"soundlist" now tells you if a sound is streamed and whether it is mono or stereo
authormolivier <molivier@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 8 Apr 2004 12:59:34 +0000 (12:59 +0000)
committermolivier <molivier@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 8 Apr 2004 12:59:34 +0000 (12:59 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@4089 d7cf8633-e32d-0410-b094-e92efae38249

snd_dma.c
snd_ogg.c
snd_wav.c
sound.h

index dd19c69..11fb8c3 100644 (file)
--- a/snd_dma.c
+++ b/snd_dma.c
@@ -1087,7 +1087,13 @@ void S_SoundList(void)
                {
                        size = sfx->mempool->totalsize;
                        total += size;
-                       Con_Printf("%c(%2db) %7i : %s\n", sfx->loopstart >= 0 ? 'L' : ' ', sfx->format.width * 8, size, sfx->name);
+                       Con_Printf ("%c%c(%2db, %6s) %8i : %s\n",
+                                               (sfx->loopstart >= 0) ? 'L' : ' ',
+                                               (sfx->flags & SFXFLAG_STREAMED) ? 'S' : ' ',
+                                               sfx->format.width * 8,
+                                               (sfx->format.channels == 2) ? "stereo" : "mono",
+                                               size,
+                                               sfx->name);
                }
        }
        Con_Printf("Total resident: %i\n", total);
index 18c500f..6c78a67 100644 (file)
--- a/snd_ogg.c
+++ b/snd_ogg.c
@@ -555,6 +555,7 @@ qboolean OGG_LoadVorbisFile (const char *filename, sfx_t *s)
                s->format.width = 2;  // We always work with 16 bits samples
                s->format.channels = vi->channels;
                s->loopstart = -1;
+               s->flags |= SFXFLAG_STREAMED;
                s->total_length = (size_t)len / (vi->channels * 2) * (float)(shm->format.speed / vi->rate);
        }
        else
@@ -590,6 +591,7 @@ qboolean OGG_LoadVorbisFile (const char *filename, sfx_t *s)
                s->format.width = 2;  // We always work with 16 bits samples
                s->format.channels = vi->channels;
                s->loopstart = -1;
+               s->flags &= ~SFXFLAG_STREAMED;
 
                sb->length = ResampleSfx (buff, (size_t)done / (vi->channels * 2), &s->format, sb->data, s->name);
                s->format.speed = shm->format.speed;
index e11c245..a944073 100644 (file)
--- a/snd_wav.c
+++ b/snd_wav.c
@@ -290,6 +290,7 @@ qboolean S_LoadWavFile (const char *filename, sfx_t *s)
                s->loopstart = -1;
        else
                s->loopstart = (double)info.loopstart * (double)shm->format.speed / (double)s->format.speed;
+       s->flags &= ~SFXFLAG_STREAMED;
 
 #if BYTE_ORDER != LITTLE_ENDIAN
        // We must convert the WAV data from little endian
diff --git a/sound.h b/sound.h
index b6a44bc..4d463c2 100644 (file)
--- a/sound.h
+++ b/sound.h
@@ -43,6 +43,7 @@ typedef struct
 #define SFXFLAG_NONE                   0
 #define SFXFLAG_SILENTLYMISSING        (1 << 0) // if the sfx is missing and loaded with complain = false
 #define SFXFLAG_USED                   (1 << 1)
+#define SFXFLAG_STREAMED               (1 << 2) // informative only. You shouldn't need to know that
 
 typedef struct snd_fetcher_s snd_fetcher_t;
 typedef struct sfx_s