Etterna 0.74.4
Loading...
Searching...
No Matches
RageSoundReader_MP3.h
1/* RageSoundReader_MP3 - An interface to read MP3s via MAD. */
2
3#ifndef RAGE_SOUND_READER_MP3_H
4#define RAGE_SOUND_READER_MP3_H
5
6#include "RageSoundReader_FileReader.h"
7#include "RageUtil/File/RageFile.h"
8
9struct madlib_t;
10
11typedef unsigned long id3_length_t;
12
13signed long
14id3_tag_query(const unsigned char* data, id3_length_t length);
15void
16fill_frame_index_cache(madlib_t* mad);
17
19{
20 public:
21 OpenResult Open(RageFileBasic* pFile) override;
22 void Close();
23 int GetLength() const override { return GetLengthConst(false); }
24 int GetLength_Fast() const override { return GetLengthConst(true); }
25 int SetPosition(int iSample) override;
26 int Read(float* pBuf, int iFrames) override;
27 unsigned GetNumChannels() const override { return Channels; }
28 int GetSampleRate() const override { return SampleRate; }
29 int GetNextSourceFrame() const override;
30 bool SetProperty(const std::string& sProperty, float fValue) override;
31
35 const RageSoundReader_MP3&); /* not defined; don't use */
36 RageSoundReader_MP3* Copy() const override;
37
38 private:
39 int SampleRate;
40 int Channels;
41 bool m_bAccurateSync;
42
43 madlib_t* mad;
44
45 bool MADLIB_rewind();
46 int SetPosition_toc(int iSample, bool Xing);
47 int SetPosition_hard(int iSample);
48 int SetPosition_estimate(int iSample);
49
50 int fill_buffer();
51 int do_mad_frame_decode(bool headers_only = false);
52 int resync();
53 void synth_output();
54 int seek_stream_to_byte(int byte);
55 bool handle_first_frame();
56 int GetLengthInternal(bool fast);
57 int GetLengthConst(bool fast) const;
58};
59
60#endif
Definition RageFileBasic.h:10
Definition RageSoundReader_FileReader.h:13
Definition RageSoundReader_MP3.h:19
Definition RageSoundReader_MP3.cpp:172