1
0
Fork 0
forked from hanez/xtc

Initial commit.

This commit is contained in:
Johannes Findeisen 2026-10-26 22:51:25 +01:00
commit 1d8f869b5b
39 changed files with 1671 additions and 0 deletions

26
include/xtlite/xtlite.h Normal file
View file

@ -0,0 +1,26 @@
#ifndef XTLITE_H
#define XTLITE_H
#include "xtlite_types.h"
#ifdef __cplusplus
extern "C" {
#endif
#define XTLITE_VERSION_MAJOR 0
#define XTLITE_VERSION_MINOR 1
#define XTLITE_VERSION_PATCH 0
typedef struct xt_app xt_app;
/* Creates an application context. On success, *out_app is caller-owned. */
xt_result xt_app_create(xt_app **out_app);
/* Destroys an application context; NULL is accepted. */
void xt_app_destroy(xt_app *app);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -0,0 +1,44 @@
#ifndef XTLITE_ENGINE_H
#define XTLITE_ENGINE_H
#include "xtlite_types.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct xt_graph xt_graph;
typedef enum {
XT_SIGNAL_AUDIO = 1,
XT_SIGNAL_EVENT = 2,
XT_SIGNAL_CONTROL = 3
} xt_signal_type;
typedef enum {
XT_PORT_INPUT = 1,
XT_PORT_OUTPUT = 2
} xt_port_direction;
typedef struct {
float *samples;
size_t frame_count;
size_t channel_count;
} xt_audio_buffer;
/* Graph API is intentionally small in this first scaffold. */
xt_result xt_graph_create(size_t max_nodes, xt_graph **out_graph);
void xt_graph_destroy(xt_graph *graph);
xt_result xt_graph_add_gain(xt_graph *graph, float gain, size_t *out_node_id);
xt_result xt_graph_connect(xt_graph *graph, size_t source_node,
size_t destination_node);
xt_result xt_graph_validate(const xt_graph *graph);
xt_result xt_graph_process_offline(xt_graph *graph, const float *input,
float *output, size_t frame_count,
float input_gain);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -0,0 +1,22 @@
#ifndef XTLITE_PROJECT_H
#define XTLITE_PROJECT_H
#include "xtlite_types.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct xt_project xt_project;
/* Project persistence is not implemented in this scaffold yet. */
xt_result xt_project_create(xt_project **out_project);
void xt_project_destroy(xt_project *project);
xt_result xt_project_save(const xt_project *project, const char *path);
xt_result xt_project_load(xt_project *project, const char *path);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -0,0 +1,29 @@
#ifndef XTLITE_TYPES_H
#define XTLITE_TYPES_H
#include <stddef.h>
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef enum {
XT_OK = 0,
XT_ERR_INVALID_ARGUMENT,
XT_ERR_OUT_OF_MEMORY,
XT_ERR_NOT_FOUND,
XT_ERR_INVALID_STATE,
XT_ERR_IO,
XT_ERR_UNSUPPORTED,
XT_ERR_CAPACITY,
XT_ERR_GRAPH_CYCLE
} xt_result;
const char *xt_result_string(xt_result result);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -0,0 +1,7 @@
#ifndef XTLITE_VERSION_H
#define XTLITE_VERSION_H
#define XTLITE_VERSION_STRING "0.1.0"
#define XTLITE_PROJECT_NAME "xtlite"
#endif