|
a/scctl_src/scctl.cpp |
|
b/scctl_src/scctl.cpp |
|
... |
|
... |
79 |
#define OPT_r 0x80
|
79 |
#define OPT_r 0x80
|
80 |
#define OPT_s 0x100
|
80 |
#define OPT_s 0x100
|
81 |
#define OPT_x 0x200
|
81 |
#define OPT_x 0x200
|
82 |
#define OPT_i 0x400
|
82 |
#define OPT_i 0x400
|
83 |
#define OPT_I 0x800
|
83 |
#define OPT_I 0x800
|
|
|
84 |
#define OPT_X 0x1000
|
84 |
|
85 |
|
85 |
static const string sep("||");
|
86 |
static const string sep("||");
|
86 |
|
87 |
|
87 |
string showReceivers(int ops)
|
88 |
string showReceivers(int ops)
|
88 |
{
|
89 |
{
|
|
... |
|
... |
146 |
args.end()));
|
147 |
args.end()));
|
147 |
} else if (opflags & OPT_x) {
|
148 |
} else if (opflags & OPT_x) {
|
148 |
if (args.size() < 1)
|
149 |
if (args.size() < 1)
|
149 |
return 1;
|
150 |
return 1;
|
150 |
stopReceivers(args);
|
151 |
stopReceivers(args);
|
|
|
152 |
#ifdef HAVE_SETRECEIVERSPLAYING_IN_LINN
|
|
|
153 |
} else if (opflags & OPT_X) {
|
|
|
154 |
if (args.size() < 1)
|
|
|
155 |
return 1;
|
|
|
156 |
setReceiversPlaying(args);
|
|
|
157 |
#endif
|
151 |
#ifdef HAVE_SETSOURCEINDEX_IN_LINN
|
158 |
#ifdef HAVE_SETSOURCEINDEX_IN_LINN
|
152 |
} else if ((opflags & OPT_i)) {
|
159 |
} else if ((opflags & OPT_i)) {
|
153 |
if (args.size() < 2)
|
160 |
if (args.size() < 2)
|
154 |
return 1;
|
161 |
return 1;
|
155 |
setSourceIndex(args[0], std::stoi(args[1]));
|
162 |
setSourceIndex(args[0], std::stoi(args[1]));
|
|
... |
|
... |
174 |
" -I <renderer> name : set source index by name\n"
|
181 |
" -I <renderer> name : set source index by name\n"
|
175 |
#endif
|
182 |
#endif
|
176 |
" -s <master> <slave> [slave ...] : Set up the slaves renderers as Songcast\n"
|
183 |
" -s <master> <slave> [slave ...] : Set up the slaves renderers as Songcast\n"
|
177 |
" Receivers and make them play from the same uri as the master receiver\n"
|
184 |
" 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"
|
185 |
" -x <renderer> [renderer ...] Reset renderers from Songcast to Playlist\n"
|
|
|
186 |
#ifdef HAVE_SETRECEIVERSPLAYING_IN_LINN
|
|
|
187 |
" -X <renderer> [renderer ...] Set renderers to Songcast (requires usage of\n"
|
|
|
188 |
" screceiverstatefile in the config file)\n"
|
|
|
189 |
#endif
|
179 |
" -r <sender> <renderer> <renderer> : set up the renderers in Receiver mode\n"
|
190 |
" -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"
|
191 |
" 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"
|
192 |
" the sender instead of a sibling receiver\n"
|
182 |
" -S Run as server\n"
|
193 |
" -S Run as server\n"
|
183 |
" -f If no server is found, scctl will fork one after performing the\n"
|
194 |
" -f If no server is found, scctl will fork one after performing the\n"
|
|
... |
|
... |
204 |
int main(int argc, char *argv[])
|
215 |
int main(int argc, char *argv[])
|
205 |
{
|
216 |
{
|
206 |
thisprog = argv[0];
|
217 |
thisprog = argv[0];
|
207 |
|
218 |
|
208 |
int ret;
|
219 |
int ret;
|
209 |
while ((ret = getopt(argc, argv, "fhmLlrsSxiI")) != -1) {
|
220 |
while ((ret = getopt(argc, argv, "fhmLlrsSxXiI")) != -1) {
|
210 |
switch (ret) {
|
221 |
switch (ret) {
|
211 |
case 'f': op_flags |= OPT_f; break;
|
222 |
case 'f': op_flags |= OPT_f; break;
|
212 |
case 'h': Usage(stdout); break;
|
223 |
case 'h': Usage(stdout); break;
|
213 |
case 'l': op_flags |= OPT_l; break;
|
224 |
case 'l': op_flags |= OPT_l; break;
|
214 |
case 'L': op_flags |= OPT_L; break;
|
225 |
case 'L': op_flags |= OPT_L; break;
|
215 |
case 'm': op_flags |= OPT_m; break;
|
226 |
case 'm': op_flags |= OPT_m; break;
|
216 |
case 'r': op_flags |= OPT_r; break;
|
227 |
case 'r': op_flags |= OPT_r; break;
|
217 |
case 's': op_flags |= OPT_s; break;
|
228 |
case 's': op_flags |= OPT_s; break;
|
218 |
case 'S': op_flags |= OPT_S; break;
|
229 |
case 'S': op_flags |= OPT_S; break;
|
219 |
case 'x': op_flags |= OPT_x; break;
|
230 |
case 'x': op_flags |= OPT_x; break;
|
|
|
231 |
case 'X': op_flags |= OPT_X; break;
|
220 |
case 'i': op_flags |= OPT_i; break;
|
232 |
case 'i': op_flags |= OPT_i; break;
|
221 |
case 'I': op_flags |= OPT_I; break;
|
233 |
case 'I': op_flags |= OPT_I; break;
|
222 |
default: Usage();
|
234 |
default: Usage();
|
223 |
}
|
235 |
}
|
224 |
}
|
236 |
}
|