Commit Graph

45 Commits

Author SHA1 Message Date
Paul Davis 8857abc028 ensure that freesound token dialog is always on top (of similar windows) 2022-11-02 09:19:16 -06:00
Robin Gareus a9b785d89c
Fix typos - #9000 2022-10-17 15:57:01 +02:00
Paul Davis e8e21b3152 NOOP: fix comment for abort-after-fatal to follow norms 2022-06-22 13:31:08 -06:00
Paul Davis 22e77130e2 use new macros to cleanup #ifndef NDEBUG as much as possible (GUI edition) 2022-06-22 13:31:08 -06:00
Paul Davis a78fbf919d fix optimized unused variable warning 2022-06-22 13:31:07 -06:00
Robin Gareus 7fa207d9ee
Add UI config-option for freesound download cache
This also invalidates any prior libardour rc-config
(which was not previously exposed as config).

Note: old existing cache is not moved or invalidated
when the path changes.
2022-05-20 22:03:14 +02:00
Robin Gareus f925dd675e
Setup Freesound certificates for bundled builds 2022-05-20 22:03:14 +02:00
Robin Gareus 5f1a06f2aa
NO-OP sort includes - fixes macOS and --no-nls builds
Ardour's "pbd/i18n.h" needs to be included last,
after all template specialization, otherwise there will be
an ambiguity:

```
boost/function_types/detail/class_transform.hpp:23:26:
  error: ‘boost::mpl::placeholders::_’ has not been declared
  using mpl::placeholders::_;
```
2022-05-20 22:03:14 +02:00
Colin Fletcher 9fe0a4f4dd freesound: update to API v2
Add a new client id & token for Ardour 7, and update to Freesound's API
v2.

Implement OAuth authentication for Freesound downloads, as described at:
https://freesound.org/docs/api/authentication.html#oauth-authentication

Open the Freesound login page in the default browser, so that the user
can log in and get an authorization code, to copy-&-paste from the
browser. Exchange this authorization code for an access token, and use
it in a custom 'Authorization: Bearer $TOKEN' http header.

If logging in to Freesound to download a file fails or is cancelled,
clear the 'downloading' flag for that file in the list so that a
subsequent click on it will try to log in again.

Show login progress in download progress bar, and disable preview if
file hasn't yet been downloaded.

If a download fails for any reason (except the user cancelling it),
report an error in the Log window.

Use curl_free() for pointers returned by curl_easy_escape(), as per the
curl documentation, rather than plain free().

Also, don't use the www. sub-domain of freesound.org: although it
appears to work for most things, it returns an empty document from
https://freesound.org/apiv2/oauth2/access_token/

