Export dialog: tidy code, & remove some superfluous debug output
authorColin Fletcher <colin.m.fletcher@googlemail.com>
Tue, 27 May 2014 10:23:47 +0000 (11:23 +0100)
committerColin Fletcher <colin.m.fletcher@googlemail.com>
Thu, 12 Jun 2014 22:20:05 +0000 (23:20 +0100)
Remove some debug output, tidy up a few whitespace inconsistencies, use
DEBUG::Soundcloud in one more place, and zap a couple of unused variables.

gtk2_ardour/export_file_notebook.cc
gtk2_ardour/export_file_notebook.h
gtk2_ardour/soundcloud_export_selector.cc
libs/ardour/export_handler.cc
libs/pbd/system_exec.cc

index 00e26872514147cf280d7c8de1ec357a6f640b72..b34d3aab09df01c863a0e5927f3752bb24d07e6e 100644 (file)
@@ -91,7 +91,7 @@ ExportFileNotebook::sync_with_manager ()
 }
 
 void
-ExportFileNotebook::update_soundcloud_upload()
+ExportFileNotebook::update_soundcloud_upload ()
 {
        int i;
        ExportProfileManager::FormatStateList const & formats = profile_manager->get_formats ();
@@ -99,19 +99,14 @@ ExportFileNotebook::update_soundcloud_upload()
 
        for (i = 0, format_it = formats.begin(); format_it != formats.end(); ++i, ++format_it) {
                FilePage * page;
-               std::cerr << "get_nth_soundcloud_upload " << i << std::endl;
                if ((page = dynamic_cast<FilePage *> (get_nth_page (i)))) {
-                       (*format_it)->format->set_soundcloud_upload( page->get_soundcloud_upload () );
-                       // profile_manager->soundcloud_upload_list.push_back (page->get_soundcloud_upload () );
-               } else  {
-                       std::cerr << "not a page!" << std::endl;
+                       (*format_it)->format->set_soundcloud_upload (page->get_soundcloud_upload ());
                }
        }
-
 }
 
 void
-ExportFileNotebook::update_example_filenames()
+ExportFileNotebook::update_example_filenames ()
 {
        int i = 0;
        FilePage * page;
index 2d87d942e75fe52e74a43dddefd9048c89ccec62..7a021057ef716c64a99c0cd769533fd9a432db17 100644 (file)
@@ -58,7 +58,7 @@ class ExportFileNotebook : public Gtk::Notebook, public ARDOUR::SessionHandlePtr
        void add_file_page (ARDOUR::ExportProfileManager::FormatStatePtr format_state, ARDOUR::ExportProfileManager::FilenameStatePtr filename_state);
        void remove_file_page (FilePage * page);
        void update_remove_file_page_sensitivity ();
-       void update_soundcloud_upload();
+       void update_soundcloud_upload ();
 
        sigc::connection page_change_connection;
        void handle_page_change (GtkNotebookPage*, uint32_t page);
index ab1f1a63c8f0ccb38f45d6e883f19856ab1fa835..8ecdf5d49bbb3ddda997f64dcb56243bd697cd13 100644 (file)
@@ -20,6 +20,7 @@
 
 
 *************************************************************************************/
+#include "ardour/debug.h"
 #include "ardour/soundcloud_upload.h"
 #include "soundcloud_export_selector.h"
 
@@ -38,7 +39,7 @@ using namespace PBD;
 #include "ardour/session_metadata.h"
 #include "utils.h"
 
-SoundcloudExportSelector::SoundcloudExportSelector() :
+SoundcloudExportSelector::SoundcloudExportSelector () :
          sc_table (4, 3),
          soundcloud_username_label (_("User Email"), 1.0, 0.5),
          soundcloud_password_label (_("Password"), 1.0, 0.5),
@@ -57,20 +58,19 @@ SoundcloudExportSelector::SoundcloudExportSelector() :
        soundcloud_password_entry.set_name ("ExportFormatDisplay");
 
        soundcloud_username_entry.set_text (ARDOUR::SessionMetadata::Metadata()->user_email());
-       soundcloud_password_entry.set_visibility(false);
+       soundcloud_password_entry.set_visibility (false);
 
-       Gtk::Frame *sc_frame = manage(new Gtk::Frame);
-       sc_frame->set_border_width(4);
-       sc_frame->set_shadow_type(Gtk::SHADOW_ETCHED_OUT);
-       sc_frame->set_name("soundcloud_export_box");
-       pack_start(*sc_frame, false, false);
+       Gtk::Frame *sc_frame = manage (new Gtk::Frame);
+       sc_frame->set_border_width (4);
+       sc_frame->set_shadow_type (Gtk::SHADOW_ETCHED_OUT);
+       sc_frame->set_name ("soundcloud_export_box");
+       pack_start (*sc_frame, false, false);
 
        sc_table.set_border_width (4);
        sc_table.set_col_spacings (5);
        sc_table.set_row_spacings (5);
        sc_frame->add (sc_table);
 
-       //              sc_table.attach ( *( manage (new EventBox (::get_icon (X_("soundcloud"))))) , 0, 1,  0, 1);
        sc_table.attach ( *(Gtk::manage (new Gtk::Image (get_icon (X_("soundcloud"))))) , 0, 1,  0, 2);
 
        sc_table.attach (soundcloud_username_label,    0, 1,  1, 2);
@@ -81,15 +81,15 @@ SoundcloudExportSelector::SoundcloudExportSelector() :
        sc_table.attach (soundcloud_open_checkbox,     2, 3,  4, 5);
        sc_table.attach (soundcloud_download_checkbox, 2, 3,  5, 6);
 
-       pack_end(progress_bar, false, false);
-       sc_frame->show_all();
+       pack_end (progress_bar, false, false);
+       sc_frame->show_all ();
 }
 
 
 int
