532 |
pInstrument = pItem->instrument(); |
pInstrument = pItem->instrument(); |
533 |
if (pInstrument) { |
if (pInstrument) { |
534 |
// Save current key values... |
// Save current key values... |
535 |
int iMap = pInstrument->map(); |
qsamplerInstrument oldInstrument(*pInstrument); |
|
int iBank = pInstrument->bank(); |
|
|
int iProg = pInstrument->prog(); |
|
536 |
// Do the edit dance... |
// Do the edit dance... |
537 |
qsamplerInstrumentForm form(this); |
qsamplerInstrumentForm form(this); |
538 |
form.setup(pInstrument); |
form.setup(pInstrument); |
540 |
// Commit... |
// Commit... |
541 |
pInstrument->mapInstrument(); |
pInstrument->mapInstrument(); |
542 |
// Check whether we changed instrument key... |
// Check whether we changed instrument key... |
543 |
if (iMap == pInstrument->map() && |
if (oldInstrument.map() == pInstrument->map() && |
544 |
iBank == pInstrument->bank() && |
oldInstrument.bank() == pInstrument->bank() && |
545 |
iProg == pInstrument->prog()) { |
oldInstrument.prog() == pInstrument->prog()) { |
546 |
// just update tree item... |
// just update tree item... |
547 |
pItem->update(); |
pItem->update(); |
548 |
} else { |
} else { |
549 |
|
// Unmap old instance... |
550 |
|
oldInstrument.unmapInstrument(); |
551 |
// Change item tree, whether applicable... |
// Change item tree, whether applicable... |
552 |
if (m_iMidiMap < 0 || m_iMidiMap == pInstrument->map()) { |
if (m_iMidiMap < 0 || m_iMidiMap == pInstrument->map()) { |
553 |
// Add new brand item into view... |
// Add new brand item into view... |