scheduling now works, so-so
This commit is contained in:
parent
2ba3b1d751
commit
5a31ad37ed
8 changed files with 120 additions and 36 deletions
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
|
|
||||||
Author : $Author: maroy $
|
Author : $Author: maroy $
|
||||||
Version : $Revision: 1.3 $
|
Version : $Revision: 1.4 $
|
||||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/Attic/DjBagWindow.cxx,v $
|
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/Attic/DjBagWindow.cxx,v $
|
||||||
|
|
||||||
------------------------------------------------------------------------------*/
|
------------------------------------------------------------------------------*/
|
||||||
|
@ -385,7 +385,6 @@ DjBagWindow :: onSchedulePlaylist(void) throw ()
|
||||||
Ptr<StorageClientInterface>::Ref storage =
|
Ptr<StorageClientInterface>::Ref storage =
|
||||||
gLiveSupport->getStorage();
|
gLiveSupport->getStorage();
|
||||||
|
|
||||||
// append the appropriate playable object to the end of the playlist
|
|
||||||
if (!storage->existsPlaylist(sessionId, uid)) {
|
if (!storage->existsPlaylist(sessionId, uid)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -401,7 +400,6 @@ DjBagWindow :: onSchedulePlaylist(void) throw ()
|
||||||
}
|
}
|
||||||
|
|
||||||
Ptr<SchedulePlaylistWindow>::Ref scheduleWindow;
|
Ptr<SchedulePlaylistWindow>::Ref scheduleWindow;
|
||||||
|
|
||||||
scheduleWindow.reset(new SchedulePlaylistWindow(gLiveSupport,
|
scheduleWindow.reset(new SchedulePlaylistWindow(gLiveSupport,
|
||||||
bundle,
|
bundle,
|
||||||
playlist));
|
playlist));
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
|
|
||||||
Author : $Author: maroy $
|
Author : $Author: maroy $
|
||||||
Version : $Revision: 1.12 $
|
Version : $Revision: 1.13 $
|
||||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/GLiveSupport.cxx,v $
|
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/GLiveSupport.cxx,v $
|
||||||
|
|
||||||
------------------------------------------------------------------------------*/
|
------------------------------------------------------------------------------*/
|
||||||
|
@ -329,14 +329,53 @@ GLiveSupport :: uploadFile(Ptr<const Glib::ustring>::Ref title,
|
||||||
|
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
/*------------------------------------------------------------------------------
|
||||||
* Upload a file to the server.
|
* Open a playlist for editing.
|
||||||
|
*----------------------------------------------------------------------------*/
|
||||||
|
Ptr<Playlist>::Ref
|
||||||
|
LiveSupport :: GLiveSupport ::
|
||||||
|
GLiveSupport :: openPlaylistForEditing(Ptr<UniqueId>::Ref playlistId)
|
||||||
|
throw (XmlRpcException)
|
||||||
|
{
|
||||||
|
releaseEditedPlaylist();
|
||||||
|
|
||||||
|
if (!playlistId.get()) {
|
||||||
|
editedPlaylist = storage->createPlaylist(sessionId);
|
||||||
|
playlistId = editedPlaylist->getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
editedPlaylist = storage->editPlaylist(sessionId, playlistId);
|
||||||
|
|
||||||
|
return editedPlaylist;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------------------
|
||||||
|
* Release the edited playlist.
|
||||||
*----------------------------------------------------------------------------*/
|
*----------------------------------------------------------------------------*/
|
||||||
void
|
void
|
||||||
LiveSupport :: GLiveSupport ::
|
LiveSupport :: GLiveSupport ::
|
||||||
GLiveSupport :: addToPlaylist(Ptr<const UniqueId>::Ref id) throw ()
|
GLiveSupport :: releaseEditedPlaylist(void)
|
||||||
|
throw (XmlRpcException)
|
||||||
|
{
|
||||||
|
if (editedPlaylist.get()) {
|
||||||
|
if (editedPlaylist->isLocked()) {
|
||||||
|
storage->releasePlaylist(sessionId, editedPlaylist);
|
||||||
|
}
|
||||||
|
editedPlaylist.reset();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*------------------------------------------------------------------------------
|
||||||
|
* Add a playlist to the currently edited playlist
|
||||||
|
*----------------------------------------------------------------------------*/
|
||||||
|
void
|
||||||
|
LiveSupport :: GLiveSupport ::
|
||||||
|
GLiveSupport :: addToPlaylist(Ptr<const UniqueId>::Ref id)
|
||||||
|
throw (XmlRpcException)
|
||||||
{
|
{
|
||||||
if (!editedPlaylist.get()) {
|
if (!editedPlaylist.get()) {
|
||||||
editedPlaylist = storage->createPlaylist(sessionId);
|
openPlaylistForEditing();
|
||||||
}
|
}
|
||||||
|
|
||||||
// for some wierd reason, the storage functions won't accept
|
// for some wierd reason, the storage functions won't accept
|
||||||
|
@ -361,14 +400,16 @@ GLiveSupport :: addToPlaylist(Ptr<const UniqueId>::Ref id) throw ()
|
||||||
*----------------------------------------------------------------------------*/
|
*----------------------------------------------------------------------------*/
|
||||||
Ptr<Playlist>::Ref
|
Ptr<Playlist>::Ref
|
||||||
LiveSupport :: GLiveSupport ::
|
LiveSupport :: GLiveSupport ::
|
||||||
GLiveSupport :: uploadPlaylist(Ptr<const Glib::ustring>::Ref title)
|
GLiveSupport :: savePlaylist(void)
|
||||||
throw (XmlRpcException)
|
throw (XmlRpcException)
|
||||||
{
|
{
|
||||||
editedPlaylist->setTitle(title);
|
|
||||||
|
|
||||||
storage->savePlaylist(sessionId, editedPlaylist);
|
storage->savePlaylist(sessionId, editedPlaylist);
|
||||||
|
|
||||||
|
Ptr<Playlist>::Ref playlist = storage->getPlaylist(sessionId,
|
||||||
|
editedPlaylist->getId());
|
||||||
|
|
||||||
// add the saved playlist to the DJ Bag, and update it
|
// add the saved playlist to the DJ Bag, and update it
|
||||||
|
// TODO: if already in the DJ bag, don't add, just pop it to the front
|
||||||
djBagContents->push_front(editedPlaylist);
|
djBagContents->push_front(editedPlaylist);
|
||||||
masterPanel->updateDjBagWindow();
|
masterPanel->updateDjBagWindow();
|
||||||
|
|
||||||
|
@ -385,11 +426,8 @@ GLiveSupport :: schedulePlaylist(Ptr<Playlist>::Ref playlist,
|
||||||
Ptr<posix_time::ptime>::Ref playtime)
|
Ptr<posix_time::ptime>::Ref playtime)
|
||||||
throw (XmlRpcException)
|
throw (XmlRpcException)
|
||||||
{
|
{
|
||||||
std::cerr << "schedulePlaylist #1" << std::endl;
|
|
||||||
scheduler->uploadPlaylist(sessionId, playlist->getId(), playtime);
|
scheduler->uploadPlaylist(sessionId, playlist->getId(), playtime);
|
||||||
std::cerr << "schedulePlaylist #2" << std::endl;
|
|
||||||
masterPanel->updateSchedulerWindow(playtime);
|
masterPanel->updateSchedulerWindow(playtime);
|
||||||
std::cerr << "schedulePlaylist #3" << std::endl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
|
|
||||||
Author : $Author: maroy $
|
Author : $Author: maroy $
|
||||||
Version : $Revision: 1.14 $
|
Version : $Revision: 1.15 $
|
||||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/GLiveSupport.h,v $
|
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/GLiveSupport.h,v $
|
||||||
|
|
||||||
------------------------------------------------------------------------------*/
|
------------------------------------------------------------------------------*/
|
||||||
|
@ -95,7 +95,7 @@ class MasterPanelWindow;
|
||||||
* respective documentation.
|
* respective documentation.
|
||||||
*
|
*
|
||||||
* @author $Author: maroy $
|
* @author $Author: maroy $
|
||||||
* @version $Revision: 1.14 $
|
* @version $Revision: 1.15 $
|
||||||
* @see LocalizedObject#getBundle(const xmlpp::Element &)
|
* @see LocalizedObject#getBundle(const xmlpp::Element &)
|
||||||
* @see AuthenticationClientFactory
|
* @see AuthenticationClientFactory
|
||||||
* @see StorageClientFactory
|
* @see StorageClientFactory
|
||||||
|
@ -369,29 +369,61 @@ class GLiveSupport : public LocalizedConfigurable,
|
||||||
return editedPlaylist;
|
return editedPlaylist;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new playlist or Open a playlist for editing.
|
||||||
|
* The opened playlist can be later accessed by getEditedPlaylist().
|
||||||
|
* Always release the opened playlist by calling
|
||||||
|
* releaseEditedPlaylist()
|
||||||
|
*
|
||||||
|
* @param playlistId the id of the playlist to open for editing.
|
||||||
|
* if a reference to 0, create a new playlist.
|
||||||
|
* @return the new playlist object, which is opened for editing.
|
||||||
|
* @exception XmlRpcException on XMl-RPC errors.
|
||||||
|
* @see #getEditedPlaylist
|
||||||
|
* @see #releaseEditedPlaylist
|
||||||
|
*/
|
||||||
|
Ptr<Playlist>::Ref
|
||||||
|
openPlaylistForEditing(
|
||||||
|
Ptr<UniqueId>::Ref playlistId = Ptr<UniqueId>::Ref())
|
||||||
|
throw (XmlRpcException);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a playable item to the currently open playlist.
|
* Add a playable item to the currently open playlist.
|
||||||
* If there is no currently open playlist, open the simple playlist
|
* If there is no currently open playlist, open the simple playlist
|
||||||
* management window with a new playlist, holding only this one
|
* management window with a new playlist, holding only this one
|
||||||
* entry.
|
* entry.
|
||||||
|
* Always release the opened playlist by calling
|
||||||
|
* releaseEditedPlaylist()
|
||||||
*
|
*
|
||||||
* @param id the id of the playable object to add to the playlist.
|
* @param id the id of the playable object to add to the playlist.
|
||||||
|
* @exception XmlRpcException on XMl-RPC errors.
|
||||||
|
* @see #releaseEditedPlaylist
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
addToPlaylist(Ptr<const UniqueId>::Ref id) throw ();
|
addToPlaylist(Ptr<const UniqueId>::Ref id)
|
||||||
|
throw (XmlRpcException);
|
||||||
/**
|
/**
|
||||||
* Save the currently edited playlist in storage.
|
* Save the currently edited playlist in storage.
|
||||||
|
* This call has to be preceeded by a call to openPlaylistForEditing()
|
||||||
|
* or addToPlaylist().
|
||||||
*
|
*
|
||||||
* @param title the title of the audio clip.
|
* @return the audio clip that was saved.
|
||||||
* @return the audio clip that was uploaded.
|
|
||||||
* @exception XmlRpcException on upload failures.
|
* @exception XmlRpcException on upload failures.
|
||||||
|
* @see #openPlaylistForEditing
|
||||||
|
* @see #addToPlaylist
|
||||||
*/
|
*/
|
||||||
Ptr<Playlist>::Ref
|
Ptr<Playlist>::Ref
|
||||||
uploadPlaylist(Ptr<const Glib::ustring>::Ref title)
|
savePlaylist(void) throw (XmlRpcException);
|
||||||
throw (XmlRpcException);
|
|
||||||
|
/**
|
||||||
|
* Release the playlist that was opened for editing.
|
||||||
|
*
|
||||||
|
* @exception XmlRpcException on XML-RPC errors.
|
||||||
|
* @see #openPlaylistForEditing
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
releaseEditedPlaylist(void) throw (XmlRpcException);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the scheduled entries for a specified time interval.
|
* Return the scheduled entries for a specified time interval.
|
||||||
*
|
*
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
|
|
||||||
Author : $Author: maroy $
|
Author : $Author: maroy $
|
||||||
Version : $Revision: 1.1 $
|
Version : $Revision: 1.2 $
|
||||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/SchedulePlaylistWindow.cxx,v $
|
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/SchedulePlaylistWindow.cxx,v $
|
||||||
|
|
||||||
------------------------------------------------------------------------------*/
|
------------------------------------------------------------------------------*/
|
||||||
|
@ -82,7 +82,10 @@ SchedulePlaylistWindow :: SchedulePlaylistWindow (
|
||||||
std::cerr << e.what() << std::endl;
|
std::cerr << e.what() << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
playlistLabel.reset(new Gtk::Label(*playlist->getTitle()));
|
// the title is lost, for some reason, see
|
||||||
|
// http://bugs.campware.org/view.php?id=534
|
||||||
|
// playlistLabel.reset(new Gtk::Label(*playlist->getTitle()));
|
||||||
|
playlistLabel.reset(new Gtk::Label("TODO: playlist title here"));
|
||||||
calendar.reset(new Gtk::Calendar());
|
calendar.reset(new Gtk::Calendar());
|
||||||
hourEntry.reset(new Gtk::Entry());
|
hourEntry.reset(new Gtk::Entry());
|
||||||
minuteEntry.reset(new Gtk::Entry());
|
minuteEntry.reset(new Gtk::Entry());
|
||||||
|
@ -154,11 +157,6 @@ SchedulePlaylistWindow :: onScheduleButtonClicked (void) throw ()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::cerr << "selected time: " << *selectedTime << std::endl;
|
|
||||||
std::cerr << "playist: " << playlist->getId()->getId()
|
|
||||||
<< ", " << *playlist->getTitle()
|
|
||||||
<< std::endl;
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
gLiveSupport->schedulePlaylist(playlist, selectedTime);
|
gLiveSupport->schedulePlaylist(playlist, selectedTime);
|
||||||
} catch (XmlRpcException &e) {
|
} catch (XmlRpcException &e) {
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
|
|
||||||
Author : $Author: maroy $
|
Author : $Author: maroy $
|
||||||
Version : $Revision: 1.2 $
|
Version : $Revision: 1.3 $
|
||||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/SchedulerWindow.cxx,v $
|
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/SchedulerWindow.cxx,v $
|
||||||
|
|
||||||
------------------------------------------------------------------------------*/
|
------------------------------------------------------------------------------*/
|
||||||
|
@ -196,6 +196,7 @@ SchedulerWindow :: showContents(void) throw ()
|
||||||
*midnight));
|
*midnight));
|
||||||
|
|
||||||
entries = gLiveSupport->displaySchedule(from, to);
|
entries = gLiveSupport->displaySchedule(from, to);
|
||||||
|
|
||||||
it = entries->begin();
|
it = entries->begin();
|
||||||
end = entries->end();
|
end = entries->end();
|
||||||
entriesModel->clear();
|
entriesModel->clear();
|
||||||
|
@ -217,7 +218,10 @@ SchedulerWindow :: showContents(void) throw ()
|
||||||
row[entryColumns->idColumn] = entry->getId();
|
row[entryColumns->idColumn] = entry->getId();
|
||||||
row[entryColumns->startColumn] =
|
row[entryColumns->startColumn] =
|
||||||
to_simple_string(*entry->getStartTime());
|
to_simple_string(*entry->getStartTime());
|
||||||
row[entryColumns->titleColumn] = *playlist->getTitle();
|
// the title is lost, for some reason, see
|
||||||
|
// http://bugs.campware.org/view.php?id=534
|
||||||
|
// row[entryColumns->titleColumn] = *playlist->getTitle();
|
||||||
|
row[entryColumns->titleColumn] = "TODO: playlist title here";
|
||||||
row[entryColumns->endColumn] = to_simple_string(*entry->getEndTime());
|
row[entryColumns->endColumn] = to_simple_string(*entry->getEndTime());
|
||||||
|
|
||||||
++it;
|
++it;
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
|
|
||||||
Author : $Author: maroy $
|
Author : $Author: maroy $
|
||||||
Version : $Revision: 1.3 $
|
Version : $Revision: 1.4 $
|
||||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/SimplePlaylistManagementWindow.cxx,v $
|
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/SimplePlaylistManagementWindow.cxx,v $
|
||||||
|
|
||||||
------------------------------------------------------------------------------*/
|
------------------------------------------------------------------------------*/
|
||||||
|
@ -145,11 +145,21 @@ SimplePlaylistManagementWindow :: onSaveButtonClicked (void) throw ()
|
||||||
|
|
||||||
title.reset(new Glib::ustring(nameEntry->get_text()));
|
title.reset(new Glib::ustring(nameEntry->get_text()));
|
||||||
|
|
||||||
playlist = gLiveSupport->uploadPlaylist(title);
|
playlist = gLiveSupport->getEditedPlaylist();
|
||||||
|
playlist->setTitle(title);
|
||||||
|
|
||||||
Glib::ustring statusText("uploaded playlist ");
|
playlist = gLiveSupport->savePlaylist();
|
||||||
statusText += *playlist->getTitle();
|
|
||||||
statusBar->set_text(statusText);
|
Ptr<UnicodeString>::Ref uTitle = ustringToUnicodeString(
|
||||||
|
playlist->getTitle());
|
||||||
|
Formattable arguments[] = { *uTitle };
|
||||||
|
Ptr<Glib::ustring>::Ref statusText = formatMessageUstring(
|
||||||
|
"playlistSavedMessage",
|
||||||
|
arguments,
|
||||||
|
1);
|
||||||
|
statusBar->set_text(*statusText);
|
||||||
|
|
||||||
|
gLiveSupport->releaseEditedPlaylist();
|
||||||
} catch (XmlRpcException &e) {
|
} catch (XmlRpcException &e) {
|
||||||
statusBar->set_text(e.what());
|
statusBar->set_text(e.what());
|
||||||
}
|
}
|
||||||
|
@ -162,6 +172,8 @@ SimplePlaylistManagementWindow :: onSaveButtonClicked (void) throw ()
|
||||||
void
|
void
|
||||||
SimplePlaylistManagementWindow :: onCloseButtonClicked (void) throw ()
|
SimplePlaylistManagementWindow :: onCloseButtonClicked (void) throw ()
|
||||||
{
|
{
|
||||||
|
gLiveSupport->releaseEditedPlaylist();
|
||||||
|
|
||||||
hide();
|
hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -84,6 +84,7 @@ hu:table
|
||||||
saveButtonLabel:string { "elment" }
|
saveButtonLabel:string { "elment" }
|
||||||
closeButtonLabel:string { "bezár" }
|
closeButtonLabel:string { "bezár" }
|
||||||
statusBar:string { "állapotsor" }
|
statusBar:string { "állapotsor" }
|
||||||
|
playlistSavedMessage:string { "playlist {0} elmentve" }
|
||||||
}
|
}
|
||||||
|
|
||||||
schedulerWindow:table
|
schedulerWindow:table
|
||||||
|
|
|
@ -84,6 +84,7 @@ root:table
|
||||||
saveButtonLabel:string { "save" }
|
saveButtonLabel:string { "save" }
|
||||||
closeButtonLabel:string { "close" }
|
closeButtonLabel:string { "close" }
|
||||||
statusBar:string { "status bar" }
|
statusBar:string { "status bar" }
|
||||||
|
playlistSavedMessage:string { "saved playlist {0}" }
|
||||||
}
|
}
|
||||||
|
|
||||||
schedulerWindow:table
|
schedulerWindow:table
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue