コード例 #1
0
        public void Sound(ToggleButton btn)
        {
            Ad_name.Adres("select name from music where id=" + Convert.ToString(btn.Name.ToString()[4]));
            name = Ad_name.muzic_name;

            if (btn_n != btn)
            {
                if (output != null)
                {
                    output.Stop();
                    output.Dispose();
                }
                gg(name);
                output.Play();
                btn_n = btn;
                del_(false);
            }
            else if (btn_n == btn)
            {
                if (output != null)
                {
                    output.Stop();
                    stream.Dispose();
                    output.Dispose();
                    output = null;
                }
                else if (output == null)
                {
                    gg(name);
                    output.Play();
                }
            }
        }
コード例 #2
0
 private void DisposeWave()
 {
     if (output != null)
     {
         if (output.PlaybackState == NAudio.Wave.PlaybackState.Playing) output.Stop();
         output.Dispose();
         output = null;
     }
     if (stream != null)
     {
         stream.Dispose();
         stream = null;
     }
 }
コード例 #3
0
 private void DisposeWave()
 {
     //dispose of song from stream. To ensure no memory leaks
     if (stream == null)
     {
         txtNowPlaying.Text = "Nothing to stop...";
     }
     if (output != null)
     {
         if (output.PlaybackState == NAudio.Wave.PlaybackState.Playing)
         {
             output.Stop();
         }
         output.Dispose();
         output = null;
     }
     if (stream != null)
     {
         stream.Dispose();
         stream = null;
     }
 }
コード例 #4
0
ファイル: Form1.cs プロジェクト: Chausiku32/Multimedia
        public void DisposeWave()
        {
            if (output != null)
            {
                if (output.PlaybackState == NAudio.Wave.PlaybackState.Playing)
                {
                    output.Stop();
                }
                output.Dispose();
                output = null;
            }

            if (wave != null)
            {
                wave.Dispose();
                wave = null;
            }

            if (stream != null)
            {
                stream.Dispose();
                stream = null;
            }
        }