/// <summary>
 /// Initializes a new instance of PacItoArmManager
 /// <param name="cmdMan">The reference to the CommandManager which this object serves</param>
 /// </summary>
 internal PacItoArmManager(PacItoCommandManager cmdMan)
 {
     this.cmdMan = cmdMan;
     CreateArmSignatures();
 }
示例#2
0
        /// <summary>
        ///  Initializes a new instance of FrmSocketSpeech
        /// </summary>
        public FrmSocketSpeech()
        {
            x64 = IntPtr.Size == 8;
            InitializeComponent();
            //if (x64 && Loq7SpeechGenerator.LoquendoInstalled)
            //if (Loq7SpeechGenerator.LoquendoInstalled)
            //	spGen = new Loq7SpeechGenerator();
            //else
            spGen = new SapiSpeechGenerator();
            spGen.SpeakStarted   += new SpeakStartedEventHandler(spGen_SpeakStarted);
            spGen.SpeakCompleted += new SpeakCompletedEventHandler(spGen_SpeakCompleted);
            spGen.VoiceChanged   += new VoiceChangedEventHandler(spGen_VoiceChanged);
            spGen.SpeakProgress  += new SpeakProgressEventHandler(spGen_SpeakProgress);

            //if(!x64)
            audioPlayer = new AudioPlayer32();
            //else
            //	audioPlayer = new AudioPlayer64();

            TcpPortIn        = 2052;
            TcpPortOut       = 2052;
            TcpServerAddress = System.Net.IPAddress.Parse("127.0.0.1");

            commandManager = new PacItoCommandManager();
            commandManager.SharedVariablesLoaded += new SharedVariablesLoadedEventHandler(commandManager_SharedVariablesLoaded);
            commandManager.Started               += new CommandManagerStatusChangedEventHandler(commandManager_Started);
            commandManager.Stopped               += new CommandManagerStatusChangedEventHandler(commandManager_Stopped);
            connectionManager                     = new ConnectionManager(2052, commandManager);
            connectionManager.ClientConnected    += new TcpClientConnectedEventHandler(connectionManager_ClientConnected);
            connectionManager.ClientDisconnected += new TcpClientDisconnectedEventHandler(connectionManager_ClientDisconnected);
            connectionManager.Connected          += new TcpClientConnectedEventHandler(connectionManager_Connected);
            //connectionManager.DataReceived += new ConnectionManagerDataReceivedEH(connectionManager_DataReceived);
            connectionManager.Disconnected += new TcpClientDisconnectedEventHandler(connectionManager_Disconnected);

            cexAread    = new SpgAreadCommandExecuter(spGen);
            cexAsay     = new SpgAsayCommandExecuter(spGen);
            cexRead     = new SpgReadCommandExecuter(spGen);
            cexSay      = new SpgSayCommandExecuter(spGen);
            cexShutUp   = new SpgShutUpCommandExecuter(spGen, audioPlayer);
            cexVoice    = new SpgVoiceCommandExecuter(spGen);
            cexAplay    = new SpgAplayCommandExecuter(audioPlayer);
            cexPlay     = new SpgPlayCommandExecuter(audioPlayer);
            cexPlayLoop = new SpgPlayLoopCommandExecuter(audioPlayer);

            cexReadCompatible = new SpgReadCommandExecuter("read", spGen);
            cexSayCompatible  = new SpgAsayCommandExecuter("say", spGen);

            commandManager.CommandExecuters.Add(cexAread);
            commandManager.CommandExecuters.Add(cexAsay);
            commandManager.CommandExecuters.Add(cexRead);
            commandManager.CommandExecuters.Add(cexSay);
            commandManager.CommandExecuters.Add(cexShutUp);
            commandManager.CommandExecuters.Add(cexVoice);
            commandManager.CommandExecuters.Add(cexAplay);
            commandManager.CommandExecuters.Add(cexPlay);
            commandManager.CommandExecuters.Add(cexPlayLoop);
            commandManager.CommandExecuters.Add(cexSayCompatible);
            commandManager.CommandExecuters.Add(cexReadCompatible);

            dlgConsole           = new StringEventHandler(Console);
            dlgUpdateVoiceCombo  = new VoidEventHandler(UpdateVoiceCombo);
            dlgSetTextboxText    = new SetTextboxTextCallback(SetTextboxText);
            dlgAppendTextboxText = new SetTextboxTextCallback(AppendTextboxText);
            dlgUpdatePB          = new DoubleEventHandler(UpdateProgressBar);

            AutoDisableSpRec = false;
        }
 /// <summary>
 /// Initializes a new instance of PacItoManManager
 /// <param name="cmdMan">The reference to the CommandManager which this object serves</param>
 /// </summary>
 internal PacItoManipulatorManager(PacItoCommandManager cmdMan)
 {
     this.cmdMan = cmdMan;
     CreateManipulatorSignatures();
 }
 /// <summary>
 /// Initializes a new instance of PacItoCommandManager
 /// <param name="cmdMan">The reference to the CommandManager which this object serves</param>
 /// </summary>
 internal PacItoHeadManager(PacItoCommandManager cmdMan)
     : base()
 {
     this.cmdMan = cmdMan;
     CreateHeadSignatures();
 }