blob: 80c47d287b46f069cd164414d6c10c605d818b6c (
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
// Copyright 2005-2019 The Mumble Developers. All rights reserved.
// Use of this source code is governed by a BSD-style license
// that can be found in the LICENSE file at the root of the
// Mumble source tree or at <https://www.mumble.info/LICENSE>.
#ifndef MUMBLE_MUMBLE_ASIOINPUT_H_
#define MUMBLE_MUMBLE_ASIOINPUT_H_
#include <QtCore/QList>
#include <QtCore/QObject>
#include <QtCore/QString>
#include <QtCore/QWaitCondition>
#include <windows.h>
#include <asiodrvr.h>
#include "AudioInput.h"
#include "ConfigDialog.h"
#include "ui_ASIOInput.h"
typedef QPair<QString, QString> ASIODev;
class ASIOConfig : public ConfigWidget, public Ui::ASIOConfig {
private:
Q_OBJECT
Q_DISABLE_COPY(ASIOConfig)
protected:
QList<ASIODev> qlDevs;
bool bOk;
public:
ASIOConfig(Settings &st);
virtual QString title() const Q_DECL_OVERRIDE;
virtual QIcon icon() const Q_DECL_OVERRIDE;
public slots:
void save() const Q_DECL_OVERRIDE;
void load(const Settings &r) Q_DECL_OVERRIDE;
void clearQuery();
void on_qcbDevice_activated(int index);
void on_qpbQuery_clicked();
void on_qpbConfig_clicked();
void on_qpbAddMic_clicked();
void on_qpbRemMic_clicked();
void on_qpbAddSpeaker_clicked();
void on_qpbRemSpeaker_clicked();
};
#define IEEE754_64FLOAT 1
#include "asio.h"
class ASIOInput : public AudioInput {
private:
Q_OBJECT
Q_DISABLE_COPY(ASIOInput)
protected:
IASIO *iasio;
int iNumMic, iNumSpeaker;
long lBufSize;
ASIOBufferInfo *abiInfo;
ASIOChannelInfo *aciInfo;
// ASIO Callbacks
static ASIOInput *aiSelf;
static void sampleRateChanged(ASIOSampleRate sRate);
static long asioMessages(long selector, long value, void* message, double* opt);
static void bufferSwitch(long index, ASIOBool processNow);
static ASIOTime *bufferSwitchTimeInfo(ASIOTime *timeInfo, long index, ASIOBool processNow);
void addBuffer(long sampType, int interleave, void *src, float * RESTRICT dst);
void bufferReady(long index);
bool initializeDriver();
QWaitCondition qwDone;
public:
ASIOInput();
~ASIOInput() Q_DECL_OVERRIDE;
void run() Q_DECL_OVERRIDE;
};
#endif
|