vtl: remove xjadeo option dialog

xjadeo options (selective session restore) are only
useful for testing and debugging.
This commit is contained in:
Robin Gareus 2013-04-02 17:57:09 +02:00
parent 37b108959c
commit 5a4d0fff01
7 changed files with 8 additions and 348 deletions

View file

@ -1,196 +0,0 @@
/*
Copyright (C) 2010 Paul Davis
Author: Robin Gareus <robin@gareus.org>
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.
*/
#ifdef WITH_VIDEOTIMELINE
#include <cstdio>
#include <cmath>
#include <sigc++/bind.h>
#include "pbd/file_utils.h"
#include "pbd/error.h"
#include "pbd/convert.h"
#include "gtkmm2ext/utils.h"
#include "ardour/profile.h"
#include "ardour/template_utils.h"
#include "ardour/session.h"
#include "ardour_ui.h"
#include "utils.h"
#include "add_video_dialog.h"
#include "video_monitor.h"
#include "i18n.h"
using namespace Gtk;
using namespace std;
using namespace PBD;
using namespace ARDOUR;
OpenVideoMonitorDialog::OpenVideoMonitorDialog (Session* s)
: ArdourDialog (_("Open Video Monitor"))
, filename_label ()
, showagain_checkbox (_("Don't show this dialog again. (Reset in Edit->Preferences)."))
, win_checkbox (_("Restore last window size and position."))
, att_checkbox (_("Restore Window Attributes (fullscreen, on-top)."))
, osd_checkbox (_("Restore On-Screen-Display settings."))
, off_checkbox (_("Restore Time Offset."))
, label_winsize ()
, label_winpos ()
, label_letterbox ()
, label_ontop ()
, label_fullscreen ()
, label_osd ()
, label_offset ()
#if 1
, debug_checkbox (_("Enable Debug Mode: Dump Communication to stdout."))
#endif
{
set_session (s);
set_name ("OpenVideoMonitorDialog");
set_position (Gtk::WIN_POS_MOUSE);
set_modal (true);
set_skip_taskbar_hint (true);
set_resizable (false);
Gtk::Label* l;
VBox* vbox = manage (new VBox);
VBox* options_box = manage (new VBox);
l = manage (new Label (_("<b>Video Monitor Window</b>"), Gtk::ALIGN_LEFT, Gtk::ALIGN_CENTER, false));
l->set_use_markup ();
vbox->pack_start (*l, false, true);
l = manage (new Label (_("The video monitor state can restored to the last known settings for this session. To modify the settings, interact with the monitor itself: Move its window or focus it and use keyboard shortcuts (or the OSX menu bar). Consult the xjadeo documentation for available keyboard shortcuts."), Gtk::ALIGN_LEFT, Gtk::ALIGN_CENTER, false));
l->set_size_request(550,-1);
l->set_line_wrap();
vbox->pack_start (*l, false, true,4);
l = manage (new Label (_("<b>Open Video file:</b>"), Gtk::ALIGN_LEFT, Gtk::ALIGN_CENTER, false));
l->set_use_markup ();
vbox->pack_start (*l, false, true, 4);
vbox->pack_start (filename_label, false, false);
l = manage (new Label (_("<b>Session Options</b>"), Gtk::ALIGN_LEFT, Gtk::ALIGN_CENTER, false));
l->set_use_markup ();
options_box->pack_start (*l, false, true, 4);
options_box->pack_start (win_checkbox, false, true, 2);
options_box->pack_start (label_winpos, false, false, 2);
options_box->pack_start (label_winsize, false, false, 2);
options_box->pack_start (label_letterbox, false, false, 2);
options_box->pack_start (att_checkbox, false, true, 2);
options_box->pack_start (label_fullscreen, false, false, 2);
options_box->pack_start (label_ontop, false, false, 2);
options_box->pack_start (osd_checkbox, false, true, 2);
options_box->pack_start (label_osd, false, false, 2);
options_box->pack_start (off_checkbox, false, true, 2);
options_box->pack_start (label_offset, false, false, 2);
options_box->pack_start (*(manage (new HSeparator())), true, true, 2);
options_box->pack_start (showagain_checkbox, false, true, 2);
#if 1
options_box->pack_start (debug_checkbox, false, true, 2);
debug_checkbox.set_active(false);
#endif
vbox->pack_start (*options_box, false, true);
get_vbox()->set_spacing (4);
get_vbox()->pack_start (*vbox, false, false);
showagain_checkbox.set_active(false);
show_all_children ();
add_button (Stock::CANCEL, RESPONSE_CANCEL);
add_button (Stock::OPEN, RESPONSE_ACCEPT);
}
OpenVideoMonitorDialog::~OpenVideoMonitorDialog ()
{
}
void
OpenVideoMonitorDialog::on_show ()
{
label_offset.set_text(string_compose(_("Offset: %1 Video frame(s)"), "-"));
label_osd.set_text(string_compose(_("On-Screen-Display: %1"), "-"));
label_letterbox.set_text(string_compose(_("Letterbox: %1"), "-"));
label_winsize.set_text(string_compose(_("Size: %1"), "-"));
label_winpos.set_text(string_compose(_("Position: %1"), "-"));
label_fullscreen.set_text(string_compose(_("Fullscreen: %1"), "-"));
label_ontop.set_text(string_compose(_("Window on Top: %1"), "-"));
#define L_YESNO(v) (atoi(v)?_("Yes"):_("No"))
#define L_OSDMODE(i) ( std::string((i)? "":_("(Off)")) \
+std::string((i&1)?_("Frame Number "):"") \
+std::string((i&2)?_("SMPTE "):"") \
+std::string((i&4)?_("Text "):"") \
+std::string((i&8)?_("Box "):"") )
XMLNode* node = _session->extra_xml (X_("XJSettings"));
if (node) {
XMLNodeList nlist = node->children();
XMLNodeConstIterator niter;
for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
std::string k = (*niter)->property(X_("k"))->value();
std::string v = (*niter)->property(X_("v"))->value();
if (k == "osd mode") { label_osd.set_text(string_compose(_("On-Screen-Display: %1"), L_OSDMODE(atoi(v)))); }
if (k == "window letterbox") { label_letterbox.set_text(string_compose(_("Letterbox: %1"), L_YESNO(v))); }
if (k == "window xy") { label_winpos.set_text(string_compose(_("Position: %1"), v)); }
if (k == "window ontop") { label_ontop.set_text(string_compose(_("Window On Top: %1"), L_YESNO(v))); }
if (k == "window zoom") { label_fullscreen.set_text(string_compose(_("Fullscreen: %1"), L_YESNO(v))); }
if (k == "window size") { label_winsize.set_text(string_compose(_("Size: %1"), v)); }
if (k == "set offset") { label_offset.set_text(string_compose(_("Offset: %1 video-frame(s)"), v)); }
}
}
Dialog::on_show ();
}
int
OpenVideoMonitorDialog::xj_settings_mask ()
{
int rv =0;
if (!win_checkbox.get_active()) { rv |= XJ_WINDOW_SIZE | XJ_WINDOW_POS | XJ_LETTERBOX; }
if (!att_checkbox.get_active()) { rv |= XJ_WINDOW_ONTOP | XJ_FULLSCREEN; }
if (!osd_checkbox.get_active()) { rv |= XJ_OSD; }
if (!off_checkbox.get_active()) { rv |= XJ_OFFSET; }
return rv;
}
void
OpenVideoMonitorDialog::set_filename (const std::string fn)
{
filename_label.set_text(fn);
}
void
OpenVideoMonitorDialog::setup_settings_mask (const int f)
{
win_checkbox.set_active((f&XJ_WINDOW_SIZE) == 0);
att_checkbox.set_active((f&XJ_WINDOW_ONTOP) == 0);
osd_checkbox.set_active((f&XJ_OSD) == 0);
off_checkbox.set_active((f&XJ_OFFSET) == 0);
}
#endif /* WITH_VIDEOTIMELINE */

