-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMP3Mod.h
57 lines (41 loc) · 1.32 KB
/
MP3Mod.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
53
54
55
56
57
//---------------------------------------------------------------------------
#ifndef MP3ModH
#define MP3ModH
#include <System.hpp>
#include <strmif.h>
#include <control.h>
class Mp3
{
public:
Mp3();
~Mp3();
void LoadFromFile( String FileName );
void Cleanup();
void Play();
void Pause();
void Stop();
bool WaitForCompletion( long TimeoutMS, long* pEventCode = nullptr );
void SetVolume( float dB );
float GetVolume(); // dB
__int64 GetDuration() const { // 1/10 millionth of a second
return duration_;
}
__int64 GetCurrentPosition(); // 1/10 millionth of a second
// Current and Stop in 1/10 millionth of a second
void SetPositions( __int64 Current, __int64 Stop, bool AbsolutePos );
private:
using _di_IGraphBuilder = DelphiInterface<IGraphBuilder>;
using _di_IMediaControl = DelphiInterface<IMediaControl>;
using _di_IMediaEventEx = DelphiInterface<IMediaEventEx>;
using _di_IBasicAudio = DelphiInterface<IBasicAudio>;
using _di_IMediaSeeking = DelphiInterface<IMediaSeeking>;
_di_IGraphBuilder gb_;
_di_IMediaControl mc_;
_di_IMediaEventEx mex_;
_di_IBasicAudio ba_;
_di_IMediaSeeking ms_;
__int64 duration_ {};
void Reset();
};
//---------------------------------------------------------------------------
#endif