]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
"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 dd19c6907fa33837860eb09a144d9bdb4ab5d718..11fb8c326a991da7f51e052e97b0bcd1d0b581c4 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 18c500f77942324c0f74da24068882abffa2ff68..6c78a6768f8594d25fa9858d3fadbe6a6fed0ec6 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 e11c24563f5684ea674d2b19768a66b33f374dd8..a9440735893744c4e95f993c6ffecddceed91f67 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 b6a44bc1cef047d225b79aee80592c771a1e1382..4d463c2a23519883c8cad633e921b6249f166e1f 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