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.
This commit is contained in:
Tobias Doerffel
2009-08-24 17:59:28 +02:00
parent b5d9fab944
commit 8c9a9dd14c
290 changed files with 5182 additions and 5380 deletions

View File

@@ -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,30 +22,28 @@
*
*/
#include <QtXml/QDomElement>
#include "automatable_model.h"
#include "AutomatableModel.h"
#include "automation_recorder.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 ),
@@ -68,7 +66,7 @@ automatableModel::automatableModel( DataType _type,
automatableModel::~automatableModel()
AutomatableModel::~AutomatableModel()
{
while( m_linkedModels.empty() == false )
{
@@ -87,7 +85,7 @@ automatableModel::~automatableModel()
bool automatableModel::isAutomated( void ) const
bool AutomatableModel::isAutomated() const
{
return automationPattern::isAutomated( this );
}
@@ -95,7 +93,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() )
@@ -132,7 +130,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
@@ -182,7 +180,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;
@@ -191,10 +189,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 )
{
@@ -220,7 +218,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;
@@ -229,9 +227,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 ) !=
@@ -248,7 +245,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 ) )
@@ -272,7 +269,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 )
{
@@ -284,7 +281,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 );
@@ -327,7 +324,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() );
@@ -337,16 +334,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 );
@@ -356,14 +353,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;
@@ -373,7 +370,7 @@ void automatableModel::addJournalEntryFromOldToCurVal( void )
void automatableModel::linkModel( automatableModel * _model )
void AutomatableModel::linkModel( AutomatableModel * _model )
{
if( !m_linkedModels.contains( _model ) )
{
@@ -390,10 +387,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 );
@@ -406,8 +403,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 );
@@ -416,8 +413,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 );
@@ -426,7 +423,7 @@ void automatableModel::unlinkModels( automatableModel * _model1,
void automatableModel::setControllerConnection( ControllerConnection * _c )
void AutomatableModel::setControllerConnection( ControllerConnection * _c )
{
m_controllerConnection = _c;
if( _c )
@@ -443,7 +440,7 @@ void automatableModel::setControllerConnection( ControllerConnection * _c )
float automatableModel::controllerValue( int _frameOffset ) const
float AutomatableModel::controllerValue( int _frameOffset ) const
{
if( m_controllerConnection )
{
@@ -456,7 +453,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 );
@@ -467,7 +464,7 @@ float automatableModel::controllerValue( int _frameOffset ) const
void automatableModel::unlinkControllerConnection( void )
void AutomatableModel::unlinkControllerConnection()
{
if( m_controllerConnection )
{
@@ -479,7 +476,7 @@ void automatableModel::unlinkControllerConnection( void )
void automatableModel::handleDataChanged( void )
void AutomatableModel::handleDataChanged()
{
// report the data changed to AutomationRecorder
engine::getAutomationRecorder()->modelDataEvent( this );
@@ -487,7 +484,7 @@ void automatableModel::handleDataChanged( void )
void automatableModel::setInitValue( const float _value )
void AutomatableModel::setInitValue( const float _value )
{
m_initValue = _value;
bool journalling = testAndSetJournalling( false );
@@ -499,7 +496,7 @@ void automatableModel::setInitValue( const float _value )
void automatableModel::reset( void )
void AutomatableModel::reset()
{
setValue( initValue<float>() );
}
@@ -507,7 +504,7 @@ void automatableModel::reset( void )
void automatableModel::copyValue( void )
void AutomatableModel::copyValue()
{
__copiedValue = value<float>();
}
@@ -515,7 +512,7 @@ void automatableModel::copyValue( void )
void automatableModel::pasteValue( void )
void AutomatableModel::pasteValue()
{
setValue( __copiedValue );
}
@@ -523,5 +520,5 @@ void automatableModel::pasteValue( void )
#include "moc_automatable_model.cxx"
#include "moc_AutomatableModel.cxx"

View File

@@ -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;
}

View File

@@ -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"

View File

@@ -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 )

View File

@@ -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>
*

View File

@@ -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 ) );
}
}

View File

@@ -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"

View File

@@ -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"

View File

@@ -1,5 +1,5 @@
/*
* fx_mixer.cpp - effect-mixer for LMMS
* FxMixer.cpp - effect mixer for LMMS
*
* Copyright (c) 2008-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
@@ -25,13 +25,13 @@
#include <QtXml/QDomElement>
#include "fx_mixer.h"
#include "FxMixer.h"
#include "Cpu.h"
#include "effect.h"
#include "Effect.h"
#include "song.h"
fxChannel::fxChannel( model * _parent ) :
FxChannel::FxChannel( Model * _parent ) :
m_fxChain( NULL ),
m_used( false ),
m_stillRunning( false ),
@@ -50,7 +50,7 @@ fxChannel::fxChannel( model * _parent ) :
fxChannel::~fxChannel()
FxChannel::~FxChannel()
{
CPU::freeFrames( m_buffer );
}
@@ -60,13 +60,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();
@@ -75,7 +75,7 @@ fxMixer::fxMixer() :
fxMixer::~fxMixer()
FxMixer::~FxMixer()
{
for( int i = 0; i < NumFxChannels+1; ++i )
{
@@ -86,7 +86,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 )
{
@@ -101,7 +101,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 ||
@@ -135,7 +135,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() );
@@ -144,7 +144,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 );
@@ -189,7 +189,7 @@ void fxMixer::masterMix( sampleFrame * _buf )
void fxMixer::clear()
void FxMixer::clear()
{
for( int i = 0; i <= NumFxChannels; ++i )
{
@@ -207,7 +207,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 )
{
@@ -226,7 +226,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();

View File

@@ -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;
}

View File

@@ -1,8 +1,8 @@
/*
* instrument.cpp - base-class for all instrument-plugins (synths, samplers etc)
* 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
@@ -22,17 +22,16 @@
*
*/
#include "instrument.h"
#include "instrument_track.h"
#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*/ ),
Instrument::Instrument( InstrumentTrack * _instrument_track,
const Descriptor * _descriptor ) :
Plugin( _descriptor, NULL/* _instrument_track*/ ),
m_instrumentTrack( _instrument_track )
{
}
@@ -40,28 +39,28 @@ instrument::instrument( instrumentTrack * _instrument_track,
instrument::~instrument()
Instrument::~Instrument()
{
}
void instrument::play( sampleFrame * )
void Instrument::play( sampleFrame * )
{
}
void instrument::deleteNotePluginData( notePlayHandle * )
void Instrument::deleteNotePluginData( notePlayHandle * )
{
}
f_cnt_t instrument::beatLen( notePlayHandle * ) const
f_cnt_t Instrument::beatLen( notePlayHandle * ) const
{
return 0;
}
@@ -69,16 +68,16 @@ f_cnt_t instrument::beatLen( notePlayHandle * ) const
instrument * instrument::instantiate( const QString & _plugin_name,
instrumentTrack * _instrument_track )
Instrument * Instrument::instantiate( const QString & _plugin_name,
InstrumentTrack * _instrument_track )
{
plugin * p = plugin::instantiate( _plugin_name, _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 )
if( dynamic_cast<Instrument *>( p ) != NULL )
{
// everything ok, so return pointer
return dynamic_cast<instrument *>( p );
return dynamic_cast<Instrument *>( p );
}
// not quite... so delete plugin and return dummy instrument
@@ -89,14 +88,14 @@ instrument * instrument::instantiate( const QString & _plugin_name,
bool instrument::isFromTrack( const track * _track ) const
bool Instrument::isFromTrack( const track * _track ) const
{
return m_instrumentTrack == _track;
}
void instrument::applyRelease( sampleFrame * buf, const notePlayHandle * _n )
void Instrument::applyRelease( sampleFrame * buf, const notePlayHandle * _n )
{
const fpp_t frames = _n->framesLeftForCurrentPeriod();
const fpp_t fpp = engine::getMixer()->framesPerPeriod();
@@ -120,9 +119,9 @@ void instrument::applyRelease( sampleFrame * buf, const notePlayHandle * _n )
QString instrument::fullDisplayName() const
QString Instrument::fullDisplayName() const
{
return getInstrumentTrack()->displayName();
return instrumentTrack()->displayName();
}

View File

@@ -1,8 +1,8 @@
/*
* 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
@@ -22,124 +22,122 @@
*
*/
#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"
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" ) )
{
@@ -153,14 +151,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
@@ -169,10 +167,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();
@@ -207,7 +205,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 );
@@ -221,7 +219,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" );
@@ -231,7 +229,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" );
@@ -244,9 +242,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,
@@ -256,42 +254,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() ) )
@@ -303,14 +299,14 @@ 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 )
{
cnphv.push_back( _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();
@@ -396,7 +392,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
@@ -421,15 +417,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;
@@ -447,7 +443,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" );
@@ -462,7 +458,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" );
@@ -484,5 +480,5 @@ void arpeggiator::loadSettings( const QDomElement & _this )
#include "moc_instrument_functions.cxx"
#include "moc_InstrumentFunctions.cxx"

View File

@@ -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,56 +72,41 @@ 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( "RC LowPass 12dB" ),
new pixmapLoader( "filter_lp" ) );
m_filterModel.addItem( tr( "RC BandPass 12dB" ),
new pixmapLoader( "filter_bp" ) );
m_filterModel.addItem( tr( "RC HighPass 12dB" ),
new pixmapLoader( "filter_hp" ) );
m_filterModel.addItem( tr( "RC LowPass 24dB" ),
new pixmapLoader( "filter_lp" ) );
m_filterModel.addItem( tr( "RC BandPass 24dB" ),
new pixmapLoader( "filter_bp" ) );
m_filterModel.addItem( tr( "RC HighPass 24dB" ),
new pixmapLoader( "filter_hp" ) );
m_filterModel.addItem( tr( "Vocal Formant Filter" ),
new pixmapLoader( "filter_hp" ) );
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( "RC LowPass 12dB" ), new PixmapLoader( "filter_lp" ) );
m_filterModel.addItem( tr( "RC BandPass 12dB" ), new PixmapLoader( "filter_bp" ) );
m_filterModel.addItem( tr( "RC HighPass 12dB" ), new PixmapLoader( "filter_hp" ) );
m_filterModel.addItem( tr( "RC LowPass 24dB" ), new PixmapLoader( "filter_lp" ) );
m_filterModel.addItem( tr( "RC BandPass 24dB" ), new PixmapLoader( "filter_bp" ) );
m_filterModel.addItem( tr( "RC HighPass 24dB" ), new PixmapLoader( "filter_hp" ) );
m_filterModel.addItem( tr( "Vocal Formant Filter" ), new PixmapLoader( "filter_hp" ) );
}
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() +
@@ -137,16 +118,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 )
{
@@ -187,20 +168,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 );
}
@@ -208,12 +189,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];
@@ -230,11 +211,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 )
@@ -247,7 +228,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 )
{
@@ -280,14 +261,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 )
@@ -302,7 +283,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 )
@@ -320,18 +301,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();
}
}
}
@@ -341,26 +322,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();
}
}
}
@@ -370,7 +348,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" );
@@ -379,8 +357,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() );
}
}
@@ -388,7 +366,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" );
@@ -403,12 +381,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() );
}
}
}
@@ -419,5 +396,5 @@ void instrumentSoundShaping::loadSettings( const QDomElement & _this )
#include "moc_instrument_sound_shaping.cxx"
#include "moc_InstrumentSoundShaping.cxx"

