From e776bc768cf9afca1867200e25d64d315cd72a3e Mon Sep 17 00:00:00 2001 From: Calvin Morrison Date: Fri, 15 May 2026 10:10:04 -0400 Subject: Full mixer implementation — tray, popup, prefs, devices tab with port indicators MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds the complete tmix feature set built since the initial skeleton: balance knob, level meters, KLed mute button, system tray with scroll-wheel volume and recording indicator, tray popup, preferences dialog, right-click context menus, single-instance enforcement, scroll area, window geometry persistence, and Devices tab with PA card profile switcher and live port availability indicators (2-column layout, in-place updates on plug/unplug). Co-Authored-By: Claude Sonnet 4.6 --- src/model/pulsedevice.h | 42 ++++++++++++++++++++++++++++++++++++------ 1 file changed, 36 insertions(+), 6 deletions(-) (limited to 'src/model/pulsedevice.h') diff --git a/src/model/pulsedevice.h b/src/model/pulsedevice.h index fbdf985..e974508 100644 --- a/src/model/pulsedevice.h +++ b/src/model/pulsedevice.h @@ -3,38 +3,68 @@ #include #include "audiodevice.h" +class PulseModel; + class PulseDevice : public AudioDevice { TQ_OBJECT public: PulseDevice( AudioDevice::Category cat, uint32_t paIndex, TQObject *parent = 0 ); - ~PulseDevice() {} + ~PulseDevice(); TQString name() const { return m_name; } + TQString iconName() const { return m_iconName; } 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; } + int pan() const { return m_pan; } + uint32_t paIndex() const { return m_paIndex; } + uint32_t sinkIndex() const { return m_sinkIndex; } + TQString monitorName() const { return m_monitorName; } + TQString paName() const { return m_paName; } + + void setPaName( const TQString &n ) { m_paName = n; } + void setSinkIndex( uint32_t idx ) { m_sinkIndex = idx; } + void setModel( PulseModel *m ) { m_model = m; } + void adjustRecordingCount( int delta ); void setVolume( int v ); void setMuted( bool m ); + void setPan( int p ); - // Called by PulseModel when PA reports an update — updates in place and emits signals. - void update( const TQString &name, int volume, bool muted ); + void update( const TQString &name, int volume, bool muted, + uint8_t channels, int pan, + const TQString &monitorName, const TQString &iconName ); 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 ); + void detach(); // called by PulseModel before tearing down the mainloop + +protected: + void customEvent( TQCustomEvent *e ); private: + void startMonitoring(); + static void monitorReadCb( pa_stream *s, size_t nbytes, void *userdata ); + AudioDevice::Category m_category; uint32_t m_paIndex; + uint32_t m_sinkIndex; TQString m_name; - int m_volume; // 0-100 + TQString m_iconName; + int m_volume; bool m_muted; + int m_pan; + uint8_t m_channels; pa_context *m_context; pa_threaded_mainloop *m_mainloop; + + TQString m_monitorName; + pa_stream *m_monitorStream; + TQString m_paName; + PulseModel *m_model; + int m_recordingCount; }; -- cgit v1.2.3