Skip to content

Misc api calls#3783

Closed
digable1 wants to merge 5 commits into
jamulussoftware:mainfrom
digable1:misc-api-calls
Closed

Misc api calls#3783
digable1 wants to merge 5 commits into
jamulussoftware:mainfrom
digable1:misc-api-calls

Conversation

@digable1

@digable1 digable1 commented Jul 14, 2026

Copy link
Copy Markdown

Add new JSON-RPC API methods, re-factor connect and disconnect to share code between UI and API

CHANGELOG: <!--

  1. Adds jamulusclient/connect, jamulusclient/disconnect, jamulusclient/setCurrentDirectory.
  2. Adds attribute 'result.id' to jamulusclient/getChannelInfo (channel ID)
  3. Copies jamulusclient/getCurrentDirectory, jamulusclient/getDirectories, from earlier PR, as that PR is pending -->

NOTE: It is suggested that some of this works gets split into its own PR, specifically connect and disconnect (which affects other common code and UI behavior). This will be done in a subsequent edit to this PR and the creation another PR to handle the other API additions.

Context: Fixes an issue?

Provides further parity between the API and the UI (more to go)

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

JSON-RPC.md has been updated (auto-generated from source using provided tool)

Status of this Pull Request

This is a working implementation, as far as I know. Being a new developer to the Jamulus codebase, I might have missed a side effect or other issue that I don't know about yet - or corner case(s).

What is missing until this pull request can be merged?

More testing is desirable. It has been tested, but not as deeply as desirable due to internal re-factoring to share code for actions connect and disconnect (these actions alter the UI whether triggered by the UI or API).

Checklist

  • I've verified that this Pull Request follows the general code principles
  • I tested my code and it does what I want
  • 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

@dingodoppelt

dingodoppelt commented Jul 15, 2026

Copy link
Copy Markdown
Member

Thanks for your PR. It seems there was a mishap with commit 2926589

