added first version of Live Mode window
This commit is contained in:
parent
df15345907
commit
1f0539a1d8
18 changed files with 602 additions and 33 deletions
|
@ -22,7 +22,7 @@
|
|||
|
||||
|
||||
Author : $Author: fgerlits $
|
||||
Version : $Revision: 1.16 $
|
||||
Version : $Revision: 1.17 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/widgets/include/LiveSupport/Widgets/WidgetFactory.h,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -89,7 +89,7 @@ class WhiteWindow;
|
|||
* </code></pre>
|
||||
*
|
||||
* @author $Author: fgerlits $
|
||||
* @version $Revision: 1.16 $
|
||||
* @version $Revision: 1.17 $
|
||||
*/
|
||||
class WidgetFactory :
|
||||
virtual public Configurable
|
||||
|
@ -114,7 +114,8 @@ class WidgetFactory :
|
|||
*/
|
||||
typedef enum { resizeImage,
|
||||
scratchpadWindowTitleImage,
|
||||
searchWindowTitleImage }
|
||||
searchWindowTitleImage,
|
||||
liveModeWindowTitleImage }
|
||||
ImageType;
|
||||
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
|
||||
Author : $Author: fgerlits $
|
||||
Version : $Revision: 1.8 $
|
||||
Version : $Revision: 1.9 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/widgets/include/LiveSupport/Widgets/ZebraTreeView.h,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -91,7 +91,7 @@ using namespace LiveSupport::Core;
|
|||
* 3) connected with a TreeModelColumn using set_renderer().
|
||||
*
|
||||
* @author $Author: fgerlits $
|
||||
* @version $Revision: 1.8 $
|
||||
* @version $Revision: 1.9 $
|
||||
*/
|
||||
class ZebraTreeView : public Gtk::TreeView
|
||||
{
|
||||
|
@ -133,11 +133,14 @@ class ZebraTreeView : public Gtk::TreeView
|
|||
*
|
||||
* @param title the title of the column
|
||||
* @param modelColumn the model column this view will display
|
||||
* @param minimumWidth the minimum width of the column, in pixels
|
||||
* (optional)
|
||||
* @return the number of columns after adding this one
|
||||
*/
|
||||
int
|
||||
appendColumn(const Glib::ustring& title,
|
||||
const Gtk::TreeModelColumn<Glib::ustring>& modelColumn)
|
||||
const Gtk::TreeModelColumn<Glib::ustring>& modelColumn,
|
||||
int minimumWidth = 0)
|
||||
throw ();
|
||||
};
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
|
||||
Author : $Author: fgerlits $
|
||||
Version : $Revision: 1.18 $
|
||||
Version : $Revision: 1.19 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/widgets/src/WidgetFactory.cxx,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -217,6 +217,12 @@ static const std::string scratchpadWindowTitleImageName
|
|||
static const std::string searchWindowTitleImageName
|
||||
= "titleImages/searchWindowTitle.png";
|
||||
|
||||
/**
|
||||
* The name of the image for the title of the live mode window.
|
||||
*/
|
||||
static const std::string liveModeWindowTitleImageName
|
||||
= "titleImages/liveModeWindowTitle.png";
|
||||
|
||||
|
||||
/* =============================================== local function prototypes */
|
||||
|
||||
|
@ -437,6 +443,10 @@ WidgetFactory :: createImage(ImageType imageName) throw ()
|
|||
rawImage = loadImage(searchWindowTitleImageName);
|
||||
break;
|
||||
|
||||
case liveModeWindowTitleImage:
|
||||
rawImage = loadImage(liveModeWindowTitleImageName);
|
||||
break;
|
||||
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
|
||||
Author : $Author: fgerlits $
|
||||
Version : $Revision: 1.8 $
|
||||
Version : $Revision: 1.9 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/widgets/src/ZebraTreeView.cxx,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -80,7 +80,8 @@ ZebraTreeView :: ~ZebraTreeView(void) throw ()
|
|||
int
|
||||
ZebraTreeView :: appendColumn(
|
||||
const Glib::ustring& title,
|
||||
const Gtk::TreeModelColumn<Glib::ustring>& modelColumn)
|
||||
const Gtk::TreeModelColumn<Glib::ustring>& modelColumn,
|
||||
int minimumWidth)
|
||||
throw ()
|
||||
{
|
||||
// a standard cell renderer; can be replaced with a ZebraCellRenderer
|
||||
|
@ -98,6 +99,11 @@ ZebraTreeView :: appendColumn(
|
|||
*renderer,
|
||||
sigc::mem_fun(*this, &ZebraTreeView::cellDataFunction) );
|
||||
|
||||
// set the minimum width of the column
|
||||
if (minimumWidth) {
|
||||
viewColumn->set_min_width(minimumWidth);
|
||||
}
|
||||
|
||||
return append_column(*viewColumn);
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
#
|
||||
#
|
||||
# Author : $Author: fgerlits $
|
||||
# Version : $Revision: 1.32 $
|
||||
# Version : $Revision: 1.33 $
|
||||
# Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/etc/Makefile.in,v $
|
||||
#
|
||||
# @configure_input@
|
||||
|
@ -192,7 +192,8 @@ G_LIVESUPPORT_OBJS = ${TMP_DIR}/GLiveSupport.o \
|
|||
${TMP_DIR}/SchedulePlaylistWindow.o \
|
||||
${TMP_DIR}/SearchWindow.o \
|
||||
${TMP_DIR}/BrowseEntry.o \
|
||||
${TMP_DIR}/BrowseItem.o
|
||||
${TMP_DIR}/BrowseItem.o \
|
||||
${TMP_DIR}/LiveModeWindow.o
|
||||
|
||||
G_LIVESUPPORT_RES = ${TMP_DIR}/${PACKAGE_NAME}_root.res \
|
||||
${TMP_DIR}/${PACKAGE_NAME}_en.res \
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
|
||||
Author : $Author: fgerlits $
|
||||
Version : $Revision: 1.31 $
|
||||
Version : $Revision: 1.32 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/GLiveSupport.cxx,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -532,6 +532,19 @@ GLiveSupport :: addToScratchPad(Ptr<Playable>::Ref playable)
|
|||
}
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* Add a file to the Live Mode, and update it.
|
||||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
LiveSupport :: GLiveSupport ::
|
||||
GLiveSupport :: addToLiveMode(Ptr<Playable>::Ref playable)
|
||||
throw ()
|
||||
{
|
||||
liveModeContents->push_back(playable);
|
||||
masterPanel->updateLiveModeWindow();
|
||||
}
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* Open a playlist for editing.
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
|
||||
Author : $Author: fgerlits $
|
||||
Version : $Revision: 1.27 $
|
||||
Version : $Revision: 1.28 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/GLiveSupport.h,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -100,7 +100,7 @@ class MasterPanelWindow;
|
|||
* respective documentation.
|
||||
*
|
||||
* @author $Author: fgerlits $
|
||||
* @version $Revision: 1.27 $
|
||||
* @version $Revision: 1.28 $
|
||||
* @see LocalizedObject#getBundle(const xmlpp::Element &)
|
||||
* @see AuthenticationClientFactory
|
||||
* @see StorageClientFactory
|
||||
|
@ -177,6 +177,11 @@ class GLiveSupport : public LocalizedConfigurable,
|
|||
*/
|
||||
Ptr<PlayableList>::Ref scratchpadContents;
|
||||
|
||||
/**
|
||||
* The contents of the Live Mode, stored as a list.
|
||||
*/
|
||||
Ptr<PlayableList>::Ref liveModeContents;
|
||||
|
||||
/**
|
||||
* The one and only playlist that may be edited at any one time.
|
||||
*/
|
||||
|
@ -224,6 +229,7 @@ class GLiveSupport : public LocalizedConfigurable,
|
|||
GLiveSupport(void) throw ()
|
||||
{
|
||||
scratchpadContents.reset(new PlayableList());
|
||||
liveModeContents. reset(new PlayableList());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -428,6 +434,25 @@ class GLiveSupport : public LocalizedConfigurable,
|
|||
return scratchpadContents;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a file to the Live Mode, and update it.
|
||||
*
|
||||
* @param playable the audio clip or playlist to be added
|
||||
*/
|
||||
void
|
||||
addToLiveMode(Ptr<Playable>::Ref playable) throw ();
|
||||
|
||||
/**
|
||||
* Return the Live Mode contents.
|
||||
*
|
||||
* @return the list holding the Live Mode contents.
|
||||
*/
|
||||
Ptr<PlayableList>::Ref
|
||||
getLiveModeContents(void) throw ()
|
||||
{
|
||||
return liveModeContents;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the currently edited playlist.
|
||||
*
|
||||
|
|
179
livesupport/products/gLiveSupport/src/LiveModeWindow.cxx
Normal file
179
livesupport/products/gLiveSupport/src/LiveModeWindow.cxx
Normal file
|
@ -0,0 +1,179 @@
|
|||
/*------------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2004 Media Development Loan Fund
|
||||
|
||||
This file is part of the LiveSupport project.
|
||||
http://livesupport.campware.org/
|
||||
To report bugs, send an e-mail to bugs@campware.org
|
||||
|
||||
LiveSupport is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
LiveSupport is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with LiveSupport; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
|
||||
Author : $Author: fgerlits $
|
||||
Version : $Revision: 1.1 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/LiveModeWindow.cxx,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
||||
/* ============================================================ include files */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "configure.h"
|
||||
#endif
|
||||
|
||||
#include <iostream>
|
||||
#include <stdexcept>
|
||||
|
||||
#include "LiveSupport/Widgets/WidgetFactory.h"
|
||||
#include "SchedulePlaylistWindow.h"
|
||||
#include "LiveModeWindow.h"
|
||||
|
||||
|
||||
using namespace Glib;
|
||||
|
||||
using namespace LiveSupport::Core;
|
||||
using namespace LiveSupport::Widgets;
|
||||
using namespace LiveSupport::GLiveSupport;
|
||||
|
||||
/* =================================================== local data structures */
|
||||
|
||||
|
||||
/* ================================================ local constants & macros */
|
||||
|
||||
|
||||
/* =============================================== local function prototypes */
|
||||
|
||||
|
||||
/* ============================================================= module code */
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* Constructor.
|
||||
*----------------------------------------------------------------------------*/
|
||||
LiveModeWindow :: LiveModeWindow (Ptr<GLiveSupport>::Ref gLiveSupport,
|
||||
Ptr<ResourceBundle>::Ref bundle)
|
||||
throw ()
|
||||
: WhiteWindow(WidgetFactory::liveModeWindowTitleImage,
|
||||
Colors::White,
|
||||
WidgetFactory::getInstance()->getWhiteWindowCorners()),
|
||||
LocalizedObject(bundle),
|
||||
gLiveSupport(gLiveSupport)
|
||||
{
|
||||
Ptr<WidgetFactory>::Ref widgetFactory = WidgetFactory::getInstance();
|
||||
|
||||
// Create the Tree model:
|
||||
treeModel = Gtk::ListStore::create(modelColumns);
|
||||
treeView = Gtk::manage(widgetFactory->createTreeView(treeModel));
|
||||
|
||||
// Add the TreeView's view columns:
|
||||
try {
|
||||
treeView->appendColumn(*getResourceUstring("titleColumnLabel"),
|
||||
modelColumns.titleColumn, 200);
|
||||
treeView->appendColumn(*getResourceUstring("creatorColumnLabel"),
|
||||
modelColumns.creatorColumn, 200);
|
||||
treeView->appendColumn(*getResourceUstring("lengthColumnLabel"),
|
||||
modelColumns.lengthColumn, 120);
|
||||
} catch (std::invalid_argument &e) {
|
||||
std::cerr << e.what() << std::endl;
|
||||
std::exit(1);
|
||||
}
|
||||
|
||||
treeView->columns_autosize();
|
||||
|
||||
/*
|
||||
// register the signal handler for treeview entries being clicked
|
||||
treeView->signal_button_press_event().connect_notify(sigc::mem_fun(*this,
|
||||
&LiveModeWindow::onEntryClicked));
|
||||
*/
|
||||
// Add the TreeView, inside a ScrolledWindow, with the button underneath:
|
||||
scrolledWindow.add(*treeView);
|
||||
|
||||
// Only show the scrollbars when they are necessary:
|
||||
scrolledWindow.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
|
||||
|
||||
vBox.pack_start(scrolledWindow);
|
||||
add(vBox);
|
||||
/*
|
||||
// create the right-click entry context menu for audio clips
|
||||
contextMenu = Gtk::manage(new Gtk::Menu());
|
||||
Gtk::Menu::MenuList& contextMenuList = contextMenu->items();
|
||||
// register the signal handlers for the popup menu
|
||||
try {
|
||||
contextMenu.push_back(Gtk::Menu_Helpers::MenuElem(
|
||||
*getResourceUstring("addToPlaylistMenuItem"),
|
||||
sigc::mem_fun(*this,
|
||||
&LiveModeWindow::onAddToPlaylist)));
|
||||
} catch (std::invalid_argument &e) {
|
||||
std::cerr << e.what() << std::endl;
|
||||
std::exit(1);
|
||||
}
|
||||
|
||||
contextMenu->accelerate(*this);
|
||||
*/
|
||||
// show
|
||||
set_name("liveModeWindow");
|
||||
set_default_size(530, 300);
|
||||
set_modal(false);
|
||||
property_window_position().set_value(Gtk::WIN_POS_NONE);
|
||||
set_resizable(true);
|
||||
|
||||
showContents();
|
||||
show_all_children();
|
||||
}
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* Show all audio clips
|
||||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
LiveModeWindow :: showContents(void) throw ()
|
||||
{
|
||||
Ptr<GLiveSupport::PlayableList>::Ref liveModeContents;
|
||||
GLiveSupport::PlayableList::iterator it;
|
||||
GLiveSupport::PlayableList::iterator end;
|
||||
Ptr<Playable>::Ref playable;
|
||||
Gtk::TreeModel::Row row;
|
||||
|
||||
liveModeContents = gLiveSupport->getLiveModeContents();
|
||||
it = liveModeContents->begin();
|
||||
end = liveModeContents->end();
|
||||
treeModel->clear();
|
||||
int rowNumber = 0;
|
||||
|
||||
while (it != end) {
|
||||
playable = *it;
|
||||
row = *(treeModel->append());
|
||||
|
||||
row[modelColumns.playableColumn] = playable;
|
||||
row[modelColumns.titleColumn] = *playable->getTitle();
|
||||
Ptr<Glib::ustring>::Ref
|
||||
creator = playable->getMetadata("dc:creator");
|
||||
row[modelColumns.creatorColumn] = creator ? *creator : "";
|
||||
row[modelColumns.lengthColumn] = to_simple_string(
|
||||
*playable->getPlaylength() );
|
||||
row[modelColumns.rowNumberColumn] = rowNumber;
|
||||
|
||||
++it;
|
||||
++rowNumber;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* Destructor.
|
||||
*----------------------------------------------------------------------------*/
|
||||
LiveModeWindow :: ~LiveModeWindow (void) throw ()
|
||||
{
|
||||
}
|
||||
|
204
livesupport/products/gLiveSupport/src/LiveModeWindow.h
Normal file
204
livesupport/products/gLiveSupport/src/LiveModeWindow.h
Normal file
|
@ -0,0 +1,204 @@
|
|||
/*------------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2004 Media Development Loan Fund
|
||||
|
||||
This file is part of the LiveSupport project.
|
||||
http://livesupport.campware.org/
|
||||
To report bugs, send an e-mail to bugs@campware.org
|
||||
|
||||
LiveSupport is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
LiveSupport is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with LiveSupport; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
|
||||
Author : $Author: fgerlits $
|
||||
Version : $Revision: 1.1 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/LiveModeWindow.h,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
#ifndef LiveModeWindow_h
|
||||
#define LiveModeWindow_h
|
||||
|
||||
#ifndef __cplusplus
|
||||
#error This is a C++ include file
|
||||
#endif
|
||||
|
||||
|
||||
/* ============================================================ include files */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "configure.h"
|
||||
#endif
|
||||
|
||||
#include <string>
|
||||
|
||||
#include <unicode/resbund.h>
|
||||
|
||||
#include <gtkmm.h>
|
||||
|
||||
#include "LiveSupport/Core/Ptr.h"
|
||||
#include "LiveSupport/Core/LocalizedObject.h"
|
||||
#include "LiveSupport/Widgets/WhiteWindow.h"
|
||||
#include "LiveSupport/Widgets/Button.h"
|
||||
#include "LiveSupport/Widgets/ZebraTreeModelColumnRecord.h"
|
||||
#include "GLiveSupport.h"
|
||||
|
||||
namespace LiveSupport {
|
||||
namespace GLiveSupport {
|
||||
|
||||
using namespace LiveSupport::Core;
|
||||
using namespace LiveSupport::Widgets;
|
||||
|
||||
/* ================================================================ constants */
|
||||
|
||||
|
||||
/* =================================================================== macros */
|
||||
|
||||
|
||||
/* =============================================================== data types */
|
||||
|
||||
/**
|
||||
* The LiveMode window, showing recent and relevant audio clips and
|
||||
* playlists.
|
||||
*
|
||||
* @author $Author: fgerlits $
|
||||
* @version $Revision: 1.1 $
|
||||
*/
|
||||
class LiveModeWindow : public WhiteWindow, public LocalizedObject
|
||||
{
|
||||
private:
|
||||
|
||||
protected:
|
||||
|
||||
/**
|
||||
* The columns model needed by Gtk::TreeView.
|
||||
* Lists one clip per row.
|
||||
*
|
||||
* @author $Author: fgerlits $
|
||||
* @version $Revision: 1.1 $
|
||||
*/
|
||||
class ModelColumns : public ZebraTreeModelColumnRecord
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* The column for the playable object shown in the row.
|
||||
*/
|
||||
Gtk::TreeModelColumn<Ptr<Playable>::Ref> playableColumn;
|
||||
|
||||
/**
|
||||
* The column for the play button.
|
||||
*/
|
||||
Gtk::TreeModelColumn<Glib::RefPtr<Gdk::Pixbuf> >
|
||||
playButtonColumn;
|
||||
|
||||
/**
|
||||
* The column for the title of the audio clip or playlist.
|
||||
*/
|
||||
Gtk::TreeModelColumn<Glib::ustring> titleColumn;
|
||||
|
||||
/**
|
||||
* The column for the creator of the audio clip or playlist.
|
||||
*/
|
||||
Gtk::TreeModelColumn<Glib::ustring> creatorColumn;
|
||||
|
||||
/**
|
||||
* The column for the length of the audio clip or playlist.
|
||||
*/
|
||||
Gtk::TreeModelColumn<Glib::ustring> lengthColumn;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
ModelColumns(void) throw ()
|
||||
{
|
||||
add(playableColumn);
|
||||
add(playButtonColumn);
|
||||
add(titleColumn);
|
||||
add(creatorColumn);
|
||||
add(lengthColumn);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* The GLiveSupport object, holding the state of the application.
|
||||
*/
|
||||
Ptr<GLiveSupport>::Ref gLiveSupport;
|
||||
|
||||
/**
|
||||
* The column model.
|
||||
*/
|
||||
ModelColumns modelColumns;
|
||||
|
||||
/**
|
||||
* The main container in the window.
|
||||
*/
|
||||
Gtk::VBox vBox;
|
||||
|
||||
/**
|
||||
* A scrolled window, so that the list can be scrolled.
|
||||
*/
|
||||
Gtk::ScrolledWindow scrolledWindow;
|
||||
|
||||
/**
|
||||
* The tree view, now only showing rows.
|
||||
*/
|
||||
ZebraTreeView * treeView;
|
||||
|
||||
/**
|
||||
* The tree model, as a GTK reference.
|
||||
*/
|
||||
Glib::RefPtr<Gtk::ListStore> treeModel;
|
||||
|
||||
/**
|
||||
* The right-click context menu,
|
||||
* that comes up when right-clicking an entry in the entry list.
|
||||
*/
|
||||
// Gtk::Menu * contextMenu;
|
||||
|
||||
|
||||
public:
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param gLiveSupport the GLiveSupport, application object.
|
||||
* @param bundle the resource bundle holding the localized
|
||||
* resources for this window
|
||||
*/
|
||||
LiveModeWindow(Ptr<GLiveSupport>::Ref gLiveSupport,
|
||||
Ptr<ResourceBundle>::Ref bundle) throw ();
|
||||
|
||||
/**
|
||||
* Virtual destructor.
|
||||
*/
|
||||
virtual
|
||||
~LiveModeWindow(void) throw ();
|
||||
|
||||
/**
|
||||
* Update the window contents, with the contents of the LiveMode.
|
||||
*/
|
||||
void
|
||||
showContents(void) throw ();
|
||||
};
|
||||
|
||||
/* ================================================= external data structures */
|
||||
|
||||
|
||||
/* ====================================================== function prototypes */
|
||||
|
||||
|
||||
} // namespace GLiveSupport
|
||||
} // namespace LiveSupport
|
||||
|
||||
#endif // LiveModeWindow_h
|
||||
|
|
@ -21,8 +21,8 @@
|
|||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
|
||||
Author : $Author: maroy $
|
||||
Version : $Revision: 1.23 $
|
||||
Author : $Author: fgerlits $
|
||||
Version : $Revision: 1.24 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/MasterPanelWindow.cxx,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -62,10 +62,9 @@ using namespace LiveSupport::GLiveSupport;
|
|||
MasterPanelWindow :: MasterPanelWindow (Ptr<GLiveSupport>::Ref gLiveSupport,
|
||||
Ptr<ResourceBundle>::Ref bundle)
|
||||
throw ()
|
||||
: LocalizedObject(bundle)
|
||||
: LocalizedObject(bundle),
|
||||
gLiveSupport(gLiveSupport)
|
||||
{
|
||||
this->gLiveSupport = gLiveSupport;
|
||||
|
||||
Ptr<WidgetFactory>::Ref widgetFactory = WidgetFactory::getInstance();
|
||||
|
||||
// TODO: remove hard-coded station logo path reference
|
||||
|
@ -118,6 +117,7 @@ MasterPanelWindow :: MasterPanelWindow (Ptr<GLiveSupport>::Ref gLiveSupport,
|
|||
bottomBar->attach(*userInfoAlignment, 1, 2, 0, 1,
|
||||
Gtk::SHRINK|Gtk::FILL, Gtk::SHRINK|Gtk::FILL,
|
||||
5, 0);
|
||||
|
||||
// set up the main window, and show everything
|
||||
// all the localized widgets were set up in changeLanguage()
|
||||
set_border_width(10);
|
||||
|
@ -156,6 +156,7 @@ MasterPanelWindow :: MasterPanelWindow (Ptr<GLiveSupport>::Ref gLiveSupport,
|
|||
set_decorated(false);
|
||||
|
||||
// set the localized resources
|
||||
liveModeButton = 0;
|
||||
uploadFileButton = 0;
|
||||
scratchpadButton = 0;
|
||||
simplePlaylistMgmtButton = 0;
|
||||
|
@ -190,6 +191,9 @@ MasterPanelWindow :: changeLanguage(Ptr<ResourceBundle>::Ref bundle)
|
|||
{
|
||||
setBundle(bundle);
|
||||
|
||||
if (liveModeButton) {
|
||||
buttonBar->remove(*liveModeButton);
|
||||
}
|
||||
if (uploadFileButton) {
|
||||
buttonBar->remove(*uploadFileButton);
|
||||
}
|
||||
|
@ -211,6 +215,8 @@ MasterPanelWindow :: changeLanguage(Ptr<ResourceBundle>::Ref bundle)
|
|||
|
||||
Ptr<WidgetFactory>::Ref wf = WidgetFactory::getInstance();
|
||||
|
||||
liveModeButton = Gtk::manage(wf->createButton(
|
||||
*getResourceUstring("liveModeButtonLabel")));
|
||||
uploadFileButton = Gtk::manage(wf->createButton(
|
||||
*getResourceUstring("uploadFileButtonLabel")));
|
||||
scratchpadButton = Gtk::manage(wf->createButton(
|
||||
|
@ -229,23 +235,28 @@ MasterPanelWindow :: changeLanguage(Ptr<ResourceBundle>::Ref bundle)
|
|||
userInfoWidget->changeLanguage(bundle);
|
||||
|
||||
// re-attach the localized widgets to the layout
|
||||
buttonBar->attach(*uploadFileButton, 0, 1, 0, 1,
|
||||
buttonBar->attach(*liveModeButton, 0, 1, 0, 1,
|
||||
Gtk::SHRINK|Gtk::FILL, Gtk::SHRINK|Gtk::FILL,
|
||||
5, 0);
|
||||
buttonBar->attach(*scratchpadButton, 1, 2, 0, 1,
|
||||
buttonBar->attach(*uploadFileButton, 1, 2, 0, 1,
|
||||
Gtk::SHRINK|Gtk::FILL, Gtk::SHRINK|Gtk::FILL,
|
||||
5, 0);
|
||||
buttonBar->attach(*simplePlaylistMgmtButton, 2, 3, 0, 1,
|
||||
buttonBar->attach(*scratchpadButton, 2, 3, 0, 1,
|
||||
Gtk::SHRINK|Gtk::FILL, Gtk::SHRINK|Gtk::FILL,
|
||||
5, 0);
|
||||
buttonBar->attach(*schedulerButton, 3, 4, 0, 1,
|
||||
buttonBar->attach(*simplePlaylistMgmtButton, 3, 4, 0, 1,
|
||||
Gtk::SHRINK|Gtk::FILL, Gtk::SHRINK|Gtk::FILL,
|
||||
5, 0);
|
||||
buttonBar->attach(*searchButton, 4, 5, 0, 1,
|
||||
buttonBar->attach(*schedulerButton, 4, 5, 0, 1,
|
||||
Gtk::SHRINK|Gtk::FILL, Gtk::SHRINK|Gtk::FILL,
|
||||
5, 0);
|
||||
buttonBar->attach(*searchButton, 5, 6, 0, 1,
|
||||
Gtk::SHRINK|Gtk::FILL, Gtk::SHRINK|Gtk::FILL,
|
||||
5, 0);
|
||||
|
||||
// re-bind events to the buttons
|
||||
liveModeButton->signal_clicked().connect(sigc::mem_fun(*this,
|
||||
&MasterPanelWindow::onLiveModeButtonClicked));
|
||||
uploadFileButton->signal_clicked().connect(sigc::mem_fun(*this,
|
||||
&MasterPanelWindow::onUploadFileButtonClicked));
|
||||
scratchpadButton->signal_clicked().connect(sigc::mem_fun(*this,
|
||||
|
@ -316,6 +327,32 @@ MasterPanelWindow :: onUpdateTime(int dummy) throw ()
|
|||
}
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* The event when the Live Mode button has been clicked.
|
||||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
MasterPanelWindow :: onLiveModeButtonClicked(void) throw ()
|
||||
{
|
||||
if (!liveModeWindow.get()) {
|
||||
Ptr<ResourceBundle>::Ref bundle;
|
||||
try {
|
||||
bundle = getBundle("liveModeWindow");
|
||||
} catch (std::invalid_argument &e) {
|
||||
std::cerr << e.what() << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
liveModeWindow.reset(new LiveModeWindow(gLiveSupport, bundle));
|
||||
}
|
||||
|
||||
if (!liveModeWindow->is_visible()) {
|
||||
liveModeWindow->show();
|
||||
}
|
||||
|
||||
liveModeWindow->showContents();
|
||||
}
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* The event when the upload file button has been clicked.
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
@ -453,6 +490,10 @@ MasterPanelWindow :: showAnonymousUI(void) throw ()
|
|||
schedulerButton->hide();
|
||||
searchButton->hide();
|
||||
|
||||
if (liveModeWindow.get()) {
|
||||
liveModeWindow->hide();
|
||||
liveModeWindow.reset();
|
||||
}
|
||||
if (uploadFileWindow.get()) {
|
||||
uploadFileWindow->hide();
|
||||
uploadFileWindow.reset();
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
|
||||
Author : $Author: fgerlits $
|
||||
Version : $Revision: 1.13 $
|
||||
Version : $Revision: 1.14 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/MasterPanelWindow.h,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -50,6 +50,7 @@
|
|||
|
||||
#include "GLiveSupport.h"
|
||||
#include "MasterPanelUserInfoWidget.h"
|
||||
#include "LiveModeWindow.h"
|
||||
#include "UploadFileWindow.h"
|
||||
#include "ScratchpadWindow.h"
|
||||
#include "SimplePlaylistManagementWindow.h"
|
||||
|
@ -90,7 +91,7 @@ using namespace LiveSupport::Widgets;
|
|||
* </code></pre>
|
||||
*
|
||||
* @author $Author: fgerlits $
|
||||
* @version $Revision: 1.13 $
|
||||
* @version $Revision: 1.14 $
|
||||
*/
|
||||
class MasterPanelWindow : public Gtk::Window, public LocalizedObject
|
||||
{
|
||||
|
@ -181,6 +182,11 @@ class MasterPanelWindow : public Gtk::Window, public LocalizedObject
|
|||
*/
|
||||
Gtk::Table * buttonBar;
|
||||
|
||||
/**
|
||||
* The button to invoke the live mode window.
|
||||
*/
|
||||
Button * liveModeButton;
|
||||
|
||||
/**
|
||||
* The button to invoke the upload file window.
|
||||
*/
|
||||
|
@ -211,6 +217,11 @@ class MasterPanelWindow : public Gtk::Window, public LocalizedObject
|
|||
*/
|
||||
Ptr<GLiveSupport>::Ref gLiveSupport;
|
||||
|
||||
/**
|
||||
* The one and only Live Mode window.
|
||||
*/
|
||||
Ptr<LiveModeWindow>::Ref liveModeWindow;
|
||||
|
||||
/**
|
||||
* The one and only Upload File window.
|
||||
*/
|
||||
|
@ -270,6 +281,13 @@ class MasterPanelWindow : public Gtk::Window, public LocalizedObject
|
|||
virtual void
|
||||
onUploadFileButtonClicked(void) throw ();
|
||||
|
||||
/**
|
||||
* Function to catch the event of the live mode button being
|
||||
* pressed.
|
||||
*/
|
||||
virtual void
|
||||
onLiveModeButtonClicked(void) throw ();
|
||||
|
||||
/**
|
||||
* Function to catch the event of the Scratchpad button being
|
||||
* pressed.
|
||||
|
@ -342,6 +360,16 @@ class MasterPanelWindow : public Gtk::Window, public LocalizedObject
|
|||
void
|
||||
showLoggedInUI(void) throw ();
|
||||
|
||||
/**
|
||||
* Update the Live Mode window.
|
||||
*/
|
||||
void
|
||||
updateLiveModeWindow(void) throw ()
|
||||
{
|
||||
// this will create, open and display the window.
|
||||
onLiveModeButtonClicked();
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the Scratchpad window.
|
||||
*/
|
||||
|
|
|
@ -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/ScratchpadWindow.cxx,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -181,6 +181,10 @@ ScratchpadWindow :: ScratchpadWindow (Ptr<GLiveSupport>::Ref gLiveSupport,
|
|||
*getResourceUstring("playMenuItem"),
|
||||
sigc::mem_fun(*this,
|
||||
&ScratchpadWindow::onPlayItem)));
|
||||
audioClipMenuList.push_back(Gtk::Menu_Helpers::MenuElem(
|
||||
*getResourceUstring("addToLiveModeMenuItem"),
|
||||
sigc::mem_fun(*this,
|
||||
&ScratchpadWindow::onAddToLiveMode)));
|
||||
} catch (std::invalid_argument &e) {
|
||||
std::cerr << e.what() << std::endl;
|
||||
std::exit(1);
|
||||
|
@ -222,6 +226,10 @@ ScratchpadWindow :: ScratchpadWindow (Ptr<GLiveSupport>::Ref gLiveSupport,
|
|||
*getResourceUstring("playMenuItem"),
|
||||
sigc::mem_fun(*this,
|
||||
&ScratchpadWindow::onPlayItem)));
|
||||
playlistMenuList.push_back(Gtk::Menu_Helpers::MenuElem(
|
||||
*getResourceUstring("addToLiveModeMenuItem"),
|
||||
sigc::mem_fun(*this,
|
||||
&ScratchpadWindow::onAddToLiveMode)));
|
||||
} catch (std::invalid_argument &e) {
|
||||
std::cerr << e.what() << std::endl;
|
||||
std::exit(1);
|
||||
|
@ -626,6 +634,27 @@ ScratchpadWindow :: onPlayItem(void) throw ()
|
|||
}
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* Event handler for the Add To Live Mode menu item selected from the
|
||||
* entry conext menu
|
||||
*----------------------------------------------------------------------------*/
|
||||
void
|
||||
ScratchpadWindow :: onAddToLiveMode(void) throw ()
|
||||
{
|
||||
Glib::RefPtr<Gtk::TreeView::Selection> refSelection =
|
||||
treeView->get_selection();
|
||||
|
||||
if (refSelection) {
|
||||
Gtk::TreeModel::iterator iter = refSelection->get_selected();
|
||||
if (iter) {
|
||||
Ptr<Playable>::Ref playable = (*iter)[modelColumns.playableColumn];
|
||||
|
||||
gLiveSupport->addToLiveMode(playable);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* Event handler for the Play button getting clicked
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
|
||||
Author : $Author: fgerlits $
|
||||
Version : $Revision: 1.2 $
|
||||
Version : $Revision: 1.3 $
|
||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/ScratchpadWindow.h,v $
|
||||
|
||||
------------------------------------------------------------------------------*/
|
||||
|
@ -72,7 +72,7 @@ using namespace LiveSupport::Widgets;
|
|||
* playlists.
|
||||
*
|
||||
* @author $Author: fgerlits $
|
||||
* @version $Revision: 1.2 $
|
||||
* @version $Revision: 1.3 $
|
||||
*/
|
||||
class ScratchpadWindow : public WhiteWindow, public LocalizedObject
|
||||
{
|
||||
|
@ -85,7 +85,7 @@ class ScratchpadWindow : public WhiteWindow, public LocalizedObject
|
|||
* Lists one clip per row.
|
||||
*
|
||||
* @author $Author: fgerlits $
|
||||
* @version $Revision: 1.2 $
|
||||
* @version $Revision: 1.3 $
|
||||
*/
|
||||
class ModelColumns : public ZebraTreeModelColumnRecord
|
||||
{
|
||||
|
@ -280,6 +280,13 @@ class ScratchpadWindow : public WhiteWindow, public LocalizedObject
|
|||
virtual void
|
||||
onPlayItem(void) throw ();
|
||||
|
||||
/**
|
||||
* Signal handler for the "add to live mode" menu item selected from
|
||||
* the entry context menu.
|
||||
*/
|
||||
virtual void
|
||||
onAddToLiveMode(void) throw ();
|
||||
|
||||
/**
|
||||
* Delete an item from the storage and remove it from the Scratchpad.
|
||||
*
|
||||
|
|
|
@ -5,9 +5,10 @@ hu:table
|
|||
loggedInMsg:string { "Bejelentkezve {0} felhasználóként" }
|
||||
loginButtonLabel:string { "bejelentkezés" }
|
||||
logoutButtonLabel:string { "kijelentkezés" }
|
||||
uploadFileButtonLabel:string { "file feltöltés" }
|
||||
liveModeButtonLabel:string { "élő adás" }
|
||||
uploadFileButtonLabel:string { "filefeltöltés" }
|
||||
scratchpadButtonLabel:string { "praktikus csupor" }
|
||||
simplePlaylistMgmtButtonLabel:string { "egyszerű playlist kezelés" }
|
||||
simplePlaylistMgmtButtonLabel:string { "playlistkezelés" }
|
||||
schedulerButtonLabel:string { "időzítő" }
|
||||
searchButtonLabel:string { "keresés" }
|
||||
|
||||
|
@ -54,6 +55,7 @@ hu:table
|
|||
schedulePlaylistMenuItem:string { "_Playlist időzítése" }
|
||||
deleteMenuItem:string { "_Töröl" }
|
||||
playMenuItem:string { "Le_játszâs" }
|
||||
addToLiveModeMenuItem:string { "Élő _adásba" }
|
||||
}
|
||||
|
||||
playlistListWindow:table
|
||||
|
@ -171,5 +173,14 @@ hu:table
|
|||
|
||||
addToScratchpadMenuItem:string { "_Hasznos csuporba betenni" }
|
||||
}
|
||||
|
||||
liveModeWindow:table
|
||||
{
|
||||
windowTitle:string { "LiveSupport Élő adás ablak" }
|
||||
|
||||
titleColumnLabel:string { "Cím" }
|
||||
creatorColumnLabel:string { "Előadó" }
|
||||
lengthColumnLabel:string { "Hossz" }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -5,9 +5,10 @@ root:table
|
|||
loggedInMsg:string { "Logged in as {0}" }
|
||||
loginButtonLabel:string { "log in" }
|
||||
logoutButtonLabel:string { "log out" }
|
||||
liveModeButtonLabel:string { "live mode" }
|
||||
uploadFileButtonLabel:string { "upload file" }
|
||||
scratchpadButtonLabel:string { "scratchpad" }
|
||||
simplePlaylistMgmtButtonLabel:string { "simple playlist management" }
|
||||
simplePlaylistMgmtButtonLabel:string { "edit playlist" }
|
||||
schedulerButtonLabel:string { "scheduler" }
|
||||
searchButtonLabel:string { "search" }
|
||||
|
||||
|
@ -55,6 +56,7 @@ root:table
|
|||
schedulePlaylistMenuItem:string { "_Schedule Playlist" }
|
||||
deleteMenuItem:string { "_Delete" }
|
||||
playMenuItem:string { "_Play" }
|
||||
addToLiveModeMenuItem:string { "Add To _Live Mode" }
|
||||
}
|
||||
|
||||
playlistListWindow:table
|
||||
|
@ -173,5 +175,14 @@ root:table
|
|||
|
||||
addToScratchpadMenuItem:string { "_Add To Scratchpad" }
|
||||
}
|
||||
|
||||
liveModeWindow:table
|
||||
{
|
||||
windowTitle:string { "LiveSupport Live Mode Window" }
|
||||
|
||||
titleColumnLabel:string { "Title" }
|
||||
creatorColumnLabel:string { "Creator" }
|
||||
lengthColumnLabel:string { "Length" }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 3.6 KiB |
Binary file not shown.
After Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.8 KiB |
Loading…
Add table
Add a link
Reference in a new issue