diff --git a/livesupport/modules/playlistExecutor/etc/audioPlayer.xml b/livesupport/modules/playlistExecutor/etc/audioPlayer.xml index 0d7c6505b..7bc5b74aa 100644 --- a/livesupport/modules/playlistExecutor/etc/audioPlayer.xml +++ b/livesupport/modules/playlistExecutor/etc/audioPlayer.xml @@ -4,7 +4,10 @@ - + + + + ]> + + ]> diff --git a/livesupport/modules/playlistExecutor/src/HelixPlayer.cxx b/livesupport/modules/playlistExecutor/src/HelixPlayer.cxx index 31bfab832..50abe2263 100644 --- a/livesupport/modules/playlistExecutor/src/HelixPlayer.cxx +++ b/livesupport/modules/playlistExecutor/src/HelixPlayer.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.15 $ + Version : $Revision: 1.16 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/playlistExecutor/src/Attic/HelixPlayer.cxx,v $ ------------------------------------------------------------------------------*/ @@ -33,6 +33,8 @@ #include "configure.h" #endif +#include + #include "HelixDefs.h" #include "LiveSupport/Core/TimeConversion.h" @@ -76,22 +78,31 @@ static const std::string dllPathName = "dllPath"; */ static const std::string audioDeviceName = "audioDevice"; +/** + * The name of the audio stream timeout attribute. + */ +static const std::string audioStreamTimeoutName = "audioStreamTimeout"; + +/** + * The default value of the audio stream timeout attribute. + */ +static const int audioStreamTimeoutDefault = 5; + +/** + * The name of the fade look ahead time attribute. + */ +static const std::string fadeLookAheadTimeName = "fadeLookAheadTime"; + +/** + * The default value of the fade look ahead time attribute. + */ +static const int fadeLookAheadTimeDefault = 2500; /** * The name of the client core shared object, as found under dllPath */ static const std::string clntcoreName = "/clntcore.so"; -/** - * Magic number #1: max time to wait for an audio stream, in milliseconds - */ -static const int getAudioStreamTimeOut = 5; - -/** - * Magic number #2: schedule fading this many milliseconds in advance - */ -static const int lookAheadTime = 2500; - /* =============================================== local function prototypes */ @@ -123,6 +134,20 @@ HelixPlayer :: configure(const xmlpp::Element & element) if ((attribute = element.get_attribute(audioDeviceName))) { setAudioDevice(attribute->get_value()); } + + if ((attribute = element.get_attribute(audioStreamTimeoutName))) { + std::stringstream timeoutStream(attribute->get_value()); + timeoutStream >> audioStreamTimeout; + } else { + audioStreamTimeout = audioStreamTimeoutDefault; + } + + if ((attribute = element.get_attribute(fadeLookAheadTimeName))) { + std::stringstream lookAheadStream(attribute->get_value()); + lookAheadStream >> fadeLookAheadTime; + } else { + fadeLookAheadTime = fadeLookAheadTimeDefault; + } } @@ -436,7 +461,7 @@ HelixPlayer :: openAndStart(Ptr::Ref playlist) audioStream[i] = audioPlayer->GetAudioStream(i); int counter = 0; while (!audioStream[i]) { - if (counter > getAudioStreamTimeOut * 100) { + if (counter > audioStreamTimeout * 100) { std::stringstream eMsg; eMsg << "can't get audio stream number " << i; throw std::runtime_error(eMsg.str()); @@ -544,7 +569,7 @@ HelixPlayer :: implementFading(unsigned long position) it = fadeDataList->erase(it); continue; - } else if (fadeAt < position + lookAheadTime) { // we are on time + } else if (fadeAt < position + fadeLookAheadTime) { // we are on time IHXAudioPlayer* audioPlayer = 0; if (player->QueryInterface(IID_IHXAudioPlayer, diff --git a/livesupport/modules/playlistExecutor/src/HelixPlayer.h b/livesupport/modules/playlistExecutor/src/HelixPlayer.h index 2ae0b1d0c..776e5c7a2 100644 --- a/livesupport/modules/playlistExecutor/src/HelixPlayer.h +++ b/livesupport/modules/playlistExecutor/src/HelixPlayer.h @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.13 $ + Version : $Revision: 1.14 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/playlistExecutor/src/Attic/HelixPlayer.h,v $ ------------------------------------------------------------------------------*/ @@ -89,16 +89,30 @@ using namespace LiveSupport::Core; * library shared objects. The optional audioDevice argument sets the * AUDIO environment variable which is read by the Helix client. * + * There are two parameters which are only there because the current version + * of the Helix client does not handle animation tags in SMIL files properly. + * They will be removed from later versions. + *
    + *
  • audioStreamTimeOut (milliseconds) - the time to wait for each + * GetAudioStream() operation before a timeout occurs; + * the default is 5;
  • + *
  • fadeLookAheadTime (milliseconds) - each fade-in or fade-out is + * scheduled (using IHXAudioCrossFade::CrossFade()) this + * much time before it is to happen; the default is 2500.
  • + *
+ * * The DTD for the above configuration is the following: * *

  *  
  *  
  *  
+ *  
+ *  
  *  
* * @author $Author: fgerlits $ - * @version $Revision: 1.13 $ + * @version $Revision: 1.14 $ */ class HelixPlayer : virtual public Configurable, virtual public AudioPlayerInterface, @@ -115,6 +129,16 @@ class HelixPlayer : virtual public Configurable, */ std::string dllPath; + /** + * Max time to wait for an audio stream, in milliseconds. + */ + int audioStreamTimeout; + + /** + * Schedule fading this many milliseconds in advance. + */ + int fadeLookAheadTime; + /** * The shared object access point. */