Ejemplo n.º 1
0
INT_PTR TprocsfsPage::msgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
    switch (uMsg) {
        case WM_COMMAND:
            switch (LOWORD(wParam)) {
                case IDC_CHB_PREFERRED_PCM16:
                case IDC_CHB_PREFERRED_PCM32:
                case IDC_CHB_PREFERRED_FLOAT32: {
                    int prefsfs=0;
                    if (getCheck(IDC_CHB_PREFERRED_PCM16  )) {
                        prefsfs|=TsampleFormat::SF_PCM16;
                    }
                    if (getCheck(IDC_CHB_PREFERRED_PCM32  )) {
                        prefsfs|=TsampleFormat::SF_PCM32;
                    }
                    if (getCheck(IDC_CHB_PREFERRED_FLOAT32)) {
                        prefsfs|=TsampleFormat::SF_FLOAT32;
                    }
                    if (prefsfs) {
                        cfgSet(IDFF_preferredsfs,prefsfs);
                    } else {
                        setCheck(LOWORD(wParam),!getCheck(LOWORD(wParam)));
                    }
                    return TRUE;
                }
            }
            break;
    }
    return TconfPageDecAudio::msgProc(uMsg,wParam,lParam);
}
Ejemplo n.º 2
0
void TvolumePage::onFrame(void)
{
    int amp = (filter && getCheck(IDC_CHB_VOLUME_NORMALIZE) && getCheck(IDC_CHB_VOLUME)) ? filter->getCurrentNormalization() : 100;
    if (isdb) {
        setText(IDC_LBL_VOLUME_NORMALIZE_CURRENT, _l("%s %4.1f dB"), _(IDC_LBL_VOLUME_NORMALIZE_CURRENT), value2db(amp / 100.0));
    } else {
        setText(IDC_LBL_VOLUME_NORMALIZE_CURRENT, _l("%s %i%%"), _(IDC_LBL_VOLUME_NORMALIZE_CURRENT), amp);
    }
    if (getCheck(IDC_CHB_VOLUME_SHOWCURRENT)) {
        unsigned int numchannels;
        int channels[8], volumes[8];
        if (filter && filter->getVolumeData(&numchannels, channels, volumes) == S_OK) {
            bool isPbr[8];
            memset(isPbr, 0, sizeof(isPbr));
            for (unsigned int i = 0; i < numchannels; i++) {
                int pbr;
                if (channels[i]&SPEAKER_FRONT_LEFT) {
                    pbr = IDC_PBR_VOLUME_L;
                    isPbr[0] = true;
                } else if (channels[i]&SPEAKER_FRONT_RIGHT) {
                    pbr = IDC_PBR_VOLUME_R;
                    isPbr[2] = true;
                } else if (channels[i]&SPEAKER_FRONT_CENTER) {
                    pbr = IDC_PBR_VOLUME_C;
                    isPbr[1] = true;
                } else if (channels[i] & (SPEAKER_BACK_LEFT | SPEAKER_BACK_CENTER)) {
                    pbr = IDC_PBR_VOLUME_SL;
                    isPbr[3] = true;
                } else if (channels[i]&SPEAKER_BACK_RIGHT) {
                    pbr = IDC_PBR_VOLUME_SR;
                    isPbr[4] = true;
                } else if (channels[i]&SPEAKER_SIDE_LEFT) {
                    pbr = IDC_PBR_VOLUME_AL;
                    isPbr[5] = true;
                } else if (channels[i]&SPEAKER_SIDE_RIGHT) {
                    pbr = IDC_PBR_VOLUME_AR;
                    isPbr[6] = true;
                } else if (channels[i]&SPEAKER_LOW_FREQUENCY) {
                    pbr = IDC_PBR_VOLUME_LFE;
                    isPbr[7] = true;
                } else {
                    continue;
                }
                SendDlgItemMessage(m_hwnd, pbr, PBM_SETPOS, volumes[i] ? 50 + ff_round(value2db(volumes[i] / 65536.0)) : 0, 0);
                //SendDlgItemMessage(m_hwnd,pbr,PBM_SETBARCOLOR,0,LPARAM(CLR_DEFAULT));
            }
            for (unsigned int i = 0; i < countof(isPbr); i++)
                if (!isPbr[i]) {
                    SendDlgItemMessage(m_hwnd, pbrs[i], PBM_SETPOS, 0, 0);
                    //SendDlgItemMessage(m_hwnd,pbrs[i],PBM_SETBARCOLOR,0,LPARAM(CLR_NONE));
                }
            return;
        }
    }
    for (int i = 0; i < 6; i++) {
        SendDlgItemMessage(m_hwnd, pbrs[i], PBM_SETPOS, 0, 0);
    }
}
Ejemplo n.º 3
0
    ~TestProxy()
    {
      IMessageQueue::size_type count = 0;

#ifdef _WIN32
      BOOL result = 0;

      MSG msg;
      memset(&msg, 0, sizeof(msg));
      while ((result = ::GetMessage(&msg, NULL, 0, 0)) != 0)
      {
        BOOST_CHECK(-1 != result)

        ::TranslateMessage(&msg);
        ::DispatchMessage(&msg);

        count = mThread->getTotalUnprocessedMessages();
        count += mThread->getTotalUnprocessedMessages();
        if (0 == count)
          break;

        memset(&msg, 0, sizeof(msg));
      }
#elif __APPLE__
        count = mThread->getTotalUnprocessedMessages();
        do
        {
            //Run loop to handle sources
            CFRunLoopRunInMode(kCFRunLoopDefaultMode,1,false);
            count = mThread->getTotalUnprocessedMessages();

        } while (count > 0);
#else
      do
      {
        count = mThread->getTotalUnprocessedMessages();
        count += mThreadNeverCalled->getTotalUnprocessedMessages();
        if (0 != count)
          boost::this_thread::yield();
      } while (count > 0);
#endif //_WIN32

      BOOST_EQUAL(0, mThread->getTotalUnprocessedMessages());
      BOOST_EQUAL(0, mThreadNeverCalled->getTotalUnprocessedMessages());

      mThread->waitForShutdown();
      mThreadNeverCalled->waitForShutdown();

      BOOST_EQUAL(getCheck().mCalledFunc3, "func3");
      BOOST_EQUAL(getCheck().mCalledFunc2, 1000);
      BOOST_CHECK(getCheck().mCalledFunc1);
      BOOST_CHECK(getCheck().mDestroyedTestProxyCallback);
    }
