Hi,
I keep running into problems. I've added a 'Play' button to the Plugin and would like to be able to play it using the IMJPlaybackAutomation object. Clearing the current playlist goes OK. Adding my file also succeeds. Playing doesn't start however.
Here's the code I've added for playing:
private void buttonPlay_Click ( object sender, EventArgs e )
{
DataGridViewSelectedRowCollection rows;
IMJPlaybackAutomation playback;
IMJCurPlaylistAutomation playlist;
IMJFilesAutomation files;
rows = gridSongs.SelectedRows;
playback = mcRef.GetPlayback ();
playlist = mcRef.GetCurPlaylist ();
if ( rows.Count > 0 )
{
// Clear the current playlist
playlist.RemoveAllFiles ();
// Add my selected file. Unique hold the Unique number of the File
playlist.AddFileByKey ( (int)rows[0].Cells["Unique"].Value, 0 );
// Set the position to my file in the Current Playlist
playlist.Position = 0;
if (playlist.GetCanPlayNext ())
{
// Play it
playback.Play ();
}
else
{
addUserInfoText ( "Can't play next" );
}
}
}
}
Am I doing something wrong. If you would like to have all of my plugin code just give me call and I publish it somewhere.
Paul.