This commit is contained in:
tzim 2014-12-02 23:45:58 +00:00
parent 6fe272c32e
commit 46afd98e9b
4 changed files with 51 additions and 20 deletions

View file

@ -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)

View file

@ -49,7 +49,8 @@ namespace DMX2
delegate void Task ();
Queue<Task> taskQueue = new Queue<Task>();
System.Collections.Concurrent.ConcurrentQueue<Task> taskQueue =
new System.Collections.Concurrent.ConcurrentQueue<Task>();
TimeSpan fading=TimeSpan.Zero;
TimeSpan fadeLen;
@ -107,7 +108,6 @@ 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;
});
@ -163,7 +163,6 @@ namespace DMX2
{
if(element == null)return;
if(element.CurrentState != Gst.State.Paused && element.CurrentState != Gst.State.Playing){
lock(this)
taskQueue.Enqueue(delegate(){
Play();
});
@ -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){

View file

@ -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 ();

View file

@ -3842,7 +3842,7 @@ trames DMX (ms)</property>
<property name="MemberName" />
<property name="CanFocus">True</property>
<property name="Type">TextOnly</property>
<property name="Label" translatable="yes">GoTo</property>
<property name="Label" translatable="yes">Cmd</property>
<property name="UseUnderline">True</property>
<signal name="Clicked" handler="OnBtnGotoClicked" />
</widget>
@ -3896,7 +3896,7 @@ trames DMX (ms)</property>
<property name="ShowArrow">False</property>
<property name="ButtonStyle">Icons</property>
<property name="IconSize">SmallToolbar</property>
<node name="__gtksharp_92_Stetic_Editor_ActionToolbar" type="Toolbar">
<node name="toolbar4" type="Toolbar">
<node type="Toolitem" action="closeAction1" />
<node type="Toolitem" action="actAddFile" />
<node type="Toolitem" action="actDelFile" />
@ -3936,6 +3936,22 @@ trames DMX (ms)</property>
<property name="AutoSize">True</property>
</packing>
</child>
<child>
<widget class="Gtk.Label" id="label1">
<property name="MemberName" />
<property name="Xalign">0</property>
<property name="LabelProp" translatable="yes">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)</property>
<property name="UseMarkup">True</property>
</widget>
<packing>
<property name="Position">2</property>
<property name="AutoSize">False</property>
<property name="Expand">False</property>
<property name="Fill">False</property>
</packing>
</child>
</widget>
</child>
</widget>