Beispiel #1
0
 public void Mute(bool mute)
 {
     Muted = mute;
     if (QuickMute.BlizzyToolbar != null)
     {
         QuickMute.BlizzyToolbar.Refresh();
     }
     if (QStockToolbar.Instance != null)
     {
         QStockToolbar.Instance.Refresh();
     }
     audioSourceMute();
     if (Muted)
     {
         SaveSettingsVolume();
         ResetSettingsVolume();
         MusicLogic.SetVolume(0);
     }
     else
     {
         LoadSavedVolume();
         ResetSavedVolume();
         MusicLogic.SetVolume(GameSettings.MUSIC_VOLUME);
     }
     Log((Muted ? "Mute" : "Unmute"));
 }
Beispiel #2
0
 private void HammerMusicMute( )
 {
     if (muted)
     {
         MusicLogic.SetVolume(0f, 0f);
     }
 }
Beispiel #3
0
        private void Start()
        {
            StartCoroutine(AttachSoundAssets());

            _originalMusicSound = GameSettings.MUSIC_VOLUME;
            MusicLogic.SetVolume(0);
        }
Beispiel #4
0
        public void Start()
        {
            Instance = this;
            music    = MusicLogic.fetch;

            preloadTimer.Elapsed += new System.Timers.ElapsedEventHandler(preloadTimer_Elapsed);

            //Utils.Log("# OS Version: " + Environment.OSVersion + ", Platform: " + Environment.OSVersion.Platform);
            //DeleteAllStock();

            DontDestroyOnLoad(gameObject);

            /*Load();
             * UnloadUnusedTracks();
             *
             * // Remove positional effects.
             * music.audio1.panLevel = 0;
             * music.audio1.dopplerLevel = 0;
             * music.audio2.panLevel = 0;
             * music.audio2.dopplerLevel = 0;*/

            UnloadStockMusicPlayer();

            /*for (int i = 0; i < Enum.GetNames(typeof(Enums.Channel)).Length; i++)
             * {
             *  Speakers[i] = new Speaker(gameObject, (Enums.Channel)i);
             * }*/

            // Set up the main audio source.
            Speaker = gameObject.AddComponent <AudioSource>();
            // Disable positional effects.
            Speaker.spatialBlend = 0;
            Speaker.dopplerLevel = 0;
            Speaker.loop         = false;
            Speaker.volume       = GameSettings.MUSIC_VOLUME;
            fader = new Fader(Speaker);

            // TODO: Change volume on unpause or main menu.

            EventManager.Instance.AddEvents();

            // Set up test playlists.
            //SoundTest soundTest = new SoundTest();
            //SoundTest.CreatePlaylists(Playlists);

            Playlists = Persistor.LoadPlaylists();
        }
        public void Start()
        {
            Instance = this;
            music    = MusicLogic.fetch;

            //Utils.Log("# OS Version: " + Environment.OSVersion + ", Platform: " + Environment.OSVersion.Platform);
            //DeleteAllStock();

            DontDestroyOnLoad(gameObject);

            //UnloadUnusedTracks();

            emptyTrack = AudioClip.Create("none", 44100, 1, 44100, false);
            UnloadStockMusicPlayer();

            /*for (int i = 0; i < Enum.GetNames(typeof(Enums.Channel)).Length; i++)
             * {
             *  Speakers[i] = new Speaker(gameObject, (Enums.Channel)i);
             * }*/

            // Set up the main audio source.
            Speaker = gameObject.AddComponent <AudioSource>();
            // Disable positional effects.
            Speaker.spatialBlend = 0;
            Speaker.dopplerLevel = 0;
            Speaker.loop         = false;
            Speaker.volume       = GameSettings.MUSIC_VOLUME;
            fader = new Fader(Speaker);

            // TODO: Change volume on unpause or main menu.

            preloadTimer          = new System.Timers.Timer();
            preloadTimer.Elapsed += new System.Timers.ElapsedEventHandler(preloadTimer_Elapsed);
            // Create a new empty audio clip to replace the stock ones when they are disabled.
            CurrentSituation = new Playlist.Prerequisites()
            {
                scene = Enums.Scenes.Loading
            };
            EventManager.Instance.AddEvents();

            // Set up test playlists.
            //SoundTest soundTest = new SoundTest();
            //SoundTest.CreatePlaylists(Playlists);
            Playlists = Persistor.LoadPlaylists();
        }
        public void Start()
        {
            Instance = this;
            music = MusicLogic.fetch;

            preloadTimer.Elapsed += new System.Timers.ElapsedEventHandler(preloadTimer_Elapsed);

            //Utils.Log("# OS Version: " + Environment.OSVersion + ", Platform: " + Environment.OSVersion.Platform);
            //DeleteAllStock();

            DontDestroyOnLoad(gameObject);

            /*Load();
            UnloadUnusedTracks();

            // Remove positional effects.
            music.audio1.panLevel = 0;
            music.audio1.dopplerLevel = 0;
            music.audio2.panLevel = 0;
            music.audio2.dopplerLevel = 0;*/

            UnloadStockMusicPlayer();

            /*for (int i = 0; i < Enum.GetNames(typeof(Enums.Channel)).Length; i++)
            {
                Speakers[i] = new Speaker(gameObject, (Enums.Channel)i);
            }*/

            // Set up the main audio source.
            Speaker = gameObject.AddComponent<AudioSource>();
            // Disable positional effects.
            Speaker.spatialBlend = 0;
            Speaker.dopplerLevel = 0;
            Speaker.loop = false;
            Speaker.volume = GameSettings.MUSIC_VOLUME;
            fader = new Fader(Speaker);

            // TODO: Change volume on unpause or main menu.

            EventManager.Instance.AddEvents();

            // Set up test playlists.
            //SoundTest soundTest = new SoundTest();
            //SoundTest.CreatePlaylists(Playlists);

            Playlists = Persistor.LoadPlaylists();
        }
Beispiel #7
0
 // Sets the music volume to 0
 public void VerifyMuted()
 {
     MusicLogic.SetVolume(0f);
 }
        public void Start()
        {
            music = MusicLogic.fetch;

            Load();
            UnloadUnusedTracks();

            // Remove positional effects.
            music.audio1.panLevel = 0;
            music.audio1.dopplerLevel = 0;
            music.audio2.panLevel = 0;
            music.audio2.dopplerLevel = 0;
        }
Beispiel #9
0
 private void OnDestroy()
 {
     audio.Stop();
     MusicLogic.SetVolume(_originalMusicSound);
 }
 //constructor
 public MusicLogicWrapper()
 {
     musicLogic = MusicLogic.fetch;
 }