Jump to content

Change background image


Recommended Posts

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).

Link to comment

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 by SnoopyDog
Link to comment

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...

Link to comment
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...

Link to comment

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 by brutus
Link to comment

Thanks for the "yet" :D

Link to comment

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. :D

Link to comment
  • 3 weeks later...

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.

Link to comment
  • 2 weeks later...

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.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...