forked from DocMarty84/sacd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
converter_core.h
52 lines (38 loc) · 1.08 KB
/
converter_core.h
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
//
// Created by Zhao Wang on 2018-12-05.
//
#ifndef __CONVERTER_CORE_H__
#define __CONVERTER_CORE_H__
#include "libdsd2pcm/dsd_pcm_converter.h"
extern int g_nCPUs;
class ConverterCore
{
public:
int m_nTracks;
float m_fProgress;
int m_nPcmOutChannels;
sacd_reader_t *m_pSacdReader;
bool m_bTrackCompleted;
ConverterCore();
~ConverterCore();
int open(const string &p_path);
string init(int nTrack, int g_nSampleRate, area_id_e nArea);
void fixPcmStream(bool bIsEnd, float *pPcmData, int nPcmSamples);
bool decode(FILE *pFile);
private:
sacd_media_t *m_pSacdMedia;
dst_decoder_t *m_pDstDecoder;
vector<uint8_t> m_arrDstBuf;
vector<uint8_t> m_arrDsdBuf;
vector<float> m_arrPcmBuf;
int m_nDsdBufSize;
int m_nDstBufSize;
DSDPCMConverter *m_pDsdPcmConverter;
int m_nDsdSamplerate;
int m_nFramerate;
int m_nPcmOutSamples;
int m_nPcmOutDelta;
void dsd2pcm(uint8_t *dsd_data, int dsd_samples, float *pcm_data);
void writeData(FILE *pFile, int nOffset, int nSamples);
};
#endif // __CONVERTER_CORE_H__