summaryrefslogtreecommitdiff
path: root/src/lib/ecore_audio
diff options
context:
space:
mode:
authorYossi Kantor <yossi.kantor@samsung.com>2014-03-26 17:01:08 +0200
committerDaniel Zaoui <daniel.zaoui@samsung.com>2014-04-02 15:56:14 +0300
commit2c8bc8df52d7d5774475e01c4c296145c1581f13 (patch)
treea6823c0e09799811545c8a945d59a92fe0236792 /src/lib/ecore_audio
parenteb2821bca0eb6e67e8c2bfe345f923bc419bbfa5 (diff)
Eolian: Integration of Ecore Audio In
Diffstat (limited to 'src/lib/ecore_audio')
-rw-r--r--src/lib/ecore_audio/ecore_audio.eo7
-rw-r--r--src/lib/ecore_audio/ecore_audio_in.eo205
-rw-r--r--src/lib/ecore_audio/ecore_audio_obj_in.c236
-rw-r--r--src/lib/ecore_audio/ecore_audio_obj_in.h6
-rw-r--r--src/lib/ecore_audio/ecore_audio_obj_out_pulse.c2
-rw-r--r--src/lib/ecore_audio/ecore_audio_protected.h2
6 files changed, 265 insertions, 193 deletions
diff --git a/src/lib/ecore_audio/ecore_audio.eo b/src/lib/ecore_audio/ecore_audio.eo
index 6c2d70536e..4f85787f1c 100644
--- a/src/lib/ecore_audio/ecore_audio.eo
+++ b/src/lib/ecore_audio/ecore_audio.eo
@@ -116,6 +116,7 @@ class Ecore_Audio (Eo_Base)
116 Set the virtual IO functions 116 Set the virtual IO functions
117 117
118 @since 1.8 */ 118 @since 1.8 */
119 legacy null;
119 params { 120 params {
120 Ecore_Audio_Vio *vio; /*The @ref Ecore_Audio_Vio struct with the function callbacks*/ 121 Ecore_Audio_Vio *vio; /*The @ref Ecore_Audio_Vio struct with the function callbacks*/
121 void *data; /*User data to pass to the VIO functions*/ 122 void *data; /*User data to pass to the VIO functions*/
@@ -125,8 +126,10 @@ class Ecore_Audio (Eo_Base)
125 } 126 }
126 implements { 127 implements {
127 Eo_Base::constructor; 128 Eo_Base::constructor;
128 virtual::source; 129 virtual::source::get;
129 virtual::format; 130 virtual::source::set;
131 virtual::format::get;
132 virtual::format::set;
130 virtual::vio_set; 133 virtual::vio_set;
131 } 134 }
132} \ No newline at end of file 135} \ No newline at end of file
diff --git a/src/lib/ecore_audio/ecore_audio_in.eo b/src/lib/ecore_audio/ecore_audio_in.eo
new file mode 100644
index 0000000000..3b8f683e4b
--- /dev/null
+++ b/src/lib/ecore_audio/ecore_audio_in.eo
@@ -0,0 +1,205 @@
1class Ecore_Audio_In (Ecore_Audio)
2{
3 eo_prefix: ecore_audio_obj_in;
4 data: Ecore_Audio_Input;
5 properties {
6 speed {
7 set {
8 /*@
9 Set the playback speed of the input.
10
11 @since 1.8 */
12 legacy null;
13 }
14 get {
15 /*@
16 Get the playback speed of the input.
17
18 @since 1.8 */
19 legacy null;
20 }
21 values {
22 double speed; /*The speed, 1.0 is the default*/
23 }
24 }
25 samplerate {
26 set {
27 /*@
28 Set the sample-rate of the input
29
30 @since 1.8 */
31 legacy null;
32 }
33 get {
34 /*@
35 Get the he sample-rate of the input
36
37 @since 1.8 */
38 legacy null;
39 }
40 values {
41 int samplerate; /*The samplerate in Hz*/
42 }
43 }
44 channels {
45 set {
46 /*@
47 Set the amount of channels the input has
48
49 @since 1.8 */
50 legacy null;
51 }
52 get {
53 /*@
54 Get the amount of channels the input has
55
56 @since 1.8 */
57 legacy null;
58 }
59 values {
60 int channels; /*The number of channels*/
61 }
62 }
63 preloaded {
64 set {
65 /*@
66 Set the preloaded state of the input
67
68 @since 1.8 */
69 legacy null;
70 }
71 get {
72 /*@
73 Get the the preloaded state of the input
74
75 @since 1.8 */
76 legacy null;
77 }
78 values {
79 Eina_Bool preloaded; /*EINA_TRUE if the input should be cached, EINA_FALSE otherwise*/
80 }
81 }
82 looped {
83 set {
84 /*@
85 Set the looped state of the input
86
87 If the input is looped and reaches the end it will start from the
88 beginning again. At the same time the event @ref ECORE_AUDIO_EV_IN_LOOPED
89 will be emitted
90
91 @since 1.8 */
92 legacy null;
93 }
94 get {
95 /*@
96 Get the looped state of the input
97
98 @since 1.8 */
99 legacy null;
100 }
101 values {
102 Eina_Bool looped; /*EINA_TRUE if the input should be looped, EINA_FALSE otherwise*/
103 }
104 }
105 length {
106 set {
107 /*@
108 Set the length of the input
109
110 This function is only implemented by some classes
111 (i.e. ECORE_AUDIO_OBJ_IN_TONE_CLASS)
112
113 @since 1.8 */
114 legacy null;
115 }
116 get {
117 /*@
118 Get the length of the input
119
120 @since 1.8 */
121 legacy null;
122 }
123 values {
124 double length; /*The length of the input in seconds*/
125 }
126 }
127 output {
128 get {
129 /*@
130 Get the output that this input is attached to
131
132 @since 1.8 */
133 legacy null;
134 }
135 values {
136 Eo *output; /*The output*/
137 }
138 }
139 remaining {
140 get {
141 /*@
142 Get the remaining time of the input
143
144 @since 1.8 */
145 legacy null;
146 }
147 values {
148 double remaining; /*The amount of time in seconds left to play*/
149 }
150 }
151 }
152 methods {
153 read {
154 /*@
155 Read from the input
156
157 @since 1.8 */
158 legacy null;
159 return ssize_t; /*The amount of samples written to buf*/
160 params {
161 @in void *buf; /*The buffer to read into*/
162 @in size_t len; /*The amount of samples to read*/
163 }
164 }
165 read_internal {
166 /*@
167 Internal read function
168
169 @since 1.8 */
170 legacy null;
171 return ssize_t; /*The amount of samples written to buf*/
172 params {
173 @in void *buf; /*The buffer to read into*/
174 @in size_t len; /*The amount of samples to read*/
175 }
176 }
177 seek {
178 /*@
179 Seek within the input
180
181 @since 1.8 */
182 legacy null;
183 return double; /*The current absolute position in seconds within the input*/
184 params {
185 @in double offs; /*The offset in seconds*/
186 @in int mode; /*mode The seek mode. Is absolute with SEEK_SET, relative to the
187 current position with SEEK_CUR and relative to the end with SEEK_END.*/
188 }
189 }
190 }
191 implements {
192 Eo_Base::constructor;
193 Eo_Base::destructor;
194 Ecore_Audio::vio_set;
195 virtual::preloaded::get;
196 virtual::preloaded::set;
197 virtual::seek;
198 virtual::length::set;
199 }
200 events {
201 in,looped; /*@ Called when an input has looped. */
202 in,stopped; /*@ Called when an input has stopped playing. */
203 in,samplerate,changed; /*@ Called when the input samplerate has changed. */
204 }
205}
diff --git a/src/lib/ecore_audio/ecore_audio_obj_in.c b/src/lib/ecore_audio/ecore_audio_obj_in.c
index e383a9710d..f77374f551 100644
--- a/src/lib/ecore_audio/ecore_audio_obj_in.c
+++ b/src/lib/ecore_audio/ecore_audio_obj_in.c
@@ -14,24 +14,12 @@
14 14
15#include "ecore_audio_private.h" 15#include "ecore_audio_private.h"
16 16
17EAPI Eo_Op ECORE_AUDIO_OBJ_IN_BASE_ID = EO_NOOP;
18
19EAPI const Eo_Event_Description _ECORE_AUDIO_EV_IN_LOOPED =
20 EO_EVENT_DESCRIPTION("in,looped", "Called when an input has looped.");
21EAPI const Eo_Event_Description _ECORE_AUDIO_EV_IN_STOPPED =
22 EO_EVENT_DESCRIPTION("in,stopped", "Called when an input has stopped playing.");
23EAPI const Eo_Event_Description _ECORE_AUDIO_EV_IN_SAMPLERATE_CHANGED =
24 EO_EVENT_DESCRIPTION("in,samplerate,changed", "Called when the input samplerate has changed.");
25
26#define MY_CLASS ECORE_AUDIO_OBJ_IN_CLASS 17#define MY_CLASS ECORE_AUDIO_OBJ_IN_CLASS
27#define MY_CLASS_NAME "Ecore_Audio_In" 18#define MY_CLASS_NAME "Ecore_Audio_In"
28 19
29static void _speed_set(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list) 20EOLIAN static void
21_ecore_audio_in_speed_set(Eo *eo_obj EINA_UNUSED, Ecore_Audio_Input *obj, double speed)
30{ 22{
31 Ecore_Audio_Input *obj = _pd;
32
33 double speed = va_arg(*list, double);
34
35 if (speed < 0.2) 23 if (speed < 0.2)
36 speed = 0.2; 24 speed = 0.2;
37 if (speed > 5.0) 25 if (speed > 5.0)
@@ -39,116 +27,79 @@ static void _speed_set(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
39 27
40 obj->speed = speed; 28 obj->speed = speed;
41 29
42 eo_do(eo_obj, eo_event_callback_call(ECORE_AUDIO_EV_IN_SAMPLERATE_CHANGED, NULL, NULL)); 30 eo_do(eo_obj, eo_event_callback_call(ECORE_AUDIO_IN_EVENT_IN_SAMPLERATE_CHANGED, NULL, NULL));
43} 31}
44 32
45static void _speed_get(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list) 33EOLIAN static double
34_ecore_audio_in_speed_get(Eo *eo_obj EINA_UNUSED, Ecore_Audio_Input *obj)
46{ 35{
47 const Ecore_Audio_Input *obj = _pd; 36 return obj->speed;
48
49 double *speed = va_arg(*list, double *);
50
51 if (speed)
52 *speed = obj->speed;
53} 37}
54 38
55static void _samplerate_set(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list) 39EOLIAN static void
40_ecore_audio_in_samplerate_set(Eo *eo_obj EINA_UNUSED, Ecore_Audio_Input *obj, int samplerate)
56{ 41{
57 Ecore_Audio_Input *obj = _pd;
58
59 int samplerate = va_arg(*list, int);
60
61 obj->samplerate = samplerate; 42 obj->samplerate = samplerate;
62 43
63 eo_do(eo_obj, eo_event_callback_call(ECORE_AUDIO_EV_IN_SAMPLERATE_CHANGED, NULL, NULL)); 44 eo_do(eo_obj, eo_event_callback_call(ECORE_AUDIO_IN_EVENT_IN_SAMPLERATE_CHANGED, NULL, NULL));
64} 45}
65 46
66static void _samplerate_get(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list) 47EOLIAN static int
48_ecore_audio_in_samplerate_get(Eo *eo_obj EINA_UNUSED, Ecore_Audio_Input *obj)
67{ 49{
68 const Ecore_Audio_Input *obj = _pd; 50 return obj->samplerate;;
69
70 int *samplerate = va_arg(*list, int *);
71
72 if (samplerate)
73 *samplerate = obj->samplerate;
74} 51}
75 52
76static void _channels_set(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list) 53EOLIAN static void
54_ecore_audio_in_channels_set(Eo *eo_obj EINA_UNUSED, Ecore_Audio_Input *obj, int channels)
77{ 55{
78 Ecore_Audio_Input *obj = _pd;
79
80 int channels = va_arg(*list, int);
81
82 obj->channels = channels; 56 obj->channels = channels;
83 57
84 /* TODO: Notify output */ 58 /* TODO: Notify output */
85 59
86} 60}
87 61
88static void _channels_get(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list) 62EOLIAN static int
63_ecore_audio_in_channels_get(Eo *eo_obj EINA_UNUSED, Ecore_Audio_Input *obj)
89{ 64{
90 const Ecore_Audio_Input *obj = _pd; 65 return obj->channels;
91
92 int *channels = va_arg(*list, int *);
93
94 if (channels)
95 *channels = obj->channels;
96} 66}
97 67
98static void _looped_set(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list) 68EOLIAN static void
69_ecore_audio_in_looped_set(Eo *eo_obj EINA_UNUSED, Ecore_Audio_Input *obj, Eina_Bool looped)
99{ 70{
100 Ecore_Audio_Input *obj = _pd;
101
102 Eina_Bool looped = va_arg(*list, int);
103
104 obj->looped = looped; 71 obj->looped = looped;
105} 72}
106 73
107static void _looped_get(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list) 74EOLIAN static Eina_Bool
75_ecore_audio_in_looped_get(Eo *eo_obj EINA_UNUSED, Ecore_Audio_Input *obj)
108{ 76{
109 const Ecore_Audio_Input *obj = _pd; 77 return obj->looped;
110
111 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
112
113 if (ret)
114 *ret = obj->looped;
115} 78}
116 79
117static void _length_get(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list) 80EOLIAN static double
81_ecore_audio_in_length_get(Eo *eo_obj EINA_UNUSED, Ecore_Audio_Input *obj)
118{ 82{
119 const Ecore_Audio_Input *obj = _pd; 83 return obj->length;;
120
121 double *ret = va_arg(*list, double *);
122
123 if (ret) {
124 *ret = obj->length;
125 }
126} 84}
127 85
128static void _remaining_get(Eo *eo_obj, void *_pd, va_list *list) 86EOLIAN static double
87_ecore_audio_in_remaining_get(Eo *eo_obj, Ecore_Audio_Input *obj)
129{ 88{
130 const Ecore_Audio_Input *obj = _pd; 89 if (!obj->seekable) return -1;
131 90 else {
132 double *ret = va_arg(*list, double *); 91 double ret;
133 92 eo_do(eo_obj, ecore_audio_obj_in_seek(0, SEEK_CUR, &ret));
134 if (!obj->seekable && ret) { 93 return obj->length - ret;
135 *ret = -1;
136 } else if (ret) {
137 eo_do(eo_obj, ecore_audio_obj_in_seek(0, SEEK_CUR, ret));
138 *ret = obj->length - *ret;
139 } 94 }
140} 95}
141 96
142static void _in_read(Eo *eo_obj, void *_pd, va_list *list) 97EOLIAN static ssize_t
98_ecore_audio_in_read(Eo *eo_obj, Ecore_Audio_Input *obj, void *buf, size_t len)
143{ 99{
144 const Ecore_Audio_Input *obj = _pd;
145 ssize_t len_read = 0; 100 ssize_t len_read = 0;
146 const Ecore_Audio_Object *ea_obj = eo_data_scope_get(eo_obj, ECORE_AUDIO_OBJ_CLASS); 101 const Ecore_Audio_Object *ea_obj = eo_data_scope_get(eo_obj, ECORE_AUDIO_OBJ_CLASS);
147 102
148 void *buf = va_arg(*list, void *);
149 size_t len = va_arg(*list, size_t);
150 ssize_t *ret = va_arg(*list, ssize_t *);
151
152 if (ea_obj->paused) { 103 if (ea_obj->paused) {
153 memset(buf, 0, len); 104 memset(buf, 0, len);
154 len_read = len; 105 len_read = len;
@@ -156,45 +107,36 @@ static void _in_read(Eo *eo_obj, void *_pd, va_list *list)
156 eo_do(eo_obj, ecore_audio_obj_in_read_internal(buf, len, &len_read)); 107 eo_do(eo_obj, ecore_audio_obj_in_read_internal(buf, len, &len_read));
157 if (len_read == 0) { 108 if (len_read == 0) {
158 if (!obj->looped || !obj->seekable) { 109 if (!obj->looped || !obj->seekable) {
159 eo_do(eo_obj, eo_event_callback_call(ECORE_AUDIO_EV_IN_STOPPED, NULL, NULL)); 110 eo_do(eo_obj, eo_event_callback_call(ECORE_AUDIO_IN_EVENT_IN_STOPPED, NULL, NULL));
160 } else { 111 } else {
161 eo_do(eo_obj, ecore_audio_obj_in_seek(0, SEEK_SET, NULL)); 112 eo_do(eo_obj, ecore_audio_obj_in_seek(0, SEEK_SET, NULL));
162 eo_do(eo_obj, ecore_audio_obj_in_read_internal(buf, len, &len_read)); 113 eo_do(eo_obj, ecore_audio_obj_in_read_internal(buf, len, &len_read));
163 eo_do(eo_obj, eo_event_callback_call(ECORE_AUDIO_EV_IN_LOOPED, NULL, NULL)); 114 eo_do(eo_obj, eo_event_callback_call(ECORE_AUDIO_IN_EVENT_IN_LOOPED, NULL, NULL));
164 } 115 }
165 } 116 }
166 117
167 } 118 }
168 119
169 if (ret) 120 return len_read;
170 *ret = len_read;
171} 121}
172 122
173static void _read_internal(Eo *eo_obj, void *_pd EINA_UNUSED, va_list *list) 123EOLIAN static ssize_t
124_ecore_audio_in_read_internal(Eo *eo_obj, Ecore_Audio_Input *_pd EINA_UNUSED, void *buf, size_t len)
174{ 125{
175 ssize_t len_read = 0; 126 ssize_t len_read = 0;
176 const Ecore_Audio_Object *ea_obj = eo_data_scope_get(eo_obj, ECORE_AUDIO_OBJ_CLASS); 127 const Ecore_Audio_Object *ea_obj = eo_data_scope_get(eo_obj, ECORE_AUDIO_OBJ_CLASS);
177 128
178 void *buf = va_arg(*list, void *);
179 size_t len = va_arg(*list, size_t);
180 ssize_t *ret = va_arg(*list, ssize_t *);
181
182 if (ea_obj->vio && ea_obj->vio->vio->read) { 129 if (ea_obj->vio && ea_obj->vio->vio->read) {
183 len_read = ea_obj->vio->vio->read(ea_obj->vio->data, eo_obj, buf, len); 130 len_read = ea_obj->vio->vio->read(ea_obj->vio->data, eo_obj, buf, len);
184 } 131 }
185 132
186 if (ret) 133 return len_read;
187 *ret = len_read;
188} 134}
189 135
190static void _output_get(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list) 136EOLIAN static Eo*
137_ecore_audio_in_output_get(Eo *eo_obj EINA_UNUSED, Ecore_Audio_Input *obj)
191{ 138{
192 const Ecore_Audio_Input *obj = _pd; 139 return obj->output;
193
194 Eo **ret = va_arg(*list, Eo **);
195
196 if (ret)
197 *ret = obj->output;
198} 140}
199 141
200static void _free_vio(Ecore_Audio_Object *ea_obj) 142static void _free_vio(Ecore_Audio_Object *ea_obj)
@@ -206,15 +148,11 @@ static void _free_vio(Ecore_Audio_Object *ea_obj)
206 ea_obj->vio = NULL; 148 ea_obj->vio = NULL;
207} 149}
208 150
209static void _vio_set(Eo *eo_obj, void *_pd, va_list *list) 151EOLIAN static void
152_ecore_audio_in_ecore_audio_vio_set(Eo *eo_obj, Ecore_Audio_Input *obj, Ecore_Audio_Vio *vio, void *data, eo_base_data_free_func free_func)
210{ 153{
211 Ecore_Audio_Input *obj = _pd;
212 Ecore_Audio_Object *ea_obj = eo_data_scope_get(eo_obj, ECORE_AUDIO_OBJ_CLASS); 154 Ecore_Audio_Object *ea_obj = eo_data_scope_get(eo_obj, ECORE_AUDIO_OBJ_CLASS);
213 155
214 Ecore_Audio_Vio *vio = va_arg(*list, Ecore_Audio_Vio *);
215 void *data = va_arg(*list, Ecore_Audio_Vio *);
216 eo_base_data_free_func free_func = va_arg(*list, eo_base_data_free_func);
217
218 if (ea_obj->vio) 156 if (ea_obj->vio)
219 _free_vio(ea_obj); 157 _free_vio(ea_obj);
220 158
@@ -232,95 +170,21 @@ static void _vio_set(Eo *eo_obj, void *_pd, va_list *list)
232 obj->seekable = (vio->seek != NULL); 170 obj->seekable = (vio->seek != NULL);
233} 171}
234 172
235static void _constructor(Eo *eo_obj, void *_pd, va_list *list EINA_UNUSED) 173EOLIAN static void
174_ecore_audio_in_eo_base_constructor(Eo *eo_obj, Ecore_Audio_Input *obj)
236{ 175{
237 Ecore_Audio_Input *obj = _pd;
238
239 eo_do_super(eo_obj, MY_CLASS, eo_constructor()); 176 eo_do_super(eo_obj, MY_CLASS, eo_constructor());
240 177
241 obj->speed = 1.0; 178 obj->speed = 1.0;
242} 179}
243 180
244static void _destructor(Eo *eo_obj, void *_pd, va_list *list EINA_UNUSED) 181EOLIAN static void
182_ecore_audio_in_eo_base_destructor(Eo *eo_obj, Ecore_Audio_Input *obj)
245{ 183{
246 Ecore_Audio_Input *obj = _pd;
247
248 if(obj->output) 184 if(obj->output)
249 eo_do(obj->output, ecore_audio_obj_out_input_detach(eo_obj, NULL)); 185 eo_do(obj->output, ecore_audio_obj_out_input_detach(eo_obj, NULL));
250 186
251 eo_do_super(eo_obj, MY_CLASS, eo_destructor()); 187 eo_do_super(eo_obj, MY_CLASS, eo_destructor());
252} 188}
253 189
254static void _class_constructor(Eo_Class *klass) 190#include "ecore_audio_in.eo.c"
255{
256 const Eo_Op_Func_Description func_desc[] = {
257 /* Virtual functions of parent class implemented in this class */
258 EO_OP_FUNC(EO_BASE_ID(EO_BASE_SUB_ID_CONSTRUCTOR), _constructor),
259 EO_OP_FUNC(EO_BASE_ID(EO_BASE_SUB_ID_DESTRUCTOR), _destructor),
260
261 EO_OP_FUNC(ECORE_AUDIO_OBJ_ID(ECORE_AUDIO_OBJ_SUB_ID_VIO_SET), _vio_set),
262
263 /* Specific functions to this class */
264 EO_OP_FUNC(ECORE_AUDIO_OBJ_IN_ID(ECORE_AUDIO_OBJ_IN_SUB_ID_SPEED_SET), _speed_set),
265 EO_OP_FUNC(ECORE_AUDIO_OBJ_IN_ID(ECORE_AUDIO_OBJ_IN_SUB_ID_SPEED_GET), _speed_get),
266 EO_OP_FUNC(ECORE_AUDIO_OBJ_IN_ID(ECORE_AUDIO_OBJ_IN_SUB_ID_SAMPLERATE_SET), _samplerate_set),
267 EO_OP_FUNC(ECORE_AUDIO_OBJ_IN_ID(ECORE_AUDIO_OBJ_IN_SUB_ID_SAMPLERATE_GET), _samplerate_get),
268 EO_OP_FUNC(ECORE_AUDIO_OBJ_IN_ID(ECORE_AUDIO_OBJ_IN_SUB_ID_CHANNELS_SET), _channels_set),
269 EO_OP_FUNC(ECORE_AUDIO_OBJ_IN_ID(ECORE_AUDIO_OBJ_IN_SUB_ID_CHANNELS_GET), _channels_get),
270 EO_OP_FUNC(ECORE_AUDIO_OBJ_IN_ID(ECORE_AUDIO_OBJ_IN_SUB_ID_LOOPED_SET), _looped_set),
271 EO_OP_FUNC(ECORE_AUDIO_OBJ_IN_ID(ECORE_AUDIO_OBJ_IN_SUB_ID_LOOPED_GET), _looped_get),
272 EO_OP_FUNC(ECORE_AUDIO_OBJ_IN_ID(ECORE_AUDIO_OBJ_IN_SUB_ID_LENGTH_GET), _length_get),
273 EO_OP_FUNC(ECORE_AUDIO_OBJ_IN_ID(ECORE_AUDIO_OBJ_IN_SUB_ID_REMAINING_GET), _remaining_get),
274 EO_OP_FUNC(ECORE_AUDIO_OBJ_IN_ID(ECORE_AUDIO_OBJ_IN_SUB_ID_READ), _in_read),
275 EO_OP_FUNC(ECORE_AUDIO_OBJ_IN_ID(ECORE_AUDIO_OBJ_IN_SUB_ID_READ_INTERNAL), _read_internal),
276 EO_OP_FUNC(ECORE_AUDIO_OBJ_IN_ID(ECORE_AUDIO_OBJ_IN_SUB_ID_OUTPUT_GET), _output_get),
277
278 EO_OP_FUNC_SENTINEL
279 };
280
281 eo_class_funcs_set(klass, func_desc);
282}
283
284#define S(val) "Sets the " #val " of the input."
285#define G(val) "Gets the " #val " of the input."
286
287static const Eo_Op_Description op_desc[] = {
288 EO_OP_DESCRIPTION(ECORE_AUDIO_OBJ_IN_SUB_ID_SPEED_SET, S(speed)),
289 EO_OP_DESCRIPTION(ECORE_AUDIO_OBJ_IN_SUB_ID_SPEED_GET, G(speed)),
290 EO_OP_DESCRIPTION(ECORE_AUDIO_OBJ_IN_SUB_ID_SAMPLERATE_SET, S(samplerate)),
291 EO_OP_DESCRIPTION(ECORE_AUDIO_OBJ_IN_SUB_ID_SAMPLERATE_GET, G(samplerate)),
292 EO_OP_DESCRIPTION(ECORE_AUDIO_OBJ_IN_SUB_ID_CHANNELS_SET, S(channels)),
293 EO_OP_DESCRIPTION(ECORE_AUDIO_OBJ_IN_SUB_ID_CHANNELS_GET, G(channels)),
294 EO_OP_DESCRIPTION(ECORE_AUDIO_OBJ_IN_SUB_ID_PRELOADED_SET, S(preloaded)),
295 EO_OP_DESCRIPTION(ECORE_AUDIO_OBJ_IN_SUB_ID_PRELOADED_GET, G(preloaded)),
296 EO_OP_DESCRIPTION(ECORE_AUDIO_OBJ_IN_SUB_ID_LOOPED_SET, S(looped)),
297 EO_OP_DESCRIPTION(ECORE_AUDIO_OBJ_IN_SUB_ID_LOOPED_GET, G(looped)),
298 EO_OP_DESCRIPTION(ECORE_AUDIO_OBJ_IN_SUB_ID_LENGTH_SET, S(length)),
299 EO_OP_DESCRIPTION(ECORE_AUDIO_OBJ_IN_SUB_ID_LENGTH_GET, G(length)),
300 EO_OP_DESCRIPTION(ECORE_AUDIO_OBJ_IN_SUB_ID_READ, "Read from the input"),
301 EO_OP_DESCRIPTION(ECORE_AUDIO_OBJ_IN_SUB_ID_READ_INTERNAL, "Internal implementation for the read"),
302 EO_OP_DESCRIPTION(ECORE_AUDIO_OBJ_IN_SUB_ID_SEEK, "Seek within the input"),
303 EO_OP_DESCRIPTION(ECORE_AUDIO_OBJ_IN_SUB_ID_OUTPUT_GET, G(output)),
304 EO_OP_DESCRIPTION(ECORE_AUDIO_OBJ_IN_SUB_ID_REMAINING_GET, G(remaining)),
305 EO_OP_DESCRIPTION_SENTINEL
306};
307
308static const Eo_Event_Description *event_desc[] = {
309 ECORE_AUDIO_EV_IN_LOOPED,
310 ECORE_AUDIO_EV_IN_STOPPED,
311 ECORE_AUDIO_EV_IN_SAMPLERATE_CHANGED,
312 NULL
313};
314
315static const Eo_Class_Description class_desc = {
316 EO_VERSION,
317 MY_CLASS_NAME,
318 EO_CLASS_TYPE_REGULAR,
319 EO_CLASS_DESCRIPTION_OPS(&ECORE_AUDIO_OBJ_IN_BASE_ID, op_desc, ECORE_AUDIO_OBJ_IN_SUB_ID_LAST),
320 event_desc,
321 sizeof(Ecore_Audio_Input),
322 _class_constructor,
323 NULL
324};
325
326EO_DEFINE_CLASS(ecore_audio_obj_in_class_get, &class_desc, ECORE_AUDIO_OBJ_CLASS, NULL);
diff --git a/src/lib/ecore_audio/ecore_audio_obj_in.h b/src/lib/ecore_audio/ecore_audio_obj_in.h
index e9e49ffe01..8caa518489 100644
--- a/src/lib/ecore_audio/ecore_audio_obj_in.h
+++ b/src/lib/ecore_audio/ecore_audio_obj_in.h
@@ -33,6 +33,8 @@ extern "C"
33 * @ingroup Ecore_Audio_Group 33 * @ingroup Ecore_Audio_Group
34 * @{ 34 * @{
35 */ 35 */
36#include "ecore_audio_in.eo.h"
37#if 0
36 38
37#define ECORE_AUDIO_OBJ_IN_CLASS ecore_audio_obj_in_class_get() /**< Ecore_Audio input object class */ 39#define ECORE_AUDIO_OBJ_IN_CLASS ecore_audio_obj_in_class_get() /**< Ecore_Audio input object class */
38 40
@@ -265,6 +267,7 @@ extern const Eo_Event_Description _ECORE_AUDIO_EV_IN_SAMPLERATE_CHANGED;
265 */ 267 */
266#define ECORE_AUDIO_EV_IN_SAMPLERATE_CHANGED (&(_ECORE_AUDIO_EV_IN_SAMPLERATE_CHANGED)) 268#define ECORE_AUDIO_EV_IN_SAMPLERATE_CHANGED (&(_ECORE_AUDIO_EV_IN_SAMPLERATE_CHANGED))
267 269
270#endif
268/** 271/**
269 * @} 272 * @}
270 */ 273 */
@@ -273,5 +276,4 @@ extern const Eo_Event_Description _ECORE_AUDIO_EV_IN_SAMPLERATE_CHANGED;
273} 276}
274#endif 277#endif
275 278
276#endif 279#endif \ No newline at end of file
277
diff --git a/src/lib/ecore_audio/ecore_audio_obj_out_pulse.c b/src/lib/ecore_audio/ecore_audio_obj_out_pulse.c
index ce7bd7f856..f94f4999ba 100644
--- a/src/lib/ecore_audio/ecore_audio_obj_out_pulse.c
+++ b/src/lib/ecore_audio/ecore_audio_obj_out_pulse.c
@@ -141,7 +141,7 @@ static Eina_Bool _input_attach_internal(Eo *eo_obj, Eo *in)
141 return EINA_FALSE; 141 return EINA_FALSE;
142 } 142 }
143 143
144 eo_do(in, eo_event_callback_add(ECORE_AUDIO_EV_IN_SAMPLERATE_CHANGED, _update_samplerate_cb, eo_obj)); 144 eo_do(in, eo_event_callback_add(ECORE_AUDIO_IN_EVENT_IN_SAMPLERATE_CHANGED, _update_samplerate_cb, eo_obj));
145 145
146 eo_do(in, eo_base_data_set("pulse_data", stream, NULL)); 146 eo_do(in, eo_base_data_set("pulse_data", stream, NULL));
147 147
diff --git a/src/lib/ecore_audio/ecore_audio_protected.h b/src/lib/ecore_audio/ecore_audio_protected.h
index 7dc835c9ae..e337b0a6d9 100644
--- a/src/lib/ecore_audio/ecore_audio_protected.h
+++ b/src/lib/ecore_audio/ecore_audio_protected.h
@@ -5,6 +5,4 @@
5#include "Ecore.h" 5#include "Ecore.h"
6#include "Ecore_Audio.h" 6#include "Ecore_Audio.h"
7 7
8#define ecore_audio_obj_in_read_internal(buf, len, ret) ECORE_AUDIO_OBJ_IN_ID(ECORE_AUDIO_OBJ_IN_SUB_ID_READ_INTERNAL), EO_TYPECHECK(void *, buf), EO_TYPECHECK(size_t, len), EO_TYPECHECK(ssize_t *, ret)
9
10#endif 8#endif