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

tests/jdkmidi_test_drvwin32.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 
00026 #include "jdkmidi/world.h"
00027 #include "jdkmidi/track.h"
00028 #include "jdkmidi/multitrack.h"
00029 #include "jdkmidi/filereadmultitrack.h"
00030 #include "jdkmidi/fileread.h"
00031 #include "jdkmidi/fileshow.h"
00032 #include "jdkmidi/sequencer.h"
00033 #include "jdkmidi/manager.h"
00034 #include "jdkmidi/driver.h"
00035 #include "jdkmidi/driverwin32.h"
00036 
00037 
00038 int main(int argc, char **argv)
00039 {
00040 #ifdef WIN32
00041   if( argc>1 )
00042   {
00043     MIDIFileReadStreamFile rs( argv[1] );
00044     MIDIMultiTrack tracks(64);
00045     MIDIFileReadMultiTrack track_loader( &tracks );
00046     MIDIFileRead reader( &rs, &track_loader );
00047     MIDISequencerGUIEventNotifierText gui( stdout );
00048     MIDISequencer seq( &tracks, &gui );
00049     MIDIDriverWin32 driver(128);
00050     MIDIManager mgr( &driver, &gui );
00051     
00052     reader.Parse();
00053     
00054     driver.StartTimer( 20 );
00055     driver.OpenMIDIOutPort( MIDI_MAPPER );
00056     
00057     seq.GoToZero();
00058     mgr.SetSeq( &seq );
00059     
00060     mgr.SetTimeOffset( timeGetTime() );
00061     mgr.SeqPlay();
00062     
00063     getchar();
00064     mgr.SeqStop();
00065   }
00066   
00067   return 0;
00068 #endif  
00069 }
00070 
00071