Just in case, the relevant (yes, I know, to get the above output the code could be much simpler, but this is the fragment I shall try to use to get what I want) piece of code is:
private void MJEvent(String s1, String s2, String s3)
{
MediaCenter.IMJCurPlaylistAutomation curPlaylist = mcRef.GetCurPlaylist();
MediaCenter.IMJPlaybackAutomation playback = mcRef.GetPlayback();
switch (s1)
{
case "MJEvent type: MCCommand":
switch (s2)
{
case "MCC: NOTIFY_TRACK_CHANGE":
Debug.WriteLine(DateTime.Now.ToString("hh:mm:ss.fff") + " MCC: NOTIFY_TRACK_CHANGE " + playback.State.ToString() +
" " + curPlaylist.GetFile(curPlaylist.Position).Tracknumber +
" " + curPlaylist.GetFile(curPlaylist.Position).Name);
break;
case "MCC: NOTIFY_PLAYERSTATE_CHANGE":
if ("PLAYSTATE_WAITING" == playback.State.ToString())
{
Debug.WriteLine(DateTime.Now.ToString("hh:mm:ss.fff") + " MCC: NOTIFY_PLAYERSTATE_CHANGE " + playback.State.ToString() +
" " + curPlaylist.GetFile(curPlaylist.Position).Tracknumber +
" " + curPlaylist.GetFile(curPlaylist.Position).Name);
}
if ("PLAYSTATE_PLAYING" == playback.State.ToString())
{
Debug.WriteLine(DateTime.Now.ToString("hh:mm:ss.fff") + " MCC: NOTIFY_PLAYERSTATE_CHANGE " + playback.State.ToString() +
" " + curPlaylist.GetFile(curPlaylist.Position).Tracknumber +
" " + curPlaylist.GetFile(curPlaylist.Position).Name);
}
break;
default:
// Unknown (new?) event
break;
}
break;
default:
// Unknown (new?) type
break;
}