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:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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() );
|
||||
|
||||
Reference in New Issue
Block a user