View File

@@ -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" ) ) );
}

View File

@@ -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"

View File

@@ -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;
}
}

View File

@@ -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
View 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"

View File

@@ -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 ) );

View File

@@ -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 )
{
@@ -92,7 +92,7 @@ void PeakController::saveSettings( QDomDocument & _doc, QDomElement & _this )
{
Controller::saveSettings( _doc, _this );
_this.setAttribute( "effectId", m_peakEffect->m_effectId );
_this.setAttribute( "effectId", m_peakEffect->effectId() );
}
}
@@ -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)->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" );
}

115
src/core/Piano.cpp Normal file
View File

@@ -0,0 +1,115 @@
/*
* 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 "MidiEventProcessor.h"
/*! \brief Create a new keyboard display
*
* \param _it the InstrumentTrack window to attach to
*/
Piano::Piano( MidiEventProcessor * _mep ) :
Model( NULL ), /*!< base class ctor */
m_midiEvProc( _mep ) /*!< 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"

View File

@@ -1,8 +1,8 @@
/*
* 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
@@ -22,31 +22,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
} ;
@@ -54,9 +52,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 )
@@ -68,30 +66,30 @@ plugin::plugin( const descriptor * _descriptor, model * _parent ) :
plugin::~plugin()
Plugin::~Plugin()
{
}
void plugin::loadResource( const ResourceItem * )
void Plugin::loadResource( const ResourceItem * )
{
}
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() +
@@ -109,7 +107,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" );
@@ -124,16 +122,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
@@ -162,13 +160,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;
@@ -181,9 +179,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 );
@@ -193,7 +191,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" ) ),
@@ -211,12 +209,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() );

View File

@@ -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 )
{

View File

@@ -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"

View File

@@ -25,9 +25,9 @@
#include "ResourceAction.h"
#include "ResourceItem.h"
#include "ResourceFileMapper.h"
#include "import_filter.h"
#include "instrument.h"
#include "instrument_track.h"
#include "ImportFilter.h"
#include "Instrument.h"
#include "InstrumentTrack.h"
#include "MainWindow.h"
#include "mmp.h"
#include "song.h"
@@ -56,12 +56,11 @@ bool ResourceAction::loadProject()
bool ResourceAction::loadByPlugin( instrumentTrack * _target )
bool ResourceAction::loadByPlugin( InstrumentTrack * _target )
{
instrument * i = _target->getInstrument();
if( i == NULL ||
!i->getDescriptor()->supportsFileType(
m_item->nameExtension() ) )
Instrument * i = _target->instrument();
if( i == NULL || !i->descriptor()->supportsFileType(
m_item->nameExtension() ) )
{
i = _target->loadInstrument(
engine::pluginFileHandling()[m_item->nameExtension()] );
@@ -77,10 +76,10 @@ bool ResourceAction::loadByPlugin( instrumentTrack * _target )
bool ResourceAction::loadPreset( instrumentTrack * _target )
bool ResourceAction::loadPreset( InstrumentTrack * _target )
{
multimediaProject mmp( m_item->fetchData() );
instrumentTrack::removeMidiPortNode( mmp );
InstrumentTrack::removeMidiPortNode( mmp );
_target->setSimpleSerializing();
_target->loadSettings( mmp.content().toElement() );
@@ -93,7 +92,7 @@ bool ResourceAction::loadPreset( instrumentTrack * _target )
bool ResourceAction::importProject( trackContainer * _target )
{
ResourceFileMapper mapper( m_item );
/*return*/ importFilter::import( mapper.fileName(), _target );
/*return*/ ImportFilter::import( mapper.fileName(), _target );
return true;
}

View File

