From 3552a5e68eb7a336cdb6f8e4fc6a674ff19edcf3 Mon Sep 17 00:00:00 2001 From: Paolo Marrone Date: Fri, 5 Jul 2024 16:18:17 +0200 Subject: [PATCH] minor fixing --- templates/ios/src/app.swift | 12 +- templates/ios/src/index.html | 226 ++++++++++++++++++----------------- templates/ios/src/native.mm | 28 ++--- 3 files changed, 134 insertions(+), 132 deletions(-) diff --git a/templates/ios/src/app.swift b/templates/ios/src/app.swift index d92db0c..706f8d5 100644 --- a/templates/ios/src/app.swift +++ b/templates/ios/src/app.swift @@ -97,12 +97,12 @@ struct templateApp: App { var body: some Scene { WindowGroup { ContentView() - .onReceive(NotificationCenter.default.publisher(for: UIApplication.didEnterBackgroundNotification)) { _ in - audioPause() - } - .onReceive(NotificationCenter.default.publisher(for: UIApplication.willEnterForegroundNotification)) { _ in - audioResume() - } + .onReceive(NotificationCenter.default.publisher(for: UIApplication.didEnterBackgroundNotification)) { _ in + audioPause() + } + .onReceive(NotificationCenter.default.publisher(for: UIApplication.willEnterForegroundNotification)) { _ in + audioResume() + } } } } diff --git a/templates/ios/src/index.html b/templates/ios/src/index.html index ce7e217..e7b0655 100644 --- a/templates/ios/src/index.html +++ b/templates/ios/src/index.html @@ -21,14 +21,15 @@ --> - - - {{=it.product.name}} - - - - - -
- + .range { + width: 90%; + } + + + + +
+ diff --git a/templates/ios/src/native.mm b/templates/ios/src/native.mm index 00ed24d..fe4bb1e 100644 --- a/templates/ios/src/native.mm +++ b/templates/ios/src/native.mm @@ -109,16 +109,16 @@ static void data_callback(ma_device* pDevice, void* pOutput, const void* pInput, if (mutex.try_lock()) { # if PARAMETERS_N > 0 for (size_t i = 0; i < PARAMETERS_N; i++) { - if (param_data[i].out) { + if (param_data[i].out) { # ifdef PARAM_OUT_CPU_INDEX - if (i == PARAM_OUT_CPU_INDEX) { - param_values_prev[i] = param_values[i] = cpu_meter; - continue; - } + if (i == PARAM_OUT_CPU_INDEX) { + param_values_prev[i] = param_values[i] = cpu_meter; + continue; + } # endif - param_values_prev[i] = param_values[i] = plugin_get_parameter(&instance, i); - } - else if (param_values_prev[i] != param_values[i]) { + param_values_prev[i] = param_values[i] = plugin_get_parameter(&instance, i); + } + else if (param_values_prev[i] != param_values[i]) { plugin_set_parameter(&instance, i, param_values[i]); param_values_prev[i] = param_values[i]; } @@ -178,10 +178,10 @@ static void data_callback(ma_device* pDevice, void* pOutput, const void* pInput, #endif #ifdef PARAM_OUT_CPU_INDEX - const unsigned long long processTimeEnd = fatica_time_process(); - const unsigned long long processTime100n = processTimeEnd - processTimeStart; - const double processTimeS = ((double) processTime100n) * 1.0e-7; - cpu_meter = cpu_meter * 0.9f + ((float) (processTimeS * sample_rate)) * 0.1f; + const unsigned long long processTimeEnd = fatica_time_process(); + const unsigned long long processTime100n = processTimeEnd - processTimeStart; + const double processTimeS = ((double) processTime100n) * 1.0e-7; + cpu_meter = cpu_meter * 0.9f + ((float) (processTimeS * sample_rate)) * 0.1f; #endif } @@ -301,8 +301,8 @@ char audioStart() { #endif plugin_set_sample_rate(&instance, (float)device.sampleRate); - sample_rate = (float)device.sampleRate; - + sample_rate = (float)device.sampleRate; + size_t req = plugin_mem_req(&instance); if (req != 0) { mem = malloc(req);