blob: f3fb0f48f083fd0a169839292b70e914334dc69f (
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
|
#pragma once
#include "encoder/encoderwavesettings.h"
#ifdef Q_OS_WIN
// Enable unicode in libsndfile on Windows
// (sf_open uses UTF-8 otherwise)
#include <windows.h>
#define ENABLE_SNDFILE_WINDOWS_PROTOTYPES 1
#endif
#include <sndfile.h>
#include "encoder/encoder.h"
#include "track/track_decl.h"
#include "util/types.h"
class EncoderCallback;
// WAVE/AIFF "encoder"
class EncoderWave : public Encoder {
public:
EncoderWave(EncoderCallback* pCallback = nullptr);
~EncoderWave() override;
int initEncoder(int samplerate, QString* pUserErrorMessage) override;
void encodeBuffer(const CSAMPLE *samples, const int size) override;
void updateMetaData(const QString& artist, const QString& title, const QString& album) override;
void flush() override;
void setEncoderSettings(const EncoderSettings& settings) override;
protected:
virtual void initStream();
TrackPointer m_pMetaData;
EncoderCallback* m_pCallback;
QString m_metaDataTitle;
QString m_metaDataArtist;
QString m_metaDataAlbum;
SNDFILE* m_pSndfile;
SF_INFO m_sfInfo;
SF_VIRTUAL_IO m_virtualIo;
};
|