Skip to content

Commit

Permalink
Merge branch 'rossmaxx-work' into enable-ladspa
Browse files Browse the repository at this point in the history
  • Loading branch information
dan-giddins authored Nov 6, 2023
2 parents 16c4e54 + d40b05c commit a14a5e8
Show file tree
Hide file tree
Showing 13 changed files with 128 additions and 43 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
CCACHE_MAXSIZE: 500M
macos:
name: macos
runs-on: macos-11
runs-on: macos-12
env:
CMAKE_OPTS: >-
-DUSE_WERROR=ON
Expand All @@ -78,7 +78,7 @@ jobs:
CCACHE_MAXSIZE: 0
CCACHE_NOCOMPRESS: 1
MAKEFLAGS: -j3
DEVELOPER_DIR: /Applications/Xcode_11.7.app/Contents/Developer
DEVELOPER_DIR: /Applications/Xcode_13.1.app/Contents/Developer
steps:
- name: Check out
uses: actions/checkout@v3
Expand All @@ -105,6 +105,7 @@ jobs:
- name: Install dependencies
run: |
brew bundle install --verbose
npm update -g npm
npm install --location=global appdmg
env:
HOMEBREW_NO_AUTO_UPDATE: 1
Expand Down
23 changes: 23 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,24 @@ SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules" ${CMAKE_MODULE_PATH})
SET(LMMS_BINARY_DIR ${CMAKE_BINARY_DIR})
SET(LMMS_SOURCE_DIR ${CMAKE_SOURCE_DIR})

# CMAKE_POLICY Section
IF(COMMAND CMAKE_POLICY)
CMAKE_POLICY(SET CMP0005 NEW)
CMAKE_POLICY(SET CMP0003 NEW)
IF (CMAKE_MAJOR_VERSION GREATER 2)
CMAKE_POLICY(SET CMP0026 NEW)
CMAKE_POLICY(SET CMP0045 NEW)
CMAKE_POLICY(SET CMP0050 OLD)
ENDIF()
CMAKE_POLICY(SET CMP0020 NEW)
CMAKE_POLICY(SET CMP0057 NEW)
# TODO: Keep CMP0074 but remove this condition when cmake 3.12+ is guaranteed
IF(${CMAKE_VERSION} VERSION_GREATER_EQUAL 3.12)
# Needed for the SWH Ladspa plugins. See below.
CMAKE_POLICY(SET CMP0074 NEW) # find_package() uses <PackageName>_ROOT variables
ENDIF()
ENDIF(COMMAND CMAKE_POLICY)

# Import of windows.h breaks min()/max()
ADD_DEFINITIONS(-DNOMINMAX)

Expand Down Expand Up @@ -299,6 +317,11 @@ ELSE(WANT_CMT)
ENDIF(WANT_CMT)

IF(WANT_SWH)
IF(LMMS_BUILD_APPLE)
# Prefer system perl over Homebrew, MacPorts, etc
SET(Perl_ROOT "/usr/bin")
ENDIF()
FIND_PACKAGE(Perl)
IF(PERL_FOUND)
SET(LMMS_HAVE_SWH TRUE)
SET(STATUS_SWH "OK")
Expand Down
66 changes: 66 additions & 0 deletions CMakeSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
"configurations": [
{
"name": "x64-Debug",
"generator": "Ninja",
"configurationType": "Debug",
"inheritEnvironments": [ "msvc_x64" ],
"buildRoot": "${projectDir}\\out\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}",
"variables": [
{
"name": "Qt5_DIR",
"value": "C:/Qt/5.15.2/msvc2019_64/lib/cmake",
"type": "PATH"
},
{
"name": "Qt5Test_DIR",
"value": "C:/Qt/5.15.2/msvc2019_64/lib/cmake/Qt5Test",
"type": "PATH"
},
{
"name": "PERL_EXECUTABLE",
"value": "C:/Strawberry/perl/bin/perl.exe",
"type": "FILEPATH"
},
{
"name": "VCPKG_TRACE_FIND_PACKAGE",
"value": "ON",
"type": "STRING"
}
],
"cmakeToolchain": "C:/vcpkg/scripts/buildsystems/vcpkg.cmake"
},
{
"name": "x64-Release",
"generator": "Ninja",
"configurationType": "Release",
"buildRoot": "${projectDir}\\out\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeToolchain": "C:/vcpkg/scripts/buildsystems/vcpkg.cmake",
"inheritEnvironments": [ "msvc_x64" ],
"variables": [
{
"name": "Qt5_DIR",
"value": "C:/Qt/5.15.2/msvc2019_64/lib/cmake",
"type": "PATH"
},
{
"name": "Qt5Test_DIR",
"value": "C:/Qt/5.15.2/msvc2019_64/lib/cmake/Qt5Test",
"type": "PATH"
},
{
"name": "PERL_EXECUTABLE",
"value": "C:/Strawberry/perl/bin/perl.exe",
"type": "FILEPATH"
},
{
"name": "VCPKG_TRACE_FIND_PACKAGE",
"value": "ON",
"type": "STRING"
}
]
}
]
}
2 changes: 1 addition & 1 deletion plugins/LadspaEffect/caps/basics.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@

