TrackContainer, TrackContainerView: adopted coding style

Renamed file and class names.
This commit is contained in:
Tobias Doerffel
2014-01-14 17:39:02 +01:00
parent 7105c8ac90
commit 4e5507a30a
38 changed files with 278 additions and 284 deletions

View File

@@ -2,7 +2,7 @@
* AutomationPattern.cpp - implementation of class AutomationPattern which
* holds dynamic values
*
* Copyright (c) 2008-2013 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2008-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2006-2008 Javier Serrano Polo <jasp00/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
@@ -449,10 +449,10 @@ trackContentObjectView * AutomationPattern::createView( trackView * _tv )
bool AutomationPattern::isAutomated( const AutomatableModel * _m )
{
trackContainer::trackList l = engine::getSong()->tracks() +
TrackContainer::TrackList l = engine::getSong()->tracks() +
engine::getBBTrackContainer()->tracks();
l += engine::getSong()->globalAutomationTrack();
for( trackContainer::trackList::const_iterator it = l.begin();
for( TrackContainer::TrackList::const_iterator it = l.begin();
it != l.end(); ++it )
{
if( ( *it )->type() == track::AutomationTrack ||
@@ -516,10 +516,10 @@ AutomationPattern * AutomationPattern::globalAutomationPattern(
void AutomationPattern::resolveAllIDs()
{
trackContainer::trackList l = engine::getSong()->tracks() +
TrackContainer::TrackList l = engine::getSong()->tracks() +
engine::getBBTrackContainer()->tracks();
l += engine::getSong()->globalAutomationTrack();
for( trackContainer::trackList::iterator it = l.begin();
for( TrackContainer::TrackList::iterator it = l.begin();
it != l.end(); ++it )
{
if( ( *it )->type() == track::AutomationTrack ||

View File

@@ -1,7 +1,7 @@
/*
* ImportFilter.cpp - base-class for all import-filters (MIDI, FLP etc)
*
* Copyright (c) 2006-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2006-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -27,7 +27,7 @@
#include "ImportFilter.h"
#include "engine.h"
#include "track_container.h"
#include "TrackContainer.h"
#include "ProjectJournal.h"
@@ -50,7 +50,7 @@ ImportFilter::~ImportFilter()
void ImportFilter::import( const QString & _file_to_import,
trackContainer * _tc )
TrackContainer* tc )
{
DescriptorList d;
Plugin::getDescriptorsOfAvailPlugins( d );
@@ -70,8 +70,7 @@ void ImportFilter::import( const QString & _file_to_import,
{
Plugin * p = Plugin::instantiate( it->name, NULL, s );
if( dynamic_cast<ImportFilter *>( p ) != NULL &&
dynamic_cast<ImportFilter *>( p )->tryImport(
_tc ) == true )
dynamic_cast<ImportFilter *>( p )->tryImport( tc ) == true )
{
delete p;
successful = true;
@@ -88,8 +87,8 @@ void ImportFilter::import( const QString & _file_to_import,
if( successful == false )
{
QMessageBox::information( NULL,
trackContainer::tr( "Couldn't import file" ),
trackContainer::tr( "Couldn't find a filter for "
TrackContainer::tr( "Couldn't import file" ),
TrackContainer::tr( "Couldn't find a filter for "
"importing file %1.\n"
"You should convert this file "
"into a format supported by "
@@ -108,8 +107,8 @@ bool ImportFilter::openFile()
if( m_file.open( QFile::ReadOnly ) == false )
{
QMessageBox::critical( NULL,
trackContainer::tr( "Couldn't open file" ),
trackContainer::tr( "Couldn't open file %1 "
TrackContainer::tr( "Couldn't open file" ),
TrackContainer::tr( "Couldn't open file %1 "
"for reading.\nPlease make "
"sure you have read-"
"permission to the file and "

View File

@@ -1,8 +1,8 @@
/*
* track_container.cpp - implementation of base-class for all track-containers
* like Song-Editor, BB-Editor...
* TrackContainer.cpp - implementation of base class for all trackcontainers
* like Song-Editor, BB-Editor...
*
* Copyright (c) 2004-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2004-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -28,14 +28,14 @@
#include <QtGui/QProgressDialog>
#include <QtXml/QDomElement>
#include "track_container.h"
#include "TrackContainer.h"
#include "InstrumentTrack.h"
#include "engine.h"
#include "MainWindow.h"
#include "song.h"
trackContainer::trackContainer() :
TrackContainer::TrackContainer() :
Model( NULL ),
JournallingObject(),
m_tracksMutex(),
@@ -46,7 +46,7 @@ trackContainer::trackContainer() :
trackContainer::~trackContainer()
TrackContainer::~TrackContainer()
{
clearAllTracks();
}
@@ -54,7 +54,7 @@ trackContainer::~trackContainer()
void trackContainer::saveSettings( QDomDocument & _doc, QDomElement & _this )
void TrackContainer::saveSettings( QDomDocument & _doc, QDomElement & _this )
{
_this.setTagName( classNodeName() );
_this.setAttribute( "type", nodeName() );
@@ -71,7 +71,7 @@ void trackContainer::saveSettings( QDomDocument & _doc, QDomElement & _this )
void trackContainer::loadSettings( const QDomElement & _this )
void TrackContainer::loadSettings( const QDomElement & _this )
{
static QProgressDialog * pd = NULL;
bool was_null = ( pd == NULL );
@@ -132,7 +132,7 @@ void trackContainer::loadSettings( const QDomElement & _this )
int trackContainer::countTracks( track::TrackTypes _tt ) const
int TrackContainer::countTracks( track::TrackTypes _tt ) const
{
int cnt = 0;
m_tracksMutex.lockForRead();
@@ -150,7 +150,7 @@ int trackContainer::countTracks( track::TrackTypes _tt ) const
void trackContainer::addTrack( track * _track )
void TrackContainer::addTrack( track * _track )
{
if( _track->type() != track::HiddenAutomationTrack )
{
@@ -164,7 +164,7 @@ void trackContainer::addTrack( track * _track )
void trackContainer::removeTrack( track * _track )
void TrackContainer::removeTrack( track * _track )
{
int index = m_tracks.indexOf( _track );
if( index != -1 )
@@ -183,14 +183,14 @@ void trackContainer::removeTrack( track * _track )
void trackContainer::updateAfterTrackAdd()
void TrackContainer::updateAfterTrackAdd()
{
}
void trackContainer::clearAllTracks()
void TrackContainer::clearAllTracks()
{
//m_tracksMutex.lockForWrite();
while( !m_tracks.isEmpty() )
@@ -203,9 +203,9 @@ void trackContainer::clearAllTracks()
bool trackContainer::isEmpty() const
bool TrackContainer::isEmpty() const
{
for( trackList::const_iterator it = m_tracks.begin();
for( TrackList::const_iterator it = m_tracks.begin();
it != m_tracks.end(); ++it )
{
if( !( *it )->getTCOs().isEmpty() )
@@ -222,7 +222,7 @@ bool trackContainer::isEmpty() const
DummyTrackContainer::DummyTrackContainer() :
trackContainer(),
TrackContainer(),
m_dummyInstrumentTrack( NULL )
{
setJournalling( false );
@@ -235,5 +235,5 @@ DummyTrackContainer::DummyTrackContainer() :
#include "moc_track_container.cxx"
#include "moc_TrackContainer.cxx"

View File

@@ -1,7 +1,7 @@
/*
* bb_track_container.cpp - model-component of BB-Editor
*
* Copyright (c) 2004-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2004-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -33,7 +33,7 @@
bbTrackContainer::bbTrackContainer() :
trackContainer(),
TrackContainer(),
m_bbComboBoxModel( this )
{
connect( &m_bbComboBoxModel, SIGNAL( dataChanged() ),
@@ -66,8 +66,8 @@ bool bbTrackContainer::play( midiTime _start, fpp_t _frames,
_start = _start % ( lengthOfBB( _tco_num ) * midiTime::ticksPerTact() );
trackList tl = tracks();
for( trackList::iterator it = tl.begin(); it != tl.end(); ++it )
TrackList tl = tracks();
for( TrackList::iterator it = tl.begin(); it != tl.end(); ++it )
{
if( ( *it )->play( _start, _frames, _offset, _tco_num ) )
{
@@ -102,8 +102,8 @@ tact_t bbTrackContainer::lengthOfBB( int _bb )
{
midiTime max_length = midiTime::ticksPerTact();
const trackList & tl = tracks();
for( trackList::const_iterator it = tl.begin(); it != tl.end(); ++it )
const TrackList & tl = tracks();
for( TrackList::const_iterator it = tl.begin(); it != tl.end(); ++it )
{
max_length = qMax( max_length,
( *it )->getTCO( _bb )->length() );
@@ -125,8 +125,8 @@ int bbTrackContainer::numOfBBs() const
void bbTrackContainer::removeBB( int _bb )
{
trackList tl = tracks();
for( trackList::iterator it = tl.begin(); it != tl.end(); ++it )
TrackList tl = tracks();
for( TrackList::iterator it = tl.begin(); it != tl.end(); ++it )
{
delete ( *it )->getTCO( _bb );
( *it )->removeTact( _bb * DefaultTicksPerTact );
@@ -142,8 +142,8 @@ void bbTrackContainer::removeBB( int _bb )
void bbTrackContainer::swapBB( int _bb1, int _bb2 )
{
trackList tl = tracks();
for( trackList::iterator it = tl.begin(); it != tl.end(); ++it )
TrackList tl = tracks();
for( TrackList::iterator it = tl.begin(); it != tl.end(); ++it )
{
( *it )->swapPositionOfTCOs( _bb1, _bb2 );
}
@@ -168,8 +168,8 @@ void bbTrackContainer::updateBBTrack( trackContentObject * _tco )
void bbTrackContainer::fixIncorrectPositions()
{
trackList tl = tracks();
for( trackList::iterator it = tl.begin(); it != tl.end(); ++it )
TrackList tl = tracks();
for( TrackList::iterator it = tl.begin(); it != tl.end(); ++it )
{
for( int i = 0; i < numOfBBs(); ++i )
{
@@ -228,8 +228,8 @@ void bbTrackContainer::currentBBChanged()
// now update all track-labels (the current one has to become white,
// the others gray)
trackList tl = engine::getSong()->tracks();
for( trackList::iterator it = tl.begin(); it != tl.end(); ++it )
TrackList tl = engine::getSong()->tracks();
for( TrackList::iterator it = tl.begin(); it != tl.end(); ++it )
{
if( ( *it )->type() == track::BBTrack )
{
@@ -248,7 +248,7 @@ void bbTrackContainer::createTCOsForBB( int _bb )
return;
}
trackList tl = tracks();
TrackList tl = tracks();
for( int i = 0; i < tl.size(); ++i )
{
while( tl[i]->numOfTCOs() < _bb + 1 )

View File

@@ -35,12 +35,12 @@
#include "mmp.h"
#include "note_play_handle.h"
#include "ProjectJournal.h"
#include "track_container.h"
#include "TrackContainer.h"
// invisible track-container which is needed as parent for preview-channels
class previewTrackContainer : public trackContainer
class previewTrackContainer : public TrackContainer
{
public:
previewTrackContainer() :

View File

@@ -81,7 +81,7 @@ tick_t midiTime::s_ticksPerTact = DefaultTicksPerTact;
song::song() :
trackContainer(),
TrackContainer(),
m_globalAutomationTrack( dynamic_cast<AutomationTrack *>(
track::create( track::HiddenAutomationTrack,
this ) ) ),
@@ -399,7 +399,7 @@ void song::processNextBuffer()
return;
}
trackList track_list;
TrackList track_list;
int tco_num = -1;
switch( m_playMode )
@@ -742,7 +742,7 @@ void song::updateLength()
{
m_length = 0;
m_tracksMutex.lockForRead();
for( trackList::const_iterator it = tracks().begin();
for( TrackList::const_iterator it = tracks().begin();
it != tracks().end(); ++it )
{
const tact_t cur = ( *it )->length();
@@ -867,7 +867,7 @@ void song::stopExport()
void song::insertBar()
{
m_tracksMutex.lockForRead();
for( trackList::const_iterator it = tracks().begin();
for( TrackList::const_iterator it = tracks().begin();
it != tracks().end(); ++it )
{
( *it )->insertTact( m_playPos[Mode_PlaySong] );
@@ -881,7 +881,7 @@ void song::insertBar()
void song::removeBar()
{
m_tracksMutex.lockForRead();
for( trackList::const_iterator it = tracks().begin();
for( TrackList::const_iterator it = tracks().begin();
it != tracks().end(); ++it )
{
( *it )->removeTact( m_playPos[Mode_PlaySong] );

View File

@@ -2,7 +2,7 @@
* track.cpp - implementation of classes concerning tracks -> necessary for
* all track-like objects (beat/bassline, sample-track...)
*
* Copyright (c) 2004-2012 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2004-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -68,7 +68,7 @@
#include "templates.h"
#include "text_float.h"
#include "tooltip.h"
#include "track_container.h"
#include "TrackContainer.h"
/*! The width of the resize grip in pixels
@@ -336,7 +336,7 @@ trackContentObjectView::~trackContentObjectView()
// op-buttons of our track-widgets could become focus and when the user
// presses space for playing song, just one of these buttons is pressed
// which results in unwanted effects
m_trackView->getTrackContainerView()->setFocus();
m_trackView->trackContainerView()->setFocus();
}
@@ -352,7 +352,7 @@ trackContentObjectView::~trackContentObjectView()
*/
bool trackContentObjectView::fixedTCOs()
{
return m_trackView->getTrackContainerView()->fixedTCOs();
return m_trackView->trackContainerView()->fixedTCOs();
}
@@ -425,7 +425,7 @@ void trackContentObjectView::updateLength()
midiTime::ticksPerTact() ) +
TCO_BORDER_WIDTH * 2-1 );
}
m_trackView->getTrackContainerView()->update();
m_trackView->trackContainerView()->update();
}
@@ -443,7 +443,7 @@ void trackContentObjectView::updatePosition()
m_trackView->getTrackContentWidget()->changePosition();
// moving a TCO can result in change of song-length etc.,
// therefore we update the track-container
m_trackView->getTrackContainerView()->update();
m_trackView->trackContainerView()->update();
}
@@ -532,11 +532,11 @@ void trackContentObjectView::leaveEvent( QEvent * _e )
*/
void trackContentObjectView::mousePressEvent( QMouseEvent * _me )
{
if( m_trackView->getTrackContainerView()->allowRubberband() == true &&
if( m_trackView->trackContainerView()->allowRubberband() == true &&
_me->button() == Qt::LeftButton )
{
// if rubberband is active, we can be selected
if( !m_trackView->getTrackContainerView()->rubberBandActive() )
if( !m_trackView->trackContainerView()->rubberBandActive() )
{
if( _me->modifiers() & Qt::ControlModifier )
{
@@ -650,12 +650,12 @@ void trackContentObjectView::mouseMoveEvent( QMouseEvent * _me )
m_hint = NULL;
}
const float ppt = m_trackView->getTrackContainerView()->pixelsPerTact();
const float ppt = m_trackView->trackContainerView()->pixelsPerTact();
if( m_action == Move )
{
const int x = mapToParent( _me->pos() ).x() - m_initialMouseX;
midiTime t = qMax( 0, (int)
m_trackView->getTrackContainerView()->currentPosition()+
m_trackView->trackContainerView()->currentPosition()+
static_cast<int>( x * midiTime::ticksPerTact() /
ppt ) );
if( ! ( _me->modifiers() & Qt::ControlModifier )
@@ -676,7 +676,7 @@ void trackContentObjectView::mouseMoveEvent( QMouseEvent * _me )
{
const int dx = _me->x() - m_initialMouseX;
QVector<selectableObject *> so =
m_trackView->getTrackContainerView()->selectedObjects();
m_trackView->trackContainerView()->selectedObjects();
QVector<trackContentObject *> tcos;
midiTime smallest_pos, t;
// find out smallest position of all selected objects for not
@@ -830,7 +830,7 @@ void trackContentObjectView::contextMenuEvent( QContextMenuEvent * _cme )
*/
float trackContentObjectView::pixelsPerTact()
{
return m_trackView->getTrackContainerView()->pixelsPerTact();
return m_trackView->trackContainerView()->pixelsPerTact();
}
@@ -866,7 +866,7 @@ trackContentWidget::trackContentWidget( trackView * _parent ) :
{
setAcceptDrops( true );
connect( _parent->getTrackContainerView(),
connect( _parent->trackContainerView(),
SIGNAL( positionChanged( const midiTime & ) ),
this, SLOT( changePosition( const midiTime & ) ) );
@@ -890,7 +890,7 @@ trackContentWidget::~trackContentWidget()
void trackContentWidget::updateBackground()
{
const int tactsPerBar = 4;
const trackContainerView * tcv = m_trackView->getTrackContainerView();
const TrackContainerView * tcv = m_trackView->trackContainerView();
// Assume even-pixels-per-tact. Makes sense, should be like this anyways
int ppt = static_cast<int>( tcv->pixelsPerTact() );
@@ -1019,7 +1019,7 @@ void trackContentWidget::update()
*/
void trackContentWidget::changePosition( const midiTime & _new_pos )
{
if( m_trackView->getTrackContainerView() == engine::getBBEditor() )
if( m_trackView->trackContainerView() == engine::getBBEditor() )
{
const int cur_bb = engine::getBBTrackContainer()->currentBB();
setUpdatesEnabled( false );
@@ -1057,12 +1057,12 @@ void trackContentWidget::changePosition( const midiTime & _new_pos )
midiTime pos = _new_pos;
if( pos < 0 )
{
pos = m_trackView->getTrackContainerView()->currentPosition();
pos = m_trackView->trackContainerView()->currentPosition();
}
const int begin = pos;
const int end = endPosition( pos );
const float ppt = m_trackView->getTrackContainerView()->pixelsPerTact();
const float ppt = m_trackView->trackContainerView()->pixelsPerTact();
setUpdatesEnabled( false );
for( tcoViewVector::iterator it = m_tcoViews.begin();
@@ -1123,7 +1123,7 @@ void trackContentWidget::dropEvent( QDropEvent * _de )
QString type = stringPairDrag::decodeKey( _de );
QString value = stringPairDrag::decodeValue( _de );
if( type == ( "tco_" + QString::number( getTrack()->type() ) ) &&
m_trackView->getTrackContainerView()->fixedTCOs() == false )
m_trackView->trackContainerView()->fixedTCOs() == false )
{
const midiTime pos = getPosition( _de->pos().x()
).toNearestTact();
@@ -1154,7 +1154,7 @@ void trackContentWidget::dropEvent( QDropEvent * _de )
*/
void trackContentWidget::mousePressEvent( QMouseEvent * _me )
{
if( m_trackView->getTrackContainerView()->allowRubberband() == true )
if( m_trackView->trackContainerView()->allowRubberband() == true )
{
QWidget::mousePressEvent( _me );
}
@@ -1163,7 +1163,7 @@ void trackContentWidget::mousePressEvent( QMouseEvent * _me )
QWidget::mousePressEvent( _me );
}
else if( _me->button() == Qt::LeftButton &&
!m_trackView->getTrackContainerView()->fixedTCOs() )
!m_trackView->trackContainerView()->fixedTCOs() )
{
const midiTime pos = getPosition( _me->x() ).getTact() *
midiTime::ticksPerTact();
@@ -1186,11 +1186,11 @@ void trackContentWidget::mousePressEvent( QMouseEvent * _me )
void trackContentWidget::paintEvent( QPaintEvent * _pe )
{
// Assume even-pixels-per-tact. Makes sense, should be like this anyways
const trackContainerView * tcv = m_trackView->getTrackContainerView();
const TrackContainerView * tcv = m_trackView->trackContainerView();
int ppt = static_cast<int>( tcv->pixelsPerTact() );
QPainter p( this );
// Don't draw background on BB-Editor
if( m_trackView->getTrackContainerView() != engine::getBBEditor() )
if( m_trackView->trackContainerView() != engine::getBBEditor() )
{
p.drawTiledPixmap( rect(), m_background, QPoint(
tcv->currentPosition().getTact() * ppt, 0 ) );
@@ -1297,11 +1297,11 @@ track * trackContentWidget::getTrack()
*/
midiTime trackContentWidget::getPosition( int _mouse_x )
{
return midiTime( m_trackView->getTrackContainerView()->
return midiTime( m_trackView->trackContainerView()->
currentPosition() + _mouse_x *
midiTime::ticksPerTact() /
static_cast<int>( m_trackView->
getTrackContainerView()->pixelsPerTact() ) );
trackContainerView()->pixelsPerTact() ) );
}
@@ -1312,7 +1312,7 @@ midiTime trackContentWidget::getPosition( int _mouse_x )
*/
midiTime trackContentWidget::endPosition( const midiTime & _pos_start )
{
const float ppt = m_trackView->getTrackContainerView()->pixelsPerTact();
const float ppt = m_trackView->trackContainerView()->pixelsPerTact();
const int w = width();
return _pos_start + static_cast<int>( w * midiTime::ticksPerTact() / ppt );
}
@@ -1393,7 +1393,7 @@ trackOperationsWidget::trackOperationsWidget( trackView * _parent ) :
toolTip::add( m_soloBtn, tr( "Solo" ) );
connect( this, SIGNAL( trackRemovalScheduled( trackView * ) ),
m_trackView->getTrackContainerView(),
m_trackView->trackContainerView(),
SLOT( deleteTrackView( trackView * ) ),
Qt::QueuedConnection );
}
@@ -1545,7 +1545,7 @@ void trackOperationsWidget::updateMenu()
*
* \todo check the definitions of all the properties - are they OK?
*/
track::track( TrackTypes _type, trackContainer * _tc ) :
track::track( TrackTypes _type, TrackContainer * _tc ) :
Model( _tc ), /*!< The track Model */
m_trackContainer( _tc ), /*!< The track container object */
m_type( _type ), /*!< The track type */
@@ -1594,7 +1594,7 @@ track::~track()
* \param _tt The type of track to create
* \param _tc The track container to attach to
*/
track * track::create( TrackTypes _tt, trackContainer * _tc )
track * track::create( TrackTypes _tt, TrackContainer * _tc )
{
track * t = NULL;
@@ -1619,12 +1619,12 @@ track * track::create( TrackTypes _tt, trackContainer * _tc )
/*! \brief Create a track inside trackContainer from track type in a QDomElement and restore state from XML
/*! \brief Create a track inside TrackContainer from track type in a QDomElement and restore state from XML
*
* \param _this The QDomElement containing the type of track to create
* \param _tc The track container to attach to
*/
track * track::create( const QDomElement & _this, trackContainer * _tc )
track * track::create( const QDomElement & _this, TrackContainer * _tc )
{
track * t = create(
static_cast<TrackTypes>( _this.attribute( "type" ).toInt() ),
@@ -2039,10 +2039,10 @@ tact_t track::length() const
*/
void track::toggleSolo()
{
const trackContainer::trackList & tl = m_trackContainer->tracks();
const TrackContainer::TrackList & tl = m_trackContainer->tracks();
bool solo_before = false;
for( trackContainer::trackList::const_iterator it = tl.begin();
for( TrackContainer::TrackList::const_iterator it = tl.begin();
it != tl.end(); ++it )
{
if( *it != this )
@@ -2056,7 +2056,7 @@ void track::toggleSolo()
}
const bool solo = m_soloModel.value();
for( trackContainer::trackList::const_iterator it = tl.begin();
for( TrackContainer::TrackList::const_iterator it = tl.begin();
it != tl.end(); ++it )
{
if( solo )
@@ -2097,7 +2097,7 @@ void track::toggleSolo()
* \param _tcv The track Container View for us to be displayed in.
* \todo Is my description of these properties correct?
*/
trackView::trackView( track * _track, trackContainerView * _tcv ) :
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 */
m_track( _track ), /*!< The track we're displaying */

View File

@@ -2,7 +2,7 @@
* AutomationEditor.cpp - implementation of AutomationEditor which is used for
* actual setting of dynamic values
*
* Copyright (c) 2008-2013 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2008-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2008-2013 Paul Giblock <pgib/at/users.sourceforge.net>
* Copyright (c) 2006-2008 Javier Serrano Polo <jasp00/at/users.sourceforge.net>
*
@@ -1848,8 +1848,7 @@ inline bool AutomationEditor::inBBEditor()
{
QMutexLocker m( &m_patternMutex );
return( validPattern() &&
m_pattern->getTrack()->getTrackContainer()
== engine::getBBTrackContainer() );
m_pattern->getTrack()->trackContainer() == engine::getBBTrackContainer() );
}

View File

@@ -1,7 +1,7 @@
/*
* track_container_view.cpp - view-component for trackContainer
* TrackContainerView.cpp - view-component for TrackContainer
*
* Copyright (c) 2004-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2004-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -31,8 +31,8 @@
#include <QtGui/QWheelEvent>
#include "track_container_view.h"
#include "track_container.h"
#include "TrackContainerView.h"
#include "TrackContainer.h"
#include "bb_track.h"
#include "MainWindow.h"
#include "debug.h"
@@ -47,7 +47,7 @@
#include "track.h"
trackContainerView::trackContainerView( trackContainer * _tc ) :
TrackContainerView::TrackContainerView( TrackContainer * _tc ) :
QWidget(),
ModelView( NULL, this ),
JournallingObject(),
@@ -90,7 +90,7 @@ trackContainerView::trackContainerView( trackContainer * _tc ) :
trackContainerView::~trackContainerView()
TrackContainerView::~TrackContainerView()
{
while( !m_trackViews.empty() )
{
@@ -102,7 +102,7 @@ trackContainerView::~trackContainerView()
void trackContainerView::saveSettings( QDomDocument & _doc,
void TrackContainerView::saveSettings( QDomDocument & _doc,
QDomElement & _this )
{
MainWindow::saveWidgetState( this, _this );
@@ -111,7 +111,7 @@ void trackContainerView::saveSettings( QDomDocument & _doc,
void trackContainerView::loadSettings( const QDomElement & _this )
void TrackContainerView::loadSettings( const QDomElement & _this )
{
MainWindow::restoreWidgetState( this, _this );
}
@@ -119,7 +119,7 @@ void trackContainerView::loadSettings( const QDomElement & _this )
trackView * trackContainerView::addTrackView( trackView * _tv )
trackView * TrackContainerView::addTrackView( trackView * _tv )
{
/* QMap<QString, QVariant> map;
map["id"] = _tv->getTrack()->id();
@@ -137,7 +137,7 @@ trackView * trackContainerView::addTrackView( trackView * _tv )
void trackContainerView::removeTrackView( trackView * _tv )
void TrackContainerView::removeTrackView( trackView * _tv )
{
int index = m_trackViews.indexOf( _tv );
if( index != -1 )
@@ -165,7 +165,7 @@ void trackContainerView::removeTrackView( trackView * _tv )
void trackContainerView::moveTrackViewUp( trackView * _tv )
void TrackContainerView::moveTrackViewUp( trackView * _tv )
{
for( int i = 1; i < m_trackViews.size(); ++i )
{
@@ -187,7 +187,7 @@ void trackContainerView::moveTrackViewUp( trackView * _tv )
void trackContainerView::moveTrackViewDown( trackView * _tv )
void TrackContainerView::moveTrackViewDown( trackView * _tv )
{
for( int i = 0; i < m_trackViews.size()-1; ++i )
{
@@ -210,7 +210,7 @@ void trackContainerView::moveTrackViewDown( trackView * _tv )
void trackContainerView::realignTracks()
void TrackContainerView::realignTracks()
{
QWidget * content = m_scrollArea->widget();
content->setFixedWidth( width()
@@ -228,7 +228,7 @@ void trackContainerView::realignTracks()
void trackContainerView::createTrackView( track * _t )
void TrackContainerView::createTrackView( track * _t )
{
_t->createView( this );
}
@@ -236,7 +236,7 @@ void trackContainerView::createTrackView( track * _t )
void trackContainerView::deleteTrackView( trackView * _tv )
void TrackContainerView::deleteTrackView( trackView * _tv )
{
track * t = _tv->getTrack();
removeTrackView( _tv );
@@ -250,7 +250,7 @@ void trackContainerView::deleteTrackView( trackView * _tv )
const trackView * trackContainerView::trackViewAt( const int _y ) const
const trackView * TrackContainerView::trackViewAt( const int _y ) const
{
const int abs_y = _y + m_scrollArea->viewport()->y();
int y_cnt = 0;
@@ -270,7 +270,7 @@ const trackView * trackContainerView::trackViewAt( const int _y ) const
bool trackContainerView::allowRubberband() const
bool TrackContainerView::allowRubberband() const
{
return( false );
}
@@ -278,7 +278,7 @@ bool trackContainerView::allowRubberband() const
void trackContainerView::setPixelsPerTact( int _ppt )
void TrackContainerView::setPixelsPerTact( int _ppt )
{
m_ppt = _ppt;
@@ -293,7 +293,7 @@ void trackContainerView::setPixelsPerTact( int _ppt )
void trackContainerView::clearAllTracks()
void TrackContainerView::clearAllTracks()
{
while( !m_trackViews.empty() )
{
@@ -307,7 +307,7 @@ void trackContainerView::clearAllTracks()
void trackContainerView::undoStep( JournalEntry & _je )
void TrackContainerView::undoStep( JournalEntry & _je )
{
#if 0
saveJournallingState( false );
@@ -345,7 +345,7 @@ void trackContainerView::undoStep( JournalEntry & _je )
void trackContainerView::redoStep( JournalEntry & _je )
void TrackContainerView::redoStep( JournalEntry & _je )
{
#if 0
switch( _je.actionID() )
@@ -365,7 +365,7 @@ void trackContainerView::redoStep( JournalEntry & _je )
void trackContainerView::dragEnterEvent( QDragEnterEvent * _dee )
void TrackContainerView::dragEnterEvent( QDragEnterEvent * _dee )
{
stringPairDrag::processDragEnterEvent( _dee,
QString( "presetfile,pluginpresetfile,samplefile,instrument,"
@@ -377,7 +377,7 @@ void trackContainerView::dragEnterEvent( QDragEnterEvent * _dee )
void trackContainerView::dropEvent( QDropEvent * _de )
void TrackContainerView::dropEvent( QDropEvent * _de )
{
QString type = stringPairDrag::decodeKey( _de );
QString value = stringPairDrag::decodeValue( _de );
@@ -431,7 +431,7 @@ void trackContainerView::dropEvent( QDropEvent * _de )
void trackContainerView::mousePressEvent( QMouseEvent * _me )
void TrackContainerView::mousePressEvent( QMouseEvent * _me )
{
if( allowRubberband() == true )
{
@@ -445,7 +445,7 @@ void trackContainerView::mousePressEvent( QMouseEvent * _me )
void trackContainerView::mouseMoveEvent( QMouseEvent * _me )
void TrackContainerView::mouseMoveEvent( QMouseEvent * _me )
{
if( rubberBandActive() == true )
{
@@ -459,7 +459,7 @@ void trackContainerView::mouseMoveEvent( QMouseEvent * _me )
void trackContainerView::mouseReleaseEvent( QMouseEvent * _me )
void TrackContainerView::mouseReleaseEvent( QMouseEvent * _me )
{
m_rubberBand->hide();
QWidget::mouseReleaseEvent( _me );
@@ -469,7 +469,7 @@ void trackContainerView::mouseReleaseEvent( QMouseEvent * _me )
void trackContainerView::resizeEvent( QResizeEvent * _re )
void TrackContainerView::resizeEvent( QResizeEvent * _re )
{
realignTracks();
QWidget::resizeEvent( _re );
@@ -478,7 +478,7 @@ void trackContainerView::resizeEvent( QResizeEvent * _re )
trackContainerView::scrollArea::scrollArea( trackContainerView * _parent ) :
TrackContainerView::scrollArea::scrollArea( TrackContainerView * _parent ) :
QScrollArea( _parent ),
m_trackContainerView( _parent )
{
@@ -490,14 +490,14 @@ trackContainerView::scrollArea::scrollArea( trackContainerView * _parent ) :
trackContainerView::scrollArea::~scrollArea()
TrackContainerView::scrollArea::~scrollArea()
{
}
void trackContainerView::scrollArea::wheelEvent( QWheelEvent * _we )
void TrackContainerView::scrollArea::wheelEvent( QWheelEvent * _we )
{
// always pass wheel-event to parent-widget (song-editor
// bb-editor etc.) because they might want to use it for zooming
@@ -514,5 +514,5 @@ void trackContainerView::scrollArea::wheelEvent( QWheelEvent * _we )
#include "moc_track_container_view.cxx"
#include "moc_TrackContainerView.cxx"

View File

@@ -38,9 +38,9 @@
bbEditor::bbEditor( bbTrackContainer * _tc ) :
trackContainerView( _tc ),
m_bbtc( _tc )
bbEditor::bbEditor( bbTrackContainer* tc ) :
TrackContainerView( tc ),
m_bbtc( tc )
{
// create toolbar
m_toolBar = new QWidget;
@@ -108,7 +108,7 @@ bbEditor::bbEditor( bbTrackContainer * _tc ) :
m_bbComboBox = new comboBox( m_toolBar );
m_bbComboBox->setFixedSize( 200, 22 );
m_bbComboBox->setModel( &_tc->m_bbComboBoxModel );
m_bbComboBox->setModel( &tc->m_bbComboBoxModel );
tb_layout->addSpacing( 5 );
tb_layout->addWidget( m_playButton );
@@ -130,8 +130,8 @@ bbEditor::bbEditor( bbTrackContainer * _tc ) :
parentWidget()->show();
setModel( _tc );
connect( &_tc->m_bbComboBoxModel, SIGNAL( dataChanged() ),
setModel( tc );
connect( &tc->m_bbComboBoxModel, SIGNAL( dataChanged() ),
this, SLOT( updatePosition() ) );
}

View File

@@ -186,10 +186,10 @@ void exportProjectDialog::multiRender()
int x = 1;
const trackContainer::trackList & tl = engine::getSong()->tracks();
const TrackContainer::TrackList & tl = engine::getSong()->tracks();
// Check for all unmuted tracks. Remember list.
for( trackContainer::trackList::ConstIterator it = tl.begin();
for( TrackContainer::TrackList::ConstIterator it = tl.begin();
it != tl.end(); ++it )
{
track* tk = (*it);
@@ -213,8 +213,8 @@ void exportProjectDialog::multiRender()
}
const trackContainer::trackList t2 = engine::getBBTrackContainer()->tracks();
for( trackContainer::trackList::ConstIterator it = t2.begin(); it != t2.end(); ++it )
const TrackContainer::TrackList t2 = engine::getBBTrackContainer()->tracks();
for( TrackContainer::TrackList::ConstIterator it = t2.begin(); it != t2.end(); ++it )
{
track* tk = (*it);
if ( tk->isMuted() == false )

View File

@@ -626,14 +626,14 @@ void fileBrowserTreeWidget::activateListItem( QTreeWidgetItem * _item,
void fileBrowserTreeWidget::openInNewInstrumentTrack( trackContainer * _tc )
void fileBrowserTreeWidget::openInNewInstrumentTrack( TrackContainer* tc )
{
if( m_contextMenuItem->handling() == fileItem::LoadAsPreset ||
m_contextMenuItem->handling() == fileItem::LoadByPlugin )
{
engine::mixer()->lock();
InstrumentTrack * it = dynamic_cast<InstrumentTrack *>(
track::create( track::InstrumentTrack, _tc ) );
track::create( track::InstrumentTrack, tc ) );
handleFile( m_contextMenuItem, it );
engine::mixer()->unlock();
}

View File

@@ -3294,7 +3294,7 @@ int pianoRoll::getKey( int _y ) const
song::PlayModes pianoRoll::desiredPlayModeForAccompany() const
{
if( m_pattern->getTrack()->getTrackContainer() ==
if( m_pattern->getTrack()->trackContainer() ==
engine::getBBTrackContainer() )
{
return song::Mode_PlayBB;
@@ -3357,7 +3357,7 @@ void pianoRoll::recordAccompany()
m_recording = true;
if( m_pattern->getTrack()->getTrackContainer() == engine::getSong() )
if( m_pattern->getTrack()->trackContainer() == engine::getSong() )
{
engine::getSong()->playSong();
}

View File

@@ -77,7 +77,7 @@ void positionLine::paintEvent( QPaintEvent * _pe )
songEditor::songEditor( song * _song, songEditor * & _engine_ptr ) :
trackContainerView( _song ),
TrackContainerView( _song ),
m_s( _song ),
m_scrollBack( false ),
m_smoothScroll( configManager::inst()->value( "ui", "smoothscroll" ).toInt() )

View File

@@ -2,7 +2,7 @@
* AutomationTrack.cpp - AutomationTrack handles automation of objects without
* a track
*
* Copyright (c) 2008-2010 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2008-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2006-2008 Javier Serrano Polo <jasp00/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
@@ -30,12 +30,12 @@
#include "embed.h"
#include "ProjectJournal.h"
#include "string_pair_drag.h"
#include "track_container_view.h"
#include "TrackContainerView.h"
#include "track_label_button.h"
AutomationTrack::AutomationTrack( trackContainer * _tc, bool _hidden ) :
track( _hidden ? HiddenAutomationTrack : track::AutomationTrack, _tc )
AutomationTrack::AutomationTrack( TrackContainer* tc, bool _hidden ) :
track( _hidden ? HiddenAutomationTrack : track::AutomationTrack, tc )
{
setName( tr( "Automation track" ) );
}
@@ -90,9 +90,9 @@ bool AutomationTrack::play( const midiTime & _start, const fpp_t _frames,
trackView * AutomationTrack::createView( trackContainerView * _tcv )
trackView * AutomationTrack::createView( TrackContainerView* tcv )
{
return new AutomationTrackView( this, _tcv );
return new AutomationTrackView( this, tcv );
}
@@ -127,9 +127,8 @@ void AutomationTrack::loadTrackSpecificSettings( const QDomElement & _this )
AutomationTrackView::AutomationTrackView( AutomationTrack * _at,
trackContainerView * _tcv ) :
trackView( _at, _tcv )
AutomationTrackView::AutomationTrackView( AutomationTrack * _at, TrackContainerView* tcv ) :
trackView( _at, tcv )
{
setFixedHeight( 32 );
trackLabelButton * tlb = new trackLabelButton( this,
@@ -169,12 +168,12 @@ void AutomationTrackView::dropEvent( QDropEvent * _de )
journallingObject( val.toInt() ) );
if( mod != NULL )
{
midiTime pos = midiTime( getTrackContainerView()->
midiTime pos = midiTime( trackContainerView()->
currentPosition() +
( _de->pos().x() -
getTrackContentWidget()->x() ) *
midiTime::ticksPerTact() /
static_cast<int>( getTrackContainerView()->pixelsPerTact() ) )
static_cast<int>( trackContainerView()->pixelsPerTact() ) )
.toNearestTact();
if( pos.getTicks() < 0 )

View File

@@ -2,7 +2,7 @@
* InstrumentTrack.cpp - implementation of instrument-track-class
* (window + data-structures)
*
* Copyright (c) 2004-2013 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2004-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -91,8 +91,8 @@ const int INSTRUMENT_WINDOW_CACHE_SIZE = 8;
// #### IT:
InstrumentTrack::InstrumentTrack( trackContainer * _tc ) :
track( track::InstrumentTrack, _tc ),
InstrumentTrack::InstrumentTrack( TrackContainer* tc ) :
track( track::InstrumentTrack, tc ),
MidiEventProcessor(),
m_audioPort( tr( "unnamed_track" ) ),
m_midiPort( tr( "unnamed_track" ), engine::mixer()->midiClient(),
@@ -744,9 +744,9 @@ 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 );
}
@@ -909,9 +909,8 @@ QQueue<InstrumentTrackWindow *> InstrumentTrackView::s_windowCache;
InstrumentTrackView::InstrumentTrackView( InstrumentTrack * _it,
trackContainerView * _tcv ) :
trackView( _it, _tcv ),
InstrumentTrackView::InstrumentTrackView( InstrumentTrack * _it, TrackContainerView* tcv ) :
trackView( _it, tcv ),
m_window( NULL ),
m_lastPos( -1, -1 )
{

View File

@@ -298,8 +298,8 @@ void bbTCOView::setColor( QColor _new_color )
bbTrack::bbTrack( trackContainer * _tc ) :
track( BBTrack, _tc )
bbTrack::bbTrack( TrackContainer* tc ) :
track( BBTrack, tc )
{
int bbNum = s_infoMap.size();
s_infoMap[this] = bbNum;
@@ -333,7 +333,7 @@ bbTrack::~bbTrack()
// remove us from TC so bbTrackContainer::numOfBBs() returns a smaller
// value and thus combobox-updating in bbTrackContainer works well
getTrackContainer()->removeTrack( this );
trackContainer()->removeTrack( this );
engine::getBBTrackContainer()->updateComboBox();
}
@@ -391,9 +391,9 @@ bool bbTrack::play( const midiTime & _start, const fpp_t _frames,
trackView * bbTrack::createView( trackContainerView * _tcv )
trackView * bbTrack::createView( TrackContainerView* tcv )
{
return( new bbTrackView( this, _tcv ) );
return new bbTrackView( this, tcv );
}
@@ -454,11 +454,11 @@ void bbTrack::loadTrackSpecificSettings( const QDomElement & _this )
const int src = _this.attribute( "clonebbt" ).toInt();
const int dst = s_infoMap[this];
engine::getBBTrackContainer()->createTCOsForBB( dst );
trackContainer::trackList tl =
TrackContainer::TrackList tl =
engine::getBBTrackContainer()->tracks();
// copy TCOs of all tracks from source BB (at bar "src") to destination
// TCOs (which are created if they do not exist yet)
for( trackContainer::trackList::iterator it = tl.begin();
for( TrackContainer::TrackList::iterator it = tl.begin();
it != tl.end(); ++it )
{
( *it )->getTCO( src )->copy();
@@ -470,7 +470,7 @@ void bbTrack::loadTrackSpecificSettings( const QDomElement & _this )
else
{
QDomNode node = _this.namedItem(
trackContainer::classNodeName() );
TrackContainer::classNodeName() );
if( node.isElement() )
{
( (JournallingObject *)engine::getBBTrackContainer() )->
@@ -539,8 +539,8 @@ void bbTrack::swapBBTracks( track * _track1, track * _track2 )
bbTrackView::bbTrackView( bbTrack * _bbt, trackContainerView * _tcv ) :
trackView( _bbt, _tcv ),
bbTrackView::bbTrackView( bbTrack * _bbt, TrackContainerView* tcv ) :
trackView( _bbt, tcv ),
m_bbTrack( _bbt )
{
setFixedHeight( 32 );
@@ -583,7 +583,7 @@ void bbTrackView::clickedTrackLabel()
bbTrack::numOfBBTrack( m_bbTrack ) );
engine::getBBEditor()->show();
/* foreach( bbTrackView * tv,
getTrackContainerView()->findChildren<bbTrackView *>() )
trackContainerView()->findChildren<bbTrackView *>() )
{
tv->m_trackLabel->update();
}*/

View File

@@ -1,7 +1,7 @@
/*
* pattern.cpp - implementation of class pattern which holds notes
*
* Copyright (c) 2004-2012 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2004-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2005-2007 Danny McRae <khjklujn/at/yahoo.com>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
@@ -40,7 +40,7 @@
#include "embed.h"
#include "engine.h"
#include "piano_roll.h"
#include "track_container.h"
#include "TrackContainer.h"
#include "rename_dialog.h"
#include "sample_buffer.h"
#include "AudioSampleRecorder.h"
@@ -563,7 +563,7 @@ void pattern::ensureBeatNotes()
void pattern::updateBBTrack()
{
if( getTrack()->getTrackContainer() == engine::getBBTrackContainer() )
if( getTrack()->trackContainer() == engine::getBBTrackContainer() )
{
engine::getBBTrackContainer()->updateBBTrack( this );
}

View File

@@ -2,7 +2,7 @@
* sample_track.cpp - implementation of class sampleTrack, a track which
* provides arrangement of samples
*
* Copyright (c) 2005-2010 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2005-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -385,8 +385,8 @@ void sampleTCOView::paintEvent( QPaintEvent * _pe )
sampleTrack::sampleTrack( trackContainer * _tc ) :
track( SampleTrack, _tc ),
sampleTrack::sampleTrack( TrackContainer* tc ) :
track( SampleTrack, tc ),
m_audioPort( tr( "Sample track" ) ),
m_volumeModel( DefaultVolume, MinVolume, MaxVolume, 1.0, this,
tr( "Volume" ) )
@@ -453,9 +453,9 @@ bool sampleTrack::play( const midiTime & _start, const fpp_t _frames,
trackView * sampleTrack::createView( trackContainerView * _tcv )
trackView * sampleTrack::createView( TrackContainerView* tcv )
{
return new sampleTrackView( this, _tcv );
return new sampleTrackView( this, tcv );
}
@@ -505,8 +505,8 @@ void sampleTrack::loadTrackSpecificSettings( const QDomElement & _this )
sampleTrackView::sampleTrackView( sampleTrack * _t, trackContainerView * _tcv ) :
trackView( _t, _tcv )
sampleTrackView::sampleTrackView( sampleTrack * _t, TrackContainerView* tcv ) :
trackView( _t, tcv )
{
setFixedHeight( 32 );