Exemple #1
0
void TresizeAspectPage::onResizeAspectMenu(void)
{
    static const char_t *aspects[] = {
        _l("4:3"),
        _l("5:4"),
        _l("16:9"),
        _l("2.35:1"),
        NULL
    };
    int cmd = selectFromMenu(aspects, IDC_BT_RESIZE_ASPECT_MENU, false);
    int a1, a2;
    switch (cmd) {
        case 0:
            a1 =  4;
            a2 =  3;
            break;
        case 1:
            a1 =  5;
            a2 =  4;
            break;
        case 2:
            a1 = 16;
            a2 =  9;
            break;
        case 3:
            a1 = 235;
            a2 = 100;
            break;
        default:
            return;
    }
    cfgSet(IDFF_resizeA1, a1);
    cfgSet(IDFF_resizeA2, a2);
    resize2dlg();
}
Exemple #2
0
int Twindow::selectFromMenu(const strings &items,int id,bool translate,int columnHeight)
{
    Tstrptrs ptritems;
    for (strings::const_iterator s=items.begin(); s!=items.end(); s++) {
        ptritems.push_back(s->c_str());
    }
    ptritems.push_back(NULL);
    return selectFromMenu(&ptritems[0],id,translate,columnHeight);
}
Exemple #3
0
void TresizeAspectPage::onResizeMulfOfMenu(void)
{
    static const char_t *mults[] = {
        _l("2"), _l("4"), _l("8"), _l("16"), _l("32"), _l("64"), _l("128"), NULL
    };
    int cmd = selectFromMenu(mults, IDC_BT_RESIZE_MOD_16, false);
    if (cmd >= 0) {
        cfgSet(IDFF_resizeMultOf, atoi(mults[cmd]));
        resize2dlg();
    }
}
Exemple #4
0
void TresizeAspectPage::onResizeSizeMenu(void)
{
    static const char_t *pixels[] = {
        _l("320x240"),
        _l("640x480"),
        _l("720x480"),
        _l("720x576"),
        _l("1024x768"),
        _l("1280x720"),
        _l("1920x1080"),
        NULL
    };
    int cmd = selectFromMenu(pixels, IDC_BT_RESIZE_SIZE_MENU, false);
    int x, y;
    switch (cmd) {
        case 0:
            x = 320;
            y = 240;
            break;
        case 1:
            x = 640;
            y = 480;
            break;
        case 2:
            x = 720;
            y = 480;
            break;
        case 3:
            x = 720;
            y = 576;
            break;
        case 4:
            x = 1024;
            y = 768;
            break;
        case 5:
            x = 1280;
            y = 720;
            break;
        case 6:
            x = 1920;
            y = 1080;
            break;
        default:
            return;
    }
    cfgSet(IDFF_resizeDx, x);
    cfgSet(IDFF_resizeDy, y);
    cfgSet(IDFF_resizeDy_real, y);
    resize2dlg();
}
Exemple #5
0
void TresizeAspectPage::onResizeManualArMenu(void)
{
    static const char_t *aspects[] = {
        _l("1.25 ( 5:4)"),
        _l("1.33 ( 4:3)"),
        _l("1.67 ( 5:3)"),
        _l("1.78 (16:9)"),
        _l("1.85 (DVD)"),
        _l("2.35 (cinemascope)"),
        _l("2.39 (cinemascope, HD discs)"),
        NULL
    };
    int cmd = selectFromMenu(aspects, IDC_BT_RESIZE_USER_ASPECT, true);
    double ar;
    switch (cmd) {
        case 0:
            ar = 1.25;
            break;
        case 1:
            ar = 4.0 / 3.0;
            break;
        case 2:
            ar = 5.0 / 3.0;
            break;
        case 3:
            ar = 16.0 / 9.0;
            break;
        case 4:
            ar = 1.85;
            break;
        case 5:
            ar = 2.35;
            break;
        case 6:
            ar = 2.39;
            break;
        default:
            return;
    }
    cfgSet(IDFF_aspectRatio, int(ar * 65536.0));
    userAspect2dlg();
}
Exemple #6
0
void TresizeAspectPage::onResizePixMenu(void)
{
    static const char_t *pixels[] = {
        _l("320x240"),
        _l("640x480"),
        NULL
    };
    int cmd = selectFromMenu(pixels, IDC_BT_RESIZE_PIX_MENU, false);
    int pix;
    switch (cmd) {
        case 0:
            pix = 320 * 240;
            break;
        case 1:
            pix = 640 * 480;
            break;
        default:
            return;
    }
    cfgSet(IDFF_resizeIfPixVal, pix);
    resizeIf2dlg();
}
Exemple #7
0
INT_PTR TpresetAutoloadDlgBase::TitemsWindow::msgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
    if (uMsg == WM_COMMAND) {
        int id = LOWORD(wParam) - 1000;
        if (id > 0 && id / 10 < (int)items.size()) {
            Titem &item = items[id / 10];
            if ((id % 10) == 1) {
                item.is = 1 - item.is;
                item.wasChange = true;
            } else if ((id % 10) == 2) {
                if (HIWORD(wParam) == EN_CHANGE && !isSetWindowText) {
                    GetDlgItemText(m_hwnd, LOWORD(wParam), item.val, 256);
                    item.wasChange = true;
                }
            } else if ((id % 10) == 3) {
                Tstrptrs mitems;
                const char_t *mitem;
                for (unsigned int li = 0; (mitem = deciD->getPresetAutoloadItemList(id / 10, li)) != NULL; li++) {
                    mitems.push_back(mitem);
                }
                mitems.push_back(NULL);
                int idx = selectFromMenu(&mitems[0], LOWORD(wParam), false, 20);
                if (idx >= 0) {
                    if (item.val[0] != '\0') {
                        strncat_s(item.val, countof(item.val), _l(";"), _TRUNCATE);
                    }
                    strncat_s(item.val, countof(item.val), mitems[idx], _TRUNCATE);
                    HWND hed = GetDlgItem(m_hwnd, LOWORD(wParam) - 1);
                    SetWindowText(hed, item.val);
                    size_t len = strlen(item.val);
                    SendMessage(hed, EM_SETSEL, len, len);
                }
            } else if ((id % 10) == 4) {
                const char_t *help;
                if (deciD->getPresetAutoloadItemHelp(id / 10, &help) == S_OK) {
                    msg(_(-IDD_PRESET_AUTOLOAD_ITEMS, help), _(-IDD_PRESET_AUTOLOAD_ITEMS, _l("Preset autoload condition help")));
                }
            }
        }
    } else if (uMsg == WM_VSCROLL) {
        SCROLLINFO si;
        si.cbSize = sizeof(si);
        si.fMask  = SIF_ALL;
        GetScrollInfo(m_hwnd, SB_VERT, &si);
        int oldpos = si.nPos;
        switch (LOWORD(wParam)) {
            case SB_LINELEFT:
                si.nPos--;
                break;
            case SB_LINERIGHT:
                si.nPos++;
                break;
            case SB_PAGELEFT:
                si.nPos -= si.nPage;
                break;
            case SB_PAGERIGHT:
                si.nPos += si.nPage;
                break;
            case SB_THUMBTRACK:
                si.nPos = si.nTrackPos;
                break;
            default:
                break;
        }
        si.fMask = SIF_POS;
        SetScrollInfo(m_hwnd, SB_VERT, &si, TRUE);
        GetScrollInfo(m_hwnd, SB_VERT, &si);
        if (si.nPos != oldpos) {
            ScrollWindow(m_hwnd, 0, oldpos - si.nPos, NULL, NULL);
        }
    }
    return TdlgWindow::msgProc(uMsg, wParam, lParam);
}