diff --git a/CHANGELOG.md b/CHANGELOG.md index 05fddcc..09dca73 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] +### Changed +* Plugin version is now source from V mod file. + ## [0.1.2] - 2024-01-20 ### Changed * Using proper struct casting for event header when processing. diff --git a/src/main.v b/src/main.v index 0c49874..140aa25 100644 --- a/src/main.v +++ b/src/main.v @@ -1,11 +1,17 @@ import log +import v.vmod + +// Only need to change the mod file to update the version. +const manifest = vmod.decode(@VMOD_FILE) or { panic(err) } +const current_version = manifest.version + // Exposes the plugin to the host (DAW). +@[markused] +__global clap_entry = plugin_entry // This requires modification to `clap/entry.h`. // Remove "const" so you get: // CLAP_EXPORT extern clap_plugin_entry_t clap_entry; -@[markused] -__global clap_entry = plugin_entry fn init() { $if debug { diff --git a/src/setup.v b/src/setup.v index 219e778..5c656a2 100644 --- a/src/setup.v +++ b/src/setup.v @@ -13,7 +13,7 @@ const _plugin_descriptor = C.clap_plugin_descriptor_t{ id: _plugin_id.str name: c'CLAP V Hello World' vendor: c'MOFOSS' - version: c'0.1.0' + version: current_version.str description: c'MVP of a CLAP plugin in V.' // voidptr is to fix warning about const char**. features: voidptr(unsafe {