| 1 | #cxx . . $ `<file>/src/pt2_audio.h`/pragma once |
| 2 | |
| 3 | #include <stdint.h> |
| 4 | #include <stdbool.h> |
| 5 | #include "pt2_replayer.h"cxx . . $ `<file>/src/pt2_replayer.h`/ |
| 6 | |
| 7 | // for the low-pass/high-pass filters in the SAMPLER screen |
| 8 | #define FILTERS_BASE_FREQcxx . . $ `src/pt2_audio.h:8:9`! (PAULA_PAL_CLKcxx . . $ `src/pt2_paula.h:14:9`! / 214.0) |
| 9 | |
| 10 | // too many bits makes little sense here |
| 11 | |
| 12 | #define BPM_FRAC_BITScxx . . $ `src/pt2_audio.h:12:9`! 52 |
| 13 | #define BPM_FRAC_SCALEcxx . . $ `src/pt2_audio.h:13:9`! (1ULL << BPM_FRAC_BITScxx . . $ `src/pt2_audio.h:12:9`!) |
| 14 | #define BPM_FRAC_MASKcxx . . $ `src/pt2_audio.h:14:9`! (BPM_FRAC_SCALEcxx . . $ `src/pt2_audio.h:13:9`!-1) |
| 15 | |
| 16 | #define TICK_TIME_FRAC_BITScxx . . $ `src/pt2_audio.h:16:9`! 52 |
| 17 | #define TICK_TIME_FRAC_SCALEcxx . . $ `src/pt2_audio.h:17:9`! (1ULL << TICK_TIME_FRAC_BITScxx . . $ `src/pt2_audio.h:16:9`!) |
| 18 | #define TICK_TIME_FRAC_MASKcxx . . $ `src/pt2_audio.h:18:9`! (TICK_TIME_FRAC_SCALEcxx . . $ `src/pt2_audio.h:17:9`!-1) |
| 19 | |
| 20 | typedef struct audio_tcxx . . $ audio_t# |
| 21 | { |
| 22 | volatile boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! lockedcxx . . $ audio_t#locked., isSamplingcxx . . $ audio_t#isSampling., callbackOngoingcxx . . $ audio_t#callbackOngoing.; |
| 23 | |
| 24 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! ledFilterEnabledcxx . . $ audio_t#ledFilterEnabled., oversamplingFlagcxx . . $ audio_t#oversamplingFlag.; |
| 25 | |
| 26 | uint32_tcxx . . $ uint32_t# amigaModelcxx . . $ audio_t#amigaModel., outputRatecxx . . $ audio_t#outputRate., audioBufferSizecxx . . $ audio_t#audioBufferSize.; |
| 27 | |
| 28 | int32_tcxx . . $ int32_t# tickSampleCountercxx . . $ audio_t#tickSampleCounter.; |
| 29 | uint32_tcxx . . $ uint32_t# samplesPerTickIntcxx . . $ audio_t#samplesPerTickInt., samplesPerTickIntTabcxx . . $ audio_t#samplesPerTickIntTab.[(MAX_BPMcxx . . $ `src/pt2_replayer.h:8:9`!-MIN_BPMcxx . . $ `src/pt2_replayer.h:7:9`!)+1]; |
| 30 | uint64_tcxx . . $ uint64_t# tickSampleCounterFraccxx . . $ audio_t#tickSampleCounterFrac., samplesPerTickFraccxx . . $ audio_t#samplesPerTickFrac., samplesPerTickFracTabcxx . . $ audio_t#samplesPerTickFracTab.[(MAX_BPMcxx . . $ `src/pt2_replayer.h:8:9`!-MIN_BPMcxx . . $ `src/pt2_replayer.h:7:9`!)+1]; |
| 31 | |
| 32 | // for audio sampling |
| 33 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! rescanAudioDevicesSupportedcxx . . $ audio_t#rescanAudioDevicesSupported.; |
| 34 | |
| 35 | // for audio/video syncing |
| 36 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! resetSyncTickTimeFlagcxx . . $ audio_t#resetSyncTickTimeFlag.; |
| 37 | uint32_tcxx . . $ uint32_t# tickTimeIntTabcxx . . $ audio_t#tickTimeIntTab.[(MAX_BPMcxx . . $ `src/pt2_replayer.h:8:9`!-MIN_BPMcxx . . $ `src/pt2_replayer.h:7:9`!)+1]; |
| 38 | uint64_tcxx . . $ uint64_t# tickTimeFracTabcxx . . $ audio_t#tickTimeFracTab.[(MAX_BPMcxx . . $ `src/pt2_replayer.h:8:9`!-MIN_BPMcxx . . $ `src/pt2_replayer.h:7:9`!)+1]; |
| 39 | } audio_tcxx . . $ audio_t#; |
| 40 | |
| 41 | void setAmigaFilterModelcxx . . $ setAmigaFilterModel(ac50b47256ae7414).(uint8_tcxx . . $ uint8_t# model); |
| 42 | void toggleAmigaFilterModelcxx . . $ toggleAmigaFilterModel(49f6e7a06ebc5aa8).(void); |
| 43 | void setLEDFiltercxx . . $ setLEDFilter(b45ddcbc8423892c).(boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! state); |
| 44 | void toggleLEDFiltercxx . . $ toggleLEDFilter(49f6e7a06ebc5aa8).(void); |
| 45 | |
| 46 | void updateReplayerTimingModecxx . . $ updateReplayerTimingMode(49f6e7a06ebc5aa8).(void); |
| 47 | void generateBpmTablecxx . . $ generateBpmTable(e7c9417f9c54f86f).(double dAudioFreq, boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! vblankTimingFlag); |
| 48 | uint16_tcxx . . $ uint16_t# get16BitPeakcxx . . $ get16BitPeak(5bbf7f3ea503fca5).(int16_tcxx . . $ int16_t# *sampleData, uint32_tcxx . . $ uint32_t# sampleLength); |
| 49 | uint32_tcxx . . $ uint32_t# get32BitPeakcxx . . $ get32BitPeak(7ca14e0a6faf8061).(int32_tcxx . . $ int32_t# *sampleData, uint32_tcxx . . $ uint32_t# sampleLength); |
| 50 | float getFloatPeakcxx . . $ getFloatPeak(5c3cfcb0fda3feba).(float *fSampleData, uint32_tcxx . . $ uint32_t# sampleLength); |
| 51 | double getDoublePeakcxx . . $ getDoublePeak(fe75d5ffdcd76c3).(double *dSampleData, uint32_tcxx . . $ uint32_t# sampleLength); |
| 52 | void normalize16BitTo8Bitcxx . . $ normalize16BitTo8Bit(e289b749b410839e).(int16_tcxx . . $ int16_t# *sampleData, uint32_tcxx . . $ uint32_t# sampleLength); |
| 53 | void normalize32BitTo8Bitcxx . . $ normalize32BitTo8Bit(4ccd4d0b8005c765).(int32_tcxx . . $ int32_t# *sampleData, uint32_tcxx . . $ uint32_t# sampleLength); |
| 54 | void normalizeFloatTo8Bitcxx . . $ normalizeFloatTo8Bit(ac1d28a1859f2825).(float *fSampleData, uint32_tcxx . . $ uint32_t# sampleLength); |
| 55 | void normalizeDoubleTo8Bitcxx . . $ normalizeDoubleTo8Bit(b832380d3925cf6).(double *dSampleData, uint32_tcxx . . $ uint32_t# sampleLength); |
| 56 | void toggleAmigaPanModecxx . . $ toggleAmigaPanMode(49f6e7a06ebc5aa8).(void); |
| 57 | void lockAudiocxx . . $ lockAudio(49f6e7a06ebc5aa8).(void); |
| 58 | void unlockAudiocxx . . $ unlockAudio(49f6e7a06ebc5aa8).(void); |
| 59 | void resetAudioDithercxx . . $ resetAudioDither(49f6e7a06ebc5aa8).(void); |
| 60 | void audioSetStereoSeparationcxx . . $ audioSetStereoSeparation(ac50b47256ae7414).(uint8_tcxx . . $ uint8_t# percentage); |
| 61 | void outputAudiocxx . . $ outputAudio(4683f455c3e046d4).(int16_tcxx . . $ int16_t# *target, int32_tcxx . . $ int32_t# numSamples); |
| 62 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! setupAudiocxx . . $ setupAudio(c9857a73d68e59ba).(void); |
| 63 | void audioClosecxx . . $ audioClose(49f6e7a06ebc5aa8).(void); |
| 64 | |
| 65 | extern audio_tcxx . . $ audio_t# audiocxx . . $ audio.; // pt2_audio.c |