Пример #1
0
void TvolumePage::init(void)
{
    deciD->queryFilterInterface(IID_IaudioFilterVolume, (void**)&filter);
    for (int i = 0; i < countof(mutes); i++) {
        addHint(mutes[i], _l("mute"));
        addHint(solos[i], _l("solo"));
        SendDlgItemMessage(m_hwnd, pbrs[i], PBM_SETRANGE, 0, MAKELPARAM(0, 50));
    }
    addHint(IDC_CHB_NORMALIZE_REGAINVOLUME, _l("Unchecked: one-pass normalization will be performed.\n(this mode is used to reach the highest possible loudness\nwith minimum of possible artifacts)\n\nChecked: dynamic range compression will be performed.\n(quieter parts will be amplified more than louder parts,\nalso known as night mode)"));
    switchDb();
}
Пример #2
0
void TDXVAOptionsPage::init(void)
{
    const TvideoCodecDec *movie;
    deciV->getMovieSource(&movie);
    int source=movie?movie->getType():0;
    islavc=((filterMode&IDFF_FILTERMODE_PLAYER) && (source==IDFF_MOVIE_LAVC || source==IDFF_MOVIE_FFMPEG_MT ||source==IDFF_MOVIE_FFMPEG_DXVA)) || (filterMode&(IDFF_FILTERMODE_CONFIG|IDFF_FILTERMODE_VFW));
    addHint(IDC_GRP_DXVA2,_l("Enabling DXVA on those codecs will disable all FFDShow internal filters (subtitles, resize,...)"));
    addHint(IDC_CHB_H264,_l("Enable DXVA on H264 codec. Prior the H264/AVC codec must be enabled in the codec section"));
    addHint(IDC_CHB_VC1,_l("Enable DXVA on VC1 codec. Prior the H264/AVC codec must be enabled in the codec section"));
    cfg2dlg();
}
Пример #3
0
void ToutsfsPage::init(void)
{
    for (int i = 0; i < countof(ac3bitrates); i++) {
        char_t s[30];
        cbxAdd(IDC_CBX_OUT_AC3, _itoa(ac3bitrates[i], s, 10), ac3bitrates[i]);
    }
    Tlibavcodec *lavc;
    deci->getLibavcodec(&lavc);
    static const int ac3s[] = {IDC_CHB_OUT_AC3, IDC_LBL_OUT_AC3, IDC_CBX_OUT_AC3, IDC_CHB_AOUT_AC3ENCODE_MODE, 0};
    enable(lavc && lavc->ok, ac3s);
    if (lavc) {
        lavc->Release();
    }

    setCheck(IDC_CHB_PASSTHROUGH_PCM_CONNECT  , cfgGet(IDFF_aoutpassthroughPCMConnection) == 1);

    addHint(IDC_CHB_OUT_AC3, _l("Will encode the output stream to AC3 format. AC3 encoder currently supports the following sample rates: 32kHz and 48kHz.\nother sample rates should be resampled to one of the supported sample rates,\nthis can be done using the \"Resample\" filter."));
    addHint(IDC_CHB_ALWAYEXTENSIBLE, _l("\"not needed\": no custom channel mapping"));
    addHint(IDC_CHB_ALLOWOUTSTREAM, _l("Useful for directly storing encoded ac3 to a file in graphedt with File Writer filter"));
    addHint(IDC_CHB_PASSTHROUGH_EAC3, _l("Performs a Dolby Digital Plus (EAC3) bitstream if your HT receiver supports it."));
    addHint(IDC_CHB_PASSTHROUGH_TRUEHD, _l("Performs a Dolby TrueHD bitstream if your HT receiver supports it."));
    addHint(IDC_CHB_PASSTHROUGH_DTSHD, _l("Performs a DTS HD bitstream if your HT receiver supports it."));
    addHint(IDC_CBX_OUT_PASSTHROUGH_DEVICEID, _l("Change this parameter only if your card does not support the official media types"));
    addHint(IDC_CHB_PASSTHROUGH_PCM_CONNECT, _l("Some renderers need that the connection is done on PCM (uncompressed) format first then it would switch to bitstream. If checked then FFDShow will assume that your receiver supports the bitstream formats you checked"));
    warningShowed = 0;
}
Пример #4
0
void TdecoderOptionsPage::init(void)
{
    const TvideoCodecDec *movie;
    deciV->getMovieSource(&movie);
    int source = movie ? movie->getType() : 0;
    islavc = ((filterMode & IDFF_FILTERMODE_PLAYER) && (source == IDFF_MOVIE_LAVC || source == IDFF_MOVIE_FFMPEG_DXVA)) || (filterMode & (IDFF_FILTERMODE_CONFIG | IDFF_FILTERMODE_VFW));
    for (int i = 0; workarounds[i].ff_bug; i++) {
        enable(islavc, workarounds[i].idc_chb);
    }
    static const int idLavc[] = {IDC_LBL_IDCT, IDC_CBX_IDCT, IDC_LBL_BUGS, IDC_BT_QUANTMATRIX_EXPORT, IDC_ED_NUMTHREADS, IDC_CHB_H264_SKIP_ON_DELAY, IDC_ED_H264SKIP_ON_DELAY_TIME, IDC_LBL_NUMTHREADS, 0};
    enable(islavc, idLavc);
    addHint(IDC_ED_NUMTHREADS, _l("For libavcodec H.264, MPEG-1/2, FFV1, and DV decoders"));
    addHint(IDC_CHB_SOFT_TELECINE, _l("Checked: If soft telecine is detected, frames are flagged as progressive.\n\nYou may want to unckeck if you have interlaced TV."));
}
Пример #5
0
void TgenericHuffyuvPage::init(void)
{
    for (int i = 0; TcoSettings::huffYUVcsps[i]; i++) {
        cbxAdd(IDC_CBX_HUFFYUV_CSP, TcoSettings::huffYUVcsps[i]);
    }
    addHint(IDC_CHB_HUFFYUV_CTX, _l("Better compression, incompatible with original HuffYUV codec"));
}
Пример #6
0
void TsubtitlesTextPage::cfg2dlg()
{
    split2dlg();
    linespacing2dlg();
    min2dlg();
    fix2dlg();
    memory2dlg();
    addHint(IDC_ED_SUB_MEMORY,L"ffdshow rasterize the font in the background and store the images in this buffer.\nIf the memory capacity is small, 10MB may help.");
}
Пример #7
0
void TresizeBordersPage::init(void)
{
    tbrSetRange(IDC_TBR_BORDER_HORIZ_PERCENT, 0, 100, 10);
    tbrSetRange(IDC_TBR_BORDER_VERT_PERCENT , 0, 100, 10);
    tbrSetRange(IDC_TBR_BORDER_HORIZ_PIXELS, 0, 300, 16);
    tbrSetRange(IDC_TBR_BORDER_VERT_PIXELS , 0, 300, 16);
    tbrSetRange(IDC_TBR_BORDER_HORIZ_DIV , 0, 100, 10);
    tbrSetRange(IDC_TBR_BORDER_VERT_DIV , 0, 100, 10);
    tbrSetRange(IDC_TBR_BORDER_BRIGHTNESS , 0, 255, 10);

    addHint(IDC_TBR_BORDER_BRIGHTNESS, _l("Brightness x is interpreted as RGB(x,x,x) and converted to luma using the settings in RGB conversion page, if necessary."));
}
Пример #8
0
void TavisynthPage::init(void)
{
    helpURL = _l("http://ffdshow-tryout.sourceforge.net/wiki/video:avisynth");

    static const TanchorInfo ainfo[] = {
        IDC_GRP_AVISYNTH, TanchorInfo::LEFT | TanchorInfo::RIGHT | TanchorInfo::BOTTOM | TanchorInfo::TOP,
        IDC_BT_AVISYNTH_LOAD, TanchorInfo::RIGHT | TanchorInfo::TOP,
        IDC_BT_AVISYNTH_SAVE, TanchorInfo::RIGHT | TanchorInfo::TOP,
        IDC_ED_AVISYNTH, TanchorInfo::LEFT | TanchorInfo::RIGHT | TanchorInfo::BOTTOM | TanchorInfo::TOP,
        0, 0
    };

    anchors.init(ainfo, *this);

    edLimitText(IDC_ED_AVISYNTH_BUF_BACK, 2);
    edLimitText(IDC_ED_AVISYNTH_BUF_AHEAD, 2);
    edLimitText(IDC_ED_AVISYNTH, MAX_AVISYNTH_SCRIPT_LENGTH);

    addHint(IDC_ED_AVISYNTH_BUF_AHEAD, _l("Number of frames to buffer ahead"));
    addHint(IDC_ED_AVISYNTH_BUF_BACK, _l("Number of used frames to keep in buffer"));
}
Пример #9
0
void ChatView::add(const Message &msg)
{
  if (!msg.isValid())
    return;

  QVariantMap data = msg.data();
  data[LS("Hint")] = addHint(msg);

  m_messagesQueue.append(data);
  if (m_loaded && m_messagesQueue.size() == 1)
    QTimer::singleShot(0, this, SLOT(startTasks()));
}
Пример #10
0
void TdlgMiscPage::init(void)
{
    for (Ttranslate::Tlanglist::const_iterator i = tr->langlist.begin(); i != tr->langlist.end(); i++) {
        char_t desc[256];
        tr->langlist.getLangName(i, desc, 256);
        cbxAdd(IDC_CBX_LANG, desc, Ttranslate::lang2int(i->first.c_str()));
    }
    edLimitText(IDC_ED_PATH_FFDSHOW, MAX_PATH);
    edLimitText(IDC_ED_PATH_DSCALER, MAX_PATH);
    static const int idDscaler[] = {IDC_LBL_PATH_DSCALER, IDC_ED_PATH_DSCALER, IDC_BT_PATH_DSCALER, 0};
    enable((filterMode & IDFF_FILTERMODE_AUDIO) == 0, idDscaler);
    addHint(IDC_CBX_SUBFILES_MODE, _l("All subtitles: all subtitles files found\nVideo file match: list of subtitle files built from the following mask : <video filename>.ext or <video filename>.<suffix>.ext\nPartial match: list built with heuristic comparison on video file name\nVideo file match then partial: use heuristic if no exact match found on video file"));
}
Пример #11
0
//===================================== TlevelsPage =====================================
void TlevelsPage::init(void)
{
    deciD->queryFilterInterface(IID_IimgFilterLevels,(void**)&filter);
    memset(&histogramBmp.bmiHeader,0,sizeof(histogramBmp.bmiHeader));
    histogramBmp.bmiHeader.biSize=sizeof(histogramBmp.bmiHeader);
    histogramBmp.bmiHeader.biWidth=256;
    histogramBmp.bmiHeader.biHeight=64;
    histogramBmp.bmiHeader.biPlanes=1;
    histogramBmp.bmiHeader.biBitCount=8;
    histogramBmp.bmiHeader.biCompression=BI_RGB;
    histogramBmp.bmiHeader.biXPelsPerMeter=100;
    histogramBmp.bmiHeader.biYPelsPerMeter=100;
    memset(histogramBmp.bmiColors,0,256*sizeof(RGBQUAD));
    histogramBmp.bmiColors[1].rgbRed=histogramBmp.bmiColors[1].rgbGreen=histogramBmp.bmiColors[1].rgbBlue=255;
    histogramBmp.bmiColors[2].rgbRed=histogramBmp.bmiColors[2].rgbGreen=histogramBmp.bmiColors[2].rgbBlue=192;
    memset(histogramBits,1,sizeof(histogramBits));

    curvesBmp=histogramBmp;
    curvesBmp.bmiHeader.biHeight=256;
    hcurves=GetDlgItem(m_hwnd,IDC_BMP_LEVELS_CURVES);

    bmpGradient=LoadBitmap(hi,MAKEINTRESOURCE(IDB_GRADIENT));
    HDC hdc=GetDC(m_hwnd);
    hdcGradient=CreateCompatibleDC(hdc);
    oldHDCgradient=SelectObject(hdcGradient,bmpGradient);
    LOGFONT oldFont;
    HFONT hf=(HFONT)GetCurrentObject(hdc,OBJ_FONT);
    GetObject(hf,sizeof(LOGFONT),&oldFont);
    strcpy(oldFont.lfFaceName,_l("Courier"));
    oldFont.lfWeight=FW_LIGHT;
    oldFont.lfHeight=-11;
    oldFont.lfWidth=0;
    fontCurier=CreateFontIndirect(&oldFont);
    SendMessage(GetDlgItem(m_hwnd,IDC_LBX_LEVELS_CURVES),WM_SETFONT,WPARAM(fontCurier),FALSE);
    strcpy(oldFont.lfFaceName,_l("Small fonts"));
    fontGradient=CreateFontIndirect(&oldFont);
    ReleaseDC(m_hwnd,hdc);
    isMap=false;
    hIn=GetDlgItem(m_hwnd,IDC_BMP_LEVELS_IN);
    hOut=GetDlgItem(m_hwnd,IDC_BMP_LEVELS_OUT);
    RECT r;
    GetWindowRect(hIn,&r);
    bdx=r.right-r.left-2;
    tbrSetRange(IDC_TBR_LEVELS_GAMMA,1,400,40);
    tbrSetRange(IDC_TBR_LEVELS_POSTERIZE,1,255);
    SendDlgItemMessage(m_hwnd,IDC_UD_Y_MAX_DELTA ,UDM_SETRANGE,0,MAKELONG(50,1));
    SendDlgItemMessage(m_hwnd,IDC_UD_Y_THRESHOLD ,UDM_SETRANGE,0,MAKELONG(150,1));
    SendDlgItemMessage(m_hwnd,IDC_UD_Y_TEMPORAL ,UDM_SETRANGE,0,MAKELONG(20,1));
    startup=true;
    addHint(IDC_CHB_LEVELS_RGB, L"You need to force RGB conversion to get accurate color. If your computer is fast enough, we recommend you to check it. If the video is interlaced, please make sure to deinterlace before RGB conversion.\nFor the range setting, output levels in RGB conversion page is used even if the picture is RGB from the start.");
}
Пример #12
0
void TpresetAutoloadDlgBase::TitemsWindow::showItems(void)
{
    THWNDs hwnds;
    getChildWindows(m_hwnd, hwnds);
    for (THWNDs::const_iterator h = hwnds.begin(); h != hwnds.end(); h++) {
        DestroyWindow(*h);
    }
    int y = 0;
    HFONT fnt = (HFONT)SendMessage(m_hwnd, WM_GETFONT, 0, 0);
    CRect pr;
    GetWindowRect(m_hwnd, &pr);
    int prdlgdx = 170; //TODO: compute
    int id = 0;
    int sbrWidth = GetSystemMetrics(SM_CXVSCROLL) + 4;
    for (Titems::const_iterator i = items.begin(); i != items.end(); i++, id++) {
        CRect r(CPoint(0, y), CSize(prdlgdx, 10));
        MapDialogRect(m_hwnd, &r);
        HWND hchb = CreateWindow(_l("BUTTON"), _(-IDD_PRESET_AUTOLOAD_ITEMS, i->name), WS_VISIBLE | WS_CHILD | BS_AUTOCHECKBOX | WS_TABSTOP, r.left, r.top, r.Width() - sbrWidth, r.Height(), m_hwnd, HMENU(1000 + 10 * id + 1), hi, 0);
        SendMessage(hchb, WM_SETFONT, WPARAM(fnt), TRUE);
        setCheck(1000 + 10 * id + 1, i->is);
        y += 11;
        if (i->isVal) {
            static const int dxbt1 = 10;
            int dxbt = (i->isList ? dxbt1 : 0) + (i->isHelp ? dxbt1 : 0);
            r = CRect(CPoint(0, y), CSize(prdlgdx - dxbt, 12));
            MapDialogRect(m_hwnd, &r);
            HWND hed = CreateWindowEx(WS_EX_CLIENTEDGE, _l("EDIT"), NULL, WS_CHILD | WS_VISIBLE | ES_LEFT | ES_AUTOHSCROLL | WS_TABSTOP, r.left, r.top, r.Width() - sbrWidth, r.Height(), m_hwnd, HMENU(1000 + 10 * id + 2), hi, 0);
            SendMessage(hed, WM_SETFONT, WPARAM(fnt), TRUE);
            SendMessage(hed, EM_SETLIMITTEXT, 255, 0);
            setWindowText(hed, i->val);
            if (i->hint && i->hint[0]) {
                addHint(1000 + 10 * id + 2, i->hint);
            }
            int btx = prdlgdx - dxbt;
            if (i->isList) {
                r = CRect(CPoint(btx, y), CSize(10, 12));
                MapDialogRect(m_hwnd, &r);
                btx += dxbt1;
                HWND hbt = CreateWindow(_l("BUTTON"), _l("6"), WS_VISIBLE | WS_CHILD | BS_PUSHBUTTON | WS_TABSTOP, r.left - sbrWidth, r.top, r.Width(), r.Height(), m_hwnd, HMENU(1000 + 10 * id + 3), hi, 0);
                SendMessage(hbt, WM_SETFONT, WPARAM(arrowsFont), TRUE);
            }
            if (i->isHelp) {
                r = CRect(CPoint(btx, y), CSize(10, 12));
                MapDialogRect(m_hwnd, &r);
                HWND hbt = CreateWindow(_l("BUTTON"), _l("?"), WS_VISIBLE | WS_CHILD | BS_PUSHBUTTON | WS_TABSTOP, r.left - sbrWidth, r.top, r.Width(), r.Height(), m_hwnd, HMENU(1000 + 10 * id + 4), hi, 0);
                SendMessage(hbt, WM_SETFONT, WPARAM(fnt), TRUE);
            }
            y += 14;
        }
    }
    SCROLLINFO si;
    si.cbSize = sizeof(si);
    si.fMask = SIF_PAGE | SIF_POS | SIF_RANGE;
    si.nMin = 0;
    CRect r(0, 0, 0, y);
    MapDialogRect(m_hwnd, &r);
    si.nMax = r.Height();
    si.nPage = pr.Height();
    si.nPos = 0;
    SetScrollInfo(m_hwnd, SB_VERT, &si, TRUE);
}
Пример #13
0
HRESULT CLAVVideoSettingsProp::OnActivate()
{
  HRESULT hr = S_OK;
  INITCOMMONCONTROLSEX icc;
  icc.dwSize = sizeof(INITCOMMONCONTROLSEX);
  icc.dwICC = ICC_BAR_CLASSES | ICC_STANDARD_CLASSES;
  if (InitCommonControlsEx(&icc) == FALSE)
  {
    return E_FAIL;
  }
  ASSERT(m_pVideoSettings != NULL);

  const WCHAR *version = TEXT(LAV_VIDEO) L" " TEXT(LAV_VERSION_STR);
  SendDlgItemMessage(m_Dlg, IDC_LAVVIDEO_FOOTER, WM_SETTEXT, 0, (LPARAM)version);

  WCHAR stringBuffer[512] = L"Auto";

  // Init the Combo Box
  SendDlgItemMessage(m_Dlg, IDC_THREADS, CB_RESETCONTENT, 0, 0);
  SendDlgItemMessage(m_Dlg, IDC_THREADS, CB_ADDSTRING, 0, (LPARAM)stringBuffer);

  for (unsigned i = 1; i <= 16; ++i) {
    swprintf_s(stringBuffer, L"%d", i);
    SendDlgItemMessage(m_Dlg, IDC_THREADS, CB_ADDSTRING, 0, (LPARAM)stringBuffer);
  }

  addHint(IDC_THREADS, L"Enable Multi-Threading for codecs that support it.\nAuto will automatically use the maximum number of threads suitable for your CPU. Using 1 thread disables multi-threading.\n\nMT decoding is supported for H264, MPEG2, MPEG4, VP8, VP3/Theora, DV and HuffYUV");

  addHint(IDC_STREAMAR, L"Checked - Stream AR will be used.\nUnchecked - Frame AR will not be used.\nIndeterminate (Auto) - Stream AR will not be used on files with a container AR (recommended).");

  WCHAR hwAccelNone[] = L"None";
  WCHAR hwAccelCUDA[] = L"NVIDIA CUVID";
  WCHAR hwAccelQuickSync[] = L"Intel\xae QuickSync";
  WCHAR hwAccelDXVA2CB[] = L"DXVA2 (copy-back)";
  WCHAR hwAccelDXVA2N[] = L"DXVA2 (native)";
  SendDlgItemMessage(m_Dlg, IDC_HWACCEL, CB_ADDSTRING, 0, (LPARAM)hwAccelNone);
  SendDlgItemMessage(m_Dlg, IDC_HWACCEL, CB_ADDSTRING, 0, (LPARAM)hwAccelCUDA);
  SendDlgItemMessage(m_Dlg, IDC_HWACCEL, CB_ADDSTRING, 0, (LPARAM)hwAccelQuickSync);
  SendDlgItemMessage(m_Dlg, IDC_HWACCEL, CB_ADDSTRING, 0, (LPARAM)hwAccelDXVA2CB);
  SendDlgItemMessage(m_Dlg, IDC_HWACCEL, CB_ADDSTRING, 0, (LPARAM)hwAccelDXVA2N);

  // Init the fieldorder Combo Box
  SendDlgItemMessage(m_Dlg, IDC_DEINT_FIELDORDER, CB_RESETCONTENT, 0, 0);
  WideStringFromResource(stringBuffer, IDS_FIELDORDER_AUTO);
  SendDlgItemMessage(m_Dlg, IDC_DEINT_FIELDORDER, CB_ADDSTRING, 0, (LPARAM)stringBuffer);
  WideStringFromResource(stringBuffer, IDS_FIELDORDER_TOP);
  SendDlgItemMessage(m_Dlg, IDC_DEINT_FIELDORDER, CB_ADDSTRING, 0, (LPARAM)stringBuffer);
  WideStringFromResource(stringBuffer, IDS_FIELDORDER_BOTTOM);
  SendDlgItemMessage(m_Dlg, IDC_DEINT_FIELDORDER, CB_ADDSTRING, 0, (LPARAM)stringBuffer);

  // Deint Mode combo box
  SendDlgItemMessage(m_Dlg, IDC_DEINT_MODE, CB_RESETCONTENT, 0, 0);
  WideStringFromResource(stringBuffer, IDS_DEINTMODE_AUTO);
  SendDlgItemMessage(m_Dlg, IDC_DEINT_MODE, CB_ADDSTRING, 0, (LPARAM)stringBuffer);
  WideStringFromResource(stringBuffer, IDS_DEINTMODE_AGGRESSIVE);
  SendDlgItemMessage(m_Dlg, IDC_DEINT_MODE, CB_ADDSTRING, 0, (LPARAM)stringBuffer);
  WideStringFromResource(stringBuffer, IDS_DEINTMODE_FORCE);
  SendDlgItemMessage(m_Dlg, IDC_DEINT_MODE, CB_ADDSTRING, 0, (LPARAM)stringBuffer);
  WideStringFromResource(stringBuffer, IDS_DEINTMODE_DISABLE);
  SendDlgItemMessage(m_Dlg, IDC_DEINT_MODE, CB_ADDSTRING, 0, (LPARAM)stringBuffer);

  addHint(IDC_HWACCEL_MPEG4, L"EXPERIMENTAL! The MPEG4-ASP decoder is known to be unstable! Use at your own peril!");

  addHint(IDC_HWRES_SD, L"Use Hardware Decoding for Standard-definition content (DVD, SDTV)\n\nThis affects all videos with a resolution less than 1024x576 (DVD resolution)");
  addHint(IDC_HWRES_HD, L"Use Hardware Decoding for High-definition content (Blu-ray, HDTV)\n\nAffects all videos above SD resolution, up to Full-HD, 1920x1200");
  addHint(IDC_HWRES_UHD, L"Use Hardware Decoding for Ultra-high-definition content (4K, UHDTV)\n\nAffects all videos above HD resolution. Note that not all hardware supports decoding 4K/UHD content. On AMD GPUs, 4K support is very fragile, and may even cause crashes or BSODs, use at your own risk.");

  addHint(IDC_DEINT_MODE, L"Controls how interlaced material is handled.\n\nAuto: Frame flags are used to determine content type.\nAggressive: All frames in an interlaced streams are handled interlaced.\nForce: All frames are handles as interlaced.\nDisabled: All frames are handled as progressive.");

  addHint(IDC_HWDEINT_OUT_FILM, L"Deinterlace in \"Film\" Mode.\nFor every pair of interlaced fields, one frame will be created, resulting in 25/30 fps.");
  addHint(IDC_HWDEINT_OUT_VIDEO, L"Deinterlace in \"Video\" Mode. (Recommended)\nFor every interlaced field, one frame will be created, resulting in 50/60 fps.");

  addHint(IDC_HWDEINT_HQ, L"Instruct the decoder to use the maximum quality possible.\nThis will cost performance, it is however required for the best deinterlacing quality.");

  addHint(IDC_DITHER_ORDERED, L"Ordered Dithering uses a static pattern, resulting in very smooth and regular pattern. However, in some cases the regular pattern can be visible and distracting.");
  addHint(IDC_DITHER_RANDOM, L"Random Dithering uses random noise to dither the video frames. This has the advantage of not creating any visible pattern, at the downside of increasing the noise floor slightly.");

  hr = LoadData();
  if (SUCCEEDED(hr)) {
    SendDlgItemMessage(m_Dlg, IDC_THREADS, CB_SETCURSEL, m_dwNumThreads, 0);

    SendDlgItemMessage(m_Dlg, IDC_STREAMAR, BM_SETCHECK, m_StreamAR, 0);

    SendDlgItemMessage(m_Dlg, IDC_DEINT_FIELDORDER, CB_SETCURSEL, m_DeintFieldOrder, 0);
    SendDlgItemMessage(m_Dlg, IDC_DEINT_MODE, CB_SETCURSEL, m_DeintMode, 0);

    SendDlgItemMessage(m_Dlg, IDC_OUT_YV12, BM_SETCHECK, m_bPixFmts[LAVOutPixFmt_YV12], 0);
    SendDlgItemMessage(m_Dlg, IDC_OUT_NV12, BM_SETCHECK, m_bPixFmts[LAVOutPixFmt_NV12], 0);
    SendDlgItemMessage(m_Dlg, IDC_OUT_P010, BM_SETCHECK, m_bPixFmts[LAVOutPixFmt_P010], 0);
    SendDlgItemMessage(m_Dlg, IDC_OUT_P016, BM_SETCHECK, m_bPixFmts[LAVOutPixFmt_P016], 0);
    SendDlgItemMessage(m_Dlg, IDC_OUT_YUY2, BM_SETCHECK, m_bPixFmts[LAVOutPixFmt_YUY2], 0);
    SendDlgItemMessage(m_Dlg, IDC_OUT_UYVY, BM_SETCHECK, m_bPixFmts[LAVOutPixFmt_UYVY], 0);
    SendDlgItemMessage(m_Dlg, IDC_OUT_P210, BM_SETCHECK, m_bPixFmts[LAVOutPixFmt_P210], 0);
    SendDlgItemMessage(m_Dlg, IDC_OUT_V210, BM_SETCHECK, m_bPixFmts[LAVOutPixFmt_v210], 0);
    SendDlgItemMessage(m_Dlg, IDC_OUT_P216, BM_SETCHECK, m_bPixFmts[LAVOutPixFmt_P216], 0);
    SendDlgItemMessage(m_Dlg, IDC_OUT_YV24, BM_SETCHECK, m_bPixFmts[LAVOutPixFmt_YV24], 0);
    SendDlgItemMessage(m_Dlg, IDC_OUT_AYUV, BM_SETCHECK, m_bPixFmts[LAVOutPixFmt_AYUV], 0);
    SendDlgItemMessage(m_Dlg, IDC_OUT_Y410, BM_SETCHECK, m_bPixFmts[LAVOutPixFmt_Y410], 0);
    SendDlgItemMessage(m_Dlg, IDC_OUT_V410, BM_SETCHECK, m_bPixFmts[LAVOutPixFmt_v410], 0);
    SendDlgItemMessage(m_Dlg, IDC_OUT_Y416, BM_SETCHECK, m_bPixFmts[LAVOutPixFmt_Y416], 0);
    SendDlgItemMessage(m_Dlg, IDC_OUT_RGB32, BM_SETCHECK, m_bPixFmts[LAVOutPixFmt_RGB32], 0);
    SendDlgItemMessage(m_Dlg, IDC_OUT_RGB24, BM_SETCHECK, m_bPixFmts[LAVOutPixFmt_RGB24], 0);
    SendDlgItemMessage(m_Dlg, IDC_OUT_RGB48, BM_SETCHECK, m_bPixFmts[LAVOutPixFmt_RGB48], 0);

    SendDlgItemMessage(m_Dlg, IDC_RGBOUT_AUTO, BM_SETCHECK, (m_dwRGBOutput == 0), 0);
    SendDlgItemMessage(m_Dlg, IDC_RGBOUT_TV, BM_SETCHECK, (m_dwRGBOutput == 1), 0);
    SendDlgItemMessage(m_Dlg, IDC_RGBOUT_PC, BM_SETCHECK, (m_dwRGBOutput == 2), 0);

    SendDlgItemMessage(m_Dlg, IDC_HWACCEL, CB_SETCURSEL, m_HWAccel, 0);
    SendDlgItemMessage(m_Dlg, IDC_HWACCEL_H264, BM_SETCHECK, m_HWAccelCodecs[HWCodec_H264], 0);
    SendDlgItemMessage(m_Dlg, IDC_HWACCEL_VC1, BM_SETCHECK, m_HWAccelCodecs[HWCodec_VC1], 0);
    SendDlgItemMessage(m_Dlg, IDC_HWACCEL_MPEG2, BM_SETCHECK, m_HWAccelCodecs[HWCodec_MPEG2], 0);
    SendDlgItemMessage(m_Dlg, IDC_HWACCEL_MPEG4, BM_SETCHECK, m_HWAccelCodecs[HWCodec_MPEG4], 0);
    SendDlgItemMessage(m_Dlg, IDC_HWACCEL_MPEG2_DVD, BM_SETCHECK, m_HWAccelCodecs[HWCodec_MPEG2DVD], 0);

    SendDlgItemMessage(m_Dlg, IDC_HWRES_SD, BM_SETCHECK, !!(m_HWRes & LAVHWResFlag_SD), 0);
    SendDlgItemMessage(m_Dlg, IDC_HWRES_HD, BM_SETCHECK, !!(m_HWRes & LAVHWResFlag_HD), 0);
    SendDlgItemMessage(m_Dlg, IDC_HWRES_UHD, BM_SETCHECK, !!(m_HWRes & LAVHWResFlag_UHD), 0);

    SendDlgItemMessage(m_Dlg, IDC_HWDEINT_ENABLE, BM_SETCHECK, (m_HWDeintAlgo == HWDeintMode_Hardware), 0);

    SendDlgItemMessage(m_Dlg, IDC_HWDEINT_OUT_FILM, BM_SETCHECK, (m_HWDeintOutMode == DeintOutput_FramePer2Field), 0);
    SendDlgItemMessage(m_Dlg, IDC_HWDEINT_OUT_VIDEO, BM_SETCHECK, (m_HWDeintOutMode == DeintOutput_FramePerField), 0);

    SendDlgItemMessage(m_Dlg, IDC_HWDEINT_HQ, BM_SETCHECK, IsVistaOrNewer() ? m_HWDeintHQ : 0, 0);

    SendDlgItemMessage(m_Dlg, IDC_SWDEINT_ENABLE, BM_SETCHECK, m_SWDeint, 0);
    SendDlgItemMessage(m_Dlg, IDC_SWDEINT_OUT_FILM, BM_SETCHECK, (m_SWDeintOutMode == DeintOutput_FramePer2Field), 0);
    SendDlgItemMessage(m_Dlg, IDC_SWDEINT_OUT_VIDEO, BM_SETCHECK, (m_SWDeintOutMode == DeintOutput_FramePerField), 0);

    SendDlgItemMessage(m_Dlg, IDC_DITHER_ORDERED, BM_SETCHECK, (m_DitherMode == LAVDither_Ordered), 0);
    SendDlgItemMessage(m_Dlg, IDC_DITHER_RANDOM, BM_SETCHECK, (m_DitherMode == LAVDither_Random), 0);

    SendDlgItemMessage(m_Dlg, IDC_TRAYICON, BM_SETCHECK, m_TrayIcon, 0);

    UpdateHWOptions();
    UpdateYADIFOptions();
  }

  const WCHAR *decoder = m_pVideoStatus->GetActiveDecoderName();
  SendDlgItemMessage(m_Dlg, IDC_ACTIVE_DECODER, WM_SETTEXT, 0, (LPARAM)(decoder ? decoder : L"<inactive>"));

  return hr;
}
Пример #14
0
HRESULT CLAVSplitterSettingsProp::OnActivate()
{
  HRESULT hr = S_OK;
  INITCOMMONCONTROLSEX icc;
  icc.dwSize = sizeof(INITCOMMONCONTROLSEX);
  icc.dwICC = ICC_BAR_CLASSES | ICC_STANDARD_CLASSES;
  if (InitCommonControlsEx(&icc) == FALSE)
  {
    return E_FAIL;
  }
  ASSERT(m_pLAVF != nullptr);

  const WCHAR *version = TEXT(LAV_SPLITTER) L" " TEXT(LAV_VERSION_STR);
  SendDlgItemMessage(m_Dlg, IDC_SPLITTER_FOOTER, WM_SETTEXT, 0, (LPARAM)version);

  hr = LoadData();
  memset(m_subLangBuffer, 0, sizeof(m_advSubBuffer));
  memset(m_advSubBuffer, 0, sizeof(m_advSubBuffer));

  m_selectedSubMode = LAVSubtitleMode_Default;
  if (m_pszAdvSubConfig)
    wcsncpy_s(m_advSubBuffer, m_pszAdvSubConfig, _TRUNCATE);

  // Notify the UI about those settings
  SendDlgItemMessage(m_Dlg, IDC_PREF_LANG, WM_SETTEXT, 0, (LPARAM)m_pszPrefLang);
  SendDlgItemMessage(m_Dlg, IDC_PREF_LANG_SUBS, WM_SETTEXT, 0, (LPARAM)m_pszPrefSubLang);

  // Init the Combo Box
  SendDlgItemMessage(m_Dlg, IDC_SUBTITLE_MODE, CB_RESETCONTENT, 0, 0);
  WideStringFromResource(stringBuffer, IDS_SUBMODE_NO_SUBS);
  SendDlgItemMessage(m_Dlg, IDC_SUBTITLE_MODE, CB_ADDSTRING, 0, (LPARAM)stringBuffer);
  WideStringFromResource(stringBuffer, IDS_SUBMODE_FORCED_SUBS);
  SendDlgItemMessage(m_Dlg, IDC_SUBTITLE_MODE, CB_ADDSTRING, 0, (LPARAM)stringBuffer);
  WideStringFromResource(stringBuffer, IDS_SUBMODE_DEFAULT);
  SendDlgItemMessage(m_Dlg, IDC_SUBTITLE_MODE, CB_ADDSTRING, 0, (LPARAM)stringBuffer);
  WideStringFromResource(stringBuffer, IDS_SUBMODE_ADVANCED);
  SendDlgItemMessage(m_Dlg, IDC_SUBTITLE_MODE, CB_ADDSTRING, 0, (LPARAM)stringBuffer);

  SendDlgItemMessage(m_Dlg, IDC_SUBTITLE_MODE, CB_SETCURSEL, m_subtitleMode, 0);
  addHint(IDC_SUBTITLE_MODE, L"Configure how subtitles are selected.");

  SendDlgItemMessage(m_Dlg, IDC_BD_SEPARATE_FORCED_SUBS, BM_SETCHECK, m_PGSForcedStream, 0);
  addHint(IDC_BD_SEPARATE_FORCED_SUBS, L"Enabling this causes the creation of a new \"Forced Subtitles\" stream, which will try to always display forced subtitles matching your selected audio language.\n\nNOTE: This option may not work on all Blu-ray discs.\nRequires restart to take effect.");

  SendDlgItemMessage(m_Dlg, IDC_BD_ONLY_FORCED_SUBS, BM_SETCHECK, m_PGSOnlyForced, 0);
  addHint(IDC_BD_ONLY_FORCED_SUBS, L"When enabled, all Blu-ray (PGS) subtitles will be filtered, and only forced subtitles will be sent to the renderer.\n\nNOTE: When this option is active, you will not be able to get the \"full\" subtitles.");

  SendDlgItemMessage(m_Dlg, IDC_VC1TIMESTAMP, BM_SETCHECK, m_VC1Mode, 0);
  addHint(IDC_VC1TIMESTAMP, L"Checked - Frame timings will be corrected.\nUnchecked - Frame timings will be sent untouched.\nIndeterminate (Auto) - Only enabled for decoders that rely on the splitter doing the corrections.\n\nNOTE: Only for debugging, if unsure, set to \"Auto\".");

  SendDlgItemMessage(m_Dlg, IDC_MKV_EXTERNAL, BM_SETCHECK, m_MKVExternal, 0);

  SendDlgItemMessage(m_Dlg, IDC_SUBSTREAMS, BM_SETCHECK, m_substreams, 0);
  addHint(IDC_SUBSTREAMS, L"Controls if sub-streams should be exposed as a separate stream.\nSub-streams are typically streams for backwards compatibility, for example the AC3 part of TrueHD streams on Blu-rays.");

  SendDlgItemMessage(m_Dlg, IDC_STREAM_SWITCH_REMOVE_AUDIO, BM_SETCHECK, m_StreamSwitchRemoveAudio, 0);
  addHint(IDC_STREAM_SWITCH_REMOVE_AUDIO, L"Remove the old Audio Decoder from the Playback Chain before switching the audio stream, forcing DirectShow to select a new one.\n\nThis option ensures that the preferred decoder is always used, however it does not work properly with all players.");

  addHint(IDC_SELECT_AUDIO_QUALITY, L"Controls if the stream with the highest quality (matching your language preferences) should always be used.\nIf disabled, the first stream is always used.");
  SendDlgItemMessage(m_Dlg, IDC_SELECT_AUDIO_QUALITY, BM_SETCHECK, m_PreferHighQualityAudio, 0);

  SendDlgItemMessage(m_Dlg, IDC_IMPAIRED_AUDIO, BM_SETCHECK, m_ImpairedAudio, 0);

  SendDlgItemMessage(m_Dlg, IDC_QUEUE_MEM_SPIN, UDM_SETRANGE32, 0, 2048);

  addHint(IDC_QUEUE_MEM, L"Set the maximum memory a frame queue can use for buffering (in megabytes).\nNote that this is the maximum value, only very high bitrate files will usually even reach the default maximum value.");
  addHint(IDC_QUEUE_MEM_SPIN, L"Set the maximum memory a frame queue can use for buffering (in megabytes).\nNote that this is the maximum value, only very high bitrate files will usually even reach the default maximum value.");

  swprintf_s(stringBuffer, L"%d", m_QueueMaxMem);
  SendDlgItemMessage(m_Dlg, IDC_QUEUE_MEM, WM_SETTEXT, 0, (LPARAM)stringBuffer);

  SendDlgItemMessage(m_Dlg, IDC_QUEUE_PACKETS_SPIN, UDM_SETRANGE32, 100, 100000);

  addHint(IDC_QUEUE_PACKETS, L"Set the maximum numbers of packets to buffer in the frame queue.\nNote that the frame queue will never exceed the memory limited set above.");
  addHint(IDC_QUEUE_PACKETS_SPIN, L"Set the maximum numbers of packets to buffer in the frame queue.\nNote that the frame queue will never exceed the memory limited set above.");

  swprintf_s(stringBuffer, L"%d", m_QueueMaxPackets);
  SendDlgItemMessage(m_Dlg, IDC_QUEUE_PACKETS, WM_SETTEXT, 0, (LPARAM)stringBuffer);

  SendDlgItemMessage(m_Dlg, IDC_STREAM_ANADUR_SPIN, UDM_SETRANGE32, 200, 10000);

  addHint(IDC_STREAM_ANADUR, L"Set the duration (in milliseconds) a network stream is analyzed for before playback starts.\nA longer duration ensures the stream parameters are properly detected, however it will delay playback start.\n\nDefault: 1000 (1 second)");
  addHint(IDC_STREAM_ANADUR_SPIN, L"Set the duration (in milliseconds) a network stream is analyzed for before playback starts.\nA longer duration ensures the stream parameters are properly detected, however it will delay playback start.\n\nDefault: 1000 (1 second)");

  swprintf_s(stringBuffer, L"%d", m_NetworkAnalysisDuration);
  SendDlgItemMessage(m_Dlg, IDC_STREAM_ANADUR, WM_SETTEXT, 0, (LPARAM)stringBuffer);

  UpdateSubtitleMode(m_subtitleMode);

  SendDlgItemMessage(m_Dlg, IDC_TRAYICON, BM_SETCHECK, m_TrayIcon, 0);

  return hr;
}
Пример #15
0
    void QueryPlanSet::init() {
        DEBUGQO( "QueryPlanSet::init " << ns << "\t" << _originalQuery );
        _plans.clear();
        _mayRecordPlan = true;
        _usingPrerecordedPlan = false;

        const char *ns = _frsp->ns();
        NamespaceDetails *d = nsdetails( ns );
        if ( !d || !_frsp->matchPossible() ) {
            // Table scan plan, when no matches are possible
            _plans.push_back( QueryPlanPtr( new QueryPlan( d, -1, *_frsp, *_originalFrsp, _originalQuery, _order ) ) );
            return;
        }

        BSONElement hint = _hint.firstElement();
        if ( !hint.eoo() ) {
            _mayRecordPlan = false;
            IndexDetails *id = parseHint( hint, d );
            if ( id ) {
                addHint( *id );
            }
            else {
                massert( 10366 ,  "natural order cannot be specified with $min/$max", _min.isEmpty() && _max.isEmpty() );
                // Table scan plan
                _plans.push_back( QueryPlanPtr( new QueryPlan( d, -1, *_frsp, *_originalFrsp, _originalQuery, _order ) ) );
            }
            return;
        }

        if ( !_min.isEmpty() || !_max.isEmpty() ) {
            string errmsg;
            BSONObj keyPattern;
            IndexDetails *idx = indexDetailsForRange( ns, errmsg, _min, _max, keyPattern );
            massert( 10367 ,  errmsg, idx );
            _plans.push_back( QueryPlanPtr( new QueryPlan( d, d->idxNo(*idx), *_frsp, *_originalFrsp, _originalQuery, _order, _min, _max ) ) );
            return;
        }

        if ( isSimpleIdQuery( _originalQuery ) ) {
            int idx = d->findIdIndex();
            if ( idx >= 0 ) {
                _usingPrerecordedPlan = true;
                _mayRecordPlan = false;
                _plans.push_back( QueryPlanPtr( new QueryPlan( d , idx , *_frsp , *_originalFrsp , _originalQuery, _order ) ) );
                return;
            }
        }

        if ( _originalQuery.isEmpty() && _order.isEmpty() ) {
            _plans.push_back( QueryPlanPtr( new QueryPlan( d, -1, *_frsp, *_originalFrsp, _originalQuery, _order ) ) );
            return;
        }

        DEBUGQO( "\t special : " << _frsp->getSpecial() );
        if ( _frsp->getSpecial().size() ) {
            _special = _frsp->getSpecial();
            NamespaceDetails::IndexIterator i = d->ii();
            while( i.more() ) {
                int j = i.pos();
                IndexDetails& ii = i.next();
                const IndexSpec& spec = ii.getSpec();
                if ( spec.getTypeName() == _special && spec.suitability( _originalQuery , _order ) ) {
                    _usingPrerecordedPlan = true;
                    _mayRecordPlan = false;
                    _plans.push_back( QueryPlanPtr( new QueryPlan( d , j , *_frsp , *_originalFrsp , _originalQuery, _order ,
                                                    BSONObj() , BSONObj() , _special ) ) );
                    return;
                }
            }
            uassert( 13038 , (string)"can't find special index: " + _special + " for: " + _originalQuery.toString() , 0 );
        }

        if ( _honorRecordedPlan ) {
            pair< BSONObj, long long > best = QueryUtilIndexed::bestIndexForPatterns( *_frsp, _order );
            BSONObj bestIndex = best.first;
            long long oldNScanned = best.second;
            if ( !bestIndex.isEmpty() ) {
                QueryPlanPtr p;
                _oldNScanned = oldNScanned;
                if ( !strcmp( bestIndex.firstElement().fieldName(), "$natural" ) ) {
                    // Table scan plan
                    p.reset( new QueryPlan( d, -1, *_frsp, *_originalFrsp, _originalQuery, _order ) );
                }

                NamespaceDetails::IndexIterator i = d->ii();
                while( i.more() ) {
                    int j = i.pos();
                    IndexDetails& ii = i.next();
                    if( ii.keyPattern().woCompare(bestIndex) == 0 ) {
                        p.reset( new QueryPlan( d, j, *_frsp, *_originalFrsp, _originalQuery, _order ) );
                    }
                }

                massert( 10368 ,  "Unable to locate previously recorded index", p.get() );
                if ( !( _bestGuessOnly && p->scanAndOrderRequired() ) ) {
                    _usingPrerecordedPlan = true;
                    _mayRecordPlan = false;
                    _plans.push_back( p );
                    return;
                }
            }
        }

        addOtherPlans( false );
    }
