|
a/src/ohplaylist.hxx |
|
b/src/ohplaylist.hxx |
|
... |
|
... |
21 |
#include <unordered_map> // for unordered_map
|
21 |
#include <unordered_map> // for unordered_map
|
22 |
#include <vector> // for vector
|
22 |
#include <vector> // for vector
|
23 |
|
23 |
|
24 |
#include "libupnpp/device/device.hxx" // for UpnpService
|
24 |
#include "libupnpp/device/device.hxx" // for UpnpService
|
25 |
#include "libupnpp/soaphelp.hxx" // for SoapIncoming, SoapOutgoing
|
25 |
#include "libupnpp/soaphelp.hxx" // for SoapIncoming, SoapOutgoing
|
|
|
26 |
|
26 |
#include "mpdcli.hxx"
|
27 |
#include "mpdcli.hxx"
|
27 |
|
28 |
#include "ohservice.hxx"
|
28 |
class UpMpd;
|
|
|
29 |
|
29 |
|
30 |
using namespace UPnPP;
|
30 |
using namespace UPnPP;
|
31 |
|
31 |
|
32 |
class OHPlaylist : public UPnPProvider::UpnpService {
|
32 |
class OHPlaylist : public OHService {
|
33 |
public:
|
33 |
public:
|
34 |
OHPlaylist(UpMpd *dev, unsigned int cachesavesleep);
|
34 |
OHPlaylist(UpMpd *dev, unsigned int cachesavesleep);
|
35 |
|
35 |
|
36 |
virtual bool getEventData(bool all, std::vector<std::string>& names,
|
|
|
37 |
std::vector<std::string>& values);
|
|
|
38 |
bool cacheFind(const std::string& uri, std:: string& meta);
|
36 |
bool cacheFind(const std::string& uri, std:: string& meta);
|
39 |
|
37 |
|
40 |
// Internal non-soap versions of some of the interface for use by
|
38 |
// Internal non-soap versions of some of the interface for use by
|
41 |
// e.g. ohreceiver
|
39 |
// e.g. ohreceiver
|
42 |
bool insertUri(int afterid, const std::string& uri,
|
40 |
bool insertUri(int afterid, const std::string& uri,
|
|
... |
|
... |
48 |
int iStop();
|
46 |
int iStop();
|
49 |
void refreshState();
|
47 |
void refreshState();
|
50 |
|
48 |
|
51 |
// Source active ?
|
49 |
// Source active ?
|
52 |
void setActive(bool onoff);
|
50 |
void setActive(bool onoff);
|
53 |
|
51 |
|
|
|
52 |
protected:
|
|
|
53 |
virtual bool makestate(std::unordered_map<std::string, std::string> &st);
|
54 |
private:
|
54 |
private:
|
55 |
int play(const SoapIncoming& sc, SoapOutgoing& data);
|
55 |
int play(const SoapIncoming& sc, SoapOutgoing& data);
|
56 |
int pause(const SoapIncoming& sc, SoapOutgoing& data);
|
56 |
int pause(const SoapIncoming& sc, SoapOutgoing& data);
|
57 |
int stop(const SoapIncoming& sc, SoapOutgoing& data);
|
57 |
int stop(const SoapIncoming& sc, SoapOutgoing& data);
|
58 |
int next(const SoapIncoming& sc, SoapOutgoing& data);
|
58 |
int next(const SoapIncoming& sc, SoapOutgoing& data);
|
|
... |
|
... |
76 |
int idArray(const SoapIncoming& sc, SoapOutgoing& data);
|
76 |
int idArray(const SoapIncoming& sc, SoapOutgoing& data);
|
77 |
int idArrayChanged(const SoapIncoming& sc, SoapOutgoing& data);
|
77 |
int idArrayChanged(const SoapIncoming& sc, SoapOutgoing& data);
|
78 |
int protocolInfo(const SoapIncoming& sc, SoapOutgoing& data);
|
78 |
int protocolInfo(const SoapIncoming& sc, SoapOutgoing& data);
|
79 |
|
79 |
|
80 |
bool makeIdArray(std::string&);
|
80 |
bool makeIdArray(std::string&);
|
81 |
bool makestate(std::unordered_map<std::string, std::string> &st);
|
|
|
82 |
void maybeWakeUp(bool ok);
|
81 |
void maybeWakeUp(bool ok);
|
83 |
|
|
|
84 |
// State variable storage
|
|
|
85 |
std::unordered_map<std::string, std::string> m_state;
|
|
|
86 |
UpMpd *m_dev;
|
|
|
87 |
|
82 |
|
88 |
bool m_active;
|
83 |
bool m_active;
|
89 |
MpdState m_mpdsavedstate;
|
84 |
MpdState m_mpdsavedstate;
|
90 |
|
85 |
|
91 |
// Storage for song metadata, indexed by URL. This used to be
|
86 |
// Storage for song metadata, indexed by URL. This used to be
|