Merge pull request #2033 from michaelgregorius/2028-slow_midi_import
Solves issue #2028 (Slow MIDI import due to repeated message)
This commit is contained in:
@@ -56,7 +56,7 @@ public:
|
||||
AutomationPattern( const AutomationPattern & _pat_to_copy );
|
||||
virtual ~AutomationPattern();
|
||||
|
||||
void addObject( AutomatableModel * _obj, bool _search_dup = true );
|
||||
bool addObject( AutomatableModel * _obj, bool _search_dup = true );
|
||||
|
||||
const AutomatableModel * firstObject() const;
|
||||
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
#include "ProjectJournal.h"
|
||||
#include "BBTrackContainer.h"
|
||||
#include "Song.h"
|
||||
#include "TextFloat.h"
|
||||
#include "embed.h"
|
||||
|
||||
int AutomationPattern::s_quantization = 1;
|
||||
@@ -107,7 +106,7 @@ AutomationPattern::~AutomationPattern()
|
||||
|
||||
|
||||
|
||||
void AutomationPattern::addObject( AutomatableModel * _obj, bool _search_dup )
|
||||
bool AutomationPattern::addObject( AutomatableModel * _obj, bool _search_dup )
|
||||
{
|
||||
if( _search_dup )
|
||||
{
|
||||
@@ -115,10 +114,8 @@ void AutomationPattern::addObject( AutomatableModel * _obj, bool _search_dup )
|
||||
it != m_objects.end(); ++it )
|
||||
{
|
||||
if( *it == _obj )
|
||||
{
|
||||
TextFloat::displayMessage( _obj->displayName(), tr( "Model is already connected "
|
||||
"to this pattern." ), embed::getIconPixmap( "automation" ), 2000 );
|
||||
return;
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -138,6 +135,7 @@ void AutomationPattern::addObject( AutomatableModel * _obj, bool _search_dup )
|
||||
|
||||
emit dataChanged();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#include "ProjectJournal.h"
|
||||
#include "RenameDialog.h"
|
||||
#include "StringPairDrag.h"
|
||||
#include "TextFloat.h"
|
||||
#include "ToolTip.h"
|
||||
|
||||
|
||||
@@ -420,7 +421,15 @@ void AutomationPatternView::dropEvent( QDropEvent * _de )
|
||||
journallingObject( val.toInt() ) );
|
||||
if( mod != NULL )
|
||||
{
|
||||
m_pat->addObject( mod );
|
||||
bool added = m_pat->addObject( mod );
|
||||
if ( !added )
|
||||
{
|
||||
TextFloat::displayMessage( mod->displayName(),
|
||||
tr( "Model is already connected "
|
||||
"to this pattern." ),
|
||||
embed::getIconPixmap( "automation" ),
|
||||
2000 );
|
||||
}
|
||||
}
|
||||
update();
|
||||
|
||||
|
||||
@@ -2299,7 +2299,15 @@ void AutomationEditorWindow::dropEvent( QDropEvent *_de )
|
||||
journallingObject( val.toInt() ) );
|
||||
if( mod != NULL )
|
||||
{
|
||||
m_editor->m_pattern->addObject( mod );
|
||||
bool added = m_editor->m_pattern->addObject( mod );
|
||||
if ( !added )
|
||||
{
|
||||
TextFloat::displayMessage( mod->displayName(),
|
||||
tr( "Model is already connected "
|
||||
"to this pattern." ),
|
||||
embed::getIconPixmap( "automation" ),
|
||||
2000 );
|
||||
}
|
||||
setCurrentPattern( m_editor->m_pattern );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user