home *** CD-ROM | disk | FTP | other *** search
/ Large Pack of OldSkool DOS MOD Trackers / beaversweeper_v101.zip / src / Globals.cpp < prev    next >
C/C++ Source or Header  |  2003-01-06  |  626b  |  29 lines

  1. #include "stdafx.h"
  2. #include "MIDIInput.h"
  3. #include "Configuration.h"
  4.  
  5. MIDIInput *g_midi_input = 0;
  6. UINT g_midi_device = 0;
  7. UINT g_patposadd, g_chanposadd;
  8.  
  9. void GLOBALS_INIT(void)
  10. {
  11.     g_midi_input = new MIDIInput();
  12.     DWORD device = CONFIGURATION_GETDWORD( _T("MIDI"), _T("Device"), 0 );
  13.  
  14.     g_patposadd = CONFIGURATION_GETDWORD( _T("Editor"), _T("PatPosAdd"), 1 );
  15.     g_chanposadd = CONFIGURATION_GETDWORD( _T("Editor"), _T("ChanPosAdd"), 1 );
  16.  
  17.     if (device > 0)
  18.         g_midi_input->start( device - 1 );
  19.  
  20.     g_midi_device = device;
  21.  
  22. }
  23.  
  24. void GLOBALS_DESTROY(void)
  25. {
  26.     delete g_midi_input;
  27.     g_midi_input = 0;    
  28. }
  29.