merge fixes

This commit is contained in:
Volker Fischer 2020-04-30 22:03:01 +02:00
parent effa2c5bef
commit bac89e358a
11 changed files with 58 additions and 63 deletions

View file

@ -27,7 +27,7 @@
#include "sound.h" #include "sound.h"
#ifdef WITH_SOUND #ifdef WITH_SOUND
void CSound::OpenJack(char* jackClientName) void CSound::OpenJack ( const char* jackClientName )
{ {
jack_status_t JackStatus; jack_status_t JackStatus;

View file

@ -65,7 +65,9 @@ public:
const int iCtrlMIDIChannel, const int iCtrlMIDIChannel,
const bool bNoAutoJackConnect, const bool bNoAutoJackConnect,
const QString& strJackClientName ) : const QString& strJackClientName ) :
CSoundBase ( "Jack", true, fpNewProcessCallback, arg, iCtrlMIDIChannel, bNoAutoJackConnect, strJackClientName ), iJACKBufferSizeMono ( 0 ) { OpenJack( strJackClientName.toLocal8Bit().data() ); } CSoundBase ( "Jack", true, fpNewProcessCallback, arg, iCtrlMIDIChannel, bNoAutoJackConnect, strJackClientName ),
iJACKBufferSizeMono ( 0 ) { OpenJack ( strJackClientName.toLocal8Bit().data() ); }
virtual ~CSound() { CloseJack(); } virtual ~CSound() { CloseJack(); }
virtual int Init ( const int iNewPrefMonoBufferSize ); virtual int Init ( const int iNewPrefMonoBufferSize );
@ -85,7 +87,7 @@ public:
jack_port_t* input_port_midi; jack_port_t* input_port_midi;
protected: protected:
void OpenJack(char* jackClientName); void OpenJack ( const char* jackClientName );
void CloseJack(); void CloseJack();
// callbacks // callbacks

View file

