Virtual U.org
Get Personal Training on VU Today
    
Top shadow
 
 register/help
User Name:

Password:

Audio class Reference
Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

Audio Class Reference

Object for controlling MIDI Audio and Digitized Sound. More...

#include <Oaudio.h>

List of all members.

Public Methods

 Audio ()
 ~Audio ()
int init ()
void deinit ()
void yield ()
int play_mid (char *)
int play_wav (char *, DsVolume)
int play_wav (short resIdx, DsVolume)
int play_resided_wav (char *, DsVolume)
int get_free_wav_ch ()
int stop_wav (int)
int is_wav_playing (int)
int play_long_wav (char *, DsVolume)
void play_long_wav2 (char *, DsVolume)
int stop_long_wav (int)
int is_long_wav_playing (int)
void volume_long_wav (int ch, DsVolume)
int play_loop_wav (char *, int repeatOffset, DsVolume)
void stop_loop_wav (int ch)
void volume_loop_wav (int ch, DsVolume)
void fade_out_loop_wav (int ch, int fadeRate)
DsVolume get_loop_wav_volume (int ch)
int is_loop_wav_fading (int ch)
int play_cd (int, int retVolume)
void stop_mid ()
void stop_wav ()
void stop_cd ()
void stop_long_wav ()
int is_mid_playing ()
int is_wav_playing ()
int is_cd_playing ()
void toggle_mid (int)
void toggle_wav (int)
void toggle_cd (int)
void set_mid_volume (int)
void set_wav_volume (int)
void set_cd_volume (int)
DsVolume int_to_DsVolume (int)

Public Attributes

char init_flag
char mid_init_flag
char wav_init_flag
char cd_init_flag
char mid_flag
char wav_flag
char cd_flag
char * mid_buf
char * wav_buf
int mid_buf_size
int wav_buf_size
int last_played_lwave_ch
ResourceIdx mid_res
ResourceIdx wav_res


Detailed Description

Object for controlling MIDI Audio and Digitized Sound.

Definition at line 33 of file Oaudio.h.


Constructor & Destructor Documentation

Audio::Audio  
 

Definition at line 75 of file Oaudio.cpp.

References init_flag.

Audio::~Audio  
 

Definition at line 83 of file Oaudio.cpp.

References deinit().


Member Function Documentation

void Audio::deinit  
 

Definition at line 165 of file Oaudio.cpp.

References init_flag.

Referenced by ~Audio().

void Audio::fade_out_loop_wav int    ch,
int    fadeRate
 

<int> fadeRate, time for volume 100 wave drop to slience

Definition at line 1315 of file Oaudio.cpp.

References MAX_LOOP_WAV_CH.

int Audio::get_free_wav_ch  
 

Definition at line 790 of file Oaudio.cpp.

References MAX_WAV_CHANNEL, and NULL.

Referenced by SECtrl::flush().

DsVolume Audio::get_loop_wav_volume int    ch
 

Definition at line 1328 of file Oaudio.cpp.

References MAX_LOOP_WAV_CH.

int Audio::init  
 

Initialize the mid driver

return : <int> 1 - initialized successfully 0 - init fail

Definition at line 96 of file Oaudio.cpp.

References MAX_WAV_CHANNEL, and NULL.

DsVolume Audio::int_to_DsVolume int   
 

Definition at line 1917 of file Oaudio.cpp.

Referenced by WinMain().

int Audio::is_cd_playing  
 

Definition at line 1750 of file Oaudio.cpp.

int Audio::is_long_wav_playing int    serial
 

return wheather a short sound effect is stopped

<int> the serial no returned by play_wav or play_resided_wav

Definition at line 1094 of file Oaudio.cpp.

References MAX_LONG_WAV_CH, and NULL.

Referenced by volume_long_wav().

int Audio::is_loop_wav_fading int    ch
 

Definition at line 1346 of file Oaudio.cpp.

References MAX_LOOP_WAV_CH.

int Audio::is_mid_playing  
 

Definition at line 1706 of file Oaudio.cpp.

int Audio::is_wav_playing  
 

Definition at line 1719 of file Oaudio.cpp.

