;;EndCadenzaTime
(let ((tag "EndCadenzaTime"))
    (define (insert-timesig time)
     (if (not (d-Directive-standalone? "ForceBarline"))
     	(d-ForceBarline))
      (d-HideTimesig 'unconditional)
      (d-DirectivePut-timesig-prefix tag  "\\cadenzaOff " )
      (d-DirectivePut-timesig-gy tag -15)
      (d-DirectivePut-timesig-gx tag -5)
      (d-DirectivePut-timesig-display tag (_ "End Cad."))
      (d-DirectivePut-timesig-graphic tag "\nT\nSerif\n40\nbold\nitalic"))
    (if (d-Directive-timesig? tag)
            (d-InfoDialog (_ "Inserts a time signature to resume normal measured music."))
	    (begin
	    	(if (not (ZeroDurationMeasure?))
	    		(d-AddMeasure))
		(d-InsertTimeSig)
		(GoToMeasureBeginning)
		(if (Timesignature?)
		    (let ((time (d-GetPrevailingTimesig)))
		        (d-PushPosition)
		        (while (d-MoveToStaffUp))
		         (insert-timesig time)
		        (while (d-MoveToStaffDown) (insert-timesig time))
		        (d-PopPosition)
		        (d-SetSaved #f))))))

