Suite Combo
This commit is contained in:
parent
52f56202bf
commit
a21b917e94
3 changed files with 71 additions and 52 deletions
|
|
@ -210,13 +210,14 @@ namespace DMX2
|
||||||
new ContextMenuHelper(frame1,RenamePopup);
|
new ContextMenuHelper(frame1,RenamePopup);
|
||||||
new ContextMenuHelper(evBBox,CompteurPopup);
|
new ContextMenuHelper(evBBox,CompteurPopup);
|
||||||
|
|
||||||
lsDest = new ListStore(typeof(string));
|
/*lsDest = new ListStore(typeof(string));
|
||||||
lsDest.AppendValues("TEST 1");
|
lsDest.AppendValues("TEST 1");
|
||||||
lsDest.AppendValues("TEST 2");
|
lsDest.AppendValues("TEST 2");
|
||||||
|
|
||||||
cbDest.Model = lsDest;
|
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 ();
|
item = new Gtk.SeparatorMenuItem ();
|
||||||
m.Add(item);
|
m.Add(item);
|
||||||
|
|
||||||
item = new MenuItem("Connecter");
|
m.ShowAll();
|
||||||
item.Submenu = EnumMidiDevices ();
|
|
||||||
m.Add(item);
|
|
||||||
|
|
||||||
m.ShowAll();
|
|
||||||
m.Popup();
|
m.Popup();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -258,32 +255,7 @@ namespace DMX2
|
||||||
|
|
||||||
static public object PortKey = new object();
|
static public object PortKey = new object();
|
||||||
|
|
||||||
Gtk.Menu EnumMidiDevices(){
|
public override void Update (bool full)
|
||||||
|
|
||||||
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)
|
if (fullUpdFlag || full)
|
||||||
FullUpdate ();
|
FullUpdate ();
|
||||||
|
|
@ -304,12 +276,6 @@ 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)
|
void SelectionneEffet (int index)
|
||||||
|
|
|
||||||
|
|
@ -108,7 +108,32 @@ namespace DMX2
|
||||||
AlsaSeqLib.MidiPort midiport;
|
AlsaSeqLib.MidiPort midiport;
|
||||||
static int portnum=0;
|
static int portnum=0;
|
||||||
|
|
||||||
List<AlsaSeqLib.Port> mididests = new List<AlsaSeqLib.Port>();
|
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 {
|
public bool Paused {
|
||||||
get {
|
get {
|
||||||
|
|
@ -173,11 +198,7 @@ namespace DMX2
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Connect (AlsaSeqLib.Port port){
|
public int IndexLigneaSuivre
|
||||||
midiport.ConnectTo (port);
|
|
||||||
}
|
|
||||||
|
|
||||||
public int IndexLigneaSuivre
|
|
||||||
{
|
{
|
||||||
get {
|
get {
|
||||||
if (aSuivre == null)
|
if (aSuivre == null)
|
||||||
|
|
|
||||||
|
|
@ -2165,16 +2165,48 @@ au sequenceur</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<widget class="Gtk.ComboBox" id="cbDest">
|
<widget class="Gtk.HBox" id="hbox3">
|
||||||
<property name="MemberName" />
|
<property name="MemberName" />
|
||||||
<property name="IsTextCombo">True</property>
|
<property name="Spacing">6</property>
|
||||||
<property name="Items" translatable="yes" />
|
<child>
|
||||||
|
<widget class="Gtk.Label" id="label1">
|
||||||
|
<property name="MemberName" />
|
||||||
|
<property name="LabelProp" translatable="yes">label1</property>
|
||||||
|
</widget>
|
||||||
|
<packing>
|
||||||
|
<property name="Position">0</property>
|
||||||
|
<property name="AutoSize">True</property>
|
||||||
|
<property name="Expand">False</property>
|
||||||
|
<property name="Fill">False</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<widget class="Gtk.ComboBoxEntry" id="comboboxentry2">
|
||||||
|
<property name="MemberName" />
|
||||||
|
<property name="IsTextCombo">True</property>
|
||||||
|
<property name="Items" translatable="yes" />
|
||||||
|
</widget>
|
||||||
|
<packing>
|
||||||
|
<property name="Position">1</property>
|
||||||
|
<property name="AutoSize">False</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<widget class="Gtk.Label" id="label2">
|
||||||
|
<property name="MemberName" />
|
||||||
|
<property name="LabelProp" translatable="yes">label2</property>
|
||||||
|
</widget>
|
||||||
|
<packing>
|
||||||
|
<property name="Position">2</property>
|
||||||
|
<property name="AutoSize">True</property>
|
||||||
|
<property name="Expand">False</property>
|
||||||
|
<property name="Fill">False</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
</widget>
|
</widget>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="Position">1</property>
|
<property name="Position">1</property>
|
||||||
<property name="AutoSize">True</property>
|
<property name="AutoSize">False</property>
|
||||||
<property name="Expand">False</property>
|
|
||||||
<property name="Fill">False</property>
|
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue