Found in "gnokii-working" directory, some November-patches version
[gnokii.git] / include / gsm-ringtones.h
index 948966d..bc3a514 100644 (file)
@@ -1,14 +1,26 @@
 /*
 
+  $Id$
+
   G N O K I I
 
   A Linux/Unix toolset and driver for Nokia mobile phones.
 
+  Copyright (C) 1999, 2000 Hugh Blemings & Pavel Janík ml.
+
   Released under the terms of the GNU GPL, see file COPYING for more details.
 
   This file provides definitions of macros from the Smart Messaging
   Specification. It is mainly rewrite of the spec to C :-) Viva Nokia!
 
+  $Log$
+  Revision 1.1.1.4  2002/04/03 00:08:19  short
+  Found in "gnokii-working" directory, some November-patches version
+
+  Revision 1.2  2001/06/28 00:28:46  pkot
+  Small docs updates (Pawel Kot)
+
+
 */
 
 #ifndef __gsm_ringtones_h
 #include <ctype.h>
 #include "misc.h"
 #include "gsm-common.h"
-#include "gsm-sms.h"
-
-#define MAX_RINGTONE_NOTES 255
-
-/* Structure to hold note of ringtone. */
-/* NoteValue is encoded as octave(scale)*14 + note */
-/* where for note: c=0, d=2, e=4 .... */
-/* ie. c#=1 and 5 and 13 are invalid */
-/* note=255 means a pause */
-typedef struct {
-  u8 duration;
-  u8 note;
-  int tempo;
-  u8 style;
-} GSM_RingtoneNote;
-
-/* Structure to hold ringtones. */
-typedef struct {
-  char name[20];
-  unsigned char Loop;
-  u8 NrNotes;
-  GSM_RingtoneNote notes[256];
-  bool allnotesscale; /* Some Nokia phones doesn't receive correctly some
-                         ringtones without it. N3310 4.02 */
-  int location;
-} GSM_Ringtone;
-  
-/* Structure to hold binary ringtones. */
-
-typedef struct {
-  char name[20];
-  unsigned char frame[1000];
-  int length;
-  int location;
-} GSM_BinRingtone;
 
 #define GetBit(Stream,BitNr) Stream[(BitNr)/8] & 1<<(7-((BitNr)%8))
 #define SetBit(Stream,BitNr) Stream[(BitNr)/8] |= 1<<(7-((BitNr)%8))
@@ -68,8 +45,6 @@ typedef struct {
 #define CancelCommand          (0x05<<1) /* binary 0000 101 */
 #define RingingToneProgramming (0x25<<1) /* binary 0100 101 */
 #define Sound                  (0x1d<<1) /* binary 0011 101 */
-/* MW: I didn't find phone, which can unpack ringtone with Unicode
-   command. Tested 3310, 6150 */
 #define Unicode                (0x22<<1) /* binary 0100 010 */
 
 /* Song-Type Encoding */
@@ -86,13 +61,13 @@ typedef struct {
 #define ScaleInstructionId   (0x02<<5) /* binary 010 */
 #define StyleInstructionId   (0x03<<5) /* binary 011 */
 #define TempoInstructionId   (0x04<<5) /* binary 100 */
-#define VolumeInstructionId  (0x05<<5) /* binary 101 */
+#define VolumeInstructionId (0x05<<5) /* binary 101 */
 
 /* Style-Value Encoding*/
 
 #define NaturalStyle    (0x00<<6) /* binary 00 */
 #define ContinuousStyle (0x01<<6) /* binary 01 */
-#define StaccatoStyle   (0x02<<6) /* binary 10 */
+#define StaccatoStyle   (0x02<<6) /* binary 11 */
 
 /* Note-Scale Encoding  */
 
@@ -140,57 +115,26 @@ typedef struct {
 #define D_part (0x03<<6) /* binary 11 */
 
 /* Command-End */
-#define CommandEnd (0x00) /* binary 00000000 */
-
-u8 GSM_PackRingtone(GSM_Ringtone *ringtone, unsigned char *package, int *maxlength);
-GSM_Error GSM_UnPackRingtone(GSM_Ringtone *ringtone, char *package, int maxlength);
 
-int GSM_GetDuration(int number, unsigned char *spec);
-int GSM_GetNote(int number);
-int GSM_GetScale(int number);
-int GSM_GetTempo(int Beats);
-
-void GSM_PlayOneNote (GSM_RingtoneNote note);
-void GSM_PlayRingtone (GSM_Ringtone *ringtone);
-
-int GSM_GetFrequency(int number);
-
-GSM_Error GSM_ReadRingtone(GSM_SMSMessage *message, GSM_Ringtone *ringtone);
-
-int GSM_SaveRingtoneToSMS(GSM_MultiSMSMessage *SMS,
-                          GSM_Ringtone *ringtone,bool profilestyle);
-
-/* FIXME: For each phone probaby different */
-#define FB61_MAX_RINGTONE_FRAME_LENGTH 200
-
-/* Smart Messaging 3.0 says: 16*9=144 bytes,
-   but on 3310 4.02 it was possible to save about 196 chars (without cutting) */
-#define SM30_MAX_RINGTONE_FRAME_LENGTH 196
-
-/* Like PC Composer help say */
-#define FB61_MAX_RINGTONE_NOTES 130
-
-/* Nokia ringtones codes. */
-
-struct OneRingtone {
-  char name[30];
-  int menu;
-  int code;
-};
+#define CommandEnd (0x00) /* binary 00000000 */
 
-void PrepareRingingTones(char model[64], char rev[64]);
+/* Definition of the Note type */
 
-/* returns names from code or number in menu */
-char *RingingToneName(int code, int menu);
+typedef struct {
+  int Scale;
+  int NoteID;
+  int Duration;
+  int DurationSpecifier;
+} Note;
 
-/* returns code from number in menu */
-int RingingToneCode(int menu);
+#define GSM_MAX_RINGTONE_PACKAGE_LENGTH 200
 
-/* returns number in menu from code */
-int RingingToneMenu(int code);
+/* From PC Composer help */
+#define GSM_MAX_RINGTONE_NOTES 130
 
-int NumberOfRingtones();
+u8 GSM_PackRingtone(GSM_Ringtone *ringtone, char *package, int *maxlength);
+GSM_Error GSM_UnPackRingtone(GSM_Ringtone *ringtone, char *package, int maxlength);
 
-GSM_Error GSM_GetPhoneRingtone(GSM_BinRingtone *ringtone,GSM_Ringtone *SMringtone);
+int GSM_GetNote(int number);
 
 #endif /* __gsm_ringtones_h */