acp: improve debug

This commit is contained in:
Wim Taymans 2020-10-01 13:12:19 +02:00
parent 0da406d304
commit 38276d126c
4 changed files with 40 additions and 33 deletions

View file

@ -32,6 +32,30 @@ void *_acp_log_data;
#define VOLUME_ACCURACY (PA_VOLUME_NORM/100) /* don't require volume adjustments to be perfectly correct. don't necessarily extend granularity in software unless the differences get greater than this level */
const char *acp_available_str(enum acp_available status)
{
switch (status) {
case ACP_AVAILABLE_UNKNOWN:
return "unknown";
case ACP_AVAILABLE_NO:
return "no";
case ACP_AVAILABLE_YES:
return "yes";
}
return "error";
}
const char *acp_direction_str(enum acp_direction direction)
{
switch (direction) {
case ACP_DIRECTION_CAPTURE:
return "capture";
case ACP_DIRECTION_PLAYBACK:
return "playback";
}
return "error";
}
static void profile_free(void *data)
{
}
@ -421,7 +445,6 @@ static int report_jack_state(snd_mixer_elem_t *melem, unsigned int mask)
found_available_input_port = true;
} else {
has_output_port = true;
if (port->port.available != ACP_AVAILABLE_NO)
found_available_output_port = true;
}

View file

@ -77,12 +77,16 @@ enum acp_direction {
ACP_DIRECTION_CAPTURE = 2
};
const char *acp_direction_str(enum acp_direction direction);
enum acp_available {
ACP_AVAILABLE_UNKNOWN = 0,
ACP_AVAILABLE_NO = 1,
ACP_AVAILABLE_YES = 2
};
const char *acp_available_str(enum acp_available status);
/** Port type. New types can be added in the future, so applications should
* gracefully handle situations where a type identifier doesn't match any item
* in this enumeration. */