Merge pull request #368 from pljones/feature/295-receive-and-display-recorder-state

#295 Part 3: Client side changes for recorder state - the end
This commit is contained in:
Volker Fischer 2020-06-15 21:34:39 +02:00 committed by GitHub
commit ac9f054ee3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 50 additions and 3 deletions

32
src/audiomixerboard.cpp Normal file → Executable file
View File

@ -619,7 +619,8 @@ CAudioMixerBoard::CAudioMixerBoard ( QWidget* parent, Qt::WindowFlags ) :
bIsPanSupported ( false ),
bNoFaderVisible ( true ),
iMyChannelID ( INVALID_INDEX ),
strServerName ( "" )
strServerName ( "" ),
eRecorderState ( RS_UNDEFINED )
{
// add group box and hboxlayout
QHBoxLayout* pGroupBoxLayout = new QHBoxLayout ( this );
@ -627,6 +628,14 @@ CAudioMixerBoard::CAudioMixerBoard ( QWidget* parent, Qt::WindowFlags ) :
pScrollArea = new CMixerBoardScrollArea ( this );
pMainLayout = new QHBoxLayout ( pMixerWidget );
setAccessibleName ( "Personal Mix at the Server groupbox" );
setWhatsThis ( "<b>" + tr( "Personal Mix at the Server" ) + "</b>: " +
tr ( "When connected to a server, the controls here allow you to set " ) +
tr ( "your local mix without affecting what others hear from you.") + "<br/>" +
tr ( "The title shows the server name and, when known, "
"whether it is actively recording." ) );
// set title text (default: no server given)
SetServerName ( "" );
@ -807,13 +816,32 @@ void CAudioMixerBoard::ChangeFaderOrder ( const bool bDoSort,
}
}
QString CAudioMixerBoard::GetTitle()
{
QString myTitle = "";
if ( eRecorderState == RS_RECORDING )
{
myTitle = "[" + tr ( "RECORDING ACTIVE" ) + "] ";
}
return myTitle + tr ( "Personal Mix at: " ) + strServerName;
}
void CAudioMixerBoard::SetRecorderState ( const ERecorderState newRecorderState )
{
eRecorderState = newRecorderState;
if ( !strServerName.isEmpty() && !bNoFaderVisible )
{
setTitle ( GetTitle() );
}
}
void CAudioMixerBoard::ApplyNewConClientList ( CVector<CChannelInfo>& vecChanInfo )
{
// we want to set the server name only if the very first faders appear
// in the audio mixer board to show a "try to connect" before
if ( bNoFaderVisible )
{
setTitle ( tr ( "Personal Mix at the Server: " ) + strServerName );
setTitle ( GetTitle() );
}
// get number of connected clients

5
src/audiomixerboard.h Normal file → Executable file
View File

@ -164,6 +164,8 @@ public:
void SetChannelLevels ( const CVector<uint16_t>& vecChannelLevel );
void SetRecorderState ( const ERecorderState newRecorderState );
// settings
CVector<QString> vecStoredFaderTags;
CVector<int> vecStoredFaderLevels;
@ -188,6 +190,8 @@ protected:
}
};
QString GetTitle();
bool GetStoredFaderSettings ( const CChannelInfo& ChanInfo,
int& iStoredFaderLevel,
int& iStoredPanValue,
@ -209,6 +213,7 @@ protected:
bool bNoFaderVisible;
int iMyChannelID;
QString strServerName;
ERecorderState eRecorderState;
virtual void UpdateGainValue ( const int iChannelIdx,
const double dValue,

View File

@ -108,6 +108,9 @@ qRegisterMetaType<CHostAddress> ( "CHostAddress" );
QObject::connect ( &Protocol, &CProtocol::VersionAndOSReceived,
this, &CChannel::VersionAndOSReceived );
QObject::connect ( &Protocol, &CProtocol::RecorderStateReceived,
this, &CChannel::RecorderStateReceived );
QObject::connect ( &Protocol, &CProtocol::ReqChannelLevelList,
this, &CChannel::OnReqChannelLevelList );
}

View File

@ -290,6 +290,7 @@ signals:
void ReqNetTranspProps();
void LicenceRequired ( ELicenceType eLicenceType );
void VersionAndOSReceived ( COSUtil::EOpSystemType eOSType, QString strVersion );
void RecorderStateReceived ( ERecorderState eRecorderState );
void Disconnected();
void DetectedCLMessage ( CVector<uint8_t> vecbyMesBodyData,

View File

@ -165,6 +165,9 @@ CClient::CClient ( const quint16 iPortNumber,
QObject::connect ( &Channel, &CChannel::VersionAndOSReceived,
this, &CClient::VersionAndOSReceived );
QObject::connect ( &Channel, &CChannel::RecorderStateReceived,
this, &CClient::RecorderStateReceived );
QObject::connect ( &ConnLessProtocol, &CProtocol::CLMessReadyForSending,
this, &CClient::OnSendCLProtMessage );

View File

@ -424,6 +424,7 @@ signals:
void LicenceRequired ( ELicenceType eLicenceType );
void VersionAndOSReceived ( COSUtil::EOpSystemType eOSType, QString strVersion );
void PingTimeReceived ( int iPingTime );
void RecorderStateReceived ( ERecorderState eRecorderState );
void CLServerListReceived ( CHostAddress InetAddr,
CVector<CServerInfo> vecServerInfo );

View File

@ -472,6 +472,9 @@ CClientDlg::CClientDlg ( CClient* pNCliP,
QObject::connect ( pClient, &CClient::MuteStateHasChangedReceived,
this, &CClientDlg::OnMuteStateHasChangedReceived );
QObject::connect ( pClient, &CClient::RecorderStateReceived,
this, &CClientDlg::OnRecorderStateReceived );
// This connection is a special case. On receiving a licence required message via the
// protocol, a modal licence dialog is opened. Since this blocks the thread, we need
// a queued connection to make sure the core protocol mechanism is not blocked, too.

View File

@ -221,6 +221,9 @@ public slots:
void OnDisplayChannelLevelsChanged()
{ MainMixerBoard->SetDisplayChannelLevels ( pClient->GetDisplayChannelLevels() ); }
void OnRecorderStateReceived ( ERecorderState eRecorderState )
{ MainMixerBoard->SetRecorderState ( eRecorderState ); }
void OnAudioChannelsChanged() { UpdateRevSelection(); }
void OnNumClientsChanged ( int iNewNumClients );
void OnNewClientLevelChanged() { MainMixerBoard->iNewClientFaderLevel = pClient->iNewClientFaderLevel; }

View File

@ -740,7 +740,7 @@ void CServer::SetEnableRecording ( bool bNewEnableRecording )
#if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0)
// TODO we should use the ConsoleWriterFactory() instead of qInfo()
qInfo() << "Recording state " << ( bEnableRecording ? "enabled" : "disabled" );
qInfo() << "Recording state" << ( bEnableRecording ? "enabled" : "disabled" );
#endif
if ( !bEnableRecording )