View file

@ -1,80 +0,0 @@
/*
Copyright (C) 2010 Paul Davis
Author: Robin Gareus <robin@gareus.org>
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.
*/
#ifdef WITH_VIDEOTIMELINE
#ifndef __gtk_ardour_open_video_monitor_dialog_h__
#define __gtk_ardour_open_video_monitor_dialog_h__
#include <string>
#include <gtkmm.h>
#include "ardour/types.h"
#include "ardour/template_utils.h"
#include "ardour_dialog.h"
/** @class OpenVideoMonitorDialog
* @brief video-monitor start-option dialog
*
* This dialog allows to override xjadeo startup-options
* eg. restore previous size&position, offset or letterbox
* settings.
*
* This dialog is optional and can be en/disabled in the
* Preferences.
*/
class OpenVideoMonitorDialog : public ArdourDialog
{
public:
OpenVideoMonitorDialog (ARDOUR::Session*);
~OpenVideoMonitorDialog ();
bool show_again () { return showagain_checkbox.get_active(); }
int xj_settings_mask ();
void setup_settings_mask (const int);
void set_filename (const std::string);
#if 1
bool enable_debug () { return debug_checkbox.get_active(); }
#endif
private:
void on_show ();
Gtk::Label filename_label;
Gtk::CheckButton showagain_checkbox;
Gtk::CheckButton win_checkbox;
Gtk::CheckButton att_checkbox;
Gtk::CheckButton osd_checkbox;
Gtk::CheckButton off_checkbox;
Gtk::Label label_winsize;
Gtk::Label label_winpos;
Gtk::Label label_letterbox;
Gtk::Label label_ontop;
Gtk::Label label_fullscreen;
Gtk::Label label_osd;
Gtk::Label label_offset;
#if 1
Gtk::CheckButton debug_checkbox;
#endif
};
#endif /* __gtk_ardour_open_video_monitor_dialog_h__ */
#endif /* WITH_VIDEOTIMELINE */

