Switch to unified view

a/src/ohradio.hxx b/src/ohradio.hxx
...
...
22
#include <vector>
22
#include <vector>
23
23
24
#include "libupnpp/device/device.hxx"
24
#include "libupnpp/device/device.hxx"
25
#include "libupnpp/soaphelp.hxx"
25
#include "libupnpp/soaphelp.hxx"
26
#include "mpdcli.hxx"
26
#include "mpdcli.hxx"
27
#include "ohservice.hxx"
27
28
28
class UpMpd;
29
class UpMpd;
29
30
30
using namespace UPnPP;
31
using namespace UPnPP;
31
32
32
class OHRadio : public UPnPProvider::UpnpService {
33
class OHRadio : public OHService {
33
public:
34
public:
34
    OHRadio(UpMpd *dev);
35
    OHRadio(UpMpd *dev);
35
36
36
    // We can only offer this if Python is available because of the
37
    // We can only offer this if Python is available because of the
37
    // stream uri fetching script. This is checked during construction.
38
    // stream uri fetching script. This is checked during construction.
38
    bool ok() {return m_ok;}
39
    bool ok() {return m_ok;}
39
    
40
    
40
    virtual bool getEventData(bool all, std::vector<std::string>& names,
41
                              std::vector<std::string>& values);
42
    int iStop();
41
    int iStop();
43
42
44
    // Source active ?
43
    // Source active ?
45
    void setActive(bool onoff);
44
    void setActive(bool onoff);
46
45
46
protected:
47
    bool makestate(std::unordered_map<std::string, std::string>& st);
48
    
47
private:
49
private:
48
    int channel(const SoapIncoming& sc, SoapOutgoing& data);
50
    int channel(const SoapIncoming& sc, SoapOutgoing& data);
49
    int channelsMax(const SoapIncoming& sc, SoapOutgoing& data);
51
    int channelsMax(const SoapIncoming& sc, SoapOutgoing& data);
50
    int id(const SoapIncoming& sc, SoapOutgoing& data);
52
    int id(const SoapIncoming& sc, SoapOutgoing& data);
51
    int idArray(const SoapIncoming& sc, SoapOutgoing& data);
53
    int idArray(const SoapIncoming& sc, SoapOutgoing& data);
...
...
64
66
65
    std::string metaForId(unsigned int id);
67
    std::string metaForId(unsigned int id);
66
    bool readRadios();
68
    bool readRadios();
67
    int setPlaying();
69
    int setPlaying();
68
    bool makeIdArray(std::string&);
70
    bool makeIdArray(std::string&);
69
    bool makestate(std::unordered_map<std::string, std::string>& st);
70
    void maybeWakeUp(bool ok);
71
    void maybeWakeUp(bool ok);
71
72
72
    // State variable storage
73
    std::unordered_map<std::string, std::string> m_state;
74
    UpMpd *m_dev;
75
    bool m_active;
73
    bool m_active;
76
    // Current channel id set by setId
74
    // Current channel id set by setId
77
    unsigned int m_id; 
75
    unsigned int m_id; 
78
    // MPD song id for the radio uri, or 0
76
    // MPD song id for the radio uri, or 0
79
    int m_songid;
77
    int m_songid;