Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Create command to place mark in score, with control over appearance (…
…extending named bookmark)
  • Loading branch information
Richard Shann committed Jul 13, 2014
1 parent 7151c12 commit 8444b37
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 14 deletions.
7 changes: 7 additions & 0 deletions actions/Default.commands
Expand Up @@ -6787,6 +6787,13 @@ before and after the LilyPond syntax. </_tooltip>
<_label>Chord Chart Staff</_label>
<_tooltip>Prints Chord symbols separated by bar lines. Repeats, time signatures and text are also printed for this staff.</_tooltip>
</row>
<row type="scheme">
<action>CustomRehearsalMark</action>
<after>RehearsalMark</after>
<menupath>/ObjectMenu/Directives/Markings</menupath>
<_label>Add Text/Rehearsal/Bookmark</_label>
<_tooltip>Inserts an arbitray mark in the score at the cursor. Any size, font, effect can be chosen. The text position can be dragged in the print view if needed.</_tooltip>
</row>
</map>
</merge>
</Denemo>
2 changes: 1 addition & 1 deletion actions/Default.shortcuts
Expand Up @@ -613,7 +613,7 @@
<bind>F9</bind>
</row>
<row>
<action>BookmarkNamed</action>
<action>CustomRehearsalMark</action>
<bind>Shft+F9</bind>
</row>
<row>
Expand Down
@@ -1,18 +1,21 @@
;;; CustomRehearsalMark
(let ((user-input CustomRehearsalMark::params) (tag "CustomRehearsalMark"))

(if (and (not user-input) (d-Directive-standalone? tag))
(set! user_input (d-DirectiveGet-standalone-data tag)))
(if (not user-input)
(set! user-input "X"))
(set! user-input (d-GetUserInputWithSnippets (_ "Custom Rehearsal/Text Mark") (_ "Give text to use for mark") user-input))
(if user-input ;in case the user pressed Escape do nothing
(let ((text (car user-input))(data (cdr user-input))(position (RadioBoxMenu (cons (_ "left") "left") (cons (_ "center") "center") (cons (_ "right") "right"))))
(let ((value CustomRehearsalMark::params) (tag "CustomRehearsalMark"))
(if (equal? value "edit")
(set! value #f))
(if (and (not value) (d-Directive-standalone? tag))
(set! value (d-DirectiveGet-standalone-data tag)))
(if (not value)
(set! value "X"))
(set! value (d-GetUserInputWithSnippets (_ "Custom Rehearsal/Text Mark") (_ "Give text to use for mark") value))
(if value ;in case the user pressed Escape do nothing
(let ((text (cdr value))(data (car value))(position (RadioBoxMenu (cons (_ "left") "left") (cons (_ "center") "center") (cons (_ "right") "right"))))
(d-Directive-standalone tag)
(d-DirectivePut-standalone-display tag text)
(d-DirectivePut-standalone-display tag data)
(d-DirectivePut-standalone-graphic tag "RehearsalMark")
(d-DirectivePut-standalone-gx tag 15)
(d-DirectivePut-standalone-postfix tag (string-append " \\once \\override Score.RehearsalMark #'self-alignment-X = #" position " \\mark \\markup {" text "}" ) )
(d-DirectivePut-standalone-grob tag "RehearsalMark")
(d-DirectivePut-standalone-minpixels tag 10)
(d-DirectivePut-standalone-minpixels tag 30)
(d-DirectivePut-standalone-data tag data)
(d-SetSaved #f)
(d-RefreshDisplay))))
Expand Down
3 changes: 2 additions & 1 deletion po/POTFILES.in
Expand Up @@ -673,6 +673,8 @@ actions/menus/ObjectMenu/Directives/Markings/BeatChange.scm
actions/menus/ObjectMenu/Directives/Markings/BeatChange.xml
actions/menus/ObjectMenu/Directives/Markings/BreathMark.scm
actions/menus/ObjectMenu/Directives/Markings/BreathMark.xml
actions/menus/ObjectMenu/Directives/Markings/CustomRehearsalMark.scm
actions/menus/ObjectMenu/Directives/Markings/CustomRehearsalMark.xml
actions/menus/ObjectMenu/Directives/Markings/DynamicText.scm
actions/menus/ObjectMenu/Directives/Markings/DynamicText.xml
actions/menus/ObjectMenu/Directives/Markings/FreeFermata.scm
Expand Down Expand Up @@ -1810,4 +1812,3 @@ actions/mxml2ly2denemo/import_nwctext.scm
actions/palettes.xml
actions/silex.scm
actions/Simple.scm
denemo.appdata.xml.in
1 change: 0 additions & 1 deletion po/POTFILES.skip
@@ -1,4 +1,3 @@
tools/cairo_svg2path.c
tools/generate_source.c
tools/menu.c
src/pathconfig.h

0 comments on commit 8444b37

Please sign in to comment.