Remove default empty token value from Mootcher constructor, to make it
explicit when we construct a Mootcher that doesn't require
authorisation, by requiring an empty token parameter in that case.
2022-05-20 14:33:57 +01:00
luz paz 3d395585c1
Fix various typos
Found via `codespell -q 3 -S *.po,./share/patchfiles,./libs -L ba,buss,busses,doubleclick,hsi,ontop,ro,seh,siz,sord,sur,te,trough,ue`  
Follow-up to 364f2f078
2022-04-08 19:51:02 +02:00
Robin Gareus 31815b5f26
NO-OP: whitespace
This fixes mostly <tab> after <space> and similar <tab> not used
for indenting as well as some related code alignment issues.
2019-04-13 17:57:46 +02:00
Robin Gareus e544934780 Call curl_global_init() exactly only once (1/2) 2017-08-31 20:08:47 +02:00
Tim Mayberry 3193aa93ce Rename Struct defined in freesound header to be less generic
This could potentially conflict with a struct declared in the
ardour/soundcloud_upload.h file.
2016-09-13 14:55:02 +10:00
Paul Davis cf52d6e4b4 enough with umpteen "i18n.h" files. Consolidate on pbd/i18n.h 2016-07-14 14:45:23 -04:00
Robin Gareus 2397429e99 use quotes for in-tree pbd/glib wrapper include 2015-10-05 22:15:18 +02:00
Robin Gareus 22b07e0233 NOOP, remove trailing tabs/whitespace. 2015-10-05 16:17:49 +02:00
Paul Davis 4dc63966f0 globally remove all trailing whitespace from ardour code base.
Paul Davis was responsible for introducing almost all of this.
2015-10-04 14:51:05 -04:00
Robin Gareus f27800ea41 use pbd's gstdio compatibility wrapper (GUI) 2015-09-17 14:38:09 +02:00
David Robillard dbc2f59453 Remove pointless register specifier and warning. 2014-12-28 16:06:44 -05:00
Colin Fletcher 8ebd8a99ab Fix MS-DOS line endings
Somehow sfdb_freesound_mootcher.cc has ended up with MS-DOS style line
endings again. Put it back to UNIX-style.
2014-05-23 17:42:34 +01:00
John Emmas 5568026387 'gtk2_ardour' - Harmonize '__WIN32__', 'OS_WIN32' etc, etc. Use 'PLATFORM_WINDOWS' instead 2013-10-14 17:00:28 +01:00
Colin Fletcher 7ba817e36f Amend comment to 'delete this'
Amend comment to 'delete this' to describe why I think it's OK.
2013-06-21 21:33:56 +01:00
Colin Fletcher 8ad4924b7f Use connect(..., gui_thread()) rather than g_idle_add().
Use the proper functions to ensure things happen in the main gui thread,
instead of fudging around with g_idle_add().
2013-06-21 21:30:52 +01:00
Colin Fletcher 0483803186 Further Freesound tweaks.
Make download of sound files multi-threaded. Each sound file download takes
place in its own thread, and has its own progress bar and cancel button,
which stack up from the bottom of the list of results.
Sound files download into a file with a '.part' suffix, which is then
renamed to the intended name on success.
Add a 'Similar' button, which searches Freesound for sounds similar to the
currently-selected sound in the results list.
2013-06-21 21:30:52 +01:00
Colin Fletcher 1eff5a8215 Use config variable for Freesound download folder location.
Use the new freesound-download-dir config variable to decide the location
of sound files downloaded from Freesound.
Move the Windows-specific logic to replace '/'s with '\'s from
Mootcher::changeWorkingDir() to Mootcher::ensureWorkingDir(), and remove
the now unused Mootcher::changeWorkingDir().
Use Glib::build_filename to construct the path.
2013-06-21 21:30:52 +01:00
Colin Fletcher 2233e91086 Freesound fixes for #5853, and a few other small improvements
Add a 'More' button to load the next page of results without clearing the already-found list.
Don't allow cancellation of searches, and don't update progress bar around searches, since we only get one page at a time now.
Show number of pages of results remaining to download in the tooltip of the 'More' button.
Use a new Mootcher object for each request, to avoid bad things happening when clicking in the Freesound search results list while a search or file download is already in progress.
Make the 'Stop' button insensitive except when it will actually stop the download of a sound file.
Only retrieve one page worth of data per search, rather than looping to get all pages.
Don't show an error in the log window if the user cancelled download.
Request 100 items per page, rather than the default 30.
Fix DOS line endings.
2013-03-17 12:33:59 +00:00
Robin Gareus 57b673a9d7 freesound display license
git-svn-id: svn://localhost/ardour2/branches/3.0@13701 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-12-21 19:32:19 +00:00
Robin Gareus 6d57f7e926 freesound import - various small tweaks
* quote search string
 * show filesize
 * include samplerate in list
 * filter out mp3s on Linux
 * decrease layout-spacing and shorten progressbar txt.

