|
a |
|
b/upmpd/avtransport.hxx |
|
|
1 |
/* Copyright (C) 2014 J.F.Dockes
|
|
|
2 |
* This program is free software; you can redistribute it and/or modify
|
|
|
3 |
* it under the terms of the GNU General Public License as published by
|
|
|
4 |
* the Free Software Foundation; either version 2 of the License, or
|
|
|
5 |
* (at your option) any later version.
|
|
|
6 |
*
|
|
|
7 |
* This program is distributed in the hope that it will be useful,
|
|
|
8 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
9 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
10 |
* GNU General Public License for more details.
|
|
|
11 |
*
|
|
|
12 |
* You should have received a copy of the GNU General Public License
|
|
|
13 |
* along with this program; if not, write to the
|
|
|
14 |
* Free Software Foundation, Inc.,
|
|
|
15 |
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
16 |
*/
|
|
|
17 |
#ifndef _AVTRANSPORT_H_X_INCLUDED_
|
|
|
18 |
#define _AVTRANSPORT_H_X_INCLUDED_
|
|
|
19 |
|
|
|
20 |
#include <string>
|
|
|
21 |
|
|
|
22 |
#include "libupnpp/device.hxx"
|
|
|
23 |
|
|
|
24 |
class UpMpd;
|
|
|
25 |
|
|
|
26 |
class UpMpdAVTransport : public UpnpService {
|
|
|
27 |
public:
|
|
|
28 |
UpMpdAVTransport(UpMpd *dev);
|
|
|
29 |
virtual bool getEventData(bool all,
|
|
|
30 |
std::vector<std::string>& names,
|
|
|
31 |
std::vector<std::string>& values);
|
|
|
32 |
virtual const std::string& getServiceType();
|
|
|
33 |
private:
|
|
|
34 |
int setAVTransportURI(const SoapArgs& sc, SoapData& data, bool setnext);
|
|
|
35 |
int getPositionInfo(const SoapArgs& sc, SoapData& data);
|
|
|
36 |
int getTransportInfo(const SoapArgs& sc, SoapData& data);
|
|
|
37 |
int getMediaInfo(const SoapArgs& sc, SoapData& data);
|
|
|
38 |
int getDeviceCapabilities(const SoapArgs& sc, SoapData& data);
|
|
|
39 |
int setPlayMode(const SoapArgs& sc, SoapData& data);
|
|
|
40 |
int getTransportSettings(const SoapArgs& sc, SoapData& data);
|
|
|
41 |
int getCurrentTransportActions(const SoapArgs& sc, SoapData& data);
|
|
|
42 |
int playcontrol(const SoapArgs& sc, SoapData& data, int what);
|
|
|
43 |
int seek(const SoapArgs& sc, SoapData& data);
|
|
|
44 |
int seqcontrol(const SoapArgs& sc, SoapData& data, int what);
|
|
|
45 |
// Translate MPD state to AVTransport state variables.
|
|
|
46 |
bool tpstateMToU(unordered_map<string, string>& state);
|
|
|
47 |
|
|
|
48 |
UpMpd *m_dev;
|
|
|
49 |
// State variable storage
|
|
|
50 |
unordered_map<string, string> m_tpstate;
|
|
|
51 |
string m_curMetadata;
|
|
|
52 |
string m_nextUri;
|
|
|
53 |
string m_nextMetadata;
|
|
|
54 |
// My track identifiers (for cleaning up)
|
|
|
55 |
set<int> m_songids;
|
|
|
56 |
};
|
|
|
57 |
|
|
|
58 |
#endif /* _AVTRANSPORT_H_X_INCLUDED_ */
|