added cue player buttons to Live Mode window
This commit is contained in:
parent
17e320da97
commit
d6f48b7f29
6 changed files with 62 additions and 68 deletions
|
@ -22,7 +22,7 @@
|
|||
|
||||
|
||||
Author : $Author: fgerlits $
|
||||
Version : $Revision: 1.1 $
|
||||
Version : $Revision: 1.2 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/CuePlayer.cxx,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -82,8 +82,8 @@ CuePlayer :: CuePlayer(Ptr<GLiveSupport>::Ref gLiveSupport,
|
|||
stopButton->signal_clicked().connect(sigc::mem_fun(*this,
|
||||
&CuePlayer::onStopButtonClicked ));
|
||||
|
||||
pack_end(*stopButton, Gtk::PACK_SHRINK, 5);
|
||||
pack_end(*playButton, Gtk::PACK_SHRINK);
|
||||
pack_end(*stopButton, Gtk::PACK_SHRINK, 3);
|
||||
pack_end(*playButton, Gtk::PACK_SHRINK, 3);
|
||||
|
||||
audioState = waitingState;
|
||||
|
||||
|
@ -131,7 +131,7 @@ CuePlayer :: onPlayItem(void) throw ()
|
|||
|
||||
audioState = playingState;
|
||||
remove(*playButton);
|
||||
pack_end(*pauseButton, Gtk::PACK_SHRINK);
|
||||
pack_end(*pauseButton, Gtk::PACK_SHRINK, 3);
|
||||
pauseButton->show();
|
||||
}
|
||||
}
|
||||
|
@ -153,7 +153,7 @@ CuePlayer :: onPlayButtonClicked(void) throw ()
|
|||
gLiveSupport->pauseCueAudio(); // ie, restart
|
||||
audioState = playingState;
|
||||
remove(*playButton);
|
||||
pack_end(*pauseButton, Gtk::PACK_SHRINK);
|
||||
pack_end(*pauseButton, Gtk::PACK_SHRINK, 3);
|
||||
pauseButton->show();
|
||||
} catch (std::logic_error &e) {
|
||||
std::cerr << "GLiveSupport::pauseCueAudio() error:" << std::endl
|
||||
|
@ -179,7 +179,7 @@ CuePlayer :: onPauseButtonClicked(void) throw ()
|
|||
gLiveSupport->pauseCueAudio();
|
||||
audioState = pausedState;
|
||||
remove(*pauseButton);
|
||||
pack_end(*playButton, Gtk::PACK_SHRINK);
|
||||
pack_end(*playButton, Gtk::PACK_SHRINK, 3);
|
||||
playButton->show();
|
||||
} catch (std::logic_error &e) {
|
||||
std::cerr << "GLiveSupport::pauseCueAudio() error:" << std::endl
|
||||
|
@ -225,7 +225,7 @@ CuePlayer :: onStop(void) throw ()
|
|||
return;
|
||||
}
|
||||
audioState = waitingState;
|
||||
pack_end(*playButton, Gtk::PACK_SHRINK);
|
||||
pack_end(*playButton, Gtk::PACK_SHRINK, 3);
|
||||
playButton->show();
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
|
||||
Author : $Author: fgerlits $
|
||||
Version : $Revision: 1.10 $
|
||||
Version : $Revision: 1.11 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/LiveModeWindow.cxx,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -71,7 +71,7 @@ LiveModeWindow :: LiveModeWindow (Ptr<GLiveSupport>::Ref gLiveSupport,
|
|||
LocalizedObject(bundle),
|
||||
gLiveSupport(gLiveSupport)
|
||||
{
|
||||
Ptr<WidgetFactory>::Ref widgetFactory = WidgetFactory::getInstance();
|
||||
Ptr<WidgetFactory>::Ref wf = WidgetFactory::getInstance();
|
||||
|
||||
// Create the tree model:
|
||||
treeModel = Gtk::ListStore::create(modelColumns);
|
||||
|
@ -81,7 +81,7 @@ LiveModeWindow :: LiveModeWindow (Ptr<GLiveSupport>::Ref gLiveSupport,
|
|||
&LiveModeWindow::onRowDeleted));
|
||||
|
||||
// ... and the tree view:
|
||||
treeView = Gtk::manage(widgetFactory->createTreeView(treeModel));
|
||||
treeView = Gtk::manage(wf->createTreeView(treeModel));
|
||||
treeView->set_headers_visible(false);
|
||||
|
||||
// Add the TreeView's view columns:
|
||||
|
@ -104,7 +104,33 @@ LiveModeWindow :: LiveModeWindow (Ptr<GLiveSupport>::Ref gLiveSupport,
|
|||
// Only show the scrollbars when they are necessary:
|
||||
scrolledWindow.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
|
||||
|
||||
vBox.pack_start(scrolledWindow);
|
||||
// Create the play etc buttons:
|
||||
Gtk::HBox * buttonBox = Gtk::manage(new Gtk::HBox);
|
||||
ImageButton * outputPlayButton = Gtk::manage(wf->createButton(
|
||||
WidgetFactory::hugePlayButton ));
|
||||
Gtk::VBox * cueAudioBox = Gtk::manage(new Gtk::VBox);
|
||||
Gtk::HBox * cueAudioLabelBox = Gtk::manage(new Gtk::HBox);
|
||||
Gtk::Label * cueAudioLabel;
|
||||
try {
|
||||
cueAudioLabel = Gtk::manage(new Gtk::Label(
|
||||
*getResourceUstring("cuePlayerLabel") ));
|
||||
} catch (std::invalid_argument &e) {
|
||||
std::cerr << e.what() << std::endl;
|
||||
std::exit(1);
|
||||
}
|
||||
Gtk::HBox * cueAudioButtonsBox = Gtk::manage(new Gtk::HBox);
|
||||
CuePlayer * cueAudioButtons = Gtk::manage(new CuePlayer(
|
||||
gLiveSupport, treeView, modelColumns ));
|
||||
buttonBox->pack_start(*outputPlayButton, Gtk::PACK_EXPAND_PADDING, 10);
|
||||
buttonBox->pack_start(*cueAudioBox, Gtk::PACK_EXPAND_PADDING, 10);
|
||||
cueAudioBox->pack_start(*cueAudioLabelBox, Gtk::PACK_SHRINK, 6);
|
||||
cueAudioLabelBox->pack_start(*cueAudioLabel, Gtk::PACK_EXPAND_PADDING, 1);
|
||||
cueAudioBox->pack_start(*cueAudioButtonsBox, Gtk::PACK_SHRINK, 0);
|
||||
cueAudioButtonsBox->pack_start(*cueAudioButtons,
|
||||
Gtk::PACK_EXPAND_PADDING, 1);
|
||||
|
||||
vBox.pack_start(*buttonBox, Gtk::PACK_SHRINK, 5);
|
||||
vBox.pack_start(scrolledWindow, Gtk::PACK_EXPAND_WIDGET, 5);
|
||||
add(vBox);
|
||||
|
||||
// create the right-click entry context menu for audio clips
|
||||
|
@ -114,8 +140,8 @@ LiveModeWindow :: LiveModeWindow (Ptr<GLiveSupport>::Ref gLiveSupport,
|
|||
try {
|
||||
contextMenuList.push_back(Gtk::Menu_Helpers::MenuElem(
|
||||
*getResourceUstring("cueMenuItem"),
|
||||
sigc::mem_fun(*this,
|
||||
&LiveModeWindow::onCueMenuOption)));
|
||||
sigc::mem_fun(*cueAudioButtons,
|
||||
&CuePlayer::onPlayItem)));
|
||||
contextMenuList.push_back(Gtk::Menu_Helpers::MenuElem(
|
||||
*getResourceUstring("upMenuItem"),
|
||||
sigc::mem_fun(*this,
|
||||
|
@ -206,25 +232,18 @@ Ptr<Playable>::Ref
|
|||
LiveModeWindow :: popTop(void) throw ()
|
||||
{
|
||||
Ptr<Playable>::Ref playable;
|
||||
/* disabled for testing
|
||||
Gtk::TreeModel::iterator iter = treeModel->children().begin();
|
||||
|
||||
if (iter) {
|
||||
playable = (*iter)[modelColumns.playableColumn];
|
||||
treeModel->erase(iter);
|
||||
}
|
||||
|
||||
*/
|
||||
return playable;
|
||||
}
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* Destructor.
|
||||
*----------------------------------------------------------------------------*/
|
||||
LiveModeWindow :: ~LiveModeWindow (void) throw ()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* Event handler for an entry being clicked in the list
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
@ -259,32 +278,6 @@ LiveModeWindow :: onEntryClicked (GdkEventButton * event) throw ()
|
|||
}
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* Signal handler for the cue menu option selected.
|
||||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
LiveModeWindow :: onCueMenuOption(void) throw ()
|
||||
{
|
||||
Glib::RefPtr<Gtk::TreeView::Selection> refSelection =
|
||||
treeView->get_selection();
|
||||
Gtk::TreeModel::iterator iter = refSelection->get_selected();
|
||||
|
||||
if (iter) {
|
||||
Ptr<Playable>::Ref playable = (*iter)[modelColumns.playableColumn];
|
||||
|
||||
try {
|
||||
gLiveSupport->playOutputAudio(playable);
|
||||
} catch (XmlRpcException &e) {
|
||||
std::cerr << "GLiveSupport::playOutputAudio() error:" << std::endl
|
||||
<< e.what() << std::endl;
|
||||
} catch (std::exception &e) {
|
||||
std::cerr << "GLiveSupport::playOutputAudio() error:" << std::endl
|
||||
<< e.what() << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* Event handler for the Up menu item selected from the entry conext menu
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
|
||||
Author : $Author: fgerlits $
|
||||
Version : $Revision: 1.9 $
|
||||
Version : $Revision: 1.10 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/LiveModeWindow.h,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -52,6 +52,7 @@
|
|||
#include "LiveSupport/Widgets/Button.h"
|
||||
#include "LiveSupport/Widgets/ZebraTreeView.h"
|
||||
#include "LiveSupport/Widgets/PlayableTreeModelColumnRecord.h"
|
||||
#include "CuePlayer.h"
|
||||
#include "GLiveSupport.h"
|
||||
|
||||
namespace LiveSupport {
|
||||
|
@ -73,7 +74,7 @@ using namespace LiveSupport::Widgets;
|
|||
* playlists.
|
||||
*
|
||||
* @author $Author: fgerlits $
|
||||
* @version $Revision: 1.9 $
|
||||
* @version $Revision: 1.10 $
|
||||
*/
|
||||
class LiveModeWindow : public WhiteWindow, public LocalizedObject
|
||||
{
|
||||
|
@ -86,7 +87,7 @@ class LiveModeWindow : public WhiteWindow, public LocalizedObject
|
|||
* Lists one clip per row.
|
||||
*
|
||||
* @author $Author: fgerlits $
|
||||
* @version $Revision: 1.9 $
|
||||
* @version $Revision: 1.10 $
|
||||
*/
|
||||
class ModelColumns : public PlayableTreeModelColumnRecord
|
||||
{
|
||||
|
@ -163,12 +164,6 @@ class LiveModeWindow : public WhiteWindow, public LocalizedObject
|
|||
virtual void
|
||||
onEntryClicked(GdkEventButton * event) throw ();
|
||||
|
||||
/**
|
||||
* Signal handler for the cue menu option selected.
|
||||
*/
|
||||
virtual void
|
||||
onCueMenuOption(void) throw ();
|
||||
|
||||
/**
|
||||
* Signal handler for the "up" menu option selected from
|
||||
* the context menu.
|
||||
|
@ -229,7 +224,9 @@ class LiveModeWindow : public WhiteWindow, public LocalizedObject
|
|||
* Virtual destructor.
|
||||
*/
|
||||
virtual
|
||||
~LiveModeWindow(void) throw ();
|
||||
~LiveModeWindow(void) throw ()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a new item to the Live Mode Window.
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
|
||||
Author : $Author: fgerlits $
|
||||
Version : $Revision: 1.17 $
|
||||
Version : $Revision: 1.18 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/ScratchpadWindow.cxx,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -118,9 +118,9 @@ ScratchpadWindow :: ScratchpadWindow (Ptr<GLiveSupport>::Ref gLiveSupport,
|
|||
// Only show the scrollbars when they are necessary:
|
||||
scrolledWindow.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
|
||||
|
||||
vBox.pack_start(topButtonBox, Gtk::PACK_SHRINK);
|
||||
vBox.pack_start(scrolledWindow);
|
||||
vBox.pack_start(bottomButtonBox, Gtk::PACK_SHRINK);
|
||||
vBox.pack_start(topButtonBox, Gtk::PACK_SHRINK, 5);
|
||||
vBox.pack_start(scrolledWindow, Gtk::PACK_EXPAND_WIDGET, 5);
|
||||
vBox.pack_start(bottomButtonBox, Gtk::PACK_SHRINK, 5);
|
||||
|
||||
audioButtonBox = Gtk::manage(new CuePlayer(
|
||||
gLiveSupport, treeView, modelColumns ));
|
||||
|
|
|
@ -55,7 +55,7 @@ hu:table
|
|||
addToPlaylistMenuItem:string { "_Hozzáad Playlisthez" }
|
||||
schedulePlaylistMenuItem:string { "_Playlist időzítése" }
|
||||
deleteMenuItem:string { "_Töröl" }
|
||||
playMenuItem:string { "Le_játszâs" }
|
||||
playMenuItem:string { "_Belehallgatni" }
|
||||
addToLiveModeMenuItem:string { "Élő _adásba" }
|
||||
}
|
||||
|
||||
|
@ -180,10 +180,12 @@ hu:table
|
|||
{
|
||||
windowTitle:string { "LiveSupport Élő adás ablak" }
|
||||
|
||||
cueMenuItem:string { "Bele_hallgatni" }
|
||||
cueMenuItem:string { "_Belehallgatni" }
|
||||
upMenuItem:string { "_Fel" }
|
||||
downMenuItem:string { "_Le" }
|
||||
removeMenuItem:string { "_Eltávolít" }
|
||||
|
||||
cuePlayerLabel:string { "Belehallgatni" }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ root:table
|
|||
addToPlaylistMenuItem:string { "_Add To Playlist" }
|
||||
schedulePlaylistMenuItem:string { "_Schedule Playlist" }
|
||||
deleteMenuItem:string { "_Delete" }
|
||||
playMenuItem:string { "_Play" }
|
||||
playMenuItem:string { "_Preview" }
|
||||
addToLiveModeMenuItem:string { "Add To _Live Mode" }
|
||||
}
|
||||
|
||||
|
@ -182,10 +182,12 @@ root:table
|
|||
{
|
||||
windowTitle:string { "LiveSupport Live Mode Window" }
|
||||
|
||||
cueMenuItem:string { "_Cue" }
|
||||
cueMenuItem:string { "_Preview" }
|
||||
upMenuItem:string { "Move _Up" }
|
||||
downMenuItem:string { "Move D_own" }
|
||||
removeMenuItem:string { "_Remove" }
|
||||
|
||||
cuePlayerLabel:string { "Preview" }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue