using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace BroadcastModule
{
    class Program
    {
        static void Main(string[] args)
        {
            BroadcastBoard bm1 = new BroadcastBoard("192.168.0.60", 8888);

            //bm1.IpConfig("192.168.0.60", 8888);
            //bm1.Restart();
            //Console.WriteLine("wake up");


            ////Task.Factory.StartNew(() =>
            ////{
            ////    int count = 500;
            ////    while (count-- > 0)
            ////    {
            ////        bm1.VolumeControl((int)Math.Sin(count / 10.0 * Math.PI) * 8, out int vol);
            ////        Thread.Sleep(200);
            ////    }
            ////});
            ////for (int i = 0; i < 4; i++)
            ////{
            ////    bm1.DelFile(i, 0, 1);
            ////}
            ////Console.WriteLine(DateTime.Now.Hour+","+DateTime.Now.Minute+","+DateTime.Now.Second);
            //bm1 = new BroadcastBoard("192.168.0.60", 9999);
            bm1.UpdateTime();
            bm1.Refresh();
            bm1.DownloadString(0, "欢迎光临", 0);
            bm1.DispString(1, "yah hoo!", 0);
            bm1.DownloadString(2, "date", 0);
            bm1.DownloadString(3, "time", 0);
            bm1.DispDownStr(2, 0);
            bm1.DispDownStr(3, 0);

            //Task.Factory.StartNew(() =>
            //{
            //    int count = 33;
            //    while (count-- > 0)
            //    {
            //        //bm1.DispString(0, "欢迎光临",255);
            //        bm1.DispString(1, "",0);
            //        //bm1.DispString(2, "`Y年`M月`D日");
            //        //bm1.DispString(3, "`H:`N:`S");
            //        for (int i = 0; i < 20; i++)
            //        {
            //            //bm1.AudioPlay("欢迎光临");
            //            Thread.Sleep(500);
            //        }
            //        //bm1.AudioPlay("欢迎光临");
            //        //Thread.Sleep(1500);
            //        //bm1.AudioPlay("鄂ABCDEFGHIJ");
            //        //Thread.Sleep(3000);
            //    }
            //});
            //bm1.VolumeControl(5);
            Console.ReadLine();
        }
    }
}
