Beispiel #1
0
 /**
  * The current recording's type is determined by the key that is pressed to trigger the recording.
  * @param key - key that triggers the module
  */
 public override void KeyTrigger(int key)
 {
     for (int i = 0; i < typeNames.Length; i++)
     {
         if (triggers[i] == key)
         {
             frameIndex       = 0;
             currentRecording = new FaceRecording(typeNames[i]);
             recording        = true;
             return;
         }
     }
     if (recording && key == triggers[7])
     {
         recording = false;
         currentRecording.setData(data, model.NullFace);
         currentRecording.Save();
     }
 }
Beispiel #2
0
            /**
             *
             * Initializes the UI and loads all the recording's data into RAM.
             *
             * @param string fileBaseName since there are two file for each recording (landmark- and video-data), the timestamp will be used to identify them
             * @param string type specifies the emotion-type
             * @param idx assigns an index to the DataSet
             */
            public DataSetView(string fileBaseName, string type, int idx)
            {
                initModules();
                index         = idx;
                videoFile     = fileBaseName + ".mp4";
                dataFile      = fileBaseName + "." + type;
                shortName     = fileBaseName.Substring(fileBaseName.LastIndexOf("\\"));
                faceRecording = FaceRecording.load(dataFile);

                vlcControl = new Vlc.DotNet.Forms.VlcControl();
                vlcControl.VlcLibDirectoryNeeded += new EventHandler <Vlc.DotNet.Forms.VlcLibDirectoryNeededEventArgs>(this.OnVlcControlNeedLibDirectory);
                ((System.ComponentModel.ISupportInitialize)(this.vlcControl)).EndInit();
                vlcControl.ImeMode  = System.Windows.Forms.ImeMode.NoControl;
                vlcControl.Location = new System.Drawing.Point(0, 0);
                arrange();
                vlcControl.VlcMediaplayerOptions = null;

                dataImage            = new Bitmap(dataPictureBox.Bounds.Width, dataPictureBox.Bounds.Height);
                dataPictureBox.Image = dataImage;

                pictureUpdate = delegate
                {
                    dataPictureBox.Image = dataImage;
                    dataPictureBox.Refresh();
                };

                Controls.Add(vlcControl);
                Controls.Add(dataPictureBox);
                vlcControl.SetMedia(new Uri(videoFile), null);
                vlcControl.Play();
                vlcControl.Pause();

                model.NullFace = faceRecording.getNullFace();

                arrange();
            }