@ -30,7 +30,7 @@ CClient::CClient ( const quint16 iPortNumber,
const QString& strConnOnStartupAddress, const QString& strConnOnStartupAddress,
const int iCtrlMIDIChannel, const int iCtrlMIDIChannel,
const bool bNoAutoJackConnect, const bool bNoAutoJackConnect,
const QString& strClientName ) : const QString& strNClientName ) :
vstrIPAddress ( MAX_NUM_SERVER_ADDR_ITEMS, "" ), vstrIPAddress ( MAX_NUM_SERVER_ADDR_ITEMS, "" ),
ChannelInfo (), ChannelInfo (),
vecStoredFaderTags ( MAX_NUM_STORED_FADER_SETTINGS, "" ), vecStoredFaderTags ( MAX_NUM_STORED_FADER_SETTINGS, "" ),
@ -60,7 +60,7 @@ CClient::CClient ( const quint16 iPortNumber,
bIsInitializationPhase ( true ), bIsInitializationPhase ( true ),
bMuteOutStream ( false ), bMuteOutStream ( false ),
Socket ( &Channel, iPortNumber ), Socket ( &Channel, iPortNumber ),
Sound ( AudioCallback, this, iCtrlMIDIChannel, bNoAutoJackConnect, strClientName ), Sound ( AudioCallback, this, iCtrlMIDIChannel, bNoAutoJackConnect, strNClientName ),
iAudioInFader ( AUD_FADER_IN_MIDDLE ), iAudioInFader ( AUD_FADER_IN_MIDDLE ),
bReverbOnLeftChan ( false ), bReverbOnLeftChan ( false ),
iReverbLevel ( 0 ), iReverbLevel ( 0 ),
@ -78,11 +78,8 @@ CClient::CClient ( const quint16 iPortNumber,
strCentralServerAddress ( "" ), strCentralServerAddress ( "" ),
eCentralServerAddressType ( AT_DEFAULT ), eCentralServerAddressType ( AT_DEFAULT ),
iServerSockBufNumFrames ( DEF_NET_BUF_SIZE_NUM_BL ), iServerSockBufNumFrames ( DEF_NET_BUF_SIZE_NUM_BL ),
strClientName ( APP_NAME ) strClientName ( strNClientName )
{ {
SetClientName ( strClientName );
int iOpusError; int iOpusError;
OpusMode = opus_custom_mode_create ( SYSTEM_SAMPLE_RATE_HZ, OpusMode = opus_custom_mode_create ( SYSTEM_SAMPLE_RATE_HZ,

View file

@ -108,18 +108,13 @@ public:
const QString& strConnOnStartupAddress, const QString& strConnOnStartupAddress,
const int iCtrlMIDIChannel, const int iCtrlMIDIChannel,
const bool bNoAutoJackConnect, const bool bNoAutoJackConnect,
const QString& strClientName ); const QString& strNClientName );
void Start(); void Start();
void Stop(); void Stop();
bool IsRunning() { return Sound.IsRunning(); } bool IsRunning() { return Sound.IsRunning(); }
bool SetServerAddr ( QString strNAddr ); bool SetServerAddr ( QString strNAddr );
QString GetClientName() const { return this->strClientName; }
void SetClientName ( const QString& strClientName ) {
this->strClientName = strClientName;
}
double MicLeveldB_L() { return SignalLevelMeter.MicLeveldBLeft(); } double MicLeveldB_L() { return SignalLevelMeter.MicLeveldBLeft(); }
double MicLeveldB_R() { return SignalLevelMeter.MicLeveldBRight(); } double MicLeveldB_R() { return SignalLevelMeter.MicLeveldBRight(); }
@ -288,6 +283,7 @@ public:
CVector<int> vecStoredFaderIsMute; CVector<int> vecStoredFaderIsMute;
int iNewClientFaderLevel; int iNewClientFaderLevel;
bool bConnectDlgShowAllMusicians; bool bConnectDlgShowAllMusicians;
QString strClientName;
// window position/state settings // window position/state settings
QByteArray vecWindowPosMain; QByteArray vecWindowPosMain;
@ -390,8 +386,6 @@ protected:
// for ping measurement // for ping measurement
CPreciseTime PreciseTime; CPreciseTime PreciseTime;
QString strClientName;
public slots: public slots:
void OnSendProtMessage ( CVector<uint8_t> vecMessage ); void OnSendProtMessage ( CVector<uint8_t> vecMessage );
void OnInvalidPacketReceived ( CHostAddress RecHostAddr ); void OnInvalidPacketReceived ( CHostAddress RecHostAddr );

View file

@ -809,17 +809,17 @@ void CClientDlg::SetMyWindowTitle ( const int iNumClients)
if ( iNumClients == 0 ) if ( iNumClients == 0 )
{ {
// only application name // only application name
setWindowTitle ( pClient->GetClientName() ); setWindowTitle ( pClient->strClientName );
} }
else else
{ {
if ( iNumClients == 1 ) if ( iNumClients == 1 )
{ {
setWindowTitle ( QString ( pClient->GetClientName() ) + " (1 user)" ); setWindowTitle ( QString ( pClient->strClientName ) + " (1 user)" );
} }
else else
{ {
setWindowTitle ( QString ( pClient->GetClientName() ) + setWindowTitle ( QString ( pClient->strClientName ) +
QString ( " (%1 users)" ).arg ( iNumClients ) ); QString ( " (%1 users)" ).arg ( iNumClients ) );
} }
} }

View file

@ -95,7 +95,6 @@ protected:
CClient* pClient; CClient* pClient;
CSettings* pSettings; CSettings* pSettings;
QString strClientName;
bool bConnected; bool bConnected;
bool bConnectDlgWasShown; bool bConnectDlgWasShown;
QTimer TimerSigMet; QTimer TimerSigMet;

View file

@ -328,7 +328,22 @@ int main ( int argc, char** argv )
} }
// HTML status file ---------------------------------------------------- // Client Name ---------------------------------------------------------
if ( GetStringArgument ( tsConsole,
argc,
argv,
i,
"--clientname",
"--clientname",
strArgument ) )
{
strClientName = QString ( APP_NAME ) + " " + strArgument;
tsConsole << "- client name: " << strClientName << endl;
continue;
}
// Server history file name --------------------------------------------
if ( GetStringArgument ( tsConsole, if ( GetStringArgument ( tsConsole,
argc, argc,
argv, argv,
@ -432,19 +447,6 @@ int main ( int argc, char** argv )
continue; continue;
} }
// Client Name ---------------------------------------------------------
if ( GetStringArgument ( tsConsole,
argc,
argv,
i,
"--clientname",
"--clientname",
strArgument ) )
{
strClientName = strArgument;
tsConsole << "- client name: " << strClientName << endl;
continue;
}
// Version number ------------------------------------------------------ // Version number ------------------------------------------------------
if ( ( !strcmp ( argv[i], "--version" ) ) || if ( ( !strcmp ( argv[i], "--version" ) ) ||
@ -487,6 +489,7 @@ int main ( int argc, char** argv )
strCentralServer = DEFAULT_SERVER_ADDRESS; strCentralServer = DEFAULT_SERVER_ADDRESS;
} }
// Application/GUI setup --------------------------------------------------- // Application/GUI setup ---------------------------------------------------
// Application object // Application object
if ( !bUseGUI && !strHistoryFileName.isEmpty() ) if ( !bUseGUI && !strHistoryFileName.isEmpty() )
@ -687,7 +690,7 @@ QString UsageArguments ( char **argv )
" -D, --histdays number of days of history to display (server only)\n" " -D, --histdays number of days of history to display (server only)\n"
" -z, --startminimized start minimizied (server only)\n" " -z, --startminimized start minimizied (server only)\n"
" --ctrlmidich MIDI controller channel to listen (client only)\n" " --ctrlmidich MIDI controller channel to listen (client only)\n"
" --clientname Jamulus client name (windows title and jack client name)\n" " --clientname client name (window title and jack client name)\n"
"\nExample: " + QString ( argv[0] ) + " -l -inifile myinifile.ini\n"; "\nExample: " + QString ( argv[0] ) + " -l -inifile myinifile.ini\n";
} }