Ejemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="funcion"></param>
        /// <param name="via"></param>
        /// <param name="fileName"></param>
        /// <param name="fileLength"></param>
        public void DoFunction(FunctionReplay funcion, ViaReplay via, string fileName, long fileLength)
        {
            switch (funcion)
            {
            case FunctionReplay.Stop:
                if (_ReplayTone != -1)
                {
                    Top.Mixer.Unlink(_ReplayTone);
                    SipAgent.DestroyWavPlayer(_ReplayTone);
                    _ReplayTone          = -1;
                    _Replaying           = false;
                    _StopPlaying.Enabled = false;

                    General.SafeLaunchEvent(PlayingChanged, this, new StateMsg <bool>(false));
                    if (Settings.Default.SNMPEnabled == 1)
                    {
                        Top.WorkingThread.Enqueue("SetSnmp", delegate()
                        {
                            string evento = Top.Cfg.PositionId + "_0";
                            General.SafeLaunchEvent(SetSnmpString, this, new SnmpStringMsg <string, string>(Settings.Default.StartingReplayOid, evento));
                        });
                    }
                }
                break;

            case FunctionReplay.Play:
                if (_ReplayTone == -1)
                {
                    _ReplayTone = SipAgent.CreateWavPlayer(fileName, true);
                    Top.Mixer.LinkReplay(_ReplayTone, via);
                    _Replaying = true;

                    _StopPlaying           = new Timer(1000 * fileLength / 16000);
                    _StopPlaying.Elapsed  += new ElapsedEventHandler(StopPlayingElapsed);
                    _StopPlaying.AutoReset = false;
                    _StopPlaying.Enabled   = true;

                    General.SafeLaunchEvent(PlayingChanged, this, new StateMsg <bool>(true));
                    if (Settings.Default.SNMPEnabled == 1)
                    {
                        Top.WorkingThread.Enqueue("SetSnmp", delegate()
                        {
                            string evento = Top.Cfg.PositionId + "_1";
                            General.SafeLaunchEvent(SetSnmpString, this, new SnmpStringMsg <string, string>(Settings.Default.StartingReplayOid, evento));
                        });
                    }
                }
                break;

            case FunctionReplay.DisableSupervisor:

            case FunctionReplay.Pause:
                /* De momento no se va a implementar */
                break;
            }
        }
Ejemplo n.º 2
0
 public void FunctionReplay(FunctionReplay function, ViaReplay via, string fileName, long fileLength)
 {
     if (function != BusinessEntities.FunctionReplay.Erase)
     {
         _EngineCmdManager.FunctionReplay(function, via, fileName, fileLength);
     }
     else
     {
         NotifMsg msg = new NotifMsg(Resources.DeleteSessionGLP, Resources.MessageInfoCaption, Resources.DeleteSessionGLP, 0, MessageType.Information, MessageButtons.OkCancel);
         _StateManager.ShowUIMessage(msg);
     }
 }
Ejemplo n.º 3
0
 public void FunctionReplay(FunctionReplay funcion, ViaReplay via, string fileName, long fileLength)
 {
 }