mirror of
https://github.com/LMMS/lmms.git
synced 2026-01-23 22:08:02 -05:00
Drag-and-drop support for VST, SF2
This commit is contained in:
BIN
data/themes/default/soundfont_file.png
Normal file
BIN
data/themes/default/soundfont_file.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
BIN
data/themes/default/vst_plugin_file.png
Normal file
BIN
data/themes/default/vst_plugin_file.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
@@ -224,6 +224,8 @@ private:
|
||||
static QPixmap * s_projectFilePixmap;
|
||||
static QPixmap * s_presetFilePixmap;
|
||||
static QPixmap * s_sampleFilePixmap;
|
||||
static QPixmap * s_soundfontFilePixmap;
|
||||
static QPixmap * s_vstPluginFilePixmap;
|
||||
static QPixmap * s_midiFilePixmap;
|
||||
static QPixmap * s_flpFilePixmap;
|
||||
static QPixmap * s_unknownFilePixmap;
|
||||
|
||||
@@ -312,7 +312,8 @@ void TrackContainerView::dragEnterEvent( QDragEnterEvent * _dee )
|
||||
{
|
||||
stringPairDrag::processDragEnterEvent( _dee,
|
||||
QString( "presetfile,pluginpresetfile,samplefile,instrument,"
|
||||
"importedproject,track_%1,track_%2" ).
|
||||
"importedproject,soundfontfile,vstpluginfile,"
|
||||
"track_%1,track_%2" ).
|
||||
arg( track::InstrumentTrack ).
|
||||
arg( track::SampleTrack ) );
|
||||
}
|
||||
@@ -334,7 +335,8 @@ void TrackContainerView::dropEvent( QDropEvent * _de )
|
||||
//it->toggledInstrumentTrackButton( true );
|
||||
_de->accept();
|
||||
}
|
||||
else if( type == "samplefile" || type == "pluginpresetfile" )
|
||||
else if( type == "samplefile" || type == "pluginpresetfile"
|
||||
|| type == "soundfontfile" || type == "vstpluginfile")
|
||||
{
|
||||
InstrumentTrack * it = dynamic_cast<InstrumentTrack *>(
|
||||
track::create( track::InstrumentTrack,
|
||||
|
||||
@@ -484,7 +484,14 @@ void fileBrowserTreeWidget::mouseMoveEvent( QMouseEvent * _me )
|
||||
new stringPairDrag( "samplefile", f->fullName(),
|
||||
embed::getIconPixmap( "sample_file" ), this );
|
||||
break;
|
||||
|
||||
case fileItem::SoundFontFile:
|
||||
new stringPairDrag( "soundfontfile", f->fullName(),
|
||||
embed::getIconPixmap( "soundfont_file" ), this );
|
||||
break;
|
||||
case fileItem::VstPluginFile:
|
||||
new stringPairDrag( "vstpluginfile", f->fullName(),
|
||||
embed::getIconPixmap( "vst_plugin_file" ), this );
|
||||
break;
|
||||
case fileItem::MidiFile:
|
||||
// don't allow dragging FLP-files as FLP import filter clears project
|
||||
// without asking
|
||||
@@ -493,11 +500,6 @@ void fileBrowserTreeWidget::mouseMoveEvent( QMouseEvent * _me )
|
||||
embed::getIconPixmap( "midi_file" ), this );
|
||||
break;
|
||||
|
||||
case fileItem::VstPluginFile:
|
||||
new stringPairDrag( "vstplugin", f->fullName(),
|
||||
embed::getIconPixmap( "sample_file" ), this );
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -857,6 +859,8 @@ bool directory::addItems( const QString & _path )
|
||||
QPixmap * fileItem::s_projectFilePixmap = NULL;
|
||||
QPixmap * fileItem::s_presetFilePixmap = NULL;
|
||||
QPixmap * fileItem::s_sampleFilePixmap = NULL;
|
||||
QPixmap * fileItem::s_soundfontFilePixmap = NULL;
|
||||
QPixmap * fileItem::s_vstPluginFilePixmap = NULL;
|
||||
QPixmap * fileItem::s_midiFilePixmap = NULL;
|
||||
QPixmap * fileItem::s_flpFilePixmap = NULL;
|
||||
QPixmap * fileItem::s_unknownFilePixmap = NULL;
|
||||
@@ -905,6 +909,18 @@ void fileItem::initPixmaps( void )
|
||||
"sample_file", 16, 16 ) );
|
||||
}
|
||||
|
||||
if ( s_soundfontFilePixmap == NULL )
|
||||
{
|
||||
s_soundfontFilePixmap = new QPixmap( embed::getIconPixmap(
|
||||
"soundfont_file", 16, 16 ) );
|
||||
}
|
||||
|
||||
if ( s_vstPluginFilePixmap == NULL )
|
||||
{
|
||||
s_vstPluginFilePixmap = new QPixmap( embed::getIconPixmap(
|
||||
"vst_plugin_file", 16, 16 ) );
|
||||
}
|
||||
|
||||
if( s_midiFilePixmap == NULL )
|
||||
{
|
||||
s_midiFilePixmap = new QPixmap( embed::getIconPixmap(
|
||||
@@ -931,8 +947,13 @@ void fileItem::initPixmaps( void )
|
||||
case PresetFile:
|
||||
setIcon( 0, *s_presetFilePixmap );
|
||||
break;
|
||||
case SoundFontFile:
|
||||
setIcon( 0, *s_soundfontFilePixmap );
|
||||
break;
|
||||
case VstPluginFile:
|
||||
setIcon( 0, *s_vstPluginFilePixmap );
|
||||
break;
|
||||
case SampleFile:
|
||||
case SoundFontFile: // TODO
|
||||
case PatchFile: // TODO
|
||||
setIcon( 0, *s_sampleFilePixmap );
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user