git-svn-id: svn://localhost/ardour2/branches/3.0@13700 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-12-21 17:28:44 +00:00
Robin Gareus cea21cab7e fix freesound URL parameter escape
git-svn-id: svn://localhost/ardour2/branches/3.0@13698 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-12-21 13:44:53 +00:00
Paul Davis 98834c0532 remove a bunch of cerr output and/or convert to use error<<
git-svn-id: svn://localhost/ardour2/branches/3.0@13477 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-11-13 15:11:07 +00:00
Tim Mayberry 6b62959ba0 Replace use of pbd/filesystem.h with Glib equivalent in Mootcher class
git-svn-id: svn://localhost/ardour2/branches/3.0@12886 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-06-23 05:09:08 +00:00
Paul Davis 4235e9a1a2 a variety of mostly unused parameter errors from OS X Lion's compiler
git-svn-id: svn://localhost/ardour2/branches/3.0@12148 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-05-02 20:29:46 +00:00
Carl Hetherington d23a97a6ac Clean up possibly-null pointer dereference (#4812).
git-svn-id: svn://localhost/ardour2/branches/3.0@11813 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-04-07 02:08:18 +00:00
Ben Loftis 164db566b0 various tweaks to Freesound UI and code. keep a single mootcher to speed up operations; add text to progress bar, stop storing xml files, auto-increment pages until user clicks stop.
git-svn-id: svn://localhost/ardour2/branches/3.0@11801 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-04-05 21:31:55 +00:00
Paul Davis 0eb97bcae7 use g_fopen()
git-svn-id: svn://localhost/ardour2/branches/3.0@11670 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-03-13 20:15:37 +00:00
Carl Hetherington c23a34a5a5 Freesound tweaks from colinf (#4761).
git-svn-id: svn://localhost/ardour2/branches/3.0@11636 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-03-09 22:02:48 +00:00
Paul Davis 577469a06a colinf's 2011-12-08 patch for freesound mootcher (add stop, remove URI, clear barberpole, etc)
git-svn-id: svn://localhost/ardour2/branches/3.0@11265 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-01-18 18:43:43 +00:00
Carl Hetherington e41d64724c Create Freesound working directory a little more lazily so
that a Freesound directory doesn't appear in /home/carl
without ever using Freesound.


git-svn-id: svn://localhost/ardour2/branches/3.0@11090 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-12-27 14:36:14 +00:00
Paul Davis 1d984b7985 the return of basic FreeSound mootcher functionality, c/o colinf. lots of bugs and workflow issues to still resolve, but good to play with. remember that ardour can't play mp3's
git-svn-id: svn://localhost/ardour2/branches/3.0@10596 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-11-14 22:04:14 +00:00
David Robillard ed626628b5 Delete trailing whitespace
git-svn-id: svn://localhost/ardour2/branches/3.0@9656 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-06-01 17:00:29 +00:00
Paul Davis 4a46fccc68 freesound mootcher patch from donf, from 2.X
git-svn-id: svn://localhost/ardour2/branches/3.0@5701 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-10-01 16:21:23 +00:00
Sampo Savolainen cd3de6c9bc Missing namespaces
git-svn-id: svn://localhost/ardour2/branches/3.0@5176 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-06-13 12:58:34 +00:00
David Robillard e0aaed6d65 *** NEW CODING POLICY ***
All #include statements that include a header that is a part of a library
bundled with ardour MUST use quotes, not angle brackets.

Do this:

#include "ardour/types.h"

NOT this:

#include <ardour/types.h>

Rationale:

This is best practice in general, to ensure we include the local version
and not the system version.  That quotes mean "local" (in some sense)
and angle brackets mean "system" (in some sense) is a ubiquitous
convention and IIRC right in the C spec somewhere.

More pragmatically, this is required by (my) waf (stuff) for dependencies
to work correctly.  That is:

!!! FAILURE TO DO THIS CAN RESULT IN BROKEN BUILDS !!!

Failure to comply is punishable by death by torture. :)

P.S. It's not that dramatic in all cases, but this (in combination with some
GCC flags specific to the include type) is the best way I have found to be
absolutely 100% positive the local ones are being used (and we definitely
want to be absolutely 100% positive on that one).


git-svn-id: svn://localhost/ardour2/branches/3.0@4655 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-02-25 18:26:51 +00:00
Paul Davis c944de1d3e fix URL's for freesound (debian patch)
git-svn-id: svn://localhost/ardour2/branches/3.0@3907 d708f5d6-7413-0410-9779-e7cbd77b26cf
2008-10-10 09:53:03 +00:00
Paul Davis cb41314642 merge 3.0 from 2.0-ongoing@3243
git-svn-id: svn://localhost/ardour2/branches/3.0@3248 d708f5d6-7413-0410-9779-e7cbd77b26cf
2008-04-11 14:06:50 +00:00