<commit_before>/*
 * Copyright (c) 2015 <NAME> (<EMAIL>)
 *
 * This is free software: you can redistribute it and/or modify
 * it under the terms of the Artistic License 2.0 as published by
 * The Perl Foundation.
 *
 * This source is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * Artistic License 2.0 for more details.
 *
 * You should have received a copy of the Artistic License 2.0
 * along the source as a COPYING file. If not, obtain it from
 * http://www.perlfoundation.org/artistic_license_2_0.
 */

#ifndef _CHIMAERA_LV2_H
#define _CHIMAERA_LV2_H

#include <stdint.h>

#include <lv2/lv2plug.in/ns/lv2core/lv2.h>
#include <lv2/lv2plug.in/ns/ext/atom/atom.h>
#include <lv2/lv2plug.in/ns/ext/atom/util.h>
#include <lv2/lv2plug.in/ns/ext/atom/forge.h>
#include <lv2/lv2plug.in/ns/ext/urid/urid.h>
#include <lv2/lv2plug.in/ns/ext/midi/midi.h>
#include <lv2/lv2plug.in/ns/ext/state/state.h>
#include <lv2/lv2plug.in/ns/ext/worker/worker.h>
#include <lv2/lv2plug.in/ns/ext/patch/patch.h>
#include <lv2/lv2plug.in/ns/extensions/ui/ui.h>

#define _ATOM_ALIGNED __attribute__((aligned(8)))

// bundle uri
#define CHIMAERA_URI							"http://open-music-kontrollers.ch/lv2/chimaera"

// event uri
#define CHIMAERA_EVENT_URI				CHIMAERA_URI"#event"
#define CHIMAERA_COMM_URL_URI			CHIMAERA_URI"#commURL"
#define CHIMAERA_DATA_URL_URI			CHIMAERA_URI"#dataURL"

// state uris
#define CHIMAERA_STATE_ON_URI			CHIMAERA_URI"#on"
#define CHIMAERA_STATE_SET_URI		CHIMAERA_URI"#set"
#define CHIMAERA_STATE_OFF_URI		CHIMAERA_URI"#off"
#define CHIMAERA_STATE_IDLE_URI		CHIMAERA_URI"#idle"

// dump uri
#define CHIMAERA_DUMP_URI					CHIMAERA_URI"#dump"

// plugin uris
#define CHIMAERA_FILTER_URI				CHIMAERA_URI"#filter"
#define CHIMAERA_MAPPER_URI				CHIMAERA_URI"#mapper"
#define CHIMAERA_CONTROL_OUT_URI	CHIMAERA_URI"#control_out"
#define CHIMAERA_MIDI_OUT_URI			CHIMAERA_URI"#midi_out"
#define CHIMAERA_OSC_OUT_URI			CHIMAERA_URI"#osc_out"
#define CHIMAERA_SIMULATOR_URI		CHIMAERA_URI"#simulator"
#define CHIMAERA_VISUALIZER_URI		CHIMAERA_URI"#visualizer"
#define CHIMAERA_COMM_URI					CHIMAERA_URI"#comm"

const LV2_Descriptor filter;
const LV2_Descriptor mapper;
const LV2_Descriptor control_out;
const LV2_Descriptor midi_out;
const LV2_Descriptor osc_out;
const LV2_Descriptor simulator;
const LV2_Descriptor visualizer;
const LV2_Descriptor comm;

// ui plugins uris
#if defined(CHIMAERA_UI_PLUGINS)
#	define CHIMAERA_SIMULATOR_EO_URI	CHIMAERA_URI"#simulator_eo"
#	define CHIMAERA_SIMULATOR_UI_URI	CHIMAERA_URI"#simulator_ui"
#	define CHIMAERA_SIMULATOR_X11_URI	CHIMAERA_URI"#simulator_x11"
#	define CHIMAERA_SIMULATOR_KX_URI	CHIMAERA_URI"#simulator_kx"

#	define CHIMAERA_VISUALIZER_EO_URI	CHIMAERA_URI"#visualizer_eo"
#	define CHIMAERA_VISUALIZER_UI_URI	CHIMAERA_URI"#visualizer_ui"
#	define CHIMAERA_VISUALIZER_X11_URI	CHIMAERA_URI"#visualizer_x11"
#	define CHIMAERA_VISUALIZER_KX_URI	CHIMAERA_URI"#visualizer_kx"

