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/pulsedevice.h | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 src/model/pulsedevice.h (limited to 'src/model/pulsedevice.h') diff --git a/src/model/pulsedevice.h b/src/model/pulsedevice.h new file mode 100644 index 0000000..fbdf985 --- /dev/null +++ b/src/model/pulsedevice.h @@ -0,0 +1,40 @@ +#pragma once + +#include +#include "audiodevice.h" + +class PulseDevice : public AudioDevice +{ + TQ_OBJECT + +public: + PulseDevice( AudioDevice::Category cat, uint32_t paIndex, TQObject *parent = 0 ); + ~PulseDevice() {} + + TQString name() const { return m_name; } + Category category() const { return m_category; } + int volume() const { return m_volume; } + bool muted() const { return m_muted; } + uint32_t paIndex() const { return m_paIndex; } + + void setVolume( int v ); + void setMuted( bool m ); + + // Called by PulseModel when PA reports an update — updates in place and emits signals. + void update( const TQString &name, int volume, bool muted ); + + TQWidget *createWidget( TQWidget *parent ); + + // PA context needed to write volume back — set once by PulseModel after construction. + void setPAContext( pa_context *ctx, pa_threaded_mainloop *mainloop ); + +private: + AudioDevice::Category m_category; + uint32_t m_paIndex; + TQString m_name; + int m_volume; // 0-100 + bool m_muted; + + pa_context *m_context; + pa_threaded_mainloop *m_mainloop; +}; -- cgit v1.2.3