added flags to prevent pause from firing onStop()
This commit is contained in:
parent
0b20c3ccf0
commit
ad9b8acf2b
4 changed files with 76 additions and 5 deletions
|
@ -22,7 +22,7 @@
|
|||
|
||||
|
||||
Author : $Author: fgerlits $
|
||||
Version : $Revision: 1.4 $
|
||||
Version : $Revision: 1.5 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/CuePlayer.cxx,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -174,11 +174,13 @@ void
|
|||
CuePlayer :: onPauseButtonClicked(void) throw ()
|
||||
{
|
||||
try {
|
||||
gLiveSupport->setCueAudioPauseFlag(true);
|
||||
gLiveSupport->pauseCueAudio();
|
||||
audioState = pausedState;
|
||||
remove(*pauseButton);
|
||||
pack_end(*playButton, Gtk::PACK_SHRINK, 3);
|
||||
playButton->show();
|
||||
gLiveSupport->setCueAudioPauseFlag(false);
|
||||
} catch (std::logic_error &e) {
|
||||
std::cerr << "GLiveSupport::pauseCueAudio() error:" << std::endl
|
||||
<< e.what() << std::endl;
|
||||
|
@ -209,6 +211,10 @@ CuePlayer :: onStopButtonClicked(void) throw ()
|
|||
void
|
||||
CuePlayer :: onStop(void) throw ()
|
||||
{
|
||||
if (gLiveSupport->getCueAudioPauseFlag()) {
|
||||
return; // onStop() is fired on pause, unfortunately
|
||||
}
|
||||
|
||||
switch (audioState) {
|
||||
case pausedState:
|
||||
remove(*playButton);
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
|
||||
Author : $Author: fgerlits $
|
||||
Version : $Revision: 1.55 $
|
||||
Version : $Revision: 1.56 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/GLiveSupport.cxx,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -836,6 +836,10 @@ void
|
|||
LiveSupport :: GLiveSupport ::
|
||||
GLiveSupport :: onStop(void) throw ()
|
||||
{
|
||||
if (getOutputAudioPauseFlag()) {
|
||||
return; // onStop() is fired on pause, unfortunately
|
||||
}
|
||||
|
||||
releaseOutputAudio();
|
||||
|
||||
Ptr<Playable>::Ref playable = masterPanel->getNextItemToPlay();
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
|
||||
Author : $Author: fgerlits $
|
||||
Version : $Revision: 1.41 $
|
||||
Version : $Revision: 1.42 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/GLiveSupport.h,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -102,7 +102,7 @@ class MasterPanelWindow;
|
|||
* respective documentation.
|
||||
*
|
||||
* @author $Author: fgerlits $
|
||||
* @version $Revision: 1.41 $
|
||||
* @version $Revision: 1.42 $
|
||||
* @see LocalizedObject#getBundle(const xmlpp::Element &)
|
||||
* @see AuthenticationClientFactory
|
||||
* @see StorageClientFactory
|
||||
|
@ -212,11 +212,21 @@ class GLiveSupport : public LocalizedConfigurable,
|
|||
*/
|
||||
bool outputPlayerIsPaused;
|
||||
|
||||
/**
|
||||
* Set to prevent onStop() from being fired by pausing.
|
||||
*/
|
||||
bool outputAudioPauseFlag;
|
||||
|
||||
/**
|
||||
* True if the cue audio player has been paused.
|
||||
*/
|
||||
bool cuePlayerIsPaused;
|
||||
|
||||
/**
|
||||
* Set to prevent onStop() from being fired by pausing.
|
||||
*/
|
||||
bool cueAudioPauseFlag;
|
||||
|
||||
/**
|
||||
* The raw image containing the station logo.
|
||||
*/
|
||||
|
@ -624,6 +634,30 @@ class GLiveSupport : public LocalizedConfigurable,
|
|||
pauseOutputAudio(void)
|
||||
throw (std::logic_error);
|
||||
|
||||
/**
|
||||
* Set the output audio pause flag. This is set to true before
|
||||
* a call to pauseOutputAudio() and to false afterwards, in
|
||||
* order to prevent the onStop() method from executing on pause.
|
||||
*
|
||||
* @param value the new value of the flag.
|
||||
*/
|
||||
virtual void
|
||||
setOutputAudioPauseFlag(bool value) throw ()
|
||||
{
|
||||
outputAudioPauseFlag = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the output audio pause flag.
|
||||
*
|
||||
* @see setOutputAudioPauseFlag()
|
||||
*/
|
||||
virtual bool
|
||||
getOutputAudioPauseFlag(void) throw ()
|
||||
{
|
||||
return outputAudioPauseFlag;
|
||||
}
|
||||
|
||||
/**
|
||||
* Play a Playable object using the cue audio player.
|
||||
*
|
||||
|
@ -656,6 +690,30 @@ class GLiveSupport : public LocalizedConfigurable,
|
|||
pauseCueAudio(void)
|
||||
throw (std::logic_error);
|
||||
|
||||
/**
|
||||
* Set the cue audio pause flag. This is set to true before
|
||||
* a call to pauseCueAudio() and to false afterwards, in
|
||||
* order to prevent the onStop() method from executing on pause.
|
||||
*
|
||||
* @param value the new value of the flag.
|
||||
*/
|
||||
virtual void
|
||||
setCueAudioPauseFlag(bool value) throw ()
|
||||
{
|
||||
cueAudioPauseFlag = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the cue audio pause flag.
|
||||
*
|
||||
* @see setOutputAudioPauseFlag()
|
||||
*/
|
||||
virtual bool
|
||||
getCueAudioPauseFlag(void) throw ()
|
||||
{
|
||||
return cueAudioPauseFlag;
|
||||
}
|
||||
|
||||
/**
|
||||
* Attach a listener for the cue audio player (the listener
|
||||
* will be notified when the cue audio player has stopped playing).
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
|
||||
Author : $Author: fgerlits $
|
||||
Version : $Revision: 1.5 $
|
||||
Version : $Revision: 1.6 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/NowPlaying.cxx,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -162,6 +162,8 @@ NowPlaying :: onPlayButtonClicked(void) throw ()
|
|||
void
|
||||
NowPlaying :: onPauseButtonClicked(void) throw ()
|
||||
{
|
||||
gLiveSupport->setOutputAudioPauseFlag(true);
|
||||
|
||||
gLiveSupport->pauseOutputAudio();
|
||||
|
||||
remove(*pauseButton);
|
||||
|
@ -169,6 +171,7 @@ NowPlaying :: onPauseButtonClicked(void) throw ()
|
|||
playButton->show();
|
||||
|
||||
isPaused = true;
|
||||
gLiveSupport->setOutputAudioPauseFlag(false);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue