--Author: John Maxwell
--last modified: November 28, 1981 8:46 AM
DIRECTORY
MusicDefs: FROM "MusicDefs";
Piece: DEFINITIONS IMPORTS MusicDefs =
BEGIN
OPEN MusicDefs;
default:INTEGER = 1000;
AddSync:PROCEDURE[p:PiecePTR,s:SyncPTR];
CleanUpNotes:PROCEDURE[p:PiecePTR];
CleanUpSyncs:PROCEDURE[p:PiecePTR];
Copy:PROCEDURE[time1,time2:Time] RETURNS[PiecePTR];
Delete:PROCEDURE[begin,end:Time];
DeleteSync:PROCEDURE[s:SyncPTR];
Insert:PROCEDURE[begin:Time,new:PiecePTR]; -- new gets deleted when done
MaxToc:PROCEDURE[piece:PiecePTR,time1,time2:Time,duration:BOOLEAN] RETURNS[Time];
Merge:PROCEDURE[begin,end:Time,p:PiecePTR]; -- new gets deleted when done
NearestNote:PROCEDURE[x,y:INTEGER←default] RETURNS[NotePTR];
NearestObject:PROCEDURE[x,y:INTEGER←default] RETURNS[obj:ObjectType,p:UnspecifiedPTR];
NearestSync:PROCEDURE[p:PiecePTR,t:Time,notesOnly:BOOLEAN←FALSE] RETURNS[index:CARDINAL];
RemoveSync:PROCEDURE[p:PiecePTR,s:SyncPTR];
Replace:PROCEDURE[delete1,delete2,copy1,copy2:Time];
Sort:PROCEDURE[p:PiecePTR];
--INLINE Procedures
Length:PROCEDURE[p:PiecePTR] RETURNS[CARDINAL] = INLINE
{IF p=NIL THEN RETURN[0];
IF p=MusicDefs.score THEN RETURN[scoreLength];
FOR i:CARDINAL IN [0..maxPieceLength] DO
IF i=maxPieceLength THEN RETURN[i];
IF p[i]=NIL THEN RETURN[i];
ENDLOOP;
ERROR};
END..