#define MIN_GAIN .000001 /* -120 dB */

/* smallest non-denormal 32 bit IEEE float is 1.18x10-38 */
/* smallest non-denormal 32 bit IEEE float is 1.18*10^-38 */
#define NOISE_FLOOR .00000000000005 /* -266 dB */

typedef int8_t int8;
Expand Down
3 changes: 3 additions & 0 deletions plugins/LadspaEffect/caps/dsp/Eq.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
02111-1307, USA or point your web browser to http://www.gnu.org.
*/


#include "../basics.h"

#ifndef _DSP_EQ_H_
#define _DSP_EQ_H_

Expand Down
2 changes: 2 additions & 0 deletions plugins/LadspaEffect/caps/dsp/OnePole.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
02111-1307, USA or point your web browser to http://www.gnu.org.
*/

#include "../basics.h"

#ifndef _ONE_POLE_H_
#define _ONE_POLE_H_

Expand Down
3 changes: 3 additions & 0 deletions plugins/LadspaEffect/caps/dsp/SVF.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,12 @@
}
*/

#include "../basics.h"

#ifndef _DSP_SVF_H_
#define _DSP_SVF_H_


namespace DSP {

template <int OVERSAMPLE>
Expand Down
2 changes: 2 additions & 0 deletions plugins/LadspaEffect/caps/dsp/Sine.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
02111-1307, USA or point your web browser to http://www.gnu.org.
*/

#include "../basics.h"

#ifndef _DSP_SINE_H_
#define _DSP_SINE_H_

Expand Down
13 changes: 0 additions & 13 deletions plugins/LadspaEffect/caps/interface.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
(2541 - 2580 donated to artemio@kdemail.net)
*/

// #include <sys/time.h> needed if using the commented seed function

#include "basics.h"

#include "Cabinet.h"
Expand Down Expand Up @@ -58,15 +56,6 @@
#define N 39
static DescriptorStub * descriptors [N];

/*static inline void
seed()
{
static struct timeval tv;
gettimeofday (&tv, 0);
srand (tv.tv_sec ^ tv.tv_usec);
}*/

extern "C" {

void caps_so_init()
Expand Down Expand Up @@ -120,8 +109,6 @@ void caps_so_init()

/* make sure N is correct */
assert (d - descriptors == N);

//seed();
}

void caps_so_fini()
Expand Down
4 changes: 1 addition & 3 deletions plugins/LadspaEffect/tap/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/include")
FILE(GLOB PLUGIN_SOURCES tap-plugins/*.c)
LIST(SORT PLUGIN_SOURCES)
IF(NOT MSVC)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3 -Wno-write-strings -fomit-frame-pointer -fno-strict-aliasing -funroll-loops -ffast-math")
ENDIF()
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3 -fomit-frame-pointer -fno-strict-aliasing -funroll-loops -ffast-math")
FOREACH(_item ${PLUGIN_SOURCES})
GET_FILENAME_COMPONENT(_plugin "${_item}" NAME_WE)
ADD_LIBRARY("${_plugin}" MODULE "${_item}")
Expand Down
2 changes: 1 addition & 1 deletion plugins/OpulenZ/adplug
Submodule adplug updated 721 files
44 changes: 22 additions & 22 deletions src/core/DataFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include <QFileInfo>
#include <QDir>
#include <QMessageBox>
#include <QSaveFile>

#include "base64.h"
#include "ConfigManager.h"
Expand Down Expand Up @@ -379,12 +380,12 @@ bool DataFile::writeFile(const QString& filename, bool withResources)
}
}

QFile outfile (fullNameTemp);
QSaveFile outfile(fullNameTemp);

if (!outfile.open(QIODevice::WriteOnly | QIODevice::Truncate))
{
showError(SongEditor::tr("Could not write file"),
SongEditor::tr("Could not open %1 for writing. You probably are not permitted to"
SongEditor::tr("Could not open %1 for writing. You probably are not permitted to "
"write to this file. Please make sure you have write-access to "
"the file and try again.").arg(fullName));

Expand All @@ -405,30 +406,29 @@ bool DataFile::writeFile(const QString& filename, bool withResources)
write( ts );
}

outfile.close();

// make sure the file has been written correctly
if( QFileInfo( outfile.fileName() ).size() > 0 )
if (!outfile.commit())
{
if( ConfigManager::inst()->value( "app", "disablebackup" ).toInt() )
{
// remove current file
QFile::remove( fullName );
}
else
{
// remove old backup file
QFile::remove( fullNameBak );
// move current file to backup file
QFile::rename( fullName, fullNameBak );
}
// move temporary file to current file
QFile::rename( fullNameTemp, fullName );
showError(SongEditor::tr("Could not write file"),
SongEditor::tr("An unknown error has occured and the file could not be saved."));
return false;
}

return true;
if (ConfigManager::inst()->value("app", "disablebackup").toInt())
{
// remove current file
QFile::remove(fullName);
}
else
{
// remove old backup file
QFile::remove(fullNameBak);
// move current file to backup file
QFile::rename(fullName, fullNameBak);
}
// move temporary file to current file
QFile::rename(fullNameTemp, fullName);

return false;
return true;
}


Expand Down

0 comments on commit a14a5e8

Please sign in to comment.