Ejemplo n.º 1
0
        // Called every 5 seconds
        private void Timer_handle(object sender, EventArgs e)
        {
            IWMPControls controls = m_player.controls;

            WebcamCtrl.TakeSnapshot();
            m_imagePath = m_picturesDefaultPath;
            scan();

            // We need to check if the mood needs to be switched
            if (controls.currentItem != null &&
                controls.currentItem.duration - controls.currentPosition < 10.0)
            {
                DetectedResult emotion = getBestValue(m_averageEmotion);
                Mood           mood    = emotion.toMood();

                if (mood != m_currentMood)
                {
                    m_currentMood = mood;
                    ResetPlaylist(mood);
                }
            }

            if (controls.currentItem != null &&
                controls.currentItem.duration - controls.currentPosition < 2.0)
            {
                Track  track = m_songQueue.Dequeue();
                String uri   = m_videoPath + track.id + ".mp3";
                Log("Playing song: " + uri);
                m_player.URL = uri;
                controls.play();
                m_songQueue.Enqueue(track);
                // Box with artist and title track.artist and track.sonh
            }
        }
Ejemplo n.º 2
0
 private void TakeSnapshotButton_Click(object sender, RoutedEventArgs e)
 {
     // Take snapshot of webcam video.
     WebcamCtrl.TakeSnapshot();
     m_imagePath = m_picturesDefaultPath;
     scan();
 }
Ejemplo n.º 3
0
 private void TakeSnapshotButton_Click(Object sender, RoutedEventArgs e)
 {
     // Take snapshot of webcam video
     FileName = WebcamCtrl.TakeSnapshot();
     WebcamCtrl.StopCapturing();
     CamGrid.Visibility       = Visibility.Collapsed;
     TransmitGrid.Visibility  = Visibility.Visible;
     TransmitImage.Source     = new ImageSourceConverter().ConvertFromString(FileName) as ImageSource;
     TransmitImage.Visibility = Visibility.Visible;
 }
        private void TakePhoto_button_Click(object sender, RoutedEventArgs e)
        {
            Loger.WriteLog(this.GetType() + "-" + TakePhoto_button.Name + "Clicked");
            // timer.Stop();
            try {
                // Take snapshot of webcam video.
                WebcamCtrl.TakeSnapshot();
            }
            catch (Exception ex)
            {
                Helper.ShowPopUp("An Error Occurred!! Please check log for errors", "Exception");
                Loger.WriteLog(this.GetType() + "-Exception:" + ex.Message + Environment.NewLine + "StackTrace:" + ex.StackTrace);
            }

            ConvertImageandDisplay();
        }
Ejemplo n.º 5
0
 private void TakeSnapshotButton_Click(object sender, RoutedEventArgs e)
 {
     // Take snapshot of webcam video.
     WebcamCtrl.TakeSnapshot();
 }