|
a/scctl_src/scctl.cpp |
|
b/scctl_src/scctl.cpp |
|
... |
|
... |
61 |
using namespace UPnPClient;
|
61 |
using namespace UPnPClient;
|
62 |
using namespace UPnPP;
|
62 |
using namespace UPnPP;
|
63 |
using namespace std;
|
63 |
using namespace std;
|
64 |
using namespace Songcast;
|
64 |
using namespace Songcast;
|
65 |
|
65 |
|
66 |
#ifdef LIBUPNPP_VERSION_MAJOR
|
|
|
67 |
#if LIBUPNPP_AT_LEAST(0,16,0)
|
|
|
68 |
#define HAVE_SETSOURCEINDEX_IN_LINN
|
|
|
69 |
#endif
|
|
|
70 |
#endif
|
|
|
71 |
|
|
|
72 |
#define OPT_L 0x1
|
66 |
#define OPT_L 0x1
|
73 |
#define OPT_S 0x2
|
67 |
#define OPT_S 0x2
|
74 |
#define OPT_f 0x4
|
68 |
#define OPT_f 0x4
|
75 |
#define OPT_h 0x8
|
69 |
#define OPT_h 0x8
|
76 |
#define OPT_l 0x10
|
70 |
#define OPT_l 0x10
|
|
... |
|
... |
79 |
#define OPT_r 0x80
|
73 |
#define OPT_r 0x80
|
80 |
#define OPT_s 0x100
|
74 |
#define OPT_s 0x100
|
81 |
#define OPT_x 0x200
|
75 |
#define OPT_x 0x200
|
82 |
#define OPT_i 0x400
|
76 |
#define OPT_i 0x400
|
83 |
#define OPT_I 0x800
|
77 |
#define OPT_I 0x800
|
|
|
78 |
#define OPT_R 0x1000
|
84 |
|
79 |
|
85 |
static const string sep("||");
|
80 |
static const string sep("||");
|
86 |
|
81 |
|
87 |
string showReceivers(int ops)
|
82 |
string showReceivers(int ops)
|
88 |
{
|
83 |
{
|
|
... |
|
... |
155 |
setSourceIndex(args[0], std::stoi(args[1]));
|
150 |
setSourceIndex(args[0], std::stoi(args[1]));
|
156 |
} else if ((opflags & OPT_I)) {
|
151 |
} else if ((opflags & OPT_I)) {
|
157 |
if (args.size() < 2)
|
152 |
if (args.size() < 2)
|
158 |
return 1;
|
153 |
return 1;
|
159 |
setSourceIndexByName(args[0], args[1]);
|
154 |
setSourceIndexByName(args[0], args[1]);
|
|
|
155 |
#endif
|
|
|
156 |
#ifdef HAVE_SETRECEIVERSPLAYING_IN_LINN
|
|
|
157 |
} else if (opflags & OPT_R) {
|
|
|
158 |
if (args.size() < 1)
|
|
|
159 |
return 1;
|
|
|
160 |
setReceiversPlaying(args);
|
160 |
#endif
|
161 |
#endif
|
161 |
}
|
162 |
}
|
162 |
return 0;
|
163 |
return 0;
|
163 |
}
|
164 |
}
|
164 |
|
165 |
|
|
... |
|
... |
177 |
" Receivers and make them play from the same uri as the master receiver\n"
|
178 |
" Receivers and make them play from the same uri as the master receiver\n"
|
178 |
" -x <renderer> [renderer ...] Reset renderers from Songcast to Playlist\n"
|
179 |
" -x <renderer> [renderer ...] Reset renderers from Songcast to Playlist\n"
|
179 |
" -r <sender> <renderer> <renderer> : set up the renderers in Receiver mode\n"
|
180 |
" -r <sender> <renderer> <renderer> : set up the renderers in Receiver mode\n"
|
180 |
" playing data from the sender. This is like -s but we get the uri from \n"
|
181 |
" playing data from the sender. This is like -s but we get the uri from \n"
|
181 |
" the sender instead of a sibling receiver\n"
|
182 |
" the sender instead of a sibling receiver\n"
|
|
|
183 |
#ifdef HAVE_SETRECEIVERSPLAYING_IN_LINN
|
|
|
184 |
" -R <renderer> [renderer ...] Set renderers to Songcast receiver source\n"
|
|
|
185 |
" without looking for the Songcast sender first (requires usage of\n"
|
|
|
186 |
" screceiverstatefile in the configfile).\n"
|
|
|
187 |
#endif
|
182 |
" -S Run as server\n"
|
188 |
" -S Run as server\n"
|
183 |
" -f If no server is found, scctl will fork one after performing the\n"
|
189 |
" -f If no server is found, scctl will fork one after performing the\n"
|
184 |
" requested command, so that the next execution will not have to wait for\n"
|
190 |
" requested command, so that the next execution will not have to wait for\n"
|
185 |
" the discovery timeout.\n"
|
191 |
" the discovery timeout.\n"
|
186 |
" -h This help.\n"
|
192 |
" -h This help.\n"
|
|
... |
|
... |
204 |
int main(int argc, char *argv[])
|
210 |
int main(int argc, char *argv[])
|
205 |
{
|
211 |
{
|
206 |
thisprog = argv[0];
|
212 |
thisprog = argv[0];
|
207 |
|
213 |
|
208 |
int ret;
|
214 |
int ret;
|
209 |
while ((ret = getopt(argc, argv, "fhmLlrsSxiI")) != -1) {
|
215 |
while ((ret = getopt(argc, argv, "fhmLlrRsSxiI")) != -1) {
|
210 |
switch (ret) {
|
216 |
switch (ret) {
|
211 |
case 'f': op_flags |= OPT_f; break;
|
217 |
case 'f': op_flags |= OPT_f; break;
|
212 |
case 'h': Usage(stdout); break;
|
218 |
case 'h': Usage(stdout); break;
|
213 |
case 'l': op_flags |= OPT_l; break;
|
219 |
case 'l': op_flags |= OPT_l; break;
|
214 |
case 'L': op_flags |= OPT_L; break;
|
220 |
case 'L': op_flags |= OPT_L; break;
|
215 |
case 'm': op_flags |= OPT_m; break;
|
221 |
case 'm': op_flags |= OPT_m; break;
|
216 |
case 'r': op_flags |= OPT_r; break;
|
222 |
case 'r': op_flags |= OPT_r; break;
|
|
|
223 |
case 'R': op_flags |= OPT_R; break;
|
217 |
case 's': op_flags |= OPT_s; break;
|
224 |
case 's': op_flags |= OPT_s; break;
|
218 |
case 'S': op_flags |= OPT_S; break;
|
225 |
case 'S': op_flags |= OPT_S; break;
|
219 |
case 'x': op_flags |= OPT_x; break;
|
226 |
case 'x': op_flags |= OPT_x; break;
|
220 |
case 'i': op_flags |= OPT_i; break;
|
227 |
case 'i': op_flags |= OPT_i; break;
|
221 |
case 'I': op_flags |= OPT_I; break;
|
228 |
case 'I': op_flags |= OPT_I; break;
|