the original thread, was for support USB HDD in MP List without need to tweaks/tricks config !You will have to find someone more experienced here.
is wrong !!!There is no existing method to check whether it is new device and is it USB so MP just assume that disk is inserted into drive and same method reacts on inserting CD/DVD disk into existing drive so we do not know if is device plugged in or media inserted.
is wrong !!!There is no existing method to check whether it is new device and is it USB so MP just assume that disk is inserted into drive and same method reacts on inserting CD/DVD disk into existing drive so we do not know if is device plugged in or media inserted.
look my post https://forum.team-mediaportal.com/...ive-method-obsolete.113317/page-5#post-988186
MP detect insertion of CD !
private static bool DeviceNew(DEV_BROADCAST_VOLUME volumeInformation)
{
char volumeLetter = GetVolumeLetter(volumeInformation.UnitMask);
string path = (volumeLetter + @":").ToUpperInvariant();
string driveName = Utils.GetDriveName(path);
_volumeInsertTime = DateTime.Now;
TimeSpan tsMount = DateTime.Now - _mountTime;
TimeSpan tsExamineCD = DateTime.Now - _examineCDTime;
TimeSpan tsVolumeRemoval = DateTime.Now - _volumeRemovalTime;
if (Utils.IsRemovable(path) || Utils.IsHD(path))
{
Log.Debug("Detected new device: {0}", volumeLetter);
GUIMessage msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_ADD_REMOVABLE_DRIVE, 0, 0, 0, 0, 0, 0);
msg.Label = path;
msg.Label2 = String.Format("({0}) {1}", path, driveName);
GUIGraphicsContext.SendMessage(msg);
return true;
}
else if (Utils.IsDVD(path))
{
// AnyDVD is causing media removed & inserted events when waking up from S3/S4
// We need to filter out those as it could trigger false autoplay event
if (tsExamineCD.TotalMilliseconds < _volumeRemovalDelay
|| (tsVolumeRemoval.TotalMilliseconds < _volumeRemovalDelay || tsMount.TotalMilliseconds < _volumeRemovalDelay))
{
Log.Debug("Ignoring volume inserted event - drive {0} - timespan mount {1} s",
volumeLetter, tsMount.TotalMilliseconds / 1000);
Log.Debug(" _volumeRemovalDelay = {0}", _volumeRemovalDelay);
return false;
}
Log.Debug("Detected new optical media: {0}", volumeLetter);
GUIMessage msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_VOLUME_INSERTED, 0, 0, 0, 0, 0, 0);
msg.Label = path;
GUIGraphicsContext.SendMessage(msg);
return true;
}
return false;
}