mirror of
https://github.com/cookiengineer/audacity
synced 2025-11-27 15:50:10 +01:00
Update Nyquist to v3.09.
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
#include "cext.h"
|
||||
#include "follow.h"
|
||||
|
||||
void follow_free();
|
||||
void follow_free(snd_susp_type a_susp);
|
||||
|
||||
|
||||
typedef struct follow_susp_struct {
|
||||
@@ -76,8 +76,9 @@ static sample_type *create_buf(double floor, long lookahead)
|
||||
}
|
||||
|
||||
|
||||
void follow_s_fetch(register follow_susp_type susp, snd_list_type snd_list)
|
||||
void follow_s_fetch(snd_susp_type a_susp, snd_list_type snd_list)
|
||||
{
|
||||
follow_susp_type susp = (follow_susp_type) a_susp;
|
||||
int cnt = 0; /* how many samples computed */
|
||||
int togo;
|
||||
int n;
|
||||
@@ -112,6 +113,7 @@ void follow_s_fetch(register follow_susp_type susp, snd_list_type snd_list)
|
||||
if (susp->terminate_cnt != UNKNOWN &&
|
||||
susp->terminate_cnt <= susp->susp.current + cnt + togo) {
|
||||
togo = susp->terminate_cnt - (susp->susp.current + cnt);
|
||||
if (togo < 0) togo = 0; /* avoids rounding errros */
|
||||
if (togo == 0) break;
|
||||
}
|
||||
|
||||
@@ -163,7 +165,7 @@ void follow_s_fetch(register follow_susp_type susp, snd_list_type snd_list)
|
||||
}
|
||||
prevptr_reg = delayptr_reg++;
|
||||
if (delayptr_reg == endptr_reg) delayptr_reg = susp->delaybuf;
|
||||
*out_ptr_reg++ = *delayptr_reg;;
|
||||
*out_ptr_reg++ = *delayptr_reg;
|
||||
} while (--n); /* inner loop */
|
||||
|
||||
togo -= n;
|
||||
@@ -188,11 +190,9 @@ void follow_s_fetch(register follow_susp_type susp, snd_list_type snd_list)
|
||||
} /* follow_s_fetch */
|
||||
|
||||
|
||||
void follow_toss_fetch(susp, snd_list)
|
||||
register follow_susp_type susp;
|
||||
snd_list_type snd_list;
|
||||
{
|
||||
long final_count = susp->susp.toss_cnt;
|
||||
void follow_toss_fetch(snd_susp_type a_susp, snd_list_type snd_list)
|
||||
{
|
||||
follow_susp_type susp = (follow_susp_type) a_susp;
|
||||
time_type final_time = susp->susp.t0;
|
||||
long n;
|
||||
|
||||
@@ -207,25 +207,28 @@ void follow_toss_fetch(susp, snd_list)
|
||||
susp->sndin_ptr += n;
|
||||
susp_took(sndin_cnt, n);
|
||||
susp->susp.fetch = susp->susp.keep_fetch;
|
||||
(*(susp->susp.fetch))(susp, snd_list);
|
||||
(*(susp->susp.fetch))(a_susp, snd_list);
|
||||
}
|
||||
|
||||
|
||||
void follow_mark(follow_susp_type susp)
|
||||
void follow_mark(snd_susp_type a_susp)
|
||||
{
|
||||
follow_susp_type susp = (follow_susp_type) a_susp;
|
||||
sound_xlmark(susp->sndin);
|
||||
}
|
||||
|
||||
|
||||
void follow_free(follow_susp_type susp)
|
||||
void follow_free(snd_susp_type a_susp)
|
||||
{
|
||||
follow_susp_type susp = (follow_susp_type) a_susp;
|
||||
free(susp->delaybuf); sound_unref(susp->sndin);
|
||||
ffree_generic(susp, sizeof(follow_susp_node), "follow_free");
|
||||
}
|
||||
|
||||
|
||||
void follow_print_tree(follow_susp_type susp, int n)
|
||||
void follow_print_tree(snd_susp_type a_susp, int n)
|
||||
{
|
||||
follow_susp_type susp = (follow_susp_type) a_susp;
|
||||
indent(n);
|
||||
stdputstr("sndin:");
|
||||
sound_print_tree_1(susp->sndin, n);
|
||||
@@ -237,7 +240,6 @@ sound_type snd_make_follow(sound_type sndin, double floor, double risetime, doub
|
||||
register follow_susp_type susp;
|
||||
rate_type sr = sndin->sr;
|
||||
time_type t0 = sndin->t0;
|
||||
int interp_desc = 0;
|
||||
sample_type scale_factor = 1.0F;
|
||||
time_type t0_min = t0;
|
||||
falloc_generic(susp, follow_susp_node, "snd_make_follow");
|
||||
@@ -260,8 +262,8 @@ sound_type snd_make_follow(sound_type sndin, double floor, double risetime, doub
|
||||
/* how many samples to toss before t0: */
|
||||
susp->susp.toss_cnt = (long) ((t0 - t0_min) * sr + 0.5);
|
||||
if (susp->susp.toss_cnt > 0) {
|
||||
susp->susp.keep_fetch = susp->susp.fetch;
|
||||
susp->susp.fetch = follow_toss_fetch;
|
||||
susp->susp.keep_fetch = susp->susp.fetch;
|
||||
susp->susp.fetch = follow_toss_fetch;
|
||||
}
|
||||
|
||||
/* initialize susp state */
|
||||
|
||||
Reference in New Issue
Block a user