-
Notifications
You must be signed in to change notification settings - Fork 239
Add MIDI GUI tab and learn function #3502
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
Draft
ignotus666
wants to merge
2
commits into
jamulussoftware:main
Choose a base branch
from
ignotus666:midi-gui-learn
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,7 +25,9 @@ | |
|
|
||
| #include "clientrpc.h" | ||
|
|
||
| CClientRpc::CClientRpc ( CClient* pClient, CRpcServer* pRpcServer, QObject* parent ) : QObject ( parent ) | ||
| CClientRpc::CClientRpc ( CClient* pClient, CClientSettings* pSettings, CRpcServer* pRpcServer, QObject* parent ) : | ||
| QObject ( parent ), | ||
| m_pSettings ( pSettings ) | ||
| { | ||
| /// @rpc_notification jamulusclient/chatTextReceived | ||
| /// @brief Emitted when a chat text is received. | ||
|
|
@@ -355,6 +357,78 @@ CClientRpc::CClientRpc ( CClient* pClient, CRpcServer* pRpcServer, QObject* pare | |
| pClient->SetControllerInFaderLevel ( jsonChannelIndex.toInt(), jsonLevel.toInt() ); | ||
| response["result"] = "ok"; | ||
| } ); | ||
|
|
||
| /// @rpc_method jamulusclient/getMidiSettings | ||
| /// @brief Returns all MIDI controller settings. | ||
| /// @param {object} params - No parameters (empty object). | ||
| /// @result {object} result - MIDI settings object. | ||
| pRpcServer->HandleMethod ( "jamulusclient/getMidiSettings", [=] ( const QJsonObject& params, QJsonObject& response ) { | ||
| QJsonObject jsonMidiParams{ { "bUseMIDIController", m_pSettings->bUseMIDIController }, | ||
| { "midiChannel", m_pSettings->iMidiChannel }, | ||
| { "midiMuteMyself", m_pSettings->iMidiMuteMyself }, | ||
| { "midiFaderOffset", m_pSettings->iMidiFaderOffset }, | ||
| { "midiFaderCount", m_pSettings->iMidiFaderCount }, | ||
| { "midiPanOffset", m_pSettings->iMidiPanOffset }, | ||
| { "midiPanCount", m_pSettings->iMidiPanCount }, | ||
| { "midiSoloOffset", m_pSettings->iMidiSoloOffset }, | ||
| { "midiSoloCount", m_pSettings->iMidiSoloCount }, | ||
| { "midiMuteOffset", m_pSettings->iMidiMuteOffset }, | ||
| { "midiMuteCount", m_pSettings->iMidiMuteCount } }; | ||
| response["result"] = jsonMidiParams; | ||
| Q_UNUSED ( params ); | ||
| } ); | ||
|
|
||
| /// @rpc_method jamulusclient/setMidiSettings | ||
| /// @brief Sets one or more MIDI controller settings. | ||
| /// @param {object} params - Any subset of MIDI settings fields to set. | ||
| /// @result {string} result - Always "ok". | ||
| pRpcServer->HandleMethod ( "jamulusclient/setMidiSettings", [=] ( const QJsonObject& params, QJsonObject& response ) { | ||
pljones marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| if ( params.contains ( "bUseMIDIController" ) ) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do I trust Gemini to write C++? (And it followed Jamulus coding style better than I did...) |
||
| { | ||
| m_pSettings->bUseMIDIController = params["bUseMIDIController"].toBool(); | ||
| } | ||
| if ( params.contains ( "midiChannel" ) ) | ||
| { | ||
| m_pSettings->iMidiChannel = params["midiChannel"].toInt(); | ||
| } | ||
| if ( params.contains ( "midiMuteMyself" ) ) | ||
| { | ||
| m_pSettings->iMidiMuteMyself = params["midiMuteMyself"].toInt(); | ||
| } | ||
| if ( params.contains ( "midiFaderOffset" ) ) | ||
| { | ||
| m_pSettings->iMidiFaderOffset = params["midiFaderOffset"].toInt(); | ||
| } | ||
| if ( params.contains ( "midiFaderCount" ) ) | ||
| { | ||
| m_pSettings->iMidiFaderCount = params["midiFaderCount"].toInt(); | ||
| } | ||
| if ( params.contains ( "midiPanOffset" ) ) | ||
| { | ||
| m_pSettings->iMidiPanOffset = params["midiPanOffset"].toInt(); | ||
| } | ||
| if ( params.contains ( "midiPanCount" ) ) | ||
| { | ||
| m_pSettings->iMidiPanCount = params["midiPanCount"].toInt(); | ||
| } | ||
| if ( params.contains ( "midiSoloOffset" ) ) | ||
| { | ||
| m_pSettings->iMidiSoloOffset = params["midiSoloOffset"].toInt(); | ||
| } | ||
| if ( params.contains ( "midiSoloCount" ) ) | ||
| { | ||
| m_pSettings->iMidiSoloCount = params["midiSoloCount"].toInt(); | ||
| } | ||
| if ( params.contains ( "midiMuteOffset" ) ) | ||
| { | ||
| m_pSettings->iMidiMuteOffset = params["midiMuteOffset"].toInt(); | ||
| } | ||
| if ( params.contains ( "midiMuteCount" ) ) | ||
| { | ||
| m_pSettings->iMidiMuteCount = params["midiMuteCount"].toInt(); | ||
| } | ||
| response["result"] = "ok"; | ||
| } ); | ||
| } | ||
|
|
||
| QJsonValue CClientRpc::SerializeSkillLevel ( ESkillLevel eSkillLevel ) | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move it all into SetSettings (and move SetSettings into client.cpp of course). You won't need that
if ( *pSettings )then, as you'll seepSettings = settingsjust having been done.