From: Wouter V. <m97...@us...> - 2003-06-30 19:03:28
|
Update of /cvsroot/openmsx/openMSX/src In directory sc8-pr-cvs1:/tmp/cvs-serv18853/src Modified Files: EmuTime.hh Log Message: Fixed cassette player bug Index: EmuTime.hh =================================================================== RCS file: /cvsroot/openmsx/openMSX/src/EmuTime.hh,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- EmuTime.hh 21 Apr 2003 12:42:32 -0000 1.13 +++ EmuTime.hh 30 Jun 2003 19:03:25 -0000 1.14 @@ -22,6 +22,7 @@ friend class EmuTime; // constructors + EmuDuration() { time = 0; } EmuDuration(uint64 n) { time = n; } EmuDuration(double duration) { time = (uint64)(duration*MAIN_FREQ); } @@ -29,6 +30,10 @@ float toFloat() const { return (float)time / MAIN_FREQ; } uint64 length() const { return time; } + // assignment operator + EmuDuration &operator =(const EmuDuration &d) + { time = d.time; return *this; } + private: uint64 time; }; @@ -72,6 +77,9 @@ EmuDuration operator -(const EmuTime &e) const { assert(time >= e.time); return EmuDuration(time-e.time); } + + // ticks + int getTicksAt(int freq) const { return time / (MAIN_FREQ / freq); } static const EmuTime zero; static const EmuTime infinity; |