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

Refactoring: Move sound sources into src/sound folder #2575

Merged
merged 1 commit into from
May 15, 2022

Conversation

ann0see
Copy link
Member

@ann0see ann0see commented Apr 1, 2022

Short description of changes

Moves the sound.cpp / sound.h / sound.mm files to src/sound/

CHANGELOG: Refactoring: Moved sound API files into src/sound folder. Contributors will now find the sound.cpp/sound.h/sound.mm in the src/sound folder for consistency

Context: Fixes an issue?

Related to: #2573

@pgScorpio, I assume you should also have a look at this PR.

Does this change need documentation? What needs to be documented and how?
Yes

Status of this Pull Request

Waiting on second review

What is missing until this pull request can be merged?

Second review

Checklist

  • I've verified that this Pull Request follows the general code principles
  • I tested my code and it does what I want (works on Linux and Windows. Since the CI is clean it should be ok)
  • My code follows the style guide
  • I waited some time after this Pull Request was opened and all GitHub checks completed without errors.
  • I've filled all the content above

@pgScorpio
Copy link
Contributor

pgScorpio commented Apr 2, 2022

@ann0see
Yes, I will keep an eye on this PR too...

And if we indeed are going to change the src tree we maybe should have a look if it wouldn't be useful to split up some more at the same time... i.e. Common, Client, Server, Protocol,....

EDIT: Also the generated ui_*.h files should not go into root but into a src/generated folder

And would it be possible to get the same structure in the editors (Qt Creator, VS, XCode) too? That would be a great improvement too.

@ann0see ann0see marked this pull request as ready for review April 2, 2022 19:15
Copy link
Member

@hoffie hoffie left a comment

Choose a reason for hiding this comment

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

Didn't have a deeper look yet, just some thoughts. As said elsewhere, I like this idea.

  • Did you check translations? It looks like each .ts file contains references to the source path, so I guess they must/should be updated to match the new location to avoid all translations showing up as new? I haven't checked though if this is really the case. Maybe Qt tooling is intelligent enough to update it itself, but it should be checked nevertheless.
  • Various checks or scripts contain explicit references to our code directories. As everything is moved to the existing src/, this should be fine already, but I'm mentioning it nevertheless.
  • I didn't think of the fact that windows/ etc. are not gone automatically, as they contain build scripts, platform-specific resources (icons, installers). Some (at least mac/) continues to ship source files. Would be nice to get rid of that as well, but maybe in a follow-up PR...
  • I think it would be logical to move the windows/ASIOSDK2 extraction target. Either, it should be moved along with the code which is using it or it could be moved to libs/ where all other third-party stuff lives. As this is closely related to the move of the ASIO sound implementation, I think this should be done in this PR as well. It will likely affect docs and build scripts though.

@hoffie hoffie added this to the Release 3.9.0 milestone Apr 2, 2022
@ann0see
Copy link
Member Author

ann0see commented Apr 2, 2022

Hmm. Moving ASIO around involves some bigger changes, I think?

I'd like to have it in libs.

@ann0see
Copy link
Member Author

ann0see commented Apr 2, 2022

@hoffie just updated the .ts files

@ann0see
Copy link
Member Author

ann0see commented Apr 2, 2022

I didn't think of the fact that windows/ etc. are not gone automatically, as they contain build scripts, platform-specific resources (icons, installers). Some (at least mac/) continues to ship source files. Would be nice to get rid of that as well, but maybe in a follow-up PR...

Yes. But this needs a bit of restructuring other places too...

@pgScorpio
Copy link
Contributor

Hmm. Moving ASIO around involves some bigger changes, I think?

I'd like to have it in libs.

I agree that that seems more consistent. oboe is also in libs.
Though I don't see yet why that would involve bigger changes. Changing base folder is changing base folder, whether it is src/sound/asio/ or src/libs/ doesn't make that much of a difference or do I mis something here ?

@ann0see
Copy link
Member Author

ann0see commented Apr 2, 2022

No. I did that already in this PR - and it seems to build fine.

@pgScorpio
Copy link
Contributor

move sound API files into src/sound folder

To keep related things together please move soundbase.h and soundbase.cpp to ./Sound too !

