From: Mikko Rasa Date: Wed, 19 Mar 2014 16:51:35 +0000 (+0200) Subject: Additional accessors for Clock X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=f6f08a66299ab4ac2bd3fca29a528bd609a9a672;p=r2c2.git Additional accessors for Clock --- diff --git a/source/libr2c2/clock.cpp b/source/libr2c2/clock.cpp index 890b2b2..1f467e8 100644 --- a/source/libr2c2/clock.cpp +++ b/source/libr2c2/clock.cpp @@ -13,6 +13,11 @@ void Clock::set_rate(float s) rate = s; } +void Clock::set_current_time(const Time::TimeDelta &t) +{ + current_time = t; +} + void Clock::tick(const Time::TimeDelta &dt) { unsigned prev_minute = current_time/Time::min; diff --git a/source/libr2c2/clock.h b/source/libr2c2/clock.h index 1c00158..186e0ba 100644 --- a/source/libr2c2/clock.h +++ b/source/libr2c2/clock.h @@ -19,6 +19,8 @@ public: Clock(); void set_rate(float); + float get_rate() const { return rate; } + void set_current_time(const Msp::Time::TimeDelta &); const Msp::Time::TimeDelta &get_current_time() const { return current_time; } void tick(const Msp::Time::TimeDelta &); };