public void notifyPlay(String playlist, IAudioItem audioItem) {
if ((_boStatsActivated) &&
(audioItem instanceof AudioItem)) {
String key;
StatisticItem item;
key = getKey(StatisticItemType.Playlist, playlist);
if (_statsList.containsKey(key)) {
item = _statsList.get(key);
} else {
item = new StatisticItem(key, StatisticItemType.Playlist, playlist, "", 0); //$NON-NLS-1$
_statsList.put(key, item);
}
item.incValue();
key = getKey(StatisticItemType.Genre, audioItem.getPropertiesList().get(AudioItem.GENRE));
if (_statsList.containsKey(key)) {
item = _statsList.get(key);
} else {
item = new StatisticItem(key, StatisticItemType.Genre, audioItem.getPropertiesList().get(AudioItem.GENRE), "", 0); //$NON-NLS-1$
_statsList.put(key, item);
}
item.incValue();
key = getKey(StatisticItemType.Artist, audioItem.getPropertiesList().get(AudioItem.ARTIST));
if (_statsList.containsKey(key)) {
item = _statsList.get(key);
} else {
item = new StatisticItem(key, StatisticItemType.Artist, audioItem.getPropertiesList().get(AudioItem.ARTIST), "", 0); //$NON-NLS-1$
_statsList.put(key, item);
}
item.incValue();
key = getKey(StatisticItemType.Album, audioItem.getPropertiesList().get(AudioItem.ALBUM));
if (_statsList.containsKey(key)) {
item = _statsList.get(key);
} else {
item = new StatisticItem(key,
StatisticItemType.Album,
audioItem.getPropertiesList().get(AudioItem.ALBUM),
audioItem.getPropertiesList().get(AudioItem.ARTIST),
0);
_statsList.put(key, item);
}
item.incValue();
key = getKey(StatisticItemType.Title, audioItem.getFileName());
if (_statsList.containsKey(key)) {
item = _statsList.get(key);
} else {
item = new StatisticItem(key,
StatisticItemType.Title,
audioItem.getPropertiesList().get(AudioItem.TITLE),
audioItem.getPropertiesList().get(AudioItem.ARTIST) + " - " + audioItem.getPropertiesList().get(AudioItem.ALBUM),//$NON-NLS-1$
0);
_statsList.put(key, item);
}
item.incValue();
}
}