MUSX Document Model
Loading...
Searching...
No Matches
PseudoTieUtils.h
1/*
2 * Copyright (C) 2025, 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 <optional>
25
26#include "musx/dom/Fundamentals.h"
27#include "musx/dom/MusxInstance.h"
28
29namespace musx {
30namespace dom {
31enum class KnownShapeDefType;
32
33namespace others {
34class ShapeDef;
35} // namespace others
36} // namespace dom
37
38namespace utils {
39
45enum class PseudoTieMode
46{
47 LaissezVibrer,
48 TieEnd
49};
50
51
62
68[[nodiscard]] bool calcIsPseudoBackwardTie(dom::Evpu startOffset, dom::Evpu endOffset);
69
75[[nodiscard]] bool calcIsPseudoForwardTie(dom::Evpu startOffset, dom::Evpu endOffset);
76
77} // namespace utils
78} // namespace musx
KnownShapeDefType
Enumerates the shape types we can recognize semantically.
Definition ShapeDesigner.h:39
std::shared_ptr< const T > MusxInstance
Defines the type of a musx instance stored in a pool.
Definition MusxInstance.h:39
int32_t Evpu
EVPU value (288 per inch)
Definition Fundamentals.h:57
object model for musx file (enigmaxml)
Definition BaseClasses.h:36
Information about a shape that could be used as a surrogate for a tie.
Definition PseudoTieUtils.h:55
dom::Evpu calcWidthOffset() const
Returns the signed width offset for this shape, falling back to a one-space offset.
Definition PseudoTieUtils.cpp:47
dom::KnownShapeDefType shapeType
The recognized shape category (e.g., SlurTieCurveRight/Left).
Definition PseudoTieUtils.h:57
dom::MusxInstance< dom::others::ShapeDef > shape
The resolved shape definition.
Definition PseudoTieUtils.h:56