diff options
| author | Calvin Morrison <calvin@pobox.com> | 2026-05-18 00:00:17 -0400 |
|---|---|---|
| committer | Calvin Morrison <calvin@pobox.com> | 2026-05-18 00:00:17 -0400 |
| commit | 65c7ea9fbf4886fa3d6127c5fa699520f30f386c (patch) | |
| tree | bca364e1c1f0244d477349345ec7dd531b8032f8 /src/model/ossdevice.h | |
| parent | 3909a06fe6786027c83e3adaef89c343cde4fbe3 (diff) | |
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 <noreply@anthropic.com>
Diffstat (limited to 'src/model/ossdevice.h')
| -rw-r--r-- | src/model/ossdevice.h | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/src/model/ossdevice.h b/src/model/ossdevice.h new file mode 100644 index 0000000..66a0d1b --- /dev/null +++ b/src/model/ossdevice.h @@ -0,0 +1,51 @@ +#pragma once + +#include <tqobject.h> +#include <tqstring.h> + +class OssDevice : public TQObject +{ + TQ_OBJECT +public: + enum Category { Output, Input }; + + OssDevice( Category cat, int cardIdx, const TQString &cardPath, + int fd, int channelIdx, const TQString &name, bool stereo, + TQObject *parent = 0 ); + + TQString name() const { return m_name; } + TQString cardPath() const { return m_cardPath; } + int cardIndex() const { return m_cardIdx; } + Category category() const { return m_category; } + int volume() const { return m_volume; } + bool muted() const { return m_muted; } + int pan() const { return m_pan; } + bool stereo() const { return m_stereo; } + bool hasMute() const { return true; } + + void setVolume( int v ); + void setMuted( bool m ); + void setPan( int p ); + + void syncFromOss(); + +signals: + void volumeChanged( int v ); + void muteChanged( bool m ); + void panChanged( int p ); + +private: + void pushVolume(); + + int m_fd; // borrowed from OssModel — do not close + int m_cardIdx; + TQString m_cardPath; + int m_channelIdx; + TQString m_name; + Category m_category; + bool m_stereo; + int m_volume; + int m_savedVol; // pre-mute volume for fake-mute + bool m_muted; + int m_pan; +}; |