@ann0see ann0see force-pushed the patch/moveSound branch 3 times, most recently from 133e7fc to 1901792 Compare April 7, 2022 20:53
@ann0see
Copy link
Member Author

ann0see commented Apr 7, 2022

@pgScorpio moved the soundbase files too.

Also added a README stub which you can use for documenting your new design + ideas.

@ann0see ann0see requested a review from hoffie April 8, 2022 19:13
@ann0see
Copy link
Member Author

ann0see commented Apr 8, 2022

What's missing here?

@ann0see ann0see requested a review from pljones April 8, 2022 19:17
Copy link
Contributor

@pgScorpio pgScorpio left a comment

Choose a reason for hiding this comment

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

Looks good to me

Copy link
Member

@hoffie hoffie left a comment

Choose a reason for hiding this comment

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

Looks good to me. Thanks! :)

@ann0see
Copy link
Member Author

ann0see commented Apr 9, 2022

@pljones is this ok to be merged? @pgScorpio depends on this being merged such that he can continue

@ann0see
Copy link
Member Author

ann0see commented Apr 16, 2022

@jamulussoftware/maindevelopers any review here? I think we should merge this.

@ann0see ann0see added the refactoring Non-behavioural changes, Code cleanup label Apr 16, 2022
@ann0see
Copy link
Member Author

ann0see commented Apr 17, 2022

Rebased. I'll open another PR based on this branch moving the other files soon (as requested by @hoffie)

@pljones
Copy link
Collaborator

pljones commented Apr 17, 2022

One thing I noticed when I was doing my various changes... linux/sound.h depends on src/server.h. It shouldn't - not sure if you want to go fixing this here, though. (It means moving the high resolution timer from src/server.* to src/util.* - was a simple cut-n-paste.)

@ann0see
Copy link
Member Author

ann0see commented Apr 17, 2022

I wouldn't want to include it here. This should just move the files without many changes

@pgScorpio
Copy link
Contributor

pgScorpio commented Apr 17, 2022

One thing I noticed when I was doing my various changes... linux/sound.h depends on src/server.h. It shouldn't - not sure if you want to go fixing this here, though.

Should be another PR I think

(It means moving the high resolution timer from src/server.* to src/util.* - was a simple cut-n-paste.)

To keep things clean I would create a new .h/.cpp i.e. 'timers'.
I personally don't call a timer a 'util' and in my opinion util is already becoming a receptacle.

EDIT: This will be solved for linux/sound in the sound-redesign anyway...

@ann0see
Copy link
Member Author

ann0see commented Apr 20, 2022

@pljones could you please review this PR?

The sound.h server.h dependency should be part of another PR, so this isn't blocking.

@ann0see
Copy link
Member Author

ann0see commented Apr 30, 2022

@hoffie @npostavs since you're both familiar with the code could you please review? I assume this is safe to merge.

!exists(windows/ASIOSDK2) {
error("Error: ASIOSDK2 must be placed in Jamulus windows folder.")
!exists(libs/ASIOSDK2/common) {
error("Error: ASIOSDK2 must be placed in Jamulus \\libs folder such that e.g. \\libs\ASIOSDK2\common exists.")
Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, you added two more unescaped backslashes.

I double checked it, and it seems that qmake treats \\x and \x the same (with exception of x = "), so I guess you could just leave them unescaped, but it still seems cleaner to have it escaped, IMO.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok.

@ann0see
Copy link
Member Author

ann0see commented May 9, 2022

Note to maintainers: Should be squash-merged.

@ann0see
Copy link
Member Author

ann0see commented May 9, 2022

Since @pgScorpio depends on this and I think it's save, I will merge this in the following days if nobody objects

@ann0see ann0see force-pushed the patch/moveSound branch from 2b7871b to 8314b2d Compare May 15, 2022 06:06
@ann0see
Copy link
Member Author

ann0see commented May 15, 2022

@jamulussoftware/maindevelopers I will merge this today

@ann0see ann0see merged commit e875d60 into jamulussoftware:master May 15, 2022
@ann0see ann0see deleted the patch/moveSound branch May 15, 2022 06:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring Non-behavioural changes, Code cleanup
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants