' ***************************************************************************************** ' * * ' * a multithreaded preemptive multitasking realtime composition programming environment * ' * Version 12.00 * ' * Power Basic Win compiler version 10.04 * ' * Needs the Win32Api. Runs under Win XP/Vista/Windows7/Windows8/Windows10/Windows11 * ' *---------------------------------------------------------------------------------------* ' * by * ' * Em.Prof.dr.Godfried-Willem Raes * ' * founding director of the Logos Foundation * ' * researcher at Ghent University and Orpheus Institute * ' *---------------------------------------------------------------------------------------* ' * public domain software under the GNU conditions * ' ***************************************************************************************** ' This module always has to be the main for any compilation of apps. ' ****************************************************************** #COMPILER PBWIN 10 ' always make sure you use the latest compiler version #DIM ALL ' we do enforce declarations for all variables #REGISTER ALL ' we use register variables whereever possible #DEBUG ERROR OFF ' if ON should trap array boundary errors with a msgbox. #DEBUG DISPLAY OFF ' ON #TOOLS OFF #OPTIMIZE SPEED #OPTION VERSION5 ' VERSION4 compiles for Win95, Win98, Win Me, WinNT4 - 32 bit only. ' ' version5 compiles for Windows2000, XP, Vista and Windows7/8 - will not run on lower versions! '%NoMidiIn = 1 ' was workaround voor mim - nog nodig? ' load metacompiler file: ' '#INCLUDE "_meta.inc" ' use only this one for batch file compilation. '#INCLUDE "_utils.inc" ' compiles g_tools.exe '#INCLUDE "_brewaey.inc" ' compiles due_cose.ex '#INCLUDE "_algoko.inc" ' compiles gmt_alg.exe '#INCLUDE "_faust.inc" ' compiles technofaustus.exe '#INCLUDE "_websit.inc" ' compiles g_demo.exe for website demo. '#INCLUDE "_enseko.inc" ' compiles gmt_ens.exe '#INCLUDE "_invis.inc" ' compiles gmt_ii.exe (sonar as well as radar versions, includes BOM and Songbook)) '#INCLUDE "_slag.inc" ' compiles slagwerk.exe (midi controlled percussion only) '#INCLUDE "_soloko.inc" ' compiles gmt_sol.exe 'obsolete: #INCLUDE "_roboko.inc" ' compiles g_robots.exe runs both with and without Nidaq devices '#INCLUDE "_karin.inc" ' compiles nenuasop.exe '#INCLUDE "_mim.inc" ' compile mim.exe #INCLUDE "_mrobots.inc" ' compile m_robots.exe (includes all midi controlled robots, except percussion) '#INCLUDE "_sens.inc" ' compiles app's using sensing devices without NiDAQ: Ranger, Picra, ADXL, g_pads, HY1 '#INCLUDE "_picra.inc" ' compiles to g_picra.exe - contains the same picradar code as g_interfaces and new ones - code for other sensors from g_interfaces is not included here '#INCLUDE "_controllers.inc" ' compiles g_ctrl.exe : app's using wired sensing devices '#INCLUDE "_player.inc" ' compiles the M&M file player and its interactive app's. '#INCLUDE "_butoh.inc" ' voor M&M butoh produktie '#INCLUDE "_namuda.inc" ' compile namuda.exe gesture recognition code using doppler only '#INCLUDE "_kristof.inc" ' compile klAlg.exe '#INCLUDE "_kristof2.inc" ' compile klIax.exe '#include "_machinewall.inc" ' compile machinewall.exe '#INCLUDE "_lukas.inc" ' compiles Lukas Huisman kode ' not compiling on \\No compile problem... '#INCLUDE "_yvan.inc" ' compiles Yvan Vander Sanden kode ' links statically to g_nxh, which should not happen!! (INITDAQDLL, PREPAREDAQMENU, FINDNIDAQDEVICE, IOPORTSELECTOR) ''''''''''#INCLUDE "_test.inc" '%interceptcrashes = 1 #IF %DEF (%interceptcrashes) #INCLUDE ONCE "g_crash.inc" 'experimental: crash interception code #ENDIF #IF NOT %DEF($kompilfile) $kompilfile = "GMT" '#RESOURCE "resource\gmt.pbr" ' gwr: dit hoort inderdaad in de if lus! #RESOURCE "resource\gmt.res" ' pbr form no longer required in PBWin10 #ENDIF '* GMT MAIN * FUNCTION WINMAIN(BYVAL hInst AS LONG, BYVAL hPrev AS LONG, BYVAL lpszCmdLine AS ASCIIZ PTR, BYVAL nCmdShow AS LONG) EXPORT AS LONG LOCAL msg AS tagMSG LOCAL wc AS WndClassEx LOCAL szClassName AS ASCIIZ * 80 LOCAL x AS INTEGER LOCAL y AS INTEGER LOCAL i AS DWORD LOCAL IccEx AS INIT_COMMON_CONTROLSEX LOCAL cptr AS DWORD #IF %DEF (%interceptcrashes) PrepareExceptionfilter 'now it seems to work.. reports access violation on doppler_daq crash (and prevents crash from happening..! #ENDIF gh.Inst = hInst ' save instance handle gh.InstDLL = GetModuleHandle("g_lib.dll") ' instance handle of our library dll gh.file = GetModuleHandle("g_file.dll") gh.mus = GetModuleHandle("g_mus.dll") gh.hmix = GetModuleHandle("g_wmix.dll") gh.gnh = LoadLibrary($dll) ' $dll konstante wordt geset in g_h.bi , ' deze library wordt dynamisch geladen. $dll = "g_nxh.dll" SLEEP 100 IF ISFALSE gh.gnh THEN MSGBOX "Failed loading " + $dll,, "" EXIT FUNCTION END IF GMT_Initialize SLEEP 100 ' should initialize only general/default items, valid for all app's. ' Initialisation of application specific tasks should take place after the ' appropriate item has been selected by the user in the opening window menu. ' InitTasks makes a call to SetTasks so that the G_LIB.DLL can have access to all ' the Task() structures as well as to the window handles contained in gh. ' The dll's use pointers to access task data in GMT and your app.code. IccEx.dwSize = SIZEOF (IccEx) IccEx.dwICC = %ICC_WIN95_CLASSES OR %ICC_COOL_CLASSES OR %ICC_DATE_CLASSES OR %ICC_INTERNET_CLASSES OR %ICC_USEREX_CLASSES InitCommonControlsEx IccEx ' more possible values for IccEx.ICC are: ' %ICC_DATE_CLASSES 'Load date and time picker control class. ' %ICC_PAGESCROLLER_CLASS 'Load pager control class. szClassName = $kompilfile wc.cbSize = SIZEOF(wc) wc.style = %CS_HREDRAW OR %CS_VREDRAW wc.lpfnWndProc = CODEPTR(WndProc) wc.cbClsExtra = 0 wc.cbWndExtra = 0 wc.hInstance = hInst wc.hIcon = gmt_Icon ($kompilfile) ' dll call in g_lib.dll wc.hCursor = LoadCursor(%NULL, BYVAL %IDC_ARROW) wc.hbrBackground = GetSysColorBrush(%COLOR_3DFACE)' gives gray. GetStockObject(%WHITE_BRUSH) wc.lpszMenuName = %NULL wc.lpszClassName = VARPTR(szClassName) wc.hIconSm = wc.hIcon ' LoadIcon(gh.InstDLL, BYVAL %IDI_APPLICATION) RegisterClassEx wc x = (GetSystemMetrics(%SM_CXSCREEN)) ' horizontal screen resolution in pixels (1024) x = MIN%(x,640) y = (GetSystemMetrics(%SM_CYSCREEN)) ' vertical resolution in pixels (768) y = MIN%(y,480) gh.Setup = CreateWindowEx(%WS_EX_APPWINDOW,_ szClassName,_ ' window class name "LogoSoft GMT realtime experimental composition software", _ %WS_OVERLAPPEDWINDOW, _ ' window style %CW_USEDEFAULT,_ ' initial x position %CW_USEDEFAULT,_ ' initial y position x,_ ' initial x size y,_ ' initial y size %HWND_DESKTOP, _ ' parent window handle LoadMenu(gh.InstDLL, "MAINMENU"), _ ' window menu handle, in DLL resource gh.Inst, _ ' program instance handle BYVAL %Null) ' creation parameters ShowWindow gh.Setup, %SW_SHOW PrepareMenu ' removes menu selections that are not present in this build of App.hIcon = wc.hIcon ' sets default icon UpdateWindow gh.setup ' this sends a paint message... SetForegroundWindow gh.setup ' make sure we first set up the engine... CenterWindow gh.setup ' also possible: CornerWindow h, "rb" 'i = SetPriorityClass (GetCurrentProcess(), %REALTIME_PRIORITY_CLASS) ' no longer essential since we set the dll priority high. ' CheckTimerResolution can be called as a void function, or as a function returning ' the resolution expressed in ms. This must be matched with a call to timeEndPeriod. SLEEP 100 ' 'if we don't do the following on Windows 7, we get only 10 ms resolution!! 'Checktimerresolution returns 1 on Yo timeBeginPeriod CheckTimerResolution ' in g_indep 03.06.2009 #IF %DEF(%ii_mim) mim_autostart #ENDIF DO IF GetMessage (msg, %Null, %Null, %Null) THEN WindowsMessageHandler msg ' in g_lib.dll ELSE EXIT LOOP END IF LOOP logfile "exit from main loop" g_CLEANUP logfile"g_cleanup done" FUNCTION = %False END FUNCTION FUNCTION WndProc (BYVAL hWnd AS LONG, BYVAL wMsg AS LONG, BYVAL wParam AS LONG, BYVAL lParam AS LONG) EXPORT AS LONG ' In the window served by this callback, we initialize all parameters for a users GMT application STATIC szTitelBox AS ASCIIZ * 30 STATIC hStatus AS LONG STATIC hMenu AS LONG STATIC nrOpenMidiOutPorts AS BYTE STATIC nrOpenMidiInPorts AS BYTE STATIC nrOpenWaveOutPorts AS BYTE STATIC nrOpenWaveInPorts AS BYTE STATIC nrOpenAuxPorts AS BYTE STATIC nrOpenMixers AS BYTE STATIC cfgflag AS BYTE LOCAL lpToolTip AS TOOLTIPTEXT PTR ' tooltip texts are defined in the resource file LOCAL i AS LONG LOCAL zText AS ASCIIZ * 255 LOCAL m AS STRING 'ASCIIZ * 1024 LOCAL msgval& LOCAL DAQfound AS BYTE LOCAL mciOpenParms AS MCI_OPEN_PARMS ' for MCI support STATIC hMixer AS DWORD ' 12.05.2000 LOCAL h AS DWORD ' 23.07.2004 LOCAL cptr AS DWORD FUNCTION = %False SELECT CASE wMsg CASE %WM_CREATE hStatus = CreateStatusWindow(%WS_CHILD OR %WS_BORDER OR %WS_VISIBLE OR %SBS_SIZEGRIP,"", hWnd, 200) hMenu = GetMenu(gh.setup) szTitelBox = " Main Set Up Message" CASE %WM_NOTIFY lpToolTip = lParam IF @lpToolTip.hdr.code = %TTN_NEEDTEXT THEN LoadString gh.InstDLL, @lpToolTip.hdr.idFrom, zText, SIZEOF(zText) @lpToolTip.lpszText = VARPTR(zText) END IF EXIT FUNCTION CASE %WM_MENUSELECT ' comments are displayed on the status bar LoadString gh.InstDLL, wParam, zText, SIZEOF(zText) ' the comment strings are defined in the g_lib.dll resource SendMessage hStatus, %WM_SETTEXT, 0, VARPTR(zText) EXIT FUNCTION ' CASE %WM_MOUSEMOVE ' included here only to demonstrate the coding... ' zText = "Mouse Position:" + STR$(LOWRD(lParam)) + ","+STR$(HIWRD(lParam)) ' SendMessage hStatus, %WM_SETTEXT, 0, VARPTR(zText) ' EXIT FUNCTION CASE %WM_SIZE IF hStatus THEN SendMessage hStatus, wMsg, wParam, lParam ' hstatus is static EXIT FUNCTION CASE %WM_COMMAND hMenu = GetMenu(gh.setup) SELECT CASE LOWRD(wParam) ' CASE %IDM_0 TO %IDM_0 + 19 ' no longer used. (was toolbar) #IF NOT %DEF(%gmt_w95) CASE %IDM_NETWORK ' 23.11.2002 i = g_net_init (App) ' initializes g_net.dll IF i THEN CheckMenuItem hMenu, %IDM_NETWORK, %MF_CHECKED CheckMenuItem hMenu, %IDM_NETWORK, %MF_GRAYED cfgflag = %True ELSE Warning "Failure to open network sockets in" + FUNCNAME$, 10000 END IF #ENDIF #IF NOT %DEF(%NoMidiIn) CASE %IDM_MIDI_INPUT_DEVS ' in this case we just open it... h = OpenMidiInputDevice (0) IF h THEN CheckMenuItem hMenu, %IDM_MIDI_INPUT_DEVS, %MF_CHECKED EnableMenuItem hMenu, %IDM_MIDI_INPUT_DEVS, %MF_GRAYED IF hMidiI(0) <> h THEN Warning "Inconsistency bug hMidiI() in " + FUNCNAME$, 10000 nrOpenMidiInPorts = 1 cfgflag = %True ELSE Warning "Failure opening midi-input device in " + FUNCNAME$, 10000 END IF #ENDIF CASE %IDM_MIDI_OUTPUT_DEVS ' this message only received if only a single midi-output port exists. MENU GET STATE hMenu, BYCMD %IDM_MIDI_OUTPUT_DEVS TO i IF i = -1 THEN EXIT FUNCTION h = OpenMidiOutputDevice (0) IF h THEN CheckMenuItem hMenu, %IDM_MIDI_OUTPUT_DEVS, %MF_CHECKED EnableMenuItem hMenu, %IDM_MIDI_OUTPUT_DEVS, %MF_GRAYED IF hMidiO(0) <> h THEN Warning "Inconsistency bug hMidiO() in " + FUNCNAME$, 10000 nrOpenMidiOutPorts = 1 cfgflag = %True ELSE Warning "Failure opening midi-output device in " + FUNCNAME$, 10000 END IF CASE %IDM_MIDI_OUTPUT_PORTS TO %IDM_MIDI_OUTPUT_PORTS + 15 ' = LOWRD(wParam) ' here we open devices selected from the dynamic pop-up i = LOWRD(wParam) - %IDM_MIDI_OUTPUT_PORTS ' number of selected device LOCAL var& MENU GET STATE hMenu, BYCMD %IDM_MIDI_OUTPUT_PORTS + i TO var& IF var& = -1 THEN EXIT FUNCTION ' cannot happen... INCR nrOpenMidiOutPorts ' becomes 1 h = OpenMidiOutputDevice(i) ' dll IF h THEN CheckMenuItem hMenu,%IDM_MIDI_OUTPUT_PORTS + i,%MF_CHECKED EnableMenuItem hMenu,%IDM_MIDI_OUTPUT_PORTS + i,%MF_GRAYED IF hMidiO(nrOpenmidiOutPorts-1) <> h THEN Warning "Inconsistency bug hMidiO() in " + FUNCNAME$, 10000 cfgflag = %True ELSE Warning "Failure opening selected midi-out port in " + FUNCNAME$, 10000 DECR nrOpenMidiOutPorts END IF #IF NOT %DEF(%NoMidiIn) CASE %IDM_MIDI_INPUT_PORTS TO %IDM_MIDI_INPUT_PORTS + 15 ' = LOWRD(wParam) i = LOWRD(wParam) - %IDM_MIDI_INPUT_PORTS MENU GET STATE hMenu, BYCMD %IDM_MIDI_INPUT_PORTS + i TO var& IF var& = -1 THEN EXIT FUNCTION ' cannot happen... INCR nrOpenMidiInPorts h = OpenMidiInputDevice(i) ' dll IF h THEN CheckMenuItem hMenu,%IDM_MIDI_INPUT_PORTS + i,%MF_CHECKED EnableMenuItem hMenu,%IDM_MIDI_INPUT_PORTS + i,%MF_GRAYED IF hMidiI(nrOpenMidiInPorts-1) <> h THEN Warning "Inconsistency bug hMidiI() in " + FUNCNAME$, 10000 cfgflag = %True ELSE DECR nrOpenMidiInPorts Warning "Failure opening selected midi-in port in " + FUNCNAME$, 10000 END IF #ENDIF CASE %IDM_WAVE_INPUT_DEVS ' in this case we just open the device... Audio.hWi = OpenAudioInputDevice (0,TrackStatus) IF Audio.hWi THEN CheckMenuItem hMenu, %IDM_WAVE_INPUT_DEVS, %MF_CHECKED EnableMenuItem hMenu,%IDM_WAVE_INPUT_DEVS,%MF_GRAYED WaveFader(1).ID = 0 ' wave-in device id mixerGetID Audio.hWi, WaveFader(1).mixID, %MIXER_OBJECTF_HWAVEIN ' get the fader in the windows mixer IF WaveFader(1).mixID = -1 THEN Warning "No mixer element found for this wave-in device in " + FUNCNAME$, 10000 WaveFader(1).ID = -1 ELSE mixerOpen hMixer, Audio.hWi,GetProcAddress(gh.hmix,"PROCMIXER"), %NULL,%MIXER_OBJECTF_HWAVEIN WaveFader(1).hMix = hMixer WaveFader(1).tag = "WaveIn" END IF cfgflag = %True ELSE Warning "Failure opening wave-input device in " + FUNCNAME$, 10000 END IF CASE %IDM_WAVE_INPUT_PORTS TO %IDM_WAVE_INPUT_PORTS + 15 ' for now, we allow only a single port to be selected... i = LOWRD(wParam) - %IDM_WAVE_INPUT_PORTS ' number of selected device MENU GET STATE hMenu, BYCMD %IDM_WAVE_INPUT_PORTS + i TO var& IF var& = -1 THEN EXIT FUNCTION ' cannot happen... Audio.hWi = OpenAudioInputDevice (i, TrackStatus) IF Audio.hWi THEN CheckMenuItem hMenu, %IDM_WAVE_INPUT_PORTS + i, %MF_CHECKED EnableMenuItem hMenu,%IDM_WAVE_INPUT_PORTS + i, %MF_GRAYED WaveFader(1).ID = i mixerGetID Audio.hWi, WaveFader(1).mixID, %MIXER_OBJECTF_HWAVEIN ' get the fader in the windows mixer IF WaveFader(1).mixID = -1 THEN Warning "No mixer element found for this wave-in device in " + FUNCNAME$, 10000 WaveFader(1).ID = -1 ELSE mixerOpen hMixer, Audio.hWi,GetProcAddress(gh.hmix,"PROCMIXER"), %NULL,%MIXER_OBJECTF_HWAVEIN WaveFader(1).tag = "WaveIn" WaveFader(1).hMix = hMixer END IF cfgflag = %True ELSE Warning "Failure opening selected wave-input device in " + FUNCNAME$, 10000 END IF CASE %IDM_WAVE_OUTPUT_DEVS ' in this case we just open the device... Audio.hWo = OpenAudioOutputDevice (0, TrackStatus) IF Audio.hWo THEN CheckMenuItem hMenu, %IDM_WAVE_OUTPUT_DEVS, %MF_CHECKED EnableMenuItem hMenu,%IDM_WAVE_OUTPUT_DEVS, %MF_GRAYED WaveFader(0).ID = 0 ' wave-out device ID mixerGetID Audio.hWo, WaveFader(0).mixID, %MIXER_OBJECTF_HWAVEOUT ' get the fader in the windows mixer mixerOpen hMixer, Audio.hWo,GetProcAddress(gh.hmix,"PROCMIXER"), %NULL,%MIXER_OBJECTF_HWAVEOUT WaveFader(0).tag = "WaveOut" WaveFader(0).hMix = hMixer cfgflag = %True ELSE Warning "Failure opening selected wave output device in " + FUNCNAME$, 10000 END IF CASE %IDM_WAVE_OUTPUT_PORTS TO %IDM_WAVE_OUTPUT_PORTS + 15 ' for now, we allow only a single port to be selected... i = LOWRD(wParam) - %IDM_WAVE_OUTPUT_PORTS ' number of selected device MENU GET STATE hMenu, BYCMD %IDM_WAVE_OUTPUT_PORTS + i TO var& IF var& = -1 THEN EXIT FUNCTION ' cannot happen... Audio.hWo = OpenAudioOutputDevice (i,TrackStatus) IF Audio.hWo THEN CheckMenuItem hMenu, %IDM_WAVE_OUTPUT_PORTS + i, %MF_CHECKED EnableMenuItem hMenu,%IDM_WAVE_OUTPUT_PORTS + i, %MF_GRAYED WaveFader(0).ID = i mixerGetID Audio.hWo, WaveFader(0).mixID, %MIXER_OBJECTF_HWAVEOUT ' get the fader in the windows mixer mixerOpen hMixer, Audio.hWo,GetProcAddress(gh.hmix,"PROCMIXER"), %NULL,%MIXER_OBJECTF_HWAVEOUT WaveFader(0).tag = "WaveOut" WaveFader(0).hMix = hMixer cfgflag = %True ELSE Warning "Failure opening selected wave output device in " + FUNCNAME$, 10000 END IF CASE %IDM_AUX_PORTS TO %IDM_AUX_PORTS + 15 ' 14.12.1999 ' we introduced a new type array: AudioFader() ' these devices may be present in all or some of the available mixer lines! i = LOWRD(wParam)- %IDM_AUX_PORTS ' number of the selected device INCR nrOpenAuxPorts REDIM PRESERVE AudioFader(0 TO nrOpenAuxPorts -1) AS GLOBAL AudioFaderType AudioFader(nrOpenAuxPorts-1).ID = i ' store the device identifier CheckMenuItem hMenu, %IDM_AUX_PORTS + i, %MF_CHECKED EnableMenuItem hMenu, %IDM_AUX_PORTS + i, %MF_GRAYED CASE %IDM_MIXERS ' in this case only a single mixer was found. IF ISFALSE Audio.hInstMIX THEN Audio.hInstMIX = SHELL ($WinMix,4) ' runs the mixer applet asynchronously IF Audio.hInstMIX THEN CheckMenuItem hMenu, %IDM_MIXERS,%MF_CHECKED END IF ' MSGBOX "hmix:" + HEX$(gh.hmix) cptr = GetProcAddress(gh.hmix,"PROCMIXER") ' MSGBOX "cptr:" + HEX$(cptr) msgval& = mixerOpen (hMixer, 0, cptr, %NULL, %MIXER_OBJECTF_MIXER) IF ISFALSE ReportMixerError (msgval&) THEN gh.wMix = hMixer ' save mixer handle as global. MixerLines OutPutMixer, InputMixer ' works. for debugging... CheckMenuItem hMenu, %IDM_MIXERS,%MF_CHECKED EnableMenuItem hMenu, %IDM_MIXERS, %MF_GRAYED END IF CASE %IDM_MIX_PORTS TO %IDM_MIX_PORTS + 15 i = LOWRD(wParam)- %IDM_MIX_PORTS ' number of the selected device IF ISFALSE Audio.hInstMIX THEN Audio.hInstMIX = SHELL ($WinMix,4) ' runs the mixer applet asynchronously IF Audio.hInstMIX THEN CheckMenuItem hMenu, %IDM_MIXERS,%MF_CHECKED ' impossible... END IF msgval& = mixerOpen (hMixer, i, GetProcAddress(gh.hmix,"PROCMIXER"), %NULL, %MIXER_OBJECTF_MIXER) IF ISFALSE ReportMixerError (msgval&) THEN gh.wMix = hMixer ' save mixer handle as global. ' we can retrieve the mixer id again by calling: ' mixerGetID gh.wMix, i, $%MIXER_OBJECTF_HMIXER MixerLines OutputMixer, InputMixer ' for debugging... returns the 3 lines, we use only 2 CheckMenuItem hMenu, %IDM_MIX_PORTS + i,%MF_CHECKED EnableMenuItem hMenu, %IDM_MIX_PORTS + i, %MF_GRAYED END IF ' DAQ section ' CASE %IDM_SIMULATOR ' CheckMenuItem hMenu, %IDM_SIMULATOR, %MF_CHECKED ' DAQparams.device = "SIMULATOR" ' cfgflag = %True ' IF %Wordy > 1 THEN ' m = "Selections for data acquisition hardware have been cancelled" + CHR$(13, 10) ' m = m + "A software simulator will be used for debugging only " + CHR$(13, 10) ' Warning m, 10000 ' END IF CASE %IDM_NONE CheckMenuItem hMenu, %IDM_NONE, %MF_CHECKED DAQparams.device = "None" DAQparams.id = %False IF %Wordy > 1 THEN m = "All selections for data acquisition hardware have been cancelled" + CHR$(13) Warning m, 10000 END IF CASE %IDM_DAQ_PORTS TO %IDM_DAQ_PORTS_LAST ' we can select one DAQ device and one DIO device. cfgflag = %True cptr = GetProcAddress(gh.gnh, "FINDNIDAQDEVICE") ' proc. in all g_n*h.dll versions CALL DWORD cptr USING FindNiDAQdevice(LOWRD(wParam)- %IDM_DAQ_PORTS + 1,%True) SLEEP 0 CheckMenuItem hMenu, LOWRD(wParam), %MF_CHECKED ' remmed out because if we have NiDAQ installed, the applets can be activated from the desktop anyway ' CASE %IDM_DAQ_PORTS_LAST + 1 ' ' shell testpanel for NiDAQ ' IF $dll = "g_nih.dll" THEN ' msgval& = SHELL ($NiDAQtestpanel,4) ' runs the program asynchronously ' ELSEIF $dll = "g_nxh.dll" THEN ' msgval& = SHELL ($NiDAQmxtestpanel, 4) ' nidaq 8.8 ' ELSE ' ' niks ' END IF ' CheckMenuItem hMenu, LOWRD(wParam), %MF_CHECKED ' ' the call for NiDAQmx is different!!! CASE %IDM_OPEN_CONFIG ' new 21.01.2005 IF ReadSetup THEN CheckMenuItem hMenu, LOWRD(wParam), %MF_CHECKED OR %MF_GRAYED cfgflag = %True ' this is required. Otherwize, gmt does not start... END IF CASE %IDM_SAVE_CONFIG IF WriteSetup THEN CheckMenuItem hMenu, LOWRD(wParam), %MF_CHECKED END IF CASE %IDM_ROBOT TO %IDM_ROBOT_LAST ' these are the midi controlled robots CheckMenuItem hMenu, LOWRD(wParam),%MF_CHECKED CheckMenuItem hMenu, LOWRD(wParam),%MF_GRAYED App.Id = LOWRD(wParam) ' ---------------------------------------------------------------------- ' group: %IDM_0 + 220 TO %IDM_0 + 240 CASE %IDM_MCI_MIDI_REC ' = %IDM_0 + 220 ' MCI devices.- support added 06.09.1999 IF ISFALSE MCIid.h THEN MCIid.h = MakeMCIWindow 'LOCAL mciOpenParms AS MCI_OPEN_PARMS mciOpenParms.lpstrDeviceType = %MCI_DEVTYPE_SEQUENCER mciOpenParms.dwCallback = MCIiD.h mciOpenParms.wDeviceID = %False CASE %IDM_MCI_WAVE_REC ' = %IDM_0 + 221 IF ISFALSE MCIid.h THEN MCIid.h =MakeMCIWindow 'LOCAL mciOpenParms AS MCI_OPEN_PARMS mciOpenParms.lpstrDeviceType = %MCI_DEVTYPE_WAVEFORM_AUDIO mciOpenParms.dwCallback = MCIiD.h mciOpenParms.wDeviceID = %False ' CASE %IDM_MCI_JOYSTICK ' = %IDM_0 + 222 ' IF ISFALSE MCIid.h THEN MCIid.h =MakeMCIWindow ' 'mciOpenParms.lpstrDeviceType = %MCI_DEVTYPE_??? ' mciOpenParms.dwCallback = MCIiD.h ' mciOpenParms.wDeviceID = %False CASE %IDM_MCI_CD ' = %IDM_0 + 230 IF ISFALSE MCIid.h THEN MCIid.h = MakeMCIWindow 'mciSendString "set cdaudio door open", "", %NULL, %NULL ' this works, but starts autoplay... LOCAL retval AS LONG ' LOCAL DevName AS ASCIIZ * 10 ' DevName = "cdaudio" + CHR$(0) mciOpenParms.lpstrDeviceType = %MCI_DEVTYPE_CD_AUDIO 'VARPTR(DevName) mciOpenParms.dwCallback = MCIiD.h mciOpenParms.wDeviceID = %False ' mciOpenParms.lpstrAlias = VARPTR(DevName) retval = mciSendCommand(0,%MCI_OPEN,%MCI_OPEN_TYPE OR %MCI_OPEN_TYPE_ID, BYREF mciOpenParms) IF retval THEN ReportMCIError retval CheckMenuItem hMenu, %IDM_MCI_CD, %MF_UNCHECKED EXIT FUNCTION END IF IF mciOpenParms.wDeviceID THEN MCIid.CDid= mciOpenParms.wDeviceID CheckMenuItem hMenu, %IDM_MCI_CD,%MF_CHECKED GetCDDeviceCaps ELSE ReportMCIError retval CheckMenuItem hMenu, %IDM_MCI_CD,%MF_UNCHECKED EXIT FUNCTION END IF 'mciSendString "set cdaudio door open", "", %Null, BYVAL (MCIid.h) CloseCD ' forces reading nr tracks etc... CASE %IDM_MCI_MIDI ' = %IDM_0 + 232 ' opens the sequencer device for playing midi files. ' for recording, the id %IDM_MCI_MIDI_REC will be used. IF ISFALSE MCIid.h THEN MCIid.h = MakeMCIWindow 'DevName = "sequencer" '+ CHR$(0) 'mciOpenParms.lpstrDeviceType = VARPTR(DevName) ' or : mciOpenParms.lpstrDeviceType = %MCI_DEVTYPE_SEQUENCER mciOpenParms.dwCallback = MCIiD.h mciOpenParms.wDeviceID = %False 'for test: 'LOCAL midifilenaam AS ASCIIZ * 40 'midifilenaam = "C:\b\pb\gmt\obotek\obotek.mid" '+ CHR$(0) 'mciOpenParms.lpstrElementName = VARPTR(midifilenaam) 'could be midi file to be opened. 'mciOpenParms.lpstrAlias = VARPTR(DevName) 'if the registered ID is used: retval = mciSendCommand(0,%MCI_OPEN,%MCI_NOTIFY OR %MCI_OPEN_TYPE OR %MCI_OPEN_TYPE_ID, BYREF mciOpenParms) ' if the name string is used: 'retval = mciSendCommand(0,%MCI_OPEN,%MCI_NOTIFY OR %MCI_OPEN_TYPE, BYREF mciOpenParms) ' may return 'this is not a registered mci device', if you have not installed the ' midi sequencer under windows. IF mciOpenParms.wDeviceID THEN MCIid.SEQid = mciOpenParms.wDeviceID CheckMenuItem hMenu, %IDM_MCI_MIDI,%MF_CHECKED ' getdevicecaps... GetSEQDeviceCaps 'MCIid.SEQid ELSE ReportMCIError retval CheckMenuItem hMenu, %IDM_MCI_MIDI,%MF_UNCHECKED END IF CASE %IDM_MCI_WAVE ' = %IDM_0 + 233 IF ISFALSE MCIid.h THEN MCIid.h = MakeMCIWindow mciOpenParms.lpstrDeviceType = %MCI_DEVTYPE_WAVEFORM_AUDIO mciOpenParms.dwCallback = MCIiD.h mciOpenParms.wDeviceID = %False ' application setup messages: CASE %ID_GWR TO %ID_LAST ' the complete range of app. constants. App.Id = LOWRD(wParam) CheckMenuItem hMenu, LOWRD(wParam),%MF_CHECKED CASE %IDM_EXIT IF gh.Cockpit THEN EndDialog gh.Cockpit, 0 PostQuitmessage 0 EXIT FUNCTION CASE %IDM_HELP TO %IDM_ABOUT_LAST gmt_CreateAboutBox LOWRD(wParam) 'in g_lib.dll CASE %IDM_GMTMAINSTART IF StartApplication THEN ' minimize this window, if the application could be started. CloseWindow hWnd END IF EXIT FUNCTION END SELECT InvalidateRect hWnd, BYVAL 0, BYVAL 1 ' placed here, to avoid repetition above. EXIT FUNCTION CASE %WM_PAINT IF ISFALSE cfgflag THEN ShowIntroScreen 'places intro text in the main-window (gh.setup) INCR cfgflag ELSE ShowMenuSelections END IF EXIT FUNCTION CASE %WM_DESTROY PostQuitMessage 0 ' this quits GMT !!! EXIT FUNCTION CASE ELSE FUNCTION = DefWindowProc(hWnd, wMsg, wParam, lParam) EXIT FUNCTION END SELECT END FUNCTION FUNCTION StartApplication() EXPORT AS LONG LOCAL i AS DWORD LOCAL hMenu AS LONG LOCAL CockpitLayo AS CockpitLabels LOCAL TaskParamLAbels() AS ASCIIZ * 8 FUNCTION = %False ' default return value. hMenu = GetMenu(gh.setup) ' here we create the cockpit! App.hIcon = GetApplicationIconHandle (App.id) IF ISFALSE gh.Cockpit THEN gh.Cockpit = CreateDialogParam (gh.InstDLL, "GMTCockpit", %Null, GetProcAddress(gh.InstDLL,"GMTCOCKPIT"), 0) ReadCockpitLabelsFromFile IniFileName, CockpitLayo ' read default labels - proc. in g_file.dll PrintCockpitLabels CockpitLayo InitButtons ButnSW(), ButnOS() ' set default buttons - dll., publishes button pointers to dll DIM TaskParamLabels(2) MakeSliderControls gh.Cockpit,2, Slider(), TaskParamLabels() 'last param is a dummy in this case REDIM UDctrl(App.NrUpdowns-1) AS GLOBAL UpDownController MakeCockpitUpDowns UDctrl() InitFunctionKeys FunctionKey() ' call default initialisation of function keys... , publishes pointers to DLL ShowWindow gh.Cockpit, %SW_HIDE ' we dont want to see the Cockpit prior to its update... ' we create this dialog window as non-modal and not as a child of the opening window! END IF ' App.id should be set prior to calling this function! ' only here we read the app.specific initialisation files... SELECT CASE App.Id 'put slagwerk first, as otherwise it is not selected (part of '%ID_GWR TO %ID_GWR + &HFFF') 'in simulation we should delete/gray all other choices... CASE %ID_WSB_SERVER #IF %DEF(%gmt_wsb) SetDlgItemText gh.Cockpit, %GMT_TITLE, "" 'szTitelBox CALL wsb_initserver FUNCTION = %true #ENDIF CASE %IDM_ROBOT TO %IDM_ROBOT_LAST #IF %DEF(%gmt_gorgel) FUNCTION = StartMidiRobotApplication (App.id) 'm_robots.exe #ENDIF #IF %DEF(%gmt_slagwerk) FUNCTION = StartMidiRobotApplication (App.id) 'slagwerk.exe #ENDIF #IF %DEF(%gwr) CASE %ID_GWR TO %ID_GWR + &H0FFF IF ISFALSE WinProcGwrEx THEN 'function in gmt_gwr.inc CheckMenuItem hMenu, App.Id, %MF_UNCHECKED MSGBOX "Initialisation for this piece not succesfull",,FUNCNAME$ EXIT FUNCTION ELSE FUNCTION = %True END IF #ENDIF #IF %DEF(%kristofLauwers) CASE %ID_KL_KOMPOS1 TO %ID_KL_KOMPOS1 + &H0FFF FUNCTION = InitKlKompos(App.id) #ENDIF CASE %ID_STUDENTS TO %ID_STUDENTS + &H0FFF ' here we should add menu items according to the compilation... #IF %DEF(%Students) IF ISFALSE InitStudKomps THEN CheckMenuItem hMenu, App.Id, %MF_UNCHECKED EXIT FUNCTION ELSE FUNCTION = %True END IF #ELSE EXIT FUNCTION #ENDIF CASE %ID_LUKASHUISMAN TO %ID_LUKASHUISMAN + 10 #IF %DEF(%LukasHuisman) IF ISFALSE InitLHKompos (App.id) THEN CheckMenuItem hMenu, App.id, %MF_UNCHECKED EXIT FUNCTION ELSE FUNCTION = %TRue END IF #ELSE EXIT FUNCTION #ENDIF CASE %ID_LB_DUECOSE #IF %DEF(%DueCose) ' for performance of Due Cose by Luc Brewaeys IF ISFALSE DueCoseInit THEN CheckMenuItem hMenu, App.Id, %MF_UNCHECKED EXIT FUNCTION ELSE FUNCTION = %True END IF #ELSE EXIT FUNCTION #ENDIF CASE %ID_DEMO, %ID_DEFAULT, %ID_PIANOPHASE #IF %DEF(%Demo) IF ISFALSE InitDemo THEN CheckMenuItem hMenu, App.Id, %MF_UNCHECKED EXIT FUNCTION ELSE FUNCTION = %True END IF #ENDIF CASE %ID_INTERFACES ' new 20.05.2005 #IF %DEF(%g_interfaces) IF ISFALSE Init_Interfaces THEN CheckMenuItem hMenu, App.Id, %MF_UNCHECKED EXIT FUNCTION ELSE FUNCTION = %True END IF #ENDIF CASE %ID_PICRA ' new 11.05.2016 #IF %DEF(%g_picra) IF ISFALSE Init_Picra THEN CheckMenuItem hMenu, App.Id, %MF_UNCHECKED EXIT FUNCTION ELSE FUNCTION = %True END IF #ENDIF CASE %ID_TOOLS #IF %DEF(%utils) IF ISFALSE Init_Utils THEN CheckMenuItem hMenu, App.Id,%MF_UNCHECKED EXIT FUNCTION ELSE FUNCTION = %True END IF #ENDIF CASE %ID_PLAYER #IF %DEF(%player) IF ISFALSE Init_Player THEN CheckMenuItem hMenu, App.Id,%MF_UNCHECKED EXIT FUNCTION ELSE FUNCTION = %True END IF #ENDIF CASE %ID_BUTOH ' new 19.06.2009 #IF %DEF(%butoh) IF ISFALSE Init_butoh THEN CheckMenuItem hMenu, App.Id,%MF_UNCHECKED EXIT FUNCTION ELSE FUNCTION = %True END IF #ENDIF CASE %ID_DOPPLER ' new 06.06.2010 #IF %DEF(%namuda) IF ISFALSE Namuda_Init THEN CheckMenuItem hMenu, App.Id,%MF_UNCHECKED EXIT FUNCTION ELSE FUNCTION = %True END IF #ENDIF CASE %ID_CTRL #IF %DEF(%g_ctrl) IF ISFALSE Init_Controllers THEN CheckMenuItem hMenu, App.Id,%MF_UNCHECKED EXIT FUNCTION ELSE FUNCTION = %True END IF #ENDIF END SELECT DIALOG DOEVENTS ' kl added. SetFaders AudioFader(), WaveFader() ' publish the newest pointers to dll UpdateCockpit ' definitive initialisation of the cockpitwindow (DLL procedure in g_main) ShowWindow gh.Cockpit, %SW_SHOW END FUNCTION '***************** FUNCTIONS & PROCEDURES ****************** FUNCTION GMT_Initialize () AS DWORD ' This is the very first procedure called by LOCAL i AS LONG LOCAL f AS STRING LOCAL zt AS ASCIIZ * 20 LOCAL cptr AS DWORD DIM Task (%NumberOfTasks -1) AS GLOBAL Taak ' global arrays must be declared as global with empty parenthesis ' and dimensioned again as global in the procedure code! DIM TaskEx(UBOUND(Task)) AS GLOBAL ExtraInfo ' cfr. dll manual DIM SampleList(0) AS GLOBAL ASCIIZ * 50 ' overwritten in reading app specific file... DIM Slider(127) AS GLOBAL SliderController ' start off with 2 for the cockpit - changed to 127 31.01.2020 DIM UDctrl(127) AS GLOBAL UpDownController ' start off with none for the cockpit. DIM ButnSW(11) AS GLOBAL SwitchController ' toggling buttons DIM ButnOS(11) AS GLOBAL OneShotController ' one shot buttons DIM FunctionKey(1 TO 48) AS GLOBAL FunctionKeyController ' initfunctionskeys publishes the pointers in the dll ' globals for realtime audio I/O: one fader for each Aux device found. DIM AudioFader(0) AS GLOBAL AudioFaderType ' redim depending on hardware- cfr. winproc DIM WaveFader(1) AS GLOBAL AudioFaderType ' for wave I/O devices ' wavefader 0 is for wave-out ' wavefader 1 is for wave-in DIM PatternSeq(0) AS GLOBAL PatternSequenceType ' redim depends on reading app. file (dll procedure) DIM SampleList(0) AS GLOBAL ASCIIZ * 50 ' idem. REDIM WavHdr(15) AS GLOBAL WAVEHDR ' declared global! ' it would be easier and better to put this entirely ' and only into the dll. (we can use DIM WavHdr(15) at ...) DIM Meq(0) AS GLOBAL MidiEquipment f = COMMAND$ ' if GMT was started with an ini filename in the command line, we will read it. f = TRIM$(f) IF f = "" THEN f = IniFileName ' g_indep.dll i = InitFileIOdll (Task(),TaskEX(),gh,App) ' g_file.dll i = ReadAppDataFromFile (f) ' g_file.dll i = Init_lib_pointers (gh, App, Task(), TaskEx(),Keyboard, Meq()) ' 08.06.2002 g_lib.bas i = Init_g_wave(gh, App, Task(), TaskEx()) Init_G_wmix(gh, App, Task(), TaskEx()) ' i = ReadAudioDataFromFile (f, AudioFader()) 'dll ' only scalars (arrays) are (re)dimensioned here ' non scalars are defined in gmt_glob.bi ' g_lib.dll uses its own copy of following globals. ' Please note that, although the variables have the same name, they are not shared! ' We have to use globals in instances where we actually wanted to have constants. ' PB however does not allow us to have floating point constants! ' ------------------------ ' for aku-module in harmony library: - tuning base La = ReadDiapasonFromFile (f) ' g_file.dll - returns La as global single. GrondDo = La * (2!^(3!/12!))/64! Domq = La * (2!^(5!/24!))/64! '= 7.94305: ' quartertone lower for semitone bands in FFT's ' ------------------------- TrackStatus.lastrecordedtrack = -1 TrackStatus.lastplayedtrack = -1 PrepareWaveFunctions WavHdr(), TrackStatus ' publish the pointers of these structures to g_lib.dll ResetStaff Staff ' this sets the parameters to the default values, saves pointer in DLL @pStaff in DLL SetMCI MCIid, AudioCD ' publish pointers to g_lib.dll SetFaders AudioFader(), WaveFader() ' publish pointers to g_lib.dll. cptr = GetProcAddress(gh.gnh, "INITDAQDLL") IF cptr THEN CALL DWORD cptr USING InitDaqDll(Task(), TaskEX(), gh, App, DAQparams, DIOparams ) ELSE MSGBOX "No codepointer for InitDaqDll",, FUNCNAME$ END IF ' publish pointers to g_nih.dll, or, if %NiDAQ is not defined, to g_noh.dll (now $dll) ' the name of the library is in the string constant $dll. ' note that at this point, the cockpit is not created, so calling ' it will lead to a zero pointer!!! FUNCTION = %True END FUNCTION SUB g_CLEANUP () EXPORT ' since PBWIN8.0 Cleanup seems to be a reserved word... ' 28.02.2020: shouldn't we close all windows? LOCAL i AS LONG LOCAL retval AS LONG LOCAL nr AS LONG LOCAL cptr AS DWORD STATIC done AS BYTE logfile FUNCNAME$ + STR$(done) IF ISFALSE done THEN ' this leaves the computer in a clean state... #IF %DEF(%g_mm_inc) MM_AllOff %MM_Notes OR %MM_Lights OR %MM_Wind OR %MM_Motor OR %MM_Power #ENDIF FOR i = 0 TO UBOUND(Task) ' required to make the tasks quit... IF BIT(Task(i).swit,%TASK_ONOFF) THEN StopTask i IF Task(i).hparam THEN DestroyWindow Task(i).hparam Task(i).hParam = %Null NEXT i CLOSE ' close all opened files. nr = TrackStatus.StreamOut ' may contain a handle to the mixing thread for audiostreaming TrackStatus.StreamOut = %False ' causes streamaudio thread in the dll to exit. ' logfile "close audio threads" + STR$(nr) IF nr THEN IF nr <> %True THEN ' nr is true only when callback mixing was enabled. DO THREAD CLOSE nr TO retval logfile STR$(nr) + STR$(retval) LOOP UNTIL retval = %NotFalse END IF END IF ' MSGBOX "closed audio threads!",,FUNCNAME$ ' logfile "closed audiothreads" #IF NOT %DEF(%NoMidiIn) ' logfile "now close midi in" + STR$(UBOUND(hMidiI)) ' crash conditie: gmt blijft hangen op MidiInClose van devices die wel geopend zijn maar geen midi ontvangen hebben! FOR i = 0 TO UBOUND(hMidiI) ' o.k. for multiport IF hMidiI(i) THEN ' logfile "clear mibuf"+ STR$(i) ClearMiBuf i ' 05.10.2006 removed quitsysexthread, as we don't start it automatically anymore ' QuitSysExThread i ' SxThread.flags = &HFFFFFFFF forces sysex thread to exit, if on. ' logfile "close midi handle"+ STR$(i) midiInClose hMidiI(i) ' winAPI call - we should close the devices ' logfile "ök" END IF ' logfile "next i" NEXT i #ENDIF ' logfile "closed midi in" FOR retval = 0 TO UBOUND(hMidiO) ' adapted to multiport IF hMidiO(retval) THEN ' only if we have a handle nr = retval SHIFT LEFT nr,8 ' count ports in lownibble of high byte FOR i = 0 TO 15 nr = HIBYT(nr) OR i ' ok. AllNotesOff nr NEXT i SLEEP 5 ' added 6.11.2004 kl midiOutClose hMidiO(retval) ' maybe to fast ! END IF SLEEP 10 ' added 6.11.2004 kl NEXT retval ' logfile "closed midi out" IF Audio.hWi THEN waveInClose Audio.hWi IF Audio.hWo THEN waveOutClose Audio.hWo ' logfile "closed audio handles" 'IF Audio.hInstMix THEN DestroyWindow Audio.hInstMix ' optional IF gh.wMix THEN MixerClose gh.wMix ' win32 api ' erase empty files... DeleteIfEmpty TRIM$(App.SeqFileOut) DeleteIfEmpty TRIM$(App.SeqFileIn) DeleteIfEmpty "GMT_USER.SEQ" DeleteIfEmpty "GMT_INP.SEQ" DeleteIfEmpty "SysEx.hex" ' logfile "do endperiod" timeEndPeriod CheckTimerResolution ' 05.09.1999 - must be paired with timeBeginPeriod ' logfile "endperiod done" ' cptr = GetProcAddress(gh.gnh, "CHECKTIMERRESOLUTION") ' now in g_indep ' CALL DWORD cptr USING CheckTimerResolution TO i ' timeEndPeriod i IF MCIid.CDid THEN StopCD 'kl 010913 CloseMCIDevice MCIid.CDid END IF IF MCIid.AVIid THEN CloseMCIDevice MCIid.AVIid IF MCIid.SEQid THEN CloseMCIDevice MCIid.SEQid IF MCIid.WAVid THEN CloseMCIDevice MCIid.WAVid ' here we should also close other windows if still open (03.03.2020) ' added to avoid crashes IF gh.Spec THEN DestroyWindow gh.spec IF gh.harvel THEN destroywindow gh.harvel IF gh.Harpsy THEN destroywindow gh.harpsy IF gh.melpat THEN destroywindow gh.melpat IF gh.graph THEN destroywindow gh.graph IF gh.VU THEN destroywindow gh.vu IF gh.List THEN destroywindow gh.list IF gh.wMix THEN destroywindow gh.wMix IF gh.mm THEN destroywindow gh.mm ' logfile " kill cockpit" IF gh.Cockpit THEN DestroyWindow gh.Cockpit ' logfile "do specific app cleanup" IF App.pCleanup THEN CALL DWORD App.pCleanUp Done = %True END IF ' logfile FUNCNAME$ + " all done!" END SUB SUB PrepareMenu () EXPORT ' disables inappropriate menu choices from the setup menu , in function of the actual compiled code as well as ' on availability of essential support and configuration files. LOCAL hMenu AS DWORD LOCAL i AS DWORD LOCAL hMo AS DWORD LOCAL hMi AS DWORD LOCAL cptr AS DWORD hMenu = GetMenu(gh.setup) PrepareMidiIOmenu hMo, hMi ' byref! DIM hMidiI(MAX(0, midiInGetNumDevs -1)) AS GLOBAL DWORD AT hMi 'was bug: no device caused crash.. added MAX(0,...) ' so we now refer to the same var!!! ' msgbox str$(midiOutGetNumDevs),,funcname$ DIM hMidiO(MAX(0, midiOutGetNumDevs -1)) AS GLOBAL DWORD AT hMo PrepareWaveIOmenu ' would better become hWaveO(), hWaveO() i = AdaptMenuToCompilation ' g_lib.dll - g_main.inc ' i = PrepareDaqMenu ' g_n*h.dll cptr = GetProcAddress(gh.gnh, "PREPAREDAQMENU") CALL DWORD cptr USING PrepareDaqMenu TO i #IF NOT %DEF(%gmt_w95) i = PrepareNetMenu (gh) ' g_net.dll 23.11.2002 for network support #ENDIF '#IF %DEF(%gmt_robots) ' i = PrepareRobotMenu ' - kompilatie g_robots.exe '#ENDIF #IF %DEF(%gmt_gorgel) OR %DEF(%gmt_midictrl) i = PrepareMidiRobotMenu ' rechecked/ renamed 06.12.2004 - kompilatie m_robots.exe #ENDIF #IF %DEF(%gmt_slagwerk) i = PrepareSlagwerkRobotMenu ' in mrobots.inc - kompilatie slagwerk.exe #ENDIF #IF %DEF(%GWR) InitGWRmenu ' in gmt_gwr.inc #ELSE ' MENU DELETE hMenu, BYCMD %ID_GWR 'with PBDLL 8.0 removing this removes the whole GMT_COMPOSITIONS menu.. ' if we do this we cannot run slagwerk.exe anymore... #ENDIF #IF %DEF(%Cardew) EnableMenuItem hMenu, %ID_CCARDEW, %MF_ENABLED ' for volo solo #ENDIF #IF %DEF(%kristoflauwers) EnableMenuItem hMenu, %ID_KLAUWERS, %MF_ENABLED Kl_Menu #ELSE 'MENU DELETE hMenu, BYCMD %ID_KLAUWERS EnableMenuItem hMenu, %ID_KLAUWERS, %MF_GRAYED #ENDIF #IF %DEF(%LukasHuisman) EnableMenuItem hMenu, %ID_LUKASHUISMAN, %MF_ENABLED InitLukasMenu () #ELSE MENU DELETE hMenu, BYCMD %ID_LUKASHUISMAN #ENDIF #IF %DEF(%YvanVanderSanden) EnableMenuItem hMenu, %ID_YVANVANDERSANDEN, %MF_ENABLED InitYvanMenu () 'InitNiMxMenu () #ELSE MENU DELETE hMenu, BYCMD %ID_YVANVANDERSANDEN #ENDIF #IF %DEF(%Students) InitStudMenu ' gmt_stud.inc #ENDIF #IF %DEF(%Player) i = InitPlayerMenu (hMenu) ' g_player.inc #ENDIF #IF %DEF(%butoh) EnableMenuItem hMenu, %ID_BUTOH, %MF_ENABLED #ENDIF MENU DRAW BAR gh.setup END SUB '[EOF]