diff --git a/livesupport/products/gLiveSupport/src/GLiveSupport.cxx b/livesupport/products/gLiveSupport/src/GLiveSupport.cxx index 3898b92ba..df321faf5 100644 --- a/livesupport/products/gLiveSupport/src/GLiveSupport.cxx +++ b/livesupport/products/gLiveSupport/src/GLiveSupport.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.38 $ + Version : $Revision: 1.39 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/GLiveSupport.cxx,v $ ------------------------------------------------------------------------------*/ @@ -602,7 +602,7 @@ GLiveSupport :: addToLiveMode(Ptr::Ref playable) *----------------------------------------------------------------------------*/ void LiveSupport :: GLiveSupport :: -GLiveSupport :: onStop(void) throw () +GLiveSupport :: onStop(void) throw () { Ptr::Ref playable; masterPanel->setNowPlaying(playable); // reset to empty @@ -758,31 +758,45 @@ GLiveSupport :: deletePlayable(Ptr::Ref playable) void LiveSupport :: GLiveSupport :: GLiveSupport :: playOutputAudio(Ptr::Ref playable) - throw (XmlRpcException, - std::invalid_argument, - std::logic_error, - std::runtime_error) + throw (std::logic_error) { - if (outputItemPlayingNow) { - stopOutputAudio(); // stop the audio player and release old resources - } + try { + if (outputItemPlayingNow) { + stopOutputAudio(); // stop the audio player and + } // release old resources + + switch (playable->getType()) { + case Playable::AudioClipType: + outputItemPlayingNow = storage->acquireAudioClip(sessionId, + playable->getId()); + outputPlayer->open(*outputItemPlayingNow->getUri()); + outputPlayer->start(); + break; - switch (playable->getType()) { - case Playable::AudioClipType: - outputItemPlayingNow = storage->acquireAudioClip(sessionId, - playable->getId()); - outputPlayer->open(*outputItemPlayingNow->getUri()); - outputPlayer->start(); - break; - - case Playable::PlaylistType: - outputItemPlayingNow = storage->acquirePlaylist(sessionId, - playable->getId()); - outputPlayer->openAndStart(outputItemPlayingNow->getPlaylist()); - break; - - default: // this never happens - break; + case Playable::PlaylistType: + outputItemPlayingNow = storage->acquirePlaylist(sessionId, + playable->getId()); + outputPlayer->openAndStart(outputItemPlayingNow->getPlaylist()); + break; + + default: // this never happens + break; + } + } catch (XmlRpcException &e) { + Ptr::Ref eMsg + = getResourceUstring("audioErrorMsg"); + eMsg->append(e.what()); + displayMessageWindow(eMsg); + } catch (std::invalid_argument &e) { + Ptr::Ref eMsg + = getResourceUstring("audioErrorMsg"); + eMsg->append(e.what()); + displayMessageWindow(eMsg); + } catch (std::runtime_error &e) { + Ptr::Ref eMsg + = getResourceUstring("audioErrorMsg"); + eMsg->append(e.what()); + displayMessageWindow(eMsg); } outputPlayerIsPaused = false; @@ -814,26 +828,32 @@ GLiveSupport :: pauseOutputAudio(void) void LiveSupport :: GLiveSupport :: GLiveSupport :: stopOutputAudio(void) - throw (XmlRpcException, - std::logic_error) + throw (std::logic_error) { - outputPlayer->close(); - - if (outputItemPlayingNow) { - switch (outputItemPlayingNow->getType()) { - case Playable::AudioClipType: - storage->releaseAudioClip(sessionId, - outputItemPlayingNow->getAudioClip()); - outputItemPlayingNow.reset(); - break; - case Playable::PlaylistType: - storage->releasePlaylist(sessionId, - outputItemPlayingNow->getPlaylist()); - outputItemPlayingNow.reset(); - break; - default: // this never happens - break; + try { + outputPlayer->close(); + + if (outputItemPlayingNow) { + switch (outputItemPlayingNow->getType()) { + case Playable::AudioClipType: + storage->releaseAudioClip(sessionId, + outputItemPlayingNow->getAudioClip()); + outputItemPlayingNow.reset(); + break; + case Playable::PlaylistType: + storage->releasePlaylist(sessionId, + outputItemPlayingNow->getPlaylist()); + outputItemPlayingNow.reset(); + break; + default: // this never happens + break; + } } + } catch (XmlRpcException &e) { + Ptr::Ref eMsg + = getResourceUstring("audioErrorMsg"); + eMsg->append(e.what()); + displayMessageWindow(eMsg); } outputPlayerIsPaused = false; @@ -846,31 +866,45 @@ GLiveSupport :: stopOutputAudio(void) void LiveSupport :: GLiveSupport :: GLiveSupport :: playCueAudio(Ptr::Ref playable) - throw (XmlRpcException, - std::invalid_argument, - std::logic_error, - std::runtime_error) + throw (std::logic_error) { - if (cueItemPlayingNow) { - stopCueAudio(); // stop the audio player and release old resources - } + try { + if (cueItemPlayingNow) { + stopCueAudio(); // stop the audio player and + } // release old resources + + switch (playable->getType()) { + case Playable::AudioClipType: + cueItemPlayingNow = storage->acquireAudioClip(sessionId, + playable->getId()); + cuePlayer->open(*cueItemPlayingNow->getUri()); + cuePlayer->start(); + break; - switch (playable->getType()) { - case Playable::AudioClipType: - cueItemPlayingNow = storage->acquireAudioClip(sessionId, - playable->getId()); - cuePlayer->open(*cueItemPlayingNow->getUri()); - cuePlayer->start(); - break; - - case Playable::PlaylistType: - cueItemPlayingNow = storage->acquirePlaylist(sessionId, - playable->getId()); - cuePlayer->openAndStart(cueItemPlayingNow->getPlaylist()); - break; - - default: // this never happens - break; + case Playable::PlaylistType: + cueItemPlayingNow = storage->acquirePlaylist(sessionId, + playable->getId()); + cuePlayer->openAndStart(cueItemPlayingNow->getPlaylist()); + break; + + default: // this never happens + break; + } + } catch (XmlRpcException &e) { + Ptr::Ref eMsg + = getResourceUstring("audioErrorMsg"); + eMsg->append(e.what()); + displayMessageWindow(eMsg); + } catch (std::invalid_argument &e) { + Ptr::Ref eMsg + = getResourceUstring("audioErrorMsg"); + eMsg->append(e.what()); + displayMessageWindow(eMsg); + } catch (std::runtime_error &e) { + Ptr::Ref eMsg + = getResourceUstring("audioErrorMsg"); + eMsg->append(e.what()); + displayMessageWindow(eMsg); } cuePlayerIsPaused = false; @@ -902,26 +936,32 @@ GLiveSupport :: pauseCueAudio(void) void LiveSupport :: GLiveSupport :: GLiveSupport :: stopCueAudio(void) - throw (XmlRpcException, - std::logic_error) + throw (std::logic_error) { - cuePlayer->close(); - - if (cueItemPlayingNow) { - switch (cueItemPlayingNow->getType()) { - case Playable::AudioClipType: - storage->releaseAudioClip(sessionId, - cueItemPlayingNow->getAudioClip()); - cueItemPlayingNow.reset(); - break; - case Playable::PlaylistType: - storage->releasePlaylist(sessionId, - cueItemPlayingNow->getPlaylist()); - cueItemPlayingNow.reset(); - break; - default: // this never happens - break; + try { + cuePlayer->close(); + + if (cueItemPlayingNow) { + switch (cueItemPlayingNow->getType()) { + case Playable::AudioClipType: + storage->releaseAudioClip(sessionId, + cueItemPlayingNow->getAudioClip()); + cueItemPlayingNow.reset(); + break; + case Playable::PlaylistType: + storage->releasePlaylist(sessionId, + cueItemPlayingNow->getPlaylist()); + cueItemPlayingNow.reset(); + break; + default: // this never happens + break; + } } + } catch (XmlRpcException &e) { + Ptr::Ref eMsg + = getResourceUstring("audioErrorMsg"); + eMsg->append(e.what()); + displayMessageWindow(eMsg); } cuePlayerIsPaused = false; diff --git a/livesupport/products/gLiveSupport/src/GLiveSupport.h b/livesupport/products/gLiveSupport/src/GLiveSupport.h index ca44b9896..74553008b 100644 --- a/livesupport/products/gLiveSupport/src/GLiveSupport.h +++ b/livesupport/products/gLiveSupport/src/GLiveSupport.h @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.31 $ + Version : $Revision: 1.32 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/GLiveSupport.h,v $ ------------------------------------------------------------------------------*/ @@ -101,7 +101,7 @@ class MasterPanelWindow; * respective documentation. * * @author $Author: fgerlits $ - * @version $Revision: 1.31 $ + * @version $Revision: 1.32 $ * @see LocalizedObject#getBundle(const xmlpp::Element &) * @see AuthenticationClientFactory * @see StorageClientFactory @@ -588,10 +588,7 @@ class GLiveSupport : public LocalizedConfigurable, */ virtual void playOutputAudio(Ptr::Ref playable) - throw (XmlRpcException, - std::invalid_argument, - std::logic_error, - std::runtime_error); + throw (std::logic_error); /** * Stop the output audio player. @@ -601,8 +598,7 @@ class GLiveSupport : public LocalizedConfigurable, */ virtual void stopOutputAudio(void) - throw (XmlRpcException, - std::logic_error); + throw (std::logic_error); /** * Pause the output audio player. @@ -624,10 +620,7 @@ class GLiveSupport : public LocalizedConfigurable, */ virtual void playCueAudio(Ptr::Ref playable) - throw (XmlRpcException, - std::invalid_argument, - std::logic_error, - std::runtime_error); + throw (std::logic_error); /** * Stop the cue audio player. @@ -637,8 +630,7 @@ class GLiveSupport : public LocalizedConfigurable, */ virtual void stopCueAudio(void) - throw (XmlRpcException, - std::logic_error); + throw (std::logic_error); /** * Pause the cue audio player. diff --git a/livesupport/products/gLiveSupport/var/hu.txt b/livesupport/products/gLiveSupport/var/hu.txt index bc996a411..5c3840b2d 100644 --- a/livesupport/products/gLiveSupport/var/hu.txt +++ b/livesupport/products/gLiveSupport/var/hu.txt @@ -16,6 +16,7 @@ hu:table schedulerNotReachableMsg:string { "Az időzítő szerver nem elérhető" } storageNotReachableMsg:string { "A tároló szerver nem elérhető" } authenticationNotReachableMsg:string { "A beléptető szerver nem elérhető" } + audioErrorMsg { "Hiba történt a lejátszáskor: " } loginWindow:table { diff --git a/livesupport/products/gLiveSupport/var/root.txt b/livesupport/products/gLiveSupport/var/root.txt index da7381a30..a1e278d05 100644 --- a/livesupport/products/gLiveSupport/var/root.txt +++ b/livesupport/products/gLiveSupport/var/root.txt @@ -17,6 +17,7 @@ root:table storageNotReachableMsg:string { "Storage server not available" } authenticationNotReachableMsg:string { "Authentication server not available" } + audioErrorMsg { "Audio player error: " } loginWindow:table {