libupnpp 0.16.0
A C++ wrapper for the Portable UPnP reference library
linnsongcast.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 _LINNSONGCAST_H_X_INCLUDED_
19#define _LINNSONGCAST_H_X_INCLUDED_
20
21#include <string>
22#include <vector>
23
24#include "libupnpp/control/device.hxx"
25#include "libupnpp/control/ohsender.hxx"
26#include "libupnpp/control/ohreceiver.hxx"
27#include "libupnpp/control/ohproduct.hxx"
28
35namespace UPnPClient {
36namespace Songcast {
37
42OHSNH UPNPP_API senderService(DVCH dev);
43
48OHSNH UPNPP_API getSender(const std::string& nm, std::string& reason);
49
51struct UPNPP_API SenderState {
52 std::string nm;
53 std::string UDN;
54 std::string uri;
55 std::string meta;
56 std::string reason;
57 bool has_sender{false};
58
59 OHPRH prod;
60 OHSNH sender;
61
62 void reset() {
63 nm = UDN = uri = meta = reason = std::string();
64 has_sender = false;
65 sender.reset();
66 }
67};
68
75void UPNPP_API getSenderState(const std::string& nm, SenderState& st,
76 bool live = true);
77
79void UPNPP_API listSenders(std::vector<SenderState>& vscs);
80
82struct UPNPP_API ReceiverState {
83 enum SCState {SCRS_GENERROR, SCRS_NOOH, SCRS_NOTRECEIVER,
84 SCRS_STOPPED, SCRS_PLAYING
85 };
86 SCState state{SCRS_GENERROR};
87 int receiverSourceIndex{-1};
88 std::string nm;
89 std::string UDN;
90 std::string uri;
91 std::string meta;
92 std::string reason;
93
94 OHPRH prod;
95 OHRCH rcv;
96
97 void reset() {
98 state = ReceiverState::SCRS_GENERROR;
99 receiverSourceIndex = -1;
100 nm = UDN = uri = meta = reason = std::string();
101 prod.reset();
102 rcv.reset();
103 }
104};
105
112bool UPNPP_API setSourceIndex(const std::string& rdrnm, int sourceindex);
113
120bool UPNPP_API setSourceIndexByName(const std::string& rdrnm,
121 const std::string& name);
122
129void UPNPP_API getReceiverState(const std::string& nm, ReceiverState& st,
130 bool live = true);
132void UPNPP_API listReceivers(std::vector<ReceiverState>& vscs);
133
134bool UPNPP_API setReceiverPlaying(ReceiverState& st);
135bool UPNPP_API setReceiverPlaying(ReceiverState& st,
136 const std::string& uri,
137 const std::string& meta);
138bool UPNPP_API stopReceiver(ReceiverState& st);
139
140void UPNPP_API setReceiversFromSender(const std::string& sendernm,
141 const std::vector<std::string>& rcvnms);
146bool UPNPP_API setReceiversFromSenderWithStatus(
147 const std::string& sendernm,
148 const std::vector<std::string>& rcvnms,
149 std::vector<std::string>& reasons);
150
151void UPNPP_API setReceiversFromReceiver(const std::string& rcvnm,
152 const std::vector<std::string>& rcvnms);
157bool UPNPP_API setReceiversFromReceiverWithStatus(
158 const std::string& rcvnm,
159 const std::vector<std::string>& rcvnms,
160 std::vector<std::string>& reasons);
161
162void UPNPP_API stopReceivers(const std::vector<std::string>& rcvnms);
167bool UPNPP_API stopReceiversWithStatus(const std::vector<std::string>& rcvnms,
168 std::vector<std::string>& reasons);
169
170void UPNPP_API setReceiversPlaying(const std::vector<std::string>& rcvnms);
171
172bool UPNPP_API setReceiversPlayingWithStatus(
173 const std::vector<std::string>& rcvnms,
174 std::vector<std::string>& reasons);
175
176}
177}
178#endif /* _LINNSONGCAST_H_X_INCLUDED_ */
UPnP Description phase: interpreting the device description which we downloaded from the URL obtained...
Definition avlastchg.cxx:28
Everything you need to know about a Receiver.
Definition linnsongcast.hxx:82
Everything you need to know about a Sender.
Definition linnsongcast.hxx:51