diff options
author | Robin Gareus <robin@gareus.org> | 2013-04-04 00:51:03 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2013-04-04 01:05:49 +0200 |
commit | 1040801ffe7a4d51ebd1593b7552d5d2a71be7c7 (patch) | |
tree | 077f249ee8941d600a4047307572a0af96219f52 /gtk2_ardour | |
parent | ddfc047f0e1578277f8e70c454df7b4f85904ff1 (diff) |
vtl: video-monitor letterbox & orig-zoom to menu
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/ardour.menus.in | 2 | ||||
-rw-r--r-- | gtk2_ardour/editor.h | 2 | ||||
-rw-r--r-- | gtk2_ardour/editor_actions.cc | 18 | ||||
-rw-r--r-- | gtk2_ardour/video_monitor.cc | 16 | ||||
-rw-r--r-- | gtk2_ardour/video_timeline.cc | 4 |
5 files changed, 40 insertions, 2 deletions
diff --git a/gtk2_ardour/ardour.menus.in b/gtk2_ardour/ardour.menus.in index f101a9dc4f..cc9883066d 100644 --- a/gtk2_ardour/ardour.menus.in +++ b/gtk2_ardour/ardour.menus.in @@ -447,6 +447,8 @@ <menuitem action="toggle-vmon-frame"/> <menuitem action="toggle-vmon-osdbg"/> <menuitem action="toggle-vmon-fullscreen"/> + <menuitem action="toggle-vmon-letterbox"/> + <menuitem action="zoom-vmon-100"/> #endif </menu> <menu action="ScrollMenu"> diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index c287a259ea..676b4f1830 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -933,6 +933,8 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD Glib::RefPtr<Gtk::ToggleAction> xjadeo_frame_action; Glib::RefPtr<Gtk::ToggleAction> xjadeo_osdbg_action; Glib::RefPtr<Gtk::ToggleAction> xjadeo_fullscreen_action; + Glib::RefPtr<Gtk::ToggleAction> xjadeo_letterbox_action; + Glib::RefPtr<Gtk::Action> xjadeo_zoom_100; void set_xjadeo_proc (); void toggle_xjadeo_proc (int state=-1); void set_xjadeo_sensitive (bool onoff); diff --git a/gtk2_ardour/editor_actions.cc b/gtk2_ardour/editor_actions.cc index 8c81a6122e..fb6cd7df81 100644 --- a/gtk2_ardour/editor_actions.cc +++ b/gtk2_ardour/editor_actions.cc @@ -555,6 +555,8 @@ Editor::register_actions () xjadeo_frame_action = Glib::RefPtr<ToggleAction>::cast_static (ActionManager::register_toggle_action (editor_actions, X_("toggle-vmon-frame"), _("Framenumber"), sigc::bind (sigc::mem_fun (*this, &Editor::set_xjadeo_viewoption), (int) 3))); xjadeo_osdbg_action = Glib::RefPtr<ToggleAction>::cast_static (ActionManager::register_toggle_action (editor_actions, X_("toggle-vmon-osdbg"), _("Timecode Background"), sigc::bind (sigc::mem_fun (*this, &Editor::set_xjadeo_viewoption), (int) 4))); xjadeo_fullscreen_action = Glib::RefPtr<ToggleAction>::cast_static (ActionManager::register_toggle_action (editor_actions, X_("toggle-vmon-fullscreen"), _("Fullscreen"), sigc::bind (sigc::mem_fun (*this, &Editor::set_xjadeo_viewoption), (int) 5))); + xjadeo_letterbox_action = Glib::RefPtr<ToggleAction>::cast_static (ActionManager::register_toggle_action (editor_actions, X_("toggle-vmon-letterbox"), _("Letterbox"), sigc::bind (sigc::mem_fun (*this, &Editor::set_xjadeo_viewoption), (int) 6))); + xjadeo_zoom_100 = reg_sens (editor_actions, "zoom-vmon-100", _("Original Size"), sigc::bind (sigc::mem_fun (*this, &Editor::set_xjadeo_viewoption), (int) 7)); #endif @@ -581,6 +583,9 @@ Editor::register_actions () xjadeo_osdbg_action->set_sensitive (false); xjadeo_fullscreen_action->set_active (false); xjadeo_fullscreen_action->set_sensitive (false); + xjadeo_letterbox_action->set_active (false); + xjadeo_letterbox_action->set_sensitive (false); + xjadeo_zoom_100->set_sensitive (false); #endif if (Profile->get_sae()) { ruler_bbt_action->set_active (true); @@ -800,6 +805,8 @@ Editor::toggle_xjadeo_proc (int state) xjadeo_frame_action->set_sensitive(onoff); xjadeo_osdbg_action->set_sensitive(onoff); xjadeo_fullscreen_action->set_sensitive(onoff); + xjadeo_letterbox_action->set_sensitive(onoff); + xjadeo_zoom_100->set_sensitive(onoff); } void @@ -832,6 +839,11 @@ Editor::toggle_xjadeo_viewoption (int what, int state) case 5: action = xjadeo_fullscreen_action; break; + case 6: + action = xjadeo_letterbox_action; + break; + case 7: + return; default: return; } @@ -869,6 +881,12 @@ Editor::set_xjadeo_viewoption (int what) case 5: action = xjadeo_fullscreen_action; break; + case 6: + action = xjadeo_letterbox_action; + break; + case 7: + ARDOUR_UI::instance()->video_timeline->control_video_monitor(what, 0); + return; default: return; } diff --git a/gtk2_ardour/video_monitor.cc b/gtk2_ardour/video_monitor.cc index fabe4201dd..5bc6bb6777 100644 --- a/gtk2_ardour/video_monitor.cc +++ b/gtk2_ardour/video_monitor.cc @@ -118,7 +118,7 @@ VideoMonitor::open (std::string filename) manually_seeked_frame = 0; osdmode = 10; // 1: frameno, 2: timecode, 8: box sync_by_manual_seek = false; - starting = 7; + starting = 15; process->write_to_stdin("load " + filename + "\n"); process->write_to_stdin("set fps -1\n"); process->write_to_stdin("window resize 100%\n"); @@ -132,7 +132,7 @@ VideoMonitor::open (std::string filename) process->write_to_stdin(it->first + " " + it->second + "\n"); } if (!state_connection.connected()) { - starting = 7; + starting = 15; querystate(); state_clk_divide = 0; /* TODO once every two second or so -- state_clk_divide hack below */ @@ -197,6 +197,13 @@ VideoMonitor::send_cmd (int what, int param) if (param) process->write_to_stdin("window zoom on\n"); else process->write_to_stdin("window zoom off\n"); break; + case 6: + if (param) process->write_to_stdin("window letterbox on\n"); + else process->write_to_stdin("window letterbox off\n"); + break; + case 7: + process->write_to_stdin("window resize 100%"); + break; default: break; } @@ -280,6 +287,11 @@ VideoMonitor::parse_output (std::string d, size_t s) } xjadeo_settings["window zoom"] = value; } else if(key == "letterbox") { + if (starting || xjadeo_settings["window letterbox"] != value) { + starting &= ~8; + if (atoi(value.c_str())) { UiState("xjadeo-window-letterbox-on"); } + else { UiState("xjadeo-window-letterbox-off"); } + } xjadeo_settings["window letterbox"] = value; } else if(key == "osdmode") { if (starting || xjadeo_settings["osd mode"] != value) { diff --git a/gtk2_ardour/video_timeline.cc b/gtk2_ardour/video_timeline.cc index d68df6bc2f..9cd9d35315 100644 --- a/gtk2_ardour/video_timeline.cc +++ b/gtk2_ardour/video_timeline.cc @@ -601,6 +601,10 @@ VideoTimeLine::gui_update(std::string const & t) { editor->toggle_xjadeo_viewoption(5, 1); } else if (t == "xjadeo-window-fullscreen-off") { editor->toggle_xjadeo_viewoption(5, 0); + } else if (t == "xjadeo-window-letterbox-on") { + editor->toggle_xjadeo_viewoption(6, 1); + } else if (t == "xjadeo-window-letterbox-off") { + editor->toggle_xjadeo_viewoption(6, 0); } } |