drag'n'drop-support everywhere

git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@38 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Tobias Doerffel
2005-12-19 12:17:23 +00:00
parent f700c16c33
commit 5e6a719b7c
51 changed files with 2492 additions and 1534 deletions

View File

@@ -57,6 +57,8 @@
#include "pixmap_button.h"
#include "knob.h"
#include "tooltip.h"
#include "string_pair_drag.h"
#include "mmp.h"
#include "embed.cpp"
@@ -277,6 +279,7 @@ audioFileProcessor::audioFileProcessor( channelTrack * _channel_track ) :
setBackgroundMode( Qt::NoBackground );
#endif
setAcceptDrops( TRUE );
}
@@ -413,6 +416,36 @@ void audioFileProcessor::deleteNotePluginData( notePlayHandle * _n )
void audioFileProcessor::dragEnterEvent( QDragEnterEvent * _dee )
{
stringPairDrag::processDragEnterEvent( _dee,
QString( "samplefile,tco_%1" ).arg( track::SAMPLE_TRACK ) );
}
void audioFileProcessor::dropEvent( QDropEvent * _de )
{
QString type = stringPairDrag::decodeKey( _de );
QString value = stringPairDrag::decodeValue( _de );
if( type == "samplefile" )
{
setAudioFile( stringPairDrag::decodeValue( _de ) );
_de->accept();
}
else if( type == QString( "tco_%1" ).arg( track::SAMPLE_TRACK ) )
{
multimediaProject mmp( value, FALSE );
setAudioFile( mmp.content().firstChild().toElement().
attribute( "src" ) );
_de->accept();
}
}
void audioFileProcessor::paintEvent( QPaintEvent * )
{
#ifdef QT4
@@ -493,6 +526,7 @@ void audioFileProcessor::sampleUpdated( void )
m_graph.height() );
QPainter p( &m_graph );
#endif
p.setPen( QColor( 64, 255, 160 ) );
m_sampleBuffer.drawWaves( p, QRect( 2, 2, m_graph.width() - 4,
m_graph.height() - 4 ),
m_drawMethod );

View File

@@ -86,7 +86,9 @@ protected slots:
protected:
void paintEvent( QPaintEvent * );
virtual void dragEnterEvent( QDragEnterEvent * _dee );
virtual void dropEvent( QDropEvent * _de );
virtual void paintEvent( QPaintEvent * );
private:

View File

@@ -1,6 +1,6 @@
AUTOMAKE_OPTIONS = foreign 1.4
INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/src/lib -I.
INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/src/lib -I. -I/usr/X11R6/include
AM_CXXFLAGS := $(AM_CXXFLAGS) $(QT_CXXFLAGS) -DPLUGIN_NAME="vestige"