TempleOSCDV4.10.ISO

This commit is contained in:
Terry A. Davis authored and minexew committed 2018-09-08 21:47:44 +02:00
1 parent c5954d3371
commit 9206246147
181 files changed
+4468 -4313

No files matched your search

+2 -2
View File
@@ -32,7 +32,7 @@ Bool JBPutKey(CDoc *doc,U8 *,I64 ch,I64 sc)
if (StrLen(doc_ce->tag)>1)
doc_ce->tag[0]=ch;
s=DocRead(tempde->full_name);
doc_e=s->root.next;
doc_e=s->head.next;
while (doc_e!=s && doc_e->type_u8!=DOCT_TEXT)
doc_e=doc_e->next;
if (doc_e!=s && doc_e->type_u8==DOCT_TEXT && StrLen(doc_e->tag)>=3) {
@@ -77,7 +77,7 @@ public U0 JukeBox(U8 *dirname="~/Psalmody",U8 **_filename=NULL)
st=StrNew(tempde->name);
FileExtRem(st);
s=DocRead(tempde->full_name);
doc_e=s->root.next;
doc_e=s->head.next;
while (doc_e!=s && doc_e->type_u8!=DOCT_TEXT)
doc_e=doc_e->next;
rating='0';
+2 -2
View File
@@ -25,7 +25,7 @@ $WW,1$$WW,0$*/
#define NOTE_REST MIN_I64
#define OCTAVE_REST MIN_I64
#define PSMT_ROOT 0
#define PSMT_HEAD 0
#define PSMT_NOTE 1
#define PSMT_METER 2
@@ -59,7 +59,7 @@ class PsmNote
class PsmCtrl
{
PsmNote root;
PsmNote head;
PsmNote clipboard;
CMenuEntry *incomplete_entry,*record_entry;
I64 screen_x,
+8 -8
View File
@@ -88,8 +88,8 @@ Bool PsmIsDotted(I64 duration)
U0 PsmMarkSel(I64 x1,I64 x2,Bool sel)
{
PsmNote *tempo=oc.root.next;
while (tempo!=&oc.root) {
PsmNote *tempo=oc.head.next;
while (tempo!=&oc.head) {
if (sel) {
if (x1<=tempo->x<=x2)
tempo->flags|=PSMF_SEL;
@@ -150,12 +150,12 @@ U0 DrawTimeSignature(CDC *dc,I64 x,I64 y,I64 top,I64 bottom)
U0 PsmRecalcNoteXY()
{
F64 measure_len=4,measure_left=measure_len;
PsmNote *tempo=oc.root.next;
PsmNote *tempo=oc.head.next;
I64 x=8-oc.screen_x,note,octave;
while (TRUE) {
tempo->x=x;
tempo->y=50;
if (tempo==&oc.root)
if (tempo==&oc.head)
break;
else {
if (tempo->type!=PSMT_METER) {
@@ -215,8 +215,8 @@ U0 DrawIt(CTask *task,CDC *dc)
PsmRecalcNoteXY;
}
tempo=oc.root.next;
while (tempo!=&oc.root) {
tempo=oc.head.next;
while (tempo!=&oc.head) {
x=tempo->x;
y=tempo->y;
if (measure_left<0.001) {
@@ -258,11 +258,11 @@ U0 DrawIt(CTask *task,CDC *dc)
tempo=tempo->next;
}
if (oc.cur_note==&oc.root && PsmBlink)
if (oc.cur_note==&oc.head && PsmBlink)
dc->color=BROWN;
else
dc->color=BLACK;
Sprite3(dc,oc.root.x,50,0,$IB,"<12>",BI=12$);
Sprite3(dc,oc.head.x,50,0,$IB,"<12>",BI=12$);
}
#define PSM_NOTE_BOX_X 220
+23 -23
View File
@@ -14,24 +14,24 @@ PsmNote *PsmNoteCopy(PsmNote *tempo)
return tempo1;
}
U0 PsmSongDel(PsmNote *root)
U0 PsmSongDel(PsmNote *head)
{
PsmNote *tempo,*tempo1;
tempo=root->next;
while (tempo!=root) {
tempo=head->next;
while (tempo!=head) {
tempo1=tempo->next;
PsmNoteDel(tempo);
tempo=tempo1;
}
QueInit(root);
QueInit(head);
}
U0 PsmCutToClipboard()
{
PsmNote *tempo,*tempo1;
PsmSongDel(&oc.clipboard);
tempo=oc.root.next;
while (tempo!=&oc.root) {
tempo=oc.head.next;
while (tempo!=&oc.head) {
tempo1=tempo->next;
if (tempo->flags&PSMF_SEL) {
if (oc.cur_note==tempo)
@@ -59,8 +59,8 @@ U0 PsmCopyToClipboard()
{
PsmNote *tempo,*tempo1;
PsmSongDel(&oc.clipboard);
tempo=oc.root.next;
while (tempo!=&oc.root) {
tempo=oc.head.next;
while (tempo!=&oc.head) {
if (tempo->flags&PSMF_SEL) {
tempo->flags&=~PSMF_SEL;
tempo1=PsmNoteCopy(tempo);
@@ -72,10 +72,10 @@ U0 PsmCopyToClipboard()
PsmNote *PsmFindNote(I64 x,I64)
{
PsmNote *tempo=oc.root.next;
PsmNote *tempo=oc.head.next;
PsmRecalcNoteXY;
x+=PSM_NOTE_SPACING/2;
while (x>tempo->next->x && tempo!=&oc.root)
while (x>tempo->next->x && tempo!=&oc.head)
tempo=tempo->next;
return tempo;
}
@@ -129,7 +129,7 @@ U0 PsmLoadSongStr(U8 *st,I64 *psm_octave,F64 *psm_duration)
else
tempo1->meter_bottom=4;
PsmSetWidth(tempo1);
QueIns(tempo1,oc.root.last);
QueIns(tempo1,oc.head.last);
}
while (*st=='(') {
Bts(&tempo->flags,PSMf_TIE);
@@ -212,7 +212,7 @@ U0 PsmLoadSong(U8 *filename,I64 *psm_octave,F64 *psm_duration)
if (!StrCmp(cc->cur_str,"Play")) {
if (Lex(cc)=='(')
if (Lex(cc)==TK_STR) {
tempo=oc.root.last;
tempo=oc.head.last;
st=LexExtStr(cc);
PsmLoadSongStr(st,psm_octave,psm_duration);
if (cc->token==',') {
@@ -220,8 +220,8 @@ U0 PsmLoadSong(U8 *filename,I64 *psm_octave,F64 *psm_duration)
st=LexExtStr(cc);
do {
do tempo=tempo->next;
while (tempo!=&oc.root && tempo->type==PSMT_METER);
if (tempo!=&oc.root)
while (tempo!=&oc.head && tempo->type==PSMT_METER);
if (tempo!=&oc.head)
tempo->word=StrNew(st);
st+=StrLen(st)+1;
} while (*st);
@@ -254,10 +254,10 @@ U8 *PsmCvtSong()
I64 i,note,octave,last_octave,last_duration;
i=0;
tempo=oc.root.next;
tempo=oc.head.next;
last_octave=OCTAVE_REST;
last_duration=-1;
while (tempo!=&oc.root) {
while (tempo!=&oc.head) {
dst=&tempo->ascii;
if (tempo->type==PSMT_METER) {
*dst++='M';
@@ -313,8 +313,8 @@ U8 *PsmCvtSong()
st=MAlloc(i+1);
dst=st;
tempo=oc.root.next;
while (tempo!=&oc.root) {
tempo=oc.head.next;
while (tempo!=&oc.head) {
StrCpy(dst,tempo->ascii);
dst+=StrLen(tempo->ascii);
tempo=tempo->next;
@@ -338,8 +338,8 @@ U8 *PsmSaveSong(U8 *dirname,U8 *full_filename)
music.stacatto_factor=0.88*tempo_state.stacatto/TEMPO_RANGE+0.12;
has_words=FALSE;
tempo=oc.root.next;
while (tempo!=&oc.root) {
tempo=oc.head.next;
while (tempo!=&oc.head) {
if (PsmHasWords(tempo->word)) has_words=TRUE;
tempo=tempo->next;
}
@@ -361,10 +361,10 @@ U8 *PsmSaveSong(U8 *dirname,U8 *full_filename)
" while (!ScanKey) {\n"
"\tPlay(\"",music.tempo+0.0005,music.stacatto_factor+0.0005);
tempo=oc.root.next;
tempo=oc.head.next;
tempo1=tempo;
has_words=FALSE;
while (tempo!=&oc.root) {
while (tempo!=&oc.head) {
DocPrint(doc,"%s",tempo->ascii);
if (PsmHasWords(tempo->word)) has_words=TRUE;
if (tempo->type==PSMT_METER) {
@@ -373,7 +373,7 @@ U8 *PsmSaveSong(U8 *dirname,U8 *full_filename)
} else
two_measure_left-=psm_durations[tempo->duration];
tempo=tempo->next;
if (two_measure_left<0.001 && tempo!=&oc.root) {
if (two_measure_left<0.001 && tempo!=&oc.head) {
if (has_words) {
DocPrint(doc,"\",\n\t\t\"");
while (tempo1!=tempo) {
+32 -32
View File
@@ -32,7 +32,7 @@ U0 PsmRightClick(I64 x,I64 y)
I64 i,old_doc_flags;
if (DocPut) old_doc_flags=DocPut->flags;
oc.cur_note=tempo=PsmFindNote(x,y);
if (tempo!=&oc.root) {
if (tempo!=&oc.head) {
Fs->win_inhibit=WIG_USER_TASK_DFT;
i=PopUpDuration;
if (0<=i<PSM_NUM_DURATIONS) {
@@ -133,10 +133,10 @@ U0 PsmLeftClickPickNoteBox(I64 duration)
}
} while (msg_code!=MSG_IP_L_UP);
if (a2<13*FONT_HEIGHT) {
if (a1>oc.root.last->x)
tempo1=oc.root.last;
else if (a1<oc.root.next->x)
tempo1=&oc.root;
if (a1>oc.head.last->x)
tempo1=oc.head.last;
else if (a1<oc.head.next->x)
tempo1=&oc.head;
else
tempo1=PsmFindNote(a1-PSM_NOTE_SPACING/2,a2);
tempo=CAlloc(sizeof(PsmNote));
@@ -172,10 +172,10 @@ U0 PsmLeftClickPickMeterBox(I64 top,I64 bottom)
}
} while (msg_code!=MSG_IP_L_UP);
if (a2<13*FONT_HEIGHT) {
if (a1>=oc.root.x)
tempo1=oc.root.last;
else if (a1<oc.root.next->x)
tempo1=&oc.root;
if (a1>=oc.head.x)
tempo1=oc.head.last;
else if (a1<oc.head.next->x)
tempo1=&oc.head;
else
tempo1=PsmFindNote(a1-PSM_NOTE_SPACING/2,a2);
tempo=CAlloc(sizeof(PsmNote));
@@ -194,7 +194,7 @@ U0 PsmLeftClickStaffPtr(I64 x,I64 y)
PsmNote *tempo,*tempo1;
I64 o,n,msg_code,a1,a2,n_original,o_original;
oc.cur_note=tempo=PsmFindNote(x,y);
if (tempo!=&oc.root) {
if (tempo!=&oc.head) {
if (tempo->type==PSMT_NOTE) {
n_original=tempo->note;
o_original=tempo->octave;
@@ -202,7 +202,7 @@ U0 PsmLeftClickStaffPtr(I64 x,I64 y)
msg_code=GetMsg(&a1,&a2,1<<MSG_IP_L_UP|1<<MSG_IP_MOVE);
if (msg_code==MSG_IP_L_UP) {
tempo1=PsmFindNote(a1,a2);
if (tempo1==&oc.root || tempo1==tempo)
if (tempo1==&oc.head || tempo1==tempo)
goto move_note;
else {
Free(tempo1->word);
@@ -420,9 +420,9 @@ U0 Psalmody(U8 *dirname="~/Psalmody")
MemSet(&oc,0,sizeof(PsmCtrl));
oc.screen_x=0;
oc.root.next=oc.root.last=&oc.root;
oc.head.next=oc.head.last=&oc.head;
oc.clipboard.next=oc.clipboard.last=&oc.clipboard;
oc.cur_note=&oc.root;
oc.cur_note=&oc.head;
oc.dc2=DCAlias;
MenuPush(
@@ -569,29 +569,29 @@ mo_got_msg:
switch (a2.u8[0]) {
case SC_CURSOR_LEFT:
if (a2&SCF_CTRL) {
while (oc.cur_note->last!=&oc.root) {
while (oc.cur_note->last!=&oc.head) {
oc.cur_note=oc.cur_note->last;
if (oc.cur_note!=&oc.root)
if (oc.cur_note!=&oc.head)
LBEqu(&oc.cur_note->flags,PSMf_SEL,a2&SCF_SHIFT);
}
} else {
if (oc.cur_note->last!=&oc.root) {
if (oc.cur_note->last!=&oc.head) {
oc.cur_note=oc.cur_note->last;
if (oc.cur_note!=&oc.root)
if (oc.cur_note!=&oc.head)
LBEqu(&oc.cur_note->flags,PSMf_SEL,a2&SCF_SHIFT);
}
}
break;
case SC_CURSOR_RIGHT:
if (a2&SCF_CTRL) {
while (oc.cur_note!=&oc.root) {
if (oc.cur_note!=&oc.root)
while (oc.cur_note!=&oc.head) {
if (oc.cur_note!=&oc.head)
LBEqu(&oc.cur_note->flags,PSMf_SEL,a2&SCF_SHIFT);
oc.cur_note=oc.cur_note->next;
}
} else {
if (oc.cur_note!=&oc.root) {
if (oc.cur_note!=&oc.root)
if (oc.cur_note!=&oc.head) {
if (oc.cur_note!=&oc.head)
LBEqu(&oc.cur_note->flags,PSMf_SEL,a2&SCF_SHIFT);
oc.cur_note=oc.cur_note->next;
}
@@ -603,7 +603,7 @@ mo_got_msg:
else {
tempo=oc.cur_note;
oc.cur_note=tempo->next;
if (tempo!=&oc.root) {
if (tempo!=&oc.head) {
QueRem(tempo);
PsmNoteDel(tempo);
}
@@ -650,11 +650,11 @@ mo_got_msg:
oc.screen_x=0;
psm_duration=1.0;
psm_octave=3;
PsmSongDel(&oc.root);
oc.cur_note=&oc.root;
PsmSongDel(&oc.head);
oc.cur_note=&oc.head;
PsmLoadSong(filename,&psm_octave,&psm_duration);
oc.record_entry->checked=FALSE;
oc.cur_note=oc.root.next;
oc.cur_note=oc.head.next;
}
PsmPushMode(psm_octave);
col=0;
@@ -680,12 +680,12 @@ mo_got_msg:
filename=NULL;
psm_duration=1.0;
psm_octave=3;
PsmSongDel(&oc.root);
oc.cur_note=&oc.root;
PsmSongDel(&oc.head);
oc.cur_note=&oc.head;
oc.screen_x=0;
break;
case '\n':
if (oc.cur_note!=&oc.root)
if (oc.cur_note!=&oc.head)
PsmRightClick(oc.cur_note->x,oc.cur_note->y);
break;
case 'x':
@@ -695,7 +695,7 @@ mo_got_msg:
oc.playing=TRUE;
PsmMenu(psm_octave);
tempo=oc.cur_note;
while (tempo!=&oc.root) {
while (tempo!=&oc.head) {
if (tempo->type!=PSMT_METER) {
timeout_val=cnts.jiffies;
if (ip.pos_text.y-Fs->win_top<18)
@@ -748,7 +748,7 @@ mo_got_msg:
}
tempo=tempo->next;
}
oc.cur_note=&oc.root;
oc.cur_note=&oc.head;
oc.screen_x+=oc.cur_note->x-GR_WIDTH/2;
oc.playing=FALSE;
PsmMenu(psm_octave);
@@ -758,7 +758,7 @@ mo_got_msg:
break;
case CH_BACKSPACE:
tempo=oc.cur_note->last;
if (tempo!=&oc.root) {
if (tempo!=&oc.head) {
QueRem(tempo);
PsmNoteDel(tempo);
}
@@ -860,7 +860,7 @@ mo_done:
} catch
PutExcept;
PsmPopMode;
PsmSongDel(&oc.root);
PsmSongDel(&oc.head);
PsmSongDel(&oc.clipboard);
TempoDel(c);
Kill(play_task);