mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
NowPlayingPlugin:
- Fixed that the OpenPlayer bang didn't work correctly since r848 - Fixed that the "SetPosition +n" bang didn't work correctly
This commit is contained in:
@ -447,14 +447,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();
|
||||
}
|
||||
@ -474,14 +467,18 @@ void ExecuteBang(LPCTSTR bang, UINT id)
|
||||
{
|
||||
player->Next();
|
||||
}
|
||||
else if (_wcsicmp(bang, L"Previous") == 0)
|
||||
else if (_wcsicmp(bang, L"OpenPlayer") == 0)
|
||||
{
|
||||
player->Previous();
|
||||
player->OpenPlayer(parent->playerPath);
|
||||
}
|
||||
else if (_wcsicmp(bang, L"ClosePlayer") == 0 || _wcsicmp(bang, L"TogglePlayer") == 0)
|
||||
else if (_wcsicmp(bang, L"ClosePlayer") == 0)
|
||||
{
|
||||
player->ClosePlayer();
|
||||
}
|
||||
else if (_wcsicmp(bang, L"TogglePlayer") == 0)
|
||||
{
|
||||
player->IsInitialized() ? player->ClosePlayer() : player->OpenPlayer(parent->playerPath);
|
||||
}
|
||||
else
|
||||
{
|
||||
LPCTSTR arg = wcschr(bang, L' ');
|
||||
@ -492,7 +489,7 @@ void ExecuteBang(LPCTSTR bang, UINT id)
|
||||
|
||||
if (wcsnicmp(bang, L"SetPosition", 11) == 0)
|
||||
{
|
||||
int position = (_wtoi(arg) * player->GetDuration()) / 100;
|
||||
int position = (_wtoi(arg) * (int)player->GetDuration()) / 100;
|
||||
if (arg[0] == L'+' || arg[0] == L'-')
|
||||
{
|
||||
position += player->GetPosition();
|
||||
|
Reference in New Issue
Block a user