Remove C++/Cli version and replace with P/Invoke wrapper to support all platforms

This commit is contained in:
Flamefire committed 2014-03-26 19:52:35 +01:00
1 parent e54892391f
commit ae9f8bb30a
9 files changed
+283 -100

No files matched your search

+12 -11
View File
@@ -1,9 +1,6 @@
#pragma once
#include "pitch.hh"
#include "PitchWrapper.h"
#pragma managed(push, off)
#include <stdlib.h>
#include <cmath>
@@ -43,19 +40,23 @@ void freeDoubleArray(double* floats){
free(floats);
}
#pragma managed(pop)
double ToneToNote(const Tone* tone){
return 12.0 * std::log(tone->freq / 127.09) / std::log(2.0) + 27.5 - 16; // 16 = C2
}
/*
namespace Native{
namespace PitchTracking{
CTone^ ConvertToneToManaged(Tone tone){
CTone^ ConvertToneToManaged(Tone* tone){
CTone^ result = gcnew CTone();
result->Freq = tone.freq;
result->DB = tone.db;
result->Stabledb = tone.stabledb;
result->Age = static_cast<int>(tone.age);
result->NoteExact = 12.0 * std::log(tone.freq / 127.09) / std::log(2.0) + 27.5 - 16; // 16 = C2
result->Freq = tone->freq;
result->DB = tone->db;
result->Stabledb = tone->stabledb;
result->Age = static_cast<int>(tone->age);
result->NoteExact = 12.0 * std::log(tone->freq / 127.09) / std::log(2.0) + 27.5 - 16; // 16 = C2
result->Note = static_cast<int>(std::round(result->NoteExact));
return result;
}
}
}
}
*/