Ejemplo n.º 1
0
        public static void Initialize()
        {
            lock (typeof(PlayerConnection))
            {
                if (initialized)
                {
                    return;
                }

                string headerFile = System.Web.Configuration.WebConfigurationManager.AppSettings["HeaderFile"];

                ID3V2_Header = System.IO.File.ReadAllBytes(headerFile);


                Initializer.Initialize(Program.INTEGRATION_INITIALIZATION);

                _control = Initializer.Control;
                _control.PushCommand("ldasm CPlayerStreamer.dll");
                _control.PushCommand("setp 2");
                _control.PushCommand("starthkm");
                _control.WaitQueueExecution();

                CPlayerStreamer.ImmediateStreamer streamer = Player.GetInstance().GetImplementer() as CPlayerStreamer.ImmediateStreamer;
                streamer.PushData += (o, d) =>
                {
                    LastDataPacket = d;
                    DataRecived.Set();
                    DataRecived.Reset();
                };

                CPlayer.Output.Display.Print += (sender, text, color, newLine) =>
                {
                    if (newLine)
                    {
                        _sb.AppendLine(text);
                    }
                    else
                    {
                        _sb.Append(text);
                    }



                    LastOutput = text;
                    TextRecieved.Set();
                    TextRecieved.Reset();
                };
                _buffer     = new ReceiveBuffer();
                initialized = true;
            }
        }
Ejemplo n.º 2
0
 public static void Play()
 {
     _control.PushCommand("play");
 }