54b259b2941f — Chris Cannam 6 years ago
Build fixes for Android
3 files changed, 7 insertions(+), 8 deletions(-)

M Android.mk
M src/MiniBpm.cpp
M src/jni/MiniBpmJNI.cpp
M Android.mk +2 -2
@@ 2,9 2,9 @@ 
 LOCAL_MODULE := minibpm
 LOCAL_MODULE_FILENAME := libminibpm-jni
 
-LOCAL_C_INCLUDES := $(LOCAL_PATH)/src
+LOCAL_C_INCLUDES := $(LOCAL_PATH)/minibpm/src 
 
-MINIBPM_PATH := .
+MINIBPM_PATH := minibpm
 MINIBPM_SRC_PATH := $(MINIBPM_PATH)/src
 
 MINIBPM_JNI_FILES := \

          
M src/MiniBpm.cpp +3 -3
@@ 507,13 507,13 @@ public:
 
 	zero(acf, acfLength);
 
-	acfcalc.acfUnityNormalised(m_lfdf.data(), temp);
+	acfcalc.acfUnityNormalised(&m_lfdf[0], temp);
 	for (int i = 0; i < acfLength; ++i) acf[i] += temp[i];
 
-	acfcalc.acfUnityNormalised(m_hfdf.data(), temp);
+	acfcalc.acfUnityNormalised(&m_hfdf[0], temp);
 	for (int i = 0; i < acfLength; ++i) acf[i] += temp[i] * 0.5;
 
-	acfcalc.acfUnityNormalised(m_rms.data(), temp);
+	acfcalc.acfUnityNormalised(&m_rms[0], temp);
 	for (int i = 0; i < acfLength; ++i) acf[i] += temp[i] * 0.1;
 
 	int minlag = Autocorrelation::bpmToLag(m_maxbpm, hopsPerSec);

          
M src/jni/MiniBpmJNI.cpp +2 -3
@@ 21,7 21,7 @@ 
     valid commercial licence before doing so.
 */
 
-#include "MiniBPM.h"
+#include "MiniBpm.h"
 
 #include <jni.h>
 

          
@@ 180,7 180,6 @@ JNIEXPORT jdouble JNICALL
 Java_com_breakfastquay_minibpm_MiniBpm_estimateTempoOfSamples(JNIEnv *env, jobject obj, jfloatArray data, jint offset, jint n)
 {
     float *arr = env->GetFloatArrayElements(data, 0);
-    float *in = arr + offset;
 
     double estimate =
         getMiniBPM(env, obj)->estimateTempoOfSamples(arr + offset, n);

          
@@ 195,7 194,7 @@ Java_com_breakfastquay_minibpm_MiniBpm_g
 {
     std::vector<double> candidates = getMiniBPM(env, obj)->getTempoCandidates();
     jdoubleArray out = env->NewDoubleArray(candidates.size());
-    env->SetDoubleArrayRegion(out, 0, candidates.size(), candidates.data());
+    env->SetDoubleArrayRegion(out, 0, candidates.size(), &candidates[0]);
     return out;
 }