Skip to content
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

Rename BB and TCO to clip and pattern in save files #6309

Merged
merged 1 commit into from
Feb 14, 2022

Conversation

allejok96
Copy link
Contributor

Upgrade method in DataFile + renamed some tags used internally to clone pattern tracks

SAVING FILES WITH THIS WILL MAKE INCOMPATIBLE TO OLDER LMMS (BB tracks will be empty)!

Things to test

  • open old project, check automation, instruments, samples and patterns aka BBs
  • save project as new, open and check again
  • midi export
  • cloning patterns aka BB tracks

@LmmsBot
Copy link

LmmsBot commented Feb 13, 2022

🤖 Hey, I'm @LmmsBot from github.com/lmms/bot and I made downloads for this pull request, click me to make them magically appear! 🎩

Windows

Linux

macOS

🤖
{"platform_name_to_artifacts": {"Windows": [{"artifact": {"title": {"title": "32-bit", "platform_name": "Windows"}, "link": {"link": "https://15746-15778896-gh.circle-artifacts.com/0/lmms-1.3.0-alpha.1.171%2Bge6b86eb49-mingw-win32.exe"}}, "build_link": "https://circleci.com/gh/LMMS/lmms/15746?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link"}, {"artifact": {"title": {"title": "64-bit", "platform_name": "Windows"}, "link": {"link": "https://15744-15778896-gh.circle-artifacts.com/0/lmms-1.3.0-alpha.1.171%2Bge6b86eb49-mingw-win64.exe"}}, "build_link": "https://circleci.com/gh/LMMS/lmms/15744?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link"}, {"artifact": {"title": {"title": "32-bit", "platform_name": "Windows"}, "link": {"link": "https://ci.appveyor.com/api/buildjobs/cf39n0wt0mla31ej/artifacts/build/lmms-1.3.0-alpha-msvc2017-win32.exe"}}, "build_link": "https://ci.appveyor.com/project/Lukas-W/lmms/builds/42570392"}, {"artifact": {"title": {"title": "64-bit", "platform_name": "Windows"}, "link": {"link": "https://ci.appveyor.com/api/buildjobs/ng8ugl5ki2qft76m/artifacts/build/lmms-1.3.0-alpha-msvc2017-win64.exe"}}, "build_link": "https://ci.appveyor.com/project/Lukas-W/lmms/builds/42570392"}], "Linux": [{"artifact": {"title": {"title": "(AppImage)", "platform_name": "Linux"}, "link": {"link": "https://15747-15778896-gh.circle-artifacts.com/0/lmms-1.3.0-alpha.1.171%2Bge6b86eb49-linux-x86_64.AppImage"}}, "build_link": "https://circleci.com/gh/LMMS/lmms/15747?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link"}], "macOS": [{"artifact": {"title": {"title": "", "platform_name": "macOS"}, "link": {"link": "https://15743-15778896-gh.circle-artifacts.com/0/lmms-1.3.0-alpha.1.171%2Bge6b86eb49-mac10.14.dmg"}}, "build_link": "https://circleci.com/gh/LMMS/lmms/15743?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link"}]}, "commit_sha": "111b4fdf8444e689a69014c42f1f44c30d89d3c3"}

Copy link
Contributor

@JohannesLorenz JohannesLorenz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review finished. Only 2 minor comments.

The code covers the tags of all renamed classes, renames the tags correctly and consistently.

@allejok96
Copy link
Contributor Author

Should we replace Beat/Bassline with Pattern in the track names when opening an older project file? Like this older upgrade:

