summaryrefslogtreecommitdiff
path: root/rotord/rotor.h
diff options
context:
space:
mode:
Diffstat (limited to 'rotord/rotor.h')
-rwxr-xr-xrotord/rotor.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/rotord/rotor.h b/rotord/rotor.h
index 105ed98..7dbb18d 100755
--- a/rotord/rotor.h
+++ b/rotord/rotor.h
@@ -244,9 +244,21 @@ namespace Rotor {
void cleanup();
int process_frame(uint8_t *data,int samples_in_frame);
float get_output(const float &time) {
- float t=time;
- return t;
+ if (analyser.features.size()) {
+ auto i=analyser.features.lower_bound(time);
+ if (i!=analyser.features.end()){
+ float lk=i->first;
+ int ln=i->second;
+ if (i++!=analyser.features.end()){
+ float uk=i->first;
+ return (((time-lk)/(uk-lk))+ln);
+ }
+ else return (float)ln;
+ }
+ }
+ return 0.0f;
}
+ void print_features();
private:
string soname,id;
int outputNo;