Skip to content
Merged
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
13 changes: 13 additions & 0 deletions src/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@ CClient::CClient ( const quint16 iPortNumber,

QObject::connect ( &Sound, &CSound::ControllerInFaderIsMute, this, &CClient::OnControllerInFaderIsMute );

QObject::connect ( &Sound, &CSound::ControllerInMuteMyself, this, &CClient::OnControllerInMuteMyself );

QObject::connect ( &Socket, &CHighPrioSocket::InvalidPacketReceived, this, &CClient::OnInvalidPacketReceived );

QObject::connect ( pSignalHandler, &CSignalHandler::HandledSignal, this, &CClient::OnHandledSignal );
Expand Down Expand Up @@ -704,6 +706,17 @@ void CClient::OnControllerInFaderIsMute ( int iChannelIdx, bool bIsMute )
emit ControllerInFaderIsMute ( iChannelIdx, bIsMute );
}

void CClient::OnControllerInMuteMyself ( bool bMute )
{
// in case of a headless client the buttons are not displayed so we need
// to send the controller information directly to the server
#ifdef HEADLESS
// FIXME: no idea what to do here.
Copy link
Copy Markdown
Collaborator

@pljones pljones Feb 2, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basically, follow the path.

What the emit does is handled somewhere - that method ends up back in the client code and should be what's called here.

There should really be no client.cpp code that's dependent upon the state of #ifdef HEADLESS - the client should work the same regardless.

Currently it goes to src/clientdlg.h line 150 to check the toggle the box in the dialog, which then triggers the dialog to emit the change, which the client handles.

This does ensure the UI is consistent with the client state, but it's not the right way to do it.

#endif

emit ControllerInMuteMyself ( bMute );
}

void CClient::OnClientIDReceived ( int iChanID )
{
// for headless mode we support to mute our own signal in the personal mix
Expand Down
2 changes: 2 additions & 0 deletions src/client.h
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,7 @@ protected slots:
void OnControllerInPanValue ( int iChannelIdx, int iValue );
void OnControllerInFaderIsSolo ( int iChannelIdx, bool bIsSolo );
void OnControllerInFaderIsMute ( int iChannelIdx, bool bIsMute );
void OnControllerInMuteMyself ( bool bMute );
void OnClientIDReceived ( int iChanID );

signals:
Expand Down Expand Up @@ -423,4 +424,5 @@ protected slots:
void ControllerInPanValue ( int iChannelIdx, int iValue );
void ControllerInFaderIsSolo ( int iChannelIdx, bool bIsSolo );
void ControllerInFaderIsMute ( int iChannelIdx, bool bIsMute );
void ControllerInMuteMyself ( bool bMute );
};
2 changes: 2 additions & 0 deletions src/clientdlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,8 @@ CClientDlg::CClientDlg ( CClient* pNCliP,

QObject::connect ( pClient, &CClient::ControllerInFaderIsMute, this, &CClientDlg::OnControllerInFaderIsMute );

QObject::connect ( pClient, &CClient::ControllerInMuteMyself, this, &CClientDlg::OnControllerInMuteMyself );

QObject::connect ( pClient, &CClient::CLChannelLevelListReceived, this, &CClientDlg::OnCLChannelLevelListReceived );

QObject::connect ( pClient, &CClient::VersionAndOSReceived, this, &CClientDlg::OnVersionAndOSReceived );
Expand Down
2 changes: 2 additions & 0 deletions src/clientdlg.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ public slots:

void OnControllerInFaderIsMute ( const int iChannelIdx, const bool bIsMute ) { MainMixerBoard->SetFaderIsMute ( iChannelIdx, bIsMute ); }

void OnControllerInMuteMyself ( const bool bMute ) { chbLocalMute->setChecked ( bMute ); }

void OnVersionAndOSReceived ( COSUtil::EOpSystemType, QString strVersion );

void OnCLVersionAndOSReceived ( CHostAddress, COSUtil::EOpSystemType, QString strVersion );
Expand Down
17 changes: 12 additions & 5 deletions src/soundbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@
// a single character to an EMidiCtlType
char const sMidiCtlChar[] = {
// Has to follow order of EMidiCtlType
/* [EMidiCtlType::Fader] = */ 'f',
/* [EMidiCtlType::Pan] = */ 'p',
/* [EMidiCtlType::Solo] = */ 's',
/* [EMidiCtlType::Mute] = */ 'm',
/* [EMidiCtlType::None] = */ '\0' };
/* [EMidiCtlType::Fader] = */ 'f',
/* [EMidiCtlType::Pan] = */ 'p',
/* [EMidiCtlType::Solo] = */ 's',
/* [EMidiCtlType::Mute] = */ 'm',
/* [EMidiCtlType::MuteMyself] = */ 'o',
/* [EMidiCtlType::None] = */ '\0' };

/* Implementation *************************************************************/
CSoundBase::CSoundBase ( const QString& strNewSystemDriverTechniqueName,
Expand Down Expand Up @@ -392,6 +393,12 @@ void CSoundBase::ParseMIDIMessage ( const CVector<uint8_t>& vMIDIPaketBytes )
emit ControllerInFaderIsMute ( cCtrl.iChannel, iValue >= 0x40 );
}
break;
case MuteMyself:
{
// We depend on toggles reflecting the desired state to Mute Myself
emit ControllerInMuteMyself ( iValue >= 0x40 );
}
break;
default:
break;
}
Expand Down
2 changes: 2 additions & 0 deletions src/soundbase.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ enum EMidiCtlType
Pan,
Solo,
Mute,
MuteMyself,
None
};

Expand Down Expand Up @@ -171,4 +172,5 @@ class CSoundBase : public QThread
void ControllerInPanValue ( int iChannelIdx, int iValue );
void ControllerInFaderIsSolo ( int iChannelIdx, bool bIsSolo );
void ControllerInFaderIsMute ( int iChannelIdx, bool bIsMute );
void ControllerInMuteMyself ( bool bMute );
};