public PlaylistEntryCacheable(SB_SoundPlayer player, string cond, string SndName, bool Active = true)
 {
     this.Soundplayer = player;
     this.Condition = cond;
     this.SoundName = SndName;
     this.isActive = Active;
 }
Example #2
0
        internal static void BuildSoundBank()
        {
            if (SoundBankCreated)
            {
                List<string> files = new List<string>();
                files.AddRange(Directory.GetFiles(SoundsDirectory, "*.wav"));
                files.AddRange(Directory.GetFiles(SoundsDirectory, "*.mp3"));
                files.AddRange(Directory.GetFiles(SoundsDirectory, "*.ogg"));
                files.AddRange(Directory.GetFiles(SoundsDirectory, "*.flac"));
                files.AddRange(Directory.GetFiles(SoundsDirectory, "*.mod"));
                files.AddRange(Directory.GetFiles(SoundsDirectory, "*.it"));
                files.AddRange(Directory.GetFiles(SoundsDirectory, "*.s3d"));
                files.AddRange(Directory.GetFiles(SoundsDirectory, "*.xm"));

                SoundEngine.RemoveAllSoundSources();
                dictSoundBank.Clear();
                allSoundsNames.Clear();
                foreach (string file in files)
                {
                    SB_SoundPlayer newsound = new SB_SoundPlayer(file);
                    float volume;
                    if (AdjustedVolumesDict.TryGetValue(Path.GetFileName(file), out volume))
                    {
                        newsound.Load(volume);
                    }
                    else newsound.Load();
                    dictSoundBank.Add(Path.GetFileName(file), newsound);
                    allSoundsNames.Add(Path.GetFileName(file));
                }
            }
            else
            {
                Logger.LogCritical("!!! Init before Create, no sounds loaded", THIS);
            }
        }
Example #3
0
        void InitPortedCode(string playername)
        {
            PlaylistTextFile = new TextFileObject(Path.Combine(thisNotifierDataDir, "playlist.txt"), true, false, true, false, false, false);
            LoadPlaylist();

            try
            {
                defQueueSoundPlayer = new SB_SoundPlayer(Path.Combine(ParentModule.ModuleAssetDir, "defQueueSound.ogg"));
                defQueueSoundPlayer.Load(volumeAdjust: false);
            }
            catch (Exception _e)
            {
                Logger.LogError("could not load default queue sound", this, _e);
                defQueueSoundPlayerEnabled = false;
            }
        }