Created wrapper function so that c++ apps can access named quality / effect parameters.

This commit is contained in:
2013-03-07 18:22:14 -08:00
parent 8cd5a2f7cf
commit 408b0f7612
3 changed files with 13 additions and 1 deletions

View File

@@ -165,7 +165,7 @@ void KRAudioManager::renderAudio(UInt32 inNumberFrames, AudioBufferList *ioData)
uint64_t end_time = mach_absolute_time(); uint64_t end_time = mach_absolute_time();
uint64_t duration = (end_time - start_time) * m_timebase_info.numer / m_timebase_info.denom; // Nanoseconds uint64_t duration = (end_time - start_time) * m_timebase_info.numer / m_timebase_info.denom; // Nanoseconds
uint64_t max_duration = (uint64_t)inNumberFrames * 1000000000 / 44100; uint64_t max_duration = (uint64_t)inNumberFrames * 1000000000 / 44100;
fprintf(stderr, "audio load: %5.1f%% hrtf channels: %li\n", (float)(duration * 1000 / max_duration) / 10.0f, m_mapped_sources.size()); // fprintf(stderr, "audio load: %5.1f%% hrtf channels: %li\n", (float)(duration * 1000 / max_duration) / 10.0f, m_mapped_sources.size());
} }
float *KRAudioManager::getBlockAddress(int block_offset) float *KRAudioManager::getBlockAddress(int block_offset)

View File

@@ -41,6 +41,11 @@
typedef enum KREngineParameterType {KRENGINE_PARAMETER_INT, KRENGINE_PARAMETER_FLOAT, KRENGINE_PARAMETER_BOOL} KREngineParameterType; typedef enum KREngineParameterType {KRENGINE_PARAMETER_INT, KRENGINE_PARAMETER_FLOAT, KRENGINE_PARAMETER_BOOL} KREngineParameterType;
namespace kraken {
void set_parameter(const std::string &parameter_name, float parameter_value);
};
#ifdef __OBJC__
@interface KREngine : NSObject @interface KREngine : NSObject
@@ -72,3 +77,5 @@ typedef enum KREngineParameterType {KRENGINE_PARAMETER_INT, KRENGINE_PARAMETER_F
@end @end
#endif

View File

@@ -39,6 +39,11 @@
using namespace std; using namespace std;
// Temporary wrapper function, until the KREngine class is refactored into the C++ codebase
void kraken::set_parameter(const std::string &parameter_name, float parameter_value)
{
[[KREngine sharedInstance] setParameterValueWithName: [NSString stringWithUTF8String:parameter_name.c_str()] Value:parameter_value];
}
@interface KREngine() { @interface KREngine() {