-SoundcloudExportSelector::do_progress_callback(double ultotal, double ulnow, const std::string &filename)
+SoundcloudExportSelector::do_progress_callback (double ultotal, double ulnow, const std::string &filename)
 {
-       std::cerr << "SoundcloudExportSelector::do_progress_callback(" << ultotal << ", " << ulnow << ", " << filename << ")..." << std::endl; 
+       DEBUG_TRACE (DEBUG::Soundcloud, string_compose ("SoundcloudExportSelector::do_progress_callback(%1, %2, %3)", ultotal, ulnow, filename));
        if (soundcloud_cancel) {
                progress_bar.set_fraction (0);
                // cancel_button.set_label ("");
@@ -105,7 +105,7 @@ SoundcloudExportSelector::do_progress_callback(double ultotal, double ulnow, con
 
        std::string prog;
        prog = string_compose (_("%1: %2 of %3 bytes uploaded"), filename, ulnow, ultotal);
-       progress_bar.set_text( prog );
+       progress_bar.set_text (prog);
 
 
        return 0;
index 4368d54430e4361e41019d0c396a5310867a98ad..e706522aa9b6678e5038e354f81fa3301a081a65 100644 (file)
@@ -328,20 +328,15 @@ ExportHandler::finish_timespan ()
                        subs.insert (std::pair<char, std::string> ('s', session.path ()));
                        subs.insert (std::pair<char, std::string> ('n', session.name ()));
 
-
-                       std::cerr << "running command: " << fmt->command() << "..." << std::endl;
                        ARDOUR::SystemExec *se = new ARDOUR::SystemExec(fmt->command(), subs);
                        se->ReadStdout.connect_same_thread(command_connection, boost::bind(&ExportHandler::command_output, this, _1, _2));
                        if (se->start (2) == 0) {
                                // successfully started
-                               std::cerr << "started!" << std::endl;
                                while (se->is_running ()) {
                                        // wait for system exec to terminate
-                                       // std::cerr << "waiting..." << std::endl;
                                        Glib::usleep (1000);
                                }
                        }
-                       std::cerr << "done! deleting..." << std::endl;
                        delete (se);
                }
 
index a5dd20afac7e180245568b9a7817c6524d3aab9f..5d2db21efca71118012c1009c62f3dab084b52e3 100644 (file)
@@ -274,9 +274,6 @@ SystemExec::make_argp_escaped(std::string command, const std::map<char, std::str
                }
        }
        argp[n] = NULL;
-
-       char *p = argp[0];
-       n = 0;
 }
 
 SystemExec::~SystemExec ()