Exemplo n.º 1
0
CPlayerInfoBar::CPlayerInfoBar(CMainFrame* pMainFrame)
    : m_pMainFrame(pMainFrame)
{
    GetEventd().Connect(m_eventc, {
        MpcEvent::DPI_CHANGED,
    }, std::bind(&CPlayerInfoBar::EventCallback, this, std::placeholders::_1));
}
Exemplo n.º 2
0
CPPageShaders::CPPageShaders()
    : CPPageBase(IDD, IDD)
    , m_bCurrentPresetChanged(false)
{
    EventRouter::EventSelection fires;
    fires.insert(MpcEvent::SHADER_LIST_CHANGED);
    GetEventd().Connect(m_eventc, fires);
}
Exemplo n.º 3
0
CPPageSheet::CPPageSheet(LPCTSTR pszCaption, IFilterGraph* pFG, CWnd* pParentWnd, UINT idPage)
    : CTreePropSheet(pszCaption, pParentWnd, 0)
    , m_bLockPage(false)
    , m_bLanguageChanged(false)
    , m_audioswitcher(pFG)
{
    EventRouter::EventSelection receives;
    receives.insert(MpcEvent::CHANGING_UI_LANGUAGE);
    GetEventd().Connect(m_eventc, receives, std::bind(&CPPageSheet::EventCallback, this, std::placeholders::_1));

    SetTreeWidth(m_dpi.ScaleX(180));
    AddPage(&m_player);
    AddPage(&m_formats);
    AddPage(&m_acceltbl);
    AddPage(&m_logo);
    AddPage(&m_webserver);
    AddPage(&m_playback);
    AddPage(&m_dvd);
    AddPage(&m_output);
    AddPage(&m_shaders);
    AddPage(&m_fullscreen);
    AddPage(&m_sync);
    AddPage(&m_tuner);
#ifndef MPCHC_LITE
    AddPage(&m_internalfilters);
#endif
    AddPage(&m_audioswitcher);
    if (SysVersion::IsVistaOrLater()) { AddPage(&m_audiorenderer); }
    AddPage(&m_externalfilters);
    AddPage(&m_subtitles);
    AddPage(&m_substyle);
    AddPage(&m_subMisc);
    AddPage(&m_tweaks);
    AddPage(&m_misc);
    AddPage(&m_advance);

    EnableStackedTabs(FALSE);

    SetTreeViewMode(TRUE, TRUE, FALSE);

    if (!idPage) {
        idPage = AfxGetAppSettings().nLastUsedPage;
    }
    if (idPage) {
        for (int i = 0; i < GetPageCount(); i++) {
            if (GetPage(i)->m_pPSP->pszTemplate == MAKEINTRESOURCE(idPage)) {
                SetActivePage(i);
                break;
            }
        }
    }
}
Exemplo n.º 4
0
CChildView::CChildView(CMainFrame* pMainFrame)
    : m_vrect(0, 0, 0, 0)
    , CMouseWnd(pMainFrame)
    , m_pMainFrame(pMainFrame)
    , m_bSwitchingFullscreen(false)
    , m_bFirstMedia(true)
{
    LoadImg();
    GetEventd().Connect(m_eventc, {
        MpcEvent::SWITCHING_TO_FULLSCREEN,
        MpcEvent::SWITCHED_TO_FULLSCREEN,
        MpcEvent::SWITCHING_FROM_FULLSCREEN,
        MpcEvent::SWITCHED_FROM_FULLSCREEN,
        MpcEvent::MEDIA_LOADED,
    }, std::bind(&CChildView::EventCallback, this, std::placeholders::_1));
}
Exemplo n.º 5
0
CPlayerSeekBar::CPlayerSeekBar(CMainFrame* pMainFrame)
    : m_pMainFrame(pMainFrame)
    , m_rtStart(0)
    , m_rtStop(0)
    , m_rtPos(0)
    , m_bEnabled(false)
    , m_bHasDuration(false)
    , m_rtHoverPos(0)
    , m_bHovered(false)
    , m_cursor(AfxGetApp()->LoadStandardCursor(IDC_HAND))
    , m_bDraggingThumb(false)
    , m_tooltipState(TOOLTIP_HIDDEN)
    , m_bIgnoreLastTooltipPoint(true)
{
    ZeroMemory(&m_ti, sizeof(m_ti));
    m_ti.cbSize = sizeof(m_ti);

    GetEventd().Connect(m_eventc, {
        MpcEvent::DPI_CHANGED,
    }, std::bind(&CPlayerSeekBar::EventCallback, this, std::placeholders::_1));
}
Exemplo n.º 6
0
CMouse::CMouse(CMainFrame* pMainFrm, bool bD3DFS/* = false*/)
    : m_bD3DFS(bD3DFS)
    , m_pMainFrame(pMainFrm)
    , m_dwMouseHiderStartTick(0)
    , m_bLeftDoubleStarted(false)
    , m_leftDoubleStartTime(0)
    , m_popupMenuUninitTime(0)
{
    m_cursors[Cursor::NONE] = nullptr;
    m_cursors[Cursor::ARROW] = LoadCursor(nullptr, IDC_ARROW);
    m_cursors[Cursor::HAND] = LoadCursor(nullptr, IDC_HAND);
    ResetToBlankState();

    EventRouter::EventSelection evs;
    evs.insert(MpcEvent::SWITCHING_TO_FULLSCREEN);
    evs.insert(MpcEvent::SWITCHED_TO_FULLSCREEN);
    evs.insert(MpcEvent::SWITCHING_TO_FULLSCREEN_D3D);
    evs.insert(MpcEvent::SWITCHED_TO_FULLSCREEN_D3D);
    evs.insert(MpcEvent::MEDIA_LOADED);
    evs.insert(MpcEvent::CONTEXT_MENU_POPUP_UNINITIALIZED);
    GetEventd().Connect(m_eventc, evs, std::bind(&CMouse::EventCallback, this, std::placeholders::_1));
}
Exemplo n.º 7
0
CDebugShadersDlg::CDebugShadersDlg()
    : CModelessDialog(IDD)
    , m_timerOneTime(this, TIMER_ONETIME_START, TIMER_ONETIME_END - TIMER_ONETIME_START + 1)
    , m_Compiler(nullptr)
{
    EventRouter::EventSelection receives;
    receives.insert(MpcEvent::SHADER_LIST_CHANGED);
    GetEventd().Connect(m_eventc, receives, std::bind(&CDebugShadersDlg::EventCallback, this, std::placeholders::_1));

    // Set window icon
    VERIFY(SetIcon(AfxGetMainWnd()->GetIcon(true), true) == nullptr);

    // Setup window auto-resize and restore last position
    SetSizeGripVisibility(FALSE);
    SetMinTrackSize(CSize(360, 100));
    AddAnchor(IDC_COMBO1, TOP_LEFT, TOP_RIGHT);
    AddAnchor((UINT)IDC_STATIC, TOP_LEFT, BOTTOM_RIGHT);
    AddAnchor(IDC_EDIT1, TOP_LEFT, BOTTOM_RIGHT);
    AddAnchor(IDC_RADIO1, TOP_RIGHT);
    AddAnchor(IDC_RADIO2, TOP_RIGHT);
    AddAnchor(IDC_RADIO3, TOP_RIGHT);
    AddAnchor(IDC_RADIO4, TOP_RIGHT);
    EnableSaveRestore(IDS_R_DEBUG_SHADERS);

    CWinApp* pApp = AfxGetApp();

    // Restore controls' old state
    m_iVersion = pApp->GetProfileInt(IDS_R_DEBUG_SHADERS, IDS_RS_DEBUG_SHADERS_LASTVERSION, ps_2_0);
    VERIFY(UpdateData(FALSE));
    CString oldpath = pApp->GetProfileString(IDS_R_DEBUG_SHADERS, IDS_RS_DEBUG_SHADERS_LASTFILE);
    if (!oldpath.IsEmpty()) {
        ASSERT(m_Shaders.GetCount() == 0);
        int sel = m_Shaders.AddString(oldpath);
        if (sel >= 0) {
            VERIFY(m_Shaders.SetCurSel(sel) != CB_ERR);
        } else {
            ASSERT(FALSE);
        }
    }

    // Put WM_PAINT message before WM_APP_RECOMPILE_SHADER
    UpdateWindow();

    // Load new shader list
    OnListRefresh();

    // We need to trigger shader compilation manually when
    // old state's selected shader is present in current shader list.
    // Otherwise it's triggered by OnListRefresh()
    int sel = m_Shaders.GetCurSel();
    if (sel != CB_ERR) {
        CString path;
        m_Shaders.GetLBText(sel, path);
        ASSERT(!path.IsEmpty());
        if (oldpath == path) {
            UpdateNotifierState();
            VERIFY(PostMessage(WM_APP_RECOMPILE_SHADER));
        }
    }

    // Display first-run dialog
    if (pApp->GetProfileInt(IDS_R_DEBUG_SHADERS, IDS_RS_DEBUG_SHADERS_FIRSTRUN, 1)) {
        CString msg;
        if (msg.LoadString(IDS_DEBUGSHADERS_FIRSTRUN_MSG)) {
            AfxMessageBox(msg, MB_ICONINFORMATION);
        } else {
            ASSERT(FALSE);
        }
        VERIFY(pApp->WriteProfileInt(IDS_R_DEBUG_SHADERS, IDS_RS_DEBUG_SHADERS_FIRSTRUN, 0));
    }
}