* MidiEventProvider.cs: Pas de canal non paginé par défaut

* GestionMidiUI.cs:
* DMX2.GestionMidiUI.cs: Interface plus claire pour la gestion du
  canal non paginé

* gui.stetic:
* DMX2.MainWindow.cs: Modifs sur l'interface (le bouton param midi
  passe a gauche, vu que les params font désormais partie de la
  conduite)
This commit is contained in:
tzim 2014-05-23 08:44:13 +00:00
parent 8e1ad807b7
commit 49162860fe
5 changed files with 64 additions and 45 deletions

View file

@ -15,42 +15,47 @@ namespace DMX2
{ {
this.Build (); this.Build ();
lsDetect = new Gtk.ListStore(typeof(string)); lsDetect = new Gtk.ListStore (typeof(string));
lsKnown = new Gtk.ListStore(typeof(MidiEventProvider.MidiDev)); lsKnown = new Gtk.ListStore (typeof(MidiEventProvider.MidiDev));
var nameCol = new Gtk.TreeViewColumn(); var nameCol = new Gtk.TreeViewColumn ();
var nameCell = new Gtk.CellRendererText(); var nameCell = new Gtk.CellRendererText ();
nameCol.Title = "Interfaces"; nameCol.Title = "Interfaces";
nameCol.PackStart(nameCell,true); nameCol.PackStart (nameCell, true);
nameCol.AddAttribute(nameCell,"text",0); nameCol.AddAttribute (nameCell, "text", 0);
this.listDetect.AppendColumn(nameCol); this.listDetect.AppendColumn (nameCol);
var mdCol = new Gtk.TreeViewColumn(); var mdCol = new Gtk.TreeViewColumn ();
var mdCell = new Gtk.CellRendererText(); var mdCell = new Gtk.CellRendererText ();
mdCol.Title = "Interfaces"; mdCol.Title = "Interfaces";
mdCol.PackStart(mdCell,true); mdCol.PackStart (mdCell, true);
mdCol.SetCellDataFunc(mdCell, new Gtk.TreeCellDataFunc( RenderMidiDev) ); mdCol.SetCellDataFunc (mdCell, new Gtk.TreeCellDataFunc (RenderMidiDev));
this.listKnown.AppendColumn(mdCol); this.listKnown.AppendColumn (mdCol);
listDetect.Model = lsDetect; listDetect.Model = lsDetect;
listKnown.Model = lsKnown; listKnown.Model = lsKnown;
FillLsDetect(); FillLsDetect ();
FillLsKnown(); FillLsKnown ();
timer = GLib.Timeout.Add(500,Refresh); timer = GLib.Timeout.Add (500, Refresh);
Destroyed+= HandleDestroyed; Destroyed += HandleDestroyed;
spinNbPage.Value = Conduite.Courante.Midi.Maxpage; spinNbPage.Value = Conduite.Courante.Midi.Maxpage;
if(Conduite.Courante.Midi.UnpaginatedChannels.Count==0)
spinUPCh.Value = 0; if (Conduite.Courante.Midi.UnpaginatedChannels.Count == 0) {
else spinUPCh.Sensitive = false;
spinUPCh.Value= Conduite.Courante.Midi.UnpaginatedChannels[0]+1; chkPg.Active = false;
} else {
spinUPCh.Sensitive = true;
spinUPCh.Value = Conduite.Courante.Midi.UnpaginatedChannels [0] + 1;
chkPg.Active = true;
}
} }
@ -164,9 +169,20 @@ namespace DMX2
Conduite.Courante.Midi.UnpaginatedChannels.Clear(); Conduite.Courante.Midi.UnpaginatedChannels.Clear();
if (spinUPCh.ValueAsInt == 0) return; if (spinUPCh.ValueAsInt == 0) return;
Conduite.Courante.Midi.UnpaginatedChannels.Add((byte)(spinUPCh.ValueAsInt-1)); 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));
}
} }

View file

@ -305,8 +305,6 @@ namespace DMX2
AlsaSeqLib.ConnectFrom(AlsaSeqLib.SND_SEQ_CLIENT_SYSTEM, AlsaSeqLib.SND_SEQ_PORT_SYSTEM_ANNOUNCE); AlsaSeqLib.ConnectFrom(AlsaSeqLib.SND_SEQ_CLIENT_SYSTEM, AlsaSeqLib.SND_SEQ_PORT_SYSTEM_ANNOUNCE);
AutoConnect(); AutoConnect();
unpaginatedchannels.Add((byte)0);
} }
void AutoConnect () void AutoConnect ()

View file

