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;
}
};
/* 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;
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);