Ejemplo n.º 4
0
HRESULT TblurPage::msgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
 switch (uMsg)
  {
   case WM_HSCROLL:
    if (HWND(lParam)==GetDlgItem(m_hwnd,IDC_TBR_BLUR_STRENGTH) || HWND(lParam)==GetDlgItem(m_hwnd,IDC_TBR_BLUR_TEMPSMOOTH))
     {
      cfgSet(IDFF_blurStrength,SendDlgItemMessage(m_hwnd,IDC_TBR_BLUR_STRENGTH  ,TBM_GETPOS,0,0));
      cfgSet(IDFF_tempSmooth  ,SendDlgItemMessage(m_hwnd,IDC_TBR_BLUR_TEMPSMOOTH,TBM_GETPOS,0,0));
      blur2dlg();
      return TRUE;
     }
    break;
   case WM_COMMAND:
    switch (LOWORD(wParam))  
     {
      case IDC_CHB_BLUR:
       setInter(getCheck(IDC_CHB_BLUR));
       parent->drawInter();
       return TRUE;
     }
    break;
  }
 return FALSE;
}
Ejemplo n.º 5
0
void TcodecsPage::dlg2options(int id)
{
    int ii=lvGetSelItem(IDC_LV_INCODECS);
    if (isIn(ii,0,(int)formats.size())) {
        int optionId = 0;
        switch(id) {
            case IDC_CHB_CODEC_OPT1:
                optionId=0;
                break;
            case IDC_CHB_CODEC_OPT2:
                optionId=1;
                break;
            case IDC_CHB_CODEC_OPT3:
                optionId=2;
                break;
            case IDC_CHB_CODEC_OPT4:
                optionId=3;
                break;
        }
        const Tformat::Toption &o=formats[ii].options[optionId];
        int idff=o.id;
        int val=cfgGet(idff);
        if (getCheck(id)) {
            val|=o.val;
        } else {
            val&=~o.val;
        }
        cfgSet(idff,val);
    }
}
Ejemplo n.º 6
0
void TresizeBordersPage::onLock(void)
{
    cfgSet(IDFF_bordersLocked, getCheck(IDC_CHB_BORDERSLOCKED));
    cfgSet(IDFF_bordersPercentY, cfgGet(IDFF_bordersPercentX));
    cfgSet(IDFF_bordersPixelsY, cfgGet(IDFF_bordersPixelsX));
    cfg2dlg();
}
Ejemplo n.º 7
0
HRESULT TpictPropPage::msgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
 switch (uMsg)
  {
   case WM_HSCROLL:
    if (HWND(lParam)==GetDlgItem(m_hwnd,IDC_TBR_LUMGAIN) || HWND(lParam)==GetDlgItem(m_hwnd,IDC_TBR_LUMOFFSET) || HWND(lParam)==GetDlgItem(m_hwnd,IDC_TBR_GAMMA))
     {
      cfgSet(IDFF_lumGain,writeLumGain(SendDlgItemMessage(m_hwnd,IDC_TBR_LUMGAIN,TBM_GETPOS,0,0)));
      cfgSet(IDFF_lumOffset,writeLumOffset(SendDlgItemMessage(m_hwnd,IDC_TBR_LUMOFFSET,TBM_GETPOS,0,0))-256);
      cfgSet(IDFF_gammaCorrection,writeGamma(SendDlgItemMessage(m_hwnd,IDC_TBR_GAMMA,TBM_GETPOS,0,0)));
      return TRUE;
     }
    else if (HWND(lParam)==GetDlgItem(m_hwnd,IDC_TBR_HUE) || HWND(lParam)==GetDlgItem(m_hwnd,IDC_TBR_SATURATION))
     {
      cfgSet(IDFF_hue,writeHue(SendDlgItemMessage(m_hwnd,IDC_TBR_HUE,TBM_GETPOS,0,0)));
      cfgSet(IDFF_saturation,writeSaturation(SendDlgItemMessage(m_hwnd,IDC_TBR_SATURATION,TBM_GETPOS,0,0)));
      return TRUE;
     }   
    break; 
   case WM_COMMAND:
    switch (LOWORD(wParam))  
     {
      case IDC_CHB_PICTPROP:
       setInter(getCheck(IDC_CHB_PICTPROP));
       parent->drawInter();
       return TRUE;
     }
    break;
  }   
 return FALSE;
}
Ejemplo n.º 8
0
HRESULT ToffsetPage::msgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
 switch (uMsg)
  {
   case WM_HSCROLL:
    if (HWND(lParam)==GetDlgItem(m_hwnd,IDC_TBR_OFFSETY_X) || HWND(lParam)==GetDlgItem(m_hwnd,IDC_TBR_OFFSETY_Y) || HWND(lParam)==GetDlgItem(m_hwnd,IDC_TBR_OFFSETUV_X) || HWND(lParam)==GetDlgItem(m_hwnd,IDC_TBR_OFFSETUV_Y))
     {
      cfgSet(IDFF_offsetY_X,SendDlgItemMessage(m_hwnd,IDC_TBR_OFFSETY_X ,TBM_GETPOS,0,0));
      cfgSet(IDFF_offsetY_Y,SendDlgItemMessage(m_hwnd,IDC_TBR_OFFSETY_Y ,TBM_GETPOS,0,0));
      cfgSet(IDFF_offsetU_X,SendDlgItemMessage(m_hwnd,IDC_TBR_OFFSETUV_X,TBM_GETPOS,0,0));
      cfgSet(IDFF_offsetU_Y,SendDlgItemMessage(m_hwnd,IDC_TBR_OFFSETUV_Y,TBM_GETPOS,0,0));
      cfgSet(IDFF_offsetV_X,SendDlgItemMessage(m_hwnd,IDC_TBR_OFFSETUV_X,TBM_GETPOS,0,0));
      cfgSet(IDFF_offsetV_Y,SendDlgItemMessage(m_hwnd,IDC_TBR_OFFSETUV_Y,TBM_GETPOS,0,0));
      offset2dlg();
      return TRUE;
     }
    break;
   case WM_COMMAND:
    switch (LOWORD(wParam))  
     {
      case IDC_CHB_OFFSET:
       cfgSet(IDFF_isOffset,getCheck(IDC_CHB_OFFSET));
       parent->drawInter();
       return TRUE;
     }
    break;
  }
 return FALSE;
}
Ejemplo n.º 9
0
INT_PTR TdecoderOptionsPage::msgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
    switch (uMsg) {
        case WM_COMMAND:
            switch (LOWORD(wParam)) {
                case IDC_CHB_WORKAROUND_AUTODETECT:
                case IDC_CHB_WORKAROUND_OLDMSMPEG4:
                case IDC_CHB_WORKAROUND_XVIDILACE:
                case IDC_CHB_WORKAROUND_UMP4:
                case IDC_CHB_WORKAROUND_NOPADDING:
                case IDC_CHB_WORKAROUND_QPELCHROMA:
                case IDC_CHB_WORKAROUND_EDGE:
                case IDC_CHB_WORKAROUND_HPELCHROMA:
                case IDC_CHB_WORKAROUND_AMV:
                case IDC_CHB_WORKAROUND_DC_CLIP: {
                    int bugs = 0;
                    for (int i = 0; workarounds[i].ff_bug; i++)
                        if (getCheck(workarounds[i].idc_chb)) {
                            bugs |= workarounds[i].ff_bug;
                        }
                    deci->putParam(IDFF_workaroundBugs, bugs);
                    return TRUE;
                }
            }
            break;
    }
    return TconfPageDecVideo::msgProc(uMsg, wParam, lParam);
}
Ejemplo n.º 10
0
INT_PTR TkeysPage::msgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
    switch (uMsg) {
        case WM_DESTROY:
            cfgSet(IDFF_lvKeysWidth0, ListView_GetColumnWidth(hlv, 0));
            cfgSet(IDFF_lvKeysWidth1, ListView_GetColumnWidth(hlv, 1));
            break;
        case WM_COMMAND:
            switch (LOWORD(wParam)) {
                case IDC_CHB_KEYS:
                    cfgSet(IDFF_isKeys, getCheck(IDC_CHB_KEYS));
                    keys2dlg();
                    parent->drawInter();
                    return TRUE;
            }
            break;
        case WM_NOTIFY: {
            NMHDR *nmhdr = LPNMHDR(lParam);
            if (nmhdr->hwndFrom == hlv && nmhdr->idFrom == IDC_LV_KEYS)
                switch (nmhdr->code) {
                    case NM_DBLCLK:
                        if (keyChanging != -1) {
                            endKeyChange();
                        } else {
                            beginKeyChange();
                        }
                        return TRUE;
                    case NM_CLICK:
                        if (keyChanging != -1) {
                            endKeyChange();
                        }
                        return TRUE;
                    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: {
                                    const char_t *descr;
                                    deciD->getKeyParamDescr(i, &descr);
                                    strcpy(nmdi->item.pszText, _(IDC_LV_KEYS, descr));
                                    break;
                                }
                                case 1:
                                    strcpy(nmdi->item.pszText, _(IDC_LV_KEYS, keyChanging == -1 ? Tkeyboard::getKeyName(deciD->getKeyParamKey2(i)) : _l("press key")));
                                    break;
                            }
                        return TRUE;
                    }
                }
            break;
        }
    }
    return TconfPageDec::msgProc(uMsg, wParam, lParam);
}
Ejemplo n.º 11
0
INT_PTR TavisynthPage::msgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
    int c;
    switch (uMsg) {
        case WM_COMMAND:
            switch (LOWORD(wParam)) {
                case IDC_CHB_AVISYNTH:
                    c = getCheck(IDC_CHB_AVISYNTH);
                    cfgSet(IDFF_isAvisynth, c);
                    break;

                case IDC_CHB_AVISYNTH_BUFFER:
                    enable(getCheck(IDC_CHB_AVISYNTH_BUFFER), bufferControlIDs, false);
                    break;

                case IDC_ED_AVISYNTH_BUF_BACK:
                    if (HIWORD(wParam) == EN_CHANGE && !isSetWindowText) {
                        c = GetDlgItemInt(m_hwnd, IDC_ED_AVISYNTH_BUF_BACK, NULL, false);
                        cfgSet(IDFF_avisynthBufferBack, c);
                        return TRUE;
                    }
                    break;

                case IDC_ED_AVISYNTH_BUF_AHEAD:
                    if (HIWORD(wParam) == EN_CHANGE && !isSetWindowText) {
                        c = GetDlgItemInt(m_hwnd, IDC_ED_AVISYNTH_BUF_AHEAD, NULL, false);
                        cfgSet(IDFF_avisynthBufferAhead, c);
                        return TRUE;
                    }
                    break;

                case IDC_ED_AVISYNTH:
                    if (HIWORD(wParam) == EN_CHANGE && !isSetWindowText) {
                        parent->setChange();
                        return TRUE;
                    }
                    break;
            }
            break;
    }
    return TconfPageDecVideo::msgProc(uMsg, wParam, lParam);
}
Ejemplo n.º 12
0
void TOSDpageDec::save2dlg(void)
{
    int is = cfgGet(IDFF_OSDisSave);
    setCheck(IDC_CHB_OSD_SAVE, is);
    int isUser = getCheck(IDC_CHB_OSD_USER);
    enable(!isUser, IDC_CHB_OSD_SAVE);
    setDlgItemText(m_hwnd, IDC_ED_OSD_SAVE, cfgGetStr(IDFF_OSDsaveFlnm));
    is &= !isUser;
    static const int idSave[] = {IDC_ED_OSD_SAVE, IDC_BT_OSD_SAVE, 0};
    enable(is, idSave);
}
Ejemplo n.º 13
0
char Chessboard::isKingInCheck(char king) {
    char kingInCheck = 0;

    for (int row = 0; row < 8; row++) {
        for (int col = 0; col < 8; col++) {
            if (get(row, col) == king) {
                kingInCheck = getCheck(row, col); 
            }
        }
    }
    return kingInCheck;
}
Ejemplo n.º 14
0
void HtmlCheckBox::renderAttributes(HtmlWriter &writer)
{
	ControlBase::renderAttributes(writer);

	writer.writeAttribute(_S("type"), _S("checkbox"));

	if(getCheck())
		writer.writeAttribute(_S("checked"), _S("checked"));

	if(getAutoPostBack())
		writer.writeAttribute(_S("onchange"), _S("javascript:return osAutoPostBack(this);"));
}
Ejemplo n.º 15
0
static void saveIni(HWND hwnd)
{
	char buffer[512];
	CNRINFO cnrInfo;
	HINI inifile;

	inifile = openProfile(INIFILE);

	if(inifile)
	{
		getText(WinWindowFromID(hwnd, CB_GRABBER), CBID_EDIT, buffer, sizeof(buffer));
		writeProfile(inifile,"CD","Grabber", buffer,0);
		getText(WinWindowFromID(hwnd, CB_DRIVE), CBID_EDIT, buffer, sizeof(buffer));
		writeProfile(inifile,"CD","Drive", buffer,0);
		getText(hwnd, EF_TEMPDIR, buffer, sizeof(buffer));
		writeProfile(inifile,"CD","TempDir", buffer,0);
		getText(hwnd, EF_CUSTOMCD, buffer, sizeof(buffer));
		writeProfile(inifile,"CD","Custom", buffer,0);

		*buffer = getCheck(hwnd, CB_SUPERGRAB);
		writeProfile(inifile,"CD","SuperGrab", buffer, 1);
		*buffer = getCheck(hwnd, CB_USECDDB);
		writeProfile(inifile,"CD","Use CDDB", buffer, 1);

		getText(hwnd, EF_TITLE, buffer, sizeof(buffer));
		writeProfile(inifile,"CD","Title", buffer,0);
		getText(hwnd, EF_ARTIST, buffer, sizeof(buffer));
		writeProfile(inifile,"CD","Artist", buffer,0);
		getText(hwnd, EF_COMMENTS, buffer, sizeof(buffer));
		writeProfile(inifile,"CD","Comments", buffer,0);
		getText(hwnd, EF_GENRE, buffer, sizeof(buffer));
		writeProfile(inifile,"CD","Category", buffer,0);

		cnrInfo.cb = sizeof(cnrInfo);
		WinSendDlgItemMsg(hwnd,CT_TRACK,CM_QUERYCNRINFO, MPFROMP(&cnrInfo),MPFROMLONG(sizeof(cnrInfo)));
		writeProfile(inifile,"CD","ContainerInfo", &cnrInfo, sizeof(cnrInfo));

		closeProfile(inifile);
	}
}
Ejemplo n.º 16
0
void TavisynthPage::cfg2dlg(void)
{
    setCheck(IDC_CHB_AVISYNTH_FFDSHOW, cfgGet(IDFF_avisynthFfdshowSource));
    cbxSetCurSel(IDC_CBX_AVISYNTH_PULLDOWN, cfgGet(IDFF_avisynthApplyPulldown));
    setCheck(IDC_CHB_AVISYNTH_YV12 , cfgGet(IDFF_avisynthInYV12));
    setCheck(IDC_CHB_AVISYNTH_YUY2 , cfgGet(IDFF_avisynthInYUY2));
    setCheck(IDC_CHB_AVISYNTH_RGB32, cfgGet(IDFF_avisynthInRGB32));
    setCheck(IDC_CHB_AVISYNTH_RGB24, cfgGet(IDFF_avisynthInRGB24));
    setCheck(IDC_CHB_AVISYNTH_BUFFER, cfgGet(IDFF_avisynthEnableBuffering));
    SetDlgItemInt(m_hwnd, IDC_ED_AVISYNTH_BUF_BACK, cfgGet(IDFF_avisynthBufferBack), false);
    SetDlgItemInt(m_hwnd, IDC_ED_AVISYNTH_BUF_AHEAD, cfgGet(IDFF_avisynthBufferAhead), false);
    setDlgItemText(m_hwnd, IDC_ED_AVISYNTH, cfgGetStr(IDFF_avisynthScript));
    enable(getCheck(IDC_CHB_AVISYNTH_BUFFER), bufferControlIDs, false);
}
Ejemplo n.º 17
0
void TlevelsPage::onFrame(void)
{
    if (!startup && !IsWindowVisible(m_hwnd)) {
        return;
    }
    startup=false;
    int mode=cfgGet(IDFF_levelsMode);
    memset(histogramBits,1,sizeof(histogramBits));
    if (mode==5)
        for (int i=32; i<256; i+=32)
            for (int j=0; j<256; j+=2) {
                histogramBits[i*256+j]=2;
                histogramBits[j*256+i]=2;
            }
    repaint(GetDlgItem(m_hwnd,IDC_BMP_HISTOGRAM));
    unsigned int histogram[256];
    int isHist=getCheck(IDC_CHB_LEVELS_SHOW_HISTOGRAM);
    if (isHist && filter) {
        filter->getHistogram(histogram);
    } else {
        memset(histogram,0,sizeof(histogram));
    }
    unsigned int min,max;
    if (mode==5 || cfgGet(IDFF_levelsFullY)) {
        min=0;
        max=255;
    } else {
        min=16;
        max=234;
    }
    unsigned int histogramMax=0;
    histogramMax=*std::max_element(histogram+min,histogram+max+1);
    int dy=mode==5?256:64;
    if (histogramMax>1 || isMap || !isHist || mode==5) {
        for (unsigned int x=min; x<=max; x++) {
            if (histogramMax>0) {
                unsigned int y=histogram[x]*dy/histogramMax;
                for (unsigned char *dst=histogramBits+x,*dstEnd=dst+y*256; dst<dstEnd; dst+=256) {
                    *dst=2;
                }
            }
            if (isMap) {
                histogramBits[x+256*(map[x]/(256/dy))]=0;
            }
        }
        repaint(mode==5?hcurves:GetDlgItem(m_hwnd,IDC_BMP_HISTOGRAM));
    }
    repaint(GetDlgItem(m_hwnd,IDC_BMP_LEVELS_IN));
}
Ejemplo n.º 18
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);
}
Ejemplo n.º 19
0
CUIBase* CUITree::Clone()
{
	CUITree* pTree = new CUITree(*this);

	CUIBase* pCheck = getCheck();

	if (pCheck != NULL)
		pTree->setCheck((CUICheckButton*)pCheck->Clone());	

	// tree 는 재귀로 연결될 수 있으므로 m_vecTree 복제 안함.
	pTree->clearChildList();
	pTree->setScroll(NULL);

	CUIBase::CloneChild(pTree);

	return pTree;
}
Ejemplo n.º 20
0
    TestProxy()
    {
      mThread = zsLib::MessageQueueThread::singletonUsingCurrentGUIThreadsMessageQueue();
      mThreadNeverCalled = zsLib::MessageQueueThread::singletonUsingCurrentGUIThreadsMessageQueue();

      TestProxyCallbackPtr testObject = TestProxyCallback::create(mThread);

      ITestProxyDelegatePtr delegate = zsLib::Proxy<ITestProxyDelegate>::create(testObject);

      delegate->func1();
      for (int i = 0; i < 1000; ++i)
      {
        delegate->func2();
      }
      zsLib::String str("func3");
      delegate->func3(str);
      str = "bogus3";

      delegate->func4(0xFFFF);
      BOOST_EQUAL(getCheck().mCalledFunc4, 0xFFFF);

      BOOST_EQUAL(delegate->func5(0xABC, 0xDEF), "abc def");
    }
Ejemplo n.º 21
0
INT_PTR TinfoPageDec::msgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
    switch (uMsg) {
        case WM_COMMAND:
            switch (LOWORD(wParam)) {
                case IDC_CHB_ALLOW_MMX:
                case IDC_CHB_ALLOW_MMXEXT:
                case IDC_CHB_ALLOW_SSE:
                case IDC_CHB_ALLOW_SSE2:
                case IDC_CHB_ALLOW_SSE3:
                case IDC_CHB_ALLOW_SSSE3:
                case IDC_CHB_ALLOW_3DNOW:
                case IDC_CHB_ALLOW_3DNOWEXT:
                case IDC_CHB_ALLOW_SSE41:
                case IDC_CHB_ALLOW_SSE42:
                case IDC_CHB_ALLOW_SSE4A:
                case IDC_CHB_ALLOW_SSE5: {
                    int allow=0;
                    if (getCheck(IDC_CHB_ALLOW_MMX     )) {
                        allow|=FF_CPU_MMX;
                    }
                    if (getCheck(IDC_CHB_ALLOW_MMXEXT  )) {
                        allow|=FF_CPU_MMXEXT;
                    }
                    if (getCheck(IDC_CHB_ALLOW_SSE     )) {
                        allow|=FF_CPU_SSE;
                    }
                    if (getCheck(IDC_CHB_ALLOW_SSE2    )) {
                        allow|=FF_CPU_SSE2;
                    }
                    if (getCheck(IDC_CHB_ALLOW_SSE3    )) {
                        allow|=FF_CPU_SSE3;
                    }
                    if (getCheck(IDC_CHB_ALLOW_SSSE3   )) {
                        allow|=FF_CPU_SSSE3;
                    }
                    if (getCheck(IDC_CHB_ALLOW_3DNOW   )) {
                        allow|=FF_CPU_3DNOW;
                    }
                    if (getCheck(IDC_CHB_ALLOW_3DNOWEXT)) {
                        allow|=FF_CPU_3DNOWEXT;
                    }
                    if (getCheck(IDC_CHB_ALLOW_SSE41   )) {
                        allow|=FF_CPU_SSE41;
                    }
                    if (getCheck(IDC_CHB_ALLOW_SSE42   )) {
                        allow|=FF_CPU_SSE42;
                    }
                    if (getCheck(IDC_CHB_ALLOW_SSE4A   )) {
                        allow|=FF_CPU_SSE4A;
                    }
                    if (getCheck(IDC_CHB_ALLOW_SSE5    )) {
                        allow|=FF_CPU_SSE5;
                    }
                    cfgSet(IDFF_allowedCpuFlags,allow);
                    return TRUE;
                }
            }
            break;
        case WM_NOTIFY: {
            NMHDR *nmhdr=LPNMHDR(lParam);
            if (nmhdr->hwndFrom==hlv && nmhdr->idFrom==IDC_LV_INFO)
                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: {
                                    nmdi->item.pszText = pszTextBuf;
                                    tsnprintf_s(pszTextBuf,countof(pszTextBuf),_TRUNCATE,_l("%s: %s"),infoitems[i].translatedName,infoitems[i].val?infoitems[i].val:_l(""));
                                    break;
                                }
                            }
                        return TRUE;
                    }
                }
            break;
        }
    }
    return TconfPageDec::msgProc(uMsg,wParam,lParam);
}
Ejemplo n.º 22
0
INT_PTR TOSDpageDec::msgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
    switch (uMsg) {
        case WM_COMMAND:
            switch (LOWORD(wParam)) {
                case IDC_CHB_OSD:
                    cfgSet(IDFF_isOSD, getCheck(IDC_CHB_OSD));
                    parent->drawInter();
                    return TRUE;
                case IDC_CHB_OSD_IS_AUTO_HIDE:
                    cfgSet(IDFF_OSDisAutoHide, getCheck(IDC_CHB_OSD_IS_AUTO_HIDE));
                    osd2dlg();
                    parent->setChange();
                    break;
                case IDC_ED_OSD_DURATION_VISIBLE:
                    if (HIWORD(wParam) == EN_CHANGE && !isSetWindowText) {
                        HWND hed = GetDlgItem(m_hwnd, LOWORD(wParam));
                        if (hed != GetFocus()) {
                            return FALSE;
                        }
                        repaint(hed);
                        parent->setChange();
                        break;
                    }
                    break;
                case IDC_CHB_OSD_USER:
                    if (!getCheck(IDC_CHB_OSD_USER)) {
                        lv2osdFormat();
                    } else {
                        cfgSet(IDFF_OSDformat, _l("user"));
                    }
                    osd2dlg();
                    parent->setChange();
                    break;
                case IDC_ED_OSD_USER:
                    if (HIWORD(wParam) == EN_CHANGE && !isSetWindowText) {
                        char_t ed[1020]; //4 chars are reserved for "user" prefix
                        GetDlgItemText(m_hwnd, IDC_ED_OSD_USER, ed, 1020);
                        char_t format[1024];
                        tsnprintf_s(format, 1024, _TRUNCATE, _l("user%s"), ed);
                        cfgSet(IDFF_OSDformat, format);
                        parent->setChange();
                    };
                    break;
                case IDC_ED_OSD_SAVE:
                    if (HIWORD(wParam) == EN_CHANGE && !isSetWindowText) {
                        char_t saveflnm[MAX_PATH];
                        GetDlgItemText(m_hwnd, IDC_ED_OSD_SAVE, saveflnm, MAX_PATH);
                        cfgSet(IDFF_OSDsaveFlnm, saveflnm);
                        return TRUE;
                    }
                    return TRUE;
            }
            break;
        case WM_NOTIFY: {
            NMHDR *nmhdr = LPNMHDR(lParam);
            if (!nostate && nmhdr->hwndFrom == hlv && nmhdr->idFrom == IDC_LV_OSD_LINES)
                switch (nmhdr->code) {
                    case LVN_ITEMCHANGED: {
                        LPNMLISTVIEW nmlv = LPNMLISTVIEW(lParam);
                        if (nmlv->uChanged & LVIF_STATE && ((nmlv->uOldState & 4096) != (nmlv->uNewState & 4096))) {
                            lv2osdFormat();
                        }
                        return TRUE;
                    }
                    case LVN_BEGINDRAG: {
                        if (!user) {
                            LPNMLISTVIEW nmlv = LPNMLISTVIEW(lParam);
                            if (nmlv->iItem != -1) {
                                dragitem = nmlv->iItem;
                                SetCapture(m_hwnd);
                            }
                        }
                        break;
                    }
                    case NM_DBLCLK: {
                        if (user) {
                            LPNMITEMACTIVATE nmia = LPNMITEMACTIVATE(lParam);
                            if (nmia->iItem != -1) {
                                const char_t *shortcut = deci->getInfoItemShortcut((int)lvGetItemParam(IDC_LV_OSD_LINES, nmia->iItem));
                                if (shortcut && shortcut[0]) {
                                    char_t osd[1020];
                                    tsnprintf_s(osd, countof(osd), _TRUNCATE, _l("%%%s"), shortcut);
                                    SendDlgItemMessage(m_hwnd, IDC_ED_OSD_USER, EM_REPLACESEL, TRUE, LPARAM(osd));
                                }
                            }
                        }
                        break;
                    }
                }
            break;
        }
        case WM_MOUSEMOVE:
            if (dragitem != -1) {
                LVHITTESTINFO lvhti;
                lvhti.pt.x = LOWORD(lParam) - lvx;
                lvhti.pt.y = HIWORD(lParam) - lvy;
                int target = ListView_HitTest(hlv, &lvhti);
                if (target != -1) {
                    lvSwapItems(IDC_LV_OSD_LINES, target, dragitem);
                    lv2osdFormat();
                    dragitem = target;
                }
                return TRUE;
            }
            break;
        case WM_LBUTTONUP:
            if (dragitem != -1) {
                dragitem = -1;
                ReleaseCapture();
                return TRUE;
            }
            break;
    }
    return TconfPageDec::msgProc(uMsg, wParam, lParam);
}
Ejemplo n.º 23
0
HRESULT TfiltersPage::msgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
 switch (uMsg)
  {
  case WM_SHOWWINDOW:
   if (wParam) cfg2dlg();
   break;
  case WM_DESTROY:
   KillTimer(m_hwnd,POSTPROC_TIMER);
   break;
  case WM_HSCROLL:
   if (HWND(lParam)==GetDlgItem(m_hwnd,IDC_TBR_PPQUAL))
    {
     cfgSet(IDFF_ppqual,SendDlgItemMessage(m_hwnd,IDC_TBR_PPQUAL,TBM_GETPOS,0,0));
     cfgSet(IDFF_currentq,cfgGet(IDFF_ppqual));
     setPPchbs();
     return TRUE;
    }
   else if (HWND(lParam)==GetDlgItem(m_hwnd,IDC_TBR_LUMGAIN) || HWND(lParam)==GetDlgItem(m_hwnd,IDC_TBR_LUMOFFSET) || HWND(lParam)==GetDlgItem(m_hwnd,IDC_TBR_GAMMA))
    {
     cfgSet(IDFF_lumGain,writeLumGain(SendDlgItemMessage(m_hwnd,IDC_TBR_LUMGAIN,TBM_GETPOS,0,0)));
     cfgSet(IDFF_lumOffset,writeLumOffset(SendDlgItemMessage(m_hwnd,IDC_TBR_LUMOFFSET,TBM_GETPOS,0,0))-256);
     cfgSet(IDFF_gammaCorrection,writeGamma(SendDlgItemMessage(m_hwnd,IDC_TBR_GAMMA,TBM_GETPOS,0,0)));
     return TRUE;
    }
   else if (HWND(lParam)==GetDlgItem(m_hwnd,IDC_TBR_HUE) || HWND(lParam)==GetDlgItem(m_hwnd,IDC_TBR_SATURATION))
    {
     cfgSet(IDFF_hue,writeHue(SendDlgItemMessage(m_hwnd,IDC_TBR_HUE,TBM_GETPOS,0,0)));
     cfgSet(IDFF_saturation,writeSaturation(SendDlgItemMessage(m_hwnd,IDC_TBR_SATURATION,TBM_GETPOS,0,0)));
     return TRUE;
    }
   else if (HWND(lParam)==GetDlgItem(m_hwnd,IDC_TBR_XSHARPENSTRENGTH) || HWND(lParam)==GetDlgItem(m_hwnd,IDC_TBR_XSHARPENTHRESH))
    {
     switch (cfgGet(IDFF_sharpenMethod))
      {
       case 0:cfgSet(IDFF_xsharp_strength,writeSharpenStrength(SendDlgItemMessage(m_hwnd,IDC_TBR_XSHARPENSTRENGTH,TBM_GETPOS,0,0)));
              cfgSet(IDFF_xsharp_threshold,writeSharpenThreshold(SendDlgItemMessage(m_hwnd,IDC_TBR_XSHARPENTHRESH,TBM_GETPOS,0,0)));
              break;
       case 1:cfgSet(IDFF_unsharp_strength,writeSharpenStrength(SendDlgItemMessage(m_hwnd,IDC_TBR_XSHARPENSTRENGTH,TBM_GETPOS,0,0)));
              cfgSet(IDFF_unsharp_threshold,writeSharpenThreshold(SendDlgItemMessage(m_hwnd,IDC_TBR_XSHARPENTHRESH,TBM_GETPOS,0,0)));
              break;
      };        
     return TRUE;
    }
   else if (HWND(lParam)==GetDlgItem(m_hwnd,IDC_TBR_NOISESTRENGTH))
    {
     cfgSet(IDFF_noiseStrength,writeNoiseStrength(SendDlgItemMessage(m_hwnd,IDC_TBR_NOISESTRENGTH,TBM_GETPOS,0,0)));
     return TRUE;
    }
   else if (HWND(lParam)==GetDlgItem(m_hwnd,IDC_TBR_NOISESTRENGTH_CHROMA))
    {
     cfgSet(IDFF_noiseStrengthChroma,writeNoiseStrengthChroma(SendDlgItemMessage(m_hwnd,IDC_TBR_NOISESTRENGTH_CHROMA,TBM_GETPOS,0,0)));
     return TRUE;
    }
   break;
   
  case WM_COMMAND:
   switch (LOWORD(wParam))  
    {
    case IDC_CHB_POSTPROC:
     cfgSet(IDFF_isPostproc,getCheck(IDC_CHB_POSTPROC));
     return TRUE;
    case IDC_CHB_PICTPROP:
     cfgSet(IDFF_isPictProp,getCheck(IDC_CHB_PICTPROP));
     return TRUE;
    case IDC_CHB_NOISE:
     cfgSet(IDFF_isNoise,getCheck(IDC_CHB_NOISE));
     return TRUE;
    case IDC_CHB_SHARPEN:
     cfgSet(IDFF_isSharpen,getCheck(IDC_CHB_SHARPEN));
     return TRUE;
    
    case IDC_RBT_PPPRESETS:
    case IDC_RBT_PPCUSTOM:
     cfgSet(IDFF_ppIsCustom,getCheck(IDC_RBT_PPCUSTOM));
     setPPchbs();
     return TRUE;
    case IDC_CHB_AUTOQ:
     cfgSet(IDFF_autoq,getCheck(IDC_CHB_AUTOQ));
     cfgSet(IDFF_currentq,cfgGet(IDFF_ppqual));
     setPPchbs();
     return TRUE;
    case IDC_CHB_DEBLOCKV_LUM:
    case IDC_CHB_DEBLOCKH_LUM:
    case IDC_CHB_DEBLOCKV_CHROM:
    case IDC_CHB_DEBLOCKH_CHROM:
    case IDC_CHB_DERING_LUM:
    case IDC_CHB_DERING_CHROM:
     {
      int ppcustom=0;
      ppcustom|=getCheck(IDC_CHB_DEBLOCKV_LUM  )?LUM_V_DEBLOCK:0;
      ppcustom|=getCheck(IDC_CHB_DEBLOCKH_LUM  )?LUM_H_DEBLOCK:0;
      ppcustom|=getCheck(IDC_CHB_DEBLOCKV_CHROM)?CHROM_V_DEBLOCK:0;
      ppcustom|=getCheck(IDC_CHB_DEBLOCKH_CHROM)?CHROM_H_DEBLOCK:0;
      ppcustom|=getCheck(IDC_CHB_DERING_LUM    )?LUM_DERING:0;
      ppcustom|=getCheck(IDC_CHB_DERING_CHROM  )?CHROM_DERING:0;
      cfgSet(IDFF_ppcustom,ppcustom);
      setPPchbs();
      return TRUE;
     }
    case IDC_CHB_LEVELFIX_LUM:
    case IDC_CHB_LEVELFIX_CHROM:
     {
      cfgSet(IDFF_levelFixLum  ,getCheck(IDC_CHB_LEVELFIX_LUM  ));
      cfgSet(IDFF_levelFixChrom,getCheck(IDC_CHB_LEVELFIX_CHROM));
      return TRUE;
     }
     
    case IDC_BT_LUMRESET:
     SendDlgItemMessage(m_hwnd,IDC_TBR_LUMGAIN   ,TBM_SETPOS,TRUE,writeLumGain(cfgSet(IDFF_lumGain,Tconfig::lumGainDef)));
     SendDlgItemMessage(m_hwnd,IDC_TBR_LUMOFFSET ,TBM_SETPOS,TRUE,writeLumOffset(256+(cfgSet(IDFF_lumOffset,Tconfig::lumOffsetDef))));
     SendDlgItemMessage(m_hwnd,IDC_TBR_GAMMA     ,TBM_SETPOS,TRUE,writeGamma(cfgSet(IDFF_gammaCorrection,Tconfig::gammaCorrectionDef)));
     SendDlgItemMessage(m_hwnd,IDC_TBR_HUE       ,TBM_SETPOS,TRUE,writeHue(cfgSet(IDFF_hue,Tconfig::hueDef)));
     SendDlgItemMessage(m_hwnd,IDC_TBR_SATURATION,TBM_SETPOS,TRUE,writeSaturation(cfgSet(IDFF_saturation,Tconfig::saturationDef)));
     return TRUE;
     
    case IDC_CHB_XSHARPEN:
     cfgSet(IDFF_isSharpen,getCheck(IDC_CHB_XSHARPEN));
     return TRUE;
    case IDC_RBT_SHARPEN_XSHARPEN:
    case IDC_RBT_SHARPEN_UNSHARPMASK:
     cfgSet(IDFF_sharpenMethod,getCheck(IDC_RBT_SHARPEN_XSHARPEN)?0:1);
     sharpen2dlg();
     return TRUE; 
     
    case IDC_RBT_NOISE_MOJ:
    case IDC_RBT_NOISE_AVIH:
     cfgSet(IDFF_noiseMethod,getCheck(IDC_RBT_NOISE_AVIH)?1:0);
     return TRUE;
    case IDC_CHB_NOISE_UNIFORM:
     cfgSet(IDFF_uniformNoise,getCheck(IDC_CHB_NOISE_UNIFORM));
     return TRUE;
   };
   break;
  case WM_TIMER:
   if (wParam==POSTPROC_TIMER/* && !cfgGet(IDFF_ppIsCustom)*/)
    {
     if (!cfgGet(IDFF_autoq)) cfgSet(IDFF_currentq,cfgGet(IDFF_ppqual));
     SendDlgItemMessage(m_hwnd,IDC_TBR_PPQUAL,TBM_SETSELEND,TRUE,cfgGet(IDFF_currentq));
     setPPchbs();
     return TRUE;
    };   
   break;
  };
 return FALSE;
};
Ejemplo n.º 24
0
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);
}
Ejemplo n.º 25
0
INT_PTR TvolumePage::msgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
    switch (uMsg) {
    case WM_HSCROLL:
        switch (getId(HWND(lParam))) {
        case IDC_TBR_VOLUME_MASTER:
            volTbr2cfg(IDC_TBR_VOLUME_MASTER, IDFF_volume, 1);
            master2dlg();
            return TRUE;
        }
        break;
    case WM_VSCROLL:
        switch (getId(HWND(lParam))) {
        case IDC_TBR_VOLUME_L:
            volTbr2cfg(IDC_TBR_VOLUME_L, IDFF_volumeL, -1);
            speakers2dlg();
            return TRUE;
        case IDC_TBR_VOLUME_C:
            volTbr2cfg(IDC_TBR_VOLUME_C, IDFF_volumeC, -1);
            speakers2dlg();
            return TRUE;
        case IDC_TBR_VOLUME_R:
            volTbr2cfg(IDC_TBR_VOLUME_R, IDFF_volumeR, -1);
            speakers2dlg();
            return TRUE;
        case IDC_TBR_VOLUME_SL:
            volTbr2cfg(IDC_TBR_VOLUME_SL, IDFF_volumeSL, -1);
            speakers2dlg();
            return TRUE;
        case IDC_TBR_VOLUME_SR:
            volTbr2cfg(IDC_TBR_VOLUME_SR, IDFF_volumeSR, -1);
            speakers2dlg();
            return TRUE;
        case IDC_TBR_VOLUME_AL:
            volTbr2cfg(IDC_TBR_VOLUME_AL, IDFF_volumeAL, -1);
            speakers2dlg();
            return TRUE;
        case IDC_TBR_VOLUME_AR:
            volTbr2cfg(IDC_TBR_VOLUME_AR, IDFF_volumeAR, -1);
            speakers2dlg();
            return TRUE;
        case IDC_TBR_VOLUME_LFE:
            volTbr2cfg(IDC_TBR_VOLUME_LFE, IDFF_volumeLFE, -1);
            speakers2dlg();
            return TRUE;
        }
        break;
    case WM_COMMAND:
        switch (LOWORD(wParam)) {
        case IDC_ED_VOLUME_NORMALIZE_MAX:
            if (HIWORD(wParam) == EN_CHANGE && !isSetWindowText) {
                HWND hed = GetDlgItem(m_hwnd, LOWORD(wParam));
                if (hed != GetFocus()) {
                    return FALSE;
                }
                repaint(hed);
                parent->setChange();
                break;
            }
            break;
        case IDC_CHB_VOLUME_L_MUTE:
        case IDC_CHB_VOLUME_C_MUTE:
        case IDC_CHB_VOLUME_R_MUTE:
        case IDC_CHB_VOLUME_SL_MUTE:
        case IDC_CHB_VOLUME_SR_MUTE:
        case IDC_CHB_VOLUME_AL_MUTE:
        case IDC_CHB_VOLUME_AR_MUTE:
        case IDC_CHB_VOLUME_LFE_MUTE: {
            int idff = ((TwidgetMS*)Twidget::getDlgItem((HWND)lParam))->idff;
            cfgSet(idff, getCheck(LOWORD(wParam)));
            mute2dlg();
            break;
        }
        case IDC_CHB_VOLUME_L_SOLO:
        case IDC_CHB_VOLUME_C_SOLO:
        case IDC_CHB_VOLUME_R_SOLO:
        case IDC_CHB_VOLUME_SL_SOLO:
        case IDC_CHB_VOLUME_SR_SOLO:
        case IDC_CHB_VOLUME_AL_SOLO:
        case IDC_CHB_VOLUME_AR_SOLO:
        case IDC_CHB_VOLUME_LFE_SOLO: {
            int idff = ((TwidgetMS*)Twidget::getDlgItem((HWND)lParam))->idff;
            for (int i = 0; i < countof(idffsMS); i++)
                if (idffsMS[i] == idff) {
                    cfgSet(idff, getCheck(LOWORD(wParam)) ? 2 : 0);
                } else {
                    cfgSet(idffsMS[i], 0);
                }
            mute2dlg();
            break;
        }
        }
        break;
    case WM_CTLCOLOREDIT: {
        HWND hwnd = HWND(lParam);
        bool ok;
        switch (getId(hwnd)) {
        case IDC_ED_VOLUME_NORMALIZE_MAX:
            ok = eval(hwnd, 0, isdb ? 30 : MAX_AMPLIFICATION);
            break;
        default:
            return FALSE;
        }
        if (!ok) {
            HDC dc = HDC(wParam);
            SetBkColor(dc, RGB(255, 0, 0));
            return INT_PTR(getRed());
        } else {
            return FALSE;
        }
    }
    }
    return TconfPageDecAudio::msgProc(uMsg, wParam, lParam);
}
Ejemplo n.º 26
0
HRESULT TcropNzoomPage::msgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
 switch (uMsg)
  {
   case WM_DESTROY:
    if (red) DeleteObject(red);
    return TRUE;
   case WM_HSCROLL:
    if (HWND(lParam)==GetDlgItem(m_hwnd,IDC_TBR_ZOOMX) || HWND(lParam)==GetDlgItem(m_hwnd,IDC_TBR_ZOOMY))
     {
      cfgSet(IDFF_magnificationX,SendDlgItemMessage(m_hwnd,IDC_TBR_ZOOMX,TBM_GETPOS,0,0));
      cfgSet(IDFF_magnificationY,SendDlgItemMessage(m_hwnd,IDC_TBR_ZOOMY,TBM_GETPOS,0,0));
      crop2dlg();
      return TRUE;
     }
    else 
     break; 
   case WM_COMMAND:
    switch (LOWORD(wParam))  
     {
      case IDC_CHB_CROPNZOOM:
       setInter(getCheck(IDC_CHB_CROPNZOOM));
       parent->drawInter();
       return TRUE; 
      case IDC_RBT_ZOOM:
      case IDC_RBT_CROP:
       cfgSet(IDFF_isZoom,getCheck(IDC_RBT_ZOOM));
       return TRUE; 
      case IDC_CHB_MAGNIFICATION_LOCKED:
       cfgSet(IDFF_magnificationLocked,getCheck(IDC_CHB_MAGNIFICATION_LOCKED));
       crop2dlg();
       return TRUE;
      case IDC_ED_CROP_LEFT:
      case IDC_ED_CROP_RIGHT:
      case IDC_ED_CROP_TOP:
      case IDC_ED_CROP_BOTTOM:
       if (HIWORD(wParam)==EN_CHANGE) 
        {
         HWND hed=GetDlgItem(m_hwnd,LOWORD(wParam));
         if (hed!=GetFocus()) return FALSE;
         InvalidateRect(hed,NULL,TRUE);
         BOOL ok;
         if (cropOK(GetDlgItem(m_hwnd,IDC_ED_CROP_LEFT  ))) cfgSet(IDFF_cropLeft  ,GetDlgItemInt(m_hwnd,IDC_ED_CROP_LEFT  ,&ok,FALSE));
         if (cropOK(GetDlgItem(m_hwnd,IDC_ED_CROP_RIGHT ))) cfgSet(IDFF_cropRight ,GetDlgItemInt(m_hwnd,IDC_ED_CROP_RIGHT ,&ok,FALSE));
         if (cropOK(GetDlgItem(m_hwnd,IDC_ED_CROP_TOP   ))) cfgSet(IDFF_cropTop   ,GetDlgItemInt(m_hwnd,IDC_ED_CROP_TOP   ,&ok,FALSE));
         if (cropOK(GetDlgItem(m_hwnd,IDC_ED_CROP_BOTTOM))) cfgSet(IDFF_cropBottom,GetDlgItemInt(m_hwnd,IDC_ED_CROP_BOTTOM,&ok,FALSE));
         return TRUE;  
        }
       break;
     }
    break; 
   case WM_CTLCOLOREDIT:
    {
     HWND hwnd=HWND(lParam);
     if (hwnd!=GetDlgItem(m_hwnd,IDC_ED_CROP_LEFT) && hwnd!=GetDlgItem(m_hwnd,IDC_ED_CROP_RIGHT) && hwnd!=GetDlgItem(m_hwnd,IDC_ED_CROP_TOP) && hwnd!=GetDlgItem(m_hwnd,IDC_ED_CROP_BOTTOM)) return FALSE;
     if (!red) red=CreateSolidBrush(RGB(255,0,0));
     if (!cropOK(hwnd))
      {
       HDC dc=HDC(wParam);
       SetBkColor(dc,RGB(255,0,0));
       return HRESULT(red); 
      }
     else return FALSE;  
    }
  }   
 return FALSE;
}
Ejemplo n.º 27
0
int getButton()
{
	return getCheck(buttoncheck);
}
Ejemplo n.º 28
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);
}
Ejemplo n.º 29
0
HRESULT TpostProcPage::msgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
 switch (uMsg)
  {
   case WM_HSCROLL:
    if (HWND(lParam)==GetDlgItem(m_hwnd,IDC_TBR_PPQUAL))
     {
      cfgSet(IDFF_ppqual,SendDlgItemMessage(m_hwnd,IDC_TBR_PPQUAL,TBM_GETPOS,0,0));
      cfgSet(IDFF_currentq,cfgGet(IDFF_ppqual));
      setPPchbs();
      return TRUE;
     }
    break;  
   case WM_COMMAND:
    switch (LOWORD(wParam))  
     {
      case IDC_CHB_POSTPROC:
       cfgSet(IDFF_isPostproc,getCheck(IDC_CHB_POSTPROC));
       parent->drawInter();
       return TRUE;
      case IDC_RBT_PPPRESETS:
      case IDC_RBT_PPCUSTOM:
       cfgSet(IDFF_ppIsCustom,getCheck(IDC_RBT_PPCUSTOM));
       setPPchbs();
       return TRUE;
      case IDC_CHB_AUTOQ:
       cfgSet(IDFF_autoq,getCheck(IDC_CHB_AUTOQ));
       cfgSet(IDFF_currentq,cfgGet(IDFF_ppqual));
       setPPchbs();
       return TRUE;
      case IDC_CHB_DEBLOCKV_LUM:
      case IDC_CHB_DEBLOCKH_LUM:
      case IDC_CHB_DEBLOCKV_CHROM:
      case IDC_CHB_DEBLOCKH_CHROM:
      case IDC_CHB_DERING_LUM:
      case IDC_CHB_DERING_CHROM:
       {
        int ppcustom=0;
        ppcustom|=getCheck(IDC_CHB_DEBLOCKV_LUM  )?LUM_V_DEBLOCK:0;
        ppcustom|=getCheck(IDC_CHB_DEBLOCKH_LUM  )?LUM_H_DEBLOCK:0;
        ppcustom|=getCheck(IDC_CHB_DEBLOCKV_CHROM)?CHROM_V_DEBLOCK:0;
        ppcustom|=getCheck(IDC_CHB_DEBLOCKH_CHROM)?CHROM_H_DEBLOCK:0;
        ppcustom|=getCheck(IDC_CHB_DERING_LUM    )?LUM_DERING:0;
        ppcustom|=getCheck(IDC_CHB_DERING_CHROM  )?CHROM_DERING:0;
        cfgSet(IDFF_ppcustom,ppcustom);
        setPPchbs();
        return TRUE;
       }
      case IDC_CHB_LEVELFIX_LUM:
      case IDC_CHB_LEVELFIX_CHROM:
       {
        cfgSet(IDFF_levelFixLum  ,getCheck(IDC_CHB_LEVELFIX_LUM  ));
        cfgSet(IDFF_levelFixChrom,getCheck(IDC_CHB_LEVELFIX_CHROM));
        return TRUE;
       }
     }  
    break; 
   case WM_TIMER:
    if (wParam==POSTPROC_TIMER/* && !cfgGet(IDFF_ppIsCustom)*/)
     {
      //if (!cfgGet(IDFF_autoq)) cfgSet(IDFF_currentq,cfgGet(IDFF_ppqual));
      SendDlgItemMessage(m_hwnd,IDC_TBR_PPQUAL,TBM_SETSELEND,TRUE,cfgGet(IDFF_currentq));
      setPPchbs();
      return TRUE;
     };   
    break;
   case WM_DESTROY:
    KillTimer(m_hwnd,POSTPROC_TIMER);
    break;
  }
 return FALSE;
}
Ejemplo n.º 30
0
INT_PTR TlevelsPage::msgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
    switch (uMsg) {
        case WM_DESTROY:
            SelectObject(hdcGradient,oldHDCgradient);
            DeleteDC(hdcGradient);
            DeleteBitmap(bmpGradient);
            DeleteFont(fontGradient);
            SendMessage(GetDlgItem(m_hwnd,IDC_LBX_LEVELS_CURVES),WM_SETFONT,NULL,FALSE);
            DeleteFont(fontCurier);
            break;
        case WM_DRAWITEM:
            switch (wParam) {
                case IDC_BMP_HISTOGRAM: {
                    LPDRAWITEMSTRUCT dis=LPDRAWITEMSTRUCT(lParam);
                    int full=cfgGet(IDFF_levelsFullY);
                    StretchDIBits(dis->hDC,0,0,dis->rcItem.right,dis->rcItem.bottom,full?0:16,0,full?256:234-16+1,64,histogramBits,(BITMAPINFO*)&histogramBmp,DIB_RGB_COLORS,SRCCOPY);
                    wIn->draw(dis);
                    return TRUE;
                }
                case IDC_BMP_LEVELS_IN: {
                    LPDRAWITEMSTRUCT dis=LPDRAWITEMSTRUCT(lParam);
                    StretchBlt(dis->hDC,0,0,dis->rcItem.right,10,hdcGradient,0,0,256,1,SRCCOPY);
                    RECT r=dis->rcItem;
                    r.top=10;
                    FillRect(dis->hDC,&r,GetSysColorBrush(COLOR_BTNFACE));
                    if (filter && getCheck(IDC_CHB_LEVELS_INPUT_AUTO)) {
                        int min,max;
                        filter->getInAuto(&min,&max);
                        drawTriangle(dis,min,true);
                        drawTriangle(dis,max,true);
                    }
                    drawTriangle(dis,cfgGet(IDFF_levelsInMin));
                    drawTriangle(dis,cfgGet(IDFF_levelsInMax));
                    return TRUE;
                }
                case IDC_BMP_LEVELS_OUT: {
                    LPDRAWITEMSTRUCT dis=LPDRAWITEMSTRUCT(lParam);
                    StretchBlt(dis->hDC,0,0,dis->rcItem.right,10,hdcGradient,0,0,256,1,SRCCOPY);
                    RECT r=dis->rcItem;
                    r.top=10;
                    FillRect(dis->hDC,&r,GetSysColorBrush(COLOR_BTNFACE));
                    drawTriangle(dis,cfgGet(IDFF_levelsOutMin));
                    drawTriangle(dis,cfgGet(IDFF_levelsOutMax));
                    return TRUE;
                }
                case IDC_BMP_LEVELS_CURVES: {
                    LPDRAWITEMSTRUCT dis=LPDRAWITEMSTRUCT(lParam);
                    StretchDIBits(dis->hDC,0,0,dis->rcItem.right,dis->rcItem.bottom,0,0,256,256,histogramBits,(BITMAPINFO*)&curvesBmp,DIB_RGB_COLORS,SRCCOPY);
                    wCurves->draw(dis);
                    return TRUE;
                }
            }
            break;
        case WM_SETCURSOR:
            if (HWND(wParam)==hcurves) {
                if (wCurves->setCursor()) {
                    SetCursor(LoadCursor(NULL,IDC_SIZEALL));
                    setDlgResult(TRUE);
                }
                return TRUE;
            }
            break;
    }
    return TconfPageDecVideo::msgProc(uMsg,wParam,lParam);
}