Début de gestion des ajout suppression de perifs midi via l'interface.

Reste le parametrage de celles ci :)
This commit is contained in:
tzim 2014-05-22 11:21:50 +00:00
parent 88faf30ca1
commit b893ec5e6f
6 changed files with 349 additions and 63 deletions

View file

@ -105,6 +105,14 @@ namespace DMX2
[DllImport(ASOUND_LIB_NAME, CallingConvention = CallingConvention.Cdecl)] [DllImport(ASOUND_LIB_NAME, CallingConvention = CallingConvention.Cdecl)]
public static extern int snd_seq_query_subscribe_get_port (IntPtr info); public static extern int snd_seq_query_subscribe_get_port (IntPtr info);
[DllImport(ASOUND_LIB_NAME, CallingConvention = CallingConvention.Cdecl)]
public static extern int snd_seq_query_subscribe_get_queue (IntPtr info);
[DllImport(ASOUND_LIB_NAME, CallingConvention = CallingConvention.Cdecl)]
public static extern int snd_seq_query_subscribe_get_time_real (IntPtr info);
[DllImport(ASOUND_LIB_NAME, CallingConvention = CallingConvention.Cdecl)]
public static extern int snd_seq_query_subscribe_get_time_update (IntPtr info);
[DllImport(ASOUND_LIB_NAME, CallingConvention = CallingConvention.Cdecl)]
public static extern int snd_seq_query_subscribe_get_exclusive (IntPtr info);
[DllImport(ASOUND_LIB_NAME, CallingConvention = CallingConvention.Cdecl)] [DllImport(ASOUND_LIB_NAME, CallingConvention = CallingConvention.Cdecl)]
public static extern uint snd_seq_port_info_get_capability (IntPtr info); public static extern uint snd_seq_port_info_get_capability (IntPtr info);
@ -132,6 +140,8 @@ namespace DMX2
[DllImport(ASOUND_LIB_NAME, CallingConvention = CallingConvention.Cdecl)] [DllImport(ASOUND_LIB_NAME, CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr snd_seq_query_subscribe_get_addr (IntPtr subs); public static extern IntPtr snd_seq_query_subscribe_get_addr (IntPtr subs);
[DllImport(ASOUND_LIB_NAME, CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr snd_seq_query_subscribe_get_root (IntPtr subs);
[DllImport(ASOUND_LIB_NAME, CallingConvention = CallingConvention.Cdecl)] [DllImport(ASOUND_LIB_NAME, CallingConvention = CallingConvention.Cdecl)]
public static extern void snd_seq_port_subscribe_set_sender (IntPtr info, IntPtr addr); public static extern void snd_seq_port_subscribe_set_sender (IntPtr info, IntPtr addr);
@ -142,6 +152,9 @@ namespace DMX2
[DllImport(ASOUND_LIB_NAME, CallingConvention = CallingConvention.Cdecl)] [DllImport(ASOUND_LIB_NAME, CallingConvention = CallingConvention.Cdecl)]
public static extern void snd_seq_port_subscribe_set_exclusive (IntPtr info, int val); public static extern void snd_seq_port_subscribe_set_exclusive (IntPtr info, int val);
[DllImport(ASOUND_LIB_NAME, CallingConvention = CallingConvention.Cdecl)]
public static extern void snd_seq_port_subscribe_set_queue (IntPtr info, int q);
[DllImport(ASOUND_LIB_NAME, CallingConvention = CallingConvention.Cdecl)] [DllImport(ASOUND_LIB_NAME, CallingConvention = CallingConvention.Cdecl)]
public static extern void snd_seq_port_subscribe_set_time_update (IntPtr info, int val); public static extern void snd_seq_port_subscribe_set_time_update (IntPtr info, int val);
@ -162,6 +175,11 @@ namespace DMX2
[DllImport(ASOUND_LIB_NAME, CallingConvention = CallingConvention.Cdecl)] [DllImport(ASOUND_LIB_NAME, CallingConvention = CallingConvention.Cdecl)]
public static extern int snd_seq_connect_to (IntPtr handle, int myport, int dest_client, int dest_port); public static extern int snd_seq_connect_to (IntPtr handle, int myport, int dest_client, int dest_port);
[DllImport(ASOUND_LIB_NAME, CallingConvention = CallingConvention.Cdecl)]
public static extern int snd_seq_disconnect_from (IntPtr handle, int myport, int src_client, int src_port);
[DllImport(ASOUND_LIB_NAME, CallingConvention = CallingConvention.Cdecl)]
public static extern int snd_seq_disconnect_to (IntPtr handle, int myport, int dest_client, int dest_port);
} }

View file

@ -66,6 +66,11 @@ namespace DMX2
} }
} }
public static int ClientId {
get {
return clientId;
}
}
public class Port public class Port
{ {
int portId; int portId;
@ -227,6 +232,58 @@ namespace DMX2
return Invoke.snd_seq_connect_from(seq_handle.Handle,inport,client,port)==0; return Invoke.snd_seq_connect_from(seq_handle.Handle,inport,client,port)==0;
} }
public static void Deconnecte (int client, int port)
{
snd_seq_addr_t local = new snd_seq_addr_t ();
local.client = (byte)clientId;
local.port = (byte)inport;
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,inport,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,outport,client,port);
}
}
}
/* /*
public static void GetConnections() public static void GetConnections()
{ {

View file

@ -1,23 +1,134 @@
using System; using System;
using Gtk;
namespace DMX2 namespace DMX2
{ {
public partial class GestionMidiUI : Gtk.Dialog public partial class GestionMidiUI : Gtk.Dialog
{ {
Gtk.ListStore lsDetect;
Gtk.ListStore lsKnown;
uint timer=0;
public GestionMidiUI () public GestionMidiUI ()
{ {
this.Build (); this.Build ();
lsDetect = new Gtk.ListStore(typeof(string));
lsKnown = new Gtk.ListStore(typeof(MidiEventProvider.MidiDev));
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);
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);
listDetect.Model = lsDetect;
listKnown.Model = lsKnown;
FillLsDetect();
FillLsKnown();
timer = GLib.Timeout.Add(500,Refresh);
Destroyed+= HandleDestroyed;
} }
void HandleDestroyed (object sender, EventArgs e)
{
if(timer!=0)
GLib.Source.Remove(timer);
}
bool Refresh ()
{
if (MidiEventProvider.GuiRefreshFlag) {
FillLsDetect();
FillLsKnown();
}
return true;
}
void RenderMidiDev (Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.TreeModel tree_model, Gtk.TreeIter iter)
{
MidiEventProvider.MidiDev dev = tree_model.GetValue (iter, 0) as MidiEventProvider.MidiDev;
(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);
}
void FillLsDetect ()
{
lsDetect.Clear ();
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_READ) == AlsaSeqLib.SND_SEQ_PORT_CAP_READ){
string name = dev.Name+":"+port.Name;
if(!MidiEventProvider.IsKnownDevice(name))
lsDetect.AppendValues(name);
}
}
}
}
void FillLsKnown ()
{
lsKnown.Clear ();
foreach (var dev in MidiEventProvider.KnownDevices) {
lsKnown.AppendValues(dev);
}
}
protected void OnButtonCloseClicked (object sender, EventArgs e) protected void OnButtonCloseClicked (object sender, EventArgs e)
{ {
Destroy(); Destroy();
} }
protected void OnListDetectCursorChanged (object sender, EventArgs e)
{
btnActiv.Sensitive = (listDetect.Selection.CountSelectedRows() >0);
}
protected void OnListKnownCursorChanged (object sender, EventArgs e)
{
btnDesactiv.Sensitive = (listKnown.Selection.CountSelectedRows() >0);
}
protected void OnBtnActivClicked (object sender, EventArgs e)
{
TreeIter iter;
if(!listDetect.Selection.GetSelected(out iter)) return;
string name= lsDetect.GetValue(iter,0) as string;
MidiEventProvider.ConnectDevice(name);
FillLsDetect () ;
FillLsKnown();
}
protected void OnBtnDesactivClicked (object sender, EventArgs e)
{
TreeIter iter;
if(!listKnown.Selection.GetSelected(out iter)) return;
MidiEventProvider.MidiDev dev = lsKnown.GetValue(iter,0) as MidiEventProvider.MidiDev ;
MidiEventProvider.DisconnectDevice(dev);
FillLsDetect () ;
FillLsKnown();
}
} }
} }

View file

@ -115,7 +115,7 @@ namespace DMX2
if (prov.CurrentPage == iev.Page || iev.Page == 0) { if (prov.CurrentPage == iev.Page || iev.Page == 0) {
prov.SendEvent (ev); prov.SendEvent (ev);
foreach (int srcid in prov.feedbacksources) { foreach (int srcid in MidiEventProvider.feedbacksources) {
int lnvk = srcid ^ iev.MidiEvCode; int lnvk = srcid ^ iev.MidiEvCode;
prov.lastKnownValues[lnvk] = data; prov.lastKnownValues[lnvk] = data;
} }
@ -181,8 +181,8 @@ namespace DMX2
} }
readonly Dictionary<string,internalEvent> eventlist = new Dictionary<string, internalEvent>(); readonly Dictionary<string,internalEvent> eventlist = new Dictionary<string, internalEvent>();
readonly Dictionary<string,MidiDev> knowndevices = new Dictionary<string,MidiDev>(); static readonly Dictionary<string,MidiDev> knowndevices = new Dictionary<string,MidiDev>();
readonly List<int> feedbacksources = new List<int>(); static readonly List<int> feedbacksources = new List<int>();
readonly List<byte> unpaginatedchannels = new List<byte>(); readonly List<byte> unpaginatedchannels = new List<byte>();
readonly Dictionary<int,byte> lastKnownValues = new Dictionary<int, byte>(); readonly Dictionary<int,byte> lastKnownValues = new Dictionary<int, byte>();
@ -191,6 +191,8 @@ namespace DMX2
internalEvent levent=null; internalEvent levent=null;
bool connected=false; bool connected=false;
static bool guirefreshflag=false;
int page=1; int page=1;
public int CurrentPage { public int CurrentPage {
@ -211,12 +213,58 @@ namespace DMX2
} }
} }
public Dictionary<string,MidiDev> KnownDevices { public static bool GuiRefreshFlag {
get { get {
return knowndevices; if(guirefreshflag){
guirefreshflag=false;
return true;
}
return false;
}
}
static public void ConnectDevice (string name)
{
knowndevices.Add(name,new MidiDev(name));
AutoConnect();
}
public static void DisconnectDevice (MidiEventProvider.MidiDev dev)
{
if (!knowndevices.ContainsKey (dev.Name))
return;
knowndevices.Remove (dev.Name);
// TODO: Deconnecter ici
foreach (int connectedport in dev.ConnectedPorts) {
int client = connectedport >> 8;
int port = connectedport & 0xFF;
AlsaSeqLib.Deconnecte(client,port);
} }
} }
static public bool IsKnownDevice(string name){
return knowndevices.ContainsKey(name);
}
static public IEnumerable<MidiDev> KnownDevices {
get {
return knowndevices.Values;
}
}
static MidiEventProvider ()
{
MidiDev dev = new MidiDev("VMPK Input:VMPK Input");
dev.HasFeedback = true;
knowndevices.Add(dev.Name,dev);
dev = new MidiDev("VMPK Output:VMPK Output");
dev.HasFeedback = true;
knowndevices.Add(dev.Name,dev);
/*
dev = new MidiDev("BCF2000:BCF2000 MIDI 1");
dev.HasFeedback = true;
knowndevices.Add(dev.Name,dev);*/
}
public MidiEventProvider (EventManager manager) public MidiEventProvider (EventManager manager)
{ {
@ -225,44 +273,75 @@ 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();
MidiDev dev = new MidiDev("VMPK Input:VMPK Input"); unpaginatedchannels.Add((byte)0);
dev.HasFeedback = true; }
knowndevices.Add(dev.Name,dev);
dev = new MidiDev("VMPK Output:VMPK Output");
dev.HasFeedback = true;
knowndevices.Add(dev.Name,dev);
dev = new MidiDev("BCF2000:BCF2000 MIDI 1");
dev.HasFeedback = true;
knowndevices.Add(dev.Name,dev);
static void AutoConnect ()
{
foreach (var cli in AlsaSeqLib.EnumClients()) { foreach (var cli in AlsaSeqLib.EnumClients()) {
foreach(var p in cli.Ports){ foreach(var p in cli.Ports){
PortDetected(cli,p); PortDetected(cli,p);
} }
} }
unpaginatedchannels.Add((byte)0);
} }
void PortDetected (AlsaSeqLib.Client cli, AlsaSeqLib.Port p) static void PortDetected (AlsaSeqLib.Client cli, AlsaSeqLib.Port p)
{ {
// Execute a chaque 'apparition' d'un port midi // Execute a chaque 'apparition' d'un port midi
// teste si connection auto au port et connecte si besoin // teste si connection auto au port et connecte si besoin
guirefreshflag=true;
string fullportname = cli.Name + ':' + p.Name; string fullportname = cli.Name + ':' + p.Name;
Console.WriteLine(fullportname); Console.WriteLine(fullportname);
if(knowndevices.ContainsKey(fullportname)){ if(knowndevices.ContainsKey(fullportname)){
AlsaSeqLib.Connect(p);
int srcid = p.ClientId <<8 + p.PortId; int srcid = p.ClientId <<8 + p.PortId;
knowndevices[fullportname].ConnectedPorts.Add(srcid); if(knowndevices[fullportname].ConnectedPorts.Contains(srcid))
if(knowndevices[fullportname].HasFeedback) return;
feedbacksources.Add(srcid);
AlsaSeqLib.Connect(p);
} }
} }
static void PortConnect (AlsaSeqLib.snd_seq_connect_t cn, bool connect)
{
int clientId,portId;
if (cn.dest.client == AlsaSeqLib.ClientId) {
clientId = cn.sender.client;
portId = cn.sender.port;
} else {
clientId = cn.dest.client;
portId = cn.dest.port;
}
int srcid = clientId << 8 + portId;
if (connect) {
string fpname= AlsaSeqLib.GetClientByID(clientId).Name + ":"+ AlsaSeqLib.GetPortByIDs (clientId, portId).Name;
Console.WriteLine("PortConnect {0}",fpname);
if (!knowndevices.ContainsKey(fpname)) return;
if (knowndevices [fpname].ConnectedPorts.Contains (srcid))
return;
knowndevices [fpname].ConnectedPorts.Add (srcid);
if(knowndevices [fpname].HasFeedback)
feedbacksources.Add (srcid);
guirefreshflag=true;
return;
}
foreach (var dev in knowndevices.Values) {
if(dev.ConnectedPorts.Contains (srcid))
{
dev.ConnectedPorts.Remove(srcid);
guirefreshflag=true;
return;
}
}
}
protected bool HasFeedback (int source) protected bool HasFeedback (int source)
{ {
return feedbacksources.Contains(source); return feedbacksources.Contains(source);
@ -370,7 +449,11 @@ namespace DMX2
switch (evS.type) { 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_SUBSCRIBED: // Connection d'un périph midi
connected = true; 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; continue;
case AlsaSeqLib.snd_seq_event_type_t.SND_SEQ_EVENT_CONTROLLER: case AlsaSeqLib.snd_seq_event_type_t.SND_SEQ_EVENT_CONTROLLER:
if(evS.data_ev_ctrl.param==127 && evS.data_ev_ctrl.value >0){ if(evS.data_ev_ctrl.param==127 && evS.data_ev_ctrl.value >0){
@ -416,6 +499,7 @@ namespace DMX2
default: default:
id= null; id= null;
#if DEBUG #if DEBUG
Console.WriteLine(string.Format ("event {0}", evS.type) );
Info.Publish(string.Format ("event {0}", evS.type) ); // On affiche les evenements inconnus Info.Publish(string.Format ("event {0}", evS.type) ); // On affiche les evenements inconnus
#endif #endif
continue; continue;

View file

@ -19,16 +19,16 @@ namespace DMX2
private global::Gtk.CheckButton checkbutton1; private global::Gtk.CheckButton checkbutton1;
private global::Gtk.Label GtkLabel3; private global::Gtk.Label GtkLabel3;
private global::Gtk.HButtonBox hbuttonbox2; private global::Gtk.HButtonBox hbuttonbox2;
private global::Gtk.Button button5; private global::Gtk.Button btnActiv;
private global::Gtk.Button button6; private global::Gtk.Button btnDesactiv;
private global::Gtk.VBox vbox2; private global::Gtk.VBox vbox2;
private global::Gtk.Label label1; private global::Gtk.Label label1;
private global::Gtk.ScrolledWindow GtkScrolledWindow; private global::Gtk.ScrolledWindow GtkScrolledWindow;
private global::Gtk.TreeView treeview1; private global::Gtk.TreeView listDetect;
private global::Gtk.VBox vbox3; private global::Gtk.VBox vbox3;
private global::Gtk.Label label2; private global::Gtk.Label label2;
private global::Gtk.ScrolledWindow GtkScrolledWindow1; private global::Gtk.ScrolledWindow GtkScrolledWindow1;
private global::Gtk.TreeView treeview2; private global::Gtk.TreeView listKnown;
private global::Gtk.Button buttonClose; private global::Gtk.Button buttonClose;
protected virtual void Build () protected virtual void Build ()
@ -50,7 +50,7 @@ namespace DMX2
// Container child table1.Gtk.Table+TableChild // Container child table1.Gtk.Table+TableChild
this.frame2 = new global::Gtk.Frame (); this.frame2 = new global::Gtk.Frame ();
this.frame2.Name = "frame2"; this.frame2.Name = "frame2";
this.frame2.ShadowType = ((global::Gtk.ShadowType)(0)); this.frame2.ShadowType = ((global::Gtk.ShadowType)(1));
// Container child frame2.Gtk.Container+ContainerChild // 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.Name = "GtkAlignment3";
@ -119,7 +119,7 @@ namespace DMX2
// Container child table1.Gtk.Table+TableChild // Container child table1.Gtk.Table+TableChild
this.frame3 = new global::Gtk.Frame (); this.frame3 = new global::Gtk.Frame ();
this.frame3.Name = "frame3"; this.frame3.Name = "frame3";
this.frame3.ShadowType = ((global::Gtk.ShadowType)(0)); this.frame3.ShadowType = ((global::Gtk.ShadowType)(1));
// Container child frame3.Gtk.Container+ContainerChild // 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.Name = "GtkAlignment2";
@ -157,11 +157,12 @@ namespace DMX2
this.hbuttonbox2 = new global::Gtk.HButtonBox (); this.hbuttonbox2 = new global::Gtk.HButtonBox ();
this.hbuttonbox2.Name = "hbuttonbox2"; this.hbuttonbox2.Name = "hbuttonbox2";
// Container child hbuttonbox2.Gtk.ButtonBox+ButtonBoxChild // Container child hbuttonbox2.Gtk.ButtonBox+ButtonBoxChild
this.button5 = new global::Gtk.Button (); this.btnActiv = new global::Gtk.Button ();
this.button5.CanFocus = true; this.btnActiv.Sensitive = false;
this.button5.Name = "button5"; this.btnActiv.CanFocus = true;
this.button5.UseUnderline = true; this.btnActiv.Name = "btnActiv";
// Container child button5.Gtk.Container+ContainerChild this.btnActiv.UseUnderline = true;
// Container child btnActiv.Gtk.Container+ContainerChild
global::Gtk.Alignment w13 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F); global::Gtk.Alignment w13 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F);
// Container child GtkAlignment.Gtk.Container+ContainerChild // Container child GtkAlignment.Gtk.Container+ContainerChild
global::Gtk.HBox w14 = new global::Gtk.HBox (); global::Gtk.HBox w14 = new global::Gtk.HBox ();
@ -176,17 +177,18 @@ namespace DMX2
w17.UseUnderline = true; w17.UseUnderline = true;
w14.Add (w17); w14.Add (w17);
w13.Add (w14); w13.Add (w14);
this.button5.Add (w13); this.btnActiv.Add (w13);
this.hbuttonbox2.Add (this.button5); this.hbuttonbox2.Add (this.btnActiv);
global::Gtk.ButtonBox.ButtonBoxChild w21 = ((global::Gtk.ButtonBox.ButtonBoxChild)(this.hbuttonbox2 [this.button5])); global::Gtk.ButtonBox.ButtonBoxChild w21 = ((global::Gtk.ButtonBox.ButtonBoxChild)(this.hbuttonbox2 [this.btnActiv]));
w21.Expand = false; w21.Expand = false;
w21.Fill = false; w21.Fill = false;
// Container child hbuttonbox2.Gtk.ButtonBox+ButtonBoxChild // Container child hbuttonbox2.Gtk.ButtonBox+ButtonBoxChild
this.button6 = new global::Gtk.Button (); this.btnDesactiv = new global::Gtk.Button ();
this.button6.CanFocus = true; this.btnDesactiv.Sensitive = false;
this.button6.Name = "button6"; this.btnDesactiv.CanFocus = true;
this.button6.UseUnderline = true; this.btnDesactiv.Name = "btnDesactiv";
// Container child button6.Gtk.Container+ContainerChild this.btnDesactiv.UseUnderline = true;
// Container child btnDesactiv.Gtk.Container+ContainerChild
global::Gtk.Alignment w22 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F); global::Gtk.Alignment w22 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F);
// Container child GtkAlignment.Gtk.Container+ContainerChild // Container child GtkAlignment.Gtk.Container+ContainerChild
global::Gtk.HBox w23 = new global::Gtk.HBox (); global::Gtk.HBox w23 = new global::Gtk.HBox ();
@ -201,9 +203,9 @@ namespace DMX2
w26.UseUnderline = true; w26.UseUnderline = true;
w23.Add (w26); w23.Add (w26);
w22.Add (w23); w22.Add (w23);
this.button6.Add (w22); this.btnDesactiv.Add (w22);
this.hbuttonbox2.Add (this.button6); this.hbuttonbox2.Add (this.btnDesactiv);
global::Gtk.ButtonBox.ButtonBoxChild w30 = ((global::Gtk.ButtonBox.ButtonBoxChild)(this.hbuttonbox2 [this.button6])); global::Gtk.ButtonBox.ButtonBoxChild w30 = ((global::Gtk.ButtonBox.ButtonBoxChild)(this.hbuttonbox2 [this.btnDesactiv]));
w30.Position = 1; w30.Position = 1;
w30.Expand = false; w30.Expand = false;
w30.Fill = false; w30.Fill = false;
@ -234,10 +236,11 @@ namespace DMX2
this.GtkScrolledWindow.Name = "GtkScrolledWindow"; this.GtkScrolledWindow.Name = "GtkScrolledWindow";
this.GtkScrolledWindow.ShadowType = ((global::Gtk.ShadowType)(1)); this.GtkScrolledWindow.ShadowType = ((global::Gtk.ShadowType)(1));
// Container child GtkScrolledWindow.Gtk.Container+ContainerChild // Container child GtkScrolledWindow.Gtk.Container+ContainerChild
this.treeview1 = new global::Gtk.TreeView (); this.listDetect = new global::Gtk.TreeView ();
this.treeview1.CanFocus = true; this.listDetect.CanFocus = true;
this.treeview1.Name = "treeview1"; this.listDetect.Name = "listDetect";
this.GtkScrolledWindow.Add (this.treeview1); this.listDetect.HeadersVisible = false;
this.GtkScrolledWindow.Add (this.listDetect);
this.vbox2.Add (this.GtkScrolledWindow); this.vbox2.Add (this.GtkScrolledWindow);
global::Gtk.Box.BoxChild w34 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.GtkScrolledWindow])); global::Gtk.Box.BoxChild w34 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.GtkScrolledWindow]));
w34.Position = 1; w34.Position = 1;
@ -264,10 +267,11 @@ namespace DMX2
this.GtkScrolledWindow1.Name = "GtkScrolledWindow1"; this.GtkScrolledWindow1.Name = "GtkScrolledWindow1";
this.GtkScrolledWindow1.ShadowType = ((global::Gtk.ShadowType)(1)); this.GtkScrolledWindow1.ShadowType = ((global::Gtk.ShadowType)(1));
// Container child GtkScrolledWindow1.Gtk.Container+ContainerChild // Container child GtkScrolledWindow1.Gtk.Container+ContainerChild
this.treeview2 = new global::Gtk.TreeView (); this.listKnown = new global::Gtk.TreeView ();
this.treeview2.CanFocus = true; this.listKnown.CanFocus = true;
this.treeview2.Name = "treeview2"; this.listKnown.Name = "listKnown";
this.GtkScrolledWindow1.Add (this.treeview2); this.listKnown.HeadersVisible = false;
this.GtkScrolledWindow1.Add (this.listKnown);
this.vbox3.Add (this.GtkScrolledWindow1); this.vbox3.Add (this.GtkScrolledWindow1);
global::Gtk.Box.BoxChild w38 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.GtkScrolledWindow1])); global::Gtk.Box.BoxChild w38 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.GtkScrolledWindow1]));
w38.Position = 1; w38.Position = 1;
@ -301,9 +305,13 @@ namespace DMX2
if ((this.Child != null)) { if ((this.Child != null)) {
this.Child.ShowAll (); this.Child.ShowAll ();
} }
this.DefaultWidth = 667; this.DefaultWidth = 587;
this.DefaultHeight = 424; this.DefaultHeight = 503;
this.Show (); 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.buttonClose.Clicked += new global::System.EventHandler (this.OnButtonCloseClicked); this.buttonClose.Clicked += new global::System.EventHandler (this.OnButtonCloseClicked);
} }
} }

