Jump to content
Excelsior Forums


  • Content count

  • Joined

  • Last visited


Community Reputation

0 Neutral

About simondk

  • Rank
  • Birthday 01/01/1
  1. Hello, The company i work at bought xFunction cause we have a dot net (c#) solution that we to some point need to port to a java plugin for a costumer. We have an USB connected footpedal to which we have a dll driver. And in the dot net solution we load the driver, after which we can catch the input from the footpedal through the code below. Is something like this posible in Java, using xFunction, and if it is how would you do this ? im totally new to xFunction, and have been away from the java scene for about a year, so please explain in details. Loading the driver Olympus.ConnectUSB(Handle); The driver class [DllImport("DSSUSBF.DLL", EntryPoint="GetFootSWInfo")] unsafe public static extern uint GetFootSWInfo(uint* FSNum); [DllImport("DSSUSBF.DLL", EntryPoint="OpenUSBFootSW")] unsafe public static extern uint OpenUSBFootSW(uint hWhandle, uint qNumber); public static bool ConnectUSB(IntPtr winhandle) { unsafe { uint inf = 0; uint res = GetFootSWInfo(&inf); if (res == DSS_NOERROR) { res = OpenUSBFootSW((uint) winhandle, 0); if (res == DSS_NOERROR) { return true; } else return false; } else return false; } } Catching the events from the foorpedal protected override void WndProc(ref Message m) { //WriteLogToFile(ref m); switch (m.Msg) { case Olympus.WM_DVR_PUSHCHANGE: { FormAfspil f = null; try { //f = (FormAfspil)ActiveMdiChild; f = FormAfspil.theInstance; } catch { f = null; } if (f != null) { //... det var det. uint wp = (uint)m.WParam.ToInt32(); switch (wp) { case Olympus.DVR_push_FF_OFF: { // fodpedal FORWARD oppe break; } case Olympus.DVR_push_FF_ON: { // fodpedal FORWARD nede f.Frem(f.config.FFspeed / 1000); break; } case Olympus.DVR_push_REW_OFF: { // fodpedal REWIND oppe f.timerRestart.Stop(); break; } case Olympus.DVR_push_REW_ON: { // fodpedal REWIND nede f.timerRestart.Interval = f.config.REWresettimer; f.timerRestart.Start(); f.Tilbage(f.config.REWspeed / 1000); break; } case Olympus.DVR_push_PLAY_OFF: { // fodpedal PLAY oppe f.wmpControl.Ctlcontrols.pause(); f.Tilbage(f.config.Autobackspace / 1000); break; } case Olympus.DVR_push_PLAY_ON: { // fodpedal PLAY nede f.wmpControl.Ctlcontrols.play(); break; } } } break; } } base.WndProc(ref m); } How do i do something like this where i catch the input from the USB device, and is it even posible using xFunction? Thanks in advance ! Best regards -Simon