mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
NowPlaying.dll:
- Fixed that album name and cover were not always displayed with Winamp due to r1018 - Shuffle and repeat state is now rechecked on track change with iTunes - Improved performance when reading file tags/cover - Updated iTunes SDK files
This commit is contained in:
parent
8cb0a041e0
commit
f84491ec83
@ -102,30 +102,7 @@ void CSystem::Initialize(HINSTANCE instance)
|
|||||||
SetWindowPos(c_Window, HWND_BOTTOM, 0, 0, 0, 0, ZPOS_FLAGS);
|
SetWindowPos(c_Window, HWND_BOTTOM, 0, 0, 0, 0, ZPOS_FLAGS);
|
||||||
SetWindowPos(c_HelperWindow, HWND_BOTTOM, 0, 0, 0, 0, ZPOS_FLAGS);
|
SetWindowPos(c_HelperWindow, HWND_BOTTOM, 0, 0, 0, 0, ZPOS_FLAGS);
|
||||||
|
|
||||||
OSVERSIONINFOEX osvi = {sizeof(OSVERSIONINFOEX)};
|
SetOSPlatform();
|
||||||
if (GetVersionEx((OSVERSIONINFO*)&osvi))
|
|
||||||
{
|
|
||||||
if (osvi.dwMajorVersion == 5)
|
|
||||||
{
|
|
||||||
// Not checking for osvi.dwMinorVersion >= 1 because Rainmeter won't run on pre-XP
|
|
||||||
c_Platform = OSPLATFORM_XP;
|
|
||||||
}
|
|
||||||
else if (osvi.dwMajorVersion == 6)
|
|
||||||
{
|
|
||||||
if (osvi.dwMinorVersion == 0)
|
|
||||||
{
|
|
||||||
c_Platform = OSPLATFORM_VISTA; // Vista, Server 2008
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
c_Platform = OSPLATFORM_7; // 7, Server 2008R2
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else // newer OS
|
|
||||||
{
|
|
||||||
c_Platform = OSPLATFORM_7;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
c_Monitors.monitors.reserve(8);
|
c_Monitors.monitors.reserve(8);
|
||||||
SetMultiMonitorInfo();
|
SetMultiMonitorInfo();
|
||||||
@ -564,6 +541,40 @@ void CSystem::UpdateWorkareaInfo()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
** SetOSPlatform
|
||||||
|
**
|
||||||
|
** Sets the OS platform.
|
||||||
|
**
|
||||||
|
*/
|
||||||
|
void CSystem::SetOSPlatform()
|
||||||
|
{
|
||||||
|
OSVERSIONINFOEX osvi = {sizeof(OSVERSIONINFOEX)};
|
||||||
|
if (GetVersionEx((OSVERSIONINFO*)&osvi))
|
||||||
|
{
|
||||||
|
if (osvi.dwMajorVersion == 5)
|
||||||
|
{
|
||||||
|
// Not checking for osvi.dwMinorVersion >= 1 because Rainmeter won't run on pre-XP
|
||||||
|
c_Platform = OSPLATFORM_XP;
|
||||||
|
}
|
||||||
|
else if (osvi.dwMajorVersion == 6)
|
||||||
|
{
|
||||||
|
if (osvi.dwMinorVersion == 0)
|
||||||
|
{
|
||||||
|
c_Platform = OSPLATFORM_VISTA; // Vista, Server 2008
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
c_Platform = OSPLATFORM_7; // 7, Server 2008R2
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else // newer OS
|
||||||
|
{
|
||||||
|
c_Platform = OSPLATFORM_7;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** GetDefaultShellWindow
|
** GetDefaultShellWindow
|
||||||
**
|
**
|
||||||
|
@ -97,6 +97,8 @@ private:
|
|||||||
static void ClearMultiMonitorInfo() { c_Monitors.monitors.clear(); }
|
static void ClearMultiMonitorInfo() { c_Monitors.monitors.clear(); }
|
||||||
static void UpdateWorkareaInfo();
|
static void UpdateWorkareaInfo();
|
||||||
|
|
||||||
|
static void SetOSPlatform();
|
||||||
|
|
||||||
static HWND GetDefaultShellWindow();
|
static HWND GetDefaultShellWindow();
|
||||||
static HWND GetWorkerW();
|
static HWND GetWorkerW();
|
||||||
static void ChangeZPosInOrder();
|
static void ChangeZPosInOrder();
|
||||||
|
@ -407,31 +407,31 @@ LPCTSTR GetString(UINT id, UINT flags)
|
|||||||
return buffer;
|
return buffer;
|
||||||
|
|
||||||
case MEASURE_PROGRESS:
|
case MEASURE_PROGRESS:
|
||||||
_itow(player->GetDuration() ? ((player->GetPosition() * 100) / player->GetDuration()) : 0, buffer, 10);
|
_itow_s(player->GetDuration() ? ((player->GetPosition() * 100) / player->GetDuration()) : 0, buffer, 10);
|
||||||
return buffer;
|
return buffer;
|
||||||
|
|
||||||
case MEASURE_RATING:
|
case MEASURE_RATING:
|
||||||
_itow(player->GetRating(), buffer, 10);
|
_itow_s(player->GetRating(), buffer, 10);
|
||||||
return buffer;
|
return buffer;
|
||||||
|
|
||||||
case MEASURE_VOLUME:
|
case MEASURE_VOLUME:
|
||||||
_itow(player->GetVolume(), buffer, 10);
|
_itow_s(player->GetVolume(), buffer, 10);
|
||||||
return buffer;
|
return buffer;
|
||||||
|
|
||||||
case MEASURE_STATE:
|
case MEASURE_STATE:
|
||||||
_itow(player->GetState(), buffer, 10);
|
_itow_s(player->GetState(), buffer, 10);
|
||||||
return buffer;
|
return buffer;
|
||||||
|
|
||||||
case MEASURE_STATUS:
|
case MEASURE_STATUS:
|
||||||
_itow((int)player->IsInitialized(), buffer, 10);
|
_itow_s((int)player->IsInitialized(), buffer, 10);
|
||||||
return buffer;
|
return buffer;
|
||||||
|
|
||||||
case MEASURE_SHUFFLE:
|
case MEASURE_SHUFFLE:
|
||||||
_itow((int)player->GetShuffle(), buffer, 10);
|
_itow_s((int)player->GetShuffle(), buffer, 10);
|
||||||
return buffer;
|
return buffer;
|
||||||
|
|
||||||
case MEASURE_REPEAT:
|
case MEASURE_REPEAT:
|
||||||
_itow((int)player->GetRepeat(), buffer, 10);
|
_itow_s((int)player->GetRepeat(), buffer, 10);
|
||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -440,7 +440,7 @@ LPCTSTR GetString(UINT id, UINT flags)
|
|||||||
return L"Error: Invalid player name";
|
return L"Error: Invalid player name";
|
||||||
}
|
}
|
||||||
|
|
||||||
return L"";
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -124,7 +124,7 @@ void CPlayer::UpdateMeasure()
|
|||||||
*/
|
*/
|
||||||
void CPlayer::FindCover()
|
void CPlayer::FindCover()
|
||||||
{
|
{
|
||||||
TagLib::FileRef fr(m_FilePath.c_str());
|
TagLib::FileRef fr(m_FilePath.c_str(), false);
|
||||||
if (!fr.isNull() && CCover::GetEmbedded(fr, m_TempCoverPath))
|
if (!fr.isNull() && CCover::GetEmbedded(fr, m_TempCoverPath))
|
||||||
{
|
{
|
||||||
m_CoverPath = m_TempCoverPath;
|
m_CoverPath = m_TempCoverPath;
|
||||||
|
@ -372,6 +372,27 @@ void CPlayerITunes::OnTrackChange()
|
|||||||
tmpVal /= 20L;
|
tmpVal /= 20L;
|
||||||
m_Rating = (UINT)tmpVal;
|
m_Rating = (UINT)tmpVal;
|
||||||
|
|
||||||
|
IITPlaylist* playlist;
|
||||||
|
hr = track->get_Playlist(&playlist);
|
||||||
|
if (SUCCEEDED(hr))
|
||||||
|
{
|
||||||
|
VARIANT_BOOL shuffle;
|
||||||
|
hr = playlist->get_Shuffle(&shuffle);
|
||||||
|
if (SUCCEEDED(hr))
|
||||||
|
{
|
||||||
|
m_Shuffle = (bool)shuffle;
|
||||||
|
}
|
||||||
|
|
||||||
|
ITPlaylistRepeatMode repeat;
|
||||||
|
hr = playlist->get_SongRepeat(&repeat);
|
||||||
|
if (SUCCEEDED(hr))
|
||||||
|
{
|
||||||
|
m_Repeat = (bool)repeat;
|
||||||
|
}
|
||||||
|
|
||||||
|
playlist->Release();
|
||||||
|
}
|
||||||
|
|
||||||
IITFileOrCDTrack* file;
|
IITFileOrCDTrack* file;
|
||||||
hr = track->QueryInterface(&file);
|
hr = track->QueryInterface(&file);
|
||||||
if (SUCCEEDED(hr))
|
if (SUCCEEDED(hr))
|
||||||
|
@ -178,7 +178,7 @@ void CPlayerWinamp::UpdateData()
|
|||||||
m_Shuffle = (bool)SendMessage(m_Window, WM_WA_IPC, 0, IPC_GET_SHUFFLE);
|
m_Shuffle = (bool)SendMessage(m_Window, WM_WA_IPC, 0, IPC_GET_SHUFFLE);
|
||||||
m_Repeat = (bool)SendMessage(m_Window, WM_WA_IPC, 0, IPC_GET_REPEAT);
|
m_Repeat = (bool)SendMessage(m_Window, WM_WA_IPC, 0, IPC_GET_REPEAT);
|
||||||
|
|
||||||
TagLib::FileRef fr(wBuffer);
|
TagLib::FileRef fr(wBuffer, false);
|
||||||
TagLib::Tag* tag = fr.tag();
|
TagLib::Tag* tag = fr.tag();
|
||||||
if (tag)
|
if (tag)
|
||||||
{
|
{
|
||||||
@ -207,7 +207,7 @@ void CPlayerWinamp::UpdateData()
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::wstring trackFolder = CCover::GetFileFolder(m_FilePath);
|
std::wstring trackFolder = CCover::GetFileFolder(m_FilePath);
|
||||||
if (!m_Album.empty())
|
if (tag && !m_Album.empty())
|
||||||
{
|
{
|
||||||
// Winamp stores covers usually as %album%.jpg
|
// Winamp stores covers usually as %album%.jpg
|
||||||
std::wstring file = m_Album;
|
std::wstring file = m_Album;
|
||||||
@ -257,7 +257,8 @@ void CPlayerWinamp::UpdateData()
|
|||||||
m_CoverPath.clear();
|
m_CoverPath.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (tag)
|
|
||||||
|
if (tag)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
VS_VERSION_INFO VERSIONINFO
|
VS_VERSION_INFO VERSIONINFO
|
||||||
FILEVERSION 1,1,3,6
|
FILEVERSION 1,1,3,7
|
||||||
PRODUCTVERSION PRODUCTVER
|
PRODUCTVERSION PRODUCTVER
|
||||||
FILEFLAGSMASK 0x17L
|
FILEFLAGSMASK 0x17L
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
@ -29,7 +29,7 @@ BEGIN
|
|||||||
BLOCK "040904E4"
|
BLOCK "040904E4"
|
||||||
BEGIN
|
BEGIN
|
||||||
VALUE "FileDescription", "NowPlaying Plugin for Rainmeter"
|
VALUE "FileDescription", "NowPlaying Plugin for Rainmeter"
|
||||||
VALUE "FileVersion", "1.1.3.6"
|
VALUE "FileVersion", "1.1.3.7"
|
||||||
VALUE "InternalName", "NowPlaying"
|
VALUE "InternalName", "NowPlaying"
|
||||||
VALUE "LegalCopyright", "Copyright (C) 2011 - Birunthan Mohanathas"
|
VALUE "LegalCopyright", "Copyright (C) 2011 - Birunthan Mohanathas"
|
||||||
VALUE "OriginalFilename", "NowPlaying.dll"
|
VALUE "OriginalFilename", "NowPlaying.dll"
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
|
|
||||||
/* File created by MIDL compiler version 6.00.0366 */
|
/* File created by MIDL compiler version 6.00.0366 */
|
||||||
/* at Wed Jun 25 17:02:20 2008
|
/* at Wed Nov 05 13:21:00 2008
|
||||||
*/
|
*/
|
||||||
/* Compiler settings for iTunesCOMInterface.idl:
|
/* Compiler settings for iTunesCOMInterface.idl:
|
||||||
Oicf, W1, Zp8, env=Win32 (32b run)
|
Oicf, W1, Zp8, env=Win32 (32b run)
|
||||||
@ -263,7 +263,7 @@ void __RPC_USER MIDL_user_free( void * );
|
|||||||
typedef /* [public][v1_enum][uuid] */ DECLSPEC_UUID("4B73428D-2F56-4833-8E5D-65590E45FEAD")
|
typedef /* [public][v1_enum][uuid] */ DECLSPEC_UUID("4B73428D-2F56-4833-8E5D-65590E45FEAD")
|
||||||
enum __MIDL___MIDL_itf_iTunesCOMInterface_0000_0001
|
enum __MIDL___MIDL_itf_iTunesCOMInterface_0000_0001
|
||||||
{ kITTypeLibrary_MajorVersion = 1,
|
{ kITTypeLibrary_MajorVersion = 1,
|
||||||
kITTypeLibrary_MinorVersion = 11
|
kITTypeLibrary_MinorVersion = 12
|
||||||
} ITVersion;
|
} ITVersion;
|
||||||
|
|
||||||
typedef /* [public][v1_enum][uuid] */ DECLSPEC_UUID("4C25623B-F990-4ebd-8970-F29A70084B8C")
|
typedef /* [public][v1_enum][uuid] */ DECLSPEC_UUID("4C25623B-F990-4ebd-8970-F29A70084B8C")
|
||||||
@ -12390,6 +12390,12 @@ EXTERN_C const IID IID_IITFileOrCDTrack;
|
|||||||
virtual /* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_Playlists(
|
virtual /* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_Playlists(
|
||||||
/* [retval][out] */ IITPlaylistCollection **iPlaylistCollection) = 0;
|
/* [retval][out] */ IITPlaylistCollection **iPlaylistCollection) = 0;
|
||||||
|
|
||||||
|
virtual /* [helpstring][propput] */ HRESULT STDMETHODCALLTYPE put_Location(
|
||||||
|
/* [in] */ BSTR location) = 0;
|
||||||
|
|
||||||
|
virtual /* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_ReleaseDate(
|
||||||
|
/* [retval][out] */ DATE *releaseDate) = 0;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#else /* C style interface */
|
#else /* C style interface */
|
||||||
@ -12929,6 +12935,14 @@ EXTERN_C const IID IID_IITFileOrCDTrack;
|
|||||||
IITFileOrCDTrack * This,
|
IITFileOrCDTrack * This,
|
||||||
/* [retval][out] */ IITPlaylistCollection **iPlaylistCollection);
|
/* [retval][out] */ IITPlaylistCollection **iPlaylistCollection);
|
||||||
|
|
||||||
|
/* [helpstring][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Location )(
|
||||||
|
IITFileOrCDTrack * This,
|
||||||
|
/* [in] */ BSTR location);
|
||||||
|
|
||||||
|
/* [helpstring][propget] */ HRESULT ( STDMETHODCALLTYPE *get_ReleaseDate )(
|
||||||
|
IITFileOrCDTrack * This,
|
||||||
|
/* [retval][out] */ DATE *releaseDate);
|
||||||
|
|
||||||
END_INTERFACE
|
END_INTERFACE
|
||||||
} IITFileOrCDTrackVtbl;
|
} IITFileOrCDTrackVtbl;
|
||||||
|
|
||||||
@ -13336,6 +13350,12 @@ EXTERN_C const IID IID_IITFileOrCDTrack;
|
|||||||
#define IITFileOrCDTrack_get_Playlists(This,iPlaylistCollection) \
|
#define IITFileOrCDTrack_get_Playlists(This,iPlaylistCollection) \
|
||||||
(This)->lpVtbl -> get_Playlists(This,iPlaylistCollection)
|
(This)->lpVtbl -> get_Playlists(This,iPlaylistCollection)
|
||||||
|
|
||||||
|
#define IITFileOrCDTrack_put_Location(This,location) \
|
||||||
|
(This)->lpVtbl -> put_Location(This,location)
|
||||||
|
|
||||||
|
#define IITFileOrCDTrack_get_ReleaseDate(This,releaseDate) \
|
||||||
|
(This)->lpVtbl -> get_ReleaseDate(This,releaseDate)
|
||||||
|
|
||||||
#endif /* COBJMACROS */
|
#endif /* COBJMACROS */
|
||||||
|
|
||||||
|
|
||||||
@ -14036,6 +14056,30 @@ void __RPC_STUB IITFileOrCDTrack_get_Playlists_Stub(
|
|||||||
DWORD *_pdwStubPhase);
|
DWORD *_pdwStubPhase);
|
||||||
|
|
||||||
|
|
||||||
|
/* [helpstring][propput] */ HRESULT STDMETHODCALLTYPE IITFileOrCDTrack_put_Location_Proxy(
|
||||||
|
IITFileOrCDTrack * This,
|
||||||
|
/* [in] */ BSTR location);
|
||||||
|
|
||||||
|
|
||||||
|
void __RPC_STUB IITFileOrCDTrack_put_Location_Stub(
|
||||||
|
IRpcStubBuffer *This,
|
||||||
|
IRpcChannelBuffer *_pRpcChannelBuffer,
|
||||||
|
PRPC_MESSAGE _pRpcMessage,
|
||||||
|
DWORD *_pdwStubPhase);
|
||||||
|
|
||||||
|
|
||||||
|
/* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE IITFileOrCDTrack_get_ReleaseDate_Proxy(
|
||||||
|
IITFileOrCDTrack * This,
|
||||||
|
/* [retval][out] */ DATE *releaseDate);
|
||||||
|
|
||||||
|
|
||||||
|
void __RPC_STUB IITFileOrCDTrack_get_ReleaseDate_Stub(
|
||||||
|
IRpcStubBuffer *This,
|
||||||
|
IRpcChannelBuffer *_pRpcChannelBuffer,
|
||||||
|
PRPC_MESSAGE _pRpcMessage,
|
||||||
|
DWORD *_pdwStubPhase);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* __IITFileOrCDTrack_INTERFACE_DEFINED__ */
|
#endif /* __IITFileOrCDTrack_INTERFACE_DEFINED__ */
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
|
|
||||||
/* File created by MIDL compiler version 6.00.0366 */
|
/* File created by MIDL compiler version 6.00.0366 */
|
||||||
/* at Wed Jun 25 17:02:20 2008
|
/* at Wed Nov 05 13:21:00 2008
|
||||||
*/
|
*/
|
||||||
/* Compiler settings for iTunesCOMInterface.idl:
|
/* Compiler settings for iTunesCOMInterface.idl:
|
||||||
Oicf, W1, Zp8, env=Win32 (32b run)
|
Oicf, W1, Zp8, env=Win32 (32b run)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user