NowPlayingPlugin: Added PlayerType=FILE and fixed that TrackChangeAction is executed when track metadata is changed.

This commit is contained in:
Birunthan Mohanathas
2011-05-22 08:06:43 +00:00
parent e05aca67fc
commit ef97fb2435
12 changed files with 179 additions and 358 deletions

View File

@ -240,6 +240,10 @@ UINT Initialize(HMODULE instance, LPCTSTR iniFile, LPCTSTR section, UINT id)
data->measure = MEASURE_VOLUME;
maxValue = 100;
}
else if (_wcsicmp(L"FILE", str) == 0)
{
data->measure = MEASURE_FILE;
}
}
data->player->AddInstance(data->measure);
@ -280,14 +284,11 @@ UINT Update(UINT id)
// Only allow main measure to update
(*i).second->player->UpdateData();
}
CPlayer* player = (*i).second->player;
switch ((*i).second->measure)
{
case MEASURE_RATING:
return player->GetRating();
case MEASURE_DURATION:
return player->GetDuration();
@ -301,6 +302,9 @@ UINT Update(UINT id)
}
return 0;
case MEASURE_RATING:
return player->GetRating();
case MEASURE_STATE:
return (int)player->GetState();
@ -340,18 +344,6 @@ LPCTSTR GetString(UINT id, UINT flags)
case MEASURE_COVER:
return player->GetCoverPath();
case MEASURE_RATING:
_itow(player->GetRating(), buffer, 10);
return buffer;
case MEASURE_STATE:
_itow(player->GetState(), buffer, 10);
return buffer;
case MEASURE_VOLUME:
_itow(player->GetVolume(), buffer, 10);
return buffer;
case MEASURE_DURATION:
SecondsToTime(player->GetDuration(), buffer);
return buffer;
@ -368,6 +360,21 @@ LPCTSTR GetString(UINT id, UINT flags)
return buffer;
}
return L"0";
case MEASURE_RATING:
_itow(player->GetRating(), buffer, 10);
return buffer;
case MEASURE_STATE:
_itow(player->GetState(), buffer, 10);
return buffer;
case MEASURE_VOLUME:
_itow(player->GetVolume(), buffer, 10);
return buffer;
case MEASURE_FILE:
return player->GetFilePath();
}
}
else