From f6f08a66299ab4ac2bd3fca29a528bd609a9a672 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Wed, 19 Mar 2014 18:51:35 +0200 Subject: [PATCH] Additional accessors for Clock --- source/libr2c2/clock.cpp | 5 +++++ source/libr2c2/clock.h | 2 ++ 2 files changed, 7 insertions(+) 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 &); }; -- 2.45.2