示例#1
0
文件: Main.cs 项目: mattpk/OSUplayer
        private void Main_Mini_Switcher_Click(object sender, EventArgs e)
        {
            Visible             = false;
            UpdateTimer.Enabled = false;
            _hotkeyHelper.UnregisterHotkeys();
            NotifySystem.RegisterClick(null);
            using (var dialog = new Mini())
            {
                dialog.ShowDialog();
            }
            NotifySystem.RegisterClick(TaskbarIconClickHandler);
            _playKey = _hotkeyHelper.RegisterHotkey(Keys.F5, KeyModifiers.Alt);
            _prevKey = _hotkeyHelper.RegisterHotkey(Keys.Left, KeyModifiers.Alt);
            _nextKey = _hotkeyHelper.RegisterHotkey(Keys.Right, KeyModifiers.Alt);
            _hotkeyHelper.OnHotkey += OnHotkey;
            Main_PlayList.SelectedIndices.Clear();
            int currentset = Core.CurrentSetIndex;

            if (currentset == -1)
            {
                currentset = 0;
            }
            Main_PlayList.SelectedIndices.Add(currentset);
            Main_PlayList.EnsureVisible(currentset);
            Main_PlayList.Focus();
            Core.SetBG();
            if (Core.Isplaying)
            {
                Main_Time_Trackbar.MaxValue = (int)Core.Durnation * 1000;
                Main_Time_Trackbar.Enabled  = true;
                UpdateTimer.Enabled         = true;
                Main_Play.Text    = LanguageManager.Get("Main_Pause_Text");
                Main_Stop.Enabled = true;
            }
            else
            {
                Main_Time_Trackbar.Enabled = false;
                UpdateTimer.Enabled        = false;
                Main_Play.Text             = LanguageManager.Get("Main_Play_Text");
                Main_Stop.Enabled          = false;
            }
            Visible = true;
        }
示例#2
0
文件: Main.cs 项目: mattpk/OSUplayer
        private void Main_Shown(object sender, EventArgs e)
        {
            CenterToScreen();
            Core.Init(Main_Main_Display.Handle, Main_Main_Display.Size);
            SetForm();
            RefreshList();
            VisibleChanged += Main_VisibleChanged;
            SizeChanged    += Main_SizeChanged;
            NotifySystem.RegisterClick(TaskbarIconClickHandler);
            Core.MainIsVisible      = true;
            _hotkeyHelper           = new HotkeyHelper(Handle);
            _playKey                = _hotkeyHelper.RegisterHotkey(Keys.F5, KeyModifiers.Alt);
            _playKey1               = _hotkeyHelper.RegisterHotkey(Keys.Play, KeyModifiers.None);
            _playKey2               = _hotkeyHelper.RegisterHotkey(Keys.Pause, KeyModifiers.None);
            _prevKey                = _hotkeyHelper.RegisterHotkey(Keys.Left, KeyModifiers.Alt);
            _prevKey1               = _hotkeyHelper.RegisterHotkey(Keys.MediaPreviousTrack, KeyModifiers.None);
            _nextKey                = _hotkeyHelper.RegisterHotkey(Keys.Right, KeyModifiers.Alt);
            _nextKey1               = _hotkeyHelper.RegisterHotkey(Keys.MediaNextTrack, KeyModifiers.None);
            _hotkeyHelper.OnHotkey += OnHotkey;

            Main_Main_Display.ResumeLayout();
        }