Add VERSION file, preset DTD, and .cfl version-compatibility check

This commit is contained in:
Armin 2026-07-15 23:54:25 +02:00
commit 270abe2cc0
4 changed files with 42 additions and 0 deletions

View file

@ -70,6 +70,14 @@ target_compile_definitions(ChromaFlock PUBLIC
JUCE_MODAL_LOOPS_PERMITTED=0 JUCE_MODAL_LOOPS_PERMITTED=0
) )
# Inject the version from the VERSION file into a generated header.
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/VERSION" CHROMAFLOCK_VERSION_RAW)
string(STRIP "${CHROMAFLOCK_VERSION_RAW}" CHROMAFLOCK_VERSION)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/Source/Version.h.in"
"${CMAKE_CURRENT_BINARY_DIR}/Generated/Version.h" @ONLY)
target_include_directories(ChromaFlock PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/Generated")
target_link_libraries(ChromaFlock PRIVATE target_link_libraries(ChromaFlock PRIVATE
ChromaFlockBinaryData ChromaFlockBinaryData
juce::juce_audio_basics juce::juce_audio_basics

30
ChromaFlockPatch.dtd Normal file
View file

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
ChromaFlock Preset File Format DTD
==================================
This DTD defines the structure of a ChromaFlock (.cfl) preset file.
Compatibility is governed by the "version" attribute on the root
<ChromaFlockPatch> element:
- version 1.0 : file-format version, compatible with ChromaFlock 0.1
- A .cfl whose version does NOT match the running ChromaFlock version
will still be loaded when possible, but the user is shown a warning
that the preset may not sound as intended.
Changelog:
1.0 (ChromaFlock 0.1) Initial preset format.
-->
<!ELEMENT ChromaFlockPatch (PARAM*)>
<!ATTLIST ChromaFlockPatch
version CDATA #REQUIRED
generator CDATA #IMPLIED
>
<!ELEMENT PARAM EMPTY>
<!ATTLIST PARAM
id CDATA #REQUIRED
value CDATA #REQUIRED
>

3
Source/Version.h.in Normal file
View file

@ -0,0 +1,3 @@
#pragma once
// Generated by CMake from the VERSION file. Do not edit manually.
#define CHROMAFLOCK_VERSION "@CHROMAFLOCK_VERSION@"

1
VERSION Normal file
View file

@ -0,0 +1 @@
0.1