References MAX_WAV_CHANNEL, and NULL.

int Audio::is_wav_playing int    serial
 

return wheather a short sound effect is stopped

<int> the serial no returned by play_wav or play_resided_wav

Definition at line 840 of file Oaudio.cpp.

References MAX_WAV_CHANNEL, and NULL.

int Audio::play_cd int    trackId,
int    volume
 

<int> trackId - the id. of the CD track to play.

Definition at line 1653 of file Oaudio.cpp.

int Audio::play_long_wav char *    wavName,
DsVolume    dsVolume
 

Play digitized wav from the wav file suitable for very large wave file

<char*> wavName = name of the wave file

return : <int> 1 - wav loaded and is playing 0 - wav not played note : it uses streaming DirectSoundBuffer Audio::yield() keeps on feeding data to it

Definition at line 882 of file Oaudio.cpp.

References DsVolume::ds_pan, DsVolume::ds_vol, DSBCAPS_CTRLDEFAULT, err_now, File::file_open(), File::file_pos(), File::file_read(), File::file_seek(), LWAV_BANKS, LWAV_STREAM_BUFSIZ, MAX_LONG_WAV_CH, mem_resize, NULL, wav_buf, wav_buf_size, wav_flag, wav_init_flag, and WORD.

void Audio::play_long_wav2 char *   ,
DsVolume   
 

Definition at line 856 of file Oaudio.cpp.

int Audio::play_loop_wav char *    wavName,
int    repeatOffset,
DsVolume    dsVolume
 

Play digitized wav from the wav resource file

<char*> wavName = name of the wav in the resource file int repeatOffset = offset of wave data to play on repeat i.e. 0 to start of wave data

return : <int> channel number (1 - MAX_LOOP_WAV_CH) 0 not played

Definition at line 1145 of file Oaudio.cpp.

int Audio::play_mid char *    midName
 

Play a midi mid from the mid resource file

<char*> midName = name of the mid in the resource file

return : <int> 1 - mid loaded and is playing 0 - mid not played

Definition at line 319 of file Oaudio.cpp.

int Audio::play_resided_wav char *    wavBuf,
DsVolume    dsVolume
 

Play digitized wav from the wav file in memory

<char*> wavBuf = point to the wav in memory long vol = volume (0 to 100) long pan = pan (-10000 to 10000)

return : <int> 1 - wav loaded and is playing 0 - wav not played

Definition at line 688 of file Oaudio.cpp.

Referenced by SECtrl::flush(), and SECtrl::immediate_sound().

int Audio::play_wav short    resIdx,
DsVolume    dsVolume
 

Play digitized wav from the wav resource file

short resIdx = index of wave file in A_WAVE2.RES long vol = volume (0 to 100) long pan = pan (-10000 to 10000)

return : <int> 1 - wav loaded and is playing 0 - wav not played

Definition at line 540 of file Oaudio.cpp.

int Audio::play_wav char *    wavName,
DsVolume    dsVolume
 

Play digitized wav from the wav resource file

<char*> wavName = name of the wav in the resource file long vol = volume (0 to 100) long pan = pan (-10000 to 10000)

return : <int> non-zero - wav loaded and is playing, return a serial no. to be referred in stop_wav and is_wav_playing 0 - wav not played

Definition at line 375 of file Oaudio.cpp.

Referenced by SECtrl::flush(), SECtrl::immediate_sound(), and WinMain().

void Audio::set_cd_volume int   
 

Definition at line 1882 of file Oaudio.cpp.

References cd_init_flag.

void Audio::set_mid_volume int   
 

Definition at line 1810 of file Oaudio.cpp.

References mid_init_flag.

void Audio::set_wav_volume int   
 

Definition at line 1826 of file Oaudio.cpp.

References MAX_LONG_WAV_CH, MAX_LOOP_WAV_CH, MAX_WAV_CHANNEL, and wav_init_flag.

void Audio::stop_cd  
 

Definition at line 1693 of file Oaudio.cpp.

References NULL.

Referenced by toggle_cd().

void Audio::stop_long_wav  
 

Definition at line 1615 of file Oaudio.cpp.

References MAX_LONG_WAV_CH, and NULL.

