jdkmidi class library documentation

Copyright © 2004 J.D. Koftinoff Software, Ltd.

Released under the GNU General Public License (GPL)




Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

src/jdkmidi_sysex.cpp

Go to the documentation of this file.
00001 /*
00002  *  libjdkmidi-2004 C++ Class Library for MIDI
00003  *
00004  *  Copyright (C) 2004  J.D. Koftinoff Software, Ltd.
00005  *  www.jdkoftinoff.com
00006  *  jeffk@jdkoftinoff.com
00007  *
00008  *  *** RELEASED UNDER THE GNU GENERAL PUBLIC LICENSE (GPL) April 27, 2004 ***
00009  *
00010  *  This program is free software; you can redistribute it and/or modify
00011  *  it under the terms of the GNU General Public License as published by
00012  *  the Free Software Foundation; either version 2 of the License, or
00013  *  (at your option) any later version.
00014  *
00015  *  This program is distributed in the hope that it will be useful,
00016  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018  *  GNU General Public License for more details.
00019  *
00020  *  You should have received a copy of the GNU General Public License
00021  *  along with this program; if not, write to the Free Software
00022  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00023 */
00024 /*
00025 **  Copyright 1986 to 1998 By J.D. Koftinoff Software, Ltd.
00026 **
00027 **  All rights reserved.
00028 **
00029 **  No one may duplicate this source code in any form for any reason
00030 **  without the written permission given by J.D. Koftinoff Software, Ltd.
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 }