Fix occasional MIDI read crash.
[ardour.git] / gtk2_ardour / export_file_notebook.cc
index b34d3aab09df01c863a0e5927f3752bb24d07e6e..ae924c10e3d9ae754f9afc25c7582c30d2fe6161 100644 (file)
@@ -27,6 +27,7 @@
 #include "i18n.h"
 
 using namespace ARDOUR;
+using namespace ARDOUR_UI_UTILS;
 using namespace PBD;
 
 ExportFileNotebook::ExportFileNotebook () :
@@ -94,15 +95,23 @@ void
 ExportFileNotebook::update_soundcloud_upload ()
 {
        int i;
+       bool show_credentials_entry = false;
        ExportProfileManager::FormatStateList const & formats = profile_manager->get_formats ();
        ExportProfileManager::FormatStateList::const_iterator format_it;
 
        for (i = 0, format_it = formats.begin(); format_it != formats.end(); ++i, ++format_it) {
                FilePage * page;
                if ((page = dynamic_cast<FilePage *> (get_nth_page (i)))) {
-                       (*format_it)->format->set_soundcloud_upload (page->get_soundcloud_upload ());
+                       bool this_soundcloud_upload = page->get_soundcloud_upload ();
+                       (*format_it)->format->set_soundcloud_upload (this_soundcloud_upload);
+                       if (this_soundcloud_upload) {
+                               show_credentials_entry  = true;
+                       }
                }
        }
+
+       soundcloud_export_selector->set_visible (show_credentials_entry);
+
 }
 
 void
@@ -115,16 +124,6 @@ ExportFileNotebook::update_example_filenames ()
        }
 }
 
-std::string
-ExportFileNotebook::get_nth_format_name (uint32_t n)
-{
-       FilePage * page;
-       if ((page = dynamic_cast<FilePage *> (get_nth_page (n - 1)))) {
-               return page->get_format_name();
-       }
-       return "";
-}
-
 void
 ExportFileNotebook::add_new_file_page ()
 {