FreeCalypso > hg > fc-tourmaline
comparison src/ui/bmi/mmiVoiceMemo.c @ 92:c0052fe355d3
src/ui/bmi/*.[ch]: rm trailing white space
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sun, 08 Nov 2020 06:39:16 +0000 |
parents | 67bfe9f274f6 |
children | e41c934ecd97 |
comparison
equal
deleted
inserted
replaced
91:c3d28a37caad | 92:c0052fe355d3 |
---|---|
26 | 26 |
27 ******************************************************************************** | 27 ******************************************************************************** |
28 $History: MmiVoiceMemo.c | 28 $History: MmiVoiceMemo.c |
29 | 29 |
30 Mar 28, 2007 DR: OMAPS00122762 x0039928 | 30 Mar 28, 2007 DR: OMAPS00122762 x0039928 |
31 Description: MM: Deleting a PCM Voice Memo message in one particular memory, | 31 Description: MM: Deleting a PCM Voice Memo message in one particular memory, |
32 delete them in all memories | 32 delete them in all memories |
33 Solution: voice memo position and pcm voice memo position is provided for all the devices. | 33 Solution: voice memo position and pcm voice memo position is provided for all the devices. |
34 | 34 |
35 Mar 31, 2006 ER: OMAPS00067709 x0pleela | 35 Mar 31, 2006 ER: OMAPS00067709 x0pleela |
36 Description: Voice Buffering implementation on C+ for PTT via PCM API | 36 Description: Voice Buffering implementation on C+ for PTT via PCM API |
37 Solution: Added prototype for voice_buffering_stop_recording | 37 Solution: Added prototype for voice_buffering_stop_recording |
38 Updating voicebuffering data for play stopped in play callback | 38 Updating voicebuffering data for play stopped in play callback |
39 | 39 |
40 Mar 15, 2006 ER: OMAPS00067709 x0pleela | 40 Mar 15, 2006 ER: OMAPS00067709 x0pleela |
41 Description: Voice Buffering implementation on C+ for PTT via PCM API | 41 Description: Voice Buffering implementation on C+ for PTT via PCM API |
42 Solution: Defined new macro "PCM_VOICE_MEMO_MAX_DURATION" to restrict the recording | 42 Solution: Defined new macro "PCM_VOICE_MEMO_MAX_DURATION" to restrict the recording |
43 timeout to 20 secs for PCM voice memo and voice buffering | 43 timeout to 20 secs for PCM voice memo and voice buffering |
44 Added prototypes of new functions inputVoiceMemoNumberEditor, voiceMemoNumberCB, | 44 Added prototypes of new functions inputVoiceMemoNumberEditor, voiceMemoNumberCB, |
45 voice_buffering_tim_cb, voice_buffering_data_reset | 45 voice_buffering_tim_cb, voice_buffering_data_reset |
46 Added following new functions: | 46 Added following new functions: |
47 pcm_voice_memo_play: Sets voice memo type to PCM_VOICE_MEMO which indicates | 47 pcm_voice_memo_play: Sets voice memo type to PCM_VOICE_MEMO which indicates |
48 PCM voice memo is active and start playing the voice | 48 PCM voice memo is active and start playing the voice |
49 pcm_voice_memo_record: Sets voice memo type to PCM_VOICE_MEMO which indicates | 49 pcm_voice_memo_record: Sets voice memo type to PCM_VOICE_MEMO which indicates |
50 PCM voice memo is active and start recording the voice | 50 PCM voice memo is active and start recording the voice |
51 voice_buffering_edit_num: Opens an edtor for the user to enter PTT number. Also resets | 51 voice_buffering_edit_num: Opens an edtor for the user to enter PTT number. Also resets |
52 voice buffering data with default values | 52 voice buffering data with default values |
53 voiceMemoNumberCB: call back for number entry | 53 voiceMemoNumberCB: call back for number entry |
54 inputVoiceMemoNumberEditor: Settings of Editor | 54 inputVoiceMemoNumberEditor: Settings of Editor |
55 voice_buffering_record_start: Starts recording voice and conects to the PTT number if the | 55 voice_buffering_record_start: Starts recording voice and conects to the PTT number if the |
56 call is not active. If in call, then start playing the voice | 56 call is not active. If in call, then start playing the voice |
57 voice_buffering_record_stop: Stops the timer and recording. If call is not active the | 57 voice_buffering_record_stop: Stops the timer and recording. If call is not active the |
58 disconnects the call | 58 disconnects the call |
59 voice_buffering_playback_start: Starts playing the voice. If any error while playing, | 59 voice_buffering_playback_start: Starts playing the voice. If any error while playing, |
60 stops timer and recording | 60 stops timer and recording |
61 voice_buffering_stop_recording: A wrapper function for record stop to invoke from other | 61 voice_buffering_stop_recording: A wrapper function for record stop to invoke from other |
62 modules. Stops the timer and recording | 62 modules. Stops the timer and recording |
63 voice_buffering_stop_playing: A wrapper function for play stop to invoke from other modules | 63 voice_buffering_stop_playing: A wrapper function for play stop to invoke from other modules |
64 voice_buffering_tim_cb: Timer callback. Stops the timer. If PTT call is not setup disconnect | 64 voice_buffering_tim_cb: Timer callback. Stops the timer. If PTT call is not setup disconnect |
65 the call, else call record stop | 65 the call, else call record stop |
66 voice_buffering_data_reset: Resets voice buffering data to default values | 66 voice_buffering_data_reset: Resets voice buffering data to default values |
67 | 67 |
68 Function: voice_memo_play, voice_memo_record, voice_memo_destroy | 68 Function: voice_memo_play, voice_memo_record, voice_memo_destroy |
69 Changes: Added code to set voice memo type | 69 Changes: Added code to set voice memo type |
74 Function: voice_memo_tim_cb | 74 Function: voice_memo_tim_cb |
75 Changes: Added code to handle record stop, play stop for PCM voice memo | 75 Changes: Added code to handle record stop, play stop for PCM voice memo |
76 | 76 |
77 Function: voice_memo_riv_play_cb | 77 Function: voice_memo_riv_play_cb |
78 Changes: Added code to allow user to accept ant incoming call after the buffering phase | 78 Changes: Added code to allow user to accept ant incoming call after the buffering phase |
79 | 79 |
80 Feb 27, 2006 ER: OMAPS00067709 x0pleela | 80 Feb 27, 2006 ER: OMAPS00067709 x0pleela |
81 Description: Voice Buffering implementation on C+ for PTT via PCM API | 81 Description: Voice Buffering implementation on C+ for PTT via PCM API |
82 Solution: Defined a global variable gPcm_voice_Memo which indicates which Voice memo is active | 82 Solution: Defined a global variable gPcm_voice_Memo which indicates which Voice memo is active |
83 and corresponding audio APIs will be invoked and duplication of code is avoided | 83 and corresponding audio APIs will be invoked and duplication of code is avoided |
84 | 84 |
85 Feb 24, 2006 ER: OMAPS00067709 x0pleela | 85 Feb 24, 2006 ER: OMAPS00067709 x0pleela |
86 Description: Voice Buffering implementation on C+ for PTT via PCM API | 86 Description: Voice Buffering implementation on C+ for PTT via PCM API |
87 Solution: Defined new macro PCM_VOICE_MEMO_MAX_DURATION which defines maximum | 87 Solution: Defined new macro PCM_VOICE_MEMO_MAX_DURATION which defines maximum |
88 recording and playing duration for PCM voice memo and voice buffering | 88 recording and playing duration for PCM voice memo and voice buffering |
89 Implemented following functions to support PCM voice memo feature | 89 Implemented following functions to support PCM voice memo feature |
90 pcm_voice_memo_init: Initialization of PCM voice memo | 90 pcm_voice_memo_init: Initialization of PCM voice memo |
91 pcm_voice_memo_exit:Termination of PCM voice memo | 91 pcm_voice_memo_exit:Termination of PCM voice memo |
92 pcm_voice_memo_play:Starts PCM voice memo play functionality | 92 pcm_voice_memo_play:Starts PCM voice memo play functionality |
98 pcm_voice_memo_win_cb:Callback function for information dialog | 98 pcm_voice_memo_win_cb:Callback function for information dialog |
99 pcm_voice_memo_tim_cb: Callback function for the PCM voice_memo timer. | 99 pcm_voice_memo_tim_cb: Callback function for the PCM voice_memo timer. |
100 pcm_voice_memo_kbd_cb: Keyboard event handler | 100 pcm_voice_memo_kbd_cb: Keyboard event handler |
101 pcm_voice_memo_riv_record_cb: Callback that handles the return status for PCM voice memo recording | 101 pcm_voice_memo_riv_record_cb: Callback that handles the return status for PCM voice memo recording |
102 pcm_voice_memo_riv_play_cb:Callback that handles the return status for PCM voice memo palying | 102 pcm_voice_memo_riv_play_cb:Callback that handles the return status for PCM voice memo palying |
103 | 103 |
104 09/04/01 Original Condat(UK) BMI version. | 104 09/04/01 Original Condat(UK) BMI version. |
105 | 105 |
106 $End | 106 $End |
107 | 107 |
108 *******************************************************************************/ | 108 *******************************************************************************/ |
229 } T_voice_memo; | 229 } T_voice_memo; |
230 | 230 |
231 //x0pleela 09 Mar, 2006 ER:OMAPS00067709 | 231 //x0pleela 09 Mar, 2006 ER:OMAPS00067709 |
232 #ifdef FF_PCM_VM_VB | 232 #ifdef FF_PCM_VM_VB |
233 EXTERN T_voice_buffering voice_buffering_data; | 233 EXTERN T_voice_buffering voice_buffering_data; |
234 EXTERN T_call call_data; | 234 EXTERN T_call call_data; |
235 #endif | 235 #endif |
236 /******************************************************************************* | 236 /******************************************************************************* |
237 | 237 |
238 Local prototypes | 238 Local prototypes |
239 | 239 |
277 | 277 |
278 *******************************************************************************/ | 278 *******************************************************************************/ |
279 GLOBAL void voice_memo_init (void) | 279 GLOBAL void voice_memo_init (void) |
280 { | 280 { |
281 TRACE_FUNCTION ("voice_memo_init()"); | 281 TRACE_FUNCTION ("voice_memo_init()"); |
282 | 282 |
283 #ifdef FF_PCM_VM_VB | 283 #ifdef FF_PCM_VM_VB |
284 voice_buffering_data_reset(); | 284 voice_buffering_data_reset(); |
285 #endif | 285 #endif |
286 | 286 |
287 } | 287 } |
288 | 288 |
289 /******************************************************************************* | 289 /******************************************************************************* |
290 | 290 |
291 $Function: voice_memo_exit | 291 $Function: voice_memo_exit |
299 | 299 |
300 *******************************************************************************/ | 300 *******************************************************************************/ |
301 GLOBAL void voice_memo_exit (void) | 301 GLOBAL void voice_memo_exit (void) |
302 { | 302 { |
303 TRACE_FUNCTION ("voice_memo_exit()"); | 303 TRACE_FUNCTION ("voice_memo_exit()"); |
304 | 304 |
305 } | 305 } |
306 | 306 |
307 | 307 |
308 | 308 |
309 | 309 |
327 //x0pleela 27 Feb, 2006 ER: OMAPA00067709 | 327 //x0pleela 27 Feb, 2006 ER: OMAPA00067709 |
328 //Set this variable to VOICE_MEMOwhich indicates voice memo is active | 328 //Set this variable to VOICE_MEMOwhich indicates voice memo is active |
329 #ifdef FF_PCM_VM_VB | 329 #ifdef FF_PCM_VM_VB |
330 set_voice_memo_type( AMR_VOICE_MEMO); | 330 set_voice_memo_type( AMR_VOICE_MEMO); |
331 #endif | 331 #endif |
332 | 332 |
333 //create a new voice memo dialog | 333 //create a new voice memo dialog |
334 voice_memo_start (win, VM_PLAY); | 334 voice_memo_start (win, VM_PLAY); |
335 return 1; // ADDED BY RAVI - 29-11-2005 | 335 return 1; // ADDED BY RAVI - 29-11-2005 |
336 } | 336 } |
337 | 337 |
359 { | 359 { |
360 case 0: | 360 case 0: |
361 txtId = TxtFFS; | 361 txtId = TxtFFS; |
362 FFS_flashData.PCM_voicememo_storage = SNAP_STG_FFS; | 362 FFS_flashData.PCM_voicememo_storage = SNAP_STG_FFS; |
363 break; | 363 break; |
364 | 364 |
365 case 1: | 365 case 1: |
366 txtId = TxtNORMS; | 366 txtId = TxtNORMS; |
367 FFS_flashData.PCM_voicememo_storage = SNAP_STG_NORMS; | 367 FFS_flashData.PCM_voicememo_storage = SNAP_STG_NORMS; |
368 break; | 368 break; |
369 | 369 |
370 case 2: | 370 case 2: |
371 txtId = TxtNAND; | 371 txtId = TxtNAND; |
372 FFS_flashData.PCM_voicememo_storage = SNAP_STG_NAND; | 372 FFS_flashData.PCM_voicememo_storage = SNAP_STG_NAND; |
373 break; | 373 break; |
374 | 374 |
375 case 3: | 375 case 3: |
376 txtId = TxtTflash; | 376 txtId = TxtTflash; |
377 FFS_flashData.PCM_voicememo_storage = SNAP_STG_MMC; | 377 FFS_flashData.PCM_voicememo_storage = SNAP_STG_MMC; |
378 break; | 378 break; |
379 } | 379 } |
381 flash_write(); | 381 flash_write(); |
382 //Set the Quality Factor. | 382 //Set the Quality Factor. |
383 TRACE_EVENT_P1("STorage set to %d ", FFS_flashData.PCM_voicememo_storage); | 383 TRACE_EVENT_P1("STorage set to %d ", FFS_flashData.PCM_voicememo_storage); |
384 //Display the dialgbox to the user. | 384 //Display the dialgbox to the user. |
385 voice_memo_dialog_create(parent_win,txtId,TxtSelected); | 385 voice_memo_dialog_create(parent_win,txtId,TxtSelected); |
386 return MFW_EVENT_CONSUMED; | 386 return MFW_EVENT_CONSUMED; |
387 } | 387 } |
388 | 388 |
389 /******************************************************************************* | 389 /******************************************************************************* |
390 | 390 |
391 $Function: voice_memo_storeage | 391 $Function: voice_memo_storeage |
409 { | 409 { |
410 case 0: | 410 case 0: |
411 txtId = TxtFFS; | 411 txtId = TxtFFS; |
412 FFS_flashData.voicebuffer_storage = SNAP_STG_FFS; | 412 FFS_flashData.voicebuffer_storage = SNAP_STG_FFS; |
413 break; | 413 break; |
414 | 414 |
415 case 1: | 415 case 1: |
416 txtId = TxtNORMS; | 416 txtId = TxtNORMS; |
417 FFS_flashData.voicebuffer_storage = SNAP_STG_NORMS; | 417 FFS_flashData.voicebuffer_storage = SNAP_STG_NORMS; |
418 break; | 418 break; |
419 | 419 |
420 case 2: | 420 case 2: |
421 txtId = TxtNAND; | 421 txtId = TxtNAND; |
422 FFS_flashData.voicebuffer_storage = SNAP_STG_NAND; | 422 FFS_flashData.voicebuffer_storage = SNAP_STG_NAND; |
423 break; | 423 break; |
424 | 424 |
425 case 3: | 425 case 3: |
426 txtId = TxtTflash; | 426 txtId = TxtTflash; |
427 FFS_flashData.voicebuffer_storage = SNAP_STG_MMC; | 427 FFS_flashData.voicebuffer_storage = SNAP_STG_MMC; |
428 break; | 428 break; |
429 } | 429 } |
431 flash_write(); | 431 flash_write(); |
432 //Set the Quality Factor. | 432 //Set the Quality Factor. |
433 TRACE_EVENT_P1("STorage set to %d ", FFS_flashData.voicebuffer_storage); | 433 TRACE_EVENT_P1("STorage set to %d ", FFS_flashData.voicebuffer_storage); |
434 //Display the dialgbox to the user. | 434 //Display the dialgbox to the user. |
435 voice_memo_dialog_create(parent_win,txtId,TxtSelected); | 435 voice_memo_dialog_create(parent_win,txtId,TxtSelected); |
436 return MFW_EVENT_CONSUMED; | 436 return MFW_EVENT_CONSUMED; |
437 } | 437 } |
438 | 438 |
439 /******************************************************************************* | 439 /******************************************************************************* |
440 | 440 |
441 $Function: voice_memo_storeage | 441 $Function: voice_memo_storeage |
459 { | 459 { |
460 case 0: | 460 case 0: |
461 txtId = TxtFFS; | 461 txtId = TxtFFS; |
462 FFS_flashData.voicememo_storage = SNAP_STG_FFS; | 462 FFS_flashData.voicememo_storage = SNAP_STG_FFS; |
463 break; | 463 break; |
464 | 464 |
465 case 1: | 465 case 1: |
466 txtId = TxtNORMS; | 466 txtId = TxtNORMS; |
467 FFS_flashData.voicememo_storage = SNAP_STG_NORMS; | 467 FFS_flashData.voicememo_storage = SNAP_STG_NORMS; |
468 break; | 468 break; |
469 | 469 |
470 case 2: | 470 case 2: |
471 txtId = TxtNAND; | 471 txtId = TxtNAND; |
472 FFS_flashData.voicememo_storage = SNAP_STG_NAND; | 472 FFS_flashData.voicememo_storage = SNAP_STG_NAND; |
473 break; | 473 break; |
474 | 474 |
475 case 3: | 475 case 3: |
476 txtId = TxtTflash; | 476 txtId = TxtTflash; |
477 FFS_flashData.voicememo_storage = SNAP_STG_MMC; | 477 FFS_flashData.voicememo_storage = SNAP_STG_MMC; |
478 break; | 478 break; |
479 } | 479 } |
481 flash_write(); | 481 flash_write(); |
482 //Set the Quality Factor. | 482 //Set the Quality Factor. |
483 TRACE_EVENT_P1("STorage set to %d ", FFS_flashData.voicememo_storage); | 483 TRACE_EVENT_P1("STorage set to %d ", FFS_flashData.voicememo_storage); |
484 //Display the dialgbox to the user. | 484 //Display the dialgbox to the user. |
485 voice_memo_dialog_create(parent_win,txtId,TxtSelected); | 485 voice_memo_dialog_create(parent_win,txtId,TxtSelected); |
486 return MFW_EVENT_CONSUMED; | 486 return MFW_EVENT_CONSUMED; |
487 } | 487 } |
488 #endif | 488 #endif |
489 | 489 |
490 | 490 |
491 /******************************************************************************* | 491 /******************************************************************************* |
578 | 578 |
579 /* | 579 /* |
580 ** Initialise values to safe defualts | 580 ** Initialise values to safe defualts |
581 */ | 581 */ |
582 data->play_sk2 = TxtSoftBack; | 582 data->play_sk2 = TxtSoftBack; |
583 | 583 |
584 /* | 584 /* |
585 * return window handle | 585 * return window handle |
586 */ | 586 */ |
587 return data->info_win; | 587 return data->info_win; |
588 } | 588 } |
627 /* | 627 /* |
628 * Free Memory | 628 * Free Memory |
629 */ | 629 */ |
630 FREE_MEMORY ((void *)data, sizeof (T_voice_memo)); | 630 FREE_MEMORY ((void *)data, sizeof (T_voice_memo)); |
631 } | 631 } |
632 | 632 |
633 //x0pleela 27 Feb, 2006 ER: OMAPA00067709 | 633 //x0pleela 27 Feb, 2006 ER: OMAPA00067709 |
634 //Set gVoiceMemo to NONE while destroying voice memo dialog | 634 //Set gVoiceMemo to NONE while destroying voice memo dialog |
635 #ifdef FF_PCM_VM_VB | 635 #ifdef FF_PCM_VM_VB |
636 set_voice_memo_type( NONE); | 636 set_voice_memo_type( NONE); |
637 #endif | 637 #endif |
654 { | 654 { |
655 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data; | 655 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data; |
656 T_voice_memo * data = (T_voice_memo *)win_data->user; | 656 T_voice_memo * data = (T_voice_memo *)win_data->user; |
657 | 657 |
658 // T_DISPLAY_DATA display_info; // RAVI | 658 // T_DISPLAY_DATA display_info; // RAVI |
659 | 659 |
660 SHORT mfw_aud_retVal = 0; /* x0039928 - Lint warning fix */ | 660 SHORT mfw_aud_retVal = 0; /* x0039928 - Lint warning fix */ |
661 #ifdef FF_PCM_VM_VB | 661 #ifdef FF_PCM_VM_VB |
662 UBYTE vm_type; //to store voice memo type | 662 UBYTE vm_type; //to store voice memo type |
663 #endif | 663 #endif |
664 | 664 |
665 | 665 |
666 data->Identifier = value; | 666 data->Identifier = value; |
683 | 683 |
684 | 684 |
685 if (value EQ VM_PLAY) | 685 if (value EQ VM_PLAY) |
686 { | 686 { |
687 TRACE_EVENT ("VM_PLAY()"); | 687 TRACE_EVENT ("VM_PLAY()"); |
688 | 688 |
689 mfw_aud_retVal = mfw_aud_vm_start_playback(voice_memo_riv_play_cb); | 689 mfw_aud_retVal = mfw_aud_vm_start_playback(voice_memo_riv_play_cb); |
690 | 690 |
691 if (mfw_aud_retVal == MFW_AUD_VM_OK) | 691 if (mfw_aud_retVal == MFW_AUD_VM_OK) |
692 { | 692 { |
693 //start the second timer | 693 //start the second timer |
694 data->time = 0; | 694 data->time = 0; |
695 tim_start (data->info_tim); | 695 tim_start (data->info_tim); |
696 | 696 |
697 //Set the Right Softkey Id | 697 //Set the Right Softkey Id |
698 data->play_sk2 = TxtStop; | 698 data->play_sk2 = TxtStop; |
699 } | 699 } |
700 else | 700 else |
701 { | 701 { |
705 } | 705 } |
706 else | 706 else |
707 { | 707 { |
708 //Display a dialog and exit | 708 //Display a dialog and exit |
709 TRACE_EVENT_P1 ("ERROR : mfw_aud_vm_start_playback failed with return value : %d", mfw_aud_retVal); | 709 TRACE_EVENT_P1 ("ERROR : mfw_aud_vm_start_playback failed with return value : %d", mfw_aud_retVal); |
710 | 710 |
711 voice_memo_dialog_create( win, TxtPlayback, TxtFailed); | 711 voice_memo_dialog_create( win, TxtPlayback, TxtFailed); |
712 } | 712 } |
713 } | 713 } |
714 } | 714 } |
715 else if (value EQ VM_RECORD) | 715 else if (value EQ VM_RECORD) |
720 #ifdef FF_PCM_VM_VB | 720 #ifdef FF_PCM_VM_VB |
721 //get the voice memo type | 721 //get the voice memo type |
722 vm_type = get_voice_memo_type(); | 722 vm_type = get_voice_memo_type(); |
723 | 723 |
724 if(vm_type EQ PCM_VOICE_MEMO) | 724 if(vm_type EQ PCM_VOICE_MEMO) |
725 mfw_aud_retVal = mfw_aud_vm_start_record(PCM_VOICE_MEMO_MAX_DURATION, | 725 mfw_aud_retVal = mfw_aud_vm_start_record(PCM_VOICE_MEMO_MAX_DURATION, |
726 voice_memo_riv_record_cb); | 726 voice_memo_riv_record_cb); |
727 else | 727 else |
728 { | 728 { |
729 if(vm_type EQ AMR_VOICE_MEMO ) | 729 if(vm_type EQ AMR_VOICE_MEMO ) |
730 #endif | 730 #endif |
731 mfw_aud_retVal = mfw_aud_vm_start_record(VOICE_MEMO_MAX_DURATION, voice_memo_riv_record_cb); | 731 mfw_aud_retVal = mfw_aud_vm_start_record(VOICE_MEMO_MAX_DURATION, voice_memo_riv_record_cb); |
732 #ifdef FF_PCM_VM_VB | 732 #ifdef FF_PCM_VM_VB |
733 } | 733 } |
734 #endif | 734 #endif |
735 | 735 |
736 // If the Riviera call failed | 736 // If the Riviera call failed |
737 if (mfw_aud_retVal == MFW_AUD_VM_OK) | 737 if (mfw_aud_retVal == MFW_AUD_VM_OK) |
738 { | 738 { |
739 //start the second timer | 739 //start the second timer |
740 data->time = 0; | 740 data->time = 0; |
746 { | 746 { |
747 TRACE_EVENT ("memory full "); | 747 TRACE_EVENT ("memory full "); |
748 /* RAVI - 20-1-2006 */ | 748 /* RAVI - 20-1-2006 */ |
749 /* Silent Implementation */ | 749 /* Silent Implementation */ |
750 #ifdef NEPTUNE_BOARD | 750 #ifdef NEPTUNE_BOARD |
751 audio_PlaySoundID(0, TONES_KEYBEEP, getCurrentVoulmeSettings(), | 751 audio_PlaySoundID(0, TONES_KEYBEEP, getCurrentVoulmeSettings(), |
752 AUDIO_PLAY_ONCE ); /* GW#2355 /CQ11341 */ | 752 AUDIO_PLAY_ONCE ); /* GW#2355 /CQ11341 */ |
753 #else | 753 #else |
754 /* play Keybeep */ | 754 /* play Keybeep */ |
755 audio_PlaySoundID(0, TONES_KEYBEEP, 200, AUDIO_PLAY_ONCE ); /* GW#2355 /CQ11341 */ | 755 audio_PlaySoundID(0, TONES_KEYBEEP, 200, AUDIO_PLAY_ONCE ); /* GW#2355 /CQ11341 */ |
756 #endif | 756 #endif |
757 /* END RAVI */ | 757 /* END RAVI */ |
758 | 758 |
759 voice_memo_dialog_create( win, TxtRecording, TxtFull ); | 759 voice_memo_dialog_create( win, TxtRecording, TxtFull ); |
760 } | 760 } |
761 else | 761 else |
762 { | 762 { |
763 //Display a dialog and exit | 763 //Display a dialog and exit |
764 TRACE_EVENT_P1 ("ERROR : mfw_aud_vm_start_record failed with return value : %d", mfw_aud_retVal); | 764 TRACE_EVENT_P1 ("ERROR : mfw_aud_vm_start_record failed with return value : %d", mfw_aud_retVal); |
765 | 765 |
766 voice_memo_dialog_create( win, TxtRecording, TxtFailed ); | 766 voice_memo_dialog_create( win, TxtRecording, TxtFailed ); |
767 } | 767 } |
768 } | 768 } |
769 } | 769 } |
770 win_show (win); | 770 win_show (win); |
887 //to store PCM/AMR voice memo record/play duration | 887 //to store PCM/AMR voice memo record/play duration |
888 USHORT vm_duration = 0; /* x0039928 - Lint warning fix */ | 888 USHORT vm_duration = 0; /* x0039928 - Lint warning fix */ |
889 // char buf[40]; // RAVI | 889 // char buf[40]; // RAVI |
890 | 890 |
891 //x0pleela 08 Mar, 2006 ER:OMAPS00067709 | 891 //x0pleela 08 Mar, 2006 ER:OMAPS00067709 |
892 #ifdef FF_PCM_VM_VB | 892 #ifdef FF_PCM_VM_VB |
893 UBYTE vm_type; //to store voice memo type | 893 UBYTE vm_type; //to store voice memo type |
894 #endif | 894 #endif |
895 | 895 |
896 TRACE_FUNCTION ("voice_memo_tim_cb()"); | 896 TRACE_FUNCTION ("voice_memo_tim_cb()"); |
897 | 897 |
901 //get the voice memo type | 901 //get the voice memo type |
902 vm_type = get_voice_memo_type(); | 902 vm_type = get_voice_memo_type(); |
903 | 903 |
904 if(vm_type EQ PCM_VOICE_MEMO) | 904 if(vm_type EQ PCM_VOICE_MEMO) |
905 vm_duration = PCM_VOICE_MEMO_MAX_DURATION; | 905 vm_duration = PCM_VOICE_MEMO_MAX_DURATION; |
906 else | 906 else |
907 { | 907 { |
908 if (vm_type EQ AMR_VOICE_MEMO) | 908 if (vm_type EQ AMR_VOICE_MEMO) |
909 #endif | 909 #endif |
910 vm_duration = VOICE_MEMO_MAX_DURATION; | 910 vm_duration = VOICE_MEMO_MAX_DURATION; |
911 #ifdef FF_PCM_VM_VB | 911 #ifdef FF_PCM_VM_VB |
912 } | 912 } |
913 #endif | 913 #endif |
914 | 914 |
915 switch (data->Identifier) | 915 switch (data->Identifier) |
916 { | 916 { |
948 | 948 |
949 | 949 |
950 case VM_RECORD: | 950 case VM_RECORD: |
951 | 951 |
952 data->time++; | 952 data->time++; |
953 | 953 |
954 if (data->time < vm_duration) | 954 if (data->time < vm_duration) |
955 { | 955 { |
956 TRACE_EVENT ("continue the second timer"); | 956 TRACE_EVENT ("continue the second timer"); |
957 //x0pleela 27 Feb, 2006 ER:OMAPS00067709 | 957 //x0pleela 27 Feb, 2006 ER:OMAPS00067709 |
958 //changed from Macro VOICE_MEMO_MAX_DURATION to local variable vm_duration | 958 //changed from Macro VOICE_MEMO_MAX_DURATION to local variable vm_duration |
967 else | 967 else |
968 { | 968 { |
969 //x0pleela 27 Feb, 2006 ER:OMAPS00067709 | 969 //x0pleela 27 Feb, 2006 ER:OMAPS00067709 |
970 //changed from Macro VOICE_MEMO_MAX_DURATION to local variable vm_duration | 970 //changed from Macro VOICE_MEMO_MAX_DURATION to local variable vm_duration |
971 mfw_aud_vm_set_duration(vm_duration); | 971 mfw_aud_vm_set_duration(vm_duration); |
972 | 972 |
973 #ifndef _SIMULATION_ | 973 #ifndef _SIMULATION_ |
974 /* | 974 /* |
975 ** Stop recording the Voice Memo. | 975 ** Stop recording the Voice Memo. |
976 */ | 976 */ |
977 mfw_aud_retVal = mfw_aud_vm_stop_record(voice_memo_riv_record_cb); | 977 mfw_aud_retVal = mfw_aud_vm_stop_record(voice_memo_riv_record_cb); |
1036 #ifndef _SIMULATION_ | 1036 #ifndef _SIMULATION_ |
1037 /* | 1037 /* |
1038 ** Stop playing the Voice Memo and Delete it. | 1038 ** Stop playing the Voice Memo and Delete it. |
1039 */ | 1039 */ |
1040 mfw_aud_retVal = mfw_aud_vm_stop_playback(voice_memo_riv_play_cb); | 1040 mfw_aud_retVal = mfw_aud_vm_stop_playback(voice_memo_riv_play_cb); |
1041 | 1041 |
1042 if (mfw_aud_retVal != MFW_AUD_VM_OK) | 1042 if (mfw_aud_retVal != MFW_AUD_VM_OK) |
1043 TRACE_EVENT_P1 ("ERROR : mfw_aud_vm_stop_playback failed with return value : %d", mfw_aud_retVal); | 1043 TRACE_EVENT_P1 ("ERROR : mfw_aud_vm_stop_playback failed with return value : %d", mfw_aud_retVal); |
1044 #else | 1044 #else |
1045 TRACE_EVENT("call mfw_aud_vm_stop_playback()"); | 1045 TRACE_EVENT("call mfw_aud_vm_stop_playback()"); |
1046 #endif | 1046 #endif |
1053 SEND_EVENT (win, VM_DELETE_BUFFER, 0, 0); | 1053 SEND_EVENT (win, VM_DELETE_BUFFER, 0, 0); |
1054 } | 1054 } |
1055 else if (Identifier EQ VM_RECORD) | 1055 else if (Identifier EQ VM_RECORD) |
1056 { | 1056 { |
1057 mfw_aud_vm_set_duration(data->time); | 1057 mfw_aud_vm_set_duration(data->time); |
1058 | 1058 |
1059 #ifndef _SIMULATION_ | 1059 #ifndef _SIMULATION_ |
1060 /* | 1060 /* |
1061 ** Stop recording the Voice Memo. | 1061 ** Stop recording the Voice Memo. |
1062 */ | 1062 */ |
1063 mfw_aud_retVal = mfw_aud_vm_stop_record(voice_memo_riv_record_cb); | 1063 mfw_aud_retVal = mfw_aud_vm_stop_record(voice_memo_riv_record_cb); |
1064 | 1064 |
1065 if (mfw_aud_retVal != MFW_AUD_VM_OK) | 1065 if (mfw_aud_retVal != MFW_AUD_VM_OK) |
1066 TRACE_EVENT_P1 ("ERROR : mfw_aud_vm_stop_record failed with return value : %d", mfw_aud_retVal); | 1066 TRACE_EVENT_P1 ("ERROR : mfw_aud_vm_stop_record failed with return value : %d", mfw_aud_retVal); |
1067 | 1067 |
1068 //go back to the previous dialog | 1068 //go back to the previous dialog |
1069 SEND_EVENT (win, VM_DESTROY, 0, 0); | 1069 SEND_EVENT (win, VM_DESTROY, 0, 0); |
1070 #else | 1070 #else |
1071 TRACE_EVENT("call mfw_aud_vm_stop_record()"); | 1071 TRACE_EVENT("call mfw_aud_vm_stop_record()"); |
1072 #endif | 1072 #endif |
1080 #ifndef _SIMULATION_ | 1080 #ifndef _SIMULATION_ |
1081 /* | 1081 /* |
1082 ** Stop playing the Voice Memo. | 1082 ** Stop playing the Voice Memo. |
1083 */ | 1083 */ |
1084 mfw_aud_retVal = mfw_aud_vm_stop_playback(voice_memo_riv_play_cb); | 1084 mfw_aud_retVal = mfw_aud_vm_stop_playback(voice_memo_riv_play_cb); |
1085 | 1085 |
1086 if (mfw_aud_retVal != MFW_AUD_VM_OK) | 1086 if (mfw_aud_retVal != MFW_AUD_VM_OK) |
1087 TRACE_EVENT_P1 ("ERROR : mfw_aud_vm_stop_playback failed with return value : %d", mfw_aud_retVal); | 1087 TRACE_EVENT_P1 ("ERROR : mfw_aud_vm_stop_playback failed with return value : %d", mfw_aud_retVal); |
1088 #else | 1088 #else |
1089 TRACE_EVENT("call mfw_aud_vm_stop_playback()"); | 1089 TRACE_EVENT("call mfw_aud_vm_stop_playback()"); |
1090 #endif | 1090 #endif |
1152 | 1152 |
1153 *******************************************************************************/ | 1153 *******************************************************************************/ |
1154 static void voice_memo_dialog_create(T_MFW_HND win, int str1, int str2) | 1154 static void voice_memo_dialog_create(T_MFW_HND win, int str1, int str2) |
1155 { | 1155 { |
1156 T_DISPLAY_DATA display_info; | 1156 T_DISPLAY_DATA display_info; |
1157 | 1157 |
1158 TRACE_FUNCTION ("voice_memo_dialog_create()"); | 1158 TRACE_FUNCTION ("voice_memo_dialog_create()"); |
1159 | 1159 |
1160 dlg_initDisplayData_TextId( &display_info, TxtNull, TxtNull, str1, str2, COLOUR_STATUS); | 1160 dlg_initDisplayData_TextId( &display_info, TxtNull, TxtNull, str1, str2, COLOUR_STATUS); |
1161 dlg_initDisplayData_events( &display_info, (T_VOID_FUNC)voice_memo_dialog_cb, THREE_SECS, KEY_CLEAR | KEY_RIGHT | KEY_LEFT ); | 1161 dlg_initDisplayData_events( &display_info, (T_VOID_FUNC)voice_memo_dialog_cb, THREE_SECS, KEY_CLEAR | KEY_RIGHT | KEY_LEFT ); |
1162 /* | 1162 /* |
1196 { | 1196 { |
1197 TRACE_EVENT_P1("INFO : voice_memo_riv_record_cb received AUDIO_OK, recorded duration is %d", | 1197 TRACE_EVENT_P1("INFO : voice_memo_riv_record_cb received AUDIO_OK, recorded duration is %d", |
1198 record_status->recorded_duration); | 1198 record_status->recorded_duration); |
1199 mfw_aud_vm_set_duration((UINT8)record_status->recorded_duration); | 1199 mfw_aud_vm_set_duration((UINT8)record_status->recorded_duration); |
1200 } | 1200 } |
1201 #ifdef FF_PCM_VM_VB | 1201 #ifdef FF_PCM_VM_VB |
1202 } | 1202 } |
1203 break; | 1203 break; |
1204 | 1204 |
1205 case PCM_VOICE_MEMO: | 1205 case PCM_VOICE_MEMO: |
1206 { | 1206 { |
1207 T_AUDIO_VM_PCM_RECORD_STATUS *pcm_vm_record_status; | 1207 T_AUDIO_VM_PCM_RECORD_STATUS *pcm_vm_record_status; |
1208 | 1208 |
1209 pcm_vm_record_status = (T_AUDIO_VM_PCM_RECORD_STATUS *)parameter; | 1209 pcm_vm_record_status = (T_AUDIO_VM_PCM_RECORD_STATUS *)parameter; |
1210 if (pcm_vm_record_status->status != AUDIO_OK) | 1210 if (pcm_vm_record_status->status != AUDIO_OK) |
1211 { | 1211 { |
1212 TRACE_EVENT_P1("ERROR : voice_memo_riv_record_cb received AUDIO_ERROR, recorded duration is %d", | 1212 TRACE_EVENT_P1("ERROR : voice_memo_riv_record_cb received AUDIO_ERROR, recorded duration is %d", |
1213 pcm_vm_record_status->recorded_duration); | 1213 pcm_vm_record_status->recorded_duration); |
1218 pcm_vm_record_status->recorded_duration); | 1218 pcm_vm_record_status->recorded_duration); |
1219 mfw_aud_vm_set_duration((UINT8)pcm_vm_record_status->recorded_duration); | 1219 mfw_aud_vm_set_duration((UINT8)pcm_vm_record_status->recorded_duration); |
1220 } | 1220 } |
1221 } | 1221 } |
1222 break; | 1222 break; |
1223 | 1223 |
1224 case VOICE_BUFFERING: | 1224 case VOICE_BUFFERING: |
1225 { | 1225 { |
1226 T_AUDIO_VBUF_PCM_RECORD_STATUS *vbuf_pcm_record_status; | 1226 T_AUDIO_VBUF_PCM_RECORD_STATUS *vbuf_pcm_record_status; |
1227 | 1227 |
1228 vbuf_pcm_record_status = (T_AUDIO_VBUF_PCM_RECORD_STATUS *)parameter; | 1228 vbuf_pcm_record_status = (T_AUDIO_VBUF_PCM_RECORD_STATUS *)parameter; |
1229 | 1229 |
1230 if (vbuf_pcm_record_status->status != AUDIO_OK) | 1230 if (vbuf_pcm_record_status->status != AUDIO_OK) |
1231 { | 1231 { |
1232 TRACE_EVENT_P1("ERROR : voice_memo_riv_record_cb received AUDIO_ERROR, recorded duration is %d", | 1232 TRACE_EVENT_P1("ERROR : voice_memo_riv_record_cb received AUDIO_ERROR, recorded duration is %d", |
1233 vbuf_pcm_record_status->recorded_duration); | 1233 vbuf_pcm_record_status->recorded_duration); |
1234 } | 1234 } |
1238 vbuf_pcm_record_status->recorded_duration); | 1238 vbuf_pcm_record_status->recorded_duration); |
1239 //x0pleela 13 Mar, 2006 ER:OMAPS00067709 | 1239 //x0pleela 13 Mar, 2006 ER:OMAPS00067709 |
1240 //check for reason to call record_stop | 1240 //check for reason to call record_stop |
1241 switch( voice_buffering_data.rec_stop_reason) | 1241 switch( voice_buffering_data.rec_stop_reason) |
1242 { | 1242 { |
1243 case CALLING_PARTY_END_CALL: //calling party hangs up | 1243 case CALLING_PARTY_END_CALL: //calling party hangs up |
1244 case CALLED_PARTY_END_CALL: //called party hangs up | 1244 case CALLED_PARTY_END_CALL: //called party hangs up |
1245 voice_buffering_data.call_active = FALSE; | 1245 voice_buffering_data.call_active = FALSE; |
1246 break; | 1246 break; |
1247 | 1247 |
1248 case PLAY_ERROR: //recording timeout while playing | 1248 case PLAY_ERROR: //recording timeout while playing |
1249 voice_buffering_data.buffering_phase = FALSE; | 1249 voice_buffering_data.buffering_phase = FALSE; |
1250 break; | 1250 break; |
1251 | 1251 |
1252 case CALL_END_BEF_SETUP: //calling party hangs up before call setup | 1252 case CALL_END_BEF_SETUP: //calling party hangs up before call setup |
1253 case USER_SEL_STOP: //user selected "STOP" option, then just return | 1253 case USER_SEL_STOP: //user selected "STOP" option, then just return |
1254 case RECORDING_TIMEOUT: //recording timeout | 1254 case RECORDING_TIMEOUT: //recording timeout |
1255 case CALLED_PARTY_NOT_AVAILABLE: //not reachable | 1255 case CALLED_PARTY_NOT_AVAILABLE: //not reachable |
1256 default: | 1256 default: |
1257 break; | 1257 break; |
1258 } | 1258 } |
1259 voice_buffering_data.recording_possible = TRUE; | 1259 voice_buffering_data.recording_possible = TRUE; |
1260 voice_buffering_data.incoming_call_discon = FALSE; | 1260 voice_buffering_data.incoming_call_discon = FALSE; |
1261 //destroy timer | 1261 //destroy timer |
1262 timDelete(voice_buffering_data.voice_buffering_tim); | 1262 timDelete(voice_buffering_data.voice_buffering_tim); |
1263 } | 1263 } |
1264 //x0pleela 03 Apr, 2006 ER: OMAPS00067709 | 1264 //x0pleela 03 Apr, 2006 ER: OMAPS00067709 |
1265 //Set voice memo type to NONE | 1265 //Set voice memo type to NONE |
1266 set_voice_memo_type(NONE); | 1266 set_voice_memo_type(NONE); |
1267 } | 1267 } |
1268 | 1268 |
1269 break; | 1269 break; |
1270 | 1270 |
1271 default: | 1271 default: |
1272 break; | 1272 break; |
1273 } | 1273 } |
1274 | 1274 |
1275 | 1275 |
1276 | 1276 |
1277 #endif /* FF_PCM_VM_VB */ | 1277 #endif /* FF_PCM_VM_VB */ |
1278 | 1278 |
1279 /* BEGIN ADD: Req ID: : Sumit : 14-Mar-05 */ | 1279 /* BEGIN ADD: Req ID: : Sumit : 14-Mar-05 */ |
1280 #endif /* NEPTUNE_BOARD */ | 1280 #endif /* NEPTUNE_BOARD */ |
1281 /* END ADD: Req ID: : Sumit : 14-Mar-05 */ | 1281 /* END ADD: Req ID: : Sumit : 14-Mar-05 */ |
1282 | 1282 |
1283 } | 1283 } |
1310 } | 1310 } |
1311 else | 1311 else |
1312 { | 1312 { |
1313 TRACE_EVENT("INFO : voice_memo_riv_play_cb received AUDIO_OK"); | 1313 TRACE_EVENT("INFO : voice_memo_riv_play_cb received AUDIO_OK"); |
1314 } | 1314 } |
1315 | 1315 |
1316 #ifdef FF_PCM_VM_VB | 1316 #ifdef FF_PCM_VM_VB |
1317 } | 1317 } |
1318 break; | 1318 break; |
1319 | 1319 |
1320 case PCM_VOICE_MEMO: | 1320 case PCM_VOICE_MEMO: |
1321 { | 1321 { |
1329 { | 1329 { |
1330 TRACE_EVENT("INFO : voice_memo_riv_play_cb received AUDIO_OK"); | 1330 TRACE_EVENT("INFO : voice_memo_riv_play_cb received AUDIO_OK"); |
1331 } | 1331 } |
1332 } | 1332 } |
1333 break; | 1333 break; |
1334 | 1334 |
1335 case VOICE_BUFFERING: | 1335 case VOICE_BUFFERING: |
1336 { | 1336 { |
1337 T_AUDIO_VBUF_PCM_PLAY_STATUS *voice_buffering_play_status; | 1337 T_AUDIO_VBUF_PCM_PLAY_STATUS *voice_buffering_play_status; |
1338 voice_buffering_play_status = (T_AUDIO_VBUF_PCM_PLAY_STATUS *)parameter; | 1338 voice_buffering_play_status = (T_AUDIO_VBUF_PCM_PLAY_STATUS *)parameter; |
1339 | 1339 |
1340 if (voice_buffering_play_status->status != AUDIO_OK) | 1340 if (voice_buffering_play_status->status != AUDIO_OK) |
1341 { | 1341 { |
1342 TRACE_EVENT("ERROR : voice_memo_riv_play_cb received AUDIO_ERROR"); | 1342 TRACE_EVENT("ERROR : voice_memo_riv_play_cb received AUDIO_ERROR"); |
1343 } | 1343 } |
1344 else | 1344 else |
1349 } | 1349 } |
1350 | 1350 |
1351 //x0pleela 06 Jul, 2006 DR: OMAPS00067709 | 1351 //x0pleela 06 Jul, 2006 DR: OMAPS00067709 |
1352 //Fix from AS team | 1352 //Fix from AS team |
1353 vocoder_mute_ul(0); | 1353 vocoder_mute_ul(0); |
1354 | 1354 |
1355 //x0pleela 03 Apr, 2006 ER: OMAPS00067709 | 1355 //x0pleela 03 Apr, 2006 ER: OMAPS00067709 |
1356 //Set voice memo type to NONE | 1356 //Set voice memo type to NONE |
1357 set_voice_memo_type(NONE); | 1357 set_voice_memo_type(NONE); |
1358 } | 1358 } |
1359 | 1359 |
1360 break; | 1360 break; |
1361 | 1361 |
1362 default: | 1362 default: |
1363 break; | 1363 break; |
1364 } | 1364 } |
1365 | 1365 |
1366 | 1366 |
1367 | 1367 |
1368 #endif /* FF_PCM_VM_VB */ | 1368 #endif /* FF_PCM_VM_VB */ |
1369 | 1369 |
1370 /* BEGIN ADD: Req ID: : Sumit : 14-Mar-05 */ | 1370 /* BEGIN ADD: Req ID: : Sumit : 14-Mar-05 */ |
1371 #endif /* NEPTUNE_BOARD*/ | 1371 #endif /* NEPTUNE_BOARD*/ |
1372 /* END ADD: Req ID: : Sumit : 14-Mar-05 */ | 1372 /* END ADD: Req ID: : Sumit : 14-Mar-05 */ |
1378 | 1378 |
1379 /******************************************************************************* | 1379 /******************************************************************************* |
1380 | 1380 |
1381 $Function: pcm_voice_memo_play | 1381 $Function: pcm_voice_memo_play |
1382 | 1382 |
1383 $Description: Sets voice memo type to PCM_VOICE_MEMO which indicates PCM voice memo is | 1383 $Description: Sets voice memo type to PCM_VOICE_MEMO which indicates PCM voice memo is |
1384 active and start playing the voice | 1384 active and start playing the voice |
1385 | 1385 |
1386 $Returns: | 1386 $Returns: |
1387 | 1387 |
1388 $Arguments: | 1388 $Arguments: |
1397 //x0pleela 27 Feb, 2006 ER: OMAPA00067709 | 1397 //x0pleela 27 Feb, 2006 ER: OMAPA00067709 |
1398 //Set this variable to PCM_VOICE_MEMO which indicates PCM voice memo is active | 1398 //Set this variable to PCM_VOICE_MEMO which indicates PCM voice memo is active |
1399 set_voice_memo_type( PCM_VOICE_MEMO); | 1399 set_voice_memo_type( PCM_VOICE_MEMO); |
1400 //create a new voice memo dialog | 1400 //create a new voice memo dialog |
1401 voice_memo_start (win, VM_PLAY); | 1401 voice_memo_start (win, VM_PLAY); |
1402 return 1; | 1402 return 1; |
1403 } | 1403 } |
1404 | 1404 |
1405 /******************************************************************************* | 1405 /******************************************************************************* |
1406 | 1406 |
1407 $Function: pcm_voice_memo_record | 1407 $Function: pcm_voice_memo_record |
1408 | 1408 |
1409 $Description: Sets voice memo type to PCM_VOICE_MEMO which indicates PCM voice memo is | 1409 $Description: Sets voice memo type to PCM_VOICE_MEMO which indicates PCM voice memo is |
1410 active and start recording the voice | 1410 active and start recording the voice |
1411 | 1411 |
1412 | 1412 |
1413 $Returns: | 1413 $Returns: |
1414 | 1414 |
1431 | 1431 |
1432 /******************************************************************************* | 1432 /******************************************************************************* |
1433 | 1433 |
1434 $Function: voice_buffering_edit_num | 1434 $Function: voice_buffering_edit_num |
1435 | 1435 |
1436 $Description: Opens an edtor for the user to enter PTT number. Also resets voice buffering data | 1436 $Description: Opens an edtor for the user to enter PTT number. Also resets voice buffering data |
1437 with default values | 1437 with default values |
1438 | 1438 |
1439 $Returns: | 1439 $Returns: |
1440 | 1440 |
1441 $Arguments: | 1441 $Arguments: |
1447 T_MFW_WIN *win_data = ( (T_MFW_HDR *) win )->data; | 1447 T_MFW_WIN *win_data = ( (T_MFW_HDR *) win )->data; |
1448 tBookStandard *data = (tBookStandard *) win_data->user; | 1448 tBookStandard *data = (tBookStandard *) win_data->user; |
1449 T_phbk *Phbk = data->phbk; | 1449 T_phbk *Phbk = data->phbk; |
1450 | 1450 |
1451 TRACE_FUNCTION ("voice_buffering_edit_num()"); | 1451 TRACE_FUNCTION ("voice_buffering_edit_num()"); |
1452 | 1452 |
1453 set_voice_memo_type( VOICE_BUFFERING ); | 1453 set_voice_memo_type( VOICE_BUFFERING ); |
1454 | 1454 |
1455 memset( Phbk->phbk->edt_buf_number, '\0', PHB_MAX_LEN ); | 1455 memset( Phbk->phbk->edt_buf_number, '\0', PHB_MAX_LEN ); |
1456 Phbk->input_number_win = inputVoiceMemoNumberEditor( win, Phbk->edt_buf_number ); | 1456 Phbk->input_number_win = inputVoiceMemoNumberEditor( win, Phbk->edt_buf_number ); |
1457 | 1457 |
1458 //Reset voice buffering data with default values | 1458 //Reset voice buffering data with default values |
1459 voice_buffering_data_reset(); | 1459 voice_buffering_data_reset(); |
1460 | 1460 |
1461 /* Always return event consumed */ | 1461 /* Always return event consumed */ |
1462 return MFW_EVENT_CONSUMED; | 1462 return MFW_EVENT_CONSUMED; |
1463 } | 1463 } |
1464 | 1464 |
1465 /******************************************************************************* | 1465 /******************************************************************************* |
1466 | 1466 |
1467 $Function: voiceMemoNumberCB | 1467 $Function: voiceMemoNumberCB |
1476 | 1476 |
1477 void voiceMemoNumberCB( T_MFW_HND win, USHORT Identifier, UBYTE reason ) | 1477 void voiceMemoNumberCB( T_MFW_HND win, USHORT Identifier, UBYTE reason ) |
1478 { | 1478 { |
1479 T_MFW_WIN *win_data = ( (T_MFW_HDR *) win )->data; | 1479 T_MFW_WIN *win_data = ( (T_MFW_HDR *) win )->data; |
1480 tBookStandard *data = (tBookStandard *) win_data->user; | 1480 tBookStandard *data = (tBookStandard *) win_data->user; |
1481 | 1481 |
1482 TRACE_FUNCTION("voiceMemoNumberCB()"); | 1482 TRACE_FUNCTION("voiceMemoNumberCB()"); |
1483 | 1483 |
1484 switch ( reason ) | 1484 switch ( reason ) |
1485 { | 1485 { |
1486 case INFO_KCD_LEFT: | 1486 case INFO_KCD_LEFT: |
1490 memcpy( voice_buffering_data.vb_PTTnum, data->phbk->edt_buf_number, strlen(data->phbk->edt_buf_number) ); | 1490 memcpy( voice_buffering_data.vb_PTTnum, data->phbk->edt_buf_number, strlen(data->phbk->edt_buf_number) ); |
1491 SEND_EVENT( data->phbk->input_number_win, E_ED_DESTROY, 0, 0 ); | 1491 SEND_EVENT( data->phbk->input_number_win, E_ED_DESTROY, 0, 0 ); |
1492 data->phbk->input_number_win = 0; | 1492 data->phbk->input_number_win = 0; |
1493 } | 1493 } |
1494 break; | 1494 break; |
1495 | 1495 |
1496 case INFO_KCD_RIGHT: | 1496 case INFO_KCD_RIGHT: |
1497 case INFO_KCD_HUP: | 1497 case INFO_KCD_HUP: |
1498 { | 1498 { |
1499 AUI_edit_Destroy( data->phbk->input_number_win ); | 1499 AUI_edit_Destroy( data->phbk->input_number_win ); |
1500 data->phbk->input_number_win = 0; | 1500 data->phbk->input_number_win = 0; |
1501 } | 1501 } |
1502 break; | 1502 break; |
1503 | 1503 |
1504 default: | 1504 default: |
1505 { | 1505 { |
1506 /* otherwise no action to be performed | 1506 /* otherwise no action to be performed |
1507 */ | 1507 */ |
1508 break; | 1508 break; |
1521 | 1521 |
1522 *******************************************************************************/ | 1522 *******************************************************************************/ |
1523 MfwHnd inputVoiceMemoNumberEditor( MfwHnd parent, void *buffer ) | 1523 MfwHnd inputVoiceMemoNumberEditor( MfwHnd parent, void *buffer ) |
1524 { | 1524 { |
1525 T_AUI_EDITOR_DATA editor_data; | 1525 T_AUI_EDITOR_DATA editor_data; |
1526 | 1526 |
1527 TRACE_FUNCTION ("inputVoiceMemoNumberEditor()"); | 1527 TRACE_FUNCTION ("inputVoiceMemoNumberEditor()"); |
1528 | 1528 |
1529 AUI_edit_SetDefault(&editor_data); | 1529 AUI_edit_SetDefault(&editor_data); |
1530 AUI_edit_SetDisplay(&editor_data, NUMBER_EDITOR, COLOUR_EDITOR_XX, EDITOR_FONT); | 1530 AUI_edit_SetDisplay(&editor_data, NUMBER_EDITOR, COLOUR_EDITOR_XX, EDITOR_FONT); |
1531 AUI_edit_SetEvents(&editor_data, 0, FALSE, FOREVER, (T_AUI_EDIT_CB)voiceMemoNumberCB); | 1531 AUI_edit_SetEvents(&editor_data, 0, FALSE, FOREVER, (T_AUI_EDIT_CB)voiceMemoNumberCB); |
1532 AUI_edit_SetTextStr(&editor_data, TxtSoftOK, TxtDelete, TxtEnterNumber, NULL); | 1532 AUI_edit_SetTextStr(&editor_data, TxtSoftOK, TxtDelete, TxtEnterNumber, NULL); |
1533 AUI_edit_SetAltTextStr(&editor_data, 0, NULL, TRUE, TxtSoftBack); | 1533 AUI_edit_SetAltTextStr(&editor_data, 0, NULL, TRUE, TxtSoftBack); |
1534 AUI_edit_SetBuffer(&editor_data, ATB_DCS_ASCII, (UBYTE *)buffer, NUMBER_LENGTH); | 1534 AUI_edit_SetBuffer(&editor_data, ATB_DCS_ASCII, (UBYTE *)buffer, NUMBER_LENGTH); |
1535 AUI_edit_SetMode(&editor_data, 0, ED_CURSOR_UNDERLINE); | 1535 AUI_edit_SetMode(&editor_data, 0, ED_CURSOR_UNDERLINE); |
1536 | 1536 |
1537 return AUI_edit_Start(parent, &editor_data); | 1537 return AUI_edit_Start(parent, &editor_data); |
1538 } | 1538 } |
1539 | 1539 |
1540 /******************************************************************************* | 1540 /******************************************************************************* |
1541 $Function: voice_buffering_record_start | 1541 $Function: voice_buffering_record_start |
1542 | 1542 |
1543 $Description: Starts recording voice and conects to the PTT number if the call is not active. | 1543 $Description: Starts recording voice and conects to the PTT number if the call is not active. |
1544 If in call, then start playing the voice | 1544 If in call, then start playing the voice |
1545 | 1545 |
1546 $Returns: | 1546 $Returns: |
1547 | 1547 |
1548 $Arguments: | 1548 $Arguments: |
1562 voice_buffering_data.win_hnd = win; | 1562 voice_buffering_data.win_hnd = win; |
1563 | 1563 |
1564 if( voice_buffering_data.recording_possible ) | 1564 if( voice_buffering_data.recording_possible ) |
1565 { | 1565 { |
1566 //create timer | 1566 //create timer |
1567 voice_buffering_data.voice_buffering_tim= tim_create (win, 20000, | 1567 voice_buffering_data.voice_buffering_tim= tim_create (win, 20000, |
1568 (T_MFW_CB)voice_buffering_tim_cb); | 1568 (T_MFW_CB)voice_buffering_tim_cb); |
1569 //start timer | 1569 //start timer |
1570 timStart(voice_buffering_data.voice_buffering_tim); | 1570 timStart(voice_buffering_data.voice_buffering_tim); |
1571 voice_buffering_data.buffering_phase = TRUE; | 1571 voice_buffering_data.buffering_phase = TRUE; |
1572 voice_buffering_data.recording_possible = FALSE; | 1572 voice_buffering_data.recording_possible = FALSE; |
1573 | 1573 |
1574 mfw_aud_retVal = mfw_aud_vm_start_record(PCM_VOICE_MEMO_MAX_DURATION, | 1574 mfw_aud_retVal = mfw_aud_vm_start_record(PCM_VOICE_MEMO_MAX_DURATION, |
1575 voice_memo_riv_record_cb); | 1575 voice_memo_riv_record_cb); |
1576 if(voice_buffering_data.call_active ) | 1576 if(voice_buffering_data.call_active ) |
1577 { | 1577 { |
1578 //start playing the recorded voice | 1578 //start playing the recorded voice |
1579 voice_buffering_playback_start(); | 1579 voice_buffering_playback_start(); |
1580 } | 1580 } |
1581 else | 1581 else |
1582 { | 1582 { |
1583 //call PTT number | 1583 //call PTT number |
1584 callNumber((UBYTE*)voice_buffering_data.vb_PTTnum); | 1584 callNumber((UBYTE*)voice_buffering_data.vb_PTTnum); |
1602 } | 1602 } |
1603 else | 1603 else |
1604 { | 1604 { |
1605 //Display a dialog and exit | 1605 //Display a dialog and exit |
1606 TRACE_EVENT_P1 ("ERROR : voice_buffering_record_start failed with return value : %d", mfw_aud_retVal); | 1606 TRACE_EVENT_P1 ("ERROR : voice_buffering_record_start failed with return value : %d", mfw_aud_retVal); |
1607 | 1607 |
1608 voice_memo_dialog_create( win, TxtRecording, TxtFailed ); | 1608 voice_memo_dialog_create( win, TxtRecording, TxtFailed ); |
1609 } | 1609 } |
1610 } | 1610 } |
1611 } | 1611 } |
1612 else | 1612 else |
1613 { | 1613 { |
1614 //Display a dialog saying "Already Recording" | 1614 //Display a dialog saying "Already Recording" |
1615 voice_memo_dialog_create(win, TxtAlready, TxtRecording); | 1615 voice_memo_dialog_create(win, TxtAlready, TxtRecording); |
1616 } | 1616 } |
1617 win_show (win); | 1617 win_show (win); |
1618 return 1; | 1618 return 1; |
1619 } | 1619 } |
1620 | 1620 |
1621 /******************************************************************************* | 1621 /******************************************************************************* |
1622 | 1622 |
1623 $Function: voice_buffering_record_stop | 1623 $Function: voice_buffering_record_stop |
1637 | 1637 |
1638 set_voice_memo_type ( VOICE_BUFFERING ); | 1638 set_voice_memo_type ( VOICE_BUFFERING ); |
1639 | 1639 |
1640 //store window handler | 1640 //store window handler |
1641 voice_buffering_data.win_hnd = win; | 1641 voice_buffering_data.win_hnd = win; |
1642 | 1642 |
1643 voice_buffering_data.rec_stop_reason = USER_SEL_STOP; | 1643 voice_buffering_data.rec_stop_reason = USER_SEL_STOP; |
1644 voice_buffering_data.recording_possible = TRUE; | 1644 voice_buffering_data.recording_possible = TRUE; |
1645 | 1645 |
1646 if(!voice_buffering_data.call_active ) | 1646 if(!voice_buffering_data.call_active ) |
1647 { | 1647 { |
1648 //stop the timer, if recording | 1648 //stop the timer, if recording |
1649 timStop(voice_buffering_data.voice_buffering_tim); | 1649 timStop(voice_buffering_data.voice_buffering_tim); |
1650 | 1650 |
1651 /* destroy the redial windows if exit*/ | 1651 /* destroy the redial windows if exit*/ |
1652 cm_redial_abort(); | 1652 cm_redial_abort(); |
1653 cm_disconnect(call_data.outCall); | 1653 cm_disconnect(call_data.outCall); |
1654 | 1654 |
1655 if (!call_data.calls.numCalls) | 1655 if (!call_data.calls.numCalls) |
1656 { | 1656 { |
1657 call_data.ignore_disconnect = TRUE; | 1657 call_data.ignore_disconnect = TRUE; |
1658 call_destroy(call_data.win); | 1658 call_destroy(call_data.win); |
1659 } | 1659 } |
1661 else | 1661 else |
1662 { | 1662 { |
1663 //Stop recording | 1663 //Stop recording |
1664 voice_buffering_stop_recording(); | 1664 voice_buffering_stop_recording(); |
1665 } | 1665 } |
1666 | 1666 |
1667 return 1; | 1667 return 1; |
1668 } | 1668 } |
1669 | 1669 |
1670 /******************************************************************************* | 1670 /******************************************************************************* |
1671 | 1671 |
1672 $Function: voice_buffering_playback_start | 1672 $Function: voice_buffering_playback_start |
1703 voice_memo_dialog_create( voice_buffering_data.win_hnd, TxtPlayback, TxtFailed); | 1703 voice_memo_dialog_create( voice_buffering_data.win_hnd, TxtPlayback, TxtFailed); |
1704 | 1704 |
1705 //update the reason to stop recording | 1705 //update the reason to stop recording |
1706 voice_buffering_data.rec_stop_reason = PLAY_ERROR; | 1706 voice_buffering_data.rec_stop_reason = PLAY_ERROR; |
1707 | 1707 |
1708 //stop recording | 1708 //stop recording |
1709 voice_buffering_stop_recording(); | 1709 voice_buffering_stop_recording(); |
1710 } | 1710 } |
1711 } | 1711 } |
1712 return; | 1712 return; |
1713 } | 1713 } |
1714 | 1714 |
1715 /******************************************************************************* | 1715 /******************************************************************************* |
1716 | 1716 |
1717 $Function: voice_buffering_stop_recording | 1717 $Function: voice_buffering_stop_recording |
1718 | 1718 |
1719 $Description: A wrapper function for record stop to invoke from other modules. | 1719 $Description: A wrapper function for record stop to invoke from other modules. |
1720 Stops the timer and recording | 1720 Stops the timer and recording |
1721 | 1721 |
1722 $Returns: | 1722 $Returns: |
1723 | 1723 |
1724 $Arguments: | 1724 $Arguments: |
1726 *******************************************************************************/ | 1726 *******************************************************************************/ |
1727 GLOBAL void voice_buffering_stop_recording(void ) | 1727 GLOBAL void voice_buffering_stop_recording(void ) |
1728 { | 1728 { |
1729 SHORT mfw_aud_retVal; | 1729 SHORT mfw_aud_retVal; |
1730 | 1730 |
1731 TRACE_FUNCTION ("voice_buffering_stop_recording()"); | 1731 TRACE_FUNCTION ("voice_buffering_stop_recording()"); |
1732 | 1732 |
1733 //stop the timer, if recording | 1733 //stop the timer, if recording |
1734 timStop(voice_buffering_data.voice_buffering_tim); | 1734 timStop(voice_buffering_data.voice_buffering_tim); |
1735 | 1735 |
1736 mfw_aud_retVal = mfw_aud_vm_stop_record(voice_memo_riv_record_cb); | 1736 mfw_aud_retVal = mfw_aud_vm_stop_record(voice_memo_riv_record_cb); |
1737 | 1737 |
1738 if (mfw_aud_retVal != MFW_AUD_VM_OK) | 1738 if (mfw_aud_retVal != MFW_AUD_VM_OK) |
1739 { | 1739 { |
1740 TRACE_EVENT_P1 ("ERROR : voice_buffering_record_stop failed with return value : %d", mfw_aud_retVal); | 1740 TRACE_EVENT_P1 ("ERROR : voice_buffering_record_stop failed with return value : %d", mfw_aud_retVal); |
1741 | 1741 |
1747 | 1747 |
1748 /******************************************************************************* | 1748 /******************************************************************************* |
1749 | 1749 |
1750 $Function: voice_buffering_stop_playing | 1750 $Function: voice_buffering_stop_playing |
1751 | 1751 |
1752 $Description: A wrapper function for play stop to invoke from other modules. | 1752 $Description: A wrapper function for play stop to invoke from other modules. |
1753 | 1753 |
1754 $Returns: | 1754 $Returns: |
1755 | 1755 |
1756 $Arguments: | 1756 $Arguments: |
1757 | 1757 |
1758 *******************************************************************************/ | 1758 *******************************************************************************/ |
1759 GLOBAL void voice_buffering_stop_playing(void ) | 1759 GLOBAL void voice_buffering_stop_playing(void ) |
1760 { | 1760 { |
1761 SHORT mfw_aud_retVal; | 1761 SHORT mfw_aud_retVal; |
1762 | 1762 |
1763 TRACE_FUNCTION ("voice_buffering_stop_playing()"); | 1763 TRACE_FUNCTION ("voice_buffering_stop_playing()"); |
1764 | 1764 |
1765 mfw_aud_retVal = mfw_aud_vm_stop_playback(voice_memo_riv_play_cb); | 1765 mfw_aud_retVal = mfw_aud_vm_stop_playback(voice_memo_riv_play_cb); |
1766 | 1766 |
1767 if (mfw_aud_retVal != MFW_AUD_VM_OK) | 1767 if (mfw_aud_retVal != MFW_AUD_VM_OK) |
1768 { | 1768 { |
1769 TRACE_EVENT_P1 ("ERROR : voice_buffering_record_stop failed with return value : %d", mfw_aud_retVal); | 1769 TRACE_EVENT_P1 ("ERROR : voice_buffering_record_stop failed with return value : %d", mfw_aud_retVal); |
1770 | 1770 |
1777 | 1777 |
1778 /******************************************************************************* | 1778 /******************************************************************************* |
1779 | 1779 |
1780 $Function: voice_memo_tim_cb | 1780 $Function: voice_memo_tim_cb |
1781 | 1781 |
1782 $Description: Timer callback. Stops the timer. If PTT call is not setup disconnect the call, | 1782 $Description: Timer callback. Stops the timer. If PTT call is not setup disconnect the call, |
1783 else call record stop | 1783 else call record stop |
1784 | 1784 |
1785 $Returns: | 1785 $Returns: |
1786 | 1786 |
1787 $Arguments: | 1787 $Arguments: |
1798 //get the voice memo type | 1798 //get the voice memo type |
1799 if( ( get_voice_memo_type() EQ VOICE_BUFFERING ) AND ( data->voice_buffering_tim ) ) | 1799 if( ( get_voice_memo_type() EQ VOICE_BUFFERING ) AND ( data->voice_buffering_tim ) ) |
1800 { | 1800 { |
1801 timStop(voice_buffering_data.voice_buffering_tim); | 1801 timStop(voice_buffering_data.voice_buffering_tim); |
1802 } | 1802 } |
1803 voice_buffering_data.rec_stop_reason = RECORDING_TIMEOUT; | 1803 voice_buffering_data.rec_stop_reason = RECORDING_TIMEOUT; |
1804 | 1804 |
1805 if( !voice_buffering_data.call_active ) //timeout before call setup | 1805 if( !voice_buffering_data.call_active ) //timeout before call setup |
1806 { | 1806 { |
1807 cm_disconnect(call_data.outCall); | 1807 cm_disconnect(call_data.outCall); |
1808 | 1808 |
1809 if (!call_data.calls.numCalls) | 1809 if (!call_data.calls.numCalls) |
1810 { | 1810 { |
1811 call_data.ignore_disconnect = TRUE; | 1811 call_data.ignore_disconnect = TRUE; |
1812 call_destroy(call_data.win); | 1812 call_destroy(call_data.win); |
1813 } | 1813 } |
1814 } | 1814 } |
1815 else //timeout after call setup | 1815 else //timeout after call setup |
1816 { | 1816 { |
1817 mfw_aud_retVal = mfw_aud_vm_stop_record(voice_memo_riv_record_cb); | 1817 mfw_aud_retVal = mfw_aud_vm_stop_record(voice_memo_riv_record_cb); |
1818 | 1818 |
1819 if (mfw_aud_retVal != MFW_AUD_VM_OK) | 1819 if (mfw_aud_retVal != MFW_AUD_VM_OK) |
1820 { | 1820 { |
1821 TRACE_EVENT_P1 ("ERROR : mfw_aud_vm_stop_record failed with return value : %d", mfw_aud_retVal); | 1821 TRACE_EVENT_P1 ("ERROR : mfw_aud_vm_stop_record failed with return value : %d", mfw_aud_retVal); |
1822 | 1822 |
1823 //display dialog saying "Recording Stop Failed" | 1823 //display dialog saying "Recording Stop Failed" |
1824 voice_memo_dialog_create( voice_buffering_data.win_hnd, TxtRecording, TxtStopFailed ); | 1824 voice_memo_dialog_create( voice_buffering_data.win_hnd, TxtRecording, TxtStopFailed ); |
1825 } | 1825 } |
1826 } | 1826 } |
1827 | 1827 |
1850 voice_buffering_data.call_active = FALSE; | 1850 voice_buffering_data.call_active = FALSE; |
1851 voice_buffering_data.recording_possible = TRUE; | 1851 voice_buffering_data.recording_possible = TRUE; |
1852 voice_buffering_data.buffering_phase = FALSE; | 1852 voice_buffering_data.buffering_phase = FALSE; |
1853 voice_buffering_data.incoming_call_discon = FALSE; | 1853 voice_buffering_data.incoming_call_discon = FALSE; |
1854 voice_buffering_data.play_stopped = FALSE; | 1854 voice_buffering_data.play_stopped = FALSE; |
1855 | 1855 |
1856 } | 1856 } |
1857 #endif | 1857 #endif |