v0.9.5 beta — full feature build ready for distribution

Core additions since initial commit:
- Platform-split MIDI (midi_linux.c / midi_windows.c)
- Patch system: save/load/scan, subdirectory navigation, favourites
- Config system: last MIDI device and CC mappings persisted to disk
- Custom embedded pixel font and sprite sheet (no loose asset files at runtime)
- Window icon embedded at runtime (SetWindowIcon) and in Windows .exe (windres)
- chdirToExeDir() in platform.c so double-click launch finds patches/ correctly
- About screen accessible from Master panel

UI polish:
- TITLE_BAR_H constant (20 px) — sprite buttons now fit inside title bars
- All title bar text, button overlay text, and close/active labels vertically centred
- Full-screen dim overlay computed from camera transform (no more partial coverage)
- Patch browser: folder navigation, breadcrumb title, 256-slot limit lifted

Build:
- Makefile auto-discovers sources; embeds sprites/font/icon via xxd rules
- Windows cross-compile: make PLATFORM=windows (mingw-w64 + windres)
- windows.h isolated in platform.c to avoid Rectangle/CloseWindow conflicts with raylib.h
- WIN_RES uses lazy = assignment so OBJ_DIR expands correctly for windres output path

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Anachronaut
2026-07-07 19:18:34 -04:00
parent 801ea22d3e
commit 75e0894ff8
70 changed files with 5910 additions and 237 deletions

View File

@@ -1,20 +1,52 @@
#ifndef MIDI_H
#define MIDI_H
#define _POSIX_C_SOURCE 200809L
#include <alsa/asoundlib.h>
#ifndef _WIN32
# define _POSIX_C_SOURCE 200809L
# include <alsa/asoundlib.h>
#endif
#include <stdatomic.h>
#include "synth.h"
#define MIDI_MAX_INPUTS 16
typedef struct {
int active;
float *valuePtr; // direct pointer into Synth for CC to write
float min, max; // CC 0 → min, CC 127 → max
int controlId; // stable UI control ID, used for persistence
} CcMapping;
typedef struct {
int client;
int port;
char clientName[64];
char portName[64];
} MidiInputInfo;
typedef struct {
#ifdef _WIN32
void *hMidiIn; // HMIDIIN; kept opaque to avoid including windows.h here
#else
snd_seq_t *seq;
int port;
int client;
Synth *synth; // pointer to the synth we'll drive with MIDI events
#endif
Synth *synth;
int connectedClient; // WinMM device index on Windows, ALSA client on Linux; -1 if not connected
int connectedPort; // always 0 on Windows, ALSA port on Linux
MidiInputInfo inputs[MIDI_MAX_INPUTS];
int inputCount;
atomic_int midiLearnMode; // 1 while waiting for CC wiggle
atomic_int midiLearnCC; // -1 or the CC number received
CcMapping ccMappings[128];
} MidiState;
int midiInit(MidiState *m, Synth *synth);
void midiListInputs(MidiState *m);
void midiConnect(MidiState *m, int srcClient, int srcPort);
void midiScanInputs(MidiState *m);
void midiDevConnect(MidiState *m, int srcClient, int srcPort);
void midiDevDisconnect(MidiState *m);
void midiClose(MidiState *m);
void *midiThread(void *arg);