alarms: change new alarm default values. 22/93522/1
authorLukasz Stanislawski <l.stanislaws@samsung.com>
Mon, 24 Oct 2016 14:56:05 +0000 (16:56 +0200)
committerLukasz Stanislawski <l.stanislaws@samsung.com>
Mon, 24 Oct 2016 14:57:14 +0000 (16:57 +0200)
Set alarms initial values according to guideline.

Change-Id: I07c67a1731a5c89b43153328b4381de2089e4b8e

clock/inc/Common/Defines.h
clock/inc/Presenter/RingPresenter.h
clock/src/Presenter/EditAlarmPresenter.cpp
clock/src/Presenter/RingPresenter.cpp

index dfac3f0..a933777 100644 (file)
@@ -6,4 +6,7 @@
 #define APP_CONTROL_OPERATION_TIMEOUT "http://tizen.org/appcontrol/operation/timeout"
 #define APP_CONTROL_OPERATION_ALARM "http://tizen.org/appcontrol/operation/alarm"
 
+#define SOUND_DEFAULT "settings/ringtone_sdk.mp3"
+
+
 #endif
index b16bd99..0910adb 100644 (file)
@@ -60,8 +60,6 @@ namespace presenter {
                 * @brief Callback function called on sound stream focus change.
                 */
                void SoundStreamChanged(void);
-
-               static const char *SOUND_DEFAULT;
        };
 
 } //namespace presenter
index 114365d..a366684 100644 (file)
@@ -1,5 +1,7 @@
+#include "Common/Defines.h"
 #include "Presenter/EditAlarmPresenter.h"
 #include "Utils/Log.h"
+#include "Utils/Utils.h"
 #include "Model/AlarmProvider.h"
 #include "Utils/EventBus.h"
 #include "Model/AlarmEvent.h"
@@ -30,16 +32,12 @@ view::EditAlarmView::AlarmViewInfo EditAlarmPresenter::GetDefaultInfo() const
        view::EditAlarmView::AlarmViewInfo data;
 
        data.time = Time::Now();
-       data.flags.AddDay(WeekDay::MONDAY);
-       data.flags.AddDay(WeekDay::TUESDAY);
-       data.flags.AddDay(WeekDay::WEDNESDAY);
-       data.flags.AddDay(WeekDay::THURSDAY);
-       data.flags.AddDay(WeekDay::FRIDAY);
        data.snooze = true;
-       data.volume = 0.6;
-       data.melody = "Over the horizon";
-       data.type = AlarmType::VIBRATION;
-       data.name = "Alarm";
+       data.volume = 0.7;
+       data.melody = Utils::GetAppResourcePath(
+                                       Utils::APP_DIR_RESOURCE, SOUND_DEFAULT);
+       data.type = AlarmType::SOUND_ONLY;
+       data.name = "";
 
        return data;
 }
index 569d4f7..5a8f30f 100644 (file)
 #include "Utils/Time.h"
 #include "Utils/Utils.h"
 #include "Controller/RingController.h"
+#include "Common/Defines.h"
 
 namespace presenter {
 
-const char *SOUND_DEFAULT = "settings/ringtone_sdk.mp3";
-
 RingPresenter::RingPresenter(view::RingView *view, model::Ring *model)
        : view_(view), model_(model)
 {
@@ -41,7 +40,7 @@ RingPresenter::RingPresenter(view::RingView *view, model::Ring *model)
        model_->Run();
        animator_.Start();
        view_->EnableSnooze(false);
-       view_->PlayMusic(utils::Utils::GetAppResourcePath(utils::Utils::APP_DIR_RESOURCE, presenter::SOUND_DEFAULT), 1.0);
+       view_->PlayMusic(utils::Utils::GetAppResourcePath(utils::Utils::APP_DIR_RESOURCE, SOUND_DEFAULT), 1.0);
        view_->StartVibration();
 }
 
@@ -69,7 +68,7 @@ RingPresenter::RingPresenter(view::RingView *view, model::Alarm *alarm)
        else {
                DBG("Invalid alarm's sound path. Playing default.");
                view_->PlayMusic(utils::Utils::GetAppResourcePath(
-                                       utils::Utils::APP_DIR_RESOURCE, presenter::SOUND_DEFAULT),
+                                       utils::Utils::APP_DIR_RESOURCE, SOUND_DEFAULT),
                                alarm_->GetVolume());
        }