name-property in trackContentObject-class

git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1173 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Tobias Doerffel
2008-06-25 11:58:54 +00:00
parent 939fd8ef44
commit 50075770f5
7 changed files with 47 additions and 35 deletions

View File

@@ -1,5 +1,18 @@
2008-06-25 Tobias Doerffel <tobydox/at/users/dot/sourceforge/dot/net>
* include/track.h:
* include/pattern.h:
* include/bb_track.h:
* src/tracks/bb_track.cpp:
* src/tracks/pattern.cpp:
* src/core/track.cpp:
name-property in trackContentObject-class
* include/automation_pattern.h:
* src/core/automation_pattern.cpp:
- added submenu for removing connections
- made automation-pattern rename working
* src/core/automation_pattern.cpp:
fixed loading song-global automation

View File

@@ -58,7 +58,6 @@ public:
private:
QString m_name;
unsigned int m_color;

View File

@@ -91,19 +91,6 @@ public:
void checkType( void );
// pattern-name functions
inline const QString & name( void ) const
{
return( m_name );
}
inline void setName( const QString & _name )
{
m_name = _name;
emit dataChanged();
}
// functions which are part of freezing-feature
inline bool freezing( void ) const
{
@@ -163,7 +150,6 @@ private:
instrumentTrack * m_instrumentTrack;
PatternTypes m_patternType;
QString m_name;
// data-stuff
noteVector m_notes;

View File

@@ -66,20 +66,35 @@ class trackContentObject : public model, public journallingObject
Q_OBJECT
public:
trackContentObject( track * _track );
// trackContentObject( const trackContentObject & _copy );
virtual ~trackContentObject();
inline track * getTrack( void )
{
return( m_track );
}
inline const QString & name( void ) const
{
return( m_name );
}
inline void setName( const QString & _name )
{
m_name = _name;
emit dataChanged();
}
inline const midiTime & startPosition( void ) const
{
return( m_startPosition );
}
inline midiTime endPosition( void ) const
{
return( m_startPosition + m_length );
}
inline const midiTime & length( void ) const
{
return( m_length );
@@ -96,7 +111,6 @@ public:
virtual trackContentObjectView * createView( trackView * _tv ) = 0;
protected:
virtual void undoStep( journalEntry & _je );
virtual void redoStep( journalEntry & _je );
@@ -124,6 +138,8 @@ private:
} ;
track * m_track;
QString m_name;
midiTime m_startPosition;
midiTime m_length;

View File

@@ -109,6 +109,7 @@ textFloat * trackContentObjectView::s_textFloat = NULL;
trackContentObject::trackContentObject( track * _track ) :
model( _track ),
m_track( _track ),
m_name( QString::null ),
m_startPosition(),
m_length(),
m_mutedModel( FALSE, this )
@@ -968,9 +969,9 @@ void trackContentWidget::changePosition( const midiTime & _new_pos )
// first show TCO for current BB...
for( tcoViewVector::iterator it = m_tcoViews.begin();
it != m_tcoViews.end(); ++it )
it != m_tcoViews.end(); ++it )
{
if( ( *it )->getTrackContentObject()->
if( ( *it )->getTrackContentObject()->
startPosition().getTact() == cur_bb )
{
( *it )->move( 0, ( *it )->y() );
@@ -986,8 +987,8 @@ void trackContentWidget::changePosition( const midiTime & _new_pos )
for( tcoViewVector::iterator it = m_tcoViews.begin();
it != m_tcoViews.end(); ++it )
{
if( ( *it )->getTrackContentObject()->
startPosition().getTact() != cur_bb )
if( ( *it )->getTrackContentObject()->
startPosition().getTact() != cur_bb )
{
( *it )->hide();
}

View File

@@ -51,10 +51,6 @@ bbTrack::infoMap bbTrack::s_infoMap;
bbTCO::bbTCO( track * _track, unsigned int _color ) :
trackContentObject( _track ),
m_name(/* ( dynamic_cast<bbTrack *>( _track ) != NULL ) ?
dynamic_cast<bbTrack *>( _track )->trackLabel()->text() :
QString( "" )*/
"" ),
m_color( _color > 0 ? _color : qRgb( 64, 128, 255 ) )
{
tact t = engine::getBBTrackContainer()->lengthOfBB(
@@ -79,7 +75,7 @@ bbTCO::~bbTCO()
void bbTCO::saveSettings( QDomDocument & _doc, QDomElement & _this )
{
_this.setAttribute( "name", m_name );
_this.setAttribute( "name", name() );
if( _this.parentNode().nodeName() == "clipboard" )
{
_this.setAttribute( "pos", -1 );
@@ -98,7 +94,7 @@ void bbTCO::saveSettings( QDomDocument & _doc, QDomElement & _this )
void bbTCO::loadSettings( const QDomElement & _this )
{
m_name = _this.attribute( "name" );
setName( _this.attribute( "name" ) );
if( _this.attribute( "pos" ).toInt() >= 0 )
{
movePosition( _this.attribute( "pos" ).toInt() );
@@ -216,7 +212,7 @@ void bbTCOView::paintEvent( QPaintEvent * )
p.setFont( pointSize<7>( p.font() ) );
p.setPen( QColor( 0, 0, 0 ) );
p.drawText( 2, p.fontMetrics().height() - 1, m_bbTCO->m_name );
p.drawText( 2, p.fontMetrics().height() - 1, m_bbTCO->name() );
if( m_bbTCO->isMuted() )
{
@@ -243,9 +239,9 @@ void bbTCOView::resetName( void )
{
if( dynamic_cast<bbTrackView *>( getTrackView() ) != NULL )
{
m_bbTCO->m_name =
m_bbTCO->setName(
dynamic_cast<bbTrackView *>( getTrackView() )->
trackLabel()->text();
trackLabel()->text() );
}
}
@@ -254,8 +250,10 @@ void bbTCOView::resetName( void )
void bbTCOView::changeName( void )
{
renameDialog rename_dlg( m_bbTCO->m_name );
QString s = m_bbTCO->name();
renameDialog rename_dlg( s );
rename_dlg.exec();
m_bbTCO->setName( s );
}

View File

@@ -66,12 +66,12 @@ pattern::pattern( instrumentTrack * _instrument_track ) :
trackContentObject( _instrument_track ),
m_instrumentTrack( _instrument_track ),
m_patternType( BeatPattern ),
m_name( _instrument_track->name() ),
m_steps( midiTime::stepsPerTact() ),
m_frozenPattern( NULL ),
m_freezing( FALSE ),
m_freezeAborted( FALSE )
{
setName( _instrument_track->name() );
init();
}
@@ -82,7 +82,6 @@ pattern::pattern( const pattern & _pat_to_copy ) :
trackContentObject( _pat_to_copy.m_instrumentTrack ),
m_instrumentTrack( _pat_to_copy.m_instrumentTrack ),
m_patternType( _pat_to_copy.m_patternType ),
m_name( "" ),
m_steps( _pat_to_copy.m_steps ),
m_frozenPattern( NULL ),
m_freezeAborted( FALSE )
@@ -324,7 +323,7 @@ void pattern::checkType( void )
void pattern::saveSettings( QDomDocument & _doc, QDomElement & _this )
{
_this.setAttribute( "type", m_patternType );
_this.setAttribute( "name", m_name );
_this.setAttribute( "name", name() );
// as the target of copied/dragged pattern is always an existing
// pattern, we must not store actual position, instead we store -1
// which tells loadSettings() not to mess around with position
@@ -362,7 +361,7 @@ void pattern::loadSettings( const QDomElement & _this )
m_patternType = static_cast<PatternTypes>( _this.attribute( "type"
).toInt() );
m_name = _this.attribute( "name" );
setName( _this.attribute( "name" ) );
if( _this.attribute( "pos" ).toInt() >= 0 )
{
movePosition( _this.attribute( "pos" ).toInt() );