diff --git a/DMX-2.0/SequenceurSon.cs b/DMX-2.0/SequenceurSon.cs index e3add42..65a5c21 100644 --- a/DMX-2.0/SequenceurSon.cs +++ b/DMX-2.0/SequenceurSon.cs @@ -75,7 +75,8 @@ namespace DMX2 } set { if(value>=0 && value< files.Count) - LoadFile(value); + lock(this) + LoadFile(value); } } @@ -100,8 +101,7 @@ namespace DMX2 public TimeSpan PlayTime { get{ if(element==null) return TimeSpan.Zero; - Gst.Format format = Gst.Format.Time ; - long cur; + Gst.Format format = Gst.Format.Time ; long cur; element.QueryPosition(ref format, out cur); return TimeSpan.FromMilliseconds(cur/1000000); } @@ -136,7 +136,6 @@ namespace DMX2 public void DelFile (int pos) { lock (this) { - files.RemoveAt (pos); CommandRemove(pos); } @@ -171,11 +170,13 @@ namespace DMX2 element.SetState(Gst.State.Playing); } + public void Pause () { if(element == null)return; element.SetState(Gst.State.Paused); } + public void Stop () { if(element == null)return; @@ -192,7 +193,6 @@ namespace DMX2 gsinit=true; string[] args = new string[] {"--gst-disable-segtrap"}; Gst.Application.Init("dmx2", ref args ); - } public SequenceurSon () @@ -215,6 +215,7 @@ namespace DMX2 { ui=null; } + public override int ValeurCircuit (Circuit c) { return 0; @@ -222,11 +223,11 @@ namespace DMX2 public override void Tick (TimeSpan time) { - if (element != null) { + if (element != null && taskQueue.Count>0) { if (element.CurrentState == Gst.State.Paused || element.CurrentState == Gst.State.Playing) { Task t; - while(taskQueue.TryDequeue(out t)) t(); + if(taskQueue.TryDequeue(out t)) t(); } } if (fading != TimeSpan.Zero) { @@ -237,8 +238,7 @@ namespace DMX2 } else{ Volume = (uint)( - fadeVEnd + - (fadeVStart-fadeVEnd) * + fadeVEnd + (fadeVStart-fadeVEnd) * fading.TotalMilliseconds / fadeLen.TotalMilliseconds); } @@ -310,7 +310,6 @@ namespace DMX2 } - if (cmd.Groups ["goto"].Success) { string[] formats = new string[]{ @"m\:s\.f", @"m\:s", @"h\:m\:s",@"h\:m\:s\.f" diff --git a/DMX-2.0/gtk-gui/DMX2.SeqSonUI.cs b/DMX-2.0/gtk-gui/DMX2.SeqSonUI.cs index 2162ffc..19b8b7f 100644 --- a/DMX-2.0/gtk-gui/DMX2.SeqSonUI.cs +++ b/DMX-2.0/gtk-gui/DMX2.SeqSonUI.cs @@ -44,7 +44,7 @@ namespace DMX2 private global::Gtk.ScrolledWindow GtkScrolledWindow; private global::Gtk.NodeView listFiles; private global::Gtk.Label label1; - private global::Gtk.Label GtkLabel9; + private global::Gtk.Label titreLabel; protected virtual void Build () { @@ -421,11 +421,11 @@ namespace DMX2 w81.Fill = false; this.GtkAlignment.Add (this.vbox2); this.frame1.Add (this.GtkAlignment); - this.GtkLabel9 = new global::Gtk.Label (); - this.GtkLabel9.Name = "GtkLabel9"; - this.GtkLabel9.LabelProp = "Sequenceur Son"; - this.GtkLabel9.UseMarkup = true; - this.frame1.LabelWidget = this.GtkLabel9; + this.titreLabel = new global::Gtk.Label (); + this.titreLabel.Name = "titreLabel"; + this.titreLabel.LabelProp = "Sequenceur Son"; + this.titreLabel.UseMarkup = true; + this.frame1.LabelWidget = this.titreLabel; this.Add (this.frame1); if ((this.Child != null)) { this.Child.ShowAll ();