From 65c7ea9fbf4886fa3d6127c5fa699520f30f386c Mon Sep 17 00:00:00 2001 From: Calvin Morrison Date: Mon, 18 May 2026 00:00:17 -0400 Subject: OSS backend for FreeBSD support Adds a complete OSS audio backend alongside PulseAudio and ALSA: - OssDevice/OssModel: enumerate /dev/mixer*, poll for changes at 500ms - Full UI layer: mixer window, system tray, mini popup, per-channel widgets - Fake mute (saves/restores volume since OSS has no mute bit) - BackendController and PreferencesDlg updated; backend combo now uses m_backendIds list so any combination of compiled-in backends works Co-Authored-By: Claude Sonnet 4.6 --- src/model/ossmodel.h | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 src/model/ossmodel.h (limited to 'src/model/ossmodel.h') diff --git a/src/model/ossmodel.h b/src/model/ossmodel.h new file mode 100644 index 0000000..8c3db8b --- /dev/null +++ b/src/model/ossmodel.h @@ -0,0 +1,50 @@ +#pragma once + +#include +#include +#include +#include + +#include "ossdevice.h" + +class TQTimer; + +struct OssCard { + int index; + TQString path; + TQString name; +}; + +class OssModel : public TQObject +{ + TQ_OBJECT +public: + explicit OssModel( TQObject *parent = 0 ); + ~OssModel(); + + bool open(); + void close(); + + TQValueList cards() const { return m_cards; } + TQPtrList devices() const { return m_devices; } + TQPtrList devicesForCard( int cardIdx ) const; + OssDevice *defaultOutput() const; + OssDevice *preferredOutput() const; + void setPreferredOutput( int cardIdx, const TQString &name ); + +signals: + void deviceAdded( OssDevice *dev ); + void preferredOutputChanged( OssDevice *dev ); + void ready(); + +private slots: + void onPollTimer(); + +private: + void openCard( int cardIdx, const TQString &path ); + + TQValueList m_cards; + TQPtrList m_devices; + TQValueList m_fds; // one open fd per card, owned here + TQTimer *m_timer; +}; -- cgit v1.2.3