{\rtf1\ansi\ansicpg1252\uc1\deff0\stshfdbch0\stshfloch0\stshfhich0\stshfbi0\deflang1033\deflangfe1033{\fonttbl{\f0\froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f1\fswiss\fcharset0\fprq2{\*\panose 020b0604020202020204}Arial;} {\f37\froman\fcharset238\fprq2 Times New Roman CE;}{\f38\froman\fcharset204\fprq2 Times New Roman Cyr;}{\f40\froman\fcharset161\fprq2 Times New Roman Greek;}{\f41\froman\fcharset162\fprq2 Times New Roman Tur;} {\f42\froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\f43\froman\fcharset178\fprq2 Times New Roman (Arabic);}{\f44\froman\fcharset186\fprq2 Times New Roman Baltic;}{\f45\froman\fcharset163\fprq2 Times New Roman (Vietnamese);} {\f47\fswiss\fcharset238\fprq2 Arial CE;}{\f48\fswiss\fcharset204\fprq2 Arial Cyr;}{\f50\fswiss\fcharset161\fprq2 Arial Greek;}{\f51\fswiss\fcharset162\fprq2 Arial Tur;}{\f52\fswiss\fcharset177\fprq2 Arial (Hebrew);} {\f53\fswiss\fcharset178\fprq2 Arial (Arabic);}{\f54\fswiss\fcharset186\fprq2 Arial Baltic;}{\f55\fswiss\fcharset163\fprq2 Arial (Vietnamese);}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0; \red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128; \red192\green192\blue192;}{\stylesheet{\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \snext0 Normal;}{\*\cs10 \additive \ssemihidden Default Paragraph Font;}{\* \ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tscellwidthfts0\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs20\lang1024\langfe1024\cgrid\langnp1024\langfenp1024 \snext11 \ssemihidden Normal Table;}}{\*\rsidtbl \rsid928474\rsid1311826\rsid5056432\rsid5572268\rsid6828841\rsid8667063 \rsid8728605\rsid11619772\rsid12661939\rsid14093336}{\*\generator Microsoft Word 10.0.6775;}{\info{\author Stephen Baynham}{\operator GameWyze}{\creatim\yr2007\mo1\dy22\hr11\min18}{\revtim\yr2007\mo1\dy22\hr21\min18}{\version5}{\edmins130}{\nofpages2} {\nofwords901}{\nofchars5142}{\*\company GameWyze}{\nofcharsws6031}{\vern16391}}\widowctrl\ftnbj\aenddoc\noxlattoyen\expshrtn\noultrlspc\dntblnsbdb\nospaceforul\hyphcaps0\horzdoc\dghspace120\dgvspace120\dghorigin1701\dgvorigin1984\dghshow0\dgvshow3 \jcompress\viewkind4\viewscale100\nolnhtadjtbl\rsidroot8667063 \fet0\sectd \linex0\sectdefaultcl\sftnbj {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl3 \pndec\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta )}}{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}} {\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}\pard\plain \ql \li0\ri0\nowidctlpar\faauto\rin0\lin0\itap0 \fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\f1\fs20\insrsid11619772 BTL4 Has its own AudioRenderer (BTL4AudioRenderer) which just establishes a new AudioHead (BTL4AudioHead). \par \par MungaL4 has its own AudioRenderer (L4AudioRenderer) which implements the Initialize() function to load world sound info from a file.}{\f1\fs20\insrsid6828841 It also initializes the AudioHardware. Finally, it refers to L4 AudioResourceManager::PreloadResources.}{\f1\fs20\insrsid11619772 \par }{\f1\fs20\insrsid6828841 \par L4AudioRenderer also! Will create entity audio objects when it is notified of new interesting things. An audio representation of the object is obtained from entity::GetAudioRepresentation and used to create the necessary entity audio objects in L4AudioRe sourceManager::CreateEntityAudioObjects. L4AudioResourceManager::DestroyEntityAudioObjects is used to get rid of it when it\rquote s over. \par \par }{\f1\fs20\insrsid8728605 L4AudioRenderer::StartRequest(L4AudioSource) is called to start an audiosource rendering. It requests the necessary resources with RequestAudioResources. If they don\rquote t exist, it will put sustained audio sources in line to play later on when the resources are available. Otherwise, it will set necessary values and call L4AudioSource::StartImplementation(), which probably check s the type of the audio source and plays it accordingly. It also adds the source to the running socket and if it isn\rquote t mixed manually, adds it to the mix socket.}{\f1\fs20\insrsid11619772 \par }{\f1\fs20\insrsid928474 \par L4AudioRenderer::RequestAudioResources(source, channel_set_result) ensures that}{\f1\fs20\insrsid5572268 the source ought to be played (isn\rquote t clipped) and then sends a list of possible channels and number of channels the source will use. If not enough channels remain, then the list of desired channels is searched for playing audio that has lower importance than the requesting source. If room can be found, returns true, otherwise false.}{\f1\fs20\insrsid928474 \par }{\f1\fs20\insrsid8728605 \par L4AudioRenderer::StopRequest(L4AudioSource) checks if the source is suspended or dormant (or otherwise not running) and if so, removes it from the dormant plug (waiting list) and sets it to stop. For currently-playing sounds, AudioSourceStopMaintenance(source) is called. \par }{\f1\fs20\insrsid12661939 \par L4AudioRenderer::AudioSourceStopMaintenance}{\f1\fs20\insrsid928474 (source) calls source::StopImplementation(), releases channels, and removes the source from the mix & running sockets.}{\f1\fs20\insrsid12661939 \par }{\f1\fs20\insrsid928474 \par L4AudioRenderer::AudioSourceSuspendMaintenance(source) calls source::SuspendImplementation(), removes it from the sockets and adds it to the dormant socket. \par }{\f1\fs20\insrsid8728605 \par }{\f1\fs20\insrsid12661939 L4AudioRenderer::ExecuteImplementation() is the renderer-specific code that is called each frame. It extends AudioRenderer\rquote s implementation. It mixes stuff in the mix plug, plays stuff in the running plug, and processes stuff in the dormant plug to see if it should activate. \par }{\f1\fs20\insrsid5572268 \par }{\f1\fs20\insrsid12661939 CalculateMix(), RunningSourceCheckup(), and DormantSourceCheckup() perform these activities. \par }{\f1\fs20\insrsid1311826 \par }\pard \ql \li0\ri0\nowidctlpar\faauto\rin0\lin0\itap0\pararsid1311826 {\f1\fs20\insrsid1311826 AudioRenderer links its AudioHead when it is linked to a guy. In ExecuteImplementation (called each frame), AudioRenderer calls Execute() on its AudioHead. \par \par What does AudioRenderer::PostAudioRequestMessage do? \par }{\f1\fs20\insrsid5056432 \par AudioRenderer::ProcessAudioRequestMessage seems to do something with these requests. Just calls the Process() function on them if there\rquote s one on the stack. \par \par AudioRenderer::FlushAudioMessages(source) gets rid of any pending audio events for a particular source, only processing messages saying to stop the sound. \par \par AudioRenderer::StartEntityEffectImplementation starts a new sound on a portion of an entity? AudioEntity::Make is used. \par \par AudioEntity/AudioSource for implementing buffers & sources? \par AudioHead for implementing listener controls. \par }\pard \ql \li0\ri0\nowidctlpar\faauto\rin0\lin0\itap0 {\f1\fs20\insrsid1311826 \par }{\f1\fs20\insrsid8728605 \par }{\f1\fs20\insrsid8667063 Stuff is held in audio\\static.scp! This is read as a NotationFile \par \par AudioControlSequence seems to be the primary audio/midi file class. BuildFromPage is used to load the information. Actually, AudioControlSequence is descended from AudioComponent which seems to be a sort of generic audio class. I might be able to chang e the way it loads, stores, and plays its data and have that do most of the work. \par \par AudioControlSequence::BuildFromPage makes use of the CreateAudioControlEventStream class to parse midi files and DynamicMemoryStream objects to hold most information. \par \par What's a NameList, is it like a string/string dictionary? \par \par In BuildFromPage, we pull the midi_file value from the passed-in NameLIst, open up a file stream, and write it into a DynamicMemoryStream object. We also pull the tempo from the NameList. Then we run the file through the midi parser, getting a new DynamicMemoryStream out. \par \par The new DynamicMemoryStream has information on what are apparently called control events- presumably the whole what happens in this midi file info. We write that as well as a ton of other options into a PlugStream that got passed in as an argument. \par \par Actually, there are a ton of different audio object types, and all of their BuildFromPage things are called from AudioObjectStream::BuildFromPageImplementation. This seems to be called from a generic ObjectStream::ParseNotationFile(), which may be called fro ObjectStream::BuildFromNotationFile() and ObjectStream::ReadIncludedFiles(). ReadIncludedFiles() is run because a notation file may reference other notation files within it and cau se those to be read as well. \par \par BuildFromNotationFile is called from: \par \tab -L4AudioResourceManager::CreateStaticAudioStreamResource(ResourceFile) \par \tab -L4AudioResourceManager::CreateModelAudioStreamResource(ResourceFile, model_name, model_File, ResourceDirectorie) \par \tab -Registry::CreateStaticObjectStreamResource(NotationFile, ResourceFile) \par \par ApplicationTool::BuildResources calls each of these when necessary. CreateStaticAudioStreamResource may only be called once? \par \par \par \par Called from main of BTL4Tool/RPL4Tool. Where the fuck in the game app? \par \par In WinMain, we open a StreamableResourceFile (btl4.res in BT410). Also, we make a new BTL4Application object and send in the StreamableResourceFile. \par \par Passes to L4Application to Application. \par \par Saves resourcefile to Application::resourceFile. Retrievable with GetResourceFile(). Sent to Application::MakeMission() which is picked up by BTL4Application/RPL4Application and used to Create a new BTL4Mission/RPL4Mission. \par \par The mission constructors seem to have the relevant info within. \par }}