public GHWTDrumController(FrmMain main, int pid, int vid) { m_UsbDrum = new UsbHidPort(); m_UsbDrum.ProductId = pid; m_UsbDrum.VendorId = vid; m_UsbDrum.OnSpecifiedDeviceArrived += UsbOnSpecifiedDeviceArrived; m_UsbDrum.OnSpecifiedDeviceRemoved += UsbOnSpecifiedDeviceRemoved; m_UsbDrum.OnDataRecieved += UsbOnDataRecieved; m_HitFilter = new HitFilter(main, 6, m_GuiTranslater); m_CheckForDrumTimer = new Timer(); m_CheckForDrumTimer.Interval = 1000; m_CheckForDrumTimer.Tick += CheckForDrumsTick; m_CheckForDrumTimer.Start(); }
public ProDrumController(FrmMain main, int pid, int vid) { m_UsbDrum = new UsbHidPort(); m_UsbDrum.ProductId = pid; m_UsbDrum.VendorId = vid; m_UsbDrum.OnSpecifiedDeviceArrived += new System.EventHandler(UsbOnSpecifiedDeviceArrived); m_UsbDrum.OnSpecifiedDeviceRemoved += new System.EventHandler(UsbOnSpecifiedDeviceRemoved); m_UsbDrum.OnDataRecieved += new UsbLibrary.DataRecievedEventHandler(UsbOnDataRecieved); m_HitFilter = new HitFilter(main, NUM_PADS, m_GuiTranslater); m_CheckForDrumTimer = new Timer(); m_CheckForDrumTimer.Interval = 1000; m_CheckForDrumTimer.Tick += CheckForDrumsTick; m_CheckForDrumTimer.Start(); }
private const int MAX_HIT_PER_SECOND = 30; //33.3333ms delay public HitFilter(FrmMain main, byte numPads, IRawToGui translater) { m_RawToGuiConverter = translater; m_HitVelocities = new byte?[numPads]; m_Timers = new Timer[numPads]; m_NumPads = numPads; m_Main = main; for (int i = 0; i < m_NumPads; ++i) { m_HitVelocities[i] = null; m_Timers[i] = new Timer(1.0f / MAX_HIT_PER_SECOND * 1000); m_Timers[i].AutoReset = true; m_Timers[i].Elapsed += new ElapsedEventHandler(HitFilterTimer_Elapsed); } }
public GuiLinker(FrmMain main) { m_Main = main; }
public MidiSender(FrmMain main) { MidiDevices = Instrument.OutDeviceNames(); m_DrumsHandler = new Instrument(); m_Main = main; }