"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "plugins/sf2_player/sf2_player.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.

sf2_player.cpp  (lmms-1.2.0-rc7):sf2_player.cpp  (lmms-1.2.0-rc8)
skipping to change at line 123 skipping to change at line 123
fluid_audio_driver_register( none ); fluid_audio_driver_register( none );
#endif #endif
m_settings = new_fluid_settings(); m_settings = new_fluid_settings();
//fluid_settings_setint( m_settings, (char *) "audio.period-size", engine ::mixer()->framesPerPeriod() ); //fluid_settings_setint( m_settings, (char *) "audio.period-size", engine ::mixer()->framesPerPeriod() );
// This is just our starting instance of synth. It is recreated // This is just our starting instance of synth. It is recreated
// everytime we load a new soundfont. // everytime we load a new soundfont.
m_synth = new_fluid_synth( m_settings ); m_synth = new_fluid_synth( m_settings );
#if FLUIDSYNTH_VERSION_MAJOR >= 2
// Get the default values from the setting
double settingVal;
fluid_settings_getnum_default(m_settings, "synth.reverb.room-size", &sett
ingVal);
m_reverbRoomSize.setInitValue(settingVal);
fluid_settings_getnum_default(m_settings, "synth.reverb.damping", &settin
gVal);
m_reverbDamping.setInitValue(settingVal);
fluid_settings_getnum_default(m_settings, "synth.reverb.width", &settingV
al);
m_reverbWidth.setInitValue(settingVal);
fluid_settings_getnum_default(m_settings, "synth.reverb.level", &settingV
al);
m_reverbLevel.setInitValue(settingVal);
fluid_settings_getnum_default(m_settings, "synth.chorus.nr", &settingVal)
;
m_chorusNum.setInitValue(settingVal);
fluid_settings_getnum_default(m_settings, "synth.chorus.level", &settingV
al);
m_chorusLevel.setInitValue(settingVal);
fluid_settings_getnum_default(m_settings, "synth.chorus.speed", &settingV
al);
m_chorusSpeed.setInitValue(settingVal);
fluid_settings_getnum_default(m_settings, "synth.chorus.depth", &settingV
al);
m_chorusDepth.setInitValue(settingVal);
#endif
loadFile( ConfigManager::inst()->defaultSoundfont() ); loadFile( ConfigManager::inst()->defaultSoundfont() );
updateSampleRate(); updateSampleRate();
updateReverbOn(); updateReverbOn();
updateReverb(); updateReverb();
updateChorusOn(); updateChorusOn();
updateChorus(); updateChorus();
updateGain(); updateGain();
connect( &m_bankNum, SIGNAL( dataChanged() ), this, SLOT( updatePatch() ) ); connect( &m_bankNum, SIGNAL( dataChanged() ), this, SLOT( updatePatch() ) );
skipping to change at line 362 skipping to change at line 385
fluid_synth_program_select( m_synth, m_channel, m_fontId, fluid_synth_program_select( m_synth, m_channel, m_fontId,
m_bankNum.value(), m_patchNum.value() ); m_bankNum.value(), m_patchNum.value() );
} }
} }
QString sf2Instrument::getCurrentPatchName() QString sf2Instrument::getCurrentPatchName()
{ {
int iBankSelected = m_bankNum.value(); int iBankSelected = m_bankNum.value();
int iProgSelected = m_patchNum.value(); int iProgSelected = m_patchNum.value();
fluid_preset_t preset;
// 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_synth ); int cSoundFonts = ::fluid_synth_sfcount( m_synth );
for( int i = 0; i < cSoundFonts; i++ ) for( int i = 0; i < cSoundFonts; i++ )
{ {
fluid_sfont_t *pSoundFont = fluid_synth_get_sfont( m_synth, i ); fluid_sfont_t *pSoundFont = fluid_synth_get_sfont( m_synth, i );
if ( pSoundFont ) if ( pSoundFont )
{ {
#ifdef CONFIG_FLUID_BANK_OFFSET #ifdef CONFIG_FLUID_BANK_OFFSET
int iBankOffset = int iBankOffset =
fluid_synth_get_bank_offset( fluid_synth_get_bank_offset(
m_synth, pSoundFont->id ); m_synth, fluid_sfont_get_id(pSoun
dFont) );
#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, SoundFont, pCurPreset)))
&preset ) )
{ {
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 && iProg == if( iBank == iBankSelected && iProg ==
iProgSelected ) iProgSelected )
{ {
return preset.get_name( &preset ); return fluid_preset_get_name( pCurPreset );
} }
} }
} }
} }
return ""; return "";
} }
void sf2Instrument::updateGain() void sf2Instrument::updateGain()
{ {
fluid_synth_set_gain( m_synth, m_gain.value() ); fluid_synth_set_gain( m_synth, m_gain.value() );
 End of changes. 7 change blocks. 
8 lines changed or deleted 45 lines changed or added

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