InstrumentView: added generic DnD support, renamed/splitted files

Added generic drag'n'drop support for all instrument views. All
resources supported by the according instrument now can be dropped
onto instrument view without any extra code in actual instrument.

Additionally renamed some files and classes related to InstrumentView
class to match new style.

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
This commit is contained in:
Tobias Doerffel
2009-06-30 01:19:48 +02:00
parent 65668f9489
commit f943df139e
35 changed files with 251 additions and 380 deletions

View File

@@ -1,8 +1,8 @@
/*
* dummy_instrument.h - instrument used as fallback if an instrument couldn't
* be loaded
* DummyInstrument.h - instrument used as fallback if an instrument couldn't
* be loaded
*
* Copyright (c) 2005-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2005-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -23,23 +23,22 @@
*
*/
#ifndef _DUMMY_INSTRUMENT_H
#define _DUMMY_INSTRUMENT_H
#include "instrument.h"
#include "instrument_view.h"
#include "InstrumentView.h"
class dummyInstrument : public instrument
class DummyInstrument : public instrument
{
public:
dummyInstrument( instrumentTrack * _instrument_track ) :
DummyInstrument( instrumentTrack * _instrument_track ) :
instrument( _instrument_track, NULL )
{
}
virtual ~dummyInstrument()
virtual ~DummyInstrument()
{
}
@@ -57,12 +56,12 @@ public:
virtual QString nodeName( void ) const
{
return( "dummyinstrument" );
return "dummyinstrument";
}
virtual pluginView * instantiateView( QWidget * _parent )
{
return( new instrumentView( this, _parent ) );
return new InstrumentView( this, _parent );
}
} ;

View File

@@ -1,7 +1,7 @@
/*
* instrument_view.h - definition of instrumentView-class
* InstrumentView.h - definition of InstrumentView class
*
* Copyright (c) 2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2008-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -32,25 +32,30 @@
class instrumentTrackWindow;
class EXPORT instrumentView : public pluginView
class EXPORT InstrumentView : public pluginView
{
public:
instrumentView( instrument * _instrument, QWidget * _parent );
virtual ~instrumentView();
InstrumentView( instrument * _instrument, QWidget * _parent );
virtual ~InstrumentView();
instrument * model( void )
instrument * model()
{
return( castModel<instrument>() );
return castModel<instrument>();
}
const instrument * model( void ) const
const instrument * model() const
{
return( castModel<instrument>() );
return castModel<instrument>();
}
virtual void setModel( ::model * _model, bool = FALSE );
virtual void setModel( ::model * _model, bool = false );
instrumentTrackWindow * getInstrumentTrackWindow( void );
instrumentTrackWindow * getInstrumentTrackWindow();
protected:
virtual void dragEnterEvent( QDragEnterEvent * _dee );
virtual void dropEvent( QDropEvent * _de );
} ;

View File

@@ -394,7 +394,7 @@ private:
// test-piano at the bottom of every instrument-settings-window
PianoView * m_pianoView;
friend class instrumentView;
friend class InstrumentView;
} ;