Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
1782bb6
git subrepo clone --branch=sononew --force https://github.com/essej/a…
Jul 4, 2021
9c49ca9
aoo::sink: fixed uninvite event typo
Jul 6, 2021
922efb6
initial integration of new aoo library
Jul 6, 2021
8d95176
modifications to support interopability with older sonobus aoo
Jul 7, 2021
d4b5669
legacy aoo interop fixes
Jul 7, 2021
3a21b96
event change
Jul 12, 2021
23dc216
made warnings cross-platform
Jul 12, 2021
b7c8291
fixed missing return values
Jul 12, 2021
c8cc2d2
fixed missing return values again
Jul 12, 2021
035cd7d
include jitter buffer in buffer_fill_ratio stat. temporarily prevent …
Jul 20, 2021
085df2b
use underrun event instead of lost
Jul 20, 2021
a0cf2f3
aoo: added flags to sink::invite_source so that initial invites can b…
Jul 21, 2021
637e1a9
added flags to sink invites to support relaying
Jul 21, 2021
0ea81a2
respect flags for source::add_sink to allow relaying to work
Jul 21, 2021
568cb54
pass aoo source::add_sink flags to allow relaying to work
Jul 21, 2021
7b90221
use aoo client peer message sending for custom messages
Jul 21, 2021
58da557
fix sending of ping replies
Jul 21, 2021
3867bf5
safety muting fix
Jul 21, 2021
289ef23
unwrap relayed messages without assuming they are OSC (to allow for b…
Jul 21, 2021
7a58e96
git subrepo push deps/aoo
Jul 28, 2021
4242a86
git subrepo clone --branch=sononewest --force https://github.com/esse…
essej Jan 9, 2022
e78888c
aoo: fixed address copy in endpoint_event copy/= operation
essej Jan 12, 2022
15dde9b
aoo: type fixes for double paramters
essej Jan 12, 2022
ab0f4e8
port to latest aoo API. ongoing
essej Jan 12, 2022
5540505
aoo: unwrap relayed messages without assuming they are OSC (to allow …
essej Jan 14, 2022
b26f673
git subrepo push deps/aoo
essej Jan 14, 2022
be14bff
git subrepo clone --branch=sononewester --force https://github.com/es…
essej Mar 25, 2022
33b5db0
updated to work with latest develop AOO
essej Mar 26, 2022
632f58d
fixed conflicts from merge from develop
essej Mar 26, 2022
cc7124d
git subrepo pull deps/aoo
essej Jun 26, 2022
c713017
fix compile and type errors from new AOO
essej Jun 27, 2022
9c619b2
merged from develop, untested
essej Feb 18, 2023
f62bb96
git subrepo clone --branch=sono202302 --force https://github.com/esse…
essej Feb 18, 2023
b98db66
excised some unnecessary stuff, and more merging with latest aoo
essej Mar 2, 2023
c3ebd76
git subrepo pull (merge) deps/aoo
essej Mar 2, 2023
7e762b5
fixed for latest aoo api
essej Mar 2, 2023
1310623
git subrepo clone --branch=sono20230530 --force https://github.com/es…
essej Jun 11, 2023
fee5212
update to support the latest oaa
essej Jun 12, 2023
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
53 changes: 42 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ endif()
# `project()` command. `project()` sets up some helpful variables that describe source/binary
# directories, and the current project version. This is a standard CMake command.

project(SonoBus VERSION 1.6.1)
project(SonoBus VERSION 1.9.0)

set(BUILDVERSION 76)
set(BUILDVERSION 174)


# If you've installed JUCE somehow (via a package manager, or directly using the CMake install
Expand Down Expand Up @@ -69,11 +69,35 @@ set_property(GLOBAL PROPERTY USE_FOLDERS YES)
# Bug in Xcode? https://gitlab.kitware.com/cmake/cmake/-/issues/21383
set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER "Targets")

# Create a /Modules directory in the IDE with the JUCE Module code
option(JUCE_ENABLE_MODULE_SOURCE_GROUPS "Show all module sources in IDE projects" ON)


# include AOO (which includes opus)
set(AOO_BUILD_SHARED_LIBRARY OFF CACHE INTERNAL "" FORCE)
set(AOO_BUILD_PD_EXTERNAL OFF CACHE INTERNAL "" FORCE)
set(AOO_BUILD_SC_EXTENSION OFF CACHE INTERNAL "" FORCE)
set(AOO_BUILD_TEST_SUITE OFF CACHE INTERNAL "" FORCE)
set(AOO_CODEC_OPUS ON CACHE INTERNAL "" FORCE)
set(AOO_SYSTEM_OPUS ON CACHE INTERNAL "" FORCE)

if (APPLE)
add_definitions(-DAOO_OPUS_MULTISTREAM_H="../../../../mac/include/opus/opus_multistream.h")
elseif (WIN32)
add_definitions(-DAOO_OPUS_MULTISTREAM_H="../../../../windows/include/opus/opus_multistream.h")
endif()

add_subdirectory(deps/aoo EXCLUDE_FROM_ALL )

# need to get these out of the AOO build so we can add them to our our own build defs
get_directory_property(AOODIR_COMPILE_DEFS DIRECTORY deps/aoo COMPILE_DEFINITIONS)

#message(STATUS "AOODIR_DEFS: ${AOODIR_COMPILE_DEFS}")



# include JUCE
# Create a /Modules directory in the IDE with the JUCE Module code
option(JUCE_ENABLE_MODULE_SOURCE_GROUPS "Show all module sources in IDE projects" ON)


add_subdirectory(deps/juce EXCLUDE_FROM_ALL )

Expand Down Expand Up @@ -180,7 +204,8 @@ function(sono_add_custom_plugin_target target_name product_name formats is_instr


set (HEADER_INCLUDES
deps/aoo/lib
deps/aoo
deps/aoo/include
deps/aoo/deps
)

Expand Down Expand Up @@ -325,6 +350,8 @@ function(sono_add_custom_plugin_target target_name product_name formats is_instr
Source/mtdm.h
Source/zitaRev.h
)

#[[
set(AOOSourceFiles
deps/aoo/lib/src/SLIP.hpp
deps/aoo/lib/src/client.cpp
Expand Down Expand Up @@ -371,18 +398,20 @@ function(sono_add_custom_plugin_target target_name product_name formats is_instr
deps/aoo/deps/oscpack/osc/OscReceivedElements.h
deps/aoo/deps/oscpack/osc/OscTypes.h
)

]]

target_sources("${target_name}" PRIVATE
${SourceFiles}
${AOOSourceFiles}
# ${AOOSourceFiles}
)

# No, we don't want our source buried in extra nested folders
set_target_properties("${target_name}" PROPERTIES FOLDER "")

# The source tree should uhhh, still look like the source tree, yo
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/Source PREFIX "" FILES ${SourceFiles})
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/deps/aoo PREFIX "aoo" FILES ${AOOSourceFiles})

