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 TCO and related to Clip #6226

Merged
merged 46 commits into from
Jan 14, 2022
Merged

Rename TCO and related to Clip #6226

merged 46 commits into from
Jan 14, 2022

Conversation

M374LX
Copy link
Contributor

@M374LX M374LX commented Nov 28, 2021

Rebasing #6044.

Renaming "pattern" to something else on the data file is a task for another PR. Thus, this one does not touch the data file.

As in #6044, this PR does not include renaming BB to Pattern.

@LmmsBot
Copy link

LmmsBot commented Nov 28, 2021

🤖 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

🤖
{"platform_name_to_artifacts": {"Windows": [{"artifact": {"title": {"title": "32-bit", "platform_name": "Windows"}, "link": {"link": "https://ci.appveyor.com/api/buildjobs/360d3o9twib9n5n3/artifacts/build/lmms-1.3.0-alpha-msvc2017-win32.exe"}}, "build_link": "https://ci.appveyor.com/project/Lukas-W/lmms/builds/42135894"}, {"artifact": {"title": {"title": "64-bit", "platform_name": "Windows"}, "link": {"link": "https://ci.appveyor.com/api/buildjobs/ao20uxtxxaah3mo0/artifacts/build/lmms-1.3.0-alpha-msvc2017-win64.exe"}}, "build_link": "https://ci.appveyor.com/project/Lukas-W/lmms/builds/42135894"}]}, "commit_sha": "dd2e4ea60d9abc5da96e020a5911729f156d1158"}

@M374LX M374LX changed the title (WIP) Rename TCO and related to Clip Rename TCO and related to Clip Nov 28, 2021
@M374LX M374LX marked this pull request as ready for review November 28, 2021 23:21
@JohannesLorenz
Copy link
Contributor

Thanks for your contribution. Is this ready to review?

@M374LX
Copy link
Contributor Author

M374LX commented Dec 2, 2021

It is mostly ready for review, except that the locales are pending.

Should we leave the locales for another PR?

@JohannesLorenz
Copy link
Contributor

I don't know what you mean by locales. Will changing those locales cause many conflicts for other PRs?

@M374LX
Copy link
Contributor Author

M374LX commented Dec 2, 2021

The locales I refer to are the files in data/locale. Commits between e4dab80 and e2ae1fa update the file names on the locales, but fully replacing "pattern" with "clip" on the locales where appropriate is yet to be done.

@JohannesLorenz
Copy link
Contributor

I asked in our Discord, but got no answer. I'm not sure if this can/must be done here or in Transifex. I wish anyone could help here...

@Spekular
Copy link
Member

Since we've now got an answer...

You could use sed to fix that, or you could tell me and I will do the fix and sync with Transifex

... this PR can either be merged, or updated to upgrade the locales as well, correct?

@JohannesLorenz
Copy link
Contributor

this PR can either be merged, or updated to upgrade the locales as well, correct?

I'd say let's upgrade this PR (if @M374LX has time). And then, a review will be required.

@M374LX
Copy link
Contributor Author

M374LX commented Dec 13, 2021

