diff --git a/examples/engine_steamaudio.c b/examples/engine_steamaudio.c index ade30fa7..7fc2f886 100644 --- a/examples/engine_steamaudio.c +++ b/examples/engine_steamaudio.c @@ -183,7 +183,7 @@ MA_API ma_result ma_steamaudio_binaural_node_init(ma_node_graph* pNodeGraph, con channelsOut = 2; /* Always stereo output. */ baseConfig = ma_node_config_init(); - baseConfig.vtable = &g_ma_steamaudio_binaural_node_vtable; + baseConfig.pVTable = &g_ma_steamaudio_binaural_node_vtable; baseConfig.pInputChannels = &channelsIn; baseConfig.pOutputChannels = &channelsOut; result = ma_node_init(pNodeGraph, &baseConfig, pAllocationCallbacks, &pBinauralNode->baseNode); diff --git a/extras/decoders/libopus/miniaudio_libopus.c b/extras/decoders/libopus/miniaudio_libopus.c index 2ac23027..a231bf5c 100644 --- a/extras/decoders/libopus/miniaudio_libopus.c +++ b/extras/decoders/libopus/miniaudio_libopus.c @@ -123,7 +123,7 @@ static ma_result ma_libopus_init_internal(const ma_decoding_backend_config* pCon } dataSourceConfig = ma_data_source_config_init(); - dataSourceConfig.vtable = &ma_gDataSourceVTable_libopus; + dataSourceConfig.pVTable = &ma_gDataSourceVTable_libopus; result = ma_data_source_init(&dataSourceConfig, &pOpus->ds); if (result != MA_SUCCESS) { diff --git a/extras/nodes/ma_channel_combiner_node/ma_channel_combiner_node.c b/extras/nodes/ma_channel_combiner_node/ma_channel_combiner_node.c index 61128243..4b1bde55 100644 --- a/extras/nodes/ma_channel_combiner_node/ma_channel_combiner_node.c +++ b/extras/nodes/ma_channel_combiner_node/ma_channel_combiner_node.c @@ -61,7 +61,7 @@ MA_API ma_result ma_channel_combiner_node_init(ma_node_graph* pNodeGraph, const outputChannels[0] = pConfig->channels; baseConfig = pConfig->nodeConfig; - baseConfig.vtable = &g_ma_channel_combiner_node_vtable; + baseConfig.pVTable = &g_ma_channel_combiner_node_vtable; baseConfig.inputBusCount = pConfig->channels; /* The vtable has an unknown channel count, so must specify it here. */ baseConfig.pInputChannels = inputChannels; baseConfig.pOutputChannels = outputChannels; diff --git a/extras/nodes/ma_channel_separator_node/ma_channel_separator_node.c b/extras/nodes/ma_channel_separator_node/ma_channel_separator_node.c index 9c67c5e4..dcec1334 100644 --- a/extras/nodes/ma_channel_separator_node/ma_channel_separator_node.c +++ b/extras/nodes/ma_channel_separator_node/ma_channel_separator_node.c @@ -65,7 +65,7 @@ MA_API ma_result ma_channel_separator_node_init(ma_node_graph* pNodeGraph, const } baseConfig = pConfig->nodeConfig; - baseConfig.vtable = &g_ma_channel_separator_node_vtable; + baseConfig.pVTable = &g_ma_channel_separator_node_vtable; baseConfig.outputBusCount = pConfig->channels; /* The vtable has an unknown channel count, so must specify it here. */ baseConfig.pInputChannels = inputChannels; baseConfig.pOutputChannels = outputChannels; diff --git a/extras/nodes/ma_ltrim_node/ma_ltrim_node.c b/extras/nodes/ma_ltrim_node/ma_ltrim_node.c index 5698d95c..65da60c6 100644 --- a/extras/nodes/ma_ltrim_node/ma_ltrim_node.c +++ b/extras/nodes/ma_ltrim_node/ma_ltrim_node.c @@ -91,7 +91,7 @@ MA_API ma_result ma_ltrim_node_init(ma_node_graph* pNodeGraph, const ma_ltrim_no pTrimNode->foundStart = MA_FALSE; baseConfig = pConfig->nodeConfig; - baseConfig.vtable = &g_ma_ltrim_node_vtable; + baseConfig.pVTable = &g_ma_ltrim_node_vtable; baseConfig.pInputChannels = &pConfig->channels; baseConfig.pOutputChannels = &pConfig->channels; diff --git a/extras/nodes/ma_reverb_node/ma_reverb_node.c b/extras/nodes/ma_reverb_node/ma_reverb_node.c index f67b9f51..dfbb985a 100644 --- a/extras/nodes/ma_reverb_node/ma_reverb_node.c +++ b/extras/nodes/ma_reverb_node/ma_reverb_node.c @@ -63,7 +63,7 @@ MA_API ma_result ma_reverb_node_init(ma_node_graph* pNodeGraph, const ma_reverb_ } baseConfig = pConfig->nodeConfig; - baseConfig.vtable = &g_ma_reverb_node_vtable; + baseConfig.pVTable = &g_ma_reverb_node_vtable; baseConfig.pInputChannels = &pConfig->channels; baseConfig.pOutputChannels = &pConfig->channels; diff --git a/extras/nodes/ma_vocoder_node/ma_vocoder_node.c b/extras/nodes/ma_vocoder_node/ma_vocoder_node.c index 21c7268b..c45f2733 100644 --- a/extras/nodes/ma_vocoder_node/ma_vocoder_node.c +++ b/extras/nodes/ma_vocoder_node/ma_vocoder_node.c @@ -65,7 +65,7 @@ MA_API ma_result ma_vocoder_node_init(ma_node_graph* pNodeGraph, const ma_vocode outputChannels[0] = pConfig->channels; /* Output channels is always the same as the source/carrier. */ baseConfig = pConfig->nodeConfig; - baseConfig.vtable = &g_ma_vocoder_node_vtable; + baseConfig.pVTable = &g_ma_vocoder_node_vtable; baseConfig.pInputChannels = inputChannels; baseConfig.pOutputChannels = outputChannels; diff --git a/miniaudio.h b/miniaudio.h index 1912d083..0cdac108 100644 --- a/miniaudio.h +++ b/miniaudio.h @@ -992,7 +992,7 @@ base object (`ma_data_source_base`): ma_data_source_config baseConfig; baseConfig = ma_data_source_config_init(); - baseConfig.vtable = &g_my_data_source_vtable; + baseConfig.pVTable = &g_my_data_source_vtable; result = ma_data_source_init(&baseConfig, &pMyDataSource->base); if (result != MA_SUCCESS) { @@ -2195,7 +2195,7 @@ pointer to the processing function and the number of input and output buses. Exa outputChannels[0] = channelsOut; ma_node_config nodeConfig = ma_node_config_init(); - nodeConfig.vtable = &my_custom_node_vtable; + nodeConfig.pVTable = &my_custom_node_vtable; nodeConfig.pInputChannels = inputChannels; nodeConfig.pOutputChannels = outputChannels; @@ -2224,7 +2224,7 @@ to `MA_NODE_BUS_COUNT_UNKNOWN`. In this case, the bus count should be set in the ... ma_node_config nodeConfig = ma_node_config_init(); - nodeConfig.vtable = &my_custom_node_vtable; + nodeConfig.pVTable = &my_custom_node_vtable; nodeConfig.inputBusCount = myBusCount; // <-- Since the vtable specifies MA_NODE_BUS_COUNT_UNKNOWN, the input bus count should be set here. nodeConfig.pInputChannels = inputChannels; // <-- Make sure there are nodeConfig.inputBusCount elements in this array. nodeConfig.pOutputChannels = outputChannels; // <-- The vtable specifies 1 output bus, so there must be 1 element in this array. @@ -2365,7 +2365,7 @@ for specialized nodes: ``` When using a specialized node like `ma_data_source_node` or `ma_splitter_node`, be sure to not -modify the `vtable` member of the `nodeConfig` object. +modify the `pVTable` member of the `nodeConfig` object. 7.1. Timing @@ -6081,7 +6081,7 @@ typedef ma_data_source* (* ma_data_source_get_next_proc)(ma_data_source* pDataSo typedef struct { - const ma_data_source_vtable* vtable; + const ma_data_source_vtable* pVTable; } ma_data_source_config; MA_API ma_data_source_config ma_data_source_config_init(void); @@ -6089,7 +6089,7 @@ MA_API ma_data_source_config ma_data_source_config_init(void); typedef struct { - const ma_data_source_vtable* vtable; + const ma_data_source_vtable* pVTable; ma_uint64 rangeBegInFrames; ma_uint64 rangeEndInFrames; /* Set to -1 for unranged (default). */ ma_uint64 loopBegInFrames; /* Relative to rangeBegInFrames. */ @@ -10759,7 +10759,7 @@ typedef struct typedef struct { - const ma_node_vtable* vtable; /* Should never be null. Initialization of the node will fail if so. */ + const ma_node_vtable* pVTable; /* Should never be null. Initialization of the node will fail if so. */ ma_node_state initialState; /* Defaults to ma_node_state_started. */ ma_uint32 inputBusCount; /* Only used if the vtable specifies an input bus count of `MA_NODE_BUS_COUNT_UNKNOWN`, otherwise must be set to `MA_NODE_BUS_COUNT_UNKNOWN` (default). */ ma_uint32 outputBusCount; /* Only used if the vtable specifies an output bus count of `MA_NODE_BUS_COUNT_UNKNOWN`, otherwise be set to `MA_NODE_BUS_COUNT_UNKNOWN` (default). */ @@ -10816,7 +10816,7 @@ struct ma_node_base { /* These variables are set once at startup. */ ma_node_graph* pNodeGraph; /* The graph this node belongs to. */ - const ma_node_vtable* vtable; + const ma_node_vtable* pVTable; ma_uint32 inputBusCount; ma_uint32 outputBusCount; ma_node_input_bus* pInputBuses; @@ -63743,7 +63743,7 @@ MA_API ma_result ma_audio_ring_buffer_init_ex(ma_format format, ma_uint32 channe /* Initialize the data source. */ dataSourceConfig = ma_data_source_config_init(); - dataSourceConfig.vtable = &ma_gDataSourceVTable_AudioRingBuffer; + dataSourceConfig.pVTable = &ma_gDataSourceVTable_AudioRingBuffer; result = ma_data_source_init(&dataSourceConfig, &pRingBuffer->ds); if (result != MA_SUCCESS) { @@ -64185,11 +64185,11 @@ MA_API ma_result ma_data_source_init(const ma_data_source_config* pConfig, ma_da return MA_INVALID_ARGS; } - if (pConfig->vtable == NULL) { + if (pConfig->pVTable == NULL) { return MA_INVALID_ARGS; } - pDataSourceBase->vtable = pConfig->vtable; + pDataSourceBase->pVTable = pConfig->pVTable; pDataSourceBase->rangeBegInFrames = MA_DATA_SOURCE_DEFAULT_RANGE_BEG; pDataSourceBase->rangeEndInFrames = MA_DATA_SOURCE_DEFAULT_RANGE_END; pDataSourceBase->loopBegInFrames = MA_DATA_SOURCE_DEFAULT_LOOP_POINT_BEG; @@ -64243,13 +64243,13 @@ static ma_result ma_data_source_read_pcm_frames_from_backend(ma_data_source* pDa { ma_data_source_base* pDataSourceBase = (ma_data_source_base*)pDataSource; - MA_ASSERT(pDataSourceBase != NULL); - MA_ASSERT(pDataSourceBase->vtable != NULL); - MA_ASSERT(pDataSourceBase->vtable->onRead != NULL); + MA_ASSERT(pDataSourceBase != NULL); + MA_ASSERT(pDataSourceBase->pVTable != NULL); + MA_ASSERT(pDataSourceBase->pVTable->onRead != NULL); MA_ASSERT(pFramesRead != NULL); if (pFramesOut != NULL) { - return pDataSourceBase->vtable->onRead(pDataSourceBase, pFramesOut, frameCount, pFramesRead); + return pDataSourceBase->pVTable->onRead(pDataSourceBase, pFramesOut, frameCount, pFramesRead); } else { /* No output buffer. Probably seeking forward. Read and discard. Can probably optimize this in terms of @@ -64277,7 +64277,7 @@ static ma_result ma_data_source_read_pcm_frames_from_backend(ma_data_source* pDa framesToRead = discardBufferCapInFrames; } - result = pDataSourceBase->vtable->onRead(pDataSourceBase, pDiscardBuffer, framesToRead, &framesReadThisIteration); + result = pDataSourceBase->pVTable->onRead(pDataSourceBase, pDiscardBuffer, framesToRead, &framesReadThisIteration); if (result != MA_SUCCESS) { return result; } @@ -64306,9 +64306,9 @@ static ma_result ma_data_source_read_pcm_frames_within_range(ma_data_source* pDa return MA_INVALID_ARGS; } - MA_ASSERT(pDataSourceBase->vtable != NULL); + MA_ASSERT(pDataSourceBase->pVTable != NULL); - if ((pDataSourceBase->vtable->flags & MA_DATA_SOURCE_SELF_MANAGED_RANGE_AND_LOOP_POINT) != 0 || (pDataSourceBase->rangeEndInFrames == ~((ma_uint64)0) && (pDataSourceBase->loopEndInFrames == ~((ma_uint64)0) || loop == MA_FALSE))) { + if ((pDataSourceBase->pVTable->flags & MA_DATA_SOURCE_SELF_MANAGED_RANGE_AND_LOOP_POINT) != 0 || (pDataSourceBase->rangeEndInFrames == ~((ma_uint64)0) && (pDataSourceBase->loopEndInFrames == ~((ma_uint64)0) || loop == MA_FALSE))) { /* Either the data source is self-managing the range, or no range is set - just read like normal. The data source itself will tell us when the end is reached. */ result = ma_data_source_read_pcm_frames_from_backend(pDataSource, pFramesOut, frameCount, &framesRead); } else { @@ -64523,7 +64523,7 @@ MA_API ma_result ma_data_source_seek_to_pcm_frame(ma_data_source* pDataSource, m return MA_INVALID_ARGS; } - if (pDataSourceBase->vtable->onSeek == NULL) { + if (pDataSourceBase->pVTable->onSeek == NULL) { return MA_NOT_IMPLEMENTED; } @@ -64531,9 +64531,9 @@ MA_API ma_result ma_data_source_seek_to_pcm_frame(ma_data_source* pDataSource, m return MA_INVALID_OPERATION; /* Trying to seek too far forward. */ } - MA_ASSERT(pDataSourceBase->vtable != NULL); + MA_ASSERT(pDataSourceBase->pVTable != NULL); - return pDataSourceBase->vtable->onSeek(pDataSource, pDataSourceBase->rangeBegInFrames + frameIndex); + return pDataSourceBase->pVTable->onSeek(pDataSource, pDataSourceBase->rangeBegInFrames + frameIndex); } MA_API ma_result ma_data_source_seek_seconds(ma_data_source* pDataSource, float secondCount, float* pSecondsSeeked) @@ -64609,13 +64609,13 @@ MA_API ma_result ma_data_source_get_data_format(ma_data_source* pDataSource, ma_ return MA_INVALID_ARGS; } - MA_ASSERT(pDataSourceBase->vtable != NULL); + MA_ASSERT(pDataSourceBase->pVTable != NULL); - if (pDataSourceBase->vtable->onGetDataFormat == NULL) { + if (pDataSourceBase->pVTable->onGetDataFormat == NULL) { return MA_NOT_IMPLEMENTED; } - result = pDataSourceBase->vtable->onGetDataFormat(pDataSource, &format, &channels, &sampleRate, pChannelMap, channelMapCap); + result = pDataSourceBase->pVTable->onGetDataFormat(pDataSource, &format, &channels, &sampleRate, pChannelMap, channelMapCap); if (result != MA_SUCCESS) { return result; } @@ -64651,13 +64651,13 @@ MA_API ma_result ma_data_source_get_cursor_in_pcm_frames(ma_data_source* pDataSo return MA_SUCCESS; } - MA_ASSERT(pDataSourceBase->vtable != NULL); + MA_ASSERT(pDataSourceBase->pVTable != NULL); - if (pDataSourceBase->vtable->onGetCursor == NULL) { + if (pDataSourceBase->pVTable->onGetCursor == NULL) { return MA_NOT_IMPLEMENTED; } - result = pDataSourceBase->vtable->onGetCursor(pDataSourceBase, &cursor); + result = pDataSourceBase->pVTable->onGetCursor(pDataSourceBase, &cursor); if (result != MA_SUCCESS) { return result; } @@ -64686,7 +64686,7 @@ MA_API ma_result ma_data_source_get_length_in_pcm_frames(ma_data_source* pDataSo return MA_INVALID_ARGS; } - MA_ASSERT(pDataSourceBase->vtable != NULL); + MA_ASSERT(pDataSourceBase->pVTable != NULL); /* If we have a range defined we'll use that to determine the length. This is one of rare times @@ -64702,11 +64702,11 @@ MA_API ma_result ma_data_source_get_length_in_pcm_frames(ma_data_source* pDataSo Getting here means a range is not defined so we'll need to get the data source itself to tell us the length. */ - if (pDataSourceBase->vtable->onGetLength == NULL) { + if (pDataSourceBase->pVTable->onGetLength == NULL) { return MA_NOT_IMPLEMENTED; } - return pDataSourceBase->vtable->onGetLength(pDataSource, pLength); + return pDataSourceBase->pVTable->onGetLength(pDataSource, pLength); } MA_API ma_result ma_data_source_get_cursor_in_seconds(ma_data_source* pDataSource, float* pCursor) @@ -64785,14 +64785,14 @@ MA_API ma_result ma_data_source_set_looping(ma_data_source* pDataSource, ma_bool ma_atomic_exchange_32(&pDataSourceBase->isLooping, isLooping); - MA_ASSERT(pDataSourceBase->vtable != NULL); + MA_ASSERT(pDataSourceBase->pVTable != NULL); /* If there's no callback for this just treat it as a successful no-op. */ - if (pDataSourceBase->vtable->onSetLooping == NULL) { + if (pDataSourceBase->pVTable->onSetLooping == NULL) { return MA_SUCCESS; } - return pDataSourceBase->vtable->onSetLooping(pDataSource, isLooping); + return pDataSourceBase->pVTable->onSetLooping(pDataSource, isLooping); } MA_API ma_bool32 ma_data_source_is_looping(const ma_data_source* pDataSource) @@ -65084,7 +65084,7 @@ MA_API ma_result ma_audio_buffer_ref_init(ma_format format, ma_uint32 channels, MA_ZERO_OBJECT(pAudioBufferRef); dataSourceConfig = ma_data_source_config_init(); - dataSourceConfig.vtable = &ma_gDataSourceVTable_AudioBufferRef; + dataSourceConfig.pVTable = &ma_gDataSourceVTable_AudioBufferRef; result = ma_data_source_init(&dataSourceConfig, &pAudioBufferRef->ds); if (result != MA_SUCCESS) { @@ -65773,7 +65773,7 @@ MA_API ma_result ma_paged_audio_buffer_init(const ma_paged_audio_buffer_config* } dataSourceConfig = ma_data_source_config_init(); - dataSourceConfig.vtable = &ma_gDataSourceVTable_PagedAudioBuffer; + dataSourceConfig.pVTable = &ma_gDataSourceVTable_PagedAudioBuffer; result = ma_data_source_init(&dataSourceConfig, &pPagedAudioBuffer->ds); if (result != MA_SUCCESS) { @@ -65989,7 +65989,7 @@ MA_API ma_result ma_audio_queue_init(const ma_audio_queue_config* pConfig, ma_au /* Initialize the data source first. */ dataSourceConfig = ma_data_source_config_init(); - dataSourceConfig.vtable = &ma_gDataSourceVTable_AudioQueue; + dataSourceConfig.pVTable = &ma_gDataSourceVTable_AudioQueue; result = ma_data_source_init(&dataSourceConfig, &pAudioQueue->ds); if (result != MA_SUCCESS) { @@ -68278,7 +68278,7 @@ static ma_result ma_wav_init_internal(const ma_decoding_backend_config* pConfig, } dataSourceConfig = ma_data_source_config_init(); - dataSourceConfig.vtable = &ma_gDataSourceVTable_WAV; + dataSourceConfig.pVTable = &ma_gDataSourceVTable_WAV; result = ma_data_source_init(&dataSourceConfig, &pWav->ds); if (result != MA_SUCCESS) { @@ -68982,7 +68982,7 @@ static ma_result ma_flac_init_internal(const ma_decoding_backend_config* pConfig } dataSourceConfig = ma_data_source_config_init(); - dataSourceConfig.vtable = &ma_gDataSourceVTable_FLAC; + dataSourceConfig.pVTable = &ma_gDataSourceVTable_FLAC; result = ma_data_source_init(&dataSourceConfig, &pFlac->ds); if (result != MA_SUCCESS) { @@ -69623,7 +69623,7 @@ static ma_result ma_mp3_init_internal(const ma_decoding_backend_config* pConfig, } dataSourceConfig = ma_data_source_config_init(); - dataSourceConfig.vtable = &ma_gDataSourceVTable_MP3; + dataSourceConfig.pVTable = &ma_gDataSourceVTable_MP3; result = ma_data_source_init(&dataSourceConfig, &pMP3->ds); if (result != MA_SUCCESS) { @@ -70277,7 +70277,7 @@ static ma_result ma_stbvorbis_init_internal(const ma_decoding_backend_config* pC pVorbis->format = ma_format_f32; /* Only supporting f32. */ dataSourceConfig = ma_data_source_config_init(); - dataSourceConfig.vtable = &ma_gDataSourceVTable_stbvorbis; + dataSourceConfig.pVTable = &ma_gDataSourceVTable_stbvorbis; result = ma_data_source_init(&dataSourceConfig, &pVorbis->ds); if (result != MA_SUCCESS) { @@ -71606,7 +71606,7 @@ static ma_result ma_decoder__preinit(ma_decoder_read_proc onRead, ma_decoder_see MA_ZERO_OBJECT(pDecoder); dataSourceConfig = ma_data_source_config_init(); - dataSourceConfig.vtable = &ma_gDataSourceVTable_Decoder; + dataSourceConfig.pVTable = &ma_gDataSourceVTable_Decoder; result = ma_data_source_init(&dataSourceConfig, &pDecoder->ds); if (result != MA_SUCCESS) { @@ -73088,7 +73088,7 @@ MA_API ma_result ma_waveform_init(const ma_waveform_config* pConfig, ma_waveform MA_ZERO_OBJECT(pWaveform); dataSourceConfig = ma_data_source_config_init(); - dataSourceConfig.vtable = &ma_gDataSourceVTable_Waveform; + dataSourceConfig.pVTable = &ma_gDataSourceVTable_Waveform; result = ma_data_source_init(&dataSourceConfig, &pWaveform->ds); if (result != MA_SUCCESS) { @@ -73743,7 +73743,7 @@ MA_API ma_result ma_noise_init_preallocated(const ma_noise_config* pConfig, void MA_ZERO_MEMORY(pNoise->_pHeap, heapLayout.sizeInBytes); dataSourceConfig = ma_data_source_config_init(); - dataSourceConfig.vtable = &ma_gDataSourceVTable_Noise; + dataSourceConfig.pVTable = &ma_gDataSourceVTable_Noise; result = ma_data_source_init(&dataSourceConfig, &pNoise->ds); if (result != MA_SUCCESS) { @@ -76028,7 +76028,7 @@ static ma_result ma_resource_manager_data_buffer_init_ex_internal(ma_resource_ma } dataSourceConfig = ma_data_source_config_init(); - dataSourceConfig.vtable = &ma_gDataSourceVTable_ResourceManagerDataBuffer; + dataSourceConfig.pVTable = &ma_gDataSourceVTable_ResourceManagerDataBuffer; result = ma_data_source_init(&dataSourceConfig, &pDataBuffer->ds); if (result != MA_SUCCESS) { @@ -76746,7 +76746,7 @@ MA_API ma_result ma_resource_manager_data_stream_init_ex(ma_resource_manager* pR } dataSourceConfig = ma_data_source_config_init(); - dataSourceConfig.vtable = &ma_gDataSourceVTable_ResourceManagerDataStream; + dataSourceConfig.pVTable = &ma_gDataSourceVTable_ResourceManagerDataStream; result = ma_data_source_init(&dataSourceConfig, &pDataStream->ds); if (result != MA_SUCCESS) { @@ -78518,7 +78518,7 @@ MA_API ma_result ma_node_graph_init(const ma_node_graph_config* pConfig, const m /* Data source. */ dataSourceConfig = ma_data_source_config_init(); - dataSourceConfig.vtable = &ma_gDataSourceVTable_NodeGraph; + dataSourceConfig.pVTable = &ma_gDataSourceVTable_NodeGraph; result = ma_data_source_init(&dataSourceConfig, &pNodeGraph->ds); if (result != MA_SUCCESS) { @@ -78528,7 +78528,7 @@ MA_API ma_result ma_node_graph_init(const ma_node_graph_config* pConfig, const m /* Endpoint. */ endpointConfig = ma_node_config_init(); - endpointConfig.vtable = &g_node_graph_endpoint_vtable; + endpointConfig.pVTable = &g_node_graph_endpoint_vtable; endpointConfig.pInputChannels = &pConfig->channels; endpointConfig.pOutputChannels = &pConfig->channels; @@ -79126,9 +79126,9 @@ static ma_result ma_node_input_bus_read_pcm_frames(ma_node* pInputNode, ma_node_ ma_bool32 isSilentOutput = MA_FALSE; MA_ASSERT(pOutputBus->pNode != NULL); - MA_ASSERT(((ma_node_base*)pOutputBus->pNode)->vtable != NULL); + MA_ASSERT(((ma_node_base*)pOutputBus->pNode)->pVTable != NULL); - isSilentOutput = (((ma_node_base*)pOutputBus->pNode)->vtable->flags & MA_NODE_FLAG_SILENT_OUTPUT) != 0; + isSilentOutput = (((ma_node_base*)pOutputBus->pNode)->pVTable->flags & MA_NODE_FLAG_SILENT_OUTPUT) != 0; if (pFramesOut != NULL) { /* Read. */ @@ -79308,22 +79308,22 @@ static ma_result ma_node_translate_bus_counts(const ma_node_config* pConfig, ma_ MA_ASSERT(pOutputBusCount != NULL); /* Bus counts are determined by the vtable, unless they're set to `MA_NODE_BUS_COUNT_UNKNWON`, in which case they're taken from the config. */ - if (pConfig->vtable->inputBusCount == MA_NODE_BUS_COUNT_UNKNOWN) { + if (pConfig->pVTable->inputBusCount == MA_NODE_BUS_COUNT_UNKNOWN) { inputBusCount = pConfig->inputBusCount; } else { - inputBusCount = pConfig->vtable->inputBusCount; + inputBusCount = pConfig->pVTable->inputBusCount; - if (pConfig->inputBusCount != MA_NODE_BUS_COUNT_UNKNOWN && pConfig->inputBusCount != pConfig->vtable->inputBusCount) { + if (pConfig->inputBusCount != MA_NODE_BUS_COUNT_UNKNOWN && pConfig->inputBusCount != pConfig->pVTable->inputBusCount) { return MA_INVALID_ARGS; /* Invalid configuration. You must not specify a conflicting bus count between the node's config and the vtable. */ } } - if (pConfig->vtable->outputBusCount == MA_NODE_BUS_COUNT_UNKNOWN) { + if (pConfig->pVTable->outputBusCount == MA_NODE_BUS_COUNT_UNKNOWN) { outputBusCount = pConfig->outputBusCount; } else { - outputBusCount = pConfig->vtable->outputBusCount; + outputBusCount = pConfig->pVTable->outputBusCount; - if (pConfig->outputBusCount != MA_NODE_BUS_COUNT_UNKNOWN && pConfig->outputBusCount != pConfig->vtable->outputBusCount) { + if (pConfig->outputBusCount != MA_NODE_BUS_COUNT_UNKNOWN && pConfig->outputBusCount != pConfig->pVTable->outputBusCount) { return MA_INVALID_ARGS; /* Invalid configuration. You must not specify a conflicting bus count between the node's config and the vtable. */ } } @@ -79341,8 +79341,8 @@ static ma_result ma_node_translate_bus_counts(const ma_node_config* pConfig, ma_ /* Some special rules for passthrough nodes. */ - if ((pConfig->vtable->flags & MA_NODE_FLAG_PASSTHROUGH) != 0) { - if ((pConfig->vtable->inputBusCount != 0 && pConfig->vtable->inputBusCount != 1) || pConfig->vtable->outputBusCount != 1) { + if ((pConfig->pVTable->flags & MA_NODE_FLAG_PASSTHROUGH) != 0) { + if ((pConfig->pVTable->inputBusCount != 0 && pConfig->pVTable->inputBusCount != 1) || pConfig->pVTable->outputBusCount != 1) { return MA_INVALID_ARGS; /* Passthrough nodes must have exactly 1 output bus and either 0 or 1 input bus. */ } @@ -79368,7 +79368,7 @@ static ma_result ma_node_get_heap_layout(ma_node_graph* pNodeGraph, const ma_nod MA_ZERO_OBJECT(pHeapLayout); - if (pConfig == NULL || pConfig->vtable == NULL || pConfig->vtable->onProcess == NULL) { + if (pConfig == NULL || pConfig->pVTable == NULL || pConfig->pVTable->onProcess == NULL) { return MA_INVALID_ARGS; } @@ -79493,7 +79493,7 @@ MA_API ma_result ma_node_init_preallocated(ma_node_graph* pNodeGraph, const ma_n MA_ZERO_MEMORY(pHeap, heapLayout.sizeInBytes); pNodeBase->pNodeGraph = pNodeGraph; - pNodeBase->vtable = pConfig->vtable; + pNodeBase->pVTable = pConfig->pVTable; pNodeBase->state = pConfig->initialState; pNodeBase->stateTimes[ma_node_state_started] = 0; pNodeBase->stateTimes[ma_node_state_stopped] = (ma_uint64)(ma_int64)-1; /* Weird casting for VC6 compatibility. */ @@ -79939,8 +79939,8 @@ static void ma_node_process_pcm_frames_internal(ma_node* pNode, const float** pp MA_ASSERT(pNode != NULL); - if (pNodeBase->vtable->onProcess) { - pNodeBase->vtable->onProcess(pNode, ppFramesIn, pFrameCountIn, ppFramesOut, pFrameCountOut); + if (pNodeBase->pVTable->onProcess) { + pNodeBase->pVTable->onProcess(pNode, ppFramesIn, pFrameCountIn, ppFramesOut, pFrameCountOut); } } @@ -80050,7 +80050,7 @@ static ma_result ma_node_read_pcm_frames(ma_node* pNode, ma_uint32 outputBusInde If it's a passthrough we won't be expecting the callback to output anything, so we'll need to pre-silence the output buffer. */ - if ((pNodeBase->vtable->flags & MA_NODE_FLAG_PASSTHROUGH) != 0) { + if ((pNodeBase->pVTable->flags & MA_NODE_FLAG_PASSTHROUGH) != 0) { ma_silence_pcm_frames(pFramesOut, frameCount, ma_format_f32, ma_node_get_output_channels(pNode, outputBusIndex)); } @@ -80058,7 +80058,7 @@ static ma_result ma_node_read_pcm_frames(ma_node* pNode, ma_uint32 outputBusInde totalFramesRead = frameCountOut; } else { /* Slow path. Need to read input data. */ - if ((pNodeBase->vtable->flags & MA_NODE_FLAG_PASSTHROUGH) != 0) { + if ((pNodeBase->pVTable->flags & MA_NODE_FLAG_PASSTHROUGH) != 0) { /* Fast path. We're running a passthrough. We need to read directly into the output buffer, but still fire the callback so that event handling and trigger nodes can do their thing. Since @@ -80120,8 +80120,8 @@ static ma_result ma_node_read_pcm_frames(ma_node* pNode, ma_uint32 outputBusInde } framesToProcessIn = frameCount; - if (pNodeBase->vtable->onGetRequiredInputFrameCount) { - pNodeBase->vtable->onGetRequiredInputFrameCount(pNode, framesToProcessOut, &framesToProcessIn); /* <-- It does not matter if this fails. */ + if (pNodeBase->pVTable->onGetRequiredInputFrameCount) { + pNodeBase->pVTable->onGetRequiredInputFrameCount(pNode, framesToProcessOut, &framesToProcessIn); /* <-- It does not matter if this fails. */ } if (framesToProcessIn > pNodeBase->cachedDataCapInFramesPerBus) { framesToProcessIn = pNodeBase->cachedDataCapInFramesPerBus; @@ -80213,11 +80213,11 @@ static ma_result ma_node_read_pcm_frames(ma_node* pNode, ma_uint32 outputBusInde pNodeBase->cachedFrameCountIn, which could be 0. Also, we want to check if we can pass in NULL for the input buffer to the callback. */ - if ((pNodeBase->vtable->flags & MA_NODE_FLAG_CONTINUOUS_PROCESSING) != 0) { + if ((pNodeBase->pVTable->flags & MA_NODE_FLAG_CONTINUOUS_PROCESSING) != 0) { /* We're using continuous processing. Make sure we specify the whole frame count at all times. */ frameCountIn = framesToProcessIn; /* Give the processing function as much input data as we've got in the buffer, including any silenced padding from short reads. */ - if ((pNodeBase->vtable->flags & MA_NODE_FLAG_ALLOW_NULL_INPUT) != 0 && pNodeBase->consumedFrameCountIn == 0 && pNodeBase->cachedFrameCountIn == 0) { + if ((pNodeBase->pVTable->flags & MA_NODE_FLAG_ALLOW_NULL_INPUT) != 0 && pNodeBase->consumedFrameCountIn == 0 && pNodeBase->cachedFrameCountIn == 0) { consumeNullInput = MA_TRUE; } else { consumeNullInput = MA_FALSE; @@ -80261,7 +80261,7 @@ static ma_result ma_node_read_pcm_frames(ma_node* pNode, ma_uint32 outputBusInde determining whether or not we need to process the node even when there are no input frames available right now. */ - if (frameCountIn > 0 || (pNodeBase->vtable->flags & MA_NODE_FLAG_DIFFERENT_PROCESSING_RATES) != 0) { + if (frameCountIn > 0 || (pNodeBase->pVTable->flags & MA_NODE_FLAG_DIFFERENT_PROCESSING_RATES) != 0) { ma_node_process_pcm_frames_internal(pNode, (const float**)ppFramesIn, &frameCountIn, ppFramesOut, &frameCountOut); /* From GCC: expected 'const float **' but argument is of type 'float **'. Shouldn't this be implicit? Explicit cast to silence the warning. */ } else { frameCountOut = 0; /* No data was processed. */ @@ -80404,7 +80404,7 @@ MA_API ma_result ma_data_source_node_init(ma_node_graph* pNodeGraph, const ma_da /* The channel count is defined by the data source. If the caller has manually changed the channels we just ignore it. */ baseConfig = pConfig->nodeConfig; - baseConfig.vtable = &g_ma_data_source_node_vtable; /* Explicitly set the vtable here to prevent callers from setting it incorrectly. */ + baseConfig.pVTable = &g_ma_data_source_node_vtable; /* Explicitly set the vtable here to prevent callers from setting it incorrectly. */ /* The channel count is defined by the data source. It is invalid for the caller to manually set @@ -80527,7 +80527,7 @@ MA_API ma_result ma_splitter_node_init(ma_node_graph* pNodeGraph, const ma_split } baseConfig = pConfig->nodeConfig; - baseConfig.vtable = &g_ma_splitter_node_vtable; + baseConfig.pVTable = &g_ma_splitter_node_vtable; baseConfig.pInputChannels = pInputChannels; baseConfig.pOutputChannels = pOutputChannels; baseConfig.outputBusCount = pConfig->outputBusCount; @@ -80603,7 +80603,7 @@ MA_API ma_result ma_biquad_node_init(ma_node_graph* pNodeGraph, const ma_biquad_ } baseNodeConfig = ma_node_config_init(); - baseNodeConfig.vtable = &g_ma_biquad_node_vtable; + baseNodeConfig.pVTable = &g_ma_biquad_node_vtable; baseNodeConfig.pInputChannels = &pConfig->biquad.channels; baseNodeConfig.pOutputChannels = &pConfig->biquad.channels; @@ -80695,7 +80695,7 @@ MA_API ma_result ma_lpf_node_init(ma_node_graph* pNodeGraph, const ma_lpf_node_c } baseNodeConfig = ma_node_config_init(); - baseNodeConfig.vtable = &g_ma_lpf_node_vtable; + baseNodeConfig.pVTable = &g_ma_lpf_node_vtable; baseNodeConfig.pInputChannels = &pConfig->lpf.channels; baseNodeConfig.pOutputChannels = &pConfig->lpf.channels; @@ -80789,7 +80789,7 @@ MA_API ma_result ma_hpf_node_init(ma_node_graph* pNodeGraph, const ma_hpf_node_c } baseNodeConfig = ma_node_config_init(); - baseNodeConfig.vtable = &g_ma_hpf_node_vtable; + baseNodeConfig.pVTable = &g_ma_hpf_node_vtable; baseNodeConfig.pInputChannels = &pConfig->hpf.channels; baseNodeConfig.pOutputChannels = &pConfig->hpf.channels; @@ -80884,7 +80884,7 @@ MA_API ma_result ma_bpf_node_init(ma_node_graph* pNodeGraph, const ma_bpf_node_c } baseNodeConfig = ma_node_config_init(); - baseNodeConfig.vtable = &g_ma_bpf_node_vtable; + baseNodeConfig.pVTable = &g_ma_bpf_node_vtable; baseNodeConfig.pInputChannels = &pConfig->bpf.channels; baseNodeConfig.pOutputChannels = &pConfig->bpf.channels; @@ -80978,7 +80978,7 @@ MA_API ma_result ma_notch_node_init(ma_node_graph* pNodeGraph, const ma_notch_no } baseNodeConfig = ma_node_config_init(); - baseNodeConfig.vtable = &g_ma_notch_node_vtable; + baseNodeConfig.pVTable = &g_ma_notch_node_vtable; baseNodeConfig.pInputChannels = &pConfig->notch.channels; baseNodeConfig.pOutputChannels = &pConfig->notch.channels; @@ -81073,7 +81073,7 @@ MA_API ma_result ma_peak_node_init(ma_node_graph* pNodeGraph, const ma_peak_node } baseNodeConfig = ma_node_config_init(); - baseNodeConfig.vtable = &g_ma_peak_node_vtable; + baseNodeConfig.pVTable = &g_ma_peak_node_vtable; baseNodeConfig.pInputChannels = &pConfig->peak.channels; baseNodeConfig.pOutputChannels = &pConfig->peak.channels; @@ -81167,7 +81167,7 @@ MA_API ma_result ma_loshelf_node_init(ma_node_graph* pNodeGraph, const ma_loshel } baseNodeConfig = ma_node_config_init(); - baseNodeConfig.vtable = &g_ma_loshelf_node_vtable; + baseNodeConfig.pVTable = &g_ma_loshelf_node_vtable; baseNodeConfig.pInputChannels = &pConfig->loshelf.channels; baseNodeConfig.pOutputChannels = &pConfig->loshelf.channels; @@ -81261,7 +81261,7 @@ MA_API ma_result ma_hishelf_node_init(ma_node_graph* pNodeGraph, const ma_hishel } baseNodeConfig = ma_node_config_init(); - baseNodeConfig.vtable = &g_ma_hishelf_node_vtable; + baseNodeConfig.pVTable = &g_ma_hishelf_node_vtable; baseNodeConfig.pInputChannels = &pConfig->hishelf.channels; baseNodeConfig.pOutputChannels = &pConfig->hishelf.channels; @@ -81345,7 +81345,7 @@ MA_API ma_result ma_delay_node_init(ma_node_graph* pNodeGraph, const ma_delay_no } baseConfig = pConfig->nodeConfig; - baseConfig.vtable = &g_ma_delay_node_vtable; + baseConfig.pVTable = &g_ma_delay_node_vtable; baseConfig.pInputChannels = &pConfig->delay.channels; baseConfig.pOutputChannels = &pConfig->delay.channels; @@ -81929,12 +81929,12 @@ static ma_node_config ma_engine_node_base_node_config_init(const ma_engine_node_ if (pConfig->type == ma_engine_node_type_sound) { /* Sound. */ baseNodeConfig = ma_node_config_init(); - baseNodeConfig.vtable = &g_ma_engine_node_vtable__sound; + baseNodeConfig.pVTable = &g_ma_engine_node_vtable__sound; baseNodeConfig.initialState = ma_node_state_stopped; /* Sounds are stopped by default. */ } else { /* Group. */ baseNodeConfig = ma_node_config_init(); - baseNodeConfig.vtable = &g_ma_engine_node_vtable__group; + baseNodeConfig.pVTable = &g_ma_engine_node_vtable__group; baseNodeConfig.initialState = ma_node_state_started; /* Groups are started by default. */ }