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:

Welcome to the Rockbox Technical Forums!

+  Rockbox Technical Forums
|-+  Rockbox Development
| |-+  Starting Development and Compiling
| | |-+  Writing my first program.
« previous next »
  • Print
Pages: [1]

Author Topic: Writing my first program.  (Read 3522 times)

Offline employeeno5

  • Member
  • *
  • Posts: 3
Writing my first program.
« on: September 03, 2009, 01:03:37 PM »
I do interval training in which I require some form of alert after 30 seconds and then another alert after an additional 60 seconds, with that interval repeating. It would be great to have Rockbox emit a beep into my headphones in this 30/60 second intervals.

So I'm going to set out to write myself a plugin that does this. I'm not a coder. I understand some of the basic ideas behind programming and learned to use QBASIC back in elementary school and have taken a few Python tutorials for fun. However, really, I know nothing. That's ok, I'm looking at attempting this simple program as great learning activity.

However, I don't know where to start, especially in terms of doing this for Rockbox. Does it matter what language I choose? How do I compile for Rockbox and specifically the hardware I have it running on (iPod Video)?

I'm hoping there might be some beginer documentation somewhere or at least some friendly advice pointing me in the right direction. I'm happy figure out how to write the code myself. What I'm more curious about is if the language used bears any importance with Rockbox development and how one goes about compiling for an iPod running Rockbox once you're code is testing/complete.

I do apologize if these questions seem ridiculous, but like I said, I have no prior background in writing code though I'm eager to learn.
Logged

Offline Domonoky

  • Developer
  • Member
  • *
  • Posts: 205
Re: Writing my first program.
« Reply #1 on: September 03, 2009, 02:01:06 PM »
About making plugins:
They are written in C, you can find many tutorials for that via google :-)
You should first start by getting the source via svn, and set up a build enviroment (search the wiki on how todo that) and make sure you can build rockbox from source.
Then start reading apps/plugins/helloworld.c, modify it, try it on target and learn...

Another possibility for your needs might be the Lua plugin. Its a script language, so you can make rockbox do things without the need for compilers and a build-enviroment. Its more limited and slower then a normal plugin, but might be enough for your needs. Search the Wiki for more information about it.
Logged

Offline froggyman

  • Member
  • *
  • Posts: 214
Re: Writing my first program.
« Reply #2 on: September 03, 2009, 05:49:55 PM »
One book that you may want to consider getting is "The C programming language" by Brian W. Kernighan and Dennis M. Ritchie. I am currently reading it and it is great :)
Logged
iPod Video 5.5G 30GB - Now Dead :(
Sansa Fuzev2 4GB

"To prevent this day from getting worse, I'll just read ERROR as GOOD THING"

Offline ipodzen

  • Member
  • *
  • Posts: 7
Re: Writing my first program.
« Reply #3 on: June 15, 2010, 02:05:32 AM »
I'm writing a very similar program to the one described here.  Everything is working correctly except the sound notifications.  Are there any quick dirty ways to play sounds and not interrupt music playing?
Logged

Offline Grahack

  • Member
  • *
  • Posts: 13
Re: Writing my first program.
« Reply #4 on: June 16, 2010, 03:28:02 AM »
You'll find a void pcmbuf_beep(unsigned int frequency, size_t duration, int amplitude) function here:

Logged

Offline ipodzen

  • Member
  • *
  • Posts: 7
Re: Writing my first program.
« Reply #5 on: June 20, 2010, 11:19:28 PM »
Thank you!  Worked like a charm.
Logged

Offline renne

  • Member
  • *
  • Posts: 1
Re: Writing my first program.
« Reply #6 on: June 23, 2010, 08:02:27 AM »
Quote from: Grahack on June 16, 2010, 03:28:02 AM
You'll find a void pcmbuf_beep(unsigned int frequency, size_t duration, int amplitude) function here:

What is the range and unit of the parameter "amplitude"?

What is the recommended way for user termination of a "pcmbuf_beep" loop?
Logged

  • Print
Pages: [1]
« previous next »
+  Rockbox Technical Forums
|-+  Rockbox Development
| |-+  Starting Development and Compiling
| | |-+  Writing my first program.
 

  • SMF 2.0.18 | SMF © 2021, Simple Machines
  • Rockbox Privacy Policy
  • XHTML
  • RSS
  • WAP2

Page created in 0.039 seconds with 17 queries.