mirror of
https://github.com/cookiengineer/audacity
synced 2025-10-25 07:43:54 +02:00
I very recently pushed nyx.c thinking it was the same one pushed earlier by Steve. This version has some fundamental changes to keep reading/writing of multiple channels synchronized and insuring that the same number of samples are written to every channel. There are some minor differences like using printf instead of stdputstr and I tried to follow what I found in the nyx.c that has been in use for a long time.
This commit is contained in:
@@ -41,7 +41,7 @@
|
|||||||
#define NYX_FULL_COPY 1
|
#define NYX_FULL_COPY 1
|
||||||
|
|
||||||
/* show memory stats */
|
/* show memory stats */
|
||||||
#define NYX_MEMORY_STATS 1
|
// #define NYX_MEMORY_STATS 1
|
||||||
|
|
||||||
/* show details of obarray copy */
|
/* show details of obarray copy */
|
||||||
// #define NYX_DEBUG_COPY 1
|
// #define NYX_DEBUG_COPY 1
|
||||||
@@ -486,7 +486,7 @@ void nyx_init()
|
|||||||
xlprot1(nyx_result);
|
xlprot1(nyx_result);
|
||||||
|
|
||||||
#if defined(NYX_MEMORY_STATS) && NYX_MEMORY_STATS
|
#if defined(NYX_MEMORY_STATS) && NYX_MEMORY_STATS
|
||||||
stdputstr("\nnyx_init\n");
|
printf("\nnyx_init\n");
|
||||||
xmem();
|
xmem();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -531,7 +531,7 @@ void nyx_cleanup()
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if defined(NYX_MEMORY_STATS) && NYX_MEMORY_STATS
|
#if defined(NYX_MEMORY_STATS) && NYX_MEMORY_STATS
|
||||||
stdputstr("\nnyx_cleanup\n");
|
printf("\nnyx_cleanup\n");
|
||||||
xmem();
|
xmem();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -830,7 +830,7 @@ nyx_rval nyx_eval_expression(const char *expr_string)
|
|||||||
LVAL expr = NULL;
|
LVAL expr = NULL;
|
||||||
|
|
||||||
#if defined(NYX_MEMORY_STATS) && NYX_MEMORY_STATS
|
#if defined(NYX_MEMORY_STATS) && NYX_MEMORY_STATS
|
||||||
stdputstr("\nnyx_eval_expression before\n");
|
printf("\nnyx_eval_expression before\n");
|
||||||
xmem();
|
xmem();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -914,7 +914,7 @@ nyx_rval nyx_eval_expression(const char *expr_string)
|
|||||||
gc();
|
gc();
|
||||||
|
|
||||||
#if defined(NYX_MEMORY_STATS) && NYX_MEMORY_STATS
|
#if defined(NYX_MEMORY_STATS) && NYX_MEMORY_STATS
|
||||||
stdputstr("\nnyx_eval_expression after\n");
|
printf("\nnyx_eval_expression after\n");
|
||||||
xmem();
|
xmem();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -970,20 +970,20 @@ int nyx_get_audio(nyx_audio_callback callback, void *userdata)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if defined(NYX_MEMORY_STATS) && NYX_MEMORY_STATS
|
#if defined(NYX_MEMORY_STATS) && NYX_MEMORY_STATS
|
||||||
stdputstr("\nnyx_get_audio before\n");
|
printf("\nnyx_get_audio before\n");
|
||||||
xmem();
|
xmem();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
num_channels = nyx_get_audio_num_channels();
|
num_channels = nyx_get_audio_num_channels();
|
||||||
|
|
||||||
buffer = (sample_type *) malloc(max_sample_block_len * sizeof(sample_type *));
|
buffer = (sample_type *) malloc(max_sample_block_len * sizeof(sample_type));
|
||||||
if (buffer == NULL) {
|
if (buffer == NULL) {
|
||||||
goto finish;
|
goto finish;
|
||||||
}
|
}
|
||||||
|
|
||||||
states = (sound_state_type) malloc(num_channels * sizeof(sound_state_node));
|
states = (sound_state_type) malloc(num_channels * sizeof(sound_state_node));
|
||||||
if (states == NULL) {
|
if (states == NULL) {
|
||||||
goto finish;
|
goto finish;
|
||||||
}
|
}
|
||||||
for (ch = 0; ch < num_channels; ch++) {
|
for (ch = 0; ch < num_channels; ch++) {
|
||||||
states[ch].cnt = 0; // force initial fetch
|
states[ch].cnt = 0; // force initial fetch
|
||||||
@@ -1121,7 +1121,7 @@ int nyx_get_audio(nyx_audio_callback callback, void *userdata)
|
|||||||
finish:
|
finish:
|
||||||
|
|
||||||
if (buffer) {
|
if (buffer) {
|
||||||
free(buffer);
|
free(buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (states) {
|
if (states) {
|
||||||
@@ -1131,7 +1131,7 @@ int nyx_get_audio(nyx_audio_callback callback, void *userdata)
|
|||||||
gc();
|
gc();
|
||||||
|
|
||||||
#if defined(NYX_MEMORY_STATS) && NYX_MEMORY_STATS
|
#if defined(NYX_MEMORY_STATS) && NYX_MEMORY_STATS
|
||||||
stdputstr("\nnyx_get_audio after\n");
|
printf("\nnyx_get_audio after\n");
|
||||||
xmem();
|
xmem();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user