mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
NowPlayingPlugin:
- Minor improvements to CAD interface - Fixed: TITLE was empty when listening to radio stations with Winamp - Fixed: Metadata may not be updated until full refresh after closing one of multiple NowPlaying based skins
This commit is contained in:
parent
339e798ba3
commit
8ae8a68547
@ -316,6 +316,7 @@ UINT Update(UINT id)
|
||||
ParentMeasure* parent = child->parent;
|
||||
CPlayer* player = parent->player;
|
||||
|
||||
// Only allow parent measure to update
|
||||
if (parent->id == id)
|
||||
{
|
||||
player->UpdateMeasure();
|
||||
@ -451,14 +452,7 @@ void ExecuteBang(LPCTSTR bang, UINT id)
|
||||
ParentMeasure* parent = child->parent;
|
||||
CPlayer* player = parent->player;
|
||||
|
||||
if (!player->IsInitialized())
|
||||
{
|
||||
if (_wcsicmp(bang, L"OpenPlayer") == 0 || _wcsicmp(bang, L"TogglePlayer") == 0)
|
||||
{
|
||||
player->OpenPlayer(parent->playerPath);
|
||||
}
|
||||
}
|
||||
else if (_wcsicmp(bang, L"Pause") == 0)
|
||||
if (_wcsicmp(bang, L"Pause") == 0)
|
||||
{
|
||||
player->Pause();
|
||||
}
|
||||
@ -482,7 +476,13 @@ void ExecuteBang(LPCTSTR bang, UINT id)
|
||||
{
|
||||
player->Previous();
|
||||
}
|
||||
else if (_wcsicmp(bang, L"ClosePlayer") == 0 || _wcsicmp(bang, L"TogglePlayer") == 0)
|
||||
else if (_wcsicmp(bang, L"OpenPlayer") == 0 ||
|
||||
(!player->IsInitialized() && _wcsicmp(bang, L"TogglePlayer") == 0))
|
||||
{
|
||||
player->OpenPlayer(parent->playerPath);
|
||||
}
|
||||
else if (_wcsicmp(bang, L"ClosePlayer") == 0 ||
|
||||
(player->IsInitialized() && _wcsicmp(bang, L"TogglePlayer") == 0))
|
||||
{
|
||||
player->ClosePlayer();
|
||||
}
|
||||
|
@ -39,10 +39,8 @@ CPlayer::CPlayer() :
|
||||
m_Position(),
|
||||
m_Rating(),
|
||||
m_Volume(),
|
||||
m_CriticalSection(),
|
||||
m_InternetThread()
|
||||
{
|
||||
InitializeCriticalSection(&m_CriticalSection);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -53,7 +51,10 @@ CPlayer::CPlayer() :
|
||||
*/
|
||||
CPlayer::~CPlayer()
|
||||
{
|
||||
DeleteCriticalSection(&m_CriticalSection);
|
||||
if (m_InternetThread)
|
||||
{
|
||||
TerminateThread(m_InternetThread, 0);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@ -79,6 +80,8 @@ void CPlayer::RemoveInstance()
|
||||
{
|
||||
delete this;
|
||||
}
|
||||
|
||||
m_UpdateCount = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -181,7 +184,7 @@ void CPlayer::FindCover()
|
||||
*/
|
||||
void CPlayer::FindLyrics()
|
||||
{
|
||||
if (TryEnterCriticalSection(&m_CriticalSection))
|
||||
if (!m_InternetThread)
|
||||
{
|
||||
m_Lyrics.clear();
|
||||
|
||||
@ -195,8 +198,6 @@ void CPlayer::FindLyrics()
|
||||
{
|
||||
LSLog(LOG_DEBUG, L"Rainmeter", L"NowPlayingPlugin: Failed to start lyrics thread.");
|
||||
}
|
||||
|
||||
LeaveCriticalSection(&m_CriticalSection);
|
||||
}
|
||||
}
|
||||
|
||||
@ -210,7 +211,6 @@ unsigned __stdcall CPlayer::LyricsThreadProc(void* pParam)
|
||||
{
|
||||
CPlayer* player = (CPlayer*)pParam;
|
||||
|
||||
EnterCriticalSection(&player->m_CriticalSection);
|
||||
std::wstring lyrics;
|
||||
bool found;
|
||||
|
||||
@ -226,7 +226,7 @@ unsigned __stdcall CPlayer::LyricsThreadProc(void* pParam)
|
||||
break;
|
||||
}
|
||||
|
||||
// Track changed, fetch lyrics for it
|
||||
// Track changed, try again
|
||||
}
|
||||
|
||||
if (found)
|
||||
@ -236,7 +236,6 @@ unsigned __stdcall CPlayer::LyricsThreadProc(void* pParam)
|
||||
|
||||
CloseHandle(player->m_InternetThread);
|
||||
player->m_InternetThread = NULL;
|
||||
LeaveCriticalSection(&player->m_CriticalSection);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -117,7 +117,6 @@ private:
|
||||
static unsigned __stdcall LyricsThreadProc(void* pParam);
|
||||
|
||||
HANDLE m_InternetThread;
|
||||
CRITICAL_SECTION m_CriticalSection;
|
||||
};
|
||||
|
||||
#endif
|
@ -144,11 +144,27 @@ void CPlayerCAD::Initialize()
|
||||
}
|
||||
else
|
||||
{
|
||||
// TODO: Remove this in a few weeks (left here for MusicBee backwards compatibility)
|
||||
m_PlayerWindow = FindWindow(L"WindowsForms10.Window.8.app.0.378734a", NULL);
|
||||
m_PlayerWindow = FindWindow(L"CD Art Display IPC Class", NULL);
|
||||
if (m_PlayerWindow)
|
||||
{
|
||||
WritePrivateProfileString(L"NowPlaying.dll", L"ClassName", L"WindowsForms10.Window.8.app.0.378734a", file);
|
||||
classSz = L"CD Art Display IPC Class";
|
||||
WritePrivateProfileString(L"NowPlaying.dll", L"ClassName", classSz, file);
|
||||
|
||||
windowSz = (GetWindowText(m_PlayerWindow, buffer, MAX_PATH) > 0) ? buffer : NULL;
|
||||
WritePrivateProfileString(L"NowPlaying.dll", L"WindowName", windowSz, file);
|
||||
|
||||
DWORD pID;
|
||||
GetWindowThreadProcessId(m_PlayerWindow, &pID);
|
||||
HANDLE hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, pID);
|
||||
if (hProcess)
|
||||
{
|
||||
if (GetModuleFileNameEx(hProcess, NULL, buffer, MAX_PATH) > 0)
|
||||
{
|
||||
WritePrivateProfileString(L"NowPlaying.dll", L"PlayerPath", buffer, file);
|
||||
}
|
||||
|
||||
CloseHandle(hProcess);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -156,7 +172,7 @@ void CPlayerCAD::Initialize()
|
||||
{
|
||||
m_Initialized = true;
|
||||
SendMessage(m_PlayerWindow, WM_USER, (WPARAM)m_Window, IPC_SET_CALLBACK_HWND);
|
||||
m_State = (PLAYSTATE)SendMessage(m_PlayerWindow, WM_USER, 0, IPC_GET_PLAYER_STATE);
|
||||
m_State = (PLAYSTATE)SendMessage(m_PlayerWindow, WM_USER, 0, IPC_GET_STATE);
|
||||
|
||||
if (m_State != PLAYER_STOPPED)
|
||||
{
|
||||
@ -190,40 +206,62 @@ LRESULT CALLBACK CPlayerCAD::WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
|
||||
switch (msg)
|
||||
{
|
||||
case WM_CREATE:
|
||||
// Get pointer to the CPlayerCAD class from the CreateWindow call
|
||||
player = (CPlayerCAD*)((CREATESTRUCT*)lParam)->lpCreateParams;
|
||||
return 0;
|
||||
{
|
||||
// Get pointer to the CPlayerCAD class from the CreateWindow call
|
||||
player = (CPlayerCAD*)((CREATESTRUCT*)lParam)->lpCreateParams;
|
||||
return 0;
|
||||
}
|
||||
|
||||
case WM_DESTROY:
|
||||
SendMessage(player->m_PlayerWindow, WM_USER, 0, IPC_SHUTDOWN_NOTIFICATION);
|
||||
return 0;
|
||||
{
|
||||
SendMessage(player->m_PlayerWindow, WM_USER, 0, IPC_SHUTDOWN_NOTIFICATION);
|
||||
return 0;
|
||||
}
|
||||
|
||||
case WM_USER:
|
||||
switch (lParam)
|
||||
{
|
||||
case IPC_TRACK_CHANGED_NOTIFICATION:
|
||||
PostMessage(player->m_PlayerWindow, WM_USER, 0, IPC_GET_CURRENT_TRACK);
|
||||
break;
|
||||
|
||||
case IPC_PLAYER_STATE_CHANGED_NOTIFICATION:
|
||||
player->m_State = (PLAYSTATE)wParam;
|
||||
if (player->m_State == PLAYER_STOPPED)
|
||||
{
|
||||
player->ClearData();
|
||||
PostMessage(player->m_PlayerWindow, WM_USER, 0, IPC_GET_CURRENT_TRACK);
|
||||
break;
|
||||
}
|
||||
|
||||
case IPC_STATE_CHANGED_NOTIFICATION:
|
||||
{
|
||||
player->m_State = (PLAYSTATE)wParam;
|
||||
if (player->m_State == PLAYER_STOPPED)
|
||||
{
|
||||
player->ClearData();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case IPC_VOLUME_CHANGED_NOTIFICATION:
|
||||
{
|
||||
player->m_Volume = wParam;
|
||||
break;
|
||||
}
|
||||
|
||||
case IPC_RATING_CHANGED_NOTIFICATION:
|
||||
{
|
||||
player->m_Rating = (wParam + 1) / 2; // From 0 - 10 to 0 - 5
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case IPC_SHUTDOWN_NOTIFICATION:
|
||||
player->m_Initialized = false;
|
||||
player->ClearData();
|
||||
break;
|
||||
{
|
||||
player->m_Initialized = false;
|
||||
player->ClearData();
|
||||
break;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
||||
case WM_COPYDATA:
|
||||
{
|
||||
PCOPYDATASTRUCT cds = (PCOPYDATASTRUCT)lParam;
|
||||
if (cds->dwData == IPC_CURRENT_TRACK_INFO)
|
||||
if (cds->dwData == IPC_CURRENT_TRACK_NOTIFICATION)
|
||||
{
|
||||
// TODO: Sent on track update?
|
||||
++player->m_TrackCount;
|
||||
@ -269,7 +307,7 @@ LRESULT CALLBACK CPlayerCAD::WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
|
||||
player->FindLyrics();
|
||||
}
|
||||
}
|
||||
else if (cds->dwData == IPC_REGISTER_PLAYER && !player->m_Initialized)
|
||||
else if (cds->dwData == IPC_REGISTER_NOTIFICATION && !player->m_Initialized)
|
||||
{
|
||||
std::wstring data = (WCHAR*)cds->lpData;
|
||||
if (data[0] == L'1')
|
||||
@ -301,7 +339,7 @@ LRESULT CALLBACK CPlayerCAD::WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
|
||||
if (player->m_PlayerWindow)
|
||||
{
|
||||
player->m_Initialized = true;
|
||||
player->m_State = (PLAYSTATE)SendMessage(player->m_PlayerWindow, WM_USER, 0, IPC_GET_PLAYER_STATE);
|
||||
player->m_State = (PLAYSTATE)SendMessage(player->m_PlayerWindow, WM_USER, 0, IPC_GET_STATE);
|
||||
|
||||
if (player->m_State != PLAYER_STOPPED)
|
||||
{
|
||||
@ -341,7 +379,7 @@ void CPlayerCAD::UpdateData()
|
||||
*/
|
||||
void CPlayerCAD::Pause()
|
||||
{
|
||||
SendMessage(m_PlayerWindow, WM_USER, 0, IPC_FORCEPAUSE);
|
||||
SendMessage(m_PlayerWindow, WM_USER, 0, IPC_PAUSE);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -409,7 +447,7 @@ void CPlayerCAD::SetRating(int rating)
|
||||
{
|
||||
m_Rating = rating;
|
||||
rating *= 2; // From 0 - 5 to 0 - 10
|
||||
SendMessage(m_PlayerWindow, WM_USER, rating, IPC_RATING_CHANGED_NOTIFICATION);
|
||||
SendMessage(m_PlayerWindow, WM_USER, rating, IPC_SET_RATING);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -439,7 +477,7 @@ void CPlayerCAD::SetVolume(int volume)
|
||||
*/
|
||||
void CPlayerCAD::ClosePlayer()
|
||||
{
|
||||
SendMessage(m_PlayerWindow, WM_USER, 0, IPC_CLOSE_PLAYER);
|
||||
SendMessage(m_PlayerWindow, WM_USER, 0, IPC_CLOSE);
|
||||
// TODO
|
||||
m_Initialized = false;
|
||||
ClearData();
|
||||
@ -453,12 +491,20 @@ void CPlayerCAD::ClosePlayer()
|
||||
*/
|
||||
void CPlayerCAD::OpenPlayer(std::wstring& path)
|
||||
{
|
||||
if (!path.empty())
|
||||
if (!m_Initialized)
|
||||
{
|
||||
ShellExecute(NULL, L"open", path.c_str(), NULL, NULL, SW_SHOW);
|
||||
if (!path.empty())
|
||||
{
|
||||
ShellExecute(NULL, L"open", path.c_str(), NULL, NULL, SW_SHOW);
|
||||
}
|
||||
else if (!m_PlayerPath.empty())
|
||||
{
|
||||
ShellExecute(NULL, L"open", m_PlayerPath.c_str(), NULL, NULL, SW_SHOW);
|
||||
}
|
||||
}
|
||||
else if (!m_PlayerPath.empty())
|
||||
else
|
||||
{
|
||||
ShellExecute(NULL, L"open", m_PlayerPath.c_str(), NULL, NULL, SW_SHOW);
|
||||
// Bring player to front
|
||||
SendMessage(m_PlayerWindow, WM_USER, 0, IPC_SHOW_WINDOW);
|
||||
}
|
||||
}
|
||||
|
@ -177,6 +177,7 @@ LRESULT CALLBACK CPlayerFoobar::WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR
|
||||
break;
|
||||
|
||||
case FOO_PLAYERSTART:
|
||||
player->m_Initialized = true;
|
||||
player->m_FooWindow = (HWND)wParam;
|
||||
break;
|
||||
|
||||
|
@ -197,15 +197,12 @@ void CPlayerITunes::Initialize()
|
||||
if (position != 0)
|
||||
{
|
||||
m_State = PLAYER_PAUSED;
|
||||
OnTrackChange();
|
||||
}
|
||||
}
|
||||
else if (state == ITPlayerStatePlaying)
|
||||
{
|
||||
m_State = PLAYER_PLAYING;
|
||||
}
|
||||
|
||||
if (m_State != PLAYER_STOPPED)
|
||||
{
|
||||
OnTrackChange();
|
||||
}
|
||||
|
||||
|
@ -25,6 +25,7 @@
|
||||
#ifndef _ATL_DLL
|
||||
#define _ATL_DLL
|
||||
#define _ATL_APARTMENT_THREADED
|
||||
#define _ATL_NO_EXCEPTIONS
|
||||
#endif
|
||||
|
||||
#include <atlbase.h>
|
||||
|
@ -19,12 +19,14 @@
|
||||
#ifndef __PLAYERWMP_H__
|
||||
#define __PLAYERWMP_H__
|
||||
|
||||
#include "Player.h"
|
||||
|
||||
#ifndef _ATL_DLL
|
||||
#define _ATL_DLL
|
||||
#define _ATL_APARTMENT_THREADED
|
||||
#define _ATL_NO_EXCEPTIONS
|
||||
#endif
|
||||
|
||||
#include "Player.h"
|
||||
#include <wmp.h>
|
||||
#include <atlbase.h>
|
||||
#include <atlcom.h>
|
||||
|
@ -89,7 +89,7 @@ bool CPlayerWinamp::CheckWindow()
|
||||
{
|
||||
DWORD pID;
|
||||
GetWindowThreadProcessId(m_Window, &pID);
|
||||
m_WinampHandle = OpenProcess(PROCESS_VM_READ, false, pID);
|
||||
m_WinampHandle = OpenProcess(PROCESS_VM_READ, FALSE, pID);
|
||||
|
||||
if (m_WinampHandle)
|
||||
{
|
||||
@ -200,7 +200,6 @@ void CPlayerWinamp::UpdateData()
|
||||
|
||||
std::wstring title = wBuffer;
|
||||
std::wstring::size_type pos = title.find(L". ");
|
||||
|
||||
if (pos != std::wstring::npos && pos < 5)
|
||||
{
|
||||
pos += 2; // Skip ". "
|
||||
@ -217,8 +216,9 @@ void CPlayerWinamp::UpdateData()
|
||||
}
|
||||
else
|
||||
{
|
||||
ClearData();
|
||||
return;
|
||||
m_Title = title;
|
||||
m_Artist.clear();
|
||||
m_Album.clear();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 1,1,2,0
|
||||
FILEVERSION 1,1,3,0
|
||||
PRODUCTVERSION PRODUCTVER
|
||||
FILEFLAGSMASK 0x17L
|
||||
#ifdef _DEBUG
|
||||
@ -29,7 +29,7 @@ BEGIN
|
||||
BLOCK "040904E4"
|
||||
BEGIN
|
||||
VALUE "FileDescription", "NowPlaying Plugin for Rainmeter"
|
||||
VALUE "FileVersion", "1.1.2.0"
|
||||
VALUE "FileVersion", "1.1.3.0"
|
||||
VALUE "InternalName", "NowPlaying"
|
||||
VALUE "LegalCopyright", "Copyright (C) 2011 - Birunthan Mohanathas"
|
||||
VALUE "OriginalFilename", "NowPlaying.dll"
|
||||
|
@ -122,7 +122,7 @@
|
||||
<ProgramDatabaseFile>.\x32/Debug/NowPlaying.pdb</ProgramDatabaseFile>
|
||||
<ImportLibrary>.\x32/Debug/NowPlaying.lib</ImportLibrary>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
<AdditionalDependencies>WinInet.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>Psapi.lib;WinInet.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
@ -163,7 +163,7 @@
|
||||
<ProgramDatabaseFile>.\x64/Debug/NowPlaying.pdb</ProgramDatabaseFile>
|
||||
<ImportLibrary>.\x64/Debug/NowPlaying.lib</ImportLibrary>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
<AdditionalDependencies>WinInet.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>Psapi.lib;WinInet.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
@ -192,15 +192,16 @@
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<DisableSpecificWarnings>4018;4090;4099;4114;4244;4267;4309;4351;4390;4786;4800;4996</DisableSpecificWarnings>
|
||||
<DisableSpecificWarnings>4018;4090;4099;4114;4244;4267;4309;4351;4390;4530;4786;4800;4996</DisableSpecificWarnings>
|
||||
<AdditionalIncludeDirectories>.\sha2;.\taglib;.\taglib\toolkit;.\taglib\mpeg\id3v2\frames;.\taglib\ogg;.\taglib\asf;.\taglib\mp4;.\taglib\ogg\vorbis;.\taglib\ogg\flac;.\taglib\ogg\speex;.\taglib\riff;.\taglib\riff\wav;.\taglib\riff\aiff;.\taglib\flac;.\taglib\mpeg;.\taglib\mpeg\id3v1;.\taglib\mpeg\id3v2;.\taglib\mpc;.\taglib\ape;.\taglib\trueaudio;.\taglib\wavpack;.\SDKs\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ExceptionHandling>false</ExceptionHandling>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0409</Culture>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>Rainmeter.lib;WinInet.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>Rainmeter.lib;Psapi.lib;WinInet.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>../../TestBench/x32/Release/Plugins/NowPlaying.dll</OutputFile>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<AdditionalLibraryDirectories>..\..\Library\x32\Release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
@ -236,8 +237,9 @@
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<DisableSpecificWarnings>4018;4090;4099;4114;4244;4267;4309;4351;4390;4786;4800;4996</DisableSpecificWarnings>
|
||||
<DisableSpecificWarnings>4018;4090;4099;4114;4244;4267;4309;4351;4390;4530;4786;4800;4996</DisableSpecificWarnings>
|
||||
<AdditionalIncludeDirectories>.\sha2;.\taglib;.\taglib\toolkit;.\taglib\mpeg\id3v2\frames;.\taglib\ogg;.\taglib\asf;.\taglib\mp4;.\taglib\ogg\vorbis;.\taglib\ogg\flac;.\taglib\ogg\speex;.\taglib\riff;.\taglib\riff\wav;.\taglib\riff\aiff;.\taglib\flac;.\taglib\mpeg;.\taglib\mpeg\id3v1;.\taglib\mpeg\id3v2;.\taglib\mpc;.\taglib\ape;.\taglib\trueaudio;.\taglib\wavpack;.\SDKs\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ExceptionHandling>false</ExceptionHandling>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>NDEBUG;_WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
@ -245,7 +247,7 @@
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<AdditionalOptions>/LTCG %(AdditionalOptions)</AdditionalOptions>
|
||||
<AdditionalDependencies>Rainmeter.lib;WinInet.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>Rainmeter.lib;Psapi.lib;WinInet.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>../../TestBench/x64/Release/Plugins/NowPlaying.dll</OutputFile>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<AdditionalLibraryDirectories>..\..\Library\x64\Release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
|
@ -3,140 +3,38 @@
|
||||
|
||||
enum IPCMESSAGE
|
||||
{
|
||||
/*
|
||||
Most of these messages are sent to the player. Messages that the player
|
||||
should send back to CAD are noted by '[Sent by player]'
|
||||
|
||||
Based on information available in cad-sdk-2.1.pdf and in foo_cdartdisplay source.
|
||||
*/
|
||||
|
||||
// uMsg: WM_USER, wParam: 0, lParam: 100
|
||||
IPC_PLAY = 100,
|
||||
|
||||
// uMsg: WM_USER, wParam: 0, lParam: 101
|
||||
IPC_PLAYPAUSE,
|
||||
|
||||
// uMsg: WM_USER, wParam: 0, lParam: 102
|
||||
IPC_FORCEPAUSE,
|
||||
|
||||
// uMsg: WM_USER, wParam: 0, lParam: 103
|
||||
IPC_STOP,
|
||||
|
||||
// uMsg: WM_USER, wParam: 0, lParam: 104
|
||||
IPC_NEXT,
|
||||
|
||||
// uMsg: WM_USER, wParam: 0, lParam: 105
|
||||
IPC_PREVIOUS,
|
||||
|
||||
// uMsg: WM_USER, wParam: volume (0 - 100), lParam: 108
|
||||
IPC_SET_VOLUME = 108,
|
||||
|
||||
// uMsg: WM_USER, wParam: 0, lParam: 109, result: 0 to 100
|
||||
IPC_GET_VOLUME,
|
||||
|
||||
// uMsg: WM_USER, wParam: 0, lParam: 110
|
||||
// When the player recieves this message, it should send
|
||||
// the IPC_CURRENT_TRACK message back to CAD
|
||||
IPC_GET_CURRENT_TRACK,
|
||||
|
||||
// uMsg: WM_USER, wParam: 0, lParam: 113
|
||||
IPC_GET_DURATION = 113,
|
||||
|
||||
// uMsg: WM_USER, wParam: position (seconds), lParam: 114
|
||||
IPC_SET_POSITION,
|
||||
|
||||
// uMsg: WM_USER, wParam: 0, lParam: 115, result: 1 if playing
|
||||
IPC_IS_PLAYING,
|
||||
|
||||
// uMsg: WM_USER, wParam: 0, lParam: 116, result: 1 if paused
|
||||
IPC_IS_PAUSED,
|
||||
|
||||
// uMsg: WM_USER, wParam: 0, lParam: 117
|
||||
IPC_GET_LIST_LENGTH,
|
||||
|
||||
// uMsg: WM_USER, wParam: position, lParam: 118
|
||||
IPC_SET_LIST_POS,
|
||||
|
||||
// uMsg: WM_USER, wParam: 0, lParam: 119
|
||||
IPC_GET_LIST_ITEM,
|
||||
|
||||
// uMsg: WM_USER, wParam: hwnd, lParam: 120
|
||||
// CAD sends this mesage to the player on startup. The player
|
||||
// should then send all future WM_COPYDATA messages to this window.
|
||||
IPC_SET_CALLBACK_HWND,
|
||||
|
||||
// uMsg: WM_USER, wParam: 0, lParam: 121
|
||||
IPC_GET_LIST_POS,
|
||||
|
||||
// uMsg: WM_USER, wParam: 0, lParam: 122, result: position (in seconds)
|
||||
IPC_GET_POSITION,
|
||||
|
||||
// uMsg: WM_USER, wParam: 0, lParam: 123 [Sent by player]
|
||||
// The player should send this message when the track changes.
|
||||
IPC_TRACK_CHANGED_NOTIFICATION,
|
||||
|
||||
// uMsg: WM_USER, wParam: 0, lParam: 124
|
||||
IPC_SHOW_PLAYER_WINDOW,
|
||||
|
||||
// uMsg: WM_USER, wParam: 0, lParam: 125, result: 0 (stopped), 1 (playing), or 2 (paused)
|
||||
IPC_GET_PLAYER_STATE,
|
||||
|
||||
// uMsg: WM_USER, wParam: 0, lParam: 126 [Sent by player]
|
||||
// The player should send this notification when the play state changes.
|
||||
IPC_PLAYER_STATE_CHANGED_NOTIFICATION,
|
||||
|
||||
// uMsg: WM_USER, wParam: 0, lParam: 127 [Not implemented in CAD yet]
|
||||
IPC_AUTOENQUEUE_OPTIONS,
|
||||
|
||||
// uMsg: WM_USER, wParam: 0 or 1, lParam: 128
|
||||
IPC_SET_REPEAT,
|
||||
|
||||
// uMsg: WM_USER, wParam: 0 or 1, lParam: 129 [Sent by/to player]
|
||||
// The player should send this message when it quits.
|
||||
// CAD will also send this message on exit. Upon receival, the player should
|
||||
// disconnect the communication interface and get ready for a IPC_SET_CALLBACK_HWND message.
|
||||
IPC_SHUTDOWN_NOTIFICATION,
|
||||
|
||||
// uMsg: WM_USER, wParam: 0, lParam: 130, result: 1 if shuffle is active
|
||||
IPC_GET_REPEAT,
|
||||
|
||||
// uMsg: WM_USER, wParam: 0, lParam: 131
|
||||
// The player should quit completely upon receival.
|
||||
IPC_CLOSE_PLAYER,
|
||||
|
||||
// uMsg: WM_USER, wParam: 0, lParam: 140, result: 1 if shuffle is active
|
||||
IPC_GET_SHUFFLE = 140,
|
||||
|
||||
// uMsg: WM_USER, wParam: 0 or 1, lParam: 141
|
||||
IPC_SET_SHUFFLE,
|
||||
|
||||
// uMsg: WM_USER, wParam: rating (0 - 10), lParam: 141 [Sent by/to player]
|
||||
// CAD sends this message to the player with the new rating (0 - 10). The
|
||||
// player sends this message when the rating changes.
|
||||
IPC_PLAY = 100,
|
||||
IPC_PLAYPAUSE = 101,
|
||||
IPC_PAUSE = 102,
|
||||
IPC_STOP = 103,
|
||||
IPC_NEXT = 104,
|
||||
IPC_PREVIOUS = 105,
|
||||
IPC_VOLUME_CHANGED_NOTIFICATION = 108,
|
||||
IPC_SET_VOLUME = 108,
|
||||
IPC_GET_VOLUME = 109,
|
||||
IPC_GET_CURRENT_TRACK = 110,
|
||||
IPC_GET_DURATION = 113,
|
||||
IPC_SET_POSITION = 114,
|
||||
IPC_SET_CALLBACK_HWND = 120,
|
||||
IPC_GET_POSITION = 122,
|
||||
IPC_TRACK_CHANGED_NOTIFICATION = 123,
|
||||
IPC_SHOW_WINDOW = 124,
|
||||
IPC_GET_STATE = 125,
|
||||
IPC_STATE_CHANGED_NOTIFICATION = 126,
|
||||
IPC_SET_REPEAT = 128,
|
||||
IPC_SHUTDOWN_NOTIFICATION = 129,
|
||||
IPC_GET_REPEAT = 130,
|
||||
IPC_CLOSE = 131,
|
||||
IPC_GET_SHUFFLE = 140,
|
||||
IPC_SET_SHUFFLE = 141,
|
||||
IPC_RATING_CHANGED_NOTIFICATION = 639,
|
||||
|
||||
// uMsg: WM_COPYDATA, wParam: 700, lParam: COPYDATASTRUCT [Sent by player]
|
||||
// The player sends this message on start up. Refer to the SDK manual for detailed info.
|
||||
IPC_REGISTER_PLAYER = 700, // Sent by player to CAD on startup.
|
||||
|
||||
// uMsg: WM_COPYDATA, wParam: 701, lParam: COPYDATASTRUCT [Sent by player]
|
||||
// The player sends this when it receives the IPC_GET_CURRENT_TRACK message.
|
||||
IPC_CURRENT_TRACK_INFO,
|
||||
|
||||
// uMsg: WM_COPYDATA, wParam: 702, lParam: COPYDATASTRUCT [Sent by player]
|
||||
// The player sends this when it receives the IPC_GET_CURRENT_LYRICS message.
|
||||
IPC_CURRENT_LYRICS,
|
||||
|
||||
// uMsg: WM_COPYDATA, wParam: 703, lParam: COPYDATASTRUCT [Sent by player]
|
||||
// The player sends this when, for example, new lyrics have been retrieved.
|
||||
IPC_NEW_LYRICS,
|
||||
|
||||
// uMsg: WM_COPYDATA, wParam: 800, lParam: COPYDATASTRUCT [Sent by player]
|
||||
// The player sends this when a new cover is available for playing track.
|
||||
IPC_NEW_COVER = 800,
|
||||
|
||||
// uMsg: WM_USER, wParam: 0, lParam: 801
|
||||
IPC_GET_CURRENT_LYRICS,
|
||||
IPC_SET_RATING = 639,
|
||||
IPC_REGISTER_NOTIFICATION = 700,
|
||||
IPC_CURRENT_TRACK_NOTIFICATION = 701,
|
||||
IPC_CURRENT_LYRICS_NOTIFICATION = 702,
|
||||
IPC_NEW_LYRICS_NOTIFICATION = 703,
|
||||
IPC_NEW_COVER_NOTIFICATION = 800,
|
||||
IPC_GET_LYRICS = 801
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -22,6 +22,7 @@
|
||||
// WinAPI
|
||||
#include <Windows.h>
|
||||
#include <WinInet.h>
|
||||
#include <Psapi.h>
|
||||
|
||||
// STL
|
||||
#include <string>
|
||||
|
Loading…
Reference in New Issue
Block a user