mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-03 09:01:50 -05:00
introduce typedef for pa_bt_audio_state and use it everywhere
This commit is contained in:
parent
1390564227
commit
91355a1ce5
2 changed files with 10 additions and 11 deletions
|
|
@ -42,18 +42,17 @@ struct pa_bluetooth_discovery {
|
|||
static void get_properties_reply(DBusPendingCall *pending, void *userdata);
|
||||
static pa_dbus_pending* send_and_add_to_pending(pa_bluetooth_discovery *y, pa_bluetooth_device *d, DBusMessage *m, DBusPendingCallNotifyFunction func);
|
||||
|
||||
static enum pa_bt_audio_state pa_bt_audio_state_from_string(const char* value) {
|
||||
static pa_bt_audio_state_t pa_bt_audio_state_from_string(const char* value) {
|
||||
pa_assert(value);
|
||||
|
||||
if (pa_streq(value, "disconnected")) {
|
||||
if (pa_streq(value, "disconnected"))
|
||||
return PA_BT_AUDIO_STATE_DISCONNECTED;
|
||||
} else if (pa_streq(value, "connecting")) {
|
||||
else if (pa_streq(value, "connecting"))
|
||||
return PA_BT_AUDIO_STATE_CONNECTING;
|
||||
} else if (pa_streq(value, "connected")) {
|
||||
else if (pa_streq(value, "connected"))
|
||||
return PA_BT_AUDIO_STATE_CONNECTED;
|
||||
} else if (pa_streq(value, "playing")) {
|
||||
else if (pa_streq(value, "playing"))
|
||||
return PA_BT_AUDIO_STATE_PLAYING;
|
||||
}
|
||||
|
||||
return PA_BT_AUDIO_STATE_INVALID;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,14 +54,14 @@ struct pa_bluetooth_uuid {
|
|||
};
|
||||
|
||||
/* This enum is shared among Audio, Headset, and AudioSink, although not all values are acceptable in all profiles */
|
||||
enum pa_bt_audio_state {
|
||||
typedef enum pa_bt_audio_state {
|
||||
PA_BT_AUDIO_STATE_INVALID = -1,
|
||||
PA_BT_AUDIO_STATE_DISCONNECTED,
|
||||
PA_BT_AUDIO_STATE_CONNECTING,
|
||||
PA_BT_AUDIO_STATE_CONNECTED,
|
||||
PA_BT_AUDIO_STATE_PLAYING,
|
||||
PA_BT_AUDIO_STATE_LAST
|
||||
};
|
||||
} pa_bt_audio_state_t;
|
||||
|
||||
struct pa_bluetooth_device {
|
||||
pa_bool_t dead;
|
||||
|
|
@ -80,13 +80,13 @@ struct pa_bluetooth_device {
|
|||
int trusted;
|
||||
|
||||
/* Audio state */
|
||||
int audio_state;
|
||||
pa_bt_audio_state_t audio_state;
|
||||
|
||||
/* AudioSink state */
|
||||
int audio_sink_state;
|
||||
pa_bt_audio_state_t audio_sink_state;
|
||||
|
||||
/* Headset state */
|
||||
int headset_state;
|
||||
pa_bt_audio_state_t headset_state;
|
||||
};
|
||||
|
||||
pa_bluetooth_discovery* pa_bluetooth_discovery_get(pa_core *core);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue