This commit is contained in:
fgerlits 2006-11-01 12:47:02 +00:00
parent 90fd4b1ca8
commit c301eb13ae
5 changed files with 102 additions and 3 deletions

View File

@ -1118,7 +1118,9 @@ GLiveSupport :: savePlaylist(void)
}
// update with new version
// this will also add it to the local cache
uncachePlaylist(editedPlaylist->getId());
addToScratchpad(editedPlaylist);
refreshPlaylistInLiveMode(editedPlaylist);
}
editedPlaylist.reset();
}
@ -1688,3 +1690,15 @@ GLiveSupport :: displayAuthenticationServerMissingMessage(void) throw ()
}
}
/*------------------------------------------------------------------------------
* Refresh the playlist in the Live Mode window.
*----------------------------------------------------------------------------*/
void
LiveSupport :: GLiveSupport ::
GLiveSupport :: refreshPlaylistInLiveMode(Ptr<Playlist>::Ref playlist)
throw ()
{
masterPanel->refreshPlaylistInLiveMode(playlist);
}

View File

@ -344,6 +344,19 @@ class GLiveSupport : public LocalizedConfigurable,
void
displayAuthenticationServerMissingMessage(void) throw ();
/**
* Refresh the playlist in the Live Mode window.
* Updates the playlist to the new copy supplied in the argument,
* if it is present in the Live Mode window.
* This is called by savePlaylist() after the playlist has been
* edited.
*
* @param playlist the new version of the playlist.
*/
void
refreshPlaylistInLiveMode(Ptr<Playlist>::Ref playlist)
throw ();
protected:
/**

View File

@ -208,13 +208,24 @@ LiveModeWindow :: LiveModeWindow (Ptr<GLiveSupport>::Ref gLiveSupport,
/*------------------------------------------------------------------------------
* Add a new item to the Live Mode Window.
* Add a new item to the top of the Live Mode Window.
*----------------------------------------------------------------------------*/
void
LiveModeWindow :: addItem(Ptr<Playable>::Ref playable) throw ()
{
Gtk::TreeModel::Row row = *(treeModel->append());
addItem(treeModel->append(), playable);
}
/*------------------------------------------------------------------------------
* Add a new item as the given row in the Live Mode Window.
*----------------------------------------------------------------------------*/
void
LiveModeWindow :: addItem(Gtk::TreeModel::iterator iter,
Ptr<Playable>::Ref playable) throw ()
{
Gtk::TreeModel::Row row = *iter;
row[modelColumns.playableColumn] = playable;
Ptr<Glib::ustring>::Ref infoString(new Glib::ustring);
@ -444,3 +455,19 @@ LiveModeWindow :: on_hide(void) throw ()
GuiWindow::on_hide();
}
/*------------------------------------------------------------------------------
* Refresh the playlist in the window.
*----------------------------------------------------------------------------*/
void
LiveModeWindow :: refreshPlaylist(Ptr<Playlist>::Ref playlist) throw ()
{
for (Gtk::TreeModel::iterator iter = treeModel->children().begin();
iter != treeModel->children().end(); ++iter) {
Ptr<Playable>::Ref currentItem = (*iter)[modelColumns.playableColumn];
if (*currentItem->getId() == *playlist->getId()) {
addItem(iter, playlist);
}
}
}

View File

@ -246,13 +246,28 @@ class LiveModeWindow : public GuiWindow
}
/**
* Add a new item to the Live Mode Window.
* Add a new item to the top of the Live Mode Window.
*
* @param playable the playable object to be added.
*/
void
addItem(Ptr<Playable>::Ref playable) throw ();
/**
* Add a new item as the given row in the Live Mode Window.
*
* @param iter an iterator pointing to the row to be updated.
* @param playable the playable object to be added.
*/
void
addItem(Gtk::TreeModel::iterator iter,
Ptr<Playable>::Ref playable) throw ();
/**
* "Pop" the first item from the top of the Live Mode Window.
*
* @return the playable object at the top of the window,
* or 0 if the window is empty.
*/
Ptr<Playable>::Ref
popTop(void) throw ();
@ -265,6 +280,18 @@ class LiveModeWindow : public GuiWindow
{
cueAudioButtons->onStop();
}
/**
* Refresh the playlist in the window.
* Updates the playlist to the new copy supplied in the argument,
* if it is present in the window.
* This is called by GLiveSupport::savePlaylist() after the playlist
* has been edited.
*
* @param playlist the new version of the playlist.
*/
void
refreshPlaylist(Ptr<Playlist>::Ref playlist) throw ();
};
/* ================================================= external data structures */

View File

@ -471,6 +471,24 @@ class MasterPanelWindow : public Gtk::Window, public LocalizedObject
= Ptr<Playable>::Ref())
throw ();
/**
* Refresh the playlist in the Live Mode window.
* Updates the playlist to the new copy supplied in the argument,
* if it is present in the Live Mode window.
* This is called by GLiveSupport::savePlaylist() after the playlist
* has been edited.
*
* @param playlist the new version of the playlist.
*/
void
refreshPlaylistInLiveMode(Ptr<Playlist>::Ref playlist)
throw ()
{
if (liveModeWindow) {
liveModeWindow->refreshPlaylist(playlist);
}
}
/**
* Create the Scratchpad window.
*/