Browse Source

Add C++ test compilation file

master
Nils 3 months ago
parent
commit
36e75b9a72
  1. 2
      .gitignore
  2. 88
      experiments/testcpp.cpp

2
.gitignore

@ -1,2 +1,4 @@
config.h
build/
experiments/testcpp
!experiments/testcpp.cpp

88
experiments/testcpp.cpp

@ -0,0 +1,88 @@
//g++ testcpp.cpp -o testcpp $(pkg-config --cflags --libs glib-2.0)
//g++ testcpp.cpp -o testcpp -Wall -lcalfbox-lss-static $(pkg-config --cflags --libs glib-2.0) -lm -luuid -lsndfile -ljack
#include <iostream>
extern "C" {
#include <glib.h>
#include <calfbox/app.h>
#include <calfbox/auxbus.h>
#include <calfbox/blob.h>
#include <calfbox/cmd.h>
#include <calfbox/config-api.h>
#include <calfbox/dom.h>
#include <calfbox/engine.h>
#include <calfbox/eq.h>
#include <calfbox/errors.h>
#include <calfbox/fifo.h>
#include <calfbox/hwcfg.h>
#include <calfbox/instr.h>
#include <calfbox/io.h>
#include <calfbox/layer.h>
#include <calfbox/master.h>
#include <calfbox/meter.h>
#include <calfbox/midi.h>
#include <calfbox/mididest.h>
#include <calfbox/module.h>
#include <calfbox/pattern.h>
#include <calfbox/pattern-maker.h>
#include <calfbox/prefetch_pipe.h>
#include <calfbox/recsrc.h>
#include <calfbox/rt.h>
#include <calfbox/sampler.h>
#include <calfbox/sampler_layer.h>
#include <calfbox/sampler_prg.h>
#include <calfbox/scene.h>
#include <calfbox/scripting.h>
#include <calfbox/seq.h>
#include <calfbox/sfzloader.h>
#include <calfbox/sfzparser.h>
#include <calfbox/song.h>
#include <calfbox/tarfile.h>
#include <calfbox/track.h>
#include <calfbox/wavebank.h>
}
struct cbox_environment
{
struct cbox_document *document;
struct cbox_engine *engine;
struct cbox_rt *realtime;
struct cbox_io io;
struct cbox_open_params params;
struct cbox_layer *layer;
struct cbox_scene *scene;
void *arg;
gchar *context;
};
struct cbox_environment env;
int main() {
// Example function call - replace this with actual usage
std::cout << "Hello World!\n";
cbox_dom_init();
env.document = cbox_document_new();
env.realtime = cbox_rt_new(env.document);
env.engine = cbox_engine_new(env.document, env.realtime);
env.context = NULL;
env.realtime->engine = env.engine; //inject engine into realtime struct
cbox_config_init("");
//Autoconnect our jack outputs to system out
cbox_config_set_string("io", "out_1", "#1");
cbox_config_set_string("io", "out_2", "#2");
cbox_config_set_string("io", "midi", "*a2j:.*");
cbox_config_set_string("io", "client_name", "sfzload");
cbox_config_set_int("io", "enable_common_midi_input", 1); //last is a bool. This is the default, let's call it anyway.
return 0;
}
Loading…
Cancel
Save