Permalink
Browse files

Add support for .pat previews, drag+drop

Closes #4202
  • Loading branch information...
tresf committed Mar 1, 2018
1 parent 3177575 commit a8e874601169820b15107aae2396539f212205a2
Showing with 8 additions and 3 deletions.
  1. +5 −1 src/gui/FileBrowser.cpp
  2. +3 −2 src/gui/TrackContainerView.cpp
View
@@ -424,7 +424,7 @@ void FileBrowserTreeWidget::mousePressEvent(QMouseEvent * me )
m_previewPlayHandle = s;
delete tf;
}
else if( ( f->extension ()== "xiz" || f->extension() == "sf2" || f->extension() == "gig" ) &&
else if( ( f->extension ()== "xiz" || f->extension() == "sf2" || f->extension() == "gig" || f->extension() == "pat" ) &&
! pluginFactory->pluginSupportingExtension(f->extension()).isNull() )
{
m_previewPlayHandle = new PresetPreviewPlayHandle( f->fullName(), f->handling() == FileItem::LoadByPlugin );
@@ -489,6 +489,10 @@ void FileBrowserTreeWidget::mouseMoveEvent( QMouseEvent * me )
new StringPairDrag( "soundfontfile", f->fullName(),
embed::getIconPixmap( "soundfont_file" ), this );
break;
case FileItem::PatchFile:
new StringPairDrag( "patchfile", f->fullName(),
embed::getIconPixmap( "sample_file" ), this );
break;
case FileItem::VstPluginFile:
new StringPairDrag( "vstpluginfile", f->fullName(),
embed::getIconPixmap( "vst_plugin_file" ), this );
@@ -340,7 +340,7 @@ void TrackContainerView::dragEnterEvent( QDragEnterEvent * _dee )
{
StringPairDrag::processDragEnterEvent( _dee,
QString( "presetfile,pluginpresetfile,samplefile,instrument,"
"importedproject,soundfontfile,vstpluginfile,projectfile,"
"importedproject,soundfontfile,patchfile,vstpluginfile,projectfile,"
"track_%1,track_%2" ).
arg( Track::InstrumentTrack ).
arg( Track::SampleTrack ) );
@@ -378,7 +378,8 @@ void TrackContainerView::dropEvent( QDropEvent * _de )
_de->accept();
}
else if( type == "samplefile" || type == "pluginpresetfile"
|| type == "soundfontfile" || type == "vstpluginfile")
|| type == "soundfontfile" || type == "vstpluginfile"
|| type == "patchfile" )
{
InstrumentTrack * it = dynamic_cast<InstrumentTrack *>(
Track::create( Track::InstrumentTrack,

0 comments on commit a8e8746

Please sign in to comment.