| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 395 人关注过本帖
标题:C# 实现播发器淡入淡出
只看楼主 加入收藏
helloliyao
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2014-5-6
结帖率:0
收藏
已结贴  问题点数:20 回复次数:1 
C# 实现播发器淡入淡出
要实现淡入淡出功能,有个listview里有歌曲和需要淡入淡出,切入切出的时间。然后实现淡入淡出,还有切入切出,一开始播放就播放歌曲的副歌部分,副歌放完立即停止播放。
private void timer1_Tick(object sender, EventArgs e)
        {
            string t = DateTime.Now.ToLongTimeString().ToString();
            this.textBox1.Text = t.ToString();
            for (int i = 0; i < listView1.Items.Count; i++)

                if (this.textBox1.Text == this.listView1.Items.SubItems[1].Text)
                 {

                     axWindowsMediaPlayer1.URL = listView1.Items.SubItems[3].Text;

                     axWindowsMediaPlayer1.Ctlcontrols.play();

                  //  this.timer1.Enabled = false;
                     timer2.Enabled = true;

                  }
         }   

         }
 //下面想实现淡入淡出,根本不行啊
         private void timer2_Tick_1(object sender, EventArgs e)
         {
             for (int x = 0; x < listView1.Items.Count; x++)
             if (axWindowsMediaPlayer1.playState == WMPLib.WMPPlayState.wmppsPlaying)
             {
                 if (axWindowsMediaPlayer1.settings.volume > 70)

                     axWindowsMediaPlayer1.settings.volume = axWindowsMediaPlayer1.settings.volume - 1;

                 if (axWindowsMediaPlayer1.settings.volume < 0)

                     axWindowsMediaPlayer1.settings.volume = axWindowsMediaPlayer1.settings.volume + 1;



                  timer2.Enabled =false ;

             }
         }
 //下面想实现切入
         private void timer3_Tick(object sender, EventArgs e)
          {
              for (int y= 0; y< listView1.Items.Count; y++)
                  if (listView1.Items[y].SubItems[4].Text != null)
                  if (axWindowsMediaPlayer1.playState == WMPLib.WMPPlayState.wmppsPlaying)
                      {

                          axWindowsMediaPlayer1.Ctlcontrols.currentPosition = Convert.ToDouble(listView1.Items[y].SubItems[4].Text);
                          timer3.Enabled = false;
                          timer4.Enabled = true;
                      }
          }

         private double ToDouble(string p)
         {
             throw new NotImplementedException();
         }
 //下面想实现切出
        private void timer4_Tick(object sender, EventArgs e)
         {
             for (int z = 0; z < listView1.Items.Count; z++)
                  if (listView1.Items[z].SubItems[5].Text != null)
                      if (axWindowsMediaPlayer1.Ctlcontrols.currentPosition ==Convert .ToDouble ( listView1.Items[z].SubItems[5].Text))
                      {   
                          axWindowsMediaPlayer1.Ctlcontrols.stop();
                          timer4.Enabled = false;

                      }
搜索更多相关主题的帖子: 歌曲 private 
2014-05-06 23:22
xydddaxia
Rank: 11Rank: 11Rank: 11Rank: 11
等 级:贵宾
威 望:33
帖 子:466
专家分:2307
注 册:2009-3-20
收藏
得分:20 
axWindowsMediaPlayer1.settings.volume 只会维持在70吧,你的代码

站在春哥的肩膀上
2014-05-07 09:44
快速回复:C# 实现播发器淡入淡出
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.041696 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved