Switch to unified view

a/scctl_src/scctl.cpp b/scctl_src/scctl.cpp
...
...
73
#define OPT_r 0x80
73
#define OPT_r 0x80
74
#define OPT_s 0x100
74
#define OPT_s 0x100
75
#define OPT_x 0x200
75
#define OPT_x 0x200
76
#define OPT_i 0x400
76
#define OPT_i 0x400
77
#define OPT_I 0x800
77
#define OPT_I 0x800
78
#define OPT_R 0x1000
78
79
79
static const string sep("||");
80
static const string sep("||");
80
81
81
string showReceivers(int ops)
82
string showReceivers(int ops)
82
{
83
{
...
...
149
        setSourceIndex(args[0], std::stoi(args[1]));
150
        setSourceIndex(args[0], std::stoi(args[1]));
150
    } else if ((opflags & OPT_I)) {
151
    } else if ((opflags & OPT_I)) {
151
        if (args.size() < 2)
152
        if (args.size() < 2)
152
            return 1;
153
            return 1;
153
        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);
154
#endif
161
#endif
155
    }
162
    }
156
    return 0;
163
    return 0;
157
}
164
}
158
165
...
...
171
"    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"
172
" -x <renderer> [renderer ...] Reset renderers from Songcast to Playlist\n"
179
" -x <renderer> [renderer ...] Reset renderers from Songcast to Playlist\n"
173
" -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"
174
"    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"
175
"    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
176
" -S Run as server\n"
188
" -S Run as server\n"
177
" -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"
178
"    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"
179
"    the discovery timeout.\n"
191
"    the discovery timeout.\n"
180
" -h This help.\n"
192
" -h This help.\n"
...
...
198
int main(int argc, char *argv[])
210
int main(int argc, char *argv[])
199
{
211
{
200
    thisprog = argv[0];
212
    thisprog = argv[0];
201
213
202
    int ret;
214
    int ret;
203
    while ((ret = getopt(argc, argv, "fhmLlrsSxiI")) != -1) {
215
    while ((ret = getopt(argc, argv, "fhmLlrRsSxiI")) != -1) {
204
        switch (ret) {
216
        switch (ret) {
205
        case 'f': op_flags |= OPT_f; break;
217
        case 'f': op_flags |= OPT_f; break;
206
        case 'h': Usage(stdout); break;
218
        case 'h': Usage(stdout); break;
207
        case 'l': op_flags |= OPT_l; break;
219
        case 'l': op_flags |= OPT_l; break;
208
        case 'L': op_flags |= OPT_L; break;
220
        case 'L': op_flags |= OPT_L; break;
209
        case 'm': op_flags |= OPT_m; break;
221
        case 'm': op_flags |= OPT_m; break;
210
        case 'r': op_flags |= OPT_r; break;
222
        case 'r': op_flags |= OPT_r; break;
223
        case 'R': op_flags |= OPT_R; break;
211
        case 's': op_flags |= OPT_s; break;
224
        case 's': op_flags |= OPT_s; break;
212
        case 'S': op_flags |= OPT_S; break;
225
        case 'S': op_flags |= OPT_S; break;
213
        case 'x': op_flags |= OPT_x; break;
226
        case 'x': op_flags |= OPT_x; break;
214
        case 'i': op_flags |= OPT_i; break;
227
        case 'i': op_flags |= OPT_i; break;
215
        case 'I': op_flags |= OPT_I; break;
228
        case 'I': op_flags |= OPT_I; break;