annotate VisualC/playsound.dsp @ 474:c66080364dff

Most decoders now report total sample play time, now. Technically, this breaks binary compatibility with the 1.0 branch, since it extends the Sound_Sample struct, but most (all?) programs are just passing pointers allocated by SDL_sound around, and might be okay. Source-level compatibility is not broken...yet! :) --ryan. -------- Original Message -------- Subject: SDL_sound patch: Finding total length of time of sound file. Date: Sun, 26 Jan 2003 09:31:17 -0800 (PST) Hi Ryan, I am working with Eric Wing and helping him modify SDL_sound. AS part of our efforts in improving and enhancing SDL_sound, we like to submit this patch. We modified the codecs to find the total time of a sound file. Below is the explanation of the patch. The patch is appended as an attachment to this email. * MOTIVATION: We needed the ability to get the total play time of a sample (And we noticed that we're not the only ones). Since SDL_sound blocks direct access to the specific decoders, there is no way for a user to know this information short of decoding the whole thing. Because of this, we believe this will be a useful addition, even though the accuracy may not be perfect (subject to each decoder) or the information may not always be available. * CONTRIBUTORS: Wesley Leong (modified the majority of the codecs and verified the results) Eric Wing (showed everyone how to do modify codec, modified mikmod) Wang Lam (modified a handful of codecs, researched into specs and int overflow) Ahilan Anantha (modified a few codecs and helped with integer math) * GENERAL ISSUES: We chose the value to be milliseconds as an Sint32. Milliseconds because that's what Sound_Seek takes as a parameter and -1 to allow for instances/codecs where the value could not be determined. We are not sure if this is the final convention you want, so we are willing to work with you on this. We also expect the total_time field to be set on open and never again modified by SDL_sound. Users may access it directly much like the sample buffer and buffer_size. We thought about recomputing the time on DecodeAll, but since users may seek or decode small chunks first, not all the data may be there. So this is better done by the user. This may be good information to document. Currently, all the main codecs are implemented except for QuickTime.
author Ryan C. Gordon <icculus@icculus.org>
date Sat, 08 May 2004 08:19:50 +0000
parents 72ccb2916418
children
rev   line source
438
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1 # Microsoft Developer Studio Project File - Name="playsound" - Package Owner=<4>
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2 # Microsoft Developer Studio Generated Build File, Format Version 6.00
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3 # ** DO NOT EDIT **
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
5 # TARGTYPE "Win32 (x86) Console Application" 0x0103
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
6
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
7 CFG=playsound - Win32 Debug
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
8 !MESSAGE This is not a valid makefile. To build this project using NMAKE,
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
9 !MESSAGE use the Export Makefile command and run
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
10 !MESSAGE
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
11 !MESSAGE NMAKE /f "playsound.mak".
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
12 !MESSAGE
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
13 !MESSAGE You can specify a configuration when running NMAKE
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
14 !MESSAGE by defining the macro CFG on the command line. For example:
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
15 !MESSAGE
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
16 !MESSAGE NMAKE /f "playsound.mak" CFG="playsound - Win32 Debug"
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
17 !MESSAGE
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
18 !MESSAGE Possible choices for configuration are:
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
19 !MESSAGE
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
20 !MESSAGE "playsound - Win32 Release" (based on "Win32 (x86) Console Application")
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
21 !MESSAGE "playsound - Win32 Debug" (based on "Win32 (x86) Console Application")
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
22 !MESSAGE
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
23
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
24 # Begin Project
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
25 # PROP AllowPerConfigDependencies 0
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
26 # PROP Scc_ProjName ""
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
27 # PROP Scc_LocalPath ""
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
28 CPP=cl.exe
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
29 RSC=rc.exe
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
30
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
31 !IF "$(CFG)" == "playsound - Win32 Release"
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
32
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
33 # PROP BASE Use_MFC 0
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
34 # PROP BASE Use_Debug_Libraries 0
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
35 # PROP BASE Output_Dir "playsound___Win32_Release"
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
36 # PROP BASE Intermediate_Dir "playsound___Win32_Release"
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
37 # PROP BASE Target_Dir ""
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
38 # PROP Use_MFC 0
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
39 # PROP Use_Debug_Libraries 0
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
40 # PROP Output_Dir "playsound___Win32_Release"
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
41 # PROP Intermediate_Dir "playsound___Win32_Release"
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
42 # PROP Ignore_Export_Lib 0
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
43 # PROP Target_Dir ""
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
44 # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
45 # ADD CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
46 # ADD BASE RSC /l 0x409 /d "NDEBUG"
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
47 # ADD RSC /l 0x409 /d "NDEBUG"
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
48 BSC32=bscmake.exe
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
49 # ADD BASE BSC32 /nologo
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
50 # ADD BSC32 /nologo
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
51 LINK32=link.exe
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
52 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
53 # ADD LINK32 sdl.lib sdlmain.lib win32lib\sdl_sound.lib /nologo /subsystem:console /machine:I386 /out:"win32bin/playsound.exe"
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
54
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
55 !ELSEIF "$(CFG)" == "playsound - Win32 Debug"
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
56
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
57 # PROP BASE Use_MFC 0
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
58 # PROP BASE Use_Debug_Libraries 1
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
59 # PROP BASE Output_Dir "playsound___Win32_Debug"
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
60 # PROP BASE Intermediate_Dir "playsound___Win32_Debug"
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
61 # PROP BASE Target_Dir ""
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
62 # PROP Use_MFC 0
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
63 # PROP Use_Debug_Libraries 1
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
64 # PROP Output_Dir "playsound___Win32_Debug"
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
65 # PROP Intermediate_Dir "playsound___Win32_Debug"
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
66 # PROP Ignore_Export_Lib 0
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
67 # PROP Target_Dir ""
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
68 # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
69 # ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
70 # ADD BASE RSC /l 0x409 /d "_DEBUG"
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
71 # ADD RSC /l 0x409 /d "_DEBUG"
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
72 BSC32=bscmake.exe
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
73 # ADD BASE BSC32 /nologo
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
74 # ADD BSC32 /nologo
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
75 LINK32=link.exe
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
76 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
77 # ADD LINK32 sdl.lib sdlmain.lib win32lib\sdl_sound_d.lib /nologo /subsystem:console /debug /machine:I386 /out:"win32bin/playsound_d.exe" /pdbtype:sept
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
78
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
79 !ENDIF
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
80
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
81 # Begin Target
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
82
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
83 # Name "playsound - Win32 Release"
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
84 # Name "playsound - Win32 Debug"
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
85 # Begin Group "Source Files"
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
86
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
87 # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
88 # Begin Source File
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
89
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
90 SOURCE=..\playsound\playsound.c
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
91 # End Source File
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
92 # End Group
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
93 # Begin Group "Header Files"
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
94
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
95 # PROP Default_Filter "h;hpp;hxx;hm;inl"
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
96 # End Group
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
97 # Begin Group "Resource Files"
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
98
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
99 # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
100 # End Group
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
101 # End Target
72ccb2916418 Initial add.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
102 # End Project