@Spekular It is possibly not appropriate to replace every single occurrence of "pattern" with "clip" on the locales, which means that simply running sed -i 's/pattern/clip/g' data/locale/*.ts is not a good idea.

I plan to check this in the next days.

@M374LX
Copy link
Contributor Author

M374LX commented Dec 20, 2021

I think the task of updating the locales should be left for someone with more experience on Transifex.

Update: I am going to update the locales directly just in case (done on fffa09b).

@JohannesLorenz
Copy link
Contributor

I am going to update the locales directly just in case

OK, but what is left to do on Transifex then?

@M374LX
Copy link
Contributor Author

M374LX commented Dec 21, 2021

Possibly just update the line numbers on the locale files in case Transifex has this ability.

@JohannesLorenz
Copy link
Contributor

Update which line numbers? You didn't change line number in fffa09b, did you?

@M374LX
Copy link
Contributor Author

M374LX commented Dec 21, 2021

No line numbers have been changed by fffa09b, but some line number references on the locale files are outdated due to previous changes (not necessarily from this PR) that caused tr() calls to be moved to different lines.

@JohannesLorenz
Copy link
Contributor

Somehow, git difftool tells me that data/themes/classic/pat_rec.png was changed, but I can't see the difference. Do you know what that means?

@M374LX
Copy link
Contributor Author

M374LX commented Dec 23, 2021

pat_rec.png has been renamed to clip_rec.png.

@JohannesLorenz JohannesLorenz self-requested a review December 26, 2021 11:30
@JohannesLorenz
Copy link
Contributor

I'll review this.

What's the intended scope? I guess it's point 1-3 from the reorg point, so:

  • Rename TCO -> Clip
  • Rename Pattern -> MidiClip
  • Rename *TCO and *TCOView -> *Clip and *ClipView

And renaming BB to Pattern is not done yet because the PR blocks itself (i.e. there will be a following PR).

Is this all correct?

@M374LX
Copy link
Contributor Author

M374LX commented Dec 26, 2021

That is all correct, @JohannesLorenz.

@JohannesLorenz
Copy link
Contributor

JohannesLorenz commented Dec 27, 2021

I just see that the locales still contain TrackContentWidget. Is that wanted?

Edit: Now I see that the code contains them, too. Wanted?

@M374LX
Copy link
Contributor Author

M374LX commented Dec 27, 2021

TrackContentWidget has not been renamed. It refers to the area on which clips (previously track content objects) are shown. Unless someone suggests a better name, I would say it is wanted.

c5f17bf fixes two small oversights in comments.

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.

Review finished. I added comments to the code. Despite from those comments:

  1. Some remaining "Pattern" are left. They are shown using git grep -i pattern. I see that in at least in 3 Plugins. Not all might be pattern in sense of "clip", but at least, in "plugins/MidiExport/MidiExport.h", I guess writeBBPattern should be changed.
  2. The Wiki should be checked for TCO and others, too (submodule in doc/wiki).

src/gui/ClipView.cpp Show resolved Hide resolved
include/MidiClip.h Outdated Show resolved Hide resolved
include/NotePlayHandle.h Outdated Show resolved Hide resolved
include/NotePlayHandle.h Outdated Show resolved Hide resolved
include/Song.h Outdated Show resolved Hide resolved
include/BasicFilters.h Outdated Show resolved Hide resolved
include/ClipView.h Outdated Show resolved Hide resolved
src/core/DataFile.cpp Outdated Show resolved Hide resolved
src/core/midi/MidiPort.cpp Outdated Show resolved Hide resolved
src/gui/LmmsStyle.cpp Outdated Show resolved Hide resolved
@JohannesLorenz
Copy link
Contributor

@M374LX Looks like you resolved all my comments. Should I re-review already, or still wait?

@M374LX
Copy link
Contributor Author

M374LX commented Jan 1, 2022

No problem in reviewing the code again, but I have not yet reviewed the remaining occurrences of "pattern" with git grep -i pattern and the Wiki.

@JohannesLorenz
Copy link
Contributor

No problem in reviewing the code again, but I have not yet reviewed the remaining occurrences of "pattern" with git grep -i pattern and the Wiki.

Oh, OK. I'll wait. Let me know when you're through with everything.

@M374LX M374LX requested a review from JohannesLorenz January 9, 2022 20:14
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.

Thanks for your time! Only 4 quick points:

  1. I think you forgot to revert those occurrences of "clips" strings:
src/gui/ClipView.cpp:   QDomElement clips = dataFile.content().firstChildElement( "clips" );
src/gui/widgets/TrackContentWidget.cpp: QDomElement clipParent = dataFile.content().firstChildElement( "clips" );
src/gui/widgets/TrackContentWidget.cpp: QDomElement clipParent = dataFile.content().firstChildElement( "clips" );
  1. Fix pattern in HydrogenImport and MidiExport plugins? At least, plugins/HydrogenImport/HydrogenImport.cpp has it partially changed, but partially not. Is that really wanted? And plugins/MidiExport/MidiExport.h should probably treated in the same way as HydrogenImport (they are both very similar).

  2. Change pattern here?
    src/gui/ClipView.cpp: "elidedPatternName"?
    src/gui/editors/PianoRoll.cpp: "detuningPattern"?

  3. Wiki: Can you please edit the files directly or push them into the submodule and submit them there?

@M374LX
Copy link
Contributor Author

M374LX commented Jan 11, 2022

I suggest keeping "pattern" in HydrogenImport because this is the term used by Hydrogen project files (example: https://github.com/hydrogen-music/hydrogen/blob/master/data/demo_songs/TR808kit-demo.h2song).

@M374LX M374LX requested a review from JohannesLorenz January 12, 2022 00:04
@JohannesLorenz
Copy link
Contributor

Before I can review, there is still a build error. I copied this from the "appveyor" build:

--   Fetching doc/wiki @ --depth 100
Submodule 'doc/wiki' (https://github.com/lmms/lmms.wiki.git) registered for path 'doc/wiki'
Cloning into 'C:/projects/lmms/doc/wiki'...
fatal: remote error: upload-pack: not our ref 069fa1fc1a1784e944629431100c979d50b9f0a3
fatal: the remote end hung up unexpectedly
Fetched in submodule path 'doc/wiki', but it did not contain 069fa1fc1a1784e944629431100c979d50b9f0a3. Direct fetching of that commit failed.

Did you forget to push your wiki submodule?

@M374LX
Copy link
Contributor Author

M374LX commented Jan 12, 2022

This is the message when trying to push the wiki submodule:

remote: Resolving deltas: 100% (247/247), completed with 2 local objects.
To https://github.com/M374LX/lmms.wiki.git
 ! [remote rejected] clip-rename -> clip-rename (shallow update not allowed)
error: failed to push some refs to 'https://github.com/M374LX/lmms.wiki.git'

@PhysSong
Copy link
Member

@M374LX Could you try git fetch --unshallow on the wiki submodule before pushing?

@M374LX
Copy link
Contributor Author

M374LX commented Jan 12, 2022

@PhysSong The message disappeared after trying the suggested command.

@JohannesLorenz Did it solve the problem?

@PhysSong
Copy link
Member

@M374LX I think you pushed to the wiki on your fork. I pushed your changes to LMMS/lmms.

@JohannesLorenz
Copy link
Contributor

Works here. Will review it in the next days.

@JohannesLorenz
Copy link
Contributor

Perfect. Now, we need a good commit message, so we can squash all commits into one. Proposal:

Rename TCO and related to Clip (without savefiles)

This PR renames

    TCO -> Clip
    Pattern -> MidiClip
    *TCO and *TCOView -> *Clip and *ClipView

The savefiles are not yet modified by this PR

@M374LX Feel free to modify and tell me when we can squash-merge it.

@M374LX
Copy link
Contributor Author

M374LX commented Jan 13, 2022

@JohannesLorenz The suggested commit message is fine.

The PR is ready for merge.

@JohannesLorenz JohannesLorenz merged commit 55d361f into LMMS:master Jan 14, 2022
Copy link
Member

@Spekular Spekular left a comment

Choose a reason for hiding this comment

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

This breaks two old upgrades, and lacks its own upgrade routine.

src/core/DataFile.cpp Outdated Show resolved Hide resolved
src/core/DataFile.cpp Outdated Show resolved Hide resolved
@M374LX
Copy link
Contributor Author

M374LX commented Jan 14, 2022

@Spekular I am going to open a new PR to fix the breakage soon. As for the lack of its own upgrade routine, it is because this PR is not intended to touch the data files (the breakage you pinpointed is a slip).

@Spekular
Copy link
Member

it is because this PR is not intended to touch the data files

I think this is a mistake, unless there's some benefit that I'm not seeing. IMHO data file upgrades should come with the PRs that need them, because otherwise we get commits (which are basically versions) with broken backwards compatibility.

  • Until the upgrade PR is created and merged, anyone building master will be unable to load any projects.
  • If we had nightlies up and running they'd be useless until the upgrade routine came in.
  • Anyone bisecting an issue where they need to load a project will be inconvenienced if they land on these commits.

@JohannesLorenz
Copy link
Contributor

Oh no, how could we oversee this! Sorry. Should we force-push-remove the merge commit in this case? It's a bit late, but seems the most clean to me.

Alternatively, we should push a fix really fast. Though that does not help with your bisecting argument.

@M374LX
Copy link
Contributor Author

M374LX commented Jan 14, 2022

As it is easy to fix, I see no reason for a force-push-remove. I can do the fix later today.

@JohannesLorenz
Copy link
Contributor

Thanks. I should be able to review and merge your fixes today, too. We can still force-push later if that should ever be wanted.

m_tco->movePosition( pos );
AutomationPattern::resolveAllIDs();
TimePos pos = m_clip->startPosition();
QDomElement clips = dataFile.content().firstChildElement( "tcos" ); //TODO: rename "tcos" to "clips"
Copy link
Contributor

Choose a reason for hiding this comment

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

Any reason tcos was kept here?

Copy link
Contributor

Choose a reason for hiding this comment

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

Because the PR intends to not change anything in the Datafile?

Copy link
Contributor

Choose a reason for hiding this comment

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

This is just a dummy datafile tho, for clipboard and drag-n-drop, should be safe... here's a better link

@allejok96
Copy link
Contributor

{ "sampleclip", {"src"} },

This breaks loading of old project bundles with sample tracks

@Spekular
Copy link
Member

[...] data file upgrades should come with the PRs that need them, because otherwise we get commits [...] with broken backwards compatibility.

Or in this case, it apparently would have worked fine if the existing upgrade routines hadn't been affected: #5592 (comment)

Apologies for the untested (incorrect) claims, it never occurred to me that LMMS would ignore the tag names on load.

While we're on the topic, I saw a lot of lines with "tco" and one with "pattern" reintroduced in #6279, these will be changed back to "clip" in a later PR, right? (e.g. the data file upgrade PR?)

@JohannesLorenz
Copy link
Contributor

While we're on the topic, I saw a lot of lines with "tco" and one with "pattern" reintroduced in #6279, these will be changed back to "clip" in a later PR, right? (e.g. the data file upgrade PR?)

Yes, that's the plan.

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.

7 participants