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

iOS sound support 2 #1865

Closed
wants to merge 108 commits into from
Closed

iOS sound support 2 #1865

wants to merge 108 commits into from

Conversation

ngocdh
Copy link
Contributor

@ngocdh ngocdh commented Jun 12, 2021

I messed #1512 up. So this is a brand new branch for iOS sound support. I hope this is not creating much trouble for the team.

TODO: clang-format

ios/sound.mm Show resolved Hide resolved
ios/sound.mm Outdated
//vecsTmpAudioSndCrdStereo.Init ( iCoreAudioBufferSizeStereo );

return iCoreAudioBufferSizeMono;
void checkStatus(int status){
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why are these global?

Also style is wrong here. I think clang-format is ignoring the .mm files, which it should treat like .cpp files.

@@ -65,6 +65,9 @@ CChatDlg::CChatDlg ( QWidget* parent ) : CBaseDlg ( parent, Qt::Window ) // use
connect ( action, SIGNAL ( triggered() ), this, SLOT ( close() ) );
#endif

#if defined( ANDROID ) || defined( Q_OS_ANDROID )
Copy link
Collaborator

Choose a reason for hiding this comment

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

Again, this change is for iOS, so why this android change?

@@ -375,6 +375,17 @@ CClientDlg::CClientDlg ( CClient* pNCliP,
pMenu->addMenu ( pEditMenu );
pMenu->addMenu ( new CHelpMenu ( true, this ) );

#if defined( Q_OS_IOS ) or defined( Q_OS_ANDROID ) or defined( ANDROID )
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd suggest this whole change - switching input device - be split out from the main pull request. It will make more sense as a separate change to have both iOS and android support then. Here the android bit looks lost.

@pljones
Copy link
Collaborator

pljones commented Jun 13, 2021

OK, now I can see what's going on, I'd like the introduction of the new feature of selecting input device split into a separate change, dependent upon this one.

There's a lot happening here already. Having that in as an "different thing" just makes this PR too big, in my opinion.

Also, there are too many commits to simply merge this - we'd have to squash and that's a bit messy. Or someone would have to tidy it up a bit.

@gilgongo gilgongo mentioned this pull request Jun 13, 2021
@ngocdh
Copy link
Contributor Author

ngocdh commented Jun 13, 2021

Thank you @pljones for the thorough review. I’ll check the .mm file style.

About the input selection feature, it would be complicated for me to split, now that the iOS PR is not yet merged.

And yeah I’d love to have my commits tidied up.

ngocdh added a commit to ngocdh/jamulus that referenced this pull request Jun 13, 2021
Review of jamulussoftware#1865 by @pljones revealed .mm extension was not checked.
@ann0see
Copy link
Member

ann0see commented Jun 13, 2021

About the input selection feature, it would be complicated for me to split, now that the iOS PR is not yet merged.

Yes, but the other problem is we can't merge this as is (#1865 (comment)). Can you have a look at related commits and describe which features this PR exactly adds?

  1. Add iOS support
  2. Allow switching between intenal/external microphones

If we exactly know what you changed, we can try to get this into smaller commits.

See solution 3 here: https://about.gitlab.com/blog/2018/06/07/keeping-git-commit-history-clean/

@ngocdh
Copy link
Contributor Author

ngocdh commented Jun 13, 2021

Ok so here comes some explanation for this PR:

  • My 1st commit (d9abe62) was for iOS sound support, meaning iOS sound fully worked in this commit
  • While testing on my iPhone, I felt the need to implement a feature: "switching between intenal/external microphones/devices". However, the feature depends on the first unmerged commit, so I couldn't just create another unrelated branch. I had to continue to develop on the same branch. 2 next commits did this task.
  • While that feature worked great on iPhone, I thought maybe Android could benefit the same, so I wrote the Android part. That's when things got messy: I could have written the Android part in a separated branch, but since the same feature was written for iOS, I figured maybe I could just add code in the same branch.
    I also didn't have a proper dev environment for Android, so I wrote directly on github.com and wait for the auto-build to finish to test the apk (yeah I know you can laugh at me). The following long list of commits were because of this. (Actually it's a bit more complicated, this feature is not yet fully complete in Android: it's working, but you have to know how to make it work, i.e. it's not a few clicks away. For it to be complete: java code, and thus a bridge must be involved).
  • Then some more commits to reduce the launch time in iOS, some to fix a socket crash in socket.cpp, specific to iOS environment, some to fix clang style.

The key here is: that additional feature could only have been implemented in a separate PR if the iOS sound support code had already been merged.

@ann0see
Copy link
Member

ann0see commented Jun 13, 2021

Ok. Thanks for this explanation. This means that we can probably reduce the number of commits dramatically:

Commit 1: Add iOS sound support

This should also include the code which fixes the crash, formatting and the removal of the libraries to reduce the launch time.

Commit 2: Allow automatic switching between internal/external audio devices (iOS)
You can branch off an unmerged branch by using git checkout -b myNewFeature while being on the branch with the changes you made.

Commit 3: Add initial auto switching of audio device to Android

You'd squash all the related commits into one or even better use fixup in an interactive rebase.

@ngocdh
Copy link
Contributor Author

ngocdh commented Jun 13, 2021

I'm not sure what to do.
I tried git rebase -i to squash commits related to ios sound only and already got conflicts...

The best thing I can do now, I think is to create a new branch from jamulus master, manually apply changes from this branch, and then remove all android related changes. That way I have a new iOS-only PR. Let's just say the feature comes with the sound support in iOS. Android can come later.

@ngocdh ngocdh mentioned this pull request Jun 14, 2021
5 tasks
@ngocdh
Copy link
Contributor Author

ngocdh commented Jun 14, 2021

Closing this as I've created #1875 for iOS, and a clean commit history.
Will create other PRs for Android.

@ngocdh ngocdh closed this Jun 14, 2021
@ngocdh ngocdh deleted the ngocdhmaster2 branch June 16, 2021 04:54
ann0see pushed a commit to ngocdh/jamulus that referenced this pull request Feb 27, 2022
Review of jamulussoftware#1865 by @pljones revealed .mm extension was not checked.
ann0see added a commit that referenced this pull request Feb 27, 2022
* Add .mm extension to coding style check

Review of #1865 by @pljones revealed .mm extension was not checked.

* .clang-format for ObjC

* Apply clang-format to sound.mm

* Apply clang format on all .mm files

Co-authored-by: ann0see <20726856+ann0see@users.noreply.github.com>
@ann0see
Copy link
Member

ann0see commented Mar 9, 2022

unrelated: @hoffie I just ran your changelog-helper script and it listed this PR as being added to the next release?

@ann0see
Copy link
Member

ann0see commented Mar 9, 2022

I'd just add CHANGELOG: SKIP

@hoffie
Copy link
Member

hoffie commented Mar 9, 2022

unrelated: @hoffie I just ran your changelog-helper script and it listed this PR as being added to the next release?

Yes, as it was referenced in fac5d9d (which will be part of 3.9.0).
Meta: Maybe we should work on this in a new Issue if that's considered a generic problem.

@ann0see
Copy link
Member

ann0see commented Mar 9, 2022

Yes. It’s at least counter intuitive to have a closed PR in the changelog. On the other hand I think feature branch merges are not in the changelog (basically also an edge-case)

pgScorpio pushed a commit to pgScorpio/jamulus that referenced this pull request Mar 28, 2022
* Add .mm extension to coding style check

Review of jamulussoftware#1865 by @pljones revealed .mm extension was not checked.

* .clang-format for ObjC

* Apply clang-format to sound.mm

* Apply clang format on all .mm files

Co-authored-by: ann0see <20726856+ann0see@users.noreply.github.com>
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.

4 participants