Skip to content

Commit

Permalink
Merge pull request #3 from schweizerweb/version-3-release
Browse files Browse the repository at this point in the history
Version 3 release
  • Loading branch information
schweizerweb committed Dec 8, 2023
2 parents fd54feb + 27dd052 commit a5ffe45
Show file tree
Hide file tree
Showing 87 changed files with 4,913 additions and 6,226 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ jobs:
run: |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
- name: Set Build info
shell: bash
run: |
sed -i.bak "s/BUILD_NUMBER 0/BUILD_NUMBER ${{github.run_number}}/" Common/BuildInfo.h
sed -i.bak "s/COMMIT_ID \"\"/COMMIT_ID \"${{github.event.pull_request.head.sha}}\"/" Common/BuildInfo.h
- name: Configure CMake
run: >
cmake -B ${{ steps.strings.outputs.build-output-dir }}
Expand All @@ -80,4 +86,24 @@ jobs:
- name: Test
working-directory: ${{ steps.strings.outputs.build-output-dir }}
run: ctest --build-config ${{ matrix.build_type }}

- if: ${{ runner.os == 'macOS' }}
name: Install packagesbuild
shell: bash
run: |
wget http://s.sudre.free.fr/Software/files/Packages.dmg
hdiutil attach Packages.dmg -mountpoint "/Volumes/PackagesTmp"
sudo installer -package "/Volumes/PackagesTmp/Install Packages.pkg" -target /
hdiutil detach /Volumes/PackagesTmp
- name: Build Installer
shell: bash
working-directory: ${{ steps.strings.outputs.build-output-dir }}
run: ../Setup/build_installer.sh -p ${{ matrix.name }} -t "0.0.0.${{github.run_id}}" -n "ICST_AmbiPlugins_dev_${{ matrix.name }}_cibuild_${{github.run_number}}"

- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.name }}
path: ${{ steps.strings.outputs.build-output-dir }}/packages/*

6 changes: 6 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ jobs:
run: |
sed -i.bak "s/.*#version_replacement_tag#.*/VERSION ${{ needs.prepare.outputs.version }}/" CMakeLists.txt
- name: Set Build info
shell: bash
run: |
sed -i.bak "s/BUILD_NUMBER 0/BUILD_NUMBER ${{github.run_number}}/" Common/BuildInfo.h
sed -i.bak "s/COMMIT_ID \"\"/COMMIT_ID \"${{github.sha}}\"/" Common/BuildInfo.h
- name: Set reusable strings
id: strings
shell: bash
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ Encoder/Builds/
Encoder/JuceLibraryCode/
bin/
packages/
build/
build*/
*AutoGen.jucer
.vscode/
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ cmake_minimum_required(VERSION 3.15)

if(APPLE)
set( CMAKE_OSX_ARCHITECTURES "x86_64;arm64" CACHE STRING "" )
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.13" CACHE STRING "Minimum OSX deployment version")
if(XCODE_VERSION VERSION_GREATER_EQUAL 15)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-ld_classic" CACHE STRING "Xcode 15 Linker issue")
message("Xcode ${XCODE_VERSION} detected, using old linker style")
endif()
endif()

project(ICST_AMBISONICS_PLUGINS
Expand All @@ -30,7 +35,7 @@ set(COMMON_PLUGIN_SETTINGS
# EDITOR_WANTS_KEYBOARD_FOCUS TRUE/FALSE # Does the editor need keyboard focus?
# COPY_PLUGIN_AFTER_BUILD TRUE/FALSE # Should the plugin be installed to a default location after building?
PLUGIN_MANUFACTURER_CODE "ICST" # A four-character manufacturer id with at least one upper-case character
FORMATS AU VST3 Standalone LV2 # The formats to build. Other valid formats are: AAX Unity VST AU AUv3
FORMATS AU VST3 LV2 # The formats to build. Other valid formats are: AAX Unity VST AU AUv3
AU_MAIN_TYPE kAudioUnitType_Effect
NEEDS_WEB_BROWSER TRUE
)
Expand Down
31 changes: 5 additions & 26 deletions Common/AmbiDataSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

#include "AmbiDataSet.h"

AmbiDataSet::AmbiDataSet(ScalingInfo* pScaling) : pScalingInfo(pScaling), groupModeFlag(DEFAULT_GROUP_MODE_FLAG)
AmbiDataSet::AmbiDataSet(ScalingInfo* pScaling, bool _groupModeFlag) : pScalingInfo(pScaling), groupModeFlag(_groupModeFlag)
{
}

Expand Down Expand Up @@ -784,37 +784,16 @@ bool AmbiDataSet::getGroupModeFlag() const
return groupModeFlag;
}

