Skip to content

Commit

Permalink
Merge branch 'master' into cleanup-lmms-math
Browse files Browse the repository at this point in the history
  • Loading branch information
Rossmaxx committed Aug 9, 2024
2 parents 7ebb8c2 + 632966c commit 30c61cb
Show file tree
Hide file tree
Showing 134 changed files with 814 additions and 700 deletions.
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
---
custom: https://lmms.io/get-involved/#donate
3 changes: 2 additions & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ body:
label: Screenshots / Minimum Reproducible Project
description: |
- Upload any screenshots showing the bug in action.
- If possible, also include a .mmp/.mmpz project containing the simplest possible setup needed to reproduce the bug.
- If possible, also include a .mmp/.mmpz project containing the simplest possible
setup needed to reproduce the bug.
***Note:** To upload a project file to GitHub, it will need to be placed in a .zip archive.*
- type: checkboxes
Expand Down
7 changes: 4 additions & 3 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
contact_links:
- name: Get help on Discord
url: https://lmms.io/chat/
about: Need help? Have a question? Reach out to other LMMS users on our Discord server!
- name: Get help on Discord
url: https://lmms.io/chat/
about: Need help? Have a question? Reach out to other LMMS users on our Discord server!
3 changes: 2 additions & 1 deletion .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ body:
label: Enhancement Summary
description: |
- Briefly describe the enhancement.
- Explain why you believe the proposed enhancement to be a good idea, and (if applicable) how it helps overcome a limitation of LMMS you are currently facing.
- Explain why you believe the proposed enhancement to be a good idea, and (if applicable) how it helps
overcome a limitation of LMMS you are currently facing.
validations:
required: true
- type: textarea
Expand Down
1 change: 1 addition & 0 deletions .github/no-response.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
---
# Label requiring a response
responseRequiredLabel: "response required"
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -260,12 +260,14 @@ jobs:
- name: Cache ccache data
uses: actions/cache@v3
with:
# yamllint disable rule:line-length
key: "ccache-${{ github.job }}-${{ matrix.arch }}-${{ github.ref }}\
-${{ github.run_id }}"
restore-keys: |
ccache-${{ github.job }}-${{ matrix.arch }}-${{ github.ref }}-
ccache-${{ github.job }}-${{ matrix.arch }}-
path: ~\AppData\Local\ccache
# yamllint enable rule:line-length
- name: Install tools
run: choco install ccache
- name: Install Qt
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,10 @@ jobs:
$(find "./cmake/" -type f -name '*.sh' -o -name "*.sh.in") \
doc/bash-completion/lmms \
buildtools/update_locales
yamllint:
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v3
- name: Run yamllint
run: for i in $(git ls-files '*.yml'); do yamllint $i; done
3 changes: 3 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
rules:
line-length:
max: 120 # be conforming to LMMS coding rules
65 changes: 2 additions & 63 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -630,69 +630,6 @@ ENDIF(WANT_DEBUG_FPE)
# check for libsamplerate
FIND_PACKAGE(Samplerate 0.1.8 MODULE REQUIRED)

# Shim the SYSTEM property for older CMake versions
if(CMAKE_VERSION VERSION_LESS "3.25")
define_property(TARGET
PROPERTY SYSTEM
INHERITED
BRIEF_DOCS "Shim of built-in SYSTEM property for CMake versions less than 3.25"
FULL_DOCS "Non-functional, but allows the property to be inherited properly."
"See the CMake documentation at https://cmake.org/cmake/help/latest/prop_tgt/SYSTEM.html."
)
endif()

# Add warning and error flags
option(USE_WERROR "Treat compiler warnings as errors" OFF)
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
set(COMPILE_ERROR_FLAGS
"-Wall" # Enable most warnings by default
"-Werror=unused-function" # Unused functions are an error
# TODO: Fix the code and remove the following:
"-Wno-sign-compare" # Permit comparisons between signed and unsigned integers
"-Wno-strict-overflow" # Permit optimisations assuming no signed overflow
)
set(THIRD_PARTY_COMPILE_ERROR_FLAGS
"-w" # Disable all warnings
)

# Due to a regression in gcc-4.8.X, we need to disable array-bounds check
# TODO: Is this still necessary?
if(CMAKE_COMPILER_IS_GNUCXX)
list(APPEND COMPILE_ERROR_FLAGS
"-Wno-array-bounds" # Permit out-of-bounds array subscripts
"-Wno-attributes" # Permit unrecognised attributes
)
endif()

if(USE_WERROR)
list(APPEND COMPILE_ERROR_FLAGS
"-Werror" # Treat warnings as errors
)
endif()
elseif(MSVC)
set(COMPILE_ERROR_FLAGS
"/W2" # Enable some warnings by default
"/external:W0" # Don't emit warnings for third-party code
"/external:anglebrackets" # Consider headers included with angle brackets to be third-party
"/external:templates-" # Still emit warnings from first-party instantiations of third-party templates
# Silence "class X needs to have DLL-interface to be used by clients of
# class Y" warnings. These aren't trivial to address, and don't pose a
# problem for us since we build all modules with the same compiler and
# options, and dynamically link the CRT.
"/wd4251"
)
set(THIRD_PARTY_COMPILE_ERROR_FLAGS
"/W0" # Disable all warnings
)

