#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; };