Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ priority must-knows that fit in Copilot's chat context window.

- C++20, Qt6, no `QSettings`, no naked `new`/`delete`, no `goto`,
braces on all control flow.
- Platform guards prefer `Q_OS_WIN` / `Q_OS_MAC` / `Q_OS_LINUX`.
- Platform guards prefer `Q_OS_WIN` / `Q_OS_MACOS` / `Q_OS_LINUX`.
- For new files: classes `PascalCase`, methods `camelCase`, member
vars `m_camelCase`, constants `kPascalCase`.

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ jobs:
# Cross-platform build check — runs on every PR (no path gating).
#
# History: previously gated by a `check-paths` job on a hand-maintained
# allow-list of files known to carry `#ifdef Q_OS_WIN` / `Q_OS_MAC`
# allow-list of files known to carry `#ifdef Q_OS_WIN` / `Q_OS_MACOS`
# branches (CMakeLists, third_party/, workflows, MainWindow,
# AudioEngine). The allow-list was a chronic leaker — every time a
# new platform-guarded path got added to a different file, the gap
Expand Down Expand Up @@ -876,7 +876,7 @@ jobs:
key: sccache-windows-${{ github.run_id }}

# macOS build check — runs on every PR (no path gating), same rationale
# as check-windows above. Catches Q_OS_MAC / CoreAudio / Cocoa-bridge
# as check-windows above. Catches Q_OS_MACOS / CoreAudio / Cocoa-bridge
# breakage that Linux clang misses, which is otherwise only discovered
# at release tag time by macos-dmg.yml. Build-only (no code signing,
# no DMG, no notarization — those stay in macos-dmg.yml on tag push).
Expand Down
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ contributors.
- **Braces on all control flow** — even single-line `if`/`else`/`for`/`while`
- **`auto` sparingly** — use explicit types unless the type is obvious from context (e.g. `auto* ptr = new Foo` is fine, `auto x = foo()` is not)
- **Naming**: classes `PascalCase`, methods/variables `camelCase`, constants `kPascalCase`, member variables `m_camelCase`
- **Platform guards**: prefer `Q_OS_WIN` / `Q_OS_MAC` / `Q_OS_LINUX` for new code. Existing `_WIN32`/`__APPLE__` guards can be migrated opportunistically — don't do a blanket rewrite.
- **Platform guards**: prefer `Q_OS_WIN` / `Q_OS_MACOS` / `Q_OS_LINUX` for new code. Existing `_WIN32`/`__APPLE__` guards can be migrated opportunistically — don't do a blanket rewrite.
- **Don't remove code you didn't add** — if rebasing, ensure upstream changes are preserved. Review the diff before submitting.
- **Atomic parameters for cross-thread DSP** — main thread writes via `std::atomic`, audio thread reads. Never hold a mutex in the audio callback for parameter updates.
- **Error handling**: log with `qCWarning(lcCategory)`, don't throw exceptions
Expand Down
2 changes: 1 addition & 1 deletion GEMINI.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ the must-knows that fit in Gemini's chat context efficiently.

- C++20, Qt6, no `QSettings`, no naked `new`/`delete`, no `goto`,
braces on all control flow.
- Platform guards prefer `Q_OS_WIN` / `Q_OS_MAC` / `Q_OS_LINUX`.
- Platform guards prefer `Q_OS_WIN` / `Q_OS_MACOS` / `Q_OS_LINUX`.
- Naming: classes `PascalCase`, methods `camelCase`, member vars
`m_camelCase`, constants `kPascalCase`.

Expand Down
4 changes: 2 additions & 2 deletions src/aetherd/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

