Skip to content

Commit 9efcb31

Browse files
committed
add logs to vst
1 parent 0b78877 commit 9efcb31

File tree

4 files changed

+7
-2
lines changed

4 files changed

+7
-2
lines changed

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,8 @@ if (ENABLE_LOGGING)
208208
message(STATUS "set debug level")
209209
# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DRK_LOG_DEBUG_LEVEL")
210210
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DRK_LOG_DEBUG_LEVEL")
211+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DGKICK_LOG_DEBUG_LEVEL")
212+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DGKICK_LOG_DEBUG_LEVEL")
211213
list(APPEND GKICK_API_FLAGS "-DGKICK_LIB_LOG_LEVEL_DEBUG")
212214
list(APPEND GKICK_API_FLAGS "-DGKICK_LIB_LOG_FUNCTION")
213215
list(APPEND GKICK_API_PLUGIN_FLAGS "-DGKICK_LIB_LOG_LEVEL_DEBUG")

src/dsp/src/ring_buffer.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ ring_buffer_get_data(struct ring_buffer *ring,
8080
gkick_real *data,
8181
size_t data_size)
8282
{
83+
if (data == NULL)
84+
return;
8385
for (size_t i = 0; i < data_size; i++)
8486
data[i] += ring->buff[(ring->index + i) % ring->size];
8587
}

src/globals.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050

5151
#include <RkObject.h>
5252

53-
#ifdef RK_LOG_DEBUG_LEVEL
53+
#ifdef GKICK_LOG_DEBUG_LEVEL
5454
#define GEONKICK_LOG_INFO(msg) std::cout << "[" << GEONKICK_NAME << "] " \
5555
<< " [" << std::this_thread::get_id() << "] " \
5656
<< __PRETTY_FUNCTION__ << "[INFO] " \

src/plugin/vst/GKickVstProcessor.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ GKickVstProcessor::initialize(FUnknown* context)
6969
return res;
7070

7171
auto nChannels = GeonkickApi::numberOfChannels();
72+
GEONKICK_LOG_DEBUG("nChannels : " << nChannels);
7273
for (decltype(nChannels) i = 0; i < nChannels; i++) {
7374
std::wstring outStr;
7475
if ( i == GEONKICK_AUDITION_CHANNEL_INDEX)
@@ -88,6 +89,7 @@ GKickVstProcessor::setBusArrangements(Vst::SpeakerArrangement* inputs,
8889
Vst::SpeakerArrangement* outputs,
8990
int32 numOuts)
9091
{
92+
GEONKICK_LOG_DEBUG("numIns : " << numIns << ", numOuts: " << numOuts);
9193
auto n = GeonkickApi::numberOfChannels();
9294
if (numIns == 0 && numOuts == static_cast<decltype(numOuts)>(n))
9395
return Vst::SingleComponentEffect::setBusArrangements(inputs, numIns, outputs, numOuts);
@@ -128,7 +130,6 @@ GKickVstProcessor::process(Vst::ProcessData& data)
128130

129131
size_t nChannels = std::min(geonkickApi->numberOfChannels(),
130132
static_cast<decltype(nChannels)>(data.numOutputs));
131-
132133
for (decltype(nChannels) ch = 0; ch < nChannels; ch++) {
133134
channelsBuffers.data()[2 * ch] = data.outputs[ch].channelBuffers32[0];
134135
channelsBuffers.data()[2 * ch + 1] = data.outputs[ch].channelBuffers32[1];

0 commit comments

Comments
 (0)