@@ -26,7 +26,7 @@
#include "ResourceModel.h"
#include "embed.h"
#include "plugin.h"
#include "Plugin.h"
#include "string_pair_drag.h"
@@ -119,10 +119,10 @@ case ResourceItem::TypePluginSpecificResource:
}
// iterate through all plugins
QVector<plugin::descriptor> descriptors;
plugin::getDescriptorsOfAvailPlugins( descriptors );
QVector<Plugin::Descriptor> descriptors;
Plugin::getDescriptorsOfAvailPlugins( descriptors );
for( QVector<plugin::descriptor>::iterator it = descriptors.begin();
for( QVector<Plugin::Descriptor>::iterator it = descriptors.begin();
it != descriptors.end(); ++it )
{
if( it->supportsFileType( ext ) )

View File

@@ -30,10 +30,10 @@
#include "ResourceFileMapper.h"
#include "ResourceItem.h"
#include "engine.h"
#include "instrument.h"
#include "instrument_track.h"
#include "Instrument.h"
#include "InstrumentTrack.h"
#include "mmp.h"
#include "project_journal.h"
#include "ProjectJournal.h"
ResourcePreviewer::ResourcePreviewer() :
@@ -44,7 +44,7 @@ ResourcePreviewer::ResourcePreviewer() :
// do not clutter global journal with items due to changing settings
// in preview classes
m_previewTrackContainer.setJournalling( false );
m_previewTrack = dynamic_cast<instrumentTrack *>(
m_previewTrack = dynamic_cast<InstrumentTrack *>(
track::create( track::InstrumentTrack,
&m_previewTrackContainer ) );
@@ -74,8 +74,8 @@ void ResourcePreviewer::preview( ResourceItem * _item )
stopPreview();
// disable journalling of changes in our preview track
const bool j = engine::getProjectJournal()->isJournalling();
engine::getProjectJournal()->setJournalling( false );
const bool j = engine::projectJournal()->isJournalling();
engine::projectJournal()->setJournalling( false );
engine::setSuppressMessages( true );
// handle individual resource types
@@ -108,7 +108,7 @@ void ResourcePreviewer::preview( ResourceItem * _item )
// re-enable journalling
engine::setSuppressMessages( false );
engine::getProjectJournal()->setJournalling( j );
engine::projectJournal()->setJournalling( j );
if( handledItem )
{

View File

@@ -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*/ )
{
}

View 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"

58
src/core/ToolPlugin.cpp Normal file
View File

@@ -0,0 +1,58 @@
/*
* 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
* 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"
ToolPlugin::ToolPlugin( const Descriptor * _descriptor, Model * _parent ) :
Plugin( _descriptor, _parent )
{
}
ToolPlugin::~ToolPlugin()
{
}
ToolPlugin * ToolPlugin::instantiate( const QString & _plugin_name, Model * _parent )
{
Plugin * p = Plugin::instantiate( _plugin_name, _parent, NULL );
// check whether instantiated plugin is a tool
if( p->type() == Plugin::Tool )
{
// everything ok, so return pointer
return dynamic_cast<ToolPlugin *>( p );
}
// not quite... so delete plugin
delete p;
return NULL;
}

View File

@@ -24,7 +24,7 @@
#include "AudioPort.h"
#include "AudioDevice.h"
#include "effect_chain.h"
#include "EffectChain.h"
#include "engine.h"
#include "Cpu.h"
@@ -38,7 +38,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() );

View File

@@ -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;
}
@@ -376,7 +376,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();
@@ -416,7 +416,7 @@ bool automationPattern::isAutomated( const automatableModel * _m )
automationPattern * automationPattern::globalAutomationPattern(
automatableModel * _m )
AutomatableModel * _m )
{
automationTrack * t = engine::getSong()->globalAutomationTrack();
track::tcoVector v = t->getTCOs();
@@ -464,14 +464,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();

View File

@@ -1,7 +1,7 @@
/*
* automation_recorder.cpp - declaration of class AutomationRecorder
* which handles the dataChanged event of every
* automatableModel and records it if automation
* AutomatableModel and records it if automation
* recording is on.
*
* Copyright (c) 2009-2009 Andrew Kelley <superjoe30/at/gmail.com>
@@ -40,7 +40,7 @@ AutomationRecorder::~AutomationRecorder()
{
}
void AutomationRecorder::modelDataEvent( automatableModel * _model )
void AutomationRecorder::modelDataEvent( AutomatableModel * _model )
{
if( _model->armed() &&
engine::getSong()->isRecording() &&

View File

@@ -32,17 +32,17 @@
#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 "MainWindow.h"
#include "mixer.h"
#include "pattern.h"
#include "piano_roll.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"
#include "MidiControlListener.h"
@@ -57,8 +57,8 @@ 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;
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;
@@ -71,9 +71,9 @@ AutomationRecorder * engine::s_automationRecorder = 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;
MidiControlListener * engine::s_midiControlListener = NULL;
QMap<QString, QString> engine::s_pluginFileHandling;
@@ -88,7 +88,7 @@ void engine::init( const bool _has_gui )
initPluginFileHandling();
s_projectJournal = new projectJournal;
s_projectJournal = new ProjectJournal;
s_mixer = new mixer;
s_song = new song;
@@ -112,7 +112,7 @@ void engine::init( const bool _has_gui )
s_mergedResourceDB = unifiedResource->database();
s_fxMixer = new fxMixer;
s_fxMixer = new FxMixer;
s_bbTrackContainer = new bbTrackContainer;
s_ladspaManager = new ladspa2LMMS;
@@ -129,7 +129,7 @@ void engine::init( const bool _has_gui )
{
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 );
@@ -139,7 +139,7 @@ void engine::init( const bool _has_gui )
s_mainWindow->finalize();
}
s_dummyTC = new dummyTrackContainer;
s_dummyTC = new DummyTrackContainer;
s_mixer->startProcessing();
}
@@ -147,7 +147,7 @@ void engine::init( const bool _has_gui )
void engine::destroy( void )
void engine::destroy()
{
configManager::inst()->saveConfigFile();
@@ -167,7 +167,7 @@ void engine::destroy( void )
delete s_fxMixerView;
s_fxMixerView = NULL;
instrumentTrackView::cleanupWindowPool();
InstrumentTrackView::cleanupWindowPool();
s_song->clearProject();
delete s_bbTrackContainer;
@@ -202,7 +202,7 @@ void engine::destroy( void )
void engine::updateFramesPerTick( void )
void engine::updateFramesPerTick()
{
s_framesPerTick = s_mixer->processingSampleRate() * 60.0f * 4 /
DefaultTicksPerTact / s_song->getTempo();
@@ -211,15 +211,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 char * * suppFileTypes = it->supportedFileTypes;
while( suppFileTypes && *suppFileTypes != NULL )

View File

@@ -56,7 +56,7 @@
#include "config_mgr.h"
#include "embed.h"
#include "engine.h"
#include "import_filter.h"
#include "ImportFilter.h"
#include "MainWindow.h"
#include "ProjectRenderer.h"
#include "song.h"
@@ -461,8 +461,7 @@ int main( int argc, char * * argv )
}
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;

View File

@@ -35,7 +35,7 @@
#include "automation_recorder.h"
MidiController::MidiController( model * _parent ) :
MidiController::MidiController( Model * _parent ) :
Controller( Controller::MidiController, _parent, tr( "MIDI Controller" ) ),
MidiEventProcessor(),
m_midiPort( tr( "unnamed_midi_controller" ),

View File

@@ -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 ),

View File

@@ -25,14 +25,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"
@@ -196,14 +195,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;
@@ -576,7 +575,7 @@ sampleFrameA * 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();
@@ -626,7 +625,7 @@ sampleFrameA * mixer::renderNextBuffer()
// STAGE 4: do master mix in FX mixer
engine::getFxMixer()->masterMix( m_writeBuf );
engine::fxMixer()->masterMix( m_writeBuf );
unlock();
@@ -634,7 +633,7 @@ sampleFrameA * mixer::renderNextBuffer()
emit nextAudioBuffer();
// and trigger LFOs
envelopeAndLFOParameters::triggerLFO();
EnvelopeAndLfoParameters::triggerLfo();
Controller::triggerFrameCounter();
const float new_cpu_load = timer.elapsed() / 10000.0f *

View File

@@ -36,7 +36,7 @@
#include "config_mgr.h"
#include "project_version.h"
#include "song_editor.h"
#include "effect.h"
#include "Effect.h"
#include "lmmsversion.h"
@@ -606,28 +606,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 ) );
}
}

View File

@@ -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 ),

View File

@@ -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,
@@ -57,7 +56,7 @@ notePlayHandle::notePlayHandle( instrumentTrack * _it,
_n.getVolume(), _n.getPanning(), _n.detuning() ),
m_pluginData( NULL ),
m_filter( NULL ),
m_instrumentTrack( _it ),
m_InstrumentTrack( _it ),
m_frames( 0 ),
m_totalFramesPlayed( 0 ),
m_framesBeforeRelease( 0 ),
@@ -76,7 +75,7 @@ notePlayHandle::notePlayHandle( instrumentTrack * _it,
if( m_baseNote )
{
m_baseDetuning = new baseDetuning( detuning() );
m_instrumentTrack->m_processHandles.push_back( this );
m_InstrumentTrack->m_processHandles.push_back( this );
}
else
{
@@ -100,11 +99,11 @@ notePlayHandle::notePlayHandle( instrumentTrack * _it,
setFrames( _frames );
if( !isBaseNote() || !getInstrumentTrack()->arpeggiatorEnabled() )
if( !isBaseNote() || !instrumentTrack()->isArpeggiatorEnabled() )
{
// send MIDI-note-on-event
m_instrumentTrack->processOutEvent( midiEvent( MidiNoteOn,
m_instrumentTrack->midiPort()->realOutputChannel(),
m_InstrumentTrack->processOutEvent( midiEvent( MidiNoteOn,
m_InstrumentTrack->midiPort()->realOutputChannel(),
key(), getMidiVelocity() ),
midiTime::fromFrames( offset(),
engine::framesPerTick() ) );
@@ -121,17 +120,17 @@ notePlayHandle::~notePlayHandle()
if( m_baseNote )
{
delete m_baseDetuning;
m_instrumentTrack->m_processHandles.removeAll( this );
m_InstrumentTrack->m_processHandles.removeAll( this );
}
if( m_pluginData != NULL )
{
m_instrumentTrack->deleteNotePluginData( this );
m_InstrumentTrack->deleteNotePluginData( this );
}
if( m_instrumentTrack->m_notes[key()] == this )
if( m_InstrumentTrack->m_notes[key()] == this )
{
m_instrumentTrack->m_notes[key()] = NULL;
m_InstrumentTrack->m_notes[key()] = NULL;
}
for( NotePlayHandleList::Iterator it = m_subNotes.begin();
@@ -150,8 +149,8 @@ notePlayHandle::~notePlayHandle()
void notePlayHandle::setVolume( const volume_t _volume )
{
note::setVolume( _volume );
m_instrumentTrack->processOutEvent( midiEvent( MidiKeyPressure,
m_instrumentTrack->midiPort()->realOutputChannel(),
m_InstrumentTrack->processOutEvent( midiEvent( MidiKeyPressure,
m_InstrumentTrack->midiPort()->realOutputChannel(),
key(), getMidiVelocity() ), 0 );
}
@@ -162,9 +161,9 @@ void notePlayHandle::setVolume( const volume_t _volume )
int notePlayHandle::getMidiVelocity() const
{
int vel = getVolume();
if( m_instrumentTrack->getVolume() < DefaultVolume )
if( m_InstrumentTrack->getVolume() < DefaultVolume )
{
vel = ( vel * m_instrumentTrack->getVolume() ) / DefaultVolume;
vel = ( vel * m_InstrumentTrack->getVolume() ) / DefaultVolume;
}
return qMin( MidiMaxVelocity, vel * MidiMaxVelocity / DefaultVolume );
}
@@ -192,7 +191,7 @@ void notePlayHandle::play( sampleFrame * _working_buffer )
if( framesLeft() > 0 )
{
// play note!
m_instrumentTrack->playNote( this, _working_buffer );
m_InstrumentTrack->playNote( this, _working_buffer );
}
if( m_released )
@@ -300,7 +299,7 @@ f_cnt_t notePlayHandle::framesLeft() const
bool notePlayHandle::isFromTrack( const track * _track ) const
{
return m_instrumentTrack == _track || m_bbTrack == _track;
return m_InstrumentTrack == _track || m_bbTrack == _track;
}
@@ -323,13 +322,13 @@ void notePlayHandle::noteOff( const f_cnt_t _s )
// then set some variables indicating release-state
m_framesBeforeRelease = _s;
m_releaseFramesToDo = qMax<f_cnt_t>( 0, // 10,
m_instrumentTrack->m_soundShaping.releaseFrames() );
m_InstrumentTrack->m_soundShaping.releaseFrames() );
if( !isBaseNote() || !getInstrumentTrack()->arpeggiatorEnabled() )
if( !isBaseNote() || !instrumentTrack()->isArpeggiatorEnabled() )
{
// send MIDI-note-off-event
m_instrumentTrack->processOutEvent( midiEvent( MidiNoteOff,
m_instrumentTrack->midiPort()->realOutputChannel(),
m_InstrumentTrack->processOutEvent( midiEvent( MidiNoteOff,
m_InstrumentTrack->midiPort()->realOutputChannel(),
key(), 0 ),
midiTime::fromFrames( m_framesBeforeRelease,
engine::framesPerTick() ) );
@@ -343,7 +342,7 @@ void notePlayHandle::noteOff( const f_cnt_t _s )
f_cnt_t notePlayHandle::actualReleaseFramesToDo() const
{
return m_instrumentTrack->m_soundShaping.releaseFrames(/*
return m_InstrumentTrack->m_soundShaping.releaseFrames(/*
isArpeggioBaseNote()*/ );
}
@@ -355,7 +354,7 @@ void notePlayHandle::setFrames( const f_cnt_t _frames )
m_frames = _frames;
if( m_frames == 0 )
{
m_frames = m_instrumentTrack->beatLen( this );
m_frames = m_InstrumentTrack->beatLen( this );
}
m_origFrames = m_frames;
}
@@ -365,7 +364,7 @@ void notePlayHandle::setFrames( const f_cnt_t _frames )
float notePlayHandle::volumeLevel( const f_cnt_t _frame )
{
return m_instrumentTrack->m_soundShaping.volumeLevel( this, _frame );
return m_InstrumentTrack->m_soundShaping.volumeLevel( this, _frame );
}
@@ -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() );
}
@@ -405,7 +404,7 @@ int notePlayHandle::index() const
const notePlayHandle * nph =
dynamic_cast<const notePlayHandle *>( *it );
if( nph == NULL ||
nph->m_instrumentTrack != m_instrumentTrack ||
nph->m_InstrumentTrack != m_InstrumentTrack ||
nph->released() == true )
{
continue;
@@ -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;
@@ -433,7 +432,7 @@ ConstNotePlayHandleList notePlayHandle::nphsOfInstrumentTrack(
{
const notePlayHandle * nph =
dynamic_cast<const notePlayHandle *>( *it );
if( nph != NULL && nph->m_instrumentTrack == _it &&
if( nph != NULL && nph->m_InstrumentTrack == _it &&
( nph->released() == false || _all_ph == true ) )
{
cnphv.push_back( nph );
@@ -452,7 +451,7 @@ bool notePlayHandle::operator==( const notePlayHandle & _nph ) const
key() == _nph.key() &&
getVolume() == _nph.getVolume() &&
getPanning() == _nph.getPanning() &&
m_instrumentTrack == _nph.m_instrumentTrack &&
m_InstrumentTrack == _nph.m_InstrumentTrack &&
m_frames == _nph.m_frames &&
offset() == _nph.offset() &&
m_totalFramesPlayed == _nph.m_totalFramesPlayed &&
@@ -468,10 +467,10 @@ bool notePlayHandle::operator==( const notePlayHandle & _nph ) const
void notePlayHandle::updateFrequency()
{
const float pitch =
( key() - m_instrumentTrack->baseNoteModel()->value() +
( key() - m_InstrumentTrack->baseNoteModel()->value() +
engine::getSong()->masterPitch() ) / 12.0f;
m_frequency = BaseFreq * powf( 2.0f, pitch +
m_instrumentTrack->pitchModel()->value() / ( 100 * 12.0f ) );
m_InstrumentTrack->pitchModel()->value() / ( 100 * 12.0f ) );
m_unpitchedFrequency = BaseFreq * powf( 2.0f, pitch );
for( NotePlayHandleList::Iterator it = m_subNotes.begin();

View File

@@ -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 )
{
}

View File

@@ -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"

View File

@@ -41,19 +41,19 @@
#include "ControllerRackView.h"
#include "ControllerConnection.h"
#include "embed.h"
#include "envelope_and_lfo_parameters.h"
#include "EnvelopeAndLfoParameters.h"
#include "ExportProjectDialog.h"
#include "fx_mixer.h"
#include "fx_mixer_view.h"
#include "import_filter.h"
#include "instrument_track.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"
@@ -301,7 +301,7 @@ void song::processNextBuffer()
// at song-start we have to reset the LFOs
if( m_playPos[Mode_PlaySong] == 0 )
{
envelopeAndLFOParameters::resetLFO();
EnvelopeAndLfoParameters::resetLfo();
}
break;
@@ -721,7 +721,7 @@ automationPattern * song::tempoAutomationPattern()
void song::clearProject()
{
engine::getProjectJournal()->setJournalling( false );
engine::projectJournal()->setJournalling( false );
if( m_playing )
{
@@ -737,15 +737,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() )
{
@@ -772,9 +772,9 @@ void song::clearProject()
emit dataChanged();
engine::getProjectJournal()->clearJournal();
engine::projectJournal()->clearJournal();
engine::getProjectJournal()->setJournalling( true );
engine::projectJournal()->setJournalling( true );
}
@@ -804,17 +804,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 );
@@ -831,7 +831,7 @@ void song::createNewProject()
engine::getBBTrackContainer()->updateAfterTrackAdd();
engine::getProjectJournal()->setJournalling( true );
engine::projectJournal()->setJournalling( true );
QCoreApplication::sendPostedEvents();
@@ -870,7 +870,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;
@@ -910,18 +910,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() )
{
@@ -949,7 +947,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].
@@ -980,7 +978,7 @@ 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;
@@ -1012,14 +1010,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() );
}
@@ -1086,7 +1084,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 );
}
}

View File

@@ -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"

View File

