Skip to content

Commit 7128167

Browse files
committed
Merge branch 'master' into fork-master-2
2 parents 71615e8 + f4ba3d2 commit 7128167

46 files changed

Lines changed: 434 additions & 373 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CMakeLists.txt

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,32 @@ ELSE(LMMS_BUILD_WIN32)
150150
SET(STATUS_WINMM "<not supported on this platform>")
151151
ENDIF(LMMS_BUILD_WIN32)
152152

153+
IF(LMMS_BUILD_OPENBSD)
154+
# “don't link deprecated ossaudio on OpenBSD”
155+
# https://cvsweb.openbsd.org/checkout/ports/audio/lmms/patches/patch-CMakeLists_txt?rev=1.3
156+
SET(WANT_OSS OFF)
157+
SET(STATUS_OSS "<not supported on this platform>")
158+
# LMMS finds SDL and compiles fine with it enabled, but it doesn't
159+
# appear as an option when choosing an audio backend in settings for
160+
# some reason. This might be fixable, but the OpenBSD ports
161+
# maintainers have also explicitly disabled SDL since 2010-10-28.
162+
# https://cvsweb.openbsd.org/checkout/ports/audio/lmms/Makefile?rev=1.1
163+
SET(WANT_SDL OFF)
164+
SET(STATUS_SDL "<not supported on this platform>")
165+
# “explicitly disable pulseaudio in these ports so they won't pick
166+
# it up when it becomes available.”
167+
# https://cvsweb.openbsd.org/checkout/ports/audio/lmms/Makefile?rev=1.5
168+
SET(WANT_PULSEAUDIO OFF)
169+
SET(STATUS_PULSEAUDIO "<not supported on this platform>")
170+
# OpenBSD does not and never will have WINE, which is necessary for
171+
# Windows VST support.
172+
# TODO: Is Linux VST support on OpenBSD possible?
173+
SET(WANT_VST OFF)
174+
SET(STATUS_VST "<not supported on this platform>")
175+
SET(STATUS_VST_32 "<not supported on this platform>")
176+
SET(STATUS_VST_64 "<not supported on this platform>")
177+
ENDIF()
178+
153179
SET(CMAKE_CXX_STANDARD_REQUIRED ON)
154180

155181
CHECK_INCLUDE_FILES(pthread.h LMMS_HAVE_PTHREAD_H)
@@ -165,8 +191,6 @@ CHECK_INCLUDE_FILES(sys/soundcard.h LMMS_HAVE_SYS_SOUNDCARD_H)
165191
CHECK_INCLUDE_FILES(soundcard.h LMMS_HAVE_SOUNDCARD_H)
166192
CHECK_INCLUDE_FILES(fcntl.h LMMS_HAVE_FCNTL_H)
167193
CHECK_INCLUDE_FILES(sys/ioctl.h LMMS_HAVE_SYS_IOCTL_H)
168-
CHECK_INCLUDE_FILES(ctype.h LMMS_HAVE_CTYPE_H)
169-
CHECK_INCLUDE_FILES(string.h LMMS_HAVE_STRING_H)
170194
CHECK_INCLUDE_FILES(process.h LMMS_HAVE_PROCESS_H)
171195
CHECK_INCLUDE_FILES(locale.h LMMS_HAVE_LOCALE_H)
172196

cmake/modules/DetectMachine.cmake

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,3 +192,12 @@ IF(LMMS_BUILD_APPLE)
192192
STRING(REGEX REPLACE "\\.[0-9]*$" "" APPLE_OS_VER "${APPLE_OS_VER}")
193193
SET(CMAKE_MACOSX_RPATH 1)
194194
ENDIF()
195+
196+
IF(LMMS_BUILD_OPENBSD)
197+
SET(Qt5_DIR "${OPENBSD_LOCALBASE}/lib/qt5/cmake/Qt5/")
198+
SET(Qt5Test_DIR "${OPENBSD_LOCALBASE}/lib/qt5/cmake/Qt5Test/")
199+
SET(Qt6_DIR "${OPENBSD_LOCALBASE}/lib/qt6/cmake/Qt6/")
200+
SET(Qt6Test_DIR "${OPENBSD_LOCALBASE}/lib/qt6/cmake/Qt6Test/")
201+
INCLUDE_DIRECTORIES("${OPENBSD_LOCALBASE}/include/" "${OPENBSD_X11BASE}/include/")
202+
LINK_DIRECTORIES("${OPENBSD_LOCALBASE}/lib/" "${OPENBSD_X11BASE}/lib/")
203+
ENDIF()

doc/Doxyfile.in

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1981,8 +1981,6 @@ PREDEFINED = "LMMS_BUILD_LINUX=" \
19811981
"LMMS_HAVE_SOUNDCARD_H=" \
19821982
"LMMS_HAVE_FCNTL_H=" \
19831983
"LMMS_HAVE_SYS_IOCTL_H=" \
1984-
"LMMS_HAVE_CTYPE_H=" \
1985-
"LMMS_HAVE_STRING_H=" \
19861984
"LMMS_HAVE_PROCESS_H=" \
19871985
"LMMS_HAVE_LOCALE_H=" \
19881986

