本文整理汇总了C++中IPropertyBag::Write方法的典型用法代码示例。如果您正苦于以下问题:C++ IPropertyBag::Write方法的具体用法?C++ IPropertyBag::Write怎么用?C++ IPropertyBag::Write使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IPropertyBag
的用法示例。
在下文中一共展示了IPropertyBag::Write方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PyCom_BuildPyException
// @pymethod |PyIPropertyBag|Write|Called by the control to write each property in turn to the storage provided by the container.
PyObject *PyIPropertyBag::Write(PyObject *self, PyObject *args)
{
PyObject *obName;
PyObject *obValue;
// @pyparm str|propName||Name of the property to read.
// @pyparm object|value||The value for the property. The value must be able to be converted to a COM VARIANT.
if ( !PyArg_ParseTuple(args, "OO:Write", &obName, &obValue) )
return NULL;
IPropertyBag *pIPB = GetI(self);
if ( pIPB == NULL )
return NULL;
TmpWCHAR Name;
if ( !PyWinObject_AsWCHAR(obName, &Name))
return NULL;
VARIANT var;
if ( !PyCom_VariantFromPyObject(obValue, &var) )
return NULL;
PY_INTERFACE_PRECALL;
HRESULT hr = pIPB->Write(Name, &var);
VariantClear(&var);
PY_INTERFACE_POSTCALL;
if ( FAILED(hr) )
return PyCom_BuildPyException(hr, pIPB, IID_IPropertyBag);
Py_INCREF(Py_None);
return Py_None;
}
示例2: LogDeviceInformation
void Audio::LogDeviceInformation(IEnumMoniker *pEnum)
{
logger.addline("Starting to record audio or video input devices.", info);
IMoniker *pMoniker = NULL;
while (pEnum->Next(1, &pMoniker, NULL) == S_OK)
{
logger.addline("Have found a new device", success);
IPropertyBag *pPropBag;
HRESULT hr = pMoniker->BindToStorage(0, 0, IID_PPV_ARGS(&pPropBag));
if (FAILED(hr))
{
pMoniker->Release();
continue;
}
VARIANT var;
VariantInit(&var);
// Get description or friendly name.
hr = pPropBag->Read(L"Description", &var, 0);
if (FAILED(hr))
{
hr = pPropBag->Read(L"FriendlyName", &var, 0);
}
if (SUCCEEDED(hr))
{
//printf("%S\n", var.bstrVal);
logger.addline("Below is the device name.", debug);
logger.addline(ConvertBSTRToMBS(var.bstrVal), debug);
VariantClear(&var);
}
hr = pPropBag->Write(L"FriendlyName", &var);
// WaveInID applies only to audio capture devices.
hr = pPropBag->Read(L"WaveInID", &var, 0);
if (SUCCEEDED(hr))
{
//printf("WaveIn ID: %d\n", var.lVal);
logger.addline("Below is the WaveIn ID.", debug);
logger.addline("BLANK FOR NOW! FIX ME LATER", debug);
VariantClear(&var);
}
hr = pPropBag->Read(L"DevicePath", &var, 0);
if (SUCCEEDED(hr))
{
// The device path is not intended for display.
printf("Device path: %S\n", var.bstrVal);
logger.addline("Below is the device path.", debug);
//logger.addline(ConvertBSTRToMBS(var.bstrVal), success);
VariantClear(&var);
}
pPropBag->Release();
pMoniker->Release();
}
}
示例3: DisplayDeviceInformation
void DisplayDeviceInformation(IEnumMoniker *pEnum)
{
IMoniker *pMoniker = NULL;
while (pEnum->Next(1, &pMoniker, NULL) == S_OK)
{
IPropertyBag *pPropBag;
HRESULT hr = pMoniker->BindToStorage(0, 0, IID_PPV_ARGS(&pPropBag));
if (FAILED(hr))
{
pMoniker->Release();
continue;
}
VARIANT var;
VariantInit(&var);
// Get description or friendly name.
hr = pPropBag->Read(L"Description", &var, 0);
if (FAILED(hr))
{
hr = pPropBag->Read(L"FriendlyName", &var, 0);
}
if (SUCCEEDED(hr))
{
out_message() << "Capture device: " << var.bstrVal << std::endl;
VariantClear(&var);
}
hr = pPropBag->Write(L"FriendlyName", &var);
// WaveInID applies only to audio capture devices.
hr = pPropBag->Read(L"WaveInID", &var, 0);
if (SUCCEEDED(hr))
{
out_message() << "Audio device: " << var.lVal << std::endl;
VariantClear(&var);
}
hr = pPropBag->Read(L"DevicePath", &var, 0);
if (SUCCEEDED(hr))
{
// The device path is not intended for display.
out_message() << "Video device: " << var.bstrVal << std::endl;
VariantClear(&var);
}
pPropBag->Release();
pMoniker->Release();
}
}
示例4: DbgLog
// ILAVDecoder
STDMETHODIMP CDecWMV9::Init()
{
DbgLog((LOG_TRACE, 10, L"CDecWMV9::Init(): Trying to open WMV9 DMO decoder"));
HRESULT hr = S_OK;
// Disable deinterlacing setting in the registry
// Apparently required on XP
CreateRegistryKey(HKEY_CURRENT_USER, L"Software\\Microsoft\\Scrunch");
CRegistry reg = CRegistry(HKEY_CURRENT_USER, L"Software\\Microsoft\\Scrunch", hr);
if (SUCCEEDED(hr)) {
reg.ReadDWORD(L"Deinterlace.old", hr);
if (FAILED(hr)) {
DWORD dwValue = reg.ReadDWORD(L"Deinterlace", hr);
if (FAILED(hr))
dwValue = 0;
reg.WriteDWORD(L"Deinterlace.old", dwValue);
reg.WriteDWORD(L"Deinterlace", 0);
}
}
hr = CoCreateInstance(CLSID_CWMVDecMediaObject, NULL, CLSCTX_INPROC_SERVER, IID_IMediaObject, (void **)&m_pDMO);
if (FAILED(hr)) {
DbgLog((LOG_TRACE, 10, L"-> Failed to create DMO object"));
return hr;
}
// Force decoder deinterlacing to off
IPropertyBag *pProp = NULL;
hr = m_pDMO->QueryInterface(&pProp);
if (SUCCEEDED(hr)) {
VARIANT var = {0};
var.vt = VT_BOOL;
var.boolVal = FALSE;
pProp->Write(g_wszWMVCDecoderDeinterlacing, &var);
SafeRelease(&pProp);
}
return S_OK;
}
示例5: SetVideoParams
HRESULT SetVideoParams( IMediaObject *pDMO, VideoEncParams *pParams )
{
HRESULT hr;
VARIANT varg;
IPropertyBag *pPropertyBag = NULL;
if( NULL == pDMO || NULL == pParams )
{
return ( E_INVALIDARG );
}
do
{
//
// Get the IPropertyBag IF and set the appropriate params
//
hr = pDMO->QueryInterface(IID_IPropertyBag, (void**)&pPropertyBag);
if( FAILED( hr ) )
{
break;
}
//
//set the encoder in VBR mode if required
//
if( pParams->fIsVBR == TRUE )
{
::VariantInit(&varg);
varg.vt = VT_BOOL;
varg.boolVal = TRUE;
hr = pPropertyBag->Write( g_wszWMVCVBREnabled, &varg );
if( FAILED( hr ) )
{
hr = E_VIDEO_VBR_NOT_SUPPORTED;
break;
}
//
// if it is 1 pass VBR set the Quality param
//
if( pParams->nPasses == 1 )
{
::VariantInit(&varg);
varg.vt = VT_I4;
varg.lVal = pParams->nVBRQuality;
hr = pPropertyBag->Write( g_wszWMVCVBRQuality, &varg );
if( FAILED( hr ) )
{
hr = E_VBR_QUALITY_REJECTED;
break;
}
}
}
//
//set the number of passes
//
if( pParams->nPasses > 1 )
{
::VariantInit(&varg);
varg.vt = VT_I4;
varg.lVal = pParams->nPasses;
hr = pPropertyBag->Write( g_wszWMVCPassesUsed, &varg );
if( FAILED( hr ) )
{
hr = E_VIDEO_NPASS_NOT_SUPPORTED;
break;
}
}
//
// set the bitrate for all the modes except 1 pass VBR
//
if( !( pParams->fIsVBR == TRUE && pParams->nPasses == 1 ) )
{
::VariantInit(&varg);
varg.vt = VT_I4;
varg.lVal = pParams->nBitrate;
hr = pPropertyBag->Write( g_wszWMVCAvgBitrate, &varg );
if( FAILED( hr ) )
{
hr = E_VIDEO_BITRATE_REJECTED;
break;
}
}
//
// set the buffer window
//
::VariantInit(&varg);
varg.vt = VT_I4;
varg.lVal = pParams->nBufferDelay;
hr = pPropertyBag->Write( g_wszWMVCVideoWindow, &varg );
if( FAILED( hr ) )
{
hr = E_VIDEO_BUFFER_REJECTED;
break;
}
if( pParams->fIsConstrained == TRUE )
{
::VariantInit(&varg);
varg.vt = VT_I4;
//.........这里部分代码省略.........