durbrak
10th December 2006, 22:51
Hello,
I'm trying to adjust the volume of my WindowsMediaPlayer ActiveX control.
Unfortunately, I couldn't find the appropriate methods in QAxWidget::generateDocumentation() but I know they exist. It's actually IWMPSettings::setVolume() where I can adjust the volume.
Now I used Qt's dumpcpp tool to generate the namespace interface thingies but I have no clue how to use it. The generated .h file has the proper method:
class WMPLIB_EXPORT IWMPSettings : public QAxObject
{
public:
IWMPSettings(IDispatch *subobject = 0, QAxObject *parent = 0)
: QAxObject((IUnknown*)subobject, parent)
{
internalRelease();
}
//[...]
/*
Property volume
Returns current audio volume
*/
inline int volume() const; //Returns the value of volume
inline void setVolume(int value); //Sets the value of the volume property
//[...]
};
And here's how I tried it (inside my subclassed QAxWidget):
WMPLib::IWMPSettings *s = 0;
this->queryInterface("{9104D1AB-80C9-4fed-ABF0-2E6417A6DF14}", (void **)&s);
s->setVolume(75);
(I found the Uuid in the WMP-SDK and also on google) But all I get are runtime errors in s->setVolume() (well of course).
So am I understanding something wrong or is it really that hard to get it?
Thank you!
I'm trying to adjust the volume of my WindowsMediaPlayer ActiveX control.
Unfortunately, I couldn't find the appropriate methods in QAxWidget::generateDocumentation() but I know they exist. It's actually IWMPSettings::setVolume() where I can adjust the volume.
Now I used Qt's dumpcpp tool to generate the namespace interface thingies but I have no clue how to use it. The generated .h file has the proper method:
class WMPLIB_EXPORT IWMPSettings : public QAxObject
{
public:
IWMPSettings(IDispatch *subobject = 0, QAxObject *parent = 0)
: QAxObject((IUnknown*)subobject, parent)
{
internalRelease();
}
//[...]
/*
Property volume
Returns current audio volume
*/
inline int volume() const; //Returns the value of volume
inline void setVolume(int value); //Sets the value of the volume property
//[...]
};
And here's how I tried it (inside my subclassed QAxWidget):
WMPLib::IWMPSettings *s = 0;
this->queryInterface("{9104D1AB-80C9-4fed-ABF0-2E6417A6DF14}", (void **)&s);
s->setVolume(75);
(I found the Uuid in the WMP-SDK and also on google) But all I get are runtime errors in s->setVolume() (well of course).
So am I understanding something wrong or is it really that hard to get it?
Thank you!