void AmbiDataSet::setGroupModeFlag(bool en)
{
std::map<int, Vector3D<double>> origPos;

if(groupModeFlag != en)
{
// rearrange all source positions
for(int i = 0; i < size(); i++)
{
auto p = get(i);
if(p != nullptr)
{
origPos[i] = getAbsSourcePoint(i);
}
}
}

groupModeFlag = en;

for(auto& p : origPos)
setAbsSourcePoint(p.first, p.second);
}


Vector3D<double> AmbiDataSet::getAbsSourcePoint(int index) const
{
const ScopedLock lock(cs);

if(groupModeFlag)
{
Vector3D<double> pt = get(index)->getVector3D();
auto p = get(index);
if(p==nullptr)
return Vector3D<double>();
Vector3D<double> pt = p->getVector3D();
auto grpPoint = get(index)->getGroup();
if(grpPoint != nullptr)
{
Expand Down
4 changes: 1 addition & 3 deletions Common/AmbiDataSet.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,13 @@
#include "AmbiPoint.h"
#include "AmbiGroup.h"

#define DEFAULT_GROUP_MODE_FLAG false
#define XML_TAG_GROUPS "Groups"
#define XML_TAG_GROUP "Group"

class AmbiDataSet
{
public:
AmbiDataSet(ScalingInfo* pScaling);
AmbiDataSet(ScalingInfo* pScaling, bool _groupModeFlag);
virtual ~AmbiDataSet();

virtual int size() const = 0;
Expand Down Expand Up @@ -101,7 +100,6 @@ class AmbiDataSet
void setAbsSourcePoint(int index, Vector3D<double> absPoint);

bool getGroupModeFlag() const;
void setGroupModeFlag(bool en);

private:
bool nameExists(String name) const;
Expand Down
15 changes: 4 additions & 11 deletions Common/AmbiSourceSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,8 @@ void AmbiSourceSet::addNew(String id, Point3D<double> point, String name, Colour

void AmbiSourceSet::loadFromXml(XmlElement* xmlElement, AudioParams* pAudioParams)
{
XmlElement* groupMode = xmlElement->getChildByName(XML_TAG_GROUP_MODE);
if(groupMode != nullptr)
{
groupModeFlag = groupMode->getBoolAttribute(XML_ATTRIBUTE_ENABLE, DEFAULT_GROUP_MODE_FLAG);
}

const ScopedLock lock(cs);

XmlElement* distanceScalerXml = xmlElement->getChildByName(XML_TAG_DISTANCE_SCALER);
if (distanceScalerXml != nullptr)
{
Expand Down Expand Up @@ -233,11 +229,8 @@ void AmbiSourceSet::loadFromXml(XmlElement* xmlElement, AudioParams* pAudioParam

void AmbiSourceSet::writeToXmlElement(XmlElement* xml) const
{
// group mode flag
XmlElement* groupMode = new XmlElement(XML_TAG_GROUP_MODE);
groupMode->setAttribute(XML_ATTRIBUTE_ENABLE, groupModeFlag);
xml->addChildElement(groupMode);

const ScopedLock lock(cs);

XmlElement* distanceScalerXml = new XmlElement(XML_TAG_DISTANCE_SCALER);
distanceScalerXml->setAttribute(XML_ATTRIBUTE_FACTOR, getDistanceScaler());
xml->addChildElement(distanceScalerXml);
Expand Down
2 changes: 1 addition & 1 deletion Common/AmbiSourceSet.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
class AmbiSourceSet : public AmbiDataSet, public AudioProcessorParameter::Listener, public ChangeBroadcaster
{
public:
AmbiSourceSet(ScalingInfo* pScaling) : AmbiDataSet(pScaling), distanceScaler(DEFAULT_DISTANCE_SCALER), masterGain(nullptr), localMasterGain(DEFAULT_MASTER_GAIN)
AmbiSourceSet(ScalingInfo* pScaling) : AmbiDataSet(pScaling, true), distanceScaler(DEFAULT_DISTANCE_SCALER), masterGain(nullptr), localMasterGain(DEFAULT_MASTER_GAIN)
{}

void initialize(AudioProcessor* pProcessor);
Expand Down
2 changes: 0 additions & 2 deletions Common/AmbiSpeakerSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,12 @@ void AmbiSpeakerSet::loadFromXml(XmlElement *xmlElement)
for(int i = 0; i < elements.size(); i++)
ambiPointPointers.add(elements[i]);

int index = 0;
XmlElement* xmlGroup = groupsElement->getChildByName(XML_TAG_GROUP);
while (xmlGroup != nullptr)
{
groups.add(new AmbiGroup(xmlGroup, &ambiPointPointers, AudioParameterSet(), pScalingInfo));

xmlGroup = xmlGroup->getNextElement();
index++;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Common/AmbiSpeakerSet.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
class AmbiSpeakerSet : public AmbiDataSet
{
public:
AmbiSpeakerSet(ScalingInfo* pScaling) : AmbiDataSet(pScaling) {}
AmbiSpeakerSet(ScalingInfo* pScaling) : AmbiDataSet(pScaling, false) {}
AmbiSpeaker* get(int index) const override;

void add(AmbiSpeaker* pt);
Expand Down
2 changes: 2 additions & 0 deletions Common/BuildInfo.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#define BUILD_NUMBER 0
#define COMMIT_ID ""
37 changes: 37 additions & 0 deletions Common/Constants.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@


#include "Constants.h"
#include "BuildInfo.h"
#include "JuceHeader.h"

const float Constants::AzimuthRadMin = float(0);
Expand Down Expand Up @@ -65,3 +66,39 @@ bool Constants::isNonVisibleVersionPrerelease()
{
return String(ProjectInfo::versionString).endsWith("-t");
}

String Constants::getUiVersionString(bool addLeadingSpace)
{
if(Constants::isNonVisibleVersionPrerelease())
{
return "";
}

String versionString;
if(String(ProjectInfo::versionString).startsWith("0.0.0."))
{
if(BUILD_NUMBER > 0)
{
versionString = "Dev" + String(BUILD_NUMBER);
}
else
{
versionString = "self-built";
}
}
else
{
versionString = String(ProjectInfo::versionString);
}

return addLeadingSpace
? (" " + versionString)
: versionString;
}

String Constants::getBuildInfo()
{
return String(COMMIT_ID) == String("")
? ""
: ("Version: " + getUiVersionString(false) + "\r\nBuild#: " + String(BUILD_NUMBER) + "\r\nLast commit: " + COMMIT_ID);
}
3 changes: 3 additions & 0 deletions Common/Constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@


#pragma once
#include "JuceHeader.h"

#define PI 3.1415926535897932384626433832795
#define SOUND_SPEED_M_PER_S 343.0
Expand Down Expand Up @@ -54,4 +55,6 @@ class Constants

static bool isDevelopmentVersion();
static bool isNonVisibleVersionPrerelease();
static String getUiVersionString(bool addBrackets);
static String getBuildInfo();
};
4 changes: 2 additions & 2 deletions Common/DelayHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ double DelayHelper::getDelayCompensationMs(double distance, double maxNormalized

int DelayHelper::getDelayCompensationSamples(double distance, double maxNormalizedDistance, double samplingRate)
{
return int((maxNormalizedDistance - distance)
return jmax(0, int((maxNormalizedDistance - distance)
* SOUND_SPEED_S_PER_M
* samplingRate);
* samplingRate));
}

float DelayHelper::getDelaySamples(double distance, double samplingRate)
Expand Down
55 changes: 28 additions & 27 deletions Common/HelpComponent.cpp
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
/*
================================================================================
This file is part of the ICST AmbiPlugins.
ICST AmbiPlugins are free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ICST AmbiPlugins are distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the ICSTAmbiPlugins. If not, see <http://www.gnu.org/licenses/>.
================================================================================
*/



/*
================================================================================
This file is part of the ICST AmbiPlugins.
ICST AmbiPlugins are free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ICST AmbiPlugins are distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the ICSTAmbiPlugins. If not, see <http://www.gnu.org/licenses/>.
================================================================================
*/



//[Headers] You can add your own extra header files here...
#include "HelpRadarInteraction.h"
#include "HelpOscSyntax.h"
#include "HelpWebBrowserComponent.h"
#include "Constants.h"
//[/Headers]

#include "HelpComponent.h"
Expand All @@ -44,7 +45,7 @@ HelpComponent::HelpComponent (bool isEncoder)
tabHelp->setCurrentTabIndex (0);

label.reset (new juce::Label ("new label",
juce::CharPointer_UTF8 ("\xc2\xa9 2022 Martin Neukom, Johannes Schuett & Christian Schweizer @ ICST")));
juce::CharPointer_UTF8 ("\xc2\xa9 2023 Martin Neukom, Johannes Schuett & Christian Schweizer @ ICST")));
addAndMakeVisible (label.get());
label->setFont (juce::Font (15.00f, juce::Font::plain).withTypefaceStyle ("Regular"));
label->setJustificationType (juce::Justification::centred);
Expand All @@ -60,13 +61,13 @@ HelpComponent::HelpComponent (bool isEncoder)
}

String documentationUrl = isEncoder
? "https://bitbucket.org/christian_schweizer/icst-ambisonics-plugins/wiki/Encoder_specification"
: "https://bitbucket.org/christian_schweizer/icst-ambisonics-plugins/wiki/Decoder_specification";
? "https://github.com/schweizerweb/icst-ambisonics-plugins/wiki/ICST-AmbiEncoder"
: "https://github.com/schweizerweb/icst-ambisonics-plugins/wiki/ICST-AmbiDecoder";
tabHelp->addTab(TRANS("Documentation"), Colours::lightgrey, new HelpWebBrowserComponent(documentationUrl), true);
tabHelp->addTab(TRANS("Tutorials"), Colours::lightgrey, new HelpWebBrowserComponent("https://ambisonics.ch/page/icst-ambisonics-plugins"), true);

label->setText(String(JucePlugin_Name).upToFirstOccurrenceOf("_", false, false) + " " + String(ProjectInfo::versionString) + " " + String::fromUTF8("\xc2\xa9 2022 Martin Neukom, Johannes Schuett & Christian Schweizer @ ICST"), dontSendNotification);

label->setText(String(JucePlugin_Name).upToFirstOccurrenceOf("_", false, false) + Constants::getUiVersionString(true) + " " + String::fromUTF8("\xc2\xa9 2023 Martin Neukom, Johannes Schuett & Christian Schweizer @ ICST"), dontSendNotification);
label->setTooltip(Constants::getBuildInfo());
//[/UserPreSize]

setSize (600, 400);
Expand Down Expand Up @@ -140,7 +141,7 @@ BEGIN_JUCER_METADATA
</TABBEDCOMPONENT>
<LABEL name="new label" id="c9e7e52a2e8c0879" memberName="label" virtualName=""
explicitFocusOrder="0" pos="0 3Rr 0M 16" edTextCol="ff000000"
edBkgCol="0" labelText="&#169; 2022 Martin Neukom, Johannes Schuett &amp; Christian Schweizer @ ICST"
edBkgCol="0" labelText="&#169; 2023 Martin Neukom, Johannes Schuett &amp; Christian Schweizer @ ICST"
editableSingleClick="0" editableDoubleClick="0" focusDiscardsChanges="0"
fontname="Default font" fontsize="15.0" kerning="0.0" bold="0"
italic="0" justification="36"/>
Expand Down
Loading

0 comments on commit a5ffe45

Please sign in to comment.