Welcome to mirror list, hosted at ThFree Co, Russian Federation.

ASIOInput.h « mumble « src - github.com/mumble-voip/mumble.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 6c73774f71e351d2b581a27eb37d2e1231e83a7b (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
81
82
83
84
85
// 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 "ui_ASIOInput.h"

#include "AudioInput.h"
#include "ConfigDialog.h"

#include "win.h"

#include <QtCore/QList>
#include <QtCore/QObject>
#include <QtCore/QString>
#include <QtCore/QWaitCondition>

#include <combaseapi.h>

#include <asiodrvr.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