#source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/deps/aoo PREFIX "aoo" FILES ${AOOSourceFiles})

# Move the INTERFACE auto-created JUCE library stuff into its own folder
source_group("JUCE Library Code" REGULAR_EXPRESSION "juce_")
Expand Down Expand Up @@ -445,7 +474,9 @@ function(sono_add_custom_plugin_target target_name product_name formats is_instr
JUCE_LOAD_CURL_SYMBOLS_LAZILY=1
FF_AUDIO_ALLOW_ALLOCATIONS_IN_MEASURE_BLOCK=0
SONOBUS_BUILD_VERSION="${VERSION}"
${PLAT_COMPILE_DEFS} )
${PLAT_COMPILE_DEFS}
${AOODIR_COMPILE_DEFS}
)

juce_add_binary_data("${target_name}_SBData" SOURCES
Source/wordmaker.g
Expand Down Expand Up @@ -594,14 +625,14 @@ function(sono_add_custom_plugin_target target_name product_name formats is_instr
ff_meters

${target_name}_SBData

AOO_STATIC
opus
PUBLIC
juce::juce_recommended_config_flags
juce::juce_recommended_lto_flags
# juce::juce_recommended_warning_flags
)

endfunction()

# most of the targets
Expand Down
6 changes: 4 additions & 2 deletions Source/ConnectView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1002,7 +1002,7 @@ void ConnectView::buttonClicked (Button* buttonThatWasClicked)
}

