summaryrefslogtreecommitdiffabout
path: root/gammu/emb/common/service/gsmring.h
Unidiff
Diffstat (limited to 'gammu/emb/common/service/gsmring.h') (more/less context) (ignore whitespace changes)
-rw-r--r--gammu/emb/common/service/gsmring.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/gammu/emb/common/service/gsmring.h b/gammu/emb/common/service/gsmring.h
index 207cf31..2d2dd7a 100644
--- a/gammu/emb/common/service/gsmring.h
+++ b/gammu/emb/common/service/gsmring.h
@@ -75,111 +75,113 @@ typedef enum {
75 DoubleDottedNote = 0x02<<6, 75 DoubleDottedNote = 0x02<<6,
76 Length_2_3 = 0x03<<6 76 Length_2_3 = 0x03<<6
77} GSM_RingNoteDurationSpec; 77} GSM_RingNoteDurationSpec;
78 78
79typedef enum { 79typedef enum {
80 Scale_55 = 1, /* 55 Hz for note A */ 80 Scale_55 = 1, /* 55 Hz for note A */
81 Scale_110, /* 110 Hz for note A */ 81 Scale_110, /* 110 Hz for note A */
82 Scale_220, 82 Scale_220,
83 Scale_440, /* first scale for Nokia */ 83 Scale_440, /* first scale for Nokia */
84 Scale_880, 84 Scale_880,
85 Scale_1760, 85 Scale_1760,
86 Scale_3520, /* last scale for Nokia */ 86 Scale_3520, /* last scale for Nokia */
87 Scale_7040, 87 Scale_7040,
88 Scale_14080 88 Scale_14080
89} GSM_RingNoteScale; 89} GSM_RingNoteScale;
90 90
91typedef struct { 91typedef struct {
92 GSM_RingNoteDuration Duration; 92 GSM_RingNoteDuration Duration;
93 GSM_RingNoteDurationSpec DurationSpec; 93 GSM_RingNoteDurationSpec DurationSpec;
94 GSM_RingNoteNote Note; 94 GSM_RingNoteNote Note;
95 GSM_RingNoteStyle Style; 95 GSM_RingNoteStyle Style;
96 GSM_RingNoteScale Scale; 96 GSM_RingNoteScale Scale;
97 int Tempo; 97 int Tempo;
98} GSM_RingNote; 98} GSM_RingNote;
99 99
100typedef enum { 100typedef enum {
101 RING_Note = 1, 101 RING_Note = 1,
102 RING_EnableVibra, 102 RING_EnableVibra,
103 RING_DisableVibra, 103 RING_DisableVibra,
104 RING_EnableLight, 104 RING_EnableLight,
105 RING_DisableLight, 105 RING_DisableLight,
106 RING_EnableLED, 106 RING_EnableLED,
107 RING_DisableLED, 107 RING_DisableLED,
108 RING_Repeat 108 RING_Repeat
109} GSM_RingCommandType; 109} GSM_RingCommandType;
110 110
111typedef struct { 111typedef struct {
112 GSM_RingCommandType Type; 112 GSM_RingCommandType Type;
113 GSM_RingNote Note; 113 GSM_RingNote Note;
114 unsigned char Value; 114 unsigned char Value;
115} GSM_RingCommand; 115} GSM_RingCommand;
116 116
117typedef struct { 117typedef struct {
118 int NrCommands; 118 int NrCommands;
119 GSM_RingCommand Commands[MAX_RINGTONE_NOTES]; 119 GSM_RingCommand Commands[MAX_RINGTONE_NOTES];
120 bool AllNotesScale; 120 bool AllNotesScale;
121} GSM_NoteRingtone; 121} GSM_NoteRingtone;
122 122
123/* FIXME: should use BinaryTone instead? */
123/* Structure to hold Nokia binary ringtones. */ 124/* Structure to hold Nokia binary ringtones. */
124typedef struct { 125typedef struct {
125 unsigned char Frame[30000]; 126 unsigned char Frame[50000];
126 int Length; 127 int Length;
127} GSM_NokiaBinaryRingtone; 128} GSM_NokiaBinaryRingtone;
128 129
129typedef struct { 130typedef struct {
130 unsigned char *Frame; 131 unsigned char *Buffer;
131 int Length; 132 int Length;
132} GSM_BinaryTone; 133} GSM_BinaryTone;
133 134
134typedef enum { 135typedef enum {
135 RING_NOTETONE = 1, 136 RING_NOTETONE = 1,
136 RING_NOKIABINARY, 137 RING_NOKIABINARY,
137 RING_MIDI 138 RING_MIDI,
139 RING_MMF
138} GSM_RingtoneFormat; 140} GSM_RingtoneFormat;
139 141
140/** 142/**
141 * Structure for saving various ringtones formats 143 * Structure for saving various ringtones formats
142 */ 144 */
143typedef struct { 145typedef struct {
144 /** 146 /**
145 * Ringtone saved in one of three formats 147 * Ringtone saved in one of three formats
146 */ 148 */
147 GSM_NokiaBinaryRingtone NokiaBinary; 149 GSM_NokiaBinaryRingtone NokiaBinary;
148 GSM_BinaryTone BinaryTone; 150 GSM_BinaryTone BinaryTone;
149 GSM_NoteRingtone NoteTone; 151 GSM_NoteRingtone NoteTone;
150 /** 152 /**
151 * Ringtone format 153 * Ringtone format
152 */ 154 */
153 GSM_RingtoneFormat Format; 155 GSM_RingtoneFormat Format;
154 /** 156 /**
155 * Ringtone name 157 * Ringtone name
156 */ 158 */
157 char Name[20*2]; 159 char Name[20*2];
158 /** 160 /**
159 * Ringtone location 161 * Ringtone location
160 */ 162 */
161 int Location; 163 int Location;
162} GSM_Ringtone; 164} GSM_Ringtone;
163 165
164typedef struct { 166typedef struct {
165 int Group;//Nokia specific 167 int Group;//Nokia specific
166 int ID; 168 int ID;
167 char Name[30*2]; 169 char Name[30*2];
168} GSM_RingtoneInfo; 170} GSM_RingtoneInfo;
169 171
170typedef struct { 172typedef struct {
171 int Number; 173 int Number;
172 GSM_RingtoneInfo Ringtone[100]; 174 GSM_RingtoneInfo Ringtone[100];
173} GSM_AllRingtonesInfo; 175} GSM_AllRingtonesInfo;
174 176
175GSM_Error GSM_SaveRingtoneFile(char *FileName, GSM_Ringtone *ringtone); 177GSM_Error GSM_SaveRingtoneFile(char *FileName, GSM_Ringtone *ringtone);
176GSM_Error GSM_ReadRingtoneFile(char *FileName, GSM_Ringtone *ringtone); 178GSM_Error GSM_ReadRingtoneFile(char *FileName, GSM_Ringtone *ringtone);
177 179
178void saveott(FILE *file, GSM_Ringtone *ringtone); 180void saveott(FILE *file, GSM_Ringtone *ringtone);
179void savemid(FILE *file, GSM_Ringtone *ringtone); 181void savemid(FILE *file, GSM_Ringtone *ringtone);
180void saverng(FILE *file, GSM_Ringtone *ringtone); 182void saverng(FILE *file, GSM_Ringtone *ringtone);
181void saveimelody(FILE *file, GSM_Ringtone *ringtone); 183void saveimelody(FILE *file, GSM_Ringtone *ringtone);
182GSM_Error savewav(FILE *file, GSM_Ringtone *ringtone); 184GSM_Error savewav(FILE *file, GSM_Ringtone *ringtone);
183GSM_Error saverttl(FILE *file, GSM_Ringtone *ringtone); 185GSM_Error saverttl(FILE *file, GSM_Ringtone *ringtone);
184 186
185 unsigned char GSM_EncodeNokiaRTTLRingtone(GSM_Ringtone ringtone, unsigned char *package, int *maxlength); 187 unsigned char GSM_EncodeNokiaRTTLRingtone(GSM_Ringtone ringtone, unsigned char *package, int *maxlength);