if(USE_WERROR)
list(APPEND COMPILE_ERROR_FLAGS
"/WX" # Treat warnings as errors
)
endif()
endif()
add_compile_options("$<IF:$<BOOL:$<TARGET_PROPERTY:SYSTEM>>,${THIRD_PARTY_COMPILE_ERROR_FLAGS},${COMPILE_ERROR_FLAGS}>")

IF(NOT CMAKE_BUILD_TYPE)
message(STATUS "Setting build type to 'Release' as none was specified.")
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
Expand Down Expand Up @@ -774,6 +711,8 @@ add_sanitizer(memory "Clang" WANT_DEBUG_MSAN STATUS_DEBUG_MSAN -fno-omit-frame-p
# not being found by PeakController
add_sanitizer(undefined "GNU|Clang" WANT_DEBUG_UBSAN STATUS_DEBUG_UBSAN -fno-sanitize=vptr)

# Add warning and error flags
include(ErrorFlags)

# use ccache
include(CompileCache)
Expand Down
72 changes: 72 additions & 0 deletions cmake/modules/ErrorFlags.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Shim the SYSTEM property for older CMake versions - we rely on this property
# to determine which set of error flags to use.
if(CMAKE_VERSION VERSION_LESS "3.25")
define_property(TARGET
PROPERTY SYSTEM
INHERITED
BRIEF_DOCS "Shim of built-in SYSTEM property for CMake versions less than 3.25"
FULL_DOCS "Non-functional, but allows the property to be inherited properly."
"See the CMake documentation at https://cmake.org/cmake/help/latest/prop_tgt/SYSTEM.html."
)
endif()

# Allow the user to control whether to treat warnings as errors
option(USE_WERROR "Treat compiler warnings as errors" OFF)

# Compute the appropriate flags for the current compiler and options
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
set(COMPILE_ERROR_FLAGS
"-Wall" # Enable most warnings by default
)
set(THIRD_PARTY_COMPILE_ERROR_FLAGS
"-w" # Disable all warnings
)

if(CMAKE_COMPILER_IS_GNUCXX)
list(APPEND COMPILE_ERROR_FLAGS
# The following warning generates false positives that are difficult
# to work around, in particular when inlining calls to standard
# algorithms performed on single-element arrays. See, for example,
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111273.
"-Wno-array-bounds" # Permit out-of-bounds array subscripts
)

if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "11")
list(APPEND COMPILE_ERROR_FLAGS
# This has the same problems described above for "array-bounds".
"-Wno-stringop-overread" # Permit string functions overreading the source
)
endif()
endif()

if(USE_WERROR)
list(APPEND COMPILE_ERROR_FLAGS
"-Werror" # Treat warnings as errors
)
endif()
elseif(MSVC)
set(COMPILE_ERROR_FLAGS
"/W2" # Enable some warnings by default
"/external:W0" # Don't emit warnings for third-party code
"/external:anglebrackets" # Consider headers included with angle brackets to be third-party
"/external:templates-" # Still emit warnings from first-party instantiations of third-party templates
# Silence "class X needs to have DLL-interface to be used by clients of
# class Y" warnings. These aren't trivial to address, and don't pose a
# problem for us since we build all modules with the same compiler and
# options, and dynamically link the CRT.
"/wd4251"
)
set(THIRD_PARTY_COMPILE_ERROR_FLAGS
"/W0" # Disable all warnings
)

if(USE_WERROR)
list(APPEND COMPILE_ERROR_FLAGS
"/WX" # Treat warnings as errors
)
endif()
endif()

# Add the flags to the whole directory tree. We use the third-party flags for
# targets whose SYSTEM property is true, and the normal flags otherwise.
add_compile_options("$<IF:$<BOOL:$<TARGET_PROPERTY:SYSTEM>>,${THIRD_PARTY_COMPILE_ERROR_FLAGS},${COMPILE_ERROR_FLAGS}>")
Binary file added data/themes/classic/autoscroll_continuous_on.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/themes/classic/autoscroll_stepped_on.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/themes/default/autoscroll_continuous_on.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/themes/default/autoscroll_stepped_on.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions include/AudioEngineWorkerThread.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ class AudioEngineWorkerThread : public QThread

private:
std::atomic<ThreadableJob*> m_items[JOB_QUEUE_SIZE];
std::atomic_int m_writeIndex;
std::atomic_int m_itemsDone;
std::atomic_size_t m_writeIndex;
std::atomic_size_t m_itemsDone;
OperationMode m_opMode;
} ;

Expand Down
10 changes: 3 additions & 7 deletions include/AudioPortAudio.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,7 @@ class AudioPortAudio : public AudioDevice
return QT_TRANSLATE_NOOP( "AudioDeviceSetupWidget", "PortAudio" );
}


