File and class renames part 1
Most files and most of the core classes and their methods have been
renamed to match new coding style conventions:
391 files changed, 25400 insertions(+), 25598 deletions(-)
Furthermore splitted some files where model and view classes were
declared or implemented together in the same file.
Should be tested thoroughly as I might have missed renaming some virtual
methods or SIGNAL/SLOT parameters.
(cherry picked from commit 8c9a9dd14c)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* automatable_model.cpp - some implementations of automatableModel-class
|
||||
* AutomatableModel.cpp - some implementations of AutomatableModel-class
|
||||
*
|
||||
* Copyright (c) 2008-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
@@ -22,29 +22,27 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include <QtXml/QDomElement>
|
||||
|
||||
|
||||
#include "automatable_model.h"
|
||||
#include "AutomatableModel.h"
|
||||
#include "automation_pattern.h"
|
||||
#include "ControllerConnection.h"
|
||||
|
||||
|
||||
float automatableModel::__copiedValue = 0;
|
||||
float AutomatableModel::__copiedValue = 0;
|
||||
|
||||
|
||||
|
||||
|
||||
automatableModel::automatableModel( DataType _type,
|
||||
AutomatableModel::AutomatableModel( DataType _type,
|
||||
const float _val,
|
||||
const float _min,
|
||||
const float _max,
|
||||
const float _step,
|
||||
::model * _parent,
|
||||
::Model * _parent,
|
||||
const QString & _display_name,
|
||||
bool _default_constructed ) :
|
||||
model( _parent, _display_name, _default_constructed ),
|
||||
Model( _parent, _display_name, _default_constructed ),
|
||||
m_dataType( _type ),
|
||||
m_value( _val ),
|
||||
m_initValue( _val ),
|
||||
@@ -62,7 +60,7 @@ automatableModel::automatableModel( DataType _type,
|
||||
|
||||
|
||||
|
||||
automatableModel::~automatableModel()
|
||||
AutomatableModel::~AutomatableModel()
|
||||
{
|
||||
while( m_linkedModels.empty() == false )
|
||||
{
|
||||
@@ -81,7 +79,7 @@ automatableModel::~automatableModel()
|
||||
|
||||
|
||||
|
||||
bool automatableModel::isAutomated( void ) const
|
||||
bool AutomatableModel::isAutomated() const
|
||||
{
|
||||
return automationPattern::isAutomated( this );
|
||||
}
|
||||
@@ -89,7 +87,7 @@ bool automatableModel::isAutomated( void ) const
|
||||
|
||||
|
||||
|
||||
void automatableModel::saveSettings( QDomDocument & _doc, QDomElement & _this,
|
||||
void AutomatableModel::saveSettings( QDomDocument & _doc, QDomElement & _this,
|
||||
const QString & _name )
|
||||
{
|
||||
if( isAutomated() )
|
||||
@@ -126,7 +124,7 @@ void automatableModel::saveSettings( QDomDocument & _doc, QDomElement & _this,
|
||||
|
||||
|
||||
|
||||
void automatableModel::loadSettings( const QDomElement & _this,
|
||||
void AutomatableModel::loadSettings( const QDomElement & _this,
|
||||
const QString & _name )
|
||||
{
|
||||
// compat code
|
||||
@@ -176,7 +174,7 @@ void automatableModel::loadSettings( const QDomElement & _this,
|
||||
|
||||
|
||||
|
||||
void automatableModel::setValue( const float _value )
|
||||
void AutomatableModel::setValue( const float _value )
|
||||
{
|
||||
++m_setValueDepth;
|
||||
const float old_val = m_value;
|
||||
@@ -185,10 +183,10 @@ void automatableModel::setValue( const float _value )
|
||||
if( old_val != m_value )
|
||||
{
|
||||
// add changes to history so user can undo it
|
||||
addJournalEntry( journalEntry( 0, m_value - old_val ) );
|
||||
addJournalEntry( JournalEntry( 0, m_value - old_val ) );
|
||||
|
||||
// notify linked models
|
||||
for( autoModelVector::iterator it =
|
||||
for( AutoModelVector::Iterator it =
|
||||
m_linkedModels.begin();
|
||||
it != m_linkedModels.end(); ++it )
|
||||
{
|
||||
@@ -214,7 +212,7 @@ void automatableModel::setValue( const float _value )
|
||||
|
||||
|
||||
|
||||
void automatableModel::setAutomatedValue( const float _value )
|
||||
void AutomatableModel::setAutomatedValue( const float _value )
|
||||
{
|
||||
++m_setValueDepth;
|
||||
const float old_val = m_value;
|
||||
@@ -223,9 +221,8 @@ void automatableModel::setAutomatedValue( const float _value )
|
||||
if( old_val != m_value )
|
||||
{
|
||||
// notify linked models
|
||||
for( autoModelVector::iterator it =
|
||||
m_linkedModels.begin();
|
||||
it != m_linkedModels.end(); ++it )
|
||||
for( AutoModelVector::Iterator it = m_linkedModels.begin();
|
||||
it != m_linkedModels.end(); ++it )
|
||||
{
|
||||
if( (*it)->m_setValueDepth < 1 &&
|
||||
!(*it)->fittedValue( m_value ) !=
|
||||
@@ -242,7 +239,7 @@ void automatableModel::setAutomatedValue( const float _value )
|
||||
|
||||
|
||||
|
||||
void automatableModel::setRange( const float _min, const float _max,
|
||||
void AutomatableModel::setRange( const float _min, const float _max,
|
||||
const float _step )
|
||||
{
|
||||
if( ( m_maxValue != _max ) || ( m_minValue != _min ) )
|
||||
@@ -266,7 +263,7 @@ void automatableModel::setRange( const float _min, const float _max,
|
||||
|
||||
|
||||
|
||||
void automatableModel::setStep( const float _step )
|
||||
void AutomatableModel::setStep( const float _step )
|
||||
{
|
||||
if( m_step != _step )
|
||||
{
|
||||
@@ -278,7 +275,7 @@ void automatableModel::setStep( const float _step )
|
||||
|
||||
|
||||
|
||||
float automatableModel::fittedValue( float _value ) const
|
||||
float AutomatableModel::fittedValue( float _value ) const
|
||||
{
|
||||
_value = tLimit<float>( _value, m_minValue, m_maxValue );
|
||||
|
||||
@@ -321,7 +318,7 @@ float automatableModel::fittedValue( float _value ) const
|
||||
|
||||
|
||||
|
||||
void automatableModel::redoStep( journalEntry & _je )
|
||||
void AutomatableModel::redoStep( JournalEntry & _je )
|
||||
{
|
||||
bool journalling = testAndSetJournalling( false );
|
||||
setValue( value<float>() + (float) _je.data().toDouble() );
|
||||
@@ -331,16 +328,16 @@ void automatableModel::redoStep( journalEntry & _je )
|
||||
|
||||
|
||||
|
||||
void automatableModel::undoStep( journalEntry & _je )
|
||||
void AutomatableModel::undoStep( JournalEntry & _je )
|
||||
{
|
||||
journalEntry je( _je.actionID(), -_je.data().toDouble() );
|
||||
JournalEntry je( _je.actionID(), -_je.data().toDouble() );
|
||||
redoStep( je );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void automatableModel::prepareJournalEntryFromOldVal( void )
|
||||
void AutomatableModel::prepareJournalEntryFromOldVal()
|
||||
{
|
||||
m_oldValue = value<float>();
|
||||
saveJournallingState( false );
|
||||
@@ -350,14 +347,14 @@ void automatableModel::prepareJournalEntryFromOldVal( void )
|
||||
|
||||
|
||||
|
||||
void automatableModel::addJournalEntryFromOldToCurVal( void )
|
||||
void AutomatableModel::addJournalEntryFromOldToCurVal()
|
||||
{
|
||||
if( m_journalEntryReady )
|
||||
{
|
||||
restoreJournallingState();
|
||||
if( value<float>() != m_oldValue )
|
||||
{
|
||||
addJournalEntry( journalEntry( 0, value<float>() -
|
||||
addJournalEntry( JournalEntry( 0, value<float>() -
|
||||
m_oldValue ) );
|
||||
}
|
||||
m_journalEntryReady = false;
|
||||
@@ -367,7 +364,7 @@ void automatableModel::addJournalEntryFromOldToCurVal( void )
|
||||
|
||||
|
||||
|
||||
void automatableModel::linkModel( automatableModel * _model )
|
||||
void AutomatableModel::linkModel( AutomatableModel * _model )
|
||||
{
|
||||
if( !m_linkedModels.contains( _model ) )
|
||||
{
|
||||
@@ -384,10 +381,10 @@ void automatableModel::linkModel( automatableModel * _model )
|
||||
|
||||
|
||||
|
||||
void automatableModel::unlinkModel( automatableModel * _model )
|
||||
void AutomatableModel::unlinkModel( AutomatableModel * _model )
|
||||
{
|
||||
autoModelVector::iterator it = qFind( m_linkedModels.begin(),
|
||||
m_linkedModels.end(), _model );
|
||||
AutoModelVector::Iterator it =
|
||||
qFind( m_linkedModels.begin(), m_linkedModels.end(), _model );
|
||||
if( it != m_linkedModels.end() )
|
||||
{
|
||||
m_linkedModels.erase( it );
|
||||
@@ -400,8 +397,8 @@ void automatableModel::unlinkModel( automatableModel * _model )
|
||||
|
||||
|
||||
|
||||
void automatableModel::linkModels( automatableModel * _model1,
|
||||
automatableModel * _model2 )
|
||||
void AutomatableModel::linkModels( AutomatableModel * _model1,
|
||||
AutomatableModel * _model2 )
|
||||
{
|
||||
_model1->linkModel( _model2 );
|
||||
_model2->linkModel( _model1 );
|
||||
@@ -410,8 +407,8 @@ void automatableModel::linkModels( automatableModel * _model1,
|
||||
|
||||
|
||||
|
||||
void automatableModel::unlinkModels( automatableModel * _model1,
|
||||
automatableModel * _model2 )
|
||||
void AutomatableModel::unlinkModels( AutomatableModel * _model1,
|
||||
AutomatableModel * _model2 )
|
||||
{
|
||||
_model1->unlinkModel( _model2 );
|
||||
_model2->unlinkModel( _model1 );
|
||||
@@ -420,7 +417,7 @@ void automatableModel::unlinkModels( automatableModel * _model1,
|
||||
|
||||
|
||||
|
||||
void automatableModel::setControllerConnection( ControllerConnection * _c )
|
||||
void AutomatableModel::setControllerConnection( ControllerConnection * _c )
|
||||
{
|
||||
m_controllerConnection = _c;
|
||||
if( _c )
|
||||
@@ -437,7 +434,7 @@ void automatableModel::setControllerConnection( ControllerConnection * _c )
|
||||
|
||||
|
||||
|
||||
float automatableModel::controllerValue( int _frameOffset ) const
|
||||
float AutomatableModel::controllerValue( int _frameOffset ) const
|
||||
{
|
||||
if( m_controllerConnection )
|
||||
{
|
||||
@@ -450,7 +447,7 @@ float automatableModel::controllerValue( int _frameOffset ) const
|
||||
}
|
||||
return v;
|
||||
}
|
||||
automatableModel * lm = m_linkedModels.first();
|
||||
AutomatableModel * lm = m_linkedModels.first();
|
||||
if( lm->m_controllerConnection )
|
||||
{
|
||||
return lm->controllerValue( _frameOffset );
|
||||
@@ -461,7 +458,7 @@ float automatableModel::controllerValue( int _frameOffset ) const
|
||||
|
||||
|
||||
|
||||
void automatableModel::unlinkControllerConnection( void )
|
||||
void AutomatableModel::unlinkControllerConnection()
|
||||
{
|
||||
if( m_controllerConnection )
|
||||
{
|
||||
@@ -474,7 +471,7 @@ void automatableModel::unlinkControllerConnection( void )
|
||||
|
||||
|
||||
|
||||
void automatableModel::setInitValue( const float _value )
|
||||
void AutomatableModel::setInitValue( const float _value )
|
||||
{
|
||||
m_initValue = _value;
|
||||
bool journalling = testAndSetJournalling( false );
|
||||
@@ -486,7 +483,7 @@ void automatableModel::setInitValue( const float _value )
|
||||
|
||||
|
||||
|
||||
void automatableModel::reset( void )
|
||||
void AutomatableModel::reset()
|
||||
{
|
||||
setValue( initValue<float>() );
|
||||
}
|
||||
@@ -494,7 +491,7 @@ void automatableModel::reset( void )
|
||||
|
||||
|
||||
|
||||
void automatableModel::copyValue( void )
|
||||
void AutomatableModel::copyValue()
|
||||
{
|
||||
__copiedValue = value<float>();
|
||||
}
|
||||
@@ -502,7 +499,7 @@ void automatableModel::copyValue( void )
|
||||
|
||||
|
||||
|
||||
void automatableModel::pasteValue( void )
|
||||
void AutomatableModel::pasteValue()
|
||||
{
|
||||
setValue( __copiedValue );
|
||||
}
|
||||
@@ -510,5 +507,5 @@ void automatableModel::pasteValue( void )
|
||||
|
||||
|
||||
|
||||
#include "moc_automatable_model.cxx"
|
||||
#include "moc_AutomatableModel.cxx"
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* clipboard.cpp - the clipboard for patterns, notes etc.
|
||||
* Clipboard.cpp - the clipboard for patterns, notes etc.
|
||||
*
|
||||
* Copyright (c) 2004-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* Copyright (c) 2004-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
@@ -22,22 +22,17 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "clipboard.h"
|
||||
#include "journalling_object.h"
|
||||
#include "Clipboard.h"
|
||||
#include "JournallingObject.h"
|
||||
|
||||
|
||||
Clipboard::Map Clipboard::content;
|
||||
|
||||
|
||||
clipboard::map clipboard::content;
|
||||
|
||||
|
||||
|
||||
|
||||
void clipboard::copy( journallingObject * _obj )
|
||||
void Clipboard::copy( JournallingObject * _obj )
|
||||
{
|
||||
QDomDocument doc;
|
||||
QDomElement parent = doc.createElement( "clipboard" );
|
||||
QDomElement parent = doc.createElement( "Clipboard" );
|
||||
_obj->saveState( doc, parent );
|
||||
content[_obj->nodeName()] = parent.firstChild().toElement();
|
||||
}
|
||||
@@ -45,15 +40,14 @@ void clipboard::copy( journallingObject * _obj )
|
||||
|
||||
|
||||
|
||||
const QDomElement * clipboard::getContent( const QString & _node_name )
|
||||
const QDomElement * Clipboard::getContent( const QString & _node_name )
|
||||
{
|
||||
if( content.find( _node_name ) != content.end() )
|
||||
{
|
||||
return( &content[_node_name] );
|
||||
return &content[_node_name];
|
||||
}
|
||||
return( NULL );
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* combobox_model.cpp - implementation of comboBoxModel
|
||||
* ComboBoxModel.cpp - implementation of ComboBoxModel
|
||||
*
|
||||
* Copyright (c) 2008-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* Copyright (c) 2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
@@ -21,14 +21,13 @@
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "combobox_model.h"
|
||||
#include "ComboBoxModel.h"
|
||||
#include "embed.h"
|
||||
|
||||
|
||||
|
||||
void comboBoxModel::addItem( const QString & _item, pixmapLoader * _pl )
|
||||
void ComboBoxModel::addItem( const QString & _item, PixmapLoader * _pl )
|
||||
{
|
||||
m_items.push_back( qMakePair( _item, _pl ) );
|
||||
setRange( 0, m_items.size() - 1 );
|
||||
@@ -37,10 +36,10 @@ void comboBoxModel::addItem( const QString & _item, pixmapLoader * _pl )
|
||||
|
||||
|
||||
|
||||
void comboBoxModel::clear( void )
|
||||
void ComboBoxModel::clear()
|
||||
{
|
||||
setRange( 0, 0 );
|
||||
foreach( const item & _i, m_items )
|
||||
foreach( const Item & _i, m_items )
|
||||
{
|
||||
delete _i.second;
|
||||
}
|
||||
@@ -51,21 +50,20 @@ void comboBoxModel::clear( void )
|
||||
|
||||
|
||||
|
||||
int comboBoxModel::findText( const QString & _txt ) const
|
||||
int ComboBoxModel::findText( const QString & _txt ) const
|
||||
{
|
||||
for( QVector<item>::const_iterator it = m_items.begin();
|
||||
for( QVector<Item>::ConstIterator it = m_items.begin();
|
||||
it != m_items.end(); ++it )
|
||||
{
|
||||
if( ( *it ).first == _txt )
|
||||
{
|
||||
return( it - m_items.begin() );
|
||||
return it - m_items.begin();
|
||||
}
|
||||
}
|
||||
return( -1 );
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#include "moc_combobox_model.cxx"
|
||||
#include "moc_ComboBoxModel.cxx"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Controller.cpp - implementation of class controller which handles
|
||||
* remote-control of automatableModels
|
||||
* remote-control of AutomatableModels
|
||||
*
|
||||
* Copyright (c) 2008 Paul Giblock <drfaygo/at/gmail.com>
|
||||
*
|
||||
@@ -44,10 +44,10 @@ QVector<Controller *> Controller::s_controllers;
|
||||
|
||||
|
||||
|
||||
Controller::Controller( ControllerTypes _type, model * _parent,
|
||||
Controller::Controller( ControllerTypes _type, Model * _parent,
|
||||
const QString & _display_name ) :
|
||||
model( _parent, _display_name ),
|
||||
journallingObject(),
|
||||
Model( _parent, _display_name ),
|
||||
JournallingObject(),
|
||||
m_type( _type )
|
||||
{
|
||||
if( _type != DummyController && _type != MidiController )
|
||||
@@ -138,7 +138,7 @@ void Controller::resetFrameCounter( void )
|
||||
|
||||
|
||||
|
||||
Controller * Controller::create( ControllerTypes _ct, model * _parent )
|
||||
Controller * Controller::create( ControllerTypes _ct, Model * _parent )
|
||||
{
|
||||
static Controller * dummy = NULL;
|
||||
Controller * c = NULL;
|
||||
@@ -174,7 +174,7 @@ Controller * Controller::create( ControllerTypes _ct, model * _parent )
|
||||
|
||||
|
||||
|
||||
Controller * Controller::create( const QDomElement & _this, model * _parent )
|
||||
Controller * Controller::create( const QDomElement & _this, Model * _parent )
|
||||
{
|
||||
Controller * c = create(
|
||||
static_cast<ControllerTypes>( _this.attribute( "type" ).toInt() ),
|
||||
@@ -189,13 +189,13 @@ Controller * Controller::create( const QDomElement & _this, model * _parent )
|
||||
|
||||
|
||||
|
||||
bool Controller::hasModel( const model * m )
|
||||
bool Controller::hasModel( const Model * m )
|
||||
{
|
||||
QObjectList chldren = children();
|
||||
for( int i = 0; i < chldren.size(); ++i )
|
||||
{
|
||||
QObject * c = chldren.at(i);
|
||||
automatableModel * am = qobject_cast<automatableModel*>(c);
|
||||
AutomatableModel * am = qobject_cast<AutomatableModel*>(c);
|
||||
if( am != NULL )
|
||||
{
|
||||
if( am == m )
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* ControllerConnection.cpp - implementation of class controller connection
|
||||
* which handles the link between automatableModels and controllers
|
||||
* which handles the link between AutomatableModels and controllers
|
||||
*
|
||||
* Copyright (c) 2008 Paul Giblock <drfaygo/at/gmail.com>
|
||||
*
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* effect.cpp - base-class for effects
|
||||
* Effect.cpp - base-class for effects
|
||||
*
|
||||
* Copyright (c) 2006-2007 Danny McRae <khjklujn/at/users.sourceforge.net>
|
||||
* Copyright (c) 2006-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* Copyright (c) 2006-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
@@ -28,24 +28,24 @@
|
||||
|
||||
#include <cstdio>
|
||||
|
||||
#include "effect.h"
|
||||
#include "Effect.h"
|
||||
#include "engine.h"
|
||||
#include "dummy_effect.h"
|
||||
#include "effect_chain.h"
|
||||
#include "effect_view.h"
|
||||
#include "DummyEffect.h"
|
||||
#include "EffectChain.h"
|
||||
#include "EffectView.h"
|
||||
|
||||
|
||||
effect::effect( const plugin::descriptor * _desc,
|
||||
model * _parent,
|
||||
const descriptor::subPluginFeatures::key * _key ) :
|
||||
plugin( _desc, _parent ),
|
||||
m_key( _key ? *_key : descriptor::subPluginFeatures::key() ),
|
||||
Effect::Effect( const Plugin::Descriptor * _desc,
|
||||
Model * _parent,
|
||||
const Descriptor::SubPluginFeatures::Key * _key ) :
|
||||
Plugin( _desc, _parent ),
|
||||
m_key( _key ? *_key : Descriptor::SubPluginFeatures::Key() ),
|
||||
m_processors( 1 ),
|
||||
m_okay( TRUE ),
|
||||
m_noRun( FALSE ),
|
||||
m_running( FALSE ),
|
||||
m_okay( true ),
|
||||
m_noRun( false ),
|
||||
m_running( false ),
|
||||
m_bufferCount( 0 ),
|
||||
m_enabledModel( TRUE, this, tr( "Effect enabled" ) ),
|
||||
m_enabledModel( true, this, tr( "Effect enabled" ) ),
|
||||
m_wetDryModel( 1.0f, -1.0f, 1.0f, 0.01f, this, tr( "Wet/Dry mix" ) ),
|
||||
m_gateModel( 0.0f, 0.0f, 1.0f, 0.01f, this, tr( "Gate" ) ),
|
||||
m_autoQuitModel( 1.0f, 1.0f, 8000.0f, 100.0f, 1.0f, this, tr( "Decay" ) )
|
||||
@@ -57,7 +57,7 @@ effect::effect( const plugin::descriptor * _desc,
|
||||
|
||||
|
||||
|
||||
effect::~effect()
|
||||
Effect::~Effect()
|
||||
{
|
||||
for( int i = 0; i < 2; ++i )
|
||||
{
|
||||
@@ -71,19 +71,19 @@ effect::~effect()
|
||||
|
||||
|
||||
|
||||
void effect::saveSettings( QDomDocument & _doc, QDomElement & _this )
|
||||
void Effect::saveSettings( QDomDocument & _doc, QDomElement & _this )
|
||||
{
|
||||
m_enabledModel.saveSettings( _doc, _this, "on" );
|
||||
m_wetDryModel.saveSettings( _doc, _this, "wet" );
|
||||
m_autoQuitModel.saveSettings( _doc, _this, "autoquit" );
|
||||
m_gateModel.saveSettings( _doc, _this, "gate" );
|
||||
getControls()->saveState( _doc, _this );
|
||||
controls()->saveState( _doc, _this );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void effect::loadSettings( const QDomElement & _this )
|
||||
void Effect::loadSettings( const QDomElement & _this )
|
||||
{
|
||||
m_enabledModel.loadSettings( _this, "on" );
|
||||
m_wetDryModel.loadSettings( _this, "wet" );
|
||||
@@ -95,9 +95,9 @@ void effect::loadSettings( const QDomElement & _this )
|
||||
{
|
||||
if( node.isElement() )
|
||||
{
|
||||
if( getControls()->nodeName() == node.nodeName() )
|
||||
if( controls()->nodeName() == node.nodeName() )
|
||||
{
|
||||
getControls()->restoreState( node.toElement() );
|
||||
controls()->restoreState( node.toElement() );
|
||||
}
|
||||
}
|
||||
node = node.nextSibling();
|
||||
@@ -108,34 +108,34 @@ void effect::loadSettings( const QDomElement & _this )
|
||||
|
||||
|
||||
|
||||
effect * effect::instantiate( const QString & _plugin_name,
|
||||
model * _parent,
|
||||
descriptor::subPluginFeatures::key * _key )
|
||||
Effect * Effect::instantiate( const QString & _plugin_name,
|
||||
Model * _parent,
|
||||
Descriptor::SubPluginFeatures::Key * _key )
|
||||
{
|
||||
plugin * p = plugin::instantiate( _plugin_name, _parent, _key );
|
||||
Plugin * p = Plugin::instantiate( _plugin_name, _parent, _key );
|
||||
// check whether instantiated plugin is an effect
|
||||
if( dynamic_cast<effect *>( p ) != NULL )
|
||||
if( dynamic_cast<Effect *>( p ) != NULL )
|
||||
{
|
||||
// everything ok, so return pointer
|
||||
return( dynamic_cast<effect *>( p ) );
|
||||
return dynamic_cast<Effect *>( p );
|
||||
}
|
||||
|
||||
// not quite... so delete plugin and return dummy effect
|
||||
delete p;
|
||||
return( new dummyEffect( _parent ) );
|
||||
return new DummyEffect( _parent );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void effect::checkGate( double _out_sum )
|
||||
void Effect::checkGate( double _out_sum )
|
||||
{
|
||||
// Check whether we need to continue processing input. Restart the
|
||||
// counter if the threshold has been exceeded.
|
||||
if( _out_sum <= getGate()+0.000001 )
|
||||
if( _out_sum <= gate()+0.000001 )
|
||||
{
|
||||
incrementBufferCount();
|
||||
if( getBufferCount() > getTimeout() )
|
||||
if( bufferCount() > timeout() )
|
||||
{
|
||||
stopRunning();
|
||||
resetBufferCount();
|
||||
@@ -150,15 +150,15 @@ void effect::checkGate( double _out_sum )
|
||||
|
||||
|
||||
|
||||
pluginView * effect::instantiateView( QWidget * _parent )
|
||||
PluginView * Effect::instantiateView( QWidget * _parent )
|
||||
{
|
||||
return( new effectView( this, _parent ) );
|
||||
return new EffectView( this, _parent );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void effect::reinitSRC( void )
|
||||
void Effect::reinitSRC()
|
||||
{
|
||||
for( int i = 0; i < 2; ++i )
|
||||
{
|
||||
@@ -180,7 +180,7 @@ void effect::reinitSRC( void )
|
||||
|
||||
|
||||
|
||||
void effect::resample( int _i, const sampleFrame * _src_buf,
|
||||
void Effect::resample( int _i, const sampleFrame * _src_buf,
|
||||
sample_rate_t _src_sr,
|
||||
sampleFrame * _dst_buf, sample_rate_t _dst_sr,
|
||||
f_cnt_t _frames )
|
||||
@@ -198,7 +198,7 @@ void effect::resample( int _i, const sampleFrame * _src_buf,
|
||||
int error;
|
||||
if( ( error = src_process( m_srcState[_i], &m_srcData[_i] ) ) )
|
||||
{
|
||||
fprintf( stderr, "effect::resample(): error while resampling: %s\n",
|
||||
fprintf( stderr, "Effect::resample(): error while resampling: %s\n",
|
||||
src_strerror( error ) );
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* effect_chain.cpp - class for processing and effects chain
|
||||
* EffectChain.cpp - class for processing and effects chain
|
||||
*
|
||||
* Copyright (c) 2006-2008 Danny McRae <khjklujn/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
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
@@ -26,25 +26,25 @@
|
||||
|
||||
#include <QtXml/QDomElement>
|
||||
|
||||
#include "effect_chain.h"
|
||||
#include "effect.h"
|
||||
#include "EffectChain.h"
|
||||
#include "Effect.h"
|
||||
#include "engine.h"
|
||||
#include "debug.h"
|
||||
#include "dummy_effect.h"
|
||||
#include "DummyEffect.h"
|
||||
|
||||
|
||||
|
||||
effectChain::effectChain( model * _parent ) :
|
||||
model( _parent ),
|
||||
serializingObject(),
|
||||
m_enabledModel( FALSE, NULL, tr( "Effects enabled" ) )
|
||||
EffectChain::EffectChain( Model * _parent ) :
|
||||
Model( _parent ),
|
||||
SerializingObject(),
|
||||
m_enabledModel( false, NULL, tr( "Effects enabled" ) )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
effectChain::~effectChain()
|
||||
EffectChain::~EffectChain()
|
||||
{
|
||||
clear();
|
||||
}
|
||||
@@ -52,23 +52,23 @@ effectChain::~effectChain()
|
||||
|
||||
|
||||
|
||||
void effectChain::saveSettings( QDomDocument & _doc, QDomElement & _this )
|
||||
void EffectChain::saveSettings( QDomDocument & _doc, QDomElement & _this )
|
||||
{
|
||||
_this.setAttribute( "enabled", m_enabledModel.value() );
|
||||
_this.setAttribute( "numofeffects", m_effects.count() );
|
||||
for( effectList::iterator it = m_effects.begin();
|
||||
for( EffectList::Iterator it = m_effects.begin();
|
||||
it != m_effects.end(); it++ )
|
||||
{
|
||||
QDomElement ef = ( *it )->saveState( _doc, _this );
|
||||
ef.setAttribute( "name", ( *it )->getDescriptor()->name );
|
||||
ef.appendChild( ( *it )->getKey().saveXML( _doc ) );
|
||||
ef.setAttribute( "name", ( *it )->descriptor()->name );
|
||||
ef.appendChild( ( *it )->key().saveXML( _doc ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void effectChain::loadSettings( const QDomElement & _this )
|
||||
void EffectChain::loadSettings( const QDomElement & _this )
|
||||
{
|
||||
clear();
|
||||
|
||||
@@ -84,23 +84,23 @@ void effectChain::loadSettings( const QDomElement & _this )
|
||||
{
|
||||
QDomElement cn = node.toElement();
|
||||
const QString name = cn.attribute( "name" );
|
||||
effectKey key( cn.elementsByTagName( "key" ).
|
||||
EffectKey key( cn.elementsByTagName( "key" ).
|
||||
item( 0 ).toElement() );
|
||||
effect * e = effect::instantiate( name, this, &key );
|
||||
Effect * e = Effect::instantiate( name, this, &key );
|
||||
if( e->isOkay() )
|
||||
{
|
||||
if( node.isElement() )
|
||||
{
|
||||
if( e->nodeName() == node.nodeName() )
|
||||
{
|
||||
e->restoreState( node.toElement() );
|
||||
e->restoreState( node.toElement() );
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
delete e;
|
||||
e = new dummyEffect( parentModel() );
|
||||
e = new DummyEffect( parentModel() );
|
||||
}
|
||||
m_effects.push_back( e );
|
||||
++fx_loaded;
|
||||
@@ -114,7 +114,7 @@ void effectChain::loadSettings( const QDomElement & _this )
|
||||
|
||||
|
||||
|
||||
void effectChain::appendEffect( effect * _effect )
|
||||
void EffectChain::appendEffect( Effect * _effect )
|
||||
{
|
||||
engine::getMixer()->lock();
|
||||
m_effects.append( _effect );
|
||||
@@ -126,7 +126,7 @@ void effectChain::appendEffect( effect * _effect )
|
||||
|
||||
|
||||
|
||||
void effectChain::removeEffect( effect * _effect )
|
||||
void EffectChain::removeEffect( Effect * _effect )
|
||||
{
|
||||
engine::getMixer()->lock();
|
||||
m_effects.erase( qFind( m_effects.begin(), m_effects.end(), _effect ) );
|
||||
@@ -136,12 +136,12 @@ void effectChain::removeEffect( effect * _effect )
|
||||
|
||||
|
||||
|
||||
void effectChain::moveDown( effect * _effect )
|
||||
void EffectChain::moveDown( Effect * _effect )
|
||||
{
|
||||
if( _effect != m_effects.last() )
|
||||
{
|
||||
int i = 0;
|
||||
for( effectList::iterator it = m_effects.begin();
|
||||
for( EffectList::Iterator it = m_effects.begin();
|
||||
it != m_effects.end(); it++, i++ )
|
||||
{
|
||||
if( *it == _effect )
|
||||
@@ -150,7 +150,7 @@ void effectChain::moveDown( effect * _effect )
|
||||
}
|
||||
}
|
||||
|
||||
effect * temp = m_effects[i + 1];
|
||||
Effect * temp = m_effects[i + 1];
|
||||
m_effects[i + 1] = _effect;
|
||||
m_effects[i] = temp;
|
||||
}
|
||||
@@ -159,12 +159,12 @@ void effectChain::moveDown( effect * _effect )
|
||||
|
||||
|
||||
|
||||
void effectChain::moveUp( effect * _effect )
|
||||
void EffectChain::moveUp( Effect * _effect )
|
||||
{
|
||||
if( _effect != m_effects.first() )
|
||||
{
|
||||
int i = 0;
|
||||
for( effectList::iterator it = m_effects.begin();
|
||||
for( EffectList::Iterator it = m_effects.begin();
|
||||
it != m_effects.end(); it++, i++ )
|
||||
{
|
||||
if( *it == _effect )
|
||||
@@ -173,7 +173,7 @@ void effectChain::moveUp( effect * _effect )
|
||||
}
|
||||
}
|
||||
|
||||
effect * temp = m_effects[i - 1];
|
||||
Effect * temp = m_effects[i - 1];
|
||||
m_effects[i - 1] = _effect;
|
||||
m_effects[i] = temp;
|
||||
}
|
||||
@@ -182,17 +182,17 @@ void effectChain::moveUp( effect * _effect )
|
||||
|
||||
|
||||
|
||||
bool effectChain::processAudioBuffer( sampleFrame * _buf, const fpp_t _frames )
|
||||
bool EffectChain::processAudioBuffer( sampleFrame * _buf, const fpp_t _frames )
|
||||
{
|
||||
if( m_enabledModel.value() == FALSE )
|
||||
if( m_enabledModel.value() == false )
|
||||
{
|
||||
return( FALSE );
|
||||
return false;
|
||||
}
|
||||
bool more_effects = FALSE;
|
||||
for( effectList::iterator it = m_effects.begin();
|
||||
bool moreEffects = false;
|
||||
for( EffectList::Iterator it = m_effects.begin();
|
||||
it != m_effects.end(); ++it )
|
||||
{
|
||||
more_effects |= ( *it )->processAudioBuffer( _buf, _frames );
|
||||
moreEffects |= ( *it )->processAudioBuffer( _buf, _frames );
|
||||
#ifdef LMMS_DEBUG
|
||||
for( int f = 0; f < _frames; ++f )
|
||||
{
|
||||
@@ -207,20 +207,20 @@ bool effectChain::processAudioBuffer( sampleFrame * _buf, const fpp_t _frames )
|
||||
}
|
||||
#endif
|
||||
}
|
||||
return( more_effects );
|
||||
return moreEffects;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void effectChain::startRunning( void )
|
||||
void EffectChain::startRunning()
|
||||
{
|
||||
if( m_enabledModel.value() == FALSE )
|
||||
if( m_enabledModel.value() == false )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for( effectList::iterator it = m_effects.begin();
|
||||
for( EffectList::Iterator it = m_effects.begin();
|
||||
it != m_effects.end(); it++ )
|
||||
{
|
||||
( *it )->startRunning();
|
||||
@@ -230,27 +230,27 @@ void effectChain::startRunning( void )
|
||||
|
||||
|
||||
|
||||
bool effectChain::isRunning( void )
|
||||
bool EffectChain::isRunning()
|
||||
{
|
||||
if( m_enabledModel.value() == FALSE )
|
||||
if( m_enabledModel.value() == false )
|
||||
{
|
||||
return( FALSE );
|
||||
return false;
|
||||
}
|
||||
|
||||
bool running = FALSE;
|
||||
bool running = false;
|
||||
|
||||
for( effectList::iterator it = m_effects.begin();
|
||||
for( EffectList::Iterator it = m_effects.begin();
|
||||
it != m_effects.end() || !running; it++ )
|
||||
{
|
||||
running = ( *it )->isRunning() && running;
|
||||
}
|
||||
return( running );
|
||||
return running;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void effectChain::clear( void )
|
||||
void EffectChain::clear()
|
||||
{
|
||||
emit aboutToClear();
|
||||
|
||||
@@ -264,5 +264,5 @@ void effectChain::clear( void )
|
||||
|
||||
|
||||
|
||||
#include "moc_effect_chain.cxx"
|
||||
#include "moc_EffectChain.cxx"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* envelope_and_lfo_parameters.cpp - class envelopeAndLFOParameters
|
||||
* EnvelopeAndLfoParameters.cpp - class EnvelopeAndLfoParameters
|
||||
*
|
||||
* Copyright (c) 2004-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
@@ -22,18 +22,14 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "envelope_and_lfo_parameters.h"
|
||||
|
||||
|
||||
#include <QtXml/QDomElement>
|
||||
|
||||
#include "EnvelopeAndLfoParameters.h"
|
||||
#include "debug.h"
|
||||
#include "engine.h"
|
||||
#include "mixer.h"
|
||||
#include "mmp.h"
|
||||
#include "oscillator.h"
|
||||
|
||||
#include "Oscillator.h"
|
||||
|
||||
|
||||
// how long should be each envelope-segment maximal (e.g. attack)?
|
||||
@@ -42,14 +38,14 @@ extern const float SECS_PER_ENV_SEGMENT = 5.0f;
|
||||
extern const float SECS_PER_LFO_OSCILLATION = 20.0f;
|
||||
|
||||
|
||||
QVector<envelopeAndLFOParameters *> envelopeAndLFOParameters::s_EaLParametersInstances;
|
||||
QVector<EnvelopeAndLfoParameters *> EnvelopeAndLfoParameters::s_EaLParametersInstances;
|
||||
|
||||
|
||||
|
||||
envelopeAndLFOParameters::envelopeAndLFOParameters(
|
||||
EnvelopeAndLfoParameters::EnvelopeAndLfoParameters(
|
||||
float _value_for_zero_amount,
|
||||
model * _parent ) :
|
||||
model( _parent ),
|
||||
Model * _parent ) :
|
||||
Model( _parent ),
|
||||
m_used( false ),
|
||||
m_predelayModel( 0.0, 0.0, 1.0, 0.001, this, tr( "Predelay" ) ),
|
||||
m_attackModel( 0.0, 0.0, 1.0, 0.001, this, tr( "Attack" ) ),
|
||||
@@ -61,16 +57,13 @@ envelopeAndLFOParameters::envelopeAndLFOParameters(
|
||||
m_valueForZeroAmount( _value_for_zero_amount ),
|
||||
m_pahdEnv( NULL ),
|
||||
m_rEnv( NULL ),
|
||||
m_lfoPredelayModel( 0.0, 0.0, 1.0, 0.001, this,
|
||||
tr( "LFO Predelay" ) ),
|
||||
m_lfoPredelayModel( 0.0, 0.0, 1.0, 0.001, this, tr( "LFO Predelay" ) ),
|
||||
m_lfoAttackModel( 0.0, 0.0, 1.0, 0.001, this, tr( "LFO Attack" ) ),
|
||||
m_lfoSpeedModel( 0.1, 0.001, 1.0, 0.0001,
|
||||
SECS_PER_LFO_OSCILLATION * 1000.0, this,
|
||||
tr( "LFO speed" ) ),
|
||||
m_lfoAmountModel( 0.0, -1.0, 1.0, 0.005, this,
|
||||
tr( "LFO Modulation" ) ),
|
||||
m_lfoWaveModel( SineWave, 0, NumLfoShapes, this,
|
||||
tr( "LFO Wave Shape" ) ),
|
||||
m_lfoAmountModel( 0.0, -1.0, 1.0, 0.005, this, tr( "LFO Modulation" ) ),
|
||||
m_lfoWaveModel( SineWave, 0, NumLfoShapes, this, tr( "LFO Wave Shape" ) ),
|
||||
m_x100Model( false, this, tr( "Freq x 100" ) ),
|
||||
m_controlEnvAmountModel( false, this, tr( "Modulate Env-Amount" ) ),
|
||||
m_lfoFrame( 0 ),
|
||||
@@ -120,7 +113,7 @@ envelopeAndLFOParameters::envelopeAndLFOParameters(
|
||||
|
||||
|
||||
|
||||
envelopeAndLFOParameters::~envelopeAndLFOParameters()
|
||||
EnvelopeAndLfoParameters::~EnvelopeAndLfoParameters()
|
||||
{
|
||||
m_predelayModel.disconnect( this );
|
||||
m_attackModel.disconnect( this );
|
||||
@@ -140,7 +133,7 @@ envelopeAndLFOParameters::~envelopeAndLFOParameters()
|
||||
delete[] m_rEnv;
|
||||
delete[] m_lfoShapeData;
|
||||
|
||||
QVector<envelopeAndLFOParameters *> & v = s_EaLParametersInstances;
|
||||
QVector<EnvelopeAndLfoParameters *> & v = s_EaLParametersInstances;
|
||||
if( qFind( v.begin(), v.end(), this ) != v.end() )
|
||||
{
|
||||
v.erase( qFind( v.begin(), v.end(), this ) );
|
||||
@@ -150,7 +143,7 @@ envelopeAndLFOParameters::~envelopeAndLFOParameters()
|
||||
|
||||
|
||||
|
||||
inline sample_t envelopeAndLFOParameters::lfoShapeSample( fpp_t _frame_offset )
|
||||
inline sample_t EnvelopeAndLfoParameters::lfoShapeSample( fpp_t _frame_offset )
|
||||
{
|
||||
f_cnt_t frame = ( m_lfoFrame + _frame_offset ) % m_lfoOscillationFrames;
|
||||
const float phase = frame / static_cast<float>(
|
||||
@@ -159,29 +152,29 @@ inline sample_t envelopeAndLFOParameters::lfoShapeSample( fpp_t _frame_offset )
|
||||
switch( m_lfoWaveModel.value() )
|
||||
{
|
||||
case TriangleWave:
|
||||
shape_sample = oscillator::triangleSample( phase );
|
||||
shape_sample = Oscillator::triangleSample( phase );
|
||||
break;
|
||||
case SquareWave:
|
||||
shape_sample = oscillator::squareSample( phase );
|
||||
shape_sample = Oscillator::squareSample( phase );
|
||||
break;
|
||||
case SawWave:
|
||||
shape_sample = oscillator::sawSample( phase );
|
||||
shape_sample = Oscillator::sawSample( phase );
|
||||
break;
|
||||
case UserDefinedWave:
|
||||
shape_sample = m_userWave.userWaveSample( phase );
|
||||
break;
|
||||
case SineWave:
|
||||
default:
|
||||
shape_sample = oscillator::sinSample( phase );
|
||||
shape_sample = Oscillator::sinSample( phase );
|
||||
break;
|
||||
}
|
||||
return( shape_sample * m_lfoAmount );
|
||||
return shape_sample * m_lfoAmount;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void envelopeAndLFOParameters::updateLFOShapeData( void )
|
||||
void EnvelopeAndLfoParameters::updateLfoShapeData()
|
||||
{
|
||||
const fpp_t frames = engine::getMixer()->framesPerPeriod();
|
||||
for( fpp_t offset = 0; offset < frames; ++offset )
|
||||
@@ -194,10 +187,10 @@ void envelopeAndLFOParameters::updateLFOShapeData( void )
|
||||
|
||||
|
||||
|
||||
void envelopeAndLFOParameters::triggerLFO( void )
|
||||
void EnvelopeAndLfoParameters::triggerLfo()
|
||||
{
|
||||
QVector<envelopeAndLFOParameters *> & v = s_EaLParametersInstances;
|
||||
for( QVector<envelopeAndLFOParameters *>::iterator it = v.begin();
|
||||
QVector<EnvelopeAndLfoParameters *> & v = s_EaLParametersInstances;
|
||||
for( QVector<EnvelopeAndLfoParameters *>::iterator it = v.begin();
|
||||
it != v.end(); ++it )
|
||||
{
|
||||
( *it )->m_lfoFrame +=
|
||||
@@ -209,10 +202,10 @@ void envelopeAndLFOParameters::triggerLFO( void )
|
||||
|
||||
|
||||
|
||||
void envelopeAndLFOParameters::resetLFO( void )
|
||||
void EnvelopeAndLfoParameters::resetLfo()
|
||||
{
|
||||
QVector<envelopeAndLFOParameters *> & v = s_EaLParametersInstances;
|
||||
for( QVector<envelopeAndLFOParameters *>::iterator it = v.begin();
|
||||
QVector<EnvelopeAndLfoParameters *> & v = s_EaLParametersInstances;
|
||||
for( QVector<EnvelopeAndLfoParameters *>::iterator it = v.begin();
|
||||
it != v.end(); ++it )
|
||||
{
|
||||
( *it )->m_lfoFrame = 0;
|
||||
@@ -223,7 +216,7 @@ void envelopeAndLFOParameters::resetLFO( void )
|
||||
|
||||
|
||||
|
||||
inline void envelopeAndLFOParameters::fillLFOLevel( float * _buf,
|
||||
inline void EnvelopeAndLfoParameters::fillLfoLevel( float * _buf,
|
||||
f_cnt_t _frame,
|
||||
const fpp_t _frames )
|
||||
{
|
||||
@@ -239,7 +232,7 @@ inline void envelopeAndLFOParameters::fillLFOLevel( float * _buf,
|
||||
|
||||
if( m_bad_lfoShapeData )
|
||||
{
|
||||
updateLFOShapeData();
|
||||
updateLfoShapeData();
|
||||
}
|
||||
|
||||
fpp_t offset = 0;
|
||||
@@ -258,7 +251,7 @@ inline void envelopeAndLFOParameters::fillLFOLevel( float * _buf,
|
||||
|
||||
|
||||
|
||||
void envelopeAndLFOParameters::fillLevel( float * _buf, f_cnt_t _frame,
|
||||
void EnvelopeAndLfoParameters::fillLevel( float * _buf, f_cnt_t _frame,
|
||||
const f_cnt_t _release_begin,
|
||||
const fpp_t _frames )
|
||||
{
|
||||
@@ -267,7 +260,7 @@ void envelopeAndLFOParameters::fillLevel( float * _buf, f_cnt_t _frame,
|
||||
return;
|
||||
}
|
||||
|
||||
fillLFOLevel( _buf, _frame, _frames );
|
||||
fillLfoLevel( _buf, _frame, _frames );
|
||||
|
||||
for( fpp_t offset = 0; offset < _frames; ++offset, ++_buf, ++_frame )
|
||||
{
|
||||
@@ -304,7 +297,7 @@ void envelopeAndLFOParameters::fillLevel( float * _buf, f_cnt_t _frame,
|
||||
|
||||
|
||||
|
||||
void envelopeAndLFOParameters::saveSettings( QDomDocument & _doc,
|
||||
void EnvelopeAndLfoParameters::saveSettings( QDomDocument & _doc,
|
||||
QDomElement & _parent )
|
||||
{
|
||||
m_predelayModel.saveSettings( _doc, _parent, "pdel" );
|
||||
@@ -327,7 +320,7 @@ void envelopeAndLFOParameters::saveSettings( QDomDocument & _doc,
|
||||
|
||||
|
||||
|
||||
void envelopeAndLFOParameters::loadSettings( const QDomElement & _this )
|
||||
void EnvelopeAndLfoParameters::loadSettings( const QDomElement & _this )
|
||||
{
|
||||
m_predelayModel.loadSettings( _this, "pdel" );
|
||||
m_attackModel.loadSettings( _this, "att" );
|
||||
@@ -349,7 +342,7 @@ void envelopeAndLFOParameters::loadSettings( const QDomElement & _this )
|
||||
if( _this.hasAttribute( "lfosyncmode" ) )
|
||||
{
|
||||
m_lfoSpeedKnob->setSyncMode(
|
||||
( tempoSyncKnob::tempoSyncMode ) _this.attribute(
|
||||
( TempoSyncKnob::TtempoSyncMode ) _this.attribute(
|
||||
"lfosyncmode" ).toInt() );
|
||||
}*/
|
||||
|
||||
@@ -361,7 +354,7 @@ void envelopeAndLFOParameters::loadSettings( const QDomElement & _this )
|
||||
|
||||
|
||||
|
||||
void envelopeAndLFOParameters::updateSampleVars( void )
|
||||
void EnvelopeAndLfoParameters::updateSampleVars()
|
||||
{
|
||||
engine::getMixer()->lock();
|
||||
|
||||
@@ -494,6 +487,6 @@ void envelopeAndLFOParameters::updateSampleVars( void )
|
||||
|
||||
|
||||
|
||||
#include "moc_envelope_and_lfo_parameters.cxx"
|
||||
#include "moc_EnvelopeAndLfoParameters.cxx"
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef SINGLE_SOURCE_COMPILE
|
||||
|
||||
/*
|
||||
* fx_mixer.cpp - effect-mixer for LMMS
|
||||
* FxMixer.cpp - effect mixer for LMMS
|
||||
*
|
||||
* Copyright (c) 2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
@@ -27,12 +27,12 @@
|
||||
|
||||
#include <QtXml/QDomElement>
|
||||
|
||||
#include "fx_mixer.h"
|
||||
#include "effect.h"
|
||||
#include "FxMixer.h"
|
||||
#include "Effect.h"
|
||||
#include "song.h"
|
||||
|
||||
|
||||
fxChannel::fxChannel( model * _parent ) :
|
||||
FxChannel::FxChannel( Model * _parent ) :
|
||||
m_fxChain( NULL ),
|
||||
m_used( false ),
|
||||
m_stillRunning( false ),
|
||||
@@ -51,7 +51,7 @@ fxChannel::fxChannel( model * _parent ) :
|
||||
|
||||
|
||||
|
||||
fxChannel::~fxChannel()
|
||||
FxChannel::~FxChannel()
|
||||
{
|
||||
delete[] m_buffer;
|
||||
}
|
||||
@@ -61,13 +61,13 @@ fxChannel::~fxChannel()
|
||||
|
||||
|
||||
|
||||
fxMixer::fxMixer() :
|
||||
journallingObject(),
|
||||
model( NULL )
|
||||
FxMixer::FxMixer() :
|
||||
JournallingObject(),
|
||||
Model( NULL )
|
||||
{
|
||||
for( int i = 0; i < NumFxChannels+1; ++i )
|
||||
{
|
||||
m_fxChannels[i] = new fxChannel( this );
|
||||
m_fxChannels[i] = new FxChannel( this );
|
||||
}
|
||||
// reset name etc.
|
||||
clear();
|
||||
@@ -76,7 +76,7 @@ fxMixer::fxMixer() :
|
||||
|
||||
|
||||
|
||||
fxMixer::~fxMixer()
|
||||
FxMixer::~FxMixer()
|
||||
{
|
||||
for( int i = 0; i < NumFxChannels+1; ++i )
|
||||
{
|
||||
@@ -87,7 +87,7 @@ fxMixer::~fxMixer()
|
||||
|
||||
|
||||
|
||||
void fxMixer::mixToChannel( const sampleFrame * _buf, fx_ch_t _ch )
|
||||
void FxMixer::mixToChannel( const sampleFrame * _buf, fx_ch_t _ch )
|
||||
{
|
||||
if( m_fxChannels[_ch]->m_muteModel.value() == false )
|
||||
{
|
||||
@@ -107,7 +107,7 @@ void fxMixer::mixToChannel( const sampleFrame * _buf, fx_ch_t _ch )
|
||||
|
||||
|
||||
|
||||
void fxMixer::processChannel( fx_ch_t _ch, sampleFrame * _buf )
|
||||
void FxMixer::processChannel( fx_ch_t _ch, sampleFrame * _buf )
|
||||
{
|
||||
if( m_fxChannels[_ch]->m_muteModel.value() == false &&
|
||||
( m_fxChannels[_ch]->m_used ||
|
||||
@@ -141,7 +141,7 @@ void fxMixer::processChannel( fx_ch_t _ch, sampleFrame * _buf )
|
||||
|
||||
|
||||
|
||||
void fxMixer::prepareMasterMix( void )
|
||||
void FxMixer::prepareMasterMix( void )
|
||||
{
|
||||
engine::getMixer()->clearAudioBuffer( m_fxChannels[0]->m_buffer,
|
||||
engine::getMixer()->framesPerPeriod() );
|
||||
@@ -150,7 +150,7 @@ void fxMixer::prepareMasterMix( void )
|
||||
|
||||
|
||||
|
||||
void fxMixer::masterMix( sampleFrame * _buf )
|
||||
void FxMixer::masterMix( sampleFrame * _buf )
|
||||
{
|
||||
const int fpp = engine::getMixer()->framesPerPeriod();
|
||||
memcpy( _buf, m_fxChannels[0]->m_buffer, sizeof( sampleFrame ) * fpp );
|
||||
@@ -195,7 +195,7 @@ void fxMixer::masterMix( sampleFrame * _buf )
|
||||
|
||||
|
||||
|
||||
void fxMixer::clear()
|
||||
void FxMixer::clear()
|
||||
{
|
||||
for( int i = 0; i <= NumFxChannels; ++i )
|
||||
{
|
||||
@@ -213,7 +213,7 @@ void fxMixer::clear()
|
||||
|
||||
|
||||
|
||||
void fxMixer::saveSettings( QDomDocument & _doc, QDomElement & _this )
|
||||
void FxMixer::saveSettings( QDomDocument & _doc, QDomElement & _this )
|
||||
{
|
||||
for( int i = 0; i <= NumFxChannels; ++i )
|
||||
{
|
||||
@@ -232,7 +232,7 @@ void fxMixer::saveSettings( QDomDocument & _doc, QDomElement & _this )
|
||||
|
||||
|
||||
|
||||
void fxMixer::loadSettings( const QDomElement & _this )
|
||||
void FxMixer::loadSettings( const QDomElement & _this )
|
||||
{
|
||||
clear();
|
||||
QDomNode node = _this.firstChild();
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* import_filter.cpp - base-class for all import-filters (MIDI, FLP etc)
|
||||
* ImportFilter.cpp - base-class for all import-filters (MIDI, FLP etc)
|
||||
*
|
||||
* Copyright (c) 2006-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
@@ -25,16 +25,16 @@
|
||||
|
||||
#include <QtGui/QMessageBox>
|
||||
|
||||
#include "import_filter.h"
|
||||
#include "ImportFilter.h"
|
||||
#include "engine.h"
|
||||
#include "track_container.h"
|
||||
#include "project_journal.h"
|
||||
#include "ProjectJournal.h"
|
||||
|
||||
|
||||
|
||||
importFilter::importFilter( const QString & _file_name,
|
||||
const descriptor * _descriptor ) :
|
||||
plugin( _descriptor, NULL ),
|
||||
ImportFilter::ImportFilter( const QString & _file_name,
|
||||
const Descriptor * _descriptor ) :
|
||||
Plugin( _descriptor, NULL ),
|
||||
m_file( _file_name )
|
||||
{
|
||||
}
|
||||
@@ -42,50 +42,50 @@ importFilter::importFilter( const QString & _file_name,
|
||||
|
||||
|
||||
|
||||
importFilter::~importFilter()
|
||||
ImportFilter::~ImportFilter()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void importFilter::import( const QString & _file_to_import,
|
||||
trackContainer * _tc )
|
||||
void ImportFilter::import( const QString & _file_to_import,
|
||||
trackContainer * _tc )
|
||||
{
|
||||
QVector<descriptor> d;
|
||||
plugin::getDescriptorsOfAvailPlugins( d );
|
||||
QVector<Descriptor> d;
|
||||
Plugin::getDescriptorsOfAvailPlugins( d );
|
||||
|
||||
bool successful = FALSE;
|
||||
bool successful = false;
|
||||
|
||||
char * s = qstrdup( _file_to_import.toUtf8().constData() );
|
||||
|
||||
// do not record changes while importing files
|
||||
const bool j = engine::getProjectJournal()->isJournalling();
|
||||
engine::getProjectJournal()->setJournalling( FALSE );
|
||||
const bool j = engine::projectJournal()->isJournalling();
|
||||
engine::projectJournal()->setJournalling( false );
|
||||
|
||||
for( QVector<plugin::descriptor>::iterator it = d.begin();
|
||||
for( QVector<Plugin::Descriptor>::Iterator it = d.begin();
|
||||
it != d.end(); ++it )
|
||||
{
|
||||
if( it->type == plugin::ImportFilter )
|
||||
if( it->type == Plugin::ImportFilter )
|
||||
{
|
||||
plugin * p = plugin::instantiate( it->name, NULL, s );
|
||||
if( dynamic_cast<importFilter *>( p ) != NULL &&
|
||||
dynamic_cast<importFilter *>( p )->tryImport(
|
||||
_tc ) == TRUE )
|
||||
Plugin * p = Plugin::instantiate( it->name, NULL, s );
|
||||
if( dynamic_cast<ImportFilter *>( p ) != NULL &&
|
||||
dynamic_cast<ImportFilter *>( p )->tryImport(
|
||||
_tc ) == true )
|
||||
{
|
||||
delete p;
|
||||
successful = TRUE;
|
||||
successful = true;
|
||||
break;
|
||||
}
|
||||
delete p;
|
||||
}
|
||||
}
|
||||
|
||||
engine::getProjectJournal()->setJournalling( j );
|
||||
engine::projectJournal()->setJournalling( j );
|
||||
|
||||
delete[] s;
|
||||
|
||||
if( successful == FALSE )
|
||||
if( successful == false )
|
||||
{
|
||||
QMessageBox::information( NULL,
|
||||
trackContainer::tr( "Couldn't import file" ),
|
||||
@@ -103,9 +103,9 @@ void importFilter::import( const QString & _file_to_import,
|
||||
|
||||
|
||||
|
||||
bool importFilter::openFile( void )
|
||||
bool ImportFilter::openFile()
|
||||
{
|
||||
if( m_file.open( QFile::ReadOnly ) == FALSE )
|
||||
if( m_file.open( QFile::ReadOnly ) == false )
|
||||
{
|
||||
QMessageBox::critical( NULL,
|
||||
trackContainer::tr( "Couldn't open file" ),
|
||||
@@ -118,9 +118,9 @@ bool importFilter::openFile( void )
|
||||
m_file.fileName() ),
|
||||
QMessageBox::Ok,
|
||||
QMessageBox::NoButton );
|
||||
return( FALSE );
|
||||
return false;
|
||||
}
|
||||
return( TRUE );
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
128
src/core/Instrument.cpp
Normal file
128
src/core/Instrument.cpp
Normal file
@@ -0,0 +1,128 @@
|
||||
/*
|
||||
* Instrument.cpp - base-class for all instrument-plugins (synths, samplers etc)
|
||||
*
|
||||
* Copyright (c) 2005-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public
|
||||
* License along with this program (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "Instrument.h"
|
||||
#include "InstrumentTrack.h"
|
||||
#include "DummyInstrument.h"
|
||||
#include "note_play_handle.h"
|
||||
#include "embed.h"
|
||||
|
||||
|
||||
Instrument::Instrument( InstrumentTrack * _instrument_track,
|
||||
const Descriptor * _descriptor ) :
|
||||
Plugin( _descriptor, NULL/* _instrument_track*/ ),
|
||||
m_instrumentTrack( _instrument_track )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Instrument::~Instrument()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void Instrument::play( sampleFrame * )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void Instrument::deleteNotePluginData( notePlayHandle * )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
f_cnt_t Instrument::beatLen( notePlayHandle * ) const
|
||||
{
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Instrument * Instrument::instantiate( const QString & _plugin_name,
|
||||
InstrumentTrack * _instrument_track )
|
||||
{
|
||||
Plugin * p = Plugin::instantiate( _plugin_name, _instrument_track,
|
||||
_instrument_track );
|
||||
// check whether instantiated plugin is an instrument
|
||||
if( dynamic_cast<Instrument *>( p ) != NULL )
|
||||
{
|
||||
// everything ok, so return pointer
|
||||
return dynamic_cast<Instrument *>( p );
|
||||
}
|
||||
|
||||
// not quite... so delete plugin and return dummy instrument
|
||||
delete p;
|
||||
return( new DummyInstrument( _instrument_track ) );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
bool Instrument::isFromTrack( const track * _track ) const
|
||||
{
|
||||
return( m_instrumentTrack == _track );
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Instrument::applyRelease( sampleFrame * buf, const notePlayHandle * _n )
|
||||
{
|
||||
const fpp_t frames = _n->framesLeftForCurrentPeriod();
|
||||
const fpp_t fpp = engine::getMixer()->framesPerPeriod();
|
||||
const f_cnt_t fl = _n->framesLeft();
|
||||
if( fl <= desiredReleaseFrames()+fpp )
|
||||
{
|
||||
for( fpp_t f = (fpp_t)( ( fl > desiredReleaseFrames() ) ?
|
||||
( qMax( fpp - desiredReleaseFrames(), 0 ) +
|
||||
fl % fpp ) : 0 ); f < frames; ++f )
|
||||
{
|
||||
const float fac = (float)( fl-f-1 ) /
|
||||
desiredReleaseFrames();
|
||||
for( ch_cnt_t ch = 0; ch < DEFAULT_CHANNELS; ++ch )
|
||||
{
|
||||
buf[f][ch] *= fac;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
QString Instrument::fullDisplayName() const
|
||||
{
|
||||
return instrumentTrack()->displayName();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
#ifndef SINGLE_SOURCE_COMPILE
|
||||
|
||||
/*
|
||||
* instrument_functions.cpp - models for instrument-function-tab
|
||||
* InstrumentFunctions.cpp - models for instrument-function-tab
|
||||
*
|
||||
* Copyright (c) 2004-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
@@ -24,125 +22,123 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include <QtXml/QDomElement>
|
||||
|
||||
|
||||
#include "instrument_functions.h"
|
||||
#include "InstrumentFunctions.h"
|
||||
#include "embed.h"
|
||||
#include "engine.h"
|
||||
#include "instrument_track.h"
|
||||
#include "InstrumentTrack.h"
|
||||
#include "note_play_handle.h"
|
||||
#include "preset_preview_play_handle.h"
|
||||
|
||||
|
||||
|
||||
chordCreator::chord chordCreator::s_chordTable[] =
|
||||
ChordCreator::Chord ChordCreator::s_chordTable[] =
|
||||
{
|
||||
{ chordCreator::tr( "octave" ), { 0, -1 } },
|
||||
{ chordCreator::tr( "Major" ), { 0, 4, 7, -1 } },
|
||||
{ chordCreator::tr( "Majb5" ), { 0, 4, 6, -1 } },
|
||||
{ chordCreator::tr( "minor" ), { 0, 3, 7, -1 } },
|
||||
{ chordCreator::tr( "minb5" ), { 0, 3, 6, -1 } },
|
||||
{ chordCreator::tr( "sus2" ), { 0, 2, 7, -1 } },
|
||||
{ chordCreator::tr( "sus4" ), { 0, 5, 7, -1 } },
|
||||
{ chordCreator::tr( "aug" ), { 0, 4, 8, -1 } },
|
||||
{ chordCreator::tr( "augsus4" ), { 0, 5, 8, -1 } },
|
||||
{ chordCreator::tr( "tri" ), { 0, 3, 6, 9, -1 } },
|
||||
{ ChordCreator::tr( "octave" ), { 0, -1 } },
|
||||
{ ChordCreator::tr( "Major" ), { 0, 4, 7, -1 } },
|
||||
{ ChordCreator::tr( "Majb5" ), { 0, 4, 6, -1 } },
|
||||
{ ChordCreator::tr( "minor" ), { 0, 3, 7, -1 } },
|
||||
{ ChordCreator::tr( "minb5" ), { 0, 3, 6, -1 } },
|
||||
{ ChordCreator::tr( "sus2" ), { 0, 2, 7, -1 } },
|
||||
{ ChordCreator::tr( "sus4" ), { 0, 5, 7, -1 } },
|
||||
{ ChordCreator::tr( "aug" ), { 0, 4, 8, -1 } },
|
||||
{ ChordCreator::tr( "augsus4" ), { 0, 5, 8, -1 } },
|
||||
{ ChordCreator::tr( "tri" ), { 0, 3, 6, 9, -1 } },
|
||||
|
||||
{ chordCreator::tr( "6" ), { 0, 4, 7, 9, -1 } },
|
||||
{ chordCreator::tr( "6sus4" ), { 0, 5, 7, 9, -1 } },
|
||||
{ chordCreator::tr( "6add9" ), { 0, 4, 7, 12, -1 } },
|
||||
{ chordCreator::tr( "m6" ), { 0, 3, 7, 9, -1 } },
|
||||
{ chordCreator::tr( "m6add9" ), { 0, 3, 7, 9, 14, -1 } },
|
||||
{ ChordCreator::tr( "6" ), { 0, 4, 7, 9, -1 } },
|
||||
{ ChordCreator::tr( "6sus4" ), { 0, 5, 7, 9, -1 } },
|
||||
{ ChordCreator::tr( "6add9" ), { 0, 4, 7, 12, -1 } },
|
||||
{ ChordCreator::tr( "m6" ), { 0, 3, 7, 9, -1 } },
|
||||
{ ChordCreator::tr( "m6add9" ), { 0, 3, 7, 9, 14, -1 } },
|
||||
|
||||
{ chordCreator::tr( "7" ), { 0, 4, 7, 10, -1 } },
|
||||
{ chordCreator::tr( "7sus4" ), { 0, 5, 7, 10, -1 } },
|
||||
{ chordCreator::tr( "7#5" ), { 0, 4, 8, 10, -1 } },
|
||||
{ chordCreator::tr( "7b5" ), { 0, 4, 6, 10, -1 } },
|
||||
{ chordCreator::tr( "7#9" ), { 0, 4, 7, 10, 13, 18, -1 } },
|
||||
{ chordCreator::tr( "7b9" ), { 0, 4, 7, 10, 13, 16, -1 } },
|
||||
{ chordCreator::tr( "7#5#9" ), { 0, 4, 8, 12, 14, 19, -1 } },
|
||||
{ chordCreator::tr( "7#5b9" ), { 0, 4, 8, 12, 14, 17, -1 } },
|
||||
{ chordCreator::tr( "7b5b9" ), { 0, 4, 6, 10, 12, 15, -1 } },
|
||||
{ chordCreator::tr( "7add11" ), { 0, 4, 7, 10, 17, -1 } },
|
||||
{ chordCreator::tr( "7add13" ), { 0, 4, 7, 10, 21, -1 } },
|
||||
{ chordCreator::tr( "7#11" ), { 0, 4, 7, 10, 18, -1 } },
|
||||
{ chordCreator::tr( "Maj7" ), { 0, 4, 7, 11, -1 } },
|
||||
{ chordCreator::tr( "Maj7b5" ), { 0, 4, 6, 11, -1 } },
|
||||
{ chordCreator::tr( "Maj7#5" ), { 0, 4, 8, 11, -1 } },
|
||||
{ chordCreator::tr( "Maj7#11" ), { 0, 4, 7, 11, 18, -1 } },
|
||||
{ chordCreator::tr( "Maj7add13" ), { 0, 4, 7, 11, 21, -1 } },
|
||||
{ chordCreator::tr( "m7" ), { 0, 3, 7, 10, -1 } },
|
||||
{ chordCreator::tr( "m7b5" ), { 0, 3, 6, 10, -1 } },
|
||||
{ chordCreator::tr( "m7b9" ), { 0, 3, 7, 10, 13, -1 } },
|
||||
{ chordCreator::tr( "m7add11" ), { 0, 3, 7, 10, 17, -1 } },
|
||||
{ chordCreator::tr( "m7add13" ), { 0, 3, 7, 10, 21, -1 } },
|
||||
{ chordCreator::tr( "m-Maj7" ), { 0, 3, 7, 11, -1 } },
|
||||
{ chordCreator::tr( "m-Maj7add11" ), { 0, 3, 7, 11, 17, -1 } },
|
||||
{ chordCreator::tr( "m-Maj7add13" ), { 0, 3, 7, 11, 21, -1 } },
|
||||
{ ChordCreator::tr( "7" ), { 0, 4, 7, 10, -1 } },
|
||||
{ ChordCreator::tr( "7sus4" ), { 0, 5, 7, 10, -1 } },
|
||||
{ ChordCreator::tr( "7#5" ), { 0, 4, 8, 10, -1 } },
|
||||
{ ChordCreator::tr( "7b5" ), { 0, 4, 6, 10, -1 } },
|
||||
{ ChordCreator::tr( "7#9" ), { 0, 4, 7, 10, 13, 18, -1 } },
|
||||
{ ChordCreator::tr( "7b9" ), { 0, 4, 7, 10, 13, 16, -1 } },
|
||||
{ ChordCreator::tr( "7#5#9" ), { 0, 4, 8, 12, 14, 19, -1 } },
|
||||
{ ChordCreator::tr( "7#5b9" ), { 0, 4, 8, 12, 14, 17, -1 } },
|
||||
{ ChordCreator::tr( "7b5b9" ), { 0, 4, 6, 10, 12, 15, -1 } },
|
||||
{ ChordCreator::tr( "7add11" ), { 0, 4, 7, 10, 17, -1 } },
|
||||
{ ChordCreator::tr( "7add13" ), { 0, 4, 7, 10, 21, -1 } },
|
||||
{ ChordCreator::tr( "7#11" ), { 0, 4, 7, 10, 18, -1 } },
|
||||
{ ChordCreator::tr( "Maj7" ), { 0, 4, 7, 11, -1 } },
|
||||
{ ChordCreator::tr( "Maj7b5" ), { 0, 4, 6, 11, -1 } },
|
||||
{ ChordCreator::tr( "Maj7#5" ), { 0, 4, 8, 11, -1 } },
|
||||
{ ChordCreator::tr( "Maj7#11" ), { 0, 4, 7, 11, 18, -1 } },
|
||||
{ ChordCreator::tr( "Maj7add13" ), { 0, 4, 7, 11, 21, -1 } },
|
||||
{ ChordCreator::tr( "m7" ), { 0, 3, 7, 10, -1 } },
|
||||
{ ChordCreator::tr( "m7b5" ), { 0, 3, 6, 10, -1 } },
|
||||
{ ChordCreator::tr( "m7b9" ), { 0, 3, 7, 10, 13, -1 } },
|
||||
{ ChordCreator::tr( "m7add11" ), { 0, 3, 7, 10, 17, -1 } },
|
||||
{ ChordCreator::tr( "m7add13" ), { 0, 3, 7, 10, 21, -1 } },
|
||||
{ ChordCreator::tr( "m-Maj7" ), { 0, 3, 7, 11, -1 } },
|
||||
{ ChordCreator::tr( "m-Maj7add11" ), { 0, 3, 7, 11, 17, -1 } },
|
||||
{ ChordCreator::tr( "m-Maj7add13" ), { 0, 3, 7, 11, 21, -1 } },
|
||||
|
||||
{ chordCreator::tr( "9" ), { 0, 4, 7, 10, 14, -1 } },
|
||||
{ chordCreator::tr( "9sus4" ), { 0, 5, 7, 10, 14, -1 } },
|
||||
{ chordCreator::tr( "add9" ), { 0, 4, 7, 14, -1 } },
|
||||
{ chordCreator::tr( "9#5" ), { 0, 4, 8, 10, 14, -1 } },
|
||||
{ chordCreator::tr( "9b5" ), { 0, 4, 6, 10, 14, -1 } },
|
||||
{ chordCreator::tr( "9#11" ), { 0, 4, 7, 10, 14, 18, -1 } },
|
||||
{ chordCreator::tr( "9b13" ), { 0, 4, 7, 10, 14, 20, -1 } },
|
||||
{ chordCreator::tr( "Maj9" ), { 0, 4, 7, 11, 14, -1 } },
|
||||
{ chordCreator::tr( "Maj9sus4" ), { 0, 5, 7, 11, 15, -1 } },
|
||||
{ chordCreator::tr( "Maj9#5" ), { 0, 4, 8, 11, 14, -1 } },
|
||||
{ chordCreator::tr( "Maj9#11" ), { 0, 4, 7, 11, 14, 18, -1 } },
|
||||
{ chordCreator::tr( "m9" ), { 0, 3, 7, 10, 14, -1 } },
|
||||
{ chordCreator::tr( "madd9" ), { 0, 3, 7, 14, -1 } },
|
||||
{ chordCreator::tr( "m9b5" ), { 0, 3, 6, 10, 14, -1 } },
|
||||
{ chordCreator::tr( "m9-Maj7" ), { 0, 3, 7, 11, 14, -1 } },
|
||||
{ ChordCreator::tr( "9" ), { 0, 4, 7, 10, 14, -1 } },
|
||||
{ ChordCreator::tr( "9sus4" ), { 0, 5, 7, 10, 14, -1 } },
|
||||
{ ChordCreator::tr( "add9" ), { 0, 4, 7, 14, -1 } },
|
||||
{ ChordCreator::tr( "9#5" ), { 0, 4, 8, 10, 14, -1 } },
|
||||
{ ChordCreator::tr( "9b5" ), { 0, 4, 6, 10, 14, -1 } },
|
||||
{ ChordCreator::tr( "9#11" ), { 0, 4, 7, 10, 14, 18, -1 } },
|
||||
{ ChordCreator::tr( "9b13" ), { 0, 4, 7, 10, 14, 20, -1 } },
|
||||
{ ChordCreator::tr( "Maj9" ), { 0, 4, 7, 11, 14, -1 } },
|
||||
{ ChordCreator::tr( "Maj9sus4" ), { 0, 5, 7, 11, 15, -1 } },
|
||||
{ ChordCreator::tr( "Maj9#5" ), { 0, 4, 8, 11, 14, -1 } },
|
||||
{ ChordCreator::tr( "Maj9#11" ), { 0, 4, 7, 11, 14, 18, -1 } },
|
||||
{ ChordCreator::tr( "m9" ), { 0, 3, 7, 10, 14, -1 } },
|
||||
{ ChordCreator::tr( "madd9" ), { 0, 3, 7, 14, -1 } },
|
||||
{ ChordCreator::tr( "m9b5" ), { 0, 3, 6, 10, 14, -1 } },
|
||||
{ ChordCreator::tr( "m9-Maj7" ), { 0, 3, 7, 11, 14, -1 } },
|
||||
|
||||
{ chordCreator::tr( "11" ), { 0, 4, 7, 10, 14, 17, -1 } },
|
||||
{ chordCreator::tr( "11b9" ), { 0, 4, 7, 10, 13, 17, -1 } },
|
||||
{ chordCreator::tr( "Maj11" ), { 0, 4, 7, 11, 14, 17, -1 } },
|
||||
{ chordCreator::tr( "m11" ), { 0, 3, 7, 10, 14, 17, -1 } },
|
||||
{ chordCreator::tr( "m-Maj11" ), { 0, 3, 7, 11, 14, 17, -1 } },
|
||||
{ ChordCreator::tr( "11" ), { 0, 4, 7, 10, 14, 17, -1 } },
|
||||
{ ChordCreator::tr( "11b9" ), { 0, 4, 7, 10, 13, 17, -1 } },
|
||||
{ ChordCreator::tr( "Maj11" ), { 0, 4, 7, 11, 14, 17, -1 } },
|
||||
{ ChordCreator::tr( "m11" ), { 0, 3, 7, 10, 14, 17, -1 } },
|
||||
{ ChordCreator::tr( "m-Maj11" ), { 0, 3, 7, 11, 14, 17, -1 } },
|
||||
|
||||
{ chordCreator::tr( "13" ), { 0, 4, 7, 10, 14, 21, -1 } },
|
||||
{ chordCreator::tr( "13#9" ), { 0, 4, 7, 10, 15, 21, -1 } },
|
||||
{ chordCreator::tr( "13b9" ), { 0, 4, 7, 10, 13, 21, -1 } },
|
||||
{ chordCreator::tr( "13b5b9" ), { 0, 4, 6, 10, 13, 21, -1 } },
|
||||
{ chordCreator::tr( "Maj13" ), { 0, 4, 7, 11, 14, 21, -1 } },
|
||||
{ chordCreator::tr( "m13" ), { 0, 3, 7, 10, 14, 21, -1 } },
|
||||
{ chordCreator::tr( "m-Maj13" ), { 0, 3, 7, 11, 14, 21, -1 } },
|
||||
{ ChordCreator::tr( "13" ), { 0, 4, 7, 10, 14, 21, -1 } },
|
||||
{ ChordCreator::tr( "13#9" ), { 0, 4, 7, 10, 15, 21, -1 } },
|
||||
{ ChordCreator::tr( "13b9" ), { 0, 4, 7, 10, 13, 21, -1 } },
|
||||
{ ChordCreator::tr( "13b5b9" ), { 0, 4, 6, 10, 13, 21, -1 } },
|
||||
{ ChordCreator::tr( "Maj13" ), { 0, 4, 7, 11, 14, 21, -1 } },
|
||||
{ ChordCreator::tr( "m13" ), { 0, 3, 7, 10, 14, 21, -1 } },
|
||||
{ ChordCreator::tr( "m-Maj13" ), { 0, 3, 7, 11, 14, 21, -1 } },
|
||||
|
||||
{ chordCreator::tr( "Major" ), { 0, 2, 4, 5, 7, 9, 11, -1 } },
|
||||
{ chordCreator::tr( "Harmonic minor" ), { 0, 2, 3, 5, 7, 8, 11, -1 } },
|
||||
{ chordCreator::tr( "Melodic minor" ), { 0, 2, 3, 5, 7, 9, 11, -1 } },
|
||||
{ chordCreator::tr( "Whole tone" ), { 0, 2, 4, 6, 8, 10, -1 } },
|
||||
{ chordCreator::tr( "Diminished" ), { 0, 2, 3, 5, 6, 8, 9, 11, -1 } },
|
||||
{ chordCreator::tr( "Major pentatonic" ), { 0, 2, 4, 7, 10, -1 } },
|
||||
{ chordCreator::tr( "Minor pentatonic" ), { 0, 3, 5, 7, 10, -1 } },
|
||||
{ chordCreator::tr( "Jap in sen" ), { 0, 1, 5, 7, 10, -1 } },
|
||||
{ chordCreator::tr( "Major bebop" ), { 0, 2, 4, 5, 7, 8, 9, 11, -1 } },
|
||||
{ chordCreator::tr( "Dominant bebop" ), { 0, 2, 4, 5, 7, 9, 10, 11, -1 } },
|
||||
{ chordCreator::tr( "Blues" ), { 0, 3, 5, 6, 7, 10, -1 } },
|
||||
{ chordCreator::tr( "Arabic" ), { 0, 1, 4, 5, 7, 8, 11, -1 } },
|
||||
{ chordCreator::tr( "Enigmatic" ), { 0, 1, 4, 6, 8, 10, 11, -1 } },
|
||||
{ chordCreator::tr( "Neopolitan" ), { 0, 1, 3, 5, 7, 9, 11, -1 } },
|
||||
{ chordCreator::tr( "Neopolitan minor" ), { 0, 1, 3, 5, 7, 9, 11, -1 } },
|
||||
{ chordCreator::tr( "Hungarian minor" ), { 0, 2, 3, 6, 7, 9, 11, -1 } },
|
||||
{ chordCreator::tr( "Dorian" ), { 0, 2, 3, 5, 7, 9, 10, -1 } },
|
||||
{ chordCreator::tr( "Phrygolydian" ), { 0, 1, 3, 5, 7, 8, 10, -1 } },
|
||||
{ chordCreator::tr( "Lydian" ), { 0, 2, 4, 6, 7, 9, 11, -1 } },
|
||||
{ chordCreator::tr( "Mixolydian" ), { 0, 2, 4, 5, 7, 9, 10, -1 } },
|
||||
{ chordCreator::tr( "Aeolian" ), { 0, 2, 3, 5, 7, 8, 10, -1 } },
|
||||
{ chordCreator::tr( "Locrian" ), { 0, 1, 3, 5, 6, 8, 10, -1 } },
|
||||
{ ChordCreator::tr( "Major" ), { 0, 2, 4, 5, 7, 9, 11, -1 } },
|
||||
{ ChordCreator::tr( "Harmonic minor" ), { 0, 2, 3, 5, 7, 8, 11, -1 } },
|
||||
{ ChordCreator::tr( "Melodic minor" ), { 0, 2, 3, 5, 7, 9, 11, -1 } },
|
||||
{ ChordCreator::tr( "Whole tone" ), { 0, 2, 4, 6, 8, 10, -1 } },
|
||||
{ ChordCreator::tr( "Diminished" ), { 0, 2, 3, 5, 6, 8, 9, 11, -1 } },
|
||||
{ ChordCreator::tr( "Major pentatonic" ), { 0, 2, 4, 7, 10, -1 } },
|
||||
{ ChordCreator::tr( "Minor pentatonic" ), { 0, 3, 5, 7, 10, -1 } },
|
||||
{ ChordCreator::tr( "Jap in sen" ), { 0, 1, 5, 7, 10, -1 } },
|
||||
{ ChordCreator::tr( "Major bebop" ), { 0, 2, 4, 5, 7, 8, 9, 11, -1 } },
|
||||
{ ChordCreator::tr( "Dominant bebop" ), { 0, 2, 4, 5, 7, 9, 10, 11, -1 } },
|
||||
{ ChordCreator::tr( "Blues" ), { 0, 3, 5, 6, 7, 10, -1 } },
|
||||
{ ChordCreator::tr( "Arabic" ), { 0, 1, 4, 5, 7, 8, 11, -1 } },
|
||||
{ ChordCreator::tr( "Enigmatic" ), { 0, 1, 4, 6, 8, 10, 11, -1 } },
|
||||
{ ChordCreator::tr( "Neopolitan" ), { 0, 1, 3, 5, 7, 9, 11, -1 } },
|
||||
{ ChordCreator::tr( "Neopolitan minor" ), { 0, 1, 3, 5, 7, 9, 11, -1 } },
|
||||
{ ChordCreator::tr( "Hungarian minor" ), { 0, 2, 3, 6, 7, 9, 11, -1 } },
|
||||
{ ChordCreator::tr( "Dorian" ), { 0, 2, 3, 5, 7, 9, 10, -1 } },
|
||||
{ ChordCreator::tr( "Phrygolydian" ), { 0, 1, 3, 5, 7, 8, 10, -1 } },
|
||||
{ ChordCreator::tr( "Lydian" ), { 0, 2, 4, 6, 7, 9, 11, -1 } },
|
||||
{ ChordCreator::tr( "Mixolydian" ), { 0, 2, 4, 5, 7, 9, 10, -1 } },
|
||||
{ ChordCreator::tr( "Aeolian" ), { 0, 2, 3, 5, 7, 8, 10, -1 } },
|
||||
{ ChordCreator::tr( "Locrian" ), { 0, 1, 3, 5, 6, 8, 10, -1 } },
|
||||
|
||||
{ "", { -1, -1 } }
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
chordCreator::chordCreator( model * _parent ) :
|
||||
model( _parent, tr( "Chords" ) ),
|
||||
m_chordsEnabledModel( FALSE, this ),
|
||||
ChordCreator::ChordCreator( Model * _parent ) :
|
||||
Model( _parent, tr( "Chords" ) ),
|
||||
m_chordsEnabledModel( false, this ),
|
||||
m_chordsModel( this, tr( "Chord type" ) ),
|
||||
m_chordRangeModel( 1.0f, 1.0f, 9.0f, 1.0f, this, tr( "Chord range" ) )
|
||||
{
|
||||
@@ -156,14 +152,14 @@ chordCreator::chordCreator( model * _parent ) :
|
||||
|
||||
|
||||
|
||||
chordCreator::~chordCreator()
|
||||
ChordCreator::~ChordCreator()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void chordCreator::processNote( notePlayHandle * _n )
|
||||
void ChordCreator::processNote( notePlayHandle * _n )
|
||||
{
|
||||
const int base_note_key = _n->key();
|
||||
// we add chord-subnotes to note if either note is a base-note and
|
||||
@@ -172,10 +168,10 @@ void chordCreator::processNote( notePlayHandle * _n )
|
||||
// played yet, because otherwise we would add chord-subnotes every
|
||||
// time an audio-buffer is rendered...
|
||||
if( ( ( _n->isBaseNote() &&
|
||||
_n->getInstrumentTrack()->arpeggiatorEnabled() == FALSE ) ||
|
||||
_n->instrumentTrack()->isArpeggiatorEnabled() == false ) ||
|
||||
_n->isPartOfArpeggio() ) &&
|
||||
_n->totalFramesPlayed() == 0 &&
|
||||
m_chordsEnabledModel.value() == TRUE )
|
||||
m_chordsEnabledModel.value() == true )
|
||||
{
|
||||
// then insert sub-notes for chord
|
||||
const int selected_chord = m_chordsModel.value();
|
||||
@@ -210,7 +206,7 @@ void chordCreator::processNote( notePlayHandle * _n )
|
||||
_n->detuning() );
|
||||
// create sub-note-play-handle, only note is
|
||||
// different
|
||||
new notePlayHandle( _n->getInstrumentTrack(),
|
||||
new notePlayHandle( _n->instrumentTrack(),
|
||||
_n->offset(),
|
||||
_n->frames(), note_copy,
|
||||
_n );
|
||||
@@ -224,7 +220,7 @@ void chordCreator::processNote( notePlayHandle * _n )
|
||||
|
||||
|
||||
|
||||
void chordCreator::saveSettings( QDomDocument & _doc, QDomElement & _this )
|
||||
void ChordCreator::saveSettings( QDomDocument & _doc, QDomElement & _this )
|
||||
{
|
||||
m_chordsEnabledModel.saveSettings( _doc, _this, "chord-enabled" );
|
||||
m_chordsModel.saveSettings( _doc, _this, "chord" );
|
||||
@@ -234,7 +230,7 @@ void chordCreator::saveSettings( QDomDocument & _doc, QDomElement & _this )
|
||||
|
||||
|
||||
|
||||
void chordCreator::loadSettings( const QDomElement & _this )
|
||||
void ChordCreator::loadSettings( const QDomElement & _this )
|
||||
{
|
||||
m_chordsEnabledModel.loadSettings( _this, "chord-enabled" );
|
||||
m_chordsModel.loadSettings( _this, "chord" );
|
||||
@@ -247,9 +243,9 @@ void chordCreator::loadSettings( const QDomElement & _this )
|
||||
|
||||
|
||||
|
||||
arpeggiator::arpeggiator( model * _parent ) :
|
||||
model( _parent, tr( "Arpeggio" ) ),
|
||||
m_arpEnabledModel( FALSE ),
|
||||
Arpeggiator::Arpeggiator( Model * _parent ) :
|
||||
Model( _parent, tr( "Arpeggio" ) ),
|
||||
m_arpEnabledModel( false ),
|
||||
m_arpModel( this, tr( "Arpeggio type" ) ),
|
||||
m_arpRangeModel( 1.0f, 1.0f, 9.0f, 1.0f, this, tr( "Arpeggio range" ) ),
|
||||
m_arpTimeModel( 100.0f, 25.0f, 2000.0f, 1.0f, 2000, this,
|
||||
@@ -259,42 +255,40 @@ arpeggiator::arpeggiator( model * _parent ) :
|
||||
m_arpDirectionModel( this, tr( "Arpeggio direction" ) ),
|
||||
m_arpModeModel( this, tr( "Arpeggio mode" ) )
|
||||
{
|
||||
for( int i = 0; chordCreator::s_chordTable[i].interval[0] != -1; ++i )
|
||||
for( int i = 0; ChordCreator::s_chordTable[i].interval[0] != -1; ++i )
|
||||
{
|
||||
m_arpModel.addItem( chordCreator::tr(
|
||||
chordCreator::s_chordTable[i].
|
||||
m_arpModel.addItem( ChordCreator::tr(
|
||||
ChordCreator::s_chordTable[i].
|
||||
name.toUtf8().constData() ) );
|
||||
}
|
||||
|
||||
m_arpDirectionModel.addItem( tr( "Up" ),
|
||||
new pixmapLoader( "arp_up" ) );
|
||||
m_arpDirectionModel.addItem( tr( "Down" ),
|
||||
new pixmapLoader( "arp_down" ) );
|
||||
m_arpDirectionModel.addItem( tr( "Up" ), new PixmapLoader( "arp_up" ) );
|
||||
m_arpDirectionModel.addItem( tr( "Down" ), new PixmapLoader( "arp_down" ) );
|
||||
m_arpDirectionModel.addItem( tr( "Up and down" ),
|
||||
new pixmapLoader( "arp_up_and_down" ) );
|
||||
new PixmapLoader( "arp_up_and_down" ) );
|
||||
m_arpDirectionModel.addItem( tr( "Random" ),
|
||||
new pixmapLoader( "arp_random" ) );
|
||||
new PixmapLoader( "arp_random" ) );
|
||||
m_arpDirectionModel.setInitValue( ArpDirUp );
|
||||
|
||||
m_arpModeModel.addItem( tr( "Free" ), new pixmapLoader( "arp_free" ) );
|
||||
m_arpModeModel.addItem( tr( "Sort" ), new pixmapLoader( "arp_sort" ) );
|
||||
m_arpModeModel.addItem( tr( "Sync" ), new pixmapLoader( "arp_sync" ) );
|
||||
m_arpModeModel.addItem( tr( "Free" ), new PixmapLoader( "arp_free" ) );
|
||||
m_arpModeModel.addItem( tr( "Sort" ), new PixmapLoader( "arp_sort" ) );
|
||||
m_arpModeModel.addItem( tr( "Sync" ), new PixmapLoader( "arp_sync" ) );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
arpeggiator::~arpeggiator()
|
||||
Arpeggiator::~Arpeggiator()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void arpeggiator::processNote( notePlayHandle * _n )
|
||||
void Arpeggiator::processNote( notePlayHandle * _n )
|
||||
{
|
||||
const int base_note_key = _n->key();
|
||||
if( _n->isBaseNote() == FALSE ||
|
||||
if( _n->isBaseNote() == false ||
|
||||
!m_arpEnabledModel.value() ||
|
||||
( _n->released() && _n->releaseFramesDone() >=
|
||||
_n->actualReleaseFramesToDo() ) )
|
||||
@@ -306,12 +300,12 @@ void arpeggiator::processNote( notePlayHandle * _n )
|
||||
const int selected_arp = m_arpModel.value();
|
||||
|
||||
ConstNotePlayHandleList cnphv = notePlayHandle::nphsOfInstrumentTrack(
|
||||
_n->getInstrumentTrack() );
|
||||
_n->instrumentTrack() );
|
||||
if( m_arpModeModel.value() != FreeMode && cnphv.size() == 0 )
|
||||
{
|
||||
// maybe we're playing only a preset-preview-note?
|
||||
cnphv = presetPreviewPlayHandle::nphsOfInstrumentTrack(
|
||||
_n->getInstrumentTrack() );
|
||||
_n->instrumentTrack() );
|
||||
if( cnphv.size() == 0 )
|
||||
{
|
||||
// still nothing found here, so lets return
|
||||
@@ -320,8 +314,8 @@ void arpeggiator::processNote( notePlayHandle * _n )
|
||||
}
|
||||
}
|
||||
|
||||
const int cur_chord_size = chordCreator::getChordSize(
|
||||
chordCreator::s_chordTable[selected_arp] );
|
||||
const int cur_chord_size = ChordCreator::getChordSize(
|
||||
ChordCreator::s_chordTable[selected_arp] );
|
||||
const int range = (int)( cur_chord_size * m_arpRangeModel.value() );
|
||||
const int total_range = range * cnphv.size();
|
||||
|
||||
@@ -407,7 +401,7 @@ void arpeggiator::processNote( notePlayHandle * _n )
|
||||
const int sub_note_key = base_note_key + (cur_arp_idx /
|
||||
cur_chord_size ) *
|
||||
KeysPerOctave +
|
||||
chordCreator::s_chordTable[selected_arp].
|
||||
ChordCreator::s_chordTable[selected_arp].
|
||||
interval[cur_arp_idx % cur_chord_size];
|
||||
|
||||
// range-checking
|
||||
@@ -432,15 +426,15 @@ void arpeggiator::processNote( notePlayHandle * _n )
|
||||
_n->getPanning(), _n->detuning() );
|
||||
|
||||
// create sub-note-play-handle, only ptr to note is different
|
||||
// and is_arp_note=TRUE
|
||||
new notePlayHandle( _n->getInstrumentTrack(),
|
||||
// and is_arp_note=true
|
||||
new notePlayHandle( _n->instrumentTrack(),
|
||||
( ( m_arpModeModel.value() != FreeMode ) ?
|
||||
cnphv.first()->offset() :
|
||||
_n->offset() ) +
|
||||
frames_processed,
|
||||
gated_frames,
|
||||
new_note,
|
||||
_n, TRUE );
|
||||
_n, true );
|
||||
|
||||
// update counters
|
||||
frames_processed += arp_frames;
|
||||
@@ -458,7 +452,7 @@ void arpeggiator::processNote( notePlayHandle * _n )
|
||||
|
||||
|
||||
|
||||
void arpeggiator::saveSettings( QDomDocument & _doc, QDomElement & _this )
|
||||
void Arpeggiator::saveSettings( QDomDocument & _doc, QDomElement & _this )
|
||||
{
|
||||
m_arpEnabledModel.saveSettings( _doc, _this, "arp-enabled" );
|
||||
m_arpModel.saveSettings( _doc, _this, "arp" );
|
||||
@@ -473,7 +467,7 @@ void arpeggiator::saveSettings( QDomDocument & _doc, QDomElement & _this )
|
||||
|
||||
|
||||
|
||||
void arpeggiator::loadSettings( const QDomElement & _this )
|
||||
void Arpeggiator::loadSettings( const QDomElement & _this )
|
||||
{
|
||||
m_arpEnabledModel.loadSettings( _this, "arp-enabled" );
|
||||
m_arpModel.loadSettings( _this, "arp" );
|
||||
@@ -494,6 +488,4 @@ void arpeggiator::loadSettings( const QDomElement & _this )
|
||||
}
|
||||
|
||||
|
||||
#include "moc_instrument_functions.cxx"
|
||||
|
||||
#endif
|
||||
#include "moc_InstrumentFunctions.cxx"
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* instrument_sound_shaping.cpp - class instrumentSoundShaping
|
||||
* InstrumentSoundShaping.cpp - implementation of class InstrumentSoundShaping
|
||||
*
|
||||
* Copyright (c) 2004-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* Copyright (c) 2004-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
@@ -22,17 +22,15 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include <QtXml/QDomElement>
|
||||
|
||||
|
||||
#include "instrument_sound_shaping.h"
|
||||
#include "InstrumentSoundShaping.h"
|
||||
#include "basic_filters.h"
|
||||
#include "embed.h"
|
||||
#include "engine.h"
|
||||
#include "envelope_and_lfo_parameters.h"
|
||||
#include "instrument.h"
|
||||
#include "instrument_track.h"
|
||||
#include "EnvelopeAndLfoParameters.h"
|
||||
#include "Instrument.h"
|
||||
#include "InstrumentTrack.h"
|
||||
#include "note_play_handle.h"
|
||||
|
||||
|
||||
@@ -44,30 +42,28 @@ const float RES_PRECISION = 1000.0f;
|
||||
|
||||
// names for env- and lfo-targets - first is name being displayed to user
|
||||
// and second one is used internally, e.g. for saving/restoring settings
|
||||
const QString __targetNames[instrumentSoundShaping::NumTargets][3] =
|
||||
const QString __targetNames[InstrumentSoundShaping::NumTargets][3] =
|
||||
{
|
||||
{ instrumentSoundShaping::tr( "VOLUME" ), "vol",
|
||||
instrumentSoundShaping::tr( "Volume" ) },
|
||||
/* instrumentSoundShaping::tr( "Pan" ),
|
||||
instrumentSoundShaping::tr( "Pitch" ),*/
|
||||
{ instrumentSoundShaping::tr( "CUTOFF" ), "cut",
|
||||
instrumentSoundShaping::tr( "Cutoff frequency" ) },
|
||||
{ instrumentSoundShaping::tr( "RESO" ), "res",
|
||||
instrumentSoundShaping::tr( "Resonance" ) }
|
||||
{ InstrumentSoundShaping::tr( "VOLUME" ), "vol",
|
||||
InstrumentSoundShaping::tr( "Volume" ) },
|
||||
/* InstrumentSoundShaping::tr( "Pan" ),
|
||||
InstrumentSoundShaping::tr( "Pitch" ),*/
|
||||
{ InstrumentSoundShaping::tr( "CUTOFF" ), "cut",
|
||||
InstrumentSoundShaping::tr( "Cutoff frequency" ) },
|
||||
{ InstrumentSoundShaping::tr( "RESO" ), "res",
|
||||
InstrumentSoundShaping::tr( "Resonance" ) }
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
instrumentSoundShaping::instrumentSoundShaping(
|
||||
instrumentTrack * _instrument_track ) :
|
||||
model( _instrument_track, tr( "Envelopes/LFOs" ) ),
|
||||
InstrumentSoundShaping::InstrumentSoundShaping(
|
||||
InstrumentTrack * _instrument_track ) :
|
||||
Model( _instrument_track, tr( "Envelopes/LFOs" ) ),
|
||||
m_instrumentTrack( _instrument_track ),
|
||||
m_filterEnabledModel( false, this ),
|
||||
m_filterModel( this, tr( "Filter type" ) ),
|
||||
m_filterCutModel( 14000.0, 1.0, 14000.0, 1.0, this,
|
||||
tr( "Cutoff frequency" ) ),
|
||||
m_filterResModel( 0.5, basicFilters<>::minQ(), 10.0, 0.01, this,
|
||||
tr( "Q/Resonance" ) )
|
||||
m_filterCutModel( 14000.0, 1.0, 14000.0, 1.0, this, tr( "Cutoff frequency" ) ),
|
||||
m_filterResModel( 0.5, basicFilters<>::minQ(), 10.0, 0.01, this, tr( "Q/Resonance" ) )
|
||||
{
|
||||
for( int i = 0; i < NumTargets; ++i )
|
||||
{
|
||||
@@ -76,42 +72,34 @@ instrumentSoundShaping::instrumentSoundShaping(
|
||||
{
|
||||
value_for_zero_amount = 1.0;
|
||||
}
|
||||
m_envLFOParameters[i] = new envelopeAndLFOParameters(
|
||||
value_for_zero_amount,
|
||||
this );
|
||||
m_envLFOParameters[i]->setDisplayName(
|
||||
m_envLfoParameters[i] = new EnvelopeAndLfoParameters(
|
||||
value_for_zero_amount,
|
||||
this );
|
||||
m_envLfoParameters[i]->setDisplayName(
|
||||
tr( __targetNames[i][2].toUtf8().constData() ) );
|
||||
}
|
||||
|
||||
m_filterModel.addItem( tr( "LowPass" ),
|
||||
new pixmapLoader( "filter_lp" ) );
|
||||
m_filterModel.addItem( tr( "HiPass" ),
|
||||
new pixmapLoader( "filter_hp" ) );
|
||||
m_filterModel.addItem( tr( "BandPass csg" ),
|
||||
new pixmapLoader( "filter_bp" ) );
|
||||
m_filterModel.addItem( tr( "BandPass czpg" ),
|
||||
new pixmapLoader( "filter_bp" ) );
|
||||
m_filterModel.addItem( tr( "Notch" ),
|
||||
new pixmapLoader( "filter_notch" ) );
|
||||
m_filterModel.addItem( tr( "Allpass" ),
|
||||
new pixmapLoader( "filter_ap" ) );
|
||||
m_filterModel.addItem( tr( "Moog" ),
|
||||
new pixmapLoader( "filter_lp" ) );
|
||||
m_filterModel.addItem( tr( "2x LowPass" ),
|
||||
new pixmapLoader( "filter_2lp" ) );
|
||||
m_filterModel.addItem( tr( "LowPass" ), new PixmapLoader( "filter_lp" ) );
|
||||
m_filterModel.addItem( tr( "HiPass" ), new PixmapLoader( "filter_hp" ) );
|
||||
m_filterModel.addItem( tr( "BandPass csg" ), new PixmapLoader( "filter_bp" ) );
|
||||
m_filterModel.addItem( tr( "BandPass czpg" ), new PixmapLoader( "filter_bp" ) );
|
||||
m_filterModel.addItem( tr( "Notch" ), new PixmapLoader( "filter_notch" ) );
|
||||
m_filterModel.addItem( tr( "Allpass" ), new PixmapLoader( "filter_ap" ) );
|
||||
m_filterModel.addItem( tr( "Moog" ), new PixmapLoader( "filter_lp" ) );
|
||||
m_filterModel.addItem( tr( "2x LowPass" ), new PixmapLoader( "filter_2lp" ) );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
instrumentSoundShaping::~instrumentSoundShaping()
|
||||
InstrumentSoundShaping::~InstrumentSoundShaping()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
float instrumentSoundShaping::volumeLevel( notePlayHandle * _n,
|
||||
float InstrumentSoundShaping::volumeLevel( notePlayHandle * _n,
|
||||
const f_cnt_t _frame )
|
||||
{
|
||||
f_cnt_t release_begin = _frame - _n->releaseFramesDone() +
|
||||
@@ -123,16 +111,16 @@ float instrumentSoundShaping::volumeLevel( notePlayHandle * _n,
|
||||
}
|
||||
|
||||
float volume_level;
|
||||
m_envLFOParameters[Volume]->fillLevel( &volume_level, _frame,
|
||||
m_envLfoParameters[Volume]->fillLevel( &volume_level, _frame,
|
||||
release_begin, 1 );
|
||||
|
||||
return( volume_level );
|
||||
return volume_level;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void instrumentSoundShaping::processAudioBuffer( sampleFrame * _ab,
|
||||
void InstrumentSoundShaping::processAudioBuffer( sampleFrame * _ab,
|
||||
const fpp_t _frames,
|
||||
notePlayHandle * _n )
|
||||
{
|
||||
@@ -173,20 +161,20 @@ void instrumentSoundShaping::processAudioBuffer( sampleFrame * _ab,
|
||||
float * res_buf = NULL;
|
||||
#endif
|
||||
|
||||
if( m_envLFOParameters[Cut]->used() )
|
||||
if( m_envLfoParameters[Cut]->isUsed() )
|
||||
{
|
||||
#ifndef __GNUC__
|
||||
cut_buf = new float[_frames];
|
||||
#endif
|
||||
m_envLFOParameters[Cut]->fillLevel( cut_buf, total_frames,
|
||||
m_envLfoParameters[Cut]->fillLevel( cut_buf, total_frames,
|
||||
release_begin, _frames );
|
||||
}
|
||||
if( m_envLFOParameters[Resonance]->used() )
|
||||
if( m_envLfoParameters[Resonance]->isUsed() )
|
||||
{
|
||||
#ifndef __GNUC__
|
||||
res_buf = new float[_frames];
|
||||
#endif
|
||||
m_envLFOParameters[Resonance]->fillLevel( res_buf,
|
||||
m_envLfoParameters[Resonance]->fillLevel( res_buf,
|
||||
total_frames, release_begin,
|
||||
_frames );
|
||||
}
|
||||
@@ -194,12 +182,12 @@ void instrumentSoundShaping::processAudioBuffer( sampleFrame * _ab,
|
||||
const float fcv = m_filterCutModel.value();
|
||||
const float frv = m_filterResModel.value();
|
||||
|
||||
if( m_envLFOParameters[Cut]->used() &&
|
||||
m_envLFOParameters[Resonance]->used() )
|
||||
if( m_envLfoParameters[Cut]->isUsed() &&
|
||||
m_envLfoParameters[Resonance]->isUsed() )
|
||||
{
|
||||
for( fpp_t frame = 0; frame < _frames; ++frame )
|
||||
{
|
||||
const float new_cut_val = envelopeAndLFOParameters::expKnobVal( cut_buf[frame] ) *
|
||||
const float new_cut_val = EnvelopeAndLfoParameters::expKnobVal( cut_buf[frame] ) *
|
||||
CUT_FREQ_MULTIPLIER + fcv;
|
||||
|
||||
const float new_res_val = frv + RES_MULTIPLIER * res_buf[frame];
|
||||
@@ -216,11 +204,11 @@ void instrumentSoundShaping::processAudioBuffer( sampleFrame * _ab,
|
||||
_ab[frame][1] = _n->m_filter->update( _ab[frame][1], 1 );
|
||||
}
|
||||
}
|
||||
else if( m_envLFOParameters[Cut]->used() )
|
||||
else if( m_envLfoParameters[Cut]->isUsed() )
|
||||
{
|
||||
for( fpp_t frame = 0; frame < _frames; ++frame )
|
||||
{
|
||||
float new_cut_val = envelopeAndLFOParameters::expKnobVal( cut_buf[frame] ) *
|
||||
float new_cut_val = EnvelopeAndLfoParameters::expKnobVal( cut_buf[frame] ) *
|
||||
CUT_FREQ_MULTIPLIER + fcv;
|
||||
|
||||
if( static_cast<int>( new_cut_val ) != old_filter_cut )
|
||||
@@ -233,7 +221,7 @@ void instrumentSoundShaping::processAudioBuffer( sampleFrame * _ab,
|
||||
_ab[frame][1] = _n->m_filter->update( _ab[frame][1], 1 );
|
||||
}
|
||||
}
|
||||
else if( m_envLFOParameters[Resonance]->used() )
|
||||
else if( m_envLfoParameters[Resonance]->isUsed() )
|
||||
{
|
||||
for( fpp_t frame = 0; frame < _frames; ++frame )
|
||||
{
|
||||
@@ -266,14 +254,14 @@ void instrumentSoundShaping::processAudioBuffer( sampleFrame * _ab,
|
||||
#endif
|
||||
}
|
||||
|
||||
if( m_envLFOParameters[Volume]->used() )
|
||||
if( m_envLfoParameters[Volume]->isUsed() )
|
||||
{
|
||||
#ifdef __GNUC__
|
||||
float vol_buf[_frames];
|
||||
#else
|
||||
float * vol_buf = new float[_frames];
|
||||
#endif
|
||||
m_envLFOParameters[Volume]->fillLevel( vol_buf, total_frames,
|
||||
m_envLfoParameters[Volume]->fillLevel( vol_buf, total_frames,
|
||||
release_begin, _frames );
|
||||
|
||||
for( fpp_t frame = 0; frame < _frames; ++frame )
|
||||
@@ -288,7 +276,7 @@ void instrumentSoundShaping::processAudioBuffer( sampleFrame * _ab,
|
||||
#endif
|
||||
}
|
||||
|
||||
/* else if( m_envLFOParameters[Volume]->used() == false && m_envLFOParameters[PANNING]->used() )
|
||||
/* else if( m_envLfoParameters[Volume]->isUsed() == false && m_envLfoParameters[PANNING]->isUsed() )
|
||||
{
|
||||
// only use panning-envelope...
|
||||
for( fpp_t frame = 0; frame < _frames; ++frame )
|
||||
@@ -306,18 +294,18 @@ void instrumentSoundShaping::processAudioBuffer( sampleFrame * _ab,
|
||||
|
||||
|
||||
|
||||
f_cnt_t instrumentSoundShaping::envFrames( const bool _only_vol ) const
|
||||
f_cnt_t InstrumentSoundShaping::envFrames( const bool _only_vol ) const
|
||||
{
|
||||
f_cnt_t ret_val = m_envLFOParameters[Volume]->PAHD_Frames();
|
||||
f_cnt_t ret_val = m_envLfoParameters[Volume]->PAHD_Frames();
|
||||
|
||||
if( _only_vol == false )
|
||||
{
|
||||
for( int i = Volume+1; i < NumTargets; ++i )
|
||||
{
|
||||
if( m_envLFOParameters[i]->used() &&
|
||||
m_envLFOParameters[i]->PAHD_Frames() > ret_val )
|
||||
if( m_envLfoParameters[i]->isUsed() &&
|
||||
m_envLfoParameters[i]->PAHD_Frames() > ret_val )
|
||||
{
|
||||
ret_val = m_envLFOParameters[i]->PAHD_Frames();
|
||||
ret_val = m_envLfoParameters[i]->PAHD_Frames();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -327,26 +315,23 @@ f_cnt_t instrumentSoundShaping::envFrames( const bool _only_vol ) const
|
||||
|
||||
|
||||
|
||||
f_cnt_t instrumentSoundShaping::releaseFrames( void ) const
|
||||
f_cnt_t InstrumentSoundShaping::releaseFrames() const
|
||||
{
|
||||
f_cnt_t ret_val = m_envLFOParameters[Volume]->used() ?
|
||||
m_envLFOParameters[Volume]->releaseFrames() : 0;
|
||||
if( m_instrumentTrack->getInstrument()->desiredReleaseFrames() >
|
||||
ret_val )
|
||||
f_cnt_t ret_val = m_envLfoParameters[Volume]->isUsed() ?
|
||||
m_envLfoParameters[Volume]->releaseFrames() : 0;
|
||||
if( m_instrumentTrack->instrument()->desiredReleaseFrames() > ret_val )
|
||||
{
|
||||
ret_val = m_instrumentTrack->getInstrument()->
|
||||
desiredReleaseFrames();
|
||||
ret_val = m_instrumentTrack->instrument()->desiredReleaseFrames();
|
||||
}
|
||||
|
||||
if( m_envLFOParameters[Volume]->used() == false )
|
||||
if( m_envLfoParameters[Volume]->isUsed() == false )
|
||||
{
|
||||
for( int i = Volume+1; i < NumTargets; ++i )
|
||||
{
|
||||
if( m_envLFOParameters[i]->used() &&
|
||||
m_envLFOParameters[i]->releaseFrames() >
|
||||
ret_val )
|
||||
if( m_envLfoParameters[i]->isUsed() &&
|
||||
m_envLfoParameters[i]->releaseFrames() > ret_val )
|
||||
{
|
||||
ret_val = m_envLFOParameters[i]->releaseFrames();
|
||||
ret_val = m_envLfoParameters[i]->releaseFrames();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -356,7 +341,7 @@ f_cnt_t instrumentSoundShaping::releaseFrames( void ) const
|
||||
|
||||
|
||||
|
||||
void instrumentSoundShaping::saveSettings( QDomDocument & _doc, QDomElement & _this )
|
||||
void InstrumentSoundShaping::saveSettings( QDomDocument & _doc, QDomElement & _this )
|
||||
{
|
||||
m_filterModel.saveSettings( _doc, _this, "ftype" );
|
||||
m_filterCutModel.saveSettings( _doc, _this, "fcut" );
|
||||
@@ -365,8 +350,8 @@ void instrumentSoundShaping::saveSettings( QDomDocument & _doc, QDomElement & _t
|
||||
|
||||
for( int i = 0; i < NumTargets; ++i )
|
||||
{
|
||||
m_envLFOParameters[i]->saveState( _doc, _this ).setTagName(
|
||||
m_envLFOParameters[i]->nodeName() +
|
||||
m_envLfoParameters[i]->saveState( _doc, _this ).setTagName(
|
||||
m_envLfoParameters[i]->nodeName() +
|
||||
QString( __targetNames[i][1] ).toLower() );
|
||||
}
|
||||
}
|
||||
@@ -374,7 +359,7 @@ void instrumentSoundShaping::saveSettings( QDomDocument & _doc, QDomElement & _t
|
||||
|
||||
|
||||
|
||||
void instrumentSoundShaping::loadSettings( const QDomElement & _this )
|
||||
void InstrumentSoundShaping::loadSettings( const QDomElement & _this )
|
||||
{
|
||||
m_filterModel.loadSettings( _this, "ftype" );
|
||||
m_filterCutModel.loadSettings( _this, "fcut" );
|
||||
@@ -389,12 +374,11 @@ void instrumentSoundShaping::loadSettings( const QDomElement & _this )
|
||||
for( int i = 0; i < NumTargets; ++i )
|
||||
{
|
||||
if( node.nodeName() ==
|
||||
m_envLFOParameters[i]->nodeName() +
|
||||
m_envLfoParameters[i]->nodeName() +
|
||||
QString( __targetNames[i][1] ).
|
||||
toLower() )
|
||||
{
|
||||
m_envLFOParameters[i]->restoreState(
|
||||
node.toElement() );
|
||||
m_envLfoParameters[i]->restoreState( node.toElement() );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -405,5 +389,5 @@ void instrumentSoundShaping::loadSettings( const QDomElement & _this )
|
||||
|
||||
|
||||
|
||||
#include "moc_instrument_sound_shaping.cxx"
|
||||
#include "moc_InstrumentSoundShaping.cxx"
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* journalling_object.cpp - implementation of journalling-object related stuff
|
||||
* JournallingObject.cpp - implementation of journalling-object related stuff
|
||||
*
|
||||
* Copyright (c) 2006-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
@@ -22,21 +22,21 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include <QtXml/QDomElement>
|
||||
|
||||
#include <cstdio>
|
||||
|
||||
#include "journalling_object.h"
|
||||
#include "automatable_model.h"
|
||||
#include "project_journal.h"
|
||||
#include "JournallingObject.h"
|
||||
#include "AutomatableModel.h"
|
||||
#include "ProjectJournal.h"
|
||||
#include "base64.h"
|
||||
#include "engine.h"
|
||||
|
||||
|
||||
|
||||
journallingObject::journallingObject() :
|
||||
m_id( engine::getProjectJournal()->allocID( this ) ),
|
||||
JournallingObject::JournallingObject() :
|
||||
SerializingObject(),
|
||||
m_id( engine::projectJournal()->allocID( this ) ),
|
||||
m_journalEntries(),
|
||||
m_currentJournalEntry( m_journalEntries.end() ),
|
||||
m_journalling( true ),
|
||||
@@ -47,18 +47,18 @@ journallingObject::journallingObject() :
|
||||
|
||||
|
||||
|
||||
journallingObject::~journallingObject()
|
||||
JournallingObject::~JournallingObject()
|
||||
{
|
||||
if( engine::getProjectJournal() )
|
||||
if( engine::projectJournal() )
|
||||
{
|
||||
engine::getProjectJournal()->freeID( id() );
|
||||
engine::projectJournal()->freeID( id() );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void journallingObject::undo()
|
||||
void JournallingObject::undo()
|
||||
{
|
||||
if( m_journalEntries.empty() == true )
|
||||
{
|
||||
@@ -74,7 +74,7 @@ void journallingObject::undo()
|
||||
|
||||
|
||||
|
||||
void journallingObject::redo()
|
||||
void JournallingObject::redo()
|
||||
{
|
||||
if( m_journalEntries.empty() == true )
|
||||
{
|
||||
@@ -90,10 +90,10 @@ void journallingObject::redo()
|
||||
|
||||
|
||||
|
||||
QDomElement journallingObject::saveState( QDomDocument & _doc,
|
||||
QDomElement JournallingObject::saveState( QDomDocument & _doc,
|
||||
QDomElement & _parent )
|
||||
{
|
||||
QDomElement _this = serializingObject::saveState( _doc, _parent );
|
||||
QDomElement _this = SerializingObject::saveState( _doc, _parent );
|
||||
saveJournal( _doc, _this );
|
||||
return _this;
|
||||
}
|
||||
@@ -101,9 +101,9 @@ QDomElement journallingObject::saveState( QDomDocument & _doc,
|
||||
|
||||
|
||||
|
||||
void journallingObject::restoreState( const QDomElement & _this )
|
||||
void JournallingObject::restoreState( const QDomElement & _this )
|
||||
{
|
||||
serializingObject::restoreState( _this );
|
||||
SerializingObject::restoreState( _this );
|
||||
|
||||
saveJournallingState( false );
|
||||
|
||||
@@ -124,43 +124,43 @@ void journallingObject::restoreState( const QDomElement & _this )
|
||||
|
||||
|
||||
|
||||
void journallingObject::addJournalEntry( const journalEntry & _je )
|
||||
void JournallingObject::addJournalEntry( const JournalEntry & _je )
|
||||
{
|
||||
if( engine::getProjectJournal()->isJournalling() && isJournalling() )
|
||||
if( engine::projectJournal()->isJournalling() && isJournalling() )
|
||||
{
|
||||
m_journalEntries.erase( m_currentJournalEntry,
|
||||
m_journalEntries.end() );
|
||||
m_journalEntries.push_back( _je );
|
||||
m_currentJournalEntry = m_journalEntries.end();
|
||||
engine::getProjectJournal()->journalEntryAdded( id() );
|
||||
engine::projectJournal()->journalEntryAdded( id() );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void journallingObject::changeID( jo_id_t _id )
|
||||
void JournallingObject::changeID( jo_id_t _id )
|
||||
{
|
||||
if( id() != _id )
|
||||
{
|
||||
journallingObject * jo = engine::getProjectJournal()->
|
||||
getJournallingObject( _id );
|
||||
JournallingObject * jo = engine::projectJournal()->
|
||||
journallingObject( _id );
|
||||
if( jo != NULL )
|
||||
{
|
||||
QString used_by = jo->nodeName();
|
||||
if( used_by == "automatablemodel" &&
|
||||
dynamic_cast<automatableModel *>( jo ) )
|
||||
dynamic_cast<AutomatableModel *>( jo ) )
|
||||
{
|
||||
used_by += ":" +
|
||||
dynamic_cast<automatableModel *>( jo )->
|
||||
dynamic_cast<AutomatableModel *>( jo )->
|
||||
displayName();
|
||||
}
|
||||
fprintf( stderr, "JO-ID %d already in use by %s!\n",
|
||||
(int) _id, used_by.toUtf8().constData() );
|
||||
return;
|
||||
}
|
||||
engine::getProjectJournal()->forgetAboutID( id() );
|
||||
engine::getProjectJournal()->reallocID( _id, this );
|
||||
engine::projectJournal()->forgetAboutID( id() );
|
||||
engine::projectJournal()->reallocID( _id, this );
|
||||
m_id = _id;
|
||||
}
|
||||
}
|
||||
@@ -168,7 +168,7 @@ void journallingObject::changeID( jo_id_t _id )
|
||||
|
||||
|
||||
|
||||
void journallingObject::saveJournal( QDomDocument & _doc,
|
||||
void JournallingObject::saveJournal( QDomDocument & _doc,
|
||||
QDomElement & _parent )
|
||||
{
|
||||
/* // avoid creating empty journal-nodes
|
||||
@@ -183,7 +183,7 @@ void journallingObject::saveJournal( QDomDocument & _doc,
|
||||
m_journalEntries.begin() ) );
|
||||
journal_de.setAttribute( "metadata", true );
|
||||
|
||||
for( journalEntryVector::const_iterator it = m_journalEntries.begin();
|
||||
for( JournalEntryVector::const_iterator it = m_journalEntries.begin();
|
||||
it != m_journalEntries.end(); ++it )
|
||||
{
|
||||
QDomElement je_de = _doc.createElement( "entry" );
|
||||
@@ -200,7 +200,7 @@ void journallingObject::saveJournal( QDomDocument & _doc,
|
||||
|
||||
|
||||
|
||||
void journallingObject::loadJournal( const QDomElement & _this )
|
||||
void JournallingObject::loadJournal( const QDomElement & _this )
|
||||
{
|
||||
clear();
|
||||
|
||||
@@ -222,7 +222,7 @@ void journallingObject::loadJournal( const QDomElement & _this )
|
||||
{
|
||||
const QDomElement & je = node.toElement();
|
||||
m_journalEntries[je.attribute( "pos" ).toInt()] =
|
||||
journalEntry(
|
||||
JournalEntry(
|
||||
je.attribute( "actionid" ).toInt(),
|
||||
base64::decode( je.attribute( "data" ) ) );
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* ladspa_control.cpp - model for controlling a LADSPA port
|
||||
* LadspaControl.cpp - model for controlling a LADSPA port
|
||||
*
|
||||
* Copyright (c) 2008-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2006-2008 Danny McRae <khjklujn/at/users.sourceforge.net>
|
||||
*
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
@@ -25,17 +25,17 @@
|
||||
|
||||
#include <cstdio>
|
||||
|
||||
#include "ladspa_control.h"
|
||||
#include "ladspa_base.h"
|
||||
#include "LadspaControl.h"
|
||||
#include "LadspaBase.h"
|
||||
|
||||
|
||||
ladspaControl::ladspaControl( model * _parent, port_desc_t * _port,
|
||||
LadspaControl::LadspaControl( Model * _parent, port_desc_t * _port,
|
||||
bool _link ) :
|
||||
model( _parent ),
|
||||
Model( _parent ),
|
||||
m_link( _link ),
|
||||
m_port( _port ),
|
||||
m_linkEnabledModel( _link, this, tr( "Link channels" ) ),
|
||||
m_toggledModel( FALSE, this, m_port->name ),
|
||||
m_toggledModel( false, this, m_port->name ),
|
||||
m_knobModel( 0, 0, 0, 1, this, m_port->name ),
|
||||
m_tempoSyncKnobModel( 0, 0, 0, 1, m_port->max, this, m_port->name )
|
||||
{
|
||||
@@ -44,7 +44,7 @@ ladspaControl::ladspaControl( model * _parent, port_desc_t * _port,
|
||||
connect( &m_linkEnabledModel, SIGNAL( dataChanged() ),
|
||||
this, SLOT( linkStateChanged() ) );
|
||||
}
|
||||
|
||||
|
||||
switch( m_port->data_type )
|
||||
{
|
||||
case TOGGLED:
|
||||
@@ -52,16 +52,16 @@ ladspaControl::ladspaControl( model * _parent, port_desc_t * _port,
|
||||
this, SLOT( ledChanged() ) );
|
||||
if( m_port->def == 1.0f )
|
||||
{
|
||||
m_toggledModel.setValue( TRUE );
|
||||
m_toggledModel.setValue( true );
|
||||
}
|
||||
break;
|
||||
|
||||
case INTEGER:
|
||||
m_knobModel.setRange( static_cast<int>( m_port->max ),
|
||||
static_cast<int>( m_port->min ),
|
||||
1 + static_cast<int>( m_port->max -
|
||||
m_knobModel.setRange( static_cast<int>( m_port->max ),
|
||||
static_cast<int>( m_port->min ),
|
||||
1 + static_cast<int>( m_port->max -
|
||||
m_port->min ) / 400 );
|
||||
m_knobModel.setInitValue(
|
||||
m_knobModel.setInitValue(
|
||||
static_cast<int>( m_port->def ) );
|
||||
connect( &m_knobModel, SIGNAL( dataChanged() ),
|
||||
this, SLOT( knobChanged() ) );
|
||||
@@ -79,8 +79,8 @@ ladspaControl::ladspaControl( model * _parent, port_desc_t * _port,
|
||||
break;
|
||||
|
||||
case TIME:
|
||||
m_tempoSyncKnobModel.setRange( m_port->min, m_port->max,
|
||||
( m_port->max -
|
||||
m_tempoSyncKnobModel.setRange( m_port->min, m_port->max,
|
||||
( m_port->max -
|
||||
m_port->min ) / 400.0f );
|
||||
m_tempoSyncKnobModel.setInitValue( m_port->def );
|
||||
connect( &m_tempoSyncKnobModel, SIGNAL( dataChanged() ),
|
||||
@@ -95,44 +95,36 @@ ladspaControl::ladspaControl( model * _parent, port_desc_t * _port,
|
||||
|
||||
|
||||
|
||||
ladspaControl::~ladspaControl()
|
||||
LadspaControl::~LadspaControl()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
LADSPA_Data ladspaControl::getValue( void )
|
||||
LADSPA_Data LadspaControl::value()
|
||||
{
|
||||
LADSPA_Data value = 0.0f;
|
||||
|
||||
switch( m_port->data_type )
|
||||
{
|
||||
case TOGGLED:
|
||||
value = static_cast<LADSPA_Data>(
|
||||
m_toggledModel.value() );
|
||||
break;
|
||||
return static_cast<LADSPA_Data>( m_toggledModel.value() );
|
||||
case INTEGER:
|
||||
case FLOATING:
|
||||
value = static_cast<LADSPA_Data>(
|
||||
m_knobModel.value() );
|
||||
break;
|
||||
return static_cast<LADSPA_Data>( m_knobModel.value() );
|
||||
case TIME:
|
||||
value = static_cast<LADSPA_Data>(
|
||||
m_tempoSyncKnobModel.value() );
|
||||
break;
|
||||
return static_cast<LADSPA_Data>( m_tempoSyncKnobModel.value() );
|
||||
default:
|
||||
printf( "ladspaControl::getValue BAD BAD BAD\n" );
|
||||
qWarning( "LadspaControl::value(): BAD BAD BAD\n" );
|
||||
break;
|
||||
}
|
||||
|
||||
return( value );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void ladspaControl::setValue( LADSPA_Data _value )
|
||||
void LadspaControl::setValue( LADSPA_Data _value )
|
||||
{
|
||||
switch( m_port->data_type )
|
||||
{
|
||||
@@ -150,7 +142,7 @@ void ladspaControl::setValue( LADSPA_Data _value )
|
||||
_value ) );
|
||||
break;
|
||||
default:
|
||||
printf("ladspaControl::setValue BAD BAD BAD\n");
|
||||
printf("LadspaControl::setValue BAD BAD BAD\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -158,8 +150,8 @@ void ladspaControl::setValue( LADSPA_Data _value )
|
||||
|
||||
|
||||
|
||||
void ladspaControl::saveSettings( QDomDocument & _doc,
|
||||
QDomElement & _this,
|
||||
void LadspaControl::saveSettings( QDomDocument & _doc,
|
||||
QDomElement & _this,
|
||||
const QString & _name )
|
||||
{
|
||||
if( m_link )
|
||||
@@ -179,7 +171,7 @@ void ladspaControl::saveSettings( QDomDocument & _doc,
|
||||
m_tempoSyncKnobModel.saveSettings( _doc, _this, _name );
|
||||
break;
|
||||
default:
|
||||
printf("ladspaControl::saveSettings BAD BAD BAD\n");
|
||||
printf("LadspaControl::saveSettings BAD BAD BAD\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -187,7 +179,7 @@ void ladspaControl::saveSettings( QDomDocument & _doc,
|
||||
|
||||
|
||||
|
||||
void ladspaControl::loadSettings( const QDomElement & _this,
|
||||
void LadspaControl::loadSettings( const QDomElement & _this,
|
||||
const QString & _name )
|
||||
{
|
||||
if( m_link )
|
||||
@@ -207,7 +199,7 @@ void ladspaControl::loadSettings( const QDomElement & _this,
|
||||
m_tempoSyncKnobModel.loadSettings( _this, _name );
|
||||
break;
|
||||
default:
|
||||
printf("ladspaControl::loadSettings BAD BAD BAD\n");
|
||||
printf("LadspaControl::loadSettings BAD BAD BAD\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -215,22 +207,20 @@ void ladspaControl::loadSettings( const QDomElement & _this,
|
||||
|
||||
|
||||
|
||||
void ladspaControl::linkControls( ladspaControl * _control )
|
||||
void LadspaControl::linkControls( LadspaControl * _control )
|
||||
{
|
||||
switch( m_port->data_type )
|
||||
{
|
||||
case TOGGLED:
|
||||
boolModel::linkModels( &m_toggledModel,
|
||||
_control->getToggledModel() );
|
||||
BoolModel::linkModels( &m_toggledModel, _control->toggledModel() );
|
||||
break;
|
||||
case INTEGER:
|
||||
case FLOATING:
|
||||
knobModel::linkModels( &m_knobModel,
|
||||
_control->getKnobModel() );
|
||||
FloatModel::linkModels( &m_knobModel, _control->knobModel() );
|
||||
break;
|
||||
case TIME:
|
||||
tempoSyncKnobModel::linkModels( &m_tempoSyncKnobModel,
|
||||
_control->getTempoSyncKnobModel() );
|
||||
TempoSyncKnobModel::linkModels( &m_tempoSyncKnobModel,
|
||||
_control->tempoSyncKnobModel() );
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -240,49 +230,47 @@ void ladspaControl::linkControls( ladspaControl * _control )
|
||||
|
||||
|
||||
|
||||
void ladspaControl::ledChanged( void )
|
||||
void LadspaControl::ledChanged()
|
||||
{
|
||||
emit( changed( m_port->port_id, static_cast<LADSPA_Data>(
|
||||
m_toggledModel.value() ) ) );
|
||||
emit changed( m_port->port_id, static_cast<LADSPA_Data>(
|
||||
m_toggledModel.value() ) );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void ladspaControl::knobChanged( void )
|
||||
void LadspaControl::knobChanged()
|
||||
{
|
||||
emit( changed( m_port->port_id, static_cast<LADSPA_Data>(
|
||||
m_knobModel.value() ) ) );
|
||||
emit changed( m_port->port_id, static_cast<LADSPA_Data>(
|
||||
m_knobModel.value() ) );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void ladspaControl::tempoKnobChanged( void )
|
||||
void LadspaControl::tempoKnobChanged()
|
||||
{
|
||||
emit( changed( m_port->port_id, static_cast<LADSPA_Data>(
|
||||
m_tempoSyncKnobModel.value() ) ) );
|
||||
emit changed( m_port->port_id, static_cast<LADSPA_Data>(
|
||||
m_tempoSyncKnobModel.value() ) );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void ladspaControl::unlinkControls( ladspaControl * _control )
|
||||
void LadspaControl::unlinkControls( LadspaControl * _control )
|
||||
{
|
||||
switch( m_port->data_type )
|
||||
{
|
||||
case TOGGLED:
|
||||
boolModel::unlinkModels( &m_toggledModel,
|
||||
_control->getToggledModel() );
|
||||
BoolModel::unlinkModels( &m_toggledModel, _control->toggledModel() );
|
||||
break;
|
||||
case INTEGER:
|
||||
case FLOATING:
|
||||
knobModel::unlinkModels( &m_knobModel,
|
||||
_control->getKnobModel() );
|
||||
FloatModel::unlinkModels( &m_knobModel, _control->knobModel() );
|
||||
break;
|
||||
case TIME:
|
||||
tempoSyncKnobModel::unlinkModels( &m_tempoSyncKnobModel,
|
||||
_control->getTempoSyncKnobModel() );
|
||||
TempoSyncKnobModel::unlinkModels( &m_tempoSyncKnobModel,
|
||||
_control->tempoSyncKnobModel() );
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -292,19 +280,19 @@ void ladspaControl::unlinkControls( ladspaControl * _control )
|
||||
|
||||
|
||||
|
||||
void ladspaControl::linkStateChanged( void )
|
||||
void LadspaControl::linkStateChanged()
|
||||
{
|
||||
emit( linkChanged( m_port->control_id, m_linkEnabledModel.value() ) );
|
||||
emit linkChanged( m_port->control_id, m_linkEnabledModel.value() );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void ladspaControl::setLink( bool _state )
|
||||
void LadspaControl::setLink( bool _state )
|
||||
{
|
||||
m_linkEnabledModel.setValue( _state );
|
||||
}
|
||||
|
||||
|
||||
|
||||
#include "moc_ladspa_control.cxx"
|
||||
#include "moc_LadspaControl.cxx"
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* LfoController.cpp - implementation of class controller which handles
|
||||
* remote-control of automatableModels
|
||||
* remote-control of AutomatableModels
|
||||
*
|
||||
* Copyright (c) 2008 Paul Giblock <drfaygo/at/gmail.com>
|
||||
*
|
||||
@@ -37,19 +37,19 @@
|
||||
|
||||
//const float TWO_PI = 6.28318531f;
|
||||
|
||||
LfoController::LfoController( model * _parent ) :
|
||||
LfoController::LfoController( Model * _parent ) :
|
||||
Controller( Controller::LfoController, _parent, tr( "LFO Controller" ) ),
|
||||
m_baseModel( 0.5, 0.0, 1.0, 0.001, this, tr( "Base value" ) ),
|
||||
m_speedModel( 2.0, 0.01, 20.0, 0.0001, 20000.0, this, tr( "Oscillator speed" ) ),
|
||||
m_amountModel( 1.0, -1.0, 1.0, 0.005, this, tr( "Oscillator amount" ) ),
|
||||
m_phaseModel( 0.0, 0.0, 360.0, 4.0, this, tr( "Oscillator phase" ) ),
|
||||
m_waveModel( oscillator::SineWave, 0, oscillator::NumWaveShapes,
|
||||
m_waveModel( Oscillator::SineWave, 0, Oscillator::NumWaveShapes,
|
||||
this, tr( "Oscillator waveform" ) ),
|
||||
m_multiplierModel( 0, 0, 2, this, tr( "Frequency Multiplier" ) ),
|
||||
m_duration( 1000 ),
|
||||
m_phaseCorrection( 0 ),
|
||||
m_phaseOffset( 0 ),
|
||||
m_sampleFunction( &oscillator::sinSample )
|
||||
m_sampleFunction( &Oscillator::sinSample )
|
||||
{
|
||||
|
||||
connect( &m_waveModel, SIGNAL( dataChanged() ),
|
||||
@@ -175,26 +175,26 @@ void LfoController::updateSampleFunction( void )
|
||||
{
|
||||
switch( m_waveModel.value() )
|
||||
{
|
||||
case oscillator::SineWave:
|
||||
m_sampleFunction = &oscillator::sinSample;
|
||||
case Oscillator::SineWave:
|
||||
m_sampleFunction = &Oscillator::sinSample;
|
||||
break;
|
||||
case oscillator::TriangleWave:
|
||||
m_sampleFunction = &oscillator::triangleSample;
|
||||
case Oscillator::TriangleWave:
|
||||
m_sampleFunction = &Oscillator::triangleSample;
|
||||
break;
|
||||
case oscillator::SawWave:
|
||||
m_sampleFunction = &oscillator::sawSample;
|
||||
case Oscillator::SawWave:
|
||||
m_sampleFunction = &Oscillator::sawSample;
|
||||
break;
|
||||
case oscillator::SquareWave:
|
||||
m_sampleFunction = &oscillator::squareSample;
|
||||
case Oscillator::SquareWave:
|
||||
m_sampleFunction = &Oscillator::squareSample;
|
||||
break;
|
||||
case oscillator::MoogSawWave:
|
||||
m_sampleFunction = &oscillator::moogSawSample;
|
||||
case Oscillator::MoogSawWave:
|
||||
m_sampleFunction = &Oscillator::moogSawSample;
|
||||
break;
|
||||
case oscillator::ExponentialWave:
|
||||
m_sampleFunction = &oscillator::expSample;
|
||||
case Oscillator::ExponentialWave:
|
||||
m_sampleFunction = &Oscillator::expSample;
|
||||
break;
|
||||
case oscillator::WhiteNoise:
|
||||
m_sampleFunction = &oscillator::noiseSample;
|
||||
case Oscillator::WhiteNoise:
|
||||
m_sampleFunction = &Oscillator::noiseSample;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* meter_model.cpp - model for meter specification
|
||||
* MeterModel.cpp - model for meter specification
|
||||
*
|
||||
* Copyright (c) 2008-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* Copyright (c) 2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
@@ -23,11 +23,11 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "meter_model.h"
|
||||
#include "MeterModel.h"
|
||||
|
||||
|
||||
meterModel::meterModel( ::model * _parent ) :
|
||||
model( _parent ),
|
||||
MeterModel::MeterModel( ::Model * _parent ) :
|
||||
Model( _parent ),
|
||||
m_numeratorModel( 4, 1, 32, this, tr( "Numerator" ) ),
|
||||
m_denominatorModel( 4, 1, 32, this, tr( "Denominator" ) )
|
||||
{
|
||||
@@ -40,14 +40,14 @@ meterModel::meterModel( ::model * _parent ) :
|
||||
|
||||
|
||||
|
||||
meterModel::~meterModel()
|
||||
MeterModel::~MeterModel()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void meterModel::reset( void )
|
||||
void MeterModel::reset()
|
||||
{
|
||||
m_numeratorModel.setValue( 4 );
|
||||
m_denominatorModel.setValue( 4 );
|
||||
@@ -56,8 +56,8 @@ void meterModel::reset( void )
|
||||
|
||||
|
||||
|
||||
void meterModel::saveSettings( QDomDocument & _doc, QDomElement & _this,
|
||||
const QString & _name )
|
||||
void MeterModel::saveSettings( QDomDocument & _doc, QDomElement & _this,
|
||||
const QString & _name )
|
||||
{
|
||||
m_numeratorModel.saveSettings( _doc, _this, _name + "_numerator" );
|
||||
m_denominatorModel.saveSettings( _doc, _this, _name + "_denominator" );
|
||||
@@ -66,8 +66,8 @@ void meterModel::saveSettings( QDomDocument & _doc, QDomElement & _this,
|
||||
|
||||
|
||||
|
||||
void meterModel::loadSettings( const QDomElement & _this,
|
||||
const QString & _name )
|
||||
void MeterModel::loadSettings( const QDomElement & _this,
|
||||
const QString & _name )
|
||||
{
|
||||
m_numeratorModel.loadSettings( _this, _name + "_numerator" );
|
||||
m_denominatorModel.loadSettings( _this, _name + "_denominator" );
|
||||
@@ -75,5 +75,5 @@ void meterModel::loadSettings( const QDomElement & _this,
|
||||
|
||||
|
||||
|
||||
#include "moc_meter_model.cxx"
|
||||
#include "moc_MeterModel.cxx"
|
||||
|
||||
50
src/core/Model.cpp
Normal file
50
src/core/Model.cpp
Normal file
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* Model.cpp - implementation of Model base class
|
||||
*
|
||||
* Copyright (c) 2007-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public
|
||||
* License along with this program (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "Model.h"
|
||||
|
||||
|
||||
QString Model::fullDisplayName() const
|
||||
{
|
||||
const QString & n = displayName();
|
||||
if( parentModel() )
|
||||
{
|
||||
const QString p = parentModel()->fullDisplayName();
|
||||
if( n.isEmpty() && p.isEmpty() )
|
||||
{
|
||||
return QString::null;
|
||||
}
|
||||
else if( p.isEmpty() )
|
||||
{
|
||||
return n;
|
||||
}
|
||||
return p + ">" + n;
|
||||
}
|
||||
return n;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#include "moc_Model.cxx"
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* oscillator.cpp - implementation of powerful oscillator-class
|
||||
* Oscillator.cpp - implementation of powerful oscillator-class
|
||||
*
|
||||
* Copyright (c) 2004-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* Copyright (c) 2004-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
@@ -22,21 +22,20 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "oscillator.h"
|
||||
#include "Oscillator.h"
|
||||
#include "engine.h"
|
||||
#include "mixer.h"
|
||||
#include "automatable_model.h"
|
||||
#include "AutomatableModel.h"
|
||||
|
||||
|
||||
|
||||
oscillator::oscillator( const intModel * _wave_shape_model,
|
||||
const intModel * _mod_algo_model,
|
||||
Oscillator::Oscillator( const IntModel * _wave_shape_model,
|
||||
const IntModel * _mod_algo_model,
|
||||
const float & _freq,
|
||||
const float & _detuning,
|
||||
const float & _phase_offset,
|
||||
const float & _volume,
|
||||
oscillator * _sub_osc ) :
|
||||
Oscillator * _sub_osc ) :
|
||||
m_waveShapeModel( _wave_shape_model ),
|
||||
m_modulationAlgoModel( _mod_algo_model ),
|
||||
m_freq( _freq ),
|
||||
@@ -53,7 +52,7 @@ oscillator::oscillator( const intModel * _wave_shape_model,
|
||||
|
||||
|
||||
|
||||
void oscillator::update( sampleFrame * _ab, const fpp_t _frames,
|
||||
void Oscillator::update( sampleFrame * _ab, const fpp_t _frames,
|
||||
const ch_cnt_t _chnl )
|
||||
{
|
||||
if( m_freq >= engine::getMixer()->processingSampleRate() / 2 )
|
||||
@@ -90,7 +89,7 @@ void oscillator::update( sampleFrame * _ab, const fpp_t _frames,
|
||||
|
||||
|
||||
|
||||
void oscillator::updateNoSub( sampleFrame * _ab, const fpp_t _frames,
|
||||
void Oscillator::updateNoSub( sampleFrame * _ab, const fpp_t _frames,
|
||||
const ch_cnt_t _chnl )
|
||||
{
|
||||
switch( m_waveShapeModel->value() )
|
||||
@@ -126,7 +125,7 @@ void oscillator::updateNoSub( sampleFrame * _ab, const fpp_t _frames,
|
||||
|
||||
|
||||
|
||||
void oscillator::updatePM( sampleFrame * _ab, const fpp_t _frames,
|
||||
void Oscillator::updatePM( sampleFrame * _ab, const fpp_t _frames,
|
||||
const ch_cnt_t _chnl )
|
||||
{
|
||||
switch( m_waveShapeModel->value() )
|
||||
@@ -162,7 +161,7 @@ void oscillator::updatePM( sampleFrame * _ab, const fpp_t _frames,
|
||||
|
||||
|
||||
|
||||
void oscillator::updateAM( sampleFrame * _ab, const fpp_t _frames,
|
||||
void Oscillator::updateAM( sampleFrame * _ab, const fpp_t _frames,
|
||||
const ch_cnt_t _chnl )
|
||||
{
|
||||
switch( m_waveShapeModel->value() )
|
||||
@@ -198,7 +197,7 @@ void oscillator::updateAM( sampleFrame * _ab, const fpp_t _frames,
|
||||
|
||||
|
||||
|
||||
void oscillator::updateMix( sampleFrame * _ab, const fpp_t _frames,
|
||||
void Oscillator::updateMix( sampleFrame * _ab, const fpp_t _frames,
|
||||
const ch_cnt_t _chnl )
|
||||
{
|
||||
switch( m_waveShapeModel->value() )
|
||||
@@ -234,7 +233,7 @@ void oscillator::updateMix( sampleFrame * _ab, const fpp_t _frames,
|
||||
|
||||
|
||||
|
||||
void oscillator::updateSync( sampleFrame * _ab, const fpp_t _frames,
|
||||
void Oscillator::updateSync( sampleFrame * _ab, const fpp_t _frames,
|
||||
const ch_cnt_t _chnl )
|
||||
{
|
||||
switch( m_waveShapeModel->value() )
|
||||
@@ -270,7 +269,7 @@ void oscillator::updateSync( sampleFrame * _ab, const fpp_t _frames,
|
||||
|
||||
|
||||
|
||||
void oscillator::updateFM( sampleFrame * _ab, const fpp_t _frames,
|
||||
void Oscillator::updateFM( sampleFrame * _ab, const fpp_t _frames,
|
||||
const ch_cnt_t _chnl )
|
||||
{
|
||||
switch( m_waveShapeModel->value() )
|
||||
@@ -307,7 +306,7 @@ void oscillator::updateFM( sampleFrame * _ab, const fpp_t _frames,
|
||||
|
||||
|
||||
// should be called every time phase-offset is changed...
|
||||
inline void oscillator::recalcPhase( void )
|
||||
inline void Oscillator::recalcPhase( void )
|
||||
{
|
||||
if( !typeInfo<float>::isEqual( m_phaseOffset, m_ext_phaseOffset ) )
|
||||
{
|
||||
@@ -322,7 +321,7 @@ inline void oscillator::recalcPhase( void )
|
||||
|
||||
|
||||
|
||||
inline bool oscillator::syncOk( float _osc_coeff )
|
||||
inline bool Oscillator::syncOk( float _osc_coeff )
|
||||
{
|
||||
const float v1 = m_phase;
|
||||
m_phase += _osc_coeff;
|
||||
@@ -333,7 +332,7 @@ inline bool oscillator::syncOk( float _osc_coeff )
|
||||
|
||||
|
||||
|
||||
float oscillator::syncInit( sampleFrame * _ab, const fpp_t _frames,
|
||||
float Oscillator::syncInit( sampleFrame * _ab, const fpp_t _frames,
|
||||
const ch_cnt_t _chnl )
|
||||
{
|
||||
if( m_subOsc != NULL )
|
||||
@@ -348,8 +347,8 @@ float oscillator::syncInit( sampleFrame * _ab, const fpp_t _frames,
|
||||
|
||||
|
||||
// if we have no sub-osc, we can't do any modulation... just get our samples
|
||||
template<oscillator::WaveShapes W>
|
||||
void oscillator::updateNoSub( sampleFrame * _ab, const fpp_t _frames,
|
||||
template<Oscillator::WaveShapes W>
|
||||
void Oscillator::updateNoSub( sampleFrame * _ab, const fpp_t _frames,
|
||||
const ch_cnt_t _chnl )
|
||||
{
|
||||
recalcPhase();
|
||||
@@ -366,8 +365,8 @@ void oscillator::updateNoSub( sampleFrame * _ab, const fpp_t _frames,
|
||||
|
||||
|
||||
// do pm by using sub-osc as modulator
|
||||
template<oscillator::WaveShapes W>
|
||||
void oscillator::updatePM( sampleFrame * _ab, const fpp_t _frames,
|
||||
template<Oscillator::WaveShapes W>
|
||||
void Oscillator::updatePM( sampleFrame * _ab, const fpp_t _frames,
|
||||
const ch_cnt_t _chnl )
|
||||
{
|
||||
m_subOsc->update( _ab, _frames, _chnl );
|
||||
@@ -387,8 +386,8 @@ void oscillator::updatePM( sampleFrame * _ab, const fpp_t _frames,
|
||||
|
||||
|
||||
// do am by using sub-osc as modulator
|
||||
template<oscillator::WaveShapes W>
|
||||
void oscillator::updateAM( sampleFrame * _ab, const fpp_t _frames,
|
||||
template<Oscillator::WaveShapes W>
|
||||
void Oscillator::updateAM( sampleFrame * _ab, const fpp_t _frames,
|
||||
const ch_cnt_t _chnl )
|
||||
{
|
||||
m_subOsc->update( _ab, _frames, _chnl );
|
||||
@@ -406,8 +405,8 @@ void oscillator::updateAM( sampleFrame * _ab, const fpp_t _frames,
|
||||
|
||||
|
||||
// do mix by using sub-osc as mix-sample
|
||||
template<oscillator::WaveShapes W>
|
||||
void oscillator::updateMix( sampleFrame * _ab, const fpp_t _frames,
|
||||
template<Oscillator::WaveShapes W>
|
||||
void Oscillator::updateMix( sampleFrame * _ab, const fpp_t _frames,
|
||||
const ch_cnt_t _chnl )
|
||||
{
|
||||
m_subOsc->update( _ab, _frames, _chnl );
|
||||
@@ -426,8 +425,8 @@ void oscillator::updateMix( sampleFrame * _ab, const fpp_t _frames,
|
||||
|
||||
// sync with sub-osc (every time sub-osc starts new period, we also start new
|
||||
// period)
|
||||
template<oscillator::WaveShapes W>
|
||||
void oscillator::updateSync( sampleFrame * _ab, const fpp_t _frames,
|
||||
template<Oscillator::WaveShapes W>
|
||||
void Oscillator::updateSync( sampleFrame * _ab, const fpp_t _frames,
|
||||
const ch_cnt_t _chnl )
|
||||
{
|
||||
const float sub_osc_coeff = m_subOsc->syncInit( _ab, _frames, _chnl );
|
||||
@@ -449,8 +448,8 @@ void oscillator::updateSync( sampleFrame * _ab, const fpp_t _frames,
|
||||
|
||||
|
||||
// do fm by using sub-osc as modulator
|
||||
template<oscillator::WaveShapes W>
|
||||
void oscillator::updateFM( sampleFrame * _ab, const fpp_t _frames,
|
||||
template<Oscillator::WaveShapes W>
|
||||
void Oscillator::updateFM( sampleFrame * _ab, const fpp_t _frames,
|
||||
const ch_cnt_t _chnl )
|
||||
{
|
||||
m_subOsc->update( _ab, _frames, _chnl );
|
||||
@@ -471,7 +470,7 @@ void oscillator::updateFM( sampleFrame * _ab, const fpp_t _frames,
|
||||
|
||||
|
||||
template<>
|
||||
inline sample_t oscillator::getSample<oscillator::SineWave>(
|
||||
inline sample_t Oscillator::getSample<Oscillator::SineWave>(
|
||||
const float _sample )
|
||||
{
|
||||
return( sinSample( _sample ) );
|
||||
@@ -481,7 +480,7 @@ inline sample_t oscillator::getSample<oscillator::SineWave>(
|
||||
|
||||
|
||||
template<>
|
||||
inline sample_t oscillator::getSample<oscillator::TriangleWave>(
|
||||
inline sample_t Oscillator::getSample<Oscillator::TriangleWave>(
|
||||
const float _sample )
|
||||
{
|
||||
return( triangleSample( _sample ) );
|
||||
@@ -491,7 +490,7 @@ inline sample_t oscillator::getSample<oscillator::TriangleWave>(
|
||||
|
||||
|
||||
template<>
|
||||
inline sample_t oscillator::getSample<oscillator::SawWave>(
|
||||
inline sample_t Oscillator::getSample<Oscillator::SawWave>(
|
||||
const float _sample )
|
||||
{
|
||||
return( sawSample( _sample ) );
|
||||
@@ -501,7 +500,7 @@ inline sample_t oscillator::getSample<oscillator::SawWave>(
|
||||
|
||||
|
||||
template<>
|
||||
inline sample_t oscillator::getSample<oscillator::SquareWave>(
|
||||
inline sample_t Oscillator::getSample<Oscillator::SquareWave>(
|
||||
const float _sample )
|
||||
{
|
||||
return( squareSample( _sample ) );
|
||||
@@ -511,7 +510,7 @@ inline sample_t oscillator::getSample<oscillator::SquareWave>(
|
||||
|
||||
|
||||
template<>
|
||||
inline sample_t oscillator::getSample<oscillator::MoogSawWave>(
|
||||
inline sample_t Oscillator::getSample<Oscillator::MoogSawWave>(
|
||||
const float _sample )
|
||||
{
|
||||
return( moogSawSample( _sample ) );
|
||||
@@ -521,7 +520,7 @@ inline sample_t oscillator::getSample<oscillator::MoogSawWave>(
|
||||
|
||||
|
||||
template<>
|
||||
inline sample_t oscillator::getSample<oscillator::ExponentialWave>(
|
||||
inline sample_t Oscillator::getSample<Oscillator::ExponentialWave>(
|
||||
const float _sample )
|
||||
{
|
||||
return( expSample( _sample ) );
|
||||
@@ -531,7 +530,7 @@ inline sample_t oscillator::getSample<oscillator::ExponentialWave>(
|
||||
|
||||
|
||||
template<>
|
||||
inline sample_t oscillator::getSample<oscillator::WhiteNoise>(
|
||||
inline sample_t Oscillator::getSample<Oscillator::WhiteNoise>(
|
||||
const float _sample )
|
||||
{
|
||||
return( noiseSample( _sample ) );
|
||||
@@ -541,7 +540,7 @@ inline sample_t oscillator::getSample<oscillator::WhiteNoise>(
|
||||
|
||||
|
||||
template<>
|
||||
inline sample_t oscillator::getSample<oscillator::UserDefinedWave>(
|
||||
inline sample_t Oscillator::getSample<Oscillator::UserDefinedWave>(
|
||||
const float _sample )
|
||||
{
|
||||
return( userWaveSample( _sample ) );
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* PeakController.cpp - implementation of class controller which handles
|
||||
* remote-control of automatableModels
|
||||
* remote-control of AutomatableModels
|
||||
*
|
||||
* Copyright (c) 2008 Paul Giblock <drfaygo/at/gmail.com>
|
||||
*
|
||||
@@ -38,11 +38,11 @@
|
||||
#include "plugins/peak_controller_effect/peak_controller_effect.h"
|
||||
|
||||
int PeakController::s_lastEffectId = 0;
|
||||
peakControllerEffectVector PeakController::s_effects;
|
||||
PeakControllerEffectVector PeakController::s_effects;
|
||||
|
||||
|
||||
PeakController::PeakController( model * _parent,
|
||||
peakControllerEffect * _peak_effect ) :
|
||||
PeakController::PeakController( Model * _parent,
|
||||
PeakControllerEffect * _peak_effect ) :
|
||||
Controller( Controller::PeakController, _parent, tr( "Peak Controller" ) ),
|
||||
m_peakEffect( _peak_effect )
|
||||
{
|
||||
@@ -102,12 +102,11 @@ void PeakController::loadSettings( const QDomElement & _this )
|
||||
{
|
||||
int effectId = _this.attribute( "effectId" ).toInt();
|
||||
|
||||
peakControllerEffectVector::iterator i;
|
||||
PeakControllerEffectVector::Iterator i;
|
||||
for( i = s_effects.begin(); i != s_effects.end(); ++i )
|
||||
{
|
||||
if( (*i)->m_effectId == effectId )
|
||||
{
|
||||
if( (*i)->m_effectId == effectId )
|
||||
m_peakEffect = *i;
|
||||
return;
|
||||
}
|
||||
@@ -116,7 +115,7 @@ void PeakController::loadSettings( const QDomElement & _this )
|
||||
|
||||
|
||||
|
||||
QString PeakController::nodeName( void ) const
|
||||
QString PeakController::nodeName() const
|
||||
{
|
||||
return( "Peakcontroller" );
|
||||
}
|
||||
|
||||
117
src/core/Piano.cpp
Normal file
117
src/core/Piano.cpp
Normal file
@@ -0,0 +1,117 @@
|
||||
/*
|
||||
* Piano.cpp - implementation of piano-widget used in instrument-track-window
|
||||
* for testing + according model class
|
||||
*
|
||||
* Copyright (c) 2004-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public
|
||||
* License along with this program (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*
|
||||
*/
|
||||
|
||||
/** \file Piano.cpp
|
||||
* \brief A piano keyboard to play notes on in the instrument plugin window.
|
||||
*/
|
||||
|
||||
/*
|
||||
* \mainpage Instrument plugin keyboard display classes
|
||||
*
|
||||
* \section introduction Introduction
|
||||
*
|
||||
* \todo fill this out
|
||||
* \todo write isWhite inline function and replace throughout
|
||||
*/
|
||||
|
||||
#include "Piano.h"
|
||||
#include "InstrumentTrack.h"
|
||||
#include "MidiEventProcessor.h"
|
||||
|
||||
|
||||
/*! \brief Create a new keyboard display
|
||||
*
|
||||
* \param _it the InstrumentTrack window to attach to
|
||||
*/
|
||||
Piano::Piano( InstrumentTrack * _it ) :
|
||||
Model( NULL ), /*!< base class ctor */
|
||||
m_instrumentTrack( _it ),
|
||||
m_midiEvProc( _it ) /*!< the InstrumentTrack Model */
|
||||
{
|
||||
for( int i = 0; i < NumKeys; ++i )
|
||||
{
|
||||
m_pressedKeys[i] = false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*! \brief Destroy this new keyboard display
|
||||
*
|
||||
*/
|
||||
Piano::~Piano()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*! \brief Turn a key on or off
|
||||
*
|
||||
* \param _key the key number to change
|
||||
* \param _on the state to set the key to
|
||||
*/
|
||||
void Piano::setKeyState( int _key, bool _on )
|
||||
{
|
||||
m_pressedKeys[tLimit( _key, 0, NumKeys-1 )] = _on;
|
||||
emit dataChanged();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*! \brief Handle a note being pressed on our keyboard display
|
||||
*
|
||||
* \param _key the key being pressed
|
||||
*/
|
||||
void Piano::handleKeyPress( int _key )
|
||||
{
|
||||
m_midiEvProc->processInEvent( midiEvent( MidiNoteOn, 0, _key,
|
||||
MidiMaxVelocity ), midiTime() );
|
||||
m_pressedKeys[_key] = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*! \brief Handle a note being released on our keyboard display
|
||||
*
|
||||
* \param _key the key being releassed
|
||||
*/
|
||||
void Piano::handleKeyRelease( int _key )
|
||||
{
|
||||
m_midiEvProc->processInEvent( midiEvent( MidiNoteOff, 0, _key, 0 ),
|
||||
midiTime() );
|
||||
m_pressedKeys[_key] = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#include "moc_Piano.cxx"
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
#ifndef SINGLE_SOURCE_COMPILE
|
||||
|
||||
/*
|
||||
* plugin.cpp - implementation of plugin-class including plugin-loader
|
||||
* Plugin.cpp - implementation of plugin-class including plugin-loader
|
||||
*
|
||||
* Copyright (c) 2005-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
@@ -24,31 +24,29 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include <QtCore/QDir>
|
||||
#include <QtCore/QLibrary>
|
||||
#include <QtGui/QMessageBox>
|
||||
|
||||
|
||||
#include "plugin.h"
|
||||
#include "Plugin.h"
|
||||
#include "embed.h"
|
||||
#include "engine.h"
|
||||
#include "mixer.h"
|
||||
#include "config_mgr.h"
|
||||
#include "dummy_plugin.h"
|
||||
#include "automatable_model.h"
|
||||
#include "DummyPlugin.h"
|
||||
#include "AutomatableModel.h"
|
||||
|
||||
|
||||
static pixmapLoader __dummy_loader;
|
||||
static PixmapLoader __dummy_loader;
|
||||
|
||||
static plugin::descriptor dummy_plugin_descriptor =
|
||||
static Plugin::Descriptor dummy_plugin_descriptor =
|
||||
{
|
||||
"dummy",
|
||||
"dummy",
|
||||
QT_TRANSLATE_NOOP( "pluginBrowser", "no description" ),
|
||||
"Tobias Doerffel <tobydox/at/users.sf.net>",
|
||||
0x0100,
|
||||
plugin::Undefined,
|
||||
Plugin::Undefined,
|
||||
&__dummy_loader,
|
||||
NULL
|
||||
} ;
|
||||
@@ -56,9 +54,9 @@ static plugin::descriptor dummy_plugin_descriptor =
|
||||
|
||||
|
||||
|
||||
plugin::plugin( const descriptor * _descriptor, model * _parent ) :
|
||||
journallingObject(),
|
||||
model( _parent ),
|
||||
Plugin::Plugin( const Descriptor * _descriptor, Model * _parent ) :
|
||||
JournallingObject(),
|
||||
Model( _parent ),
|
||||
m_descriptor( _descriptor )
|
||||
{
|
||||
if( m_descriptor == NULL )
|
||||
@@ -70,30 +68,30 @@ plugin::plugin( const descriptor * _descriptor, model * _parent ) :
|
||||
|
||||
|
||||
|
||||
plugin::~plugin()
|
||||
Plugin::~Plugin()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void plugin::loadFile( const QString & )
|
||||
void Plugin::loadFile( const QString & )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
automatableModel * plugin::getChildModel( const QString & )
|
||||
AutomatableModel * Plugin::childModel( const QString & )
|
||||
{
|
||||
static floatModel fm;
|
||||
static FloatModel fm;
|
||||
return &fm;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
plugin * plugin::instantiate( const QString & _plugin_name, model * _parent,
|
||||
Plugin * Plugin::instantiate( const QString & _plugin_name, Model * _parent,
|
||||
void * _data )
|
||||
{
|
||||
QLibrary plugin_lib( configManager::inst()->pluginDir() +
|
||||
@@ -111,7 +109,7 @@ plugin * plugin::instantiate( const QString & _plugin_name, model * _parent,
|
||||
QMessageBox::Ok |
|
||||
QMessageBox::Default );
|
||||
}
|
||||
return( new dummyPlugin() );
|
||||
return new DummyPlugin();
|
||||
}
|
||||
instantiationHook inst_hook = ( instantiationHook ) plugin_lib.resolve(
|
||||
"lmms_plugin_main" );
|
||||
@@ -126,16 +124,16 @@ plugin * plugin::instantiate( const QString & _plugin_name, model * _parent,
|
||||
QMessageBox::Ok |
|
||||
QMessageBox::Default );
|
||||
}
|
||||
return( new dummyPlugin() );
|
||||
return new DummyPlugin();
|
||||
}
|
||||
plugin * inst = inst_hook( _parent, _data );
|
||||
Plugin * inst = inst_hook( _parent, _data );
|
||||
return inst;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void plugin::getDescriptorsOfAvailPlugins( QVector<descriptor> & _plugin_descs )
|
||||
void Plugin::getDescriptorsOfAvailPlugins( QVector<Descriptor> & _plugin_descs )
|
||||
{
|
||||
QDir directory( configManager::inst()->pluginDir() );
|
||||
#ifdef LMMS_BUILD_WIN32
|
||||
@@ -164,13 +162,13 @@ void plugin::getDescriptorsOfAvailPlugins( QVector<descriptor> & _plugin_descs )
|
||||
{
|
||||
desc_name = desc_name.mid( 3 );
|
||||
}
|
||||
descriptor * plugin_desc =
|
||||
(descriptor *) plugin_lib.resolve(
|
||||
Descriptor * plugin_desc =
|
||||
(Descriptor *) plugin_lib.resolve(
|
||||
desc_name.toUtf8().constData() );
|
||||
if( plugin_desc == NULL )
|
||||
{
|
||||
printf( "LMMS-plugin %s does not have a "
|
||||
"plugin-descriptor named %s!\n",
|
||||
printf( "LMMS plugin %s does not have a "
|
||||
"plugin descriptor named %s!\n",
|
||||
f.absoluteFilePath().toUtf8().constData(),
|
||||
desc_name.toUtf8().constData() );
|
||||
continue;
|
||||
@@ -183,9 +181,9 @@ void plugin::getDescriptorsOfAvailPlugins( QVector<descriptor> & _plugin_descs )
|
||||
|
||||
|
||||
|
||||
pluginView * plugin::createView( QWidget * _parent )
|
||||
PluginView * Plugin::createView( QWidget * _parent )
|
||||
{
|
||||
pluginView * pv = instantiateView( _parent );
|
||||
PluginView * pv = instantiateView( _parent );
|
||||
if( pv != NULL )
|
||||
{
|
||||
pv->setModel( this );
|
||||
@@ -195,7 +193,7 @@ pluginView * plugin::createView( QWidget * _parent )
|
||||
|
||||
|
||||
|
||||
plugin::descriptor::subPluginFeatures::key::key(
|
||||
Plugin::Descriptor::SubPluginFeatures::Key::Key(
|
||||
const QDomElement & _key ) :
|
||||
desc( NULL ),
|
||||
name( _key.attribute( "key" ) ),
|
||||
@@ -213,12 +211,12 @@ plugin::descriptor::subPluginFeatures::key::key(
|
||||
|
||||
|
||||
|
||||
QDomElement plugin::descriptor::subPluginFeatures::key::saveXML(
|
||||
QDomElement Plugin::Descriptor::SubPluginFeatures::Key::saveXML(
|
||||
QDomDocument & _doc ) const
|
||||
{
|
||||
QDomElement e = _doc.createElement( "key" );
|
||||
for( attributeMap::const_iterator it = attributes.begin();
|
||||
it != attributes.end(); ++it )
|
||||
for( AttributeMap::ConstIterator it = attributes.begin();
|
||||
it != attributes.end(); ++it )
|
||||
{
|
||||
QDomElement a = _doc.createElement( "attribute" );
|
||||
a.setAttribute( "name", it.key() );
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* project_journal.cpp - implementation of project-journal
|
||||
* ProjectJournal.cpp - implementation of ProjectJournal
|
||||
*
|
||||
* Copyright (c) 2006-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* Copyright (c) 2006-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
@@ -22,41 +22,40 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include <cstdlib>
|
||||
|
||||
#include "project_journal.h"
|
||||
#include "ProjectJournal.h"
|
||||
#include "engine.h"
|
||||
#include "journalling_object.h"
|
||||
#include "JournallingObject.h"
|
||||
#include "song.h"
|
||||
|
||||
|
||||
projectJournal::projectJournal( void ) :
|
||||
ProjectJournal::ProjectJournal() :
|
||||
m_joIDs(),
|
||||
m_journalEntries(),
|
||||
m_currentJournalEntry( m_journalEntries.end() ),
|
||||
m_journalling( FALSE )
|
||||
m_journalling( false )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
projectJournal::~projectJournal()
|
||||
ProjectJournal::~ProjectJournal()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void projectJournal::undo( void )
|
||||
void ProjectJournal::undo()
|
||||
{
|
||||
if( m_journalEntries.empty() == TRUE )
|
||||
if( m_journalEntries.empty() == true )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
journallingObject * jo;
|
||||
JournallingObject * jo;
|
||||
|
||||
if( m_currentJournalEntry - 1 >= m_journalEntries.begin() &&
|
||||
( jo = m_joIDs[*--m_currentJournalEntry] ) != NULL )
|
||||
@@ -69,14 +68,14 @@ void projectJournal::undo( void )
|
||||
|
||||
|
||||
|
||||
void projectJournal::redo( void )
|
||||
void ProjectJournal::redo()
|
||||
{
|
||||
if( m_journalEntries.empty() == TRUE )
|
||||
if( m_journalEntries.empty() == true )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
journallingObject * jo;
|
||||
JournallingObject * jo;
|
||||
|
||||
//printf("%d\n", m_joIDs[*(m_currentJournalEntry+1)] );
|
||||
if( m_currentJournalEntry < m_journalEntries.end() &&
|
||||
@@ -90,7 +89,7 @@ void projectJournal::redo( void )
|
||||
|
||||
|
||||
|
||||
void projectJournal::journalEntryAdded( const jo_id_t _id )
|
||||
void ProjectJournal::journalEntryAdded( const jo_id_t _id )
|
||||
{
|
||||
m_journalEntries.erase( m_currentJournalEntry, m_journalEntries.end() );
|
||||
m_journalEntries.push_back( _id );
|
||||
@@ -101,7 +100,7 @@ void projectJournal::journalEntryAdded( const jo_id_t _id )
|
||||
|
||||
|
||||
|
||||
jo_id_t projectJournal::allocID( journallingObject * _obj )
|
||||
jo_id_t ProjectJournal::allocID( JournallingObject * _obj )
|
||||
{
|
||||
const jo_id_t EO_ID_MAX = (1 << 23)-1;
|
||||
jo_id_t id;
|
||||
@@ -113,13 +112,13 @@ jo_id_t projectJournal::allocID( journallingObject * _obj )
|
||||
|
||||
m_joIDs[id] = _obj;
|
||||
//printf("new id: %d\n", id );
|
||||
return( id );
|
||||
return id;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void projectJournal::reallocID( const jo_id_t _id, journallingObject * _obj )
|
||||
void ProjectJournal::reallocID( const jo_id_t _id, JournallingObject * _obj )
|
||||
{
|
||||
//printf("realloc %d %d\n", _id, _obj );
|
||||
// if( m_joIDs.contains( _id ) )
|
||||
@@ -131,10 +130,10 @@ void projectJournal::reallocID( const jo_id_t _id, journallingObject * _obj )
|
||||
|
||||
|
||||
|
||||
void projectJournal::forgetAboutID( const jo_id_t _id )
|
||||
void ProjectJournal::forgetAboutID( const jo_id_t _id )
|
||||
{
|
||||
//printf("forget about %d\n", _id );
|
||||
journalEntryVector::iterator it;
|
||||
JournalEntryVector::Iterator it;
|
||||
while( ( it = qFind( m_journalEntries.begin(), m_journalEntries.end(),
|
||||
_id ) ) != m_journalEntries.end() )
|
||||
{
|
||||
@@ -150,11 +149,11 @@ void projectJournal::forgetAboutID( const jo_id_t _id )
|
||||
|
||||
|
||||
|
||||
void projectJournal::clearJournal( void )
|
||||
void ProjectJournal::clearJournal()
|
||||
{
|
||||
m_journalEntries.clear();
|
||||
m_currentJournalEntry = m_journalEntries.end();
|
||||
for( joIDMap::iterator it = m_joIDs.begin(); it != m_joIDs.end(); )
|
||||
for( JoIdMap::Iterator it = m_joIDs.begin(); it != m_joIDs.end(); )
|
||||
{
|
||||
if( it.value() == NULL )
|
||||
{
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* remote_plugin.cpp - base class providing RPC like mechanisms
|
||||
* RemotePlugin.cpp - base class providing RPC like mechanisms
|
||||
*
|
||||
* Copyright (c) 2008-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
#define COMPILE_REMOTE_PLUGIN_BASE
|
||||
|
||||
#include "remote_plugin.h"
|
||||
#include "RemotePlugin.h"
|
||||
#include "mixer.h"
|
||||
#include "engine.h"
|
||||
#include "config_mgr.h"
|
||||
@@ -42,9 +42,9 @@
|
||||
#endif
|
||||
|
||||
|
||||
// simple helper thread monitoring our remotePlugin - if process terminates
|
||||
// simple helper thread monitoring our RemotePlugin - if process terminates
|
||||
// unexpectedly invalidate plugin so LMMS doesn't lock up
|
||||
processWatcher::processWatcher( remotePlugin * _p ) :
|
||||
ProcessWatcher::ProcessWatcher( RemotePlugin * _p ) :
|
||||
QThread(),
|
||||
m_plugin( _p ),
|
||||
m_quit( false )
|
||||
@@ -52,7 +52,7 @@ processWatcher::processWatcher( remotePlugin * _p ) :
|
||||
}
|
||||
|
||||
|
||||
void processWatcher::run( void )
|
||||
void ProcessWatcher::run()
|
||||
{
|
||||
while( !m_quit && m_plugin->isRunning() )
|
||||
{
|
||||
@@ -70,9 +70,9 @@ void processWatcher::run( void )
|
||||
|
||||
|
||||
|
||||
remotePlugin::remotePlugin( const QString & _plugin_executable,
|
||||
RemotePlugin::RemotePlugin( const QString & _plugin_executable,
|
||||
bool _wait_for_init_done ) :
|
||||
remotePluginBase( new shmFifo(), new shmFifo() ),
|
||||
RemotePluginBase( new shmFifo(), new shmFifo() ),
|
||||
m_failed( true ),
|
||||
m_watcher( this ),
|
||||
m_commMutex( QMutex::Recursive ),
|
||||
@@ -115,7 +115,7 @@ remotePlugin::remotePlugin( const QString & _plugin_executable,
|
||||
|
||||
|
||||
|
||||
remotePlugin::~remotePlugin()
|
||||
RemotePlugin::~RemotePlugin()
|
||||
{
|
||||
m_watcher.quit();
|
||||
m_watcher.wait();
|
||||
@@ -147,7 +147,7 @@ remotePlugin::~remotePlugin()
|
||||
|
||||
|
||||
|
||||
bool remotePlugin::process( const sampleFrame * _in_buf,
|
||||
bool RemotePlugin::process( const sampleFrame * _in_buf,
|
||||
sampleFrame * _out_buf )
|
||||
{
|
||||
const fpp_t frames = engine::getMixer()->framesPerPeriod();
|
||||
@@ -270,7 +270,7 @@ bool remotePlugin::process( const sampleFrame * _in_buf,
|
||||
|
||||
|
||||
|
||||
void remotePlugin::processMidiEvent( const midiEvent & _e,
|
||||
void RemotePlugin::processMidiEvent( const midiEvent & _e,
|
||||
const f_cnt_t _offset )
|
||||
{
|
||||
message m( IdMidiEvent );
|
||||
@@ -287,7 +287,7 @@ void remotePlugin::processMidiEvent( const midiEvent & _e,
|
||||
|
||||
|
||||
|
||||
void remotePlugin::resizeSharedProcessingMemory( void )
|
||||
void RemotePlugin::resizeSharedProcessingMemory()
|
||||
{
|
||||
const size_t s = ( m_inputCount+m_outputCount ) *
|
||||
engine::getMixer()->framesPerPeriod() *
|
||||
@@ -327,7 +327,7 @@ void remotePlugin::resizeSharedProcessingMemory( void )
|
||||
|
||||
|
||||
|
||||
bool remotePlugin::processMessage( const message & _m )
|
||||
bool RemotePlugin::processMessage( const message & _m )
|
||||
{
|
||||
lock();
|
||||
message reply_message( _m.id );
|
||||
@@ -343,14 +343,12 @@ bool remotePlugin::processMessage( const message & _m )
|
||||
|
||||
case IdSampleRateInformation:
|
||||
reply = true;
|
||||
reply_message.addInt(
|
||||
engine::getMixer()->processingSampleRate() );
|
||||
reply_message.addInt( engine::getMixer()->processingSampleRate() );
|
||||
break;
|
||||
|
||||
case IdBufferSizeInformation:
|
||||
reply = true;
|
||||
reply_message.addInt(
|
||||
engine::getMixer()->framesPerPeriod() );
|
||||
reply_message.addInt( engine::getMixer()->framesPerPeriod() );
|
||||
break;
|
||||
|
||||
case IdChangeInputCount:
|
||||
@@ -385,5 +383,5 @@ bool remotePlugin::processMessage( const message & _m )
|
||||
|
||||
|
||||
|
||||
#include "moc_remote_plugin.cxx"
|
||||
#include "moc_RemotePlugin.cxx"
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* serializing_object.cpp - implementation of serializingObject
|
||||
* SerializingObject.cpp - implementation of SerializingObject
|
||||
*
|
||||
* Copyright (c) 2008-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* Copyright (c) 2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
@@ -22,14 +22,13 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include <QtXml/QDomElement>
|
||||
|
||||
#include "serializing_object.h"
|
||||
#include "SerializingObject.h"
|
||||
|
||||
|
||||
|
||||
serializingObject::serializingObject( void ) :
|
||||
SerializingObject::SerializingObject() :
|
||||
m_hook( NULL )
|
||||
{
|
||||
}
|
||||
@@ -37,7 +36,7 @@ serializingObject::serializingObject( void ) :
|
||||
|
||||
|
||||
|
||||
serializingObject::~serializingObject()
|
||||
SerializingObject::~SerializingObject()
|
||||
{
|
||||
if( m_hook )
|
||||
{
|
||||
@@ -48,7 +47,7 @@ serializingObject::~serializingObject()
|
||||
|
||||
|
||||
|
||||
QDomElement serializingObject::saveState( QDomDocument & _doc,
|
||||
QDomElement SerializingObject::saveState( QDomDocument & _doc,
|
||||
QDomElement & _parent )
|
||||
{
|
||||
QDomElement _this = _doc.createElement( nodeName() );
|
||||
@@ -58,13 +57,13 @@ QDomElement serializingObject::saveState( QDomDocument & _doc,
|
||||
{
|
||||
getHook()->saveSettings( _doc, _this );
|
||||
}
|
||||
return( _this );
|
||||
return _this;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void serializingObject::restoreState( const QDomElement & _this )
|
||||
void SerializingObject::restoreState( const QDomElement & _this )
|
||||
{
|
||||
loadSettings( _this );
|
||||
if( getHook() )
|
||||
@@ -76,7 +75,7 @@ void serializingObject::restoreState( const QDomElement & _this )
|
||||
|
||||
|
||||
|
||||
void serializingObject::setHook( serializingObjectHook * _hook )
|
||||
void SerializingObject::setHook( SerializingObjectHook * _hook )
|
||||
{
|
||||
if( m_hook )
|
||||
{
|
||||
@@ -92,7 +91,7 @@ void serializingObject::setHook( serializingObjectHook * _hook )
|
||||
|
||||
|
||||
|
||||
void serializingObject::saveSettings( QDomDocument &/* _doc*/,
|
||||
void SerializingObject::saveSettings( QDomDocument &/* _doc*/,
|
||||
QDomElement &/* _this*/ )
|
||||
{
|
||||
}
|
||||
@@ -100,7 +99,7 @@ void serializingObject::saveSettings( QDomDocument &/* _doc*/,
|
||||
|
||||
|
||||
|
||||
void serializingObject::loadSettings( const QDomElement & /* _this*/ )
|
||||
void SerializingObject::loadSettings( const QDomElement & /* _this*/ )
|
||||
{
|
||||
}
|
||||
|
||||
186
src/core/TempoSyncKnobModel.cpp
Normal file
186
src/core/TempoSyncKnobModel.cpp
Normal file
@@ -0,0 +1,186 @@
|
||||
/*
|
||||
* TempoSyncKnobModel.cpp - adds bpm to ms conversion for knob class
|
||||
*
|
||||
* Copyright (c) 2005-2007 Danny McRae <khjklujn/at/yahoo.com>
|
||||
* Copyright (c) 2005-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public
|
||||
* License along with this program (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <QtGui/QAction>
|
||||
#include <QtXml/QDomElement>
|
||||
|
||||
#include "TempoSyncKnobModel.h"
|
||||
#include "engine.h"
|
||||
#include "song.h"
|
||||
|
||||
|
||||
TempoSyncKnobModel::TempoSyncKnobModel( const float _val, const float _min,
|
||||
const float _max, const float _step,
|
||||
const float _scale, Model * _parent,
|
||||
const QString & _display_name ) :
|
||||
FloatModel( _val, _min, _max, _step, _parent, _display_name ),
|
||||
m_tempoSyncMode( SyncNone ),
|
||||
m_tempoLastSyncMode( SyncNone ),
|
||||
m_scale( _scale ),
|
||||
m_custom( _parent )
|
||||
{
|
||||
connect( engine::getSong(), SIGNAL( tempoChanged( bpm_t ) ),
|
||||
this, SLOT( calculateTempoSyncTime( bpm_t ) ) );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
TempoSyncKnobModel::~TempoSyncKnobModel()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void TempoSyncKnobModel::setTempoSync( QAction * _item )
|
||||
{
|
||||
setTempoSync( _item->data().toInt() );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void TempoSyncKnobModel::setTempoSync( int _note_type )
|
||||
{
|
||||
setSyncMode( ( TempoSyncMode ) _note_type );
|
||||
engine::getSong()->setModified();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void TempoSyncKnobModel::calculateTempoSyncTime( bpm_t _bpm )
|
||||
{
|
||||
float conversionFactor = 1.0;
|
||||
|
||||
if( m_tempoSyncMode )
|
||||
{
|
||||
switch( m_tempoSyncMode )
|
||||
{
|
||||
case SyncCustom:
|
||||
conversionFactor =
|
||||
static_cast<float>( m_custom.getDenominator() ) /
|
||||
static_cast<float>( m_custom.getNumerator() );
|
||||
break;
|
||||
case SyncDoubleWholeNote:
|
||||
conversionFactor = 0.125;
|
||||
break;
|
||||
case SyncWholeNote:
|
||||
conversionFactor = 0.25;
|
||||
break;
|
||||
case SyncHalfNote:
|
||||
conversionFactor = 0.5;
|
||||
break;
|
||||
case SyncQuarterNote:
|
||||
conversionFactor = 1.0;
|
||||
break;
|
||||
case SyncEighthNote:
|
||||
conversionFactor = 2.0;
|
||||
break;
|
||||
case SyncSixteenthNote:
|
||||
conversionFactor = 4.0;
|
||||
break;
|
||||
case SyncThirtysecondNote:
|
||||
conversionFactor = 8.0;
|
||||
break;
|
||||
default: ;
|
||||
}
|
||||
bool journalling = testAndSetJournalling( FALSE );
|
||||
float oneUnit = 60000.0 / ( _bpm * conversionFactor * m_scale );
|
||||
setValue( oneUnit * maxValue() );
|
||||
setJournalling( journalling );
|
||||
}
|
||||
|
||||
if( m_tempoSyncMode != m_tempoLastSyncMode )
|
||||
{
|
||||
emit syncModeChanged( m_tempoSyncMode );
|
||||
m_tempoLastSyncMode = m_tempoSyncMode;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void TempoSyncKnobModel::saveSettings( QDomDocument & _doc, QDomElement & _this,
|
||||
const QString & _name )
|
||||
{
|
||||
_this.setAttribute( "syncmode", (int) syncMode() );
|
||||
m_custom.saveSettings( _doc, _this, _name );
|
||||
FloatModel::saveSettings( _doc, _this, _name );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void TempoSyncKnobModel::loadSettings( const QDomElement & _this,
|
||||
const QString & _name )
|
||||
{
|
||||
setSyncMode( ( TempoSyncMode ) _this.attribute( "syncmode" ).toInt() );
|
||||
m_custom.loadSettings( _this, _name );
|
||||
FloatModel::loadSettings( _this, _name );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void TempoSyncKnobModel::setSyncMode( TempoSyncMode _new_mode )
|
||||
{
|
||||
if( m_tempoSyncMode != _new_mode )
|
||||
{
|
||||
m_tempoSyncMode = _new_mode;
|
||||
if( _new_mode == SyncCustom )
|
||||
{
|
||||
connect( &m_custom, SIGNAL( dataChanged() ),
|
||||
this, SLOT( updateCustom() ) );
|
||||
}
|
||||
}
|
||||
calculateTempoSyncTime( engine::getSong()->getTempo() );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void TempoSyncKnobModel::setScale( float _new_scale )
|
||||
{
|
||||
m_scale = _new_scale;
|
||||
calculateTempoSyncTime( engine::getSong()->getTempo() );
|
||||
emit scaleChanged( _new_scale );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void TempoSyncKnobModel::updateCustom()
|
||||
{
|
||||
setSyncMode( SyncCustom );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#include "moc_TempoSyncKnobModel.cxx"
|
||||
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
/*
|
||||
* tool.cpp - base class for all tool plugins (graphs, extensions, etc)
|
||||
* ToolPlugin.cpp - base class for all tool plugins (graphs, extensions, etc)
|
||||
*
|
||||
* Copyright (c) 2006-2008 Javier Serrano Polo <jasp00/at/users.sourceforge.net>
|
||||
*
|
||||
* Copyright (c) 2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
@@ -22,61 +23,36 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "tool.h"
|
||||
|
||||
#include <QtGui/QIcon>
|
||||
#include <QtGui/QMdiArea>
|
||||
|
||||
#include "embed.h"
|
||||
#include "engine.h"
|
||||
#include "main_window.h"
|
||||
#include "ToolPlugin.h"
|
||||
|
||||
|
||||
|
||||
|
||||
tool::tool( const descriptor * _descriptor, model * _parent ) :
|
||||
plugin( _descriptor, _parent )
|
||||
ToolPlugin::ToolPlugin( const Descriptor * _descriptor, Model * _parent ) :
|
||||
Plugin( _descriptor, _parent )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
tool::~tool()
|
||||
ToolPlugin::~ToolPlugin()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
tool * tool::instantiate( const QString & _plugin_name, model * _parent )
|
||||
ToolPlugin * ToolPlugin::instantiate( const QString & _plugin_name, Model * _parent )
|
||||
{
|
||||
plugin * p = plugin::instantiate( _plugin_name, _parent, NULL );
|
||||
Plugin * p = Plugin::instantiate( _plugin_name, _parent, NULL );
|
||||
// check whether instantiated plugin is a tool
|
||||
if( p->type() == Tool )
|
||||
if( p->type() == Plugin::Tool )
|
||||
{
|
||||
// everything ok, so return pointer
|
||||
return( dynamic_cast<tool *>( p ) );
|
||||
return dynamic_cast<ToolPlugin *>( p );
|
||||
}
|
||||
|
||||
// not quite... so delete plugin
|
||||
delete p;
|
||||
return( NULL );
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
toolView::toolView( tool * _tool ) :
|
||||
pluginView( _tool, NULL )
|
||||
{
|
||||
engine::getMainWindow()->workspace()->addSubWindow( this );
|
||||
parentWidget()->setAttribute( Qt::WA_DeleteOnClose, FALSE );
|
||||
|
||||
setWindowTitle( _tool->displayName() );
|
||||
setWindowIcon( _tool->getDescriptor()->logo->pixmap() );
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
#include "config_mgr.h"
|
||||
#include "lcd_spinbox.h"
|
||||
#include "AudioPort.h"
|
||||
#include "main_window.h"
|
||||
#include "MainWindow.h"
|
||||
|
||||
|
||||
|
||||
@@ -100,7 +100,7 @@ void AudioJack::restartAfterZombified()
|
||||
{
|
||||
m_active = false;
|
||||
startProcessing();
|
||||
QMessageBox::information( engine::getMainWindow(),
|
||||
QMessageBox::information( engine::mainWindow(),
|
||||
tr( "JACK client restarted" ),
|
||||
tr( "LMMS was kicked by JACK for some reason. "
|
||||
"Therefore the JACK backend of LMMS has been "
|
||||
@@ -109,7 +109,7 @@ void AudioJack::restartAfterZombified()
|
||||
}
|
||||
else
|
||||
{
|
||||
QMessageBox::information( engine::getMainWindow(),
|
||||
QMessageBox::information( engine::mainWindow(),
|
||||
tr( "JACK server down" ),
|
||||
tr( "The JACK server seems to have been shutdown "
|
||||
"and starting a new instance failed. "
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
#include "AudioPort.h"
|
||||
#include "AudioDevice.h"
|
||||
#include "effect_chain.h"
|
||||
#include "EffectChain.h"
|
||||
#include "engine.h"
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ AudioPort::AudioPort( const QString & _name, bool _has_effect_chain ) :
|
||||
m_extOutputEnabled( false ),
|
||||
m_nextFxChannel( 0 ),
|
||||
m_name( "unnamed port" ),
|
||||
m_effects( _has_effect_chain ? new effectChain( NULL ) : NULL )
|
||||
m_effects( _has_effect_chain ? new EffectChain( NULL ) : NULL )
|
||||
{
|
||||
engine::getMixer()->clearAudioBuffer( m_firstBuffer,
|
||||
engine::getMixer()->framesPerPeriod() );
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
#include "automation_pattern_view.h"
|
||||
#include "automation_editor.h"
|
||||
#include "automation_track.h"
|
||||
#include "project_journal.h"
|
||||
#include "ProjectJournal.h"
|
||||
#include "bb_track_container.h"
|
||||
#include "song.h"
|
||||
|
||||
@@ -80,7 +80,7 @@ automationPattern::~automationPattern()
|
||||
|
||||
|
||||
|
||||
void automationPattern::addObject( automatableModel * _obj, bool _search_dup )
|
||||
void automationPattern::addObject( AutomatableModel * _obj, bool _search_dup )
|
||||
{
|
||||
bool addIt = true;
|
||||
|
||||
@@ -117,15 +117,15 @@ void automationPattern::addObject( automatableModel * _obj, bool _search_dup )
|
||||
|
||||
|
||||
|
||||
const automatableModel * automationPattern::firstObject( void ) const
|
||||
const AutomatableModel * automationPattern::firstObject( void ) const
|
||||
{
|
||||
automatableModel * m;
|
||||
AutomatableModel * m;
|
||||
if( !m_objects.isEmpty() && ( m = m_objects.first() ) != NULL )
|
||||
{
|
||||
return m;
|
||||
}
|
||||
|
||||
static floatModel _fm( 0, 0, 1, 0.001 );
|
||||
static FloatModel _fm( 0, 0, 1, 0.001 );
|
||||
return &_fm;
|
||||
}
|
||||
|
||||
@@ -395,7 +395,7 @@ trackContentObjectView * automationPattern::createView( trackView * _tv )
|
||||
|
||||
|
||||
|
||||
bool automationPattern::isAutomated( const automatableModel * _m )
|
||||
bool automationPattern::isAutomated( const AutomatableModel * _m )
|
||||
{
|
||||
trackContainer::trackList l = engine::getSong()->tracks() +
|
||||
engine::getBBTrackContainer()->tracks();
|
||||
@@ -435,7 +435,7 @@ bool automationPattern::isAutomated( const automatableModel * _m )
|
||||
|
||||
|
||||
automationPattern * automationPattern::globalAutomationPattern(
|
||||
automatableModel * _m )
|
||||
AutomatableModel * _m )
|
||||
{
|
||||
automationTrack * t = engine::getSong()->globalAutomationTrack();
|
||||
track::tcoVector v = t->getTCOs();
|
||||
@@ -483,14 +483,14 @@ void automationPattern::resolveAllIDs( void )
|
||||
dynamic_cast<automationPattern *>( *j );
|
||||
if( a )
|
||||
{
|
||||
for( QVector<jo_id_t>::iterator k = a->m_idsToResolve.begin();
|
||||
for( QVector<jo_id_t>::Iterator k = a->m_idsToResolve.begin();
|
||||
k != a->m_idsToResolve.end(); ++k )
|
||||
{
|
||||
journallingObject * o = engine::getProjectJournal()->
|
||||
getJournallingObject( *k );
|
||||
if( o && dynamic_cast<automatableModel *>( o ) )
|
||||
JournallingObject * o = engine::projectJournal()->
|
||||
journallingObject( *k );
|
||||
if( o && dynamic_cast<AutomatableModel *>( o ) )
|
||||
{
|
||||
a->addObject( dynamic_cast<automatableModel *>( o ), false );
|
||||
a->addObject( dynamic_cast<AutomatableModel *>( o ), false );
|
||||
}
|
||||
}
|
||||
a->m_idsToResolve.clear();
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
|
||||
#include "config_mgr.h"
|
||||
#include "main_window.h"
|
||||
#include "MainWindow.h"
|
||||
|
||||
|
||||
static inline QString ensureTrailingSlash( const QString & _s )
|
||||
@@ -331,8 +331,8 @@ void configManager::loadConfigFile( void )
|
||||
if( !QDir( m_workingDir ).exists() )
|
||||
{
|
||||
if( QMessageBox::question( 0,
|
||||
mainWindow::tr( "Working directory" ),
|
||||
mainWindow::tr( "The LMMS working directory %1 does not "
|
||||
MainWindow::tr( "Working directory" ),
|
||||
MainWindow::tr( "The LMMS working directory %1 does not "
|
||||
"exist. Create it now? You can change the directory "
|
||||
"later via Edit -> Settings." ).arg( m_workingDir ),
|
||||
QMessageBox::Yes, QMessageBox::No ) ==
|
||||
@@ -402,8 +402,8 @@ void configManager::saveConfigFile( void )
|
||||
if( !outfile.open( QIODevice::WriteOnly | QIODevice::Truncate ) )
|
||||
{
|
||||
QMessageBox::critical( NULL,
|
||||
mainWindow::tr( "Could not save config-file" ),
|
||||
mainWindow::tr( "Could not save configuration file %1. "
|
||||
MainWindow::tr( "Could not save config-file" ),
|
||||
MainWindow::tr( "Could not save configuration file %1. "
|
||||
"You're probably not permitted to "
|
||||
"write to this file.\n"
|
||||
"Please make sure you have write-"
|
||||
|
||||
@@ -31,18 +31,18 @@
|
||||
#include "bb_track_container.h"
|
||||
#include "config_mgr.h"
|
||||
#include "ControllerRackView.h"
|
||||
#include "fx_mixer.h"
|
||||
#include "fx_mixer_view.h"
|
||||
#include "instrument_track.h"
|
||||
#include "FxMixer.h"
|
||||
#include "FxMixerView.h"
|
||||
#include "InstrumentTrack.h"
|
||||
#include "ladspa_2_lmms.h"
|
||||
#include "main_window.h"
|
||||
#include "MainWindow.h"
|
||||
#include "mixer.h"
|
||||
#include "pattern.h"
|
||||
#include "piano_roll.h"
|
||||
#include "preset_preview_play_handle.h"
|
||||
#include "project_journal.h"
|
||||
#include "ProjectJournal.h"
|
||||
#include "project_notes.h"
|
||||
#include "plugin.h"
|
||||
#include "Plugin.h"
|
||||
#include "song_editor.h"
|
||||
#include "song.h"
|
||||
|
||||
@@ -51,9 +51,9 @@ bool engine::s_hasGUI = true;
|
||||
bool engine::s_suppressMessages = false;
|
||||
float engine::s_framesPerTick;
|
||||
mixer * engine::s_mixer = NULL;
|
||||
fxMixer * engine::s_fxMixer = NULL;
|
||||
fxMixerView * engine::s_fxMixerView = NULL;
|
||||
mainWindow * engine::s_mainWindow = NULL;
|
||||
FxMixer * engine::s_fxMixer = NULL;
|
||||
FxMixerView * engine::s_fxMixerView = NULL;
|
||||
MainWindow * engine::s_mainWindow = NULL;
|
||||
bbTrackContainer * engine::s_bbTrackContainer = NULL;
|
||||
song * engine::s_song = NULL;
|
||||
songEditor * engine::s_songEditor = NULL;
|
||||
@@ -61,9 +61,9 @@ automationEditor * engine::s_automationEditor = NULL;
|
||||
bbEditor * engine::s_bbEditor = NULL;
|
||||
pianoRoll * engine::s_pianoRoll = NULL;
|
||||
projectNotes * engine::s_projectNotes = NULL;
|
||||
projectJournal * engine::s_projectJournal = NULL;
|
||||
ProjectJournal * engine::s_projectJournal = NULL;
|
||||
ladspa2LMMS * engine::s_ladspaManager = NULL;
|
||||
dummyTrackContainer * engine::s_dummyTC = NULL;
|
||||
DummyTrackContainer * engine::s_dummyTC = NULL;
|
||||
ControllerRackView * engine::s_controllerRackView = NULL;
|
||||
QMap<QString, QString> engine::s_pluginFileHandling;
|
||||
|
||||
@@ -76,10 +76,10 @@ void engine::init( const bool _has_gui )
|
||||
|
||||
initPluginFileHandling();
|
||||
|
||||
s_projectJournal = new projectJournal;
|
||||
s_projectJournal = new ProjectJournal;
|
||||
s_mixer = new mixer;
|
||||
s_song = new song;
|
||||
s_fxMixer = new fxMixer;
|
||||
s_fxMixer = new FxMixer;
|
||||
s_bbTrackContainer = new bbTrackContainer;
|
||||
|
||||
s_ladspaManager = new ladspa2LMMS;
|
||||
@@ -90,9 +90,9 @@ void engine::init( const bool _has_gui )
|
||||
|
||||
if( s_hasGUI )
|
||||
{
|
||||
s_mainWindow = new mainWindow;
|
||||
s_mainWindow = new MainWindow;
|
||||
s_songEditor = new songEditor( s_song, s_songEditor );
|
||||
s_fxMixerView = new fxMixerView;
|
||||
s_fxMixerView = new FxMixerView;
|
||||
s_controllerRackView = new ControllerRackView;
|
||||
s_projectNotes = new projectNotes;
|
||||
s_bbEditor = new bbEditor( s_bbTrackContainer );
|
||||
@@ -103,7 +103,7 @@ void engine::init( const bool _has_gui )
|
||||
}
|
||||
|
||||
presetPreviewPlayHandle::init();
|
||||
s_dummyTC = new dummyTrackContainer;
|
||||
s_dummyTC = new DummyTrackContainer;
|
||||
|
||||
s_mixer->startProcessing();
|
||||
}
|
||||
@@ -111,7 +111,7 @@ void engine::init( const bool _has_gui )
|
||||
|
||||
|
||||
|
||||
void engine::destroy( void )
|
||||
void engine::destroy()
|
||||
{
|
||||
s_mixer->stopProcessing();
|
||||
|
||||
@@ -130,7 +130,7 @@ void engine::destroy( void )
|
||||
s_fxMixerView = NULL;
|
||||
|
||||
presetPreviewPlayHandle::cleanup();
|
||||
instrumentTrackView::cleanupWindowPool();
|
||||
InstrumentTrackView::cleanupWindowPool();
|
||||
|
||||
s_song->clearProject();
|
||||
delete s_bbTrackContainer;
|
||||
@@ -159,7 +159,7 @@ void engine::destroy( void )
|
||||
|
||||
|
||||
|
||||
void engine::updateFramesPerTick( void )
|
||||
void engine::updateFramesPerTick()
|
||||
{
|
||||
s_framesPerTick = s_mixer->processingSampleRate() * 60.0f * 4 /
|
||||
DefaultTicksPerTact / s_song->getTempo();
|
||||
@@ -168,15 +168,14 @@ void engine::updateFramesPerTick( void )
|
||||
|
||||
|
||||
|
||||
void engine::initPluginFileHandling( void )
|
||||
void engine::initPluginFileHandling()
|
||||
{
|
||||
QVector<plugin::descriptor> pluginDescriptors;
|
||||
plugin::getDescriptorsOfAvailPlugins( pluginDescriptors );
|
||||
for( QVector<plugin::descriptor>::iterator it =
|
||||
pluginDescriptors.begin();
|
||||
it != pluginDescriptors.end(); ++it )
|
||||
QVector<Plugin::Descriptor> pluginDescriptors;
|
||||
Plugin::getDescriptorsOfAvailPlugins( pluginDescriptors );
|
||||
for( QVector<Plugin::Descriptor>::Iterator it = pluginDescriptors.begin();
|
||||
it != pluginDescriptors.end(); ++it )
|
||||
{
|
||||
if( it->type == plugin::Instrument )
|
||||
if( it->type == Plugin::Instrument )
|
||||
{
|
||||
const QStringList & ext =
|
||||
QString( it->supportedFileTypes ).
|
||||
|
||||
@@ -1,180 +0,0 @@
|
||||
#ifndef SINGLE_SOURCE_COMPILE
|
||||
|
||||
/*
|
||||
* instrument.cpp - base-class for all instrument-plugins (synths, samplers etc)
|
||||
*
|
||||
* Copyright (c) 2005-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public
|
||||
* License along with this program (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "instrument.h"
|
||||
#include "instrument_view.h"
|
||||
#include "instrument_track.h"
|
||||
#include "dummy_instrument.h"
|
||||
#include "note_play_handle.h"
|
||||
#include "embed.h"
|
||||
|
||||
|
||||
instrument::instrument( instrumentTrack * _instrument_track,
|
||||
const descriptor * _descriptor ) :
|
||||
plugin( _descriptor, NULL/* _instrument_track*/ ),
|
||||
m_instrumentTrack( _instrument_track )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
instrument::~instrument()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void instrument::play( sampleFrame * )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void instrument::deleteNotePluginData( notePlayHandle * )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
f_cnt_t instrument::beatLen( notePlayHandle * ) const
|
||||
{
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
instrument * instrument::instantiate( const QString & _plugin_name,
|
||||
instrumentTrack * _instrument_track )
|
||||
{
|
||||
plugin * p = plugin::instantiate( _plugin_name, _instrument_track,
|
||||
_instrument_track );
|
||||
// check whether instantiated plugin is an instrument
|
||||
if( dynamic_cast<instrument *>( p ) != NULL )
|
||||
{
|
||||
// everything ok, so return pointer
|
||||
return( dynamic_cast<instrument *>( p ) );
|
||||
}
|
||||
|
||||
// not quite... so delete plugin and return dummy instrument
|
||||
delete p;
|
||||
return( new dummyInstrument( _instrument_track ) );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
bool instrument::isFromTrack( const track * _track ) const
|
||||
{
|
||||
return( m_instrumentTrack == _track );
|
||||
}
|
||||
|
||||
|
||||
|
||||
void instrument::applyRelease( sampleFrame * buf, const notePlayHandle * _n )
|
||||
{
|
||||
const fpp_t frames = _n->framesLeftForCurrentPeriod();
|
||||
const fpp_t fpp = engine::getMixer()->framesPerPeriod();
|
||||
const f_cnt_t fl = _n->framesLeft();
|
||||
if( fl <= desiredReleaseFrames()+fpp )
|
||||
{
|
||||
for( fpp_t f = (fpp_t)( ( fl > desiredReleaseFrames() ) ?
|
||||
( qMax( fpp - desiredReleaseFrames(), 0 ) +
|
||||
fl % fpp ) : 0 ); f < frames; ++f )
|
||||
{
|
||||
const float fac = (float)( fl-f-1 ) /
|
||||
desiredReleaseFrames();
|
||||
for( ch_cnt_t ch = 0; ch < DEFAULT_CHANNELS; ++ch )
|
||||
{
|
||||
buf[f][ch] *= fac;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
QString instrument::fullDisplayName() const
|
||||
{
|
||||
return getInstrumentTrack()->displayName();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
instrumentView::instrumentView( instrument * _instrument, QWidget * _parent ) :
|
||||
pluginView( _instrument, _parent )
|
||||
{
|
||||
setModel( _instrument );
|
||||
setFixedSize( 250, 250 );
|
||||
setAttribute( Qt::WA_DeleteOnClose, TRUE );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
instrumentView::~instrumentView()
|
||||
{
|
||||
if( getInstrumentTrackWindow() )
|
||||
{
|
||||
getInstrumentTrackWindow()->m_instrumentView = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void instrumentView::setModel( ::model * _model, bool )
|
||||
{
|
||||
if( dynamic_cast<instrument *>( _model ) != NULL )
|
||||
{
|
||||
modelView::setModel( _model );
|
||||
getInstrumentTrackWindow()->setWindowIcon(
|
||||
model()->getDescriptor()->logo->pixmap() );
|
||||
connect( model(), SIGNAL( destroyed( QObject * ) ),
|
||||
this, SLOT( close() ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
instrumentTrackWindow * instrumentView::getInstrumentTrackWindow( void )
|
||||
{
|
||||
return( dynamic_cast<instrumentTrackWindow *>(
|
||||
parentWidget()->parentWidget() ) );
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -55,9 +55,9 @@
|
||||
#include "config_mgr.h"
|
||||
#include "embed.h"
|
||||
#include "engine.h"
|
||||
#include "import_filter.h"
|
||||
#include "lmms_style.h"
|
||||
#include "main_window.h"
|
||||
#include "ImportFilter.h"
|
||||
#include "MainWindow.h"
|
||||
#include "ProjectRenderer.h"
|
||||
#include "song.h"
|
||||
|
||||
@@ -417,26 +417,25 @@ int main( int argc, char * * argv )
|
||||
// we try to load given file
|
||||
if( !file_to_load.isEmpty() )
|
||||
{
|
||||
engine::getMainWindow()->show();
|
||||
engine::mainWindow()->show();
|
||||
if( fullscreen )
|
||||
{
|
||||
engine::getMainWindow()->showMaximized();
|
||||
engine::mainWindow()->showMaximized();
|
||||
}
|
||||
engine::getSong()->loadProject( file_to_load );
|
||||
}
|
||||
else if( !file_to_import.isEmpty() )
|
||||
{
|
||||
importFilter::import( file_to_import,
|
||||
engine::getSong() );
|
||||
ImportFilter::import( file_to_import, engine::getSong() );
|
||||
if( exit_after_import )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
engine::getMainWindow()->show();
|
||||
engine::mainWindow()->show();
|
||||
if( fullscreen )
|
||||
{
|
||||
engine::getMainWindow()->showMaximized();
|
||||
engine::mainWindow()->showMaximized();
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -445,10 +444,10 @@ int main( int argc, char * * argv )
|
||||
|
||||
// [Settel] workaround: showMaximized() doesn't work with
|
||||
// FVWM2 unless the window is already visible -> show() first
|
||||
engine::getMainWindow()->show();
|
||||
engine::mainWindow()->show();
|
||||
if( fullscreen )
|
||||
{
|
||||
engine::getMainWindow()->showMaximized();
|
||||
engine::mainWindow()->showMaximized();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
#include "MidiController.h"
|
||||
|
||||
|
||||
MidiController::MidiController( model * _parent ) :
|
||||
MidiController::MidiController( Model * _parent ) :
|
||||
Controller( Controller::MidiController, _parent, tr( "MIDI Controller" ) ),
|
||||
MidiEventProcessor(),
|
||||
m_midiPort( tr( "unnamed_midi_controller" ),
|
||||
|
||||
@@ -32,9 +32,9 @@
|
||||
|
||||
|
||||
MidiPort::MidiPort( const QString & _name, MidiClient * _mc,
|
||||
MidiEventProcessor * _mep, model * _parent,
|
||||
MidiEventProcessor * _mep, Model * _parent,
|
||||
Modes _mode ) :
|
||||
model( _parent ),
|
||||
Model( _parent ),
|
||||
m_readablePortsMenu( NULL ),
|
||||
m_writablePortsMenu( NULL ),
|
||||
m_midiClient( _mc ),
|
||||
|
||||
@@ -26,14 +26,13 @@
|
||||
#include <math.h>
|
||||
|
||||
#include "mixer.h"
|
||||
#include "fx_mixer.h"
|
||||
#include "FxMixer.h"
|
||||
#include "play_handle.h"
|
||||
#include "effect.h"
|
||||
#include "song.h"
|
||||
#include "templates.h"
|
||||
#include "envelope_and_lfo_parameters.h"
|
||||
#include "EnvelopeAndLfoParameters.h"
|
||||
#include "note_play_handle.h"
|
||||
#include "instrument_track.h"
|
||||
#include "InstrumentTrack.h"
|
||||
#include "debug.h"
|
||||
#include "engine.h"
|
||||
#include "config_mgr.h"
|
||||
@@ -224,14 +223,14 @@ void MixerWorkerThread::processJobQueue()
|
||||
const bool me = a->processEffects();
|
||||
if( me || a->m_bufferUsage != AudioPort::NoUsage )
|
||||
{
|
||||
engine::getFxMixer()->mixToChannel( a->firstBuffer(),
|
||||
engine::fxMixer()->mixToChannel( a->firstBuffer(),
|
||||
a->nextFxChannel() );
|
||||
a->nextPeriod();
|
||||
}
|
||||
}
|
||||
break;
|
||||
case EffectChannel:
|
||||
engine::getFxMixer()->processChannel( (fx_ch_t) it->param );
|
||||
engine::fxMixer()->processChannel( (fx_ch_t) it->param );
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -607,7 +606,7 @@ const surroundSampleFrame * mixer::renderNextBuffer()
|
||||
clearAudioBuffer( m_writeBuf, m_framesPerPeriod );
|
||||
|
||||
// prepare master mix (clear internal buffers etc.)
|
||||
engine::getFxMixer()->prepareMasterMix();
|
||||
engine::fxMixer()->prepareMasterMix();
|
||||
|
||||
// create play-handles for new notes, samples etc.
|
||||
engine::getSong()->processNextBuffer();
|
||||
@@ -657,7 +656,7 @@ const surroundSampleFrame * mixer::renderNextBuffer()
|
||||
|
||||
|
||||
// STAGE 4: do master mix in FX mixer
|
||||
engine::getFxMixer()->masterMix( m_writeBuf );
|
||||
engine::fxMixer()->masterMix( m_writeBuf );
|
||||
|
||||
unlock();
|
||||
|
||||
@@ -665,7 +664,7 @@ const surroundSampleFrame * mixer::renderNextBuffer()
|
||||
emit nextAudioBuffer();
|
||||
|
||||
// and trigger LFOs
|
||||
envelopeAndLFOParameters::triggerLFO();
|
||||
EnvelopeAndLfoParameters::triggerLfo();
|
||||
Controller::triggerFrameCounter();
|
||||
|
||||
const float new_cpu_load = timer.elapsed() / 10000.0f *
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
#include "config_mgr.h"
|
||||
#include "project_version.h"
|
||||
#include "song_editor.h"
|
||||
#include "effect.h"
|
||||
#include "Effect.h"
|
||||
|
||||
|
||||
|
||||
@@ -604,28 +604,25 @@ void multimediaProject::upgrade( void )
|
||||
if( !k.isEmpty() )
|
||||
{
|
||||
const QList<QVariant> l =
|
||||
base64::decode( k, QVariant::List ).
|
||||
toList();
|
||||
base64::decode( k, QVariant::List ).toList();
|
||||
if( !l.isEmpty() )
|
||||
{
|
||||
QString name = l[0].toString();
|
||||
QVariant u = l[1];
|
||||
effectKey::attributeMap m;
|
||||
EffectKey::AttributeMap m;
|
||||
// VST-effect?
|
||||
if( u.type() == QVariant::String )
|
||||
{
|
||||
m["file"] = u.toString();
|
||||
}
|
||||
// LADSPA-effect?
|
||||
else if( u.type() ==
|
||||
QVariant::StringList )
|
||||
else if( u.type() == QVariant::StringList )
|
||||
{
|
||||
const QStringList sl =
|
||||
u.toStringList();
|
||||
const QStringList sl = u.toStringList();
|
||||
m["plugin"] = sl.value( 0 );
|
||||
m["file"] = sl.value( 1 );
|
||||
}
|
||||
effectKey key( NULL, name, m );
|
||||
EffectKey key( NULL, name, m );
|
||||
el.appendChild( key.saveXML( *this ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ note::note( const midiTime & _length, const midiTime & _pos,
|
||||
|
||||
|
||||
note::note( const note & _note ) :
|
||||
serializingObject( _note ),
|
||||
SerializingObject( _note ),
|
||||
m_selected( _note.m_selected ),
|
||||
m_oldKey( _note.m_oldKey ),
|
||||
m_oldPos( _note.m_oldPos ),
|
||||
|
||||
@@ -23,13 +23,12 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "note_play_handle.h"
|
||||
#include "basic_filters.h"
|
||||
#include "config_mgr.h"
|
||||
#include "detuning_helper.h"
|
||||
#include "instrument_sound_shaping.h"
|
||||
#include "instrument_track.h"
|
||||
#include "InstrumentSoundShaping.h"
|
||||
#include "InstrumentTrack.h"
|
||||
#include "MidiPort.h"
|
||||
#include "song.h"
|
||||
|
||||
@@ -46,7 +45,7 @@ inline notePlayHandle::baseDetuning::baseDetuning(
|
||||
|
||||
|
||||
|
||||
notePlayHandle::notePlayHandle( instrumentTrack * _it,
|
||||
notePlayHandle::notePlayHandle( InstrumentTrack * _it,
|
||||
const f_cnt_t _offset,
|
||||
const f_cnt_t _frames,
|
||||
const note & _n,
|
||||
@@ -100,7 +99,7 @@ notePlayHandle::notePlayHandle( instrumentTrack * _it,
|
||||
setFrames( _frames );
|
||||
|
||||
|
||||
if( !isBaseNote() || !getInstrumentTrack()->arpeggiatorEnabled() )
|
||||
if( !isBaseNote() || !instrumentTrack()->isArpeggiatorEnabled() )
|
||||
{
|
||||
// send MIDI-note-on-event
|
||||
m_instrumentTrack->processOutEvent( midiEvent( MidiNoteOn,
|
||||
@@ -325,7 +324,7 @@ void notePlayHandle::noteOff( const f_cnt_t _s )
|
||||
m_releaseFramesToDo = qMax<f_cnt_t>( 0, // 10,
|
||||
m_instrumentTrack->m_soundShaping.releaseFrames() );
|
||||
|
||||
if( !isBaseNote() || !getInstrumentTrack()->arpeggiatorEnabled() )
|
||||
if( !isBaseNote() || !instrumentTrack()->isArpeggiatorEnabled() )
|
||||
{
|
||||
// send MIDI-note-off-event
|
||||
m_instrumentTrack->processOutEvent( midiEvent( MidiNoteOff,
|
||||
@@ -374,7 +373,7 @@ float notePlayHandle::volumeLevel( const f_cnt_t _frame )
|
||||
bool notePlayHandle::isArpeggioBaseNote() const
|
||||
{
|
||||
return isBaseNote() && ( m_partOfArpeggio ||
|
||||
m_instrumentTrack->arpeggiatorEnabled() );
|
||||
m_instrumentTrack->isArpeggiatorEnabled() );
|
||||
}
|
||||
|
||||
|
||||
@@ -423,7 +422,7 @@ int notePlayHandle::index() const
|
||||
|
||||
|
||||
ConstNotePlayHandleList notePlayHandle::nphsOfInstrumentTrack(
|
||||
const instrumentTrack * _it, bool _all_ph )
|
||||
const InstrumentTrack * _it, bool _all_ph )
|
||||
{
|
||||
const PlayHandleList & playHandles = engine::getMixer()->playHandles();
|
||||
ConstNotePlayHandleList cnphv;
|
||||
|
||||
@@ -29,12 +29,12 @@
|
||||
#include "preset_preview_play_handle.h"
|
||||
#include "debug.h"
|
||||
#include "engine.h"
|
||||
#include "instrument.h"
|
||||
#include "instrument_track.h"
|
||||
#include "Instrument.h"
|
||||
#include "InstrumentTrack.h"
|
||||
#include "MidiPort.h"
|
||||
#include "mmp.h"
|
||||
#include "note_play_handle.h"
|
||||
#include "project_journal.h"
|
||||
#include "ProjectJournal.h"
|
||||
#include "track_container.h"
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ public:
|
||||
m_dataMutex()
|
||||
{
|
||||
setJournalling( FALSE );
|
||||
m_previewInstrumentTrack = dynamic_cast<instrumentTrack *>(
|
||||
m_previewInstrumentTrack = dynamic_cast<InstrumentTrack *>(
|
||||
track::create( track::InstrumentTrack,
|
||||
this ) );
|
||||
m_previewInstrumentTrack->setJournalling( FALSE );
|
||||
@@ -64,7 +64,7 @@ public:
|
||||
return "bbtrackcontainer";
|
||||
}
|
||||
|
||||
instrumentTrack * previewInstrumentTrack()
|
||||
InstrumentTrack * previewInstrumentTrack()
|
||||
{
|
||||
return m_previewInstrumentTrack;
|
||||
}
|
||||
@@ -91,7 +91,7 @@ public:
|
||||
|
||||
|
||||
private:
|
||||
instrumentTrack * m_previewInstrumentTrack;
|
||||
InstrumentTrack * m_previewInstrumentTrack;
|
||||
notePlayHandle * m_previewNote;
|
||||
QMutex m_dataMutex;
|
||||
|
||||
@@ -115,18 +115,17 @@ presetPreviewPlayHandle::presetPreviewPlayHandle( const QString & _preset_file,
|
||||
}
|
||||
|
||||
|
||||
const bool j = engine::getProjectJournal()->isJournalling();
|
||||
engine::getProjectJournal()->setJournalling( FALSE );
|
||||
const bool j = engine::projectJournal()->isJournalling();
|
||||
engine::projectJournal()->setJournalling( FALSE );
|
||||
|
||||
engine::setSuppressMessages( true );
|
||||
|
||||
if( _load_by_plugin )
|
||||
{
|
||||
instrument * i = s_previewTC->previewInstrumentTrack()->
|
||||
getInstrument();
|
||||
Instrument * i = s_previewTC->previewInstrumentTrack()->instrument();
|
||||
const QString ext = QFileInfo( _preset_file ).
|
||||
suffix().toLower();
|
||||
if( i == NULL || !i->getDescriptor()->supportsFileType( ext ) )
|
||||
if( i == NULL || !i->descriptor()->supportsFileType( ext ) )
|
||||
{
|
||||
i = s_previewTC->previewInstrumentTrack()->
|
||||
loadInstrument(
|
||||
@@ -162,7 +161,7 @@ presetPreviewPlayHandle::presetPreviewPlayHandle( const QString & _preset_file,
|
||||
s_previewTC->setPreviewNote( m_previewNote );
|
||||
|
||||
s_previewTC->unlockData();
|
||||
engine::getProjectJournal()->setJournalling( j );
|
||||
engine::projectJournal()->setJournalling( j );
|
||||
}
|
||||
|
||||
|
||||
@@ -229,12 +228,12 @@ void presetPreviewPlayHandle::cleanup()
|
||||
|
||||
|
||||
ConstNotePlayHandleList presetPreviewPlayHandle::nphsOfInstrumentTrack(
|
||||
const instrumentTrack * _it )
|
||||
const InstrumentTrack * _it )
|
||||
{
|
||||
ConstNotePlayHandleList cnphv;
|
||||
s_previewTC->lockData();
|
||||
if( s_previewTC->previewNote() != NULL &&
|
||||
s_previewTC->previewNote()->getInstrumentTrack() == _it )
|
||||
s_previewTC->previewNote()->instrumentTrack() == _it )
|
||||
{
|
||||
cnphv.push_back( s_previewTC->previewNote() );
|
||||
}
|
||||
|
||||
@@ -22,12 +22,11 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "sample_play_handle.h"
|
||||
#include "AudioPort.h"
|
||||
#include "bb_track.h"
|
||||
#include "engine.h"
|
||||
#include "instrument_track.h"
|
||||
#include "InstrumentTrack.h"
|
||||
#include "pattern.h"
|
||||
#include "sample_buffer.h"
|
||||
#include "sample_track.h"
|
||||
@@ -87,14 +86,14 @@ samplePlayHandle::samplePlayHandle( sampleTCO * _tco ) :
|
||||
|
||||
samplePlayHandle::samplePlayHandle( pattern * _pattern ) :
|
||||
playHandle( SamplePlayHandle ),
|
||||
m_sampleBuffer( sharedObject::ref( _pattern->getFrozenPattern() ) ),
|
||||
m_sampleBuffer( sharedObject::ref( _pattern->frozenPattern() ) ),
|
||||
m_doneMayReturnTrue( true ),
|
||||
m_frame( 0 ),
|
||||
m_audioPort( _pattern->getInstrumentTrack()->audioPort() ),
|
||||
m_audioPort( _pattern->instrumentTrack()->audioPort() ),
|
||||
m_ownAudioPort( false ),
|
||||
m_defaultVolumeModel( DefaultVolume, MinVolume, MaxVolume, 1 ),
|
||||
m_volumeModel( &m_defaultVolumeModel ),
|
||||
m_track( _pattern->getInstrumentTrack() ),
|
||||
m_track( _pattern->instrumentTrack() ),
|
||||
m_bbTrack( NULL )
|
||||
{
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
#include "sample_record_handle.h"
|
||||
#include "bb_track.h"
|
||||
#include "engine.h"
|
||||
#include "instrument_track.h"
|
||||
#include "InstrumentTrack.h"
|
||||
#include "pattern.h"
|
||||
#include "sample_buffer.h"
|
||||
#include "sample_track.h"
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include <QtCore/QCoreApplication>
|
||||
#include <QtCore/QFile>
|
||||
#include <QtCore/QFileInfo>
|
||||
#include <QtGui/QFileDialog>
|
||||
@@ -40,19 +40,19 @@
|
||||
#include "ControllerRackView.h"
|
||||
#include "ControllerConnection.h"
|
||||
#include "embed.h"
|
||||
#include "envelope_and_lfo_parameters.h"
|
||||
#include "EnvelopeAndLfoParameters.h"
|
||||
#include "export_project_dialog.h"
|
||||
#include "fx_mixer.h"
|
||||
#include "fx_mixer_view.h"
|
||||
#include "import_filter.h"
|
||||
#include "instrument_track.h"
|
||||
#include "main_window.h"
|
||||
#include "FxMixer.h"
|
||||
#include "FxMixerView.h"
|
||||
#include "ImportFilter.h"
|
||||
#include "InstrumentTrack.h"
|
||||
#include "MainWindow.h"
|
||||
#include "MidiClient.h"
|
||||
#include "mmp.h"
|
||||
#include "note_play_handle.h"
|
||||
#include "pattern.h"
|
||||
#include "piano_roll.h"
|
||||
#include "project_journal.h"
|
||||
#include "ProjectJournal.h"
|
||||
#include "project_notes.h"
|
||||
#include "ProjectRenderer.h"
|
||||
#include "rename_dialog.h"
|
||||
@@ -300,7 +300,7 @@ void song::processNextBuffer()
|
||||
// at song-start we have to reset the LFOs
|
||||
if( m_playPos[Mode_PlaySong] == 0 )
|
||||
{
|
||||
envelopeAndLFOParameters::resetLFO();
|
||||
EnvelopeAndLfoParameters::resetLfo();
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -718,7 +718,7 @@ automationPattern * song::tempoAutomationPattern()
|
||||
|
||||
void song::clearProject()
|
||||
{
|
||||
engine::getProjectJournal()->setJournalling( false );
|
||||
engine::projectJournal()->setJournalling( false );
|
||||
|
||||
if( m_playing )
|
||||
{
|
||||
@@ -734,15 +734,15 @@ void song::clearProject()
|
||||
{
|
||||
engine::getSongEditor()->clearAllTracks();
|
||||
}
|
||||
if( engine::getFxMixerView() )
|
||||
if( engine::fxMixerView() )
|
||||
{
|
||||
engine::getFxMixerView()->clear();
|
||||
engine::fxMixerView()->clear();
|
||||
}
|
||||
QCoreApplication::sendPostedEvents();
|
||||
engine::getBBTrackContainer()->clearAllTracks();
|
||||
clearAllTracks();
|
||||
|
||||
engine::getFxMixer()->clear();
|
||||
engine::fxMixer()->clear();
|
||||
|
||||
if( engine::getAutomationEditor() )
|
||||
{
|
||||
@@ -769,9 +769,9 @@ void song::clearProject()
|
||||
|
||||
emit dataChanged();
|
||||
|
||||
engine::getProjectJournal()->clearJournal();
|
||||
engine::projectJournal()->clearJournal();
|
||||
|
||||
engine::getProjectJournal()->setJournalling( true );
|
||||
engine::projectJournal()->setJournalling( true );
|
||||
}
|
||||
|
||||
|
||||
@@ -801,17 +801,17 @@ void song::createNewProject()
|
||||
|
||||
clearProject();
|
||||
|
||||
engine::getProjectJournal()->setJournalling( false );
|
||||
engine::projectJournal()->setJournalling( false );
|
||||
|
||||
m_fileName = m_oldFileName = "";
|
||||
|
||||
track * t;
|
||||
t = track::create( track::InstrumentTrack, this );
|
||||
dynamic_cast<instrumentTrack * >( t )->loadInstrument(
|
||||
dynamic_cast<InstrumentTrack * >( t )->loadInstrument(
|
||||
"tripleoscillator" );
|
||||
t = track::create( track::InstrumentTrack,
|
||||
engine::getBBTrackContainer() );
|
||||
dynamic_cast<instrumentTrack * >( t )->loadInstrument(
|
||||
dynamic_cast<InstrumentTrack * >( t )->loadInstrument(
|
||||
"tripleoscillator" );
|
||||
track::create( track::SampleTrack, this );
|
||||
track::create( track::BBTrack, this );
|
||||
@@ -828,15 +828,15 @@ void song::createNewProject()
|
||||
|
||||
engine::getBBTrackContainer()->updateAfterTrackAdd();
|
||||
|
||||
engine::getProjectJournal()->setJournalling( true );
|
||||
engine::projectJournal()->setJournalling( true );
|
||||
|
||||
QCoreApplication::sendPostedEvents();
|
||||
|
||||
m_modified = false;
|
||||
|
||||
if( engine::getMainWindow() )
|
||||
if( engine::mainWindow() )
|
||||
{
|
||||
engine::getMainWindow()->resetWindowTitle();
|
||||
engine::mainWindow()->resetWindowTitle();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -850,9 +850,9 @@ void song::createNewProjectFromTemplate( const QString & _template )
|
||||
// saving...
|
||||
m_fileName = m_oldFileName = "";
|
||||
// update window title
|
||||
if( engine::getMainWindow() )
|
||||
if( engine::mainWindow() )
|
||||
{
|
||||
engine::getMainWindow()->resetWindowTitle();
|
||||
engine::mainWindow()->resetWindowTitle();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -867,7 +867,7 @@ void song::loadProject( const QString & _file_name )
|
||||
|
||||
clearProject();
|
||||
|
||||
engine::getProjectJournal()->setJournalling( false );
|
||||
engine::projectJournal()->setJournalling( false );
|
||||
|
||||
m_fileName = _file_name;
|
||||
m_oldFileName = _file_name;
|
||||
@@ -907,18 +907,16 @@ void song::loadProject( const QString & _file_name )
|
||||
{
|
||||
if( node.nodeName() == "trackcontainer" )
|
||||
{
|
||||
( (journallingObject *)( this ) )->
|
||||
( (JournallingObject *)( this ) )->
|
||||
restoreState( node.toElement() );
|
||||
}
|
||||
else if( node.nodeName() == "controllers" )
|
||||
{
|
||||
restoreControllerStates( node.toElement() );
|
||||
}
|
||||
else if( node.nodeName() ==
|
||||
engine::getFxMixer()->nodeName() )
|
||||
else if( node.nodeName() == engine::fxMixer()->nodeName() )
|
||||
{
|
||||
engine::getFxMixer()->restoreState(
|
||||
node.toElement() );
|
||||
engine::fxMixer()->restoreState( node.toElement() );
|
||||
}
|
||||
else if( engine::hasGUI() )
|
||||
{
|
||||
@@ -946,7 +944,7 @@ void song::loadProject( const QString & _file_name )
|
||||
nodeName() )
|
||||
{
|
||||
engine::getProjectNotes()->
|
||||
serializingObject::restoreState( node.toElement() );
|
||||
SerializingObject::restoreState( node.toElement() );
|
||||
}
|
||||
else if( node.nodeName() ==
|
||||
m_playPos[Mode_PlaySong].
|
||||
@@ -977,14 +975,14 @@ void song::loadProject( const QString & _file_name )
|
||||
|
||||
configManager::inst()->addRecentlyOpenedProject( _file_name );
|
||||
|
||||
engine::getProjectJournal()->setJournalling( true );
|
||||
engine::projectJournal()->setJournalling( true );
|
||||
|
||||
m_loadingProject = false;
|
||||
m_modified = false;
|
||||
|
||||
if( engine::getMainWindow() )
|
||||
if( engine::mainWindow() )
|
||||
{
|
||||
engine::getMainWindow()->resetWindowTitle();
|
||||
engine::mainWindow()->resetWindowTitle();
|
||||
}
|
||||
if( engine::getSongEditor() )
|
||||
{
|
||||
@@ -1009,14 +1007,14 @@ bool song::saveProject()
|
||||
saveState( mmp, mmp.content() );
|
||||
|
||||
m_globalAutomationTrack->saveState( mmp, mmp.content() );
|
||||
engine::getFxMixer()->saveState( mmp, mmp.content() );
|
||||
engine::fxMixer()->saveState( mmp, mmp.content() );
|
||||
if( engine::hasGUI() )
|
||||
{
|
||||
engine::getControllerRackView()->saveState( mmp, mmp.content() );
|
||||
engine::getPianoRoll()->saveState( mmp, mmp.content() );
|
||||
engine::getAutomationEditor()->saveState( mmp, mmp.content() );
|
||||
engine::getProjectNotes()->
|
||||
serializingObject::saveState( mmp, mmp.content() );
|
||||
SerializingObject::saveState( mmp, mmp.content() );
|
||||
m_playPos[Mode_PlaySong].m_timeLine->saveState(
|
||||
mmp, mmp.content() );
|
||||
}
|
||||
@@ -1033,7 +1031,7 @@ bool song::saveProject()
|
||||
2000 );
|
||||
configManager::inst()->addRecentlyOpenedProject( m_fileName );
|
||||
m_modified = false;
|
||||
engine::getMainWindow()->resetWindowTitle();
|
||||
engine::mainWindow()->resetWindowTitle();
|
||||
}
|
||||
else if( engine::hasGUI() )
|
||||
{
|
||||
@@ -1077,7 +1075,7 @@ void song::importProject()
|
||||
ofd.setFileMode( QFileDialog::ExistingFiles );
|
||||
if( ofd.exec () == QDialog::Accepted && !ofd.selectedFiles().isEmpty() )
|
||||
{
|
||||
importFilter::import( ofd.selectedFiles()[0], this );
|
||||
ImportFilter::import( ofd.selectedFiles()[0], this );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1116,7 +1114,7 @@ void song::exportProject()
|
||||
{
|
||||
if( isEmpty() )
|
||||
{
|
||||
QMessageBox::information( engine::getMainWindow(),
|
||||
QMessageBox::information( engine::mainWindow(),
|
||||
tr( "Empty project" ),
|
||||
tr( "This project is empty so exporting makes "
|
||||
"no sense. Please put some items into "
|
||||
@@ -1124,7 +1122,7 @@ void song::exportProject()
|
||||
return;
|
||||
}
|
||||
|
||||
QFileDialog efd( engine::getMainWindow() );
|
||||
QFileDialog efd( engine::mainWindow() );
|
||||
efd.setFileMode( QFileDialog::AnyFile );
|
||||
efd.setAcceptMode( QFileDialog::AcceptSave );
|
||||
int idx = 0;
|
||||
@@ -1156,7 +1154,7 @@ void song::exportProject()
|
||||
{
|
||||
const QString export_file_name = efd.selectedFiles()[0];
|
||||
exportProjectDialog epd( export_file_name,
|
||||
engine::getMainWindow() );
|
||||
engine::mainWindow() );
|
||||
epd.exec();
|
||||
}
|
||||
}
|
||||
@@ -1177,11 +1175,11 @@ void song::setModified()
|
||||
if( !m_loadingProject )
|
||||
{
|
||||
m_modified = true;
|
||||
if( engine::getMainWindow() &&
|
||||
if( engine::mainWindow() &&
|
||||
QThread::currentThread() ==
|
||||
engine::getMainWindow()->thread() )
|
||||
engine::mainWindow()->thread() )
|
||||
{
|
||||
engine::getMainWindow()->resetWindowTitle();
|
||||
engine::mainWindow()->resetWindowTitle();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
* surround_area.cpp - a widget for setting position of a channel +
|
||||
* calculation of volume for each speaker
|
||||
*
|
||||
* Copyright (c) 2004-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* Copyright (c) 2004-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
@@ -23,168 +23,15 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "surround_area.h"
|
||||
|
||||
|
||||
#include <QtGui/QApplication>
|
||||
#include <QtGui/QMouseEvent>
|
||||
#include <QtGui/QPainter>
|
||||
#include <QtXml/QDomElement>
|
||||
|
||||
|
||||
#include "caption_menu.h"
|
||||
#include "embed.h"
|
||||
#include "surround_area.h"
|
||||
#include "templates.h"
|
||||
#include "tooltip.h"
|
||||
|
||||
|
||||
|
||||
/*
|
||||
QPixmap * surroundArea::s_backgroundArtwork = NULL;
|
||||
|
||||
|
||||
|
||||
|
||||
surroundArea::surroundArea( QWidget * _parent, const QString & _name ) :
|
||||
QWidget( _parent ),
|
||||
modelView( new surroundAreaModel( NULL, NULL, TRUE ) )
|
||||
{
|
||||
if( s_backgroundArtwork == NULL )
|
||||
{
|
||||
s_backgroundArtwork = new QPixmap( embed::getIconPixmap(
|
||||
"surround_area" ) );
|
||||
}
|
||||
|
||||
setFixedSize( s_backgroundArtwork->width(),
|
||||
s_backgroundArtwork->height() );
|
||||
setAccessibleName( _name );
|
||||
toolTip::add( this,
|
||||
tr( "click to where this channel should be audible" ) );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
surroundArea::~surroundArea()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void surroundArea::contextMenuEvent( QContextMenuEvent * )
|
||||
{
|
||||
// for the case, the user clicked right while pressing left mouse-
|
||||
// button, the context-menu appears while mouse-cursor is still hidden
|
||||
// and it isn't shown again until user does something which causes
|
||||
// an QApplication::restoreOverrideCursor()-call...
|
||||
mouseReleaseEvent( NULL );
|
||||
|
||||
captionMenu contextMenu( accessibleName() );
|
||||
contextMenu.addAction( embed::getIconPixmap( "automation" ),
|
||||
tr( "Open &X in automation editor" ),
|
||||
model()->automationPatternX(),
|
||||
SLOT( openInAutomationEditor() ) );
|
||||
contextMenu.addAction( embed::getIconPixmap( "automation" ),
|
||||
tr( "Open &Y in automation editor" ),
|
||||
model()->automationPatternY(),
|
||||
SLOT( openInAutomationEditor() ) );
|
||||
contextMenu.exec( QCursor::pos() );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void surroundArea::paintEvent( QPaintEvent * )
|
||||
{
|
||||
QPainter p( this );
|
||||
if( s_backgroundArtwork->size() != size() )
|
||||
{
|
||||
p.drawPixmap( 0, 0, *s_backgroundArtwork );
|
||||
}
|
||||
else
|
||||
{
|
||||
p.drawPixmap( 0, 0, s_backgroundArtwork->scaled(
|
||||
width(), height(),
|
||||
Qt::IgnoreAspectRatio,
|
||||
Qt::SmoothTransformation ) );
|
||||
}
|
||||
const int x = ( width() + model()->x() * ( width() - 4 ) /
|
||||
SURROUND_AREA_SIZE ) / 2;
|
||||
const int y = ( height() + model()->y() * ( height() - 4 ) /
|
||||
SURROUND_AREA_SIZE ) / 2;
|
||||
p.setPen( QColor( 64, 255, 64 ) );
|
||||
p.drawPoint( x, y - 1 );
|
||||
p.drawPoint( x - 1, y );
|
||||
p.drawPoint( x, y );
|
||||
p.drawPoint( x + 1, y );
|
||||
p.drawPoint( x, y + 1 );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void surroundArea::mousePressEvent( QMouseEvent * _me )
|
||||
{
|
||||
if( _me->button() == Qt::RightButton )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
model()->prepareJournalEntryFromOldVal();
|
||||
|
||||
const int w = width();//s_backgroundArtwork->width();
|
||||
const int h = height();//s_backgroundArtwork->height();
|
||||
if( _me->x() > 1 && _me->x() < w-1 && _me->y() > 1 && _me->y() < h-1 )
|
||||
{
|
||||
model()->setX( ( _me->x() * 2 - w ) * SURROUND_AREA_SIZE /
|
||||
( w - 4 ) );
|
||||
model()->setY( ( _me->y() * 2 - h ) * SURROUND_AREA_SIZE /
|
||||
( h - 4 ) );
|
||||
//update();
|
||||
if( _me->button() != Qt::NoButton )
|
||||
{
|
||||
QApplication::setOverrideCursor( Qt::BlankCursor );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
int x = tLimit( _me->x(), 2, w - 2 );
|
||||
int y = tLimit( _me->y(), 2, h - 2 );
|
||||
QCursor::setPos( mapToGlobal( QPoint( x, y ) ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void surroundArea::mouseMoveEvent( QMouseEvent * _me )
|
||||
{
|
||||
mousePressEvent( _me );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void surroundArea::mouseReleaseEvent( QMouseEvent * )
|
||||
{
|
||||
model()->addJournalEntryFromOldToCurVal();
|
||||
QApplication::restoreOverrideCursor();
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
surroundAreaModel::surroundAreaModel( ::model * _parent,
|
||||
surroundAreaModel::surroundAreaModel( ::Model * _parent,
|
||||
bool _default_constructed ) :
|
||||
model( _parent, QString::null, _default_constructed ),
|
||||
Model( _parent, QString::null, _default_constructed ),
|
||||
m_posX( 0, -SURROUND_AREA_SIZE, SURROUND_AREA_SIZE, _parent ),
|
||||
m_posY( 0, -SURROUND_AREA_SIZE, SURROUND_AREA_SIZE, _parent )
|
||||
{
|
||||
@@ -266,20 +113,6 @@ void surroundAreaModel::loadSettings( const QDomElement & _this,
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
automationPattern * surroundAreaModel::automationPatternX( void )
|
||||
{
|
||||
return( m_posX.getAutomationPattern() );
|
||||
}
|
||||
|
||||
automationPattern * surroundAreaModel::automationPatternY( void )
|
||||
{
|
||||
return( m_posY.getAutomationPattern() );
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
#include "moc_surround_area.cxx"
|
||||
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
#include "engine.h"
|
||||
#include "templates.h"
|
||||
#include "nstate_button.h"
|
||||
#include "main_window.h"
|
||||
#include "MainWindow.h"
|
||||
#include "text_float.h"
|
||||
|
||||
|
||||
|
||||
@@ -52,15 +52,15 @@
|
||||
#include "bb_editor.h"
|
||||
#include "bb_track.h"
|
||||
#include "bb_track_container.h"
|
||||
#include "clipboard.h"
|
||||
#include "Clipboard.h"
|
||||
#include "embed.h"
|
||||
#include "engine.h"
|
||||
#include "gui_templates.h"
|
||||
#include "instrument_track.h"
|
||||
#include "main_window.h"
|
||||
#include "InstrumentTrack.h"
|
||||
#include "MainWindow.h"
|
||||
#include "mmp.h"
|
||||
#include "pixmap_button.h"
|
||||
#include "project_journal.h"
|
||||
#include "ProjectJournal.h"
|
||||
#include "sample_track.h"
|
||||
#include "song.h"
|
||||
#include "string_pair_drag.h"
|
||||
@@ -106,7 +106,7 @@ textFloat * trackContentObjectView::s_textFloat = NULL;
|
||||
* \param _track The track that will contain the new object
|
||||
*/
|
||||
trackContentObject::trackContentObject( track * _track ) :
|
||||
model( _track ),
|
||||
Model( _track ),
|
||||
m_track( _track ),
|
||||
m_name( QString::null ),
|
||||
m_startPosition(),
|
||||
@@ -155,7 +155,7 @@ void trackContentObject::movePosition( const midiTime & _pos )
|
||||
{
|
||||
if( m_startPosition != _pos )
|
||||
{
|
||||
addJournalEntry( journalEntry( Move, m_startPosition - _pos ) );
|
||||
addJournalEntry( JournalEntry( Move, m_startPosition - _pos ) );
|
||||
m_startPosition = _pos;
|
||||
engine::getSong()->updateLength();
|
||||
}
|
||||
@@ -176,7 +176,7 @@ void trackContentObject::changeLength( const midiTime & _length )
|
||||
{
|
||||
if( m_length != _length )
|
||||
{
|
||||
addJournalEntry( journalEntry( Resize, m_length - _length ) );
|
||||
addJournalEntry( JournalEntry( Resize, m_length - _length ) );
|
||||
m_length = _length;
|
||||
engine::getSong()->updateLength();
|
||||
}
|
||||
@@ -194,7 +194,7 @@ void trackContentObject::changeLength( const midiTime & _length )
|
||||
*
|
||||
* \param _je The journal entry to undo
|
||||
*/
|
||||
void trackContentObject::undoStep( journalEntry & _je )
|
||||
void trackContentObject::undoStep( JournalEntry & _je )
|
||||
{
|
||||
saveJournallingState( false );
|
||||
switch( _je.actionID() )
|
||||
@@ -218,9 +218,9 @@ void trackContentObject::undoStep( journalEntry & _je )
|
||||
*
|
||||
* \param _je The journal entry to redo
|
||||
*/
|
||||
void trackContentObject::redoStep( journalEntry & _je )
|
||||
void trackContentObject::redoStep( JournalEntry & _je )
|
||||
{
|
||||
journalEntry je( _je.actionID(), -_je.data().toInt() );
|
||||
JournalEntry je( _je.actionID(), -_je.data().toInt() );
|
||||
undoStep( je );
|
||||
}
|
||||
|
||||
@@ -231,9 +231,9 @@ void trackContentObject::redoStep( journalEntry & _je )
|
||||
*
|
||||
* Copies this track content object to the clipboard.
|
||||
*/
|
||||
void trackContentObject::copy( void )
|
||||
void trackContentObject::copy()
|
||||
{
|
||||
clipboard::copy( this );
|
||||
Clipboard::copy( this );
|
||||
}
|
||||
|
||||
|
||||
@@ -245,11 +245,11 @@ void trackContentObject::copy( void )
|
||||
*
|
||||
* \param _je The journal entry to undo
|
||||
*/
|
||||
void trackContentObject::paste( void )
|
||||
void trackContentObject::paste()
|
||||
{
|
||||
if( clipboard::getContent( nodeName() ) != NULL )
|
||||
if( Clipboard::getContent( nodeName() ) != NULL )
|
||||
{
|
||||
restoreState( *( clipboard::getContent( nodeName() ) ) );
|
||||
restoreState( *( Clipboard::getContent( nodeName() ) ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -264,7 +264,7 @@ void trackContentObject::paste( void )
|
||||
*
|
||||
* \param _je The journal entry to undo
|
||||
*/
|
||||
void trackContentObject::toggleMute( void )
|
||||
void trackContentObject::toggleMute()
|
||||
{
|
||||
m_mutedModel.setValue( !m_mutedModel.value() );
|
||||
emit dataChanged();
|
||||
@@ -290,7 +290,7 @@ void trackContentObject::toggleMute( void )
|
||||
trackContentObjectView::trackContentObjectView( trackContentObject * _tco,
|
||||
trackView * _tv ) :
|
||||
selectableObject( _tv->getTrackContentWidget() ),
|
||||
modelView( NULL, this ),
|
||||
ModelView( NULL, this ),
|
||||
m_tco( _tco ),
|
||||
m_trackView( _tv ),
|
||||
m_action( NoAction ),
|
||||
@@ -354,9 +354,9 @@ trackContentObjectView::~trackContentObjectView()
|
||||
* \todo What the hell is a TCO here - track content object? And in
|
||||
* what circumstance are they fixed?
|
||||
*/
|
||||
bool trackContentObjectView::fixedTCOs( void )
|
||||
bool trackContentObjectView::fixedTCOs()
|
||||
{
|
||||
return( m_trackView->getTrackContainerView()->fixedTCOs() );
|
||||
return m_trackView->getTrackContainerView()->fixedTCOs();
|
||||
}
|
||||
|
||||
|
||||
@@ -369,10 +369,10 @@ bool trackContentObjectView::fixedTCOs( void )
|
||||
*
|
||||
* \return Boolean state of whether the QWidget was able to close.
|
||||
*/
|
||||
bool trackContentObjectView::close( void )
|
||||
bool trackContentObjectView::close()
|
||||
{
|
||||
m_trackView->getTrackContentWidget()->removeTCOView( this );
|
||||
return( QWidget::close() );
|
||||
return QWidget::close();
|
||||
}
|
||||
|
||||
|
||||
@@ -385,7 +385,7 @@ bool trackContentObjectView::close( void )
|
||||
* scheduled for later deletion rather than closed immediately.
|
||||
*
|
||||
*/
|
||||
void trackContentObjectView::remove( void )
|
||||
void trackContentObjectView::remove()
|
||||
{
|
||||
// delete ourself
|
||||
close();
|
||||
@@ -400,7 +400,7 @@ void trackContentObjectView::remove( void )
|
||||
* Perform the 'cut' action of the clipboard - copies the track content
|
||||
* object to the clipboard and then removes it from the track.
|
||||
*/
|
||||
void trackContentObjectView::cut( void )
|
||||
void trackContentObjectView::cut()
|
||||
{
|
||||
m_tco->copy();
|
||||
remove();
|
||||
@@ -416,7 +416,7 @@ void trackContentObjectView::cut( void )
|
||||
* the track content object's length in pixels adding in the border.
|
||||
*
|
||||
*/
|
||||
void trackContentObjectView::updateLength( void )
|
||||
void trackContentObjectView::updateLength()
|
||||
{
|
||||
if( fixedTCOs() )
|
||||
{
|
||||
@@ -442,7 +442,7 @@ void trackContentObjectView::updateLength( void )
|
||||
* view's length.
|
||||
*
|
||||
*/
|
||||
void trackContentObjectView::updatePosition( void )
|
||||
void trackContentObjectView::updatePosition()
|
||||
{
|
||||
m_trackView->getTrackContentWidget()->changePosition();
|
||||
// moving a TCO can result in change of song-length etc.,
|
||||
@@ -578,7 +578,7 @@ void trackContentObjectView::mousePressEvent( QMouseEvent * _me )
|
||||
mmp.toString(), thumbnail, this );
|
||||
}
|
||||
else if( _me->button() == Qt::LeftButton &&
|
||||
/* engine::getMainWindow()->isShiftPressed() == false &&*/
|
||||
/* engine::mainWindow()->isShiftPressed() == false &&*/
|
||||
fixedTCOs() == false )
|
||||
{
|
||||
// move or resize
|
||||
@@ -777,7 +777,7 @@ void trackContentObjectView::mouseReleaseEvent( QMouseEvent * _me )
|
||||
if( m_action == Move || m_action == Resize )
|
||||
{
|
||||
m_tco->setJournalling( true );
|
||||
m_tco->addJournalEntry( journalEntry( m_action, m_oldTime -
|
||||
m_tco->addJournalEntry( JournalEntry( m_action, m_oldTime -
|
||||
( ( m_action == Move ) ?
|
||||
m_tco->startPosition() : m_tco->length() ) ) );
|
||||
}
|
||||
@@ -832,9 +832,9 @@ void trackContentObjectView::contextMenuEvent( QContextMenuEvent * _cme )
|
||||
*
|
||||
* \return the number of pixels per tact (bar).
|
||||
*/
|
||||
float trackContentObjectView::pixelsPerTact( void )
|
||||
float trackContentObjectView::pixelsPerTact()
|
||||
{
|
||||
return( m_trackView->getTrackContainerView()->pixelsPerTact() );
|
||||
return m_trackView->getTrackContainerView()->pixelsPerTact();
|
||||
}
|
||||
|
||||
|
||||
@@ -901,7 +901,7 @@ void trackContentWidget::addTCOView( trackContentObjectView * _tcov )
|
||||
trackContentObject * tco = _tcov->getTrackContentObject();
|
||||
/* QMap<QString, QVariant> map;
|
||||
map["id"] = tco->id();
|
||||
addJournalEntry( journalEntry( AddTrackContentObject, map ) );*/
|
||||
addJournalEntry( JournalEntry( AddTrackContentObject, map ) );*/
|
||||
|
||||
m_tcoViews.push_back( _tcov );
|
||||
|
||||
@@ -931,7 +931,7 @@ void trackContentWidget::removeTCOView( trackContentObjectView * _tcov )
|
||||
_tcov->getTrackContentObject()->saveState( mmp, mmp.content() );
|
||||
map["id"] = _tcov->getTrackContentObject()->id();
|
||||
map["state"] = mmp.toString();
|
||||
addJournalEntry( journalEntry( RemoveTrackContentObject,
|
||||
addJournalEntry( JournalEntry( RemoveTrackContentObject,
|
||||
map ) );*/
|
||||
|
||||
m_tcoViews.erase( it );
|
||||
@@ -945,7 +945,7 @@ void trackContentWidget::removeTCOView( trackContentObjectView * _tcov )
|
||||
/*! \brief Update ourselves by updating all the tCOViews attached.
|
||||
*
|
||||
*/
|
||||
void trackContentWidget::update( void )
|
||||
void trackContentWidget::update()
|
||||
{
|
||||
for( tcoViewVector::iterator it = m_tcoViews.begin();
|
||||
it != m_tcoViews.end(); ++it )
|
||||
@@ -1154,7 +1154,6 @@ void trackContentWidget::paintEvent( QPaintEvent * _pe )
|
||||
*/
|
||||
void trackContentWidget::resizeEvent( QResizeEvent * _re )
|
||||
{
|
||||
// Update backgroud
|
||||
const int tactsPerBar = 4;
|
||||
const trackContainerView * tcv = m_trackView->getTrackContainerView();
|
||||
|
||||
@@ -1211,7 +1210,7 @@ void trackContentWidget::resizeEvent( QResizeEvent * _re )
|
||||
*
|
||||
* \param _je the details of the edit journal
|
||||
*/
|
||||
void trackContentWidget::undoStep( journalEntry & _je )
|
||||
void trackContentWidget::undoStep( JournalEntry & _je )
|
||||
{
|
||||
saveJournallingState( false );
|
||||
switch( _je.actionID() )
|
||||
@@ -1221,10 +1220,8 @@ void trackContentWidget::undoStep( journalEntry & _je )
|
||||
QMap<QString, QVariant> map = _je.data().toMap();
|
||||
trackContentObject * tco =
|
||||
dynamic_cast<trackContentObject *>(
|
||||
engine::getProjectJournal()->getJournallingObject(
|
||||
map["id"].toInt() ) );
|
||||
multimediaProject mmp(
|
||||
multimediaProject::JournalData );
|
||||
engine::projectJournal()->journallingObject( map["id"].toInt() ) );
|
||||
multimediaProject mmp( multimediaProject::JournalData );
|
||||
tco->saveState( mmp, mmp.content() );
|
||||
map["state"] = mmp.toString();
|
||||
_je.data() = map;
|
||||
@@ -1234,13 +1231,11 @@ void trackContentWidget::undoStep( journalEntry & _je )
|
||||
|
||||
case RemoveTrackContentObject:
|
||||
{
|
||||
trackContentObject * tco = getTrack()->createTCO(
|
||||
midiTime( 0 ) );
|
||||
trackContentObject * tco = getTrack()->createTCO( midiTime( 0 ) );
|
||||
multimediaProject mmp(
|
||||
_je.data().toMap()["state"].
|
||||
toString().toUtf8() );
|
||||
tco->restoreState(
|
||||
mmp.content().firstChild().toElement() );
|
||||
tco->restoreState( mmp.content().firstChild().toElement() );
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1254,7 +1249,7 @@ void trackContentWidget::undoStep( journalEntry & _je )
|
||||
*
|
||||
* \param _je the entry in the edit journal to redo.
|
||||
*/
|
||||
void trackContentWidget::redoStep( journalEntry & _je )
|
||||
void trackContentWidget::redoStep( JournalEntry & _je )
|
||||
{
|
||||
switch( _je.actionID() )
|
||||
{
|
||||
@@ -1279,9 +1274,9 @@ void trackContentWidget::redoStep( journalEntry & _je )
|
||||
/*! \brief Return the track shown by the trackContentWidget
|
||||
*
|
||||
*/
|
||||
track * trackContentWidget::getTrack( void )
|
||||
track * trackContentWidget::getTrack()
|
||||
{
|
||||
return( m_trackView->getTrack() );
|
||||
return m_trackView->getTrack();
|
||||
}
|
||||
|
||||
|
||||
@@ -1293,11 +1288,11 @@ track * trackContentWidget::getTrack( void )
|
||||
*/
|
||||
midiTime trackContentWidget::getPosition( int _mouse_x )
|
||||
{
|
||||
return( midiTime( m_trackView->getTrackContainerView()->
|
||||
return midiTime( m_trackView->getTrackContainerView()->
|
||||
currentPosition() + _mouse_x *
|
||||
midiTime::ticksPerTact() /
|
||||
static_cast<int>( m_trackView->
|
||||
getTrackContainerView()->pixelsPerTact() ) ) );
|
||||
getTrackContainerView()->pixelsPerTact() ) );
|
||||
}
|
||||
|
||||
|
||||
@@ -1310,8 +1305,7 @@ midiTime trackContentWidget::endPosition( const midiTime & _pos_start )
|
||||
{
|
||||
const float ppt = m_trackView->getTrackContainerView()->pixelsPerTact();
|
||||
const int w = width();
|
||||
return( _pos_start + static_cast<int>( w * midiTime::ticksPerTact() /
|
||||
ppt ) );
|
||||
return _pos_start + static_cast<int>( w * midiTime::ticksPerTact() / ppt );
|
||||
}
|
||||
|
||||
|
||||
@@ -1466,7 +1460,7 @@ void trackOperationsWidget::paintEvent( QPaintEvent * _pe )
|
||||
/*! \brief Clone this track
|
||||
*
|
||||
*/
|
||||
void trackOperationsWidget::cloneTrack( void )
|
||||
void trackOperationsWidget::cloneTrack()
|
||||
{
|
||||
engine::getMixer()->lock();
|
||||
m_trackView->getTrack()->clone();
|
||||
@@ -1479,7 +1473,7 @@ void trackOperationsWidget::cloneTrack( void )
|
||||
/*! \brief Remove this track from the track list
|
||||
*
|
||||
*/
|
||||
void trackOperationsWidget::removeTrack( void )
|
||||
void trackOperationsWidget::removeTrack()
|
||||
{
|
||||
emit trackRemovalScheduled( m_trackView );
|
||||
}
|
||||
@@ -1492,7 +1486,7 @@ void trackOperationsWidget::removeTrack( void )
|
||||
* For all track types, we have the Clone and Remove options.
|
||||
* For instrument-tracks we also offer the MIDI-control-menu
|
||||
*/
|
||||
void trackOperationsWidget::updateMenu( void )
|
||||
void trackOperationsWidget::updateMenu()
|
||||
{
|
||||
QMenu * to_menu = m_trackOps->menu();
|
||||
to_menu->clear();
|
||||
@@ -1503,10 +1497,10 @@ void trackOperationsWidget::updateMenu( void )
|
||||
tr( "Remove this track" ),
|
||||
this, SLOT( removeTrack() ) );
|
||||
|
||||
if( dynamic_cast<instrumentTrackView *>( m_trackView ) )
|
||||
if( dynamic_cast<InstrumentTrackView *>( m_trackView ) )
|
||||
{
|
||||
to_menu->addSeparator();
|
||||
to_menu->addMenu( dynamic_cast<instrumentTrackView *>(
|
||||
to_menu->addMenu( dynamic_cast<InstrumentTrackView *>(
|
||||
m_trackView )->midiMenu() );
|
||||
}
|
||||
}
|
||||
@@ -1530,7 +1524,7 @@ void trackOperationsWidget::updateMenu( void )
|
||||
* \todo check the definitions of all the properties - are they OK?
|
||||
*/
|
||||
track::track( TrackTypes _type, trackContainer * _tc ) :
|
||||
model( _tc ), /*!< The track model */
|
||||
Model( _tc ), /*!< The track Model */
|
||||
m_trackContainer( _tc ), /*!< The track container object */
|
||||
m_type( _type ), /*!< The track type */
|
||||
m_name(), /*!< The track's name */
|
||||
@@ -1583,7 +1577,7 @@ track * track::create( TrackTypes _tt, trackContainer * _tc )
|
||||
|
||||
switch( _tt )
|
||||
{
|
||||
case InstrumentTrack: t = new instrumentTrack( _tc ); break;
|
||||
case InstrumentTrack: t = new ::InstrumentTrack( _tc ); break;
|
||||
case BBTrack: t = new bbTrack( _tc ); break;
|
||||
case SampleTrack: t = new sampleTrack( _tc ); break;
|
||||
// case EVENT_TRACK:
|
||||
@@ -1596,7 +1590,7 @@ track * track::create( TrackTypes _tt, trackContainer * _tc )
|
||||
|
||||
_tc->updateAfterTrackAdd();
|
||||
|
||||
return( t );
|
||||
return t;
|
||||
}
|
||||
|
||||
|
||||
@@ -1616,7 +1610,7 @@ track * track::create( const QDomElement & _this, trackContainer * _tc )
|
||||
{
|
||||
t->restoreState( _this );
|
||||
}
|
||||
return( t );
|
||||
return t;
|
||||
}
|
||||
|
||||
|
||||
@@ -1625,7 +1619,7 @@ track * track::create( const QDomElement & _this, trackContainer * _tc )
|
||||
/*! \brief Clone a track from this track
|
||||
*
|
||||
*/
|
||||
void track::clone( void )
|
||||
void track::clone()
|
||||
{
|
||||
QDomDocument doc;
|
||||
QDomElement parent = doc.createElement( "clone" );
|
||||
@@ -1662,7 +1656,7 @@ void track::saveSettings( QDomDocument & _doc, QDomElement & _this )
|
||||
// _this.setAttribute( "height", m_trackView->height() );
|
||||
|
||||
QDomElement ts_de = _doc.createElement( nodeName() );
|
||||
// let actual track (instrumentTrack, bbTrack, sampleTrack etc.) save
|
||||
// let actual track (InstrumentTrack, bbTrack, sampleTrack etc.) save
|
||||
// its settings
|
||||
_this.appendChild( ts_de );
|
||||
saveTrackSpecificSettings( _doc, ts_de );
|
||||
@@ -1803,9 +1797,9 @@ void track::removeTCO( trackContentObject * _tco )
|
||||
*
|
||||
* \return the number of trackContentObjects we currently contain.
|
||||
*/
|
||||
int track::numOfTCOs( void )
|
||||
int track::numOfTCOs()
|
||||
{
|
||||
return( m_trackContentObjects.size() );
|
||||
return m_trackContentObjects.size();
|
||||
}
|
||||
|
||||
|
||||
@@ -1827,11 +1821,11 @@ trackContentObject * track::getTCO( int _tco_num )
|
||||
{
|
||||
if( _tco_num < m_trackContentObjects.size() )
|
||||
{
|
||||
return( m_trackContentObjects[_tco_num] );
|
||||
return m_trackContentObjects[_tco_num];
|
||||
}
|
||||
printf( "called track::getTCO( %d ), "
|
||||
"but TCO %d doesn't exist\n", _tco_num, _tco_num );
|
||||
return( createTCO( _tco_num * midiTime::ticksPerTact() ) );
|
||||
return createTCO( _tco_num * midiTime::ticksPerTact() );
|
||||
|
||||
}
|
||||
|
||||
@@ -1853,12 +1847,12 @@ int track::getTCONum( trackContentObject * _tco )
|
||||
{
|
||||
/* if( getTCO( i ) == _tco )
|
||||
{
|
||||
return( i );
|
||||
return i;
|
||||
}*/
|
||||
return( it - m_trackContentObjects.begin() );
|
||||
return it - m_trackContentObjects.begin();
|
||||
}
|
||||
qWarning( "track::getTCONum(...) -> _tco not found!\n" );
|
||||
return( 0 );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -1990,7 +1984,7 @@ void track::removeTact( const midiTime & _pos )
|
||||
* keeping track of the latest time found in ticks. Then we return
|
||||
* that in bars by dividing by the number of ticks per bar.
|
||||
*/
|
||||
tact_t track::length( void ) const
|
||||
tact_t track::length() const
|
||||
{
|
||||
// find last end-position
|
||||
tick_t last = 0;
|
||||
@@ -2015,7 +2009,7 @@ tact_t track::length( void ) const
|
||||
* is already soloed. Then we have to save the mute state of all tracks,
|
||||
* and set our mute state to on and all the others to off.
|
||||
*/
|
||||
void track::toggleSolo( void )
|
||||
void track::toggleSolo()
|
||||
{
|
||||
const trackContainer::trackList & tl = m_trackContainer->tracks();
|
||||
|
||||
@@ -2077,7 +2071,7 @@ void track::toggleSolo( void )
|
||||
*/
|
||||
trackView::trackView( track * _track, trackContainerView * _tcv ) :
|
||||
QWidget( _tcv->contentWidget() ), /*!< The Track Container View's content widget. */
|
||||
modelView( NULL, this ), /*!< The model view of this track */
|
||||
ModelView( NULL, this ), /*!< The model view of this track */
|
||||
m_track( _track ), /*!< The track we're displaying */
|
||||
m_trackContainerView( _tcv ), /*!< The track Container View we're displayed in */
|
||||
m_trackOperationsWidget( this ), /*!< Our trackOperationsWidget */
|
||||
@@ -2158,7 +2152,7 @@ void trackView::resizeEvent( QResizeEvent * _re )
|
||||
/*! \brief Update this track View and all its content objects.
|
||||
*
|
||||
*/
|
||||
void trackView::update( void )
|
||||
void trackView::update()
|
||||
{
|
||||
m_trackContentWidget.update();
|
||||
if( !m_trackContainerView->fixedTCOs() )
|
||||
@@ -2174,10 +2168,10 @@ void trackView::update( void )
|
||||
/*! \brief Close this track View.
|
||||
*
|
||||
*/
|
||||
bool trackView::close( void )
|
||||
bool trackView::close()
|
||||
{
|
||||
m_trackContainerView->removeTrackView( this );
|
||||
return( QWidget::close() );
|
||||
return QWidget::close();
|
||||
}
|
||||
|
||||
|
||||
@@ -2186,14 +2180,14 @@ bool trackView::close( void )
|
||||
/*! \brief Register that the model of this track View has changed.
|
||||
*
|
||||
*/
|
||||
void trackView::modelChanged( void )
|
||||
void trackView::modelChanged()
|
||||
{
|
||||
m_track = castModel<track>();
|
||||
assert( m_track != NULL );
|
||||
connect( m_track, SIGNAL( destroyedTrack() ), this, SLOT( close() ) );
|
||||
m_trackOperationsWidget.m_muteBtn->setModel( &m_track->m_mutedModel );
|
||||
m_trackOperationsWidget.m_soloBtn->setModel( &m_track->m_soloModel );
|
||||
modelView::modelChanged();
|
||||
ModelView::modelChanged();
|
||||
}
|
||||
|
||||
|
||||
@@ -2203,7 +2197,7 @@ void trackView::modelChanged( void )
|
||||
*
|
||||
* \param _je the Journal Entry to undo.
|
||||
*/
|
||||
void trackView::undoStep( journalEntry & _je )
|
||||
void trackView::undoStep( JournalEntry & _je )
|
||||
{
|
||||
saveJournallingState( false );
|
||||
switch( _je.actionID() )
|
||||
@@ -2235,9 +2229,9 @@ void trackView::undoStep( journalEntry & _je )
|
||||
*
|
||||
* \param _je the Journal Event to redo.
|
||||
*/
|
||||
void trackView::redoStep( journalEntry & _je )
|
||||
void trackView::redoStep( JournalEntry & _je )
|
||||
{
|
||||
journalEntry je( _je.actionID(), -_je.data().toInt() );
|
||||
JournalEntry je( _je.actionID(), -_je.data().toInt() );
|
||||
undoStep( je );
|
||||
}
|
||||
|
||||
@@ -2376,7 +2370,7 @@ void trackView::mouseMoveEvent( QMouseEvent * _me )
|
||||
{
|
||||
m_trackContainerView->moveTrackViewDown( this );
|
||||
}
|
||||
addJournalEntry( journalEntry( MoveTrack, _me->y() ) );
|
||||
addJournalEntry( JournalEntry( MoveTrack, _me->y() ) );
|
||||
}
|
||||
}
|
||||
else if( m_action == ResizeTrack )
|
||||
|
||||
@@ -29,15 +29,15 @@
|
||||
#include <QtXml/QDomElement>
|
||||
|
||||
#include "track_container.h"
|
||||
#include "instrument_track.h"
|
||||
#include "InstrumentTrack.h"
|
||||
#include "engine.h"
|
||||
#include "main_window.h"
|
||||
#include "MainWindow.h"
|
||||
#include "song.h"
|
||||
|
||||
|
||||
trackContainer::trackContainer( void ) :
|
||||
model( NULL ),
|
||||
journallingObject(),
|
||||
trackContainer::trackContainer() :
|
||||
Model( NULL ),
|
||||
JournallingObject(),
|
||||
m_tracksMutex(),
|
||||
m_tracks()
|
||||
{
|
||||
@@ -83,7 +83,7 @@ void trackContainer::loadSettings( const QDomElement & _this )
|
||||
pd = new QProgressDialog( tr( "Loading project..." ),
|
||||
tr( "Cancel" ), 0,
|
||||
_this.childNodes().count(),
|
||||
engine::getMainWindow() );
|
||||
engine::mainWindow() );
|
||||
pd->setWindowModality( Qt::ApplicationModal );
|
||||
pd->setWindowTitle( tr( "Please wait..." ) );
|
||||
pd->show();
|
||||
@@ -183,14 +183,14 @@ void trackContainer::removeTrack( track * _track )
|
||||
|
||||
|
||||
|
||||
void trackContainer::updateAfterTrackAdd( void )
|
||||
void trackContainer::updateAfterTrackAdd()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void trackContainer::clearAllTracks( void )
|
||||
void trackContainer::clearAllTracks()
|
||||
{
|
||||
//m_tracksMutex.lockForWrite();
|
||||
while( !m_tracks.isEmpty() )
|
||||
@@ -203,7 +203,7 @@ void trackContainer::clearAllTracks( void )
|
||||
|
||||
|
||||
|
||||
bool trackContainer::isEmpty( void ) const
|
||||
bool trackContainer::isEmpty() const
|
||||
{
|
||||
for( trackList::const_iterator it = m_tracks.begin();
|
||||
it != m_tracks.end(); ++it )
|
||||
@@ -221,15 +221,15 @@ bool trackContainer::isEmpty( void ) const
|
||||
|
||||
|
||||
|
||||
dummyTrackContainer::dummyTrackContainer( void ) :
|
||||
DummyTrackContainer::DummyTrackContainer() :
|
||||
trackContainer(),
|
||||
m_dummyInstrumentTrack( NULL )
|
||||
{
|
||||
setJournalling( FALSE );
|
||||
m_dummyInstrumentTrack = dynamic_cast<instrumentTrack *>(
|
||||
m_dummyInstrumentTrack = dynamic_cast<InstrumentTrack *>(
|
||||
track::create( track::InstrumentTrack,
|
||||
this ) );
|
||||
m_dummyInstrumentTrack->setJournalling( FALSE );
|
||||
m_dummyInstrumentTrack->setJournalling( false );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* automatable_model_view.cpp - implementation of automatableModelView
|
||||
* automatable_model_view.cpp - implementation of AutomatableModelView
|
||||
*
|
||||
* Copyright (c) 2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
@@ -25,67 +25,68 @@
|
||||
|
||||
#include <QtGui/QMenu>
|
||||
#include <QtGui/QMouseEvent>
|
||||
#include "automatable_model_view.h"
|
||||
|
||||
#include "AutomatableModelView.h"
|
||||
#include "automation_pattern.h"
|
||||
#include "ControllerConnectionDialog.h"
|
||||
#include "ControllerConnection.h"
|
||||
#include "embed.h"
|
||||
#include "main_window.h"
|
||||
#include "MainWindow.h"
|
||||
#include "string_pair_drag.h"
|
||||
|
||||
|
||||
|
||||
automatableModelView::automatableModelView( ::model * _model,
|
||||
AutomatableModelView::AutomatableModelView( ::Model * _model,
|
||||
QWidget * _this ) :
|
||||
modelView( _model, _this ),
|
||||
ModelView( _model, _this ),
|
||||
m_description( QString::null ),
|
||||
m_unit( QString::null )
|
||||
{
|
||||
widget()->setAcceptDrops( TRUE );
|
||||
widget()->setAcceptDrops( true );
|
||||
widget()->setCursor( QCursor( embed::getIconPixmap( "hand" ), 0, 0 ) );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
automatableModelView::~automatableModelView()
|
||||
AutomatableModelView::~AutomatableModelView()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void automatableModelView::addDefaultActions( QMenu * _menu )
|
||||
void AutomatableModelView::addDefaultActions( QMenu * _menu )
|
||||
{
|
||||
automatableModel * _model = modelUntyped();
|
||||
AutomatableModel * _model = modelUntyped();
|
||||
|
||||
automatableModelViewSlots * amvSlots =
|
||||
new automatableModelViewSlots( this, _menu );
|
||||
AutomatableModelViewSlots * amvSlots =
|
||||
new AutomatableModelViewSlots( this, _menu );
|
||||
|
||||
_menu->addAction( embed::getIconPixmap( "reload" ),
|
||||
automatableModel::tr( "&Reset (%1%2)" ).
|
||||
AutomatableModel::tr( "&Reset (%1%2)" ).
|
||||
arg( _model->displayValue(
|
||||
_model->initValue<float>() ) ).
|
||||
arg( m_unit ),
|
||||
_model, SLOT( reset() ) );
|
||||
_menu->addSeparator();
|
||||
_menu->addAction( embed::getIconPixmap( "edit_copy" ),
|
||||
automatableModel::tr( "&Copy value (%1%2)" ).
|
||||
AutomatableModel::tr( "&Copy value (%1%2)" ).
|
||||
arg( _model->displayValue(
|
||||
_model->value<float>() ) ).
|
||||
arg( m_unit ),
|
||||
_model, SLOT( copyValue() ) );
|
||||
_menu->addAction( embed::getIconPixmap( "edit_paste" ),
|
||||
automatableModel::tr( "&Paste value (%1%2)").
|
||||
AutomatableModel::tr( "&Paste value (%1%2)").
|
||||
arg( _model->displayValue(
|
||||
automatableModel::copiedValue() ) ).
|
||||
AutomatableModel::copiedValue() ) ).
|
||||
arg( m_unit ),
|
||||
_model, SLOT( pasteValue() ) );
|
||||
|
||||
_menu->addSeparator();
|
||||
|
||||
_menu->addAction( embed::getIconPixmap( "automation" ),
|
||||
automatableModel::tr( "Edit song-global automation" ),
|
||||
AutomatableModel::tr( "Edit song-global automation" ),
|
||||
amvSlots,
|
||||
SLOT( editSongGlobalAutomation() ) );
|
||||
_menu->addSeparator();
|
||||
@@ -98,12 +99,12 @@ void automatableModelView::addDefaultActions( QMenu * _menu )
|
||||
if( cont )
|
||||
{
|
||||
controllerTxt =
|
||||
automatableModel::tr( "Connected to %1" ).
|
||||
AutomatableModel::tr( "Connected to %1" ).
|
||||
arg( cont->name() );
|
||||
}
|
||||
else
|
||||
{
|
||||
controllerTxt = automatableModel::tr(
|
||||
controllerTxt = AutomatableModel::tr(
|
||||
"Connected to controller" );
|
||||
}
|
||||
|
||||
@@ -112,18 +113,18 @@ void automatableModelView::addDefaultActions( QMenu * _menu )
|
||||
controllerTxt );
|
||||
|
||||
contMenu->addAction( embed::getIconPixmap( "controller" ),
|
||||
automatableModel::tr("Edit connection..."),
|
||||
AutomatableModel::tr("Edit connection..."),
|
||||
amvSlots,
|
||||
SLOT( execConnectionDialog() ) );
|
||||
contMenu->addAction( embed::getIconPixmap( "cancel" ),
|
||||
automatableModel::tr("Remove connection"),
|
||||
AutomatableModel::tr("Remove connection"),
|
||||
amvSlots,
|
||||
SLOT( removeConnection() ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
_menu->addAction( embed::getIconPixmap( "controller" ),
|
||||
automatableModel::tr("Connect to controller..."),
|
||||
AutomatableModel::tr("Connect to controller..."),
|
||||
amvSlots,
|
||||
SLOT( execConnectionDialog() ) );
|
||||
}
|
||||
@@ -132,16 +133,16 @@ void automatableModelView::addDefaultActions( QMenu * _menu )
|
||||
|
||||
|
||||
|
||||
void automatableModelView::setModel( model * _model, bool _old_model_valid )
|
||||
void AutomatableModelView::setModel( Model * _model, bool _old_model_valid )
|
||||
{
|
||||
modelView::setModel( _model, _old_model_valid );
|
||||
ModelView::setModel( _model, _old_model_valid );
|
||||
//setAccessibleName( _model->displayName();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void automatableModelView::mousePressEvent( QMouseEvent * _me )
|
||||
void AutomatableModelView::mousePressEvent( QMouseEvent * _me )
|
||||
{
|
||||
if( _me->button() == Qt::LeftButton &&
|
||||
_me->modifiers() & Qt::ControlModifier )
|
||||
@@ -162,8 +163,8 @@ void automatableModelView::mousePressEvent( QMouseEvent * _me )
|
||||
|
||||
|
||||
|
||||
automatableModelViewSlots::automatableModelViewSlots(
|
||||
automatableModelView * _amv,
|
||||
AutomatableModelViewSlots::AutomatableModelViewSlots(
|
||||
AutomatableModelView * _amv,
|
||||
QObject * _parent ) :
|
||||
QObject(),
|
||||
amv( _amv )
|
||||
@@ -176,15 +177,15 @@ automatableModelViewSlots::automatableModelViewSlots(
|
||||
|
||||
|
||||
|
||||
void automatableModelViewSlots::execConnectionDialog( void )
|
||||
void AutomatableModelViewSlots::execConnectionDialog()
|
||||
{
|
||||
// TODO[pg]: Display a dialog with list of controllers currently in the song
|
||||
// in addition to any system MIDI controllers
|
||||
automatableModel * m = amv->modelUntyped();
|
||||
AutomatableModel * m = amv->modelUntyped();
|
||||
|
||||
m->displayName();
|
||||
ControllerConnectionDialog * d = new ControllerConnectionDialog(
|
||||
(QWidget*)engine::getMainWindow(), m );
|
||||
(QWidget*)engine::mainWindow(), m );
|
||||
|
||||
if( d->exec() == 1)
|
||||
{
|
||||
@@ -220,9 +221,9 @@ void automatableModelViewSlots::execConnectionDialog( void )
|
||||
|
||||
|
||||
|
||||
void automatableModelViewSlots::removeConnection( void )
|
||||
void AutomatableModelViewSlots::removeConnection()
|
||||
{
|
||||
automatableModel * m = amv->modelUntyped();
|
||||
AutomatableModel * m = amv->modelUntyped();
|
||||
|
||||
if( m->getControllerConnection() )
|
||||
{
|
||||
@@ -234,7 +235,7 @@ void automatableModelViewSlots::removeConnection( void )
|
||||
|
||||
|
||||
|
||||
void automatableModelViewSlots::editSongGlobalAutomation( void )
|
||||
void AutomatableModelViewSlots::editSongGlobalAutomation()
|
||||
{
|
||||
automationPattern::globalAutomationPattern( amv->modelUntyped() )->
|
||||
openInAutomationEditor();
|
||||
@@ -242,5 +243,4 @@ void automatableModelViewSlots::editSongGlobalAutomation( void )
|
||||
|
||||
|
||||
|
||||
|
||||
#include "moc_automatable_model_view.cxx"
|
||||
#include "moc_AutomatableModelView.cxx"
|
||||
@@ -2,8 +2,8 @@
|
||||
* ControllerConnectionDialog.cpp - dialog allowing the user to create and
|
||||
* modify links between controllers and models
|
||||
*
|
||||
* Copyright (c) 2008 Paul Giblock <drfaygo/at/gmail.com>
|
||||
*
|
||||
* Copyright (c) 2008 Paul Giblock <drfaygo/at/gmail.com>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
@@ -23,7 +23,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include <QtGui/QLayout>
|
||||
#include <QtGui/QLineEdit>
|
||||
#include <QtGui/QPushButton>
|
||||
@@ -46,10 +45,11 @@
|
||||
#include "gui_templates.h"
|
||||
#include "embed.h"
|
||||
|
||||
|
||||
class AutoDetectMidiController : public MidiController
|
||||
{
|
||||
public:
|
||||
AutoDetectMidiController( model * _parent ) :
|
||||
AutoDetectMidiController( Model * _parent ) :
|
||||
MidiController( _parent ),
|
||||
m_detectedMidiChannel( 0 ),
|
||||
m_detectedMidiController( 0 )
|
||||
@@ -82,7 +82,7 @@ public:
|
||||
|
||||
// Would be a nice copy ctor, but too hard to add copy ctor because
|
||||
// model has none.
|
||||
MidiController * copyToMidiController( model * _parent )
|
||||
MidiController * copyToMidiController( Model * _parent )
|
||||
{
|
||||
MidiController * c = new MidiController( _parent );
|
||||
c->m_midiPort.setInputChannel( m_midiPort.inputChannel() );
|
||||
@@ -127,8 +127,7 @@ private:
|
||||
|
||||
|
||||
ControllerConnectionDialog::ControllerConnectionDialog( QWidget * _parent,
|
||||
const automatableModel * _target_model
|
||||
) :
|
||||
const AutomatableModel * _target_model ) :
|
||||
QDialog( _parent ),
|
||||
m_readablePorts( NULL ),
|
||||
m_midiAutoDetect( false ),
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* ControllerDialog.cpp - per-controller-specific view for changing a
|
||||
* controller's settings
|
||||
* controller's settings
|
||||
*
|
||||
* Copyright (c) 2008 Paul Giblock <drfaygo/at/gmail.com>
|
||||
*
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
@@ -32,7 +32,7 @@
|
||||
ControllerDialog::ControllerDialog( Controller * _controller,
|
||||
QWidget * _parent ) :
|
||||
QWidget( _parent ),
|
||||
modelView( _controller, this )
|
||||
ModelView( _controller, this )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* effect_control_dialog.cpp - base-class for effect-dialogs for displaying
|
||||
* and editing control port values
|
||||
* EffectControlDialog.cpp - base-class for effect-dialogs for displaying
|
||||
* and editing control port values
|
||||
*
|
||||
* Copyright (c) 2006-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
@@ -26,31 +26,30 @@
|
||||
#include <QtGui/QMessageBox>
|
||||
#include <QtGui/QCloseEvent>
|
||||
|
||||
#include "effect_control_dialog.h"
|
||||
#include "effect_controls.h"
|
||||
#include "effect.h"
|
||||
#include "EffectControlDialog.h"
|
||||
#include "EffectControls.h"
|
||||
#include "Effect.h"
|
||||
|
||||
|
||||
effectControlDialog::effectControlDialog( effectControls * _controls ) :
|
||||
EffectControlDialog::EffectControlDialog( EffectControls * _controls ) :
|
||||
QWidget( NULL ),
|
||||
modelView( _controls, this ),
|
||||
ModelView( _controls, this ),
|
||||
m_effectControls( _controls )
|
||||
{
|
||||
setWindowTitle( m_effectControls->getEffect()->displayName() );
|
||||
|
||||
setWindowTitle( m_effectControls->effect()->displayName() );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
effectControlDialog::~effectControlDialog()
|
||||
EffectControlDialog::~EffectControlDialog()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void effectControlDialog::closeEvent( QCloseEvent * _ce )
|
||||
void EffectControlDialog::closeEvent( QCloseEvent * _ce )
|
||||
{
|
||||
_ce->ignore();
|
||||
emit closed();
|
||||
@@ -58,5 +57,5 @@ void effectControlDialog::closeEvent( QCloseEvent * _ce )
|
||||
|
||||
|
||||
|
||||
#include "moc_effect_control_dialog.cxx"
|
||||
#include "moc_EffectControlDialog.cxx"
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* effect_select_dialog.cpp - dialog to choose effect plugin
|
||||
* EffectSelectDialog.cpp - dialog to choose effect plugin
|
||||
*
|
||||
* Copyright (c) 2006-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* Copyright (c) 2006-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
@@ -22,7 +22,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include <QtGui/QGroupBox>
|
||||
#include <QtGui/QLayout>
|
||||
#include <QtGui/QLineEdit>
|
||||
@@ -30,24 +29,24 @@
|
||||
#include <QtGui/QPushButton>
|
||||
#include <QtGui/QScrollArea>
|
||||
|
||||
#include "effect_select_dialog.h"
|
||||
#include "EffectSelectDialog.h"
|
||||
|
||||
#include "gui_templates.h"
|
||||
#include "embed.h"
|
||||
|
||||
|
||||
effectSelectDialog::effectSelectDialog( QWidget * _parent ) :
|
||||
EffectSelectDialog::EffectSelectDialog( QWidget * _parent ) :
|
||||
QDialog( _parent )
|
||||
{
|
||||
setWindowIcon( embed::getIconPixmap( "setup_audio" ) );
|
||||
setWindowTitle( tr( "Effects Selector" ) );
|
||||
setModal( TRUE );
|
||||
setModal( true );
|
||||
|
||||
QVBoxLayout * vlayout = new QVBoxLayout( this );
|
||||
vlayout->setSpacing( 10 );
|
||||
vlayout->setMargin( 10 );
|
||||
|
||||
effectListWidget * elist = new effectListWidget( this );
|
||||
EffectListWidget * elist = new EffectListWidget( this );
|
||||
elist->setMinimumSize( 540, 400 );
|
||||
connect( elist, SIGNAL( doubleClicked( const effectKey & ) ),
|
||||
this, SLOT( selectPlugin() ) );
|
||||
@@ -92,20 +91,20 @@ effectSelectDialog::effectSelectDialog( QWidget * _parent ) :
|
||||
|
||||
|
||||
|
||||
effectSelectDialog::~effectSelectDialog()
|
||||
EffectSelectDialog::~EffectSelectDialog()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
effect * effectSelectDialog::instantiateSelectedPlugin( effectChain * _parent )
|
||||
Effect * EffectSelectDialog::instantiateSelectedPlugin( EffectChain * _parent )
|
||||
{
|
||||
if( !m_currentSelection.name.isEmpty() && m_currentSelection.desc )
|
||||
{
|
||||
return( effect::instantiate( m_currentSelection.desc->name,
|
||||
return Effect::instantiate( m_currentSelection.desc->name,
|
||||
_parent,
|
||||
&m_currentSelection ) );
|
||||
&m_currentSelection );
|
||||
}
|
||||
return( NULL );
|
||||
}
|
||||
@@ -113,7 +112,7 @@ effect * effectSelectDialog::instantiateSelectedPlugin( effectChain * _parent )
|
||||
|
||||
|
||||
|
||||
void effectSelectDialog::setSelection( const effectKey & _selection )
|
||||
void EffectSelectDialog::setSelection( const EffectKey & _selection )
|
||||
{
|
||||
m_currentSelection = _selection;
|
||||
}
|
||||
@@ -121,7 +120,7 @@ void effectSelectDialog::setSelection( const effectKey & _selection )
|
||||
|
||||
|
||||
|
||||
void effectSelectDialog::selectPlugin( void )
|
||||
void EffectSelectDialog::selectPlugin()
|
||||
{
|
||||
if( m_currentSelection.isValid() )
|
||||
{
|
||||
@@ -135,19 +134,19 @@ void effectSelectDialog::selectPlugin( void )
|
||||
|
||||
|
||||
|
||||
effectListWidget::effectListWidget( QWidget * _parent ) :
|
||||
EffectListWidget::EffectListWidget( QWidget * _parent ) :
|
||||
QWidget( _parent ),
|
||||
m_sourceModel(),
|
||||
m_model(),
|
||||
m_descriptionWidget( NULL )
|
||||
{
|
||||
plugin::getDescriptorsOfAvailPlugins( m_pluginDescriptors );
|
||||
Plugin::getDescriptorsOfAvailPlugins( m_pluginDescriptors );
|
||||
|
||||
for( QVector<plugin::descriptor>::iterator it =
|
||||
for( QVector<Plugin::Descriptor>::iterator it =
|
||||
m_pluginDescriptors.begin();
|
||||
it != m_pluginDescriptors.end(); ++it )
|
||||
{
|
||||
if( it->type != plugin::Effect )
|
||||
if( it->type != Plugin::Effect )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -164,13 +163,13 @@ effectListWidget::effectListWidget( QWidget * _parent ) :
|
||||
}
|
||||
else
|
||||
{
|
||||
m_effectKeys << effectKey( &( *it ), it->name );
|
||||
m_effectKeys << EffectKey( &( *it ), it->name );
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
QStringList plugin_names;
|
||||
for( effectKeyList::const_iterator it = m_effectKeys.begin();
|
||||
for( EffectKeyList::ConstIterator it = m_effectKeys.begin();
|
||||
it != m_effectKeys.end(); ++it )
|
||||
{
|
||||
plugin_names += QString( ( *it ).desc->displayName ) +
|
||||
@@ -237,15 +236,14 @@ effectListWidget::effectListWidget( QWidget * _parent ) :
|
||||
|
||||
|
||||
|
||||
effectListWidget::~effectListWidget()
|
||||
EffectListWidget::~EffectListWidget()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void effectListWidget::rowChanged( const QModelIndex & _idx,
|
||||
const QModelIndex & )
|
||||
void EffectListWidget::rowChanged( const QModelIndex & _idx, const QModelIndex & )
|
||||
{
|
||||
delete m_descriptionWidget;
|
||||
m_descriptionWidget = NULL;
|
||||
@@ -254,7 +252,7 @@ void effectListWidget::rowChanged( const QModelIndex & _idx,
|
||||
{
|
||||
// invalidate current selection
|
||||
m_currentSelection =
|
||||
plugin::descriptor::subPluginFeatures::key();
|
||||
Plugin::Descriptor::SubPluginFeatures::Key();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -285,21 +283,21 @@ void effectListWidget::rowChanged( const QModelIndex & _idx,
|
||||
l->setSizeConstraint( QLayout::SetFixedSize );
|
||||
m_descriptionWidget->show();
|
||||
}
|
||||
emit( highlighted( m_currentSelection ) );
|
||||
emit highlighted( m_currentSelection );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void effectListWidget::onDoubleClicked( const QModelIndex & )
|
||||
void EffectListWidget::onDoubleClicked( const QModelIndex & )
|
||||
{
|
||||
emit( doubleClicked( m_currentSelection ) );
|
||||
emit doubleClicked( m_currentSelection );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void effectListWidget::updateSelection( void )
|
||||
void EffectListWidget::updateSelection()
|
||||
{
|
||||
// no valid selection anymore due to changed filter?
|
||||
if( m_pluginList->selectionModel()->selection().size() <= 0 )
|
||||
@@ -312,5 +310,5 @@ void effectListWidget::updateSelection( void )
|
||||
}
|
||||
|
||||
|
||||
#include "moc_effect_select_dialog.cxx"
|
||||
#include "moc_EffectSelectDialog.cxx"
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* fx_mixer_view.cpp - effect-mixer-view for LMMS
|
||||
* FxMixerView.cpp - effect-mixer-view for LMMS
|
||||
*
|
||||
* Copyright (c) 2008-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
@@ -22,7 +22,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include <QtGui/QButtonGroup>
|
||||
#include <QtGui/QInputDialog>
|
||||
#include <QtGui/QLayout>
|
||||
@@ -33,12 +32,12 @@
|
||||
#include <QtGui/QToolButton>
|
||||
#include <QtGui/QStackedLayout>
|
||||
|
||||
#include "fx_mixer_view.h"
|
||||
#include "FxMixerView.h"
|
||||
#include "fader.h"
|
||||
#include "effect_rack_view.h"
|
||||
#include "EffectRackView.h"
|
||||
#include "engine.h"
|
||||
#include "embed.h"
|
||||
#include "main_window.h"
|
||||
#include "MainWindow.h"
|
||||
#include "lcd_spinbox.h"
|
||||
#include "gui_templates.h"
|
||||
#include "tooltip.h"
|
||||
@@ -46,10 +45,10 @@
|
||||
|
||||
|
||||
|
||||
class fxLine : public QWidget
|
||||
class FxLine : public QWidget
|
||||
{
|
||||
public:
|
||||
fxLine( QWidget * _parent, fxMixerView * _mv, QString & _name ) :
|
||||
FxLine( QWidget * _parent, FxMixerView * _mv, QString & _name ) :
|
||||
QWidget( _parent ),
|
||||
m_mv( _mv ),
|
||||
m_name( _name )
|
||||
@@ -86,8 +85,8 @@ public:
|
||||
{
|
||||
bool ok;
|
||||
QString new_name = QInputDialog::getText( this,
|
||||
fxMixerView::tr( "Rename FX channel" ),
|
||||
fxMixerView::tr( "Enter the new name for this "
|
||||
FxMixerView::tr( "Rename FX channel" ),
|
||||
FxMixerView::tr( "Enter the new name for this "
|
||||
"FX channel" ),
|
||||
QLineEdit::Normal, m_name, &ok );
|
||||
if( ok && !new_name.isEmpty() )
|
||||
@@ -99,7 +98,7 @@ public:
|
||||
|
||||
|
||||
private:
|
||||
fxMixerView * m_mv;
|
||||
FxMixerView * m_mv;
|
||||
QString & m_name;
|
||||
|
||||
} ;
|
||||
@@ -107,12 +106,12 @@ private:
|
||||
|
||||
|
||||
|
||||
fxMixerView::fxMixerView() :
|
||||
FxMixerView::FxMixerView() :
|
||||
QWidget(),
|
||||
modelView( NULL, this ),
|
||||
serializingObjectHook()
|
||||
ModelView( NULL, this ),
|
||||
SerializingObjectHook()
|
||||
{
|
||||
fxMixer * m = engine::getFxMixer();
|
||||
FxMixer * m = engine::fxMixer();
|
||||
m->setHook( this );
|
||||
|
||||
QPalette pal = palette();
|
||||
@@ -151,10 +150,10 @@ fxMixerView::fxMixerView() :
|
||||
|
||||
for( int i = 0; i < NumFxChannels+1; ++i )
|
||||
{
|
||||
fxChannelView * cv = &m_fxChannelViews[i];
|
||||
FxChannelView * cv = &m_fxChannelViews[i];
|
||||
if( i == 0 )
|
||||
{
|
||||
cv->m_fxLine = new fxLine( NULL, this,
|
||||
cv->m_fxLine = new FxLine( NULL, this,
|
||||
m->m_fxChannels[i]->m_name );
|
||||
ml->addWidget( cv->m_fxLine );
|
||||
ml->addSpacing( 10 );
|
||||
@@ -162,7 +161,7 @@ fxMixerView::fxMixerView() :
|
||||
else
|
||||
{
|
||||
const int bank = (i-1) / 16;
|
||||
cv->m_fxLine = new fxLine( NULL, this,
|
||||
cv->m_fxLine = new FxLine( NULL, this,
|
||||
m->m_fxChannels[i]->m_name );
|
||||
banks[bank]->addWidget( cv->m_fxLine );
|
||||
}
|
||||
@@ -190,7 +189,7 @@ fxMixerView::fxMixerView() :
|
||||
cv->m_muteBtn->move( 9, cv->m_fader->y()-16);
|
||||
toolTip::add( cv->m_muteBtn, tr( "Mute this FX channel" ) );
|
||||
|
||||
cv->m_rackView = new effectRackView(
|
||||
cv->m_rackView = new EffectRackView(
|
||||
&m->m_fxChannels[i]->m_fxChain, this );
|
||||
m_fxRacksLayout->addWidget( cv->m_rackView );
|
||||
if( i == 0 )
|
||||
@@ -228,13 +227,13 @@ fxMixerView::fxMixerView() :
|
||||
setCurrentFxLine( m_fxChannelViews[0].m_fxLine );
|
||||
|
||||
// timer for updating faders
|
||||
connect( engine::getMainWindow(), SIGNAL( periodicUpdate() ),
|
||||
connect( engine::mainWindow(), SIGNAL( periodicUpdate() ),
|
||||
this, SLOT( updateFaders() ) );
|
||||
|
||||
|
||||
// add ourself to workspace
|
||||
QMdiSubWindow * subWin =
|
||||
engine::getMainWindow()->workspace()->addSubWindow( this );
|
||||
engine::mainWindow()->workspace()->addSubWindow( this );
|
||||
Qt::WindowFlags flags = subWin->windowFlags();
|
||||
flags |= Qt::MSWindowsFixedSizeDialogHint;
|
||||
flags &= ~Qt::WindowMaximizeButtonHint;
|
||||
@@ -251,30 +250,30 @@ fxMixerView::fxMixerView() :
|
||||
|
||||
|
||||
|
||||
fxMixerView::~fxMixerView()
|
||||
FxMixerView::~FxMixerView()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void fxMixerView::saveSettings( QDomDocument & _doc, QDomElement & _this )
|
||||
void FxMixerView::saveSettings( QDomDocument & _doc, QDomElement & _this )
|
||||
{
|
||||
mainWindow::saveWidgetState( this, _this );
|
||||
MainWindow::saveWidgetState( this, _this );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void fxMixerView::loadSettings( const QDomElement & _this )
|
||||
void FxMixerView::loadSettings( const QDomElement & _this )
|
||||
{
|
||||
mainWindow::restoreWidgetState( this, _this );
|
||||
MainWindow::restoreWidgetState( this, _this );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void fxMixerView::setCurrentFxLine( fxLine * _line )
|
||||
void FxMixerView::setCurrentFxLine( FxLine * _line )
|
||||
{
|
||||
m_currentFxLine = _line;
|
||||
for( int i = 0; i < NumFxChannels+1; ++i )
|
||||
@@ -289,7 +288,7 @@ void fxMixerView::setCurrentFxLine( fxLine * _line )
|
||||
|
||||
|
||||
|
||||
void fxMixerView::setCurrentFxLine( int _line )
|
||||
void FxMixerView::setCurrentFxLine( int _line )
|
||||
{
|
||||
if ( _line >= 0 && _line < NumFxChannels+1 )
|
||||
{
|
||||
@@ -302,7 +301,7 @@ void fxMixerView::setCurrentFxLine( int _line )
|
||||
|
||||
|
||||
|
||||
void fxMixerView::clear( void )
|
||||
void FxMixerView::clear()
|
||||
{
|
||||
for( int i = 0; i <= NumFxChannels; ++i )
|
||||
{
|
||||
@@ -313,9 +312,9 @@ void fxMixerView::clear( void )
|
||||
|
||||
|
||||
|
||||
void fxMixerView::updateFaders( void )
|
||||
void FxMixerView::updateFaders()
|
||||
{
|
||||
fxMixer * m = engine::getFxMixer();
|
||||
FxMixer * m = engine::fxMixer();
|
||||
for( int i = 0; i < NumFxChannels+1; ++i )
|
||||
{
|
||||
const float opl = m_fxChannelViews[i].m_fader->getPeak_L();
|
||||
@@ -344,5 +343,5 @@ void fxMixerView::updateFaders( void )
|
||||
|
||||
|
||||
|
||||
#include "moc_fx_mixer_view.cxx"
|
||||
#include "moc_FxMixerView.cxx"
|
||||
|
||||
74
src/gui/InstrumentView.cpp
Normal file
74
src/gui/InstrumentView.cpp
Normal file
@@ -0,0 +1,74 @@
|
||||
/*
|
||||
* InstrumentView.cpp - base-class for views of all Instruments
|
||||
*
|
||||
* Copyright (c) 2008-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public
|
||||
* License along with this program (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "InstrumentView.h"
|
||||
#include "embed.h"
|
||||
#include "Instrument.h"
|
||||
#include "InstrumentTrack.h"
|
||||
#include "string_pair_drag.h"
|
||||
|
||||
|
||||
InstrumentView::InstrumentView( Instrument * _Instrument, QWidget * _parent ) :
|
||||
PluginView( _Instrument, _parent )
|
||||
{
|
||||
setModel( _Instrument );
|
||||
setFixedSize( 250, 250 );
|
||||
setAttribute( Qt::WA_DeleteOnClose, TRUE );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
InstrumentView::~InstrumentView()
|
||||
{
|
||||
if( instrumentTrackWindow() )
|
||||
{
|
||||
instrumentTrackWindow()->m_instrumentView = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void InstrumentView::setModel( Model * _model, bool )
|
||||
{
|
||||
if( dynamic_cast<Instrument *>( _model ) != NULL )
|
||||
{
|
||||
ModelView::setModel( _model );
|
||||
instrumentTrackWindow()->setWindowIcon(
|
||||
model()->descriptor()->logo->pixmap() );
|
||||
connect( model(), SIGNAL( destroyed( QObject * ) ),
|
||||
this, SLOT( close() ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
InstrumentTrackWindow * InstrumentView::instrumentTrackWindow( void )
|
||||
{
|
||||
return( dynamic_cast<InstrumentTrackWindow *>(
|
||||
parentWidget()->parentWidget() ) );
|
||||
}
|
||||
|
||||
@@ -34,15 +34,14 @@
|
||||
#include "embed.h"
|
||||
#include "engine.h"
|
||||
#include "led_checkbox.h"
|
||||
#include "main_window.h"
|
||||
#include "MainWindow.h"
|
||||
#include "tooltip.h"
|
||||
|
||||
|
||||
#include "LfoController.h"
|
||||
#include "ControllerDialog.h"
|
||||
#include "mv_base.h"
|
||||
#include "knob.h"
|
||||
#include "tempo_sync_knob.h"
|
||||
#include "TempoSyncKnob.h"
|
||||
#include "pixmap_button.h"
|
||||
|
||||
const int CD_ENV_KNOBS_LBL_Y = 20;
|
||||
@@ -80,7 +79,7 @@ LfoControllerDialog::LfoControllerDialog( Controller * _model, QWidget * _parent
|
||||
m_baseKnob->setWhatsThis( tr("todo") );
|
||||
|
||||
|
||||
m_speedKnob = new tempoSyncKnob( knobBright_26, this );
|
||||
m_speedKnob = new TempoSyncKnob( knobBright_26, this );
|
||||
m_speedKnob->setLabel( tr( "SPD" ) );
|
||||
m_speedKnob->move( CD_LFO_SPEED_CD_KNOB_X, CD_LFO_CD_KNOB_Y );
|
||||
m_speedKnob->setHintText( tr( "LFO-speed:" ) + " ", "" );
|
||||
|
||||
@@ -37,14 +37,14 @@
|
||||
#include <QtGui/QMessageBox>
|
||||
#include <QtGui/QSplitter>
|
||||
|
||||
#include "main_window.h"
|
||||
#include "MainWindow.h"
|
||||
#include "bb_editor.h"
|
||||
#include "song_editor.h"
|
||||
#include "song.h"
|
||||
#include "piano_roll.h"
|
||||
#include "embed.h"
|
||||
#include "engine.h"
|
||||
#include "fx_mixer_view.h"
|
||||
#include "FxMixerView.h"
|
||||
#include "about_dialog.h"
|
||||
#include "ControllerRackView.h"
|
||||
#include "file_browser.h"
|
||||
@@ -52,20 +52,20 @@
|
||||
#include "side_bar.h"
|
||||
#include "config_mgr.h"
|
||||
#include "mixer.h"
|
||||
#include "plugin_view.h"
|
||||
#include "PluginView.h"
|
||||
#include "project_notes.h"
|
||||
#include "setup_dialog.h"
|
||||
#include "AudioDummy.h"
|
||||
#include "tool.h"
|
||||
#include "ToolPlugin.h"
|
||||
#include "tool_button.h"
|
||||
#include "project_journal.h"
|
||||
#include "ProjectJournal.h"
|
||||
#include "automation_editor.h"
|
||||
#include "templates.h"
|
||||
|
||||
|
||||
|
||||
|
||||
mainWindow::mainWindow( void ) :
|
||||
MainWindow::MainWindow( void ) :
|
||||
m_workspace( NULL ),
|
||||
m_templatesMenu( NULL ),
|
||||
m_recentlyOpenedProjectsMenu( NULL ),
|
||||
@@ -187,12 +187,12 @@ mainWindow::mainWindow( void ) :
|
||||
|
||||
|
||||
|
||||
mainWindow::~mainWindow()
|
||||
MainWindow::~MainWindow()
|
||||
{
|
||||
for( QList<pluginView *>::iterator it = m_tools.begin();
|
||||
for( QList<PluginView *>::iterator it = m_tools.begin();
|
||||
it != m_tools.end(); ++it )
|
||||
{
|
||||
model * m = ( *it )->getModel();
|
||||
Model * m = ( *it )->model();
|
||||
delete *it;
|
||||
delete m;
|
||||
}
|
||||
@@ -204,7 +204,7 @@ mainWindow::~mainWindow()
|
||||
|
||||
|
||||
|
||||
void mainWindow::finalize( void )
|
||||
void MainWindow::finalize( void )
|
||||
{
|
||||
resetWindowTitle();
|
||||
setWindowIcon( embed::getIconPixmap( "icon" ) );
|
||||
@@ -273,17 +273,17 @@ void mainWindow::finalize( void )
|
||||
|
||||
|
||||
m_toolsMenu = new QMenu( this );
|
||||
QVector<plugin::descriptor> pluginDescriptors;
|
||||
plugin::getDescriptorsOfAvailPlugins( pluginDescriptors );
|
||||
for( QVector<plugin::descriptor>::iterator it =
|
||||
QVector<Plugin::Descriptor> pluginDescriptors;
|
||||
Plugin::getDescriptorsOfAvailPlugins( pluginDescriptors );
|
||||
for( QVector<Plugin::Descriptor>::iterator it =
|
||||
pluginDescriptors.begin();
|
||||
it != pluginDescriptors.end(); ++it )
|
||||
{
|
||||
if( it->type == plugin::Tool )
|
||||
if( it->type == Plugin::Tool )
|
||||
{
|
||||
m_toolsMenu->addAction( it->logo->pixmap(),
|
||||
it->displayName );
|
||||
m_tools.push_back( tool::instantiate( it->name,
|
||||
m_tools.push_back( ToolPlugin::instantiate( it->name,
|
||||
/*this*/NULL )->createView( this ) );
|
||||
}
|
||||
}
|
||||
@@ -502,7 +502,7 @@ void mainWindow::finalize( void )
|
||||
|
||||
|
||||
|
||||
int mainWindow::addWidgetToToolBar( QWidget * _w, int _row, int _col )
|
||||
int MainWindow::addWidgetToToolBar( QWidget * _w, int _row, int _col )
|
||||
{
|
||||
int col = ( _col == -1 ) ? m_toolBarLayout->columnCount() + 7 : _col;
|
||||
if( _w->height() > 32 || _row == -1 )
|
||||
@@ -519,7 +519,7 @@ int mainWindow::addWidgetToToolBar( QWidget * _w, int _row, int _col )
|
||||
|
||||
|
||||
|
||||
void mainWindow::addSpacingToToolBar( int _size )
|
||||
void MainWindow::addSpacingToToolBar( int _size )
|
||||
{
|
||||
m_toolBarLayout->setColumnMinimumWidth( m_toolBarLayout->columnCount() +
|
||||
7, _size );
|
||||
@@ -528,7 +528,7 @@ void mainWindow::addSpacingToToolBar( int _size )
|
||||
|
||||
|
||||
|
||||
void mainWindow::resetWindowTitle( void )
|
||||
void MainWindow::resetWindowTitle( void )
|
||||
{
|
||||
QString title = "";
|
||||
if( engine::getSong()->projectFileName() != "" )
|
||||
@@ -550,7 +550,7 @@ void mainWindow::resetWindowTitle( void )
|
||||
|
||||
|
||||
|
||||
bool mainWindow::mayChangeProject( void )
|
||||
bool MainWindow::mayChangeProject( void )
|
||||
{
|
||||
if( !engine::getSong()->isModified() )
|
||||
{
|
||||
@@ -583,7 +583,7 @@ bool mainWindow::mayChangeProject( void )
|
||||
|
||||
|
||||
|
||||
void mainWindow::clearKeyModifiers( void )
|
||||
void MainWindow::clearKeyModifiers( void )
|
||||
{
|
||||
m_keyMods.m_ctrl = FALSE;
|
||||
m_keyMods.m_shift = FALSE;
|
||||
@@ -593,7 +593,7 @@ void mainWindow::clearKeyModifiers( void )
|
||||
|
||||
|
||||
|
||||
void mainWindow::saveWidgetState( QWidget * _w, QDomElement & _de )
|
||||
void MainWindow::saveWidgetState( QWidget * _w, QDomElement & _de )
|
||||
{
|
||||
if( _w->parentWidget() != NULL &&
|
||||
_w->parentWidget()->inherits( "QMdiSubWindow" ) )
|
||||
@@ -614,7 +614,7 @@ void mainWindow::saveWidgetState( QWidget * _w, QDomElement & _de )
|
||||
|
||||
|
||||
|
||||
void mainWindow::restoreWidgetState( QWidget * _w, const QDomElement & _de )
|
||||
void MainWindow::restoreWidgetState( QWidget * _w, const QDomElement & _de )
|
||||
{
|
||||
QRect r( qMax( 0, _de.attribute( "x" ).toInt() ),
|
||||
qMax( 0, _de.attribute( "y" ).toInt() ),
|
||||
@@ -643,7 +643,7 @@ void mainWindow::restoreWidgetState( QWidget * _w, const QDomElement & _de )
|
||||
|
||||
|
||||
|
||||
void mainWindow::createNewProject( void )
|
||||
void MainWindow::createNewProject( void )
|
||||
{
|
||||
if( mayChangeProject() )
|
||||
{
|
||||
@@ -654,7 +654,7 @@ void mainWindow::createNewProject( void )
|
||||
|
||||
|
||||
|
||||
void mainWindow::createNewProjectFromTemplate( QAction * _idx )
|
||||
void MainWindow::createNewProjectFromTemplate( QAction * _idx )
|
||||
{
|
||||
if( m_templatesMenu != NULL && mayChangeProject() )
|
||||
{
|
||||
@@ -671,7 +671,7 @@ void mainWindow::createNewProjectFromTemplate( QAction * _idx )
|
||||
|
||||
|
||||
|
||||
void mainWindow::openProject( void )
|
||||
void MainWindow::openProject( void )
|
||||
{
|
||||
if( mayChangeProject() )
|
||||
{
|
||||
@@ -693,7 +693,7 @@ void mainWindow::openProject( void )
|
||||
|
||||
|
||||
|
||||
void mainWindow::updateRecentlyOpenedProjectsMenu( void )
|
||||
void MainWindow::updateRecentlyOpenedProjectsMenu( void )
|
||||
{
|
||||
m_recentlyOpenedProjectsMenu->clear();
|
||||
QStringList rup = configManager::inst()->recentlyOpenedProjects();
|
||||
@@ -707,7 +707,7 @@ void mainWindow::updateRecentlyOpenedProjectsMenu( void )
|
||||
|
||||
|
||||
|
||||
void mainWindow::openRecentlyOpenedProject( QAction * _action )
|
||||
void MainWindow::openRecentlyOpenedProject( QAction * _action )
|
||||
{
|
||||
const QString & f = _action->text();
|
||||
setCursor( Qt::WaitCursor );
|
||||
@@ -719,7 +719,7 @@ void mainWindow::openRecentlyOpenedProject( QAction * _action )
|
||||
|
||||
|
||||
|
||||
bool mainWindow::saveProject( void )
|
||||
bool MainWindow::saveProject( void )
|
||||
{
|
||||
if( engine::getSong()->projectFileName() == "" )
|
||||
{
|
||||
@@ -735,7 +735,7 @@ bool mainWindow::saveProject( void )
|
||||
|
||||
|
||||
|
||||
bool mainWindow::saveProjectAs( void )
|
||||
bool MainWindow::saveProjectAs( void )
|
||||
{
|
||||
QFileDialog sfd( this, tr( "Save project" ), "",
|
||||
tr( "MultiMedia Project (*.mmp *.mmpz);;"
|
||||
@@ -766,7 +766,7 @@ bool mainWindow::saveProjectAs( void )
|
||||
|
||||
|
||||
|
||||
void mainWindow::showSettingsDialog( void )
|
||||
void MainWindow::showSettingsDialog( void )
|
||||
{
|
||||
setupDialog sd;
|
||||
sd.exec();
|
||||
@@ -775,7 +775,7 @@ void mainWindow::showSettingsDialog( void )
|
||||
|
||||
|
||||
|
||||
void mainWindow::aboutLMMS( void )
|
||||
void MainWindow::aboutLMMS( void )
|
||||
{
|
||||
aboutDialog().exec();
|
||||
}
|
||||
@@ -783,7 +783,7 @@ void mainWindow::aboutLMMS( void )
|
||||
|
||||
|
||||
|
||||
void mainWindow::help( void )
|
||||
void MainWindow::help( void )
|
||||
{
|
||||
QMessageBox::information( this, tr( "Help not available" ),
|
||||
tr( "Currently there's no help "
|
||||
@@ -797,7 +797,7 @@ void mainWindow::help( void )
|
||||
|
||||
|
||||
|
||||
void mainWindow::toggleWindow( QWidget * _w )
|
||||
void MainWindow::toggleWindow( QWidget * _w )
|
||||
{
|
||||
if( m_workspace->activeSubWindow() != _w->parentWidget()
|
||||
|| _w->parentWidget()->isHidden() )
|
||||
@@ -815,7 +815,7 @@ void mainWindow::toggleWindow( QWidget * _w )
|
||||
|
||||
|
||||
|
||||
void mainWindow::toggleBBEditorWin( void )
|
||||
void MainWindow::toggleBBEditorWin( void )
|
||||
{
|
||||
toggleWindow( engine::getBBEditor() );
|
||||
}
|
||||
@@ -823,7 +823,7 @@ void mainWindow::toggleBBEditorWin( void )
|
||||
|
||||
|
||||
|
||||
void mainWindow::toggleSongEditorWin( void )
|
||||
void MainWindow::toggleSongEditorWin( void )
|
||||
{
|
||||
toggleWindow( engine::getSongEditor() );
|
||||
}
|
||||
@@ -831,7 +831,7 @@ void mainWindow::toggleSongEditorWin( void )
|
||||
|
||||
|
||||
|
||||
void mainWindow::toggleProjectNotesWin( void )
|
||||
void MainWindow::toggleProjectNotesWin( void )
|
||||
{
|
||||
toggleWindow( engine::getProjectNotes() );
|
||||
}
|
||||
@@ -839,7 +839,7 @@ void mainWindow::toggleProjectNotesWin( void )
|
||||
|
||||
|
||||
|
||||
void mainWindow::togglePianoRollWin( void )
|
||||
void MainWindow::togglePianoRollWin( void )
|
||||
{
|
||||
toggleWindow( engine::getPianoRoll() );
|
||||
}
|
||||
@@ -847,7 +847,7 @@ void mainWindow::togglePianoRollWin( void )
|
||||
|
||||
|
||||
|
||||
void mainWindow::toggleAutomationEditorWin( void )
|
||||
void MainWindow::toggleAutomationEditorWin( void )
|
||||
{
|
||||
toggleWindow( engine::getAutomationEditor() );
|
||||
}
|
||||
@@ -855,15 +855,15 @@ void mainWindow::toggleAutomationEditorWin( void )
|
||||
|
||||
|
||||
|
||||
void mainWindow::toggleFxMixerWin( void )
|
||||
void MainWindow::toggleFxMixerWin( void )
|
||||
{
|
||||
toggleWindow( engine::getFxMixerView() );
|
||||
toggleWindow( engine::fxMixerView() );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void mainWindow::toggleControllerRack( void )
|
||||
void MainWindow::toggleControllerRack( void )
|
||||
{
|
||||
toggleWindow( engine::getControllerRackView() );
|
||||
}
|
||||
@@ -871,23 +871,23 @@ void mainWindow::toggleControllerRack( void )
|
||||
|
||||
|
||||
|
||||
void mainWindow::undo( void )
|
||||
void MainWindow::undo( void )
|
||||
{
|
||||
engine::getProjectJournal()->undo();
|
||||
engine::projectJournal()->undo();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void mainWindow::redo( void )
|
||||
void MainWindow::redo( void )
|
||||
{
|
||||
engine::getProjectJournal()->redo();
|
||||
engine::projectJournal()->redo();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void mainWindow::closeEvent( QCloseEvent * _ce )
|
||||
void MainWindow::closeEvent( QCloseEvent * _ce )
|
||||
{
|
||||
if( mayChangeProject() )
|
||||
{
|
||||
@@ -902,7 +902,7 @@ void mainWindow::closeEvent( QCloseEvent * _ce )
|
||||
|
||||
|
||||
|
||||
void mainWindow::focusOutEvent( QFocusEvent * _fe )
|
||||
void MainWindow::focusOutEvent( QFocusEvent * _fe )
|
||||
{
|
||||
// when loosing focus we do not receive key-(release!)-events anymore,
|
||||
// so we might miss release-events of one the modifiers we're watching!
|
||||
@@ -913,7 +913,7 @@ void mainWindow::focusOutEvent( QFocusEvent * _fe )
|
||||
|
||||
|
||||
|
||||
void mainWindow::keyPressEvent( QKeyEvent * _ke )
|
||||
void MainWindow::keyPressEvent( QKeyEvent * _ke )
|
||||
{
|
||||
switch( _ke->key() )
|
||||
{
|
||||
@@ -928,7 +928,7 @@ void mainWindow::keyPressEvent( QKeyEvent * _ke )
|
||||
|
||||
|
||||
|
||||
void mainWindow::keyReleaseEvent( QKeyEvent * _ke )
|
||||
void MainWindow::keyReleaseEvent( QKeyEvent * _ke )
|
||||
{
|
||||
switch( _ke->key() )
|
||||
{
|
||||
@@ -943,7 +943,7 @@ void mainWindow::keyReleaseEvent( QKeyEvent * _ke )
|
||||
|
||||
|
||||
|
||||
void mainWindow::timerEvent( QTimerEvent * )
|
||||
void MainWindow::timerEvent( QTimerEvent * )
|
||||
{
|
||||
emit periodicUpdate();
|
||||
}
|
||||
@@ -951,7 +951,7 @@ void mainWindow::timerEvent( QTimerEvent * )
|
||||
|
||||
|
||||
|
||||
void mainWindow::fillTemplatesMenu( void )
|
||||
void MainWindow::fillTemplatesMenu( void )
|
||||
{
|
||||
m_templatesMenu->clear();
|
||||
|
||||
@@ -989,9 +989,9 @@ void mainWindow::fillTemplatesMenu( void )
|
||||
|
||||
|
||||
|
||||
void mainWindow::showTool( QAction * _idx )
|
||||
void MainWindow::showTool( QAction * _idx )
|
||||
{
|
||||
pluginView * p = m_tools[m_toolsMenu->actions().indexOf( _idx )];
|
||||
PluginView * p = m_tools[m_toolsMenu->actions().indexOf( _idx )];
|
||||
p->show();
|
||||
p->parentWidget()->show();
|
||||
p->setFocus();
|
||||
@@ -1000,7 +1000,7 @@ void mainWindow::showTool( QAction * _idx )
|
||||
|
||||
|
||||
|
||||
void mainWindow::browseHelp( void )
|
||||
void MainWindow::browseHelp( void )
|
||||
{
|
||||
// file:// alternative for offline help
|
||||
QString url = "http://lmms.sf.net/wiki/index.php?title=Main_Page";
|
||||
@@ -1011,7 +1011,7 @@ void mainWindow::browseHelp( void )
|
||||
|
||||
|
||||
|
||||
#include "moc_main_window.cxx"
|
||||
#include "moc_MainWindow.cxx"
|
||||
|
||||
|
||||
#endif
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* mv_base.cpp - base for M/V-architecture of LMMS
|
||||
* ModelView.cpp - implementation of ModelView.cpp
|
||||
*
|
||||
* Copyright (c) 2007-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* Copyright (c) 2007-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
@@ -22,39 +22,13 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#include <QtGui/QWidget>
|
||||
|
||||
|
||||
#include "mv_base.h"
|
||||
#include "ModelView.h"
|
||||
|
||||
|
||||
|
||||
QString model::fullDisplayName( void ) const
|
||||
{
|
||||
const QString & n = displayName();
|
||||
if( parentModel() )
|
||||
{
|
||||
const QString p = parentModel()->fullDisplayName();
|
||||
if( n.isEmpty() && p.isEmpty() )
|
||||
{
|
||||
return QString::null;
|
||||
}
|
||||
else if( p.isEmpty() )
|
||||
{
|
||||
return( n );
|
||||
}
|
||||
return p + ">" + n;
|
||||
}
|
||||
return n;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
modelView::modelView( model * _model, QWidget * _this ) :
|
||||
ModelView::ModelView( Model * _model, QWidget * _this ) :
|
||||
m_widget( _this ),
|
||||
m_model( _model )
|
||||
{
|
||||
@@ -63,7 +37,7 @@ modelView::modelView( model * _model, QWidget * _this ) :
|
||||
|
||||
|
||||
|
||||
modelView::~modelView()
|
||||
ModelView::~ModelView()
|
||||
{
|
||||
if( m_model != NULL && m_model->defaultConstructed() )
|
||||
{
|
||||
@@ -74,7 +48,7 @@ modelView::~modelView()
|
||||
|
||||
|
||||
|
||||
void modelView::setModel( model * _model, bool _old_model_valid )
|
||||
void ModelView::setModel( Model * _model, bool _old_model_valid )
|
||||
{
|
||||
if( _old_model_valid && m_model != NULL )
|
||||
{
|
||||
@@ -99,7 +73,7 @@ void modelView::setModel( model * _model, bool _old_model_valid )
|
||||
|
||||
|
||||
|
||||
void modelView::doConnections( void )
|
||||
void ModelView::doConnections()
|
||||
{
|
||||
if( m_model != NULL )
|
||||
{
|
||||
@@ -112,5 +86,3 @@ void modelView::doConnections( void )
|
||||
}
|
||||
|
||||
|
||||
#include "moc_mv_base.cxx"
|
||||
|
||||
@@ -34,17 +34,16 @@
|
||||
#include "gui_templates.h"
|
||||
#include "embed.h"
|
||||
#include "engine.h"
|
||||
#include "main_window.h"
|
||||
#include "MainWindow.h"
|
||||
#include "tooltip.h"
|
||||
|
||||
|
||||
#include "PeakController.h"
|
||||
#include "ControllerDialog.h"
|
||||
#include "mv_base.h"
|
||||
#include "knob.h"
|
||||
#include "tempo_sync_knob.h"
|
||||
#include "TempoSyncKnob.h"
|
||||
#include "pixmap_button.h"
|
||||
|
||||
|
||||
PeakControllerDialog::PeakControllerDialog( Controller * _model, QWidget * _parent ) :
|
||||
ControllerDialog( _model, _parent )
|
||||
{
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
#ifndef SINGLE_SOURCE_COMPILE
|
||||
|
||||
/*
|
||||
* piano.cpp - implementation of piano-widget used in instrument-track-window
|
||||
* for testing
|
||||
* Piano.cpp - implementation of piano-widget used in instrument-track-window
|
||||
* for testing + according model class
|
||||
*
|
||||
* Copyright (c) 2004-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2004-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -38,24 +36,23 @@
|
||||
* \todo write isWhite inline function and replace throughout
|
||||
*/
|
||||
|
||||
#include "piano.h"
|
||||
|
||||
|
||||
#include <QtGui/QCursor>
|
||||
#include <QtGui/QKeyEvent>
|
||||
#include <QtGui/QMouseEvent>
|
||||
#include <QtGui/QPainter>
|
||||
#include <QtGui/QVBoxLayout>
|
||||
|
||||
|
||||
#include "automation_pattern.h"
|
||||
#include "PianoView.h"
|
||||
#include "caption_menu.h"
|
||||
#include "embed.h"
|
||||
#include "engine.h"
|
||||
#include "gui_templates.h"
|
||||
#include "instrument_track.h"
|
||||
#include "InstrumentTrack.h"
|
||||
#include "knob.h"
|
||||
#include "string_pair_drag.h"
|
||||
#include "main_window.h"
|
||||
#include "MainWindow.h"
|
||||
#include "midi.h"
|
||||
#include "templates.h"
|
||||
#include "update_event.h"
|
||||
@@ -68,12 +65,14 @@
|
||||
|
||||
/*! The black / white order of keys as they appear on the keyboard.
|
||||
*/
|
||||
const KeyTypes KEY_ORDER[] =
|
||||
const Piano::KeyTypes KEY_ORDER[] =
|
||||
{
|
||||
// C CIS D DIS E F
|
||||
WhiteKey, BlackKey, WhiteKey, BlackKey, WhiteKey, WhiteKey,
|
||||
// FIS G GIS A B H
|
||||
BlackKey, WhiteKey, BlackKey, WhiteKey, BlackKey, WhiteKey
|
||||
// C CIS D DIS
|
||||
Piano::WhiteKey, Piano::BlackKey, Piano::WhiteKey, Piano::BlackKey,
|
||||
// E F FIS G
|
||||
Piano::WhiteKey, Piano::WhiteKey, Piano::BlackKey, Piano::WhiteKey,
|
||||
// GIS A B H
|
||||
Piano::BlackKey, Piano::WhiteKey, Piano::BlackKey, Piano::WhiteKey
|
||||
} ;
|
||||
|
||||
|
||||
@@ -85,10 +84,10 @@ Keys WhiteKeys[] =
|
||||
} ;
|
||||
|
||||
|
||||
QPixmap * pianoView::s_whiteKeyPm = NULL; /*!< A white key released */
|
||||
QPixmap * pianoView::s_blackKeyPm = NULL; /*!< A black key released */
|
||||
QPixmap * pianoView::s_whiteKeyPressedPm = NULL; /*!< A white key pressed */
|
||||
QPixmap * pianoView::s_blackKeyPressedPm = NULL; /*!< A black key pressed */
|
||||
QPixmap * PianoView::s_whiteKeyPm = NULL; /*!< A white key released */
|
||||
QPixmap * PianoView::s_blackKeyPm = NULL; /*!< A black key released */
|
||||
QPixmap * PianoView::s_whiteKeyPressedPm = NULL; /*!< A white key pressed */
|
||||
QPixmap * PianoView::s_blackKeyPressedPm = NULL; /*!< A black key pressed */
|
||||
|
||||
|
||||
const int PIANO_BASE = 11; /*!< The height of the root note display */
|
||||
@@ -101,127 +100,55 @@ const int LABEL_TEXT_SIZE = 7; /*!< The height of the key label text */
|
||||
|
||||
|
||||
|
||||
/*! \brief Create a new keyboard display
|
||||
*
|
||||
* \param _it the InstrumentTrack window to attach to
|
||||
*/
|
||||
piano::piano( instrumentTrack * _it ) :
|
||||
model( _it ), /*!< our model */
|
||||
m_instrumentTrack( _it ) /*!< the instrumentTrack model */
|
||||
{
|
||||
for( int i = 0; i < KeysPerOctave * NumOctaves; ++i )
|
||||
{
|
||||
m_pressedKeys[i] = FALSE;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*! \brief Destroy this new keyboard display
|
||||
*
|
||||
*/
|
||||
piano::~piano()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*! \brief Turn a key on or off
|
||||
*
|
||||
* \param _key the key number to change
|
||||
* \param _on the state to set the key to
|
||||
*/
|
||||
void piano::setKeyState( int _key, bool _on )
|
||||
{
|
||||
m_pressedKeys[tLimit( _key, 0, KeysPerOctave * NumOctaves - 1 )] = _on;
|
||||
emit dataChanged();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*! \brief Handle a note being pressed on our keyboard display
|
||||
*
|
||||
* \param _key the key being pressed
|
||||
*/
|
||||
void piano::handleKeyPress( int _key )
|
||||
{
|
||||
m_instrumentTrack->processInEvent( midiEvent( MidiNoteOn, 0, _key,
|
||||
MidiMaxVelocity ), midiTime() );
|
||||
m_pressedKeys[_key] = TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*! \brief Handle a note being released on our keyboard display
|
||||
*
|
||||
* \param _key the key being releassed
|
||||
*/
|
||||
void piano::handleKeyRelease( int _key )
|
||||
{
|
||||
m_instrumentTrack->processInEvent( midiEvent( MidiNoteOff, 0, _key, 0 ),
|
||||
midiTime() );
|
||||
m_pressedKeys[_key] = FALSE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*! \brief Create a new keyboard display view
|
||||
*
|
||||
* \param _parent the parent instrument plugin window
|
||||
* \todo are the descriptions of the m_startkey and m_lastkey properties correct?
|
||||
*/
|
||||
pianoView::pianoView( QWidget * _parent ) :
|
||||
PianoView::PianoView( QWidget * _parent ) :
|
||||
QWidget( _parent ), /*!< Our parent */
|
||||
modelView( NULL, this ), /*!< Our view model */
|
||||
m_piano( NULL ), /*!< Our piano model */
|
||||
ModelView( NULL, this ), /*!< Our view Model */
|
||||
m_piano( NULL ), /*!< Our piano Model */
|
||||
m_startKey( Key_C + Octave_3*KeysPerOctave ), /*!< The first key displayed? */
|
||||
m_lastKey( -1 ) /*!< The last key displayed? */
|
||||
{
|
||||
if( s_whiteKeyPm == NULL )
|
||||
{
|
||||
s_whiteKeyPm = new QPixmap( embed::getIconPixmap(
|
||||
"white_key" ) );
|
||||
s_whiteKeyPm = new QPixmap( embed::getIconPixmap( "white_key" ) );
|
||||
}
|
||||
if( s_blackKeyPm == NULL )
|
||||
{
|
||||
s_blackKeyPm = new QPixmap( embed::getIconPixmap(
|
||||
"black_key" ) );
|
||||
s_blackKeyPm = new QPixmap( embed::getIconPixmap( "black_key" ) );
|
||||
}
|
||||
if( s_whiteKeyPressedPm == NULL )
|
||||
{
|
||||
s_whiteKeyPressedPm = new QPixmap( embed::getIconPixmap(
|
||||
"white_key_pressed" ) );
|
||||
s_whiteKeyPressedPm = new QPixmap( embed::getIconPixmap( "white_key_pressed" ) );
|
||||
}
|
||||
if ( s_blackKeyPressedPm == NULL )
|
||||
{
|
||||
s_blackKeyPressedPm = new QPixmap( embed::getIconPixmap(
|
||||
"black_key_pressed" ) );
|
||||
s_blackKeyPressedPm = new QPixmap( embed::getIconPixmap( "black_key_pressed" ) );
|
||||
}
|
||||
|
||||
setAttribute( Qt::WA_OpaquePaintEvent, true );
|
||||
setFocusPolicy( Qt::StrongFocus );
|
||||
setMaximumWidth( WhiteKeysPerOctave * NumOctaves * PW_WHITE_KEY_WIDTH );
|
||||
|
||||
// create scrollbar at the bottom
|
||||
m_pianoScroll = new QScrollBar( Qt::Horizontal, this );
|
||||
m_pianoScroll->setRange( 0, WhiteKeysPerOctave * ( NumOctaves - 3 ) -
|
||||
5 );
|
||||
m_pianoScroll->setSingleStep( 1 );
|
||||
m_pianoScroll->setPageStep( 20 );
|
||||
m_pianoScroll->setValue( Octave_3 * WhiteKeysPerOctave );
|
||||
m_pianoScroll->setGeometry( 0, PIANO_BASE + PW_WHITE_KEY_HEIGHT, 250,
|
||||
16 );
|
||||
// ...and connect it to this widget...
|
||||
|
||||
// and connect it to this widget
|
||||
connect( m_pianoScroll, SIGNAL( valueChanged( int ) ),
|
||||
this, SLOT( pianoScrolled( int ) ) );
|
||||
this, SLOT( pianoScrolled( int ) ) );
|
||||
|
||||
// create a layout for ourselves
|
||||
QVBoxLayout * layout = new QVBoxLayout( this );
|
||||
layout->setSpacing( 0 );
|
||||
layout->setMargin( 0 );
|
||||
layout->addSpacing( PIANO_BASE+PW_WHITE_KEY_HEIGHT );
|
||||
layout->addWidget( m_pianoScroll );
|
||||
|
||||
}
|
||||
|
||||
@@ -231,7 +158,7 @@ pianoView::pianoView( QWidget * _parent ) :
|
||||
/*! \brief Destroy this piano display view
|
||||
*
|
||||
*/
|
||||
pianoView::~pianoView()
|
||||
PianoView::~PianoView()
|
||||
{
|
||||
}
|
||||
|
||||
@@ -244,7 +171,7 @@ pianoView::~pianoView()
|
||||
* \todo check the scan codes for ',' = c, 'L' = c#, '.' = d, ':' = d#,
|
||||
* '/' = d, '[' = f', '=' = f'#, ']' = g' - Paul's additions
|
||||
*/
|
||||
int pianoView::getKeyFromKeyEvent( QKeyEvent * _ke )
|
||||
int PianoView::getKeyFromKeyEvent( QKeyEvent * _ke )
|
||||
{
|
||||
#ifdef LMMS_BUILD_APPLE
|
||||
const int k = _ke->nativeVirtualKey();
|
||||
@@ -379,9 +306,9 @@ int pianoView::getKeyFromKeyEvent( QKeyEvent * _ke )
|
||||
/*! \brief Register a change to this piano display view
|
||||
*
|
||||
*/
|
||||
void pianoView::modelChanged( void )
|
||||
void PianoView::modelChanged()
|
||||
{
|
||||
m_piano = castModel<piano>();
|
||||
m_piano = castModel<Piano>();
|
||||
if( m_piano != NULL )
|
||||
{
|
||||
connect( m_piano->m_instrumentTrack->baseNoteModel(),
|
||||
@@ -413,13 +340,14 @@ void pianoView::modelChanged( void )
|
||||
*
|
||||
* \param _p The point that the mouse was pressed.
|
||||
*/
|
||||
int pianoView::getKeyFromMouse( const QPoint & _p ) const
|
||||
int PianoView::getKeyFromMouse( const QPoint & _p ) const
|
||||
{
|
||||
int key_num = (int)( (float) _p.x() / (float) PW_WHITE_KEY_WIDTH );
|
||||
|
||||
for( int i = 0; i <= key_num; ++i )
|
||||
{
|
||||
if( KEY_ORDER[( m_startKey+i ) % KeysPerOctave] == BlackKey )
|
||||
if( KEY_ORDER[( m_startKey+i ) % KeysPerOctave] ==
|
||||
Piano::BlackKey )
|
||||
{
|
||||
++key_num;
|
||||
}
|
||||
@@ -432,17 +360,17 @@ int pianoView::getKeyFromMouse( const QPoint & _p ) const
|
||||
{
|
||||
// then do extra checking whether the mouse-cursor is over
|
||||
// a black key
|
||||
if( key_num > 0 && KEY_ORDER[( key_num - 1 ) % KeysPerOctave] ==
|
||||
BlackKey &&
|
||||
if( key_num > 0 && KEY_ORDER[(key_num-1 ) % KeysPerOctave] ==
|
||||
Piano::BlackKey &&
|
||||
_p.x() % PW_WHITE_KEY_WIDTH <=
|
||||
( PW_WHITE_KEY_WIDTH / 2 ) -
|
||||
( PW_BLACK_KEY_WIDTH / 2 ) )
|
||||
{
|
||||
--key_num;
|
||||
}
|
||||
if( key_num < KeysPerOctave * NumOctaves - 1 &&
|
||||
if( key_num < NumKeys - 1 &&
|
||||
KEY_ORDER[( key_num + 1 ) % KeysPerOctave] ==
|
||||
BlackKey &&
|
||||
Piano::BlackKey &&
|
||||
_p.x() % PW_WHITE_KEY_WIDTH >=
|
||||
( PW_WHITE_KEY_WIDTH -
|
||||
PW_BLACK_KEY_WIDTH / 2 ) )
|
||||
@@ -452,7 +380,7 @@ int pianoView::getKeyFromMouse( const QPoint & _p ) const
|
||||
}
|
||||
|
||||
// some range-checking-stuff
|
||||
return tLimit( key_num, 0, KeysPerOctave * NumOctaves - 1 );
|
||||
return tLimit( key_num, 0, NumKeys - 1 );
|
||||
}
|
||||
|
||||
|
||||
@@ -465,7 +393,7 @@ int pianoView::getKeyFromMouse( const QPoint & _p ) const
|
||||
*
|
||||
* \param _new_pos the new key position.
|
||||
*/
|
||||
void pianoView::pianoScrolled( int _new_pos )
|
||||
void PianoView::pianoScrolled( int _new_pos )
|
||||
{
|
||||
m_startKey = WhiteKeys[_new_pos % WhiteKeysPerOctave]+
|
||||
( _new_pos / WhiteKeysPerOctave ) * KeysPerOctave;
|
||||
@@ -481,7 +409,7 @@ void pianoView::pianoScrolled( int _new_pos )
|
||||
* \param _me the ContextMenuEvent to handle.
|
||||
* \todo Is this right, or does this create the context menu?
|
||||
*/
|
||||
void pianoView::contextMenuEvent( QContextMenuEvent * _me )
|
||||
void PianoView::contextMenuEvent( QContextMenuEvent * _me )
|
||||
{
|
||||
if( _me->pos().y() > PIANO_BASE || m_piano == NULL )
|
||||
{
|
||||
@@ -490,7 +418,7 @@ void pianoView::contextMenuEvent( QContextMenuEvent * _me )
|
||||
}
|
||||
|
||||
captionMenu contextMenu( tr( "Base note" ) );
|
||||
automatableModelView amv( m_piano->m_instrumentTrack->baseNoteModel(),
|
||||
AutomatableModelView amv( m_piano->m_instrumentTrack->baseNoteModel(),
|
||||
&contextMenu );
|
||||
amv.addDefaultActions( &contextMenu );
|
||||
contextMenu.exec( QCursor::pos() );
|
||||
@@ -517,7 +445,7 @@ void pianoView::contextMenuEvent( QContextMenuEvent * _me )
|
||||
*
|
||||
* \param _me the mouse click to handle.
|
||||
*/
|
||||
void pianoView::mousePressEvent( QMouseEvent * _me )
|
||||
void PianoView::mousePressEvent( QMouseEvent * _me )
|
||||
{
|
||||
if( _me->button() == Qt::LeftButton && m_piano != NULL )
|
||||
{
|
||||
@@ -528,16 +456,16 @@ void pianoView::mousePressEvent( QMouseEvent * _me )
|
||||
int y_diff = _me->pos().y() - PIANO_BASE;
|
||||
int velocity = (int)( ( float ) y_diff /
|
||||
( ( KEY_ORDER[key_num % KeysPerOctave] ==
|
||||
WhiteKey ) ?
|
||||
Piano::WhiteKey ) ?
|
||||
PW_WHITE_KEY_HEIGHT : PW_BLACK_KEY_HEIGHT ) *
|
||||
(float) MidiMaxVelocity );
|
||||
if( y_diff < 0 )
|
||||
{
|
||||
velocity = 0;
|
||||
}
|
||||
else if( y_diff > ( ( KEY_ORDER[key_num %
|
||||
KeysPerOctave] ==
|
||||
WhiteKey ) ?
|
||||
else if( y_diff >
|
||||
( ( KEY_ORDER[key_num % KeysPerOctave] ==
|
||||
Piano::WhiteKey ) ?
|
||||
PW_WHITE_KEY_HEIGHT : PW_BLACK_KEY_HEIGHT ) )
|
||||
{
|
||||
velocity = MidiMaxVelocity;
|
||||
@@ -547,8 +475,10 @@ void pianoView::mousePressEvent( QMouseEvent * _me )
|
||||
midiEvent( MidiNoteOn, 0, key_num,
|
||||
velocity ),
|
||||
midiTime() );
|
||||
m_piano->m_pressedKeys[key_num] = TRUE;
|
||||
m_piano->m_pressedKeys[key_num] = true;
|
||||
m_lastKey = key_num;
|
||||
|
||||
emit keyPressed( key_num );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -566,6 +496,8 @@ void pianoView::mousePressEvent( QMouseEvent * _me )
|
||||
m_piano->m_instrumentTrack->
|
||||
baseNoteModel()->
|
||||
setInitValue( (float) key_num );
|
||||
|
||||
emit baseNoteChanged();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -585,16 +517,16 @@ void pianoView::mousePressEvent( QMouseEvent * _me )
|
||||
*
|
||||
* \param _me the mousePressEvent to handle.
|
||||
*/
|
||||
void pianoView::mouseReleaseEvent( QMouseEvent * )
|
||||
void PianoView::mouseReleaseEvent( QMouseEvent * )
|
||||
{
|
||||
if( m_lastKey != -1 )
|
||||
{
|
||||
if( m_piano != NULL )
|
||||
{
|
||||
m_piano->m_instrumentTrack->processInEvent(
|
||||
m_piano->m_midiEvProc->processInEvent(
|
||||
midiEvent( MidiNoteOff, 0, m_lastKey, 0 ),
|
||||
midiTime() );
|
||||
m_piano->m_pressedKeys[m_lastKey] = FALSE;
|
||||
m_piano->m_pressedKeys[m_lastKey] = false;
|
||||
}
|
||||
|
||||
// and let the user see that he released a key... :)
|
||||
@@ -621,7 +553,7 @@ void pianoView::mouseReleaseEvent( QMouseEvent * )
|
||||
* reduce or remove the duplication between this, the mousePressEvent()
|
||||
* and mouseReleaseEvent() methods.
|
||||
*/
|
||||
void pianoView::mouseMoveEvent( QMouseEvent * _me )
|
||||
void PianoView::mouseMoveEvent( QMouseEvent * _me )
|
||||
{
|
||||
if( m_piano == NULL )
|
||||
{
|
||||
@@ -631,7 +563,7 @@ void pianoView::mouseMoveEvent( QMouseEvent * _me )
|
||||
int key_num = getKeyFromMouse( _me->pos() );
|
||||
int y_diff = _me->pos().y() - PIANO_BASE;
|
||||
int velocity = (int)( (float) y_diff /
|
||||
( ( KEY_ORDER[key_num % KeysPerOctave] == WhiteKey ) ?
|
||||
( ( KEY_ORDER[key_num % KeysPerOctave] == Piano::WhiteKey ) ?
|
||||
PW_WHITE_KEY_HEIGHT : PW_BLACK_KEY_HEIGHT ) *
|
||||
(float) MidiMaxVelocity );
|
||||
// maybe the user moved the mouse-cursor above or under the
|
||||
@@ -642,7 +574,7 @@ void pianoView::mouseMoveEvent( QMouseEvent * _me )
|
||||
velocity = 0;
|
||||
}
|
||||
else if( y_diff >
|
||||
( ( KEY_ORDER[key_num % KeysPerOctave] == WhiteKey ) ?
|
||||
( ( KEY_ORDER[key_num % KeysPerOctave] == Piano::WhiteKey ) ?
|
||||
PW_WHITE_KEY_HEIGHT : PW_BLACK_KEY_HEIGHT ) )
|
||||
{
|
||||
velocity = MidiMaxVelocity;
|
||||
@@ -654,21 +586,21 @@ void pianoView::mouseMoveEvent( QMouseEvent * _me )
|
||||
{
|
||||
if( m_lastKey != -1 )
|
||||
{
|
||||
m_piano->m_instrumentTrack->processInEvent(
|
||||
m_piano->m_midiEvProc->processInEvent(
|
||||
midiEvent( MidiNoteOff, 0, m_lastKey, 0 ),
|
||||
midiTime() );
|
||||
m_piano->m_pressedKeys[m_lastKey] = FALSE;
|
||||
m_piano->m_pressedKeys[m_lastKey] = false;
|
||||
m_lastKey = -1;
|
||||
}
|
||||
if( _me->buttons() & Qt::LeftButton )
|
||||
{
|
||||
if( _me->pos().y() > PIANO_BASE )
|
||||
{
|
||||
m_piano->m_instrumentTrack->processInEvent(
|
||||
m_piano->m_midiEvProc->processInEvent(
|
||||
midiEvent( MidiNoteOn, 0, key_num,
|
||||
velocity ),
|
||||
midiTime() );
|
||||
m_piano->m_pressedKeys[key_num] = TRUE;
|
||||
m_piano->m_pressedKeys[key_num] = true;
|
||||
m_lastKey = key_num;
|
||||
}
|
||||
else
|
||||
@@ -681,9 +613,9 @@ void pianoView::mouseMoveEvent( QMouseEvent * _me )
|
||||
// and let the user see that he pressed a key... :)
|
||||
update();
|
||||
}
|
||||
else if( m_piano->m_pressedKeys[key_num] == TRUE )
|
||||
else if( m_piano->m_pressedKeys[key_num] == true )
|
||||
{
|
||||
m_piano->m_instrumentTrack->processInEvent(
|
||||
m_piano->m_midiEvProc->processInEvent(
|
||||
midiEvent( MidiKeyPressure, 0, key_num,
|
||||
velocity ),
|
||||
midiTime() );
|
||||
@@ -702,12 +634,12 @@ void pianoView::mouseMoveEvent( QMouseEvent * _me )
|
||||
*
|
||||
* \param _ke the KeyEvent to handle.
|
||||
*/
|
||||
void pianoView::keyPressEvent( QKeyEvent * _ke )
|
||||
void PianoView::keyPressEvent( QKeyEvent * _ke )
|
||||
{
|
||||
const int key_num = getKeyFromKeyEvent( _ke ) +
|
||||
( DefaultOctave - 1 ) * KeysPerOctave;
|
||||
|
||||
if( _ke->isAutoRepeat() == FALSE && key_num > -1 )
|
||||
if( _ke->isAutoRepeat() == false && key_num > -1 )
|
||||
{
|
||||
if( m_piano != NULL )
|
||||
{
|
||||
@@ -730,11 +662,11 @@ void pianoView::keyPressEvent( QKeyEvent * _ke )
|
||||
*
|
||||
* \param _ke the KeyEvent to handle.
|
||||
*/
|
||||
void pianoView::keyReleaseEvent( QKeyEvent * _ke )
|
||||
void PianoView::keyReleaseEvent( QKeyEvent * _ke )
|
||||
{
|
||||
const int key_num = getKeyFromKeyEvent( _ke ) +
|
||||
( DefaultOctave - 1 ) * KeysPerOctave;
|
||||
if( _ke->isAutoRepeat() == FALSE && key_num > -1 )
|
||||
if( _ke->isAutoRepeat() == false && key_num > -1 )
|
||||
{
|
||||
if( m_piano != NULL )
|
||||
{
|
||||
@@ -757,7 +689,7 @@ void pianoView::keyReleaseEvent( QKeyEvent * _ke )
|
||||
*
|
||||
* \todo Is there supposed to be a parameter given here?
|
||||
*/
|
||||
void pianoView::focusOutEvent( QFocusEvent * )
|
||||
void PianoView::focusOutEvent( QFocusEvent * )
|
||||
{
|
||||
if( m_piano == NULL )
|
||||
{
|
||||
@@ -779,14 +711,14 @@ void pianoView::focusOutEvent( QFocusEvent * )
|
||||
// if we loose focus, we HAVE to note off all running notes because
|
||||
// we don't receive key-release-events anymore and so the notes would
|
||||
// hang otherwise
|
||||
for( int i = 0; i < KeysPerOctave * NumOctaves; ++i )
|
||||
for( int i = 0; i < NumKeys; ++i )
|
||||
{
|
||||
if( m_piano->m_pressedKeys[i] == TRUE )
|
||||
if( m_piano->m_pressedKeys[i] == true )
|
||||
{
|
||||
m_piano->m_instrumentTrack->processInEvent(
|
||||
m_piano->m_midiEvProc->processInEvent(
|
||||
midiEvent( MidiNoteOff, 0, i, 0 ),
|
||||
midiTime() );
|
||||
m_piano->m_pressedKeys[i] = FALSE;
|
||||
m_piano->m_pressedKeys[i] = false;
|
||||
}
|
||||
}
|
||||
update();
|
||||
@@ -795,6 +727,24 @@ void pianoView::focusOutEvent( QFocusEvent * )
|
||||
|
||||
|
||||
|
||||
/*! \brief update scrollbar range after resize
|
||||
*
|
||||
* After resizing we need to adjust range of scrollbar for not allowing
|
||||
* to scroll too far to the right.
|
||||
*
|
||||
* \param _event resize-event object (unused)
|
||||
*/
|
||||
void PianoView::resizeEvent( QResizeEvent * _event )
|
||||
{
|
||||
QWidget::resizeEvent( _event );
|
||||
m_pianoScroll->setRange( 0, WhiteKeysPerOctave * NumOctaves -
|
||||
(int) ceil( (float) width() /
|
||||
PW_WHITE_KEY_WIDTH ) );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*! \brief Convert a key number to an X coordinate in the piano display view
|
||||
*
|
||||
* We can immediately discard the trivial case of when the key number is
|
||||
@@ -809,7 +759,7 @@ void pianoView::focusOutEvent( QFocusEvent * )
|
||||
* \todo is this description of what the method does correct?
|
||||
* \todo replace the final subtract with initialising x to width/2.
|
||||
*/
|
||||
int pianoView::getKeyX( int _key_num ) const
|
||||
int PianoView::getKeyX( int _key_num ) const
|
||||
{
|
||||
int k = m_startKey;
|
||||
if( _key_num < m_startKey )
|
||||
@@ -822,7 +772,7 @@ int pianoView::getKeyX( int _key_num ) const
|
||||
|
||||
while( k <= _key_num )
|
||||
{
|
||||
if( KEY_ORDER[k % KeysPerOctave] == WhiteKey )
|
||||
if( KEY_ORDER[k % KeysPerOctave] == Piano::WhiteKey )
|
||||
{
|
||||
++white_cnt;
|
||||
if( white_cnt > 1 )
|
||||
@@ -858,7 +808,7 @@ int pianoView::getKeyX( int _key_num ) const
|
||||
*
|
||||
* \todo Is there supposed to be a parameter given here?
|
||||
*/
|
||||
void pianoView::paintEvent( QPaintEvent * )
|
||||
void PianoView::paintEvent( QPaintEvent * )
|
||||
{
|
||||
QPainter p( this );
|
||||
|
||||
@@ -886,7 +836,7 @@ void pianoView::paintEvent( QPaintEvent * )
|
||||
g.setColorAt( 0, QColor( 0, 96, 0 ) );
|
||||
g.setColorAt( 0.1, QColor( 64, 255, 64 ) );
|
||||
g.setColorAt( 1, QColor( 0, 96, 0 ) );
|
||||
if( KEY_ORDER[base_key % KeysPerOctave] == WhiteKey )
|
||||
if( KEY_ORDER[base_key % KeysPerOctave] == Piano::WhiteKey )
|
||||
{
|
||||
p.fillRect( QRect( getKeyX( base_key ), 1, PW_WHITE_KEY_WIDTH-1,
|
||||
PIANO_BASE-2 ), g );
|
||||
@@ -903,14 +853,14 @@ void pianoView::paintEvent( QPaintEvent * )
|
||||
// draw all white keys...
|
||||
for( int x = 0; x < width(); )
|
||||
{
|
||||
while( KEY_ORDER[cur_key%KeysPerOctave] != WhiteKey )
|
||||
while( KEY_ORDER[cur_key%KeysPerOctave] != Piano::WhiteKey )
|
||||
{
|
||||
++cur_key;
|
||||
}
|
||||
|
||||
// draw pressed or not pressed key, depending on state of
|
||||
// current key
|
||||
if( m_piano && m_piano->m_pressedKeys[cur_key] == TRUE )
|
||||
if( m_piano && m_piano->m_pressedKeys[cur_key] == true )
|
||||
{
|
||||
p.drawPixmap( x, PIANO_BASE, *s_whiteKeyPressedPm );
|
||||
}
|
||||
@@ -939,9 +889,9 @@ void pianoView::paintEvent( QPaintEvent * )
|
||||
|
||||
int s_key = m_startKey;
|
||||
if( s_key > 0 &&
|
||||
KEY_ORDER[(Keys)( --s_key ) % KeysPerOctave] == BlackKey )
|
||||
KEY_ORDER[(Keys)(--s_key) % KeysPerOctave] == Piano::BlackKey )
|
||||
{
|
||||
if( m_piano && m_piano->m_pressedKeys[s_key] == TRUE )
|
||||
if( m_piano && m_piano->m_pressedKeys[s_key] == true )
|
||||
{
|
||||
p.drawPixmap( 0 - PW_WHITE_KEY_WIDTH / 2, PIANO_BASE,
|
||||
*s_blackKeyPressedPm );
|
||||
@@ -956,11 +906,11 @@ void pianoView::paintEvent( QPaintEvent * )
|
||||
// now draw all black keys...
|
||||
for( int x = 0; x < width(); )
|
||||
{
|
||||
if( KEY_ORDER[cur_key%KeysPerOctave] == BlackKey )
|
||||
if( KEY_ORDER[cur_key%KeysPerOctave] == Piano::BlackKey )
|
||||
{
|
||||
// draw pressed or not pressed key, depending on
|
||||
// state of current key
|
||||
if( m_piano && m_piano->m_pressedKeys[cur_key] == TRUE )
|
||||
if( m_piano && m_piano->m_pressedKeys[cur_key] == true )
|
||||
{
|
||||
p.drawPixmap( x + PW_WHITE_KEY_WIDTH / 2,
|
||||
PIANO_BASE,
|
||||
@@ -991,8 +941,5 @@ void pianoView::paintEvent( QPaintEvent * )
|
||||
|
||||
|
||||
|
||||
#include "moc_PianoView.cxx"
|
||||
|
||||
#include "moc_piano.cxx"
|
||||
|
||||
|
||||
#endif
|
||||
47
src/gui/ToolPluginView.cpp
Normal file
47
src/gui/ToolPluginView.cpp
Normal file
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* ToolPluginView.cpp - implementation of ToolPluginView
|
||||
*
|
||||
* Copyright (c) 2006-2008 Javier Serrano Polo <jasp00/at/users.sourceforge.net>
|
||||
* Copyright (c) 2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public
|
||||
* License along with this program (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "ToolPlugin.h"
|
||||
#include "ToolPluginView.h"
|
||||
|
||||
#include <QtGui/QIcon>
|
||||
#include <QtGui/QMdiArea>
|
||||
|
||||
#include "embed.h"
|
||||
#include "engine.h"
|
||||
#include "MainWindow.h"
|
||||
|
||||
|
||||
ToolPluginView::ToolPluginView( ToolPlugin * _toolPlugin ) :
|
||||
PluginView( _toolPlugin, NULL )
|
||||
{
|
||||
engine::mainWindow()->workspace()->addSubWindow( this );
|
||||
parentWidget()->setAttribute( Qt::WA_DeleteOnClose, false );
|
||||
|
||||
setWindowTitle( _toolPlugin->displayName() );
|
||||
setWindowIcon( _toolPlugin->descriptor()->logo->pixmap() );
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#include "about_dialog.h"
|
||||
#include "embed.h"
|
||||
#include "engine.h"
|
||||
#include "main_window.h"
|
||||
#include "MainWindow.h"
|
||||
|
||||
|
||||
#ifdef __GNUC__
|
||||
@@ -62,7 +62,7 @@
|
||||
|
||||
|
||||
aboutDialog::aboutDialog() :
|
||||
QDialog( engine::getMainWindow() ),
|
||||
QDialog( engine::mainWindow() ),
|
||||
Ui::AboutDialog()
|
||||
{
|
||||
setupUi( this );
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
|
||||
|
||||
#include "song_editor.h"
|
||||
#include "main_window.h"
|
||||
#include "MainWindow.h"
|
||||
#include "embed.h"
|
||||
#include "engine.h"
|
||||
#include "pixmap_button.h"
|
||||
@@ -308,7 +308,7 @@ automationEditor::automationEditor( void ) :
|
||||
m_quantizeComboBox->setFixedSize( 60, 22 );
|
||||
|
||||
// TODO: leak
|
||||
comboBoxModel * quantize_model = new comboBoxModel( /* this */ );
|
||||
ComboBoxModel * quantize_model = new ComboBoxModel( /* this */ );
|
||||
for( int i = 0; i < 7; ++i )
|
||||
{
|
||||
quantize_model->addItem( "1/" + QString::number( 1 << i ) );
|
||||
@@ -357,9 +357,9 @@ automationEditor::automationEditor( void ) :
|
||||
setMinimumSize( tb_layout->minimumSize().width(), 128 );
|
||||
|
||||
// add us to workspace
|
||||
if( engine::getMainWindow()->workspace() )
|
||||
if( engine::mainWindow()->workspace() )
|
||||
{
|
||||
engine::getMainWindow()->workspace()->addSubWindow( this );
|
||||
engine::mainWindow()->workspace()->addSubWindow( this );
|
||||
parentWidget()->resize( INITIAL_WIDTH, INITIAL_HEIGHT );
|
||||
parentWidget()->hide();
|
||||
}
|
||||
@@ -414,7 +414,7 @@ void automationEditor::setCurrentPattern( automationPattern * _new_pattern )
|
||||
|
||||
void automationEditor::saveSettings( QDomDocument & _doc, QDomElement & _this )
|
||||
{
|
||||
mainWindow::saveWidgetState( this, _this );
|
||||
MainWindow::saveWidgetState( this, _this );
|
||||
}
|
||||
|
||||
|
||||
@@ -422,7 +422,7 @@ void automationEditor::saveSettings( QDomDocument & _doc, QDomElement & _this )
|
||||
|
||||
void automationEditor::loadSettings( const QDomElement & _this )
|
||||
{
|
||||
mainWindow::restoreWidgetState( this, _this );
|
||||
MainWindow::restoreWidgetState( this, _this );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
#include "embed.h"
|
||||
#include "engine.h"
|
||||
#include "gui_templates.h"
|
||||
#include "project_journal.h"
|
||||
#include "ProjectJournal.h"
|
||||
#include "rename_dialog.h"
|
||||
#include "string_pair_drag.h"
|
||||
#include "tooltip.h"
|
||||
@@ -69,7 +69,7 @@ automationPatternView::~automationPatternView()
|
||||
|
||||
|
||||
|
||||
void automationPatternView::update( void )
|
||||
void automationPatternView::update()
|
||||
{
|
||||
m_needsUpdate = true;
|
||||
if( fixedTCOs() )
|
||||
@@ -82,7 +82,7 @@ void automationPatternView::update( void )
|
||||
|
||||
|
||||
|
||||
void automationPatternView::resetName( void )
|
||||
void automationPatternView::resetName()
|
||||
{
|
||||
m_pat->setName( QString::null );
|
||||
}
|
||||
@@ -90,7 +90,7 @@ void automationPatternView::resetName( void )
|
||||
|
||||
|
||||
|
||||
void automationPatternView::changeName( void )
|
||||
void automationPatternView::changeName()
|
||||
{
|
||||
QString s = m_pat->name();
|
||||
renameDialog rename_dlg( s );
|
||||
@@ -104,13 +104,13 @@ void automationPatternView::changeName( void )
|
||||
|
||||
void automationPatternView::disconnectObject( QAction * _a )
|
||||
{
|
||||
journallingObject * j = engine::getProjectJournal()->
|
||||
getJournallingObject( _a->data().toInt() );
|
||||
if( j && dynamic_cast<automatableModel *>( j ) )
|
||||
JournallingObject * j = engine::projectJournal()->
|
||||
journallingObject( _a->data().toInt() );
|
||||
if( j && dynamic_cast<AutomatableModel *>( j ) )
|
||||
{
|
||||
m_pat->m_objects.erase( qFind( m_pat->m_objects.begin(),
|
||||
m_pat->m_objects.end(),
|
||||
dynamic_cast<automatableModel *>( j ) ) );
|
||||
dynamic_cast<AutomatableModel *>( j ) ) );
|
||||
update();
|
||||
}
|
||||
}
|
||||
@@ -309,9 +309,9 @@ void automationPatternView::dropEvent( QDropEvent * _de )
|
||||
QString val = stringPairDrag::decodeValue( _de );
|
||||
if( type == "automatable_model" )
|
||||
{
|
||||
automatableModel * mod = dynamic_cast<automatableModel *>(
|
||||
engine::getProjectJournal()->
|
||||
getJournallingObject( val.toInt() ) );
|
||||
AutomatableModel * mod = dynamic_cast<AutomatableModel *>(
|
||||
engine::projectJournal()->
|
||||
journallingObject( val.toInt() ) );
|
||||
if( mod != NULL )
|
||||
{
|
||||
m_pat->addObject( mod );
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
#include "bb_editor.h"
|
||||
#include "bb_track_container.h"
|
||||
#include "embed.h"
|
||||
#include "main_window.h"
|
||||
#include "MainWindow.h"
|
||||
#include "song.h"
|
||||
#include "tool_button.h"
|
||||
|
||||
@@ -112,7 +112,7 @@ bbEditor::bbEditor( bbTrackContainer * _tc ) :
|
||||
tb_layout->addWidget( l );
|
||||
tb_layout->addSpacing( 15 );
|
||||
|
||||
engine::getMainWindow()->workspace()->addSubWindow( this );
|
||||
engine::mainWindow()->workspace()->addSubWindow( this );
|
||||
parentWidget()->setAttribute( Qt::WA_DeleteOnClose, FALSE );
|
||||
parentWidget()->layout()->setSizeConstraint( QLayout::SetMinimumSize );
|
||||
parentWidget()->resize( minimumWidth(), 300 );
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
#include "export_project_dialog.h"
|
||||
#include "engine.h"
|
||||
#include "main_window.h"
|
||||
#include "MainWindow.h"
|
||||
#include "ProjectRenderer.h"
|
||||
|
||||
|
||||
@@ -149,7 +149,7 @@ void exportProjectDialog::startBtnClicked()
|
||||
connect( m_renderer, SIGNAL( finished() ),
|
||||
this, SLOT( accept() ) );
|
||||
connect( m_renderer, SIGNAL( finished() ),
|
||||
engine::getMainWindow(), SLOT( resetWindowTitle() ) );
|
||||
engine::mainWindow(), SLOT( resetWindowTitle() ) );
|
||||
|
||||
m_renderer->startProcessing();
|
||||
}
|
||||
@@ -164,7 +164,7 @@ void exportProjectDialog::startBtnClicked()
|
||||
|
||||
void exportProjectDialog::updateTitleBar( int _prog )
|
||||
{
|
||||
engine::getMainWindow()->setWindowTitle(
|
||||
engine::mainWindow()->setWindowTitle(
|
||||
tr( "Rendering: %1%" ).arg( _prog ) );
|
||||
}
|
||||
|
||||
|
||||
@@ -39,10 +39,10 @@
|
||||
#include "embed.h"
|
||||
#include "engine.h"
|
||||
#include "gui_templates.h"
|
||||
#include "import_filter.h"
|
||||
#include "instrument.h"
|
||||
#include "instrument_track.h"
|
||||
#include "main_window.h"
|
||||
#include "ImportFilter.h"
|
||||
#include "Instrument.h"
|
||||
#include "InstrumentTrack.h"
|
||||
#include "MainWindow.h"
|
||||
#include "mmp.h"
|
||||
#include "preset_preview_play_handle.h"
|
||||
#include "sample_play_handle.h"
|
||||
@@ -542,13 +542,13 @@ void fileBrowserTreeWidget::mouseReleaseEvent( QMouseEvent * _me )
|
||||
|
||||
|
||||
|
||||
void fileBrowserTreeWidget::handleFile( fileItem * f, instrumentTrack * _it )
|
||||
void fileBrowserTreeWidget::handleFile( fileItem * f, InstrumentTrack * _it )
|
||||
{
|
||||
engine::getMixer()->lock();
|
||||
switch( f->handling() )
|
||||
{
|
||||
case fileItem::LoadAsProject:
|
||||
if( engine::getMainWindow()->mayChangeProject() )
|
||||
if( engine::mainWindow()->mayChangeProject() )
|
||||
{
|
||||
engine::getSong()->loadProject( f->fullName() );
|
||||
}
|
||||
@@ -557,9 +557,9 @@ void fileBrowserTreeWidget::handleFile( fileItem * f, instrumentTrack * _it )
|
||||
case fileItem::LoadByPlugin:
|
||||
{
|
||||
const QString e = f->extension();
|
||||
instrument * i = _it->getInstrument();
|
||||
Instrument * i = _it->instrument();
|
||||
if( i == NULL ||
|
||||
!i->getDescriptor()->supportsFileType( e ) )
|
||||
!i->descriptor()->supportsFileType( e ) )
|
||||
{
|
||||
i = _it->loadInstrument(
|
||||
engine::pluginFileHandling()[e] );
|
||||
@@ -571,7 +571,7 @@ void fileBrowserTreeWidget::handleFile( fileItem * f, instrumentTrack * _it )
|
||||
case fileItem::LoadAsPreset:
|
||||
{
|
||||
multimediaProject mmp( f->fullName() );
|
||||
instrumentTrack::removeMidiPortNode( mmp );
|
||||
InstrumentTrack::removeMidiPortNode( mmp );
|
||||
_it->setSimpleSerializing();
|
||||
_it->loadSettings( mmp.content().toElement() );
|
||||
break;
|
||||
@@ -579,11 +579,11 @@ void fileBrowserTreeWidget::handleFile( fileItem * f, instrumentTrack * _it )
|
||||
|
||||
case fileItem::ImportAsProject:
|
||||
if( f->type() == fileItem::FlpFile &&
|
||||
!engine::getMainWindow()->mayChangeProject() )
|
||||
!engine::mainWindow()->mayChangeProject() )
|
||||
{
|
||||
break;
|
||||
}
|
||||
importFilter::import( f->fullName(),
|
||||
ImportFilter::import( f->fullName(),
|
||||
engine::getSong() );
|
||||
break;
|
||||
|
||||
@@ -615,7 +615,7 @@ void fileBrowserTreeWidget::activateListItem( QTreeWidgetItem * _item,
|
||||
else if( f->handling() != fileItem::NotSupported )
|
||||
{
|
||||
engine::getMixer()->lock();
|
||||
instrumentTrack * it = dynamic_cast<instrumentTrack *>(
|
||||
InstrumentTrack * it = dynamic_cast<InstrumentTrack *>(
|
||||
track::create( track::InstrumentTrack,
|
||||
engine::getBBTrackContainer() ) );
|
||||
handleFile( f, it );
|
||||
@@ -632,7 +632,7 @@ void fileBrowserTreeWidget::openInNewInstrumentTrack( trackContainer * _tc )
|
||||
m_contextMenuItem->handling() == fileItem::LoadByPlugin )
|
||||
{
|
||||
engine::getMixer()->lock();
|
||||
instrumentTrack * it = dynamic_cast<instrumentTrack *>(
|
||||
InstrumentTrack * it = dynamic_cast<InstrumentTrack *>(
|
||||
track::create( track::InstrumentTrack, _tc ) );
|
||||
handleFile( m_contextMenuItem, it );
|
||||
engine::getMixer()->unlock();
|
||||
@@ -662,7 +662,7 @@ void fileBrowserTreeWidget::sendToActiveInstrumentTrack( void )
|
||||
{
|
||||
// get all windows opened in the workspace
|
||||
QList<QMdiSubWindow*> pl =
|
||||
engine::getMainWindow()->workspace()->
|
||||
engine::mainWindow()->workspace()->
|
||||
subWindowList( QMdiArea::StackingOrder );
|
||||
QListIterator<QMdiSubWindow *> w( pl );
|
||||
w.toBack();
|
||||
@@ -670,8 +670,8 @@ void fileBrowserTreeWidget::sendToActiveInstrumentTrack( void )
|
||||
// instrument-track
|
||||
while( w.hasPrevious() )
|
||||
{
|
||||
instrumentTrackWindow * itw =
|
||||
dynamic_cast<instrumentTrackWindow *>(
|
||||
InstrumentTrackWindow * itw =
|
||||
dynamic_cast<InstrumentTrackWindow *>(
|
||||
w.previous()->widget() );
|
||||
if( itw != NULL && itw->isHidden() == false )
|
||||
{
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*
|
||||
* Copyright (c) 2004-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2008 Andrew Kelley <superjoe30/at/gmail/dot/com>
|
||||
*
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
@@ -24,9 +24,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "piano_roll.h"
|
||||
|
||||
#include <QtGui/QApplication>
|
||||
#include <QtGui/QButtonGroup>
|
||||
#include <QtGui/QClipboard>
|
||||
@@ -35,32 +32,32 @@
|
||||
#include <QtGui/QLayout>
|
||||
#include <QtGui/QMdiArea>
|
||||
#include <QtGui/QPainter>
|
||||
#include <QtGui/QScrollBar>
|
||||
#include <QtGui/QStyleOption>
|
||||
#include <QtGui/QWheelEvent>
|
||||
#include <QString>
|
||||
#include <QSignalMapper>
|
||||
|
||||
|
||||
#ifndef __USE_XOPEN
|
||||
#define __USE_XOPEN
|
||||
#endif
|
||||
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#include "piano_roll.h"
|
||||
#include "bb_track_container.h"
|
||||
#include "clipboard.h"
|
||||
#include "Clipboard.h"
|
||||
#include "combobox.h"
|
||||
#include "debug.h"
|
||||
#include "detuning_helper.h"
|
||||
#include "embed.h"
|
||||
#include "gui_templates.h"
|
||||
#include "instrument_track.h"
|
||||
#include "main_window.h"
|
||||
#include "InstrumentTrack.h"
|
||||
#include "MainWindow.h"
|
||||
#include "midi.h"
|
||||
#include "mmp.h"
|
||||
#include "pattern.h"
|
||||
#include "piano.h"
|
||||
#include "Piano.h"
|
||||
#include "pixmap_button.h"
|
||||
#include "song.h"
|
||||
#include "song_editor.h"
|
||||
@@ -137,7 +134,7 @@ pianoRoll::pianoRollKeyTypes pianoRoll::prKeyOrder[] =
|
||||
const int DEFAULT_PR_PPT = KEY_LINE_HEIGHT * DefaultStepsPerTact;
|
||||
|
||||
|
||||
pianoRoll::pianoRoll( void ) :
|
||||
pianoRoll::pianoRoll() :
|
||||
m_nemStr( QVector<QString>() ),
|
||||
m_noteEditMenu( NULL ),
|
||||
m_signalMapper( NULL ),
|
||||
@@ -449,7 +446,7 @@ pianoRoll::pianoRoll( void ) :
|
||||
note_len_lbl->setPixmap( embed::getIconPixmap( "note" ) );
|
||||
|
||||
m_noteLenModel.addItem( tr( "Last note" ),
|
||||
new pixmapLoader( "edit_draw" ) );
|
||||
new PixmapLoader( "edit_draw" ) );
|
||||
const QString pixmaps[] = { "whole", "half", "quarter", "eighth",
|
||||
"sixteenth", "thirtysecond", "triplethalf",
|
||||
"tripletquarter", "tripleteighth",
|
||||
@@ -458,12 +455,12 @@ pianoRoll::pianoRoll( void ) :
|
||||
for( int i = 0; i < NUM_EVEN_LENGTHS; ++i )
|
||||
{
|
||||
m_noteLenModel.addItem( "1/" + QString::number( 1 << i ),
|
||||
new pixmapLoader( "note_" + pixmaps[i] ) );
|
||||
new PixmapLoader( "note_" + pixmaps[i] ) );
|
||||
}
|
||||
for( int i = 0; i < NUM_TRIPLET_LENGTHS; ++i )
|
||||
{
|
||||
m_noteLenModel.addItem( "1/" + QString::number( (1 << i) * 3 ),
|
||||
new pixmapLoader( "note_" + pixmaps[i+NUM_EVEN_LENGTHS] ) );
|
||||
new PixmapLoader( "note_" + pixmaps[i+NUM_EVEN_LENGTHS] ) );
|
||||
}
|
||||
m_noteLenModel.setValue( 0 );
|
||||
m_noteLenComboBox = new comboBox( m_toolBar );
|
||||
@@ -515,9 +512,9 @@ pianoRoll::pianoRoll( void ) :
|
||||
setMinimumSize( tb_layout->minimumSize().width(), 160 );
|
||||
|
||||
// add us to workspace
|
||||
if( engine::getMainWindow()->workspace() )
|
||||
if( engine::mainWindow()->workspace() )
|
||||
{
|
||||
engine::getMainWindow()->workspace()->addSubWindow( this );
|
||||
engine::mainWindow()->workspace()->addSubWindow( this );
|
||||
parentWidget()->resize( INITIAL_PIANOROLL_WIDTH,
|
||||
INITIAL_PIANOROLL_HEIGHT );
|
||||
parentWidget()->hide();
|
||||
@@ -549,7 +546,7 @@ void pianoRoll::setCurrentPattern( pattern * _new_pattern )
|
||||
{
|
||||
if( validPattern() )
|
||||
{
|
||||
m_pattern->getInstrumentTrack()->disconnect( this );
|
||||
m_pattern->instrumentTrack()->disconnect( this );
|
||||
}
|
||||
|
||||
m_pattern = _new_pattern;
|
||||
@@ -597,10 +594,10 @@ void pianoRoll::setCurrentPattern( pattern * _new_pattern )
|
||||
// of start-notes and so on...)
|
||||
resizeEvent( NULL );
|
||||
|
||||
connect( m_pattern->getInstrumentTrack(),
|
||||
connect( m_pattern->instrumentTrack(),
|
||||
SIGNAL( noteOn( const note & ) ),
|
||||
this, SLOT( startRecordNote( const note & ) ) );
|
||||
connect( m_pattern->getInstrumentTrack(),
|
||||
connect( m_pattern->instrumentTrack(),
|
||||
SIGNAL( noteOff( const note & ) ),
|
||||
this, SLOT( finishRecordNote( const note & ) ) );
|
||||
|
||||
@@ -614,7 +611,7 @@ void pianoRoll::setCurrentPattern( pattern * _new_pattern )
|
||||
|
||||
void pianoRoll::saveSettings( QDomDocument & _doc, QDomElement & _this )
|
||||
{
|
||||
mainWindow::saveWidgetState( this, _this );
|
||||
MainWindow::saveWidgetState( this, _this );
|
||||
}
|
||||
|
||||
|
||||
@@ -622,7 +619,7 @@ void pianoRoll::saveSettings( QDomDocument & _doc, QDomElement & _this )
|
||||
|
||||
void pianoRoll::loadSettings( const QDomElement & _this )
|
||||
{
|
||||
mainWindow::restoreWidgetState( this, _this );
|
||||
MainWindow::restoreWidgetState( this, _this );
|
||||
}
|
||||
|
||||
|
||||
@@ -746,7 +743,7 @@ inline void pianoRoll::drawDetuningInfo( QPainter & _p, note * _n, int _x,
|
||||
|
||||
|
||||
|
||||
void pianoRoll::removeSelection( void )
|
||||
void pianoRoll::removeSelection()
|
||||
{
|
||||
m_selectStartTick = 0;
|
||||
m_selectedTick = 0;
|
||||
@@ -759,7 +756,7 @@ void pianoRoll::removeSelection( void )
|
||||
|
||||
|
||||
|
||||
void pianoRoll::clearSelectedNotes( void )
|
||||
void pianoRoll::clearSelectedNotes()
|
||||
{
|
||||
if( m_pattern != NULL )
|
||||
{
|
||||
@@ -856,7 +853,7 @@ void pianoRoll::shiftPos( int amount ) //shift notes pos by amount
|
||||
|
||||
|
||||
|
||||
bool pianoRoll::isSelection( void ) const // are any notes selected?
|
||||
bool pianoRoll::isSelection() const // are any notes selected?
|
||||
{
|
||||
const NoteVector & notes = m_pattern->notes();
|
||||
for( NoteVector::ConstIterator it = notes.begin(); it != notes.end();
|
||||
@@ -873,7 +870,7 @@ bool pianoRoll::isSelection( void ) const // are any notes selected?
|
||||
|
||||
|
||||
|
||||
int pianoRoll::selectionCount( void ) const // how many notes are selected?
|
||||
int pianoRoll::selectionCount() const // how many notes are selected?
|
||||
{
|
||||
int sum = 0;
|
||||
|
||||
@@ -896,13 +893,13 @@ void pianoRoll::keyPressEvent( QKeyEvent * _ke )
|
||||
{
|
||||
if( validPattern() && _ke->modifiers() == Qt::NoModifier )
|
||||
{
|
||||
const int key_num = pianoView::getKeyFromKeyEvent( _ke ) +
|
||||
const int key_num = PianoView::getKeyFromKeyEvent( _ke ) +
|
||||
( DefaultOctave - 1 ) * KeysPerOctave;
|
||||
|
||||
if( _ke->isAutoRepeat() == false && key_num > -1 )
|
||||
{
|
||||
m_pattern->getInstrumentTrack()->
|
||||
getPiano()->handleKeyPress( key_num );
|
||||
m_pattern->instrumentTrack()->
|
||||
getPiano()->handleKeyPress( key_num );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1202,13 +1199,13 @@ void pianoRoll::keyReleaseEvent( QKeyEvent * _ke )
|
||||
{
|
||||
if( validPattern() && _ke->modifiers() == Qt::NoModifier )
|
||||
{
|
||||
const int key_num = pianoView::getKeyFromKeyEvent( _ke ) +
|
||||
const int key_num = PianoView::getKeyFromKeyEvent( _ke ) +
|
||||
( DefaultOctave - 1 ) * KeysPerOctave;
|
||||
|
||||
if( _ke->isAutoRepeat() == false && key_num > -1 )
|
||||
{
|
||||
m_pattern->getInstrumentTrack()->
|
||||
getPiano()->handleKeyRelease( key_num );
|
||||
m_pattern->instrumentTrack()->
|
||||
getPiano()->handleKeyRelease( key_num );
|
||||
}
|
||||
}
|
||||
switch( _ke->key() )
|
||||
@@ -1608,7 +1605,7 @@ void pianoRoll::mousePressEvent( QMouseEvent * _me )
|
||||
if( ! m_recording && ! engine::getSong()->isPlaying() )
|
||||
{
|
||||
int v = ( (float) x ) / ( (float) WHITE_KEY_WIDTH ) * 127;
|
||||
m_pattern->getInstrumentTrack()->processInEvent(
|
||||
m_pattern->instrumentTrack()->processInEvent(
|
||||
midiEvent( MidiNoteOn, 0, key_num, v ),
|
||||
midiTime() );
|
||||
}
|
||||
@@ -1663,7 +1660,7 @@ void pianoRoll::testPlayNote( note * n )
|
||||
! engine::getSong()->isPlaying() )
|
||||
{
|
||||
n->setIsPlaying( true );
|
||||
m_pattern->getInstrumentTrack()->processInEvent(
|
||||
m_pattern->instrumentTrack()->processInEvent(
|
||||
midiEvent( MidiNoteOn, 0, n->key(),
|
||||
n->getVolume() * 127 / 100 ), midiTime() );
|
||||
|
||||
@@ -1671,7 +1668,7 @@ void pianoRoll::testPlayNote( note * n )
|
||||
panningToMidi( n->getPanning() ) );
|
||||
|
||||
evt.m_metaEvent = MidiNotePanning;
|
||||
m_pattern->getInstrumentTrack()->processInEvent( evt, midiTime() );
|
||||
m_pattern->instrumentTrack()->processInEvent( evt, midiTime() );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1689,7 +1686,7 @@ void pianoRoll::pauseTestNotes( bool _pause )
|
||||
if( _pause )
|
||||
{
|
||||
// stop note
|
||||
m_pattern->getInstrumentTrack()->
|
||||
m_pattern->instrumentTrack()->
|
||||
processInEvent(
|
||||
midiEvent( MidiNoteOff, 0,
|
||||
( *it )->key(), 0 ),
|
||||
@@ -1713,7 +1710,7 @@ void pianoRoll::pauseTestNotes( bool _pause )
|
||||
void pianoRoll::testPlayKey( int _key, int _vol, int _pan )
|
||||
{
|
||||
// turn off old key
|
||||
m_pattern->getInstrumentTrack()->processInEvent(
|
||||
m_pattern->instrumentTrack()->processInEvent(
|
||||
midiEvent( MidiNoteOff, 0, m_lastKey, 0 ),
|
||||
midiTime() );
|
||||
|
||||
@@ -1721,7 +1718,7 @@ void pianoRoll::testPlayKey( int _key, int _vol, int _pan )
|
||||
m_lastKey = _key;
|
||||
|
||||
// play new key
|
||||
m_pattern->getInstrumentTrack()->processInEvent(
|
||||
m_pattern->instrumentTrack()->processInEvent(
|
||||
midiEvent( MidiNoteOn, 0, _key, _vol ),
|
||||
midiTime() );
|
||||
|
||||
@@ -1863,7 +1860,7 @@ void pianoRoll::mouseReleaseEvent( QMouseEvent * _me )
|
||||
{
|
||||
if( ( *it )->isPlaying() )
|
||||
{
|
||||
m_pattern->getInstrumentTrack()->
|
||||
m_pattern->instrumentTrack()->
|
||||
processInEvent(
|
||||
midiEvent( MidiNoteOff, 0,
|
||||
( *it )->key(), 0 ),
|
||||
@@ -1875,7 +1872,7 @@ void pianoRoll::mouseReleaseEvent( QMouseEvent * _me )
|
||||
}
|
||||
|
||||
// stop playing keys that we let go of
|
||||
m_pattern->getInstrumentTrack()->processInEvent(
|
||||
m_pattern->instrumentTrack()->processInEvent(
|
||||
midiEvent( MidiNoteOff, 0, m_lastKey, 0 ),
|
||||
midiTime() );
|
||||
|
||||
@@ -2033,7 +2030,7 @@ void pianoRoll::mouseMoveEvent( QMouseEvent * _me )
|
||||
if( m_noteEditMode == NoteEditVolume )
|
||||
{
|
||||
( *it )->setVolume( vol );
|
||||
m_pattern->getInstrumentTrack()->processInEvent(
|
||||
m_pattern->instrumentTrack()->processInEvent(
|
||||
midiEvent(
|
||||
MidiKeyPressure,
|
||||
0,
|
||||
@@ -2047,7 +2044,7 @@ void pianoRoll::mouseMoveEvent( QMouseEvent * _me )
|
||||
midiEvent evt( MidiMetaEvent, 0,
|
||||
( *it )->key(), panningToMidi( pan ) );
|
||||
evt.m_metaEvent = MidiNotePanning;
|
||||
m_pattern->getInstrumentTrack()->processInEvent(
|
||||
m_pattern->instrumentTrack()->processInEvent(
|
||||
evt, midiTime() );
|
||||
}
|
||||
}
|
||||
@@ -2056,7 +2053,7 @@ void pianoRoll::mouseMoveEvent( QMouseEvent * _me )
|
||||
if( ( *it )->isPlaying() )
|
||||
{
|
||||
// mouse not over this note, stop playing it.
|
||||
m_pattern->getInstrumentTrack()->processInEvent(
|
||||
m_pattern->instrumentTrack()->processInEvent(
|
||||
midiEvent( MidiNoteOff, 0,
|
||||
( *it )->key(), 0 ), midiTime() );
|
||||
|
||||
@@ -2989,7 +2986,7 @@ int pianoRoll::getKey( int _y ) const
|
||||
|
||||
|
||||
|
||||
song::PlayModes pianoRoll::desiredPlayModeForAccompany( void ) const
|
||||
song::PlayModes pianoRoll::desiredPlayModeForAccompany() const
|
||||
{
|
||||
if( m_pattern->getTrack()->getTrackContainer() ==
|
||||
engine::getBBTrackContainer() )
|
||||
@@ -3002,7 +2999,7 @@ song::PlayModes pianoRoll::desiredPlayModeForAccompany( void ) const
|
||||
|
||||
|
||||
|
||||
void pianoRoll::play( void )
|
||||
void pianoRoll::play()
|
||||
{
|
||||
if( validPattern() == false )
|
||||
{
|
||||
@@ -3039,7 +3036,7 @@ void pianoRoll::play( void )
|
||||
|
||||
|
||||
|
||||
void pianoRoll::record( void )
|
||||
void pianoRoll::record()
|
||||
{
|
||||
if( engine::getSong()->isPlaying() )
|
||||
{
|
||||
@@ -3058,7 +3055,7 @@ void pianoRoll::record( void )
|
||||
|
||||
|
||||
|
||||
void pianoRoll::recordAccompany( void )
|
||||
void pianoRoll::recordAccompany()
|
||||
{
|
||||
if( engine::getSong()->isPlaying() )
|
||||
{
|
||||
@@ -3085,7 +3082,7 @@ void pianoRoll::recordAccompany( void )
|
||||
|
||||
|
||||
|
||||
void pianoRoll::stop( void )
|
||||
void pianoRoll::stop()
|
||||
{
|
||||
engine::getSong()->stop();
|
||||
m_playButton->setIcon( embed::getIconPixmap( "play" ) );
|
||||
@@ -3175,7 +3172,7 @@ void pianoRoll::verScrolled( int _new_pos )
|
||||
|
||||
|
||||
|
||||
void pianoRoll::drawButtonToggled( void )
|
||||
void pianoRoll::drawButtonToggled()
|
||||
{
|
||||
m_editMode = ModeDraw;
|
||||
update();
|
||||
@@ -3184,7 +3181,7 @@ void pianoRoll::drawButtonToggled( void )
|
||||
|
||||
|
||||
|
||||
void pianoRoll::eraseButtonToggled( void )
|
||||
void pianoRoll::eraseButtonToggled()
|
||||
{
|
||||
m_editMode = ModeErase;
|
||||
update();
|
||||
@@ -3193,7 +3190,7 @@ void pianoRoll::eraseButtonToggled( void )
|
||||
|
||||
|
||||
|
||||
void pianoRoll::selectButtonToggled( void )
|
||||
void pianoRoll::selectButtonToggled()
|
||||
{
|
||||
m_editMode = ModeSelect;
|
||||
update();
|
||||
@@ -3201,7 +3198,7 @@ void pianoRoll::selectButtonToggled( void )
|
||||
|
||||
|
||||
|
||||
void pianoRoll::detuneButtonToggled( void )
|
||||
void pianoRoll::detuneButtonToggled()
|
||||
{
|
||||
m_editMode = ModeEditDetuning;
|
||||
update();
|
||||
@@ -3209,7 +3206,7 @@ void pianoRoll::detuneButtonToggled( void )
|
||||
|
||||
|
||||
|
||||
void pianoRoll::selectAll( void )
|
||||
void pianoRoll::selectAll()
|
||||
{
|
||||
if( validPattern() == false )
|
||||
{
|
||||
@@ -3306,7 +3303,7 @@ void pianoRoll::copy_to_clipboard( const NoteVector & _notes ) const
|
||||
}
|
||||
|
||||
QMimeData * clip_content = new QMimeData;
|
||||
clip_content->setData( clipboard::mimeType(), mmp.toString().toUtf8() );
|
||||
clip_content->setData( Clipboard::mimeType(), mmp.toString().toUtf8() );
|
||||
QApplication::clipboard()->setMimeData( clip_content,
|
||||
QClipboard::Clipboard );
|
||||
}
|
||||
@@ -3314,7 +3311,7 @@ void pianoRoll::copy_to_clipboard( const NoteVector & _notes ) const
|
||||
|
||||
|
||||
|
||||
void pianoRoll::copySelectedNotes( void )
|
||||
void pianoRoll::copySelectedNotes()
|
||||
{
|
||||
NoteVector selected_notes;
|
||||
getSelectedNotes( selected_notes );
|
||||
@@ -3328,7 +3325,7 @@ void pianoRoll::copySelectedNotes( void )
|
||||
|
||||
|
||||
|
||||
void pianoRoll::cutSelectedNotes( void )
|
||||
void pianoRoll::cutSelectedNotes()
|
||||
{
|
||||
if( validPattern() == false )
|
||||
{
|
||||
@@ -3360,7 +3357,7 @@ void pianoRoll::cutSelectedNotes( void )
|
||||
|
||||
|
||||
|
||||
void pianoRoll::pasteNotes( void )
|
||||
void pianoRoll::pasteNotes()
|
||||
{
|
||||
if( validPattern() == false )
|
||||
{
|
||||
@@ -3369,7 +3366,7 @@ void pianoRoll::pasteNotes( void )
|
||||
|
||||
QString value = QApplication::clipboard()
|
||||
->mimeData( QClipboard::Clipboard )
|
||||
->data( clipboard::mimeType() );
|
||||
->data( Clipboard::mimeType() );
|
||||
|
||||
if( !value.isEmpty() )
|
||||
{
|
||||
@@ -3408,7 +3405,7 @@ void pianoRoll::pasteNotes( void )
|
||||
|
||||
|
||||
|
||||
void pianoRoll::deleteSelectedNotes( void )
|
||||
void pianoRoll::deleteSelectedNotes()
|
||||
{
|
||||
if( validPattern() == false )
|
||||
{
|
||||
@@ -3511,7 +3508,7 @@ void pianoRoll::updatePositionAccompany( const midiTime & _t )
|
||||
|
||||
|
||||
|
||||
void pianoRoll::zoomingChanged( void )
|
||||
void pianoRoll::zoomingChanged()
|
||||
{
|
||||
const QString & zfac = m_zoomingModel.currentText();
|
||||
m_ppt = zfac.left( zfac.length() - 1 ).toInt() * DEFAULT_PR_PPT / 100;
|
||||
@@ -3526,7 +3523,7 @@ void pianoRoll::zoomingChanged( void )
|
||||
|
||||
|
||||
|
||||
void pianoRoll::quantizeChanged( void )
|
||||
void pianoRoll::quantizeChanged()
|
||||
{
|
||||
if( m_quantizeModel.value() == 0 &&
|
||||
m_noteLenModel.value() == 0 )
|
||||
@@ -3539,7 +3536,7 @@ void pianoRoll::quantizeChanged( void )
|
||||
}
|
||||
|
||||
|
||||
int pianoRoll::quantization( void ) const
|
||||
int pianoRoll::quantization() const
|
||||
{
|
||||
if( m_quantizeModel.value() == 0 )
|
||||
{
|
||||
@@ -3553,7 +3550,7 @@ int pianoRoll::quantization( void ) const
|
||||
|
||||
|
||||
|
||||
midiTime pianoRoll::newNoteLen( void ) const
|
||||
midiTime pianoRoll::newNoteLen() const
|
||||
{
|
||||
if( m_noteLenModel.value() == 0 )
|
||||
{
|
||||
@@ -3567,7 +3564,7 @@ midiTime pianoRoll::newNoteLen( void ) const
|
||||
|
||||
|
||||
|
||||
bool pianoRoll::mouseOverNote( void )
|
||||
bool pianoRoll::mouseOverNote()
|
||||
{
|
||||
return validPattern() && noteUnderMouse() != NULL;
|
||||
}
|
||||
@@ -3575,7 +3572,7 @@ bool pianoRoll::mouseOverNote( void )
|
||||
|
||||
|
||||
|
||||
note * pianoRoll::noteUnderMouse( void )
|
||||
note * pianoRoll::noteUnderMouse()
|
||||
{
|
||||
QPoint pos = mapFromGlobal( QCursor::pos() );
|
||||
|
||||
|
||||
@@ -59,16 +59,16 @@ pluginBrowser::pluginBrowser( QWidget * _parent ) :
|
||||
"existing instrument track." ),
|
||||
m_view );
|
||||
hint->setFont( pointSize<8>( hint->font() ) );
|
||||
hint->setWordWrap( TRUE );
|
||||
hint->setWordWrap( true );
|
||||
view_layout->addWidget( hint );
|
||||
|
||||
plugin::getDescriptorsOfAvailPlugins( m_pluginDescriptors );
|
||||
Plugin::getDescriptorsOfAvailPlugins( m_pluginDescriptors );
|
||||
|
||||
for( QVector<plugin::descriptor>::iterator it =
|
||||
for( QVector<Plugin::Descriptor>::iterator it =
|
||||
m_pluginDescriptors.begin();
|
||||
it != m_pluginDescriptors.end(); ++it )
|
||||
{
|
||||
if( it->type == plugin::Instrument )
|
||||
if( it->type == Plugin::Instrument )
|
||||
{
|
||||
pluginDescWidget * p = new pluginDescWidget( *it,
|
||||
m_view );
|
||||
@@ -93,18 +93,18 @@ pluginBrowser::~pluginBrowser()
|
||||
|
||||
|
||||
|
||||
pluginDescWidget::pluginDescWidget( const plugin::descriptor & _pd,
|
||||
pluginDescWidget::pluginDescWidget( const Plugin::Descriptor & _pd,
|
||||
QWidget * _parent ) :
|
||||
QWidget( _parent ),
|
||||
m_updateTimer( this ),
|
||||
m_pluginDescriptor( _pd ),
|
||||
m_logo( _pd.logo->pixmap() ),
|
||||
m_mouseOver( FALSE ),
|
||||
m_mouseOver( false ),
|
||||
m_targetHeight( 24 )
|
||||
{
|
||||
connect( &m_updateTimer, SIGNAL( timeout() ), SLOT( updateHeight() ) );
|
||||
setFixedHeight( m_targetHeight );
|
||||
setMouseTracking( TRUE );
|
||||
setMouseTracking( true );
|
||||
setCursor( Qt::PointingHandCursor );
|
||||
}
|
||||
|
||||
@@ -136,14 +136,14 @@ void pluginDescWidget::paintEvent( QPaintEvent * )
|
||||
p.drawPixmap( 4, 4, logo );
|
||||
|
||||
QFont f = pointSize<8>( p.font() );
|
||||
f.setBold( TRUE );
|
||||
f.setBold( true );
|
||||
p.setFont( f );
|
||||
p.drawText( 10 + logo_size.width(), 15,
|
||||
m_pluginDescriptor.displayName );
|
||||
|
||||
if( height() > 24 || m_mouseOver )
|
||||
{
|
||||
f.setBold( FALSE );
|
||||
f.setBold( false );
|
||||
p.setFont( pointSize<7>( f ) );
|
||||
QRect br;
|
||||
p.drawText( 10 + logo_size.width(), 20, width() - 58 - 5, 999,
|
||||
@@ -163,7 +163,7 @@ void pluginDescWidget::paintEvent( QPaintEvent * )
|
||||
|
||||
void pluginDescWidget::enterEvent( QEvent * _e )
|
||||
{
|
||||
m_mouseOver = TRUE;
|
||||
m_mouseOver = true;
|
||||
m_targetHeight = height() + 1;
|
||||
updateHeight();
|
||||
QWidget::enterEvent( _e );
|
||||
@@ -174,7 +174,7 @@ void pluginDescWidget::enterEvent( QEvent * _e )
|
||||
|
||||
void pluginDescWidget::leaveEvent( QEvent * _e )
|
||||
{
|
||||
m_mouseOver = FALSE;
|
||||
m_mouseOver = false;
|
||||
m_targetHeight = 24;
|
||||
updateHeight();
|
||||
QWidget::leaveEvent( _e );
|
||||
@@ -196,7 +196,7 @@ void pluginDescWidget::mousePressEvent( QMouseEvent * _me )
|
||||
|
||||
|
||||
|
||||
void pluginDescWidget::updateHeight( void )
|
||||
void pluginDescWidget::updateHeight()
|
||||
{
|
||||
if( m_targetHeight > height() )
|
||||
{
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
#include "tab_widget.h"
|
||||
#include "gui_templates.h"
|
||||
#include "mixer.h"
|
||||
#include "project_journal.h"
|
||||
#include "ProjectJournal.h"
|
||||
#include "config_mgr.h"
|
||||
#include "embed.h"
|
||||
#include "engine.h"
|
||||
@@ -117,7 +117,7 @@ setupDialog::setupDialog( ConfigTabs _tab_to_open ) :
|
||||
setWindowTitle( tr( "Setup LMMS" ) );
|
||||
setModal( true );
|
||||
|
||||
engine::getProjectJournal()->setJournalling( false );
|
||||
engine::projectJournal()->setJournalling( false );
|
||||
|
||||
QVBoxLayout * vlayout = new QVBoxLayout( this );
|
||||
vlayout->setSpacing( 0 );
|
||||
@@ -700,7 +700,7 @@ setupDialog::setupDialog( ConfigTabs _tab_to_open ) :
|
||||
|
||||
setupDialog::~setupDialog()
|
||||
{
|
||||
engine::getProjectJournal()->setJournalling( true );
|
||||
engine::projectJournal()->setJournalling( true );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -39,8 +39,8 @@
|
||||
#include "cpuload_widget.h"
|
||||
#include "embed.h"
|
||||
#include "lcd_spinbox.h"
|
||||
#include "main_window.h"
|
||||
#include "meter_dialog.h"
|
||||
#include "MainWindow.h"
|
||||
#include "MeterDialog.h"
|
||||
#include "mmp.h"
|
||||
#include "text_float.h"
|
||||
#include "timeline.h"
|
||||
@@ -100,9 +100,9 @@ songEditor::songEditor( song * _song, songEditor * & _engine_ptr ) :
|
||||
|
||||
|
||||
// add some essential widgets to global tool-bar
|
||||
QWidget * tb = engine::getMainWindow()->toolBar();
|
||||
QWidget * tb = engine::mainWindow()->toolBar();
|
||||
|
||||
engine::getMainWindow()->addSpacingToToolBar( 10 );
|
||||
engine::mainWindow()->addSpacingToToolBar( 10 );
|
||||
|
||||
m_tempoSpinBox = new lcdSpinBox( 3, tb, tr( "Tempo" ) );
|
||||
m_tempoSpinBox->setModel( &m_s->m_tempoModel );
|
||||
@@ -117,7 +117,7 @@ songEditor::songEditor( song * _song, songEditor * & _engine_ptr ) :
|
||||
"should be played within a minute (or how many measures "
|
||||
"should be played within four minutes)." ) );
|
||||
|
||||
engine::getMainWindow()->addWidgetToToolBar( m_tempoSpinBox, 0 );
|
||||
engine::mainWindow()->addWidgetToToolBar( m_tempoSpinBox, 0 );
|
||||
|
||||
#if 0
|
||||
toolButton * hq_btn = new toolButton( embed::getIconPixmap( "hq_mode" ),
|
||||
@@ -127,17 +127,17 @@ songEditor::songEditor( song * _song, songEditor * & _engine_ptr ) :
|
||||
connect( hq_btn, SIGNAL( toggled( bool ) ),
|
||||
this, SLOT( setHighQuality( bool ) ) );
|
||||
hq_btn->setFixedWidth( 42 );
|
||||
engine::getMainWindow()->addWidgetToToolBar( hq_btn, 1, col );
|
||||
engine::mainWindow()->addWidgetToToolBar( hq_btn, 1, col );
|
||||
#endif
|
||||
|
||||
engine::getMainWindow()->addSpacingToToolBar( 10 );
|
||||
engine::mainWindow()->addSpacingToToolBar( 10 );
|
||||
|
||||
|
||||
m_timeSigDisplay = new meterDialog( this, TRUE );
|
||||
m_timeSigDisplay = new MeterDialog( this, TRUE );
|
||||
m_timeSigDisplay->setModel( &m_s->m_timeSigModel );
|
||||
engine::getMainWindow()->addWidgetToToolBar( m_timeSigDisplay );
|
||||
engine::mainWindow()->addWidgetToToolBar( m_timeSigDisplay );
|
||||
|
||||
engine::getMainWindow()->addSpacingToToolBar( 10 );
|
||||
engine::mainWindow()->addSpacingToToolBar( 10 );
|
||||
|
||||
|
||||
QLabel * master_vol_lbl = new QLabel( tb );
|
||||
@@ -166,11 +166,11 @@ songEditor::songEditor( song * _song, songEditor * & _engine_ptr ) :
|
||||
m_mvsStatus->setTitle( tr( "Master volume" ) );
|
||||
m_mvsStatus->setPixmap( embed::getIconPixmap( "master_volume" ) );
|
||||
|
||||
engine::getMainWindow()->addWidgetToToolBar( master_vol_lbl );
|
||||
engine::getMainWindow()->addWidgetToToolBar( m_masterVolumeSlider );
|
||||
engine::mainWindow()->addWidgetToToolBar( master_vol_lbl );
|
||||
engine::mainWindow()->addWidgetToToolBar( m_masterVolumeSlider );
|
||||
|
||||
|
||||
engine::getMainWindow()->addSpacingToToolBar( 10 );
|
||||
engine::mainWindow()->addSpacingToToolBar( 10 );
|
||||
|
||||
|
||||
QLabel * master_pitch_lbl = new QLabel( tb );
|
||||
@@ -198,10 +198,10 @@ songEditor::songEditor( song * _song, songEditor * & _engine_ptr ) :
|
||||
m_mpsStatus->setTitle( tr( "Master pitch" ) );
|
||||
m_mpsStatus->setPixmap( embed::getIconPixmap( "master_pitch" ) );
|
||||
|
||||
engine::getMainWindow()->addWidgetToToolBar( master_pitch_lbl );
|
||||
engine::getMainWindow()->addWidgetToToolBar( m_masterPitchSlider );
|
||||
engine::mainWindow()->addWidgetToToolBar( master_pitch_lbl );
|
||||
engine::mainWindow()->addWidgetToToolBar( m_masterPitchSlider );
|
||||
|
||||
engine::getMainWindow()->addSpacingToToolBar( 10 );
|
||||
engine::mainWindow()->addSpacingToToolBar( 10 );
|
||||
|
||||
// create widget for visualization- and cpu-load-widget
|
||||
QWidget * vc_w = new QWidget( tb );
|
||||
@@ -216,7 +216,7 @@ songEditor::songEditor( song * _song, songEditor * & _engine_ptr ) :
|
||||
vcw_layout->addWidget( new cpuloadWidget( vc_w ) );
|
||||
vcw_layout->addStretch();
|
||||
|
||||
engine::getMainWindow()->addWidgetToToolBar( vc_w );
|
||||
engine::mainWindow()->addWidgetToToolBar( vc_w );
|
||||
|
||||
|
||||
// create own toolbar
|
||||
@@ -374,7 +374,7 @@ songEditor::songEditor( song * _song, songEditor * & _engine_ptr ) :
|
||||
this, SLOT( updateScrollBar( int ) ) );
|
||||
|
||||
|
||||
engine::getMainWindow()->workspace()->addSubWindow( this );
|
||||
engine::mainWindow()->workspace()->addSubWindow( this );
|
||||
parentWidget()->setAttribute( Qt::WA_DeleteOnClose, FALSE );
|
||||
parentWidget()->resize( 600, 300 );
|
||||
parentWidget()->move( 5, 5 );
|
||||
@@ -456,13 +456,13 @@ void songEditor::stop( void )
|
||||
void songEditor::keyPressEvent( QKeyEvent * _ke )
|
||||
{
|
||||
if( /*_ke->modifiers() & Qt::ShiftModifier*/
|
||||
engine::getMainWindow()->isShiftPressed() == TRUE &&
|
||||
engine::mainWindow()->isShiftPressed() == TRUE &&
|
||||
_ke->key() == Qt::Key_Insert )
|
||||
{
|
||||
m_s->insertBar();
|
||||
}
|
||||
else if(/* _ke->modifiers() & Qt::ShiftModifier &&*/
|
||||
engine::getMainWindow()->isShiftPressed() == TRUE &&
|
||||
engine::mainWindow()->isShiftPressed() == TRUE &&
|
||||
_ke->key() == Qt::Key_Delete )
|
||||
{
|
||||
m_s->removeBar();
|
||||
@@ -509,7 +509,7 @@ void songEditor::keyPressEvent( QKeyEvent * _ke )
|
||||
|
||||
void songEditor::wheelEvent( QWheelEvent * _we )
|
||||
{
|
||||
if( engine::getMainWindow()->isCtrlPressed() == TRUE )
|
||||
if( engine::mainWindow()->isCtrlPressed() == TRUE )
|
||||
{
|
||||
if( _we->delta() > 0 )
|
||||
{
|
||||
@@ -533,7 +533,7 @@ void songEditor::wheelEvent( QWheelEvent * _we )
|
||||
// and make sure, all TCO's are resized and relocated
|
||||
realignTracks();
|
||||
}
|
||||
else if( engine::getMainWindow()->isShiftPressed() == TRUE )
|
||||
else if( engine::mainWindow()->isShiftPressed() == TRUE )
|
||||
{
|
||||
m_leftRightScroll->setValue( m_leftRightScroll->value() -
|
||||
_we->delta() / 30 );
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
#include "string_pair_drag.h"
|
||||
#include "engine.h"
|
||||
#include "main_window.h"
|
||||
#include "MainWindow.h"
|
||||
|
||||
|
||||
stringPairDrag::stringPairDrag( const QString & _key, const QString & _value,
|
||||
@@ -64,9 +64,9 @@ stringPairDrag::~stringPairDrag()
|
||||
{
|
||||
// during a drag, we might have lost key-press-events, so reset
|
||||
// modifiers of main-win
|
||||
if( engine::getMainWindow() )
|
||||
if( engine::mainWindow() )
|
||||
{
|
||||
engine::getMainWindow()->clearKeyModifiers();
|
||||
engine::mainWindow()->clearKeyModifiers();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -34,14 +34,13 @@
|
||||
#include "track_container_view.h"
|
||||
#include "track_container.h"
|
||||
#include "bb_track.h"
|
||||
#include "main_window.h"
|
||||
#include "MainWindow.h"
|
||||
#include "debug.h"
|
||||
#include "file_browser.h"
|
||||
#include "import_filter.h"
|
||||
#include "instrument.h"
|
||||
#include "instrument_track.h"
|
||||
#include "ImportFilter.h"
|
||||
#include "Instrument.h"
|
||||
#include "InstrumentTrack.h"
|
||||
#include "mmp.h"
|
||||
#include "project_journal.h"
|
||||
#include "rubberband.h"
|
||||
#include "song.h"
|
||||
#include "string_pair_drag.h"
|
||||
@@ -50,9 +49,9 @@
|
||||
|
||||
trackContainerView::trackContainerView( trackContainer * _tc ) :
|
||||
QWidget(),
|
||||
modelView( NULL, this ),
|
||||
journallingObject(),
|
||||
serializingObjectHook(),
|
||||
ModelView( NULL, this ),
|
||||
JournallingObject(),
|
||||
SerializingObjectHook(),
|
||||
m_currentPosition( 0, 0 ),
|
||||
m_tc( _tc ),
|
||||
m_trackViews(),
|
||||
@@ -106,7 +105,7 @@ trackContainerView::~trackContainerView()
|
||||
void trackContainerView::saveSettings( QDomDocument & _doc,
|
||||
QDomElement & _this )
|
||||
{
|
||||
mainWindow::saveWidgetState( this, _this );
|
||||
MainWindow::saveWidgetState( this, _this );
|
||||
}
|
||||
|
||||
|
||||
@@ -114,7 +113,7 @@ void trackContainerView::saveSettings( QDomDocument & _doc,
|
||||
|
||||
void trackContainerView::loadSettings( const QDomElement & _this )
|
||||
{
|
||||
mainWindow::restoreWidgetState( this, _this );
|
||||
MainWindow::restoreWidgetState( this, _this );
|
||||
}
|
||||
|
||||
|
||||
@@ -124,7 +123,7 @@ trackView * trackContainerView::addTrackView( trackView * _tv )
|
||||
{
|
||||
/* QMap<QString, QVariant> map;
|
||||
map["id"] = _tv->getTrack()->id();
|
||||
addJournalEntry( journalEntry( AddTrack, map ) );*/
|
||||
addJournalEntry( JournalEntry( AddTrack, map ) );*/
|
||||
|
||||
m_trackViews.push_back( _tv );
|
||||
m_scrollLayout->addWidget( _tv );
|
||||
@@ -148,7 +147,7 @@ void trackContainerView::removeTrackView( trackView * _tv )
|
||||
_tv->getTrack()->saveState( mmp, mmp.content() );
|
||||
map["id"] = _tv->getTrack()->id();
|
||||
map["state"] = mmp.toString();
|
||||
addJournalEntry( journalEntry( RemoveTrack, map ) );*/
|
||||
addJournalEntry( JournalEntry( RemoveTrack, map ) );*/
|
||||
|
||||
m_trackViews.removeAt( index );
|
||||
|
||||
@@ -211,7 +210,7 @@ void trackContainerView::moveTrackViewDown( trackView * _tv )
|
||||
|
||||
|
||||
|
||||
void trackContainerView::realignTracks( void )
|
||||
void trackContainerView::realignTracks()
|
||||
{
|
||||
QWidget * content = m_scrollArea->widget();
|
||||
content->setFixedWidth( width()
|
||||
@@ -271,7 +270,7 @@ const trackView * trackContainerView::trackViewAt( const int _y ) const
|
||||
|
||||
|
||||
|
||||
bool trackContainerView::allowRubberband( void ) const
|
||||
bool trackContainerView::allowRubberband() const
|
||||
{
|
||||
return( false );
|
||||
}
|
||||
@@ -287,7 +286,7 @@ void trackContainerView::setPixelsPerTact( int _ppt )
|
||||
|
||||
|
||||
|
||||
void trackContainerView::clearAllTracks( void )
|
||||
void trackContainerView::clearAllTracks()
|
||||
{
|
||||
while( !m_trackViews.empty() )
|
||||
{
|
||||
@@ -301,7 +300,7 @@ void trackContainerView::clearAllTracks( void )
|
||||
|
||||
|
||||
|
||||
void trackContainerView::undoStep( journalEntry & _je )
|
||||
void trackContainerView::undoStep( JournalEntry & _je )
|
||||
{
|
||||
#if 0
|
||||
saveJournallingState( false );
|
||||
@@ -312,7 +311,7 @@ void trackContainerView::undoStep( journalEntry & _je )
|
||||
QMap<QString, QVariant> map = _je.data().toMap();
|
||||
track * t =
|
||||
dynamic_cast<track *>(
|
||||
engine::getProjectJournal()->getJournallingObject(
|
||||
engine::projectJournal()->getJournallingObject(
|
||||
map["id"].toInt() ) );
|
||||
assert( t != NULL );
|
||||
multimediaProject mmp( multimediaProject::JournalData );
|
||||
@@ -339,7 +338,7 @@ void trackContainerView::undoStep( journalEntry & _je )
|
||||
|
||||
|
||||
|
||||
void trackContainerView::redoStep( journalEntry & _je )
|
||||
void trackContainerView::redoStep( JournalEntry & _je )
|
||||
{
|
||||
#if 0
|
||||
switch( _je.actionID() )
|
||||
@@ -378,7 +377,7 @@ void trackContainerView::dropEvent( QDropEvent * _de )
|
||||
engine::getMixer()->lock();
|
||||
if( type == "instrument" )
|
||||
{
|
||||
instrumentTrack * it = dynamic_cast<instrumentTrack *>(
|
||||
InstrumentTrack * it = dynamic_cast<InstrumentTrack *>(
|
||||
track::create( track::InstrumentTrack,
|
||||
m_tc ) );
|
||||
it->loadInstrument( value );
|
||||
@@ -387,10 +386,10 @@ void trackContainerView::dropEvent( QDropEvent * _de )
|
||||
}
|
||||
else if( type == "samplefile" || type == "pluginpresetfile" )
|
||||
{
|
||||
instrumentTrack * it = dynamic_cast<instrumentTrack *>(
|
||||
InstrumentTrack * it = dynamic_cast<InstrumentTrack *>(
|
||||
track::create( track::InstrumentTrack,
|
||||
m_tc ) );
|
||||
instrument * i = it->loadInstrument(
|
||||
Instrument * i = it->loadInstrument(
|
||||
engine::pluginFileHandling()[fileItem::extension(
|
||||
value )]);
|
||||
i->loadFile( value );
|
||||
@@ -400,7 +399,7 @@ void trackContainerView::dropEvent( QDropEvent * _de )
|
||||
else if( type == "presetfile" )
|
||||
{
|
||||
multimediaProject mmp( value );
|
||||
instrumentTrack * it = dynamic_cast<instrumentTrack *>(
|
||||
InstrumentTrack * it = dynamic_cast<InstrumentTrack *>(
|
||||
track::create( track::InstrumentTrack,
|
||||
m_tc ) );
|
||||
it->loadSettings( mmp.content().toElement() );
|
||||
@@ -409,7 +408,7 @@ void trackContainerView::dropEvent( QDropEvent * _de )
|
||||
}
|
||||
else if( type == "importedproject" )
|
||||
{
|
||||
importFilter::import( value, m_tc );
|
||||
ImportFilter::import( value, m_tc );
|
||||
_de->accept();
|
||||
}
|
||||
else if( type.left( 6 ) == "track_" )
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
#include "song.h"
|
||||
#include "embed.h"
|
||||
#include "main_window.h"
|
||||
#include "MainWindow.h"
|
||||
#include "group_box.h"
|
||||
#include "ControllerRackView.h"
|
||||
#include "ControllerView.h"
|
||||
@@ -75,7 +75,7 @@ ControllerRackView::ControllerRackView( ) :
|
||||
this->setLayout( layout );
|
||||
|
||||
QMdiSubWindow * subWin =
|
||||
engine::getMainWindow()->workspace()->addSubWindow( this );
|
||||
engine::mainWindow()->workspace()->addSubWindow( this );
|
||||
|
||||
// No maximize button
|
||||
Qt::WindowFlags flags = subWin->windowFlags();
|
||||
@@ -104,7 +104,7 @@ ControllerRackView::~ControllerRackView()
|
||||
void ControllerRackView::saveSettings( QDomDocument & _doc,
|
||||
QDomElement & _this )
|
||||
{
|
||||
mainWindow::saveWidgetState( this, _this );
|
||||
MainWindow::saveWidgetState( this, _this );
|
||||
}
|
||||
|
||||
|
||||
@@ -112,7 +112,7 @@ void ControllerRackView::saveSettings( QDomDocument & _doc,
|
||||
|
||||
void ControllerRackView::loadSettings( const QDomElement & _this )
|
||||
{
|
||||
mainWindow::restoreWidgetState( this, _this );
|
||||
MainWindow::restoreWidgetState( this, _this );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -38,18 +38,17 @@
|
||||
#include "embed.h"
|
||||
#include "engine.h"
|
||||
#include "led_checkbox.h"
|
||||
#include "main_window.h"
|
||||
#include "MainWindow.h"
|
||||
#include "tooltip.h"
|
||||
#include "mv_base.h"
|
||||
|
||||
|
||||
ControllerView::ControllerView( Controller * _model, QWidget * _parent ) :
|
||||
QWidget( _parent ),
|
||||
modelView( _model, this ),
|
||||
ModelView( _model, this ),
|
||||
m_bg( embed::getIconPixmap( "controller_bg" ) ),
|
||||
m_subWindow( NULL ),
|
||||
m_controllerDlg( NULL ),
|
||||
m_show( TRUE )
|
||||
m_show( true )
|
||||
{
|
||||
setFixedSize( 210, 32 );
|
||||
|
||||
@@ -63,9 +62,9 @@ ControllerView::ControllerView( Controller * _model, QWidget * _parent ) :
|
||||
connect( ctls_btn, SIGNAL( clicked() ),
|
||||
this, SLOT( editControls() ) );
|
||||
|
||||
m_controllerDlg = getController()->createDialog( engine::getMainWindow()->workspace() );
|
||||
m_controllerDlg = getController()->createDialog( engine::mainWindow()->workspace() );
|
||||
|
||||
m_subWindow = engine::getMainWindow()->workspace()->addSubWindow(
|
||||
m_subWindow = engine::mainWindow()->workspace()->addSubWindow(
|
||||
m_controllerDlg );
|
||||
|
||||
Qt::WindowFlags flags = m_subWindow->windowFlags();
|
||||
@@ -98,28 +97,28 @@ ControllerView::~ControllerView()
|
||||
|
||||
|
||||
|
||||
void ControllerView::editControls( void )
|
||||
void ControllerView::editControls()
|
||||
{
|
||||
if( m_show )
|
||||
{
|
||||
m_subWindow->show();
|
||||
m_subWindow->raise();
|
||||
m_show = FALSE;
|
||||
m_show = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_subWindow->hide();
|
||||
m_show = TRUE;
|
||||
m_show = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void ControllerView::closeControls( void )
|
||||
void ControllerView::closeControls()
|
||||
{
|
||||
m_subWindow->hide();
|
||||
m_show = TRUE;
|
||||
m_show = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -136,7 +135,7 @@ void ControllerView::paintEvent( QPaintEvent * )
|
||||
p.drawPixmap( 0, 0, m_bg );
|
||||
|
||||
QFont f = pointSizeF( font(), 7.5f );
|
||||
f.setBold( TRUE );
|
||||
f.setBold( true );
|
||||
p.setFont( f );
|
||||
|
||||
Controller * c = castModel<Controller>();
|
||||
@@ -146,7 +145,7 @@ void ControllerView::paintEvent( QPaintEvent * )
|
||||
p.setPen( Qt::white );
|
||||
p.drawText( 6, 12, c->displayName() );
|
||||
|
||||
f.setBold( FALSE );
|
||||
f.setBold( false );
|
||||
p.setFont( f );
|
||||
p.drawText( 8, 26, c->name() );
|
||||
}
|
||||
@@ -170,7 +169,7 @@ void ControllerView::mouseDoubleClickEvent( QMouseEvent * event )
|
||||
|
||||
|
||||
|
||||
void ControllerView::modelChanged( void )
|
||||
void ControllerView::modelChanged()
|
||||
{
|
||||
}
|
||||
|
||||
@@ -178,17 +177,7 @@ void ControllerView::modelChanged( void )
|
||||
|
||||
void ControllerView::contextMenuEvent( QContextMenuEvent * )
|
||||
{
|
||||
QPointer<captionMenu> contextMenu = new captionMenu(
|
||||
getModel()->displayName() );
|
||||
/*
|
||||
contextMenu->addAction( embed::getIconPixmap( "arp_up" ),
|
||||
tr( "Move &up" ),
|
||||
this, SLOT( moveUp() ) );
|
||||
contextMenu->addAction( embed::getIconPixmap( "arp_down" ),
|
||||
tr( "Move &down" ),
|
||||
this, SLOT( moveDown() ) );
|
||||
contextMenu->addSeparator();
|
||||
*/
|
||||
QPointer<captionMenu> contextMenu = new captionMenu( model()->displayName() );
|
||||
contextMenu->addAction( embed::getIconPixmap( "cancel" ),
|
||||
tr( "&Remove this plugin" ),
|
||||
this, SLOT( deleteController() ) );
|
||||
@@ -202,7 +191,7 @@ void ControllerView::contextMenuEvent( QContextMenuEvent * )
|
||||
|
||||
|
||||
|
||||
void ControllerView::displayHelp( void )
|
||||
void ControllerView::displayHelp()
|
||||
{
|
||||
QWhatsThis::showText( mapToGlobal( rect().center() ),
|
||||
whatsThis() );
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* effect_rack_view.cpp - view for effectChain-model
|
||||
* EffectRackView.cpp - view for effectChain model
|
||||
*
|
||||
* Copyright (c) 2006-2007 Danny McRae <khjklujn@netscape.net>
|
||||
* Copyright (c) 2008-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
@@ -23,22 +23,21 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include <QtGui/QApplication>
|
||||
#include <QtGui/QLayout>
|
||||
#include <QtGui/QPushButton>
|
||||
#include <QtGui/QScrollArea>
|
||||
#include <QtGui/QVBoxLayout>
|
||||
|
||||
#include "effect_rack_view.h"
|
||||
#include "effect_select_dialog.h"
|
||||
#include "effect_view.h"
|
||||
#include "EffectRackView.h"
|
||||
#include "EffectSelectDialog.h"
|
||||
#include "EffectView.h"
|
||||
#include "group_box.h"
|
||||
|
||||
|
||||
effectRackView::effectRackView( effectChain * _model, QWidget * _parent ) :
|
||||
EffectRackView::EffectRackView( EffectChain * _model, QWidget * _parent ) :
|
||||
QWidget( _parent ),
|
||||
modelView( NULL, this )
|
||||
ModelView( NULL, this )
|
||||
{
|
||||
setFixedSize( 250, 250 );
|
||||
|
||||
@@ -70,7 +69,7 @@ effectRackView::effectRackView( effectChain * _model, QWidget * _parent ) :
|
||||
|
||||
|
||||
|
||||
effectRackView::~effectRackView()
|
||||
EffectRackView::~EffectRackView()
|
||||
{
|
||||
clearViews();
|
||||
}
|
||||
@@ -79,9 +78,9 @@ effectRackView::~effectRackView()
|
||||
|
||||
|
||||
|
||||
void effectRackView::clearViews( void )
|
||||
void EffectRackView::clearViews()
|
||||
{
|
||||
for( QVector<effectView *>::iterator it = m_effectViews.begin();
|
||||
for( QVector<EffectView *>::Iterator it = m_effectViews.begin();
|
||||
it != m_effectViews.end(); ++it )
|
||||
{
|
||||
delete *it;
|
||||
@@ -92,14 +91,13 @@ void effectRackView::clearViews( void )
|
||||
|
||||
|
||||
|
||||
void effectRackView::moveUp( effectView * _view )
|
||||
void EffectRackView::moveUp( EffectView * _view )
|
||||
{
|
||||
fxChain()->moveUp( _view->getEffect() );
|
||||
fxChain()->moveUp( _view->effect() );
|
||||
if( _view != m_effectViews.first() )
|
||||
{
|
||||
int i = 0;
|
||||
for( QVector<effectView *>::iterator it =
|
||||
m_effectViews.begin();
|
||||
for( QVector<EffectView *>::Iterator it = m_effectViews.begin();
|
||||
it != m_effectViews.end(); it++, i++ )
|
||||
{
|
||||
if( *it == _view )
|
||||
@@ -108,7 +106,7 @@ void effectRackView::moveUp( effectView * _view )
|
||||
}
|
||||
}
|
||||
|
||||
effectView * temp = m_effectViews[ i - 1 ];
|
||||
EffectView * temp = m_effectViews[ i - 1 ];
|
||||
|
||||
m_effectViews[i - 1] = _view;
|
||||
m_effectViews[i] = temp;
|
||||
@@ -120,22 +118,21 @@ void effectRackView::moveUp( effectView * _view )
|
||||
|
||||
|
||||
|
||||
void effectRackView::moveDown( effectView * _view )
|
||||
void EffectRackView::moveDown( EffectView * _view )
|
||||
{
|
||||
if( _view != m_effectViews.last() )
|
||||
{
|
||||
// moving next effect up is the same
|
||||
moveUp( *( qFind( m_effectViews.begin(), m_effectViews.end(),
|
||||
_view ) + 1 ) );
|
||||
moveUp( *( qFind( m_effectViews.begin(), m_effectViews.end(), _view ) + 1 ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void effectRackView::deletePlugin( effectView * _view )
|
||||
void EffectRackView::deletePlugin( EffectView * _view )
|
||||
{
|
||||
effect * e = _view->getEffect();
|
||||
Effect * e = _view->effect();
|
||||
m_effectViews.erase( qFind( m_effectViews.begin(), m_effectViews.end(),
|
||||
_view ) );
|
||||
delete _view;
|
||||
@@ -147,49 +144,48 @@ void effectRackView::deletePlugin( effectView * _view )
|
||||
|
||||
|
||||
|
||||
void effectRackView::update( void )
|
||||
void EffectRackView::update()
|
||||
{
|
||||
QWidget * w = m_scrollArea->widget();
|
||||
QVector<bool> view_map( qMax<int>( fxChain()->m_effects.size(),
|
||||
m_effectViews.size() ), FALSE );
|
||||
m_effectViews.size() ), false );
|
||||
|
||||
for( QVector<effect *>::iterator it = fxChain()->m_effects.begin();
|
||||
for( QVector<Effect *>::Iterator it = fxChain()->m_effects.begin();
|
||||
it != fxChain()->m_effects.end(); ++it )
|
||||
{
|
||||
int i = 0;
|
||||
for( QVector<effectView *>::iterator vit =
|
||||
m_effectViews.begin();
|
||||
for( QVector<EffectView *>::Iterator vit = m_effectViews.begin();
|
||||
vit != m_effectViews.end(); ++vit, ++i )
|
||||
{
|
||||
if( ( *vit )->getModel() == *it )
|
||||
if( ( *vit )->model() == *it )
|
||||
{
|
||||
view_map[i] = TRUE;
|
||||
view_map[i] = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if( i >= m_effectViews.size() )
|
||||
{
|
||||
effectView * view = new effectView( *it, w );
|
||||
connect( view, SIGNAL( moveUp( effectView * ) ),
|
||||
this, SLOT( moveUp( effectView * ) ) );
|
||||
connect( view, SIGNAL( moveDown( effectView * ) ),
|
||||
this, SLOT( moveDown( effectView * ) ) );
|
||||
connect( view, SIGNAL( deletePlugin( effectView * ) ),
|
||||
this, SLOT( deletePlugin( effectView * ) ),
|
||||
EffectView * view = new EffectView( *it, w );
|
||||
connect( view, SIGNAL( moveUp( EffectView * ) ),
|
||||
this, SLOT( moveUp( EffectView * ) ) );
|
||||
connect( view, SIGNAL( moveDown( EffectView * ) ),
|
||||
this, SLOT( moveDown( EffectView * ) ) );
|
||||
connect( view, SIGNAL( deletePlugin( EffectView * ) ),
|
||||
this, SLOT( deletePlugin( EffectView * ) ),
|
||||
Qt::QueuedConnection );
|
||||
view->show();
|
||||
m_effectViews.append( view );
|
||||
view_map[i] = TRUE;
|
||||
view_map[i] = true;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
int i = m_lastY = 0;
|
||||
for( QVector<effectView *>::iterator it = m_effectViews.begin();
|
||||
for( QVector<EffectView *>::Iterator it = m_effectViews.begin();
|
||||
it != m_effectViews.end(); )
|
||||
{
|
||||
if( i < view_map.size() && i < m_effectViews.size() &&
|
||||
view_map[i] == FALSE )
|
||||
view_map[i] == false )
|
||||
{
|
||||
delete m_effectViews[i];
|
||||
m_effectViews.erase( it );
|
||||
@@ -210,9 +206,9 @@ void effectRackView::update( void )
|
||||
|
||||
|
||||
|
||||
void effectRackView::addEffect( void )
|
||||
void EffectRackView::addEffect()
|
||||
{
|
||||
effectSelectDialog esd( this );
|
||||
EffectSelectDialog esd( this );
|
||||
esd.exec();
|
||||
|
||||
if( esd.result() == QDialog::Rejected )
|
||||
@@ -220,17 +216,17 @@ void effectRackView::addEffect( void )
|
||||
return;
|
||||
}
|
||||
|
||||
effect * fx = esd.instantiateSelectedPlugin( fxChain() );
|
||||
Effect * fx = esd.instantiateSelectedPlugin( fxChain() );
|
||||
|
||||
fxChain()->m_enabledModel.setValue( TRUE );
|
||||
fxChain()->m_enabledModel.setValue( true );
|
||||
fxChain()->appendEffect( fx );
|
||||
update();
|
||||
|
||||
// Find the effectView, and show the controls
|
||||
for( QVector<effectView *>::iterator vit = m_effectViews.begin();
|
||||
for( QVector<EffectView *>::Iterator vit = m_effectViews.begin();
|
||||
vit != m_effectViews.end(); ++vit )
|
||||
{
|
||||
if( ( *vit )->getEffect() == fx )
|
||||
if( ( *vit )->effect() == fx )
|
||||
{
|
||||
( *vit )->editControls();
|
||||
|
||||
@@ -244,7 +240,7 @@ void effectRackView::addEffect( void )
|
||||
|
||||
|
||||
|
||||
void effectRackView::modelChanged( void )
|
||||
void EffectRackView::modelChanged()
|
||||
{
|
||||
clearViews();
|
||||
m_effectsGroupBox->setModel( &fxChain()->m_enabledModel );
|
||||
@@ -255,5 +251,5 @@ void effectRackView::modelChanged( void )
|
||||
|
||||
|
||||
|
||||
#include "moc_effect_rack_view.cxx"
|
||||
#include "moc_EffectRackView.cxx"
|
||||
|
||||
@@ -23,30 +23,28 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "effect_view.h"
|
||||
|
||||
#include <QtGui/QLabel>
|
||||
#include <QtGui/QPushButton>
|
||||
#include <QtGui/QMdiArea>
|
||||
#include <QtGui/QMdiSubWindow>
|
||||
#include <QtGui/QPainter>
|
||||
|
||||
#include "EffectView.h"
|
||||
#include "caption_menu.h"
|
||||
#include "effect_controls.h"
|
||||
#include "effect_control_dialog.h"
|
||||
#include "EffectControls.h"
|
||||
#include "EffectControlDialog.h"
|
||||
#include "embed.h"
|
||||
#include "engine.h"
|
||||
#include "gui_templates.h"
|
||||
#include "knob.h"
|
||||
#include "led_checkbox.h"
|
||||
#include "main_window.h"
|
||||
#include "tempo_sync_knob.h"
|
||||
#include "MainWindow.h"
|
||||
#include "TempoSyncKnob.h"
|
||||
#include "tooltip.h"
|
||||
|
||||
|
||||
effectView::effectView( effect * _model, QWidget * _parent ) :
|
||||
pluginView( _model, _parent ),
|
||||
EffectView::EffectView( Effect * _model, QWidget * _parent ) :
|
||||
PluginView( _model, _parent ),
|
||||
m_bg( embed::getIconPixmap( "effect_plugin" ) ),
|
||||
m_subWindow( NULL ),
|
||||
m_controlView( NULL ),
|
||||
@@ -71,7 +69,7 @@ effectView::effectView( effect * _model, QWidget * _parent ) :
|
||||
"forms the output." ) );
|
||||
|
||||
|
||||
m_autoQuit = new tempoSyncKnob( knobBright_26, this );
|
||||
m_autoQuit = new TempoSyncKnob( knobBright_26, this );
|
||||
m_autoQuit->setLabel( tr( "DECAY" ) );
|
||||
m_autoQuit->move( 60, 5 );
|
||||
m_autoQuit->setHintText( tr( "Time:" ) + " ", "ms" );
|
||||
@@ -90,7 +88,7 @@ effectView::effectView( effect * _model, QWidget * _parent ) :
|
||||
"while deciding when to stop processing signals." ) );
|
||||
|
||||
|
||||
if( getEffect()->getControls()->getControlCount() > 0 )
|
||||
if( effect()->controls()->controlCount() > 0 )
|
||||
{
|
||||
QPushButton * ctls_btn = new QPushButton( tr( "Controls" ),
|
||||
this );
|
||||
@@ -99,10 +97,10 @@ effectView::effectView( effect * _model, QWidget * _parent ) :
|
||||
ctls_btn->setGeometry( 140, 14, 50, 20 );
|
||||
connect( ctls_btn, SIGNAL( clicked() ),
|
||||
this, SLOT( editControls() ) );
|
||||
m_controlView = getEffect()->getControls()->createView();
|
||||
m_controlView = effect()->controls()->createView();
|
||||
if( m_controlView )
|
||||
{
|
||||
m_subWindow = engine::getMainWindow()->workspace()->addSubWindow(
|
||||
m_subWindow = engine::mainWindow()->workspace()->addSubWindow(
|
||||
m_controlView,
|
||||
Qt::SubWindow | Qt::CustomizeWindowHint |
|
||||
Qt::WindowTitleHint | Qt::WindowSystemMenuHint );
|
||||
@@ -152,7 +150,7 @@ effectView::effectView( effect * _model, QWidget * _parent ) :
|
||||
|
||||
|
||||
|
||||
effectView::~effectView()
|
||||
EffectView::~EffectView()
|
||||
{
|
||||
delete m_subWindow;
|
||||
}
|
||||
@@ -160,7 +158,7 @@ effectView::~effectView()
|
||||
|
||||
|
||||
|
||||
void effectView::editControls( void )
|
||||
void EffectView::editControls()
|
||||
{
|
||||
if( m_subWindow )
|
||||
{
|
||||
@@ -181,7 +179,7 @@ void effectView::editControls( void )
|
||||
|
||||
|
||||
|
||||
void effectView::moveUp()
|
||||
void EffectView::moveUp()
|
||||
{
|
||||
emit moveUp( this );
|
||||
}
|
||||
@@ -189,14 +187,14 @@ void effectView::moveUp()
|
||||
|
||||
|
||||
|
||||
void effectView::moveDown()
|
||||
void EffectView::moveDown()
|
||||
{
|
||||
emit moveDown( this );
|
||||
}
|
||||
|
||||
|
||||
|
||||
void effectView::deletePlugin()
|
||||
void EffectView::deletePlugin()
|
||||
{
|
||||
emit deletePlugin( this );
|
||||
}
|
||||
@@ -204,7 +202,7 @@ void effectView::deletePlugin()
|
||||
|
||||
|
||||
|
||||
void effectView::displayHelp( void )
|
||||
void EffectView::displayHelp()
|
||||
{
|
||||
QWhatsThis::showText( mapToGlobal( rect().bottomRight() ),
|
||||
whatsThis() );
|
||||
@@ -213,7 +211,7 @@ void effectView::displayHelp( void )
|
||||
|
||||
|
||||
|
||||
void effectView::closeEffects( void )
|
||||
void EffectView::closeEffects()
|
||||
{
|
||||
if( m_subWindow )
|
||||
{
|
||||
@@ -224,10 +222,9 @@ void effectView::closeEffects( void )
|
||||
|
||||
|
||||
|
||||
void effectView::contextMenuEvent( QContextMenuEvent * )
|
||||
void EffectView::contextMenuEvent( QContextMenuEvent * )
|
||||
{
|
||||
QPointer<captionMenu> contextMenu = new captionMenu(
|
||||
getModel()->displayName() );
|
||||
QPointer<captionMenu> contextMenu = new captionMenu( model()->displayName() );
|
||||
contextMenu->addAction( embed::getIconPixmap( "arp_up" ),
|
||||
tr( "Move &up" ),
|
||||
this, SLOT( moveUp() ) );
|
||||
@@ -249,7 +246,7 @@ void effectView::contextMenuEvent( QContextMenuEvent * )
|
||||
|
||||
|
||||
|
||||
void effectView::paintEvent( QPaintEvent * )
|
||||
void EffectView::paintEvent( QPaintEvent * )
|
||||
{
|
||||
QPainter p( this );
|
||||
p.drawPixmap( 0, 0, m_bg );
|
||||
@@ -259,23 +256,23 @@ void effectView::paintEvent( QPaintEvent * )
|
||||
p.setFont( f );
|
||||
|
||||
p.setPen( QColor( 64, 64, 64 ) );
|
||||
p.drawText( 6, 55, getModel()->displayName() );
|
||||
p.setPen( Qt::white );
|
||||
p.drawText( 5, 54, getModel()->displayName() );
|
||||
p.drawText( 6, 55, model()->displayName() );
|
||||
p.setPen( palette().text().color() );
|
||||
p.drawText( 5, 54, model()->displayName() );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void effectView::modelChanged( void )
|
||||
void EffectView::modelChanged()
|
||||
{
|
||||
m_bypass->setModel( &getEffect()->m_enabledModel );
|
||||
m_wetDry->setModel( &getEffect()->m_wetDryModel );
|
||||
m_autoQuit->setModel( &getEffect()->m_autoQuitModel );
|
||||
m_gate->setModel( &getEffect()->m_gateModel );
|
||||
m_bypass->setModel( &effect()->m_enabledModel );
|
||||
m_wetDry->setModel( &effect()->m_wetDryModel );
|
||||
m_autoQuit->setModel( &effect()->m_autoQuitModel );
|
||||
m_gate->setModel( &effect()->m_gateModel );
|
||||
}
|
||||
|
||||
|
||||
|
||||
#include "moc_effect_view.cxx"
|
||||
#include "moc_EffectView.cxx"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* envelope_and_lfo_view.cpp - widget which is m_used by envelope/lfo/filter-
|
||||
* tab of channel-window
|
||||
* EnvelopeAndLfoView.cpp - widget which is m_used by envelope/lfo/filter-
|
||||
* tab of instrument track window
|
||||
*
|
||||
* Copyright (c) 2004-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
@@ -23,15 +23,11 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "envelope_and_lfo_view.h"
|
||||
|
||||
|
||||
#include <QtGui/QMouseEvent>
|
||||
#include <QtGui/QPainter>
|
||||
|
||||
|
||||
#include "envelope_and_lfo_parameters.h"
|
||||
#include "EnvelopeAndLfoView.h"
|
||||
#include "EnvelopeAndLfoParameters.h"
|
||||
#include "embed.h"
|
||||
#include "engine.h"
|
||||
#include "gui_templates.h"
|
||||
@@ -39,16 +35,15 @@
|
||||
#include "led_checkbox.h"
|
||||
#include "mixer.h"
|
||||
#include "mmp.h"
|
||||
#include "oscillator.h"
|
||||
#include "Oscillator.h"
|
||||
#include "pixmap_button.h"
|
||||
#include "string_pair_drag.h"
|
||||
#include "tempo_sync_knob.h"
|
||||
#include "TempoSyncKnob.h"
|
||||
#include "text_float.h"
|
||||
#include "tooltip.h"
|
||||
#include "track.h"
|
||||
|
||||
|
||||
|
||||
extern const float SECS_PER_ENV_SEGMENT;
|
||||
extern const float SECS_PER_LFO_OSCILLATION;
|
||||
|
||||
@@ -81,20 +76,19 @@ const int LFO_SHAPES_X = LFO_GRAPH_X;//PREDELAY_KNOB_X;
|
||||
const int LFO_SHAPES_Y = LFO_GRAPH_Y + 50;
|
||||
|
||||
|
||||
QPixmap * envelopeAndLFOView::s_envGraph = NULL;
|
||||
QPixmap * envelopeAndLFOView::s_lfoGraph = NULL;
|
||||
QPixmap * EnvelopeAndLfoView::s_envGraph = NULL;
|
||||
QPixmap * EnvelopeAndLfoView::s_lfoGraph = NULL;
|
||||
|
||||
|
||||
|
||||
envelopeAndLFOView::envelopeAndLFOView( QWidget * _parent ) :
|
||||
EnvelopeAndLfoView::EnvelopeAndLfoView( QWidget * _parent ) :
|
||||
QWidget( _parent ),
|
||||
modelView( NULL, this ),
|
||||
ModelView( NULL, this ),
|
||||
m_params( NULL )
|
||||
{
|
||||
if( s_envGraph == NULL )
|
||||
{
|
||||
s_envGraph = new QPixmap( embed::getIconPixmap(
|
||||
"envelope_graph" ) );
|
||||
s_envGraph = new QPixmap( embed::getIconPixmap( "envelope_graph" ) );
|
||||
}
|
||||
if( s_lfoGraph == NULL )
|
||||
{
|
||||
@@ -200,7 +194,7 @@ envelopeAndLFOView::envelopeAndLFOView( QWidget * _parent ) :
|
||||
"increase its amplitude to maximum." ) );
|
||||
|
||||
|
||||
m_lfoSpeedKnob = new tempoSyncKnob( knobBright_26, this );
|
||||
m_lfoSpeedKnob = new TempoSyncKnob( knobBright_26, this );
|
||||
m_lfoSpeedKnob->setLabel( tr( "SPD" ) );
|
||||
m_lfoSpeedKnob->move( LFO_SPEED_KNOB_X, LFO_KNOB_Y );
|
||||
m_lfoSpeedKnob->setHintText( tr( "LFO speed:" ) + " ", "" );
|
||||
@@ -307,7 +301,7 @@ envelopeAndLFOView::envelopeAndLFOView( QWidget * _parent ) :
|
||||
|
||||
|
||||
|
||||
envelopeAndLFOView::~envelopeAndLFOView()
|
||||
EnvelopeAndLfoView::~EnvelopeAndLfoView()
|
||||
{
|
||||
delete m_lfoWaveBtnGrp;
|
||||
}
|
||||
@@ -315,9 +309,9 @@ envelopeAndLFOView::~envelopeAndLFOView()
|
||||
|
||||
|
||||
|
||||
void envelopeAndLFOView::modelChanged( void )
|
||||
void EnvelopeAndLfoView::modelChanged()
|
||||
{
|
||||
m_params = castModel<envelopeAndLFOParameters>();
|
||||
m_params = castModel<EnvelopeAndLfoParameters>();
|
||||
m_predelayKnob->setModel( &m_params->m_predelayModel );
|
||||
m_attackKnob->setModel( &m_params->m_attackModel );
|
||||
m_holdKnob->setModel( &m_params->m_holdModel );
|
||||
@@ -337,7 +331,7 @@ void envelopeAndLFOView::modelChanged( void )
|
||||
|
||||
|
||||
|
||||
void envelopeAndLFOView::mousePressEvent( QMouseEvent * _me )
|
||||
void EnvelopeAndLfoView::mousePressEvent( QMouseEvent * _me )
|
||||
{
|
||||
if( _me->button() != Qt::LeftButton )
|
||||
{
|
||||
@@ -373,7 +367,7 @@ void envelopeAndLFOView::mousePressEvent( QMouseEvent * _me )
|
||||
|
||||
|
||||
|
||||
void envelopeAndLFOView::dragEnterEvent( QDragEnterEvent * _dee )
|
||||
void EnvelopeAndLfoView::dragEnterEvent( QDragEnterEvent * _dee )
|
||||
{
|
||||
stringPairDrag::processDragEnterEvent( _dee,
|
||||
QString( "samplefile,tco_%1" ).arg(
|
||||
@@ -383,7 +377,7 @@ void envelopeAndLFOView::dragEnterEvent( QDragEnterEvent * _dee )
|
||||
|
||||
|
||||
|
||||
void envelopeAndLFOView::dropEvent( QDropEvent * _de )
|
||||
void EnvelopeAndLfoView::dropEvent( QDropEvent * _de )
|
||||
{
|
||||
QString type = stringPairDrag::decodeKey( _de );
|
||||
QString value = stringPairDrag::decodeValue( _de );
|
||||
@@ -408,7 +402,7 @@ void envelopeAndLFOView::dropEvent( QDropEvent * _de )
|
||||
|
||||
|
||||
|
||||
void envelopeAndLFOView::paintEvent( QPaintEvent * )
|
||||
void EnvelopeAndLfoView::paintEvent( QPaintEvent * )
|
||||
{
|
||||
QPainter p( this );
|
||||
p.setRenderHint( QPainter::Antialiasing );
|
||||
@@ -517,20 +511,20 @@ void envelopeAndLFOView::paintEvent( QPaintEvent * )
|
||||
osc_frames;
|
||||
switch( m_params->m_lfoWaveModel.value() )
|
||||
{
|
||||
case envelopeAndLFOParameters::SineWave:
|
||||
val = oscillator::sinSample( phase );
|
||||
case EnvelopeAndLfoParameters::SineWave:
|
||||
val = Oscillator::sinSample( phase );
|
||||
break;
|
||||
case envelopeAndLFOParameters::TriangleWave:
|
||||
val = oscillator::triangleSample(
|
||||
case EnvelopeAndLfoParameters::TriangleWave:
|
||||
val = Oscillator::triangleSample(
|
||||
phase );
|
||||
break;
|
||||
case envelopeAndLFOParameters::SawWave:
|
||||
val = oscillator::sawSample( phase );
|
||||
case EnvelopeAndLfoParameters::SawWave:
|
||||
val = Oscillator::sawSample( phase );
|
||||
break;
|
||||
case envelopeAndLFOParameters::SquareWave:
|
||||
val = oscillator::squareSample( phase );
|
||||
case EnvelopeAndLfoParameters::SquareWave:
|
||||
val = Oscillator::squareSample( phase );
|
||||
break;
|
||||
case envelopeAndLFOParameters::UserDefinedWave:
|
||||
case EnvelopeAndLfoParameters::UserDefinedWave:
|
||||
val = m_params->m_userWave.
|
||||
userWaveSample( phase );
|
||||
}
|
||||
@@ -561,10 +555,10 @@ void envelopeAndLFOView::paintEvent( QPaintEvent * )
|
||||
|
||||
|
||||
|
||||
void envelopeAndLFOView::lfoUserWaveChanged( void )
|
||||
void EnvelopeAndLfoView::lfoUserWaveChanged()
|
||||
{
|
||||
if( m_params->m_lfoWaveModel.value() ==
|
||||
envelopeAndLFOParameters::UserDefinedWave )
|
||||
EnvelopeAndLfoParameters::UserDefinedWave )
|
||||
{
|
||||
if( m_params->m_userWave.frames() <= 1 )
|
||||
{
|
||||
@@ -579,6 +573,6 @@ void envelopeAndLFOView::lfoUserWaveChanged( void )
|
||||
|
||||
|
||||
|
||||
#include "moc_envelope_and_lfo_view.cxx"
|
||||
#include "moc_EnvelopeAndLfoView.cxx"
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* instrument_function_views.cpp - view for instrument-functions-tab
|
||||
* InstrumentFunctionViews.cpp - view for instrument-functions-tab
|
||||
*
|
||||
* Copyright (c) 2004-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* Copyright (c) 2004-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
@@ -22,11 +22,10 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include <QtGui/QLabel>
|
||||
|
||||
#include "instrument_functions.h"
|
||||
#include "instrument_function_views.h"
|
||||
#include "InstrumentFunctions.h"
|
||||
#include "InstrumentFunctionViews.h"
|
||||
#include "combobox.h"
|
||||
#include "embed.h"
|
||||
#include "engine.h"
|
||||
@@ -34,7 +33,7 @@
|
||||
#include "gui_templates.h"
|
||||
#include "knob.h"
|
||||
#include "pixmap_button.h"
|
||||
#include "tempo_sync_knob.h"
|
||||
#include "TempoSyncKnob.h"
|
||||
#include "tooltip.h"
|
||||
|
||||
|
||||
@@ -50,9 +49,9 @@ const int ARP_GROUPBOX_HEIGHT = 240 - ARP_GROUPBOX_Y;
|
||||
|
||||
|
||||
|
||||
chordCreatorView::chordCreatorView( chordCreator * _cc, QWidget * _parent ) :
|
||||
ChordCreatorView::ChordCreatorView( ChordCreator * _cc, QWidget * _parent ) :
|
||||
QWidget( _parent ),
|
||||
modelView( NULL, this ),
|
||||
ModelView( NULL, this ),
|
||||
m_cc( _cc ),
|
||||
m_chordsGroupBox( new groupBox( tr( "CHORDS" ), this ) ),
|
||||
m_chordsComboBox( new comboBox( m_chordsGroupBox ) ),
|
||||
@@ -81,7 +80,7 @@ chordCreatorView::chordCreatorView( chordCreator * _cc, QWidget * _parent ) :
|
||||
|
||||
|
||||
|
||||
chordCreatorView::~chordCreatorView()
|
||||
ChordCreatorView::~ChordCreatorView()
|
||||
{
|
||||
delete m_chordsGroupBox;
|
||||
}
|
||||
@@ -89,9 +88,9 @@ chordCreatorView::~chordCreatorView()
|
||||
|
||||
|
||||
|
||||
void chordCreatorView::modelChanged( void )
|
||||
void ChordCreatorView::modelChanged( void )
|
||||
{
|
||||
m_cc = castModel<chordCreator>();
|
||||
m_cc = castModel<ChordCreator>();
|
||||
m_chordsGroupBox->setModel( &m_cc->m_chordsEnabledModel );
|
||||
m_chordsComboBox->setModel( &m_cc->m_chordsModel );
|
||||
m_chordRangeKnob->setModel( &m_cc->m_chordRangeModel );
|
||||
@@ -103,14 +102,14 @@ void chordCreatorView::modelChanged( void )
|
||||
|
||||
|
||||
|
||||
arpeggiatorView::arpeggiatorView( arpeggiator * _arp, QWidget * _parent ) :
|
||||
ArpeggiatorView::ArpeggiatorView( Arpeggiator * _arp, QWidget * _parent ) :
|
||||
QWidget( _parent ),
|
||||
modelView( NULL, this ),
|
||||
ModelView( NULL, this ),
|
||||
m_a( _arp ),
|
||||
m_arpGroupBox( new groupBox( tr( "ARPEGGIO" ), this ) ),
|
||||
m_arpComboBox( new comboBox( m_arpGroupBox) ),
|
||||
m_arpRangeKnob( new knob( knobBright_26, m_arpGroupBox ) ),
|
||||
m_arpTimeKnob( new tempoSyncKnob( knobBright_26, m_arpGroupBox ) ),
|
||||
m_arpTimeKnob( new TempoSyncKnob( knobBright_26, m_arpGroupBox ) ),
|
||||
m_arpGateKnob( new knob( knobBright_26, m_arpGroupBox ) ),
|
||||
m_arpDirectionComboBox( new comboBox( m_arpGroupBox ) ),
|
||||
m_arpModeComboBox( new comboBox( m_arpGroupBox ) )
|
||||
@@ -180,7 +179,7 @@ arpeggiatorView::arpeggiatorView( arpeggiator * _arp, QWidget * _parent ) :
|
||||
|
||||
|
||||
|
||||
arpeggiatorView::~arpeggiatorView()
|
||||
ArpeggiatorView::~ArpeggiatorView()
|
||||
{
|
||||
delete m_arpGroupBox;
|
||||
}
|
||||
@@ -188,9 +187,9 @@ arpeggiatorView::~arpeggiatorView()
|
||||
|
||||
|
||||
|
||||
void arpeggiatorView::modelChanged( void )
|
||||
void ArpeggiatorView::modelChanged( void )
|
||||
{
|
||||
m_a = castModel<arpeggiator>();
|
||||
m_a = castModel<Arpeggiator>();
|
||||
m_arpGroupBox->setModel( &m_a->m_arpEnabledModel );
|
||||
m_arpComboBox->setModel( &m_a->m_arpModel );
|
||||
m_arpRangeKnob->setModel( &m_a->m_arpRangeModel );
|
||||
@@ -202,5 +201,5 @@ void arpeggiatorView::modelChanged( void )
|
||||
|
||||
|
||||
|
||||
#include "moc_instrument_function_views.cxx"
|
||||
#include "moc_InstrumentFunctionViews.cxx"
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* instrument_midi_io_view.cpp - MIDI-IO-View
|
||||
* InstrumentMidiIOView.cpp - MIDI-IO-View
|
||||
*
|
||||
* Copyright (c) 2005-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
@@ -25,7 +25,7 @@
|
||||
#include <QtGui/QMenu>
|
||||
#include <QtGui/QToolButton>
|
||||
|
||||
#include "instrument_midi_io_view.h"
|
||||
#include "InstrumentMidiIOView.h"
|
||||
#include "MidiPortMenu.h"
|
||||
#include "engine.h"
|
||||
#include "embed.h"
|
||||
@@ -38,9 +38,9 @@
|
||||
|
||||
|
||||
|
||||
instrumentMidiIOView::instrumentMidiIOView( QWidget * _parent ) :
|
||||
InstrumentMidiIOView::InstrumentMidiIOView( QWidget * _parent ) :
|
||||
QWidget( _parent ),
|
||||
modelView( NULL, this ),
|
||||
ModelView( NULL, this ),
|
||||
m_rpBtn( NULL ),
|
||||
m_wpBtn( NULL )
|
||||
{
|
||||
@@ -112,14 +112,14 @@ instrumentMidiIOView::instrumentMidiIOView( QWidget * _parent ) :
|
||||
|
||||
|
||||
|
||||
instrumentMidiIOView::~instrumentMidiIOView()
|
||||
InstrumentMidiIOView::~InstrumentMidiIOView()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void instrumentMidiIOView::modelChanged()
|
||||
void InstrumentMidiIOView::modelChanged()
|
||||
{
|
||||
MidiPort * mp = castModel<MidiPort>();
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* instrument_sound_shaping_view.cpp - view for instrumentSoundShaping-class
|
||||
* InstrumentSoundShapingView.cpp - view for InstrumentSoundShaping class
|
||||
*
|
||||
* Copyright (c) 2004-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* Copyright (c) 2004-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
@@ -22,10 +22,9 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "instrument_sound_shaping_view.h"
|
||||
#include "envelope_and_lfo_parameters.h"
|
||||
#include "envelope_and_lfo_view.h"
|
||||
#include "InstrumentSoundShapingView.h"
|
||||
#include "EnvelopeAndLfoParameters.h"
|
||||
#include "EnvelopeAndLfoView.h"
|
||||
#include "combobox.h"
|
||||
#include "group_box.h"
|
||||
#include "gui_templates.h"
|
||||
@@ -46,9 +45,9 @@ const int FILTER_GROUPBOX_HEIGHT = 245-FILTER_GROUPBOX_Y;
|
||||
|
||||
|
||||
|
||||
instrumentSoundShapingView::instrumentSoundShapingView( QWidget * _parent ) :
|
||||
InstrumentSoundShapingView::InstrumentSoundShapingView( QWidget * _parent ) :
|
||||
QWidget( _parent ),
|
||||
modelView( NULL, this ),
|
||||
ModelView( NULL, this ),
|
||||
m_ss( NULL )
|
||||
{
|
||||
m_targetsTabWidget = new tabWidget( tr( "TARGET" ), this );
|
||||
@@ -71,12 +70,11 @@ instrumentSoundShapingView::instrumentSoundShapingView( QWidget * _parent ) :
|
||||
"sounds out of a saw-wave with just some "
|
||||
"envelopes...!" ) );
|
||||
|
||||
for( int i = 0; i < instrumentSoundShaping::NumTargets; ++i )
|
||||
for( int i = 0; i < InstrumentSoundShaping::NumTargets; ++i )
|
||||
{
|
||||
m_envLFOViews[i] = new envelopeAndLFOView( m_targetsTabWidget );
|
||||
m_targetsTabWidget->addTab( m_envLFOViews[i],
|
||||
tr( __targetNames[i][0]
|
||||
.toUtf8().constData() ) );
|
||||
m_envLfoViews[i] = new EnvelopeAndLfoView( m_targetsTabWidget );
|
||||
m_targetsTabWidget->addTab( m_envLfoViews[i],
|
||||
tr( __targetNames[i][0].toUtf8().constData() ) );
|
||||
}
|
||||
|
||||
|
||||
@@ -123,7 +121,7 @@ instrumentSoundShapingView::instrumentSoundShapingView( QWidget * _parent ) :
|
||||
|
||||
|
||||
|
||||
instrumentSoundShapingView::~instrumentSoundShapingView()
|
||||
InstrumentSoundShapingView::~InstrumentSoundShapingView()
|
||||
{
|
||||
delete m_targetsTabWidget;
|
||||
}
|
||||
@@ -131,20 +129,20 @@ instrumentSoundShapingView::~instrumentSoundShapingView()
|
||||
|
||||
|
||||
|
||||
void instrumentSoundShapingView::modelChanged( void )
|
||||
void InstrumentSoundShapingView::modelChanged( void )
|
||||
{
|
||||
m_ss = castModel<instrumentSoundShaping>();
|
||||
m_ss = castModel<InstrumentSoundShaping>();
|
||||
m_filterGroupBox->setModel( &m_ss->m_filterEnabledModel );
|
||||
m_filterComboBox->setModel( &m_ss->m_filterModel );
|
||||
m_filterCutKnob->setModel( &m_ss->m_filterCutModel );
|
||||
m_filterResKnob->setModel( &m_ss->m_filterResModel );
|
||||
for( int i = 0; i < instrumentSoundShaping::NumTargets; ++i )
|
||||
for( int i = 0; i < InstrumentSoundShaping::NumTargets; ++i )
|
||||
{
|
||||
m_envLFOViews[i]->setModel( m_ss->m_envLFOParameters[i] );
|
||||
m_envLfoViews[i]->setModel( m_ss->m_envLfoParameters[i] );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
#include "moc_instrument_sound_shaping_view.cxx"
|
||||
#include "moc_InstrumentSoundShapingView.cxx"
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
/*
|
||||
* ladspa_control_view.cpp - widget for controlling a LADSPA port
|
||||
* LadspaControlView.cpp - widget for controlling a LADSPA port
|
||||
*
|
||||
* Copyright (c) 2006-2008 Danny McRae <khjklujn/at/users.sourceforge.net>
|
||||
* Copyright (c) 2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -22,21 +23,20 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include <QtGui/QLayout>
|
||||
|
||||
#include "ladspa_control.h"
|
||||
#include "ladspa_control_view.h"
|
||||
#include "ladspa_base.h"
|
||||
#include "LadspaControl.h"
|
||||
#include "LadspaControlView.h"
|
||||
#include "LadspaBase.h"
|
||||
#include "led_checkbox.h"
|
||||
#include "tempo_sync_knob.h"
|
||||
#include "TempoSyncKnob.h"
|
||||
#include "tooltip.h"
|
||||
|
||||
|
||||
ladspaControlView::ladspaControlView( QWidget * _parent,
|
||||
ladspaControl * _ctl ) :
|
||||
LadspaControlView::LadspaControlView( QWidget * _parent,
|
||||
LadspaControl * _ctl ) :
|
||||
QWidget( _parent ),
|
||||
modelView( _ctl, this ),
|
||||
ModelView( _ctl, this ),
|
||||
m_ctl( _ctl )
|
||||
{
|
||||
QHBoxLayout * layout = new QHBoxLayout( this );
|
||||
@@ -55,15 +55,13 @@ ladspaControlView::ladspaControlView( QWidget * _parent,
|
||||
|
||||
knob * knb = NULL;
|
||||
|
||||
switch( m_ctl->getPort()->data_type )
|
||||
switch( m_ctl->port()->data_type )
|
||||
{
|
||||
case TOGGLED:
|
||||
{
|
||||
ledCheckBox * toggle = new ledCheckBox(
|
||||
m_ctl->getPort()->name, this,
|
||||
QString::null,
|
||||
ledCheckBox::Green );
|
||||
toggle->setModel( m_ctl->getToggledModel() );
|
||||
m_ctl->port()->name, this, QString::null, ledCheckBox::Green );
|
||||
toggle->setModel( m_ctl->toggledModel() );
|
||||
layout->addWidget( toggle );
|
||||
if( link != NULL )
|
||||
{
|
||||
@@ -80,13 +78,11 @@ ladspaControlView::ladspaControlView( QWidget * _parent,
|
||||
|
||||
case INTEGER:
|
||||
case FLOATING:
|
||||
knb = new knob( knobBright_26, this,
|
||||
m_ctl->getPort()->name );
|
||||
knb = new knob( knobBright_26, this, m_ctl->port()->name );
|
||||
break;
|
||||
|
||||
case TIME:
|
||||
knb = new tempoSyncKnob( knobBright_26, this,
|
||||
m_ctl->getPort()->name );
|
||||
knb = new TempoSyncKnob( knobBright_26, this, m_ctl->port()->name );
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -95,15 +91,15 @@ ladspaControlView::ladspaControlView( QWidget * _parent,
|
||||
|
||||
if( knb != NULL )
|
||||
{
|
||||
if( m_ctl->getPort()->data_type != TIME )
|
||||
if( m_ctl->port()->data_type != TIME )
|
||||
{
|
||||
knb->setModel( m_ctl->getKnobModel() );
|
||||
knb->setModel( m_ctl->knobModel() );
|
||||
}
|
||||
else
|
||||
{
|
||||
knb->setModel( m_ctl->getTempoSyncKnobModel() );
|
||||
knb->setModel( m_ctl->tempoSyncKnobModel() );
|
||||
}
|
||||
knb->setLabel( m_ctl->getPort()->name );
|
||||
knb->setLabel( m_ctl->port()->name );
|
||||
knb->setHintText( tr( "Value:" ) + " ", "" );
|
||||
knb->setWhatsThis( tr( "Sorry, no help available." ) );
|
||||
layout->addWidget( knb );
|
||||
@@ -122,11 +118,11 @@ ladspaControlView::ladspaControlView( QWidget * _parent,
|
||||
|
||||
|
||||
|
||||
ladspaControlView::~ladspaControlView()
|
||||
LadspaControlView::~LadspaControlView()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
#include "moc_ladspa_control_view.cxx"
|
||||
#include "moc_LadspaControlView.cxx"
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* meter_dialog.cpp - dialog for entering meter settings
|
||||
* MeterDialog.cpp - dialog for entering meter settings
|
||||
*
|
||||
* Copyright (c) 2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2008-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2006-2008 Danny McRae <khjklujn/at/yahoo.com>
|
||||
*
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
@@ -28,16 +28,16 @@
|
||||
#include <QtGui/QPushButton>
|
||||
#include <QtGui/QLabel>
|
||||
|
||||
#include "meter_dialog.h"
|
||||
#include "meter_model.h"
|
||||
#include "MeterDialog.h"
|
||||
#include "MeterModel.h"
|
||||
#include "embed.h"
|
||||
#include "gui_templates.h"
|
||||
#include "lcd_spinbox.h"
|
||||
|
||||
|
||||
meterDialog::meterDialog( QWidget * _parent, bool _simple ) :
|
||||
MeterDialog::MeterDialog( QWidget * _parent, bool _simple ) :
|
||||
QWidget( _parent ),
|
||||
modelView( NULL, this )
|
||||
ModelView( NULL, this )
|
||||
{
|
||||
QVBoxLayout * vlayout = new QVBoxLayout( this );
|
||||
vlayout->setSpacing( 0 );
|
||||
@@ -99,18 +99,18 @@ meterDialog::meterDialog( QWidget * _parent, bool _simple ) :
|
||||
|
||||
|
||||
|
||||
meterDialog::~meterDialog()
|
||||
MeterDialog::~MeterDialog()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void meterDialog::modelChanged( void )
|
||||
void MeterDialog::modelChanged()
|
||||
{
|
||||
meterModel * mm = castModel<meterModel>();
|
||||
m_numerator->setModel( &mm->m_numeratorModel );
|
||||
m_denominator->setModel( &mm->m_denominatorModel );
|
||||
MeterModel * mm = castModel<MeterModel>();
|
||||
m_numerator->setModel( &mm->numeratorModel() );
|
||||
m_denominator->setModel( &mm->denominatorModel() );
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
|
||||
MidiPortMenu::MidiPortMenu( MidiPort::Modes _mode ) :
|
||||
modelView( NULL, this ),
|
||||
ModelView( NULL, this ),
|
||||
m_mode( _mode )
|
||||
{
|
||||
setFont( pointSize<9>( font() ) );
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
#include "caption_menu.h"
|
||||
#include "engine.h"
|
||||
#include "embed.h"
|
||||
#include "main_window.h"
|
||||
#include "MainWindow.h"
|
||||
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
automatableButton::automatableButton( QWidget * _parent,
|
||||
const QString & _name ) :
|
||||
QPushButton( _parent ),
|
||||
boolModelView( new boolModel( FALSE, NULL, _name, TRUE ), this ),
|
||||
BoolModelView( new BoolModel( false, NULL, _name, true ), this ),
|
||||
m_group( NULL )
|
||||
{
|
||||
setAccessibleName( _name );
|
||||
@@ -62,7 +62,7 @@ automatableButton::~automatableButton()
|
||||
|
||||
|
||||
|
||||
void automatableButton::modelChanged( void )
|
||||
void automatableButton::modelChanged()
|
||||
{
|
||||
if( QPushButton::isChecked() != model()->value() )
|
||||
{
|
||||
@@ -73,7 +73,7 @@ void automatableButton::modelChanged( void )
|
||||
|
||||
|
||||
|
||||
void automatableButton::update( void )
|
||||
void automatableButton::update()
|
||||
{
|
||||
if( QPushButton::isChecked() != model()->value() )
|
||||
{
|
||||
@@ -124,7 +124,7 @@ void automatableButton::mousePressEvent( QMouseEvent * _me )
|
||||
}
|
||||
else
|
||||
{
|
||||
automatableModelView::mousePressEvent( _me );
|
||||
AutomatableModelView::mousePressEvent( _me );
|
||||
QPushButton::mousePressEvent( _me );
|
||||
}
|
||||
}
|
||||
@@ -143,11 +143,11 @@ void automatableButton::mouseReleaseEvent( QMouseEvent * _me )
|
||||
|
||||
|
||||
|
||||
void automatableButton::toggle( void )
|
||||
void automatableButton::toggle()
|
||||
{
|
||||
if( isCheckable() && m_group != NULL )
|
||||
{
|
||||
if( model()->value() == FALSE )
|
||||
if( model()->value() == false )
|
||||
{
|
||||
m_group->activateButton( this );
|
||||
}
|
||||
@@ -168,7 +168,7 @@ void automatableButton::toggle( void )
|
||||
automatableButtonGroup::automatableButtonGroup( QWidget * _parent,
|
||||
const QString & _name ) :
|
||||
QWidget( _parent ),
|
||||
intModelView( new intModel( 0, 0, 0, NULL, _name, TRUE ), this )
|
||||
IntModelView( new IntModel( 0, 0, 0, NULL, _name, true ), this )
|
||||
{
|
||||
hide();
|
||||
setAccessibleName( _name );
|
||||
@@ -192,11 +192,11 @@ automatableButtonGroup::~automatableButtonGroup()
|
||||
void automatableButtonGroup::addButton( automatableButton * _btn )
|
||||
{
|
||||
_btn->m_group = this;
|
||||
_btn->setCheckable( TRUE );
|
||||
_btn->model()->setValue( FALSE );
|
||||
_btn->setCheckable( true );
|
||||
_btn->model()->setValue( false );
|
||||
// disable journalling as we're recording changes of states of
|
||||
// button-group members on our own
|
||||
_btn->model()->setJournalling( FALSE );
|
||||
_btn->model()->setJournalling( false );
|
||||
|
||||
m_buttons.push_back( _btn );
|
||||
model()->setRange( 0, m_buttons.size() - 1 );
|
||||
@@ -231,18 +231,18 @@ void automatableButtonGroup::activateButton( automatableButton * _btn )
|
||||
|
||||
|
||||
|
||||
void automatableButtonGroup::modelChanged( void )
|
||||
void automatableButtonGroup::modelChanged()
|
||||
{
|
||||
connect( model(), SIGNAL( dataChanged() ),
|
||||
this, SLOT( updateButtons() ) );
|
||||
intModelView::modelChanged();
|
||||
IntModelView::modelChanged();
|
||||
updateButtons();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void automatableButtonGroup::updateButtons( void )
|
||||
void automatableButtonGroup::updateButtons()
|
||||
{
|
||||
model()->setRange( 0, m_buttons.size() - 1 );
|
||||
int i = 0;
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
* automatable_slider.cpp - implementation of class automatableSlider
|
||||
*
|
||||
* Copyright (c) 2006-2007 Javier Serrano Polo <jasp00/at/users.sourceforge.net>
|
||||
* Copyright (c) 2007-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* Copyright (c) 2007-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
@@ -23,7 +23,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "automatable_slider.h"
|
||||
|
||||
#include <QtGui/QCursor>
|
||||
@@ -32,7 +31,7 @@
|
||||
#include "caption_menu.h"
|
||||
#include "embed.h"
|
||||
#include "engine.h"
|
||||
#include "main_window.h"
|
||||
#include "MainWindow.h"
|
||||
|
||||
|
||||
|
||||
@@ -40,8 +39,8 @@
|
||||
automatableSlider::automatableSlider( QWidget * _parent,
|
||||
const QString & _name ) :
|
||||
QSlider( _parent ),
|
||||
intModelView( new intModel( 0, 0, 0, NULL, _name, TRUE ), this ),
|
||||
m_showStatus( FALSE )
|
||||
IntModelView( new IntModel( 0, 0, 0, NULL, _name, true ), this ),
|
||||
m_showStatus( false )
|
||||
{
|
||||
setAccessibleName( _name );
|
||||
|
||||
@@ -76,12 +75,12 @@ void automatableSlider::mousePressEvent( QMouseEvent * _me )
|
||||
if( _me->button() == Qt::LeftButton &&
|
||||
! ( _me->modifiers() & Qt::ControlModifier ) )
|
||||
{
|
||||
m_showStatus = TRUE;
|
||||
m_showStatus = true;
|
||||
QSlider::mousePressEvent( _me );
|
||||
}
|
||||
else
|
||||
{
|
||||
automatableModelView::mousePressEvent( _me );
|
||||
IntModelView::mousePressEvent( _me );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,7 +89,7 @@ void automatableSlider::mousePressEvent( QMouseEvent * _me )
|
||||
|
||||
void automatableSlider::mouseReleaseEvent( QMouseEvent * _me )
|
||||
{
|
||||
m_showStatus = FALSE;
|
||||
m_showStatus = false;
|
||||
QSlider::mouseReleaseEvent( _me );
|
||||
}
|
||||
|
||||
@@ -100,7 +99,7 @@ void automatableSlider::mouseReleaseEvent( QMouseEvent * _me )
|
||||
void automatableSlider::wheelEvent( QWheelEvent * _me )
|
||||
{
|
||||
bool old_status = m_showStatus;
|
||||
m_showStatus = TRUE;
|
||||
m_showStatus = true;
|
||||
QSlider::wheelEvent( _me );
|
||||
m_showStatus = old_status;
|
||||
}
|
||||
@@ -108,7 +107,7 @@ void automatableSlider::wheelEvent( QWheelEvent * _me )
|
||||
|
||||
|
||||
|
||||
void automatableSlider::modelChanged( void )
|
||||
void automatableSlider::modelChanged()
|
||||
{
|
||||
QSlider::setRange( model()->minValue(), model()->maxValue() );
|
||||
updateSlider();
|
||||
@@ -137,7 +136,7 @@ void automatableSlider::moveSlider( int _value )
|
||||
|
||||
|
||||
|
||||
void automatableSlider::updateSlider( void )
|
||||
void automatableSlider::updateSlider()
|
||||
{
|
||||
QSlider::setValue( model()->value() );
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
#include "engine.h"
|
||||
#include "embed.h"
|
||||
#include "gui_templates.h"
|
||||
#include "main_window.h"
|
||||
#include "MainWindow.h"
|
||||
|
||||
|
||||
QPixmap * comboBox::s_background = NULL;
|
||||
@@ -50,26 +50,23 @@ const int CB_ARROW_BTN_WIDTH = 20;
|
||||
|
||||
comboBox::comboBox( QWidget * _parent, const QString & _name ) :
|
||||
QWidget( _parent ),
|
||||
intModelView( new comboBoxModel( NULL, QString::null, TRUE ), this ),
|
||||
IntModelView( new ComboBoxModel( NULL, QString::null, true ), this ),
|
||||
m_menu( this ),
|
||||
m_pressed( FALSE )
|
||||
m_pressed( false )
|
||||
{
|
||||
if( s_background == NULL )
|
||||
{
|
||||
s_background = new QPixmap( embed::getIconPixmap(
|
||||
"combobox_bg" ) );
|
||||
s_background = new QPixmap( embed::getIconPixmap( "combobox_bg" ) );
|
||||
}
|
||||
|
||||
if( s_arrow == NULL )
|
||||
{
|
||||
s_arrow = new QPixmap( embed::getIconPixmap(
|
||||
"combobox_arrow" ) );
|
||||
s_arrow = new QPixmap( embed::getIconPixmap( "combobox_arrow" ) );
|
||||
}
|
||||
|
||||
if( s_arrowSelected == NULL )
|
||||
{
|
||||
s_arrowSelected = new QPixmap( embed::getIconPixmap(
|
||||
"combobox_arrow_selected" ) );
|
||||
s_arrowSelected = new QPixmap( embed::getIconPixmap( "combobox_arrow_selected" ) );
|
||||
}
|
||||
|
||||
setFont( pointSize<9>( font() ) );
|
||||
@@ -115,7 +112,7 @@ void comboBox::mousePressEvent( QMouseEvent * _me )
|
||||
{
|
||||
if( _me->x() > width() - CB_ARROW_BTN_WIDTH )
|
||||
{
|
||||
m_pressed = TRUE;
|
||||
m_pressed = true;
|
||||
update();
|
||||
|
||||
m_menu.clear();
|
||||
@@ -141,7 +138,7 @@ void comboBox::mousePressEvent( QMouseEvent * _me )
|
||||
m_menu.exec( mapToGlobal(
|
||||
QPoint( width(), 0 ) ) );
|
||||
}
|
||||
m_pressed = FALSE;
|
||||
m_pressed = false;
|
||||
update();
|
||||
}
|
||||
else if( _me->button() == Qt::LeftButton )
|
||||
@@ -157,7 +154,7 @@ void comboBox::mousePressEvent( QMouseEvent * _me )
|
||||
}
|
||||
else
|
||||
{
|
||||
automatableModelView::mousePressEvent( _me );
|
||||
IntModelView::mousePressEvent( _me );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -53,13 +53,13 @@
|
||||
#include "embed.h"
|
||||
#include "engine.h"
|
||||
#include "caption_menu.h"
|
||||
#include "main_window.h"
|
||||
#include "MainWindow.h"
|
||||
|
||||
|
||||
|
||||
fader::fader( floatModel * _model, const QString & _name, QWidget * _parent ) :
|
||||
fader::fader( FloatModel * _model, const QString & _name, QWidget * _parent ) :
|
||||
QWidget( _parent ),
|
||||
floatModelView( _model, this ),
|
||||
FloatModelView( _model, this ),
|
||||
m_model( _model ),
|
||||
m_fPeakValue_L( 0.0 ),
|
||||
m_fPeakValue_R( 0.0 ),
|
||||
@@ -120,7 +120,7 @@ void fader::mousePressEvent( QMouseEvent * _me )
|
||||
}
|
||||
else
|
||||
{
|
||||
automatableModelView::mousePressEvent( _me );
|
||||
AutomatableModelView::mousePressEvent( _me );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include <QtGui/QPaintEvent>
|
||||
#include <QtGui/QFontMetrics>
|
||||
#include <QtGui/QPainter>
|
||||
@@ -31,25 +30,21 @@
|
||||
#include "graph.h"
|
||||
#include "string_pair_drag.h"
|
||||
#include "sample_buffer.h"
|
||||
#include "oscillator.h"
|
||||
//#include <cstdlib>
|
||||
//#include <math.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
#include "Oscillator.h"
|
||||
#include "engine.h"
|
||||
|
||||
|
||||
graph::graph( QWidget * _parent, graphStyle _style ) :
|
||||
QWidget( _parent ),
|
||||
/* TODO: size, background? */
|
||||
modelView( new graphModel( -1.0, 1.0, 128, NULL, TRUE ), this ),
|
||||
/* TODO: size, background? */
|
||||
ModelView( new graphModel( -1.0, 1.0, 128, NULL, true ), this ),
|
||||
m_graphStyle( _style )
|
||||
{
|
||||
m_mouseDown = false;
|
||||
m_graphColor = QColor( 0xFF, 0xAA, 0x00 );
|
||||
|
||||
resize( 132, 104 );
|
||||
setAcceptDrops( TRUE );
|
||||
setAcceptDrops( true );
|
||||
setCursor( Qt::CrossCursor );
|
||||
|
||||
graphModel * gModel = castModel<graphModel>();
|
||||
@@ -125,18 +120,18 @@ void graph::mouseMoveEvent ( QMouseEvent * _me )
|
||||
|
||||
if( diff >= 1 )
|
||||
{
|
||||
x = min( width() - 2, m_lastCursorX + 1);
|
||||
x = qMin( width() - 2, m_lastCursorX + 1);
|
||||
}
|
||||
else if( diff <= 1 )
|
||||
{
|
||||
x = max( 2, m_lastCursorX - 1 );
|
||||
x = qMax( 2, m_lastCursorX - 1 );
|
||||
}
|
||||
else
|
||||
{
|
||||
x = m_lastCursorX;
|
||||
}
|
||||
|
||||
y = max( 2, min( y, height()-3 ) );
|
||||
y = qMax( 2, qMin( y, height()-3 ) );
|
||||
|
||||
changeSampleAt( x, y );
|
||||
|
||||
@@ -237,7 +232,7 @@ void graph::paintEvent( QPaintEvent * )
|
||||
switch( m_graphStyle )
|
||||
{
|
||||
case graph::LinearStyle:
|
||||
p.setRenderHints( QPainter::Antialiasing, TRUE );
|
||||
p.setRenderHints( QPainter::Antialiasing, true );
|
||||
|
||||
for( int i=0; i < length; i++ )
|
||||
{
|
||||
@@ -255,7 +250,7 @@ void graph::paintEvent( QPaintEvent * )
|
||||
width()-2,
|
||||
2+static_cast<int>( ( (*samps)[0] - maxVal ) * yscale ) );
|
||||
|
||||
p.setRenderHints( QPainter::Antialiasing, FALSE );
|
||||
p.setRenderHints( QPainter::Antialiasing, false );
|
||||
break;
|
||||
|
||||
|
||||
@@ -314,7 +309,7 @@ void graph::dropEvent( QDropEvent * _de )
|
||||
void graph::dragEnterEvent( QDragEnterEvent * _dee )
|
||||
{
|
||||
if( stringPairDrag::processDragEnterEvent( _dee,
|
||||
QString( "samplefile" ) ) == FALSE )
|
||||
QString( "samplefile" ) ) == false )
|
||||
{
|
||||
_dee->ignore();
|
||||
}
|
||||
@@ -322,7 +317,7 @@ void graph::dragEnterEvent( QDragEnterEvent * _dee )
|
||||
|
||||
|
||||
|
||||
void graph::modelChanged( void )
|
||||
void graph::modelChanged()
|
||||
{
|
||||
graphModel * gModel = castModel<graphModel>();
|
||||
|
||||
@@ -341,15 +336,15 @@ void graph::updateGraph( int _startPos, int _endPos )
|
||||
}
|
||||
|
||||
|
||||
void graph::updateGraph( void )
|
||||
void graph::updateGraph()
|
||||
{
|
||||
updateGraph( 0, model()->length() - 1 );
|
||||
}
|
||||
|
||||
|
||||
graphModel::graphModel( float _min, float _max, int _length,
|
||||
::model * _parent, bool _default_constructed, float _step ) :
|
||||
model( _parent, tr( "Graph" ), _default_constructed ),
|
||||
::Model * _parent, bool _default_constructed, float _step ) :
|
||||
Model( _parent, tr( "Graph" ), _default_constructed ),
|
||||
m_samples( _length ),
|
||||
m_minValue( _min ),
|
||||
m_maxValue( _max ),
|
||||
@@ -424,11 +419,11 @@ void graphModel::setSamples( const float * _samples )
|
||||
|
||||
|
||||
|
||||
void graphModel::setWaveToSine( void )
|
||||
void graphModel::setWaveToSine()
|
||||
{
|
||||
for( int i = 0; i < length(); i++ )
|
||||
{
|
||||
m_samples[i] = oscillator::sinSample(
|
||||
m_samples[i] = Oscillator::sinSample(
|
||||
i / static_cast<float>( length() ) );
|
||||
}
|
||||
|
||||
@@ -437,11 +432,11 @@ void graphModel::setWaveToSine( void )
|
||||
|
||||
|
||||
|
||||
void graphModel::setWaveToTriangle( void )
|
||||
void graphModel::setWaveToTriangle()
|
||||
{
|
||||
for( int i = 0; i < length(); i++ )
|
||||
{
|
||||
m_samples[i] = oscillator::triangleSample(
|
||||
m_samples[i] = Oscillator::triangleSample(
|
||||
i / static_cast<float>( length() ) );
|
||||
}
|
||||
|
||||
@@ -450,11 +445,11 @@ void graphModel::setWaveToTriangle( void )
|
||||
|
||||
|
||||
|
||||
void graphModel::setWaveToSaw( void )
|
||||
void graphModel::setWaveToSaw()
|
||||
{
|
||||
for( int i = 0; i < length(); i++ )
|
||||
{
|
||||
m_samples[i] = oscillator::sawSample(
|
||||
m_samples[i] = Oscillator::sawSample(
|
||||
i / static_cast<float>( length() ) );
|
||||
}
|
||||
|
||||
@@ -463,11 +458,11 @@ void graphModel::setWaveToSaw( void )
|
||||
|
||||
|
||||
|
||||
void graphModel::setWaveToSquare( void )
|
||||
void graphModel::setWaveToSquare()
|
||||
{
|
||||
for( int i = 0; i < length(); i++ )
|
||||
{
|
||||
m_samples[i] = oscillator::squareSample(
|
||||
m_samples[i] = Oscillator::squareSample(
|
||||
i / static_cast<float>( length() ) );
|
||||
}
|
||||
|
||||
@@ -476,11 +471,11 @@ void graphModel::setWaveToSquare( void )
|
||||
|
||||
|
||||
|
||||
void graphModel::setWaveToNoise( void )
|
||||
void graphModel::setWaveToNoise()
|
||||
{
|
||||
for( int i = 0; i < length(); i++ )
|
||||
{
|
||||
m_samples[i] = oscillator::noiseSample(
|
||||
m_samples[i] = Oscillator::noiseSample(
|
||||
i / static_cast<float>( length() ) );
|
||||
}
|
||||
|
||||
@@ -489,7 +484,7 @@ void graphModel::setWaveToNoise( void )
|
||||
|
||||
|
||||
|
||||
void graphModel::smooth( void )
|
||||
void graphModel::smooth()
|
||||
{
|
||||
// store values in temporary array
|
||||
QVector<float> temp = m_samples;
|
||||
@@ -506,7 +501,7 @@ void graphModel::smooth( void )
|
||||
|
||||
|
||||
|
||||
void graphModel::normalize( void )
|
||||
void graphModel::normalize()
|
||||
{
|
||||
float max = 0.0001f;
|
||||
for( int i = 0; i < length(); i++ )
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* group_box.cpp - groupbox for LMMS
|
||||
*
|
||||
* Copyright (c) 2005-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
@@ -22,18 +22,15 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include <QtGui/QMouseEvent>
|
||||
#include <QtGui/QPainter>
|
||||
|
||||
|
||||
#ifndef __USE_XOPEN
|
||||
#define __USE_XOPEN
|
||||
#endif
|
||||
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#include "group_box.h"
|
||||
#include "embed.h"
|
||||
#include "gui_templates.h"
|
||||
@@ -42,19 +39,19 @@
|
||||
|
||||
groupBox::groupBox( const QString & _caption, QWidget * _parent ) :
|
||||
QWidget( _parent ),
|
||||
boolModelView( NULL, this ),
|
||||
BoolModelView( NULL, this ),
|
||||
m_caption( _caption )
|
||||
{
|
||||
updatePixmap();
|
||||
|
||||
m_led = new pixmapButton( this, _caption );
|
||||
m_led->setCheckable( TRUE );
|
||||
m_led->setCheckable( true );
|
||||
m_led->move( 3, 3 );
|
||||
m_led->setActiveGraphic( embed::getIconPixmap( "led_green" ) );
|
||||
m_led->setInactiveGraphic( embed::getIconPixmap( "led_off" ) );
|
||||
|
||||
setModel( new boolModel( FALSE, NULL, _caption, TRUE ) );
|
||||
setAutoFillBackground( TRUE );
|
||||
setModel( new BoolModel( false, NULL, _caption, true ) );
|
||||
setAutoFillBackground( true );
|
||||
unsetCursor();
|
||||
}
|
||||
|
||||
@@ -69,7 +66,7 @@ groupBox::~groupBox()
|
||||
|
||||
|
||||
|
||||
void groupBox::modelChanged( void )
|
||||
void groupBox::modelChanged()
|
||||
{
|
||||
m_led->setModel( model() );
|
||||
}
|
||||
@@ -96,7 +93,7 @@ void groupBox::resizeEvent( QResizeEvent * _ev )
|
||||
|
||||
|
||||
|
||||
void groupBox::updatePixmap( void )
|
||||
void groupBox::updatePixmap()
|
||||
{
|
||||
QColor bg_color = QApplication::palette().color( QPalette::Active,
|
||||
QPalette::Background );
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* knob.cpp - powerful knob-widget
|
||||
*
|
||||
* Copyright (c) 2004-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
@@ -22,9 +22,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "knob.h"
|
||||
|
||||
#include <QtGui/QApplication>
|
||||
#include <QtGui/QBitmap>
|
||||
#include <QtGui/QFontMetrics>
|
||||
@@ -38,15 +35,15 @@
|
||||
#endif
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#include "knob.h"
|
||||
#include "caption_menu.h"
|
||||
#include "config_mgr.h"
|
||||
#include "ControllerConnection.h"
|
||||
#include "embed.h"
|
||||
#include "engine.h"
|
||||
#include "gui_templates.h"
|
||||
#include "main_window.h"
|
||||
#include "project_journal.h"
|
||||
#include "MainWindow.h"
|
||||
#include "ProjectJournal.h"
|
||||
#include "song.h"
|
||||
#include "string_pair_drag.h"
|
||||
#include "templates.h"
|
||||
@@ -59,13 +56,13 @@ textFloat * knob::s_textFloat = NULL;
|
||||
|
||||
knob::knob( int _knob_num, QWidget * _parent, const QString & _name ) :
|
||||
QWidget( _parent ),
|
||||
floatModelView( new knobModel( 0, 0, 0, 1, NULL, _name, TRUE ), this ),
|
||||
FloatModelView( new FloatModel( 0, 0, 0, 1, NULL, _name, true ), this ),
|
||||
m_knobNum( _knob_num ),
|
||||
m_label( "" ),
|
||||
m_knobPixmap( NULL ),
|
||||
m_volumeKnob( FALSE ),
|
||||
m_volumeKnob( false ),
|
||||
m_mouseOffset( 0.0f ),
|
||||
m_buttonPressed( FALSE ),
|
||||
m_buttonPressed( false ),
|
||||
m_angle( -10 ),
|
||||
m_outerColor( NULL )
|
||||
{
|
||||
@@ -137,7 +134,7 @@ void knob::setTotalAngle( float _angle )
|
||||
|
||||
|
||||
|
||||
float knob::innerRadius( void ) const
|
||||
float knob::innerRadius() const
|
||||
{
|
||||
return m_innerRadius;
|
||||
}
|
||||
@@ -151,7 +148,7 @@ void knob::setInnerRadius( float _r )
|
||||
|
||||
|
||||
|
||||
float knob::outerRadius( void ) const
|
||||
float knob::outerRadius() const
|
||||
{
|
||||
return m_outerRadius;
|
||||
}
|
||||
@@ -165,14 +162,14 @@ void knob::setOuterRadius( float _r )
|
||||
|
||||
|
||||
|
||||
QPointF knob::centerPoint( void ) const
|
||||
QPointF knob::centerPoint() const
|
||||
{
|
||||
return m_centerPoint;
|
||||
}
|
||||
|
||||
|
||||
|
||||
float knob::centerPointX( void ) const
|
||||
float knob::centerPointX() const
|
||||
{
|
||||
return m_centerPoint.x();
|
||||
}
|
||||
@@ -186,7 +183,7 @@ void knob::setCenterPointX( float _c )
|
||||
|
||||
|
||||
|
||||
float knob::centerPointY( void ) const
|
||||
float knob::centerPointY() const
|
||||
{
|
||||
return m_centerPoint.y();
|
||||
}
|
||||
@@ -200,7 +197,7 @@ void knob::setCenterPointY( float _c )
|
||||
|
||||
|
||||
|
||||
float knob::lineWidth( void ) const
|
||||
float knob::lineWidth() const
|
||||
{
|
||||
return m_lineWidth;
|
||||
}
|
||||
@@ -214,7 +211,7 @@ void knob::setLineWidth( float _w )
|
||||
|
||||
|
||||
|
||||
QColor knob::outerColor( void ) const
|
||||
QColor knob::outerColor() const
|
||||
{
|
||||
if( m_outerColor )
|
||||
{
|
||||
@@ -255,7 +252,7 @@ QLineF knob::calculateLine( const QPointF & _mid, float _radius, float _innerRad
|
||||
|
||||
|
||||
|
||||
bool knob::updateAngle( void )
|
||||
bool knob::updateAngle()
|
||||
{
|
||||
int angle = 0;
|
||||
if( model() && model()->maxValue() != model()->minValue() )
|
||||
@@ -269,9 +266,9 @@ bool knob::updateAngle( void )
|
||||
if( qAbs( angle - m_angle ) > 3 )
|
||||
{
|
||||
m_angle = angle;
|
||||
return( TRUE );
|
||||
return true;
|
||||
}
|
||||
return( FALSE );
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -279,7 +276,7 @@ bool knob::updateAngle( void )
|
||||
|
||||
void knob::drawKnob( QPainter * _p )
|
||||
{
|
||||
if( updateAngle() == FALSE && !m_cache.isNull() )
|
||||
if( updateAngle() == false && !m_cache.isNull() )
|
||||
{
|
||||
_p->drawImage( 0, 0, m_cache );
|
||||
return;
|
||||
@@ -371,7 +368,7 @@ void knob::drawKnob( QPainter * _p )
|
||||
|
||||
float knob::getValue( const QPoint & _p )
|
||||
{
|
||||
if( engine::getMainWindow()->isShiftPressed() )
|
||||
if( engine::mainWindow()->isShiftPressed() )
|
||||
{
|
||||
return( ( _p.y() - m_origMousePos.y() ) * model()->step<float>() );
|
||||
}
|
||||
@@ -420,12 +417,12 @@ void knob::dropEvent( QDropEvent * _de )
|
||||
}
|
||||
else if( type == "automatable_model" )
|
||||
{
|
||||
automatableModel * mod = dynamic_cast<automatableModel *>(
|
||||
engine::getProjectJournal()->
|
||||
getJournallingObject( val.toInt() ) );
|
||||
AutomatableModel * mod = dynamic_cast<AutomatableModel *>(
|
||||
engine::projectJournal()->
|
||||
journallingObject( val.toInt() ) );
|
||||
if( mod != NULL )
|
||||
{
|
||||
automatableModel::linkModels( model(), mod );
|
||||
AutomatableModel::linkModels( model(), mod );
|
||||
mod->setValue( model()->value() );
|
||||
}
|
||||
}
|
||||
@@ -452,10 +449,10 @@ void knob::mousePressEvent( QMouseEvent * _me )
|
||||
s_textFloat->moveGlobal( this,
|
||||
QPoint( width() + 2, 0 ) );
|
||||
s_textFloat->show();
|
||||
m_buttonPressed = TRUE;
|
||||
m_buttonPressed = true;
|
||||
}
|
||||
else if( _me->button() == Qt::LeftButton &&
|
||||
engine::getMainWindow()->isShiftPressed() == TRUE )
|
||||
engine::mainWindow()->isShiftPressed() == true )
|
||||
{
|
||||
new stringPairDrag( "float_value",
|
||||
QString::number( model()->value() ),
|
||||
@@ -463,7 +460,7 @@ void knob::mousePressEvent( QMouseEvent * _me )
|
||||
}
|
||||
else
|
||||
{
|
||||
automatableModelView::mousePressEvent( _me );
|
||||
FloatModelView::mousePressEvent( _me );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -472,7 +469,7 @@ void knob::mousePressEvent( QMouseEvent * _me )
|
||||
|
||||
void knob::mouseMoveEvent( QMouseEvent * _me )
|
||||
{
|
||||
if( m_buttonPressed == TRUE && _me->pos() != m_origMousePos )
|
||||
if( m_buttonPressed == true && _me->pos() != m_origMousePos )
|
||||
{
|
||||
setPosition( _me->pos() );
|
||||
emit sliderMoved( model()->value() );
|
||||
@@ -489,7 +486,7 @@ void knob::mouseReleaseEvent( QMouseEvent * /* _me*/ )
|
||||
{
|
||||
model()->addJournalEntryFromOldToCurVal();
|
||||
|
||||
m_buttonPressed = FALSE;
|
||||
m_buttonPressed = false;
|
||||
|
||||
m_mouseOffset = 0;
|
||||
emit sliderReleased();
|
||||
@@ -567,7 +564,7 @@ void knob::setPosition( const QPoint & _p )
|
||||
|
||||
|
||||
|
||||
void knob::enterValue( void )
|
||||
void knob::enterValue()
|
||||
{
|
||||
bool ok;
|
||||
float new_val;
|
||||
@@ -611,11 +608,11 @@ void knob::enterValue( void )
|
||||
|
||||
|
||||
|
||||
void knob::friendlyUpdate( void )
|
||||
void knob::friendlyUpdate()
|
||||
{
|
||||
if( model()->getControllerConnection() == NULL ||
|
||||
model()->getControllerConnection()->getController()->
|
||||
frequentUpdates() == FALSE ||
|
||||
frequentUpdates() == false ||
|
||||
Controller::runningFrames() % (256*4) == 0 )
|
||||
{
|
||||
update();
|
||||
@@ -625,23 +622,23 @@ void knob::friendlyUpdate( void )
|
||||
|
||||
|
||||
|
||||
QString knob::displayValue( void ) const
|
||||
QString knob::displayValue() const
|
||||
{
|
||||
if( isVolumeKnob() &&
|
||||
configManager::inst()->value( "app", "displaydbv" ).toInt() )
|
||||
{
|
||||
return( m_description.trimmed() + QString( " %1 dBV" ).
|
||||
return m_description.trimmed() + QString( " %1 dBV" ).
|
||||
arg( 20.0 * log10( model()->value() / 100.0 ),
|
||||
3, 'f', 2 ) );
|
||||
3, 'f', 2 );
|
||||
}
|
||||
return( m_description.trimmed() + QString( " %1" ).
|
||||
arg( model()->value() ) + m_unit );
|
||||
return m_description.trimmed() + QString( " %1" ).
|
||||
arg( model()->value() ) + m_unit;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void knob::doConnections( void )
|
||||
void knob::doConnections()
|
||||
{
|
||||
if( model() != NULL )
|
||||
{
|
||||
@@ -656,7 +653,7 @@ void knob::doConnections( void )
|
||||
|
||||
|
||||
|
||||
void knob::displayHelp( void )
|
||||
void knob::displayHelp()
|
||||
{
|
||||
QWhatsThis::showText( mapToGlobal( rect().bottomRight() ),
|
||||
whatsThis() );
|
||||
|
||||
@@ -38,14 +38,14 @@
|
||||
#include "embed.h"
|
||||
#include "gui_templates.h"
|
||||
#include "templates.h"
|
||||
#include "main_window.h"
|
||||
#include "MainWindow.h"
|
||||
|
||||
|
||||
|
||||
lcdSpinBox::lcdSpinBox( int _num_digits, QWidget * _parent,
|
||||
const QString & _name ) :
|
||||
QWidget( _parent ),
|
||||
intModelView( new intModel( 0, 0, 0, NULL, _name, true ), this ),
|
||||
IntModelView( new IntModel( 0, 0, 0, NULL, _name, true ), this ),
|
||||
m_label(),
|
||||
m_numDigits( _num_digits ),
|
||||
m_origMousePos()
|
||||
@@ -70,7 +70,7 @@ lcdSpinBox::lcdSpinBox( int _num_digits, QWidget * _parent,
|
||||
lcdSpinBox::lcdSpinBox( int _num_digits, const QString & _lcd_style,
|
||||
QWidget * _parent, const QString & _name ) :
|
||||
QWidget( _parent ),
|
||||
intModelView( new intModel( 0, 0, 0, NULL, _name, true ), this ),
|
||||
IntModelView( new IntModel( 0, 0, 0, NULL, _name, true ), this ),
|
||||
m_label(),
|
||||
m_numDigits( _num_digits ),
|
||||
m_origMousePos()
|
||||
@@ -291,7 +291,7 @@ void lcdSpinBox::mousePressEvent( QMouseEvent * _me )
|
||||
}
|
||||
else
|
||||
{
|
||||
automatableModelView::mousePressEvent( _me );
|
||||
IntModelView::mousePressEvent( _me );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#include <QtGui/QPainter>
|
||||
|
||||
#include "pixmap_button.h"
|
||||
#include "main_window.h"
|
||||
#include "MainWindow.h"
|
||||
#include "embed.h"
|
||||
|
||||
|
||||
|
||||
@@ -39,13 +39,13 @@
|
||||
|
||||
#include "embed.h"
|
||||
#include "engine.h"
|
||||
#include "main_window.h"
|
||||
#include "MainWindow.h"
|
||||
#include "song.h"
|
||||
|
||||
|
||||
|
||||
projectNotes::projectNotes( void ) :
|
||||
QMainWindow( engine::getMainWindow()->workspace() )
|
||||
QMainWindow( engine::mainWindow()->workspace() )
|
||||
{
|
||||
m_edit = new QTextEdit( this );
|
||||
m_edit->setAutoFillBackground( TRUE );
|
||||
@@ -70,7 +70,7 @@ projectNotes::projectNotes( void ) :
|
||||
setWindowTitle( tr( "Project notes" ) );
|
||||
setWindowIcon( embed::getIconPixmap( "project_notes" ) );
|
||||
|
||||
engine::getMainWindow()->workspace()->addSubWindow( this );
|
||||
engine::mainWindow()->workspace()->addSubWindow( this );
|
||||
parentWidget()->setAttribute( Qt::WA_DeleteOnClose, false );
|
||||
parentWidget()->move( 700, 10 );
|
||||
parentWidget()->resize( 400, 300 );
|
||||
@@ -378,7 +378,7 @@ void projectNotes::alignmentChanged( int _a )
|
||||
|
||||
void projectNotes::saveSettings( QDomDocument & _doc, QDomElement & _this )
|
||||
{
|
||||
mainWindow::saveWidgetState( this, _this );
|
||||
MainWindow::saveWidgetState( this, _this );
|
||||
|
||||
QDomCDATASection ds = _doc.createCDATASection( m_edit->toHtml() );
|
||||
_this.appendChild( ds );
|
||||
@@ -389,7 +389,7 @@ void projectNotes::saveSettings( QDomDocument & _doc, QDomElement & _this )
|
||||
|
||||
void projectNotes::loadSettings( const QDomElement & _this )
|
||||
{
|
||||
mainWindow::restoreWidgetState( this, _this );
|
||||
MainWindow::restoreWidgetState( this, _this );
|
||||
m_edit->setHtml( _this.text() );
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* tempo_sync_knob.cpp - adds bpm to ms conversion for knob class
|
||||
* TempoSyncKnob.cpp - adds bpm to ms conversion for knob class
|
||||
*
|
||||
* Copyright (c) 2005-2007 Danny McRae <khjklujn/at/yahoo.com>
|
||||
* 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
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
@@ -24,191 +24,19 @@
|
||||
*/
|
||||
|
||||
|
||||
#include <cstdio>
|
||||
|
||||
#include "tempo_sync_knob.h"
|
||||
|
||||
#include <QtGui/QMouseEvent>
|
||||
#include <QtGui/QMdiArea>
|
||||
#include <QtXml/QDomElement>
|
||||
|
||||
#include "TempoSyncKnob.h"
|
||||
#include "engine.h"
|
||||
#include "caption_menu.h"
|
||||
#include "embed.h"
|
||||
#include "main_window.h"
|
||||
#include "meter_dialog.h"
|
||||
#include "MainWindow.h"
|
||||
#include "MeterDialog.h"
|
||||
#include "song.h"
|
||||
|
||||
|
||||
tempoSyncKnobModel::tempoSyncKnobModel( const float _val, const float _min,
|
||||
const float _max, const float _step,
|
||||
const float _scale, ::model * _parent,
|
||||
const QString & _display_name ) :
|
||||
knobModel( _val, _min, _max, _step, _parent, _display_name ),
|
||||
m_tempoSyncMode( SyncNone ),
|
||||
m_tempoLastSyncMode( SyncNone ),
|
||||
m_scale( _scale ),
|
||||
m_custom( _parent )
|
||||
{
|
||||
connect( engine::getSong(), SIGNAL( tempoChanged( bpm_t ) ),
|
||||
this, SLOT( calculateTempoSyncTime( bpm_t ) ) );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
tempoSyncKnobModel::~tempoSyncKnobModel()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void tempoSyncKnobModel::setTempoSync( QAction * _item )
|
||||
{
|
||||
setTempoSync( _item->data().toInt() );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void tempoSyncKnobModel::setTempoSync( int _note_type )
|
||||
{
|
||||
setSyncMode( ( tempoSyncMode ) _note_type );
|
||||
engine::getSong()->setModified();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void tempoSyncKnobModel::calculateTempoSyncTime( bpm_t _bpm )
|
||||
{
|
||||
float conversionFactor = 1.0;
|
||||
|
||||
if( m_tempoSyncMode )
|
||||
{
|
||||
switch( m_tempoSyncMode )
|
||||
{
|
||||
case SyncCustom:
|
||||
conversionFactor =
|
||||
static_cast<float>( m_custom.getDenominator() ) /
|
||||
static_cast<float>( m_custom.getNumerator() );
|
||||
break;
|
||||
case SyncDoubleWholeNote:
|
||||
conversionFactor = 0.125;
|
||||
break;
|
||||
case SyncWholeNote:
|
||||
conversionFactor = 0.25;
|
||||
break;
|
||||
case SyncHalfNote:
|
||||
conversionFactor = 0.5;
|
||||
break;
|
||||
case SyncQuarterNote:
|
||||
conversionFactor = 1.0;
|
||||
break;
|
||||
case SyncEighthNote:
|
||||
conversionFactor = 2.0;
|
||||
break;
|
||||
case SyncSixteenthNote:
|
||||
conversionFactor = 4.0;
|
||||
break;
|
||||
case SyncThirtysecondNote:
|
||||
conversionFactor = 8.0;
|
||||
break;
|
||||
default: ;
|
||||
}
|
||||
bool journalling = testAndSetJournalling( FALSE );
|
||||
float oneUnit = 60000.0 / ( _bpm * conversionFactor * m_scale );
|
||||
setValue( oneUnit * maxValue() );
|
||||
setJournalling( journalling );
|
||||
}
|
||||
|
||||
if( m_tempoSyncMode != m_tempoLastSyncMode )
|
||||
{
|
||||
emit syncModeChanged( m_tempoSyncMode );
|
||||
m_tempoLastSyncMode = m_tempoSyncMode;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void tempoSyncKnobModel::saveSettings( QDomDocument & _doc, QDomElement & _this,
|
||||
const QString & _name )
|
||||
{
|
||||
_this.setAttribute( "syncmode", ( int ) getSyncMode() );
|
||||
m_custom.saveSettings( _doc, _this, _name );
|
||||
knobModel::saveSettings( _doc, _this, _name );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void tempoSyncKnobModel::loadSettings( const QDomElement & _this,
|
||||
const QString & _name )
|
||||
{
|
||||
setSyncMode( ( tempoSyncMode ) _this.attribute( "syncmode" ).toInt() );
|
||||
m_custom.loadSettings( _this, _name );
|
||||
knobModel::loadSettings( _this, _name );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
tempoSyncKnobModel::tempoSyncMode tempoSyncKnobModel::getSyncMode( void )
|
||||
{
|
||||
return( m_tempoSyncMode );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void tempoSyncKnobModel::setSyncMode( tempoSyncMode _new_mode )
|
||||
{
|
||||
if( m_tempoSyncMode != _new_mode )
|
||||
{
|
||||
m_tempoSyncMode = _new_mode;
|
||||
if( _new_mode == SyncCustom )
|
||||
{
|
||||
connect( &m_custom, SIGNAL( dataChanged() ),
|
||||
this, SLOT( updateCustom() ) );
|
||||
}
|
||||
}
|
||||
calculateTempoSyncTime( engine::getSong()->getTempo() );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
float tempoSyncKnobModel::getScale( void )
|
||||
{
|
||||
return( m_scale );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void tempoSyncKnobModel::setScale( float _new_scale )
|
||||
{
|
||||
m_scale = _new_scale;
|
||||
calculateTempoSyncTime( engine::getSong()->getTempo() );
|
||||
emit scaleChanged( _new_scale );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void tempoSyncKnobModel::updateCustom( void )
|
||||
{
|
||||
setSyncMode( SyncCustom );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
tempoSyncKnob::tempoSyncKnob( int _knob_num, QWidget * _parent,
|
||||
TempoSyncKnob::TempoSyncKnob( int _knob_num, QWidget * _parent,
|
||||
const QString & _name ) :
|
||||
knob( _knob_num, _parent, _name ),
|
||||
m_tempoSyncIcon( embed::getIconPixmap( "tempo_sync" ) ),
|
||||
@@ -220,7 +48,7 @@ tempoSyncKnob::tempoSyncKnob( int _knob_num, QWidget * _parent,
|
||||
|
||||
|
||||
|
||||
tempoSyncKnob::~tempoSyncKnob()
|
||||
TempoSyncKnob::~TempoSyncKnob()
|
||||
{
|
||||
if( m_custom )
|
||||
{
|
||||
@@ -231,17 +59,17 @@ tempoSyncKnob::~tempoSyncKnob()
|
||||
|
||||
|
||||
|
||||
void tempoSyncKnob::modelChanged( void )
|
||||
void TempoSyncKnob::modelChanged()
|
||||
{
|
||||
if( model() == NULL )
|
||||
{
|
||||
printf( "no tempoSyncKnobModel has been set!\n" );
|
||||
qWarning( "no TempoSyncKnobModel has been set!" );
|
||||
}
|
||||
if( m_custom != NULL )
|
||||
{
|
||||
m_custom->setModel( &model()->m_custom );
|
||||
}
|
||||
connect( model(), SIGNAL( syncModeChanged( tempoSyncMode ) ),
|
||||
connect( model(), SIGNAL( syncModeChanged( TempoSyncMode ) ),
|
||||
this, SLOT( updateDescAndIcon() ) );
|
||||
connect( this, SIGNAL( sliderMoved( float ) ),
|
||||
model(), SLOT( disableSync() ) );
|
||||
@@ -251,7 +79,7 @@ void tempoSyncKnob::modelChanged( void )
|
||||
|
||||
|
||||
|
||||
void tempoSyncKnob::contextMenuEvent( QContextMenuEvent * )
|
||||
void TempoSyncKnob::contextMenuEvent( QContextMenuEvent * )
|
||||
{
|
||||
mouseReleaseEvent( NULL );
|
||||
|
||||
@@ -270,51 +98,51 @@ void tempoSyncKnob::contextMenuEvent( QContextMenuEvent * )
|
||||
connect( syncMenu, SIGNAL( triggered( QAction * ) ),
|
||||
model(), SLOT( setTempoSync( QAction * ) ) );
|
||||
syncMenu->addAction( embed::getIconPixmap( "note_none" ),
|
||||
tr( "No Sync" ) )->setData( (int) tempoSyncKnobModel::SyncNone );
|
||||
tr( "No Sync" ) )->setData( (int) TempoSyncKnobModel::SyncNone );
|
||||
if( limit / 0.125f <= model()->maxValue() )
|
||||
{
|
||||
syncMenu->addAction( embed::getIconPixmap( "note_double_whole" ),
|
||||
tr( "Eight beats" ) )->setData(
|
||||
(int) tempoSyncKnobModel::SyncDoubleWholeNote );
|
||||
(int) TempoSyncKnobModel::SyncDoubleWholeNote );
|
||||
}
|
||||
if( limit / 0.25f <= model()->maxValue() )
|
||||
{
|
||||
syncMenu->addAction( embed::getIconPixmap( "note_whole" ),
|
||||
tr( "Whole note" ) )->setData(
|
||||
(int) tempoSyncKnobModel::SyncWholeNote );
|
||||
(int) TempoSyncKnobModel::SyncWholeNote );
|
||||
}
|
||||
if( limit / 0.5f <= model()->maxValue() )
|
||||
{
|
||||
syncMenu->addAction( embed::getIconPixmap( "note_half" ),
|
||||
tr( "Half note" ) )->setData(
|
||||
(int) tempoSyncKnobModel::SyncHalfNote );
|
||||
(int) TempoSyncKnobModel::SyncHalfNote );
|
||||
}
|
||||
if( limit <= model()->maxValue() )
|
||||
{
|
||||
syncMenu->addAction( embed::getIconPixmap( "note_quarter" ),
|
||||
tr( "Quarter note" ) )->setData(
|
||||
(int) tempoSyncKnobModel::SyncQuarterNote );
|
||||
(int) TempoSyncKnobModel::SyncQuarterNote );
|
||||
}
|
||||
if( limit / 2.0f <= model()->maxValue() )
|
||||
{
|
||||
syncMenu->addAction( embed::getIconPixmap( "note_eighth" ),
|
||||
tr( "8th note" ) )->setData(
|
||||
(int) tempoSyncKnobModel::SyncEighthNote );
|
||||
(int) TempoSyncKnobModel::SyncEighthNote );
|
||||
}
|
||||
if( limit / 4.0f <= model()->maxValue() )
|
||||
{
|
||||
syncMenu->addAction( embed::getIconPixmap( "note_sixteenth" ),
|
||||
tr( "16th note" ) )->setData(
|
||||
(int) tempoSyncKnobModel::SyncSixteenthNote );
|
||||
(int) TempoSyncKnobModel::SyncSixteenthNote );
|
||||
}
|
||||
syncMenu->addAction( embed::getIconPixmap( "note_thirtysecond" ),
|
||||
tr( "32nd note" ) )->setData(
|
||||
(int) tempoSyncKnobModel::SyncThirtysecondNote );
|
||||
(int) TempoSyncKnobModel::SyncThirtysecondNote );
|
||||
syncMenu->addAction( embed::getIconPixmap( "dont_know" ),
|
||||
tr( "Custom..." ),
|
||||
this, SLOT( showCustom( void ) )
|
||||
this, SLOT( showCustom() )
|
||||
)->setData(
|
||||
(int) tempoSyncKnobModel::SyncCustom );
|
||||
(int) TempoSyncKnobModel::SyncCustom );
|
||||
contextMenu.addSeparator();
|
||||
|
||||
}
|
||||
@@ -330,45 +158,45 @@ void tempoSyncKnob::contextMenuEvent( QContextMenuEvent * )
|
||||
|
||||
|
||||
|
||||
void tempoSyncKnob::updateDescAndIcon( void )
|
||||
void TempoSyncKnob::updateDescAndIcon()
|
||||
{
|
||||
if( model()->m_tempoSyncMode )
|
||||
{
|
||||
switch( model()->m_tempoSyncMode )
|
||||
{
|
||||
case tempoSyncKnobModel::SyncCustom:
|
||||
case TempoSyncKnobModel::SyncCustom:
|
||||
m_tempoSyncDescription = tr( "Custom " ) +
|
||||
"(" +
|
||||
QString::number( model()->m_custom.getNumerator() ) +
|
||||
QString::number( model()->m_custom.numeratorModel().value() ) +
|
||||
"/" +
|
||||
QString::number( model()->m_custom.getDenominator() ) +
|
||||
QString::number( model()->m_custom.denominatorModel().value() ) +
|
||||
")";
|
||||
break;
|
||||
case tempoSyncKnobModel::SyncDoubleWholeNote:
|
||||
case TempoSyncKnobModel::SyncDoubleWholeNote:
|
||||
m_tempoSyncDescription = tr(
|
||||
"Synced to Eight Beats" );
|
||||
break;
|
||||
case tempoSyncKnobModel::SyncWholeNote:
|
||||
case TempoSyncKnobModel::SyncWholeNote:
|
||||
m_tempoSyncDescription = tr(
|
||||
"Synced to Whole Note" );
|
||||
break;
|
||||
case tempoSyncKnobModel::SyncHalfNote:
|
||||
case TempoSyncKnobModel::SyncHalfNote:
|
||||
m_tempoSyncDescription = tr(
|
||||
"Synced to Half Note" );
|
||||
break;
|
||||
case tempoSyncKnobModel::SyncQuarterNote:
|
||||
case TempoSyncKnobModel::SyncQuarterNote:
|
||||
m_tempoSyncDescription = tr(
|
||||
"Synced to Quarter Note" );
|
||||
break;
|
||||
case tempoSyncKnobModel::SyncEighthNote:
|
||||
case TempoSyncKnobModel::SyncEighthNote:
|
||||
m_tempoSyncDescription = tr(
|
||||
"Synced to 8th Note" );
|
||||
break;
|
||||
case tempoSyncKnobModel::SyncSixteenthNote:
|
||||
case TempoSyncKnobModel::SyncSixteenthNote:
|
||||
m_tempoSyncDescription = tr(
|
||||
"Synced to 16th Note" );
|
||||
break;
|
||||
case tempoSyncKnobModel::SyncThirtysecondNote:
|
||||
case TempoSyncKnobModel::SyncThirtysecondNote:
|
||||
m_tempoSyncDescription = tr(
|
||||
"Synced to 32nd Note" );
|
||||
break;
|
||||
@@ -380,52 +208,43 @@ void tempoSyncKnob::updateDescAndIcon( void )
|
||||
m_tempoSyncDescription = tr( "Tempo Sync" );
|
||||
}
|
||||
if( m_custom != NULL &&
|
||||
model()->m_tempoSyncMode != tempoSyncKnobModel::SyncCustom )
|
||||
model()->m_tempoSyncMode != TempoSyncKnobModel::SyncCustom )
|
||||
{
|
||||
m_custom->parentWidget()->hide();
|
||||
}
|
||||
|
||||
switch( model()->m_tempoSyncMode )
|
||||
{
|
||||
case tempoSyncKnobModel::SyncNone:
|
||||
m_tempoSyncIcon = embed::getIconPixmap(
|
||||
"tempo_sync" );
|
||||
case TempoSyncKnobModel::SyncNone:
|
||||
m_tempoSyncIcon = embed::getIconPixmap( "tempo_sync" );
|
||||
break;
|
||||
case tempoSyncKnobModel::SyncCustom:
|
||||
m_tempoSyncIcon = embed::getIconPixmap(
|
||||
"dont_know" );
|
||||
case TempoSyncKnobModel::SyncCustom:
|
||||
m_tempoSyncIcon = embed::getIconPixmap( "dont_know" );
|
||||
break;
|
||||
case tempoSyncKnobModel::SyncDoubleWholeNote:
|
||||
m_tempoSyncIcon = embed::getIconPixmap(
|
||||
"note_double_whole" );
|
||||
case TempoSyncKnobModel::SyncDoubleWholeNote:
|
||||
m_tempoSyncIcon = embed::getIconPixmap( "note_double_whole" );
|
||||
break;
|
||||
case tempoSyncKnobModel::SyncWholeNote:
|
||||
m_tempoSyncIcon = embed::getIconPixmap(
|
||||
"note_whole" );
|
||||
case TempoSyncKnobModel::SyncWholeNote:
|
||||
m_tempoSyncIcon = embed::getIconPixmap( "note_whole" );
|
||||
break;
|
||||
case tempoSyncKnobModel::SyncHalfNote:
|
||||
m_tempoSyncIcon = embed::getIconPixmap(
|
||||
"note_half" );
|
||||
case TempoSyncKnobModel::SyncHalfNote:
|
||||
m_tempoSyncIcon = embed::getIconPixmap( "note_half" );
|
||||
break;
|
||||
case tempoSyncKnobModel::SyncQuarterNote:
|
||||
m_tempoSyncIcon = embed::getIconPixmap(
|
||||
"note_quarter" );
|
||||
case TempoSyncKnobModel::SyncQuarterNote:
|
||||
m_tempoSyncIcon = embed::getIconPixmap( "note_quarter" );
|
||||
break;
|
||||
case tempoSyncKnobModel::SyncEighthNote:
|
||||
m_tempoSyncIcon = embed::getIconPixmap(
|
||||
"note_eighth" );
|
||||
case TempoSyncKnobModel::SyncEighthNote:
|
||||
m_tempoSyncIcon = embed::getIconPixmap( "note_eighth" );
|
||||
break;
|
||||
case tempoSyncKnobModel::SyncSixteenthNote:
|
||||
m_tempoSyncIcon = embed::getIconPixmap(
|
||||
"note_sixteenth" );
|
||||
case TempoSyncKnobModel::SyncSixteenthNote:
|
||||
m_tempoSyncIcon = embed::getIconPixmap( "note_sixteenth" );
|
||||
break;
|
||||
case tempoSyncKnobModel::SyncThirtysecondNote:
|
||||
m_tempoSyncIcon = embed::getIconPixmap(
|
||||
"note_thirtysecond" );
|
||||
case TempoSyncKnobModel::SyncThirtysecondNote:
|
||||
m_tempoSyncIcon = embed::getIconPixmap( "note_thirtysecond" );
|
||||
break;
|
||||
default:
|
||||
printf( "tempoSyncKnob::calculateTempoSyncTime"
|
||||
": invalid tempoSyncMode" );
|
||||
qWarning( "TempoSyncKnob::calculateTempoSyncTime:"
|
||||
"invalid TempoSyncMode" );
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -436,15 +255,15 @@ void tempoSyncKnob::updateDescAndIcon( void )
|
||||
|
||||
|
||||
|
||||
const QString & tempoSyncKnob::getSyncDescription( void )
|
||||
const QString & TempoSyncKnob::syncDescription()
|
||||
{
|
||||
return( m_tempoSyncDescription );
|
||||
return m_tempoSyncDescription;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void tempoSyncKnob::setSyncDescription( const QString & _new_description )
|
||||
void TempoSyncKnob::setSyncDescription( const QString & _new_description )
|
||||
{
|
||||
m_tempoSyncDescription = _new_description;
|
||||
emit syncDescriptionChanged( _new_description );
|
||||
@@ -453,15 +272,15 @@ void tempoSyncKnob::setSyncDescription( const QString & _new_description )
|
||||
|
||||
|
||||
|
||||
const QPixmap & tempoSyncKnob::getSyncIcon( void )
|
||||
const QPixmap & TempoSyncKnob::syncIcon()
|
||||
{
|
||||
return( m_tempoSyncIcon );
|
||||
return m_tempoSyncIcon;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void tempoSyncKnob::setSyncIcon( const QPixmap & _new_icon )
|
||||
void TempoSyncKnob::setSyncIcon( const QPixmap & _new_icon )
|
||||
{
|
||||
m_tempoSyncIcon = _new_icon;
|
||||
emit syncIconChanged();
|
||||
@@ -470,22 +289,21 @@ void tempoSyncKnob::setSyncIcon( const QPixmap & _new_icon )
|
||||
|
||||
|
||||
|
||||
void tempoSyncKnob::showCustom( void )
|
||||
void TempoSyncKnob::showCustom()
|
||||
{
|
||||
if( m_custom == NULL )
|
||||
{
|
||||
m_custom = new meterDialog(
|
||||
engine::getMainWindow()->workspace() );
|
||||
engine::getMainWindow()->workspace()->addSubWindow( m_custom );
|
||||
m_custom = new MeterDialog( engine::mainWindow()->workspace() );
|
||||
engine::mainWindow()->workspace()->addSubWindow( m_custom );
|
||||
m_custom->setWindowTitle( "Meter" );
|
||||
m_custom->setModel( &model()->m_custom );
|
||||
}
|
||||
m_custom->parentWidget()->show();
|
||||
model()->setTempoSync( tempoSyncKnobModel::SyncCustom );
|
||||
model()->setTempoSync( TempoSyncKnobModel::SyncCustom );
|
||||
}
|
||||
|
||||
|
||||
|
||||
#include "moc_tempo_sync_knob.cxx"
|
||||
#include "moc_TempoSyncKnob.cxx"
|
||||
|
||||
|
||||
|
||||
@@ -28,13 +28,13 @@
|
||||
|
||||
#include "text_float.h"
|
||||
#include "gui_templates.h"
|
||||
#include "main_window.h"
|
||||
#include "MainWindow.h"
|
||||
#include "engine.h"
|
||||
|
||||
|
||||
|
||||
textFloat::textFloat( void ) :
|
||||
QWidget( engine::getMainWindow(), Qt::ToolTip ),
|
||||
QWidget( engine::mainWindow(), Qt::ToolTip ),
|
||||
m_title( "" ),
|
||||
m_text( "" ),
|
||||
m_pixmap()
|
||||
@@ -87,7 +87,7 @@ void textFloat::setVisibilityTimeOut( int _msecs )
|
||||
textFloat * textFloat::displayMessage( const QString & _msg, int _timeout,
|
||||
QWidget * _parent, int _add_y_margin )
|
||||
{
|
||||
QWidget * mw = engine::getMainWindow();
|
||||
QWidget * mw = engine::mainWindow();
|
||||
textFloat * tf = new textFloat;
|
||||
if( _parent != NULL )
|
||||
{
|
||||
|
||||
@@ -31,8 +31,8 @@
|
||||
#include "track_label_button.h"
|
||||
#include "embed.h"
|
||||
#include "rename_dialog.h"
|
||||
#include "instrument_track.h"
|
||||
#include "instrument.h"
|
||||
#include "InstrumentTrack.h"
|
||||
#include "Instrument.h"
|
||||
#include "config_mgr.h"
|
||||
#include "engine.h"
|
||||
|
||||
@@ -123,13 +123,13 @@ void trackLabelButton::paintEvent( QPaintEvent * _pe )
|
||||
{
|
||||
if( m_trackView->getTrack()->type() == track::InstrumentTrack )
|
||||
{
|
||||
instrumentTrack * it =
|
||||
dynamic_cast<instrumentTrack *>(
|
||||
InstrumentTrack * it =
|
||||
dynamic_cast<InstrumentTrack *>(
|
||||
m_trackView->getTrack() );
|
||||
const pixmapLoader * pl;
|
||||
if( it && it->getInstrument() &&
|
||||
it->getInstrument()->getDescriptor() &&
|
||||
( pl = it->getInstrument()->getDescriptor()->logo ) )
|
||||
const PixmapLoader * pl;
|
||||
if( it && it->instrument() &&
|
||||
it->instrument()->descriptor() &&
|
||||
( pl = it->instrument()->descriptor()->logo ) )
|
||||
{
|
||||
if( pl->pixmapName() != m_iconName )
|
||||
{
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
#include "visualization_widget.h"
|
||||
#include "gui_templates.h"
|
||||
#include "main_window.h"
|
||||
#include "MainWindow.h"
|
||||
#include "embed.h"
|
||||
#include "engine.h"
|
||||
#include "tooltip.h"
|
||||
@@ -88,7 +88,7 @@ void visualizationWidget::setActive( bool _active )
|
||||
m_active = _active;
|
||||
if( m_active )
|
||||
{
|
||||
connect( engine::getMainWindow(),
|
||||
connect( engine::mainWindow(),
|
||||
SIGNAL( periodicUpdate() ),
|
||||
this, SLOT( update() ) );
|
||||
connect( engine::getMixer(),
|
||||
@@ -97,7 +97,7 @@ void visualizationWidget::setActive( bool _active )
|
||||
}
|
||||
else
|
||||
{
|
||||
disconnect( engine::getMainWindow(),
|
||||
disconnect( engine::mainWindow(),
|
||||
SIGNAL( periodicUpdate() ),
|
||||
this, SLOT( update() ) );
|
||||
disconnect( engine::getMixer(),
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* instrument_track.cpp - implementation of instrument-track-class
|
||||
* InstrumentTrack.cpp - implementation of instrument-track-class
|
||||
* (window + data-structures)
|
||||
*
|
||||
* Copyright (c) 2004-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
@@ -38,35 +38,36 @@
|
||||
#include <QtGui/QMdiSubWindow>
|
||||
#include <QtGui/QPainter>
|
||||
|
||||
#include "instrument_track.h"
|
||||
#include "InstrumentTrack.h"
|
||||
#include "AudioPort.h"
|
||||
#include "automation_pattern.h"
|
||||
#include "bb_track.h"
|
||||
#include "config_mgr.h"
|
||||
#include "debug.h"
|
||||
#include "effect_chain.h"
|
||||
#include "effect_rack_view.h"
|
||||
#include "EffectChain.h"
|
||||
#include "EffectRackView.h"
|
||||
#include "embed.h"
|
||||
#include "engine.h"
|
||||
#include "file_browser.h"
|
||||
#include "fx_mixer.h"
|
||||
#include "fx_mixer_view.h"
|
||||
#include "instrument_sound_shaping.h"
|
||||
#include "instrument_sound_shaping_view.h"
|
||||
#include "FxMixer.h"
|
||||
#include "FxMixerView.h"
|
||||
#include "InstrumentSoundShaping.h"
|
||||
#include "InstrumentSoundShapingView.h"
|
||||
#include "fade_button.h"
|
||||
#include "gui_templates.h"
|
||||
#include "instrument.h"
|
||||
#include "instrument_function_views.h"
|
||||
#include "instrument_midi_io_view.h"
|
||||
#include "Instrument.h"
|
||||
#include "InstrumentFunctionViews.h"
|
||||
#include "InstrumentMidiIOView.h"
|
||||
#include "knob.h"
|
||||
#include "lcd_spinbox.h"
|
||||
#include "led_checkbox.h"
|
||||
#include "main_window.h"
|
||||
#include "MainWindow.h"
|
||||
#include "MidiClient.h"
|
||||
#include "MidiPortMenu.h"
|
||||
#include "mmp.h"
|
||||
#include "note_play_handle.h"
|
||||
#include "pattern.h"
|
||||
#include "plugin_view.h"
|
||||
#include "PluginView.h"
|
||||
#include "sample_play_handle.h"
|
||||
#include "song.h"
|
||||
#include "string_pair_drag.h"
|
||||
@@ -77,7 +78,7 @@
|
||||
|
||||
|
||||
|
||||
const char * volume_help = QT_TRANSLATE_NOOP( "instrumentTrack",
|
||||
const char * volume_help = QT_TRANSLATE_NOOP( "InstrumentTrack",
|
||||
"With this knob you can set "
|
||||
"the volume of the opened "
|
||||
"channel.");
|
||||
@@ -89,8 +90,8 @@ const int INSTRUMENT_WINDOW_CACHE_SIZE = 8;
|
||||
|
||||
|
||||
// #### IT:
|
||||
instrumentTrack::instrumentTrack( trackContainer * _tc ) :
|
||||
track( InstrumentTrack, _tc ),
|
||||
InstrumentTrack::InstrumentTrack( trackContainer * _tc ) :
|
||||
track( track::InstrumentTrack, _tc ),
|
||||
MidiEventProcessor(),
|
||||
m_audioPort( tr( "unnamed_track" ) ),
|
||||
m_midiPort( tr( "unnamed_track" ), engine::getMixer()->midiClient(),
|
||||
@@ -131,7 +132,7 @@ instrumentTrack::instrumentTrack( trackContainer * _tc ) :
|
||||
|
||||
|
||||
|
||||
instrumentTrack::~instrumentTrack()
|
||||
InstrumentTrack::~InstrumentTrack()
|
||||
{
|
||||
// kill all running notes
|
||||
silenceAllNotes();
|
||||
@@ -143,11 +144,11 @@ instrumentTrack::~instrumentTrack()
|
||||
|
||||
|
||||
|
||||
void instrumentTrack::processAudioBuffer( sampleFrame * _buf,
|
||||
void InstrumentTrack::processAudioBuffer( sampleFrame * _buf,
|
||||
const fpp_t _frames,
|
||||
notePlayHandle * _n )
|
||||
{
|
||||
// we must not play the sound if this instrumentTrack is muted...
|
||||
// we must not play the sound if this InstrumentTrack is muted...
|
||||
if( isMuted() || ( _n && _n->bbTrackMuted() ) )
|
||||
{
|
||||
return;
|
||||
@@ -155,7 +156,7 @@ void instrumentTrack::processAudioBuffer( sampleFrame * _buf,
|
||||
|
||||
// if effects "went to sleep" because there was no input, wake them up
|
||||
// now
|
||||
m_audioPort.getEffects()->startRunning();
|
||||
m_audioPort.effects()->startRunning();
|
||||
|
||||
float v_scale = (float) getVolume() / DefaultVolume;
|
||||
|
||||
@@ -195,7 +196,7 @@ void instrumentTrack::processAudioBuffer( sampleFrame * _buf,
|
||||
|
||||
|
||||
|
||||
midiEvent instrumentTrack::applyMasterKey( const midiEvent & _me )
|
||||
midiEvent InstrumentTrack::applyMasterKey( const midiEvent & _me )
|
||||
{
|
||||
midiEvent copy( _me );
|
||||
switch( _me.m_type )
|
||||
@@ -214,7 +215,7 @@ midiEvent instrumentTrack::applyMasterKey( const midiEvent & _me )
|
||||
|
||||
|
||||
|
||||
void instrumentTrack::processInEvent( const midiEvent & _me,
|
||||
void InstrumentTrack::processInEvent( const midiEvent & _me,
|
||||
const midiTime & _time )
|
||||
{
|
||||
engine::getMixer()->lock();
|
||||
@@ -337,7 +338,7 @@ void instrumentTrack::processInEvent( const midiEvent & _me,
|
||||
|
||||
|
||||
|
||||
void instrumentTrack::processOutEvent( const midiEvent & _me,
|
||||
void InstrumentTrack::processOutEvent( const midiEvent & _me,
|
||||
const midiTime & _time )
|
||||
{
|
||||
int k;
|
||||
@@ -407,7 +408,7 @@ void instrumentTrack::processOutEvent( const midiEvent & _me,
|
||||
|
||||
|
||||
|
||||
void instrumentTrack::silenceAllNotes()
|
||||
void InstrumentTrack::silenceAllNotes()
|
||||
{
|
||||
engine::getMixer()->lock();
|
||||
for( int i = 0; i < NumKeys; ++i )
|
||||
@@ -425,7 +426,7 @@ void instrumentTrack::silenceAllNotes()
|
||||
|
||||
|
||||
|
||||
f_cnt_t instrumentTrack::beatLen( notePlayHandle * _n ) const
|
||||
f_cnt_t InstrumentTrack::beatLen( notePlayHandle * _n ) const
|
||||
{
|
||||
if( m_instrument != NULL )
|
||||
{
|
||||
@@ -441,7 +442,7 @@ f_cnt_t instrumentTrack::beatLen( notePlayHandle * _n ) const
|
||||
|
||||
|
||||
|
||||
void instrumentTrack::playNote( notePlayHandle * _n,
|
||||
void InstrumentTrack::playNote( notePlayHandle * _n,
|
||||
sampleFrame * _working_buffer )
|
||||
{
|
||||
// arpeggio- and chord-widget has to do its work -> adding sub-notes
|
||||
@@ -459,7 +460,7 @@ void instrumentTrack::playNote( notePlayHandle * _n,
|
||||
|
||||
|
||||
|
||||
QString instrumentTrack::instrumentName( void ) const
|
||||
QString InstrumentTrack::instrumentName() const
|
||||
{
|
||||
if( m_instrument != NULL )
|
||||
{
|
||||
@@ -471,7 +472,7 @@ QString instrumentTrack::instrumentName( void ) const
|
||||
|
||||
|
||||
|
||||
void instrumentTrack::deleteNotePluginData( notePlayHandle * _n )
|
||||
void InstrumentTrack::deleteNotePluginData( notePlayHandle * _n )
|
||||
{
|
||||
if( m_instrument != NULL )
|
||||
{
|
||||
@@ -495,7 +496,7 @@ void instrumentTrack::deleteNotePluginData( notePlayHandle * _n )
|
||||
|
||||
|
||||
|
||||
void instrumentTrack::setName( const QString & _new_name )
|
||||
void InstrumentTrack::setName( const QString & _new_name )
|
||||
{
|
||||
// when changing name of track, also change name of those patterns,
|
||||
// which have the same name as the instrument-track
|
||||
@@ -520,7 +521,7 @@ void instrumentTrack::setName( const QString & _new_name )
|
||||
|
||||
|
||||
|
||||
void instrumentTrack::updateBaseNote( void )
|
||||
void InstrumentTrack::updateBaseNote()
|
||||
{
|
||||
engine::getMixer()->lock();
|
||||
for( NotePlayHandleList::Iterator it = m_processHandles.begin();
|
||||
@@ -534,7 +535,7 @@ void instrumentTrack::updateBaseNote( void )
|
||||
|
||||
|
||||
|
||||
void instrumentTrack::updatePitch( void )
|
||||
void InstrumentTrack::updatePitch()
|
||||
{
|
||||
updateBaseNote();
|
||||
processOutEvent( midiEvent( MidiPitchBend,
|
||||
@@ -545,7 +546,7 @@ void instrumentTrack::updatePitch( void )
|
||||
|
||||
|
||||
|
||||
int instrumentTrack::masterKey( int _midi_key ) const
|
||||
int InstrumentTrack::masterKey( int _midi_key ) const
|
||||
{
|
||||
int key = m_baseNoteModel.value() - engine::getSong()->masterPitch();
|
||||
return tLimit<int>( _midi_key - ( key - DefaultKey ), 0, NumKeys );
|
||||
@@ -554,7 +555,7 @@ int instrumentTrack::masterKey( int _midi_key ) const
|
||||
|
||||
|
||||
|
||||
void instrumentTrack::removeMidiPortNode( multimediaProject & _mmp )
|
||||
void InstrumentTrack::removeMidiPortNode( multimediaProject & _mmp )
|
||||
{
|
||||
QDomNodeList n = _mmp.elementsByTagName( "midiport" );
|
||||
n.item( 0 ).parentNode().removeChild( n.item( 0 ) );
|
||||
@@ -563,7 +564,7 @@ void instrumentTrack::removeMidiPortNode( multimediaProject & _mmp )
|
||||
|
||||
|
||||
|
||||
bool instrumentTrack::play( const midiTime & _start,
|
||||
bool InstrumentTrack::play( const midiTime & _start,
|
||||
const fpp_t _frames,
|
||||
const f_cnt_t _offset,
|
||||
Sint16 _tco_num )
|
||||
@@ -688,7 +689,7 @@ bool instrumentTrack::play( const midiTime & _start,
|
||||
|
||||
|
||||
|
||||
trackContentObject * instrumentTrack::createTCO( const midiTime & )
|
||||
trackContentObject * InstrumentTrack::createTCO( const midiTime & )
|
||||
{
|
||||
return new pattern( this );
|
||||
}
|
||||
@@ -696,15 +697,15 @@ trackContentObject * instrumentTrack::createTCO( const midiTime & )
|
||||
|
||||
|
||||
|
||||
trackView * instrumentTrack::createView( trackContainerView * _tcv )
|
||||
trackView * InstrumentTrack::createView( trackContainerView * _tcv )
|
||||
{
|
||||
return new instrumentTrackView( this, _tcv );
|
||||
return new InstrumentTrackView( this, _tcv );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void instrumentTrack::saveTrackSpecificSettings( QDomDocument & _doc,
|
||||
void InstrumentTrack::saveTrackSpecificSettings( QDomDocument & _doc,
|
||||
QDomElement & _this )
|
||||
{
|
||||
m_volumeModel.saveSettings( _doc, _this, "vol" );
|
||||
@@ -717,7 +718,7 @@ void instrumentTrack::saveTrackSpecificSettings( QDomDocument & _doc,
|
||||
if( m_instrument != NULL )
|
||||
{
|
||||
QDomElement i = _doc.createElement( "instrument" );
|
||||
i.setAttribute( "name", m_instrument->getDescriptor()->name );
|
||||
i.setAttribute( "name", m_instrument->descriptor()->name );
|
||||
m_instrument->saveState( _doc, i );
|
||||
_this.appendChild( i );
|
||||
}
|
||||
@@ -725,13 +726,13 @@ void instrumentTrack::saveTrackSpecificSettings( QDomDocument & _doc,
|
||||
m_chordCreator.saveState( _doc, _this );
|
||||
m_arpeggiator.saveState( _doc, _this );
|
||||
m_midiPort.saveState( _doc, _this );
|
||||
m_audioPort.getEffects()->saveState( _doc, _this );
|
||||
m_audioPort.effects()->saveState( _doc, _this );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void instrumentTrack::loadTrackSpecificSettings( const QDomElement & _this )
|
||||
void InstrumentTrack::loadTrackSpecificSettings( const QDomElement & _this )
|
||||
{
|
||||
silenceAllNotes();
|
||||
|
||||
@@ -770,7 +771,7 @@ void instrumentTrack::loadTrackSpecificSettings( const QDomElement & _this )
|
||||
}
|
||||
|
||||
// clear effect-chain just in case we load an old preset without FX-data
|
||||
m_audioPort.getEffects()->clear();
|
||||
m_audioPort.effects()->clear();
|
||||
|
||||
QDomNode node = _this.firstChild();
|
||||
while( !node.isNull() )
|
||||
@@ -793,17 +794,15 @@ void instrumentTrack::loadTrackSpecificSettings( const QDomElement & _this )
|
||||
{
|
||||
m_midiPort.restoreState( node.toElement() );
|
||||
}
|
||||
else if( m_audioPort.getEffects()->nodeName() ==
|
||||
node.nodeName() )
|
||||
else if( m_audioPort.effects()->nodeName() == node.nodeName() )
|
||||
{
|
||||
m_audioPort.getEffects()->restoreState(
|
||||
node.toElement() );
|
||||
m_audioPort.effects()->restoreState( node.toElement() );
|
||||
}
|
||||
else if( node.nodeName() == "instrument" )
|
||||
{
|
||||
delete m_instrument;
|
||||
m_instrument = NULL;
|
||||
m_instrument = instrument::instantiate(
|
||||
m_instrument = Instrument::instantiate(
|
||||
node.toElement().attribute( "name" ),
|
||||
this );
|
||||
m_instrument->restoreState(
|
||||
@@ -819,7 +818,7 @@ void instrumentTrack::loadTrackSpecificSettings( const QDomElement & _this )
|
||||
{
|
||||
delete m_instrument;
|
||||
m_instrument = NULL;
|
||||
m_instrument = instrument::instantiate(
|
||||
m_instrument = Instrument::instantiate(
|
||||
node.nodeName(), this );
|
||||
if( m_instrument->nodeName() ==
|
||||
node.nodeName() )
|
||||
@@ -838,13 +837,13 @@ void instrumentTrack::loadTrackSpecificSettings( const QDomElement & _this )
|
||||
|
||||
|
||||
|
||||
instrument * instrumentTrack::loadInstrument( const QString & _plugin_name )
|
||||
Instrument * InstrumentTrack::loadInstrument( const QString & _plugin_name )
|
||||
{
|
||||
silenceAllNotes();
|
||||
|
||||
engine::getMixer()->lock();
|
||||
delete m_instrument;
|
||||
m_instrument = instrument::instantiate( _plugin_name, this );
|
||||
m_instrument = Instrument::instantiate( _plugin_name, this );
|
||||
engine::getMixer()->unlock();
|
||||
|
||||
emit instrumentChanged();
|
||||
@@ -859,11 +858,11 @@ instrument * instrumentTrack::loadInstrument( const QString & _plugin_name )
|
||||
// #### ITV:
|
||||
|
||||
|
||||
QQueue<instrumentTrackWindow *> instrumentTrackView::s_windows;
|
||||
QQueue<InstrumentTrackWindow *> InstrumentTrackView::s_windows;
|
||||
|
||||
|
||||
|
||||
instrumentTrackView::instrumentTrackView( instrumentTrack * _it,
|
||||
InstrumentTrackView::InstrumentTrackView( InstrumentTrack * _it,
|
||||
trackContainerView * _tcv ) :
|
||||
trackView( _it, _tcv ),
|
||||
m_window( NULL ),
|
||||
@@ -945,9 +944,9 @@ instrumentTrackView::instrumentTrackView( instrumentTrack * _it,
|
||||
m_activityIndicator->setGeometry(
|
||||
DEFAULT_SETTINGS_WIDGET_WIDTH-2*24-11, 2, 8, 28 );
|
||||
m_activityIndicator->show();
|
||||
connect( m_activityIndicator, SIGNAL( pressed( void ) ),
|
||||
connect( m_activityIndicator, SIGNAL( pressed() ),
|
||||
this, SLOT( activityIndicatorPressed() ) );
|
||||
connect( m_activityIndicator, SIGNAL( released( void ) ),
|
||||
connect( m_activityIndicator, SIGNAL( released() ),
|
||||
this, SLOT( activityIndicatorReleased() ) );
|
||||
connect( _it, SIGNAL( newNote() ),
|
||||
m_activityIndicator, SLOT( activate() ) );
|
||||
@@ -959,7 +958,7 @@ instrumentTrackView::instrumentTrackView( instrumentTrack * _it,
|
||||
|
||||
|
||||
|
||||
instrumentTrackView::~instrumentTrackView()
|
||||
InstrumentTrackView::~InstrumentTrackView()
|
||||
{
|
||||
freeInstrumentTrackWindow();
|
||||
|
||||
@@ -973,7 +972,7 @@ instrumentTrackView::~instrumentTrackView()
|
||||
// TODO: Add windows to free list on freeInstrumentTrackWindow.
|
||||
// But, don't NULL m_window or disconnect signals. This will allow windows
|
||||
// that are being show/hidden frequently to stay connected.
|
||||
void instrumentTrackView::freeInstrumentTrackWindow( void )
|
||||
void InstrumentTrackView::freeInstrumentTrackWindow()
|
||||
{
|
||||
if( m_window != NULL )
|
||||
{
|
||||
@@ -983,7 +982,7 @@ void instrumentTrackView::freeInstrumentTrackWindow( void )
|
||||
model()->setHook( NULL );
|
||||
m_window->parentWidget()->hide();
|
||||
m_window->setModel(
|
||||
engine::getDummyTrackContainer()->
|
||||
engine::dummyTrackContainer()->
|
||||
dummyInstrumentTrack() );
|
||||
m_window->updateInstrumentView();
|
||||
s_windows.enqueue( m_window );
|
||||
@@ -1000,7 +999,7 @@ void instrumentTrackView::freeInstrumentTrackWindow( void )
|
||||
|
||||
|
||||
|
||||
void instrumentTrackView::cleanupWindowPool( void )
|
||||
void InstrumentTrackView::cleanupWindowPool()
|
||||
{
|
||||
while( s_windows.count() )
|
||||
{
|
||||
@@ -1011,7 +1010,7 @@ void instrumentTrackView::cleanupWindowPool( void )
|
||||
|
||||
|
||||
|
||||
instrumentTrackWindow * instrumentTrackView::getInstrumentTrackWindow( void )
|
||||
InstrumentTrackWindow * InstrumentTrackView::getInstrumentTrackWindow()
|
||||
{
|
||||
if( m_window != NULL )
|
||||
{
|
||||
@@ -1032,7 +1031,7 @@ instrumentTrackWindow * instrumentTrackView::getInstrumentTrackWindow( void )
|
||||
}
|
||||
else
|
||||
{
|
||||
m_window = new instrumentTrackWindow( this );
|
||||
m_window = new InstrumentTrackWindow( this );
|
||||
}
|
||||
|
||||
return m_window;
|
||||
@@ -1041,9 +1040,9 @@ instrumentTrackWindow * instrumentTrackView::getInstrumentTrackWindow( void )
|
||||
|
||||
|
||||
|
||||
void instrumentTrackView::dragEnterEvent( QDragEnterEvent * _dee )
|
||||
void InstrumentTrackView::dragEnterEvent( QDragEnterEvent * _dee )
|
||||
{
|
||||
instrumentTrackWindow::dragEnterEventGeneric( _dee );
|
||||
InstrumentTrackWindow::dragEnterEventGeneric( _dee );
|
||||
if( !_dee->isAccepted() )
|
||||
{
|
||||
trackView::dragEnterEvent( _dee );
|
||||
@@ -1053,7 +1052,7 @@ void instrumentTrackView::dragEnterEvent( QDragEnterEvent * _dee )
|
||||
|
||||
|
||||
|
||||
void instrumentTrackView::dropEvent( QDropEvent * _de )
|
||||
void InstrumentTrackView::dropEvent( QDropEvent * _de )
|
||||
{
|
||||
getInstrumentTrackWindow()->dropEvent( _de );
|
||||
trackView::dropEvent( _de );
|
||||
@@ -1062,7 +1061,7 @@ void instrumentTrackView::dropEvent( QDropEvent * _de )
|
||||
|
||||
|
||||
|
||||
void instrumentTrackView::toggleInstrumentWindow( bool _on )
|
||||
void InstrumentTrackView::toggleInstrumentWindow( bool _on )
|
||||
{
|
||||
getInstrumentTrackWindow()->toggleVisibility( _on );
|
||||
|
||||
@@ -1075,7 +1074,7 @@ void instrumentTrackView::toggleInstrumentWindow( bool _on )
|
||||
|
||||
|
||||
|
||||
void instrumentTrackView::activityIndicatorPressed( void )
|
||||
void InstrumentTrackView::activityIndicatorPressed()
|
||||
{
|
||||
model()->processInEvent(
|
||||
midiEvent( MidiNoteOn, 0, DefaultKey, MidiMaxVelocity ),
|
||||
@@ -1085,7 +1084,7 @@ void instrumentTrackView::activityIndicatorPressed( void )
|
||||
|
||||
|
||||
|
||||
void instrumentTrackView::activityIndicatorReleased( void )
|
||||
void InstrumentTrackView::activityIndicatorReleased()
|
||||
{
|
||||
model()->processInEvent( midiEvent( MidiNoteOff, 0, DefaultKey, 0 ),
|
||||
midiTime() );
|
||||
@@ -1095,7 +1094,7 @@ void instrumentTrackView::activityIndicatorReleased( void )
|
||||
|
||||
|
||||
|
||||
void instrumentTrackView::midiInSelected( void )
|
||||
void InstrumentTrackView::midiInSelected()
|
||||
{
|
||||
if( model() )
|
||||
{
|
||||
@@ -1107,7 +1106,7 @@ void instrumentTrackView::midiInSelected( void )
|
||||
|
||||
|
||||
|
||||
void instrumentTrackView::midiOutSelected( void )
|
||||
void InstrumentTrackView::midiOutSelected()
|
||||
{
|
||||
if( model() )
|
||||
{
|
||||
@@ -1119,7 +1118,7 @@ void instrumentTrackView::midiOutSelected( void )
|
||||
|
||||
|
||||
|
||||
void instrumentTrackView::midiConfigChanged( void )
|
||||
void InstrumentTrackView::midiConfigChanged()
|
||||
{
|
||||
m_midiInputAction->setChecked( model()->m_midiPort.isReadable() );
|
||||
m_midiOutputAction->setChecked( model()->m_midiPort.isWritable() );
|
||||
@@ -1140,7 +1139,7 @@ class fxLineLcdSpinBox : public lcdSpinBox
|
||||
protected:
|
||||
virtual void mouseDoubleClickEvent ( QMouseEvent * _me )
|
||||
{
|
||||
engine::getFxMixerView()->setCurrentFxLine( model()->value() );
|
||||
engine::fxMixerView()->setCurrentFxLine( model()->value() );
|
||||
//engine::getFxMixerView()->raise();
|
||||
}
|
||||
};
|
||||
@@ -1148,9 +1147,9 @@ class fxLineLcdSpinBox : public lcdSpinBox
|
||||
|
||||
|
||||
// #### ITW:
|
||||
instrumentTrackWindow::instrumentTrackWindow( instrumentTrackView * _itv ) :
|
||||
InstrumentTrackWindow::InstrumentTrackWindow( InstrumentTrackView * _itv ) :
|
||||
QWidget(),
|
||||
modelView( NULL, this ),
|
||||
ModelView( NULL, this ),
|
||||
m_track( _itv->model() ),
|
||||
m_itv( _itv ),
|
||||
m_instrumentView( NULL )
|
||||
@@ -1232,14 +1231,14 @@ instrumentTrackWindow::instrumentTrackWindow( instrumentTrackView * _itv ) :
|
||||
|
||||
|
||||
// create tab-widgets
|
||||
m_ssView = new instrumentSoundShapingView( m_tabWidget );
|
||||
m_ssView = new InstrumentSoundShapingView( m_tabWidget );
|
||||
QWidget * instrument_functions = new QWidget( m_tabWidget );
|
||||
m_chordView = new chordCreatorView( &m_track->m_chordCreator,
|
||||
m_chordView = new ChordCreatorView( &m_track->m_chordCreator,
|
||||
instrument_functions );
|
||||
m_arpView= new arpeggiatorView( &m_track->m_arpeggiator,
|
||||
m_arpView= new ArpeggiatorView( &m_track->m_arpeggiator,
|
||||
instrument_functions );
|
||||
m_midiView = new instrumentMidiIOView( m_tabWidget );
|
||||
m_effectView = new effectRackView( m_track->m_audioPort.getEffects(),
|
||||
m_midiView = new InstrumentMidiIOView( m_tabWidget );
|
||||
m_effectView = new EffectRackView( m_track->m_audioPort.effects(),
|
||||
m_tabWidget );
|
||||
m_tabWidget->addTab( m_ssView, tr( "ENV/LFO" ), 1 );
|
||||
m_tabWidget->addTab( instrument_functions, tr( "FUNC" ), 2 );
|
||||
@@ -1247,7 +1246,7 @@ instrumentTrackWindow::instrumentTrackWindow( instrumentTrackView * _itv ) :
|
||||
m_tabWidget->addTab( m_midiView, tr( "MIDI" ), 4 );
|
||||
|
||||
// setup piano-widget
|
||||
m_pianoView= new pianoView( this );
|
||||
m_pianoView= new PianoView( this );
|
||||
m_pianoView->setFixedSize( INSTRUMENT_WIDTH, PIANO_HEIGHT );
|
||||
|
||||
vlayout->addWidget( m_generalSettingsWidget );
|
||||
@@ -1263,7 +1262,7 @@ instrumentTrackWindow::instrumentTrackWindow( instrumentTrackView * _itv ) :
|
||||
resize( sizeHint() );
|
||||
|
||||
QMdiSubWindow * subWin =
|
||||
engine::getMainWindow()->workspace()->addSubWindow( this );
|
||||
engine::mainWindow()->workspace()->addSubWindow( this );
|
||||
Qt::WindowFlags flags = subWin->windowFlags();
|
||||
flags |= Qt::MSWindowsFixedSizeDialogHint;
|
||||
flags &= ~Qt::WindowMaximizeButtonHint;
|
||||
@@ -1276,10 +1275,10 @@ instrumentTrackWindow::instrumentTrackWindow( instrumentTrackView * _itv ) :
|
||||
|
||||
|
||||
|
||||
instrumentTrackWindow::~instrumentTrackWindow()
|
||||
InstrumentTrackWindow::~InstrumentTrackWindow()
|
||||
{
|
||||
delete m_instrumentView;
|
||||
if( engine::getMainWindow()->workspace() )
|
||||
if( engine::mainWindow()->workspace() )
|
||||
{
|
||||
parentWidget()->hide();
|
||||
parentWidget()->deleteLater();
|
||||
@@ -1289,9 +1288,9 @@ instrumentTrackWindow::~instrumentTrackWindow()
|
||||
|
||||
|
||||
|
||||
void instrumentTrackWindow::modelChanged( void )
|
||||
void InstrumentTrackWindow::modelChanged()
|
||||
{
|
||||
m_track = castModel<instrumentTrack>();
|
||||
m_track = castModel<InstrumentTrack>();
|
||||
|
||||
m_nameLineEdit->setText( m_track->name() );
|
||||
|
||||
@@ -1308,7 +1307,7 @@ void instrumentTrackWindow::modelChanged( void )
|
||||
m_effectChannelNumber->setModel( &m_track->m_effectChannelModel );
|
||||
m_pianoView->setModel( &m_track->m_piano );
|
||||
|
||||
if( m_track->getInstrument() && m_track->getInstrument()->isBendable() )
|
||||
if( m_track->instrument() && m_track->instrument()->isBendable() )
|
||||
{
|
||||
m_pitchKnob->setModel( &m_track->m_pitchModel );
|
||||
m_pitchKnob->show();
|
||||
@@ -1323,14 +1322,14 @@ void instrumentTrackWindow::modelChanged( void )
|
||||
m_chordView->setModel( &m_track->m_chordCreator );
|
||||
m_arpView->setModel( &m_track->m_arpeggiator );
|
||||
m_midiView->setModel( &m_track->m_midiPort );
|
||||
m_effectView->setModel( m_track->m_audioPort.getEffects() );
|
||||
m_effectView->setModel( m_track->m_audioPort.effects() );
|
||||
updateName();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void instrumentTrackWindow::saveSettingsBtnClicked( void )
|
||||
void InstrumentTrackWindow::saveSettingsBtnClicked()
|
||||
{
|
||||
QFileDialog sfd( this, tr( "Save preset" ), "",
|
||||
tr( "XML preset file (*.xpf)" ) );
|
||||
@@ -1365,7 +1364,7 @@ void instrumentTrackWindow::saveSettingsBtnClicked( void )
|
||||
|
||||
|
||||
|
||||
void instrumentTrackWindow::updateName( void )
|
||||
void InstrumentTrackWindow::updateName()
|
||||
{
|
||||
setWindowTitle( m_track->name() );
|
||||
|
||||
@@ -1379,7 +1378,7 @@ void instrumentTrackWindow::updateName( void )
|
||||
|
||||
|
||||
|
||||
void instrumentTrackWindow::updateInstrumentView( void )
|
||||
void InstrumentTrackWindow::updateInstrumentView()
|
||||
{
|
||||
delete m_instrumentView;
|
||||
if( m_track->m_instrument != NULL )
|
||||
@@ -1397,7 +1396,7 @@ void instrumentTrackWindow::updateInstrumentView( void )
|
||||
|
||||
|
||||
|
||||
void instrumentTrackWindow::textChanged( const QString & _new_name )
|
||||
void InstrumentTrackWindow::textChanged( const QString & _new_name )
|
||||
{
|
||||
m_track->setName( _new_name );
|
||||
engine::getSong()->setModified();
|
||||
@@ -1406,7 +1405,7 @@ void instrumentTrackWindow::textChanged( const QString & _new_name )
|
||||
|
||||
|
||||
|
||||
void instrumentTrackWindow::toggleVisibility( bool _on )
|
||||
void InstrumentTrackWindow::toggleVisibility( bool _on )
|
||||
{
|
||||
|
||||
if( _on )
|
||||
@@ -1424,10 +1423,10 @@ void instrumentTrackWindow::toggleVisibility( bool _on )
|
||||
|
||||
|
||||
|
||||
void instrumentTrackWindow::closeEvent( QCloseEvent * _ce )
|
||||
void InstrumentTrackWindow::closeEvent( QCloseEvent * _ce )
|
||||
{
|
||||
_ce->ignore();
|
||||
if( engine::getMainWindow()->workspace() )
|
||||
if( engine::mainWindow()->workspace() )
|
||||
{
|
||||
parentWidget()->hide();
|
||||
}
|
||||
@@ -1442,7 +1441,7 @@ void instrumentTrackWindow::closeEvent( QCloseEvent * _ce )
|
||||
|
||||
|
||||
|
||||
void instrumentTrackWindow::focusInEvent( QFocusEvent * )
|
||||
void InstrumentTrackWindow::focusInEvent( QFocusEvent * )
|
||||
{
|
||||
m_pianoView->setFocus();
|
||||
}
|
||||
@@ -1450,7 +1449,7 @@ void instrumentTrackWindow::focusInEvent( QFocusEvent * )
|
||||
|
||||
|
||||
|
||||
void instrumentTrackWindow::dragEnterEventGeneric( QDragEnterEvent * _dee )
|
||||
void InstrumentTrackWindow::dragEnterEventGeneric( QDragEnterEvent * _dee )
|
||||
{
|
||||
stringPairDrag::processDragEnterEvent( _dee, "instrument,presetfile,"
|
||||
"pluginpresetfile" );
|
||||
@@ -1459,7 +1458,7 @@ void instrumentTrackWindow::dragEnterEventGeneric( QDragEnterEvent * _dee )
|
||||
|
||||
|
||||
|
||||
void instrumentTrackWindow::dragEnterEvent( QDragEnterEvent * _dee )
|
||||
void InstrumentTrackWindow::dragEnterEvent( QDragEnterEvent * _dee )
|
||||
{
|
||||
dragEnterEventGeneric( _dee );
|
||||
}
|
||||
@@ -1467,7 +1466,7 @@ void instrumentTrackWindow::dragEnterEvent( QDragEnterEvent * _dee )
|
||||
|
||||
|
||||
|
||||
void instrumentTrackWindow::dropEvent( QDropEvent * _de )
|
||||
void InstrumentTrackWindow::dropEvent( QDropEvent * _de )
|
||||
{
|
||||
QString type = stringPairDrag::decodeKey( _de );
|
||||
QString value = stringPairDrag::decodeValue( _de );
|
||||
@@ -1480,7 +1479,7 @@ void instrumentTrackWindow::dropEvent( QDropEvent * _de )
|
||||
else if( type == "presetfile" )
|
||||
{
|
||||
multimediaProject mmp( value );
|
||||
instrumentTrack::removeMidiPortNode( mmp );
|
||||
InstrumentTrack::removeMidiPortNode( mmp );
|
||||
m_track->setSimpleSerializing();
|
||||
m_track->loadSettings( mmp.content().toElement() );
|
||||
engine::getSong()->setModified();
|
||||
@@ -1489,8 +1488,8 @@ void instrumentTrackWindow::dropEvent( QDropEvent * _de )
|
||||
else if( type == "pluginpresetfile" )
|
||||
{
|
||||
const QString ext = fileItem::extension( value );
|
||||
instrument * i = m_track->getInstrument();
|
||||
if( !i->getDescriptor()->supportsFileType( ext ) )
|
||||
Instrument * i = m_track->instrument();
|
||||
if( !i->descriptor()->supportsFileType( ext ) )
|
||||
{
|
||||
i = m_track->loadInstrument(
|
||||
engine::pluginFileHandling()[ext] );
|
||||
@@ -1503,20 +1502,20 @@ void instrumentTrackWindow::dropEvent( QDropEvent * _de )
|
||||
|
||||
|
||||
|
||||
void instrumentTrackWindow::saveSettings( QDomDocument & _doc,
|
||||
void InstrumentTrackWindow::saveSettings( QDomDocument & _doc,
|
||||
QDomElement & _this )
|
||||
{
|
||||
_this.setAttribute( "tab", m_tabWidget->activeTab() );
|
||||
mainWindow::saveWidgetState( this, _this );
|
||||
MainWindow::saveWidgetState( this, _this );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void instrumentTrackWindow::loadSettings( const QDomElement & _this )
|
||||
void InstrumentTrackWindow::loadSettings( const QDomElement & _this )
|
||||
{
|
||||
m_tabWidget->setActiveTab( _this.attribute( "tab" ).toInt() );
|
||||
mainWindow::restoreWidgetState( this, _this );
|
||||
MainWindow::restoreWidgetState( this, _this );
|
||||
if( isVisible() )
|
||||
{
|
||||
m_itv->m_tlb->setChecked( true );
|
||||
@@ -1526,6 +1525,6 @@ void instrumentTrackWindow::loadSettings( const QDomElement & _this )
|
||||
|
||||
|
||||
|
||||
#include "moc_instrument_track.cxx"
|
||||
#include "moc_InstrumentTrack.cxx"
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#include "automation_pattern.h"
|
||||
#include "engine.h"
|
||||
#include "embed.h"
|
||||
#include "project_journal.h"
|
||||
#include "ProjectJournal.h"
|
||||
#include "string_pair_drag.h"
|
||||
#include "track_container_view.h"
|
||||
#include "track_label_button.h"
|
||||
@@ -56,7 +56,7 @@ bool automationTrack::play( const midiTime & _start, const fpp_t _frames,
|
||||
{
|
||||
if( isMuted() )
|
||||
{
|
||||
return( FALSE );
|
||||
return false;
|
||||
}
|
||||
|
||||
tcoVector tcos;
|
||||
@@ -86,7 +86,7 @@ bool automationTrack::play( const midiTime & _start, const fpp_t _frames,
|
||||
}
|
||||
p->processMidiTime( cur_start );
|
||||
}
|
||||
return( FALSE );
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@ bool automationTrack::play( const midiTime & _start, const fpp_t _frames,
|
||||
|
||||
trackView * automationTrack::createView( trackContainerView * _tcv )
|
||||
{
|
||||
return( new automationTrackView( this, _tcv ) );
|
||||
return new automationTrackView( this, _tcv );
|
||||
}
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@ trackView * automationTrack::createView( trackContainerView * _tcv )
|
||||
|
||||
trackContentObject * automationTrack::createTCO( const midiTime & )
|
||||
{
|
||||
return( new automationPattern( this ) );
|
||||
return new automationPattern( this );
|
||||
}
|
||||
|
||||
|
||||
@@ -121,7 +121,7 @@ void automationTrack::loadTrackSpecificSettings( const QDomElement & _this )
|
||||
// just in case something somehow wrent wrong...
|
||||
if( type() == HiddenAutomationTrack )
|
||||
{
|
||||
setMuted( FALSE );
|
||||
setMuted( false );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -166,9 +166,9 @@ void automationTrackView::dropEvent( QDropEvent * _de )
|
||||
QString val = stringPairDrag::decodeValue( _de );
|
||||
if( type == "automatable_model" )
|
||||
{
|
||||
automatableModel * mod = dynamic_cast<automatableModel *>(
|
||||
engine::getProjectJournal()->
|
||||
getJournallingObject( val.toInt() ) );
|
||||
AutomatableModel * mod = dynamic_cast<AutomatableModel *>(
|
||||
engine::projectJournal()->
|
||||
journallingObject( val.toInt() ) );
|
||||
if( mod != NULL )
|
||||
{
|
||||
midiTime pos = midiTime( getTrackContainerView()->
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user