Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions docs/JSON-RPC.md
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,23 @@ Results:
| result | string | Always "ok". |


### jamulusclient/setInputBoost

Sets the input boost factor.

Parameters:

| Name | Type | Description |
| --- | --- | --- |
| params.boost | int | boost factor, 1 (no boost) to 10. |

Results:

| Name | Type | Description |
| --- | --- | --- |
| result | string | Always "ok". |


### jamulusclient/setMidiSettings

Sets one or more MIDI controller settings.
Expand Down
24 changes: 24 additions & 0 deletions src/clientrpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,30 @@ CClientRpc::CClientRpc ( CClient* pClient, CClientSettings* pSettings, CRpcServe

response["result"] = "ok";
} );

/// @rpc_method jamulusclient/setInputBoost
/// @brief Sets the input boost factor.
/// @param {int} params.boost - boost factor, 1 (no boost) to 10.
/// @result {string} result - Always "ok".
pRpcServer->HandleMethod ( "jamulusclient/setInputBoost", [=] ( const QJsonObject& params, QJsonObject& response ) {
auto boost = params["boost"];
if ( !boost.isDouble() )
{
response["error"] = CRpcServer::CreateJsonRpcError ( CRpcServer::iErrInvalidParams, "Invalid params: boost is not a number" );
return;
}

const int iBoost = boost.toInt();
if ( iBoost < 1 || iBoost > 10 )
{
response["error"] = CRpcServer::CreateJsonRpcError ( CRpcServer::iErrInvalidParams, "Invalid params: boost must be between 1 and 10" );
return;
}

pClient->SetInputBoost ( iBoost );

response["result"] = "ok";
} );
}

QJsonValue CClientRpc::SerializeSkillLevel ( ESkillLevel eSkillLevel )
Expand Down
Loading