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

Move widget files, add folder for track and instrument #6374

Merged
merged 3 commits into from
May 29, 2022

Conversation

allejok96
Copy link
Contributor

@allejok96 allejok96 commented Apr 14, 2022

Moving files in src/gui, no change to their source. Updated translations accordingly.

  • gui/clips for *ClipView
  • gui/editors for editors and their child widgets
  • gui/instrument for InstrumentTrackWindow and child widgets
  • gui/tracks for *TrackView and child widgets
  • gui/widgets for generic widgets only

@allejok96
Copy link
Contributor Author

I didn't touch LinkedModelGroupViews, Controls and ControlLayout. I wonder if @JohannesLorenz thinks these should be moved out of widgets ?

@LmmsBot
Copy link

LmmsBot commented Apr 14, 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://output.circle-artifacts.com/output/job/f1bacb40-4840-4e39-aeba-30782cc04215/artifacts/0/lmms-1.3.0-alpha.1.189+gef9e92a91-mingw-win32.exe"}}, "build_link": "https://circleci.com/gh/LMMS/lmms/16899?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link"}, {"artifact": {"title": {"title": "64-bit", "platform_name": "Windows"}, "link": {"link": "https://output.circle-artifacts.com/output/job/4a2226c3-09a5-4e9c-9ee4-d7cbac59fbb8/artifacts/0/lmms-1.3.0-alpha.1.189+gef9e92a91-mingw-win64.exe"}}, "build_link": "https://circleci.com/gh/LMMS/lmms/16897?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/eo4fqj24n8o3qd0u/artifacts/build/lmms-1.3.0-alpha-msvc2017-win32.exe"}}, "build_link": "https://ci.appveyor.com/project/Lukas-W/lmms/builds/43635922"}, {"artifact": {"title": {"title": "64-bit", "platform_name": "Windows"}, "link": {"link": "https://ci.appveyor.com/api/buildjobs/b5enk7ejxk6trce0/artifacts/build/lmms-1.3.0-alpha-msvc2017-win64.exe"}}, "build_link": "https://ci.appveyor.com/project/Lukas-W/lmms/builds/43635922"}], "Linux": [{"artifact": {"title": {"title": "(AppImage)", "platform_name": "Linux"}, "link": {"link": "https://output.circle-artifacts.com/output/job/1a4f2f60-c4a3-4cea-b437-c715d4813a30/artifacts/0/lmms-1.3.0-alpha.1.189+gef9e92a91-linux-x86_64.AppImage"}}, "build_link": "https://circleci.com/gh/LMMS/lmms/16895?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link"}], "macOS": [{"artifact": {"title": {"title": "", "platform_name": "macOS"}, "link": {"link": "https://output.circle-artifacts.com/output/job/a0b411cc-2ccd-429a-9c92-02609b81d05b/artifacts/0/lmms-1.3.0-alpha.1.189+gef9e92a91-mac10.14.dmg"}}, "build_link": "https://circleci.com/gh/LMMS/lmms/16898?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link"}]}, "commit_sha": "dfb051efdcd9050094622943080ee01f64b56ae7"}

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.

A few thoughts

  • PositionLine is only used in editors, right? Maybe it should live in the editors folder.
  • I'm not sure how I feel about ClipViews being in the track folder. I understand the reasoning, but that's not where I would expect them to be if I were searching for them.

Looks good otherwise

@allejok96
Copy link
Contributor Author

I'm not sure how I feel about ClipViews being in the track folder.

I share that feeling 😅 but it would be nice if they lived together in a directory, even if it's only 5 of them.

PositionLine is only used in editors, right? Maybe it should live in the editors folder.

I could see that. Same goes for TimeLineWidget, StepRecorderWidget and Rubberband.

@JohannesLorenz
Copy link
Contributor

I didn't touch LinkedModelGroupViews, Controls and ControlLayout.

I designed Controls and ControlLayout as generic-purpose widgets, so I think they can stay in widgets.

For LinkedModelGroupViews, this is only useful if you have a dynamic set of controls (e.g. TripleOscillator is static, but e.g. Lv2, LADSPA etc. are dynamic, because the controls depend on the loaded plugin). Due to their complexity and their rare use case (Lv2 currently, possibly LADSPA, VST), I'd rather say not widgets?

@allejok96
Copy link
Contributor Author

Okay so LinkedModelGroupViews goes.

I'd like to move out ControlLayout too since it's not a QWidget even if it's general purpose (similarly to ActionGroup).

@JohannesLorenz
Copy link
Contributor

I'd like to move out ControlLayout too since it's not a QWidget even if it's general purpose (similarly to ActionGroup).

Sounds good!

@allejok96
Copy link
Contributor Author

I don't know what the consensus is for more small widgets in the editors folder and a separate clips folder (like @Spekular insinuated), but I've made those changes. Now let's see what the people think.

@PhysSong
Copy link
Member

Why is InstrumentTrackWindow.cpp in gui/instrument while SampleTrackWindow.cpp is in gui and InstrumentTrackView.cpp is in gui/tracks?
I think InstrumentTrackWindow.cpp should stay in gui unless we move SampleTrackWindow.cpp to gui/tracks.

@allejok96
Copy link
Contributor Author

I understand how it can get confusing with many classes named "instrument". The instrument directory should really be called instrumentwindow to avoid all confusion...

Why is InstrumentTrackWindow.cpp in gui/instrument while SampleTrackWindow.cpp is in gui?

