README - Media Player UI

=====
Notes
=====


This project does not use autotools, so there are no configure scripts or otherwise that
need to be run before building the project. 

The Media Player is consisted of several modules, which have to be builded to use every
aspect of the software. These are for example libmetalayer, mediaplayer-engine and
mediaplayer-ui. Each module has it's own makefile. To build a module, run "make" at the 
modules directory. To build a deb-package, run "make deb".

To see all the make targets, run "make help".


Issues
======

Dependency checking is not perfect. In case of compilation problems, do
"make clean all" before submitting bugs.


Video playing (as of Friday 16th June 2006)
===========================================

From the application developer's view, playing video streams in roughly similar to playing
other streams. The most notable difference is that the Media Server needs to be told where
to display the video in.

XID
---

There's a custom widget for just this purpose, implemented in ui/video-widget.c. There's a 
function video_widget_get_xid, which gets an XID of a specific widget. This ID should then
be given to the Engine by the library call mp_register_xid. 

Note that a widget doesn't have an XID before it's realized, which roughly is 
before it's displayed via gtk_show_widget. 

This is ideally all you need to do to get the video shown in the right spot: 

	1) create the video widget, attach it to a GtkBox
	2) make sure it's realized
	3) send its XID to the Engine

The UI already does that, supposedly, but Ferrix has reported problems with it; that an extra
GtkWindow appears where the movie plays. This may be related to the fullscreen toggling code,
since Ferrix started reporting about it after this code was inserted. 


Fullscreen
----------

This part is hazy. The old videoplayer uses a DBUS-call 'play', and gives as the first parameter
a flag for telling whether to play fullscreen or not. However, the Mediaserver DBUS API 1.0 
(gridinfo 34211) does not mention such a parameter. So, perhaps it is no longer needed, 
that you just need to call gtk_window_fullscreen -- I believe this is possible, since the Mediaserver 
knows the windows's XID, so it might be able to handle fullscreen without a different call.

Also what's different is that we use the call 'play_media' instead of 'play'. Difference between those
is that play_media is given the location of the played stream as the first parameter (DBUS API 1.0
again).

The fullscreening code is in now-playing.c, which calls ui_toggle_video_fullscreen (ui.c). It switches
a global fullscreen flag, calls the necessary gtk_window_*fullscreen, and reports about the change to the
Engine (reporting about this might not be needed, if the Mediaserver doesn't need the info).

When doing a fullscreen, playing is paused before the switch, and resumed in the idle loop.


Other
-----

osso-videoplayer is probably
the best reference to tackling the whole video playing issue. Look at user-interface.c and 
player-controller.c.

