hydrogen 1.2.3
DiskWriterDriver.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-2024 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 DISK_WRITER_DRIVER_H
24#define DISK_WRITER_DRIVER_H
25
26#include <sndfile.h>
27
28#include <inttypes.h>
29
30#include <core/IO/AudioOutput.h>
31#include <core/Object.h>
32
33namespace H2Core
34{
35
36 void* diskWriterDriver_thread( void *param );
40
41class DiskWriterDriver : public Object<DiskWriterDriver>, public AudioOutput
42{
44 public:
45
46 unsigned m_nSampleRate;
47 QString m_sFilename;
48 unsigned m_nBufferSize;
51 float* m_pOut_L;
52 float* m_pOut_R;
53
54 DiskWriterDriver( audioProcessCallback processCallback );
56
57 virtual int init( unsigned nBufferSize ) override;
58
59 virtual int connect() override;
60 virtual void disconnect() override;
61
62 void write();
63
64 virtual unsigned getBufferSize() override {
65 return m_nBufferSize;
66 }
67
68 virtual unsigned getSampleRate() override;
69 void setSampleRate( unsigned nNewRate ) {
70 m_nSampleRate = nNewRate;
71 }
72 void setSampleDepth( int nNewDepth ) {
73 m_nSampleDepth = nNewDepth;
74 }
75
76 virtual float* getOut_L() override {
77 return m_pOut_L;
78 }
79 virtual float* getOut_R() override {
80 return m_pOut_R;
81 }
82
83 void setFileName( const QString& sFilename ){
84 m_sFilename = sFilename;
85 }
86
87 private:
88
89
90};
91
92};
93
94#endif
#define H2_OBJECT(name)
Definition Object.h:224
Base abstract class for audio output classes.
Definition AudioOutput.h:39
Driver for export audio to disk.
virtual void disconnect() override
disconnect
void setSampleRate(unsigned nNewRate)
virtual float * getOut_L() override
virtual float * getOut_R() override
virtual int init(unsigned nBufferSize) override
DiskWriterDriver(audioProcessCallback processCallback)
void setSampleDepth(int nNewDepth)
void setFileName(const QString &sFilename)
virtual int connect() override
virtual unsigned getBufferSize() override
audioProcessCallback m_processCallback
virtual unsigned getSampleRate() override
int(* audioProcessCallback)(uint32_t, void *)
Definition AudioOutput.h:32
void * diskWriterDriver_thread(void *param)