public virtual void BufferSize() { using (Processor client = new Processor ("testing")) { client.Start (); Assert.IsTrue (client.BufferSize > 0); client.Stop (); } }
public virtual void ChangeNameFormat() { using (Controller controller = new Controller ("testController")) using (Processor client = new Processor ("testClient", 1)) { client.PortNameFormat = "my_{direction}-{type}_{index}"; client.Start (); Thread.Sleep (100); Assert.AreEqual ("my_in-audio_1", client.AudioInPorts.First ().Name); client.Stop (); controller.Stop (); } }
static void PlayWithJack() { using (Processor processor = new Processor("PdTest", 0, 2, 0, 0, true)) using (IWavePlayer output = new JackOut(processor)) using (PdProvider pd = new PdProvider()) { output.Init(pd); output.Play(); Console.ReadLine(); output.Stop(); } }
public virtual void ShutdownEvent() { using (Controller controller = new Controller ("testController")) using (Processor client = new Processor ("TestClient", 2, 2)) { ShutdownReceiver receiver = new ShutdownReceiver (); controller.Start (true); client.Shutdown += receiver.OnShutdown; client.Start (); Thread.Sleep (100); controller.Stop (); Thread.Sleep (100); Assert.AreEqual (1, receiver.Shutdowns); } }
public virtual void AutoConnect() { using (Controller controller = new Controller ("testController")) using (Processor client = new Processor ("testClient", 2, 2, 0, 0, true)) { ControllerReceiver receiver = new ControllerReceiver (); controller.ConnectionChanged += receiver.ConnectionChanged; controller.Start (); Thread.Sleep (100); int connectionsWithoutClient = receiver.ConnectionsFound; client.Start (); Thread.Sleep (100); Assert.AreNotEqual (connectionsWithoutClient, receiver.ConnectionsFound); client.Stop (); controller.Stop (); } }
public virtual void DefaultNameFormat() { using (Controller controller = new Controller ("testController")) using (Processor client = new Processor ("testClient", 1)) { client.Start (); Thread.Sleep (100); Assert.AreEqual ("audioin_1", client.AudioInPorts.First ().Name); client.Stop (); controller.Stop (); } }
public virtual void StopIfNotStarted() { using (Processor client = new Processor ("testing")) { Assert.IsFalse (client.Stop ()); } }
public JackIn(Processor client) { _client = client; _client.ProcessFunc += ProcessAudio; }
public virtual void SampleRate() { using (Processor client = new Processor ("testing")) { client.Start (); Assert.IsTrue (client.SampleRate == 44100 || client.SampleRate == 48000); client.Stop (); } }
public static void CreateOutput() { _client = new Processor ("testNaudioOut", 0, 2); _jackOut = new JackOut (_client); }
public JackOut(Processor client) { _client = client; _playbackState = PlaybackState.Stopped; }
public static void CreateInput() { _client = new Processor ("testNaudioIn", 2); _jackIn = new JackIn (_client); }
public static void CreateClient() { _client = new Processor ("testMidi", 0, 1, 1, 1); }
public static void CreateClient() { _client = new Processor ("testAudio", 2, 2); }
public virtual void DoubleStart() { using (Processor client = new Processor ("testing")) { Assert.IsTrue (client.Start ()); Assert.IsFalse (client.Start ()); } }
public static void CreateClient() { _client = new Processor ("testPorts", 2, 4, 1, 3); }
public virtual void StartAfterStopped() { using (Processor client = new Processor ("testing", 1)) { ClientReceiver receiver = new ClientReceiver (); client.ProcessFunc += receiver.ChannelCounterAction; Assert.IsTrue (client.Start ()); client.Stop (); Assert.IsTrue (client.Start ()); Assert.AreEqual (1, client.AudioInPorts.Count ()); Thread.Sleep (100); Assert.AreEqual (1, receiver.Called); } }
public virtual void Stop() { using (Processor client = new Processor ("testing")) { client.Start (); Assert.IsTrue (client.Stop ()); } }
public NAudioJack(IWaveProvider provider) { _waveProvider = provider; _jackProcessor = new Processor("PremierLeague", audioOutPorts:2, autoconnect:true); _soundOutput = new JackOut(_jackProcessor); }