brutus Posted March 2, 2010 Share Posted March 2, 2010 How to change background image for myvideo/mymusic via com interface ? Which command ? (I checked IOSD and IDataM, nothing found) I would like to load different backgrounds dependent on the selected menu item for music/video (backdrops). Quote Link to comment
SnoopyDog Posted March 5, 2010 Share Posted March 5, 2010 (edited) Unfortunately, the class IOSDWindow (represents the "standard" windows) has no enumerator or "GetElement"/"GetOSDControl(ID)" function (or none that is documented). This would be a very important feature, but right now it's not there. You have to create your own window, then it's a "IOSDPlgWindow" class which has the missing important functions to query subcontrols. Edit: In other words: i found no documented function that can give me a reference to a subcontrol (e.g. the background image) for existing windows. Edited March 5, 2010 by SnoopyDog Quote Link to comment
Lars_MQ Posted March 5, 2010 Share Posted March 5, 2010 Of course you can. You can always iterate through the controls of a IOSDPlgWindow. (ControlCount, GetControl). You will have to query the control for a iosdimage interface. If it is successful you have to guess if it is the background image (width and height = osdskin width and height is a good indicator....) There will be no access though a dispatch Interface to the OSD. The reason is quite simple. Cross process marshalling et all is way to slow for this. A plugin runs in the sample process space as the main app and there is no need for marshalling... Quote Link to comment
SnoopyDog Posted March 6, 2010 Share Posted March 6, 2010 You can always iterate through the controls of a IOSDPlgWindow. Yepp, this is exactly what i was writing But the myMusic window is not a "IOSDPlgWindow" - it seems to be a "IOSDWindow" with no (documented) functions like "GetControl". IOSDPlgWindow (establishes the "GetControl" function ) is inherited from "IOSDWindow" (has no "GetControl"). I can get a reference to the "myMusic" window, but it's not a "IOSDPlgWindow". If i typecast it, then the result is NIL. Pls let me know if i'm wrong... Quote Link to comment
brutus Posted March 13, 2010 Author Share Posted March 13, 2010 (edited) For MyVideo window I would like to change the background image. I created a plugin, in this plugin I check on windowID, when it is 6 then I'm in MyVideo window, this window is standard window (IOSDImage), which was already mentioned in previous post. Because of this it is not possible to use MyWindow.GetControl(i). Is there any other solution ? WindowManager.ActiveWindow(value); if value <> NIL then begin MyWindow := value AS IOSDWindow; id := MyWindow.GetID(); if id = 6 then begin MyWindow := value AS IOSDWindow; if MyWindow <> NIL then begin // for i := 0 to MyWindow.ControlCount() - 1 do // begin // Image := MyWindow.GetControl(i) as IOSDImage; // if Image <> NIL then begin // if Image.ImageHeight > 640 then begin // pseudo-code: // get directory-name of selected item // image load random folder from backdrop folder // end; // end; // end; end; end; Edited March 13, 2010 by brutus Quote Link to comment
Lars_MQ Posted March 13, 2010 Share Posted March 13, 2010 No there isn't (yet). Quote Link to comment
SnoopyDog Posted March 13, 2010 Share Posted March 13, 2010 Thanks for the "yet" Quote Link to comment
Lars_MQ Posted March 13, 2010 Share Posted March 13, 2010 In the NEXT (after 4.3.1.82) Beta you can query the iOSDWindow for a IOSDWindow2 = interface(IUnknown) ['{3B262068-D05C-48F7-9717-0AC417C39BA9}'] function ControlCount: Integer; stdcall; procedure EnableControl(aID: Integer; Enabled: WordBool); stdcall; function GetControl(iControl: Integer): IOSDControl; stdcall; function GetControlbyNr(iControl: Integer): IOSDControl; stdcall; function GetFocusControl: IOSDControl; stdcall; function GetFocusControlID: Integer; stdcall; function GetFocusControlNr: Integer; stdcall; function GetHDC(var awidth , aheight : Integer): LongWord; stdcall; function NewOSDListItem: IOSDListItem; stdcall; procedure OnPopup; stdcall; procedure ReleaseHDC(ahdc : Longword); stdcall; procedure Remove(controlID: Integer); stdcall; procedure SetControlVisible(aID: Integer; Visible: WordBool); stdcall; end; Interface. Use with care, you can cause a lot of problems with it. Quote Link to comment
brutus Posted March 15, 2010 Author Share Posted March 15, 2010 I've tested it and it works, thanks a lot ! Quote Link to comment
LonelyPixel Posted April 3, 2010 Share Posted April 3, 2010 Could you please tell me where I can find that IOSDWindow interface? My version of DVBViewer (4.3.1.103) doesn't come with it. Neither does it feature an IOSDImage interface or something... It only has the IOSDItem and IWindowManager interfaces, but still I don't know through what methods to request instances of them. Quote Link to comment
LonelyPixel Posted April 16, 2010 Share Posted April 16, 2010 In case nobody of you know what I was talking about... I now know that this interface is only available to plug-ins through the undocumented internal COM API. It is not available through the public COM API that can be used from other processes. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.