gnokii-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gnokii/common/phones nk6100.c, 1.152, 1.153 nk6510.c, 1.124, 1.125 nk711


From: BORBELY Zoltan <address@hidden>
Subject: gnokii/common/phones nk6100.c, 1.152, 1.153 nk6510.c, 1.124, 1.125 nk7110.c, 1.153, 1.154
Date: Thu, 23 Oct 2003 00:35:04 +0000

Update of /cvsroot/gnokii/gnokii/common/phones
In directory subversions:/tmp/cvs-serv30277/common/phones

Modified Files:
        nk6100.c nk6510.c nk7110.c 
Log Message:
ringtone handling unified


Index: nk6100.c
===================================================================
RCS file: /cvsroot/gnokii/gnokii/common/phones/nk6100.c,v
retrieving revision 1.152
retrieving revision 1.153
diff -C2 -d -r1.152 -r1.153
*** nk6100.c    19 Oct 2003 21:23:20 -0000      1.152
--- nk6100.c    23 Oct 2003 00:35:01 -0000      1.153
***************
*** 2060,2070 ****
  
        if (!data || !data->ringtone) return GN_ERR_INTERNALERROR;
  
!       if (DRVINSTANCE(state)->capabilities & NK6100_CAP_NBS_UPLOAD)
                return NBSUpload(data, state, GN_SMS_DATA_Ringtone);
  
        size = GN_RINGTONE_PACKAGE_MAX_LENGTH;
        gn_ringtone_pack(data->ringtone, req + 7, &size);
!       req[4] = data->ringtone->location;
  
        if (sm_message_send(7 + size, 0x05, req, state)) return GN_ERR_NOTREADY;
--- 2060,2073 ----
  
        if (!data || !data->ringtone) return GN_ERR_INTERNALERROR;
+       if (data->ringtone->location < 0) data->ringtone->location = 17;
  
!       if (DRVINSTANCE(state)->capabilities & NK6100_CAP_NBS_UPLOAD) {
!               data->ringtone->location = -1;
                return NBSUpload(data, state, GN_SMS_DATA_Ringtone);
+       }
  
        size = GN_RINGTONE_PACKAGE_MAX_LENGTH;
        gn_ringtone_pack(data->ringtone, req + 7, &size);
!       req[4] = data->ringtone->location - 17;
  
        if (sm_message_send(7 + size, 0x05, req, state)) return GN_ERR_NOTREADY;
***************
*** 2762,2767 ****
  
        if (!data || !data->ringtone || !data->raw_data) return 
GN_ERR_INTERNALERROR;
  
!       req[3] = data->ringtone->location;
  
        if ((error = pnok_extended_cmds_enable(0x01, data, state))) return 
error;
--- 2765,2771 ----
  
        if (!data || !data->ringtone || !data->raw_data) return 
GN_ERR_INTERNALERROR;
+       if (data->ringtone->location < 0) return GN_ERR_INVALIDLOCATION;
  
!       req[3] = data->ringtone->location - 17;
  
        if ((error = pnok_extended_cmds_enable(0x01, data, state))) return 
error;
***************
*** 2782,2787 ****
        if (!data || !data->ringtone || !data->raw_data || 
!data->raw_data->data)
                return GN_ERR_INTERNALERROR;
  
!       req[3] = data->ringtone->location;
        snprintf(req + 8, 13, "%s", data->ringtone->name);
        memcpy(req + 24, data->raw_data->data, data->raw_data->length);
--- 2786,2792 ----
        if (!data || !data->ringtone || !data->raw_data || 
!data->raw_data->data)
                return GN_ERR_INTERNALERROR;
+       if (data->ringtone->location < 0) data->ringtone->location = 17;
  
!       req[3] = data->ringtone->location - 17;
        snprintf(req + 8, 13, "%s", data->ringtone->name);
        memcpy(req + 24, data->raw_data->data, data->raw_data->length);
***************
*** 2875,2884 ****
                        break;
                case 0x0a:
