diff --git a/DMX-2.0/GestionMidiUI.cs b/DMX-2.0/GestionMidiUI.cs index b8baa9d..47524aa 100644 --- a/DMX-2.0/GestionMidiUI.cs +++ b/DMX-2.0/GestionMidiUI.cs @@ -15,42 +15,47 @@ namespace DMX2 { this.Build (); - lsDetect = new Gtk.ListStore(typeof(string)); - lsKnown = new Gtk.ListStore(typeof(MidiEventProvider.MidiDev)); + lsDetect = new Gtk.ListStore (typeof(string)); + lsKnown = new Gtk.ListStore (typeof(MidiEventProvider.MidiDev)); - var nameCol = new Gtk.TreeViewColumn(); - var nameCell = new Gtk.CellRendererText(); + var nameCol = new Gtk.TreeViewColumn (); + var nameCell = new Gtk.CellRendererText (); nameCol.Title = "Interfaces"; - nameCol.PackStart(nameCell,true); - nameCol.AddAttribute(nameCell,"text",0); - this.listDetect.AppendColumn(nameCol); + nameCol.PackStart (nameCell, true); + nameCol.AddAttribute (nameCell, "text", 0); + this.listDetect.AppendColumn (nameCol); - var mdCol = new Gtk.TreeViewColumn(); - var mdCell = new Gtk.CellRendererText(); + var mdCol = new Gtk.TreeViewColumn (); + var mdCell = new Gtk.CellRendererText (); mdCol.Title = "Interfaces"; - mdCol.PackStart(mdCell,true); - mdCol.SetCellDataFunc(mdCell, new Gtk.TreeCellDataFunc( RenderMidiDev) ); - this.listKnown.AppendColumn(mdCol); + mdCol.PackStart (mdCell, true); + mdCol.SetCellDataFunc (mdCell, new Gtk.TreeCellDataFunc (RenderMidiDev)); + this.listKnown.AppendColumn (mdCol); listDetect.Model = lsDetect; listKnown.Model = lsKnown; - FillLsDetect(); - FillLsKnown(); + FillLsDetect (); + FillLsKnown (); - timer = GLib.Timeout.Add(500,Refresh); + timer = GLib.Timeout.Add (500, Refresh); - Destroyed+= HandleDestroyed; + Destroyed += HandleDestroyed; spinNbPage.Value = Conduite.Courante.Midi.Maxpage; - if(Conduite.Courante.Midi.UnpaginatedChannels.Count==0) - spinUPCh.Value = 0; - else - spinUPCh.Value= Conduite.Courante.Midi.UnpaginatedChannels[0]+1; + + if (Conduite.Courante.Midi.UnpaginatedChannels.Count == 0) { + spinUPCh.Sensitive = false; + chkPg.Active = false; + } else { + spinUPCh.Sensitive = true; + spinUPCh.Value = Conduite.Courante.Midi.UnpaginatedChannels [0] + 1; + chkPg.Active = true; + } } @@ -63,8 +68,8 @@ namespace DMX2 bool Refresh () { if (Conduite.Courante.Midi.GuiRefreshFlag) { - FillLsDetect(); - FillLsKnown(); + FillLsDetect(); + FillLsKnown(); } return true; } @@ -164,11 +169,22 @@ namespace DMX2 Conduite.Courante.Midi.UnpaginatedChannels.Clear(); if (spinUPCh.ValueAsInt == 0) return; Conduite.Courante.Midi.UnpaginatedChannels.Add((byte)(spinUPCh.ValueAsInt-1)); + } + protected void OnChkPgToggled (object sender, EventArgs e) + { + Conduite.Courante.Midi.UnpaginatedChannels.Clear (); + if (!chkPg.Active) { + spinUPCh.Sensitive=false; + return; + } + spinUPCh.Sensitive=true; + Conduite.Courante.Midi.UnpaginatedChannels.Add((byte)(spinUPCh.ValueAsInt-1)); } + } } diff --git a/DMX-2.0/MidiEventProvider.cs b/DMX-2.0/MidiEventProvider.cs index 4648f15..2aa5e42 100644 --- a/DMX-2.0/MidiEventProvider.cs +++ b/DMX-2.0/MidiEventProvider.cs @@ -305,8 +305,6 @@ namespace DMX2 AlsaSeqLib.ConnectFrom(AlsaSeqLib.SND_SEQ_CLIENT_SYSTEM, AlsaSeqLib.SND_SEQ_PORT_SYSTEM_ANNOUNCE); AutoConnect(); - - unpaginatedchannels.Add((byte)0); } void AutoConnect () diff --git a/DMX-2.0/gtk-gui/DMX2.GestionMidiUI.cs b/DMX-2.0/gtk-gui/DMX2.GestionMidiUI.cs index 1572d4e..ceaf3a3 100644 --- a/DMX-2.0/gtk-gui/DMX2.GestionMidiUI.cs +++ b/DMX-2.0/gtk-gui/DMX2.GestionMidiUI.cs @@ -12,7 +12,7 @@ namespace DMX2 private global::Gtk.Label label3; private global::Gtk.SpinButton spinNbPage; private global::Gtk.HBox hbox2; - private global::Gtk.Label label4; + private global::Gtk.CheckButton chkPg; private global::Gtk.SpinButton spinUPCh; private global::Gtk.Label GtkLabel5; private global::Gtk.Frame frame3; @@ -99,22 +99,23 @@ namespace DMX2 this.hbox2.Name = "hbox2"; this.hbox2.Spacing = 6; // Container child hbox2.Gtk.Box+BoxChild - this.label4 = new global::Gtk.Label (); - this.label4.Name = "label4"; - this.label4.Xalign = 0F; - this.label4.LabelProp = "Ne pas paginer\nce canal :"; - this.hbox2.Add (this.label4); - global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.label4])); + 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.hbox2.Add (this.chkPg); + global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.chkPg])); w5.Position = 0; - w5.Expand = false; - w5.Fill = false; // Container child hbox2.Gtk.Box+BoxChild - this.spinUPCh = new global::Gtk.SpinButton (0, 16, 1); + this.spinUPCh = new global::Gtk.SpinButton (1, 16, 1); this.spinUPCh.CanFocus = true; this.spinUPCh.Name = "spinUPCh"; - this.spinUPCh.Adjustment.PageIncrement = 10; + this.spinUPCh.Adjustment.PageIncrement = 1; this.spinUPCh.ClimbRate = 1; this.spinUPCh.Numeric = true; + this.spinUPCh.Value = 1; this.hbox2.Add (this.spinUPCh); global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.spinUPCh])); w6.PackType = ((global::Gtk.PackType)(1)); @@ -336,6 +337,7 @@ namespace DMX2 this.btnDesactiv.Clicked += new global::System.EventHandler (this.OnBtnDesactivClicked); this.chkFB.Toggled += new global::System.EventHandler (this.OnChkFBToggled); this.spinNbPage.ValueChanged += new global::System.EventHandler (this.OnSpinNbPageValueChanged); + this.chkPg.Toggled += new global::System.EventHandler (this.OnChkPgToggled); this.spinUPCh.ValueChanged += new global::System.EventHandler (this.OnSpinUPChValueChanged); 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 3208ae8..6a355cb 100644 --- a/DMX-2.0/gtk-gui/DMX2.MainWindow.cs +++ b/DMX-2.0/gtk-gui/DMX2.MainWindow.cs @@ -448,7 +448,7 @@ namespace DMX2 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; @@ -469,7 +469,7 @@ namespace DMX2 global::Gtk.Box.BoxChild w78 = ((global::Gtk.Box.BoxChild)(this.hbox4 [this.evInfo])); w78.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; diff --git a/DMX-2.0/gtk-gui/gui.stetic b/DMX-2.0/gtk-gui/gui.stetic index 1ec6eed..5975e17 100644 --- a/DMX-2.0/gtk-gui/gui.stetic +++ b/DMX-2.0/gtk-gui/gui.stetic @@ -573,6 +573,7 @@ page + @@ -609,7 +610,6 @@ page - @@ -3213,28 +3213,31 @@ trames DMX (ms) 6 - + - 0 - Ne pas paginer -ce canal : + True + ne pas paginer ce canal : + True + True + True + 0 True - False - False True + 1 16 - 10 + 1 1 1 True + 1