This commit is contained in:
manu 2013-11-03 17:30:39 +00:00
parent fcec24d461
commit 2f464e2d77
2 changed files with 53 additions and 76 deletions

View file

@ -102,6 +102,7 @@ namespace DMX2
} }
TimeSpan timeStamp = TimeSpan.Zero; TimeSpan timeStamp = TimeSpan.Zero;
TimeSpan tempsTransition = TimeSpan.Zero;
List<Circuit> circuitsSeq = new List<Circuit> (); List<Circuit> circuitsSeq = new List<Circuit> ();
List<Effet> effets = new List<Effet> (); List<Effet> effets = new List<Effet> ();
Effet effetcourrant = null; Effet effetcourrant = null;
@ -229,8 +230,8 @@ namespace DMX2
timeStamp += time; timeStamp += time;
if (enTransition) { if (enTransition) {
if (timeStamp < effetcourrant.Transition) { if (timeStamp < tempsTransition) {
double progression = timeStamp.TotalMilliseconds / effetcourrant.Transition.TotalMilliseconds; double progression = timeStamp.TotalMilliseconds / tempsTransition.TotalMilliseconds;
foreach (Circuit c in circuitsSeq) { foreach (Circuit c in circuitsSeq) {
if (valeurscourantes [c] != effetcourrant [c] && !valeurschangees.ContainsKey (c)) { if (valeurscourantes [c] != effetcourrant [c] && !valeurschangees.ContainsKey (c)) {
valeurscourantes [c] = (int)(progression * (effetcourrant [c] - valeursinitiales [c]) + valeursinitiales [c]); valeurscourantes [c] = (int)(progression * (effetcourrant [c] - valeursinitiales [c]) + valeursinitiales [c]);
@ -280,6 +281,7 @@ namespace DMX2
effetcourrant = effets [index]; effetcourrant = effets [index];
valeurschangees.Clear (); valeurschangees.Clear ();
valeursinitiales = new Dictionary<Circuit, int> (valeurscourantes); valeursinitiales = new Dictionary<Circuit, int> (valeurscourantes);
tempsTransition = effetcourrant.Transition;
enTransition = true; enTransition = true;
timeStamp = TimeSpan.Zero; timeStamp = TimeSpan.Zero;
if (ui != null) if (ui != null)
@ -433,7 +435,7 @@ namespace DMX2
if (cmd.Groups ["transition"].Success) { if (cmd.Groups ["transition"].Success) {
int transition = int.Parse (cmd.Groups ["transition"].Value); int transition = int.Parse (cmd.Groups ["transition"].Value);
effetcourrant = new Effet ("", effetcourrant.Valeurs, effetcourrant.Duree, TimeSpan.FromMilliseconds (transition * 100)); tempsTransition = TimeSpan.FromMilliseconds( transition *100);
} }
} }
} }

View file

@ -31,7 +31,6 @@ namespace DMX2
private global::Gtk.Button btnRetireLigne; private global::Gtk.Button btnRetireLigne;
private global::Gtk.ToggleButton btnBlackOut; private global::Gtk.ToggleButton btnBlackOut;
private global::Gtk.ToggleButton btnPause; private global::Gtk.ToggleButton btnPause;
private global::Gtk.ToggleButton togglebutton3;
private global::Gtk.Label timeLabel; private global::Gtk.Label timeLabel;
private global::Gtk.VScale masterScale; private global::Gtk.VScale masterScale;
private global::Gtk.VSeparator vseparator1; private global::Gtk.VSeparator vseparator1;
@ -268,30 +267,6 @@ namespace DMX2
w55.Expand = false; w55.Expand = false;
w55.Fill = false; w55.Fill = false;
// Container child vbox2.Gtk.Box+BoxChild // Container child vbox2.Gtk.Box+BoxChild
this.togglebutton3 = new global::Gtk.ToggleButton ();
this.togglebutton3.CanFocus = true;
this.togglebutton3.Name = "togglebutton3";
this.togglebutton3.UseUnderline = true;
// Container child togglebutton3.Gtk.Container+ContainerChild
global::Gtk.Alignment w56 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F);
// Container child GtkAlignment.Gtk.Container+ContainerChild
global::Gtk.HBox w57 = new global::Gtk.HBox ();
w57.Spacing = 2;
// Container child GtkHBox.Gtk.Container+ContainerChild
global::Gtk.Image w58 = new global::Gtk.Image ();
w58.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-justify-fill", global::Gtk.IconSize.Dnd);
w57.Add (w58);
// Container child GtkHBox.Gtk.Container+ContainerChild
global::Gtk.Label w60 = new global::Gtk.Label ();
w57.Add (w60);
w56.Add (w57);
this.togglebutton3.Add (w56);
this.vbox2.Add (this.togglebutton3);
global::Gtk.Box.BoxChild w64 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.togglebutton3]));
w64.Position = 6;
w64.Expand = false;
w64.Fill = false;
// Container child vbox2.Gtk.Box+BoxChild
this.timeLabel = new global::Gtk.Label (); this.timeLabel = new global::Gtk.Label ();
this.timeLabel.Name = "timeLabel"; this.timeLabel.Name = "timeLabel";
this.timeLabel.LabelProp = global::Mono.Unix.Catalog.GetString ("<big>0.00</big>"); this.timeLabel.LabelProp = global::Mono.Unix.Catalog.GetString ("<big>0.00</big>");
@ -299,11 +274,11 @@ namespace DMX2
this.timeLabel.Justify = ((global::Gtk.Justification)(2)); this.timeLabel.Justify = ((global::Gtk.Justification)(2));
this.timeLabel.Angle = 90; this.timeLabel.Angle = 90;
this.vbox2.Add (this.timeLabel); this.vbox2.Add (this.timeLabel);
global::Gtk.Box.BoxChild w65 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.timeLabel])); global::Gtk.Box.BoxChild w56 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.timeLabel]));
w65.Position = 7; w56.Position = 6;
w65.Expand = false; w56.Expand = false;
w65.Fill = false; w56.Fill = false;
w65.Padding = ((uint)(10)); w56.Padding = ((uint)(10));
// Container child vbox2.Gtk.Box+BoxChild // Container child vbox2.Gtk.Box+BoxChild
this.masterScale = new global::Gtk.VScale (null); this.masterScale = new global::Gtk.VScale (null);
this.masterScale.HeightRequest = 75; this.masterScale.HeightRequest = 75;
@ -317,21 +292,21 @@ namespace DMX2
this.masterScale.Digits = 0; this.masterScale.Digits = 0;
this.masterScale.ValuePos = ((global::Gtk.PositionType)(2)); this.masterScale.ValuePos = ((global::Gtk.PositionType)(2));
this.vbox2.Add (this.masterScale); this.vbox2.Add (this.masterScale);
global::Gtk.Box.BoxChild w66 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.masterScale])); global::Gtk.Box.BoxChild w57 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.masterScale]));
w66.Position = 8; w57.Position = 7;
this.hbox1.Add (this.vbox2); this.hbox1.Add (this.vbox2);
global::Gtk.Box.BoxChild w67 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.vbox2])); global::Gtk.Box.BoxChild w58 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.vbox2]));
w67.Position = 0; w58.Position = 0;
w67.Expand = false; w58.Expand = false;
w67.Fill = false; w58.Fill = false;
// Container child hbox1.Gtk.Box+BoxChild // Container child hbox1.Gtk.Box+BoxChild
this.vseparator1 = new global::Gtk.VSeparator (); this.vseparator1 = new global::Gtk.VSeparator ();
this.vseparator1.Name = "vseparator1"; this.vseparator1.Name = "vseparator1";
this.hbox1.Add (this.vseparator1); this.hbox1.Add (this.vseparator1);
global::Gtk.Box.BoxChild w68 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.vseparator1])); global::Gtk.Box.BoxChild w59 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.vseparator1]));
w68.Position = 1; w59.Position = 1;
w68.Expand = false; w59.Expand = false;
w68.Fill = false; w59.Fill = false;
// Container child hbox1.Gtk.Box+BoxChild // Container child hbox1.Gtk.Box+BoxChild
this.hpaned1 = new global::Gtk.HPaned (); this.hpaned1 = new global::Gtk.HPaned ();
this.hpaned1.CanFocus = true; this.hpaned1.CanFocus = true;
@ -352,8 +327,8 @@ namespace DMX2
this.MatriceUI.Name = "MatriceUI"; this.MatriceUI.Name = "MatriceUI";
this.GtkScrolledWindow2.Add (this.MatriceUI); this.GtkScrolledWindow2.Add (this.MatriceUI);
this.hpaned2.Add (this.GtkScrolledWindow2); this.hpaned2.Add (this.GtkScrolledWindow2);
global::Gtk.Paned.PanedChild w70 = ((global::Gtk.Paned.PanedChild)(this.hpaned2 [this.GtkScrolledWindow2])); global::Gtk.Paned.PanedChild w61 = ((global::Gtk.Paned.PanedChild)(this.hpaned2 [this.GtkScrolledWindow2]));
w70.Resize = false; w61.Resize = false;
// Container child hpaned2.Gtk.Paned+PanedChild // Container child hpaned2.Gtk.Paned+PanedChild
this.onglets = new global::Gtk.Notebook (); this.onglets = new global::Gtk.Notebook ();
this.onglets.CanFocus = true; this.onglets.CanFocus = true;
@ -361,8 +336,8 @@ namespace DMX2
this.onglets.CurrentPage = 1; this.onglets.CurrentPage = 1;
this.hpaned2.Add (this.onglets); this.hpaned2.Add (this.onglets);
this.hpaned1.Add (this.hpaned2); this.hpaned1.Add (this.hpaned2);
global::Gtk.Paned.PanedChild w72 = ((global::Gtk.Paned.PanedChild)(this.hpaned1 [this.hpaned2])); global::Gtk.Paned.PanedChild w63 = ((global::Gtk.Paned.PanedChild)(this.hpaned1 [this.hpaned2]));
w72.Resize = false; w63.Resize = false;
// Container child hpaned1.Gtk.Paned+PanedChild // Container child hpaned1.Gtk.Paned+PanedChild
this.scrolledwindow2 = new global::Gtk.ScrolledWindow (); this.scrolledwindow2 = new global::Gtk.ScrolledWindow ();
this.scrolledwindow2.WidthRequest = 150; this.scrolledwindow2.WidthRequest = 150;
@ -370,32 +345,32 @@ namespace DMX2
this.scrolledwindow2.Name = "scrolledwindow2"; this.scrolledwindow2.Name = "scrolledwindow2";
this.scrolledwindow2.ShadowType = ((global::Gtk.ShadowType)(1)); this.scrolledwindow2.ShadowType = ((global::Gtk.ShadowType)(1));
// Container child scrolledwindow2.Gtk.Container+ContainerChild // Container child scrolledwindow2.Gtk.Container+ContainerChild
global::Gtk.Viewport w73 = new global::Gtk.Viewport (); global::Gtk.Viewport w64 = new global::Gtk.Viewport ();
w73.ShadowType = ((global::Gtk.ShadowType)(0)); w64.ShadowType = ((global::Gtk.ShadowType)(0));
// Container child GtkViewport1.Gtk.Container+ContainerChild // Container child GtkViewport1.Gtk.Container+ContainerChild
this.vboxCircuits = new global::Gtk.VBox (); this.vboxCircuits = new global::Gtk.VBox ();
this.vboxCircuits.Name = "vboxCircuits"; this.vboxCircuits.Name = "vboxCircuits";
this.vboxCircuits.Spacing = 2; this.vboxCircuits.Spacing = 2;
w73.Add (this.vboxCircuits); w64.Add (this.vboxCircuits);
this.scrolledwindow2.Add (w73); this.scrolledwindow2.Add (w64);
this.hpaned1.Add (this.scrolledwindow2); this.hpaned1.Add (this.scrolledwindow2);
global::Gtk.Paned.PanedChild w76 = ((global::Gtk.Paned.PanedChild)(this.hpaned1 [this.scrolledwindow2])); global::Gtk.Paned.PanedChild w67 = ((global::Gtk.Paned.PanedChild)(this.hpaned1 [this.scrolledwindow2]));
w76.Resize = false; w67.Resize = false;
w76.Shrink = false; w67.Shrink = false;
this.hbox1.Add (this.hpaned1); this.hbox1.Add (this.hpaned1);
global::Gtk.Box.BoxChild w77 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.hpaned1])); global::Gtk.Box.BoxChild w68 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.hpaned1]));
w77.Position = 2; w68.Position = 2;
this.vbox1.Add (this.hbox1); this.vbox1.Add (this.hbox1);
global::Gtk.Box.BoxChild w78 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.hbox1])); global::Gtk.Box.BoxChild w69 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.hbox1]));
w78.Position = 0; w69.Position = 0;
// Container child vbox1.Gtk.Box+BoxChild // Container child vbox1.Gtk.Box+BoxChild
this.hseparator1 = new global::Gtk.HSeparator (); this.hseparator1 = new global::Gtk.HSeparator ();
this.hseparator1.Name = "hseparator1"; this.hseparator1.Name = "hseparator1";
this.vbox1.Add (this.hseparator1); this.vbox1.Add (this.hseparator1);
global::Gtk.Box.BoxChild w79 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.hseparator1])); global::Gtk.Box.BoxChild w70 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.hseparator1]));
w79.Position = 1; w70.Position = 1;
w79.Expand = false; w70.Expand = false;
w79.Fill = false; w70.Fill = false;
// Container child vbox1.Gtk.Box+BoxChild // Container child vbox1.Gtk.Box+BoxChild
this.hbox4 = new global::Gtk.HBox (); this.hbox4 = new global::Gtk.HBox ();
this.hbox4.Name = "hbox4"; this.hbox4.Name = "hbox4";
@ -406,17 +381,17 @@ namespace DMX2
this.toolbar7.Name = "toolbar7"; this.toolbar7.Name = "toolbar7";
this.toolbar7.ShowArrow = false; this.toolbar7.ShowArrow = false;
this.hbox4.Add (this.toolbar7); this.hbox4.Add (this.toolbar7);
global::Gtk.Box.BoxChild w80 = ((global::Gtk.Box.BoxChild)(this.hbox4 [this.toolbar7])); global::Gtk.Box.BoxChild w71 = ((global::Gtk.Box.BoxChild)(this.hbox4 [this.toolbar7]));
w80.Position = 0; w71.Position = 0;
w80.Expand = false; w71.Expand = false;
w80.Fill = false; w71.Fill = false;
// Container child hbox4.Gtk.Box+BoxChild // Container child hbox4.Gtk.Box+BoxChild
this.fixed5 = new global::Gtk.Fixed (); this.fixed5 = new global::Gtk.Fixed ();
this.fixed5.Name = "fixed5"; this.fixed5.Name = "fixed5";
this.fixed5.HasWindow = false; this.fixed5.HasWindow = false;
this.hbox4.Add (this.fixed5); this.hbox4.Add (this.fixed5);
global::Gtk.Box.BoxChild w81 = ((global::Gtk.Box.BoxChild)(this.hbox4 [this.fixed5])); global::Gtk.Box.BoxChild w72 = ((global::Gtk.Box.BoxChild)(this.hbox4 [this.fixed5]));
w81.Position = 1; w72.Position = 1;
// Container child hbox4.Gtk.Box+BoxChild // Container child hbox4.Gtk.Box+BoxChild
this.UIManager.AddUiFromString ("<ui><toolbar name='toolbar8'><toolitem name='newAction' action='newAction'/><toolitem name='openAction' action='openAction'/><toolitem name='saveAction' action='saveAction'/><toolitem name='saveAsAction' action='saveAsAction'/><toolitem name='closeAction' action='closeAction'/><toolitem name='quitAction' action='quitAction'/></toolbar></ui>"); this.UIManager.AddUiFromString ("<ui><toolbar name='toolbar8'><toolitem name='newAction' action='newAction'/><toolitem name='openAction' action='openAction'/><toolitem name='saveAction' action='saveAction'/><toolitem name='saveAsAction' action='saveAsAction'/><toolitem name='closeAction' action='closeAction'/><toolitem name='quitAction' action='quitAction'/></toolbar></ui>");
this.toolbar8 = ((global::Gtk.Toolbar)(this.UIManager.GetWidget ("/toolbar8"))); this.toolbar8 = ((global::Gtk.Toolbar)(this.UIManager.GetWidget ("/toolbar8")));
@ -424,15 +399,15 @@ namespace DMX2
this.toolbar8.ShowArrow = false; this.toolbar8.ShowArrow = false;
this.toolbar8.ToolbarStyle = ((global::Gtk.ToolbarStyle)(0)); this.toolbar8.ToolbarStyle = ((global::Gtk.ToolbarStyle)(0));
this.hbox4.Add (this.toolbar8); this.hbox4.Add (this.toolbar8);
global::Gtk.Box.BoxChild w82 = ((global::Gtk.Box.BoxChild)(this.hbox4 [this.toolbar8])); global::Gtk.Box.BoxChild w73 = ((global::Gtk.Box.BoxChild)(this.hbox4 [this.toolbar8]));
w82.Position = 2; w73.Position = 2;
w82.Expand = false; w73.Expand = false;
w82.Fill = false; w73.Fill = false;
this.vbox1.Add (this.hbox4); this.vbox1.Add (this.hbox4);
global::Gtk.Box.BoxChild w83 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.hbox4])); global::Gtk.Box.BoxChild w74 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.hbox4]));
w83.Position = 2; w74.Position = 2;
w83.Expand = false; w74.Expand = false;
w83.Fill = false; w74.Fill = false;
this.Add (this.vbox1); this.Add (this.vbox1);
if ((this.Child != null)) { if ((this.Child != null)) {
this.Child.ShowAll (); this.Child.ShowAll ();