Пример #1
0
/*****************************Private*Routine******************************\
* VideoCd_OnCommand
*
\**************************************************************************/
void
VideoCd_OnCommand(
    HWND hwnd,
    int id,
    HWND hwndCtl,
    UINT codeNotify
    )
{
    switch(id)
    {
        case IDM_FILE_OPEN:
            if(VcdPlayerOpenCmd())
                VcdPlayerPlayCmd();
            break;

        case IDM_FILE_CLOSE:
            VcdPlayerCloseCmd();
            QzFreeUnusedLibraries();
            break;

        case IDM_FILE_ABOUT:
            DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX),
                hwnd,  (DLGPROC) AboutDlgProc);
            break;

        case IDM_FILE_EXIT:
            PostMessage(hwnd, WM_CLOSE, 0, 0L);
            break;

        case IDM_MOVIE_PLAY:
            VcdPlayerPlayCmd();
            break;

        case IDM_MOVIE_STOP:
            VcdPlayerStopCmd();
            VcdPlayerRewindCmd();
            break;

        case IDM_MOVIE_PAUSE:
            VcdPlayerPauseCmd();
            break;

        case IDM_FULL_SCREEN:
            if(pMpegMovie)
            {
                BOOL bFullScreen = (BOOL)SendMessage(g_hwndToolbar,
                    TB_ISBUTTONCHECKED, IDM_FULL_SCREEN, 0);
                SetFullScreenMode(bFullScreen);
            }
            break;
    }

    SetPlayButtonsEnableState();
}
Пример #2
0
/*****************************Private*Routine******************************\
* VideoCd_OnCommand
*
\**************************************************************************/
void
VideoCd_OnCommand(
    HWND hwnd,
    int id,
    HWND hwndCtl,
    UINT codeNotify
    )
{
    switch(id)
    {
        case IDM_FILE_OPEN:
            if(VcdPlayerOpenCmd())
                VcdPlayerPlayCmd();
            break;

        case IDM_FILE_CLOSE:
            VcdPlayerCloseCmd();
            QzFreeUnusedLibraries();
            break;

        case IDM_FILE_EXIT:
            PostMessage(hwnd, WM_CLOSE, 0, 0L);
            break;

        case IDM_MOVIE_PLAY:
            VcdPlayerPlayCmd();
            break;

        case IDM_MOVIE_STOP:
            VcdPlayerStopCmd();
            VcdPlayerRewindCmd();
            break;

        case IDM_MOVIE_PAUSE:
            VcdPlayerPauseCmd();
            break;

        case IDM_MOVIE_SKIP_FORE:
            VcdPlayerSeekCmd(1.0);
            break;

        case IDM_MOVIE_SKIP_BACK:
            VcdPlayerSeekCmd(-1.0);
            break;

        case IDM_MOVIE_PREVTRACK:
            if(pMovie)
            {
                VcdPlayerSeekCmd(-pMovie->GetCurrentPosition());
            }
            break;

        case IDM_MOVIE_STEP:
            VcdPlayerPauseCmd();
            VcdPlayerStepCmd();
            break;

        case IDM_TIME:
        case IDM_FRAME:
        case IDM_FIELD:
        case IDM_SAMPLE:
        case IDM_BYTES:
            if(pMovie)
            {
                g_TimeFormat = VcdPlayerChangeTimeFormat(id);
            }
            break;

        case IDM_HELP_ABOUT:
            DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX),
                hwnd,  (DLGPROC) AboutDlgProc);
            break;

        default:
            if(id > ID_RECENT_FILE_BASE
                && id <= (ID_RECENT_FILE_BASE + MAX_RECENT_FILES + 1))
            {
                ProcessOpen(aRecentFiles[id - ID_RECENT_FILE_BASE - 1]);
                VcdPlayerPlayCmd();
            }
            break;
    }

    SetPlayButtonsEnableState();
}