Commit 31fa887f authored by Evangelos Ribeiro Tzaras's avatar Evangelos Ribeiro Tzaras
Browse files

Build "ugly code" in calls-call-display conditionally

* meson_options.txt: Added option librem5-hack, defaults to true
* src/meson.build: Added conditional define USE_UGLY_CODE which will be
  set when librem5-hack option is used
* src/calls-call-display.c: ifdef'ed ugly_hacks call
parent f6db8cb5
...@@ -9,3 +9,7 @@ option('tests', ...@@ -9,3 +9,7 @@ option('tests',
option('wayland', option('wayland',
type: 'feature', value: 'enabled', type: 'feature', value: 'enabled',
description: 'Whether to support Wayland lockscreen interaction') description: 'Whether to support Wayland lockscreen interaction')
option('librem5-hack',
type: 'boolean', value: true,
description: 'Whether to use hacky code to support audio output switching (Speaker)')
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
* *
*/ */
#include "config.h"
#include "calls-call-display.h" #include "calls-call-display.h"
#include "calls-call-data.h" #include "calls-call-data.h"
#include "util.h" #include "util.h"
...@@ -330,6 +331,7 @@ set_property (GObject *object, ...@@ -330,6 +331,7 @@ set_property (GObject *object,
} }
} }
#ifdef CALLS_USE_UGLY_CODE
//#define UGLY_SOURCE "alsa_input.platform-sound.VoiceCall__hw_CARD_sgtl5000__source" //#define UGLY_SOURCE "alsa_input.platform-sound.VoiceCall__hw_CARD_sgtl5000__source"
//#define UGLY_SINK "alsa_output.platform-sound.VoiceCall__hw_CARD_sgtl5000__sink" //#define UGLY_SINK "alsa_output.platform-sound.VoiceCall__hw_CARD_sgtl5000__sink"
...@@ -509,6 +511,7 @@ ugly_hacks (CallsCallDisplay *self) ...@@ -509,6 +511,7 @@ ugly_hacks (CallsCallDisplay *self)
self); self);
} }
#endif
static void static void
constructed (GObject *object) constructed (GObject *object)
...@@ -519,7 +522,9 @@ constructed (GObject *object) ...@@ -519,7 +522,9 @@ constructed (GObject *object)
call_state_changed_cb (self, calls_call_get_state (self->call)); call_state_changed_cb (self, calls_call_get_state (self->call));
#ifdef CALLS_USE_UGLY_CODE
ugly_hacks (self); ugly_hacks (self);
#endif
G_OBJECT_CLASS (calls_call_display_parent_class)->constructed (object); G_OBJECT_CLASS (calls_call_display_parent_class)->constructed (object);
} }
......
...@@ -95,6 +95,9 @@ calls_config_data = config_data ...@@ -95,6 +95,9 @@ calls_config_data = config_data
calls_config_data.set_quoted('VCS_TAG', '@VCS_TAG@') calls_config_data.set_quoted('VCS_TAG', '@VCS_TAG@')
calls_config_data.set10('WL_SCANNER_FOUND', wl_scanner.found()) calls_config_data.set10('WL_SCANNER_FOUND', wl_scanner.found())
use_l5_hacks = get_option('librem5-hack')
calls_config_data.set('CALLS_USE_UGLY_CODE', use_l5_hacks)
config_h_in = configure_file( config_h_in = configure_file(
output: 'config.h.in', output: 'config.h.in',
configuration: calls_config_data configuration: calls_config_data
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment