Skip to content

GuitarPrometheus::Project::Project

GuitarPrometheus::Project::Project

A user’s working state for one MusicXML arrangement. More…

#include <Project.h>

Public Classes

Name
structMergedSourceXml
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.
SourceFormatgetSourceFormat() const
Originating format of musicXmlGzip.
ProjectwithTrackBindings(std::vector< TrackBinding > trackBindings) const
Wither helpers: return a copy of this Project with one field replaced.
ProjectwithTempoOverrides(TempoOverrides tempoOverrides) const
ProjectwithExportConfig(ExportConfigData exportConfig) const
ProjectwithProfileOverrides(ProfileOverrides profileOverrides) const
ProjectwithMergedSources(std::vector< MergedSourceXml > mergedSources) const
ProjectwithMusicXml(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() const

function getSalt

const std::array< std::uint8_t, 8 > & getSalt() const

function getName

const std::string & getName() const

function getMusicXmlGzip

const juce::MemoryBlock & getMusicXmlGzip() const

The 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() const

The 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() const

function getTempoOverrides

const TempoOverrides & getTempoOverrides() const

function getExportConfig

const ExportConfigData & getExportConfig() const

function getProfileOverrides

const ProfileOverrides & getProfileOverrides() const

function getMergedSources

const std::vector< MergedSourceXml > & getMergedSources() const

Merged-in MusicXML payloads, in the order they were appended via addMusicXmlToProject.

Empty for projects that have never been merged.

function getSourceFormat

SourceFormat getSourceFormat() const

Originating 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
) const

Wither 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
) const

function withExportConfig

Project withExportConfig(
ExportConfigData exportConfig
) const

function withProfileOverrides

Project withProfileOverrides(
ProfileOverrides profileOverrides
) const

function withMergedSources

Project withMergedSources(
std::vector< MergedSourceXml > mergedSources
) const

function withMusicXml

Project withMusicXml(
juce::MemoryBlock musicXmlGzip,
std::string originalFilename
) const

Updated on 2026-05-29 at 07:39:52 +0000