comparison base/RealTime.h @ 26:090c22aa726a

* Add the Note layer for pianoroll-type display of note-type data * Complete the MIDI file importer (well, nearly -- it would be nice to be able to import the non-note data as other sorts of models, and that's not done yet). * Minor refactoring in RealTime etc
author Chris Cannam
date Fri, 10 Feb 2006 17:51:36 +0000
parents 2fb933f88604
children 39ae3dee27b9
comparison
equal deleted inserted replaced
25:7dad8a310963 26:090c22aa726a
17 #define _REAL_TIME_H_ 17 #define _REAL_TIME_H_
18 18
19 #include <iostream> 19 #include <iostream>
20 #include <string> 20 #include <string>
21 21
22 struct timeval;
23
24
22 /** 25 /**
23 * RealTime represents time values to nanosecond precision 26 * RealTime represents time values to nanosecond precision
24 * with accurate arithmetic and frame-rate conversion functions. 27 * with accurate arithmetic and frame-rate conversion functions.
25 */ 28 */
26 29
35 RealTime(): sec(0), nsec(0) {} 38 RealTime(): sec(0), nsec(0) {}
36 RealTime(int s, int n); 39 RealTime(int s, int n);
37 40
38 RealTime(const RealTime &r) : 41 RealTime(const RealTime &r) :
39 sec(r.sec), nsec(r.nsec) { } 42 sec(r.sec), nsec(r.nsec) { }
43
44 static RealTime fromSeconds(double sec);
45 static RealTime fromMilliseconds(int msec);
46 static RealTime fromTimeval(const struct timeval &);
40 47
41 RealTime &operator=(const RealTime &r) { 48 RealTime &operator=(const RealTime &r) {
42 sec = r.sec; nsec = r.nsec; return *this; 49 sec = r.sec; nsec = r.nsec; return *this;
43 } 50 }
44 51