"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "plugins/sf2_player/patches_dialog.cpp" between
lmms-1.2.0-rc7.tar.gz and lmms-1.2.0-rc8.tar.gz

About: LMMS (Linux MultiMedia Studio) is a sound generation system (creation of melodies and beats, synthesis and mixing of sounds, arranging of samples; full MIDI support). Release candidate.

patches_dialog.cpp  (lmms-1.2.0-rc7):patches_dialog.cpp  (lmms-1.2.0-rc8)
skipping to change at line 139 skipping to change at line 139
m_pSynth = NULL; m_pSynth = NULL;
// Load bank list from actual synth stack... // Load bank list from actual synth stack...
m_bankListView->setSortingEnabled(false); m_bankListView->setSortingEnabled(false);
m_bankListView->clear(); m_bankListView->clear();
// now it should be safe to set internal stuff // now it should be safe to set internal stuff
m_pSynth = pSynth; m_pSynth = pSynth;
m_iChan = iChan; m_iChan = iChan;
fluid_preset_t preset;
QTreeWidgetItem *pBankItem = NULL; QTreeWidgetItem *pBankItem = NULL;
// For all soundfonts (in reversed stack order) fill the available banks. .. // For all soundfonts (in reversed stack order) fill the available banks. ..
int cSoundFonts = ::fluid_synth_sfcount(m_pSynth); int cSoundFonts = ::fluid_synth_sfcount(m_pSynth);
for (int i = 0; i < cSoundFonts; i++) { for (int i = 0; i < cSoundFonts; i++) {
fluid_sfont_t *pSoundFont = ::fluid_synth_get_sfont(m_pSynth, i); fluid_sfont_t *pSoundFont = ::fluid_synth_get_sfont(m_pSynth, i);
if (pSoundFont) { if (pSoundFont) {
#ifdef CONFIG_FLUID_BANK_OFFSET #ifdef CONFIG_FLUID_BANK_OFFSET
int iBankOffset = ::fluid_synth_get_bank_offset(m_pSynth, pSoundFont->id); int iBankOffset = ::fluid_synth_get_bank_offset(m_pSynth, fluid_sfont_get_id(pSoundFont));
#endif #endif
pSoundFont->iteration_start(pSoundFont); fluid_sfont_iteration_start(pSoundFont);
while (pSoundFont->iteration_next(pSoundFont, &preset)) { #if FLUIDSYNTH_VERSION_MAJOR < 2
int iBank = preset.get_banknum(&preset); fluid_preset_t preset;
fluid_preset_t *pCurPreset = &preset;
#else
fluid_preset_t *pCurPreset;
#endif
while ((pCurPreset = fluid_sfont_iteration_next_wrapper(p
SoundFont, pCurPreset))) {
int iBank = fluid_preset_get_banknum(pCurPreset);
#ifdef CONFIG_FLUID_BANK_OFFSET #ifdef CONFIG_FLUID_BANK_OFFSET
iBank += iBankOffset; iBank += iBankOffset;
#endif #endif
if (!findBankItem(iBank)) { if (!findBankItem(iBank)) {
pBankItem = new patchItem(m_bankListView, pBankItem); pBankItem = new patchItem(m_bankListView, pBankItem);
if (pBankItem) if (pBankItem)
pBankItem->setText(0, QString::nu mber(iBank)); pBankItem->setText(0, QString::nu mber(iBank));
} }
} }
} }
} }
m_bankListView->setSortingEnabled(true); m_bankListView->setSortingEnabled(true);
// Set the selected bank. // Set the selected bank.
m_iBank = 0; m_iBank = 0;
fluid_preset_t *pPreset = ::fluid_synth_get_channel_preset(m_pSynth, m_iC han); fluid_preset_t *pPreset = ::fluid_synth_get_channel_preset(m_pSynth, m_iC han);
if (pPreset) { if (pPreset) {
m_iBank = pPreset->get_banknum(pPreset); m_iBank = fluid_preset_get_banknum(pPreset);
#ifdef CONFIG_FLUID_BANK_OFFSET #ifdef CONFIG_FLUID_BANK_OFFSET
m_iBank += ::fluid_synth_get_bank_offset(m_pSynth, (pPreset->sfon t)->id); m_iBank += ::fluid_synth_get_bank_offset(m_pSynth, fluid_sfont_ge t_id(fluid_preset_get_sfont(sfont)));
#endif #endif
} }
pBankItem = findBankItem(m_iBank); pBankItem = findBankItem(m_iBank);
m_bankListView->setCurrentItem(pBankItem); m_bankListView->setCurrentItem(pBankItem);
m_bankListView->scrollToItem(pBankItem); m_bankListView->scrollToItem(pBankItem);
bankChanged(); bankChanged();
// Set the selected program. // Set the selected program.
if (pPreset) if (pPreset)
m_iProg = pPreset->get_num(pPreset); m_iProg = fluid_preset_get_num(pPreset);
QTreeWidgetItem *pProgItem = findProgItem(m_iProg); QTreeWidgetItem *pProgItem = findProgItem(m_iProg);
m_progListView->setCurrentItem(pProgItem); m_progListView->setCurrentItem(pProgItem);
m_progListView->scrollToItem(pProgItem); m_progListView->scrollToItem(pProgItem);
// Done with setup... // Done with setup...
//m_iDirtySetup--; //m_iDirtySetup--;
} }
// Stabilize current state form. // Stabilize current state form.
void patchesDialog::stabilizeForm() void patchesDialog::stabilizeForm()
skipping to change at line 299 skipping to change at line 304
QTreeWidgetItem *pBankItem = m_bankListView->currentItem(); QTreeWidgetItem *pBankItem = m_bankListView->currentItem();
if (pBankItem == NULL) if (pBankItem == NULL)
return; return;
int iBankSelected = pBankItem->text(0).toInt(); int iBankSelected = pBankItem->text(0).toInt();
// Clear up the program listview. // Clear up the program listview.
m_progListView->setSortingEnabled(false); m_progListView->setSortingEnabled(false);
m_progListView->clear(); m_progListView->clear();
fluid_preset_t preset;
QTreeWidgetItem *pProgItem = NULL; QTreeWidgetItem *pProgItem = NULL;
// For all soundfonts (in reversed stack order) fill the available progra ms... // For all soundfonts (in reversed stack order) fill the available progra ms...
int cSoundFonts = ::fluid_synth_sfcount(m_pSynth); int cSoundFonts = ::fluid_synth_sfcount(m_pSynth);
for (int i = 0; i < cSoundFonts && !pProgItem; i++) { for (int i = 0; i < cSoundFonts && !pProgItem; i++) {
fluid_sfont_t *pSoundFont = ::fluid_synth_get_sfont(m_pSynth, i); fluid_sfont_t *pSoundFont = ::fluid_synth_get_sfont(m_pSynth, i);
if (pSoundFont) { if (pSoundFont) {
#ifdef CONFIG_FLUID_BANK_OFFSET #ifdef CONFIG_FLUID_BANK_OFFSET
int iBankOffset = ::fluid_synth_get_bank_offset(m_pSynth, int iBankOffset = ::fluid_synth_get_bank_offset(m_pSynth,
pSoundFont->id); fluid_sfont_get_id(pSoundFont));
#endif
fluid_sfont_iteration_start(pSoundFont);
#if FLUIDSYNTH_VERSION_MAJOR < 2
fluid_preset_t preset;
fluid_preset_t *pCurPreset = &preset;
#else
fluid_preset_t *pCurPreset;
#endif #endif
pSoundFont->iteration_start(pSoundFont); while ((pCurPreset = fluid_sfont_iteration_next_wrapper(p
while (pSoundFont->iteration_next(pSoundFont, &preset)) { SoundFont, pCurPreset))) {
int iBank = preset.get_banknum(&preset); int iBank = fluid_preset_get_banknum(pCurPreset);
#ifdef CONFIG_FLUID_BANK_OFFSET #ifdef CONFIG_FLUID_BANK_OFFSET
iBank += iBankOffset; iBank += iBankOffset;
#endif #endif
int iProg = preset.get_num(&preset); int iProg = fluid_preset_get_num(pCurPreset);
if (iBank == iBankSelected && !findProgItem(iProg )) { if (iBank == iBankSelected && !findProgItem(iProg )) {
pProgItem = new patchItem(m_progListView, pProgItem); pProgItem = new patchItem(m_progListView, pProgItem);
if (pProgItem) { if (pProgItem) {
pProgItem->setText(0, QString::nu mber(iProg)); pProgItem->setText(0, QString::nu mber(iProg));
pProgItem->setText(1, preset.get_ pProgItem->setText(1, fluid_prese
name(&preset)); t_get_name(pCurPreset));
//pProgItem->setText(2, QString:: //pProgItem->setText(2, QString::
number(pSoundFont->id)); number(fluid_sfont_get_id(pSoundFont)));
//pProgItem->setText(3, QFileInfo ( //pProgItem->setText(3, QFileInfo (
// pSoundFont->get_name(pSou ndFont)).baseName()); // fluid_sfont_get_name(pSou ndFont).baseName());
} }
} }
} }
} }
} }
m_progListView->setSortingEnabled(true); m_progListView->setSortingEnabled(true);
// Stabilize the form. // Stabilize the form.
stabilizeForm(); stabilizeForm();
} }
 End of changes. 12 change blocks. 
20 lines changed or deleted 32 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)