int Audio::stop_long_wav int    serial
 

stop a short sound effect started by play_long_wav

<int> the serial no returned by play_long_wav

return 1 - channel is found and stopped / channel not found return 0 - cannot stop the channel

Definition at line 1071 of file Oaudio.cpp.

References MAX_LONG_WAV_CH, and NULL.

void Audio::stop_loop_wav int    ch
 

Definition at line 1633 of file Oaudio.cpp.

References MAX_LOOP_WAV_CH, and NULL.

void Audio::stop_mid  
 

Definition at line 353 of file Oaudio.cpp.

References NULL.

Referenced by toggle_mid().

void Audio::stop_wav  
 

Definition at line 1589 of file Oaudio.cpp.

References MAX_WAV_CHANNEL, and NULL.

Referenced by toggle_wav().

int Audio::stop_wav int    serial
 

stop a short sound effect started by play_wav or play_resided_wav

<int> the serial no returned by play_wav or play_resided_wav

return 1 - channel is found and stopped / channel not found return 0 - cannot stop the channel

Definition at line 819 of file Oaudio.cpp.

References MAX_WAV_CHANNEL, and NULL.

void Audio::toggle_cd int   
 

Definition at line 1795 of file Oaudio.cpp.

References cd_flag, and stop_cd().

void Audio::toggle_mid int   
 

Definition at line 1773 of file Oaudio.cpp.

References mid_flag, and stop_mid().

void Audio::toggle_wav int   
 

Definition at line 1784 of file Oaudio.cpp.

References stop_wav(), and wav_flag.

void Audio::volume_long_wav int    ch,
DsVolume   
 

Definition at line 1902 of file Oaudio.cpp.

References DsVolume::ds_vol, is_long_wav_playing(), MAX_LONG_WAV_CH, and NULL.

void Audio::volume_loop_wav int    ch,
DsVolume   
 

Definition at line 1296 of file Oaudio.cpp.

References DsVolume::ds_pan, DsVolume::ds_vol, and MAX_LOOP_WAV_CH.

void Audio::yield  
 

Definition at line 1357 of file Oaudio.cpp.

References err_here, err_now, File::file_pos(), File::file_read(), File::file_seek(), LOOPWAV_BANKS, LOOPWAV_STREAM_BUFSIZ, LWAV_BANKS, MAX_LONG_WAV_CH, MAX_LOOP_WAV_CH, and NULL.


Member Data Documentation

char Audio::cd_flag
 

Definition at line 43 of file Oaudio.h.

Referenced by toggle_cd().

char Audio::cd_init_flag
 

Definition at line 39 of file Oaudio.h.

Referenced by set_cd_volume().

char Audio::init_flag
 

Definition at line 35 of file Oaudio.h.

Referenced by Audio(), and deinit().

int Audio::last_played_lwave_ch
 

Definition at line 50 of file Oaudio.h.

char* Audio::mid_buf
 

Definition at line 45 of file Oaudio.h.

int Audio::mid_buf_size
 

Definition at line 48 of file Oaudio.h.

char Audio::mid_flag
 

Definition at line 41 of file Oaudio.h.

Referenced by toggle_mid().

char Audio::mid_init_flag
 

Definition at line 37 of file Oaudio.h.

Referenced by set_mid_volume().

ResourceIdx Audio::mid_res
 

Definition at line 52 of file Oaudio.h.

char* Audio::wav_buf
 

Definition at line 46 of file Oaudio.h.

Referenced by play_long_wav().

int Audio::wav_buf_size
 

Definition at line 49 of file Oaudio.h.

Referenced by play_long_wav().

char Audio::wav_flag
 

Definition at line 42 of file Oaudio.h.

Referenced by play_long_wav(), and toggle_wav().

char Audio::wav_init_flag
 

Definition at line 38 of file Oaudio.h.

Referenced by SECtrl::init(), play_long_wav(), and set_wav_volume().

ResourceIdx Audio::wav_res
 

Definition at line 53 of file Oaudio.h.


The documentation for this class was generated from the following files:
Generated on Fri Aug 23 01:39:00 2002 for VirtualU by doxygen1.2.17