s.replace( QRegExp( "^Beat/Baseline " ),

@Veratil
Copy link
Contributor

Veratil commented Feb 13, 2022

Should we replace Beat/Bassline with Pattern in the track names when opening an older project file? Like this older upgrade:

s.replace( QRegExp( "^Beat/Baseline " ),

My opinion is yes.

@allejok96
Copy link
Contributor Author

Replacing done for the English strings, I couldn't figure out how to get tr() working in this scope.

Copy link
Contributor

@JohannesLorenz JohannesLorenz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code is OK.

A bit ugly to use the constant "1" for type "PatternTrack", but I guess you wanted to save compile time to not include Track.h?

@JohannesLorenz
Copy link
Contributor

I'll continue with test review.

@JohannesLorenz JohannesLorenz self-requested a review February 13, 2022 20:38
@allejok96
Copy link
Contributor Author

A bit ugly to use the constant "1" for type "PatternTrack", but I guess you wanted to save compile time

Nah, laziness + relying on the fact that 1 will need to remain for backwards compatibility even if the enum changes in the future.

@Veratil
Copy link
Contributor

Veratil commented Feb 13, 2022

A bit ugly to use the constant "1" for type "PatternTrack", but I guess you wanted to save compile time

Nah, laziness + relying on the fact that 1 will need to remain for backwards compatibility even if the enum changes in the future.

We should use the enum honestly.

Copy link
Contributor

@JohannesLorenz JohannesLorenz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test report:

  • A note from SampleClip does not survive the conversion MMP -> MIDI -> MMP => Same issue on master
  • Found one bug in PatternEditor: Open new project -> Clone PatternTrack in SongEditor -> Move clone over original (the reorder is necessary) -> Open PatternEditor -> Select original (if not already selected) -> Remove original from SongEditor -> PatternEditor shows a track without a grid => Same issue on master
  • No other issues found

IMO, ready to merge. If you want to change the "1", you can test it yourself, no further review for that.

@allejok96
Copy link
Contributor Author

U sure @Veratil ? A change to the enum would break this (admittedly very silly) upgrade routine. So it would be for the looks only. But on the other hand, why would it ever change...

@Veratil
Copy link
Contributor

Veratil commented Feb 13, 2022

U sure @Veratil ? A change to the enum would break this (admittedly very silly) upgrade routine. So it would be for the looks only. But on the other hand, why would it ever change...

Yes, we should be explicit and not guess at the number it's suppose to be. I'm not going to call it a blocker at this point, but it's something we shouldn't overlook. It's not that it will never change, but that it's the correct way.

@Veratil
Copy link
Contributor

Veratil commented Feb 13, 2022

We can still merge it now, to be clear. It's just something we should start focusing on later.

@JohannesLorenz
Copy link
Contributor

We also still need a commit message. Does the current title fit? It does not name "pattern" yet, which is changed to "midiclip".

Let Veratil/me know when we should merge.

... and clarify how PatternTrack cloning works

- pattern -> midiclip
- automationpattern -> automationclip
- *tco -> *clip
- bb* -> pattern*
- bbtrackcontainer -> patternstore
@allejok96
Copy link
Contributor Author

@JohannesLorenz, I've squashed the commits and given it a proper message.

The only lines changes since before the force-push is #include "Track.h" and line 1819 and 1820.

I think I found a golden middle way using static_assert in combination with TrackType. So now things like "Find references to symbol" works, but it can never silently break. Ok @Veratil ?

@Veratil
Copy link
Contributor

Veratil commented Feb 14, 2022

I think I found a golden middle way using static_assert in combination with TrackType. So now things like "Find references to symbol" works, but it can never silently break. Ok @Veratil ?

I didn't even think about static_assert, but it doesn't hurt for sanity checks. 👍

@JohannesLorenz
Copy link
Contributor

Perfect. Time to merge then 🚀

Thanks for the PR, again.

@JohannesLorenz JohannesLorenz merged commit f56fc68 into LMMS:master Feb 14, 2022
@allejok96 allejok96 deleted the bbTcoDataFile branch March 22, 2022 19:36
@zonkmachine
Copy link
Member

@allejok96 This creates issues with some older projects. Try demos/DnB

@allejok96
Copy link
Contributor Author

Uhoh, thanks for the heads up. I've verified that DnB works before this PR and is broken after. Interestingly enough an older version of DnB still works after this PR... The search goes on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants