コード例 #1
0
 private void button2_Click(object sender, EventArgs e)
 {
     if (MediaControl.Status() == "playing")
     {
         MediaControl.Pause();
     }
     else if (MediaControl.Status() == "paused")
     {
         MediaControl.Resume();
     }
     else if (MediaControl.Status() == "stopped")
     {
         MediaControl.Close();
         PlayMusic(curFileFullPath, true);
     }
     else
     {
         if (curIndex >= 0)
         {
             PlayMusic(curFileFullPath, true);
         }
         else
         {
             MediaControl.Close();
         }
     }
 }
コード例 #2
0
        private void button2_Click(object sender, EventArgs e)
        {
            playCount++;
            label2.Text = playCount.ToString();

            if (MediaControl.Status() != "playing")
            {
                PlayMusic(false);
            }
        }
コード例 #3
0
 private void timer1_Tick(object sender, EventArgs e)
 {
     if (MediaControl.Status() != "playing")
     {
         PlayMusic(false);
     }
     else
     {
         return;
     }
 }
コード例 #4
0
        private void button2_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Space)
            {
                playCount++;
                label2.Text = playCount.ToString();

                if (MediaControl.Status() != "playing")
                {
                    PlayMusic(false);
                }
            }
        }
コード例 #5
0
        private void PlayMusic(string musicFile, bool loop, int seekTime)
        {
            if (MediaControl.Status() == "playing" || MediaControl.Status() == "paused")
            {
                MediaControl.Close();
            }

            MediaControl.Open(musicFile);
            trackBar1.Maximum = MediaControl.Length();

            MediaControl.Play(loop, seekTime);

            PrintMusicName();
        }
コード例 #6
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            if (MediaControl.Status() == "playing" || MediaControl.Status() == "paused")
            {
                //Console.WriteLine("length : {0} ~ {1}", trackBar1.Minimum, trackBar1.Maximum);

                if (isTrackBarScroling != true)
                {
                    trackBar1.Value = MediaControl.Position();
                }
            }
            else if (MediaControl.Status() == "stopped")
            {
                trackBar1.Value = 0;
            }
        }
コード例 #7
0
        private void PlayMusic(bool loop)
        {
            MediaControl.Close();

            if (curMusicList.Count > 0 && playCount > 0)
            {
                int rand = new Random().Next(curMusicList.Count);

                curFileFullPath  = curMusicList[rand].FullName;
                curMediaFileName = curMusicList[rand].Name;

                MediaControl.Open(curFileFullPath);
                MediaControl.Play(loop);
                playCount--;

                button1.Text = curMediaFileName;
                label2.Text  = playCount.ToString();
            }
        }
コード例 #8
0
 private void trackBar1_Scroll(object sender, EventArgs e)
 {
     MediaControl.MasterVolume(trackBar1.Value);
 }
コード例 #9
0
 private void button3_Click(object sender, EventArgs e)
 {
     MediaControl.Stop();
 }