mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-09 08:14:58 +01:00
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.
This commit is contained in:
parent
2f6debf0d2
commit
9daab3db84
4 changed files with 37 additions and 1 deletions
|
|
@ -86,9 +86,30 @@ ExportFileNotebook::sync_with_manager ()
|
||||||
}
|
}
|
||||||
|
|
||||||
set_current_page (0);
|
set_current_page (0);
|
||||||
|
update_soundcloud_upload ();
|
||||||
CriticalSelectionChanged ();
|
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
|
void
|
||||||
ExportFileNotebook::update_example_filenames()
|
ExportFileNotebook::update_example_filenames()
|
||||||
{
|
{
|
||||||
|
|
@ -177,6 +198,7 @@ ExportFileNotebook::FilePage::FilePage (Session * s, ManagerPtr profile_manager,
|
||||||
|
|
||||||
format_label (_("Format"), Gtk::ALIGN_LEFT),
|
format_label (_("Format"), Gtk::ALIGN_LEFT),
|
||||||
filename_label (_("Location"), Gtk::ALIGN_LEFT),
|
filename_label (_("Location"), Gtk::ALIGN_LEFT),
|
||||||
|
soundcloud_upload_button (_("Upload to Soundcloud")),
|
||||||
tab_number (number)
|
tab_number (number)
|
||||||
{
|
{
|
||||||
set_border_width (12);
|
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 (format_align, false, false, 0);
|
||||||
pack_start (filename_label, false, false, 0);
|
pack_start (filename_label, false, false, 0);
|
||||||
pack_start (filename_align, 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.add (format_selector);
|
||||||
format_align.set_padding (6, 12, 18, 0);
|
format_align.set_padding (6, 12, 18, 0);
|
||||||
|
|
@ -219,6 +242,7 @@ ExportFileNotebook::FilePage::FilePage (Session * s, ManagerPtr profile_manager,
|
||||||
filename_selector.CriticalSelectionChanged.connect (
|
filename_selector.CriticalSelectionChanged.connect (
|
||||||
sigc::mem_fun (*this, &ExportFileNotebook::FilePage::critical_selection_changed));
|
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 widget */
|
||||||
|
|
||||||
tab_close_button.add (*Gtk::manage (new Gtk::Image (::get_icon("close"))));
|
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!");
|
return _("No format!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
ExportFileNotebook::FilePage::get_soundcloud_upload () const
|
||||||
|
{
|
||||||
|
return soundcloud_upload_button.get_active ();
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ExportFileNotebook::FilePage::save_format_to_manager (FormatPtr format)
|
ExportFileNotebook::FilePage::save_format_to_manager (FormatPtr format)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -58,6 +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 add_file_page (ARDOUR::ExportProfileManager::FormatStatePtr format_state, ARDOUR::ExportProfileManager::FilenameStatePtr filename_state);
|
||||||
void remove_file_page (FilePage * page);
|
void remove_file_page (FilePage * page);
|
||||||
void update_remove_file_page_sensitivity ();
|
void update_remove_file_page_sensitivity ();
|
||||||
|
void update_soundcloud_upload();
|
||||||
|
|
||||||
sigc::connection page_change_connection;
|
sigc::connection page_change_connection;
|
||||||
void handle_page_change (GtkNotebookPage*, uint32_t page);
|
void handle_page_change (GtkNotebookPage*, uint32_t page);
|
||||||
|
|
@ -80,6 +81,7 @@ class ExportFileNotebook : public Gtk::Notebook, public ARDOUR::SessionHandlePtr
|
||||||
Gtk::Widget & get_tab_widget () { return tab_widget; }
|
Gtk::Widget & get_tab_widget () { return tab_widget; }
|
||||||
void set_remove_sensitive (bool value);
|
void set_remove_sensitive (bool value);
|
||||||
std::string get_format_name () const;
|
std::string get_format_name () const;
|
||||||
|
bool get_soundcloud_upload () const;
|
||||||
|
|
||||||
void update_example_filename();
|
void update_example_filename();
|
||||||
|
|
||||||
|
|
@ -108,6 +110,7 @@ class ExportFileNotebook : public Gtk::Notebook, public ARDOUR::SessionHandlePtr
|
||||||
Gtk::Alignment filename_align;
|
Gtk::Alignment filename_align;
|
||||||
ExportFilenameSelector filename_selector;
|
ExportFilenameSelector filename_selector;
|
||||||
|
|
||||||
|
Gtk::CheckButton soundcloud_upload_button;
|
||||||
Gtk::HBox tab_widget;
|
Gtk::HBox tab_widget;
|
||||||
Gtk::Label tab_label;
|
Gtk::Label tab_label;
|
||||||
Gtk::Alignment tab_close_alignment;
|
Gtk::Alignment tab_close_alignment;
|
||||||
|
|
|
||||||
|
|
@ -96,6 +96,7 @@ class LIBARDOUR_API ExportFormatSpecification : public ExportFormatBase {
|
||||||
void set_tag (bool tag_it) { _tag = tag_it; }
|
void set_tag (bool tag_it) { _tag = tag_it; }
|
||||||
void set_with_cue (bool yn) { _with_cue = yn; }
|
void set_with_cue (bool yn) { _with_cue = yn; }
|
||||||
void set_with_toc (bool yn) { _with_toc = yn; }
|
void set_with_toc (bool yn) { _with_toc = yn; }
|
||||||
|
void set_soundcloud_upload (bool yn) { _soundcloud_upload = yn; }
|
||||||
void set_command (std::string command) { _command = command; }
|
void set_command (std::string command) { _command = command; }
|
||||||
|
|
||||||
void set_silence_beginning (AnyTime const & value) { _silence_beginning = value; }
|
void set_silence_beginning (AnyTime const & value) { _silence_beginning = value; }
|
||||||
|
|
@ -126,6 +127,7 @@ class LIBARDOUR_API ExportFormatSpecification : public ExportFormatBase {
|
||||||
float normalize_target () const { return _normalize_target; }
|
float normalize_target () const { return _normalize_target; }
|
||||||
bool with_toc() const { return _with_toc; }
|
bool with_toc() const { return _with_toc; }
|
||||||
bool with_cue() const { return _with_cue; }
|
bool with_cue() const { return _with_cue; }
|
||||||
|
bool soundcloud_upload() const { return _soundcloud_upload; }
|
||||||
std::string command() const { return _command; }
|
std::string command() const { return _command; }
|
||||||
|
|
||||||
bool tag () const { return _tag && supports_tagging; }
|
bool tag () const { return _tag && supports_tagging; }
|
||||||
|
|
@ -176,6 +178,7 @@ class LIBARDOUR_API ExportFormatSpecification : public ExportFormatBase {
|
||||||
float _normalize_target;
|
float _normalize_target;
|
||||||
bool _with_toc;
|
bool _with_toc;
|
||||||
bool _with_cue;
|
bool _with_cue;
|
||||||
|
bool _soundcloud_upload;
|
||||||
std::string _command;
|
std::string _command;
|
||||||
|
|
||||||
/* serialization helpers */
|
/* serialization helpers */
|
||||||
|
|
|
||||||
|
|
@ -345,7 +345,7 @@ ExportHandler::finish_timespan ()
|
||||||
delete (se);
|
delete (se);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fmt->upload()) {
|
if (fmt->soundcloud_upload()) {
|
||||||
SoundcloudUploader *soundcloud_uploader = new SoundcloudUploader;
|
SoundcloudUploader *soundcloud_uploader = new SoundcloudUploader;
|
||||||
std::string token = soundcloud_uploader->Get_Auth_Token(upload_username, upload_password);
|
std::string token = soundcloud_uploader->Get_Auth_Token(upload_username, upload_password);
|
||||||
std::cerr
|
std::cerr
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue