ecore: make ecore_audio_out abstract

ecore_audio does define format and source, those are then used in some
leave classes, ecore_audio is only used in the tests, and should not be
used externally. Therefore make it abstract.
The other missing implementations are in the leave classes,
They are resolved with providing empty implementations, since no format
switching is supported.

ref T5719

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D7782
This commit is contained in:
Marcel Hollerbach 2019-01-25 15:32:53 +01:00
parent db13fbc494
commit 015fbac20d
7 changed files with 40 additions and 5 deletions

View File

@ -5,7 +5,8 @@ ecore_eolian_files_legacy = \
lib/ecore/ecore_exe.eo \
lib/ecore/ecore_event_message.eo \
lib/ecore/ecore_event_message_handler.eo \
lib/ecore/efl_loop_timer.eo
lib/ecore/efl_loop_timer.eo \
tests/ecore/ecore_audio_out_test.eo
ecore_eolian_files_public = \
lib/ecore/efl_app.eo \

View File

@ -1,4 +1,4 @@
class Ecore.Audio.Out extends Ecore.Audio
abstract Ecore.Audio.Out extends Ecore.Audio
{
[[Ecore Audio output object.]]

View File

@ -7,6 +7,8 @@ class Ecore.Audio.Out.Pulse extends Ecore.Audio.Out
Efl.Object.constructor;
Efl.Object.destructor;
Ecore.Audio.volume { set; }
@empty Ecore.Audio.format { set; get; }
@empty Ecore.Audio.source { set; get; }
Ecore.Audio.Out.input_attach;
Ecore.Audio.Out.input_detach;
}

View File

@ -7,6 +7,8 @@ class Ecore.Audio.Out.Wasapi extends Ecore.Audio.Out
Efl.Object.constructor;
Efl.Object.destructor;
Ecore.Audio.volume { set;}
@empty Ecore.Audio.format { set; get; }
@empty Ecore.Audio.source { set; get; }
Ecore.Audio.Out.input_attach;
Ecore.Audio.Out.input_detach;
}

View File

@ -0,0 +1,8 @@
class Ecore.Audio.Out.Test extends Ecore.Audio.Out
{
data: null;
implements {
@empty Ecore.Audio.source { set; get; }
@empty Ecore.Audio.format { set; get; }
}
}

View File

@ -311,6 +311,9 @@ EFL_START_TEST(ecore_test_ecore_audio_obj_sndfile)
}
EFL_END_TEST
#include "ecore_audio_out_test.eo.h"
#include "ecore_audio_out_test.eo.c"
EFL_START_TEST(ecore_test_ecore_audio_obj_in_out)
{
Eo *out2;
@ -319,7 +322,7 @@ EFL_START_TEST(ecore_test_ecore_audio_obj_in_out)
Eo *in = efl_add_ref(ECORE_AUDIO_IN_CLASS, NULL);
Eo *in2 = efl_add_ref(ECORE_AUDIO_IN_CLASS, NULL);
Eo *out = efl_add_ref(ECORE_AUDIO_OUT_CLASS, NULL);
Eo *out = efl_add_ref(ECORE_AUDIO_OUT_TEST_CLASS, NULL);
fail_if(!in);
fail_if(!in2);
@ -418,7 +421,7 @@ EFL_START_TEST(ecore_test_ecore_audio_obj_vio)
in = efl_add_ref(ECORE_AUDIO_IN_CLASS, NULL);
fail_if(!in);
out = efl_add_ref(ECORE_AUDIO_OUT_CLASS, NULL);
out = efl_add_ref(ECORE_AUDIO_OUT_TEST_CLASS, NULL);
fail_if(!out);
ecore_audio_obj_vio_set(in, &in_vio, NULL, NULL);
@ -543,7 +546,7 @@ EFL_START_TEST(ecore_test_ecore_audio_obj)
objs[0] = efl_add_ref(ECORE_AUDIO_IN_CLASS, NULL);
fail_if(!objs[0]);
objs[1] = efl_add_ref(ECORE_AUDIO_OUT_CLASS, NULL);
objs[1] = efl_add_ref(ECORE_AUDIO_OUT_TEST_CLASS, NULL);
fail_if(!objs[1]);
for (i=0; i<2; i++) {

View File

@ -23,9 +23,28 @@ ecore_suite_deps += ecore_evas
ecore_suite_deps += ecore_input
ecore_suite_deps += ecore_imf
test_eo_files = [
'ecore_audio_out_test.eo',
]
test_eo_file_target = []
foreach eo_file : test_eo_files
test_eo_file_target += custom_target('eolian_gen_' + eo_file,
input : eo_file,
output : [eo_file + '.h'],
depfile : eo_file + '.d',
install : false,
command : eolian_gen + [ '-I', meson.current_source_dir(), eolian_include_directories,
'-o', 'h:' + join_paths(meson.current_build_dir(), eo_file + '.h'),
'-o', 'c:' + join_paths(meson.current_build_dir(), eo_file + '.c'),
'-o', 'd:' + join_paths(meson.current_build_dir(), eo_file + '.d'),
'-gchd', '@INPUT@'])
endforeach
if get_option('audio')
ecore_suite_deps += ecore_audio
ecore_suite_src += 'ecore_test_ecore_audio.c'
ecore_suite_src += test_eo_file_target
endif
if get_option('fb')