Switch to unified view

a/src/ohreceiver.hxx b/src/ohreceiver.hxx
...
...
33
class OHProduct;
33
class OHProduct;
34
34
35
struct OHReceiverParams {
35
struct OHReceiverParams {
36
    enum PlayMethod {OHRP_MPD, OHRP_ALSA};
36
    enum PlayMethod {OHRP_MPD, OHRP_ALSA};
37
    PlayMethod pm;
37
    PlayMethod pm;
38
    OHPlaylist *pl;
39
    OHProduct *pr;
40
    int httpport;
38
    int httpport;
41
    OHReceiverParams() : pm(OHRP_MPD), pl(0), pr(0), httpport(8768) {}
39
    OHReceiverParams() : pm(OHRP_MPD), httpport(8768) {}
42
};
40
};
43
41
44
class OHReceiver : public UPnPProvider::UpnpService {
42
class OHReceiver : public UPnPProvider::UpnpService {
45
public:
43
public:
46
    OHReceiver(UpMpd *dev, const OHReceiverParams& parms);
44
    OHReceiver(UpMpd *dev, const OHReceiverParams& parms);
47
45
48
    virtual bool getEventData(bool all, std::vector<std::string>& names, 
46
    virtual bool getEventData(bool all, std::vector<std::string>& names, 
49
                              std::vector<std::string>& values);
47
                              std::vector<std::string>& values);
50
48
51
    virtual bool iStop();
49
    bool iStop();
50
    bool iPlay();
51
    bool iSetSender(const std::string& uri, const std::string& meta);
52
52
53
private:
53
private:
54
    int play(const SoapIncoming& sc, SoapOutgoing& data);
54
    int play(const SoapIncoming& sc, SoapOutgoing& data);
55
    int stop(const SoapIncoming& sc, SoapOutgoing& data);
55
    int stop(const SoapIncoming& sc, SoapOutgoing& data);
56
    int setSender(const SoapIncoming& sc, SoapOutgoing& data);
56
    int setSender(const SoapIncoming& sc, SoapOutgoing& data);
...
...
58
    int protocolInfo(const SoapIncoming& sc, SoapOutgoing& data);
58
    int protocolInfo(const SoapIncoming& sc, SoapOutgoing& data);
59
    int transportState(const SoapIncoming& sc, SoapOutgoing& data);
59
    int transportState(const SoapIncoming& sc, SoapOutgoing& data);
60
60
61
    bool makestate(std::unordered_map<std::string, std::string> &st);
61
    bool makestate(std::unordered_map<std::string, std::string> &st);
62
    void maybeWakeUp(bool ok);
62
    void maybeWakeUp(bool ok);
63
63
    // State variable storage (previous state)
64
    // State variable storage (previous state)
64
    std::unordered_map<std::string, std::string> m_state;
65
    std::unordered_map<std::string, std::string> m_state;
65
    // Current
66
    // Current
66
    std::string m_uri;
67
    std::string m_uri;
67
    std::string m_metadata;
68
    std::string m_metadata;
68
69
69
    UpMpd *m_dev;
70
    UpMpd *m_dev;
70
    OHPlaylist *m_pl;
71
    OHProduct *m_pr;
72
73
    std::shared_ptr<ExecCmd> m_cmd;
71
    std::shared_ptr<ExecCmd> m_cmd;
74
    int m_httpport;
72
    int m_httpport;
75
    std::string m_httpuri;
73
    std::string m_httpuri;
76
    OHReceiverParams::PlayMethod m_pm;
74
    OHReceiverParams::PlayMethod m_pm;
77
};
75
};