Restauration de la détection des perifs physiques

This commit is contained in:
tzim 2018-10-06 23:35:45 +02:00
parent 4bae84ee23
commit 4075ca7f34
3 changed files with 450 additions and 348 deletions

View file

@ -70,11 +70,11 @@ namespace DMX2
return Invoke.snd_seq_connect_to (seq_handle.Handle, portid, p.ClientId, p.PortId) == 0; return Invoke.snd_seq_connect_to (seq_handle.Handle, portid, p.ClientId, p.PortId) == 0;
} }
internal bool ConnectTo(int client, int port){ /*internal bool ConnectTo(int client, int port){
if (seq_handle == null) if (seq_handle == null)
throw new InvalidOperationException (); throw new InvalidOperationException ();
return Invoke.snd_seq_connect_to (seq_handle.Handle, portid, client, port) == 0; return Invoke.snd_seq_connect_to (seq_handle.Handle, portid, client, port) == 0;
} }*/
public bool ConnectFrom(Port p){ public bool ConnectFrom(Port p){
if (seq_handle == null) if (seq_handle == null)

View file

@ -13,7 +13,7 @@ namespace DMX2
//static int outport; //static int outport;
static System.Threading.Thread eventthread = null; static System.Threading.Thread eventthread = null;
static MidiPort systemPort = null; //static MidiPort systemPort = null;
static internal Dictionary<int, MidiPort> openports = new Dictionary<int, MidiPort>(); static internal Dictionary<int, MidiPort> openports = new Dictionary<int, MidiPort>();
@ -129,6 +129,7 @@ namespace DMX2
clientId = _clientId; clientId = _clientId;
portId = _portId; portId = _portId;
srcid = clientId << 8 + portId; srcid = clientId << 8 + portId;
ports.Add(srcid, this);
} }
private void Updateinfo (PointerWrapper portInfo) private void Updateinfo (PointerWrapper portInfo)
@ -177,8 +178,8 @@ namespace DMX2
System.Threading.ThreadStart ts = new System.Threading.ThreadStart (EventLoop); System.Threading.ThreadStart ts = new System.Threading.ThreadStart (EventLoop);
eventthread = new System.Threading.Thread (ts); eventthread = new System.Threading.Thread (ts);
eventthread.Start(); eventthread.Start();
systemPort = new MidiPort ("system"); //systemPort = new MidiPort ("system");
systemPort.ConnectTo (SND_SEQ_CLIENT_SYSTEM, SND_SEQ_PORT_SYSTEM_ANNOUNCE); //systemPort.ConnectTo (SND_SEQ_CLIENT_SYSTEM, SND_SEQ_PORT_SYSTEM_ANNOUNCE);
} }
public static void Close () public static void Close ()
@ -201,16 +202,16 @@ namespace DMX2
// liberation du pointeur // liberation du pointeur
Invoke.snd_seq_free_event (evPtr); Invoke.snd_seq_free_event (evPtr);
if (ev.dest.port == systemPort.portid) { /*if (ev.dest.port == systemPort.portid) {
if (ev.type == AlsaSeqLib.snd_seq_event_type_t.SND_SEQ_EVENT_PORT_START) { if (ev.type == AlsaSeqLib.snd_seq_event_type_t.SND_SEQ_EVENT_PORT_START) {
} }
} else { } else {*/
// queue // queue
if (openports.ContainsKey (ev.dest.port)) { if (openports.ContainsKey (ev.dest.port)) {
openports [ev.dest.port].eventqueue.Enqueue (ev); openports [ev.dest.port].eventqueue.Enqueue (ev);
} }
} //}
} }
System.Threading.Thread.Sleep (1); System.Threading.Thread.Sleep (1);
} }

File diff suppressed because it is too large Load diff