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

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

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

revision 970 by schoenebeck, Wed Dec 6 22:28:17 2006 UTC revision 2427 by persson, Sat Mar 2 07:03:04 2013 UTC
# Line 1  Line 1 
1  /***************************************************************************  /***************************************************************************
2   *                                                                         *   *                                                                         *
3   *   Copyright (C) 2006 Christian Schoenebeck                              *   *   Copyright (C) 2006 - 2013 Christian Schoenebeck                       *
4   *                                                                         *   *                                                                         *
5   *   This library is free software; you can redistribute it and/or modify  *   *   This library 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 20  Line 20 
20    
21  #include "MidiInstrumentMapper.h"  #include "MidiInstrumentMapper.h"
22    
23    #include "../../common/global_private.h"
24  #include "../../common/Mutex.h"  #include "../../common/Mutex.h"
25  #include "../../engines/EngineFactory.h"  #include "../../engines/EngineFactory.h"
26  #include "../../engines/Engine.h"  #include "../../engines/Engine.h"
27    
28    #include <RIFF.h>
29    
30  namespace LinuxSampler {  namespace LinuxSampler {
31    
32      // same as entry_t but without 'LoadMode'      // same as entry_t but without 'LoadMode'
# Line 35  namespace LinuxSampler { Line 38  namespace LinuxSampler {
38          String Name;          String Name;
39      };      };
40    
41      // here we store all mappings (MIDI bank&prog) -> (Engine,File,Index)      // internal map type (MIDI bank&prog) -> (Engine,File,Index)
42      std::map<midi_prog_index_t,private_entry_t> midiMap;      class MidiInstrumentMap : public std::map<midi_prog_index_t,private_entry_t> {
43            public:
44                String name;
45        };
46    
47        // here we store all maps
48        std::map<int,MidiInstrumentMap> midiMaps;
49    
50        // for synchronization of midiMaps
51        Mutex midiMapsMutex;
52    
53        ListenerList<MidiInstrumentCountListener*> MidiInstrumentMapper::llMidiInstrumentCountListeners;
54        ListenerList<MidiInstrumentInfoListener*> MidiInstrumentMapper::llMidiInstrumentInfoListeners;
55        ListenerList<MidiInstrumentMapCountListener*> MidiInstrumentMapper::llMidiInstrumentMapCountListeners;
56        ListenerList<MidiInstrumentMapInfoListener*> MidiInstrumentMapper::llMidiInstrumentMapInfoListeners;
57        int MidiInstrumentMapper::DefaultMap;
58        
59        void MidiInstrumentMapper::AddMidiInstrumentCountListener(MidiInstrumentCountListener* l) {
60            llMidiInstrumentCountListeners.AddListener(l);
61        }
62    
63        void MidiInstrumentMapper::RemoveMidiInstrumentCountListener(MidiInstrumentCountListener* l) {
64            llMidiInstrumentCountListeners.RemoveListener(l);
65        }
66    
67        void MidiInstrumentMapper::fireMidiInstrumentCountChanged(int MapId, int NewCount) {
68            for (int i = 0; i < llMidiInstrumentCountListeners.GetListenerCount(); i++) {
69                llMidiInstrumentCountListeners.GetListener(i)->MidiInstrumentCountChanged(MapId, NewCount);
70            }
71        }
72    
73        void MidiInstrumentMapper::AddMidiInstrumentInfoListener(MidiInstrumentInfoListener* l) {
74            llMidiInstrumentInfoListeners.AddListener(l);
75        }
76    
77        void MidiInstrumentMapper::RemoveMidiInstrumentInfoListener(MidiInstrumentInfoListener* l) {
78            llMidiInstrumentInfoListeners.RemoveListener(l);
79        }
80    
81        void MidiInstrumentMapper::fireMidiInstrumentInfoChanged(int MapId, int Bank, int Program) {
82            for (int i = 0; i < llMidiInstrumentInfoListeners.GetListenerCount(); i++) {
83                llMidiInstrumentInfoListeners.GetListener(i)->MidiInstrumentInfoChanged(MapId, Bank, Program);
84            }
85        }
86    
87        void MidiInstrumentMapper::AddMidiInstrumentMapCountListener(MidiInstrumentMapCountListener* l) {
88            llMidiInstrumentMapCountListeners.AddListener(l);
89        }
90    
91      // for synchronization of midiMap      void MidiInstrumentMapper::RemoveMidiInstrumentMapCountListener(MidiInstrumentMapCountListener* l) {
92      Mutex midiMapMutex;          llMidiInstrumentMapCountListeners.RemoveListener(l);
93        }
94    
95        void MidiInstrumentMapper::fireMidiInstrumentMapCountChanged(int NewCount) {
96            for (int i = 0; i < llMidiInstrumentMapCountListeners.GetListenerCount(); i++) {
97                llMidiInstrumentMapCountListeners.GetListener(i)->MidiInstrumentMapCountChanged(NewCount);
98            }
99        }
100    
101        void MidiInstrumentMapper::AddMidiInstrumentMapInfoListener(MidiInstrumentMapInfoListener* l) {
102            llMidiInstrumentMapInfoListeners.AddListener(l);
103        }
104    
105        void MidiInstrumentMapper::RemoveMidiInstrumentMapInfoListener(MidiInstrumentMapInfoListener* l) {
106            llMidiInstrumentMapInfoListeners.RemoveListener(l);
107        }
108    
109        void MidiInstrumentMapper::fireMidiInstrumentMapInfoChanged(int MapId) {
110            for (int i = 0; i < llMidiInstrumentMapInfoListeners.GetListenerCount(); i++) {
111                llMidiInstrumentMapInfoListeners.GetListener(i)->MidiInstrumentMapInfoChanged(MapId);
112            }
113        }
114    
115      void MidiInstrumentMapper::AddOrReplaceMapping(midi_prog_index_t Index, entry_t Entry, bool bInBackground) throw (Exception) {      void MidiInstrumentMapper::AddOrReplaceEntry(int Map, midi_prog_index_t Index, entry_t Entry, bool bInBackground) throw (Exception) {
116          if (bInBackground) {          if (bInBackground) {
117              dmsg(3,("MidiInstrumentMapper: updating mapping (%d,%d,%d) -> ('%s','%s',%d) with vol=%f, mode=%d in background\n",              dmsg(3,("MidiInstrumentMapper: updating mapping %d (%d,%d,%d) -> ('%s','%s',%d) with vol=%f, mode=%d in background\n",
118                    Map,
119                  Index.midi_bank_msb,Index.midi_bank_lsb,Index.midi_prog,                  Index.midi_bank_msb,Index.midi_bank_lsb,Index.midi_prog,
120                  Entry.EngineName.c_str(),Entry.InstrumentFile.c_str(),Entry.InstrumentIndex,                  Entry.EngineName.c_str(),Entry.InstrumentFile.c_str(),Entry.InstrumentIndex,
121                  Entry.Volume,Entry.LoadMode)                  Entry.Volume,Entry.LoadMode)
122              );              );
123          } else {          } else {
124              dmsg(3,("MidiInstrumentMapper: updating mapping (%d,%d,%d) -> ('%s','%s',%d) with vol=%f, mode=%d\n",              dmsg(3,("MidiInstrumentMapper: updating mapping %d (%d,%d,%d) -> ('%s','%s',%d) with vol=%f, mode=%d\n",
125                    Map,
126                  Index.midi_bank_msb,Index.midi_bank_lsb,Index.midi_prog,                  Index.midi_bank_msb,Index.midi_bank_lsb,Index.midi_prog,
127                  Entry.EngineName.c_str(),Entry.InstrumentFile.c_str(),Entry.InstrumentIndex,                  Entry.EngineName.c_str(),Entry.InstrumentFile.c_str(),Entry.InstrumentIndex,
128                  Entry.Volume,Entry.LoadMode)                  Entry.Volume,Entry.LoadMode)
129              );              );
130          }          }
131            {
132                LockGuard lock(midiMapsMutex);
133                if (midiMaps.empty()) {
134                    throw Exception("There is no MIDI instrument map, you have to add one first.");
135                }
136            }
137          if (!Entry.InstrumentFile.size())          if (!Entry.InstrumentFile.size())
138              throw Exception("No instrument file name given");              throw Exception("No instrument file name given");
139            // TODO: an easy one - we should check here if given file exists and throw an exception if it doesn't
140          if (Entry.Volume < 0.0)          if (Entry.Volume < 0.0)
141              throw Exception("Volume may not be a negative value");              throw Exception("Volume may not be a negative value");
142          Engine* pEngine = EngineFactory::Create(Entry.EngineName);          Engine* pEngine = EngineFactory::Create(Entry.EngineName);
# Line 68  namespace LinuxSampler { Line 147  namespace LinuxSampler {
147              InstrumentManager::instrument_id_t id;              InstrumentManager::instrument_id_t id;
148              id.FileName = Entry.InstrumentFile;              id.FileName = Entry.InstrumentFile;
149              id.Index    = Entry.InstrumentIndex;              id.Index    = Entry.InstrumentIndex;
150              if (Entry.LoadMode != VOID) {              if (Entry.LoadMode != DONTCARE) {
151                  if (bInBackground)                  if (bInBackground)
152                      pEngine->GetInstrumentManager()->SetModeInBackground(id, static_cast<InstrumentManager::mode_t>(Entry.LoadMode));                      pEngine->GetInstrumentManager()->SetModeInBackground(id, static_cast<InstrumentManager::mode_t>(Entry.LoadMode));
153                  else                  else
154                      pEngine->GetInstrumentManager()->SetMode(id, static_cast<InstrumentManager::mode_t>(Entry.LoadMode));                      try { pEngine->GetInstrumentManager()->SetMode(id, static_cast<InstrumentManager::mode_t>(Entry.LoadMode)); }
155                        catch (RIFF::Exception e) { throw Exception(e.Message); }
156              }              }
157          } else {          } else {
158              dmsg(1,("WARNING: no InstrumentManager for engine '%s'\n",Entry.EngineName.c_str()));              dmsg(1,("WARNING: no InstrumentManager for engine '%s'\n",Entry.EngineName.c_str()));
# Line 83  namespace LinuxSampler { Line 163  namespace LinuxSampler {
163          privateEntry.InstrumentIndex = Entry.InstrumentIndex;          privateEntry.InstrumentIndex = Entry.InstrumentIndex;
164          privateEntry.Volume          = Entry.Volume;          privateEntry.Volume          = Entry.Volume;
165          privateEntry.Name            = Entry.Name;          privateEntry.Name            = Entry.Name;
166          midiMapMutex.Lock();  
167          midiMap[Index] = privateEntry;          bool Replaced = false;
168          midiMapMutex.Unlock();          int InstrCount = 0;
169            bool MapFound = false;
170            {
171                LockGuard lock(midiMapsMutex);
172                std::map<int,MidiInstrumentMap>::iterator iterMap = midiMaps.find(Map);
173                if (iterMap != midiMaps.end()) { // map found
174                    MapFound = true;
175                    Replaced = (iterMap->second.find(Index) != iterMap->second.end());
176                    iterMap->second[Index] = privateEntry;
177                    InstrCount = iterMap->second.size();
178                }
179            }
180          EngineFactory::Destroy(pEngine);          EngineFactory::Destroy(pEngine);
181            if (!MapFound) {
182                throw Exception("There is no MIDI instrument map " + ToString(Map));
183            }
184    
185            if (Replaced) {
186                int Bank = (int(Index.midi_bank_msb) << 7) | int(Index.midi_bank_lsb);
187                fireMidiInstrumentInfoChanged(Map, Bank, Index.midi_prog);
188            } else {
189                fireMidiInstrumentCountChanged(Map, InstrCount);
190            }
191      }      }
192    
193      void MidiInstrumentMapper::RemoveMapping(midi_prog_index_t Index) {      void MidiInstrumentMapper::SetLoadMode(entry_t* pEntry) {
194          midiMapMutex.Lock();          Engine* pEngine = EngineFactory::Create(pEntry->EngineName);
195          midiMap.erase(Index);          if (!pEngine) { // invalid mapping
196          midiMapMutex.Unlock();              throw Exception("Invalid mapping");
197            }
198    
199            InstrumentManager* pManager = pEngine->GetInstrumentManager();
200            if (pManager) { // engine provides an InstrumentManager
201                InstrumentManager::instrument_id_t id;
202                id.FileName = pEntry->InstrumentFile;
203                id.Index    = pEntry->InstrumentIndex;
204                pEntry->LoadMode = static_cast<mode_t>(pManager->GetMode(id));
205            } else { // engine does not provide an InstrumentManager
206                // use default value
207                pEntry->LoadMode = ON_DEMAND;
208            }
209    
210            EngineFactory::Destroy(pEngine);
211      }      }
212    
213      void MidiInstrumentMapper::RemoveAllMappings() {      MidiInstrumentMapper::entry_t MidiInstrumentMapper::GetEntry(int Map, uint MidiBank, uint MidiProg) {
214          midiMapMutex.Lock();          LockGuard lock(midiMapsMutex);
215          midiMap.clear();  
216          midiMapMutex.Unlock();          std::map<int,MidiInstrumentMap>::iterator iterMap = midiMaps.find(Map);
217            if (iterMap == midiMaps.end()) { // no such map
218                throw Exception("There is no MIDI instrument map " + ToString(Map));
219            }
220    
221            midi_prog_index_t idx;
222            idx.midi_bank_msb = (MidiBank >> 7) & 0x7f;
223            idx.midi_bank_lsb = MidiBank & 0x7f;
224            idx.midi_prog     = MidiProg;
225    
226            std::map<midi_prog_index_t,private_entry_t>::iterator iterEntry = iterMap->second.find(idx);
227            if (iterEntry == iterMap->second.end()) {
228                throw Exception("There is no map entry with that index");
229            }
230    
231            entry_t entry;
232            entry.EngineName      = iterEntry->second.EngineName;
233            entry.InstrumentFile  = iterEntry->second.InstrumentFile;
234            entry.InstrumentIndex = iterEntry->second.InstrumentIndex;
235            entry.Volume          = iterEntry->second.Volume;
236            entry.Name            = iterEntry->second.Name;
237    
238            try {
239                SetLoadMode(&entry);
240            } catch(Exception e) {
241                throw e;
242            }
243    
244            return entry;
245      }      }
246    
247      std::map<midi_prog_index_t,MidiInstrumentMapper::entry_t> MidiInstrumentMapper::Mappings() {      void MidiInstrumentMapper::RemoveEntry(int Map, midi_prog_index_t Index) {
248            int InstrCount = -1;
249            {
250                LockGuard lock(midiMapsMutex);
251    
252                std::map<int,MidiInstrumentMap>::iterator iterMap = midiMaps.find(Map);
253                if (iterMap != midiMaps.end()) { // map found
254                    iterMap->second.erase(Index); // remove entry
255                    InstrCount = iterMap->second.size();
256                }
257            }
258            
259            if (InstrCount != -1) {
260                fireMidiInstrumentCountChanged(Map, InstrCount);
261            }
262        }
263    
264        void MidiInstrumentMapper::RemoveAllEntries(int Map) {
265            int InstrCount = -1;
266            {
267                LockGuard lock(midiMapsMutex);
268    
269                std::map<int,MidiInstrumentMap>::iterator iterMap = midiMaps.find(Map);
270                if (iterMap != midiMaps.end()) { // map found
271                    iterMap->second.clear(); // clear that map
272                    InstrCount = 0;
273                }
274            }
275            
276            if (InstrCount != -1) {
277                fireMidiInstrumentCountChanged(Map, InstrCount);
278            }
279        }
280    
281        std::map<midi_prog_index_t,MidiInstrumentMapper::entry_t> MidiInstrumentMapper::Entries(int Map) throw (Exception) {
282          std::map<midi_prog_index_t,entry_t> result;          std::map<midi_prog_index_t,entry_t> result;
283    
284          // copy the internal map first          // copy the internal map first
285          midiMapMutex.Lock();          {
286          for (std::map<midi_prog_index_t,private_entry_t>::iterator iter = midiMap.begin();              LockGuard lock(midiMapsMutex);
287               iter != midiMap.end(); iter++)  
288          {              std::map<int,MidiInstrumentMap>::iterator iterMap = midiMaps.find(Map);
289              entry_t entry;              if (iterMap == midiMaps.end()) { // no such map
290              entry.EngineName      = iter->second.EngineName;                  throw Exception("There is no MIDI instrument map " + ToString(Map));
291              entry.InstrumentFile  = iter->second.InstrumentFile;              }
292              entry.InstrumentIndex = iter->second.InstrumentIndex;              for (std::map<midi_prog_index_t,private_entry_t>::iterator iterEntry = iterMap->second.begin();
293              entry.Volume          = iter->second.Volume;                   iterEntry != iterMap->second.end(); iterEntry++)
294              entry.Name            = iter->second.Name;              {
295              result[iter->first] = entry;                  entry_t entry;
296                    entry.EngineName      = iterEntry->second.EngineName;
297                    entry.InstrumentFile  = iterEntry->second.InstrumentFile;
298                    entry.InstrumentIndex = iterEntry->second.InstrumentIndex;
299                    entry.Volume          = iterEntry->second.Volume;
300                    entry.Name            = iterEntry->second.Name;
301                    result[iterEntry->first] = entry;
302                }
303          }          }
304          midiMapMutex.Unlock();  
305          // complete it with current LoadMode of each entry          // complete it with current LoadMode of each entry
306          for (std::map<midi_prog_index_t,entry_t>::iterator iter = result.begin();          for (std::map<midi_prog_index_t,entry_t>::iterator iter = result.begin();
307               iter != result.end(); iter++)               iter != result.end(); iter++)
308          {          {
309              entry_t& entry = iter->second;              try {
310              Engine* pEngine = EngineFactory::Create(entry.EngineName);                  SetLoadMode(&(iter->second));
311              if (!pEngine) { // invalid mapping              } catch(Exception e) {
312                  RemoveMapping(iter->first);                  RemoveEntry(Map, iter->first);
313                  result.erase(iter);                  result.erase(iter);
                 continue;  
             }  
             InstrumentManager* pManager = pEngine->GetInstrumentManager();  
             if (pManager) { // engine provides an InstrumentManager  
                 InstrumentManager::instrument_id_t id;  
                 id.FileName = entry.InstrumentFile;  
                 id.Index    = entry.InstrumentIndex;  
                 entry.LoadMode = static_cast<mode_t>(pManager->GetMode(id));  
             } else { // engine does not provide an InstrumentManager  
                 // use default value  
                 entry.LoadMode = ON_DEMAND;  
314              }              }
             EngineFactory::Destroy(pEngine);  
315          }          }
316          return result;          return result;
317      }      }
318    
319      optional<MidiInstrumentMapper::entry_t> MidiInstrumentMapper::GetEntry(midi_prog_index_t Index) {      std::vector<int> MidiInstrumentMapper::Maps() {
320            std::vector<int> result;
321            LockGuard lock(midiMapsMutex);
322            for (std::map<int,MidiInstrumentMap>::iterator iterMap = midiMaps.begin();
323                 iterMap != midiMaps.end(); iterMap++)
324            {
325                result.push_back(iterMap->first);
326            }
327            return result;
328        }
329    
330        int MidiInstrumentMapper::GetMapCount() {
331            LockGuard lock(midiMapsMutex);
332            return midiMaps.size();
333        }
334    
335        int MidiInstrumentMapper::GetInstrumentCount(int Map) {
336            LockGuard lock(midiMapsMutex);
337            std::map<int,MidiInstrumentMap>::iterator iterMap = midiMaps.find(Map);
338            if (iterMap == midiMaps.end()) { // no such map
339                throw Exception("There is no MIDI instrument map " + ToString(Map));
340            }
341    
342            return iterMap->second.size();
343        }
344    
345        int MidiInstrumentMapper::GetInstrumentCount() {
346            int count = 0;
347    
348            LockGuard lock(midiMapsMutex);
349            std::map<int,MidiInstrumentMap>::iterator iterMap = midiMaps.begin();
350            for (;iterMap != midiMaps.end(); iterMap++) {
351                count += iterMap->second.size();
352            }
353    
354            return count;
355        }
356    
357        int MidiInstrumentMapper::AddMap(String MapName) throw (Exception) {
358            int ID;
359            LockGuard lock(midiMapsMutex);
360    
361            if (midiMaps.empty()) ID = 0;
362            else {
363                // get the highest existing map ID
364                uint lastIndex = (--(midiMaps.end()))->first;
365                // check if we reached the index limit
366                if (lastIndex + 1 < lastIndex) {
367                    // search for an unoccupied map ID starting from 0
368                    for (uint i = 0; i < lastIndex; i++) {
369                        if (midiMaps.find(i) != midiMaps.end()) continue;
370                        // we found an unused ID, so insert the new map there
371                        ID = i;
372                        goto __create_map;
373                    }
374                    throw Exception("Internal error: could not find unoccupied MIDI instrument map ID.");
375                }
376                ID = lastIndex + 1;
377            }
378            __create_map:
379            midiMaps[ID].name = MapName;
380            
381            fireMidiInstrumentMapCountChanged(Maps().size());
382            // If there were no maps until now we must set a default map.
383            if (midiMaps.size() == 1) SetDefaultMap(ID);
384            
385            return ID;
386        }
387    
388        String MidiInstrumentMapper::MapName(int Map) throw (Exception) {
389            LockGuard lock(midiMapsMutex);
390            std::map<int,MidiInstrumentMap>::iterator iterMap = midiMaps.find(Map);
391            if (iterMap == midiMaps.end()) {
392                throw Exception("There is no MIDI instrument map " + ToString(Map));
393            }
394            return iterMap->second.name;
395        }
396    
397        void MidiInstrumentMapper::RenameMap(int Map, String NewName) throw (Exception) {
398            {
399                LockGuard lock(midiMapsMutex);
400                std::map<int,MidiInstrumentMap>::iterator iterMap = midiMaps.find(Map);
401                if (iterMap == midiMaps.end()) {
402                    throw Exception("There is no MIDI instrument map " + ToString(Map));
403                }
404                iterMap->second.name = NewName;
405            }
406            fireMidiInstrumentMapInfoChanged(Map);
407        }
408    
409        void MidiInstrumentMapper::RemoveMap(int Map) {
410            LockGuard lock(midiMapsMutex);
411            
412            midiMaps.erase(Map);
413            if (Map == GetDefaultMap()) {
414                SetDefaultMap(midiMaps.empty() ? -1 : (*(midiMaps.begin())).first);
415            }
416            fireMidiInstrumentMapCountChanged(Maps().size());
417        }
418    
419        void MidiInstrumentMapper::RemoveAllMaps() {
420            LockGuard lock(midiMapsMutex);
421    
422            midiMaps.clear();
423            SetDefaultMap(-1);
424            fireMidiInstrumentMapCountChanged(Maps().size());
425        }
426    
427        int MidiInstrumentMapper::GetDefaultMap() {
428            LockGuard lock(midiMapsMutex);
429    
430            return DefaultMap;
431        }
432    
433        void MidiInstrumentMapper::SetDefaultMap(int MapId) {
434            {
435                LockGuard lock(midiMapsMutex);
436    
437                DefaultMap = MapId;
438            }
439            
440            if (MapId != -1) fireMidiInstrumentMapInfoChanged(MapId);
441        }
442    
443        optional<MidiInstrumentMapper::entry_t> MidiInstrumentMapper::GetEntry(int Map, midi_prog_index_t Index) {
444          optional<entry_t> result;          optional<entry_t> result;
445          midiMapMutex.Lock();          LockGuard lock(midiMapsMutex);
446          std::map<midi_prog_index_t,private_entry_t>::iterator iter = midiMap.find(Index);  
447          if (iter != midiMap.end()) {          std::map<int,MidiInstrumentMap>::iterator iterMap = midiMaps.find(Map);
448              entry_t entry;          if (iterMap != midiMaps.end()) { // map found
449              entry.EngineName      = iter->second.EngineName;              std::map<midi_prog_index_t,private_entry_t>::iterator iterEntry = iterMap->second.find(Index);
450              entry.InstrumentFile  = iter->second.InstrumentFile;              if (iterEntry != iterMap->second.end()) {
451              entry.InstrumentIndex = iter->second.InstrumentIndex;                  entry_t entry;
452              entry.Volume          = iter->second.Volume;                  entry.EngineName      = iterEntry->second.EngineName;
453              //TODO: for now we skip the LoadMode and Name entry here, since we don't need it in the MidiInputPort                  entry.InstrumentFile  = iterEntry->second.InstrumentFile;
454              result = entry;                  entry.InstrumentIndex = iterEntry->second.InstrumentIndex;
455                    entry.Volume          = iterEntry->second.Volume;
456                    //TODO: for now we skip the LoadMode and Name entry here, since we don't need it in the EngineChannel
457                    result = entry;
458                }
459          }          }
         midiMapMutex.Unlock();  
460          return result;          return result;
461      }      }
462    

Legend:
Removed from v.970  
changed lines
  Added in v.2427

  ViewVC Help
Powered by ViewVC