Exemplo n.º 1
0
        private void doAction(QActionType Action)
        {
            if (!Locked)
            {
                actionHandler.RequestAction(Action);
                switch (Action)
                {
                case QActionType.PlaySelectedTracks:
                case QActionType.Pause:
                    frmGlobalInfoBox.Show(controller, frmGlobalInfoBox.ActionType.PlayPause);
                    break;

                case QActionType.Stop:
                    frmGlobalInfoBox.Show(controller, frmGlobalInfoBox.ActionType.Stop);
                    break;

                case QActionType.Next:
                    frmGlobalInfoBox.Show(controller, frmGlobalInfoBox.ActionType.Next);
                    break;

                case QActionType.Previous:
                    frmGlobalInfoBox.Show(controller, frmGlobalInfoBox.ActionType.Previous);
                    break;

                case QActionType.VolumeUp:
                    frmGlobalInfoBox.Show(controller, frmGlobalInfoBox.ActionType.VolumeUp);
                    break;

                case QActionType.VolumeDown:
                    frmGlobalInfoBox.Show(controller, frmGlobalInfoBox.ActionType.VolumeDown);
                    break;
                }
            }
        }
Exemplo n.º 2
0
 private void clearMessage()
 {
     message    = String.Empty;
     msgTick    = long.MaxValue;
     lastAction = QActionType.None;
     this.Invalidate();
 }
Exemplo n.º 3
0
 public QAction(QActionType Type, string Value, string AltValue)
 {
     this.Type     = Type;
     this.Track    = null;
     this.Value    = Value;
     this.AltValue = AltValue;
 }
Exemplo n.º 4
0
 public void RequestAction(QActionType ActionType)
 {
     if (ActionType == QActionType.ToggleGamepadHelp)
     {
         this.Close();
     }
     else
     {
         showAction(ActionType);
     }
 }
Exemplo n.º 5
0
        private void showHelpByMouse(int X, int Y, bool Alt)
        {
            int         lengthSquared = Int32.MaxValue;
            QActionType type          = QActionType.None;

            int x = X - imageRect.X;
            int y = Y - imageRect.Y;

            int dist;

            foreach (KeyValuePair <QActionType, Point> kvp in padLocations)
            {
                dist = (((kvp.Value.X - x) * (kvp.Value.X - x)) + ((kvp.Value.Y - y) * (kvp.Value.Y - y)));
                if (lengthSquared > dist || (Alt && lengthSquared == dist))
                {
                    lengthSquared = dist;
                    type          = kvp.Key;
                }
            }
            if (lengthSquared < 700)
            {
                showAction(type);
            }
        }
Exemplo n.º 6
0
        public void RequestAction(QActionType Type)
        {
            switch (Type)
            {
            case QActionType.MoveDown:
            case QActionType.MoveTracksDown:
            case QActionType.PageDown:
                txtDescription.FirstVisibleYPixel += 20;
                break;

            case QActionType.SelectNextItemGamePadRight:
                txtDescription.FirstVisibleYPixel += 5;
                break;

            case QActionType.MoveUp:
            case QActionType.MoveTracksUp:
            case QActionType.PageUp:
                txtDescription.FirstVisibleYPixel -= 20;
                break;

            case QActionType.SelectPreviousItemGamePadRight:
                txtDescription.FirstVisibleYPixel -= 5;
                break;

            case QActionType.SelectNextItemGamePadLeft:
            case QActionType.SelectPreviousItemGamePadLeft:
            case QActionType.ReleaseAllFilters:
            case QActionType.ReleaseCurrentFilter:
            case QActionType.NextFilter:
            case QActionType.PreviousFilter:
                // suppress
                break;

            case QActionType.HTPCMode:
                controller.RequestActionNoRedirect(QActionType.HTPCMode);
                setViewMode();
                break;

            case QActionType.AdvanceScreen:
            case QActionType.AdvanceScreenWithoutMouse:
            case QActionType.ShowTrackAndAlbumDetails:
                if (currentTrack == null)
                {
                    // no reason to stay here
                    controller.RequestActionNoRedirect(QActionType.AdvanceScreen);
                }
                else
                {
                    switch (View)
                    {
                    case AlbumDetailView.Lyrics:
                        if (currentTrack.Album.Length == 0)
                        {
                            this.View = AlbumDetailView.ArtistInfo;
                        }
                        else
                        {
                            this.View = AlbumDetailView.AlbumInfo;
                        }
                        break;

                    case AlbumDetailView.AlbumInfo:
                        this.View = AlbumDetailView.ArtistInfo;
                        break;

                    case AlbumDetailView.ArtistInfo:
                        this.View = AlbumDetailView.Lyrics;         // for when we come back
                        controller.RequestActionNoRedirect(QActionType.AdvanceScreen);
                        if (currentTrack != null)
                        {
                            Clock.DoOnNewThread(updateLyrics, 30);
                        }
                        break;
                    }
                }
                break;

            default:
                controller.RequestActionNoRedirect(Type);
                break;
            }
        }
