summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Glover <j@johnglover.net>2012-10-15 09:29:59 +0200
committerJohn Glover <j@johnglover.net>2012-10-15 09:29:59 +0200
commit0970b652791919d864a34bdf446f594380d83b67 (patch)
tree97244e4910938a057e2c3af3f12c90971c40ff8d /src
parentb3f515b5066e90ae8a828e03ed2b26bdff8029c3 (diff)
downloadsimpl-0970b652791919d864a34bdf446f594380d83b67.tar.gz
simpl-0970b652791919d864a34bdf446f594380d83b67.tar.bz2
simpl-0970b652791919d864a34bdf446f594380d83b67.zip
[partial_tracking] Getters/setters for more SMS
partial tracking parameters.
Diffstat (limited to 'src')
-rw-r--r--src/simpl/partial_tracking.cpp60
-rw-r--r--src/simpl/partial_tracking.h10
2 files changed, 68 insertions, 2 deletions
diff --git a/src/simpl/partial_tracking.cpp b/src/simpl/partial_tracking.cpp
index 5bb08b3..420bcb6 100644
--- a/src/simpl/partial_tracking.cpp
+++ b/src/simpl/partial_tracking.cpp
@@ -143,6 +143,9 @@ void SMSPartialTracking::init_peaks() {
memset(_peak_phase, 0.0, sizeof(sample) * _max_partials);
}
+void SMSPartialTracking::reset() {
+}
+
void SMSPartialTracking::max_partials(int new_max_partials) {
_max_partials = new_max_partials;
@@ -193,7 +196,62 @@ void SMSPartialTracking::harmonic(bool is_harmonic) {
sms_allocFrameH(&_header, &_data);
}
-void SMSPartialTracking::reset() {
+int SMSPartialTracking::max_frame_delay() {
+ return _analysis_params.iMaxDelayFrames;
+}
+
+void SMSPartialTracking::max_frame_delay(int new_max_frame_delay) {
+ sms_freeAnalysis(&_analysis_params);
+ sms_freeFrame(&_data);
+
+ _analysis_params.iMaxDelayFrames = new_max_frame_delay;
+
+ sms_initAnalysis(&_analysis_params);
+ sms_fillHeader(&_header, &_analysis_params);
+ sms_allocFrameH(&_header, &_data);
+}
+
+int SMSPartialTracking::analysis_delay() {
+ return _analysis_params.analDelay;
+}
+
+void SMSPartialTracking::analysis_delay(int new_analysis_delay) {
+ sms_freeAnalysis(&_analysis_params);
+ sms_freeFrame(&_data);
+
+ _analysis_params.analDelay = new_analysis_delay;
+
+ sms_initAnalysis(&_analysis_params);
+ sms_fillHeader(&_header, &_analysis_params);
+ sms_allocFrameH(&_header, &_data);
+}
+
+int SMSPartialTracking::min_good_frames() {
+ return _analysis_params.minGoodFrames;
+}
+
+void SMSPartialTracking::min_good_frames(int new_min_good_frames) {
+ sms_freeAnalysis(&_analysis_params);
+ sms_freeFrame(&_data);
+
+ _analysis_params.minGoodFrames = new_min_good_frames;
+
+ sms_initAnalysis(&_analysis_params);
+ sms_fillHeader(&_header, &_analysis_params);
+ sms_allocFrameH(&_header, &_data);
+}
+
+bool SMSPartialTracking::clean_tracks() {
+ return _analysis_params.iCleanTracks == 1;
+}
+
+void SMSPartialTracking::clean_tracks(bool new_clean_tracks) {
+ if(new_clean_tracks) {
+ _analysis_params.iCleanTracks = 1;
+ }
+ else {
+ _analysis_params.iCleanTracks = 0;
+ }
}
Peaks SMSPartialTracking::update_partials(Frame* frame) {
diff --git a/src/simpl/partial_tracking.h b/src/simpl/partial_tracking.h
index 324c348..0812e64 100644
--- a/src/simpl/partial_tracking.h
+++ b/src/simpl/partial_tracking.h
@@ -77,12 +77,20 @@ class SMSPartialTracking : public PartialTracking {
public:
SMSPartialTracking();
~SMSPartialTracking();
+ void reset();
void max_partials(int new_max_partials);
bool realtime();
void realtime(bool is_realtime);
bool harmonic();
void harmonic(bool is_harmonic);
- void reset();
+ int max_frame_delay();
+ void max_frame_delay(int new_max_frame_delay);
+ int analysis_delay();
+ void analysis_delay(int new_analysis_delay);
+ int min_good_frames();
+ void min_good_frames(int new_min_good_frames);
+ bool clean_tracks();
+ void clean_tracks(bool new_clean_tracks);
Peaks update_partials(Frame* frame);
};