Files
TeslaRel410/CODE/BT/MUNGA/AUDTIME.CPP
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

88 lines
2.8 KiB
C++

//===========================================================================//
// File: audtime.cpp //
// Project: MUNGA Brick: Audio Renderer //
// Contents: Interface declarations for AudioTim //
//---------------------------------------------------------------------------//
// Date Who Modification //
// -------- --- ---------------------------------------------------------- //
// 05/08/96 ECH Initial coding. //
//---------------------------------------------------------------------------//
// Copyright (C) 1994-1995, Virtual World Entertainment, Inc. //
// PROPRIETARY AND CONFIDENTIAL //
//===========================================================================//
#include <munga.hpp>
#pragma hdrstop
#if !defined(AUDIO_HPP)
#include <audio.hpp>
#endif
#if !defined(AUDTIME_HPP)
#include <audtime.hpp>
#endif
#if !defined(APP_HPP)
#include <app.hpp>
#endif
#if !defined(AUDREND_HPP)
#include <audrend.hpp>
#endif
//#############################################################################
//############################# AudioTime ###############################
//#############################################################################
const AudioTime
AudioTime::Null;
//
//#############################################################################
//#############################################################################
//
Logical
AudioTime::TestInstance() const
{
return True;
}
//
//#############################################################################
//#############################################################################
//
AudioTime
AudioTime::Now()
{
Check(application);
Check(application->GetAudioRenderer());
return AudioTime(application->GetAudioRenderer()->GetAudioFrameCount());
}
//
//#############################################################################
//#############################################################################
//
AudioFrameCount
AudioTime::Seconds_To_Frames(Scalar seconds) const
{
Check(application);
Check(application->GetAudioRenderer());
return
(seconds * application->GetAudioRenderer()->GetCalibrationRate() + 0.5f);
}
//
//#############################################################################
//#############################################################################
//
Scalar
AudioTime::Frames_To_Seconds(AudioFrameCount frames) const
{
Check(application);
Check(application->GetAudioRenderer());
return
((Scalar)frames / application->GetAudioRenderer()->GetCalibrationRate());
}