[MPlayer-dev-eng] [PATCH-RFC] Implementing the osd preferences menu

Alban Bedel albeu at free.fr
Thu Sep 15 13:00:09 CEST 2005


Hi all,

i have finnaly got around doing some work on the OSD menu :) As the topic
say i'm try to finish the preference menu. It's not really finished
but basically working ;) Some large change in mplayer.c are requiered,
so i will try to give an overview of these changes.

Currently the osd menu mostly rely on the command system. This is fine to
fire a new menu, etc but it's not usable for configuration as "feedback"
is needed. One can play a bit with the command line options, but that's
not usable either because very often after modifying an option some extra
code (like a call to vo->ctrl, etc) still need to be run.
So something which allow setting and getting options at runtime is needed.
The first patch is my attempt at that: m_property.

It's a simple extension of the m_option api. m_option_t struct are used
to describe the properties, but instead of a pointer to a variable like
in m_config a pointer to a sysctl like function is used.
By reusing m_option the property values can easily be manipulated in a
generic way and converted to/from string.

However the code needed to set most properties is basicaly just the same
as for an equivalent command. Except that the command may need to show
something on the osd. So to avoid heavy code duplication i implemented
a command to property bridge that can handle most "property setting"
commands automaticaly. It set the property and optionaly show the new
value on the osd with the progbar or a message.

But the osd message code is crap :( So while at it with big hackings in
mplayer.c i ditched the osd_show_* mess and replaced it with a simple
message stack. With this all commands can easily show some message
on the osd. All they need to do is to #define a msg id and use it :)

Finnaly i also added commands to set/get properties. Set doesn't really
add anything currently but get allow to query a lot more things than
it's currently possible.

That's it for the "common" side. I really like to hear what you guys
think about all this, especially those working on/planning the new gui.


Now using that new api implementing the preference menu is quiet easier.
That's the second patch. I also made some changes adding 2 extra menu
commands (left and right) to allow quicker navigation with 6 buttons
(up/down/left/right/ok/cancel). All menus should still work with the 4
buttons navigation (up/down/ok/cancel), except the (unfinished)
preference menu which doesn't allow setting values with only 4 buttons.

	Albeu
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mplayer-property.diff
Type: application/octet-stream
Size: 63540 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20050915/45c72905/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mplayer-property-menu.diff
Type: application/octet-stream
Size: 10452 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20050915/45c72905/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: menu.conf
Type: application/octet-stream
Size: 2429 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20050915/45c72905/attachment-0002.obj>


More information about the MPlayer-dev-eng mailing list