From 9607f81f363e2b74d768908dcb968cb3db3db017 Mon Sep 17 00:00:00 2001 From: Tzim Date: Fri, 30 Jun 2017 10:00:38 +0200 Subject: [PATCH 01/22] Preparation : ajout de la possibilite de plusieurs ports seq. Adaptation du MidiEventProvider --- DMX-2.0/AlsaSeqLib.Invoke.cs | 3 +++ DMX-2.0/AlsaSeqLib.cs | 52 ++++++++++++++++++++---------------- DMX-2.0/Main.cs | 6 ++++- DMX-2.0/MidiEventProvider.cs | 16 +++++++---- 4 files changed, 48 insertions(+), 29 deletions(-) diff --git a/DMX-2.0/AlsaSeqLib.Invoke.cs b/DMX-2.0/AlsaSeqLib.Invoke.cs index bdb6be1..a1b0d51 100644 --- a/DMX-2.0/AlsaSeqLib.Invoke.cs +++ b/DMX-2.0/AlsaSeqLib.Invoke.cs @@ -26,6 +26,9 @@ namespace DMX2 [DllImport(ASOUND_LIB_NAME, CallingConvention = CallingConvention.Cdecl)] public static extern int snd_seq_create_simple_port (IntPtr seq, string name, uint caps, uint type); + [DllImport(ASOUND_LIB_NAME, CallingConvention = CallingConvention.Cdecl)] + public static extern int snd_seq_delete_simple_port (IntPtr seq, int port); + [DllImport(ASOUND_LIB_NAME, CallingConvention = CallingConvention.Cdecl)] public static extern int snd_seq_event_input (IntPtr seq, out IntPtr ev); diff --git a/DMX-2.0/AlsaSeqLib.cs b/DMX-2.0/AlsaSeqLib.cs index d03e092..e76c010 100644 --- a/DMX-2.0/AlsaSeqLib.cs +++ b/DMX-2.0/AlsaSeqLib.cs @@ -9,8 +9,8 @@ namespace DMX2 { static SeqHandleWrapper seq_handle = null; static int clientId; - static int inport; - static int outport; + //static int inport; + //static int outport; public class Client @@ -123,17 +123,23 @@ namespace DMX2 seq_handle = new SeqHandleWrapper (); clientId = Invoke.snd_seq_client_id (seq_handle.Handle); + } - outport = inport = Invoke.snd_seq_create_simple_port (seq_handle.Handle, - "midi_in_out", - SND_SEQ_PORT_CAP_WRITE - //+ SND_SEQ_PORT_CAP_SUBS_WRITE - + SND_SEQ_PORT_CAP_READ - + SND_SEQ_PORT_CAP_SUBS_READ - , - SND_SEQ_PORT_TYPE_APPLICATION - ); + public static int CreatePort(string portname){ + return Invoke.snd_seq_create_simple_port (seq_handle.Handle, + portname, + SND_SEQ_PORT_CAP_WRITE + + SND_SEQ_PORT_CAP_SUBS_WRITE + + SND_SEQ_PORT_CAP_READ + + SND_SEQ_PORT_CAP_SUBS_READ + , + SND_SEQ_PORT_TYPE_APPLICATION + ); + } + public static void DeletePort(int port){ + Invoke.snd_seq_delete_simple_port (seq_handle.Handle, + port); } public static void Close () @@ -177,7 +183,7 @@ namespace DMX2 throw new InvalidOperationException (); ev.queue = SND_SEQ_QUEUE_DIRECT; ev.source.client = (byte)clientId; - ev.source.port = (byte)outport; + //ev.source.port = (byte)outport; Marshal.StructureToPtr (ev, evOutPtr.Pointer, false); Invoke.snd_seq_event_output (seq_handle.Handle, evOutPtr.Pointer); Invoke.snd_seq_drain_output (seq_handle.Handle); @@ -228,7 +234,7 @@ namespace DMX2 } } - public static bool Connect (Port port) + public static bool Connect (int localport, Port port) { if (seq_handle == null) throw new InvalidOperationException (); @@ -236,37 +242,37 @@ namespace DMX2 bool isOutput = (port.Caps & SND_SEQ_PORT_CAP_READ) == SND_SEQ_PORT_CAP_READ; if (isInput) - if (!ConnectTo (port.ClientId, port.PortId)) + if (!ConnectTo (localport,port.ClientId, port.PortId)) return false; if (isOutput) - if (!ConnectFrom (port.ClientId, port.PortId)) + if (!ConnectFrom (localport,port.ClientId, port.PortId)) return false; return true; } - public static bool ConnectTo (int client, int port) + public static bool ConnectTo (int localoutport, int client, int port) { if (seq_handle == null) throw new InvalidOperationException (); - return Invoke.snd_seq_connect_to (seq_handle.Handle, outport, client, port) == 0; + return Invoke.snd_seq_connect_to (seq_handle.Handle, localoutport, client, port) == 0; } - public static bool ConnectFrom (int client, int port) + public static bool ConnectFrom (int localinport, int client, int port) { if (seq_handle == null) throw new InvalidOperationException (); - return Invoke.snd_seq_connect_from (seq_handle.Handle, inport, client, port) == 0; + return Invoke.snd_seq_connect_from (seq_handle.Handle, localinport, client, port) == 0; } - public static void Deconnecte (int client, int port) + public static void Deconnecte (int localport, int client, int port) { if (seq_handle == null) throw new InvalidOperationException (); snd_seq_addr_t local = new snd_seq_addr_t (); local.client = (byte)clientId; - local.port = (byte)inport; + local.port = (byte)localport; snd_seq_addr_t addr; using (PointerWrapper subqueryInfo = new PointerWrapper(GetQuerySubscribeInfoSize())) @@ -286,7 +292,7 @@ namespace DMX2 if (addr.client != client || addr.port != port) continue; - Invoke.snd_seq_disconnect_from (seq_handle.Handle, inport, client, port); + Invoke.snd_seq_disconnect_from (seq_handle.Handle, localport, client, port); } @@ -305,7 +311,7 @@ namespace DMX2 if (addr.client != client || addr.port != port) continue; - Invoke.snd_seq_disconnect_to (seq_handle.Handle, outport, client, port); + Invoke.snd_seq_disconnect_to (seq_handle.Handle, localport, client, port); } } diff --git a/DMX-2.0/Main.cs b/DMX-2.0/Main.cs index e2fc5cc..2d74489 100644 --- a/DMX-2.0/Main.cs +++ b/DMX-2.0/Main.cs @@ -60,6 +60,8 @@ namespace DMX2 if (oscEn) osc = new OSCServer (); + AlsaSeqLib.Init (); + // Initialisation GTK# Application.Init (); @@ -117,9 +119,11 @@ namespace DMX2 Conduite.Courante.Dispose (); } - //if(ws!=null) ws.Dispose(); + if(ws!=null) ws.Dispose(); if(osc!=null) osc.Dispose(); + + AlsaSeqLib.Close (); } static void HandleUnhandledException (GLib.UnhandledExceptionArgs args) diff --git a/DMX-2.0/MidiEventProvider.cs b/DMX-2.0/MidiEventProvider.cs index 4301a2c..b7947f6 100644 --- a/DMX-2.0/MidiEventProvider.cs +++ b/DMX-2.0/MidiEventProvider.cs @@ -60,6 +60,8 @@ namespace DMX2 uint pageUpCC = 127; uint pageDownCC = 126; + int eventmidiport; + public uint CurrentPage { get { return page; @@ -157,7 +159,7 @@ namespace DMX2 foreach (int connectedport in dev.ConnectedPorts) { int client = connectedport >> 8; int port = connectedport & 0xFF; - AlsaSeqLib.Deconnecte (client, port); + AlsaSeqLib.Deconnecte (eventmidiport, client, port); } } @@ -183,9 +185,11 @@ namespace DMX2 knowndevices.Add(dev.Name,dev); #endif manager.RegisterProvider (this); - AlsaSeqLib.Init (); + //AlsaSeqLib.Init (); + + eventmidiport = AlsaSeqLib.CreatePort ("event_prov_in_out"); - AlsaSeqLib.ConnectFrom (AlsaSeqLib.SND_SEQ_CLIENT_SYSTEM, AlsaSeqLib.SND_SEQ_PORT_SYSTEM_ANNOUNCE); + AlsaSeqLib.ConnectFrom (eventmidiport,AlsaSeqLib.SND_SEQ_CLIENT_SYSTEM, AlsaSeqLib.SND_SEQ_PORT_SYSTEM_ANNOUNCE); AutoConnect (); } @@ -213,7 +217,7 @@ namespace DMX2 if (knowndevices [fullportname].ConnectedPorts.Contains (srcid)) return; - AlsaSeqLib.Connect (p); + AlsaSeqLib.Connect (eventmidiport,p); } } @@ -271,6 +275,7 @@ namespace DMX2 public void SendEvent (AlsaSeqLib.snd_seq_event_t ev) { + ev.source.port =(byte) eventmidiport; AlsaSeqLib.SendEventToSubscribers (ev); } @@ -594,7 +599,8 @@ namespace DMX2 if (disposed) return; disposed = true; - AlsaSeqLib.Close(); + //AlsaSeqLib.Close(); + AlsaSeqLib.DeletePort(eventmidiport); } #endregion From acd01db3fc42bb074b9ec7294fa4763a2f22cbe5 Mon Sep 17 00:00:00 2001 From: Tzim Date: Fri, 30 Jun 2017 11:01:30 +0200 Subject: [PATCH 02/22] Copie Seq Macro -> Seq Midi --- DMX-2.0/DMX-2.0.csproj | 5 +- DMX-2.0/SeqMidiUI.cs | 456 ++++++++++++++++++ DMX-2.0/SequenceurMidi.cs | 718 +++++++++++++++++++++++++++++ DMX-2.0/gtk-gui/DMX2.SeqMacroUI.cs | 111 +++-- DMX-2.0/gtk-gui/DMX2.SeqMidiUI.cs | 286 ++++++++++++ DMX-2.0/gtk-gui/gui.stetic | 298 ++++++++++++ 6 files changed, 1826 insertions(+), 48 deletions(-) create mode 100644 DMX-2.0/SeqMidiUI.cs create mode 100644 DMX-2.0/SequenceurMidi.cs create mode 100644 DMX-2.0/gtk-gui/DMX2.SeqMidiUI.cs diff --git a/DMX-2.0/DMX-2.0.csproj b/DMX-2.0/DMX-2.0.csproj index 8689edd..d0e28d1 100644 --- a/DMX-2.0/DMX-2.0.csproj +++ b/DMX-2.0/DMX-2.0.csproj @@ -137,6 +137,9 @@ + + + @@ -150,4 +153,4 @@ - \ No newline at end of file + diff --git a/DMX-2.0/SeqMidiUI.cs b/DMX-2.0/SeqMidiUI.cs new file mode 100644 index 0000000..dae55d8 --- /dev/null +++ b/DMX-2.0/SeqMidiUI.cs @@ -0,0 +1,456 @@ +/* + + 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 SeqMidiUI : SequenceurUI + { + bool fullUpdFlag = true; + bool updating; + SequenceurMidi 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 */ + { + + effetsListe.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)); + effetsListe.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; + effetsListe.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; + effetsListe.AppendColumn (topCol); + + var circuitsCol = new Gtk.TreeViewColumn (); + var circuitsCell = new Gtk.CellRendererText (); + circuitsCol.Title = "Circuits"; + circuitsCol.PackStart (circuitsCell, true); + circuitsCol.SetCellDataFunc (circuitsCell, new Gtk.TreeCellDataFunc (RenderMatriceCircuits)); + circuitsCol.Resizable = true; + circuitsCell.Editable = true; + circuitsCell.Edited += OnCircuitsCellEdited; + effetsListe.AppendColumn (circuitsCol); + + var valeurCol = new Gtk.TreeViewColumn (); + var valeurCell = new Gtk.CellRendererText (); + valeurCol.Title = "Valeur"; + valeurCol.PackStart (valeurCell, true); + valeurCol.SetCellDataFunc (valeurCell, new Gtk.TreeCellDataFunc (RenderMatriceValeur)); + valeurCell.Editable = true; + valeurCell.Edited += OnValeurCellEdited; + effetsListe.AppendColumn (valeurCol); + + var tempsCol = new Gtk.TreeViewColumn (); + var tempsCell = new Gtk.CellRendererText (); + tempsCol.Title = "Temps"; + tempsCol.PackStart (tempsCell, true); + tempsCol.SetCellDataFunc (tempsCell, new Gtk.TreeCellDataFunc (RenderMatriceTemps)); + tempsCell.Editable = true; + tempsCell.Edited += OnTempsCellEdited; + effetsListe.AppendColumn (tempsCol); + + lsEffets = new Gtk.ListStore(typeof (SequenceurMacro.Ligne)); + this.effetsListe.Model = lsEffets; + UpdListeEffets(); + } + + void RenderMatriceNum (TreeViewColumn tree_column, CellRenderer cell, TreeModel tree_model, TreeIter iter) + { + if (Conduite.Courante==null) return; + string num=string.Empty; + SequenceurMidi.Ligne l = tree_model.GetValue (iter, 0) as SequenceurMidi.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; + SequenceurMacro.Ligne l = tree_model.GetValue (iter, 0) as SequenceurMacro.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; + SequenceurMacro.Ligne l = tree_model.GetValue (iter, 0) as SequenceurMacro.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 RenderMatriceCircuits (TreeViewColumn tree_column, CellRenderer cell, TreeModel tree_model, TreeIter iter) + { + if (Conduite.Courante==null) return; + SequenceurMacro.Ligne l = tree_model.GetValue (iter, 0) as SequenceurMacro.Ligne; + (cell as Gtk.CellRendererText).Text = l.Circuits; + } + + void RenderMatriceValeur (TreeViewColumn tree_column, CellRenderer cell, TreeModel tree_model, TreeIter iter) + { + if (Conduite.Courante==null) return; + SequenceurMacro.Ligne l = tree_model.GetValue (iter, 0) as SequenceurMacro.Ligne; + (cell as Gtk.CellRendererText).Text = (l.Valeur).ToString(); + + } + + void RenderMatriceTemps (TreeViewColumn tree_column, CellRenderer cell, TreeModel tree_model, TreeIter iter) + { + if (Conduite.Courante==null) return; + SequenceurMacro.Ligne l = tree_model.GetValue (iter, 0) as SequenceurMacro.Ligne; + (cell as Gtk.CellRendererText).Text = (l.Temps.TotalMilliseconds /100).ToString(); + } + + void OnNomCellEdited (object o, EditedArgs args) + { + Gtk.TreeIter iter; + lsEffets.GetIter (out iter, new Gtk.TreePath (args.Path)); + SequenceurMacro.Ligne l = lsEffets.GetValue(iter,0) as SequenceurMacro.Ligne; + l.Nom = args.NewText; + } + + void OnTopCellEdited (object o, EditedArgs args) + { + Gtk.TreeIter iter; + lsEffets.GetIter (out iter, new Gtk.TreePath (args.Path)); + SequenceurMacro.Ligne l = lsEffets.GetValue (iter, 0) as SequenceurMacro.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 OnCircuitsCellEdited (object o, EditedArgs args) + { + Gtk.TreeIter iter; + lsEffets.GetIter (out iter, new Gtk.TreePath (args.Path)); + SequenceurMacro.Ligne l = lsEffets.GetValue(iter,0) as SequenceurMacro.Ligne; + l.Circuits = args.NewText; + } + + + void OnValeurCellEdited (object o, EditedArgs args) + { + Gtk.TreeIter iter; + lsEffets.GetIter (out iter, new Gtk.TreePath (args.Path)); + SequenceurMacro.Ligne l = lsEffets.GetValue(iter,0) as SequenceurMacro.Ligne; + int val; + if(int.TryParse(args.NewText,out val)) l.Valeur = val; + } + + void OnTempsCellEdited (object o, EditedArgs args) + { + Gtk.TreeIter iter; + lsEffets.GetIter (out iter, new Gtk.TreePath (args.Path)); + SequenceurMacro.Ligne l = lsEffets.GetValue (iter, 0) as SequenceurMacro.Ligne; + if (args.NewText.Length == 0) + l.Temps = TimeSpan.Zero; + else { + int val; + if(int.TryParse(args.NewText, out val)) + l.Temps = TimeSpan.FromMilliseconds(val *100); + } + } + + + void UpdListeEffets () + { + lsEffets.Clear(); + foreach (var ligne in sequenceur.Lignes) { + lsEffets.AppendValues(ligne); + } + } + +#endregion + + public SeqMidiUI (SequenceurMidi s ) : base (s) + { + this.Build (); + titreLabel.Text = s.Name; + sequenceur = s; + ConstruitMatrice (); + + + new ContextMenuHelper(seqMasterScale,MasterPopup); + new ContextMenuHelper(frame1,RenamePopup); + new ContextMenuHelper(evBBox,CompteurPopup); + + + } + + void MasterPopup (object sender, ContextMenuEventArgs e) + { + Menu m = Conduite.Courante.EventManager.GetMenu(null, + delegate(object o,string eventId){ + sequenceur.BindMasterEvent(eventId); + } + ); + m.ShowAll(); + m.Popup(); + } + + 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(); + effetsListe.QueueDraw(); + SelectionneEffet (sequenceur.IndexLigneEnCours); + posLabel.Text = string.Format("n°{0}",sequenceur.IndexLigneEnCours +1 ); + } + updating = true; + seqMasterScale.Value = sequenceur.Master; + updating = false; + + if (DateTime.Now > nextMaj ) { + nextMaj = DateTime.Now.AddMilliseconds(500); + StringBuilder str = new StringBuilder (); + bool a = false; + foreach (Circuit c in sequenceur.Circuits) { + if (sequenceur.ValeurBruteCircuit (c) > 0) { + if (sequenceur.EstActif (c) != a) { + if(!a){ + str.Append (""); + a = true; + } else { + str.Append (""); + a = false; + } + } + str.Append (c.ID); str.Append (' '); + } + } + if (a) { + str.Append (""); + a = false; + } + actLabel.LabelProp = str.ToString (); + } + } + + + void SelectionneEffet (int index) + { + if(index <0 ) return; + effetsListe.SetCursor( new TreePath( new int[1] {index }) ,null,false); + effetChange = false; + } + + protected void OnCircuitsActionActivated (object sender, EventArgs e) + { + // récupère la fenètre principale + Window win = this.GetAncestor(Gtk.Window.GType) as Window; + var dlg = new SelSeqCircuits (sequenceur.Circuits,win); + if ((ResponseType)dlg.Run () == ResponseType.Ok) { + sequenceur.ChangeCircuits(dlg.GetResultList()); + } + dlg.Destroy(); + fullUpdFlag = true; + } + + 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 = effetsListe.Selection.GetSelectedRows(); + if(sel.Length ==0) return -1; + return effetsListe.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 OnSeqMasterScaleValueChanged (object sender, EventArgs e) + { + if (updating)return; + sequenceur.Master = (int)(seqMasterScale.Value); + } + + protected void OnBtnAjoutLigneActivated (object sender, EventArgs e) + { + int pos=IndexEffetSelectionne() + 1; + sequenceur.AjoutLigne(pos); + UpdListeEffets(); + effetsListe.SetCursor( new TreePath( new int[1] {pos }) , effetsListe.Columns[1] ,true); + } + + protected void OnRemoveLigneActivated (object sender, EventArgs e) + { + int pos = IndexEffetSelectionne(); + if (pos==-1) return; + sequenceur.RetireLigne(pos); + UpdListeEffets(); + } + + protected void OnEffetsListeCursorChanged (object sender, EventArgs e) + { + if(effetChange) return; + TreeViewColumn col; + TreePath path; + effetsListe.GetCursor (out path, out col); + + if (effetsListe.Columns [0] == col) { + sequenceur.IndexLigneaSuivre = IndexEffetSelectionne(); + } + } + + + + + protected void OnBtnCommandClicked (object sender, EventArgs e) + { + sequenceur.CommandDirecte(txtCommand.Text ); + + } + + + 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/SequenceurMidi.cs b/DMX-2.0/SequenceurMidi.cs new file mode 100644 index 0000000..3da5490 --- /dev/null +++ b/DMX-2.0/SequenceurMidi.cs @@ -0,0 +1,718 @@ +/* + + 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 SequenceurMidi : Sequenceur + { + public class Ligne { + public Ligne(){} + string nom = string.Empty; + TimeSpan top = TimeSpan.MinValue; + string circuits = string.Empty; + int valeur; + TimeSpan temps = TimeSpan.Zero; + + public string Nom { + get { + return nom; + } + set { + nom = value; + } + } + + public TimeSpan Top { + get { + return top; + } + set { + top = value; + } + } + + public string Circuits { + get { + return circuits; + } + set { + circuits = value; + } + } + + public int Valeur { + get { + return valeur; + } + set { + valeur = value; + } + } + + public TimeSpan Temps { + get { + return temps; + } + set { + temps = 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 ("circuits", circuits); + el.SetAttribute ("valeur", valeur.ToString ()); + el.SetAttribute ("temps", temps.ToString ()); + + + } + + 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.circuits = el.GetAttribute ("circuits"); + l.valeur = int.Parse(el.GetAttribute("valeur")); + l.temps = TimeSpan.Parse(el.GetAttribute("temps")); + + return l; + } + } + + public class EffetMacro + { + public EffetMacro( TimeSpan tempsTransition, int valeurInitiale, int valeurFinale) { + TempsPasse = TimeSpan.Zero; + TempsTransition = tempsTransition; + ValeurInitiale= valeurInitiale; + ValeurFinale = valeurFinale; + } + public TimeSpan TempsPasse { get; set; } + public TimeSpan TempsTransition { get; set; } + public int ValeurInitiale { get; set; } + public int ValeurFinale { get; set; } + public bool Incremente (TimeSpan delta) + { + TempsPasse += delta; + if (TempsPasse > TempsTransition) { + TempsPasse = TempsTransition; + return true; + } + return false; + } + public int ValeurCourante() + { + double progression = TempsPasse.TotalMilliseconds/TempsTransition.TotalMilliseconds; + return (int)( progression * (ValeurFinale - ValeurInitiale) + ValeurInitiale ); + } + } + + List lignes = new List(); + + Ligne aSuivre = null; + Ligne enCours = null; + Ligne ligneMaitre = null; + + TimeSpan timeStamp = TimeSpan.Zero; + TimeSpan topSuivant = TimeSpan.Zero; + bool topPresent = false; + + List circuitsSeq = new List (); + + + Dictionary valeurscourantes = new Dictionary (); + Dictionary effetsEnCours = new Dictionary(); + + actionEventTargetEx masterEventTarget=null; + actionEventTarget goNextEventTarget=null; + actionEventTarget goBackEventTarget=null; + + + SeqMidiUI ui = null; + bool change = false; + int master = 100; + + public int Master { + get { + return master; + } + set { + master = value; + masterEventTarget.FeedBack (); + } + } + + bool paused=false; + + public bool Paused { + get { + return paused; + } + set { + paused = value; + } + } + + public SequenceurMidi () + { + masterEventTarget = new actionEventTargetEx ( + delegate(EventData data) { + Master = 100 * data.value / 255; + return true; + }, + delegate{ + return Master *255/100; + }, + true + ); + + 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 ReadOnlyCollection Circuits { + get { + return circuitsSeq.AsReadOnly (); + } + } + + public void ChangeCircuits (System.Collections.Generic.List list) + { + foreach (var c in circuitsSeq.ToArray()) { + if (!list.Contains (c)) + lock (this) RetireCircuit (c); + } + foreach (var c in list) + if (!circuitsSeq.Contains (c)) + lock (this) AjouteCircuit (c); + circuitsSeq = list; + } + + void AjouteCircuit (Circuit c) + { + valeurscourantes [c] = 0; + } + + void RetireCircuit (Circuit c) + { + circuitsSeq.Remove (c); + valeurscourantes.Remove (c); + } + + /*public override void MajCircuitsSupprimes () + { + lock (this) { + foreach (var c in circuitsSeq.ToArray()) { + if (!Conduite.Courante.Circuits.Contains (c)) + RetireCircuit (c); + } + } + }*/ + + public override int ValeurCircuit (Circuit c) + { + if (!valeurscourantes.ContainsKey (c)) + return 0; + if(master !=100) + return valeurscourantes [c] * master /100; + return valeurscourantes [c]; + } + + public int ValeurBruteCircuit (Circuit c) + { + if (!circuitsSeq.Contains (c)) + return 0; + return valeurscourantes [c]; + } + + public bool EstActif (Circuit c) + { + lock (this) + return effetsEnCours.ContainsKey(c); + } + + public override void Tick (TimeSpan time) + { + if (paused) + return; + timeStamp += time; + + if (Monitor.TryEnter (this)) { + try { + if (effetsEnCours.Count > 0) { + List circuits = new List (effetsEnCours.Keys); + + foreach (Circuit c in circuits) { + if (effetsEnCours [c].Incremente (time)) { + valeurscourantes [c] = effetsEnCours [c].ValeurFinale; + effetsEnCours.Remove (c); + } else { + valeurscourantes [c] = effetsEnCours [c].ValeurCourante (); + } + } + } + + 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; + LanceEffetsMacro(false,TimeSpan.Zero); + if(ui!=null) + ui.EffetChange(); + } + } + + void LanceEffetsMacro (bool ecrase, TimeSpan tempsMatrice) + { + lock (this) { + if (ecrase) + LanceEffetsMacro (enCours.Circuits, enCours.Valeur, tempsMatrice); + else + LanceEffetsMacro (enCours.Circuits, enCours.Valeur, enCours.Temps); + } + + } + + void LanceEffetsMacro (string circuits, int valeurCible, TimeSpan temps) + { + if(circuits==null)return; + string[] blocs = circuits.Split(','); + foreach (string bloc in blocs) { + string[] circ = bloc.Split('-'); + int start, end; + if(! int.TryParse(circ[0], out start)) + continue; + if(circ.Length > 1) // on a affaire a un bloc (de plusieurs) + { + if(! int.TryParse(circ[1], out end)) + continue; + } + else + end= start; + for( int i = start; i<=end; i++) + { + Circuit c = Conduite.Courante.GetCircuitByID(i); + if(circuitsSeq.Contains(c)) + { + lock(this) + effetsEnCours[c] = new EffetMacro(temps,valeurscourantes[c],valeurCible); + } + } + } + } + + + 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 ("SequenceurMidi"); + System.Xml.XmlElement xmlEl; + + parent.AppendChild (el); + el.SetAttribute ("id", ID.ToString ()); + el.SetAttribute ("name", Name); + //el.SetAttribute ("master", master.ToString ()); + + el.AppendChild(xmlEl = parent.OwnerDocument.CreateElement ("Master")); + xmlEl.SetAttribute("value",master.ToString()); + Conduite.Courante.EventManager.SaveBindings(xmlEl,masterEventTarget); + + 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 (Circuit c in circuitsSeq) { + el.AppendChild(xmlEl = parent.OwnerDocument.CreateElement ("CircuitSeq")); + xmlEl.SetAttribute("id",c.ID.ToString()); + } + + foreach (Ligne li in lignes) { + li.Save(el); + } + + } + + + public override SequenceurUI GetUI () + { + + if (ui == null) { + ui = new SeqMidiUI (this); + ui.Destroyed += UiDestroyed; + } + + return ui; + } + + void UiDestroyed (object sender, EventArgs e) + { + ui = null; + } + + public void BindMasterEvent (string eventId) + { + if(eventId.Length==0) + { + Conduite.Courante.EventManager.Unbind(masterEventTarget); + return; + } + Conduite.Courante.EventManager.Bind(eventId,masterEventTarget); + } + + 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 SequenceurMidi Load (Conduite conduite, System.Xml.XmlElement el) + { + SequenceurMidi seq = new SequenceurMidi(); + 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["Master"]) != null) { + master = int.Parse (xmlE.TryGetAttribute("value","100")); + foreach(string id in EventManager.LoadBindings(xmlE)) + BindMasterEvent(id); + } + else master = int.Parse (el.TryGetAttribute("master","100")); + + 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 xc in el.GetElementsByTagName("CircuitSeq")) { + System.Xml.XmlElement xcir = xc as System.Xml.XmlElement; + Circuit c = conduite.GetCircuitByID (int.Parse (xcir.GetAttribute ("id"))); + circuitsSeq.Add (c); + AjouteCircuit (c); + } + + foreach (var xe in el.GetElementsByTagName("Ligne")) + lignes.Add(Ligne.Load(conduite,xe as System.Xml.XmlElement)); + } + + static System.Text.RegularExpressions.Regex regexCommandeDirecte = new System.Text.RegularExpressions.Regex( + @"(?[\d,-]+) (?\d+) (?\d+)", + System.Text.RegularExpressions.RegexOptions.Compiled); + + + public void CommandDirecte (string text) + { + var cmd = regexCommandeDirecte.Match (text); + if (cmd.Success) { + string circuits = cmd.Groups["circuits"].Value; + + int valeur = int.Parse(cmd.Groups["valeur"].Value); + TimeSpan temps = TimeSpan.FromMilliseconds(100* int.Parse(cmd.Groups["temps"].Value)); + + LanceEffetsMacro(circuits,valeur,temps); + } + } + + static System.Text.RegularExpressions.Regex regexCommand1 = new System.Text.RegularExpressions.Regex( + @"(?\d+)(t(?\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; + int transition=-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; + + if (cmd.Groups ["transition"].Success) { + transition = int.Parse (cmd.Groups ["transition"].Value); + LanceEffetsMacro(true, TimeSpan.FromMilliseconds(transition *100)); + } + else + LanceEffetsMacro(false,TimeSpan.Zero); + + 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.SeqMacroUI.cs b/DMX-2.0/gtk-gui/DMX2.SeqMacroUI.cs index 3199b2f..eaf944d 100644 --- a/DMX-2.0/gtk-gui/DMX2.SeqMacroUI.cs +++ b/DMX-2.0/gtk-gui/DMX2.SeqMacroUI.cs @@ -5,33 +5,61 @@ namespace DMX2 public partial class SeqMacroUI { 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.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.HScale seqMasterScale; + private global::Gtk.HBox hbox3; + private global::Gtk.Entry txtCommand; + private global::Gtk.Button btnCommand; + private global::Gtk.Toolbar toolbar; + private global::Gtk.Toolbar toolbar1; + private global::Gtk.ScrolledWindow scrolledwindow1; + private global::Gtk.TreeView effetsListe; + private global::Gtk.Label titreLabel; protected virtual void Build () @@ -135,10 +163,10 @@ namespace DMX2 this.seqMasterScale = new global::Gtk.HScale (null); this.seqMasterScale.CanFocus = true; this.seqMasterScale.Name = "seqMasterScale"; - this.seqMasterScale.Adjustment.Upper = 100; - this.seqMasterScale.Adjustment.PageIncrement = 10; - this.seqMasterScale.Adjustment.StepIncrement = 1; - this.seqMasterScale.Adjustment.Value = 100; + this.seqMasterScale.Adjustment.Upper = 100D; + this.seqMasterScale.Adjustment.PageIncrement = 10D; + this.seqMasterScale.Adjustment.StepIncrement = 1D; + this.seqMasterScale.Adjustment.Value = 100D; this.seqMasterScale.DrawValue = true; this.seqMasterScale.Digits = 0; this.seqMasterScale.ValuePos = ((global::Gtk.PositionType)(1)); @@ -165,49 +193,38 @@ namespace DMX2 this.btnCommand.CanFocus = true; this.btnCommand.Name = "btnCommand"; this.btnCommand.UseUnderline = true; - // Container child btnCommand.Gtk.Container+ContainerChild - global::Gtk.Alignment w10 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F); - // Container child GtkAlignment.Gtk.Container+ContainerChild - global::Gtk.HBox w11 = new global::Gtk.HBox (); - w11.Spacing = 2; - // Container child GtkHBox.Gtk.Container+ContainerChild - global::Gtk.Image w12 = new global::Gtk.Image (); - w12.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-ok", global::Gtk.IconSize.Menu); - w11.Add (w12); - // Container child GtkHBox.Gtk.Container+ContainerChild - global::Gtk.Label w14 = new global::Gtk.Label (); - w14.LabelProp = "Ok"; - w14.UseUnderline = true; - w11.Add (w14); - w10.Add (w11); - this.btnCommand.Add (w10); + this.btnCommand.Label = "Ok"; + global::Gtk.Image w10 = new global::Gtk.Image (); + w10.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-ok", global::Gtk.IconSize.Menu); + this.btnCommand.Image = w10; this.hbox3.Add (this.btnCommand); - global::Gtk.Box.BoxChild w18 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.btnCommand])); - w18.Position = 1; - w18.Expand = false; - w18.Fill = false; + global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.btnCommand])); + w11.Position = 1; + w11.Expand = false; + w11.Fill = false; this.vbox3.Add (this.hbox3); - global::Gtk.Box.BoxChild w19 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.hbox3])); - w19.Position = 2; - w19.Expand = false; - w19.Fill = false; + global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.hbox3])); + w12.Position = 2; + w12.Expand = false; + w12.Fill = false; // Container child vbox3.Gtk.Box+BoxChild - this.UIManager.AddUiFromString (""); + 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 w20 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.toolbar])); - w20.Position = 3; - w20.Expand = false; - w20.Fill = false; + global::Gtk.Box.BoxChild w13 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.toolbar])); + w13.Position = 3; + w13.Expand = false; + w13.Fill = false; this.hbox1.Add (this.vbox3); - global::Gtk.Box.BoxChild w21 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.vbox3])); - w21.Position = 0; + global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.vbox3])); + w14.Position = 0; // Container child hbox1.Gtk.Box+BoxChild - this.UIManager.AddUiFromString (""); + this.UIManager.AddUiFromString ("<" + + "toolitem name=\'circuitsAction\' action=\'circuitsAction\'/>"); this.toolbar1 = ((global::Gtk.Toolbar)(this.UIManager.GetWidget ("/toolbar1"))); this.toolbar1.Name = "toolbar1"; this.toolbar1.Orientation = ((global::Gtk.Orientation)(1)); @@ -215,16 +232,16 @@ namespace DMX2 this.toolbar1.ToolbarStyle = ((global::Gtk.ToolbarStyle)(0)); this.toolbar1.IconSize = ((global::Gtk.IconSize)(2)); this.hbox1.Add (this.toolbar1); - global::Gtk.Box.BoxChild w22 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.toolbar1])); - w22.PackType = ((global::Gtk.PackType)(1)); - w22.Position = 1; - w22.Expand = false; - w22.Fill = false; + global::Gtk.Box.BoxChild w15 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.toolbar1])); + w15.PackType = ((global::Gtk.PackType)(1)); + w15.Position = 1; + w15.Expand = false; + w15.Fill = false; this.vbox2.Add (this.hbox1); - global::Gtk.Box.BoxChild w23 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.hbox1])); - w23.Position = 0; - w23.Expand = false; - w23.Fill = false; + global::Gtk.Box.BoxChild w16 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.hbox1])); + w16.Position = 0; + w16.Expand = false; + w16.Fill = false; // Container child vbox2.Gtk.Box+BoxChild this.scrolledwindow1 = new global::Gtk.ScrolledWindow (); this.scrolledwindow1.CanFocus = true; @@ -237,8 +254,8 @@ namespace DMX2 this.effetsListe.RulesHint = true; this.scrolledwindow1.Add (this.effetsListe); this.vbox2.Add (this.scrolledwindow1); - global::Gtk.Box.BoxChild w25 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.scrolledwindow1])); - w25.Position = 1; + global::Gtk.Box.BoxChild w18 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.scrolledwindow1])); + w18.Position = 1; this.alignment1.Add (this.vbox2); this.GtkAlignment.Add (this.alignment1); this.frame1.Add (this.GtkAlignment); diff --git a/DMX-2.0/gtk-gui/DMX2.SeqMidiUI.cs b/DMX-2.0/gtk-gui/DMX2.SeqMidiUI.cs new file mode 100644 index 0000000..c105e11 --- /dev/null +++ b/DMX-2.0/gtk-gui/DMX2.SeqMidiUI.cs @@ -0,0 +1,286 @@ + +// This file has been generated by the GUI designer. Do not modify. +namespace DMX2 +{ + public partial class SeqMidiUI + { + 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.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.HScale seqMasterScale; + + private global::Gtk.HBox hbox3; + + private global::Gtk.Entry txtCommand; + + private global::Gtk.Button btnCommand; + + private global::Gtk.Toolbar toolbar; + + private global::Gtk.Toolbar toolbar1; + + private global::Gtk.ScrolledWindow scrolledwindow1; + + private global::Gtk.TreeView effetsListe; + + private global::Gtk.Label titreLabel; + + protected virtual void Build () + { + global::Stetic.Gui.Initialize (this); + // Widget DMX2.SeqMidiUI + 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.UIManager.InsertActionGroup (w2, 0); + this.Name = "DMX2.SeqMidiUI"; + // Container child DMX2.SeqMidiUI.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.seqMasterScale = new global::Gtk.HScale (null); + this.seqMasterScale.CanFocus = true; + this.seqMasterScale.Name = "seqMasterScale"; + this.seqMasterScale.Adjustment.Upper = 100D; + this.seqMasterScale.Adjustment.PageIncrement = 10D; + this.seqMasterScale.Adjustment.StepIncrement = 1D; + this.seqMasterScale.Adjustment.Value = 100D; + this.seqMasterScale.DrawValue = true; + this.seqMasterScale.Digits = 0; + this.seqMasterScale.ValuePos = ((global::Gtk.PositionType)(1)); + this.vbox3.Add (this.seqMasterScale); + global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.seqMasterScale])); + w8.Position = 1; + w8.Expand = false; + w8.Fill = false; + // Container child vbox3.Gtk.Box+BoxChild + this.hbox3 = new global::Gtk.HBox (); + this.hbox3.Name = "hbox3"; + this.hbox3.Spacing = 6; + // Container child hbox3.Gtk.Box+BoxChild + this.txtCommand = new global::Gtk.Entry (); + this.txtCommand.CanFocus = true; + this.txtCommand.Name = "txtCommand"; + this.txtCommand.IsEditable = true; + this.txtCommand.InvisibleChar = '●'; + this.hbox3.Add (this.txtCommand); + global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.txtCommand])); + w9.Position = 0; + // Container child hbox3.Gtk.Box+BoxChild + this.btnCommand = new global::Gtk.Button (); + this.btnCommand.CanFocus = true; + this.btnCommand.Name = "btnCommand"; + this.btnCommand.UseUnderline = true; + this.btnCommand.Label = "Ok"; + global::Gtk.Image w10 = new global::Gtk.Image (); + w10.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-ok", global::Gtk.IconSize.Menu); + this.btnCommand.Image = w10; + this.hbox3.Add (this.btnCommand); + global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.btnCommand])); + w11.Position = 1; + w11.Expand = false; + w11.Fill = false; + this.vbox3.Add (this.hbox3); + global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.hbox3])); + w12.Position = 2; + w12.Expand = false; + w12.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 w13 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.toolbar])); + w13.Position = 3; + w13.Expand = false; + w13.Fill = false; + this.hbox1.Add (this.vbox3); + global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.vbox3])); + w14.Position = 0; + // Container child hbox1.Gtk.Box+BoxChild + this.UIManager.AddUiFromString ("<" + + "toolitem name=\'circuitsAction\' action=\'circuitsAction\'/>"); + 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 w15 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.toolbar1])); + w15.PackType = ((global::Gtk.PackType)(1)); + w15.Position = 1; + w15.Expand = false; + w15.Fill = false; + this.vbox2.Add (this.hbox1); + global::Gtk.Box.BoxChild w16 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.hbox1])); + w16.Position = 0; + w16.Expand = false; + w16.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.effetsListe = new global::Gtk.TreeView (); + this.effetsListe.CanFocus = true; + this.effetsListe.Name = "effetsListe"; + this.effetsListe.RulesHint = true; + this.scrolledwindow1.Add (this.effetsListe); + this.vbox2.Add (this.scrolledwindow1); + global::Gtk.Box.BoxChild w18 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.scrolledwindow1])); + w18.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 Macro"; + 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.circuitsAction.Activated += new global::System.EventHandler (this.OnCircuitsActionActivated); + 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.seqMasterScale.ValueChanged += new global::System.EventHandler (this.OnSeqMasterScaleValueChanged); + this.btnCommand.Clicked += new global::System.EventHandler (this.OnBtnCommandClicked); + this.effetsListe.CursorChanged += new global::System.EventHandler (this.OnEffetsListeCursorChanged); + } + } +} diff --git a/DMX-2.0/gtk-gui/gui.stetic b/DMX-2.0/gtk-gui/gui.stetic index 1303625..47df39a 100644 --- a/DMX-2.0/gtk-gui/gui.stetic +++ b/DMX-2.0/gtk-gui/gui.stetic @@ -2011,6 +2011,304 @@ au sequenceur + + + + Toggle + + + gtk-close + False + False + + + + Action + + circuits + Association des circuits +au sequenceur + + + + Action + + gtk-go-forward + + + + Action + + gtk-go-back + + + + Action + + gtk-media-pause + + + + Action + + gtk-media-next + + + Action + + gtk-add + + + + Action + + gtk-remove + + + + + False + + + + In + + + + 0 + 0 + 12 + + + + + + + 6 + + + + 6 + + + + + + + + + + 300 + 6 + + + + + 33 + 15 + 0 + <big>n° 0</big> + True + + + 0 + True + False + False + + + + + + True + True + + + 1 + False + False + + + + + + 33 + 15 + <big>00.0</big> + True + + + End + 2 + False + False + False + + + + + + + 0 + True + False + False + + + + + + True + 100 + 10 + 1 + 100 + True + 0 + Right + + + + 1 + True + False + False + + + + + + 6 + + + + True + True + + + + 0 + True + + + + + + True + TextAndIcon + stock:gtk-ok Menu + Ok + True + + + + 1 + True + False + False + + + + + 2 + True + False + False + + + + + + False + Icons + SmallToolbar + + + + + + + + + + 3 + True + False + False + + + + + 0 + False + + + + + + Vertical + False + Icons + SmallToolbar + + + + + + + End + 1 + True + False + False + + + + + 0 + True + False + False + + + + + + True + In + + + + True + True + + + + + + 1 + True + + + + + + + + + + + + Séquenceur Macro + True + + + label_item + + + + + CenterOnParent From 0fd3c6d95c3f8643489521275d3bef024c441e39 Mon Sep 17 00:00:00 2001 From: Tzim Date: Fri, 30 Jun 2017 12:02:17 +0200 Subject: [PATCH 03/22] =?UTF-8?q?Structure=20de=20donn=C3=A9es=20et=20inte?= =?UTF-8?q?rface=20de=20programmation=20OK?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DMX-2.0/DMX-2.0.csproj | 8 + DMX-2.0/MainWindow.cs | 14 +- DMX-2.0/SeqMidiUI.cs | 183 +++----------- DMX-2.0/Sequenceur.cs | 2 + DMX-2.0/SequenceurMidi.cs | 268 ++------------------- DMX-2.0/gtk-gui/DMX2.MainWindow.cs | 374 ++++++++++++++--------------- DMX-2.0/gtk-gui/DMX2.SeqMidiUI.cs | 117 +++------ DMX-2.0/gtk-gui/generated.cs | 2 + DMX-2.0/gtk-gui/gui.stetic | 88 ++----- 9 files changed, 314 insertions(+), 742 deletions(-) diff --git a/DMX-2.0/DMX-2.0.csproj b/DMX-2.0/DMX-2.0.csproj index d0e28d1..5b55327 100644 --- a/DMX-2.0/DMX-2.0.csproj +++ b/DMX-2.0/DMX-2.0.csproj @@ -83,6 +83,11 @@ loupiottes.js loupiottes.js + + + + + @@ -153,4 +158,7 @@ + + + diff --git a/DMX-2.0/MainWindow.cs b/DMX-2.0/MainWindow.cs index c7d3771..f0c1dd9 100644 --- a/DMX-2.0/MainWindow.cs +++ b/DMX-2.0/MainWindow.cs @@ -565,6 +565,14 @@ namespace DMX2 NextUpdateFull(); } + protected void OnSeqMidiActionActivated (object sender, EventArgs e) + { + Sequenceur s = new SequenceurMidi(); + Conduite.Courante.AjoutSequenceur(s); + AddSeqUI(s); + NextUpdateFull(); + } + #endregion #region Gestion de l'affichage @@ -630,7 +638,7 @@ namespace DMX2 btnAjoutLigne.Sensitive = btnRetireLigne.Sensitive = btnGo.Sensitive = btnGoBack.Sensitive = showAllAction.Sensitive = universAction.Sensitive = masterScale.Sensitive = seqLinAction.Sensitive = seqMacroAction.Sensitive = circAction.Sensitive = saveAction.Sensitive = - btnPause.Sensitive = btnBlackOut.Sensitive = seqSonAction.Sensitive = + btnPause.Sensitive = btnBlackOut.Sensitive = seqSonAction.Sensitive = seqMidiAction.Sensitive = connectAction.Sensitive = midiAction.Sensitive = saveAsAction.Sensitive = closeAction.Sensitive = true; openAction.Sensitive = newAction.Sensitive = false; @@ -642,7 +650,7 @@ namespace DMX2 btnAjoutLigne.Sensitive = btnRetireLigne.Sensitive = btnGo.Sensitive = btnGoBack.Sensitive = showAllAction.Sensitive = universAction.Sensitive = masterScale.Sensitive = seqLinAction.Sensitive = seqMacroAction.Sensitive = circAction.Sensitive = saveAction.Sensitive = - btnPause.Sensitive = btnBlackOut.Sensitive = seqSonAction.Sensitive = + btnPause.Sensitive = btnBlackOut.Sensitive = seqSonAction.Sensitive = seqMidiAction.Sensitive = connectAction.Sensitive = midiAction.Sensitive = saveAsAction.Sensitive = closeAction.Sensitive = false; openAction.Sensitive = newAction.Sensitive = true; @@ -826,5 +834,7 @@ namespace DMX2 }; } + + } } \ No newline at end of file diff --git a/DMX-2.0/SeqMidiUI.cs b/DMX-2.0/SeqMidiUI.cs index dae55d8..339fed0 100644 --- a/DMX-2.0/SeqMidiUI.cs +++ b/DMX-2.0/SeqMidiUI.cs @@ -69,7 +69,7 @@ namespace DMX2 protected void ConstruitMatrice () /* Matrice d'affichage des effets de la macro */ { - effetsListe.EnableGridLines= TreeViewGridLines.Both; + cmdList.EnableGridLines= TreeViewGridLines.Both; var idCol = new Gtk.TreeViewColumn (); var idCell = new Gtk.CellRendererText (); @@ -77,7 +77,7 @@ namespace DMX2 idCol.Title = "Num"; idCol.PackStart (idCell, true); idCol.SetCellDataFunc (idCell, new Gtk.TreeCellDataFunc (RenderMatriceNum)); - effetsListe.AppendColumn (idCol); + cmdList.AppendColumn (idCol); var nomCol = new Gtk.TreeViewColumn (); @@ -88,7 +88,7 @@ namespace DMX2 nomCol.Resizable = true; nomCell.Editable = true; nomCell.Edited += OnNomCellEdited; - effetsListe.AppendColumn (nomCol); + cmdList.AppendColumn (nomCol); var topCol = new Gtk.TreeViewColumn (); var topCell = new Gtk.CellRendererText (); @@ -97,38 +97,19 @@ namespace DMX2 topCol.SetCellDataFunc (topCell, new Gtk.TreeCellDataFunc (RenderMatriceTop)); topCell.Editable = true; topCell.Edited += OnTopCellEdited; - effetsListe.AppendColumn (topCol); + cmdList.AppendColumn (topCol); - var circuitsCol = new Gtk.TreeViewColumn (); - var circuitsCell = new Gtk.CellRendererText (); - circuitsCol.Title = "Circuits"; - circuitsCol.PackStart (circuitsCell, true); - circuitsCol.SetCellDataFunc (circuitsCell, new Gtk.TreeCellDataFunc (RenderMatriceCircuits)); - circuitsCol.Resizable = true; - circuitsCell.Editable = true; - circuitsCell.Edited += OnCircuitsCellEdited; - effetsListe.AppendColumn (circuitsCol); + var cmdCol = new Gtk.TreeViewColumn (); + var cmdCell = new Gtk.CellRendererText (); + cmdCol.Title = "Commande Midi"; + cmdCol.PackStart (cmdCell, true); + cmdCol.SetCellDataFunc (cmdCell, new TreeCellDataFunc (RenderMatriceCmd)); + cmdCell.Editable = true; + cmdCell.Edited += OnCmdCellEdited; + cmdList.AppendColumn (cmdCol); - var valeurCol = new Gtk.TreeViewColumn (); - var valeurCell = new Gtk.CellRendererText (); - valeurCol.Title = "Valeur"; - valeurCol.PackStart (valeurCell, true); - valeurCol.SetCellDataFunc (valeurCell, new Gtk.TreeCellDataFunc (RenderMatriceValeur)); - valeurCell.Editable = true; - valeurCell.Edited += OnValeurCellEdited; - effetsListe.AppendColumn (valeurCol); - - var tempsCol = new Gtk.TreeViewColumn (); - var tempsCell = new Gtk.CellRendererText (); - tempsCol.Title = "Temps"; - tempsCol.PackStart (tempsCell, true); - tempsCol.SetCellDataFunc (tempsCell, new Gtk.TreeCellDataFunc (RenderMatriceTemps)); - tempsCell.Editable = true; - tempsCell.Edited += OnTempsCellEdited; - effetsListe.AppendColumn (tempsCol); - - lsEffets = new Gtk.ListStore(typeof (SequenceurMacro.Ligne)); - this.effetsListe.Model = lsEffets; + lsEffets = new Gtk.ListStore(typeof (SequenceurMidi.Ligne)); + this.cmdList.Model = lsEffets; UpdListeEffets(); } @@ -148,45 +129,30 @@ namespace DMX2 void RenderMatriceNom (TreeViewColumn tree_column, CellRenderer cell, TreeModel tree_model, TreeIter iter) { if (Conduite.Courante==null) return; - SequenceurMacro.Ligne l = tree_model.GetValue (iter, 0) as SequenceurMacro.Ligne; + SequenceurMidi.Ligne l = tree_model.GetValue (iter, 0) as SequenceurMidi.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; - SequenceurMacro.Ligne l = tree_model.GetValue (iter, 0) as SequenceurMacro.Ligne; + SequenceurMidi.Ligne l = tree_model.GetValue (iter, 0) as SequenceurMidi.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 RenderMatriceCircuits (TreeViewColumn tree_column, CellRenderer cell, TreeModel tree_model, TreeIter iter) + void RenderMatriceCmd (TreeViewColumn tree_column, CellRenderer cell, TreeModel tree_model, TreeIter iter) { if (Conduite.Courante==null) return; - SequenceurMacro.Ligne l = tree_model.GetValue (iter, 0) as SequenceurMacro.Ligne; - (cell as Gtk.CellRendererText).Text = l.Circuits; - } - - void RenderMatriceValeur (TreeViewColumn tree_column, CellRenderer cell, TreeModel tree_model, TreeIter iter) - { - if (Conduite.Courante==null) return; - SequenceurMacro.Ligne l = tree_model.GetValue (iter, 0) as SequenceurMacro.Ligne; - (cell as Gtk.CellRendererText).Text = (l.Valeur).ToString(); - - } - - void RenderMatriceTemps (TreeViewColumn tree_column, CellRenderer cell, TreeModel tree_model, TreeIter iter) - { - if (Conduite.Courante==null) return; - SequenceurMacro.Ligne l = tree_model.GetValue (iter, 0) as SequenceurMacro.Ligne; - (cell as Gtk.CellRendererText).Text = (l.Temps.TotalMilliseconds /100).ToString(); + SequenceurMidi.Ligne l = tree_model.GetValue (iter, 0) as SequenceurMidi.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)); - SequenceurMacro.Ligne l = lsEffets.GetValue(iter,0) as SequenceurMacro.Ligne; + SequenceurMidi.Ligne l = lsEffets.GetValue(iter,0) as SequenceurMidi.Ligne; l.Nom = args.NewText; } @@ -194,7 +160,7 @@ namespace DMX2 { Gtk.TreeIter iter; lsEffets.GetIter (out iter, new Gtk.TreePath (args.Path)); - SequenceurMacro.Ligne l = lsEffets.GetValue (iter, 0) as SequenceurMacro.Ligne; + SequenceurMidi.Ligne l = lsEffets.GetValue (iter, 0) as SequenceurMidi.Ligne; if (args.NewText.Length == 0) l.Top = TimeSpan.MinValue; else { @@ -204,39 +170,14 @@ namespace DMX2 } } - void OnCircuitsCellEdited (object o, EditedArgs args) + void OnCmdCellEdited (object o, EditedArgs args) { Gtk.TreeIter iter; lsEffets.GetIter (out iter, new Gtk.TreePath (args.Path)); - SequenceurMacro.Ligne l = lsEffets.GetValue(iter,0) as SequenceurMacro.Ligne; - l.Circuits = args.NewText; + SequenceurMidi.Ligne l = lsEffets.GetValue(iter,0) as SequenceurMidi.Ligne; + l.Commande = args.NewText; } - - void OnValeurCellEdited (object o, EditedArgs args) - { - Gtk.TreeIter iter; - lsEffets.GetIter (out iter, new Gtk.TreePath (args.Path)); - SequenceurMacro.Ligne l = lsEffets.GetValue(iter,0) as SequenceurMacro.Ligne; - int val; - if(int.TryParse(args.NewText,out val)) l.Valeur = val; - } - - void OnTempsCellEdited (object o, EditedArgs args) - { - Gtk.TreeIter iter; - lsEffets.GetIter (out iter, new Gtk.TreePath (args.Path)); - SequenceurMacro.Ligne l = lsEffets.GetValue (iter, 0) as SequenceurMacro.Ligne; - if (args.NewText.Length == 0) - l.Temps = TimeSpan.Zero; - else { - int val; - if(int.TryParse(args.NewText, out val)) - l.Temps = TimeSpan.FromMilliseconds(val *100); - } - } - - void UpdListeEffets () { lsEffets.Clear(); @@ -255,23 +196,13 @@ namespace DMX2 ConstruitMatrice (); - new ContextMenuHelper(seqMasterScale,MasterPopup); new ContextMenuHelper(frame1,RenamePopup); new ContextMenuHelper(evBBox,CompteurPopup); } - void MasterPopup (object sender, ContextMenuEventArgs e) - { - Menu m = Conduite.Courante.EventManager.GetMenu(null, - delegate(object o,string eventId){ - sequenceur.BindMasterEvent(eventId); - } - ); - m.ShowAll(); - m.Popup(); - } + void CompteurPopup (object sender, ContextMenuEventArgs e) { @@ -308,36 +239,14 @@ namespace DMX2 if (effetChange) { //UpdListeEffets(); - effetsListe.QueueDraw(); + cmdList.QueueDraw(); SelectionneEffet (sequenceur.IndexLigneEnCours); posLabel.Text = string.Format("n°{0}",sequenceur.IndexLigneEnCours +1 ); } - updating = true; - seqMasterScale.Value = sequenceur.Master; - updating = false; if (DateTime.Now > nextMaj ) { nextMaj = DateTime.Now.AddMilliseconds(500); StringBuilder str = new StringBuilder (); - bool a = false; - foreach (Circuit c in sequenceur.Circuits) { - if (sequenceur.ValeurBruteCircuit (c) > 0) { - if (sequenceur.EstActif (c) != a) { - if(!a){ - str.Append (""); - a = true; - } else { - str.Append (""); - a = false; - } - } - str.Append (c.ID); str.Append (' '); - } - } - if (a) { - str.Append (""); - a = false; - } actLabel.LabelProp = str.ToString (); } } @@ -346,22 +255,10 @@ namespace DMX2 void SelectionneEffet (int index) { if(index <0 ) return; - effetsListe.SetCursor( new TreePath( new int[1] {index }) ,null,false); + cmdList.SetCursor( new TreePath( new int[1] {index }) ,null,false); effetChange = false; } - protected void OnCircuitsActionActivated (object sender, EventArgs e) - { - // récupère la fenètre principale - Window win = this.GetAncestor(Gtk.Window.GType) as Window; - var dlg = new SelSeqCircuits (sequenceur.Circuits,win); - if ((ResponseType)dlg.Run () == ResponseType.Ok) { - sequenceur.ChangeCircuits(dlg.GetResultList()); - } - dlg.Destroy(); - fullUpdFlag = true; - } - protected void OnCloseActionActivated (object sender, EventArgs e) { this.Destroy(); @@ -378,9 +275,9 @@ namespace DMX2 int IndexEffetSelectionne() { - var sel = effetsListe.Selection.GetSelectedRows(); + var sel = cmdList.Selection.GetSelectedRows(); if(sel.Length ==0) return -1; - return effetsListe.Selection.GetSelectedRows()[0].Indices[0]; + return cmdList.Selection.GetSelectedRows()[0].Indices[0]; } protected void OnGoForwardActionActivated (object sender, EventArgs e) @@ -401,18 +298,12 @@ namespace DMX2 sequenceur.Paused = ! sequenceur.Paused; } - protected void OnSeqMasterScaleValueChanged (object sender, EventArgs e) - { - if (updating)return; - sequenceur.Master = (int)(seqMasterScale.Value); - } - protected void OnBtnAjoutLigneActivated (object sender, EventArgs e) { int pos=IndexEffetSelectionne() + 1; sequenceur.AjoutLigne(pos); UpdListeEffets(); - effetsListe.SetCursor( new TreePath( new int[1] {pos }) , effetsListe.Columns[1] ,true); + cmdList.SetCursor( new TreePath( new int[1] {pos }) , cmdList.Columns[1] ,true); } protected void OnRemoveLigneActivated (object sender, EventArgs e) @@ -423,26 +314,20 @@ namespace DMX2 UpdListeEffets(); } - protected void OnEffetsListeCursorChanged (object sender, EventArgs e) + protected void OnCmdListeCursorChanged (object sender, EventArgs e) { if(effetChange) return; TreeViewColumn col; TreePath path; - effetsListe.GetCursor (out path, out col); + cmdList.GetCursor (out path, out col); - if (effetsListe.Columns [0] == col) { + if (cmdList.Columns [0] == col) { sequenceur.IndexLigneaSuivre = IndexEffetSelectionne(); } } - - - protected void OnBtnCommandClicked (object sender, EventArgs e) - { - sequenceur.CommandDirecte(txtCommand.Text ); - - } + protected void OnHbox2SizeAllocated (object o, SizeAllocatedArgs args) diff --git a/DMX-2.0/Sequenceur.cs b/DMX-2.0/Sequenceur.cs index b2d62b1..694e0df 100644 --- a/DMX-2.0/Sequenceur.cs +++ b/DMX-2.0/Sequenceur.cs @@ -84,6 +84,8 @@ namespace DMX2 return SequenceurMacro.Load(conduite,el); case "SequenceurSon": return SequenceurSon.Load(conduite,el); + case "SequenceurMidi": + return SequenceurMidi.Load(conduite,el); } return null; } diff --git a/DMX-2.0/SequenceurMidi.cs b/DMX-2.0/SequenceurMidi.cs index 3da5490..a5ac1c8 100644 --- a/DMX-2.0/SequenceurMidi.cs +++ b/DMX-2.0/SequenceurMidi.cs @@ -30,9 +30,8 @@ namespace DMX2 public Ligne(){} string nom = string.Empty; TimeSpan top = TimeSpan.MinValue; - string circuits = string.Empty; - int valeur; - TimeSpan temps = TimeSpan.Zero; + + string commande =null; public string Nom { get { @@ -52,34 +51,15 @@ namespace DMX2 } } - public string Circuits { + public string Commande { get { - return circuits; + return commande; } - set { - circuits = value; + set{ + commande = value; } } - public int Valeur { - get { - return valeur; - } - set { - valeur = value; - } - } - - public TimeSpan Temps { - get { - return temps; - } - set { - temps = value; - } - } - - public void Save (XmlElement parent) { XmlElement el = parent.OwnerDocument.CreateElement ("Ligne"); @@ -87,10 +67,8 @@ namespace DMX2 el.SetAttribute ("nom", nom); el.SetAttribute ("top", top.ToString ()); - el.SetAttribute ("circuits", circuits); - el.SetAttribute ("valeur", valeur.ToString ()); - el.SetAttribute ("temps", temps.ToString ()); + el.SetAttribute ("cmd", commande); } @@ -99,41 +77,13 @@ namespace DMX2 Ligne l = new Ligne(); l.nom = el.GetAttribute ("nom"); l.top = TimeSpan.Parse(el.GetAttribute("top")); - l.circuits = el.GetAttribute ("circuits"); - l.valeur = int.Parse(el.GetAttribute("valeur")); - l.temps = TimeSpan.Parse(el.GetAttribute("temps")); + l.commande = el.GetAttribute ("cmd"); return l; } } - public class EffetMacro - { - public EffetMacro( TimeSpan tempsTransition, int valeurInitiale, int valeurFinale) { - TempsPasse = TimeSpan.Zero; - TempsTransition = tempsTransition; - ValeurInitiale= valeurInitiale; - ValeurFinale = valeurFinale; - } - public TimeSpan TempsPasse { get; set; } - public TimeSpan TempsTransition { get; set; } - public int ValeurInitiale { get; set; } - public int ValeurFinale { get; set; } - public bool Incremente (TimeSpan delta) - { - TempsPasse += delta; - if (TempsPasse > TempsTransition) { - TempsPasse = TempsTransition; - return true; - } - return false; - } - public int ValeurCourante() - { - double progression = TempsPasse.TotalMilliseconds/TempsTransition.TotalMilliseconds; - return (int)( progression * (ValeurFinale - ValeurInitiale) + ValeurInitiale ); - } - } + List lignes = new List(); @@ -145,30 +95,12 @@ namespace DMX2 TimeSpan topSuivant = TimeSpan.Zero; bool topPresent = false; - List circuitsSeq = new List (); - - - Dictionary valeurscourantes = new Dictionary (); - Dictionary effetsEnCours = new Dictionary(); - - actionEventTargetEx masterEventTarget=null; actionEventTarget goNextEventTarget=null; actionEventTarget goBackEventTarget=null; SeqMidiUI ui = null; bool change = false; - int master = 100; - - public int Master { - get { - return master; - } - set { - master = value; - masterEventTarget.FeedBack (); - } - } bool paused=false; @@ -183,16 +115,6 @@ namespace DMX2 public SequenceurMidi () { - masterEventTarget = new actionEventTargetEx ( - delegate(EventData data) { - Master = 100 * data.value / 255; - return true; - }, - delegate{ - return Master *255/100; - }, - true - ); goNextEventTarget = new actionEventTarget ( delegate(EventData data) { @@ -273,66 +195,9 @@ namespace DMX2 } } - - public ReadOnlyCollection Circuits { - get { - return circuitsSeq.AsReadOnly (); - } - } - - public void ChangeCircuits (System.Collections.Generic.List list) - { - foreach (var c in circuitsSeq.ToArray()) { - if (!list.Contains (c)) - lock (this) RetireCircuit (c); - } - foreach (var c in list) - if (!circuitsSeq.Contains (c)) - lock (this) AjouteCircuit (c); - circuitsSeq = list; - } - - void AjouteCircuit (Circuit c) - { - valeurscourantes [c] = 0; - } - - void RetireCircuit (Circuit c) - { - circuitsSeq.Remove (c); - valeurscourantes.Remove (c); - } - - /*public override void MajCircuitsSupprimes () - { - lock (this) { - foreach (var c in circuitsSeq.ToArray()) { - if (!Conduite.Courante.Circuits.Contains (c)) - RetireCircuit (c); - } - } - }*/ - public override int ValeurCircuit (Circuit c) { - if (!valeurscourantes.ContainsKey (c)) - return 0; - if(master !=100) - return valeurscourantes [c] * master /100; - return valeurscourantes [c]; - } - - public int ValeurBruteCircuit (Circuit c) - { - if (!circuitsSeq.Contains (c)) - return 0; - return valeurscourantes [c]; - } - - public bool EstActif (Circuit c) - { - lock (this) - return effetsEnCours.ContainsKey(c); + return 0; } public override void Tick (TimeSpan time) @@ -343,19 +208,6 @@ namespace DMX2 if (Monitor.TryEnter (this)) { try { - if (effetsEnCours.Count > 0) { - List circuits = new List (effetsEnCours.Keys); - - foreach (Circuit c in circuits) { - if (effetsEnCours [c].Incremente (time)) { - valeurscourantes [c] = effetsEnCours [c].ValeurFinale; - effetsEnCours.Remove (c); - } else { - valeurscourantes [c] = effetsEnCours [c].ValeurCourante (); - } - } - } - if (topPresent) { if (timeStamp > topSuivant) { LigneSuivante (); @@ -381,8 +233,8 @@ namespace DMX2 enCours = lignes[index]; // Gestion de la Reprise - if(enCours.Circuits.ToLower().Equals("r") && ligneMaitre != null) - enCours = ligneMaitre; + // if(enCours.Circuits.ToLower().Equals("r") && ligneMaitre != null) + // enCours = ligneMaitre; if(enCours.Nom.Length!=0) { @@ -408,50 +260,18 @@ namespace DMX2 } } aSuivre = null; - LanceEffetsMacro(false,TimeSpan.Zero); + LanceCommandeMidi(); if(ui!=null) ui.EffetChange(); } } - void LanceEffetsMacro (bool ecrase, TimeSpan tempsMatrice) + void LanceCommandeMidi () { - lock (this) { - if (ecrase) - LanceEffetsMacro (enCours.Circuits, enCours.Valeur, tempsMatrice); - else - LanceEffetsMacro (enCours.Circuits, enCours.Valeur, enCours.Temps); - } + Console.WriteLine (enCours.Commande); } - void LanceEffetsMacro (string circuits, int valeurCible, TimeSpan temps) - { - if(circuits==null)return; - string[] blocs = circuits.Split(','); - foreach (string bloc in blocs) { - string[] circ = bloc.Split('-'); - int start, end; - if(! int.TryParse(circ[0], out start)) - continue; - if(circ.Length > 1) // on a affaire a un bloc (de plusieurs) - { - if(! int.TryParse(circ[1], out end)) - continue; - } - else - end= start; - for( int i = start; i<=end; i++) - { - Circuit c = Conduite.Courante.GetCircuitByID(i); - if(circuitsSeq.Contains(c)) - { - lock(this) - effetsEnCours[c] = new EffetMacro(temps,valeurscourantes[c],valeurCible); - } - } - } - } public bool LigneChange () @@ -473,21 +293,12 @@ namespace DMX2 el.SetAttribute ("name", Name); //el.SetAttribute ("master", master.ToString ()); - el.AppendChild(xmlEl = parent.OwnerDocument.CreateElement ("Master")); - xmlEl.SetAttribute("value",master.ToString()); - Conduite.Courante.EventManager.SaveBindings(xmlEl,masterEventTarget); - 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 (Circuit c in circuitsSeq) { - el.AppendChild(xmlEl = parent.OwnerDocument.CreateElement ("CircuitSeq")); - xmlEl.SetAttribute("id",c.ID.ToString()); - } - foreach (Ligne li in lignes) { li.Save(el); } @@ -511,16 +322,6 @@ namespace DMX2 ui = null; } - public void BindMasterEvent (string eventId) - { - if(eventId.Length==0) - { - Conduite.Courante.EventManager.Unbind(masterEventTarget); - return; - } - Conduite.Courante.EventManager.Bind(eventId,masterEventTarget); - } - public void BindEffetSuivantEvent (string eventId) { if (eventId.Length == 0) { @@ -554,12 +355,6 @@ namespace DMX2 XmlElement xmlE; - if ((xmlE = el["Master"]) != null) { - master = int.Parse (xmlE.TryGetAttribute("value","100")); - foreach(string id in EventManager.LoadBindings(xmlE)) - BindMasterEvent(id); - } - else master = int.Parse (el.TryGetAttribute("master","100")); if ((xmlE = el["EffetSuivant"])!= null) foreach(string id in EventManager.LoadBindings(xmlE)) @@ -569,37 +364,14 @@ namespace DMX2 foreach(string id in EventManager.LoadBindings(xmlE)) BindEffetPrecedentEvent(id); - foreach (var xc in el.GetElementsByTagName("CircuitSeq")) { - System.Xml.XmlElement xcir = xc as System.Xml.XmlElement; - Circuit c = conduite.GetCircuitByID (int.Parse (xcir.GetAttribute ("id"))); - circuitsSeq.Add (c); - AjouteCircuit (c); - } foreach (var xe in el.GetElementsByTagName("Ligne")) lignes.Add(Ligne.Load(conduite,xe as System.Xml.XmlElement)); } - static System.Text.RegularExpressions.Regex regexCommandeDirecte = new System.Text.RegularExpressions.Regex( - @"(?[\d,-]+) (?\d+) (?\d+)", - System.Text.RegularExpressions.RegexOptions.Compiled); - - - public void CommandDirecte (string text) - { - var cmd = regexCommandeDirecte.Match (text); - if (cmd.Success) { - string circuits = cmd.Groups["circuits"].Value; - - int valeur = int.Parse(cmd.Groups["valeur"].Value); - TimeSpan temps = TimeSpan.FromMilliseconds(100* int.Parse(cmd.Groups["temps"].Value)); - - LanceEffetsMacro(circuits,valeur,temps); - } - } static System.Text.RegularExpressions.Regex regexCommand1 = new System.Text.RegularExpressions.Regex( - @"(?\d+)(t(?\d+))?", + @"(?\d+)", System.Text.RegularExpressions.RegexOptions.Compiled); static System.Text.RegularExpressions.Regex regexCommand2 = new System.Text.RegularExpressions.Regex( @@ -616,7 +388,6 @@ namespace DMX2 if (cmd.Success) { if (cmd.Groups ["effet"].Success) { int effet = int.Parse (cmd.Groups ["effet"].Value) - 1; - int transition=-1; if(effet>=lignes.Count) return; enCours = lignes[effet]; @@ -636,12 +407,7 @@ namespace DMX2 } aSuivre = null; - if (cmd.Groups ["transition"].Success) { - transition = int.Parse (cmd.Groups ["transition"].Value); - LanceEffetsMacro(true, TimeSpan.FromMilliseconds(transition *100)); - } - else - LanceEffetsMacro(false,TimeSpan.Zero); + LanceCommandeMidi(); if(ui!=null) ui.EffetChange(); diff --git a/DMX-2.0/gtk-gui/DMX2.MainWindow.cs b/DMX-2.0/gtk-gui/DMX2.MainWindow.cs index 5b82d65..ec1a256 100644 --- a/DMX-2.0/gtk-gui/DMX2.MainWindow.cs +++ b/DMX-2.0/gtk-gui/DMX2.MainWindow.cs @@ -5,63 +5,123 @@ namespace DMX2 public partial class MainWindow { private global::Gtk.UIManager UIManager; + private global::Gtk.Action openAction; + private global::Gtk.Action saveAction; + private global::Gtk.Action saveAsAction; + private global::Gtk.Action quitAction; + private global::Gtk.Action closeAction; + private global::Gtk.Action TestAction; + private global::Gtk.Action circAction; + private global::Gtk.Action propertiesAction; + private global::Gtk.Action FichierAction; + private global::Gtk.Action newAction; + private global::Gtk.Action seqLinAction; + private global::Gtk.Action fullscreenAction; + private global::Gtk.Action fullscreenAction1; + private global::Gtk.Action showAllAction; + private global::Gtk.Action universAction; + private global::Gtk.Action connectAction; + private global::Gtk.Action seqMacroAction; + private global::Gtk.Action selectColorAction; + private global::Gtk.Action aboutAction; + private global::Gtk.Action midiAction; + private global::Gtk.Action connectAction1; + private global::Gtk.Action selectColorAction1; + private global::Gtk.Action seqSonAction; + private global::Gtk.Action selectColorAction2; + + private global::Gtk.Action seqMidiAction; + private global::Gtk.VBox vbox1; + private global::Gtk.HBox hbox1; + private global::Gtk.VBox vbox2; + private global::Gtk.Button btnGo; + private global::Gtk.Button btnGoBack; + private global::Gtk.Button btnAjoutLigne; + private global::Gtk.Button btnRetireLigne; + private global::Gtk.ToggleButton btnBlackOut; + private global::Gtk.ToggleButton btnPause; + private global::Gtk.EventBox evBBox; + private global::Gtk.Label timeLabel; + private global::Gtk.VScale masterScale; + private global::Gtk.EventBox evBBox1; + private global::Gtk.VBox vbox3; + private global::Gtk.Label lblPage; + private global::Gtk.Label lblpagesmall; + private global::Gtk.VSeparator vseparator1; + private global::Gtk.HPaned hpaned1; + private global::Gtk.HPaned hpaned2; + private global::Gtk.VBox vbox4; + private global::Gtk.EventBox evBBox2; + private global::Gtk.VBox vbox5; + private global::Gtk.Label labelMasterPos; + private global::Gtk.Label labelMasterNext; + private global::Gtk.ScrolledWindow GtkScrolledWindow2; + private global::Gtk.NodeView MatriceUI; + private global::Gtk.ScrolledWindow scrolledwindow2; + private global::Gtk.VBox vboxCircuits; + private global::Gtk.HSeparator hseparator1; + private global::Gtk.HBox hbox4; + private global::Gtk.Toolbar toolbar7; + private global::Gtk.EventBox evInfo; + private global::Gtk.Label lblInfo; + private global::Gtk.Toolbar toolbar8; protected virtual void Build () @@ -117,7 +177,7 @@ namespace DMX2 this.universAction.Sensitive = false; this.universAction.ShortLabel = "Univers"; w1.Add (this.universAction, null); - this.connectAction = new global::Gtk.Action ("connectAction", null, "Connecter d'un boitier", "gtk-connect"); + this.connectAction = new global::Gtk.Action ("connectAction", null, "Connecter d\'un boitier", "gtk-connect"); w1.Add (this.connectAction, null); this.seqMacroAction = new global::Gtk.Action ("seqMacroAction", null, "Ajouter un sequenceur macro", "gtk-index"); this.seqMacroAction.Sensitive = false; @@ -142,6 +202,9 @@ namespace DMX2 this.selectColorAction2.VisibleVertical = false; this.selectColorAction2.VisibleOverflown = false; w1.Add (this.selectColorAction2, null); + this.seqMidiAction = new global::Gtk.Action ("seqMidiAction", null, null, "MidiSeq"); + this.seqMidiAction.Sensitive = false; + w1.Add (this.seqMidiAction, null); this.UIManager.InsertActionGroup (w1, 0); this.AddAccelGroup (this.UIManager.AccelGroup); this.Name = "DMX2.MainWindow"; @@ -165,149 +228,83 @@ namespace DMX2 this.btnGo.CanFocus = true; this.btnGo.Name = "btnGo"; this.btnGo.UseUnderline = true; - // Container child btnGo.Gtk.Container+ContainerChild - global::Gtk.Alignment w2 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F); - // Container child GtkAlignment.Gtk.Container+ContainerChild - global::Gtk.HBox w3 = new global::Gtk.HBox (); - w3.Spacing = 2; - // Container child GtkHBox.Gtk.Container+ContainerChild - global::Gtk.Image w4 = new global::Gtk.Image (); - w4.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-goto-last", global::Gtk.IconSize.Dnd); - w3.Add (w4); - // Container child GtkHBox.Gtk.Container+ContainerChild - global::Gtk.Label w6 = new global::Gtk.Label (); - w3.Add (w6); - w2.Add (w3); - this.btnGo.Add (w2); + global::Gtk.Image w2 = new global::Gtk.Image (); + w2.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-goto-last", global::Gtk.IconSize.Dnd); + this.btnGo.Image = w2; this.vbox2.Add (this.btnGo); - global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.btnGo])); - w10.Position = 0; - w10.Expand = false; - w10.Fill = false; + global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.btnGo])); + w3.Position = 0; + w3.Expand = false; + w3.Fill = false; // Container child vbox2.Gtk.Box+BoxChild this.btnGoBack = new global::Gtk.Button (); this.btnGoBack.CanFocus = true; this.btnGoBack.Name = "btnGoBack"; this.btnGoBack.UseUnderline = true; - // Container child btnGoBack.Gtk.Container+ContainerChild - global::Gtk.Alignment w11 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F); - // Container child GtkAlignment.Gtk.Container+ContainerChild - global::Gtk.HBox w12 = new global::Gtk.HBox (); - w12.Spacing = 2; - // Container child GtkHBox.Gtk.Container+ContainerChild - global::Gtk.Image w13 = new global::Gtk.Image (); - w13.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-goto-first", global::Gtk.IconSize.Dnd); - w12.Add (w13); - // Container child GtkHBox.Gtk.Container+ContainerChild - global::Gtk.Label w15 = new global::Gtk.Label (); - w12.Add (w15); - w11.Add (w12); - this.btnGoBack.Add (w11); + global::Gtk.Image w4 = new global::Gtk.Image (); + w4.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-goto-first", global::Gtk.IconSize.Dnd); + this.btnGoBack.Image = w4; this.vbox2.Add (this.btnGoBack); - global::Gtk.Box.BoxChild w19 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.btnGoBack])); - w19.Position = 1; - w19.Expand = false; - w19.Fill = false; + global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.btnGoBack])); + w5.Position = 1; + w5.Expand = false; + w5.Fill = false; // Container child vbox2.Gtk.Box+BoxChild this.btnAjoutLigne = new global::Gtk.Button (); this.btnAjoutLigne.TooltipMarkup = "Ajoute ligne sous\ncelle selectionnée"; this.btnAjoutLigne.CanFocus = true; this.btnAjoutLigne.Name = "btnAjoutLigne"; this.btnAjoutLigne.UseUnderline = true; - // Container child btnAjoutLigne.Gtk.Container+ContainerChild - global::Gtk.Alignment w20 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F); - // Container child GtkAlignment.Gtk.Container+ContainerChild - global::Gtk.HBox w21 = new global::Gtk.HBox (); - w21.Spacing = 2; - // Container child GtkHBox.Gtk.Container+ContainerChild - global::Gtk.Image w22 = new global::Gtk.Image (); - w22.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-add", global::Gtk.IconSize.Dnd); - w21.Add (w22); - // Container child GtkHBox.Gtk.Container+ContainerChild - global::Gtk.Label w24 = new global::Gtk.Label (); - w21.Add (w24); - w20.Add (w21); - this.btnAjoutLigne.Add (w20); + global::Gtk.Image w6 = new global::Gtk.Image (); + w6.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-add", global::Gtk.IconSize.Dnd); + this.btnAjoutLigne.Image = w6; this.vbox2.Add (this.btnAjoutLigne); - global::Gtk.Box.BoxChild w28 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.btnAjoutLigne])); - w28.Position = 2; - w28.Expand = false; - w28.Fill = false; + global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.btnAjoutLigne])); + w7.Position = 2; + w7.Expand = false; + w7.Fill = false; // Container child vbox2.Gtk.Box+BoxChild this.btnRetireLigne = new global::Gtk.Button (); this.btnRetireLigne.TooltipMarkup = "Retire la ligne selectionnée"; this.btnRetireLigne.CanFocus = true; this.btnRetireLigne.Name = "btnRetireLigne"; this.btnRetireLigne.UseUnderline = true; - // Container child btnRetireLigne.Gtk.Container+ContainerChild - global::Gtk.Alignment w29 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F); - // Container child GtkAlignment.Gtk.Container+ContainerChild - global::Gtk.HBox w30 = new global::Gtk.HBox (); - w30.Spacing = 2; - // Container child GtkHBox.Gtk.Container+ContainerChild - global::Gtk.Image w31 = new global::Gtk.Image (); - w31.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-remove", global::Gtk.IconSize.Dnd); - w30.Add (w31); - // Container child GtkHBox.Gtk.Container+ContainerChild - global::Gtk.Label w33 = new global::Gtk.Label (); - w30.Add (w33); - w29.Add (w30); - this.btnRetireLigne.Add (w29); + global::Gtk.Image w8 = new global::Gtk.Image (); + w8.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-remove", global::Gtk.IconSize.Dnd); + this.btnRetireLigne.Image = w8; this.vbox2.Add (this.btnRetireLigne); - global::Gtk.Box.BoxChild w37 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.btnRetireLigne])); - w37.Position = 3; - w37.Expand = false; - w37.Fill = false; + global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.btnRetireLigne])); + w9.Position = 3; + w9.Expand = false; + w9.Fill = false; // Container child vbox2.Gtk.Box+BoxChild this.btnBlackOut = new global::Gtk.ToggleButton (); this.btnBlackOut.TooltipMarkup = "Blackout"; this.btnBlackOut.CanFocus = true; this.btnBlackOut.Name = "btnBlackOut"; this.btnBlackOut.UseUnderline = true; - // Container child btnBlackOut.Gtk.Container+ContainerChild - global::Gtk.Alignment w38 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F); - // Container child GtkAlignment.Gtk.Container+ContainerChild - global::Gtk.HBox w39 = new global::Gtk.HBox (); - w39.Spacing = 2; - // Container child GtkHBox.Gtk.Container+ContainerChild - global::Gtk.Image w40 = new global::Gtk.Image (); - w40.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-no", global::Gtk.IconSize.Dnd); - w39.Add (w40); - // Container child GtkHBox.Gtk.Container+ContainerChild - global::Gtk.Label w42 = new global::Gtk.Label (); - w39.Add (w42); - w38.Add (w39); - this.btnBlackOut.Add (w38); + global::Gtk.Image w10 = new global::Gtk.Image (); + w10.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-no", global::Gtk.IconSize.Dnd); + this.btnBlackOut.Image = w10; this.vbox2.Add (this.btnBlackOut); - global::Gtk.Box.BoxChild w46 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.btnBlackOut])); - w46.Position = 4; - w46.Expand = false; - w46.Fill = false; + global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.btnBlackOut])); + w11.Position = 4; + w11.Expand = false; + w11.Fill = false; // Container child vbox2.Gtk.Box+BoxChild this.btnPause = new global::Gtk.ToggleButton (); this.btnPause.TooltipMarkup = "Pause"; this.btnPause.CanFocus = true; this.btnPause.Name = "btnPause"; this.btnPause.UseUnderline = true; - // Container child btnPause.Gtk.Container+ContainerChild - global::Gtk.Alignment w47 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F); - // Container child GtkAlignment.Gtk.Container+ContainerChild - global::Gtk.HBox w48 = new global::Gtk.HBox (); - w48.Spacing = 2; - // Container child GtkHBox.Gtk.Container+ContainerChild - global::Gtk.Image w49 = new global::Gtk.Image (); - w49.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-media-pause", global::Gtk.IconSize.Dnd); - w48.Add (w49); - // Container child GtkHBox.Gtk.Container+ContainerChild - global::Gtk.Label w51 = new global::Gtk.Label (); - w48.Add (w51); - w47.Add (w48); - this.btnPause.Add (w47); + global::Gtk.Image w12 = new global::Gtk.Image (); + w12.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-media-pause", global::Gtk.IconSize.Dnd); + this.btnPause.Image = w12; this.vbox2.Add (this.btnPause); - global::Gtk.Box.BoxChild w55 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.btnPause])); - w55.Position = 5; - w55.Expand = false; - w55.Fill = false; + global::Gtk.Box.BoxChild w13 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.btnPause])); + w13.Position = 5; + w13.Expand = false; + w13.Fill = false; // Container child vbox2.Gtk.Box+BoxChild this.evBBox = new global::Gtk.EventBox (); this.evBBox.Name = "evBBox"; @@ -318,29 +315,29 @@ namespace DMX2 this.timeLabel.LabelProp = "0.00"; this.timeLabel.UseMarkup = true; this.timeLabel.Justify = ((global::Gtk.Justification)(2)); - this.timeLabel.Angle = 90; + this.timeLabel.Angle = 90D; this.evBBox.Add (this.timeLabel); this.vbox2.Add (this.evBBox); - global::Gtk.Box.BoxChild w57 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.evBBox])); - w57.Position = 6; - w57.Expand = false; - w57.Fill = false; + global::Gtk.Box.BoxChild w15 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.evBBox])); + w15.Position = 6; + w15.Expand = false; + w15.Fill = false; // Container child vbox2.Gtk.Box+BoxChild this.masterScale = new global::Gtk.VScale (null); this.masterScale.TooltipMarkup = "Master"; this.masterScale.HeightRequest = 75; this.masterScale.Name = "masterScale"; this.masterScale.Inverted = true; - this.masterScale.Adjustment.Upper = 100; - this.masterScale.Adjustment.PageIncrement = 10; - this.masterScale.Adjustment.StepIncrement = 1; - this.masterScale.Adjustment.Value = 100; + this.masterScale.Adjustment.Upper = 100D; + this.masterScale.Adjustment.PageIncrement = 10D; + this.masterScale.Adjustment.StepIncrement = 1D; + this.masterScale.Adjustment.Value = 100D; this.masterScale.DrawValue = true; this.masterScale.Digits = 0; this.masterScale.ValuePos = ((global::Gtk.PositionType)(2)); this.vbox2.Add (this.masterScale); - global::Gtk.Box.BoxChild w58 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.masterScale])); - w58.Position = 7; + global::Gtk.Box.BoxChild w16 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.masterScale])); + w16.Position = 7; // Container child vbox2.Gtk.Box+BoxChild this.evBBox1 = new global::Gtk.EventBox (); this.evBBox1.Name = "evBBox1"; @@ -353,10 +350,10 @@ namespace DMX2 this.lblPage.Name = "lblPage"; this.lblPage.LabelProp = "0"; this.vbox3.Add (this.lblPage); - global::Gtk.Box.BoxChild w59 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.lblPage])); - w59.Position = 0; - w59.Expand = false; - w59.Fill = false; + global::Gtk.Box.BoxChild w17 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.lblPage])); + w17.Position = 0; + w17.Expand = false; + w17.Fill = false; // Container child vbox3.Gtk.Box+BoxChild this.lblpagesmall = new global::Gtk.Label (); this.lblpagesmall.HeightRequest = 28; @@ -364,28 +361,28 @@ namespace DMX2 this.lblpagesmall.LabelProp = "midi\npage"; this.lblpagesmall.UseMarkup = true; this.vbox3.Add (this.lblpagesmall); - global::Gtk.Box.BoxChild w60 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.lblpagesmall])); - w60.Position = 1; - w60.Fill = false; + global::Gtk.Box.BoxChild w18 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.lblpagesmall])); + w18.Position = 1; + w18.Fill = false; this.evBBox1.Add (this.vbox3); this.vbox2.Add (this.evBBox1); - global::Gtk.Box.BoxChild w62 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.evBBox1])); - w62.Position = 8; - w62.Expand = false; - w62.Fill = false; + global::Gtk.Box.BoxChild w20 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.evBBox1])); + w20.Position = 8; + w20.Expand = false; + w20.Fill = false; this.hbox1.Add (this.vbox2); - global::Gtk.Box.BoxChild w63 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.vbox2])); - w63.Position = 0; - w63.Expand = false; - w63.Fill = false; + global::Gtk.Box.BoxChild w21 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.vbox2])); + w21.Position = 0; + w21.Expand = false; + w21.Fill = false; // Container child hbox1.Gtk.Box+BoxChild this.vseparator1 = new global::Gtk.VSeparator (); this.vseparator1.Name = "vseparator1"; this.hbox1.Add (this.vseparator1); - global::Gtk.Box.BoxChild w64 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.vseparator1])); - w64.Position = 1; - w64.Expand = false; - w64.Fill = false; + global::Gtk.Box.BoxChild w22 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.vseparator1])); + w22.Position = 1; + w22.Expand = false; + w22.Fill = false; // Container child hbox1.Gtk.Box+BoxChild this.hpaned1 = new global::Gtk.HPaned (); this.hpaned1.CanFocus = true; @@ -415,10 +412,10 @@ namespace DMX2 this.labelMasterPos.Xalign = 0F; this.labelMasterPos.LabelProp = "\t"; this.vbox5.Add (this.labelMasterPos); - global::Gtk.Box.BoxChild w65 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.labelMasterPos])); - w65.Position = 0; - w65.Expand = false; - w65.Fill = false; + global::Gtk.Box.BoxChild w23 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.labelMasterPos])); + w23.Position = 0; + w23.Expand = false; + w23.Fill = false; // Container child vbox5.Gtk.Box+BoxChild this.labelMasterNext = new global::Gtk.Label (); this.labelMasterNext.Name = "labelMasterNext"; @@ -426,16 +423,16 @@ namespace DMX2 this.labelMasterNext.Xalign = 0F; this.labelMasterNext.LabelProp = "\t"; this.vbox5.Add (this.labelMasterNext); - global::Gtk.Box.BoxChild w66 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.labelMasterNext])); - w66.Position = 1; - w66.Expand = false; - w66.Fill = false; + global::Gtk.Box.BoxChild w24 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.labelMasterNext])); + w24.Position = 1; + w24.Expand = false; + w24.Fill = false; this.evBBox2.Add (this.vbox5); this.vbox4.Add (this.evBBox2); - global::Gtk.Box.BoxChild w68 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.evBBox2])); - w68.Position = 0; - w68.Expand = false; - w68.Fill = false; + global::Gtk.Box.BoxChild w26 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.evBBox2])); + w26.Position = 0; + w26.Expand = false; + w26.Fill = false; // Container child vbox4.Gtk.Box+BoxChild this.GtkScrolledWindow2 = new global::Gtk.ScrolledWindow (); this.GtkScrolledWindow2.Name = "GtkScrolledWindow2"; @@ -447,14 +444,14 @@ namespace DMX2 this.MatriceUI.RulesHint = true; this.GtkScrolledWindow2.Add (this.MatriceUI); this.vbox4.Add (this.GtkScrolledWindow2); - global::Gtk.Box.BoxChild w70 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.GtkScrolledWindow2])); - w70.Position = 1; + global::Gtk.Box.BoxChild w28 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.GtkScrolledWindow2])); + w28.Position = 1; this.hpaned2.Add (this.vbox4); - global::Gtk.Paned.PanedChild w71 = ((global::Gtk.Paned.PanedChild)(this.hpaned2 [this.vbox4])); - w71.Resize = false; + global::Gtk.Paned.PanedChild w29 = ((global::Gtk.Paned.PanedChild)(this.hpaned2 [this.vbox4])); + w29.Resize = false; this.hpaned1.Add (this.hpaned2); - global::Gtk.Paned.PanedChild w72 = ((global::Gtk.Paned.PanedChild)(this.hpaned1 [this.hpaned2])); - w72.Resize = false; + global::Gtk.Paned.PanedChild w30 = ((global::Gtk.Paned.PanedChild)(this.hpaned1 [this.hpaned2])); + w30.Resize = false; // Container child hpaned1.Gtk.Paned+PanedChild this.scrolledwindow2 = new global::Gtk.ScrolledWindow (); this.scrolledwindow2.WidthRequest = 150; @@ -462,47 +459,47 @@ namespace DMX2 this.scrolledwindow2.Name = "scrolledwindow2"; this.scrolledwindow2.ShadowType = ((global::Gtk.ShadowType)(1)); // Container child scrolledwindow2.Gtk.Container+ContainerChild - global::Gtk.Viewport w73 = new global::Gtk.Viewport (); - w73.ShadowType = ((global::Gtk.ShadowType)(0)); + global::Gtk.Viewport w31 = new global::Gtk.Viewport (); + w31.ShadowType = ((global::Gtk.ShadowType)(0)); // Container child GtkViewport1.Gtk.Container+ContainerChild this.vboxCircuits = new global::Gtk.VBox (); this.vboxCircuits.Name = "vboxCircuits"; this.vboxCircuits.Spacing = 2; - w73.Add (this.vboxCircuits); - this.scrolledwindow2.Add (w73); + w31.Add (this.vboxCircuits); + this.scrolledwindow2.Add (w31); this.hpaned1.Add (this.scrolledwindow2); - global::Gtk.Paned.PanedChild w76 = ((global::Gtk.Paned.PanedChild)(this.hpaned1 [this.scrolledwindow2])); - w76.Resize = false; - w76.Shrink = false; + global::Gtk.Paned.PanedChild w34 = ((global::Gtk.Paned.PanedChild)(this.hpaned1 [this.scrolledwindow2])); + w34.Resize = false; + w34.Shrink = false; this.hbox1.Add (this.hpaned1); - global::Gtk.Box.BoxChild w77 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.hpaned1])); - w77.Position = 2; + global::Gtk.Box.BoxChild w35 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.hpaned1])); + w35.Position = 2; this.vbox1.Add (this.hbox1); - global::Gtk.Box.BoxChild w78 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.hbox1])); - w78.Position = 0; + global::Gtk.Box.BoxChild w36 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.hbox1])); + w36.Position = 0; // Container child vbox1.Gtk.Box+BoxChild this.hseparator1 = new global::Gtk.HSeparator (); this.hseparator1.Name = "hseparator1"; this.vbox1.Add (this.hseparator1); - global::Gtk.Box.BoxChild w79 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.hseparator1])); - w79.Position = 1; - w79.Expand = false; - w79.Fill = false; + global::Gtk.Box.BoxChild w37 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.hseparator1])); + w37.Position = 1; + w37.Expand = false; + w37.Fill = false; // Container child vbox1.Gtk.Box+BoxChild this.hbox4 = new global::Gtk.HBox (); this.hbox4.Name = "hbox4"; this.hbox4.Spacing = 6; // Container child hbox4.Gtk.Box+BoxChild - this.UIManager.AddUiFromString (""); + this.UIManager.AddUiFromString (@""); this.toolbar7 = ((global::Gtk.Toolbar)(this.UIManager.GetWidget ("/toolbar7"))); this.toolbar7.Name = "toolbar7"; this.toolbar7.ShowArrow = false; this.toolbar7.ToolbarStyle = ((global::Gtk.ToolbarStyle)(0)); this.hbox4.Add (this.toolbar7); - global::Gtk.Box.BoxChild w80 = ((global::Gtk.Box.BoxChild)(this.hbox4 [this.toolbar7])); - w80.Position = 0; - w80.Expand = false; - w80.Fill = false; + global::Gtk.Box.BoxChild w38 = ((global::Gtk.Box.BoxChild)(this.hbox4 [this.toolbar7])); + w38.Position = 0; + w38.Expand = false; + w38.Fill = false; // Container child hbox4.Gtk.Box+BoxChild this.evInfo = new global::Gtk.EventBox (); this.evInfo.Name = "evInfo"; @@ -512,24 +509,24 @@ namespace DMX2 this.lblInfo.LabelProp = "info"; this.evInfo.Add (this.lblInfo); this.hbox4.Add (this.evInfo); - global::Gtk.Box.BoxChild w82 = ((global::Gtk.Box.BoxChild)(this.hbox4 [this.evInfo])); - w82.Position = 1; + global::Gtk.Box.BoxChild w40 = ((global::Gtk.Box.BoxChild)(this.hbox4 [this.evInfo])); + w40.Position = 1; // Container child hbox4.Gtk.Box+BoxChild - this.UIManager.AddUiFromString (""); + this.UIManager.AddUiFromString (@""); this.toolbar8 = ((global::Gtk.Toolbar)(this.UIManager.GetWidget ("/toolbar8"))); this.toolbar8.Name = "toolbar8"; this.toolbar8.ShowArrow = false; this.toolbar8.ToolbarStyle = ((global::Gtk.ToolbarStyle)(0)); this.hbox4.Add (this.toolbar8); - global::Gtk.Box.BoxChild w83 = ((global::Gtk.Box.BoxChild)(this.hbox4 [this.toolbar8])); - w83.Position = 2; - w83.Expand = false; - w83.Fill = false; + global::Gtk.Box.BoxChild w41 = ((global::Gtk.Box.BoxChild)(this.hbox4 [this.toolbar8])); + w41.Position = 2; + w41.Expand = false; + w41.Fill = false; this.vbox1.Add (this.hbox4); - global::Gtk.Box.BoxChild w84 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.hbox4])); - w84.Position = 2; - w84.Expand = false; - w84.Fill = false; + global::Gtk.Box.BoxChild w42 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.hbox4])); + w42.Position = 2; + w42.Expand = false; + w42.Fill = false; this.Add (this.vbox1); if ((this.Child != null)) { this.Child.ShowAll (); @@ -557,6 +554,7 @@ namespace DMX2 this.selectColorAction1.Activated += new global::System.EventHandler (this.OnSelectColorActionActivated); this.seqSonAction.Activated += new global::System.EventHandler (this.OnSeqSonActionActivated); this.selectColorAction2.Activated += new global::System.EventHandler (this.OnSelectColorActionActivated); + this.seqMidiAction.Activated += new global::System.EventHandler (this.OnSeqMidiActionActivated); this.btnGo.Clicked += new global::System.EventHandler (this.OnBtnGoClicked); this.btnGoBack.Clicked += new global::System.EventHandler (this.OnBtnGoBackClicked); this.btnAjoutLigne.Clicked += new global::System.EventHandler (this.OnBtnAjoutLigneClicked); diff --git a/DMX-2.0/gtk-gui/DMX2.SeqMidiUI.cs b/DMX-2.0/gtk-gui/DMX2.SeqMidiUI.cs index c105e11..aa97bcd 100644 --- a/DMX-2.0/gtk-gui/DMX2.SeqMidiUI.cs +++ b/DMX-2.0/gtk-gui/DMX2.SeqMidiUI.cs @@ -22,6 +22,8 @@ namespace DMX2 private global::Gtk.Action btnRetireligne; + private global::Gtk.Action Action; + private global::Gtk.Frame frame1; private global::Gtk.Alignment GtkAlignment; @@ -44,21 +46,13 @@ namespace DMX2 private global::Gtk.Label timeLabel; - private global::Gtk.HScale seqMasterScale; - - private global::Gtk.HBox hbox3; - - private global::Gtk.Entry txtCommand; - - private global::Gtk.Button btnCommand; - private global::Gtk.Toolbar toolbar; private global::Gtk.Toolbar toolbar1; private global::Gtk.ScrolledWindow scrolledwindow1; - private global::Gtk.TreeView effetsListe; + private global::Gtk.TreeView cmdList; private global::Gtk.Label titreLabel; @@ -86,6 +80,8 @@ namespace DMX2 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.SeqMidiUI"; // Container child DMX2.SeqMidiUI.Gtk.Container+ContainerChild @@ -160,71 +156,23 @@ namespace DMX2 w7.Expand = false; w7.Fill = false; // Container child vbox3.Gtk.Box+BoxChild - this.seqMasterScale = new global::Gtk.HScale (null); - this.seqMasterScale.CanFocus = true; - this.seqMasterScale.Name = "seqMasterScale"; - this.seqMasterScale.Adjustment.Upper = 100D; - this.seqMasterScale.Adjustment.PageIncrement = 10D; - this.seqMasterScale.Adjustment.StepIncrement = 1D; - this.seqMasterScale.Adjustment.Value = 100D; - this.seqMasterScale.DrawValue = true; - this.seqMasterScale.Digits = 0; - this.seqMasterScale.ValuePos = ((global::Gtk.PositionType)(1)); - this.vbox3.Add (this.seqMasterScale); - global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.seqMasterScale])); - w8.Position = 1; - w8.Expand = false; - w8.Fill = false; - // Container child vbox3.Gtk.Box+BoxChild - this.hbox3 = new global::Gtk.HBox (); - this.hbox3.Name = "hbox3"; - this.hbox3.Spacing = 6; - // Container child hbox3.Gtk.Box+BoxChild - this.txtCommand = new global::Gtk.Entry (); - this.txtCommand.CanFocus = true; - this.txtCommand.Name = "txtCommand"; - this.txtCommand.IsEditable = true; - this.txtCommand.InvisibleChar = '●'; - this.hbox3.Add (this.txtCommand); - global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.txtCommand])); - w9.Position = 0; - // Container child hbox3.Gtk.Box+BoxChild - this.btnCommand = new global::Gtk.Button (); - this.btnCommand.CanFocus = true; - this.btnCommand.Name = "btnCommand"; - this.btnCommand.UseUnderline = true; - this.btnCommand.Label = "Ok"; - global::Gtk.Image w10 = new global::Gtk.Image (); - w10.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-ok", global::Gtk.IconSize.Menu); - this.btnCommand.Image = w10; - this.hbox3.Add (this.btnCommand); - global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.btnCommand])); - w11.Position = 1; - w11.Expand = false; - w11.Fill = false; - this.vbox3.Add (this.hbox3); - global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.hbox3])); - w12.Position = 2; - w12.Expand = false; - w12.Fill = false; - // Container child vbox3.Gtk.Box+BoxChild - this.UIManager.AddUiFromString (@""); + 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 w13 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.toolbar])); - w13.Position = 3; - w13.Expand = false; - w13.Fill = false; + 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 w14 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.vbox3])); - w14.Position = 0; + 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 ("<" + - "toolitem name=\'circuitsAction\' action=\'circuitsAction\'/>"); + "/toolbar>"); this.toolbar1 = ((global::Gtk.Toolbar)(this.UIManager.GetWidget ("/toolbar1"))); this.toolbar1.Name = "toolbar1"; this.toolbar1.Orientation = ((global::Gtk.Orientation)(1)); @@ -232,36 +180,36 @@ namespace DMX2 this.toolbar1.ToolbarStyle = ((global::Gtk.ToolbarStyle)(0)); this.toolbar1.IconSize = ((global::Gtk.IconSize)(2)); this.hbox1.Add (this.toolbar1); - global::Gtk.Box.BoxChild w15 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.toolbar1])); - w15.PackType = ((global::Gtk.PackType)(1)); - w15.Position = 1; - w15.Expand = false; - w15.Fill = false; + 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 w16 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.hbox1])); - w16.Position = 0; - w16.Expand = false; - w16.Fill = false; + 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.effetsListe = new global::Gtk.TreeView (); - this.effetsListe.CanFocus = true; - this.effetsListe.Name = "effetsListe"; - this.effetsListe.RulesHint = true; - this.scrolledwindow1.Add (this.effetsListe); + 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 w18 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.scrolledwindow1])); - w18.Position = 1; + 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 Macro"; + this.titreLabel.LabelProp = "Séquenceur Midi"; this.titreLabel.UseMarkup = true; this.frame1.LabelWidget = this.titreLabel; this.Add (this.frame1); @@ -271,16 +219,13 @@ namespace DMX2 w1.SetUiManager (UIManager); this.Hide (); this.closeAction.Activated += new global::System.EventHandler (this.OnCloseActionActivated); - this.circuitsAction.Activated += new global::System.EventHandler (this.OnCircuitsActionActivated); 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.seqMasterScale.ValueChanged += new global::System.EventHandler (this.OnSeqMasterScaleValueChanged); - this.btnCommand.Clicked += new global::System.EventHandler (this.OnBtnCommandClicked); - this.effetsListe.CursorChanged += new global::System.EventHandler (this.OnEffetsListeCursorChanged); + this.cmdList.CursorChanged += new global::System.EventHandler (this.OnCmdListeCursorChanged); } } } diff --git a/DMX-2.0/gtk-gui/generated.cs b/DMX-2.0/gtk-gui/generated.cs index e859413..d1ab735 100644 --- a/DMX-2.0/gtk-gui/generated.cs +++ b/DMX-2.0/gtk-gui/generated.cs @@ -75,6 +75,8 @@ namespace Stetic w15.Size = global::Gtk.IconSize.Dnd; w9.AddSource (w15); w1.Add ("circuits", w9); + global::Gtk.IconSet w16 = new global::Gtk.IconSet (global::Gdk.Pixbuf.LoadFromResource ("DMX2.icons.midiseq.audio-x-generic.svg")); + w1.Add ("MidiSeq", w16); w1.AddDefault (); } } diff --git a/DMX-2.0/gtk-gui/gui.stetic b/DMX-2.0/gtk-gui/gui.stetic index 47df39a..189c3a6 100644 --- a/DMX-2.0/gtk-gui/gui.stetic +++ b/DMX-2.0/gtk-gui/gui.stetic @@ -60,6 +60,11 @@ Dnd + + + resource:DMX2.icons.midiseq.audio-x-generic.svg + + @@ -238,6 +243,13 @@ False + + Action + + False + MidiSeq + + MainWindow @@ -623,6 +635,7 @@ page + @@ -2065,6 +2078,10 @@ au sequenceur gtk-remove + + Action + + False @@ -2155,67 +2172,6 @@ au sequenceur False - - - - True - 100 - 10 - 1 - 100 - True - 0 - Right - - - - 1 - True - False - False - - - - - - 6 - - - - True - True - - - - 0 - True - - - - - - True - TextAndIcon - stock:gtk-ok Menu - Ok - True - - - - 1 - True - False - False - - - - - 2 - True - False - False - - @@ -2228,10 +2184,11 @@ au sequenceur + - 3 + 1 True False False @@ -2252,7 +2209,6 @@ au sequenceur SmallToolbar - @@ -2277,11 +2233,11 @@ au sequenceur True In - + True True - + @@ -2299,7 +2255,7 @@ au sequenceur - Séquenceur Macro + Séquenceur Midi True From ec2ab966107be043bff24fa2056e69e8249feffa Mon Sep 17 00:00:00 2001 From: Tzim Date: Fri, 30 Jun 2017 14:11:27 +0200 Subject: [PATCH 04/22] Copie Sequenceur Midi -> Sequenceur OSC --- DMX-2.0/SeqOscUI.cs | 341 +++++++++++++ DMX-2.0/SequenceurOSC.cs | 484 +++++++++++++++++++ DMX-2.0/gtk-gui/DMX2.SeqOscUI.cs | 231 +++++++++ DMX-2.0/icons/midiseq/audio-x-generic.16.png | Bin 0 -> 688 bytes DMX-2.0/icons/midiseq/audio-x-generic.22.png | Bin 0 -> 951 bytes DMX-2.0/icons/midiseq/audio-x-generic.24.png | Bin 0 -> 1475 bytes DMX-2.0/icons/midiseq/audio-x-generic.32.png | Bin 0 -> 1486 bytes DMX-2.0/icons/midiseq/audio-x-generic.svg | 180 +++++++ 8 files changed, 1236 insertions(+) create mode 100644 DMX-2.0/SeqOscUI.cs create mode 100644 DMX-2.0/SequenceurOSC.cs create mode 100644 DMX-2.0/gtk-gui/DMX2.SeqOscUI.cs create mode 100644 DMX-2.0/icons/midiseq/audio-x-generic.16.png create mode 100644 DMX-2.0/icons/midiseq/audio-x-generic.22.png create mode 100644 DMX-2.0/icons/midiseq/audio-x-generic.24.png create mode 100644 DMX-2.0/icons/midiseq/audio-x-generic.32.png create mode 100644 DMX-2.0/icons/midiseq/audio-x-generic.svg 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 0000000000000000000000000000000000000000..2bd5af93884992dce73468227aa296a2b5780ee1 GIT binary patch literal 688 zcmV;h0#E&kP)^MF*i^r8aGC)22;clK1a-4t0{mr8nMj zAHH{dL{-^InH_BdZoB5C8+)IM=rL6chyw_sMioaCqk@1qD64G&S*GX5$4_++^bNBs z*hj(d!}9`+amccWR#c_lT;|b}2mNgU0D}Yj$@@M*5Kt_X2>c;(UXfN*p%yNX_X7~L zBcNKFC$U?^NsW4=OjoW4!68XQqGXdO-T@3oDZc{)zi)3wz2)yeco3#m6|DG^4GjQ7V%x%vUj_11a;(BhT#E787Wn}Vd zX{^gN_wxDPLn7ihuCZ2QP{h4>ZSaEUIgihtIhP+fe3G!a#7gCpvr(Hv6+$z3v%k0J z?)2oX!k*njgv}L}Dj(Sj=K#cYj9eKxTF6KGmG3_nX+`TaqczNSI0buW^u&R}@2$5i zS5umCg(L|v#zPh3D*EBaTw}D@Q!e=a3Tdi@^^AJ0fwk7Sj;t=0e-(4xiHI1YRzzjJ zL1nFx07g`m>FcHYAeXaD`$QyhT$xApa~kU_&~J`so@JRHF-BsA%rWvMP3#+tdHn}< WF%C7a=_bMe0000(k}l8B`^iCA$YIF$SY4jedgVu$TS>p%pdqG)_WtpP#$; z6H(GDk`0TsV6Xl0h)E%Nz*xAi?(k99~!u^C_6x`aOv)I!VSY>F-MHU`vO(^0}F<8?=N-!f7_p%A5%0U7*r+p<*}j|j8@xj z-~OlpF+#Ne0gMsdxh2Z}V25DD_N`b00-7aZf5p**3Ot)#m&&@ZE+SI<64Uax(ZBjIb zN67O$i_t0KKv0`RGdDlcNRs%5h|W&L@!MZ|?QZok_*$)6s)h_ygYE$*i9J7gZ+-NU zho3fg9+^&ya)W$lm1g@}Iy)_52x3h%7|u*iPCWYL<1=>R$P`7nDcgB7TVDGN=Qr`* zOSV^Wj0_Ktq-LeP$ol3IF*=;@;GO5qQFWz&g Z{sJU`uR+$N!_EKz002ovPDHLkV1n;)xqtuw literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..da6c6c5d7bf89bc95f337d1cd4b5d2e8f217fbc8 GIT binary patch literal 1475 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM3?#3wJbMaAv7|ftIx;Y9?C1WI$O_~uBzpw; zGB8xBF)%c=FfjZA3N^f7U???UV0e|lz+g3lfkC`r&aOZk1_q`D0X`wFAO#H!4h;;R zxhlSCQlVL*v9aQ@SrRds644prk?CSlU=*1q7L_3u4MO5z5m6u`t3oL%Ln6IYJ|bNt zxlkfJO(Zd2Dk?)9C>5P49s@*KVzFRGN|AI_s%T7>WN4vGYLRSYidbBhbXtjAc!qdf zj!b%qLUg)Be2z?Xu26chVt9&VLV`eAu~JN?NN6ZSRHk@%nixTQn6|bkFmR%?#ETkK z8vC_V3T0z5#NB;`fPxU<;K?5lEgX_48k`_v@5!%Y!~+o*5n=ZX5sFL|3riLYNf5Pn z=U3O}glVD<4UCSRM+?qeopj^=>POEHzIu1@{pY(MzdU^R@%D>1XYW7Tb>+^&1E;Hw zUuwN{YtG##TVK36^Xcp3A3xuJ{PN)Wn^SilZ@&3(&8nT=>-Pt5J{Y^>XvUrsMF&n- z?>}9=`$Wn1!`Yh;CTuwzy?Uqb=0j1N4@Ruo>9g@b=t_|KfE7DD*6#ILw#{YLZnq^{ z99HafT(Z@A`3}1s$I`CdTXz1&v?CYl*X;3Hw8iw`>5i*+mz=oNvu2Oq@*VaQ7pu+R zq`P#x_2R8&^ET?tTBEUYm*>)LRtq;9FWhXnbem1{6s4ZIDxI^GXRWlJz1nu#a?Ah! z|4(dP|8wDXMgJEg z66t5H&dkllE+8((d!WR?80b32ByV?@`|~m{@d7!V1s;*bz$|+mgc+SQW>)|O*-Jcq zUD+S7%J6e2wg+>|0rhxzx;TbtoKH@WU^sB%$eBZ@+H?+`J9zTwS>w*>?fvl%0UVxA z6`!W8yu9rE49o0qb9O2%IwAD=nSR8MjE|F+o}RW|K-hg+#Lld*v$npzmVaYM=H?ca zO-IBu9Wx~(Eh|}%uJt;lA*8iR;M$VhtXC(5ZksMxH)o4;Fn46qax?9ar0IQnn~vn! z)~+}r$LyTaxwpzKptJUvT7YA)adFtgzhcuI)Pw^bH5eXw9(K)aTiG{0cG|07a_#E%xhL{-aUO_QmvAUQh^kMk%6I^u7Rnpkwu81sg;3+m9ep|fq|8QLH3jE zeiRM4`6-!cmAExX?Ys<%YDtg{!TD(=<%vb94CUqJdYO6I#mR{Use1WE>9gP2NC6cw Nc)I$ztaD0e0s!|GKpOx6 literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..c60b595dac5f47609cb225f21a697ba17e4e24b9 GIT binary patch literal 1486 zcmV;<1u^=GP)b>>Xs}6Xs)UGC zRZ&Ti$_wp-r3&`}35wDps02bSPv!%(-=Ly>s9N#R7al4oYJ)_DC`y|uQ4=UADTFxo zj6LJIoH=tYd-32iFvSVjwJTn_q@^t#?X}i_|JP;jBdW^hDduyH{(k^K=6~UIeqJ22 zXZ$wDm^qX?9oL)?blkMN_dox9t-fmjo_kKrrR${`QJFPj=Q5tT8_Q95th{e@bgaAo z3;SifSS$>W>1fdE;od=q1WkFX?Io#qjg^S)1MR9iv6U|Z2`~>XHT9uo|)Qr(AhU}n9}%R1`1`* zbq2^dSwtKX+oc=UsWsoF)_99X>pdLfk|ZIKBb$1Ddnr(LzH;ZRlW}v1)27yZi?zlj zqPRs6*69Qlg0My$cQ7V{F&-iY!Qhyjc(%PW1^^oVHJbi=2#QDs&mAJ49jA~lQ5?C0 zDE3*aU8lOXLbY0ro6TnU)nkVWsFJAJIe<9!86KFzbqWMQLaXJo{K1N?RNwY*EG^qc zqm?rmSrO$z9NRZs&-=;jtSx}WW_MTvJ$d!)xz^GL>z)`I#>hXD*uJ5bf2eXHUf+B9 zg%>V{y}b`VIsF*0$D-nd!Om(xL{MO5#rKjZnfdK6E7!MTr>c;sBzAKOwm%8gf>lX! z(%8y&BZ6X4Ajxe`!8QR1RudEzve{%S7FHG21dB>0+}wuSW5E?s|i?@e8JfT02%|x*+sSvz(y!aY+Jj-04TbRrG*Z5jSxN_C<~7k_ZPj)>!W*zMot{RXYfl0zb3uQ6lc_Er4wU8N{>?{@8ji;L*uqDX%SWqPzfbf)~nZ{9mQfN68}`X3n`K13KcSY5wN zrG5cxLslyh7tc5SC}dGY+;4q%Xvv)@1ZQ7+F+X0)I*xf6Yb}Y5sISHP?<*ZY3bo;P z;%9&VtJQO9JS!r$2SV8B1aIL?`ELgf4&FX}&^4aB@w~EX@%;`<*8=*8u^nUp3S6`~X21G!&PZJ2lWH*1$(?i@+Zgzov2!oosFe3KZ1^@s607*qoM6N<$g0cp{#{d8T literal 0 HcmV?d00001 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 @@ + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Generic Audio + + + Jakub Steiner + + + + + + + + + + + + + + + + + + + From 281437c752f0f7f2b6a82864e079d5adc90c9596 Mon Sep 17 00:00:00 2001 From: Tzim Date: Fri, 30 Jun 2017 14:18:25 +0200 Subject: [PATCH 05/22] Ajout Seq OSC --- DMX-2.0/DMX-2.0.csproj | 3 + DMX-2.0/MainWindow.cs | 27 ++++- DMX-2.0/gtk-gui/gui.stetic | 237 ++++++++++++++++++++++++++++++++++++- 3 files changed, 259 insertions(+), 8 deletions(-) diff --git a/DMX-2.0/DMX-2.0.csproj b/DMX-2.0/DMX-2.0.csproj index 5b55327..82cd163 100644 --- a/DMX-2.0/DMX-2.0.csproj +++ b/DMX-2.0/DMX-2.0.csproj @@ -145,6 +145,9 @@ + + + diff --git a/DMX-2.0/MainWindow.cs b/DMX-2.0/MainWindow.cs index f0c1dd9..6725fe9 100644 --- a/DMX-2.0/MainWindow.cs +++ b/DMX-2.0/MainWindow.cs @@ -34,6 +34,8 @@ namespace DMX2 int lastSaveHash=0; bool nextChange=false; + Menu midioscMenu; + public string CurFolder{ get; set; @@ -71,6 +73,25 @@ namespace DMX2 hpaned2.Add2(seqCtn); hpaned2.ShowAll(); + midioscMenu = new Menu (); + MenuItem midiItem = new MenuItem ("Sequenceur Midi"); + MenuItem oscItem = new MenuItem ("Sequenceur OSC"); + midiItem.ButtonPressEvent+= delegate(object o, ButtonPressEventArgs args) { + Sequenceur s = new SequenceurMidi(); + Conduite.Courante.AjoutSequenceur(s); + AddSeqUI(s); + NextUpdateFull(); + }; + oscItem.ButtonPressEvent+= delegate(object o, ButtonPressEventArgs args) { + Sequenceur s = new SequenceurOSC(); + Conduite.Courante.AjoutSequenceur(s); + AddSeqUI(s); + NextUpdateFull(); + }; + midioscMenu.Add (midiItem); + midioscMenu.Add (oscItem); + midioscMenu.ShowAll (); + } @@ -567,10 +588,12 @@ namespace DMX2 protected void OnSeqMidiActionActivated (object sender, EventArgs e) { - Sequenceur s = new SequenceurMidi(); + /* Sequenceur s = new SequenceurMidi(); Conduite.Courante.AjoutSequenceur(s); AddSeqUI(s); - NextUpdateFull(); + NextUpdateFull();*/ + + midioscMenu.Popup (); } #endregion diff --git a/DMX-2.0/gtk-gui/gui.stetic b/DMX-2.0/gtk-gui/gui.stetic index 189c3a6..9c852c5 100644 --- a/DMX-2.0/gtk-gui/gui.stetic +++ b/DMX-2.0/gtk-gui/gui.stetic @@ -2035,13 +2035,238 @@ au sequenceur False - + Action - circuits - Association des circuits -au sequenceur - + gtk-go-forward + + + + Action + + gtk-go-back + + + + Action + + gtk-media-pause + + + + Action + + gtk-media-next + + + Action + + gtk-add + + + + Action + + gtk-remove + + + + Action + + + + + False + + + + In + + + + 0 + 0 + 12 + + + + + + + 6 + + + + 6 + + + + + + + + + + 300 + 6 + + + + + 33 + 15 + 0 + <big>n° 0</big> + True + + + 0 + True + False + False + + + + + + True + True + + + 1 + False + False + + + + + + 33 + 15 + <big>00.0</big> + True + + + End + 2 + False + False + False + + + + + + + 0 + True + False + False + + + + + + False + Icons + SmallToolbar + + + + + + + + + + + 1 + True + False + False + + + + + 0 + False + + + + + + Vertical + False + Icons + SmallToolbar + + + + + + End + 1 + True + False + False + + + + + 0 + True + False + False + + + + + + True + In + + + + True + True + + + + + + 1 + True + + + + + + + + + + + + Séquenceur Midi + True + + + label_item + + + + + + + + + Toggle + + + gtk-close + False + False + Action @@ -4486,4 +4711,4 @@ trames DMX (ms) - \ No newline at end of file + From 306f835e65e8afb4c241f9d22cf67e56e099e437 Mon Sep 17 00:00:00 2001 From: Tzim Date: Fri, 30 Jun 2017 14:19:07 +0200 Subject: [PATCH 06/22] Ajout Seq OSC Suite --- DMX-2.0/Sequenceur.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/DMX-2.0/Sequenceur.cs b/DMX-2.0/Sequenceur.cs index 694e0df..7e5ac68 100644 --- a/DMX-2.0/Sequenceur.cs +++ b/DMX-2.0/Sequenceur.cs @@ -85,7 +85,9 @@ namespace DMX2 case "SequenceurSon": return SequenceurSon.Load(conduite,el); case "SequenceurMidi": - return SequenceurMidi.Load(conduite,el); + return SequenceurMidi.Load(conduite,el); + case "SequenceurOSC": + return SequenceurOSC.Load(conduite,el); } return null; } From 8b1331142012ac83d35c0092b759e7f255ee9583 Mon Sep 17 00:00:00 2001 From: Tzim Date: Fri, 30 Jun 2017 14:20:53 +0200 Subject: [PATCH 07/22] =?UTF-8?q?Les=20tops=20identiques=20sont=20lanc?= =?UTF-8?q?=C3=A9s=20simultan=C3=A9ment?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DMX-2.0/SequenceurMacro.cs | 4 +--- DMX-2.0/SequenceurMidi.cs | 4 +--- DMX-2.0/SequenceurOSC.cs | 4 +--- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/DMX-2.0/SequenceurMacro.cs b/DMX-2.0/SequenceurMacro.cs index 9e29526..4b13ff2 100644 --- a/DMX-2.0/SequenceurMacro.cs +++ b/DMX-2.0/SequenceurMacro.cs @@ -356,10 +356,8 @@ namespace DMX2 } } - if (topPresent) { - if (timeStamp > topSuivant) { + while (topPresent && (timeStamp >= topSuivant)) { LigneSuivante (); - } } } finally { Monitor.Exit (this); diff --git a/DMX-2.0/SequenceurMidi.cs b/DMX-2.0/SequenceurMidi.cs index a5ac1c8..1530ab2 100644 --- a/DMX-2.0/SequenceurMidi.cs +++ b/DMX-2.0/SequenceurMidi.cs @@ -208,10 +208,8 @@ namespace DMX2 if (Monitor.TryEnter (this)) { try { - if (topPresent) { - if (timeStamp > topSuivant) { + while (topPresent &&(timeStamp >= topSuivant)) { LigneSuivante (); - } } } finally { Monitor.Exit (this); diff --git a/DMX-2.0/SequenceurOSC.cs b/DMX-2.0/SequenceurOSC.cs index 5bf8ab6..243f6f5 100644 --- a/DMX-2.0/SequenceurOSC.cs +++ b/DMX-2.0/SequenceurOSC.cs @@ -208,10 +208,8 @@ namespace DMX2 if (Monitor.TryEnter (this)) { try { - if (topPresent) { - if (timeStamp > topSuivant) { + while (topPresent&&(timeStamp >= topSuivant)) { LigneSuivante (); - } } } finally { Monitor.Exit (this); From ca1690929ebc6587ffc67f4f3a04ff5350493fc3 Mon Sep 17 00:00:00 2001 From: Tzim Date: Fri, 30 Jun 2017 16:33:09 +0200 Subject: [PATCH 08/22] POC Sequenceur MIDI --- DMX-2.0/SeqMidiUI.cs | 42 ++++++++++++ DMX-2.0/SequenceurMidi.cs | 109 ++++++++++++++++++++++++++++-- DMX-2.0/gtk-gui/DMX2.SeqMidiUI.cs | 4 -- DMX-2.0/gtk-gui/gui.stetic | 20 +++++- 4 files changed, 166 insertions(+), 9 deletions(-) diff --git a/DMX-2.0/SeqMidiUI.cs b/DMX-2.0/SeqMidiUI.cs index 339fed0..d6b7f0b 100644 --- a/DMX-2.0/SeqMidiUI.cs +++ b/DMX-2.0/SeqMidiUI.cs @@ -224,12 +224,47 @@ namespace DMX2 } ); + + item = new Gtk.SeparatorMenuItem (); + m.Add(item); + + item = new MenuItem("Connecter"); + item.Submenu = EnumMidiDevices (); + m.Add(item); + m.ShowAll(); m.Popup(); } + static public object PortKey = new object(); + + Gtk.Menu EnumMidiDevices(){ + + Gtk.Menu m = new Menu (); + + Gtk.MenuItem item; + + foreach (var dev in AlsaSeqLib.EnumClients ()) { + if(dev.Id== AlsaSeqLib.ClientId || dev.Id == 0 || dev.Id == 14 ) continue; + foreach(var port in dev.Ports){ + if((port.Caps & AlsaSeqLib.SND_SEQ_PORT_CAP_WRITE) == AlsaSeqLib.SND_SEQ_PORT_CAP_WRITE){ + string name = dev.Name+":"+port.Name; + + item = new MenuItem (name); + item.Data[PortKey] = port; + item.ButtonPressEvent+= ConnectMidiDevEvent; + m.Add (item); + + } + } + } + + return m; + } + + public override void Update (bool full) { if (fullUpdFlag || full) @@ -251,6 +286,13 @@ namespace DMX2 } } + void ConnectMidiDevEvent (object o, ButtonPressEventArgs args) + { + Gtk.MenuItem item = o as Gtk.MenuItem; + AlsaSeqLib.Port port = item.Data [PortKey] as AlsaSeqLib.Port; + sequenceur.Connect (port); + } + void SelectionneEffet (int index) { diff --git a/DMX-2.0/SequenceurMidi.cs b/DMX-2.0/SequenceurMidi.cs index 1530ab2..39f6578 100644 --- a/DMX-2.0/SequenceurMidi.cs +++ b/DMX-2.0/SequenceurMidi.cs @@ -24,14 +24,14 @@ using System.Threading; namespace DMX2 { - public class SequenceurMidi : Sequenceur + public class SequenceurMidi : Sequenceur , IDisposable { public class Ligne { public Ligne(){} string nom = string.Empty; TimeSpan top = TimeSpan.MinValue; - string commande =null; + string commande =string.Empty; public string Nom { get { @@ -104,6 +104,11 @@ namespace DMX2 bool paused=false; + int midiport=-1; + static int portnum=0; + + List mididests = new List(); + public bool Paused { get { return paused; @@ -113,6 +118,14 @@ namespace DMX2 } } + int midiCh=0; + + public int MidiCh { + get{ + return midiCh; + } + } + public SequenceurMidi () { @@ -134,8 +147,22 @@ namespace DMX2 return true; } ); + string portname = string.Format ("midi_seq_{0}", portnum++); + midiport = AlsaSeqLib.CreatePort (portname); } + bool disposed=false; + ~SequenceurMidi () + { + ((IDisposable)this).Dispose (); + } + + void IDisposable.Dispose (){ + if (disposed) + return; + disposed = true; + AlsaSeqLib.DeletePort (midiport); + } public int IndexLigneEnCours { @@ -145,6 +172,9 @@ namespace DMX2 } } + public void Connect (AlsaSeqLib.Port port){ + AlsaSeqLib.ConnectTo (midiport, port.ClientId, port.PortId); + } public int IndexLigneaSuivre { @@ -231,8 +261,19 @@ namespace DMX2 enCours = lignes[index]; // Gestion de la Reprise - // if(enCours.Circuits.ToLower().Equals("r") && ligneMaitre != null) - // enCours = ligneMaitre; + if (enCours.Commande.ToLower ().Equals ("r") && ligneMaitre != null) { + enCours = ligneMaitre; + } + + System.Text.RegularExpressions.Match m = regexGotoCmd.Match (enCours.Commande); + if (m.Success) { + int gtindex = int.Parse (m.Groups [2].Value)-1; + if (lignes.Count >= gtindex) { + timeStamp = TimeSpan.Zero; + enCours = lignes [gtindex]; + } + } + if(enCours.Nom.Length!=0) { @@ -264,10 +305,70 @@ namespace DMX2 } } + static System.Text.RegularExpressions.Regex regexMidiCmd = new System.Text.RegularExpressions.Regex( + @"(ch(\d+))|(CC(\d+),(\d+))|(PC(\d+))|(N(\d+)(\+|\-)(\d+)?)", + System.Text.RegularExpressions.RegexOptions.Compiled | System.Text.RegularExpressions.RegexOptions.IgnoreCase ); + + static System.Text.RegularExpressions.Regex regexGotoCmd = new System.Text.RegularExpressions.Regex( + @"(GT(\d+))", + System.Text.RegularExpressions.RegexOptions.Compiled | System.Text.RegularExpressions.RegexOptions.IgnoreCase ); + + void LanceCommandeMidi () { + Console.WriteLine (enCours.Commande); + + AlsaSeqLib.snd_seq_event_t ev; + var matches = regexMidiCmd.Matches (enCours.Commande); + + foreach (System.Text.RegularExpressions.Match match in matches) { + if (match.Groups [2].Success) { + midiCh = int.Parse (match.Groups [2].Value); + continue; + } + if (match.Groups [4].Success) { + ev = new AlsaSeqLib.snd_seq_event_t (); + ev.type = AlsaSeqLib.snd_seq_event_type_t.SND_SEQ_EVENT_CONTROLLER; + ev.data_ev_ctrl.channel = (byte)midiCh; + ev.data_ev_ctrl.param = uint.Parse (match.Groups [4].Value); + ev.data_ev_ctrl.value = int.Parse (match.Groups [5].Value); + ev.source.port = (byte)midiport; + AlsaSeqLib.SendEventToSubscribers (ev); + } + + if (match.Groups [7].Success) { + ev = new AlsaSeqLib.snd_seq_event_t (); + ev.type = AlsaSeqLib.snd_seq_event_type_t.SND_SEQ_EVENT_PGMCHANGE; + ev.data_ev_ctrl.channel = (byte)midiCh; + ev.data_ev_ctrl.value = int.Parse (match.Groups [7].Value); + ev.source.port = (byte)midiport; + AlsaSeqLib.SendEventToSubscribers (ev); + } + + if (match.Groups [9].Success) { + ev = new AlsaSeqLib.snd_seq_event_t (); + ev.data_ev_note.note = byte.Parse (match.Groups [9].Value); + ev.data_ev_note.channel = (byte)midiCh; + + if (match.Groups [10].Value.Equals ("+")) { + ev.type = AlsaSeqLib.snd_seq_event_type_t.SND_SEQ_EVENT_NOTEON; + if (match.Groups [11].Success) + ev.data_ev_note.velocity = byte.Parse (match.Groups [11].Value); + else + ev.data_ev_note.velocity = 127; + } else { + ev.type = AlsaSeqLib.snd_seq_event_type_t.SND_SEQ_EVENT_NOTEOFF; + if (match.Groups [11].Success) + ev.data_ev_note.off_velocity = byte.Parse (match.Groups [11].Value); + else + ev.data_ev_note.off_velocity = 0; + } + ev.source.port = (byte)midiport; + AlsaSeqLib.SendEventToSubscribers (ev); + } + } } diff --git a/DMX-2.0/gtk-gui/DMX2.SeqMidiUI.cs b/DMX-2.0/gtk-gui/DMX2.SeqMidiUI.cs index aa97bcd..a49fdd3 100644 --- a/DMX-2.0/gtk-gui/DMX2.SeqMidiUI.cs +++ b/DMX-2.0/gtk-gui/DMX2.SeqMidiUI.cs @@ -8,8 +8,6 @@ namespace DMX2 private global::Gtk.ToggleAction closeAction; - private global::Gtk.Action circuitsAction; - private global::Gtk.Action goForwardAction; private global::Gtk.Action goBackAction; @@ -66,8 +64,6 @@ namespace DMX2 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"); diff --git a/DMX-2.0/gtk-gui/gui.stetic b/DMX-2.0/gtk-gui/gui.stetic index 9c852c5..676e6a0 100644 --- a/DMX-2.0/gtk-gui/gui.stetic +++ b/DMX-2.0/gtk-gui/gui.stetic @@ -2238,6 +2238,24 @@ au sequenceur True + + + + 0 + CC : Control Change (ex: CC12,100) +PC : Program Change (ex: PC5) +N : Note On/Off (ex: N64+127 ou N12-) +GT : Go To (ex: GT4) +r: loop + True + + + 2 + True + False + False + + @@ -4711,4 +4729,4 @@ trames DMX (ms) - + \ No newline at end of file From b8af051eae0e1361cbdc6b99bce8a868fdc87d3c Mon Sep 17 00:00:00 2001 From: Tzim Date: Mon, 3 Jul 2017 10:21:11 +0200 Subject: [PATCH 09/22] Ajout text seqmidiui --- DMX-2.0/gtk-gui/DMX2.SeqMidiUI.cs | 14 ++++++++++++++ DMX-2.0/gtk-gui/gui.stetic | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/DMX-2.0/gtk-gui/DMX2.SeqMidiUI.cs b/DMX-2.0/gtk-gui/DMX2.SeqMidiUI.cs index a49fdd3..a1f872f 100644 --- a/DMX-2.0/gtk-gui/DMX2.SeqMidiUI.cs +++ b/DMX-2.0/gtk-gui/DMX2.SeqMidiUI.cs @@ -52,6 +52,8 @@ namespace DMX2 private global::Gtk.TreeView cmdList; + private global::Gtk.Label lblText; + private global::Gtk.Label titreLabel; protected virtual void Build () @@ -200,6 +202,18 @@ namespace DMX2 this.vbox2.Add (this.scrolledwindow1); global::Gtk.Box.BoxChild w13 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.scrolledwindow1])); w13.Position = 1; + // Container child vbox2.Gtk.Box+BoxChild + this.lblText = new global::Gtk.Label (); + this.lblText.Name = "lblText"; + this.lblText.Xalign = 0F; + this.lblText.LabelProp = "CC : Control Change (ex: CC12,100)\nPC : Program Change (ex: PC5)\nN : Note On/Off " + + "(ex: N64+127 ou N12-)\nGT : Go To (ex: GT4)\nr: loop"; + this.lblText.UseMarkup = true; + this.vbox2.Add (this.lblText); + global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.lblText])); + w14.Position = 2; + w14.Expand = false; + w14.Fill = false; this.alignment1.Add (this.vbox2); this.GtkAlignment.Add (this.alignment1); this.frame1.Add (this.GtkAlignment); diff --git a/DMX-2.0/gtk-gui/gui.stetic b/DMX-2.0/gtk-gui/gui.stetic index 676e6a0..e0e0cd0 100644 --- a/DMX-2.0/gtk-gui/gui.stetic +++ b/DMX-2.0/gtk-gui/gui.stetic @@ -2239,7 +2239,7 @@ au sequenceur - + 0 CC : Control Change (ex: CC12,100) From 910a3af9803a568fa4b8a16cf4d9480ab075cabf Mon Sep 17 00:00:00 2001 From: tzim Date: Tue, 4 Jul 2017 20:33:13 +0200 Subject: [PATCH 10/22] Nettoyage --- DMX-2.0/AlsaSeqLib.Invoke.cs | 2 +- DMX-2.0/AlsaSeqLib.Wrappers.cs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/DMX-2.0/AlsaSeqLib.Invoke.cs b/DMX-2.0/AlsaSeqLib.Invoke.cs index a1b0d51..7b06c9c 100644 --- a/DMX-2.0/AlsaSeqLib.Invoke.cs +++ b/DMX-2.0/AlsaSeqLib.Invoke.cs @@ -6,7 +6,7 @@ namespace DMX2 public static partial class AlsaSeqLib { - public static class Invoke + static class Invoke { const string ASOUND_LIB_NAME = "libasound.so.2"; diff --git a/DMX-2.0/AlsaSeqLib.Wrappers.cs b/DMX-2.0/AlsaSeqLib.Wrappers.cs index d0a75f2..58e145d 100644 --- a/DMX-2.0/AlsaSeqLib.Wrappers.cs +++ b/DMX-2.0/AlsaSeqLib.Wrappers.cs @@ -69,7 +69,7 @@ namespace DMX2 } } } - public static snd_seq_addr_t PtrToSndSeqAddr (this IntPtr ptr) + static snd_seq_addr_t PtrToSndSeqAddr (this IntPtr ptr) { try { return (snd_seq_addr_t)Marshal.PtrToStructure ( @@ -81,7 +81,7 @@ namespace DMX2 } } - public static IntPtr SndSeqAddrToPtr (this snd_seq_addr_t addr) + static IntPtr SndSeqAddrToPtr (this snd_seq_addr_t addr) { IntPtr ptr = typeof(snd_seq_addr_t).Malloc (); Marshal.StructureToPtr (addr, ptr, false); @@ -93,7 +93,7 @@ namespace DMX2 return Marshal.AllocHGlobal (Marshal.SizeOf (type)); } - public static string PtrToString (this IntPtr p) + static string PtrToString (this IntPtr p) { if (p == IntPtr.Zero) { return null; From cdce4bc523ce488964ead4c97ff2b083461bf917 Mon Sep 17 00:00:00 2001 From: tzim Date: Tue, 4 Jul 2017 21:06:16 +0200 Subject: [PATCH 11/22] ajout gitignore --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3f1929a --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +DMX-2.0.userprefs +DMX-2.0/bin/ +DMX-2.0/obj/ + From 404f9685871df5400fb4cd940b22ed8292a03689 Mon Sep 17 00:00:00 2001 From: Tzim Date: Wed, 5 Jul 2017 17:02:31 +0200 Subject: [PATCH 12/22] Ajout MidiPort --- DMX-2.0/AlsaSeqLib.MidiPort.cs | 129 ++++++++++++++++++++++ DMX-2.0/AlsaSeqLib.Wrappers.cs | 4 +- DMX-2.0/AlsaSeqLib.cs | 191 ++++++++------------------------- DMX-2.0/DMX-2.0.csproj | 1 + DMX-2.0/GestionMidiUI.cs | 10 +- DMX-2.0/Main.cs | 2 +- DMX-2.0/MidiEventProvider.cs | 41 +++---- DMX-2.0/SequenceurMidi.cs | 18 ++-- 8 files changed, 208 insertions(+), 188 deletions(-) create mode 100644 DMX-2.0/AlsaSeqLib.MidiPort.cs diff --git a/DMX-2.0/AlsaSeqLib.MidiPort.cs b/DMX-2.0/AlsaSeqLib.MidiPort.cs new file mode 100644 index 0000000..db700d1 --- /dev/null +++ b/DMX-2.0/AlsaSeqLib.MidiPort.cs @@ -0,0 +1,129 @@ +using System; +using System.Runtime.InteropServices; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Collections.Concurrent; + +namespace DMX2 +{ + public static partial class AlsaSeqLib + { public class MidiPort : IDisposable + { + internal ConcurrentQueue eventqueue = new ConcurrentQueue (); + + internal int portid; + public MidiPort(string portname){ + portid=Invoke.snd_seq_create_simple_port (seq_handle.Handle, + portname, + SND_SEQ_PORT_CAP_WRITE + + SND_SEQ_PORT_CAP_SUBS_WRITE + + SND_SEQ_PORT_CAP_READ + + SND_SEQ_PORT_CAP_SUBS_READ + , + SND_SEQ_PORT_TYPE_APPLICATION + ); + openports[portid]=this; + } + + bool closed = false; + public void Close() + { + if (closed) + return; + closed = true; + + Invoke.snd_seq_delete_simple_port (seq_handle.Handle, + portid); + + if(openports.ContainsKey(portid)) + if (openports [portid] == this) + openports.Remove (portid); + } + + void IDisposable.Dispose(){ + Close (); + } + + public void SendEvent(snd_seq_event_t ev){ + if (seq_handle == null) + throw new InvalidOperationException (); + + ev.source.client = (byte)clientId; + ev.source.port = (byte)portid; + ev.dest.client = SND_SEQ_ADDRESS_SUBSCRIBERS; + ev.dest.port = SND_SEQ_ADDRESS_UNKNOWN; + ev.queue = SND_SEQ_QUEUE_DIRECT; + + Marshal.StructureToPtr (ev, evOutPtr.Pointer, false); + Invoke.snd_seq_event_output (seq_handle.Handle, evOutPtr.Pointer); + Invoke.snd_seq_drain_output (seq_handle.Handle); + + } + + public bool GetEvent(out snd_seq_event_t ev){ + return eventqueue.TryDequeue (out ev); + } + + public bool ConnectTo(Port p){ + if (seq_handle == null) + throw new InvalidOperationException (); + return Invoke.snd_seq_connect_to (seq_handle.Handle, portid, p.ClientId, p.PortId) == 0; + } + + internal bool ConnectTo(int client, int port){ + if (seq_handle == null) + throw new InvalidOperationException (); + return Invoke.snd_seq_connect_to (seq_handle.Handle, portid, client, port) == 0; + } + + public bool ConnectFrom(Port p){ + if (seq_handle == null) + throw new InvalidOperationException (); + return Invoke.snd_seq_connect_from (seq_handle.Handle, portid, p.ClientId, p.PortId) == 0; + } + + public void Deconnecte(Port p){ + if (seq_handle == null) + throw new InvalidOperationException (); + snd_seq_addr_t local = new snd_seq_addr_t (); + local.client = (byte)clientId; + local.port = (byte)portid; + + snd_seq_addr_t addr; + using (PointerWrapper subqueryInfo = new PointerWrapper(GetQuerySubscribeInfoSize())) + using (PointerWrapper localAddr =new PointerWrapper(local.SndSeqAddrToPtr())) { + Invoke.snd_seq_query_subscribe_set_root (subqueryInfo.Pointer, localAddr.Pointer); + Invoke.snd_seq_query_subscribe_set_type (subqueryInfo.Pointer, SND_SEQ_QUERY_SUBS_WRITE); + + for (Invoke.snd_seq_query_subscribe_set_index(subqueryInfo.Pointer,0); + Invoke.snd_seq_query_port_subscribers (seq_handle.Handle,subqueryInfo.Pointer)>=0; + Invoke.snd_seq_query_subscribe_set_index(subqueryInfo.Pointer, + Invoke.snd_seq_query_subscribe_get_index(subqueryInfo.Pointer) +1) + ) { + addr = Invoke.snd_seq_query_subscribe_get_addr (subqueryInfo.Pointer).PtrToSndSeqAddr (); + + if (addr.client != p.ClientId || addr.port != p.PortId) + continue; + + Invoke.snd_seq_disconnect_from (seq_handle.Handle, portid, p.ClientId, p.PortId); + } + + Invoke.snd_seq_query_subscribe_set_type (subqueryInfo.Pointer, SND_SEQ_QUERY_SUBS_READ); + + for (Invoke.snd_seq_query_subscribe_set_index(subqueryInfo.Pointer,0); + Invoke.snd_seq_query_port_subscribers (seq_handle.Handle,subqueryInfo.Pointer)>=0; + Invoke.snd_seq_query_subscribe_set_index(subqueryInfo.Pointer, + Invoke.snd_seq_query_subscribe_get_index(subqueryInfo.Pointer) +1) + ) { + addr = Invoke.snd_seq_query_subscribe_get_addr (subqueryInfo.Pointer).PtrToSndSeqAddr (); + if (addr.client != p.ClientId || addr.port != p.PortId) + continue; + Invoke.snd_seq_disconnect_to (seq_handle.Handle, portid, p.ClientId, p.PortId); + } + } + } + + + } + } +} diff --git a/DMX-2.0/AlsaSeqLib.Wrappers.cs b/DMX-2.0/AlsaSeqLib.Wrappers.cs index 58e145d..eb396e8 100644 --- a/DMX-2.0/AlsaSeqLib.Wrappers.cs +++ b/DMX-2.0/AlsaSeqLib.Wrappers.cs @@ -15,10 +15,10 @@ namespace DMX2 } } - public SeqHandleWrapper () + public SeqHandleWrapper (string appname) { Invoke.snd_seq_open (out _seq, "default", SND_SEQ_OPEN_DUPLEX, 0); - Invoke.snd_seq_set_client_name (_seq, "Loupiottes"); + Invoke.snd_seq_set_client_name (_seq, appname); } ~SeqHandleWrapper () diff --git a/DMX-2.0/AlsaSeqLib.cs b/DMX-2.0/AlsaSeqLib.cs index e76c010..c3fa9e1 100644 --- a/DMX-2.0/AlsaSeqLib.cs +++ b/DMX-2.0/AlsaSeqLib.cs @@ -12,6 +12,10 @@ namespace DMX2 //static int inport; //static int outport; + static System.Threading.Thread eventthread=null; + static MidiPort systemPort=null; + + static internal Dictionary openports = new Dictionary(); public class Client { @@ -61,11 +65,12 @@ namespace DMX2 } } - public static int ClientId { + /*public static int ClientId { get { return clientId; } - } + }*/ + public class Port { int portId; @@ -115,31 +120,20 @@ namespace DMX2 } } - public static void Init () + public static void Init (string appname) { if (seq_handle != null) return; - seq_handle = new SeqHandleWrapper (); + seq_handle = new SeqHandleWrapper (appname); clientId = Invoke.snd_seq_client_id (seq_handle.Handle); - } - public static int CreatePort(string portname){ - return Invoke.snd_seq_create_simple_port (seq_handle.Handle, - portname, - SND_SEQ_PORT_CAP_WRITE - + SND_SEQ_PORT_CAP_SUBS_WRITE - + SND_SEQ_PORT_CAP_READ - + SND_SEQ_PORT_CAP_SUBS_READ - , - SND_SEQ_PORT_TYPE_APPLICATION - ); - } + System.Threading.ThreadStart ts = new System.Threading.ThreadStart (EventLoop); + eventthread = new System.Threading.Thread (ts); - public static void DeletePort(int port){ - Invoke.snd_seq_delete_simple_port (seq_handle.Handle, - port); + systemPort = new MidiPort ("system"); + systemPort.ConnectTo (SND_SEQ_CLIENT_SYSTEM, SND_SEQ_PORT_SYSTEM_ANNOUNCE); } public static void Close () @@ -150,7 +144,34 @@ namespace DMX2 seq_handle = null; } - public static bool GetEvent (out snd_seq_event_t ev) + public static void EventLoop(){ + snd_seq_event_t ev = new snd_seq_event_t ();; + while (seq_handle != null) { + while (seq_handle != null && Invoke.snd_seq_event_input_pending (seq_handle.Handle, 1) > 0) { + IntPtr evPtr; + // Recup du pointeur vers l'ev + Invoke.snd_seq_event_input (seq_handle.Handle, out evPtr); + // Copie de la zone mémoire dans une structure managee + ev = (snd_seq_event_t)Marshal.PtrToStructure (evPtr, typeof(snd_seq_event_t)); + // liberation du pointeur + Invoke.snd_seq_free_event (evPtr); + + if (ev.dest.port == systemPort.portid) { + if (ev.type == AlsaSeqLib.snd_seq_event_type_t.SND_SEQ_EVENT_PORT_START) { + + } + } else { + // queue + if (openports.ContainsKey (ev.dest.port)) { + openports [ev.dest.port].eventqueue.Enqueue (ev); + } + } + } + System.Threading.Thread.Sleep (1); + } + } + + /*static bool GetEvent (out snd_seq_event_t ev) { if (seq_handle == null) throw new InvalidOperationException (); @@ -173,32 +194,11 @@ namespace DMX2 return true; - } + }*/ static PointerWrapper evOutPtr = new PointerWrapper (32); - public static void SendEvent (snd_seq_event_t ev) - { - if (seq_handle == null) - throw new InvalidOperationException (); - ev.queue = SND_SEQ_QUEUE_DIRECT; - ev.source.client = (byte)clientId; - //ev.source.port = (byte)outport; - Marshal.StructureToPtr (ev, evOutPtr.Pointer, false); - Invoke.snd_seq_event_output (seq_handle.Handle, evOutPtr.Pointer); - Invoke.snd_seq_drain_output (seq_handle.Handle); - } - - public static void SendEventToSubscribers (snd_seq_event_t ev) - { - if (seq_handle == null) - throw new InvalidOperationException (); - ev.dest.client = SND_SEQ_ADDRESS_SUBSCRIBERS; - ev.dest.port = SND_SEQ_ADDRESS_UNKNOWN; - SendEvent (ev); - } - - public static IEnumerable EnumClients () + static IEnumerable EnumClients () { if (seq_handle == null) throw new InvalidOperationException (); @@ -210,7 +210,7 @@ namespace DMX2 } } - public static Client GetClientByID (int client) + static Client GetClientByID (int client) { if (seq_handle == null) throw new InvalidOperationException (); @@ -222,7 +222,7 @@ namespace DMX2 } } - public static Port GetPortByIDs (int client, int port) + static Port GetPortByIDs (int client, int port) { if (seq_handle == null) throw new InvalidOperationException (); @@ -234,107 +234,6 @@ namespace DMX2 } } - public static bool Connect (int localport, Port port) - { - if (seq_handle == null) - throw new InvalidOperationException (); - bool isInput = (port.Caps & SND_SEQ_PORT_CAP_WRITE) == SND_SEQ_PORT_CAP_WRITE; - bool isOutput = (port.Caps & SND_SEQ_PORT_CAP_READ) == SND_SEQ_PORT_CAP_READ; - - if (isInput) - if (!ConnectTo (localport,port.ClientId, port.PortId)) - return false; - - if (isOutput) - if (!ConnectFrom (localport,port.ClientId, port.PortId)) - return false; - - return true; - } - - public static bool ConnectTo (int localoutport, int client, int port) - { - if (seq_handle == null) - throw new InvalidOperationException (); - return Invoke.snd_seq_connect_to (seq_handle.Handle, localoutport, client, port) == 0; - } - - public static bool ConnectFrom (int localinport, int client, int port) - { - if (seq_handle == null) - throw new InvalidOperationException (); - return Invoke.snd_seq_connect_from (seq_handle.Handle, localinport, client, port) == 0; - } - - public static void Deconnecte (int localport, int client, int port) - { - if (seq_handle == null) - throw new InvalidOperationException (); - snd_seq_addr_t local = new snd_seq_addr_t (); - local.client = (byte)clientId; - local.port = (byte)localport; - - snd_seq_addr_t addr; - using (PointerWrapper subqueryInfo = new PointerWrapper(GetQuerySubscribeInfoSize())) - using (PointerWrapper localAddr =new PointerWrapper(local.SndSeqAddrToPtr())) { - Invoke.snd_seq_query_subscribe_set_root (subqueryInfo.Pointer, localAddr.Pointer); - Invoke.snd_seq_query_subscribe_set_type (subqueryInfo.Pointer, SND_SEQ_QUERY_SUBS_WRITE); - - for (Invoke.snd_seq_query_subscribe_set_index(subqueryInfo.Pointer,0); - Invoke.snd_seq_query_port_subscribers (seq_handle.Handle,subqueryInfo.Pointer)>=0; - Invoke.snd_seq_query_subscribe_set_index(subqueryInfo.Pointer, - Invoke.snd_seq_query_subscribe_get_index(subqueryInfo.Pointer) +1) - ) { - - //root = Invoke.snd_seq_query_subscribe_get_root(subqueryInfo.Pointer).PtrToSndSeqAddr(); - addr = Invoke.snd_seq_query_subscribe_get_addr (subqueryInfo.Pointer).PtrToSndSeqAddr (); - - if (addr.client != client || addr.port != port) - continue; - - Invoke.snd_seq_disconnect_from (seq_handle.Handle, localport, client, port); - - - } - - Invoke.snd_seq_query_subscribe_set_type (subqueryInfo.Pointer, SND_SEQ_QUERY_SUBS_READ); - - for (Invoke.snd_seq_query_subscribe_set_index(subqueryInfo.Pointer,0); - Invoke.snd_seq_query_port_subscribers (seq_handle.Handle,subqueryInfo.Pointer)>=0; - Invoke.snd_seq_query_subscribe_set_index(subqueryInfo.Pointer, - Invoke.snd_seq_query_subscribe_get_index(subqueryInfo.Pointer) +1) - ) { - - //root = Invoke.snd_seq_query_subscribe_get_root(subqueryInfo.Pointer).PtrToSndSeqAddr(); - addr = Invoke.snd_seq_query_subscribe_get_addr (subqueryInfo.Pointer).PtrToSndSeqAddr (); - - if (addr.client != client || addr.port != port) - continue; - - Invoke.snd_seq_disconnect_to (seq_handle.Handle, localport, client, port); - } - } - - } - - - /* - public static void GetConnections() - { - using(PointerWrapper subscribeInfo = new PointerWrapper(GetQuerySubscribeInfoSize())){ - int index=0; - Invoke.snd_seq_query_subscribe_set_client (subscribeInfo.Pointer,clientId); - Invoke.snd_seq_query_subscribe_set_port (subscribeInfo.Pointer,inport); - Invoke.snd_seq_query_subscribe_set_index(subscribeInfo.Pointer,index++); - Invoke.snd_seq_query_subscribe_set_type(subscribeInfo.Pointer,SND_SEQ_QUERY_SUBS_WRITE); - - while (Invoke.snd_seq_query_port_subscribers(seq_handle.Handle,subscribeInfo.Pointer) ==0){ - - //Console.WriteLine("Remote => {0}:{1}",rclient,rport); - Invoke.snd_seq_query_subscribe_set_index(subscribeInfo.Pointer,index++); - } - } - }*/ } } diff --git a/DMX-2.0/DMX-2.0.csproj b/DMX-2.0/DMX-2.0.csproj index 82cd163..6578677 100644 --- a/DMX-2.0/DMX-2.0.csproj +++ b/DMX-2.0/DMX-2.0.csproj @@ -148,6 +148,7 @@ + diff --git a/DMX-2.0/GestionMidiUI.cs b/DMX-2.0/GestionMidiUI.cs index 80afa71..45c6736 100644 --- a/DMX-2.0/GestionMidiUI.cs +++ b/DMX-2.0/GestionMidiUI.cs @@ -16,7 +16,7 @@ namespace DMX2 this.Build (); lsDetect = new Gtk.ListStore (typeof(string)); - lsKnown = new Gtk.ListStore (typeof(MidiEventProvider.MidiDevice)); + lsKnown = new Gtk.ListStore (typeof(MidiEventProvider.MidiControler)); var nameCol = new Gtk.TreeViewColumn (); @@ -81,7 +81,7 @@ namespace DMX2 void RenderMidiDev (Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.TreeModel tree_model, Gtk.TreeIter iter) { - MidiEventProvider.MidiDevice dev = tree_model.GetValue (iter, 0) as MidiEventProvider.MidiDevice; + MidiEventProvider.MidiControler dev = tree_model.GetValue (iter, 0) as MidiEventProvider.MidiControler; (cell as Gtk.CellRendererText).Text = dev.ConnectedPorts.Count>0 ?string.Format("{0} ({1} connectés)",dev.Name,dev.ConnectedPorts.Count) :string.Format("{0} (Déconnecté)",dev.Name); @@ -124,7 +124,7 @@ namespace DMX2 chkFB.Sensitive = btnDesactiv.Sensitive = (listKnown.Selection.CountSelectedRows() >0); TreeIter iter; if(!listKnown.Selection.GetSelected(out iter)) return; - MidiEventProvider.MidiDevice dev = lsKnown.GetValue(iter,0) as MidiEventProvider.MidiDevice ; + MidiEventProvider.MidiControler dev = lsKnown.GetValue(iter,0) as MidiEventProvider.MidiControler ; chkFB.Active = dev.HasFeedback; } @@ -144,7 +144,7 @@ namespace DMX2 { TreeIter iter; if(!listKnown.Selection.GetSelected(out iter)) return; - MidiEventProvider.MidiDevice dev = lsKnown.GetValue(iter,0) as MidiEventProvider.MidiDevice ; + MidiEventProvider.MidiControler dev = lsKnown.GetValue(iter,0) as MidiEventProvider.MidiControler ; Conduite.Courante.Midi.DisconnectDevice(dev); FillLsDetect () ; FillLsKnown(); @@ -156,7 +156,7 @@ namespace DMX2 { TreeIter iter; if(!listKnown.Selection.GetSelected(out iter)) return; - MidiEventProvider.MidiDevice dev = lsKnown.GetValue(iter,0) as MidiEventProvider.MidiDevice ; + MidiEventProvider.MidiControler dev = lsKnown.GetValue(iter,0) as MidiEventProvider.MidiControler ; dev.HasFeedback = chkFB.Active; Conduite.Courante.Midi.RefreshFeedback(dev.Name); diff --git a/DMX-2.0/Main.cs b/DMX-2.0/Main.cs index 2d74489..6a82a77 100644 --- a/DMX-2.0/Main.cs +++ b/DMX-2.0/Main.cs @@ -60,7 +60,7 @@ namespace DMX2 if (oscEn) osc = new OSCServer (); - AlsaSeqLib.Init (); + AlsaSeqLib.Init ("Loupiottes"); // Initialisation GTK# Application.Init (); diff --git a/DMX-2.0/MidiEventProvider.cs b/DMX-2.0/MidiEventProvider.cs index b7947f6..ba0ee8e 100644 --- a/DMX-2.0/MidiEventProvider.cs +++ b/DMX-2.0/MidiEventProvider.cs @@ -33,7 +33,7 @@ namespace DMX2 /// /// Liste des peripheriques connus (presents ou non) /// - readonly Dictionary knowndevices = new Dictionary (); + readonly Dictionary knowndevices = new Dictionary (); /// /// Liste des ports connectés avec feedback @@ -60,7 +60,7 @@ namespace DMX2 uint pageUpCC = 127; uint pageDownCC = 126; - int eventmidiport; + AlsaSeqLib.MidiPort midiport; public uint CurrentPage { get { @@ -133,7 +133,7 @@ namespace DMX2 public void ConnectDevice (string name) { - knowndevices.Add (name, new MidiDevice (name)); + knowndevices.Add (name, new MidiControler (name)); AutoConnect (); } @@ -150,7 +150,7 @@ namespace DMX2 } } - public void DisconnectDevice (MidiEventProvider.MidiDevice dev) + public void DisconnectDevice (MidiEventProvider.MidiControler dev) { if (!knowndevices.ContainsKey (dev.Name)) return; @@ -168,7 +168,7 @@ namespace DMX2 return knowndevices.ContainsKey (name); } - public IEnumerable KnownDevices { + public IEnumerable KnownDevices { get { return knowndevices.Values; } @@ -177,20 +177,18 @@ namespace DMX2 public MidiEventProvider (EventManager manager) { #if DEBUG - MidiDevice dev = new MidiDevice("VMPK Input:VMPK Input"); + MidiControler dev = new MidiControler("VMPK Input:VMPK Input"); dev.HasFeedback = true; knowndevices.Add(dev.Name,dev); - dev = new MidiDevice("VMPK Output:VMPK Output"); + dev = new MidiControler("VMPK Output:VMPK Output"); dev.HasFeedback = true; knowndevices.Add(dev.Name,dev); #endif manager.RegisterProvider (this); //AlsaSeqLib.Init (); - eventmidiport = AlsaSeqLib.CreatePort ("event_prov_in_out"); + midiport = new AlsaSeqLib.MidiPort("event_prov_in_out"); - AlsaSeqLib.ConnectFrom (eventmidiport,AlsaSeqLib.SND_SEQ_CLIENT_SYSTEM, AlsaSeqLib.SND_SEQ_PORT_SYSTEM_ANNOUNCE); - AutoConnect (); } @@ -275,8 +273,7 @@ namespace DMX2 public void SendEvent (AlsaSeqLib.snd_seq_event_t ev) { - ev.source.port =(byte) eventmidiport; - AlsaSeqLib.SendEventToSubscribers (ev); + midiport.SendEvent (ev); } public void Refresh () @@ -378,7 +375,7 @@ namespace DMX2 uint evpage; // Tant qu'il y des evenements midi en attente - while (AlsaSeqLib.GetEvent(out evS)) { + while (midiport.GetEvent(out evS)) { Console.WriteLine(string.Format ("event {0}", evS.type) ); string id = null; int value = 0; @@ -444,12 +441,7 @@ namespace DMX2 case AlsaSeqLib.snd_seq_event_type_t.SND_SEQ_EVENT_PGMCHANGE: CurrentPage = (uint)evS.data_ev_ctrl.value; continue; - case AlsaSeqLib.snd_seq_event_type_t.SND_SEQ_EVENT_PORT_START: - PortDetected ( - AlsaSeqLib.GetClientByID (evS.data_addr.client), - AlsaSeqLib.GetPortByIDs (evS.data_addr.client, evS.data_addr.port) - ); - continue; + /*case AlsaSeqLib.snd_seq_event_type_t.SND_SEQ_EVENT_CLOCK: case AlsaSeqLib.snd_seq_event_type_t.SND_SEQ_EVENT_SENSING: @@ -600,7 +592,8 @@ namespace DMX2 return; disposed = true; //AlsaSeqLib.Close(); - AlsaSeqLib.DeletePort(eventmidiport); + midiport.Close(); + } #endregion @@ -615,7 +608,7 @@ namespace DMX2 el.SetAttribute ("max14b", max14bValue.ToString ()); System.Xml.XmlElement xmlEl; - foreach (MidiDevice dev in knowndevices.Values) { + foreach (MidiControler dev in knowndevices.Values) { el.AppendChild (xmlEl = parent.OwnerDocument.CreateElement ("MidiDev")); xmlEl.SetAttribute ("name", dev.Name); xmlEl.SetAttribute ("feedback", dev.HasFeedback.ToString ()); @@ -642,7 +635,7 @@ namespace DMX2 System.Xml.XmlElement xdev = xd as System.Xml.XmlElement; string name = xdev.GetAttribute ("name"); if (!knowndevices.ContainsKey (name)) - knowndevices.Add (name, new MidiDevice (name)); + knowndevices.Add (name, new MidiControler (name)); knowndevices [name].HasFeedback = bool.Parse (xdev.TryGetAttribute ("feedback", "false")); } unpaginatedchannels.Clear (); @@ -813,7 +806,7 @@ namespace DMX2 #endregion } - public class MidiDevice + public class MidiControler { string name; @@ -827,7 +820,7 @@ namespace DMX2 get{ return connected;} } - public MidiDevice (string _name) + public MidiControler (string _name) { name = _name; } diff --git a/DMX-2.0/SequenceurMidi.cs b/DMX-2.0/SequenceurMidi.cs index 39f6578..a5c2e2a 100644 --- a/DMX-2.0/SequenceurMidi.cs +++ b/DMX-2.0/SequenceurMidi.cs @@ -104,7 +104,8 @@ namespace DMX2 bool paused=false; - int midiport=-1; + + AlsaSeqLib.MidiPort midiport; static int portnum=0; List mididests = new List(); @@ -148,7 +149,7 @@ namespace DMX2 } ); string portname = string.Format ("midi_seq_{0}", portnum++); - midiport = AlsaSeqLib.CreatePort (portname); + midiport = new AlsaSeqLib.MidiPort (portname); } bool disposed=false; @@ -161,7 +162,7 @@ namespace DMX2 if (disposed) return; disposed = true; - AlsaSeqLib.DeletePort (midiport); + midiport.Close (); } public int IndexLigneEnCours @@ -173,7 +174,7 @@ namespace DMX2 } public void Connect (AlsaSeqLib.Port port){ - AlsaSeqLib.ConnectTo (midiport, port.ClientId, port.PortId); + midiport.ConnectTo (port); } public int IndexLigneaSuivre @@ -334,8 +335,7 @@ namespace DMX2 ev.data_ev_ctrl.channel = (byte)midiCh; ev.data_ev_ctrl.param = uint.Parse (match.Groups [4].Value); ev.data_ev_ctrl.value = int.Parse (match.Groups [5].Value); - ev.source.port = (byte)midiport; - AlsaSeqLib.SendEventToSubscribers (ev); + midiport.SendEvent (ev); } if (match.Groups [7].Success) { @@ -343,8 +343,7 @@ namespace DMX2 ev.type = AlsaSeqLib.snd_seq_event_type_t.SND_SEQ_EVENT_PGMCHANGE; ev.data_ev_ctrl.channel = (byte)midiCh; ev.data_ev_ctrl.value = int.Parse (match.Groups [7].Value); - ev.source.port = (byte)midiport; - AlsaSeqLib.SendEventToSubscribers (ev); + midiport.SendEvent (ev); } if (match.Groups [9].Success) { @@ -365,8 +364,7 @@ namespace DMX2 else ev.data_ev_note.off_velocity = 0; } - ev.source.port = (byte)midiport; - AlsaSeqLib.SendEventToSubscribers (ev); + midiport.SendEvent (ev); } } } From e91e43b76c0dbb68362dbeb0b14573b57a19831c Mon Sep 17 00:00:00 2001 From: "arnaud.houdelette" Date: Thu, 4 Oct 2018 10:31:48 +0200 Subject: [PATCH 13/22] fin de modifs objet d'AlsaSeqLib --- DMX-2.0/AlsaSeqLib.cs | 73 +++++++++++++++++++++++++++++------- DMX-2.0/MidiEventProvider.cs | 53 +++++++++++++------------- 2 files changed, 85 insertions(+), 41 deletions(-) diff --git a/DMX-2.0/AlsaSeqLib.cs b/DMX-2.0/AlsaSeqLib.cs index c3fa9e1..1c096d0 100644 --- a/DMX-2.0/AlsaSeqLib.cs +++ b/DMX-2.0/AlsaSeqLib.cs @@ -12,10 +12,16 @@ namespace DMX2 //static int inport; //static int outport; - static System.Threading.Thread eventthread=null; - static MidiPort systemPort=null; + static System.Threading.Thread eventthread = null; + static MidiPort systemPort = null; - static internal Dictionary openports = new Dictionary(); + static internal Dictionary openports = new Dictionary(); + + public static int ClientId{ + get { + return clientId; + } + } public class Client { @@ -59,7 +65,7 @@ namespace DMX2 Invoke.snd_seq_port_info_set_client (portInfo.Pointer, id); Invoke.snd_seq_port_info_set_port (portInfo.Pointer, -1); while (Invoke.snd_seq_query_next_port(seq_handle.Handle, portInfo.Pointer) >= 0) { - ports.Add (new Port (portInfo)); + ports.Add (Port.GetPort(portInfo)); } } } @@ -78,6 +84,7 @@ namespace DMX2 string name; uint caps; uint type; + int srcid; public int ClientId { get { @@ -109,15 +116,53 @@ namespace DMX2 } } - internal Port (PointerWrapper portInfo) + public int SrcId + { + get + { + return srcid; + } + } + + private Port(int _clientId, int _portId) + { + clientId = _clientId; + portId = _portId; + srcid = clientId << 8 + portId; + } + + private void Updateinfo (PointerWrapper portInfo) { - clientId = Invoke.snd_seq_port_info_get_client (portInfo.Pointer); - portId = Invoke.snd_seq_port_info_get_port (portInfo.Pointer); IntPtr namePtr = Invoke.snd_seq_port_info_get_name (portInfo.Pointer); caps = Invoke.snd_seq_port_info_get_capability (portInfo.Pointer); type = Invoke.snd_seq_port_info_get_type (portInfo.Pointer); name = namePtr.PtrToString (); } + + internal static Port GetPort(PointerWrapper portInfo) + { + Port p; + int clientId = Invoke.snd_seq_port_info_get_client(portInfo.Pointer); + int portId = Invoke.snd_seq_port_info_get_port(portInfo.Pointer); + int srcid = clientId << 8 + portId; + + if (ports.ContainsKey(srcid)) + p = ports[srcid]; + else + p = new Port(clientId, portId); + + p.Updateinfo(portInfo); + return p; + } + internal static Port GetPort(int clientId, int portId) + { + int srcid = clientId << 8 + portId; + if (ports.ContainsKey(srcid)) + return ports[srcid]; + return null; + } + + static Dictionary ports = new Dictionary(); } public static void Init (string appname) @@ -131,7 +176,7 @@ namespace DMX2 System.Threading.ThreadStart ts = new System.Threading.ThreadStart (EventLoop); eventthread = new System.Threading.Thread (ts); - + eventthread.Start(); systemPort = new MidiPort ("system"); systemPort.ConnectTo (SND_SEQ_CLIENT_SYSTEM, SND_SEQ_PORT_SYSTEM_ANNOUNCE); } @@ -198,7 +243,7 @@ namespace DMX2 static PointerWrapper evOutPtr = new PointerWrapper (32); - static IEnumerable EnumClients () + public static IEnumerable EnumClients () { if (seq_handle == null) throw new InvalidOperationException (); @@ -210,7 +255,7 @@ namespace DMX2 } } - static Client GetClientByID (int client) + public static Client GetClientByID (int client) { if (seq_handle == null) throw new InvalidOperationException (); @@ -222,15 +267,15 @@ namespace DMX2 } } - static Port GetPortByIDs (int client, int port) + public static Port GetPortByIDs (int clientid, int portid) { if (seq_handle == null) throw new InvalidOperationException (); using (PointerWrapper portInfo = new PointerWrapper(GetPortInfoSize ())) { - if (Invoke.snd_seq_get_any_port_info (seq_handle.Handle, client, port, portInfo.Pointer) >= 0) { - return new Port (portInfo); + if (Invoke.snd_seq_get_any_port_info (seq_handle.Handle, clientid, portid, portInfo.Pointer) >= 0) { + return Port.GetPort (portInfo); } else - return null; + return Port.GetPort (clientid,portid); } } diff --git a/DMX-2.0/MidiEventProvider.cs b/DMX-2.0/MidiEventProvider.cs index ba0ee8e..5c83a39 100644 --- a/DMX-2.0/MidiEventProvider.cs +++ b/DMX-2.0/MidiEventProvider.cs @@ -38,7 +38,7 @@ namespace DMX2 /// /// Liste des ports connectés avec feedback /// - readonly List feedbacksources = new List (); + readonly List feedbacksources = new List (); //static readonly Dictionary srcidToDev = new Dictionary(); readonly List unpaginatedchannels = new List (); @@ -139,7 +139,7 @@ namespace DMX2 public void RefreshFeedback (string name) { - foreach (int port in knowndevices[name].ConnectedPorts) { + foreach (AlsaSeqLib.Port port in knowndevices[name].ConnectedPorts) { if (knowndevices [name].HasFeedback) { if (!feedbacksources.Contains (port)) feedbacksources.Add (port); @@ -156,10 +156,8 @@ namespace DMX2 return; knowndevices.Remove (dev.Name); - foreach (int connectedport in dev.ConnectedPorts) { - int client = connectedport >> 8; - int port = connectedport & 0xFF; - AlsaSeqLib.Deconnecte (eventmidiport, client, port); + foreach (AlsaSeqLib.Port connectedport in dev.ConnectedPorts) { + midiport.Deconnecte ( connectedport); } } @@ -212,13 +210,14 @@ namespace DMX2 string fullportname = cli.Name + ':' + p.Name; if (knowndevices.ContainsKey (fullportname)) { int srcid = p.ClientId << 8 + p.PortId; - if (knowndevices [fullportname].ConnectedPorts.Contains (srcid)) + if (knowndevices [fullportname].ConnectedPorts.Contains (p)) return; - AlsaSeqLib.Connect (eventmidiport,p); + midiport.ConnectFrom(p); + midiport.ConnectTo(p); } } - + void PortConnect (AlsaSeqLib.snd_seq_connect_t cn, bool connect) { int clientId, portId; @@ -230,16 +229,18 @@ namespace DMX2 portId = cn.dest.port; } - int srcid = clientId << 8 + portId; + AlsaSeqLib.Port p = AlsaSeqLib.GetPortByIDs(clientId, portId); + if (connect) { - string fpname = AlsaSeqLib.GetClientByID (clientId).Name + ":" + AlsaSeqLib.GetPortByIDs (clientId, portId).Name; + AlsaSeqLib.Client c = AlsaSeqLib.GetClientByID(clientId); + string fpname = c.Name + ":" + p.Name; if (!knowndevices.ContainsKey (fpname)) return; - if (knowndevices [fpname].ConnectedPorts.Contains (srcid)) + if (knowndevices [fpname].ConnectedPorts.Contains (p)) return; - knowndevices [fpname].ConnectedPorts.Add (srcid); + knowndevices [fpname].ConnectedPorts.Add (p); if (knowndevices [fpname].HasFeedback) - feedbacksources.Add (srcid); + feedbacksources.Add (p); guirefreshflag = true; //srcidToDev[srcid] = knowndevices [fpname]; @@ -248,10 +249,8 @@ namespace DMX2 } foreach (var dev in knowndevices.Values) { - if (dev.ConnectedPorts.Contains (srcid)) { - /*if(srcidToDev.ContainsKey(srcid)) - srcidToDev.Remove(srcid);*/ - dev.ConnectedPorts.Remove (srcid); + if (dev.ConnectedPorts.Contains (p)) { + dev.ConnectedPorts.Remove (p); guirefreshflag = true; return; } @@ -266,7 +265,7 @@ namespace DMX2 } } - protected bool HasFeedback (int source) + protected bool HasFeedback (AlsaSeqLib.Port source) { return feedbacksources.Contains (source); } @@ -275,14 +274,14 @@ namespace DMX2 { midiport.SendEvent (ev); } - + public void Refresh () { foreach (var ievent in eventlist.Values) { if (ievent.Page == page) { ievent.SendFeedback(); - foreach (int src in feedbacksources) { - int lnvk = CombineHash (src, ievent.MidiEvCode); + foreach (AlsaSeqLib.Port src in feedbacksources) { + int lnvk = CombineHash (src.SrcId, ievent.MidiEvCode); if (ievent.LastKnownValue != -1) lastValueOfSrc [lnvk] = (byte)ievent.LastKnownValue; } @@ -789,13 +788,13 @@ namespace DMX2 #region IFeedbackInfo implementation bool IFeedbackInfo.FeedBack (byte data) { - + iev.LastKnownValue = data; if (prov.CurrentPage == iev.Page || iev.Page == 0) { iev.SendFeedback(); - foreach (int src in prov.feedbacksources) { - int lnvk = CombineHash (src, iev.MidiEvCode); + foreach (AlsaSeqLib.Port src in prov.feedbacksources) { + int lnvk = CombineHash (src.SrcId, iev.MidiEvCode); if (iev.LastKnownValue != -1) prov.lastValueOfSrc [lnvk] = (byte)iev.LastKnownValue; } @@ -814,9 +813,9 @@ namespace DMX2 public bool HasFeedback { get; set; } - readonly List connected = new List (); + readonly List connected = new List (); - public List ConnectedPorts { + public List ConnectedPorts { get{ return connected;} } From dac480d5bf6f7c7e645af6e558f857f408a91b08 Mon Sep 17 00:00:00 2001 From: "arnaud.houdelette" Date: Thu, 4 Oct 2018 17:12:24 +0200 Subject: [PATCH 14/22] Implementation seq OSC --- DMX-2.0/DMX-2.0.csproj | 1 + DMX-2.0/OSCMessage.cs | 323 ++++++++++++++ DMX-2.0/OSCServer.cs | 289 +----------- DMX-2.0/SeqOscUI.cs | 7 +- DMX-2.0/SequenceurOSC.cs | 62 ++- DMX-2.0/gtk-gui/DMX2.About.cs | 34 +- DMX-2.0/gtk-gui/DMX2.DriverBoitierV1UI.cs | 81 ++-- DMX-2.0/gtk-gui/DMX2.DriverBoitierV2UI.cs | 153 ++++--- DMX-2.0/gtk-gui/DMX2.DriverBoitierV3UI.cs | 178 ++++---- DMX-2.0/gtk-gui/DMX2.EditionUnivers.cs | 450 +++++++++---------- DMX-2.0/gtk-gui/DMX2.GestionCircuits.cs | 68 +-- DMX-2.0/gtk-gui/DMX2.GestionDriversUI.cs | 82 ++-- DMX-2.0/gtk-gui/DMX2.GestionMidiUI.cs | 408 ++++++++--------- DMX-2.0/gtk-gui/DMX2.MainWindow.cs | 517 +++++++++++----------- DMX-2.0/gtk-gui/DMX2.SelSeqCircuits.cs | 297 ++++++------- DMX-2.0/gtk-gui/DMX2.SeqLinUI.cs | 258 ++++++----- DMX-2.0/gtk-gui/DMX2.SeqMacroUI.cs | 245 +++++----- DMX-2.0/gtk-gui/DMX2.SeqMidiUI.cs | 213 ++++----- DMX-2.0/gtk-gui/DMX2.SeqOscUI.cs | 257 ++++++----- DMX-2.0/gtk-gui/DMX2.SeqSonUI.cs | 507 ++++++++++----------- DMX-2.0/gtk-gui/generated.cs | 200 +++++---- DMX-2.0/gtk-gui/gui.stetic | 73 ++- 22 files changed, 2435 insertions(+), 2268 deletions(-) create mode 100644 DMX-2.0/OSCMessage.cs diff --git a/DMX-2.0/DMX-2.0.csproj b/DMX-2.0/DMX-2.0.csproj index 6578677..1167d22 100644 --- a/DMX-2.0/DMX-2.0.csproj +++ b/DMX-2.0/DMX-2.0.csproj @@ -149,6 +149,7 @@ + diff --git a/DMX-2.0/OSCMessage.cs b/DMX-2.0/OSCMessage.cs new file mode 100644 index 0000000..982581f --- /dev/null +++ b/DMX-2.0/OSCMessage.cs @@ -0,0 +1,323 @@ +using System; +namespace DMX2 +{ + public class OSCMessage + { + + public enum OSCType + { + Int32, + Float32, + String, + Blob + } + + + public abstract class OSCArg + { + protected OSCArg() { } + public abstract OSCType Type { get; } + public virtual string GetString() { throw new System.NotImplementedException(); } + public virtual float GetFloat() { throw new System.NotImplementedException(); } + public virtual int GetInt() { throw new System.NotImplementedException(); } + public virtual byte[] GetBlob() { throw new System.NotImplementedException(); } + } + + private class OSCStringArg : OSCArg + { + string _s; + public override OSCType Type + { + get + { + return OSCType.String; + } + } + public OSCStringArg(string s) + { + _s = s; + } + public override string GetString() + { + return _s; + } + public override float GetFloat() + { + float f; + if (float.TryParse(_s, out f)) return f; + return 0.0f; + } + public override int GetInt() + { + return (int)GetFloat(); + } + } + private class OSCIntArg : OSCArg + { + int _i; + public override OSCType Type + { + get + { + return OSCType.Int32; + } + } + public OSCIntArg(int i) + { + _i = i; + } + public override int GetInt() + { + return _i; + } + public override float GetFloat() + { + return (float)_i; + } + public override string GetString() + { + return _i.ToString(); + } + + } + private class OSCFloatArg : OSCArg + { + float _f; + public override OSCType Type + { + get + { + return OSCType.Float32; + } + } + public OSCFloatArg(float f) + { + _f = f; + } + public override int GetInt() + { + return (int)(_f); + } + public override float GetFloat() + { + return _f; + } + public override string GetString() + { + return _f.ToString(); + } + + } + private class OSCBlobArg : OSCArg + { + byte[] _b; + public override OSCType Type + { + get + { + return OSCType.Blob; + } + } + public OSCBlobArg(byte[] b) + { + _b = b; + } + public override byte[] GetBlob() + { + return _b; + } + + } + + static string DecodeString(byte[] b, ref int pos) + { + int end = Array.IndexOf(b, 0, pos); + if (end == -1) end = b.Length; + string ret = System.Text.Encoding.ASCII.GetString(b, pos, end - pos); + pos = (end / 4 + 1) * 4; + return ret; + } + + static float DecodeFloat(byte[] b, ref int pos) + { + if (BitConverter.IsLittleEndian) + Array.Reverse(b, pos, 4); + float ret = BitConverter.ToSingle(b, pos); + pos += 4; + return ret; + } + + static int DecodeInt(byte[] b, ref int pos) + { + if (BitConverter.IsLittleEndian) + Array.Reverse(b, pos, 4); + int ret = BitConverter.ToInt32(b, pos); + pos += 4; + return ret; + } + + public OSCMessage(byte[] bmsg) + { + int pos = 0; + Address = DecodeString(bmsg, ref pos); + string typestring = DecodeString(bmsg, ref pos); + + args = new OSCArg[typestring.Length - 1]; + + int idx = 0; + foreach (char c in typestring) + { + switch (c) + { + case 'f': + args[idx++] = new OSCFloatArg(DecodeFloat(bmsg, ref pos)); + break; + case 's': + args[idx++] = new OSCStringArg(DecodeString(bmsg, ref pos)); + break; + case 'i': + args[idx++] = new OSCIntArg(DecodeInt(bmsg, ref pos)); + break; + case 'b': + int len = DecodeInt(bmsg, ref pos) * 4; + byte[] b = new byte[len]; + bmsg.CopyTo(b, 0); + pos += len; + args[idx++] = new OSCBlobArg(b); + break; + + } + } + + } + + + public string Address + { + get; + private set; + } + + OSCArg[] args; + + public OSCArg[] Args + { + get + { + return args; + } + } + + + // Construction de message + public OSCMessage(string _address) + { + Address = _address; + } + + void AddArg(OSCArg arg) + { + if (args == null) + { + args = new OSCArg[1]; + } + else + { + OSCArg[] na = new OSCArg[args.Length + 1]; + args.CopyTo(na, 0); + args = na; + } + args[args.Length - 1] = arg; + } + + public void AddString(string arg) + { + AddArg(new OSCStringArg(arg)); + } + + public void AddInt(int arg) + { + AddArg(new OSCIntArg(arg)); + } + public void AddFloat(float arg) + { + AddArg(new OSCFloatArg(arg)); + } + + public byte[] Encode() + { + int len = System.Text.ASCIIEncoding.ASCII.GetByteCount(Address) / 4 + 1; + string typestring = ","; + foreach (var arg in args) + { + switch (arg.Type) + { + case OSCType.Int32: + len += 1; + typestring += "i"; + break; + case OSCType.Float32: + len += 1; + typestring += "f"; + break; + case OSCType.String: + len += System.Text.ASCIIEncoding.ASCII.GetByteCount(arg.GetString()) / 4 + 1; + typestring += "s"; + break; + } + } + + len += typestring.Length / 4 + 1; + byte[] res = new byte[len * 4]; + int pos = 0; + EncodeString(res, ref pos, Address); + EncodeString(res, ref pos, typestring); + foreach (var arg in args) + { + switch (arg.Type) + { + case OSCType.Int32: + EncodeInt(res, ref pos, arg.GetInt()); + break; + case OSCType.Float32: + EncodeFloat(res, ref pos, arg.GetFloat()); + break; + case OSCType.String: + EncodeString(res, ref pos, arg.GetString()); + break; + } + } + return res; + } + + void EncodeString(byte[] buff, ref int pos, string s) + { + pos += + System.Text.ASCIIEncoding.ASCII.GetBytes( + s, 0, s.Length, buff, pos); + do + { + buff[pos++] = 0; + } while (pos % 4 != 0); + } + + void EncodeInt(byte[] res, ref int pos, int i) + { + byte[] buff = BitConverter.GetBytes(i); + if (BitConverter.IsLittleEndian) + Array.Reverse(buff); + buff.CopyTo(res, pos); + pos += 4; + } + + void EncodeFloat(byte[] res, ref int pos, float f) + { + byte[] buff = BitConverter.GetBytes(f); + if (BitConverter.IsLittleEndian) + Array.Reverse(buff); + buff.CopyTo(res, pos); + pos += 4; + } + } + +} diff --git a/DMX-2.0/OSCServer.cs b/DMX-2.0/OSCServer.cs index 83f8400..691390e 100644 --- a/DMX-2.0/OSCServer.cs +++ b/DMX-2.0/OSCServer.cs @@ -13,294 +13,7 @@ namespace DMX2 Thread pollThread = null; bool running=true; - - enum OSCType { - Int32, - Float32, - String, - Blob - } - - class OSCMessage { - - public abstract class OSCArg{ - protected OSCArg(){} - public abstract OSCType Type{ get; } - public virtual string GetString(){ throw new System.NotImplementedException (); } - public virtual float GetFloat (){throw new System.NotImplementedException (); } - public virtual int GetInt(){throw new System.NotImplementedException (); } - public virtual byte[] GetBlob(){throw new System.NotImplementedException (); } - } - - private class OSCStringArg : OSCArg{ - string _s; - public override OSCType Type { - get { - return OSCType.String; - } - } - public OSCStringArg(string s){ - _s=s; - } - public override string GetString () - { - return _s; - } - public override float GetFloat () - { - float f; - if(float.TryParse(_s,out f)) return f; - return 0.0f; - } - public override int GetInt () - { - return (int)GetFloat(); - } - } - private class OSCIntArg : OSCArg{ - int _i; - public override OSCType Type { - get { - return OSCType.Int32; - } - } - public OSCIntArg(int i){ - _i=i; - } - public override int GetInt () - { - return _i; - } - public override float GetFloat () - { - return (float)_i; - } - public override string GetString () - { - return _i.ToString(); - } - - } - private class OSCFloatArg : OSCArg{ - float _f; - public override OSCType Type { - get { - return OSCType.Float32; - } - } - public OSCFloatArg(float f){ - _f=f; - } - public override int GetInt () - { - return (int)(_f); - } - public override float GetFloat () - { - return _f; - } - public override string GetString () - { - return _f.ToString(); - } - - } - private class OSCBlobArg : OSCArg{ - byte[] _b; - public override OSCType Type { - get { - return OSCType.Blob; - } - } - public OSCBlobArg(byte[] b){ - _b=b; - } - public override byte[] GetBlob () - { - return _b; - } - - } - - static string DecodeString (byte[] b, ref int pos) - { - int end = Array.IndexOf(b,0,pos); - if(end==-1) end = b.Length; - string ret = System.Text.Encoding.ASCII.GetString(b,pos,end-pos); - pos = (end/4+1)*4; - return ret; - } - - static float DecodeFloat (byte[] b, ref int pos) - { - if(BitConverter.IsLittleEndian) - Array.Reverse(b,pos,4); - float ret = BitConverter.ToSingle(b,pos); - pos+=4; - return ret; - } - - static int DecodeInt (byte[] b, ref int pos) - { - if(BitConverter.IsLittleEndian) - Array.Reverse(b,pos,4); - int ret = BitConverter.ToInt32(b, pos); - pos+=4; - return ret; - } - - public OSCMessage(byte[] bmsg){ - int pos = 0; - Address = DecodeString(bmsg,ref pos); - string typestring = DecodeString(bmsg,ref pos); - - args = new OSCArg[typestring.Length-1]; - - int idx=0; - foreach(char c in typestring){ - switch(c){ - case 'f': - args[idx++] = new OSCFloatArg(DecodeFloat(bmsg,ref pos)); - break; - case 's': - args[idx++] = new OSCStringArg(DecodeString(bmsg,ref pos)); - break; - case 'i': - args[idx++] = new OSCIntArg(DecodeInt(bmsg,ref pos)); - break; - case 'b': - int len=DecodeInt(bmsg,ref pos)*4; - byte[] b = new byte[len]; - bmsg.CopyTo(b,0); - pos+=len; - args[idx++] = new OSCBlobArg(b); - break; - - } - } - - } - - - public string Address{ - get; - private set; - } - - OSCArg[] args; - - public OSCArg[] Args { - get { - return args; - } - } - - - // Construction de message - public OSCMessage(string _address){ - Address=_address; - } - - void AddArg (OSCArg arg) - { - if (args == null) { - args = new OSCArg[1]; - } else { - OSCArg[] na = new OSCArg[args.Length+1]; - args.CopyTo(na,0); - args = na; - } - args[args.Length-1] = arg; - } - - public void AddString (string arg) - { - AddArg(new OSCStringArg(arg)); - } - - public void AddInt (int arg) - { - AddArg(new OSCIntArg(arg)); - } - public void AddFloat (float arg) - { - AddArg(new OSCFloatArg(arg)); - } - - public byte[] Encode () - { - int len = System.Text.ASCIIEncoding.ASCII.GetByteCount (Address) / 4+1; - string typestring = ","; - foreach (var arg in args) { - switch(arg.Type){ - case OSCType.Int32: - len +=1; - typestring+="i"; - break; - case OSCType.Float32: - len += 1; - typestring+="f"; - break; - case OSCType.String: - len += System.Text.ASCIIEncoding.ASCII.GetByteCount (arg.GetString())/4+1; - typestring+="s"; - break; - } - } - - len += typestring.Length/4 +1; - byte[] res = new byte[len*4]; - int pos=0; - EncodeString(res,ref pos,Address); - EncodeString(res,ref pos,typestring); - foreach (var arg in args) { - switch(arg.Type){ - case OSCType.Int32: - EncodeInt(res,ref pos,arg.GetInt()); - break; - case OSCType.Float32: - EncodeFloat(res,ref pos,arg.GetFloat()); - break; - case OSCType.String: - EncodeString(res,ref pos,arg.GetString()); - break; - } - } - return res; - } - - void EncodeString (byte[] buff, ref int pos, string s) - { - pos += - System.Text.ASCIIEncoding.ASCII.GetBytes ( - s, 0, s.Length, buff, pos); - do { - buff[pos++]=0; - } while (pos%4!=0); - } - - void EncodeInt (byte[] res, ref int pos, int i) - { - byte[] buff = BitConverter.GetBytes(i); - if(BitConverter.IsLittleEndian) - Array.Reverse(buff); - buff.CopyTo(res,pos); - pos+=4; - } - - void EncodeFloat (byte[] res, ref int pos, float f) - { - byte[] buff = BitConverter.GetBytes(f); - if(BitConverter.IsLittleEndian) - Array.Reverse(buff); - buff.CopyTo(res,pos); - pos+=4; - } - } - - - - public OSCServer () + public OSCServer () { pollThread = new Thread(new ThreadStart(Loop)); pollThread.Start(); diff --git a/DMX-2.0/SeqOscUI.cs b/DMX-2.0/SeqOscUI.cs index 6cbce26..e1d8f9d 100644 --- a/DMX-2.0/SeqOscUI.cs +++ b/DMX-2.0/SeqOscUI.cs @@ -270,6 +270,8 @@ namespace DMX2 posLabel.Text = string.Format("n°{0}",sequenceur.IndexLigneEnCours +1); + entryDest.Text = sequenceur.Destination; + fullUpdFlag=false; } @@ -335,7 +337,10 @@ namespace DMX2 actLabel.SetSizeRequest ( Math.Max(50, args.Allocation.Width - posLabel.Allocation.Width - timeLabel.Allocation.Width - 50),-1); } - + protected void OnEntryDestChanged(object sender, EventArgs e) + { + sequenceur.Destination = entryDest.Text; + } } } diff --git a/DMX-2.0/SequenceurOSC.cs b/DMX-2.0/SequenceurOSC.cs index 243f6f5..69e9f35 100644 --- a/DMX-2.0/SequenceurOSC.cs +++ b/DMX-2.0/SequenceurOSC.cs @@ -21,6 +21,8 @@ using System.Collections.Generic; using System.Xml; using System.Collections.ObjectModel; using System.Threading; +using System.Net.Sockets; +using System.Net; namespace DMX2 { @@ -98,10 +100,15 @@ namespace DMX2 actionEventTarget goNextEventTarget=null; actionEventTarget goBackEventTarget=null; + string destination=""; SeqOscUI ui = null; bool change = false; + UdpClient udpClient = new UdpClient(); + IPEndPoint iPEndPoint = null; + + bool paused=false; public bool Paused { @@ -113,6 +120,32 @@ namespace DMX2 } } + public string Destination + { + get + { + return destination; + } + set + { + destination = value; + SetEndpoint(); + } + } + + private void SetEndpoint() + { + IPAddress iPAddress; + int port; + string[] st = destination.Split(':'); + iPEndPoint = null; + if (st.Length != 2) return; + if (!IPAddress.TryParse(st[0], out iPAddress)) return; + if (!int.TryParse(st[1], out port)) return; + iPEndPoint = new IPEndPoint(iPAddress, port); + udpClient.Connect(iPEndPoint); + } + public SequenceurOSC () { @@ -258,16 +291,35 @@ namespace DMX2 } } aSuivre = null; - LanceCommandeMidi(); + LanceCommandeOSC(); if(ui!=null) ui.EffetChange(); } } - void LanceCommandeMidi () + void LanceCommandeOSC() { - Console.WriteLine (enCours.Commande); + + Console.WriteLine(enCours.Commande); + string[] data = enCours.Commande.Split(' '); + + int di; + float df; + + OSCMessage message = new OSCMessage(data[0]); + for (int i = 1; i < data.Length; i++) + { + if (int.TryParse(data[i], out di)) + message.AddInt(di); + else if (float.TryParse(data[i], out df)) + message.AddFloat(df); + else message.AddString(data[i]); + } + + + var buff = message.Encode(); + udpClient.Send(buff, buff.Length); } @@ -289,6 +341,7 @@ namespace DMX2 parent.AppendChild (el); el.SetAttribute ("id", ID.ToString ()); el.SetAttribute ("name", Name); + el.SetAttribute ("destination", Destination); //el.SetAttribute ("master", master.ToString ()); xmlEl = parent.OwnerDocument.CreateElement ("EffetSuivant"); @@ -350,6 +403,7 @@ namespace DMX2 { ID = int.Parse (el.GetAttribute ("id")); Name = el.GetAttribute ("name"); + Destination = el.TryGetAttribute("destination", "224.0.0.3:8888"); XmlElement xmlE; @@ -405,7 +459,7 @@ namespace DMX2 } aSuivre = null; - LanceCommandeMidi(); + LanceCommandeOSC(); if(ui!=null) ui.EffetChange(); diff --git a/DMX-2.0/gtk-gui/DMX2.About.cs b/DMX-2.0/gtk-gui/DMX2.About.cs index 68356da..39b9609 100644 --- a/DMX-2.0/gtk-gui/DMX2.About.cs +++ b/DMX-2.0/gtk-gui/DMX2.About.cs @@ -4,12 +4,13 @@ namespace DMX2 { public partial class About { - private global::Gtk.Label label1; + private global::Gtk.Label labelA; + private global::Gtk.Button buttonOk; - protected virtual void Build () + protected virtual void Build() { - global::Stetic.Gui.Initialize (this); + global::Stetic.Gui.Initialize(this); // Widget DMX2.About this.Name = "DMX2.About"; this.WindowPosition = ((global::Gtk.WindowPosition)(4)); @@ -19,11 +20,13 @@ namespace DMX2 w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild - this.label1 = new global::Gtk.Label (); - this.label1.Name = "label1"; - this.label1.LabelProp = "Loupiottes\n\nLogiciel de contrôle DMX 512\n\nCopyright (C) Arnaud Houdelette\t\t2012-2014\nCopyright (C) Emmanuel Langlois\t\t2012-2014\nhttp://www.loupiottes.fr\nLicence : GPL V2"; - w1.Add (this.label1); - global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(w1 [this.label1])); + this.labelA = new global::Gtk.Label(); + this.labelA.Name = "labelA"; + this.labelA.LabelProp = "Loupiottes\n\nLogiciel de contrôle DMX 512\n\nCopyright (C) Arnaud Houdelette\t\t2012-" + + "2014\nCopyright (C) Emmanuel Langlois\t\t2012-2014\nhttp://www.loupiottes.fr\nLicence" + + " : GPL V2"; + w1.Add(this.labelA); + global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(w1[this.labelA])); w2.Position = 0; w2.Expand = false; w2.Fill = false; @@ -34,24 +37,25 @@ namespace DMX2 w3.BorderWidth = ((uint)(5)); w3.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild - this.buttonOk = new global::Gtk.Button (); + this.buttonOk = new global::Gtk.Button(); this.buttonOk.CanDefault = true; this.buttonOk.CanFocus = true; this.buttonOk.Name = "buttonOk"; this.buttonOk.UseStock = true; this.buttonOk.UseUnderline = true; this.buttonOk.Label = "gtk-close"; - this.AddActionWidget (this.buttonOk, -7); - global::Gtk.ButtonBox.ButtonBoxChild w4 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w3 [this.buttonOk])); + this.AddActionWidget(this.buttonOk, -7); + global::Gtk.ButtonBox.ButtonBoxChild w4 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w3[this.buttonOk])); w4.Expand = false; w4.Fill = false; - if ((this.Child != null)) { - this.Child.ShowAll (); + if ((this.Child != null)) + { + this.Child.ShowAll(); } this.DefaultWidth = 400; this.DefaultHeight = 300; - this.Show (); - this.buttonOk.Clicked += new global::System.EventHandler (this.OnButtonOkClicked); + this.Show(); + this.buttonOk.Clicked += new global::System.EventHandler(this.OnButtonOkClicked); } } } diff --git a/DMX-2.0/gtk-gui/DMX2.DriverBoitierV1UI.cs b/DMX-2.0/gtk-gui/DMX2.DriverBoitierV1UI.cs index 9c98093..89f1ee2 100644 --- a/DMX-2.0/gtk-gui/DMX2.DriverBoitierV1UI.cs +++ b/DMX-2.0/gtk-gui/DMX2.DriverBoitierV1UI.cs @@ -5,44 +5,52 @@ namespace DMX2 public partial class DriverBoitierV1UI { private global::Gtk.VBox vbox2; - private global::Gtk.Label label1; + + private global::Gtk.Label labelT; + private global::Gtk.Table table1; + private global::Gtk.ComboBox cbUnivers; + private global::Gtk.Label label4; + private global::Gtk.Label label5; + private global::Gtk.Label lblEtat; + private global::Gtk.HBox hbox1; + private global::Gtk.Button btnValider; - protected virtual void Build () + protected virtual void Build() { - global::Stetic.Gui.Initialize (this); + global::Stetic.Gui.Initialize(this); // Widget DMX2.DriverBoitierV1UI - global::Stetic.BinContainer.Attach (this); + global::Stetic.BinContainer.Attach(this); this.Name = "DMX2.DriverBoitierV1UI"; // Container child DMX2.DriverBoitierV1UI.Gtk.Container+ContainerChild - this.vbox2 = new global::Gtk.VBox (); + this.vbox2 = new global::Gtk.VBox(); this.vbox2.Name = "vbox2"; this.vbox2.Spacing = 6; // Container child vbox2.Gtk.Box+BoxChild - this.label1 = new global::Gtk.Label (); - this.label1.Name = "label1"; - this.label1.LabelProp = "Driver Boitier V1"; - this.vbox2.Add (this.label1); - global::Gtk.Box.BoxChild w1 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.label1])); + this.labelT = new global::Gtk.Label(); + this.labelT.Name = "labelT"; + this.labelT.LabelProp = "Driver Boitier V1"; + this.vbox2.Add(this.labelT); + global::Gtk.Box.BoxChild w1 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.labelT])); w1.Position = 0; w1.Expand = false; w1.Fill = false; // Container child vbox2.Gtk.Box+BoxChild - this.table1 = new global::Gtk.Table (((uint)(3)), ((uint)(2)), false); + this.table1 = new global::Gtk.Table(((uint)(3)), ((uint)(2)), false); this.table1.Name = "table1"; this.table1.RowSpacing = ((uint)(6)); this.table1.ColumnSpacing = ((uint)(6)); // Container child table1.Gtk.Table+TableChild - this.cbUnivers = global::Gtk.ComboBox.NewText (); + this.cbUnivers = global::Gtk.ComboBox.NewText(); this.cbUnivers.Name = "cbUnivers"; - this.table1.Add (this.cbUnivers); - global::Gtk.Table.TableChild w2 = ((global::Gtk.Table.TableChild)(this.table1 [this.cbUnivers])); + this.table1.Add(this.cbUnivers); + global::Gtk.Table.TableChild w2 = ((global::Gtk.Table.TableChild)(this.table1[this.cbUnivers])); w2.TopAttach = ((uint)(1)); w2.BottomAttach = ((uint)(2)); w2.LeftAttach = ((uint)(1)); @@ -50,62 +58,63 @@ namespace DMX2 w2.XOptions = ((global::Gtk.AttachOptions)(4)); w2.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild - this.label4 = new global::Gtk.Label (); + this.label4 = new global::Gtk.Label(); this.label4.Name = "label4"; this.label4.LabelProp = "Univers DMX :"; - this.table1.Add (this.label4); - global::Gtk.Table.TableChild w3 = ((global::Gtk.Table.TableChild)(this.table1 [this.label4])); + this.table1.Add(this.label4); + global::Gtk.Table.TableChild w3 = ((global::Gtk.Table.TableChild)(this.table1[this.label4])); w3.TopAttach = ((uint)(1)); w3.BottomAttach = ((uint)(2)); w3.XOptions = ((global::Gtk.AttachOptions)(4)); w3.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild - this.label5 = new global::Gtk.Label (); + this.label5 = new global::Gtk.Label(); this.label5.Name = "label5"; this.label5.LabelProp = "Etat :"; - this.table1.Add (this.label5); - global::Gtk.Table.TableChild w4 = ((global::Gtk.Table.TableChild)(this.table1 [this.label5])); + this.table1.Add(this.label5); + global::Gtk.Table.TableChild w4 = ((global::Gtk.Table.TableChild)(this.table1[this.label5])); w4.XOptions = ((global::Gtk.AttachOptions)(4)); w4.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild - this.lblEtat = new global::Gtk.Label (); + this.lblEtat = new global::Gtk.Label(); this.lblEtat.Name = "lblEtat"; this.lblEtat.LabelProp = "Univer associé"; - this.table1.Add (this.lblEtat); - global::Gtk.Table.TableChild w5 = ((global::Gtk.Table.TableChild)(this.table1 [this.lblEtat])); + this.table1.Add(this.lblEtat); + global::Gtk.Table.TableChild w5 = ((global::Gtk.Table.TableChild)(this.table1[this.lblEtat])); w5.LeftAttach = ((uint)(1)); w5.RightAttach = ((uint)(2)); w5.XOptions = ((global::Gtk.AttachOptions)(4)); w5.YOptions = ((global::Gtk.AttachOptions)(4)); - this.vbox2.Add (this.table1); - global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.table1])); + this.vbox2.Add(this.table1); + global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.table1])); w6.Position = 1; // Container child vbox2.Gtk.Box+BoxChild - this.hbox1 = new global::Gtk.HBox (); + this.hbox1 = new global::Gtk.HBox(); this.hbox1.Name = "hbox1"; this.hbox1.Spacing = 6; // Container child hbox1.Gtk.Box+BoxChild - this.btnValider = new global::Gtk.Button (); + this.btnValider = new global::Gtk.Button(); this.btnValider.CanFocus = true; this.btnValider.Name = "btnValider"; this.btnValider.UseUnderline = true; this.btnValider.Label = "Valider"; - this.hbox1.Add (this.btnValider); - global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.btnValider])); + this.hbox1.Add(this.btnValider); + global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.btnValider])); w7.Position = 1; w7.Expand = false; w7.Fill = false; - this.vbox2.Add (this.hbox1); - global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.hbox1])); + this.vbox2.Add(this.hbox1); + global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.hbox1])); w8.Position = 2; w8.Expand = false; w8.Fill = false; - this.Add (this.vbox2); - if ((this.Child != null)) { - this.Child.ShowAll (); + this.Add(this.vbox2); + if ((this.Child != null)) + { + this.Child.ShowAll(); } - this.Hide (); - this.btnValider.Clicked += new global::System.EventHandler (this.OnBtnValiderClicked); + this.Hide(); + this.btnValider.Clicked += new global::System.EventHandler(this.OnBtnValiderClicked); } } } diff --git a/DMX-2.0/gtk-gui/DMX2.DriverBoitierV2UI.cs b/DMX-2.0/gtk-gui/DMX2.DriverBoitierV2UI.cs index a261611..bda528c 100644 --- a/DMX-2.0/gtk-gui/DMX2.DriverBoitierV2UI.cs +++ b/DMX-2.0/gtk-gui/DMX2.DriverBoitierV2UI.cs @@ -5,57 +5,75 @@ namespace DMX2 public partial class DriverBoitierV2UI { private global::Gtk.VBox vbox2; - private global::Gtk.Label label1; + + private global::Gtk.Label labelT; + private global::Gtk.Table table1; + private global::Gtk.Entry caseBrk; + private global::Gtk.Entry caseMab; + private global::Gtk.ComboBox cbUnivers1; + private global::Gtk.ComboBox cbUnivers2; + private global::Gtk.CheckButton chkMerge1; + private global::Gtk.CheckButton chkMerge2; + private global::Gtk.Label label2; + private global::Gtk.Label label3; + private global::Gtk.Label label4; + private global::Gtk.Label label5; + private global::Gtk.Label label6; + private global::Gtk.Label label7; + private global::Gtk.Label label8; + private global::Gtk.HBox hbox1; + private global::Gtk.Button btnValider; + private global::Gtk.Button btnInit; - protected virtual void Build () + protected virtual void Build() { - global::Stetic.Gui.Initialize (this); + global::Stetic.Gui.Initialize(this); // Widget DMX2.DriverBoitierV2UI - global::Stetic.BinContainer.Attach (this); + global::Stetic.BinContainer.Attach(this); this.Name = "DMX2.DriverBoitierV2UI"; // Container child DMX2.DriverBoitierV2UI.Gtk.Container+ContainerChild - this.vbox2 = new global::Gtk.VBox (); + this.vbox2 = new global::Gtk.VBox(); this.vbox2.Name = "vbox2"; this.vbox2.Spacing = 6; // Container child vbox2.Gtk.Box+BoxChild - this.label1 = new global::Gtk.Label (); - this.label1.Name = "label1"; - this.label1.LabelProp = "Driver V2"; - this.vbox2.Add (this.label1); - global::Gtk.Box.BoxChild w1 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.label1])); + this.labelT = new global::Gtk.Label(); + this.labelT.Name = "labelT"; + this.labelT.LabelProp = "Driver V2"; + this.vbox2.Add(this.labelT); + global::Gtk.Box.BoxChild w1 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.labelT])); w1.Position = 0; w1.Expand = false; w1.Fill = false; // Container child vbox2.Gtk.Box+BoxChild - this.table1 = new global::Gtk.Table (((uint)(4)), ((uint)(5)), false); + this.table1 = new global::Gtk.Table(((uint)(4)), ((uint)(5)), false); this.table1.Name = "table1"; this.table1.RowSpacing = ((uint)(6)); this.table1.ColumnSpacing = ((uint)(6)); // Container child table1.Gtk.Table+TableChild - this.caseBrk = new global::Gtk.Entry (); + this.caseBrk = new global::Gtk.Entry(); this.caseBrk.CanFocus = true; this.caseBrk.Name = "caseBrk"; this.caseBrk.IsEditable = true; this.caseBrk.InvisibleChar = '•'; - this.table1.Add (this.caseBrk); - global::Gtk.Table.TableChild w2 = ((global::Gtk.Table.TableChild)(this.table1 [this.caseBrk])); + this.table1.Add(this.caseBrk); + global::Gtk.Table.TableChild w2 = ((global::Gtk.Table.TableChild)(this.table1[this.caseBrk])); w2.TopAttach = ((uint)(1)); w2.BottomAttach = ((uint)(2)); w2.LeftAttach = ((uint)(2)); @@ -63,13 +81,13 @@ namespace DMX2 w2.XOptions = ((global::Gtk.AttachOptions)(4)); w2.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild - this.caseMab = new global::Gtk.Entry (); + this.caseMab = new global::Gtk.Entry(); this.caseMab.CanFocus = true; this.caseMab.Name = "caseMab"; this.caseMab.IsEditable = true; this.caseMab.InvisibleChar = '•'; - this.table1.Add (this.caseMab); - global::Gtk.Table.TableChild w3 = ((global::Gtk.Table.TableChild)(this.table1 [this.caseMab])); + this.table1.Add(this.caseMab); + global::Gtk.Table.TableChild w3 = ((global::Gtk.Table.TableChild)(this.table1[this.caseMab])); w3.TopAttach = ((uint)(1)); w3.BottomAttach = ((uint)(2)); w3.LeftAttach = ((uint)(3)); @@ -77,10 +95,10 @@ namespace DMX2 w3.XOptions = ((global::Gtk.AttachOptions)(4)); w3.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild - this.cbUnivers1 = global::Gtk.ComboBox.NewText (); + this.cbUnivers1 = global::Gtk.ComboBox.NewText(); this.cbUnivers1.Name = "cbUnivers1"; - this.table1.Add (this.cbUnivers1); - global::Gtk.Table.TableChild w4 = ((global::Gtk.Table.TableChild)(this.table1 [this.cbUnivers1])); + this.table1.Add(this.cbUnivers1); + global::Gtk.Table.TableChild w4 = ((global::Gtk.Table.TableChild)(this.table1[this.cbUnivers1])); w4.TopAttach = ((uint)(1)); w4.BottomAttach = ((uint)(2)); w4.LeftAttach = ((uint)(1)); @@ -88,10 +106,10 @@ namespace DMX2 w4.XOptions = ((global::Gtk.AttachOptions)(4)); w4.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild - this.cbUnivers2 = global::Gtk.ComboBox.NewText (); + this.cbUnivers2 = global::Gtk.ComboBox.NewText(); this.cbUnivers2.Name = "cbUnivers2"; - this.table1.Add (this.cbUnivers2); - global::Gtk.Table.TableChild w5 = ((global::Gtk.Table.TableChild)(this.table1 [this.cbUnivers2])); + this.table1.Add(this.cbUnivers2); + global::Gtk.Table.TableChild w5 = ((global::Gtk.Table.TableChild)(this.table1[this.cbUnivers2])); w5.TopAttach = ((uint)(2)); w5.BottomAttach = ((uint)(3)); w5.LeftAttach = ((uint)(1)); @@ -99,14 +117,14 @@ namespace DMX2 w5.XOptions = ((global::Gtk.AttachOptions)(4)); w5.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild - this.chkMerge1 = new global::Gtk.CheckButton (); + this.chkMerge1 = new global::Gtk.CheckButton(); this.chkMerge1.CanFocus = true; this.chkMerge1.Name = "chkMerge1"; this.chkMerge1.Label = ""; this.chkMerge1.DrawIndicator = true; this.chkMerge1.UseUnderline = true; - this.table1.Add (this.chkMerge1); - global::Gtk.Table.TableChild w6 = ((global::Gtk.Table.TableChild)(this.table1 [this.chkMerge1])); + this.table1.Add(this.chkMerge1); + global::Gtk.Table.TableChild w6 = ((global::Gtk.Table.TableChild)(this.table1[this.chkMerge1])); w6.TopAttach = ((uint)(1)); w6.BottomAttach = ((uint)(2)); w6.LeftAttach = ((uint)(4)); @@ -114,14 +132,14 @@ namespace DMX2 w6.XOptions = ((global::Gtk.AttachOptions)(4)); w6.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild - this.chkMerge2 = new global::Gtk.CheckButton (); + this.chkMerge2 = new global::Gtk.CheckButton(); this.chkMerge2.CanFocus = true; this.chkMerge2.Name = "chkMerge2"; this.chkMerge2.Label = ""; this.chkMerge2.DrawIndicator = true; this.chkMerge2.UseUnderline = true; - this.table1.Add (this.chkMerge2); - global::Gtk.Table.TableChild w7 = ((global::Gtk.Table.TableChild)(this.table1 [this.chkMerge2])); + this.table1.Add(this.chkMerge2); + global::Gtk.Table.TableChild w7 = ((global::Gtk.Table.TableChild)(this.table1[this.chkMerge2])); w7.TopAttach = ((uint)(2)); w7.BottomAttach = ((uint)(3)); w7.LeftAttach = ((uint)(4)); @@ -129,115 +147,116 @@ namespace DMX2 w7.XOptions = ((global::Gtk.AttachOptions)(4)); w7.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild - this.label2 = new global::Gtk.Label (); + this.label2 = new global::Gtk.Label(); this.label2.Name = "label2"; this.label2.LabelProp = "Etat"; - this.table1.Add (this.label2); - global::Gtk.Table.TableChild w8 = ((global::Gtk.Table.TableChild)(this.table1 [this.label2])); + this.table1.Add(this.label2); + global::Gtk.Table.TableChild w8 = ((global::Gtk.Table.TableChild)(this.table1[this.label2])); w8.XOptions = ((global::Gtk.AttachOptions)(4)); w8.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild - this.label3 = new global::Gtk.Label (); + this.label3 = new global::Gtk.Label(); this.label3.Name = "label3"; this.label3.LabelProp = "Univer associé"; - this.table1.Add (this.label3); - global::Gtk.Table.TableChild w9 = ((global::Gtk.Table.TableChild)(this.table1 [this.label3])); + this.table1.Add(this.label3); + global::Gtk.Table.TableChild w9 = ((global::Gtk.Table.TableChild)(this.table1[this.label3])); w9.LeftAttach = ((uint)(1)); w9.RightAttach = ((uint)(2)); w9.XOptions = ((global::Gtk.AttachOptions)(4)); w9.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild - this.label4 = new global::Gtk.Label (); + this.label4 = new global::Gtk.Label(); this.label4.Name = "label4"; this.label4.LabelProp = "Break"; - this.table1.Add (this.label4); - global::Gtk.Table.TableChild w10 = ((global::Gtk.Table.TableChild)(this.table1 [this.label4])); + this.table1.Add(this.label4); + global::Gtk.Table.TableChild w10 = ((global::Gtk.Table.TableChild)(this.table1[this.label4])); w10.LeftAttach = ((uint)(2)); w10.RightAttach = ((uint)(3)); w10.XOptions = ((global::Gtk.AttachOptions)(4)); w10.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild - this.label5 = new global::Gtk.Label (); + this.label5 = new global::Gtk.Label(); this.label5.Name = "label5"; this.label5.LabelProp = "MAB"; - this.table1.Add (this.label5); - global::Gtk.Table.TableChild w11 = ((global::Gtk.Table.TableChild)(this.table1 [this.label5])); + this.table1.Add(this.label5); + global::Gtk.Table.TableChild w11 = ((global::Gtk.Table.TableChild)(this.table1[this.label5])); w11.LeftAttach = ((uint)(3)); w11.RightAttach = ((uint)(4)); w11.XOptions = ((global::Gtk.AttachOptions)(4)); w11.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild - this.label6 = new global::Gtk.Label (); + this.label6 = new global::Gtk.Label(); this.label6.Name = "label6"; this.label6.LabelProp = "Block 1"; - this.table1.Add (this.label6); - global::Gtk.Table.TableChild w12 = ((global::Gtk.Table.TableChild)(this.table1 [this.label6])); + this.table1.Add(this.label6); + global::Gtk.Table.TableChild w12 = ((global::Gtk.Table.TableChild)(this.table1[this.label6])); w12.TopAttach = ((uint)(1)); w12.BottomAttach = ((uint)(2)); w12.XOptions = ((global::Gtk.AttachOptions)(4)); w12.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild - this.label7 = new global::Gtk.Label (); + this.label7 = new global::Gtk.Label(); this.label7.Name = "label7"; this.label7.LabelProp = "Block 2"; - this.table1.Add (this.label7); - global::Gtk.Table.TableChild w13 = ((global::Gtk.Table.TableChild)(this.table1 [this.label7])); + this.table1.Add(this.label7); + global::Gtk.Table.TableChild w13 = ((global::Gtk.Table.TableChild)(this.table1[this.label7])); w13.TopAttach = ((uint)(2)); w13.BottomAttach = ((uint)(3)); w13.XOptions = ((global::Gtk.AttachOptions)(4)); w13.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild - this.label8 = new global::Gtk.Label (); + this.label8 = new global::Gtk.Label(); this.label8.Name = "label8"; this.label8.LabelProp = "Merge"; - this.table1.Add (this.label8); - global::Gtk.Table.TableChild w14 = ((global::Gtk.Table.TableChild)(this.table1 [this.label8])); + this.table1.Add(this.label8); + global::Gtk.Table.TableChild w14 = ((global::Gtk.Table.TableChild)(this.table1[this.label8])); w14.LeftAttach = ((uint)(4)); w14.RightAttach = ((uint)(5)); w14.XOptions = ((global::Gtk.AttachOptions)(4)); w14.YOptions = ((global::Gtk.AttachOptions)(4)); - this.vbox2.Add (this.table1); - global::Gtk.Box.BoxChild w15 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.table1])); + this.vbox2.Add(this.table1); + global::Gtk.Box.BoxChild w15 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.table1])); w15.Position = 1; // Container child vbox2.Gtk.Box+BoxChild - this.hbox1 = new global::Gtk.HBox (); + this.hbox1 = new global::Gtk.HBox(); this.hbox1.Name = "hbox1"; this.hbox1.Spacing = 6; // Container child hbox1.Gtk.Box+BoxChild - this.btnValider = new global::Gtk.Button (); + this.btnValider = new global::Gtk.Button(); this.btnValider.CanFocus = true; this.btnValider.Name = "btnValider"; this.btnValider.UseUnderline = true; this.btnValider.Label = "Valider"; - this.hbox1.Add (this.btnValider); - global::Gtk.Box.BoxChild w16 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.btnValider])); + this.hbox1.Add(this.btnValider); + global::Gtk.Box.BoxChild w16 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.btnValider])); w16.Position = 1; w16.Expand = false; w16.Fill = false; // Container child hbox1.Gtk.Box+BoxChild - this.btnInit = new global::Gtk.Button (); + this.btnInit = new global::Gtk.Button(); this.btnInit.CanFocus = true; this.btnInit.Name = "btnInit"; this.btnInit.UseUnderline = true; this.btnInit.Label = "Init Boitier"; - this.hbox1.Add (this.btnInit); - global::Gtk.Box.BoxChild w17 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.btnInit])); + this.hbox1.Add(this.btnInit); + global::Gtk.Box.BoxChild w17 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.btnInit])); w17.Position = 2; w17.Expand = false; w17.Fill = false; - this.vbox2.Add (this.hbox1); - global::Gtk.Box.BoxChild w18 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.hbox1])); + this.vbox2.Add(this.hbox1); + global::Gtk.Box.BoxChild w18 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.hbox1])); w18.PackType = ((global::Gtk.PackType)(1)); w18.Position = 2; w18.Expand = false; w18.Fill = false; - this.Add (this.vbox2); - if ((this.Child != null)) { - this.Child.ShowAll (); + this.Add(this.vbox2); + if ((this.Child != null)) + { + this.Child.ShowAll(); } - this.Hide (); - this.btnValider.Clicked += new global::System.EventHandler (this.OnButtonValider); - this.btnInit.Clicked += new global::System.EventHandler (this.OnBtnInitClicked); + this.Hide(); + this.btnValider.Clicked += new global::System.EventHandler(this.OnButtonValider); + this.btnInit.Clicked += new global::System.EventHandler(this.OnBtnInitClicked); } } } diff --git a/DMX-2.0/gtk-gui/DMX2.DriverBoitierV3UI.cs b/DMX-2.0/gtk-gui/DMX2.DriverBoitierV3UI.cs index d99e649..e585cb6 100644 --- a/DMX-2.0/gtk-gui/DMX2.DriverBoitierV3UI.cs +++ b/DMX-2.0/gtk-gui/DMX2.DriverBoitierV3UI.cs @@ -5,60 +5,81 @@ namespace DMX2 public partial class DriverBoitierV3UI { private global::Gtk.VBox vbox2; - private global::Gtk.Label label1; + + private global::Gtk.Label labelT; + private global::Gtk.Table table1; + private global::Gtk.Entry caseBrk; + private global::Gtk.Entry caseCircuits; + private global::Gtk.Entry caseDMXInt; + private global::Gtk.Entry caseMab; + private global::Gtk.Entry caseUSBRef; + private global::Gtk.ComboBox cbUnivers1; + private global::Gtk.CheckButton chkMerge1; + private global::Gtk.CheckButton chkSync; + private global::Gtk.Label label10; + private global::Gtk.Label label3; + private global::Gtk.Label label4; + private global::Gtk.Label label5; + private global::Gtk.Label label8; + private global::Gtk.Label label9; + private global::Gtk.Label labelsync; + private global::Gtk.Label lblDMX; + private global::Gtk.HBox hbox1; + private global::Gtk.Button btnValider; + private global::Gtk.Button btnInit; - protected virtual void Build () + protected virtual void Build() { - global::Stetic.Gui.Initialize (this); + global::Stetic.Gui.Initialize(this); // Widget DMX2.DriverBoitierV3UI - global::Stetic.BinContainer.Attach (this); + global::Stetic.BinContainer.Attach(this); this.Name = "DMX2.DriverBoitierV3UI"; // Container child DMX2.DriverBoitierV3UI.Gtk.Container+ContainerChild - this.vbox2 = new global::Gtk.VBox (); + this.vbox2 = new global::Gtk.VBox(); this.vbox2.Name = "vbox2"; this.vbox2.Spacing = 6; // Container child vbox2.Gtk.Box+BoxChild - this.label1 = new global::Gtk.Label (); - this.label1.Name = "label1"; - this.label1.LabelProp = "Driver V3"; - this.vbox2.Add (this.label1); - global::Gtk.Box.BoxChild w1 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.label1])); + this.labelT = new global::Gtk.Label(); + this.labelT.Name = "labelT"; + this.labelT.LabelProp = "Driver V3"; + this.vbox2.Add(this.labelT); + global::Gtk.Box.BoxChild w1 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.labelT])); w1.Position = 0; w1.Expand = false; w1.Fill = false; // Container child vbox2.Gtk.Box+BoxChild - this.table1 = new global::Gtk.Table (((uint)(5)), ((uint)(4)), false); + this.table1 = new global::Gtk.Table(((uint)(5)), ((uint)(4)), false); this.table1.Name = "table1"; this.table1.RowSpacing = ((uint)(6)); this.table1.ColumnSpacing = ((uint)(6)); // Container child table1.Gtk.Table+TableChild - this.caseBrk = new global::Gtk.Entry (); + this.caseBrk = new global::Gtk.Entry(); this.caseBrk.CanFocus = true; this.caseBrk.Name = "caseBrk"; this.caseBrk.IsEditable = true; this.caseBrk.InvisibleChar = '•'; - this.table1.Add (this.caseBrk); - global::Gtk.Table.TableChild w2 = ((global::Gtk.Table.TableChild)(this.table1 [this.caseBrk])); + this.table1.Add(this.caseBrk); + global::Gtk.Table.TableChild w2 = ((global::Gtk.Table.TableChild)(this.table1[this.caseBrk])); w2.TopAttach = ((uint)(1)); w2.BottomAttach = ((uint)(2)); w2.LeftAttach = ((uint)(1)); @@ -66,50 +87,50 @@ namespace DMX2 w2.XOptions = ((global::Gtk.AttachOptions)(4)); w2.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild - this.caseCircuits = new global::Gtk.Entry (); + this.caseCircuits = new global::Gtk.Entry(); this.caseCircuits.CanFocus = true; this.caseCircuits.Name = "caseCircuits"; this.caseCircuits.IsEditable = true; this.caseCircuits.InvisibleChar = '•'; - this.table1.Add (this.caseCircuits); - global::Gtk.Table.TableChild w3 = ((global::Gtk.Table.TableChild)(this.table1 [this.caseCircuits])); + this.table1.Add(this.caseCircuits); + global::Gtk.Table.TableChild w3 = ((global::Gtk.Table.TableChild)(this.table1[this.caseCircuits])); w3.LeftAttach = ((uint)(3)); w3.RightAttach = ((uint)(4)); w3.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild - this.caseDMXInt = new global::Gtk.Entry (); + this.caseDMXInt = new global::Gtk.Entry(); this.caseDMXInt.CanFocus = true; this.caseDMXInt.Name = "caseDMXInt"; this.caseDMXInt.IsEditable = true; this.caseDMXInt.InvisibleChar = '•'; - this.table1.Add (this.caseDMXInt); - global::Gtk.Table.TableChild w4 = ((global::Gtk.Table.TableChild)(this.table1 [this.caseDMXInt])); + this.table1.Add(this.caseDMXInt); + global::Gtk.Table.TableChild w4 = ((global::Gtk.Table.TableChild)(this.table1[this.caseDMXInt])); w4.TopAttach = ((uint)(3)); w4.BottomAttach = ((uint)(4)); w4.LeftAttach = ((uint)(3)); w4.RightAttach = ((uint)(4)); w4.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild - this.caseMab = new global::Gtk.Entry (); + this.caseMab = new global::Gtk.Entry(); this.caseMab.CanFocus = true; this.caseMab.Name = "caseMab"; this.caseMab.IsEditable = true; this.caseMab.InvisibleChar = '•'; - this.table1.Add (this.caseMab); - global::Gtk.Table.TableChild w5 = ((global::Gtk.Table.TableChild)(this.table1 [this.caseMab])); + this.table1.Add(this.caseMab); + global::Gtk.Table.TableChild w5 = ((global::Gtk.Table.TableChild)(this.table1[this.caseMab])); w5.TopAttach = ((uint)(1)); w5.BottomAttach = ((uint)(2)); w5.LeftAttach = ((uint)(3)); w5.RightAttach = ((uint)(4)); w5.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild - this.caseUSBRef = new global::Gtk.Entry (); + this.caseUSBRef = new global::Gtk.Entry(); this.caseUSBRef.CanFocus = true; this.caseUSBRef.Name = "caseUSBRef"; this.caseUSBRef.IsEditable = true; this.caseUSBRef.InvisibleChar = '•'; - this.table1.Add (this.caseUSBRef); - global::Gtk.Table.TableChild w6 = ((global::Gtk.Table.TableChild)(this.table1 [this.caseUSBRef])); + this.table1.Add(this.caseUSBRef); + global::Gtk.Table.TableChild w6 = ((global::Gtk.Table.TableChild)(this.table1[this.caseUSBRef])); w6.TopAttach = ((uint)(3)); w6.BottomAttach = ((uint)(4)); w6.LeftAttach = ((uint)(1)); @@ -117,37 +138,37 @@ namespace DMX2 w6.XOptions = ((global::Gtk.AttachOptions)(4)); w6.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild - this.cbUnivers1 = global::Gtk.ComboBox.NewText (); + this.cbUnivers1 = global::Gtk.ComboBox.NewText(); this.cbUnivers1.Name = "cbUnivers1"; - this.table1.Add (this.cbUnivers1); - global::Gtk.Table.TableChild w7 = ((global::Gtk.Table.TableChild)(this.table1 [this.cbUnivers1])); + this.table1.Add(this.cbUnivers1); + global::Gtk.Table.TableChild w7 = ((global::Gtk.Table.TableChild)(this.table1[this.cbUnivers1])); w7.LeftAttach = ((uint)(1)); w7.RightAttach = ((uint)(2)); w7.XOptions = ((global::Gtk.AttachOptions)(4)); w7.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild - this.chkMerge1 = new global::Gtk.CheckButton (); + this.chkMerge1 = new global::Gtk.CheckButton(); this.chkMerge1.CanFocus = true; this.chkMerge1.Name = "chkMerge1"; this.chkMerge1.Label = ""; this.chkMerge1.DrawIndicator = true; this.chkMerge1.UseUnderline = true; - this.table1.Add (this.chkMerge1); - global::Gtk.Table.TableChild w8 = ((global::Gtk.Table.TableChild)(this.table1 [this.chkMerge1])); + this.table1.Add(this.chkMerge1); + global::Gtk.Table.TableChild w8 = ((global::Gtk.Table.TableChild)(this.table1[this.chkMerge1])); w8.TopAttach = ((uint)(2)); w8.BottomAttach = ((uint)(3)); w8.LeftAttach = ((uint)(3)); w8.RightAttach = ((uint)(4)); w8.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild - this.chkSync = new global::Gtk.CheckButton (); + this.chkSync = new global::Gtk.CheckButton(); this.chkSync.CanFocus = true; this.chkSync.Name = "chkSync"; this.chkSync.Label = ""; this.chkSync.DrawIndicator = true; this.chkSync.UseUnderline = true; - this.table1.Add (this.chkSync); - global::Gtk.Table.TableChild w9 = ((global::Gtk.Table.TableChild)(this.table1 [this.chkSync])); + this.table1.Add(this.chkSync); + global::Gtk.Table.TableChild w9 = ((global::Gtk.Table.TableChild)(this.table1[this.chkSync])); w9.TopAttach = ((uint)(2)); w9.BottomAttach = ((uint)(3)); w9.LeftAttach = ((uint)(1)); @@ -155,39 +176,39 @@ namespace DMX2 w9.XOptions = ((global::Gtk.AttachOptions)(4)); w9.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild - this.label10 = new global::Gtk.Label (); + this.label10 = new global::Gtk.Label(); this.label10.Name = "label10"; this.label10.LabelProp = "Freq. USB (ms)"; - this.table1.Add (this.label10); - global::Gtk.Table.TableChild w10 = ((global::Gtk.Table.TableChild)(this.table1 [this.label10])); + this.table1.Add(this.label10); + global::Gtk.Table.TableChild w10 = ((global::Gtk.Table.TableChild)(this.table1[this.label10])); w10.TopAttach = ((uint)(3)); w10.BottomAttach = ((uint)(4)); w10.XOptions = ((global::Gtk.AttachOptions)(4)); w10.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild - this.label3 = new global::Gtk.Label (); + this.label3 = new global::Gtk.Label(); this.label3.Name = "label3"; this.label3.LabelProp = "Univer associé"; - this.table1.Add (this.label3); - global::Gtk.Table.TableChild w11 = ((global::Gtk.Table.TableChild)(this.table1 [this.label3])); + this.table1.Add(this.label3); + global::Gtk.Table.TableChild w11 = ((global::Gtk.Table.TableChild)(this.table1[this.label3])); w11.XOptions = ((global::Gtk.AttachOptions)(4)); w11.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild - this.label4 = new global::Gtk.Label (); + this.label4 = new global::Gtk.Label(); this.label4.Name = "label4"; this.label4.LabelProp = "Break (µs)"; - this.table1.Add (this.label4); - global::Gtk.Table.TableChild w12 = ((global::Gtk.Table.TableChild)(this.table1 [this.label4])); + this.table1.Add(this.label4); + global::Gtk.Table.TableChild w12 = ((global::Gtk.Table.TableChild)(this.table1[this.label4])); w12.TopAttach = ((uint)(1)); w12.BottomAttach = ((uint)(2)); w12.XOptions = ((global::Gtk.AttachOptions)(4)); w12.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild - this.label5 = new global::Gtk.Label (); + this.label5 = new global::Gtk.Label(); this.label5.Name = "label5"; this.label5.LabelProp = "MAB (µs)"; - this.table1.Add (this.label5); - global::Gtk.Table.TableChild w13 = ((global::Gtk.Table.TableChild)(this.table1 [this.label5])); + this.table1.Add(this.label5); + global::Gtk.Table.TableChild w13 = ((global::Gtk.Table.TableChild)(this.table1[this.label5])); w13.TopAttach = ((uint)(1)); w13.BottomAttach = ((uint)(2)); w13.LeftAttach = ((uint)(2)); @@ -195,11 +216,11 @@ namespace DMX2 w13.XOptions = ((global::Gtk.AttachOptions)(4)); w13.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild - this.label8 = new global::Gtk.Label (); + this.label8 = new global::Gtk.Label(); this.label8.Name = "label8"; this.label8.LabelProp = "Merge"; - this.table1.Add (this.label8); - global::Gtk.Table.TableChild w14 = ((global::Gtk.Table.TableChild)(this.table1 [this.label8])); + this.table1.Add(this.label8); + global::Gtk.Table.TableChild w14 = ((global::Gtk.Table.TableChild)(this.table1[this.label8])); w14.TopAttach = ((uint)(2)); w14.BottomAttach = ((uint)(3)); w14.LeftAttach = ((uint)(2)); @@ -207,83 +228,84 @@ namespace DMX2 w14.XOptions = ((global::Gtk.AttachOptions)(4)); w14.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild - this.label9 = new global::Gtk.Label (); + this.label9 = new global::Gtk.Label(); this.label9.Name = "label9"; this.label9.LabelProp = "Circuits"; - this.table1.Add (this.label9); - global::Gtk.Table.TableChild w15 = ((global::Gtk.Table.TableChild)(this.table1 [this.label9])); + this.table1.Add(this.label9); + global::Gtk.Table.TableChild w15 = ((global::Gtk.Table.TableChild)(this.table1[this.label9])); w15.LeftAttach = ((uint)(2)); w15.RightAttach = ((uint)(3)); w15.XOptions = ((global::Gtk.AttachOptions)(4)); w15.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild - this.labelsync = new global::Gtk.Label (); + this.labelsync = new global::Gtk.Label(); this.labelsync.Name = "labelsync"; this.labelsync.LabelProp = "Syncro\nDMX<->USB"; - this.table1.Add (this.labelsync); - global::Gtk.Table.TableChild w16 = ((global::Gtk.Table.TableChild)(this.table1 [this.labelsync])); + this.table1.Add(this.labelsync); + global::Gtk.Table.TableChild w16 = ((global::Gtk.Table.TableChild)(this.table1[this.labelsync])); w16.TopAttach = ((uint)(2)); w16.BottomAttach = ((uint)(3)); w16.XOptions = ((global::Gtk.AttachOptions)(4)); w16.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild - this.lblDMX = new global::Gtk.Label (); + this.lblDMX = new global::Gtk.Label(); this.lblDMX.Name = "lblDMX"; this.lblDMX.LabelProp = "Intervale entre\ntrames DMX (ms)"; - this.table1.Add (this.lblDMX); - global::Gtk.Table.TableChild w17 = ((global::Gtk.Table.TableChild)(this.table1 [this.lblDMX])); + this.table1.Add(this.lblDMX); + global::Gtk.Table.TableChild w17 = ((global::Gtk.Table.TableChild)(this.table1[this.lblDMX])); w17.TopAttach = ((uint)(3)); w17.BottomAttach = ((uint)(4)); w17.LeftAttach = ((uint)(2)); w17.RightAttach = ((uint)(3)); w17.XOptions = ((global::Gtk.AttachOptions)(4)); w17.YOptions = ((global::Gtk.AttachOptions)(4)); - this.vbox2.Add (this.table1); - global::Gtk.Box.BoxChild w18 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.table1])); + this.vbox2.Add(this.table1); + global::Gtk.Box.BoxChild w18 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.table1])); w18.Position = 1; w18.Expand = false; w18.Fill = false; // Container child vbox2.Gtk.Box+BoxChild - this.hbox1 = new global::Gtk.HBox (); + this.hbox1 = new global::Gtk.HBox(); this.hbox1.Name = "hbox1"; this.hbox1.Spacing = 6; // Container child hbox1.Gtk.Box+BoxChild - this.btnValider = new global::Gtk.Button (); + this.btnValider = new global::Gtk.Button(); this.btnValider.CanFocus = true; this.btnValider.Name = "btnValider"; this.btnValider.UseUnderline = true; this.btnValider.Label = "Valider"; - this.hbox1.Add (this.btnValider); - global::Gtk.Box.BoxChild w19 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.btnValider])); + this.hbox1.Add(this.btnValider); + global::Gtk.Box.BoxChild w19 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.btnValider])); w19.Position = 1; w19.Expand = false; w19.Fill = false; // Container child hbox1.Gtk.Box+BoxChild - this.btnInit = new global::Gtk.Button (); + this.btnInit = new global::Gtk.Button(); this.btnInit.CanFocus = true; this.btnInit.Name = "btnInit"; this.btnInit.UseUnderline = true; this.btnInit.Label = "Init Boitier"; - this.hbox1.Add (this.btnInit); - global::Gtk.Box.BoxChild w20 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.btnInit])); + this.hbox1.Add(this.btnInit); + global::Gtk.Box.BoxChild w20 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.btnInit])); w20.Position = 2; w20.Expand = false; w20.Fill = false; - this.vbox2.Add (this.hbox1); - global::Gtk.Box.BoxChild w21 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.hbox1])); + this.vbox2.Add(this.hbox1); + global::Gtk.Box.BoxChild w21 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.hbox1])); w21.PackType = ((global::Gtk.PackType)(1)); w21.Position = 2; w21.Expand = false; w21.Fill = false; - this.Add (this.vbox2); - if ((this.Child != null)) { - this.Child.ShowAll (); + this.Add(this.vbox2); + if ((this.Child != null)) + { + this.Child.ShowAll(); } - this.Hide (); - this.chkSync.Toggled += new global::System.EventHandler (this.OnChkSyncToggled); - this.caseUSBRef.Changed += new global::System.EventHandler (this.OnCaseUSBRefChanged); - this.btnValider.Clicked += new global::System.EventHandler (this.OnButtonValider); - this.btnInit.Clicked += new global::System.EventHandler (this.OnBtnInitClicked); + this.Hide(); + this.chkSync.Toggled += new global::System.EventHandler(this.OnChkSyncToggled); + this.caseUSBRef.Changed += new global::System.EventHandler(this.OnCaseUSBRefChanged); + this.btnValider.Clicked += new global::System.EventHandler(this.OnButtonValider); + this.btnInit.Clicked += new global::System.EventHandler(this.OnBtnInitClicked); } } } diff --git a/DMX-2.0/gtk-gui/DMX2.EditionUnivers.cs b/DMX-2.0/gtk-gui/DMX2.EditionUnivers.cs index c565f93..5774c45 100644 --- a/DMX-2.0/gtk-gui/DMX2.EditionUnivers.cs +++ b/DMX-2.0/gtk-gui/DMX2.EditionUnivers.cs @@ -5,42 +5,69 @@ namespace DMX2 public partial class EditionUnivers { private global::Gtk.UIManager UIManager; + private global::Gtk.HBox hbox2; - private global::Gtk.Label label1; + + private global::Gtk.Label labelU; + private global::Gtk.ComboBox cbUnivers; + private global::Gtk.HBox hbox3; + private global::Gtk.Button btAdd; + private global::Gtk.Button btDel; + private global::Gtk.Button btReset; + private global::Gtk.Button btPatchDroit; + private global::Gtk.HSeparator hseparator1; + private global::Gtk.HBox hbox1; + private global::Gtk.ToggleButton btAllume; + private global::Gtk.SpinButton spinDimmer; + private global::Gtk.Label label6; + private global::Gtk.ComboBox cbCircuit; + private global::Gtk.ComboBox cbFT; + private global::Gtk.Label lbParam1; + private global::Gtk.Entry txtParam1; + private global::Gtk.Label lbParam2; + private global::Gtk.Entry txtParam2; + private global::Gtk.Notebook notebook1; + private global::Gtk.ScrolledWindow GtkScrolledWindow; + private global::Gtk.TreeView tvDimm; + private global::Gtk.Label label2; + private global::Gtk.ScrolledWindow GtkScrolledWindow1; + private global::Gtk.TreeView tvCircuits; + private global::Gtk.Label label5; + private global::Gtk.Button buttonCancel; - protected virtual void Build () + protected virtual void Build() { - global::Stetic.Gui.Initialize (this); + global::Stetic.Gui.Initialize(this); // Widget DMX2.EditionUnivers - this.UIManager = new global::Gtk.UIManager (); - global::Gtk.ActionGroup w1 = new global::Gtk.ActionGroup ("Default"); - this.UIManager.InsertActionGroup (w1, 0); - this.AddAccelGroup (this.UIManager.AccelGroup); + this.UIManager = new global::Gtk.UIManager(); + global::Gtk.ActionGroup w1 = new global::Gtk.ActionGroup("Default"); + this.UIManager.InsertActionGroup(w1, 0); + this.AddAccelGroup(this.UIManager.AccelGroup); this.Name = "DMX2.EditionUnivers"; this.TypeHint = ((global::Gdk.WindowTypeHint)(5)); this.WindowPosition = ((global::Gtk.WindowPosition)(4)); @@ -49,341 +76,282 @@ namespace DMX2 w2.Name = "dialog1_VBox"; w2.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild - this.hbox2 = new global::Gtk.HBox (); + this.hbox2 = new global::Gtk.HBox(); this.hbox2.Name = "hbox2"; this.hbox2.Spacing = 6; // Container child hbox2.Gtk.Box+BoxChild - this.label1 = new global::Gtk.Label (); - this.label1.Name = "label1"; - this.label1.LabelProp = "Univers :"; - this.hbox2.Add (this.label1); - global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.label1])); + this.labelU = new global::Gtk.Label(); + this.labelU.Name = "labelU"; + this.labelU.LabelProp = "Univers :"; + this.hbox2.Add(this.labelU); + global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.hbox2[this.labelU])); w3.Position = 0; w3.Expand = false; w3.Fill = false; // Container child hbox2.Gtk.Box+BoxChild - this.cbUnivers = global::Gtk.ComboBox.NewText (); + this.cbUnivers = global::Gtk.ComboBox.NewText(); this.cbUnivers.Name = "cbUnivers"; - this.hbox2.Add (this.cbUnivers); - global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.cbUnivers])); + this.hbox2.Add(this.cbUnivers); + global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.hbox2[this.cbUnivers])); w4.Position = 1; w4.Expand = false; w4.Fill = false; // Container child hbox2.Gtk.Box+BoxChild - this.hbox3 = new global::Gtk.HBox (); + this.hbox3 = new global::Gtk.HBox(); this.hbox3.Name = "hbox3"; this.hbox3.Spacing = 6; // Container child hbox3.Gtk.Box+BoxChild - this.btAdd = new global::Gtk.Button (); + this.btAdd = new global::Gtk.Button(); this.btAdd.CanFocus = true; this.btAdd.Name = "btAdd"; this.btAdd.UseUnderline = true; - // Container child btAdd.Gtk.Container+ContainerChild - global::Gtk.Alignment w5 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F); - // Container child GtkAlignment.Gtk.Container+ContainerChild - global::Gtk.HBox w6 = new global::Gtk.HBox (); - w6.Spacing = 2; - // Container child GtkHBox.Gtk.Container+ContainerChild - global::Gtk.Image w7 = new global::Gtk.Image (); - w7.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-add", global::Gtk.IconSize.Menu); - w6.Add (w7); - // Container child GtkHBox.Gtk.Container+ContainerChild - global::Gtk.Label w9 = new global::Gtk.Label (); - w9.LabelProp = "Nouvel Univers"; - w9.UseUnderline = true; - w6.Add (w9); - w5.Add (w6); - this.btAdd.Add (w5); - this.hbox3.Add (this.btAdd); - global::Gtk.Box.BoxChild w13 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.btAdd])); - w13.Position = 0; - w13.Expand = false; - w13.Fill = false; + this.btAdd.Label = "Nouvel Univers"; + global::Gtk.Image w5 = new global::Gtk.Image(); + w5.Pixbuf = global::Stetic.IconLoader.LoadIcon(this, "gtk-add", global::Gtk.IconSize.Menu); + this.btAdd.Image = w5; + this.hbox3.Add(this.btAdd); + global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.hbox3[this.btAdd])); + w6.Position = 0; + w6.Expand = false; + w6.Fill = false; // Container child hbox3.Gtk.Box+BoxChild - this.btDel = new global::Gtk.Button (); + this.btDel = new global::Gtk.Button(); this.btDel.Sensitive = false; this.btDel.CanFocus = true; this.btDel.Name = "btDel"; this.btDel.UseUnderline = true; - // Container child btDel.Gtk.Container+ContainerChild - global::Gtk.Alignment w14 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F); - // Container child GtkAlignment.Gtk.Container+ContainerChild - global::Gtk.HBox w15 = new global::Gtk.HBox (); - w15.Spacing = 2; - // Container child GtkHBox.Gtk.Container+ContainerChild - global::Gtk.Image w16 = new global::Gtk.Image (); - w16.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-remove", global::Gtk.IconSize.Menu); - w15.Add (w16); - // Container child GtkHBox.Gtk.Container+ContainerChild - global::Gtk.Label w18 = new global::Gtk.Label (); - w18.LabelProp = "Supprimer"; - w18.UseUnderline = true; - w15.Add (w18); - w14.Add (w15); - this.btDel.Add (w14); - this.hbox3.Add (this.btDel); - global::Gtk.Box.BoxChild w22 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.btDel])); - w22.Position = 1; - w22.Expand = false; - w22.Fill = false; + this.btDel.Label = "Supprimer"; + global::Gtk.Image w7 = new global::Gtk.Image(); + w7.Pixbuf = global::Stetic.IconLoader.LoadIcon(this, "gtk-remove", global::Gtk.IconSize.Menu); + this.btDel.Image = w7; + this.hbox3.Add(this.btDel); + global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.hbox3[this.btDel])); + w8.Position = 1; + w8.Expand = false; + w8.Fill = false; // Container child hbox3.Gtk.Box+BoxChild - this.btReset = new global::Gtk.Button (); + this.btReset = new global::Gtk.Button(); this.btReset.CanFocus = true; this.btReset.Name = "btReset"; this.btReset.UseUnderline = true; - // Container child btReset.Gtk.Container+ContainerChild - global::Gtk.Alignment w23 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F); - // Container child GtkAlignment.Gtk.Container+ContainerChild - global::Gtk.HBox w24 = new global::Gtk.HBox (); - w24.Spacing = 2; - // Container child GtkHBox.Gtk.Container+ContainerChild - global::Gtk.Image w25 = new global::Gtk.Image (); - w25.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-clear", global::Gtk.IconSize.Menu); - w24.Add (w25); - // Container child GtkHBox.Gtk.Container+ContainerChild - global::Gtk.Label w27 = new global::Gtk.Label (); - w27.LabelProp = "Réinitialiser"; - w27.UseUnderline = true; - w24.Add (w27); - w23.Add (w24); - this.btReset.Add (w23); - this.hbox3.Add (this.btReset); - global::Gtk.Box.BoxChild w31 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.btReset])); - w31.PackType = ((global::Gtk.PackType)(1)); - w31.Position = 3; - w31.Expand = false; - w31.Fill = false; + this.btReset.Label = "Réinitialiser"; + global::Gtk.Image w9 = new global::Gtk.Image(); + w9.Pixbuf = global::Stetic.IconLoader.LoadIcon(this, "gtk-clear", global::Gtk.IconSize.Menu); + this.btReset.Image = w9; + this.hbox3.Add(this.btReset); + global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.hbox3[this.btReset])); + w10.PackType = ((global::Gtk.PackType)(1)); + w10.Position = 3; + w10.Expand = false; + w10.Fill = false; // Container child hbox3.Gtk.Box+BoxChild - this.btPatchDroit = new global::Gtk.Button (); + this.btPatchDroit = new global::Gtk.Button(); this.btPatchDroit.CanFocus = true; this.btPatchDroit.Name = "btPatchDroit"; this.btPatchDroit.UseUnderline = true; - // Container child btPatchDroit.Gtk.Container+ContainerChild - global::Gtk.Alignment w32 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F); - // Container child GtkAlignment.Gtk.Container+ContainerChild - global::Gtk.HBox w33 = new global::Gtk.HBox (); - w33.Spacing = 2; - // Container child GtkHBox.Gtk.Container+ContainerChild - global::Gtk.Image w34 = new global::Gtk.Image (); - w34.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-sort-ascending", global::Gtk.IconSize.Menu); - w33.Add (w34); - // Container child GtkHBox.Gtk.Container+ContainerChild - global::Gtk.Label w36 = new global::Gtk.Label (); - w36.LabelProp = "Patch Droit"; - w36.UseUnderline = true; - w33.Add (w36); - w32.Add (w33); - this.btPatchDroit.Add (w32); - this.hbox3.Add (this.btPatchDroit); - global::Gtk.Box.BoxChild w40 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.btPatchDroit])); - w40.PackType = ((global::Gtk.PackType)(1)); - w40.Position = 4; - w40.Expand = false; - w40.Fill = false; - this.hbox2.Add (this.hbox3); - global::Gtk.Box.BoxChild w41 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.hbox3])); - w41.Position = 2; - w2.Add (this.hbox2); - global::Gtk.Box.BoxChild w42 = ((global::Gtk.Box.BoxChild)(w2 [this.hbox2])); - w42.Position = 0; - w42.Expand = false; - w42.Fill = false; + this.btPatchDroit.Label = "Patch Droit"; + global::Gtk.Image w11 = new global::Gtk.Image(); + w11.Pixbuf = global::Stetic.IconLoader.LoadIcon(this, "gtk-sort-ascending", global::Gtk.IconSize.Menu); + this.btPatchDroit.Image = w11; + this.hbox3.Add(this.btPatchDroit); + global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.hbox3[this.btPatchDroit])); + w12.PackType = ((global::Gtk.PackType)(1)); + w12.Position = 4; + w12.Expand = false; + w12.Fill = false; + this.hbox2.Add(this.hbox3); + global::Gtk.Box.BoxChild w13 = ((global::Gtk.Box.BoxChild)(this.hbox2[this.hbox3])); + w13.Position = 2; + w2.Add(this.hbox2); + global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(w2[this.hbox2])); + w14.Position = 0; + w14.Expand = false; + w14.Fill = false; // Container child dialog1_VBox.Gtk.Box+BoxChild - this.hseparator1 = new global::Gtk.HSeparator (); + this.hseparator1 = new global::Gtk.HSeparator(); this.hseparator1.HeightRequest = 24; this.hseparator1.Name = "hseparator1"; - w2.Add (this.hseparator1); - global::Gtk.Box.BoxChild w43 = ((global::Gtk.Box.BoxChild)(w2 [this.hseparator1])); - w43.Position = 1; - w43.Expand = false; - w43.Fill = false; + w2.Add(this.hseparator1); + global::Gtk.Box.BoxChild w15 = ((global::Gtk.Box.BoxChild)(w2[this.hseparator1])); + w15.Position = 1; + w15.Expand = false; + w15.Fill = false; // Container child dialog1_VBox.Gtk.Box+BoxChild - this.hbox1 = new global::Gtk.HBox (); + this.hbox1 = new global::Gtk.HBox(); this.hbox1.Name = "hbox1"; this.hbox1.Spacing = 6; // Container child hbox1.Gtk.Box+BoxChild - this.btAllume = new global::Gtk.ToggleButton (); + this.btAllume = new global::Gtk.ToggleButton(); this.btAllume.CanFocus = true; this.btAllume.Name = "btAllume"; this.btAllume.UseUnderline = true; - // Container child btAllume.Gtk.Container+ContainerChild - global::Gtk.Alignment w44 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F); - // Container child GtkAlignment.Gtk.Container+ContainerChild - global::Gtk.HBox w45 = new global::Gtk.HBox (); - w45.Spacing = 2; - // Container child GtkHBox.Gtk.Container+ContainerChild - global::Gtk.Image w46 = new global::Gtk.Image (); - w46.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-find", global::Gtk.IconSize.Menu); - w45.Add (w46); - // Container child GtkHBox.Gtk.Container+ContainerChild - global::Gtk.Label w48 = new global::Gtk.Label (); - w48.LabelProp = "Allumer !"; - w48.UseUnderline = true; - w45.Add (w48); - w44.Add (w45); - this.btAllume.Add (w44); - this.hbox1.Add (this.btAllume); - global::Gtk.Box.BoxChild w52 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.btAllume])); - w52.Position = 0; - w52.Expand = false; - w52.Fill = false; + this.btAllume.Label = "Allumer !"; + global::Gtk.Image w16 = new global::Gtk.Image(); + w16.Pixbuf = global::Stetic.IconLoader.LoadIcon(this, "gtk-find", global::Gtk.IconSize.Menu); + this.btAllume.Image = w16; + this.hbox1.Add(this.btAllume); + global::Gtk.Box.BoxChild w17 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.btAllume])); + w17.Position = 0; + w17.Expand = false; + w17.Fill = false; // Container child hbox1.Gtk.Box+BoxChild - this.spinDimmer = new global::Gtk.SpinButton (1, 512, 1); + this.spinDimmer = new global::Gtk.SpinButton(1D, 512D, 1D); this.spinDimmer.CanFocus = true; this.spinDimmer.Name = "spinDimmer"; - this.spinDimmer.Adjustment.PageIncrement = 10; - this.spinDimmer.ClimbRate = 1; + this.spinDimmer.Adjustment.PageIncrement = 10D; + this.spinDimmer.ClimbRate = 1D; this.spinDimmer.Numeric = true; - this.spinDimmer.Value = 1; - this.hbox1.Add (this.spinDimmer); - global::Gtk.Box.BoxChild w53 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.spinDimmer])); - w53.Position = 1; - w53.Expand = false; - w53.Fill = false; + this.spinDimmer.Value = 1D; + this.hbox1.Add(this.spinDimmer); + global::Gtk.Box.BoxChild w18 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.spinDimmer])); + w18.Position = 1; + w18.Expand = false; + w18.Fill = false; // Container child hbox1.Gtk.Box+BoxChild - this.label6 = new global::Gtk.Label (); + this.label6 = new global::Gtk.Label(); this.label6.Name = "label6"; this.label6.LabelProp = "Circuit :"; - this.hbox1.Add (this.label6); - global::Gtk.Box.BoxChild w54 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.label6])); - w54.Position = 2; - w54.Expand = false; - w54.Fill = false; + this.hbox1.Add(this.label6); + global::Gtk.Box.BoxChild w19 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.label6])); + w19.Position = 2; + w19.Expand = false; + w19.Fill = false; // Container child hbox1.Gtk.Box+BoxChild - this.cbCircuit = global::Gtk.ComboBox.NewText (); + this.cbCircuit = global::Gtk.ComboBox.NewText(); this.cbCircuit.Name = "cbCircuit"; - this.hbox1.Add (this.cbCircuit); - global::Gtk.Box.BoxChild w55 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.cbCircuit])); - w55.Position = 3; - w55.Expand = false; - w55.Fill = false; + this.hbox1.Add(this.cbCircuit); + global::Gtk.Box.BoxChild w20 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.cbCircuit])); + w20.Position = 3; + w20.Expand = false; + w20.Fill = false; // Container child hbox1.Gtk.Box+BoxChild - this.cbFT = global::Gtk.ComboBox.NewText (); + this.cbFT = global::Gtk.ComboBox.NewText(); this.cbFT.Name = "cbFT"; - this.hbox1.Add (this.cbFT); - global::Gtk.Box.BoxChild w56 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.cbFT])); - w56.Position = 4; - w56.Expand = false; - w56.Fill = false; + this.hbox1.Add(this.cbFT); + global::Gtk.Box.BoxChild w21 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.cbFT])); + w21.Position = 4; + w21.Expand = false; + w21.Fill = false; // Container child hbox1.Gtk.Box+BoxChild - this.lbParam1 = new global::Gtk.Label (); + this.lbParam1 = new global::Gtk.Label(); this.lbParam1.Name = "lbParam1"; this.lbParam1.LabelProp = "param 1"; - this.hbox1.Add (this.lbParam1); - global::Gtk.Box.BoxChild w57 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.lbParam1])); - w57.Position = 5; - w57.Expand = false; - w57.Fill = false; + this.hbox1.Add(this.lbParam1); + global::Gtk.Box.BoxChild w22 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.lbParam1])); + w22.Position = 5; + w22.Expand = false; + w22.Fill = false; // Container child hbox1.Gtk.Box+BoxChild - this.txtParam1 = new global::Gtk.Entry (); + this.txtParam1 = new global::Gtk.Entry(); this.txtParam1.CanFocus = true; this.txtParam1.Name = "txtParam1"; this.txtParam1.IsEditable = true; this.txtParam1.InvisibleChar = '•'; - this.hbox1.Add (this.txtParam1); - global::Gtk.Box.BoxChild w58 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.txtParam1])); - w58.Position = 6; + this.hbox1.Add(this.txtParam1); + global::Gtk.Box.BoxChild w23 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.txtParam1])); + w23.Position = 6; // Container child hbox1.Gtk.Box+BoxChild - this.lbParam2 = new global::Gtk.Label (); + this.lbParam2 = new global::Gtk.Label(); this.lbParam2.Name = "lbParam2"; this.lbParam2.LabelProp = "param2"; - this.hbox1.Add (this.lbParam2); - global::Gtk.Box.BoxChild w59 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.lbParam2])); - w59.Position = 7; - w59.Expand = false; - w59.Fill = false; + this.hbox1.Add(this.lbParam2); + global::Gtk.Box.BoxChild w24 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.lbParam2])); + w24.Position = 7; + w24.Expand = false; + w24.Fill = false; // Container child hbox1.Gtk.Box+BoxChild - this.txtParam2 = new global::Gtk.Entry (); + this.txtParam2 = new global::Gtk.Entry(); this.txtParam2.CanFocus = true; this.txtParam2.Name = "txtParam2"; this.txtParam2.IsEditable = true; this.txtParam2.InvisibleChar = '•'; - this.hbox1.Add (this.txtParam2); - global::Gtk.Box.BoxChild w60 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.txtParam2])); - w60.Position = 8; - w2.Add (this.hbox1); - global::Gtk.Box.BoxChild w61 = ((global::Gtk.Box.BoxChild)(w2 [this.hbox1])); - w61.Position = 2; - w61.Expand = false; - w61.Fill = false; + this.hbox1.Add(this.txtParam2); + global::Gtk.Box.BoxChild w25 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.txtParam2])); + w25.Position = 8; + w2.Add(this.hbox1); + global::Gtk.Box.BoxChild w26 = ((global::Gtk.Box.BoxChild)(w2[this.hbox1])); + w26.Position = 2; + w26.Expand = false; + w26.Fill = false; // Container child dialog1_VBox.Gtk.Box+BoxChild - this.notebook1 = new global::Gtk.Notebook (); + this.notebook1 = new global::Gtk.Notebook(); this.notebook1.CanFocus = true; this.notebook1.Name = "notebook1"; this.notebook1.CurrentPage = 0; // Container child notebook1.Gtk.Notebook+NotebookChild - this.GtkScrolledWindow = new global::Gtk.ScrolledWindow (); + this.GtkScrolledWindow = new global::Gtk.ScrolledWindow(); this.GtkScrolledWindow.Name = "GtkScrolledWindow"; this.GtkScrolledWindow.ShadowType = ((global::Gtk.ShadowType)(1)); // Container child GtkScrolledWindow.Gtk.Container+ContainerChild - this.tvDimm = new global::Gtk.TreeView (); + this.tvDimm = new global::Gtk.TreeView(); this.tvDimm.CanFocus = true; this.tvDimm.Name = "tvDimm"; - this.GtkScrolledWindow.Add (this.tvDimm); - this.notebook1.Add (this.GtkScrolledWindow); + this.GtkScrolledWindow.Add(this.tvDimm); + this.notebook1.Add(this.GtkScrolledWindow); // Notebook tab - this.label2 = new global::Gtk.Label (); + this.label2 = new global::Gtk.Label(); this.label2.Name = "label2"; this.label2.LabelProp = "Patch"; - this.notebook1.SetTabLabel (this.GtkScrolledWindow, this.label2); - this.label2.ShowAll (); + this.notebook1.SetTabLabel(this.GtkScrolledWindow, this.label2); + this.label2.ShowAll(); // Container child notebook1.Gtk.Notebook+NotebookChild - this.GtkScrolledWindow1 = new global::Gtk.ScrolledWindow (); + this.GtkScrolledWindow1 = new global::Gtk.ScrolledWindow(); this.GtkScrolledWindow1.Name = "GtkScrolledWindow1"; this.GtkScrolledWindow1.ShadowType = ((global::Gtk.ShadowType)(1)); // Container child GtkScrolledWindow1.Gtk.Container+ContainerChild - this.tvCircuits = new global::Gtk.TreeView (); + this.tvCircuits = new global::Gtk.TreeView(); this.tvCircuits.CanFocus = true; this.tvCircuits.Name = "tvCircuits"; - this.GtkScrolledWindow1.Add (this.tvCircuits); - this.notebook1.Add (this.GtkScrolledWindow1); - global::Gtk.Notebook.NotebookChild w65 = ((global::Gtk.Notebook.NotebookChild)(this.notebook1 [this.GtkScrolledWindow1])); - w65.Position = 1; + this.GtkScrolledWindow1.Add(this.tvCircuits); + this.notebook1.Add(this.GtkScrolledWindow1); + global::Gtk.Notebook.NotebookChild w30 = ((global::Gtk.Notebook.NotebookChild)(this.notebook1[this.GtkScrolledWindow1])); + w30.Position = 1; // Notebook tab - this.label5 = new global::Gtk.Label (); + this.label5 = new global::Gtk.Label(); this.label5.Name = "label5"; this.label5.LabelProp = "Patch Rapide"; - this.notebook1.SetTabLabel (this.GtkScrolledWindow1, this.label5); - this.label5.ShowAll (); - w2.Add (this.notebook1); - global::Gtk.Box.BoxChild w66 = ((global::Gtk.Box.BoxChild)(w2 [this.notebook1])); - w66.Position = 3; + this.notebook1.SetTabLabel(this.GtkScrolledWindow1, this.label5); + this.label5.ShowAll(); + w2.Add(this.notebook1); + global::Gtk.Box.BoxChild w31 = ((global::Gtk.Box.BoxChild)(w2[this.notebook1])); + w31.Position = 3; // Internal child DMX2.EditionUnivers.ActionArea - global::Gtk.HButtonBox w67 = this.ActionArea; - w67.Name = "dialog1_ActionArea"; - w67.Spacing = 10; - w67.BorderWidth = ((uint)(5)); - w67.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); + global::Gtk.HButtonBox w32 = this.ActionArea; + w32.Name = "dialog1_ActionArea"; + w32.Spacing = 10; + w32.BorderWidth = ((uint)(5)); + w32.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild - this.buttonCancel = new global::Gtk.Button (); + this.buttonCancel = new global::Gtk.Button(); this.buttonCancel.CanDefault = true; this.buttonCancel.CanFocus = true; this.buttonCancel.Name = "buttonCancel"; this.buttonCancel.UseStock = true; this.buttonCancel.UseUnderline = true; this.buttonCancel.Label = "gtk-close"; - this.AddActionWidget (this.buttonCancel, -7); - global::Gtk.ButtonBox.ButtonBoxChild w68 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w67 [this.buttonCancel])); - w68.Expand = false; - w68.Fill = false; - if ((this.Child != null)) { - this.Child.ShowAll (); + this.AddActionWidget(this.buttonCancel, -7); + global::Gtk.ButtonBox.ButtonBoxChild w33 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w32[this.buttonCancel])); + w33.Expand = false; + w33.Fill = false; + if ((this.Child != null)) + { + this.Child.ShowAll(); } this.DefaultWidth = 771; this.DefaultHeight = 483; - this.Show (); - this.cbUnivers.Changed += new global::System.EventHandler (this.OnCbUniversChanged); - this.btAdd.Clicked += new global::System.EventHandler (this.OnBtAddClicked); - this.btPatchDroit.Clicked += new global::System.EventHandler (this.OnBtPatchDroitClicked); - this.btReset.Clicked += new global::System.EventHandler (this.OnBtResetClicked); - this.btAllume.Clicked += new global::System.EventHandler (this.OnBtAllumeClicked); - this.spinDimmer.ValueChanged += new global::System.EventHandler (this.OnSpinDimmerValueChanged); - this.cbCircuit.Changed += new global::System.EventHandler (this.OnCbCircuitChanged); - this.cbFT.Changed += new global::System.EventHandler (this.OnCbFTChanged); - this.txtParam1.Changed += new global::System.EventHandler (this.OnTxtParam1Changed); - this.txtParam2.Changed += new global::System.EventHandler (this.OnTxtParam2Changed); - this.tvDimm.CursorChanged += new global::System.EventHandler (this.OnTvDimmCursorChanged); - this.buttonCancel.Clicked += new global::System.EventHandler (this.OnButtonCancelClicked); + this.Show(); + this.cbUnivers.Changed += new global::System.EventHandler(this.OnCbUniversChanged); + this.btAdd.Clicked += new global::System.EventHandler(this.OnBtAddClicked); + this.btPatchDroit.Clicked += new global::System.EventHandler(this.OnBtPatchDroitClicked); + this.btReset.Clicked += new global::System.EventHandler(this.OnBtResetClicked); + this.btAllume.Clicked += new global::System.EventHandler(this.OnBtAllumeClicked); + this.spinDimmer.ValueChanged += new global::System.EventHandler(this.OnSpinDimmerValueChanged); + this.cbCircuit.Changed += new global::System.EventHandler(this.OnCbCircuitChanged); + this.cbFT.Changed += new global::System.EventHandler(this.OnCbFTChanged); + this.txtParam1.Changed += new global::System.EventHandler(this.OnTxtParam1Changed); + this.txtParam2.Changed += new global::System.EventHandler(this.OnTxtParam2Changed); + this.tvDimm.CursorChanged += new global::System.EventHandler(this.OnTvDimmCursorChanged); + this.buttonCancel.Clicked += new global::System.EventHandler(this.OnButtonCancelClicked); } } } diff --git a/DMX-2.0/gtk-gui/DMX2.GestionCircuits.cs b/DMX-2.0/gtk-gui/DMX2.GestionCircuits.cs index 0537343..f1a0b5f 100644 --- a/DMX-2.0/gtk-gui/DMX2.GestionCircuits.cs +++ b/DMX-2.0/gtk-gui/DMX2.GestionCircuits.cs @@ -5,23 +5,29 @@ namespace DMX2 public partial class GestionCircuits { private global::Gtk.UIManager UIManager; + private global::Gtk.Action addAction; + private global::Gtk.VBox vbox2; + private global::Gtk.Toolbar toolbar1; + private global::Gtk.ScrolledWindow GtkScrolledWindow; + private global::Gtk.TreeView listeCircuits; + private global::Gtk.Button buttonOk; - protected virtual void Build () + protected virtual void Build() { - global::Stetic.Gui.Initialize (this); + global::Stetic.Gui.Initialize(this); // Widget DMX2.GestionCircuits - this.UIManager = new global::Gtk.UIManager (); - global::Gtk.ActionGroup w1 = new global::Gtk.ActionGroup ("Default"); - this.addAction = new global::Gtk.Action ("addAction", null, null, "gtk-add"); - w1.Add (this.addAction, null); - this.UIManager.InsertActionGroup (w1, 0); - this.AddAccelGroup (this.UIManager.AccelGroup); + this.UIManager = new global::Gtk.UIManager(); + global::Gtk.ActionGroup w1 = new global::Gtk.ActionGroup("Default"); + this.addAction = new global::Gtk.Action("addAction", null, null, "gtk-add"); + w1.Add(this.addAction, null); + this.UIManager.InsertActionGroup(w1, 0); + this.AddAccelGroup(this.UIManager.AccelGroup); this.Name = "DMX2.GestionCircuits"; this.Title = "Circuits"; this.TypeHint = ((global::Gdk.WindowTypeHint)(1)); @@ -33,63 +39,65 @@ namespace DMX2 w2.Name = "dialog1_VBox"; w2.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild - this.vbox2 = new global::Gtk.VBox (); + this.vbox2 = new global::Gtk.VBox(); this.vbox2.Name = "vbox2"; this.vbox2.Spacing = 6; // Container child vbox2.Gtk.Box+BoxChild - this.UIManager.AddUiFromString (""); - this.toolbar1 = ((global::Gtk.Toolbar)(this.UIManager.GetWidget ("/toolbar1"))); + this.UIManager.AddUiFromString(""); + this.toolbar1 = ((global::Gtk.Toolbar)(this.UIManager.GetWidget("/toolbar1"))); this.toolbar1.Name = "toolbar1"; this.toolbar1.ShowArrow = false; - this.vbox2.Add (this.toolbar1); - global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.toolbar1])); + this.vbox2.Add(this.toolbar1); + global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.toolbar1])); w3.Position = 0; w3.Expand = false; w3.Fill = false; // Container child vbox2.Gtk.Box+BoxChild - this.GtkScrolledWindow = new global::Gtk.ScrolledWindow (); + this.GtkScrolledWindow = new global::Gtk.ScrolledWindow(); this.GtkScrolledWindow.Name = "GtkScrolledWindow"; this.GtkScrolledWindow.ShadowType = ((global::Gtk.ShadowType)(1)); // Container child GtkScrolledWindow.Gtk.Container+ContainerChild - this.listeCircuits = new global::Gtk.TreeView (); + this.listeCircuits = new global::Gtk.TreeView(); this.listeCircuits.CanFocus = true; this.listeCircuits.Name = "listeCircuits"; this.listeCircuits.EnableSearch = false; this.listeCircuits.Reorderable = true; - this.GtkScrolledWindow.Add (this.listeCircuits); - this.vbox2.Add (this.GtkScrolledWindow); - global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.GtkScrolledWindow])); + this.GtkScrolledWindow.Add(this.listeCircuits); + this.vbox2.Add(this.GtkScrolledWindow); + global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.GtkScrolledWindow])); w5.Position = 1; - w2.Add (this.vbox2); - global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(w2 [this.vbox2])); + w2.Add(this.vbox2); + global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(w2[this.vbox2])); w6.Position = 0; // Internal child DMX2.GestionCircuits.ActionArea global::Gtk.HButtonBox w7 = this.ActionArea; - w7.Name = "dialog1_ActionArea"; + w7.Name = "dialog_ActionArea"; w7.Spacing = 10; w7.BorderWidth = ((uint)(5)); w7.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); - // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild - this.buttonOk = new global::Gtk.Button (); + // Container child dialog_ActionArea.Gtk.ButtonBox+ButtonBoxChild + this.buttonOk = new global::Gtk.Button(); this.buttonOk.CanDefault = true; this.buttonOk.CanFocus = true; this.buttonOk.Name = "buttonOk"; this.buttonOk.UseStock = true; this.buttonOk.UseUnderline = true; this.buttonOk.Label = "gtk-close"; - this.AddActionWidget (this.buttonOk, -7); - global::Gtk.ButtonBox.ButtonBoxChild w8 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w7 [this.buttonOk])); + this.AddActionWidget(this.buttonOk, -7); + global::Gtk.ButtonBox.ButtonBoxChild w8 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w7[this.buttonOk])); w8.Expand = false; w8.Fill = false; - if ((this.Child != null)) { - this.Child.ShowAll (); + if ((this.Child != null)) + { + this.Child.ShowAll(); } this.DefaultWidth = 400; this.DefaultHeight = 456; this.buttonOk.HasDefault = true; - this.Hide (); - this.Response += new global::Gtk.ResponseHandler (this.OnResp); - this.addAction.Activated += new global::System.EventHandler (this.OnAddActionActivated); + this.Hide(); + this.Response += new global::Gtk.ResponseHandler(this.OnResp); + this.addAction.Activated += new global::System.EventHandler(this.OnAddActionActivated); } } } diff --git a/DMX-2.0/gtk-gui/DMX2.GestionDriversUI.cs b/DMX-2.0/gtk-gui/DMX2.GestionDriversUI.cs index 5110119..b78cd77 100644 --- a/DMX-2.0/gtk-gui/DMX2.GestionDriversUI.cs +++ b/DMX-2.0/gtk-gui/DMX2.GestionDriversUI.cs @@ -5,19 +5,28 @@ namespace DMX2 public partial class GestionDriversUI { private global::Gtk.VBox vbox2; + private global::Gtk.TreeView listeUsb; + private global::Gtk.HBox hbox1; + private global::Gtk.ComboBox comboDriver; + private global::Gtk.Button btnDisconnect; + private global::Gtk.Button btnConnect; + private global::Gtk.Frame frmDrvUI; + private global::Gtk.Alignment frmDrvChild; + private global::Gtk.Label GtkLabel2; + private global::Gtk.Button buttonOk; - protected virtual void Build () + protected virtual void Build() { - global::Stetic.Gui.Initialize (this); + global::Stetic.Gui.Initialize(this); // Widget DMX2.GestionDriversUI this.Name = "DMX2.GestionDriversUI"; this.WindowPosition = ((global::Gtk.WindowPosition)(4)); @@ -26,81 +35,81 @@ namespace DMX2 w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild - this.vbox2 = new global::Gtk.VBox (); + this.vbox2 = new global::Gtk.VBox(); this.vbox2.Name = "vbox2"; this.vbox2.Spacing = 6; // Container child vbox2.Gtk.Box+BoxChild - this.listeUsb = new global::Gtk.TreeView (); + this.listeUsb = new global::Gtk.TreeView(); this.listeUsb.HeightRequest = 87; this.listeUsb.CanFocus = true; this.listeUsb.Name = "listeUsb"; - this.vbox2.Add (this.listeUsb); - global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.listeUsb])); + this.vbox2.Add(this.listeUsb); + global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.listeUsb])); w2.Position = 0; w2.Expand = false; // Container child vbox2.Gtk.Box+BoxChild - this.hbox1 = new global::Gtk.HBox (); + this.hbox1 = new global::Gtk.HBox(); this.hbox1.Name = "hbox1"; this.hbox1.Spacing = 6; // Container child hbox1.Gtk.Box+BoxChild - this.comboDriver = global::Gtk.ComboBox.NewText (); + this.comboDriver = global::Gtk.ComboBox.NewText(); this.comboDriver.Sensitive = false; this.comboDriver.Name = "comboDriver"; - this.hbox1.Add (this.comboDriver); - global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.comboDriver])); + this.hbox1.Add(this.comboDriver); + global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.comboDriver])); w3.Position = 0; // Container child hbox1.Gtk.Box+BoxChild - this.btnDisconnect = new global::Gtk.Button (); + this.btnDisconnect = new global::Gtk.Button(); this.btnDisconnect.Sensitive = false; this.btnDisconnect.CanFocus = true; this.btnDisconnect.Name = "btnDisconnect"; this.btnDisconnect.UseStock = true; this.btnDisconnect.UseUnderline = true; this.btnDisconnect.Label = "gtk-disconnect"; - this.hbox1.Add (this.btnDisconnect); - global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.btnDisconnect])); + this.hbox1.Add(this.btnDisconnect); + global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.btnDisconnect])); w4.PackType = ((global::Gtk.PackType)(1)); w4.Position = 1; w4.Expand = false; w4.Fill = false; // Container child hbox1.Gtk.Box+BoxChild - this.btnConnect = new global::Gtk.Button (); + this.btnConnect = new global::Gtk.Button(); this.btnConnect.Sensitive = false; this.btnConnect.CanFocus = true; this.btnConnect.Name = "btnConnect"; this.btnConnect.UseStock = true; this.btnConnect.UseUnderline = true; this.btnConnect.Label = "gtk-connect"; - this.hbox1.Add (this.btnConnect); - global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.btnConnect])); + this.hbox1.Add(this.btnConnect); + global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.btnConnect])); w5.PackType = ((global::Gtk.PackType)(1)); w5.Position = 2; w5.Expand = false; w5.Fill = false; - this.vbox2.Add (this.hbox1); - global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.hbox1])); + this.vbox2.Add(this.hbox1); + global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.hbox1])); w6.Position = 1; w6.Expand = false; w6.Fill = false; // Container child vbox2.Gtk.Box+BoxChild - this.frmDrvUI = new global::Gtk.Frame (); + this.frmDrvUI = new global::Gtk.Frame(); this.frmDrvUI.HeightRequest = 200; this.frmDrvUI.Name = "frmDrvUI"; this.frmDrvUI.ShadowType = ((global::Gtk.ShadowType)(1)); // Container child frmDrvUI.Gtk.Container+ContainerChild - this.frmDrvChild = new global::Gtk.Alignment (0F, 0F, 1F, 1F); + this.frmDrvChild = new global::Gtk.Alignment(0F, 0F, 1F, 1F); this.frmDrvChild.Name = "frmDrvChild"; this.frmDrvChild.LeftPadding = ((uint)(12)); - this.frmDrvUI.Add (this.frmDrvChild); - this.GtkLabel2 = new global::Gtk.Label (); + this.frmDrvUI.Add(this.frmDrvChild); + this.GtkLabel2 = new global::Gtk.Label(); this.GtkLabel2.Name = "GtkLabel2"; this.GtkLabel2.UseMarkup = true; this.frmDrvUI.LabelWidget = this.GtkLabel2; - this.vbox2.Add (this.frmDrvUI); - global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.frmDrvUI])); + this.vbox2.Add(this.frmDrvUI); + global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.frmDrvUI])); w8.Position = 2; - w1.Add (this.vbox2); - global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2])); + w1.Add(this.vbox2); + global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(w1[this.vbox2])); w9.Position = 0; // Internal child DMX2.GestionDriversUI.ActionArea global::Gtk.HButtonBox w10 = this.ActionArea; @@ -109,27 +118,28 @@ namespace DMX2 w10.BorderWidth = ((uint)(5)); w10.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild - this.buttonOk = new global::Gtk.Button (); + this.buttonOk = new global::Gtk.Button(); this.buttonOk.CanDefault = true; this.buttonOk.CanFocus = true; this.buttonOk.Name = "buttonOk"; this.buttonOk.UseStock = true; this.buttonOk.UseUnderline = true; this.buttonOk.Label = "gtk-close"; - this.AddActionWidget (this.buttonOk, -7); - global::Gtk.ButtonBox.ButtonBoxChild w11 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w10 [this.buttonOk])); + this.AddActionWidget(this.buttonOk, -7); + global::Gtk.ButtonBox.ButtonBoxChild w11 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w10[this.buttonOk])); w11.Expand = false; w11.Fill = false; - if ((this.Child != null)) { - this.Child.ShowAll (); + if ((this.Child != null)) + { + this.Child.ShowAll(); } this.DefaultWidth = 488; this.DefaultHeight = 420; - this.Show (); - this.listeUsb.CursorChanged += new global::System.EventHandler (this.OnListeUsbCursorChanged); - this.btnConnect.Clicked += new global::System.EventHandler (this.OnBtnConnectClicked); - this.btnDisconnect.Clicked += new global::System.EventHandler (this.OnBtnDisConnectClicked); - this.buttonOk.Clicked += new global::System.EventHandler (this.OnButtonOkClicked); + this.Show(); + this.listeUsb.CursorChanged += new global::System.EventHandler(this.OnListeUsbCursorChanged); + this.btnConnect.Clicked += new global::System.EventHandler(this.OnBtnConnectClicked); + this.btnDisconnect.Clicked += new global::System.EventHandler(this.OnBtnDisConnectClicked); + this.buttonOk.Clicked += new global::System.EventHandler(this.OnButtonOkClicked); } } } diff --git a/DMX-2.0/gtk-gui/DMX2.GestionMidiUI.cs b/DMX-2.0/gtk-gui/DMX2.GestionMidiUI.cs index c67b852..9c3159f 100644 --- a/DMX-2.0/gtk-gui/DMX2.GestionMidiUI.cs +++ b/DMX-2.0/gtk-gui/DMX2.GestionMidiUI.cs @@ -5,43 +5,76 @@ namespace DMX2 public partial class GestionMidiUI { private global::Gtk.Table table1; + private global::Gtk.Frame frame2; + private global::Gtk.Alignment GtkAlignment3; + private global::Gtk.Table table2; + private global::Gtk.CheckButton chkFourteenBits; + private global::Gtk.CheckButton chkPg; + private global::Gtk.Label label3; + private global::Gtk.Label label4; + private global::Gtk.Label label5; + private global::Gtk.Label label6; + private global::Gtk.SpinButton spinMax14b; + private global::Gtk.SpinButton spinNbPage; + private global::Gtk.SpinButton spinPageDown; + private global::Gtk.SpinButton spinPageUp; + private global::Gtk.SpinButton spinUPCh; - private global::Gtk.Label GtkLabel6; + + private global::Gtk.Label GtkLabelT; + private global::Gtk.Frame frame3; + private global::Gtk.Alignment GtkAlignment2; + private global::Gtk.VBox vbox5; + private global::Gtk.CheckButton chkFB; + private global::Gtk.Label GtkLabel3; + private global::Gtk.HButtonBox hbuttonbox2; + private global::Gtk.Button btnActiv; + private global::Gtk.Button btnDesactiv; + private global::Gtk.VBox vbox2; + private global::Gtk.Label label1; + private global::Gtk.ScrolledWindow GtkScrolledWindow; + private global::Gtk.TreeView listDetect; + private global::Gtk.VBox vbox3; + private global::Gtk.Label label2; + private global::Gtk.ScrolledWindow GtkScrolledWindow1; + private global::Gtk.TreeView listKnown; + private global::Gtk.Button btnClearEvents; + private global::Gtk.Button buttonClose; - protected virtual void Build () + protected virtual void Build() { - global::Stetic.Gui.Initialize (this); + global::Stetic.Gui.Initialize(this); // Widget DMX2.GestionMidiUI this.Name = "DMX2.GestionMidiUI"; this.Title = "Connexions Midi"; @@ -51,102 +84,102 @@ namespace DMX2 w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild - this.table1 = new global::Gtk.Table (((uint)(3)), ((uint)(2)), false); + this.table1 = new global::Gtk.Table(((uint)(3)), ((uint)(2)), false); this.table1.Name = "table1"; this.table1.RowSpacing = ((uint)(6)); this.table1.ColumnSpacing = ((uint)(6)); // Container child table1.Gtk.Table+TableChild - this.frame2 = new global::Gtk.Frame (); + this.frame2 = new global::Gtk.Frame(); this.frame2.Name = "frame2"; this.frame2.ShadowType = ((global::Gtk.ShadowType)(1)); // Container child frame2.Gtk.Container+ContainerChild - this.GtkAlignment3 = new global::Gtk.Alignment (0F, 0F, 1F, 1F); + this.GtkAlignment3 = new global::Gtk.Alignment(0F, 0F, 1F, 1F); this.GtkAlignment3.Name = "GtkAlignment3"; this.GtkAlignment3.LeftPadding = ((uint)(12)); // Container child GtkAlignment3.Gtk.Container+ContainerChild - this.table2 = new global::Gtk.Table (((uint)(6)), ((uint)(2)), false); + this.table2 = new global::Gtk.Table(((uint)(6)), ((uint)(2)), false); this.table2.Name = "table2"; this.table2.RowSpacing = ((uint)(6)); this.table2.ColumnSpacing = ((uint)(6)); // Container child table2.Gtk.Table+TableChild - this.chkFourteenBits = new global::Gtk.CheckButton (); + this.chkFourteenBits = new global::Gtk.CheckButton(); this.chkFourteenBits.CanFocus = true; this.chkFourteenBits.Name = "chkFourteenBits"; this.chkFourteenBits.Label = "Mode 14bits (CC 1 à 32)"; this.chkFourteenBits.DrawIndicator = true; this.chkFourteenBits.UseUnderline = true; - this.table2.Add (this.chkFourteenBits); - global::Gtk.Table.TableChild w2 = ((global::Gtk.Table.TableChild)(this.table2 [this.chkFourteenBits])); + this.table2.Add(this.chkFourteenBits); + global::Gtk.Table.TableChild w2 = ((global::Gtk.Table.TableChild)(this.table2[this.chkFourteenBits])); w2.TopAttach = ((uint)(4)); w2.BottomAttach = ((uint)(5)); w2.XOptions = ((global::Gtk.AttachOptions)(4)); w2.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table2.Gtk.Table+TableChild - this.chkPg = new global::Gtk.CheckButton (); + this.chkPg = new global::Gtk.CheckButton(); this.chkPg.CanFocus = true; this.chkPg.Name = "chkPg"; this.chkPg.Label = "ne pas paginer ce canal :"; this.chkPg.DrawIndicator = true; this.chkPg.UseUnderline = true; - this.table2.Add (this.chkPg); - global::Gtk.Table.TableChild w3 = ((global::Gtk.Table.TableChild)(this.table2 [this.chkPg])); + this.table2.Add(this.chkPg); + global::Gtk.Table.TableChild w3 = ((global::Gtk.Table.TableChild)(this.table2[this.chkPg])); w3.TopAttach = ((uint)(1)); w3.BottomAttach = ((uint)(2)); w3.XOptions = ((global::Gtk.AttachOptions)(4)); w3.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table2.Gtk.Table+TableChild - this.label3 = new global::Gtk.Label (); + this.label3 = new global::Gtk.Label(); this.label3.Name = "label3"; this.label3.Xalign = 0F; this.label3.LabelProp = "Nombre de pages"; - this.table2.Add (this.label3); - global::Gtk.Table.TableChild w4 = ((global::Gtk.Table.TableChild)(this.table2 [this.label3])); + this.table2.Add(this.label3); + global::Gtk.Table.TableChild w4 = ((global::Gtk.Table.TableChild)(this.table2[this.label3])); w4.XOptions = ((global::Gtk.AttachOptions)(4)); w4.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table2.Gtk.Table+TableChild - this.label4 = new global::Gtk.Label (); + this.label4 = new global::Gtk.Label(); this.label4.Name = "label4"; this.label4.Xalign = 0F; this.label4.LabelProp = "CC page suivante :"; - this.table2.Add (this.label4); - global::Gtk.Table.TableChild w5 = ((global::Gtk.Table.TableChild)(this.table2 [this.label4])); + this.table2.Add(this.label4); + global::Gtk.Table.TableChild w5 = ((global::Gtk.Table.TableChild)(this.table2[this.label4])); w5.TopAttach = ((uint)(2)); w5.BottomAttach = ((uint)(3)); w5.XOptions = ((global::Gtk.AttachOptions)(4)); w5.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table2.Gtk.Table+TableChild - this.label5 = new global::Gtk.Label (); + this.label5 = new global::Gtk.Label(); this.label5.Name = "label5"; this.label5.Xalign = 0F; this.label5.LabelProp = "CC page précédente :"; - this.table2.Add (this.label5); - global::Gtk.Table.TableChild w6 = ((global::Gtk.Table.TableChild)(this.table2 [this.label5])); + this.table2.Add(this.label5); + global::Gtk.Table.TableChild w6 = ((global::Gtk.Table.TableChild)(this.table2[this.label5])); w6.TopAttach = ((uint)(3)); w6.BottomAttach = ((uint)(4)); w6.XOptions = ((global::Gtk.AttachOptions)(4)); w6.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table2.Gtk.Table+TableChild - this.label6 = new global::Gtk.Label (); + this.label6 = new global::Gtk.Label(); this.label6.Name = "label6"; this.label6.Xpad = 20; this.label6.Xalign = 0F; this.label6.LabelProp = "Valeur entrée max :"; - this.table2.Add (this.label6); - global::Gtk.Table.TableChild w7 = ((global::Gtk.Table.TableChild)(this.table2 [this.label6])); + this.table2.Add(this.label6); + global::Gtk.Table.TableChild w7 = ((global::Gtk.Table.TableChild)(this.table2[this.label6])); w7.TopAttach = ((uint)(5)); w7.BottomAttach = ((uint)(6)); w7.XOptions = ((global::Gtk.AttachOptions)(4)); w7.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table2.Gtk.Table+TableChild - this.spinMax14b = new global::Gtk.SpinButton (1, 16383, 1); + this.spinMax14b = new global::Gtk.SpinButton(1D, 16383D, 1D); this.spinMax14b.CanFocus = true; this.spinMax14b.Name = "spinMax14b"; - this.spinMax14b.Adjustment.PageIncrement = 10; - this.spinMax14b.ClimbRate = 1; + this.spinMax14b.Adjustment.PageIncrement = 10D; + this.spinMax14b.ClimbRate = 1D; this.spinMax14b.Numeric = true; - this.spinMax14b.Value = 127; - this.table2.Add (this.spinMax14b); - global::Gtk.Table.TableChild w8 = ((global::Gtk.Table.TableChild)(this.table2 [this.spinMax14b])); + this.spinMax14b.Value = 127D; + this.table2.Add(this.spinMax14b); + global::Gtk.Table.TableChild w8 = ((global::Gtk.Table.TableChild)(this.table2[this.spinMax14b])); w8.TopAttach = ((uint)(5)); w8.BottomAttach = ((uint)(6)); w8.LeftAttach = ((uint)(1)); @@ -154,29 +187,29 @@ namespace DMX2 w8.XOptions = ((global::Gtk.AttachOptions)(4)); w8.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table2.Gtk.Table+TableChild - this.spinNbPage = new global::Gtk.SpinButton (1, 99, 1); + this.spinNbPage = new global::Gtk.SpinButton(1D, 99D, 1D); this.spinNbPage.CanFocus = true; this.spinNbPage.Name = "spinNbPage"; - this.spinNbPage.Adjustment.PageIncrement = 10; - this.spinNbPage.ClimbRate = 1; + this.spinNbPage.Adjustment.PageIncrement = 10D; + this.spinNbPage.ClimbRate = 1D; this.spinNbPage.Numeric = true; - this.spinNbPage.Value = 8; - this.table2.Add (this.spinNbPage); - global::Gtk.Table.TableChild w9 = ((global::Gtk.Table.TableChild)(this.table2 [this.spinNbPage])); + this.spinNbPage.Value = 8D; + this.table2.Add(this.spinNbPage); + global::Gtk.Table.TableChild w9 = ((global::Gtk.Table.TableChild)(this.table2[this.spinNbPage])); w9.LeftAttach = ((uint)(1)); w9.RightAttach = ((uint)(2)); w9.XOptions = ((global::Gtk.AttachOptions)(4)); w9.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table2.Gtk.Table+TableChild - this.spinPageDown = new global::Gtk.SpinButton (1, 127, 1); + this.spinPageDown = new global::Gtk.SpinButton(1D, 127D, 1D); this.spinPageDown.CanFocus = true; this.spinPageDown.Name = "spinPageDown"; - this.spinPageDown.Adjustment.PageIncrement = 10; - this.spinPageDown.ClimbRate = 1; + this.spinPageDown.Adjustment.PageIncrement = 10D; + this.spinPageDown.ClimbRate = 1D; this.spinPageDown.Numeric = true; - this.spinPageDown.Value = 126; - this.table2.Add (this.spinPageDown); - global::Gtk.Table.TableChild w10 = ((global::Gtk.Table.TableChild)(this.table2 [this.spinPageDown])); + this.spinPageDown.Value = 126D; + this.table2.Add(this.spinPageDown); + global::Gtk.Table.TableChild w10 = ((global::Gtk.Table.TableChild)(this.table2[this.spinPageDown])); w10.TopAttach = ((uint)(3)); w10.BottomAttach = ((uint)(4)); w10.LeftAttach = ((uint)(1)); @@ -184,15 +217,15 @@ namespace DMX2 w10.XOptions = ((global::Gtk.AttachOptions)(4)); w10.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table2.Gtk.Table+TableChild - this.spinPageUp = new global::Gtk.SpinButton (1, 127, 1); + this.spinPageUp = new global::Gtk.SpinButton(1D, 127D, 1D); this.spinPageUp.CanFocus = true; this.spinPageUp.Name = "spinPageUp"; - this.spinPageUp.Adjustment.PageIncrement = 10; - this.spinPageUp.ClimbRate = 1; + this.spinPageUp.Adjustment.PageIncrement = 10D; + this.spinPageUp.ClimbRate = 1D; this.spinPageUp.Numeric = true; - this.spinPageUp.Value = 127; - this.table2.Add (this.spinPageUp); - global::Gtk.Table.TableChild w11 = ((global::Gtk.Table.TableChild)(this.table2 [this.spinPageUp])); + this.spinPageUp.Value = 127D; + this.table2.Add(this.spinPageUp); + global::Gtk.Table.TableChild w11 = ((global::Gtk.Table.TableChild)(this.table2[this.spinPageUp])); w11.TopAttach = ((uint)(2)); w11.BottomAttach = ((uint)(3)); w11.LeftAttach = ((uint)(1)); @@ -200,249 +233,226 @@ namespace DMX2 w11.XOptions = ((global::Gtk.AttachOptions)(4)); w11.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table2.Gtk.Table+TableChild - this.spinUPCh = new global::Gtk.SpinButton (1, 16, 1); + this.spinUPCh = new global::Gtk.SpinButton(1D, 16D, 1D); this.spinUPCh.CanFocus = true; this.spinUPCh.Name = "spinUPCh"; - this.spinUPCh.Adjustment.PageIncrement = 1; - this.spinUPCh.ClimbRate = 1; + this.spinUPCh.Adjustment.PageIncrement = 1D; + this.spinUPCh.ClimbRate = 1D; this.spinUPCh.Numeric = true; - this.spinUPCh.Value = 1; - this.table2.Add (this.spinUPCh); - global::Gtk.Table.TableChild w12 = ((global::Gtk.Table.TableChild)(this.table2 [this.spinUPCh])); + this.spinUPCh.Value = 1D; + this.table2.Add(this.spinUPCh); + global::Gtk.Table.TableChild w12 = ((global::Gtk.Table.TableChild)(this.table2[this.spinUPCh])); w12.TopAttach = ((uint)(1)); w12.BottomAttach = ((uint)(2)); w12.LeftAttach = ((uint)(1)); w12.RightAttach = ((uint)(2)); w12.XOptions = ((global::Gtk.AttachOptions)(4)); w12.YOptions = ((global::Gtk.AttachOptions)(4)); - this.GtkAlignment3.Add (this.table2); - this.frame2.Add (this.GtkAlignment3); - this.GtkLabel6 = new global::Gtk.Label (); - this.GtkLabel6.Name = "GtkLabel6"; - this.GtkLabel6.LabelProp = "Options Midi"; - this.GtkLabel6.UseMarkup = true; - this.frame2.LabelWidget = this.GtkLabel6; - this.table1.Add (this.frame2); - global::Gtk.Table.TableChild w15 = ((global::Gtk.Table.TableChild)(this.table1 [this.frame2])); + this.GtkAlignment3.Add(this.table2); + this.frame2.Add(this.GtkAlignment3); + this.GtkLabelT = new global::Gtk.Label(); + this.GtkLabelT.Name = "GtkLabelT"; + this.GtkLabelT.LabelProp = "Options Midi"; + this.GtkLabelT.UseMarkup = true; + this.frame2.LabelWidget = this.GtkLabelT; + this.table1.Add(this.frame2); + global::Gtk.Table.TableChild w15 = ((global::Gtk.Table.TableChild)(this.table1[this.frame2])); w15.XOptions = ((global::Gtk.AttachOptions)(4)); w15.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild - this.frame3 = new global::Gtk.Frame (); + this.frame3 = new global::Gtk.Frame(); this.frame3.Name = "frame3"; this.frame3.ShadowType = ((global::Gtk.ShadowType)(1)); // Container child frame3.Gtk.Container+ContainerChild - this.GtkAlignment2 = new global::Gtk.Alignment (0F, 0F, 1F, 1F); + this.GtkAlignment2 = new global::Gtk.Alignment(0F, 0F, 1F, 1F); this.GtkAlignment2.Name = "GtkAlignment2"; this.GtkAlignment2.LeftPadding = ((uint)(12)); // Container child GtkAlignment2.Gtk.Container+ContainerChild - this.vbox5 = new global::Gtk.VBox (); + this.vbox5 = new global::Gtk.VBox(); this.vbox5.Name = "vbox5"; this.vbox5.Spacing = 6; // Container child vbox5.Gtk.Box+BoxChild - this.chkFB = new global::Gtk.CheckButton (); + this.chkFB = new global::Gtk.CheckButton(); this.chkFB.Sensitive = false; this.chkFB.CanFocus = true; this.chkFB.Name = "chkFB"; this.chkFB.Label = "Feedback\n(interface motorisée)"; this.chkFB.DrawIndicator = true; this.chkFB.UseUnderline = true; - this.vbox5.Add (this.chkFB); - global::Gtk.Box.BoxChild w16 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.chkFB])); + this.vbox5.Add(this.chkFB); + global::Gtk.Box.BoxChild w16 = ((global::Gtk.Box.BoxChild)(this.vbox5[this.chkFB])); w16.Position = 0; w16.Expand = false; w16.Fill = false; - this.GtkAlignment2.Add (this.vbox5); - this.frame3.Add (this.GtkAlignment2); - this.GtkLabel3 = new global::Gtk.Label (); + this.GtkAlignment2.Add(this.vbox5); + this.frame3.Add(this.GtkAlignment2); + this.GtkLabel3 = new global::Gtk.Label(); this.GtkLabel3.Name = "GtkLabel3"; - this.GtkLabel3.LabelProp = "Options de l'interface"; + this.GtkLabel3.LabelProp = "Options de l\'interface"; this.GtkLabel3.UseMarkup = true; this.frame3.LabelWidget = this.GtkLabel3; - this.table1.Add (this.frame3); - global::Gtk.Table.TableChild w19 = ((global::Gtk.Table.TableChild)(this.table1 [this.frame3])); + this.table1.Add(this.frame3); + global::Gtk.Table.TableChild w19 = ((global::Gtk.Table.TableChild)(this.table1[this.frame3])); w19.TopAttach = ((uint)(2)); w19.BottomAttach = ((uint)(3)); w19.XOptions = ((global::Gtk.AttachOptions)(4)); w19.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild - this.hbuttonbox2 = new global::Gtk.HButtonBox (); + this.hbuttonbox2 = new global::Gtk.HButtonBox(); this.hbuttonbox2.Name = "hbuttonbox2"; // Container child hbuttonbox2.Gtk.ButtonBox+ButtonBoxChild - this.btnActiv = new global::Gtk.Button (); + this.btnActiv = new global::Gtk.Button(); this.btnActiv.Sensitive = false; this.btnActiv.CanFocus = true; this.btnActiv.Name = "btnActiv"; this.btnActiv.UseUnderline = true; - // Container child btnActiv.Gtk.Container+ContainerChild - global::Gtk.Alignment w20 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F); - // Container child GtkAlignment.Gtk.Container+ContainerChild - global::Gtk.HBox w21 = new global::Gtk.HBox (); - w21.Spacing = 2; - // Container child GtkHBox.Gtk.Container+ContainerChild - global::Gtk.Image w22 = new global::Gtk.Image (); - w22.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-go-down", global::Gtk.IconSize.Menu); - w21.Add (w22); - // Container child GtkHBox.Gtk.Container+ContainerChild - global::Gtk.Label w24 = new global::Gtk.Label (); - w24.LabelProp = "Activer"; - w24.UseUnderline = true; - w21.Add (w24); - w20.Add (w21); - this.btnActiv.Add (w20); - this.hbuttonbox2.Add (this.btnActiv); - global::Gtk.ButtonBox.ButtonBoxChild w28 = ((global::Gtk.ButtonBox.ButtonBoxChild)(this.hbuttonbox2 [this.btnActiv])); - w28.Expand = false; - w28.Fill = false; + this.btnActiv.Label = "Activer"; + global::Gtk.Image w20 = new global::Gtk.Image(); + w20.Pixbuf = global::Stetic.IconLoader.LoadIcon(this, "gtk-go-down", global::Gtk.IconSize.Menu); + this.btnActiv.Image = w20; + this.hbuttonbox2.Add(this.btnActiv); + global::Gtk.ButtonBox.ButtonBoxChild w21 = ((global::Gtk.ButtonBox.ButtonBoxChild)(this.hbuttonbox2[this.btnActiv])); + w21.Expand = false; + w21.Fill = false; // Container child hbuttonbox2.Gtk.ButtonBox+ButtonBoxChild - this.btnDesactiv = new global::Gtk.Button (); + this.btnDesactiv = new global::Gtk.Button(); this.btnDesactiv.Sensitive = false; this.btnDesactiv.CanFocus = true; this.btnDesactiv.Name = "btnDesactiv"; this.btnDesactiv.UseUnderline = true; - // Container child btnDesactiv.Gtk.Container+ContainerChild - global::Gtk.Alignment w29 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F); - // Container child GtkAlignment.Gtk.Container+ContainerChild - global::Gtk.HBox w30 = new global::Gtk.HBox (); - w30.Spacing = 2; - // Container child GtkHBox.Gtk.Container+ContainerChild - global::Gtk.Image w31 = new global::Gtk.Image (); - w31.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-go-up", global::Gtk.IconSize.Menu); - w30.Add (w31); - // Container child GtkHBox.Gtk.Container+ContainerChild - global::Gtk.Label w33 = new global::Gtk.Label (); - w33.LabelProp = "Désactiver"; - w33.UseUnderline = true; - w30.Add (w33); - w29.Add (w30); - this.btnDesactiv.Add (w29); - this.hbuttonbox2.Add (this.btnDesactiv); - global::Gtk.ButtonBox.ButtonBoxChild w37 = ((global::Gtk.ButtonBox.ButtonBoxChild)(this.hbuttonbox2 [this.btnDesactiv])); - w37.Position = 1; - w37.Expand = false; - w37.Fill = false; - this.table1.Add (this.hbuttonbox2); - global::Gtk.Table.TableChild w38 = ((global::Gtk.Table.TableChild)(this.table1 [this.hbuttonbox2])); - w38.TopAttach = ((uint)(1)); - w38.BottomAttach = ((uint)(2)); - w38.LeftAttach = ((uint)(1)); - w38.RightAttach = ((uint)(2)); - w38.XOptions = ((global::Gtk.AttachOptions)(0)); - w38.YOptions = ((global::Gtk.AttachOptions)(4)); + this.btnDesactiv.Label = "Désactiver"; + global::Gtk.Image w22 = new global::Gtk.Image(); + w22.Pixbuf = global::Stetic.IconLoader.LoadIcon(this, "gtk-go-up", global::Gtk.IconSize.Menu); + this.btnDesactiv.Image = w22; + this.hbuttonbox2.Add(this.btnDesactiv); + global::Gtk.ButtonBox.ButtonBoxChild w23 = ((global::Gtk.ButtonBox.ButtonBoxChild)(this.hbuttonbox2[this.btnDesactiv])); + w23.Position = 1; + w23.Expand = false; + w23.Fill = false; + this.table1.Add(this.hbuttonbox2); + global::Gtk.Table.TableChild w24 = ((global::Gtk.Table.TableChild)(this.table1[this.hbuttonbox2])); + w24.TopAttach = ((uint)(1)); + w24.BottomAttach = ((uint)(2)); + w24.LeftAttach = ((uint)(1)); + w24.RightAttach = ((uint)(2)); + w24.XOptions = ((global::Gtk.AttachOptions)(0)); + w24.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild - this.vbox2 = new global::Gtk.VBox (); + this.vbox2 = new global::Gtk.VBox(); this.vbox2.Name = "vbox2"; this.vbox2.Spacing = 6; // Container child vbox2.Gtk.Box+BoxChild - this.label1 = new global::Gtk.Label (); + this.label1 = new global::Gtk.Label(); this.label1.Name = "label1"; this.label1.Xalign = 0F; this.label1.LabelProp = "Interfaces disponibles :"; - this.vbox2.Add (this.label1); - global::Gtk.Box.BoxChild w39 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.label1])); - w39.Position = 0; - w39.Expand = false; - w39.Fill = false; + this.vbox2.Add(this.label1); + global::Gtk.Box.BoxChild w25 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.label1])); + w25.Position = 0; + w25.Expand = false; + w25.Fill = false; // Container child vbox2.Gtk.Box+BoxChild - this.GtkScrolledWindow = new global::Gtk.ScrolledWindow (); + this.GtkScrolledWindow = new global::Gtk.ScrolledWindow(); this.GtkScrolledWindow.Name = "GtkScrolledWindow"; this.GtkScrolledWindow.ShadowType = ((global::Gtk.ShadowType)(1)); // Container child GtkScrolledWindow.Gtk.Container+ContainerChild - this.listDetect = new global::Gtk.TreeView (); + this.listDetect = new global::Gtk.TreeView(); this.listDetect.CanFocus = true; this.listDetect.Name = "listDetect"; this.listDetect.HeadersVisible = false; - this.GtkScrolledWindow.Add (this.listDetect); - this.vbox2.Add (this.GtkScrolledWindow); - global::Gtk.Box.BoxChild w41 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.GtkScrolledWindow])); - w41.Position = 1; - this.table1.Add (this.vbox2); - global::Gtk.Table.TableChild w42 = ((global::Gtk.Table.TableChild)(this.table1 [this.vbox2])); - w42.LeftAttach = ((uint)(1)); - w42.RightAttach = ((uint)(2)); + this.GtkScrolledWindow.Add(this.listDetect); + this.vbox2.Add(this.GtkScrolledWindow); + global::Gtk.Box.BoxChild w27 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.GtkScrolledWindow])); + w27.Position = 1; + this.table1.Add(this.vbox2); + global::Gtk.Table.TableChild w28 = ((global::Gtk.Table.TableChild)(this.table1[this.vbox2])); + w28.LeftAttach = ((uint)(1)); + w28.RightAttach = ((uint)(2)); // Container child table1.Gtk.Table+TableChild - this.vbox3 = new global::Gtk.VBox (); + this.vbox3 = new global::Gtk.VBox(); this.vbox3.Name = "vbox3"; this.vbox3.Spacing = 6; // Container child vbox3.Gtk.Box+BoxChild - this.label2 = new global::Gtk.Label (); + this.label2 = new global::Gtk.Label(); this.label2.Name = "label2"; this.label2.Xalign = 0F; this.label2.LabelProp = "Interfaces selectionnées : "; - this.vbox3.Add (this.label2); - global::Gtk.Box.BoxChild w43 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.label2])); - w43.Position = 0; - w43.Expand = false; - w43.Fill = false; + this.vbox3.Add(this.label2); + global::Gtk.Box.BoxChild w29 = ((global::Gtk.Box.BoxChild)(this.vbox3[this.label2])); + w29.Position = 0; + w29.Expand = false; + w29.Fill = false; // Container child vbox3.Gtk.Box+BoxChild - this.GtkScrolledWindow1 = new global::Gtk.ScrolledWindow (); + this.GtkScrolledWindow1 = new global::Gtk.ScrolledWindow(); this.GtkScrolledWindow1.Name = "GtkScrolledWindow1"; this.GtkScrolledWindow1.ShadowType = ((global::Gtk.ShadowType)(1)); // Container child GtkScrolledWindow1.Gtk.Container+ContainerChild - this.listKnown = new global::Gtk.TreeView (); + this.listKnown = new global::Gtk.TreeView(); this.listKnown.CanFocus = true; this.listKnown.Name = "listKnown"; this.listKnown.HeadersVisible = false; - this.GtkScrolledWindow1.Add (this.listKnown); - this.vbox3.Add (this.GtkScrolledWindow1); - global::Gtk.Box.BoxChild w45 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.GtkScrolledWindow1])); - w45.Position = 1; - this.table1.Add (this.vbox3); - global::Gtk.Table.TableChild w46 = ((global::Gtk.Table.TableChild)(this.table1 [this.vbox3])); - w46.TopAttach = ((uint)(2)); - w46.BottomAttach = ((uint)(3)); - w46.LeftAttach = ((uint)(1)); - w46.RightAttach = ((uint)(2)); - w1.Add (this.table1); - global::Gtk.Box.BoxChild w47 = ((global::Gtk.Box.BoxChild)(w1 [this.table1])); - w47.Position = 0; + this.GtkScrolledWindow1.Add(this.listKnown); + this.vbox3.Add(this.GtkScrolledWindow1); + global::Gtk.Box.BoxChild w31 = ((global::Gtk.Box.BoxChild)(this.vbox3[this.GtkScrolledWindow1])); + w31.Position = 1; + this.table1.Add(this.vbox3); + global::Gtk.Table.TableChild w32 = ((global::Gtk.Table.TableChild)(this.table1[this.vbox3])); + w32.TopAttach = ((uint)(2)); + w32.BottomAttach = ((uint)(3)); + w32.LeftAttach = ((uint)(1)); + w32.RightAttach = ((uint)(2)); + w1.Add(this.table1); + global::Gtk.Box.BoxChild w33 = ((global::Gtk.Box.BoxChild)(w1[this.table1])); + w33.Position = 0; // Internal child DMX2.GestionMidiUI.ActionArea - global::Gtk.HButtonBox w48 = this.ActionArea; - w48.Name = "dialog1_ActionArea"; - w48.Spacing = 10; - w48.BorderWidth = ((uint)(5)); - w48.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); + global::Gtk.HButtonBox w34 = this.ActionArea; + w34.Name = "dialog1_ActionArea"; + w34.Spacing = 10; + w34.BorderWidth = ((uint)(5)); + w34.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild - this.btnClearEvents = new global::Gtk.Button (); + this.btnClearEvents = new global::Gtk.Button(); this.btnClearEvents.CanFocus = true; this.btnClearEvents.Name = "btnClearEvents"; this.btnClearEvents.UseUnderline = true; this.btnClearEvents.Label = "Delier tout les évenements"; - this.AddActionWidget (this.btnClearEvents, 0); - global::Gtk.ButtonBox.ButtonBoxChild w49 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w48 [this.btnClearEvents])); - w49.Expand = false; - w49.Fill = false; + this.AddActionWidget(this.btnClearEvents, 0); + global::Gtk.ButtonBox.ButtonBoxChild w35 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w34[this.btnClearEvents])); + w35.Expand = false; + w35.Fill = false; // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild - this.buttonClose = new global::Gtk.Button (); + this.buttonClose = new global::Gtk.Button(); this.buttonClose.CanDefault = true; this.buttonClose.CanFocus = true; this.buttonClose.Name = "buttonClose"; this.buttonClose.UseStock = true; this.buttonClose.UseUnderline = true; this.buttonClose.Label = "gtk-close"; - this.AddActionWidget (this.buttonClose, -7); - global::Gtk.ButtonBox.ButtonBoxChild w50 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w48 [this.buttonClose])); - w50.Position = 1; - w50.Expand = false; - w50.Fill = false; - if ((this.Child != null)) { - this.Child.ShowAll (); + this.AddActionWidget(this.buttonClose, -7); + global::Gtk.ButtonBox.ButtonBoxChild w36 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w34[this.buttonClose])); + w36.Position = 1; + w36.Expand = false; + w36.Fill = false; + if ((this.Child != null)) + { + this.Child.ShowAll(); } this.DefaultWidth = 838; this.DefaultHeight = 567; - this.Show (); - this.listKnown.CursorChanged += new global::System.EventHandler (this.OnListKnownCursorChanged); - this.listDetect.CursorChanged += new global::System.EventHandler (this.OnListDetectCursorChanged); - this.btnActiv.Clicked += new global::System.EventHandler (this.OnBtnActivClicked); - this.btnDesactiv.Clicked += new global::System.EventHandler (this.OnBtnDesactivClicked); - this.chkFB.Toggled += new global::System.EventHandler (this.OnChkFBToggled); - this.spinUPCh.ValueChanged += new global::System.EventHandler (this.OnSpinUPChValueChanged); - this.spinPageUp.ValueChanged += new global::System.EventHandler (this.OnSpinPageUpValueChanged); - this.spinPageDown.ValueChanged += new global::System.EventHandler (this.OnSpinPageDownValueChanged); - this.spinMax14b.ValueChanged += new global::System.EventHandler (this.OnSpinMax14bValueChanged); - this.chkPg.Toggled += new global::System.EventHandler (this.OnChkPgToggled); - this.chkFourteenBits.Toggled += new global::System.EventHandler (this.OnChkFourteenBitsToggled); - this.btnClearEvents.Clicked += new global::System.EventHandler (this.OnBtnClearEventsClicked); - this.buttonClose.Clicked += new global::System.EventHandler (this.OnButtonCloseClicked); + this.Show(); + this.listKnown.CursorChanged += new global::System.EventHandler(this.OnListKnownCursorChanged); + this.listDetect.CursorChanged += new global::System.EventHandler(this.OnListDetectCursorChanged); + this.btnActiv.Clicked += new global::System.EventHandler(this.OnBtnActivClicked); + this.btnDesactiv.Clicked += new global::System.EventHandler(this.OnBtnDesactivClicked); + this.chkFB.Toggled += new global::System.EventHandler(this.OnChkFBToggled); + this.spinUPCh.ValueChanged += new global::System.EventHandler(this.OnSpinUPChValueChanged); + this.spinPageUp.ValueChanged += new global::System.EventHandler(this.OnSpinPageUpValueChanged); + this.spinPageDown.ValueChanged += new global::System.EventHandler(this.OnSpinPageDownValueChanged); + this.spinMax14b.ValueChanged += new global::System.EventHandler(this.OnSpinMax14bValueChanged); + this.chkPg.Toggled += new global::System.EventHandler(this.OnChkPgToggled); + this.chkFourteenBits.Toggled += new global::System.EventHandler(this.OnChkFourteenBitsToggled); + this.btnClearEvents.Clicked += new global::System.EventHandler(this.OnBtnClearEventsClicked); + this.buttonClose.Clicked += new global::System.EventHandler(this.OnButtonCloseClicked); } } } diff --git a/DMX-2.0/gtk-gui/DMX2.MainWindow.cs b/DMX-2.0/gtk-gui/DMX2.MainWindow.cs index ec1a256..5de3acd 100644 --- a/DMX-2.0/gtk-gui/DMX2.MainWindow.cs +++ b/DMX-2.0/gtk-gui/DMX2.MainWindow.cs @@ -5,325 +5,325 @@ namespace DMX2 public partial class MainWindow { private global::Gtk.UIManager UIManager; - + private global::Gtk.Action openAction; - + private global::Gtk.Action saveAction; - + private global::Gtk.Action saveAsAction; - + private global::Gtk.Action quitAction; - + private global::Gtk.Action closeAction; - + private global::Gtk.Action TestAction; - + private global::Gtk.Action circAction; - + private global::Gtk.Action propertiesAction; - + private global::Gtk.Action FichierAction; - + private global::Gtk.Action newAction; - + private global::Gtk.Action seqLinAction; - + private global::Gtk.Action fullscreenAction; - + private global::Gtk.Action fullscreenAction1; - + private global::Gtk.Action showAllAction; - + private global::Gtk.Action universAction; - + private global::Gtk.Action connectAction; - + private global::Gtk.Action seqMacroAction; - + private global::Gtk.Action selectColorAction; - + private global::Gtk.Action aboutAction; - + private global::Gtk.Action midiAction; - + private global::Gtk.Action connectAction1; - + private global::Gtk.Action selectColorAction1; - + private global::Gtk.Action seqSonAction; - + private global::Gtk.Action selectColorAction2; - + private global::Gtk.Action seqMidiAction; - + private global::Gtk.VBox vbox1; - + private global::Gtk.HBox hbox1; - + private global::Gtk.VBox vbox2; - + private global::Gtk.Button btnGo; - + private global::Gtk.Button btnGoBack; - + private global::Gtk.Button btnAjoutLigne; - + private global::Gtk.Button btnRetireLigne; - + private global::Gtk.ToggleButton btnBlackOut; - + private global::Gtk.ToggleButton btnPause; - + private global::Gtk.EventBox evBBox; - + private global::Gtk.Label timeLabel; - + private global::Gtk.VScale masterScale; - + private global::Gtk.EventBox evBBox1; - + private global::Gtk.VBox vbox3; - + private global::Gtk.Label lblPage; - + private global::Gtk.Label lblpagesmall; - + private global::Gtk.VSeparator vseparator1; - + private global::Gtk.HPaned hpaned1; - + private global::Gtk.HPaned hpaned2; - + private global::Gtk.VBox vbox4; - + private global::Gtk.EventBox evBBox2; - + private global::Gtk.VBox vbox5; - + private global::Gtk.Label labelMasterPos; - + private global::Gtk.Label labelMasterNext; - + private global::Gtk.ScrolledWindow GtkScrolledWindow2; - + private global::Gtk.NodeView MatriceUI; - + private global::Gtk.ScrolledWindow scrolledwindow2; - + private global::Gtk.VBox vboxCircuits; - + private global::Gtk.HSeparator hseparator1; - + private global::Gtk.HBox hbox4; - + private global::Gtk.Toolbar toolbar7; - + private global::Gtk.EventBox evInfo; - + private global::Gtk.Label lblInfo; - + private global::Gtk.Toolbar toolbar8; - protected virtual void Build () + protected virtual void Build() { - global::Stetic.Gui.Initialize (this); + global::Stetic.Gui.Initialize(this); // Widget DMX2.MainWindow - this.UIManager = new global::Gtk.UIManager (); - global::Gtk.ActionGroup w1 = new global::Gtk.ActionGroup ("Default"); - this.openAction = new global::Gtk.Action ("openAction", "_Ouvrir", "Ouvrir", "gtk-open"); + this.UIManager = new global::Gtk.UIManager(); + global::Gtk.ActionGroup w1 = new global::Gtk.ActionGroup("Default"); + this.openAction = new global::Gtk.Action("openAction", "_Ouvrir", "Ouvrir", "gtk-open"); this.openAction.ShortLabel = "_Ouvrir"; - w1.Add (this.openAction, null); - this.saveAction = new global::Gtk.Action ("saveAction", null, "Enregistrer", "gtk-save"); + w1.Add(this.openAction, null); + this.saveAction = new global::Gtk.Action("saveAction", null, "Enregistrer", "gtk-save"); this.saveAction.Sensitive = false; - w1.Add (this.saveAction, null); - this.saveAsAction = new global::Gtk.Action ("saveAsAction", null, "Enregistrer sous ...", "gtk-save-as"); + w1.Add(this.saveAction, null); + this.saveAsAction = new global::Gtk.Action("saveAsAction", null, "Enregistrer sous ...", "gtk-save-as"); this.saveAsAction.Sensitive = false; - w1.Add (this.saveAsAction, null); - this.quitAction = new global::Gtk.Action ("quitAction", null, "Quitter", "gtk-quit"); - w1.Add (this.quitAction, null); - this.closeAction = new global::Gtk.Action ("closeAction", null, "Fermer", "gtk-close"); + w1.Add(this.saveAsAction, null); + this.quitAction = new global::Gtk.Action("quitAction", null, "Quitter", "gtk-quit"); + w1.Add(this.quitAction, null); + this.closeAction = new global::Gtk.Action("closeAction", null, "Fermer", "gtk-close"); this.closeAction.Sensitive = false; - w1.Add (this.closeAction, null); - this.TestAction = new global::Gtk.Action ("TestAction", "Test", null, null); + w1.Add(this.closeAction, null); + this.TestAction = new global::Gtk.Action("TestAction", "Test", null, null); this.TestAction.ShortLabel = "Test"; - w1.Add (this.TestAction, null); - this.circAction = new global::Gtk.Action ("circAction", "Gestion des Circuits", "Gestion des Circuits", "circuits"); + w1.Add(this.TestAction, null); + this.circAction = new global::Gtk.Action("circAction", "Gestion des Circuits", "Gestion des Circuits", "circuits"); this.circAction.Sensitive = false; this.circAction.ShortLabel = "Circuits"; - w1.Add (this.circAction, null); - this.propertiesAction = new global::Gtk.Action ("propertiesAction", "Circuits", null, "gtk-properties"); + w1.Add(this.circAction, null); + this.propertiesAction = new global::Gtk.Action("propertiesAction", "Circuits", null, "gtk-properties"); this.propertiesAction.ShortLabel = "Circuits"; - w1.Add (this.propertiesAction, null); - this.FichierAction = new global::Gtk.Action ("FichierAction", "_Fichier", null, null); + w1.Add(this.propertiesAction, null); + this.FichierAction = new global::Gtk.Action("FichierAction", "_Fichier", null, null); this.FichierAction.ShortLabel = "_Fichier"; - w1.Add (this.FichierAction, null); - this.newAction = new global::Gtk.Action ("newAction", null, "Nouvelle Conduite", "gtk-new"); - w1.Add (this.newAction, null); - this.seqLinAction = new global::Gtk.Action ("seqLinAction", "Ajout Sequenceur", "Ajouter un sequenceur lineraire", "tirettes"); + w1.Add(this.FichierAction, null); + this.newAction = new global::Gtk.Action("newAction", null, "Nouvelle Conduite", "gtk-new"); + w1.Add(this.newAction, null); + this.seqLinAction = new global::Gtk.Action("seqLinAction", "Ajout Sequenceur", "Ajouter un sequenceur lineraire", "tirettes"); this.seqLinAction.Sensitive = false; this.seqLinAction.ShortLabel = "Ajout Sequenceur"; - w1.Add (this.seqLinAction, null); - this.fullscreenAction = new global::Gtk.Action ("fullscreenAction", "_Plein écran", null, "gtk-fullscreen"); + w1.Add(this.seqLinAction, null); + this.fullscreenAction = new global::Gtk.Action("fullscreenAction", "_Plein écran", null, "gtk-fullscreen"); this.fullscreenAction.ShortLabel = "_Plein écran"; - w1.Add (this.fullscreenAction, null); - this.fullscreenAction1 = new global::Gtk.Action ("fullscreenAction1", "_Plein écran", "Plein Ecran", "gtk-fullscreen"); + w1.Add(this.fullscreenAction, null); + this.fullscreenAction1 = new global::Gtk.Action("fullscreenAction1", "_Plein écran", "Plein Ecran", "gtk-fullscreen"); this.fullscreenAction1.ShortLabel = "_Plein écran"; - w1.Add (this.fullscreenAction1, null); - this.showAllAction = new global::Gtk.Action ("showAllAction", "ShowAll", "Tout réafficher", "gtk-refresh"); + w1.Add(this.fullscreenAction1, null); + this.showAllAction = new global::Gtk.Action("showAllAction", "ShowAll", "Tout réafficher", "gtk-refresh"); this.showAllAction.Sensitive = false; this.showAllAction.ShortLabel = "ShowAll"; - w1.Add (this.showAllAction, null); - this.universAction = new global::Gtk.Action ("universAction", "Univers", "Gestion des Univers", "gtk-execute"); + w1.Add(this.showAllAction, null); + this.universAction = new global::Gtk.Action("universAction", "Univers", "Gestion des Univers", "gtk-execute"); this.universAction.Sensitive = false; this.universAction.ShortLabel = "Univers"; - w1.Add (this.universAction, null); - this.connectAction = new global::Gtk.Action ("connectAction", null, "Connecter d\'un boitier", "gtk-connect"); - w1.Add (this.connectAction, null); - this.seqMacroAction = new global::Gtk.Action ("seqMacroAction", null, "Ajouter un sequenceur macro", "gtk-index"); + w1.Add(this.universAction, null); + this.connectAction = new global::Gtk.Action("connectAction", null, "Connecter d\'un boitier", "gtk-connect"); + w1.Add(this.connectAction, null); + this.seqMacroAction = new global::Gtk.Action("seqMacroAction", null, "Ajouter un sequenceur macro", "gtk-index"); this.seqMacroAction.Sensitive = false; - w1.Add (this.seqMacroAction, null); - this.selectColorAction = new global::Gtk.Action ("selectColorAction", null, "Recharger le theme", "gtk-select-color"); - w1.Add (this.selectColorAction, null); - this.aboutAction = new global::Gtk.Action ("aboutAction", null, null, "gtk-about"); - w1.Add (this.aboutAction, null); - this.midiAction = new global::Gtk.Action ("midiAction", null, null, "gtk-preferences"); - w1.Add (this.midiAction, null); - this.connectAction1 = new global::Gtk.Action ("connectAction1", "Connection Midi", null, "gtk-connect"); + w1.Add(this.seqMacroAction, null); + this.selectColorAction = new global::Gtk.Action("selectColorAction", null, "Recharger le theme", "gtk-select-color"); + w1.Add(this.selectColorAction, null); + this.aboutAction = new global::Gtk.Action("aboutAction", null, null, "gtk-about"); + w1.Add(this.aboutAction, null); + this.midiAction = new global::Gtk.Action("midiAction", null, null, "gtk-preferences"); + w1.Add(this.midiAction, null); + this.connectAction1 = new global::Gtk.Action("connectAction1", "Connection Midi", null, "gtk-connect"); this.connectAction1.ShortLabel = "Connection Midi"; - w1.Add (this.connectAction1, null); - this.selectColorAction1 = new global::Gtk.Action ("selectColorAction1", null, null, "gtk-select-color"); - w1.Add (this.selectColorAction1, null); - this.seqSonAction = new global::Gtk.Action ("seqSonAction", null, null, "gtk-cdrom"); + w1.Add(this.connectAction1, null); + this.selectColorAction1 = new global::Gtk.Action("selectColorAction1", null, null, "gtk-select-color"); + w1.Add(this.selectColorAction1, null); + this.seqSonAction = new global::Gtk.Action("seqSonAction", null, null, "gtk-cdrom"); this.seqSonAction.Sensitive = false; - w1.Add (this.seqSonAction, null); - this.selectColorAction2 = new global::Gtk.Action ("selectColorAction2", null, null, "gtk-select-color"); + w1.Add(this.seqSonAction, null); + this.selectColorAction2 = new global::Gtk.Action("selectColorAction2", null, null, "gtk-select-color"); this.selectColorAction2.Visible = false; this.selectColorAction2.VisibleHorizontal = false; this.selectColorAction2.VisibleVertical = false; this.selectColorAction2.VisibleOverflown = false; - w1.Add (this.selectColorAction2, null); - this.seqMidiAction = new global::Gtk.Action ("seqMidiAction", null, null, "MidiSeq"); + w1.Add(this.selectColorAction2, null); + this.seqMidiAction = new global::Gtk.Action("seqMidiAction", null, null, "MidiSeq"); this.seqMidiAction.Sensitive = false; - w1.Add (this.seqMidiAction, null); - this.UIManager.InsertActionGroup (w1, 0); - this.AddAccelGroup (this.UIManager.AccelGroup); + w1.Add(this.seqMidiAction, null); + this.UIManager.InsertActionGroup(w1, 0); + this.AddAccelGroup(this.UIManager.AccelGroup); this.Name = "DMX2.MainWindow"; this.Title = "MainWindow"; this.WindowPosition = ((global::Gtk.WindowPosition)(4)); this.BorderWidth = ((uint)(3)); // Container child DMX2.MainWindow.Gtk.Container+ContainerChild - this.vbox1 = new global::Gtk.VBox (); + this.vbox1 = new global::Gtk.VBox(); this.vbox1.Name = "vbox1"; this.vbox1.Spacing = 6; // Container child vbox1.Gtk.Box+BoxChild - this.hbox1 = new global::Gtk.HBox (); + this.hbox1 = new global::Gtk.HBox(); this.hbox1.Name = "hbox1"; this.hbox1.Spacing = 6; // Container child hbox1.Gtk.Box+BoxChild - this.vbox2 = new global::Gtk.VBox (); + this.vbox2 = new global::Gtk.VBox(); this.vbox2.Name = "vbox2"; this.vbox2.Spacing = 6; // Container child vbox2.Gtk.Box+BoxChild - this.btnGo = new global::Gtk.Button (); + this.btnGo = new global::Gtk.Button(); this.btnGo.CanFocus = true; this.btnGo.Name = "btnGo"; this.btnGo.UseUnderline = true; - global::Gtk.Image w2 = new global::Gtk.Image (); - w2.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-goto-last", global::Gtk.IconSize.Dnd); + global::Gtk.Image w2 = new global::Gtk.Image(); + w2.Pixbuf = global::Stetic.IconLoader.LoadIcon(this, "gtk-goto-last", global::Gtk.IconSize.Dnd); this.btnGo.Image = w2; - this.vbox2.Add (this.btnGo); - global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.btnGo])); + this.vbox2.Add(this.btnGo); + global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.btnGo])); w3.Position = 0; w3.Expand = false; w3.Fill = false; // Container child vbox2.Gtk.Box+BoxChild - this.btnGoBack = new global::Gtk.Button (); + this.btnGoBack = new global::Gtk.Button(); this.btnGoBack.CanFocus = true; this.btnGoBack.Name = "btnGoBack"; this.btnGoBack.UseUnderline = true; - global::Gtk.Image w4 = new global::Gtk.Image (); - w4.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-goto-first", global::Gtk.IconSize.Dnd); + global::Gtk.Image w4 = new global::Gtk.Image(); + w4.Pixbuf = global::Stetic.IconLoader.LoadIcon(this, "gtk-goto-first", global::Gtk.IconSize.Dnd); this.btnGoBack.Image = w4; - this.vbox2.Add (this.btnGoBack); - global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.btnGoBack])); + this.vbox2.Add(this.btnGoBack); + global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.btnGoBack])); w5.Position = 1; w5.Expand = false; w5.Fill = false; // Container child vbox2.Gtk.Box+BoxChild - this.btnAjoutLigne = new global::Gtk.Button (); + this.btnAjoutLigne = new global::Gtk.Button(); this.btnAjoutLigne.TooltipMarkup = "Ajoute ligne sous\ncelle selectionnée"; this.btnAjoutLigne.CanFocus = true; this.btnAjoutLigne.Name = "btnAjoutLigne"; this.btnAjoutLigne.UseUnderline = true; - global::Gtk.Image w6 = new global::Gtk.Image (); - w6.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-add", global::Gtk.IconSize.Dnd); + global::Gtk.Image w6 = new global::Gtk.Image(); + w6.Pixbuf = global::Stetic.IconLoader.LoadIcon(this, "gtk-add", global::Gtk.IconSize.Dnd); this.btnAjoutLigne.Image = w6; - this.vbox2.Add (this.btnAjoutLigne); - global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.btnAjoutLigne])); + this.vbox2.Add(this.btnAjoutLigne); + global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.btnAjoutLigne])); w7.Position = 2; w7.Expand = false; w7.Fill = false; // Container child vbox2.Gtk.Box+BoxChild - this.btnRetireLigne = new global::Gtk.Button (); + this.btnRetireLigne = new global::Gtk.Button(); this.btnRetireLigne.TooltipMarkup = "Retire la ligne selectionnée"; this.btnRetireLigne.CanFocus = true; this.btnRetireLigne.Name = "btnRetireLigne"; this.btnRetireLigne.UseUnderline = true; - global::Gtk.Image w8 = new global::Gtk.Image (); - w8.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-remove", global::Gtk.IconSize.Dnd); + global::Gtk.Image w8 = new global::Gtk.Image(); + w8.Pixbuf = global::Stetic.IconLoader.LoadIcon(this, "gtk-remove", global::Gtk.IconSize.Dnd); this.btnRetireLigne.Image = w8; - this.vbox2.Add (this.btnRetireLigne); - global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.btnRetireLigne])); + this.vbox2.Add(this.btnRetireLigne); + global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.btnRetireLigne])); w9.Position = 3; w9.Expand = false; w9.Fill = false; // Container child vbox2.Gtk.Box+BoxChild - this.btnBlackOut = new global::Gtk.ToggleButton (); + this.btnBlackOut = new global::Gtk.ToggleButton(); this.btnBlackOut.TooltipMarkup = "Blackout"; this.btnBlackOut.CanFocus = true; this.btnBlackOut.Name = "btnBlackOut"; this.btnBlackOut.UseUnderline = true; - global::Gtk.Image w10 = new global::Gtk.Image (); - w10.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-no", global::Gtk.IconSize.Dnd); + global::Gtk.Image w10 = new global::Gtk.Image(); + w10.Pixbuf = global::Stetic.IconLoader.LoadIcon(this, "gtk-no", global::Gtk.IconSize.Dnd); this.btnBlackOut.Image = w10; - this.vbox2.Add (this.btnBlackOut); - global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.btnBlackOut])); + this.vbox2.Add(this.btnBlackOut); + global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.btnBlackOut])); w11.Position = 4; w11.Expand = false; w11.Fill = false; // Container child vbox2.Gtk.Box+BoxChild - this.btnPause = new global::Gtk.ToggleButton (); + this.btnPause = new global::Gtk.ToggleButton(); this.btnPause.TooltipMarkup = "Pause"; this.btnPause.CanFocus = true; this.btnPause.Name = "btnPause"; this.btnPause.UseUnderline = true; - global::Gtk.Image w12 = new global::Gtk.Image (); - w12.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-media-pause", global::Gtk.IconSize.Dnd); + global::Gtk.Image w12 = new global::Gtk.Image(); + w12.Pixbuf = global::Stetic.IconLoader.LoadIcon(this, "gtk-media-pause", global::Gtk.IconSize.Dnd); this.btnPause.Image = w12; - this.vbox2.Add (this.btnPause); - global::Gtk.Box.BoxChild w13 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.btnPause])); + this.vbox2.Add(this.btnPause); + global::Gtk.Box.BoxChild w13 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.btnPause])); w13.Position = 5; w13.Expand = false; w13.Fill = false; // Container child vbox2.Gtk.Box+BoxChild - this.evBBox = new global::Gtk.EventBox (); + this.evBBox = new global::Gtk.EventBox(); this.evBBox.Name = "evBBox"; // Container child evBBox.Gtk.Container+ContainerChild - this.timeLabel = new global::Gtk.Label (); + this.timeLabel = new global::Gtk.Label(); this.timeLabel.Name = "timeLabel"; this.timeLabel.Ypad = 8; this.timeLabel.LabelProp = "0.00"; this.timeLabel.UseMarkup = true; this.timeLabel.Justify = ((global::Gtk.Justification)(2)); this.timeLabel.Angle = 90D; - this.evBBox.Add (this.timeLabel); - this.vbox2.Add (this.evBBox); - global::Gtk.Box.BoxChild w15 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.evBBox])); + this.evBBox.Add(this.timeLabel); + this.vbox2.Add(this.evBBox); + global::Gtk.Box.BoxChild w15 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.evBBox])); w15.Position = 6; w15.Expand = false; w15.Fill = false; // Container child vbox2.Gtk.Box+BoxChild - this.masterScale = new global::Gtk.VScale (null); + this.masterScale = new global::Gtk.VScale(null); this.masterScale.TooltipMarkup = "Master"; this.masterScale.HeightRequest = 75; this.masterScale.Name = "masterScale"; @@ -335,234 +335,235 @@ namespace DMX2 this.masterScale.DrawValue = true; this.masterScale.Digits = 0; this.masterScale.ValuePos = ((global::Gtk.PositionType)(2)); - this.vbox2.Add (this.masterScale); - global::Gtk.Box.BoxChild w16 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.masterScale])); + this.vbox2.Add(this.masterScale); + global::Gtk.Box.BoxChild w16 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.masterScale])); w16.Position = 7; // Container child vbox2.Gtk.Box+BoxChild - this.evBBox1 = new global::Gtk.EventBox (); + this.evBBox1 = new global::Gtk.EventBox(); this.evBBox1.Name = "evBBox1"; // Container child evBBox1.Gtk.Container+ContainerChild - this.vbox3 = new global::Gtk.VBox (); + this.vbox3 = new global::Gtk.VBox(); this.vbox3.Name = "vbox3"; this.vbox3.Spacing = 6; // Container child vbox3.Gtk.Box+BoxChild - this.lblPage = new global::Gtk.Label (); + this.lblPage = new global::Gtk.Label(); this.lblPage.Name = "lblPage"; this.lblPage.LabelProp = "0"; - this.vbox3.Add (this.lblPage); - global::Gtk.Box.BoxChild w17 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.lblPage])); + this.vbox3.Add(this.lblPage); + global::Gtk.Box.BoxChild w17 = ((global::Gtk.Box.BoxChild)(this.vbox3[this.lblPage])); w17.Position = 0; w17.Expand = false; w17.Fill = false; // Container child vbox3.Gtk.Box+BoxChild - this.lblpagesmall = new global::Gtk.Label (); + this.lblpagesmall = new global::Gtk.Label(); this.lblpagesmall.HeightRequest = 28; this.lblpagesmall.Name = "lblpagesmall"; this.lblpagesmall.LabelProp = "midi\npage"; this.lblpagesmall.UseMarkup = true; - this.vbox3.Add (this.lblpagesmall); - global::Gtk.Box.BoxChild w18 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.lblpagesmall])); + this.vbox3.Add(this.lblpagesmall); + global::Gtk.Box.BoxChild w18 = ((global::Gtk.Box.BoxChild)(this.vbox3[this.lblpagesmall])); w18.Position = 1; w18.Fill = false; - this.evBBox1.Add (this.vbox3); - this.vbox2.Add (this.evBBox1); - global::Gtk.Box.BoxChild w20 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.evBBox1])); + this.evBBox1.Add(this.vbox3); + this.vbox2.Add(this.evBBox1); + global::Gtk.Box.BoxChild w20 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.evBBox1])); w20.Position = 8; w20.Expand = false; w20.Fill = false; - this.hbox1.Add (this.vbox2); - global::Gtk.Box.BoxChild w21 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.vbox2])); + this.hbox1.Add(this.vbox2); + global::Gtk.Box.BoxChild w21 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.vbox2])); w21.Position = 0; w21.Expand = false; w21.Fill = false; // Container child hbox1.Gtk.Box+BoxChild - this.vseparator1 = new global::Gtk.VSeparator (); + this.vseparator1 = new global::Gtk.VSeparator(); this.vseparator1.Name = "vseparator1"; - this.hbox1.Add (this.vseparator1); - global::Gtk.Box.BoxChild w22 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.vseparator1])); + this.hbox1.Add(this.vseparator1); + global::Gtk.Box.BoxChild w22 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.vseparator1])); w22.Position = 1; w22.Expand = false; w22.Fill = false; // Container child hbox1.Gtk.Box+BoxChild - this.hpaned1 = new global::Gtk.HPaned (); + this.hpaned1 = new global::Gtk.HPaned(); this.hpaned1.CanFocus = true; this.hpaned1.Name = "hpaned1"; this.hpaned1.Position = 776; // Container child hpaned1.Gtk.Paned+PanedChild - this.hpaned2 = new global::Gtk.HPaned (); + this.hpaned2 = new global::Gtk.HPaned(); this.hpaned2.CanFocus = true; this.hpaned2.Name = "hpaned2"; this.hpaned2.Position = 177; // Container child hpaned2.Gtk.Paned+PanedChild - this.vbox4 = new global::Gtk.VBox (); + this.vbox4 = new global::Gtk.VBox(); this.vbox4.Name = "vbox4"; this.vbox4.Spacing = 6; // Container child vbox4.Gtk.Box+BoxChild - this.evBBox2 = new global::Gtk.EventBox (); + this.evBBox2 = new global::Gtk.EventBox(); this.evBBox2.Name = "evBBox2"; // Container child evBBox2.Gtk.Container+ContainerChild - this.vbox5 = new global::Gtk.VBox (); + this.vbox5 = new global::Gtk.VBox(); this.vbox5.Name = "vbox5"; this.vbox5.Spacing = 6; // Container child vbox5.Gtk.Box+BoxChild - this.labelMasterPos = new global::Gtk.Label (); + this.labelMasterPos = new global::Gtk.Label(); this.labelMasterPos.Name = "labelMasterPos"; this.labelMasterPos.Xpad = 4; this.labelMasterPos.Ypad = 1; this.labelMasterPos.Xalign = 0F; this.labelMasterPos.LabelProp = "\t"; - this.vbox5.Add (this.labelMasterPos); - global::Gtk.Box.BoxChild w23 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.labelMasterPos])); + this.vbox5.Add(this.labelMasterPos); + global::Gtk.Box.BoxChild w23 = ((global::Gtk.Box.BoxChild)(this.vbox5[this.labelMasterPos])); w23.Position = 0; w23.Expand = false; w23.Fill = false; // Container child vbox5.Gtk.Box+BoxChild - this.labelMasterNext = new global::Gtk.Label (); + this.labelMasterNext = new global::Gtk.Label(); this.labelMasterNext.Name = "labelMasterNext"; this.labelMasterNext.Xpad = 20; this.labelMasterNext.Xalign = 0F; this.labelMasterNext.LabelProp = "\t"; - this.vbox5.Add (this.labelMasterNext); - global::Gtk.Box.BoxChild w24 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.labelMasterNext])); + this.vbox5.Add(this.labelMasterNext); + global::Gtk.Box.BoxChild w24 = ((global::Gtk.Box.BoxChild)(this.vbox5[this.labelMasterNext])); w24.Position = 1; w24.Expand = false; w24.Fill = false; - this.evBBox2.Add (this.vbox5); - this.vbox4.Add (this.evBBox2); - global::Gtk.Box.BoxChild w26 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.evBBox2])); + this.evBBox2.Add(this.vbox5); + this.vbox4.Add(this.evBBox2); + global::Gtk.Box.BoxChild w26 = ((global::Gtk.Box.BoxChild)(this.vbox4[this.evBBox2])); w26.Position = 0; w26.Expand = false; w26.Fill = false; // Container child vbox4.Gtk.Box+BoxChild - this.GtkScrolledWindow2 = new global::Gtk.ScrolledWindow (); + this.GtkScrolledWindow2 = new global::Gtk.ScrolledWindow(); this.GtkScrolledWindow2.Name = "GtkScrolledWindow2"; this.GtkScrolledWindow2.ShadowType = ((global::Gtk.ShadowType)(1)); // Container child GtkScrolledWindow2.Gtk.Container+ContainerChild - this.MatriceUI = new global::Gtk.NodeView (); + this.MatriceUI = new global::Gtk.NodeView(); this.MatriceUI.CanFocus = true; this.MatriceUI.Name = "MatriceUI"; this.MatriceUI.RulesHint = true; - this.GtkScrolledWindow2.Add (this.MatriceUI); - this.vbox4.Add (this.GtkScrolledWindow2); - global::Gtk.Box.BoxChild w28 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.GtkScrolledWindow2])); + this.GtkScrolledWindow2.Add(this.MatriceUI); + this.vbox4.Add(this.GtkScrolledWindow2); + global::Gtk.Box.BoxChild w28 = ((global::Gtk.Box.BoxChild)(this.vbox4[this.GtkScrolledWindow2])); w28.Position = 1; - this.hpaned2.Add (this.vbox4); - global::Gtk.Paned.PanedChild w29 = ((global::Gtk.Paned.PanedChild)(this.hpaned2 [this.vbox4])); + this.hpaned2.Add(this.vbox4); + global::Gtk.Paned.PanedChild w29 = ((global::Gtk.Paned.PanedChild)(this.hpaned2[this.vbox4])); w29.Resize = false; - this.hpaned1.Add (this.hpaned2); - global::Gtk.Paned.PanedChild w30 = ((global::Gtk.Paned.PanedChild)(this.hpaned1 [this.hpaned2])); + this.hpaned1.Add(this.hpaned2); + global::Gtk.Paned.PanedChild w30 = ((global::Gtk.Paned.PanedChild)(this.hpaned1[this.hpaned2])); w30.Resize = false; // Container child hpaned1.Gtk.Paned+PanedChild - this.scrolledwindow2 = new global::Gtk.ScrolledWindow (); + this.scrolledwindow2 = new global::Gtk.ScrolledWindow(); this.scrolledwindow2.WidthRequest = 150; this.scrolledwindow2.CanFocus = true; this.scrolledwindow2.Name = "scrolledwindow2"; this.scrolledwindow2.ShadowType = ((global::Gtk.ShadowType)(1)); // Container child scrolledwindow2.Gtk.Container+ContainerChild - global::Gtk.Viewport w31 = new global::Gtk.Viewport (); + global::Gtk.Viewport w31 = new global::Gtk.Viewport(); w31.ShadowType = ((global::Gtk.ShadowType)(0)); // Container child GtkViewport1.Gtk.Container+ContainerChild - this.vboxCircuits = new global::Gtk.VBox (); + this.vboxCircuits = new global::Gtk.VBox(); this.vboxCircuits.Name = "vboxCircuits"; this.vboxCircuits.Spacing = 2; - w31.Add (this.vboxCircuits); - this.scrolledwindow2.Add (w31); - this.hpaned1.Add (this.scrolledwindow2); - global::Gtk.Paned.PanedChild w34 = ((global::Gtk.Paned.PanedChild)(this.hpaned1 [this.scrolledwindow2])); + w31.Add(this.vboxCircuits); + this.scrolledwindow2.Add(w31); + this.hpaned1.Add(this.scrolledwindow2); + global::Gtk.Paned.PanedChild w34 = ((global::Gtk.Paned.PanedChild)(this.hpaned1[this.scrolledwindow2])); w34.Resize = false; w34.Shrink = false; - this.hbox1.Add (this.hpaned1); - global::Gtk.Box.BoxChild w35 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.hpaned1])); + this.hbox1.Add(this.hpaned1); + global::Gtk.Box.BoxChild w35 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.hpaned1])); w35.Position = 2; - this.vbox1.Add (this.hbox1); - global::Gtk.Box.BoxChild w36 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.hbox1])); + this.vbox1.Add(this.hbox1); + global::Gtk.Box.BoxChild w36 = ((global::Gtk.Box.BoxChild)(this.vbox1[this.hbox1])); w36.Position = 0; // Container child vbox1.Gtk.Box+BoxChild - this.hseparator1 = new global::Gtk.HSeparator (); + this.hseparator1 = new global::Gtk.HSeparator(); this.hseparator1.Name = "hseparator1"; - this.vbox1.Add (this.hseparator1); - global::Gtk.Box.BoxChild w37 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.hseparator1])); + this.vbox1.Add(this.hseparator1); + global::Gtk.Box.BoxChild w37 = ((global::Gtk.Box.BoxChild)(this.vbox1[this.hseparator1])); w37.Position = 1; w37.Expand = false; w37.Fill = false; // Container child vbox1.Gtk.Box+BoxChild - this.hbox4 = new global::Gtk.HBox (); + this.hbox4 = new global::Gtk.HBox(); this.hbox4.Name = "hbox4"; this.hbox4.Spacing = 6; // Container child hbox4.Gtk.Box+BoxChild - this.UIManager.AddUiFromString (@""); - this.toolbar7 = ((global::Gtk.Toolbar)(this.UIManager.GetWidget ("/toolbar7"))); + this.UIManager.AddUiFromString(@""); + this.toolbar7 = ((global::Gtk.Toolbar)(this.UIManager.GetWidget("/toolbar7"))); this.toolbar7.Name = "toolbar7"; this.toolbar7.ShowArrow = false; this.toolbar7.ToolbarStyle = ((global::Gtk.ToolbarStyle)(0)); - this.hbox4.Add (this.toolbar7); - global::Gtk.Box.BoxChild w38 = ((global::Gtk.Box.BoxChild)(this.hbox4 [this.toolbar7])); + this.hbox4.Add(this.toolbar7); + global::Gtk.Box.BoxChild w38 = ((global::Gtk.Box.BoxChild)(this.hbox4[this.toolbar7])); w38.Position = 0; w38.Expand = false; w38.Fill = false; // Container child hbox4.Gtk.Box+BoxChild - this.evInfo = new global::Gtk.EventBox (); + this.evInfo = new global::Gtk.EventBox(); this.evInfo.Name = "evInfo"; // Container child evInfo.Gtk.Container+ContainerChild - this.lblInfo = new global::Gtk.Label (); + this.lblInfo = new global::Gtk.Label(); this.lblInfo.Name = "lblInfo"; this.lblInfo.LabelProp = "info"; - this.evInfo.Add (this.lblInfo); - this.hbox4.Add (this.evInfo); - global::Gtk.Box.BoxChild w40 = ((global::Gtk.Box.BoxChild)(this.hbox4 [this.evInfo])); + this.evInfo.Add(this.lblInfo); + this.hbox4.Add(this.evInfo); + global::Gtk.Box.BoxChild w40 = ((global::Gtk.Box.BoxChild)(this.hbox4[this.evInfo])); w40.Position = 1; // Container child hbox4.Gtk.Box+BoxChild - this.UIManager.AddUiFromString (@""); - this.toolbar8 = ((global::Gtk.Toolbar)(this.UIManager.GetWidget ("/toolbar8"))); + this.UIManager.AddUiFromString(@""); + this.toolbar8 = ((global::Gtk.Toolbar)(this.UIManager.GetWidget("/toolbar8"))); this.toolbar8.Name = "toolbar8"; this.toolbar8.ShowArrow = false; this.toolbar8.ToolbarStyle = ((global::Gtk.ToolbarStyle)(0)); - this.hbox4.Add (this.toolbar8); - global::Gtk.Box.BoxChild w41 = ((global::Gtk.Box.BoxChild)(this.hbox4 [this.toolbar8])); + this.hbox4.Add(this.toolbar8); + global::Gtk.Box.BoxChild w41 = ((global::Gtk.Box.BoxChild)(this.hbox4[this.toolbar8])); w41.Position = 2; w41.Expand = false; w41.Fill = false; - this.vbox1.Add (this.hbox4); - global::Gtk.Box.BoxChild w42 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.hbox4])); + this.vbox1.Add(this.hbox4); + global::Gtk.Box.BoxChild w42 = ((global::Gtk.Box.BoxChild)(this.vbox1[this.hbox4])); w42.Position = 2; w42.Expand = false; w42.Fill = false; - this.Add (this.vbox1); - if ((this.Child != null)) { - this.Child.ShowAll (); + this.Add(this.vbox1); + if ((this.Child != null)) + { + this.Child.ShowAll(); } this.DefaultWidth = 1027; this.DefaultHeight = 709; - this.Show (); - this.DeleteEvent += new global::Gtk.DeleteEventHandler (this.OnDeleteEvent); - this.openAction.Activated += new global::System.EventHandler (this.OnOpenActionActivated); - this.saveAction.Activated += new global::System.EventHandler (this.OnSaveActionActivated); - this.saveAsAction.Activated += new global::System.EventHandler (this.OnSaveAsActionActivated); - this.quitAction.Activated += new global::System.EventHandler (this.OnQuitActionActivated); - this.closeAction.Activated += new global::System.EventHandler (this.OnCloseActionActivated); - this.circAction.Activated += new global::System.EventHandler (this.OnCircuitsActionActivated); - this.newAction.Activated += new global::System.EventHandler (this.OnNewActionActivated); - this.seqLinAction.Activated += new global::System.EventHandler (this.OnSeqLinActionActivated); - this.fullscreenAction1.Activated += new global::System.EventHandler (this.OnFullscreenAction1Activated); - this.showAllAction.Activated += new global::System.EventHandler (this.OnShowAllActionActivated); - this.universAction.Activated += new global::System.EventHandler (this.OnUniversActionActivated); - this.connectAction.Activated += new global::System.EventHandler (this.OnConnectActionActivated); - this.seqMacroAction.Activated += new global::System.EventHandler (this.OnSeqMacroActionActivated); - this.selectColorAction.Activated += new global::System.EventHandler (this.OnSelectColorActionActivated); - this.aboutAction.Activated += new global::System.EventHandler (this.OnAboutActionActivated); - this.midiAction.Activated += new global::System.EventHandler (this.OnMidiActionActivated); - this.selectColorAction1.Activated += new global::System.EventHandler (this.OnSelectColorActionActivated); - this.seqSonAction.Activated += new global::System.EventHandler (this.OnSeqSonActionActivated); - this.selectColorAction2.Activated += new global::System.EventHandler (this.OnSelectColorActionActivated); - this.seqMidiAction.Activated += new global::System.EventHandler (this.OnSeqMidiActionActivated); - this.btnGo.Clicked += new global::System.EventHandler (this.OnBtnGoClicked); - this.btnGoBack.Clicked += new global::System.EventHandler (this.OnBtnGoBackClicked); - this.btnAjoutLigne.Clicked += new global::System.EventHandler (this.OnBtnAjoutLigneClicked); - this.btnRetireLigne.Clicked += new global::System.EventHandler (this.OnBtnRetireLigneClicked); - this.btnBlackOut.Toggled += new global::System.EventHandler (this.OnBtnBlackOutToggled); - this.btnPause.Toggled += new global::System.EventHandler (this.OnBtnPauseToggled); - this.masterScale.ValueChanged += new global::System.EventHandler (this.OnMasterScaleValueChanged); - this.MatriceUI.CursorChanged += new global::System.EventHandler (this.OnMatriceUICursorChanged); + this.Show(); + this.DeleteEvent += new global::Gtk.DeleteEventHandler(this.OnDeleteEvent); + this.openAction.Activated += new global::System.EventHandler(this.OnOpenActionActivated); + this.saveAction.Activated += new global::System.EventHandler(this.OnSaveActionActivated); + this.saveAsAction.Activated += new global::System.EventHandler(this.OnSaveAsActionActivated); + this.quitAction.Activated += new global::System.EventHandler(this.OnQuitActionActivated); + this.closeAction.Activated += new global::System.EventHandler(this.OnCloseActionActivated); + this.circAction.Activated += new global::System.EventHandler(this.OnCircuitsActionActivated); + this.newAction.Activated += new global::System.EventHandler(this.OnNewActionActivated); + this.seqLinAction.Activated += new global::System.EventHandler(this.OnSeqLinActionActivated); + this.fullscreenAction1.Activated += new global::System.EventHandler(this.OnFullscreenAction1Activated); + this.showAllAction.Activated += new global::System.EventHandler(this.OnShowAllActionActivated); + this.universAction.Activated += new global::System.EventHandler(this.OnUniversActionActivated); + this.connectAction.Activated += new global::System.EventHandler(this.OnConnectActionActivated); + this.seqMacroAction.Activated += new global::System.EventHandler(this.OnSeqMacroActionActivated); + this.selectColorAction.Activated += new global::System.EventHandler(this.OnSelectColorActionActivated); + this.aboutAction.Activated += new global::System.EventHandler(this.OnAboutActionActivated); + this.midiAction.Activated += new global::System.EventHandler(this.OnMidiActionActivated); + this.selectColorAction1.Activated += new global::System.EventHandler(this.OnSelectColorActionActivated); + this.seqSonAction.Activated += new global::System.EventHandler(this.OnSeqSonActionActivated); + this.selectColorAction2.Activated += new global::System.EventHandler(this.OnSelectColorActionActivated); + this.seqMidiAction.Activated += new global::System.EventHandler(this.OnSeqMidiActionActivated); + this.btnGo.Clicked += new global::System.EventHandler(this.OnBtnGoClicked); + this.btnGoBack.Clicked += new global::System.EventHandler(this.OnBtnGoBackClicked); + this.btnAjoutLigne.Clicked += new global::System.EventHandler(this.OnBtnAjoutLigneClicked); + this.btnRetireLigne.Clicked += new global::System.EventHandler(this.OnBtnRetireLigneClicked); + this.btnBlackOut.Toggled += new global::System.EventHandler(this.OnBtnBlackOutToggled); + this.btnPause.Toggled += new global::System.EventHandler(this.OnBtnPauseToggled); + this.masterScale.ValueChanged += new global::System.EventHandler(this.OnMasterScaleValueChanged); + this.MatriceUI.CursorChanged += new global::System.EventHandler(this.OnMatriceUICursorChanged); } } } diff --git a/DMX-2.0/gtk-gui/DMX2.SelSeqCircuits.cs b/DMX-2.0/gtk-gui/DMX2.SelSeqCircuits.cs index 8799344..36feef9 100644 --- a/DMX-2.0/gtk-gui/DMX2.SelSeqCircuits.cs +++ b/DMX-2.0/gtk-gui/DMX2.SelSeqCircuits.cs @@ -5,23 +5,36 @@ namespace DMX2 public partial class SelSeqCircuits { private global::Gtk.HBox hbox1; + private global::Gtk.ScrolledWindow GtkScrolledWindow; + private global::Gtk.TreeView listeToutCircuits; - private global::Gtk.VButtonBox vbuttonbox1; + + private global::Gtk.VButtonBox vbuttonbox; + private global::Gtk.Button ajtBut; + private global::Gtk.Button supBt; + private global::Gtk.Button supToutBut; + private global::Gtk.Button button90; + private global::Gtk.Button mvHautBt; + private global::Gtk.Button mvBasBt; + private global::Gtk.ScrolledWindow GtkScrolledWindow1; + private global::Gtk.TreeView listeSelCircuits; + private global::Gtk.Button buttonCancel; + private global::Gtk.Button buttonOk; - protected virtual void Build () + protected virtual void Build() { - global::Stetic.Gui.Initialize (this); + global::Stetic.Gui.Initialize(this); // Widget DMX2.SelSeqCircuits this.Name = "DMX2.SelSeqCircuits"; this.Title = "Selection des Circuits"; @@ -35,229 +48,169 @@ namespace DMX2 w1.Name = "dialog1_VBox"; w1.BorderWidth = ((uint)(2)); // Container child dialog1_VBox.Gtk.Box+BoxChild - this.hbox1 = new global::Gtk.HBox (); + this.hbox1 = new global::Gtk.HBox(); this.hbox1.Name = "hbox1"; this.hbox1.Spacing = 6; // Container child hbox1.Gtk.Box+BoxChild - this.GtkScrolledWindow = new global::Gtk.ScrolledWindow (); + this.GtkScrolledWindow = new global::Gtk.ScrolledWindow(); this.GtkScrolledWindow.Name = "GtkScrolledWindow"; this.GtkScrolledWindow.ShadowType = ((global::Gtk.ShadowType)(1)); // Container child GtkScrolledWindow.Gtk.Container+ContainerChild - this.listeToutCircuits = new global::Gtk.TreeView (); + this.listeToutCircuits = new global::Gtk.TreeView(); this.listeToutCircuits.CanFocus = true; this.listeToutCircuits.Name = "listeToutCircuits"; - this.GtkScrolledWindow.Add (this.listeToutCircuits); - this.hbox1.Add (this.GtkScrolledWindow); - global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.GtkScrolledWindow])); + this.GtkScrolledWindow.Add(this.listeToutCircuits); + this.hbox1.Add(this.GtkScrolledWindow); + global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.GtkScrolledWindow])); w3.Position = 0; // Container child hbox1.Gtk.Box+BoxChild - this.vbuttonbox1 = new global::Gtk.VButtonBox (); - this.vbuttonbox1.Name = "vbuttonbox1"; - this.vbuttonbox1.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(3)); - // Container child vbuttonbox1.Gtk.ButtonBox+ButtonBoxChild - this.ajtBut = new global::Gtk.Button (); + this.vbuttonbox = new global::Gtk.VButtonBox(); + this.vbuttonbox.Name = "vbuttonbox"; + this.vbuttonbox.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(3)); + // Container child vbuttonbox.Gtk.ButtonBox+ButtonBoxChild + this.ajtBut = new global::Gtk.Button(); this.ajtBut.CanFocus = true; this.ajtBut.Name = "ajtBut"; this.ajtBut.UseUnderline = true; - // Container child ajtBut.Gtk.Container+ContainerChild - global::Gtk.Alignment w4 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F); - // Container child GtkAlignment.Gtk.Container+ContainerChild - global::Gtk.HBox w5 = new global::Gtk.HBox (); - w5.Spacing = 2; - // Container child GtkHBox.Gtk.Container+ContainerChild - global::Gtk.Image w6 = new global::Gtk.Image (); - w6.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-go-forward", global::Gtk.IconSize.Menu); - w5.Add (w6); - // Container child GtkHBox.Gtk.Container+ContainerChild - global::Gtk.Label w8 = new global::Gtk.Label (); - w8.LabelProp = "Ajouter"; - w8.UseUnderline = true; - w5.Add (w8); - w4.Add (w5); - this.ajtBut.Add (w4); - this.vbuttonbox1.Add (this.ajtBut); - global::Gtk.ButtonBox.ButtonBoxChild w12 = ((global::Gtk.ButtonBox.ButtonBoxChild)(this.vbuttonbox1 [this.ajtBut])); - w12.Expand = false; - w12.Fill = false; - // Container child vbuttonbox1.Gtk.ButtonBox+ButtonBoxChild - this.supBt = new global::Gtk.Button (); + this.ajtBut.Label = "Ajouter"; + global::Gtk.Image w4 = new global::Gtk.Image(); + w4.Pixbuf = global::Stetic.IconLoader.LoadIcon(this, "gtk-go-forward", global::Gtk.IconSize.Menu); + this.ajtBut.Image = w4; + this.vbuttonbox.Add(this.ajtBut); + global::Gtk.ButtonBox.ButtonBoxChild w5 = ((global::Gtk.ButtonBox.ButtonBoxChild)(this.vbuttonbox[this.ajtBut])); + w5.Expand = false; + w5.Fill = false; + // Container child vbuttonbox.Gtk.ButtonBox+ButtonBoxChild + this.supBt = new global::Gtk.Button(); this.supBt.CanFocus = true; this.supBt.Name = "supBt"; this.supBt.UseUnderline = true; - // Container child supBt.Gtk.Container+ContainerChild - global::Gtk.Alignment w13 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F); - // Container child GtkAlignment.Gtk.Container+ContainerChild - global::Gtk.HBox w14 = new global::Gtk.HBox (); - w14.Spacing = 2; - // Container child GtkHBox.Gtk.Container+ContainerChild - global::Gtk.Image w15 = new global::Gtk.Image (); - w15.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-go-back", global::Gtk.IconSize.Menu); - w14.Add (w15); - // Container child GtkHBox.Gtk.Container+ContainerChild - global::Gtk.Label w17 = new global::Gtk.Label (); - w17.LabelProp = "Enlever"; - w17.UseUnderline = true; - w14.Add (w17); - w13.Add (w14); - this.supBt.Add (w13); - this.vbuttonbox1.Add (this.supBt); - global::Gtk.ButtonBox.ButtonBoxChild w21 = ((global::Gtk.ButtonBox.ButtonBoxChild)(this.vbuttonbox1 [this.supBt])); - w21.Position = 1; - w21.Expand = false; - w21.Fill = false; - // Container child vbuttonbox1.Gtk.ButtonBox+ButtonBoxChild - this.supToutBut = new global::Gtk.Button (); + this.supBt.Label = "Enlever"; + global::Gtk.Image w6 = new global::Gtk.Image(); + w6.Pixbuf = global::Stetic.IconLoader.LoadIcon(this, "gtk-go-back", global::Gtk.IconSize.Menu); + this.supBt.Image = w6; + this.vbuttonbox.Add(this.supBt); + global::Gtk.ButtonBox.ButtonBoxChild w7 = ((global::Gtk.ButtonBox.ButtonBoxChild)(this.vbuttonbox[this.supBt])); + w7.Position = 1; + w7.Expand = false; + w7.Fill = false; + // Container child vbuttonbox.Gtk.ButtonBox+ButtonBoxChild + this.supToutBut = new global::Gtk.Button(); this.supToutBut.CanFocus = true; this.supToutBut.Name = "supToutBut"; this.supToutBut.UseUnderline = true; - // Container child supToutBut.Gtk.Container+ContainerChild - global::Gtk.Alignment w22 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F); - // Container child GtkAlignment.Gtk.Container+ContainerChild - global::Gtk.HBox w23 = new global::Gtk.HBox (); - w23.Spacing = 2; - // Container child GtkHBox.Gtk.Container+ContainerChild - global::Gtk.Image w24 = new global::Gtk.Image (); - w24.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-go-back", global::Gtk.IconSize.Menu); - w23.Add (w24); - // Container child GtkHBox.Gtk.Container+ContainerChild - global::Gtk.Label w26 = new global::Gtk.Label (); - w26.LabelProp = "Tout Enlever"; - w26.UseUnderline = true; - w23.Add (w26); - w22.Add (w23); - this.supToutBut.Add (w22); - this.vbuttonbox1.Add (this.supToutBut); - global::Gtk.ButtonBox.ButtonBoxChild w30 = ((global::Gtk.ButtonBox.ButtonBoxChild)(this.vbuttonbox1 [this.supToutBut])); - w30.Position = 2; - w30.Expand = false; - w30.Fill = false; - // Container child vbuttonbox1.Gtk.ButtonBox+ButtonBoxChild - this.button90 = new global::Gtk.Button (); + this.supToutBut.Label = "Tout Enlever"; + global::Gtk.Image w8 = new global::Gtk.Image(); + w8.Pixbuf = global::Stetic.IconLoader.LoadIcon(this, "gtk-go-back", global::Gtk.IconSize.Menu); + this.supToutBut.Image = w8; + this.vbuttonbox.Add(this.supToutBut); + global::Gtk.ButtonBox.ButtonBoxChild w9 = ((global::Gtk.ButtonBox.ButtonBoxChild)(this.vbuttonbox[this.supToutBut])); + w9.Position = 2; + w9.Expand = false; + w9.Fill = false; + // Container child vbuttonbox.Gtk.ButtonBox+ButtonBoxChild + this.button90 = new global::Gtk.Button(); this.button90.Sensitive = false; this.button90.CanFocus = true; this.button90.Name = "button90"; this.button90.UseUnderline = true; this.button90.Relief = ((global::Gtk.ReliefStyle)(2)); - this.button90.Label = ""; - this.vbuttonbox1.Add (this.button90); - global::Gtk.ButtonBox.ButtonBoxChild w31 = ((global::Gtk.ButtonBox.ButtonBoxChild)(this.vbuttonbox1 [this.button90])); - w31.Position = 3; - w31.Expand = false; - w31.Fill = false; - // Container child vbuttonbox1.Gtk.ButtonBox+ButtonBoxChild - this.mvHautBt = new global::Gtk.Button (); + this.vbuttonbox.Add(this.button90); + global::Gtk.ButtonBox.ButtonBoxChild w10 = ((global::Gtk.ButtonBox.ButtonBoxChild)(this.vbuttonbox[this.button90])); + w10.Position = 3; + w10.Expand = false; + w10.Fill = false; + // Container child vbuttonbox.Gtk.ButtonBox+ButtonBoxChild + this.mvHautBt = new global::Gtk.Button(); this.mvHautBt.CanFocus = true; this.mvHautBt.Name = "mvHautBt"; this.mvHautBt.UseUnderline = true; - // Container child mvHautBt.Gtk.Container+ContainerChild - global::Gtk.Alignment w32 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F); - // Container child GtkAlignment.Gtk.Container+ContainerChild - global::Gtk.HBox w33 = new global::Gtk.HBox (); - w33.Spacing = 2; - // Container child GtkHBox.Gtk.Container+ContainerChild - global::Gtk.Image w34 = new global::Gtk.Image (); - w34.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-go-up", global::Gtk.IconSize.Menu); - w33.Add (w34); - // Container child GtkHBox.Gtk.Container+ContainerChild - global::Gtk.Label w36 = new global::Gtk.Label (); - w36.LabelProp = "Monter"; - w36.UseUnderline = true; - w33.Add (w36); - w32.Add (w33); - this.mvHautBt.Add (w32); - this.vbuttonbox1.Add (this.mvHautBt); - global::Gtk.ButtonBox.ButtonBoxChild w40 = ((global::Gtk.ButtonBox.ButtonBoxChild)(this.vbuttonbox1 [this.mvHautBt])); - w40.Position = 4; - w40.Expand = false; - w40.Fill = false; - // Container child vbuttonbox1.Gtk.ButtonBox+ButtonBoxChild - this.mvBasBt = new global::Gtk.Button (); + this.mvHautBt.Label = "Monter"; + global::Gtk.Image w11 = new global::Gtk.Image(); + w11.Pixbuf = global::Stetic.IconLoader.LoadIcon(this, "gtk-go-up", global::Gtk.IconSize.Menu); + this.mvHautBt.Image = w11; + this.vbuttonbox.Add(this.mvHautBt); + global::Gtk.ButtonBox.ButtonBoxChild w12 = ((global::Gtk.ButtonBox.ButtonBoxChild)(this.vbuttonbox[this.mvHautBt])); + w12.Position = 4; + w12.Expand = false; + w12.Fill = false; + // Container child vbuttonbox.Gtk.ButtonBox+ButtonBoxChild + this.mvBasBt = new global::Gtk.Button(); this.mvBasBt.CanFocus = true; this.mvBasBt.Name = "mvBasBt"; this.mvBasBt.UseUnderline = true; - // Container child mvBasBt.Gtk.Container+ContainerChild - global::Gtk.Alignment w41 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F); - // Container child GtkAlignment.Gtk.Container+ContainerChild - global::Gtk.HBox w42 = new global::Gtk.HBox (); - w42.Spacing = 2; - // Container child GtkHBox.Gtk.Container+ContainerChild - global::Gtk.Image w43 = new global::Gtk.Image (); - w43.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-go-down", global::Gtk.IconSize.Menu); - w42.Add (w43); - // Container child GtkHBox.Gtk.Container+ContainerChild - global::Gtk.Label w45 = new global::Gtk.Label (); - w45.LabelProp = "Descendre"; - w45.UseUnderline = true; - w42.Add (w45); - w41.Add (w42); - this.mvBasBt.Add (w41); - this.vbuttonbox1.Add (this.mvBasBt); - global::Gtk.ButtonBox.ButtonBoxChild w49 = ((global::Gtk.ButtonBox.ButtonBoxChild)(this.vbuttonbox1 [this.mvBasBt])); - w49.Position = 5; - w49.Expand = false; - w49.Fill = false; - this.hbox1.Add (this.vbuttonbox1); - global::Gtk.Box.BoxChild w50 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.vbuttonbox1])); - w50.Position = 1; - w50.Expand = false; - w50.Fill = false; + this.mvBasBt.Label = "Descendre"; + global::Gtk.Image w13 = new global::Gtk.Image(); + w13.Pixbuf = global::Stetic.IconLoader.LoadIcon(this, "gtk-go-down", global::Gtk.IconSize.Menu); + this.mvBasBt.Image = w13; + this.vbuttonbox.Add(this.mvBasBt); + global::Gtk.ButtonBox.ButtonBoxChild w14 = ((global::Gtk.ButtonBox.ButtonBoxChild)(this.vbuttonbox[this.mvBasBt])); + w14.Position = 5; + w14.Expand = false; + w14.Fill = false; + this.hbox1.Add(this.vbuttonbox); + global::Gtk.Box.BoxChild w15 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.vbuttonbox])); + w15.Position = 1; + w15.Expand = false; + w15.Fill = false; // Container child hbox1.Gtk.Box+BoxChild - this.GtkScrolledWindow1 = new global::Gtk.ScrolledWindow (); + this.GtkScrolledWindow1 = new global::Gtk.ScrolledWindow(); this.GtkScrolledWindow1.Name = "GtkScrolledWindow1"; this.GtkScrolledWindow1.ShadowType = ((global::Gtk.ShadowType)(1)); // Container child GtkScrolledWindow1.Gtk.Container+ContainerChild - this.listeSelCircuits = new global::Gtk.TreeView (); + this.listeSelCircuits = new global::Gtk.TreeView(); this.listeSelCircuits.CanFocus = true; this.listeSelCircuits.Name = "listeSelCircuits"; - this.GtkScrolledWindow1.Add (this.listeSelCircuits); - this.hbox1.Add (this.GtkScrolledWindow1); - global::Gtk.Box.BoxChild w52 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.GtkScrolledWindow1])); - w52.Position = 2; - w1.Add (this.hbox1); - global::Gtk.Box.BoxChild w53 = ((global::Gtk.Box.BoxChild)(w1 [this.hbox1])); - w53.Position = 0; + this.GtkScrolledWindow1.Add(this.listeSelCircuits); + this.hbox1.Add(this.GtkScrolledWindow1); + global::Gtk.Box.BoxChild w17 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.GtkScrolledWindow1])); + w17.Position = 2; + w1.Add(this.hbox1); + global::Gtk.Box.BoxChild w18 = ((global::Gtk.Box.BoxChild)(w1[this.hbox1])); + w18.Position = 0; // Internal child DMX2.SelSeqCircuits.ActionArea - global::Gtk.HButtonBox w54 = this.ActionArea; - w54.Name = "dialog1_ActionArea"; - w54.Spacing = 10; - w54.BorderWidth = ((uint)(5)); - w54.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); + global::Gtk.HButtonBox w19 = this.ActionArea; + w19.Name = "dialog1_ActionArea"; + w19.Spacing = 10; + w19.BorderWidth = ((uint)(5)); + w19.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4)); // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild - this.buttonCancel = new global::Gtk.Button (); + this.buttonCancel = new global::Gtk.Button(); this.buttonCancel.CanDefault = true; this.buttonCancel.CanFocus = true; this.buttonCancel.Name = "buttonCancel"; this.buttonCancel.UseStock = true; this.buttonCancel.UseUnderline = true; this.buttonCancel.Label = "gtk-cancel"; - this.AddActionWidget (this.buttonCancel, -6); - global::Gtk.ButtonBox.ButtonBoxChild w55 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w54 [this.buttonCancel])); - w55.Expand = false; - w55.Fill = false; + this.AddActionWidget(this.buttonCancel, -6); + global::Gtk.ButtonBox.ButtonBoxChild w20 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w19[this.buttonCancel])); + w20.Expand = false; + w20.Fill = false; // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild - this.buttonOk = new global::Gtk.Button (); + this.buttonOk = new global::Gtk.Button(); this.buttonOk.CanDefault = true; this.buttonOk.CanFocus = true; this.buttonOk.Name = "buttonOk"; this.buttonOk.UseStock = true; this.buttonOk.UseUnderline = true; this.buttonOk.Label = "gtk-ok"; - this.AddActionWidget (this.buttonOk, -5); - global::Gtk.ButtonBox.ButtonBoxChild w56 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w54 [this.buttonOk])); - w56.Position = 1; - w56.Expand = false; - w56.Fill = false; - if ((this.Child != null)) { - this.Child.ShowAll (); + this.AddActionWidget(this.buttonOk, -5); + global::Gtk.ButtonBox.ButtonBoxChild w21 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w19[this.buttonOk])); + w21.Position = 1; + w21.Expand = false; + w21.Fill = false; + if ((this.Child != null)) + { + this.Child.ShowAll(); } this.DefaultWidth = 740; this.DefaultHeight = 587; - this.Hide (); - this.ajtBut.Clicked += new global::System.EventHandler (this.OnAjtButClicked); - this.supBt.Clicked += new global::System.EventHandler (this.OnSupBtClicked); - this.supToutBut.Clicked += new global::System.EventHandler (this.OnSupToutButClicked); - this.mvHautBt.Clicked += new global::System.EventHandler (this.OnMvHautBtClicked); - this.mvBasBt.Clicked += new global::System.EventHandler (this.OnMvBasBtClicked); + this.Hide(); + this.ajtBut.Clicked += new global::System.EventHandler(this.OnAjtButClicked); + this.supBt.Clicked += new global::System.EventHandler(this.OnSupBtClicked); + this.supToutBut.Clicked += new global::System.EventHandler(this.OnSupToutButClicked); + this.mvHautBt.Clicked += new global::System.EventHandler(this.OnMvHautBtClicked); + this.mvBasBt.Clicked += new global::System.EventHandler(this.OnMvBasBtClicked); } } } diff --git a/DMX-2.0/gtk-gui/DMX2.SeqLinUI.cs b/DMX-2.0/gtk-gui/DMX2.SeqLinUI.cs index 7a54214..6c1bbe9 100644 --- a/DMX-2.0/gtk-gui/DMX2.SeqLinUI.cs +++ b/DMX-2.0/gtk-gui/DMX2.SeqLinUI.cs @@ -5,116 +5,149 @@ namespace DMX2 public partial class SeqLinUI { private global::Gtk.UIManager UIManager; + private global::Gtk.Action goBackAction; + private global::Gtk.Action goForwardAction; + private global::Gtk.Action applyAction; + private global::Gtk.Action mediaPauseAction; + private global::Gtk.Action mediaNextAction; + private global::Gtk.Action saveAction; + private global::Gtk.Action saveAfterAction; + private global::Gtk.Action deleteAction; + private global::Gtk.Action moveUpAction; + private global::Gtk.Action moveDownAction; + private global::Gtk.Action circuitsAction; + private global::Gtk.Action closeAction; + private global::Gtk.ToggleAction pourcentBtn; + private global::Gtk.Frame frame1; + private global::Gtk.Alignment GtkAlignment; + private global::Gtk.VBox vbox2; + private global::Gtk.HBox hbox1; + private global::Gtk.VBox vbox4; + private global::Gtk.EventBox evBBox; + private global::Gtk.HBox hbox2; + private global::Gtk.Label posLabel; + private global::Gtk.Label timeLabel; + private global::Gtk.HScale seqMasterScale; + private global::Gtk.ProgressBar pbTrans; + private global::Gtk.ProgressBar pbDuree; + private global::Gtk.Toolbar toolbar1; + private global::Gtk.Toolbar toolbar2; + private global::Gtk.ScrolledWindow GtkScrolledWindow; + private global::Gtk.TreeView effetsListe; + private global::Gtk.Toolbar toolbar3; + private global::Gtk.ScrolledWindow GtkScrolledWindow1; + private global::Gtk.Fixed zoneWid; + private global::Gtk.Label titreLabel; - protected virtual void Build () + protected virtual void Build() { - global::Stetic.Gui.Initialize (this); + global::Stetic.Gui.Initialize(this); // Widget DMX2.SeqLinUI - Stetic.BinContainer w1 = global::Stetic.BinContainer.Attach (this); - this.UIManager = new global::Gtk.UIManager (); - global::Gtk.ActionGroup w2 = new global::Gtk.ActionGroup ("Default"); - this.goBackAction = new global::Gtk.Action ("goBackAction", null, null, "gtk-go-back"); - w2.Add (this.goBackAction, null); - this.goForwardAction = new global::Gtk.Action ("goForwardAction", null, null, "gtk-go-forward"); - w2.Add (this.goForwardAction, null); - this.applyAction = new global::Gtk.Action ("applyAction", null, "Ecrase l'effet selectionné.", "gtk-apply"); - w2.Add (this.applyAction, null); - this.mediaPauseAction = new global::Gtk.Action ("mediaPauseAction", null, "Pause", "gtk-media-pause"); - w2.Add (this.mediaPauseAction, null); - this.mediaNextAction = new global::Gtk.Action ("mediaNextAction", null, "Fin de transition", "gtk-media-next"); - w2.Add (this.mediaNextAction, null); - this.saveAction = new global::Gtk.Action ("saveAction", null, "Enregistre l'effet à la fin.", "gtk-save"); - w2.Add (this.saveAction, null); - this.saveAfterAction = new global::Gtk.Action ("saveAfterAction", null, "Insère un effet sous celui selectionné.", "gtk-save-as"); - w2.Add (this.saveAfterAction, null); - this.deleteAction = new global::Gtk.Action ("deleteAction", null, "Supprime l'effet selectionné.", "gtk-delete"); - w2.Add (this.deleteAction, null); - this.moveUpAction = new global::Gtk.Action ("moveUpAction", null, "", "gtk-go-up"); - w2.Add (this.moveUpAction, null); - this.moveDownAction = new global::Gtk.Action ("moveDownAction", null, null, "gtk-go-down"); - w2.Add (this.moveDownAction, null); - this.circuitsAction = new global::Gtk.Action ("circuitsAction", null, "Association des circuits\nau sequenceur", "circuits"); - w2.Add (this.circuitsAction, null); - this.closeAction = new global::Gtk.Action ("closeAction", null, null, "gtk-close"); - w2.Add (this.closeAction, null); - this.pourcentBtn = new global::Gtk.ToggleAction ("pourcentBtn", null, null, "gtk-zoom-100"); - w2.Add (this.pourcentBtn, null); - this.UIManager.InsertActionGroup (w2, 0); + Stetic.BinContainer w1 = global::Stetic.BinContainer.Attach(this); + this.UIManager = new global::Gtk.UIManager(); + global::Gtk.ActionGroup w2 = new global::Gtk.ActionGroup("Default"); + this.goBackAction = new global::Gtk.Action("goBackAction", null, null, "gtk-go-back"); + w2.Add(this.goBackAction, null); + this.goForwardAction = new global::Gtk.Action("goForwardAction", null, null, "gtk-go-forward"); + w2.Add(this.goForwardAction, null); + this.applyAction = new global::Gtk.Action("applyAction", null, "Ecrase l\'effet selectionné.", "gtk-apply"); + w2.Add(this.applyAction, null); + this.mediaPauseAction = new global::Gtk.Action("mediaPauseAction", null, "Pause", "gtk-media-pause"); + w2.Add(this.mediaPauseAction, null); + this.mediaNextAction = new global::Gtk.Action("mediaNextAction", null, "Fin de transition", "gtk-media-next"); + w2.Add(this.mediaNextAction, null); + this.saveAction = new global::Gtk.Action("saveAction", null, "Enregistre l\'effet à la fin.", "gtk-save"); + w2.Add(this.saveAction, null); + this.saveAfterAction = new global::Gtk.Action("saveAfterAction", null, "Insère un effet sous celui selectionné.", "gtk-save-as"); + w2.Add(this.saveAfterAction, null); + this.deleteAction = new global::Gtk.Action("deleteAction", null, "Supprime l\'effet selectionné.", "gtk-delete"); + w2.Add(this.deleteAction, null); + this.moveUpAction = new global::Gtk.Action("moveUpAction", null, "", "gtk-go-up"); + w2.Add(this.moveUpAction, null); + this.moveDownAction = new global::Gtk.Action("moveDownAction", null, null, "gtk-go-down"); + w2.Add(this.moveDownAction, null); + this.circuitsAction = new global::Gtk.Action("circuitsAction", null, "Association des circuits\nau sequenceur", "circuits"); + w2.Add(this.circuitsAction, null); + this.closeAction = new global::Gtk.Action("closeAction", null, null, "gtk-close"); + w2.Add(this.closeAction, null); + this.pourcentBtn = new global::Gtk.ToggleAction("pourcentBtn", null, null, "gtk-zoom-100"); + w2.Add(this.pourcentBtn, null); + this.UIManager.InsertActionGroup(w2, 0); this.Name = "DMX2.SeqLinUI"; // Container child DMX2.SeqLinUI.Gtk.Container+ContainerChild - this.frame1 = new global::Gtk.Frame (); + 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 = new global::Gtk.Alignment(0F, 0F, 1F, 1F); this.GtkAlignment.Name = "GtkAlignment"; this.GtkAlignment.LeftPadding = ((uint)(12)); // Container child GtkAlignment.Gtk.Container+ContainerChild - this.vbox2 = new global::Gtk.VBox (); + 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 = new global::Gtk.HBox(); this.hbox1.Name = "hbox1"; this.hbox1.Spacing = 6; // Container child hbox1.Gtk.Box+BoxChild - this.vbox4 = new global::Gtk.VBox (); + this.vbox4 = new global::Gtk.VBox(); this.vbox4.Name = "vbox4"; // Container child vbox4.Gtk.Box+BoxChild - this.evBBox = new global::Gtk.EventBox (); + this.evBBox = new global::Gtk.EventBox(); this.evBBox.Name = "evBBox"; // Container child evBBox.Gtk.Container+ContainerChild - this.hbox2 = new global::Gtk.HBox (); + this.hbox2 = new global::Gtk.HBox(); this.hbox2.Name = "hbox2"; this.hbox2.Spacing = 6; // Container child hbox2.Gtk.Box+BoxChild - this.posLabel = new global::Gtk.Label (); + 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])); + 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.timeLabel = new global::Gtk.Label (); + this.timeLabel = new global::Gtk.Label(); this.timeLabel.HeightRequest = 33; this.timeLabel.Name = "timeLabel"; this.timeLabel.Xpad = 15; @@ -122,157 +155,158 @@ namespace DMX2 this.timeLabel.LabelProp = "0.00"; this.timeLabel.UseMarkup = true; this.timeLabel.Justify = ((global::Gtk.Justification)(1)); - this.hbox2.Add (this.timeLabel); - global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.timeLabel])); + this.hbox2.Add(this.timeLabel); + global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.hbox2[this.timeLabel])); w4.PackType = ((global::Gtk.PackType)(1)); w4.Position = 1; w4.Expand = false; w4.Fill = false; - this.evBBox.Add (this.hbox2); - this.vbox4.Add (this.evBBox); - global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.evBBox])); + this.evBBox.Add(this.hbox2); + this.vbox4.Add(this.evBBox); + global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.vbox4[this.evBBox])); w6.Position = 0; w6.Expand = false; w6.Fill = false; // Container child vbox4.Gtk.Box+BoxChild - this.seqMasterScale = new global::Gtk.HScale (null); + this.seqMasterScale = new global::Gtk.HScale(null); this.seqMasterScale.CanFocus = true; this.seqMasterScale.Name = "seqMasterScale"; - this.seqMasterScale.Adjustment.Upper = 100; - this.seqMasterScale.Adjustment.PageIncrement = 10; - this.seqMasterScale.Adjustment.StepIncrement = 1; - this.seqMasterScale.Adjustment.Value = 100; + this.seqMasterScale.Adjustment.Upper = 100D; + this.seqMasterScale.Adjustment.PageIncrement = 10D; + this.seqMasterScale.Adjustment.StepIncrement = 1D; + this.seqMasterScale.Adjustment.Value = 100D; this.seqMasterScale.DrawValue = true; this.seqMasterScale.Digits = 0; this.seqMasterScale.ValuePos = ((global::Gtk.PositionType)(1)); - this.vbox4.Add (this.seqMasterScale); - global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.seqMasterScale])); + this.vbox4.Add(this.seqMasterScale); + global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.vbox4[this.seqMasterScale])); w7.Position = 1; w7.Expand = false; w7.Fill = false; // Container child vbox4.Gtk.Box+BoxChild - this.pbTrans = new global::Gtk.ProgressBar (); + this.pbTrans = new global::Gtk.ProgressBar(); this.pbTrans.HeightRequest = 15; this.pbTrans.Name = "pbTrans"; - this.vbox4.Add (this.pbTrans); - global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.pbTrans])); + this.vbox4.Add(this.pbTrans); + global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.vbox4[this.pbTrans])); w8.Position = 2; w8.Expand = false; w8.Fill = false; // Container child vbox4.Gtk.Box+BoxChild - this.pbDuree = new global::Gtk.ProgressBar (); + this.pbDuree = new global::Gtk.ProgressBar(); this.pbDuree.HeightRequest = 15; this.pbDuree.Name = "pbDuree"; - this.vbox4.Add (this.pbDuree); - global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.pbDuree])); + this.vbox4.Add(this.pbDuree); + global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.vbox4[this.pbDuree])); w9.Position = 3; w9.Expand = false; w9.Fill = false; // Container child vbox4.Gtk.Box+BoxChild - this.UIManager.AddUiFromString (""); - this.toolbar1 = ((global::Gtk.Toolbar)(this.UIManager.GetWidget ("/toolbar1"))); + this.UIManager.AddUiFromString(@""); + this.toolbar1 = ((global::Gtk.Toolbar)(this.UIManager.GetWidget("/toolbar1"))); this.toolbar1.Name = "toolbar1"; this.toolbar1.ShowArrow = false; this.toolbar1.ToolbarStyle = ((global::Gtk.ToolbarStyle)(0)); this.toolbar1.IconSize = ((global::Gtk.IconSize)(2)); - this.vbox4.Add (this.toolbar1); - global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.toolbar1])); + this.vbox4.Add(this.toolbar1); + global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.vbox4[this.toolbar1])); w10.Position = 4; w10.Expand = false; w10.Fill = false; // Container child vbox4.Gtk.Box+BoxChild - this.UIManager.AddUiFromString (""); - this.toolbar2 = ((global::Gtk.Toolbar)(this.UIManager.GetWidget ("/toolbar2"))); + this.UIManager.AddUiFromString(@""); + this.toolbar2 = ((global::Gtk.Toolbar)(this.UIManager.GetWidget("/toolbar2"))); this.toolbar2.Name = "toolbar2"; this.toolbar2.ShowArrow = false; this.toolbar2.ToolbarStyle = ((global::Gtk.ToolbarStyle)(0)); this.toolbar2.IconSize = ((global::Gtk.IconSize)(2)); - this.vbox4.Add (this.toolbar2); - global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.toolbar2])); + this.vbox4.Add(this.toolbar2); + global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.vbox4[this.toolbar2])); w11.Position = 5; w11.Expand = false; w11.Fill = false; - this.hbox1.Add (this.vbox4); - global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.vbox4])); + this.hbox1.Add(this.vbox4); + global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.vbox4])); w12.Position = 0; w12.Expand = false; w12.Fill = false; // Container child hbox1.Gtk.Box+BoxChild - this.GtkScrolledWindow = new global::Gtk.ScrolledWindow (); + this.GtkScrolledWindow = new global::Gtk.ScrolledWindow(); this.GtkScrolledWindow.Name = "GtkScrolledWindow"; this.GtkScrolledWindow.HscrollbarPolicy = ((global::Gtk.PolicyType)(2)); this.GtkScrolledWindow.ShadowType = ((global::Gtk.ShadowType)(1)); // Container child GtkScrolledWindow.Gtk.Container+ContainerChild - this.effetsListe = new global::Gtk.TreeView (); + this.effetsListe = new global::Gtk.TreeView(); this.effetsListe.CanFocus = true; this.effetsListe.Name = "effetsListe"; this.effetsListe.RulesHint = true; - this.GtkScrolledWindow.Add (this.effetsListe); - this.hbox1.Add (this.GtkScrolledWindow); - global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.GtkScrolledWindow])); + this.GtkScrolledWindow.Add(this.effetsListe); + this.hbox1.Add(this.GtkScrolledWindow); + global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.GtkScrolledWindow])); w14.Position = 1; // Container child hbox1.Gtk.Box+BoxChild - this.UIManager.AddUiFromString (""); - this.toolbar3 = ((global::Gtk.Toolbar)(this.UIManager.GetWidget ("/toolbar3"))); + this.UIManager.AddUiFromString(@""); + this.toolbar3 = ((global::Gtk.Toolbar)(this.UIManager.GetWidget("/toolbar3"))); this.toolbar3.Name = "toolbar3"; this.toolbar3.Orientation = ((global::Gtk.Orientation)(1)); this.toolbar3.ShowArrow = false; this.toolbar3.ToolbarStyle = ((global::Gtk.ToolbarStyle)(0)); this.toolbar3.IconSize = ((global::Gtk.IconSize)(2)); - this.hbox1.Add (this.toolbar3); - global::Gtk.Box.BoxChild w15 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.toolbar3])); + this.hbox1.Add(this.toolbar3); + global::Gtk.Box.BoxChild w15 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.toolbar3])); w15.Position = 2; w15.Expand = false; w15.Fill = false; - this.vbox2.Add (this.hbox1); - global::Gtk.Box.BoxChild w16 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.hbox1])); + this.vbox2.Add(this.hbox1); + global::Gtk.Box.BoxChild w16 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.hbox1])); w16.Position = 0; w16.Expand = false; w16.Fill = false; // Container child vbox2.Gtk.Box+BoxChild - this.GtkScrolledWindow1 = new global::Gtk.ScrolledWindow (); + this.GtkScrolledWindow1 = new global::Gtk.ScrolledWindow(); this.GtkScrolledWindow1.Name = "GtkScrolledWindow1"; // Container child GtkScrolledWindow1.Gtk.Container+ContainerChild - global::Gtk.Viewport w17 = new global::Gtk.Viewport (); + global::Gtk.Viewport w17 = new global::Gtk.Viewport(); w17.ShadowType = ((global::Gtk.ShadowType)(0)); // Container child GtkViewport.Gtk.Container+ContainerChild - this.zoneWid = new global::Gtk.Fixed (); + this.zoneWid = new global::Gtk.Fixed(); this.zoneWid.HeightRequest = 0; this.zoneWid.Name = "zoneWid"; this.zoneWid.HasWindow = false; - w17.Add (this.zoneWid); - this.GtkScrolledWindow1.Add (w17); - this.vbox2.Add (this.GtkScrolledWindow1); - global::Gtk.Box.BoxChild w20 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.GtkScrolledWindow1])); + w17.Add(this.zoneWid); + this.GtkScrolledWindow1.Add(w17); + this.vbox2.Add(this.GtkScrolledWindow1); + global::Gtk.Box.BoxChild w20 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.GtkScrolledWindow1])); w20.Position = 1; - this.GtkAlignment.Add (this.vbox2); - this.frame1.Add (this.GtkAlignment); - this.titreLabel = new global::Gtk.Label (); + this.GtkAlignment.Add(this.vbox2); + this.frame1.Add(this.GtkAlignment); + this.titreLabel = new global::Gtk.Label(); this.titreLabel.Name = "titreLabel"; this.titreLabel.LabelProp = "Sequenceur Lineaire"; this.titreLabel.UseMarkup = true; this.frame1.LabelWidget = this.titreLabel; - this.Add (this.frame1); - if ((this.Child != null)) { - this.Child.ShowAll (); + this.Add(this.frame1); + if ((this.Child != null)) + { + this.Child.ShowAll(); } - w1.SetUiManager (UIManager); - this.Show (); - this.goBackAction.Activated += new global::System.EventHandler (this.OnGoBackActionActivated); - this.goForwardAction.Activated += new global::System.EventHandler (this.OnGoForwardActionActivated); - this.applyAction.Activated += new global::System.EventHandler (this.OnApplyActionActivated); - this.mediaPauseAction.Activated += new global::System.EventHandler (this.OnMediaPauseActionActivated); - this.mediaNextAction.Activated += new global::System.EventHandler (this.OnMediaNextActionActivated); - this.saveAction.Activated += new global::System.EventHandler (this.OnSaveActionActivated); - this.saveAfterAction.Activated += new global::System.EventHandler (this.OnSaveAfterActionActivated); - this.deleteAction.Activated += new global::System.EventHandler (this.OnDeleteActionActivated); - this.moveUpAction.Activated += new global::System.EventHandler (this.OnMoveUpActionActivated); - this.moveDownAction.Activated += new global::System.EventHandler (this.OnMoveDownActionActivated); - this.circuitsAction.Activated += new global::System.EventHandler (this.OnCircuitsActionActivated); - this.closeAction.Activated += new global::System.EventHandler (this.OnCloseActionActivated); - this.pourcentBtn.Toggled += new global::System.EventHandler (this.OnPourcentBtnToggled); - this.seqMasterScale.ValueChanged += new global::System.EventHandler (this.OnSeqMasterScaleValueChanged); - this.zoneWid.SizeAllocated += new global::Gtk.SizeAllocatedHandler (this.OnZoneWidSizeAllocated); + w1.SetUiManager(UIManager); + this.Show(); + this.goBackAction.Activated += new global::System.EventHandler(this.OnGoBackActionActivated); + this.goForwardAction.Activated += new global::System.EventHandler(this.OnGoForwardActionActivated); + this.applyAction.Activated += new global::System.EventHandler(this.OnApplyActionActivated); + this.mediaPauseAction.Activated += new global::System.EventHandler(this.OnMediaPauseActionActivated); + this.mediaNextAction.Activated += new global::System.EventHandler(this.OnMediaNextActionActivated); + this.saveAction.Activated += new global::System.EventHandler(this.OnSaveActionActivated); + this.saveAfterAction.Activated += new global::System.EventHandler(this.OnSaveAfterActionActivated); + this.deleteAction.Activated += new global::System.EventHandler(this.OnDeleteActionActivated); + this.moveUpAction.Activated += new global::System.EventHandler(this.OnMoveUpActionActivated); + this.moveDownAction.Activated += new global::System.EventHandler(this.OnMoveDownActionActivated); + this.circuitsAction.Activated += new global::System.EventHandler(this.OnCircuitsActionActivated); + this.closeAction.Activated += new global::System.EventHandler(this.OnCloseActionActivated); + this.pourcentBtn.Toggled += new global::System.EventHandler(this.OnPourcentBtnToggled); + this.seqMasterScale.ValueChanged += new global::System.EventHandler(this.OnSeqMasterScaleValueChanged); + this.zoneWid.SizeAllocated += new global::Gtk.SizeAllocatedHandler(this.OnZoneWidSizeAllocated); } } } diff --git a/DMX-2.0/gtk-gui/DMX2.SeqMacroUI.cs b/DMX-2.0/gtk-gui/DMX2.SeqMacroUI.cs index eaf944d..2aa7453 100644 --- a/DMX-2.0/gtk-gui/DMX2.SeqMacroUI.cs +++ b/DMX-2.0/gtk-gui/DMX2.SeqMacroUI.cs @@ -5,162 +5,162 @@ namespace DMX2 public partial class SeqMacroUI { 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.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.HScale seqMasterScale; - + private global::Gtk.HBox hbox3; - + private global::Gtk.Entry txtCommand; - + private global::Gtk.Button btnCommand; - + private global::Gtk.Toolbar toolbar; - + private global::Gtk.Toolbar toolbar1; - + private global::Gtk.ScrolledWindow scrolledwindow1; - + private global::Gtk.TreeView effetsListe; - + private global::Gtk.Label titreLabel; - protected virtual void Build () + protected virtual void Build() { - global::Stetic.Gui.Initialize (this); + global::Stetic.Gui.Initialize(this); // Widget DMX2.SeqMacroUI - 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"); + 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.UIManager.InsertActionGroup (w2, 0); + 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.UIManager.InsertActionGroup(w2, 0); this.Name = "DMX2.SeqMacroUI"; // Container child DMX2.SeqMacroUI.Gtk.Container+ContainerChild - this.frame1 = new global::Gtk.Frame (); + 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 = 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 = 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 = 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 = 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 = new global::Gtk.VBox(); this.vbox3.Name = "vbox3"; // Container child vbox3.Gtk.Box+BoxChild - this.evBBox = new global::Gtk.EventBox (); + this.evBBox = new global::Gtk.EventBox(); this.evBBox.Name = "evBBox"; // Container child evBBox.Gtk.Container+ContainerChild - this.hbox2 = new global::Gtk.HBox (); + 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 = 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])); + 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 = 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])); + 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 = 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])); + 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])); + 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.seqMasterScale = new global::Gtk.HScale (null); + this.seqMasterScale = new global::Gtk.HScale(null); this.seqMasterScale.CanFocus = true; this.seqMasterScale.Name = "seqMasterScale"; this.seqMasterScale.Adjustment.Upper = 100D; @@ -170,117 +170,118 @@ namespace DMX2 this.seqMasterScale.DrawValue = true; this.seqMasterScale.Digits = 0; this.seqMasterScale.ValuePos = ((global::Gtk.PositionType)(1)); - this.vbox3.Add (this.seqMasterScale); - global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.seqMasterScale])); + this.vbox3.Add(this.seqMasterScale); + global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.vbox3[this.seqMasterScale])); w8.Position = 1; w8.Expand = false; w8.Fill = false; // Container child vbox3.Gtk.Box+BoxChild - this.hbox3 = new global::Gtk.HBox (); + this.hbox3 = new global::Gtk.HBox(); this.hbox3.Name = "hbox3"; this.hbox3.Spacing = 6; // Container child hbox3.Gtk.Box+BoxChild - this.txtCommand = new global::Gtk.Entry (); + this.txtCommand = new global::Gtk.Entry(); this.txtCommand.CanFocus = true; this.txtCommand.Name = "txtCommand"; this.txtCommand.IsEditable = true; this.txtCommand.InvisibleChar = '●'; - this.hbox3.Add (this.txtCommand); - global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.txtCommand])); + this.hbox3.Add(this.txtCommand); + global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.hbox3[this.txtCommand])); w9.Position = 0; // Container child hbox3.Gtk.Box+BoxChild - this.btnCommand = new global::Gtk.Button (); + this.btnCommand = new global::Gtk.Button(); this.btnCommand.CanFocus = true; this.btnCommand.Name = "btnCommand"; this.btnCommand.UseUnderline = true; this.btnCommand.Label = "Ok"; - global::Gtk.Image w10 = new global::Gtk.Image (); - w10.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-ok", global::Gtk.IconSize.Menu); + global::Gtk.Image w10 = new global::Gtk.Image(); + w10.Pixbuf = global::Stetic.IconLoader.LoadIcon(this, "gtk-ok", global::Gtk.IconSize.Menu); this.btnCommand.Image = w10; - this.hbox3.Add (this.btnCommand); - global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.btnCommand])); + this.hbox3.Add(this.btnCommand); + global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.hbox3[this.btnCommand])); w11.Position = 1; w11.Expand = false; w11.Fill = false; - this.vbox3.Add (this.hbox3); - global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.hbox3])); + this.vbox3.Add(this.hbox3); + global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.vbox3[this.hbox3])); w12.Position = 2; w12.Expand = false; w12.Fill = false; // Container child vbox3.Gtk.Box+BoxChild - this.UIManager.AddUiFromString (@""); - this.toolbar = ((global::Gtk.Toolbar)(this.UIManager.GetWidget ("/toolbar"))); + 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 w13 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.toolbar])); + this.vbox3.Add(this.toolbar); + global::Gtk.Box.BoxChild w13 = ((global::Gtk.Box.BoxChild)(this.vbox3[this.toolbar])); w13.Position = 3; w13.Expand = false; w13.Fill = false; - this.hbox1.Add (this.vbox3); - global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.vbox3])); + this.hbox1.Add(this.vbox3); + global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.vbox3])); w14.Position = 0; // Container child hbox1.Gtk.Box+BoxChild - this.UIManager.AddUiFromString ("<" + - "toolitem name=\'circuitsAction\' action=\'circuitsAction\'/>"); - this.toolbar1 = ((global::Gtk.Toolbar)(this.UIManager.GetWidget ("/toolbar1"))); + this.UIManager.AddUiFromString("<" + + "toolitem name=\'circuitsAction\' action=\'circuitsAction\'/>"); + 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 w15 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.toolbar1])); + this.hbox1.Add(this.toolbar1); + global::Gtk.Box.BoxChild w15 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.toolbar1])); w15.PackType = ((global::Gtk.PackType)(1)); w15.Position = 1; w15.Expand = false; w15.Fill = false; - this.vbox2.Add (this.hbox1); - global::Gtk.Box.BoxChild w16 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.hbox1])); + this.vbox2.Add(this.hbox1); + global::Gtk.Box.BoxChild w16 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.hbox1])); w16.Position = 0; w16.Expand = false; w16.Fill = false; // Container child vbox2.Gtk.Box+BoxChild - this.scrolledwindow1 = new global::Gtk.ScrolledWindow (); + 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.effetsListe = new global::Gtk.TreeView (); + this.effetsListe = new global::Gtk.TreeView(); this.effetsListe.CanFocus = true; this.effetsListe.Name = "effetsListe"; this.effetsListe.RulesHint = true; - this.scrolledwindow1.Add (this.effetsListe); - this.vbox2.Add (this.scrolledwindow1); - global::Gtk.Box.BoxChild w18 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.scrolledwindow1])); + this.scrolledwindow1.Add(this.effetsListe); + this.vbox2.Add(this.scrolledwindow1); + global::Gtk.Box.BoxChild w18 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.scrolledwindow1])); w18.Position = 1; - this.alignment1.Add (this.vbox2); - this.GtkAlignment.Add (this.alignment1); - this.frame1.Add (this.GtkAlignment); - this.titreLabel = new global::Gtk.Label (); + 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 Macro"; this.titreLabel.UseMarkup = true; this.frame1.LabelWidget = this.titreLabel; - this.Add (this.frame1); - if ((this.Child != null)) { - this.Child.ShowAll (); + 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.circuitsAction.Activated += new global::System.EventHandler (this.OnCircuitsActionActivated); - 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.seqMasterScale.ValueChanged += new global::System.EventHandler (this.OnSeqMasterScaleValueChanged); - this.btnCommand.Clicked += new global::System.EventHandler (this.OnBtnCommandClicked); - this.effetsListe.CursorChanged += new global::System.EventHandler (this.OnEffetsListeCursorChanged); + w1.SetUiManager(UIManager); + this.Hide(); + this.closeAction.Activated += new global::System.EventHandler(this.OnCloseActionActivated); + this.circuitsAction.Activated += new global::System.EventHandler(this.OnCircuitsActionActivated); + 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.seqMasterScale.ValueChanged += new global::System.EventHandler(this.OnSeqMasterScaleValueChanged); + this.btnCommand.Clicked += new global::System.EventHandler(this.OnBtnCommandClicked); + this.effetsListe.CursorChanged += new global::System.EventHandler(this.OnEffetsListeCursorChanged); } } } diff --git a/DMX-2.0/gtk-gui/DMX2.SeqMidiUI.cs b/DMX-2.0/gtk-gui/DMX2.SeqMidiUI.cs index a1f872f..dd8be9c 100644 --- a/DMX-2.0/gtk-gui/DMX2.SeqMidiUI.cs +++ b/DMX-2.0/gtk-gui/DMX2.SeqMidiUI.cs @@ -5,237 +5,238 @@ namespace DMX2 public partial class SeqMidiUI { private global::Gtk.UIManager UIManager; - + private global::Gtk.ToggleAction closeAction; - + 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 lblText; - + private global::Gtk.Label titreLabel; - protected virtual void Build () + protected virtual void Build() { - global::Stetic.Gui.Initialize (this); + global::Stetic.Gui.Initialize(this); // Widget DMX2.SeqMidiUI - 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"); + 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.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); + w2.Add(this.closeAction, 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.SeqMidiUI"; // Container child DMX2.SeqMidiUI.Gtk.Container+ContainerChild - this.frame1 = new global::Gtk.Frame (); + 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 = 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 = 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 = 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 = 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 = new global::Gtk.VBox(); this.vbox3.Name = "vbox3"; // Container child vbox3.Gtk.Box+BoxChild - this.evBBox = new global::Gtk.EventBox (); + this.evBBox = new global::Gtk.EventBox(); this.evBBox.Name = "evBBox"; // Container child evBBox.Gtk.Container+ContainerChild - this.hbox2 = new global::Gtk.HBox (); + 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 = 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])); + 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 = 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])); + 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 = 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])); + 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])); + 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.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])); + 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])); + 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.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])); + 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])); + 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 = 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 = 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])); + 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; // Container child vbox2.Gtk.Box+BoxChild - this.lblText = new global::Gtk.Label (); + this.lblText = new global::Gtk.Label(); this.lblText.Name = "lblText"; this.lblText.Xalign = 0F; this.lblText.LabelProp = "CC : Control Change (ex: CC12,100)\nPC : Program Change (ex: PC5)\nN : Note On/Off " + - "(ex: N64+127 ou N12-)\nGT : Go To (ex: GT4)\nr: loop"; + "(ex: N64+127 ou N12-)\nGT : Go To (ex: GT4)\nr: loop"; this.lblText.UseMarkup = true; - this.vbox2.Add (this.lblText); - global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.lblText])); + this.vbox2.Add(this.lblText); + global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.lblText])); w14.Position = 2; w14.Expand = false; w14.Fill = false; - this.alignment1.Add (this.vbox2); - this.GtkAlignment.Add (this.alignment1); - this.frame1.Add (this.GtkAlignment); - this.titreLabel = new global::Gtk.Label (); + 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 (); + 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); + 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/gtk-gui/DMX2.SeqOscUI.cs b/DMX-2.0/gtk-gui/DMX2.SeqOscUI.cs index 25e1149..0026e3c 100644 --- a/DMX-2.0/gtk-gui/DMX2.SeqOscUI.cs +++ b/DMX-2.0/gtk-gui/DMX2.SeqOscUI.cs @@ -5,227 +5,248 @@ 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.HBox hbox3; + private global::Gtk.Toolbar toolbar; - + + private global::Gtk.Entry entryDest; + private global::Gtk.Toolbar toolbar1; - + private global::Gtk.ScrolledWindow scrolledwindow1; - + private global::Gtk.TreeView cmdList; - + private global::Gtk.Label titreLabel; - protected virtual void Build () + protected virtual void Build() { - global::Stetic.Gui.Initialize (this); + 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"); + 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); + w2.Add(this.closeAction, 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 = 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 = 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 = 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 = 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 = 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 = new global::Gtk.VBox(); this.vbox3.Name = "vbox3"; // Container child vbox3.Gtk.Box+BoxChild - this.evBBox = new global::Gtk.EventBox (); + this.evBBox = new global::Gtk.EventBox(); this.evBBox.Name = "evBBox"; // Container child evBBox.Gtk.Container+ContainerChild - this.hbox2 = new global::Gtk.HBox (); + 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 = 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])); + 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 = 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])); + 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 = 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])); + 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])); + 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.hbox3 = new global::Gtk.HBox(); + this.hbox3.Name = "hbox3"; + this.hbox3.Spacing = 6; + // Container child hbox3.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; + this.hbox3.Add(this.toolbar); + global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.hbox3[this.toolbar])); + w8.Position = 0; + // Container child hbox3.Gtk.Box+BoxChild + this.entryDest = new global::Gtk.Entry(); + this.entryDest.WidthRequest = 220; + this.entryDest.CanFocus = true; + this.entryDest.Name = "entryDest"; + this.entryDest.IsEditable = true; + this.entryDest.InvisibleChar = '●'; + this.hbox3.Add(this.entryDest); + global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.hbox3[this.entryDest])); + w9.Position = 2; + w9.Expand = false; + w9.Fill = false; + this.vbox3.Add(this.hbox3); + global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.vbox3[this.hbox3])); + w10.Position = 1; + w10.Expand = false; + w10.Fill = false; + this.hbox1.Add(this.vbox3); + global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.vbox3])); + w11.Position = 0; // Container child hbox1.Gtk.Box+BoxChild - this.UIManager.AddUiFromString ("<" + - "/toolbar>"); - this.toolbar1 = ((global::Gtk.Toolbar)(this.UIManager.GetWidget ("/toolbar1"))); + 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; + this.hbox1.Add(this.toolbar1); + global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.toolbar1])); + w12.PackType = ((global::Gtk.PackType)(1)); + w12.Position = 1; + w12.Expand = false; + w12.Fill = false; + this.vbox2.Add(this.hbox1); + global::Gtk.Box.BoxChild w13 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.hbox1])); + w13.Position = 0; + w13.Expand = false; + w13.Fill = false; // Container child vbox2.Gtk.Box+BoxChild - this.scrolledwindow1 = new global::Gtk.ScrolledWindow (); + 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 = 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.scrolledwindow1.Add(this.cmdList); + this.vbox2.Add(this.scrolledwindow1); + global::Gtk.Box.BoxChild w15 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.scrolledwindow1])); + w15.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.LabelProp = "Séquenceur OSC"; this.titreLabel.UseMarkup = true; this.frame1.LabelWidget = this.titreLabel; - this.Add (this.frame1); - if ((this.Child != null)) { - this.Child.ShowAll (); + 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); + 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.entryDest.Changed += new global::System.EventHandler(this.OnEntryDestChanged); + this.cmdList.CursorChanged += new global::System.EventHandler(this.OnCmdListeCursorChanged); } } } diff --git a/DMX-2.0/gtk-gui/DMX2.SeqSonUI.cs b/DMX-2.0/gtk-gui/DMX2.SeqSonUI.cs index 3ab3843..cc9f342 100644 --- a/DMX-2.0/gtk-gui/DMX2.SeqSonUI.cs +++ b/DMX-2.0/gtk-gui/DMX2.SeqSonUI.cs @@ -5,447 +5,414 @@ namespace DMX2 public partial class SeqSonUI { private global::Gtk.UIManager UIManager; + private global::Gtk.Action closeAction; + private global::Gtk.Action mediaPlayAction; + private global::Gtk.Action mediaPauseAction; + private global::Gtk.Action mediaStopAction; + private global::Gtk.Action mediaPreviousAction; + private global::Gtk.Action mediaRewindAction; + private global::Gtk.Action mediaForwardAction; + private global::Gtk.Action mediaNextAction; + private global::Gtk.Action actAddFile; + private global::Gtk.Action actDelFile; + private global::Gtk.Action preferencesAction; + private global::Gtk.Action closeAction1; + private global::Gtk.Action preferencesAction1; + private global::Gtk.Frame frame1; + private global::Gtk.Alignment GtkAlignment; + 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 titleLabel; + private global::Gtk.Label timeLabel; + private global::Gtk.ProgressBar pbCur; + private global::Gtk.HBox hbox3; + private global::Gtk.Button btnPlay; + private global::Gtk.Button btnPause; + private global::Gtk.Button btnStop; + private global::Gtk.Button btnPrev; + private global::Gtk.Button btnRewind; + private global::Gtk.Button btnForward; + private global::Gtk.Button btnNext; + private global::Gtk.Entry txtGoto; + private global::Gtk.Button btnGoto; + private global::Gtk.VScale sclVolume; + private global::Gtk.Toolbar toolbar4; + private global::Gtk.ScrolledWindow GtkScrolledWindow; + private global::Gtk.NodeView listFiles; + private global::Gtk.Label label1; + private global::Gtk.Label titreLabel; - protected virtual void Build () + protected virtual void Build() { - global::Stetic.Gui.Initialize (this); + global::Stetic.Gui.Initialize(this); // Widget DMX2.SeqSonUI - 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.Action ("closeAction", null, null, "gtk-close"); - w2.Add (this.closeAction, null); - this.mediaPlayAction = new global::Gtk.Action ("mediaPlayAction", null, null, "gtk-media-play"); - w2.Add (this.mediaPlayAction, null); - this.mediaPauseAction = new global::Gtk.Action ("mediaPauseAction", null, null, "gtk-media-pause"); - w2.Add (this.mediaPauseAction, null); - this.mediaStopAction = new global::Gtk.Action ("mediaStopAction", null, null, "gtk-media-stop"); - w2.Add (this.mediaStopAction, null); - this.mediaPreviousAction = new global::Gtk.Action ("mediaPreviousAction", null, null, "gtk-media-previous"); - w2.Add (this.mediaPreviousAction, null); - this.mediaRewindAction = new global::Gtk.Action ("mediaRewindAction", null, null, "gtk-media-rewind"); - w2.Add (this.mediaRewindAction, null); - this.mediaForwardAction = new global::Gtk.Action ("mediaForwardAction", null, null, "gtk-media-forward"); - w2.Add (this.mediaForwardAction, null); - this.mediaNextAction = new global::Gtk.Action ("mediaNextAction", null, null, "gtk-media-next"); - w2.Add (this.mediaNextAction, null); - this.actAddFile = new global::Gtk.Action ("actAddFile", null, null, "gtk-add"); - w2.Add (this.actAddFile, null); - this.actDelFile = new global::Gtk.Action ("actDelFile", null, null, "gtk-remove"); - w2.Add (this.actDelFile, null); - this.preferencesAction = new global::Gtk.Action ("preferencesAction", null, null, "gtk-preferences"); - w2.Add (this.preferencesAction, null); - this.closeAction1 = new global::Gtk.Action ("closeAction1", null, null, "gtk-close"); - w2.Add (this.closeAction1, null); - this.preferencesAction1 = new global::Gtk.Action ("preferencesAction1", null, null, "gtk-preferences"); - w2.Add (this.preferencesAction1, null); - this.UIManager.InsertActionGroup (w2, 0); + 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.Action("closeAction", null, null, "gtk-close"); + w2.Add(this.closeAction, null); + this.mediaPlayAction = new global::Gtk.Action("mediaPlayAction", null, null, "gtk-media-play"); + w2.Add(this.mediaPlayAction, null); + this.mediaPauseAction = new global::Gtk.Action("mediaPauseAction", null, null, "gtk-media-pause"); + w2.Add(this.mediaPauseAction, null); + this.mediaStopAction = new global::Gtk.Action("mediaStopAction", null, null, "gtk-media-stop"); + w2.Add(this.mediaStopAction, null); + this.mediaPreviousAction = new global::Gtk.Action("mediaPreviousAction", null, null, "gtk-media-previous"); + w2.Add(this.mediaPreviousAction, null); + this.mediaRewindAction = new global::Gtk.Action("mediaRewindAction", null, null, "gtk-media-rewind"); + w2.Add(this.mediaRewindAction, null); + this.mediaForwardAction = new global::Gtk.Action("mediaForwardAction", null, null, "gtk-media-forward"); + w2.Add(this.mediaForwardAction, null); + this.mediaNextAction = new global::Gtk.Action("mediaNextAction", null, null, "gtk-media-next"); + w2.Add(this.mediaNextAction, null); + this.actAddFile = new global::Gtk.Action("actAddFile", null, null, "gtk-add"); + w2.Add(this.actAddFile, null); + this.actDelFile = new global::Gtk.Action("actDelFile", null, null, "gtk-remove"); + w2.Add(this.actDelFile, null); + this.preferencesAction = new global::Gtk.Action("preferencesAction", null, null, "gtk-preferences"); + w2.Add(this.preferencesAction, null); + this.closeAction1 = new global::Gtk.Action("closeAction1", null, null, "gtk-close"); + w2.Add(this.closeAction1, null); + this.preferencesAction1 = new global::Gtk.Action("preferencesAction1", null, null, "gtk-preferences"); + w2.Add(this.preferencesAction1, null); + this.UIManager.InsertActionGroup(w2, 0); this.Name = "DMX2.SeqSonUI"; // Container child DMX2.SeqSonUI.Gtk.Container+ContainerChild - this.frame1 = new global::Gtk.Frame (); + 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 = new global::Gtk.Alignment(0F, 0F, 1F, 1F); this.GtkAlignment.Name = "GtkAlignment"; this.GtkAlignment.LeftPadding = ((uint)(12)); // Container child GtkAlignment.Gtk.Container+ContainerChild - this.vbox2 = new global::Gtk.VBox (); + 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 = 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 = new global::Gtk.VBox(); this.vbox3.Name = "vbox3"; this.vbox3.Spacing = 6; // Container child vbox3.Gtk.Box+BoxChild - this.evBBox = new global::Gtk.EventBox (); + this.evBBox = new global::Gtk.EventBox(); this.evBBox.Name = "evBBox"; // Container child evBBox.Gtk.Container+ContainerChild - this.hbox2 = new global::Gtk.HBox (); + 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 = 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])); + 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.titleLabel = new global::Gtk.Label (); + this.titleLabel = new global::Gtk.Label(); this.titleLabel.Name = "titleLabel"; this.titleLabel.UseMarkup = true; this.titleLabel.Wrap = true; - this.hbox2.Add (this.titleLabel); - global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.titleLabel])); + this.hbox2.Add(this.titleLabel); + global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.hbox2[this.titleLabel])); w4.Position = 1; w4.Fill = false; // Container child hbox2.Gtk.Box+BoxChild - this.timeLabel = new global::Gtk.Label (); + 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.timeLabel.Justify = ((global::Gtk.Justification)(1)); - this.hbox2.Add (this.timeLabel); - global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.timeLabel])); + 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])); + 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.pbCur = new global::Gtk.ProgressBar (); + this.pbCur = new global::Gtk.ProgressBar(); this.pbCur.Name = "pbCur"; - this.vbox3.Add (this.pbCur); - global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.pbCur])); + this.vbox3.Add(this.pbCur); + global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.vbox3[this.pbCur])); w8.Position = 1; w8.Expand = false; w8.Fill = false; // Container child vbox3.Gtk.Box+BoxChild - this.hbox3 = new global::Gtk.HBox (); + this.hbox3 = new global::Gtk.HBox(); this.hbox3.Name = "hbox3"; this.hbox3.Spacing = 6; // Container child hbox3.Gtk.Box+BoxChild - this.btnPlay = new global::Gtk.Button (); + this.btnPlay = new global::Gtk.Button(); this.btnPlay.CanFocus = true; this.btnPlay.Name = "btnPlay"; this.btnPlay.UseUnderline = true; - // Container child btnPlay.Gtk.Container+ContainerChild - global::Gtk.Alignment w9 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F); - // Container child GtkAlignment.Gtk.Container+ContainerChild - global::Gtk.HBox w10 = new global::Gtk.HBox (); - w10.Spacing = 2; - // Container child GtkHBox.Gtk.Container+ContainerChild - global::Gtk.Image w11 = new global::Gtk.Image (); - w11.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-media-play", global::Gtk.IconSize.Button); - w10.Add (w11); - // Container child GtkHBox.Gtk.Container+ContainerChild - global::Gtk.Label w13 = new global::Gtk.Label (); - w10.Add (w13); - w9.Add (w10); - this.btnPlay.Add (w9); - this.hbox3.Add (this.btnPlay); - global::Gtk.Box.BoxChild w17 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.btnPlay])); - w17.Position = 0; - w17.Expand = false; - w17.Fill = false; + global::Gtk.Image w9 = new global::Gtk.Image(); + w9.Pixbuf = global::Stetic.IconLoader.LoadIcon(this, "gtk-media-play", global::Gtk.IconSize.Button); + this.btnPlay.Image = w9; + this.hbox3.Add(this.btnPlay); + global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.hbox3[this.btnPlay])); + w10.Position = 0; + w10.Expand = false; + w10.Fill = false; // Container child hbox3.Gtk.Box+BoxChild - this.btnPause = new global::Gtk.Button (); + this.btnPause = new global::Gtk.Button(); this.btnPause.CanFocus = true; this.btnPause.Name = "btnPause"; this.btnPause.UseUnderline = true; - // Container child btnPause.Gtk.Container+ContainerChild - global::Gtk.Alignment w18 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F); - // Container child GtkAlignment.Gtk.Container+ContainerChild - global::Gtk.HBox w19 = new global::Gtk.HBox (); - w19.Spacing = 2; - // Container child GtkHBox.Gtk.Container+ContainerChild - global::Gtk.Image w20 = new global::Gtk.Image (); - w20.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-media-pause", global::Gtk.IconSize.Button); - w19.Add (w20); - // Container child GtkHBox.Gtk.Container+ContainerChild - global::Gtk.Label w22 = new global::Gtk.Label (); - w19.Add (w22); - w18.Add (w19); - this.btnPause.Add (w18); - this.hbox3.Add (this.btnPause); - global::Gtk.Box.BoxChild w26 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.btnPause])); - w26.Position = 1; - w26.Expand = false; - w26.Fill = false; + global::Gtk.Image w11 = new global::Gtk.Image(); + w11.Pixbuf = global::Stetic.IconLoader.LoadIcon(this, "gtk-media-pause", global::Gtk.IconSize.Button); + this.btnPause.Image = w11; + this.hbox3.Add(this.btnPause); + global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.hbox3[this.btnPause])); + w12.Position = 1; + w12.Expand = false; + w12.Fill = false; // Container child hbox3.Gtk.Box+BoxChild - this.btnStop = new global::Gtk.Button (); + this.btnStop = new global::Gtk.Button(); this.btnStop.CanFocus = true; this.btnStop.Name = "btnStop"; this.btnStop.UseUnderline = true; - // Container child btnStop.Gtk.Container+ContainerChild - global::Gtk.Alignment w27 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F); - // Container child GtkAlignment.Gtk.Container+ContainerChild - global::Gtk.HBox w28 = new global::Gtk.HBox (); - w28.Spacing = 2; - // Container child GtkHBox.Gtk.Container+ContainerChild - global::Gtk.Image w29 = new global::Gtk.Image (); - w29.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-media-stop", global::Gtk.IconSize.Button); - w28.Add (w29); - // Container child GtkHBox.Gtk.Container+ContainerChild - global::Gtk.Label w31 = new global::Gtk.Label (); - w28.Add (w31); - w27.Add (w28); - this.btnStop.Add (w27); - this.hbox3.Add (this.btnStop); - global::Gtk.Box.BoxChild w35 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.btnStop])); - w35.Position = 2; - w35.Expand = false; - w35.Fill = false; + global::Gtk.Image w13 = new global::Gtk.Image(); + w13.Pixbuf = global::Stetic.IconLoader.LoadIcon(this, "gtk-media-stop", global::Gtk.IconSize.Button); + this.btnStop.Image = w13; + this.hbox3.Add(this.btnStop); + global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(this.hbox3[this.btnStop])); + w14.Position = 2; + w14.Expand = false; + w14.Fill = false; // Container child hbox3.Gtk.Box+BoxChild - this.btnPrev = new global::Gtk.Button (); + this.btnPrev = new global::Gtk.Button(); this.btnPrev.CanFocus = true; this.btnPrev.Name = "btnPrev"; this.btnPrev.UseUnderline = true; - // Container child btnPrev.Gtk.Container+ContainerChild - global::Gtk.Alignment w36 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F); - // Container child GtkAlignment.Gtk.Container+ContainerChild - global::Gtk.HBox w37 = new global::Gtk.HBox (); - w37.Spacing = 2; - // Container child GtkHBox.Gtk.Container+ContainerChild - global::Gtk.Image w38 = new global::Gtk.Image (); - w38.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-media-previous", global::Gtk.IconSize.Button); - w37.Add (w38); - // Container child GtkHBox.Gtk.Container+ContainerChild - global::Gtk.Label w40 = new global::Gtk.Label (); - w37.Add (w40); - w36.Add (w37); - this.btnPrev.Add (w36); - this.hbox3.Add (this.btnPrev); - global::Gtk.Box.BoxChild w44 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.btnPrev])); - w44.Position = 3; - w44.Expand = false; - w44.Fill = false; + global::Gtk.Image w15 = new global::Gtk.Image(); + w15.Pixbuf = global::Stetic.IconLoader.LoadIcon(this, "gtk-media-previous", global::Gtk.IconSize.Button); + this.btnPrev.Image = w15; + this.hbox3.Add(this.btnPrev); + global::Gtk.Box.BoxChild w16 = ((global::Gtk.Box.BoxChild)(this.hbox3[this.btnPrev])); + w16.Position = 3; + w16.Expand = false; + w16.Fill = false; // Container child hbox3.Gtk.Box+BoxChild - this.btnRewind = new global::Gtk.Button (); + this.btnRewind = new global::Gtk.Button(); this.btnRewind.CanFocus = true; this.btnRewind.Name = "btnRewind"; this.btnRewind.UseUnderline = true; - // Container child btnRewind.Gtk.Container+ContainerChild - global::Gtk.Alignment w45 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F); - // Container child GtkAlignment.Gtk.Container+ContainerChild - global::Gtk.HBox w46 = new global::Gtk.HBox (); - w46.Spacing = 2; - // Container child GtkHBox.Gtk.Container+ContainerChild - global::Gtk.Image w47 = new global::Gtk.Image (); - w47.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-media-rewind", global::Gtk.IconSize.Button); - w46.Add (w47); - // Container child GtkHBox.Gtk.Container+ContainerChild - global::Gtk.Label w49 = new global::Gtk.Label (); - w46.Add (w49); - w45.Add (w46); - this.btnRewind.Add (w45); - this.hbox3.Add (this.btnRewind); - global::Gtk.Box.BoxChild w53 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.btnRewind])); - w53.Position = 4; - w53.Expand = false; - w53.Fill = false; + global::Gtk.Image w17 = new global::Gtk.Image(); + w17.Pixbuf = global::Stetic.IconLoader.LoadIcon(this, "gtk-media-rewind", global::Gtk.IconSize.Button); + this.btnRewind.Image = w17; + this.hbox3.Add(this.btnRewind); + global::Gtk.Box.BoxChild w18 = ((global::Gtk.Box.BoxChild)(this.hbox3[this.btnRewind])); + w18.Position = 4; + w18.Expand = false; + w18.Fill = false; // Container child hbox3.Gtk.Box+BoxChild - this.btnForward = new global::Gtk.Button (); + this.btnForward = new global::Gtk.Button(); this.btnForward.CanFocus = true; this.btnForward.Name = "btnForward"; this.btnForward.UseUnderline = true; - // Container child btnForward.Gtk.Container+ContainerChild - global::Gtk.Alignment w54 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F); - // Container child GtkAlignment.Gtk.Container+ContainerChild - global::Gtk.HBox w55 = new global::Gtk.HBox (); - w55.Spacing = 2; - // Container child GtkHBox.Gtk.Container+ContainerChild - global::Gtk.Image w56 = new global::Gtk.Image (); - w56.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-media-forward", global::Gtk.IconSize.Button); - w55.Add (w56); - // Container child GtkHBox.Gtk.Container+ContainerChild - global::Gtk.Label w58 = new global::Gtk.Label (); - w55.Add (w58); - w54.Add (w55); - this.btnForward.Add (w54); - this.hbox3.Add (this.btnForward); - global::Gtk.Box.BoxChild w62 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.btnForward])); - w62.Position = 5; - w62.Expand = false; - w62.Fill = false; + global::Gtk.Image w19 = new global::Gtk.Image(); + w19.Pixbuf = global::Stetic.IconLoader.LoadIcon(this, "gtk-media-forward", global::Gtk.IconSize.Button); + this.btnForward.Image = w19; + this.hbox3.Add(this.btnForward); + global::Gtk.Box.BoxChild w20 = ((global::Gtk.Box.BoxChild)(this.hbox3[this.btnForward])); + w20.Position = 5; + w20.Expand = false; + w20.Fill = false; // Container child hbox3.Gtk.Box+BoxChild - this.btnNext = new global::Gtk.Button (); + this.btnNext = new global::Gtk.Button(); this.btnNext.CanFocus = true; this.btnNext.Name = "btnNext"; this.btnNext.UseUnderline = true; - // Container child btnNext.Gtk.Container+ContainerChild - global::Gtk.Alignment w63 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F); - // Container child GtkAlignment.Gtk.Container+ContainerChild - global::Gtk.HBox w64 = new global::Gtk.HBox (); - w64.Spacing = 2; - // Container child GtkHBox.Gtk.Container+ContainerChild - global::Gtk.Image w65 = new global::Gtk.Image (); - w65.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-media-next", global::Gtk.IconSize.Button); - w64.Add (w65); - // Container child GtkHBox.Gtk.Container+ContainerChild - global::Gtk.Label w67 = new global::Gtk.Label (); - w64.Add (w67); - w63.Add (w64); - this.btnNext.Add (w63); - this.hbox3.Add (this.btnNext); - global::Gtk.Box.BoxChild w71 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.btnNext])); - w71.Position = 6; - w71.Expand = false; - w71.Fill = false; + global::Gtk.Image w21 = new global::Gtk.Image(); + w21.Pixbuf = global::Stetic.IconLoader.LoadIcon(this, "gtk-media-next", global::Gtk.IconSize.Button); + this.btnNext.Image = w21; + this.hbox3.Add(this.btnNext); + global::Gtk.Box.BoxChild w22 = ((global::Gtk.Box.BoxChild)(this.hbox3[this.btnNext])); + w22.Position = 6; + w22.Expand = false; + w22.Fill = false; // Container child hbox3.Gtk.Box+BoxChild - this.txtGoto = new global::Gtk.Entry (); + this.txtGoto = new global::Gtk.Entry(); this.txtGoto.CanFocus = true; this.txtGoto.Name = "txtGoto"; this.txtGoto.IsEditable = true; this.txtGoto.InvisibleChar = '•'; - this.hbox3.Add (this.txtGoto); - global::Gtk.Box.BoxChild w72 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.txtGoto])); - w72.Position = 7; + this.hbox3.Add(this.txtGoto); + global::Gtk.Box.BoxChild w23 = ((global::Gtk.Box.BoxChild)(this.hbox3[this.txtGoto])); + w23.Position = 7; // Container child hbox3.Gtk.Box+BoxChild - this.btnGoto = new global::Gtk.Button (); + this.btnGoto = new global::Gtk.Button(); this.btnGoto.CanFocus = true; this.btnGoto.Name = "btnGoto"; this.btnGoto.UseUnderline = true; 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; - w73.Expand = false; - w73.Fill = false; - this.vbox3.Add (this.hbox3); - global::Gtk.Box.BoxChild w74 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.hbox3])); - w74.Position = 2; - w74.Expand = false; - w74.Fill = false; - this.hbox1.Add (this.vbox3); - global::Gtk.Box.BoxChild w75 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.vbox3])); - w75.Position = 0; + this.hbox3.Add(this.btnGoto); + global::Gtk.Box.BoxChild w24 = ((global::Gtk.Box.BoxChild)(this.hbox3[this.btnGoto])); + w24.Position = 8; + w24.Expand = false; + w24.Fill = false; + this.vbox3.Add(this.hbox3); + global::Gtk.Box.BoxChild w25 = ((global::Gtk.Box.BoxChild)(this.vbox3[this.hbox3])); + w25.Position = 2; + w25.Expand = false; + w25.Fill = false; + this.hbox1.Add(this.vbox3); + global::Gtk.Box.BoxChild w26 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.vbox3])); + w26.Position = 0; // Container child hbox1.Gtk.Box+BoxChild - this.sclVolume = new global::Gtk.VScale (null); + this.sclVolume = new global::Gtk.VScale(null); this.sclVolume.WidthRequest = 20; this.sclVolume.CanFocus = true; this.sclVolume.Name = "sclVolume"; this.sclVolume.Inverted = true; - this.sclVolume.Adjustment.Upper = 100; - this.sclVolume.Adjustment.PageIncrement = 10; - this.sclVolume.Adjustment.StepIncrement = 1; - this.sclVolume.Adjustment.Value = 100; + this.sclVolume.Adjustment.Upper = 100D; + this.sclVolume.Adjustment.PageIncrement = 10D; + this.sclVolume.Adjustment.StepIncrement = 1D; + this.sclVolume.Adjustment.Value = 100D; this.sclVolume.DrawValue = true; this.sclVolume.Digits = 0; this.sclVolume.ValuePos = ((global::Gtk.PositionType)(3)); - this.hbox1.Add (this.sclVolume); - global::Gtk.Box.BoxChild w76 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.sclVolume])); - w76.Position = 1; - w76.Expand = false; - w76.Fill = false; + this.hbox1.Add(this.sclVolume); + global::Gtk.Box.BoxChild w27 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.sclVolume])); + w27.Position = 1; + w27.Expand = false; + w27.Fill = false; // Container child hbox1.Gtk.Box+BoxChild - this.UIManager.AddUiFromString (""); - this.toolbar4 = ((global::Gtk.Toolbar)(this.UIManager.GetWidget ("/toolbar4"))); + this.UIManager.AddUiFromString(""); + this.toolbar4 = ((global::Gtk.Toolbar)(this.UIManager.GetWidget("/toolbar4"))); this.toolbar4.Name = "toolbar4"; this.toolbar4.Orientation = ((global::Gtk.Orientation)(1)); this.toolbar4.ShowArrow = false; this.toolbar4.ToolbarStyle = ((global::Gtk.ToolbarStyle)(0)); this.toolbar4.IconSize = ((global::Gtk.IconSize)(2)); - this.hbox1.Add (this.toolbar4); - global::Gtk.Box.BoxChild w77 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.toolbar4])); - w77.Position = 2; - w77.Expand = false; - w77.Fill = false; - this.vbox2.Add (this.hbox1); - global::Gtk.Box.BoxChild w78 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.hbox1])); - w78.Position = 0; - w78.Expand = false; - w78.Fill = false; + this.hbox1.Add(this.toolbar4); + global::Gtk.Box.BoxChild w28 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.toolbar4])); + w28.Position = 2; + w28.Expand = false; + w28.Fill = false; + this.vbox2.Add(this.hbox1); + global::Gtk.Box.BoxChild w29 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.hbox1])); + w29.Position = 0; + w29.Expand = false; + w29.Fill = false; // Container child vbox2.Gtk.Box+BoxChild - this.GtkScrolledWindow = new global::Gtk.ScrolledWindow (); + this.GtkScrolledWindow = new global::Gtk.ScrolledWindow(); this.GtkScrolledWindow.Name = "GtkScrolledWindow"; this.GtkScrolledWindow.ShadowType = ((global::Gtk.ShadowType)(1)); // Container child GtkScrolledWindow.Gtk.Container+ContainerChild - this.listFiles = new global::Gtk.NodeView (); + this.listFiles = new global::Gtk.NodeView(); this.listFiles.CanFocus = true; this.listFiles.Name = "listFiles"; this.listFiles.RulesHint = true; - this.GtkScrolledWindow.Add (this.listFiles); - this.vbox2.Add (this.GtkScrolledWindow); - global::Gtk.Box.BoxChild w80 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.GtkScrolledWindow])); - w80.Position = 1; + this.GtkScrolledWindow.Add(this.listFiles); + this.vbox2.Add(this.GtkScrolledWindow); + global::Gtk.Box.BoxChild w31 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.GtkScrolledWindow])); + w31.Position = 1; // Container child vbox2.Gtk.Box+BoxChild - this.label1 = new global::Gtk.Label (); + 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.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.titreLabel = new global::Gtk.Label (); + this.vbox2.Add(this.label1); + global::Gtk.Box.BoxChild w32 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.label1])); + w32.Position = 2; + w32.Expand = false; + w32.Fill = false; + this.GtkAlignment.Add(this.vbox2); + this.frame1.Add(this.GtkAlignment); + 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 (); + this.Add(this.frame1); + if ((this.Child != null)) + { + this.Child.ShowAll(); } - w1.SetUiManager (UIManager); - this.Hide (); - this.actAddFile.Activated += new global::System.EventHandler (this.OnActAddFileActivated); - this.actDelFile.Activated += new global::System.EventHandler (this.OnActDelFileActivated); - this.btnPlay.Clicked += new global::System.EventHandler (this.OnBtnPlayClicked); - this.btnPause.Clicked += new global::System.EventHandler (this.OnBtnPauseClicked); - this.btnStop.Clicked += new global::System.EventHandler (this.OnBtnStopClicked); - this.btnPrev.Clicked += new global::System.EventHandler (this.OnBtnPrevClicked); - this.btnRewind.Pressed += new global::System.EventHandler (this.OnBtnRewindPressed); - this.btnRewind.Released += new global::System.EventHandler (this.OnBtnRewindReleased); - this.btnForward.Pressed += new global::System.EventHandler (this.OnBtnForwardPressed); - this.btnForward.Released += new global::System.EventHandler (this.OnBtnForwardReleased); - this.btnNext.Clicked += new global::System.EventHandler (this.OnBtnNextClicked); - this.btnGoto.Clicked += new global::System.EventHandler (this.OnBtnGotoClicked); - this.sclVolume.ValueChanged += new global::System.EventHandler (this.OnSclVolumeValueChanged); - this.listFiles.CursorChanged += new global::System.EventHandler (this.OnListFilesCursorChanged); + w1.SetUiManager(UIManager); + this.Hide(); + this.actAddFile.Activated += new global::System.EventHandler(this.OnActAddFileActivated); + this.actDelFile.Activated += new global::System.EventHandler(this.OnActDelFileActivated); + this.btnPlay.Clicked += new global::System.EventHandler(this.OnBtnPlayClicked); + this.btnPause.Clicked += new global::System.EventHandler(this.OnBtnPauseClicked); + this.btnStop.Clicked += new global::System.EventHandler(this.OnBtnStopClicked); + this.btnPrev.Clicked += new global::System.EventHandler(this.OnBtnPrevClicked); + this.btnRewind.Pressed += new global::System.EventHandler(this.OnBtnRewindPressed); + this.btnRewind.Released += new global::System.EventHandler(this.OnBtnRewindReleased); + this.btnForward.Pressed += new global::System.EventHandler(this.OnBtnForwardPressed); + this.btnForward.Released += new global::System.EventHandler(this.OnBtnForwardReleased); + this.btnNext.Clicked += new global::System.EventHandler(this.OnBtnNextClicked); + this.btnGoto.Clicked += new global::System.EventHandler(this.OnBtnGotoClicked); + this.sclVolume.ValueChanged += new global::System.EventHandler(this.OnSclVolumeValueChanged); + this.listFiles.CursorChanged += new global::System.EventHandler(this.OnListFilesCursorChanged); } } } diff --git a/DMX-2.0/gtk-gui/generated.cs b/DMX-2.0/gtk-gui/generated.cs index d1ab735..19494a5 100644 --- a/DMX-2.0/gtk-gui/generated.cs +++ b/DMX-2.0/gtk-gui/generated.cs @@ -6,114 +6,124 @@ namespace Stetic { private static bool initialized; - internal static void Initialize (Gtk.Widget iconRenderer) + internal static void Initialize(Gtk.Widget iconRenderer) { - if ((Stetic.Gui.initialized == false)) { + if ((Stetic.Gui.initialized == false)) + { Stetic.Gui.initialized = true; - global::Gtk.IconFactory w1 = new global::Gtk.IconFactory (); - global::Gtk.IconSet w2 = new global::Gtk.IconSet (); - global::Gtk.IconSource w3 = new global::Gtk.IconSource (); - w3.Pixbuf = global::Gdk.Pixbuf.LoadFromResource ("DMX2.icons.ictir.16.png"); + global::Gtk.IconFactory w1 = new global::Gtk.IconFactory(); + global::Gtk.IconSet w2 = new global::Gtk.IconSet(); + global::Gtk.IconSource w3 = new global::Gtk.IconSource(); + w3.Pixbuf = global::Gdk.Pixbuf.LoadFromResource("DMX2.icons.ictir.16.png"); w3.SizeWildcarded = false; w3.Size = global::Gtk.IconSize.SmallToolbar; - w2.AddSource (w3); - global::Gtk.IconSource w4 = new global::Gtk.IconSource (); - w4.Pixbuf = global::Gdk.Pixbuf.LoadFromResource ("DMX2.icons.ictir.24.png"); + w2.AddSource(w3); + global::Gtk.IconSource w4 = new global::Gtk.IconSource(); + w4.Pixbuf = global::Gdk.Pixbuf.LoadFromResource("DMX2.icons.ictir.24.png"); w4.SizeWildcarded = false; w4.Size = global::Gtk.IconSize.LargeToolbar; - w2.AddSource (w4); - global::Gtk.IconSource w5 = new global::Gtk.IconSource (); - w5.Pixbuf = global::Gdk.Pixbuf.LoadFromResource ("DMX2.icons.ictir.32.png"); + w2.AddSource(w4); + global::Gtk.IconSource w5 = new global::Gtk.IconSource(); + w5.Pixbuf = global::Gdk.Pixbuf.LoadFromResource("DMX2.icons.ictir.32.png"); w5.SizeWildcarded = false; w5.Size = global::Gtk.IconSize.Dnd; - w2.AddSource (w5); - global::Gtk.IconSource w6 = new global::Gtk.IconSource (); - w6.Pixbuf = global::Gdk.Pixbuf.LoadFromResource ("DMX2.icons.ictir.48.png"); + w2.AddSource(w5); + global::Gtk.IconSource w6 = new global::Gtk.IconSource(); + w6.Pixbuf = global::Gdk.Pixbuf.LoadFromResource("DMX2.icons.ictir.48.png"); w6.SizeWildcarded = false; w6.Size = global::Gtk.IconSize.Dialog; - w2.AddSource (w6); - global::Gtk.IconSource w7 = new global::Gtk.IconSource (); - w7.Pixbuf = global::Gdk.Pixbuf.LoadFromResource ("DMX2.icons.ictir.16.png"); + w2.AddSource(w6); + global::Gtk.IconSource w7 = new global::Gtk.IconSource(); + w7.Pixbuf = global::Gdk.Pixbuf.LoadFromResource("DMX2.icons.ictir.16.png"); w7.SizeWildcarded = false; w7.Size = global::Gtk.IconSize.Button; - w2.AddSource (w7); - global::Gtk.IconSource w8 = new global::Gtk.IconSource (); - w8.Pixbuf = global::Gdk.Pixbuf.LoadFromResource ("DMX2.icons.ictir.16.png"); + w2.AddSource(w7); + global::Gtk.IconSource w8 = new global::Gtk.IconSource(); + w8.Pixbuf = global::Gdk.Pixbuf.LoadFromResource("DMX2.icons.ictir.16.png"); w8.SizeWildcarded = false; w8.Size = global::Gtk.IconSize.Menu; - w2.AddSource (w8); - w1.Add ("tirettes", w2); - global::Gtk.IconSet w9 = new global::Gtk.IconSet (); - global::Gtk.IconSource w10 = new global::Gtk.IconSource (); - w10.Pixbuf = global::Gdk.Pixbuf.LoadFromResource ("DMX2.icons.docListe.16.png"); + w2.AddSource(w8); + w1.Add("tirettes", w2); + global::Gtk.IconSet w9 = new global::Gtk.IconSet(); + global::Gtk.IconSource w10 = new global::Gtk.IconSource(); + w10.Pixbuf = global::Gdk.Pixbuf.LoadFromResource("DMX2.icons.docListe.16.png"); w10.SizeWildcarded = false; w10.Size = global::Gtk.IconSize.Menu; - w9.AddSource (w10); - global::Gtk.IconSource w11 = new global::Gtk.IconSource (); - w11.Pixbuf = global::Gdk.Pixbuf.LoadFromResource ("DMX2.icons.docListe.48.png"); + w9.AddSource(w10); + global::Gtk.IconSource w11 = new global::Gtk.IconSource(); + w11.Pixbuf = global::Gdk.Pixbuf.LoadFromResource("DMX2.icons.docListe.48.png"); w11.SizeWildcarded = false; w11.Size = global::Gtk.IconSize.Dialog; - w9.AddSource (w11); - global::Gtk.IconSource w12 = new global::Gtk.IconSource (); - w12.Pixbuf = global::Gdk.Pixbuf.LoadFromResource ("DMX2.icons.docListe.16.png"); + w9.AddSource(w11); + global::Gtk.IconSource w12 = new global::Gtk.IconSource(); + w12.Pixbuf = global::Gdk.Pixbuf.LoadFromResource("DMX2.icons.docListe.16.png"); w12.SizeWildcarded = false; w12.Size = global::Gtk.IconSize.Button; - w9.AddSource (w12); - global::Gtk.IconSource w13 = new global::Gtk.IconSource (); - w13.Pixbuf = global::Gdk.Pixbuf.LoadFromResource ("DMX2.icons.docListe.24.png"); + w9.AddSource(w12); + global::Gtk.IconSource w13 = new global::Gtk.IconSource(); + w13.Pixbuf = global::Gdk.Pixbuf.LoadFromResource("DMX2.icons.docListe.24.png"); w13.SizeWildcarded = false; w13.Size = global::Gtk.IconSize.LargeToolbar; - w9.AddSource (w13); - global::Gtk.IconSource w14 = new global::Gtk.IconSource (); - w14.Pixbuf = global::Gdk.Pixbuf.LoadFromResource ("DMX2.icons.docListe.16.png"); + w9.AddSource(w13); + global::Gtk.IconSource w14 = new global::Gtk.IconSource(); + w14.Pixbuf = global::Gdk.Pixbuf.LoadFromResource("DMX2.icons.docListe.16.png"); w14.SizeWildcarded = false; w14.Size = global::Gtk.IconSize.SmallToolbar; - w9.AddSource (w14); - global::Gtk.IconSource w15 = new global::Gtk.IconSource (); - w15.Pixbuf = global::Gdk.Pixbuf.LoadFromResource ("DMX2.icons.docListe.32.png"); + w9.AddSource(w14); + global::Gtk.IconSource w15 = new global::Gtk.IconSource(); + w15.Pixbuf = global::Gdk.Pixbuf.LoadFromResource("DMX2.icons.docListe.32.png"); w15.SizeWildcarded = false; w15.Size = global::Gtk.IconSize.Dnd; - w9.AddSource (w15); - w1.Add ("circuits", w9); - global::Gtk.IconSet w16 = new global::Gtk.IconSet (global::Gdk.Pixbuf.LoadFromResource ("DMX2.icons.midiseq.audio-x-generic.svg")); - w1.Add ("MidiSeq", w16); - w1.AddDefault (); + w9.AddSource(w15); + w1.Add("circuits", w9); + global::Gtk.IconSet w16 = new global::Gtk.IconSet(global::Gdk.Pixbuf.LoadFromResource("DMX2.icons.midiseq.audio-x-generic.svg")); + w1.Add("MidiSeq", w16); + w1.AddDefault(); } } } internal class IconLoader { - public static Gdk.Pixbuf LoadIcon (Gtk.Widget widget, string name, Gtk.IconSize size) + public static Gdk.Pixbuf LoadIcon(Gtk.Widget widget, string name, Gtk.IconSize size) { - Gdk.Pixbuf res = widget.RenderIcon (name, size, null); - if ((res != null)) { + Gdk.Pixbuf res = widget.RenderIcon(name, size, null); + if ((res != null)) + { return res; - } else { + } + else + { int sz; int sy; - global::Gtk.Icon.SizeLookup (size, out sz, out sy); - try { - return Gtk.IconTheme.Default.LoadIcon (name, sz, 0); - } catch (System.Exception) { - if ((name != "gtk-missing-image")) { - return Stetic.IconLoader.LoadIcon (widget, "gtk-missing-image", size); - } else { - Gdk.Pixmap pmap = new Gdk.Pixmap (Gdk.Screen.Default.RootWindow, sz, sz); - Gdk.GC gc = new Gdk.GC (pmap); - gc.RgbFgColor = new Gdk.Color (255, 255, 255); - pmap.DrawRectangle (gc, true, 0, 0, sz, sz); - gc.RgbFgColor = new Gdk.Color (0, 0, 0); - pmap.DrawRectangle (gc, false, 0, 0, (sz - 1), (sz - 1)); - gc.SetLineAttributes (3, Gdk.LineStyle.Solid, Gdk.CapStyle.Round, Gdk.JoinStyle.Round); - gc.RgbFgColor = new Gdk.Color (255, 0, 0); - pmap.DrawLine (gc, (sz / 4), (sz / 4), ((sz - 1) - - (sz / 4)), ((sz - 1) - - (sz / 4))); - pmap.DrawLine (gc, ((sz - 1) - - (sz / 4)), (sz / 4), (sz / 4), ((sz - 1) - - (sz / 4))); - return Gdk.Pixbuf.FromDrawable (pmap, pmap.Colormap, 0, 0, 0, 0, sz, sz); + global::Gtk.Icon.SizeLookup(size, out sz, out sy); + try + { + return Gtk.IconTheme.Default.LoadIcon(name, sz, 0); + } + catch (System.Exception) + { + if ((name != "gtk-missing-image")) + { + return Stetic.IconLoader.LoadIcon(widget, "gtk-missing-image", size); + } + else + { + Gdk.Pixmap pmap = new Gdk.Pixmap(Gdk.Screen.Default.RootWindow, sz, sz); + Gdk.GC gc = new Gdk.GC(pmap); + gc.RgbFgColor = new Gdk.Color(255, 255, 255); + pmap.DrawRectangle(gc, true, 0, 0, sz, sz); + gc.RgbFgColor = new Gdk.Color(0, 0, 0); + pmap.DrawRectangle(gc, false, 0, 0, (sz - 1), (sz - 1)); + gc.SetLineAttributes(3, Gdk.LineStyle.Solid, Gdk.CapStyle.Round, Gdk.JoinStyle.Round); + gc.RgbFgColor = new Gdk.Color(255, 0, 0); + pmap.DrawLine(gc, (sz / 4), (sz / 4), ((sz - 1) + - (sz / 4)), ((sz - 1) + - (sz / 4))); + pmap.DrawLine(gc, ((sz - 1) + - (sz / 4)), (sz / 4), (sz / 4), ((sz - 1) + - (sz / 4))); + return Gdk.Pixbuf.FromDrawable(pmap, pmap.Colormap, 0, 0, 0, 0, sz, sz); } } } @@ -123,51 +133,55 @@ namespace Stetic internal class BinContainer { private Gtk.Widget child; - + private Gtk.UIManager uimanager; - public static BinContainer Attach (Gtk.Bin bin) + public static BinContainer Attach(Gtk.Bin bin) { - BinContainer bc = new BinContainer (); - bin.SizeRequested += new Gtk.SizeRequestedHandler (bc.OnSizeRequested); - bin.SizeAllocated += new Gtk.SizeAllocatedHandler (bc.OnSizeAllocated); - bin.Added += new Gtk.AddedHandler (bc.OnAdded); + BinContainer bc = new BinContainer(); + bin.SizeRequested += new Gtk.SizeRequestedHandler(bc.OnSizeRequested); + bin.SizeAllocated += new Gtk.SizeAllocatedHandler(bc.OnSizeAllocated); + bin.Added += new Gtk.AddedHandler(bc.OnAdded); return bc; } - private void OnSizeRequested (object sender, Gtk.SizeRequestedArgs args) + private void OnSizeRequested(object sender, Gtk.SizeRequestedArgs args) { - if ((this.child != null)) { - args.Requisition = this.child.SizeRequest (); + if ((this.child != null)) + { + args.Requisition = this.child.SizeRequest(); } } - private void OnSizeAllocated (object sender, Gtk.SizeAllocatedArgs args) + private void OnSizeAllocated(object sender, Gtk.SizeAllocatedArgs args) { - if ((this.child != null)) { + if ((this.child != null)) + { this.child.Allocation = args.Allocation; } } - private void OnAdded (object sender, Gtk.AddedArgs args) + private void OnAdded(object sender, Gtk.AddedArgs args) { this.child = args.Widget; } - public void SetUiManager (Gtk.UIManager uim) + public void SetUiManager(Gtk.UIManager uim) { this.uimanager = uim; - this.child.Realized += new System.EventHandler (this.OnRealized); + this.child.Realized += new System.EventHandler(this.OnRealized); } - private void OnRealized (object sender, System.EventArgs args) + private void OnRealized(object sender, System.EventArgs args) { - if ((this.uimanager != null)) { + if ((this.uimanager != null)) + { Gtk.Widget w; w = this.child.Toplevel; if (((w != null) - && typeof(Gtk.Window).IsInstanceOfType (w))) { - ((Gtk.Window)(w)).AddAccelGroup (this.uimanager.AccelGroup); + && typeof(Gtk.Window).IsInstanceOfType(w))) + { + ((Gtk.Window)(w)).AddAccelGroup(this.uimanager.AccelGroup); this.uimanager = null; } } @@ -176,12 +190,12 @@ namespace Stetic internal class ActionGroups { - public static Gtk.ActionGroup GetActionGroup (System.Type type) + public static Gtk.ActionGroup GetActionGroup(System.Type type) { - return Stetic.ActionGroups.GetActionGroup (type.FullName); + return Stetic.ActionGroups.GetActionGroup(type.FullName); } - public static Gtk.ActionGroup GetActionGroup (string name) + public static Gtk.ActionGroup GetActionGroup(string name) { return null; } diff --git a/DMX-2.0/gtk-gui/gui.stetic b/DMX-2.0/gtk-gui/gui.stetic index e0e0cd0..dbae9e1 100644 --- a/DMX-2.0/gtk-gui/gui.stetic +++ b/DMX-2.0/gtk-gui/gui.stetic @@ -770,7 +770,7 @@ page - + 10 5 @@ -1180,7 +1180,7 @@ au sequenceur - + 6 Start @@ -1371,7 +1371,7 @@ au sequenceur 6 - + Univers : @@ -2416,19 +2416,48 @@ r: loop - + - False - Icons - SmallToolbar - - - - - - - - + 6 + + + + False + Icons + SmallToolbar + + + + + + + + + + + 0 + True + + + + + + + + + 220 + True + True + + + + + 2 + False + False + False + + 1 @@ -2498,7 +2527,7 @@ r: loop - Séquenceur Midi + Séquenceur OSC True @@ -2670,7 +2699,7 @@ r: loop 6 - + Driver Boitier V1 @@ -2822,7 +2851,7 @@ r: loop 6 - + Driver V2 @@ -3200,7 +3229,7 @@ r: loop 2 - + Loupiottes @@ -3247,7 +3276,7 @@ Licence : GPL V2 - + False @@ -3255,7 +3284,7 @@ Licence : GPL V2 6 - + Driver V3 @@ -3997,7 +4026,7 @@ trames DMX (ms) - + <b>Options Midi</b> True From 7437fac7406d102bc7fa9f6836ec7d54a1b4eedc Mon Sep 17 00:00:00 2001 From: tzim Date: Fri, 5 Oct 2018 00:35:36 +0200 Subject: [PATCH 15/22] Ajouts verifs diverses --- DMX-2.0/Main.cs | 2 +- DMX-2.0/SequenceurOSC.cs | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/DMX-2.0/Main.cs b/DMX-2.0/Main.cs index 6a82a77..dbf6540 100644 --- a/DMX-2.0/Main.cs +++ b/DMX-2.0/Main.cs @@ -88,7 +88,7 @@ namespace DMX2 if (openfile != null) win.OpenFile (openfile); - + // Gestion des erreurs non traitées dans l'interface GLib.ExceptionManager.UnhandledException += HandleUnhandledException; diff --git a/DMX-2.0/SequenceurOSC.cs b/DMX-2.0/SequenceurOSC.cs index 69e9f35..c781214 100644 --- a/DMX-2.0/SequenceurOSC.cs +++ b/DMX-2.0/SequenceurOSC.cs @@ -302,17 +302,18 @@ namespace DMX2 Console.WriteLine(enCours.Commande); + if (enCours.Commande == null) return; + if (enCours.Commande.Length == 0) return; + if (iPEndPoint == null) return; + string[] data = enCours.Commande.Split(' '); - - int di; - float df; - + OSCMessage message = new OSCMessage(data[0]); for (int i = 1; i < data.Length; i++) { - if (int.TryParse(data[i], out di)) + if (int.TryParse(data[i], out int di)) message.AddInt(di); - else if (float.TryParse(data[i], out df)) + else if (float.TryParse(data[i], out float df)) message.AddFloat(df); else message.AddString(data[i]); } From 4bae84ee2353f67598591c3556f474587334b2bd Mon Sep 17 00:00:00 2001 From: "arnaud.houdelette" Date: Fri, 5 Oct 2018 17:14:19 +0200 Subject: [PATCH 16/22] Ajout script python GST --- tools/gstlaunchdynamic.py | 157 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 157 insertions(+) create mode 100644 tools/gstlaunchdynamic.py diff --git a/tools/gstlaunchdynamic.py b/tools/gstlaunchdynamic.py new file mode 100644 index 0000000..3936c41 --- /dev/null +++ b/tools/gstlaunchdynamic.py @@ -0,0 +1,157 @@ +#!/usr/bin/env python + +import sys + +import gi + +from gi.repository import GLib +gi.require_version('Gst', '1.0') +from gi.repository import Gst + +import fcntl +import os +import ast +import re + +# for the moment... +gst_eval = ast.literal_eval + +class Parser(object): + def __init__(self, pipeline): + self.pipeline = pipeline + + self.expressions = [ + ('^(\w+)\.(\w+) = (.+)$', self.set_property), + ('^(\w+)(?:\.(\w+))? ([-x])> (\w+)(?:\.(\w+))?$', self.link_pads), + ('^\+ (\w+)(?: (.*))?$', self.add_element), + ('^- (\w+)$', self.remove_element), + ('^(stop|play|pause)$', self.set_state), + ('^seekto ([0-9.]+)$', self.seek), + ] + + self.expressions = [ + (re.compile(regex), fn) + for regex, fn in self.expressions + ] + + def parse_line(self, line): + for regex, fn in self.expressions: + m = regex.match(line) + if m: + try: + fn(*m.groups()) + except Exception: + import traceback + traceback.print_exc() + break + else: + print 'Error: could not parse line.' + + def set_property(self, target, attr, value): + el = self.pipeline.get_by_name(target) + value = gst_eval(value) + el.set_property(attr, value) + + def link_pads(self, src, src_pad, char, dst, dst_pad): + src_el = self.pipeline.get_by_name(src) + dst_el = self.pipeline.get_by_name(dst) + + print src_el, src_pad, char, dst_el, dst_pad + + if char == '-': + success = src_el.link_pads(src_pad, dst_el, dst_pad) + if not success: + print 'Could not link pads.' + + elif char == 'x': + success = src_el.unlink_pads(src_pad, dst_el, dst_pad) + if not success: + print 'Could not unlink pads.' + + def set_state(self, state): + state = { + 'stop': Gst.State.READY, + 'play': Gst.State.PLAYING, + 'pause': Gst.State.PAUSED, + }[state] + self.pipeline.set_state(state) + + def seek(self, to): + to=int(float(to)*1000000000) + print to + pipeline.seek_simple( + Gst.Format.TIME, + Gst.SeekFlags.FLUSH | Gst.SeekFlags.KEY_UNIT, + to + ) + + def add_element(self, kind, properties): + # TODO: write a proper parser, and don't have this here + properties = dict( + pair.split('=', 1) + for pair in properties.split(' ') + ) + + # create the element + name = properties.pop('name', None) + element = Gst.ElementFactory.make(kind, name) + + # set the properties + for key, value in properties: + value = gst_eval(value) + element.set_property(key, value) + + self.pipeline.add(element) + + def remove_element(self, name): + element = self.pipeline.get_by_name(name) + self.pipeline.remove(element) + +def setup_non_blocking_read(f, on_line): + fd = f.fileno() + + fl = fcntl.fcntl(fd, fcntl.F_GETFL) + fcntl.fcntl(fd, fcntl.F_SETFL, fl | os.O_NONBLOCK) + + buf = [''] + def on_data_available(fd, condition): + data = f.read() + buf[0] += data + + lines = buf[0].split('\n') + buf[0] = lines.pop() + + for line in lines: + on_line(line) + + return True + + GLib.io_add_watch( + fd, + GLib.IOCondition.IN, + on_data_available, + ) + + +# init gstreamer, parse args +args = sys.argv[:] +Gst.init(args) + +desc = ' '.join(args[1:]) + +# load gstreamer pipeline, press play + +pipeline = Gst.parse_launch(desc) +pipeline.set_state(Gst.State.PLAYING) + +# make stdin non-blocking +# when a line of input is recieved, parse it +# the parser has most of the logic + +parser = Parser(pipeline) +setup_non_blocking_read(sys.stdin, parser.parse_line) + +# run glib main loop + +loop = GLib.MainLoop() +loop.run() From 4075ca7f3427f6b16cbf3d2d702546f0f2623c23 Mon Sep 17 00:00:00 2001 From: tzim Date: Sat, 6 Oct 2018 23:35:45 +0200 Subject: [PATCH 17/22] =?UTF-8?q?Restauration=20de=20la=20d=C3=A9tection?= =?UTF-8?q?=20des=20perifs=20physiques?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DMX-2.0/AlsaSeqLib.MidiPort.cs | 6 +- DMX-2.0/AlsaSeqLib.cs | 13 +- DMX-2.0/MidiEventProvider.cs | 779 +++++++++++++++++++-------------- 3 files changed, 450 insertions(+), 348 deletions(-) diff --git a/DMX-2.0/AlsaSeqLib.MidiPort.cs b/DMX-2.0/AlsaSeqLib.MidiPort.cs index db700d1..4a7c656 100644 --- a/DMX-2.0/AlsaSeqLib.MidiPort.cs +++ b/DMX-2.0/AlsaSeqLib.MidiPort.cs @@ -70,12 +70,12 @@ namespace DMX2 return Invoke.snd_seq_connect_to (seq_handle.Handle, portid, p.ClientId, p.PortId) == 0; } - internal bool ConnectTo(int client, int port){ + /*internal bool ConnectTo(int client, int port){ if (seq_handle == null) throw new InvalidOperationException (); return Invoke.snd_seq_connect_to (seq_handle.Handle, portid, client, port) == 0; - } - + }*/ + public bool ConnectFrom(Port p){ if (seq_handle == null) throw new InvalidOperationException (); diff --git a/DMX-2.0/AlsaSeqLib.cs b/DMX-2.0/AlsaSeqLib.cs index 1c096d0..93fd5de 100644 --- a/DMX-2.0/AlsaSeqLib.cs +++ b/DMX-2.0/AlsaSeqLib.cs @@ -13,7 +13,7 @@ namespace DMX2 //static int outport; static System.Threading.Thread eventthread = null; - static MidiPort systemPort = null; + //static MidiPort systemPort = null; static internal Dictionary openports = new Dictionary(); @@ -129,6 +129,7 @@ namespace DMX2 clientId = _clientId; portId = _portId; srcid = clientId << 8 + portId; + ports.Add(srcid, this); } private void Updateinfo (PointerWrapper portInfo) @@ -177,8 +178,8 @@ namespace DMX2 System.Threading.ThreadStart ts = new System.Threading.ThreadStart (EventLoop); eventthread = new System.Threading.Thread (ts); eventthread.Start(); - systemPort = new MidiPort ("system"); - systemPort.ConnectTo (SND_SEQ_CLIENT_SYSTEM, SND_SEQ_PORT_SYSTEM_ANNOUNCE); + //systemPort = new MidiPort ("system"); + //systemPort.ConnectTo (SND_SEQ_CLIENT_SYSTEM, SND_SEQ_PORT_SYSTEM_ANNOUNCE); } public static void Close () @@ -201,16 +202,16 @@ namespace DMX2 // liberation du pointeur Invoke.snd_seq_free_event (evPtr); - if (ev.dest.port == systemPort.portid) { + /*if (ev.dest.port == systemPort.portid) { if (ev.type == AlsaSeqLib.snd_seq_event_type_t.SND_SEQ_EVENT_PORT_START) { } - } else { + } else {*/ // queue if (openports.ContainsKey (ev.dest.port)) { openports [ev.dest.port].eventqueue.Enqueue (ev); } - } + //} } System.Threading.Thread.Sleep (1); } diff --git a/DMX-2.0/MidiEventProvider.cs b/DMX-2.0/MidiEventProvider.cs index 5c83a39..b17b684 100644 --- a/DMX-2.0/MidiEventProvider.cs +++ b/DMX-2.0/MidiEventProvider.cs @@ -28,27 +28,27 @@ namespace DMX2 /// /// Etat interne des evenements midi paginés. /// - readonly Dictionary eventlist = new Dictionary (); + readonly Dictionary eventlist = new Dictionary(); /// /// Liste des peripheriques connus (presents ou non) /// - readonly Dictionary knowndevices = new Dictionary (); + readonly Dictionary knowndevices = new Dictionary(); /// /// Liste des ports connectés avec feedback /// - readonly List feedbacksources = new List (); + readonly List feedbacksources = new List(); //static readonly Dictionary srcidToDev = new Dictionary(); - readonly List unpaginatedchannels = new List (); + readonly List unpaginatedchannels = new List(); /// /// Derniere valeur connue pour une evenement sur source donnée : /// Soit recue, soit envoyée (feedback / changement de page) /// - readonly Dictionary lastValueOfSrc = new Dictionary (); - // EventData last; + readonly Dictionary lastValueOfSrc = new Dictionary(); + // EventData last; internalEventDesc levent = null; bool guirefreshflag = false; uint page = 1; @@ -62,68 +62,91 @@ namespace DMX2 AlsaSeqLib.MidiPort midiport; - public uint CurrentPage { - get { + public uint CurrentPage + { + get + { return page; } - set { + set + { if (value < 1 || value > maxpage) return; page = value; - Refresh (); + Refresh(); } } - public uint PageUpCC { - get { + public uint PageUpCC + { + get + { return pageUpCC; } - set { + set + { pageUpCC = value; } } - public uint PageDownCC { - get { + public uint PageDownCC + { + get + { return pageDownCC; } - set { + set + { pageDownCC = value; } } - public uint Maxpage { - get { + public uint Maxpage + { + get + { return maxpage; } - set { + set + { maxpage = value; } } - public List UnpaginatedChannels { - get { + public List UnpaginatedChannels + { + get + { return unpaginatedchannels; } } - public bool Use14bCC { - get { + public bool Use14bCC + { + get + { return use14b; } - set { + set + { use14b = value; } } - public int Max14bValue { - get { + public int Max14bValue + { + get + { return max14bValue; } - set { + set + { max14bValue = value; } } - public bool GuiRefreshFlag { - get { - if (guirefreshflag) { + public bool GuiRefreshFlag + { + get + { + if (guirefreshflag) + { guirefreshflag = false; return true; } @@ -131,75 +154,87 @@ namespace DMX2 } } - public void ConnectDevice (string name) + public void ConnectDevice(string name) { - knowndevices.Add (name, new MidiControler (name)); - AutoConnect (); + knowndevices.Add(name, new MidiControler(name)); + AutoConnect(); } - public void RefreshFeedback (string name) + public void RefreshFeedback(string name) { - foreach (AlsaSeqLib.Port port in knowndevices[name].ConnectedPorts) { - if (knowndevices [name].HasFeedback) { - if (!feedbacksources.Contains (port)) - feedbacksources.Add (port); - } else { - if (feedbacksources.Contains (port)) - feedbacksources.Remove (port); + foreach (AlsaSeqLib.Port port in knowndevices[name].ConnectedPorts) + { + if (knowndevices[name].HasFeedback) + { + if (!feedbacksources.Contains(port)) + feedbacksources.Add(port); + } + else + { + if (feedbacksources.Contains(port)) + feedbacksources.Remove(port); } } } - public void DisconnectDevice (MidiEventProvider.MidiControler dev) + public void DisconnectDevice(MidiEventProvider.MidiControler dev) { - if (!knowndevices.ContainsKey (dev.Name)) + if (!knowndevices.ContainsKey(dev.Name)) return; - knowndevices.Remove (dev.Name); + knowndevices.Remove(dev.Name); - foreach (AlsaSeqLib.Port connectedport in dev.ConnectedPorts) { - midiport.Deconnecte ( connectedport); + foreach (AlsaSeqLib.Port connectedport in dev.ConnectedPorts) + { + midiport.Deconnecte(connectedport); } } - public bool IsKnownDevice (string name) + public bool IsKnownDevice(string name) { - return knowndevices.ContainsKey (name); + return knowndevices.ContainsKey(name); } - public IEnumerable KnownDevices { - get { + public IEnumerable KnownDevices + { + get + { return knowndevices.Values; } } - public MidiEventProvider (EventManager manager) + public MidiEventProvider(EventManager manager) { #if DEBUG MidiControler dev = new MidiControler("VMPK Input:VMPK Input"); dev.HasFeedback = true; - knowndevices.Add(dev.Name,dev); + knowndevices.Add(dev.Name, dev); dev = new MidiControler("VMPK Output:VMPK Output"); dev.HasFeedback = true; - knowndevices.Add(dev.Name,dev); + knowndevices.Add(dev.Name, dev); #endif - manager.RegisterProvider (this); + manager.RegisterProvider(this); //AlsaSeqLib.Init (); midiport = new AlsaSeqLib.MidiPort("event_prov_in_out"); - - AutoConnect (); + //midiport.ConnectFrom(AlsaSeqLib.SND_SEQ_CLIENT_SYSTEM, AlsaSeqLib.SND_SEQ_PORT_SYSTEM_ANNOUNCE); + AlsaSeqLib.Port systemport = AlsaSeqLib.GetPortByIDs(AlsaSeqLib.SND_SEQ_CLIENT_SYSTEM, AlsaSeqLib.SND_SEQ_PORT_SYSTEM_ANNOUNCE); + midiport.ConnectFrom(systemport); + + AutoConnect(); } - void AutoConnect () + void AutoConnect() { - foreach (var cli in AlsaSeqLib.EnumClients()) { - foreach (var p in cli.Ports) { - PortDetected (cli, p); + foreach (var cli in AlsaSeqLib.EnumClients()) + { + foreach (var p in cli.Ports) + { + PortDetected(cli, p); } } } - void PortDetected (AlsaSeqLib.Client cli, AlsaSeqLib.Port p) + void PortDetected(AlsaSeqLib.Client cli, AlsaSeqLib.Port p) { // Execute a chaque 'apparition' d'un port midi @@ -208,39 +243,44 @@ namespace DMX2 guirefreshflag = true; string fullportname = cli.Name + ':' + p.Name; - if (knowndevices.ContainsKey (fullportname)) { + if (knowndevices.ContainsKey(fullportname)) + { int srcid = p.ClientId << 8 + p.PortId; - if (knowndevices [fullportname].ConnectedPorts.Contains (p)) + if (knowndevices[fullportname].ConnectedPorts.Contains(p)) return; midiport.ConnectFrom(p); midiport.ConnectTo(p); } } - - void PortConnect (AlsaSeqLib.snd_seq_connect_t cn, bool connect) + + void PortConnect(AlsaSeqLib.snd_seq_connect_t cn, bool connect) { int clientId, portId; - if (cn.dest.client == AlsaSeqLib.ClientId) { + if (cn.dest.client == AlsaSeqLib.ClientId) + { clientId = cn.sender.client; portId = cn.sender.port; - } else { + } + else + { clientId = cn.dest.client; portId = cn.dest.port; } - AlsaSeqLib.Port p = AlsaSeqLib.GetPortByIDs(clientId, portId); + AlsaSeqLib.Port p = AlsaSeqLib.GetPortByIDs(clientId, portId); - if (connect) { + if (connect) + { AlsaSeqLib.Client c = AlsaSeqLib.GetClientByID(clientId); string fpname = c.Name + ":" + p.Name; - if (!knowndevices.ContainsKey (fpname)) + if (!knowndevices.ContainsKey(fpname)) return; - if (knowndevices [fpname].ConnectedPorts.Contains (p)) + if (knowndevices[fpname].ConnectedPorts.Contains(p)) return; - knowndevices [fpname].ConnectedPorts.Add (p); - if (knowndevices [fpname].HasFeedback) - feedbacksources.Add (p); + knowndevices[fpname].ConnectedPorts.Add(p); + if (knowndevices[fpname].HasFeedback) + feedbacksources.Add(p); guirefreshflag = true; //srcidToDev[srcid] = knowndevices [fpname]; @@ -248,9 +288,11 @@ namespace DMX2 return; } - foreach (var dev in knowndevices.Values) { - if (dev.ConnectedPorts.Contains (p)) { - dev.ConnectedPorts.Remove (p); + foreach (var dev in knowndevices.Values) + { + if (dev.ConnectedPorts.Contains(p)) + { + dev.ConnectedPorts.Remove(p); guirefreshflag = true; return; } @@ -258,32 +300,36 @@ namespace DMX2 } - static int CombineHash (int hash1, int hash2) + static int CombineHash(int hash1, int hash2) { - unchecked { + unchecked + { return hash1 * 33 + hash2; } } - protected bool HasFeedback (AlsaSeqLib.Port source) + protected bool HasFeedback(AlsaSeqLib.Port source) { - return feedbacksources.Contains (source); + return feedbacksources.Contains(source); } - public void SendEvent (AlsaSeqLib.snd_seq_event_t ev) + public void SendEvent(AlsaSeqLib.snd_seq_event_t ev) { - midiport.SendEvent (ev); + midiport.SendEvent(ev); } - - public void Refresh () + + public void Refresh() { - foreach (var ievent in eventlist.Values) { - if (ievent.Page == page) { + foreach (var ievent in eventlist.Values) + { + if (ievent.Page == page) + { ievent.SendFeedback(); - foreach (AlsaSeqLib.Port src in feedbacksources) { - int lnvk = CombineHash (src.SrcId, ievent.MidiEvCode); + foreach (AlsaSeqLib.Port src in feedbacksources) + { + int lnvk = CombineHash(src.SrcId, ievent.MidiEvCode); if (ievent.LastKnownValue != -1) - lastValueOfSrc [lnvk] = (byte)ievent.LastKnownValue; + lastValueOfSrc[lnvk] = (byte)ievent.LastKnownValue; } } } @@ -293,299 +339,327 @@ namespace DMX2 - bool IEventProvider.Bind (string eventId) + bool IEventProvider.Bind(string eventId) { // On indique a l'EventManager qu'on traite, si l'ID commence par 'MIDI-' - if (! eventId.StartsWith ("MIDI-")) + if (!eventId.StartsWith("MIDI-")) return false; - if (! eventlist.ContainsKey (eventId)) { - Match res = regexEventID.Match (eventId); + if (!eventlist.ContainsKey(eventId)) + { + Match res = regexEventID.Match(eventId); if (!res.Success) return false; - uint _page = uint.Parse (res.Groups ["page"].Value); - int _evHC = res.Groups ["id"].Value.GetHashCode (); + uint _page = uint.Parse(res.Groups["page"].Value); + int _evHC = res.Groups["id"].Value.GetHashCode(); midiFeedbackSender sender = null; - res = regexCtrlEventID.Match (eventId); - if (res.Success) { - byte chan = byte.Parse (res.Groups ["chan"].Value); - uint param = uint.Parse (res.Groups ["param"].Value); - sender = new midiCCFbSender (this, chan, param); - } else if ((res = regexPbEventID.Match (eventId)).Success){ - byte chan = byte.Parse (res.Groups ["chan"].Value); - sender = new midiPBFbSender (this, chan); + res = regexCtrlEventID.Match(eventId); + if (res.Success) + { + byte chan = byte.Parse(res.Groups["chan"].Value); + uint param = uint.Parse(res.Groups["param"].Value); + sender = new midiCCFbSender(this, chan, param); } - eventlist.Add (eventId, new internalEventDesc (eventId, _page, _evHC,sender)); + else if ((res = regexPbEventID.Match(eventId)).Success) + { + byte chan = byte.Parse(res.Groups["chan"].Value); + sender = new midiPBFbSender(this, chan); + } + eventlist.Add(eventId, new internalEventDesc(eventId, _page, _evHC, sender)); } - eventlist [eventId].Bound = true; + eventlist[eventId].Bound = true; return true; } - void IEventProvider.Unbind (string eventId) + void IEventProvider.Unbind(string eventId) { - if (! eventlist.ContainsKey (eventId)) + if (!eventlist.ContainsKey(eventId)) return; - eventlist [eventId].Bound = false; + eventlist[eventId].Bound = false; return; } - Gtk.Menu IEventProvider.GetProviderSubMenu (EventManager.EventMenuData state, Gtk.ButtonPressEventHandler handler) + Gtk.Menu IEventProvider.GetProviderSubMenu(EventManager.EventMenuData state, Gtk.ButtonPressEventHandler handler) { - Gtk.Menu retmenu = new Gtk.Menu (); + Gtk.Menu retmenu = new Gtk.Menu(); - if (levent != null) { // Creation du sous menu "Dernier" - /*Gtk.MenuItem lmenuitem = new Gtk.MenuItem ("Dernier"); - retmenu.Add (lmenuitem); - Gtk.Menu lmenu = new Gtk.Menu (); - lmenuitem.Submenu = lmenu;*/ - Gtk.MenuItem item = new Gtk.MenuItem (GetDescription (levent.InternalName)); - item.Data [EventManager.EventIdKey] = levent.InternalName; - item.Data [EventManager.StateKey] = state; + if (levent != null) + { // Creation du sous menu "Dernier" + /*Gtk.MenuItem lmenuitem = new Gtk.MenuItem ("Dernier"); + retmenu.Add (lmenuitem); + Gtk.Menu lmenu = new Gtk.Menu (); + lmenuitem.Submenu = lmenu;*/ + Gtk.MenuItem item = new Gtk.MenuItem(GetDescription(levent.InternalName)); + item.Data[EventManager.EventIdKey] = levent.InternalName; + item.Data[EventManager.StateKey] = state; item.ButtonPressEvent += handler; - retmenu.Add (item); + retmenu.Add(item); } - Gtk.MenuItem evmenuitem = new Gtk.MenuItem ("Events"); // Creation du sous menu "Events" - retmenu.Add (evmenuitem); - Gtk.Menu evmenu = new Gtk.Menu (); + Gtk.MenuItem evmenuitem = new Gtk.MenuItem("Events"); // Creation du sous menu "Events" + retmenu.Add(evmenuitem); + Gtk.Menu evmenu = new Gtk.Menu(); evmenuitem.Submenu = evmenu; - List sortedKeys = eventlist.Keys.ToList (); // On recupere des IDs - sortedKeys.Sort (); // et on les trie + List sortedKeys = eventlist.Keys.ToList(); // On recupere des IDs + sortedKeys.Sort(); // et on les trie - foreach (string key in sortedKeys) { - internalEventDesc evt = eventlist [key]; - Gtk.MenuItem item = new Gtk.MenuItem (GetDescription (evt.InternalName)); - item.Data [EventManager.EventIdKey] = evt.InternalName; - item.Data [EventManager.StateKey] = state; + foreach (string key in sortedKeys) + { + internalEventDesc evt = eventlist[key]; + Gtk.MenuItem item = new Gtk.MenuItem(GetDescription(evt.InternalName)); + item.Data[EventManager.EventIdKey] = evt.InternalName; + item.Data[EventManager.StateKey] = state; item.ButtonPressEvent += handler; - evmenu.Add (item); + evmenu.Add(item); } return retmenu; } - void IEventProvider.ProcessEvents (EventManagerCallback callback) + void IEventProvider.ProcessEvents(EventManagerCallback callback) { AlsaSeqLib.snd_seq_event_t evS; uint evpage; // Tant qu'il y des evenements midi en attente - while (midiport.GetEvent(out evS)) { - Console.WriteLine(string.Format ("event {0}", evS.type) ); - string id = null; + while (midiport.GetEvent(out evS)) + { + Console.WriteLine(string.Format("event {0}", evS.type)); + string id = null; int value = 0; byte channel = 255; - switch (evS.type) { - case AlsaSeqLib.snd_seq_event_type_t.SND_SEQ_EVENT_PORT_SUBSCRIBED: // Connection d'un périph midi - case AlsaSeqLib.snd_seq_event_type_t.SND_SEQ_EVENT_PORT_UNSUBSCRIBED: - PortConnect ( - evS.data_connect, - evS.type == AlsaSeqLib.snd_seq_event_type_t.SND_SEQ_EVENT_PORT_SUBSCRIBED - ); - continue; - case AlsaSeqLib.snd_seq_event_type_t.SND_SEQ_EVENT_CONTROLLER: - if (evS.data_ev_ctrl.param == pageUpCC && evS.data_ev_ctrl.value > 0) { - CurrentPage++; + switch (evS.type) + { + case AlsaSeqLib.snd_seq_event_type_t.SND_SEQ_EVENT_PORT_SUBSCRIBED: // Connection d'un périph midi + case AlsaSeqLib.snd_seq_event_type_t.SND_SEQ_EVENT_PORT_UNSUBSCRIBED: + PortConnect( + evS.data_connect, + evS.type == AlsaSeqLib.snd_seq_event_type_t.SND_SEQ_EVENT_PORT_SUBSCRIBED + ); continue; - } - - if (evS.data_ev_ctrl.param == pageDownCC && evS.data_ev_ctrl.value > 0) { - CurrentPage--; - continue; - } - - channel = evS.data_ev_ctrl.channel; - - if (use14b && evS.data_ev_ctrl.param < 64) { - long msbAddr; - if (evS.data_ev_ctrl.param < 32) { - msbAddr = evS.data_ev_ctrl.channel * 32 + evS.data_ev_ctrl.param; - fbTmpData [msbAddr] = (byte)evS.data_ev_ctrl.value; + case AlsaSeqLib.snd_seq_event_type_t.SND_SEQ_EVENT_CONTROLLER: + if (evS.data_ev_ctrl.param == pageUpCC && evS.data_ev_ctrl.value > 0) + { + CurrentPage++; continue; } - evS.data_ev_ctrl.param -= 32; - msbAddr = evS.data_ev_ctrl.channel * 32 + evS.data_ev_ctrl.param; - value = ((fbTmpData [msbAddr] << 7) ^ evS.data_ev_ctrl.value); - value = 255 * value / max14bValue; - if (value > 255) value = 255; - } else { - value = 255 * evS.data_ev_ctrl.value / 127; // Conversion {0,127} => {0,255} - } - id = string.Format ("CTRL-C{0}P{1}", evS.data_ev_ctrl.channel, evS.data_ev_ctrl.param); - break; - case AlsaSeqLib.snd_seq_event_type_t.SND_SEQ_EVENT_NOTEON: - id = string.Format ("NOTE-C{0}N{1}", evS.data_ev_note.channel, evS.data_ev_note.note); - channel = evS.data_ev_note.channel; - value = 255; - break; - case AlsaSeqLib.snd_seq_event_type_t.SND_SEQ_EVENT_NOTEOFF: - id = string.Format ("NOTE-C{0}N{1}", evS.data_ev_note.channel, evS.data_ev_note.note); - channel = evS.data_ev_note.channel; - value = 0; - break; - case AlsaSeqLib.snd_seq_event_type_t.SND_SEQ_EVENT_PITCHBEND: - id = string.Format ("PB-C{0}", evS.data_ev_ctrl.channel); - channel = evS.data_ev_ctrl.channel; - value = ((evS.data_ev_ctrl.value + 7000) * 255 / 14000); - if (value < 0) - value = 0; - if (value > 255) + + if (evS.data_ev_ctrl.param == pageDownCC && evS.data_ev_ctrl.value > 0) + { + CurrentPage--; + continue; + } + + channel = evS.data_ev_ctrl.channel; + + if (use14b && evS.data_ev_ctrl.param < 64) + { + long msbAddr; + if (evS.data_ev_ctrl.param < 32) + { + msbAddr = evS.data_ev_ctrl.channel * 32 + evS.data_ev_ctrl.param; + fbTmpData[msbAddr] = (byte)evS.data_ev_ctrl.value; + continue; + } + evS.data_ev_ctrl.param -= 32; + msbAddr = evS.data_ev_ctrl.channel * 32 + evS.data_ev_ctrl.param; + value = ((fbTmpData[msbAddr] << 7) ^ evS.data_ev_ctrl.value); + value = 255 * value / max14bValue; + if (value > 255) value = 255; + } + else + { + value = 255 * evS.data_ev_ctrl.value / 127; // Conversion {0,127} => {0,255} + } + id = string.Format("CTRL-C{0}P{1}", evS.data_ev_ctrl.channel, evS.data_ev_ctrl.param); + break; + case AlsaSeqLib.snd_seq_event_type_t.SND_SEQ_EVENT_NOTEON: + id = string.Format("NOTE-C{0}N{1}", evS.data_ev_note.channel, evS.data_ev_note.note); + channel = evS.data_ev_note.channel; value = 255; - break; - case AlsaSeqLib.snd_seq_event_type_t.SND_SEQ_EVENT_PGMCHANGE: - CurrentPage = (uint)evS.data_ev_ctrl.value; - continue; + break; + case AlsaSeqLib.snd_seq_event_type_t.SND_SEQ_EVENT_NOTEOFF: + id = string.Format("NOTE-C{0}N{1}", evS.data_ev_note.channel, evS.data_ev_note.note); + channel = evS.data_ev_note.channel; + value = 0; + break; + case AlsaSeqLib.snd_seq_event_type_t.SND_SEQ_EVENT_PITCHBEND: + id = string.Format("PB-C{0}", evS.data_ev_ctrl.channel); + channel = evS.data_ev_ctrl.channel; + value = ((evS.data_ev_ctrl.value + 7000) * 255 / 14000); + if (value < 0) + value = 0; + if (value > 255) + value = 255; + break; + case AlsaSeqLib.snd_seq_event_type_t.SND_SEQ_EVENT_PGMCHANGE: + CurrentPage = (uint)evS.data_ev_ctrl.value; + continue; + case AlsaSeqLib.snd_seq_event_type_t.SND_SEQ_EVENT_PORT_START: + PortDetected( + AlsaSeqLib.GetClientByID(evS.data_addr.client), + AlsaSeqLib.GetPortByIDs(evS.data_addr.client,evS.data_addr.port) + ); + continue; + /*case AlsaSeqLib.snd_seq_event_type_t.SND_SEQ_EVENT_CLOCK: + case AlsaSeqLib.snd_seq_event_type_t.SND_SEQ_EVENT_SENSING: + continue;*/ - - /*case AlsaSeqLib.snd_seq_event_type_t.SND_SEQ_EVENT_CLOCK: - case AlsaSeqLib.snd_seq_event_type_t.SND_SEQ_EVENT_SENSING: - continue;*/ - - default: - id = null; + default: + id = null; #if DEBUG - Console.WriteLine(string.Format ("event {0}", evS.type) ); - Info.Publish(string.Format ("event {0}", evS.type) ); // On affiche les evenements inconnus + Console.WriteLine(string.Format("event {0}", evS.type)); + Info.Publish(string.Format("event {0}", evS.type)); // On affiche les evenements inconnus #endif - continue; + continue; } - if (id != null) { + if (id != null) + { // Hashcode de l'ev Midi, non pagine - int evHC = id.GetHashCode (); + int evHC = id.GetHashCode(); int srcid = evS.source.client << 8 + evS.source.port; - int lnvk = CombineHash (srcid, evHC); + int lnvk = CombineHash(srcid, evHC); - if (channel == 255 || unpaginatedchannels.Contains (channel)) + if (channel == 255 || unpaginatedchannels.Contains(channel)) evpage = 0; else evpage = page; // Construction de l'ID evenement - id = string.Format ("MIDI-PAGE{0}-{1}", evpage, id); - + id = string.Format("MIDI-PAGE{0}-{1}", evpage, id); + // Creation de l'objet interne si innexistant - if (!eventlist.ContainsKey (id)) { - switch (evS.type) { + if (!eventlist.ContainsKey(id)) + { + switch (evS.type) + { // TODO : Pitchbend feedback - case AlsaSeqLib.snd_seq_event_type_t.SND_SEQ_EVENT_CONTROLLER: - eventlist.Add (id, new internalEventDesc (id, evpage, evHC, - new midiCCFbSender(this,channel,evS.data_ev_ctrl.param)) - ); - break; - case AlsaSeqLib.snd_seq_event_type_t.SND_SEQ_EVENT_PITCHBEND: - eventlist.Add (id, new internalEventDesc (id, evpage, evHC, - new midiPBFbSender(this,channel)) - ); - break; - default: - eventlist.Add (id, new internalEventDesc (id, evpage, evHC, null)); - break; + case AlsaSeqLib.snd_seq_event_type_t.SND_SEQ_EVENT_CONTROLLER: + eventlist.Add(id, new internalEventDesc(id, evpage, evHC, + new midiCCFbSender(this, channel, evS.data_ev_ctrl.param)) + ); + break; + case AlsaSeqLib.snd_seq_event_type_t.SND_SEQ_EVENT_PITCHBEND: + eventlist.Add(id, new internalEventDesc(id, evpage, evHC, + new midiPBFbSender(this, channel)) + ); + break; + default: + eventlist.Add(id, new internalEventDesc(id, evpage, evHC, null)); + break; } } - levent = eventlist [id]; //Dernier Evenement recu conserve pour menu + levent = eventlist[id]; //Dernier Evenement recu conserve pour menu - if (!lastValueOfSrc.ContainsKey (lnvk)) { - lastValueOfSrc [lnvk] = (byte)value; - } else if (lastValueOfSrc [lnvk] == (byte)value) + if (!lastValueOfSrc.ContainsKey(lnvk)) + { + lastValueOfSrc[lnvk] = (byte)value; + } + else if (lastValueOfSrc[lnvk] == (byte)value) continue; - EventData evData = new EventData (); + EventData evData = new EventData(); evData.id = id; evData.value = (byte)value; - evData.prev_value = lastValueOfSrc [lnvk]; + evData.prev_value = lastValueOfSrc[lnvk]; /*if (evData.Equals (last)) - continue; */ + continue; */ //last = evData; - eventlist [id].CallEvent (callback, evData); + eventlist[id].CallEvent(callback, evData); /*if (eventlist [id].Bound) { callback (evData); }*/ - lastValueOfSrc [lnvk] = (byte)value; - eventlist [id].LastKnownValue = (byte)value; + lastValueOfSrc[lnvk] = (byte)value; + eventlist[id].LastKnownValue = (byte)value; } } } - string IEventProvider.MenuName { - get { + string IEventProvider.MenuName + { + get + { return "Midi"; } } - static System.Text.RegularExpressions.Regex regexEventID = new System.Text.RegularExpressions.Regex ( + static System.Text.RegularExpressions.Regex regexEventID = new System.Text.RegularExpressions.Regex( @"MIDI-PAGE(?\d+)-(?.+)", System.Text.RegularExpressions.RegexOptions.Compiled); - static System.Text.RegularExpressions.Regex regexCtrlEventID = new System.Text.RegularExpressions.Regex ( + static System.Text.RegularExpressions.Regex regexCtrlEventID = new System.Text.RegularExpressions.Regex( @"MIDI-PAGE(?\d+)-CTRL-C(?\d+)P(?\d+)", System.Text.RegularExpressions.RegexOptions.Compiled); - static System.Text.RegularExpressions.Regex regexPbEventID = new System.Text.RegularExpressions.Regex ( + static System.Text.RegularExpressions.Regex regexPbEventID = new System.Text.RegularExpressions.Regex( @"MIDI-PAGE(?\d+)-PB-C(?\d+)", System.Text.RegularExpressions.RegexOptions.Compiled); - static System.Text.RegularExpressions.Regex regexNoteEventID = new System.Text.RegularExpressions.Regex ( + static System.Text.RegularExpressions.Regex regexNoteEventID = new System.Text.RegularExpressions.Regex( @"MIDI-PAGE(?\d+)-NOTE-C(?\d+)N(?\d+)", System.Text.RegularExpressions.RegexOptions.Compiled); - string GetDescription (string eventId) + string GetDescription(string eventId) { - if (!eventlist.ContainsKey (eventId)) + if (!eventlist.ContainsKey(eventId)) return null; - var res = regexCtrlEventID.Match (eventId); - if (res.Success) { - uint page = uint.Parse (res.Groups ["page"].Value); - byte chan = byte.Parse (res.Groups ["chan"].Value); - uint param = uint.Parse (res.Groups ["param"].Value); - return string.Format ("Page {2} => Control-Change C({0}) Param-{1}", chan + 1, param, page); + var res = regexCtrlEventID.Match(eventId); + if (res.Success) + { + uint page = uint.Parse(res.Groups["page"].Value); + byte chan = byte.Parse(res.Groups["chan"].Value); + uint param = uint.Parse(res.Groups["param"].Value); + return string.Format("Page {2} => Control-Change C({0}) Param-{1}", chan + 1, param, page); } - res = regexPbEventID.Match (eventId); - if (res.Success) { - uint page = uint.Parse (res.Groups ["page"].Value); - byte chan = byte.Parse (res.Groups ["chan"].Value); - return string.Format ("Page {1} => PitchBend C({0})", chan + 1, page); + res = regexPbEventID.Match(eventId); + if (res.Success) + { + uint page = uint.Parse(res.Groups["page"].Value); + byte chan = byte.Parse(res.Groups["chan"].Value); + return string.Format("Page {1} => PitchBend C({0})", chan + 1, page); } - res = regexNoteEventID.Match (eventId); - if (res.Success) { - uint page = uint.Parse (res.Groups ["page"].Value); - byte chan = byte.Parse (res.Groups ["chan"].Value); - byte note = byte.Parse (res.Groups ["note"].Value); - return string.Format ("Page {2} => Note C({0}) Note-{1}", chan + 1, note, page); + res = regexNoteEventID.Match(eventId); + if (res.Success) + { + uint page = uint.Parse(res.Groups["page"].Value); + byte chan = byte.Parse(res.Groups["chan"].Value); + byte note = byte.Parse(res.Groups["note"].Value); + return string.Format("Page {2} => Note C({0}) Note-{1}", chan + 1, note, page); } return eventId; } - IFeedbackInfo IEventProvider.GetFeedbackInfo (string eventId) + IFeedbackInfo IEventProvider.GetFeedbackInfo(string eventId) { - if (!eventlist.ContainsKey (eventId)) + if (!eventlist.ContainsKey(eventId)) return null; - return new midifeedbackinfo (this, eventlist [eventId]); + return new midifeedbackinfo(this, eventlist[eventId]); } - #endregion + #endregion #region IDisposable implementation bool disposed = false; - ~MidiEventProvider () + ~MidiEventProvider() { - Dispose (); + Dispose(); } - public void Dispose () + public void Dispose() { if (disposed) return; @@ -596,57 +670,61 @@ namespace DMX2 } #endregion - public void Save (System.Xml.XmlElement parent) + public void Save(System.Xml.XmlElement parent) { - System.Xml.XmlElement el = parent.OwnerDocument.CreateElement ("Midi"); - parent.AppendChild (el); - el.SetAttribute ("maxpage", maxpage.ToString ()); - el.SetAttribute ("pageUpCC", pageUpCC.ToString ()); - el.SetAttribute ("pageDownCC", pageDownCC.ToString ()); - el.SetAttribute ("fourteenbits", use14b?"true":"false"); - el.SetAttribute ("max14b", max14bValue.ToString ()); + System.Xml.XmlElement el = parent.OwnerDocument.CreateElement("Midi"); + parent.AppendChild(el); + el.SetAttribute("maxpage", maxpage.ToString()); + el.SetAttribute("pageUpCC", pageUpCC.ToString()); + el.SetAttribute("pageDownCC", pageDownCC.ToString()); + el.SetAttribute("fourteenbits", use14b ? "true" : "false"); + el.SetAttribute("max14b", max14bValue.ToString()); System.Xml.XmlElement xmlEl; - foreach (MidiControler dev in knowndevices.Values) { - el.AppendChild (xmlEl = parent.OwnerDocument.CreateElement ("MidiDev")); - xmlEl.SetAttribute ("name", dev.Name); - xmlEl.SetAttribute ("feedback", dev.HasFeedback.ToString ()); + foreach (MidiControler dev in knowndevices.Values) + { + el.AppendChild(xmlEl = parent.OwnerDocument.CreateElement("MidiDev")); + xmlEl.SetAttribute("name", dev.Name); + xmlEl.SetAttribute("feedback", dev.HasFeedback.ToString()); } - foreach (byte ch in unpaginatedchannels) { - el.AppendChild (xmlEl = parent.OwnerDocument.CreateElement ("UPC")); - xmlEl.SetAttribute ("ch", ch.ToString ()); + foreach (byte ch in unpaginatedchannels) + { + el.AppendChild(xmlEl = parent.OwnerDocument.CreateElement("UPC")); + xmlEl.SetAttribute("ch", ch.ToString()); } } - public void Load (System.Xml.XmlElement el) + public void Load(System.Xml.XmlElement el) { if (el == null) return; - maxpage = uint.Parse (el.TryGetAttribute ("maxpage", "8")); - pageUpCC = uint.Parse (el.TryGetAttribute ("pageUpCC", "127")); - pageDownCC = uint.Parse (el.TryGetAttribute ("pageDownCC", "126")); - use14b = el.TryGetAttribute ("fourteenbits", string.Empty).Equals ("true"); - max14bValue = int.Parse (el.TryGetAttribute ("max14b", "255")); + maxpage = uint.Parse(el.TryGetAttribute("maxpage", "8")); + pageUpCC = uint.Parse(el.TryGetAttribute("pageUpCC", "127")); + pageDownCC = uint.Parse(el.TryGetAttribute("pageDownCC", "126")); + use14b = el.TryGetAttribute("fourteenbits", string.Empty).Equals("true"); + max14bValue = int.Parse(el.TryGetAttribute("max14b", "255")); - foreach (var xd in el.GetElementsByTagName("MidiDev")) { + foreach (var xd in el.GetElementsByTagName("MidiDev")) + { System.Xml.XmlElement xdev = xd as System.Xml.XmlElement; - string name = xdev.GetAttribute ("name"); - if (!knowndevices.ContainsKey (name)) - knowndevices.Add (name, new MidiControler (name)); - knowndevices [name].HasFeedback = bool.Parse (xdev.TryGetAttribute ("feedback", "false")); + string name = xdev.GetAttribute("name"); + if (!knowndevices.ContainsKey(name)) + knowndevices.Add(name, new MidiControler(name)); + knowndevices[name].HasFeedback = bool.Parse(xdev.TryGetAttribute("feedback", "false")); } - unpaginatedchannels.Clear (); - foreach (var xu in el.GetElementsByTagName("UPC")) { + unpaginatedchannels.Clear(); + foreach (var xu in el.GetElementsByTagName("UPC")) + { System.Xml.XmlElement xupc = xu as System.Xml.XmlElement; - unpaginatedchannels.Add (byte.Parse (xupc.GetAttribute ("ch"))); + unpaginatedchannels.Add(byte.Parse(xupc.GetAttribute("ch"))); } - AutoConnect (); + AutoConnect(); } - + class internalEventDesc { @@ -657,34 +735,43 @@ namespace DMX2 readonly midiFeedbackSender fbSender; - public bool Bound { - get { + public bool Bound + { + get + { return bound; } - set { + set + { bound = value; } } - public string InternalName { - get { + public string InternalName + { + get + { return internalName; } } - public uint Page { - get { + public uint Page + { + get + { return page; } } - public int MidiEvCode { - get { + public int MidiEvCode + { + get + { return midiEvCode; } } - public internalEventDesc (string _id, uint _page, int _evHCode, midiFeedbackSender _evsender) + public internalEventDesc(string _id, uint _page, int _evHCode, midiFeedbackSender _evsender) { internalName = _id; page = _page; @@ -694,42 +781,48 @@ namespace DMX2 int lastknownvalue = -1; - public int LastKnownValue { - get { + public int LastKnownValue + { + get + { return lastknownvalue; } - set { + set + { lastknownvalue = value; } } - bool nofbflag=false; + bool nofbflag = false; - public void SendFeedback () + public void SendFeedback() { - if(fbSender !=null && !nofbflag) - fbSender.SendFeedback (lastknownvalue); + if (fbSender != null && !nofbflag) + fbSender.SendFeedback(lastknownvalue); } - public void CallEvent (EventManagerCallback callback, EventData evData) + public void CallEvent(EventManagerCallback callback, EventData evData) { nofbflag = true; - callback (evData); + callback(evData); nofbflag = false; } } - abstract class midiFeedbackSender { - public abstract void SendFeedback (int value); + abstract class midiFeedbackSender + { + public abstract void SendFeedback(int value); } - class midiCCFbSender : midiFeedbackSender { + class midiCCFbSender : midiFeedbackSender + { readonly MidiEventProvider prov; AlsaSeqLib.snd_seq_event_t ev; AlsaSeqLib.snd_seq_event_t ev2; - public midiCCFbSender (MidiEventProvider _prov, byte _chan, uint _param){ + public midiCCFbSender(MidiEventProvider _prov, byte _chan, uint _param) + { prov = _prov; ev = new AlsaSeqLib.snd_seq_event_t(); ev.type = AlsaSeqLib.snd_seq_event_type_t.SND_SEQ_EVENT_CONTROLLER; @@ -738,39 +831,44 @@ namespace DMX2 ev2 = ev; ev2.data_ev_ctrl.param += 32; } - public override void SendFeedback (int value) + public override void SendFeedback(int value) { - if (prov.use14b && ev.data_ev_ctrl.param <32 ) { + if (prov.use14b && ev.data_ev_ctrl.param < 32) + { value = value * prov.max14bValue / 255; ev.data_ev_ctrl.value = value >> 7; ev2.data_ev_ctrl.value = value & 0xFF; - prov.SendEvent (ev); - prov.SendEvent (ev2); - } else { + prov.SendEvent(ev); + prov.SendEvent(ev2); + } + else + { ev.data_ev_ctrl.value = value * 127 / 255; - prov.SendEvent (ev); + prov.SendEvent(ev); } } } - class midiPBFbSender : midiFeedbackSender { + class midiPBFbSender : midiFeedbackSender + { readonly MidiEventProvider prov; AlsaSeqLib.snd_seq_event_t ev; - public midiPBFbSender (MidiEventProvider _prov, byte _chan){ + public midiPBFbSender(MidiEventProvider _prov, byte _chan) + { prov = _prov; ev = new AlsaSeqLib.snd_seq_event_t(); ev.type = AlsaSeqLib.snd_seq_event_type_t.SND_SEQ_EVENT_PITCHBEND; ev.data_ev_ctrl.channel = _chan; } - public override void SendFeedback (int value) + public override void SendFeedback(int value) { // value = ((evS.data_ev_ctrl.value + 7000) * 255 / 14000); ev.data_ev_ctrl.value = value * 14000 / 255 - 7000; - prov.SendEvent (ev); + prov.SendEvent(ev); } } @@ -779,24 +877,26 @@ namespace DMX2 MidiEventProvider prov; readonly internalEventDesc iev; - public midifeedbackinfo (MidiEventProvider _prov, internalEventDesc _iev) + public midifeedbackinfo(MidiEventProvider _prov, internalEventDesc _iev) { prov = _prov; iev = _iev; } #region IFeedbackInfo implementation - bool IFeedbackInfo.FeedBack (byte data) + bool IFeedbackInfo.FeedBack(byte data) { - + iev.LastKnownValue = data; - if (prov.CurrentPage == iev.Page || iev.Page == 0) { + if (prov.CurrentPage == iev.Page || iev.Page == 0) + { iev.SendFeedback(); - foreach (AlsaSeqLib.Port src in prov.feedbacksources) { - int lnvk = CombineHash (src.SrcId, iev.MidiEvCode); + foreach (AlsaSeqLib.Port src in prov.feedbacksources) + { + int lnvk = CombineHash(src.SrcId, iev.MidiEvCode); if (iev.LastKnownValue != -1) - prov.lastValueOfSrc [lnvk] = (byte)iev.LastKnownValue; + prov.lastValueOfSrc[lnvk] = (byte)iev.LastKnownValue; } } @@ -813,13 +913,14 @@ namespace DMX2 public bool HasFeedback { get; set; } - readonly List connected = new List (); + readonly List connected = new List(); - public List ConnectedPorts { - get{ return connected;} + public List ConnectedPorts + { + get { return connected; } } - public MidiControler (string _name) + public MidiControler(string _name) { name = _name; } From b3eda5f5d96f440c49bc5727eaeafb1c56f774c2 Mon Sep 17 00:00:00 2001 From: tzim Date: Sat, 6 Oct 2018 23:43:22 +0200 Subject: [PATCH 18/22] Changement gitignore ajout .vs --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 3f1929a..4c807e6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ DMX-2.0.userprefs DMX-2.0/bin/ DMX-2.0/obj/ - +.vs \ No newline at end of file From 52f56202bfba13b36c8f99f8ae86ce1a61e2bdee Mon Sep 17 00:00:00 2001 From: tzim Date: Sun, 7 Oct 2018 00:51:39 +0200 Subject: [PATCH 19/22] SeqMidiUI : Ajout Combo et premiers tests --- DMX-2.0/SeqMidiUI.cs | 24 +++++++++++++-- DMX-2.0/gtk-gui/DMX2.SeqMidiUI.cs | 50 ++++++++++++++++++------------- DMX-2.0/gtk-gui/gui.stetic | 15 +++++++++- 3 files changed, 65 insertions(+), 24 deletions(-) diff --git a/DMX-2.0/SeqMidiUI.cs b/DMX-2.0/SeqMidiUI.cs index d6b7f0b..f4f910a 100644 --- a/DMX-2.0/SeqMidiUI.cs +++ b/DMX-2.0/SeqMidiUI.cs @@ -26,11 +26,14 @@ namespace DMX2 [System.ComponentModel.ToolboxItem(true)] public partial class SeqMidiUI : SequenceurUI { + bool fullUpdFlag = true; bool updating; SequenceurMidi sequenceur; /* pointe sur les données */ - ListStore lsEffets=null; /* liste des effets */ - //TreeViewColumn nomCol; /* inutile dans le contexte macro */ + ListStore lsEffets=null; /* liste des effets */ + //TreeViewColumn nomCol; /* inutile dans le contexte macro */ + + ListStore lsDest = null; bool effetChange = false; public void EffetChange () @@ -186,6 +189,13 @@ namespace DMX2 } } + void HandleCellLayoutDataFunc(CellLayout cell_layout, CellRenderer cell, TreeModel tree_model, TreeIter iter) + { + var s = (tree_model.GetValue(iter, 0) as string); + (cell as Gtk.CellRendererText).Text = "<<-- " + s + " -->>"; + } + + #endregion public SeqMidiUI (SequenceurMidi s ) : base (s) @@ -194,11 +204,19 @@ namespace DMX2 titreLabel.Text = s.Name; sequenceur = s; ConstruitMatrice (); - + + new ContextMenuHelper(frame1,RenamePopup); new ContextMenuHelper(evBBox,CompteurPopup); + lsDest = new ListStore(typeof(string)); + lsDest.AppendValues("TEST 1"); + lsDest.AppendValues("TEST 2"); + + cbDest.Model = lsDest; + + cbDest.SetCellDataFunc(cbDest.Cells[0], HandleCellLayoutDataFunc); } diff --git a/DMX-2.0/gtk-gui/DMX2.SeqMidiUI.cs b/DMX-2.0/gtk-gui/DMX2.SeqMidiUI.cs index dd8be9c..c57243b 100644 --- a/DMX-2.0/gtk-gui/DMX2.SeqMidiUI.cs +++ b/DMX-2.0/gtk-gui/DMX2.SeqMidiUI.cs @@ -44,6 +44,8 @@ namespace DMX2 private global::Gtk.Label timeLabel; + private global::Gtk.ComboBox cbDest; + private global::Gtk.Toolbar toolbar; private global::Gtk.Toolbar toolbar1; @@ -154,6 +156,14 @@ namespace DMX2 w7.Expand = false; w7.Fill = false; // Container child vbox3.Gtk.Box+BoxChild + this.cbDest = global::Gtk.ComboBox.NewText(); + this.cbDest.Name = "cbDest"; + this.vbox3.Add(this.cbDest); + global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.vbox3[this.cbDest])); + w8.Position = 1; + w8.Expand = false; + w8.Fill = false; + // Container child vbox3.Gtk.Box+BoxChild this.UIManager.AddUiFromString(@""); this.toolbar = ((global::Gtk.Toolbar)(this.UIManager.GetWidget("/toolbar"))); this.toolbar.Name = "toolbar"; @@ -161,13 +171,13 @@ namespace DMX2 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; + global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.vbox3[this.toolbar])); + w9.Position = 2; + w9.Expand = false; + w9.Fill = false; this.hbox1.Add(this.vbox3); - global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.vbox3])); - w9.Position = 0; + global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.vbox3])); + w10.Position = 0; // Container child hbox1.Gtk.Box+BoxChild this.UIManager.AddUiFromString("<" + "/toolbar>"); @@ -178,16 +188,16 @@ namespace DMX2 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; + global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.toolbar1])); + w11.PackType = ((global::Gtk.PackType)(1)); + w11.Position = 1; w11.Expand = false; w11.Fill = false; + this.vbox2.Add(this.hbox1); + global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.hbox1])); + w12.Position = 0; + w12.Expand = false; + w12.Fill = false; // Container child vbox2.Gtk.Box+BoxChild this.scrolledwindow1 = new global::Gtk.ScrolledWindow(); this.scrolledwindow1.CanFocus = true; @@ -200,8 +210,8 @@ namespace DMX2 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; + global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.scrolledwindow1])); + w14.Position = 1; // Container child vbox2.Gtk.Box+BoxChild this.lblText = new global::Gtk.Label(); this.lblText.Name = "lblText"; @@ -210,10 +220,10 @@ namespace DMX2 "(ex: N64+127 ou N12-)\nGT : Go To (ex: GT4)\nr: loop"; this.lblText.UseMarkup = true; this.vbox2.Add(this.lblText); - global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.lblText])); - w14.Position = 2; - w14.Expand = false; - w14.Fill = false; + global::Gtk.Box.BoxChild w15 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.lblText])); + w15.Position = 2; + w15.Expand = false; + w15.Fill = false; this.alignment1.Add(this.vbox2); this.GtkAlignment.Add(this.alignment1); this.frame1.Add(this.GtkAlignment); diff --git a/DMX-2.0/gtk-gui/gui.stetic b/DMX-2.0/gtk-gui/gui.stetic index dbae9e1..994e535 100644 --- a/DMX-2.0/gtk-gui/gui.stetic +++ b/DMX-2.0/gtk-gui/gui.stetic @@ -2164,6 +2164,19 @@ au sequenceur False + + + + True + + + + 1 + True + False + False + + @@ -2180,7 +2193,7 @@ au sequenceur - 1 + 2 True False False From a21b917e94a97f8a478a0219ec7ca994550c8bbe Mon Sep 17 00:00:00 2001 From: tzim Date: Mon, 8 Oct 2018 08:42:56 +0200 Subject: [PATCH 20/22] Suite Combo --- DMX-2.0/SeqMidiUI.cs | 46 +++++--------------------------------- DMX-2.0/SequenceurMidi.cs | 33 ++++++++++++++++++++++----- DMX-2.0/gtk-gui/gui.stetic | 44 +++++++++++++++++++++++++++++++----- 3 files changed, 71 insertions(+), 52 deletions(-) diff --git a/DMX-2.0/SeqMidiUI.cs b/DMX-2.0/SeqMidiUI.cs index f4f910a..da8c0d6 100644 --- a/DMX-2.0/SeqMidiUI.cs +++ b/DMX-2.0/SeqMidiUI.cs @@ -210,13 +210,14 @@ namespace DMX2 new ContextMenuHelper(frame1,RenamePopup); new ContextMenuHelper(evBBox,CompteurPopup); - lsDest = new ListStore(typeof(string)); + /*lsDest = new ListStore(typeof(string)); lsDest.AppendValues("TEST 1"); lsDest.AppendValues("TEST 2"); cbDest.Model = lsDest; - cbDest.SetCellDataFunc(cbDest.Cells[0], HandleCellLayoutDataFunc); + cbDest.SetCellDataFunc(cbDest.Cells[0], HandleCellLayoutDataFunc);*/ + } @@ -246,11 +247,7 @@ namespace DMX2 item = new Gtk.SeparatorMenuItem (); m.Add(item); - item = new MenuItem("Connecter"); - item.Submenu = EnumMidiDevices (); - m.Add(item); - - m.ShowAll(); + m.ShowAll(); m.Popup(); } @@ -258,32 +255,7 @@ namespace DMX2 static public object PortKey = new object(); - Gtk.Menu EnumMidiDevices(){ - - Gtk.Menu m = new Menu (); - - Gtk.MenuItem item; - - foreach (var dev in AlsaSeqLib.EnumClients ()) { - if(dev.Id== AlsaSeqLib.ClientId || dev.Id == 0 || dev.Id == 14 ) continue; - foreach(var port in dev.Ports){ - if((port.Caps & AlsaSeqLib.SND_SEQ_PORT_CAP_WRITE) == AlsaSeqLib.SND_SEQ_PORT_CAP_WRITE){ - string name = dev.Name+":"+port.Name; - - item = new MenuItem (name); - item.Data[PortKey] = port; - item.ButtonPressEvent+= ConnectMidiDevEvent; - m.Add (item); - - } - } - } - - return m; - } - - - public override void Update (bool full) + public override void Update (bool full) { if (fullUpdFlag || full) FullUpdate (); @@ -304,13 +276,7 @@ namespace DMX2 } } - void ConnectMidiDevEvent (object o, ButtonPressEventArgs args) - { - Gtk.MenuItem item = o as Gtk.MenuItem; - AlsaSeqLib.Port port = item.Data [PortKey] as AlsaSeqLib.Port; - sequenceur.Connect (port); - } - + void SelectionneEffet (int index) { diff --git a/DMX-2.0/SequenceurMidi.cs b/DMX-2.0/SequenceurMidi.cs index a5c2e2a..227b187 100644 --- a/DMX-2.0/SequenceurMidi.cs +++ b/DMX-2.0/SequenceurMidi.cs @@ -108,7 +108,32 @@ namespace DMX2 AlsaSeqLib.MidiPort midiport; static int portnum=0; - List mididests = new List(); + public class DestListItem { + public DestListItem(string _name, AlsaSeqLib.Port _port){ + name = _name; + port = _port; + } + string name; + public string Name{ + get { return name; } + } + AlsaSeqLib.Port port; + public AlsaSeqLib.Port Port{ + get { return port; } + } + } + + DestListItem destination; + public DestListItem Destination + { + get{ + return destination; + } + set{ + destination = value; + + } + } public bool Paused { get { @@ -173,11 +198,7 @@ namespace DMX2 } } - public void Connect (AlsaSeqLib.Port port){ - midiport.ConnectTo (port); - } - - public int IndexLigneaSuivre + public int IndexLigneaSuivre { get { if (aSuivre == null) diff --git a/DMX-2.0/gtk-gui/gui.stetic b/DMX-2.0/gtk-gui/gui.stetic index 994e535..1057039 100644 --- a/DMX-2.0/gtk-gui/gui.stetic +++ b/DMX-2.0/gtk-gui/gui.stetic @@ -2165,16 +2165,48 @@ au sequenceur - + - True - + 6 + + + + label1 + + + 0 + True + False + False + + + + + + True + + + + 1 + False + + + + + + label2 + + + 2 + True + False + False + + 1 - True - False - False + False From bf09b340937f38b0ac4cebc8425bc6d37df016c5 Mon Sep 17 00:00:00 2001 From: manu Date: Sun, 28 Oct 2018 18:52:53 +0100 Subject: [PATCH 21/22] Correction Style GTK et sequenceur Son --- DMX-2.0/MainWindow.cs | 6 +++++- DMX-2.0/SequenceurSon.cs | 34 +++++++++++++++++++----------- DMX-2.0/gtk-gui/DMX2.MainWindow.cs | 3 --- DMX-2.0/gtk-gui/gui.stetic | 3 --- DMX-2.0/style.gtkrc | 2 +- 5 files changed, 28 insertions(+), 20 deletions(-) diff --git a/DMX-2.0/MainWindow.cs b/DMX-2.0/MainWindow.cs index 6725fe9..80dea92 100644 --- a/DMX-2.0/MainWindow.cs +++ b/DMX-2.0/MainWindow.cs @@ -53,7 +53,11 @@ namespace DMX2 Build (); MajWidgets(); - ContextMenuHelper ctxHelper = new ContextMenuHelper(); +#if DEBUG + // selectColorAction2.Visible = true; +#endif + + ContextMenuHelper ctxHelper = new ContextMenuHelper(); ctxHelper.ContextMenu += EventPopup; ctxHelper.AttachToWidget(btnGo); ctxHelper.AttachToWidget(btnGoBack); diff --git a/DMX-2.0/SequenceurSon.cs b/DMX-2.0/SequenceurSon.cs index 3491588..52367de 100644 --- a/DMX-2.0/SequenceurSon.cs +++ b/DMX-2.0/SequenceurSon.cs @@ -133,16 +133,24 @@ namespace DMX2 get{ return volume;} set { volume=value; - mplayerProcess.StandardInput.WriteLine ("volume {0} 1", volume); + if (mplayerProcess != null && !mplayerProcess.HasExited) + { + if (!Paused) + mplayerProcess.StandardInput.WriteLine("volume {0} 1", volume); + } volumeEventTarget.FeedBack (); } } public TimeSpan PlayTime { get{ - if(mplayerProcess!=null && !mplayerProcess.HasExited) - mplayerProcess.StandardInput.WriteLine ("get_time_pos"); - return position; + if (mplayerProcess != null && !mplayerProcess.HasExited) + { + if (!Paused) + mplayerProcess.StandardInput.WriteLine("get_time_pos"); + + } + return position; } set{ if (CheckMplayer ()) { @@ -171,13 +179,14 @@ namespace DMX2 curfile = files[pos]; Stop(); - mplayerProcess.StandardInput.WriteLine ("volume 0 1"); - mplayerProcess.StandardInput.WriteLine ("loadfile \"{0}\" 0", curfile); - mplayerProcess.StandardInput.WriteLine ("get_time_length"); + //mplayerProcess.StandardInput.WriteLine ("volume 0 1"); + mplayerProcess.StandardInput.WriteLine ("volume {0} 1", volume); + mplayerProcess.StandardInput.WriteLine ("pausing loadfile \"{0}\"", curfile); + mplayerProcess.StandardInput.WriteLine ("pausing get_time_length"); //mplayerProcess.StandardInput.WriteLine ("pausing seek 0 2"); - mplayerProcess.StandardInput.WriteLine ("pause"); - mplayerProcess.StandardInput.WriteLine ("seek 0 2"); - mplayerProcess.StandardInput.WriteLine ("volume {0} 1", volume); + //mplayerProcess.StandardInput.WriteLine ("pause"); + //mplayerProcess.StandardInput.WriteLine ("seek 0 2"); + //mplayerProcess.StandardInput.WriteLine ("volume {0} 1", volume); Paused = true; } @@ -187,8 +196,9 @@ namespace DMX2 return; if (!CheckMplayer ()) return; - mplayerProcess.StandardInput.WriteLine ("pause"); - Paused = false; + mplayerProcess.StandardInput.WriteLine ("pause"); + mplayerProcess.StandardInput.WriteLine ("volume {0} 1", volume); + Paused = false; } public void Pause () diff --git a/DMX-2.0/gtk-gui/DMX2.MainWindow.cs b/DMX-2.0/gtk-gui/DMX2.MainWindow.cs index 5de3acd..23225d2 100644 --- a/DMX-2.0/gtk-gui/DMX2.MainWindow.cs +++ b/DMX-2.0/gtk-gui/DMX2.MainWindow.cs @@ -198,9 +198,6 @@ namespace DMX2 w1.Add(this.seqSonAction, null); this.selectColorAction2 = new global::Gtk.Action("selectColorAction2", null, null, "gtk-select-color"); this.selectColorAction2.Visible = false; - this.selectColorAction2.VisibleHorizontal = false; - this.selectColorAction2.VisibleVertical = false; - this.selectColorAction2.VisibleOverflown = false; w1.Add(this.selectColorAction2, null); this.seqMidiAction = new global::Gtk.Action("seqMidiAction", null, null, "MidiSeq"); this.seqMidiAction.Sensitive = false; diff --git a/DMX-2.0/gtk-gui/gui.stetic b/DMX-2.0/gtk-gui/gui.stetic index 1057039..cd2d6e5 100644 --- a/DMX-2.0/gtk-gui/gui.stetic +++ b/DMX-2.0/gtk-gui/gui.stetic @@ -238,9 +238,6 @@ gtk-select-color False - False - False - False diff --git a/DMX-2.0/style.gtkrc b/DMX-2.0/style.gtkrc index e32ecd7..e72eff0 100644 --- a/DMX-2.0/style.gtkrc +++ b/DMX-2.0/style.gtkrc @@ -45,7 +45,7 @@ style "sombre" } GtkTreeView::odd-row-color = "#66666F" - #GtkTreeView::even-row-color = "#595959" + GtkTreeView::even-row-color = "#595959" } style "scale-s" = "sombre" { From fc7d7f30d8d378d93295ba916587f976edb03e31 Mon Sep 17 00:00:00 2001 From: manu Date: Sun, 31 Oct 2021 14:48:41 +0100 Subject: [PATCH 22/22] Modifs SeqSon (cosmetique) --- DMX-2.0/SequenceurSon.cs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/DMX-2.0/SequenceurSon.cs b/DMX-2.0/SequenceurSon.cs index 52367de..093ec57 100644 --- a/DMX-2.0/SequenceurSon.cs +++ b/DMX-2.0/SequenceurSon.cs @@ -179,14 +179,16 @@ namespace DMX2 curfile = files[pos]; Stop(); - //mplayerProcess.StandardInput.WriteLine ("volume 0 1"); + //mplayerProcess.StandardInput.WriteLine ("volume 0 1"); // old mplayerProcess.StandardInput.WriteLine ("volume {0} 1", volume); mplayerProcess.StandardInput.WriteLine ("pausing loadfile \"{0}\"", curfile); - mplayerProcess.StandardInput.WriteLine ("pausing get_time_length"); - //mplayerProcess.StandardInput.WriteLine ("pausing seek 0 2"); - //mplayerProcess.StandardInput.WriteLine ("pause"); - //mplayerProcess.StandardInput.WriteLine ("seek 0 2"); - //mplayerProcess.StandardInput.WriteLine ("volume {0} 1", volume); + mplayerProcess.StandardInput.WriteLine ("pausing get_time_length"); + //mplayerProcess.StandardInput.WriteLine("loadfile \"{0}\"", curfile); //old + //mplayerProcess.StandardInput.WriteLine("get_time_length"); //old + ////mplayerProcess.StandardInput.WriteLine ("pausing seek 0 2"); //old + //mplayerProcess.StandardInput.WriteLine ("pause"); //old + //mplayerProcess.StandardInput.WriteLine ("seek 0 2"); //old + //mplayerProcess.StandardInput.WriteLine ("volume {0} 1", volume); //old Paused = true; }