diff options
author | Rafael Antognolli <rafael.antognolli@intel.com> | 2013-05-03 17:44:01 -0300 |
---|---|---|
committer | Rafael Antognolli <rafael.antognolli@intel.com> | 2013-05-03 17:44:01 -0300 |
commit | 70e882cefb2b9383d2d7d15df1bb05b6d770393c (patch) | |
tree | 5fb0cc5f334c865f1db272410dba27ec7ccbeb31 /src/lib/ecore_audio | |
parent | d8b0c6e1da073766ce2c6fb3ff6677f7bf8c34b9 (diff) |
Revert "ecore_audio: Remove old structs that we don't need anymore"
This reverts commit 96d98696849ac2b141d6eb9d68238ff8c628c1ac.
Diffstat (limited to 'src/lib/ecore_audio')
-rw-r--r-- | src/lib/ecore_audio/Ecore_Audio.h | 21 | ||||
-rw-r--r-- | src/lib/ecore_audio/ecore_audio.c | 6 | ||||
-rw-r--r-- | src/lib/ecore_audio/ecore_audio_private.h | 43 |
3 files changed, 68 insertions, 2 deletions
diff --git a/src/lib/ecore_audio/Ecore_Audio.h b/src/lib/ecore_audio/Ecore_Audio.h index 6ba515c394..5e676348f0 100644 --- a/src/lib/ecore_audio/Ecore_Audio.h +++ b/src/lib/ecore_audio/Ecore_Audio.h | |||
@@ -37,6 +37,17 @@ extern "C" | |||
37 | * @{ | 37 | * @{ |
38 | */ | 38 | */ |
39 | 39 | ||
40 | /** @since 1.8 | ||
41 | */ | ||
42 | enum _Ecore_Audio_Type { | ||
43 | ECORE_AUDIO_TYPE_PULSE, /**< Use Pulseaudio module */ | ||
44 | ECORE_AUDIO_TYPE_ALSA, /**< Use ALSA module*/ | ||
45 | ECORE_AUDIO_TYPE_SNDFILE, /**< Use libsndfile module */ | ||
46 | ECORE_AUDIO_TYPE_TONE, /**< Use tone module */ | ||
47 | ECORE_AUDIO_TYPE_CUSTOM, /**< Use custom module */ | ||
48 | ECORE_AUDIO_MODULE_LAST, /**< Sentinel */ | ||
49 | }; | ||
50 | |||
40 | /** | 51 | /** |
41 | * @since 1.8 | 52 | * @since 1.8 |
42 | */ | 53 | */ |
@@ -61,6 +72,15 @@ enum _Ecore_Audio_Format { | |||
61 | typedef enum _Ecore_Audio_Format Ecore_Audio_Format; | 72 | typedef enum _Ecore_Audio_Format Ecore_Audio_Format; |
62 | /**< The format of the audio data */ | 73 | /**< The format of the audio data */ |
63 | 74 | ||
75 | /** @since 1.8 | ||
76 | */ | ||
77 | typedef struct _Ecore_Audio_Module Ecore_Audio_Module; | ||
78 | /**< The audio module */ | ||
79 | |||
80 | /** @since 1.8 | ||
81 | */ | ||
82 | typedef struct _Ecore_Audio_Object Ecore_Audio_Object; /**< The audio object */ | ||
83 | |||
64 | /* | 84 | /* |
65 | * @since 1.8 | 85 | * @since 1.8 |
66 | */ | 86 | */ |
@@ -192,7 +212,6 @@ EAPI int ecore_audio_shutdown(void); | |||
192 | 212 | ||
193 | #include <ecore_audio_obj_out_pulse.h> | 213 | #include <ecore_audio_obj_out_pulse.h> |
194 | 214 | ||
195 | |||
196 | #include <ecore_audio_obj_out_alsa.h> | 215 | #include <ecore_audio_obj_out_alsa.h> |
197 | 216 | ||
198 | /** | 217 | /** |
diff --git a/src/lib/ecore_audio/ecore_audio.c b/src/lib/ecore_audio/ecore_audio.c index ae052bd9e9..4d38c13ada 100644 --- a/src/lib/ecore_audio/ecore_audio.c +++ b/src/lib/ecore_audio/ecore_audio.c | |||
@@ -16,6 +16,8 @@ | |||
16 | 16 | ||
17 | int _ecore_audio_log_dom = -1; | 17 | int _ecore_audio_log_dom = -1; |
18 | static int _ecore_audio_init_count = 0; | 18 | static int _ecore_audio_init_count = 0; |
19 | Eina_List *ecore_audio_modules; | ||
20 | |||
19 | 21 | ||
20 | /* externally accessible functions */ | 22 | /* externally accessible functions */ |
21 | 23 | ||
@@ -42,6 +44,8 @@ ecore_audio_init(void) | |||
42 | } | 44 | } |
43 | 45 | ||
44 | DBG("Ecore_Audio init"); | 46 | DBG("Ecore_Audio init"); |
47 | ecore_audio_modules = NULL; | ||
48 | |||
45 | 49 | ||
46 | eina_log_timing(_ecore_audio_log_dom, | 50 | eina_log_timing(_ecore_audio_log_dom, |
47 | EINA_LOG_STATE_STOP, | 51 | EINA_LOG_STATE_STOP, |
@@ -63,6 +67,8 @@ ecore_audio_shutdown(void) | |||
63 | EINA_LOG_STATE_SHUTDOWN); | 67 | EINA_LOG_STATE_SHUTDOWN); |
64 | 68 | ||
65 | 69 | ||
70 | eina_list_free(ecore_audio_modules); | ||
71 | |||
66 | eina_log_domain_unregister(_ecore_audio_log_dom); | 72 | eina_log_domain_unregister(_ecore_audio_log_dom); |
67 | _ecore_audio_log_dom = -1; | 73 | _ecore_audio_log_dom = -1; |
68 | 74 | ||
diff --git a/src/lib/ecore_audio/ecore_audio_private.h b/src/lib/ecore_audio/ecore_audio_private.h index 29ae400332..a28ca7c374 100644 --- a/src/lib/ecore_audio/ecore_audio_private.h +++ b/src/lib/ecore_audio/ecore_audio_private.h | |||
@@ -71,10 +71,26 @@ extern int _ecore_audio_log_dom; | |||
71 | * @{ | 71 | * @{ |
72 | */ | 72 | */ |
73 | 73 | ||
74 | typedef struct _Ecore_Audio_Object Ecore_Audio_Object; | ||
75 | typedef struct _Ecore_Audio_Input Ecore_Audio_Input; | 74 | typedef struct _Ecore_Audio_Input Ecore_Audio_Input; |
76 | typedef struct _Ecore_Audio_Output Ecore_Audio_Output; | 75 | typedef struct _Ecore_Audio_Output Ecore_Audio_Output; |
77 | 76 | ||
77 | /** | ||
78 | * @brief The structure representing an Ecore_Audio module | ||
79 | */ | ||
80 | struct _Ecore_Audio_Module | ||
81 | { | ||
82 | ECORE_MAGIC; | ||
83 | Ecore_Audio_Type type; | ||
84 | char *name; | ||
85 | Eina_List *inputs; | ||
86 | Eina_List *outputs; | ||
87 | |||
88 | void *priv; | ||
89 | |||
90 | struct input_api *in_ops; | ||
91 | struct output_api *out_ops; | ||
92 | }; | ||
93 | |||
78 | struct _Ecore_Audio_Vio_Internal { | 94 | struct _Ecore_Audio_Vio_Internal { |
79 | Ecore_Audio_Vio *vio; | 95 | Ecore_Audio_Vio *vio; |
80 | void *data; | 96 | void *data; |
@@ -126,6 +142,31 @@ struct _Ecore_Audio_Input | |||
126 | Eina_Bool ended; | 142 | Eina_Bool ended; |
127 | }; | 143 | }; |
128 | 144 | ||
145 | extern Eina_List *ecore_audio_modules; | ||
146 | |||
147 | #ifdef HAVE_ALSA | ||
148 | /* ecore_audio_alsa */ | ||
149 | Ecore_Audio_Module *ecore_audio_alsa_init(void); | ||
150 | void ecore_audio_alsa_shutdown(void); | ||
151 | #endif /* HAVE_ALSA */ | ||
152 | |||
153 | #ifdef HAVE_PULSE | ||
154 | Ecore_Audio_Module *ecore_audio_pulse_init(void); | ||
155 | void ecore_audio_pulse_shutdown(void); | ||
156 | #endif /* HAVE_PULSE */ | ||
157 | |||
158 | #ifdef HAVE_SNDFILE | ||
159 | /* ecore_audio_sndfile */ | ||
160 | Ecore_Audio_Module *ecore_audio_sndfile_init(void); | ||
161 | void ecore_audio_sndfile_shutdown(void); | ||
162 | #endif /* HAVE_SNDFILE */ | ||
163 | |||
164 | Ecore_Audio_Module *ecore_audio_tone_init(void); | ||
165 | void ecore_audio_tone_shutdown(void); | ||
166 | |||
167 | Ecore_Audio_Module *ecore_audio_custom_init(void); | ||
168 | void ecore_audio_custom_shutdown(void); | ||
169 | |||
129 | /** | 170 | /** |
130 | * @} | 171 | * @} |
131 | */ | 172 | */ |