@@ -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 "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.,
@@ -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 )
@@ -1163,7 +1163,7 @@ void trackContentWidget::resizeEvent( QResizeEvent * _re )
void trackContentWidget::updateBackground( void )
void trackContentWidget::updateBackground()
{
const int tactsPerBar = 4;
const trackContainerView * tcv = m_trackView->getTrackContainerView();
@@ -1188,7 +1188,7 @@ void trackContentWidget::updateBackground( void )
*
* \param _je the details of the edit journal
*/
void trackContentWidget::undoStep( journalEntry & _je )
void trackContentWidget::undoStep( JournalEntry & _je )
{
saveJournallingState( false );
switch( _je.actionID() )
@@ -1198,10 +1198,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;
@@ -1211,13 +1209,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;
}
}
@@ -1231,7 +1227,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() )
{
@@ -1256,9 +1252,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();
}
@@ -1270,11 +1266,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() ) );
}
@@ -1287,8 +1283,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 );
}
@@ -1443,7 +1438,7 @@ void trackOperationsWidget::paintEvent( QPaintEvent * _pe )
/*! \brief Clone this track
*
*/
void trackOperationsWidget::cloneTrack( void )
void trackOperationsWidget::cloneTrack()
{
engine::getMixer()->lock();
m_trackView->getTrack()->clone();
@@ -1456,7 +1451,7 @@ void trackOperationsWidget::cloneTrack( void )
/*! \brief Remove this track from the track list
*
*/
void trackOperationsWidget::removeTrack( void )
void trackOperationsWidget::removeTrack()
{
emit trackRemovalScheduled( m_trackView );
}
@@ -1469,7 +1464,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();
@@ -1480,10 +1475,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() );
}
}
@@ -1507,7 +1502,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 */
@@ -1560,7 +1555,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:
@@ -1573,7 +1568,7 @@ track * track::create( TrackTypes _tt, trackContainer * _tc )
_tc->updateAfterTrackAdd();
return( t );
return t;
}
@@ -1593,7 +1588,7 @@ track * track::create( const QDomElement & _this, trackContainer * _tc )
{
t->restoreState( _this );
}
return( t );
return t;
}
@@ -1602,7 +1597,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" );
@@ -1639,7 +1634,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 );
@@ -1781,9 +1776,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();
}
@@ -1805,11 +1800,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() );
}
@@ -1831,12 +1826,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;
}
@@ -1968,7 +1963,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;
@@ -1993,7 +1988,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();
@@ -2055,7 +2050,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 */
@@ -2136,7 +2131,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() )
@@ -2152,10 +2147,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();
}
@@ -2164,14 +2159,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();
}
@@ -2181,7 +2176,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() )
@@ -2213,9 +2208,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 );
}
@@ -2354,7 +2349,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 )

View File

@@ -29,15 +29,15 @@
#include <QtXml/QDomElement>
#include "track_container.h"
#include "instrument_track.h"
#include "InstrumentTrack.h"
#include "engine.h"
#include "MainWindow.h"
#include "song.h"
trackContainer::trackContainer( void ) :
model( NULL ),
journallingObject(),
trackContainer::trackContainer() :
Model( NULL ),
JournallingObject(),
m_tracksMutex(),
m_tracks()
{
@@ -184,14 +184,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() )
@@ -205,7 +205,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 )
@@ -223,15 +223,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 );
}

View File

