00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 #include "jdkmidi/world.h"
00035
00036 #include "jdkmidi/sysex.h"
00037
00038
00039 #ifndef DEBUG_MDSYSEX
00040 # define DEBUG_MDSYSEX 0
00041 #endif
00042
00043 #if DEBUG_MDSYSEX
00044 # undef DBG
00045 # define DBG(a) a
00046 #endif
00047
00048 namespace jdkmidi
00049 {
00050
00051
00052 MIDISystemExclusive::MIDISystemExclusive( int size_ )
00053 {
00054 ENTER( "MIDISystemExclusive::MIDISystemExclusive" );
00055
00056 buf=new uchar[size_];
00057
00058 if( buf )
00059 max_len=size_;
00060 else
00061 max_len=0;
00062
00063 cur_len=0;
00064 chk_sum=0;
00065 deletable=true;
00066 }
00067
00068 MIDISystemExclusive::MIDISystemExclusive( const MIDISystemExclusive &e )
00069 {
00070 buf = new unsigned char [e.max_len];
00071 max_len = e.max_len;
00072 cur_len = e.cur_len;
00073 chk_sum = e.chk_sum;
00074 deletable = true;
00075
00076 for( int i=0; i<cur_len; ++i )
00077 {
00078 buf[i] = e.buf[i];
00079 }
00080 }
00081
00082 MIDISystemExclusive::~MIDISystemExclusive()
00083 {
00084 ENTER( "MIDISystemExclusive::~MIDISystemExclusive" );
00085
00086 if( deletable )
00087 delete [] buf;
00088 }
00089
00090
00091 }