From 3768ae6f6e23c894b9a2802f9cd9ae523c223388 Mon Sep 17 00:00:00 2001 From: fgerlits Date: Tue, 14 Aug 2007 12:09:24 +0000 Subject: [PATCH] Reformatted the Now Playing display to look more like it used to. --- .../gLiveSupport/src/MasterPanelWindow.cxx | 55 ++++++------ .../gLiveSupport/src/MasterPanelWindow.h | 86 +++++++++---------- .../products/gLiveSupport/src/NowPlaying.cxx | 49 +++++++++-- .../products/gLiveSupport/src/NowPlaying.h | 37 +++++--- .../var/glade/MasterPanelWindow.glade | 61 ++++++++++--- 5 files changed, 181 insertions(+), 107 deletions(-) diff --git a/campcaster/src/products/gLiveSupport/src/MasterPanelWindow.cxx b/campcaster/src/products/gLiveSupport/src/MasterPanelWindow.cxx index 9833a3e52..48efb067e 100644 --- a/campcaster/src/products/gLiveSupport/src/MasterPanelWindow.cxx +++ b/campcaster/src/products/gLiveSupport/src/MasterPanelWindow.cxx @@ -35,9 +35,6 @@ #include #include -#include -#include -#include #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::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 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::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::Ref playable) +MasterPanelWindow :: updateLiveModeWindow (Ptr::Ref playable) throw () { if (!liveModeWindow.get()) { @@ -359,7 +356,7 @@ MasterPanelWindow :: updateLiveModeWindow(Ptr::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::Ref playable) +MasterPanelWindow :: updateScratchpadWindow (Ptr::Ref playable) throw () { createScratchpadWindow(); @@ -406,7 +403,7 @@ MasterPanelWindow :: updateScratchpadWindow(Ptr::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::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::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 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::Ref playable) +MasterPanelWindow :: uploadToHub (Ptr::Ref playable) throw () { if (!searchWindow.get()) { @@ -687,7 +684,7 @@ MasterPanelWindow :: uploadToHub(Ptr::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::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::Ref loginName) +MasterPanelWindow :: updateUserInfo (Ptr::Ref loginName) throw () { if (userIsLoggedIn) { @@ -801,7 +798,7 @@ MasterPanelWindow :: updateUserInfo(Ptr::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")); diff --git a/campcaster/src/products/gLiveSupport/src/MasterPanelWindow.h b/campcaster/src/products/gLiveSupport/src/MasterPanelWindow.h index b71ba194b..74684fdfe 100644 --- a/campcaster/src/products/gLiveSupport/src/MasterPanelWindow.h +++ b/campcaster/src/products/gLiveSupport/src/MasterPanelWindow.h @@ -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::Ref playable + updateLiveModeWindow (Ptr::Ref playable = Ptr::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::Ref playlist) - throw () + refreshPlaylistInLiveMode (Ptr::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::Ref playable + updateScratchpadWindow (Ptr::Ref playable = Ptr::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::Ref time = - Ptr::Ref()) - throw (); + updateSchedulerWindow (Ptr::Ref time + = Ptr::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::Ref loginName + updateUserInfo (Ptr::Ref loginName = Ptr::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::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::Ref playable) throw () + setNowPlaying (Ptr::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::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::Ref playable) throw (); + uploadToHub (Ptr::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 */ diff --git a/campcaster/src/products/gLiveSupport/src/NowPlaying.cxx b/campcaster/src/products/gLiveSupport/src/NowPlaying.cxx index fbc87e1bd..7e2f05d55 100644 --- a/campcaster/src/products/gLiveSupport/src/NowPlaying.cxx +++ b/campcaster/src/products/gLiveSupport/src/NowPlaying.cxx @@ -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::Ref playable) throw () +NowPlaying :: setPlayable (Ptr::Ref playable) throw () { playableMutex.lock(); // BEGIN synchronized block @@ -158,7 +189,7 @@ NowPlaying :: setPlayable(Ptr::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()); diff --git a/campcaster/src/products/gLiveSupport/src/NowPlaying.h b/campcaster/src/products/gLiveSupport/src/NowPlaying.h index b4ffc0020..4bb1d3df8 100644 --- a/campcaster/src/products/gLiveSupport/src/NowPlaying.h +++ b/campcaster/src/products/gLiveSupport/src/NowPlaying.h @@ -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::Ref playable) throw (); + setPlayable (Ptr::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::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 (); }; diff --git a/campcaster/src/products/gLiveSupport/var/glade/MasterPanelWindow.glade b/campcaster/src/products/gLiveSupport/var/glade/MasterPanelWindow.glade index 356523699..288004008 100644 --- a/campcaster/src/products/gLiveSupport/var/glade/MasterPanelWindow.glade +++ b/campcaster/src/products/gLiveSupport/var/glade/MasterPanelWindow.glade @@ -1,6 +1,6 @@ - + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK @@ -93,36 +93,47 @@ True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 8 + 3 True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 + 3 title + PANGO_ELLIPSIZE_END + True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 creator + PANGO_ELLIPSIZE_END + True 1 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 10 - + + 200 True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 elapsed: @@ -130,6 +141,7 @@ True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 elapsed time @@ -137,35 +149,53 @@ + + False + False + - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - remains: - - - - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 + remains: + + + False + False + 5 + + + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 remaining time + False False 5 @@ -177,6 +207,8 @@ + False + False 1 @@ -189,7 +221,10 @@ True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 playlist + PANGO_ELLIPSIZE_MIDDLE + True 3