Exemplo n.º 7
0
 public void RequestAction(QAction Action)
 {
     showAction(Action.Type);
     lastAction = Action.Type;
 }
Exemplo n.º 8
0
 private void showAction(QActionType ActionType)
 {
     showMessage(QAction.GetHelp(ActionType));
     lastAction = ActionType;
 }
Exemplo n.º 9
0
        public void RequestAction(QActionType Type)
        {
            switch (Type)
            {
            case QActionType.Play:
            case QActionType.PlaySelectedTracks:
            case QActionType.PlayThisAlbum:
                if (lvwEpisodes.SelectedItem != null && lvwEpisodes.SelectedItem.Playable)
                {
                    controller.Play(lvwEpisodes.SelectedItem);
                }
                break;

            case QActionType.MoveTracksDown:
            case QActionType.PageDown:
                pageDown();
                break;

            case QActionType.MoveDown:
            case QActionType.SelectNextItemGamePadRight:
                moveDown();
                break;

            case QActionType.MoveTracksUp:
            case QActionType.PageUp:
                pageUp();
                break;

            case QActionType.MoveUp:
            case QActionType.SelectPreviousItemGamePadRight:
                moveUp();
                break;

            case QActionType.Home:
                home();
                break;

            case QActionType.End:
                end();
                break;

            case QActionType.MoveLeft:
                break;

            case QActionType.MoveRight:
                break;

            case QActionType.FocusSearchBox:
                break;

            case QActionType.ExportPlaylist:
                break;

            case QActionType.FindPlayingTrack:
                findPlayingTrack();
                break;

            case QActionType.EditTags:
                showSubscriptionEditPanel(lvwSubscriptions.SelectedItem);
                break;

            default:
                controller.RequestActionNoRedirect(Type);
                break;
            }
        }
Exemplo n.º 10
0
        private IntPtr HookCallback(int nCode, IntPtr wParam, ref KBDLLHOOKSTRUCT lParam)
        {
            if (nCode < 0)
            {
                return(CallNextHookEx(hookID, nCode, wParam, ref lParam));
            }

            bool doAction = (wParam == (IntPtr)WM_KEYUP);
            bool done     = false;

            action      = QActionType.None;
            popupAction = frmGlobalInfoBox.ActionType.None;

            switch (lParam.vkCode)
            {
            case 160:
            case 161:
                controller.NotifyShift();
                break;

            case VK_MEDIA_NEXT_TRACK:
                if (doAction)
                {
                    action      = QActionType.Next;
                    popupAction = frmGlobalInfoBox.ActionType.Next;
                }
                done = true;
                break;

            case VK_MEDIA_PREV_TRACK:
                if (doAction)
                {
                    action      = QActionType.Previous;
                    popupAction = frmGlobalInfoBox.ActionType.Previous;
                }
                done = true;
                break;

            case VK_MEDIA_STOP:
                if (doAction)
                {
                    action      = QActionType.Stop;
                    popupAction = frmGlobalInfoBox.ActionType.Stop;
                }
                done = true;
                break;

            case VK_MEDIA_PLAY_PAUSE:
                if (doAction)
                {
                    action      = QActionType.PlayPause;
                    popupAction = frmGlobalInfoBox.ActionType.PlayPause;
                }
                done = true;
                break;

            case VK_VOLUME_UP:
                if (doAction && controller.LocalVolumeControl && controller.Playing)
                {
                    action      = QActionType.VolumeUp;
                    popupAction = frmGlobalInfoBox.ActionType.VolumeUp;
                    done        = true;
                }
                break;

            case VK_VOLUME_DOWN:
                if (doAction && controller.LocalVolumeControl && controller.Playing)
                {
                    action      = QActionType.VolumeDown;
                    popupAction = frmGlobalInfoBox.ActionType.VolumeDown;
                    done        = true;
                }
                break;

            default:
                doAction = false;
                break;
            }

            if (action != QActionType.None)
            {
                controller.RequestAction(action);
            }
            if (popupAction != frmGlobalInfoBox.ActionType.None)
            {
                frmGlobalInfoBox.Show(controller, popupAction);
            }

            if (done)
            {
                return((IntPtr)1);
            }
            else
            {
                return(CallNextHookEx(hookID, nCode, wParam, ref lParam));
            }
        }
