[Scummvm-cvs-logs] SF.net SVN: scummvm:[38322] scummvm/trunk/engines/sci/sfx
fingolfin at users.sourceforge.net
fingolfin at users.sourceforge.net
Sun Feb 15 23:34:42 CET 2009
Revision: 38322
http://scummvm.svn.sourceforge.net/scummvm/?rev=38322&view=rev
Author: fingolfin
Date: 2009-02-15 22:34:41 +0000 (Sun, 15 Feb 2009)
Log Message:
-----------
SCI: Run astyle to make the code be more compliant with our Code Formatting Guidelines: sfx dir
Modified Paths:
--------------
scummvm/trunk/engines/sci/sfx/adlib.cpp
scummvm/trunk/engines/sci/sfx/adlib.h
scummvm/trunk/engines/sci/sfx/core.cpp
scummvm/trunk/engines/sci/sfx/device/alsa-midi.cpp
scummvm/trunk/engines/sci/sfx/device/camd-midi.cpp
scummvm/trunk/engines/sci/sfx/device/devices.cpp
scummvm/trunk/engines/sci/sfx/device/unixraw-midi.cpp
scummvm/trunk/engines/sci/sfx/device.h
scummvm/trunk/engines/sci/sfx/iterator.cpp
scummvm/trunk/engines/sci/sfx/lists/gm_patches.cpp
scummvm/trunk/engines/sci/sfx/lists/mt32_timbres.cpp
scummvm/trunk/engines/sci/sfx/mixer/dc.cpp
scummvm/trunk/engines/sci/sfx/mixer/mixers.cpp
scummvm/trunk/engines/sci/sfx/mixer/soft.cpp
scummvm/trunk/engines/sci/sfx/mixer/test.cpp
scummvm/trunk/engines/sci/sfx/pcm-iterator.cpp
scummvm/trunk/engines/sci/sfx/pcm_device/alsa.cpp
scummvm/trunk/engines/sci/sfx/pcm_device/audbuf_test.cpp
scummvm/trunk/engines/sci/sfx/pcm_device/audiobuf.cpp
scummvm/trunk/engines/sci/sfx/pcm_device/pcm_devices.cpp
scummvm/trunk/engines/sci/sfx/pcm_device/scummvm.cpp
scummvm/trunk/engines/sci/sfx/pcm_device/sdl.cpp
scummvm/trunk/engines/sci/sfx/player/players.cpp
scummvm/trunk/engines/sci/sfx/player/polled.cpp
scummvm/trunk/engines/sci/sfx/player/realtime.cpp
scummvm/trunk/engines/sci/sfx/seq/gm.cpp
scummvm/trunk/engines/sci/sfx/seq/instrument-map.cpp
scummvm/trunk/engines/sci/sfx/seq/map-mt32-to-gm.cpp
scummvm/trunk/engines/sci/sfx/seq/mt32.cpp
scummvm/trunk/engines/sci/sfx/seq/oss-adlib.cpp
scummvm/trunk/engines/sci/sfx/seq/sequencers.cpp
scummvm/trunk/engines/sci/sfx/sequencer.h
scummvm/trunk/engines/sci/sfx/softseq/SN76496.cpp
scummvm/trunk/engines/sci/sfx/softseq/amiga.cpp
scummvm/trunk/engines/sci/sfx/softseq/fluidsynth.cpp
scummvm/trunk/engines/sci/sfx/softseq/fmopl.h
scummvm/trunk/engines/sci/sfx/softseq/mt32.cpp
scummvm/trunk/engines/sci/sfx/softseq/opl2.cpp
scummvm/trunk/engines/sci/sfx/softseq/pcspeaker.cpp
scummvm/trunk/engines/sci/sfx/softseq/softsequencers.cpp
scummvm/trunk/engines/sci/sfx/softseq.h
scummvm/trunk/engines/sci/sfx/songlib.cpp
scummvm/trunk/engines/sci/sfx/test-iterator.cpp
scummvm/trunk/engines/sci/sfx/tests/tests.cpp
scummvm/trunk/engines/sci/sfx/time.cpp
scummvm/trunk/engines/sci/sfx/timer/pthread.cpp
scummvm/trunk/engines/sci/sfx/timer/sigalrm.cpp
scummvm/trunk/engines/sci/sfx/timer/timer_scummvm.cpp
scummvm/trunk/engines/sci/sfx/timer/timers.cpp
scummvm/trunk/engines/sci/sfx/timetest.cpp
Modified: scummvm/trunk/engines/sci/sfx/adlib.cpp
===================================================================
--- scummvm/trunk/engines/sci/sfx/adlib.cpp 2009-02-15 22:33:36 UTC (rev 38321)
+++ scummvm/trunk/engines/sci/sfx/adlib.cpp 2009-02-15 22:34:41 UTC (rev 38322)
@@ -22,14 +22,13 @@
adlib_instr adlib_sbi[96];
void
-make_sbi(adlib_def *one, guint8 *buffer)
-{
+make_sbi(adlib_def *one, guint8 *buffer) {
memset(buffer, 0, sizeof(adlib_instr));
#if 0
- printf ("%02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x ", one->keyscale1, one->freqmod1, one->feedback1, one->attackrate1, one->sustainvol1, one->envelope1, one->decayrate1, one->releaserate1, one->volume1, one->ampmod1, one->vibrato1, one->keybdscale1, one->algorithm1, one->waveform1);
+ printf("%02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x ", one->keyscale1, one->freqmod1, one->feedback1, one->attackrate1, one->sustainvol1, one->envelope1, one->decayrate1, one->releaserate1, one->volume1, one->ampmod1, one->vibrato1, one->keybdscale1, one->algorithm1, one->waveform1);
- printf (" %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x ", one->keyscale2, one->freqmod2, one->feedback2, one->attackrate2, one->sustainvol2, one->envelope2, one->decayrate2, one->releaserate2, one->volume2, one->ampmod2, one->vibrato2, one->keybdscale2, one->algorithm2, one->waveform2);
+ printf(" %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x ", one->keyscale2, one->freqmod2, one->feedback2, one->attackrate2, one->sustainvol2, one->envelope2, one->decayrate2, one->releaserate2, one->volume2, one->ampmod2, one->vibrato2, one->keybdscale2, one->algorithm2, one->waveform2);
printf("\n");
#endif
@@ -60,7 +59,7 @@
buffer[9] |= (one->waveform2 & 0x3);
buffer[10] |= ((one->feedback1 & 0x7) << 1);
- buffer[10] |= (1-(one->algorithm1 & 0x1));
+ buffer[10] |= (1 - (one->algorithm1 & 0x1));
return;
}
Modified: scummvm/trunk/engines/sci/sfx/adlib.h
===================================================================
--- scummvm/trunk/engines/sci/sfx/adlib.h 2009-02-15 22:33:36 UTC (rev 38321)
+++ scummvm/trunk/engines/sci/sfx/adlib.h 2009-02-15 22:34:41 UTC (rev 38322)
@@ -29,34 +29,34 @@
#define ADLIB_VOICES 12
typedef struct _sci_adlib_def {
- guint8 keyscale1; /* 0-3 !*/
- guint8 freqmod1; /* 0-15 !*/
- guint8 feedback1; /* 0-7 !*/
- guint8 attackrate1; /* 0-15 !*/
- guint8 sustainvol1; /* 0-15 !*/
- guint8 envelope1; /* t/f !*/
- guint8 decayrate1; /* 0-15 !*/
- guint8 releaserate1; /* 0-15 !*/
- guint8 volume1; /* 0-63 !*/
- guint8 ampmod1; /* t/f !*/
- guint8 vibrato1; /* t/f !*/
- guint8 keybdscale1; /* t/f !*/
- guint8 algorithm1; /* 0,1 REVERSED */
- guint8 keyscale2; /* 0-3 !*/
- guint8 freqmod2; /* 0-15 !*/
- guint8 feedback2; /* 0-7 UNUSED */
- guint8 attackrate2; /* 0-15 !*/
- guint8 sustainvol2; /* 0-15 !*/
- guint8 envelope2; /* t/f !*/
- guint8 decayrate2; /* 0-15 !*/
- guint8 releaserate2; /* 0-15 !*/
- guint8 volume2; /* 0-63 !*/
- guint8 ampmod2; /* t/f !*/
- guint8 vibrato2; /* t/f !*/
- guint8 keybdscale2; /* t/f !*/
- guint8 algorithm2; /* 0,1 UNUSED */
- guint8 waveform1; /* 0-3 !*/
- guint8 waveform2; /* 0-3 !*/
+ guint8 keyscale1; /* 0-3 !*/
+ guint8 freqmod1; /* 0-15 !*/
+ guint8 feedback1; /* 0-7 !*/
+ guint8 attackrate1; /* 0-15 !*/
+ guint8 sustainvol1; /* 0-15 !*/
+ guint8 envelope1; /* t/f !*/
+ guint8 decayrate1; /* 0-15 !*/
+ guint8 releaserate1; /* 0-15 !*/
+ guint8 volume1; /* 0-63 !*/
+ guint8 ampmod1; /* t/f !*/
+ guint8 vibrato1; /* t/f !*/
+ guint8 keybdscale1; /* t/f !*/
+ guint8 algorithm1; /* 0,1 REVERSED */
+ guint8 keyscale2; /* 0-3 !*/
+ guint8 freqmod2; /* 0-15 !*/
+ guint8 feedback2; /* 0-7 UNUSED */
+ guint8 attackrate2; /* 0-15 !*/
+ guint8 sustainvol2; /* 0-15 !*/
+ guint8 envelope2; /* t/f !*/
+ guint8 decayrate2; /* 0-15 !*/
+ guint8 releaserate2; /* 0-15 !*/
+ guint8 volume2; /* 0-63 !*/
+ guint8 ampmod2; /* t/f !*/
+ guint8 vibrato2; /* t/f !*/
+ guint8 keybdscale2; /* t/f !*/
+ guint8 algorithm2; /* 0,1 UNUSED */
+ guint8 waveform1; /* 0-3 !*/
+ guint8 waveform2; /* 0-3 !*/
} adlib_def;
typedef unsigned char adlib_instr[12];
Modified: scummvm/trunk/engines/sci/sfx/core.cpp
===================================================================
--- scummvm/trunk/engines/sci/sfx/core.cpp 2009-02-15 22:33:36 UTC (rev 38321)
+++ scummvm/trunk/engines/sci/sfx/core.cpp 2009-02-15 22:34:41 UTC (rev 38322)
@@ -52,21 +52,18 @@
#define MILLION 1000000
int
-sfx_pcm_available()
-{
+sfx_pcm_available() {
return (pcm_device != NULL);
}
void
-sfx_reset_player(void)
-{
+sfx_reset_player(void) {
if (player)
player->stop();
}
tell_synth_func *
-sfx_get_player_tell_func(void)
-{
+sfx_get_player_tell_func(void) {
if (player)
return player->tell_synth;
else
@@ -74,8 +71,7 @@
}
int
-sfx_get_player_polyphony(void)
-{
+sfx_get_player_polyphony(void) {
if (player)
return player->polyphony;
else
@@ -83,15 +79,13 @@
}
static long
-time_minus(GTimeVal t1, GTimeVal t2)
-{
+time_minus(GTimeVal t1, GTimeVal t2) {
return (t1.tv_sec - t2.tv_sec) * MILLION
- + (t1.tv_usec - t2.tv_usec);
+ + (t1.tv_usec - t2.tv_usec);
}
static GTimeVal
-time_plus(GTimeVal t1, long delta)
-{
+time_plus(GTimeVal t1, long delta) {
if (delta > 0)
t1.tv_usec += delta % MILLION;
else
@@ -109,12 +103,11 @@
static void
-_freeze_time(sfx_state_t *self)
-{
+_freeze_time(sfx_state_t *self) {
/* Freezes the top song delay time */
GTimeVal ctime;
long delta;
-
+
song_t *song = self->song;
sci_get_current_time(&ctime);
@@ -132,8 +125,7 @@
#if 0
// Unreferenced - removed
static void
-_dump_playing_list(sfx_state_t *self, char *msg)
-{
+_dump_playing_list(sfx_state_t *self, char *msg) {
song_t *song = self->song;
fprintf(stderr, "[] Song list : [ ");
@@ -156,8 +148,7 @@
#endif
static void
-_dump_songs(sfx_state_t *self)
-{
+_dump_songs(sfx_state_t *self) {
#if 0
song_t *song = self->song;
@@ -165,7 +156,7 @@
song = *(self->songlib.lib);
while (song) {
fprintf(stderr, " **\tHandle %08x (p%d): status %d\n",
- song->handle, song->priority, song->status);
+ song->handle, song->priority, song->status);
SIMSG_SEND(song->it, SIMSG_PRINT(1));
song = song->next;
}
@@ -179,8 +170,7 @@
static void
-_thaw_time(sfx_state_t *self)
-{
+_thaw_time(sfx_state_t *self) {
/* inverse of _freeze_time() */
GTimeVal ctime;
song_t *song = self->song;
@@ -195,11 +185,10 @@
}
static int
-is_playing(sfx_state_t *self, song_t *song)
-{
+is_playing(sfx_state_t *self, song_t *song) {
song_t *playing_song = self->song;
-/* _dump_playing_list(self, "is-playing");*/
+ /* _dump_playing_list(self, "is-playing");*/
while (playing_song) {
if (playing_song == song)
@@ -210,8 +199,7 @@
}
static void
-_sfx_set_song_status(sfx_state_t *self, song_t *song, int status)
-{
+_sfx_set_song_status(sfx_state_t *self, song_t *song, int status) {
switch (status) {
case SOUND_STATUS_STOPPED:
@@ -250,7 +238,7 @@
default:
fprintf(stderr, "%s L%d: Attempt to set invalid song"
- " state %d!\n", __FILE__, __LINE__, status);
+ " state %d!\n", __FILE__, __LINE__, status);
return;
}
@@ -259,12 +247,11 @@
/* Update internal state iff only one song may be played */
static void
-_update_single_song(sfx_state_t *self)
-{
+_update_single_song(sfx_state_t *self) {
song_t *newsong = song_lib_find_active(self->songlib);
if (newsong != self->song) {
-
+
_freeze_time(self); /* Store song delay time */
if (player)
@@ -273,11 +260,11 @@
if (newsong) {
if (!newsong->it)
return; /* Restore in progress and not ready for this yet */
-
+
/* Change song */
if (newsong->status == SOUND_STATUS_WAITING)
_sfx_set_song_status(self, newsong,
- SOUND_STATUS_PLAYING);
+ SOUND_STATUS_PLAYING);
/* Change instrument mappings */
} else {
@@ -286,41 +273,40 @@
if (self->song) {
if (self->song->status == SOUND_STATUS_PLAYING)
_sfx_set_song_status(self, newsong,
- SOUND_STATUS_WAITING);
+ SOUND_STATUS_WAITING);
}
-
+
if (self->debug & SFX_DEBUG_SONGS) {
sciprintf("[SFX] Changing active song:");
if (!self->song)
sciprintf(" New song:");
else
sciprintf(" pausing %08lx, now playing",
- self->song->handle);
-
+ self->song->handle);
+
if (newsong)
sciprintf(" %08lx\n", newsong->handle);
else
sciprintf(" none\n");
}
-
-
+
+
self->song = newsong;
_thaw_time(self); /* Recover song delay time */
-
+
if (newsong && player) {
song_iterator_t *clonesong
- = songit_clone(newsong->it, newsong->delay);
-
+ = songit_clone(newsong->it, newsong->delay);
+
player->add_iterator(clonesong,
- newsong->wakeup_time);
+ newsong->wakeup_time);
}
}
}
static void
-_update_multi_song(sfx_state_t *self)
-{
+_update_multi_song(sfx_state_t *self) {
song_t *oldfirst = self->song;
song_t *oldseeker;
song_t *newsong = song_lib_find_active(self->songlib);
@@ -330,11 +316,11 @@
** active. */
GTimeVal tv;
sci_get_current_time(&tv);
-/* _dump_playing_list(self, "before");*/
+ /* _dump_playing_list(self, "before");*/
_freeze_time(self); /* Store song delay time */
for (newseeker = newsong; newseeker;
- newseeker = newseeker->next_playing) {
+ newseeker = newseeker->next_playing) {
if (!newseeker->it)
return; /* Restore in progress and not ready for this yet */
}
@@ -342,7 +328,7 @@
/* First, put all old songs into the 'stopping' list and
** mark their 'next-playing' as not_playing_anymore. */
for (oldseeker = oldfirst; oldseeker;
- oldseeker = oldseeker->next_stopping) {
+ oldseeker = oldseeker->next_stopping) {
oldseeker->next_stopping = oldseeker->next_playing;
oldseeker->next_playing = ¬_playing_anymore;
@@ -351,10 +337,10 @@
/* Second, re-generate the new song queue. */
for (newseeker = newsong; newseeker;
- newseeker = newseeker->next_playing) {
+ newseeker = newseeker->next_playing) {
newseeker->next_playing
- = song_lib_find_next_active(self->songlib,
- newseeker);
+ = song_lib_find_next_active(self->songlib,
+ newseeker);
if (newseeker == newseeker->next_playing) { BREAKPOINT(); }
}
@@ -365,42 +351,41 @@
/* Third, stop all old songs */
for (oldseeker = oldfirst; oldseeker;
- oldseeker = oldseeker->next_stopping)
+ oldseeker = oldseeker->next_stopping)
if (oldseeker->next_playing == ¬_playing_anymore) {
_sfx_set_song_status(self, oldseeker,
- SOUND_STATUS_SUSPENDED);
+ SOUND_STATUS_SUSPENDED);
if (self->debug & SFX_DEBUG_SONGS) {
sciprintf("[SFX] Stopping song %lx\n", oldseeker->handle);
}
if (player && oldseeker->it)
player->iterator_message
- (songit_make_message(oldseeker->it->ID, SIMSG_STOP));
+ (songit_make_message(oldseeker->it->ID, SIMSG_STOP));
oldseeker->next_playing = NULL; /* Clear this pointer; we don't need the tag anymore */
}
for (newseeker = newsong; newseeker;
- newseeker = newseeker->next_playing) {
+ newseeker = newseeker->next_playing) {
if (newseeker->status != SOUND_STATUS_PLAYING && player) {
if (self->debug & SFX_DEBUG_SONGS)
sciprintf("[SFX] Adding song %lx\n", newseeker->it->ID);
player->add_iterator(songit_clone(newseeker->it,
- newseeker->delay),
- tv);
+ newseeker->delay),
+ tv);
}
_sfx_set_song_status(self, newseeker,
- SOUND_STATUS_PLAYING);
+ SOUND_STATUS_PLAYING);
}
self->song = newsong;
_thaw_time(self);
-/* _dump_playing_list(self, "after");*/
+ /* _dump_playing_list(self, "after");*/
}
/* Update internal state */
static void
-_update(sfx_state_t *self)
-{
+_update(sfx_state_t *self) {
if (self->flags & SFX_STATE_FLAG_MULTIPLAY)
_update_multi_song(self);
else
@@ -411,8 +396,7 @@
static int _sfx_timer_active = 0; /* Timer toggle */
int
-sfx_play_iterator_pcm(song_iterator_t *it, song_handle_t handle)
-{
+sfx_play_iterator_pcm(song_iterator_t *it, song_handle_t handle) {
#ifdef DEBUG_SONG_API
fprintf(stderr, "[sfx-core] Playing PCM: %08lx\n", handle);
#endif
@@ -428,8 +412,7 @@
}
static void
-_sfx_timer_callback(void *data)
-{
+_sfx_timer_callback(void *data) {
if (_sfx_timer_active) {
Common::StackLock lock(*callbackMutex);
/* First run the player, to give it a chance to fill
@@ -446,8 +429,7 @@
}
void
-sfx_init(sfx_state_t *self, resource_mgr_t *resmgr, int flags)
-{
+sfx_init(sfx_state_t *self, resource_mgr_t *resmgr, int flags) {
callbackMutex = new Common::Mutex();
song_lib_init(&self->songlib);
self->song = NULL;
@@ -501,7 +483,7 @@
}
sciprintf("[SFX] Initialised timer '%s', v%s\n",
- timer->name, timer->version);
+ timer->name, timer->version);
} /* With no PCM device and no player, we don't need a timer */
/*----------------*/
@@ -533,7 +515,7 @@
if (!resmgr) {
sciprintf("[SFX] Warning: No resource manager present, cannot initialise player\n");
player = NULL;
- } else if (player->init(resmgr, timer? timer->delay_ms : 0)) {
+ } else if (player->init(resmgr, timer ? timer->delay_ms : 0)) {
sciprintf("[SFX] Song player '%s' reported error, disabled\n", player->name);
player = NULL;
}
@@ -547,8 +529,7 @@
}
void
-sfx_exit(sfx_state_t *self)
-{
+sfx_exit(sfx_state_t *self) {
callbackMutex->lock();
_sfx_timer_active = 0;
#ifdef DEBUG_SONG_API
@@ -582,14 +563,12 @@
}
static inline int
-time_le(GTimeVal a, GTimeVal b)
-{
+time_le(GTimeVal a, GTimeVal b) {
return time_minus(a, b) <= 0;
}
void
-sfx_suspend(sfx_state_t *self, int suspend)
-{
+sfx_suspend(sfx_state_t *self, int suspend) {
#ifdef DEBUG_SONG_API
fprintf(stderr, "[sfx-core] Suspending? = %d\n", suspend);
#endif
@@ -634,8 +613,7 @@
}
int
-sfx_poll_specific(sfx_state_t *self, song_handle_t handle, int *cue)
-{
+sfx_poll_specific(sfx_state_t *self, song_handle_t handle, int *cue) {
GTimeVal ctime;
song_t *song = self->song;
@@ -658,13 +636,13 @@
if (!time_le(song->wakeup_time, ctime))
return 0; /* Patience, young hacker! */
result = songit_next(&(song->it), buf, cue,
- IT_READER_MASK_ALL);
+ IT_READER_MASK_ALL);
switch (result) {
case SI_FINISHED:
_sfx_set_song_status(self, song,
- SOUND_STATUS_STOPPED);
+ SOUND_STATUS_STOPPED);
_update(self);
/* ...fall through... */
case SI_LOOP:
@@ -689,8 +667,8 @@
default:
if (result > 0)
song->wakeup_time =
- time_plus(song->wakeup_time,
- result * SOUND_TICK);
+ time_plus(song->wakeup_time,
+ result * SOUND_TICK);
/* Delay */
break;
}
@@ -706,8 +684,7 @@
/*****************/
int
-sfx_add_song(sfx_state_t *self, song_iterator_t *it, int priority, song_handle_t handle, int number)
-{
+sfx_add_song(sfx_state_t *self, song_iterator_t *it, int priority, song_handle_t handle, int number) {
song_t *song = song_lib_find(self->songlib, handle);
#ifdef DEBUG_SONG_API
@@ -732,9 +709,9 @@
fprintf(stderr, "Overwriting old song (%08lx) ...\n", handle);
if (song->status == SOUND_STATUS_PLAYING
- || song->status == SOUND_STATUS_SUSPENDED) {
+ || song->status == SOUND_STATUS_SUSPENDED) {
fprintf(stderr, "Unexpected (error): Song %ld still playing/suspended (%d)\n",
- handle, song->status);
+ handle, song->status);
songit_free(it);
return -1;
} else
@@ -756,8 +733,7 @@
void
-sfx_remove_song(sfx_state_t *self, song_handle_t handle)
-{
+sfx_remove_song(sfx_state_t *self, song_handle_t handle) {
#ifdef DEBUG_SONG_API
fprintf(stderr, "[sfx-core] Removing song: %08lx\n", handle);
#endif
@@ -777,26 +753,24 @@
#define ASSERT_SONG(s) if (!(s)) { fprintf(stderr, "Looking up song handle %08lx failed in %s, L%d\n", handle, __FILE__, __LINE__); return; }
void
-sfx_song_set_status(sfx_state_t *self, song_handle_t handle, int status)
-{
+sfx_song_set_status(sfx_state_t *self, song_handle_t handle, int status) {
song_t *song = song_lib_find(self->songlib, handle);
ASSERT_SONG(song);
#ifdef DEBUG_SONG_API
fprintf(stderr, "[sfx-core] Setting song status to %d"
- " (0:stop, 1:play, 2:susp, 3:wait): %08lx\n", status, handle);
+ " (0:stop, 1:play, 2:susp, 3:wait): %08lx\n", status, handle);
#endif
- _sfx_set_song_status(self, song, status);
+ _sfx_set_song_status(self, song, status);
_update(self);
}
void
-sfx_song_set_fade(sfx_state_t *self, song_handle_t handle,
- fade_params_t *params)
-{
+sfx_song_set_fade(sfx_state_t *self, song_handle_t handle,
+ fade_params_t *params) {
#ifdef DEBUG_SONG_API
- static const char *stopmsg[] = {"??? Should not happen", "Do not stop afterwards","Stop afterwards"};
+ static const char *stopmsg[] = {"??? Should not happen", "Do not stop afterwards", "Stop afterwards"};
#endif
song_t *song = song_lib_find(self->songlib, handle);
@@ -804,9 +778,9 @@
#ifdef DEBUG_SONG_API
fprintf(stderr, "[sfx-core] Setting fade params of %08lx to "
- "final volume %d in steps of %d per %d ticks. %s.\n",
- handle, fade->final_volume, fade->step_size, fade->ticks_per_step,
- stopmsg[fade->action]);
+ "final volume %d in steps of %d per %d ticks. %s.\n",
+ handle, fade->final_volume, fade->step_size, fade->ticks_per_step,
+ stopmsg[fade->action]);
#endif
SIMSG_SEND_FADE(song->it, params);
@@ -815,13 +789,12 @@
}
void
-sfx_song_renice(sfx_state_t *self, song_handle_t handle, int priority)
-{
+sfx_song_renice(sfx_state_t *self, song_handle_t handle, int priority) {
song_t *song = song_lib_find(self->songlib, handle);
ASSERT_SONG(song);
#ifdef DEBUG_SONG_API
fprintf(stderr, "[sfx-core] Renicing song %08lx to %d\n",
- handle, priority);
+ handle, priority);
#endif
song->priority = priority;
@@ -830,16 +803,15 @@
}
void
-sfx_song_set_loops(sfx_state_t *self, song_handle_t handle, int loops)
-{
+sfx_song_set_loops(sfx_state_t *self, song_handle_t handle, int loops) {
song_t *song = song_lib_find(self->songlib, handle);
song_iterator_message_t msg
- = songit_make_message(handle, SIMSG_SET_LOOPS(loops));
+ = songit_make_message(handle, SIMSG_SET_LOOPS(loops));
ASSERT_SONG(song);
#ifdef DEBUG_SONG_API
fprintf(stderr, "[sfx-core] Setting loops on %08lx to %d\n",
- handle, loops);
+ handle, loops);
#endif
songit_handle_message(&(song->it), msg);
song->loops = ((base_song_iterator_t *) song->it)->loops;
@@ -850,17 +822,16 @@
}
void
-sfx_song_set_hold(sfx_state_t *self, song_handle_t handle, int hold)
-{
+sfx_song_set_hold(sfx_state_t *self, song_handle_t handle, int hold) {
song_t *song = song_lib_find(self->songlib, handle);
song_iterator_message_t msg
- = songit_make_message(handle, SIMSG_SET_HOLD(hold));
+ = songit_make_message(handle, SIMSG_SET_HOLD(hold));
ASSERT_SONG(song);
song->hold = hold;
#ifdef DEBUG_SONG_API
fprintf(stderr, "[sfx-core] Setting hold on %08lx to %d\n",
- handle, loops);
+ handle, loops);
#endif
songit_handle_message(&(song->it), msg);
@@ -871,49 +842,47 @@
/* Different from the one in iterator.c */
static const int MIDI_cmdlen[16] = {0, 0, 0, 0, 0, 0, 0, 0,
- 3, 3, 0, 3, 2, 0, 3, 0};
+ 3, 3, 0, 3, 2, 0, 3, 0
+ };
static const song_handle_t midi_send_base = 0xffff0000;
int
sfx_send_midi(sfx_state_t *self, song_handle_t handle, int channel,
- int command, int arg1, int arg2)
-{
+ int command, int arg1, int arg2) {
byte buffer[5];
tell_synth_func *tell = sfx_get_player_tell_func();
/* Yes, in that order. SCI channel mutes are actually done via
a counting semaphore. 0 means to decrement the counter, 1
to increment it. */
- static const char *channel_state[] = {"ON","OFF"};
+ static const char *channel_state[] = {"ON", "OFF"};
if (command == 0xb0 &&
- arg1 == SCI_MIDI_CHANNEL_MUTE)
- {
+ arg1 == SCI_MIDI_CHANNEL_MUTE) {
sciprintf("TODO: channel mute (channel %d %s)!\n", channel,
- channel_state[arg2]);
+ channel_state[arg2]);
/* We need to have a GET_PLAYMASK interface to use
here. SET_PLAYMASK we've got.
*/
return SFX_OK;
- }
+ }
buffer[0] = channel | command; /* No channel remapping yet */
- switch (command)
- {
+ switch (command) {
case 0x80 :
case 0x90 :
case 0xb0 :
- buffer[1] = arg1&0xff;
- buffer[2] = arg2&0xff;
+ buffer[1] = arg1 & 0xff;
+ buffer[2] = arg2 & 0xff;
break;
case 0xc0 :
- buffer[1] = arg1&0xff;
+ buffer[1] = arg1 & 0xff;
break;
case 0xe0 :
- buffer[1] = (arg1&0x7f) | 0x80;
- buffer[2] = (arg1&0xff00) >> 7;
+ buffer[1] = (arg1 & 0x7f) | 0x80;
+ buffer[2] = (arg1 & 0xff00) >> 7;
break;
default:
sciprintf("Unexpected explicit MIDI command %02x\n", command);
@@ -926,21 +895,18 @@
}
int
-sfx_get_volume(sfx_state_t *self)
-{
+sfx_get_volume(sfx_state_t *self) {
fprintf(stderr, "FIXME: Implement volume\n");
return 0;
}
void
-sfx_set_volume(sfx_state_t *self, int volume)
-{
+sfx_set_volume(sfx_state_t *self, int volume) {
fprintf(stderr, "FIXME: Implement volume\n");
}
void
-sfx_all_stop(sfx_state_t *self)
-{
+sfx_all_stop(sfx_state_t *self) {
#ifdef DEBUG_SONG_API
fprintf(stderr, "[sfx-core] All stop\n");
#endif
Modified: scummvm/trunk/engines/sci/sfx/device/alsa-midi.cpp
===================================================================
--- scummvm/trunk/engines/sci/sfx/device/alsa-midi.cpp 2009-02-15 22:33:36 UTC (rev 38321)
+++ scummvm/trunk/engines/sci/sfx/device/alsa-midi.cpp 2009-02-15 22:34:41 UTC (rev 38322)
@@ -44,19 +44,18 @@
static const char *seq_name = "default";
static void
-_set_tempo(void)
-{
+_set_tempo(void) {
int resolution = 60;
int tempo = 1;
snd_seq_queue_tempo_t *queue_tempo;
snd_seq_queue_tempo_malloc(&queue_tempo);
- memset(queue_tempo, 0, snd_seq_queue_tempo_sizeof());
- snd_seq_queue_tempo_set_ppq(queue_tempo, resolution);
- snd_seq_queue_tempo_set_tempo(queue_tempo, 1000000/tempo);
+ memset(queue_tempo, 0, snd_seq_queue_tempo_sizeof());
+ snd_seq_queue_tempo_set_ppq(queue_tempo, resolution);
+ snd_seq_queue_tempo_set_tempo(queue_tempo, 1000000 / tempo);
- snd_seq_set_queue_tempo(seq, queue, queue_tempo);
+ snd_seq_set_queue_tempo(seq, queue, queue_tempo);
snd_seq_queue_tempo_free(queue_tempo);
@@ -74,8 +73,7 @@
static int
-am_subscribe_to_ports(void)
-{
+am_subscribe_to_ports(void) {
if ((port_out = snd_seq_connect_to(seq, port_out, port_nr, subport_nr)) < 0) {
fprintf(stderr, "[SFX] Could not connect to ALSA sequencer port: %s\n", snd_strerror(port_out));
return SFX_ERROR;
@@ -85,8 +83,7 @@
static int
-aminit(midi_writer_t *self)
-{
+aminit(midi_writer_t *self) {
int err;
snd_midi_event_new(4096, &parser);
@@ -96,15 +93,15 @@
if (snd_seq_open(&seq, seq_name, SND_SEQ_OPEN_OUTPUT, SND_SEQ_NONBLOCK)) {
fprintf(stderr, "[SFX] Failed to open ALSA MIDI sequencer '%s' for output\n",
- seq_name);
+ seq_name);
return SFX_ERROR;
}
if ((port_out = snd_seq_create_simple_port(seq, "FreeSCI",
- SND_SEQ_PORT_CAP_WRITE |
- SND_SEQ_PORT_CAP_SUBS_WRITE |
- SND_SEQ_PORT_CAP_READ,
- SND_SEQ_PORT_TYPE_MIDI_GENERIC)) < 0) {
+ SND_SEQ_PORT_CAP_WRITE |
+ SND_SEQ_PORT_CAP_SUBS_WRITE |
+ SND_SEQ_PORT_CAP_READ,
+ SND_SEQ_PORT_TYPE_MIDI_GENERIC)) < 0) {
fprintf(stderr, "[SFX] Could not create ALSA sequencer port\n");
return SFX_ERROR;
}
@@ -120,7 +117,7 @@
if ((err = snd_seq_drain_output(seq))) {
fflush(NULL);
fprintf(stderr, "[SFX] Error while draining: %s\n",
- snd_strerror(err));
+ snd_strerror(err));
return SFX_ERROR;
}
@@ -128,15 +125,13 @@
}
static int
-amsetopt(midi_writer_t *self, char *name, char *value)
-{
+amsetopt(midi_writer_t *self, char *name, char *value) {
return SFX_ERROR;
}
static int
-amwrite(midi_writer_t *self, unsigned char *buf, int len)
-{
+amwrite(midi_writer_t *self, unsigned char *buf, int len) {
snd_seq_event_t evt;
#if 0
@@ -176,14 +171,12 @@
}
static void
-amdelay(midi_writer_t *self, int ticks)
-{
+amdelay(midi_writer_t *self, int ticks) {
delta += ticks;
}
static void
-amreset_timer(midi_writer_t *self)
-{
+amreset_timer(midi_writer_t *self) {
snd_seq_drain_output(seq);
snd_seq_stop_queue(seq, queue, NULL);
@@ -206,8 +199,7 @@
}
static void
-amclose(midi_writer_t *self)
-{
+amclose(midi_writer_t *self) {
snd_midi_event_free(parser);
parser = NULL;
}
Modified: scummvm/trunk/engines/sci/sfx/device/camd-midi.cpp
===================================================================
--- scummvm/trunk/engines/sci/sfx/device/camd-midi.cpp 2009-02-15 22:33:36 UTC (rev 38321)
+++ scummvm/trunk/engines/sci/sfx/device/camd-midi.cpp 2009-02-15 22:34:41 UTC (rev 38322)
@@ -63,8 +63,7 @@
}
static int
-camd_init(midi_writer_t *self)
-{
+camd_init(midi_writer_t *self) {
sciprintf("[SFX] Initialising CAMD raw MIDI backend, v%s\n", SCI_CAMD_MIDI_VERSION);
CamdBase = IExec->OpenLibrary("camd.library", 36L);
@@ -72,8 +71,8 @@
ABORT("Could not open 'camd.library'");
ICamd = (struct CamdIFace *) IExec->GetInterface(CamdBase, "main", 1, NULL);
- if (!ICamd)
- ABORT("Error while retrieving CAMD interface\n");
+ if (!ICamd)
+ ABORT("Error while retrieving CAMD interface\n");
midi_node = ICamd->CreateMidi(MIDI_MsgQueue, 0L, MIDI_SysExSize, 4096L, MIDI_Name, "freesci", TAG_END);
if (!midi_node)
@@ -89,16 +88,14 @@
}
static int
-camd_set_option(midi_writer_t *self, char *name, char *value)
-{
+camd_set_option(midi_writer_t *self, char *name, char *value) {
return SFX_ERROR;
}
#define MAX_MIDI_LEN 3
static int
-camd_write(midi_writer_t *self, unsigned char *buffer, int len)
-{
+camd_write(midi_writer_t *self, unsigned char *buffer, int len) {
if (len == 0)
return SFX_OK;
@@ -119,7 +116,7 @@
if (len > MAX_MIDI_LEN)
sciprintf("[SFX] Warning: Truncated MIDI message to fit CAMD format (sent %d: %02x %02x %02x, real length %d)\n",
- MAX_MIDI_LEN, buffer[0], buffer[1], buffer[2], len);
+ MAX_MIDI_LEN, buffer[0], buffer[1], buffer[2], len);
ICamd->PutMidi(midi_link, data);
}
@@ -128,21 +125,18 @@
}
static void
-camd_delay(midi_writer_t *self, int ticks)
-{
+camd_delay(midi_writer_t *self, int ticks) {
}
static void
-camd_reset_timer(midi_writer_t *self)
-{
+camd_reset_timer(midi_writer_t *self) {
}
static void
-camd_close(midi_writer_t *self)
-{
+camd_close(midi_writer_t *self) {
#ifdef NO_OP
return;
-#endif
+#endif
if (CamdBase)
IExec->CloseLibrary(CamdBase);
}
Modified: scummvm/trunk/engines/sci/sfx/device/devices.cpp
===================================================================
--- scummvm/trunk/engines/sci/sfx/device/devices.cpp 2009-02-15 22:33:36 UTC (rev 38321)
+++ scummvm/trunk/engines/sci/sfx/device/devices.cpp 2009-02-15 22:34:41 UTC (rev 38322)
@@ -49,16 +49,16 @@
static struct _midi_device *devices_midi[] = {
#ifndef SCUMMVM
#ifdef HAVE_PROTO_CAMD_H
- &sfx_device_midi_camd,
+ &sfx_device_midi_camd,
#endif
#ifdef HAVE_ALSA
- &sfx_device_midi_alsa,
+ &sfx_device_midi_alsa,
#endif
#ifdef UNIX
- &sfx_device_midi_unixraw,
+ &sfx_device_midi_unixraw,
#endif
#endif // SCUMMVM
- NULL
+ NULL
};
static struct _midi_device *devices_opl2[] = {
@@ -76,8 +76,7 @@
static struct _midi_device *
-find_dev(int type, char *name)
-{
+ find_dev(int type, char *name) {
int i = 0;
if (!type)
@@ -94,19 +93,18 @@
void *
-sfx_find_device(int type, char *name)
-{
+sfx_find_device(int type, char *name) {
struct _midi_device *dev = find_dev(type, name);
if (dev) {
if (dev->init(dev)) {
fprintf(stderr, "[SFX] Opening device '%s' failed\n",
- dev->name);
+ dev->name);
return NULL;
}
return dev;
};
-
+
return NULL;
}
Modified: scummvm/trunk/engines/sci/sfx/device/unixraw-midi.cpp
===================================================================
--- scummvm/trunk/engines/sci/sfx/device/unixraw-midi.cpp 2009-02-15 22:33:36 UTC (rev 38321)
+++ scummvm/trunk/engines/sci/sfx/device/unixraw-midi.cpp 2009-02-15 22:34:41 UTC (rev 38322)
@@ -42,11 +42,10 @@
static const char *devicename = "/dev/midi";
static int
-unixraw_init(midi_writer_t *self)
-{
+unixraw_init(midi_writer_t *self) {
sciprintf("[SFX] Initialising UNIX raw MIDI backend, v%s\n", SCI_UNIXRAW_MIDI_VERSION);
- fd = open(devicename, O_WRONLY|O_SYNC);
+ fd = open(devicename, O_WRONLY | O_SYNC);
if (!IS_VALID_FD(fd)) {
sciprintf("[SFX] Failed to open %s\n", devicename);
@@ -57,14 +56,12 @@
}
static int
-unixraw_set_option(midi_writer_t *self, char *name, char *value)
-{
+unixraw_set_option(midi_writer_t *self, char *name, char *value) {
return SFX_ERROR;
}
static int
-unixraw_write(midi_writer_t *self, unsigned char *buffer, int len)
-{
+unixraw_write(midi_writer_t *self, unsigned char *buffer, int len) {
if (write(fd, buffer, len) != len) {
sciprintf("[SFX] MIDI write error\n");
return SFX_ERROR;
@@ -73,18 +70,15 @@
}
static void
-unixraw_delay(midi_writer_t *self, int ticks)
-{
+unixraw_delay(midi_writer_t *self, int ticks) {
}
static void
-unixraw_reset_timer(midi_writer_t *self)
-{
+unixraw_reset_timer(midi_writer_t *self) {
}
static void
-unixraw_close(midi_writer_t *self)
-{
+unixraw_close(midi_writer_t *self) {
close(fd);
}
Modified: scummvm/trunk/engines/sci/sfx/device.h
===================================================================
--- scummvm/trunk/engines/sci/sfx/device.h 2009-02-15 22:33:36 UTC (rev 38321)
+++ scummvm/trunk/engines/sci/sfx/device.h 2009-02-15 22:34:41 UTC (rev 38322)
@@ -32,7 +32,7 @@
/* Various types of resources */
#define SFX_DEVICE_NONE 0
#define SFX_DEVICE_MIDI 1 /* midi writer */
-#define SFX_DEVICE_OPL2 2 /* OPL/2 sequencer */
+#define SFX_DEVICE_OPL2 2 /* OPL/2 sequencer */
struct _midi_device {
const char *name;
Modified: scummvm/trunk/engines/sci/sfx/iterator.cpp
===================================================================
--- scummvm/trunk/engines/sci/sfx/iterator.cpp 2009-02-15 22:33:36 UTC (rev 38321)
+++ scummvm/trunk/engines/sci/sfx/iterator.cpp 2009-02-15 22:34:41 UTC (rev 38322)
@@ -33,14 +33,14 @@
#include "sci/include/sci_memory.h"
static const int MIDI_cmdlen[16] = {0, 0, 0, 0, 0, 0, 0, 0,
- 2, 2, 2, 2, 1, 1, 2, 0};
+ 2, 2, 2, 2, 1, 1, 2, 0
+ };
/*#define DEBUG_DECODING*/
/*#define DEBUG_VERBOSE*/
void
-print_tabs_id(int nr, songit_id_t id)
-{
+print_tabs_id(int nr, songit_id_t id) {
while (nr-- > 0)
fprintf(stderr, "\t");
@@ -49,8 +49,7 @@
#ifndef HAVE_MEMCHR
static void *
-memchr(void *_data, int c, int n)
-{
+memchr(void *_data, int c, int n) {
unsigned char *data = (unsigned char *) _data;
while (n && !(*data == c)) {
@@ -66,8 +65,7 @@
#endif
static void
-_common_init(base_song_iterator_t *self)
-{
+_common_init(base_song_iterator_t *self) {
self->fade.action = FADE_ACTION_NONE;
self->resetflag = 0;
self->loops = 0;
@@ -101,18 +99,17 @@
static inline int
-_parse_ticks(byte *data, int *offset_p, int size)
-{
+_parse_ticks(byte *data, int *offset_p, int size) {
int ticks = 0;
int tempticks;
int offset = 0;
do {
tempticks = data[offset++];
- ticks += (tempticks == SCI_MIDI_TIME_EXPANSION_PREFIX)?
- SCI_MIDI_TIME_EXPANSION_LENGTH : tempticks;
+ ticks += (tempticks == SCI_MIDI_TIME_EXPANSION_PREFIX) ?
+ SCI_MIDI_TIME_EXPANSION_LENGTH : tempticks;
} while (tempticks == SCI_MIDI_TIME_EXPANSION_PREFIX
- && offset < size);
+ && offset < size);
if (offset_p)
*offset_p = offset;
@@ -123,30 +120,27 @@
static int
_sci0_read_next_command(sci0_song_iterator_t *self,
- unsigned char *buf, int *result);
+ unsigned char *buf, int *result);
static int
_sci0_get_pcm_data(sci0_song_iterator_t *self,
- sfx_pcm_config_t *format,
- int *xoffset,
- unsigned int *xsize);
+ sfx_pcm_config_t *format,
+ int *xoffset,
+ unsigned int *xsize);
#define PARSE_FLAG_LOOPS_UNLIMITED (1 << 0) /* Unlimited # of loops? */
#define PARSE_FLAG_PARAMETRIC_CUE (1 << 1) /* Assume that cues take an additional "cue value" argument */
/* This implements a difference between SCI0 and SCI1 cues. */
void
-_reset_synth_channels(base_song_iterator_t *self, song_iterator_channel_t *channel)
-{
+_reset_synth_channels(base_song_iterator_t *self, song_iterator_channel_t *channel) {
int i;
byte buf[5];
tell_synth_func *tell = sfx_get_player_tell_func();
- for (i = 0; i < MIDI_CHANNELS; i++)
- {
- if (channel->saw_notes & (1 << i))
- {
+ for (i = 0; i < MIDI_CHANNELS; i++) {
+ if (channel->saw_notes & (1 << i)) {
buf[0] = 0xe0 | i; /* Pitch bend */
buf[1] = 0x80; /* Wheel center */
buf[2] = 0x40;
@@ -159,9 +153,8 @@
static int
_parse_sci_midi_command(base_song_iterator_t *self, unsigned char *buf, int *result,
- song_iterator_channel_t *channel,
- int flags)
-{
+ song_iterator_channel_t *channel,
+ int flags) {
unsigned char cmd;
int paramsleft;
int midi_op;
@@ -177,8 +170,7 @@
cmd = channel->last_cmd;
}
- if (cmd == 0xfe)
- {
+ if (cmd == 0xfe) {
fprintf(stderr, "song iterator subsystem: Corrupted sound resource detected.\n");
return SI_FINISHED;
}
@@ -189,17 +181,17 @@
channel->saw_notes |= 1 << midi_channel;
#if 0
-if (1) {
- fprintf(stderr, "[IT]: off=%x, cmd=%02x, takes %d args ",
- channel->offset - 1, cmd, paramsleft);
- fprintf(stderr, "[%02x %02x <%02x> %02x %02x %02x]\n",
- self->data[channel->offset-3],
- self->data[channel->offset-2],
- self->data[channel->offset-1],
- self->data[channel->offset],
- self->data[channel->offset+1],
- self->data[channel->offset+2]);
-}
+ if (1) {
+ fprintf(stderr, "[IT]: off=%x, cmd=%02x, takes %d args ",
+ channel->offset - 1, cmd, paramsleft);
+ fprintf(stderr, "[%02x %02x <%02x> %02x %02x %02x]\n",
+ self->data[channel->offset-3],
+ self->data[channel->offset-2],
+ self->data[channel->offset-1],
+ self->data[channel->offset],
+ self->data[channel->offset+1],
+ self->data[channel->offset+2]);
+ }
#endif
buf[0] = cmd;
@@ -216,21 +208,21 @@
/* Are we supposed to play this channel? */
if (
/* First, exclude "global" properties-- such as cues-- from consideration */
- (midi_op < 0xf
- && !(cmd == SCI_MIDI_SET_SIGNAL)
- && !(SCI_MIDI_CONTROLLER(cmd)
- && buf[1] == SCI_MIDI_CUMULATIVE_CUE))
+ (midi_op < 0xf
+ && !(cmd == SCI_MIDI_SET_SIGNAL)
+ && !(SCI_MIDI_CONTROLLER(cmd)
+ && buf[1] == SCI_MIDI_CUMULATIVE_CUE))
/* Next, check if the channel is allowed */
- && (!((1 << midi_channel) & channel->playmask)))
+ && (!((1 << midi_channel) & channel->playmask)))
return /* Execute next command */
- self->next((song_iterator_t *) self, buf, result);
+ self->next((song_iterator_t *) self, buf, result);
if (cmd == SCI_MIDI_EOT) {
/* End of track? */
_reset_synth_channels(self, channel);
-/* fprintf(stderr, "eot; loops = %d, notesplayed=%d\n", self->loops, channel->notes_played);*/
+ /* fprintf(stderr, "eot; loops = %d, notesplayed=%d\n", self->loops, channel->notes_played);*/
if (self->loops > 1 /* && channel->notes_played*/) {
/* If allowed, decrement the number of loops */
if (!(flags & PARSE_FLAG_LOOPS_UNLIMITED))
@@ -243,7 +235,7 @@
else
fprintf(stderr, "(%d)", self->loops);
fprintf(stderr, " %x -> %x\n",
- channel->offset, channel->loop_offset);
+ channel->offset, channel->loop_offset);
#endif
channel->offset = channel->loop_offset;
channel->notes_played = 0;
@@ -256,9 +248,9 @@
channel->state = SI_STATE_FINISHED;
#ifdef DEBUG_DECODING
fprintf(stderr, "%s L%d: (%p):%d EOT because"
- " %d notes, %d loops\n",
- __FILE__, __LINE__, self, channel->id,
- channel->notes_played, self->loops);
+ " %d notes, %d loops\n",
+ __FILE__, __LINE__, self, channel->id,
+ channel->notes_played, self->loops);
#endif
return SI_FINISHED;
}
@@ -269,7 +261,7 @@
channel->loop_timepos = channel->total_timepos;
return /* Execute next command */
- self->next((song_iterator_t *) self, buf, result);
+ self->next((song_iterator_t *) self, buf, result);
} else {
/* Used to be conditional <= 127 */
*result = buf[1]; /* Absolute cue */
@@ -283,7 +275,7 @@
self->ccc += buf[2];
else { /* No parameter to CC */
self->ccc++;
-/* channel->offset--; */
+ /* channel->offset--; */
}
*result = self->ccc;
return SI_RELATIVE_CUE;
@@ -297,22 +289,21 @@
#if 0
{
- int i;
- int voices = 0;
- for (i = 0; i < ((sci1_song_iterator_t *) self)->channels_nr; i++)
- {
- voices += self->polyphony[i];
- }
+ int i;
+ int voices = 0;
+ for (i = 0; i < ((sci1_song_iterator_t *) self)->channels_nr; i++) {
+ voices += self->polyphony[i];
+ }
- sciprintf("SET_POLYPHONY(%d, %d) for a total of %d voices\n", midi_channel, buf[2], voices);
- sciprintf("[iterator-1] DEBUG: Polyphony = [ ");
- for (i = 0; i < ((sci1_song_iterator_t *) self)->channels_nr; i++)
- sciprintf("%d ", self->polyphony[i]);
- sciprintf("]\n");
- sciprintf("[iterator-1] DEBUG: Importance = [ ");
- for (i = 0; i < ((sci1_song_iterator_t *) self)->channels_nr; i++)
- sciprintf("%d ", self->importance[i]);
- sciprintf("]\n");
+ sciprintf("SET_POLYPHONY(%d, %d) for a total of %d voices\n", midi_channel, buf[2], voices);
+ sciprintf("[iterator-1] DEBUG: Polyphony = [ ");
+ for (i = 0; i < ((sci1_song_iterator_t *) self)->channels_nr; i++)
+ sciprintf("%d ", self->polyphony[i]);
+ sciprintf("]\n");
+ sciprintf("[iterator-1] DEBUG: Importance = [ ");
+ for (i = 0; i < ((sci1_song_iterator_t *) self)->channels_nr; i++)
+ sciprintf("%d ", self->importance[i]);
+ sciprintf("]\n");
}
#endif
break;
@@ -324,20 +315,18 @@
sciprintf("CHANNEL_MUTE(%d, %d)\n", midi_channel, buf[2]);
break;
- case SCI_MIDI_HOLD:
- {
+ case SCI_MIDI_HOLD: {
// Safe cast: This controller is only used in SCI1
sci1_song_iterator_t *self1 = (sci1_song_iterator_t *) self;
- if (buf[2] == self1->hold)
- {
+ if (buf[2] == self1->hold) {
channel->offset = channel->initial_offset;
channel->notes_played = 0;
channel->state = SI_STATE_COMMAND;
channel->total_timepos = 0;
-
- self1->channels_looped = self1->active_channels-1;
-
+
+ self1->channels_looped = self1->active_channels - 1;
+
return SI_LOOP;
}
@@ -349,7 +338,7 @@
case 0x73: /* UNKNOWN NYI (happens in Hoyle) */
case 0xd1: /* UNKNOWN NYI (happens in KQ4 when riding the unicorn) */
return /* Execute next command */
- self->next((song_iterator_t *) self, buf, result);
+ self->next((song_iterator_t *) self, buf, result);
case 0x01: /* modulation */
case 0x07: /* volume */
@@ -375,16 +364,15 @@
static int
_sci_midi_process_state(base_song_iterator_t *self, unsigned char *buf, int *result,
- song_iterator_channel_t *channel,
- int flags)
-{
+ song_iterator_channel_t *channel,
+ int flags) {
CHECK_FOR_END(0);
switch (channel->state) {
case SI_STATE_PCM: {
if (*(self->data + channel->offset) == 0
- && *(self->data + channel->offset + 1) == SCI_MIDI_EOT)
+ && *(self->data + channel->offset + 1) == SCI_MIDI_EOT)
/* Fake one extra tick to trick the interpreter into not killing the song iterator right away */
channel->state = SI_STATE_PCM_MAGIC_DELTA;
else
@@ -417,8 +405,8 @@
case SI_STATE_DELTA_TIME: {
int offset;
int ticks = _parse_ticks(self->data + channel->offset,
- &offset,
- self->size - channel->offset);
+ &offset,
+ self->size - channel->offset);
channel->offset += offset;
channel->delay += ticks;
@@ -432,7 +420,7 @@
return ticks;
}
- /* continute otherwise... */
+ /* continute otherwise... */
case SI_STATE_COMMAND: {
int retval;
@@ -440,15 +428,15 @@
channel->timepos_increment = 0;
retval = _parse_sci_midi_command(self, buf, result,
- channel, flags);
+ channel, flags);
if (retval == SI_FINISHED) {
if (self->active_channels)
--(self->active_channels);
#ifdef DEBUG_DECODING
fprintf(stderr, "%s L%d: (%p):%d Finished channel, %d channels left\n",
- __FILE__, __LINE__, self, channel->id,
- self->active_channels);
+ __FILE__, __LINE__, self, channel->id,
+ self->active_channels);
#endif
/* If we still have channels left... */
if (self->active_channels) {
@@ -464,7 +452,7 @@
default:
fprintf(stderr, SIPFX "Invalid iterator state %d!\n",
- channel->state);
+ channel->state);
BREAKPOINT();
return SI_FINISHED;
}
@@ -472,43 +460,39 @@
static inline int
_sci_midi_process(base_song_iterator_t *self, unsigned char *buf, int *result,
- song_iterator_channel_t *channel,
- int flags)
-{
+ song_iterator_channel_t *channel,
+ int flags) {
return _sci_midi_process_state(self, buf, result,
- channel,
- flags);
+ channel,
+ flags);
}
static int
_sci0_read_next_command(sci0_song_iterator_t *self, unsigned char *buf,
- int *result)
-{
+ int *result) {
return _sci_midi_process((base_song_iterator_t *) self, buf, result,
- &(self->channel),
- PARSE_FLAG_PARAMETRIC_CUE);
+ &(self->channel),
+ PARSE_FLAG_PARAMETRIC_CUE);
}
static inline int
-_sci0_header_magic_p(unsigned char *data, int offset, int size)
-{
+_sci0_header_magic_p(unsigned char *data, int offset, int size) {
if (offset + 0x10 > size)
return 0;
return
- (data[offset] == 0x1a)
- && (data[offset + 1] == 0x00)
- && (data[offset + 2] == 0x01)
- && (data[offset + 3] == 0x00);
+ (data[offset] == 0x1a)
+ && (data[offset + 1] == 0x00)
+ && (data[offset + 2] == 0x01)
+ && (data[offset + 3] == 0x00);
}
static int
_sci0_get_pcm_data(sci0_song_iterator_t *self,
- sfx_pcm_config_t *format,
- int *xoffset,
- unsigned int *xsize)
-{
+ sfx_pcm_config_t *format,
+ int *xoffset,
+ unsigned int *xsize) {
int tries = 2;
int found_it = 0;
unsigned char *pcm_data;
@@ -522,12 +506,12 @@
while ((tries--) && (offset < self->size) && (!found_it)) {
/* Search through the garbage manually */
unsigned char *fc = (unsigned char*)memchr(self->data + offset,
- SCI0_END_OF_SONG,
- self->size - offset);
+ SCI0_END_OF_SONG,
+ self->size - offset);
if (!fc) {
fprintf(stderr, SIPFX "Warning: Playing unterminated"
- " song!\n");
+ " song!\n");
return 1;
}
@@ -541,8 +525,8 @@
if (!found_it) {
fprintf(stderr, SIPFX
- "Warning: Song indicates presence of PCM, but"
- " none found (finally at offset %04x)\n", offset);
+ "Warning: Song indicates presence of PCM, but"
+ " none found (finally at offset %04x)\n", offset);
return 1;
}
@@ -560,9 +544,9 @@
int d = offset + SCI0_PCM_DATA_OFFSET + size - self->size;
fprintf(stderr, SIPFX
- "Warning: PCM advertizes %d bytes of data, but %d"
- " bytes are trailing in the resource!\n",
- size, self->size - (offset + SCI0_PCM_DATA_OFFSET));
+ "Warning: PCM advertizes %d bytes of data, but %d"
+ " bytes are trailing in the resource!\n",
+ size, self->size - (offset + SCI0_PCM_DATA_OFFSET));
if (d > 0)
size -= d; /* Fix this */
@@ -572,11 +556,10 @@
*xsize = size;
return 0;
- }
+}
static sfx_pcm_feed_t *
-_sci0_check_pcm(sci0_song_iterator_t *self)
-{
+_sci0_check_pcm(sci0_song_iterator_t *self) {
sfx_pcm_config_t format;
int offset;
unsigned int size;
@@ -584,25 +567,24 @@
return NULL;
self->channel.state
- = SI_STATE_FINISHED; /* Don't play both PCM and music */
+ = SI_STATE_FINISHED; /* Don't play both PCM and music */
return sfx_iterator_make_feed(self->data,
- offset + SCI0_PCM_DATA_OFFSET,
- size,
- format);
+ offset + SCI0_PCM_DATA_OFFSET,
+ size,
+ format);
}
static song_iterator_t *
-_sci0_handle_message(sci0_song_iterator_t *self, song_iterator_message_t msg)
-{
+_sci0_handle_message(sci0_song_iterator_t *self, song_iterator_message_t msg) {
if (msg.recipient == _SIMSG_BASE) {
switch (msg.type) {
case _SIMSG_BASEMSG_PRINT:
print_tabs_id(msg.args[0].i, self->ID);
fprintf(stderr, "SCI0: dev=%d, active-chan=%d, size=%d, loops=%d\n",
- self->device_id, self->active_channels, self->size,
- self->loops);
+ self->device_id, self->active_channels, self->size,
+ self->loops);
break;
case _SIMSG_BASEMSG_SET_LOOPS:
@@ -615,7 +597,7 @@
memcpy(mem, self, tsize);
sci_refcount_incref(mem->data);
#ifdef DEBUG_VERBOSE
-fprintf(stderr, "** CLONE INCREF for new %p from %p at %p\n", mem, self, mem->data);
+ fprintf(stderr, "** CLONE INCREF for new %p from %p at %p\n", mem, self, mem->data);
#endif
return (struct _song_iterator *) mem; /* Assume caller has another copy of this */
}
@@ -637,10 +619,10 @@
for (i = 0; i < MIDI_CHANNELS; i++)
if (self->data[2 + (i << 1)] & self->device_id
- && i != MIDI_RHYTHM_CHANNEL)
+ && i != MIDI_RHYTHM_CHANNEL)
self->channel.playmask |= (1 << i);
}
- break;
+ break;
case _SIMSG_BASEMSG_SET_RHYTHM:
self->channel.playmask &= ~(1 << MIDI_RHYTHM_CHANNEL);
@@ -648,8 +630,7 @@
self->channel.playmask |= (1 << MIDI_RHYTHM_CHANNEL);
break;
- case _SIMSG_BASEMSG_SET_FADE:
- {
+ case _SIMSG_BASEMSG_SET_FADE: {
fade_params_t *fp = (fade_params_t *) msg.args[0].p;
self->fade.action = fp->action;
self->fade.final_volume = fp->final_volume;
@@ -668,15 +649,13 @@
}
static int
-_sci0_get_timepos(sci0_song_iterator_t *self)
-{
- return self->channel.total_timepos;
+_sci0_get_timepos(sci0_song_iterator_t *self) {
+ return self->channel.total_timepos;
}
static void
_base_init_channel(song_iterator_channel_t *channel, int id, int offset,
- int end)
-{
+ int end) {
channel->playmask = PLAYMASK_NONE; /* Disable all channels */
channel->id = id;
channel->notes_played = 0;
@@ -688,23 +667,22 @@
channel->last_cmd = 0xfe;
channel->offset
- = channel->loop_offset
- = channel->initial_offset
- = offset;
+ = channel->loop_offset
+ = channel->initial_offset
+ = offset;
channel->end = end;
channel->saw_notes = 0;
}
static void
-_sci0_init(sci0_song_iterator_t *self)
-{
+_sci0_init(sci0_song_iterator_t *self) {
_common_init((base_song_iterator_t *) self);
self->ccc = 0; /* Reset cumulative cue counter */
self->active_channels = 1;
_base_init_channel(&(self->channel), 0, SCI0_MIDI_OFFSET, self->size);
- _reset_synth_channels((base_song_iterator_t *) self,
- &(self->channel));
+ _reset_synth_channels((base_song_iterator_t *) self,
+ &(self->channel));
self->delay_remaining = 0;
if (self->data[0] == 2) /* Do we have an embedded PCM? */
@@ -713,10 +691,9 @@
static void
-_sci0_cleanup(sci0_song_iterator_t *self)
-{
+_sci0_cleanup(sci0_song_iterator_t *self) {
#ifdef DEBUG_VERBOSE
-fprintf(stderr, "** FREEING it %p: data at %p\n", self, self->data);
+ fprintf(stderr, "** FREEING it %p: data at %p\n", self, self->data);
#endif
if (self->data)
sci_refcount_decref(self->data);
@@ -745,8 +722,7 @@
#define SCI1_CHANDATA(off) self->data[channel->offset + (off)]
static int
-_sci1_sample_init(sci1_song_iterator_t *self, int offset)
-{
+_sci1_sample_init(sci1_song_iterator_t *self, int offset) {
sci1_sample_t *sample, **seekerp;
int rate;
int length;
@@ -756,7 +732,7 @@
CHECK_FOR_END_ABSOLUTE((unsigned int)offset + 10);
if (self->data[offset + 1] != 0)
sciprintf("[iterator-1] In sample at offset 0x04x: Byte #1 is %02x instead of zero\n",
- self->data[offset + 1]);
+ self->data[offset + 1]);
rate = getInt16(self->data + offset + 2);
length = getUInt16(self->data + offset + 4);
@@ -772,7 +748,7 @@
#ifdef DEBUG_VERBOSE
fprintf(stderr, "[SAMPLE] %x/%x/%x/%x l=%x\n",
- offset + 10, begin, end, self->size, length);
+ offset + 10, begin, end, self->size, length);
#endif
sample->format.format = SFX_PCM_FORMAT_U8;
@@ -795,8 +771,7 @@
static int
-_sci1_song_init(sci1_song_iterator_t *self)
-{
+_sci1_song_init(sci1_song_iterator_t *self) {
sci1_sample_t *seeker;
int last_time;
unsigned int offset = 0;
@@ -805,15 +780,14 @@
// self->device_id = 0x0c;
CHECK_FOR_END_ABSOLUTE(0);
- if (SONGDATA(0) == 0xf0)
- {
+ if (SONGDATA(0) == 0xf0) {
self->priority = SONGDATA(1);
offset += 8;
}
while (SONGDATA(0) != 0xff
- && SONGDATA(0) != self->device_id) {
+ && SONGDATA(0) != self->device_id) {
offset++;
CHECK_FOR_END_ABSOLUTE(offset + 1);
while (SONGDATA(0) != 0xff) {
@@ -825,8 +799,8 @@
if (SONGDATA(0) == 0xff) {
sciprintf("[iterator-1] Song does not support"
- " hardware 0x%02x\n",
- self->device_id);
+ " hardware 0x%02x\n",
+ self->device_id);
return 1;
}
@@ -851,32 +825,32 @@
/* Regular MIDI channel */
if (self->channels_nr >= MIDI_CHANNELS) {
sciprintf("[iterator-1] Warning: Song has more than %d channels, cutting them off\n",
- MIDI_CHANNELS);
+ MIDI_CHANNELS);
break; /* Scan for remaining samples */
} else {
int channel_nr
- = self->data[track_offset] & 0xf;
+ = self->data[track_offset] & 0xf;
song_iterator_channel_t *channel =
- &(self->channels[self->channels_nr++]);
+ &(self->channels[self->channels_nr++]);
if (self->data[track_offset] & 0xf0)
- printf("Channel %d has mapping bits %02x\n",
+ printf("Channel %d has mapping bits %02x\n",
channel_nr, self->data[track_offset] & 0xf0);
_base_init_channel(channel,
- channel_nr,
- /* Skip over header bytes: */
- track_offset + 2,
- track_offset + end);
- _reset_synth_channels((base_song_iterator_t *) self,
- channel);
+ channel_nr,
+ /* Skip over header bytes: */
+ track_offset + 2,
+ track_offset + end);
+ _reset_synth_channels((base_song_iterator_t *) self,
+ channel);
self->polyphony[self->channels_nr - 1]
- = SCI1_CHANDATA(-1);
- self->importance[self->channels_nr - 1]
- = self->polyphony[self->channels_nr - 1] >> 4;
+ = SCI1_CHANDATA(-1);
+ self->importance[self->channels_nr - 1]
+ = self->polyphony[self->channels_nr - 1] >> 4;
self->polyphony[self->channels_nr - 1] &= 15;
-
+
channel->playmask = ~0; /* Enable all */
self->channel_mask |= (1 << channel_nr);
@@ -896,7 +870,7 @@
while (seeker) {
int prev_last_time = last_time;
sciprintf("[iterator-1] Detected sample: %d Hz, %d bytes at time %d\n",
- seeker->format.rate, seeker->size, seeker->delta);
+ seeker->format.rate, seeker->size, seeker->delta);
last_time = seeker->delta;
seeker->delta -= prev_last_time;
seeker = seeker->next;
@@ -908,12 +882,11 @@
#undef SONGDATA
static inline int
-_sci1_get_smallest_delta(sci1_song_iterator_t *self)
-{
+_sci1_get_smallest_delta(sci1_song_iterator_t *self) {
int i, d = -1;
for (i = 0; i < self->channels_nr; i++)
if (self->channels[i].state == SI_STATE_COMMAND
- && (d == -1 || self->channels[i].delay < d))
+ && (d == -1 || self->channels[i].delay < d))
d = self->channels[i].delay;
if (self->next_sample && self->next_sample->delta < d)
@@ -923,8 +896,7 @@
}
static inline void
-_sci1_update_delta(sci1_song_iterator_t *self, int delta)
-{
+_sci1_update_delta(sci1_song_iterator_t *self, int delta) {
int i;
if (self->next_sample)
@@ -936,13 +908,12 @@
}
static inline int
-_sci1_no_delta_time(sci1_song_iterator_t *self)
-{ /* Checks that none of the channels is waiting for its delta to be read */
+_sci1_no_delta_time(sci1_song_iterator_t *self) { /* Checks that none of the channels is waiting for its delta to be read */
int i;
for (i = 0; i < self->channels_nr; i++)
if (self->channels[i].state == SI_STATE_DELTA_TIME)
- return 0;
+ return 0;
return 1;
}
@@ -950,26 +921,25 @@
#if 0
// Unreferenced - removed
static void
-_sci1_dump_state(sci1_song_iterator_t *self)
-{
+_sci1_dump_state(sci1_song_iterator_t *self) {
int i;
sciprintf("-- [%p] ------------------------\n", self);
for (i = 0; i < self->channels_nr; i++) {
int j;
sciprintf("%d(s%02d): d-%d:\t(%x/%x) ",
- self->channels[i].id,
- self->channels[i].state,
- self->channels[i].delay,
- self->channels[i].offset,
- self->channels[i].end);
+ self->channels[i].id,
+ self->channels[i].state,
+ self->channels[i].delay,
+ self->channels[i].offset,
+ self->channels[i].end);
for (j = -3; j < 9; j++) {
if (j == 0)
sciprintf(">");
else
sciprintf(" ");
- sciprintf("%02x", self->data[self->channels[i].offset+j]);
+ sciprintf("%02x", self->data[self->channels[i].offset + j]);
if (j == 0)
sciprintf("<");
@@ -980,7 +950,7 @@
}
if (self->next_sample) {
sciprintf("\t[sample %d]\n",
- self->next_sample->delta);
+ self->next_sample->delta);
}
sciprintf("------------------------------------------\n");
}
@@ -990,18 +960,17 @@
#define COMMAND_INDEX_PCM -2
static inline int /* Determine the channel # of the next active event, or -1 */
-_sci1_command_index(sci1_song_iterator_t *self)
-{
+_sci1_command_index(sci1_song_iterator_t *self) {
int i;
int base_delay = 0x7ffffff;
int best_chan = COMMAND_INDEX_NONE;
for (i = 0; i < self->channels_nr; i++)
if ((self->channels[i].state != SI_STATE_PENDING)
- && (self->channels[i].state != SI_STATE_FINISHED)) {
-
+ && (self->channels[i].state != SI_STATE_FINISHED)) {
+
if ((self->channels[i].state == SI_STATE_DELTA_TIME)
- && (self->channels[i].delay == 0))
+ && (self->channels[i].delay == 0))
return i;
/* First, read all unknown delta times */
@@ -1019,16 +988,15 @@
static sfx_pcm_feed_t *
-_sci1_get_pcm(sci1_song_iterator_t *self)
-{
+_sci1_get_pcm(sci1_song_iterator_t *self) {
if (self->next_sample
- && self->next_sample->delta <= 0) {
+ && self->next_sample->delta <= 0) {
sci1_sample_t *sample = self->next_sample;
sfx_pcm_feed_t *feed
- = sfx_iterator_make_feed(self->data,
- sample->data - self->data,
- sample->size,
- sample->format);
+ = sfx_iterator_make_feed(self->data,
+ sample->data - self->data,
+ sample->size,
+ sample->format);
self->next_sample = self->next_sample->next;
@@ -1042,14 +1010,13 @@
static int
_sci1_process_next_command(sci1_song_iterator_t *self,
- unsigned char *buf, int *result)
-{
+ unsigned char *buf, int *result) {
int retval = -42; /* Shouldn't happen, but gcc doesn't agree */
int chan;
if (!self->initialised) {
sciprintf("[iterator-1] DEBUG: Initialising for %d\n",
- self->device_id);
+ self->device_id);
self->initialised = 1;
if (_sci1_song_init(self))
return SI_FINISHED;
@@ -1074,7 +1041,7 @@
if (self->next_sample->announced) {
/* Already announced; let's discard it */
sfx_pcm_feed_t *feed
- = _sci1_get_pcm(self);
+ = _sci1_get_pcm(self);
feed->destroy(feed);
} else {
int delay = self->next_sample->delta;
@@ -1089,45 +1056,45 @@
}
} else { /* Not a PCM */
- retval = _sci_midi_process((base_song_iterator_t *) self,
- buf, result,
- &(self->channels[chan]),
- PARSE_FLAG_LOOPS_UNLIMITED);
+ retval = _sci_midi_process((base_song_iterator_t *) self,
+ buf, result,
+ &(self->channels[chan]),
+ PARSE_FLAG_LOOPS_UNLIMITED);
- if (retval == SI_LOOP) {
- self->channels_looped++;
- self->channels[chan].state = SI_STATE_PENDING;
- self->channels[chan].delay = 0;
+ if (retval == SI_LOOP) {
+ self->channels_looped++;
+ self->channels[chan].state = SI_STATE_PENDING;
+ self->channels[chan].delay = 0;
- if (self->channels_looped == self->active_channels) {
- int i;
+ if (self->channels_looped == self->active_channels) {
+ int i;
- /* Everyone's ready: Let's loop */
- for (i = 0; i < self->channels_nr; i++)
- if (self->channels[i].state
- == SI_STATE_PENDING)
- self->channels[i].state
+ /* Everyone's ready: Let's loop */
+ for (i = 0; i < self->channels_nr; i++)
+ if (self->channels[i].state
+ == SI_STATE_PENDING)
+ self->channels[i].state
= SI_STATE_DELTA_TIME;
- self->channels_looped = 0;
- return SI_LOOP;
- }
- } else if (retval == SI_FINISHED) {
+ self->channels_looped = 0;
+ return SI_LOOP;
+ }
+ } else if (retval == SI_FINISHED) {
#ifdef DEBUG
- fprintf(stderr, "FINISHED some channel\n");
+ fprintf(stderr, "FINISHED some channel\n");
#endif
- } else if (retval > 0) {
- int sd ;
- sd = _sci1_get_smallest_delta(self);
+ } else if (retval > 0) {
+ int sd ;
+ sd = _sci1_get_smallest_delta(self);
- if (_sci1_no_delta_time(self) && sd) {
- /* No other channel is ready */
- _sci1_update_delta(self, sd);
+ if (_sci1_no_delta_time(self) && sd) {
+ /* No other channel is ready */
+ _sci1_update_delta(self, sd);
- /* Only from here do we return delta times */
- return sd;
+ /* Only from here do we return delta times */
+ return sd;
+ }
}
- }
} /* Not a PCM */
@@ -1137,9 +1104,8 @@
}
static struct _song_iterator *
-_sci1_handle_message(sci1_song_iterator_t *self,
- song_iterator_message_t msg)
-{
+ _sci1_handle_message(sci1_song_iterator_t *self,
+ song_iterator_message_t msg) {
if (msg.recipient == _SIMSG_BASE) { /* May extend this in the future */
switch (msg.type) {
@@ -1152,9 +1118,9 @@
print_tabs_id(msg.args[0].i, self->ID);
fprintf(stderr, "SCI1: chan-nr=%d, playmask=%04x\n",
- self->channels_nr, playmask);
+ self->channels_nr, playmask);
}
- break;
+ break;
case _SIMSG_BASEMSG_CLONE: {
int tsize = sizeof(sci1_song_iterator_t);
@@ -1172,7 +1138,7 @@
/* Clone chain of samples */
while (*samplep) {
sci1_sample_t *newsample
- = (sci1_sample_t*)sci_malloc(sizeof(sci1_sample_t));
+ = (sci1_sample_t*)sci_malloc(sizeof(sci1_sample_t));
memcpy(newsample, *samplep,
sizeof(sci1_sample_t));
*samplep = newsample;
@@ -1195,54 +1161,55 @@
break;
}
- case _SIMSG_BASEMSG_SET_PLAYMASK: if (msg.ID == self->ID) {
- self->channel_mask = 0;
+ case _SIMSG_BASEMSG_SET_PLAYMASK:
+ if (msg.ID == self->ID) {
+ self->channel_mask = 0;
- self->device_id
+ self->device_id
= sci0_to_sci1_device_map
- [sci_ffs(msg.args[0].i & 0xff) - 1]
- [sfx_pcm_available()]
- ;
+ [sci_ffs(msg.args[0].i & 0xff) - 1]
+ [sfx_pcm_available()]
+ ;
- if (self->device_id == 0xff) {
- sciprintf("[iterator-1] Warning: Device %d(%d) not supported",
- msg.args[0].i & 0xff, sfx_pcm_available());
- }
- if (self->initialised) {
- int i;
- int toffset = -1;
+ if (self->device_id == 0xff) {
+ sciprintf("[iterator-1] Warning: Device %d(%d) not supported",
+ msg.args[0].i & 0xff, sfx_pcm_available());
+ }
+ if (self->initialised) {
+ int i;
+ int toffset = -1;
- for (i = 0; i < self->channels_nr; i++)
- if (self->channels[i].state != SI_STATE_FINISHED
- && self->channels[i].total_timepos > toffset) {
- toffset = self->channels[i].total_timepos
- + self->channels[i].timepos_increment
- - self->channels[i].delay;
- }
+ for (i = 0; i < self->channels_nr; i++)
+ if (self->channels[i].state != SI_STATE_FINISHED
+ && self->channels[i].total_timepos > toffset) {
+ toffset = self->channels[i].total_timepos
+ + self->channels[i].timepos_increment
+ - self->channels[i].delay;
+ }
- /* Find an active channel so that we can
- ** get the correct time offset */
+ /* Find an active channel so that we can
+ ** get the correct time offset */
- _sci1_song_init(self);
+ _sci1_song_init(self);
- toffset -= self->delay_remaining;
- self->delay_remaining = 0;
+ toffset -= self->delay_remaining;
+ self->delay_remaining = 0;
- if (toffset > 0)
- return new_fast_forward_iterator((song_iterator_t *) self,
- toffset);
- } else {
- _sci1_song_init(self);
- self->initialised = 1;
- }
+ if (toffset > 0)
+ return new_fast_forward_iterator((song_iterator_t *) self,
+ toffset);
+ } else {
+ _sci1_song_init(self);
+ self->initialised = 1;
+ }
- break;
+ break;
- }
+ }
case _SIMSG_BASEMSG_SET_LOOPS:
if (msg.ID == self->ID)
- self->loops = (msg.args[0].i > 32767)? 99 : 0;
+ self->loops = (msg.args[0].i > 32767) ? 99 : 0;
/* 99 is arbitrary, but we can't use '1' because of
** the way we're testing in the decoding section. */
break;
@@ -1254,8 +1221,7 @@
/* Ignore */
break;
- case _SIMSG_BASEMSG_SET_FADE:
- {
+ case _SIMSG_BASEMSG_SET_FADE: {
fade_params_t *fp = (fade_params_t *) msg.args[0].p;
self->fade.action = fp->action;
self->fade.final_volume = fp->final_volume;
@@ -1266,7 +1232,7 @@
default:
fprintf(stderr, SIPFX "Unsupported command %d to"
- " SCI1 iterator", msg.type);
+ " SCI1 iterator", msg.type);
}
return (song_iterator_t *) self;
}
@@ -1276,15 +1242,13 @@
static int
_sci1_read_next_command(sci1_song_iterator_t *self,
- unsigned char *buf, int *result)
-{
+ unsigned char *buf, int *result) {
return _sci1_process_next_command(self, buf, result);
}
static void
-_sci1_init(sci1_song_iterator_t *self)
-{
+_sci1_init(sci1_song_iterator_t *self) {
_common_init((base_song_iterator_t *) self);
self->ccc = 127;
self->device_id = 0x00; /* Default to Sound Blaster/Adlib for purposes
@@ -1300,8 +1264,7 @@
}
static void
-_sci1_cleanup(sci1_song_iterator_t *it)
-{
+_sci1_cleanup(sci1_song_iterator_t *it) {
sci1_sample_t *sample_seeker = it->next_sample;
while (sample_seeker) {
sci1_sample_t *old_sample = sample_seeker;
@@ -1313,8 +1276,7 @@
}
static int
-_sci1_get_timepos(sci1_song_iterator_t *self)
-{
+_sci1_get_timepos(sci1_song_iterator_t *self) {
int max = 0;
int i;
@@ -1331,15 +1293,13 @@
static void
-_cleanup_iterator_init(song_iterator_t *it)
-{
+_cleanup_iterator_init(song_iterator_t *it) {
}
static song_iterator_t *
-_cleanup_iterator_handle_message(song_iterator_t *i, song_iterator_message_t msg)
-{
+_cleanup_iterator_handle_message(song_iterator_t *i, song_iterator_message_t msg) {
if (msg.recipient == _SIMSG_BASEMSG_PRINT
- && msg.type == _SIMSG_BASEMSG_PRINT) {
+ && msg.type == _SIMSG_BASEMSG_PRINT) {
print_tabs_id(msg.args[0].i, i->ID);
fprintf(stderr, "CLEANUP\n");
}
@@ -1348,8 +1308,7 @@
}
static int
-_cleanup_iterator_next(song_iterator_t *self, unsigned char *buf, int *result)
-{
+_cleanup_iterator_next(song_iterator_t *self, unsigned char *buf, int *result) {
/* Task: Return channel-notes-off for each channel */
if (self->channel_mask) {
int bs = sci_ffs(self->channel_mask) - 1;
@@ -1365,8 +1324,7 @@
}
song_iterator_t *
-new_cleanup_iterator(unsigned int channels)
-{
+new_cleanup_iterator(unsigned int channels) {
song_iterator_t *it = (song_iterator_t*)sci_malloc(sizeof(song_iterator_t));
it->channel_mask = channels;
it->ID = 17;
@@ -1388,8 +1346,7 @@
static int
_ff_read_next_command(fast_forward_song_iterator_t *self,
- byte *buf, int *result)
-{
+ byte *buf, int *result) {
int rv;
if (self->delta <= 0)
@@ -1413,15 +1370,13 @@
}
static sfx_pcm_feed_t *
-_ff_check_pcm(fast_forward_song_iterator_t *self)
-{
+_ff_check_pcm(fast_forward_song_iterator_t *self) {
return self->delegate->get_pcm_feed(self->delegate);
}
static song_iterator_t *
_ff_handle_message(fast_forward_song_iterator_t *self,
- song_iterator_message_t msg)
-{
+ song_iterator_message_t msg) {
if (msg.recipient == _SIMSG_PLASTICWRAP)
switch (msg.type) {
@@ -1465,27 +1420,23 @@
static void
-_ff_init(fast_forward_song_iterator_t *self)
-{
+_ff_init(fast_forward_song_iterator_t *self) {
return;
}
static int
-_ff_get_timepos(fast_forward_song_iterator_t *self)
-{
+_ff_get_timepos(fast_forward_song_iterator_t *self) {
return self->delegate->get_timepos(self->delegate);
}
song_iterator_t *
-new_fast_forward_iterator(song_iterator_t *capsit, int delta)
-{
+new_fast_forward_iterator(song_iterator_t *capsit, int delta) {
fast_forward_song_iterator_t *it =
- (fast_forward_song_iterator_t*)sci_malloc(sizeof(fast_forward_song_iterator_t));
+ (fast_forward_song_iterator_t*)sci_malloc(sizeof(fast_forward_song_iterator_t));
- if (capsit == NULL)
- {
- free(it);
- return NULL;
+ if (capsit == NULL) {
+ free(it);
+ return NULL;
}
it->ID = 0;
@@ -1494,19 +1445,19 @@
it->death_listeners_nr = 0;
it->next = (int(*)(song_iterator_t *, unsigned char *, int *))
- _ff_read_next_command;
- it->get_pcm_feed = (sfx_pcm_feed_t *(*)(song_iterator_t *))
- _ff_check_pcm;
- it->handle_message = (song_iterator_t *(*)(song_iterator_t *,
- song_iterator_message_t))
- _ff_handle_message;
+ _ff_read_next_command;
+ it->get_pcm_feed = (sfx_pcm_feed_t * (*)(song_iterator_t *))
+ _ff_check_pcm;
+ it->handle_message = (song_iterator_t * (*)(song_iterator_t *,
+ song_iterator_message_t))
+ _ff_handle_message;
it->get_timepos = (int(*)(song_iterator_t *))_ff_get_timepos;
it->init = (void(*)(song_iterator_t *))
- _ff_init;
+ _ff_init;
it->cleanup = NULL;
it->channel_mask = capsit->channel_mask;
-
+
return (song_iterator_t *) it;
}
@@ -1518,8 +1469,7 @@
static int
_tee_read_next_command(tee_song_iterator_t *it, unsigned char *buf,
- int *result)
-{
+ int *result) {
static int ready_masks[2] = {TEE_LEFT_READY, TEE_RIGHT_READY};
static int active_masks[2] = {TEE_LEFT_ACTIVE, TEE_RIGHT_ACTIVE};
static int pcm_masks[2] = {TEE_LEFT_PCM, TEE_RIGHT_PCM};
@@ -1538,7 +1488,7 @@
return SI_MORPH;
if ((it->status & (TEE_LEFT_ACTIVE | TEE_RIGHT_ACTIVE))
- != (TEE_LEFT_ACTIVE | TEE_RIGHT_ACTIVE)) {
+ != (TEE_LEFT_ACTIVE | TEE_RIGHT_ACTIVE)) {
/* Not all are is active? */
int which = 0;
#ifdef DEBUG_TEE_ITERATOR
@@ -1557,7 +1507,7 @@
/* First, check for unreported PCMs */
for (i = TEE_LEFT; i <= TEE_RIGHT; i++)
if ((it->status & (ready_masks[i] | pcm_masks[i]))
- == (ready_masks[i] | pcm_masks[i])) {
+ == (ready_masks[i] | pcm_masks[i])) {
it->status &= ~ready_masks[i];
return SI_PCM;
}
@@ -1567,27 +1517,27 @@
/* Buffers aren't ready yet */
it->children[i].retval =
- songit_next(&(it->children[i].it),
- it->children[i].buf,
- &(it->children[i].result),
- IT_READER_MASK_ALL
- | IT_READER_MAY_FREE
- | IT_READER_MAY_CLEAN);
+ songit_next(&(it->children[i].it),
+ it->children[i].buf,
+ &(it->children[i].result),
+ IT_READER_MASK_ALL
+ | IT_READER_MAY_FREE
+ | IT_READER_MAY_CLEAN);
it->status |= ready_masks[i];
#ifdef DEBUG_TEE_ITERATOR
fprintf(stderr, "\t Must check %d: %d\n", i,
- it->children[i].retval);
+ it->children[i].retval);
#endif
if (it->children[i].retval == SI_ABSOLUTE_CUE ||
- it->children[i].retval == SI_RELATIVE_CUE)
- return it->children[i].retval;
+ it->children[i].retval == SI_RELATIVE_CUE)
+ return it->children[i].retval;
if (it->children[i].retval == SI_FINISHED) {
it->status &= ~active_masks[i];
/* Recurse to complete */
#ifdef DEBUG_TEE_ITERATOR
-fprintf(stderr, "\t Child %d signalled completion, recursing w/ status %02x\n", i, it->status);
+ fprintf(stderr, "\t Child %d signalled completion, recursing w/ status %02x\n", i, it->status);
#endif
return _tee_read_next_command(it, buf, result);
} else if (it->children[i].retval == SI_PCM) {
@@ -1602,21 +1552,21 @@
retid = TEE_LEFT;
if ((it->children[TEE_LEFT].retval > 0)
- /* Asked to delay */
- && (it->children[TEE_RIGHT].retval <= it->children[TEE_LEFT].retval))
+ /* Asked to delay */
+ && (it->children[TEE_RIGHT].retval <= it->children[TEE_LEFT].retval))
/* Is not delaying or not delaying as much */
retid = TEE_RIGHT;
#ifdef DEBUG_TEE_ITERATOR
-fprintf(stderr, "\tl:%d / r:%d / chose %d\n",
- it->children[TEE_LEFT].retval, it->children[TEE_RIGHT].retval, retid);
+ fprintf(stderr, "\tl:%d / r:%d / chose %d\n",
+ it->children[TEE_LEFT].retval, it->children[TEE_RIGHT].retval, retid);
#endif
#if 0
if (it->children[retid].retval == 0) {
/* Perform remapping, if neccessary */
byte *buf = it->children[retid].buf;
if (*buf != SCI_MIDI_SET_SIGNAL
- && *buf < 0xf0) { /* Not a generic command */
+ && *buf < 0xf0) { /* Not a generic command */
int chan = *buf & 0xf;
int op = *buf & 0xf0;
@@ -1629,9 +1579,9 @@
/* Adjust delta times */
if (it->children[retid].retval > 0
- && it->children[1-retid].retval > 0) {
+ && it->children[1-retid].retval > 0) {
if (it->children[1-retid].retval
- == it->children[retid].retval)
+ == it->children[retid].retval)
/* If both children wait the same amount of time,
** we have to re-fetch commands from both */
it->status &= ~ready_masks[1-retid];
@@ -1639,7 +1589,7 @@
/* If they don't, we can/must re-use the other
** child's delay time */
it->children[1-retid].retval
- -= it->children[retid].retval;
+ -= it->children[retid].retval;
}
it->status &= ~ready_masks[retid];
@@ -1650,8 +1600,7 @@
}
static sfx_pcm_feed_t *
-_tee_check_pcm(tee_song_iterator_t *it)
-{
+_tee_check_pcm(tee_song_iterator_t *it) {
static int pcm_masks[2] = {TEE_LEFT_PCM, TEE_RIGHT_PCM};
int i;
@@ -1660,15 +1609,14 @@
it->status &= ~pcm_masks[i];
return it->children[i].it->
- get_pcm_feed(it->children[i].it);
+ get_pcm_feed(it->children[i].it);
}
return NULL; /* No iterator */
}
static song_iterator_t *
-_tee_handle_message(tee_song_iterator_t *self, song_iterator_message_t msg)
-{
+_tee_handle_message(tee_song_iterator_t *self, song_iterator_message_t msg) {
if (msg.recipient == _SIMSG_BASE) {
switch (msg.type) {
@@ -1680,15 +1628,15 @@
case _SIMSG_BASEMSG_CLONE: {
tee_song_iterator_t *newit
- = (tee_song_iterator_t*)sci_malloc(sizeof(tee_song_iterator_t));
+ = (tee_song_iterator_t*)sci_malloc(sizeof(tee_song_iterator_t));
memcpy(newit, self, sizeof(tee_song_iterator_t));
if (newit->children[TEE_LEFT].it)
newit->children[TEE_LEFT].it =
- songit_clone(newit->children[TEE_LEFT].it, msg.args[0].i);
+ songit_clone(newit->children[TEE_LEFT].it, msg.args[0].i);
if (newit->children[TEE_RIGHT].it)
newit->children[TEE_RIGHT].it =
- songit_clone(newit->children[TEE_RIGHT].it, msg.args[0].i);
+ songit_clone(newit->children[TEE_RIGHT].it, msg.args[0].i);
return (song_iterator_t *) newit;
}
@@ -1720,7 +1668,7 @@
return old_it;
} else {
sciprintf("[tee-iterator] WARNING:"
- " Morphing without need\n");
+ " Morphing without need\n");
return (song_iterator_t *) self;
}
@@ -1738,8 +1686,7 @@
}
static void
-_tee_init(tee_song_iterator_t *it)
-{
+_tee_init(tee_song_iterator_t *it) {
it->status = TEE_LEFT_ACTIVE | TEE_RIGHT_ACTIVE;
it->children[TEE_LEFT].it->init(it->children[TEE_LEFT].it);
it->children[TEE_RIGHT].it->init(it->children[TEE_RIGHT].it);
@@ -1748,8 +1695,7 @@
#if 0
// Unreferenced - removed
static void
-_tee_free(tee_song_iterator_t *it)
-{
+_tee_free(tee_song_iterator_t *it) {
int i;
for (i = TEE_LEFT; i <= TEE_RIGHT; i++)
if (it->children[i].it && it->may_destroy)
@@ -1759,8 +1705,7 @@
static void
songit_tee_death_notification(tee_song_iterator_t *self,
- song_iterator_t *corpse)
-{
+ song_iterator_t *corpse) {
if (corpse == self->children[TEE_LEFT].it) {
self->status &= ~TEE_LEFT_ACTIVE;
self->children[TEE_LEFT].it = NULL;
@@ -1774,8 +1719,7 @@
song_iterator_t *
-songit_new_tee(song_iterator_t *left, song_iterator_t *right, int may_destroy)
-{
+songit_new_tee(song_iterator_t *left, song_iterator_t *right, int may_destroy) {
int i;
int firstfree = 1; /* First free channel */
int incomplete_map = 0;
@@ -1794,28 +1738,28 @@
/* By default, don't remap */
for (i = 0; i < 16; i++)
it->children[TEE_LEFT].channel_remap[i]
- = it->children[TEE_RIGHT].channel_remap[i] = i;
+ = it->children[TEE_RIGHT].channel_remap[i] = i;
/* Default to lhs channels */
it->channel_mask = left->channel_mask;
for (i = 0; i < 16; i++)
if (it->channel_mask & (1 << i) & right->channel_mask
- && (i != MIDI_RHYTHM_CHANNEL) /* Share rhythm */) { /*conflict*/
+ && (i != MIDI_RHYTHM_CHANNEL) /* Share rhythm */) { /*conflict*/
while ((firstfree == MIDI_RHYTHM_CHANNEL)
- /* Either if it's the rhythm channel or if it's taken */
- || (firstfree < MIDI_CHANNELS
- && ((1 << firstfree) & it->channel_mask)))
+ /* Either if it's the rhythm channel or if it's taken */
+ || (firstfree < MIDI_CHANNELS
+ && ((1 << firstfree) & it->channel_mask)))
++firstfree;
if (firstfree == MIDI_CHANNELS) {
incomplete_map = 1;
fprintf(stderr, "[songit-tee <%08lx,%08lx>] "
- "Could not remap right channel #%d:"
- " Out of channels\n",
- left->ID, right->ID, i);
+ "Could not remap right channel #%d:"
+ " Out of channels\n",
+ left->ID, right->ID, i);
} else {
it->children[TEE_RIGHT].channel_remap[i]
- = firstfree;
+ = firstfree;
it->channel_mask |= (1 << firstfree);
}
@@ -1824,39 +1768,39 @@
if (incomplete_map) {
int c;
fprintf(stderr, "[songit-tee <%08lx,%08lx>] Channels:"
- " %04x <- %04x | %04x\n",
- left->ID, right->ID,
- it->channel_mask,
- left->channel_mask, right->channel_mask);
- for (c =0 ; c < 2; c++)
- for (i =0 ; i < 16; i++)
+ " %04x <- %04x | %04x\n",
+ left->ID, right->ID,
+ it->channel_mask,
+ left->channel_mask, right->channel_mask);
+ for (c = 0 ; c < 2; c++)
+ for (i = 0 ; i < 16; i++)
fprintf(stderr, " map [%d][%d] -> %d\n",
- c, i, it->children[c].channel_remap[i]);
+ c, i, it->children[c].channel_remap[i]);
}
#endif
it->next = (int(*)(song_iterator_t *, unsigned char *, int *))
- _tee_read_next_command;
+ _tee_read_next_command;
- it->get_pcm_feed = (sfx_pcm_feed_t*(*)(song_iterator_t *))
- _tee_check_pcm;
+ it->get_pcm_feed = (sfx_pcm_feed_t * (*)(song_iterator_t *))
+ _tee_check_pcm;
- it->handle_message = (song_iterator_t *(*)(song_iterator_t *,
- song_iterator_message_t))
- _tee_handle_message;
+ it->handle_message = (song_iterator_t * (*)(song_iterator_t *,
+ song_iterator_message_t))
+ _tee_handle_message;
it->init = (void(*)(song_iterator_t *))
- _tee_init;
+ _tee_init;
it->get_timepos = NULL;
song_iterator_add_death_listener((song_iterator_t *)it,
- left, (void (*)(void *, void*))
- songit_tee_death_notification);
+ left, (void (*)(void *, void*))
+ songit_tee_death_notification);
song_iterator_add_death_listener((song_iterator_t *)it,
- right, (void (*)(void *, void*))
- songit_tee_death_notification);
+ right, (void (*)(void *, void*))
+ songit_tee_death_notification);
it->cleanup = NULL;
@@ -1869,8 +1813,7 @@
/*************************************/
int
-songit_next(song_iterator_t **it, unsigned char *buf, int *result, int mask)
-{
+songit_next(song_iterator_t **it, unsigned char *buf, int *result, int mask) {
int retval;
if (!*it)
@@ -1887,10 +1830,10 @@
if (retval == SI_FINISHED)
fprintf(stderr, "[song-iterator] Song finished. mask = %04x, cm=%04x\n",
- mask, (*it)->channel_mask);
+ mask, (*it)->channel_mask);
if (retval == SI_FINISHED
- && (mask & IT_READER_MAY_CLEAN)
- && (*it)->channel_mask) { /* This last test will fail
+ && (mask & IT_READER_MAY_CLEAN)
+ && (*it)->channel_mask) { /* This last test will fail
** with a terminated
** cleanup iterator */
int channel_mask = (*it)->channel_mask;
@@ -1900,20 +1843,20 @@
*it = new_cleanup_iterator(channel_mask);
retval = -9999; /* Continue */
}
- } while (! ( /* Until one of the following holds */
- (retval > 0 && (mask & IT_READER_MASK_DELAY))
- || (retval == 0 && (mask & IT_READER_MASK_MIDI))
- || (retval == SI_LOOP && (mask & IT_READER_MASK_LOOP))
- || (retval == SI_ABSOLUTE_CUE &&
- (mask & IT_READER_MASK_CUE))
- || (retval == SI_RELATIVE_CUE &&
- (mask & IT_READER_MASK_CUE))
- || (retval == SI_PCM && (mask & IT_READER_MASK_PCM))
- || (retval == SI_FINISHED)
- ));
+ } while (!( /* Until one of the following holds */
+ (retval > 0 && (mask & IT_READER_MASK_DELAY))
+ || (retval == 0 && (mask & IT_READER_MASK_MIDI))
+ || (retval == SI_LOOP && (mask & IT_READER_MASK_LOOP))
+ || (retval == SI_ABSOLUTE_CUE &&
+ (mask & IT_READER_MASK_CUE))
+ || (retval == SI_RELATIVE_CUE &&
+ (mask & IT_READER_MASK_CUE))
+ || (retval == SI_PCM && (mask & IT_READER_MASK_PCM))
+ || (retval == SI_FINISHED)
+ ));
if (retval == SI_FINISHED
- && (mask & IT_READER_MAY_FREE)) {
+ && (mask & IT_READER_MAY_FREE)) {
songit_free(*it);
*it = NULL;
}
@@ -1924,65 +1867,64 @@
song_iterator_t *
-songit_new(unsigned char *data, unsigned int size, int type, songit_id_t id)
-{
+songit_new(unsigned char *data, unsigned int size, int type, songit_id_t id) {
base_song_iterator_t *it;
int i;
if (!data || size < 22) {
fprintf(stderr, SIPFX "Attempt to instantiate song iterator for null"
- " song data\n");
+ " song data\n");
return NULL;
}
switch (type) {
- case SCI_SONG_ITERATOR_TYPE_SCI0:
- /**-- Playing SCI0 sound resources --**/
- it = (base_song_iterator_t*)sci_malloc(sizeof(sci0_song_iterator_t));
- it->channel_mask = 0xffff; /* Allocate all channels by default */
+ case SCI_SONG_ITERATOR_TYPE_SCI0:
+ /**-- Playing SCI0 sound resources --**/
+ it = (base_song_iterator_t*)sci_malloc(sizeof(sci0_song_iterator_t));
+ it->channel_mask = 0xffff; /* Allocate all channels by default */
- for (i = 0; i < MIDI_CHANNELS; i++)
- it->polyphony[i] = data[1 + (i << 1)];
+ for (i = 0; i < MIDI_CHANNELS; i++)
+ it->polyphony[i] = data[1 + (i << 1)];
- it->next = (int(*)(song_iterator_t *, unsigned char *, int *))
- _sci0_read_next_command;
- it->get_pcm_feed = (sfx_pcm_feed_t*(*)(song_iterator_t *))
- _sci0_check_pcm;
- it->handle_message = (song_iterator_t *(*)(song_iterator_t *, song_iterator_message_t))
- _sci0_handle_message;
- it->init = (void(*)(song_iterator_t *))_sci0_init;
- it->cleanup = (void(*)(song_iterator_t *))_sci0_cleanup;
- ((sci0_song_iterator_t *)it)->channel.state
- = SI_STATE_UNINITIALISED;
- it->get_timepos = (int(*)(song_iterator_t *))_sci0_get_timepos;
- break;
+ it->next = (int(*)(song_iterator_t *, unsigned char *, int *))
+ _sci0_read_next_command;
+ it->get_pcm_feed = (sfx_pcm_feed_t * (*)(song_iterator_t *))
+ _sci0_check_pcm;
+ it->handle_message = (song_iterator_t * (*)(song_iterator_t *, song_iterator_message_t))
+ _sci0_handle_message;
+ it->init = (void(*)(song_iterator_t *))_sci0_init;
+ it->cleanup = (void(*)(song_iterator_t *))_sci0_cleanup;
+ ((sci0_song_iterator_t *)it)->channel.state
+ = SI_STATE_UNINITIALISED;
+ it->get_timepos = (int(*)(song_iterator_t *))_sci0_get_timepos;
+ break;
- case SCI_SONG_ITERATOR_TYPE_SCI1:
- /**-- SCI01 or later sound resource --**/
- it = (base_song_iterator_t*)sci_malloc(sizeof(sci1_song_iterator_t));
- it->channel_mask = 0; /* Defer channel allocation */
+ case SCI_SONG_ITERATOR_TYPE_SCI1:
+ /**-- SCI01 or later sound resource --**/
+ it = (base_song_iterator_t*)sci_malloc(sizeof(sci1_song_iterator_t));
+ it->channel_mask = 0; /* Defer channel allocation */
- for (i = 0; i < MIDI_CHANNELS; i++)
- it->polyphony[i] = 0; /* Unknown */
+ for (i = 0; i < MIDI_CHANNELS; i++)
+ it->polyphony[i] = 0; /* Unknown */
- it->next = (int(*)(song_iterator_t *, unsigned char *, int *))
- _sci1_read_next_command;
- it->get_pcm_feed = (sfx_pcm_feed_t*(*)(song_iterator_t *))
- _sci1_get_pcm;
- it->handle_message = (song_iterator_t *(*)(song_iterator_t *, song_iterator_message_t))
- _sci1_handle_message;
- it->init = (void(*)(song_iterator_t *))_sci1_init;
- it->cleanup = (void(*)(song_iterator_t *))_sci1_cleanup;
- it->get_timepos = (int(*)(song_iterator_t *))_sci1_get_timepos;
- break;
+ it->next = (int(*)(song_iterator_t *, unsigned char *, int *))
+ _sci1_read_next_command;
+ it->get_pcm_feed = (sfx_pcm_feed_t * (*)(song_iterator_t *))
+ _sci1_get_pcm;
+ it->handle_message = (song_iterator_t * (*)(song_iterator_t *, song_iterator_message_t))
+ _sci1_handle_message;
+ it->init = (void(*)(song_iterator_t *))_sci1_init;
+ it->cleanup = (void(*)(song_iterator_t *))_sci1_cleanup;
+ it->get_timepos = (int(*)(song_iterator_t *))_sci1_get_timepos;
+ break;
- default:
- /**-- Invalid/unsupported sound resources --**/
- fprintf(stderr, SIPFX "Attempt to instantiate invalid/unknown"
- " song iterator type %d\n", type);
- return NULL;
+ default:
+ /**-- Invalid/unsupported sound resources --**/
+ fprintf(stderr, SIPFX "Attempt to instantiate invalid/unknown"
+ " song iterator type %d\n", type);
+ return NULL;
}
it->ID = id;
@@ -1997,8 +1939,7 @@
}
void
-songit_free(song_iterator_t *it)
-{
+songit_free(song_iterator_t *it) {
if (it) {
int i;
@@ -2013,8 +1954,7 @@
}
song_iterator_message_t
-songit_make_message(songit_id_t id, int recipient, int type, int a1, int a2)
-{
+songit_make_message(songit_id_t id, int recipient, int type, int a1, int a2) {
song_iterator_message_t rv;
rv.ID = id;
rv.recipient = recipient;
@@ -2026,8 +1966,7 @@
}
song_iterator_message_t
-songit_make_ptr_message(songit_id_t id, int recipient, int type, void * a1, int a2)
-{
+songit_make_ptr_message(songit_id_t id, int recipient, int type, void * a1, int a2) {
song_iterator_message_t rv;
rv.ID = id;
rv.recipient = recipient;
@@ -2040,8 +1979,7 @@
int
-songit_handle_message(song_iterator_t **it_reg_p, song_iterator_message_t msg)
-{
+songit_handle_message(song_iterator_t **it_reg_p, song_iterator_message_t msg) {
song_iterator_t *it = *it_reg_p;
song_iterator_t *newit;
@@ -2055,8 +1993,7 @@
}
song_iterator_t *
-songit_clone(song_iterator_t *it, int delta)
-{
+songit_clone(song_iterator_t *it, int delta) {
SIMSG_SEND(it, SIMSG_CLONE(delta));
it->death_listeners_nr = 0;
it->flags |= SONGIT_FLAG_CLONE;
@@ -2065,12 +2002,11 @@
void
song_iterator_add_death_listener(song_iterator_t *it,
- void *client,
- void (*notify) (void *self, void *notifier))
-{
+ void *client,
+ void (*notify)(void *self, void *notifier)) {
if (it->death_listeners_nr >= SONGIT_MAX_LISTENERS) {
fprintf(stderr, "FATAL: Too many death listeners for song"
- " iterator\n");
+ " iterator\n");
BREAKPOINT();
exit(1);
}
@@ -2083,32 +2019,30 @@
void
song_iterator_remove_death_listener(song_iterator_t *it,
- void *client)
-{
+ void *client) {
int i;
for (i = 0; i < it->death_listeners_nr; i++) {
if (it->death_listeners[i].self == client) {
--it->death_listeners_nr;
/* Overwrite, if this wasn't the last one */
- if (i+1 < it->death_listeners_nr)
+ if (i + 1 < it->death_listeners_nr)
it->death_listeners[i]
- = it->death_listeners[it->death_listeners_nr];
+ = it->death_listeners[it->death_listeners_nr];
return;
}
}
fprintf(stderr, "FATAL: Could not remove death listener from "
- "song iterator\n");
+ "song iterator\n");
BREAKPOINT();
exit(1);
}
song_iterator_t *
-sfx_iterator_combine(song_iterator_t *it1, song_iterator_t *it2)
-{
+sfx_iterator_combine(song_iterator_t *it1, song_iterator_t *it2) {
if (it1 == NULL)
return it2;
if (it2 == NULL)
Modified: scummvm/trunk/engines/sci/sfx/lists/gm_patches.cpp
===================================================================
--- scummvm/trunk/engines/sci/sfx/lists/gm_patches.cpp 2009-02-15 22:33:36 UTC (rev 38321)
+++ scummvm/trunk/engines/sci/sfx/lists/gm_patches.cpp 2009-02-15 22:34:41 UTC (rev 38322)
@@ -19,180 +19,182 @@
***************************************************************************/
char *GM_Patch[128] = {
-/*000*/ "Acoustic Grand Piano",
-/*001*/ "Bright Acoustic Piano",
-/*002*/ "Electric Grand Piano",
-/*003*/ "Honky-tonk Piano",
-/*004*/ "Electric Piano 1",
-/*005*/ "Electric Piano 2",
-/*006*/ "Harpsichord",
-/*007*/ "Clavinet",
-/*008*/ "Celesta",
-/*009*/ "Glockenspiel",
-/*010*/ "Music Box",
-/*011*/ "Vibraphone",
-/*012*/ "Marimba",
-/*013*/ "Xylophone",
-/*014*/ "Tubular Bells",
-/*015*/ "Dulcimer",
-/*016*/ "Drawbar Organ",
-/*017*/ "Percussive Organ",
-/*018*/ "Rock Organ",
-/*019*/ "Church Organ",
-/*020*/ "Reed Organ",
-/*021*/ "Accordion",
-/*022*/ "Harmonica",
-/*023*/ "Tango Accordion",
-/*024*/ "Acoustic Guitar (nylon)",
-/*025*/ "Acoustic Guitar (steel)",
-/*026*/ "Electric Guitar (jazz)",
-/*027*/ "Electric Guitar (clean)",
-/*028*/ "Electric Guitar (muted)",
-/*029*/ "Overdriven Guitar",
-/*030*/ "Distortion Guitar",
-/*031*/ "Guitar Harmonics",
-/*032*/ "Acoustic Bass",
-/*033*/ "Electric Bass (finger)",
-/*034*/ "Electric Bass (pick)",
-/*035*/ "Fretless Bass",
-/*036*/ "Slap Bass 1",
-/*037*/ "Slap Bass 2",
-/*038*/ "Synth Bass 1",
-/*039*/ "Synth Bass 2",
-/*040*/ "Violin",
-/*041*/ "Viola",
-/*042*/ "Cello",
-/*043*/ "Contrabass",
-/*044*/ "Tremolo Strings",
-/*045*/ "Pizzicato Strings",
-/*046*/ "Orchestral Harp",
-/*047*/ "Timpani",
-/*048*/ "String Ensemble 1",
-/*049*/ "String Ensemble 2",
-/*050*/ "SynthStrings 1",
-/*051*/ "SynthStrings 2",
-/*052*/ "Choir Aahs",
-/*053*/ "Voice Oohs",
-/*054*/ "Synth Voice",
-/*055*/ "Orchestra Hit",
-/*056*/ "Trumpet",
-/*057*/ "Trombone",
-/*058*/ "Tuba",
-/*059*/ "Muted Trumpet",
-/*060*/ "French Horn",
-/*061*/ "Brass Section",
-/*062*/ "SynthBrass 1",
-/*063*/ "SynthBrass 2",
-/*064*/ "Soprano Sax",
-/*065*/ "Alto Sax",
-/*066*/ "Tenor Sax",
-/*067*/ "Baritone Sax",
-/*068*/ "Oboe",
-/*069*/ "English Horn",
-/*070*/ "Bassoon",
-/*071*/ "Clarinet",
-/*072*/ "Piccolo",
-/*073*/ "Flute",
-/*074*/ "Recorder",
-/*075*/ "Pan Flute",
-/*076*/ "Blown Bottle",
-/*077*/ "Shakuhachi",
-/*078*/ "Whistle",
-/*079*/ "Ocarina",
-/*080*/ "Lead 1 (square)",
-/*081*/ "Lead 2 (sawtooth)",
-/*082*/ "Lead 3 (calliope)",
-/*083*/ "Lead 4 (chiff)",
-/*084*/ "Lead 5 (charang)",
-/*085*/ "Lead 6 (voice)",
-/*086*/ "Lead 7 (fifths)",
-/*087*/ "Lead 8 (bass+lead)",
-/*088*/ "Pad 1 (new age)",
-/*089*/ "Pad 2 (warm)",
-/*090*/ "Pad 3 (polysynth)",
-/*091*/ "Pad 4 (choir)",
-/*092*/ "Pad 5 (bowed)",
-/*093*/ "Pad 6 (metallic)",
-/*094*/ "Pad 7 (halo)",
-/*095*/ "Pad 8 (sweep)",
-/*096*/ "FX 1 (rain)",
-/*097*/ "FX 2 (soundtrack)",
-/*098*/ "FX 3 (crystal)",
-/*099*/ "FX 4 (atmosphere)",
-/*100*/ "FX 5 (brightness)",
-/*101*/ "FX 6 (goblins)",
-/*102*/ "FX 7 (echoes)",
-/*103*/ "FX 8 (sci-fi)",
-/*104*/ "Sitar",
-/*105*/ "Banjo",
-/*106*/ "Shamisen",
-/*107*/ "Koto",
-/*108*/ "Kalimba",
-/*109*/ "Bag pipe",
-/*110*/ "Fiddle",
-/*111*/ "Shannai",
-/*112*/ "Tinkle Bell",
-/*113*/ "Agogo",
-/*114*/ "Steel Drums",
-/*115*/ "Woodblock",
-/*116*/ "Taiko Drum",
-/*117*/ "Melodic Tom",
-/*118*/ "Synth Drum",
-/*119*/ "Reverse Cymbal",
-/*120*/ "Guitar Fret Noise",
-/*121*/ "Breath Noise",
-/*122*/ "Seashore",
-/*123*/ "Bird Tweet",
-/*124*/ "Telephone Ring",
-/*125*/ "Helicopter",
-/*126*/ "Applause",
-/*127*/ "Gunshot" };
+ /*000*/ "Acoustic Grand Piano",
+ /*001*/ "Bright Acoustic Piano",
+ /*002*/ "Electric Grand Piano",
+ /*003*/ "Honky-tonk Piano",
+ /*004*/ "Electric Piano 1",
+ /*005*/ "Electric Piano 2",
+ /*006*/ "Harpsichord",
+ /*007*/ "Clavinet",
+ /*008*/ "Celesta",
+ /*009*/ "Glockenspiel",
+ /*010*/ "Music Box",
+ /*011*/ "Vibraphone",
+ /*012*/ "Marimba",
+ /*013*/ "Xylophone",
+ /*014*/ "Tubular Bells",
+ /*015*/ "Dulcimer",
+ /*016*/ "Drawbar Organ",
+ /*017*/ "Percussive Organ",
+ /*018*/ "Rock Organ",
+ /*019*/ "Church Organ",
+ /*020*/ "Reed Organ",
+ /*021*/ "Accordion",
+ /*022*/ "Harmonica",
+ /*023*/ "Tango Accordion",
+ /*024*/ "Acoustic Guitar (nylon)",
+ /*025*/ "Acoustic Guitar (steel)",
+ /*026*/ "Electric Guitar (jazz)",
+ /*027*/ "Electric Guitar (clean)",
+ /*028*/ "Electric Guitar (muted)",
+ /*029*/ "Overdriven Guitar",
+ /*030*/ "Distortion Guitar",
+ /*031*/ "Guitar Harmonics",
+ /*032*/ "Acoustic Bass",
+ /*033*/ "Electric Bass (finger)",
+ /*034*/ "Electric Bass (pick)",
+ /*035*/ "Fretless Bass",
+ /*036*/ "Slap Bass 1",
+ /*037*/ "Slap Bass 2",
+ /*038*/ "Synth Bass 1",
+ /*039*/ "Synth Bass 2",
+ /*040*/ "Violin",
+ /*041*/ "Viola",
+ /*042*/ "Cello",
+ /*043*/ "Contrabass",
+ /*044*/ "Tremolo Strings",
+ /*045*/ "Pizzicato Strings",
+ /*046*/ "Orchestral Harp",
+ /*047*/ "Timpani",
+ /*048*/ "String Ensemble 1",
+ /*049*/ "String Ensemble 2",
+ /*050*/ "SynthStrings 1",
+ /*051*/ "SynthStrings 2",
+ /*052*/ "Choir Aahs",
+ /*053*/ "Voice Oohs",
+ /*054*/ "Synth Voice",
+ /*055*/ "Orchestra Hit",
+ /*056*/ "Trumpet",
+ /*057*/ "Trombone",
+ /*058*/ "Tuba",
+ /*059*/ "Muted Trumpet",
+ /*060*/ "French Horn",
+ /*061*/ "Brass Section",
+ /*062*/ "SynthBrass 1",
+ /*063*/ "SynthBrass 2",
+ /*064*/ "Soprano Sax",
+ /*065*/ "Alto Sax",
+ /*066*/ "Tenor Sax",
+ /*067*/ "Baritone Sax",
+ /*068*/ "Oboe",
+ /*069*/ "English Horn",
+ /*070*/ "Bassoon",
+ /*071*/ "Clarinet",
+ /*072*/ "Piccolo",
+ /*073*/ "Flute",
+ /*074*/ "Recorder",
+ /*075*/ "Pan Flute",
+ /*076*/ "Blown Bottle",
+ /*077*/ "Shakuhachi",
+ /*078*/ "Whistle",
+ /*079*/ "Ocarina",
+ /*080*/ "Lead 1 (square)",
+ /*081*/ "Lead 2 (sawtooth)",
+ /*082*/ "Lead 3 (calliope)",
+ /*083*/ "Lead 4 (chiff)",
+ /*084*/ "Lead 5 (charang)",
+ /*085*/ "Lead 6 (voice)",
+ /*086*/ "Lead 7 (fifths)",
+ /*087*/ "Lead 8 (bass+lead)",
+ /*088*/ "Pad 1 (new age)",
+ /*089*/ "Pad 2 (warm)",
+ /*090*/ "Pad 3 (polysynth)",
+ /*091*/ "Pad 4 (choir)",
+ /*092*/ "Pad 5 (bowed)",
+ /*093*/ "Pad 6 (metallic)",
+ /*094*/ "Pad 7 (halo)",
+ /*095*/ "Pad 8 (sweep)",
+ /*096*/ "FX 1 (rain)",
+ /*097*/ "FX 2 (soundtrack)",
+ /*098*/ "FX 3 (crystal)",
+ /*099*/ "FX 4 (atmosphere)",
+ /*100*/ "FX 5 (brightness)",
+ /*101*/ "FX 6 (goblins)",
+ /*102*/ "FX 7 (echoes)",
+ /*103*/ "FX 8 (sci-fi)",
+ /*104*/ "Sitar",
+ /*105*/ "Banjo",
+ /*106*/ "Shamisen",
+ /*107*/ "Koto",
+ /*108*/ "Kalimba",
+ /*109*/ "Bag pipe",
+ /*110*/ "Fiddle",
+ /*111*/ "Shannai",
+ /*112*/ "Tinkle Bell",
+ /*113*/ "Agogo",
+ /*114*/ "Steel Drums",
+ /*115*/ "Woodblock",
+ /*116*/ "Taiko Drum",
+ /*117*/ "Melodic Tom",
+ /*118*/ "Synth Drum",
+ /*119*/ "Reverse Cymbal",
+ /*120*/ "Guitar Fret Noise",
+ /*121*/ "Breath Noise",
+ /*122*/ "Seashore",
+ /*123*/ "Bird Tweet",
+ /*124*/ "Telephone Ring",
+ /*125*/ "Helicopter",
+ /*126*/ "Applause",
+ /*127*/ "Gunshot"
+};
char *GM_RhythmKey[47] = {
-/*035*/ "Acoustic Bass Drum",
-/*036*/ "Bass Drum 1",
-/*037*/ "Side Stick",
-/*038*/ "Acoustic Snare",
-/*039*/ "Hand Clap",
-/*040*/ "Electric Snare",
-/*041*/ "Low Floor Tom",
-/*042*/ "Closed Hi-Hat",
-/*043*/ "High Floor Tom",
-/*044*/ "Pedal Hi-Hat",
-/*045*/ "Low Tom",
-/*046*/ "Open Hi-Hat",
-/*047*/ "Low-Mid Tom",
-/*048*/ "Hi-Mid Tom",
-/*049*/ "Crash Cymbal 1",
-/*050*/ "High Tom",
-/*051*/ "Ride Cymbal 1",
-/*052*/ "Chinese Cymbal",
-/*053*/ "Ride Bell",
-/*054*/ "Tambourine",
-/*055*/ "Splash Cymbal",
-/*056*/ "Cowbell",
-/*057*/ "Crash Cymbal 2",
-/*058*/ "Vibraslap",
-/*059*/ "Ride Cymbal 2",
-/*060*/ "Hi Bongo",
-/*061*/ "Low Bongo",
-/*062*/ "Mute Hi Conga",
-/*063*/ "Open Hi Conga",
-/*064*/ "Low Conga",
-/*065*/ "High Timbale",
-/*066*/ "Low Timbale",
-/*067*/ "High Agogo",
-/*068*/ "Low Agogo",
-/*069*/ "Cabasa",
-/*070*/ "Maracas",
-/*071*/ "Short Whistle",
-/*072*/ "Long Whistle",
-/*073*/ "Short Guiro",
-/*074*/ "Long Guiro",
-/*075*/ "Claves",
-/*076*/ "Hi Wood Block",
-/*077*/ "Low Wood Block",
-/*078*/ "Mute Cuica",
-/*079*/ "Open Cuica",
-/*080*/ "Mute Triangle"
-/*081*/ "Open Triangle" };
+ /*035*/ "Acoustic Bass Drum",
+ /*036*/ "Bass Drum 1",
+ /*037*/ "Side Stick",
+ /*038*/ "Acoustic Snare",
+ /*039*/ "Hand Clap",
+ /*040*/ "Electric Snare",
+ /*041*/ "Low Floor Tom",
+ /*042*/ "Closed Hi-Hat",
+ /*043*/ "High Floor Tom",
+ /*044*/ "Pedal Hi-Hat",
+ /*045*/ "Low Tom",
+ /*046*/ "Open Hi-Hat",
+ /*047*/ "Low-Mid Tom",
+ /*048*/ "Hi-Mid Tom",
+ /*049*/ "Crash Cymbal 1",
+ /*050*/ "High Tom",
+ /*051*/ "Ride Cymbal 1",
+ /*052*/ "Chinese Cymbal",
+ /*053*/ "Ride Bell",
+ /*054*/ "Tambourine",
+ /*055*/ "Splash Cymbal",
+ /*056*/ "Cowbell",
+ /*057*/ "Crash Cymbal 2",
+ /*058*/ "Vibraslap",
+ /*059*/ "Ride Cymbal 2",
+ /*060*/ "Hi Bongo",
+ /*061*/ "Low Bongo",
+ /*062*/ "Mute Hi Conga",
+ /*063*/ "Open Hi Conga",
+ /*064*/ "Low Conga",
+ /*065*/ "High Timbale",
+ /*066*/ "Low Timbale",
+ /*067*/ "High Agogo",
+ /*068*/ "Low Agogo",
+ /*069*/ "Cabasa",
+ /*070*/ "Maracas",
+ /*071*/ "Short Whistle",
+ /*072*/ "Long Whistle",
+ /*073*/ "Short Guiro",
+ /*074*/ "Long Guiro",
+ /*075*/ "Claves",
+ /*076*/ "Hi Wood Block",
+ /*077*/ "Low Wood Block",
+ /*078*/ "Mute Cuica",
+ /*079*/ "Open Cuica",
+ /*080*/ "Mute Triangle"
+ /*081*/ "Open Triangle"
+};
Modified: scummvm/trunk/engines/sci/sfx/lists/mt32_timbres.cpp
===================================================================
--- scummvm/trunk/engines/sci/sfx/lists/mt32_timbres.cpp 2009-02-15 22:33:36 UTC (rev 38321)
+++ scummvm/trunk/engines/sci/sfx/lists/mt32_timbres.cpp 2009-02-15 22:34:41 UTC (rev 38322)
@@ -19,163 +19,165 @@
***************************************************************************/
char *MT32_Timbre[128] = {
-/*000*/ "AcouPiano1",
-/*001*/ "AcouPiano2",
-/*002*/ "AcouPiano3",
-/*003*/ "ElecPiano1",
-/*004*/ "ElecPiano2",
-/*005*/ "ElecPiano3",
-/*006*/ "ElecPiano4",
-/*007*/ "Honkytonk ",
-/*008*/ "Elec Org 1",
-/*009*/ "Elec Org 2",
-/*010*/ "Elec Org 3",
-/*011*/ "Elec Org 4",
-/*012*/ "Pipe Org 1",
-/*013*/ "Pipe Org 2",
-/*014*/ "Pipe Org 3",
-/*015*/ "Accordion ",
-/*016*/ "Harpsi 1 ",
-/*017*/ "Harpsi 2 ",
-/*018*/ "Harpsi 3 ",
-/*019*/ "Clavi 1 ",
-/*020*/ "Clavi 2 ",
-/*021*/ "Clavi 3 ",
-/*022*/ "Celesta 1 ",
-/*023*/ "Celesta 2 ",
-/*024*/ "Syn Brass1",
-/*025*/ "Syn Brass2",
-/*026*/ "Syn Brass3",
-/*027*/ "Syn Brass4",
-/*028*/ "Syn Bass 1",
-/*029*/ "Syn Bass 2",
-/*030*/ "Syn Bass 3",
-/*031*/ "Syn Bass 4",
-/*032*/ "Fantasy ",
-/*033*/ "Harmo Pan ",
-/*034*/ "Chorale ",
-/*035*/ "Glasses ",
-/*036*/ "Soundtrack",
-/*037*/ "Atmosphere",
-/*038*/ "Warm Bell ",
-/*039*/ "Funny Vox ",
-/*040*/ "Echo Bell ",
-/*041*/ "Ice Rain ",
-/*042*/ "Oboe 2001 ",
-/*043*/ "Echo Pan ",
-/*044*/ "DoctorSolo",
-/*045*/ "Schooldaze",
-/*046*/ "BellSinger",
-/*047*/ "SquareWave",
-/*048*/ "Str Sect 1",
-/*049*/ "Str Sect 2",
-/*050*/ "Str Sect 3",
-/*051*/ "Pizzicato ",
-/*052*/ "Violin 1 ",
-/*053*/ "Violin 2 ",
-/*054*/ "Cello 1 ",
-/*055*/ "Cello 2 ",
-/*056*/ "Contrabass",
-/*057*/ "Harp 1 ",
-/*058*/ "Harp 2 ",
-/*059*/ "Guitar 1 ",
-/*060*/ "Guitar 2 ",
-/*061*/ "Elec Gtr 1",
-/*062*/ "Elec Gtr 2",
-/*063*/ "Sitar ",
-/*064*/ "Acou Bass1",
-/*065*/ "Acou Bass2",
-/*066*/ "Elec Bass1",
-/*067*/ "Elec Bass2",
-/*068*/ "Slap Bass1",
-/*069*/ "Slap Bass2",
-/*070*/ "Fretless 1",
-/*071*/ "Fretless 2",
-/*072*/ "Flute 1 ",
-/*073*/ "Flute 2 ",
-/*074*/ "Piccolo 1 ",
-/*075*/ "Piccolo 2 ",
-/*076*/ "Recorder ",
-/*077*/ "Panpipes ",
-/*078*/ "Sax 1 ",
-/*079*/ "Sax 2 ",
-/*080*/ "Sax 3 ",
-/*081*/ "Sax 4 ",
-/*082*/ "Clarinet 1",
-/*083*/ "Clarinet 2",
-/*084*/ "Oboe ",
-/*085*/ "Engl Horn ",
-/*086*/ "Bassoon ",
-/*087*/ "Harmonica ",
-/*088*/ "Trumpet 1 ",
-/*089*/ "Trumpet 2 ",
-/*090*/ "Trombone 1",
-/*091*/ "Trombone 2",
-/*092*/ "Fr Horn 1 ",
-/*093*/ "Fr Horn 2 ",
-/*094*/ "Tuba ",
-/*095*/ "Brs Sect 1",
-/*096*/ "Brs Sect 2",
-/*097*/ "Vibe 1 ",
-/*098*/ "Vibe 2 ",
-/*099*/ "Syn Mallet",
-/*100*/ "Wind Bell ",
-/*101*/ "Glock ",
-/*102*/ "Tube Bell ",
-/*103*/ "Xylophone ",
-/*104*/ "Marimba ",
-/*105*/ "Koto ",
-/*106*/ "Sho ",
-/*107*/ "Shakuhachi",
-/*108*/ "Whistle 1 ",
-/*109*/ "Whistle 2 ",
-/*110*/ "BottleBlow",
-/*111*/ "BreathPipe",
-/*112*/ "Timpani ",
-/*113*/ "MelodicTom",
-/*114*/ "Deep Snare",
-/*115*/ "Elec Perc1",
-/*116*/ "Elec Perc2",
-/*117*/ "Taiko ",
-/*118*/ "Taiko Rim ",
-/*119*/ "Cymbal ",
-/*120*/ "Castanets ",
-/*121*/ "Triangle ",
-/*122*/ "Orche Hit ",
-/*123*/ "Telephone ",
-/*124*/ "Bird Tweet",
-/*125*/ "OneNoteJam",
-/*126*/ "WaterBells",
-/*127*/ "JungleTune" };
+ /*000*/ "AcouPiano1",
+ /*001*/ "AcouPiano2",
+ /*002*/ "AcouPiano3",
+ /*003*/ "ElecPiano1",
+ /*004*/ "ElecPiano2",
+ /*005*/ "ElecPiano3",
+ /*006*/ "ElecPiano4",
+ /*007*/ "Honkytonk ",
+ /*008*/ "Elec Org 1",
+ /*009*/ "Elec Org 2",
+ /*010*/ "Elec Org 3",
+ /*011*/ "Elec Org 4",
+ /*012*/ "Pipe Org 1",
+ /*013*/ "Pipe Org 2",
+ /*014*/ "Pipe Org 3",
+ /*015*/ "Accordion ",
+ /*016*/ "Harpsi 1 ",
+ /*017*/ "Harpsi 2 ",
+ /*018*/ "Harpsi 3 ",
+ /*019*/ "Clavi 1 ",
+ /*020*/ "Clavi 2 ",
+ /*021*/ "Clavi 3 ",
+ /*022*/ "Celesta 1 ",
+ /*023*/ "Celesta 2 ",
+ /*024*/ "Syn Brass1",
+ /*025*/ "Syn Brass2",
+ /*026*/ "Syn Brass3",
+ /*027*/ "Syn Brass4",
+ /*028*/ "Syn Bass 1",
+ /*029*/ "Syn Bass 2",
+ /*030*/ "Syn Bass 3",
+ /*031*/ "Syn Bass 4",
+ /*032*/ "Fantasy ",
+ /*033*/ "Harmo Pan ",
+ /*034*/ "Chorale ",
+ /*035*/ "Glasses ",
+ /*036*/ "Soundtrack",
+ /*037*/ "Atmosphere",
+ /*038*/ "Warm Bell ",
+ /*039*/ "Funny Vox ",
+ /*040*/ "Echo Bell ",
+ /*041*/ "Ice Rain ",
+ /*042*/ "Oboe 2001 ",
+ /*043*/ "Echo Pan ",
+ /*044*/ "DoctorSolo",
+ /*045*/ "Schooldaze",
+ /*046*/ "BellSinger",
+ /*047*/ "SquareWave",
+ /*048*/ "Str Sect 1",
+ /*049*/ "Str Sect 2",
+ /*050*/ "Str Sect 3",
+ /*051*/ "Pizzicato ",
+ /*052*/ "Violin 1 ",
+ /*053*/ "Violin 2 ",
+ /*054*/ "Cello 1 ",
+ /*055*/ "Cello 2 ",
+ /*056*/ "Contrabass",
+ /*057*/ "Harp 1 ",
+ /*058*/ "Harp 2 ",
+ /*059*/ "Guitar 1 ",
+ /*060*/ "Guitar 2 ",
+ /*061*/ "Elec Gtr 1",
+ /*062*/ "Elec Gtr 2",
+ /*063*/ "Sitar ",
+ /*064*/ "Acou Bass1",
+ /*065*/ "Acou Bass2",
+ /*066*/ "Elec Bass1",
+ /*067*/ "Elec Bass2",
+ /*068*/ "Slap Bass1",
+ /*069*/ "Slap Bass2",
+ /*070*/ "Fretless 1",
+ /*071*/ "Fretless 2",
+ /*072*/ "Flute 1 ",
+ /*073*/ "Flute 2 ",
+ /*074*/ "Piccolo 1 ",
+ /*075*/ "Piccolo 2 ",
+ /*076*/ "Recorder ",
+ /*077*/ "Panpipes ",
+ /*078*/ "Sax 1 ",
+ /*079*/ "Sax 2 ",
+ /*080*/ "Sax 3 ",
+ /*081*/ "Sax 4 ",
+ /*082*/ "Clarinet 1",
+ /*083*/ "Clarinet 2",
+ /*084*/ "Oboe ",
+ /*085*/ "Engl Horn ",
+ /*086*/ "Bassoon ",
+ /*087*/ "Harmonica ",
+ /*088*/ "Trumpet 1 ",
+ /*089*/ "Trumpet 2 ",
+ /*090*/ "Trombone 1",
+ /*091*/ "Trombone 2",
+ /*092*/ "Fr Horn 1 ",
+ /*093*/ "Fr Horn 2 ",
+ /*094*/ "Tuba ",
+ /*095*/ "Brs Sect 1",
+ /*096*/ "Brs Sect 2",
+ /*097*/ "Vibe 1 ",
+ /*098*/ "Vibe 2 ",
+ /*099*/ "Syn Mallet",
+ /*100*/ "Wind Bell ",
+ /*101*/ "Glock ",
+ /*102*/ "Tube Bell ",
+ /*103*/ "Xylophone ",
+ /*104*/ "Marimba ",
+ /*105*/ "Koto ",
+ /*106*/ "Sho ",
+ /*107*/ "Shakuhachi",
+ /*108*/ "Whistle 1 ",
+ /*109*/ "Whistle 2 ",
+ /*110*/ "BottleBlow",
+ /*111*/ "BreathPipe",
+ /*112*/ "Timpani ",
+ /*113*/ "MelodicTom",
+ /*114*/ "Deep Snare",
+ /*115*/ "Elec Perc1",
+ /*116*/ "Elec Perc2",
+ /*117*/ "Taiko ",
+ /*118*/ "Taiko Rim ",
+ /*119*/ "Cymbal ",
+ /*120*/ "Castanets ",
+ /*121*/ "Triangle ",
+ /*122*/ "Orche Hit ",
+ /*123*/ "Telephone ",
+ /*124*/ "Bird Tweet",
+ /*125*/ "OneNoteJam",
+ /*126*/ "WaterBells",
+ /*127*/ "JungleTune"
+};
char *MT32_RhythmTimbre[30] = {
-/*00*/ "Acou BD ",
-/*01*/ "Acou SD ",
-/*02*/ "Acou HiTom",
-/*03*/ "AcouMidTom",
-/*04*/ "AcouLowTom",
-/*05*/ "Elec SD ",
-/*06*/ "Clsd HiHat",
-/*07*/ "OpenHiHat1",
@@ Diff output truncated at 100000 characters. @@
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list