diff options
author | Robin Gareus <robin@gareus.org> | 2013-06-13 00:54:43 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2013-06-13 00:58:19 +0200 |
commit | 6b480bb2f7d16288b5fa0d35f827ad32f88a6978 (patch) | |
tree | 702d8207fa264514fd85a655472f2b091ed91da2 /gtk2_ardour | |
parent | 67704f8de245937252cca1897f7b99f40f1fccfb (diff) |
vtl: make "Remove Video" insensitive if N/A
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/ardour_ui.cc | 2 | ||||
-rw-r--r-- | gtk2_ardour/ardour_ui_ed.cc | 2 | ||||
-rw-r--r-- | gtk2_ardour/editor.h | 1 | ||||
-rw-r--r-- | gtk2_ardour/editor_actions.cc | 9 | ||||
-rw-r--r-- | gtk2_ardour/public_editor.h | 1 | ||||
-rw-r--r-- | gtk2_ardour/video_timeline.cc | 6 |
6 files changed, 20 insertions, 1 deletions
diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index 882e764d6a..a7034a1677 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -3559,6 +3559,8 @@ ARDOUR_UI::remove_video () node = new XMLNode(X_("Videomonitor")); _session->add_extra_xml(*node); stop_video_server(); + + editor->set_close_video_sensitive(false); } void diff --git a/gtk2_ardour/ardour_ui_ed.cc b/gtk2_ardour/ardour_ui_ed.cc index 941f1936d1..b6ba025d99 100644 --- a/gtk2_ardour/ardour_ui_ed.cc +++ b/gtk2_ardour/ardour_ui_ed.cc @@ -137,7 +137,7 @@ ARDOUR_UI::install_actions () ActionManager::session_sensitive_actions.push_back (act); act = ActionManager::register_action (main_actions, X_("CloseVideo"), _("Remove Video"), sigc::mem_fun (*this, &ARDOUR_UI::remove_video)); - ActionManager::session_sensitive_actions.push_back (act); + act->set_sensitive (false); act = ActionManager::register_action (main_actions, X_("ExportVideo"), _("Export To Video File"), sigc::mem_fun (*editor, &PublicEditor::export_video)); ActionManager::session_sensitive_actions.push_back (act); diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index f9ce1da514..13c2eeb3cd 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -925,6 +925,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD Glib::RefPtr<Gtk::Action> xjadeo_zoom_100; void set_xjadeo_proc (); void toggle_xjadeo_proc (int state=-1); + void set_close_video_sensitive (bool onoff); void set_xjadeo_sensitive (bool onoff); void set_xjadeo_viewoption (int); void toggle_xjadeo_viewoption (int what, int state=-1); diff --git a/gtk2_ardour/editor_actions.cc b/gtk2_ardour/editor_actions.cc index fefb0c6dd6..d35e2870fe 100644 --- a/gtk2_ardour/editor_actions.cc +++ b/gtk2_ardour/editor_actions.cc @@ -774,6 +774,15 @@ Editor::set_group_tabs () } void +Editor::set_close_video_sensitive (bool onoff) +{ + Glib::RefPtr<Action> act = ActionManager::get_action (X_("Main"), X_("CloseVideo")); + if (act) { + act->set_sensitive (onoff); + } +} + +void Editor::set_xjadeo_sensitive (bool onoff) { xjadeo_proc_action->set_sensitive(onoff); diff --git a/gtk2_ardour/public_editor.h b/gtk2_ardour/public_editor.h index 7a4dd5d59b..96310d7488 100644 --- a/gtk2_ardour/public_editor.h +++ b/gtk2_ardour/public_editor.h @@ -296,6 +296,7 @@ class PublicEditor : public Gtk::Window, public PBD::StatefulDestructible, publi virtual void edit_notes (TimeAxisViewItem&) = 0; virtual void queue_visual_videotimeline_update () = 0; + virtual void set_close_video_sensitive (bool) = 0; virtual void toggle_ruler_video (bool) = 0; virtual void toggle_xjadeo_proc (int) = 0; virtual void toggle_xjadeo_viewoption (int, int) = 0; diff --git a/gtk2_ardour/video_timeline.cc b/gtk2_ardour/video_timeline.cc index 7bf42299d7..72b0900e16 100644 --- a/gtk2_ardour/video_timeline.cc +++ b/gtk2_ardour/video_timeline.cc @@ -465,6 +465,7 @@ VideoTimeLine::video_file_info (std::string filename, bool local) video_server_url, translated_filename(), video_file_fps, _duration, _start_offset, video_aspect_ratio)) { warning << _("Parsing video file info failed. Is the Video Server running? Is the file readable by the Video Server? Does the docroot match? Is it a video file?") << endmsg; + GuiUpdate("video-unavailable"); return false; } video_duration = _duration * _session->nominal_frame_rate() / video_file_fps; @@ -531,6 +532,7 @@ VideoTimeLine::video_file_info (std::string filename, bool local) #endif } VtlUpdate(); + GuiUpdate("video-available"); return true; } @@ -591,6 +593,10 @@ VideoTimeLine::gui_update(std::string const & t) { editor->toggle_xjadeo_viewoption(6, 1); } else if (t == "xjadeo-window-letterbox-off") { editor->toggle_xjadeo_viewoption(6, 0); + } else if (t == "video-available") { + editor->set_close_video_sensitive(true); + } else if (t == "video-unavailable") { + editor->set_close_video_sensitive(false); } } |