@@ -1174,7 +1174,7 @@ a variable number of buses on a per-node bases, the vtable should have the relev
...
@@ -1174,7 +1174,7 @@ a variable number of buses on a per-node bases, the vtable should have the relev
to `MA_NODE_BUS_COUNT_UNKNOWN`. In this case, the bus count should be set in the node config:
to `MA_NODE_BUS_COUNT_UNKNOWN`. In this case, the bus count should be set in the node config:
```c
```c
static ma_node_vtable my_custom_node_vtable =
static ma_node_vtable my_custom_node_vtable =
{
{
my_custom_node_process_pcm_frames, // The function that will be called process your custom node. This is where you'd implement your effect processing.
my_custom_node_process_pcm_frames, // The function that will be called process your custom node. This is where you'd implement your effect processing.
NULL, // Optional. A callback for calculating the number of input frames that are required to process a specified number of output frames.
NULL, // Optional. A callback for calculating the number of input frames that are required to process a specified number of output frames.
...
@@ -8202,7 +8202,7 @@ struct ma_node_output_bus
...
@@ -8202,7 +8202,7 @@ struct ma_node_output_bus
MA_ATOMIC float volume; /* Linear. */
MA_ATOMIC float volume; /* Linear. */
MA_ATOMIC ma_node_output_bus* pNext; /* If null, it's the tail node or detached. */
MA_ATOMIC ma_node_output_bus* pNext; /* If null, it's the tail node or detached. */
MA_ATOMIC ma_node_output_bus* pPrev; /* If null, it's the head node or detached. */
MA_ATOMIC ma_node_output_bus* pPrev; /* If null, it's the head node or detached. */
MA_ATOMIC ma_node* pInputNode; /* The node that this output bus is attached to. Required for detaching. */
MA_ATOMIC ma_node* pInputNode; /* The node that this output bus is attached to. Required for detaching. */
};
};
/*
/*
...
@@ -8235,7 +8235,7 @@ struct ma_node_base
...
@@ -8235,7 +8235,7 @@ struct ma_node_base
ma_uint16 cachedFrameCountOut;
ma_uint16 cachedFrameCountOut;
ma_uint16 cachedFrameCountIn;
ma_uint16 cachedFrameCountIn;
ma_uint16 consumedFrameCountIn;
ma_uint16 consumedFrameCountIn;
/* These variables are read and written between different threads. */
/* These variables are read and written between different threads. */
MA_ATOMIC ma_node_state state; /* When set to stopped, nothing will be read, regardless of the times in stateTimes. */
MA_ATOMIC ma_node_state state; /* When set to stopped, nothing will be read, regardless of the times in stateTimes. */
MA_ATOMIC ma_uint64 stateTimes[2]; /* Indexed by ma_node_state. Specifies the time based on the global clock that a node should be considered to be in the relevant state. */
MA_ATOMIC ma_uint64 stateTimes[2]; /* Indexed by ma_node_state. Specifies the time based on the global clock that a node should be considered to be in the relevant state. */
...
@@ -9675,7 +9675,7 @@ static MA_INLINE unsigned int ma_disable_denormals()
...
@@ -9675,7 +9675,7 @@ static MA_INLINE unsigned int ma_disable_denormals()
that VC6 lacks support. _MSC_VER = 1200 is VC6, but if you get compilation errors on older
that VC6 lacks support. _MSC_VER = 1200 is VC6, but if you get compilation errors on older
versions of Visual Studio, let me know and I'll make the necessary adjustment.
versions of Visual Studio, let me know and I'll make the necessary adjustment.
*/
*/
#if _MSC_VER <= 1200
#if _MSC_VER <= 1200
{
{
prevState = _statusfp();
prevState = _statusfp();
_controlfp(prevState | _DN_FLUSH, _MCW_DN);
_controlfp(prevState | _DN_FLUSH, _MCW_DN);
...
@@ -9693,7 +9693,7 @@ static MA_INLINE unsigned int ma_disable_denormals()
...
@@ -9693,7 +9693,7 @@ static MA_INLINE unsigned int ma_disable_denormals()
#if !(defined(__TINYC__)) /* <-- Add compilers that lack support for _mm_getcsr() and _mm_setcsr() to this list. */
#if !(defined(__TINYC__)) /* <-- Add compilers that lack support for _mm_getcsr() and _mm_setcsr() to this list. */
/* This is the Microsoft channel map. Based off the speaker configurations mentioned here: https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/content/ksmedia/ns-ksmedia-ksaudio_channel_config */
/* This is the Microsoft channel map. Based off the speaker configurations mentioned here: https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/content/ksmedia/ns-ksmedia-ksaudio_channel_config */
ma_copy_pcm_frames(ma_offset_pcm_frames_ptr(pFramesOut, totalFramesRead, format, channels), ma_offset_pcm_frames_ptr(pPagedAudioBuffer->pCurrent->pAudioData, pPagedAudioBuffer->relativeCursor, format, channels), framesToReadThisIteration, format, channels);
ma_copy_pcm_frames(ma_offset_pcm_frames_ptr(pFramesOut, totalFramesRead, format, channels), ma_offset_pcm_frames_ptr(pPagedAudioBuffer->pCurrent->pAudioData, pPagedAudioBuffer->relativeCursor, format, channels), framesToReadThisIteration, format, channels);
/* At this point the backend should be initialized. We do *not* want to set pDataSource->result here - that needs to be done at a higher level to ensure it's done as the last step. */
/* At this point the backend should be initialized. We do *not* want to set pDataSource->result here - that needs to be done at a higher level to ensure it's done as the last step. */
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? Excplicit cast to silence the warning. */
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? Excplicit cast to silence the warning. */
}
}
}
}
/*
/*
Thanks to our sneaky optimization above we don't need to do any data copying directly into
Thanks to our sneaky optimization above we don't need to do any data copying directly into
the output buffer - the onProcess() callback just did that for us. We do, however, need to
the output buffer - the onProcess() callback just did that for us. We do, however, need to