Rockbox.org home
Downloads
Release release
Dev builds dev builds
Extras extras
themes themes
Documentation
Manual manual
Wiki wiki
Device Status device status
Support
Forums forums
Mailing lists mailing lists
IRC IRC
Development
Bugs bugs
Patches patches
Dev Guide dev guide
Search



Donate

Rockbox Technical Forums


Login with username, password and session length
Home Help Search Staff List Login Register
News:

Thank You for your continued support and contributions!

+  Rockbox Technical Forums
|-+  Rockbox Development
| |-+  Starting Development and Compiling
| | |-+  [solved] How can I start another plugin?
« previous next »
  • Print
Pages: [1]

Author Topic: [solved] How can I start another plugin?  (Read 3442 times)

Offline gnu

  • Member
  • *
  • Posts: 269
[solved] How can I start another plugin?
« on: February 04, 2008, 06:23:36 AM »
I wrote a little, hacky viewer that opens a mp3 file, extracts the unsynced lyrics, saves them to a file  and opens the file with the text viewer plugin. The extracting of the lyrics itself works OK, but I'm having problems with displaying them.
I simply wanted to start the text viewer plugin from within my plugin, but I was told this is impossible.
Is there really no way to start another plugin? It wouldn't have to run simultanosly to my plugin, it would only have to be started AFTER my plugin has terminated. How can I do that?

p.s.: I would ask this on IRC, but my browser seems to crash after a few minutes every time I open the IRC channel.... ??
« Last Edit: February 06, 2008, 06:26:08 AM by gnu »
Logged

Offline shotofadds

  • Developer
  • Member
  • *
  • Posts: 368
Re: Plugin works in Sim, but not on target
« Reply #1 on: February 04, 2008, 07:08:35 AM »
One possible cause is stack exhaustion, since the target will almost certainly have less available stack space than the sim. For example, if you declare a large array inside a function, this will eat up a huge amount of stack space. Might it be that?

EDIT: The original title of this thread was "Plugin works in sim but not on target" - hence my slightly cryptic reply.
« Last Edit: February 06, 2008, 06:54:47 AM by shotofadds »
Logged

Offline gnu

  • Member
  • *
  • Posts: 269
Re: How can I start another plugin?
« Reply #2 on: February 04, 2008, 08:49:07 AM »
Sorry, now I edited the title of my thread so it actually describes what I want.

I want my plugin to start another plugin. Can I do that?
Logged

Offline nls

  • Developer
  • Member
  • *
  • Posts: 460
Re: How can I start another plugin?
« Reply #3 on: February 04, 2008, 10:01:32 AM »
Only one plugin can run at a time but it may be possible to tell rockbox to start another plugin from inside a plugin, which will then replace the currently running one. Check out how rockbox loads plugins and add that function(s) to the plugin api and try it out :)
Logged

Offline mschneider

  • Member
  • *
  • Posts: 235
Re: How can I start another plugin?
« Reply #4 on: February 04, 2008, 11:45:33 AM »
Yes it is possible. Take a look at plugin_load in plugin.h.
Logged

Offline gnu

  • Member
  • *
  • Posts: 269
Re: How can I start another plugin?
« Reply #5 on: February 04, 2008, 01:45:40 PM »
Well, I tried that and it does not work. I always get the following error message from cygwin.

Code: [Select]
/home/Admin/rockbox/apps/plugins/lyric_viewer.c:25: undefined reference to `_plugin_load'
collect2: ld returned 1 exit status
make[2]: *** [/home/Admin/rockbox/sim_x5/apps/plugins/lyric_viewer.rock] Error 1

This is quite strange, since the function "plugin_load" is declared in plugin.h and I've included this .h file!.
And why does the error message say " _plugin_load"?

I'm out of my (admittedly quite limited ;) ) wits, so I've attached my lyric_viewer.c; the only important bit is the "plugin_load" at the end of it.
* lyric_viewer.c (3.76 kB - downloaded 147 times.)
« Last Edit: February 04, 2008, 01:47:33 PM by gnu »
Logged

Offline mschneider

  • Member
  • *
  • Posts: 235
Re: How can I start another plugin?
« Reply #6 on: February 04, 2008, 01:51:57 PM »
You need to do rb->plugin_load because the function is a member of the rockbox plugin api structure.
Logged

Offline gnu

  • Member
  • *
  • Posts: 269
Re: How can I start another plugin?
« Reply #7 on: February 04, 2008, 02:08:26 PM »
No, it's not.
I get something like "the struct plugin_api has no member 'plugin_load'" when I try that.
As far as I can tell, it's a 'normal' function declared inside of plugin.h; but nevertheless my plugin can't see it...
Logged

Offline Job Van Dam

  • Member
  • *
  • Posts: 167
Re: How can I start another plugin?
« Reply #8 on: February 04, 2008, 06:50:49 PM »
If you just made this plugin for yourself and have no desire to make it part of commercially released Rockbox you could just add it to the plugin API.
It would be bad practice though because of the redundancy but it would work.
Logged

Offline Llorean

  • Member
  • *
  • Posts: 12931
Re: How can I start another plugin?
« Reply #9 on: February 05, 2008, 02:28:41 AM »
There's no "commercially" released Rockbox...
Logged

Offline gnu

  • Member
  • *
  • Posts: 269
Re: How can I start another plugin?
« Reply #10 on: February 06, 2008, 06:25:51 AM »
Solved - I used the list widget to display my text.
Logged

  • Print
Pages: [1]
« previous next »
+  Rockbox Technical Forums
|-+  Rockbox Development
| |-+  Starting Development and Compiling
| | |-+  [solved] How can I start another plugin?
 

  • SMF 2.0.17 | SMF © 2019, Simple Machines
  • Rockbox Privacy Policy
  • XHTML
  • RSS
  • WAP2

Page created in 0.103 seconds with 15 queries.