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
| | |-+  Hold button handiling - A nudge in the right direction? :)
« previous next »
  • Print
Pages: [1]

Author Topic: Hold button handiling - A nudge in the right direction? :)  (Read 1475 times)

Offline motionman95

  • Member
  • *
  • Posts: 108
  • aka coderkid
    • coderkid
Hold button handiling - A nudge in the right direction? :)
« on: March 11, 2009, 10:30:30 AM »
I'm trying to add some extra lines of code to what the hold button does (I'm not making a plugin) - but I can't seem to find the RockBox file that handles that. I looked at this thread:

http://forums.rockbox.org/index.php?topic=12900.0

But that file seems like the improper place to put my code, if I'm right.
What file does RockBox use to handle the Hold button?
Logged
My MP3 Player: Sansa C250 (2GB)
OS: Win XP SP3

Offline saratoga

  • Developer
  • Member
  • *
  • Posts: 8974
Re: Hold button handiling - A nudge in the right direction? :)
« Reply #1 on: March 11, 2009, 01:13:37 PM »
Quote from: motionman95 on March 11, 2009, 10:30:30 AM
What file does RockBox use to handle the Hold button?

Its handled by the button driver for each target.  The file in that thread is for the e200.
Logged

Offline motionman95

  • Member
  • *
  • Posts: 108
  • aka coderkid
    • coderkid
Re: Hold button handiling - A nudge in the right direction? :)
« Reply #2 on: March 11, 2009, 05:27:13 PM »
I found the proper file, (button-c200) and added this:

Quote
/*At the top of the file I included plugin.h*/
if(button_hold){
static const char filename[] = PLUGIN_APPS_DIR "/RockLock.rock";
plugin_load((char*)filename, NULL);
}

Instead of launching the plugin when I move the hold button, it splashes the message "Loading..." then freezes. What's wrong?
Logged
My MP3 Player: Sansa C250 (2GB)
OS: Win XP SP3

Offline mcuelenaere

  • Developer
  • Member
  • *
  • Posts: 392
Re: Hold button handiling - A nudge in the right direction? :)
« Reply #3 on: March 11, 2009, 07:29:35 PM »
Quote from: motionman95 on March 11, 2009, 05:27:13 PM
I found the proper file, (button-c200) and added this:

Quote
/*At the top of the file I included plugin.h*/
if(button_hold){
static const char filename[] = PLUGIN_APPS_DIR "/RockLock.rock";
plugin_load((char*)filename, NULL);
}

Instead of launching the plugin when I move the hold button, it splashes the message "Loading..." then freezes. What's wrong?
If you've added this code to 'firmware/target/arm/sandisk/sansa-c200/button-c200.c' (you don't clearly state which file): that's totally incorrect.

At first you should understand the separation between firmware/ and apps/: firmware/ code should *never* call any apps/ code, only the opposite is allowed.

If I would be you, I would try adding this code to apps/main.c or apps/root_menu.c (and replace button_hold with button_hold(), button_hold isn't declared globally).

edit:
apps/main.c already has something you want: AUTOROCK.
« Last Edit: March 11, 2009, 07:31:28 PM by mcuelenaere »
Logged

Offline motionman95

  • Member
  • *
  • Posts: 108
  • aka coderkid
    • coderkid
Re: Hold button handiling - A nudge in the right direction? :)
« Reply #4 on: March 12, 2009, 09:21:47 AM »
In that case, what function in main.c should I put my code? I don't want to use AUTOROCK because I don't need I to start every time I start my player, only when I switch on the hold button.
Logged
My MP3 Player: Sansa C250 (2GB)
OS: Win XP SP3

  • Print
Pages: [1]
« previous next »
+  Rockbox Technical Forums
|-+  Rockbox Development
| |-+  Starting Development and Compiling
| | |-+  Hold button handiling - A nudge in the right direction? :)
 

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

Page created in 0.073 seconds with 15 queries.