I can't tell if there are any changes that you made in that particular commit.
Could you please try rebasing interactively with git rebase -i HEAD~5 ("5" meaning five commits back or however many commits you'd like to go back in time) and get rid of commit 2926589 if possible?

@dingodoppelt

dingodoppelt commented Jul 15, 2026

Copy link
Copy Markdown
Member

This wasn't straightforward but I think I could extract what you originally intended to push.
@digable1 Could you please check, if I got everything right in 809c5f6

I think you merged your own fork's main (origin/main), which was different from the upstream branch.
You should try to keep your fork's origin/main the same as the upstream main branch so you can rebase on it, or you can add the upstream repo as a remote and fetch main from there.
I rebased your changes on the upstream main branch in 809c5f6 like so:

  • First reset the branch with your additions on upstream main so the changes keep floating on top of main with git reset upstream/main ("upstream" being the name of the remote I added with git remote add upstream https://github.com/jamulussoftware/jamulus)
  • Check which files are in the staging area with git status
  • Clean up the mess. In this particular case:
git restore libs/oboe
git rm -r libs/NSIS/NSIS-source
git add docs/JSON-RPC.md src/client.cpp src/client.h src/clientdlg.cpp src/clientdlg.h src/clientrpc.cpp src/clientrpc.h
  • Finally check again, if only the files you really want to commit are showing with git status. Keep in mind that git commit -a will commit all files listed with git status so better check twice and remove the files from the staging area and only git add the files you actually want to commit

Comment thread src/client.cpp
@@ -92,6 +94,8 @@ CClient::CClient ( const quint16 iPortNumber,
bJitterBufferOK ( true ),
bMuteMeInPersonalMix ( bNMuteMeInPersonalMix ),
iServerSockBufNumFrames ( DEF_NET_BUF_SIZE_NUM_BL ),
bRawAudioIsSupported ( false ),
iMyChannelID ( INVALID_INDEX )
bRawAudioIsSupported ( false )

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This won't compile

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just need the spurious line 99 removed. Presumably left over from a copy/paste.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I already fixed that in 809c5f6 and it compiles fine.

@softins

softins commented Jul 15, 2026

Copy link
Copy Markdown
Member

This wasn't straightforward but I think I could extract what you originally intended to push. @digable1 Could you please check, if I got everything right in 809c5f6

@dingodoppelt your branch git-accident-fix looks fine, comparing with @digable1's original branch, and I see you incorporated the correction to client.cpp

I think you merged your own fork's main (origin/main), which was different from the upstream branch. You should try to keep your fork's origin/main the same as the upstream main branch so you can rebase on it, or you can add the upstream repo as a remote and fetch main from there. I rebased your changes on the upstream main branch in 809c5f6 like so:

Yes, I think the issue was @digable1's first three commits were branched from main back in April, before all the changes to copyright headers were done, and then after that, main was merged back in to the branch instead of rebasing the branch on the new main, resulting in changes to many files.

The technique I use to keep a work-in-progress branch up to date with main is:

  • git switch main (my own main branch)
  • git pull (make sure I'm up to date, in case I last worked from a different machine)
  • git fetch upstream (update my own copy of upstream - actually I usually use git fetch --all)
  • git rebase upstream/main (get my own main up to date with upstream - this should just fast-forward)
  • git push (push my new main back to github)
  • git switch my-wip-branch (change to the branch I'm working on)
  • git rebase main (rebase all my branch changes onto the latest version of main)

If the rebase fails, then I use git mergetool to resolve any conflicts. After resolving any conflicts, or if there were none:

  • git push --force (forcibly push my updated branch back to github)

If I am later on a different machine, I can't just git pull on my work-in-progress branch, because of the rebase. What I do to get another machine in sync is:

  • git fetch origin (or git fetch --all - get the local repo up to date with github)
  • git switch my-wip-branch (will probably say that the branch has diverged from origin)
  • make sure I am satisfied that this machine doesn't have any un-pushed changes on this branch
  • git reset --hard @{u} (reset my local branch to match the remote copy from github)

A separate issue was the inclusion of NSIS-source into @digable1's branch, which was probably just an accident.

(I haven't yet reviewed the actual code for this PR)

@softins

softins commented Jul 15, 2026

Copy link
Copy Markdown
Member

@digable1 as a suggestion, the easiest way for you to get your branch up to date would be as follows:

git switch misc-api-calls
# keep a ref to the old branch before resetting
git branch misc-api-calls-old
git remote add dingodoppelt https://github.com/dingodoppelt/jamulus.git
git fetch --all
git reset --hard dingodoppelt/git-accident-fix
git push --force
# optionally, to tidy up
git remote remove dingodoppelt

@digable1 digable1 closed this Jul 15, 2026
@digable1
digable1 deleted the misc-api-calls branch July 15, 2026 15:00
@digable1

digable1 commented Jul 16, 2026

Copy link
Copy Markdown
Author

I marked this as a draft - and such I wasn't actually expecting this to looked at.

Yeah I saw those merges and didn't know the codebase well enough, which is why I accepted both. Again, not expecting this to actually be reviewed because I marked it as a draft.

  1. I did re-do the nfs-jamulus repo - it should now be correct (not that it matters), branch 'misc-api-calls'. However, It still has the API calls from the previous, although it should not have the initial merge conflicts that you apparently also found and fixed.
  2. I also separated connect and disconnect into it's own branch and was about to write a new PR right now, not marked 'Draft', in a repo nfs-jamulus branch 'connect-disconnect'. This was due to the suggestion that I separate it due to the fact this previously ran into issues and was unsuccessful at that time. And this one does not have the previous commit API calls - just connect and disconnect.

Sorry for the insanity.

Bottom line: Are we there yet, at least as a PR (pending review)?

@digable1

Copy link
Copy Markdown
Author

@dingodoppelt - #3783

This wasn't straightforward but I think I could extract what you originally intended to push. @digable1 Could you please check, if I got everything right in 809c5f6

From what I could tell eyeballing this particular commit, it looks good.

I am a bit concerned about the message "This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository." that is displayed in that commit. I had not seen that before, and while I know it's not nefarious, the results from a search for that string suggested it (looks like it really is missing an original source for that commit?)

So: In case this helps...

  1. My source for this is in repo 'digable1/nfs-jamulus', branch 'misc-api-calls' - forked from here.
  2. Synced my fork from the jamulus parent today (July 18, 2026)
  3. Made a copy of the codebase and compiled it on a rPi5 box - and tested it (ran 'netcat' for API testing - this box has the build tools such as make/qmake/Jack/etc)
    a. New API calls worked, including GUI updates when connecting and disconnecting from the API for GUI (such as button state)
    b. Audio connection and everything else on the app continued working.

Which means: If there was any issues in creating branch 809c5f6, you should be able to update from 'digable1/nfs-jamulus', branch 'misc-api-calls' and it should not have the merge conflicts you ran into out of the gate (as I think I mentioned earlier, I ran into them myself - which is why I marked it a Draft, so I knew I needed to take care of that, but you beat me to it). If it helps, I can do another PR without any hiccups like merge issues or stale code due to forgetting to pull (I think that's what happened) - or fix this PR.

Bottom line: I think this your work on this PR is good, with that potentially weird message notwithstanding.

Code-wise: At first blush my biggest concern is do we have the right scope for some of the bookeeping attributes this API-or-GUI connect/disconnect functionality - likely due to my newbieness with the codebase. And there could be duplicate code that shouldn't be there (should have been extracted into common methods).

And of course, unit tests and e2e tests would help, with a test suite (I know, I'm becoming an endless media loop on this, and we all know this would help - just finding the time and person-power for it). Just sayin...

@digable1 digable1 mentioned this pull request Jul 20, 2026
5 tasks
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.

3 participants