Hi all!
I need help with the debugging of the new RemovableMedia function. In git branch "Rework_Autoplay", I created a new core service which listens for media device changes and which sends a system message when such an event occurs.
The former Autoplay plugin has changed its name to "RemovableMediaManager" and listens for those media change messages. When such a message arrives, the plugin auto-plays the media, if possible.
Furthermore, if the current screen is either the Browse screen or the Local Media Navigation screen, the screen is automatically updated and the inserted CD/DVD etc. is shown (or removed).
The functionality doesn't work for all media types yet, it only works for audio CDs, BDs, DVDs and video CDs. Other media types such as mixed media or MP3 audio etc. will be added.
But there is a problem. When I start MP2 without a media in any drive and insert an audio CD into the drive, MP2 crashes in AudioCDDriveHandler#81:
From that time on, even the explorer doesn't recognize the audio CD any more in its "My Computer" view.
If I remove and add the CD again with MP2 shut down, the explorer works well.
I think MP2 breaks something in the Windows media insertion messaging or something like that.
Can anyone test that and find out what the problem is? I currently don't have much time.
Thanks very much!
Albert
I need help with the debugging of the new RemovableMedia function. In git branch "Rework_Autoplay", I created a new core service which listens for media device changes and which sends a system message when such an event occurs.
The former Autoplay plugin has changed its name to "RemovableMediaManager" and listens for those media change messages. When such a message arrives, the plugin auto-plays the media, if possible.
Furthermore, if the current screen is either the Browse screen or the Local Media Navigation screen, the screen is automatically updated and the inserted CD/DVD etc. is shown (or removed).
The functionality doesn't work for all media types yet, it only works for audio CDs, BDs, DVDs and video CDs. Other media types such as mixed media or MP3 audio etc. will be added.
But there is a problem. When I start MP2 without a media in any drive and insert an audio CD into the drive, MP2 crashes in AudioCDDriveHandler#81:
Code:
public static bool DetectAudioCD(string drive, out IEnumerable<MediaItem> tracks)
{
int numTracks = BassUtils.GetNumTracks(drive);
if (numTracks <= 0)
{
tracks = null;
return false;
}
ISystemResolver systemResolver = ServiceRegistration.Get<ISystemResolver>();
string systemId = systemResolver.LocalSystemId;
IList<MediaItem> resultTracks = new List<MediaItem>(numTracks);
string[] files = Directory.GetFiles(drive); // Here is line 81, here it crashes with an IOException: "The parameter is invalid"
int track = 1;
foreach (string file in files)
resultTracks.Add(CreateMediaItem(file, track++, numTracks, systemId));
tracks = resultTracks;
return true;
}
From that time on, even the explorer doesn't recognize the audio CD any more in its "My Computer" view.
If I remove and add the CD again with MP2 shut down, the explorer works well.
I think MP2 breaks something in the Windows media insertion messaging or something like that.
Can anyone test that and find out what the problem is? I currently don't have much time.
Thanks very much!
Albert