int process_callback( const float *_inputBuffer,
float * _outputBuffer,
unsigned long _framesPerBuffer );

int process_callback(const float* _inputBuffer, float* _outputBuffer, f_cnt_t _framesPerBuffer);

class setupWidget : public gui::AudioDeviceSetupWidget
{
Expand Down Expand Up @@ -151,8 +147,8 @@ class AudioPortAudio : public AudioDevice
bool m_wasPAInitError;

SampleFrame* m_outBuf;
int m_outBufPos;
int m_outBufSize;
std::size_t m_outBufPos;
fpp_t m_outBufSize;

bool m_stopped;

Expand Down
1 change: 1 addition & 0 deletions include/BasicFilters.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#endif

#include <cmath>
#include <array>

#include "lmms_basics.h"
#include "lmms_constants.h"
Expand Down
4 changes: 0 additions & 4 deletions include/BufferManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@ class LMMS_EXPORT BufferManager
public:
static void init( fpp_t fpp );
static SampleFrame* acquire();
// audio-buffer-mgm
static void clear( SampleFrame* ab, const f_cnt_t frames,
const f_cnt_t offset = 0 );

static void release( SampleFrame* buf );

private:
Expand Down
1 change: 1 addition & 0 deletions include/ConfigManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ class LMMS_EXPORT ConfigManager : public QObject

QString defaultVersion() const;

static bool enableBlockedPlugins();

static QStringList availableVstEmbedMethods();
QString vstEmbedMethod() const;
Expand Down
1 change: 1 addition & 0 deletions include/DataFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ class LMMS_EXPORT DataFile : public QDomDocument
void upgrade_noteTypes();
void upgrade_fixCMTDelays();
void upgrade_fixBassLoopsTypo();
void findProblematicLadspaPlugins();

// List of all upgrade methods
static const std::vector<UpgradeMethod> UPGRADE_METHODS;
Expand Down
2 changes: 0 additions & 2 deletions include/Engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@ class LMMS_EXPORT Engine : public QObject
return s_projectJournal;
}

static bool ignorePluginBlacklist();

#ifdef LMMS_HAVE_LV2
static class Lv2Manager * getLv2Manager()
{
Expand Down
7 changes: 4 additions & 3 deletions include/InstrumentFunctions.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@
#ifndef LMMS_INSTRUMENT_FUNCTIONS_H
#define LMMS_INSTRUMENT_FUNCTIONS_H

#include "JournallingObject.h"
#include "lmms_basics.h"
#include <array>

#include "AutomatableModel.h"
#include "TempoSyncKnobModel.h"
#include "ComboBoxModel.h"
#include "JournallingObject.h"
#include "TempoSyncKnobModel.h"

namespace lmms
{
Expand Down
2 changes: 2 additions & 0 deletions include/InstrumentTrack.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
#ifndef LMMS_INSTRUMENT_TRACK_H
#define LMMS_INSTRUMENT_TRACK_H

#include <limits>

#include "AudioPort.h"
#include "InstrumentFunctions.h"
#include "InstrumentSoundShaping.h"
Expand Down
4 changes: 2 additions & 2 deletions include/LocklessAllocator.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ class LocklessAllocator
std::atomic_int * m_freeState;
size_t m_freeStateSets;

std::atomic_int m_available;
std::atomic_int m_startIndex;
std::atomic_size_t m_available;
std::atomic_size_t m_startIndex;

} ;

Expand Down
10 changes: 9 additions & 1 deletion include/Lv2Basics.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Lv2Basics.h - basic Lv2 utils
*
* Copyright (c) 2018-2023 Johannes Lorenz <jlsf2013$users.sourceforge.net, $=@>
* Copyright (c) 2018-2024 Johannes Lorenz <jlsf2013$users.sourceforge.net, $=@>
*
* This file is part of LMMS - https://lmms.io
*
Expand Down Expand Up @@ -37,6 +37,12 @@
namespace lmms
{

template<class T>
struct LilvPtrDeleter
{
void operator()(T* n) { lilv_free(static_cast<void*>(n)); }
};

struct LilvNodeDeleter
{
void operator()(LilvNode* n) { lilv_node_free(n); }
Expand All @@ -52,6 +58,8 @@ struct LilvScalePointsDeleter
void operator()(LilvScalePoints* s) { lilv_scale_points_free(s); }
};

template<class T>
using AutoLilvPtr = std::unique_ptr<T, LilvPtrDeleter<T>>;
using AutoLilvNode = std::unique_ptr<LilvNode, LilvNodeDeleter>;
using AutoLilvNodes = std::unique_ptr<LilvNodes, LilvNodesDeleter>;
using AutoLilvScalePoints = std::unique_ptr<LilvScalePoints, LilvScalePointsDeleter>;
Expand Down
Loading

0 comments on commit 30c61cb

Please sign in to comment.