summaryrefslogtreecommitdiffstats
path: root/src/modules
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2009-03-30 20:55:10 +0200
committerLennart Poettering <lennart@poettering.net>2009-03-30 20:55:10 +0200
commit91355a1ce53c779849ded6db7bce85a30e4289bb (patch)
tree512be87fce826ab3dbd08d42855aab8e0846070e /src/modules
parent1390564227a01678f78431cd19e7c2077e962db5 (diff)
introduce typedef for pa_bt_audio_state and use it everywhere
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/bluetooth/bluetooth-util.c11
-rw-r--r--src/modules/bluetooth/bluetooth-util.h10
2 files changed, 10 insertions, 11 deletions
diff --git a/src/modules/bluetooth/bluetooth-util.c b/src/modules/bluetooth/bluetooth-util.c
index 94c1d315..aaa4cc95 100644
--- a/src/modules/bluetooth/bluetooth-util.c
+++ b/src/modules/bluetooth/bluetooth-util.c
@@ -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;
}
diff --git a/src/modules/bluetooth/bluetooth-util.h b/src/modules/bluetooth/bluetooth-util.h
index 54114738..265caf40 100644
--- a/src/modules/bluetooth/bluetooth-util.h
+++ b/src/modules/bluetooth/bluetooth-util.h
@@ -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);