Exemplo n.º 1
0
        public void TestContinueOK()
        {
            Out123 handle = new Out123();

            handle.Continue();
            Assert.AreEqual(Out123.Errors.OK, handle.LastErrorCode());
        }
Exemplo n.º 2
0
        public void TestSetBufferOK()
        {
            Out123 handle = new Out123();

            handle.SetBufferSize(10);
            Assert.AreEqual(Out123.Errors.OK, handle.LastErrorCode());
        }
Exemplo n.º 3
0
        public void TestEncodingSizeForInvalidEncoding()
        {
            Out123 handle = new Out123();
            int    result = handle.EncodingSize(0);

            Assert.AreEqual(0, result);
        }
Exemplo n.º 4
0
        public void TestCloseHandleNotOpenedOK()
        {
            Out123 handle = new Out123();

            handle.Close();
            Assert.AreEqual(Out123.Errors.OK, handle.LastErrorCode());
        }
Exemplo n.º 5
0
        public void TestSetParamFloatOK()
        {
            Out123 handle = new Out123();

            handle.SetParamFloat(Out123.Params.FLAGS, 1.0d);
            Assert.AreEqual(Out123.Errors.OK, handle.LastErrorCode());
        }
Exemplo n.º 6
0
        public void TestSetParamStringOK()
        {
            Out123 handle = new Out123();

            handle.SetParamString(Out123.Params.BINDIR, "myDir");
            Assert.AreEqual(Out123.Errors.OK, handle.LastErrorCode());
        }
Exemplo n.º 7
0
        public void TestStopOK()
        {
            Out123 handle = new Out123();

            handle.Stop();
            Assert.AreEqual(Out123.Errors.OK, handle.LastErrorCode());
        }
Exemplo n.º 8
0
        public void TestNDrainSomeBytesOK()
        {
            Out123 handle = new Out123();

            handle.Drain(10);
            Assert.AreEqual(Out123.Errors.OK, handle.LastErrorCode());
        }
Exemplo n.º 9
0
        public void TestDriverInfoOK()
        {
            Out123 handle = new Out123();

            handle.DriverInfo();
            Assert.AreEqual(Out123.Errors.OK, handle.LastErrorCode());
        }
Exemplo n.º 10
0
        public void TestDelete()
        {
            Out123 handle = new Out123();

            handle.Dispose();
            Assert.True(true, "Api Call ended succesfully!!");
        }
Exemplo n.º 11
0
        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"
        }
Exemplo n.º 12
0
        public void TestLastErrorNoProblem()
        {
            Out123 handle = new Out123();
            string result = handle.LastErrorString();

            Assert.AreEqual("no problem", result);
        }
Exemplo n.º 13
0
        public void TestLastErrorCodeOK()
        {
            Out123 handle = new Out123();

            Out123.Errors result = handle.LastErrorCode();
            Assert.AreEqual(Out123.Errors.OK, result);
        }
Exemplo n.º 14
0
        public void TestBufferedOK()
        {
            Out123 handle = new Out123();
            ulong  result = handle.Buffered();

            Assert.AreEqual(0, result);
        }
Exemplo n.º 15
0
        public void TestGetParamIntOK()
        {
            Out123 handle = new Out123();

            handle.SetParamInt(Out123.Params.FLAGS, 2);
            long result = handle.GetParamInt(Out123.Params.FLAGS);

            Assert.AreEqual(2, result);
        }
Exemplo n.º 16
0
        public void TestGetParamStringOK()
        {
            Out123 handle = new Out123();

            handle.SetParamString(Out123.Params.BINDIR, "mydir");
            string result = handle.GetParamString(Out123.Params.BINDIR);

            Assert.AreEqual("mydir", result);
        }
Exemplo n.º 17
0
        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);
        }
Exemplo n.º 18
0
        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());
        }
Exemplo n.º 19
0
        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?!?!
        }
Exemplo n.º 20
0
        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));
        }
Exemplo n.º 21
0
        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();
             * }
             */
        }
Exemplo n.º 22
0
        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();
        }
Exemplo n.º 23
0
        public void TestCreationOK()
        {
            Out123 handle = new Out123();

            Assert.True(true, "No exception is launched!");
        }
Exemplo n.º 24
0
        public void TestOpenWithDefaultOK()
        {
            Out123 handle = new Out123("invalid-plugin-path");

            Assert.That(() => handle.Open(), Throws.TypeOf <Out123.ErrorException>());
        }
Exemplo n.º 25
0
        public void TestGetDriverInfoOnOutNotOpenedGoesInException()
        {
            Out123 handle = new Out123();

            Assert.That(() => handle.GetDriverInfo(), Throws.TypeOf <Out123.ErrorException>());
        }
Exemplo n.º 26
0
        public void TestEncodingsOnOutNotOpenedGoesInException()
        {
            Out123 handle = new Out123();

            Assert.That(() => handle.EncodingsFor(44100, 2), Throws.TypeOf <Out123.ErrorException>());
        }
Exemplo n.º 27
0
        public void TestGetFormatOnNotOpenedOutGoesInException()
        {
            Out123 handle = new Out123();

            Assert.That(() => handle.GetFormat(), Throws.TypeOf <Out123.ErrorException>());
        }