@ -12,7 +12,7 @@ namespace DMX2
private global::Gtk.Label label3; private global::Gtk.Label label3;
private global::Gtk.SpinButton spinNbPage; private global::Gtk.SpinButton spinNbPage;
private global::Gtk.HBox hbox2; private global::Gtk.HBox hbox2;
private global::Gtk.Label label4; private global::Gtk.CheckButton chkPg;
private global::Gtk.SpinButton spinUPCh; private global::Gtk.SpinButton spinUPCh;
private global::Gtk.Label GtkLabel5; private global::Gtk.Label GtkLabel5;
private global::Gtk.Frame frame3; private global::Gtk.Frame frame3;
@ -99,22 +99,23 @@ namespace DMX2
this.hbox2.Name = "hbox2"; this.hbox2.Name = "hbox2";
this.hbox2.Spacing = 6; this.hbox2.Spacing = 6;
// Container child hbox2.Gtk.Box+BoxChild // Container child hbox2.Gtk.Box+BoxChild
this.label4 = new global::Gtk.Label (); this.chkPg = new global::Gtk.CheckButton ();
this.label4.Name = "label4"; this.chkPg.CanFocus = true;
this.label4.Xalign = 0F; this.chkPg.Name = "chkPg";
this.label4.LabelProp = "Ne pas paginer\nce canal :"; this.chkPg.Label = "ne pas paginer ce canal :";
this.hbox2.Add (this.label4); this.chkPg.DrawIndicator = true;
global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.label4])); 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.Position = 0;
w5.Expand = false;
w5.Fill = false;
// Container child hbox2.Gtk.Box+BoxChild // 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.CanFocus = true;
this.spinUPCh.Name = "spinUPCh"; this.spinUPCh.Name = "spinUPCh";
this.spinUPCh.Adjustment.PageIncrement = 10; this.spinUPCh.Adjustment.PageIncrement = 1;
this.spinUPCh.ClimbRate = 1; this.spinUPCh.ClimbRate = 1;
this.spinUPCh.Numeric = true; this.spinUPCh.Numeric = true;
this.spinUPCh.Value = 1;
this.hbox2.Add (this.spinUPCh); this.hbox2.Add (this.spinUPCh);
global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.spinUPCh])); global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.spinUPCh]));
w6.PackType = ((global::Gtk.PackType)(1)); w6.PackType = ((global::Gtk.PackType)(1));
@ -336,6 +337,7 @@ namespace DMX2
this.btnDesactiv.Clicked += new global::System.EventHandler (this.OnBtnDesactivClicked); this.btnDesactiv.Clicked += new global::System.EventHandler (this.OnBtnDesactivClicked);
this.chkFB.Toggled += new global::System.EventHandler (this.OnChkFBToggled); this.chkFB.Toggled += new global::System.EventHandler (this.OnChkFBToggled);
this.spinNbPage.ValueChanged += new global::System.EventHandler (this.OnSpinNbPageValueChanged); 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.spinUPCh.ValueChanged += new global::System.EventHandler (this.OnSpinUPChValueChanged);
this.buttonClose.Clicked += new global::System.EventHandler (this.OnButtonCloseClicked); this.buttonClose.Clicked += new global::System.EventHandler (this.OnButtonCloseClicked);
} }

View file

@ -448,7 +448,7 @@ namespace DMX2
this.hbox4.Name = "hbox4"; this.hbox4.Name = "hbox4";
this.hbox4.Spacing = 6; this.hbox4.Spacing = 6;
// Container child hbox4.Gtk.Box+BoxChild // Container child hbox4.Gtk.Box+BoxChild
this.UIManager.AddUiFromString ("<ui><toolbar name='toolbar7'><toolitem name='circAction' action='circAction'/><toolitem name='seqLinAction' action='seqLinAction'/><toolitem name='seqMacroAction' action='seqMacroAction'/><separator/><toolitem name='showAllAction' action='showAllAction'/><toolitem name='fullscreenAction1' action='fullscreenAction1'/><toolitem name='universAction' action='universAction'/><toolitem name='connectAction' action='connectAction'/></toolbar></ui>"); this.UIManager.AddUiFromString ("<ui><toolbar name='toolbar7'><toolitem name='circAction' action='circAction'/><toolitem name='seqLinAction' action='seqLinAction'/><toolitem name='seqMacroAction' action='seqMacroAction'/><separator/><toolitem name='showAllAction' action='showAllAction'/><toolitem name='fullscreenAction1' action='fullscreenAction1'/><toolitem name='universAction' action='universAction'/><toolitem name='midiAction' action='midiAction'/><toolitem name='connectAction' action='connectAction'/></toolbar></ui>");
this.toolbar7 = ((global::Gtk.Toolbar)(this.UIManager.GetWidget ("/toolbar7"))); this.toolbar7 = ((global::Gtk.Toolbar)(this.UIManager.GetWidget ("/toolbar7")));
this.toolbar7.Name = "toolbar7"; this.toolbar7.Name = "toolbar7";
this.toolbar7.ShowArrow = false; this.toolbar7.ShowArrow = false;
@ -469,7 +469,7 @@ namespace DMX2
global::Gtk.Box.BoxChild w78 = ((global::Gtk.Box.BoxChild)(this.hbox4 [this.evInfo])); global::Gtk.Box.BoxChild w78 = ((global::Gtk.Box.BoxChild)(this.hbox4 [this.evInfo]));
w78.Position = 1; w78.Position = 1;
// Container child hbox4.Gtk.Box+BoxChild // Container child hbox4.Gtk.Box+BoxChild
this.UIManager.AddUiFromString ("<ui><toolbar name='toolbar8'><toolitem name='newAction' action='newAction'/><toolitem name='openAction' action='openAction'/><toolitem name='saveAction' action='saveAction'/><toolitem name='saveAsAction' action='saveAsAction'/><toolitem name='closeAction' action='closeAction'/><toolitem name='midiAction' action='midiAction'/><toolitem name='aboutAction' action='aboutAction'/><toolitem name='quitAction' action='quitAction'/></toolbar></ui>"); this.UIManager.AddUiFromString ("<ui><toolbar name='toolbar8'><toolitem name='newAction' action='newAction'/><toolitem name='openAction' action='openAction'/><toolitem name='saveAction' action='saveAction'/><toolitem name='saveAsAction' action='saveAsAction'/><toolitem name='closeAction' action='closeAction'/><toolitem name='aboutAction' action='aboutAction'/><toolitem name='quitAction' action='quitAction'/></toolbar></ui>");
this.toolbar8 = ((global::Gtk.Toolbar)(this.UIManager.GetWidget ("/toolbar8"))); this.toolbar8 = ((global::Gtk.Toolbar)(this.UIManager.GetWidget ("/toolbar8")));
this.toolbar8.Name = "toolbar8"; this.toolbar8.Name = "toolbar8";
this.toolbar8.ShowArrow = false; this.toolbar8.ShowArrow = false;

