]> git.tdb.fi Git - r2c2.git/commitdiff
Additional accessors for Clock
authorMikko Rasa <tdb@tdb.fi>
Wed, 19 Mar 2014 16:51:35 +0000 (18:51 +0200)
committerMikko Rasa <tdb@tdb.fi>
Wed, 19 Mar 2014 20:21:04 +0000 (22:21 +0200)
source/libr2c2/clock.cpp
source/libr2c2/clock.h

index 890b2b2cecb411bdd0b20728fadfe25951ed292a..1f467e81ba32369d3640693f24acf7e0b2c4e81c 100644 (file)
@@ -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;
index 1c00158b5f4b65ea997cb195e06b05621d74ce19..186e0baab0181b6dfa7947f53ca82ce24a40fc36 100644 (file)
@@ -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 &);
 };