Gammu API  1.38.0
gammu-ringtone.h File Reference
#include <gammu-types.h>
#include <gammu-error.h>
#include <gammu-limits.h>
#include <gammu-statemachine.h>
#include <stdio.h>

Go to the source code of this file.

Data Structures

struct  GSM_RingNote
 
struct  GSM_RingCommand
 
struct  GSM_NoteRingtone
 
struct  GSM_NokiaBinaryRingtone
 
struct  GSM_BinaryTone
 
struct  GSM_Ringtone
 
struct  GSM_RingtoneInfo
 
struct  GSM_AllRingtonesInfo
 

Enumerations

enum  GSM_RingNoteStyle { NaturalStyle = 0x00 << 6, ContinuousStyle = 0x01 << 6, StaccatoStyle = 0x02 << 6, INVALIDStyle }
 
enum  GSM_RingNoteNote {
  Note_Pause = 0x00 << 4, Note_C = 0x01 << 4, Note_Cis = 0x02 << 4, Note_D = 0x03 << 4,
  Note_Dis = 0x04 << 4, Note_E = 0x05 << 4, Note_F = 0x06 << 4, Note_Fis = 0x07 << 4,
  Note_G = 0x08 << 4, Note_Gis = 0x09 << 4, Note_A = 0x0a << 4, Note_Ais = 0x0b << 4,
  Note_H = 0x0c << 4, Note_INVALID
}
 
enum  GSM_RingNoteDuration {
  Duration_Full = 0x00 << 5, Duration_1_2 = 0x01 << 5, Duration_1_4 = 0x02 << 5, Duration_1_8 = 0x03 << 5,
  Duration_1_16 = 0x04 << 5, Duration_1_32 = 0x05 << 5, Duration_INVALID
}
 
enum  GSM_RingNoteDurationSpec {
  NoSpecialDuration = 0x00 << 6, DottedNote = 0x01 << 6, DoubleDottedNote = 0x02 << 6, Length_2_3 = 0x03 << 6,
  DurationSpec_INVALID
}
 
enum  GSM_RingNoteScale {
  Scale_55 = 1, Scale_110, Scale_220, Scale_440,
  Scale_880, Scale_1760, Scale_3520, Scale_7040,
  Scale_14080
}
 
enum  GSM_RingCommandType {
  RING_Note = 1, RING_EnableVibra, RING_DisableVibra, RING_EnableLight,
  RING_DisableLight, RING_EnableLED, RING_DisableLED, RING_Repeat
}
 
enum  GSM_RingtoneFormat { RING_NOTETONE = 1, RING_NOKIABINARY, RING_MIDI, RING_MMF }
 

Functions

GSM_Error PHONE_RTTLPlayOneNote (GSM_StateMachine *s, GSM_RingNote note, gboolean first)
 
GSM_Error PHONE_Beep (GSM_StateMachine *s)
 
GSM_Error GSM_GetRingtone (GSM_StateMachine *s, GSM_Ringtone *Ringtone, gboolean PhoneRingtone)
 
GSM_Error GSM_SetRingtone (GSM_StateMachine *s, GSM_Ringtone *Ringtone, int *maxlength)
 
GSM_Error GSM_GetRingtonesInfo (GSM_StateMachine *s, GSM_AllRingtonesInfo *Info)
 
GSM_Error GSM_DeleteUserRingtones (GSM_StateMachine *s)
 
GSM_Error GSM_PlayTone (GSM_StateMachine *s, int Herz, unsigned char Volume, gboolean start)
 
GSM_Error GSM_RingtoneConvert (GSM_Ringtone *dest, GSM_Ringtone *src, GSM_RingtoneFormat Format)
 
GSM_Error GSM_ReadRingtoneFile (char *FileName, GSM_Ringtone *ringtone)
 
GSM_Error GSM_SaveRingtoneFile (char *FileName, GSM_Ringtone *ringtone)
 
GSM_Error GSM_SaveRingtoneOtt (FILE *file, GSM_Ringtone *ringtone)
 
GSM_Error GSM_SaveRingtoneMidi (FILE *file, GSM_Ringtone *ringtone)
 
GSM_Error GSM_SaveRingtoneIMelody (FILE *file, GSM_Ringtone *ringtone)
 
GSM_Error GSM_SaveRingtoneWav (FILE *file, GSM_Ringtone *ringtone)
 
GSM_Error GSM_SaveRingtoneRttl (FILE *file, GSM_Ringtone *ringtone)
 
const unsigned char * GSM_GetRingtoneName (const GSM_AllRingtonesInfo *Info, const int ID)
 
int GSM_RTTLGetTempo (int Beats)
 

Detailed Description

Author
Michal Čihař

Ringtone data and functions.

Definition in file gammu-ringtone.h.

Enumeration Type Documentation

§ GSM_RingCommandType

Enumerator
RING_Note 
RING_EnableVibra 
RING_DisableVibra 
RING_EnableLight 
RING_DisableLight 
RING_EnableLED 
RING_DisableLED 
RING_Repeat 

Definition at line 114 of file gammu-ringtone.h.

§ GSM_RingNoteDuration

