2008-04-12 22:15:07 +02:00
|
|
|
/*
|
2008-04-19 21:47:53 +02:00
|
|
|
viewer-panel.cpp - Implementation of the viewer panel
|
2008-04-12 22:15:07 +02:00
|
|
|
|
|
|
|
|
Copyright (C) Lumiera.org
|
|
|
|
|
2008, Joel Holdsworth <joel@airwebreathe.org.uk>
|
|
|
|
|
|
|
|
|
|
This program 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.
|
|
|
|
|
|
|
|
|
|
This program 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 this program; if not, write to the Free Software
|
|
|
|
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
|
|
|
|
|
|
* *****************************************************/
|
|
|
|
|
|
2008-05-17 19:12:07 +02:00
|
|
|
#include "../gtk-lumiera.hpp"
|
2008-04-19 21:47:53 +02:00
|
|
|
#include "viewer-panel.hpp"
|
2008-04-12 22:15:07 +02:00
|
|
|
|
2009-01-17 18:37:06 +01:00
|
|
|
#include "../workspace/workspace-window.hpp"
|
|
|
|
|
#include "../controller/controller.hpp"
|
|
|
|
|
#include "../controller/playback-controller.hpp"
|
|
|
|
|
|
2009-02-04 05:23:43 +01:00
|
|
|
#include "gui/display-service.hpp"
|
|
|
|
|
|
2008-04-15 00:23:29 +02:00
|
|
|
using namespace Gtk;
|
2009-01-17 18:37:06 +01:00
|
|
|
using namespace gui::widgets;
|
|
|
|
|
using namespace gui::controller;
|
2008-04-14 23:51:59 +02:00
|
|
|
|
2008-04-12 22:15:07 +02:00
|
|
|
namespace gui {
|
|
|
|
|
namespace panels {
|
|
|
|
|
|
2009-04-13 17:11:50 +02:00
|
|
|
ViewerPanel::ViewerPanel(workspace::PanelManager &panel_manager,
|
|
|
|
|
GdlDockItem *dock_item) :
|
2009-04-13 17:50:42 +02:00
|
|
|
Panel(panel_manager, dock_item, get_title(), get_stock_id())
|
2008-10-20 19:50:37 +02:00
|
|
|
{
|
|
|
|
|
//----- Pack in the Widgets -----//
|
|
|
|
|
pack_start(display, PACK_EXPAND_WIDGET);
|
2009-01-17 18:37:06 +01:00
|
|
|
|
|
|
|
|
PlaybackController &playback =
|
2009-04-13 17:11:50 +02:00
|
|
|
get_controller().get_playback_controller();
|
2009-02-04 05:23:43 +01:00
|
|
|
|
|
|
|
|
FrameDestination outputDestination (sigc::mem_fun(this, &ViewerPanel::on_frame));
|
|
|
|
|
playback.use_display (DisplayService::setUp (outputDestination));
|
2009-01-17 18:37:06 +01:00
|
|
|
}
|
|
|
|
|
|
2009-04-04 17:57:06 +02:00
|
|
|
const char*
|
|
|
|
|
ViewerPanel::get_title()
|
|
|
|
|
{
|
|
|
|
|
return _("Viewer");
|
|
|
|
|
}
|
|
|
|
|
|
2009-04-04 19:53:09 +02:00
|
|
|
const gchar*
|
|
|
|
|
ViewerPanel::get_stock_id()
|
|
|
|
|
{
|
|
|
|
|
return "panel_viewer";
|
|
|
|
|
}
|
|
|
|
|
|
2009-01-17 18:37:06 +01:00
|
|
|
void
|
|
|
|
|
ViewerPanel::on_frame(void *buffer)
|
|
|
|
|
{
|
|
|
|
|
Displayer *displayer = display.get_displayer();
|
|
|
|
|
REQUIRE(displayer);
|
|
|
|
|
|
|
|
|
|
displayer->put(buffer);
|
2008-10-20 19:50:37 +02:00
|
|
|
}
|
2008-04-12 22:15:07 +02:00
|
|
|
|
|
|
|
|
} // namespace panels
|
|
|
|
|
} // namespace gui
|