1 /* 2 Rosegarden 3 A sequencer and musical notation editor. 4 Copyright 2000-2021 the Rosegarden development team. 5 See the AUTHORS file for more details. 6 7 This program is free software; you can redistribute it and/or 8 modify it under the terms of the GNU General Public License as 9 published by the Free Software Foundation; either version 2 of the 10 License, or (at your option) any later version. See the file 11 COPYING included with this distribution for more information. 12 */ 13 14 #include "base/BaseProperties.h" 15 #include <vector> 16 17 #include <sstream> 18 19 namespace Rosegarden 20 { 21 22 namespace BaseProperties 23 { 24 25 // Some of the most basic property names are defined in individual 26 // classes in NotationTypes.h -- those are the ones that are used to 27 // store the value of a clef/key/timesig event, whereas things like 28 // notes have their values calculated from the duration property. 29 30 // We mostly define persistent properties with lower-case names and 31 // non-persistent ones with mixed-case. That's just because lower- 32 // case looks nicer in XML, whereas mixed-case is friendlier for the 33 // sorts of long names sometimes found in cached calculations. 34 35 const PropertyName PITCH = "pitch"; 36 const PropertyName VELOCITY = "velocity"; 37 const PropertyName ACCIDENTAL = "accidental"; 38 39 const PropertyName NOTE_TYPE = "notetype"; 40 const PropertyName NOTE_DOTS = "notedots"; 41 42 const PropertyName MARK_COUNT = "marks"; 43 getMarkPropertyName(int markNo)44PropertyName getMarkPropertyName(int markNo) 45 { 46 static std::vector<PropertyName> firstFive; 47 48 if (firstFive.empty()) { 49 firstFive.push_back(PropertyName("mark1")); 50 firstFive.push_back(PropertyName("mark2")); 51 firstFive.push_back(PropertyName("mark3")); 52 firstFive.push_back(PropertyName("mark4")); 53 firstFive.push_back(PropertyName("mark5")); 54 } 55 56 if (markNo < 5) return firstFive[markNo]; 57 58 // This is slower than it looks, because it means we need to do 59 // the PropertyName interning process for each string -- hence the 60 // firstFive cache 61 62 std::stringstream markPropertyName; 63 64 markPropertyName << "mark" << (markNo + 1); 65 66 return markPropertyName.str(); 67 } 68 69 const PropertyName TIED_BACKWARD = "tiedback"; 70 const PropertyName TIED_FORWARD = "tiedforward"; 71 const PropertyName TIE_IS_ABOVE = "tieabove"; 72 73 // capitalised for back-compatibility (used to be in NotationProperties) 74 const PropertyName HEIGHT_ON_STAFF = "HeightOnStaff"; 75 const PropertyName NOTE_STYLE = "NoteStyle"; 76 const PropertyName BEAMED = "Beamed"; 77 78 const PropertyName BEAMED_GROUP_ID = "groupid"; 79 const PropertyName BEAMED_GROUP_TYPE = "grouptype"; 80 81 const PropertyName BEAMED_GROUP_TUPLET_BASE = "tupletbase"; 82 const PropertyName BEAMED_GROUP_TUPLED_COUNT = "tupledcount"; 83 const PropertyName BEAMED_GROUP_UNTUPLED_COUNT = "untupledcount"; 84 85 // persistent, but mixed-case anyway 86 const PropertyName IS_GRACE_NOTE = "IsGraceNote"; 87 88 // obsolete 89 const PropertyName HAS_GRACE_NOTES = "HasGraceNotes"; 90 91 // non-persistent 92 const PropertyName MAY_HAVE_GRACE_NOTES = "MayHaveGraceNotes"; 93 94 const std::string GROUP_TYPE_BEAMED = "beamed"; 95 const std::string GROUP_TYPE_TUPLED = "tupled"; 96 const std::string GROUP_TYPE_GRACE = "grace"; 97 98 const PropertyName TRIGGER_EXPAND = "trigger_expand"; 99 const PropertyName TRIGGER_EXPANSION_DEPTH = "trigger_expansion_depth"; 100 const PropertyName TRIGGER_SEGMENT_ID = "triggersegmentid"; 101 const PropertyName TRIGGER_SEGMENT_RETUNE = "triggersegmentretune"; 102 const PropertyName TRIGGER_SEGMENT_ADJUST_TIMES = "triggersegmentadjusttimes"; 103 104 const std::string TRIGGER_SEGMENT_ADJUST_NONE = "none"; 105 const std::string TRIGGER_SEGMENT_ADJUST_SQUISH = "squish"; 106 const std::string TRIGGER_SEGMENT_ADJUST_SYNC_START = "syncstart"; 107 const std::string TRIGGER_SEGMENT_ADJUST_SYNC_END = "syncend"; 108 109 const PropertyName RECORDED_CHANNEL = "recordedchannel"; 110 const PropertyName RECORDED_PORT = "recordedport"; 111 112 const PropertyName DISPLACED_X = "displacedx"; 113 const PropertyName DISPLACED_Y = "displacedy"; 114 115 const PropertyName INVISIBLE = "invisible"; 116 117 const PropertyName TMP = "temporary"; /// TODO : TMP -> REPEATING 118 const PropertyName LINKED_SEGMENT_IGNORE_UPDATE = "linkedsegmentignoreupdate"; 119 120 // indicates whether note is part of a parallel movement between two voices 121 const PropertyName MEMBER_OF_PARALLEL = "member_of_parallel"; 122 123 } 124 125 } 126 127