View file

@ -573,6 +573,7 @@ page</property>
<node type="Toolitem" action="showAllAction" /> <node type="Toolitem" action="showAllAction" />
<node type="Toolitem" action="fullscreenAction1" /> <node type="Toolitem" action="fullscreenAction1" />
<node type="Toolitem" action="universAction" /> <node type="Toolitem" action="universAction" />
<node type="Toolitem" action="midiAction" />
<node type="Toolitem" action="connectAction" /> <node type="Toolitem" action="connectAction" />
</node> </node>
</widget> </widget>
@ -609,7 +610,6 @@ page</property>
<node type="Toolitem" action="saveAction" /> <node type="Toolitem" action="saveAction" />
<node type="Toolitem" action="saveAsAction" /> <node type="Toolitem" action="saveAsAction" />
<node type="Toolitem" action="closeAction" /> <node type="Toolitem" action="closeAction" />
<node type="Toolitem" action="midiAction" />
<node type="Toolitem" action="aboutAction" /> <node type="Toolitem" action="aboutAction" />
<node type="Toolitem" action="quitAction" /> <node type="Toolitem" action="quitAction" />
</node> </node>
@ -3213,28 +3213,31 @@ trames DMX (ms)</property>
<property name="MemberName" /> <property name="MemberName" />
<property name="Spacing">6</property> <property name="Spacing">6</property>
<child> <child>
<widget class="Gtk.Label" id="label4"> <widget class="Gtk.CheckButton" id="chkPg">
<property name="MemberName" /> <property name="MemberName" />
<property name="Xalign">0</property> <property name="CanFocus">True</property>
<property name="LabelProp" translatable="yes">Ne pas paginer <property name="Label" translatable="yes">ne pas paginer ce canal :</property>
ce canal :</property> <property name="DrawIndicator">True</property>
<property name="HasLabel">True</property>
<property name="UseUnderline">True</property>
<signal name="Toggled" handler="OnChkPgToggled" />
</widget> </widget>
<packing> <packing>
<property name="Position">0</property> <property name="Position">0</property>
<property name="AutoSize">True</property> <property name="AutoSize">True</property>
<property name="Expand">False</property>
<property name="Fill">False</property>
</packing> </packing>
</child> </child>
<child> <child>
<widget class="Gtk.SpinButton" id="spinUPCh"> <widget class="Gtk.SpinButton" id="spinUPCh">
<property name="MemberName" /> <property name="MemberName" />
<property name="CanFocus">True</property> <property name="CanFocus">True</property>
<property name="Lower">1</property>
<property name="Upper">16</property> <property name="Upper">16</property>
<property name="PageIncrement">10</property> <property name="PageIncrement">1</property>
<property name="StepIncrement">1</property> <property name="StepIncrement">1</property>
<property name="ClimbRate">1</property> <property name="ClimbRate">1</property>
<property name="Numeric">True</property> <property name="Numeric">True</property>
<property name="Value">1</property>
<signal name="ValueChanged" handler="OnSpinUPChValueChanged" /> <signal name="ValueChanged" handler="OnSpinUPChValueChanged" />
</widget> </widget>
<packing> <packing>