1 //========================================================= 2 // MusE 3 // Linux Music Editor 4 // $Id: mtc.h,v 1.1.1.1 2003/10/27 18:51:25 wschweer Exp $ 5 // 6 // (C) Copyright 1999/2000 Werner Schweer (ws@seh.de) 7 // 8 // This program is free software; you can redistribute it and/or 9 // modify it under the terms of the GNU General Public License 10 // as published by the Free Software Foundation; version 2 of 11 // the License, or (at your option) any later version. 12 // 13 // This program is distributed in the hope that it will be useful, 14 // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 // GNU General Public License for more details. 17 // 18 // You should have received a copy of the GNU General Public License 19 // along with this program; if not, write to the Free Software 20 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 21 // 22 //========================================================= 23 24 #ifndef __MTC_H__ 25 #define __MTC_H__ 26 27 #include <stdint.h> 28 29 namespace MusECore { 30 31 //--------------------------------------------------------- 32 // MTC 33 //--------------------------------------------------------- 34 35 class MTC { 36 unsigned char _h, _m, _s, _f, _sf; 37 38 public: 39 MTC(int h, int m, int s, int f, int sf=0) { 40 _h = h; 41 _m = m; 42 _s = s; 43 _f = f; 44 _sf = sf; 45 } MTC()46 MTC() { 47 _h = _m = _s = _f = _sf = 0; 48 } 49 MTC(double, int type = -1); 50 void set(int h, int m, int s, int f, int sf=0) { 51 _h = h; 52 _m = m; 53 _s = s; 54 _f = f; 55 _sf = sf; 56 } 57 void incQuarter(int type = -1); setH(int val)58 void setH(int val) { _h = val; } setM(int val)59 void setM(int val) { _m = val; } setS(int val)60 void setS(int val) { _s = val; } setF(int val)61 void setF(int val) { _f = val; } setSf(int val)62 void setSf(int val) { _sf = val; } 63 h()64 int h() const { return _h; } m()65 int m() const { return _m; } s()66 int s() const { return _s; } f()67 int f() const { return _f; } sf()68 int sf() const { return _sf; } 69 uint64_t timeUS(int type = -1) const; 70 void print() const; 71 }; 72 73 } // namespace MusECore 74 75 #endif 76 77