Exemplo n.º 1
0
        public void SetParameter(GameParameter parameter)
        {
            CurrentParameter = parameter;

            // Set map
            MapAssetStore = new MapAssetStore(parameter.Map, SoundTable);
        }
Exemplo n.º 2
0
        public PlayableHitsound(MapAssetStore assetStore, SampleControlPoint samplePoint, List <SoundInfo> samples,
                                ISoundPool soundPool)
        {
            this.soundTable = assetStore.SoundTable;
            this.soundPool  = soundPool;

            hitsoundAudio.AddRange(ExtractAudio(assetStore, samples));

            volume = samplePoint.Volume;
        }
Exemplo n.º 3
0
 private IEnumerable <IEffectAudio> ExtractAudio(MapAssetStore assetStore, List <SoundInfo> samples)
 {
     foreach (var sample in samples)
     {
         var effectName = sample.LookupNames.FirstOrDefault(n => assetStore.SoundTable.Contains(n));
         if (effectName != null)
         {
             yield return(assetStore.SoundTable.GetAudio(effectName));
         }
     }
 }
Exemplo n.º 4
0
        public void InvokeHardInit()
        {
            IsPlaying = false;

            OnHardInit?.Invoke();

            // Load map hitsounds only if enabled in configuration.
            if (GameConfiguration.UseBeatmapHitsounds.Value)
            {
                Model.AddAsLoader(MapAssetStore.LoadHitsounds());
            }
        }
Exemplo n.º 5
0
        public void InvokeHardDispose()
        {
            IsPlaying = false;

            CurrentParameter = null;

            // Before destroying custom hitsounds in the asset store, they must first be unmounted from the sound pool.
            SoundPool.UnmountAll();
            MapAssetStore.Dispose();
            MapAssetStore = null;

            OnHardDispose?.Invoke();
        }