hydrogen 1.2.6
FakeDriver.h
Go to the documentation of this file.
1/*
2 * Hydrogen
3 * Copyright(c) 2002-2008 by Alex >Comix< Cominu [comix@users.sourceforge.net]
4 * Copyright(c) 2008-2025 The hydrogen development team [hydrogen-devel@lists.sourceforge.net]
5 *
6 * http://www.hydrogen-music.org
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY, without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see https://www.gnu.org/licenses
20 *
21 */
22
23#ifndef FAKE_DRIVER_H
24#define FAKE_DRIVER_H
25
26#include <core/IO/AudioOutput.h>
27#include <inttypes.h>
28
29namespace H2Core
30{
36class FakeDriver : Object<FakeDriver>, public AudioOutput
37{
39public:
42
43 virtual int init( unsigned nBufferSize ) override;
44 virtual int connect() override;
45 virtual void disconnect() override;
46 virtual unsigned getBufferSize() override {
47 return m_nBufferSize;
48 }
49 virtual unsigned getSampleRate() override;
50
51 virtual float* getOut_L() override;
52 virtual float* getOut_R() override;
53
54 void processCallback();
55
56private:
58 unsigned m_nBufferSize;
59 unsigned m_nSampleRate;
60 float* m_pOut_L;
61 float* m_pOut_R;
62
63};
64
65
66};
67
68#endif
#define H2_OBJECT(name)
Definition Object.h:227
virtual void disconnect() override
FakeDriver(audioProcessCallback processCallback)
virtual float * getOut_L() override
virtual int init(unsigned nBufferSize) override
unsigned m_nSampleRate
Definition FakeDriver.h:59
virtual float * getOut_R() override
virtual int connect() override
virtual unsigned getBufferSize() override
Definition FakeDriver.h:46
audioProcessCallback m_processCallback
Definition FakeDriver.h:57
virtual unsigned getSampleRate() override
unsigned m_nBufferSize
Definition FakeDriver.h:58
int(* audioProcessCallback)(uint32_t, void *)
Definition AudioOutput.h:32