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 * |
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, " |
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; |