Пример #1
0
        private void PlayMusic(string aFilePath)
        {
            if (componentPlaylist.musicInformationDictionary.ContainsKey(aFilePath) == true)
            {
                bool  lIsMute = player.IsMute;
                bool  lIsLoop = player.IsLoop;
                float lVolume = player.Volume;

                player = ConstructorCollection.ConstructPlayer(aFilePath);

                player.IsMute = lIsMute;
                player.IsLoop = lIsLoop;
                player.Volume = lVolume;

                componentLoopEditor.SetPlayer(player, componentPlaylist.musicInformationDictionary[aFilePath]);
                componentLoopPlayer.SetPlayer(player);
                componentLoopSelector.SetPlayMusicInformation(componentPlaylist.musicInformationDictionary[aFilePath]);
            }
            else
            {
                if (componentInputlist.musicInformationDictionary.ContainsKey(aFilePath) == true)
                {
                    IMusic               lMusic = componentInputlist.musicInformationDictionary[aFilePath].music;
                    LoopInformation      lLoop  = componentInputlist.musicInformationDictionary[aFilePath].music.Loop;
                    PlayMusicInformation l      = new PlayMusicInformation(0, false, lMusic, lLoop);

                    bool  lIsMute = player.IsMute;
                    bool  lIsLoop = player.IsLoop;
                    float lVolume = player.Volume;

                    player = ConstructorCollection.ConstructPlayer(aFilePath);

                    player.IsMute = lIsMute;
                    player.IsLoop = lIsLoop;
                    player.Volume = lVolume;

                    componentLoopEditor.SetPlayer(player, l);
                    componentLoopPlayer.SetPlayer(player);
                    componentLoopSelector.SetPlayMusicInformation(l);
                }
            }

            componentLoopEditor.UpdateMesh();
        }
Пример #2
0
 private void PlayMusic(string aFilePath)
 {
     componentPlayer.SetPlayer(aFilePath);
 }