#	define CHIMAERA_COMM_EO_URI				CHIMAERA_URI"#comm_eo"
#	define CHIMAERA_COMM_UI_URI				CHIMAERA_URI"#comm_ui"
#	define CHIMAERA_COMM_X11_URI			CHIMAERA_URI"#comm_x11"
#	define CHIMAERA_COMM_KX_URI				CHIMAERA_URI"#comm_kx"

const LV2UI_Descriptor simulator_eo;
const LV2UI_Descriptor simulator_ui;
const LV2UI_Descriptor simulator_x11;
const LV2UI_Descriptor simulator_kx;

const LV2UI_Descriptor visualizer_eo;
const LV2UI_Descriptor visualizer_ui;
const LV2UI_Descriptor visualizer_x11;
const LV2UI_Descriptor visualizer_kx;

const LV2UI_Descriptor comm_eo;
const LV2UI_Descriptor comm_ui;
const LV2UI_Descriptor comm_x11;
const LV2UI_Descriptor comm_kx;
#endif

// bundle enums and structs
typedef enum _chimaera_state_t		chimaera_state_t;
typedef struct _chimaera_event_t	chimaera_event_t;
typedef struct _chimaera_obj_t		chimaera_obj_t;
typedef struct _chimaera_pack_t		chimaera_pack_t;
typedef struct _chimaera_dump_t		chimaera_dump_t;
typedef struct _chimaera_forge_t	chimaera_forge_t;
typedef struct _chimaera_dict_t		chimaera_dict_t;

enum _chimaera_state_t {
	CHIMAERA_STATE_ON		= 1,
	CHIMAERA_STATE_SET	= 2,
	CHIMAERA_STATE_OFF	= 4,
	CHIMAERA_STATE_IDLE	= 8
};

