Skip to content

Commit

Permalink
Change countdown to only 3 secs.
Browse files Browse the repository at this point in the history
  • Loading branch information
andijakl committed Sep 20, 2016
1 parent 5ab9472 commit 886fc64
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
13 changes: 6 additions & 7 deletions KissMachineKinect/KissMachineKinect.Windows/MainPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
using Windows.Foundation;
using Windows.Graphics.Imaging;
using Windows.Storage;
using Windows.Storage.Streams;
using Windows.System;
using Windows.UI;
using Windows.UI.Core;
Expand Down Expand Up @@ -44,7 +43,7 @@ public sealed partial class MainPage : Page, INotifyPropertyChanged
private const float TriggerKissCountdownDistanceInM = 0.3f;

private const double CountdownSpeedInS = 1.5;
private const int CountdownStartValue = 5;
private const int CountdownStartValue = 3;
private const int ClearPictureSpeedInS = 10;

// Screenshots
Expand Down Expand Up @@ -82,7 +81,7 @@ private enum FileFormat
// UI
private MinPlayerLine _minPlayerLine;
private Timer _photoCountdownTimer;
private int LowPerformanceFrameCounter = 0;
private int _lowPerformanceFrameCounter;

private int _photoCountDown = (int)KissCountdownStatusService.SpecialKissTexts.Invisible;
public int PhotoCountDown
Expand Down Expand Up @@ -320,8 +319,6 @@ protected override void OnNavigatedFrom(NavigationEventArgs e)

#endregion



#region Kinect Init
private void InitKinect()
{
Expand Down Expand Up @@ -462,8 +459,8 @@ private void Reader_ColorFrameArrived(ColorFrameReader sender, ColorFrameArrived
if (ShowTakenPhoto) return;
if (LowPerformanceMode)
{
LowPerformanceFrameCounter++;
if (LowPerformanceFrameCounter%2 != 0) return;
_lowPerformanceFrameCounter++;
if (_lowPerformanceFrameCounter%2 != 0) return;
}

var colorFrameProcessed = false;
Expand Down Expand Up @@ -617,6 +614,7 @@ private bool IsPlayerTracked(ulong trackingId)

#endregion

#region Player Detection & Calculations
/// <summary>
/// Handles the body frame data arriving from the sensor
/// </summary>
Expand Down Expand Up @@ -774,6 +772,7 @@ private void UpdatePlayer(Body curBody)
player.SetPosition(facePosInCamera, facePosInColor);
}
}
#endregion

#region Photo Countdown

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,12 @@ private async Task<Event> GetCameraStatusAsync()
{
var camStatus = await _camera.GetEventAsync(false, CameraApiVersion);
Debug.WriteLine("Camera status: " + camStatus.CameraStatus);
var postViewImageSizeList = await _camera.GetPostviewImageSizeAsync();
Debug.WriteLine("Postview Image sizes:");
foreach (var curSize in postViewImageSizeList)
{
Debug.WriteLine(curSize);
}
return camStatus;
}
#endregion
Expand Down

0 comments on commit 886fc64

Please sign in to comment.