From 0fd3c6d95c3f8643489521275d3bef024c441e39 Mon Sep 17 00:00:00 2001 From: Tzim Date: Fri, 30 Jun 2017 12:02:17 +0200 Subject: [PATCH] =?UTF-8?q?Structure=20de=20donn=C3=A9es=20et=20interface?= =?UTF-8?q?=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