diff --git a/livesupport/products/scheduler/src/PlaylistEvent.cxx b/livesupport/products/scheduler/src/PlaylistEvent.cxx index 99fa201fa..328a5ca20 100644 --- a/livesupport/products/scheduler/src/PlaylistEvent.cxx +++ b/livesupport/products/scheduler/src/PlaylistEvent.cxx @@ -22,7 +22,7 @@ Author : $Author: maroy $ - Version : $Revision: 1.1 $ + Version : $Revision: 1.2 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/PlaylistEvent.cxx,v $ ------------------------------------------------------------------------------*/ @@ -79,7 +79,7 @@ PlaylistEvent :: PlaylistEvent( void PlaylistEvent :: initialize(void) throw (std::exception) { - playlistUrl = storage->acquirePlaylist(scheduleEntry->getPlaylistId()); + playlist = storage->acquirePlaylist(scheduleEntry->getPlaylistId()); } @@ -89,8 +89,8 @@ PlaylistEvent :: initialize(void) throw (std::exception) void PlaylistEvent :: deInitialize(void) throw () { - storage->releasePlaylist(scheduleEntry->getPlaylistId()); - playlistUrl.reset(); + storage->releasePlaylist(playlist); + playlist.reset(); } @@ -100,8 +100,12 @@ PlaylistEvent :: deInitialize(void) throw () void PlaylistEvent :: start(void) throw () { - audioPlayer->playThis(*playlistUrl); - audioPlayer->start(); + try { + audioPlayer->playThis(*playlist->getUri()); + audioPlayer->start(); + } catch (std::invalid_argument &e) { + // TODO: handle error? + } } diff --git a/livesupport/products/scheduler/src/PlaylistEvent.h b/livesupport/products/scheduler/src/PlaylistEvent.h index d93f75d3b..2cdaef86a 100644 --- a/livesupport/products/scheduler/src/PlaylistEvent.h +++ b/livesupport/products/scheduler/src/PlaylistEvent.h @@ -22,7 +22,7 @@ Author : $Author: maroy $ - Version : $Revision: 1.1 $ + Version : $Revision: 1.2 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/PlaylistEvent.h,v $ ------------------------------------------------------------------------------*/ @@ -69,7 +69,7 @@ using namespace LiveSupport::Scheduler; * A scheduled event for playing a playlist. * * @author $Author: maroy $ - * @version $Revision: 1.1 $ + * @version $Revision: 1.2 $ */ class PlaylistEvent : public virtual ScheduledEventInterface { @@ -95,9 +95,9 @@ class PlaylistEvent : public virtual ScheduledEventInterface Ptr::Ref initTime; /** - * The URL for this playlist file. + * The Playlist this event is playing. */ - Ptr::Ref playlistUrl; + Ptr::Ref playlist; public: diff --git a/livesupport/products/scheduler/src/PlaylistEventTest.cxx b/livesupport/products/scheduler/src/PlaylistEventTest.cxx index 3eee0f3f8..b9d38555f 100644 --- a/livesupport/products/scheduler/src/PlaylistEventTest.cxx +++ b/livesupport/products/scheduler/src/PlaylistEventTest.cxx @@ -22,7 +22,7 @@ Author : $Author: maroy $ - Version : $Revision: 1.1 $ + Version : $Revision: 1.2 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/PlaylistEventTest.cxx,v $ ------------------------------------------------------------------------------*/ @@ -180,8 +180,12 @@ PlaylistEventTest :: initializeTest(void) { Ptr::Ref playlistEvent = createTestEvent(); - playlistEvent->initialize(); - playlistEvent->deInitialize(); + try { + playlistEvent->initialize(); + playlistEvent->deInitialize(); + } catch (std::logic_error &e) { + CPPUNIT_FAIL(e.what()); + } } @@ -194,10 +198,14 @@ PlaylistEventTest :: playTest(void) { Ptr::Ref playlistEvent = createTestEvent(); - playlistEvent->initialize(); - playlistEvent->start(); - TimeConversion::sleep(duration); - playlistEvent->stop(); - playlistEvent->deInitialize(); + try { + playlistEvent->initialize(); + playlistEvent->start(); + TimeConversion::sleep(duration); + playlistEvent->stop(); + playlistEvent->deInitialize(); + } catch (std::logic_error &e) { + CPPUNIT_FAIL(e.what()); + } } diff --git a/livesupport/products/scheduler/var/test1.mp3 b/livesupport/products/scheduler/var/test1.mp3 new file mode 100644 index 000000000..f774c2164 Binary files /dev/null and b/livesupport/products/scheduler/var/test1.mp3 differ diff --git a/livesupport/products/scheduler/var/test2.mp3 b/livesupport/products/scheduler/var/test2.mp3 new file mode 100644 index 000000000..f774c2164 Binary files /dev/null and b/livesupport/products/scheduler/var/test2.mp3 differ