public virtual void ShowDialog(CecConfigGUI gui, CecLogicalAddress address, ref LibCecSharp lib, bool devicePresent, CecVendorId vendor, bool isActiveSource, ushort physicalAddress, CecVersion version, CecPowerStatus power, string osdName, string menuLanguage) { DeviceInformation di = new DeviceInformation(Gui, Address, ref Lib, devicePresent, vendor, isActiveSource, physicalAddress, version, power, osdName, menuLanguage); Gui.DisplayDialog(di, false); }
/// <summary> /// /// </summary> /// <param name="aDeviceName"></param> /// <param name="aHdmiPort"></param> public Client(string aDeviceName, byte aHdmiPort, CecDeviceType aDeviceType = CecDeviceType.PlaybackDevice) { Config = new LibCECConfiguration(); Config.DeviceTypes.Types[0] = aDeviceType; Config.DeviceName = aDeviceName; Config.HDMIPort = aHdmiPort; //Config.ClientVersion = LibCECConfiguration.CurrentVersion; Config.SetCallbacks(this); iLib = new LibCecSharp(Config); iLib.InitVideoStandalone(); if (Static != null) { Trace.WriteLine("WARNING: CEC client static already exists"); } else { Static = this; } //Trace.WriteLine("CEC Parser created - libCEC version " + Lib.VersionToString(Config.ServerVersion)); Trace.WriteLine("INFO: CEC Parser created - libCEC version " + Config.ServerVersion); }
public virtual void ShowDialog(CecLogicalAddress address, ref LibCecSharp lib, bool devicePresent, CecVendorId vendor, bool isActiveSource, ushort physicalAddress, CecVersion version, CecPowerStatus power, string osdName, string menuLanguage) { DeviceInformation di = new DeviceInformation(_controller, _address, ref _lib, devicePresent, vendor, isActiveSource, physicalAddress, version, power, osdName, menuLanguage); _controller.DisplayDialog(di, false); }
public CecSharpClient() { CecDeviceTypeList types = new CecDeviceTypeList(); types.Types[0] = CecDeviceType.PlaybackDevice; Lib = new LibCecSharp("CEC Tester", types); LogLevel = (int) CecLogLevel.All; Console.WriteLine("CEC Parser created - libcec version " + Lib.GetLibVersionMajor() + "." + Lib.GetLibVersionMinor()); }
public CecSharpClient() { CecDeviceTypeList types = new CecDeviceTypeList(); types.Types[0] = CecDeviceType.RecordingDevice; Lib = new LibCecSharp("CEC Tester", types); LogLevel = (int)CecLogLevel.All; Console.WriteLine("CEC Parser created - libcec version " + Lib.GetLibVersionMajor() + "." + Lib.GetLibVersionMinor()); }
public CecClient() { config = new LibCECConfiguration(); config.DeviceTypes.Types[0] = CecDeviceType.PlaybackDevice; config.DeviceName = "kek"; config.ClientVersion = LibCECConfiguration.CurrentVersion; config.HDMIPort = 2; // TODO: make this configurable logLevel = (int)CecLogLevel.All; lib = new LibCecSharp(this, config); }
public CecSharpClient() { Config = new LibCECConfiguration(); Config.DeviceTypes.Types[0] = CecDeviceType.RecordingDevice; Config.DeviceName = "Pulse Eight USB CEC Adapter"; Config.ClientVersion = LibCECConfiguration.CurrentVersion; Config.SetCallbacks(this); LogLevel = (int)CecLogLevel.All; Lib = new LibCecSharp(Config); Lib.InitVideoStandalone(); }
public CECClient() { Config = new LibCECConfiguration(); Config.DeviceTypes.Types[0] = CecDeviceType.RecordingDevice; Config.DeviceName = "Cenero Conferencing System"; Config.ClientVersion = LibCECConfiguration.CurrentVersion; Config.SetCallbacks(this); LogLevel = (int)CecLogLevel.All; Lib = new LibCecSharp(Config); Lib.InitVideoStandalone(); }
public DeviceInformation(CECController controller, CecLogicalAddress address, ref LibCecSharp lib, bool devicePresent, CecVendorId vendor, bool isActiveSource, ushort physicalAddress, CecVersion version, CecPowerStatus power, string osdName, string menuLanguage) { _controller = controller; _lib = lib; Address = address; InitializeComponent(); lDevice.Text = lib.ToString(address); lLogicalAddress.Text = String.Format("{0,1:X}", (int)address); Update(devicePresent, vendor, isActiveSource, physicalAddress, version, power, osdName, menuLanguage); }
/// <summary> /// Constructor /// </summary> public CecClient() { CecConfig = new LibCECConfiguration(); CecConfig.DeviceTypes.Types[0] = CecDeviceType.RecordingDevice; CecConfig.DeviceName = "Avid TV Switch"; CecConfig.ClientVersion = LibCECConfiguration.CurrentVersion; CecConfig.ActivateSource = false; CecConfig.SetCallbacks(this); CecLib = new LibCecSharp(CecConfig); CecLib.InitVideoStandalone(); }
public CecSharpClient() { Config = new LibCECConfiguration(); Config.DeviceTypes.Types[0] = CecDeviceType.RecordingDevice; Config.DeviceName = "CEC Tester"; Config.ClientVersion = CecClientVersion.Version1_5_0; Config.SetCallbacks(this); LogLevel = (int)CecLogLevel.All; Lib = new LibCecSharp(Config); Console.WriteLine("CEC Parser created - libcec version " + Lib.ToString(Config.ServerVersion)); }
public CecSharpClient() { Config = new LibCECConfiguration(); Config.DeviceTypes.Types[0] = CecDeviceType.RecordingDevice; Config.DeviceName = "CEC Tester"; Config.ClientVersion = LibCECConfiguration.CurrentVersion; LogLevel = (int)CecLogLevel.All; Lib = new LibCecSharp(this, Config); Lib.InitVideoStandalone(); Console.WriteLine("CEC Parser created - libCEC version " + Lib.VersionToString(Config.ServerVersion)); }
public virtual void DeInit() { if (_lib != null) { _lib.DisableCallbacks(); _lib.Close(); _lib.Dispose(); } _connected = false; _lib = null; _libConfig = null; _cecConfig = null; _repeatTimer = null; }
public CecConfigGUI() { Config = new LibCECConfiguration(); Config.DeviceTypes.Types[0] = CecDeviceType.RecordingDevice; Config.DeviceName = "CEC Config"; Config.GetSettingsFromROM = true; Config.ClientVersion = CecClientVersion.Version1_5_1; Callbacks = new CecCallbackWrapper(this); Config.SetCallbacks(Callbacks); LoadXMLConfiguration(ref Config); Lib = new LibCecSharp(Config); InitializeComponent(); LoadButtonConfiguration(); ActiveProcess = new ConnectToDevice(ref Lib, Config); ActiveProcess.EventHandler += ProcessEventHandler; (new Thread(ActiveProcess.Run)).Start(); }
/// <summary> /// Initialize the Cec bus without callback methods (no need) /// </summary> /// <param name="timeout">Timeout for the connections to the bus. Must be positive</param> /// <exception cref="CecException">Unable to initialize Cec Bus or can't find controller</exception> /// <exception cref="ArgumentOutOfRangeException">timeout not strictly positive</exception> public CecBus(int timeout) { if (timeout <= 0) { throw new ArgumentOutOfRangeException(nameof(timeout)); } this.timeout = timeout; configuration = new LibCECConfiguration(); configuration.DeviceTypes.Types[0] = CecDeviceType.PlaybackDevice; configuration.DeviceName = Resources.StrCecDeviceName; configuration.ClientVersion = LibCECConfiguration.CurrentVersion; configuration.SetCallbacks(this); connection = new LibCecSharp(configuration) ?? throw new CecException(Resources.ErrorNoCecBus); connection.InitVideoStandalone(); // Get the controller on the bus controller = null; CecAdapter[] adapters = connection.FindAdapters(string.Empty); if (adapters.Length > 0) { controller = adapters[controllerId]; } else { throw new CecException(Resources.ErrorNoCecController); } // Connection must be openned before going to suspend mode as the SCM stop the thread if we try to open // the connection during power event because it's an async operation if (!connection.Open(controller.ComPort, timeout)) { throw new CecException(Resources.ErrorNoCecControllerConnection); } // Register active source of the connection connection.SetActiveSource(CecDeviceType.PlaybackDevice); }
public CecSharpClient() { Config = new LibCECConfiguration(); Config.BaseDevice = CecLogicalAddress.AudioSystem; Config.HDMIPort = 5; Config.DeviceTypes.Types[0] = CecDeviceType.RecordingDevice; Config.DeviceName = "CEC PX"; Config.ClientVersion = LibCECConfiguration.CurrentVersion; //Config.AutodetectAddress = false; //LogLevel = (int)CecLogLevel.All & ~(int)CecLogLevel.Debug & ~(int)CecLogLevel.Traffic; Lib = new LibCecSharp(this, Config); Lib.InitVideoStandalone(); //if (Lib.IsActiveDevice(CecLogicalAddress.Tv) && !Lib.GetDevicePowerStatus(CecLogicalAddress.Tv).Equals(CecPowerStatus.On)) //{ // Lib.SetActiveSource(CecDeviceType.Reserved); //} Console.WriteLine("CEC Parser created - libCEC version " + Lib.VersionToString(Config.ServerVersion)); }
public LibCECClient() { var config = new LibCECConfiguration(); config.DeviceTypes.Types[0] = CecDeviceType.PlaybackDevice; config.DeviceName = "MP-S"; config.ClientVersion = LibCECConfiguration.CurrentVersion; config.SetCallbacks(this); //config.PhysicalAddress = 1000; config.HDMIPort = 1; config.AdapterType = CecAdapterType.PulseEightExternal; config.TvVendor = CecVendorId.Philips; config.ActivateSource = false; _logLevel = (int)CecLogLevel.All; Lib = new LibCecSharp(config); Lib.InitVideoStandalone(); Log("LibCECClient: Successfully created LibCEC Parser with version: " + Lib.VersionToString(config.ServerVersion)); }
public UpdateConfiguration(LibCecSharp lib, LibCECConfiguration config) { _lib = lib; _config = config; }
public ConnectToDevice(ref LibCecSharp lib, LibCECConfiguration config) { Lib = lib; Config = config; }
public UpdateConfiguration(ref LibCecSharp lib, LibCECConfiguration config) { Lib = lib; Config = config; }
public ShowDeviceInfo(CecConfigGUI gui, ref LibCecSharp lib, CecLogicalAddress address) { Gui = gui; Lib = lib; Address = address; }
public ActivateSource(LibCecSharp lib) { _lib = lib; }
public UpdateDeviceInfo(CECController controller, LibCecSharp lib, DeviceInformation dialog) : base(controller, lib, dialog.Address) { _dialog = dialog; }
public SendActivateSource(LibCecSharp lib, CecLogicalAddress address) { _lib = lib; _address = address; }
public SendStandby(ref LibCecSharp lib, CecLogicalAddress address) { Lib = lib; Address = address; }
public SendStandby(LibCecSharp lib, CecLogicalAddress address) { _lib = lib; _address = address; }
public UpdateConnectedDevice(ref LibCecSharp lib, CecLogicalAddress address, int portNumber) { Lib = lib; Address = address; PortNumber = portNumber; }
public UpdateConnectedDevice(LibCecSharp lib, CecLogicalAddress address, int portNumber) { _lib = lib; _address = address; _portNumber = portNumber; }
public RescanDevices(LibCecSharp lib) { _lib = lib; }
public SendImageViewOn(ref LibCecSharp lib, CecLogicalAddress address) { Lib = lib; Address = address; }
public UpdateDeviceInfo(CecConfigGUI gui, ref LibCecSharp lib, DeviceInformation dialog) : base(gui, ref lib, dialog.Address) { Dialog = dialog; }
public SendImageViewOn(LibCecSharp lib, CecLogicalAddress address) { _lib = lib; _address = address; }
public ShowDeviceInfo(CECController controller, LibCecSharp lib, CecLogicalAddress address) { _controller = controller; _lib = lib; _address = address; }
public UpdatePhysicalAddress(LibCecSharp lib, ushort physicalAddress) { _lib = lib; _physicalAddress = physicalAddress; }
public UpdatePhysicalAddress(ref LibCecSharp lib, ushort physicalAddress) { Lib = lib; PhysicalAddress = physicalAddress; }
public override void ShowDialog(CecLogicalAddress address, ref LibCecSharp lib, bool devicePresent, CecVendorId vendor, bool isActiveSource, ushort physicalAddress, CecVersion version, CecPowerStatus power, string osdName, string menuLanguage) { _dialog.Update(devicePresent, vendor, isActiveSource, physicalAddress, version, power, osdName, menuLanguage); }
public void Start() { Config = new LibCECConfiguration(); Config.DeviceTypes.Types[0] = CecDeviceType.RecordingDevice; Config.DeviceName = "CEC Tester"; Config.ClientVersion = CecClientVersion.CurrentVersion; Config.SetCallbacks(this); LogLevel = (int)CecLogLevel.All; Lib = new LibCecSharp(Config); Lib.InitVideoStandalone(); CecAdapter[] adapters = Lib.FindAdapters(string.Empty); if (adapters.Length > 0) { Console.WriteLine("Found CEC adapters"); Lib.Open(adapters[0].ComPort, 1000); this.EnsureActive(); } else { Console.WriteLine("Did not find any CEC adapters"); } }
public ConnectToDevice(LibCecSharp lib, LibCECConfiguration config) { _lib = lib; _config = config; }
public override void ShowDialog(CecConfigGUI gui, CecLogicalAddress address, ref LibCecSharp lib, bool devicePresent, CecVendorId vendor, bool isActiveSource, ushort physicalAddress, CecVersion version, CecPowerStatus power, string osdName, string menuLanguage) { Dialog.Update(devicePresent, vendor, isActiveSource, physicalAddress, version, power, osdName, menuLanguage); }
public SendActivateSource(ref LibCecSharp lib, CecLogicalAddress address) { Lib = lib; Address = address; }
public RescanDevices(ref LibCecSharp lib) { Lib = lib; }
public GetCurrentPhysicalAddress(LibCecSharp lib) { _lib = lib; }
public virtual void LoadConfig() { WriteLog("Loading configuration..."); if (_cecConfig == null) { WriteLog("Configuration not set, abort"); return; } _fastScrolling = _cecConfig.FastScrolling; _fastScrollingKeyCount = _cecConfig.FastScrollingRepeatDelay; _repeatTimer = new System.Timers.Timer(_cecConfig.FastScrollingRepeatRate); _extensiveLogging = _cecConfig.ExtensiveLogging; _disableScreensaver = _cecConfig.DisableScreensaver; _requireDelayBetweenKeys = _cecConfig.RequireDelayBetweenKeys; if (_fastScrolling) { _repeatTimer.Elapsed += new ElapsedEventHandler(OnRepeatKeyPressEvent); _repeatTimer.AutoReset = true; } // Build configuration for new Lib try { if (_libConfig == null) { _libConfig = new LibCECConfiguration(); _libConfig.SetCallbacks(this); } _libConfig.DeviceTypes.Types[0] = _cecConfig.DeviceType; _libConfig.DeviceName = _cecConfig.OsdName; _libConfig.ClientVersion = LibCECConfiguration.CurrentVersion; _libConfig.WakeDevices.Clear(); _libConfig.PowerOffDevices.Clear(); _libConfig.PhysicalAddress = 0; _libConfig.ActivateSource = false; // Control this manually based on settings. _libConfig.HDMIPort = (byte)_cecConfig.HdmiPort; _libConfig.BaseDevice = _cecConfig.ConnectedTo; if (_cecConfig.ForcePhysicalAddress) { WriteLog("Physical address overriding enabled, ignoring HDMI port an using address: " + _cecConfig.PhysicalAddress); _libConfig.PhysicalAddress = ushort.Parse(_cecConfig.PhysicalAddress, System.Globalization.NumberStyles.AllowHexSpecifier); } WriteLog("Configuration loaded succesfully."); if (_lib == null) { _lib = new LibCecSharp(_libConfig); WriteLog("Lib created succesfully."); } else { _lib.SetConfiguration(_libConfig); _lib.EnableCallbacks(this); WriteLog("Lib configuration updated"); } } catch (Exception ex) { WriteLog("Could not configure libCec." + ex.ToString()); throw; } }