AxisMediaControlWidget
::AxisMediaControlWidget(QWidget *parent, Qt
::WFlags flags
){
m_axis
->setControl
(QString::fromUtf8("{745395C8-D0E1-4227-8586-624CA9A10A8D}"));
m_axis
->setObjectName
(QString::fromUtf8("CAxismediacontrol"));
EXCEPINFO excepInfo;
memset(&excepInfo, 0, sizeof excepInfo);
UINT nArgErr = (UINT)-1; // initialize to invalid arg
DISPPARAMS dispparams;
memset(&dispparams, 0, sizeof dispparams);
dispparams.cArgs = 1;
dispparams.cNamedArgs = 1;
DISPID dispidNamed = DISPID_PROPERTYPUT;
dispparams.rgdispidNamedArgs = &dispidNamed;
VARIANT* pArg = new VARIANT[dispparams.cArgs];
dispparams.rgvarg = pArg;
memset(pArg, 0, sizeof(VARIANT) * dispparams.cArgs);
IDispatch *iface = 0;
m_axis
->queryInterface
((QUuid)IID_IDispatch,
(void**)&iface
);
if (iface)
{
pArg->vt = VT_EMPTY;
dispparams.cArgs = 0;
dispparams.cNamedArgs = 0;
iface->Invoke(102, IID_NULL, 0, DISPATCH_METHOD, &dispparams, 0, &excepInfo, &nArgErr);
dispparams.cArgs = 1;
dispparams.cNamedArgs = 1;
// put_PTZControlURL
pArg->bstrVal = (L"http://10.67.148.30/axis-cgi/com/ptz.cgi");
iface->Invoke(0x1e, IID_NULL, 0, DISPATCH_PROPERTYPUT, &dispparams, 0, &excepInfo, &nArgErr);
// put_UIMode
pArg->bstrVal = _T("ptz-absolute");
iface->Invoke(0x3, IID_NULL, 0, DISPATCH_PROPERTYPUT, &dispparams, 0, &excepInfo, &nArgErr);
pArg->vt = VT_BOOL;
pArg->boolVal = VARIANT_TRUE;
iface->Invoke(0x12, IID_NULL, 0, DISPATCH_PROPERTYPUT, &dispparams, 0, &excepInfo, &nArgErr);
iface->Invoke(0x11, IID_NULL, 0, DISPATCH_PROPERTYPUT, &dispparams, 0, &excepInfo, &nArgErr);
iface->Invoke(0x10, IID_NULL, 0, DISPATCH_PROPERTYPUT, &dispparams, 0, &excepInfo, &nArgErr);
iface->Invoke(0x73, IID_NULL, 0, DISPATCH_PROPERTYPUT, &dispparams, 0, &excepInfo, &nArgErr);
iface->Invoke(0x75, IID_NULL, 0, DISPATCH_PROPERTYPUT, &dispparams, 0, &excepInfo, &nArgErr);
pArg->vt = VT_BSTR;
pArg->bstrVal = (L"default,+ptz");
iface->Invoke(0x13, IID_NULL, 0, DISPATCH_PROPERTYPUT, &dispparams, 0, &excepInfo, &nArgErr);
pArg->bstrVal = (L"http://10.67.148.30/axis-cgi/mjpg/video.cgi");
iface->Invoke(1, IID_NULL, 0, DISPATCH_PROPERTYPUT, &dispparams, 0, &excepInfo, &nArgErr);
pArg->bstrVal = (L"mjpg");
iface->Invoke(9, IID_NULL, 0, DISPATCH_PROPERTYPUT, &dispparams, 0, &excepInfo, &nArgErr);
// Play
pArg->vt = VT_EMPTY;
dispparams.cArgs = 0;
dispparams.cNamedArgs = 0;
dispparams.rgdispidNamedArgs = 0;
dispparams.rgvarg = 0;
iface->Invoke(101, IID_NULL, 0, DISPATCH_METHOD, &dispparams, 0, &excepInfo, &nArgErr);
iface->Release();
}
m_glay->addWidget(m_axis, 0, 0);
}
AxisMediaControlWidget::AxisMediaControlWidget(QWidget *parent, Qt::WFlags flags)
: QWidget(parent, flags)
{
m_axis = new QAxWidget(this);
m_glay = new QGridLayout(this);
m_axis->setControl(QString::fromUtf8("{745395C8-D0E1-4227-8586-624CA9A10A8D}"));
m_axis->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
m_axis->setObjectName(QString::fromUtf8("CAxismediacontrol"));
EXCEPINFO excepInfo;
memset(&excepInfo, 0, sizeof excepInfo);
UINT nArgErr = (UINT)-1; // initialize to invalid arg
DISPPARAMS dispparams;
memset(&dispparams, 0, sizeof dispparams);
dispparams.cArgs = 1;
dispparams.cNamedArgs = 1;
DISPID dispidNamed = DISPID_PROPERTYPUT;
dispparams.rgdispidNamedArgs = &dispidNamed;
VARIANT* pArg = new VARIANT[dispparams.cArgs];
dispparams.rgvarg = pArg;
memset(pArg, 0, sizeof(VARIANT) * dispparams.cArgs);
IDispatch *iface = 0;
m_axis->queryInterface((QUuid)IID_IDispatch, (void**)&iface);
if (iface)
{
pArg->vt = VT_EMPTY;
dispparams.cArgs = 0;
dispparams.cNamedArgs = 0;
iface->Invoke(102, IID_NULL, 0, DISPATCH_METHOD, &dispparams, 0, &excepInfo, &nArgErr);
dispparams.cArgs = 1;
dispparams.cNamedArgs = 1;
// put_PTZControlURL
pArg->bstrVal = (L"http://10.67.148.30/axis-cgi/com/ptz.cgi");
iface->Invoke(0x1e, IID_NULL, 0, DISPATCH_PROPERTYPUT, &dispparams, 0, &excepInfo, &nArgErr);
// put_UIMode
pArg->bstrVal = _T("ptz-absolute");
iface->Invoke(0x3, IID_NULL, 0, DISPATCH_PROPERTYPUT, &dispparams, 0, &excepInfo, &nArgErr);
pArg->vt = VT_BOOL;
pArg->boolVal = VARIANT_TRUE;
iface->Invoke(0x12, IID_NULL, 0, DISPATCH_PROPERTYPUT, &dispparams, 0, &excepInfo, &nArgErr);
iface->Invoke(0x11, IID_NULL, 0, DISPATCH_PROPERTYPUT, &dispparams, 0, &excepInfo, &nArgErr);
iface->Invoke(0x10, IID_NULL, 0, DISPATCH_PROPERTYPUT, &dispparams, 0, &excepInfo, &nArgErr);
iface->Invoke(0x73, IID_NULL, 0, DISPATCH_PROPERTYPUT, &dispparams, 0, &excepInfo, &nArgErr);
iface->Invoke(0x75, IID_NULL, 0, DISPATCH_PROPERTYPUT, &dispparams, 0, &excepInfo, &nArgErr);
pArg->vt = VT_BSTR;
pArg->bstrVal = (L"default,+ptz");
iface->Invoke(0x13, IID_NULL, 0, DISPATCH_PROPERTYPUT, &dispparams, 0, &excepInfo, &nArgErr);
pArg->bstrVal = (L"http://10.67.148.30/axis-cgi/mjpg/video.cgi");
iface->Invoke(1, IID_NULL, 0, DISPATCH_PROPERTYPUT, &dispparams, 0, &excepInfo, &nArgErr);
pArg->bstrVal = (L"mjpg");
iface->Invoke(9, IID_NULL, 0, DISPATCH_PROPERTYPUT, &dispparams, 0, &excepInfo, &nArgErr);
// Play
pArg->vt = VT_EMPTY;
dispparams.cArgs = 0;
dispparams.cNamedArgs = 0;
dispparams.rgdispidNamedArgs = 0;
dispparams.rgvarg = 0;
iface->Invoke(101, IID_NULL, 0, DISPATCH_METHOD, &dispparams, 0, &excepInfo, &nArgErr);
iface->Release();
}
m_glay->addWidget(m_axis, 0, 0);
}
To copy to clipboard, switch view to plain text mode
Bookmarks