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 - 2007 Christian Schoenebeck * |
* Copyright (C) 2005 - 2008 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 * |
463 |
* Give back an instrument. This should be used instead of |
* Give back an instrument. This should be used instead of |
464 |
* HandBack if there are some dimension regions that are still in |
* HandBack if there are some dimension regions that are still in |
465 |
* use. (When an instrument is changed, the voices currently |
* use. (When an instrument is changed, the voices currently |
466 |
* playing is allowed to keep playing with the old instrument |
* playing are allowed to keep playing with the old instrument |
467 |
* until note off arrives. New notes will use the new instrument.) |
* until note off arrives. New notes will use the new instrument.) |
468 |
*/ |
*/ |
469 |
void InstrumentResourceManager::HandBackInstrument(::gig::Instrument* pResource, InstrumentConsumer* pConsumer, |
void InstrumentResourceManager::HandBackInstrument(::gig::Instrument* pResource, InstrumentConsumer* pConsumer, |
470 |
::gig::DimensionRegion** dimRegionsInUse) { |
RTList< ::gig::DimensionRegion*>* pDimRegionsInUse) { |
471 |
DimRegInfoMutex.Lock(); |
DimRegInfoMutex.Lock(); |
472 |
for (int i = 0 ; dimRegionsInUse[i] ; i++) { |
for (RTList< ::gig::DimensionRegion*>::Iterator i = pDimRegionsInUse->first() ; i != pDimRegionsInUse->end() ; i++) { |
473 |
DimRegInfo[dimRegionsInUse[i]].refCount++; |
DimRegInfo[*i].refCount++; |
474 |
SampleRefCount[dimRegionsInUse[i]->pSample]++; |
SampleRefCount[(*i)->pSample]++; |
475 |
} |
} |
476 |
HandBack(pResource, pConsumer, true); |
HandBack(pResource, pConsumer, true); |
477 |
DimRegInfoMutex.Unlock(); |
DimRegInfoMutex.Unlock(); |