Skip to content
Open
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
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "libs/oboe"]
path = libs/oboe
url = ../../google/oboe.git
[submodule "libs/mverb"]
path = libs/mverb
url = https://github.com/martineastwood/mverb.git
1 change: 1 addition & 0 deletions COMPILING.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,3 +205,4 @@ During compile time some CONFIG arguments can be given to enable or disable spec
| `disable_version_check` | Skip checks for version updates |
| `noupcasename` | Compile Jamulus binary as lower case "jamulus" instead of "Jamulus" |
| `raspijamulus` | Use raspijamulus.sh specific enhancements for build on Raspberry Pi |
| `noreverb` | Don't build the internal reverb and disable all related GUI elements |
32 changes: 27 additions & 5 deletions Jamulus.pro
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,21 @@ contains(CONFIG, "nosound") {
warning("\"nosound\" is deprecated: please use \"serveronly\" for a server-only build.")
}

!contains(CONFIG, "serveronly") {
!contains(CONFIG, "noreverb"):!exists($$PWD/libs/mverb/MVerb.h) {
!system("git -C $$PWD submodule update --init --force libs/mverb") {
error('MVerb not found and could not be cloned as a submodule.$$escape_expand(\n) \
Try cloning MVerb manually with: \'git submodule update --init --force libs/mverb\'$$escape_expand(\n) \
To disable the reverb plugin call QMake with \"CONFIG+=noreverb\"$$escape_expand(\\n)Exiting...')
} else {
message("building with MVerb")
}
} else {
message("building without reverb plugin")
DEFINES += NO_REVERB
}
}

contains(CONFIG, "headless") {
message(Headless mode activated.)
QT -= gui
Expand Down Expand Up @@ -90,6 +105,8 @@ DEFINES += APP_VERSION=\\\"$$VERSION\\\" \
DEFINES += QT_NO_DEPRECATED_WARNINGS

win32 {
# fixes error C7525: inline variables require at least '/std:c++17'
CONFIG += c++17
DEFINES -= UNICODE # fixes issue with ASIO SDK (asiolist.cpp is not unicode compatible)
DEFINES += NOMINMAX # solves a compiler error in qdatetime.h (Qt5)
RC_FILE = src/res/win-mainicon.rc
Expand Down Expand Up @@ -387,8 +404,7 @@ FORMS_GUI = src/aboutdlgbase.ui \
src/connectdlgbase.ui
}

HEADERS += src/plugins/audioreverb.h \
src/buffer.h \
HEADERS += src/buffer.h \
src/channel.h \
src/global.h \
src/protocol.h \
Expand All @@ -409,6 +425,10 @@ HEADERS += src/plugins/audioreverb.h \
HEADERS += src/client.h \
src/sound/soundbase.h \
src/testbench.h
!contains(CONFIG, noreverb) {
HEADERS += src/plugins/audioreverb.h \
libs/mverb/MVerb.h
}
}

