D:/Projekte/Super-Yano/Super-Yano/Form1.h

gehe zur Dokumentation dieser Datei
00001 #pragma once
00002 
00003 
00004 #include "RobotControl.h"
00005 #include "Choice.h"
00006 
00007 namespace SuperYano {
00008 
00009         using namespace System::Runtime::InteropServices;
00010         using namespace System;
00011         using namespace System::ComponentModel;
00012         using namespace System::Collections;
00013         using namespace System::Windows::Forms;
00014         using namespace System::Data;
00015         using namespace System::Drawing;
00016         using namespace System::Xml;
00017         using namespace SpeechLib;
00018 
00019         [DllImport("Facedetect.dll", CharSet=CharSet::Ansi)] 
00020         extern "C" void requestVideoImage( IntPtr hdc );  
00021         [DllImport("Facedetect.dll", CharSet=CharSet::Ansi)] 
00022         extern "C" void initiateVideo( int camNumber );  
00023         [DllImport("Facedetect.dll", CharSet=CharSet::Ansi)] 
00024         extern "C" void processVideoFrame( void );  
00025         [DllImport("Facedetect.dll", CharSet=CharSet::Ansi)] 
00026         extern "C" void closeVideo( void );  
00027         [DllImport("Facedetect.dll", CharSet=CharSet::Ansi)] 
00028         extern "C" int getNumberOfFaces( void );  
00029         [DllImport("Facedetect.dll", CharSet=CharSet::Ansi)] 
00030         extern "C" int getMajorFacePosX( void );  
00031         [DllImport("Facedetect.dll", CharSet=CharSet::Ansi)] 
00032         extern "C" int getMajorFacePosY( void );  
00033 
00034         static const int STOPPED = 0;
00035         static const int RUNNING = 1;
00036         static const int PAUSED  = 2;
00037 
00038         static int facedetectThreadRunningState = 0;
00039 
00040         static int processTime = 0;
00041         
00043         public ref class Form1 : public System::Windows::Forms::Form
00044         {
00045 
00046         public:
00047                 Form1(void)
00048                 {
00049                         InitializeComponent();
00050                         //
00051                         //TODO: Konstruktorcode hier hinzufügen.
00052                         //
00053                 }
00054 
00055         protected:
00059                 ~Form1()
00060                 {
00061                         if (components)
00062                         {
00063                                 delete components;
00064                         }
00065                 }
00066 
00067         private: System::ComponentModel::IContainer^  components;
00068         protected: 
00069 
00070         private: Threading::Thread^ facedetectThread;           
00071 //      private: static void facedetectThreadISR(Object^ object);
00072         private: SpeechLib::SpVoice^ voice;
00073         private: System::Windows::Forms::Timer^  visualTimer;
00074 
00075         private: System::Windows::Forms::OpenFileDialog^  openFileDialog;
00076         private: System::Windows::Forms::MenuStrip^  menuStrip1;
00077         private: System::Windows::Forms::ToolStripMenuItem^  dateiToolStripMenuItem;
00078         private: System::Windows::Forms::ToolStripMenuItem^  geschichteÖffnenToolStripMenuItem;
00079         private: System::Windows::Forms::ToolStripSeparator^  toolStripMenuItem2;
00080         private: System::Windows::Forms::TabPage^  tabPage4;
00081         private: System::Windows::Forms::GroupBox^  groupBox1;
00082         private: System::Windows::Forms::Label^  label16;
00083         private: System::Windows::Forms::CheckBox^  headMovementCheckBox;
00084         private: System::Windows::Forms::CheckBox^  mouthCheckBox;
00085         private: System::Windows::Forms::Button^  initButton;
00086         private: System::Windows::Forms::CheckBox^  trackingCheckBox;
00087         private: System::Windows::Forms::CheckBox^  lidCheckBox;
00088         private: System::Windows::Forms::CheckBox^  earCheckBox;
00089         private: System::Windows::Forms::GroupBox^  comPortGroupBox;
00090         private: System::Windows::Forms::Label^  label4;
00091         private: System::Windows::Forms::TabPage^  tabPage3;
00092         private: System::Windows::Forms::Panel^  panel2;
00093         private: System::Windows::Forms::Button^  button5;
00094         private: System::Windows::Forms::Label^  resolutionLabel;
00095         private: System::Windows::Forms::Button^  button4;
00096         private: System::Windows::Forms::Label^  label15;
00097         private: System::Windows::Forms::Label^  label14;
00098         private: System::Windows::Forms::Label^  majorfaceLabel;
00099         private: System::Windows::Forms::CheckBox^  imageProcessingCheckBox;
00100         private: System::Windows::Forms::Label^  facesLabel;
00101         private: System::Windows::Forms::Label^  executiontimeLabel;
00102         private: System::Windows::Forms::Label^  cameraLabel;
00103         private: System::Windows::Forms::Label^  label13;
00104         private: System::Windows::Forms::Label^  label12;
00105         private: System::Windows::Forms::Label^  label11;
00106         private: System::Windows::Forms::Label^  label10;
00107         private: System::Windows::Forms::Panel^  panel1;
00108         private: System::Windows::Forms::TabPage^  tabPage1;
00109         private: System::Windows::Forms::GroupBox^  voiceGroupBox;
00110         private: System::Windows::Forms::ProgressBar^  configVolumeMeter;
00111         private: System::Windows::Forms::GroupBox^  voiceInfoGroupBox;
00112         private: System::Windows::Forms::Label^  voiceLanguageLabel;
00113         private: System::Windows::Forms::Label^  label9;
00114         private: System::Windows::Forms::Label^  voiceGenderLabel;
00115         private: System::Windows::Forms::Label^  voiceAgeLabel;
00116         private: System::Windows::Forms::Label^  voiceVendorLabel;
00117         private: System::Windows::Forms::Label^  voiceNameLabel;
00118         private: System::Windows::Forms::Label^  label8;
00119         private: System::Windows::Forms::Label^  label7;
00120         private: System::Windows::Forms::Label^  label6;
00121         private: System::Windows::Forms::Label^  label5;
00122         private: System::Windows::Forms::Label^  label1;
00123         private: System::Windows::Forms::ComboBox^  voicesComboBox;
00124         private: System::Windows::Forms::Label^  voiceVolumeLabel;
00125         private: System::Windows::Forms::TrackBar^  voiceRateTrackBar;
00126         private: System::Windows::Forms::Label^  voiceRateLabel;
00127         private: System::Windows::Forms::TextBox^  voiceTestTextBox;
00128         private: System::Windows::Forms::Label^  label3;
00129         private: System::Windows::Forms::Button^  voiceTestButton;
00130         private: System::Windows::Forms::TrackBar^  voiceVolumeTrackBar;
00131         private: System::Windows::Forms::Label^  label2;
00132         private: System::Windows::Forms::TabPage^  tabPage2;
00133         private: System::Windows::Forms::Button^  openButton;
00134         private: System::Windows::Forms::RichTextBox^  storyTextBox;
00135         private: System::Windows::Forms::Button^  stopButton;
00136         private: System::Windows::Forms::Button^  pauseButton;
00137         private: System::Windows::Forms::Button^  playButton;
00138         private: System::Windows::Forms::TabControl^  tabControl;
00139         private: System::Windows::Forms::ImageList^  imageList1;
00140         private: System::Windows::Forms::ImageList^  imageList2;
00141         private: System::Windows::Forms::Label^  label17;
00142         private: System::Windows::Forms::Label^  comPortNameLabel;
00143         private: System::Windows::Forms::ProgressBar^  leftBar;
00144         private: System::Windows::Forms::ProgressBar^  rightBar;
00145         private: System::Windows::Forms::ToolStripMenuItem^  beendenToolStripMenuItem;
00146 
00147         private: int cs;
00148 
00149 
00150 #pragma region Windows Form Designer generated code
00151 
00155                 void InitializeComponent(void)
00156                 {
00157                         this->components = (gcnew System::ComponentModel::Container());
00158                         System::ComponentModel::ComponentResourceManager^  resources = (gcnew System::ComponentModel::ComponentResourceManager(Form1::typeid));
00159                         this->visualTimer = (gcnew System::Windows::Forms::Timer(this->components));
00160                         this->openFileDialog = (gcnew System::Windows::Forms::OpenFileDialog());
00161                         this->menuStrip1 = (gcnew System::Windows::Forms::MenuStrip());
00162                         this->dateiToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
00163                         this->geschichteÖffnenToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
00164                         this->toolStripMenuItem2 = (gcnew System::Windows::Forms::ToolStripSeparator());
00165                         this->beendenToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
00166                         this->tabPage4 = (gcnew System::Windows::Forms::TabPage());
00167                         this->groupBox1 = (gcnew System::Windows::Forms::GroupBox());
00168                         this->label16 = (gcnew System::Windows::Forms::Label());
00169                         this->headMovementCheckBox = (gcnew System::Windows::Forms::CheckBox());
00170                         this->mouthCheckBox = (gcnew System::Windows::Forms::CheckBox());
00171                         this->initButton = (gcnew System::Windows::Forms::Button());
00172                         this->trackingCheckBox = (gcnew System::Windows::Forms::CheckBox());
00173                         this->lidCheckBox = (gcnew System::Windows::Forms::CheckBox());
00174                         this->earCheckBox = (gcnew System::Windows::Forms::CheckBox());
00175                         this->comPortGroupBox = (gcnew System::Windows::Forms::GroupBox());
00176                         this->label17 = (gcnew System::Windows::Forms::Label());
00177                         this->comPortNameLabel = (gcnew System::Windows::Forms::Label());
00178                         this->label4 = (gcnew System::Windows::Forms::Label());
00179                         this->tabPage3 = (gcnew System::Windows::Forms::TabPage());
00180                         this->panel2 = (gcnew System::Windows::Forms::Panel());
00181                         this->button5 = (gcnew System::Windows::Forms::Button());
00182                         this->resolutionLabel = (gcnew System::Windows::Forms::Label());
00183                         this->button4 = (gcnew System::Windows::Forms::Button());
00184                         this->label15 = (gcnew System::Windows::Forms::Label());
00185                         this->label14 = (gcnew System::Windows::Forms::Label());
00186                         this->majorfaceLabel = (gcnew System::Windows::Forms::Label());
00187                         this->imageProcessingCheckBox = (gcnew System::Windows::Forms::CheckBox());
00188                         this->facesLabel = (gcnew System::Windows::Forms::Label());
00189                         this->executiontimeLabel = (gcnew System::Windows::Forms::Label());
00190                         this->cameraLabel = (gcnew System::Windows::Forms::Label());
00191                         this->label13 = (gcnew System::Windows::Forms::Label());
00192                         this->label12 = (gcnew System::Windows::Forms::Label());
00193                         this->label11 = (gcnew System::Windows::Forms::Label());
00194                         this->label10 = (gcnew System::Windows::Forms::Label());
00195                         this->panel1 = (gcnew System::Windows::Forms::Panel());
00196                         this->tabPage1 = (gcnew System::Windows::Forms::TabPage());
00197                         this->voiceGroupBox = (gcnew System::Windows::Forms::GroupBox());
00198                         this->configVolumeMeter = (gcnew System::Windows::Forms::ProgressBar());
00199                         this->voiceInfoGroupBox = (gcnew System::Windows::Forms::GroupBox());
00200                         this->voiceLanguageLabel = (gcnew System::Windows::Forms::Label());
00201                         this->label9 = (gcnew System::Windows::Forms::Label());
00202                         this->voiceGenderLabel = (gcnew System::Windows::Forms::Label());
00203                         this->voiceAgeLabel = (gcnew System::Windows::Forms::Label());
00204                         this->voiceVendorLabel = (gcnew System::Windows::Forms::Label());
00205                         this->voiceNameLabel = (gcnew System::Windows::Forms::Label());
00206                         this->label8 = (gcnew System::Windows::Forms::Label());
00207                         this->label7 = (gcnew System::Windows::Forms::Label());
00208                         this->label6 = (gcnew System::Windows::Forms::Label());
00209                         this->label5 = (gcnew System::Windows::Forms::Label());
00210                         this->label1 = (gcnew System::Windows::Forms::Label());
00211                         this->voicesComboBox = (gcnew System::Windows::Forms::ComboBox());
00212                         this->voiceVolumeLabel = (gcnew System::Windows::Forms::Label());
00213                         this->voiceRateTrackBar = (gcnew System::Windows::Forms::TrackBar());
00214                         this->voiceRateLabel = (gcnew System::Windows::Forms::Label());
00215                         this->voiceTestTextBox = (gcnew System::Windows::Forms::TextBox());
00216                         this->label3 = (gcnew System::Windows::Forms::Label());
00217                         this->voiceTestButton = (gcnew System::Windows::Forms::Button());
00218                         this->voiceVolumeTrackBar = (gcnew System::Windows::Forms::TrackBar());
00219                         this->label2 = (gcnew System::Windows::Forms::Label());
00220                         this->tabPage2 = (gcnew System::Windows::Forms::TabPage());
00221                         this->leftBar = (gcnew System::Windows::Forms::ProgressBar());
00222                         this->rightBar = (gcnew System::Windows::Forms::ProgressBar());
00223                         this->openButton = (gcnew System::Windows::Forms::Button());
00224                         this->storyTextBox = (gcnew System::Windows::Forms::RichTextBox());
00225                         this->stopButton = (gcnew System::Windows::Forms::Button());
00226                         this->imageList1 = (gcnew System::Windows::Forms::ImageList(this->components));
00227                         this->pauseButton = (gcnew System::Windows::Forms::Button());
00228                         this->playButton = (gcnew System::Windows::Forms::Button());
00229                         this->tabControl = (gcnew System::Windows::Forms::TabControl());
00230                         this->imageList2 = (gcnew System::Windows::Forms::ImageList(this->components));
00231                         this->menuStrip1->SuspendLayout();
00232                         this->tabPage4->SuspendLayout();
00233                         this->groupBox1->SuspendLayout();
00234                         this->comPortGroupBox->SuspendLayout();
00235                         this->tabPage3->SuspendLayout();
00236                         this->panel2->SuspendLayout();
00237                         this->tabPage1->SuspendLayout();
00238                         this->voiceGroupBox->SuspendLayout();
00239                         this->voiceInfoGroupBox->SuspendLayout();
00240                         (cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->voiceRateTrackBar))->BeginInit();
00241                         (cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->voiceVolumeTrackBar))->BeginInit();
00242                         this->tabPage2->SuspendLayout();
00243                         this->tabControl->SuspendLayout();
00244                         this->SuspendLayout();
00245                         // 
00246                         // visualTimer
00247                         // 
00248                         this->visualTimer->Enabled = true;
00249                         this->visualTimer->Tick += gcnew System::EventHandler(this, &Form1::timer1_Tick_1);
00250                         // 
00251                         // openFileDialog
00252                         // 
00253                         this->openFileDialog->Filter = L"Geschichte (*.xml)|*.xml|Textdatei (*.txt)|*.txt|Alle Dateien (*.*)|*.*";
00254                         this->openFileDialog->Title = L"Geschichte öffnen...";
00255                         // 
00256                         // menuStrip1
00257                         // 
00258                         this->menuStrip1->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(1) {this->dateiToolStripMenuItem});
00259                         this->menuStrip1->Location = System::Drawing::Point(0, 0);
00260                         this->menuStrip1->Name = L"menuStrip1";
00261                         this->menuStrip1->Size = System::Drawing::Size(740, 24);
00262                         this->menuStrip1->TabIndex = 2;
00263                         this->menuStrip1->Text = L"menuStrip1";
00264                         // 
00265                         // dateiToolStripMenuItem
00266                         // 
00267                         this->dateiToolStripMenuItem->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(3) {this->geschichteÖffnenToolStripMenuItem, 
00268                                 this->toolStripMenuItem2, this->beendenToolStripMenuItem});
00269                         this->dateiToolStripMenuItem->Name = L"dateiToolStripMenuItem";
00270                         this->dateiToolStripMenuItem->Size = System::Drawing::Size(44, 20);
00271                         this->dateiToolStripMenuItem->Text = L"Datei";
00272                         // 
00273                         // geschichteÖffnenToolStripMenuItem
00274                         // 
00275                         this->geschichteÖffnenToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"geschichteÖffnenToolStripMenuItem.Image")));
00276                         this->geschichteÖffnenToolStripMenuItem->Name = L"geschichteÖffnenToolStripMenuItem";
00277                         this->geschichteÖffnenToolStripMenuItem->ShortcutKeys = static_cast<System::Windows::Forms::Keys>((System::Windows::Forms::Keys::Control | System::Windows::Forms::Keys::O));
00278                         this->geschichteÖffnenToolStripMenuItem->Size = System::Drawing::Size(227, 22);
00279                         this->geschichteÖffnenToolStripMenuItem->Text = L"Geschichte öffnen...";
00280                         this->geschichteÖffnenToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::geschichteÖffnenToolStripMenuItem_Click);
00281                         // 
00282                         // toolStripMenuItem2
00283                         // 
00284                         this->toolStripMenuItem2->Name = L"toolStripMenuItem2";
00285                         this->toolStripMenuItem2->Size = System::Drawing::Size(224, 6);
00286                         // 
00287                         // beendenToolStripMenuItem
00288                         // 
00289                         this->beendenToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"beendenToolStripMenuItem.Image")));
00290                         this->beendenToolStripMenuItem->Name = L"beendenToolStripMenuItem";
00291                         this->beendenToolStripMenuItem->ShortcutKeys = System::Windows::Forms::Keys::F10;
00292                         this->beendenToolStripMenuItem->Size = System::Drawing::Size(227, 22);
00293                         this->beendenToolStripMenuItem->Text = L"Beenden";
00294                         this->beendenToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::beendenToolStripMenuItem_Click);
00295                         // 
00296                         // tabPage4
00297                         // 
00298                         this->tabPage4->Controls->Add(this->groupBox1);
00299                         this->tabPage4->Controls->Add(this->comPortGroupBox);
00300                         this->tabPage4->Location = System::Drawing::Point(4, 37);
00301                         this->tabPage4->Name = L"tabPage4";
00302                         this->tabPage4->Size = System::Drawing::Size(708, 316);
00303                         this->tabPage4->TabIndex = 3;
00304                         this->tabPage4->Text = L"Roboterkopf";
00305                         this->tabPage4->UseVisualStyleBackColor = true;
00306                         // 
00307                         // groupBox1
00308                         // 
00309                         this->groupBox1->Controls->Add(this->label16);
00310                         this->groupBox1->Controls->Add(this->headMovementCheckBox);
00311                         this->groupBox1->Controls->Add(this->mouthCheckBox);
00312                         this->groupBox1->Controls->Add(this->initButton);
00313                         this->groupBox1->Controls->Add(this->trackingCheckBox);
00314                         this->groupBox1->Controls->Add(this->lidCheckBox);
00315                         this->groupBox1->Controls->Add(this->earCheckBox);
00316                         this->groupBox1->Location = System::Drawing::Point(18, 12);
00317                         this->groupBox1->Name = L"groupBox1";
00318                         this->groupBox1->Size = System::Drawing::Size(672, 152);
00319                         this->groupBox1->TabIndex = 15;
00320                         this->groupBox1->TabStop = false;
00321                         this->groupBox1->Text = L"Servoeinstellungen";
00322                         // 
00323                         // label16
00324                         // 
00325                         this->label16->AutoSize = true;
00326                         this->label16->Location = System::Drawing::Point(164, 32);
00327                         this->label16->Name = L"label16";
00328                         this->label16->Size = System::Drawing::Size(55, 13);
00329                         this->label16->TabIndex = 12;
00330                         this->label16->Text = L"Verhalten:";
00331                         // 
00332                         // headMovementCheckBox
00333                         // 
00334                         this->headMovementCheckBox->AutoSize = true;
00335                         this->headMovementCheckBox->Location = System::Drawing::Point(13, 28);
00336                         this->headMovementCheckBox->Name = L"headMovementCheckBox";
00337                         this->headMovementCheckBox->Size = System::Drawing::Size(99, 17);
00338                         this->headMovementCheckBox->TabIndex = 7;
00339                         this->headMovementCheckBox->Text = L"Servos aktiviert";
00340                         this->headMovementCheckBox->UseVisualStyleBackColor = true;
00341                         this->headMovementCheckBox->CheckedChanged += gcnew System::EventHandler(this, &Form1::headMovementCheckBox_CheckedChanged);
00342                         // 
00343                         // mouthCheckBox
00344                         // 
00345                         this->mouthCheckBox->AutoSize = true;
00346                         this->mouthCheckBox->Checked = true;
00347                         this->mouthCheckBox->CheckState = System::Windows::Forms::CheckState::Checked;
00348                         this->mouthCheckBox->Location = System::Drawing::Point(221, 48);
00349                         this->mouthCheckBox->Name = L"mouthCheckBox";
00350                         this->mouthCheckBox->Size = System::Drawing::Size(115, 17);
00351                         this->mouthCheckBox->TabIndex = 8;
00352                         this->mouthCheckBox->Text = L"Mundbewegungen";
00353                         this->mouthCheckBox->UseVisualStyleBackColor = true;
00354                         this->mouthCheckBox->CheckedChanged += gcnew System::EventHandler(this, &Form1::mouthCheckBox_CheckedChanged);
00355                         // 
00356                         // initButton
00357                         // 
00358                         this->initButton->Location = System::Drawing::Point(549, 113);
00359                         this->initButton->Name = L"initButton";
00360                         this->initButton->Size = System::Drawing::Size(108, 23);
00361                         this->initButton->TabIndex = 6;
00362                         this->initButton->Text = L"Servos initialisieren";
00363                         this->initButton->UseVisualStyleBackColor = true;
00364                         this->initButton->Click += gcnew System::EventHandler(this, &Form1::button6_Click);
00365                         // 
00366                         // trackingCheckBox
00367                         // 
00368                         this->trackingCheckBox->AutoSize = true;
00369                         this->trackingCheckBox->Checked = true;
00370                         this->trackingCheckBox->CheckState = System::Windows::Forms::CheckState::Checked;
00371                         this->trackingCheckBox->Location = System::Drawing::Point(221, 117);
00372                         this->trackingCheckBox->Name = L"trackingCheckBox";
00373                         this->trackingCheckBox->Size = System::Drawing::Size(105, 17);
00374                         this->trackingCheckBox->TabIndex = 11;
00375                         this->trackingCheckBox->Text = L"hält Blickkontakt";
00376                         this->trackingCheckBox->UseVisualStyleBackColor = true;
00377                         this->trackingCheckBox->CheckedChanged += gcnew System::EventHandler(this, &Form1::trackingCheckBox_CheckedChanged);
00378                         // 
00379                         // lidCheckBox
00380                         // 
00381                         this->lidCheckBox->AutoSize = true;
00382                         this->lidCheckBox->Checked = true;
00383                         this->lidCheckBox->CheckState = System::Windows::Forms::CheckState::Checked;
00384                         this->lidCheckBox->Location = System::Drawing::Point(221, 71);
00385                         this->lidCheckBox->Name = L"lidCheckBox";
00386                         this->lidCheckBox->Size = System::Drawing::Size(134, 17);
00387                         this->lidCheckBox->TabIndex = 9;
00388                         this->lidCheckBox->Text = L"Blinzelt mit Augenlidern";
00389                         this->lidCheckBox->UseVisualStyleBackColor = true;
00390                         this->lidCheckBox->CheckedChanged += gcnew System::EventHandler(this, &Form1::lidCheckBox_CheckedChanged);
00391                         // 
00392                         // earCheckBox
00393                         // 
00394                         this->earCheckBox->AutoSize = true;
00395                         this->earCheckBox->Checked = true;
00396                         this->earCheckBox->CheckState = System::Windows::Forms::CheckState::Checked;
00397                         this->earCheckBox->Location = System::Drawing::Point(221, 94);
00398                         this->earCheckBox->Name = L"earCheckBox";
00399                         this->earCheckBox->Size = System::Drawing::Size(132, 17);
00400                         this->earCheckBox->TabIndex = 10;
00401                         this->earCheckBox->Text = L"wackelt mit den Ohren";
00402                         this->earCheckBox->UseVisualStyleBackColor = true;
00403                         this->earCheckBox->CheckedChanged += gcnew System::EventHandler(this, &Form1::earCheckBox_CheckedChanged);
00404                         // 
00405                         // comPortGroupBox
00406                         // 
00407                         this->comPortGroupBox->Controls->Add(this->label17);
00408                         this->comPortGroupBox->Controls->Add(this->comPortNameLabel);
00409                         this->comPortGroupBox->Controls->Add(this->label4);
00410                         this->comPortGroupBox->Location = System::Drawing::Point(18, 170);
00411                         this->comPortGroupBox->Name = L"comPortGroupBox";
00412                         this->comPortGroupBox->Size = System::Drawing::Size(672, 106);
00413                         this->comPortGroupBox->TabIndex = 14;
00414                         this->comPortGroupBox->TabStop = false;
00415                         this->comPortGroupBox->Text = L"Comport-Einstellungen";
00416                         // 
00417                         // label17
00418                         // 
00419                         this->label17->AutoSize = true;
00420                         this->label17->Location = System::Drawing::Point(10, 64);
00421                         this->label17->Name = L"label17";
00422                         this->label17->Size = System::Drawing::Size(168, 13);
00423                         this->label17->TabIndex = 13;
00424                         this->label17->Text = L"38400 Baud, 8 Datenbit, 1 Stopbit";
00425                         // 
00426                         // comPortNameLabel
00427                         // 
00428                         this->comPortNameLabel->AutoSize = true;
00429                         this->comPortNameLabel->Location = System::Drawing::Point(65, 37);
00430                         this->comPortNameLabel->Name = L"comPortNameLabel";
00431                         this->comPortNameLabel->Size = System::Drawing::Size(13, 13);
00432                         this->comPortNameLabel->TabIndex = 12;
00433                         this->comPortNameLabel->Text = L"\?";
00434                         // 
00435                         // label4
00436                         // 
00437                         this->label4->AutoSize = true;
00438                         this->label4->Location = System::Drawing::Point(10, 37);
00439                         this->label4->Name = L"label4";
00440                         this->label4->Size = System::Drawing::Size(49, 13);
00441                         this->label4->TabIndex = 11;
00442                         this->label4->Text = L"Comport:";
00443                         // 
00444                         // tabPage3
00445                         // 
00446                         this->tabPage3->Controls->Add(this->panel2);
00447                         this->tabPage3->Controls->Add(this->panel1);
00448                         this->tabPage3->Location = System::Drawing::Point(4, 37);
00449                         this->tabPage3->Name = L"tabPage3";
00450                         this->tabPage3->Size = System::Drawing::Size(708, 316);
00451                         this->tabPage3->TabIndex = 2;
00452                         this->tabPage3->Text = L"Kameras";
00453                         this->tabPage3->UseVisualStyleBackColor = true;
00454                         // 
00455                         // panel2
00456                         // 
00457                         this->panel2->Controls->Add(this->button5);
00458                         this->panel2->Controls->Add(this->resolutionLabel);
00459                         this->panel2->Controls->Add(this->button4);
00460                         this->panel2->Controls->Add(this->label15);
00461                         this->panel2->Controls->Add(this->label14);
00462                         this->panel2->Controls->Add(this->majorfaceLabel);
00463                         this->panel2->Controls->Add(this->imageProcessingCheckBox);
00464                         this->panel2->Controls->Add(this->facesLabel);
00465                         this->panel2->Controls->Add(this->executiontimeLabel);
00466                         this->panel2->Controls->Add(this->cameraLabel);
00467                         this->panel2->Controls->Add(this->label13);
00468                         this->panel2->Controls->Add(this->label12);
00469                         this->panel2->Controls->Add(this->label11);
00470                         this->panel2->Controls->Add(this->label10);
00471                         this->panel2->Location = System::Drawing::Point(340, 34);
00472                         this->panel2->Name = L"panel2";
00473                         this->panel2->Size = System::Drawing::Size(349, 240);
00474                         this->panel2->TabIndex = 1;
00475                         // 
00476                         // button5
00477                         // 
00478                         this->button5->Location = System::Drawing::Point(235, 41);
00479                         this->button5->Name = L"button5";
00480                         this->button5->Size = System::Drawing::Size(103, 23);
00481                         this->button5->TabIndex = 5;
00482                         this->button5->Text = L"rechtes Auge";
00483                         this->button5->UseVisualStyleBackColor = true;
00484                         this->button5->Click += gcnew System::EventHandler(this, &Form1::button5_Click);
00485                         // 
00486                         // resolutionLabel
00487                         // 
00488                         this->resolutionLabel->AutoSize = true;
00489                         this->resolutionLabel->Location = System::Drawing::Point(139, 120);
00490                         this->resolutionLabel->Name = L"resolutionLabel";
00491                         this->resolutionLabel->Size = System::Drawing::Size(13, 13);
00492                         this->resolutionLabel->TabIndex = 9;
00493                         this->resolutionLabel->Text = L"\?";
00494                         // 
00495                         // button4
00496                         // 
00497                         this->button4->Location = System::Drawing::Point(126, 41);
00498                         this->button4->Name = L"button4";
00499                         this->button4->Size = System::Drawing::Size(103, 23);
00500                         this->button4->TabIndex = 4;
00501                         this->button4->Text = L"linkes Auge";
00502                         this->button4->UseVisualStyleBackColor = true;
00503                         this->button4->Click += gcnew System::EventHandler(this, &Form1::button4_Click);
00504                         // 
00505                         // label15
00506                         // 
00507                         this->label15->AutoSize = true;
00508                         this->label15->Location = System::Drawing::Point(14, 46);
00509                         this->label15->Name = L"label15";
00510                         this->label15->Size = System::Drawing::Size(106, 13);
00511                         this->label15->TabIndex = 3;
00512                         this->label15->Text = L"Verwendete Kamera:";
00513                         // 
00514                         // label14
00515                         // 
00516                         this->label14->AutoSize = true;
00517                         this->label14->Location = System::Drawing::Point(14, 120);
00518                         this->label14->Name = L"label14";
00519                         this->label14->Size = System::Drawing::Size(92, 13);
00520                         this->label14->TabIndex = 8;
00521                         this->label14->Text = L"Kameraauflösung:";
00522                         // 
00523                         // majorfaceLabel
00524                         // 
00525                         this->majorfaceLabel->AutoSize = true;
00526                         this->majorfaceLabel->Location = System::Drawing::Point(139, 148);
00527                         this->majorfaceLabel->Name = L"majorfaceLabel";
00528                         this->majorfaceLabel->Size = System::Drawing::Size(13, 13);
00529                         this->majorfaceLabel->TabIndex = 7;
00530                         this->majorfaceLabel->Text = L"\?";
00531                         // 
00532                         // imageProcessingCheckBox
00533                         // 
00534                         this->imageProcessingCheckBox->AutoSize = true;
00535                         this->imageProcessingCheckBox->Location = System::Drawing::Point(17, 16);
00536                         this->imageProcessingCheckBox->Name = L"imageProcessingCheckBox";
00537                         this->imageProcessingCheckBox->Size = System::Drawing::Size(136, 17);
00538                         this->imageProcessingCheckBox->TabIndex = 2;
00539                         this->imageProcessingCheckBox->Text = L"Gesichtssuche aktiviert";
00540                         this->imageProcessingCheckBox->UseVisualStyleBackColor = true;
00541                         this->imageProcessingCheckBox->CheckedChanged += gcnew System::EventHandler(this, &Form1::imageProcessingCheckBox_CheckedChanged);
00542                         // 
00543                         // facesLabel
00544                         // 
00545                         this->facesLabel->AutoSize = true;
00546                         this->facesLabel->Location = System::Drawing::Point(139, 175);
00547                         this->facesLabel->Name = L"facesLabel";
00548                         this->facesLabel->Size = System::Drawing::Size(13, 13);
00549                         this->facesLabel->TabIndex = 6;
00550                         this->facesLabel->Text = L"\?";
00551                         // 
00552                         // executiontimeLabel
00553                         // 
00554                         this->executiontimeLabel->AutoSize = true;
00555                         this->executiontimeLabel->Location = System::Drawing::Point(139, 202);
00556                         this->executiontimeLabel->Name = L"executiontimeLabel";
00557                         this->executiontimeLabel->Size = System::Drawing::Size(13, 13);
00558                         this->executiontimeLabel->TabIndex = 5;
00559                         this->executiontimeLabel->Text = L"\?";
00560                         // 
00561                         // cameraLabel
00562                         // 
00563                         this->cameraLabel->AutoSize = true;
00564                         this->cameraLabel->Location = System::Drawing::Point(139, 94);
00565                         this->cameraLabel->Name = L"cameraLabel";
00566                         this->cameraLabel->Size = System::Drawing::Size(13, 13);
00567                         this->cameraLabel->TabIndex = 4;
00568                         this->cameraLabel->Text = L"\?";
00569                         // 
00570                         // label13
00571                         // 
00572                         this->label13->AutoSize = true;
00573                         this->label13->Location = System::Drawing::Point(14, 148);
00574                         this->label13->Name = L"label13";
00575                         this->label13->Size = System::Drawing::Size(84, 13);
00576                         this->label13->TabIndex = 3;
00577                         this->label13->Text = L"größtes Gesicht:";
00578                         // 
00579                         // label12
00580                         // 
00581                         this->label12->AutoSize = true;
00582                         this->label12->Location = System::Drawing::Point(14, 175);
00583                         this->label12->Name = L"label12";
00584                         this->label12->Size = System::Drawing::Size(109, 13);
00585                         this->label12->TabIndex = 2;
00586                         this->label12->Text = L"gefundene Gesichter:";
00587                         // 
00588                         // label11
00589                         // 
00590                         this->label11->AutoSize = true;
00591                         this->label11->Location = System::Drawing::Point(14, 202);
00592                         this->label11->Name = L"label11";
00593                         this->label11->Size = System::Drawing::Size(89, 13);
00594                         this->label11->TabIndex = 1;
00595                         this->label11->Text = L"Berechnungszeit:";
00596                         // 
00597                         // label10
00598                         // 
00599                         this->label10->AutoSize = true;
00600                         this->label10->Location = System::Drawing::Point(14, 94);
00601                         this->label10->Name = L"label10";
00602                         this->label10->Size = System::Drawing::Size(86, 13);
00603                         this->label10->TabIndex = 0;
00604                         this->label10->Text = L"aktuelle Kamera:";
00605                         // 
00606                         // panel1
00607                         // 
00608                         this->panel1->BackColor = System::Drawing::SystemColors::ControlDark;
00609                         this->panel1->BorderStyle = System::Windows::Forms::BorderStyle::Fixed3D;
00610                         this->panel1->Location = System::Drawing::Point(14, 34);
00611                         this->panel1->Name = L"panel1";
00612                         this->panel1->Size = System::Drawing::Size(320, 240);
00613                         this->panel1->TabIndex = 0;
00614                         // 
00615                         // tabPage1
00616                         // 
00617                         this->tabPage1->Controls->Add(this->voiceGroupBox);
00618                         this->tabPage1->Location = System::Drawing::Point(4, 37);
00619                         this->tabPage1->Name = L"tabPage1";
00620                         this->tabPage1->Padding = System::Windows::Forms::Padding(3);
00621                         this->tabPage1->Size = System::Drawing::Size(708, 316);
00622                         this->tabPage1->TabIndex = 0;
00623                         this->tabPage1->Text = L"Sprachausgabe";
00624                         this->tabPage1->UseVisualStyleBackColor = true;
00625                         // 
00626                         // voiceGroupBox
00627                         // 
00628                         this->voiceGroupBox->Controls->Add(this->configVolumeMeter);
00629                         this->voiceGroupBox->Controls->Add(this->voiceInfoGroupBox);
00630                         this->voiceGroupBox->Controls->Add(this->label1);
00631                         this->voiceGroupBox->Controls->Add(this->voicesComboBox);
00632                         this->voiceGroupBox->Controls->Add(this->voiceVolumeLabel);
00633                         this->voiceGroupBox->Controls->Add(this->voiceRateTrackBar);
00634                         this->voiceGroupBox->Controls->Add(this->voiceRateLabel);
00635                         this->voiceGroupBox->Controls->Add(this->voiceTestTextBox);
00636                         this->voiceGroupBox->Controls->Add(this->label3);
00637                         this->voiceGroupBox->Controls->Add(this->voiceTestButton);
00638                         this->voiceGroupBox->Controls->Add(this->voiceVolumeTrackBar);
00639                         this->voiceGroupBox->Controls->Add(this->label2);
00640                         this->voiceGroupBox->Location = System::Drawing::Point(19, 23);
00641                         this->voiceGroupBox->Name = L"voiceGroupBox";
00642                         this->voiceGroupBox->Size = System::Drawing::Size(672, 287);
00643                         this->voiceGroupBox->TabIndex = 14;
00644                         this->voiceGroupBox->TabStop = false;
00645                         this->voiceGroupBox->Text = L"Sprachausgabe";
00646                         // 
00647                         // configVolumeMeter
00648                         // 
00649                         this->configVolumeMeter->ForeColor = System::Drawing::Color::OrangeRed;
00650                         this->configVolumeMeter->Location = System::Drawing::Point(13, 261);
00651                         this->configVolumeMeter->Name = L"configVolumeMeter";
00652                         this->configVolumeMeter->Size = System::Drawing::Size(358, 10);
00653                         this->configVolumeMeter->Style = System::Windows::Forms::ProgressBarStyle::Continuous;
00654                         this->configVolumeMeter->TabIndex = 11;
00655                         // 
00656                         // voiceInfoGroupBox
00657                         // 
00658                         this->voiceInfoGroupBox->Controls->Add(this->voiceLanguageLabel);
00659                         this->voiceInfoGroupBox->Controls->Add(this->label9);
00660                         this->voiceInfoGroupBox->Controls->Add(this->voiceGenderLabel);
00661                         this->voiceInfoGroupBox->Controls->Add(this->voiceAgeLabel);
00662                         this->voiceInfoGroupBox->Controls->Add(this->voiceVendorLabel);
00663                         this->voiceInfoGroupBox->Controls->Add(this->voiceNameLabel);
00664                         this->voiceInfoGroupBox->Controls->Add(this->label8);
00665                         this->voiceInfoGroupBox->Controls->Add(this->label7);
00666                         this->voiceInfoGroupBox->Controls->Add(this->label6);
00667                         this->voiceInfoGroupBox->Controls->Add(this->label5);
00668                         this->voiceInfoGroupBox->Location = System::Drawing::Point(394, 19);
00669                         this->voiceInfoGroupBox->Name = L"voiceInfoGroupBox";
00670                         this->voiceInfoGroupBox->Size = System::Drawing::Size(262, 164);
00671                         this->voiceInfoGroupBox->TabIndex = 10;
00672                         this->voiceInfoGroupBox->TabStop = false;
00673                         this->voiceInfoGroupBox->Text = L"Information";
00674                         // 
00675                         // voiceLanguageLabel
00676                         // 
00677                         this->voiceLanguageLabel->AutoSize = true;
00678                         this->voiceLanguageLabel->Location = System::Drawing::Point(76, 131);
00679                         this->voiceLanguageLabel->Name = L"voiceLanguageLabel";
00680                         this->voiceLanguageLabel->Size = System::Drawing::Size(41, 13);
00681                         this->voiceLanguageLabel->TabIndex = 9;
00682                         this->voiceLanguageLabel->Text = L"label10";
00683                         // 
00684                         // label9
00685                         // 
00686                         this->label9->AutoSize = true;
00687                         this->label9->Location = System::Drawing::Point(6, 131);
00688                         this->label9->Name = L"label9";
00689                         this->label9->Size = System::Drawing::Size(50, 13);
00690                         this->label9->TabIndex = 8;
00691                         this->label9->Text = L"Sprache:";
00692                         // 
00693                         // voiceGenderLabel
00694                         // 
00695                         this->voiceGenderLabel->AutoSize = true;
00696                         this->voiceGenderLabel->Location = System::Drawing::Point(76, 106);
00697                         this->voiceGenderLabel->Name = L"voiceGenderLabel";
00698                         this->voiceGenderLabel->Size = System::Drawing::Size(41, 13);
00699                         this->voiceGenderLabel->TabIndex = 7;
00700                         this->voiceGenderLabel->Text = L"label12";
00701                         // 
00702                         // voiceAgeLabel
00703                         // 
00704                         this->voiceAgeLabel->AutoSize = true;
00705                         this->voiceAgeLabel->Location = System::Drawing::Point(76, 79);
00706                         this->voiceAgeLabel->Name = L"voiceAgeLabel";
00707                         this->voiceAgeLabel->Size = System::Drawing::Size(41, 13);
00708                         this->voiceAgeLabel->TabIndex = 6;
00709                         this->voiceAgeLabel->Text = L"label11";
00710                         // 
00711                         // voiceVendorLabel
00712                         // 
00713                         this->voiceVendorLabel->AutoSize = true;
00714                         this->voiceVendorLabel->Location = System::Drawing::Point(76, 53);
00715                         this->voiceVendorLabel->Name = L"voiceVendorLabel";
00716                         this->voiceVendorLabel->Size = System::Drawing::Size(41, 13);
00717                         this->voiceVendorLabel->TabIndex = 5;
00718                         this->voiceVendorLabel->Text = L"label10";
00719                         // 
00720                         // voiceNameLabel
00721                         // 
00722                         this->voiceNameLabel->AutoSize = true;
00723                         this->voiceNameLabel->Location = System::Drawing::Point(76, 25);
00724                         this->voiceNameLabel->Name = L"voiceNameLabel";
00725                         this->voiceNameLabel->Size = System::Drawing::Size(35, 13);
00726                         this->voiceNameLabel->TabIndex = 4;
00727                         this->voiceNameLabel->Text = L"label9";
00728                         // 
00729                         // label8
00730                         // 
00731                         this->label8->AutoSize = true;
00732                         this->label8->Location = System::Drawing::Point(6, 106);
00733                         this->label8->Name = L"label8";
00734                         this->label8->Size = System::Drawing::Size(64, 13);
00735                         this->label8->TabIndex = 3;
00736                         this->label8->Text = L"Geschlecht:";
00737                         // 
00738                         // label7
00739                         // 
00740                         this->label7->AutoSize = true;
00741                         this->label7->Location = System::Drawing::Point(6, 79);
00742                         this->label7->Name = L"label7";
00743                         this->label7->Size = System::Drawing::Size(31, 13);
00744                         this->label7->TabIndex = 2;
00745                         this->label7->Text = L"Alter:";
00746                         // 
00747                         // label6
00748                         // 
00749                         this->label6->AutoSize = true;
00750                         this->label6->Location = System::Drawing::Point(6, 53);
00751                         this->label6->Name = L"label6";
00752                         this->label6->Size = System::Drawing::Size(54, 13);
00753                         this->label6->TabIndex = 1;
00754                         this->label6->Text = L"Hersteller:";
00755                         // 
00756                         // label5
00757                         // 
00758                         this->label5->AutoSize = true;
00759                         this->label5->Location = System::Drawing::Point(6, 25);
00760                         this->label5->Name = L"label5";
00761                         this->label5->Size = System::Drawing::Size(38, 13);
00762                         this->label5->TabIndex = 0;
00763                         this->label5->Text = L"Name:";
00764                         // 
00765                         // label1
00766                         // 
00767                         this->label1->AutoSize = true;
00768                         this->label1->Location = System::Drawing::Point(10, 34);
00769                         this->label1->Name = L"label1";
00770                         this->label1->Size = System::Drawing::Size(44, 13);
00771                         this->label1->TabIndex = 4;
00772                         this->label1->Text = L"Stimme:";
00773                         // 
00774                         // voicesComboBox
00775                         // 
00776                         this->voicesComboBox->DropDownStyle = System::Windows::Forms::ComboBoxStyle::DropDownList;
00777                         this->voicesComboBox->FormattingEnabled = true;
00778                         this->voicesComboBox->Location = System::Drawing::Point(115, 33);
00779                         this->voicesComboBox->Name = L"voicesComboBox";
00780                         this->voicesComboBox->Size = System::Drawing::Size(203, 21);
00781                         this->voicesComboBox->TabIndex = 0;
00782                         this->voicesComboBox->SelectedIndexChanged += gcnew System::EventHandler(this, &Form1::voicesComboBox_SelectedIndexChanged);
00783                         // 
00784                         // voiceVolumeLabel
00785                         // 
00786                         this->voiceVolumeLabel->AutoSize = true;
00787                         this->voiceVolumeLabel->Location = System::Drawing::Point(330, 130);
00788                         this->voiceVolumeLabel->Name = L"voiceVolumeLabel";
00789                         this->voiceVolumeLabel->Size = System::Drawing::Size(41, 13);
00790                         this->voiceVolumeLabel->TabIndex = 9;
00791                         this->voiceVolumeLabel->Text = L"volume";
00792                         // 
00793                         // voiceRateTrackBar
00794                         // 
00795                         this->voiceRateTrackBar->Location = System::Drawing::Point(115, 82);
00796                         this->voiceRateTrackBar->Name = L"voiceRateTrackBar";
00797                         this->voiceRateTrackBar->Size = System::Drawing::Size(202, 42);
00798                         this->voiceRateTrackBar->TabIndex = 1;
00799                         this->voiceRateTrackBar->Value = 10;
00800                         this->voiceRateTrackBar->Scroll += gcnew System::EventHandler(this, &Form1::voiceRateTrackBar_Scroll);
00801                         // 
00802                         // voiceRateLabel
00803                         // 
00804                         this->voiceRateLabel->AutoSize = true;
00805                         this->voiceRateLabel->Location = System::Drawing::Point(330, 82);
00806                         this->voiceRateLabel->Name = L"voiceRateLabel";
00807                         this->voiceRateLabel->Size = System::Drawing::Size(25, 13);
00808                         this->voiceRateLabel->TabIndex = 8;
00809                         this->voiceRateLabel->Text = L"rate";
00810                         // 
00811                         // voiceTestTextBox
00812                         // 
00813                         this->voiceTestTextBox->Location = System::Drawing::Point(13, 223);
00814                         this->voiceTestTextBox->Name = L"voiceTestTextBox";
00815                         this->voiceTestTextBox->Size = System::Drawing::Size(358, 20);
00816                         this->voiceTestTextBox->TabIndex = 2;
00817                         // 
00818                         // label3
00819                         // 
00820                         this->label3->AutoSize = true;
00821                         this->label3->Location = System::Drawing::Point(10, 130);
00822                         this->label3->Name = L"label3";
00823                         this->label3->Size = System::Drawing::Size(60, 13);
00824                         this->label3->TabIndex = 7;
00825                         this->label3->Text = L"Lautstärke:";
00826                         // 
00827                         // voiceTestButton
00828                         // 
00829                         this->voiceTestButton->Location = System::Drawing::Point(394, 223);
00830                         this->voiceTestButton->Name = L"voiceTestButton";
00831                         this->voiceTestButton->Size = System::Drawing::Size(81, 26);
00832                         this->voiceTestButton->TabIndex = 3;
00833                         this->voiceTestButton->Text = L"Test";
00834                         this->voiceTestButton->UseVisualStyleBackColor = true;
00835                         this->voiceTestButton->Click += gcnew System::EventHandler(this, &Form1::voiceTestButton_Click);
00836                         // 
00837                         // voiceVolumeTrackBar
00838                         // 
00839                         this->voiceVolumeTrackBar->Location = System::Drawing::Point(115, 130);
00840                         this->voiceVolumeTrackBar->Maximum = 100;
00841                         this->voiceVolumeTrackBar->Name = L"voiceVolumeTrackBar";
00842                         this->voiceVolumeTrackBar->Size = System::Drawing::Size(203, 42);
00843                         this->voiceVolumeTrackBar->TabIndex = 6;
00844                         this->voiceVolumeTrackBar->TickFrequency = 10;
00845                         this->voiceVolumeTrackBar->Scroll += gcnew System::EventHandler(this, &Form1::voiceVolumeTrackBar_Scroll);
00846                         // 
00847                         // label2
00848                         // 
00849                         this->label2->AutoSize = true;
00850                         this->label2->Location = System::Drawing::Point(10, 82);
00851                         this->label2->Name = L"label2";
00852                         this->label2->Size = System::Drawing::Size(88, 13);
00853                         this->label2->TabIndex = 5;
00854                         this->label2->Text = L"Geschwindigkeit:";
00855                         // 
00856                         // tabPage2
00857                         // 
00858                         this->tabPage2->Controls->Add(this->leftBar);
00859                         this->tabPage2->Controls->Add(this->rightBar);
00860                         this->tabPage2->Controls->Add(this->openButton);
00861                         this->tabPage2->Controls->Add(this->storyTextBox);
00862                         this->tabPage2->Controls->Add(this->stopButton);
00863                         this->tabPage2->Controls->Add(this->pauseButton);
00864                         this->tabPage2->Controls->Add(this->playButton);
00865                         this->tabPage2->Location = System::Drawing::Point(4, 37);
00866                         this->tabPage2->Name = L"tabPage2";
00867                         this->tabPage2->Padding = System::Windows::Forms::Padding(3);
00868                         this->tabPage2->Size = System::Drawing::Size(708, 316);
00869                         this->tabPage2->TabIndex = 1;
00870                         this->tabPage2->Text = L"Geschichte";
00871                         this->tabPage2->UseVisualStyleBackColor = true;
00872                         // 
00873                         // leftBar
00874                         // 
00875                         this->leftBar->BackColor = System::Drawing::SystemColors::Control;
00876                         this->leftBar->ForeColor = System::Drawing::Color::RoyalBlue;
00877                         this->leftBar->Location = System::Drawing::Point(472, 294);
00878                         this->leftBar->Name = L"leftBar";
00879                         this->leftBar->RightToLeft = System::Windows::Forms::RightToLeft::Yes;
00880                         this->leftBar->RightToLeftLayout = true;
00881                         this->leftBar->Size = System::Drawing::Size(115, 10);
00882                         this->leftBar->Style = System::Windows::Forms::ProgressBarStyle::Continuous;
00883                         this->leftBar->TabIndex = 13;
00884                         // 
00885                         // rightBar
00886                         // 
00887                         this->rightBar->ForeColor = System::Drawing::Color::RoyalBlue;
00888                         this->rightBar->Location = System::Drawing::Point(586, 294);
00889                         this->rightBar->Name = L"rightBar";
00890                         this->rightBar->Size = System::Drawing::Size(115, 10);
00891                         this->rightBar->Style = System::Windows::Forms::ProgressBarStyle::Continuous;
00892                         this->rightBar->TabIndex = 12;
00893                         // 
00894                         // openButton
00895                         // 
00896                         this->openButton->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"openButton.Image")));
00897                         this->openButton->ImageAlign = System::Drawing::ContentAlignment::BottomLeft;
00898                         this->openButton->Location = System::Drawing::Point(6, 287);
00899                         this->openButton->Name = L"openButton";
00900                         this->openButton->Size = System::Drawing::Size(77, 23);
00901                         this->openButton->TabIndex = 7;
00902                         this->openButton->Text = L"Öffnen";
00903                         this->openButton->TextAlign = System::Drawing::ContentAlignment::MiddleRight;
00904                         this->openButton->UseVisualStyleBackColor = true;
00905                         this->openButton->Click += gcnew System::EventHandler(this, &Form1::openButton_Click);
00906                         // 
00907                         // storyTextBox
00908                         // 
00909                         this->storyTextBox->HideSelection = false;
00910                         this->storyTextBox->Location = System::Drawing::Point(6, 11);
00911                         this->storyTextBox->Name = L"storyTextBox";
00912                         this->storyTextBox->ReadOnly = true;
00913                         this->storyTextBox->Size = System::Drawing::Size(696, 270);
00914                         this->storyTextBox->TabIndex = 6;
00915                         this->storyTextBox->Text = L"";
00916                         this->storyTextBox->WordWrap = false;
00917                         // 
00918                         // stopButton
00919                         // 
00920                         this->stopButton->ImageIndex = 2;
00921                         this->stopButton->ImageList = this->imageList1;
00922                         this->stopButton->Location = System::Drawing::Point(280, 287);
00923                         this->stopButton->Name = L"stopButton";
00924                         this->stopButton->Size = System::Drawing::Size(75, 23);
00925                         this->stopButton->TabIndex = 4;
00926                         this->stopButton->TextAlign = System::Drawing::ContentAlignment::MiddleRight;
00927                         this->stopButton->UseVisualStyleBackColor = true;
00928                         this->stopButton->Click += gcnew System::EventHandler(this, &Form1::stopButton_Click);
00929                         // 
00930                         // imageList1
00931                         // 
00932                         this->imageList1->ImageStream = (cli::safe_cast<System::Windows::Forms::ImageListStreamer^  >(resources->GetObject(L"imageList1.ImageStream")));
00933                         this->imageList1->TransparentColor = System::Drawing::Color::Transparent;
00934                         this->imageList1->Images->SetKeyName(0, L"play.png");
00935                         this->imageList1->Images->SetKeyName(1, L"pause.png");
00936                         this->imageList1->Images->SetKeyName(2, L"stop.png");
00937                         // 
00938                         // pauseButton
00939                         // 
00940                         this->pauseButton->ImageIndex = 1;
00941                         this->pauseButton->ImageList = this->imageList1;
00942                         this->pauseButton->Location = System::Drawing::Point(199, 287);
00943                         this->pauseButton->Name = L"pauseButton";
00944                         this->pauseButton->Size = System::Drawing::Size(75, 23);
00945                         this->pauseButton->TabIndex = 2;
00946                         this->pauseButton->TextAlign = System::Drawing::ContentAlignment::MiddleRight;
00947                         this->pauseButton->UseVisualStyleBackColor = true;
00948                         this->pauseButton->Click += gcnew System::EventHandler(this, &Form1::pauseButton_Click);
00949                         // 
00950                         // playButton
00951                         // 
00952                         this->playButton->ImageIndex = 0;
00953                         this->playButton->ImageList = this->imageList1;
00954                         this->playButton->Location = System::Drawing::Point(118, 287);
00955                         this->playButton->Name = L"playButton";
00956                         this->playButton->Size = System::Drawing::Size(75, 23);
00957                         this->playButton->TabIndex = 1;
00958                         this->playButton->TextAlign = System::Drawing::ContentAlignment::MiddleRight;
00959                         this->playButton->UseVisualStyleBackColor = true;
00960                         this->playButton->Click += gcnew System::EventHandler(this, &Form1::button2_Click);
00961                         // 
00962                         // tabControl
00963                         // 
00964                         this->tabControl->Controls->Add(this->tabPage2);
00965                         this->tabControl->Controls->Add(this->tabPage1);
00966                         this->tabControl->Controls->Add(this->tabPage3);
00967                         this->tabControl->Controls->Add(this->tabPage4);
00968                         this->tabControl->ImageList = this->imageList2;
00969                         this->tabControl->Location = System::Drawing::Point(12, 27);
00970                         this->tabControl->Name = L"tabControl";
00971                         this->tabControl->SelectedIndex = 0;
00972                         this->tabControl->Size = System::Drawing::Size(716, 357);
00973                         this->tabControl->TabIndex = 1;
00974                         // 
00975                         // imageList2
00976                         // 
00977                         this->imageList2->ImageStream = (cli::safe_cast<System::Windows::Forms::ImageListStreamer^  >(resources->GetObject(L"imageList2.ImageStream")));
00978                         this->imageList2->TransparentColor = System::Drawing::Color::Transparent;
00979                         this->imageList2->Images->SetKeyName(0, L"b_story.png");
00980                         this->imageList2->Images->SetKeyName(1, L"b_voice.png");
00981                         this->imageList2->Images->SetKeyName(2, L"b_kamera.png");
00982                         this->imageList2->Images->SetKeyName(3, L"b_yano_s.png");
00983                         this->imageList2->Images->SetKeyName(4, L"story.png");
00984                         this->imageList2->Images->SetKeyName(5, L"voice.png");
00985                         this->imageList2->Images->SetKeyName(6, L"kamera.png");
00986                         this->imageList2->Images->SetKeyName(7, L"robot.png");
00987                         // 
00988                         // Form1
00989                         // 
00990                         this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
00991                         this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
00992                         this->ClientSize = System::Drawing::Size(740, 396);
00993                         this->Controls->Add(this->tabControl);
00994                         this->Controls->Add(this->menuStrip1);
00995                         this->MainMenuStrip = this->menuStrip1;
00996                         this->Name = L"Form1";
00997                         this->StartPosition = System::Windows::Forms::FormStartPosition::CenterScreen;
00998                         this->Text = L"Super-Yano";
00999                         this->FormClosing += gcnew System::Windows::Forms::FormClosingEventHandler(this, &Form1::Form1_FormClosing);
01000                         this->Load += gcnew System::EventHandler(this, &Form1::Form1_Load);
01001                         this->menuStrip1->ResumeLayout(false);
01002                         this->menuStrip1->PerformLayout();
01003                         this->tabPage4->ResumeLayout(false);
01004                         this->groupBox1->ResumeLayout(false);
01005                         this->groupBox1->PerformLayout();
01006                         this->comPortGroupBox->ResumeLayout(false);
01007                         this->comPortGroupBox->PerformLayout();
01008                         this->tabPage3->ResumeLayout(false);
01009                         this->panel2->ResumeLayout(false);
01010                         this->panel2->PerformLayout();
01011                         this->tabPage1->ResumeLayout(false);
01012                         this->voiceGroupBox->ResumeLayout(false);
01013                         this->voiceGroupBox->PerformLayout();
01014                         this->voiceInfoGroupBox->ResumeLayout(false);
01015                         this->voiceInfoGroupBox->PerformLayout();
01016                         (cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->voiceRateTrackBar))->EndInit();
01017                         (cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->voiceVolumeTrackBar))->EndInit();
01018                         this->tabPage2->ResumeLayout(false);
01019                         this->tabControl->ResumeLayout(false);
01020                         this->ResumeLayout(false);
01021                         this->PerformLayout();
01022 
01023                 }
01024 #pragma endregion
01025 
01029         private: System::Void Form1_Load(System::Object^  sender, System::EventArgs^  e) 
01030                          {
01031 
01032                                 this->voiceRateTrackBar->Minimum = -10;
01033                                 this->voiceRateTrackBar->Maximum = 10;
01034                                 this->voiceRateTrackBar->Value = 0;
01035                                  
01036                                 System::String^ portName = "";
01037                                 System::String^ lastVoiceName = "";
01038                                 int voiceRate = 0;
01039                                 int voiceVolume = 100;
01040 
01041                                 XmlTextReader^ xmlTextReader = gcnew XmlTextReader("super-yano.xml");
01042 
01043                                 while (xmlTextReader->Read())
01044                                 {
01045                                         if (xmlTextReader->NodeType == XmlNodeType::Element)
01046                                         {
01047                                                 while (xmlTextReader->NodeType != XmlNodeType::EndElement)
01048                                                 {
01049                                                         if (xmlTextReader->Name->CompareTo("last_voice_name") == 0)
01050                                                         {
01051                                                                 xmlTextReader->Read();
01052                                                                 lastVoiceName = xmlTextReader->Value;
01053                                                         }
01054                                                         else if (xmlTextReader->Name->CompareTo("voice_rate") == 0)
01055                                                         {
01056                                                                 xmlTextReader->Read();
01057                                                                 try
01058                                                                 {
01059                                                                         voiceRate = Convert::ToInt32(xmlTextReader->Value);
01060                                                                 }
01061                                                                 catch (Exception^ e) 
01062                                                                 { 
01063                                                                         voiceRate = 0; 
01064                                                                         MessageBox::Show(e->Message);
01065                                                                 }
01066                                                         }
01067                                                         else if (xmlTextReader->Name->CompareTo("voice_volume") == 0)
01068                                                         {
01069                                                                 xmlTextReader->Read();
01070                                                                 try
01071                                                                 {
01072                                                                         voiceVolume = Convert::ToInt32(xmlTextReader->Value);
01073                                                                 }
01074                                                                 catch (Exception^ e) 
01075                                                                 { 
01076                                                                         voiceVolume = 100; 
01077                                                                         MessageBox::Show(e->Message);
01078                                                                 }
01079                                                         }
01080                                                         else if (xmlTextReader->Name->CompareTo("com_port") == 0)
01081                                                         {
01082                                                                 xmlTextReader->Read();
01083                                                                 portName = xmlTextReader->Value;
01084                                                         }
01085                                                         xmlTextReader->Read();
01086                                                 }
01087                                         }
01088                                 }
01089                                 xmlTextReader->Close();
01090 
01091 
01092                                 RobotControl::construct(portName);
01093 
01094 //                              Windows::Forms::MessageBox::Show( RobotControl::getComPortName(), "Comport-Info", Windows::Forms::MessageBoxButtons::OK, Windows::Forms::MessageBoxIcon::Information);
01095 
01096                                 /*
01097                                 array<System::String^, 1>^ comPortNames = RobotControl::getComPortNames();
01098                                 System::Array::Sort(comPortNames);
01099                                 int com_index = 0;
01100                                 for(int i = 0; i < comPortNames->GetLength(0); i++)
01101                                 {
01102                                         System::String^ c_name = (String^) comPortNames->GetValue(i);
01103                                         this->comportsComboBox->Items->Add(c_name);
01104                                         if (c_name->CompareTo(RobotControl::getComPortName()) == 0) com_index = i;
01105                                 }
01106                                 this->comportsComboBox->SelectedIndex = com_index;
01107                                 */
01108 
01109                                 this->comPortNameLabel->Text = RobotControl::getComPortName();
01110 
01111                                 this->voice = gcnew SpVoice();
01112 
01113                                 ISpeechObjectTokens^ isot = voice->GetVoices("", "");
01114 
01115                                 int lastVoiceIndex = -1;
01116 
01117                                 //Voiceobjekt auf zuletzt verwendete Stimme einstellen
01118                                 for(int i=0; i<isot->Count; i++)
01119                                 {
01120                                         ISpeechObjectToken^ token = isot->Item(i);
01121                                         this->voicesComboBox->Items->Add(token->GetDescription(0));
01122                                         if (token->GetDescription(0)->CompareTo(lastVoiceName) == 0) lastVoiceIndex = i;
01123                                 }
01124 
01125                                 if (lastVoiceIndex > -1)
01126                                 {
01127                                         this->voicesComboBox->SelectedIndex = lastVoiceIndex;
01128                                         voice->Voice = voice->GetVoices("","")->Item(lastVoiceIndex);
01129                                 }
01130                                 else
01131                                 {
01132                                         this->voicesComboBox->SelectedIndex = 0; 
01133                                 }
01134 
01135                                 
01136                                 this->voiceTestTextBox->Text = "Sie haben " + this->voicesComboBox->Text + " als Stimme gewählt.";
01137                                 
01138                                 this->voiceRateTrackBar->Value = voiceRate;
01139                                 this->voice->Rate = this->voiceRateTrackBar->Value;
01140                                 this->voiceRateLabel->Text = this->voiceRateTrackBar->Value.ToString();
01141 
01142                                 this->voiceVolumeTrackBar->Value = voiceVolume;
01143                                 this->voice->Volume = this->voiceVolumeTrackBar->Value;
01144                                 this->voiceVolumeLabel->Text = this->voiceVolumeTrackBar->Value.ToString() + "%";                               
01145 
01146                                 //VoiceEvents mit Funktionen verknüpen
01147                                 //gesprochenes Wort
01148                                 SpeechLib::_ISpeechVoiceEvents_WordEventHandler^ spWordEventHandler = gcnew SpeechLib::_ISpeechVoiceEvents_WordEventHandler(this, &Form1::speechWordEvent);
01149                                 this->voice->Word += spWordEventHandler;
01150                                 
01151                                 //Viseme (Mundform)
01152                                 SpeechLib::_ISpeechVoiceEvents_VisemeEventHandler^ spVisemeEventHandler = gcnew SpeechLib::_ISpeechVoiceEvents_VisemeEventHandler(this, &Form1::speechVisemeEvent);
01153                                 this->voice->Viseme += spVisemeEventHandler;
01154                                 this->voice->Viseme += RobotControl::getVisemeEventHandler();
01155 
01156                                 //privates EngineEvent (wird nicht benötigt)
01157                                 SpeechLib::_ISpeechVoiceEvents_EnginePrivateEventHandler^ spEnginePrivateEventHandler = gcnew SpeechLib::_ISpeechVoiceEvents_EnginePrivateEventHandler(this, &Form1::speechEnginePrivateEvent);
01158                                 this->voice->EnginePrivate += spEnginePrivateEventHandler;
01159 
01160                                 //privates SentenceEvent (wird nicht benötigt)
01161                                 SpeechLib::_ISpeechVoiceEvents_SentenceEventHandler^ spSentenceEventHandler = gcnew SpeechLib::_ISpeechVoiceEvents_SentenceEventHandler(this, &Form1::speechSentenceEvent);
01162                                 this->voice->Sentence += spSentenceEventHandler;
01163 
01164                                 //BookmarkEvent
01165                                 SpeechLib::_ISpeechVoiceEvents_BookmarkEventHandler^ spBookmarkEventHandler = gcnew SpeechLib::_ISpeechVoiceEvents_BookmarkEventHandler(this, &Form1::speechBookmarkEvent);
01166                                 this->voice->Bookmark += spBookmarkEventHandler;
01167 
01168                                 //Änderung der Lautstäre beim Sprechen
01169                                 SpeechLib::_ISpeechVoiceEvents_AudioLevelEventHandler^ spAudioLevelEventHandler = gcnew SpeechLib::_ISpeechVoiceEvents_AudioLevelEventHandler(this, &Form1::speechAudioEvent);
01170                                 this->voice->AudioLevel += spAudioLevelEventHandler;
01171 
01172                                 //Stream beendet. Fertig mit Sprechen.
01173                                 SpeechLib::_ISpeechVoiceEvents_EndStreamEventHandler^ spEndStreamEventHandler = gcnew SpeechLib::_ISpeechVoiceEvents_EndStreamEventHandler(this, &Form1::speechEndStreamEvent);
01174                                 this->voice->EndStream += spEndStreamEventHandler;
01175 
01176                                 //Alle Events aktivieren
01177                                 this->voice->EventInterests::set(SpeechLib::SpeechVoiceEvents::SVEAllEvents);
01178 
01179                                 headMovementCheckBox_CheckedChanged(this, System::EventArgs::Empty);
01180 
01181                             RobotControl::initiateRobot();  //Roboterservos in Startposition
01182 
01183                          }
01184 
01190         private: void speechWordEvent(int streamNumber, System::Object^ streamPosition, int characterPosition, int lenght)
01191                         {
01192                                 this->storyTextBox->Focus();
01193                                 this->storyTextBox->Select(characterPosition, lenght);
01194                                 System::String^ currentWord = this->storyTextBox->Text->Substring(characterPosition, lenght);  //gesprochenes Wort aus TextBox auslesen
01195 
01196                                 if (currentWord->StartsWith("\\"))
01197                                 {
01198                                         //Wörter die mit "\wav" beginnen als Wavesound-Befehl interpretieren
01199                                         if (currentWord->StartsWith("\\wav"))
01200                                         {
01201                                                 //Filename der Wavedatei ermitteln
01202                                                 System::String^ filename = "sounds\\" + currentWord->Substring(4)+".wav";
01203                                                 //Ein Mediaplayerobjekt erzeugen und Sound abspielen
01204                                                 WMPLib::WindowsMediaPlayer^ mplayer  = gcnew WMPLib::WindowsMediaPlayer();
01205                                                 mplayer->URL = filename;
01206                                                 mplayer->controls->play();
01207                                         }
01208                                 }
01209                                 else if (currentWord->StartsWith("<"))
01210                                 {
01211                                         //XML-Tags nicht hervorheben
01212                                 }
01213                                 else //normaler Text
01214                                 {                                       
01215                                         String^ endChar = "";
01216                                         try
01217                                         {
01218                                                 endChar = this->storyTextBox->Text->Substring(characterPosition + lenght, 1);
01219                                         }
01220                                         catch (Exception^)
01221                                         {
01222                                                 //nope!
01223                                         }
01224 
01225                                         //Text zur Ausgabe auf dem Display an µC senden und
01226                                         //Ausrufezeichen durch 0xFF ersetzen - sonst wertet das Mikrocontrollerprog dies als Anfang eines Befehls
01227                                         if ((endChar->CompareTo(".")==0) || (endChar->CompareTo(":")==0) || (endChar->CompareTo(";")==0) || (endChar->CompareTo(",")==0) || (endChar->CompareTo("?")==0))
01228                                                 RobotControl::showDisplay("!>" + currentWord->Replace('!', 0xFF) + endChar +" ");  
01229                                         else
01230                                                 RobotControl::showDisplay("!>" + currentWord->Replace('!', 0xFF) + " ");
01231                                 }
01232                         }
01233 
01239         private: void speechAudioEvent(int streamNumber, System::Object^ streamPosition, int audioLevel)
01240                         {
01241                                 if ((audioLevel >= 0) && (audioLevel <= 100))
01242                                 {
01243                                         this->configVolumeMeter->Value = audioLevel;                            
01244                                         this->leftBar->Value = audioLevel;
01245                                         this->rightBar->Value = audioLevel;
01246                                 }
01247                         }
01248 
01249 
01253         private: void speechSentenceEvent(int streamNumber, System::Object^ streamPosition, int charPosition, int lenght)
01254                         {
01255                                 /*
01256                                 this->cs++;
01257                                 VariantWrapper^ vw = gcnew VariantWrapper(streamPosition);
01258                                 this->Text = "Sätze: "+cs + "    Pos: "+vw->WrappedObject->ToString()+" CharPos: "+charPosition+" Länge: "+lenght;
01259                                 this->Text += " >"+this->storyTextBox->Text->Substring(charPosition, lenght)+"<";
01260                                 */
01261                         }
01262 
01268         private: void speechEndStreamEvent(int streamNumber, System::Object^ streamPosition)
01269                         {
01270                                 this->stopButton_Click(this, System::EventArgs::Empty);
01271                         }
01272 
01273                          
01279         private: void speechBookmarkEvent(int streamNumber, System::Object^ streamPosition, System::String^ bookmark, int bookmarkId)
01280                         {
01281                                 //this->Text= bookmark;
01282         
01283                                 array<System::String^, 1>^ splits;
01284                                 Choice^ choice;
01285 
01286                                 splits = gcnew array<System::String^, 1>{"","","",""};
01287                                 splits = bookmark->Split('#');
01288 
01289                                 //if ( bookmark->CompareTo("END") == true )
01290                                 if ( ((System::String^) splits->GetValue(0)) == "END" )
01291                                 {
01292                                                 this->stopButton_Click(this, System::EventArgs::Empty);
01293                                 }
01294                                 else if ( ((System::String^) splits->GetValue(1)) == "" )
01295                                 {
01296                                         //ist normale Bookmark
01297                                 }
01298                                 else
01299                                 {
01300                                         //ist eine Frage
01301                                         
01302                                         if (this->voice->Status->RunningState == SpeechLib::SpeechRunState::SRSEIsSpeaking)
01303                                         {
01304                                                 this->voice->Pause();
01305                                         }
01306 
01307                                         String^ question = (System::String^) splits->GetValue(0);
01308                                         String^ answer1 = (System::String^) splits->GetValue(1);
01309                                         String^ answer2 = (System::String^) splits->GetValue(2);
01310                                         String^ skip = (System::String^) splits->GetValue(3);
01311 
01312                                         question = question->Replace("~r~n", "\r\n");
01313                                         question = question->Replace('_', ' ');
01314                                         
01315                                         answer1 = answer1->Replace('_', ' ');
01316                                         answer2 = answer2->Replace('_', ' ');
01317                                         
01318                                         choice = gcnew Choice(question ,answer1,answer2);
01319                                         if (choice->ShowDialog() == Windows::Forms::DialogResult::Yes)
01320                                         {
01321                                                 //nichts machen, weiterlesen an aktueller Position
01322                                                 if (this->voice->Status->RunningState != SpeechLib::SpeechRunState::SRSEDone)
01323                                                 {
01324                                                         this->voice->Resume();
01325                                                 }
01326 
01327                                         }
01328                                         else
01329                                         {
01330                                                 //zum Bookmark vorspulen
01331                                                 if (this->voice->Status->RunningState != SpeechLib::SpeechRunState::SRSEDone)
01332                                                 {
01333                                                         this->voice->Resume();
01334                                                 }
01335                                                 voice->Skip("Sentence", Int32::Parse(skip) );
01336                                         }
01337 
01338                                 }
01339                                 
01340                         }
01341 
01342 
01348         private: void speechEnginePrivateEvent(int streamNumber, int streamPosition, System::Object^ engineData)
01349                         {
01350                                 //this->Text = streamPosition.ToString();
01351                         }
01352 
01353 
01359         private: void speechVisemeEvent(int streamNumber, System::Object^ streamPosition, int duration, SpeechLib::SpeechVisemeType nextVisemeID, SpeechLib::SpeechVisemeFeature feature, SpeechLib::SpeechVisemeType currentVisemeId)
01360                         {
01361                                 
01362                         }
01363 
01369         private: System::Void voiceTestButton_Click(System::Object^  sender, System::EventArgs^  e) 
01370                          {
01371                                  this->voice->Speak(this->voiceTestTextBox->Text, SpeechLib::SpeechVoiceSpeakFlags::SVSFlagsAsync);
01372                          }
01373         
01374 
01380         private: System::Void voicesComboBox_SelectedIndexChanged(System::Object^  sender, System::EventArgs^  e) 
01381                          {
01382                                  int index = this->voicesComboBox->SelectedIndex;
01383                                  this->voiceTestTextBox->Text = "Sie haben " + this->voicesComboBox->Text + " als Stimme gewählt.";
01384                                  voice->Voice =  voice->GetVoices("","")->Item(index);
01385 
01386                                  try
01387                                  {
01388                                          this->voiceNameLabel->Text = voice->Voice->GetAttribute("Name");
01389                                  }
01390                                  catch (Exception^)
01391                                  {
01392                                         this->voiceNameLabel->Text = "?";
01393                                  }
01394 
01395                                  try
01396                                  {
01397                                         this->voiceVendorLabel->Text = voice->Voice->GetAttribute("Vendor");
01398                                  }
01399                                  catch (Exception^)
01400                                  {
01401                                         this->voiceVendorLabel->Text = "?";
01402                                  }
01403 
01404                                  try
01405                                  {
01406                                         this->voiceAgeLabel->Text = voice->Voice->GetAttribute("Age");
01407                                  }
01408                                  catch (Exception^)
01409                                  {
01410                                         this->voiceAgeLabel->Text = "?";
01411                                  }
01412 
01413                                  try
01414                                  {
01415                                         this->voiceGenderLabel->Text = voice->Voice->GetAttribute("Gender");
01416                                  }
01417                                  catch (Exception^)
01418                                  {
01419                                         this->voiceGenderLabel->Text = "?";
01420                                  }
01421 
01422                                  try
01423                                  {
01424                                          this->voiceLanguageLabel->Text = voice->Voice->GetAttribute("Language");
01425                                  }
01426                                  catch (Exception^)
01427                                  {
01428                                         this->voiceLanguageLabel->Text = "?";
01429                                  }
01430                          }
01431 
01435         private: System::Void voiceRateTrackBar_Scroll(System::Object^  sender, System::EventArgs^  e) 
01436                          {
01437                                  this->voice->Rate = this->voiceRateTrackBar->Value;
01438                                  this->voiceRateLabel->Text = this->voiceRateTrackBar->Value.ToString();
01439                          }
01440 
01444         private: System::Void voiceVolumeTrackBar_Scroll(System::Object^  sender, System::EventArgs^  e) 
01445                          {
01446                                  this->voice->Volume = this->voiceVolumeTrackBar->Value;
01447                                  this->voiceVolumeLabel->Text = this->voiceVolumeTrackBar->Value.ToString() + "%";
01448                          }
01449 
01455         private: System::Void Form1_FormClosing(System::Object^  sender, System::Windows::Forms::FormClosingEventArgs^  e) 
01456                         {
01457                                 
01458                                 RobotControl::initiateRobot();
01459                                 
01460                                 this->visualTimer->Enabled = false;
01461                                 if(facedetectThreadRunningState != STOPPED)
01462                                 {
01463                                         facedetectThreadRunningState = STOPPED;
01464                                         this->facedetectThread->Join();
01465                                 }
01466                                 closeVideo();
01467         
01468                                 XmlTextWriter^ writer = gcnew XmlTextWriter("super-yano.xml", System::Text::Encoding::UTF8);
01469 
01470                                 writer->WriteStartDocument(true);
01471                                 
01472                                         writer->WriteStartElement("super-yano");
01473                                                 
01474                                                 writer->WriteStartElement("voice-settings");
01475                                                         writer->WriteElementString("last_voice_name", this->voicesComboBox->Text);
01476                                                         writer->WriteElementString("voice_rate", this->voiceRateTrackBar->Value.ToString());
01477                                                         writer->WriteElementString("voice_volume", this->voiceVolumeTrackBar->Value.ToString());
01478                                                 writer->WriteEndElement();
01479 
01480                                                 writer->WriteStartElement("servo-settings");
01481                                                         try
01482                                                         {
01483                                                                 if (RobotControl::getComPortName()->CompareTo("") != 0) writer->WriteElementString("com_port", RobotControl::getComPortName() );
01484                                                                 else writer->WriteElementString("com_port", "COM1" );
01485                                                         }
01486                                                         catch (Exception^)
01487                                                         {
01488                                                                 writer->WriteElementString("com_port", "COM1" );
01489                                                         }
01490                                                         
01491                                                         for(int i=0; i<16; i++)
01492                                                         {
01493                                                                 if (RobotControl::getServoDescription(i)->CompareTo("") != 0)
01494                                                                 {
01495                                                                         writer->WriteStartElement(RobotControl::getServoDescription(i));
01496                                                                         writer->WriteAttributeString("servo_nr", i.ToString());
01497                                                                         writer->WriteAttributeString("start_value", RobotControl::getServoStartValue(i).ToString());
01498                                                                         writer->WriteAttributeString("min_value", RobotControl::getServoMinValue(i).ToString());
01499                                                                         writer->WriteAttributeString("max_value", RobotControl::getServoMaxValue(i).ToString());
01500                                                                         writer->WriteEndElement();
01501                                                                 }
01502                                                         }
01503                                                 writer->WriteEndElement();
01504 
01505 
01506                                         writer->WriteEndElement();
01507 
01508                                 writer->WriteEndDocument();
01509 
01510                                 writer->Flush();
01511                                 writer->Close();
01512                                 RobotControl::setServosEnable(false);
01513                                 RobotControl::destroy();
01514 
01515                         }
01516 
01522         private: System::Void button2_Click(System::Object^  sender, System::EventArgs^  e) 
01523                         {
01524                                 if (this->voice->Status->RunningState != SpeechLib::SpeechRunState::SRSEIsSpeaking)
01525                                 {
01526                                         this->voice->Speak(this->storyTextBox->Text, (SpeechVoiceSpeakFlags::SVSFlagsAsync + SpeechVoiceSpeakFlags::SVSFIsXML + SpeechVoiceSpeakFlags::SVSFPersistXML ) );                              
01527                                         this->cs = 0;
01528                                 }       
01529 //                              this->playButton->Enabled = false;
01530 //                              this->pauseButton->Enabled = true;
01531 //                              this->stopButton->Enabled = true;
01532                         }
01533 
01539         private: System::Void pauseButton_Click(System::Object^  sender, System::EventArgs^  e) 
01540                         {
01541                                 if (this->voice->Status->RunningState == SpeechLib::SpeechRunState::SRSEIsSpeaking)
01542                                 {
01543                                         this->voice->Pause();
01544                                 }
01545                                 else this->voice->Resume();
01546 
01547                         }
01548 
01554         private: System::Void stopButton_Click(System::Object^  sender, System::EventArgs^  e) 
01555                         {
01556                                 while (this->voice->Status->RunningState != SpeechLib::SpeechRunState::SRSEDone)
01557                                 {
01558                                         try
01559                                         {       
01560                                                 if (this->voice->Status->RunningState != SpeechLib::SpeechRunState::SRSEIsSpeaking)
01561                                                 {
01562                                                         this->voice->Resume();
01563                                                 }
01564                                                 this->voice->Skip("Sentence", Int32::MaxValue);
01565                                                 RobotControl::setMouthSilentViseme();  //Mund in Ruhestellung bringen
01566                                         }
01567                                         catch (Exception^) {}
01568                                 }
01569 
01570                         }
01571 
01577 private: System::Void button4_Click(System::Object^  sender, System::EventArgs^  e) 
01578                 {
01579                         RobotControl::setCamera(RobotControl::LEFT);
01580                 }
01581 
01587 private: System::Void button5_Click(System::Object^  sender, System::EventArgs^  e) 
01588                 {
01589                         RobotControl::setCamera(RobotControl::RIGHT);
01590                 }
01591 
01597 private: System::Void button6_Click(System::Object^  sender, System::EventArgs^  e) 
01598                  {
01599                          RobotControl::initiateRobot();
01600                  }
01601 
01607 private: System::Void timer1_Tick_1(System::Object^  sender, System::EventArgs^  e) 
01608                  {
01609                          if (panel1->Visible)
01610                          {
01611                                  IntPtr hdc;    
01612                                  Graphics^ g = Graphics::FromHwnd( this->panel1->Handle );
01613                                  hdc = g->GetHdc();
01614                                  requestVideoImage(hdc);
01615                          }
01616 
01617                          this->executiontimeLabel->Text = processTime+"ms";
01618 
01619                          if(RobotControl::used_eye == RobotControl::LEFT)
01620                                  this->cameraLabel->Text = "linkes Auge";
01621                          else this->cameraLabel->Text = "rechtes Auge";
01622 
01623                          int nof = getNumberOfFaces();
01624                          if (nof >= 0) this->facesLabel->Text = ""+nof;
01625 
01626                          if(nof > 0) this->majorfaceLabel->Text = "("+getMajorFacePosX() + ", "+getMajorFacePosY()+")";
01627                          else this->majorfaceLabel->Text = "-";
01628 
01629                          this->resolutionLabel->Text = getVideoSizeX()+" x "+getVideoSizeY();
01630 
01631                  }
01632 
01633 
01639 private: static void facedetectThreadISR(Object^ object)
01640 {
01641         
01642         while(facedetectThreadRunningState != STOPPED)
01643         {
01644                 while(facedetectThreadRunningState == RUNNING)
01645                 {
01646                         int time = Environment::TickCount;
01647                         processVideoFrame();
01648                         processTime = Environment::TickCount - time;
01649                         Thread::Sleep(100);
01650                 }
01651                 Thread::Sleep(100);
01652         }
01653 }
01654 
01658 private: System::Void headMovementCheckBox_CheckedChanged(System::Object^  sender, System::EventArgs^  e) 
01659                  {
01660                          RobotControl::setServosEnable(headMovementCheckBox->Checked);
01661                          
01662                          if(this->headMovementCheckBox->Checked)
01663                          {
01664                                  this->mouthCheckBox->Enabled = true;
01665                                  this->earCheckBox->Enabled = true;
01666                                  this->lidCheckBox->Enabled = true;
01667                                  this->trackingCheckBox->Enabled = true;
01668 
01669                                  this->earCheckBox_CheckedChanged(this, gcnew System::EventArgs());
01670                                  this->lidCheckBox_CheckedChanged(this, gcnew System::EventArgs());
01671                                  this->trackingCheckBox_CheckedChanged(this, gcnew System::EventArgs());
01672                                  this->mouthCheckBox_CheckedChanged(this, gcnew System::EventArgs());
01673                          }
01674                          else
01675                          {
01676                                  this->mouthCheckBox->Enabled = false;
01677                                  this->earCheckBox->Enabled = false;
01678                                  this->lidCheckBox->Enabled = false;
01679                                  this->trackingCheckBox->Enabled = false;
01680 
01681                                  RobotControl::setVisualAdjustmentThreadPaused(true);
01682                                  RobotControl::setBlinkingThreadPaused(true);
01683                                  RobotControl::setEarTremorThreadPaused(true);
01684                                  RobotControl::setMouthMovementEnabled(false);
01685                          }
01686                  }
01687 
01691 private: System::Void mouthCheckBox_CheckedChanged(System::Object^  sender, System::EventArgs^  e) 
01692                  {
01693                          RobotControl::setMouthMovementEnabled(this->mouthCheckBox->Checked);
01694                  }
01695 
01699 private: System::Void trackingCheckBox_CheckedChanged(System::Object^  sender, System::EventArgs^  e) 
01700                  {
01701                          RobotControl::setVisualAdjustmentThreadPaused(!this->trackingCheckBox->Checked);
01702                          if (this->trackingCheckBox->Checked)
01703                          {
01704                                  this->imageProcessingCheckBox->Checked = true;
01705                                  this->imageProcessingCheckBox_CheckedChanged(this, System::EventArgs::Empty);
01706                          }
01707                  }
01708 
01712 private: System::Void lidCheckBox_CheckedChanged(System::Object^  sender, System::EventArgs^  e) 
01713                  {
01714                          RobotControl::setBlinkingThreadPaused(!this->lidCheckBox->Checked);
01715                  }
01716 
01720 private: System::Void earCheckBox_CheckedChanged(System::Object^  sender, System::EventArgs^  e) 
01721                  {
01722                          RobotControl::setEarTremorThreadPaused(!this->earCheckBox->Checked);
01723                  }
01724 
01725 
01729 private: System::Void imageProcessingCheckBox_CheckedChanged(System::Object^  sender, System::EventArgs^  e) 
01730                  {
01731                          if(( imageProcessingCheckBox->Checked) && (facedetectThreadRunningState == STOPPED))
01732                          {
01733                                 initiateVideo( 0 );
01734                                 this->facedetectThread = gcnew Thread( gcnew ParameterizedThreadStart( &Form1::facedetectThreadISR ));
01735                                 facedetectThreadRunningState = RUNNING;
01736                                 this->facedetectThread->Start( this );
01737                          }
01738                          else if(( imageProcessingCheckBox->Checked) && (facedetectThreadRunningState == PAUSED))
01739                          {
01740                                  facedetectThreadRunningState = RUNNING;
01741                                  this->visualTimer->Enabled = true;
01742                          }
01743                          else if(( !imageProcessingCheckBox->Checked ) && (facedetectThreadRunningState == RUNNING))
01744                          {
01745                                  facedetectThreadRunningState = PAUSED;
01746                                  this->visualTimer->Enabled = false;
01747                                  this->trackingCheckBox->Checked = false;
01748                                  this->trackingCheckBox_CheckedChanged(this, System::EventArgs::Empty);
01749                          }
01750                  }
01751 
01752 
01753 
01759 private: System::Void openButton_Click(System::Object^  sender, System::EventArgs^  e) 
01760                  {
01761                          if (this->openFileDialog->ShowDialog() == Windows::Forms::DialogResult::OK)
01762                          {
01763                                  try
01764                                  {
01765                                          //this->Text = openFileDialog->FileName;
01766                                          this->storyTextBox->LoadFile(openFileDialog->FileName, Windows::Forms::RichTextBoxStreamType::PlainText  );
01767                                          this->stopButton_Click(this, System::EventArgs::Empty);  //stoppen
01768 //                                       this->playButton->Enabled = true;                                                //Abspiel-Button enablen
01769                                          //this->playButton->ImageIndex = 0;
01770                                  }
01771                                  catch(Exception^) {}
01772                          }
01773                  }
01774 
01780 private: System::Void geschichteÖffnenToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) 
01781                  {
01782                          this->openButton_Click(this, System::EventArgs::Empty);
01783                  }
01784 
01785 
01791 private: System::Void beendenToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) 
01792                  {
01793                          this->Close();
01794                  }
01795 };
01796 }
01797 

Erzeugt am Mon Jun 4 16:39:20 2007 für Super-Yano von  doxygen 1.5.2