diff options
| author | Calvin Morrison <calvin@pobox.com> | 2026-05-15 10:10:04 -0400 |
|---|---|---|
| committer | Calvin Morrison <calvin@pobox.com> | 2026-05-15 10:10:04 -0400 |
| commit | e776bc768cf9afca1867200e25d64d315cd72a3e (patch) | |
| tree | 6745527b939c9d37147d7dc98e8664437ee433f6 /src/model/pulsedevice.h | |
| parent | 4e602e78cdfc210ab7781668df2a88afb923258b (diff) | |
Full mixer implementation — tray, popup, prefs, devices tab with port indicators
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 <noreply@anthropic.com>
Diffstat (limited to 'src/model/pulsedevice.h')
| -rw-r--r-- | src/model/pulsedevice.h | 42 |
1 files changed, 36 insertions, 6 deletions
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 <pulse/pulseaudio.h> #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; }; |
