diff options
author | Marcel Hollerbach <mail@marcel-hollerbach.de> | 2019-01-25 15:32:53 +0100 |
---|---|---|
committer | Marcel Hollerbach <mail@marcel-hollerbach.de> | 2019-01-26 11:42:12 +0100 |
commit | 015fbac20da75fa944573c8f359b0785c7ffedbd (patch) | |
tree | bba605f072b44139b151077407fa1335170a048f | |
parent | db13fbc4940ee619b1edf47e6bbb745b769a7dcb (diff) | |
download | efl-015fbac20da75fa944573c8f359b0785c7ffedbd.tar.gz |
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
-rw-r--r-- | src/Makefile_Ecore.am | 3 | ||||
-rw-r--r-- | src/lib/ecore_audio/ecore_audio_out.eo | 2 | ||||
-rw-r--r-- | src/lib/ecore_audio/ecore_audio_out_pulse.eo | 2 | ||||
-rw-r--r-- | src/lib/ecore_audio/ecore_audio_out_wasapi.eo | 2 | ||||
-rw-r--r-- | src/tests/ecore/ecore_audio_out_test.eo | 8 | ||||
-rw-r--r-- | src/tests/ecore/ecore_test_ecore_audio.c | 9 | ||||
-rw-r--r-- | src/tests/ecore/meson.build | 19 |
7 files changed, 40 insertions, 5 deletions
diff --git a/src/Makefile_Ecore.am b/src/Makefile_Ecore.am index 38aeab1f6c..364bac41d6 100644 --- a/src/Makefile_Ecore.am +++ b/src/Makefile_Ecore.am @@ -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 \ diff --git a/src/lib/ecore_audio/ecore_audio_out.eo b/src/lib/ecore_audio/ecore_audio_out.eo index 72d65d142c..d50f1c1473 100644 --- a/src/lib/ecore_audio/ecore_audio_out.eo +++ b/src/lib/ecore_audio/ecore_audio_out.eo @@ -1,4 +1,4 @@ -class Ecore.Audio.Out extends Ecore.Audio +abstract Ecore.Audio.Out extends Ecore.Audio { [[Ecore Audio output object.]] diff --git a/src/lib/ecore_audio/ecore_audio_out_pulse.eo b/src/lib/ecore_audio/ecore_audio_out_pulse.eo index 6d28e7edbf..ea3940acae 100644 --- a/src/lib/ecore_audio/ecore_audio_out_pulse.eo +++ b/src/lib/ecore_audio/ecore_audio_out_pulse.eo @@ -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; } diff --git a/src/lib/ecore_audio/ecore_audio_out_wasapi.eo b/src/lib/ecore_audio/ecore_audio_out_wasapi.eo index 00c503dd7c..c32e9ecef8 100644 --- a/src/lib/ecore_audio/ecore_audio_out_wasapi.eo +++ b/src/lib/ecore_audio/ecore_audio_out_wasapi.eo @@ -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; } diff --git a/src/tests/ecore/ecore_audio_out_test.eo b/src/tests/ecore/ecore_audio_out_test.eo new file mode 100644 index 0000000000..a5ec9218d7 --- /dev/null +++ b/src/tests/ecore/ecore_audio_out_test.eo @@ -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; } + } +} diff --git a/src/tests/ecore/ecore_test_ecore_audio.c b/src/tests/ecore/ecore_test_ecore_audio.c index c90d575eea..9c8a890945 100644 --- a/src/tests/ecore/ecore_test_ecore_audio.c +++ b/src/tests/ecore/ecore_test_ecore_audio.c @@ -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++) { diff --git a/src/tests/ecore/meson.build b/src/tests/ecore/meson.build index 98104146be..4b46814bbe 100644 --- a/src/tests/ecore/meson.build +++ b/src/tests/ecore/meson.build @@ -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') |