Rockbox.org home
release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide



Rockbox mail archive

Subject: development questions

development questions

From: Ray Lambert <listlizard_at_interthingy.net>
Date: Thu, 13 Jan 2005 00:45:10 -0500

Hi,

I've been using rockbox, I think, for two years now in my JBR, and it's
a great piece of work. Thanks to everyone for their hard work on it!
It's made a big difference not being stuck with Archos' lame rom all
this time. :|

I'm a musician (and programmer) and I've been using my rockbox a lot for
learning songs. There's one feature that I've been wanting for a
loooong time that would greatly help with this and I decided last week
to get my feet wet with rockbox development and write it! That would be
the A-B Repeat function.

Most of you probably know what that is already, but for those of don't:
this feature allows the user to set two arbitrary points within a song
and the rockbox then repeatedly plays the section between those two
points. So, when point B is reached the player pauses and automatically
jumps to point A to resume playing.

I do know of at least one patch that already implements this but, when I
looked at it I wasn't happy with the implementation and the integration
with rockbox. So I decided to write my own.

I'm glad to report that A-B Repeat is basically completed and working
pretty well! It is activated using the normal "repeat" setting in the
Settings menus; it adds an extra toggle, so the choices are now: off,
all, one, and ab. This setting is also supported in cfg files. With no
A or B marks set it acts exactly like Repeat One. On my JBR I've mapped
ON+LEFT and ON+RIGHT to the Set A Marker and Set B Marker functions.
This seems to work well and doesn't interfere with any other mappings or
functionality (including the pitch menu, which still works as normal).
I've even created graphical markers on the status bar (bitmapped display
only) to show where the marks are set at.

So that's all good. But there are still a couple things I need to
resolve before I finalize this, and I have a couple of questions related
to these. I haven't been able to find any documentation for these
things. I apologize in advance if I've missed it somewhere.

The first question is about lang and voice files. I have added one
small string to english.lang, but this clearly needs to get into the
other lang files as well. How does this happen? I can certainly edit
all the files myself but I'm not capable of performing the
translations. Is there a system in place for this? And what about the
voice files? Is there someone who does that or is it my responsibility?

The second question is about icons on char-mapped displays. (I have
added an A-B Repeat status bar icon for the bitmapped display.) From
reading the source code, it appears that it may be possible to define a
custom icon for the char-mapped screens (perhaps using a font only?),
but I couldn't determine how it is done. I also don't have a player
device so I can't even use trial and error. Is this actually possible
and if so how is it done?

Next, I was wondering if some folks with non-recorder devices could
suggest key pairs that could be used for the Set A Marker and Set B
Marker functions. I won't be able to test them but I could at least put
something in the patch that has a chance of working on those devices.

My last question is about the A-B implementation. I am currently
detecting when the B marker gets hit by comparing the position in
id3->elapsed with the previously set B marker (also taken from
id3->elapsed). I am doing this in wps.c, in the key loop. The loop
blocks for a maximum of 200ms per iteration (while waiting for a key)
and I decided to check for the B marker once during every iteration,
after the key processing, to insure that I don't miss it (I'm not sure
how often id3->elapsed gets updated or in what granularity). This seems
to work fine but I still wonder if there isn't a more accurate or more
efficient way to do this (e.g. some sort of "alarm" from the mp3
thread). Any suggestions?

Thanks for listening and thanks in advance for your help!

~ray

_______________________________________________
http://cool.haxx.se/mailman/listinfo/rockbox
Received on 2005-01-13

Page template was last modified "Tue Sep 7 00:00:02 2021" The Rockbox Crew -- Privacy Policy