Read Preference Values in skin

About usage, announcement and development of skins for VLC
brockb
Blank Cone
Blank Cone
Posts: 22
Joined: 26 Feb 2007 17:59

Read Preference Values in skin

Postby brockb » 16 Mar 2007 17:31

Is it possible to read width/height, X/Y coordinates from video preferences in the skin and set a skin's window's position and size based on those preferences? The reason I ask... I want to be able to set the position of the video window within the skin based on what is set in the video preferences. The little snafu though is... I have to have the player window embedded into the player (this is to prevent the little flash to the desktop between moving from one video to the next).

So the way I have it set up right now in my skin:

Code: Select all

<Window id="video_window" x="0" y="0" dragdrop="true" playondrop="true" visible="true"> <Layout width="600" height="400" maxheight="1080" maxwidth="1920" id="video"> <Group x="0" y="0"> <Anchor x="-1" y="0" priority="2"/> <Video x="0" y="0" width="600" height="400" id="video2"/> </Group> </Layout> </Window>
Is it possible to set the width & height / x&y coordinates of this window dynamically to what the user specifies in the video preferences?

Like right now I changed the video preferences to:
height=300
width=200
x=100
y=100

But because the skin is setup for 600x400 at 0,0... it shows a 600x400 at 0,0.

Maybe I'm going about it all wrong... but if anyone else knows how to create a specifically sized and positioned window that uses the video preferences but also doesn't show the desktop when it has to redraw that window after loading different video types... I'd like to know. :wink:

I'm sure it would be better to go with the borderless window not embedded into the player... but I'd have to figure out a way to prevent the desktop flashing and the only way I can immediately fix that is to set a black desktop and hide the icons.

Any thoughts would be appreciated.

Thanks.

ipkiss
Big Cone-huna
Big Cone-huna
Posts: 695
Joined: 23 Nov 2003 01:49

Postby ipkiss » 16 Mar 2007 19:16

It's not possible to adapt the size of the skin window from the size of the video specified in the preferences. However, the 'autoresize' attribute of the Video control should have the skin window resized to the size of the currently played video (which seems to suit your needs, doesn't it?).
Note that the initial position and size are also saved in the preferences when exiting VLC. You could manually update the "skins2-last" option before starting VLC to have the windows positionned like you want.

Of course, all these are work-arounds, and the right thing to do would be to prevent the desktop from being shown directly in the code. This is a known problem, but I don't know if someone is working on it.

brockb
Blank Cone
Blank Cone
Posts: 22
Joined: 26 Feb 2007 17:59

Postby brockb » 16 Mar 2007 20:07

Thanks for the reply. It doesn't quite fit my needs... we need to allow the user to have pixel precision control over position and size of video played. I've tried a couple of different "hacks" to the skin but to no avail. I just finished creating a 3000x2000 pixel blank window with a black background to cover the entire screen... and this works until you accidentally click on it which in turn hides all the other control windows and renders them useless because they are hidden. Since there is no way to set layer priorities for the windows in the skin you really can't tell your control windows to stay on top of your bg window. I've tried putting the bg and control groups in the same window... but whenever you move the control group your are moving the entire window which in turn moves the bg as well so that doesn't quite work either.

Next stop... diving into the source. I don't know how comfortable I am with compiling my own stuff but when you run into a wall you either have to go around it or climb over it some how, right? I'm not going to begin to tackle the flashing to the desktop (out of my league)... but I'll see if I can somehow access the size and position variables and try to draw a black background behind the window. I kinda need that background there anyways because since this video is being sent to a sign via screen-capture I don't want the sign showing desktop whenever a video isn't being displayed or is stopped... I need it to show a black background anyways.

Oh well... wish me luck. :)

ipkiss
Big Cone-huna
Big Cone-huna
Posts: 695
Joined: 23 Nov 2003 01:49

Postby ipkiss » 16 Mar 2007 21:50

A rather quick hack in the source would be to keep your solution with a background window and a control window, and to make the latter "always on top". This is a way to force the layer priority...

Currently, setting the skin on top sets the attribute to all the windows, so they are equivalent. What you could do is change it so that only the control window is on top (have a look at ./modules/gui/skins2/commands/cmd_on_top.cpp for an example of code changing the "on top" status).

BTW, I don't know if it would be ok for you, but without changing the code you could have 2 instances of VLC: one on top (with a control window), and another one (with a different skin) for the background. The second instance doesn't even need to be VLC of course, any black background would do.

The problem with both solutions is that the Ctrl-T hotkey can be used to change the on-top status of a skin, so you may want to disable this behaviour (see ./modules/gui/skins2/src/top_window.cpp, line 238).

brockb
Blank Cone
Blank Cone
Posts: 22
Joined: 26 Feb 2007 17:59

Postby brockb » 16 Mar 2007 22:38

thanks... I'll give that a try!


Return to “Skins”

Who is online

Users browsing this forum: No registered users and 3 guests