-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't give a segment the same name as the track #5528
Comments
This isn't a bug, but normal behavior. |
But for what? |
It was done in this commit as part of this PR. As for why, I wasn't around then so I don't know. @PhysSong I see you were around when this PR was open, do you recall anything about this? |
Interesting. I don't see a reason why other than "improve appearance". |
Let me see If I get this right. When we create a new pattern we set the name to the track name here: Line 61 in a053061
Then some people think that's a bit spammy (I tend to agree with that after removing the code to filter out the track name), so we forbid lmms to write that name on the pattern. It's better to not set the pattern name to the track name in the first place if we don't want it there. I think this should be fixed somehow. |
Something like this. It will make a whole lot of tracks out there reveal hidden track names. I don't know what to do about that though. (edit: please grab this code) diff --git a/src/tracks/Pattern.cpp b/src/tracks/Pattern.cpp
index 26cc1c9..f6924cf 100644
--- a/src/tracks/Pattern.cpp
+++ b/src/tracks/Pattern.cpp
@@ -56,7 +56,6 @@ Pattern::Pattern( InstrumentTrack * _instrument_track ) :
m_patternType( BeatPattern ),
m_steps( MidiTime::stepsPerTact() )
{
- setName( _instrument_track->name() );
if( _instrument_track->trackContainer()
== Engine::getBBTrackContainer() )
{
@@ -1049,12 +1048,7 @@ void PatternView::paintEvent( QPaintEvent * )
diff --git a/src/tracks/Pattern.cpp b/src/tracks/Pattern.cpp
index 26cc1c9..f6924cf 100644
--- a/src/tracks/Pattern.cpp
+++ b/src/tracks/Pattern.cpp
@@ -56,7 +56,6 @@ Pattern::Pattern( InstrumentTrack * _instrument_track ) :
m_patternType( BeatPattern ),
m_steps( MidiTime::stepsPerTact() )
{
- setName( _instrument_track->name() );
if( _instrument_track->trackContainer()
== Engine::getBBTrackContainer() )
{
@@ -1049,12 +1048,7 @@ void PatternView::paintEvent( QPaintEvent * )
// pattern name
p.setRenderHint( QPainter::TextAntialiasing );
- bool isDefaultName = m_pat->name() == m_pat->instrumentTrack()->name();
-
- if( !isDefaultName && m_staticTextName.text() != m_pat->name() )
- {
- m_staticTextName.setText( m_pat->name() );
- }
+ m_staticTextName.setText( m_pat->name() );
QFont font;
font.setHintingPreference( QFont::PreferFullHinting );
@@ -1064,13 +1058,10 @@ void PatternView::paintEvent( QPaintEvent * )
const int textTop = TCO_BORDER_WIDTH + 1;
const int textLeft = TCO_BORDER_WIDTH + 1;
- if( !isDefaultName )
- {
- p.setPen( textShadowColor() );
- p.drawStaticText( textLeft + 1, textTop + 1, m_staticTextName );
- p.setPen( textColor() );
- p.drawStaticText( textLeft, textTop, m_staticTextName );
- }
+ p.setPen( textShadowColor() );
+ p.drawStaticText( textLeft + 1, textTop + 1, m_staticTextName );
+ p.setPen( textColor() );
+ p.drawStaticText( textLeft, textTop, m_staticTextName );
// inner border
if( !( fixedTCOs() && beatPattern ) ) |
Should be possible to write an upgrade routine that clears the pattern name if it matches the track name. It wouldn't break anything, since those names are already invisible the behavior is unchanged for existing projects. |
Yes. I have a rather poor track record with DataFile.cpp though, so I pass that on to someone else. ;) |
If anyone gets around to this before me, go ahead. Just assigning myself so I don't forget that I want to work on this. |
* Automatic formatting changes * Give clips an empty name by default, display all names - Stop giving clips the same name as their parent track on creation - Stop hiding clip names that match the parent track name - Never rename clips on track rename - Never clear clip name when a clip is copied to another track - Create an upgrade routine to clear default names from old projects (< 1.3.0-alpha-1) - Bump version to 1.3.0-alpha-1 * Revert now-unnecessary version bump * Merge with master and fix conflicts * Formatting changes from review * Change weird for loop conditions * Properly revert AutomationPatter.h changes * Only clear names that match our parent track, be more generous with use of legacyFileVersion Co-authored-by: Hyunjin Song <[email protected]>
* Automatic formatting changes * Give clips an empty name by default, display all names - Stop giving clips the same name as their parent track on creation - Stop hiding clip names that match the parent track name - Never rename clips on track rename - Never clear clip name when a clip is copied to another track - Create an upgrade routine to clear default names from old projects (< 1.3.0-alpha-1) - Bump version to 1.3.0-alpha-1 * Revert now-unnecessary version bump * Merge with master and fix conflicts * Formatting changes from review * Change weird for loop conditions * Properly revert AutomationPatter.h changes * Only clear names that match our parent track, be more generous with use of legacyFileVersion Co-authored-by: Hyunjin Song <[email protected]>
Affected LMMS versions
1.2.1
The text was updated successfully, but these errors were encountered: