aboutsummaryrefslogtreecommitdiff
path: root/src/snap.cpp
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2014-06-27 09:46:21 -0500
committerCharles Kerr <charles.kerr@canonical.com>2014-06-27 09:46:21 -0500
commiteebf8f911cedf5124ada2f91576f821da6f421b0 (patch)
tree446610632a4c784cc5f8cae8d588818c8da84f55 /src/snap.cpp
parenta872431f78e5518419c6af5e365db972f362ba9a (diff)
downloadayatana-indicator-datetime-eebf8f911cedf5124ada2f91576f821da6f421b0.tar.gz
ayatana-indicator-datetime-eebf8f911cedf5124ada2f91576f821da6f421b0.tar.bz2
ayatana-indicator-datetime-eebf8f911cedf5124ada2f91576f821da6f421b0.zip
use unsigned ints for the alarm volume, duration properties
Diffstat (limited to 'src/snap.cpp')
-rw-r--r--src/snap.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/snap.cpp b/src/snap.cpp
index 40fd541..eab7001 100644
--- a/src/snap.cpp
+++ b/src/snap.cpp
@@ -54,8 +54,8 @@ public:
Sound(const std::shared_ptr<Clock>& clock,
const std::string& filename,
- int volume,
- int duration_minutes,
+ unsigned int volume,
+ unsigned int duration_minutes,
bool loop):
m_clock(clock),
m_filename(filename),
@@ -132,9 +132,9 @@ private:
g_clear_pointer(&props, ca_proplist_destroy);
}
- static float get_gain_level(int volume)
+ static float get_gain_level(unsigned int volume)
{
- const int clamped_volume = CLAMP(volume, 1, 100);
+ const unsigned int clamped_volume = CLAMP(volume, 1, 100);
/* This range isn't set in stone --
arrived at from manual tests on Nextus 4 */
@@ -181,7 +181,7 @@ private:
const std::shared_ptr<Clock> m_clock;
const std::string m_filename;
- const int m_volume;
+ const unsigned int m_volume;
const bool m_loop;
const int32_t m_canberra_id;
const DateTime m_loop_end_time;
@@ -194,8 +194,8 @@ class SoundBuilder
public:
void set_clock(const std::shared_ptr<Clock>& c) {m_clock = c;}
void set_filename(const std::string& s) {m_filename = s;}
- void set_volume(const int v) {m_volume = v;}
- void set_duration_minutes(int i) {m_duration_minutes=i;}
+ void set_volume(const unsigned int v) {m_volume = v;}
+ void set_duration_minutes(int unsigned i) {m_duration_minutes=i;}
void set_looping(bool b) {m_looping=b;}
Sound* operator()() {
@@ -209,8 +209,8 @@ public:
private:
std::shared_ptr<Clock> m_clock;
std::string m_filename;
- int m_volume = 50;
- int m_duration_minutes = 30;
+ unsigned int m_volume = 50;
+ unsigned int m_duration_minutes = 30;
bool m_looping = true;
};