This commit is contained in:
fgerlits 2006-09-25 15:52:22 +00:00
parent 1db206fb55
commit 1e7014ae01
3 changed files with 41 additions and 1 deletions

View File

@ -804,7 +804,32 @@ GLiveSupport :: acquirePlaylist(Ptr<const UniqueId>::Ref id)
/*------------------------------------------------------------------------------
* Acquire an Playable object.
* Open a Playable object.
*----------------------------------------------------------------------------*/
Ptr<Playable>::Ref
LiveSupport :: GLiveSupport ::
GLiveSupport :: getPlayable(Ptr<const UniqueId>::Ref id)
throw (XmlRpcException)
{
Ptr<Playable>::Ref playable;
if (existsPlaylist(id)) {
playable = getPlaylist(id);
} else if (existsAudioClip(id)) {
playable = getAudioClip(id);
} else {
throw XmlRpcInvalidArgumentException(
"invalid ID in GLiveSupport::acquirePlayable");
}
return playable;
}
/*------------------------------------------------------------------------------
* Acquire a Playable object.
*----------------------------------------------------------------------------*/
Ptr<Playable>::Ref
LiveSupport :: GLiveSupport ::

View File

@ -678,6 +678,20 @@ class GLiveSupport : public LocalizedConfigurable,
acquirePlaylist(Ptr<const UniqueId>::Ref id)
throw (XmlRpcException);
/**
* Open a playable object, for reading only.
* Calls either getAudioClip() or getPlaylist().
* You do not need to release the returned Playable object.
*
* @param id the id of the playable object.
* @return the playable object opened.
* @exception XmlRpcException if no Playable with the specified
* id exists, or there was a communication problem.
*/
Ptr<Playable>::Ref
getPlayable(Ptr<const UniqueId>::Ref id)
throw (XmlRpcException);
/**
* Acquire a playable object.
* Calls either acquireAudioClip() or acquirePlaylist().

View File

@ -754,6 +754,7 @@ SearchWindow :: onAddToLiveMode(void) throw ()
if (playable) {
try {
gLiveSupport->addToScratchpad(playable);
playable = gLiveSupport->getPlayable(playable->getId());
gLiveSupport->addToLiveMode(playable);
} catch (XmlRpcException &e) {
Ptr<Glib::ustring>::Ref errorMessage(new Glib::ustring(