diff --git a/Application/Application.rc b/Application/Application.rc index 45b492b8..5a7dc345 100644 --- a/Application/Application.rc +++ b/Application/Application.rc @@ -28,8 +28,8 @@ LANGUAGE LANG_FINNISH, SUBLANG_DEFAULT // VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,3,0,513 - PRODUCTVERSION 1,3,0,513 + FILEVERSION 1,3,0,515 + PRODUCTVERSION 1,3,0,515 FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS 0x1L @@ -45,12 +45,12 @@ BEGIN BLOCK "040b04b0" BEGIN VALUE "FileDescription", "Rainmeter - A Customizable Resource Meter" - VALUE "FileVersion", "1, 3, 0, 513" + VALUE "FileVersion", "1, 3, 0, 515" VALUE "InternalName", "Rainmeter" VALUE "LegalCopyright", "Copyright (C) 2010 - Rainy" VALUE "OriginalFilename", "Rainmeter.exe" VALUE "ProductName", "Rainmeter" - VALUE "ProductVersion", "1, 3, 0, 513" + VALUE "ProductVersion", "1, 3, 0, 515" END END BLOCK "VarFileInfo" diff --git a/Plugins/PluginWin7Audio/Win7AudioPlugin.cpp b/Plugins/PluginWin7Audio/Win7AudioPlugin.cpp index 541a8c4a..4dd387fe 100644 --- a/Plugins/PluginWin7Audio/Win7AudioPlugin.cpp +++ b/Plugins/PluginWin7Audio/Win7AudioPlugin.cpp @@ -41,8 +41,8 @@ extern "C" { __declspec( dllexport ) UINT Initialize(HMODULE instance, LPCTSTR iniFile, LPCTSTR section, UINT id); __declspec( dllexport ) void Finalize(HMODULE instance, UINT id); -__declspec( dllexport ) UINT Update(UINT id); -//__declspec( dllexport ) double Update2(UINT id); +//__declspec( dllexport ) UINT Update(UINT id); +__declspec( dllexport ) double Update2(UINT id); __declspec( dllexport ) LPCTSTR GetString(UINT id, UINT flags); __declspec( dllexport ) UINT GetPluginVersion(); __declspec( dllexport ) LPCTSTR GetPluginAuthor(); @@ -328,21 +328,23 @@ UINT Initialize(HMODULE instance, LPCTSTR iniFile, LPCTSTR section, UINT id) This function is called when new value should be measured. The function returns the new value. */ -UINT Update(UINT id) -{ - GetWin7AudioState(GET_VOLUME); - UINT volume = is_mute == TRUE ? 0 : static_cast(master_volume * 100.0f + 0.5f); // rounding up at 0.5 - return volume > 100 ? 100 : volume; -} +//UINT Update(UINT id) +//{ +// GetWin7AudioState(GET_VOLUME); +// UINT volume = is_mute == TRUE ? 0 : static_cast(master_volume * 100.0f + 0.5f); // rounding up at 0.5 +// return volume > 100 ? 100 : volume; +//} /* This function is called when new value should be measured. The function returns the new value. */ -//double Update2(UINT id) -//{ -// return 0; -//} +double Update2(UINT id) +{ + GetWin7AudioState(GET_VOLUME); + double volume = is_mute == TRUE ? -1.0 : floor(master_volume * 100.0 + 0.5); // rounding up at 0.5 + return volume > 100.0 ? 100.0 : volume; +} LPCTSTR GetString(UINT id, UINT flags) { @@ -413,7 +415,7 @@ void Finalize(HMODULE instance, UINT id) UINT GetPluginVersion() { - return 1005; + return 1006; } LPCTSTR GetPluginAuthor() @@ -507,6 +509,26 @@ void ExecuteBang(LPCTSTR args, UINT id) { if (!GetWin7AudioState(TOGGLE_MUTE)) LSLog(LOG_DEBUG, L"Rainmeter", L"Win7AudioPlugin: Mute Toggle Error!"); } + else if (_wcsicmp(wholeBang.c_str(), L"Mute") == 0) + { + if (!is_mute) + { + if (!GetWin7AudioState(TOGGLE_MUTE)) + { + LSLog(LOG_DEBUG, L"Rainmeter", L"Win7AudioPlugin: Mute Error!"); + } + } + } + else if (_wcsicmp(wholeBang.c_str(), L"Unmute") == 0) + { + if (is_mute) + { + if (!GetWin7AudioState(TOGGLE_MUTE)) + { + LSLog(LOG_DEBUG, L"Rainmeter", L"Win7AudioPlugin: Unmute Error!"); + } + } + } else { LSLog(LOG_DEBUG, L"Rainmeter", L"Win7AudioPlugin: Unknown bang!"); diff --git a/revision-number.h b/revision-number.h index eab48436..574ee5aa 100644 --- a/revision-number.h +++ b/revision-number.h @@ -1,3 +1,3 @@ #pragma once -const int revision_number = 513; +const int revision_number = 515; const bool revision_beta = true; \ No newline at end of file