jlb1234 said:Sorry for my bad english, i'm a Brazilian Developer
1) I am using the repeat counter sent by the WinLIRC instead of a delay/repeat timer in the plugin. The alteration solved some problems with the precision and the repetition of keys.
2) The setup screen now shows two sliders for control of delay and the repetition of the keys, in the same way that the function "keyboard" in Windows Control Panel.
3) I replaced the GUIWindowManager object for the GUIGraphicsContext object when sending the actions to MP. The alteration solved the problem of the volume control and the sub-menus response.
The code works with the last CVS version.
if (command.iRepeat == 0)
{
SendCommand = true;
}
else
{
if (command.iRepeat > RepeatDelay)
{
if ((command.iRepeat - RepeatDelay) % RepeatRate == 0)
{
SendCommand = true;
}
}
}
private void WinLircShutdownManager()
{
Log.Write(" WinLIRC: ShutdownManager Activated!");
if (GUIWindowManager.ActiveWindow != (int)GUIWindow.Window.WINDOW_HOME)
{
Log.Write(" WinLIRC: ShutdownManager Aborted - Not at HOME!");
return;
}
// Show shutdown/exit dialog
GUIMessage msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_ASKYESNO,0,0,0,0,0,0);
msg.Param1=631;
msg.Param2=0;
msg.Param3=0;
GUIWindowManager.SendMessage(msg);
if (msg.Param1 != 1)
{
return;
}
// Shutdown players
MediaPortal.Player.g_Player.Stop();
// Ask all plugins to see if we can shutdown
ArrayList wakeables = PluginManager.WakeablePlugins;
foreach (IWakeable wakeable in wakeables)
{
if (wakeable.DisallowShutdown())
{
Log.Write(" WinLIRC: ShutdownManager Aborted by module/plugin - {0}", wakeable.PluginName());
return;
}
}
Log.Write(" WinLIRC: ShutdownManager - Hibernating!");
/*
LogOff = 0
PowerOff = 1
Reboot = 2
ShutDown = 3 (DEFAULT)
Suspend = 4
Hibernate = 5
*/
RestartOptions tempRO;
switch(shutdownType)
{
case 0:
tempRO = RestartOptions.LogOff;
break;
case 1:
tempRO = RestartOptions.PowerOff;
break;
case 2:
tempRO = RestartOptions.Reboot;
break;
case 4:
tempRO = RestartOptions.Suspend;
break;
case 5:
tempRO = RestartOptions.Hibernate;
break;
default:
tempRO = RestartOptions.ShutDown;
break;
}
WindowsController.ExitWindows(tempRO, false);
}
// Check if the shutdown command button is being pressed. if it is
// for a specific number of repeat count, call WinLircShutdownManager
// and exit the function
if(command.sCommand == shutdownCommandButton)
{
// Only invoke this ONCE and dont let it repeat
if(command.iRepeat == shutdownGapRepeat)
{
WinLircShutdownManager();
}
return;
}