summaryrefslogtreecommitdiff
path: root/src/model/ossdevice.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/model/ossdevice.h')
-rw-r--r--src/model/ossdevice.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/src/model/ossdevice.h b/src/model/ossdevice.h
new file mode 100644
index 0000000..66a0d1b
--- /dev/null
+++ b/src/model/ossdevice.h
@@ -0,0 +1,51 @@
+#pragma once
+
+#include <tqobject.h>
+#include <tqstring.h>
+
+class OssDevice : public TQObject
+{
+ TQ_OBJECT
+public:
+ enum Category { Output, Input };
+
+ OssDevice( Category cat, int cardIdx, const TQString &cardPath,
+ int fd, int channelIdx, const TQString &name, bool stereo,
+ TQObject *parent = 0 );
+
+ TQString name() const { return m_name; }
+ TQString cardPath() const { return m_cardPath; }
+ int cardIndex() const { return m_cardIdx; }
+ Category category() const { return m_category; }
+ int volume() const { return m_volume; }
+ bool muted() const { return m_muted; }
+ int pan() const { return m_pan; }
+ bool stereo() const { return m_stereo; }
+ bool hasMute() const { return true; }
+
+ void setVolume( int v );
+ void setMuted( bool m );
+ void setPan( int p );
+
+ void syncFromOss();
+
+signals:
+ void volumeChanged( int v );
+ void muteChanged( bool m );
+ void panChanged( int p );
+
+private:
+ void pushVolume();
+
+ int m_fd; // borrowed from OssModel — do not close
+ int m_cardIdx;
+ TQString m_cardPath;
+ int m_channelIdx;
+ TQString m_name;
+ Category m_category;
+ bool m_stereo;
+ int m_volume;
+ int m_savedVol; // pre-mute volume for fake-mute
+ bool m_muted;
+ int m_pan;
+};