Skip to content

Commit 85655e6

Browse files
committed
Housekeeping MIDI clock, tests, and macro updates.
- Format the code - fix a datapath testing problem with archlinux in docker - Refactor code for consistency and clarity in various files
1 parent 94c49d8 commit 85655e6

File tree

8 files changed

+21
-20
lines changed

8 files changed

+21
-20
lines changed

include/element/element.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ extern "C" {
1919
#ifdef _WIN32
2020
// windows exports
2121
#if defined(EL_SHARED_BUILD)
22-
#define EL_API __declspec(dllexport)
22+
#define EL_API __declspec (dllexport)
2323
#pragma warning(disable : 4251)
2424
#elif defined(EL_SHARED)
25-
#define EL_API __declspec(dllimport)
25+
#define EL_API __declspec (dllimport)
2626
#pragma warning(disable : 4251)
2727
#endif
28-
#define EL_PLUGIN_EXPORT EL_EXTERN __declspec(dllexport)
28+
#define EL_PLUGIN_EXPORT EL_EXTERN __declspec (dllexport)
2929
#else
3030
#if defined(EL_SHARED) || defined(EL_SHARED_BUILD)
3131
#define EL_API __attribute__ ((visibility ("default")))

include/element/porttype.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ class PortType {
101101
inline bool operator!= (const ID& id) const { return (type != id); }
102102
inline bool operator== (const PortType& t) const { return (type == t.type); }
103103
inline bool operator!= (const PortType& t) const { return (type != t.type); }
104-
inline bool operator<(const PortType& t) const { return (type < t.type); }
104+
inline bool operator< (const PortType& t) const { return (type < t.type); }
105105

106106
inline operator int() const { return (int) this->type; }
107107

include/element/version.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ class Version {
9595
inline bool operator== (const Version& o) const noexcept { return _hex == o._hex; }
9696
inline bool operator!= (const Version& o) const noexcept { return _hex != o._hex; }
9797
inline bool operator> (const Version& o) const noexcept { return _hex > o._hex; }
98-
inline bool operator<(const Version& o) const noexcept { return _hex < o._hex; }
98+
inline bool operator< (const Version& o) const noexcept { return _hex < o._hex; }
9999
inline bool operator>= (const Version& o) const noexcept { return _hex >= o._hex; }
100100
inline bool operator<= (const Version& o) const noexcept { return _hex <= o._hex; }
101101

src/delaylockedloop.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,9 @@ class DelayLockedLoop
106106

107107
private:
108108
// Timing state
109-
double e2 = 0; ///< Estimated period
110-
double t0 = 0; ///< Previous filtered timestamp
111-
double t1 = 0; ///< Current filtered timestamp
109+
double e2 = 0; ///< Estimated period
110+
double t0 = 0; ///< Previous filtered timestamp
111+
double t1 = 0; ///< Current filtered timestamp
112112

113113
// Parameters
114114
double expectedPeriod = 1.0 / 24.0;
@@ -121,9 +121,9 @@ class DelayLockedLoop
121121
// Adaptive bandwidth settings
122122
// Higher initial bandwidth = faster convergence but more jitter
123123
// Lower locked bandwidth = more stable but slower to track changes
124-
static constexpr double initialBandwidth = 0.5; // Fast convergence
125-
double lockedBandwidth = 0.1; // Stable tracking
126-
static constexpr int lockThreshold = 24; // Lock after ~1 beat
124+
static constexpr double initialBandwidth = 0.5; // Fast convergence
125+
double lockedBandwidth = 0.1; // Stable tracking
126+
static constexpr int lockThreshold = 24; // Lock after ~1 beat
127127

128128
int updateCount = 0;
129129
bool locked = false;

src/filesystemwatcher.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,7 @@ class FileSystemWatcher::Impl
137137
CFArrayRef paths { nullptr };
138138
dispatch_queue_t queue { nullptr };
139139
FSEventStreamRef stream { nullptr };
140-
struct FSEventStreamContext context
141-
{
142-
};
140+
struct FSEventStreamContext context {};
143141
};
144142
#endif
145143

src/scripting/bindings.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ namespace element {
6565
namespace Lua {
6666

6767
//==============================================================================
68-
#if defined(EL_APPIMAGE)
68+
#if defined(ELEMENT_APPIMAGE)
6969
static File getAppImageLuaPath()
7070
{
7171
return File::getSpecialLocation (File::currentExecutableFile)
@@ -112,7 +112,7 @@ static String getApplicationLuaDir()
112112
static File getSystemLuaDir()
113113
{
114114
File dir;
115-
#if defined(EL_APPIMAGE)
115+
#if defined(ELEMENT_APPIMAGE)
116116
dir = getAppImageLuaPath().getFullPathName();
117117

118118
#elif defined(EL_LUADIR)

src/scripting/scriptmanager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ File ScriptManager::getSystemScriptsDir()
127127
{
128128
File dir;
129129

130-
#if defined(EL_APPIMAGE)
130+
#if defined(ELEMENT_APPIMAGE)
131131
dir = File::getSpecialLocation (File::currentExecutableFile)
132132
.getParentDirectory() // bin
133133
.getParentDirectory() // usr

test/datapathtests.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ BOOST_AUTO_TEST_SUITE (DataPathTests)
1414

1515
BOOST_AUTO_TEST_CASE (PathsMatch)
1616
{
17-
#if ! EL_APPIMAGE
17+
#if ! ELEMENT_APPIMAGE
1818
Settings s;
1919
auto params = s.getStorageParameters();
2020
params.folderName = params.folderName.replace ("\\", "/");
@@ -23,8 +23,11 @@ BOOST_AUTO_TEST_CASE (PathsMatch)
2323
BOOST_REQUIRE_MESSAGE (params.folderName.endsWith (EL_APP_DATA_SUBDIR),
2424
params.folderName.toStdString());
2525
BOOST_REQUIRE_MESSAGE (fullPath.endsWith (EL_APP_DATA_SUBDIR), fullPath.toStdString());
26-
BOOST_REQUIRE_EQUAL (DataPath::defaultSettingsFile().getFullPathName().toStdString(),
27-
s.getUserSettings()->getFile().getFullPathName().toStdString());
26+
// Some CI systems, like the archlinux docker container running on github, might have double
27+
// slashes in the settings file path... e.g. when the $HOME is blank.
28+
BOOST_REQUIRE_EQUAL (
29+
DataPath::defaultSettingsFile().getFullPathName().replace("//", "/").toStdString(),
30+
s.getUserSettings()->getFile().getFullPathName().replace("//", "/").toStdString());
2831
#else
2932
BOOST_REQUIRE (true);
3033
#endif

0 commit comments

Comments
 (0)