mixer: factorize backend emix infra
Summary: The mixer gadgets suffer of a bad design between old and new gadget infra. This commit refactorize the mixer backend to get only one instance between old and new gadget. This resolve many problems as e_client_volume integration or the default_sink choosen in one of this modules. Now it will be easier to maintain this code and better support when we will remove old gadget infra. Reviewers: zmike, devilhorns, stephenmhouston Reviewed By: zmike Subscribers: cedric Tags: #enlightenment-git Differential Revision: https://phab.enlightenment.org/D7718
This commit is contained in:
parent
ea3f6ed68f
commit
fb23acf874
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,24 @@
|
||||||
|
#ifndef MIXER_GADGET_BACKEND_
|
||||||
|
#define MIXER_GADGET_BACKEND_
|
||||||
|
|
||||||
|
typedef void (*Backend_Hook)(void);
|
||||||
|
|
||||||
|
EINTERN extern int E_EVENT_MIXER_BACKEND_CHANGED;
|
||||||
|
EINTERN extern int E_EVENT_MIXER_SINKS_CHANGED;
|
||||||
|
|
||||||
|
EINTERN int backend_init(void);
|
||||||
|
EINTERN int backend_shutdown(void);
|
||||||
|
|
||||||
|
EINTERN void backend_emixer_exec(void);
|
||||||
|
|
||||||
|
EINTERN void backend_volume_set(unsigned int volume);
|
||||||
|
EINTERN unsigned int backend_volume_get(void);
|
||||||
|
EINTERN void backend_volume_decrease(void);
|
||||||
|
EINTERN void backend_volume_increase(void);
|
||||||
|
EINTERN void backend_mute_set(Eina_Bool mute);
|
||||||
|
EINTERN Eina_Bool backend_mute_get(void);
|
||||||
|
|
||||||
|
EINTERN void backend_sink_default_set(const Emix_Sink *s);
|
||||||
|
EINTERN const Emix_Sink *backend_sink_default_get(void);
|
||||||
|
|
||||||
|
#endif /* MIXER_GADGET_BACKEND */
|
File diff suppressed because it is too large
Load Diff
|
@ -1,10 +1,13 @@
|
||||||
#include "mixer.h"
|
#include "mixer.h"
|
||||||
|
#include "backend.h"
|
||||||
|
|
||||||
EINTERN int _e_gemix_log_domain;
|
EINTERN int _e_gemix_log_domain;
|
||||||
|
|
||||||
EINTERN void *
|
EINTERN void *
|
||||||
e_modapi_gadget_init(E_Module *m)
|
e_modapi_gadget_init(E_Module *m)
|
||||||
{
|
{
|
||||||
|
if (!backend_init()) return NULL;
|
||||||
|
|
||||||
_e_gemix_log_domain = eina_log_domain_register("mixer_gadget", EINA_COLOR_RED);
|
_e_gemix_log_domain = eina_log_domain_register("mixer_gadget", EINA_COLOR_RED);
|
||||||
|
|
||||||
e_gadget_type_add("Mixer", mixer_gadget_create, NULL);
|
e_gadget_type_add("Mixer", mixer_gadget_create, NULL);
|
||||||
|
@ -19,7 +22,7 @@ e_modapi_gadget_shutdown(E_Module *m EINA_UNUSED)
|
||||||
|
|
||||||
e_gadget_type_del("Mixer");
|
e_gadget_type_del("Mixer");
|
||||||
|
|
||||||
emix_shutdown();
|
backend_shutdown();
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,8 @@ src = files(
|
||||||
'e_mod_main.h',
|
'e_mod_main.h',
|
||||||
'gadget/mixer.h',
|
'gadget/mixer.h',
|
||||||
'gadget/mixer.c',
|
'gadget/mixer.c',
|
||||||
'gadget/mod.c'
|
'gadget/mod.c',
|
||||||
|
'gadget/backend.c'
|
||||||
)
|
)
|
||||||
|
|
||||||
mixer_lib = files(
|
mixer_lib = files(
|
||||||
|
|
Loading…
Reference in New Issue