• R/O
  • SSH

zandronum-sandbox-stable: Commit


Commit MetaInfo

Revisiónf90298436bd07bcc70e8cea33ac46614122dbebd (tree)
Tiempo2023-10-16 23:29:43
AutorAdam Kaminski <kaminskiadam9@gmai...>
CommiterAdam Kaminski

Log Message

Fixed the +voicerecord button not working properly in Linux.

Cambiar Resumen

Diferencia incremental

diff -r d06dbe932ecc -r f90298436bd0 src/voicechat.cpp
--- a/src/voicechat.cpp Sun Oct 15 19:43:13 2023 -0400
+++ b/src/voicechat.cpp Mon Oct 16 10:29:43 2023 -0400
@@ -262,6 +262,7 @@
262262 bIsInitialized( false ),
263263 bIsActive( false ),
264264 bIsTesting( false ),
265+ bIsRecordButtonPressed( false ),
265266 TransmissionType( TRANSMISSIONTYPE_OFF )
266267 {
267268 proximityInfo.SysChannel = nullptr;
@@ -412,6 +413,7 @@
412413
413414 bIsInitialized = false;
414415 bIsTesting = false;
416+ bIsRecordButtonPressed = false;
415417 Printf( "VoIP controller shutting down.\n" );
416418 }
417419
@@ -538,23 +540,34 @@
538540
539541 // [AK] Check the status of the "voicerecord" button. If the button's been
540542 // pressed, start transmitting, or it's been released stop transmitting.
541- if (( Button_VoiceRecord.bWentUp ) && ( TransmissionType == TRANSMISSIONTYPE_BUTTON ))
542- {
543- StopTransmission( );
544- }
545- else if (( Button_VoiceRecord.bWentDown ) && ( snd_recordvoiceactivity == false ))
543+ if ( Button_VoiceRecord.bDown == false )
546544 {
547- if ( IsVoiceChatAllowed( ))
548- StartTransmission( TRANSMISSIONTYPE_BUTTON, true );
549- // [AK] We can't transmit if we're watching a demo.
550- else if ( CLIENTDEMO_IsPlaying( ))
551- Printf( "Voice chat can't be used during demo playback.\n" );
552- // ...or if we're in an offline game.
553- else if (( NETWORK_GetState( ) == NETSTATE_SINGLE ) || ( NETWORK_GetState( ) == NETSTATE_SINGLE_MULTIPLAYER ))
554- Printf( "Voice chat can't be used in a singleplayer game.\n" );
555- // ...or if the server has disabled voice chatting.
556- else if ( sv_allowvoicechat == VOICECHAT_OFF )
557- Printf( "Voice chat has been disabled by the server.\n" );
545+ if ( bIsRecordButtonPressed )
546+ {
547+ bIsRecordButtonPressed = false;
548+
549+ if ( TransmissionType == TRANSMISSIONTYPE_BUTTON )
550+ StopTransmission( );
551+ }
552+ }
553+ else if ( bIsRecordButtonPressed == false )
554+ {
555+ bIsRecordButtonPressed = true;
556+
557+ if ( snd_recordvoiceactivity == false )
558+ {
559+ if ( IsVoiceChatAllowed( ))
560+ StartTransmission( TRANSMISSIONTYPE_BUTTON, true );
561+ // [AK] We can't transmit if we're watching a demo.
562+ else if ( CLIENTDEMO_IsPlaying( ))
563+ Printf( "Voice chat can't be used during demo playback.\n" );
564+ // ...or if we're in an offline game.
565+ else if (( NETWORK_GetState( ) == NETSTATE_SINGLE ) || ( NETWORK_GetState( ) == NETSTATE_SINGLE_MULTIPLAYER ))
566+ Printf( "Voice chat can't be used in a singleplayer game.\n" );
567+ // ...or if the server has disabled voice chatting.
568+ else if ( sv_allowvoicechat == VOICECHAT_OFF )
569+ Printf( "Voice chat has been disabled by the server.\n" );
570+ }
558571 }
559572
560573 if (( bIsActive == false ) && ( bIsTesting == false ))
diff -r d06dbe932ecc -r f90298436bd0 src/voicechat.h
--- a/src/voicechat.h Sun Oct 15 19:43:13 2023 -0400
+++ b/src/voicechat.h Mon Oct 16 10:29:43 2023 -0400
@@ -229,6 +229,7 @@
229229 bool bIsInitialized;
230230 bool bIsActive;
231231 bool bIsTesting;
232+ bool bIsRecordButtonPressed;
232233 TRANSMISSIONTYPE_e TransmissionType;
233234
234235 // [AK] This is needed for saving the arrays of encoded audio frames while
Show on old repository browser