int main(int argc, char* argv[])
{
#ifdef Q_OS_MAC
#ifdef Q_OS_MACOS
// QtKeychain's Apple backend delivers completions on the native main
// dispatch queue. Qt's default QCoreApplication UNIX dispatcher does not
// service that queue. Select CoreFoundation only for credential runs;
Expand All @@ -28,7 +28,7 @@ int main(int argc, char* argv[])
}
#endif
QCoreApplication app(argc, argv);
#ifdef Q_OS_MAC
#ifdef Q_OS_MACOS
if (credentialDispatcher) {
if (hadDispatcherSetting) {
qputenv("QT_EVENT_DISPATCHER_CORE_FOUNDATION", dispatcherSetting);
Expand Down
2 changes: 1 addition & 1 deletion src/core/AppSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ void AppSettings::migrateSettingsPath()
return; // already at the correct location
}

#if defined(Q_OS_WIN) || defined(Q_OS_MAC)
#if defined(Q_OS_WIN) || defined(Q_OS_MACOS)
// On Windows and macOS, Qt 6's ConfigLocation resolves to AppConfigLocation
// (%LOCALAPPDATA%/AetherSDR/AetherSDR on Windows,
// ~/Library/Preferences/AetherSDR/AetherSDR on macOS), so appending
Expand Down
26 changes: 13 additions & 13 deletions src/core/AudioEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
#include "Resampler.h"
#include "TxVoiceProcessor.h"

#ifdef Q_OS_MAC
#ifdef Q_OS_MACOS
#include <CoreAudio/CoreAudio.h>
#include <CoreFoundation/CoreFoundation.h>
#endif
Expand Down Expand Up @@ -404,7 +404,7 @@ void logAudioOpenFailure(const QString& path,
AudioSummaryLogger::logOpenFailure(summary);
}

#ifdef Q_OS_MAC
#ifdef Q_OS_MACOS
AudioObjectPropertyAddress macAudioAddress(AudioObjectPropertySelector selector,
AudioObjectPropertyScope scope = kAudioObjectPropertyScopeGlobal)
{
Expand Down Expand Up @@ -2889,7 +2889,7 @@ QJsonArray AudioEngine::audioEndpointDiagnostics() const
endpoints.append(rx);

const bool txRunning = m_audioSource != nullptr;
#ifdef Q_OS_MAC
#ifdef Q_OS_MACOS
const bool txDeviceOpen = m_micBuffer && m_micBuffer->isOpen();
#else
const bool txDeviceOpen = !m_micDevice.isNull() && m_micDevice->isOpen();
Expand Down Expand Up @@ -4181,7 +4181,7 @@ bool AudioEngine::openRxSinkDevice(int producerRate)
}
}

