diff options
author | Thorvald Natvig <slicer@users.sourceforge.net> | 2007-08-07 21:06:50 +0400 |
---|---|---|
committer | Thorvald Natvig <slicer@users.sourceforge.net> | 2007-08-07 21:06:50 +0400 |
commit | 681c77fd58eeeec31c2a890f64215c39a38dede0 (patch) | |
tree | d5ea5b99c4bdb010f4d464ad139bda90e80309ec | |
parent | e2f1dfe88a837d0abe649ad476711cc598424770 (diff) |
PushToLink implies AltSpeak
git-svn-id: https://mumble.svn.sourceforge.net/svnroot/mumble/trunk@709 05730e5d-ab1b-0410-a4ac-84af385074fa
-rw-r--r-- | src/Message.h | 2 | ||||
-rw-r--r-- | src/mumble/AudioInput.cpp | 6 | ||||
-rw-r--r-- | src/mumble/ConfigDialog.cpp | 1 | ||||
-rw-r--r-- | src/mumble/Global.cpp | 2 | ||||
-rw-r--r-- | src/mumble/Global.h | 2 | ||||
-rw-r--r-- | src/mumble/MainWindow.cpp | 23 |
6 files changed, 22 insertions, 14 deletions
diff --git a/src/Message.h b/src/Message.h index 887634cea..87f6e0c01 100644 --- a/src/Message.h +++ b/src/Message.h @@ -62,7 +62,7 @@ class MessageSpeex : public Message { void saveStream(PacketDataStream &) const; void restoreStream(PacketDataStream &); public: - enum { AltSpeak = 0x01, LoopBack = 0x02, EndSpeech = 0x04, FrameCountMask = 0x50 }; + enum { AltSpeak = 0x01, LoopBack = 0x02, EndSpeech = 0x04, FrameCountMask = 0x30 }; unsigned int iSeq; // Flags is in first byte of packet. QByteArray qbaSpeexPacket; diff --git a/src/mumble/AudioInput.cpp b/src/mumble/AudioInput.cpp index 2ed30c9ee..23fd47a64 100644 --- a/src/mumble/AudioInput.cpp +++ b/src/mumble/AudioInput.cpp @@ -315,7 +315,7 @@ void AudioInput::encodeAudioFrame() { else if (g.s.atTransmit == Settings::PushToTalk) iIsSpeech = 0; - iIsSpeech = iIsSpeech || (g.iPushToTalk > 0) || g.bAltSpeak; + iIsSpeech = iIsSpeech || (g.iPushToTalk > 0) || (g.iAltSpeak > 0); if (g.s.bMute || (p && p->bMute) || g.bPushToMute) { iIsSpeech = 0; @@ -330,7 +330,7 @@ void AudioInput::encodeAudioFrame() { } if (p) - p->setTalking(iIsSpeech, g.bAltSpeak); + p->setTalking(iIsSpeech, (g.iAltSpeak > 0)); if (g.s.bPushClick && (g.s.atTransmit == Settings::PushToTalk)) { AudioOutputPtr ao = g.ao; @@ -382,7 +382,7 @@ void AudioInput::flushCheck() { return; unsigned char flags = 0; - if (g.bAltSpeak) + if (g.iAltSpeak > 0) flags += MessageSpeex::AltSpeak; if (g.lmLoopMode == Global::Server) flags += MessageSpeex::LoopBack; diff --git a/src/mumble/ConfigDialog.cpp b/src/mumble/ConfigDialog.cpp index 724c2b4bb..9e9f6069f 100644 --- a/src/mumble/ConfigDialog.cpp +++ b/src/mumble/ConfigDialog.cpp @@ -163,6 +163,7 @@ void ConfigDialog::apply() { // They might have changed their keys. g.iPushToTalk = 0; + g.iAltSpeak = 0; } void ConfigDialog::accept() { diff --git a/src/mumble/Global.cpp b/src/mumble/Global.cpp index 43cc72b2f..71b36a872 100644 --- a/src/mumble/Global.cpp +++ b/src/mumble/Global.cpp @@ -39,9 +39,9 @@ Global::Global() { p = 0; uiSession = 0; iPushToTalk = 0; + iAltSpeak = 0; bPushToMute = false; bCenterPosition = false; - bAltSpeak = false; lmLoopMode = None; dPacketLoss = 0; dMaxPacketDelay = 0.0; diff --git a/src/mumble/Global.h b/src/mumble/Global.h index 29b2080ea..f4861a3c5 100644 --- a/src/mumble/Global.h +++ b/src/mumble/Global.h @@ -66,9 +66,9 @@ struct Global { QSettings *qs; Overlay *o; int iPushToTalk; + int iAltSpeak; bool bPushToMute; bool bCenterPosition; - bool bAltSpeak; LoopMode lmLoopMode; double dPacketLoss; double dMaxPacketDelay; diff --git a/src/mumble/MainWindow.cpp b/src/mumble/MainWindow.cpp index b660591db..3d95c50c9 100644 --- a/src/mumble/MainWindow.cpp +++ b/src/mumble/MainWindow.cpp @@ -921,28 +921,35 @@ void MainWindow::on_PushToMute_triggered(bool down) { } void MainWindow::on_AltPushToTalk_triggered(bool down) { - if (down) + if (down) { + g.iAltSpeak++; g.iPushToTalk++; - else if (g.iPushToTalk) + } else if (g.iPushToTalk) { + g.iAltSpeak--; g.iPushToTalk--; - - g.bAltSpeak = down; + } } void MainWindow::on_CenterPos_triggered(bool down) { g.bCenterPosition = down; - if (down) + if (down) { + g.iAltSpeak++; g.iPushToTalk++; - else if (g.iPushToTalk) + } else if (g.iPushToTalk) { + g.iAltSpeak--; g.iPushToTalk--; + } } void MainWindow::pushLink(bool down) { - if (down) + if (down) { + g.iAltSpeak++; g.iPushToTalk++; - else if (g.iPushToTalk) + } else if (g.iPushToTalk) { + g.iAltSpeak--; g.iPushToTalk--; + } if (g.uiSession == 0) return; |