Rockbox Technical Forums

Support and General Use => Plugins/Viewers => Topic started by: schnittlauch on October 30, 2007, 12:52:37 PM

Title: how do I start a video (any viewer) from my code?
Post by: schnittlauch on October 30, 2007, 12:52:37 PM
Hello,

I am pretty new to rockbox developing. I just started this a couple of weeks ago because I have to write a little application to use the ipod as a touristic city guide (university project).

Most of what I am doing consist of pretty dirty hacks as I have not much idea about c programming (also I am disabling most of the standard functionality because it would be too complicated for the users).

Now I'd like to include video playback. But the user should not have control over the filemenu.
The videos should be started from my code.
Unfortunately I can't seem to figure out how to start a viewer from code. Especially the mpegviewer! How is this done in the normal rockbox filemenu?

I thought that you would call the viewer.rock file with a couple of parameters - or am I wrong?

thanks in advance
cheers
schnittlauch
Title: Re: how do I start a video (any viewer) from my code?
Post by: dionoea on October 30, 2007, 01:24:32 PM
You can't launch any other plugin while one is runing. So what you're asking is basically impossible (unless your plugin has some video playback code).
Title: Re: how do I start a video (any viewer) from my code?
Post by: linuxstb on October 30, 2007, 01:39:19 PM
Whilst you can't start one plugin whilst another is running, you could just put the code in core Rockbox, meaning you would be capable of launching plugins.  It sounds like you may already be doing this, if you're disabling standard features.

As an example, you could look at how the "Properties" context menu item is handled - this starts the file properties viewer plugin with the currently selected file as a parameter.
Title: Re: how do I start a video (any viewer) from my code?
Post by: schnittlauch on October 30, 2007, 02:13:53 PM
thanks for the fast answers.

yes I am already messing with the core ;)
that's why it's sometimes a bit hard to find the right functions or even places to put my own code.

And shame on me for the fast posting. I just found it:
plugin_load("/.rockbox/rocks/viewers/mpegplayer.rock", "/test.mpg");
from plugins.c I think - I put it on a button and it works.