Performance and other fixes
This commit is contained in:
@@ -98,9 +98,9 @@ public:
|
||||
static void restoreWidgetState( QWidget * _w, const QDomElement & _de );
|
||||
|
||||
void collectErrors( const QList<QString>* errors );
|
||||
void collectError( const QString error );
|
||||
void collectError( const QString & error );
|
||||
void clearErrors();
|
||||
void showErrors( const QString reason );
|
||||
void showErrors( const QString & reason );
|
||||
|
||||
|
||||
public slots:
|
||||
|
||||
@@ -55,6 +55,8 @@ public:
|
||||
m_type = p.m_type;
|
||||
m_offset = p.m_offset;
|
||||
m_affinity = p.m_affinity;
|
||||
m_usesBuffer = p.m_usesBuffer;
|
||||
m_audioPort = p.m_audioPort;
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
@@ -107,7 +107,7 @@ void LadspaControlDialog::updateEffectView( LadspaControls * _ctl )
|
||||
grouper->setAlignment( Qt::Vertical );
|
||||
|
||||
for( control_list_t::iterator it = controls.begin();
|
||||
it != controls.end(); it++ )
|
||||
it != controls.end(); ++it )
|
||||
{
|
||||
if( (*it)->port()->proc == proc )
|
||||
{
|
||||
|
||||
@@ -983,7 +983,7 @@ bool drawbar_organ::check_percussion() {
|
||||
void drawbar_organ::pitch_bend(int amt)
|
||||
{
|
||||
parameters->pitch_bend = pow(2.0, (amt * parameters->pitch_bend_range) / (1200.0 * 8192.0));
|
||||
for (list<voice *>::iterator i = active_voices.begin(); i != active_voices.end(); i++)
|
||||
for (list<voice *>::iterator i = active_voices.begin(); i != active_voices.end(); ++i)
|
||||
{
|
||||
organ_voice *v = dynamic_cast<organ_voice *>(*i);
|
||||
v->update_pitch();
|
||||
|
||||
@@ -25,7 +25,7 @@ using namespace std;
|
||||
|
||||
void basic_synth::kill_note(int note, int vel, bool just_one)
|
||||
{
|
||||
for (list<dsp::voice *>::iterator it = active_voices.begin(); it != active_voices.end(); it++) {
|
||||
for (list<dsp::voice *>::iterator it = active_voices.begin(); it != active_voices.end(); ++it) {
|
||||
// preserve sostenuto notes
|
||||
if ((*it)->get_current_note() == note && !(sostenuto && (*it)->sostenuto)) {
|
||||
(*it)->note_off(vel);
|
||||
@@ -58,7 +58,7 @@ dsp::voice *basic_synth::steal_voice()
|
||||
std::list<dsp::voice *>::iterator found = active_voices.end();
|
||||
float priority = 10000;
|
||||
//int idx = 0;
|
||||
for(std::list<dsp::voice *>::iterator i = active_voices.begin(); i != active_voices.end(); i++)
|
||||
for(std::list<dsp::voice *>::iterator i = active_voices.begin(); i != active_voices.end(); ++i)
|
||||
{
|
||||
//printf("Voice %d priority %f at %p\n", idx++, (*i)->get_priority(), *i);
|
||||
if ((*i)->get_priority() < priority)
|
||||
@@ -79,7 +79,7 @@ void basic_synth::trim_voices()
|
||||
{
|
||||
// count stealable voices
|
||||
unsigned int count = 0;
|
||||
for(std::list<dsp::voice *>::iterator i = active_voices.begin(); i != active_voices.end(); i++)
|
||||
for(std::list<dsp::voice *>::iterator i = active_voices.begin(); i != active_voices.end(); ++i)
|
||||
{
|
||||
if ((*i)->get_priority() < 10000)
|
||||
count++;
|
||||
@@ -118,7 +118,7 @@ void basic_synth::note_off(int note, int vel)
|
||||
kill_note(note, vel, false);
|
||||
}
|
||||
|
||||
#define for_all_voices(iter) for (std::list<dsp::voice *>::iterator iter = active_voices.begin(); iter != active_voices.end(); iter++)
|
||||
#define for_all_voices(iter) for (std::list<dsp::voice *>::iterator iter = active_voices.begin(); iter != active_voices.end(); ++iter)
|
||||
|
||||
void basic_synth::on_pedal_release()
|
||||
{
|
||||
@@ -204,7 +204,7 @@ void basic_synth::render_to(float (*output)[2], int nsamples)
|
||||
unused_voices.push(v);
|
||||
continue;
|
||||
}
|
||||
i++;
|
||||
++i;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -214,7 +214,7 @@ basic_synth::~basic_synth()
|
||||
delete unused_voices.top();
|
||||
unused_voices.pop();
|
||||
}
|
||||
for (list<voice *>::iterator i = active_voices.begin(); i != active_voices.end(); i++)
|
||||
for (list<voice *>::iterator i = active_voices.begin(); i != active_voices.end(); ++i)
|
||||
delete *i;
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ string encode_map(const dictionary &data)
|
||||
osctl::string_buffer sb;
|
||||
osc_stream<osctl::string_buffer> str(sb);
|
||||
str << (uint32_t)data.size();
|
||||
for(dictionary::const_iterator i = data.begin(); i != data.end(); i++)
|
||||
for(dictionary::const_iterator i = data.begin(); i != data.end(); ++i)
|
||||
{
|
||||
str << i->first << i->second;
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ ladspaDescription::ladspaDescription( QWidget * _parent,
|
||||
|
||||
QList<QString> pluginNames;
|
||||
for( l_sortable_plugin_t::iterator it = plugins.begin();
|
||||
it != plugins.end(); it++ )
|
||||
it != plugins.end(); ++it )
|
||||
{
|
||||
if( _type != VALID ||
|
||||
manager->getDescription( ( *it ).second )->inputChannels
|
||||
|
||||
@@ -195,7 +195,7 @@ MidiTime AutomationPattern::putValue( const MidiTime & _time,
|
||||
timeMap::const_iterator it = m_timeMap.find( newTime );
|
||||
if( it != m_timeMap.begin() )
|
||||
{
|
||||
it--;
|
||||
--it;
|
||||
}
|
||||
generateTangents(it, 3);
|
||||
|
||||
@@ -229,7 +229,7 @@ void AutomationPattern::removeValue( const MidiTime & _time,
|
||||
timeMap::const_iterator it = m_timeMap.lowerBound( newTime );
|
||||
if( it != m_timeMap.begin() )
|
||||
{
|
||||
it--;
|
||||
--it;
|
||||
}
|
||||
generateTangents(it, 3);
|
||||
|
||||
@@ -271,7 +271,7 @@ MidiTime AutomationPattern::setDragValue( const MidiTime & _time, const float _v
|
||||
//Restore to the state before it the point were being dragged
|
||||
m_timeMap = m_oldTimeMap;
|
||||
|
||||
for( timeMap::const_iterator it = m_timeMap.begin(); it != m_timeMap.end(); it++ )
|
||||
for( timeMap::const_iterator it = m_timeMap.begin(); it != m_timeMap.end(); ++it )
|
||||
{
|
||||
generateTangents(it, 3);
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ Ladspa2LMMS::Ladspa2LMMS()
|
||||
l_sortable_plugin_t plugins = getSortedPlugins();
|
||||
|
||||
for( l_sortable_plugin_t::iterator it = plugins.begin();
|
||||
it != plugins.end(); it++ )
|
||||
it != plugins.end(); ++it )
|
||||
{
|
||||
ladspa_key_t key = (*it).second;
|
||||
ladspaManagerDescription * desc = getDescription( key );
|
||||
|
||||
@@ -96,7 +96,7 @@ LadspaManager::LadspaManager()
|
||||
|
||||
l_ladspa_key_t keys = m_ladspaManagerMap.keys();
|
||||
for( l_ladspa_key_t::iterator it = keys.begin();
|
||||
it != keys.end(); it++ )
|
||||
it != keys.end(); ++it )
|
||||
{
|
||||
m_sortedPlugins.append( qMakePair( getName( *it ), *it ) );
|
||||
}
|
||||
|
||||
@@ -1774,7 +1774,7 @@ void TrackOperationsWidget::recordingOn()
|
||||
if( atv )
|
||||
{
|
||||
const Track::tcoVector & tcov = atv->getTrack()->getTCOs();
|
||||
for( Track::tcoVector::const_iterator it = tcov.begin(); it != tcov.end(); it++ )
|
||||
for( Track::tcoVector::const_iterator it = tcov.begin(); it != tcov.end(); ++it )
|
||||
{
|
||||
AutomationPattern * ap = dynamic_cast<AutomationPattern *>( *it );
|
||||
if( ap ) { ap->setRecording( true ); }
|
||||
@@ -1790,7 +1790,7 @@ void TrackOperationsWidget::recordingOff()
|
||||
if( atv )
|
||||
{
|
||||
const Track::tcoVector & tcov = atv->getTrack()->getTCOs();
|
||||
for( Track::tcoVector::const_iterator it = tcov.begin(); it != tcov.end(); it++ )
|
||||
for( Track::tcoVector::const_iterator it = tcov.begin(); it != tcov.end(); ++it )
|
||||
{
|
||||
AutomationPattern * ap = dynamic_cast<AutomationPattern *>( *it );
|
||||
if( ap ) { ap->setRecording( false ); }
|
||||
|
||||
@@ -120,6 +120,7 @@ bool AudioFileOgg::startEncoding()
|
||||
printf( "Mode initialization failed: invalid parameters for "
|
||||
"bitrate\n" );
|
||||
vorbis_info_clear( &m_vi );
|
||||
delete[] user_comments;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -1211,7 +1211,7 @@ void MainWindow::collectErrors(const QList<QString>* errors )
|
||||
|
||||
|
||||
|
||||
void MainWindow::collectError( const QString error )
|
||||
void MainWindow::collectError( const QString & error )
|
||||
{
|
||||
m_errors->append( error );
|
||||
}
|
||||
@@ -1225,7 +1225,7 @@ void MainWindow::clearErrors()
|
||||
|
||||
|
||||
|
||||
void MainWindow::showErrors( const QString message )
|
||||
void MainWindow::showErrors( const QString & message )
|
||||
{
|
||||
if ( m_errors->length() != 0 )
|
||||
{ QString* errors = new QString();
|
||||
|
||||
@@ -99,8 +99,8 @@ PluginDescList::PluginDescList(QWidget *parent) :
|
||||
std::sort(m_pluginDescriptors.begin(), m_pluginDescriptors.end(), pluginBefore);
|
||||
|
||||
|
||||
for(Plugin::DescriptorList::const_iterator it = m_pluginDescriptors.constBegin();
|
||||
it != m_pluginDescriptors.constEnd(); it++)
|
||||
for( Plugin::DescriptorList::const_iterator it = m_pluginDescriptors.constBegin();
|
||||
it != m_pluginDescriptors.constEnd(); ++it )
|
||||
{
|
||||
if( it->type == Plugin::Instrument )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user