GNOME Media Player draft



Hi,

Remember Miguel's mail about a CD player component/CD player control? I've
had some free hours and came up with a general idea how this would work.

Basically, you'd use the following interfaces:

module Bonobo {

    module Media {

	typedef long Position;
	typedef float Volume;
	
	interface StreamListener: Bonobo::Unknown {

	    oneway void notifyPosition (in Position pos);
	};
	
	interface Stream: Bonobo::Unknown {

	    exception NotSupported {};
	    exception NotFound {};
	    exception InvalidPosition {};
	    
	    void addStreamListener (in StreamListener listener);
	    void removeStreamListener (in StreamListener listener) raises (NotFound);
	    
	    Position getLength () raises (NotSupported);
	    void seek (in Position pos) raises (InvalidPosition, NotSupported);

	    /* Position in seconds == position * getPositionToSeconds() */
	    float getPositionToSeconds ();
	    
	    void stop (); /* Pause at current position */
	    void play (); /* Play from current position */
	};
	
	interface Audio: Bonobo::Unknown {
	    void setVolume (in Volume vol);
	};

	interface Video: Bonobo::Unknown {
	    Control getVideoWidget ();
	};

	interface Tuneable: Bonobo::Unknown {
	    /* Not done yet */
	};

    };

};

To get a general idea how this would work, I've created a sample mp3
player component (based on the Music view of Nautilus) and a general
stream player GUI (it only uses the Stream interface, I'll update it to
support the Audio and the Video interface as well). Don't forget to edit
test.c, it has the mp3 filename hardcoded. You can find it at
http://cactus.rulez.org/files/bonobo-media.tar.gz.

A media player component would at least implement B:M:Stream. If it plays
back an audio stream (for example, an audio player component or a video
player that plays a stream with sound), it would also implement B:M:Audio.
Video playback is done by rendering the video to a Bonobo::Control, and
the player looking for the B:M:Video interface. Please note that the
actual video and audio streams are not passed thru CORBA, and that both
audio and video needs to be synchronized to the Stream position. The Video
control could optionally implement the Zoomable interface. I have no idea
yet how full-screen playback of video streams should work (maybe a void
setFullscreen (bool fullscreen) method in B:M:Video?)

A TV/Radio tuner would use the Tuneable and the Video/Audio interfaces,
but that's yet to be designed.

I'd like to hear your comments.

		Cactus

p.s.: Thanks, George, for GOB, it's a real pleasure to create new
GtkObject classes with it!

-- 
   .--= ULLA! =----------------------------.  finger cactus cactus rulez org
   \      http://cactus.rulez.org           \   for PGP public key
    `----------= cactus cactus rulez org =--'
A KGB keyboard has no <ESC> key.





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]