Beispiel #1
0
int ChangedListeningInfo()
{
//	m_log(_T("ChangedListeningInfo"), _T("Start"));

	BOOL changed = FALSE;
	BOOL playing = FALSE;

	int first = (players[WATRACK]->enabled ? WATRACK : GENERIC);
	int last = (players[WATRACK]->enabled ? WATRACK + 1 : NUM_PLAYERS);
	for (int i = first; i < last; i++) 
	{
		if (!players[i]->enabled)
			continue;

		LISTENINGTOINFO lti = {0};
		if (!players[i]->GetListeningInfo(&lti))
			continue;

		if (!IsTypeEnabled(&lti))
		{
			FreeListeningInfo(&lti);
			continue;
		}

		playing = TRUE;

//		m_log(_T("ChangedListeningInfo"), _T("Has : %s : %d"), players[i]->name, lti.cbSize);

		if (Equals(&current, &lti))
		{
//			m_log(_T("ChangedListeningInfo"), _T("Is equals"));
			FreeListeningInfo(&lti);
		}
		else
		{
//			m_log(_T("ChangedListeningInfo"), _T("Is different"));

			FreeListeningInfo(&current);

			memcpy(&current, &lti, sizeof(current));

			changed = 1;
		}

		break;
	}

	if (!playing && current.cbSize != 0)
	{
		FreeListeningInfo(&current);
		changed = 1;
	}

	if (!changed)
		return 0;
	else
		return current.cbSize == 0 ? -1 : 1;
}
Beispiel #2
0
void Player::FreeData()
{
	mir_cslock lck(cs);

	if (listening_info.cbSize != 0)
		FreeListeningInfo(&listening_info);
}
void 
Player::FreeData()
{
	EnterCriticalSection(&cs);

	if (m_listening_info.cbSize != 0)
		FreeListeningInfo(&m_listening_info);

	LeaveCriticalSection(&cs);
}
Beispiel #4
0
void CopyListeningInfo(LISTENINGTOINFO *dest, const LISTENINGTOINFO * const src)
{
	FreeListeningInfo(dest);

	dest->cbSize = src->cbSize;
	dest->dwFlags = src->dwFlags;
	dest->ptszArtist = mir_tstrdup(src->ptszArtist);
	dest->ptszAlbum = mir_tstrdup(src->ptszAlbum);
	dest->ptszTitle = mir_tstrdup(src->ptszTitle);
	dest->ptszTrack = mir_tstrdup(src->ptszTrack);
	dest->ptszYear = mir_tstrdup(src->ptszYear);
	dest->ptszGenre = mir_tstrdup(src->ptszGenre);
	dest->ptszLength = mir_tstrdup(src->ptszLength);
	dest->ptszPlayer = mir_tstrdup(src->ptszPlayer);
	dest->ptszType = mir_tstrdup(src->ptszType);
}