From b0546e5e7f7044019892543c6c82029db8d564a7 Mon Sep 17 00:00:00 2001 From: Robert Jonsson Date: Thu, 15 Sep 2011 12:14:55 +0000 Subject: moved attic to a branch of it's own --- .../synti/zynaddsubfx/Input/WINMidiIn.C | 83 ---------------------- 1 file changed, 83 deletions(-) delete mode 100644 attic/muse_qt4_evolution/synti/zynaddsubfx/Input/WINMidiIn.C (limited to 'attic/muse_qt4_evolution/synti/zynaddsubfx/Input/WINMidiIn.C') diff --git a/attic/muse_qt4_evolution/synti/zynaddsubfx/Input/WINMidiIn.C b/attic/muse_qt4_evolution/synti/zynaddsubfx/Input/WINMidiIn.C deleted file mode 100644 index c20841bb..00000000 --- a/attic/muse_qt4_evolution/synti/zynaddsubfx/Input/WINMidiIn.C +++ /dev/null @@ -1,83 +0,0 @@ -/* - ZynAddSubFX - a software synthesizer - - WINMidiIn.C - Midi input for Windows - Copyright (C) 2002-2005 Nasca Octavian Paul - Author: Nasca Octavian Paul - - This program is free software; you can redistribute it and/or modify - it under the terms of version 2 of the GNU General Public License - as published by the Free Software Foundation. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License (version 2) for more details. - - You should have received a copy of the GNU General Public License (version 2) - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -*/ - -#include -#include -#include -#include -#include - -#include "WINMidiIn.h" -#include "MidiIn.h" -#include "../Misc/Util.h" - -Master *winmaster; -HMIDIIN winmidiinhandle; -MidiIn midictl;//used to convert the controllers to ZynAddSubFX controllers - -void CALLBACK WinMidiInProc(HMIDIIN hMidiIn,UINT wMsg,DWORD dwInstance, - DWORD dwParam1,DWORD dwParam2){ - int midicommand=MidiNull; - if (wMsg==MIM_DATA){ - int cmd,par1,par2; - cmd=dwParam1&0xff; - if (cmd==0xfe) return; - par1=(dwParam1>>8)&0xff; - par2=dwParam1>>16; - //printf("%x %x %x\n",cmd,par1,par2);fflush(stdout); - int cmdchan=cmd&0x0f; - int cmdtype=(cmd>>4)&0x0f; - - int tmp=0; - pthread_mutex_lock(&winmaster->mutex); - switch(cmdtype){ - case(0x8)://noteon - winmaster->NoteOff(cmdchan,par1); - break; - case(0x9)://noteoff - winmaster->NoteOn(cmdchan,par1,par2&0xff); - break; - case(0xb)://controller - winmaster->SetController(cmdchan,midictl.getcontroller(par1),par2&0xff); - break; - case(0xe)://pitch wheel - tmp=(par1+par2*(long int) 128)-8192; - winmaster->SetController(cmdchan,C_pitchwheel,tmp); - break; - default:break; - }; - pthread_mutex_unlock(&winmaster->mutex); - - }; -}; - -void InitWinMidi(Master *master_){ - winmaster=master_; - - long int result=midiInOpen(&winmidiinhandle,config.cfg.WindowsMidiInId,(DWORD)WinMidiInProc,0,CALLBACK_FUNCTION); - result=midiInStart(winmidiinhandle); -}; - -void StopWinMidi(){ - midiInStop(winmidiinhandle); - midiInClose(winmidiinhandle); -}; -- cgit v1.2.3