EHS
Spotify.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
ehs/EHS.h
"
4
#include "
ehs/Str.h
"
5
#include "
ehs/Array.h
"
6
#include "
ehs/io/socket/SSL.h
"
7
8
namespace
ehs
9
{
10
enum class
SpotifyState
11
{
12
TRACK
,
13
CONTEXT
,
14
OFF
15
};
16
17
struct
Track
18
{
19
Array<Str_8>
artists
;
20
Str_8
name
;
21
Str_8
id
;
22
};
23
24
class
EHS_LIB_IO
Spotify
final
25
{
26
private
:
27
SSL
client;
28
Str_8
clientId;
29
Str_8
secret;
30
Str_8
redURI;
31
Array<Str_8>
scopes;
32
bool
forceVerify;
33
Str_8
token;
34
Str_8
rToken;
35
36
public
:
37
static
const
Str_8
trackUriPrefix
;
38
39
virtual
~Spotify
();
40
41
Spotify
();
42
43
Spotify
(
Str_8
clientId,
Str_8
secret,
Str_8
redURI,
Array<Str_8>
scopes,
bool
forceVerify);
44
45
bool
Authorize();
46
50
UInt_32
SetVolume(
UInt_8
level);
51
54
UInt_32
Play();
55
58
UInt_32
Pause();
59
63
UInt_32
SetRepeat(
SpotifyState
state);
64
68
UInt_32
SetShuffle(
bool
state);
69
70
UInt_32
SearchTrack(
Vector<Str_8>
& artists,
Str_8
&
id
,
Str_8
& name);
71
72
UInt_32
GetPlayingTrack(
Vector<Str_8>
& artists,
Str_8
&
id
,
Str_8
& name);
73
74
UInt_32
GetQueue(
Array<Track>
& tracks);
75
79
UInt_32
QueueTrack(
const
Str_8
&
id
);
80
81
UInt_32
AddTracks(
const
Str_8
& playlistId,
const
Array<Str_8>
& trackIds,
const
UInt_32
pos = 0);
82
83
UInt_32
AddTrack(
const
Str_8
& playlistId,
const
Str_8
& trackId,
const
UInt_32
pos = 0);
84
87
UInt_32
Skip();
88
91
UInt_32
Previous();
92
96
UInt_32
Seek(
UInt_32
pos);
97
98
Str_8
GetClientId()
const
;
99
100
Str_8
GetSecret()
const
;
101
102
Str_8
GetRedURI()
const
;
103
104
bool
IsVerificationForced()
const
;
105
106
bool
IsActive()
const
;
107
108
private
:
109
void
StartConnection();
110
111
bool
ReAuthorize();
112
};
113
}
Array.h
EHS.h
SSL.h
Str.h
ehs::Array
Definition:
Array.h:16
ehs::SSL
A class for handling the HTTP(S) TCP socket layer.
Definition:
SSL.h:16
ehs::Spotify
Definition:
Spotify.h:25
ehs::Spotify::trackUriPrefix
static const Str_8 trackUriPrefix
Definition:
Spotify.h:37
ehs::Str< Char_8, UInt_64 >
ehs::Vector
Definition:
Vector.h:18
ehs
Definition:
Anchor.h:6
ehs::UInt_32
unsigned int UInt_32
Definition:
Types.h:49
ehs::UInt_8
unsigned char UInt_8
Definition:
Types.h:43
ehs::SpotifyState
SpotifyState
Definition:
Spotify.h:11
ehs::SpotifyState::CONTEXT
@ CONTEXT
ehs::SpotifyState::OFF
@ OFF
ehs::SpotifyState::TRACK
@ TRACK
ehs::Track
Definition:
Spotify.h:18
ehs::Track::id
Str_8 id
Definition:
Spotify.h:21
ehs::Track::artists
Array< Str_8 > artists
Definition:
Spotify.h:19
ehs::Track::name
Str_8 name
Definition:
Spotify.h:20
include
ehs
io
socket
rest
Spotify.h
Generated by
1.9.4