| 1 | /* |
|---|
| 2 | * libjdkmidi-2004 C++ Class Library for MIDI |
|---|
| 3 | * |
|---|
| 4 | * Copyright (C) 2004 J.D. Koftinoff Software, Ltd. |
|---|
| 5 | * www.jdkoftinoff.com |
|---|
| 6 | * jeffk@jdkoftinoff.com |
|---|
| 7 | * |
|---|
| 8 | * *** RELEASED UNDER THE GNU GENERAL PUBLIC LICENSE (GPL) April 27, 2004 *** |
|---|
| 9 | * |
|---|
| 10 | * This program is free software; you can redistribute it and/or modify |
|---|
| 11 | * it under the terms of the GNU General Public License as published by |
|---|
| 12 | * the Free Software Foundation; either version 2 of the License, or |
|---|
| 13 | * (at your option) any later version. |
|---|
| 14 | * |
|---|
| 15 | * This program is distributed in the hope that it will be useful, |
|---|
| 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 18 | * GNU General Public License for more details. |
|---|
| 19 | * |
|---|
| 20 | * You should have received a copy of the GNU General Public License |
|---|
| 21 | * along with this program; if not, write to the Free Software |
|---|
| 22 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|---|
| 23 | */ |
|---|
| 24 | |
|---|
| 25 | |
|---|
| 26 | #include "jdkmidi/world.h" |
|---|
| 27 | #include "jdkmidi/track.h" |
|---|
| 28 | #include "jdkmidi/multitrack.h" |
|---|
| 29 | #include "jdkmidi/filereadmultitrack.h" |
|---|
| 30 | #include "jdkmidi/fileread.h" |
|---|
| 31 | #include "jdkmidi/fileshow.h" |
|---|
| 32 | #include "jdkmidi/sequencer.h" |
|---|
| 33 | #include "jdkmidi/manager.h" |
|---|
| 34 | #include "jdkmidi/driver.h" |
|---|
| 35 | #include "jdkmidi/driverwin32.h" |
|---|
| 36 | |
|---|
| 37 | using namespace jdkmidi; |
|---|
| 38 | |
|---|
| 39 | int main ( int argc, char **argv ) |
|---|
| 40 | { |
|---|
| 41 | #ifdef WIN32 |
|---|
| 42 | if ( argc>1 ) |
|---|
| 43 | { |
|---|
| 44 | MIDIFileReadStreamFile rs ( argv[1] ); |
|---|
| 45 | MIDIMultiTrack tracks ( 64 ); |
|---|
| 46 | MIDIFileReadMultiTrack track_loader ( &tracks ); |
|---|
| 47 | MIDIFileRead reader ( &rs, &track_loader ); |
|---|
| 48 | MIDISequencerGUIEventNotifierText gui ( stdout ); |
|---|
| 49 | MIDISequencer seq ( &tracks, &gui ); |
|---|
| 50 | MIDIDriverWin32 driver ( 128 ); |
|---|
| 51 | MIDIManager mgr ( &driver, &gui ); |
|---|
| 52 | |
|---|
| 53 | reader.Parse(); |
|---|
| 54 | |
|---|
| 55 | driver.StartTimer ( 20 ); |
|---|
| 56 | driver.OpenMIDIOutPort ( MIDI_MAPPER ); |
|---|
| 57 | |
|---|
| 58 | seq.GoToZero(); |
|---|
| 59 | mgr.SetSeq ( &seq ); |
|---|
| 60 | |
|---|
| 61 | mgr.SetTimeOffset ( timeGetTime() ); |
|---|
| 62 | mgr.SeqPlay(); |
|---|
| 63 | |
|---|
| 64 | getchar(); |
|---|
| 65 | mgr.SeqStop(); |
|---|
| 66 | } |
|---|
| 67 | |
|---|
| 68 | return 0; |
|---|
| 69 | #endif |
|---|
| 70 | } |
|---|
| 71 | |
|---|