示例#1
0
void ToutsfsPage::dlg2compatmode(void)
{
    if (!warningShowed) {
        MessageBox(hwndParent, _l("Changing this parameter should only be done if your card (like asus xonar) support HD audio bitstream but doesn't work with FFDShow (auzentech xfi not supported)"), _l("Caution"), 0);
    }
    warningShowed = 1;
    // If in compatibility mode publish a PCM format to enable connection (the format will be dynamically changed after the connection)
    if (cbxGetCurItemData(IDC_CBX_OUT_PASSTHROUGH_DEVICEID) == 0) {
        setCheck(IDC_CHB_PASSTHROUGH_PCM_CONNECT, 0);
    } else {
        setCheck(IDC_CHB_PASSTHROUGH_PCM_CONNECT, 1);
    }
}
示例#2
0
INT_PTR TdlgMiscPage::msgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
    switch (uMsg) {
        case WM_COMMAND:
            switch (LOWORD(wParam)) {
                case IDC_CHB_DLG_SHOWHINTS:
                    parent->enableHints(!!getCheck(IDC_CHB_DLG_SHOWHINTS));
                    return TRUE;
                case IDC_CBX_LANG:
                    if (HIWORD(wParam) == CBN_SELCHANGE) {
                        const char_t *newlang = cbxGetCurText(IDC_CBX_LANG);
                        if (newlang[0]) {
                            int langint = (int)cbxGetCurItemData(IDC_CBX_LANG);
                            if (langint == 20554/*JP*/ || langint == 16714/*JA*/)
#ifdef UNICODE
                                langint = 16714; // JA Unicode
#else
                                langint = 20554; // JP ANSI
#endif
                            Twindow::cfgSet(IDFF_lang, text<char_t>((const char*)&langint));
                            parent->translate();
                        }
                        return TRUE;
                    }
                    break;
                case IDC_BT_PATH_DSCALER:
                    if (HIWORD(wParam) == BN_CLICKED) {
                        if (changeDir(IDFF_dscalerPath, _(-IDD_DLGMISC, _l("Select directory with installed DScaler")))) {
                            paths2dlg();
                        }
                        return TRUE;
                    }
                    break;
                case IDC_BT_PATH_FFDSHOW:
                    if (HIWORD(wParam) == BN_CLICKED) {
                        if (changeDir(IDFF_installPath, _(-IDD_DLGMISC, _l("Select ffdshow instalation directory")))) {
                            paths2dlg();
                        }
                        return TRUE;
                    }
                    break;
            }
            break;
    }
    return TconfPageBase::msgProc(uMsg, wParam, lParam);
}
示例#3
0
INT_PTR TffdshowPageEnc::msgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
    switch (uMsg) {
        case WM_HSCROLL:
            if (HWND(lParam) == GetDlgItem(m_hwnd, IDC_TBR_QUICK)) {
                if (valIdff) {
                    cfgSet(valIdff, tbrGet(IDC_TBR_QUICK));
                    quick2dlg(false);
                }
                return TRUE;
            }
            break;
        case WM_FFONCHANGE:
            if (wParam == IDFF_lang && ve) {
                ve->commonOptionChanged(IID_IffdshowEnc, IDFF_lang);
            }
            break;
        case WM_COMMAND:
            switch (LOWORD(wParam)) {
                case IDC_CBX_ENCODER:
                    if (HIWORD(wParam) == CBN_SELCHANGE) {
                        cfgSet(IDFF_enc_codecId, ((Tencoder*)cbxGetCurItemData(IDC_CBX_ENCODER))->id);
                        codec2dlg();
                        HTREEITEM hti = TreeView_GetSelection(htv);
                        if (hti) {
                            selectPage(hti2page(hti));
                        }
                        return TRUE;
                    }
                    break;
                case IDC_CBX_FOURCC:
                    if (HIWORD(wParam) == CBN_SELCHANGE) {
                        cfgSet(IDFF_enc_fourcc, (int)cbxGetCurItemData(IDC_CBX_FOURCC));
                        fourcc2dlg();
                        return TRUE;
                    }
                    break;
                case IDC_CBX_MODES:
                    if (HIWORD(wParam) == CBN_SELCHANGE) {
                        cfgSet(IDFF_enc_mode, (int)cbxGetCurItemData(IDC_CBX_MODES));
                        quick2dlg(true);
                        return TRUE;
                    }
                    break;
                case IDC_ED_QUICK:
                    if (HIWORD(wParam) == EN_CHANGE && !isSetWindowText) {
                        HWND hed = GetDlgItem(m_hwnd, LOWORD(wParam));
                        if (hed != GetFocus()) {
                            return FALSE;
                        }
                        repaint(hed);
                        switch (LOWORD(wParam)) {
                            case IDC_ED_QUICK:
                                eval(hed, valMin, valMax, valIdff);
                                tbrSet(IDC_TBR_QUICK, cfgGet(valIdff));
                                break;
                        }
                        return TRUE;
                    }
                    break;
                case IDC_BT_PRESET:
                    if (HIWORD(wParam) == BN_CLICKED) {
                        showPresets();
                        return TRUE;
                    }
                    break;
                case IDC_CHB_NOT_REGISTRY:
                    cfgSet(IDFF_notreg, getCheck(IDC_CHB_NOT_REGISTRY));
                    return TRUE;
            }
            break;
        case WM_CTLCOLOREDIT: {
            HWND hwnd = HWND(lParam);
            bool ok;
            switch (getId(hwnd)) {
                case IDC_ED_QUICK:
                    ok = eval(hwnd, valMin, valMax);
                    break;
                default:
                    return FALSE;
            }
            if (!ok) {
                HDC dc = HDC(wParam);
                SetBkColor(dc, RGB(255, 0, 0));
                return INT_PTR(getRed());
            } else {
                return FALSE;
            }
        }
        case WM_DRAWITEM:
            if (wParam == IDC_CBX_ENCODER) {
                DRAWITEMSTRUCT *dis = (DRAWITEMSTRUCT*)lParam;
                COLORREF crOldTextColor = GetTextColor(dis->hDC);
                COLORREF crOldBkColor = GetBkColor(dis->hDC);
                HBRUSH br;
                if ((dis->itemAction | ODA_SELECT) && (dis->itemState & ODS_SELECTED)) {
                    SetTextColor(dis->hDC, GetSysColor(COLOR_HIGHLIGHTTEXT));
                    SetBkColor(dis->hDC, GetSysColor(COLOR_HIGHLIGHT));
                    br = CreateSolidBrush(GetSysColor(COLOR_HIGHLIGHT));
                } else {
                    br = CreateSolidBrush(crOldBkColor);
                }
                FillRect(dis->hDC, &dis->rcItem, br);
                if (int(dis->itemData) != CB_ERR) {
                    RECT r = dis->rcItem;
                    r.left += 2;
                    Tencoder *enc = (Tencoder*)dis->itemData;
                    DrawText(dis->hDC, enc->name, (int)strlen(enc->name), &r, DT_LEFT | DT_SINGLELINE | DT_VCENTER);
                    setDlgResult(TRUE);
                    r.left += 180;
                    FillRect(dis->hDC, &r, br);
                    MoveToEx(dis->hDC, r.left, r.top, NULL);
                    LineTo(dis->hDC, r.left, r.bottom);
                    SetTextColor(dis->hDC, GetSysColor(COLOR_GRAYTEXT));
                    r.left += 4;
                    char_t text[70];
                    SendMessage(hcbxE, CB_GETLBTEXT, dis->itemID, LPARAM(text));
                    DrawText(dis->hDC, text, (int)strlen(text), &r, DT_LEFT | DT_SINGLELINE | DT_VCENTER);
                }
                SetTextColor(dis->hDC, crOldTextColor);
                SetBkColor(dis->hDC, crOldBkColor);
                DeleteObject(br);
                return TRUE;
            }
            break;
    }
    return TffdshowPageBase::msgProc(uMsg, wParam, lParam);
}
示例#4
0
INT_PTR Twindow::msgProc(UINT uMsg,WPARAM wParam,LPARAM lParam)
{
    switch (uMsg) {
        case WM_INITDIALOG:
            resizeDialog();
            init();
            //subClass();
            break;
        case WM_DESTROY: {
            THWNDs wnds;
            getChildWindows(m_hwnd,wnds);
            for (THWNDs::const_iterator wnd=wnds.begin(); wnd!=wnds.end(); wnd++) {
                ::Twidget *item=Twidget::getDlgItem(*wnd);
                if (item) {
                    item->restore();
                    delete item;
                }
            }
            ::Twidget *item=Twidget::getDlgItem(m_hwnd);
            if (item) {
                item->restore();
                delete item;
            }
            if (red) {
                DeleteObject(red);
            }
            red=NULL;
            break;
        }
        case WM_HSCROLL:
            if (onTrack(bindsHtrack,lParam)) {
                return TRUE;
            }
            break;
        case WM_VSCROLL:
            if (onTrack(bindsVtrack,lParam)) {
                return TRUE;
            }
            break;
        case WM_COMMAND: {
            if (bindsCheckbox)
                for (int i=0; bindsCheckbox[i].idc; i++)
                    if (bindsCheckbox[i].idc==LOWORD(wParam)) {
                        if (bindsCheckbox[i].idff<0) {
                            cfgSet(-bindsCheckbox[i].idff,!getCheck(LOWORD(wParam)));
                        } else {
                            cfgSet(bindsCheckbox[i].idff,getCheck(LOWORD(wParam)));
                        }
                        if (bindsCheckbox[i].onClick) {
                            (this->*bindsCheckbox[i].onClick)();
                        }
                        return TRUE;
                    }
            if (bindsRadiobutton)
                for (int i=0; bindsRadiobutton[i].idc; i++)
                    if (bindsRadiobutton[i].idc==LOWORD(wParam) && getCheck(LOWORD(bindsRadiobutton[i].idc))) {
                        cfgSet(bindsRadiobutton[i].idff,bindsRadiobutton[i].val);
                        if (bindsRadiobutton[i].onClick) {
                            (this->*bindsRadiobutton[i].onClick)();
                        }
                        return TRUE;
                    }
            if (bindsButton)
                if (HIWORD(wParam)==BN_CLICKED) // works also for static
                    for (int i=0; bindsButton[i].idc; i++)
                        if (bindsButton[i].idc==LOWORD(wParam) && bindsButton[i].onClick) {
                            (this->*bindsButton[i].onClick)();
                            return TRUE;
                        }
            if (HIWORD(wParam)==EN_CHANGE && !isSetWindowText) {
                if (LOWORD(wParam)==IDC_ED_HELP && tr->translateMode) {
                    onEditChange();
                }
                if (bindsEditInt)
                    for (int i=0; bindsEditInt[i].idc; i++)
                        if (bindsEditInt[i].idc==LOWORD(wParam)) {
                            HWND hed=GetDlgItem(m_hwnd,bindsEditInt[i].idc);
                            if (hed!=GetFocus()) {
                                return FALSE;
                            }
                            repaint(hed);
                            eval(hed,bindsEditInt[i].min,bindsEditInt[i].max,bindsEditInt[i].idff);
                            if (bindsEditInt[i].onClick) {
                                (this->*bindsEditInt[i].onClick)();
                            }
                            return TRUE;
                        }
                if (bindsEditReal)
                    for (int i=0; bindsEditReal[i].idc; i++)
                        if (bindsEditReal[i].idc==LOWORD(wParam)) {
                            HWND hed=GetDlgItem(m_hwnd,bindsEditReal[i].idc);
                            if (hed!=GetFocus()) {
                                return FALSE;
                            }
                            repaint(hed);
                            eval(hed,bindsEditReal[i].min,bindsEditReal[i].max,bindsEditReal[i].idff,bindsEditReal[i].mult);
                            if (bindsEditReal[i].onClick) {
                                (this->*bindsEditReal[i].onClick)();
                            }
                            return TRUE;
                        }
            } else if (HIWORD(wParam)==CBN_SELCHANGE) {
                if (bindsCombobox)
                    for (int i=0; bindsCombobox[i].idc; i++)
                        if (bindsCombobox[i].idc==LOWORD(wParam)) {
                            switch (bindsCombobox[i].mode) {
                                case BINDCBX_DATA:
                                    cfgSet(bindsCombobox[i].idff,(int)cbxGetCurItemData(bindsCombobox[i].idc));
                                    break;
                                case BINDCBX_SEL:
                                    cfgSet(bindsCombobox[i].idff,cbxGetCurSel(bindsCombobox[i].idc));
                                    break;
                                case BINDCBX_TEXT:
                                    cfgSet(bindsCombobox[i].idff,cbxGetCurText(bindsCombobox[i].idc));
                                    break;
                                case BINDCBX_DATATEXT:
                                    cfgSet(bindsCombobox[i].idff,(const char_t*)cbxGetCurItemData(bindsCombobox[i].idc));
                                    break;
                            }
                            if (bindsCombobox[i].onClick) {
                                (this->*bindsCombobox[i].onClick)();
                            }
                            return TRUE;
                        }
            }
            break;
        }
        case WM_CTLCOLOREDIT:
            if (bindsEditInt)
                if (onCtlColorEdit(bindsEditInt,lParam,wParam)) {
                    return INT_PTR(getRed());
                }
            if (bindsEditReal)
                if (onCtlColorEdit(bindsEditReal,lParam,wParam)) {
                    return INT_PTR(getRed());
                }
            break;
    }
    return defMsgProc(uMsg,wParam,lParam);
}
示例#5
0
INT_PTR TcodecsPage::msgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
    switch (uMsg) {
        case WM_DESTROY:
            cfgSet(IDFF_lvCodecsWidth0,ListView_GetColumnWidth(hlv,0));
            cfgSet(IDFF_lvCodecsWidth1,ListView_GetColumnWidth(hlv,1));
            cfgSet(IDFF_lvCodecsWidth2,ListView_GetColumnWidth(hlv,2));
            cfgSet(IDFF_lvCodecsSelected,lvGetSelItem(IDC_LV_INCODECS));
            break;
        case WM_COMMAND:
            switch (LOWORD(wParam)) {
                case IDC_CBX_INCODECS:
                    if (HIWORD(wParam)==CBN_SELCHANGE && IsWindowVisible(hcbx)) {
                        int ii=lvGetSelItem(IDC_LV_INCODECS);
                        int idff=formats[ii].idff;
                        cfgSet(idff,(int)cbxGetCurItemData(IDC_CBX_INCODECS));
                        options2dlg(ii);
                        return TRUE;
                    }
                    break;
                case IDC_CHB_CODEC_OPT1:
                case IDC_CHB_CODEC_OPT2:
                case IDC_CHB_CODEC_OPT3:
                case IDC_CHB_CODEC_OPT4:
                    dlg2options(LOWORD(wParam));
                    return TRUE;
            }
            break;
        case WM_NOTIFY: {
            NMHDR *nmhdr=LPNMHDR(lParam);
            if (nmhdr->hwndFrom==hlv && nmhdr->idFrom==IDC_LV_INCODECS)
                switch (nmhdr->code) {
                    case LVN_GETDISPINFO: {
                        NMLVDISPINFO *nmdi=(NMLVDISPINFO*)lParam;
                        int i=nmdi->item.iItem;
                        if (i==-1) {
                            break;
                        }
                        if (nmdi->item.mask&LVIF_TEXT)
                            switch (nmdi->item.iSubItem) {
                                case 0:
                                    strcpy(nmdi->item.pszText,_(IDC_LV_INCODECS,formats[i].descr));
                                    break;
                                case 1:
                                    strcpy(nmdi->item.pszText,_(IDC_LV_INCODECS,formats[i].getDecoderName(cfgGet(formats[i].idff))));
                                    break;
                                case 2:
                                    strcpy(nmdi->item.pszText,_(IDC_LV_INCODECS,formats[i].hint));
                                    break;
                            }
                        return TRUE;
                    }
                    case LVN_GETINFOTIP: {
                        NMLVGETINFOTIP *nmit=(NMLVGETINFOTIP*)lParam;
                        if (nmit->iItem!=-1 && nmit->iSubItem==0) {
                            ff_strncpy(nmit->pszText,formats[nmit->iItem].hint,nmit->cchTextMax);
                        }
                        return TRUE;
                    }
                    case LVN_ITEMCHANGED: {
                        NMLISTVIEW *nmlv=LPNMLISTVIEW(lParam);
                        if (nmlv->iItem!=curitem) {
                            curitem=-1;
                            show(false,IDC_CBX_INCODECS);
                            options2dlg(nmlv->iItem);
                        }
                        return TRUE;
                    }
                    case NM_CLICK: {
                        NMITEMACTIVATE *nmia=LPNMITEMACTIVATE(lParam);
                        if (nmia->iItem!=-1 && nmia->iSubItem==1) {
                            beginCodecChange(nmia->iItem);
                        } else {
                            show(false,IDC_CBX_INCODECS);
                        }
                        return TRUE;
                    }
                }
            break;
        }
    }
    return TconfPageBase::msgProc(uMsg,wParam,lParam);
}