GuitarPrometheus::Project::Project
GuitarPrometheus::Project::Project
A user’s working state for one MusicXML arrangement. More…
#include <Project.h>
Public Classes
| Name | |
|---|---|
| struct | MergedSourceXml A merged-in MusicXML payload kept alongside the project’s primary musicXmlGzip. |
Public Types
| Name | |
|---|---|
| using std::map< std::string, Profiles::ProfileFormState > | ProfileOverrides Construct a fully-populated project. |
Public Functions
| Name | |
|---|---|
| Project(juce::Uuid id, std::array< std::uint8_t, 8 > salt, std::string name, juce::MemoryBlock musicXmlGzip, std::string originalFilename, std::vector< TrackBinding > trackBindings, TempoOverrides tempoOverrides, ExportConfigData exportConfig, ProfileOverrides profileOverrides ={}, std::vector< MergedSourceXml > mergedSources ={}, SourceFormat sourceFormat =SourceFormat::MusicXml) | |
| const juce::Uuid & | getId() const |
| const std::array< std::uint8_t, 8 > & | getSalt() const |
| const std::string & | getName() const |
| const juce::MemoryBlock & | getMusicXmlGzip() const The gzip-compressed MusicXML bytes. |
| const std::string & | getOriginalFilename() const The user-visible MusicXML filename at project-creation time (e.g. |
| const std::vector< TrackBinding > & | getTrackBindings() const |
| const TempoOverrides & | getTempoOverrides() const |
| const ExportConfigData & | getExportConfig() const |
| const ProfileOverrides & | getProfileOverrides() const |
| const std::vector< MergedSourceXml > & | getMergedSources() const Merged-in MusicXML payloads, in the order they were appended via addMusicXmlToProject. |
| SourceFormat | getSourceFormat() const Originating format of musicXmlGzip. |
| Project | withTrackBindings(std::vector< TrackBinding > trackBindings) const Wither helpers: return a copy of this Project with one field replaced. |
| Project | withTempoOverrides(TempoOverrides tempoOverrides) const |
| Project | withExportConfig(ExportConfigData exportConfig) const |
| Project | withProfileOverrides(ProfileOverrides profileOverrides) const |
| Project | withMergedSources(std::vector< MergedSourceXml > mergedSources) const |
| Project | withMusicXml(juce::MemoryBlock musicXmlGzip, std::string originalFilename) const |
Detailed Description
class GuitarPrometheus::Project::Project;A user’s working state for one MusicXML arrangement.
Persisted as a .gpproj JSON file. Subsumes the MusicXML source (gzip-compressed inline), per-track profile picks, tempo overrides, and the export configuration so a single file fully reproduces an export.
Identity is the UUID; the salt + UUID derive a stable filename suffix so two projects with the same name don’t collide on disk. Immutable after construction (constructor-sink pattern, matching Profile).
musicXmlGzip is the raw gzip bytes — base64 encoding only happens at the JSON-serialization boundary, never in memory. Runtime decompression hands the bytes directly to MusicXmlParser::parse(std::string_view) via the F0.6 materializeScore helper.
Public Types Documentation
using ProfileOverrides
using GuitarPrometheus::Project::Project::ProfileOverrides = std::map<std::string , Profiles::ProfileFormState>;Construct a fully-populated project.
All collections are passed by value and moved into place.
Project-scoped profile overrides keyed by score-part-id.
When present and the part has a bound profile, the override layer wins for export — the bound profile is loaded by UUID, then applyProfileEdits rebuilds the profile from the override’s form state (so every field the override sets replaces the bound profile’s, while the bound profile’s identity is preserved). Empty / missing entries fall through to the bound profile.
Phase 10 F10.2 introduced this in schema v3 alongside a v2 -> v3 migration that adds an empty map to legacy projects.
Public Functions Documentation
function Project
Project( juce::Uuid id, std::array< std::uint8_t, 8 > salt, std::string name, juce::MemoryBlock musicXmlGzip, std::string originalFilename, std::vector< TrackBinding > trackBindings, TempoOverrides tempoOverrides, ExportConfigData exportConfig, ProfileOverrides profileOverrides ={}, std::vector< MergedSourceXml > mergedSources ={}, SourceFormat sourceFormat =SourceFormat::MusicXml)function getId
const juce::Uuid & getId() constfunction getSalt
const std::array< std::uint8_t, 8 > & getSalt() constfunction getName
const std::string & getName() constfunction getMusicXmlGzip
const juce::MemoryBlock & getMusicXmlGzip() constThe gzip-compressed MusicXML bytes.
To get the original XML, hand this to Midi::ProjectSerializer::decompressMusicXml or feed it through a juce::GZIPDecompressorInputStream.
function getOriginalFilename
const std::string & getOriginalFilename() constThe user-visible MusicXML filename at project-creation time (e.g.
“lesson-riff-v14.xml”). Stored for diagnostics + a future “Replace MusicXML…” affordance; not used for opening files.
function getTrackBindings
const std::vector< TrackBinding > & getTrackBindings() constfunction getTempoOverrides
const TempoOverrides & getTempoOverrides() constfunction getExportConfig
const ExportConfigData & getExportConfig() constfunction getProfileOverrides
const ProfileOverrides & getProfileOverrides() constfunction getMergedSources
const std::vector< MergedSourceXml > & getMergedSources() constMerged-in MusicXML payloads, in the order they were appended via addMusicXmlToProject.
Empty for projects that have never been merged.
function getSourceFormat
SourceFormat getSourceFormat() constOriginating format of musicXmlGzip.
Persisted to the project file so reopen knows which importer to use. Defaults to MusicXml for projects predating schema v5.
function withTrackBindings
Project withTrackBindings( std::vector< TrackBinding > trackBindings) constWither helpers: return a copy of this Project with one field replaced.
The 10-arg constructor remains the canonical sink, but every per-field call site forgets at least one argument eventually (see Phase 11 F11.6 fallout where mutators silently dropped mergedSources). The witers route through the constructor, preserve all other fields, and give each mutator a single-argument shape that’s hard to misuse.
function withTempoOverrides
Project withTempoOverrides( TempoOverrides tempoOverrides) constfunction withExportConfig
Project withExportConfig( ExportConfigData exportConfig) constfunction withProfileOverrides
Project withProfileOverrides( ProfileOverrides profileOverrides) constfunction withMergedSources
Project withMergedSources( std::vector< MergedSourceXml > mergedSources) constfunction withMusicXml
Project withMusicXml( juce::MemoryBlock musicXmlGzip, std::string originalFilename) constUpdated on 2026-05-29 at 07:39:52 +0000