Enumerator
Duration_Full 
Duration_1_2 
Duration_1_4 
Duration_1_8 
Duration_1_16 
Duration_1_32 
Duration_INVALID 

Definition at line 61 of file gammu-ringtone.h.

61  {
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 
GSM_RingNoteDuration

§ GSM_RingNoteDurationSpec

Enumerator
NoSpecialDuration 
DottedNote 
DoubleDottedNote 
Length_2_3 
DurationSpec_INVALID 

Definition at line 72 of file gammu-ringtone.h.

§ GSM_RingNoteNote

Enumerator
Note_Pause 
Note_C 
Note_Cis 
Note_D 
Note_Dis 
Note_E 
Note_F 
Note_Fis 
Note_G 
Note_Gis 
Note_A 
Note_Ais 
Note_H 
Note_INVALID 

Definition at line 43 of file gammu-ringtone.h.

43  {
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 
GSM_RingNoteNote

§ GSM_RingNoteScale

Enumerator
Scale_55 

55 Hz for note A

Scale_110 

110 Hz for note A

Scale_220 
Scale_440 

first scale for Nokia

Scale_880 
Scale_1760 
Scale_3520 

last scale for Nokia

Scale_7040 
Scale_14080 

Definition at line 81 of file gammu-ringtone.h.

§ GSM_RingNoteStyle

Enumerator
NaturalStyle 

Natural style (rest between notes)

ContinuousStyle 

Continuous style (no rest between notes)

StaccatoStyle 

Staccato style (shorter notes and longer rest period)

INVALIDStyle 

Definition at line 26 of file gammu-ringtone.h.

26  {
30  NaturalStyle = 0x00 << 6,
34  ContinuousStyle = 0x01 << 6,
38  StaccatoStyle = 0x02 << 6,
39 
GSM_RingNoteStyle

§ GSM_RingtoneFormat

Enumerator
RING_NOTETONE 
RING_NOKIABINARY 
RING_MIDI 
RING_MMF 

Definition at line 149 of file gammu-ringtone.h.

Function Documentation

§ GSM_DeleteUserRingtones()

GSM_Error GSM_DeleteUserRingtones ( GSM_StateMachine s)

Deletes user defined ringtones from phone.

§ GSM_GetRingtone()

GSM_Error GSM_GetRingtone ( GSM_StateMachine s,
GSM_Ringtone Ringtone,
gboolean  PhoneRingtone 
)

Gets ringtone from phone.

§ GSM_GetRingtoneName()

const unsigned char* GSM_GetRingtoneName ( const GSM_AllRingtonesInfo Info,
const int  ID 
)

Returns ringtone name, NULL if not found.

§ GSM_GetRingtonesInfo()

GSM_Error GSM_GetRingtonesInfo ( GSM_StateMachine s,
GSM_AllRingtonesInfo Info 
)

Acquires ringtone informaiton.

§ GSM_PlayTone()

GSM_Error GSM_PlayTone ( GSM_StateMachine s,
int  Herz,
unsigned char  Volume,
gboolean  start 
)

Plays tone.

§ GSM_ReadRingtoneFile()

GSM_Error GSM_ReadRingtoneFile ( char *  FileName,
GSM_Ringtone ringtone 
)

§ GSM_RingtoneConvert()

GSM_Error GSM_RingtoneConvert ( GSM_Ringtone dest,
GSM_Ringtone src,
GSM_RingtoneFormat  Format 
)

§ GSM_RTTLGetTempo()

int GSM_RTTLGetTempo ( int  Beats)

§ GSM_SaveRingtoneFile()

GSM_Error GSM_SaveRingtoneFile ( char *  FileName,
GSM_Ringtone ringtone 
)

§ GSM_SaveRingtoneIMelody()

GSM_Error GSM_SaveRingtoneIMelody ( FILE *  file,
GSM_Ringtone ringtone 
)

§ GSM_SaveRingtoneMidi()

GSM_Error GSM_SaveRingtoneMidi ( FILE *  file,
GSM_Ringtone ringtone 
)

§ GSM_SaveRingtoneOtt()

GSM_Error GSM_SaveRingtoneOtt ( FILE *  file,
GSM_Ringtone ringtone 
)

§ GSM_SaveRingtoneRttl()

GSM_Error GSM_SaveRingtoneRttl ( FILE *  file,
GSM_Ringtone ringtone 
)

§ GSM_SaveRingtoneWav()

GSM_Error GSM_SaveRingtoneWav ( FILE *  file,
GSM_Ringtone ringtone 
)

§ GSM_SetRingtone()

GSM_Error GSM_SetRingtone ( GSM_StateMachine s,
GSM_Ringtone Ringtone,
int *  maxlength 
)

Sets ringtone in phone.

§ PHONE_Beep()

GSM_Error PHONE_Beep ( GSM_StateMachine s)

Makes phone beek using state machine interface.

§ PHONE_RTTLPlayOneNote()

GSM_Error PHONE_RTTLPlayOneNote ( GSM_StateMachine s,
GSM_RingNote  note,
gboolean  first 
)

Play one note using state machine interface.