freesound-juce
A JUCE client for accessing the Freesound API
Public Member Functions | List of all members
FreesoundClientComponent Class Reference

A freesound client component for use in GUI. More...

#include <FreesoundAPI.h>

Inheritance diagram for FreesoundClientComponent:
FreesoundClient

Public Member Functions

void startAuthentication (int mode=0)
 Starts the authentication. More...
 
void pageFinishedLoading (const String &url, Callback authCallback=[] {})
 Called when the authentication page finished loading. More...
 
void pageLoadHadNetworkError ()
 Called when loading the page didn't go as expected. More...
 
- Public Member Functions inherited from FreesoundClient
 FreesoundClient ()
 Empty construtctor. More...
 
 FreesoundClient (String secret)
 Constructor for token based authorization. More...
 
 FreesoundClient (String id, String secret)
 Constructor for OAuth2 authorization. More...
 
void authenticationOnBrowser (int mode=0, Callback cb=[] {})
 Performs the first step of the authorization on the browser. More...
 
void exchangeToken (String authCode, Callback cb=[] {})
 Exchange token is the 3rd step of the authorization proccess, where the authorization code is exchanged for an access token. More...
 
void refreshAccessToken (Callback cb=[] {})
 Function for refreshing the access token, which expires in 24h. More...
 
SoundList textSearch (String query, String filter=String(), String sort="score", int groupByPack=0, int page=-1, int pageSize=-1, String fields=String(), String descriptors=String(), int normalized=0)
 This resource allows searching sounds in Freesound by matching their tags and other kinds of metadata. More...
 
SoundList contentSearch (String target, String descriptorsFilter=String(), int page=-1, int pageSize=-1, String fields=String(), String descriptors=String(), int normalized=0)
 Content search. More...
 
FSList fetchNextPage (FSList fslist)
 Gets the next page of a SoundList. More...
 
FSList fetchPreviousPage (FSList fslist)
 Gets the previous page of a FSList. More...
 
SoundList fetchNextPage (SoundList fslist)
 Gets the next page of a SoundList. More...
 
SoundList fetchPreviousPage (SoundList fslist)
 Gets the previous page of a SoundList. More...
 
FSSound getSound (String id, String fields=String())
 Gets a sound instance from its id. More...
 
var getSoundAnalysis (String id, String descriptors=String(), int normalized=0)
 Retrieves of analysis information (content-based descriptors) of a sound. More...
 
SoundList getSimilarSounds (String id, String descriptorsFilter=String(), int page=-1, int pageSize=-1, String fields=String(), String descriptors=String(), int normalized=0)
 This resource allows the retrieval of sounds similar to the given sound target. More...
 
URL::DownloadTask * downloadSound (FSSound sound, const File &location, URL::DownloadTask::Listener *listener=nullptr)
 This resource allows you to download a sound in its original format/quality. More...
 
int uploadSound (const File &fileToUpload, String tags, String description, String name=String(), String license="Creative Commons 0", String pack=String(), String geotag=String(), Callback cb=[] {})
 Uploads a sound to Freesound. More...
 
int describeSound (String uploadFilename, String description, String license, String name=String(), String tags=String(), String pack=String(), String geotag=String())
 Describe sound. More...
 
var pendingUploads ()
 This resource allows you to retrieve a list of audio files uploaded by the Freesound user logged in using OAuth2 that have not yet been described, processed or moderated. More...
 
void editSoundDescription (String id, String name=String(), String tags=String(), String description=String(), String license=String(), String pack=String(), String geotag=String(), Callback cb=[] {})
 Edit sound description. More...
 
void bookmarkSound (String id, String name=String(), String category=String(), Callback cb=[] {})
 This resource allows you to bookmark an existing sound. More...
 
void rateSound (String id, int rating, Callback cb=[] {})
 This resource allows you to rate an existing sound. More...
 
void commentSound (String id, String comment, Callback cb=[] {})
 This resource allows you to post a comment to an existing sound. More...
 
FSUser getUser (String user)
 This resource allows the retrieval of information about a particular Freesound user. More...
 
SoundList getUserSounds (String username, String descriptorsFilter=String(), int page=-1, int pageSize=-1, String fields=String(), String descriptors=String(), int normalized=0)
 This resource allows the retrieval of a list of sounds uploaded by a particular Freesound user. More...
 
FSList getUserBookmarkCategories (String username)
 This resource allows the retrieval of a list of bookmark categories created by a particular Freesound user. More...
 
FSList getUserBookmarkCategoriesSounds (String username, String bookmarkCategory)
 This resource allows the retrieval of a list of sounds from a bookmark category created by a particular Freesound user. More...
 
FSList getUserPacks (String username)
 This resource allows the retrieval of a list of packs created by a particular Freesound user. More...
 
FSPack getPack (String id)
 This resource allows the retrieval of a list of packs created by a particular Freesound user. More...
 
SoundList getPackSounds (String id, String descriptorsFilter=String(), int page=-1, int pageSize=-1, String fields=String(), String descriptors=String(), int normalized=0)
 This resource allows the retrieval of information about a pack. More...
 
URL::DownloadTask * downloadPack (FSPack pack, const File &location, URL::DownloadTask::Listener *listener=nullptr)
 This resource allows you to download all the sounds of a pack in a single zip file. More...
 
FSUser getMe ()
 Returnes a FSUser instance of the authenticated user. More...
 
bool isTokenNotEmpty ()
 Queries if the token is not empty. More...
 
String getToken ()
 Gets the authentication token. More...
 
String getHeader ()
 Gets the authentication header. More...
 
String getClientID ()
 Gets client identifier. More...
 

Detailed Description

A freesound client component for use in GUI.

Author
Antonio
Date
09/07/2019

Member Function Documentation

◆ pageFinishedLoading()

void FreesoundClientComponent::pageFinishedLoading ( const String &  url,
Callback  authCallback = [] {} 
)

Called when the authentication page finished loading.

Author
Antonio
Date
09/07/2019
Parameters
urlURL of the page.
authCallback(Optional) The authentication finished callback.

◆ pageLoadHadNetworkError()

void FreesoundClientComponent::pageLoadHadNetworkError ( )

Called when loading the page didn't go as expected.

Author
Antonio
Date
09/07/2019

◆ startAuthentication()

void FreesoundClientComponent::startAuthentication ( int  mode = 0)

Starts the authentication.

Author
Antonio
Date
09/07/2019
Parameters
mode(Optional) The mode, 0 for logout and authorize, 1 for authorize only.

The documentation for this class was generated from the following files: