Gammu internals  1.38.0
gammu-ringtone.h
Go to the documentation of this file.
1 
7 #ifndef __gammu_ringtone_h
8 #define __gammu_ringtone_h
9 
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13 
19 #include <gammu-types.h>
20 #include <gammu-error.h>
21 #include <gammu-limits.h>
22 #include <gammu-statemachine.h>
23 
24 #include <stdio.h>
25 
26 typedef enum {
30  NaturalStyle = 0x00 << 6,
34  ContinuousStyle = 0x01 << 6,
38  StaccatoStyle = 0x02 << 6,
39 
42 
43 typedef enum {
44  Note_Pause = 0x00 << 4,
45  Note_C = 0x01 << 4,
46  Note_Cis = 0x02 << 4,
47  Note_D = 0x03 << 4,
48  Note_Dis = 0x04 << 4,
49  Note_E = 0x05 << 4,
50  Note_F = 0x06 << 4,
51  Note_Fis = 0x07 << 4,
52  Note_G = 0x08 << 4,
53  Note_Gis = 0x09 << 4,
54  Note_A = 0x0a << 4,
55  Note_Ais = 0x0b << 4,
56  Note_H = 0x0c << 4,
57 
60 
61 typedef enum {
62  Duration_Full = 0x00 << 5,
63  Duration_1_2 = 0x01 << 5,
64  Duration_1_4 = 0x02 << 5,
65  Duration_1_8 = 0x03 << 5,
66  Duration_1_16 = 0x04 << 5,
67  Duration_1_32 = 0x05 << 5,
68 
71 
72 typedef enum {
73  NoSpecialDuration = 0x00 << 6,
74  DottedNote = 0x01 << 6,
75  DoubleDottedNote = 0x02 << 6,
76  Length_2_3 = 0x03 << 6,
77 
80 
81 typedef enum {
85  Scale_55 = 1,
104 
105 typedef struct {
106  GSM_RingNoteDuration Duration;
107  GSM_RingNoteDurationSpec DurationSpec;
108  GSM_RingNoteNote Note;
109  GSM_RingNoteStyle Style;
110  GSM_RingNoteScale Scale;
111  int Tempo;
112 } GSM_RingNote;
113 
114 typedef enum {
124 
125 typedef struct {
126  GSM_RingCommandType Type;
128  unsigned char Value;
130 
131 typedef struct {
136 
137 /* FIXME: should use BinaryTone instead? */
138 /* Structure to hold Nokia binary ringtones. */
139 typedef struct {
140  unsigned char Frame[50000];
141  size_t Length;
143 
144 typedef struct {
145  unsigned char *Buffer;
146  size_t Length;
148 
149 typedef enum {
155 
159 typedef struct {
169  GSM_RingtoneFormat Format;
173  unsigned char Name[(GSM_MAX_RINGTONE_NAME_LENGTH + 1) * 2];
177  int Location;
178 } GSM_Ringtone;
179 
180 typedef struct {
184  int Group;
185  int ID;
186  unsigned char Name[30 * 2];
188 
189 typedef struct {
190  int Number;
193 
198  gboolean first);
199 
204 
209  gboolean PhoneRingtone);
214  int *maxlength);
219  GSM_AllRingtonesInfo * Info);
224 
228 GSM_Error GSM_PlayTone(GSM_StateMachine * s, int Herz, unsigned char Volume,
229  gboolean start);
230 
232  GSM_RingtoneFormat Format);
233 GSM_Error GSM_ReadRingtoneFile(char *FileName, GSM_Ringtone * ringtone);
234 
235 GSM_Error GSM_SaveRingtoneFile(char *FileName, GSM_Ringtone * ringtone);
236 
237 GSM_Error GSM_SaveRingtoneOtt(FILE * file, GSM_Ringtone * ringtone);
238 
239 GSM_Error GSM_SaveRingtoneMidi(FILE * file, GSM_Ringtone * ringtone);
240 
241 GSM_Error GSM_SaveRingtoneIMelody(FILE * file, GSM_Ringtone * ringtone);
242 
243 GSM_Error GSM_SaveRingtoneWav(FILE * file, GSM_Ringtone * ringtone);
244 
245 GSM_Error GSM_SaveRingtoneRttl(FILE * file, GSM_Ringtone * ringtone);
246 
250 const unsigned char *GSM_GetRingtoneName(const GSM_AllRingtonesInfo * Info, const int ID);
251 
252 int GSM_RTTLGetTempo(int Beats);
253 
254 #ifdef __cplusplus
255 }
256 #endif
257 #endif
258 
259 /* Editor configuration
260  * vim: noexpandtab sw=8 ts=8 sts=8 tw=72:
261  */
GSM_Error GSM_SaveRingtoneOtt(FILE *file, GSM_Ringtone *ringtone)
Definition: gsmring.c:481
GSM_RingNoteDurationSpec
GSM_RingtoneFormat Format
GSM_RingNoteDuration Duration
GSM_RingNoteNote Note
GSM_Error GSM_RingtoneConvert(GSM_Ringtone *dest, GSM_Ringtone *src, GSM_RingtoneFormat Format)
Definition: gsmring.c:1543
GSM_Error GSM_SaveRingtoneRttl(FILE *file, GSM_Ringtone *ringtone)
Definition: gsmring.c:201
GSM_Error GSM_GetRingtonesInfo(GSM_StateMachine *s, GSM_AllRingtonesInfo *Info)
Definition: api.c:1079
const unsigned char * GSM_GetRingtoneName(const GSM_AllRingtonesInfo *Info, const int ID)
Definition: gsmring.c:1713
GSM_RingNoteScale Scale
GSM_Error
Definition: gammu-error.h:23
#define GSM_MAX_RINGTONE_NAME_LENGTH
Definition: gammu-limits.h:232
GSM_Error GSM_ReadRingtoneFile(char *FileName, GSM_Ringtone *ringtone)
Definition: gsmring.c:874
GSM_RingCommandType Type
GSM_RingNoteScale
GSM_RingNoteNote
GSM_Error GSM_DeleteUserRingtones(GSM_StateMachine *s)
Definition: api.c:1092
GSM_NoteRingtone NoteTone
GSM_Error PHONE_RTTLPlayOneNote(GSM_StateMachine *s, GSM_RingNote note, gboolean first)
Definition: pfunc.c:94
#define GSM_MAX_RINGTONE_NOTES
Definition: gammu-limits.h:225
int gboolean
Definition: gammu-types.h:23
int GSM_RTTLGetTempo(int Beats)
Definition: gsmring.c:979
GSM_RingNoteStyle Style
GSM_NokiaBinaryRingtone NokiaBinary
GSM_Error GSM_PlayTone(GSM_StateMachine *s, int Herz, unsigned char Volume, gboolean start)
Definition: api.c:1105
unsigned char * Buffer
GSM_RingtoneInfo * Ringtone
GSM_RingNoteDurationSpec DurationSpec
GSM_RingCommandType
GSM_RingNoteStyle
GSM_RingtoneFormat
GSM_Error GSM_SaveRingtoneMidi(FILE *file, GSM_Ringtone *ringtone)
Definition: gsmring.c:413
GSM_Error PHONE_Beep(GSM_StateMachine *s)
Definition: pfunc.c:129
GSM_BinaryTone BinaryTone
GSM_Error GSM_SaveRingtoneWav(FILE *file, GSM_Ringtone *ringtone)
Definition: gsmring.c:105
GSM_Error GSM_SaveRingtoneFile(char *FileName, GSM_Ringtone *ringtone)
Definition: gsmring.c:494
GSM_Error GSM_SaveRingtoneIMelody(FILE *file, GSM_Ringtone *ringtone)
Definition: gsmring.c:377
GSM_RingNoteDuration
GSM_RingNote Note
GSM_Error GSM_GetRingtone(GSM_StateMachine *s, GSM_Ringtone *Ringtone, gboolean PhoneRingtone)
Definition: api.c:1053
unsigned char Value
gboolean AllNotesScale
GSM_Error GSM_SetRingtone(GSM_StateMachine *s, GSM_Ringtone *Ringtone, int *maxlength)
Definition: api.c:1066