libupnpp 0.16.0
A C++ wrapper for the Portable UPnP reference library
ohvolume.hxx
1/* Copyright (C) 2006-2016 J.F.Dockes
2 *
3 * This library is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU Lesser General Public
5 * License as published by the Free Software Foundation; either
6 * version 2.1 of the License, or (at your option) any later version.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public
14 * License along with this library; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
16 * 02110-1301 USA
17 */
18#ifndef _OHVOLUME_HXX_INCLUDED_
19#define _OHVOLUME_HXX_INCLUDED_
20
21#include <unordered_map>
22#include <memory>
23#include <string>
24#include <vector>
25
26#include "service.hxx"
27
28
29namespace UPnPClient {
30
31class OHVolume;
32class UPnPDeviceDesc;
33class UPnPServiceDesc;
34
35typedef std::shared_ptr<OHVolume> OHVLH;
36
56
61class UPNPP_API OHVolume : public Service {
62public:
63 using Service::Service;
64
66 static bool isOHVLService(const std::string& st);
67 bool serviceTypeMatch(const std::string& tp) override;
68
69 int characteristics(OHVCharacteristics* c);
74 int volume(int *value);
79 int setVolume(int value);
80 int volumeLimit(int *value);
81 int mute(bool *value);
82 int setMute(bool value);
83
84protected:
85 /* My service type string */
86 static const std::string SType;
87
88private:
89 void UPNPP_LOCAL evtCallback(
90 const std::unordered_map<std::string, std::string>&);
91 void UPNPP_LOCAL registerCallback() override;
92 int UPNPP_LOCAL devVolTo0100(int);
93 int UPNPP_LOCAL vol0100ToDev(int vol);
94 int UPNPP_LOCAL maybeInitVolmax();
95
96 int m_volmax{-1};
97};
98
99} // namespace UPnPClient
100
101#endif /* _OHVOLUME_HXX_INCLUDED_ */
OHVolume Service client class.
Definition ohvolume.hxx:61
Definition service.hxx:88
UPnP Description phase: interpreting the device description which we downloaded from the URL obtained...
Definition avlastchg.cxx:28
Definition ohvolume.hxx:37
int volumeMax
VolumeMax defines the absolute maximum Volume setting.
Definition ohvolume.hxx:39
int volumeUnity
VolumeUnity defines the value of Volume that will result in unity system gain (i.e.
Definition ohvolume.hxx:42
int volumeSteps
VolumeSteps defines the number of step increments required to increase the Volume from zero to Volume...
Definition ohvolume.hxx:45
int fadeMax
FadeMax defines the maximum Fade setting.
Definition ohvolume.hxx:54
int balanceMax
BalanceMax defines the maximum Balance setting.
Definition ohvolume.hxx:51
int volumeMilliDbPerStep
VolumeMilliDbPerStep defines the size of each volume step in binary milli decibels (mibi dB).
Definition ohvolume.hxx:48