export video-range: add to context menu

This commit is contained in:
Robin Gareus 2013-10-12 22:55:54 +02:00
parent f7c54f1435
commit c2b2953f8c
7 changed files with 15 additions and 8 deletions

View 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));

View 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)));
}
}

View 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;

View 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

View 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");

View 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(); }

View 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;