summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/misc.c9
-rw-r--r--apps/playback.c2
-rw-r--r--apps/settings.c2
3 files changed, 13 insertions, 0 deletions
diff --git a/apps/misc.c b/apps/misc.c
index fa34c21..995d656 100644
--- a/apps/misc.c
+++ b/apps/misc.c
@@ -636,6 +636,15 @@ long default_event_handler_ex(long event, void (*callback)(void *), void *parame
resume = false;
return SYS_CALL_HUNG_UP;
#endif
+#if (CONFIG_PLATFORM & PLATFORM_HOSTED) && defined(PLATFORM_HAS_VOLUME_CHANGE)
+ case SYS_VOLUME_CHANGED:
+ {
+ int volume = hosted_get_volume();
+ if (global_settings.volume != volume)
+ global_settings.volume = volume;
+ return 0;
+ }
+#endif
#ifdef HAVE_MULTIMEDIA_KEYS
/* multimedia keys on keyboards, headsets */
case BUTTON_MULTIMEDIA_PLAYPAUSE:
diff --git a/apps/playback.c b/apps/playback.c
index b72ed8a..fb79c4d 100644
--- a/apps/playback.c
+++ b/apps/playback.c
@@ -1834,7 +1834,9 @@ static void audio_play_start(size_t offset)
ci.seek_time = 0;
wps_offset = 0;
+#ifndef PLAFORM_HAS_VOLUME_CHANGE
sound_set_volume(global_settings.volume);
+#endif
track_widx = track_ridx = 0;
buf_set_base_handle(-1);
diff --git a/apps/settings.c b/apps/settings.c
index e9458dc..623bc5b 100644
--- a/apps/settings.c
+++ b/apps/settings.c
@@ -726,7 +726,9 @@ void sound_settings_apply(void)
sound_set(SOUND_TREBLE, global_settings.treble);
#endif
sound_set(SOUND_BALANCE, global_settings.balance);
+#ifndef PLATFORM_HAS_VOLUME_CHANGE
sound_set(SOUND_VOLUME, global_settings.volume);
+#endif
sound_set(SOUND_CHANNELS, global_settings.channel_config);
sound_set(SOUND_STEREO_WIDTH, global_settings.stereo_width);
#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)