View file

@ -815,12 +815,11 @@ class VideoTimelineOptions : public OptionEditorBox
public:
VideoTimelineOptions (RCConfiguration* c)
: _rc_config (c)
, _show_xjadeo_setup_button (_("Show Video Monitor Option Dialog"))
, _show_video_export_info_button (_("Show Video Export Info before export"))
, _show_video_server_dialog_button (_("Show Video Server Startup Dialog"))
, _video_advanced_setup_button (_("Advanced Setup (remote video server)"))
{
Table* t = manage (new Table (2, 7));
Table* t = manage (new Table (2, 6));
t->set_spacings (4);
t->attach (_video_advanced_setup_button, 0, 2, 0, 1);
@ -844,17 +843,12 @@ public:
/* small vspace y=3..4 */
t->attach (_show_xjadeo_setup_button, 0, 2, 4, 5);
_show_xjadeo_setup_button.signal_toggled().connect (sigc::mem_fun (*this, &VideoTimelineOptions::show_xjadeo_setup_toggled));
Gtkmm2ext::UI::instance()->set_tip (_show_xjadeo_setup_button,
_("<b>When enabled</b> an option dialog is presented before opening the video monitor"));
t->attach (_show_video_export_info_button, 0, 2, 5, 6);
t->attach (_show_video_export_info_button, 0, 2, 4, 5);
_show_video_export_info_button.signal_toggled().connect (sigc::mem_fun (*this, &VideoTimelineOptions::show_video_export_info_toggled));
Gtkmm2ext::UI::instance()->set_tip (_show_video_export_info_button,
_("<b>When enabled</b> an information window with details is displayed before the video-export dialog."));
t->attach (_show_video_server_dialog_button, 0, 2, 6, 7);
t->attach (_show_video_server_dialog_button, 0, 2, 5, 6);
_show_video_server_dialog_button.signal_toggled().connect (sigc::mem_fun (*this, &VideoTimelineOptions::show_video_server_dialog_toggled));
Gtkmm2ext::UI::instance()->set_tip (_show_video_server_dialog_button,
_("<b>When enabled</b> the video server is never launched automatically without confirmation"));
@ -877,12 +871,6 @@ public:
_rc_config->set_video_server_docroot (_video_server_docroot_entry.get_text());
}
void show_xjadeo_setup_toggled ()
{
bool const x = _show_xjadeo_setup_button.get_active ();
_rc_config->set_video_monitor_setup_dialog (x);
}
void show_video_export_info_toggled ()
{
bool const x = _show_video_export_info_button.get_active ();
@ -907,9 +895,6 @@ public:
_video_server_url_entry.set_text (_rc_config->get_video_server_url());
} else if (p == "video-server-docroot") {
_video_server_docroot_entry.set_text (_rc_config->get_video_server_docroot());
} else if (p == "video-monitor-setup-dialog") {
bool const x = _rc_config->get_video_monitor_setup_dialog();
_show_xjadeo_setup_button.set_active (x);
} else if (p == "show-video-export-info") {
bool const x = _rc_config->get_show_video_export_info();
_show_video_export_info_button.set_active (x);
@ -938,7 +923,6 @@ private:
RCConfiguration* _rc_config;
Entry _video_server_url_entry;
Entry _video_server_docroot_entry;
CheckButton _show_xjadeo_setup_button;
CheckButton _show_video_export_info_button;
CheckButton _show_video_server_dialog_button;
CheckButton _video_advanced_setup_button;

View file

@ -59,7 +59,6 @@ VideoTimeLine::VideoTimeLine (PublicEditor *ed, ArdourCanvas::Group *vbg, int in
auto_set_session_fps = false;
video_offset_lock = false;
video_aspect_ratio = 4.0/3.0;
open_video_monitor_dialog = 0;
Config->ParameterChanged.connect (*this, invalidator (*this), ui_bind (&VideoTimeLine::parameter_changed, this, _1), gui_context());
video_server_url = video_get_server_url(Config);
server_docroot = video_get_docroot(Config);
@ -163,10 +162,6 @@ VideoTimeLine::close_session ()
video_filename = "";
video_duration = 0;
GuiUpdate("set-xjadeo-sensitive-off");
if (open_video_monitor_dialog) {
delete open_video_monitor_dialog;
}
open_video_monitor_dialog = 0;
}
/** load settings from session */
@ -220,16 +215,11 @@ VideoTimeLine::set_session (ARDOUR::Session *s)
video_file_info(propf->value(), local_file);
}
if (open_video_monitor_dialog) {
delete open_video_monitor_dialog;
}
open_video_monitor_dialog = 0;
node = _session->extra_xml (X_("Videomonitor"));
if (node) {
const XMLProperty* prop = node->property (X_("active"));
if (prop && prop->value() == "yes" && found_xjadeo() && !video_filename.empty() && local_file) {
open_video_monitor(false);
open_video_monitor();
}
}
@ -697,7 +687,7 @@ VideoTimeLine::find_xjadeo () {
}
void
VideoTimeLine::open_video_monitor(bool interactive) {
VideoTimeLine::open_video_monitor() {
if (!found_xjadeo()) return;
if (!vmonitor) {
vmonitor = new VideoMonitor(editor, _xjadeo_bin);
@ -719,41 +709,7 @@ VideoTimeLine::open_video_monitor(bool interactive) {
}
}
if (interactive && Config->get_video_monitor_setup_dialog()) {
if (open_video_monitor_dialog == 0) {
open_video_monitor_dialog = new OpenVideoMonitorDialog(_session);
}
if (open_video_monitor_dialog->is_visible()) {
return;
}
open_video_monitor_dialog->setup_settings_mask(xj_settings_mask);
open_video_monitor_dialog->set_filename(video_filename);
Gtk::ResponseType r = (Gtk::ResponseType) open_video_monitor_dialog->run ();
open_video_monitor_dialog->hide();
if (r != Gtk::RESPONSE_ACCEPT) {
GuiUpdate("set-xjadeo-active-off");
return;
}
if (_session && (xj_settings_mask != open_video_monitor_dialog->xj_settings_mask()) ) {
/* save mask to Session */
XMLNode* node = new XMLNode(X_("XJRestoreSettings"));
node->add_property (X_("mask"), (const long) open_video_monitor_dialog->xj_settings_mask() );
_session->add_extra_xml (*node);
_session->set_dirty ();
}
if (open_video_monitor_dialog->show_again()) {
Config->set_video_monitor_setup_dialog(false);
}
#if 1
vmonitor->set_debug(open_video_monitor_dialog->enable_debug());
#endif
vmonitor->restore_settings_mask(open_video_monitor_dialog->xj_settings_mask());
} else {
vmonitor->restore_settings_mask(xj_settings_mask);
}
vmonitor->restore_settings_mask(xj_settings_mask);
if (!vmonitor->start()) {
warning << "launching xjadeo failed.." << endmsg;
@ -781,7 +737,7 @@ VideoTimeLine::terminated_video_monitor () {
vmonitor=0;
if (reopen_vmonitor) {
reopen_vmonitor=false;
open_video_monitor(false);
open_video_monitor();
}
}

View file

@ -29,7 +29,6 @@
#include "ardour/session.h"
#include "ardour/session_handle.h"
#include "video_image_frame.h"
#include "open_video_monitor_dialog.h"
#include "video_monitor.h"
#include "pbd/signals.h"
#include "canvas.h"
@ -77,7 +76,7 @@ class VideoTimeLine : public sigc::trackable, public ARDOUR::SessionHandlePtr, p
void toggle_offset_locked () { video_offset_lock = !video_offset_lock; }
bool is_offset_locked () { return video_offset_lock; }
void open_video_monitor (bool interactive=true);
void open_video_monitor ();
void close_video_monitor ();
void terminated_video_monitor ();
void manual_seek_video_monitor (framepos_t pos);
@ -132,7 +131,6 @@ class VideoTimeLine : public sigc::trackable, public ARDOUR::SessionHandlePtr, p
std::string translated_filename ();
VideoMonitor *vmonitor;
OpenVideoMonitorDialog *open_video_monitor_dialog;
bool reopen_vmonitor;
PBD::Signal0<void> VtlUpdate;

View file

@ -427,7 +427,6 @@ def build(bld):
'video_timeline.cc',
'system_exec.cc',
'video_monitor.cc',
'open_video_monitor_dialog.cc',
'transcode_ffmpeg.cc',
'transcode_video_dialog.cc',
'video_server_dialog.cc',

View file

@ -220,7 +220,6 @@ CONFIG_VARIABLE (std::string, donate_url, "donate-url", "http://ardour.org/donat
CONFIG_VARIABLE (bool, video_advanced_setup, "video-advanced-setup", false)
CONFIG_VARIABLE (std::string, video_server_url, "video-server-url", "http://localhost:1554")
CONFIG_VARIABLE (std::string, video_server_docroot, "video-server-docroot", "/")
CONFIG_VARIABLE (bool, video_monitor_setup_dialog, "video-monitor-setup-dialog", false)
CONFIG_VARIABLE (bool, show_video_export_info, "show-video-export-info", true)
CONFIG_VARIABLE (bool, show_video_server_dialog, "show-video-server-dialog", false)
#endif