-
Notifications
You must be signed in to change notification settings - Fork 0
/
pianohelper.h
50 lines (39 loc) · 1.27 KB
/
pianohelper.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#ifndef PIANOHELPER_H
#define PIANOHELPER_H
//System Libraries
#include <vector>
#include <fstream>
#include <sstream>
#include <iostream>
//Other files
#include "pandorastation.h"
#include "pandorasong.h"
//Include the pianobar libraries
extern "C" {
#include "piano.h"
#include <json/json_object.h>
#include "waitress.h"
}
//The Pandora TLS_FINGERPRINT
#define TLS_FINGERPRINT "\242\240\276\212\067\222\071\256+.qLV\263\213\301*\233Kw?+-acdeghijmnpqrstux$b()="
class PianoHelper
{
public:
PianoHelper();
char *PianoJsonStrdup(json_object *json, const char* key);
/**
* Helper method that parses the linked list of stations and puts them in a
* nice c++ class. This is for the GUI and for my own sanity.
* @param stations PianoStation representation from libpianobar, this must
* be the head of the list for the program to work correctly.
*/
std::vector<PandoraStation> parseStations(PianoStation_t* stations);
/**
* Helper method that parses the linked list of songs pass by
* the pandora playlist. These songs are put into objects and
* sent into a vector. This provides some nice sanity keeping
* helper methods that help with the GUI and playback.
*/
std::vector<PandoraSong> parsePlaylist(PianoSong_t* playlist);
};
#endif // PIANOHELPER_H