@@ -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>
*
@@ -26,7 +26,7 @@
#include <QtGui/QMenu>
#include <QtGui/QMouseEvent>
#include "automatable_model_view.h"
#include "AutomatableModelView.h"
#include "automation_pattern.h"
#include "ControllerConnectionDialog.h"
#include "ControllerConnection.h"
@@ -36,57 +36,57 @@
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();
@@ -99,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" );
}
@@ -113,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,14 +132,14 @@ void automatableModelView::addDefaultActions( QMenu * _menu )
if( _model->armed() )
{
_menu->addAction( //embed::getIconPixmap( "controller" ),
automatableModel::tr( "de-arm" ),
AutomatableModel::tr( "de-arm" ),
amvSlots,
SLOT( deArm() ) );
}
else
{
_menu->addAction( //embed::getIconPixmap( "controller" ),
automatableModel::tr( "Arm for recording" ),
AutomatableModel::tr( "Arm for recording" ),
amvSlots,
SLOT( arm() ) );
}
@@ -148,16 +148,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 )
@@ -178,8 +178,8 @@ void automatableModelView::mousePressEvent( QMouseEvent * _me )
automatableModelViewSlots::automatableModelViewSlots(
automatableModelView * _amv,
AutomatableModelViewSlots::AutomatableModelViewSlots(
AutomatableModelView * _amv,
QObject * _parent ) :
QObject(),
amv( _amv )
@@ -192,11 +192,11 @@ 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(
@@ -236,9 +236,9 @@ void automatableModelViewSlots::execConnectionDialog( void )
void automatableModelViewSlots::removeConnection( void )
void AutomatableModelViewSlots::removeConnection()
{
automatableModel * m = amv->modelUntyped();
AutomatableModel * m = amv->modelUntyped();
if( m->getControllerConnection() )
{
@@ -250,23 +250,27 @@ void automatableModelViewSlots::removeConnection( void )
void automatableModelViewSlots::editSongGlobalAutomation( void )
void AutomatableModelViewSlots::editSongGlobalAutomation()
{
automationPattern::globalAutomationPattern( amv->modelUntyped() )->
openInAutomationEditor();
}
void automatableModelViewSlots::arm( void )
void AutomatableModelViewSlots::arm()
{
amv->modelUntyped()->setArmed( true );
}
void automatableModelViewSlots::deArm( void )
void AutomatableModelViewSlots::deArm()
{
amv->modelUntyped()->setArmed( false );
}
#include "moc_automatable_model_view.cxx"
#include "moc_AutomatableModelView.cxx"

View File

@@ -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 ),

View File

@@ -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 )
{
}

View File

@@ -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"

View File

@@ -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"

View File

@@ -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,9 +32,9 @@
#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 "MainWindow.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 )
@@ -77,8 +76,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() )
@@ -90,7 +89,7 @@ public:
private:
fxMixerView * m_mv;
FxMixerView * m_mv;
QString & m_name;
} ;
@@ -98,12 +97,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();
@@ -142,10 +141,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 );
@@ -153,7 +152,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 );
}
@@ -181,7 +180,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 )
@@ -242,14 +241,14 @@ fxMixerView::fxMixerView() :
fxMixerView::~fxMixerView()
FxMixerView::~FxMixerView()
{
}
void fxMixerView::saveSettings( QDomDocument & _doc, QDomElement & _this )
void FxMixerView::saveSettings( QDomDocument & _doc, QDomElement & _this )
{
MainWindow::saveWidgetState( this, _this );
}
@@ -257,7 +256,7 @@ void fxMixerView::saveSettings( QDomDocument & _doc, QDomElement & _this )
void fxMixerView::loadSettings( const QDomElement & _this )
void FxMixerView::loadSettings( const QDomElement & _this )
{
MainWindow::restoreWidgetState( this, _this );
}
@@ -265,7 +264,7 @@ void fxMixerView::loadSettings( const QDomElement & _this )
void fxMixerView::setCurrentFxLine( fxLine * _line )
void FxMixerView::setCurrentFxLine( FxLine * _line )
{
m_currentFxLine = _line;
for( int i = 0; i < NumFxChannels+1; ++i )
@@ -280,7 +279,7 @@ void fxMixerView::setCurrentFxLine( fxLine * _line )
void fxMixerView::setCurrentFxLine( int _line )
void FxMixerView::setCurrentFxLine( int _line )
{
if ( _line >= 0 && _line < NumFxChannels+1 )
{
@@ -293,7 +292,7 @@ void fxMixerView::setCurrentFxLine( int _line )
void fxMixerView::clear( void )
void FxMixerView::clear()
{
for( int i = 0; i <= NumFxChannels; ++i )
{
@@ -304,9 +303,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();
@@ -335,5 +334,5 @@ void fxMixerView::updateFaders( void )
#include "moc_fx_mixer_view.cxx"
#include "moc_FxMixerView.cxx"

View File

@@ -2,7 +2,7 @@
* 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
@@ -22,17 +22,16 @@
*
*/
#include "InstrumentView.h"
#include "embed.h"
#include "instrument.h"
#include "instrument_track.h"
#include "Instrument.h"
#include "InstrumentTrack.h"
#include "ResourceDB.h"
#include "string_pair_drag.h"
InstrumentView::InstrumentView( instrument * _instrument, QWidget * _parent ) :
pluginView( _instrument, _parent )
InstrumentView::InstrumentView( Instrument * _instrument, QWidget * _parent ) :
PluginView( _instrument, _parent )
{
setModel( _instrument );
setFixedSize( 250, 250 );
@@ -45,22 +44,22 @@ InstrumentView::InstrumentView( instrument * _instrument, QWidget * _parent ) :
InstrumentView::~InstrumentView()
{
if( getInstrumentTrackWindow() )
if( instrumentTrackWindow() )
{
getInstrumentTrackWindow()->m_instrumentView = NULL;
instrumentTrackWindow()->m_instrumentView = NULL;
}
}
void InstrumentView::setModel( ::model * _model, bool )
void InstrumentView::setModel( Model * _model, bool )
{
if( dynamic_cast<instrument *>( _model ) != NULL )
if( dynamic_cast<Instrument *>( _model ) != NULL )
{
modelView::setModel( _model );
getInstrumentTrackWindow()->setWindowIcon(
model()->getDescriptor()->logo->pixmap() );
ModelView::setModel( _model );
instrumentTrackWindow()->setWindowIcon(
model()->descriptor()->logo->pixmap() );
connect( model(), SIGNAL( destroyed( QObject * ) ),
this, SLOT( close() ) );
}
@@ -69,10 +68,10 @@ void InstrumentView::setModel( ::model * _model, bool )
instrumentTrackWindow * InstrumentView::getInstrumentTrackWindow( void )
InstrumentTrackWindow * InstrumentView::instrumentTrackWindow()
{
return dynamic_cast<instrumentTrackWindow *>(
parentWidget()->parentWidget() );
return dynamic_cast<InstrumentTrackWindow *>(
parentWidget()->parentWidget() );
}
@@ -86,7 +85,7 @@ void InstrumentView::dragEnterEvent( QDragEnterEvent * _dee )
engine::mergedResourceDB()->
itemByHash( stringPairDrag::decodeValue( _dee ) );
if( item &&
model()->getDescriptor()->supportsFileType(
model()->descriptor()->supportsFileType(
item->nameExtension() ) )
{
_dee->acceptProposedAction();

View File

@@ -41,9 +41,8 @@
#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;
@@ -81,7 +80,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:" ) + " ", "" );

View File

@@ -49,25 +49,25 @@
#include "piano_roll.h"
#include "embed.h"
#include "engine.h"
#include "fx_mixer_view.h"
#include "FxMixerView.h"
#include "AboutDialog.h"
#include "ControllerRackView.h"
#include "plugin_browser.h"
#include "side_bar.h"
#include "config_mgr.h"
#include "mixer.h"
#include "plugin_view.h"
#include "project_notes.h"
#include "setup_dialog.h"
#include "AudioDummy.h"
#include "tool.h"
#include "ToolPlugin.h"
#include "ToolPluginView.h"
#include "tool_button.h"
#include "project_journal.h"
#include "ProjectJournal.h"
#include "automation_editor.h"
#include "templates.h"
#include "lcd_spinbox.h"
#include "tooltip.h"
#include "meter_dialog.h"
#include "MeterDialog.h"
#include "automatable_slider.h"
#include "text_float.h"
#include "cpuload_widget.h"
@@ -168,10 +168,10 @@ 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;
}
@@ -268,17 +268,16 @@ void MainWindow::finalize()
m_toolsMenu = new QMenu( this );
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::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 ) );
}
}
@@ -536,7 +535,7 @@ void MainWindow::finalize()
timeSigLayout->setSpacing( 0 );
timeSigLayout->addSpacing( 3 );
m_timeSigDisplay = new meterDialog( this, true );
m_timeSigDisplay = new MeterDialog( this, true );
m_timeSigDisplay->setModel( &( engine::getSong()->m_timeSigModel ) );
timeSigLayout->addWidget( m_timeSigDisplay );
@@ -1142,7 +1141,7 @@ void MainWindow::toggleAutomationEditorWin()
void MainWindow::toggleFxMixerWin()
{
toggleWindow( engine::getFxMixerView() );
toggleWindow( engine::fxMixerView() );
}
@@ -1158,7 +1157,7 @@ void MainWindow::toggleControllerRack()
void MainWindow::undo()
{
engine::getProjectJournal()->undo();
engine::projectJournal()->undo();
}
@@ -1166,7 +1165,7 @@ void MainWindow::undo()
void MainWindow::redo()
{
engine::getProjectJournal()->redo();
engine::projectJournal()->redo();
}
@@ -1431,7 +1430,7 @@ void MainWindow::fillTemplatesMenu()
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();

View File

@@ -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"

View File

@@ -37,14 +37,13 @@
#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 )
{

View File

@@ -1,5 +1,5 @@
/*
* piano.cpp - implementation of piano-widget used in instrument-track-window
* 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>
@@ -36,8 +36,6 @@
* \todo write isWhite inline function and replace throughout
*/
#include "piano.h"
#include <QtGui/QCursor>
#include <QtGui/QKeyEvent>
@@ -46,12 +44,12 @@
#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 "MainWindow.h"
@@ -102,80 +100,6 @@ 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( MidiEventProcessor * _mep ) :
model( NULL ), /*!< base class ctor */
m_midiEvProc( _mep ) /*!< 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;
}
/*! \brief Create a new keyboard display view
*
* \param _parent the parent instrument plugin window
@@ -183,30 +107,26 @@ void Piano::handleKeyRelease( int _key )
*/
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 );
@@ -498,7 +418,7 @@ void PianoView::contextMenuEvent( QContextMenuEvent * _me )
}
captionMenu contextMenu( tr( "Base note" ) );
automatableModelView amv( m_piano->m_midiEvProc->baseNoteModel(),
AutomatableModelView amv( m_piano->m_midiEvProc->baseNoteModel(),
&contextMenu );
amv.addDefaultActions( &contextMenu );
contextMenu.exec( QCursor::pos() );
@@ -1021,5 +941,5 @@ void PianoView::paintEvent( QPaintEvent * )
#include "moc_piano.cxx"
#include "moc_PianoView.cxx"

View File

@@ -36,7 +36,8 @@
#include "engine.h"
#include "embed.h"
#include "MainWindow.h"
#include "piano.h"
#include "Piano.h"
#include "PianoView.h"
#include "song.h"

View File

@@ -1,8 +1,9 @@
/*
* tool.cpp - base class for all tool plugins (graphs, extensions, etc)
* 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
@@ -22,8 +23,8 @@
*
*/
#include "tool.h"
#include "ToolPlugin.h"
#include "ToolPluginView.h"
#include <QtGui/QIcon>
#include <QtGui/QMdiArea>
@@ -33,50 +34,14 @@
#include "MainWindow.h"
tool::tool( const descriptor * _descriptor, model * _parent ) :
plugin( _descriptor, _parent )
{
}
tool::~tool()
{
}
tool * tool::instantiate( const QString & _plugin_name, model * _parent )
{
plugin * p = plugin::instantiate( _plugin_name, _parent, NULL );
// check whether instantiated plugin is a tool
if( p->type() == Tool )
{
// everything ok, so return pointer
return( dynamic_cast<tool *>( p ) );
}
// not quite... so delete plugin
delete p;
return( NULL );
}
toolView::toolView( tool * _tool ) :
pluginView( _tool, NULL )
ToolPluginView::ToolPluginView( ToolPlugin * _toolPlugin ) :
PluginView( _toolPlugin, NULL )
{
engine::mainWindow()->workspace()->addSubWindow( this );
parentWidget()->setAttribute( Qt::WA_DeleteOnClose, FALSE );
parentWidget()->setAttribute( Qt::WA_DeleteOnClose, false );
setWindowTitle( _tool->displayName() );
setWindowIcon( _tool->getDescriptor()->logo->pixmap() );
setWindowTitle( _toolPlugin->displayName() );
setWindowIcon( _toolPlugin->descriptor()->logo->pixmap() );
}

View File

@@ -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();
}
}
@@ -314,9 +314,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 );

View File

@@ -37,7 +37,7 @@
#include "embed.h"
#include "bb_track.h"
#include "pattern.h"
#include "instrument_track.h"
#include "InstrumentTrack.h"
@@ -575,7 +575,7 @@ void ClassicStyle::drawTrackContentObject( QPainter * _painter,
p->setPen( QColor( 32, 240, 32 ) );
}
if( pat->name() != pat->getInstrumentTrack()->name() )
if( pat->name() != pat->instrumentTrack()->name() )
{
p->drawText( 2, p->fontMetrics().height() - 1, pat->name() );
}

View File

@@ -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 "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"
@@ -138,7 +135,7 @@ pianoRoll::KeyTypes pianoRoll::s_keyOrder[] =
pianoRoll::pianoRoll( void ) :
pianoRoll::pianoRoll() :
m_nemStr( QVector<QString>() ),
m_noteEditMenu( NULL ),
m_signalMapper( NULL ),
@@ -451,7 +448,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",
@@ -460,12 +457,12 @@ pianoRoll::pianoRoll( void ) :
for( int i = 0; i < NumEvenLengths; ++i )
{
m_noteLenModel.addItem( "1/" + QString::number( 1 << i ),
new pixmapLoader( "note_" + pixmaps[i] ) );
new PixmapLoader( "note_" + pixmaps[i] ) );
}
for( int i = 0; i < NumTripletLengths; ++i )
{
m_noteLenModel.addItem( "1/" + QString::number( (1 << i) * 3 ),
new pixmapLoader( "note_" + pixmaps[i+NumEvenLengths] ) );
new PixmapLoader( "note_" + pixmaps[i+NumEvenLengths] ) );
}
m_noteLenModel.setValue( 0 );
m_noteLenComboBox = new comboBox( m_toolBar );
@@ -557,7 +554,7 @@ void pianoRoll::setCurrentPattern( pattern * _new_pattern )
{
if( validPattern() )
{
m_pattern->getInstrumentTrack()->disconnect( this );
m_pattern->instrumentTrack()->disconnect( this );
}
m_pattern = _new_pattern;
@@ -605,10 +602,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 & ) ) );
@@ -754,7 +751,7 @@ inline void pianoRoll::drawDetuningInfo( QPainter & _p, note * _n, int _x,
void pianoRoll::removeSelection( void )
void pianoRoll::removeSelection()
{
m_selectStartTick = 0;
m_selectedTick = 0;
@@ -767,7 +764,7 @@ void pianoRoll::removeSelection( void )
void pianoRoll::clearSelectedNotes( void )
void pianoRoll::clearSelectedNotes()
{
if( m_pattern != NULL )
{
@@ -864,7 +861,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();
@@ -881,7 +878,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;
@@ -909,7 +906,7 @@ void pianoRoll::keyPressEvent( QKeyEvent * _ke )
if( _ke->isAutoRepeat() == false && key_num > -1 )
{
m_pattern->getInstrumentTrack()->
m_pattern->instrumentTrack()->
pianoModel()->handleKeyPress( key_num );
}
}
@@ -1215,7 +1212,7 @@ void pianoRoll::keyReleaseEvent( QKeyEvent * _ke )
if( _ke->isAutoRepeat() == false && key_num > -1 )
{
m_pattern->getInstrumentTrack()->
m_pattern->instrumentTrack()->
pianoModel()->handleKeyRelease( key_num );
}
}
@@ -1616,7 +1613,7 @@ void pianoRoll::mousePressEvent( QMouseEvent * _me )
if( ! m_recording && ! engine::getSong()->isPlaying() )
{
int v = ( (float) x ) / ( (float) WhiteKeyWidth ) * 127;
m_pattern->getInstrumentTrack()->processInEvent(
m_pattern->instrumentTrack()->processInEvent(
midiEvent( MidiNoteOn, 0, key_num, v ),
midiTime() );
}
@@ -1671,7 +1668,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() );
@@ -1679,7 +1676,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() );
}
}
@@ -1697,7 +1694,7 @@ void pianoRoll::pauseTestNotes( bool _pause )
if( _pause )
{
// stop note
m_pattern->getInstrumentTrack()->
m_pattern->instrumentTrack()->
processInEvent(
midiEvent( MidiNoteOff, 0,
( *it )->key(), 0 ),
@@ -1721,7 +1718,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() );
@@ -1729,7 +1726,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() );
@@ -1871,7 +1868,7 @@ void pianoRoll::mouseReleaseEvent( QMouseEvent * _me )
{
if( ( *it )->isPlaying() )
{
m_pattern->getInstrumentTrack()->
m_pattern->instrumentTrack()->
processInEvent(
midiEvent( MidiNoteOff, 0,
( *it )->key(), 0 ),
@@ -1883,7 +1880,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() );
@@ -2041,7 +2038,7 @@ void pianoRoll::mouseMoveEvent( QMouseEvent * _me )
if( m_noteEditMode == NoteEditVolume )
{
( *it )->setVolume( vol );
m_pattern->getInstrumentTrack()->processInEvent(
m_pattern->instrumentTrack()->processInEvent(
midiEvent(
MidiKeyPressure,
0,
@@ -2055,7 +2052,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() );
}
}
@@ -2064,7 +2061,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() );
@@ -2993,7 +2990,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() )
@@ -3006,7 +3003,7 @@ song::PlayModes pianoRoll::desiredPlayModeForAccompany( void ) const
void pianoRoll::play( void )
void pianoRoll::play()
{
engine::mainWindow()->setPlaybackMode( PPM_PianoRoll );
@@ -3045,7 +3042,7 @@ void pianoRoll::play( void )
void pianoRoll::record( void )
void pianoRoll::record()
{
engine::mainWindow()->setPlaybackMode( PPM_PianoRoll );
@@ -3066,7 +3063,7 @@ void pianoRoll::record( void )
void pianoRoll::recordAccompany( void )
void pianoRoll::recordAccompany()
{
engine::mainWindow()->setPlaybackMode( PPM_PianoRoll );
@@ -3095,7 +3092,7 @@ void pianoRoll::recordAccompany( void )
void pianoRoll::stop( void )
void pianoRoll::stop()
{
engine::getSong()->stop();
m_playButton->setIcon( embed::getIconPixmap( "play" ) );
@@ -3185,7 +3182,7 @@ void pianoRoll::verScrolled( int _new_pos )
void pianoRoll::drawButtonToggled( void )
void pianoRoll::drawButtonToggled()
{
m_editMode = ModeDraw;
update();
@@ -3194,7 +3191,7 @@ void pianoRoll::drawButtonToggled( void )
void pianoRoll::eraseButtonToggled( void )
void pianoRoll::eraseButtonToggled()
{
m_editMode = ModeErase;
update();
@@ -3203,7 +3200,7 @@ void pianoRoll::eraseButtonToggled( void )
void pianoRoll::selectButtonToggled( void )
void pianoRoll::selectButtonToggled()
{
m_editMode = ModeSelect;
update();
@@ -3211,7 +3208,7 @@ void pianoRoll::selectButtonToggled( void )
void pianoRoll::detuneButtonToggled( void )
void pianoRoll::detuneButtonToggled()
{
m_editMode = ModeEditDetuning;
update();
@@ -3219,7 +3216,7 @@ void pianoRoll::detuneButtonToggled( void )
void pianoRoll::selectAll( void )
void pianoRoll::selectAll()
{
if( validPattern() == false )
{
@@ -3316,7 +3313,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 );
}
@@ -3324,7 +3321,7 @@ void pianoRoll::copy_to_clipboard( const NoteVector & _notes ) const
void pianoRoll::copySelectedNotes( void )
void pianoRoll::copySelectedNotes()
{
NoteVector selected_notes;
getSelectedNotes( selected_notes );
@@ -3338,7 +3335,7 @@ void pianoRoll::copySelectedNotes( void )
void pianoRoll::cutSelectedNotes( void )
void pianoRoll::cutSelectedNotes()
{
if( validPattern() == false )
{
@@ -3370,7 +3367,7 @@ void pianoRoll::cutSelectedNotes( void )
void pianoRoll::pasteNotes( void )
void pianoRoll::pasteNotes()
{
if( validPattern() == false )
{
@@ -3379,7 +3376,7 @@ void pianoRoll::pasteNotes( void )
QString value = QApplication::clipboard()
->mimeData( QClipboard::Clipboard )
->data( clipboard::mimeType() );
->data( Clipboard::mimeType() );
if( !value.isEmpty() )
{
@@ -3418,7 +3415,7 @@ void pianoRoll::pasteNotes( void )
void pianoRoll::deleteSelectedNotes( void )
void pianoRoll::deleteSelectedNotes()
{
if( validPattern() == false )
{
@@ -3521,7 +3518,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() * DefaultPixelsPerTact / 100;
@@ -3536,7 +3533,7 @@ void pianoRoll::zoomingChanged( void )
void pianoRoll::quantizeChanged( void )
void pianoRoll::quantizeChanged()
{
if( m_quantizeModel.value() == 0 &&
m_noteLenModel.value() == 0 )
@@ -3549,7 +3546,7 @@ void pianoRoll::quantizeChanged( void )
}
int pianoRoll::quantization( void ) const
int pianoRoll::quantization() const
{
if( m_quantizeModel.value() == 0 )
{
@@ -3563,7 +3560,7 @@ int pianoRoll::quantization( void ) const
midiTime pianoRoll::newNoteLen( void ) const
midiTime pianoRoll::newNoteLen() const
{
if( m_noteLenModel.value() == 0 )
{
@@ -3577,7 +3574,7 @@ midiTime pianoRoll::newNoteLen( void ) const
bool pianoRoll::mouseOverNote( void )
bool pianoRoll::mouseOverNote()
{
return validPattern() && noteUnderMouse() != NULL;
}
@@ -3585,7 +3582,7 @@ bool pianoRoll::mouseOverNote( void )
note * pianoRoll::noteUnderMouse( void )
note * pianoRoll::noteUnderMouse()
{
QPoint pos = mapFromGlobal( QCursor::pos() );

View File

@@ -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() )
{

View File

@@ -40,7 +40,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"
@@ -136,7 +136,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 );
@@ -739,7 +739,7 @@ setupDialog::setupDialog( ConfigTabs _tab_to_open ) :
setupDialog::~setupDialog()
{
engine::getProjectJournal()->setJournalling( true );
engine::projectJournal()->setJournalling( true );
}

View File

@@ -33,7 +33,7 @@
#include "setup_dialog.h"
#include "setup_dialog_mcl.h"
#include "piano.h"
#include "PianoView.h"
setupDialogMCL::setupDialogMCL( setupDialog * _parent ) :

View File

@@ -40,11 +40,9 @@
#include "bb_track.h"
#include "MainWindow.h"
#include "debug.h"
#include "import_filter.h"
#include "instrument.h"
#include "instrument_track.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"
@@ -54,9 +52,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(),
@@ -128,7 +126,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 );
@@ -152,7 +150,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 );
@@ -215,7 +213,7 @@ void trackContainerView::moveTrackViewDown( trackView * _tv )
void trackContainerView::realignTracks( void )
void trackContainerView::realignTracks()
{
QWidget * content = m_scrollArea->widget();
content->setFixedWidth( width()
@@ -276,7 +274,7 @@ const trackView * trackContainerView::trackViewAt( const int _y ) const
bool trackContainerView::allowRubberband( void ) const
bool trackContainerView::allowRubberband() const
{
return( false );
}
@@ -292,7 +290,7 @@ void trackContainerView::setPixelsPerTact( int _ppt )
void trackContainerView::clearAllTracks( void )
void trackContainerView::clearAllTracks()
{
while( !m_trackViews.empty() )
{
@@ -306,7 +304,7 @@ void trackContainerView::clearAllTracks( void )
void trackContainerView::undoStep( journalEntry & _je )
void trackContainerView::undoStep( JournalEntry & _je )
{
#if 0
saveJournallingState( false );
@@ -317,7 +315,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 );
@@ -344,7 +342,7 @@ void trackContainerView::undoStep( journalEntry & _je )
void trackContainerView::redoStep( journalEntry & _je )
void trackContainerView::redoStep( JournalEntry & _je )
{
#if 0
switch( _je.actionID() )
@@ -384,7 +382,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 );
@@ -412,13 +410,13 @@ void trackContainerView::dropEvent( QDropEvent * _de )
case ResourceItem::TypePreset:
action.loadPreset(
dynamic_cast<instrumentTrack *>(
dynamic_cast<InstrumentTrack *>(
track::create( track::InstrumentTrack, m_tc ) ) );
break;
case ResourceItem::TypeSample:
case ResourceItem::TypePluginSpecificResource:
action.loadByPlugin(
dynamic_cast<instrumentTrack *>(
dynamic_cast<InstrumentTrack *>(
track::create( track::InstrumentTrack, m_tc ) ) );
break;
case ResourceItem::TypeForeignProject:

View File

@@ -40,16 +40,15 @@
#include "led_checkbox.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 );
@@ -94,28 +93,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;
}
@@ -132,7 +131,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>();
@@ -142,7 +141,7 @@ void ControllerView::paintEvent( QPaintEvent * )
p.setPen( palette().text().color() );
p.drawText( 6, 12, c->displayName() );
f.setBold( FALSE );
f.setBold( false );
p.setFont( f );
p.drawText( 8, 26, c->name() );
}
@@ -166,7 +165,7 @@ void ControllerView::mouseDoubleClickEvent( QMouseEvent * event )
void ControllerView::modelChanged( void )
void ControllerView::modelChanged()
{
}
@@ -174,17 +173,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() ) );
@@ -198,7 +187,7 @@ void ControllerView::contextMenuEvent( QContextMenuEvent * )
void ControllerView::displayHelp( void )
void ControllerView::displayHelp()
{
QWhatsThis::showText( mapToGlobal( rect().center() ),
whatsThis() );

View File

@@ -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"

View File

@@ -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 "MainWindow.h"
#include "tempo_sync_knob.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,7 +97,7 @@ 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::mainWindow()->workspace()->addSubWindow(
@@ -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.drawText( 6, 55, model()->displayName() );
p.setPen( palette().text().color() );
p.drawText( 5, 54, getModel()->displayName() );
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"

View File

@@ -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;
@@ -80,20 +75,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 )
{
@@ -199,7 +193,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:" ) + " ", "" );
@@ -306,7 +300,7 @@ envelopeAndLFOView::envelopeAndLFOView( QWidget * _parent ) :
envelopeAndLFOView::~envelopeAndLFOView()
EnvelopeAndLfoView::~EnvelopeAndLfoView()
{
delete m_lfoWaveBtnGrp;
}
@@ -314,9 +308,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 );
@@ -336,7 +330,7 @@ void envelopeAndLFOView::modelChanged( void )
void envelopeAndLFOView::mousePressEvent( QMouseEvent * _me )
void EnvelopeAndLfoView::mousePressEvent( QMouseEvent * _me )
{
if( _me->button() != Qt::LeftButton )
{
@@ -372,7 +366,7 @@ void envelopeAndLFOView::mousePressEvent( QMouseEvent * _me )
void envelopeAndLFOView::dragEnterEvent( QDragEnterEvent * _dee )
void EnvelopeAndLfoView::dragEnterEvent( QDragEnterEvent * _dee )
{
stringPairDrag::processDragEnterEvent( _dee,
QString( "samplefile,tco_%1" ).arg(
@@ -382,7 +376,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 );
@@ -407,7 +401,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 * )
oscFrames;
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"

View File

@@ -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"

View File

@@ -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>();

View File

@@ -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"

View File

@@ -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"

View File

@@ -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() );
}

View File

@@ -29,7 +29,7 @@
MidiPortMenu::MidiPortMenu( MidiPort::Modes _mode ) :
modelView( NULL, this ),
ModelView( NULL, this ),
m_mode( _mode )
{
setFont( pointSize<9>( font() ) );

View File

@@ -41,7 +41,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 );
@@ -63,7 +63,7 @@ automatableButton::~automatableButton()
void automatableButton::modelChanged( void )
void automatableButton::modelChanged()
{
if( QPushButton::isChecked() != model()->value() )
{
@@ -74,7 +74,7 @@ void automatableButton::modelChanged( void )
void automatableButton::update( void )
void automatableButton::update()
{
if( QPushButton::isChecked() != model()->value() )
{
@@ -130,7 +130,7 @@ void automatableButton::mousePressEvent( QMouseEvent * _me )
if( m_group )
{
// A group, we must get process it instead
automatableModelView* groupView = (automatableModelView*)m_group;
AutomatableModelView* groupView = (AutomatableModelView*)m_group;
new stringPairDrag( "automatable_model",
QString::number( groupView->modelUntyped()->id() ),
QPixmap(), widget() );
@@ -140,7 +140,7 @@ void automatableButton::mousePressEvent( QMouseEvent * _me )
else
{
// Otherwise, drag the standalone button
automatableModelView::mousePressEvent( _me );
BoolModelView::mousePressEvent( _me );
QPushButton::mousePressEvent( _me );
}
}
@@ -160,11 +160,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 );
}
@@ -185,7 +185,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 );
@@ -209,11 +209,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 );
@@ -248,18 +248,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;

View File

@@ -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>
@@ -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() );
}

View File

@@ -51,26 +51,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() ) );
@@ -116,7 +113,7 @@ void comboBox::mousePressEvent( QMouseEvent * _me )
{
if( _me->x() > width() - CB_ARROW_BTN_WIDTH )
{
m_pressed = TRUE;
m_pressed = true;
update();
m_menu.clear();
@@ -142,7 +139,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 )
@@ -158,7 +155,7 @@ void comboBox::mousePressEvent( QMouseEvent * _me )
}
else
{
automatableModelView::mousePressEvent( _me );
IntModelView::mousePressEvent( _me );
}
}

View File

@@ -57,9 +57,9 @@
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 );
}
}

View File

@@ -23,7 +23,6 @@
*
*/
#include <QtGui/QPaintEvent>
#include <QtGui/QFontMetrics>
#include <QtGui/QPainter>
@@ -31,26 +30,21 @@
#include "graph.h"
#include "string_pair_drag.h"
#include "sample_buffer.h"
#include "oscillator.h"
#include "Oscillator.h"
#include "engine.h"
//#include <cstdlib>
//#include <math.h>
using namespace std;
graph::graph( QWidget * _parent, graphStyle _style ) :
QWidget( _parent ),
/* TODO: size, background? */
modelView( new graphModel( -1.0, 1.0, 128, NULL, TRUE ), this ),
ModelView( new graphModel( -1.0, 1.0, 128, NULL, true ), this ),
m_graphStyle( _style )
{
m_mouseDown = false;
m_graphColor = engine::getLmmsStyle()->color(LmmsStyle::StandardGraphLine);
resize( 132, 104 );
setAcceptDrops( TRUE );
setAcceptDrops( true );
setCursor( Qt::CrossCursor );
graphModel * gModel = castModel<graphModel>();
@@ -126,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 );
@@ -238,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++ )
{
@@ -256,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;
@@ -315,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();
}
@@ -323,7 +317,7 @@ void graph::dragEnterEvent( QDragEnterEvent * _dee )
void graph::modelChanged( void )
void graph::modelChanged()
{
graphModel * gModel = castModel<graphModel>();
@@ -342,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 ),
@@ -425,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() ) );
}
@@ -438,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() ) );
}
@@ -451,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() ) );
}
@@ -464,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() ) );
}
@@ -477,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() ) );
}
@@ -490,7 +484,7 @@ void graphModel::setWaveToNoise( void )
void graphModel::smooth( void )
void graphModel::smooth()
{
// store values in temporary array
QVector<float> temp = m_samples;
@@ -507,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++ )

