M image/assets/lang/English.json => image/assets/lang/English.json +2 -2
@@ 646,7 646,7 @@
"app_bell_settings_frontlight_mode_auto": "auto",
"app_bell_settings_frontlight_mode_on_demand": "on demand",
"app_bell_powernap_session_ended_message": "<text>Hello!<br />Rise & shine</text>",
- "app_bell_background_sounds_timer_title": "Timer",
+ "app_bell_background_sounds_timer_title": "Auto turn off",
"app_bell_turn_off_question": "Turn off the device?",
"app_bell_goodbye": "Goodbye",
"app_bell_reset_message": "<text>Resetting Mudita<br />Harmony</text>",
@@ 705,4 705,4 @@
"app_bell_settings_advanced_factory_reset": "Factory reset",
"app_bell_settings_display_factory_reset_confirmation": "<text>Reset to factory<br></br>settings ?</text>",
"app_bell_settings_factory_reset_finished": "Factory settings\nrestored"
-}>
\ No newline at end of file
+}
M products/BellHybrid/apps/application-bell-background-sounds/ApplicationBellBackgroundSounds.cpp => products/BellHybrid/apps/application-bell-background-sounds/ApplicationBellBackgroundSounds.cpp +16 -0
@@ 13,6 13,7 @@
#include "windows/BGSoundsTimerSelectWindow.hpp"
#include "windows/BGSoundsVolumeWindow.hpp"
#include "widgets/BGSoundsPlayer.hpp"
+#include <apps-common/messages/AppMessage.hpp>
#include <common/models/TimeModel.hpp>
#include <service-audio/AudioMessage.hpp>
@@ 93,4 94,19 @@ namespace app
return handleAsyncResponse(resp);
}
+
+ sys::MessagePointer ApplicationBellBackgroundSounds::handleSwitchWindow(sys::Message *msgl)
+ {
+ if (auto msg = dynamic_cast<AppSwitchWindowMessage *>(msgl); msg) {
+ const auto newWindowName = msg->getWindowName();
+ if (newWindowName == gui::window::name::bgSoundsProgress ||
+ newWindowName == gui::window::name::bgSoundsPaused) {
+ stopIdleTimer();
+ }
+ else {
+ startIdleTimer();
+ }
+ }
+ return ApplicationCommon::handleSwitchWindow(msgl);
+ }
} // namespace app
M products/BellHybrid/apps/application-bell-background-sounds/include/application-bell-background-sounds/ApplicationBellBackgroundSounds.hpp => products/BellHybrid/apps/application-bell-background-sounds/include/application-bell-background-sounds/ApplicationBellBackgroundSounds.hpp +2 -0
@@ 23,6 23,8 @@ namespace app
{
std::unique_ptr<bgSounds::BGSoundsPlayer> player;
+ sys::MessagePointer handleSwitchWindow(sys::Message *msgl) override;
+
public:
ApplicationBellBackgroundSounds(std::string name = applicationBellBackgroundSoundsName,
std::string parent = "",
M products/BellHybrid/apps/application-bell-background-sounds/presenter/BGSoundsVolumePresenter.hpp => products/BellHybrid/apps/application-bell-background-sounds/presenter/BGSoundsVolumePresenter.hpp +2 -1
@@ 8,6 8,7 @@
namespace app::bgSounds
{
+ constexpr audio::Volume minVolume = 1u;
using VolumeData = struct VolumeData
{
audio::Volume min;
@@ 35,7 36,7 @@ namespace app::bgSounds
{
constexpr static struct VolumeData volumeData
{
- audio::minVolume, audio::maxVolume, audio::defaultVolumeStep
+ bgSounds::minVolume, audio::maxVolume, audio::defaultVolumeStep
};
VolumeData getVolumeData() override;
M products/BellHybrid/apps/application-bell-background-sounds/windows/BGSoundsVolumeWindow.hpp => products/BellHybrid/apps/application-bell-background-sounds/windows/BGSoundsVolumeWindow.hpp +1 -1
@@ 16,7 16,7 @@ namespace gui
class BGSoundsVolumeWindow : public WindowWithTimer, public app::bgSounds::BGSoundsVolumeContract::View
{
std::unique_ptr<app::bgSounds::BGSoundsVolumeContract::Presenter> presenter;
- audio::Volume volume = 0;
+ audio::Volume volume = 1;
audio::Context audioContext;
BellBaseLayout *body{};