mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-02 09:01:46 -05:00
volume work
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@42 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
e31bac0257
commit
d571be6f51
12 changed files with 203 additions and 35 deletions
|
|
@ -1,3 +1,4 @@
|
|||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
|
|
@ -87,11 +88,24 @@ void namereg_unregister(struct core *c, const char *name) {
|
|||
|
||||
void* namereg_get(struct core *c, const char *name, enum namereg_type type) {
|
||||
struct namereg_entry *e;
|
||||
uint32_t index;
|
||||
char *x = NULL;
|
||||
void *d = NULL;
|
||||
assert(c && name);
|
||||
|
||||
if (!(e = hashset_get(c->namereg, name)))
|
||||
if ((e = hashset_get(c->namereg, name)))
|
||||
if (e->type == e->type)
|
||||
return e->data;
|
||||
|
||||
return NULL;
|
||||
index = (uint32_t) strtol(name, &x, 0);
|
||||
|
||||
if (!x || *x != 0)
|
||||
return NULL;
|
||||
|
||||
if (type == NAMEREG_SINK)
|
||||
d = idxset_get_by_index(c->sinks, index);
|
||||
else if (type == NAMEREG_SOURCE)
|
||||
d = idxset_get_by_index(c->sources, index);
|
||||
|
||||
return d;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue