예제 #1
0
        public static int PlaySound(ESounds Sound)
        {
            string file = Path.Combine(Environment.CurrentDirectory, CSettings.sFolderSounds);

            switch (Sound)
            {
            case ESounds.T440:
                file = Path.Combine(file, CSettings.sSoundT440);
                break;

            default:
                break;
            }

            if (file == String.Empty)
            {
                return(-1);
            }

            int   stream = CSound.Load(file);
            float length = CSound.GetLength(stream);

            CSound.Play(stream);
            CSound.FadeAndStop(stream, 100f, length);
            return(stream);
        }
예제 #2
0
 public static void Play()
 {
     if (CConfig.BackgroundMusic == EOffOn.TR_CONFIG_ON)
     {
         if (_AllFileNames.Count > 0)
         {
             if (_CurrentMusicStream != -1)
             {
                 CSound.Fade(_CurrentMusicStream, CConfig.BackgroundMusicVolume, CSettings.BackgroundMusicFadeTime);
                 CSound.Play(_CurrentMusicStream);
                 _Playing = true;
             }
             else
             {
                 Next();
             }
         }
     }
 }
예제 #3
0
        public static void Play()
        {
            if (_Playing)
            {
                return;
            }

            if (CConfig.BackgroundMusic == EOffOn.TR_CONFIG_ON)
            {
                if (_AllFileNames.Count > 0)
                {
                    if (_CurrentMusicStream != -1)
                    {
                        CSound.Fade(_CurrentMusicStream, 100f, CSettings.BackgroundMusicFadeTime);
                        CSound.Play(_CurrentMusicStream);
                        if (_VideoEnabled && _Video != -1)
                        {
                            CVideo.VdResume(_Video);
                        }
                        _Playing = true;
                    }
                    else
                    {
                        Next();
                    }

                    if (!IsBackgroundFile(_CurrentPlaylistElement))
                    {
                        _CanSing = true;
                    }
                    else
                    {
                        _CanSing = false;
                    }
                }
            }
        }
예제 #4
0
파일: CMain.cs 프로젝트: da-ka/Vocaluxe
 public void Play(int soundStream)
 {
     CSound.Play(soundStream);
 }