/[svn]/linuxsampler/trunk/src/engines/gig/InstrumentResourceManager.cpp
ViewVC logotype

Diff of /linuxsampler/trunk/src/engines/gig/InstrumentResourceManager.cpp

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

revision 2327 by persson, Sat Mar 10 16:16:14 2012 UTC revision 2427 by persson, Sat Mar 2 07:03:04 2013 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 - 2012 Christian Schoenebeck                       *   *   Copyright (C) 2005 - 2013 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 271  namespace LinuxSampler { namespace gig { Line 271  namespace LinuxSampler { namespace gig {
271          int iProxyIndex                = -1;          int iProxyIndex                = -1;
272    
273          // first find the editor proxy entry for this editor          // first find the editor proxy entry for this editor
274          InstrumentEditorProxiesMutex.Lock();          {
275          for (int i = 0; i < InstrumentEditorProxies.size(); i++) {              LockGuard lock(InstrumentEditorProxiesMutex);
276              InstrumentEditorProxy* pCurProxy =              for (int i = 0; i < InstrumentEditorProxies.size(); i++) {
277                  dynamic_cast<InstrumentEditorProxy*>(                  InstrumentEditorProxy* pCurProxy =
278                      InstrumentEditorProxies[i]                      dynamic_cast<InstrumentEditorProxy*>(
279                  );                          InstrumentEditorProxies[i]
280              if (pCurProxy->pEditor == pSender) {                          );
281                  pProxy      = pCurProxy;                  if (pCurProxy->pEditor == pSender) {
282                  iProxyIndex = i;                      pProxy      = pCurProxy;
283                  pInstrument = pCurProxy->pInstrument;                      iProxyIndex = i;
284                        pInstrument = pCurProxy->pInstrument;
285                    }
286              }              }
287          }          }
         InstrumentEditorProxiesMutex.Unlock();  
288    
289          if (!pProxy) {          if (!pProxy) {
290              std::cerr << "Eeeek, could not find instrument editor proxy, "              std::cerr << "Eeeek, could not find instrument editor proxy, "
# Line 311  namespace LinuxSampler { namespace gig { Line 312  namespace LinuxSampler { namespace gig {
312    
313          // finally delete proxy entry and hand back instrument          // finally delete proxy entry and hand back instrument
314          if (pInstrument) {          if (pInstrument) {
315              InstrumentEditorProxiesMutex.Lock();              {
316              InstrumentEditorProxies.remove(iProxyIndex);                  LockGuard lock(InstrumentEditorProxiesMutex);
317              InstrumentEditorProxiesMutex.Unlock();                  InstrumentEditorProxies.remove(iProxyIndex);
318                }
319    
320              HandBack(pInstrument, pProxy);              HandBack(pInstrument, pProxy);
321              delete pProxy;              delete pProxy;

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

  ViewVC Help
Powered by ViewVC