made live-tool work after M/V-split

git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/branches/lmms-mv@704 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Tobias Doerffel
2008-02-25 11:37:21 +00:00
parent 80d2241864
commit 32a3b7cf23
5 changed files with 83 additions and 38 deletions

View File

@@ -1,3 +1,16 @@
2008-02-25 Tobias Doerffel <tobydox/at/users/dot/sourceforge/dot/net>
* include/tool.h:
* src/core/tool.cpp:
* plugins/live_tool/live_tool.h:
* plugins/live_tool/live_tool.cpp:
made live-tool work after M/V-split
* include/track.h:
* src/core/track.cpp:
- connect track's m_mutedModel to m_muteBtn of trackOperationsWidget
- set track for m_mutedModel
2008-02-24 Paul Giblock <pgllama/at/gmail/dot/com>
* plugins/bit_invader/bit_invader.cpp:

View File

@@ -49,7 +49,7 @@ public:
class toolView : public pluginView
{
public:
toolView( tool * _tool, QWidget * _parent );
toolView( tool * _tool );
} ;

View File

@@ -30,7 +30,7 @@
#include "bb_editor.h"
#include "engine.h"
#include "song_editor.h"
#include "song.h"
#ifdef Q_WS_X11
@@ -62,9 +62,9 @@ plugin::descriptor live_tool_plugin_descriptor =
// neccessary for getting instance out of shared lib
plugin * lmms_plugin_main( void * _data )
plugin * lmms_plugin_main( model * _parent, void * _data )
{
return( new liveTool );
return( new liveTool( _parent ) );
}
}
@@ -72,8 +72,34 @@ plugin * lmms_plugin_main( void * _data )
liveTool::liveTool( void ) :
tool( &live_tool_plugin_descriptor )
liveTool::liveTool( model * _parent ) :
tool( &live_tool_plugin_descriptor, _parent )
{
}
liveTool::~liveTool()
{
}
QString liveTool::nodeName( void ) const
{
return( live_tool_plugin_descriptor.name );
}
liveToolView::liveToolView( tool * _tool ) :
toolView( _tool )
{
const QPixmap background = PLUGIN_NAME::getIconPixmap( "artwork" );
@@ -103,39 +129,31 @@ liveTool::liveTool( void ) :
liveTool::~liveTool()
liveToolView::~liveToolView()
{
}
QString liveTool::nodeName( void ) const
{
return( live_tool_plugin_descriptor.name );
}
void liveTool::keyPressEvent( QKeyEvent * _ke )
void liveToolView::keyPressEvent( QKeyEvent * _ke )
{
switch( _ke->key() )
{
case Qt::Key_Space:
if( engine::getSongEditor()->playing() )
if( engine::getSong()->playing() )
{
engine::getSongEditor()->pause();
engine::getSong()->pause();
}
else if( engine::getSongEditor()->paused() &&
engine::getSongEditor()->playMode() ==
songEditor::PLAY_SONG )
else if( engine::getSong()->paused() &&
engine::getSong()->playMode() ==
song::Mode_PlaySong )
{
engine::getSongEditor()->resumeFromPause();
engine::getSong()->resumeFromPause();
}
else
{
engine::getSongEditor()->play();
engine::getSong()->play();
}
break;
@@ -148,7 +166,7 @@ void liveTool::keyPressEvent( QKeyEvent * _ke )
void liveTool::mousePressEvent( QMouseEvent * _me )
void liveToolView::mousePressEvent( QMouseEvent * _me )
{
// MDI window gets focus otherwise
setFocus();
@@ -159,7 +177,7 @@ void liveTool::mousePressEvent( QMouseEvent * _me )
#ifdef Q_WS_X11
bool liveTool::x11Event( XEvent * _xe )
bool liveToolView::x11Event( XEvent * _xe )
{
if( _xe->type == KeyPress )
{
@@ -178,11 +196,11 @@ bool liveTool::x11Event( XEvent * _xe )
void liveTool::toggleInstrument( int _n )
void liveToolView::toggleInstrument( int _n )
{
if( _n < engine::getBBEditor()->tracks().count() )
if( _n < engine::getBBTrackContainer()->tracks().count() )
{
track * t = engine::getBBEditor()->tracks().at( _n );
track * t = engine::getBBTrackContainer()->tracks().at( _n );
t->setMuted( !t->muted() );
}
}
@@ -190,4 +208,5 @@ void liveTool::toggleInstrument( int _n )
#include "live_tool.moc"

View File

@@ -31,15 +31,11 @@
class liveTool : public tool
class liveToolView : public toolView
{
Q_OBJECT
public:
liveTool( void );
virtual ~liveTool();
virtual QString nodeName( void ) const;
liveToolView( tool * _tool );
virtual ~liveToolView();
protected:
@@ -58,4 +54,21 @@ private:
class liveTool : public tool
{
public:
liveTool( model * _parent );
virtual ~liveTool();
virtual QString nodeName( void ) const;
virtual pluginView * instantiateView( QWidget * )
{
return( new liveToolView( this ) );
}
} ;
#endif

View File

@@ -3,7 +3,7 @@
/*
* tool.cpp - base class for all tool plugins (graphs, extensions, etc)
*
* Copyright (c) 2006-2007 Javier Serrano Polo <jasp00/at/users.sourceforge.net>
* Copyright (c) 2006-2008 Javier Serrano Polo <jasp00/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -70,8 +70,8 @@ tool * tool::instantiate( const QString & _plugin_name, model * _parent )
toolView::toolView( tool * _tool, QWidget * _parent ) :
pluginView( _tool, _parent )
toolView::toolView( tool * _tool ) :
pluginView( _tool, engine::getMainWindow()->workspace() )
{
QWidget * window;
if( engine::getMainWindow()->workspace() )