1 /* (c) 2002-2004 by Marcin Wiacek */
2 
3 #ifndef __gsm_ring_h
4 #define __gsm_ring_h
5 
6 #include <gammu-ringtone.h>
7 /* --------------- Smart Messaging Specification 2.0 & 3.0 ----------------- */
8 
9 #define SM_CommandEnd_CommandEnd 		0x00
10 
11 /* specification gives also other */
12 #define SM_Command_RingingToneProgramming 	(0x25 << 1)
13 #define SM_Command_Sound                  	(0x1d << 1)
14 /* specification gives also other */
15 
16 #define SM_Song_BasicSongType			(0x01 << 5)
17 /* specification gives also other */
18 
19 #define SM_PatternID_A_part 			(0x00 << 6)
20 /* specification gives also other */
21 
22 #define SM_InstructionID_PatternHeaderId      	(0x00 << 5)
23 #define SM_InstructionID_NoteInstructionId    	(0x01 << 5)
24 #define SM_InstructionID_ScaleInstructionId   	(0x02 << 5)
25 #define SM_InstructionID_StyleInstructionId   	(0x03 << 5)
26 #define SM_InstructionID_TempoInstructionId   	(0x04 << 5)
27 #define SM_InstructionID_VolumeInstructionId  	(0x05 << 5)
28 
29 /* ------ end of Smart Messaging Specification 2.0 & 3.0 definitions ------- */
30 
31 typedef enum {
32 	/**
33 	 * No header and footer.
34 	 */
35 	GSM_Ring_NoHeader = 1,
36 	/**
37 	 * Partial header and footer.
38 	 */
39 	GSM_Ring_PartialHeader,
40 	/**
41 	 * IMelody 1.0.
42 	 */
43 	GSM_Ring_IMelody10,
44 	/**
45 	 * IMelody 1.2.
46 	 */
47 	GSM_Ring_IMelody12,
48 } GSM_RingtoneVersion;
49 
50 
51 unsigned char	GSM_EncodeNokiaRTTLRingtone	(GSM_Ringtone *ringtone, unsigned char *package, size_t *maxlength);
52 unsigned char 	GSM_EncodeEMSSound		(GSM_Ringtone *ringtone, unsigned char *package, size_t *maxlength, GSM_RingtoneVersion version, gboolean start);
53 
54 GSM_Error	GSM_DecodeNokiaRTTLRingtone	(GSM_Ringtone *ringtone, unsigned char *package, size_t maxlength);
55 
56 
57 int GSM_RingNoteGetFrequency	(GSM_RingNote Note);
58 int GSM_RingNoteGetFullDuration	(GSM_RingNote Note);
59 
60 #endif
61 
62 /* How should editor hadle tabs in this file? Add editor commands here.
63  * vim: noexpandtab sw=8 ts=8 sts=8:
64  */
65