Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Davide Beatrici <[email protected]>
  • Loading branch information
main-- and davidebeatrici authored Mar 26, 2024
1 parent 0c8ca18 commit a9d7e9f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions src/mumble/AudioInput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1248,12 +1248,14 @@ void AudioInput::onUserMuteDeafStateChanged() {
const ClientUser *user = qobject_cast< ClientUser * >(QObject::sender());
updateUserMuteDeafState(user);
}

void AudioInput::updateUserMuteDeafState(const ClientUser *user) {
bool bMuted = user->bSuppress || user->bSelfMute;
if (bUserIsMuted != bMuted) {
bUserIsMuted = bMuted;
onUserMutedChanged();
}
}

void AudioInput::onUserMutedChanged() {
}
1 change: 1 addition & 0 deletions src/mumble/AudioInput.h
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ class AudioInput : public QThread {

protected:
virtual void onUserMutedChanged();

public slots:
void onUserMuteDeafStateChanged();
};
Expand Down
3 changes: 2 additions & 1 deletion src/mumble/Messages.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,11 @@ void MainWindow::msgServerSync(const MumbleProto::ServerSync &msg) {
connect(user, SIGNAL(muteDeafStateChanged()), this, SLOT(userStateChanged()));
connect(user, SIGNAL(prioritySpeakerStateChanged()), this, SLOT(userStateChanged()));
connect(user, SIGNAL(recordingStateChanged()), this, SLOT(userStateChanged()));

AudioInputPtr audioIn = Global::get().ai;
if (audioIn) {
audioIn->updateUserMuteDeafState(user);
QObject::connect(user, &ClientUser::muteDeafStateChanged, &*audioIn, &AudioInput::onUserMuteDeafStateChanged);
QObject::connect(user, &ClientUser::muteDeafStateChanged, audioIn.get(), &AudioInput::onUserMuteDeafStateChanged);
}

qstiIcon->setToolTip(tr("Mumble: %1").arg(Channel::get(Channel::ROOT_ID)->qsName.toHtmlEscaped()));
Expand Down
6 changes: 2 additions & 4 deletions src/mumble/PipeWire.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,13 +311,11 @@ void PipeWireEngine::queueBuffer(pw_buffer *buffer) {
}
}

void PipeWireEngine::setActive(bool active) {
void PipeWireEngine::setActive(const bool active) {
pws->pw_thread_loop_lock(m_thread);
pws->pw_stream_set_active(m_stream, active);
pws->pw_thread_loop_unlock(m_thread);
}


PipeWireInput::PipeWireInput() {
m_engine = std::make_unique< PipeWireEngine >("Capture", this, processCallback);
if (!m_engine->isOk()) {
Expand Down Expand Up @@ -368,7 +366,7 @@ void PipeWireInput::run() {
}
void PipeWireInput::onUserMutedChanged() {
if (bUserIsMuted && Global::get().s.bTxMuteCue) {
// do not disable the stream if mute cue is enabled (otherwise mute cue will not work)
// Do not disable the stream if mute cue is enabled (otherwise mute cue will not work).
return;
}

Expand Down

0 comments on commit a9d7e9f

Please sign in to comment.