fixed loading presets when dragging them onto existing instrument-track-window (finally closes #2025902)
git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1459 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
@@ -48,15 +48,6 @@
|
||||
#include "text_float.h"
|
||||
|
||||
|
||||
static inline void removeMidiPortNode( multimediaProject & _mmp )
|
||||
{
|
||||
QDomNodeList n = _mmp.elementsByTagName( "midiport" );
|
||||
n.item( 0 ).parentNode().removeChild( n.item( 0 ) );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
fileBrowser::fileBrowser( const QString & _directories, const QString & _filter,
|
||||
const QString & _title, const QPixmap & _pm,
|
||||
QWidget * _parent ) :
|
||||
@@ -243,7 +234,7 @@ void listView::activateListItem( QTreeWidgetItem * _item, int _column )
|
||||
{
|
||||
// presets are per default opened in bb-editor
|
||||
multimediaProject mmp( f->fullName() );
|
||||
removeMidiPortNode( mmp );
|
||||
instrumentTrack::removeMidiPortNode( mmp );
|
||||
|
||||
engine::getMixer()->lock();
|
||||
instrumentTrack * it = dynamic_cast<instrumentTrack *>(
|
||||
@@ -309,7 +300,7 @@ void listView::sendToActiveInstrumentTrack( void )
|
||||
{
|
||||
multimediaProject mmp(
|
||||
m_contextMenuItem->fullName() );
|
||||
removeMidiPortNode( mmp );
|
||||
instrumentTrack::removeMidiPortNode( mmp );
|
||||
itw->model()->setSimpleSerializing();
|
||||
itw->model()->loadSettings(
|
||||
mmp.content().toElement() );
|
||||
@@ -347,7 +338,7 @@ void listView::openInNewInstrumentTrack( trackContainer * _tc )
|
||||
else if( m_contextMenuItem->type() == fileItem::PresetFile )
|
||||
{
|
||||
multimediaProject mmp( m_contextMenuItem->fullName() );
|
||||
removeMidiPortNode( mmp );
|
||||
instrumentTrack::removeMidiPortNode( mmp );
|
||||
track * t = track::create( track::InstrumentTrack, _tc );
|
||||
instrumentTrack * it = dynamic_cast<instrumentTrack *>( t );
|
||||
if( it != NULL )
|
||||
|
||||
@@ -442,6 +442,15 @@ QString instrumentTrack::displayName( void ) const
|
||||
|
||||
|
||||
|
||||
void instrumentTrack::removeMidiPortNode( multimediaProject & _mmp )
|
||||
{
|
||||
QDomNodeList n = _mmp.elementsByTagName( "midiport" );
|
||||
n.item( 0 ).parentNode().removeChild( n.item( 0 ) );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
bool instrumentTrack::play( const midiTime & _start,
|
||||
const fpp_t _frames,
|
||||
const f_cnt_t _offset,
|
||||
@@ -1349,8 +1358,9 @@ void instrumentTrackWindow::dropEvent( QDropEvent * _de )
|
||||
else if( type == "presetfile" )
|
||||
{
|
||||
multimediaProject mmp( value );
|
||||
m_track->loadTrackSpecificSettings( mmp.content().firstChild().
|
||||
toElement() );
|
||||
instrumentTrack::removeMidiPortNode( mmp );
|
||||
m_track->setSimpleSerializing();
|
||||
m_track->loadSettings( mmp.content().toElement() );
|
||||
engine::getSong()->setModified();
|
||||
_de->accept();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user