added isOpen() call to the AudioPlayerInterface API
This commit is contained in:
parent
f961cee180
commit
050ece2fbc
3 changed files with 29 additions and 20 deletions
|
@ -22,7 +22,7 @@
|
|||
|
||||
|
||||
Author : $Author: maroy $
|
||||
Version : $Revision: 1.14 $
|
||||
Version : $Revision: 1.15 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/playlistExecutor/include/LiveSupport/PlaylistExecutor/AudioPlayerInterface.h,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -69,7 +69,7 @@ using namespace LiveSupport::Core;
|
|||
* A generic interface for playing audio files.
|
||||
*
|
||||
* @author $Author: maroy $
|
||||
* @version $Revision: 1.14 $
|
||||
* @version $Revision: 1.15 $
|
||||
*/
|
||||
class AudioPlayerInterface
|
||||
{
|
||||
|
@ -149,6 +149,15 @@ class AudioPlayerInterface
|
|||
open(const std::string fileUrl) throw (std::invalid_argument)
|
||||
= 0;
|
||||
|
||||
/**
|
||||
* Tell if the audio player has been openned.
|
||||
*
|
||||
* @return true if the audio player is openned, false otherwise.
|
||||
* @see #open
|
||||
*/
|
||||
virtual bool
|
||||
isOpen(void) throw () = 0;
|
||||
|
||||
/**
|
||||
* Close an audio source that was opened.
|
||||
*
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
|
||||
Author : $Author: maroy $
|
||||
Version : $Revision: 1.10 $
|
||||
Version : $Revision: 1.11 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/playlistExecutor/src/GstreamerPlayer.cxx,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -240,7 +240,7 @@ GstreamerPlayer :: open(const std::string fileUrl)
|
|||
GstElement * fakesink;
|
||||
gint64 position;
|
||||
|
||||
if (isOpened()) {
|
||||
if (isOpen()) {
|
||||
close();
|
||||
}
|
||||
|
||||
|
@ -316,7 +316,7 @@ GstreamerPlayer :: open(const std::string fileUrl)
|
|||
* Tell if we've been opened.
|
||||
*----------------------------------------------------------------------------*/
|
||||
bool
|
||||
GstreamerPlayer :: isOpened(void) throw ()
|
||||
GstreamerPlayer :: isOpen(void) throw ()
|
||||
{
|
||||
return decoder != 0;
|
||||
}
|
||||
|
@ -332,7 +332,7 @@ GstreamerPlayer :: getPlaylength(void) throw (std::logic_error)
|
|||
gint64 ns;
|
||||
GstFormat format = GST_FORMAT_TIME;
|
||||
|
||||
if (!isOpened()) {
|
||||
if (!isOpen()) {
|
||||
throw std::logic_error("player not open");
|
||||
}
|
||||
|
||||
|
@ -358,7 +358,7 @@ GstreamerPlayer :: getPosition(void) throw (std::logic_error)
|
|||
gint64 ns;
|
||||
GstFormat format = GST_FORMAT_TIME;
|
||||
|
||||
if (!isOpened()) {
|
||||
if (!isOpen()) {
|
||||
throw std::logic_error("player not open");
|
||||
}
|
||||
|
||||
|
@ -380,7 +380,7 @@ GstreamerPlayer :: getPosition(void) throw (std::logic_error)
|
|||
void
|
||||
GstreamerPlayer :: start(void) throw (std::logic_error)
|
||||
{
|
||||
if (!isOpened()) {
|
||||
if (!isOpen()) {
|
||||
throw std::logic_error("GstreamerPlayer not opened yet");
|
||||
}
|
||||
|
||||
|
@ -419,7 +419,7 @@ GstreamerPlayer :: isPlaying(void) throw ()
|
|||
void
|
||||
GstreamerPlayer :: stop(void) throw (std::logic_error)
|
||||
{
|
||||
if (!isOpened()) {
|
||||
if (!isOpen()) {
|
||||
throw std::logic_error("GstreamerPlayer not opened yet");
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
|
||||
Author : $Author: maroy $
|
||||
Version : $Revision: 1.9 $
|
||||
Version : $Revision: 1.10 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/playlistExecutor/src/GstreamerPlayer.h,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -86,7 +86,7 @@ using namespace LiveSupport::Core;
|
|||
* </code></pre>
|
||||
*
|
||||
* @author $Author: maroy $
|
||||
* @version $Revision: 1.9 $
|
||||
* @version $Revision: 1.10 $
|
||||
*/
|
||||
class GstreamerPlayer : virtual public Configurable,
|
||||
virtual public AudioPlayerInterface
|
||||
|
@ -185,15 +185,6 @@ class GstreamerPlayer : virtual public Configurable,
|
|||
virtual void
|
||||
fireOnStopEvent(void) throw ();
|
||||
|
||||
/**
|
||||
* Tell if the object is currently opened (has a file source to
|
||||
* read.)
|
||||
*
|
||||
* @return true if the object is currently opened, false otherwise.
|
||||
*/
|
||||
bool
|
||||
isOpened(void) throw ();
|
||||
|
||||
|
||||
public:
|
||||
/**
|
||||
|
@ -310,6 +301,15 @@ class GstreamerPlayer : virtual public Configurable,
|
|||
virtual void
|
||||
open(const std::string fileUrl) throw (std::invalid_argument);
|
||||
|
||||
/**
|
||||
* Tell if the object is currently opened (has a file source to
|
||||
* read.)
|
||||
*
|
||||
* @return true if the object is currently opened, false otherwise.
|
||||
*/
|
||||
virtual bool
|
||||
isOpen(void) throw ();
|
||||
|
||||
/**
|
||||
* Close an audio source that was opened.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue