added fade in and fade out columns to playlist editor window
This commit is contained in:
parent
4d1574ca0b
commit
2b368af7ad
3 changed files with 53 additions and 16 deletions
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
|
|
||||||
Author : $Author: fgerlits $
|
Author : $Author: fgerlits $
|
||||||
Version : $Revision: 1.17 $
|
Version : $Revision: 1.18 $
|
||||||
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 $
|
||||||
|
|
||||||
------------------------------------------------------------------------------*/
|
------------------------------------------------------------------------------*/
|
||||||
|
@ -36,6 +36,8 @@
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
|
||||||
|
#include "LiveSupport/Core/TimeConversion.h"
|
||||||
|
|
||||||
#include "SimplePlaylistManagementWindow.h"
|
#include "SimplePlaylistManagementWindow.h"
|
||||||
|
|
||||||
|
|
||||||
|
@ -98,11 +100,15 @@ SimplePlaylistManagementWindow :: SimplePlaylistManagementWindow (
|
||||||
// Add the TreeView's view columns:
|
// Add the TreeView's view columns:
|
||||||
try {
|
try {
|
||||||
entriesView->appendColumn(*getResourceUstring("startColumnLabel"),
|
entriesView->appendColumn(*getResourceUstring("startColumnLabel"),
|
||||||
modelColumns.startColumn, 120);
|
modelColumns.startColumn, 80);
|
||||||
entriesView->appendColumn(*getResourceUstring("titleColumnLabel"),
|
entriesView->appendColumn(*getResourceUstring("titleColumnLabel"),
|
||||||
modelColumns.titleColumn, 200);
|
modelColumns.titleColumn, 200);
|
||||||
|
entriesView->appendColumn(*getResourceUstring("fadeInColumnLabel"),
|
||||||
|
modelColumns.fadeInColumn, 80);
|
||||||
entriesView->appendColumn(*getResourceUstring("lengthColumnLabel"),
|
entriesView->appendColumn(*getResourceUstring("lengthColumnLabel"),
|
||||||
modelColumns.lengthColumn, 120);
|
modelColumns.lengthColumn, 80);
|
||||||
|
entriesView->appendColumn(*getResourceUstring("fadeOutColumnLabel"),
|
||||||
|
modelColumns.fadeOutColumn, 80);
|
||||||
|
|
||||||
statusBar = Gtk::manage(new Gtk::Label(""));
|
statusBar = Gtk::manage(new Gtk::Label(""));
|
||||||
} catch (std::invalid_argument &e) {
|
} catch (std::invalid_argument &e) {
|
||||||
|
@ -289,11 +295,28 @@ SimplePlaylistManagementWindow :: showContents(void) throw ()
|
||||||
row[modelColumns.idColumn]
|
row[modelColumns.idColumn]
|
||||||
= playable->getId();
|
= playable->getId();
|
||||||
row[modelColumns.startColumn]
|
row[modelColumns.startColumn]
|
||||||
= to_simple_string(*playlistElem->getRelativeOffset());
|
= *TimeConversion::timeDurationToHhMmSsString(
|
||||||
|
playlistElem->getRelativeOffset());
|
||||||
row[modelColumns.titleColumn]
|
row[modelColumns.titleColumn]
|
||||||
= Glib::Markup::escape_text(*playable->getTitle());
|
= Glib::Markup::escape_text(*playable->getTitle());
|
||||||
row[modelColumns.lengthColumn]
|
row[modelColumns.lengthColumn]
|
||||||
= to_simple_string(*playable->getPlaylength());
|
= *TimeConversion::timeDurationToHhMmSsString(
|
||||||
|
playable->getPlaylength());
|
||||||
|
|
||||||
|
Ptr<FadeInfo>::Ref fadeInfo = playlistElem->getFadeInfo();
|
||||||
|
Ptr<time_duration>::Ref fadeIn, fadeOut;
|
||||||
|
if (fadeInfo) {
|
||||||
|
fadeIn = fadeInfo->getFadeIn();
|
||||||
|
fadeOut = fadeInfo->getFadeOut();
|
||||||
|
}
|
||||||
|
row[modelColumns.fadeInColumn]
|
||||||
|
= (fadeIn && fadeIn->total_microseconds() != 0)
|
||||||
|
? *TimeConversion::timeDurationToHhMmSsString(fadeIn)
|
||||||
|
: "-";
|
||||||
|
row[modelColumns.fadeOutColumn]
|
||||||
|
= (fadeOut && fadeOut->total_microseconds() != 0)
|
||||||
|
? *TimeConversion::timeDurationToHhMmSsString(fadeOut)
|
||||||
|
: "-";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
|
|
||||||
Author : $Author: fgerlits $
|
Author : $Author: fgerlits $
|
||||||
Version : $Revision: 1.7 $
|
Version : $Revision: 1.8 $
|
||||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/SimplePlaylistManagementWindow.h,v $
|
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/SimplePlaylistManagementWindow.h,v $
|
||||||
|
|
||||||
------------------------------------------------------------------------------*/
|
------------------------------------------------------------------------------*/
|
||||||
|
@ -87,7 +87,7 @@ using namespace LiveSupport::Widgets;
|
||||||
* </code></pre>
|
* </code></pre>
|
||||||
*
|
*
|
||||||
* @author $Author: fgerlits $
|
* @author $Author: fgerlits $
|
||||||
* @version $Revision: 1.7 $
|
* @version $Revision: 1.8 $
|
||||||
*/
|
*/
|
||||||
class SimplePlaylistManagementWindow : public WhiteWindow,
|
class SimplePlaylistManagementWindow : public WhiteWindow,
|
||||||
public LocalizedObject
|
public LocalizedObject
|
||||||
|
@ -100,7 +100,7 @@ class SimplePlaylistManagementWindow : public WhiteWindow,
|
||||||
* Lists one playlist entry per row.
|
* Lists one playlist entry per row.
|
||||||
*
|
*
|
||||||
* @author $Author: fgerlits $
|
* @author $Author: fgerlits $
|
||||||
* @version $Revision: 1.7 $
|
* @version $Revision: 1.8 $
|
||||||
*/
|
*/
|
||||||
class ModelColumns : public ZebraTreeModelColumnRecord
|
class ModelColumns : public ZebraTreeModelColumnRecord
|
||||||
{
|
{
|
||||||
|
@ -120,11 +120,21 @@ class SimplePlaylistManagementWindow : public WhiteWindow,
|
||||||
*/
|
*/
|
||||||
Gtk::TreeModelColumn<Glib::ustring> titleColumn;
|
Gtk::TreeModelColumn<Glib::ustring> titleColumn;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The column for the fade in of the playlist entry.
|
||||||
|
*/
|
||||||
|
Gtk::TreeModelColumn<Glib::ustring> fadeInColumn;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The column for the length of the playlist entry.
|
* The column for the length of the playlist entry.
|
||||||
*/
|
*/
|
||||||
Gtk::TreeModelColumn<Glib::ustring> lengthColumn;
|
Gtk::TreeModelColumn<Glib::ustring> lengthColumn;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The column for the fade out of the playlist entry.
|
||||||
|
*/
|
||||||
|
Gtk::TreeModelColumn<Glib::ustring> fadeOutColumn;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*/
|
*/
|
||||||
|
@ -133,7 +143,9 @@ class SimplePlaylistManagementWindow : public WhiteWindow,
|
||||||
add(idColumn);
|
add(idColumn);
|
||||||
add(startColumn);
|
add(startColumn);
|
||||||
add(titleColumn);
|
add(titleColumn);
|
||||||
|
add(fadeInColumn);
|
||||||
add(lengthColumn);
|
add(lengthColumn);
|
||||||
|
add(fadeOutColumn);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -108,15 +108,17 @@ root:table
|
||||||
{
|
{
|
||||||
windowTitle:string { "LiveSupport Simple Playlist Management Window" }
|
windowTitle:string { "LiveSupport Simple Playlist Management Window" }
|
||||||
|
|
||||||
startColumnLabel:string { "start" }
|
startColumnLabel:string { "Start" }
|
||||||
titleColumnLabel:string { "title" }
|
titleColumnLabel:string { "Title" }
|
||||||
lengthColumnLabel:string { "length" }
|
lengthColumnLabel:string { "Length" }
|
||||||
nameLabel:string { "name" }
|
fadeInColumnLabel:string { "Fade in" }
|
||||||
saveButtonLabel:string { "save" }
|
fadeOutColumnLabel:string { "Fade out" }
|
||||||
closeButtonLabel:string { "close" }
|
nameLabel:string { "Name" }
|
||||||
|
saveButtonLabel:string { "Save" }
|
||||||
|
closeButtonLabel:string { "Close" }
|
||||||
statusBar:string { "status bar" }
|
statusBar:string { "status bar" }
|
||||||
playlistSavedMsg:string { "saved playlist {0}" }
|
playlistSavedMsg:string { "Saved playlist ''{0}''." }
|
||||||
savePlaylistDialogMsg:string { "Would you like to save the playlist?" }
|
savePlaylistDialogMsg:string { "Do you want to save the playlist?" }
|
||||||
emptyTitleErrorMsg:string { "Please enter a title." }
|
emptyTitleErrorMsg:string { "Please enter a title." }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue