Beispiel #1
0
 private void btnNext_Click(object sender, RoutedEventArgs e)
 {
     this.Dispatcher.BeginInvoke(new Action(() =>
     {
         PlayController.PlayNext();
     }));
 }
Beispiel #2
0
 private void playListBox_MouseDoubleClick(object sender, MouseButtonEventArgs e)
 {
     if (PlayController.PlayIndex != playListBox.SelectedIndex)
     {
         PlayController.PlayIndex = playListBox.SelectedIndex;
         PlayController.PlayMusic();
     }
 }
Beispiel #3
0
 public MainWindow()
 {
     InitializeComponent();
     AppPropertys.mainWindow = this;
     AppPropertys.Initialize();
     PlayController.Initialize();
     LrcController.Initialize();
     LoadSongList("");
 }
Beispiel #4
0
 public MainPage(string arge)
 {
     InitializeComponent();
     AppPropertys.mainWindow = this;
     AppPropertys.Initialize();
     PlayController.Initialize();
     LrcController.Initialize(AppPropertys.appSetting.LrcFont, AppPropertys.appSetting.SkinIndex);
     LoadSongList("");
     if (arge != "")
     {
         AddFileAndPlay(arge);
     }
 }
Beispiel #5
0
        public void AddFileAndPlay(string path)
        {
            Song song = PlayController.Songs.FirstOrDefault(s => s.FileUrl.Replace(" ", "") == path);

            if (song == null)
            {
                XmlDocument xmlDoc = InitXml();
                XmlNode     root   = xmlDoc.SelectSingleNode("SongList");
                song = new Song(path, CommonProperty.getTitleFromPath(path));
                ReadInfoFromFile(song);
                root.AppendChild(CreateElement(xmlDoc, song));
                PlayController.Songs.Add(song);
                xmlDoc.Save(XmlListPath);
            }
            playListBox.ScrollIntoView(song);
            playListBox.SelectedValue = song;
            PlayController.PlayMusic(playListBox.SelectedIndex);
        }
Beispiel #6
0
        /// <summary>
        /// 应用程序响应键盘按下事件,并判断做出相关动作。
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Window_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)
        {
            Key downKey = e.Key;

            switch (downKey)
            {
            case Key.Space:
                if (PlayController.bassEng.CanPlay)
                {
                    PlayController.Play();
                }
                else
                {
                    PlayController.PlayMusic();
                }
                break;

            case Key.Left:
                PlayController.PlayPrevent();
                break;

            case Key.Right:
                PlayController.PlayNext();
                break;

            case Key.Up:
                PlayController.bassEng.Volume += 0.1;
                break;

            case Key.Down:
                PlayController.bassEng.Volume -= 0.1;
                break;

            default: break;
            }
        }
Beispiel #7
0
 private void Grid_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
 {
     PlayController.ShowSetEQ();
 }
Beispiel #8
0
 private void btn_Play(object sender, EventArgs e)
 {
     PlayController.PlayMusic();
 }
Beispiel #9
0
 public void btnMute_Click(object sender, RoutedEventArgs e)
 {
     PlayController.setMute();
 }
Beispiel #10
0
 public static void nofityPlayNext_Click(object sender, EventArgs e)
 {
     PlayController.PlayNext();
 }