6659 |
// this string is needed for the gig to be loadable in GSt: |
// this string is needed for the gig to be loadable in GSt: |
6660 |
pInstrument->pInfo->Software = "Endless Wave"; |
pInstrument->pInfo->Software = "Endless Wave"; |
6661 |
|
|
6662 |
|
const size_t idxIt = InstrumentsIterator - pInstruments->begin(); |
6663 |
pInstruments->push_back(pInstrument); |
pInstruments->push_back(pInstrument); |
6664 |
|
InstrumentsIterator = pInstruments->begin() + std::min(idxIt, pInstruments->size()); // avoid iterator invalidation |
6665 |
return pInstrument; |
return pInstrument; |
6666 |
} |
} |
6667 |
|
|
6773 |
if (!pInstruments) throw gig::Exception("Could not delete instrument as there are no instruments"); |
if (!pInstruments) throw gig::Exception("Could not delete instrument as there are no instruments"); |
6774 |
InstrumentList::iterator iter = find(pInstruments->begin(), pInstruments->end(), (DLS::Instrument*) pInstrument); |
InstrumentList::iterator iter = find(pInstruments->begin(), pInstruments->end(), (DLS::Instrument*) pInstrument); |
6775 |
if (iter == pInstruments->end()) throw gig::Exception("Could not delete instrument, could not find given instrument"); |
if (iter == pInstruments->end()) throw gig::Exception("Could not delete instrument, could not find given instrument"); |
6776 |
|
const size_t idxIt = InstrumentsIterator - pInstruments->begin(); |
6777 |
pInstruments->erase(iter); |
pInstruments->erase(iter); |
6778 |
|
InstrumentsIterator = pInstruments->begin() + std::min(idxIt, pInstruments->size()); // avoid iterator invalidation |
6779 |
pInstrument->DeleteChunks(); |
pInstrument->DeleteChunks(); |
6780 |
delete pInstrument; |
delete pInstrument; |
6781 |
} |
} |