diff options
author | Colin Fletcher <colin.m.fletcher@googlemail.com> | 2014-05-23 18:14:37 +0100 |
---|---|---|
committer | Colin Fletcher <colin.m.fletcher@googlemail.com> | 2014-05-23 18:14:37 +0100 |
commit | 9daab3db8481de5653e97321c7bb2aa881f0d54c (patch) | |
tree | 651c946b0aab2b77be45bc46bbbaf8bf30c43fd2 /gtk2_ardour/export_file_notebook.cc | |
parent | 2f6debf0d2b78bd6399f9e28e98333e1fd1b05d3 (diff) |
Make Soundcloud upload applicable to any export format.
Add soundcloud_upload property back into ExportFormatSpecification, but
instead of making it settable in the export format specification dialog,
add a tick-box in each tab of ExportFileNotebook to allow setting it.
Diffstat (limited to 'gtk2_ardour/export_file_notebook.cc')
-rw-r--r-- | gtk2_ardour/export_file_notebook.cc | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/gtk2_ardour/export_file_notebook.cc b/gtk2_ardour/export_file_notebook.cc index 54c0f628c7..00e2687251 100644 --- a/gtk2_ardour/export_file_notebook.cc +++ b/gtk2_ardour/export_file_notebook.cc @@ -86,10 +86,31 @@ ExportFileNotebook::sync_with_manager () } set_current_page (0); + update_soundcloud_upload (); CriticalSelectionChanged (); } void +ExportFileNotebook::update_soundcloud_upload() +{ + int i; + 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; + 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; + } + } + +} + +void ExportFileNotebook::update_example_filenames() { int i = 0; @@ -177,6 +198,7 @@ ExportFileNotebook::FilePage::FilePage (Session * s, ManagerPtr profile_manager, format_label (_("Format"), Gtk::ALIGN_LEFT), filename_label (_("Location"), Gtk::ALIGN_LEFT), + soundcloud_upload_button (_("Upload to Soundcloud")), tab_number (number) { set_border_width (12); @@ -185,6 +207,7 @@ ExportFileNotebook::FilePage::FilePage (Session * s, ManagerPtr profile_manager, pack_start (format_align, false, false, 0); pack_start (filename_label, false, false, 0); pack_start (filename_align, false, false, 0); + pack_start (soundcloud_upload_button, false, false, 0); format_align.add (format_selector); format_align.set_padding (6, 12, 18, 0); @@ -219,6 +242,7 @@ ExportFileNotebook::FilePage::FilePage (Session * s, ManagerPtr profile_manager, filename_selector.CriticalSelectionChanged.connect ( sigc::mem_fun (*this, &ExportFileNotebook::FilePage::critical_selection_changed)); + soundcloud_upload_button.signal_toggled().connect (sigc::mem_fun (*parent, &ExportFileNotebook::update_soundcloud_upload)); /* Tab widget */ tab_close_button.add (*Gtk::manage (new Gtk::Image (::get_icon("close")))); @@ -255,6 +279,12 @@ ExportFileNotebook::FilePage::get_format_name () const return _("No format!"); } +bool +ExportFileNotebook::FilePage::get_soundcloud_upload () const +{ + return soundcloud_upload_button.get_active (); +} + void ExportFileNotebook::FilePage::save_format_to_manager (FormatPtr format) { |