00001 /* 00002 Copyright (C) 2010 Karol Krizka <kkrizka@gmail.com> 00003 00004 URL: http://www.krizka.net/projects/libmidi/ 00005 00006 This program is free software; you can redistribute it and/or modify 00007 it under the terms of the GNU General Public License as published by 00008 the Free Software Foundation; either version 3 of the License, or 00009 (at your option) any later version. 00010 00011 This program is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 GNU General Public License for more details. 00015 00016 You should have received a copy of the GNU General Public License 00017 along with this program; if not, write to the Free Software 00018 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00019 00020 $Id$ 00021 */ 00022 00023 #include "MetaEvent.h" 00024 00025 #include "Defines.h" 00026 00027 #include <iostream> 00028 #include <iomanip> 00029 using namespace std; 00030 00031 namespace MIDI 00032 { 00033 MetaEvent::MetaEvent() 00034 : Event(),_metaType(MIDI_METAEVENT_INVALID) 00035 { } 00036 00037 MetaEvent::MetaEvent(const MetaEvent& o) 00038 : Event(o),_metaType(o._metaType) 00039 { } 00040 00041 MetaEvent::MetaEvent(dword deltaTime,byte metaType) 00042 : Event(deltaTime),_metaType(metaType) 00043 { } 00044 00045 EventType MetaEvent::type() 00046 { 00047 return MIDI_METAEVENT; 00048 } 00049 00050 byte MetaEvent::metaType() 00051 { 00052 return _metaType; 00053 } 00054 00055 DataBuffer MetaEvent::data() 00056 { 00057 DataBuffer data=Event::data(); 00058 00059 data.write(0xFF); 00060 data.write(metaType()); 00061 00062 return data; 00063 } 00064 00065 void MetaEvent::debug() 00066 { 00067 cout << "\tInvalid Meta Event 0x" << setbase(16) << (unsigned int)_metaType << endl; 00068 } 00069 }