fixing #1907
This commit is contained in:
parent
90fd4b1ca8
commit
c301eb13ae
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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:
|
||||
/**
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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.
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue