diff options
Diffstat (limited to 'gtk2_ardour/editor_actions.cc')
-rw-r--r-- | gtk2_ardour/editor_actions.cc | 113 |
1 files changed, 112 insertions, 1 deletions
diff --git a/gtk2_ardour/editor_actions.cc b/gtk2_ardour/editor_actions.cc index 0fe99582ca..1efc358513 100644 --- a/gtk2_ardour/editor_actions.cc +++ b/gtk2_ardour/editor_actions.cc @@ -547,8 +547,19 @@ Editor::register_actions () ruler_timecode_action = Glib::RefPtr<ToggleAction>::cast_static (ActionManager::register_toggle_action (ruler_actions, X_("toggle-timecode-ruler"), _("Timecode"), sigc::bind (sigc::mem_fun(*this, &Editor::toggle_ruler_visibility), ruler_metric_timecode))); ruler_minsec_action = Glib::RefPtr<ToggleAction>::cast_static (ActionManager::register_toggle_action (ruler_actions, X_("toggle-minsec-ruler"), _("Min:Sec"), sigc::bind (sigc::mem_fun(*this, &Editor::toggle_ruler_visibility), ruler_metric_minsec))); #ifdef WITH_VIDEOTIMELINE + + ActionManager::register_action (editor_menu_actions, X_("VideoMonitorMenu"), _("Video Monitor")); + ruler_video_action = Glib::RefPtr<ToggleAction>::cast_static (ActionManager::register_toggle_action (ruler_actions, X_("toggle-video-ruler"), _("Video"), sigc::bind (sigc::mem_fun(*this, &Editor::toggle_ruler_visibility), ruler_video_timeline))); - xjadeo_proc_action = Glib::RefPtr<ToggleAction>::cast_static (ActionManager::register_toggle_action (editor_actions, X_("ToggleJadeo"), _("Show Video Monitor"), sigc::mem_fun (*this, &Editor::set_xjadeo_proc))); + xjadeo_proc_action = Glib::RefPtr<ToggleAction>::cast_static (ActionManager::register_toggle_action (editor_actions, X_("ToggleJadeo"), _("Video Monitor"), sigc::mem_fun (*this, &Editor::set_xjadeo_proc))); + + xjadeo_ontop_action = Glib::RefPtr<ToggleAction>::cast_static (ActionManager::register_toggle_action (editor_actions, X_("toggle-vmon-ontop"), _("Always on Top"), sigc::bind (sigc::mem_fun (*this, &Editor::set_xjadeo_viewoption), (int) 1))); + xjadeo_timecode_action = Glib::RefPtr<ToggleAction>::cast_static (ActionManager::register_toggle_action (editor_actions, X_("toggle-vmon-timecode"), _("Timecode"), sigc::bind (sigc::mem_fun (*this, &Editor::set_xjadeo_viewoption), (int) 2))); + 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 @@ -565,6 +576,19 @@ Editor::register_actions () ruler_video_action->set_active (false); xjadeo_proc_action->set_active (false); xjadeo_proc_action->set_sensitive (false); + xjadeo_ontop_action->set_active (false); + xjadeo_ontop_action->set_sensitive (false); + xjadeo_timecode_action->set_active (false); + xjadeo_timecode_action->set_sensitive (false); + xjadeo_frame_action->set_active (false); + xjadeo_frame_action->set_sensitive (false); + xjadeo_osdbg_action->set_active (false); + 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); @@ -763,6 +787,7 @@ Editor::set_xjadeo_sensitive (bool onoff) { xjadeo_proc_action->set_sensitive(onoff); } + void Editor::toggle_xjadeo_proc (int state) { @@ -777,6 +802,14 @@ Editor::toggle_xjadeo_proc (int state) xjadeo_proc_action->set_active(!xjadeo_proc_action->get_active()); break; } + bool onoff = xjadeo_proc_action->get_active(); + xjadeo_ontop_action->set_sensitive(onoff); + xjadeo_timecode_action->set_sensitive(onoff); + 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 @@ -788,6 +821,84 @@ Editor::set_xjadeo_proc () ARDOUR_UI::instance()->video_timeline->close_video_monitor(); } } + +void +Editor::toggle_xjadeo_viewoption (int what, int state) +{ + Glib::RefPtr<Gtk::ToggleAction> action; + switch (what) { + case 1: + action = xjadeo_ontop_action; + break; + case 2: + action = xjadeo_timecode_action; + break; + case 3: + action = xjadeo_frame_action; + break; + case 4: + action = xjadeo_osdbg_action; + break; + case 5: + action = xjadeo_fullscreen_action; + break; + case 6: + action = xjadeo_letterbox_action; + break; + case 7: + return; + default: + return; + } + + switch(state) { + case 1: + action->set_active(true); + break; + case 0: + action->set_active(false); + break; + default: + action->set_active(!action->get_active()); + break; + } +} + +void +Editor::set_xjadeo_viewoption (int what) +{ + Glib::RefPtr<Gtk::ToggleAction> action; + switch (what) { + case 1: + action = xjadeo_ontop_action; + break; + case 2: + action = xjadeo_timecode_action; + break; + case 3: + action = xjadeo_frame_action; + break; + case 4: + action = xjadeo_osdbg_action; + break; + 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; + } + if (action->get_active()) { + ARDOUR_UI::instance()->video_timeline->control_video_monitor(what, 1); + } else { + ARDOUR_UI::instance()->video_timeline->control_video_monitor(what, 0); + } +} #endif void |