#include <taptaudio_paimpl.h>
Inheritance diagram for AudioSystemImpl:


Definition at line 38 of file taptaudio_paimpl.h.
Public Types | |
| typedef std::map< std::string, ASSample * > | REGISTRY |
| Type for WAV file registry. | |
Public Member Functions | |
| AudioSystemImpl (unsigned inputChannels=1, unsigned outputChannels=2, double sampleRate=44100, AUDIO_FORMAT format=AF_Int16, int deviceIDin=0, int deviceIDout=0) | |
| Create an AudioSystemImpl. | |
| virtual int | callback (const void *inputBuffer, void *outputBuffer, unsigned long framesPerBuffer, Timestamp outTime) |
| Portaudio callback. | |
| bool | freeSample (ASSample *samp) |
| virtual ASSample ** | getSampleHolder (bool loop=false, float vol=1.0f, unsigned *trackno=0) |
| Get a holder (e.g. | |
| bool | isRecording () |
| ASSample * | loadRawSample (const std::string &name, void *data, unsigned long size) |
| virtual ASSample * | loadSample (const std::string &name) |
| Load a "known" sample, or a file. | |
| bool | loopSample (ASSample *samp, float vol=1.0f, unsigned *trackno=0) |
| bool | mixSample (ASSample *samp, bool record_after, double record_size, bool loop=false, float vol=1.0f, unsigned *trackno=0) |
| virtual unsigned | setVolume (ASSample *, float=1.0f, int=-1) |
| bool | startRec (double max_seconds) |
| void | stop () |
| ASSample * | stopRec (const std::string &name, bool save=false, bool save_in_thread=false) |
| virtual unsigned | stopSample (ASSample *samp, int trackno=-1, bool lock=true) |
| void | waitstop () |
| virtual | ~AudioSystemImpl () |
| Virtual destructor, free the portaudio handles and clear the registry (?). | |
Static Public Member Functions | |
| static void | listDevices () |
Static Public Attributes | |
| static SDL_mutex * | as_mutex = SDL_CreateMutex() |
| Audio System mutex. | |
| static SDL_mutex * | registry_mutex = SDL_CreateMutex() |
| Registry mutex. | |
Protected Types | |
| typedef PaTimestamp | Timestamp |
| The type used for time stamps in this version of portaudio. | |
Protected Member Functions | |
| virtual void | doPlay (void *outputBuffer, unsigned long framesPerBuffer, Timestamp outTime) |
| Perform the "play" portion of the callback. | |
| virtual void | doRecord (const void *inputBuffer, unsigned long framesPerBuffer) |
| Perform the "record" portion of the callback. | |
Protected Attributes | |
| ASSample * | cur_play |
| For non-tracked implementations, the currently playing sample. | |
| Recording * | cur_rec |
| The current recording (e.g. we are recording if this is non-null). | |
| bool | fakeMonoMic |
| Are we "faking" a Mono input stream by averaging stereo channels. | |
| AUDIO_FORMAT | fmt |
| The audio format. | |
| unsigned | iframe_size |
| The size (in bytes) of an input frame. | |
| unsigned | inChannels |
| Number of input channels. | |
| unsigned | oframe_size |
| The size (in bytes) of an output frame. | |
| unsigned | outChannels |
| Number of output channels. | |
| unsigned long | play_offset |
| The current offset into cur_play. | |
| Recording * | record_after_play |
| The recording we will start as soon as no samples are playing. | |
| REGISTRY | registry |
| The registy of loaded WAV files. | |
| double | sampRate |
| The sample rate of the audio stream. | |
| bool | stopping |
| Are we trying to stop the audio system. | |
| PortAudioStream * | stream |
| The portaudio strem handle. | |
|
|
Type for WAV file registry.
Definition at line 43 of file taptaudio_paimpl.h. |
|
|
The type used for time stamps in this version of portaudio.
Definition at line 50 of file taptaudio_paimpl.h. |
|
|
Virtual destructor, free the portaudio handles and clear the registry (?).
Definition at line 67 of file taptaudio_paimpl.cpp. |
|
||||||||||||||||||||||||||||
|
Create an AudioSystemImpl.
Definition at line 87 of file taptaudio_paimpl.cpp. References AF_Float32, AF_Int16, AF_Int24, AF_Int32, AF_Int8, AF_PackedInt24, AF_UInt8, DODEBUG, fakeMonoMic, fmt, iframe_size, inChannels, oframe_size, outChannels, sampRate, and stream. |
|
||||||||||||||||||||
|
Portaudio callback.
Definition at line 195 of file taptaudio_paimpl.cpp. References as_mutex, cur_rec, doPlay(), doRecord(), and stopping. Here is the call graph for this function: ![]() |
|
||||||||||||||||
|
Perform the "play" portion of the callback.
Definition at line 226 of file taptaudio_paimpl.cpp. References cur_play, cur_rec, ASSample::getBytes(), ASSample::getChannels(), PCMSample::mono2stereo(), ASSample::numBytes(), oframe_size, outChannels, play_offset, record_after_play, and ASSample::refs. Referenced by callback(). Here is the call graph for this function: ![]() |
|
||||||||||||
|
Perform the "record" portion of the callback.
Definition at line 212 of file taptaudio_paimpl.cpp. References cur_rec, fakeMonoMic, Recording::fill(), Recording::fillSilence(), iframe_size, and Recording::skipfill(). Referenced by callback(). Here is the call graph for this function: ![]() |
|
||||||||||||||||
|
Get a holder (e.g. a track reference) in which to load a sample. Reimplemented in AudioSystemMixer. Definition at line 351 of file taptaudio_paimpl.cpp. References cur_play, and play_offset. Referenced by mixSample(). |
|
|
Load a "known" sample, or a file.
Reimplemented in AudioSystemMixerT. Definition at line 266 of file taptaudio_paimpl.cpp. References DODEBUG, fmt, ASSample::getChannels(), ASSample::getFormat(), ASSample::getSamRate(), outChannels, registry, registry_mutex, and sampRate. Referenced by AudioSystem::loadSample(). Here is the call graph for this function: ![]() |
|
|
Audio System mutex.
Definition at line 12 of file taptaudio_paimpl.cpp. Referenced by AudioSystem::AudioSystem(), callback(), freeSample(), mixSample(), AudioSystemMixer::setVolume(), startRec(), stopRec(), AudioSystemMixer::stopSample(), and stopSample(). |
|
|
For non-tracked implementations, the currently playing sample.
Definition at line 68 of file taptaudio_paimpl.h. Referenced by doPlay(), getSampleHolder(), and stopSample(). |
|
|
The current recording (e.g. we are recording if this is non-null).
Definition at line 65 of file taptaudio_paimpl.h. Referenced by callback(), doPlay(), doRecord(), isRecording(), mixSample(), startRec(), and stopRec(). |
|
|
Are we "faking" a Mono input stream by averaging stereo channels.
Definition at line 56 of file taptaudio_paimpl.h. Referenced by AudioSystemImpl(), and doRecord(). |
|
|
The audio format.
Definition at line 60 of file taptaudio_paimpl.h. Referenced by AudioSystemImpl(), loadRawSample(), loadSample(), mixSample(), and startRec(). |
|
|
The size (in bytes) of an input frame.
Definition at line 62 of file taptaudio_paimpl.h. Referenced by AudioSystemImpl(), doRecord(), mixSample(), and startRec(). |
|
|
Number of input channels.
Definition at line 57 of file taptaudio_paimpl.h. Referenced by AudioSystemImpl(), mixSample(), and startRec(). |
|
|
The size (in bytes) of an output frame.
Definition at line 63 of file taptaudio_paimpl.h. Referenced by AudioSystemImpl(), and doPlay(). |
|
|
Number of output channels.
Definition at line 58 of file taptaudio_paimpl.h. Referenced by AudioSystemImpl(), doPlay(), loadRawSample(), AudioSystemMixerT::loadSample(), loadSample(), and mixSample(). |
|
|
The current offset into cur_play.
Definition at line 69 of file taptaudio_paimpl.h. Referenced by doPlay(), and getSampleHolder(). |
|
|
The recording we will start as soon as no samples are playing.
Definition at line 66 of file taptaudio_paimpl.h. Referenced by doPlay(), mixSample(), and startRec(). |
|
|
The registy of loaded WAV files.
Definition at line 47 of file taptaudio_paimpl.h. Referenced by freeSample(), loadRawSample(), AudioSystemMixerT::loadSample(), loadSample(), stopRec(), and ~AudioSystemImpl(). |
|
|
Registry mutex.
Definition at line 13 of file taptaudio_paimpl.cpp. Referenced by freeSample(), loadRawSample(), AudioSystemMixerT::loadSample(), loadSample(), and stopRec(). |
|
|
The sample rate of the audio stream.
Definition at line 59 of file taptaudio_paimpl.h. Referenced by AudioSystemImpl(), loadRawSample(), AudioSystemMixerT::loadSample(), loadSample(), mixSample(), and startRec(). |
|
|
Are we trying to stop the audio system.
Definition at line 55 of file taptaudio_paimpl.h. Referenced by callback(), and stop(). |
|
|
The portaudio strem handle.
Definition at line 49 of file taptaudio_paimpl.h. Referenced by AudioSystemImpl(), and ~AudioSystemImpl(). |
1.4.3