public void SetParameter(GameParameter parameter)
        {
            CurrentParameter = parameter;

            // Set map
            MapAssetStore = new MapAssetStore(parameter.Map, SoundTable);
        }
Exemple #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;
        }
Exemple #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));
         }
     }
 }
        public void InvokeHardInit()
        {
            IsPlaying = false;

            OnHardInit?.Invoke();

            // Load map hitsounds only if enabled in configuration.
            if (GameConfiguration.UseBeatmapHitsounds.Value)
            {
                Model.AddAsLoader(MapAssetStore.LoadHitsounds());
            }
        }
        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();
        }