if (host.isNotEmpty() && port != 0) {
if (processor.connectRemotePeer(host, port, "", "", processor.getValueTreeState().getParameter(SonobusAudioProcessor::paramMainRecvMute)->getValue() == 0)) {
if (processor.connectRemotePeer(host, port, kAooIdInvalid, "", "", kAooIdInvalid, processor.getValueTreeState().getParameter(SonobusAudioProcessor::paramMainRecvMute)->getValue() == 0)) {
setVisible(false);
if (auto * callout = dynamic_cast<CallOutBox*>(directConnectCalloutBox.get())) {
callout->dismiss();
Expand Down Expand Up @@ -1744,7 +1744,9 @@ void ConnectView::PublicGroupsListModel::groupSelected(int rowNumber)

parent->processor.leaveServerGroup(parent->processor.getCurrentJoinedGroup());

parent->processor.joinServerGroup(parent->currConnectionInfo.groupName, parent->currConnectionInfo.groupPassword, isPublic);
parent->processor.joinServerGroup(parent->currConnectionInfo.groupName, parent->currConnectionInfo.groupPassword,
parent->currConnectionInfo.userName, parent->currConnectionInfo.userPassword,
isPublic);

parent->processor.setWatchPublicGroups(false);
}
Expand Down
96 changes: 17 additions & 79 deletions Source/PeersContainerView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -732,13 +732,18 @@ void PeersContainerView::resetPendingUsers()
mPendingUsers.clear();
}

void PeersContainerView::peerPendingJoin(String & group, String & user)
void PeersContainerView::peerPendingJoin(String & group, String & user, AooId groupId, AooId userId)
{
mPendingUsers[user] = PendingUserInfo(group, user);
auto pui = PendingUserInfo(group, user);
pui.groupId = groupId;
pui.userId = userId;

mPendingUsers[user] = pui;

rebuildPeerViews();
}

void PeersContainerView::peerFailedJoin(String & group, String & user)
void PeersContainerView::peerFailedJoin(String & group, String & user, AooId groupId, AooId userId)
{
auto found = mPendingUsers.find(user);
if (found != mPendingUsers.end()) {
Expand All @@ -747,19 +752,21 @@ void PeersContainerView::peerFailedJoin(String & group, String & user)
}
}

void PeersContainerView::peerBlockedJoin(String & group, String & user, String & address, int port)
void PeersContainerView::peerBlockedJoin(String & group, String & user, String & address, int port, AooId groupId, AooId userId)
{
auto found = mPendingUsers.find(user);
if (found != mPendingUsers.end()) {
found->second.failed = true;
found->second.blocked = true;
found->second.address = address;
found->second.userId = userId;
found->second.groupId = groupId;
found->second.port = port;
updatePeerViews();
}
}

void PeersContainerView::peerLeftGroup(String & group, String & user)
void PeersContainerView::peerLeftGroup(String & group, String & user, AooId groupId, AooId userId)
{
// check if it was pending and remove it
auto found = mPendingUsers.find(user);
Expand Down Expand Up @@ -1610,7 +1617,6 @@ void PeersContainerView::updatePeerViews(int specific)

bool recvactive = processor.getRemotePeerRecvActive(i);
bool recvallow = processor.getRemotePeerRecvAllow(i);
bool latactive = processor.isRemotePeerLatencyTestActive(i);
bool safetymuted = processor.getRemotePeerSafetyMuted(i);
bool blocked = processor.getRemotePeerBlockedUs(i);

Expand Down Expand Up @@ -1726,8 +1732,6 @@ void PeersContainerView::updatePeerViews(int specific)
pvf->latencyLabel->setText(latlab, dontSendNotification);
}

pvf->latActiveButton->setToggleState(latactive, dontSendNotification);


bool initCompleted = false;
int autobufmode = (int)processor.getRemotePeerAutoresizeBufferMode(i, initCompleted);
Expand Down Expand Up @@ -1771,21 +1775,6 @@ void PeersContainerView::updatePeerViews(int specific)
pvf->addrLabel->setAlpha(connected ? 1.0 : 0.8);
pvf->statusLabel->setAlpha(connected ? 1.0 : disalpha);


if (latinfo.legacy) {
if (pvf->stopLatencyTestTimestampMs > 0.0 && nowstampms > pvf->stopLatencyTestTimestampMs
&& !pvf->latActiveButton->isMouseButtonDown()) {

// only stop if it has actually gotten a real latency
if (latinfo.isreal) {
stopLatencyTest(i);

String messagestr = generateLatencyMessage(latinfo);
showPopTip(messagestr, 5000, pvf->latActiveButton.get(), 300);

}
}
}
}

int i=0;
Expand Down Expand Up @@ -1825,44 +1814,6 @@ void PeersContainerView::updatePeerViews(int specific)
lastUpdateTimestampMs = nowstampms;
}

void PeersContainerView::startLatencyTest(int di)
{
if (di >= mPeerViews.size()) return;

PeerViewInfo * pvf = mPeerViews.getUnchecked(di);

int i = mPeerUpdateOrdering[di];

pvf->stopLatencyTestTimestampMs = Time::getMillisecondCounter(); // make it stop after the first one //+ 1500;
pvf->wasRecvActiveAtLatencyTest = processor.getRemotePeerRecvActive(i);
pvf->wasSendActiveAtLatencyTest = processor.getRemotePeerSendActive(i);

pvf->latencyLabel->setText("****", dontSendNotification);

processor.startRemotePeerLatencyTest(i);
}

