summaryrefslogtreecommitdiff
path: root/libs/ardour/ardour/soundcloud_upload.h
diff options
context:
space:
mode:
authorColin Fletcher <colin.m.fletcher@googlemail.com>2013-10-07 14:44:35 +0100
committerColin Fletcher <colin.m.fletcher@googlemail.com>2013-10-07 14:59:40 +0100
commita3465ff5d3b830e79a0e383b3c85df0c8cc3af9e (patch)
tree1872ca71bce4a93eb1433d7d6d4637df843a844b /libs/ardour/ardour/soundcloud_upload.h
parent15b4ebbb074ce679c5ea7fb44061934fe572cad5 (diff)
Working Soundcloud export
Adds an 'upload' property to ExportFormatSpecification, to indicate that files exported with that format specfication should be uploaded to Soundcloud, and makes it editable in the export format dialogue. Adds fields for the Soundcloud username & password to the file format selection page, as well as an option to make the uploaded files public and open them in the system browser. Possible improvements not yet implemented: - make upload happen in its own thread - cosmetic tidying up of dialogue control layout - remember username & password
Diffstat (limited to 'libs/ardour/ardour/soundcloud_upload.h')
-rw-r--r--libs/ardour/ardour/soundcloud_upload.h55
1 files changed, 55 insertions, 0 deletions
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__ */