7 #include "nsmtracker.h"
9 #include "disk_root_proc.h"
10 #include "OS_disk_proc.h"
11 #include "disk_save_proc.h"
12 #include "visual_proc.h"
13 #include "player_proc.h"
16 void Save_Clean(char *filename
,struct Root
*theroot
){
21 dc
.file
=fopen(filename
,"w");
23 RError("Could not open file for writing.\n");
27 length1
=fprintf(dc
.file
,"RADIUM SONG\n");
28 length2
=fprintf(dc
.file
,"%f\n",DISKVERSION
);
30 if(length1
<0 || length2
<0){
31 RError("Could not write to file.\n");
43 RError("Problems writing to file.\n");
49 void SaveAs(struct Root
*theroot
){
55 filename
=GFX_GetSaveFileName(theroot
->song
->tracker_windows
,(ReqType
)0,"Select file to save","work:radiumsongs");
57 if( ! access(filename
,F_OK
)){
60 ! strcmp("yes",ret
) &&
65 theroot
->song
->tracker_windows
,
67 "File already exists, are you sure? (yes/no)"
70 if(!strcmp("no",ret
)) return;
73 Save_Clean(filename
,theroot
);
77 void Save(struct Root
*theroot
){
81 if(dc
.filename
==NULL
){
84 Save_Clean(dc
.filename
,theroot
);