[longomatch/test: 10/10] WIP
- From: Andoni Morales Alastruey <amorales src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [longomatch/test: 10/10] WIP
- Date: Wed, 17 Nov 2010 23:59:07 +0000 (UTC)
commit 8dd37ee23e5ea99edc631bf0598c8d28e6a1b198
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date: Thu Nov 18 00:56:59 2010 +0100
WIP
LongoMatch/Gui/Component/ProjectListWidget.cs | 2 +-
LongoMatch/Gui/Component/ProjectTemplateWidget.cs | 4 +-
LongoMatch/Gui/Component/TimeAdjustWidget.cs | 4 +-
LongoMatch/Gui/Component/TimeLineWidget.cs | 25 ++++++--
LongoMatch/Gui/Component/TimeScale.cs | 8 +++
LongoMatch/Gui/Dialog/DrawingTool.cs | 2 +-
LongoMatch/Handlers/EventsManager.cs | 19 +++---
LongoMatch/Handlers/VideoDrawingsManager.cs | 6 +-
LongoMatch/IO/SectionsReader.cs | 4 +-
LongoMatch/Main.cs | 2 +-
LongoMatch/Time/Category.cs | 34 +++++++---
LongoMatch/Time/Drawing.cs | 36 +++++------
LongoMatch/Time/DrawingsList.cs | 69 ++++++++++++++++++---
LongoMatch/Time/HotKey.cs | 25 ++++----
LongoMatch/Time/Play.cs | 6 +-
LongoMatch/Time/Tag.cs | 4 +-
LongoMatch/Time/Time.cs | 11 ++-
17 files changed, 173 insertions(+), 88 deletions(-)
---
diff --git a/LongoMatch/Gui/Component/ProjectListWidget.cs b/LongoMatch/Gui/Component/ProjectListWidget.cs
index d1a80de..0c2f30f 100644
--- a/LongoMatch/Gui/Component/ProjectListWidget.cs
+++ b/LongoMatch/Gui/Component/ProjectListWidget.cs
@@ -118,7 +118,7 @@ namespace LongoMatch.Gui.Component
ProjectDescription project = (ProjectDescription) model.GetValue(iter, 0);
text = "\n"+"\n"+"\n"+"<b>"+Catalog.GetString("File length")+":</b> " +
- (new Time ((int)project.File.Length)).ToSecondsString();
+ (new Time {MSeconds = (int)project.File.Length}).ToSecondsString();
text = text +"\n"+"<b>"+Catalog.GetString("Video codec")+":</b> " + project.VideoCodec;
text = text +"\n"+"<b>"+Catalog.GetString("Audio codec")+":</b> " + project.AudioCodec;
text = text +"\n"+"<b>"+Catalog.GetString("Format")+":</b> " + project.Format;
diff --git a/LongoMatch/Gui/Component/ProjectTemplateWidget.cs b/LongoMatch/Gui/Component/ProjectTemplateWidget.cs
index 8d9f841..5165270 100644
--- a/LongoMatch/Gui/Component/ProjectTemplateWidget.cs
+++ b/LongoMatch/Gui/Component/ProjectTemplateWidget.cs
@@ -95,8 +95,8 @@ namespace LongoMatch.Gui.Component
Category tn;
HotKey hkey = new HotKey();
- Time start = new Time(10*Time.SECONDS_TO_TIME);
- Time stop = new Time(10*Time.SECONDS_TO_TIME);
+ Time start = new Time {MSeconds = 10*Time.SECONDS_TO_TIME};
+ Time stop = new Time {MSeconds = 10*Time.SECONDS_TO_TIME};
tn = new Category{
Name = "New Section",
diff --git a/LongoMatch/Gui/Component/TimeAdjustWidget.cs b/LongoMatch/Gui/Component/TimeAdjustWidget.cs
index 7c7075c..45d8312 100644
--- a/LongoMatch/Gui/Component/TimeAdjustWidget.cs
+++ b/LongoMatch/Gui/Component/TimeAdjustWidget.cs
@@ -44,11 +44,11 @@ namespace LongoMatch.Gui.Component
}
public Time GetStartTime() {
- return new Time((int)(spinbutton1.Value)*Time.SECONDS_TO_TIME);
+ return new Time {Seconds = (int)(spinbutton1.Value)};
}
public Time GetStopTime() {
- return new Time((int)(spinbutton2.Value)*Time.SECONDS_TO_TIME);
+ return new Time {Seconds = (int)(spinbutton2.Value)};
}
protected virtual void OnSpinbutton1ValueChanged(object sender, System.EventArgs e)
diff --git a/LongoMatch/Gui/Component/TimeLineWidget.cs b/LongoMatch/Gui/Component/TimeLineWidget.cs
index 545758f..bcbdc0a 100644
--- a/LongoMatch/Gui/Component/TimeLineWidget.cs
+++ b/LongoMatch/Gui/Component/TimeLineWidget.cs
@@ -38,7 +38,7 @@ namespace LongoMatch.Gui.Component {
public event NewMarkAtFrameEventHandler NewMarkEvent;
//public event PlayListNodeAddedHandler PlayListNodeAdded;
- private List<TimeScale> tsList;
+ private Dictionary<Category,TimeScale> tsList;
private Categories categories;
private TimeReferenceWidget tr;
private uint frames;
@@ -64,7 +64,7 @@ namespace LongoMatch.Gui.Component {
return;
selected = value;
- foreach (TimeScale ts in tsList)
+ foreach (TimeScale ts in tsList.Values)
ts.SelectedTimeNode = value;
if (selected != null) {
if (SelectedTimeNode.StartFrame/pixelRatio < GtkScrolledWindow.Hadjustment.Value ||
@@ -85,7 +85,7 @@ namespace LongoMatch.Gui.Component {
return;
currentFrame = value;
- foreach (TimeScale ts in tsList)
+ foreach (TimeScale ts in tsList.Values)
ts.CurrentFrame = value;
tr.CurrentFrame = value;
QueueDraw();
@@ -117,7 +117,7 @@ namespace LongoMatch.Gui.Component {
this.pixelRatio = pixelRatio;
tr.PixelRatio = pixelRatio;
- foreach (TimeScale ts in tsList)
+ foreach (TimeScale ts in tsList.Values)
ts.PixelRatio = pixelRatio;
vscale1.Value=pixelRatio;
}
@@ -128,6 +128,7 @@ namespace LongoMatch.Gui.Component {
if (value == null) {
categories = null;
+ tsList.Clear();
tsList=null;
hasProject = false;
return;
@@ -135,7 +136,7 @@ namespace LongoMatch.Gui.Component {
hasProject = true;
categories = value.Categories;
- tsList = new List<TimeScale>();
+ tsList = new Dictionary<Category, TimeScale>();
frames = value.Description.File.GetFrames();
Console.WriteLine (frames);
ushort fps = value.Description.File.Fps;
@@ -146,7 +147,7 @@ namespace LongoMatch.Gui.Component {
foreach (Category cat in categories.CategoriesList) {
List<Play> playsList = value.PlaysInCategory(cat);
TimeScale ts = new TimeScale(cat, playsList,frames);
- tsList.Add(ts);
+ tsList[cat] = ts;
ts.TimeNodeChanged += new TimeNodeChangedHandler(OnTimeNodeChanged);
ts.TimeNodeSelected += new TimeNodeSelectedHandler(OnTimeNodeSelected);
ts.TimeNodeDeleted += new TimeNodeDeletedHandler(OnTimeNodeDeleted);
@@ -158,6 +159,18 @@ namespace LongoMatch.Gui.Component {
}
}
+ public void AddPlay(Play play){
+ TimeScale ts;
+ if (tsList.TryGetValue(play.Category, out ts))
+ ts.AddPlay(play);
+ }
+
+ public void RemovePlay (Play play){
+ TimeScale ts;
+ if (tsList.TryGetValue(play.Category, out ts))
+ ts.RemovePlay(play);
+
+ }
private void ResetGui() {
//Unrealize all children
foreach (Widget w in vbox1.AllChildren) {
diff --git a/LongoMatch/Gui/Component/TimeScale.cs b/LongoMatch/Gui/Component/TimeScale.cs
index 64c63f5..1924a64 100644
--- a/LongoMatch/Gui/Component/TimeScale.cs
+++ b/LongoMatch/Gui/Component/TimeScale.cs
@@ -121,6 +121,14 @@ namespace LongoMatch.Gui.Component
}
}
+ public void AddPlay(Play play) {
+ list.Add(play);
+ }
+
+ public void RemovePlay(Play play) {
+ list.Remove(play);
+ }
+
public void ReDraw() {
Gdk.Region region = GdkWindow.ClipRegion;
GdkWindow.InvalidateRegion(region,true);
diff --git a/LongoMatch/Gui/Dialog/DrawingTool.cs b/LongoMatch/Gui/Dialog/DrawingTool.cs
index 2cfd7fa..1324f9e 100644
--- a/LongoMatch/Gui/Dialog/DrawingTool.cs
+++ b/LongoMatch/Gui/Dialog/DrawingTool.cs
@@ -118,7 +118,7 @@ namespace LongoMatch.Gui.Dialog
string tempFile = System.IO.Path.GetTempFileName();
drawingwidget1.SaveDrawings(tempFile);
Pixbuf frame = new Pixbuf(tempFile);
- play.KeyFrameDrawing =new Drawing(frame,stopTime);
+ play.KeyFrameDrawing =new Drawing{ Pixbuf=frame, RenderTime = stopTime};
drawingwidget1.SaveAll(tempFile);
frame.Dispose();
play.Miniature = new Pixbuf(tempFile);
diff --git a/LongoMatch/Handlers/EventsManager.cs b/LongoMatch/Handlers/EventsManager.cs
index 660ab00..98ca8d8 100644
--- a/LongoMatch/Handlers/EventsManager.cs
+++ b/LongoMatch/Handlers/EventsManager.cs
@@ -168,14 +168,14 @@ namespace LongoMatch
// Calculating borders of the segment depnding
start = pos - startTime;
stop = pos + stopTime;
- fStart = (start < new Time(0)) ? new Time(0) : start;
+ fStart = (start < new Time {MSeconds =0}) ? new Time {MSeconds = 0} : start;
if (projectType == ProjectType.FakeCaptureProject ||
projectType == ProjectType.CaptureProject){
fStop = stop;
}
else {
- length = new Time((int)player.StreamLength);
+ length = new Time {MSeconds = (int)player.StreamLength};
fStop = (stop > length) ? length: stop;
}
AddNewPlay(fStart, fStop, category);
@@ -200,6 +200,7 @@ namespace LongoMatch
var play = openedProject.AddPlay(category, start, stop,miniature);
treewidget.AddPlay(play);
tagsTreeWidget.AddPlay(play);
+ timeline.AddPlay(play);
timeline.QueueDraw();
}
@@ -233,7 +234,7 @@ namespace LongoMatch
}
protected virtual void OnNewMarkAtFrame(Category category, int frame) {
- Time pos = new Time(frame*1000/openedProject.Description.File.Fps);
+ Time pos = new Time{ MSeconds = frame*1000/openedProject.Description.File.Fps};
player.CloseActualSegment();
player.SeekTo ((long)pos.MSeconds, true);
ProcessNewMarkEvent(category,pos);
@@ -244,19 +245,19 @@ namespace LongoMatch
if (projectType == ProjectType.FakeCaptureProject ||
projectType == ProjectType.CaptureProject)
- pos = new Time((int)capturer.CurrentTime);
+ pos = new Time { MSeconds = (int)capturer.CurrentTime};
else
- pos = new Time((int)player.CurrentTime);
+ pos = new Time {MSeconds = (int)player.CurrentTime};
ProcessNewMarkEvent(category,pos);
}
public virtual void OnNewMarkStart(){
- startTime = new Time((int)player.CurrentTime);
+ startTime = new Time {MSeconds = (int)player.CurrentTime};
}
public virtual void OnNewMarkStop(Category category){
int diff;
- Time stopTime = new Time((int)player.CurrentTime);
+ Time stopTime = new Time {MSeconds = (int)player.CurrentTime};
diff = stopTime.MSeconds - startTime.MSeconds;
@@ -302,15 +303,17 @@ namespace LongoMatch
player.UpdateSegmentStopTime(pos.MSeconds);
}
}
- else if (tNode is Categories) {
+ else if (tNode is Category) {
buttonswidget.Categories = openedProject.Categories;
}
}
protected virtual void OnTimeNodeDeleted(Play play)
{
+ Console.WriteLine ("Deleting!!!!!!!!!!1");
/* FIXME: WIP*/
treewidget.RemovePlay(play);
+ timeline.RemovePlay(play);
foreach (var player in play.LocalPlayers)
localPlayersList.RemovePlay(play ,player);
diff --git a/LongoMatch/Handlers/VideoDrawingsManager.cs b/LongoMatch/Handlers/VideoDrawingsManager.cs
index 20b9873..34b0af0 100644
--- a/LongoMatch/Handlers/VideoDrawingsManager.cs
+++ b/LongoMatch/Handlers/VideoDrawingsManager.cs
@@ -90,7 +90,7 @@ namespace LongoMatch.Handlers
}
private int NextStopTime() {
- return Drawing.StopTime;
+ return Drawing.RenderTime;
}
private void PrintDrawing() {
@@ -98,7 +98,7 @@ namespace LongoMatch.Handlers
Pixbuf drawing = null;
player.Pause();
- player.SeekInSegment(Drawing.StopTime);
+ player.SeekInSegment(Drawing.RenderTime);
while (frame == null)
frame = player.CurrentFrame;
player.LogoPixbuf = frame;
@@ -145,7 +145,7 @@ namespace LongoMatch.Handlers
ResetPlayerWindow();
inKeyFrame = false;
}
- canStop = time < Drawing.StopTime;
+ canStop = time < Drawing.RenderTime;
if (canStop)
StartClock();
else StopClock();
diff --git a/LongoMatch/IO/SectionsReader.cs b/LongoMatch/IO/SectionsReader.cs
index 60e01a3..21e5444 100644
--- a/LongoMatch/IO/SectionsReader.cs
+++ b/LongoMatch/IO/SectionsReader.cs
@@ -46,11 +46,11 @@ namespace LongoMatch.IO
}
private Time GetStartTime(int section) {
- return new Time(GetIntValue("configuration","Start"+(section))*Time.SECONDS_TO_TIME);
+ return new Time {Seconds = GetIntValue("configuration","Start"+(section))};
}
private Time GetStopTime(int section) {
- return new Time(GetIntValue("configuration","Stop"+(section))*Time.SECONDS_TO_TIME);
+ return new Time {Seconds = GetIntValue("configuration","Stop"+(section))};
}
private Color GetColor(int section) {
diff --git a/LongoMatch/Main.cs b/LongoMatch/Main.cs
index 4ece301..284dac4 100644
--- a/LongoMatch/Main.cs
+++ b/LongoMatch/Main.cs
@@ -48,7 +48,7 @@ namespace LongoMatch
//Configuramos el directorio base de la ejecucuión y el directorio HOME
baseDirectory = System.IO.Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory,"../../");
homeDirectory = System.Environment.GetFolderPath(Environment.SpecialFolder.Personal);
- configDirectory = System.IO.Path.Combine(homeDirectory,".longomatch");
+ configDirectory = System.IO.Path.Combine(homeDirectory,".longomatch.test");
homeDirectory = System.IO.Path.Combine(homeDirectory,Constants.SOFTWARE_NAME);
if (Environment.OSVersion.Platform == PlatformID.Win32NT) {
diff --git a/LongoMatch/Time/Category.cs b/LongoMatch/Time/Category.cs
index faace79..77d6eab 100644
--- a/LongoMatch/Time/Category.cs
+++ b/LongoMatch/Time/Category.cs
@@ -28,8 +28,8 @@ namespace LongoMatch.TimeNodes
{
/// <summary>
- /// I am a tagging category for the analysis. I contain the default values to creates plays
- /// tagged in my category
+ /// Tag category for the analysis. Contains the default values to creates plays
+ /// tagged in this category
/// </summary>
[Serializable]
public class Category:TimeNode, ISerializable
@@ -44,41 +44,50 @@ namespace LongoMatch.TimeNodes
}
#region Properties
+ /// <summary>
+ /// Unique ID for this category
+ /// </summary>
public Guid UUID{
get {
return _UUID;
}
}
- /// <value>
- /// A key combination to create plays in my category
- /// </value>
+ /// <summary>
+ /// A key combination to create plays in this category
+ /// </summary>
public HotKey HotKey {
get;
set;
}
- /// <value>
- /// A color to draw plays from my category
- /// </value>
+ /// <summary>
+ /// A color to identify plays in this category
+ /// </summary>
public Color Color {
get;
set;
}
- //// <value>
+ //// <summary>
/// Sort method used to sort plays for this category
- /// </value>
+ /// </summary>
public SortMethodType SortMethod{
get;
set;
}
+ /// <summary>
+ /// Position of the category in the list of categories
+ /// </summary>
public int Position{
get;
set;
}
-
+
+ /// <summary>
+ /// Sort method string used for the UI
+ /// </summary>
public string SortMethodString{
get{
switch (SortMethod){
@@ -105,8 +114,11 @@ namespace LongoMatch.TimeNodes
SortMethod = SortMethodType.SortByName;
}
}
+
// this method is automatically called during serialization
public void GetObjectData(SerializationInfo info, StreamingContext context) {
+ info.AddValue("uuid", UUID);
+ info.AddValue("name", Name);
info.AddValue("name", Name);
info.AddValue("start", Start);
info.AddValue("stop", Stop);
diff --git a/LongoMatch/Time/Drawing.cs b/LongoMatch/Time/Drawing.cs
index 6b8ffb9..b0c568c 100644
--- a/LongoMatch/Time/Drawing.cs
+++ b/LongoMatch/Time/Drawing.cs
@@ -21,28 +21,24 @@ using Gdk;
namespace LongoMatch.TimeNodes
{
- /* Represent a drawing in the database using a { Gdk Pixbuf} stored
- in a bytes array in PNG format for serialization. { Drawings}
- are used by { MediaTimeNodes} to store the key frame drawing
- which stop time time is stored in a int value
- */
-
+
[Serializable]
public class Drawing
{
private byte[] drawingBuf;
- private readonly int stopTime;
-
+ /// <summary>
+ /// Represent a drawing in the database using a { Gdk Pixbuf} stored
+ /// in a bytes array in PNG format for serialization. { Drawings}
+ /// are used by { MediaTimeNodes} to store the key frame drawing
+ /// which stop time is stored in a int value
+ /// </summary>
public Drawing() {
}
- public Drawing(Pixbuf drawing,int stopTime)
- {
- Pixbuf = drawing;
- this.stopTime = stopTime;
- }
-
+ /// <summary>
+ /// Pixbuf with the drawing
+ /// </summary>
public Pixbuf Pixbuf {
get {
if (drawingBuf != null)
@@ -56,11 +52,13 @@ namespace LongoMatch.TimeNodes
drawingBuf = null;
}
}
-
- public int StopTime {
- get {
- return stopTime;
- }
+
+ /// <summary>
+ /// Render time of the drawing
+ /// </summary>
+ public int RenderTime {
+ get;
+ set;
}
}
}
diff --git a/LongoMatch/Time/DrawingsList.cs b/LongoMatch/Time/DrawingsList.cs
index 8bb0cba..f9a2659 100644
--- a/LongoMatch/Time/DrawingsList.cs
+++ b/LongoMatch/Time/DrawingsList.cs
@@ -25,53 +25,102 @@ namespace LongoMatch.TimeNodes
public class DrawingsList
{
+
private SortedList<int,Drawing> drawingsList;
public DrawingsList()
{
drawingsList = new SortedList<int,Drawing>();
}
-
+
+ /// <summary>
+ /// Adds a new drawing to the list
+ /// </summary>
+ /// <param name="drawing">
+ /// The <see cref="Drawing"/> to add
+ /// </param>
+ /// <returns>
+ /// A <see cref="System.Boolean"/>: true if the frawing was added
+ /// </returns>
public bool Add(Drawing drawing) {
- int stopTime = drawing.StopTime;
- if (!drawingsList.ContainsKey(stopTime)) {
- drawingsList.Add(stopTime,drawing);
+ int renderTime = drawing.RenderTime;
+ if (!drawingsList.ContainsKey(renderTime)) {
+ drawingsList.Add(renderTime,drawing);
return true;
}
else return false;
}
+ /// <summary>
+ /// Removes a drawing from the list
+ /// </summary>
+ /// <param name="drawing">
+ /// A <see cref="Drawing"/> to remove
+ /// </param>
+ /// <returns>
+ /// A <see cref="System.Boolean"/>: true if was removed correctly
+ /// </returns>
public bool Remove(Drawing drawing) {
- int stopTime = drawing.StopTime;
- return drawingsList.Remove(stopTime);
+ int renderTime = drawing.RenderTime;
+ return drawingsList.Remove(renderTime);
}
+ /// <summary>
+ /// Clear the drawing list
+ /// </summary>
protected void Clear() {
drawingsList.Clear();
}
+ /// <summary>
+ /// The count of drawings
+ /// </summary>
public int Count {
get {
return drawingsList.Count;
}
}
- public IList<int> StopTimes {
+ /// <summary>
+ /// A list with all the render times
+ /// </summary>
+ public IList<int> RenderTime {
get {
return drawingsList.Keys;
}
}
- public int GetStopTime(int index) {
+ /// <summary>
+ /// Gets the render time for a drawing at a position in the list
+ /// </summary>
+ /// <param name="index">
+ /// A <see cref="System.Int32"/> with the index
+ /// </param>
+ /// <returns>
+ /// A <see cref="System.Int32"/> with the render time
+ /// </returns>
+ public int GetRenderTime(int index) {
return drawingsList.Keys[index];
}
- public Drawing GetStopDrawing(int index) {
+ /// <summary>
+ /// Get the drawing for an the drawing at a position in the list
+ /// </summary>
+ /// <param name="index">
+ /// A <see cref="System.Int32"/> with the index
+ /// </param>
+ /// <returns>
+ /// A <see cref="Drawing"/> with the render time
+ /// </returns>
+ public Drawing GetRenderDrawing(int index) {
return drawingsList.Values[index];
}
+ /// <summary>
+ /// A list with all the drawings ordered by render time
+ /// </summary>
public SortedList<int,Drawing> List {
- get {
+ get{
return drawingsList;
}
}
diff --git a/LongoMatch/Time/HotKey.cs b/LongoMatch/Time/HotKey.cs
index a00c34a..2915a47 100644
--- a/LongoMatch/Time/HotKey.cs
+++ b/LongoMatch/Time/HotKey.cs
@@ -31,10 +31,9 @@ namespace LongoMatch.TimeNodes
{
/// <summary>
- /// I am key combination used to tag plays using the keyboard. <see cref="LongoMatch.TimeNodes.SectionsTimeNodes"/>
- /// uses me to create plays without using the mouse. I can only be used with Shith and Alt
- /// modifiers to avoid interfering with ohter shortcuts. In case I'am not associated to any
- /// key combinatio 'key' and 'modifier' will be set to -1
+ /// A key combination used to tag plays using the keyboard. <see cref="LongoMatch.TimeNodes.SectionsTimeNodes"/>
+ /// It can only be used with the Shith and Alt modifiers to avoid interfering with ohter shortcuts.
+ /// 'key' and 'modifier' are set to -1 when it's initialized
/// </summary>
[Serializable]
public class HotKey : IEquatable<HotKey>
@@ -54,9 +53,9 @@ namespace LongoMatch.TimeNodes
#endregion
#region Properties
- /// <value>
- /// My keyboard key
- /// </value>
+ /// <summary>
+ /// Gdk Key
+ /// </summary>
public Gdk.Key Key {
get {
return (Gdk.Key)key;
@@ -66,9 +65,9 @@ namespace LongoMatch.TimeNodes
}
}
- /// <value>
- /// My keyboard modifier. Only Alt and Shift can be used
- /// </value>
+ /// <summary>
+ /// Key modifier. Only Alt and Shift can be used
+ /// </summary>
public Gdk.ModifierType Modifier {
get {
return (Gdk.ModifierType)modifier;
@@ -78,9 +77,9 @@ namespace LongoMatch.TimeNodes
}
}
- /// <value>
- /// Whether I am defined or not
- /// </value>
+ /// <summary>
+ /// Get whether the hotkey is defined or not
+ /// </summary>
public Boolean Defined {
get {
return (key!=-1 && modifier != -1);
diff --git a/LongoMatch/Time/Play.cs b/LongoMatch/Time/Play.cs
index b995557..3592fe0 100644
--- a/LongoMatch/Time/Play.cs
+++ b/LongoMatch/Time/Play.cs
@@ -87,7 +87,7 @@ namespace LongoMatch.TimeNodes
return (uint) (Start.MSeconds * Fps / 1000);
}
set {
- Start = new Time((int)(1000 * value / Fps));
+ Start = new Time {MSeconds = (int)(1000 * value / Fps)};
}
}
@@ -99,7 +99,7 @@ namespace LongoMatch.TimeNodes
return (uint) (Stop.MSeconds * Fps / 1000);
}
set {
- Stop = new Time((int)(1000 * value / Fps));
+ Stop = new Time {MSeconds = (int)(1000 * value / Fps)};
}
}
@@ -109,7 +109,7 @@ namespace LongoMatch.TimeNodes
public uint KeyFrame {
get {
if (HasKeyFrame)
- return (uint) KeyFrameDrawing.StopTime * Fps / 1000;
+ return (uint) KeyFrameDrawing.RenderTime * Fps / 1000;
else return 0;
}
}
diff --git a/LongoMatch/Time/Tag.cs b/LongoMatch/Time/Tag.cs
index a8a4a61..a48ad0f 100644
--- a/LongoMatch/Time/Tag.cs
+++ b/LongoMatch/Time/Tag.cs
@@ -38,7 +38,7 @@ namespace LongoMatch.TimeNodes
}
public bool Equals(Tag tagComp) {
- return (TagCategory == tagComp.TagCategory && Value == tagComp.Value);
+ return (SubCategory == tagComp.SubCategory && Value == tagComp.Value);
}
public override bool Equals(object obj)
@@ -52,7 +52,7 @@ namespace LongoMatch.TimeNodes
public override int GetHashCode()
{
- return TagCategory.GetHashCode() + Value.GetHashCode();
+ return SubCategory.GetHashCode() + Value.GetHashCode();
}
}
}
diff --git a/LongoMatch/Time/Time.cs b/LongoMatch/Time/Time.cs
index f6e5f39..a22f777 100644
--- a/LongoMatch/Time/Time.cs
+++ b/LongoMatch/Time/Time.cs
@@ -54,6 +54,9 @@ namespace LongoMatch.TimeNodes
get {
return MSeconds/SECONDS_TO_TIME;
}
+ set {
+ MSeconds = value * SECONDS_TO_TIME;
+ }
}
#endregion
@@ -135,19 +138,19 @@ namespace LongoMatch.TimeNodes
}
public static Time operator +(Time t1,int t2) {
- return new Time(t1.MSeconds+t2);
+ return new Time {MSeconds = t1.MSeconds+t2};
}
public static Time operator +(Time t1,Time t2) {
- return new Time(t1.MSeconds+t2.MSeconds);
+ return new Time {MSeconds = t1.MSeconds+t2.MSeconds};
}
public static Time operator -(Time t1,Time t2) {
- return new Time(t1.MSeconds-t2.MSeconds);
+ return new Time {MSeconds = t1.MSeconds-t2.MSeconds};
}
public static Time operator -(Time t1,int t2) {
- return new Time(t1.MSeconds-t2);
+ return new Time {MSeconds = t1.MSeconds-t2};
}
#endregion
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]