Exemplo n.º 1
0
void TffdshowPageEnc::codec2dlg(void)
{
    codecId = (AVCodecID)cfgGet(IDFF_enc_codecId);
    SendDlgItemMessage(m_hwnd, IDC_CBX_FOURCC, CB_RESETCONTENT, 0, 0);
    int cnt = cbxGetItemCount(IDC_CBX_ENCODER);
    for (int i = 0; i < cnt; i++)
        if (((Tencoder*)cbxGetItemData(IDC_CBX_ENCODER, i))->id == codecId) {
            cbxSetCurSel(IDC_CBX_ENCODER, i);
            const Tencoder *enc;
            deciE->getEncoder(codecId, &enc);
            if (enc) {
                for (Tfourccs::const_iterator f = enc->fourccs.begin(); f != enc->fourccs.end(); f++) {
                    char fccs[5] = "1234";
                    memcpy(fccs, &*f, 4);
                    if (fccs[0]) {
                        cbxAdd(IDC_CBX_FOURCC, text<char_t>(fccs), *f);
                    }
                }
                static const int idFourcc[] = {IDC_LBL_FOURCC, IDC_CBX_FOURCC, 0};
                if (cbxGetItemCount(IDC_CBX_FOURCC) == 0) {
                    enable(false, idFourcc);
                } else {
                    enable(true, idFourcc);
                    fourcc2dlg();
                }
                SendDlgItemMessage(m_hwnd, IDC_CBX_MODES, CB_RESETCONTENT, 0, 0);
                if (sup_CBR(codecId) && codecId != AV_CODEC_ID_MJPEG) {
                    cbxAdd(IDC_CBX_MODES, _(IDC_CBX_MODES, encModeNames[ENC_MODE::CBR]), ENC_MODE::CBR);
                }
                if (sup_VBR_QUAL(codecId)) {
                    cbxAdd(IDC_CBX_MODES, _(IDC_CBX_MODES, encModeNames[ENC_MODE::VBR_QUAL]), ENC_MODE::VBR_QUAL);
                }
                if (sup_VBR_QUANT(codecId)) {
                    cbxAdd(IDC_CBX_MODES, _(IDC_CBX_MODES, encModeNames[ENC_MODE::VBR_QUANT]), ENC_MODE::VBR_QUANT);
                }
                static const int idModes[] = {IDC_LBL_MODES, IDC_CBX_MODES, 0};
                enable(cbxGetItemCount(IDC_CBX_MODES) != 0, idModes);
                qmin = TcoSettings::getMinMaxQuant(codecId).first;
                qmax = TcoSettings::getMinMaxQuant(codecId).second;
                quick2dlg(true);
            }
            return;
        }
}
Exemplo n.º 2
0
void TffdshowPageEnc::fourcc2dlg(void)
{
    FOURCC fourcc = cfgGet(IDFF_enc_fourcc);
    int cnt = cbxGetItemCount(IDC_CBX_FOURCC);
    for (int i = 0; i < cnt; i++)
        if ((FOURCC)cbxGetItemData(IDC_CBX_FOURCC, i) == fourcc) {
            cbxSetCurSel(IDC_CBX_FOURCC, i);
            return;
        }
    cbxSetCurSel(IDC_CBX_FOURCC, 0);
    cfgSet(IDFF_enc_fourcc, (int)cbxGetItemData(IDC_CBX_FOURCC, 0));
}
Exemplo n.º 3
0
void TffdshowPageEnc::quick2dlg(bool redraw)
{
    static const int idQuickAll[] = {IDC_LBL_ENCODER, IDC_CBX_ENCODER, IDC_LBL_FOURCC, IDC_CBX_FOURCC, IDC_LBL_MODES, IDC_CBX_MODES, IDC_LBL_QUICK, IDC_TBR_QUICK, IDC_ED_QUICK, 0};
    if (isAbout) {
        enable(false, idQuickAll);
        return;
    }
    int mode = cfgGet(IDFF_enc_mode);
    int ii = cbxFindItemData(IDC_CBX_MODES, mode);
    if (ii == CB_ERR && cbxGetItemCount(IDC_CBX_MODES) > 0) {
        ii = 0;
        mode = (int)cbxGetItemData(IDC_CBX_MODES, 0);
        cfgSet(IDFF_enc_mode, mode);
    };
    cbxSetCurSel(IDC_CBX_MODES, ii);
    static const int idQuick[] = {IDC_LBL_QUICK, IDC_ED_QUICK, IDC_TBR_QUICK, 0};
    if (ii != CB_ERR) {
        if (redraw || oldmode != mode) {
            oldmode = mode;
            const char_t *text = _l("");
            valMin = 0;
            valMax = 0;
            valIdff = 0;
            switch (oldmode) {
                case ENC_MODE::CBR:
                    text = _l("Bitrate (kbps)");
                    valIdff = IDFF_enc_bitrate1000;
                    valMin = 1;
                    valMax = 10000;
                    break;
                case ENC_MODE::VBR_QUAL:
                    text = _l("Quality");
                    valIdff = IDFF_enc_qual;
                    valMin = 0;
                    valMax = 100;
                    break;
                case ENC_MODE::VBR_QUANT:
                    text = _l("Quantizer");
                    valIdff = IDFF_enc_quant;
                    valMin = qmin;
                    valMax = qmax;
                    break;
            }
            setDlgItemText(m_hwnd, IDC_LBL_QUICK, _(IDC_LBL_QUICK, text));
            tbrSetRange(IDC_TBR_QUICK, valMin, valMax, (valMax - valMin) / 10);
        }
        if (valIdff) {
            enable(1, idQuick);
            int val = cfgGet(valIdff);
            if (!isIn(val, valMin, valMax)) {
                val = limit(val, valMin, valMax);
                cfgSet(valIdff, val);
            }
            tbrSet(IDC_TBR_QUICK, val);
            SetDlgItemInt(m_hwnd, IDC_ED_QUICK, val, FALSE);
        } else {
            enable(0, idQuick);
            tbrSet(IDC_TBR_QUICK, 0);
            setDlgItemText(m_hwnd, IDC_ED_QUICK, _l(""));
        }
    } else {
        enable(0, idQuick);
    }

    if (page && redraw) {
        selectPage(page);
    }
    if (isGraph) {
        enable(false, idQuickAll);
    }
}
Exemplo n.º 4
0
void TdeinterlacePage::getTip(char_t *tipS, size_t len)
{
    tsnprintf_s(tipS, len, _TRUNCATE, _l("Method: %s"), cbxGetItemCount(IDC_CBX_DEINT_METHOD) ? cbxGetCurText(IDC_CBX_DEINT_METHOD) : _l("DScaler"));
}