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
18 changes: 16 additions & 2 deletions src/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1297,17 +1297,31 @@ void CServer::CreateAndSendChatTextForAllConChannels ( const int iCurChanID, con
const QString strActualMessageText = "<font color=\"" + sCurColor + "\">(" + QTime::currentTime().toString ( "hh:mm:ss AP" ) + ") <b>" +
ChanName.toHtmlEscaped() + "</b></font> " + strChatText.toHtmlEscaped();

// Send chat text to all connected clients ---------------------------------
Comment thread
ann0see marked this conversation as resolved.
SendChatTextToAllConChannels ( strActualMessageText );
}

void CServer::SendChatTextToAllConChannels ( const QString& strChatText )
{
// Send chat text to all connected clients ---------------------------------
for ( int i = 0; i < iMaxNumChannels; i++ )
{
if ( vecChannels[i].IsConnected() )
{
// send message
vecChannels[i].CreateChatTextMes ( strActualMessageText );
vecChannels[i].CreateChatTextMes ( strChatText );
}
}
}

void CServer::SendChatTextToConChannel ( const int iCurChanID, const QString& strChatText )
{
if ( MathUtils::InRange<int> ( iCurChanID, 0, iMaxNumChannels - 1 ) && vecChannels[iCurChanID].IsConnected() )
{
// send message
vecChannels[iCurChanID].CreateChatTextMes ( strChatText );
}
}

void CServer::CreateAndSendRecorderStateForAllConChannels()
{
// get recorder state
Expand Down
3 changes: 3 additions & 0 deletions src/server.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,9 @@ class CServer : public QObject, public CServerSlots<MAX_NUM_CHANNELS>
void SetEnableDelayPanning ( bool bDelayPanningOn ) { bDelayPan = bDelayPanningOn; }
bool IsDelayPanningEnabled() { return bDelayPan; }

void SendChatTextToAllConChannels ( const QString& strChatText );
void SendChatTextToConChannel ( const int iCurChanID, const QString& strChatText );

protected:
// access functions for actual channels
bool IsConnected ( const int iChanNum ) { return vecChannels[iChanNum].IsConnected(); }
Expand Down
7 changes: 7 additions & 0 deletions src/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -1223,6 +1223,13 @@ class MathUtils
return powf ( 10.0f, ( fInValueRange0_1 - 1.0f ) * AUD_MIX_FADER_RANGE_DB / 20.0f );
}
}

// return true if a value is within the lower and upper bounds (inclusively), otherwise false
template<typename T>
Comment thread
dingodoppelt marked this conversation as resolved.
static inline bool InRange ( T value, T lower, T upper )
Comment thread
dingodoppelt marked this conversation as resolved.
{
return !( value < lower || value > upper );
}
};

/******************************************************************************\
Expand Down
Loading