Remove "C" prefix in class names

This commit is contained in:
Birunthan Mohanathas
2013-05-31 17:18:52 +03:00
parent 4332cea3d0
commit da9384cfad
126 changed files with 2114 additions and 2116 deletions

View File

@ -30,12 +30,12 @@
struct MeasureData
{
std::vector<CRawString> includes;
std::vector<CRawString> excludes;
CRawString includesCache;
CRawString excludesCache;
std::vector<RawString> includes;
std::vector<RawString> excludes;
RawString includesCache;
RawString excludesCache;
int topProcess;
CRawString topProcessName;
RawString topProcessName;
LONGLONG topProcessValue;
MeasureData() :
@ -47,7 +47,7 @@ struct MeasureData
struct ProcessValues
{
CRawString name;
RawString name;
LONGLONG oldValue;
LONGLONG newValue;
bool found;
@ -58,7 +58,7 @@ std::vector<ProcessValues> g_Processes;
void UpdateProcesses();
void SplitName(WCHAR* names, std::vector<CRawString>& splittedNames)
void SplitName(WCHAR* names, std::vector<RawString>& splittedNames)
{
WCHAR* token = wcstok(names, L";");
while (token != NULL)

View File

@ -90,7 +90,7 @@ void CFolderInfo::Update()
void CFolderInfo::CalculateSize()
{
std::list<CRawString> folderQueue;
std::list<RawString> folderQueue;
folderQueue.push_back(m_Path.c_str());
WCHAR searchPattern[MAX_PATH + 10];
@ -100,7 +100,7 @@ void CFolderInfo::CalculateSize()
HANDLE findHandle;
while (!folderQueue.empty())
{
const CRawString& ref = folderQueue.front();
const RawString& ref = folderQueue.front();
wsprintf(searchPattern, L"%s%s", ref.c_str(), L"\\*.*");
findHandle = FindFirstFile(searchPattern, &findData);

View File

@ -56,7 +56,7 @@ private:
UINT m_InstanceCount;
void* m_Skin;
CRawString m_Path;
RawString m_Path;
bool m_IncludeSubFolders;
bool m_IncludeHiddenFiles;
bool m_IncludeSystemFiles;

View File

@ -19,13 +19,13 @@
#include "StdAfx.h"
#include "Internet.h"
HINTERNET CInternet::c_NetHandle = NULL;
HINTERNET Internet::c_NetHandle = NULL;
/*
** Initialize internet handle and crtical section.
**
*/
void CInternet::Initialize()
void Internet::Initialize()
{
c_NetHandle = InternetOpen(L"Rainmeter NowPlaying.dll",
INTERNET_OPEN_TYPE_PRECONFIG,
@ -43,7 +43,7 @@ void CInternet::Initialize()
** Close handles and delete critical section.
**
*/
void CInternet::Finalize()
void Internet::Finalize()
{
if (c_NetHandle) InternetCloseHandle(c_NetHandle);
}
@ -52,7 +52,7 @@ void CInternet::Finalize()
** Downloads given url and returns it as a string.
**
*/
std::wstring CInternet::DownloadUrl(const std::wstring& url, int codepage)
std::wstring Internet::DownloadUrl(const std::wstring& url, int codepage)
{
// From WebParser.cpp
std::wstring result;
@ -148,7 +148,7 @@ std::wstring CInternet::DownloadUrl(const std::wstring& url, int codepage)
** Encode reserved characters.
**
*/
std::wstring CInternet::EncodeUrl(const std::wstring& url)
std::wstring Internet::EncodeUrl(const std::wstring& url)
{
// Based on http://www.zedwood.com/article/111/cpp-urlencode-function
const WCHAR* urlChars = L" !*'();:@&=+$,/?#[]";
@ -176,7 +176,7 @@ std::wstring CInternet::EncodeUrl(const std::wstring& url)
** Decodes numeric references.
**
*/
void CInternet::DecodeReferences(std::wstring& str)
void Internet::DecodeReferences(std::wstring& str)
{
// From WebParser.cpp
std::wstring::size_type start = 0;
@ -246,7 +246,7 @@ void CInternet::DecodeReferences(std::wstring& str)
** Convert multibyte string to wide string.
**
*/
std::wstring CInternet::ConvertToWide(LPCSTR str, int codepage)
std::wstring Internet::ConvertToWide(LPCSTR str, int codepage)
{
std::wstring szWide;

View File

@ -19,7 +19,7 @@
#ifndef __INTERNET_H__
#define __INTERNET_H__
class CInternet
class Internet
{
public:
static void Initialize();

View File

@ -25,10 +25,10 @@
** Download lyrics from various serivces.
**
*/
bool CLyrics::GetFromInternet(const std::wstring& artist, const std::wstring& title, std::wstring& out)
bool Lyrics::GetFromInternet(const std::wstring& artist, const std::wstring& title, std::wstring& out)
{
std::wstring encArtist = CInternet::EncodeUrl(artist);
std::wstring encTitle = CInternet::EncodeUrl(title);
std::wstring encArtist = Internet::EncodeUrl(artist);
std::wstring encTitle = Internet::EncodeUrl(title);
bool found = GetFromWikia(encArtist, encTitle, out) ||
GetFromLYRDB(encArtist, encTitle, out) ||
@ -41,7 +41,7 @@ bool CLyrics::GetFromInternet(const std::wstring& artist, const std::wstring& ti
** Download lyrics from LyricWiki.
**
*/
bool CLyrics::GetFromWikia(const std::wstring& artist, const std::wstring& title, std::wstring& data)
bool Lyrics::GetFromWikia(const std::wstring& artist, const std::wstring& title, std::wstring& data)
{
bool ret = false;
@ -49,7 +49,7 @@ bool CLyrics::GetFromWikia(const std::wstring& artist, const std::wstring& title
url += L"&song=";
url += title;
data = CInternet::DownloadUrl(url, CP_UTF8);
data = Internet::DownloadUrl(url, CP_UTF8);
if (!data.empty())
{
// First we get the URL to the actual wiki page
@ -61,7 +61,7 @@ bool CLyrics::GetFromWikia(const std::wstring& artist, const std::wstring& title
url.assign(data, 0, pos);
// Fetch the wiki page
data = CInternet::DownloadUrl(url, CP_UTF8);
data = Internet::DownloadUrl(url, CP_UTF8);
if (!data.empty())
{
pos = data.find(L"'lyricbox'");
@ -72,7 +72,7 @@ bool CLyrics::GetFromWikia(const std::wstring& artist, const std::wstring& title
data.erase(0, pos);
pos = data.find(L"<!");
data.resize(pos);
CInternet::DecodeReferences(data);
Internet::DecodeReferences(data);
pos = data.find(L"[...]");
if (pos != std::wstring::npos)
@ -115,7 +115,7 @@ bool CLyrics::GetFromWikia(const std::wstring& artist, const std::wstring& title
** Download lyrics from LYRDB.
**
*/
bool CLyrics::GetFromLYRDB(const std::wstring& artist, const std::wstring& title, std::wstring& data)
bool Lyrics::GetFromLYRDB(const std::wstring& artist, const std::wstring& title, std::wstring& data)
{
bool ret = false;
@ -132,7 +132,7 @@ bool CLyrics::GetFromLYRDB(const std::wstring& artist, const std::wstring& title
std::wstring url = L"http://webservices.lyrdb.com/lookup.php?q=" + query;
url += L"&for=match&agent=RainmeterNowPlaying";
data = CInternet::DownloadUrl(url, CP_ACP);
data = Internet::DownloadUrl(url, CP_ACP);
if (!data.empty())
{
pos = data.find(L"\\");
@ -142,7 +142,7 @@ bool CLyrics::GetFromLYRDB(const std::wstring& artist, const std::wstring& title
url.assign(data, 0, pos);
url.insert(0, L"http://webservices.lyrdb.com/getlyr.php?q=");
data = CInternet::DownloadUrl(url, CP_ACP);
data = Internet::DownloadUrl(url, CP_ACP);
if (!data.empty())
{
ret = true;
@ -157,14 +157,14 @@ bool CLyrics::GetFromLYRDB(const std::wstring& artist, const std::wstring& title
** Download lyrics from Letras.
**
*/
bool CLyrics::GetFromLetras(const std::wstring& artist, const std::wstring& title, std::wstring& data)
bool Lyrics::GetFromLetras(const std::wstring& artist, const std::wstring& title, std::wstring& data)
{
bool ret = false;
std::wstring url = L"http://letras.terra.com.br/winamp.php?musica=" + title;
url += L"&artista=";
url += artist;
data = CInternet::DownloadUrl(url, CP_ACP);
data = Internet::DownloadUrl(url, CP_ACP);
if (!data.empty())
{
std::wstring::size_type pos = data.find(L"\"letra\"");
@ -177,7 +177,7 @@ bool CLyrics::GetFromLetras(const std::wstring& artist, const std::wstring& titl
pos = data.find(L"</p>");
data.resize(pos);
CInternet::DecodeReferences(data);
Internet::DecodeReferences(data);
while ((pos = data.find(L"<br/>"), pos) != std::wstring::npos)
{

View File

@ -19,7 +19,7 @@
#ifndef __LYRICS_H__
#define __LYRICS_H__
class CLyrics
class Lyrics
{
public:
static bool GetFromInternet(const std::wstring& artist, const std::wstring& title, std::wstring& out);

View File

@ -53,7 +53,7 @@ PLUGIN_EXPORT void Initialize(void** data, void* rm)
if (!g_Initialized)
{
CInternet::Initialize();
Internet::Initialize();
g_Initialized = true;
}
}
@ -116,7 +116,7 @@ PLUGIN_EXPORT void Reload(void* data, void* rm, double* maxValue)
{
// ParentMeasure is created when PlayerName is an actual player (and not a reference)
ParentMeasure* parent = measure->parent;
CPlayer* oldPlayer = NULL;
Player* oldPlayer = NULL;
if (parent)
{
if (parent->data != data)
@ -139,11 +139,11 @@ PLUGIN_EXPORT void Reload(void* data, void* rm, double* maxValue)
if (_wcsicmp(L"AIMP", str) == 0)
{
parent->player = CPlayerAIMP::Create();
parent->player = PlayerAIMP::Create();
}
else if (_wcsicmp(L"CAD", str) == 0)
{
parent->player = CPlayerCAD::Create();
parent->player = PlayerCAD::Create();
}
else if (_wcsicmp(L"foobar2000", str) == 0)
{
@ -157,32 +157,32 @@ PLUGIN_EXPORT void Reload(void* data, void* rm, double* maxValue)
}
}
parent->player = CPlayerCAD::Create();
parent->player = PlayerCAD::Create();
}
else if (_wcsicmp(L"iTunes", str) == 0)
{
parent->player = CPlayerITunes::Create();
parent->player = PlayerITunes::Create();
}
else if (_wcsicmp(L"MediaMonkey", str) == 0)
{
parent->player = CPlayerWinamp::Create(WA_MEDIAMONKEY);
parent->player = PlayerWinamp::Create(WA_MEDIAMONKEY);
}
else if (_wcsicmp(L"Spotify", str) == 0)
{
parent->player = CPlayerSpotify::Create();
parent->player = PlayerSpotify::Create();
}
else if (_wcsicmp(L"WinAmp", str) == 0)
{
parent->player = CPlayerWinamp::Create(WA_WINAMP);
parent->player = PlayerWinamp::Create(WA_WINAMP);
}
else if (_wcsicmp(L"WMP", str) == 0)
{
parent->player = CPlayerWMP::Create();
parent->player = PlayerWMP::Create();
}
else
{
// Default to WLM
parent->player = CPlayerWLM::Create();
parent->player = PlayerWLM::Create();
if (_wcsicmp(L"WLM", str) != 0)
{
@ -302,7 +302,7 @@ PLUGIN_EXPORT double Update(void* data)
ParentMeasure* parent = measure->parent;
if (!parent) return 0.0;
CPlayer* player = parent->player;
Player* player = parent->player;
// Only allow parent measure to update
if (parent->data == data)
@ -367,7 +367,7 @@ PLUGIN_EXPORT LPCWSTR GetString(void* data)
ParentMeasure* parent = measure->parent;
if (!parent) return NULL;
const CPlayer* player = parent->player;
const Player* player = parent->player;
static WCHAR buffer[32];
switch (measure->type)
@ -444,7 +444,7 @@ PLUGIN_EXPORT void Finalize(void* data)
ParentMeasure* parent = measure->parent;
if (parent)
{
CPlayer* player = parent->player;
Player* player = parent->player;
if (--parent->measureCount == 0)
{
player->RemoveInstance();
@ -455,7 +455,7 @@ PLUGIN_EXPORT void Finalize(void* data)
if (g_ParentMeasures.empty())
{
CInternet::Finalize();
Internet::Finalize();
}
}
}
@ -469,7 +469,7 @@ PLUGIN_EXPORT void ExecuteBang(void* data, LPCWSTR args)
ParentMeasure* parent = measure->parent;
if (!parent) return;
CPlayer* player = parent->player;
Player* player = parent->player;
if (!player->IsInitialized())
{

View File

@ -33,7 +33,7 @@ struct ParentMeasure
disableLeadingZero(false)
{}
CPlayer* player;
Player* player;
void* data;
void* skin;
LPCWSTR ownerName;

View File

@ -23,7 +23,7 @@
** Constructor.
**
*/
CPlayer::CPlayer() :
Player::Player() :
m_Initialized(false),
m_InstanceCount(),
m_UpdateCount(),
@ -51,7 +51,7 @@ CPlayer::CPlayer() :
** Destructor.
**
*/
CPlayer::~CPlayer()
Player::~Player()
{
DeleteFile(m_TempCoverPath.c_str());
@ -65,7 +65,7 @@ CPlayer::~CPlayer()
** Called during initialization of main measure.
**
*/
void CPlayer::AddInstance()
void Player::AddInstance()
{
++m_InstanceCount;
}
@ -74,7 +74,7 @@ void CPlayer::AddInstance()
** Called during destruction of main measure.
**
*/
void CPlayer::RemoveInstance()
void Player::RemoveInstance()
{
m_UpdateCount = 0;
@ -88,7 +88,7 @@ void CPlayer::RemoveInstance()
** Called during initialization of any measure.
**
*/
void CPlayer::AddMeasure(INT type)
void Player::AddMeasure(INT type)
{
m_Measures |= type;
}
@ -97,7 +97,7 @@ void CPlayer::AddMeasure(INT type)
** Called during update of main measure.
**
*/
void CPlayer::UpdateMeasure()
void Player::UpdateMeasure()
{
if (++m_UpdateCount == m_InstanceCount)
{
@ -110,7 +110,7 @@ void CPlayer::UpdateMeasure()
** Default implementation for getting cover.
**
*/
void CPlayer::FindCover()
void Player::FindCover()
{
TagLib::FileRef fr(m_FilePath.c_str(), false);
if (!fr.isNull() && CCover::GetEmbedded(fr, m_TempCoverPath))
@ -134,7 +134,7 @@ void CPlayer::FindCover()
** Default implementation for getting lyrics.
**
*/
void CPlayer::FindLyrics()
void Player::FindLyrics()
{
if (!m_InternetThread)
{
@ -157,9 +157,9 @@ void CPlayer::FindLyrics()
** Thread to download lyrics.
**
*/
unsigned __stdcall CPlayer::LyricsThreadProc(void* pParam)
unsigned __stdcall Player::LyricsThreadProc(void* pParam)
{
CPlayer* player = (CPlayer*)pParam;
Player* player = (Player*)pParam;
std::wstring lyrics;
bool found;
@ -167,7 +167,7 @@ unsigned __stdcall CPlayer::LyricsThreadProc(void* pParam)
while (true)
{
UINT beforeCount = player->GetTrackCount();
found = CLyrics::GetFromInternet(player->m_Artist, player->m_Title, lyrics);
found = Lyrics::GetFromInternet(player->m_Artist, player->m_Title, lyrics);
UINT afterCount = player->GetTrackCount();
if (beforeCount == afterCount)
@ -194,7 +194,7 @@ unsigned __stdcall CPlayer::LyricsThreadProc(void* pParam)
** Clear track information.
**
*/
void CPlayer::ClearData(bool all)
void Player::ClearData(bool all)
{
m_State = STATE_STOPPED;
m_Artist.clear();

View File

@ -54,11 +54,11 @@ enum MeasureType
MEASURE_YEAR = 0x00010000
};
class __declspec(novtable) CPlayer
class __declspec(novtable) Player
{
public:
CPlayer();
virtual ~CPlayer() = 0;
Player();
virtual ~Player() = 0;
void AddInstance();
void RemoveInstance();

View File

@ -21,13 +21,13 @@
#include "AIMP/aimp2_sdk.h"
#include "Winamp/wa_ipc.h"
CPlayer* CPlayerAIMP::c_Player = NULL;
Player* PlayerAIMP::c_Player = NULL;
/*
** Constructor.
**
*/
CPlayerAIMP::CPlayerAIMP() : CPlayer(),
PlayerAIMP::PlayerAIMP() : Player(),
m_Window(),
m_WinampWindow(),
m_LastCheckTime(0),
@ -42,7 +42,7 @@ CPlayerAIMP::CPlayerAIMP() : CPlayer(),
** Destructor.
**
*/
CPlayerAIMP::~CPlayerAIMP()
PlayerAIMP::~PlayerAIMP()
{
c_Player = NULL;
if (m_FileMap) UnmapViewOfFile(m_FileMap);
@ -53,11 +53,11 @@ CPlayerAIMP::~CPlayerAIMP()
** Creates a shared class object.
**
*/
CPlayer* CPlayerAIMP::Create()
Player* PlayerAIMP::Create()
{
if (!c_Player)
{
c_Player = new CPlayerAIMP();
c_Player = new PlayerAIMP();
}
return c_Player;
@ -67,7 +67,7 @@ CPlayer* CPlayerAIMP::Create()
** Try to find AIMP periodically.
**
*/
bool CPlayerAIMP::CheckWindow()
bool PlayerAIMP::CheckWindow()
{
DWORD time = GetTickCount();
@ -100,7 +100,7 @@ bool CPlayerAIMP::CheckWindow()
** Called during each update of the main measure.
**
*/
void CPlayerAIMP::UpdateData()
void PlayerAIMP::UpdateData()
{
if (!m_Initialized)
{
@ -191,7 +191,7 @@ void CPlayerAIMP::UpdateData()
** Handles the Pause bang.
**
*/
void CPlayerAIMP::Pause()
void PlayerAIMP::Pause()
{
SendMessage(m_Window, WM_AIMP_COMMAND, WM_AIMP_CALLFUNC, AIMP_PAUSE);
}
@ -200,7 +200,7 @@ void CPlayerAIMP::Pause()
** Handles the Play bang.
**
*/
void CPlayerAIMP::Play()
void PlayerAIMP::Play()
{
SendMessage(m_Window, WM_AIMP_COMMAND, WM_AIMP_CALLFUNC, AIMP_PLAY);
}
@ -209,7 +209,7 @@ void CPlayerAIMP::Play()
** Handles the Stop bang.
**
*/
void CPlayerAIMP::Stop()
void PlayerAIMP::Stop()
{
SendMessage(m_Window, WM_AIMP_COMMAND, WM_AIMP_CALLFUNC, AIMP_STOP);
}
@ -218,7 +218,7 @@ void CPlayerAIMP::Stop()
** Handles the Next bang.
**
*/
void CPlayerAIMP::Next()
void PlayerAIMP::Next()
{
SendMessage(m_Window, WM_AIMP_COMMAND, WM_AIMP_CALLFUNC, AIMP_NEXT);
}
@ -227,7 +227,7 @@ void CPlayerAIMP::Next()
** Handles the Previous bang.
**
*/
void CPlayerAIMP::Previous()
void PlayerAIMP::Previous()
{
SendMessage(m_Window, WM_AIMP_COMMAND, WM_AIMP_CALLFUNC, AIMP_PREV);
}
@ -236,7 +236,7 @@ void CPlayerAIMP::Previous()
** Handles the SetPosition bang.
**
*/
void CPlayerAIMP::SetPosition(int position)
void PlayerAIMP::SetPosition(int position)
{
SendMessage(m_Window, WM_AIMP_COMMAND, WM_AIMP_STATUS_SET, MAKELPARAM(position, AIMP_STS_POS));
}
@ -245,7 +245,7 @@ void CPlayerAIMP::SetPosition(int position)
** Handles the SetRating bang.
**
*/
void CPlayerAIMP::SetRating(int rating)
void PlayerAIMP::SetRating(int rating)
{
// Set rating through the AIMP Winamp API
if (m_State != STATE_STOPPED)
@ -259,7 +259,7 @@ void CPlayerAIMP::SetRating(int rating)
** Handles the SetVolume bang.
**
*/
void CPlayerAIMP::SetVolume(int volume)
void PlayerAIMP::SetVolume(int volume)
{
SendMessage(m_Window, WM_AIMP_COMMAND, WM_AIMP_STATUS_SET, MAKELPARAM(volume, AIMP_STS_VOLUME));
}
@ -268,7 +268,7 @@ void CPlayerAIMP::SetVolume(int volume)
** Handles the SetShuffle bang.
**
*/
void CPlayerAIMP::SetShuffle(bool state)
void PlayerAIMP::SetShuffle(bool state)
{
m_Shuffle = state;
SendMessage(m_Window, WM_AIMP_COMMAND, WM_AIMP_STATUS_SET, MAKELPARAM(m_Shuffle, AIMP_STS_SHUFFLE));
@ -278,7 +278,7 @@ void CPlayerAIMP::SetShuffle(bool state)
** Handles the SetRepeat bang.
**
*/
void CPlayerAIMP::SetRepeat(bool state)
void PlayerAIMP::SetRepeat(bool state)
{
m_Repeat = state;
SendMessage(m_Window, WM_AIMP_COMMAND, WM_AIMP_STATUS_SET, MAKELPARAM(m_Repeat, AIMP_STS_REPEAT));
@ -288,7 +288,7 @@ void CPlayerAIMP::SetRepeat(bool state)
** Handles the ClosePlayer bang.
**
*/
void CPlayerAIMP::ClosePlayer()
void PlayerAIMP::ClosePlayer()
{
SendMessage(m_Window, WM_CLOSE, 0, 0);
}
@ -297,7 +297,7 @@ void CPlayerAIMP::ClosePlayer()
** Handles the OpenPlayer bang.
**
*/
void CPlayerAIMP::OpenPlayer(std::wstring& path)
void PlayerAIMP::OpenPlayer(std::wstring& path)
{
if (path.empty())
{

View File

@ -21,12 +21,12 @@
#include "Player.h"
class CPlayerAIMP : public CPlayer
class PlayerAIMP : public Player
{
public:
virtual ~CPlayerAIMP();
virtual ~PlayerAIMP();
static CPlayer* Create();
static Player* Create();
virtual void UpdateData();
@ -44,13 +44,13 @@ public:
virtual void OpenPlayer(std::wstring& path);
protected:
CPlayerAIMP();
PlayerAIMP();
private:
bool Initialize();
bool CheckWindow();
static CPlayer* c_Player;
static Player* c_Player;
HWND m_Window; // AIMP window
HWND m_WinampWindow; // AIMP Winamp API window

View File

@ -20,7 +20,7 @@
#include "PlayerCAD.h"
#include "CAD/cad_sdk.h"
CPlayer* CPlayerCAD::c_Player = NULL;
Player* PlayerCAD::c_Player = NULL;
extern HINSTANCE g_Instance;
// This player emulates the CD Art Display IPC interface, which is supported by
@ -30,7 +30,7 @@ extern HINSTANCE g_Instance;
** Constructor.
**
*/
CPlayerCAD::CPlayerCAD() : CPlayer(),
PlayerCAD::PlayerCAD() : Player(),
m_Window(),
m_PlayerWindow(),
m_ExtendedAPI(false),
@ -43,7 +43,7 @@ CPlayerCAD::CPlayerCAD() : CPlayer(),
** Constructor.
**
*/
CPlayerCAD::~CPlayerCAD()
PlayerCAD::~PlayerCAD()
{
c_Player = NULL;
Uninitialize();
@ -53,11 +53,11 @@ CPlayerCAD::~CPlayerCAD()
** Creates a shared class object.
**
*/
CPlayer* CPlayerCAD::Create()
Player* PlayerCAD::Create()
{
if (!c_Player)
{
c_Player = new CPlayerCAD();
c_Player = new PlayerCAD();
}
return c_Player;
@ -67,7 +67,7 @@ CPlayer* CPlayerCAD::Create()
** Create receiver window.
**
*/
void CPlayerCAD::Initialize()
void PlayerCAD::Initialize()
{
// Create windows class
WNDCLASS wc = {0};
@ -184,7 +184,7 @@ void CPlayerCAD::Initialize()
** Destroy reciever window.
**
*/
void CPlayerCAD::Uninitialize()
void PlayerCAD::Uninitialize()
{
DestroyWindow(m_Window);
UnregisterClass(L"NowPlayingCADClass", g_Instance);
@ -194,16 +194,16 @@ void CPlayerCAD::Uninitialize()
** Window procedure for the reciever window.
**
*/
LRESULT CALLBACK CPlayerCAD::WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
LRESULT CALLBACK PlayerCAD::WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
static CPlayerCAD* player;
static PlayerCAD* player;
switch (msg)
{
case WM_CREATE:
{
// Get pointer to the CPlayerCAD class from the CreateWindow call
player = (CPlayerCAD*)((CREATESTRUCT*)lParam)->lpCreateParams;
// Get pointer to the PlayerCAD class from the CreateWindow call
player = (PlayerCAD*)((CREATESTRUCT*)lParam)->lpCreateParams;
return 0;
}
@ -414,7 +414,7 @@ LRESULT CALLBACK CPlayerCAD::WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
** Called during each update of the main measure.
**
*/
void CPlayerCAD::UpdateData()
void PlayerCAD::UpdateData()
{
if (m_State != STATE_STOPPED)
{
@ -427,7 +427,7 @@ void CPlayerCAD::UpdateData()
** Handles the Pause bang.
**
*/
void CPlayerCAD::Pause()
void PlayerCAD::Pause()
{
SendMessage(m_PlayerWindow, WM_USER, 0, m_ExtendedAPI ? IPC_PAUSE : IPC_PLAYPAUSE);
}
@ -436,7 +436,7 @@ void CPlayerCAD::Pause()
** Handles the Play bang.
**
*/
void CPlayerCAD::Play()
void PlayerCAD::Play()
{
SendMessage(m_PlayerWindow, WM_USER, 0, m_ExtendedAPI ? IPC_PLAY : IPC_PLAYPAUSE);
}
@ -445,7 +445,7 @@ void CPlayerCAD::Play()
** Handles the Stop bang.
**
*/
void CPlayerCAD::Stop()
void PlayerCAD::Stop()
{
SendMessage(m_PlayerWindow, WM_USER, 0, IPC_STOP);
}
@ -454,7 +454,7 @@ void CPlayerCAD::Stop()
** Handles the Next bang.
**
*/
void CPlayerCAD::Next()
void PlayerCAD::Next()
{
SendMessage(m_PlayerWindow, WM_USER, 0, IPC_NEXT);
}
@ -463,7 +463,7 @@ void CPlayerCAD::Next()
** Handles the Previous bang.
**
*/
void CPlayerCAD::Previous()
void PlayerCAD::Previous()
{
SendMessage(m_PlayerWindow, WM_USER, 0, IPC_PREVIOUS);
}
@ -472,7 +472,7 @@ void CPlayerCAD::Previous()
** Handles the SetPosition bang.
**
*/
void CPlayerCAD::SetPosition(int position)
void PlayerCAD::SetPosition(int position)
{
SendMessage(m_PlayerWindow, WM_USER, position, IPC_SET_POSITION);
}
@ -481,7 +481,7 @@ void CPlayerCAD::SetPosition(int position)
** Handles the SetRating bang.
**
*/
void CPlayerCAD::SetRating(int rating)
void PlayerCAD::SetRating(int rating)
{
m_Rating = rating;
rating *= 2; // From 0 - 5 to 0 - 10
@ -492,7 +492,7 @@ void CPlayerCAD::SetRating(int rating)
** Handles the SetVolume bang.
**
*/
void CPlayerCAD::SetVolume(int volume)
void PlayerCAD::SetVolume(int volume)
{
SendMessage(m_PlayerWindow, WM_USER, volume, IPC_SET_VOLUME);
}
@ -501,7 +501,7 @@ void CPlayerCAD::SetVolume(int volume)
** Handles the SetShuffle bang.
**
*/
void CPlayerCAD::SetShuffle(bool state)
void PlayerCAD::SetShuffle(bool state)
{
SendMessage(m_PlayerWindow, WM_USER, (WPARAM)state, IPC_SET_SHUFFLE);
m_Shuffle = (bool)SendMessage(m_PlayerWindow, WM_USER, 0, IPC_GET_SHUFFLE);
@ -511,7 +511,7 @@ void CPlayerCAD::SetShuffle(bool state)
** Handles the SetRepeat bang.
**
*/
void CPlayerCAD::SetRepeat(bool state)
void PlayerCAD::SetRepeat(bool state)
{
SendMessage(m_PlayerWindow, WM_USER, (WPARAM)state, IPC_SET_REPEAT);
m_Repeat = (bool)SendMessage(m_PlayerWindow, WM_USER, 0, IPC_GET_REPEAT);
@ -521,7 +521,7 @@ void CPlayerCAD::SetRepeat(bool state)
** Handles the ClosePlayer bang.
**
*/
void CPlayerCAD::ClosePlayer()
void PlayerCAD::ClosePlayer()
{
SendMessage(m_PlayerWindow, WM_USER, 0, IPC_CLOSE);
// TODO
@ -533,7 +533,7 @@ void CPlayerCAD::ClosePlayer()
** Handles the OpenPlayer bang.
**
*/
void CPlayerCAD::OpenPlayer(std::wstring& path)
void PlayerCAD::OpenPlayer(std::wstring& path)
{
if (!m_Initialized)
{

View File

@ -24,12 +24,12 @@
typedef BOOL (WINAPI * FPCHANGEWINDOWMESSAGEFILTER)(UINT message, DWORD dwFlag);
typedef BOOL (WINAPI * FPCHANGEWINDOWMESSAGEFILTEREX)(HWND hWnd, UINT message, DWORD dwFlag, PCHANGEFILTERSTRUCT pChangeFilterStruct);
class CPlayerCAD : public CPlayer
class PlayerCAD : public Player
{
public:
virtual ~CPlayerCAD();
virtual ~PlayerCAD();
static CPlayer* Create();
static Player* Create();
virtual void UpdateData();
@ -47,14 +47,14 @@ public:
virtual void OpenPlayer(std::wstring& path);
protected:
CPlayerCAD();
PlayerCAD();
private:
void Initialize();
void Uninitialize();
static LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
static CPlayer* c_Player;
static Player* c_Player;
HWND m_Window;
HWND m_PlayerWindow;

View File

@ -19,14 +19,14 @@
#include "StdAfx.h"
#include "PlayerITunes.h"
CPlayer* CPlayerITunes::c_Player = NULL;
Player* PlayerITunes::c_Player = NULL;
extern HINSTANCE g_Instance;
/*
** Constructor.
**
*/
CPlayerITunes::CEventHandler::CEventHandler(CPlayerITunes* player) :
PlayerITunes::CEventHandler::CEventHandler(PlayerITunes* player) :
m_Player(player),
m_RefCount(),
m_ConnectionPoint(),
@ -43,7 +43,7 @@ CPlayerITunes::CEventHandler::CEventHandler(CPlayerITunes* player) :
** Destructor.
**
*/
CPlayerITunes::CEventHandler::~CEventHandler()
PlayerITunes::CEventHandler::~CEventHandler()
{
if (m_ConnectionPoint)
{
@ -52,7 +52,7 @@ CPlayerITunes::CEventHandler::~CEventHandler()
}
}
HRESULT STDMETHODCALLTYPE CPlayerITunes::CEventHandler::QueryInterface(REFIID iid, void** ppvObject)
HRESULT STDMETHODCALLTYPE PlayerITunes::CEventHandler::QueryInterface(REFIID iid, void** ppvObject)
{
if (iid == IID_IUnknown || iid == IID_IUnknown || iid == DIID__IiTunesEvents)
{
@ -64,17 +64,17 @@ HRESULT STDMETHODCALLTYPE CPlayerITunes::CEventHandler::QueryInterface(REFIID ii
return E_NOINTERFACE;
}
ULONG STDMETHODCALLTYPE CPlayerITunes::CEventHandler::AddRef()
ULONG STDMETHODCALLTYPE PlayerITunes::CEventHandler::AddRef()
{
return ++m_RefCount;
}
ULONG STDMETHODCALLTYPE CPlayerITunes::CEventHandler::Release()
ULONG STDMETHODCALLTYPE PlayerITunes::CEventHandler::Release()
{
return --m_RefCount;
}
HRESULT STDMETHODCALLTYPE CPlayerITunes::CEventHandler::Invoke(DISPID dispidMember, REFIID, LCID, WORD, DISPPARAMS* dispParams, VARIANT*, EXCEPINFO*, UINT*)
HRESULT STDMETHODCALLTYPE PlayerITunes::CEventHandler::Invoke(DISPID dispidMember, REFIID, LCID, WORD, DISPPARAMS* dispParams, VARIANT*, EXCEPINFO*, UINT*)
{
switch (dispidMember)
{
@ -112,7 +112,7 @@ HRESULT STDMETHODCALLTYPE CPlayerITunes::CEventHandler::Invoke(DISPID dispidMemb
** Constructor.
**
*/
CPlayerITunes::CPlayerITunes() : CPlayer(),
PlayerITunes::PlayerITunes() : Player(),
m_CallbackWindow(),
m_LastCheckTime(0),
m_iTunesActive(false),
@ -144,7 +144,7 @@ CPlayerITunes::CPlayerITunes() : CPlayer(),
** Destructor.
**
*/
CPlayerITunes::~CPlayerITunes()
PlayerITunes::~PlayerITunes()
{
c_Player = NULL;
@ -158,11 +158,11 @@ CPlayerITunes::~CPlayerITunes()
** Creates a shared class object.
**
*/
CPlayer* CPlayerITunes::Create()
Player* PlayerITunes::Create()
{
if (!c_Player)
{
c_Player = new CPlayerITunes();
c_Player = new PlayerITunes();
}
return c_Player;
@ -172,7 +172,7 @@ CPlayer* CPlayerITunes::Create()
** Initialize iTunes COM interface and event handler.
**
*/
void CPlayerITunes::Initialize()
void PlayerITunes::Initialize()
{
while (true)
{
@ -239,7 +239,7 @@ void CPlayerITunes::Initialize()
** Close iTunes COM interface.
**
*/
void CPlayerITunes::Uninitialize()
void PlayerITunes::Uninitialize()
{
if (m_Initialized)
{
@ -255,15 +255,15 @@ void CPlayerITunes::Uninitialize()
** Window procedure for the callback window.
**
*/
LRESULT CALLBACK CPlayerITunes::WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
LRESULT CALLBACK PlayerITunes::WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
static CPlayerITunes* player;
static PlayerITunes* player;
switch (msg)
{
case WM_CREATE:
// Get pointer to the CPlayerITunes class from the CreateWindow call
player = (CPlayerITunes*)(((CREATESTRUCT*)lParam)->lpCreateParams);
// Get pointer to the PlayerITunes class from the CreateWindow call
player = (PlayerITunes*)(((CREATESTRUCT*)lParam)->lpCreateParams);
return 0;
case WM_USER:
@ -294,7 +294,7 @@ LRESULT CALLBACK CPlayerITunes::WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR
** Try to find iTunes periodically.
**
*/
bool CPlayerITunes::CheckWindow()
bool PlayerITunes::CheckWindow()
{
DWORD time = GetTickCount();
if (time - m_LastCheckTime > 5000)
@ -315,7 +315,7 @@ bool CPlayerITunes::CheckWindow()
** Called during each update of the main measure.
**
*/
void CPlayerITunes::UpdateData()
void PlayerITunes::UpdateData()
{
if ((m_Initialized || CheckWindow()) && m_State != STATE_STOPPED)
{
@ -329,7 +329,7 @@ void CPlayerITunes::UpdateData()
** Called by iTunes event handler when the database is changed.
**
*/
void CPlayerITunes::OnDatabaseChange()
void PlayerITunes::OnDatabaseChange()
{
// Check the shuffle state. TODO: Find better way
IITPlaylist* playlist;
@ -351,7 +351,7 @@ void CPlayerITunes::OnDatabaseChange()
** Called by iTunes event handler on track change.
**
*/
void CPlayerITunes::OnTrackChange()
void PlayerITunes::OnTrackChange()
{
IITTrack* track;
HRESULT hr = m_iTunes->get_CurrentTrack(&track);
@ -463,7 +463,7 @@ void CPlayerITunes::OnTrackChange()
** Called by iTunes event handler on player state change.
**
*/
void CPlayerITunes::OnStateChange(bool playing)
void PlayerITunes::OnStateChange(bool playing)
{
if (playing)
{
@ -480,7 +480,7 @@ void CPlayerITunes::OnStateChange(bool playing)
** Called by iTunes event handler on volume change.
**
*/
void CPlayerITunes::OnVolumeChange(int volume)
void PlayerITunes::OnVolumeChange(int volume)
{
m_Volume = volume;
}
@ -489,7 +489,7 @@ void CPlayerITunes::OnVolumeChange(int volume)
** Handles the Pause bang.
**
*/
void CPlayerITunes::Pause()
void PlayerITunes::Pause()
{
m_iTunes->Pause();
}
@ -498,7 +498,7 @@ void CPlayerITunes::Pause()
** Handles the Play bang.
**
*/
void CPlayerITunes::Play()
void PlayerITunes::Play()
{
m_iTunes->Play();
}
@ -507,7 +507,7 @@ void CPlayerITunes::Play()
** Handles the Stop bang.
**
*/
void CPlayerITunes::Stop()
void PlayerITunes::Stop()
{
m_iTunes->Stop();
}
@ -516,7 +516,7 @@ void CPlayerITunes::Stop()
** Handles the Next bang.
**
*/
void CPlayerITunes::Next()
void PlayerITunes::Next()
{
m_iTunes->NextTrack();
}
@ -525,7 +525,7 @@ void CPlayerITunes::Next()
** Handles the Previous bang.
**
*/
void CPlayerITunes::Previous()
void PlayerITunes::Previous()
{
m_iTunes->PreviousTrack();
}
@ -534,7 +534,7 @@ void CPlayerITunes::Previous()
** Handles the SetPosition bang.
**
*/
void CPlayerITunes::SetPosition(int position)
void PlayerITunes::SetPosition(int position)
{
m_iTunes->put_PlayerPosition((long)position);
}
@ -543,7 +543,7 @@ void CPlayerITunes::SetPosition(int position)
** Handles the SetRating bang.
**
*/
void CPlayerITunes::SetRating(int rating)
void PlayerITunes::SetRating(int rating)
{
IITTrack* track;
HRESULT hr = m_iTunes->get_CurrentTrack(&track);
@ -559,7 +559,7 @@ void CPlayerITunes::SetRating(int rating)
** Handles the SetVolume bang.
**
*/
void CPlayerITunes::SetVolume(int volume)
void PlayerITunes::SetVolume(int volume)
{
m_iTunes->put_SoundVolume((long)volume);
}
@ -568,7 +568,7 @@ void CPlayerITunes::SetVolume(int volume)
** Handles the SetShuffle bang.
**
*/
void CPlayerITunes::SetShuffle(bool state)
void PlayerITunes::SetShuffle(bool state)
{
IITTrack* track;
HRESULT hr = m_iTunes->get_CurrentTrack(&track);
@ -593,7 +593,7 @@ void CPlayerITunes::SetShuffle(bool state)
** Handles the SetRepeat bang.
**
*/
void CPlayerITunes::SetRepeat(bool state)
void PlayerITunes::SetRepeat(bool state)
{
IITTrack* track;
HRESULT hr = m_iTunes->get_CurrentTrack(&track);
@ -617,7 +617,7 @@ void CPlayerITunes::SetRepeat(bool state)
** Handles the ClosePlayer bang.
**
*/
void CPlayerITunes::ClosePlayer()
void PlayerITunes::ClosePlayer()
{
m_iTunes->Quit();
Uninitialize();
@ -628,7 +628,7 @@ void CPlayerITunes::ClosePlayer()
** Handles the OpenPlayer bang.
**
*/
void CPlayerITunes::OpenPlayer(std::wstring& path)
void PlayerITunes::OpenPlayer(std::wstring& path)
{
ShellExecute(NULL, L"open", path.empty() ? L"iTunes.exe" : path.c_str(), NULL, NULL, SW_SHOW);
}

View File

@ -24,12 +24,12 @@
const int TIMER_CHECKACTIVE = 1;
class CPlayerITunes : public CPlayer
class PlayerITunes : public Player
{
public:
virtual ~CPlayerITunes();
virtual ~PlayerITunes();
static CPlayer* Create();
static Player* Create();
virtual void UpdateData();
@ -47,13 +47,13 @@ public:
virtual void OpenPlayer(std::wstring& path);
protected:
CPlayerITunes();
PlayerITunes();
private:
class CEventHandler : public _IiTunesEvents
{
public:
CEventHandler(CPlayerITunes* player);
CEventHandler(PlayerITunes* player);
~CEventHandler();
// IUnknown
@ -69,7 +69,7 @@ private:
private:
ULONG m_RefCount;
CPlayerITunes* m_Player;
PlayerITunes* m_Player;
IConnectionPoint* m_ConnectionPoint;
DWORD m_ConnectionCookie;
};
@ -84,7 +84,7 @@ private:
static LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
static CPlayer* c_Player;
static Player* c_Player;
HWND m_CallbackWindow;
DWORD m_LastCheckTime;

View File

@ -19,13 +19,13 @@
#include "StdAfx.h"
#include "PlayerSpotify.h"
CPlayer* CPlayerSpotify::c_Player = NULL;
Player* PlayerSpotify::c_Player = NULL;
/*
** Constructor.
**
*/
CPlayerSpotify::CPlayerSpotify() : CPlayer(),
PlayerSpotify::PlayerSpotify() : Player(),
m_Window(),
m_LastCheckTime(0)
{
@ -35,7 +35,7 @@ CPlayerSpotify::CPlayerSpotify() : CPlayer(),
** Destructor.
**
*/
CPlayerSpotify::~CPlayerSpotify()
PlayerSpotify::~PlayerSpotify()
{
c_Player = NULL;
}
@ -44,11 +44,11 @@ CPlayerSpotify::~CPlayerSpotify()
** Creates a shared class object.
**
*/
CPlayer* CPlayerSpotify::Create()
Player* PlayerSpotify::Create()
{
if (!c_Player)
{
c_Player = new CPlayerSpotify();
c_Player = new PlayerSpotify();
}
return c_Player;
@ -58,7 +58,7 @@ CPlayer* CPlayerSpotify::Create()
** Try to find Spotify periodically.
**
*/
bool CPlayerSpotify::CheckWindow()
bool PlayerSpotify::CheckWindow()
{
DWORD time = GetTickCount();
@ -81,7 +81,7 @@ bool CPlayerSpotify::CheckWindow()
** Called during each update of the main measure.
**
*/
void CPlayerSpotify::UpdateData()
void PlayerSpotify::UpdateData()
{
if (m_Initialized || CheckWindow())
{
@ -129,7 +129,7 @@ void CPlayerSpotify::UpdateData()
** Handles the Play bang.
**
*/
void CPlayerSpotify::Play()
void PlayerSpotify::Play()
{
SendMessage(m_Window, WM_APPCOMMAND, 0, SPOTIFY_PLAYPAUSE);
}
@ -138,7 +138,7 @@ void CPlayerSpotify::Play()
** Handles the Stop bang.
**
*/
void CPlayerSpotify::Stop()
void PlayerSpotify::Stop()
{
SendMessage(m_Window, WM_APPCOMMAND, 0, SPOTIFY_STOP);
}
@ -147,7 +147,7 @@ void CPlayerSpotify::Stop()
** Handles the Next bang.
**
*/
void CPlayerSpotify::Next()
void PlayerSpotify::Next()
{
SendMessage(m_Window, WM_APPCOMMAND, 0, SPOTIFY_NEXT);
}
@ -156,7 +156,7 @@ void CPlayerSpotify::Next()
** Handles the Previous bang.
**
*/
void CPlayerSpotify::Previous()
void PlayerSpotify::Previous()
{
SendMessage(m_Window, WM_APPCOMMAND, 0, SPOTIFY_PREV);
}
@ -166,7 +166,7 @@ void CPlayerSpotify::Previous()
** Handles the ClosePlayer bang.
**
*/
void CPlayerSpotify::ClosePlayer()
void PlayerSpotify::ClosePlayer()
{
// A little harsh...
DWORD pID;
@ -183,7 +183,7 @@ void CPlayerSpotify::ClosePlayer()
** Handles the OpenPlayer bang.
**
*/
void CPlayerSpotify::OpenPlayer(std::wstring& path)
void PlayerSpotify::OpenPlayer(std::wstring& path)
{
if (!m_Initialized)
{

View File

@ -21,12 +21,12 @@
#include "Player.h"
class CPlayerSpotify : public CPlayer
class PlayerSpotify : public Player
{
public:
virtual ~CPlayerSpotify();
virtual ~PlayerSpotify();
static CPlayer* Create();
static Player* Create();
virtual void Pause() { return Play(); }
virtual void Play();
@ -38,7 +38,7 @@ public:
virtual void UpdateData();
protected:
CPlayerSpotify();
PlayerSpotify();
private:
enum SPOTIFYCOMMAND
@ -54,7 +54,7 @@ private:
bool CheckWindow();
static CPlayer* c_Player;
static Player* c_Player;
HWND m_Window;
DWORD m_LastCheckTime;

View File

@ -19,7 +19,7 @@
#include "StdAfx.h"
#include "PlayerWLM.h"
CPlayer* CPlayerWLM::c_Player = NULL;
Player* PlayerWLM::c_Player = NULL;
extern HINSTANCE g_Instance;
// This player emulates the MSN/WLM Messenger 'Listening to' interface, which is
@ -29,7 +29,7 @@ extern HINSTANCE g_Instance;
** Constructor.
**
*/
CPlayerWLM::CPlayerWLM() : CPlayer(),
PlayerWLM::PlayerWLM() : Player(),
m_Window()
{
// Create windows class
@ -59,7 +59,7 @@ CPlayerWLM::CPlayerWLM() : CPlayer(),
** Destructor.
**
*/
CPlayerWLM::~CPlayerWLM()
PlayerWLM::~PlayerWLM()
{
c_Player = NULL;
DestroyWindow(m_Window);
@ -70,26 +70,26 @@ CPlayerWLM::~CPlayerWLM()
** Creates a shared class object.
**
*/
CPlayer* CPlayerWLM::Create()
Player* PlayerWLM::Create()
{
if (!c_Player)
{
c_Player = new CPlayerWLM();
c_Player = new PlayerWLM();
}
return c_Player;
}
LRESULT CALLBACK CPlayerWLM::WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
LRESULT CALLBACK PlayerWLM::WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
static CPlayerWLM* player;
static PlayerWLM* player;
switch (msg)
{
case WM_CREATE:
{
// Get pointer to the CPlayerWLM class from the CreateWindow call
player = (CPlayerWLM*)((CREATESTRUCT*)lParam)->lpCreateParams;
// Get pointer to the PlayerWLM class from the CreateWindow call
player = (PlayerWLM*)((CREATESTRUCT*)lParam)->lpCreateParams;
return 0;
}
@ -149,7 +149,7 @@ LRESULT CALLBACK CPlayerWLM::WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM
return DefWindowProc(hWnd, msg, wParam, lParam);
}
void CPlayerWLM::SendKeyInput(WORD key)
void PlayerWLM::SendKeyInput(WORD key)
{
KEYBDINPUT kbi = {0};
kbi.wVk = key;
@ -166,7 +166,7 @@ void CPlayerWLM::SendKeyInput(WORD key)
** Called during each update of the main measure.
**
*/
void CPlayerWLM::UpdateData()
void PlayerWLM::UpdateData()
{
}
@ -174,7 +174,7 @@ void CPlayerWLM::UpdateData()
** Handles the Play bang.
**
*/
void CPlayerWLM::Play()
void PlayerWLM::Play()
{
SendKeyInput(VK_MEDIA_PLAY_PAUSE);
}
@ -183,7 +183,7 @@ void CPlayerWLM::Play()
** Handles the Stop bang.
**
*/
void CPlayerWLM::Stop()
void PlayerWLM::Stop()
{
SendKeyInput(VK_MEDIA_STOP);
}
@ -192,7 +192,7 @@ void CPlayerWLM::Stop()
** Handles the Next bang.
**
*/
void CPlayerWLM::Next()
void PlayerWLM::Next()
{
SendKeyInput(VK_MEDIA_NEXT_TRACK);
}
@ -201,7 +201,7 @@ void CPlayerWLM::Next()
** Handles the Previous bang.
**
*/
void CPlayerWLM::Previous()
void PlayerWLM::Previous()
{
SendKeyInput(VK_MEDIA_PREV_TRACK);
}

View File

@ -21,12 +21,12 @@
#include "Player.h"
class CPlayerWLM : public CPlayer
class PlayerWLM : public Player
{
public:
virtual ~CPlayerWLM();
virtual ~PlayerWLM();
static CPlayer* Create();
static Player* Create();
virtual void UpdateData();
@ -37,13 +37,13 @@ public:
virtual void Previous();
protected:
CPlayerWLM();
PlayerWLM();
private:
static LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
void SendKeyInput(WORD key);
static CPlayer* c_Player;
static Player* c_Player;
HWND m_Window;
};

View File

@ -19,7 +19,7 @@
#include "StdAfx.h"
#include "PlayerWMP.h"
CPlayer* CPlayerWMP::c_Player = NULL;
Player* PlayerWMP::c_Player = NULL;
extern HINSTANCE g_Instance;
namespace {
@ -62,26 +62,26 @@ HMODULE InitializeAtlLibrary()
} // namespace
//
// CPlayerWMP::CRemoteHost
// PlayerWMP::CRemoteHost
//
CPlayerWMP::CRemoteHost::CRemoteHost() :
PlayerWMP::CRemoteHost::CRemoteHost() :
m_Player(),
m_RefCount(0)
{
}
CPlayerWMP::CRemoteHost::~CRemoteHost()
PlayerWMP::CRemoteHost::~CRemoteHost()
{
}
ULONG STDMETHODCALLTYPE CPlayerWMP::CRemoteHost::AddRef()
ULONG STDMETHODCALLTYPE PlayerWMP::CRemoteHost::AddRef()
{
++m_RefCount;
return m_RefCount;
}
ULONG STDMETHODCALLTYPE CPlayerWMP::CRemoteHost::Release()
ULONG STDMETHODCALLTYPE PlayerWMP::CRemoteHost::Release()
{
--m_RefCount;
if (m_RefCount == 0)
@ -92,7 +92,7 @@ ULONG STDMETHODCALLTYPE CPlayerWMP::CRemoteHost::Release()
return m_RefCount;
}
HRESULT STDMETHODCALLTYPE CPlayerWMP::CRemoteHost::QueryInterface(IID const& riid, void** object)
HRESULT STDMETHODCALLTYPE PlayerWMP::CRemoteHost::QueryInterface(IID const& riid, void** object)
{
if (!object)
{
@ -122,24 +122,24 @@ HRESULT STDMETHODCALLTYPE CPlayerWMP::CRemoteHost::QueryInterface(IID const& rii
return S_OK;
}
HRESULT CPlayerWMP::CRemoteHost::QueryService(REFGUID guidService, REFIID riid, void** ppv)
HRESULT PlayerWMP::CRemoteHost::QueryService(REFGUID guidService, REFIID riid, void** ppv)
{
return QueryInterface(riid, ppv);
}
HRESULT CPlayerWMP::CRemoteHost::GetServiceType(BSTR* pbstrType)
HRESULT PlayerWMP::CRemoteHost::GetServiceType(BSTR* pbstrType)
{
*pbstrType = SysAllocString(L"RemoteNoDialogs");
return *pbstrType ? S_OK : E_POINTER;
}
HRESULT CPlayerWMP::CRemoteHost::GetApplicationName(BSTR* pbstrName)
HRESULT PlayerWMP::CRemoteHost::GetApplicationName(BSTR* pbstrName)
{
*pbstrName = SysAllocString(L"Rainmeter NowPlaying");
return *pbstrName ? S_OK : E_POINTER;
}
HRESULT CPlayerWMP::CRemoteHost::GetScriptableObject(BSTR* pbstrName, IDispatch** ppDispatch)
HRESULT PlayerWMP::CRemoteHost::GetScriptableObject(BSTR* pbstrName, IDispatch** ppDispatch)
{
if (pbstrName)
{
@ -152,7 +152,7 @@ HRESULT CPlayerWMP::CRemoteHost::GetScriptableObject(BSTR* pbstrName, IDispatch*
return E_NOTIMPL;
}
HRESULT CPlayerWMP::CRemoteHost::GetCustomUIMode(BSTR* pbstrFile)
HRESULT PlayerWMP::CRemoteHost::GetCustomUIMode(BSTR* pbstrFile)
{
return E_POINTER;
}
@ -161,7 +161,7 @@ HRESULT CPlayerWMP::CRemoteHost::GetCustomUIMode(BSTR* pbstrFile)
** Called when playing track changes.
**
*/
void CPlayerWMP::CRemoteHost::CurrentItemChange(IDispatch* pdispMedia)
void PlayerWMP::CRemoteHost::CurrentItemChange(IDispatch* pdispMedia)
{
m_Player->m_TrackChanged = true;
}
@ -170,7 +170,7 @@ void CPlayerWMP::CRemoteHost::CurrentItemChange(IDispatch* pdispMedia)
** Called when play state changes.
**
*/
void CPlayerWMP::CRemoteHost::PlayStateChange(long NewState)
void PlayerWMP::CRemoteHost::PlayStateChange(long NewState)
{
switch (NewState)
{
@ -200,17 +200,17 @@ void CPlayerWMP::CRemoteHost::PlayStateChange(long NewState)
** Called when WMP quits.
**
*/
void CPlayerWMP::CRemoteHost::SwitchedToControl()
void PlayerWMP::CRemoteHost::SwitchedToControl()
{
m_Player->ClearData();
m_Player->Uninitialize();
}
//
// CPlayerWMP
// PlayerWMP
//
CPlayerWMP::CPlayerWMP() : CPlayer(),
PlayerWMP::PlayerWMP() : Player(),
m_TrackChanged(false),
m_Window(),
m_LastCheckTime(0),
@ -218,7 +218,7 @@ CPlayerWMP::CPlayerWMP() : CPlayer(),
{
}
CPlayerWMP::~CPlayerWMP()
PlayerWMP::~PlayerWMP()
{
c_Player = NULL;
Uninitialize();
@ -228,11 +228,11 @@ CPlayerWMP::~CPlayerWMP()
** Creates a shared class object.
**
*/
CPlayer* CPlayerWMP::Create()
Player* PlayerWMP::Create()
{
if (!c_Player)
{
c_Player = new CPlayerWMP();
c_Player = new PlayerWMP();
}
return c_Player;
@ -242,7 +242,7 @@ CPlayer* CPlayerWMP::Create()
** Set up the COM interface with WMP.
**
*/
void CPlayerWMP::Initialize()
void PlayerWMP::Initialize()
{
HMODULE atl = InitializeAtlLibrary();
if (!atl)
@ -372,7 +372,7 @@ void CPlayerWMP::Initialize()
** Close the interface with WMP.
**
*/
void CPlayerWMP::Uninitialize()
void PlayerWMP::Uninitialize()
{
if (m_Initialized)
{
@ -397,7 +397,7 @@ void CPlayerWMP::Uninitialize()
** Called during each update of the main measure.
**
*/
void CPlayerWMP::UpdateData()
void PlayerWMP::UpdateData()
{
if (m_Initialized)
{
@ -525,7 +525,7 @@ void CPlayerWMP::UpdateData()
** Handles the Pause bang.
**
*/
void CPlayerWMP::Pause()
void PlayerWMP::Pause()
{
m_IControls->pause();
}
@ -534,7 +534,7 @@ void CPlayerWMP::Pause()
** Handles the Play bang.
**
*/
void CPlayerWMP::Play()
void PlayerWMP::Play()
{
m_IControls->play();
}
@ -543,7 +543,7 @@ void CPlayerWMP::Play()
** Handles the Stop bang.
**
*/
void CPlayerWMP::Stop()
void PlayerWMP::Stop()
{
m_IControls->stop();
// TODO: FIXME
@ -554,7 +554,7 @@ void CPlayerWMP::Stop()
** Handles the Next bang.
**
*/
void CPlayerWMP::Next()
void PlayerWMP::Next()
{
m_IControls->next();
}
@ -563,7 +563,7 @@ void CPlayerWMP::Next()
** Handles the Previous bang.
**
*/
void CPlayerWMP::Previous()
void PlayerWMP::Previous()
{
m_IControls->previous();
}
@ -572,7 +572,7 @@ void CPlayerWMP::Previous()
** Handles the SetPosition bang.
**
*/
void CPlayerWMP::SetPosition(int position)
void PlayerWMP::SetPosition(int position)
{
m_IControls->put_currentPosition((double)position);
}
@ -581,7 +581,7 @@ void CPlayerWMP::SetPosition(int position)
** Handles the SetRating bang.
**
*/
void CPlayerWMP::SetRating(int rating)
void PlayerWMP::SetRating(int rating)
{
if (m_State != STATE_STOPPED)
{
@ -628,7 +628,7 @@ void CPlayerWMP::SetRating(int rating)
** Handles the SetVolume bang.
**
*/
void CPlayerWMP::SetVolume(int volume)
void PlayerWMP::SetVolume(int volume)
{
m_ISettings->put_volume(volume);
}
@ -637,7 +637,7 @@ void CPlayerWMP::SetVolume(int volume)
** Handles the ClosePlayer bang.
**
*/
void CPlayerWMP::ClosePlayer()
void PlayerWMP::ClosePlayer()
{
HWND wnd = FindWindow(L"WMPlayerApp", NULL);
@ -651,7 +651,7 @@ void CPlayerWMP::ClosePlayer()
** Handles the OpenPlayer bang.
**
*/
void CPlayerWMP::OpenPlayer(std::wstring& path)
void PlayerWMP::OpenPlayer(std::wstring& path)
{
ShellExecute(NULL, L"open", path.empty() ? L"wmplayer.exe" : path.c_str(), NULL, NULL, SW_SHOW);
}

View File

@ -23,12 +23,12 @@
#include <wmp.h>
#include <wrl/client.h>
class CPlayerWMP : public CPlayer
class PlayerWMP : public Player
{
public:
virtual ~CPlayerWMP();
virtual ~PlayerWMP();
static CPlayer* Create();
static Player* Create();
virtual void UpdateData();
@ -44,7 +44,7 @@ public:
virtual void ClosePlayer();
protected:
CPlayerWMP();
PlayerWMP();
private:
class CRemoteHost :
@ -56,7 +56,7 @@ private:
CRemoteHost();
~CRemoteHost();
CPlayerWMP* m_Player;
PlayerWMP* m_Player;
IUnknown* GetUnknown() const { return (IServiceProvider*)this; }
@ -128,7 +128,7 @@ private:
void Initialize();
void Uninitialize();
static CPlayer* c_Player;
static Player* c_Player;
bool m_TrackChanged;
HWND m_Window;

View File

@ -22,7 +22,7 @@
#include "Winamp/wa_ipc.h"
#include "Winamp/wa_cmd.h"
CPlayer* CPlayerWinamp::c_Player = NULL;
Player* PlayerWinamp::c_Player = NULL;
// This player retrieves data through the Winamp IPC interface.
@ -30,7 +30,7 @@ CPlayer* CPlayerWinamp::c_Player = NULL;
** Constructor.
**
*/
CPlayerWinamp::CPlayerWinamp(WINAMPTYPE type) : CPlayer(),
PlayerWinamp::PlayerWinamp(WINAMPTYPE type) : Player(),
m_Window(),
m_LastCheckTime(0),
m_UseUnicodeAPI(false),
@ -45,7 +45,7 @@ CPlayerWinamp::CPlayerWinamp(WINAMPTYPE type) : CPlayer(),
** Destructor.
**
*/
CPlayerWinamp::~CPlayerWinamp()
PlayerWinamp::~PlayerWinamp()
{
c_Player = NULL;
if (m_WinampHandle) CloseHandle(m_WinampHandle);
@ -55,11 +55,11 @@ CPlayerWinamp::~CPlayerWinamp()
** Creates a shared class object.
**
*/
CPlayer* CPlayerWinamp::Create(WINAMPTYPE type)
Player* PlayerWinamp::Create(WINAMPTYPE type)
{
if (!c_Player)
{
c_Player = new CPlayerWinamp(type);
c_Player = new PlayerWinamp(type);
}
return c_Player;
@ -69,7 +69,7 @@ CPlayer* CPlayerWinamp::Create(WINAMPTYPE type)
** Try to find Winamp periodically.
**
*/
bool CPlayerWinamp::CheckWindow()
bool PlayerWinamp::CheckWindow()
{
DWORD time = GetTickCount();
@ -101,7 +101,7 @@ bool CPlayerWinamp::CheckWindow()
** Called during each update of the main measure.
**
*/
void CPlayerWinamp::UpdateData()
void PlayerWinamp::UpdateData()
{
if (m_Initialized || CheckWindow())
{
@ -323,7 +323,7 @@ void CPlayerWinamp::UpdateData()
** Handles the Pause bang.
**
*/
void CPlayerWinamp::Pause()
void PlayerWinamp::Pause()
{
SendMessage(m_Window, WM_COMMAND, WINAMP_PAUSE, 0);
}
@ -332,7 +332,7 @@ void CPlayerWinamp::Pause()
** Handles the Play bang.
**
*/
void CPlayerWinamp::Play()
void PlayerWinamp::Play()
{
SendMessage(m_Window, WM_COMMAND, WINAMP_PLAY, 0);
}
@ -341,7 +341,7 @@ void CPlayerWinamp::Play()
** Handles the Stop bang.
**
*/
void CPlayerWinamp::Stop()
void PlayerWinamp::Stop()
{
SendMessage(m_Window, WM_COMMAND, WINAMP_STOP, 0);
}
@ -350,7 +350,7 @@ void CPlayerWinamp::Stop()
** Handles the Next bang.
**
*/
void CPlayerWinamp::Next()
void PlayerWinamp::Next()
{
SendMessage(m_Window, WM_COMMAND, WINAMP_FASTFWD, 0);
}
@ -359,7 +359,7 @@ void CPlayerWinamp::Next()
** Handles the Previous bang.
**
*/
void CPlayerWinamp::Previous()
void PlayerWinamp::Previous()
{
SendMessage(m_Window, WM_COMMAND, WINAMP_REWIND, 0);
}
@ -368,7 +368,7 @@ void CPlayerWinamp::Previous()
** Handles the SetPosition bang.
**
*/
void CPlayerWinamp::SetPosition(int position)
void PlayerWinamp::SetPosition(int position)
{
position *= 1000; // To milliseconds
SendMessage(m_Window, WM_WA_IPC, position, IPC_JUMPTOTIME);
@ -378,7 +378,7 @@ void CPlayerWinamp::SetPosition(int position)
** Handles the SetRating bang.
**
*/
void CPlayerWinamp::SetRating(int rating)
void PlayerWinamp::SetRating(int rating)
{
if (rating < 0)
{
@ -397,7 +397,7 @@ void CPlayerWinamp::SetRating(int rating)
** Handles the SetVolume bang.
**
*/
void CPlayerWinamp::SetVolume(int volume)
void PlayerWinamp::SetVolume(int volume)
{
// Winamp accepts volume in 0 - 255 range
float fVolume = volume * 2.55f;
@ -408,7 +408,7 @@ void CPlayerWinamp::SetVolume(int volume)
** Handles the SetShuffle bang.
**
*/
void CPlayerWinamp::SetShuffle(bool state)
void PlayerWinamp::SetShuffle(bool state)
{
if (!m_PlayingStream)
{
@ -421,7 +421,7 @@ void CPlayerWinamp::SetShuffle(bool state)
** Handles the SetRepeat bang.
**
*/
void CPlayerWinamp::SetRepeat(bool state)
void PlayerWinamp::SetRepeat(bool state)
{
if (!m_PlayingStream)
{
@ -434,7 +434,7 @@ void CPlayerWinamp::SetRepeat(bool state)
** Handles the ClosePlayer bang.
**
*/
void CPlayerWinamp::ClosePlayer()
void PlayerWinamp::ClosePlayer()
{
if (m_WinampType == WA_WINAMP)
{
@ -454,7 +454,7 @@ void CPlayerWinamp::ClosePlayer()
** Handles the OpenPlayer bang.
**
*/
void CPlayerWinamp::OpenPlayer(std::wstring& path)
void PlayerWinamp::OpenPlayer(std::wstring& path)
{
if (m_WinampType == WA_WINAMP)
{

View File

@ -27,12 +27,12 @@ enum WINAMPTYPE
WA_MEDIAMONKEY
};
class CPlayerWinamp : public CPlayer
class PlayerWinamp : public Player
{
public:
virtual ~CPlayerWinamp();
virtual ~PlayerWinamp();
static CPlayer* Create(WINAMPTYPE type);
static Player* Create(WINAMPTYPE type);
virtual void UpdateData();
@ -50,12 +50,12 @@ public:
virtual void OpenPlayer(std::wstring& path);
protected:
CPlayerWinamp(WINAMPTYPE type);
PlayerWinamp(WINAMPTYPE type);
private:
bool CheckWindow();
static CPlayer* c_Player;
static Player* c_Player;
HWND m_Window; // Winamp window
DWORD m_LastCheckTime;

View File

@ -30,9 +30,9 @@
struct MeasureData
{
CRawString objectName;
CRawString counterName;
CRawString instanceName;
RawString objectName;
RawString counterName;
RawString instanceName;
ULONGLONG oldValue;
bool difference;
bool firstTime;

View File

@ -50,7 +50,7 @@ enum MeasureType
struct MeasureData
{
MeasureType type;
CRawString format;
RawString format;
MeasureData() : type(POWER_UNKNOWN) {}
};

View File

@ -26,7 +26,7 @@
struct MeasureData
{
CRawString processName;
RawString processName;
bool isRunning;
MeasureData() : isRunning(false) {}

View File

@ -42,7 +42,7 @@ enum MEASURETYPE
struct MeasureData
{
MEASURETYPE type;
CRawString process;
RawString process;
MeasureData() : type(GDI_COUNT) {}
};

View File

@ -24,9 +24,9 @@
struct MeasureData
{
CRawString windowName;
CRawString windowClass;
CRawString value;
RawString windowName;
RawString windowClass;
RawString value;
WPARAM wParam;
LPARAM lParam;
DWORD uMsg;