1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <string.h>
4
5 #include "general.h"
6 #include "fileoutput.h"
7
8 /*
9
10 Ringtone Tools - Copyright 2001-2005 Michael Kohn (mike@mikekohn.net)
11 This falls under the Kohnian license. Please read
12 it at http://ringtonetools.mikekohn.net/
13
14 This program is NOT opensourced. You may not use any part
15 of this program for your own software.
16
17 */
18
19 /* Samsung Older Models */
20
write_siemens_header(FILE * out,struct note_t * note)21 void write_siemens_header(FILE *out, struct note_t *note)
22 {
23 note->bytes=0;
24 }
25
write_siemens_note(FILE * out,struct note_t * note)26 void write_siemens_note(FILE *out, struct note_t *note)
27 {
28 char outchars[20];
29 char temp[20];
30
31 outchars[0]=0;
32
33 if (note->tone==0) strcpy(outchars,"P");
34 else
35 if (note->tone==1) strcpy(outchars,"C");
36 else
37 if (note->tone==2) strcpy(outchars,"Cis");
38 else
39 if (note->tone==3) strcpy(outchars,"D");
40 else
41 if (note->tone==4) strcpy(outchars,"Dis");
42 else
43 if (note->tone==5) strcpy(outchars,"E");
44 else
45 if (note->tone==6) strcpy(outchars,"F");
46 else
47 if (note->tone==7) strcpy(outchars,"Fis");
48 else
49 if (note->tone==8) strcpy(outchars,"G");
50 else
51 if (note->tone==9) strcpy(outchars,"Gis");
52 else
53 if (note->tone==10) strcpy(outchars,"A");
54 else
55 if (note->tone==11) strcpy(outchars,"Ais");
56 else
57 if (note->tone==12) strcpy(outchars,"H");
58 else
59 { strcpy(outchars,"0"); }
60
61 if (note->tone!=0)
62 {
63 sprintf(temp,"%d",(note->scale+1));
64 strcat(outchars,temp);
65 }
66
67 sprintf(temp,"(1/%d) ",1<<note->length);
68 strcat(outchars,temp);
69
70 fprintf(out,"%s",outchars);
71
72 note->bytes=note->bytes+strlen(outchars);
73
74 if (note->bytes>70)
75 {
76 fprintf(out,"\n");
77 note->bytes=0;
78 }
79 }
80
write_siemens_footer(FILE * out,struct note_t * note)81 void write_siemens_footer(FILE *out, struct note_t *note)
82 {
83 fprintf(out,"\n");
84 }
85
86
87