diff --git a/campcaster/src/modules/playlistExecutor/include/LiveSupport/PlaylistExecutor/AudioPlayerEventListener.h b/campcaster/src/modules/playlistExecutor/include/LiveSupport/PlaylistExecutor/AudioPlayerEventListener.h index 4c64c40af..dfa5736cd 100644 --- a/campcaster/src/modules/playlistExecutor/include/LiveSupport/PlaylistExecutor/AudioPlayerEventListener.h +++ b/campcaster/src/modules/playlistExecutor/include/LiveSupport/PlaylistExecutor/AudioPlayerEventListener.h @@ -87,7 +87,8 @@ class AudioPlayerEventListener * @param errorMessage is a 0 pointer if the player stopped normally */ virtual void - onStop(Ptr::Ref errorMessage) throw () = 0; + onStop(Ptr::Ref errorMessage) + throw () = 0; }; diff --git a/campcaster/src/modules/playlistExecutor/src/GstreamerPlayer.cxx b/campcaster/src/modules/playlistExecutor/src/GstreamerPlayer.cxx index 18d2b46d0..44efd956f 100644 --- a/campcaster/src/modules/playlistExecutor/src/GstreamerPlayer.cxx +++ b/campcaster/src/modules/playlistExecutor/src/GstreamerPlayer.cxx @@ -144,7 +144,7 @@ GstreamerPlayer :: errorHandler(GstElement * pipeline, throw () { GstreamerPlayer* const player = (GstreamerPlayer*) self; - player->m_errorMessage = error->message; + player->m_errorMessage.reset(new const Glib::ustring(error->message)); std::cerr << "gstreamer error: " << error->message << std::endl; @@ -223,20 +223,16 @@ GstreamerPlayer :: fireOnStopEvent(gpointer self) throw ( GstreamerPlayer* const player = (GstreamerPlayer*) self; - Ptr::Ref msg; - if (!player->m_errorMessage.empty()) { - msg.reset(new const std::string(player->m_errorMessage)); - player->m_errorMessage.clear(); - } - ListenerVector::iterator it = player->m_listeners.begin(); ListenerVector::iterator end = player->m_listeners.end(); while (it != end) { - (*it)->onStop(msg); + (*it)->onStop(player->m_errorMessage); ++it; } + player->m_errorMessage.reset(); + // false == Don't call this idle function again return false; } @@ -331,7 +327,7 @@ GstreamerPlayer :: open(const std::string fileUrl) debug() << "Opening URL: " << fileUrl << endl; debug() << "Timestamp: " << *TimeConversion::now() << endl; - m_errorMessage.clear(); + m_errorMessage.reset(); std::string filePath; diff --git a/campcaster/src/modules/playlistExecutor/src/GstreamerPlayer.h b/campcaster/src/modules/playlistExecutor/src/GstreamerPlayer.h index dcc649d75..d2a13a5c1 100644 --- a/campcaster/src/modules/playlistExecutor/src/GstreamerPlayer.h +++ b/campcaster/src/modules/playlistExecutor/src/GstreamerPlayer.h @@ -153,7 +153,7 @@ class GstreamerPlayer : virtual public Configurable, /** * Contains runtime error messages from GStreamer. */ - std::string m_errorMessage; + Ptr::Ref m_errorMessage; /** * The URL of the preloaded file. Empty if nothing is preloaded. diff --git a/campcaster/src/modules/playlistExecutor/src/GstreamerPlayerTest.cxx b/campcaster/src/modules/playlistExecutor/src/GstreamerPlayerTest.cxx index 2718c23c3..706eebb53 100644 --- a/campcaster/src/modules/playlistExecutor/src/GstreamerPlayerTest.cxx +++ b/campcaster/src/modules/playlistExecutor/src/GstreamerPlayerTest.cxx @@ -622,7 +622,7 @@ GstreamerPlayerTest :: eventListenerOnStopTest(void) * Another, more realistic test of the event listener mechanism. *----------------------------------------------------------------------------*/ void -GstreamerPlayerTest :: onStop(Ptr::Ref errorMessage) +GstreamerPlayerTest :: onStop(Ptr::Ref errorMessage) throw () { if (!startNewClipFlag) { diff --git a/campcaster/src/modules/playlistExecutor/src/GstreamerPlayerTest.h b/campcaster/src/modules/playlistExecutor/src/GstreamerPlayerTest.h index 667ecdb39..d161c5c2e 100644 --- a/campcaster/src/modules/playlistExecutor/src/GstreamerPlayerTest.h +++ b/campcaster/src/modules/playlistExecutor/src/GstreamerPlayerTest.h @@ -248,7 +248,7 @@ class GstreamerPlayerTest : public CPPUNIT_NS::TestFixture, * @param errorMessage is a 0 pointer if the player stopped normally */ virtual void - onStop(Ptr::Ref errorMessage) + onStop(Ptr::Ref errorMessage) throw (); }; diff --git a/campcaster/src/modules/playlistExecutor/src/TestEventListener.h b/campcaster/src/modules/playlistExecutor/src/TestEventListener.h index d67233444..3ac9a2864 100644 --- a/campcaster/src/modules/playlistExecutor/src/TestEventListener.h +++ b/campcaster/src/modules/playlistExecutor/src/TestEventListener.h @@ -96,7 +96,8 @@ class TestEventListener : public AudioPlayerEventListener * @param errorMessage is a 0 pointer if the player stopped normally */ virtual void - onStop(Ptr::Ref errorMessage) throw () + onStop(Ptr::Ref errorMessage) + throw () { stopFlag = true; } diff --git a/campcaster/src/modules/widgets/include/LiveSupport/Widgets/DialogWindow.h b/campcaster/src/modules/widgets/include/LiveSupport/Widgets/DialogWindow.h index f760b4408..e2fa41023 100644 --- a/campcaster/src/modules/widgets/include/LiveSupport/Widgets/DialogWindow.h +++ b/campcaster/src/modules/widgets/include/LiveSupport/Widgets/DialogWindow.h @@ -135,9 +135,10 @@ class DialogWindow : public WhiteWindow, * @param bundle a resource bundle containing the localized * button labels */ - DialogWindow(Ptr::Ref message, - int buttonTypes, - Ptr::Ref bundle) throw (); + DialogWindow(Ptr::Ref message, + int buttonTypes, + Ptr::Ref bundle) + throw (); /** * Virtual destructor. diff --git a/campcaster/src/modules/widgets/include/LiveSupport/Widgets/WidgetFactory.h b/campcaster/src/modules/widgets/include/LiveSupport/Widgets/WidgetFactory.h index 341f878ce..2e72d4c5e 100644 --- a/campcaster/src/modules/widgets/include/LiveSupport/Widgets/WidgetFactory.h +++ b/campcaster/src/modules/widgets/include/LiveSupport/Widgets/WidgetFactory.h @@ -414,8 +414,8 @@ class WidgetFactory : * @return the DialogWindow object. */ DialogWindow * - createDialogWindow(Ptr::Ref message, - Ptr::Ref bundle, + createDialogWindow(Ptr::Ref message, + Ptr::Ref bundle, int buttons = DialogWindow::okButton) throw (); diff --git a/campcaster/src/modules/widgets/src/DialogWindow.cxx b/campcaster/src/modules/widgets/src/DialogWindow.cxx index 1969a0bc5..96c1f1143 100644 --- a/campcaster/src/modules/widgets/src/DialogWindow.cxx +++ b/campcaster/src/modules/widgets/src/DialogWindow.cxx @@ -58,9 +58,9 @@ using namespace LiveSupport::Widgets; /*------------------------------------------------------------------------------ * Constructor. *----------------------------------------------------------------------------*/ -DialogWindow :: DialogWindow (Ptr::Ref message, - int buttonTypes, - Ptr::Ref bundle) +DialogWindow :: DialogWindow (Ptr::Ref message, + int buttonTypes, + Ptr::Ref bundle) throw () : WhiteWindow(Colors::White, WidgetFactory::getInstance()->getWhiteWindowCorners(), diff --git a/campcaster/src/modules/widgets/src/WidgetFactory.cxx b/campcaster/src/modules/widgets/src/WidgetFactory.cxx index 385d51c1e..45de0d71a 100644 --- a/campcaster/src/modules/widgets/src/WidgetFactory.cxx +++ b/campcaster/src/modules/widgets/src/WidgetFactory.cxx @@ -684,9 +684,9 @@ WidgetFactory :: createTreeView(Glib::RefPtr treeModel) * Create a dialog window. *----------------------------------------------------------------------------*/ DialogWindow * -WidgetFactory :: createDialogWindow(Ptr::Ref message, - Ptr::Ref bundle, - int buttons) +WidgetFactory :: createDialogWindow(Ptr::Ref message, + Ptr::Ref bundle, + int buttons) throw () { return new DialogWindow(message, buttons, bundle); diff --git a/campcaster/src/products/gLiveSupport/src/CuePlayer.cxx b/campcaster/src/products/gLiveSupport/src/CuePlayer.cxx index eb3b3ea7a..93d1b887b 100644 --- a/campcaster/src/products/gLiveSupport/src/CuePlayer.cxx +++ b/campcaster/src/products/gLiveSupport/src/CuePlayer.cxx @@ -205,9 +205,13 @@ CuePlayer :: onStopButtonClicked(void) throw () * Event handler for the "cue audio player has stopped" event. *----------------------------------------------------------------------------*/ void -CuePlayer :: onStop(Ptr::Ref errorMessage) throw () +CuePlayer :: onStop(Ptr::Ref errorMessage) throw () { setAudioState(waitingState); + + if (errorMessage) { + gLiveSupport->displayMessageWindow(errorMessage); + } } diff --git a/campcaster/src/products/gLiveSupport/src/CuePlayer.h b/campcaster/src/products/gLiveSupport/src/CuePlayer.h index 14845f452..5a3277310 100644 --- a/campcaster/src/products/gLiveSupport/src/CuePlayer.h +++ b/campcaster/src/products/gLiveSupport/src/CuePlayer.h @@ -184,8 +184,8 @@ class CuePlayer : public Gtk::HBox, * @param errorMessage is a 0 pointer if the player stopped normally */ virtual void - onStop(Ptr::Ref errorMessage - = Ptr::Ref()) + onStop(Ptr::Ref errorMessage + = Ptr::Ref()) throw (); }; diff --git a/campcaster/src/products/gLiveSupport/src/GLiveSupport.cxx b/campcaster/src/products/gLiveSupport/src/GLiveSupport.cxx index 62a746f08..439780cc9 100644 --- a/campcaster/src/products/gLiveSupport/src/GLiveSupport.cxx +++ b/campcaster/src/products/gLiveSupport/src/GLiveSupport.cxx @@ -518,7 +518,7 @@ GLiveSupport :: checkConfiguration(void) throw () *----------------------------------------------------------------------------*/ void LiveSupport :: GLiveSupport :: -GLiveSupport :: displayMessageWindow(Ptr::Ref message) +GLiveSupport :: displayMessageWindow(Ptr::Ref message) throw () { std::cerr << "gLiveSupport: " << *message << std::endl; @@ -1318,7 +1318,7 @@ GLiveSupport :: stopOutputAudio(void) *----------------------------------------------------------------------------*/ void LiveSupport :: GLiveSupport :: -GLiveSupport :: onStop(Ptr::Ref errorMessage) +GLiveSupport :: onStop(Ptr::Ref errorMessage) throw () { outputItemPlayingNow.reset(); @@ -1334,6 +1334,10 @@ GLiveSupport :: onStop(Ptr::Ref errorMessage) std::cerr << "logic_error caught in GLiveSupport::onStop()\n"; std::exit(1); } + + if (errorMessage) { + displayMessageWindow(errorMessage); + } } diff --git a/campcaster/src/products/gLiveSupport/src/GLiveSupport.h b/campcaster/src/products/gLiveSupport/src/GLiveSupport.h index f2d0e3b4f..1a3c5a5d8 100644 --- a/campcaster/src/products/gLiveSupport/src/GLiveSupport.h +++ b/campcaster/src/products/gLiveSupport/src/GLiveSupport.h @@ -486,7 +486,7 @@ class GLiveSupport : public LocalizedConfigurable, * @param message the message to display */ void - displayMessageWindow(Ptr::Ref message) + displayMessageWindow(Ptr::Ref message) throw (); /** @@ -1060,8 +1060,8 @@ class GLiveSupport : public LocalizedConfigurable, * @param errorMessage is a 0 pointer if the player stopped normally */ virtual void - onStop(Ptr::Ref errorMessage - = Ptr::Ref()) + onStop(Ptr::Ref errorMessage + = Ptr::Ref()) throw (); /**