Phase 20: package Linux builds and document release and maintenance workflows
This commit is contained in:
parent
6b85f28add
commit
830b6e1914
22 changed files with 490 additions and 17 deletions
|
|
@ -1,4 +1,5 @@
|
|||
#include "xtc/xtc.h"
|
||||
#include "../plugin/config.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
|
|
@ -73,3 +74,15 @@ void xtc_app_destroy(xtc_app *app)
|
|||
{
|
||||
free(app);
|
||||
}
|
||||
|
||||
unsigned int xtc_build_features(void)
|
||||
{
|
||||
unsigned int features = 0;
|
||||
#ifdef XTC_HAVE_JACK
|
||||
features |= XTC_FEATURE_JACK;
|
||||
#endif
|
||||
#ifdef XTC_HAVE_LADSPA
|
||||
features |= XTC_FEATURE_LADSPA;
|
||||
#endif
|
||||
return features;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
#include <exception>
|
||||
#include "main_window.hpp"
|
||||
#include "xtc/xtc_version.h"
|
||||
#include "xtc/xtc.h"
|
||||
#include <cstring>
|
||||
|
||||
/**
|
||||
|
|
@ -19,9 +20,16 @@ int main(int argc, char **argv)
|
|||
std::printf("%s %s\n", XTC_PROJECT_NAME, XTC_VERSION_STRING);
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
if (argc == 2 && !std::strcmp(argv[1], "--diagnose")) {
|
||||
unsigned int features = xtc_build_features();
|
||||
std::printf("xtc %s; project formats 1..%u; JACK %s; LADSPA %s\nFor limits and recovery commands run xtc-check --diagnose/--help.\n",
|
||||
XTC_VERSION_STRING,XTC_PROJECT_FORMAT_VERSION,features & XTC_FEATURE_JACK ? "compiled" : "disabled",
|
||||
features & XTC_FEATURE_LADSPA ? "compiled" : "disabled");
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
if (argc == 2 && !std::strcmp(argv[1], "--help")) {
|
||||
std::puts(
|
||||
"Usage: xtc [PROJECT] or xtc [FLTK options]\n--version and --help work without a display or audio server.");
|
||||
"Usage: xtc [PROJECT] or xtc [FLTK options]\n--version, --diagnose and --help work without a display or audio server.");
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
const char *project_path = nullptr;
|
||||
|
|
|
|||
16
src/main.c
16
src/main.c
|
|
@ -6,6 +6,8 @@
|
|||
#include <string.h>
|
||||
#include "xtc/xtc_project.h"
|
||||
#include "xtc/xtc_audio.h"
|
||||
#include "xtc/xtc_midi.h"
|
||||
#include <limits.h>
|
||||
|
||||
/**
|
||||
* @brief Runs the xtc-check command-line entry point.
|
||||
|
|
@ -25,8 +27,18 @@ int main(int argc, char **argv)
|
|||
printf("%s %s\n", XTC_PROJECT_NAME, XTC_VERSION_STRING);
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
if (argc == 2 && !strcmp(argv[1], "--diagnose")) {
|
||||
unsigned int features = xtc_build_features();
|
||||
printf("xtc %s; %zu-bit process\nProject formats: 1..%u\nJACK compiled: %s\nLADSPA compiled: %s\n"
|
||||
"Limits: 256 graph nodes (64/project), %u tracks, %u clips, %u notes, 65536 frames/block\n"
|
||||
"No server, device or plugin probed. Runtime errors appear in GUI status/stderr.\n",
|
||||
XTC_VERSION_STRING,sizeof(void *)*CHAR_BIT,XTC_PROJECT_FORMAT_VERSION,
|
||||
features & XTC_FEATURE_JACK ? "yes" : "no",features & XTC_FEATURE_LADSPA ? "yes" : "no",
|
||||
XTC_PROJECT_MAX_TRACKS,XTC_PROJECT_MAX_CLIPS,XTC_PROJECT_MAX_NOTES);
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
if (argc == 2 && !strcmp(argv[1], "--help")) {
|
||||
puts("Usage: xtc-check [--version | --help | --validate PROJECT | --recover-recording TEMP NEW.wav]\nNo arguments checks core startup/shutdown. "
|
||||
puts("Usage: xtc-check [--version | --help | --diagnose | --validate PROJECT | --recover-recording TEMP NEW.wav]\nNo arguments checks core startup/shutdown. "
|
||||
"Validation checks metadata only.");
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
|
@ -54,7 +66,7 @@ int main(int argc, char **argv)
|
|||
return EXIT_SUCCESS;
|
||||
}
|
||||
if (argc != 1) {
|
||||
fputs("Usage: xtc-check [--version | --help | --validate PROJECT | --recover-recording TEMP NEW.wav]\n", stderr);
|
||||
fputs("Usage: xtc-check [--version | --help | --diagnose | --validate PROJECT | --recover-recording TEMP NEW.wav]\n", stderr);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -193,7 +193,7 @@ static xtc_result read_project(reader *input, xtc_project *project, const char *
|
|||
xtc_graph *graph = project->graph;
|
||||
READ("XTC_PROJECT", 2U);
|
||||
NUM(1U, version);
|
||||
if (version < 1U || version > 7U)
|
||||
if (version < 1U || version > XTC_PROJECT_FORMAT_VERSION)
|
||||
return XTC_ERR_UNSUPPORTED;
|
||||
format_version = version;
|
||||
READ("APP", 4U);
|
||||
|
|
@ -448,8 +448,8 @@ static xtc_result write_project(FILE *file, const xtc_project *project, const ch
|
|||
return XTC_ERR_UNSUPPORTED;
|
||||
if (sizeof(float) != sizeof(uint32_t) || FLT_RADIX != 2 || FLT_MANT_DIG != 24 || FLT_MAX_EXP != 128)
|
||||
return XTC_ERR_UNSUPPORTED;
|
||||
if (fprintf(file, "XTC_PROJECT 7\nAPP %d %d %d\nTEMPO %u\nIDS %" PRIu64 " %" PRIu64 "\nGRAPH %d %zu %zu %zu\n",
|
||||
XTC_VERSION_MAJOR, XTC_VERSION_MINOR, XTC_VERSION_PATCH, project->tempo, project->next_track_id,
|
||||
if (fprintf(file, "XTC_PROJECT %u\nAPP %d %d %d\nTEMPO %u\nIDS %" PRIu64 " %" PRIu64 "\nGRAPH %d %zu %zu %zu\n",
|
||||
XTC_PROJECT_FORMAT_VERSION, XTC_VERSION_MAJOR, XTC_VERSION_MINOR, XTC_VERSION_PATCH, project->tempo, project->next_track_id,
|
||||
project->next_clip_id, graph->require_output_nodes, graph->next_id, graph->node_count,
|
||||
graph->edge_count) < 0)
|
||||
return XTC_ERR_IO;
|
||||
|
|
@ -582,7 +582,11 @@ xtc_result xtc_project_load(xtc_project *project, const char *path)
|
|||
input.file = fopen(path, "rb");
|
||||
if (input.file == NULL)
|
||||
return XTC_ERR_IO;
|
||||
directory = project_folder(path);
|
||||
{
|
||||
char *canonical = realpath(path,NULL);
|
||||
directory = canonical ? project_folder(canonical) : NULL;
|
||||
free(canonical);
|
||||
}
|
||||
if (!directory) { fclose(input.file); return XTC_ERR_IO; }
|
||||
result = xtc_project_create(&candidate);
|
||||
if (result == XTC_OK)
|
||||
|
|
|
|||
8
src/plugin/config.h
Normal file
8
src/plugin/config.h
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
#ifndef XTC_PLUGIN_CONFIG_H
|
||||
#define XTC_PLUGIN_CONFIG_H
|
||||
#ifdef __has_include
|
||||
#if __has_include(<ladspa.h>) && !defined(XTC_DISABLE_LADSPA)
|
||||
#define XTC_HAVE_LADSPA 1
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
|
@ -8,11 +8,7 @@
|
|||
#include <stdio.h>
|
||||
/* Header-only optional dependency; absent development header gives explicit
|
||||
* unsupported stubs, preserving metadata-only load/save of plugin documents. */
|
||||
#ifdef __has_include
|
||||
#if __has_include(<ladspa.h>) && !defined(XTC_DISABLE_LADSPA)
|
||||
#define XTC_HAVE_LADSPA 1
|
||||
#endif
|
||||
#endif
|
||||
#include "config.h"
|
||||
static int terminated(const char *s, size_t n) { return memchr(s, 0, n) != NULL; }
|
||||
xtc_result xtc_plugin_spec_validate(const xtc_plugin_spec *s)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue