|
a |
|
b/upmpd/rendering.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 _RENDERING_H_X_INCLUDED_
|
|
|
18 |
#define _RENDERING_H_X_INCLUDED_
|
|
|
19 |
|
|
|
20 |
#include <string>
|
|
|
21 |
|
|
|
22 |
#include "libupnpp/device.hxx"
|
|
|
23 |
|
|
|
24 |
class UpMpd;
|
|
|
25 |
|
|
|
26 |
class UpMpdRenderCtl : public UpnpService {
|
|
|
27 |
public:
|
|
|
28 |
UpMpdRenderCtl(UpMpd *dev);
|
|
|
29 |
|
|
|
30 |
virtual bool getEventData(bool all, std::vector<std::string>& names,
|
|
|
31 |
std::vector<std::string>& values);
|
|
|
32 |
virtual const std::string& getServiceType();
|
|
|
33 |
|
|
|
34 |
private:
|
|
|
35 |
bool rdstateMToU(unordered_map<string, string>& status);
|
|
|
36 |
int setMute(const SoapArgs& sc, SoapData& data);
|
|
|
37 |
int getMute(const SoapArgs& sc, SoapData& data);
|
|
|
38 |
int setVolume(const SoapArgs& sc, SoapData& data, bool isDb);
|
|
|
39 |
int getVolume(const SoapArgs& sc, SoapData& data, bool isDb);
|
|
|
40 |
int listPresets(const SoapArgs& sc, SoapData& data);
|
|
|
41 |
int selectPreset(const SoapArgs& sc, SoapData& data);
|
|
|
42 |
|
|
|
43 |
UpMpd *m_dev;
|
|
|
44 |
// Desired volume target. We may delay executing small volume
|
|
|
45 |
// changes to avoid saturating with small requests.
|
|
|
46 |
int m_desiredvolume;
|
|
|
47 |
// State variable storage
|
|
|
48 |
unordered_map<string, string> m_rdstate;
|
|
|
49 |
};
|
|
|
50 |
|
|
|
51 |
#endif /* _RENDERING_H_X_INCLUDED_ */
|