Vixen
02b45cc4
csharp
public sealed class AudioMixerDocument

A mixer, open for editing: buses, sends, effects and snapshots.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

The format already existed and the panel did not, which is the shortest E5 row. MixerAsset is Vixen.Audio's own authoring layer — its remarks say why: "a sound designer who has to open a C# file to move a fader is a sound designer who does not move the fader" — and everything under it is a serialisable record with no file format attached. This document is the YAML end of that sentence and the undo stack over it.

⚠ Every number a person sees is in decibels and every number the mixer runs on is linear. That is MixerBusAsset's own decision and this editor does not second-guess it: the fields edit GainDb directly, and the one conversion happens where it always did, in MixerBuilder.

⚠ Validation is the real builder against a real mixer, not a second set of rules. Validate constructs an AudioMixer and runs Build over the document; what comes back is the list of problems a game would hit at load. An editor-side checker would be a second implementation of "is this mixer buildable" and the two would disagree the week either changed.

Fields and properties (5)

  • public const string Extension

    What a mixer is written as.

  • public string AssetPath

    Where the file is, absolute.

  • public MixerAsset Mixer

    The mixer.

  • public string? LoadError

    Why the file would not read, or .

  • public IReadOnlyList<string> Problems

    What the last Validate had to say.

Events (1)

Methods (15)

  • public AudioMixerDocument(EditorProject project, AssetId asset, string path)

    Opens a mixer.

  • public void Replace(string name, MixerAsset mixer)

    Replaces the mixer, undoably.

  • public void AddBus(string name, string parent = "")

    Adds a bus, undoably.

  • public void RemoveBus(string name)

    Removes a bus and everything pointing at it, undoably.

  • public void EditBus(string name, string bus, Func<MixerBusAsset, MixerBusAsset> change)

    Replaces one bus, undoably.

  • public void AddSend(string from, string to)

    Adds a send from one bus to another, undoably.

  • public void AddEffect(string bus, IAudioEffectAsset effect)

    Adds an effect to a bus's insert chain, undoably.

  • public void RemoveEffect(string bus, int index)

    Removes an effect by its position in the chain, undoably.

  • public void AddSnapshot(string name)

    Adds a snapshot, undoably.

  • public void RemoveSnapshot(string name)

    Removes a snapshot, undoably.

  • public void SetSnapshotBus(string snapshot, string bus, float gainDb, bool muted)

    Records what a snapshot does to a bus, undoably.

  • public void ClearSnapshotBus(string snapshot, string bus)

    Removes a bus's line from a snapshot, undoably.

  • public IReadOnlyList<string> Validate()

    Builds the mixer for real and keeps what the builder complained about.

  • public string ToYaml()

    The mixer as it would be written, without writing it.

  • protected override void SaveCore()

    Writes the document back to wherever it came from.

Used by (4)

  • AudioMixerEditorFactoryVixen.Editor.AssetEditors
  • AudioMixerViewVixen.Editor.AssetEditors
  • AudioMixerViewTestsVixen.Editor.AssetEditors.Tests
  • AuthoringTestsVixen.Editor.AssetEditors.Tests