X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;ds=inline;f=src%2Fcec-config-gui%2FCecConfigGUI.cs;h=0e83c6a449fd727218ab0acf75d3efd7b474c620;hb=217b236882e3f4e5303a135aae39f6207bfbd279;hp=b404fbd4eb48b59b3c2f16f9dcd49cbcc75ed505;hpb=b113b95ac84c2dd99d82ecc7c8dfbc296209bf23;p=deb_libcec.git
diff --git a/src/cec-config-gui/CecConfigGUI.cs b/src/cec-config-gui/CecConfigGUI.cs
index b404fbd..0e83c6a 100644
--- a/src/cec-config-gui/CecConfigGUI.cs
+++ b/src/cec-config-gui/CecConfigGUI.cs
@@ -28,11 +28,12 @@ namespace CecConfigGui
Config.DeviceTypes.Types[0] = CecDeviceType.RecordingDevice;
Config.DeviceName = "CEC Config";
Config.GetSettingsFromROM = true;
- Config.ClientVersion = CecClientVersion.Version1_5_0;
+ Config.ClientVersion = CecClientVersion.Version1_9_0;
Callbacks = new CecCallbackWrapper(this);
Config.SetCallbacks(Callbacks);
LoadXMLConfiguration(ref Config);
Lib = new LibCecSharp(Config);
+ Lib.InitVideoStandalone();
InitializeComponent();
LoadButtonConfiguration();
@@ -160,6 +161,10 @@ namespace CecConfigGui
case "port":
//TODO
break;
+ // 1.5.1 settings
+ case "send_inactive_source":
+ config.SendInactiveSource = value.Equals("1") || value.ToLower().Equals("true") || value.ToLower().Equals("yes");
+ break;
default:
break;
}
@@ -176,85 +181,85 @@ namespace CecConfigGui
private void LoadButtonConfiguration()
{
//TODO load the real configuration
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Select", (new CecKeypress { Keycode = 0x00 }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Up", (new CecKeypress { Keycode = 0x01 }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Down", (new CecKeypress { Keycode = 0x02 }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Left", (new CecKeypress { Keycode = 0x03 }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Right", (new CecKeypress { Keycode = 0x04 }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Right+Up", (new CecKeypress { Keycode = 0x05 }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Right+Down", (new CecKeypress { Keycode = 0x06 }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Left+Up", (new CecKeypress { Keycode = 0x07 }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Left+Down", (new CecKeypress { Keycode = 0x08 }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Root menu", (new CecKeypress { Keycode = 0x09 }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Setup menu", (new CecKeypress { Keycode = 0x0A }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Contents menu", (new CecKeypress { Keycode = 0x0B }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Favourite menu", (new CecKeypress { Keycode = 0x0C }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Exit", (new CecKeypress { Keycode = 0x0D }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("0", (new CecKeypress { Keycode = 0x20 }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("1", (new CecKeypress { Keycode = 0x21 }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("2", (new CecKeypress { Keycode = 0x22 }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("3", (new CecKeypress { Keycode = 0x23 }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("4", (new CecKeypress { Keycode = 0x24 }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("5", (new CecKeypress { Keycode = 0x25 }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("6", (new CecKeypress { Keycode = 0x26 }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("7", (new CecKeypress { Keycode = 0x27 }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("8", (new CecKeypress { Keycode = 0x28 }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("9", (new CecKeypress { Keycode = 0x29 }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem(".", (new CecKeypress { Keycode = 0x2A }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Enter", (new CecKeypress { Keycode = 0x2B }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Clear", (new CecKeypress { Keycode = 0x2C }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Next favourite", (new CecKeypress { Keycode = 0x2F }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Channel up", (new CecKeypress { Keycode = 0x30 }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Channel down", (new CecKeypress { Keycode = 0x31 }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Previous channel", (new CecKeypress { Keycode = 0x32 }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Sound select", (new CecKeypress { Keycode = 0x33 }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Input select", (new CecKeypress { Keycode = 0x34 }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Display information", (new CecKeypress { Keycode = 0x35 }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Help", (new CecKeypress { Keycode = 0x36 }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Page up", (new CecKeypress { Keycode = 0x37 }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Page down", (new CecKeypress { Keycode = 0x38 }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Power", (new CecKeypress { Keycode = 0x40 }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Volume up", (new CecKeypress { Keycode = 0x41 }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Volume down", (new CecKeypress { Keycode = 0x42 }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Mute", (new CecKeypress { Keycode = 0x43 }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Play", (new CecKeypress { Keycode = 0x44 }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Stop", (new CecKeypress { Keycode = 0x45 }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Pause", (new CecKeypress { Keycode = 0x46 }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Record", (new CecKeypress { Keycode = 0x47 }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Rewind", (new CecKeypress { Keycode = 0x48 }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Fast forward", (new CecKeypress { Keycode = 0x49 }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Eject", (new CecKeypress { Keycode = 0x4A }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Forward", (new CecKeypress { Keycode = 0x4B }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Backward", (new CecKeypress { Keycode = 0x4C }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Stop record", (new CecKeypress { Keycode = 0x4D }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Pause record", (new CecKeypress { Keycode = 0x4E }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Angle", (new CecKeypress { Keycode = 0x50 }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Sub picture", (new CecKeypress { Keycode = 0x51 }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Video on demand", (new CecKeypress { Keycode = 0x52 }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Electronic program guide", (new CecKeypress { Keycode = 0x53 }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Timer programming", (new CecKeypress { Keycode = 0x54 }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Initial configuration", (new CecKeypress { Keycode = 0x55 }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Play (function)", (new CecKeypress { Keycode = 0x60 }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Pause play (function)", (new CecKeypress { Keycode = 0x61 }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Record (function)", (new CecKeypress { Keycode = 0x62 }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Pause record (function)", (new CecKeypress { Keycode = 0x63 }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Stop (function)", (new CecKeypress { Keycode = 0x64 }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Mute (function)", (new CecKeypress { Keycode = 0x65 }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Restore volume", (new CecKeypress { Keycode = 0x66 }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Tune", (new CecKeypress { Keycode = 0x67 }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Select media", (new CecKeypress { Keycode = 0x68 }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Select AV input", (new CecKeypress { Keycode = 0x69 }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Select audio input", (new CecKeypress { Keycode = 0x6A }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Power toggle", (new CecKeypress { Keycode = 0x6B }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Power off", (new CecKeypress { Keycode = 0x6C }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Power on", (new CecKeypress { Keycode = 0x6D }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("F1 (blue)", (new CecKeypress { Keycode = 0x71 }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("F2 (red)", (new CecKeypress { Keycode = 0x72 }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("F3 (green)", (new CecKeypress { Keycode = 0x73 }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("F4 (yellow)", (new CecKeypress { Keycode = 0x74 }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("F5", (new CecKeypress { Keycode = 0x75 }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Data", (new CecKeypress { Keycode = 0x76 }), string.Empty));
- cecButtonConfigBindingSource.Add(new CecButtonConfigItem("(Samsung) Return", (new CecKeypress { Keycode = 0x91 }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Select", (new CecKeypress { Keycode = CecUserControlCode.Select }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Up", (new CecKeypress { Keycode = CecUserControlCode.Up }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Down", (new CecKeypress { Keycode = CecUserControlCode.Down }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Left", (new CecKeypress { Keycode = CecUserControlCode.Left }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Right", (new CecKeypress { Keycode = CecUserControlCode.Right }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Right+Up", (new CecKeypress { Keycode = CecUserControlCode.RightUp }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Right+Down", (new CecKeypress { Keycode = CecUserControlCode.RightDown }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Left+Up", (new CecKeypress { Keycode = CecUserControlCode.LeftUp }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Left+Down", (new CecKeypress { Keycode = CecUserControlCode.LeftDown }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Root menu", (new CecKeypress { Keycode = CecUserControlCode.RootMenu }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Setup menu", (new CecKeypress { Keycode = CecUserControlCode.SetupMenu }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Contents menu", (new CecKeypress { Keycode = CecUserControlCode.ContentsMenu }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Favourite menu", (new CecKeypress { Keycode = CecUserControlCode.FavoriteMenu }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Exit", (new CecKeypress { Keycode = CecUserControlCode.Exit }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("0", (new CecKeypress { Keycode = CecUserControlCode.Number0 }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("1", (new CecKeypress { Keycode = CecUserControlCode.Number1 }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("2", (new CecKeypress { Keycode = CecUserControlCode.Number2 }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("3", (new CecKeypress { Keycode = CecUserControlCode.Number3 }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("4", (new CecKeypress { Keycode = CecUserControlCode.Number4 }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("5", (new CecKeypress { Keycode = CecUserControlCode.Number5 }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("6", (new CecKeypress { Keycode = CecUserControlCode.Number6 }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("7", (new CecKeypress { Keycode = CecUserControlCode.Number7 }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("8", (new CecKeypress { Keycode = CecUserControlCode.Number8 }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("9", (new CecKeypress { Keycode = CecUserControlCode.Number9 }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem(".", (new CecKeypress { Keycode = CecUserControlCode.Dot }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Enter", (new CecKeypress { Keycode = CecUserControlCode.Enter }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Clear", (new CecKeypress { Keycode = CecUserControlCode.Clear }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Next favourite", (new CecKeypress { Keycode = CecUserControlCode.NextFavorite }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Channel up", (new CecKeypress { Keycode = CecUserControlCode.ChannelUp }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Channel down", (new CecKeypress { Keycode = CecUserControlCode.ChannelDown }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Previous channel", (new CecKeypress { Keycode = CecUserControlCode.PreviousChannel }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Sound select", (new CecKeypress { Keycode = CecUserControlCode.SoundSelect }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Input select", (new CecKeypress { Keycode = CecUserControlCode.InputSelect }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Display information", (new CecKeypress { Keycode = CecUserControlCode.DisplayInformation }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Help", (new CecKeypress { Keycode = CecUserControlCode.Help }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Page up", (new CecKeypress { Keycode = CecUserControlCode.PageUp }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Page down", (new CecKeypress { Keycode = CecUserControlCode.PageDown }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Power", (new CecKeypress { Keycode = CecUserControlCode.Power }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Volume up", (new CecKeypress { Keycode = CecUserControlCode.VolumeUp }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Volume down", (new CecKeypress { Keycode = CecUserControlCode.VolumeDown }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Mute", (new CecKeypress { Keycode = CecUserControlCode.Mute }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Play", (new CecKeypress { Keycode = CecUserControlCode.Play }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Stop", (new CecKeypress { Keycode = CecUserControlCode.Stop }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Pause", (new CecKeypress { Keycode = CecUserControlCode.Pause }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Record", (new CecKeypress { Keycode = CecUserControlCode.Record }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Rewind", (new CecKeypress { Keycode = CecUserControlCode.Rewind }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Fast forward", (new CecKeypress { Keycode = CecUserControlCode.FastForward }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Eject", (new CecKeypress { Keycode = CecUserControlCode.Eject }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Forward", (new CecKeypress { Keycode = CecUserControlCode.Forward }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Backward", (new CecKeypress { Keycode = CecUserControlCode.Backward }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Stop record", (new CecKeypress { Keycode = CecUserControlCode.StopRecord }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Pause record", (new CecKeypress { Keycode = CecUserControlCode.PauseRecord }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Angle", (new CecKeypress { Keycode = CecUserControlCode.Angle }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Sub picture", (new CecKeypress { Keycode = CecUserControlCode.SubPicture }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Video on demand", (new CecKeypress { Keycode = CecUserControlCode.VideoOnDemand }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Electronic program guide", (new CecKeypress { Keycode = CecUserControlCode.ElectronicProgramGuide }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Timer programming", (new CecKeypress { Keycode = CecUserControlCode.TimerProgramming }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Initial configuration", (new CecKeypress { Keycode = CecUserControlCode.InitialConfiguration }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Play (function)", (new CecKeypress { Keycode = CecUserControlCode.PlayFunction }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Pause play (function)", (new CecKeypress { Keycode = CecUserControlCode.PausePlayFunction }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Record (function)", (new CecKeypress { Keycode = CecUserControlCode.RecordFunction }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Pause record (function)", (new CecKeypress { Keycode = CecUserControlCode .PauseRecordFunction }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Stop (function)", (new CecKeypress { Keycode = CecUserControlCode.StopFunction }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Mute (function)", (new CecKeypress { Keycode = CecUserControlCode.MuteFunction }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Restore volume", (new CecKeypress { Keycode = CecUserControlCode.RestoreVolumeFunction }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Tune", (new CecKeypress { Keycode = CecUserControlCode.TuneFunction }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Select media", (new CecKeypress { Keycode = CecUserControlCode.SelectMediaFunction }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Select AV input", (new CecKeypress { Keycode = CecUserControlCode.SelectAVInputFunction }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Select audio input", (new CecKeypress { Keycode = CecUserControlCode.SelectAudioInputFunction }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Power toggle", (new CecKeypress { Keycode = CecUserControlCode.PowerToggleFunction }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Power off", (new CecKeypress { Keycode = CecUserControlCode.PowerOffFunction }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Power on", (new CecKeypress { Keycode = CecUserControlCode.PowerOnFunction }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("F1 (blue)", (new CecKeypress { Keycode = CecUserControlCode.F1Blue }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("F2 (red)", (new CecKeypress { Keycode = CecUserControlCode.F2Red }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("F3 (green)", (new CecKeypress { Keycode = CecUserControlCode.F3Green }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("F4 (yellow)", (new CecKeypress { Keycode = CecUserControlCode.F4Yellow }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("F5", (new CecKeypress { Keycode = CecUserControlCode.F5 }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Data", (new CecKeypress { Keycode = CecUserControlCode.Data }), string.Empty));
+ cecButtonConfigBindingSource.Add(new CecButtonConfigItem("Return (Samsung)", (new CecKeypress { Keycode = CecUserControlCode.SamsungReturn }), string.Empty));
}
private void ProcessEventHandler(object src, UpdateEvent updateEvent)
@@ -317,6 +322,12 @@ namespace CecConfigGui
}
SetControlVisible(pProgress, false);
break;
+ case UpdateEventType.ExitApplication:
+ ActiveProcess = null;
+ SetControlsEnabled(false);
+ SetControlVisible(pProgress, false);
+ Application.Exit();
+ break;
}
}
@@ -335,6 +346,7 @@ namespace CecConfigGui
SetControlEnabled(cbPowerOffDevices, val);
SetControlEnabled(cbVendorOverride, val);
SetControlEnabled(cbVendorId, val && cbVendorOverride.Checked);
+ SetControlEnabled(cbSendInactiveSource, val);
SetControlEnabled(bClose, val);
SetControlEnabled(bSaveConfig, val);
SetControlEnabled(bReloadConfig, val);
@@ -536,99 +548,97 @@ namespace CecConfigGui
Config.ActivateSource = cbActivateSource.Checked;
Config.PowerOffScreensaver = cbPowerOffScreensaver.Checked;
Config.PowerOffOnStandby = cbPowerOffOnStandby.Checked;
+ Config.SendInactiveSource = cbSendInactiveSource.Checked;
Config.WakeDevices = WakeDevices;
Config.PowerOffDevices = PowerOffDevices;
- if (!Lib.CanPersistConfiguration())
+ /* save settings in the eeprom */
+ Lib.PersistConfiguration(Config);
+
+ /* and in xml */
+ if (ActiveProcess == null)
{
- if (ActiveProcess == null)
- {
- SetControlsEnabled(false);
- string xbmcDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\XBMC\userdata\peripheral_data";
- string defaultDir = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
+ SetControlsEnabled(false);
+ string xbmcDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\XBMC\userdata\peripheral_data";
+ string defaultDir = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
- SaveFileDialog dialog = new SaveFileDialog()
+ SaveFileDialog dialog = new SaveFileDialog()
+ {
+ Title = "Where do you want to store the settings?",
+ InitialDirectory = Directory.Exists(xbmcDir) ? xbmcDir : defaultDir,
+ FileName = "usb_2548_1001.xml",
+ Filter = "xml files (*.xml)|*.xml|All files (*.*)|*.*",
+ FilterIndex = 1
+ };
+
+ if (dialog.ShowDialog() == DialogResult.OK)
+ {
+ FileStream fs = null;
+ string error = string.Empty;
+ try
{
- Title = "Where do you want to store the settings?",
- InitialDirectory = Directory.Exists(xbmcDir) ? xbmcDir : defaultDir,
- FileName = "usb_2548_1001.xml",
- Filter = "xml files (*.xml)|*.xml|All files (*.*)|*.*",
- FilterIndex = 1
- };
-
- if (dialog.ShowDialog() == DialogResult.OK)
+ fs = (FileStream)dialog.OpenFile();
+ }
+ catch (Exception ex)
{
- FileStream fs = null;
- string error = string.Empty;
- try
- {
- fs = (FileStream)dialog.OpenFile();
- }
- catch (Exception ex)
- {
- error = ex.Message;
- }
- if (fs == null)
- {
- MessageBox.Show("Cannot open '" + dialog.FileName + "' for writing" + (error.Length > 0 ? ": " + error : string.Empty ), "Pulse-Eight USB-CEC Adapter", MessageBoxButtons.OK, MessageBoxIcon.Error);
- }
- else
- {
- StreamWriter writer = new StreamWriter(fs);
- StringBuilder output = new StringBuilder();
- output.AppendLine("");
- output.AppendLine("");
- output.AppendLine("");
- output.AppendLine("");
- output.AppendLine("");
- output.AppendLine("");
- output.AppendLine("");
- output.AppendLine("");
- output.AppendLine("");
- output.AppendLine("");
-
- // only supported by 1.5.0+ clients
- output.AppendLine("");
- output.AppendLine("");
- output.AppendLine("");
- output.AppendLine("");
- output.AppendLine("");
-
- output.Append("");
-
- output.Append("");
-
- output.AppendLine("");
- writer.Write(output.ToString());
- writer.Close();
- fs.Close();
- fs.Dispose();
- MessageBox.Show("Settings are stored.", "Pulse-Eight USB-CEC Adapter", MessageBoxButtons.OK, MessageBoxIcon.Information);
- }
+ error = ex.Message;
+ }
+ if (fs == null)
+ {
+ MessageBox.Show("Cannot open '" + dialog.FileName + "' for writing" + (error.Length > 0 ? ": " + error : string.Empty ), "Pulse-Eight USB-CEC Adapter", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ else
+ {
+ StreamWriter writer = new StreamWriter(fs);
+ StringBuilder output = new StringBuilder();
+ output.AppendLine("");
+ output.AppendLine("");
+ output.AppendLine("");
+ output.AppendLine("");
+ output.AppendLine("");
+ output.AppendLine("");
+ output.AppendLine("");
+ output.AppendLine("");
+ output.AppendLine("");
+ output.AppendLine("");
+
+ // only supported by 1.5.0+ clients
+ output.AppendLine("");
+ output.AppendLine("");
+ output.AppendLine("");
+ output.AppendLine("");
+ output.AppendLine("");
+
+ output.Append("");
+
+ output.Append("");
+
+ // only supported by 1.5.1+ clients
+ output.AppendLine("");
+ output.AppendLine("");
+
+ output.AppendLine("");
+ writer.Write(output.ToString());
+ writer.Close();
+ fs.Close();
+ fs.Dispose();
+ MessageBox.Show("Settings are stored.", "Pulse-Eight USB-CEC Adapter", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
- SetControlsEnabled(true);
}
+ SetControlsEnabled(true);
}
- else
- {
- if (!Lib.PersistConfiguration(Config))
- MessageBox.Show("Could not persist the new settings.", "Pulse-Eight USB-CEC Adapter", MessageBoxButtons.OK, MessageBoxIcon.Error);
- else
- MessageBox.Show("Settings are stored.", "Pulse-Eight USB-CEC Adapter", MessageBoxButtons.OK, MessageBoxIcon.Information);
- }
- SetControlsEnabled(true);
}
private void bReloadConfig_Click(object sender, EventArgs e)
@@ -1038,6 +1048,7 @@ namespace CecConfigGui
SetCheckboxChecked(cbActivateSource, Config.ActivateSource);
SetCheckboxChecked(cbPowerOffScreensaver, Config.PowerOffScreensaver);
SetCheckboxChecked(cbPowerOffOnStandby, Config.PowerOffOnStandby);
+ SetCheckboxChecked(cbSendInactiveSource, Config.SendInactiveSource);
UpdateSelectedDevice();
for (int iPtr = 0; iPtr < 15; iPtr++)