From ccd4f9ccdc9bc6adeb26c0fb715fc968904aff90 Mon Sep 17 00:00:00 2001 From: Colin Fletcher Date: Tue, 27 May 2014 11:22:59 +0100 Subject: [PATCH] Post-export hook tweaks Remove the Soundcloud username & password from the parameter substitutions passed to the post-export hook: having thought about this now, I can't actually think of a case where these are of any use at all. In compensation, add %s and %n parameters that expand to the session directory and name - maybe people will think of uses for these. Conflicts: libs/ardour/export_handler.cc --- gtk2_ardour/export_format_dialog.cc | 2 +- libs/ardour/export_handler.cc | 17 ++++++++--------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/gtk2_ardour/export_format_dialog.cc b/gtk2_ardour/export_format_dialog.cc index 73d2c93b7b..4e5a39af9a 100644 --- a/gtk2_ardour/export_format_dialog.cc +++ b/gtk2_ardour/export_format_dialog.cc @@ -51,7 +51,7 @@ ExportFormatDialog::ExportFormatDialog (FormatPtr format, bool new_dialog) : silence_end_checkbox (_("Add silence at end:")), silence_end_clock ("silence_end", true, "", true, false, true), - command_label(_("Command to run post-export\n(%f=full path & filename, %d=directory, %b=basename, %u=username, %p=password):")), + command_label(_("Command to run post-export\n(%f=full path & filename, %d=directory, %b=basename):")), format_table (3, 4), compatibility_label (_("Compatibility"), Gtk::ALIGN_LEFT), diff --git a/libs/ardour/export_handler.cc b/libs/ardour/export_handler.cc index 0eb7be6037..bc7a44e53b 100644 --- a/libs/ardour/export_handler.cc +++ b/libs/ardour/export_handler.cc @@ -313,21 +313,20 @@ ExportHandler::finish_timespan () #if 0 // would be nicer with C++11 initialiser... std::map subs { - { 'f', filepath }, - { 'd', Glib::path_get_dirname(filepath) }, - { 'b', PBD::basename_nosuffix(filepath) }, - { 'u', upload_username }, - { 'p', upload_password} + { 'f', filename }, + { 'd', Glib::path_get_dirname(filename) + G_DIR_SEPARATOR }, + { 'b', PBD::basename_nosuffix(filename) }, + ... }; #endif PBD::ScopedConnection command_connection; std::map subs; subs.insert (std::pair ('f', filename)); - subs.insert (std::pair ('d', Glib::path_get_dirname(filename))); - subs.insert (std::pair ('b', PBD::basename_nosuffix(filename))); - subs.insert (std::pair ('s', session.path ())); - subs.insert (std::pair ('n', session.name ())); + subs.insert (std::pair ('d', Glib::path_get_dirname (filename) + G_DIR_SEPARATOR)); + subs.insert (std::pair ('b', PBD::basename_nosuffix (filename))); + subs.insert (std::pair ('s', session.path ())); + subs.insert (std::pair ('n', session.name ())); std::cerr << "running command: " << fmt->command() << "..." << std::endl; ARDOUR::SystemExec *se = new SystemExec(fmt->command(), subs);