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

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

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

revision 2499 by schoenebeck, Tue Oct 5 10:35:13 2010 UTC revision 2500 by schoenebeck, Fri Jan 10 12:20:05 2014 UTC
# Line 3  Line 3 
3   *   LinuxSampler - modular, streaming capable sampler                     *   *   LinuxSampler - modular, streaming capable sampler                     *
4   *                                                                         *   *                                                                         *
5   *   Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck   *   *   Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck   *
6   *   Copyright (C) 2005 - 2010 Christian Schoenebeck                       *   *   Copyright (C) 2005 - 2014 Christian Schoenebeck                       *
7   *                                                                         *   *                                                                         *
8   *   This program is free software; you can redistribute it and/or modify  *   *   This program is free software; you can redistribute it and/or modify  *
9   *   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 25  Line 25 
25    
26  #include "../../common/global_private.h"  #include "../../common/global_private.h"
27  #include "../../Sampler.h"  #include "../../Sampler.h"
28    #include "MidiInputDeviceFactory.h"
29    
30  namespace LinuxSampler {  namespace LinuxSampler {
31    
# Line 118  namespace LinuxSampler { Line 119  namespace LinuxSampler {
119          std::map<uint, SamplerChannel*>::iterator iter = channels.begin();          std::map<uint, SamplerChannel*>::iterator iter = channels.begin();
120          for (; iter != channels.end(); iter++) {          for (; iter != channels.end(); iter++) {
121              SamplerChannel* chn = iter->second;              SamplerChannel* chn = iter->second;
122              if (chn->GetMidiInputDevice() == NULL || chn->GetMidiInputDevice() != pDevice) {              std::vector<MidiInputPort*> vPorts = chn->GetMidiInputPorts();
123                  continue;              for (int k = 0; k < vPorts.size(); ++k) {
124              }                  if (vPorts[k]->GetDevice() != pDevice)
125                        continue;
126              int port = chn->GetMidiInputPort();                  int port = vPorts[k]->GetPortNumber();
127              if (port >= i) {                  if (port >= i) {
128                  String err = "Sampler channel " + ToString(iter->first);                      String err = "Sampler channel " + ToString(iter->first);
129                  err += " is still connected to MIDI port " + ToString(port);                      err += " is still connected to MIDI port " + ToString(port);
130                  throw Exception(err);                      throw Exception(err);
131                    }
132              }              }
133          }          }
134    
# Line 169  namespace LinuxSampler { Line 171  namespace LinuxSampler {
171          return Parameters;          return Parameters;
172      }      }
173    
174        int MidiInputDevice::MidiInputDeviceID() {
175            std::map<uint, MidiInputDevice*> mDevices = MidiInputDeviceFactory::Devices();
176            for (std::map<uint, MidiInputDevice*>::const_iterator it = mDevices.begin(); it != mDevices.end(); ++it) {
177                if (it->second == this) {
178                    return it->first;
179                }
180            }
181            return -1;
182        }
183    
184      void MidiInputDevice::AddMidiPortCountListener(MidiPortCountListener* l) {      void MidiInputDevice::AddMidiPortCountListener(MidiPortCountListener* l) {
185          portCountListeners.AddListener(l);          portCountListeners.AddListener(l);
186      }      }

Legend:
Removed from v.2499  
changed lines
  Added in v.2500

  ViewVC Help
Powered by ViewVC