summaryrefslogtreecommitdiff
path: root/src/model/audiodevice.h
blob: 854ba358b70592dd71e269c18a36627f65d39247 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#pragma once

#include <tqobject.h>
#include <tqstring.h>

class TQWidget;

class AudioDevice : public TQObject
{
    TQ_OBJECT

public:
    enum Category {
        Output,      // sinks, hardware output
        Input,       // sources, hardware input
        Playback,    // sink inputs (per-app playback streams)
        Recording,   // source outputs (per-app recording streams)
    };

    AudioDevice( TQObject *parent = 0 ) : TQObject(parent) {}
    virtual ~AudioDevice() {}

    virtual TQString     name()     const = 0;
    virtual TQString     iconName() const = 0;
    virtual Category    category() const = 0;

    virtual int  volume()            const = 0;  // 0-100
    virtual bool muted()             const = 0;
    virtual int  pan()               const = 0;  // -50 (left) .. 0 .. +50 (right)

    virtual void setVolume( int v )        = 0;
    virtual void setMuted( bool m )        = 0;
    virtual void setPan( int p )           = 0;

    // Creates the widget for this device. Caller takes ownership.
    virtual TQWidget *createWidget( TQWidget *parent ) = 0;

signals:
    void volumeChanged( int v );
    void muteChanged( bool m );
    void panChanged( int p );
    void levelChanged( float level );
    void nameChanged( const TQString &name );
    void recordingActiveChanged( bool active );
};