/[svn]/linuxsampler/trunk/src/drivers/midi/MidiInputDeviceJack.cpp
ViewVC logotype

Diff of /linuxsampler/trunk/src/drivers/midi/MidiInputDeviceJack.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2113 by schoenebeck, Sun Aug 30 11:27:35 2009 UTC revision 2114 by persson, Tue Aug 10 12:05:19 2010 UTC
# Line 1  Line 1 
1  /***************************************************************************  /***************************************************************************
2   *                                                                         *   *                                                                         *
3   *   Copyright (C) 2008 Andreas Persson                                    *   *   Copyright (C) 2008 - 2010 Andreas Persson                             *
4   *                                                                         *   *                                                                         *
5   *   This program is free software; you can redistribute it and/or modify  *   *   This program is free software; you can redistribute it and/or modify  *
6   *   it under the terms of the GNU General Public License as published by  *   *   it under the terms of the GNU General Public License as published by  *
# Line 165  namespace LinuxSampler { Line 165  namespace LinuxSampler {
165          hJackClient = pJackClient->hJackClient;          hJackClient = pJackClient->hJackClient;
166          existingJackDevices++;          existingJackDevices++;
167    
168          AcquirePorts(((DeviceCreationParameterInt*)Parameters["PORTS"])->ValueAsInt());          AcquirePorts(((DeviceCreationParameterInt*)Parameters["PORTS"])->ValueAsInt());
169          if (((DeviceCreationParameterBool*)Parameters["ACTIVE"])->ValueAsBool()) {          if (((DeviceCreationParameterBool*)Parameters["ACTIVE"])->ValueAsBool()) {
170              Listen();              Listen();
171          }          }
172      }      }
173    
174      MidiInputDeviceJack::~MidiInputDeviceJack() {      MidiInputDeviceJack::~MidiInputDeviceJack() {
# Line 210  namespace LinuxSampler { Line 210  namespace LinuxSampler {
210      }      }
211    
212      String MidiInputDeviceJack::Version() {      String MidiInputDeviceJack::Version() {
213          String s = "$Revision: 1.4 $";          String s = "$Revision: 1.5 $";
214          return s.substr(11, s.size() - 13); // cut dollar signs, spaces and CVS macro keyword          return s.substr(11, s.size() - 13); // cut dollar signs, spaces and CVS macro keyword
215      }      }
216    
# Line 225  namespace LinuxSampler { Line 225  namespace LinuxSampler {
225  #else  #else
226              int event_count = jack_midi_get_event_count(port_buffer);              int event_count = jack_midi_get_event_count(port_buffer);
227  #endif  #endif
228              for (int i = 0 ; i < event_count ; i++)              for (int i = 0 ; i < event_count ; i++) {
             {  
229                  jack_midi_event_t ev;                  jack_midi_event_t ev;
230  #if JACK_MIDI_FUNCS_NEED_NFRAMES  #if JACK_MIDI_FUNCS_NEED_NFRAMES
231                  jack_midi_event_get(&ev, port_buffer, i, nsamples); // old jack version                  jack_midi_event_get(&ev, port_buffer, i, nsamples); // old jack version
232  #else  #else
233                  jack_midi_event_get(&ev, port_buffer, i);                  jack_midi_event_get(&ev, port_buffer, i);
234  #endif  #endif
235                  port->DispatchRaw(ev.buffer, ev.time);                  if (ev.buffer) { // jack2 1.9.5 has been seen sending NULL here
236                        port->DispatchRaw(ev.buffer, ev.time);
237                    }
238              }              }
239          }          }
240      }      }

Legend:
Removed from v.2113  
changed lines
  Added in v.2114

  ViewVC Help
Powered by ViewVC