fixed #2067
This commit is contained in:
parent
097b46c5ae
commit
aafdd144d2
|
@ -1622,13 +1622,22 @@ GLiveSupport :: setCueAudioDevice(Ptr<const Glib::ustring>::Ref deviceName)
|
|||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
LiveSupport :: GLiveSupport ::
|
||||
GLiveSupport :: playTestSoundOnCue(void) throw ()
|
||||
GLiveSupport :: playTestSoundOnCue(Ptr<const Glib::ustring>::Ref oldDevice,
|
||||
Ptr<const Glib::ustring>::Ref newDevice)
|
||||
throw ()
|
||||
{
|
||||
if (cueItemPlayingNow) {
|
||||
stopCueAudio(); // stop the audio player and
|
||||
} // release old resources
|
||||
|
||||
try {
|
||||
if (cuePlayer->isOpen()) {
|
||||
if (cuePlayer->isPlaying()) {
|
||||
cuePlayer->stop();
|
||||
}
|
||||
cuePlayer->close();
|
||||
}
|
||||
cuePlayer->setAudioDevice(*newDevice);
|
||||
cuePlayer->open(*testAudioUrl);
|
||||
cuePlayer->start();
|
||||
Ptr<time_duration>::Ref sleepT(new time_duration(microseconds(10)));
|
||||
|
@ -1638,8 +1647,11 @@ GLiveSupport :: playTestSoundOnCue(void) throw ()
|
|||
}
|
||||
} catch (std::runtime_error &e) {
|
||||
// "invalid device" error from open(); do nothing
|
||||
} catch (std::logic_error &e) {
|
||||
// some other error; do nothing
|
||||
}
|
||||
cuePlayer->close();
|
||||
cuePlayer->setAudioDevice(*oldDevice);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -988,9 +988,14 @@ class GLiveSupport : public LocalizedConfigurable,
|
|||
|
||||
/**
|
||||
* Play a test sound on the cue audio player.
|
||||
*
|
||||
* @param oldDevice the name of the current audio device.
|
||||
* @param oldDevice the name of the audio device to be tested.
|
||||
*/
|
||||
void
|
||||
playTestSoundOnCue(void) throw ();
|
||||
playTestSoundOnCue(Ptr<const Glib::ustring>::Ref oldDevice,
|
||||
Ptr<const Glib::ustring>::Ref newDevice)
|
||||
throw ();
|
||||
|
||||
/**
|
||||
* Search in the local storage.
|
||||
|
|
|
@ -349,13 +349,12 @@ OptionsWindow :: onTestButtonClicked(const EntryBin * entry)
|
|||
|
||||
Ptr<const Glib::ustring>::Ref
|
||||
oldDevice = optionsContainer->getOptionItem(OptionsContainer::
|
||||
outputPlayerDeviceName);
|
||||
cuePlayerDeviceName);
|
||||
Ptr<const Glib::ustring>::Ref
|
||||
newDevice(new Glib::ustring(entry->get_text()));
|
||||
|
||||
gLiveSupport->setCueAudioDevice(newDevice); // NOTE: we can't use the
|
||||
gLiveSupport->playTestSoundOnCue(); // output player b/c that
|
||||
gLiveSupport->setCueAudioDevice(oldDevice); // would trigger onStop()
|
||||
// NOTE: we can't use the output player b/c that would trigger onStop()
|
||||
gLiveSupport->playTestSoundOnCue(oldDevice, newDevice);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue