added getVolume() and setVolume() to HelixPlayer
This commit is contained in:
parent
6c02912c69
commit
d605427efc
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
|
|
||||||
Author : $Author: maroy $
|
Author : $Author: maroy $
|
||||||
Version : $Revision: 1.8 $
|
Version : $Revision: 1.9 $
|
||||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/playlistExecutor/src/Attic/HelixPlayer.cxx,v $
|
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/playlistExecutor/src/Attic/HelixPlayer.cxx,v $
|
||||||
|
|
||||||
------------------------------------------------------------------------------*/
|
------------------------------------------------------------------------------*/
|
||||||
|
@ -38,6 +38,7 @@
|
||||||
#include "LiveSupport/Core/TimeConversion.h"
|
#include "LiveSupport/Core/TimeConversion.h"
|
||||||
#include "HelixEventHandlerThread.h"
|
#include "HelixEventHandlerThread.h"
|
||||||
#include "HelixPlayer.h"
|
#include "HelixPlayer.h"
|
||||||
|
#include <hxausvc.h>
|
||||||
|
|
||||||
|
|
||||||
using namespace LiveSupport::Core;
|
using namespace LiveSupport::Core;
|
||||||
|
@ -329,6 +330,42 @@ HelixPlayer :: close(void) throw ()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------------------
|
||||||
|
* Get the volume of the player.
|
||||||
|
*----------------------------------------------------------------------------*/
|
||||||
|
unsigned int
|
||||||
|
HelixPlayer :: getVolume(void) throw ()
|
||||||
|
{
|
||||||
|
IHXAudioPlayer * audioPlayer = 0;
|
||||||
|
player->QueryInterface(IID_IHXAudioPlayer, (void**) &audioPlayer);
|
||||||
|
if (!audioPlayer) {
|
||||||
|
std::cerr << "can't get IHXAudioPlayer interface" << std::endl;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
IHXVolume * ihxVolume = audioPlayer->GetAudioVolume();
|
||||||
|
return ihxVolume->GetVolume();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------------------
|
||||||
|
* Set the volume of the player.
|
||||||
|
*----------------------------------------------------------------------------*/
|
||||||
|
void
|
||||||
|
HelixPlayer :: setVolume(unsigned int volume) throw ()
|
||||||
|
{
|
||||||
|
IHXAudioPlayer * audioPlayer = 0;
|
||||||
|
player->QueryInterface(IID_IHXAudioPlayer, (void**) &audioPlayer);
|
||||||
|
if (!audioPlayer) {
|
||||||
|
std::cerr << "can't get IHXAudioPlayer interface" << std::endl;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
IHXVolume * ihxVolume = audioPlayer->GetAudioVolume();
|
||||||
|
ihxVolume->SetVolume(volume);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
/*------------------------------------------------------------------------------
|
||||||
* A global function needed by the Helix library, this will return the
|
* A global function needed by the Helix library, this will return the
|
||||||
* access path to shared objects.
|
* access path to shared objects.
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
|
|
||||||
Author : $Author: maroy $
|
Author : $Author: maroy $
|
||||||
Version : $Revision: 1.6 $
|
Version : $Revision: 1.7 $
|
||||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/playlistExecutor/src/Attic/HelixPlayer.h,v $
|
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/playlistExecutor/src/Attic/HelixPlayer.h,v $
|
||||||
|
|
||||||
------------------------------------------------------------------------------*/
|
------------------------------------------------------------------------------*/
|
||||||
|
@ -91,7 +91,7 @@ using namespace LiveSupport::Core;
|
||||||
* </pre></code>
|
* </pre></code>
|
||||||
*
|
*
|
||||||
* @author $Author: maroy $
|
* @author $Author: maroy $
|
||||||
* @version $Revision: 1.6 $
|
* @version $Revision: 1.7 $
|
||||||
*/
|
*/
|
||||||
class HelixPlayer : virtual public Configurable,
|
class HelixPlayer : virtual public Configurable,
|
||||||
virtual public AudioPlayerInterface,
|
virtual public AudioPlayerInterface,
|
||||||
|
@ -310,6 +310,22 @@ class HelixPlayer : virtual public Configurable,
|
||||||
*/
|
*/
|
||||||
virtual Ptr<posix_time::time_duration>::Ref
|
virtual Ptr<posix_time::time_duration>::Ref
|
||||||
getPlaylength(void) throw ();
|
getPlaylength(void) throw ();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the volume of the player.
|
||||||
|
*
|
||||||
|
* @return the volume, from 1 to 100.
|
||||||
|
*/
|
||||||
|
virtual unsigned int
|
||||||
|
getVolume(void) throw ();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the volume of the player.
|
||||||
|
*
|
||||||
|
* @param volume the new volume, from 1 to 100.
|
||||||
|
*/
|
||||||
|
virtual void
|
||||||
|
setVolume(unsigned int volume) throw ();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue