00001 /* 00002 00003 Copyright (C) 2003-2006 Grame 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Lesser General Public 00007 License as published by the Free Software Foundation; either 00008 version 2.1 of the License, or (at your option) any later version. 00009 00010 This library is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Lesser General Public License for more details. 00014 00015 You should have received a copy of the GNU Lesser General Public 00016 License along with this library; if not, write to the Free Software 00017 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00018 00019 Grame Research Laboratory, 9 rue du Garet, 69001 Lyon - France 00020 research@grame.fr 00021 00022 */ 00023 00024 #ifndef __ScoreViewerTypes__ 00025 #define __ScoreViewerTypes__ 00026 00027 #include "ScoreProcessingExport.h" 00028 00038 // -------------------------------------------------------------- 00041 class SPEXPORT readonly 00042 { 00043 protected: 00044 virtual ~readonly() {} 00045 }; 00046 00047 typedef float Time; 00048 00049 // -------------------------------------------------------------- 00056 class TimeRange 00057 { 00058 public: 00059 TimeRange( Time start = -1, Time end = 0 ) { Set( start, end ); } 00060 virtual ~TimeRange() {} 00061 00062 void Set( Time start, Time end ) { mStart = start; mEnd = end; } 00063 void Reset() { Set( -1, 0 ); } 00064 00065 Time GetStart() const { return mStart; } 00066 Time GetEnd() const { return mEnd; } 00067 Time GetDuration() const { return (mEnd - mStart); } 00068 00069 Time mStart; 00070 Time mEnd; 00071 00072 void Decrease() { mEnd -= 0.001f; } 00073 00074 // --------------------------------------------------------------------------------- 00075 template <typename S> bool operator == ( const S & timeRange ) const 00076 { 00077 return ( (mStart == timeRange.mStart) 00078 && (mEnd == timeRange.mEnd) ); 00079 } 00080 00081 // --------------------------------------------------------------------------------- 00082 template <typename S> bool operator != ( const S & timeRange ) const 00083 { 00084 return !(*this == timeRange); 00085 } 00086 00087 }; 00088 00091 typedef void (* PlayerCallback)(unsigned int midipitch, unsigned int velocity); 00092 00093 00100 #endif
1.5.8