I thought it made sense to put the window in the same directory as all its children, but I'll reverse it if I get a second opinion.

Why is InstrumentTrackView.cpp is in gui/tracks?

InstrumentTrackView is a track (view)

... unless we move SampleTrackWindow.cpp to gui/tracks

SampleTrackWindow is not a track, and not a child to a track (view)

@allejok96
Copy link
Contributor Author

allejok96 commented Apr 20, 2022

I need some opinions before I can continue (will have to fix a lot of strings)

  • Is instrument a good name for the directory that holds the instrument window and it's stuff?
  • Should TrackContainerView be in tracks or editors? (it's actually a base class of SongEditor)
  • Is it ok to put editor specific widgets, like TimeLineWidget, into editors?

@Spekular
Copy link
Member

Makes more sense to put TrackContainerView in editors than tracks, IMO, since it's the parent to both the song and pattern editors. I lean towards yes for the other two questions.

@JohannesLorenz
Copy link
Contributor

My opinion would be a copy of Spekular's:

  1. Yes. What other name would fit better if it has instrument specific GUI stuff?
  2. In editors. Because if our philosophy is that everything in tracks is a widget used inside tracks, then TrackContainerView would not fit SongEditor (which contains tracks). Also, it's more like an editor to me.
  3. Yes. I think we said everything inside "editors" should be a widget used inside editors.

@allejok96
Copy link
Contributor Author

Thank goodness for the Unix toolbox. This oneliner finds all renamed files since a given commit and updates all strings to use the new path (works only for paths relative to base of repo). Maybe you might find it useful.

git ls-tree -rz --name-only HEAD | xargs -0 sed -i -f <(git diff --raw ENTER_COMMIT_ID_HERE | sed -En 's/.*R[0-9]+\t(.*)\t(.*)/s^\1^\2^g/p')

@allejok96
Copy link
Contributor Author

I've squashed the commits, ready for review.

@JohannesLorenz
Copy link
Contributor

@allejok96 While users are reviewing, if you rebase a local copy of this branch on #6379 (or wait until it's in master), you can check your locale updates.

@allejok96
Copy link
Contributor Author

@JohannesLorenz Strings look alright, except for PatternClipView which will cause a conflict with #6379 if I rename. Either I wait for check-strings to be merged, or you resolve the conflict later.

@JohannesLorenz
Copy link
Contributor

@JohannesLorenz Strings look alright, except for PatternClipView which will cause a conflict with #6379 if I rename. Either I wait for check-strings to be merged, or you resolve the conflict later.

Both is OK to me. I'd say first come first serve?

@allejok96
Copy link
Contributor Author

I wait until the renames of this PR are approved.

@JohannesLorenz
Copy link
Contributor

If it's just for moving forward, I'd help you by reviewing this PR, but I'm rarely involved in GUI stuff, so I'm not a good candidate. I might try a review if no one else does it in the next days... 🥲

@allejok96
Copy link
Contributor Author

@JohannesLorenz and @Spekular's suggestions has been added. @PhysSong had some concerns - maybe we can get a second opinion? Or else we're good to go, as long as it builds 🙃

@JohannesLorenz JohannesLorenz self-requested a review May 20, 2022 17:03
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.

Most widgets reside where I'd expect them. A few points:

  1. MixerLineLcdSpinbox sounds a bit non-generic. Should it be in src/gui?
  2. I wonder if SubWindow is so generic that it should go down into widgets?
  3. Should we add a folder src/gui/base-classes? (AutomatableButton, SideBarWidget, ControllerDialog...)
  4. We have a lot of ...Views. Extra folder src/gui/views?
  5. I wonder why we have an extra directory for editors, but leave the non-modal dialogs (EffectControlDialog) in src/gui. After all, aren't they both some kind of windows inside the MainWindow?

Anyways, these are all just suggestions. The PR is OK.

@allejok96
Copy link
Contributor Author

I wonder why we have an extra directory for editors, but leave the non-modal dialogs (EffectControlDialog) in src/gui.

I aimed to group things by concept rather than if it's a base/derived class, if it contains a specific word, or if it's located at a specific level in the GUI. I find this approach more helpful when looking for where a certain feature is implemented. So editors are for the main editors of LMMS and their specialized widgets. You'd never call EffectControlDialog an editor, so it's excluded.

MixerLineLcdSpinbox sounds a bit non-generic. Should it be in src/gui?

Perhaps. I just put it where all of the other Lcd* siblings were, since there are a few.

I wonder if SubWindow is so generic that it should go down into widgets?

On the other hand it's mostly used by MainWindow. Personally I wouldn't look for it in widgets.

@JohannesLorenz
Copy link
Contributor

I'd say let's merge it, then?

@PhysSong
Copy link
Member

I'm still not sure where InstrumentTrackWindow.cpp should be, but I'm okay with the others.

@JohannesLorenz
Copy link
Contributor

Note: As I merged the check-strings branch prior to this PR, it might be good if you rebase on master and see if CI still passes.

Add clips, tracks and instrument directory, clean up widgets.
@allejok96
Copy link
Contributor Author

PatternClipView which will cause a conflict

Lol I forgot to update my own remark. Well, now we know that CI works 😄

@DomClark DomClark merged commit d2dd7e3 into LMMS:master May 29, 2022
@allejok96 allejok96 deleted the widgetsRename branch July 2, 2022 18:06
sakertooth pushed a commit to sakertooth/lmms that referenced this pull request May 30, 2023
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.

6 participants