Lines Matching defs:o

43 	struct opt *o = arg;
45 logx(0, "%s: can't receive midi messages", o->name);
53 struct opt *o = arg;
61 if (slot_array[chan].opt != o)
76 dev_master(o->dev, x->u.master.coarse);
77 if (o->dev->master_enabled) {
78 ctl_onval(CTL_DEV_MASTER, o->dev, NULL,
90 if (o->mtc == NULL)
92 mtc_setdev(o->mtc, o->dev);
93 logx(2, "%s: mmc stop", o->name);
94 mtc_stop(o->mtc);
99 if (o->mtc == NULL)
101 mtc_setdev(o->mtc, o->dev);
102 logx(2, "%s: mmc start", o->name);
103 mtc_start(o->mtc);
110 if (o->mtc == NULL)
112 mtc_setdev(o->mtc, o->dev);
124 mtc_stop(o->mtc);
127 mtc_loc(o->mtc,
140 dev_midi_dump(o->dev);
154 struct opt *o = arg;
156 logx(1, "%s: midi end point died", o->name);
168 struct opt *o, **po;
220 o = xmalloc(sizeof(struct opt));
221 o->num = num;
222 o->alt_first = o->dev = a;
223 o->refcnt = 0;
232 o->midi = midi_new(&opt_midiops, o, MODE_MIDIIN | MODE_MIDIOUT);
233 midi_tag(o->midi, o->num);
236 o->pmin = pmin;
237 o->pmax = pmax;
240 o->rmin = rmin;
241 o->rmax = rmax;
243 o->maxweight = maxweight;
244 o->mtc = mmc ? &mtc_array[0] : NULL;
245 o->dup = dup;
246 o->mode = mode;
247 memcpy(o->name, name, len + 1);
248 o->next = *po;
249 *po = o;
251 logx(2, "%s: %s%s, vol = %d", o->name, (chans_fmt(str, sizeof(str),
252 o->mode, o->pmin, o->pmax, o->rmin, o->rmax), str),
253 (o->dup) ? ", dup" : "", o->maxweight);
255 return o;
261 struct opt *o;
263 for (o = opt_list; o != NULL; o = o->next) {
264 if (strcmp(name, o->name) == 0)
265 return o;
273 struct opt *o;
275 for (o = opt_list; o != NULL; o = o->next) {
276 if (o->num == num)
277 return o;
283 opt_del(struct opt *o)
287 for (po = &opt_list; *po != o; po = &(*po)->next) {
295 midi_del(o->midi);
296 *po = o->next;
297 xfree(o);
301 opt_init(struct opt *o)
306 opt_done(struct opt *o)
310 if (o->refcnt != 0) {
312 logx(0, "%s: still has refs", o->name);
315 ctl_del(CTL_OPT_DEV, o, d);
323 opt_setdev(struct opt *o, struct dev *ndev)
334 odev = o->dev;
342 if (s->opt != o)
356 if (o->mtc != NULL && o->mtc->dev != ndev) {
357 mtc_setdev(o->mtc, ndev);
362 c = ctl_find(CTL_OPT_DEV, o, o->dev);
368 if (s->opt != o)
375 o->dev = ndev;
377 if (o->refcnt > 0) {
379 dev_ref(o->dev);
382 c = ctl_find(CTL_OPT_DEV, o, o->dev);
390 if (s->opt != o)
412 if (p->opt == o)
424 opt_ref(struct opt *o)
428 if (o->refcnt == 0) {
429 if (strcmp(o->name, o->dev->name) == 0) {
430 if (!dev_ref(o->dev))
434 d = o->alt_first;
439 if (d == o->alt_first)
444 if (d != o->dev)
445 opt_setdev(o, d);
452 ctl_new(CTL_OPT_DEV, o, d,
454 o->name, "server", -1, "device",
455 d->name, -1, 1, o->dev == d);
460 o->refcnt++;
461 return o->dev;
468 opt_unref(struct opt *o)
472 o->refcnt--;
473 if (o->refcnt == 0) {
476 if (ctl_del(CTL_OPT_DEV, o, d))
479 dev_unref(o->dev);