on MIDI-import load Patman-plugin instead of TripleOsc and try to load patch according to program-change-events
git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@628 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
|
||||
|
||||
#include <Qt/QtXml>
|
||||
#include <QtCore/QDir>
|
||||
#include <QtGui/QApplication>
|
||||
#include <QtGui/QProgressDialog>
|
||||
|
||||
@@ -33,6 +34,7 @@
|
||||
#include "pattern.h"
|
||||
#include "automation_pattern.h"
|
||||
#include "level_object.h"
|
||||
#include "instrument.h"
|
||||
#include "debug.h"
|
||||
|
||||
|
||||
@@ -268,8 +270,10 @@ invalid_format:
|
||||
assert( it != NULL );
|
||||
#endif
|
||||
// TODO: setup program, channel etc.
|
||||
it->loadInstrument( "tripleoscillator" );
|
||||
instrument * it_inst = it->loadInstrument( "patman" );
|
||||
it->toggledInstrumentTrackButton( FALSE );
|
||||
bool sample_loaded = FALSE;
|
||||
|
||||
// TODO: track_name.trimmed().isEmpty() (Qt4)
|
||||
if( !track_name.isEmpty() )
|
||||
{
|
||||
@@ -327,19 +331,23 @@ invalid_format:
|
||||
}
|
||||
break;
|
||||
|
||||
/* case MIDI_META_EVENT:
|
||||
case PROGRAM_CHANGE:
|
||||
{
|
||||
switch( ev.m_data.m_param[0] )
|
||||
const QString num = QString::number( ev.key() );
|
||||
const QString filter = QString().fill( '0', 3 - num.length() ) + num + "*.pat";
|
||||
const QString dir = "/usr/share/midi/"
|
||||
"freepats/Tone_000/";
|
||||
const QStringList files = QDir( dir ).
|
||||
entryList( QStringList(
|
||||
filter ) );
|
||||
if( !files.empty() && !sample_loaded )
|
||||
{
|
||||
case MIDI_SET_TEMPO:
|
||||
{
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
it_inst->setParameter( "samplefile",
|
||||
dir+files.front() );
|
||||
sample_loaded = TRUE;
|
||||
}
|
||||
break;
|
||||
}*/
|
||||
}
|
||||
|
||||
default:
|
||||
/* printf( "Unhandled event: %#x\n",
|
||||
|
||||
Reference in New Issue
Block a user