struct _chimaera_event_t {
	chimaera_state_t state;
	uint32_t sid;
	uint32_t gid;
	uint32_t pid;
	float x;
	float z;
	float X;<commit_msg>add extern keyword.<commit_after>/*
 * Copyright (c) 2015 <NAME> (<EMAIL>)
 *
 * This is free software: you can redistribute it and/or modify
 * it under the terms of the Artistic License 2.0 as published by
 * The Perl Foundation.
 *
 * This source is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * Artistic License 2.0 for more details.
 *
 * You should have received a copy of the Artistic License 2.0
 * along the source as a COPYING file. If not, obtain it from
 * http://www.perlfoundation.org/artistic_license_2_0.
 */

#ifndef _CHIMAERA_LV2_H
#define _CHIMAERA_LV2_H

#include <stdint.h>

#include <lv2/lv2plug.in/ns/lv2core/lv2.h>
#include <lv2/lv2plug.in/ns/ext/atom/atom.h>
#include <lv2/lv2plug.in/ns/ext/atom/util.h>
#include <lv2/lv2plug.in/ns/ext/atom/forge.h>
#include <lv2/lv2plug.in/ns/ext/urid/urid.h>
#include <lv2/lv2plug.in/ns/ext/midi/midi.h>
#include <lv2/lv2plug.in/ns/ext/state/state.h>
#include <lv2/lv2plug.in/ns/ext/worker/worker.h>
#include <lv2/lv2plug.in/ns/ext/patch/patch.h>
#include <lv2/lv2plug.in/ns/extensions/ui/ui.h>

#define _ATOM_ALIGNED __attribute__((aligned(8)))

// bundle uri
#define CHIMAERA_URI							"http://open-music-kontrollers.ch/lv2/chimaera"

// event uri
#define CHIMAERA_EVENT_URI				CHIMAERA_URI"#event"
#define CHIMAERA_COMM_URL_URI			CHIMAERA_URI"#commURL"
#define CHIMAERA_DATA_URL_URI			CHIMAERA_URI"#dataURL"

// state uris
#define CHIMAERA_STATE_ON_URI			CHIMAERA_URI"#on"
#define CHIMAERA_STATE_SET_URI		CHIMAERA_URI"#set"
#define CHIMAERA_STATE_OFF_URI		CHIMAERA_URI"#off"
#define CHIMAERA_STATE_IDLE_URI		CHIMAERA_URI"#idle"

// dump uri
#define CHIMAERA_DUMP_URI					CHIMAERA_URI"#dump"

// plugin uris
#define CHIMAERA_FILTER_URI				CHIMAERA_URI"#filter"
#define CHIMAERA_MAPPER_URI				CHIMAERA_URI"#mapper"
#define CHIMAERA_CONTROL_OUT_URI	CHIMAERA_URI"#control_out"
#define CHIMAERA_MIDI_OUT_URI			CHIMAERA_URI"#midi_out"
#define CHIMAERA_OSC_OUT_URI			CHIMAERA_URI"#osc_out"
#define CHIMAERA_SIMULATOR_URI		CHIMAERA_URI"#simulator"
#define CHIMAERA_VISUALIZER_URI		CHIMAERA_URI"#visualizer"
#define CHIMAERA_COMM_URI					CHIMAERA_URI"#comm"

extern const LV2_Descriptor filter;
extern const LV2_Descriptor mapper;
extern const LV2_Descriptor control_out;
extern const LV2_Descriptor midi_out;
extern const LV2_Descriptor osc_out;
extern const LV2_Descriptor simulator;
extern const LV2_Descriptor visualizer;
extern const LV2_Descriptor comm;

// ui plugins uris
#if defined(CHIMAERA_UI_PLUGINS)
#	define CHIMAERA_SIMULATOR_EO_URI	CHIMAERA_URI"#simulator_eo"
#	define CHIMAERA_SIMULATOR_UI_URI	CHIMAERA_URI"#simulator_ui"
#	define CHIMAERA_SIMULATOR_X11_URI	CHIMAERA_URI"#simulator_x11"
#	define CHIMAERA_SIMULATOR_KX_URI	CHIMAERA_URI"#simulator_kx"

#	define CHIMAERA_VISUALIZER_EO_URI	CHIMAERA_URI"#visualizer_eo"
#	define CHIMAERA_VISUALIZER_UI_URI	CHIMAERA_URI"#visualizer_ui"
#	define CHIMAERA_VISUALIZER_X11_URI	CHIMAERA_URI"#visualizer_x11"
#	define CHIMAERA_VISUALIZER_KX_URI	CHIMAERA_URI"#visualizer_kx"

#	define CHIMAERA_COMM_EO_URI				CHIMAERA_URI"#comm_eo"
#	define CHIMAERA_COMM_UI_URI				CHIMAERA_URI"#comm_ui"
#	define CHIMAERA_COMM_X11_URI			CHIMAERA_URI"#comm_x11"
#	define CHIMAERA_COMM_KX_URI				CHIMAERA_URI"#comm_kx"

extern const LV2UI_Descriptor simulator_eo;
extern const LV2UI_Descriptor simulator_ui;
extern const LV2UI_Descriptor simulator_x11;
extern const LV2UI_Descriptor simulator_kx;

extern const LV2UI_Descriptor visualizer_eo;
extern const LV2UI_Descriptor visualizer_ui;
extern const LV2UI_Descriptor visualizer_x11;
extern const LV2UI_Descriptor visualizer_kx;

extern const LV2UI_Descriptor comm_eo;
extern const LV2UI_Descriptor comm_ui;
extern const LV2UI_Descriptor comm_x11;
extern const LV2UI_Descriptor comm_kx;
#endif

// bundle enums and structs
typedef enum _chimaera_state_t		chimaera_state_t;
typedef struct _chimaera_event_t	chimaera_event_t;
typedef struct _chimaera_obj_t		chimaera_obj_t;
typedef struct _chimaera_pack_t		chimaera_pack_t;
typedef struct _chimaera_dump_t		chimaera_dump_t;
typedef struct _chimaera_forge_t	chimaera_forge_t;
typedef struct _chimaera_dict_t		chimaera_dict_t;

enum _chimaera_state_t {
	CHIMAERA_STATE_ON		= 1,
	CHIMAERA_STATE_SET	= 2,
	CHIMAERA_STATE_OFF	= 4,
	CHIMAERA_STATE_IDLE	= 8
};

struct _chimaera_event_t {
	chimaera_state_t state;
	uint32_t sid;
	uint32_t gid;
	uint32_t pid;
	float x;
	float z;
	float X;
{'fraction_non_alphanumeric': 0.07816377171215881, 'fraction_numerical': 0.019399954883825853, 'mean_word_length': 6.376871880199667, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3648727', 'n_tokens_mistral': 4063, 'n_tokens_neox': 3843, 'n_words': 705}