summaryrefslogtreecommitdiffstats
path: root/lib/data/data_providers
diff options
context:
space:
mode:
authorScott Murray <scott.murray@konsulko.com>2024-01-23 16:22:17 -0500
committerScott Murray <scott.murray@konsulko.com>2024-01-23 16:40:14 -0500
commit5587c6ae79b482fbff26442bb239d7d7eb55a337 (patch)
tree781ed45ea798f3a4dde8d132e0282b534d1ed190 /lib/data/data_providers
parent6046300bd723d9289a15d28112b653e6f2b29dec (diff)
Rework things to show the first frame of the background animation when the animation is disabled. A new 'plain-bg' option has been added to the configuration in case the previous behavior is still desired. Bug-AGL: SPEC-5054 Change-Id: I15dde41fe8472bea8ef9690ad188ee6d2ba5c3af Signed-off-by: Scott Murray <scott.murray@konsulko.com>
Diffstat (limited to 'lib/data/data_providers')
-rw-r--r--lib/data/data_providers/app_config_provider.dart15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/data/data_providers/app_config_provider.dart b/lib/data/data_providers/app_config_provider.dart
index 2f6d4bc..7ec8d8a 100644
--- a/lib/data/data_providers/app_config_provider.dart
+++ b/lib/data/data_providers/app_config_provider.dart
@@ -73,6 +73,7 @@ class MpdConfig {
class AppConfig {
final bool disableBkgAnimation;
+ final bool plainBackground;
final bool randomHybridAnimation;
final KuksaConfig kuksaConfig;
final RadioConfig radioConfig;
@@ -82,6 +83,7 @@ class AppConfig {
AppConfig(
{required this.disableBkgAnimation,
+ required this.plainBackground,
required this.randomHybridAnimation,
required this.kuksaConfig,
required this.radioConfig,
@@ -151,6 +153,7 @@ class AppConfig {
ca_certificate: ca_cert,
tls_server_name: tls_server_name);
} catch (_) {
+ debugPrint("Invalid KUKSA.val configuration, using defaults");
return KuksaConfig.defaultConfig();
}
}
@@ -174,6 +177,7 @@ class AppConfig {
return RadioConfig(hostname: hostname, port: port, presets: presets);
} catch (_) {
+ debugPrint("Invalid radio configuration, using defaults");
return RadioConfig.defaultConfig();
}
}
@@ -192,6 +196,7 @@ class AppConfig {
return MpdConfig(hostname: hostname, port: port);
} catch (_) {
+ debugPrint("Invalid MPD configuration, using defaults");
return MpdConfig.defaultConfig();
}
}
@@ -239,6 +244,14 @@ final appConfigProvider = Provider((ref) {
}
}
+ bool plainBackground = false;
+ if (yamlMap.containsKey('plain-bg')) {
+ var value = yamlMap['plain-bg'];
+ if (value is bool) {
+ plainBackground = value;
+ }
+ }
+
bool randomHybridAnimation = randomHybridAnimationDefault;
if (yamlMap.containsKey('random-hybrid-animation')) {
var value = yamlMap['random-hybrid-animation'];
@@ -249,6 +262,7 @@ final appConfigProvider = Provider((ref) {
return AppConfig(
disableBkgAnimation: disableBkgAnimation,
+ plainBackground: plainBackground,
randomHybridAnimation: randomHybridAnimation,
kuksaConfig: kuksaConfig,
radioConfig: radioConfig,
@@ -256,6 +270,7 @@ final appConfigProvider = Provider((ref) {
} catch (_) {
return AppConfig(
disableBkgAnimation: false,
+ plainBackground: false,
randomHybridAnimation: false,
kuksaConfig: KuksaConfig.defaultConfig(),
radioConfig: RadioConfig.defaultConfig(),