Skip to content

Commit

Permalink
impl pa_channel_position_from_string
Browse files Browse the repository at this point in the history
  • Loading branch information
i-rinat committed Dec 19, 2015
1 parent f1d7bf2 commit 3000db0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
19 changes: 19 additions & 0 deletions src/apulse-channel-map.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,25 @@ pa_channel_map_valid(const pa_channel_map *map)
return 1;
}

APULSE_EXPORT
pa_channel_position_t
pa_channel_position_from_string(const char *s)
{
trace_info("F %s s=%s\n", __func__, s);

if (!s)
return PA_CHANNEL_POSITION_INVALID;

for (unsigned int k = 0; k < PA_CHANNEL_POSITION_MAX; k ++) {
if (!channel_name[k])
continue;
if (strcmp(channel_name[k], s) == 0)
return k;
}

return PA_CHANNEL_POSITION_INVALID;
}

APULSE_EXPORT
const char *
pa_channel_position_to_string(pa_channel_position_t pos)
Expand Down
7 changes: 0 additions & 7 deletions src/notimplemented.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,13 +187,6 @@ pa_channel_map* pa_channel_map_init(pa_channel_map *m)
return NULL;
}

APULSE_EXPORT
pa_channel_position_t pa_channel_position_from_string(const char *s)
{
trace_info("Z %s\n", __func__);
return 0;
}

APULSE_EXPORT
const char* pa_channel_position_to_pretty_string(pa_channel_position_t pos)
{
Expand Down

0 comments on commit 3000db0

Please sign in to comment.