diff options
author | Colin Fletcher <colin.m.fletcher@googlemail.com> | 2014-05-19 20:54:36 +0100 |
---|---|---|
committer | Colin Fletcher <colin.m.fletcher@googlemail.com> | 2014-05-19 20:54:36 +0100 |
commit | 5399425f534e2d96d07cf29f427bfa0f39d904b7 (patch) | |
tree | b2134c0b8e624b9df89904b942909ea3a688c563 /libs/ardour/ardour | |
parent | 529a31bde7d17cade6c942e11e098f2c37d984a3 (diff) | |
parent | c464feb6aa96226856305531fedb8fba2e06689e (diff) |
Merge branch 'export-dialog' into cairocanvas
Fix merge conflicts in:
gtk2_ardour/export_range_markers_dialog.cc
gtk2_ardour/wscript
libs/ardour/ardour/export_handler.h
libs/ardour/system_exec.cc
libs/pbd/pbd/system_exec.h
libs/pbd/system_exec.cc
Diffstat (limited to 'libs/ardour/ardour')
-rw-r--r-- | libs/ardour/ardour/export_format_manager.h | 2 | ||||
-rw-r--r-- | libs/ardour/ardour/export_format_specification.h | 6 | ||||
-rw-r--r-- | libs/ardour/ardour/export_handler.h | 16 | ||||
-rw-r--r-- | libs/ardour/ardour/soundcloud_upload.h | 55 | ||||
-rw-r--r-- | libs/ardour/ardour/system_exec.h | 1 |
5 files changed, 79 insertions, 1 deletions
diff --git a/libs/ardour/ardour/export_format_manager.h b/libs/ardour/ardour/export_format_manager.h index 9a95111509..dad7d84b72 100644 --- a/libs/ardour/ardour/export_format_manager.h +++ b/libs/ardour/ardour/export_format_manager.h @@ -100,6 +100,8 @@ class LIBARDOUR_API ExportFormatManager : public PBD::ScopedConnectionList void select_with_cue (bool); void select_with_toc (bool); + void select_upload (bool); + void set_command (std::string); void select_src_quality (ExportFormatBase::SRCQuality value); void select_trim_beginning (bool value); void select_silence_beginning (AnyTime const & time); diff --git a/libs/ardour/ardour/export_format_specification.h b/libs/ardour/ardour/export_format_specification.h index 1593990d35..d41fe3e97a 100644 --- a/libs/ardour/ardour/export_format_specification.h +++ b/libs/ardour/ardour/export_format_specification.h @@ -96,6 +96,8 @@ class LIBARDOUR_API ExportFormatSpecification : public ExportFormatBase { void set_tag (bool tag_it) { _tag = tag_it; } void set_with_cue (bool yn) { _with_cue = yn; } void set_with_toc (bool yn) { _with_toc = yn; } + void set_upload (bool yn) { _upload = yn; } + void set_command (std::string command) { _command = command; } void set_silence_beginning (AnyTime const & value) { _silence_beginning = value; } void set_silence_end (AnyTime const & value) { _silence_end = value; } @@ -125,6 +127,8 @@ class LIBARDOUR_API ExportFormatSpecification : public ExportFormatBase { float normalize_target () const { return _normalize_target; } bool with_toc() const { return _with_toc; } bool with_cue() const { return _with_cue; } + bool upload() const { return _upload; } + std::string command() const { return _command; } bool tag () const { return _tag && supports_tagging; } @@ -174,6 +178,8 @@ class LIBARDOUR_API ExportFormatSpecification : public ExportFormatBase { float _normalize_target; bool _with_toc; bool _with_cue; + bool _upload; + std::string _command; /* serialization helpers */ diff --git a/libs/ardour/ardour/export_handler.h b/libs/ardour/ardour/export_handler.h index 1bc80a80e9..25a87045a8 100644 --- a/libs/ardour/ardour/export_handler.h +++ b/libs/ardour/ardour/export_handler.h @@ -31,6 +31,7 @@ #include "ardour/session.h" #include "ardour/libardour_visibility.h" #include "ardour/types.h" +#include "pbd/signals.h" namespace AudioGrapher { class BroadcastInfo; @@ -68,7 +69,7 @@ class LIBARDOUR_API ExportElementFactory Session & session; }; -class LIBARDOUR_API ExportHandler : public ExportElementFactory +class LIBARDOUR_API ExportHandler : public ExportElementFactory, public sigc::trackable { public: struct FileSpec { @@ -95,6 +96,8 @@ class LIBARDOUR_API ExportHandler : public ExportElementFactory friend boost::shared_ptr<ExportHandler> Session::get_export_handler(); ExportHandler (Session & session); + void command_output(std::string output, size_t size); + public: ~ExportHandler (); @@ -105,6 +108,17 @@ class LIBARDOUR_API ExportHandler : public ExportElementFactory std::string get_cd_marker_filename(std::string filename, CDMarkerFormat format); + /** signal emitted when soundcloud export reports progress updates during upload. + * The parameters are total and current bytes downloaded, and the current filename + */ + PBD::Signal3<void, double, double, std::string> SoundcloudProgress; + + /* upload credentials & preferences */ + std::string upload_username; + std::string upload_password; + bool upload_public; + bool upload_open; + private: void handle_duplicate_format_extensions(); diff --git a/libs/ardour/ardour/soundcloud_upload.h b/libs/ardour/ardour/soundcloud_upload.h new file mode 100644 index 0000000000..6b8700e784 --- /dev/null +++ b/libs/ardour/ardour/soundcloud_upload.h @@ -0,0 +1,55 @@ +/* soundcloud_upload.h ****************************************************** + + Adapted for Ardour by Ben Loftis, March 2012 + +*****************************************************************************/ + +#ifndef __ardour_soundcloud_upload_h__ +#define __ardour_soundcloud_upload_h__ + +#include <string> +#include <fstream> +#include <iostream> +#include <stdio.h> +#include <cstring> +#include <string> +#include <sstream> +#include <vector> + +#include "curl/curl.h" +#include "ardour/session_handle.h" +#include "ardour/export_handler.h" +#include "pbd/signals.h" + +//--- struct to store XML file +struct MemoryStruct { + char *memory; + size_t size; +}; + + +class SoundcloudUploader +{ +public: + SoundcloudUploader(); + ~SoundcloudUploader(); + + std::string Get_Auth_Token(std::string username, std::string password); + std::string Upload (std::string file_path, std::string title, std::string token, bool ispublic, ARDOUR::ExportHandler *caller); + static int progress_callback(void *caller, double dltotal, double dlnow, double ultotal, double ulnow); + + +private: + + void setcUrlOptions(); + + CURL *curl_handle; + CURLM *multi_handle; + char errorBuffer[CURL_ERROR_SIZE]; // storage for cUrl error message + + std::string title; + ARDOUR::ExportHandler *caller; + +}; + +#endif /* __ardour_soundcloud_upload_h__ */ diff --git a/libs/ardour/ardour/system_exec.h b/libs/ardour/ardour/system_exec.h index 40e429720e..ae865c7bff 100644 --- a/libs/ardour/ardour/system_exec.h +++ b/libs/ardour/ardour/system_exec.h @@ -32,6 +32,7 @@ class LIBARDOUR_API SystemExec public: SystemExec (std::string c, std::string a = ""); SystemExec (std::string c, char ** a); + SystemExec (std::string c, const std::map<char, std::string> subs); ~SystemExec (); int start (int stderr_mode = 1) { |