mirror of
https://github.com/mumble-voip/mumble.git
synced 2025-10-26 11:19:16 +00:00
Merge PR #5113: FIX(client, plugin-api): requestLocalUserTransmissionMode
This particular API function was implemented to only set the respective settings variable. However this would not notify any other code part about the change resulting in a potential inconsistency between the UI and the actual settings. Therefore the implementation now delegates the actual setting of the transmission mode to MainWindow::setTransmission mode that takes care of emitting the appropriate signal and informs the user about a change in transmission mode.
This commit is contained in:
commit
6bbcc63101
@ -15,7 +15,7 @@
|
||||
// API version
|
||||
#define MUMBLE_PLUGIN_API_MAJOR_MACRO 1
|
||||
#define MUMBLE_PLUGIN_API_MINOR_MACRO 0
|
||||
#define MUMBLE_PLUGIN_API_PATCH_MACRO 0
|
||||
#define MUMBLE_PLUGIN_API_PATCH_MACRO 1
|
||||
|
||||
const int32_t MUMBLE_PLUGIN_API_MAJOR = MUMBLE_PLUGIN_API_MAJOR_MACRO;
|
||||
const int32_t MUMBLE_PLUGIN_API_MINOR = MUMBLE_PLUGIN_API_MINOR_MACRO;
|
||||
|
||||
@ -636,19 +636,35 @@ void MumbleAPI::requestLocalUserTransmissionMode_v_1_0_x(mumble_plugin_id_t call
|
||||
|
||||
VERIFY_PLUGIN_ID(callerID);
|
||||
|
||||
Settings::AudioTransmit mode;
|
||||
bool identifiedTransmissionMode = false;
|
||||
|
||||
switch (transmissionMode) {
|
||||
case MUMBLE_TM_CONTINOUS:
|
||||
Global::get().s.atTransmit = Settings::AudioTransmit::Continuous;
|
||||
EXIT_WITH(MUMBLE_STATUS_OK);
|
||||
mode = Settings::Continuous;
|
||||
identifiedTransmissionMode = true;
|
||||
break;
|
||||
case MUMBLE_TM_VOICE_ACTIVATION:
|
||||
Global::get().s.atTransmit = Settings::AudioTransmit::VAD;
|
||||
EXIT_WITH(MUMBLE_STATUS_OK);
|
||||
mode = Settings::VAD;
|
||||
identifiedTransmissionMode = true;
|
||||
break;
|
||||
case MUMBLE_TM_PUSH_TO_TALK:
|
||||
Global::get().s.atTransmit = Settings::AudioTransmit::PushToTalk;
|
||||
EXIT_WITH(MUMBLE_STATUS_OK);
|
||||
mode = Settings::PushToTalk;
|
||||
identifiedTransmissionMode = true;
|
||||
break;
|
||||
}
|
||||
|
||||
EXIT_WITH(MUMBLE_EC_UNKNOWN_TRANSMISSION_MODE);
|
||||
if (identifiedTransmissionMode) {
|
||||
if (!Global::get().mw) {
|
||||
EXIT_WITH(MUMBLE_EC_INTERNAL_ERROR);
|
||||
}
|
||||
|
||||
Global::get().mw->setTransmissionMode(mode);
|
||||
|
||||
EXIT_WITH(MUMBLE_STATUS_OK);
|
||||
} else {
|
||||
EXIT_WITH(MUMBLE_EC_UNKNOWN_TRANSMISSION_MODE);
|
||||
}
|
||||
}
|
||||
|
||||
void MumbleAPI::getUserComment_v_1_0_x(mumble_plugin_id_t callerID, mumble_connection_t connection,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user