summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>2012-10-09 07:08:39 +0000
committerMike Blumenkrantz <michael.blumenkrantz@gmail.com>2012-10-09 07:08:39 +0000
commit0d05b8960e50187014a0423b151d23526a8d4b26 (patch)
tree4b97eabe2e7ef93e2e98a2cc302eb4cd4e33c747
parent4f3d17626624e1b60db4eb9e0e4acd2c2909bcd7 (diff)
same updates for epulse
SVN revision: 77614
-rw-r--r--Pulse.h79
-rw-r--r--pa.c2
-rw-r--r--pa.h19
3 files changed, 66 insertions, 34 deletions
diff --git a/Pulse.h b/Pulse.h
index bbfabde..72ac3cc 100644
--- a/Pulse.h
+++ b/Pulse.h
@@ -4,6 +4,19 @@
4#include <Eina.h> 4#include <Eina.h>
5#include <inttypes.h> 5#include <inttypes.h>
6 6
7# ifdef EINTERN
8# undef EINTERN
9# endif
10# ifdef __GNUC__
11# if __GNUC__ >= 4
12# define EINTERN __attribute__ ((visibility("hidden")))
13# else
14# define EINTERN
15# endif
16# else
17# define EINTERN
18# endif
19
7#define PULSE_SUCCESS (void*)1 20#define PULSE_SUCCESS (void*)1
8 21
9extern int PULSE_EVENT_CONNECTED; 22extern int PULSE_EVENT_CONNECTED;
@@ -32,51 +45,51 @@ typedef struct Pulse_Server_Info
32 const char *default_source; 45 const char *default_source;
33} Pulse_Server_Info; 46} Pulse_Server_Info;
34 47
35int pulse_init(void); 48EINTERN int pulse_init(void);
36void pulse_shutdown(void); 49EINTERN void pulse_shutdown(void);
37 50
38Pulse *pulse_new(void); 51EINTERN Pulse *pulse_new(void);
39Eina_Bool pulse_connect(Pulse *conn); 52EINTERN Eina_Bool pulse_connect(Pulse *conn);
40void pulse_disconnect(Pulse *conn); 53EINTERN void pulse_disconnect(Pulse *conn);
41void pulse_free(Pulse *conn); 54EINTERN void pulse_free(Pulse *conn);
42void pulse_cb_set(Pulse *conn, uint32_t tagnum, Pulse_Cb cb); 55EINTERN void pulse_cb_set(Pulse *conn, uint32_t tagnum, Pulse_Cb cb);
43void pulse_server_info_free(Pulse_Server_Info *ev); 56EINTERN void pulse_server_info_free(Pulse_Server_Info *ev);
44 57
45uint32_t pulse_server_info_get(Pulse *conn); 58EINTERN uint32_t pulse_server_info_get(Pulse *conn);
46uint32_t pulse_cards_get(Pulse *conn); 59EINTERN uint32_t pulse_cards_get(Pulse *conn);
47#define pulse_sinks_get(conn) pulse_types_get((conn), EINA_FALSE) 60#define pulse_sinks_get(conn) pulse_types_get((conn), EINA_FALSE)
48#define pulse_sources_get(conn) pulse_types_get((conn), EINA_TRUE) 61#define pulse_sources_get(conn) pulse_types_get((conn), EINA_TRUE)
49uint32_t pulse_types_get(Pulse *conn, Eina_Bool source); 62EINTERN uint32_t pulse_types_get(Pulse *conn, Eina_Bool source);
50#define pulse_sink_get(conn, idx) pulse_type_get((conn), (idx), EINA_FALSE) 63#define pulse_sink_get(conn, idx) pulse_type_get((conn), (idx), EINA_FALSE)
51#define pulse_source_get(conn, idx) pulse_type_get((conn), (idx), EINA_FALSE) 64#define pulse_source_get(conn, idx) pulse_type_get((conn), (idx), EINA_FALSE)
52uint32_t pulse_type_get(Pulse *conn, uint32_t idx, Eina_Bool source); 65EINTERN uint32_t pulse_type_get(Pulse *conn, uint32_t idx, Eina_Bool source);
53#define pulse_sink_mute_set(conn, idx, mute) pulse_type_mute_set((conn), (idx), (mute), EINA_FALSE) 66#define pulse_sink_mute_set(conn, idx, mute) pulse_type_mute_set((conn), (idx), (mute), EINA_FALSE)
54#define pulse_source_mute_set(conn, idx, mute) pulse_type_mute_set((conn), (idx), (mute), EINA_TRUE) 67#define pulse_source_mute_set(conn, idx, mute) pulse_type_mute_set((conn), (idx), (mute), EINA_TRUE)
55uint32_t pulse_type_mute_set(Pulse *conn, uint32_t idx, Eina_Bool mute, Eina_Bool source); 68EINTERN uint32_t pulse_type_mute_set(Pulse *conn, uint32_t idx, Eina_Bool mute, Eina_Bool source);
56#define pulse_sink_volume_set(conn, idx, channels, vol) pulse_type_volume_set((conn), (idx), (channels), (vol), EINA_FALSE) 69#define pulse_sink_volume_set(conn, idx, channels, vol) pulse_type_volume_set((conn), (idx), (channels), (vol), EINA_FALSE)
57#define pulse_source_volume_set(conn, idx, channels, vol) pulse_type_volume_set((conn), (idx), (channels), (vol), EINA_TRUE) 70#define pulse_source_volume_set(conn, idx, channels, vol) pulse_type_volume_set((conn), (idx), (channels), (vol), EINA_TRUE)
58uint32_t pulse_type_volume_set(Pulse *conn, uint32_t sink_num, uint8_t channels, double vol, Eina_Bool source); 71EINTERN uint32_t pulse_type_volume_set(Pulse *conn, uint32_t sink_num, uint8_t channels, double vol, Eina_Bool source);
59 72
60void pulse_sink_free(Pulse_Sink *sink); 73EINTERN void pulse_sink_free(Pulse_Sink *sink);
61const char *pulse_sink_name_get(Pulse_Sink *sink); 74EINTERN const char *pulse_sink_name_get(Pulse_Sink *sink);
62const char *pulse_sink_desc_get(Pulse_Sink *sink); 75EINTERN const char *pulse_sink_desc_get(Pulse_Sink *sink);
63uint32_t pulse_sink_idx_get(Pulse_Sink *sink); 76EINTERN uint32_t pulse_sink_idx_get(Pulse_Sink *sink);
64Eina_Bool pulse_sink_muted_get(Pulse_Sink *sink); 77EINTERN Eina_Bool pulse_sink_muted_get(Pulse_Sink *sink);
65double pulse_sink_avg_get_pct(Pulse_Sink *sink); 78EINTERN double pulse_sink_avg_get_pct(Pulse_Sink *sink);
66float pulse_sink_balance_get(Pulse_Sink *sink); 79EINTERN float pulse_sink_balance_get(Pulse_Sink *sink);
67uint8_t pulse_sink_channels_count(Pulse_Sink *sink); 80EINTERN uint8_t pulse_sink_channels_count(Pulse_Sink *sink);
68Eina_List *pulse_sink_channel_names_get(Pulse_Sink *sink); 81EINTERN Eina_List *pulse_sink_channel_names_get(Pulse_Sink *sink);
69Eina_Bool pulse_sinks_watch(Pulse *conn); 82EINTERN Eina_Bool pulse_sinks_watch(Pulse *conn);
70 83
71const Eina_List *pulse_sink_ports_get(Pulse_Sink *sink); 84EINTERN const Eina_List *pulse_sink_ports_get(Pulse_Sink *sink);
72const char *pulse_sink_port_active_get(Pulse_Sink *sink); 85EINTERN const char *pulse_sink_port_active_get(Pulse_Sink *sink);
73#define pulse_source_channel_volume_set pulse_sink_channel_volume_set 86#define pulse_source_channel_volume_set pulse_sink_channel_volume_set
74uint32_t pulse_sink_channel_volume_set(Pulse *conn, Pulse_Sink *sink, uint32_t id, double vol); 87EINTERN uint32_t pulse_sink_channel_volume_set(Pulse *conn, Pulse_Sink *sink, uint32_t id, double vol);
75uint32_t pulse_sink_port_set(Pulse *conn, Pulse_Sink *sink, const char *port); 88EINTERN uint32_t pulse_sink_port_set(Pulse *conn, Pulse_Sink *sink, const char *port);
76double pulse_sink_channel_volume_get(Pulse_Sink *sink, unsigned int id); 89EINTERN double pulse_sink_channel_volume_get(Pulse_Sink *sink, unsigned int id);
77float pulse_sink_channel_balance_get(Pulse_Sink *sink, unsigned int id); 90EINTERN float pulse_sink_channel_balance_get(Pulse_Sink *sink, unsigned int id);
78float pulse_sink_channel_depth_get(Pulse_Sink *sink, unsigned int id); 91EINTERN float pulse_sink_channel_depth_get(Pulse_Sink *sink, unsigned int id);
79unsigned int pulse_sink_channel_name_get_id(Pulse_Sink *sink, const char *name); 92EINTERN unsigned int pulse_sink_channel_name_get_id(Pulse_Sink *sink, const char *name);
80const char *pulse_sink_channel_id_get_name(Pulse_Sink *sink, unsigned int id); 93EINTERN const char *pulse_sink_channel_id_get_name(Pulse_Sink *sink, unsigned int id);
81 94
82#endif 95#endif
diff --git a/pa.c b/pa.c
index 497beb8..924a9e9 100644
--- a/pa.c
+++ b/pa.c
@@ -727,7 +727,7 @@ pulse_free(Pulse *conn)
727 if (!conn) return; 727 if (!conn) return;
728 if (conn->fdh) ecore_main_fd_handler_del(conn->fdh); 728 if (conn->fdh) ecore_main_fd_handler_del(conn->fdh);
729 else if (conn->svr) ecore_con_server_del(conn->svr); 729 else if (conn->svr) ecore_con_server_del(conn->svr);
730 ecore_event_handler_del(conn->con); 730 if (conn->con) ecore_event_handler_del(conn->con);
731 eina_stringshare_del(conn->socket); 731 eina_stringshare_del(conn->socket);
732 EINA_LIST_FREE(conn->oq, tag) 732 EINA_LIST_FREE(conn->oq, tag)
733 pulse_tag_free(tag); 733 pulse_tag_free(tag);
diff --git a/pa.h b/pa.h
index c656b0a..c5870f0 100644
--- a/pa.h
+++ b/pa.h
@@ -19,6 +19,19 @@
19# define __UNUSED__ __attribute__((unused)) 19# define __UNUSED__ __attribute__((unused))
20#endif 20#endif
21 21
22# ifdef EINTERN
23# undef EINTERN
24# endif
25# ifdef __GNUC__
26# if __GNUC__ >= 4
27# define EINTERN __attribute__ ((visibility("hidden")))
28# else
29# define EINTERN
30# endif
31# else
32# define EINTERN
33# endif
34
22#define PA_PROTOCOL_VERSION 16 35#define PA_PROTOCOL_VERSION 16
23#define PA_NATIVE_COOKIE_LENGTH 256 36#define PA_NATIVE_COOKIE_LENGTH 256
24#ifndef PA_MACHINE_ID 37#ifndef PA_MACHINE_ID
@@ -29,6 +42,12 @@
29# define _(X) (X) 42# define _(X) (X)
30#endif 43#endif
31 44
45#undef DBG
46#undef INF
47#undef WRN
48#undef ERR
49#undef CRI
50
32#define DBG(...) EINA_LOG_DOM_DBG(pa_log_dom, __VA_ARGS__) 51#define DBG(...) EINA_LOG_DOM_DBG(pa_log_dom, __VA_ARGS__)
33#define INF(...) EINA_LOG_DOM_INFO(pa_log_dom, __VA_ARGS__) 52#define INF(...) EINA_LOG_DOM_INFO(pa_log_dom, __VA_ARGS__)
34#define WRN(...) EINA_LOG_DOM_WARN(pa_log_dom, __VA_ARGS__) 53#define WRN(...) EINA_LOG_DOM_WARN(pa_log_dom, __VA_ARGS__)