Skip to content

Commit a8e8746

Browse files
committed
Add support for .pat previews, drag+drop
Closes #4202
1 parent 3177575 commit a8e8746

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

src/gui/FileBrowser.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ void FileBrowserTreeWidget::mousePressEvent(QMouseEvent * me )
424424
m_previewPlayHandle = s;
425425
delete tf;
426426
}
427-
else if( ( f->extension ()== "xiz" || f->extension() == "sf2" || f->extension() == "gig" ) &&
427+
else if( ( f->extension ()== "xiz" || f->extension() == "sf2" || f->extension() == "gig" || f->extension() == "pat" ) &&
428428
! pluginFactory->pluginSupportingExtension(f->extension()).isNull() )
429429
{
430430
m_previewPlayHandle = new PresetPreviewPlayHandle( f->fullName(), f->handling() == FileItem::LoadByPlugin );
@@ -489,6 +489,10 @@ void FileBrowserTreeWidget::mouseMoveEvent( QMouseEvent * me )
489489
new StringPairDrag( "soundfontfile", f->fullName(),
490490
embed::getIconPixmap( "soundfont_file" ), this );
491491
break;
492+
case FileItem::PatchFile:
493+
new StringPairDrag( "patchfile", f->fullName(),
494+
embed::getIconPixmap( "sample_file" ), this );
495+
break;
492496
case FileItem::VstPluginFile:
493497
new StringPairDrag( "vstpluginfile", f->fullName(),
494498
embed::getIconPixmap( "vst_plugin_file" ), this );

src/gui/TrackContainerView.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ void TrackContainerView::dragEnterEvent( QDragEnterEvent * _dee )
340340
{
341341
StringPairDrag::processDragEnterEvent( _dee,
342342
QString( "presetfile,pluginpresetfile,samplefile,instrument,"
343-
"importedproject,soundfontfile,vstpluginfile,projectfile,"
343+
"importedproject,soundfontfile,patchfile,vstpluginfile,projectfile,"
344344
"track_%1,track_%2" ).
345345
arg( Track::InstrumentTrack ).
346346
arg( Track::SampleTrack ) );
@@ -378,7 +378,8 @@ void TrackContainerView::dropEvent( QDropEvent * _de )
378378
_de->accept();
379379
}
380380
else if( type == "samplefile" || type == "pluginpresetfile"
381-
|| type == "soundfontfile" || type == "vstpluginfile")
381+
|| type == "soundfontfile" || type == "vstpluginfile"
382+
|| type == "patchfile" )
382383
{
383384
InstrumentTrack * it = dynamic_cast<InstrumentTrack *>(
384385
Track::create( Track::InstrumentTrack,

0 commit comments

Comments
 (0)