View File

@@ -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 );

View File

@@ -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,7 +35,7 @@
#endif
#include <math.h>
#include "knob.h"
#include "caption_menu.h"
#include "config_mgr.h"
#include "ControllerConnection.h"
@@ -46,7 +43,7 @@
#include "engine.h"
#include "gui_templates.h"
#include "MainWindow.h"
#include "project_journal.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 )
{
@@ -140,7 +137,7 @@ void knob::setTotalAngle( float _angle )
float knob::innerRadius( void ) const
float knob::innerRadius() const
{
return m_innerRadius;
}
@@ -154,7 +151,7 @@ void knob::setInnerRadius( float _r )
float knob::outerRadius( void ) const
float knob::outerRadius() const
{
return m_outerRadius;
}
@@ -168,14 +165,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();
}
@@ -189,7 +186,7 @@ void knob::setCenterPointX( float _c )
float knob::centerPointY( void ) const
float knob::centerPointY() const
{
return m_centerPoint.y();
}
@@ -203,7 +200,7 @@ void knob::setCenterPointY( float _c )
float knob::lineWidth( void ) const
float knob::lineWidth() const
{
return m_lineWidth;
}
@@ -217,7 +214,7 @@ void knob::setLineWidth( float _w )
QColor knob::outerColor( void ) const
QColor knob::outerColor() const
{
if( m_outerColor )
{
@@ -258,7 +255,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() )
@@ -272,9 +269,9 @@ bool knob::updateAngle( void )
if( qAbs( angle - m_angle ) > 3 )
{
m_angle = angle;
return( TRUE );
return true;
}
return( FALSE );
return false;
}
@@ -282,7 +279,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;
@@ -376,8 +373,8 @@ float knob::getValue( const QPoint & _p )
{
if( engine::mainWindow()->isShiftPressed() )
{
//return( ( _p.y() - m_origMousePos.y() ) * model()->step<float>() );
return( ( _p.y() - m_origMousePos.y() ) * pageSize() );
//return ( _p.y() - m_origMousePos.y() ) * model()->step<float>();
return ( _p.y() - m_origMousePos.y() ) * pageSize();
}
else
{
@@ -428,12 +425,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() );
}
}
@@ -460,10 +457,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::mainWindow()->isShiftPressed() == TRUE )
engine::mainWindow()->isShiftPressed() == true )
{
new stringPairDrag( "float_value",
QString::number( model()->value() ),
@@ -471,7 +468,7 @@ void knob::mousePressEvent( QMouseEvent * _me )
}
else
{
automatableModelView::mousePressEvent( _me );
FloatModelView::mousePressEvent( _me );
}
}
@@ -480,7 +477,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() );
@@ -497,7 +494,7 @@ void knob::mouseReleaseEvent( QMouseEvent * /* _me*/ )
{
model()->addJournalEntryFromOldToCurVal();
m_buttonPressed = FALSE;
m_buttonPressed = false;
m_mouseOffset = 0;
emit sliderReleased();
@@ -590,7 +587,7 @@ void knob::setPosition( const QPoint & _p )
void knob::enterValue( void )
void knob::enterValue()
{
bool ok;
float new_val;
@@ -634,11 +631,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();
@@ -648,23 +645,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 )
{
@@ -679,7 +676,7 @@ void knob::doConnections( void )
void knob::displayHelp( void )
void knob::displayHelp()
{
QWhatsThis::showText( mapToGlobal( rect().bottomRight() ),
whatsThis() );

View File

@@ -45,7 +45,7 @@
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 );
}
}

