diff --git a/DMX-2.0/SeqOscUI.cs b/DMX-2.0/SeqOscUI.cs
new file mode 100644
index 0000000..6cbce26
--- /dev/null
+++ b/DMX-2.0/SeqOscUI.cs
@@ -0,0 +1,341 @@
+/*
+
+ Copyright (C) Arnaud Houdelette 2012-2014
+ Copyright (C) Emmanuel Langlois 2012-2014
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+using System;
+using System.Collections.Generic;
+using Gtk;
+using System.Text;
+
+namespace DMX2
+{
+ [System.ComponentModel.ToolboxItem(true)]
+ public partial class SeqOscUI : SequenceurUI
+ {
+ bool fullUpdFlag = true;
+ bool updating;
+ SequenceurOSC sequenceur; /* pointe sur les données */
+ ListStore lsEffets=null; /* liste des effets */
+ //TreeViewColumn nomCol; /* inutile dans le contexte macro */
+
+ bool effetChange = false;
+ public void EffetChange ()
+ {
+ effetChange = true;
+ }
+
+ DateTime nextMaj = DateTime.Now;
+
+ void RenamePopup (object sender, ContextMenuEventArgs e)
+ {
+ Menu m = new Menu();
+ MenuItem renameItem = new MenuItem("Renommer le Sequenceur");
+ renameItem.ButtonPressEvent += new ButtonPressEventHandler(OnRenameItemButtonPressed);
+ m.Add(renameItem);
+ m.ShowAll();
+ m.Popup();
+ }
+
+
+ void OnRenameItemButtonPressed (object o, ButtonPressEventArgs args)
+ {
+ var dlg = new Dialog ("Nouveau Nom ?", GetAncestor(Gtk.Window.GType) as Gtk.Window , DialogFlags.Modal); var entry = new Entry (sequenceur.Name);
+ dlg.AddButton (Stock.Ok, ResponseType.Ok).GrabDefault(); dlg.AddButton (Stock.Cancel, ResponseType.Cancel);
+ dlg.VBox.Add (entry); dlg.VBox.ShowAll ();
+ entry.ActivatesDefault=true;
+
+ if ((ResponseType)dlg.Run () == ResponseType.Ok) {
+ sequenceur.Name = entry.Text;
+ titreLabel.Text = sequenceur.Name;
+ }
+ dlg.Destroy();
+ }
+
+#region construction et gestion de la matrice d'affichage
+ protected void ConstruitMatrice () /* Matrice d'affichage des effets de la macro */
+ {
+
+ cmdList.EnableGridLines= TreeViewGridLines.Both;
+
+ var idCol = new Gtk.TreeViewColumn ();
+ var idCell = new Gtk.CellRendererText ();
+
+ idCol.Title = "Num";
+ idCol.PackStart (idCell, true);
+ idCol.SetCellDataFunc (idCell, new Gtk.TreeCellDataFunc (RenderMatriceNum));
+ cmdList.AppendColumn (idCol);
+
+
+ var nomCol = new Gtk.TreeViewColumn ();
+ var nomCell = new Gtk.CellRendererText ();
+ nomCol.Title = "Nom";
+ nomCol.PackStart (nomCell, true);
+ nomCol.SetCellDataFunc (nomCell, new Gtk.TreeCellDataFunc (RenderMatriceNom));
+ nomCol.Resizable = true;
+ nomCell.Editable = true;
+ nomCell.Edited += OnNomCellEdited;
+ cmdList.AppendColumn (nomCol);
+
+ var topCol = new Gtk.TreeViewColumn ();
+ var topCell = new Gtk.CellRendererText ();
+ topCol.Title = "Top";
+ topCol.PackStart (topCell, true);
+ topCol.SetCellDataFunc (topCell, new Gtk.TreeCellDataFunc (RenderMatriceTop));
+ topCell.Editable = true;
+ topCell.Edited += OnTopCellEdited;
+ cmdList.AppendColumn (topCol);
+
+ var cmdCol = new Gtk.TreeViewColumn ();
+ var cmdCell = new Gtk.CellRendererText ();
+ cmdCol.Title = "Commande OSC";
+ cmdCol.PackStart (cmdCell, true);
+ cmdCol.SetCellDataFunc (cmdCell, new TreeCellDataFunc (RenderMatriceCmd));
+ cmdCell.Editable = true;
+ cmdCell.Edited += OnCmdCellEdited;
+ cmdList.AppendColumn (cmdCol);
+
+ lsEffets = new Gtk.ListStore(typeof (SequenceurOSC.Ligne));
+ this.cmdList.Model = lsEffets;
+ UpdListeEffets();
+ }
+
+ void RenderMatriceNum (TreeViewColumn tree_column, CellRenderer cell, TreeModel tree_model, TreeIter iter)
+ {
+ if (Conduite.Courante==null) return;
+ string num=string.Empty;
+ SequenceurOSC.Ligne l = tree_model.GetValue (iter, 0) as SequenceurOSC.Ligne;
+ if( sequenceur.IndexLigneEnCours == sequenceur.Lignes.IndexOf(l) )
+ num+= "->";
+ if( sequenceur.IndexLigneaSuivre == sequenceur.Lignes.IndexOf(l) )
+ num+= "* ";
+ (cell as Gtk.CellRendererText).Text = num + (sequenceur.Lignes.IndexOf(l)+1).ToString();
+
+ }
+
+ void RenderMatriceNom (TreeViewColumn tree_column, CellRenderer cell, TreeModel tree_model, TreeIter iter)
+ {
+ if (Conduite.Courante==null) return;
+ SequenceurOSC.Ligne l = tree_model.GetValue (iter, 0) as SequenceurOSC.Ligne;
+ (cell as Gtk.CellRendererText).Text = l.Nom;
+ }
+
+ void RenderMatriceTop (TreeViewColumn tree_column, CellRenderer cell, TreeModel tree_model, TreeIter iter)
+ {
+ if (Conduite.Courante==null) return;
+ SequenceurOSC.Ligne l = tree_model.GetValue (iter, 0) as SequenceurOSC.Ligne;
+ if (l.Top< TimeSpan.Zero) (cell as Gtk.CellRendererText).Text = string.Empty;
+ else (cell as Gtk.CellRendererText).Text = (l.Top.TotalMilliseconds /100).ToString();
+ }
+
+ void RenderMatriceCmd (TreeViewColumn tree_column, CellRenderer cell, TreeModel tree_model, TreeIter iter)
+ {
+ if (Conduite.Courante==null) return;
+ SequenceurOSC.Ligne l = tree_model.GetValue (iter, 0) as SequenceurOSC.Ligne;
+ (cell as Gtk.CellRendererText).Text = l.Commande;
+ }
+
+ void OnNomCellEdited (object o, EditedArgs args)
+ {
+ Gtk.TreeIter iter;
+ lsEffets.GetIter (out iter, new Gtk.TreePath (args.Path));
+ SequenceurOSC.Ligne l = lsEffets.GetValue(iter,0) as SequenceurOSC.Ligne;
+ l.Nom = args.NewText;
+ }
+
+ void OnTopCellEdited (object o, EditedArgs args)
+ {
+ Gtk.TreeIter iter;
+ lsEffets.GetIter (out iter, new Gtk.TreePath (args.Path));
+ SequenceurOSC.Ligne l = lsEffets.GetValue (iter, 0) as SequenceurOSC.Ligne;
+ if (args.NewText.Length == 0)
+ l.Top = TimeSpan.MinValue;
+ else {
+ int val;
+ if(int.TryParse(args.NewText, out val))
+ l.Top = TimeSpan.FromMilliseconds(val *100);
+ }
+ }
+
+ void OnCmdCellEdited (object o, EditedArgs args)
+ {
+ Gtk.TreeIter iter;
+ lsEffets.GetIter (out iter, new Gtk.TreePath (args.Path));
+ SequenceurOSC.Ligne l = lsEffets.GetValue(iter,0) as SequenceurOSC.Ligne;
+ l.Commande = args.NewText;
+ }
+
+ void UpdListeEffets ()
+ {
+ lsEffets.Clear();
+ foreach (var ligne in sequenceur.Lignes) {
+ lsEffets.AppendValues(ligne);
+ }
+ }
+
+#endregion
+
+ public SeqOscUI (SequenceurOSC s ) : base (s)
+ {
+ this.Build ();
+ titreLabel.Text = s.Name;
+ sequenceur = s;
+ ConstruitMatrice ();
+
+
+ new ContextMenuHelper(frame1,RenamePopup);
+ new ContextMenuHelper(evBBox,CompteurPopup);
+
+
+ }
+
+
+
+ void CompteurPopup (object sender, ContextMenuEventArgs e)
+ {
+ Menu m = new Menu();
+
+ MenuItem item = new MenuItem("Effet Suivant");
+ m.Add(item);
+ item.Submenu = Conduite.Courante.EventManager.GetMenu(null,
+ delegate(object o,string eventId){
+ sequenceur.BindEffetSuivantEvent(eventId);
+ }
+ );
+
+ item = new MenuItem("Effet Precedent");
+ m.Add(item);
+ item.Submenu = Conduite.Courante.EventManager.GetMenu(null,
+ delegate(object o,string eventId){
+ sequenceur.BindEffetPrecedentEvent(eventId);
+ }
+ );
+
+ m.ShowAll();
+ m.Popup();
+
+ }
+
+
+ public override void Update (bool full)
+ {
+ if (fullUpdFlag || full)
+ FullUpdate ();
+ // UpdateValues (); inutil dans le contexte
+ timeLabel.LabelProp = string.Format (@"{0:0\.0}", sequenceur.TimeStamp.TotalMilliseconds / 100);
+
+ if (effetChange) {
+ //UpdListeEffets();
+ cmdList.QueueDraw();
+ SelectionneEffet (sequenceur.IndexLigneEnCours);
+ posLabel.Text = string.Format("n°{0}",sequenceur.IndexLigneEnCours +1 );
+ }
+
+ if (DateTime.Now > nextMaj ) {
+ nextMaj = DateTime.Now.AddMilliseconds(500);
+ StringBuilder str = new StringBuilder ();
+ actLabel.LabelProp = str.ToString ();
+ }
+ }
+
+
+ void SelectionneEffet (int index)
+ {
+ if(index <0 ) return;
+ cmdList.SetCursor( new TreePath( new int[1] {index }) ,null,false);
+ effetChange = false;
+ }
+
+ protected void OnCloseActionActivated (object sender, EventArgs e)
+ {
+ this.Destroy();
+ }
+
+ protected void FullUpdate ()
+ {
+ fullUpdFlag = true;
+
+ posLabel.Text = string.Format("n°{0}",sequenceur.IndexLigneEnCours +1);
+
+ fullUpdFlag=false;
+ }
+
+ int IndexEffetSelectionne()
+ {
+ var sel = cmdList.Selection.GetSelectedRows();
+ if(sel.Length ==0) return -1;
+ return cmdList.Selection.GetSelectedRows()[0].Indices[0];
+ }
+
+ protected void OnGoForwardActionActivated (object sender, EventArgs e)
+ {
+ sequenceur.LigneSuivante();
+ }
+
+ protected void OnGoBackActionActivated (object sender, EventArgs e)
+ {
+ if (sequenceur.IndexLigneEnCours > 0) {
+ sequenceur.IndexLigneaSuivre = sequenceur.IndexLigneEnCours - 1;
+ sequenceur.LigneSuivante ();
+ }
+ }
+
+ protected void OnMediaPauseActionActivated (object sender, EventArgs e)
+ {
+ sequenceur.Paused = ! sequenceur.Paused;
+ }
+
+ protected void OnBtnAjoutLigneActivated (object sender, EventArgs e)
+ {
+ int pos=IndexEffetSelectionne() + 1;
+ sequenceur.AjoutLigne(pos);
+ UpdListeEffets();
+ cmdList.SetCursor( new TreePath( new int[1] {pos }) , cmdList.Columns[1] ,true);
+ }
+
+ protected void OnRemoveLigneActivated (object sender, EventArgs e)
+ {
+ int pos = IndexEffetSelectionne();
+ if (pos==-1) return;
+ sequenceur.RetireLigne(pos);
+ UpdListeEffets();
+ }
+
+ protected void OnCmdListeCursorChanged (object sender, EventArgs e)
+ {
+ if(effetChange) return;
+ TreeViewColumn col;
+ TreePath path;
+ cmdList.GetCursor (out path, out col);
+
+ if (cmdList.Columns [0] == col) {
+ sequenceur.IndexLigneaSuivre = IndexEffetSelectionne();
+ }
+ }
+
+
+
+
+
+ protected void OnHbox2SizeAllocated (object o, SizeAllocatedArgs args)
+ {
+ actLabel.SetSizeRequest ( Math.Max(50, args.Allocation.Width - posLabel.Allocation.Width - timeLabel.Allocation.Width - 50),-1);
+ }
+
+
+ }
+}
+
diff --git a/DMX-2.0/SequenceurOSC.cs b/DMX-2.0/SequenceurOSC.cs
new file mode 100644
index 0000000..5bf8ab6
--- /dev/null
+++ b/DMX-2.0/SequenceurOSC.cs
@@ -0,0 +1,484 @@
+/*
+
+ Copyright (C) Arnaud Houdelette 2012-2014
+ Copyright (C) Emmanuel Langlois 2012-2014
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+using System;
+using System.Collections.Generic;
+using System.Xml;
+using System.Collections.ObjectModel;
+using System.Threading;
+
+namespace DMX2
+{
+ public class SequenceurOSC : Sequenceur
+ {
+ public class Ligne {
+ public Ligne(){}
+ string nom = string.Empty;
+ TimeSpan top = TimeSpan.MinValue;
+
+ string commande =null;
+
+ public string Nom {
+ get {
+ return nom;
+ }
+ set {
+ nom = value;
+ }
+ }
+
+ public TimeSpan Top {
+ get {
+ return top;
+ }
+ set {
+ top = value;
+ }
+ }
+
+ public string Commande {
+ get {
+ return commande;
+ }
+ set{
+ commande = value;
+ }
+ }
+
+ public void Save (XmlElement parent)
+ {
+ XmlElement el = parent.OwnerDocument.CreateElement ("Ligne");
+ parent.AppendChild (el);
+
+ el.SetAttribute ("nom", nom);
+ el.SetAttribute ("top", top.ToString ());
+
+ el.SetAttribute ("cmd", commande);
+
+ }
+
+ public static Ligne Load (Conduite c, XmlElement el)
+ {
+ Ligne l = new Ligne();
+ l.nom = el.GetAttribute ("nom");
+ l.top = TimeSpan.Parse(el.GetAttribute("top"));
+ l.commande = el.GetAttribute ("cmd");
+
+ return l;
+ }
+ }
+
+
+
+ List lignes = new List();
+
+ Ligne aSuivre = null;
+ Ligne enCours = null;
+ Ligne ligneMaitre = null;
+
+ TimeSpan timeStamp = TimeSpan.Zero;
+ TimeSpan topSuivant = TimeSpan.Zero;
+ bool topPresent = false;
+
+ actionEventTarget goNextEventTarget=null;
+ actionEventTarget goBackEventTarget=null;
+
+
+ SeqOscUI ui = null;
+ bool change = false;
+
+ bool paused=false;
+
+ public bool Paused {
+ get {
+ return paused;
+ }
+ set {
+ paused = value;
+ }
+ }
+
+ public SequenceurOSC ()
+ {
+
+ goNextEventTarget = new actionEventTarget (
+ delegate(EventData data) {
+ if(data.value==255) LigneSuivante();
+ return true;
+ }
+ );
+
+ goBackEventTarget = new actionEventTarget (
+ delegate(EventData data) {
+ if(data.value==255){
+ if (IndexLigneEnCours > 0) {
+ IndexLigneaSuivre = IndexLigneEnCours - 1;
+ LigneSuivante ();
+ }
+ }
+ return true;
+ }
+ );
+ }
+
+
+ public int IndexLigneEnCours
+ {
+ get {
+ if (enCours == null) return -1;
+ return lignes.IndexOf(enCours);
+ }
+ }
+
+
+ public int IndexLigneaSuivre
+ {
+ get {
+ if (aSuivre == null)
+ return -1;
+ return lignes.IndexOf (aSuivre);
+ }
+ set {
+ aSuivre = lignes[value];
+ }
+ }
+
+ public int AjoutLigne (int pos)
+ {
+ lock (this) {
+ lignes.Insert (pos, new Ligne ());
+ CommandAdd(pos);
+ return pos;
+ }
+ }
+
+ public void RetireLigne (int pos)
+ {
+ lock (this) {
+ if (lignes [pos] == enCours) {
+ enCours = null;
+ if (pos + 1 < lignes.Count)
+ aSuivre = lignes [pos + 1];
+ }
+ if (lignes [pos] == aSuivre)
+ aSuivre = null;
+ lignes.RemoveAt (pos);
+ CommandRemove(pos);
+ }
+ }
+
+ public TimeSpan TimeStamp {
+ get {
+ return timeStamp;
+ }
+ }
+
+
+ public ReadOnlyCollection Lignes {
+ get {
+ return lignes.AsReadOnly();
+ }
+ }
+
+ public override int ValeurCircuit (Circuit c)
+ {
+ return 0;
+ }
+
+ public override void Tick (TimeSpan time)
+ {
+ if (paused)
+ return;
+ timeStamp += time;
+
+ if (Monitor.TryEnter (this)) {
+ try {
+ if (topPresent) {
+ if (timeStamp > topSuivant) {
+ LigneSuivante ();
+ }
+ }
+ } finally {
+ Monitor.Exit (this);
+ }
+ }
+ }
+
+ public void LigneSuivante ()
+ {
+ lock (this) {
+ if(lignes.Count==0) return;
+ int index;
+ change = true; topPresent = false;
+ if(aSuivre==null) // selection souris
+ {
+ index = IndexLigneEnCours +1; // Premier effet si aucun précédement
+ if(index>= lignes.Count) index = 0; // Boucle si arrivé à la fin
+
+ enCours = lignes[index];
+
+ // Gestion de la Reprise
+ // if(enCours.Circuits.ToLower().Equals("r") && ligneMaitre != null)
+ // enCours = ligneMaitre;
+
+ if(enCours.Nom.Length!=0)
+ {
+ ligneMaitre = enCours;
+ timeStamp = TimeSpan.Zero;
+ }
+ }
+ else
+ {
+ enCours = aSuivre;
+ ligneMaitre = enCours;
+ timeStamp = TimeSpan.Zero;
+
+ }
+ index = IndexLigneEnCours+1;
+ if(index= TimeSpan.Zero)
+ {
+ topPresent = true;
+ topSuivant= lignes[index].Top;
+ }
+ }
+ aSuivre = null;
+ LanceCommandeMidi();
+ if(ui!=null)
+ ui.EffetChange();
+ }
+ }
+
+ void LanceCommandeMidi ()
+ {
+ Console.WriteLine (enCours.Commande);
+
+ }
+
+
+
+ public bool LigneChange ()
+ {
+ if (change) {
+ change = false;
+ return true;
+ }
+ return false;
+ }
+
+ public override void Save (System.Xml.XmlElement parent)
+ {
+ System.Xml.XmlElement el = parent.OwnerDocument.CreateElement ("SequenceurOSC");
+ System.Xml.XmlElement xmlEl;
+
+ parent.AppendChild (el);
+ el.SetAttribute ("id", ID.ToString ());
+ el.SetAttribute ("name", Name);
+ //el.SetAttribute ("master", master.ToString ());
+
+ xmlEl = parent.OwnerDocument.CreateElement ("EffetSuivant");
+ if(Conduite.Courante.EventManager.SaveBindings(xmlEl,goNextEventTarget )) el.AppendChild(xmlEl);
+
+ xmlEl = parent.OwnerDocument.CreateElement ("EffetPrecedent");
+ if(Conduite.Courante.EventManager.SaveBindings(xmlEl,goBackEventTarget )) el.AppendChild(xmlEl);
+
+ foreach (Ligne li in lignes) {
+ li.Save(el);
+ }
+
+ }
+
+
+ public override SequenceurUI GetUI ()
+ {
+
+ if (ui == null) {
+ ui = new SeqOscUI (this);
+ ui.Destroyed += UiDestroyed;
+ }
+
+ return ui;
+ }
+
+ void UiDestroyed (object sender, EventArgs e)
+ {
+ ui = null;
+ }
+
+ public void BindEffetSuivantEvent (string eventId)
+ {
+ if (eventId.Length == 0) {
+ Conduite.Courante.EventManager.Unbind (goNextEventTarget);
+ return;
+ }
+ Conduite.Courante.EventManager.Bind(eventId,goNextEventTarget);
+ }
+
+ public void BindEffetPrecedentEvent (string eventId)
+ {
+ if (eventId.Length == 0) {
+ Conduite.Courante.EventManager.Unbind (goBackEventTarget);
+ return;
+ }
+ Conduite.Courante.EventManager.Bind(eventId,goBackEventTarget);
+ }
+
+
+ public static new SequenceurOSC Load (Conduite conduite, System.Xml.XmlElement el)
+ {
+ SequenceurOSC seq = new SequenceurOSC();
+ seq.LoadSeq(conduite,el);
+ return seq;
+ }
+
+ private void LoadSeq (Conduite conduite, System.Xml.XmlElement el)
+ {
+ ID = int.Parse (el.GetAttribute ("id"));
+ Name = el.GetAttribute ("name");
+
+ XmlElement xmlE;
+
+
+ if ((xmlE = el["EffetSuivant"])!= null)
+ foreach(string id in EventManager.LoadBindings(xmlE))
+ BindEffetSuivantEvent(id);
+
+ if ((xmlE = el["EffetPrecedent"])!= null)
+ foreach(string id in EventManager.LoadBindings(xmlE))
+ BindEffetPrecedentEvent(id);
+
+
+ foreach (var xe in el.GetElementsByTagName("Ligne"))
+ lignes.Add(Ligne.Load(conduite,xe as System.Xml.XmlElement));
+ }
+
+
+ static System.Text.RegularExpressions.Regex regexCommand1 = new System.Text.RegularExpressions.Regex(
+ @"(?\d+)",
+ System.Text.RegularExpressions.RegexOptions.Compiled);
+
+ static System.Text.RegularExpressions.Regex regexCommand2 = new System.Text.RegularExpressions.Regex(
+ @"(?\d+)(?(t\d+)?)?",
+ System.Text.RegularExpressions.RegexOptions.Compiled);
+
+
+
+ public override void Command (string command)
+ {
+ lock (this) {
+ var cmd = regexCommand1.Match(command);
+
+ if (cmd.Success) {
+ if (cmd.Groups ["effet"].Success) {
+ int effet = int.Parse (cmd.Groups ["effet"].Value) - 1;
+
+ if(effet>=lignes.Count) return;
+ enCours = lignes[effet];
+ ligneMaitre = enCours;
+ timeStamp = TimeSpan.Zero;
+
+ topPresent = false;
+ int index = IndexLigneEnCours+1;
+ if(index= TimeSpan.Zero)
+ {
+ topPresent = true;
+ topSuivant= lignes[index].Top;
+ }
+ }
+ aSuivre = null;
+
+ LanceCommandeMidi();
+
+ if(ui!=null) ui.EffetChange();
+
+ }
+
+ }
+ }
+ }
+
+ void CommandAdd (int index)
+ {
+ lock (Conduite.Courante.SequenceurMaitre) {
+ string[] commands = Conduite.Courante.SequenceurMaitre.GetCommands (this);
+
+ for (int i = 0; i < commands.Length; i++) {
+ var cmd = regexCommand2.Match(commands[i]);
+ if(cmd.Success){
+ int ef = int.Parse(cmd.Groups["effet"].Value);
+ if (ef-1>index) {
+ ef++;
+ commands[i] = ef.ToString() + cmd.Groups["params"].Value;
+ }
+ }
+ }
+ Conduite.Courante.SequenceurMaitre.SetCommands(this,commands);
+ }
+ }
+
+ void CommandRemove (int index)
+ {
+ lock (Conduite.Courante.SequenceurMaitre) {
+ string[] commands = Conduite.Courante.SequenceurMaitre.GetCommands (this);
+
+ for (int i = 0; i < commands.Length; i++) {
+ var cmd = regexCommand2.Match(commands[i]);
+ if(cmd.Success){
+ int ef = int.Parse(cmd.Groups["effet"].Value);
+ if (ef-1 == index)
+ commands[i] = string.Empty;
+ else if (ef-1>index) {
+ ef--;
+ commands[i] = ef.ToString() + cmd.Groups["params"].Value;
+ }
+ }
+ }
+ Conduite.Courante.SequenceurMaitre.SetCommands(this,commands);
+ }
+ }
+
+ void CommandSwap (int index)
+ {
+ lock (Conduite.Courante.SequenceurMaitre) {
+ string[] commands = Conduite.Courante.SequenceurMaitre.GetCommands (this);
+
+ // numeros a swapper
+ int a = index+1;
+ int b = index+2;
+
+ for (int i = 0; i < commands.Length; i++) {
+ var cmd = regexCommand2.Match(commands[i]);
+ if(cmd.Success){
+ int ef = int.Parse(cmd.Groups["effet"].Value);
+ if (ef == a)
+ commands[i] = b.ToString() + cmd.Groups["params"].Value;
+ if (ef == b)
+ commands[i] = a.ToString() + cmd.Groups["params"].Value;
+ }
+ }
+ Conduite.Courante.SequenceurMaitre.SetCommands(this,commands);
+ }
+ }
+
+ }
+}
diff --git a/DMX-2.0/gtk-gui/DMX2.SeqOscUI.cs b/DMX-2.0/gtk-gui/DMX2.SeqOscUI.cs
new file mode 100644
index 0000000..25e1149
--- /dev/null
+++ b/DMX-2.0/gtk-gui/DMX2.SeqOscUI.cs
@@ -0,0 +1,231 @@
+
+// This file has been generated by the GUI designer. Do not modify.
+namespace DMX2
+{
+ public partial class SeqOscUI
+ {
+ private global::Gtk.UIManager UIManager;
+
+ private global::Gtk.ToggleAction closeAction;
+
+ private global::Gtk.Action circuitsAction;
+
+ private global::Gtk.Action goForwardAction;
+
+ private global::Gtk.Action goBackAction;
+
+ private global::Gtk.Action mediaPauseAction;
+
+ private global::Gtk.Action mediaNextAction;
+
+ private global::Gtk.Action btnAjoutLigne;
+
+ private global::Gtk.Action btnRetireligne;
+
+ private global::Gtk.Action Action;
+
+ private global::Gtk.Frame frame1;
+
+ private global::Gtk.Alignment GtkAlignment;
+
+ private global::Gtk.Alignment alignment1;
+
+ private global::Gtk.VBox vbox2;
+
+ private global::Gtk.HBox hbox1;
+
+ private global::Gtk.VBox vbox3;
+
+ private global::Gtk.EventBox evBBox;
+
+ private global::Gtk.HBox hbox2;
+
+ private global::Gtk.Label posLabel;
+
+ private global::Gtk.Label actLabel;
+
+ private global::Gtk.Label timeLabel;
+
+ private global::Gtk.Toolbar toolbar;
+
+ private global::Gtk.Toolbar toolbar1;
+
+ private global::Gtk.ScrolledWindow scrolledwindow1;
+
+ private global::Gtk.TreeView cmdList;
+
+ private global::Gtk.Label titreLabel;
+
+ protected virtual void Build ()
+ {
+ global::Stetic.Gui.Initialize (this);
+ // Widget DMX2.SeqOscUI
+ Stetic.BinContainer w1 = global::Stetic.BinContainer.Attach (this);
+ this.UIManager = new global::Gtk.UIManager ();
+ global::Gtk.ActionGroup w2 = new global::Gtk.ActionGroup ("Default");
+ this.closeAction = new global::Gtk.ToggleAction ("closeAction", " ", null, "gtk-close");
+ this.closeAction.ShortLabel = " ";
+ w2.Add (this.closeAction, null);
+ this.circuitsAction = new global::Gtk.Action ("circuitsAction", null, "Association des circuits\nau sequenceur", "circuits");
+ w2.Add (this.circuitsAction, null);
+ this.goForwardAction = new global::Gtk.Action ("goForwardAction", null, null, "gtk-go-forward");
+ w2.Add (this.goForwardAction, null);
+ this.goBackAction = new global::Gtk.Action ("goBackAction", null, null, "gtk-go-back");
+ w2.Add (this.goBackAction, null);
+ this.mediaPauseAction = new global::Gtk.Action ("mediaPauseAction", null, null, "gtk-media-pause");
+ w2.Add (this.mediaPauseAction, null);
+ this.mediaNextAction = new global::Gtk.Action ("mediaNextAction", null, null, "gtk-media-next");
+ w2.Add (this.mediaNextAction, null);
+ this.btnAjoutLigne = new global::Gtk.Action ("btnAjoutLigne", null, null, "gtk-add");
+ w2.Add (this.btnAjoutLigne, null);
+ this.btnRetireligne = new global::Gtk.Action ("btnRetireligne", null, null, "gtk-remove");
+ w2.Add (this.btnRetireligne, null);
+ this.Action = new global::Gtk.Action ("Action", null, null, null);
+ w2.Add (this.Action, null);
+ this.UIManager.InsertActionGroup (w2, 0);
+ this.Name = "DMX2.SeqOscUI";
+ // Container child DMX2.SeqOscUI.Gtk.Container+ContainerChild
+ this.frame1 = new global::Gtk.Frame ();
+ this.frame1.Name = "frame1";
+ this.frame1.ShadowType = ((global::Gtk.ShadowType)(1));
+ // Container child frame1.Gtk.Container+ContainerChild
+ this.GtkAlignment = new global::Gtk.Alignment (0F, 0F, 1F, 1F);
+ this.GtkAlignment.Name = "GtkAlignment";
+ this.GtkAlignment.LeftPadding = ((uint)(12));
+ // Container child GtkAlignment.Gtk.Container+ContainerChild
+ this.alignment1 = new global::Gtk.Alignment (0.5F, 0.5F, 1F, 1F);
+ this.alignment1.Name = "alignment1";
+ // Container child alignment1.Gtk.Container+ContainerChild
+ this.vbox2 = new global::Gtk.VBox ();
+ this.vbox2.Name = "vbox2";
+ this.vbox2.Spacing = 6;
+ // Container child vbox2.Gtk.Box+BoxChild
+ this.hbox1 = new global::Gtk.HBox ();
+ this.hbox1.Name = "hbox1";
+ this.hbox1.Spacing = 6;
+ // Container child hbox1.Gtk.Box+BoxChild
+ this.vbox3 = new global::Gtk.VBox ();
+ this.vbox3.Name = "vbox3";
+ // Container child vbox3.Gtk.Box+BoxChild
+ this.evBBox = new global::Gtk.EventBox ();
+ this.evBBox.Name = "evBBox";
+ // Container child evBBox.Gtk.Container+ContainerChild
+ this.hbox2 = new global::Gtk.HBox ();
+ this.hbox2.WidthRequest = 300;
+ this.hbox2.Name = "hbox2";
+ this.hbox2.Spacing = 6;
+ // Container child hbox2.Gtk.Box+BoxChild
+ this.posLabel = new global::Gtk.Label ();
+ this.posLabel.HeightRequest = 33;
+ this.posLabel.Name = "posLabel";
+ this.posLabel.Xpad = 15;
+ this.posLabel.Xalign = 0F;
+ this.posLabel.LabelProp = "n° 0";
+ this.posLabel.UseMarkup = true;
+ this.hbox2.Add (this.posLabel);
+ global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.posLabel]));
+ w3.Position = 0;
+ w3.Expand = false;
+ w3.Fill = false;
+ // Container child hbox2.Gtk.Box+BoxChild
+ this.actLabel = new global::Gtk.Label ();
+ this.actLabel.Name = "actLabel";
+ this.actLabel.UseMarkup = true;
+ this.actLabel.Wrap = true;
+ this.hbox2.Add (this.actLabel);
+ global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.actLabel]));
+ w4.Position = 1;
+ w4.Fill = false;
+ // Container child hbox2.Gtk.Box+BoxChild
+ this.timeLabel = new global::Gtk.Label ();
+ this.timeLabel.HeightRequest = 33;
+ this.timeLabel.Name = "timeLabel";
+ this.timeLabel.Xpad = 15;
+ this.timeLabel.LabelProp = "00.0";
+ this.timeLabel.UseMarkup = true;
+ this.hbox2.Add (this.timeLabel);
+ global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.timeLabel]));
+ w5.PackType = ((global::Gtk.PackType)(1));
+ w5.Position = 2;
+ w5.Expand = false;
+ w5.Fill = false;
+ this.evBBox.Add (this.hbox2);
+ this.vbox3.Add (this.evBBox);
+ global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.evBBox]));
+ w7.Position = 0;
+ w7.Expand = false;
+ w7.Fill = false;
+ // Container child vbox3.Gtk.Box+BoxChild
+ this.UIManager.AddUiFromString (@"");
+ this.toolbar = ((global::Gtk.Toolbar)(this.UIManager.GetWidget ("/toolbar")));
+ this.toolbar.Name = "toolbar";
+ this.toolbar.ShowArrow = false;
+ this.toolbar.ToolbarStyle = ((global::Gtk.ToolbarStyle)(0));
+ this.toolbar.IconSize = ((global::Gtk.IconSize)(2));
+ this.vbox3.Add (this.toolbar);
+ global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.toolbar]));
+ w8.Position = 1;
+ w8.Expand = false;
+ w8.Fill = false;
+ this.hbox1.Add (this.vbox3);
+ global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.vbox3]));
+ w9.Position = 0;
+ // Container child hbox1.Gtk.Box+BoxChild
+ this.UIManager.AddUiFromString ("<" +
+ "/toolbar>");
+ this.toolbar1 = ((global::Gtk.Toolbar)(this.UIManager.GetWidget ("/toolbar1")));
+ this.toolbar1.Name = "toolbar1";
+ this.toolbar1.Orientation = ((global::Gtk.Orientation)(1));
+ this.toolbar1.ShowArrow = false;
+ this.toolbar1.ToolbarStyle = ((global::Gtk.ToolbarStyle)(0));
+ this.toolbar1.IconSize = ((global::Gtk.IconSize)(2));
+ this.hbox1.Add (this.toolbar1);
+ global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.toolbar1]));
+ w10.PackType = ((global::Gtk.PackType)(1));
+ w10.Position = 1;
+ w10.Expand = false;
+ w10.Fill = false;
+ this.vbox2.Add (this.hbox1);
+ global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.hbox1]));
+ w11.Position = 0;
+ w11.Expand = false;
+ w11.Fill = false;
+ // Container child vbox2.Gtk.Box+BoxChild
+ this.scrolledwindow1 = new global::Gtk.ScrolledWindow ();
+ this.scrolledwindow1.CanFocus = true;
+ this.scrolledwindow1.Name = "scrolledwindow1";
+ this.scrolledwindow1.ShadowType = ((global::Gtk.ShadowType)(1));
+ // Container child scrolledwindow1.Gtk.Container+ContainerChild
+ this.cmdList = new global::Gtk.TreeView ();
+ this.cmdList.CanFocus = true;
+ this.cmdList.Name = "cmdList";
+ this.cmdList.RulesHint = true;
+ this.scrolledwindow1.Add (this.cmdList);
+ this.vbox2.Add (this.scrolledwindow1);
+ global::Gtk.Box.BoxChild w13 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.scrolledwindow1]));
+ w13.Position = 1;
+ this.alignment1.Add (this.vbox2);
+ this.GtkAlignment.Add (this.alignment1);
+ this.frame1.Add (this.GtkAlignment);
+ this.titreLabel = new global::Gtk.Label ();
+ this.titreLabel.Name = "titreLabel";
+ this.titreLabel.LabelProp = "Séquenceur Midi";
+ this.titreLabel.UseMarkup = true;
+ this.frame1.LabelWidget = this.titreLabel;
+ this.Add (this.frame1);
+ if ((this.Child != null)) {
+ this.Child.ShowAll ();
+ }
+ w1.SetUiManager (UIManager);
+ this.Hide ();
+ this.closeAction.Activated += new global::System.EventHandler (this.OnCloseActionActivated);
+ this.goForwardAction.Activated += new global::System.EventHandler (this.OnGoForwardActionActivated);
+ this.goBackAction.Activated += new global::System.EventHandler (this.OnGoBackActionActivated);
+ this.mediaPauseAction.Activated += new global::System.EventHandler (this.OnMediaPauseActionActivated);
+ this.btnAjoutLigne.Activated += new global::System.EventHandler (this.OnBtnAjoutLigneActivated);
+ this.btnRetireligne.Activated += new global::System.EventHandler (this.OnRemoveLigneActivated);
+ this.hbox2.SizeAllocated += new global::Gtk.SizeAllocatedHandler (this.OnHbox2SizeAllocated);
+ this.cmdList.CursorChanged += new global::System.EventHandler (this.OnCmdListeCursorChanged);
+ }
+ }
+}
diff --git a/DMX-2.0/icons/midiseq/audio-x-generic.16.png b/DMX-2.0/icons/midiseq/audio-x-generic.16.png
new file mode 100644
index 0000000..2bd5af9
Binary files /dev/null and b/DMX-2.0/icons/midiseq/audio-x-generic.16.png differ
diff --git a/DMX-2.0/icons/midiseq/audio-x-generic.22.png b/DMX-2.0/icons/midiseq/audio-x-generic.22.png
new file mode 100644
index 0000000..318bebd
Binary files /dev/null and b/DMX-2.0/icons/midiseq/audio-x-generic.22.png differ
diff --git a/DMX-2.0/icons/midiseq/audio-x-generic.24.png b/DMX-2.0/icons/midiseq/audio-x-generic.24.png
new file mode 100644
index 0000000..da6c6c5
Binary files /dev/null and b/DMX-2.0/icons/midiseq/audio-x-generic.24.png differ
diff --git a/DMX-2.0/icons/midiseq/audio-x-generic.32.png b/DMX-2.0/icons/midiseq/audio-x-generic.32.png
new file mode 100644
index 0000000..c60b595
Binary files /dev/null and b/DMX-2.0/icons/midiseq/audio-x-generic.32.png differ
diff --git a/DMX-2.0/icons/midiseq/audio-x-generic.svg b/DMX-2.0/icons/midiseq/audio-x-generic.svg
new file mode 100644
index 0000000..be2d18a
--- /dev/null
+++ b/DMX-2.0/icons/midiseq/audio-x-generic.svg
@@ -0,0 +1,180 @@
+
+
+