diff options
| author | Stepan Moskovchenko <stevenm@rockbox.org> | 2007-11-03 04:09:38 +0000 |
|---|---|---|
| committer | Stepan Moskovchenko <stevenm@rockbox.org> | 2007-11-03 04:09:38 +0000 |
| commit | cd963d84ca5417ee443ea3f1d7cf13040ab9e5e7 (patch) | |
| tree | df9644e33cc866bdf1b92dc25a6b647e70770232 /apps/plugins/midi/synth.c | |
| parent | dc58c3d92e88bd1be3b73b2887c8856687d5002f (diff) | |
| download | rockbox-cd963d84ca5417ee443ea3f1d7cf13040ab9e5e7.zip rockbox-cd963d84ca5417ee443ea3f1d7cf13040ab9e5e7.tar.gz rockbox-cd963d84ca5417ee443ea3f1d7cf13040ab9e5e7.tar.bz2 rockbox-cd963d84ca5417ee443ea3f1d7cf13040ab9e5e7.tar.xz | |
MIDI: Allow seeking forward and backward using the left/right keys. Currently seeks in 5 second
increments, but this can be set to any amount. Also implemented a counter for playing time, which can
pretty easily be used to determine the length of the file, in seconds, before playing it. The time
isn't displayed anywhere right now, but all this can be useful if this thing is turned into a codec, or
at least gets a nice UI.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15418 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/midi/synth.c')
| -rw-r--r-- | apps/plugins/midi/synth.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/apps/plugins/midi/synth.c b/apps/plugins/midi/synth.c index 4e04975..ca59c76 100644 --- a/apps/plugins/midi/synth.c +++ b/apps/plugins/midi/synth.c @@ -43,12 +43,8 @@ void readTextBlock(int file, char * buf) rb->lseek(file, -1, SEEK_CUR); } -/* Filename is the name of the config file */ -/* The MIDI file should have been loaded at this point */ -int initSynth(struct MIDIfile * mf, char * filename, char * drumConfig) +void resetControllers() { - char patchUsed[128]; - char drumUsed[128]; int a=0; for(a=0; a<MAX_VOICES; a++) { @@ -71,6 +67,18 @@ int initSynth(struct MIDIfile * mf, char * filename, char * drumConfig) chLastCtrlMSB[a]=0; /* Set to pitch bend depth */ chLastCtrlLSB[a]=0; /* Set to pitch bend depth */ } +} + +/* Filename is the name of the config file */ +/* The MIDI file should have been loaded at this point */ +int initSynth(struct MIDIfile * mf, char * filename, char * drumConfig) +{ + char patchUsed[128]; + char drumUsed[128]; + int a=0; + + resetControllers(); + for(a=0; a<128; a++) { patchSet[a]=NULL; |