Exemple #1
0
INT_PTR TdeinterlacePage::msgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
    switch (uMsg) {
        case WM_DESTROY:
            if (panel) {
                delete panel;
            }
            break;
        case TdeinterlacePageDScaler::WM_DSCALERPAGE_CHANGE:
            panel->storeCfg();
            break;
        case WM_COMMAND:
            switch (LOWORD(wParam)) {
                case IDC_CBX_DEINT_METHOD:
                    if (HIWORD(wParam) == CBN_SELCHANGE) {
                        int ii = cbxGetCurSel(IDC_CBX_DEINT_METHOD);
                        if (dscalerstart && ii >= dscalerstart) {
                            cfgSet(IDFF_dscalerDIflnm, diflnms[ii - dscalerstart].c_str());
                        }
                    }
                    break;
            }
            break;
    }
    return TconfPageDecVideo::msgProc(uMsg, wParam, lParam);
}
Exemple #2
0
void TresizeSettingsPage::translate(void)
{
    TconfPageBase::translate();

    int selLuma = cbxGetCurSel(IDC_CBX_RESIZE_METHOD_LUMA), selChroma = cbxGetCurSel(IDC_CBX_RESIZE_METHOD_CHROMA);
    cbxClear(IDC_CBX_RESIZE_METHOD_LUMA);
    cbxClear(IDC_CBX_RESIZE_METHOD_CHROMA);
    for (int i = 0; TresizeAspectSettings::methodsOrder[i] != -1; i++) {
        int method = TresizeAspectSettings::methodsOrder[i];
        cbxAdd(IDC_CBX_RESIZE_METHOD_LUMA  , _(IDC_CBX_RESIZE_METHOD_LUMA, TresizeAspectSettings::methodsProps[method].name), TresizeAspectSettings::methodsProps[method].id);
        if (TresizeAspectSettings::methodsProps[method].library == TresizeAspectSettings::LIB_SWSCALER) {
            cbxAdd(IDC_CBX_RESIZE_METHOD_CHROMA, _(IDC_CBX_RESIZE_METHOD_CHROMA, TresizeAspectSettings::methodsProps[method].name), TresizeAspectSettings::methodsProps[method].id);
        }
    }
    cbxSetCurSel(IDC_CBX_RESIZE_METHOD_LUMA, selLuma);
    cbxSetCurSel(IDC_CBX_RESIZE_METHOD_CHROMA, selChroma);
}
Exemple #3
0
void Twindow::cbxTranslate(int id,const char_t **list)
{
    int sel=cbxGetCurSel(id);
    cbxClear(id);
    for (int i=0; list[i]; i++) {
        cbxAdd(id,_(id,list[i]));
    }
    cbxSetCurSel(id,sel);
}
INT_PTR TquantTablesPageBase::msgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
    switch (uMsg) {
        case WM_COMMAND:
            if (HIWORD(wParam)==EN_CHANGE && !isSetWindowText) {
                HWND hed=GetDlgItem(m_hwnd,LOWORD(wParam));
                if (hed!=GetFocus()) {
                    return FALSE;
                }
                repaint(hed);
                TwidgetMatrix *item=(TwidgetMatrix*)Twidget::getDlgItem(hed);
                if (item->id) {
                    int valI;
                    if (eval(hed,1,255,&valI)) {
                        uint8_t *intra8,*inter8,*intra4Y,*inter4Y,*intra4C,*inter4C;
                        getCustomQuantMatrixes(&intra8,&inter8,&intra4Y,&inter4Y,&intra4C,&inter4C);
                        uint8_t *intra,*inter;
                        switch (cbxGetCurSel(IDC_CBX_QUANT_TABLE)) {
                            case 1:
                                intra=intra4Y;
                                inter=inter4Y;
                                break;
                            case 2:
                                intra=intra4C;
                                inter=inter4C;
                                break;
                            default:
                                intra=intra8;
                                inter=inter8;
                                break;
                        }
                        (item->intra?intra:inter)[item->id-1]=(uint8_t)valI;
                        setChange();
                    }
                }
                return TRUE;
            }
            break;
        case WM_CTLCOLOREDIT: {
            HWND hwnd=HWND(lParam);
            if (hwnd==GetDlgItem(m_hwnd,IDC_CBX_QUANT_TABLE)) {
                break;
            }
            bool ok=eval(hwnd,1,255);
            if (!ok) {
                HDC dc=HDC(wParam);
                SetBkColor(dc,RGB(255,0,0));
                return INT_PTR(getRed());
            } else {
                return FALSE;
            }
        }
    }
    return Twindow::msgProc(uMsg,wParam,lParam);
}
Exemple #5
0
void TffdshowPageDec::fillPresetsCbx(void)
{
    int sel = cbxGetCurSel(IDC_CBX_PRESETS);
    cbxClear(IDC_CBX_PRESETS);
    for (Tpresets::iterator i = localPresets->begin(); i != localPresets->end(); i++) {
        cbxAdd(IDC_CBX_PRESETS, (*i)->presetName);
    }
    char_t presetName[MAX_PATH];
    deciD->getActivePresetName(presetName, MAX_PATH);
    cbxSetCurSel(IDC_CBX_PRESETS, cbxFindItem(IDC_CBX_PRESETS, presetName, true));
}
void TquantTablesPageBase::translate(void)
{
    Twindow::translate();

    int sel=cbxGetCurSel(IDC_CBX_QUANT_TABLE);
    cbxClear(IDC_CBX_QUANT_TABLE);
    for (int i=0; matrices[i]; i++) {
        cbxAdd(IDC_CBX_QUANT_TABLE,_(IDC_CBX_QUANT_TABLE,matrices[i]));
    }
    cbxSetCurSel(IDC_CBX_QUANT_TABLE,sel==CB_ERR?0:sel);
}
void TquantTablesPageBase::table2dlg(void)
{
    uint8_t *intra8,*inter8,*intra4Y,*inter4Y,*intra4C,*inter4C;
    getCustomQuantMatrixes(&intra8,&inter8,&intra4Y,&inter4Y,&intra4C,&inter4C);
    const int *idIntra,*idInter;
    uint8_t *intra,*inter;
    int cnt;
    switch (cbxGetCurSel(IDC_CBX_QUANT_TABLE)) {
        case 1:
            idIntra=idIntra4;
            idInter=idInter4;
            intra=intra4Y;
            inter=inter4Y;
            cnt=16;
            break;
        case 2:
            idIntra=idIntra4;
            idInter=idInter4;
            intra=intra4C;
            inter=inter4C;
            cnt=16;
            break;
        default:
            idIntra=idIntra8;
            idInter=idInter8;
            intra=intra8;
            inter=inter8;
            cnt=64;
            break;
    }
    enable(0,idIntra8);
    enable(0,idInter8);
    for (int i=0; i<cnt; i++) {
        if (intra) {
            edLimitText(idIntra[i],3);
            SetDlgItemInt(m_hwnd,idIntra[i],intra[i],FALSE);
            ((TwidgetMatrix*)Twidget::getDlgItem(GetDlgItem(m_hwnd,idIntra[i])))->set(true ,i+1);
        } else {
            edReadOnly(idIntra[i],true);
        }
        if (inter) {
            edLimitText(idInter[i],3);
            SetDlgItemInt(m_hwnd,idInter[i],inter[i],FALSE);
            ((TwidgetMatrix*)Twidget::getDlgItem(GetDlgItem(m_hwnd,idInter[i])))->set(false,i+1);
        } else {
            edReadOnly(idInter[i],true);
        }
    }
    enable(1,cnt==64?idIntra8:idIntra4);
    enable(1,cnt==64?idInter8:idInter4);
    enable(codecId==CODEC_ID_H264,IDC_ED_QUANT_TABLE_INTRA1);
}
void TdeinterlacePageYadif::init(void)
{
    translate();

    int sel=cbxGetCurSel(IDC_CBX_YADIF_PARITY);
    cbxClear(IDC_CBX_YADIF_PARITY);
    for (int i = 0 ; TdeinterlaceSettings::yadifParitySEs[i].name ; i++)
        cbxAdd(IDC_CBX_YADIF_PARITY,
               _(IDC_CBX_YADIF_PARITY,
                 TdeinterlaceSettings::yadifParitySEs[i].name),
               TdeinterlaceSettings::yadifParitySEs[i].id);
    cbxSetCurSel(IDC_CBX_YADIF_PARITY,sel);
}
Exemple #9
0
void TinPage::translate(void)
{
    TconfPageEnc::translate();

    int ii=cbxGetCurSel(IDC_CBX_INCSP);
    cbxClear(IDC_CBX_INCSP);
    cbxAdd(IDC_CBX_INCSP,_(IDC_CBX_INCSP,_l("all YUV")),FOURCC_MASK_YUV);
    cbxAdd(IDC_CBX_INCSP,_(IDC_CBX_INCSP,_l("all RGB")),FOURCC_MASK_RGB);
    for (int i=0; cspFccs[i].name; i++) {
        cbxAdd(IDC_CBX_INCSP,cspFccs[i].name,cspFccs[i].fcc);
    }
    cbxSetCurSel(IDC_CBX_INCSP,ii);
}
Exemple #10
0
void TdeinterlacePage::fillDeinterlacers(void)
{
    int ii = cbxGetCurSel(IDC_CBX_DEINT_METHOD);
    cbxClear(IDC_CBX_DEINT_METHOD);

    int i;
    for (i = 0; TdeinterlaceSettings::methodProps[i].name; i++)
        if (!(TdeinterlaceSettings::methodProps[i].id == TdeinterlaceSettings::FRAMERATEDOUBLER && !(Tconfig::cpu_flags & FF_CPU_MMXEXT)) && TdeinterlaceSettings::methodProps[i].id != TdeinterlaceSettings::DSCALER) {
            cbxAdd(IDC_CBX_DEINT_METHOD, _(IDC_CBX_DEINT_METHOD, TdeinterlaceSettings::methodProps[i].name), TdeinterlaceSettings::methodProps[i].cfgId);
        }

    const char_t *dscalerDir = cfgGetStr(IDFF_dscalerPath);
    if (!dscalerDir || !dscalerDir[0]) {
        dscalerstart = 0;
        return;
    }
    char_t dsmask[MAX_PATH];
    _makepath_s(dsmask, MAX_PATH, NULL, dscalerDir, _l("DI_*"), _l("dll"));
    strings dis;
    findFiles(dsmask, dis, true);
    dscalerstart = i - 1;
    diflnms.clear();
    for (strings::const_iterator di = dis.begin(); di != dis.end(); di++) {
        char_t flnm[MAX_PATH];
        extractfilename(di->c_str(), flnm);
        if (stricmp(flnm, _l("DI_Adaptive.dll")) != 0) {
            char_t diname[256];
            Tdscaler_DI didll(di->c_str(), deci, true);
            if (didll.fm) {
                tsnprintf_s(diname, countof(diname), _TRUNCATE, _l("DScaler: %s"), (const char_t*)text<char_t>(didll.fm->szName));
                cbxAdd(IDC_CBX_DEINT_METHOD, diname, 9);
                diflnms.push_back(*di);
            }
        }
    }
    cbxSetCurSel(IDC_CBX_DEINT_METHOD, ii);
}
INT_PTR TsubtitlesTextPage::msgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
    switch (uMsg) {
        case WM_COMMAND:
            switch (LOWORD(wParam)) {
                case IDC_ED_SUB_MINDURATION:
                    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_SUB_MINDURATION: {
                                static const int idffmins[]= {IDFF_subMinDurationSub,IDFF_subMinDurationLine,IDFF_subMinDurationChar};
                                eval(hed,1,3600000,idffmins[cbxGetCurSel(IDC_CBX_SUB_MINDURATION)]);
                                break;
                            }
                        }
                        return TRUE;
                    }
                    break;
                case IDC_CHB_SUBFIX_AP:
                case IDC_CHB_SUBFIX_IL:
                case IDC_CHB_SUBFIX_PUNCTUATION:
                case IDC_CHB_SUBFIX_ORTOGRAPHY:
                case IDC_CHB_SUBFIX_CAPITAL:
                case IDC_CHB_SUBFIX_NUMBERS:
                case IDC_CHB_SUBFIX_HEARING: {
                    int fix=0;
                    if (getCheck(IDC_CHB_SUBFIX_AP         )) {
                        fix|=TtextFixBase::fixAP;
                    }
                    if (getCheck(IDC_CHB_SUBFIX_IL         )) {
                        fix|=TtextFixBase::fixIl;
                    }
                    if (getCheck(IDC_CHB_SUBFIX_PUNCTUATION)) {
                        fix|=TtextFixBase::fixPunctuation;
                    }
                    if (getCheck(IDC_CHB_SUBFIX_ORTOGRAPHY )) {
                        fix|=TtextFixBase::fixOrtography;
                    }
                    if (getCheck(IDC_CHB_SUBFIX_CAPITAL    )) {
                        fix|=TtextFixBase::fixCapital;
                    }
                    if (getCheck(IDC_CHB_SUBFIX_NUMBERS    )) {
                        fix|=TtextFixBase::fixNumbers;
                    }
                    if (getCheck(IDC_CHB_SUBFIX_HEARING    )) {
                        fix|=TtextFixBase::fixHearingImpaired;
                    }
                    cfgSet(IDFF_subFix,fix);
                    fix2dlg();
                    break;
                }
            }
            break;
        case WM_CTLCOLOREDIT: {
            HWND hwnd=HWND(lParam);
            bool ok;
            switch (getId(hwnd)) {
                case IDC_ED_SUB_MINDURATION:
                    ok=eval(hwnd,1,3600000);
                    break;
                default:
                    return FALSE;
            }
            if (!ok) {
                HDC dc=HDC(wParam);
                SetBkColor(dc,RGB(255,0,0));
                return INT_PTR(getRed());
            } else {
                return FALSE;
            }
        }
    }
    return TconfPageDecVideo::msgProc(uMsg,wParam,lParam);
}
Exemple #12
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);
}