~mixxxdevelopers/mixxx/atomic-co

« back to all changes in this revision

Viewing changes to mixxx/src/sounddevice.h

  • Committer: Daniel Schürmann
  • Date: 2013-05-23 21:29:35 UTC
  • mfrom: (3332.1.70 mixxx)
  • Revision ID: daschuer@mixxx.org-20130523212935-e04eohxt8yb86br0
merged from lp:mixxx

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
#include "soundmanager.h"
22
22
 
23
23
//Forward declarations
24
 
///....
25
24
class SoundDevice;
26
25
class SoundManager;
27
26
class AudioOutput;
34
33
    SOUNDDEVICE_ERROR_EXCESSIVE_INPUT_CHANNEL,
35
34
};
36
35
 
37
 
class SoundDevice
38
 
{
39
 
    public:
40
 
        SoundDevice(ConfigObject<ConfigValue> *config, SoundManager* sm);
41
 
        virtual ~SoundDevice();
42
 
        QString getInternalName() const;
43
 
        QString getDisplayName() const;
44
 
        QString getHostAPI() const;
45
 
        void setHostAPI(QString api);
46
 
        void setSampleRate(double sampleRate);
47
 
        void setFramesPerBuffer(unsigned int framesPerBuffer);
48
 
        virtual int open() = 0;
49
 
        virtual int close() = 0;
50
 
        virtual QString getError() const = 0;
51
 
        virtual unsigned int getDefaultSampleRate() const = 0;
52
 
        int getNumOutputChannels() const;     
53
 
        int getNumInputChannels() const;
54
 
        SoundDeviceError addOutput(const AudioOutput &out);
55
 
        SoundDeviceError addInput(const AudioInput &in);
56
 
        void clearOutputs();
57
 
        void clearInputs();
58
 
        bool operator==(const SoundDevice &other) const;
59
 
        bool operator==(const QString &other) const;
60
 
    protected:
61
 
        ConfigObject<ConfigValue> *m_pConfig;
62
 
        SoundManager *m_pSoundManager;      //Pointer to the SoundManager object which we'll request audio from.
63
 
        QString m_strInternalName;          //The name of the soundcard, used internally (may include the device ID)
64
 
        QString m_strDisplayName;           //The name of the soundcard, as displayed to the user 
65
 
        int m_iNumOutputChannels;           //The number of output channels that the soundcard has
66
 
        int m_iNumInputChannels;            //The number of input channels that the soundcard has
67
 
        double m_dSampleRate;               //The current samplerate for the sound device.
68
 
        QString m_hostAPI;                  //The name of the audio API used by this device.
69
 
        unsigned int m_framesPerBuffer;
70
 
        QList<AudioOutput> m_audioOutputs;
71
 
        QList<AudioInput> m_audioInputs;
 
36
class SoundDevice {
 
37
  public:
 
38
    SoundDevice(ConfigObject<ConfigValue> *config, SoundManager* sm);
 
39
    virtual ~SoundDevice();
 
40
 
 
41
    QString getInternalName() const;
 
42
    QString getDisplayName() const;
 
43
    QString getHostAPI() const;
 
44
    void setHostAPI(QString api);
 
45
    void setSampleRate(double sampleRate);
 
46
    void setFramesPerBuffer(unsigned int framesPerBuffer);
 
47
    virtual int open() = 0;
 
48
    virtual int close() = 0;
 
49
    virtual QString getError() const = 0;
 
50
    virtual unsigned int getDefaultSampleRate() const = 0;
 
51
    int getNumOutputChannels() const;
 
52
    int getNumInputChannels() const;
 
53
    SoundDeviceError addOutput(const AudioOutput &out);
 
54
    SoundDeviceError addInput(const AudioInput &in);
 
55
    void clearOutputs();
 
56
    void clearInputs();
 
57
    bool operator==(const SoundDevice &other) const;
 
58
    bool operator==(const QString &other) const;
 
59
 
 
60
  protected:
 
61
    ConfigObject<ConfigValue> *m_pConfig;
 
62
    // Pointer to the SoundManager object which we'll request audio from.
 
63
    SoundManager *m_pSoundManager;
 
64
    // The name of the soundcard, used internally (may include the device ID)
 
65
    QString m_strInternalName;
 
66
    // The name of the soundcard, as displayed to the user
 
67
    QString m_strDisplayName;
 
68
    // The number of output channels that the soundcard has
 
69
    int m_iNumOutputChannels;
 
70
    // The number of input channels that the soundcard has
 
71
    int m_iNumInputChannels;
 
72
    // The current samplerate for the sound device.
 
73
    double m_dSampleRate;
 
74
    // The name of the audio API used by this device.
 
75
    QString m_hostAPI;
 
76
    unsigned int m_framesPerBuffer;
 
77
    QList<AudioOutput> m_audioOutputs;
 
78
    QList<AudioInput> m_audioInputs;
72
79
};
73
80
 
74
81
#endif