View File

@@ -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 "MainWindow.h"
#include "meter_dialog.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::mainWindow()->workspace() );
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"

View File

@@ -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 )
{

View File

@@ -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>
@@ -41,25 +41,25 @@
#include "ResourceAction.h"
#include "ResourceDB.h"
#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 "fx_mixer.h"
#include "fx_mixer_view.h"
#include "instrument_sound_shaping.h"
#include "instrument_sound_shaping_view.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 "MainWindow.h"
@@ -68,7 +68,7 @@
#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"
@@ -90,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(),
@@ -132,7 +132,7 @@ instrumentTrack::instrumentTrack( trackContainer * _tc ) :
instrumentTrack::~instrumentTrack()
InstrumentTrack::~InstrumentTrack()
{
// kill all running notes
silenceAllNotes();
@@ -146,7 +146,7 @@ instrumentTrack::~instrumentTrack()
void instrumentTrack::processAudioBuffer( sampleFrame * _buf,
void InstrumentTrack::processAudioBuffer( sampleFrame * _buf,
const fpp_t _frames,
notePlayHandle * _n )
{
@@ -158,7 +158,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;
@@ -198,7 +198,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 )
@@ -217,7 +217,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();
@@ -340,7 +340,7 @@ void instrumentTrack::processInEvent( const midiEvent & _me,
void instrumentTrack::processOutEvent( const midiEvent & _me,
void InstrumentTrack::processOutEvent( const midiEvent & _me,
const midiTime & _time )
{
int k;
@@ -410,7 +410,7 @@ void instrumentTrack::processOutEvent( const midiEvent & _me,
void instrumentTrack::silenceAllNotes()
void InstrumentTrack::silenceAllNotes()
{
engine::getMixer()->lock();
for( int i = 0; i < NumKeys; ++i )
@@ -429,7 +429,7 @@ void instrumentTrack::silenceAllNotes()
f_cnt_t instrumentTrack::beatLen( notePlayHandle * _n ) const
f_cnt_t InstrumentTrack::beatLen( notePlayHandle * _n ) const
{
if( m_instrument != NULL )
{
@@ -445,7 +445,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
@@ -463,7 +463,7 @@ void instrumentTrack::playNote( notePlayHandle * _n,
QString instrumentTrack::instrumentName( void ) const
QString InstrumentTrack::instrumentName() const
{
if( m_instrument != NULL )
{
@@ -475,7 +475,7 @@ QString instrumentTrack::instrumentName( void ) const
void instrumentTrack::deleteNotePluginData( notePlayHandle * _n )
void InstrumentTrack::deleteNotePluginData( notePlayHandle * _n )
{
if( m_instrument != NULL )
{
@@ -499,7 +499,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
@@ -524,7 +524,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();
@@ -538,7 +538,7 @@ void instrumentTrack::updateBaseNote( void )
void instrumentTrack::updatePitch( void )
void InstrumentTrack::updatePitch()
{
updateBaseNote();
processOutEvent( midiEvent( MidiPitchBend,
@@ -549,7 +549,7 @@ void instrumentTrack::updatePitch( void )
void instrumentTrack::updatePitchRange( void )
void InstrumentTrack::updatePitchRange()
{
const int r = m_pitchRangeModel.value();
m_pitchModel.setRange( -100 * r, 100 * r );
@@ -558,7 +558,7 @@ void instrumentTrack::updatePitchRange( void )
int instrumentTrack::masterKey( int _midi_key ) const
int InstrumentTrack::masterKey( int _midi_key ) const
{
int key = baseNoteModel()->value() - engine::getSong()->masterPitch();
return tLimit<int>( _midi_key - ( key - DefaultKey ), 0, NumKeys );
@@ -567,7 +567,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 ) );
@@ -576,7 +576,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 )
@@ -701,7 +701,7 @@ bool instrumentTrack::play( const midiTime & _start,
trackContentObject * instrumentTrack::createTCO( const midiTime & )
trackContentObject * InstrumentTrack::createTCO( const midiTime & )
{
return new pattern( this );
}
@@ -709,15 +709,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" );
@@ -731,7 +731,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 );
}
@@ -739,13 +739,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();
@@ -785,7 +785,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() )
@@ -808,17 +808,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(
@@ -835,7 +833,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() )
@@ -854,13 +852,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();
@@ -875,11 +873,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 ),
@@ -961,9 +959,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() ) );
@@ -975,7 +973,7 @@ instrumentTrackView::instrumentTrackView( instrumentTrack * _it,
instrumentTrackView::~instrumentTrackView()
InstrumentTrackView::~InstrumentTrackView()
{
freeInstrumentTrackWindow();
@@ -989,7 +987,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 )
{
@@ -999,7 +997,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 );
@@ -1016,7 +1014,7 @@ void instrumentTrackView::freeInstrumentTrackWindow( void )
void instrumentTrackView::cleanupWindowPool( void )
void InstrumentTrackView::cleanupWindowPool()
{
while( s_windows.count() )
{
@@ -1027,7 +1025,7 @@ void instrumentTrackView::cleanupWindowPool( void )
instrumentTrackWindow * instrumentTrackView::getInstrumentTrackWindow( void )
InstrumentTrackWindow * InstrumentTrackView::getInstrumentTrackWindow()
{
if( m_window != NULL )
{
@@ -1048,7 +1046,7 @@ instrumentTrackWindow * instrumentTrackView::getInstrumentTrackWindow( void )
}
else
{
m_window = new instrumentTrackWindow( this );
m_window = new InstrumentTrackWindow( this );
}
return m_window;
@@ -1057,9 +1055,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 );
@@ -1069,7 +1067,7 @@ void instrumentTrackView::dragEnterEvent( QDragEnterEvent * _dee )
void instrumentTrackView::dropEvent( QDropEvent * _de )
void InstrumentTrackView::dropEvent( QDropEvent * _de )
{
getInstrumentTrackWindow()->dropEvent( _de );
trackView::dropEvent( _de );
@@ -1078,7 +1076,7 @@ void instrumentTrackView::dropEvent( QDropEvent * _de )
void instrumentTrackView::toggleInstrumentWindow( bool _on )
void InstrumentTrackView::toggleInstrumentWindow( bool _on )
{
getInstrumentTrackWindow()->toggleVisibility( _on );
@@ -1091,7 +1089,7 @@ void instrumentTrackView::toggleInstrumentWindow( bool _on )
void instrumentTrackView::activityIndicatorPressed( void )
void InstrumentTrackView::activityIndicatorPressed()
{
model()->processInEvent(
midiEvent( MidiNoteOn, 0, DefaultKey, MidiMaxVelocity ),
@@ -1101,7 +1099,7 @@ void instrumentTrackView::activityIndicatorPressed( void )
void instrumentTrackView::activityIndicatorReleased( void )
void InstrumentTrackView::activityIndicatorReleased()
{
model()->processInEvent( midiEvent( MidiNoteOff, 0, DefaultKey, 0 ),
midiTime() );
@@ -1111,7 +1109,7 @@ void instrumentTrackView::activityIndicatorReleased( void )
void instrumentTrackView::midiInSelected( void )
void InstrumentTrackView::midiInSelected()
{
if( model() )
{
@@ -1123,7 +1121,7 @@ void instrumentTrackView::midiInSelected( void )
void instrumentTrackView::midiOutSelected( void )
void InstrumentTrackView::midiOutSelected()
{
if( model() )
{
@@ -1135,7 +1133,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() );
@@ -1159,8 +1157,8 @@ public:
protected:
virtual void mouseDoubleClickEvent ( QMouseEvent * _me )
{
engine::getFxMixerView()->setCurrentFxLine( model()->value() );
//engine::getFxMixerView()->raise();
engine::fxMixerView()->setCurrentFxLine( model()->value() );
//engine::fxMixerView()->raise();
}
} ;
@@ -1168,9 +1166,9 @@ protected:
// #### 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 )
@@ -1256,14 +1254,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 );
@@ -1299,7 +1297,7 @@ instrumentTrackWindow::instrumentTrackWindow( instrumentTrackView * _itv ) :
instrumentTrackWindow::~instrumentTrackWindow()
InstrumentTrackWindow::~InstrumentTrackWindow()
{
delete m_instrumentView;
if( engine::mainWindow()->workspace() )
@@ -1312,9 +1310,9 @@ instrumentTrackWindow::~instrumentTrackWindow()
void instrumentTrackWindow::modelChanged( void )
void InstrumentTrackWindow::modelChanged()
{
m_track = castModel<instrumentTrack>();
m_track = castModel<InstrumentTrack>();
m_nameLineEdit->setText( m_track->name() );
@@ -1331,7 +1329,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_pitchRange->setModel( &m_track->m_pitchRangeModel );
@@ -1347,14 +1345,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)" ) );
@@ -1389,7 +1387,7 @@ void instrumentTrackWindow::saveSettingsBtnClicked( void )
void instrumentTrackWindow::updateName( void )
void InstrumentTrackWindow::updateName()
{
setWindowTitle( m_track->name() );
@@ -1403,7 +1401,7 @@ void instrumentTrackWindow::updateName( void )
void instrumentTrackWindow::updateInstrumentView( void )
void InstrumentTrackWindow::updateInstrumentView()
{
delete m_instrumentView;
if( m_track->m_instrument != NULL )
@@ -1421,7 +1419,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();
@@ -1430,7 +1428,7 @@ void instrumentTrackWindow::textChanged( const QString & _new_name )
void instrumentTrackWindow::toggleVisibility( bool _on )
void InstrumentTrackWindow::toggleVisibility( bool _on )
{
if( _on )
@@ -1448,7 +1446,7 @@ void instrumentTrackWindow::toggleVisibility( bool _on )
void instrumentTrackWindow::closeEvent( QCloseEvent * _ce )
void InstrumentTrackWindow::closeEvent( QCloseEvent * _ce )
{
_ce->ignore();
if( engine::mainWindow()->workspace() )
@@ -1466,7 +1464,7 @@ void instrumentTrackWindow::closeEvent( QCloseEvent * _ce )
void instrumentTrackWindow::focusInEvent( QFocusEvent * )
void InstrumentTrackWindow::focusInEvent( QFocusEvent * )
{
m_pianoView->setFocus();
}
@@ -1474,7 +1472,7 @@ void instrumentTrackWindow::focusInEvent( QFocusEvent * )
void instrumentTrackWindow::dragEnterEventGeneric( QDragEnterEvent * _dee )
void InstrumentTrackWindow::dragEnterEventGeneric( QDragEnterEvent * _dee )
{
stringPairDrag::processDragEnterEvent( _dee, "instrument,presetfile,"
"pluginpresetfile" );
@@ -1483,7 +1481,7 @@ void instrumentTrackWindow::dragEnterEventGeneric( QDragEnterEvent * _dee )
void instrumentTrackWindow::dragEnterEvent( QDragEnterEvent * _dee )
void InstrumentTrackWindow::dragEnterEvent( QDragEnterEvent * _dee )
{
dragEnterEventGeneric( _dee );
}
@@ -1491,7 +1489,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 );
@@ -1526,7 +1524,7 @@ void instrumentTrackWindow::dropEvent( QDropEvent * _de )
void instrumentTrackWindow::saveSettings( QDomDocument & _doc,
void InstrumentTrackWindow::saveSettings( QDomDocument & _doc,
QDomElement & _this )
{
_this.setAttribute( "tab", m_tabWidget->activeTab() );
@@ -1536,7 +1534,7 @@ void instrumentTrackWindow::saveSettings( QDomDocument & _doc,
void instrumentTrackWindow::loadSettings( const QDomElement & _this )
void InstrumentTrackWindow::loadSettings( const QDomElement & _this )
{
m_tabWidget->setActiveTab( _this.attribute( "tab" ).toInt() );
MainWindow::restoreWidgetState( this, _this );
@@ -1549,6 +1547,6 @@ void instrumentTrackWindow::loadSettings( const QDomElement & _this )
#include "moc_instrument_track.cxx"
#include "moc_InstrumentTrack.cxx"

View File

@@ -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()->

View File

@@ -2,7 +2,7 @@
* bb_track.cpp - implementation of class bbTrack and bbTCO
*
* 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,13 +22,11 @@
*
*/
#include <QtXml/QDomElement>
#include <QtGui/QColorDialog>
#include <QtGui/QMenu>
#include <QtGui/QPainter>
#include "bb_editor.h"
#include "bb_track.h"
#include "bb_track_container.h"
@@ -432,7 +430,7 @@ void bbTrack::saveTrackSpecificSettings( QDomDocument & _doc,
_this.parentNode().parentNode().nodeName() != "clone" &&
_this.parentNode().nodeName() != "journaldata" )
{
( (journallingObject *)( engine::getBBTrackContainer() ) )->
( (JournallingObject *)( engine::getBBTrackContainer() ) )->
saveState( _doc, _this );
}
if( _this.parentNode().parentNode().nodeName() == "clone" )
@@ -471,7 +469,7 @@ void bbTrack::loadTrackSpecificSettings( const QDomElement & _this )
trackContainer::classNodeName() );
if( node.isElement() )
{
( (journallingObject *)engine::getBBTrackContainer() )->
( (JournallingObject *)engine::getBBTrackContainer() )->
restoreState( node.toElement() );
}
}

View File

@@ -34,7 +34,7 @@
#include <QtAlgorithms>
#include "pattern.h"
#include "instrument_track.h"
#include "InstrumentTrack.h"
#include "templates.h"
#include "gui_templates.h"
#include "embed.h"
@@ -58,7 +58,7 @@ QPixmap * patternView::s_frozen = NULL;
pattern::pattern( instrumentTrack * _instrument_track ) :
pattern::pattern( InstrumentTrack * _instrument_track ) :
trackContentObject( _instrument_track ),
m_instrumentTrack( _instrument_track ),
m_patternType( BeatPattern ),
@@ -1301,7 +1301,7 @@ void patternView::paintEvent( QPaintEvent * )
p.setPen( QColor( 32, 240, 32 ) );
}
if( m_pat->name() != m_pat->getInstrumentTrack()->name() )
if( m_pat->name() != m_pat->instrumentTrack()->name() )
{
p.drawText( 2, p.fontMetrics().height() - 1, m_pat->name() );
}

View File

@@ -43,7 +43,7 @@
#include "string_pair_drag.h"
#include "knob.h"
#include "MainWindow.h"
#include "effect_rack_view.h"
#include "EffectRackView.h"
#include "track_label_button.h"
@@ -404,7 +404,7 @@ bool sampleTrack::play( const midiTime & _start, const fpp_t _frames,
const f_cnt_t _offset,
Sint16 /*_tco_num*/ )
{
m_audioPort.getEffects()->startRunning();
m_audioPort.effects()->startRunning();
bool played_a_note = false; // will be return variable
for( int i = 0; i < numOfTCOs(); ++i )
@@ -467,7 +467,7 @@ trackContentObject * sampleTrack::createTCO( const midiTime & )
void sampleTrack::saveTrackSpecificSettings( QDomDocument & _doc,
QDomElement & _this )
{
m_audioPort.getEffects()->saveState( _doc, _this );
m_audioPort.effects()->saveState( _doc, _this );
#if 0
_this.setAttribute( "icon", tlb->pixmapFile() );
#endif
@@ -480,16 +480,14 @@ void sampleTrack::saveTrackSpecificSettings( QDomDocument & _doc,
void sampleTrack::loadTrackSpecificSettings( const QDomElement & _this )
{
QDomNode node = _this.firstChild();
m_audioPort.getEffects()->clear();
m_audioPort.effects()->clear();
while( !node.isNull() )
{
if( node.isElement() )
{
if( m_audioPort.getEffects()->nodeName() ==
node.nodeName() )
if( m_audioPort.effects()->nodeName() == node.nodeName() )
{
m_audioPort.getEffects()->restoreState(
node.toElement() );
m_audioPort.effects()->restoreState( node.toElement() );
}
}
node = node.nextSibling();
@@ -524,7 +522,7 @@ sampleTrackView::sampleTrackView( sampleTrack * _t, trackContainerView * _tcv )
m_volumeKnob->setLabel( tr( "VOL" ) );
m_volumeKnob->show();
m_effectRack = new effectRackView( _t->audioPort()->getEffects() );
m_effectRack = new EffectRackView( _t->audioPort()->effects() );
m_effectRack->setFixedSize( 240, 242 );
engine::mainWindow()->workspace()->addSubWindow( m_effectRack );