Drag-and-drop support for VST, SF2

This commit is contained in:
Tres Finocchiaro
2014-05-21 16:39:02 -04:00
parent 3e02a15908
commit 71f6b1b205
5 changed files with 34 additions and 9 deletions

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@@ -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;

View File

@@ -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,

View File

@@ -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;