forked from dyatlov/aimp-web-ctl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
AIMP2WebControlHeader.hpp
77 lines (64 loc) · 1.48 KB
/
AIMP2WebControlHeader.hpp
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
#ifndef AIMP2WEBCONTROLHEADER_HPP
#define AIMP2WEBCONTROLHEADER_HPP
#include "AIMP2_SDK.h"
#include "simpleserver.h"
static wchar_t PLG_NAME[] = L"AIMP2: Web Control";
static wchar_t PLG_AUTOR[] = L"Vitaly Dyatlov";
class AIMP2WebControlHeader
:public IAIMPAddonHeader
{
private:
LONG m_cRef;
public:
AIMP2WebControlHeader()
{
m_cRef = 1;
}
HRESULT WINAPI QueryInterface (REFIID riid, LPVOID * ppvObj)
{
if (!ppvObj)
return E_INVALIDARG;
*ppvObj = (LPVOID)this;
AddRef();
return NOERROR;
}
ULONG WINAPI AddRef()
{
m_cRef++;
return (ULONG)m_cRef;
}
ULONG WINAPI Release()
{
--m_cRef;
if (0 == m_cRef)
{
delete this;
}
return m_cRef;
}
BOOL WINAPI GetHasSettingsDialog()
{
return TRUE;
}
PWCHAR WINAPI GetPluginAuthor()
{
return (PWCHAR)PLG_AUTOR;
}
PWCHAR WINAPI GetPluginName()
{
return (PWCHAR)PLG_NAME;
}
void WINAPI Finalize()
{
stop_server();
}
void WINAPI Initialize(IAIMP2Controller *AController)
{
start_server(AController);
}
void WINAPI ShowSettingsDialog(HWND AParentWindow)
{
MessageBoxW(AParentWindow, L"AIMP2 Web Control plugin is written by Vitaly Dyatlov.\nTo control your player over network just type in browser\nIP address of this computer and port number 38475\nExample: http://192.168.1.100:38475/, or simple http://localhost:38475/", L"Information about AIMP2 Web Control", MB_ICONINFORMATION);
}
};
#endif //AIMP2WEBCONTROLHEADER_HPP