This commit is contained in:
tzim 2014-12-03 09:10:59 +00:00
parent b50a8301b4
commit 0792524222
2 changed files with 15 additions and 16 deletions

View file

@ -75,6 +75,7 @@ namespace DMX2
} }
set { set {
if(value>=0 && value< files.Count) if(value>=0 && value< files.Count)
lock(this)
LoadFile(value); LoadFile(value);
} }
} }
@ -100,8 +101,7 @@ namespace DMX2
public TimeSpan PlayTime { public TimeSpan PlayTime {
get{ get{
if(element==null) return TimeSpan.Zero; if(element==null) return TimeSpan.Zero;
Gst.Format format = Gst.Format.Time ; Gst.Format format = Gst.Format.Time ; long cur;
long cur;
element.QueryPosition(ref format, out cur); element.QueryPosition(ref format, out cur);
return TimeSpan.FromMilliseconds(cur/1000000); return TimeSpan.FromMilliseconds(cur/1000000);
} }
@ -136,7 +136,6 @@ namespace DMX2
public void DelFile (int pos) public void DelFile (int pos)
{ {
lock (this) { lock (this) {
files.RemoveAt (pos); files.RemoveAt (pos);
CommandRemove(pos); CommandRemove(pos);
} }
@ -171,11 +170,13 @@ namespace DMX2
element.SetState(Gst.State.Playing); element.SetState(Gst.State.Playing);
} }
public void Pause () public void Pause ()
{ {
if(element == null)return; if(element == null)return;
element.SetState(Gst.State.Paused); element.SetState(Gst.State.Paused);
} }
public void Stop () public void Stop ()
{ {
if(element == null)return; if(element == null)return;
@ -192,7 +193,6 @@ namespace DMX2
gsinit=true; gsinit=true;
string[] args = new string[] {"--gst-disable-segtrap"}; string[] args = new string[] {"--gst-disable-segtrap"};
Gst.Application.Init("dmx2", ref args ); Gst.Application.Init("dmx2", ref args );
} }
public SequenceurSon () public SequenceurSon ()
@ -215,6 +215,7 @@ namespace DMX2
{ {
ui=null; ui=null;
} }
public override int ValeurCircuit (Circuit c) public override int ValeurCircuit (Circuit c)
{ {
return 0; return 0;
@ -222,11 +223,11 @@ namespace DMX2
public override void Tick (TimeSpan time) 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) if (element.CurrentState == Gst.State.Paused || element.CurrentState == Gst.State.Playing)
{ {
Task t; Task t;
while(taskQueue.TryDequeue(out t)) t(); if(taskQueue.TryDequeue(out t)) t();
} }
} }
if (fading != TimeSpan.Zero) { if (fading != TimeSpan.Zero) {
@ -237,8 +238,7 @@ namespace DMX2
} }
else{ else{
Volume = (uint)( Volume = (uint)(
fadeVEnd + fadeVEnd + (fadeVStart-fadeVEnd) *
(fadeVStart-fadeVEnd) *
fading.TotalMilliseconds / fadeLen.TotalMilliseconds); fading.TotalMilliseconds / fadeLen.TotalMilliseconds);
} }
@ -310,7 +310,6 @@ namespace DMX2
} }
if (cmd.Groups ["goto"].Success) { if (cmd.Groups ["goto"].Success) {
string[] formats = new string[]{ string[] formats = new string[]{
@"m\:s\.f", @"m\:s", @"h\:m\:s",@"h\:m\:s\.f" @"m\:s\.f", @"m\:s", @"h\:m\:s",@"h\:m\:s\.f"

View file

@ -44,7 +44,7 @@ namespace DMX2
private global::Gtk.ScrolledWindow GtkScrolledWindow; private global::Gtk.ScrolledWindow GtkScrolledWindow;
private global::Gtk.NodeView listFiles; private global::Gtk.NodeView listFiles;
private global::Gtk.Label label1; private global::Gtk.Label label1;
private global::Gtk.Label GtkLabel9; private global::Gtk.Label titreLabel;
protected virtual void Build () protected virtual void Build ()
{ {
@ -421,11 +421,11 @@ namespace DMX2
w81.Fill = false; w81.Fill = false;
this.GtkAlignment.Add (this.vbox2); this.GtkAlignment.Add (this.vbox2);
this.frame1.Add (this.GtkAlignment); this.frame1.Add (this.GtkAlignment);
this.GtkLabel9 = new global::Gtk.Label (); this.titreLabel = new global::Gtk.Label ();
this.GtkLabel9.Name = "GtkLabel9"; this.titreLabel.Name = "titreLabel";
this.GtkLabel9.LabelProp = "Sequenceur Son"; this.titreLabel.LabelProp = "Sequenceur Son";
this.GtkLabel9.UseMarkup = true; this.titreLabel.UseMarkup = true;
this.frame1.LabelWidget = this.GtkLabel9; this.frame1.LabelWidget = this.titreLabel;
this.Add (this.frame1); this.Add (this.frame1);
if ((this.Child != null)) { if ((this.Child != null)) {
this.Child.ShowAll (); this.Child.ShowAll ();