HEADERS_GUI = src/serverdlg.h
Expand Down Expand Up @@ -495,8 +515,7 @@ HEADERS_OPUS_X86 = libs/opus/celt/x86/celt_lpc_sse.h \
libs/opus/celt/x86/x86cpu.h \
$$files(libs/opus/silk/x86/*.h)

SOURCES += src/plugins/audioreverb.cpp \
src/buffer.cpp \
SOURCES += src/buffer.cpp \
src/channel.cpp \
src/main.cpp \
src/protocol.cpp \
Expand All @@ -514,7 +533,10 @@ SOURCES += src/plugins/audioreverb.cpp \

!contains(CONFIG, "serveronly") {
SOURCES += src/client.cpp \
src/sound/soundbase.cpp \
src/sound/soundbase.cpp
!contains(CONFIG, "noreverb") {
SOURCES += src/plugins/audioreverb.cpp
}
}

SOURCES_GUI = src/serverdlg.cpp
Expand Down
1 change: 1 addition & 0 deletions libs/mverb
Submodule mverb added at 9f9512
12 changes: 7 additions & 5 deletions src/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,10 @@ CClient::CClient ( const quint16 iPortNumber,
Socket ( &Channel, iPortNumber, iQosNumber, "", "", bNDisableIPv6, bIPv6Available ),
Sound ( AudioCallback, this, bNoAutoJackConnect, strNClientName ),
iAudioInFader ( AUD_FADER_IN_MIDDLE ),
#ifndef NO_REVERB
bReverbOnLeftChan ( false ),
iReverbLevel ( 0 ),
#endif
iInputBoost ( 1 ),
iSndCrdPrefFrameSizeFactor ( FRAME_SIZE_FACTOR_DEFAULT ),
iSndCrdFrameSizeFactor ( FRAME_SIZE_FACTOR_DEFAULT ),
Expand Down Expand Up @@ -1367,10 +1369,10 @@ void CClient::Init()

// set the channel network properties
Channel.SetAudioStreamProperties ( eAudioCompressionType, iCeltNumCodedBytes, iSndCrdFrameSizeFactor, iNumAudioChannels );

#ifndef NO_REVERB
// init reverberation
AudioReverb.Init ( eAudioChannelConf, iStereoBlockSizeSam, SYSTEM_SAMPLE_RATE_HZ );

AudioReverb.Init ( eAudioChannelConf, iStereoBlockSizeSam );
#endif
// init the sound card conversion buffers
if ( bSndCrdConversionBufferRequired )
{
Expand Down Expand Up @@ -1462,13 +1464,13 @@ void CClient::ProcessAudioDataIntern ( CVector<int16_t>& vecsStereoSndCrd )
#ifndef HEADLESS
SignalLevelMeter.Update ( vecsStereoSndCrd, iMonoBlockSizeSam, true );
#endif

#ifndef NO_REVERB
// add reverberation effect if activated
if ( iReverbLevel != 0 )
{
AudioReverb.Process ( vecsStereoSndCrd, bReverbOnLeftChan, static_cast<float> ( iReverbLevel ) / AUD_REVERB_MAX / 4 );
}

#endif
// apply pan (audio fader) and mix mono signals
if ( !( ( iAudioInFader == AUD_FADER_IN_MIDDLE ) && ( eAudioChannelConf == CC_STEREO ) ) )
{
Expand Down
28 changes: 15 additions & 13 deletions src/client.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@
#include "socket.h"
#include "channel.h"
#include "util.h"
#include "plugins/audioreverb.h"
#ifndef NO_REVERB
# include "plugins/audioreverb.h"
#endif
#include "buffer.h"
#include "signalhandler.h"

Expand Down Expand Up @@ -188,17 +190,15 @@ class CClient : public QObject

int GetAudioInFader() const { return iAudioInFader; }
void SetAudioInFader ( const int iNV ) { iAudioInFader = iNV; }

#ifndef NO_REVERB
int GetReverbLevel() const { return iReverbLevel; }
int GetReverbPreset() const { return AudioReverb.getPreset(); }
void SetReverbLevel ( const int iNL ) { iReverbLevel = iNL; }
void SetReverbPreset ( const int iNP ) { AudioReverb.setPreset ( iNP ); }

bool IsReverbOnLeftChan() const { return bReverbOnLeftChan; }
void SetReverbOnLeftChan ( const bool bIL )
{
bReverbOnLeftChan = bIL;
AudioReverb.Clear();
}

void SetReverbOnLeftChan ( const bool bIL ) { bReverbOnLeftChan = bIL; }
#endif
void SetDoAutoSockBufSize ( const bool bValue );
bool GetDoAutoSockBufSize() const { return Channel.GetDoAutoSockBufSize(); }

Expand Down Expand Up @@ -403,11 +403,13 @@ class CClient : public QObject

CVector<uint8_t> vecbyNetwData;

std::atomic<int> iAudioInFader;
std::atomic<bool> bReverbOnLeftChan;
std::atomic<int> iReverbLevel;
CAudioReverb AudioReverb;
std::atomic<int> iInputBoost;
int iAudioInFader;
#ifndef NO_REVERB
bool bReverbOnLeftChan;
int iReverbLevel;
CAudioReverb AudioReverb;
#endif
int iInputBoost;

int iSndCrdPrefFrameSizeFactor;
int iSndCrdFrameSizeFactor;
Expand Down
34 changes: 22 additions & 12 deletions src/clientdlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ CClientDlg::CClientDlg ( CClient* pNCliP,
"If you are connected, pressing this button will end the session." ) );

butConnect->setAccessibleName ( tr ( "Connect and disconnect toggle button" ) );

#ifndef NO_REVERB
// reverberation level
QString strAudReverb = "<b>" + tr ( "Reverb effect" ) + ":</b> " +
tr ( "Reverb can be applied to one local mono audio channel or to both "
Expand All @@ -143,7 +143,13 @@ CClientDlg::CClientDlg ( CClient* pNCliP,
rbtReverbSelL->setAccessibleName ( tr ( "Left channel selection for reverb" ) );
rbtReverbSelR->setWhatsThis ( strRevChanSel );
rbtReverbSelR->setAccessibleName ( tr ( "Right channel selection for reverb" ) );

#endif
#ifdef NO_REVERB
lblAudioReverb->setVisible ( false );
sldAudioReverb->setVisible ( false );
rbtReverbSelL->setVisible ( false );
rbtReverbSelR->setVisible ( false );
#endif
// delay LED
QString strLEDDelay = "<b>" + tr ( "Delay Status LED" ) + ":</b> " + tr ( "Shows the current audio delay status:" ) +
"<ul>"
Expand Down Expand Up @@ -257,18 +263,18 @@ CClientDlg::CClientDlg ( CClient* pNCliP,
// init status LEDs
ledBuffers->Reset();
ledDelay->Reset();

#ifndef NO_REVERB
// init audio reverberation
sldAudioReverb->setRange ( 0, AUD_REVERB_MAX );
const int iCurAudReverb = pClient->GetReverbLevel();
sldAudioReverb->setValue ( iCurAudReverb );
sldAudioReverb->setTickInterval ( AUD_REVERB_MAX / 5 );

// init input boost
pClient->SetInputBoost ( pSettings->iInputBoost );

// init reverb channel
UpdateRevSelection();
#endif
// init input boost
pClient->SetInputBoost ( pSettings->iInputBoost );

// init connect dialog
ConnectDlg.SetShowAllMusicians ( pSettings->bConnectDlgShowAllMusicians );
Expand Down Expand Up @@ -496,14 +502,14 @@ CClientDlg::CClientDlg ( CClient* pNCliP,
QObject::connect ( &TimerCheckAudioDeviceOk, &QTimer::timeout, this, &CClientDlg::OnTimerCheckAudioDeviceOk );

QObject::connect ( &TimerDetectFeedback, &QTimer::timeout, this, &CClientDlg::OnTimerDetectFeedback );

#ifndef NO_REVERB
QObject::connect ( sldAudioReverb, &QSlider::valueChanged, this, &CClientDlg::OnAudioReverbValueChanged );

// radio buttons
QObject::connect ( rbtReverbSelL, &QRadioButton::clicked, this, &CClientDlg::OnReverbSelLClicked );

QObject::connect ( rbtReverbSelR, &QRadioButton::clicked, this, &CClientDlg::OnReverbSelRClicked );

#endif
// other
QObject::connect ( pClient, &CClient::ConClientListMesReceived, this, &CClientDlg::OnConClientListMesReceived );

Expand Down Expand Up @@ -690,7 +696,7 @@ void CClientDlg::ManageDragNDrop ( QDropEvent* Event, const bool bCheckAccept )
}
}
}

#ifndef NO_REVERB
void CClientDlg::UpdateRevSelection()
{
if ( pClient->GetAudioChannels() == CC_STEREO )
Expand Down Expand Up @@ -720,7 +726,7 @@ void CClientDlg::UpdateRevSelection()
// update visibility of the pan controls in the audio mixer board (pan is not supported for mono)
MainMixerBoard->SetDisplayPans ( pClient->GetAudioChannels() != CC_MONO );
}

#endif
void CClientDlg::OnConnectDlgAccepted()
{
// We had an issue that the accepted signal was emit twice if a list item was double
Expand Down Expand Up @@ -1402,7 +1408,8 @@ void CClientDlg::SetGUIDesign ( const EGUIDesign eNewDesign )
" image: url(:/png/fader/res/ledbuttonpressed.png); }"
"QCheckBox { color: rgb(220, 220, 220);"
" font: bold; }" );
#ifdef _WIN32
#ifndef NO_REVERB
# ifdef _WIN32
// Workaround QT-Windows problem: This should not be necessary since in the
// background frame the style sheet for QRadioButton was already set. But it
// seems that it is only applied if the style was set to default and then back
Expand All @@ -1411,6 +1418,7 @@ void CClientDlg::SetGUIDesign ( const EGUIDesign eNewDesign )
"font: bold;" );
rbtReverbSelR->setStyleSheet ( "color: rgb(220, 220, 220);"
"font: bold;" );
# endif
#endif

ledBuffers->SetType ( CMultiColorLED::MT_LED );
Expand All @@ -1421,10 +1429,12 @@ void CClientDlg::SetGUIDesign ( const EGUIDesign eNewDesign )
// reset style sheet and set original parameters
backgroundFrame->setStyleSheet ( "" );

#ifdef _WIN32
#ifndef NO_REVERB
# ifdef _WIN32
// Workaround QT-Windows problem: See above description
rbtReverbSelL->setStyleSheet ( "" );
rbtReverbSelR->setStyleSheet ( "" );
# endif
#endif

ledBuffers->SetType ( CMultiColorLED::MT_INDICATOR );
Expand Down
13 changes: 10 additions & 3 deletions src/clientdlg.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ class CClientDlg : public CBaseDlg, private Ui_CClientDlgBase
void ShowChatWindow ( const bool bForceRaise = true );
void ShowAnalyzerConsole();
void UpdateAudioFaderSlider();
#ifndef NO_REVERB
void UpdateRevSelection();
#endif
void Connect ( const QString& strSelectedAddress, const QString& strMixerBoardLabel );
void Disconnect();
void ManageDragNDrop ( QDropEvent* Event, const bool bCheckAccept );
Expand Down Expand Up @@ -201,13 +203,13 @@ public slots:
void OnSettingsStateChanged ( int value );
void OnChatStateChanged ( int value );
void OnLocalMuteStateChanged ( int value );

#ifndef NO_REVERB
void OnAudioReverbValueChanged ( int value ) { pClient->SetReverbLevel ( value ); }

void OnReverbSelLClicked() { pClient->SetReverbOnLeftChan ( true ); }

void OnReverbSelRClicked() { pClient->SetReverbOnLeftChan ( false ); }

#endif
void OnFeedbackDetectionChanged ( int state ) { ClientSettingsDlg.SetEnableFeedbackDetection ( state == Qt::Checked ); }

void OnConClientListMesReceived ( CVector<CChannelInfo> vecChanInfo );
Expand Down Expand Up @@ -259,7 +261,12 @@ public slots:
void OnMeterStyleChanged();
void OnRecorderStateReceived ( ERecorderState eRecorderState );
void SetMixerBoardDeco ( const ERecorderState newRecorderState, const EGUIDesign eNewDesign );
void OnAudioChannelsChanged() { UpdateRevSelection(); }
void OnAudioChannelsChanged()
{
#ifndef NO_REVERB
UpdateRevSelection();
#endif
}
void OnNumClientsChanged ( int iNewNumClients );

void accept() { close(); } // introduced by pljones
Expand Down
Loading
Loading