public OutputASIO(string DeviceName, int Frequency, GetSampleDelegate Callback24, GetSampleDelegate Callback16, Player Player) : base(DeviceName, Player) { needsUnload = true; playing = false; callback16 = Callback16; callback24 = Callback24; deviceNum = getDeviceNum(DeviceName); if (initializedDevice >= 0) { BassAsio.BASS_ASIO_Free(); initializedDevice = -1; } if (deviceNum < 0 || !BassAsio.BASS_ASIO_Init(deviceNum)) { System.Diagnostics.Debug.WriteLine(BassAsio.BASS_ASIO_ErrorGetCode()); return; } initializedDevice = deviceNum; if (!setup(Frequency)) { return; } playing = true; }
public OutputDX(string DeviceName, int Frequency, GetSampleDelegate Callback, Form ParentForm, Player Player) : base(DeviceName, Player) { frequency = Frequency; callback = Callback; parentForm = ParentForm; createDevice(); playStartThread(); }
public static Output GetOutput(string Name, int Frequency, Form ParentForm, GetSampleDelegate Callback16, GetSampleDelegate Callback24, Player Player) { try { if (OutputASIO.DeviceExists(Name)) { Output o = new OutputASIO(Name, Frequency, Callback24, Callback16, Player); if (o != null && o.Playing) { return(o); } else { Controller.ShowMessage("ASIO output failed; using default output device."); return(new OutputDX(String.Empty, Frequency, Callback16, ParentForm, Player)); } } } catch { } return(new OutputDX(Name, Frequency, Callback16, ParentForm, Player)); }