MUSX Document Model
Loading...
Searching...
No Matches
Playback.h
1/*
2 * Copyright (C) 2026, Robert Patterson
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a copy
5 * of this software and associated documentation files (the "Software"), to deal
6 * in the Software without restriction, including without limitation the rights
7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 * copies of the Software, and to permit persons to whom the Software is
9 * furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 * THE SOFTWARE.
21 */
22#pragma once
23
24#include <array>
25#include <memory>
26#include <string>
27#include <string_view>
28
29#include "BaseClasses.h"
30
31namespace musx {
32namespace dom {
33namespace others {
34
45{
46public:
48 explicit PlaybackRoute(const DocumentWeakPtr& document, Cmper partId, ShareMode shareMode, Cmper cmper)
49 : OthersBase(document, partId, shareMode, cmper) {}
50
52 std::string patchType;
53 int patch{};
56 std::string soundUuid;
57
58 constexpr static std::string_view XmlNodeName = "playbackRoute";
60};
61
73{
74public:
76 explicit PlaybackRouteName(const DocumentWeakPtr& document, Cmper partId, ShareMode shareMode, Cmper cmper)
77 : OthersBase(document, partId, shareMode, cmper) {}
78
79 std::string name;
80
81 constexpr static std::string_view XmlNodeName = "playbackRouteName";
83};
84
95{
96public:
102 {
103 Absolute,
104 Relative,
105 };
106
121
127 {
128 public:
130
133 std::shared_ptr<VelocityControl> velocityControl;
134 bool play{};
135 bool solo{};
136
139 { return static_cast<Cmper>(playbackRouteIndex + 1); }
140
142 };
143
145 explicit StaffPlayData(const DocumentWeakPtr& document, Cmper partId, ShareMode shareMode, Cmper cmper)
146 : OthersBase(document, partId, shareMode, cmper) {}
147
148 std::shared_ptr<PlaybackSettings> chords;
149 std::shared_ptr<PlaybackSettings> midiExpressions;
150 std::array<std::shared_ptr<PlaybackSettings>, MAX_LAYERS> layers;
151
152 constexpr static std::string_view XmlNodeName = "staffPlayData";
154};
155
156} // namespace others
157} // namespace dom
158} // namespace musx
EnigmaBase class for classes that are contained by other classes.
Definition BaseClasses.h:192
ContainedClassBase(const MusxInstance< EnigmaBase > &parent)
Constructs a ContainedClassBase object.
Definition BaseClasses.h:224
ShareMode
Describes how this instance is shared between part and score.
Definition BaseClasses.h:98
EnigmaBase class for all "others" types.
Definition BaseClasses.h:274
Contains the display name of a playback route.
Definition Playback.h:73
PlaybackRouteName(const DocumentWeakPtr &document, Cmper partId, ShareMode shareMode, Cmper cmper)
Constructor function.
Definition Playback.h:76
static constexpr std::string_view XmlNodeName
The XML node name for this type.
Definition Playback.h:81
static const xml::XmlElementArray< PlaybackRouteName > & xmlMappingArray()
Required for musx::factory::FieldPopulator.
std::string name
The playback route display name.
Definition Playback.h:79
Defines the playback destination assigned to one or more staff playback streams.
Definition Playback.h:45
int virtualChannel
The zero-based virtual MIDI channel. (xml node is <virtChannel>)
Definition Playback.h:51
std::string patchType
The encoding used for the MIDI bank and patch values.
Definition Playback.h:52
std::string soundUuid
The UUID of the sound assigned to the route. (xml node is <soundUUID>)
Definition Playback.h:56
Cmper percussionMapId
The percussion map reference ID. (xml node is <percMapRefID>)
Definition Playback.h:55
int midiBankSelectMostSignificantByte
The MIDI Bank Select most-significant-byte value. (xml node is <msb>)
Definition Playback.h:54
static constexpr std::string_view XmlNodeName
The XML node name for this type.
Definition Playback.h:58
PlaybackRoute(const DocumentWeakPtr &document, Cmper partId, ShareMode shareMode, Cmper cmper)
Constructor function.
Definition Playback.h:48
static const xml::XmlElementArray< PlaybackRoute > & xmlMappingArray()
Required for musx::factory::FieldPopulator.
int patch
The MIDI patch or program value.
Definition Playback.h:53
Defines the route and playback behavior for one staff playback stream.
Definition Playback.h:127
static const xml::XmlElementArray< PlaybackSettings > & xmlMappingArray()
Required for musx::factory::FieldPopulator.
int velocityControlLevel
The velocity-control level. (xml node is <velControlLevel>)
Definition Playback.h:132
Cmper getPlaybackRouteId() const
Returns the one-based cmper of the playback route referenced by playbackRouteIndex.
Definition Playback.h:138
bool solo
Whether this playback stream is soloed.
Definition Playback.h:135
std::shared_ptr< VelocityControl > velocityControl
The velocity-control behavior, if present. (xml node is <velControlSaveFlags>)
Definition Playback.h:133
bool play
Whether this playback stream is enabled.
Definition Playback.h:134
int playbackRouteIndex
Zero-based index of the route; the corresponding route cmper is this value plus one....
Definition Playback.h:131
Defines whether and how velocity control is applied to a playback stream.
Definition Playback.h:112
static const xml::XmlElementArray< VelocityControl > & xmlMappingArray()
Required for musx::factory::FieldPopulator.
VelocityControlFunction function
How the velocity-control level is applied.
Definition Playback.h:117
bool controlOn
Whether velocity control is enabled.
Definition Playback.h:116
Defines playback routing, velocity control, and enablement for a staff's playback streams.
Definition Playback.h:95
std::array< std::shared_ptr< PlaybackSettings >, MAX_LAYERS > layers
Playback settings for each supported notation layer.
Definition Playback.h:150
std::shared_ptr< PlaybackSettings > chords
Playback settings for chord symbols, if present.
Definition Playback.h:148
StaffPlayData(const DocumentWeakPtr &document, Cmper partId, ShareMode shareMode, Cmper cmper)
Constructor function.
Definition Playback.h:145
static constexpr std::string_view XmlNodeName
The XML node name for this type.
Definition Playback.h:152
VelocityControlFunction
Specifies how a playback stream's velocity-control level is applied.
Definition Playback.h:102
@ Relative
Adjusts the existing playback velocity by the configured level.
@ Absolute
Replaces the existing playback velocity with the configured level.
std::shared_ptr< PlaybackSettings > midiExpressions
Playback settings for MIDI expressions, if present.
Definition Playback.h:149
static const xml::XmlElementArray< StaffPlayData > & xmlMappingArray()
Required for musx::factory::FieldPopulator.
constexpr int MAX_LAYERS
The maximum number of music layers in a Finale document.
Definition Fundamentals.h:79
uint16_t Cmper
Enigma "comperator" key type.
Definition Fundamentals.h:57
std::weak_ptr< Document > DocumentWeakPtr
Shared weak Document pointer.
Definition DocumentElement.h:37
std::vector< XmlElementDescriptor< T > > XmlElementArray
an array type for XmlElementDescriptor instances.
Definition XmlInterface.h:133
object model for musx file (enigmaxml)
Definition BaseClasses.h:38