public void TestContinueOK() { Out123 handle = new Out123(); handle.Continue(); Assert.AreEqual(Out123.Errors.OK, handle.LastErrorCode()); }
public void TestSetBufferOK() { Out123 handle = new Out123(); handle.SetBufferSize(10); Assert.AreEqual(Out123.Errors.OK, handle.LastErrorCode()); }
public void TestEncodingSizeForInvalidEncoding() { Out123 handle = new Out123(); int result = handle.EncodingSize(0); Assert.AreEqual(0, result); }
public void TestCloseHandleNotOpenedOK() { Out123 handle = new Out123(); handle.Close(); Assert.AreEqual(Out123.Errors.OK, handle.LastErrorCode()); }
public void TestSetParamFloatOK() { Out123 handle = new Out123(); handle.SetParamFloat(Out123.Params.FLAGS, 1.0d); Assert.AreEqual(Out123.Errors.OK, handle.LastErrorCode()); }
public void TestSetParamStringOK() { Out123 handle = new Out123(); handle.SetParamString(Out123.Params.BINDIR, "myDir"); Assert.AreEqual(Out123.Errors.OK, handle.LastErrorCode()); }
public void TestStopOK() { Out123 handle = new Out123(); handle.Stop(); Assert.AreEqual(Out123.Errors.OK, handle.LastErrorCode()); }
public void TestNDrainSomeBytesOK() { Out123 handle = new Out123(); handle.Drain(10); Assert.AreEqual(Out123.Errors.OK, handle.LastErrorCode()); }
public void TestDriverInfoOK() { Out123 handle = new Out123(); handle.DriverInfo(); Assert.AreEqual(Out123.Errors.OK, handle.LastErrorCode()); }
public void TestDelete() { Out123 handle = new Out123(); handle.Dispose(); Assert.True(true, "Api Call ended succesfully!!"); }
public void TestDriversOnOutNotOpenedGoesInException() { Out123 handle = new Out123(); Assert.That(() => handle.Drivers().ToArray(), Throws.TypeOf <Out123.ErrorException>()); // Misleading exception. The call goes in error but the error message returned is "OK No Problem" }
public void TestLastErrorNoProblem() { Out123 handle = new Out123(); string result = handle.LastErrorString(); Assert.AreEqual("no problem", result); }
public void TestLastErrorCodeOK() { Out123 handle = new Out123(); Out123.Errors result = handle.LastErrorCode(); Assert.AreEqual(Out123.Errors.OK, result); }
public void TestBufferedOK() { Out123 handle = new Out123(); ulong result = handle.Buffered(); Assert.AreEqual(0, result); }
public void TestGetParamIntOK() { Out123 handle = new Out123(); handle.SetParamInt(Out123.Params.FLAGS, 2); long result = handle.GetParamInt(Out123.Params.FLAGS); Assert.AreEqual(2, result); }
public void TestGetParamStringOK() { Out123 handle = new Out123(); handle.SetParamString(Out123.Params.BINDIR, "mydir"); string result = handle.GetParamString(Out123.Params.BINDIR); Assert.AreEqual("mydir", result); }
public void TestGetParamFloatOK() { Out123 handle = new Out123(); handle.SetParamFloat(Out123.Params.GAIN, 5.0); double result = handle.GetParamFloat(Out123.Params.GAIN); Assert.AreEqual(5, result); }
public void TestOpenWithDefaultOK() { //Console.WriteLine(System.IO.Path.GetFullPath(".")); //Tryed to absolute point at plugin folder to understand if the error was due to releative path issue. Out123 handle = new Out123("C:\\_fdf\\projects\\workspace_aiv\\LEZ39_20180322\\aiv-mpg123_git\\Aiv.Mpg123.Tests\\bin\\Debug\\plugins"); handle.Open(); Assert.AreEqual(Out123.Errors.OK, handle.LastErrorString()); }
public void TestGetParamFloatOK() { Out123 handle = new Out123(); handle.SetParamFloat(Out123.Params.GAIN, 5.0); double result = handle.GetParamFloat(Out123.Params.GAIN); Assert.AreEqual(5, result); //Test should work. Strange behavior just with the double value. Maybe Bug in Out123?!?! }
public void TestCopyParamFromOK() { Out123 handle = new Out123(); handle.SetParamInt(Out123.Params.FLAGS, 0); Out123 other = new Out123(); other.SetParamInt(Out123.Params.FLAGS, 1); handle.CopyParamFrom(other); Assert.AreEqual(1, handle.GetParamInt(Out123.Params.FLAGS)); }
public void TestDriversOK() { Out123 handle = new Out123(); Assert.That(handle.Drivers().ToArray(), Has.Length.GreaterThan(0)); /* * try { * } catch (Out123.ErrorException e) { * //Console.WriteLine(handle.LastError()); * //Console.WriteLine("CURRENT: " + e); * Assert.Fail(); * } */ }
static void Main(string[] args) { foreach (string decoder in Mpg123.Decoders) { Console.WriteLine(decoder); } Out123 out123 = new Out123(); out123.Open(); Mpg123 mpg123 = new Mpg123(); mpg123.Open("Assets/bensound-epic.mp3"); int offset = 0; while (true) { byte[] data = null; uint size = 0; Mpg123.Errors error = mpg123.DecodeFrame(ref offset, ref data, ref size); if (error == Mpg123.Errors.NEW_FORMAT) { long rate = 0; int channels = 0; int encoding = 0; mpg123.GetFormat(ref rate, ref channels, ref encoding); out123.Start(rate, channels, encoding); } else if (error == Mpg123.Errors.OK) { out123.Play(data); } } Console.ReadLine(); }
public void TestCreationOK() { Out123 handle = new Out123(); Assert.True(true, "No exception is launched!"); }
public void TestOpenWithDefaultOK() { Out123 handle = new Out123("invalid-plugin-path"); Assert.That(() => handle.Open(), Throws.TypeOf <Out123.ErrorException>()); }
public void TestGetDriverInfoOnOutNotOpenedGoesInException() { Out123 handle = new Out123(); Assert.That(() => handle.GetDriverInfo(), Throws.TypeOf <Out123.ErrorException>()); }
public void TestEncodingsOnOutNotOpenedGoesInException() { Out123 handle = new Out123(); Assert.That(() => handle.EncodingsFor(44100, 2), Throws.TypeOf <Out123.ErrorException>()); }
public void TestGetFormatOnNotOpenedOutGoesInException() { Out123 handle = new Out123(); Assert.That(() => handle.GetFormat(), Throws.TypeOf <Out123.ErrorException>()); }