Reformatted the Now Playing display to look more like it used to.

This commit is contained in:
fgerlits 2007-08-14 12:09:24 +00:00
parent b8a863a472
commit 3768ae6f6e
5 changed files with 181 additions and 107 deletions

View File

@ -35,9 +35,6 @@
#include <iostream>
#include <unicode/msgfmt.h>
#include <gtkmm/label.h>
#include <gtkmm/main.h>
#include <gdkmm/pixbuf.h>
#include "LiveSupport/Core/TimeConversion.h"
#include "LoginWindow.h"
@ -201,7 +198,7 @@ MasterPanelWindow :: ~MasterPanelWindow (void) throw ()
* Change the language of the panel
*----------------------------------------------------------------------------*/
void
MasterPanelWindow :: changeLanguage(void)
MasterPanelWindow :: changeLanguage (void)
throw ()
{
Ptr<ResourceBundle>::Ref newBundle = gLiveSupport->getBundle(
@ -244,7 +241,7 @@ MasterPanelWindow :: changeLanguage(void)
* Set the timer
*----------------------------------------------------------------------------*/
void
MasterPanelWindow :: setTimer(void) throw ()
MasterPanelWindow :: setTimer (void) throw ()
{
sigc::slot<bool> slot = sigc::bind(sigc::mem_fun(*this,
&MasterPanelWindow::onUpdateTime),
@ -260,7 +257,7 @@ MasterPanelWindow :: setTimer(void) throw ()
* Clear the timer
*----------------------------------------------------------------------------*/
void
MasterPanelWindow :: resetTimer(void) throw ()
MasterPanelWindow :: resetTimer (void) throw ()
{
timer->disconnect();
timer.reset();
@ -271,7 +268,7 @@ MasterPanelWindow :: resetTimer(void) throw ()
* Update the timeLabel display, with the current time
*----------------------------------------------------------------------------*/
bool
MasterPanelWindow :: onUpdateTime(int dummy) throw ()
MasterPanelWindow :: onUpdateTime (int dummy) throw ()
{
Ptr<const ptime>::Ref now;
@ -338,7 +335,7 @@ MasterPanelWindow :: onUpdateTime(int dummy) throw ()
* The event when the Live Mode button has been clicked.
*----------------------------------------------------------------------------*/
void
MasterPanelWindow :: updateLiveModeWindow(Ptr<Playable>::Ref playable)
MasterPanelWindow :: updateLiveModeWindow (Ptr<Playable>::Ref playable)
throw ()
{
if (!liveModeWindow.get()) {
@ -359,7 +356,7 @@ MasterPanelWindow :: updateLiveModeWindow(Ptr<Playable>::Ref playable)
* The event when the upload file button has been clicked.
*----------------------------------------------------------------------------*/
void
MasterPanelWindow :: updateUploadFileWindow(void) throw ()
MasterPanelWindow :: updateUploadFileWindow (void) throw ()
{
if (!uploadFileWindow.get()) {
uploadFileWindow.reset(new UploadFileWindow(uploadFileButton));
@ -374,7 +371,7 @@ MasterPanelWindow :: updateUploadFileWindow(void) throw ()
* Create the Scratchpad window.
*----------------------------------------------------------------------------*/
void
MasterPanelWindow :: createScratchpadWindow(void)
MasterPanelWindow :: createScratchpadWindow (void)
throw ()
{
if (!scratchpadWindow.get()) {
@ -388,7 +385,7 @@ MasterPanelWindow :: createScratchpadWindow(void)
* The event when the Scratchpad button has been clicked.
*----------------------------------------------------------------------------*/
void
MasterPanelWindow :: updateScratchpadWindow(Ptr<Playable>::Ref playable)
MasterPanelWindow :: updateScratchpadWindow (Ptr<Playable>::Ref playable)
throw ()
{
createScratchpadWindow();
@ -406,7 +403,7 @@ MasterPanelWindow :: updateScratchpadWindow(Ptr<Playable>::Ref playable)
* The event when the Playlist button has been clicked.
*----------------------------------------------------------------------------*/
void
MasterPanelWindow :: updatePlaylistWindow(void) throw ()
MasterPanelWindow :: updatePlaylistWindow (void) throw ()
{
if (!playlistWindow.get()) {
playlistWindow.reset(new PlaylistWindow(playlistButton));
@ -423,7 +420,7 @@ MasterPanelWindow :: updatePlaylistWindow(void) throw ()
* The event when the Scheduler button has been clicked.
*----------------------------------------------------------------------------*/
void
MasterPanelWindow :: updateSchedulerWindow(
MasterPanelWindow :: updateSchedulerWindow (
Ptr<boost::posix_time::ptime>::Ref time)
throw ()
{
@ -457,7 +454,7 @@ MasterPanelWindow :: updateSchedulerWindow(
* The event when the Search button has been clicked.
*----------------------------------------------------------------------------*/
void
MasterPanelWindow :: updateSearchWindow(void) throw ()
MasterPanelWindow :: updateSearchWindow (void) throw ()
{
if (!searchWindow.get()) {
searchWindow.reset(new SearchWindow(searchButton));
@ -472,7 +469,7 @@ MasterPanelWindow :: updateSearchWindow(void) throw ()
* The event when the Options button has been clicked.
*----------------------------------------------------------------------------*/
void
MasterPanelWindow :: updateOptionsWindow(void) throw ()
MasterPanelWindow :: updateOptionsWindow (void) throw ()
{
if (!optionsWindow.get()) {
optionsWindow.reset(new OptionsWindow(optionsButton));
@ -491,7 +488,7 @@ MasterPanelWindow :: updateOptionsWindow(void) throw ()
* Show only the UI components that are visible when no one is logged in
*----------------------------------------------------------------------------*/
void
MasterPanelWindow :: showAnonymousUI(void) throw ()
MasterPanelWindow :: showAnonymousUI (void) throw ()
{
mainButtonBox->hide();
@ -550,7 +547,7 @@ MasterPanelWindow :: showAnonymousUI(void) throw ()
* Cancel the playlist edited in the PlaylistWindow, if any.
*----------------------------------------------------------------------------*/
bool
MasterPanelWindow :: cancelEditedPlaylist(void) throw ()
MasterPanelWindow :: cancelEditedPlaylist (void) throw ()
{
if (playlistWindow) {
return playlistWindow->cancelPlaylist();
@ -564,7 +561,7 @@ MasterPanelWindow :: cancelEditedPlaylist(void) throw ()
* Show the UI components that are visible to a specific user.
*----------------------------------------------------------------------------*/
void
MasterPanelWindow :: showLoggedInUI(void) throw ()
MasterPanelWindow :: showLoggedInUI (void) throw ()
{
mainButtonBox->show();
@ -592,7 +589,7 @@ MasterPanelWindow :: showLoggedInUI(void) throw ()
* Get the next item from the top of the Live Mode window.
*----------------------------------------------------------------------------*/
Ptr<Playable>::Ref
MasterPanelWindow :: getNextItemToPlay() throw ()
MasterPanelWindow :: getNextItemToPlay (void) throw ()
{
if (liveModeWindow) {
return liveModeWindow->popTop();
@ -608,7 +605,7 @@ MasterPanelWindow :: getNextItemToPlay() throw ()
*----------------------------------------------------------------------------*/
void
LiveSupport::GLiveSupport::
resizeImage(Gtk::Image* image, int width, int height) throw ()
resizeImage (Gtk::Image* image, int width, int height) throw ()
{
Glib::RefPtr<Gdk::Pixbuf> pixbuf = image->get_pixbuf();
int imageWidth = pixbuf->get_width();
@ -634,7 +631,7 @@ resizeImage(Gtk::Image* image, int width, int height) throw ()
* Event handler for a key pressed.
*----------------------------------------------------------------------------*/
bool
MasterPanelWindow :: onKeyPressed(GdkEventKey * event) throw ()
MasterPanelWindow :: onKeyPressed (GdkEventKey * event) throw ()
{
if (event->type == GDK_KEY_PRESS) {
KeyboardShortcut::Action action = gLiveSupport->findAction(
@ -669,7 +666,7 @@ MasterPanelWindow :: onKeyPressed(GdkEventKey * event) throw ()
* The event when the Search button has been clicked.
*----------------------------------------------------------------------------*/
void
MasterPanelWindow :: uploadToHub(Ptr<Playable>::Ref playable)
MasterPanelWindow :: uploadToHub (Ptr<Playable>::Ref playable)
throw ()
{
if (!searchWindow.get()) {
@ -687,7 +684,7 @@ MasterPanelWindow :: uploadToHub(Ptr<Playable>::Ref playable)
* Show or hide the Scheduler button.
*----------------------------------------------------------------------------*/
void
MasterPanelWindow :: setSchedulerAvailable(bool status) throw ()
MasterPanelWindow :: setSchedulerAvailable (bool status) throw ()
{
if (status == false) {
if (schedulerWindow && schedulerWindow->getWindow()->is_visible()) {
@ -705,7 +702,7 @@ MasterPanelWindow :: setSchedulerAvailable(bool status) throw ()
* Update the cue player displays to show a stopped state.
*----------------------------------------------------------------------------*/
void
MasterPanelWindow :: showCuePlayerStopped(void) throw ()
MasterPanelWindow :: showCuePlayerStopped (void) throw ()
{
if (scratchpadWindow) {
scratchpadWindow->showCuePlayerStopped();
@ -721,7 +718,7 @@ MasterPanelWindow :: showCuePlayerStopped(void) throw ()
* Handle the event of the Login/Logout button being clicked.
*----------------------------------------------------------------------------*/
void
MasterPanelWindow :: onLoginButtonClicked(void) throw ()
MasterPanelWindow :: onLoginButtonClicked (void) throw ()
{
if (userIsLoggedIn) {
logout();
@ -735,7 +732,7 @@ MasterPanelWindow :: onLoginButtonClicked(void) throw ()
* Let the user log in.
*----------------------------------------------------------------------------*/
void
MasterPanelWindow :: login(void) throw ()
MasterPanelWindow :: login (void) throw ()
{
Ptr<LoginWindow>::Ref loginWindow(new LoginWindow());
userIsLoggedIn = loginWindow->run();
@ -755,7 +752,7 @@ MasterPanelWindow :: login(void) throw ()
* Let the user log out.
*----------------------------------------------------------------------------*/
void
MasterPanelWindow :: logout(void) throw ()
MasterPanelWindow :: logout (void) throw ()
{
bool userCanceledTheLogout = !gLiveSupport->logout();
if (userCanceledTheLogout) {
@ -771,7 +768,7 @@ MasterPanelWindow :: logout(void) throw ()
* Show the user info and the login button.
*----------------------------------------------------------------------------*/
void
MasterPanelWindow :: updateUserInfo(Ptr<const Glib::ustring>::Ref loginName)
MasterPanelWindow :: updateUserInfo (Ptr<const Glib::ustring>::Ref loginName)
throw ()
{
if (userIsLoggedIn) {
@ -801,7 +798,7 @@ MasterPanelWindow :: updateUserInfo(Ptr<const Glib::ustring>::Ref loginName)
* Event handler for when the user closes the master panel.
*----------------------------------------------------------------------------*/
bool
MasterPanelWindow :: onDeleteEvent(GdkEventAny * event) throw ()
MasterPanelWindow :: onDeleteEvent (GdkEventAny * event) throw ()
{
Gtk::ResponseType response = gLiveSupport->runNoYesDialog(
*getResourceUstring("sureToExitMsg"));

View File

@ -106,13 +106,13 @@ class MasterPanelWindow : public GuiWindow
* Log in.
*/
void
login(void) throw ();
login (void) throw ();
/**
* Log out.
*/
void
logout(void) throw ();
logout (void) throw ();
protected:
@ -227,7 +227,7 @@ class MasterPanelWindow : public GuiWindow
* false if the timer should be canceled
*/
virtual bool
onUpdateTime(int dummy) throw ();
onUpdateTime (int dummy) throw ();
/**
* Register onUpdateTime with the GTK timer.
@ -235,7 +235,7 @@ class MasterPanelWindow : public GuiWindow
* @see #resetTimer
*/
virtual void
setTimer(void) throw ();
setTimer (void) throw ();
/**
* Stop the timer, which was set by setTimer().
@ -243,14 +243,14 @@ class MasterPanelWindow : public GuiWindow
* @see #setTimer
*/
virtual void
resetTimer(void) throw ();
resetTimer (void) throw ();
/**
* Function to catch the event of the file upload button being
* pressed.
*/
virtual void
onUploadFileButtonClicked(void) throw ()
onUploadFileButtonClicked (void) throw ()
{
if (!uploadFileWindow ||
uploadFileWindow && !uploadFileWindow->getWindow()
@ -266,7 +266,7 @@ class MasterPanelWindow : public GuiWindow
* pressed.
*/
virtual void
onLiveModeButtonClicked(void) throw ()
onLiveModeButtonClicked (void) throw ()
{
if (!liveModeWindow ||
liveModeWindow && !liveModeWindow->getWindow()
@ -282,7 +282,7 @@ class MasterPanelWindow : public GuiWindow
* pressed.
*/
virtual void
onScratchpadButtonClicked(void) throw ()
onScratchpadButtonClicked (void) throw ()
{
if (!scratchpadWindow ||
scratchpadWindow && !scratchpadWindow->getWindow()
@ -298,7 +298,7 @@ class MasterPanelWindow : public GuiWindow
* Management button being pressed.
*/
virtual void
onPlaylistButtonClicked(void) throw ()
onPlaylistButtonClicked (void) throw ()
{
if (!playlistWindow ||
playlistWindow && !playlistWindow->getWindow()
@ -314,7 +314,7 @@ class MasterPanelWindow : public GuiWindow
* button being pressed.
*/
virtual void
onSchedulerButtonClicked(void) throw ()
onSchedulerButtonClicked (void) throw ()
{
if (!schedulerWindow ||
schedulerWindow && !schedulerWindow->getWindow()
@ -330,7 +330,7 @@ class MasterPanelWindow : public GuiWindow
* button being pressed.
*/
virtual void
onSearchButtonClicked(void) throw ()
onSearchButtonClicked (void) throw ()
{
if (!searchWindow ||
searchWindow && !searchWindow->getWindow()
@ -346,7 +346,7 @@ class MasterPanelWindow : public GuiWindow
* button being pressed.
*/
virtual void
onOptionsButtonClicked(void) throw ()
onOptionsButtonClicked (void) throw ()
{
if (!optionsWindow ||
optionsWindow && !optionsWindow->getWindow()
@ -362,7 +362,7 @@ class MasterPanelWindow : public GuiWindow
* button being pressed.
*/
virtual void
onLoginButtonClicked(void) throw ();
onLoginButtonClicked (void) throw ();
/**
* Signal handler for a key pressed at one of the entries.
@ -376,7 +376,7 @@ class MasterPanelWindow : public GuiWindow
* @return true if the key press was fully handled, false if not
*/
bool
onKeyPressed(GdkEventKey * event) throw ();
onKeyPressed (GdkEventKey * event) throw ();
/**
* Event handler for when the user closes the master panel.
@ -388,7 +388,7 @@ class MasterPanelWindow : public GuiWindow
* @return true if handled the event, false to continue deleting.
*/
virtual bool
onDeleteEvent(GdkEventAny * event) throw ();
onDeleteEvent (GdkEventAny * event) throw ();
public:
@ -396,13 +396,13 @@ class MasterPanelWindow : public GuiWindow
/**
* Constructor.
*/
MasterPanelWindow(void) throw ();
MasterPanelWindow (void) throw ();
/**
* Virtual destructor.
*/
virtual
~MasterPanelWindow(void) throw ();
~MasterPanelWindow (void) throw ();
/**
* Change the user interface language of the application.
@ -415,13 +415,13 @@ class MasterPanelWindow : public GuiWindow
* this call, but subsequently opened windows are.
*/
void
changeLanguage(void) throw ();
changeLanguage (void) throw ();
/**
* Show the UI components that are visible when no one is logged in.
*/
void
showAnonymousUI(void) throw ();
showAnonymousUI (void) throw ();
/**
* Cancel the playlist edited in the PlaylistWindow.
@ -431,13 +431,13 @@ class MasterPanelWindow : public GuiWindow
* @see PlaylistWindow::cancelPlaylist()
*/
bool
cancelEditedPlaylist(void) throw ();
cancelEditedPlaylist (void) throw ();
/**
* Show the UI components that are visible when someone is logged in.
*/
void
showLoggedInUI(void) throw ();
showLoggedInUI (void) throw ();
/**
* Update the Live Mode window.
@ -446,9 +446,9 @@ class MasterPanelWindow : public GuiWindow
* the live mode window.
*/
void
updateLiveModeWindow(Ptr<Playable>::Ref playable
updateLiveModeWindow (Ptr<Playable>::Ref playable
= Ptr<Playable>::Ref())
throw ();
throw ();
/**
* Refresh the playlist in the Live Mode window.
@ -460,8 +460,8 @@ class MasterPanelWindow : public GuiWindow
* @param playlist the new version of the playlist.
*/
void
refreshPlaylistInLiveMode(Ptr<Playlist>::Ref playlist)
throw ()
refreshPlaylistInLiveMode (Ptr<Playlist>::Ref playlist)
throw ()
{
if (liveModeWindow) {
liveModeWindow->refreshPlaylist(playlist);
@ -472,27 +472,27 @@ class MasterPanelWindow : public GuiWindow
* Create the Scratchpad window.
*/
void
createScratchpadWindow(void) throw ();
createScratchpadWindow (void) throw ();
/**
* Update the Upload File window.
*/
void
updateUploadFileWindow(void) throw ();
updateUploadFileWindow (void) throw ();
/**
* Update the Scratchpad window.
*/
void
updateScratchpadWindow(Ptr<Playable>::Ref playable
updateScratchpadWindow (Ptr<Playable>::Ref playable
= Ptr<Playable>::Ref())
throw ();
throw ();
/**
* Update the Simple Playlist Management Window
*/
void
updatePlaylistWindow(void) throw ();
updatePlaylistWindow (void) throw ();
/**
* Update the Scheduler Window, optionally to display a new time.
@ -500,21 +500,21 @@ class MasterPanelWindow : public GuiWindow
* @param time the time to display in the scheduler window.
*/
void
updateSchedulerWindow(Ptr<boost::posix_time::ptime>::Ref time =
Ptr<boost::posix_time::ptime>::Ref())
throw ();
updateSchedulerWindow (Ptr<boost::posix_time::ptime>::Ref time
= Ptr<boost::posix_time::ptime>::Ref())
throw ();
/**
* Update the Search Window.
*/
void
updateSearchWindow(void) throw ();
updateSearchWindow (void) throw ();
/**
* Update the Options Window
*/
void
updateOptionsWindow(void) throw ();
updateOptionsWindow (void) throw ();
/**
* Update the User info.
@ -522,9 +522,9 @@ class MasterPanelWindow : public GuiWindow
* @param loginName the login name (only when userIsLoggedIn).
*/
void
updateUserInfo(Ptr<const Glib::ustring>::Ref loginName
updateUserInfo (Ptr<const Glib::ustring>::Ref loginName
= Ptr<const Glib::ustring>::Ref())
throw ();
throw ();
/**
* Get the next item from the top of the Live Mode window.
@ -534,7 +534,7 @@ class MasterPanelWindow : public GuiWindow
* if there is no Live Mode window, or it is empty.
*/
Ptr<Playable>::Ref
getNextItemToPlay() throw ();
getNextItemToPlay (void) throw ();
/**
* Set the "now playing" display.
@ -542,7 +542,7 @@ class MasterPanelWindow : public GuiWindow
* @param playable the Playable whose data is to be displayed.
*/
void
setNowPlaying(Ptr<Playable>::Ref playable) throw ()
setNowPlaying (Ptr<Playable>::Ref playable) throw ()
{
nowPlayingWidget->setPlayable(playable);
gLiveSupport->updateRds();
@ -554,7 +554,7 @@ class MasterPanelWindow : public GuiWindow
* @return the currently playing item; 0 if nothing is playing.
*/
Ptr<Playable>::Ref
getCurrentInnerPlayable(void) throw ()
getCurrentInnerPlayable (void) throw ()
{
return nowPlayingWidget->getCurrentInnerPlayable();
}
@ -566,7 +566,7 @@ class MasterPanelWindow : public GuiWindow
* @param playable the audio clip or playlist to be uploaded.
*/
void
uploadToHub(Ptr<Playable>::Ref playable) throw ();
uploadToHub (Ptr<Playable>::Ref playable) throw ();
/**
* Show or hide the Scheduler button.
@ -574,7 +574,7 @@ class MasterPanelWindow : public GuiWindow
* @param status true means show the button, false means hide.
*/
void
setSchedulerAvailable(bool status) throw ();
setSchedulerAvailable (bool status) throw ();
/**
* Update the cue player displays to show a stopped state.
@ -582,7 +582,7 @@ class MasterPanelWindow : public GuiWindow
* one in the Scratchpad, and one in the Live Mode window.
*/
void
showCuePlayerStopped(void) throw ();
showCuePlayerStopped (void) throw ();
};
/* ================================================= external data structures */

View File

@ -77,7 +77,7 @@ const Glib::ustring pauseStockImageName = "gtk-media-pause";
/*------------------------------------------------------------------------------
* Constructor.
*----------------------------------------------------------------------------*/
NowPlaying :: NowPlaying(GuiObject * parent)
NowPlaying :: NowPlaying (GuiObject * parent)
throw ()
: GuiComponent(parent)
{
@ -95,12 +95,19 @@ NowPlaying :: NowPlaying(GuiObject * parent)
glade->get_widget("titleLabel1", titleLabel);
glade->get_widget("creatorLabel1", creatorLabel);
glade->get_widget("elapsedTimeLabel1", elapsedTimeLabel);
glade->get_widget("remainsTimeBox1", remainsTimeBox);
glade->get_widget("remainsTimeEventBox1", remainsTimeBox);
glade->get_widget("remainsTimeLabel1", remainsTimeLabel);
glade->get_widget("playlistLabel1", playlistLabel);
setStyle(titleLabel, 14);
setStyle(creatorLabel, 8);
setStyle(elapsedTimeLabel, 16);
setStyle(remainsTimeLabel, 16);
setStyle(playlistLabel, 8);
glade->get_widget("elapsedTimeText1", elapsedTimeText);
glade->get_widget("remainsTimeText1", remainsTimeText);
setStyle(elapsedTimeText, 7);
setStyle(remainsTimeText, 7);
elapsedTimeText->set_text(*getResourceUstring("elapsedTimeLabel"));
remainsTimeText->set_text(*getResourceUstring("remainingTimeLabel"));
@ -109,11 +116,35 @@ NowPlaying :: NowPlaying(GuiObject * parent)
}
/*------------------------------------------------------------------------------
* Set the font and size of a label.
*----------------------------------------------------------------------------*/
void
NowPlaying :: setStyle (Gtk::Label * label,
int fontSize) throw ()
{
Pango::FontDescription fontDescription;
fontDescription.set_family("Bitstream Vera Sans");
fontDescription.set_weight(Pango::WEIGHT_BOLD);
fontDescription.set_size(fontSize * Pango::SCALE);
Pango::Attribute fontDescriptionAttribute =
Pango::Attribute::create_attr_font_desc(
fontDescription);
fontDescriptionAttribute.set_start_index(0);
fontDescriptionAttribute.set_end_index(255);
Pango::AttrList attributeList;
attributeList.insert(fontDescriptionAttribute);
label->set_attributes(attributeList);
}
/*------------------------------------------------------------------------------
* Set the title etc. of the playable shown in the widget.
*----------------------------------------------------------------------------*/
void
NowPlaying :: setPlayable(Ptr<Playable>::Ref playable) throw ()
NowPlaying :: setPlayable (Ptr<Playable>::Ref playable) throw ()
{
playableMutex.lock();
// BEGIN synchronized block
@ -158,7 +189,7 @@ NowPlaying :: setPlayable(Ptr<Playable>::Ref playable) throw ()
* Event handler for the Play button being clicked.
*----------------------------------------------------------------------------*/
void
NowPlaying :: onPlayButtonClicked(void) throw ()
NowPlaying :: onPlayButtonClicked (void) throw ()
{
if (isActive) {
if (isPaused) {
@ -178,7 +209,7 @@ NowPlaying :: onPlayButtonClicked(void) throw ()
* Event handler for the Stop button being clicked.
*----------------------------------------------------------------------------*/
void
NowPlaying :: onStopButtonClicked(void) throw ()
NowPlaying :: onStopButtonClicked (void) throw ()
{
if (isActive) {
gLiveSupport->stopOutputAudio(); // triggers a call to GLiveSupport::
@ -190,7 +221,7 @@ NowPlaying :: onStopButtonClicked(void) throw ()
* Update the timer displays. This is called every second by the master panel.
*----------------------------------------------------------------------------*/
void
NowPlaying :: onUpdateTime(void) throw ()
NowPlaying :: onUpdateTime (void) throw ()
{
if (!isActive) {
return;
@ -304,7 +335,7 @@ NowPlaying :: onUpdateTime(void) throw ()
* Set the background color of the "remains time" label.
*----------------------------------------------------------------------------*/
void
NowPlaying :: setRemainsTimeColor(RemainsTimeStateType state) throw ()
NowPlaying :: setRemainsTimeColor (RemainsTimeStateType state) throw ()
{
bool isBlinkOn = (remainsTimeCounter < blinkingConstant);
@ -336,7 +367,7 @@ NowPlaying :: setRemainsTimeColor(RemainsTimeStateType state) throw ()
* Reset all remains-time-blinking related variables.
*----------------------------------------------------------------------------*/
void
NowPlaying :: resetRemainsTimeState(void) throw ()
NowPlaying :: resetRemainsTimeState (void) throw ()
{
remainsTimeState = TIME_GREEN;
remainsTimeCounter = 0;
@ -348,7 +379,7 @@ NowPlaying :: resetRemainsTimeState(void) throw ()
* Change the language of the widget.
*----------------------------------------------------------------------------*/
void
NowPlaying :: changeLanguage(void)
NowPlaying :: changeLanguage (void)
throw ()
{
setBundle(parent->getBundle());

View File

@ -167,19 +167,19 @@ class NowPlaying : public GuiComponent
/**
* Default constructor.
*/
NowPlaying(void) throw ();
NowPlaying (void) throw ();
/**
* Event handler for the Play button being clicked.
*/
void
onPlayButtonClicked(void) throw ();
onPlayButtonClicked (void) throw ();
/**
* Event handler for the Stop button being clicked.
*/
void
onStopButtonClicked(void) throw ();
onStopButtonClicked (void) throw ();
/**
* Set the color of the 'remains time' label.
@ -191,7 +191,7 @@ class NowPlaying : public GuiComponent
* @param state the new state of the label.
*/
void
setRemainsTimeColor(RemainsTimeStateType state)
setRemainsTimeColor (RemainsTimeStateType state)
throw ();
/**
@ -201,7 +201,18 @@ class NowPlaying : public GuiComponent
* and the background color of the label to blue.
*/
void inline
resetRemainsTimeState(void) throw ();
resetRemainsTimeState (void) throw ();
/**
* Sets the font and size of the label.
*
* @param label the label the style of which we want to set.
* @param fontSize the font size for the label.
*/
void
setStyle (Gtk::Label * label,
int fontSize)
throw ();
public:
@ -211,14 +222,14 @@ class NowPlaying : public GuiComponent
*
* @param parent the GuiObject which contains this one.
*/
NowPlaying(GuiObject * parent)
NowPlaying (GuiObject * parent)
throw ();
/**
* A virtual destructor.
*/
virtual
~NowPlaying(void) throw ()
~NowPlaying (void) throw ()
{
}
@ -228,14 +239,14 @@ class NowPlaying : public GuiComponent
* @param playable the playable to be displayed
*/
void
setPlayable(Ptr<Playable>::Ref playable) throw ();
setPlayable (Ptr<Playable>::Ref playable) throw ();
/**
* Function that updates the elapsed and remaining time displays.
* This is called by the MasterPanelWindow every second.
*/
void
onUpdateTime(void) throw ();
onUpdateTime (void) throw ();
/**
* Public interface for restarting the audio.
@ -243,7 +254,7 @@ class NowPlaying : public GuiComponent
* This is used by MasterPanelWindow::onKeyPressed().
*/
void
onPlayAudio(void) throw ()
onPlayAudio (void) throw ()
{
onPlayButtonClicked();
}
@ -254,7 +265,7 @@ class NowPlaying : public GuiComponent
* This is used by MasterPanelWindow::onKeyPressed().
*/
void
onStopAudio(void) throw ()
onStopAudio (void) throw ()
{
onStopButtonClicked();
}
@ -269,7 +280,7 @@ class NowPlaying : public GuiComponent
* @return the currently playing item; 0 if nothing is playing.
*/
Ptr<Playable>::Ref
getCurrentInnerPlayable(void) throw ()
getCurrentInnerPlayable (void) throw ()
{
return currentInnerPlayable;
}
@ -281,7 +292,7 @@ class NowPlaying : public GuiComponent
* NowPlaying then updates its own bundle to match the parent's.
*/
void
changeLanguage() throw ();
changeLanguage (void) throw ();
};

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
<!--Generated with glade3 3.2.0 on Tue Jul 24 18:14:45 2007 by fgerlits@fgerlits-laptop-->
<!--Generated with glade3 3.2.0 on Tue Aug 14 14:08:34 2007 by fgerlits@desktop-->
<glade-interface>
<widget class="GtkWindow" id="mainWindow1">
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
@ -93,36 +93,47 @@
<widget class="GtkVBox" id="nowPlayingWidget.1">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="border_width">8</property>
<property name="spacing">3</property>
<child>
<widget class="GtkLabel" id="titleLabel1">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="xalign">0</property>
<property name="ypad">3</property>
<property name="label" translatable="yes">title</property>
<property name="ellipsize">PANGO_ELLIPSIZE_END</property>
<property name="single_line_mode">True</property>
</widget>
</child>
<child>
<widget class="GtkLabel" id="creatorLabel1">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">creator</property>
<property name="ellipsize">PANGO_ELLIPSIZE_END</property>
<property name="single_line_mode">True</property>
</widget>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<widget class="GtkHBox" id="nowPlayingWidget.1.1">
<widget class="GtkHBox" id="nowPlayingTimeBox1">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="spacing">10</property>
<child>
<widget class="GtkVBox" id="nowPlayingWidget.1.1.1">
<widget class="GtkVBox" id="elapsedTimeBox1">
<property name="width_request">200</property>
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<child>
<widget class="GtkLabel" id="elapsedTimeText1">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">elapsed:</property>
</widget>
</child>
@ -130,6 +141,7 @@
<widget class="GtkLabel" id="elapsedTimeLabel1">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">elapsed time</property>
</widget>
<packing>
@ -137,35 +149,53 @@
</packing>
</child>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkVBox" id="nowPlayingWidget.1.1.2">
<widget class="GtkVBox" id="remainsTimeBox1">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<child>
<widget class="GtkLabel" id="remainsTimeText1">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="label" translatable="yes">remains:</property>
</widget>
</child>
<child>
<widget class="GtkHBox" id="nowPlayingWidget.1.1.2.1">
<widget class="GtkHBox" id="remainsTimeTextBox1">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<child>
<widget class="GtkEventBox" id="remainsTimeBox1">
<widget class="GtkLabel" id="remainsTimeText1">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">remains:</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="padding">5</property>
</packing>
</child>
</widget>
</child>
<child>
<widget class="GtkHBox" id="remainsTimeValueBox1">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<child>
<widget class="GtkEventBox" id="remainsTimeEventBox1">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<child>
<widget class="GtkLabel" id="remainsTimeLabel1">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">remaining time</property>
</widget>
</child>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="padding">5</property>
</packing>
@ -177,6 +207,8 @@
</child>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
@ -189,7 +221,10 @@
<widget class="GtkLabel" id="playlistLabel1">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">playlist</property>
<property name="ellipsize">PANGO_ELLIPSIZE_MIDDLE</property>
<property name="single_line_mode">True</property>
</widget>
<packing>
<property name="position">3</property>