Пример #1
0
 public Form1()
 {
     xml       = new xmlHandler(paths, this);
     playTrack = play;
     InitializeComponent();
     waveOutDevice = new WaveOut();
 }
Пример #2
0
 private void checkBox1_CheckedChanged(object sender, EventArgs e)   //random track playing on/off
 {
     if (checkBox1.Checked == true)
     {
         playTrack = playRandom;
     }
     else
     {
         playTrack = play;
     }
 }
Пример #3
0
    public void StartPlayingTrack(AudioSource source)
    {
        PlayTrack   playTrack = new PlayTrack(source);
        FadeInAudio fadeIn    = new FadeInAudio(source, fadeInTime, musicVolume);

        playTrack.Then(fadeIn);

        if (currentActiveSources.Count > 0)
        {
            FadeOutAudio fadeOut = null;
            for (int i = currentActiveSources.Count - 1; i >= 0; i--)
            {
                fadeOut = new FadeOutAudio(currentActiveSources[i], fadeOutTime);
                Services.TaskManager.AddTask(fadeOut);
                currentActiveSources.Remove(currentActiveSources[i]);
            }
            fadeOut.Then(playTrack);
        }
        else
        {
            Services.TaskManager.AddTask(playTrack);
        }
        currentActiveSources.Add(source);
    }