export video-range: add to context menu
authorRobin Gareus <robin@gareus.org>
Sat, 12 Oct 2013 20:55:54 +0000 (22:55 +0200)
committerRobin Gareus <robin@gareus.org>
Sat, 12 Oct 2013 20:56:08 +0000 (22:56 +0200)
gtk2_ardour/ardour_ui_ed.cc
gtk2_ardour/editor.cc
gtk2_ardour/editor.h
gtk2_ardour/editor_videotimeline.cc
gtk2_ardour/export_video_dialog.cc
gtk2_ardour/export_video_dialog.h
gtk2_ardour/public_editor.h

index 251fc8f6fcb64fca01cc970732bbd580a8aaccf9..0ed7a95df37bb99937e5b37f8d46c7c64f4eccb9 100644 (file)
@@ -139,7 +139,7 @@ ARDOUR_UI::install_actions ()
                                              sigc::mem_fun (*this, &ARDOUR_UI::remove_video));
        act->set_sensitive (false);
        act = ActionManager::register_action (main_actions, X_("ExportVideo"), _("Export To Video File"),
-                                             sigc::mem_fun (*editor, &PublicEditor::export_video));
+                       hide_return (sigc::bind (sigc::mem_fun(*editor, &PublicEditor::export_video), false)));
        ActionManager::session_sensitive_actions.push_back (act);
 
        act = ActionManager::register_action (main_actions, X_("Snapshot"), _("Snapshot..."), sigc::bind (sigc::mem_fun(*this, &ARDOUR_UI::snapshot_session), false));
index fc4b6f4d6c4fe6ac7461bba5189ff4aed14475f9..cf3eab57245640583676310de71b17570cebe163 100644 (file)
@@ -1911,6 +1911,9 @@ Editor::add_selection_context_items (Menu_Helpers::MenuList& edit_items)
        edit_items.push_back (MenuElem (_("Bounce Range to Region List"), sigc::bind (sigc::mem_fun(*this, &Editor::bounce_range_selection), false, false)));
        edit_items.push_back (MenuElem (_("Bounce Range to Region List With Processing"), sigc::bind (sigc::mem_fun(*this, &Editor::bounce_range_selection), false, true)));
        edit_items.push_back (MenuElem (_("Export Range..."), sigc::mem_fun(*this, &Editor::export_selection)));
+       if (ARDOUR_UI::instance()->video_timeline->get_duration() > 0) {
+               edit_items.push_back (MenuElem (_("Export Video Range..."), sigc::bind (sigc::mem_fun(*this, &Editor::export_video), true)));
+       }
 }
 
 
index 033888c4b624a981e4c7ea8d0d561d4482bf59ba..e9269841ff442e88a499536545f0e09b8781d3cd 100644 (file)
@@ -924,7 +924,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
        void toggle_ruler_video (bool onoff) {ruler_video_action->set_active(onoff);}
        int videotl_bar_height; /* in units of timebar_height; default: 4 */
        int get_videotl_bar_height () const { return videotl_bar_height; }
-       void export_video ();
+       void export_video (bool range = false);
        void toggle_region_video_lock ();
 
        Gtk::VBox          time_button_vbox;
index 6f3317eabd7c09ddd507eb2456e5b376f7bffbc5..7d1c009d5885abbeef0c198fcf65db85106c98e9 100644 (file)
@@ -122,7 +122,7 @@ Editor::embed_audio_from_video (std::string path, framepos_t n)
 }
 
 void
-Editor::export_video ()
+Editor::export_video (bool range)
 {
        if (ARDOUR::Config->get_show_video_export_info()) {
                ExportVideoInfobox infobox (_session);
@@ -138,7 +138,7 @@ Editor::export_video ()
                                break;
                }
        }
-       ExportVideoDialog dialog (_session, get_selection().time);
+       ExportVideoDialog dialog (_session, get_selection().time, range);
        Gtk::ResponseType r = (Gtk::ResponseType) dialog.run();
        dialog.hide();
 #if 0
index eacc32bde2a6e20b77d06517812e3ac8817d2457..2f9df2fb1c6033fe74a04b7b997a2b1db3ea81c8 100644 (file)
@@ -61,7 +61,7 @@ using namespace PBD;
 using namespace ARDOUR;
 using namespace VideoUtils;
 
-ExportVideoDialog::ExportVideoDialog (Session* s, TimeSelection &tme)
+ExportVideoDialog::ExportVideoDialog (Session* s, TimeSelection &tme, bool range)
        : ArdourDialog (_("Export Video File "))
        , export_range (tme)
        , outfn_path_label (_("File:"), Gtk::ALIGN_LEFT)
@@ -152,7 +152,11 @@ ExportVideoDialog::ExportVideoDialog (Session* s, TimeSelection &tme)
        if (!export_range.empty()) {
                insnd_combo.append_text (_("Selected range"));  // TODO show export_range.start() -> export_range.end_frame()
        }
-       insnd_combo.set_active(0);
+       if (range) {
+               insnd_combo.set_active(2);
+       } else {
+               insnd_combo.set_active(0);
+       }
 
        outfn_path_entry.set_width_chars(38);
        outfn_path_entry.set_text (_session->session_directory().export_path() + G_DIR_SEPARATOR +"export.avi");
index 7e3cf442a777b8c823a49453cb9571cb45475e15..5ebcf3258d1b48e16ce43d6e0c3d7715568ec62a 100644 (file)
@@ -41,7 +41,7 @@
 class ExportVideoDialog : public ArdourDialog , public PBD::ScopedConnectionList
 {
   public:
-       ExportVideoDialog (ARDOUR::Session*, TimeSelection &tme);
+       ExportVideoDialog (ARDOUR::Session*, TimeSelection &tme, bool range = false);
        ~ExportVideoDialog ();
 
        std::string get_exported_filename () { return outfn_path_entry.get_text(); }
index b5f85034588fca38ffb37f3937abc432ab1caf4c..190587514171373ab1b3929e73a0c7595038f74d 100644 (file)
@@ -300,7 +300,7 @@ class PublicEditor : public Gtk::Window, public PBD::StatefulDestructible, publi
        virtual int  get_videotl_bar_height () const = 0;
        virtual void set_video_timeline_height (const int h) = 0;
        virtual void embed_audio_from_video (std::string, framepos_t n = 0) = 0;
-       virtual void export_video () = 0;
+       virtual void export_video (bool range = false) = 0;
 
        virtual RouteTimeAxisView* get_route_view_by_route_id (const PBD::ID& id) const = 0;