!                       return GN_ERR_UNKNOWN;
                default:
                        return GN_ERR_UNHANDLEDFRAME;
                }
                if (!data->ringtone) return GN_ERR_INTERNALERROR;
!               data->ringtone->location = message[3];
                snprintf(data->ringtone->name, sizeof(data->ringtone->name), 
"%s", message + 8);
                if (data->raw_data && data->raw_data->data) {
--- 2880,2889 ----
                        break;
                case 0x0a:
!                       return GN_ERR_INVALIDLOCATION;
                default:
                        return GN_ERR_UNHANDLEDFRAME;
                }
                if (!data->ringtone) return GN_ERR_INTERNALERROR;
!               data->ringtone->location = message[3] + 17;
                snprintf(data->ringtone->name, sizeof(data->ringtone->name), 
"%s", message + 8);
                if (data->raw_data && data->raw_data->data) {
***************
*** 3706,3710 ****
  
        if (!memcmp(state->config.model, "61", 2)) {
!               rl->userdef_location = 0;
                rl->userdef_count = 1;
                ADDRINGTONE(18, "Ring ring");
--- 3711,3715 ----
  
        if (!memcmp(state->config.model, "61", 2)) {
!               rl->userdef_location = 17;
                rl->userdef_count = 1;
                ADDRINGTONE(18, "Ring ring");
***************
*** 3749,3753 ****
                gn_data_clear(&d);
                d.ringtone = &ringtone;
!               ringtone.location = 0;
                if (GetRingtone(&d, state) == GN_ERR_NONE) {
                        rl->ringtone[rl->count].location = ringtone.location;
--- 3754,3813 ----
                gn_data_clear(&d);
                d.ringtone = &ringtone;
!               ringtone.location = 17;
!               if (GetRingtone(&d, state) == GN_ERR_NONE) {
!                       rl->ringtone[rl->count].location = ringtone.location;
!                       strcpy(rl->ringtone[rl->count].name, ringtone.name);
!                       rl->ringtone[rl->count].user_defined = 1;
!                       rl->ringtone[rl->count].readable = 1;
!                       rl->ringtone[rl->count].writable = 1;
!                       rl->count++;
!               }
!       } else if (!memcmp(state->config.model, "51", 2)) {
!               rl->userdef_location = 17;
!               rl->userdef_count = 1;
!               ADDRINGTONE(18, "Ring ring");
!               ADDRINGTONE(19, "Low");
!               ADDRINGTONE(20, "Fly");
!               ADDRINGTONE(21, "Mosquito");
!               ADDRINGTONE(22, "Bee");
!               ADDRINGTONE(23, "Intro");
!               ADDRINGTONE(24, "Etude");
!               ADDRINGTONE(25, "Hunt");
!               ADDRINGTONE(26, "Going up");
!               ADDRINGTONE(27, "City Bird");
!               ADDRINGTONE(30, "Chase");
!               ADDRINGTONE(32, "Scifi");
!               ADDRINGTONE(34, "Kick");
!               ADDRINGTONE(35, "Do-mi-so");
!               ADDRINGTONE(36, "Robo N1X");
!               ADDRINGTONE(37, "Dizzy");
!               ADDRINGTONE(39, "Playground");
!               ADDRINGTONE(43, "That's it!");
!               ADDRINGTONE(47, "Knock knock");
!               ADDRINGTONE(48, "Grande valse");
!               ADDRINGTONE(49, "Helan");
!               ADDRINGTONE(50, "Fuga");
!               ADDRINGTONE(51, "Ode to Joy");
!               ADDRINGTONE(52, "Elise");
!               ADDRINGTONE(54, "Mozart 40");
!               ADDRINGTONE(56, "William Tell");
!               ADDRINGTONE(57, "Badinerie");
!               ADDRINGTONE(58, "Polka");
!               ADDRINGTONE(59, "Attraction");
!               ADDRINGTONE(60, "Down");
!               ADDRINGTONE(62, "Persuasion");
!               ADDRINGTONE(67, "Tick tick");
!               ADDRINGTONE(69, "Samba");
!               ADDRINGTONE(71, "Orient");
!               ADDRINGTONE(72, "Charleston");
!               ADDRINGTONE(73, "Songette");
!               ADDRINGTONE(74, "Jumping");
!               ADDRINGTONE(75, "Lamb");
!               ADDRINGTONE(80, "Tango");
! 
!               memset(&ringtone, 0, sizeof(ringtone));
!               gn_data_clear(&d);
!               d.ringtone = &ringtone;
!               ringtone.location = 17;
                if (GetRingtone(&d, state) == GN_ERR_NONE) {
                        rl->ringtone[rl->count].location = ringtone.location;

Index: nk7110.c
===================================================================
RCS file: /cvsroot/gnokii/gnokii/common/phones/nk7110.c,v
retrieving revision 1.153
retrieving revision 1.154
diff -C2 -d -r1.153 -r1.154
*** nk7110.c    1 Oct 2003 23:32:44 -0000       1.153
--- nk7110.c    23 Oct 2003 00:35:01 -0000      1.154
***************
*** 278,282 ****
                return NK7110_PressOrReleaseKey(data, state, false);
        case GN_OP_SetRingtone:
!               return NBSUpload(data, state, GN_SMS_DATA_Ringtone);
        case GN_OP_PlayTone:
                return pnok_play_tone(data, state);
--- 278,282 ----
                return NK7110_PressOrReleaseKey(data, state, false);
        case GN_OP_SetRingtone:
!               return NK7110_SetRingtone(data, state);
        case GN_OP_PlayTone:
                return pnok_play_tone(data, state);
***************
*** 2559,2562 ****
--- 2559,2574 ----
  
        return GN_ERR_NONE;
+ }
+ 
+ /*****************************/
+ /********* RINGTONE **********/
+ /*****************************/
+ static gn_error NK7110_SetRingtone(gn_data *data, struct gn_statemachine 
*state)
+ {
+       if (!data->ringtone) return GN_ERR_INTERNALERROR;
+ 
+       data->ringtone->location = -1;
+ 
+       return NBSUpload(data, state, GN_SMS_DATA_Ringtone);
  }
  

Index: nk6510.c
===================================================================
RCS file: /cvsroot/gnokii/gnokii/common/phones/nk6510.c,v
retrieving revision 1.124
retrieving revision 1.125
diff -C2 -d -r1.124 -r1.125
*** nk6510.c    19 Oct 2003 21:23:20 -0000      1.124
--- nk6510.c    23 Oct 2003 00:35:01 -0000      1.125
***************
*** 2475,2479 ****
                if (!(rl = data->ringtone_list)) return GN_ERR_INTERNALERROR;
                rl->count = 256 * message[4] + message[5];
!               rl->userdef_location = 0; //FIXME
                rl->userdef_count = 10;
                if (rl->count > GN_RINGTONE_MAX_COUNT) rl->count = 
GN_RINGTONE_MAX_COUNT;
--- 2475,2479 ----
                if (!(rl = data->ringtone_list)) return GN_ERR_INTERNALERROR;
                rl->count = 256 * message[4] + message[5];
!               rl->userdef_location = NK6510_RINGTONE_USERDEF_LOCATION;
                rl->userdef_count = 10;
                if (rl->count > GN_RINGTONE_MAX_COUNT) rl->count = 
GN_RINGTONE_MAX_COUNT;
***************
*** 2555,2558 ****
--- 2555,2560 ----
  
        if (!data->ringtone || !data->raw_data) return GN_ERR_INTERNALERROR;
+       /* FIXME: where is the location field? */
+       if (data->ringtone->location < 0) data->ringtone->location = 
NK6510_RINGTONE_USERDEF_LOCATION;
  
        dprintf("Setting raw ringtone %d...\n", data->ringtone->location);





reply via email to

[Prev in Thread] Current Thread [Next in Thread]