Switch to unified view

a/libupnpp/control/avtransport.hxx b/libupnpp/control/avtransport.hxx
...
...
44
            registerCallback();
44
            registerCallback();
45
        }
45
        }
46
46
47
    AVTransport() {}
47
    AVTransport() {}
48
48
49
    enum TransportState {Unknown, Stopped, Playing, Transitioning, 
50
                         PausedPlayback, PausedRecording, Recording, 
51
                         NoMediaPresent};
52
    enum TransportStatus {TPS_Unknown, TPS_Ok, TPS_Error};
53
    enum PlayMode {PM_Unknown, PM_Normal, PM_Shuffle, PM_RepeatOne, 
54
                   PM_RepeatAll, PM_Random, PM_Direct1};
55
56
57
    int setAVTransportURI(const std::string& uri, const std::string& metadata,
49
    int setAVTransportURI(const std::string& uri, const std::string& metadata,
58
                          int instanceID=0)
50
                          int instanceID=0)
59
    {
51
    {
60
        return setURI(uri, metadata, instanceID, false);
52
        return setURI(uri, metadata, instanceID, false);
61
    }
53
    }
...
...
64
                              int instanceID=0)
56
                              int instanceID=0)
65
    {
57
    {
66
        return setURI(uri, md, instanceID, true);
58
        return setURI(uri, md, instanceID, true);
67
    }
59
    }
68
60
61
62
    enum PlayMode {PM_Unknown, PM_Normal, PM_Shuffle, PM_RepeatOne, 
63
                   PM_RepeatAll, PM_Random, PM_Direct1};
69
    int setPlayMode(PlayMode pm, int instanceID=0);
64
    int setPlayMode(PlayMode pm, int instanceID=0);
70
65
71
    struct MediaInfo {
66
    struct MediaInfo {
72
        int nrtracks;
67
        int nrtracks;
73
        int mduration; // seconds
68
        int mduration; // seconds
...
...
79
        std::string rcstoragemed;
74
        std::string rcstoragemed;
80
        std::string ws;
75
        std::string ws;
81
    };
76
    };
82
    int getMediaInfo(MediaInfo& info, int instanceID=0);
77
    int getMediaInfo(MediaInfo& info, int instanceID=0);
83
78
79
    enum TransportState {Unknown, Stopped, Playing, Transitioning, 
80
                         PausedPlayback, PausedRecording, Recording, 
81
                         NoMediaPresent};
82
    enum TransportStatus {TPS_Unknown, TPS_Ok, TPS_Error};
84
    struct TransportInfo {
83
    struct TransportInfo {
85
        TransportState tpstate;
84
        TransportState tpstate;
86
        TransportStatus tpstatus;
85
        TransportStatus tpstatus;
87
        int curspeed;
86
        int curspeed;
88
    };
87
    };
...
...
115
114
116
    int stop(int instanceID=0);
115
    int stop(int instanceID=0);
117
    int pause(int instanceID=0);
116
    int pause(int instanceID=0);
118
    int play(int speed = 1, int instanceID = 0);
117
    int play(int speed = 1, int instanceID = 0);
119
118
120
    enum SeekMode {SEEK_TRACK_NR, SEEK_ABS_TIME,
119
    enum SeekMode {SEEK_TRACK_NR, SEEK_ABS_TIME, SEEK_REL_TIME, SEEK_ABS_COUNT,
121
                   SEEK_REL_TIME, SEEK_ABS_COUNT,
122
                   SEEK_REL_COUNT, SEEK_CHANNEL_FREQ, 
120
                   SEEK_REL_COUNT, SEEK_CHANNEL_FREQ, SEEK_TAPE_INDEX, 
123
                   SEEK_TAPE_INDEX, SEEK_FRAME};
121
                   SEEK_FRAME};
124
    // Target in seconds for times.
122
    // Target in seconds for times.
125
    int seek(SeekMode mode, int target, int instanceID=0); 
123
    int seek(SeekMode mode, int target, int instanceID=0); 
126
124
127
    // These are for multitrack medium like a CD. No meaning for electronic
125
    // These are for multitrack medium like a CD. No meaning for electronic
128
    // tracks where set(next)AVTransportURI() is used
126
    // tracks where set(next)AVTransportURI() is used
129
    int next(int instanceID=0);
127
    int next(int instanceID=0);
130
    int previous(int instanceID=0);
128
    int previous(int instanceID=0);
131
129
130
    enum TransportActions {TPA_Next = 1, TPA_Pause = 2, TPA_Play = 4,
131
                           TPA_Previous = 8, TPA_Seek = 16, TPA_Stop = 32};
132
    int getCurrentTransportActions(std::string& actions, int instanceID=0);
132
    int getCurrentTransportActions(int& actions, int instanceID=0);
133
133
134
    /** Test service type from discovery message */
134
    /** Test service type from discovery message */
135
    static bool isAVTService(const std::string& st);
135
    static bool isAVTService(const std::string& st);
136
136
137
protected:
137
protected:
138
    static const std::string SType;
138
    static const std::string SType;
139
    int setURI(const std::string& uri, const std::string& metadata,
139
    int setURI(const std::string& uri, const std::string& metadata,
140
               int instanceID, bool next);
140
               int instanceID, bool next);
141
    int CTAStringToBits(const std::string& actions, int& iacts);
142
141
private:
143
private:
142
    void evtCallback(const std::unordered_map<std::string, std::string>&);
144
    void evtCallback(const std::unordered_map<std::string, std::string>&);
143
    void registerCallback();
145
    void registerCallback();
144
146
145
};
147
};