aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.Video/FrameRate.cs
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-02-01 16:40:13 +0200
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-02-01 16:40:13 +0200
commiteb2c264422b98458979bc96504ce8830a527d48c (patch)
tree2c2e0bcb908867759e7bea31dad0e21bd82f9cff /Software/Visual_Studio/Tango.Video/FrameRate.cs
parenta89c18abf7175f76f8673c12dac35d1658209d4e (diff)
downloadTango-eb2c264422b98458979bc96504ce8830a527d48c.tar.gz
Tango-eb2c264422b98458979bc96504ce8830a527d48c.zip
Added Tango.Video project.
Implemented USB video device capture for developer module.
Diffstat (limited to 'Software/Visual_Studio/Tango.Video/FrameRate.cs')
-rw-r--r--Software/Visual_Studio/Tango.Video/FrameRate.cs60
1 files changed, 60 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Tango.Video/FrameRate.cs b/Software/Visual_Studio/Tango.Video/FrameRate.cs
new file mode 100644
index 000000000..47ba52289
--- /dev/null
+++ b/Software/Visual_Studio/Tango.Video/FrameRate.cs
@@ -0,0 +1,60 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Tango.Video.DirectCapture
+{
+ /// <summary>
+ /// Used to hold a frame rate value for a CaptureDevice.
+ /// </summary>
+ public class FrameRate : INotifyPropertyChanged
+ {
+ /// <summary>
+ /// Initializses a new instance of FrameRate.
+ /// </summary>
+ public FrameRate()
+ {
+
+ }
+
+ /// <summary>
+ /// Initializes a new FrameRate instance.
+ /// </summary>
+ /// <param name="rate">The frame rate.</param>
+ public FrameRate(double rate)
+ : this()
+ {
+ Rate = rate;
+ }
+
+ private double _rate;
+
+ /// <summary>
+ /// Gets or sets the current frame rate.
+ /// </summary>
+ public double Rate
+ {
+ get { return _rate; }
+ set { _rate = value; RaisePropertyChanged("Rate"); }
+ }
+
+ /// <summary>
+ /// Returns a strings representation of the current frame rate.
+ /// </summary>
+ /// <returns>Frame rate.</returns>
+ public override string ToString()
+ {
+ return Rate.ToString("0.#") + " fps";
+ }
+
+ private void RaisePropertyChanged(String propName)
+ {
+ if (PropertyChanged != null) PropertyChanged(this, new PropertyChangedEventArgs(propName));
+ }
+
+ public event PropertyChangedEventHandler PropertyChanged;
+ }
+}