/
AIMPRemote.h
85 lines (72 loc) · 1.79 KB
/
AIMPRemote.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#include <apiRemote.h>
#define AIMPREMOTE_PLAYER_STATE_STOPPED 0
#define AIMPREMOTE_PLAYER_STATE_PAUSED 1
#define AIMPREMOTE_PLAYER_STATE_PLAYING 2
CONST WCHAR AIMPRemoteClassName[] = L"AIMPRemoteApp";
typedef struct AIMPVersion
{
FLOAT Version;
INT Build;
} *PAIMPVersion;
typedef struct AIMPTrackInfo
{
BOOL Active;
DWORD BitRate;
DWORD Channels;
DWORD Duration;
INT64 FileSize;
DWORD FileMark;
DWORD SampleRate;
DWORD TrackNumber;
DWORD AlbumLength;
DWORD ArtistLength;
DWORD DateLength;
DWORD FileNameLength;
DWORD GenreLength;
DWORD TitleLength;
CHAR Album[256];
CHAR Artist[256];
CHAR Date[256];
CHAR FileName[256];
CHAR Genre[256];
CHAR Title[256];
} *PAIMPTrackInfo;
typedef struct AIMPPosition
{
int Duration;
int Position;
} *PAIMPPosition;
typedef struct AIMPEvents
{
void (*State)(int AIMPRemote_State);
void (*TrackPosition)(PAIMPPosition AIMPRemote_Position);
void (*Version)(PAIMPVersion AIMPRemote_Version);
void (*TrackInfo)(PAIMPTrackInfo AIMPRemote_TrackInfo);
} AIMPEvents;
class AIMPRemote
{
public:
AIMPRemote();
~AIMPRemote();
static VOID AIMPExecuteCommand(INT ACommand);
static INT AIMPGetPropertyValue(INT APropertyID);
static BOOL AIMPSetPropertyValue(INT APropertyID, INT AValue);
static VOID AIMPSetEvents(AIMPEvents *Events);
static BOOL AIMPSetRemoteHandle(const HWND *Value);
static AIMPTrackInfo AIMPGetTrackInfo();
protected:
static LRESULT CALLBACK WMAIMPNotify(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
private:
BOOL InfoUpdatePlayerState();
BOOL InfoUpdateTrackPositionInfo();
BOOL InfoUpdateVersionInfo();
BOOL InfoUpdateTrackInfo();
HWND FAIMPRemoteHandle;
HWND MyWnd;
static AIMPRemote *PAIMPRemote;
AIMPTrackInfo ARTrackInfo;
AIMPVersion ARVersion;
AIMPPosition ARPosition;
AIMPEvents AREvents;
int ARState;
};