|
Gammu internals
1.38.0
|
#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 |
Ringtone data and functions.
Definition in file gammu-ringtone.h.
| enum 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.
| enum 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.
| Enumerator | |
|---|---|
| NoSpecialDuration | |
| DottedNote | |
| DoubleDottedNote | |
| Length_2_3 | |
| DurationSpec_INVALID | |
Definition at line 72 of file gammu-ringtone.h.
| enum 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.
| enum 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.
| enum 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.
| enum GSM_RingtoneFormat |
| Enumerator | |
|---|---|
| RING_NOTETONE | |
| RING_NOKIABINARY | |
| RING_MIDI | |
| RING_MMF | |
Definition at line 149 of file gammu-ringtone.h.
| GSM_Error GSM_DeleteUserRingtones | ( | GSM_StateMachine * | s | ) |
Deletes user defined ringtones from phone.
Definition at line 1092 of file api.c.
References CHECK_PHONE_CONNECTION, GSM_Phone_Functions::DeleteUserRingtones, GSM_Phone::Functions, _GSM_StateMachine::Phone, and PRINT_LOG_ERROR.
| GSM_Error GSM_GetRingtone | ( | GSM_StateMachine * | s, |
| GSM_Ringtone * | Ringtone, | ||
| gboolean | PhoneRingtone | ||
| ) |
Gets ringtone from phone.
Definition at line 1053 of file api.c.
References CHECK_PHONE_CONNECTION, GSM_Phone::Functions, GSM_Phone_Functions::GetRingtone, _GSM_StateMachine::Phone, and PRINT_LOG_ERROR.
| const unsigned char* GSM_GetRingtoneName | ( | const GSM_AllRingtonesInfo * | Info, |
| const int | ID | ||
| ) |
Returns ringtone name, NULL if not found.
Definition at line 1713 of file gsmring.c.
References GSM_RingtoneInfo::ID, GSM_RingtoneInfo::Name, GSM_AllRingtonesInfo::Number, and GSM_AllRingtonesInfo::Ringtone.
| GSM_Error GSM_GetRingtonesInfo | ( | GSM_StateMachine * | s, |
| GSM_AllRingtonesInfo * | Info | ||
| ) |
Acquires ringtone informaiton.
Definition at line 1079 of file api.c.
References CHECK_PHONE_CONNECTION, GSM_Phone::Functions, GSM_Phone_Functions::GetRingtonesInfo, _GSM_StateMachine::Phone, and PRINT_LOG_ERROR.
| GSM_Error GSM_PlayTone | ( | GSM_StateMachine * | s, |
| int | Herz, | ||
| unsigned char | Volume, | ||
| gboolean | start | ||
| ) |
Plays tone.
Definition at line 1105 of file api.c.
References CHECK_PHONE_CONNECTION, GSM_Phone::Functions, _GSM_StateMachine::Phone, GSM_Phone_Functions::PlayTone, and PRINT_LOG_ERROR.
| GSM_Error GSM_ReadRingtoneFile | ( | char * | FileName, |
| GSM_Ringtone * | ringtone | ||
| ) |
Definition at line 874 of file gsmring.c.
References GSM_NoteRingtone::AllNotesScale, dbgprintf, EncodeUnicode(), ERR_CANTOPENFILE, ERR_FILENOTSUPPORTED, ERR_MOREMEMORY, ERR_UNKNOWN, FALSE, GSM_Ringtone::Format, GSM_MAX_RINGTONE_NAME_LENGTH, loadbin(), loadcommunicator(), loadmmf(), loadott(), loadpuremidi(), loadre(), loadrttl(), GSM_Ringtone::Name, GSM_Ringtone::NoteTone, RING_MIDI, RING_MMF, RING_NOKIABINARY, and RING_NOTETONE.
| GSM_Error GSM_RingtoneConvert | ( | GSM_Ringtone * | dest, |
| GSM_Ringtone * | src, | ||
| GSM_RingtoneFormat | Format | ||
| ) |
Definition at line 1543 of file gsmring.c.
References Binary2RTTL(), CopyUnicodeString(), ERR_NONE, ERR_NOTIMPLEMENTED, GSM_Ringtone::Format, GSM_Ringtone::Name, RING_NOKIABINARY, RING_NOTETONE, and RTTL2Binary().
| int GSM_RTTLGetTempo | ( | int | Beats | ) |
Definition at line 979 of file gsmring.c.
References SM_BeatsPerMinute.
Referenced by GSM_EncodeNokiaRTTLRingtone().
| GSM_Error GSM_SaveRingtoneFile | ( | char * | FileName, |
| GSM_Ringtone * | ringtone | ||
| ) |
Definition at line 494 of file gsmring.c.
References ERR_CANTOPENFILE, ERR_UNKNOWN, GSM_Ringtone::Format, GSM_SaveRingtoneIMelody(), GSM_SaveRingtoneMidi(), GSM_SaveRingtoneOtt(), GSM_SaveRingtoneRttl(), GSM_SaveRingtoneWav(), RING_MIDI, RING_MMF, RING_NOKIABINARY, RING_NOTETONE, savebin(), savemmf(), and savepuremidi().
| GSM_Error GSM_SaveRingtoneIMelody | ( | FILE * | file, |
| GSM_Ringtone * | ringtone | ||
| ) |
Definition at line 377 of file gsmring.c.
References chk_fwrite, ERR_NONE, ERR_WRITING_FILE, GSM_EncodeEMSSound(), GSM_Ring_IMelody12, and TRUE.
Referenced by GSM_SaveRingtoneFile().
| GSM_Error GSM_SaveRingtoneMidi | ( | FILE * | file, |
| GSM_Ringtone * | ringtone | ||
| ) |
Definition at line 413 of file gsmring.c.
References chk_fwrite, GSM_NoteRingtone::Commands, ERR_NONE, ERR_WRITING_FILE, FALSE, GSM_RingNoteGetFullDuration(), GSM_RingNote::Note, GSM_RingCommand::Note, Note_C, Note_H, Note_Pause, GSM_Ringtone::NoteTone, GSM_NoteRingtone::NrCommands, RING_Note, GSM_RingNote::Scale, GSM_RingNote::Tempo, TRUE, GSM_RingCommand::Type, and WriteVarLen().
Referenced by GSM_SaveRingtoneFile().
| GSM_Error GSM_SaveRingtoneOtt | ( | FILE * | file, |
| GSM_Ringtone * | ringtone | ||
| ) |
Definition at line 481 of file gsmring.c.
References chk_fwrite, ERR_NONE, ERR_WRITING_FILE, and GSM_EncodeNokiaRTTLRingtone().
Referenced by GSM_SaveRingtoneFile().
| GSM_Error GSM_SaveRingtoneRttl | ( | FILE * | file, |
| GSM_Ringtone * | ringtone | ||
| ) |
Definition at line 201 of file gsmring.c.
References GSM_NoteRingtone::Commands, ContinuousStyle, dbgprintf, DecodeUnicodeString(), DottedNote, DoubleDottedNote, GSM_RingNote::Duration, Duration_1_16, Duration_1_2, Duration_1_32, Duration_1_4, Duration_1_8, Duration_Full, Duration_INVALID, GSM_RingNote::DurationSpec, ERR_NONE, FALSE, INVALIDStyle, GSM_Ringtone::Name, NaturalStyle, NoSpecialDuration, GSM_RingNote::Note, GSM_RingCommand::Note, Note_A, Note_Ais, Note_C, Note_Cis, Note_D, Note_Dis, Note_E, Note_F, Note_Fis, Note_G, Note_Gis, Note_H, Note_Pause, GSM_Ringtone::NoteTone, GSM_NoteRingtone::NrCommands, RING_Note, GSM_RingNote::Scale, Scale_14080, Scale_55, StaccatoStyle, GSM_RingNote::Style, GSM_RingNote::Tempo, TRUE, and GSM_RingCommand::Type.
Referenced by GSM_SaveRingtoneFile().
| GSM_Error GSM_SaveRingtoneWav | ( | FILE * | file, |
| GSM_Ringtone * | ringtone | ||
| ) |
Definition at line 105 of file gsmring.c.
References chk_fwrite, GSM_NoteRingtone::Commands, ERR_NONE, ERR_WRITING_FILE, GSM_RingNoteGetFrequency(), GSM_RingNoteGetFullDuration(), GSM_RingCommand::Note, GSM_Ringtone::NoteTone, GSM_NoteRingtone::NrCommands, PI, RING_Note, GSM_RingCommand::Type, and WAV_SAMPLE_RATE.
Referenced by GSM_SaveRingtoneFile().
| GSM_Error GSM_SetRingtone | ( | GSM_StateMachine * | s, |
| GSM_Ringtone * | Ringtone, | ||
| int * | maxlength | ||
| ) |
Sets ringtone in phone.
Definition at line 1066 of file api.c.
References CHECK_PHONE_CONNECTION, GSM_Phone::Functions, _GSM_StateMachine::Phone, PRINT_LOG_ERROR, and GSM_Phone_Functions::SetRingtone.
| GSM_Error PHONE_Beep | ( | GSM_StateMachine * | s | ) |
Makes phone beek using state machine interface.
Definition at line 129 of file pfunc.c.
References ERR_NONE, FALSE, GSM_Phone::Functions, _GSM_StateMachine::Phone, GSM_Phone_Functions::PlayTone, and TRUE.
| GSM_Error PHONE_RTTLPlayOneNote | ( | GSM_StateMachine * | s, |
| GSM_RingNote | note, | ||
| gboolean | first | ||
| ) |
Play one note using state machine interface.
Definition at line 94 of file pfunc.c.
References ContinuousStyle, ERR_NONE, FALSE, GSM_Phone::Functions, GSM_RingNoteGetFrequency(), GSM_RingNoteGetFullDuration(), INVALIDStyle, NaturalStyle, _GSM_StateMachine::Phone, GSM_Phone_Functions::PlayTone, StaccatoStyle, GSM_RingNote::Style, and GSM_RingNote::Tempo.