diff --git a/include/bb_track.h b/include/bb_track.h index a4c440f4c..c436477bf 100644 --- a/include/bb_track.h +++ b/include/bb_track.h @@ -53,10 +53,13 @@ public: { return( m_color ); } + inline static unsigned int defaultColor() + { + return qRgb( 128, 182, 175 ); + } virtual trackContentObjectView * createView( trackView * _tv ); - private: unsigned int m_color; diff --git a/src/core/DataFile.cpp b/src/core/DataFile.cpp index f3d5f7067..5b7fd738a 100644 --- a/src/core/DataFile.cpp +++ b/src/core/DataFile.cpp @@ -41,6 +41,9 @@ #include "Effect.h" #include "lmmsversion.h" +// bbTCO::defaultColor() +#include "bb_track.h" + DataFile::typeDescStruct @@ -680,6 +683,18 @@ void DataFile::upgrade() } + // new default colour for B&B tracks + QDomNodeList list = elementsByTagName( "bbtco" ); + for( int i = 0; !list.item( i ).isNull(); ++i ) + { + QDomElement el = list.item( i ).toElement(); + unsigned int rgb = el.attribute( "color" ).toUInt(); + if( rgb == qRgb( 64, 128, 255 ) ) + { + el.setAttribute( "color", bbTCO::defaultColor() ); + } + } + // Time-signature if ( !m_head.hasAttribute( "timesig_numerator" ) ) { diff --git a/src/tracks/bb_track.cpp b/src/tracks/bb_track.cpp index 651fa2e33..c51138e45 100644 --- a/src/tracks/bb_track.cpp +++ b/src/tracks/bb_track.cpp @@ -48,7 +48,7 @@ bbTrack::infoMap bbTrack::s_infoMap; bbTCO::bbTCO( track * _track, unsigned int _color ) : trackContentObject( _track ), - m_color( _color > 0 ? _color : qRgb( 128, 182, 175 ) ) + m_color( _color > 0 ? _color : defaultColor() ) { tact_t t = engine::getBBTrackContainer()->lengthOfBB( bbTrack::numOfBBTrack( getTrack() ) );