#ifdef Q_OS_MAC
#ifdef Q_OS_MACOS
if (!m_allowBluetoothTelephonyOutput.load()) {
// Only override devices that look like Bluetooth telephony routes.
// Telephony-only (HFP/SCO) routes cap out at 8-16 kHz and cannot
Expand Down Expand Up @@ -8677,7 +8677,7 @@ TxCaptureHealthTracker::CaptureState AudioEngine::txCaptureState(QAudio::State s

qint64 AudioEngine::txCaptureBufferedBytes() const
{
#ifdef Q_OS_MAC
#ifdef Q_OS_MACOS
return m_micBuffer ? m_micBuffer->size() : 0;
#else
return m_micDevice ? m_micDevice->bytesAvailable() : 0;
Expand Down Expand Up @@ -8931,7 +8931,7 @@ bool AudioEngine::startTxStream(const QHostAddress& radioAddress, quint16 radioP
#else
bool txBluetoothHfp = false;
int txPreferredOverride = 0;
#ifdef Q_OS_MAC
#ifdef Q_OS_MACOS
// CoreAudio-HAL detection the factory can't derive from QAudioDevice: if this
// is a Bluetooth-HFP capture route, put its native low rate first (#2615).
if (const auto nativeRate = macBluetoothNativeInputRate(dev)) {
Expand Down Expand Up @@ -9022,7 +9022,7 @@ bool AudioEngine::startTxStream(const QHostAddress& radioAddress, quint16 radioP
<< (m_txInputRate != TxVoiceProcessor::kDspRate)
<< "RADE resample to 24k:" << m_radeTxNeedsResample;

#ifdef Q_OS_MAC
#ifdef Q_OS_MACOS
// macOS: QAudioSource pull mode broken — use push mode with QBuffer
const quint64 txLifecycleGeneration = ++m_txLifecycleGeneration;
m_micBuffer = new QBuffer(this);
Expand Down Expand Up @@ -9274,7 +9274,7 @@ void AudioEngine::stopTxStream()
logTxCaptureHealthSummary(QStringLiteral("source lifecycle ended"), false);
}
++m_txLifecycleGeneration;
#ifdef Q_OS_MAC
#ifdef Q_OS_MACOS
QTimer* pollTimer = m_txPollTimer;
m_txPollTimer = nullptr;
QBuffer* micBuffer = m_micBuffer;
Expand All @@ -9284,7 +9284,7 @@ void AudioEngine::stopTxStream()
m_audioSource = nullptr;
m_micDevice = nullptr;

#ifdef Q_OS_MAC
#ifdef Q_OS_MACOS
if (pollTimer) {
pollTimer->stop();
delete pollTimer;
Expand All @@ -9299,7 +9299,7 @@ void AudioEngine::stopTxStream()
}
delete audioSource;
}
#ifdef Q_OS_MAC
#ifdef Q_OS_MACOS
if (micBuffer) {
delete micBuffer;
}
Expand Down Expand Up @@ -9466,7 +9466,7 @@ void AudioEngine::onTxAudioReady()
}
// Capture must keep being consumed while TCI owns TX audio, on every
// platform — all three backends accumulate, just in different memory.
#ifdef Q_OS_MAC
#ifdef Q_OS_MACOS
// Push mode: QAudioSource writes into m_micBuffer, which only the
// unsuppressed path below clears. Left alone it grows for the whole TCI
// session (~192 KB/s at 48 kHz stereo Int16) — the same multi-GB
Expand Down Expand Up @@ -9505,7 +9505,7 @@ void AudioEngine::onTxAudioReady()
}
return;
}
#ifdef Q_OS_MAC
#ifdef Q_OS_MACOS
if (!m_micBuffer || !m_audioSource) return;
if (m_audioSource->state() == QAudio::StoppedState) return;
if (!m_micBuffer->isOpen()) return;
Expand Down Expand Up @@ -9976,7 +9976,7 @@ void AudioEngine::setInputDevice(const QAudioDevice& dev, AudioDeviceSelection s
emit inputDeviceChanged();
}

#ifdef Q_OS_MAC
#ifdef Q_OS_MACOS
void AudioEngine::setAllowBluetoothTelephonyOutput(bool on)
{
const bool changed = (m_allowBluetoothTelephonyOutput.exchange(on) != on);
Expand Down
6 changes: 3 additions & 3 deletions src/core/AudioEngine.h
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ class AudioEngine : public QObject {
AudioDeviceSelection selection = AudioDeviceSelection::OperatorChoice);
void setInputDevice(const QAudioDevice& dev,
AudioDeviceSelection selection = AudioDeviceSelection::OperatorChoice);
#ifdef Q_OS_MAC
#ifdef Q_OS_MACOS
void setAllowBluetoothTelephonyOutput(bool on);
#endif
QAudioDevice outputDevice() const { return m_outputDevice; }
Expand Down Expand Up @@ -1125,7 +1125,7 @@ private slots:
QUdpSocket m_txSocket;
QAudioSource* m_audioSource{nullptr};
QPointer<QIODevice> m_micDevice;
#ifdef Q_OS_MAC
#ifdef Q_OS_MACOS
QTimer* m_txPollTimer{nullptr};
QBuffer* m_micBuffer{nullptr};
#endif
Expand Down Expand Up @@ -1173,7 +1173,7 @@ private slots:
// Channel count of the stage-0 open, so the ladder stays stable across
// reopens even though fmt.channelCount() changes underneath it.
int m_txSilentOpenInitialChannels{2};
#ifdef Q_OS_MAC
#ifdef Q_OS_MACOS
std::atomic<bool> m_allowBluetoothTelephonyOutput{false};
#endif
std::atomic<bool> m_daxTxUseRadioRoute{false}; // false = low-latency route (dax=0)
Expand Down
2 changes: 1 addition & 1 deletion src/core/AudioFormatNegotiator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ TargetOs hostTargetOs()
{
#if defined(Q_OS_WIN)
return TargetOs::Windows;
#elif defined(Q_OS_MAC)
#elif defined(Q_OS_MACOS)
return TargetOs::MacOS;
#else
return TargetOs::Linux;
Expand Down
2 changes: 1 addition & 1 deletion src/core/AutomationServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@
#include <QLocalServer>
#include <QScopeGuard>
#include <QLocalSocket>
#include <QApplication>

Check warning on line 38 in src/core/AutomationServer.cpp

View workflow job for this annotation

GitHub Actions / Static checks

EB2-known

src/core/AutomationServer.cpp uses QtWidgets (QApplication) — tracked legacy (baseline 20); the count may only shrink
#include <QScreen>
#include <QWidget>

Check warning on line 40 in src/core/AutomationServer.cpp

View workflow job for this annotation

GitHub Actions / Static checks

EB2-known

src/core/AutomationServer.cpp uses QtWidgets (QWidget) — tracked legacy (baseline 20); the count may only shrink
#include <QMainWindow>

Check warning on line 41 in src/core/AutomationServer.cpp

View workflow job for this annotation

GitHub Actions / Static checks

EB2-known

src/core/AutomationServer.cpp uses QtWidgets (QMainWindow) — tracked legacy (baseline 20); the count may only shrink
#include <QMenu>

Check warning on line 42 in src/core/AutomationServer.cpp

View workflow job for this annotation

GitHub Actions / Static checks

EB2-known

src/core/AutomationServer.cpp uses QtWidgets (QMenu) — tracked legacy (baseline 20); the count may only shrink
#include <QMenuBar>

Check warning on line 43 in src/core/AutomationServer.cpp

View workflow job for this annotation

GitHub Actions / Static checks

EB2-known

src/core/AutomationServer.cpp uses QtWidgets (QMenuBar) — tracked legacy (baseline 20); the count may only shrink
#include <QTabBar>

Check warning on line 44 in src/core/AutomationServer.cpp

View workflow job for this annotation

GitHub Actions / Static checks

EB2-known

src/core/AutomationServer.cpp uses QtWidgets (QTabBar) — tracked legacy (baseline 20); the count may only shrink
#include <QEnterEvent>
#include <QMouseEvent>
#include <QWheelEvent>
Expand Down Expand Up @@ -78,12 +78,12 @@
#include <utility>

// Best-effort value extraction for common control types.
#include <QAbstractButton>

Check warning on line 81 in src/core/AutomationServer.cpp

View workflow job for this annotation

GitHub Actions / Static checks

EB2-known

src/core/AutomationServer.cpp uses QtWidgets (QAbstractButton) — tracked legacy (baseline 20); the count may only shrink
#include <QAbstractSlider>

Check warning on line 82 in src/core/AutomationServer.cpp

View workflow job for this annotation

GitHub Actions / Static checks

EB2-known

src/core/AutomationServer.cpp uses QtWidgets (QAbstractSlider) — tracked legacy (baseline 20); the count may only shrink
#include <QAbstractItemView>

Check warning on line 83 in src/core/AutomationServer.cpp

View workflow job for this annotation

GitHub Actions / Static checks

EB2-known

src/core/AutomationServer.cpp uses QtWidgets (QAbstractItemView) — tracked legacy (baseline 20); the count may only shrink
#include <QPersistentModelIndex>
#include <QItemSelectionModel>
#include <QComboBox>

Check warning on line 86 in src/core/AutomationServer.cpp

View workflow job for this annotation

GitHub Actions / Static checks

EB2-known

src/core/AutomationServer.cpp uses QtWidgets (QComboBox) — tracked legacy (baseline 20); the count may only shrink
#include <QLineEdit>
#include "AutomationSensitiveLineEdit.h"
#include <QLabel>
Expand Down Expand Up @@ -2013,7 +2013,7 @@
false},
#endif
{"MNR", a->mnrEnabled(),
#ifdef Q_OS_MAC
#ifdef Q_OS_MACOS
true},
#else
false},
Expand Down
2 changes: 1 addition & 1 deletion src/core/CatPort.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include <fcntl.h>
#include <termios.h>
#include <sys/stat.h>
#ifdef Q_OS_MAC
#ifdef Q_OS_MACOS
#include <util.h>
#else
#include <pty.h>
Expand Down
6 changes: 3 additions & 3 deletions src/core/DaxTxPolicy.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ inline DaxTxPlatform currentDaxTxPlatform()
{
#if defined(Q_OS_WIN)
return DaxTxPlatform::Windows;
#elif defined(Q_OS_MAC)
#elif defined(Q_OS_MACOS)
return DaxTxPlatform::MacOS;
#elif defined(Q_OS_LINUX)
return DaxTxPlatform::Linux;
Expand All @@ -93,7 +93,7 @@ inline DaxTxPlatform currentDaxTxPlatform()

inline bool currentBuildHasHostedDax()
{
#if defined(Q_OS_MAC) || defined(HAVE_PIPEWIRE)
#if defined(Q_OS_MACOS) || defined(HAVE_PIPEWIRE)
return true;
#else
return false;
Expand All @@ -104,7 +104,7 @@ inline DaxTxMode currentDaxTxMode()
{
#if defined(Q_OS_WIN)
return DaxTxMode::ExternalDax2;
#elif defined(Q_OS_MAC) || defined(HAVE_PIPEWIRE)
#elif defined(Q_OS_MACOS) || defined(HAVE_PIPEWIRE)
return DaxTxMode::HostedDax;
#else
return DaxTxMode::None;
Expand Down
2 changes: 1 addition & 1 deletion src/core/FreeDvClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ void FreeDvClient::handleEngineIO(const QString& raw)
auth["rx_only"] = false;
#if defined(Q_OS_WIN)
auth["os"] = QString("windows");
#elif defined(Q_OS_MAC)
#elif defined(Q_OS_MACOS)
auth["os"] = QString("macos");
#else
auth["os"] = QString("linux");
Expand Down
2 changes: 1 addition & 1 deletion src/core/MacMicPermission.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Request microphone permission on macOS at app startup.
// Shows the system permission dialog on first launch.
// No-op on non-macOS platforms.
#ifdef Q_OS_MAC
#ifdef Q_OS_MACOS
void requestMicrophonePermission();
#else
inline void requestMicrophonePermission() {}
Expand Down
4 changes: 2 additions & 2 deletions src/core/MemoryTelemetry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#endif
#include <windows.h>
#include <psapi.h>
#elif defined(Q_OS_MAC)
#elif defined(Q_OS_MACOS)
#include <mach/mach.h>
#include <mach/task.h>
#include <mach/task_info.h>
Expand Down Expand Up @@ -89,7 +89,7 @@ ProcessMemorySnapshot ProcessMemorySnapshot::capture()
if (GetProcessHandleCount(GetCurrentProcess(), &handles)) {
snapshot.handleCount = static_cast<qint64>(handles);
}
#elif defined(Q_OS_MAC)
#elif defined(Q_OS_MACOS)
task_vm_info_data_t info{};
mach_msg_type_number_t count = TASK_VM_INFO_COUNT;
if (task_info(mach_task_self(), TASK_VM_INFO,
Expand Down
6 changes: 3 additions & 3 deletions src/core/SleepInhibitor.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "SleepInhibitor.h"
#include <QDebug>

#ifdef Q_OS_MAC
#ifdef Q_OS_MACOS
#include <IOKit/pwr_mgt/IOPMLib.h>
#endif

Expand Down Expand Up @@ -67,7 +67,7 @@ void SleepInhibitor::acquire(const QString& reason)
if (m_held)
return;

#ifdef Q_OS_MAC
#ifdef Q_OS_MACOS
CFStringRef cfReason = reason.toCFString();
IOReturn ret = IOPMAssertionCreateWithName(
kIOPMAssertionTypeNoIdleSleep,
Expand Down Expand Up @@ -155,7 +155,7 @@ void SleepInhibitor::release()
if (!m_held)
return;

#ifdef Q_OS_MAC
#ifdef Q_OS_MACOS
IOPMAssertionRelease(m_assertionId);
m_assertionId = 0;
qDebug() << "SleepInhibitor: released (macOS)";
Expand Down
2 changes: 1 addition & 1 deletion src/core/SleepInhibitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class SleepInhibitor {
private:
bool m_held{false};

#ifdef Q_OS_MAC
#ifdef Q_OS_MACOS
uint32_t m_assertionId{0};
#endif
#if defined(Q_OS_LINUX) && defined(HAVE_DBUS)
Expand Down
6 changes: 3 additions & 3 deletions src/core/SystemInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
extern "C" __declspec(dllimport) HRESULT WINAPI
GetThreadDescription(HANDLE hThread, PWSTR* ppszThreadDescription);
#endif
#elif defined(Q_OS_MAC)
#elif defined(Q_OS_MACOS)
#include <mach/mach.h>
#include <mach/thread_act.h>
#include <mach/thread_info.h>
Expand All @@ -41,7 +41,7 @@ namespace AetherSDR {

namespace {

#if defined(Q_OS_MAC)
#if defined(Q_OS_MACOS)
// thread_extended_info's pth_run_state, in the shared vocabulary. The constants
// are TH_STATE_* from <mach/thread_info.h>; anything outside that set is Unknown
// rather than mapped to whichever neighbour looks closest.
Expand Down Expand Up @@ -130,7 +130,7 @@ QVector<ThreadTimes> SystemInfo::enumerateThreads()
{
QVector<ThreadTimes> result;

#if defined(Q_OS_MAC)
#if defined(Q_OS_MACOS)
MachThreadArray threads;
if (!threads.acquire()) {
return result;
Expand Down
2 changes: 1 addition & 1 deletion src/core/UlanziDialBackend.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#elif defined(Q_OS_WIN) && defined(HAVE_HIDAPI)
#include "core/UlanziDialWindowsManager.h"
namespace AetherSDR { using UlanziDialBackend = UlanziDialWindowsManager; }
#elif defined(Q_OS_MAC)
#elif defined(Q_OS_MACOS)
#include "core/UlanziDialMacOSManager.h"
namespace AetherSDR { using UlanziDialBackend = UlanziDialMacOSManager; }
#else
Expand Down
4 changes: 2 additions & 2 deletions src/core/UlanziDialMacOSManager.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <QtGlobal>
#ifdef Q_OS_MAC
#ifdef Q_OS_MACOS

#include "UlanziDialMacOSManager.h"
#include "core/LogManager.h"
Expand Down Expand Up @@ -769,4 +769,4 @@ void UlanziDialMacOSManager::emitKeyTransition(int linuxKey, int value)

} // namespace AetherSDR

#endif // Q_OS_MAC
#endif // Q_OS_MACOS
Loading
Loading