void PeersContainerView::stopLatencyTest(int di)
{
if (di >= mPeerViews.size()) return;
PeerViewInfo * pvf = mPeerViews.getUnchecked(di);

int i = mPeerUpdateOrdering[di];

processor.stopRemotePeerLatencyTest(i);

pvf->stopLatencyTestTimestampMs = 0;

SonobusAudioProcessor::LatencyInfo latinfo;
processor.getRemotePeerLatencyInfo(i, latinfo);

if (latinfo.legacy && !latinfo.isreal) {
pvf->latencyLabel->setText(TRANS("PRESS"), dontSendNotification);
} else {
//pvf->latencyLabel->setText(String::formatted("%d ms", (int)lrintf(latinfo.totalRoundtripMs)) + (latinfo.estimated ? "*" : "") , dontSendNotification);
updatePeerViews(i);
}
}

String PeersContainerView::generateLatencyMessage(const SonobusAudioProcessor::LatencyInfo &latinfo)
{
Expand Down Expand Up @@ -2006,24 +1957,11 @@ void PeersContainerView::buttonClicked (Button* buttonThatWasClicked)
SonobusAudioProcessor::LatencyInfo latinfo;
processor.getRemotePeerLatencyInfo(i, latinfo);

if (latinfo.legacy) {
pvf->latActiveButton->setToggleState(!pvf->latActiveButton->getToggleState(), dontSendNotification);
if (pvf->latActiveButton->getToggleState()) {
startLatencyTest(di);
//showPopTip(TRANS("Measuring actual round-trip latency"), 4000, pvf->latActiveButton.get(), 140);
} else {
stopLatencyTest(di);
}
}
else {
String messagestr = generateLatencyMessage(latinfo);

showPopTip(messagestr, 8000, pvf->latActiveButton.get(), 300);
pvf->latActiveButton->setToggleState(false, dontSendNotification);


String messagestr = generateLatencyMessage(latinfo);

showPopTip(messagestr, 8000, pvf->latActiveButton.get(), 300);
pvf->latActiveButton->setToggleState(false, dontSendNotification);

}
return;
}

Expand Down Expand Up @@ -2116,7 +2054,7 @@ void PeersContainerView::buttonClicked (Button* buttonThatWasClicked)
else if (ppvf->unblockButton.get() == buttonThatWasClicked) {
processor.removeBlockedAddress(pinfo.second.address);

processor.connectRemotePeer(pinfo.second.address, pinfo.second.port, pinfo.second.user, pinfo.second.group);
processor.connectRemotePeer(pinfo.second.address, pinfo.second.port, pinfo.second.userId, pinfo.second.user, pinfo.second.group, pinfo.second.groupId);

mPendingUsers.erase(pinfo.first);
rebuildPeerViews();
Expand Down
13 changes: 6 additions & 7 deletions Source/PeersContainerView.h
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,10 @@ public MultiTimer
int getPeerViewCount() const { return mPeerViews.size(); }

void resetPendingUsers();
void peerPendingJoin(String & group, String & user);
void peerFailedJoin(String & group, String & user);
void peerBlockedJoin(String & group, String & user, String & address, int port);
void peerLeftGroup(String & group, String & user);
void peerPendingJoin(String & group, String & user, AooId groupId, AooId userId);
void peerFailedJoin(String & group, String & user, AooId groupId, AooId userId);
void peerBlockedJoin(String & group, String & user, String & address, int port, AooId groupId, AooId userId);
void peerLeftGroup(String & group, String & user, AooId groupId, AooId userId);
int getPendingPeerCount() const { return (int)mPendingUsers.size(); }

void rebuildPeerViews();
Expand Down Expand Up @@ -247,9 +247,6 @@ public MultiTimer

protected:

void startLatencyTest(int i);
void stopLatencyTest(int i);

void configLevelSlider(Slider * slider);
void configLabel(Label *label, int ltype);
void configKnobSlider(Slider * slider);
Expand Down Expand Up @@ -286,6 +283,8 @@ public MultiTimer
PendingUserInfo(const String & group_="", const String & user_="") : group(group_), user(user_) {}
String group;
String user;
AooId groupId = kAooIdInvalid;
AooId userId = kAooIdInvalid;
bool failed = false;
bool blocked = false;
String address;
Expand Down
4 changes: 3 additions & 1 deletion Source/SonoStandaloneFilterApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,9 @@ class SonobusStandaloneFilterApp : public JUCEApplication, public Timer

sonoproc->setWatchPublicGroups(false);

sonoproc->joinServerGroup(cmdlineConnInfo.groupName, cmdlineConnInfo.groupPassword, cmdlineConnInfo.groupIsPublic);
sonoproc->joinServerGroup(cmdlineConnInfo.groupName, cmdlineConnInfo.groupPassword,
cmdlineConnInfo.userName, cmdlineConnInfo.userPassword,
cmdlineConnInfo.groupIsPublic);
}
}

Expand Down
Loading