summaryrefslogtreecommitdiff
path: root/src/model/pulsedevice.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/model/pulsedevice.h')
-rw-r--r--src/model/pulsedevice.h42
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;
};