diff --git a/docs/html/ConfigHandler_8cpp.html b/docs/html/ConfigHandler_8cpp.html index 6d0711f..7d3c598 100644 --- a/docs/html/ConfigHandler_8cpp.html +++ b/docs/html/ConfigHandler_8cpp.html @@ -5,7 +5,7 @@ -
Class ConfigHandler implementation. +
Class ConfigHandler implementation. More...
-#include "ConfigHandler.h"
Class ConfigHandler implementation.
+Class ConfigHandler implementation.
Class ConfigHandler definition. +
Class ConfigHandler definition. More...
#include <stdlib.h>
#include <memory>
#include <string>
#include "../lib/SimpleIni/SimpleIni.h"
#include "Result.h"
#include "Types/Result.h"
Go to the source code of this file.
Classes | |
class | ConfigHandler |
Singleton class which provides shared access to the configuration file used. More... | |
Class ConfigHandler definition.
+Class ConfigHandler definition.
+ VirtualJukebox
+
+ |
+
Class DataStore definition. +More...
+#include "Types/GlobalTypes.h"
#include "Types/Queue.h"
#include "Types/Result.h"
#include "Types/Tracks.h"
#include "Types/User.h"
Go to the source code of this file.
++Classes | |
class | DataStore |
Interface for storing Data such as Tracks, Users, Votes, etc. More... | |
Class DataStore definition.
+ +
+ VirtualJukebox
+
+ |
+
Class JukeBox implementation. +
Class JukeBox implementation. More...
#include "JukeBox.h"
#include <iostream>
#include <ctime>
#include <memory>
#include "ConfigHandler.h"
#include "GlobalTypes.h"
#include "Result.h"
#include "Datastore/RAMDataStore.h"
#include "Network/RestAPI.h"
#include "Spotify/SpotifyBackend.h"
#include "Types/User.h"
#include "Utils/ConfigHandler.h"
#include "Utils/LoggingHandler.h"
Class JukeBox definition. +
Class JukeBox definition. More...
#include <string>
#include <variant>
#include <vector>
#include "GlobalTypes.h"
#include "DataStore.h"
#include "MusicBackend.h"
#include "NetworkAPI.h"
#include "NetworkListener.h"
#include "Queue.h"
#include "Result.h"
#include "Track.h"
#include "Types/GlobalTypes.h"
#include "Types/Queue.h"
#include "Types/Result.h"
#include "Utils/SimpleScheduler.h"
Go to the source code of this file.
Classes | |
class | JukeBox |
Core class which combines all interface implementations in a working server application. More... | |
Class LoggingHandler implementation. +
LoggingHandler implementation. More...
-Class LoggingHandler implementation.
+#include "Utils/LoggingHandler.h"
#include <glog/logging.h>
#include <string>
#include "Utils/ConfigHandler.h"
+Functions | |
+void | initLoggingHandler (string const &exe) |
LoggingHandler implementation.
Class LoggingHandler definition. +
LoggingHandler header file. More...
#include <string>
Go to the source code of this file.
-Classes | |
class | LoggingHandler |
+Functions | |
+void | initLoggingHandler (std::string const &exe) |
Class LoggingHandler definition.
+LoggingHandler header file.
Interface for MusicBackends. +
Interface for MusicBackend. More...
#include <memory>
#include <vector>
#include "GlobalTypes.h"
#include "PlaybackTrack.h"
#include "Queue.h"
#include "Result.h"
#include "Track.h"
#include "Types/GlobalTypes.h"
#include "Types/Queue.h"
#include "Types/Result.h"
Go to the source code of this file.
Classes | |
class | MusicBackend |
Provides an abstracted interface to a MusicBackend s. More... | |
Interface for MusicBackends.
+Interface for MusicBackend.
#include <string>
#include <variant>
#include <vector>
#include "GlobalTypes.h"
#include "Queue.h"
#include "Result.h"
#include "Track.h"
#include "Types/GlobalTypes.h"
#include "Types/Queue.h"
#include "Types/Result.h"
Go to the source code of this file.
class | NetworkListener |
Provides interface methods for all supported requests. More... | |
-Typedefs | |
-using | Queues = Queue |
Type for multiple queues. | |
Interface Class NetworkListener definition.
diff --git a/docs/html/NetworkListener_8h_source.html b/docs/html/NetworkListener_8h_source.html index 63c2d1e..2a6d3df 100644 --- a/docs/html/NetworkListener_8h_source.html +++ b/docs/html/NetworkListener_8h_source.html @@ -79,67 +79,61 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Class Queue definition. +
Class Queue definition. More...
- +Go to the source code of this file.
Classes | |
class | Queue |
struct | Queue |
Respresents a queue which is returned to the clients. More... | |
struct | QueueStatus |
Wraps all information to return if a client requests the current queue status. More... | |
+ VirtualJukebox
+
+ |
+
Class RAMDataStore implementation. +More...
+#include <mutex>
#include <shared_mutex>
#include <string>
#include <variant>
#include <vector>
#include "DataStore.h"
#include "Types/GlobalTypes.h"
#include "Types/Queue.h"
#include "Types/Result.h"
#include "Types/Tracks.h"
#include "Types/User.h"
Go to the source code of this file.
++Classes | |
class | RAMDataStore |
Implements a DataStore which stores its data purly in RAM (no persistance). More... | |
Class RAMDataStore implementation.
+Class RAMDataStore definition.
+ +
+ VirtualJukebox
+
+ |
+
+ VirtualJukebox
+
+ |
+
Definition of class RequestInformation. +More...
+#include <httpserver.hpp>
#include <map>
#include <string>
Go to the source code of this file.
++Classes | |
struct | RequestInformation |
Wraps all relevant pieces of information provided by a HTTP request. More... | |
struct | ResponseInformation |
Wraps all needed pieces of information to form a proper HTTP response. More... | |
Definition of class RequestInformation.
+ +
+ VirtualJukebox
+
+ |
+
#include "RestAPI.h"
#include <sstream>
#include "ConfigHandler.h"
#include "RestEndpointHandler.h"
#include "RestRequestHandler.h"
#include "Utils/ConfigHandler.h"
Implementation of class RestAPI.
diff --git a/docs/html/RestAPI_8h.html b/docs/html/RestAPI_8h.html index 8334cbb..f53633f 100644 --- a/docs/html/RestAPI_8h.html +++ b/docs/html/RestAPI_8h.html @@ -5,7 +5,7 @@ -
+ VirtualJukebox
+
+ |
+
Handler functions for all available REST endpoints. +More...
+#include "RestEndpointHandlers.h"
#include <iostream>
#include "Utils/Serializer.h"
#include "json/json.hpp"
+Typedefs | |
+using | json = nlohmann::json |
+Functions | |
+const ResponseInformation | generateSessionHandler (NetworkListener *listener, RequestInformation const &infos) |
+const ResponseInformation | queryTracksHandler (NetworkListener *listener, RequestInformation const &infos) |
+const ResponseInformation | getCurrentQueuesHandler (NetworkListener *listener, RequestInformation const &infos) |
+const ResponseInformation | addTrackToQueueHandler (NetworkListener *listener, RequestInformation const &infos) |
+const ResponseInformation | voteTrackHandler (NetworkListener *listener, RequestInformation const &infos) |
+const ResponseInformation | controlPlayerHandler (NetworkListener *listener, RequestInformation const &infos) |
+const ResponseInformation | moveTracksHandler (NetworkListener *listener, RequestInformation const &infos) |
+const ResponseInformation | removeTrackHandler (NetworkListener *listener, RequestInformation const &infos) |
Handler functions for all available REST endpoints.
+ +#define PARSE_OPTIONAL_INT_PARAMETER | +( | ++ | name, | +
+ | + | + | args | +
+ | ) | ++ |
#define PARSE_OPTIONAL_STRING_FIELD | +( | ++ | name, | +
+ | + | + | body | +
+ | ) | ++ |
#define PARSE_REQUIRED_INT_FIELD | +( | ++ | name, | +
+ | + | + | body | +
+ | ) | ++ |
#define PARSE_REQUIRED_STRING_FIELD | +( | ++ | name, | +
+ | + | + | body | +
+ | ) | ++ |
#define PARSE_REQUIRED_STRING_PARAMETER | +( | ++ | name, | +
+ | + | + | args | +
+ | ) | ++ |
+ VirtualJukebox
+
+ |
+
Handler functions for all available REST endpoints. +More...
+ +Go to the source code of this file.
++Typedefs | |
+typedef const ResponseInformation(* | TEndpointHandler) (NetworkListener *, RequestInformation const &) |
+Functions | |
+const ResponseInformation | generateSessionHandler (NetworkListener *, RequestInformation const &) |
+const ResponseInformation | queryTracksHandler (NetworkListener *, RequestInformation const &) |
+const ResponseInformation | getCurrentQueuesHandler (NetworkListener *, RequestInformation const &) |
+const ResponseInformation | addTrackToQueueHandler (NetworkListener *, RequestInformation const &) |
+const ResponseInformation | voteTrackHandler (NetworkListener *, RequestInformation const &) |
+const ResponseInformation | controlPlayerHandler (NetworkListener *, RequestInformation const &) |
+const ResponseInformation | moveTracksHandler (NetworkListener *, RequestInformation const &) |
+const ResponseInformation | removeTrackHandler (NetworkListener *, RequestInformation const &) |
Handler functions for all available REST endpoints.
+ +
+ VirtualJukebox
+
+ |
+
+ VirtualJukebox
+
+ |
+
Implementation of class RestRequestHandler. +More...
+#include "RestRequestHandler.h"
#include <glog/logging.h>
#include <cassert>
#include <iostream>
#include <sstream>
#include "RestEndpointHandlers.h"
#include "Utils/LoggingHandler.h"
#include "json/json.hpp"
+Typedefs | |
+using | json = nlohmann::json |
Implementation of class RestRequestHandler.
+ +
+ VirtualJukebox
+
+ |
+
Definition of class RestRequestHandler. +More...
+#include <httpserver.hpp>
#include <map>
#include <optional>
#include "NetworkListener.h"
#include "RequestInformation.h"
Go to the source code of this file.
++Classes | |
class | RestRequestHandler |
Provides a REST request handler for incoming connections. More... | |
Definition of class RestRequestHandler.
+ +
+ VirtualJukebox
+
+ |
+
Defines function return values and types. More...
-#include <iostream>
#include <glog/logging.h>
#include <iostream>
#include <optional>
#include <string>
#include <variant>
Functions | |
bool | checkOptionalError (TResultOpt ret) |
Checks if given parameter contains optional error value. If so, it prints the containing error message. More... | |
template<class GOOD_TYPE > | |
bool | checkAlternativeError (TResult< GOOD_TYPE > &ret) |
Checks if given parameter contains alternative error value. If so, it prints the containing error message. More... | |
Defines function return values and types.
@@ -162,23 +181,25 @@bool checkOptionalError | +bool checkAlternativeError | ( | -TResultOpt | +TResult< GOOD_TYPE > & | ret | ) |
Checks if given parameter contains optional error value. If so, it prints the containing error message.
+Checks if given parameter contains alternative error value. If so, it prints the containing error message.
+ VirtualJukebox
+
+ |
+
Implementation of class Serializer. +More...
++Typedefs | |
+using | json = nlohmann::json |
Implementation of class Serializer.
+ +
+ VirtualJukebox
+
+ |
+
Definition of class Serializer. +More...
+#include "json/json.hpp"
Go to the source code of this file.
++Classes | |
class | Serializer |
Template class which can be used as a central class for serialization routines for different data types. More... | |
Definition of class Serializer.
+ +
+ VirtualJukebox
+
+ |
+
+ VirtualJukebox
+
+ |
+
Class SimpleScheduler implementation. +More...
+Class SimpleScheduler implementation.
+ +
+ VirtualJukebox
+
+ |
+
Class SimpleScheduler definition. +More...
+#include <memory>
#include <shared_mutex>
#include <string>
#include <thread>
#include "DataStore.h"
#include "MusicBackend.h"
#include "Types/Result.h"
Go to the source code of this file.
++Classes | |
class | SimpleScheduler |
A simple track scheduler (for presentation purposes). More... | |
Class SimpleScheduler definition.
+ +
+ VirtualJukebox
+
+ |
+
+ VirtualJukebox
+
+ |
+
Contains Structures for the Spotify Api implementation. +More...
+Contains Structures for the Spotify Api implementation.
+ +These Structures are implemented as described the Spotify Object Model Link: https://developer.spotify.com/documentation/web-api/reference/object-model/ Some structures doesn't contain the whole information given in the object model
+
+ VirtualJukebox
+
+ |
+
Contains Structures for the Spotify Api. +More...
+#include <string>
#include <vector>
#include "json/json.hpp"
Go to the source code of this file.
++Classes | |
class | SpotifyApi::Token |
return type on valid token request More... | |
class | SpotifyApi::Device |
Device Object. More... | |
class | SpotifyApi::Devices |
Wrapper class for multiple devices. More... | |
class | SpotifyApi::Artist |
Simplified artist object. More... | |
class | SpotifyApi::Image |
Spotify Image Class. More... | |
class | SpotifyApi::Album |
Simplified Spotify Album class. More... | |
class | SpotifyApi::Track |
Simplified track object. More... | |
class | SpotifyApi::Playback |
Contains infos about the actual playback. More... | |
class | SpotifyApi::SpotifyPaging |
Represents one page of search results. More... | |
class | SpotifyApi::SpotifyError |
Error type. More... | |
class | SpotifyApi::SpotifyDummy |
Type gets used, when no content data or Error is received. More... | |
+Enumerations | |
enum | SpotifyApi::GrantType { AuthorizationCode, +ClientCredentials, +ImplicitGrant + } |
Possible Autorization Flows (until now only AuthorizationCode gets implemented) | |
Contains Structures for the Spotify Api.
+ +These Structures are implemented as described the Spotify Object Model Link: https://developer.spotify.com/documentation/web-api/reference/object-model/ Some structures doesn't contain the whole information given in the object model
+
+ VirtualJukebox
+
+ |
+
+ VirtualJukebox
+
+ |
+
+ VirtualJukebox
+
+ |
+
Class SpotifyAPI definition. +More...
+ +Go to the source code of this file.
++Classes | |
class | SpotifyApi::SpotifyAPI |
handles the calls with the spotify web api More... | |
+Enumerations | |
enum | QueryType { album, +artist, +playlist, +track + } |
Class SpotifyAPI definition.
+ +
+ VirtualJukebox
+
+ |
+
+ VirtualJukebox
+
+ |
+
Class SpotifyAuthorization implementation. +More...
+#include "SpotifyAuthorization.h"
#include <chrono>
#include <memory>
#include "Types/Result.h"
#include "Utils/ConfigHandler.h"
#include "Utils/LoggingHandler.h"
#include "httpserver.hpp"
Class SpotifyAuthorization implementation.
+ +
+ VirtualJukebox
+
+ |
+
Class SpotifyAuthorization definition. +More...
+#include <mutex>
#include <thread>
#include "SpotifyAPI.h"
#include "SpotifyAPITypes.h"
#include "Types/Result.h"
#include "httpserver.hpp"
Go to the source code of this file.
++Classes | |
class | SpotifyApi::SpotifyAuthorization |
handles the 3 parties user authentication More... | |
Class SpotifyAuthorization definition.
+ +
+ VirtualJukebox
+
+ |
+
+ VirtualJukebox
+
+ |
+
Class handles Music Playback with a Spotify Backend. +More...
+#include "SpotifyBackend.h"
#include <vector>
#include "Utils/ConfigHandler.h"
#include "Utils/LoggingHandler.h"
+Macros | |
#define | SPOTIFYCALL_WITH_REFRESH(returnValue, functionCall, tokenString) |
#define | SPOTIFYCALL_WITH_REFRESH_OPT(returnValue, functionCall, tokenString) |
Class handles Music Playback with a Spotify Backend.
+ +#define SPOTIFYCALL_WITH_REFRESH | +( | ++ | returnValue, | +
+ | + | + | functionCall, | +
+ | + | + | tokenString | +
+ | ) | ++ |
#define SPOTIFYCALL_WITH_REFRESH_OPT | +( | ++ | returnValue, | +
+ | + | + | functionCall, | +
+ | + | + | tokenString | +
+ | ) | ++ |
Class handles Music Playback with a Spotify Backend. More...
-#include "GlobalTypes.h"
#include <mutex>
#include "MusicBackend.h"
#include "PlaybackTrack.h"
#include "Queue.h"
#include "Result.h"
#include "Track.h"
#include "SpotifyAPI.h"
#include "SpotifyAuthorization.h"
#include "Types/GlobalTypes.h"
#include "Types/Queue.h"
#include "Types/Result.h"
Go to the source code of this file.
Classes | |
class | SpotifyBackend |
spotify music backend class which handles api calls and starts the authentication process More... | |
+ VirtualJukebox
+
+ |
+
Definitions of all track related structs. +More...
+#include "Types/GlobalTypes.h"
Go to the source code of this file.
++Classes | |
class | BaseTrack |
The most basic representation of a track. More... | |
struct | QueuedTrack |
Specialized track which is found inside queues. More... | |
struct | PlaybackTrack |
Specialized track representing the currently playing track. More... | |
Definitions of all track related structs.
+ +
+ VirtualJukebox
+
+ |
+
CConfigHandler | ||
CError | A customized error type | |
CJukeBox | ||
CLoggingHandler | ||
CMusicBackend | ||
CNetworkAPI | Base class for all implementations of network interfaces | |
CNetworkListener | Provides interface methods for all supported requests | |
CPlaybackTrack | ||
CQueue | ||
CRestAPI | Implementation of the REST API | |
CRestEndpointHandler | Provides REST endpoints for incoming connections | |
CSpotifyBackend | ||
CTrack |
▼NSpotifyApi | |
CAlbum | Simplified Spotify Album class |
CArtist | Simplified artist object |
CDevice | Device Object |
CDevices | Wrapper class for multiple devices |
CImage | Spotify Image Class |
CPlayback | Contains infos about the actual playback |
CSpotifyAPI | Handles the calls with the spotify web api |
CSpotifyAuthorization | Handles the 3 parties user authentication |
CSpotifyDummy | Type gets used, when no content data or Error is received |
CSpotifyError | Error type |
CSpotifyPaging | Represents one page of search results |
CToken | Return type on valid token request |
CTrack | Simplified track object |
CBaseTrack | The most basic representation of a track |
CConfigHandler | Singleton class which provides shared access to the configuration file used |
CDataStore | Interface for storing Data such as Tracks, Users, Votes, etc |
CError | A customized error type |
CJukeBox | Core class which combines all interface implementations in a working server application |
CMusicBackend | Provides an abstracted interface to a MusicBackend s |
CNetworkAPI | Base class for all implementations of network interfaces |
CNetworkListener | Provides interface methods for all supported requests |
CPlaybackTrack | Specialized track representing the currently playing track |
CQueue | Respresents a queue which is returned to the clients |
CQueuedTrack | Specialized track which is found inside queues |
CQueueStatus | Wraps all information to return if a client requests the current queue status |
CRAMDataStore | Implements a DataStore which stores its data purly in RAM (no persistance) |
CRequestInformation | Wraps all relevant pieces of information provided by a HTTP request |
CResponseInformation | Wraps all needed pieces of information to form a proper HTTP response |
CRestAPI | Implementation of the REST API |
CRestRequestHandler | Provides a REST request handler for incoming connections |
CSerializer | Template class which can be used as a central class for serialization routines for different data types |
CSimpleScheduler | A simple track scheduler (for presentation purposes) |
CSpotifyBackend | Spotify music backend class which handles api calls and starts the authentication process |
+ VirtualJukebox
+
+ |
+
This is the complete list of members for BaseTrack, including all inherited members.
+addedBy (defined in BaseTrack) | BaseTrack | |
album (defined in BaseTrack) | BaseTrack | |
artist (defined in BaseTrack) | BaseTrack | |
durationMs (defined in BaseTrack) | BaseTrack | |
iconUri (defined in BaseTrack) | BaseTrack | |
operator==(const BaseTrack &tr) (defined in BaseTrack) | BaseTrack | inline |
title (defined in BaseTrack) | BaseTrack | |
trackId (defined in BaseTrack) | BaseTrack |
+ VirtualJukebox
+
+ |
+
The most basic representation of a track. + More...
+ +#include <Tracks.h>
+Public Member Functions | |
+bool | operator== (const BaseTrack &tr) |
+Public Attributes | |
+TTrackID | trackId |
+std::string | title |
+std::string | album |
+std::string | artist |
+unsigned | durationMs |
+std::string | iconUri |
+std::string | addedBy |
The most basic representation of a track.
+Singleton class which provides shared access to the configuration file used. + More...
+ +#include <ConfigHandler.h>
Public Member Functions | |
TResult< int > | getValueInt (std::string const §ion, std::string const &key) |
Returns value of a key as integer. More... | |
+bool | isInitialized () |
Static Public Member Functions | getInstance () |
Singleton class which provides shared access to the configuration file used.
+
+ VirtualJukebox
+
+ |
+
This is the complete list of members for DataStore, including all inherited members.
+addTrack(BaseTrack const &track, QueueType q)=0 | DataStore | pure virtual |
addUser(User const &user)=0 | DataStore | pure virtual |
cSessionTimeoutAfterSeconds (defined in DataStore) | DataStore | static |
getPlayingTrack()=0 | DataStore | pure virtual |
getQueue(QueueType q)=0 | DataStore | pure virtual |
getUser(TSessionID const &sID)=0 | DataStore | pure virtual |
hasTrack(TTrackID const &tID, QueueType q)=0 | DataStore | pure virtual |
hasUser(TSessionID const &sID)=0 | DataStore | pure virtual |
isSessionExpired(TSessionID const &sID)=0 | DataStore | pure virtual |
nextTrack()=0 | DataStore | pure virtual |
removeTrack(TTrackID const &tID, QueueType q)=0 | DataStore | pure virtual |
removeUser(TSessionID const &sID)=0 | DataStore | pure virtual |
voteTrack(TSessionID const &sID, TTrackID const &tID, TVote vote)=0 | DataStore | pure virtual |
~DataStore() (defined in DataStore) | DataStore | inlinevirtual |
+ VirtualJukebox
+
+ |
+
Interface for storing Data such as Tracks, Users, Votes, etc. + More...
+ +#include <DataStore.h>
+Public Member Functions | |
virtual TResultOpt | addUser (User const &user)=0 |
Add a User to the internal List of registered Users. More... | |
virtual TResult< User > | getUser (TSessionID const &sID)=0 |
Get a User from the internal List of registered Users. More... | |
virtual TResult< User > | removeUser (TSessionID const &sID)=0 |
Remove a User from the internal List of registered Users. Does not remove votes taken by this user from the corresponding tracks. More... | |
virtual TResult< bool > | isSessionExpired (TSessionID const &sID)=0 |
Check if user session is expired. More... | |
virtual TResultOpt | addTrack (BaseTrack const &track, QueueType q)=0 |
Add Track to one of the internal Queues. More... | |
virtual TResult< BaseTrack > | removeTrack (TTrackID const &tID, QueueType q)=0 |
Remove Track from one of the internal Queues. More... | |
virtual TResult< bool > | hasTrack (TTrackID const &tID, QueueType q)=0 |
Check for Track in one of the internal Queues. More... | |
virtual TResultOpt | voteTrack (TSessionID const &sID, TTrackID const &tID, TVote vote)=0 |
Upvote/remove Upvote from a track. More... | |
virtual TResult< Queue > | getQueue (QueueType q)=0 |
Get entire Queue. More... | |
virtual TResult< std::optional< QueuedTrack > > | getPlayingTrack ()=0 |
Get the currently playing track. More... | |
virtual bool | hasUser (TSessionID const &sID)=0 |
Query the internal user list whether a certain user exists. More... | |
virtual TResultOpt | nextTrack ()=0 |
Play next Track in Queue. More... | |
+Static Public Attributes | |
+static const unsigned | cSessionTimeoutAfterSeconds = 3600 |
Interface for storing Data such as Tracks, Users, Votes, etc.
+
+
|
+ +pure virtual | +
Add Track to one of the internal Queues.
+track | The Track to add |
q | Identifier for determining which Queue the Track should be added to |
Implemented in RAMDataStore.
+ +
+
|
+ +pure virtual | +
Add a User to the internal List of registered Users.
+user | The User class to add |
Implemented in RAMDataStore.
+ +
+
|
+ +pure virtual | +
Get the currently playing track.
+Implemented in RAMDataStore.
+ +
+
|
+ +pure virtual | +
Get entire Queue.
+q | Identifier for determining which Queue should be returned |
Implemented in RAMDataStore.
+ +
+
|
+ +pure virtual | +
Get a User from the internal List of registered Users.
+sID | The ID of the User we want to get |
Implemented in RAMDataStore.
+ +
+
|
+ +pure virtual | +
Check for Track in one of the internal Queues.
+tID | The ID of the Track to check for |
q | Identifier for determining which Queue should be checked for the Track |
Implemented in RAMDataStore.
+ +
+
|
+ +pure virtual | +
Query the internal user list whether a certain user exists.
+sID | The ID of the user to check for |
true
if an user with this ID exists, false
otherwise Implemented in RAMDataStore.
+ +
+
|
+ +pure virtual | +
Check if user session is expired.
+sID | Session ID of the user to check |
Returns | false if session is not expired yet. Returns an Error object on session expiration or error. |
Implemented in RAMDataStore.
+ +
+
|
+ +pure virtual | +
Play next Track in Queue.
+Implemented in RAMDataStore.
+ +
+
|
+ +pure virtual | +
Remove Track from one of the internal Queues.
+tID | The ID of the Track to remove |
q | Identifier for determining which Queue the Track should be removed from |
Implemented in RAMDataStore.
+ +
+
|
+ +pure virtual | +
Remove a User from the internal List of registered Users. Does not remove votes taken by this user from the corresponding tracks.
+sID | ID number of the User to remove |
Implemented in RAMDataStore.
+ +
+
|
+ +pure virtual | +
Upvote/remove Upvote from a track.
+sID | The ID of the User who wants to vote |
tID | The ID of the Track to vote for |
vote | The Vote which determines whether a new upvote should be made or an old one removed |
Implemented in RAMDataStore.
+ +This is the complete list of members for Error, including all inherited members.
Error(ErrorCode code, std::string msg) (defined in Error) | Error | inline |
getErrorCode() (defined in Error) | Error | inline |
getErrorMessage() (defined in Error) | Error | inline |
getErrorCode() const (defined in Error) | Error | inline |
getErrorMessage() const (defined in Error) | Error | inline |
A customized error type.
addTrackToQueue(TSessionID const &sid, TTrackID const &trkid, QueueType type) override | JukeBox | virtual |
controlPlayer(TSessionID const &sid, PlayerAction action) override | JukeBox | virtual |
generateSession(TPassword const &pw) override | JukeBox | virtual |
moveTrack(TSessionID const &sid, TTrackID const &trkid, QueueType type) override | JukeBox | virtual |
queryTracks(std::string const &searchPattern, size_t const nrOfEntries) override | JukeBox | virtual |
generateSession(std::optional< TPassword > const &pw, std::optional< std::string > const &nickname) override | JukeBox | virtual |
getCurrentQueues(TSessionID const &sid) | JukeBox | virtual |
JukeBox() (defined in JukeBox) | JukeBox | |
moveTrack(TSessionID const &sid, TTrackID const &trkid, QueueType toQueue) override | JukeBox | virtual |
queryTracks(std::string const &searchPattern, size_t const nrOfEntries) override | JukeBox | virtual |
removeTrack(TSessionID const &sid, TTrackID const &trkid) override | JukeBox | virtual |
start(std::string configFilePath) (defined in JukeBox) | JukeBox | |
start(std::string const &exeName, std::string const &configFilePath) | JukeBox | |
voteTrack(TSessionID const &sid, TTrackID const &trkid, TVote vote) override | JukeBox | virtual |
~JukeBox() (defined in JukeBox) | JukeBox |
Core class which combines all interface implementations in a working server application. + More...
+ +#include <JukeBox.h>
Public Member Functions | |
-void | start (std::string configFilePath) |
TResult< TSessionID > | generateSession (TPassword const &pw) override |
Generate a session for an user. More... | |
TResult< std::vector< Track > > | queryTracks (std::string const &searchPattern, size_t const nrOfEntries) override |
Query available tracks using different music backends. More... | |
bool | start (std::string const &exeName, std::string const &configFilePath) |
Initializes ConfigHandler, LoggingHandler as well as the MusicBackend. More... | |
TResult< TSessionID > | generateSession (std::optional< TPassword > const &pw, std::optional< std::string > const &nickname) override |
TResult< std::vector< BaseTrack > > | queryTracks (std::string const &searchPattern, size_t const nrOfEntries) override |
Query available tracks using different music backends. More... | |
TResult< QueueStatus > | getCurrentQueues (TSessionID const &sid) |
Query the content of the current queues. More... | |
TResultOpt | addTrackToQueue (TSessionID const &sid, TTrackID const &trkid, QueueType type) override |
Querie the content of the current queues. More... | |
Add a track to a given queue (normal or admin). More... | |
TResultOpt | voteTrack (TSessionID const &sid, TTrackID const &trkid, TVote vote) override |
Vote for a track or revoke a vote. More... | |
TResultOpt | removeTrack (TSessionID const &sid, TTrackID const &trkid) override |
Remove a track from a queue. More... | |
TResultOpt | moveTrack (TSessionID const &sid, TTrackID const &trkid, QueueType type) override |
Move a track between queues. More... | |
TResultOpt | moveTrack (TSessionID const &sid, TTrackID const &trkid, QueueType toQueue) override |
Move a track between queues. More... | |
TResultOpt | controlPlayer (TSessionID const &sid, PlayerAction action) override |
Controls the behaviour of the music player. More... | |
Core class which combines all interface implementations in a working server application.
+This class is responsible for forwarding requests to the MusicBackends as well as accessing data of an DataStore and responding to requests from the NetworkAPI appropriatly.
+
+ Additionally the JukeBox contains a (simple) scheduler algorithm to proceed after a track is over.
Querie the content of the current queues.
-Additionally to the current normal and admin queue, the currently playing track is returned as well (if any).
-Error
otherwise.Add a track to a given queue (normal or admin).
+Add a track to a given queue (normal or admin).
Depending on the value of type
a track is added to either the normal or the admin queue. If the track is not found, or the user has no permission to add the track to the specified queue, an error is returned.
( | -TPassword const & | -pw | ) | +std::optional< TPassword > const & | +pw, | + +
+ | std::optional< std::string > const & | +nickname | +|
+ | ) | +
Implementations of the network endpoints defined in NetworkListener
+ +Implements NetworkListener.
+ +
+
|
+ +virtual | +
Generate a session for an user.
-A password may be provided to request admin privileges.
Query the content of the current queues.
+Additionally to the current normal and admin queue, the currently playing track is returned as well (if any).
+pw | The password used to authenticate as admin user. |
sid | The session ID of the user. Used to provide the information if the user has already voted for a specific track. |
Error
otherwise. Error
otherwise. Implements NetworkListener.
+Implements NetworkListener.
queryMusic
beforehand. Error
if something went wrong.Implements NetworkListener.
+Implements NetworkListener.
- -This is the complete list of members for MusicBackend, including all inherited members.
getCurrentPlayback(void)=0 (defined in MusicBackend) | MusicBackend | pure virtual |
getVolume(void)=0 (defined in MusicBackend) | MusicBackend | pure virtual |
initBackend(void)=0 (defined in MusicBackend) | MusicBackend | pure virtual |
pause(void)=0 (defined in MusicBackend) | MusicBackend | pure virtual |
play()=0 (defined in MusicBackend) | MusicBackend | pure virtual |
queryTracks(std::string const &pattern, size_t const num)=0 (defined in MusicBackend) | MusicBackend | pure virtual |
setPlayback(Track const &track)=0 (defined in MusicBackend) | MusicBackend | pure virtual |
setVolume(size_t const percent)=0 (defined in MusicBackend) | MusicBackend | pure virtual |
createBaseTrack(TTrackID const &trackID)=0 | MusicBackend | pure virtual |
getCurrentPlayback()=0 | MusicBackend | pure virtual |
getVolume()=0 | MusicBackend | pure virtual |
initBackend()=0 | MusicBackend | pure virtual |
pause()=0 | MusicBackend | pure virtual |
play()=0 | MusicBackend | pure virtual |
queryTracks(std::string const &pattern, size_t const num)=0 | MusicBackend | pure virtual |
setPlayback(BaseTrack const &track)=0 | MusicBackend | pure virtual |
setVolume(size_t const percent)=0 | MusicBackend | pure virtual |
~MusicBackend() (defined in MusicBackend) | MusicBackend | inlinevirtual |
Provides an abstracted interface to a MusicBackend s. + More...
+ +#include <MusicBackend.h>
Public Member Functions | |
-virtual TResultOpt | initBackend (void)=0 |
-virtual TResult< std::vector< Track > > | queryTracks (std::string const &pattern, size_t const num)=0 |
-virtual TResultOpt | setPlayback (Track const &track)=0 |
-virtual TResult< PlaybackTrack > | getCurrentPlayback (void)=0 |
-virtual TResultOpt | pause (void)=0 |
-virtual TResultOpt | play ()=0 |
+virtual TResultOpt | initBackend ()=0 |
Initalizes the backend. | |
virtual TResult< std::vector< BaseTrack > > | queryTracks (std::string const &pattern, size_t const num)=0 |
Queries the backend for all tracks given a pattern. More... | |
virtual TResultOpt | setPlayback (BaseTrack const &track)=0 |
Set the given track as playback (means the track gets played). More... | |
virtual TResult< std::optional< PlaybackTrack > > | getCurrentPlayback ()=0 |
Returns the current playback of the active device as a playback track. More... | |
virtual TResultOpt | pause ()=0 |
Pauses the current playback. More... | |
virtual TResultOpt | play ()=0 |
Resumes the current playback. More... | |
-virtual TResult< size_t > | getVolume (void)=0 |
-virtual TResultOpt | setVolume (size_t const percent)=0 |
virtual TResult< size_t > | getVolume ()=0 |
Returns the volume of the actual device in percent. More... | |
virtual TResultOpt | setVolume (size_t const percent)=0 |
Sets a new volume. More... | |
virtual TResult< BaseTrack > | createBaseTrack (TTrackID const &trackID)=0 |
Creates a new BaseTrack instance with the given trackID. More... | |
Provides an abstracted interface to a MusicBackend s.
+
+
|
+ +pure virtual | +
Creates a new BaseTrack instance with the given trackID.
+trackID | Unique track ID (returned for example by queryTracks). |
Implemented in SpotifyBackend.
+ +
+
|
+ +pure virtual | +
Returns the current playback of the active device as a playback track.
+Implemented in SpotifyBackend.
+ +
+
|
+ +pure virtual | +
Returns the volume of the actual device in percent.
+Implemented in SpotifyBackend.
+ +
+
|
+ +pure virtual | +
Pauses the current playback.
+Implemented in SpotifyBackend.
+ +
+
|
+ +pure virtual | +
Resumes the current playback.
+Implemented in SpotifyBackend.
+ +
+
|
+ +pure virtual | +
Queries the backend for all tracks given a pattern.
+pattern | Search patten (wildcard support depends on the backend). |
num | Maximum number of returned tracks (maximum is 50). |
Implemented in SpotifyBackend.
+ +
+
|
+ +pure virtual | +
Set the given track as playback (means the track gets played).
+track | track to play |
Implemented in SpotifyBackend.
+ +
+
|
+ +pure virtual | +
Sets a new volume.
+If a device is given in the ini file, this device gets selected. If no such device is given, the actual active device is used.
percent | Volume in percent. |
Implemented in SpotifyBackend.
+ +addTrackToQueue(TSessionID const &sid, TTrackID const &trkid, QueueType type)=0 | NetworkListener | pure virtual |
controlPlayer(TSessionID const &sid, PlayerAction action)=0 | NetworkListener | pure virtual |
generateSession(TPassword const &pw)=0 | NetworkListener | pure virtual |
moveTrack(TSessionID const &sid, TTrackID const &trkid, QueueType type)=0 | NetworkListener | pure virtual |
queryTracks(std::string const &searchPattern, size_t const nrOfEntries)=0 | NetworkListener | pure virtual |
removeTrack(TSessionID const &sid, TTrackID const &trkid)=0 | NetworkListener | pure virtual |
voteTrack(TSessionID const &sid, TTrackID const &trkid, TVote vote)=0 | NetworkListener | pure virtual |
generateSession(std::optional< TPassword > const &pw, std::optional< std::string > const &nickname)=0 | NetworkListener | pure virtual |
getCurrentQueues(TSessionID const &sid)=0 | NetworkListener | pure virtual |
moveTrack(TSessionID const &sid, TTrackID const &trkid, QueueType toQueue)=0 | NetworkListener | pure virtual |
queryTracks(std::string const &searchPattern, size_t const nrOfEntries)=0 | NetworkListener | pure virtual |
removeTrack(TSessionID const &sid, TTrackID const &trkid)=0 | NetworkListener | pure virtual |
voteTrack(TSessionID const &sid, TTrackID const &trkid, TVote vote)=0 | NetworkListener | pure virtual |
Public Member Functions | |
virtual TResult< TSessionID > | generateSession (TPassword const &pw)=0 |
Generate a session for an user. More... | |
virtual TResult< std::vector< Track > > | queryTracks (std::string const &searchPattern, size_t const nrOfEntries)=0 |
Query available tracks using different music backends. More... | |
virtual TResult< TSessionID > | generateSession (std::optional< TPassword > const &pw, std::optional< std::string > const &nickname)=0 |
Generate a session for an user. More... | |
virtual TResult< std::vector< BaseTrack > > | queryTracks (std::string const &searchPattern, size_t const nrOfEntries)=0 |
Query available tracks using different music backends. More... | |
virtual TResult< QueueStatus > | getCurrentQueues (TSessionID const &sid)=0 |
Query the content of the current queues. More... | |
virtual TResultOpt | addTrackToQueue (TSessionID const &sid, TTrackID const &trkid, QueueType type)=0 |
Querie the content of the current queues. More... | |
Add a track to a given queue (normal or admin). More... | |
virtual TResultOpt | voteTrack (TSessionID const &sid, TTrackID const &trkid, TVote vote)=0 |
Vote for a track or revoke a vote. More... | |
virtual TResultOpt | removeTrack (TSessionID const &sid, TTrackID const &trkid)=0 |
Remove a track from a queue. More... | |
virtual TResultOpt | moveTrack (TSessionID const &sid, TTrackID const &trkid, QueueType type)=0 |
Move a track between queues. More... | |
virtual TResultOpt | moveTrack (TSessionID const &sid, TTrackID const &trkid, QueueType toQueue)=0 |
Move a track between queues. More... | |
Provides interface methods for all supported requests.
@@ -151,10 +154,7 @@Querie the content of the current queues.
-Additionally to the current normal and admin queue, the currently playing track is returned as well (if any).
-Error
otherwise.Add a track to a given queue (normal or admin).
+Add a track to a given queue (normal or admin).
Depending on the value of type
a track is added to either the normal or the admin queue. If the track is not found, or the user has no permission to add the track to the specified queue, an error is returned.
( | -TPassword const & | -pw | ) | +std::optional< TPassword > const & | +pw, | + +
+ | std::optional< std::string > const & | +nickname | +|
+ | ) | +
pw | The password used to authenticate as admin user. |
pw | (optional) Password to authenticate the user as an admin. |
nickname | (optional) A human readable nickname for the user. |
Error
otherwise. Error
otherwise. Implemented in JukeBox.
+Implemented in JukeBox.
+
|
+ +pure virtual | +
Query the content of the current queues.
+Additionally to the current normal and admin queue, the currently playing track is returned as well (if any).
+sid | The session ID of the user. Used to provide the information if the user has already voted for a specific track. |
Error
otherwise. Implemented in JukeBox.
+ +queryMusic
beforehand. Error
if something went wrong.Implemented in JukeBox.
+Implemented in JukeBox.
- -virtual TResult<std::vector<Track> > NetworkListener::queryTracks | +virtual TResult<std::vector<BaseTrack> > NetworkListener::queryTracks | ( | std::string const & | searchPattern, | @@ -359,7 +408,7 @@||||||||
sid | The session ID of the user. Used to authenticate as admin if needed. | |||||||||||
trkid | The ID of the track to add to a queue. Has to be queried using queryMusic beforehand. | |||||||||||
type | Determines to which queue the track should be added. | |||||||||||
vote | Determines if a vote is set or revoked. There cannot be more than 1 or less than 0 votes from the same user on the same track! |
+ VirtualJukebox
+
+ |
+
This is the complete list of members for RAMDataStore, including all inherited members.
+addTrack(BaseTrack const &track, QueueType q) override | RAMDataStore | virtual |
addUser(User const &user) override | RAMDataStore | virtual |
cSessionTimeoutAfterSeconds (defined in DataStore) | DataStore | static |
getPlayingTrack() override | RAMDataStore | virtual |
getQueue(QueueType q) override | RAMDataStore | virtual |
getUser(TSessionID const &ID) override | RAMDataStore | virtual |
hasTrack(TTrackID const &ID, QueueType q) override | RAMDataStore | virtual |
hasUser(TSessionID const &ID) override | RAMDataStore | virtual |
isSessionExpired(TSessionID const &ID) override | RAMDataStore | virtual |
nextTrack() override | RAMDataStore | virtual |
removeTrack(TTrackID const &ID, QueueType q) override | RAMDataStore | virtual |
removeUser(TSessionID const &ID) override | RAMDataStore | virtual |
voteTrack(TSessionID const &sID, TTrackID const &tID, TVote vote) override | RAMDataStore | virtual |
~DataStore() (defined in DataStore) | DataStore | inlinevirtual |
+ VirtualJukebox
+
+ |
+
Implements a DataStore which stores its data purly in RAM (no persistance). + More...
+ +#include <RAMDataStore.h>
+Public Member Functions | |
TResultOpt | addUser (User const &user) override |
Add a User to the internal List of registered Users. More... | |
TResult< User > | getUser (TSessionID const &ID) override |
Get a User from the internal List of registered Users. More... | |
TResult< User > | removeUser (TSessionID const &ID) override |
Remove a User from the internal List of registered Users. Does not remove votes taken by this user from the corresponding tracks. More... | |
TResult< bool > | isSessionExpired (TSessionID const &ID) override |
Check if user session is expired. More... | |
TResultOpt | addTrack (BaseTrack const &track, QueueType q) override |
Add Track to one of the internal Queues. More... | |
TResult< BaseTrack > | removeTrack (TTrackID const &ID, QueueType q) override |
Remove Track from one of the internal Queues. More... | |
TResult< bool > | hasTrack (TTrackID const &ID, QueueType q) override |
Check for Track in one of the internal Queues. More... | |
TResultOpt | voteTrack (TSessionID const &sID, TTrackID const &tID, TVote vote) override |
Upvote/remove Upvote from a track. More... | |
TResult< Queue > | getQueue (QueueType q) override |
Get entire Queue. More... | |
TResult< std::optional< QueuedTrack > > | getPlayingTrack () override |
Get the currently playing track. More... | |
bool | hasUser (TSessionID const &ID) override |
Query the internal user list whether a certain user exists. More... | |
TResultOpt | nextTrack () override |
Play next Track in Queue. More... | |
+Additional Inherited Members | |
Static Public Attributes inherited from DataStore | |
+static const unsigned | cSessionTimeoutAfterSeconds = 3600 |
Implements a DataStore which stores its data purly in RAM (no persistance).
+
+
|
+ +overridevirtual | +
+
|
+ +overridevirtual | +
+
|
+ +overridevirtual | +
+
|
+ +overridevirtual | +
+
|
+ +overridevirtual | +
Query the internal user list whether a certain user exists.
+sID | The ID of the user to check for |
true
if an user with this ID exists, false
otherwise Implements DataStore.
+ +
+
|
+ +overridevirtual | +
+
|
+ +overridevirtual | +
+
|
+ +overridevirtual | +
+
|
+ +overridevirtual | +
Upvote/remove Upvote from a track.
+sID | The ID of the User who wants to vote |
tID | The ID of the Track to vote for |
vote | The Vote which determines whether a new upvote should be made or an old one removed |
Implements DataStore.
+ +Implementation of the REST API.
+ VirtualJukebox
+
+ |
+
This is the complete list of members for RestRequestHandler, including all inherited members.
+InternalErrorHandler(httpserver::http_request const &req) (defined in RestRequestHandler) | RestRequestHandler | static |
NotAllowedHandler(httpserver::http_request const &req) (defined in RestRequestHandler) | RestRequestHandler | static |
NotFoundHandler(httpserver::http_request const &req) (defined in RestRequestHandler) | RestRequestHandler | static |
RestRequestHandler(NetworkListener *listener) (defined in RestRequestHandler) | RestRequestHandler |
+ VirtualJukebox
+
+ |
+
Provides a REST request handler for incoming connections. + More...
+ +#include <RestRequestHandler.h>
+Public Member Functions | |
+ | RestRequestHandler (NetworkListener *listener) |
+Static Public Member Functions | |
+static const std::shared_ptr< httpserver::http_response > | NotFoundHandler (httpserver::http_request const &req) |
+static const std::shared_ptr< httpserver::http_response > | NotAllowedHandler (httpserver::http_request const &req) |
+static const std::shared_ptr< httpserver::http_response > | InternalErrorHandler (httpserver::http_request const &req) |
Provides a REST request handler for incoming connections.
+Is used to validate and dispatch incoming requests. If a valid request has found the assigned NetworkListener
is notified.
+ VirtualJukebox
+
+ |
+
This is the complete list of members for Serializer, including all inherited members.
+serialize(T const &) (defined in Serializer) | Serializer | static |
serialize(BaseTrack const &track) (defined in Serializer) | Serializer | static |
serialize(QueuedTrack const &track) (defined in Serializer) | Serializer | static |
serialize(PlaybackTrack const &track) (defined in Serializer) | Serializer | static |
+ VirtualJukebox
+
+ |
+
Template class which can be used as a central class for serialization routines for different data types. + More...
+ +#include <Serializer.h>
+Static Public Member Functions | |
+template<class T > | |
static nlohmann::json | serialize (T const &) |
+template<> | |
json | serialize (BaseTrack const &track) |
+template<> | |
json | serialize (QueuedTrack const &track) |
+template<> | |
json | serialize (PlaybackTrack const &track) |
Template class which can be used as a central class for serialization routines for different data types.
+
+ VirtualJukebox
+
+ |
+
This is the complete list of members for SimpleScheduler, including all inherited members.
+checkForInconsistency() | SimpleScheduler | |
getLastPlayback() | SimpleScheduler | |
nextTrack() | SimpleScheduler | |
SimpleScheduler(DataStore *const datastore, MusicBackend *const musicbackend) (defined in SimpleScheduler) | SimpleScheduler | |
start() | SimpleScheduler | |
~SimpleScheduler() (defined in SimpleScheduler) | SimpleScheduler |
+ VirtualJukebox
+
+ |
+
A simple track scheduler (for presentation purposes). + More...
+ +#include <SimpleScheduler.h>
+Public Member Functions | |
+ | SimpleScheduler (DataStore *const datastore, MusicBackend *const musicbackend) |
+void | start () |
Starts the scheduler thread. | |
TResult< std::optional< PlaybackTrack > > const & | getLastPlayback () |
returns the last polled playback status More... | |
TResultOpt | nextTrack () |
plays the next song from the queue More... | |
bool | checkForInconsistency () |
returns true if actual track from datastore and playback needs to be checked if they are equal More... | |
A simple track scheduler (for presentation purposes).
+bool SimpleScheduler::checkForInconsistency | +( | +) | ++ |
returns true if actual track from datastore and playback needs to be checked if they are equal
+const TResult< std::optional< PlaybackTrack > > & SimpleScheduler::getLastPlayback | +( | +) | ++ |
returns the last polled playback status
+TResultOpt SimpleScheduler::nextTrack | +( | +) | ++ |
plays the next song from the queue
+
+ VirtualJukebox
+
+ |
+
This is the complete list of members for SpotifyApi::Album, including all inherited members.
+Album()=default (defined in SpotifyApi::Album) | SpotifyApi::Album | |
Album(nlohmann::json const &albumJson) (defined in SpotifyApi::Album) | SpotifyApi::Album | |
getAlbumType() const (defined in SpotifyApi::Album) | SpotifyApi::Album | |
getArtists() const (defined in SpotifyApi::Album) | SpotifyApi::Album | |
getHref() const (defined in SpotifyApi::Album) | SpotifyApi::Album | |
getId() const (defined in SpotifyApi::Album) | SpotifyApi::Album | |
getImages() const (defined in SpotifyApi::Album) | SpotifyApi::Album | |
getName() const (defined in SpotifyApi::Album) | SpotifyApi::Album | |
getReleaseDate() const (defined in SpotifyApi::Album) | SpotifyApi::Album | |
getType() const (defined in SpotifyApi::Album) | SpotifyApi::Album | |
getUri() const (defined in SpotifyApi::Album) | SpotifyApi::Album |
+ VirtualJukebox
+
+ |
+
Simplified Spotify Album class. + More...
+ +#include <SpotifyAPITypes.h>
+Public Member Functions | |
+ | Album (nlohmann::json const &albumJson) |
+const std::vector< Artist > & | getArtists () const |
+const std::vector< Image > & | getImages () const |
+const std::string & | getAlbumType () const |
+const std::string & | getHref () const |
+const std::string & | getId () const |
+const std::string & | getName () const |
+const std::string & | getReleaseDate () const |
+const std::string & | getType () const |
+const std::string & | getUri () const |
Simplified Spotify Album class.
+
+ VirtualJukebox
+
+ |
+
This is the complete list of members for SpotifyApi::Artist, including all inherited members.
+Artist()=default (defined in SpotifyApi::Artist) | SpotifyApi::Artist | |
Artist(nlohmann::json const &artistJson) (defined in SpotifyApi::Artist) | SpotifyApi::Artist | |
getHref() const (defined in SpotifyApi::Artist) | SpotifyApi::Artist | |
getID() const (defined in SpotifyApi::Artist) | SpotifyApi::Artist | |
getName() const (defined in SpotifyApi::Artist) | SpotifyApi::Artist | |
getType() const (defined in SpotifyApi::Artist) | SpotifyApi::Artist | |
getUri() const (defined in SpotifyApi::Artist) | SpotifyApi::Artist |
+ VirtualJukebox
+
+ |
+
Simplified artist object. + More...
+ +#include <SpotifyAPITypes.h>
+Public Member Functions | |
+ | Artist (nlohmann::json const &artistJson) |
+const std::string & | getHref () const |
+const std::string & | getID () const |
+const std::string & | getName () const |
+const std::string & | getType () const |
+const std::string & | getUri () const |
Simplified artist object.
+
+ VirtualJukebox
+
+ |
+
This is the complete list of members for SpotifyApi::Device, including all inherited members.
+Device()=default (defined in SpotifyApi::Device) | SpotifyApi::Device | |
Device(nlohmann::json const &deviceJson) (defined in SpotifyApi::Device) | SpotifyApi::Device | |
getID() const (defined in SpotifyApi::Device) | SpotifyApi::Device | |
getName() const (defined in SpotifyApi::Device) | SpotifyApi::Device | |
getType() const (defined in SpotifyApi::Device) | SpotifyApi::Device | |
getVolume() const (defined in SpotifyApi::Device) | SpotifyApi::Device | |
isActive() const (defined in SpotifyApi::Device) | SpotifyApi::Device | |
isPrivateSession() const (defined in SpotifyApi::Device) | SpotifyApi::Device | |
isRestricted() const (defined in SpotifyApi::Device) | SpotifyApi::Device |
+ VirtualJukebox
+
+ |
+
#include <SpotifyAPITypes.h>
+Public Member Functions | |
+ | Device (nlohmann::json const &deviceJson) |
+const std::string & | getID () const |
+bool | isActive () const |
+bool | isPrivateSession () const |
+bool | isRestricted () const |
+const std::string & | getName () const |
+const std::string & | getType () const |
+size_t | getVolume () const |
Device Object.
+
+ VirtualJukebox
+
+ |
+
This is the complete list of members for SpotifyApi::Devices, including all inherited members.
+Devices()=default (defined in SpotifyApi::Devices) | SpotifyApi::Devices | |
Devices(nlohmann::json const &devicesJson) (defined in SpotifyApi::Devices) | SpotifyApi::Devices | inline |
mDevices (defined in SpotifyApi::Devices) | SpotifyApi::Devices |
+ VirtualJukebox
+
+ |
+
Wrapper class for multiple devices. + More...
+ +#include <SpotifyAPITypes.h>
+Public Member Functions | |
+ | Devices (nlohmann::json const &devicesJson) |
+Public Attributes | |
+std::vector< Device > | mDevices |
Wrapper class for multiple devices.
+
+ VirtualJukebox
+
+ |
+
This is the complete list of members for SpotifyApi::Image, including all inherited members.
+getHeight() (defined in SpotifyApi::Image) | SpotifyApi::Image | |
getUrl() const (defined in SpotifyApi::Image) | SpotifyApi::Image | |
getWidth() (defined in SpotifyApi::Image) | SpotifyApi::Image | |
Image()=default (defined in SpotifyApi::Image) | SpotifyApi::Image | |
Image(nlohmann::json const &imageJson) (defined in SpotifyApi::Image) | SpotifyApi::Image |
+ VirtualJukebox
+
+ |
+
Spotify Image Class. + More...
+ +#include <SpotifyAPITypes.h>
+Public Member Functions | |
+ | Image (nlohmann::json const &imageJson) |
+int | getHeight () |
+int | getWidth () |
+const std::string & | getUrl () const |
Spotify Image Class.
+
+ VirtualJukebox
+
+ |
+
This is the complete list of members for SpotifyApi::Playback, including all inherited members.
+getCurrentPlayingTrack() const (defined in SpotifyApi::Playback) | SpotifyApi::Playback | |
getCurrentPlayingType() const (defined in SpotifyApi::Playback) | SpotifyApi::Playback | |
getDevice() const (defined in SpotifyApi::Playback) | SpotifyApi::Playback | |
getProgressMs() const (defined in SpotifyApi::Playback) | SpotifyApi::Playback | |
getRepeatState() const (defined in SpotifyApi::Playback) | SpotifyApi::Playback | |
getShuffleState() const (defined in SpotifyApi::Playback) | SpotifyApi::Playback | |
getTimestamp() const (defined in SpotifyApi::Playback) | SpotifyApi::Playback | |
isPlaying() const (defined in SpotifyApi::Playback) | SpotifyApi::Playback | |
Playback()=default (defined in SpotifyApi::Playback) | SpotifyApi::Playback | |
Playback(nlohmann::json const &playbackJson) (defined in SpotifyApi::Playback) | SpotifyApi::Playback |
+ VirtualJukebox
+
+ |
+
Contains infos about the actual playback. + More...
+ +#include <SpotifyAPITypes.h>
+Public Member Functions | |
+ | Playback (nlohmann::json const &playbackJson) |
+const Device & | getDevice () const |
+const std::string & | getRepeatState () const |
+bool | getShuffleState () const |
+size_t | getTimestamp () const |
+size_t | getProgressMs () const |
+bool | isPlaying () const |
+const std::string & | getCurrentPlayingType () const |
+const std::optional< Track > & | getCurrentPlayingTrack () const |
Contains infos about the actual playback.
+
+ VirtualJukebox
+
+ |
+
This is the complete list of members for SpotifyApi::SpotifyAPI, including all inherited members.
+getAccessToken(GrantType grantType, std::string const &code, std::string const &redirectUri, std::string const &clientID, std::string const &clientSecret) | SpotifyApi::SpotifyAPI | |
getAvailableDevices(std::string const &accessToken) | SpotifyApi::SpotifyAPI | |
getCurrentPlayback(std::string const &accessToken, std::string const &market="AT") | SpotifyApi::SpotifyAPI | |
getTrack(std::string const &accessToken, std::string const &spotifyID, std::string const &market="AT") | SpotifyApi::SpotifyAPI | |
pause(std::string const &accessToken, Device const &device=Device()) | SpotifyApi::SpotifyAPI | |
play(std::string const &accessToken, std::vector< std::string > const &uris=std::vector< std::string >(), Device const &device=Device(), int positionMs=0) | SpotifyApi::SpotifyAPI | |
refreshAccessToken(std::string const &refreshToken, std::string const &clientID, std::string const &clientSecret) | SpotifyApi::SpotifyAPI | |
search(std::string const &accessToken, std::string const &queryKey, QueryType type, int const limit=20, int const offset=0, std::string const &market="AT") | SpotifyApi::SpotifyAPI | |
setVolume(std::string const &accessToken, int volume, Device const &device=Device()) | SpotifyApi::SpotifyAPI | |
stringBase64Encode(std::string const &str) | SpotifyApi::SpotifyAPI | static |
stringUrlEncode(std::string const &str) | SpotifyApi::SpotifyAPI | static |
transferUsersPlayback(std::string const &accessToken, std::vector< Device > const &devices, bool play=false) | SpotifyApi::SpotifyAPI |
+ VirtualJukebox
+
+ |
+
handles the calls with the spotify web api + More...
+ +#include <SpotifyAPI.h>
+Public Member Functions | |
TResult< Token > | getAccessToken (GrantType grantType, std::string const &code, std::string const &redirectUri, std::string const &clientID, std::string const &clientSecret) |
requests a Token (access token and refresh token) from the spotify web api More... | |
TResult< Token > | refreshAccessToken (std::string const &refreshToken, std::string const &clientID, std::string const &clientSecret) |
requests with the refresh token a new access token More... | |
TResult< std::vector< Device > > | getAvailableDevices (std::string const &accessToken) |
returns vector of available spotify devices More... | |
TResult< std::optional< Playback > > | getCurrentPlayback (std::string const &accessToken, std::string const &market="AT") |
gets the current playback status of the current active device from spotify More... | |
TResult< SpotifyPaging > | search (std::string const &accessToken, std::string const &queryKey, QueryType type, int const limit=20, int const offset=0, std::string const &market="AT") |
searches for tracks,artists,albums or playlists with the given query More... | |
TResultOpt | setVolume (std::string const &accessToken, int volume, Device const &device=Device()) |
sets a volume More... | |
TResultOpt | pause (std::string const &accessToken, Device const &device=Device()) |
pauses the acutal track More... | |
TResultOpt | play (std::string const &accessToken, std::vector< std::string > const &uris=std::vector< std::string >(), Device const &device=Device(), int positionMs=0) |
plays new songs, or resume the actual song More... | |
TResult< Track > | getTrack (std::string const &accessToken, std::string const &spotifyID, std::string const &market="AT") |
searches for the given track id and returns a simplified track object More... | |
TResultOpt | transferUsersPlayback (std::string const &accessToken, std::vector< Device > const &devices, bool play=false) |
enables a playback on the given device More... | |
+Static Public Member Functions | |
static std::string | stringUrlEncode (std::string const &str) |
encodes the given string with http special characters More... | |
static std::string | stringBase64Encode (std::string const &str) |
encodes the given string with base64 More... | |
handles the calls with the spotify web api
+TResult< Token > SpotifyAPI::getAccessToken | +( | +GrantType | +grantType, | +
+ | + | std::string const & | +code, | +
+ | + | std::string const & | +redirectUri, | +
+ | + | std::string const & | +clientID, | +
+ | + | std::string const & | +clientSecret | +
+ | ) | ++ |
requests a Token (access token and refresh token) from the spotify web api
+grantType | which authorization type to use |
code | authentification code (received from Spotify Authorization) |
redirectUri | redirection url (only for comparing) |
clientID | clientID (from spotify developers dashboard) |
clientSecret | clientSecret (from spotify developers dashboard) |
this function fetches a token from the spotify web api. until now, only the GrantType AuthorizationCode is implemented.
+ +TResult< std::optional< Playback > > SpotifyAPI::getCurrentPlayback | +( | +std::string const & | +accessToken, | +
+ | + | std::string const & | +market = "AT" |
+
+ | ) | ++ |
gets the current playback status of the current active device from spotify
+accessToken | valid access token |
market | specifies, that only tracks get returned which are valid in the given market (not implemented) |
a playback is the actual status of the player, if its playing, wich device, which track and so on..
+ +TResult< Track > SpotifyAPI::getTrack | +( | +std::string const & | +accessToken, | +
+ | + | std::string const & | +spotifyID, | +
+ | + | std::string const & | +market = "AT" |
+
+ | ) | ++ |
searches for the given track id and returns a simplified track object
+accessToken | valid access token |
spotifyID | spotify id of the song (without "spotify:track:" string) |
market | only return tracks, which are valid in the given market |
TResultOpt SpotifyAPI::pause | +( | +std::string const & | +accessToken, | +
+ | + | Device const & | +device = Device() |
+
+ | ) | ++ |
pauses the acutal track
+accessToken | valid access token |
device | select on which device to pause (if not given, the current active device will be used) |
TResultOpt SpotifyAPI::play | +( | +std::string const & | +accessToken, | +
+ | + | std::vector< std::string > const & | +uris = std::vector<std::string>() , |
+
+ | + | Device const & | +device = Device() , |
+
+ | + | int | +positionMs = 0 |
+
+ | ) | ++ |
plays new songs, or resume the actual song
+accessToken | valid access token |
uris | a vector of spotify uris (ids) which will be queued and played |
device | select on which device to play (if not given, the current active device will be used) |
positionMs | set the start position in ms of the new track |
if uris and devices are left empty, the actual song gets resumed, and if the positionMs is greater than the duration of the song, the next song will be played
TResult< Token > SpotifyAPI::refreshAccessToken | +( | +std::string const & | +refreshToken, | +
+ | + | std::string const & | +clientID, | +
+ | + | std::string const & | +clientSecret | +
+ | ) | ++ |
requests with the refresh token a new access token
+refreshToken | the refresh token gathered from getAccessToken(..) |
clientID | clientID (from spotify developers dashboard) |
clientSecret | clientSecret (from spotify developers dashboard) |
this function fetches a new token from the spotify web api. Caution it only fetches a access token, not a new refresh token (because it doesn't need to be updated) so the refresh token value from the return will be empty!!
+ +TResult< SpotifyPaging > SpotifyAPI::search | +( | +std::string const & | +accessToken, | +
+ | + | std::string const & | +queryKey, | +
+ | + | SpotifyApi::QueryType | +type, | +
+ | + | int const | +limit = 20 , |
+
+ | + | int const | +offset = 0 , |
+
+ | + | std::string const & | +market = "AT" |
+
+ | ) | ++ |
searches for tracks,artists,albums or playlists with the given query
+accessToken | valid access token |
queryKey | the search string |
type | specifies if it gets searched for tracks, artists, albums, or playlists |
limit | sets the limit of maximum number returned tracks,.. |
offset | number offset |
market | only return tracks,.. which are valid in the given market |
the queryKey can also contain 2 wildcards. for further details on the query string see https://developer.spotify.com/documentation/web-api/reference/search/search/
TResultOpt SpotifyAPI::setVolume | +( | +std::string const & | +accessToken, | +
+ | + | int | +volume, | +
+ | + | Device const & | +device = Device() |
+
+ | ) | ++ |
sets a volume
+accessToken | valid access token |
volume | volume in percent (0-100) |
device | select on which device to set the volume (if not given, the current active device will be used) |
+
|
+ +static | +
encodes the given string with base64
+str | string to encode |
+
|
+ +static | +
encodes the given string with http special characters
+str | string to encode |
TResultOpt SpotifyAPI::transferUsersPlayback | +( | +std::string const & | +accessToken, | +
+ | + | std::vector< Device > const & | +devices, | +
+ | + | bool | +play = false |
+
+ | ) | ++ |
enables a playback on the given device
+this function has to be called, when a device has no actual playback. Note: Note that a value of false for the play parameter when also transferring to another device_id will not pause playback. To ensure that playback is paused on the new device you should send a pause command to the currently active device before transferring to the new device_id
accessToken | valid access token |
devices | its possible to set an array, but until now only a single device is currently supported |
play | true ensures playback happends on new device otherwise keep the current playback state |
+ VirtualJukebox
+
+ |
+
This is the complete list of members for SpotifyApi::SpotifyAuthorization, including all inherited members.
+getAccessToken() | SpotifyApi::SpotifyAuthorization | |
getExpiresAt() | SpotifyApi::SpotifyAuthorization | |
getRefreshToken() | SpotifyApi::SpotifyAuthorization | |
getScopes() | SpotifyApi::SpotifyAuthorization | |
refreshAccessToken() | SpotifyApi::SpotifyAuthorization | |
setScopes(std::string const &scopes) | SpotifyApi::SpotifyAuthorization | |
startServer() | SpotifyApi::SpotifyAuthorization | |
stopServer() | SpotifyApi::SpotifyAuthorization | |
~SpotifyAuthorization() (defined in SpotifyApi::SpotifyAuthorization) | SpotifyApi::SpotifyAuthorization |
+ VirtualJukebox
+
+ |
+
handles the 3 parties user authentication + More...
+ +#include <SpotifyAuthorization.h>
+Public Member Functions | |
TResultOpt | startServer () |
starts the server, on which the user can connect More... | |
+void | stopServer () |
stops the server | |
const std::string & | getRefreshToken () |
returns refresh token More... | |
const std::string & | getAccessToken () |
returns access token More... | |
TResultOpt | refreshAccessToken () |
refreshes the access token (!! not implemented yet!!) More... | |
__int64_t | getExpiresAt () |
returns when the token expires More... | |
void | setScopes (std::string const &scopes) |
sets the scopes to ask on the permission More... | |
std::string | getScopes () |
return scopes More... | |
handles the 3 parties user authentication
+const std::string & SpotifyAuthorization::getAccessToken | +( | +) | ++ |
returns access token
+__int64_t SpotifyAuthorization::getExpiresAt | +( | +) | ++ |
returns when the token expires
+const std::string & SpotifyAuthorization::getRefreshToken | +( | +) | ++ |
returns refresh token
+std::string SpotifyAuthorization::getScopes | +( | +) | ++ |
return scopes
+TResultOpt SpotifyAuthorization::refreshAccessToken | +( | +) | ++ |
refreshes the access token (!! not implemented yet!!)
+void SpotifyAuthorization::setScopes | +( | +std::string const & | +scopes | ) | ++ |
sets the scopes to ask on the permission
+scopes | scopes |
see https://developer.spotify.com/documentation/general/guides/scopes/ for valid scopes
+ +TResultOpt SpotifyAuthorization::startServer | +( | +) | ++ |
starts the server, on which the user can connect
+
+ VirtualJukebox
+
+ |
+
This is the complete list of members for SpotifyApi::SpotifyDummy, including all inherited members.
+SpotifyDummy()=default (defined in SpotifyApi::SpotifyDummy) | SpotifyApi::SpotifyDummy | |
SpotifyDummy(nlohmann::json const &dummyJson) (defined in SpotifyApi::SpotifyDummy) | SpotifyApi::SpotifyDummy | inline |
+ VirtualJukebox
+
+ |
+
Type gets used, when no content data or Error is received. + More...
+ +#include <SpotifyAPITypes.h>
+Public Member Functions | |
+ | SpotifyDummy (nlohmann::json const &dummyJson) |
Type gets used, when no content data or Error is received.
+
+ VirtualJukebox
+
+ |
+
This is the complete list of members for SpotifyApi::SpotifyError, including all inherited members.
+getMessage() const (defined in SpotifyApi::SpotifyError) | SpotifyApi::SpotifyError | |
getStatus() const (defined in SpotifyApi::SpotifyError) | SpotifyApi::SpotifyError | |
SpotifyError(nlohmann::json const &errorJson) (defined in SpotifyApi::SpotifyError) | SpotifyApi::SpotifyError |
+ VirtualJukebox
+
+ |
+
#include <SpotifyAPITypes.h>
+Public Member Functions | |
+ | SpotifyError (nlohmann::json const &errorJson) |
+int | getStatus () const |
+const std::string & | getMessage () const |
Error type.
+
+ VirtualJukebox
+
+ |
+
This is the complete list of members for SpotifyApi::SpotifyPaging, including all inherited members.
+getAlbums() const (defined in SpotifyApi::SpotifyPaging) | SpotifyApi::SpotifyPaging | |
getArtists() const (defined in SpotifyApi::SpotifyPaging) | SpotifyApi::SpotifyPaging | |
getHref() const (defined in SpotifyApi::SpotifyPaging) | SpotifyApi::SpotifyPaging | |
getLimit() const (defined in SpotifyApi::SpotifyPaging) | SpotifyApi::SpotifyPaging | |
getNext() const (defined in SpotifyApi::SpotifyPaging) | SpotifyApi::SpotifyPaging | |
getOffset() const (defined in SpotifyApi::SpotifyPaging) | SpotifyApi::SpotifyPaging | |
getPrevious() const (defined in SpotifyApi::SpotifyPaging) | SpotifyApi::SpotifyPaging | |
getTotal() const (defined in SpotifyApi::SpotifyPaging) | SpotifyApi::SpotifyPaging | |
getTracks() const (defined in SpotifyApi::SpotifyPaging) | SpotifyApi::SpotifyPaging | |
SpotifyPaging()=default (defined in SpotifyApi::SpotifyPaging) | SpotifyApi::SpotifyPaging | |
SpotifyPaging(nlohmann::json const &pagingJson) (defined in SpotifyApi::SpotifyPaging) | SpotifyApi::SpotifyPaging |
+ VirtualJukebox
+
+ |
+
Represents one page of search results. + More...
+ +#include <SpotifyAPITypes.h>
+Public Member Functions | |
+ | SpotifyPaging (nlohmann::json const &pagingJson) |
+const std::vector< Track > & | getTracks () const |
+const std::vector< Artist > & | getArtists () const |
+const std::vector< Album > & | getAlbums () const |
+const std::string & | getHref () const |
+int | getLimit () const |
+const std::string & | getNext () const |
+int | getOffset () const |
+const std::string & | getPrevious () const |
+int | getTotal () const |
Represents one page of search results.
+
+ VirtualJukebox
+
+ |
+
This is the complete list of members for SpotifyApi::Token, including all inherited members.
+getAccessToken() const (defined in SpotifyApi::Token) | SpotifyApi::Token | |
getExpiresIn() const (defined in SpotifyApi::Token) | SpotifyApi::Token | |
getRefreshToken() const (defined in SpotifyApi::Token) | SpotifyApi::Token | |
getScope() const (defined in SpotifyApi::Token) | SpotifyApi::Token | |
getTokenType() const (defined in SpotifyApi::Token) | SpotifyApi::Token | |
setRefreshToken(std::string const &token) (defined in SpotifyApi::Token) | SpotifyApi::Token | |
Token()=default (defined in SpotifyApi::Token) | SpotifyApi::Token | |
Token(nlohmann::json const &tokenJson) (defined in SpotifyApi::Token) | SpotifyApi::Token |
+ VirtualJukebox
+
+ |
+
return type on valid token request + More...
+ +#include <SpotifyAPITypes.h>
+Public Member Functions | |
+ | Token (nlohmann::json const &tokenJson) |
+void | setRefreshToken (std::string const &token) |
+const std::string & | getAccessToken () const |
+const std::string & | getRefreshToken () const |
+const std::string & | getTokenType () const |
+const std::string & | getScope () const |
+size_t | getExpiresIn () const |
return type on valid token request
+
+ VirtualJukebox
+
+ |
+
This is the complete list of members for SpotifyApi::Track, including all inherited members.
+getAlbum() const (defined in SpotifyApi::Track) | SpotifyApi::Track | |
getArtists() const (defined in SpotifyApi::Track) | SpotifyApi::Track | |
getDuration() const (defined in SpotifyApi::Track) | SpotifyApi::Track | |
getHref() const (defined in SpotifyApi::Track) | SpotifyApi::Track | |
getId() const (defined in SpotifyApi::Track) | SpotifyApi::Track | |
getName() const (defined in SpotifyApi::Track) | SpotifyApi::Track | |
getUri() const (defined in SpotifyApi::Track) | SpotifyApi::Track | |
Track()=default (defined in SpotifyApi::Track) | SpotifyApi::Track | |
Track(nlohmann::json const &trackJson) (defined in SpotifyApi::Track) | SpotifyApi::Track |
+ VirtualJukebox
+
+ |
+
Simplified track object. + More...
+ +#include <SpotifyAPITypes.h>
+Public Member Functions | |
+ | Track (nlohmann::json const &trackJson) |
+const std::vector< Artist > & | getArtists () const |
+const Album & | getAlbum () const |
+size_t | getDuration () const |
+const std::string & | getHref () const |
+const std::string & | getId () const |
+const std::string & | getName () const |
+const std::string & | getUri () const |
Simplified track object.
+This is the complete list of members for SpotifyBackend, including all inherited members.
getCurrentPlayback(void) override (defined in SpotifyBackend) | SpotifyBackend | virtual |
getVolume(void) override (defined in SpotifyBackend) | SpotifyBackend | virtual |
initBackend(void) override (defined in SpotifyBackend) | SpotifyBackend | virtual |
pause(void) override (defined in SpotifyBackend) | SpotifyBackend | virtual |
play() override (defined in SpotifyBackend) | SpotifyBackend | virtual |
queryTracks(std::string const &pattern, size_t const num) override (defined in SpotifyBackend) | SpotifyBackend | virtual |
setPlayback(Track const &track) override (defined in SpotifyBackend) | SpotifyBackend | virtual |
setVolume(size_t const percent) override (defined in SpotifyBackend) | SpotifyBackend | virtual |
createBaseTrack(TTrackID const &trackID) override | SpotifyBackend | virtual |
getCurrentPlayback() override | SpotifyBackend | virtual |
getVolume() override | SpotifyBackend | virtual |
initBackend() override | SpotifyBackend | virtual |
pause() override | SpotifyBackend | virtual |
play() override | SpotifyBackend | virtual |
queryTracks(std::string const &pattern, size_t const num) override | SpotifyBackend | virtual |
setPlayback(BaseTrack const &track) override | SpotifyBackend | virtual |
setVolume(size_t const percent) override | SpotifyBackend | virtual |
~MusicBackend() (defined in MusicBackend) | MusicBackend | inlinevirtual |
spotify music backend class which handles api calls and starts the authentication process + More...
+ +#include <SpotifyBackend.h>
Public Member Functions | |
-virtual TResultOpt | initBackend (void) override |
-virtual TResult< std::vector< Track > > | queryTracks (std::string const &pattern, size_t const num) override |
-virtual TResultOpt | setPlayback (Track const &track) override |
-virtual TResult< PlaybackTrack > | getCurrentPlayback (void) override |
-virtual TResultOpt | pause (void) override |
-virtual TResultOpt | play () override |
virtual TResultOpt | initBackend () override |
Initalizes the backend. More... | |
virtual TResult< std::vector< BaseTrack > > | queryTracks (std::string const &pattern, size_t const num) override |
Queries the backend for all tracks given a pattern. More... | |
virtual TResultOpt | setPlayback (BaseTrack const &track) override |
Set the given track as playback (means the track gets played). More... | |
virtual TResult< std::optional< PlaybackTrack > > | getCurrentPlayback () override |
Returns the current playback of the active device as a playback track. More... | |
virtual TResultOpt | pause () override |
Pauses the current playback. More... | |
virtual TResultOpt | play () override |
Resumes the current playback. More... | |
-virtual TResult< size_t > | getVolume (void) override |
-virtual TResultOpt | setVolume (size_t const percent) override |
virtual TResult< size_t > | getVolume () override |
Returns the volume of the actual device in percent. More... | |
virtual TResultOpt | setVolume (size_t const percent) override |
Sets a new volume. More... | |
virtual TResult< BaseTrack > | createBaseTrack (TTrackID const &trackID) override |
Creates a new BaseTrack instance with the given trackID. More... | |
spotify music backend class which handles api calls and starts the authentication process
+all methods are capable of refreshing the token, if it gets expired
+
+
|
+ +overridevirtual | +
Creates a new BaseTrack instance with the given trackID.
+the trackID is the same as the spotify uri string
trackID | Unique track ID (returned for example by queryTracks). |
Implements MusicBackend.
+ +
+
|
+ +overridevirtual | +
Returns the current playback of the active device as a playback track.
+Implements MusicBackend.
+ +
+
|
+ +overridevirtual | +
Returns the volume of the actual device in percent.
+Implements MusicBackend.
+ +
+
|
+ +overridevirtual | +
Initalizes the backend.
+This function must be called to start the authorization server which is needed to acquire an access token.
+ +Implements MusicBackend.
+ +
+
|
+ +overridevirtual | +
Pauses the current playback.
+Implements MusicBackend.
+ +
+
|
+ +overridevirtual | +
Resumes the current playback.
+Implements MusicBackend.
+ +
+
|
+ +overridevirtual | +
Queries the backend for all tracks given a pattern.
+pattern | Search patten (wildcard support depends on the backend). |
num | Maximum number of returned tracks (maximum is 50). |
Implements MusicBackend.
+ +
+
|
+ +overridevirtual | +
Set the given track as playback (means the track gets played).
+This method checks if there are any active Spotify devices (webplayer, smartphone,...), if not KeyNotFound is returned.
+The next step is to check if playingDevice
is set in the configuration file. If yes, and this device is currently active, it gets selected for the playback, otherwise the currently selected (Spotify Connect) device is used.
track | track to play |
Implements MusicBackend.
+ +
+
|
+ +overridevirtual | +
Sets a new volume.
+If a device is given in the ini file, this device gets selected. If no such device is given, the actual active device is used.
percent | Volume in percent. |
Implements MusicBackend.
+ +
| ||||||||||||
|
-
| Device (SpotifyApi) | +
|
-NetworkListener |
|
-
| SpotifyBackend | +|||||
Devices (SpotifyApi) | +SpotifyDummy (SpotifyApi) | +|||||||||||
Album (SpotifyApi) | +
|
+NetworkAPI | +RAMDataStore | +SpotifyError (SpotifyApi) | ||||||||
| ||||||||||||
Artist (SpotifyApi) | +NetworkListener | +RequestInformation | +SpotifyPaging (SpotifyApi) | +|||||||||
|
+Error | +
|
+ResponseInformation | +
|
||||||||
ConfigHandler | -LoggingHandler | +|||||||||||
|
RestAPI | -Track | ||||||||||
| ||||||||||||
BaseTrack | +Playback (SpotifyApi) | +RestRequestHandler | +Token (SpotifyApi) | +|||||||||
|
-
| Image (SpotifyApi) | +PlaybackTrack | +
|
-PlaybackTrack | -RestEndpointHandler | -||||||
| Track (SpotifyApi) | +|||||||||||
|
-
|
|
||||||||||
Error | -MusicBackend | +|||||||||||
ConfigHandler | +Serializer | |||||||||||
| ||||||||||||
|
-
| JukeBox | +Queue | +SimpleScheduler | +||||||||
|
-Queue | -SpotifyBackend | +QueuedTrack | +SpotifyAPI (SpotifyApi) | ||||||||
JukeBox | -NetworkAPI | +|||||||||||
DataStore | +QueueStatus | +SpotifyAuthorization (SpotifyApi) | +||||||||||
MusicBackend | ||||||||||||
+ VirtualJukebox
+
+ |
+
+Files | |
file | SpotifyAPI.cpp |
Class SpotifyAPI definition. | |
file | SpotifyAPI.h [code] |
Class SpotifyAPI definition. | |
file | SpotifyAPITypes.cpp |
Contains Structures for the Spotify Api implementation. | |
file | SpotifyAPITypes.h [code] |
Contains Structures for the Spotify Api. | |
file | SpotifyAuthorization.cpp |
Class SpotifyAuthorization implementation. | |
file | SpotifyAuthorization.h [code] |
Class SpotifyAuthorization definition. | |
file | SpotifyBackend.cpp |
Class handles Music Playback with a Spotify Backend. | |
file | SpotifyBackend.h [code] |
Class handles Music Playback with a Spotify Backend. | |
+ VirtualJukebox
+
+ |
+
+Files | |
file | RequestInformation.h [code] |
Definition of class RequestInformation. | |
file | RestAPI.cpp |
Implementation of class RestAPI. | |
file | RestAPI.h [code] |
Definition of class RestAPI. | |
file | RestEndpointHandlers.cpp |
Handler functions for all available REST endpoints. | |
file | RestEndpointHandlers.h [code] |
Handler functions for all available REST endpoints. | |
file | RestRequestHandler.cpp |
Implementation of class RestRequestHandler. | |
file | RestRequestHandler.h [code] |
Definition of class RestRequestHandler. | |
+Directories |
Files | |
file | ConfigHandler.cpp |
Class ConfigHandler implementation. | |
file | ConfigHandler.h [code] |
Class ConfigHandler definition. | |
file | GlobalTypes.h [code] |
Defines types and constants that are used globally. | |
file | DataStore.h [code] |
Class DataStore definition. | |
file | JukeBox.cpp |
Class JukeBox implementation. | |
Class JukeBox implementation. | |
file | JukeBox.h [code] |
Class JukeBox definition. | |
file | LoggingHandler.cpp |
Class LoggingHandler implementation. | |
file | LoggingHandler.h [code] |
Class LoggingHandler definition. | |
Class JukeBox definition. | |
file | main.cpp |
Main program for project "Virtual JukeBox". | |
Main program for project "VirtualJukeBox". | |
file | MusicBackend.h [code] |
Interface for MusicBackends. | |
Interface for MusicBackend. | |
file | NetworkAPI.cpp |
Implementation of class NetworkAPI. | |
file | NetworkListener.h [code] |
Interface Class NetworkListener definition. | |
file | Queue.cpp |
Class Queue implementation. | |
file | Queue.h [code] |
Class Queue definition. | |
file | RestAPI.cpp |
Implementation of class RestAPI. | |
file | RestAPI.h [code] |
Definition of class RestAPI. | |
file | RestEndpointHandler.cpp |
Implementation of class RestEndpointHandler. | |
file | RestEndpointHandler.h [code] |
Definition of class RestEndpointHandler. | |
file | Result.cpp |
Implements functions. | |
file | Result.h [code] |
Defines function return values and types. | |
file | SpotifyBackend.h [code] |
Class handles Music Playback with a Spotify Backend. | |
file | Track.cpp |
Class Track implementation. | |
file | Track.h [code] |
Class Track definition. | |
+ VirtualJukebox
+
+ |
+
+Files | |
file | ConfigHandler.cpp |
Class ConfigHandler implementation. | |
file | ConfigHandler.h [code] |
Class ConfigHandler definition. | |
file | LoggingHandler.cpp |
LoggingHandler implementation. | |
file | LoggingHandler.h [code] |
LoggingHandler header file. | |
file | Serializer.cpp |
Implementation of class Serializer. | |
file | Serializer.h [code] |
Definition of class Serializer. | |
file | SimpleScheduler.cpp |
Class SimpleScheduler implementation. | |
file | SimpleScheduler.h [code] |
Class SimpleScheduler definition. | |
+ VirtualJukebox
+
+ |
+
+Files | |
file | GlobalTypes.h [code] |
Defines types and constants that are used globally. | |
file | Queue.h [code] |
Class Queue definition. | |
file | Result.h [code] |
Defines function return values and types. | |
file | Tracks.h [code] |
Definitions of all track related structs. | |
+ VirtualJukebox
+
+ |
+
+Files | |
file | RAMDataStore.h [code] |
Class RAMDataStore implementation. | |
▼ src | |
ConfigHandler.cpp | Class ConfigHandler implementation |
ConfigHandler.h | Class ConfigHandler definition |
GlobalTypes.h | Defines types and constants that are used globally |
JukeBox.cpp | Class JukeBox implementation |
JukeBox.h | Class JukeBox definition |
LoggingHandler.cpp | Class LoggingHandler implementation |
LoggingHandler.h | Class LoggingHandler definition |
main.cpp | Main program for project "Virtual JukeBox" |
MusicBackend.h | Interface for MusicBackends |
NetworkAPI.cpp | Implementation of class NetworkAPI |
NetworkAPI.h | Definition of class NetworkAPI |
NetworkListener.h | Interface Class NetworkListener definition |
PlaybackTrack.h | |
Queue.cpp | Class Queue implementation |
Queue.h | Class Queue definition |
RestAPI.cpp | Implementation of class RestAPI |
RestAPI.h | Definition of class RestAPI |
RestEndpointHandler.cpp | Implementation of class RestEndpointHandler |
RestEndpointHandler.h | Definition of class RestEndpointHandler |
Result.cpp | Implements functions |
Result.h | Defines function return values and types |
SpotifyBackend.h | Class handles Music Playback with a Spotify Backend |
Track.cpp | Class Track implementation |
Track.h | Class Track definition |
▼ Datastore | |
RAMDataStore.h | Class RAMDataStore implementation |
▼ Network | |
RequestInformation.h | Definition of class RequestInformation |
RestAPI.cpp | Implementation of class RestAPI |
RestAPI.h | Definition of class RestAPI |
RestEndpointHandlers.cpp | Handler functions for all available REST endpoints |
RestEndpointHandlers.h | Handler functions for all available REST endpoints |
RestRequestHandler.cpp | Implementation of class RestRequestHandler |
RestRequestHandler.h | Definition of class RestRequestHandler |
▼ Spotify | |
SpotifyAPI.cpp | Class SpotifyAPI definition |
SpotifyAPI.h | Class SpotifyAPI definition |
SpotifyAPITypes.cpp | Contains Structures for the Spotify Api implementation |
SpotifyAPITypes.h | Contains Structures for the Spotify Api |
SpotifyAuthorization.cpp | Class SpotifyAuthorization implementation |
SpotifyAuthorization.h | Class SpotifyAuthorization definition |
SpotifyBackend.cpp | Class handles Music Playback with a Spotify Backend |
SpotifyBackend.h | Class handles Music Playback with a Spotify Backend |
▼ Types | |
GlobalTypes.h | Defines types and constants that are used globally |
Queue.h | Class Queue definition |
Result.h | Defines function return values and types |
Tracks.h | Definitions of all track related structs |
▼ Utils | |
ConfigHandler.cpp | Class ConfigHandler implementation |
ConfigHandler.h | Class ConfigHandler definition |
LoggingHandler.cpp | LoggingHandler implementation |
LoggingHandler.h | LoggingHandler header file |
Serializer.cpp | Implementation of class Serializer |
Serializer.h | Definition of class Serializer |
SimpleScheduler.cpp | Class SimpleScheduler implementation |
SimpleScheduler.h | Class SimpleScheduler definition |
DataStore.h | Class DataStore definition |
JukeBox.cpp | Class JukeBox implementation |
JukeBox.h | Class JukeBox definition |
main.cpp | Main program for project "VirtualJukeBox" |
MusicBackend.h | Interface for MusicBackend |
NetworkAPI.cpp | Implementation of class NetworkAPI |
NetworkAPI.h | Definition of class NetworkAPI |
NetworkListener.h | Interface Class NetworkListener definition |
CConfigHandler | |
CError | A customized error type |
▼Chttp_resource | |
CRestEndpointHandler | Provides REST endpoints for incoming connections |
CLoggingHandler | |
▼CMusicBackend | |
CSpotifyBackend | |
▼CNetworkAPI | Base class for all implementations of network interfaces |
CRestAPI | Implementation of the REST API |
▼CNetworkListener | Provides interface methods for all supported requests |
CJukeBox | |
CPlaybackTrack | |
CQueue | |
CTrack | |
CSpotifyApi::Album | Simplified Spotify Album class |
CSpotifyApi::Artist | Simplified artist object |
▼CBaseTrack | The most basic representation of a track |
CPlaybackTrack | Specialized track representing the currently playing track |
CQueuedTrack | Specialized track which is found inside queues |
CConfigHandler | Singleton class which provides shared access to the configuration file used |
▼CDataStore | Interface for storing Data such as Tracks, Users, Votes, etc |
CRAMDataStore | Implements a DataStore which stores its data purly in RAM (no persistance) |
CSpotifyApi::Device | Device Object |
CSpotifyApi::Devices | Wrapper class for multiple devices |
CError | A customized error type |
▼Chttp_resource | |
CRestRequestHandler | Provides a REST request handler for incoming connections |
CSpotifyApi::SpotifyAuthorization | Handles the 3 parties user authentication |
CSpotifyApi::Image | Spotify Image Class |
▼CMusicBackend | Provides an abstracted interface to a MusicBackend s |
CSpotifyBackend | Spotify music backend class which handles api calls and starts the authentication process |
▼CNetworkAPI | Base class for all implementations of network interfaces |
CRestAPI | Implementation of the REST API |
▼CNetworkListener | Provides interface methods for all supported requests |
CJukeBox | Core class which combines all interface implementations in a working server application |
CSpotifyApi::Playback | Contains infos about the actual playback |
CQueue | Respresents a queue which is returned to the clients |
CQueueStatus | Wraps all information to return if a client requests the current queue status |
CRequestInformation | Wraps all relevant pieces of information provided by a HTTP request |
CResponseInformation | Wraps all needed pieces of information to form a proper HTTP response |
CSerializer | Template class which can be used as a central class for serialization routines for different data types |
CSimpleScheduler | A simple track scheduler (for presentation purposes) |
CSpotifyApi::SpotifyAPI | Handles the calls with the spotify web api |
CSpotifyApi::SpotifyDummy | Type gets used, when no content data or Error is received |
CSpotifyApi::SpotifyError | Error type |
CSpotifyApi::SpotifyPaging | Represents one page of search results |
CSpotifyApi::Token | Return type on valid token request |
CSpotifyApi::Track | Simplified track object |
Main program for project "Virtual JukeBox". +
Main program for project "VirtualJukeBox". More...
-#include <iostream>
#include <glog/logging.h>
#include <iostream>
#include <string>
#include "ConfigHandler.h"
#include "JukeBox.h"
#include "LoggingHandler.h"
#include "Result.h"
#include "Types/Result.h"
#include "Utils/ConfigHandler.h"
#include "Utils/LoggingHandler.h"
Functions | |
-int | main () |
+int | main (int argc, char *argv[]) |
Main program for project "Virtual JukeBox".
- +Main program for project "VirtualJukeBox".
+ +Usage: ./executable [<filepath-to-config-file.ini>]
401 Unauthorized
403 Forbidden
404 Not found
track_id
s also trigger this error.405 Method not allowed
422 Unprocessable Entity
440 Login-Time-out
500 Internal Server Error
502 Bad Gateway
Note: More errors may be added in the future!
In case of an error (i.e. HTTP status code is not 200
) the response body looks like this:
The value of player_action
controls which action the server should take. Valid values are:
"play"
: Starts or resumes playback"play"
: Starts or resumes playback."pause"
: Pauses the playback. If it is already paused or stopped nothing happens."stop"
: Stops playback and remove the currently playing track (if any). If playback is paused remove the track as well. If it is already stopped nothing happens."skip"
: Removes the currently playing (or paused) track and play the next one in the queue. If playback is stopped remove the next queued track without resuming playback."volume_up"
: Raises the volume by a fixed amount if it is not already at its maximum value."volume_down"
: Lowers the volume by a fixed amount if it is not already at its minimum value.
+ VirtualJukebox
+
+ |
+
This is the complete list of members for PlaybackTrack, including all inherited members.
+addedBy (defined in BaseTrack) | BaseTrack | |
album (defined in BaseTrack) | BaseTrack | |
artist (defined in BaseTrack) | BaseTrack | |
durationMs (defined in BaseTrack) | BaseTrack | |
iconUri (defined in BaseTrack) | BaseTrack | |
isPlaying (defined in PlaybackTrack) | PlaybackTrack | |
operator==(const BaseTrack &tr) (defined in BaseTrack) | BaseTrack | inline |
progressMs (defined in PlaybackTrack) | PlaybackTrack | |
title (defined in BaseTrack) | BaseTrack | |
trackId (defined in BaseTrack) | BaseTrack |
+ VirtualJukebox
+
+ |
+
Specialized track representing the currently playing track. + More...
+ +#include <Tracks.h>
+Public Attributes | |
+int | progressMs |
+bool | isPlaying |
Public Attributes inherited from BaseTrack | |
+TTrackID | trackId |
+std::string | title |
+std::string | album |
+std::string | artist |
+unsigned | durationMs |
+std::string | iconUri |
+std::string | addedBy |
+Additional Inherited Members | |
Public Member Functions inherited from BaseTrack | |
+bool | operator== (const BaseTrack &tr) |
Specialized track representing the currently playing track.
+
+ VirtualJukebox
+
+ |
+
This is the complete list of members for Queue, including all inherited members.
+tracks (defined in Queue) | Queue |
+ VirtualJukebox
+
+ |
+
Respresents a queue which is returned to the clients. + More...
+ +#include <Queue.h>
+Public Attributes | |
+std::vector< QueuedTrack > | tracks |
Respresents a queue which is returned to the clients.
+
+ VirtualJukebox
+
+ |
+
This is the complete list of members for QueueStatus, including all inherited members.
+adminQueue (defined in QueueStatus) | QueueStatus | |
currentTrack (defined in QueueStatus) | QueueStatus | |
normalQueue (defined in QueueStatus) | QueueStatus |
+ VirtualJukebox
+
+ |
+
Wraps all information to return if a client requests the current queue status. + More...
+ +#include <Queue.h>
+Public Attributes | |
+Queue | normalQueue |
+Queue | adminQueue |
+std::optional< PlaybackTrack > | currentTrack |
Wraps all information to return if a client requests the current queue status.
+
+ VirtualJukebox
+
+ |
+
This is the complete list of members for QueuedTrack, including all inherited members.
+addedBy (defined in BaseTrack) | BaseTrack | |
album (defined in BaseTrack) | BaseTrack | |
artist (defined in BaseTrack) | BaseTrack | |
durationMs (defined in BaseTrack) | BaseTrack | |
iconUri (defined in BaseTrack) | BaseTrack | |
insertedAt (defined in QueuedTrack) | QueuedTrack | |
operator<(const QueuedTrack tr) (defined in QueuedTrack) | QueuedTrack | inline |
operator==(const BaseTrack &tr) (defined in BaseTrack) | BaseTrack | inline |
title (defined in BaseTrack) | BaseTrack | |
trackId (defined in BaseTrack) | BaseTrack | |
userHasVoted (defined in QueuedTrack) | QueuedTrack | |
votes (defined in QueuedTrack) | QueuedTrack |
+ VirtualJukebox
+
+ |
+
Specialized track which is found inside queues. + More...
+ +#include <Tracks.h>
+Public Member Functions | |
+bool | operator< (const QueuedTrack tr) |
Public Member Functions inherited from BaseTrack | |
+bool | operator== (const BaseTrack &tr) |
+Public Attributes | |
+int | votes |
+TVote | userHasVoted |
+uint64_t | insertedAt |
Public Attributes inherited from BaseTrack | |
+TTrackID | trackId |
+std::string | title |
+std::string | album |
+std::string | artist |
+unsigned | durationMs |
+std::string | iconUri |
+std::string | addedBy |
Specialized track which is found inside queues.
+
+ VirtualJukebox
+
+ |
+
This is the complete list of members for RequestInformation, including all inherited members.
+args (defined in RequestInformation) | RequestInformation | |
body (defined in RequestInformation) | RequestInformation | |
method (defined in RequestInformation) | RequestInformation | |
path (defined in RequestInformation) | RequestInformation |
+ VirtualJukebox
+
+ |
+
Wraps all relevant pieces of information provided by a HTTP request. + More...
+ +#include <RequestInformation.h>
+Public Attributes | |
+std::string | path |
+std::string | method |
+std::string | body |
+std::map< std::string, std::string, httpserver::http::arg_comparator > | args |
Wraps all relevant pieces of information provided by a HTTP request.
+
+ VirtualJukebox
+
+ |
+
This is the complete list of members for ResponseInformation, including all inherited members.
+body (defined in ResponseInformation) | ResponseInformation | |
code (defined in ResponseInformation) | ResponseInformation |
+ VirtualJukebox
+
+ |
+
Wraps all needed pieces of information to form a proper HTTP response. + More...
+ +#include <RequestInformation.h>
+Public Attributes | |
+std::string | body |
+int | code = 200 |
Wraps all needed pieces of information to form a proper HTTP response.
+