diff --git a/DMX-2.0/SeqSonUI.cs b/DMX-2.0/SeqSonUI.cs index 4cda866..6a27225 100644 --- a/DMX-2.0/SeqSonUI.cs +++ b/DMX-2.0/SeqSonUI.cs @@ -212,7 +212,7 @@ namespace DMX2 protected void OnBtnGotoClicked (object sender, EventArgs e) { - TimeSpan ts; + /*TimeSpan ts; string[] formats = new string[]{ @"m\:s\.f", @"m\:s", @@ -220,7 +220,8 @@ namespace DMX2 @"h\:m\:s\.f" }; if(!TimeSpan.TryParseExact(txtGoto.Text,formats,null,out ts)) return; - sequenceur.PlayTime = ts; + sequenceur.PlayTime = ts;*/ + sequenceur.Command(txtGoto.Text); } protected void OnListFilesCursorChanged (object sender, EventArgs e) diff --git a/DMX-2.0/SequenceurSon.cs b/DMX-2.0/SequenceurSon.cs index a63b0a2..e3add42 100644 --- a/DMX-2.0/SequenceurSon.cs +++ b/DMX-2.0/SequenceurSon.cs @@ -49,7 +49,8 @@ namespace DMX2 delegate void Task (); - Queue taskQueue = new Queue(); + System.Collections.Concurrent.ConcurrentQueue taskQueue = + new System.Collections.Concurrent.ConcurrentQueue(); TimeSpan fading=TimeSpan.Zero; TimeSpan fadeLen; @@ -107,10 +108,9 @@ namespace DMX2 set{ if(element==null) return; if(element.CurrentState != Gst.State.Paused && element.CurrentState != Gst.State.Playing){ - lock(this) - taskQueue.Enqueue(delegate(){ - PlayTime = value; - }); + taskQueue.Enqueue(delegate(){ + PlayTime = value; + }); return; } long pos = (long)(value.TotalMilliseconds) * 1000000; @@ -163,10 +163,9 @@ namespace DMX2 { if(element == null)return; if(element.CurrentState != Gst.State.Paused && element.CurrentState != Gst.State.Playing){ - lock(this) - taskQueue.Enqueue(delegate(){ - Play(); - }); + taskQueue.Enqueue(delegate(){ + Play(); + }); return; } @@ -183,7 +182,8 @@ namespace DMX2 element.SetState(Gst.State.Null); element.Dispose(); element=null; - taskQueue.Clear(); + Task t; + while(taskQueue.TryDequeue (out t)); } static void GstInit () @@ -222,11 +222,13 @@ namespace DMX2 public override void Tick (TimeSpan time) { - if(element!=null && taskQueue.Count>0) - if(element.CurrentState == Gst.State.Paused || element.CurrentState == Gst.State.Playing) - lock(this) - taskQueue.Dequeue()(); - + if (element != null) { + if (element.CurrentState == Gst.State.Paused || element.CurrentState == Gst.State.Playing) + { + Task t; + while(taskQueue.TryDequeue(out t)) t(); + } + } if (fading != TimeSpan.Zero) { fading-=time; if(fading<=TimeSpan.Zero){ diff --git a/DMX-2.0/gtk-gui/DMX2.SeqSonUI.cs b/DMX-2.0/gtk-gui/DMX2.SeqSonUI.cs index 5b9f07c..2162ffc 100644 --- a/DMX-2.0/gtk-gui/DMX2.SeqSonUI.cs +++ b/DMX-2.0/gtk-gui/DMX2.SeqSonUI.cs @@ -43,6 +43,7 @@ namespace DMX2 private global::Gtk.Toolbar toolbar4; private global::Gtk.ScrolledWindow GtkScrolledWindow; private global::Gtk.NodeView listFiles; + private global::Gtk.Label label1; private global::Gtk.Label GtkLabel9; protected virtual void Build () @@ -344,7 +345,7 @@ namespace DMX2 this.btnGoto.CanFocus = true; this.btnGoto.Name = "btnGoto"; this.btnGoto.UseUnderline = true; - this.btnGoto.Label = "GoTo"; + this.btnGoto.Label = "Cmd"; this.hbox3.Add (this.btnGoto); global::Gtk.Box.BoxChild w73 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.btnGoto])); w73.Position = 8; @@ -407,6 +408,17 @@ namespace DMX2 this.vbox2.Add (this.GtkScrolledWindow); global::Gtk.Box.BoxChild w80 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.GtkScrolledWindow])); w80.Position = 1; + // Container child vbox2.Gtk.Box+BoxChild + this.label1 = new global::Gtk.Label (); + this.label1.Name = "label1"; + this.label1.Xalign = 0F; + this.label1.LabelProp = "Commands : \n[XX][gMM:SS.f][vVOL,T][p|ps|s]\n(FileNumber)(g=goto)(v=volume,fade in/out time)(p=play,ps=pause,s=stop)"; + this.label1.UseMarkup = true; + this.vbox2.Add (this.label1); + global::Gtk.Box.BoxChild w81 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.label1])); + w81.Position = 2; + w81.Expand = false; + w81.Fill = false; this.GtkAlignment.Add (this.vbox2); this.frame1.Add (this.GtkAlignment); this.GtkLabel9 = new global::Gtk.Label (); diff --git a/DMX-2.0/gtk-gui/gui.stetic b/DMX-2.0/gtk-gui/gui.stetic index 49b9ba9..eee773b 100644 --- a/DMX-2.0/gtk-gui/gui.stetic +++ b/DMX-2.0/gtk-gui/gui.stetic @@ -3842,7 +3842,7 @@ trames DMX (ms) True TextOnly - GoTo + Cmd True @@ -3896,7 +3896,7 @@ trames DMX (ms) False Icons SmallToolbar - + @@ -3936,6 +3936,22 @@ trames DMX (ms) True + + + + 0 + Commands : +[XX][gMM:SS.f][vVOL,T][p|ps|s] +(FileNumber)(g=goto)(v=volume,fade in/out time)(p=play,ps=pause,s=stop) + True + + + 2 + False + False + False + +