Esempio n. 1
0
void CPPageInternalFilters::ShowPPage(CPPageInternalFiltersListBox& l)
{
    int i = l.GetCurSel();
    if (i < 0) {
        return;
    }

    filter_t* f = (filter_t*)l.GetItemDataPtr(i);
    if (!f || !f->CreateInstance) {
        return;
    }

    HRESULT hr;
    CUnknown* pObj = f->CreateInstance(NULL, &hr);
    if (!pObj) {
        return;
    }

    CComPtr<IUnknown> pUnk = (IUnknown*)(INonDelegatingUnknown*)pObj;

    if (SUCCEEDED(hr)) {
        if (CComQIPtr<ISpecifyPropertyPages> pSPP = pUnk) {
            CComPropertySheet ps(ResStr(IDS_PROPSHEET_PROPERTIES), this);
            ps.AddPages(pSPP);
            ps.DoModal();
        }
    }
}
Esempio n. 2
0
BOOL CPPageInternalFilters::OnApply()
{
    UpdateData();

    CAppSettings& s = AfxGetAppSettings();

    CPPageInternalFiltersListBox* list = &m_listSrc;
    for (int l = 0; l < 2; l++) {
        for (int i = 0; i < list->GetCount(); i++) {
            filter_t* f = (filter_t*) list->GetItemDataPtr(i);

            switch (f->type) {
                case SOURCE_FILTER:
                    s.SrcFilters[f->flag] = !!list->GetCheck(i);
                    break;
                case AUDIO_DECODER:
                case VIDEO_DECODER:
                    s.TraFilters[f->flag] = !!list->GetCheck(i);
                    break;
            }
        }
        list = &m_listTra;
    }

    return __super::OnApply();
}
Esempio n. 3
0
void CPPageInternalFilters::ShowPPage(CPPageInternalFiltersListBox& l)
{
    int i = l.GetCurSel();
    if (i < 0) {
        return;
    }

    filter_t* f = (filter_t*)l.GetItemDataPtr(i);
    if (f && f->ShowPropertyPages) {
        f->ShowPropertyPages(this);
    }
}
Esempio n. 4
0
BOOL CPPageInternalFilters::OnInitDialog()
{
    __super::OnInitDialog();

    const CAppSettings& s = AfxGetAppSettings();

    m_listSrc.InsertColumn(0, _T(""));
    m_listTra.InsertColumn(0, _T(""));

    m_listSrc.SetExtendedStyle(m_listSrc.GetExtendedStyle() | LVS_EX_CHECKBOXES | LVS_EX_DOUBLEBUFFER);
    m_listTra.SetExtendedStyle(m_listTra.GetExtendedStyle() | LVS_EX_CHECKBOXES | LVS_EX_DOUBLEBUFFER);

    InitFiltersList();

    for (int i = 0; i < m_filters.GetCount(); i++) {
        CPPageInternalFiltersListBox* l;
        bool checked;

        switch (m_filters[i].type) {
            case SOURCE_FILTER:
                l = &m_listSrc;
                checked = s.SrcFilters[m_filters[i].flag];
                break;
            case AUDIO_DECODER:
            case VIDEO_DECODER:
                l = &m_listTra;
                checked = s.TraFilters[m_filters[i].flag];
                break;
            default:
                l = nullptr;
                checked = false;
        }

        if (l) {
            l->AddFilter(&m_filters[i], checked);
        }
    }

    m_listSrc.UpdateCheckState();
    m_listTra.UpdateCheckState();

    m_listSrc.SetColumnWidth(0, LVSCW_AUTOSIZE);
    m_listTra.SetColumnWidth(0, LVSCW_AUTOSIZE);

    UpdateData(FALSE);

    return TRUE;  // return TRUE unless you set the focus to a control
    // EXCEPTION: OCX Property Pages should return FALSE
}
Esempio n. 5
0
BOOL CPPageInternalFilters::OnInitDialog()
{
    __super::OnInitDialog();

    const CAppSettings& s = AfxGetAppSettings();

    for (int i = 0; i < _countof(s_filters) - 1; i++) {
        CPPageInternalFiltersListBox* l;
        bool checked;

        switch (s_filters[i].type) {
            case SOURCE_FILTER:
                l = &m_listSrc;
                checked = s.SrcFilters[s_filters[i].flag];
                break;
            case DECODER:
                l = &m_listTra;
                checked = s.TraFilters[s_filters[i].flag];
                break;
            case DXVA_DECODER:
                l = &m_listTra;
                checked = s.DXVAFilters[s_filters[i].flag];
                break;
            case FFMPEG_DECODER:
                l = &m_listTra;
                checked = s.FFmpegFilters[s_filters[i].flag];
                break;
            default:
                l = NULL;
                checked = false;
        }

        if (l) {
            l->AddFilter(&s_filters[i], checked);
        }
    }

    m_listSrc.UpdateCheckState();
    m_listTra.UpdateCheckState();

    UpdateData(FALSE);

    return TRUE;  // return TRUE unless you set the focus to a control
    // EXCEPTION: OCX Property Pages should return FALSE
}