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/branches/lmms/stable-0.3@618 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Tobias Doerffel
2007-12-03 11:56:21 +00:00
parent 22f822bf12
commit 33b5b28cd9
2 changed files with 23 additions and 10 deletions

View File

@@ -1,3 +1,9 @@
2007-12-03 Tobias Doerffel <tobydox/at/users/dot/sourceforge/dot/net>
* plugins/midi_import/midi_import.cpp:
load Patman-plugin instead of TripleOsc and try to load patch
according to program-change-events
2007-11-12 Tobias Doerffel <tobydox/at/users/dot/sourceforge/dot/net>
* configure.in:

View File

@@ -29,6 +29,7 @@
#include "pattern.h"
#include "automation_pattern.h"
#include "level_object.h"
#include "instrument.h"
#include "debug.h"
@@ -41,6 +42,7 @@
#else
#include <qdir.h>
#include <qdom.h>
#include <qapplication.h>
#include <qprogressdialog.h>
@@ -292,8 +294,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() )
{
@@ -351,19 +355,22 @@ 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( 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",