From f6f7c36909fa161efe53c40e9b4c34856e751536 Mon Sep 17 00:00:00 2001 From: Calvin Morrison Date: Tue, 12 May 2026 21:32:53 -0400 Subject: Initial tmix skeleton — model layer + basic UI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PulseModel: stable PulseDevice objects keyed by PA index, updated in-place via postEvent reconciliation. No bulk rebuilds. Three signals: deviceAdded, deviceRemoved (device changed handled per-device via volumeChanged/muteChanged/nameChanged). MixerWindow: four-tab layout (Output/Input/Playback/Recording), adds and removes individual DeviceWidgets in response to model signals. Builds and links cleanly against TQt3/TDE + libpulse. Co-Authored-By: Claude Sonnet 4.6 --- src/model/audiodevice.h | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 src/model/audiodevice.h (limited to 'src/model/audiodevice.h') diff --git a/src/model/audiodevice.h b/src/model/audiodevice.h new file mode 100644 index 0000000..e753fc9 --- /dev/null +++ b/src/model/audiodevice.h @@ -0,0 +1,38 @@ +#pragma once + +#include +#include + +class TQWidget; + +class AudioDevice : public TQObject +{ + TQ_OBJECT + +public: + enum Category { + Output, // sinks, hardware output + Input, // sources, hardware input + Playback, // sink inputs (per-app playback streams) + Recording, // source outputs (per-app recording streams) + }; + + AudioDevice( TQObject *parent = 0 ) : TQObject(parent) {} + virtual ~AudioDevice() {} + + virtual TQString name() const = 0; + virtual Category category() const = 0; + + virtual int volume() const = 0; // 0-100 + virtual bool muted() const = 0; + virtual void setVolume( int v ) = 0; + virtual void setMuted( bool m ) = 0; + + // Creates the widget for this device. Caller takes ownership. + virtual TQWidget *createWidget( TQWidget *parent ) = 0; + +signals: + void volumeChanged( int v ); + void muteChanged( bool m ); + void nameChanged( const TQString &name ); +}; -- cgit v1.2.3