[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Denemo-devel] Cut and Paste
From: |
Richard Shann |
Subject: |
[Denemo-devel] Cut and Paste |
Date: |
Thu, 19 Nov 2009 20:19:44 +0000 |
I have abandoned trying to get the paste routine written in C working.
Instead I have provided access to the copy buffer (or cutbuffer, the
same thing).
(d-GetNth n) returns the type of the n'th object that has been cut or
copied. These types are defined in denemo_types.h and automagically
available in scheme.
(d-PutNth n) inserts the n'th object at the cursor.
My sample code testing this is as follows:
;(define count -1)
(set! count (1+ count))
(let ( (type #f))
(set! type (d-GetNth count))
(cond
((= MEASUREBREAK type)
(d-InsertMeasureAfter))
((= CHORD type)
(d-PutNth count)))
(d-RefreshDisplay)
)
you first execute it with the ; removed to define count, and then put it
back so that subsequently count gets incremented, inserting only CHORD
type and creating a new measure for MEASUREBREAK type. It does not
handle STAFFBREAK type or any other type yet. All the types except the
two break types can be treated as a default case - ie like CHORD -
though we might want to be careful with TIMESIG type which would make no
sense in the middle of a measure.
I have included this bit of script to show where I am going.
This has been triggered by the latest bug report...
Richard
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Denemo-devel] Cut and Paste,
Richard Shann <=