Exemple #1
0
void Tpresets::listRegKeys(strings &l)
{
    l.clear();

    HKEY hKey;
    char_t rkey[MAX_PATH];
    tsnprintf_s(rkey, countof(rkey), _TRUNCATE, FFDSHOW_REG_PARENT _l("\\%s"), reg_child);
    RegOpenKeyEx(HKEY_CURRENT_USER,rkey,0,KEY_READ,&hKey);
    for (int i=0,retCode=ERROR_SUCCESS; retCode==ERROR_SUCCESS; i++) {
        char_t keyName[256];
        DWORD keyNameSize=255;
        FILETIME ftLastWriteTime;
        retCode = RegEnumKeyEx(hKey,
                               i,
                               keyName,
                               &keyNameSize,
                               NULL,
                               NULL,
                               NULL,
                               &ftLastWriteTime
                              );
        if (retCode==ERROR_SUCCESS) {
            l.push_back(ffstring(keyName));
        } else {
            break;
        }
    }
    RegCloseKey(hKey);
}
Exemple #2
0
const char_t* Twindow::_(int id,const char_t *s,bool addcbx)
{
    if (addcbx && tr->translateMode && s[0]) {
        strings &list=translateCbxs[id];
        if (!isIn(list,ffstring(s))) {
            list.push_back(s);
        }
    }
    return tr->translate(s);
}
ffstring TconvolverPage::getWavDesc(const char_t *flnm,int idc)
{
    TwavReader<float> wav(flnm,true);
    if (wav.empty()) {
        return _(idc,_l("invalid"));
    } else {
        char_t desc[256];
        wav.descriptionPCM(desc,256);
        return desc+ffstring(_l(", "))+ffstring::intToStr((int)wav[0].size())+_l(" samples");
    }
}
ffstring TconvolverPage::selectFile(int idff,int idc)
{
    char_t flnm[MAX_PATH];
    cfgGet(idff,flnm,MAX_PATH);
    if (dlgGetFile(false,m_hwnd,_(-IDD_CONVOLVER,_l("Select impulse file")),_l("Wave files (*.wav,*.wv)\0*.wav;*.wv\0All files (*.*)\0*.*\0"),_l("wav"),flnm,_l("."),0)) {
        if (idc) {
            setDlgItemText(m_hwnd,idc,flnm);
        }
        cfgSet(idff,flnm);
        return flnm;
    } else {
        return ffstring();
    }
}
void TvideoCodecLibavcodecDxva::detectVideoCard(HWND hwnd)
{
    IDirect3D9* pD3D9;
    nPCIVendor = 0;
    nPCIDevice = 0;
    videoDriverVersion.HighPart = 0;
    videoDriverVersion.LowPart = 0;

    if (pD3D9 = Direct3DCreate9(D3D_SDK_VERSION)) {
        D3DADAPTER_IDENTIFIER9 adapterIdentifier;
        if (pD3D9->GetAdapterIdentifier(getAdapter(pD3D9, hwnd), 0, &adapterIdentifier) == S_OK) {
            nPCIVendor = adapterIdentifier.VendorId;
            nPCIDevice = adapterIdentifier.DeviceId;
            videoDriverVersion = adapterIdentifier.DriverVersion;
            strDeviceDescription = text<char_t>(adapterIdentifier.Description);
            strDeviceDescription.append(ffstring(_l(" (")) + ffstring::intToStr(nPCIVendor) + ffstring(_l(")")));
        }
        pD3D9->Release();
    }
}