Пример #16
0
void BaseCompiler::spill(BaseVar& var) {
  addHint(var, kVarHintSpill, kInvalidValue);
}
Пример #17
0
void BaseCompiler::unuse(BaseVar& var) {
  addHint(var, kVarHintUnuse, kInvalidValue);
}
Пример #18
0
void BaseCompiler::alloc(BaseVar& var, const BaseReg& reg) {
  addHint(var, kVarHintAlloc, reg.getRegIndex());
}
Пример #19
0
void BaseCompiler::save(BaseVar& var) {
  addHint(var, kVarHintSave, kInvalidValue);
}
Пример #20
0
void BaseCompiler::alloc(BaseVar& var, uint32_t regIndex) {
  addHint(var, kVarHintAlloc, regIndex);
}
Пример #21
0
void BaseCompiler::alloc(BaseVar& var) {
  addHint(var, kVarHintAlloc, kInvalidValue);
}
Пример #22
0
void Compiler::alloc(Var& var, const Reg& reg) {
  addHint(var, kVarHintAlloc, reg.getRegIndex());
}
Пример #23
0
HRESULT CLAVAudioSettingsProp::OnActivate()
{
  HRESULT hr = S_OK;
  INITCOMMONCONTROLSEX icc;
  icc.dwSize = sizeof(INITCOMMONCONTROLSEX);
  icc.dwICC = ICC_BAR_CLASSES | ICC_STANDARD_CLASSES;
  if (InitCommonControlsEx(&icc) == FALSE)
  {
    return E_FAIL;
  }
  ASSERT(m_pAudioSettings != nullptr);

  const WCHAR *version = TEXT(LAV_AUDIO) L" " TEXT(LAV_VERSION_STR);
  SendDlgItemMessage(m_Dlg, IDC_LAVAUDIO_FOOTER, WM_SETTEXT, 0, (LPARAM)version);

  hr = LoadData();
  if (SUCCEEDED(hr)) {
    SendDlgItemMessage(m_Dlg, IDC_DRC, BM_SETCHECK, m_bDRCEnabled, 0);

    EnableWindow(GetDlgItem(m_Dlg, IDC_DRC_LEVEL), m_bDRCEnabled);
    SendDlgItemMessage(m_Dlg, IDC_DRC_LEVEL, TBM_SETRANGE, 0, MAKELONG(0, 100));
    SendDlgItemMessage(m_Dlg, IDC_DRC_LEVEL, TBM_SETTICFREQ, 10, 0);
    SendDlgItemMessage(m_Dlg, IDC_DRC_LEVEL, TBM_SETPOS, 1, m_iDRCLevel);

    WCHAR buffer[10];
    _snwprintf_s(buffer, _TRUNCATE, L"%d%%", m_iDRCLevel);
    SendDlgItemMessage(m_Dlg, IDC_DRC_LEVEL_TEXT, WM_SETTEXT, 0, (LPARAM)buffer);

    SendDlgItemMessage(m_Dlg, IDC_BS_AC3, BM_SETCHECK, m_bBitstreaming[Bitstream_AC3], 0);
    SendDlgItemMessage(m_Dlg, IDC_BS_EAC3, BM_SETCHECK, m_bBitstreaming[Bitstream_EAC3], 0);
    SendDlgItemMessage(m_Dlg, IDC_BS_TRUEHD, BM_SETCHECK, m_bBitstreaming[Bitstream_TRUEHD], 0);
    SendDlgItemMessage(m_Dlg, IDC_BS_DTS, BM_SETCHECK, m_bBitstreaming[Bitstream_DTS], 0);
    SendDlgItemMessage(m_Dlg, IDC_BS_DTSHD, BM_SETCHECK, m_bBitstreaming[Bitstream_DTSHD], 0);
    EnableWindow(GetDlgItem(m_Dlg, IDC_BS_DTSHD), m_bBitstreaming[Bitstream_DTS]);

    SendDlgItemMessage(m_Dlg, IDC_BS_DTSHD_FRAMING, BM_SETCHECK, m_bDTSHDFraming, 0);
    EnableWindow(GetDlgItem(m_Dlg, IDC_BS_DTSHD_FRAMING), m_bBitstreaming[Bitstream_DTSHD]);
    addHint(IDC_BS_DTSHD_FRAMING, L"With some Receivers, this setting might be needed to achieve the full features of DTS. However, on other Receivers, this option will cause DTS to not work at all.\n\nIf you do not experience any problems, its recommended to leave this setting untouched.");

    SendDlgItemMessage(m_Dlg, IDC_AUTO_AVSYNC, BM_SETCHECK, m_bAutoAVSync, 0);
    addHint(IDC_AUTO_AVSYNC, L"Enables automatic tracking and correction of A/V sync.\n\nIf you encounter any sync issues, disabling this option can help in debugging the source of the problem.");

    SendDlgItemMessage(m_Dlg, IDC_STANDARD_CH_LAYOUT, BM_SETCHECK, m_bOutputStdLayout, 0);
    addHint(IDC_STANDARD_CH_LAYOUT, L"Converts all channel layouts to one of the \"standard\" layouts (5.1/6.1/7.1) by adding silent channels. This is required for sending the PCM over HDMI if not using another downstream mixer, for example when using WASAPI.");

    SendDlgItemMessage(m_Dlg, IDC_OUTPUT51_LEGACY, BM_SETCHECK, m_bOutput51Legacy, 0);
    addHint(IDC_OUTPUT51_LEGACY, L"Use the legacy 5.1 channel layout which uses back channels instead of side channels, required for some audio devices and/or software.");

    SendDlgItemMessage(m_Dlg, IDC_EXPAND_MONO, BM_SETCHECK, m_bExpandMono, 0);
    addHint(IDC_EXPAND_MONO, L"Plays Mono Audio in both Left/Right Front channels, instead of the center.");
    SendDlgItemMessage(m_Dlg, IDC_EXPAND61, BM_SETCHECK, m_bExpand61, 0);
    addHint(IDC_EXPAND61, L"Converts 6.1 Audio to 7.1 by copying the Back Center into both Back Left and Right channels.");

    SendDlgItemMessage(m_Dlg, IDC_OUT_S16, BM_SETCHECK, m_bSampleFormats[SampleFormat_16], 0);
    SendDlgItemMessage(m_Dlg, IDC_OUT_S24, BM_SETCHECK, m_bSampleFormats[SampleFormat_24], 0);
    SendDlgItemMessage(m_Dlg, IDC_OUT_S32, BM_SETCHECK, m_bSampleFormats[SampleFormat_32], 0);
    SendDlgItemMessage(m_Dlg, IDC_OUT_FP32, BM_SETCHECK, m_bSampleFormats[SampleFormat_FP32], 0);
    SendDlgItemMessage(m_Dlg, IDC_OUT_U8, BM_SETCHECK, m_bSampleFormats[SampleFormat_U8], 0);

    SendDlgItemMessage(m_Dlg, IDC_OUT_S16_DITHER, BM_SETCHECK, m_bDither, 0);

    SendDlgItemMessage(m_Dlg, IDC_DELAY_ENABLED, BM_SETCHECK, m_bAudioDelay, 0);
    EnableWindow(GetDlgItem(m_Dlg, IDC_DELAYSPIN), m_bAudioDelay);
    EnableWindow(GetDlgItem(m_Dlg, IDC_DELAY), m_bAudioDelay);

    SendDlgItemMessage(m_Dlg, IDC_DELAYSPIN, UDM_SETRANGE32, -1000*60*60*24, 1000*60*60*24);

    WCHAR stringBuffer[100];
    swprintf_s(stringBuffer, L"%d", m_iAudioDelay);
    SendDlgItemMessage(m_Dlg, IDC_DELAY, WM_SETTEXT, 0, (LPARAM)stringBuffer);

    SendDlgItemMessage(m_Dlg, IDC_TRAYICON, BM_SETCHECK, m_TrayIcon, 0);
  }

  return hr;
}
Пример #24
0
HRESULT CLAVAudioMixingProp::OnActivate()
{
  HRESULT hr = S_OK;
  INITCOMMONCONTROLSEX icc;
  icc.dwSize = sizeof(INITCOMMONCONTROLSEX);
  icc.dwICC = ICC_BAR_CLASSES | ICC_STANDARD_CLASSES;
  if (InitCommonControlsEx(&icc) == FALSE)
  {
    return E_FAIL;
  }
  ASSERT(m_pAudioSettings != nullptr);

  WCHAR spkMono[] = L"Mono";
  WCHAR spkStereo[] = L"Stereo";
  WCHAR spkQuadro[] = L"4.0";
  WCHAR spk51Surround[] = L"5.1";
  WCHAR spk61Surround[] = L"6.1";
  WCHAR spk71Surround[] = L"7.1";

  SendDlgItemMessage(m_Dlg, IDC_OUTPUT_SPEAKERS, CB_RESETCONTENT, 0, 0);
  SendDlgItemMessage(m_Dlg, IDC_OUTPUT_SPEAKERS, CB_ADDSTRING, 0, (LPARAM)spkMono);
  SendDlgItemMessage(m_Dlg, IDC_OUTPUT_SPEAKERS, CB_ADDSTRING, 0, (LPARAM)spkStereo);
  SendDlgItemMessage(m_Dlg, IDC_OUTPUT_SPEAKERS, CB_ADDSTRING, 0, (LPARAM)spkQuadro);
  SendDlgItemMessage(m_Dlg, IDC_OUTPUT_SPEAKERS, CB_ADDSTRING, 0, (LPARAM)spk51Surround);
  SendDlgItemMessage(m_Dlg, IDC_OUTPUT_SPEAKERS, CB_ADDSTRING, 0, (LPARAM)spk61Surround);
  SendDlgItemMessage(m_Dlg, IDC_OUTPUT_SPEAKERS, CB_ADDSTRING, 0, (LPARAM)spk71Surround);

  SendDlgItemMessage(m_Dlg, IDC_MIX_LEVEL_CENTER, TBM_SETRANGE, 0, MAKELONG(0, 10000));
  SendDlgItemMessage(m_Dlg, IDC_MIX_LEVEL_CENTER, TBM_SETTICFREQ, 100, 0);
  SendDlgItemMessage(m_Dlg, IDC_MIX_LEVEL_CENTER, TBM_SETLINESIZE, 0, 100);
  SendDlgItemMessage(m_Dlg, IDC_MIX_LEVEL_CENTER, TBM_SETPAGESIZE, 0, 100);
  SendDlgItemMessage(m_Dlg, IDC_MIX_LEVEL_SURROUND, TBM_SETRANGE, 0, MAKELONG(0, 10000));
  SendDlgItemMessage(m_Dlg, IDC_MIX_LEVEL_SURROUND, TBM_SETTICFREQ, 100, 0);
  SendDlgItemMessage(m_Dlg, IDC_MIX_LEVEL_SURROUND, TBM_SETLINESIZE, 0, 100);
  SendDlgItemMessage(m_Dlg, IDC_MIX_LEVEL_SURROUND, TBM_SETPAGESIZE, 0, 100);
  SendDlgItemMessage(m_Dlg, IDC_MIX_LEVEL_LFE, TBM_SETRANGE, 0, MAKELONG(0, 30000));
  SendDlgItemMessage(m_Dlg, IDC_MIX_LEVEL_LFE, TBM_SETTICFREQ, 100, 0);
  SendDlgItemMessage(m_Dlg, IDC_MIX_LEVEL_LFE, TBM_SETLINESIZE, 0, 100);
  SendDlgItemMessage(m_Dlg, IDC_MIX_LEVEL_LFE, TBM_SETPAGESIZE, 0, 100);

  addHint(IDC_UNTOUCHED_STEREO, L"With this option on, stereo sources will not be mixed. This is useful when you want to mix all surround sources to e.g. 5.1, but leave stereo untouched.");
  addHint(IDC_NORMALIZE_MATRIX, L"Normalizing the matrix will apply a global attenuation to the audio, in effect making it quieter to ensure that there is a consistent volume throughout the file, and no clipping occurs.\n\n"
                                L"This mode will produce inconsistent volumes between different source formats (stereo will be louder than 5.1), but the volume during playback of one file will not change.");
  addHint(IDC_CLIP_PROTECTION, L"Clipping protection analyzes the audio, and reduces the volume if clipping is detected.\n\n"
                               L"This mode tries to preserve the original volume of the audio, and is generally more consistent between different source formats. It may however cause a sudden volume change during playback. "
                               L"In addition, this mode has a higher volume than a normalized matrix and is preferred on weak speakers or headphones.");

  hr = LoadData();
  if (SUCCEEDED(hr)) {
    SendDlgItemMessage(m_Dlg, IDC_MIXING, BM_SETCHECK, m_bMixing, 0);
    SendDlgItemMessage(m_Dlg, IDC_OUTPUT_SPEAKERS, CB_SETCURSEL, get_speaker_index(m_dwSpeakerLayout), 0);

    SendDlgItemMessage(m_Dlg, IDC_UNTOUCHED_STEREO, BM_SETCHECK, !!(m_dwFlags & LAV_MIXING_FLAG_UNTOUCHED_STEREO), 0);
    SendDlgItemMessage(m_Dlg, IDC_NORMALIZE_MATRIX, BM_SETCHECK, !!(m_dwFlags & LAV_MIXING_FLAG_NORMALIZE_MATRIX), 0);
    SendDlgItemMessage(m_Dlg, IDC_CLIP_PROTECTION, BM_SETCHECK, !!(m_dwFlags & LAV_MIXING_FLAG_CLIP_PROTECTION), 0);

    SendDlgItemMessage(m_Dlg, IDC_MIXMODE_NORMAL, BM_SETCHECK, (m_dwMixingMode == MatrixEncoding_None), 0);
    SendDlgItemMessage(m_Dlg, IDC_MIXMODE_DOLBY, BM_SETCHECK, (m_dwMixingMode == MatrixEncoding_Dolby), 0);
    SendDlgItemMessage(m_Dlg, IDC_MIXMODE_DPL2, BM_SETCHECK, (m_dwMixingMode == MatrixEncoding_DPLII), 0);

    SendDlgItemMessage(m_Dlg, IDC_MIX_LEVEL_CENTER, TBM_SETPOS, 1, m_dwMixCenter);
    SendDlgItemMessage(m_Dlg, IDC_MIX_LEVEL_SURROUND, TBM_SETPOS, 1, m_dwMixSurround);
    SendDlgItemMessage(m_Dlg, IDC_MIX_LEVEL_LFE, TBM_SETPOS, 1, m_dwMixLFE);

    WCHAR buffer[10];
    _snwprintf_s(buffer, _TRUNCATE, L"%.2f", (double)m_dwMixCenter / 10000.0);
    SendDlgItemMessage(m_Dlg, IDC_MIX_LEVEL_CENTER_TEXT, WM_SETTEXT, 0, (LPARAM)buffer);
    _snwprintf_s(buffer, _TRUNCATE, L"%.2f", (double)m_dwMixSurround / 10000.0);
    SendDlgItemMessage(m_Dlg, IDC_MIX_LEVEL_SURROUND_TEXT, WM_SETTEXT, 0, (LPARAM)buffer);
    _snwprintf_s(buffer, _TRUNCATE, L"%.2f", (double)m_dwMixLFE / 10000.0);
    SendDlgItemMessage(m_Dlg, IDC_MIX_LEVEL_LFE_TEXT, WM_SETTEXT, 0, (LPARAM)buffer);
  }

  return hr;
}