Exemplo n.º 11
0
        public void RequestAction(QActionType Type)
        {
            switch (Type)
            {
            case QActionType.Play:
            case QActionType.PlaySelectedTracks:
            case QActionType.PlayThisAlbum:
                InvokeSelectedStation();
                break;

            case QActionType.MoveTracksDown:
            case QActionType.PageDown:
                PageDown();
                break;

            case QActionType.MoveDown:
            case QActionType.SelectNextItemGamePadRight:
                MoveDown();
                break;

            case QActionType.MoveTracksUp:
            case QActionType.PageUp:
                PageUp();
                break;

            case QActionType.MoveUp:
            case QActionType.SelectPreviousItemGamePadRight:
                MoveUp();
                break;

            case QActionType.Home:
                home();
                break;

            case QActionType.End:
                end();
                break;

            case QActionType.MoveLeft:
                genrePanel.Focus();
                break;

            case QActionType.MoveRight:
                stationPanel.Focus();
                break;

            case QActionType.FocusSearchBox:
                txtFilter.Focus();
                break;

            case QActionType.ExportPlaylist:
                break;

            case QActionType.FindPlayingTrack:
                SelectedStation = playingStation;
                ensureSelectedStationVisible();
                break;

            case QActionType.EditTags:
                editStationDetails();
                break;

            case QActionType.SelectNextItemGamePadLeft:
                genrePanel.ChangeFilterIndex(1);
                break;

            case QActionType.SelectPreviousItemGamePadLeft:
                genrePanel.ChangeFilterIndex(-1);
                break;

            case QActionType.ReleaseAllFilters:
            case QActionType.ReleaseCurrentFilter:
                txtFilter.Text   = String.Empty;
                genrePanel.Value = String.Empty;
                populateStations();
                ensureSelectedStationVisible();
                break;

            case QActionType.NextFilter:
            case QActionType.PreviousFilter:
            case QActionType.LoadFilterValues:
            case QActionType.Next:
            case QActionType.Previous:
            case QActionType.PlaySelectedTrackNext:
            case QActionType.PlayRandomAlbum:
            case QActionType.ScanBack:
            case QActionType.ScanFwd:
            case QActionType.SelectAll:
            case QActionType.SelectNone:
            case QActionType.InvertSelection:
            case QActionType.Shuffle:
            case QActionType.AdvanceSortColumn:
            case QActionType.RepeatToggle:
            case QActionType.ExportCSV:
            case QActionType.ExportCurrentView:
            case QActionType.PlayFirstTrack:
            case QActionType.RequestNextTrack:
            case QActionType.ShowFileDetails:
            case QActionType.ShowFilterIndex:
                // suppress
                break;

            default:
                controller.RequestActionNoRedirect(Type);
                break;
            }
        }
Exemplo n.º 12
0
 public static string GetHelp(QActionType Type)
 {
     return(actionHelp[Type]);
 }
Exemplo n.º 13
0
 public QAction(QActionType Type, Track Track)
 {
     this.Type  = Type;
     this.Track = Track;
     this.Value = String.Empty;
 }
Exemplo n.º 14
0
 public QAction(QActionType Type)
 {
     this.Type  = Type;
     this.Track = null;
     this.Value = String.Empty;
 }