Files
TeslaRel410/CODE/RP/MUNGA/AUDLVL.HPP
T
CydandClaude Fable 5 fdd9ac9d97 Initial import: Tesla Release 4.10 (Tesla:BattleTech & Tesla:Red Planet)
Archival snapshot of the Virtual World Entertainment Tesla cockpit
software, 1994-1996: MUNGA engine and L4 pod layer source (Borland
C++ 5.0), BT/RP game code, and game content (models, audio, maps,
gauges, Division renderer data). Includes third-party libraries:
Division dVS/DPL graphics, HMI SOS audio, WATTCP networking.

Files are preserved byte-for-byte (.gitattributes disables all
line-ending conversion). README.md documents the layout, target
hardware, and toolchain.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 13:21:58 -05:00

271 lines
7.7 KiB
C++

//===========================================================================//
// File: audlvl.hpp //
// Project: MUNGA Brick: Audio manager //
// Contents: //
//---------------------------------------------------------------------------//
// Date Who Modification //
// -------- --- ---------------------------------------------------------- //
// 01/30/95 ECH Initial coding. //
//---------------------------------------------------------------------------//
// Copyright (C) 1994-1995, Virtual World Entertainment, Inc. //
// All Rights reserved worldwide //
// This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL //
//===========================================================================//
#if !defined(AUDLVL_HPP)
# define AUDLVL_HPP
# if !defined(STYLE_HPP)
# include <style.hpp>
# endif
# if !defined(AUDIO_HPP)
# include <audio.hpp>
# endif
//##########################################################################
//####################### AudioLevelOfDetail #########################
//##########################################################################
class AudioLevelOfDetail:
public Plug
{
public:
//
//-----------------------------------------------------------------------
// Construction, Destruction, Testing
//-----------------------------------------------------------------------
//
AudioLevelOfDetail(PlugStream *stream);
~AudioLevelOfDetail();
Logical
TestInstance() const;
//
//-----------------------------------------------------------------------
// BuildFromPage
//-----------------------------------------------------------------------
//
static void
BuildFromPage(
PlugStream *stream,
NameList *name_list,
ClassID class_ID,
ObjectID object_ID
);
//
//-----------------------------------------------------------------------
// Accessors
//-----------------------------------------------------------------------
//
AudioVoiceCount
GetVoiceCount()
{return voiceCount;}
AudioRenderType
GetAudioRenderType()
{return audioRenderType;}
AudioFrameCount
GetSuspendDelay()
{return suspendDelay;}
private:
//
//-----------------------------------------------------------------------
// Private data
//-----------------------------------------------------------------------
//
#if 0
//
//-----------------------------------------------------------------------
// Defines the radial variation of the amplitude of the audio source.
// This feature is implemented well in Crystal River Engineering's
// API. The radiation profile of an audio source is specified with
// an array of sound levels in decibels paired with angles off of
// the audio source orientation. For example, you can design a
// rocket sound that is louder when heard from directly behind then
// from the side.
//-----------------------------------------------------------------------
//
AudioRadiationProfile
amplitudeRadiationProfile;
#endif
#if 0
//
//-----------------------------------------------------------------------
// Defines the radial variation of the high frequency content of the
// audio source. This concept is analogous to
// SetAmplitudeRadiationProfile except applied to the high frequency
// content of the audio source. Again, this allows the audio source
// to vary with respect to the position and orientation of the audio
// source and head.
//-----------------------------------------------------------------------
//
AudioRadiationProfile
filterRadiationProfile;
#endif
//
//-----------------------------------------------------------------------
// Misc
//-----------------------------------------------------------------------
//
AudioVoiceCount
voiceCount;
AudioRenderType
audioRenderType;
AudioFrameCount
suspendDelay;
};
//##########################################################################
//########################## AudioResource ############################
//##########################################################################
class AudioResource:
public Node
{
public:
//
//-----------------------------------------------------------------------
// Construction, Destruction, Testing
//-----------------------------------------------------------------------
//
AudioResource(PlugStream *stream);
~AudioResource();
Logical
TestInstance() const;
//
//-----------------------------------------------------------------------
// BuildFromPage
//-----------------------------------------------------------------------
//
static void
BuildFromPage(
PlugStream *stream,
NameList *name_list,
ClassID class_ID,
ObjectID object_ID
);
//
//-----------------------------------------------------------------------
// SetDistance
//-----------------------------------------------------------------------
//
void
SetDistance(Scalar distance);
//
//-----------------------------------------------------------------------
// Accessors
//-----------------------------------------------------------------------
//
AudioVoiceCount
GetVoiceCount();
AudioRenderType
GetAudioRenderType();
AudioFrameCount
GetSuspendDelay();
protected:
//
//-----------------------------------------------------------------------
// Protected data
//-----------------------------------------------------------------------
//
AudioLevelOfDetail*
GetAudioLevelOfDetail();
private:
//
//-----------------------------------------------------------------------
// Private data
//-----------------------------------------------------------------------
//
AudioLevelOfDetail
*audioLevelOfDetail;
TableOf<AudioLevelOfDetail*, Scalar>
audioLevelOfDetailSocket;
};
//~~~~~~~~~~~~~~~~~~~~~~~~~~ AudioResource inlines ~~~~~~~~~~~~~~~~~~~~~~~~~
inline AudioLevelOfDetail*
AudioResource::GetAudioLevelOfDetail()
{
Check(this);
return audioLevelOfDetail;
}
inline AudioVoiceCount
AudioResource::GetVoiceCount()
{
Check(this);
Check(audioLevelOfDetail);
return audioLevelOfDetail->GetVoiceCount();
}
inline AudioRenderType
AudioResource::GetAudioRenderType()
{
Check(this);
Check(audioLevelOfDetail);
return audioLevelOfDetail->GetAudioRenderType();
}
inline AudioFrameCount
AudioResource::GetSuspendDelay()
{
Check(this);
Check(audioLevelOfDetail);
return audioLevelOfDetail->GetSuspendDelay();
}
//##########################################################################
//######################## AudioResourceIndex ########################
//##########################################################################
class AudioResourceIndex:
public Node
{
public:
AudioResourceIndex(PlugStream *stream);
~AudioResourceIndex();
Logical
TestInstance() const;
static void
BuildFromPage(
PlugStream *stream,
NameList *name_list,
ClassID class_ID,
ObjectID object_ID
);
void
AddAudioResource(
AudioResource *audio_resource,
Enumeration index
);
AudioResource*
GetAudioResource(Enumeration index);
CollectionSize
GetSize();
private:
TableOf<AudioResource*, Enumeration>
audioResourceSocket;
};
#endif