include/AudioBuffer.h

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -336,15 +336,21 @@ class LMMS_EXPORT AudioBuffer
336336
auto hasAnySignal() const -> bool;
337337

338338
/**
339-
* @brief Sanitizes specified channels of any Inf/NaN values if "nanhandler" setting is enabled
339+
* @brief Sanitizes @a channels of any Inf/NaN by replacing them with zeros.
340+
*
341+
* If any invalid values are detected within a channel, the entire channel buffer is silenced, and its
342+
* internal silence flag is set.
340343
*
341344
* @param channels channels to sanitize; 1 = selected, 0 = skip
342345
* @param upperBound any channel indexes at or above this are skipped
346+
*
347+
* @returns true if sanitization occurred
343348
*/
344-
void sanitize(const ChannelFlags& channels, ch_cnt_t upperBound = MaxChannelsPerAudioBuffer);
349+
auto sanitize(const ChannelFlags& channels, ch_cnt_t upperBound = MaxChannelsPerAudioBuffer) -> bool;
345350

346351
//! Sanitizes all channels. @see sanitize
347-
void sanitizeAll();
352+
//! @returns true if sanitization occurred
353+
auto sanitizeAll() -> bool;
348354

349355
/**
350356
* @brief Updates the silence status of the given channels, up to the upperBound index.

include/AudioBusHandle.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@ class AudioBusHandle : public ThreadableJob
8181
void addPlayHandle(PlayHandle* handle);
8282
void removePlayHandle(PlayHandle* handle);
8383

84+
//! @returns true if the processing outputted corrupted audio (infs/nans).
85+
bool isCorrupted() const { return m_corrupted.load(std::memory_order_relaxed); }
86+
8487
private:
8588
volatile bool m_bufferUsage;
8689

@@ -99,6 +102,8 @@ class AudioBusHandle : public ThreadableJob
99102
FloatModel* m_volumeModel;
100103
FloatModel* m_panningModel;
101104
BoolModel* m_mutedModel;
105+
106+
std::atomic<bool> m_corrupted = false;
102107

103108
friend class AudioEngine;
104109
friend class AudioEngineWorkerThread;

include/AudioEngine.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,11 @@ class LMMS_EXPORT AudioEngine : public QObject
301301
static bool isAudioDevNameValid(QString name);
302302
static bool isMidiDevNameValid(QString name);
303303

304+
//! @returns true if sanitization of inf/nan values is enabled
305+
bool sanitizationEnabled() { return m_sanitizationEnabled.load(std::memory_order_relaxed); }
306+
307+
//! Enable/disable sanitization of inf/nan values
308+
void setSanitizationEnabled(bool enabled) { m_sanitizationEnabled.store(enabled, std::memory_order_relaxed); }
304309

305310
signals:
306311
void qualitySettingsChanged();
@@ -406,6 +411,7 @@ class LMMS_EXPORT AudioEngine : public QObject
406411
AudioEngineProfiler m_profiler;
407412

408413
bool m_clearSignal;
414+
std::atomic<bool> m_sanitizationEnabled = false;
409415

410416
std::recursive_mutex m_changeMutex;
411417

include/AutomatableSlider.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,14 @@ class AutomatableSlider : public QSlider, public IntModelView
5656
void mousePressEvent( QMouseEvent * _me ) override;
5757
void mouseReleaseEvent( QMouseEvent * _me ) override;
5858
void wheelEvent( QWheelEvent * _me ) override;
59+
void mouseDoubleClickEvent(QMouseEvent*) override;
5960

6061
void modelChanged() override;
6162

6263

6364
private:
6465
bool m_showStatus;
66+
void enterValue();
6567

6668

6769
private slots:

include/AutomationEditor.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,8 @@ protected slots:
162162
void zoomingXChanged();
163163
void zoomingYChanged();
164164

165+
void updateYDelta();
166+
165167
/// Updates the clip's quantization using the current user selected value.
166168
void setQuantization();
167169

@@ -252,7 +254,7 @@ protected slots:
252254
tick_t m_drawLastTick;
253255

254256
int m_ppb;
255-
int m_y_delta;
257+
float m_y_delta;
256258
bool m_y_auto;
257259

258260
// Time position (key) of automation node whose outValue is being dragged

include/Effect.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ class LMMS_EXPORT Effect : public Plugin
7878
m_okay = _state;
7979
}
8080

81+
//! @returns true if the processing outputted corrupted audio (infs/nans).
82+
bool isCorrupted() const { return m_corrupted.load(std::memory_order_relaxed); }
83+
8184
//! "Awake" means the effect has not been put to sleep by auto-quit
8285
bool isAwake() const
8386
{
@@ -197,6 +200,7 @@ class LMMS_EXPORT Effect : public Plugin
197200
bool m_okay;
198201
bool m_noRun;
199202
bool m_awake;
203+
std::atomic<bool> m_corrupted = false;
200204

201205
//! The number of consecutive periods where output buffers remain below the silence threshold
202206
f_cnt_t m_quietBufferCount = 0;

include/EffectView.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ public slots:
7373
void moveUp();
7474
void moveDown();
7575
void deletePlugin();
76+
void corruptStateUpdate();
7677

7778
signals:
7879
void movedUp(EffectView* view);

0 commit comments

Comments
 (0)