View file

@ -3079,7 +3079,7 @@ trames DMX (ms)</property>
</widget> </widget>
</child> </child>
</widget> </widget>
<widget class="Gtk.Dialog" id="DMX2.GestionMidiUI" design-size="667 424"> <widget class="Gtk.Dialog" id="DMX2.GestionMidiUI" design-size="587 503">
<property name="MemberName" /> <property name="MemberName" />
<property name="Title" translatable="yes">Connexions Midi</property> <property name="Title" translatable="yes">Connexions Midi</property>
<property name="WindowPosition">CenterOnParent</property> <property name="WindowPosition">CenterOnParent</property>
@ -3102,7 +3102,7 @@ trames DMX (ms)</property>
<child> <child>
<widget class="Gtk.Frame" id="frame2"> <widget class="Gtk.Frame" id="frame2">
<property name="MemberName" /> <property name="MemberName" />
<property name="ShadowType">None</property> <property name="ShadowType">In</property>
<child> <child>
<widget class="Gtk.Alignment" id="GtkAlignment3"> <widget class="Gtk.Alignment" id="GtkAlignment3">
<property name="MemberName" /> <property name="MemberName" />
@ -3208,7 +3208,7 @@ le canal midi 1</property>
<child> <child>
<widget class="Gtk.Frame" id="frame3"> <widget class="Gtk.Frame" id="frame3">
<property name="MemberName" /> <property name="MemberName" />
<property name="ShadowType">None</property> <property name="ShadowType">In</property>
<child> <child>
<widget class="Gtk.Alignment" id="GtkAlignment2"> <widget class="Gtk.Alignment" id="GtkAlignment2">
<property name="MemberName" /> <property name="MemberName" />
@ -3276,13 +3276,15 @@ le canal midi 1</property>
<property name="MemberName" /> <property name="MemberName" />
<property name="Size">2</property> <property name="Size">2</property>
<child> <child>
<widget class="Gtk.Button" id="button5"> <widget class="Gtk.Button" id="btnActiv">
<property name="MemberName" /> <property name="MemberName" />
<property name="Sensitive">False</property>
<property name="CanFocus">True</property> <property name="CanFocus">True</property>
<property name="Type">TextAndIcon</property> <property name="Type">TextAndIcon</property>
<property name="Icon">stock:gtk-go-down Menu</property> <property name="Icon">stock:gtk-go-down Menu</property>
<property name="Label" translatable="yes">Activer</property> <property name="Label" translatable="yes">Activer</property>
<property name="UseUnderline">True</property> <property name="UseUnderline">True</property>
<signal name="Clicked" handler="OnBtnActivClicked" />
</widget> </widget>
<packing> <packing>
<property name="Expand">False</property> <property name="Expand">False</property>
@ -3290,13 +3292,15 @@ le canal midi 1</property>
</packing> </packing>
</child> </child>
<child> <child>
<widget class="Gtk.Button" id="button6"> <widget class="Gtk.Button" id="btnDesactiv">
<property name="MemberName" /> <property name="MemberName" />
<property name="Sensitive">False</property>
<property name="CanFocus">True</property> <property name="CanFocus">True</property>
<property name="Type">TextAndIcon</property> <property name="Type">TextAndIcon</property>
<property name="Icon">stock:gtk-go-up Menu</property> <property name="Icon">stock:gtk-go-up Menu</property>
<property name="Label" translatable="yes">Désactiver</property> <property name="Label" translatable="yes">Désactiver</property>
<property name="UseUnderline">True</property> <property name="UseUnderline">True</property>
<signal name="Clicked" handler="OnBtnDesactivClicked" />
</widget> </widget>
<packing> <packing>
<property name="Position">1</property> <property name="Position">1</property>
@ -3343,10 +3347,12 @@ le canal midi 1</property>
<property name="MemberName" /> <property name="MemberName" />
<property name="ShadowType">In</property> <property name="ShadowType">In</property>
<child> <child>
<widget class="Gtk.TreeView" id="treeview1"> <widget class="Gtk.TreeView" id="listDetect">
<property name="MemberName" /> <property name="MemberName" />
<property name="CanFocus">True</property> <property name="CanFocus">True</property>
<property name="ShowScrollbars">True</property> <property name="ShowScrollbars">True</property>
<property name="HeadersVisible">False</property>
<signal name="CursorChanged" handler="OnListDetectCursorChanged" />
</widget> </widget>
</child> </child>
</widget> </widget>
@ -3390,10 +3396,12 @@ le canal midi 1</property>
<property name="MemberName" /> <property name="MemberName" />
<property name="ShadowType">In</property> <property name="ShadowType">In</property>
<child> <child>
<widget class="Gtk.TreeView" id="treeview2"> <widget class="Gtk.TreeView" id="listKnown">
<property name="MemberName" /> <property name="MemberName" />
<property name="CanFocus">True</property> <property name="CanFocus">True</property>
<property name="ShowScrollbars">True</property> <property name="ShowScrollbars">True</property>
<property name="HeadersVisible">False</property>
<signal name="CursorChanged" handler="OnListKnownCursorChanged" />
</widget> </widget>
</child> </child>
</widget> </widget>