comparison src/ui/bmi/mmiVoiceMemo.c @ 182:e41c934ecd97

mmiVoiceMemo.c: formatting fixes and dead code elimination
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 19 Jan 2021 05:23:24 +0000
parents c0052fe355d3
children
comparison
equal deleted inserted replaced
181:8f6e2ae69a6b 182:e41c934ecd97
9 9
10 ******************************************************************************** 10 ********************************************************************************
11 11
12 $Project name: Basic MMI 12 $Project name: Basic MMI
13 $Project code: BMI (6349) 13 $Project code: BMI (6349)
14 $Module: VOICEMEMO 14 $Module: VOICEMEMO
15 $File: MmiVoiceMemo.c 15 $File: MmiVoiceMemo.c
16 $Revision: 1.0 16 $Revision: 1.0
17 17
18 $Author: Condat(UK) 18 $Author: Condat(UK)
19 $Date: 09/04/01 19 $Date: 09/04/01
20 20
21 ******************************************************************************** 21 ********************************************************************************
22 22
23 Description: 23 Description:
24 24
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
70 70
71 Function: voice_memo 71 Function: voice_memo
72 Changes: Added code to handle record start, play start for PCM voice memo 72 Changes: Added code to handle record start, play start for PCM voice memo
73 73
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
93 pcm_voice_memo_record:Starts PCM voice memo record functionality 93 pcm_voice_memo_record:Starts PCM voice memo record functionality
94 pcm_voice_memo_start: create a new voicememo dialog 94 pcm_voice_memo_start: create a new voicememo dialog
95 pcm_voice_memo_create: Creation of window 95 pcm_voice_memo_create: Creation of window
96 pcm_voice_memo_destroy: Destruction of an dialog 96 pcm_voice_memo_destroy: Destruction of an dialog
97 pcm_voice_memo: Dialog function for PCM voice memo dialog 97 pcm_voice_memo: Dialog function for PCM voice memo dialog
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 *******************************************************************************/
109
110
111 109
112 110
113 /******************************************************************************* 111 /*******************************************************************************
114 112
115 Include files 113 Include files
157 #include "mfw_cphs.h" 155 #include "mfw_cphs.h"
158 #include "mfw_sat.h" 156 #include "mfw_sat.h"
159 157
160 #include "dspl.h" 158 #include "dspl.h"
161 159
162
163 #include "MmiMmi.h" 160 #include "MmiMmi.h"
164 #include "MmiDummy.h" 161 #include "MmiDummy.h"
165 #include "MmiDialogs.h" 162 #include "MmiDialogs.h"
166 #include "MmiLists.h" 163 #include "MmiLists.h"
167 #include "MmiIdle.h" 164 #include "MmiIdle.h"
206 203
207 /* 204 /*
208 * Internal events 205 * Internal events
209 */ 206 */
210 #define VM_INIT 500 207 #define VM_INIT 500
211 #define VM_DESTROY 501 208 #define VM_DESTROY 501
212 #define VM_PLAY 502 209 #define VM_PLAY 502
213 #define VM_RECORD 503 210 #define VM_RECORD 503
214 #define VM_DELETE_BUFFER 504 211 #define VM_DELETE_BUFFER 504
215 212
216 #define VOICE_MEMO_MAX_DURATION 10 // 10 Secs 213 #define VOICE_MEMO_MAX_DURATION 10 // 10 Secs
217 214
218 typedef struct 215 typedef struct
219 { 216 {
220 T_MMI_CONTROL mmi_control; 217 T_MMI_CONTROL mmi_control;
221 T_MFW_HND parent_win; 218 T_MFW_HND parent_win;
222 T_MFW_HND info_win; 219 T_MFW_HND info_win;
223 T_MFW_HND info_tim; 220 T_MFW_HND info_tim;
224 T_MFW_HND info_kbd; 221 T_MFW_HND info_kbd;
225 USHORT Identifier; 222 USHORT Identifier;
226 USHORT time; 223 USHORT time;
227 char elapsed_time[7]; 224 char elapsed_time[7];
228 int play_sk2; 225 int play_sk2;
229 } T_voice_memo; 226 } T_voice_memo;
230 227
231 //x0pleela 09 Mar, 2006 ER:OMAPS00067709 228 //x0pleela 09 Mar, 2006 ER:OMAPS00067709
232 #ifdef FF_PCM_VM_VB 229 #ifdef FF_PCM_VM_VB
233 EXTERN T_voice_buffering voice_buffering_data; 230 EXTERN T_voice_buffering voice_buffering_data;
245 static void voice_memo_destroy (T_MFW_HND own_window); 242 static void voice_memo_destroy (T_MFW_HND own_window);
246 static void voice_memo (T_MFW_HND win, USHORT event, SHORT value, void * parameter); 243 static void voice_memo (T_MFW_HND win, USHORT event, SHORT value, void * parameter);
247 static int voice_memo_win_cb (T_MFW_EVENT event, T_MFW_WIN * win); 244 static int voice_memo_win_cb (T_MFW_EVENT event, T_MFW_WIN * win);
248 static T_MFW_CB voice_memo_tim_cb (T_MFW_EVENT event, T_MFW_TIM * tc); 245 static T_MFW_CB voice_memo_tim_cb (T_MFW_EVENT event, T_MFW_TIM * tc);
249 static int voice_memo_kbd_cb (T_MFW_EVENT event, T_MFW_KBD * keyboard); 246 static int voice_memo_kbd_cb (T_MFW_EVENT event, T_MFW_KBD * keyboard);
250 static void voice_memo_dialog_create(T_MFW_HND win, int str1, int str2); 247 static void voice_memo_dialog_create(T_MFW_HND win, int str1, int str2);
251 void voice_memo_dialog_cb (T_MFW_HND win, UBYTE identifier, UBYTE reason); 248 void voice_memo_dialog_cb (T_MFW_HND win, UBYTE identifier, UBYTE reason);
252 GLOBAL void voice_buffering_playback_start(void ); 249 GLOBAL void voice_buffering_playback_start(void );
253 /* 250 /*
254 ** Rivera Callback functions 251 ** Rivera Callback functions
255 */ 252 */
281 TRACE_FUNCTION ("voice_memo_init()"); 278 TRACE_FUNCTION ("voice_memo_init()");
282 279
283 #ifdef FF_PCM_VM_VB 280 #ifdef FF_PCM_VM_VB
284 voice_buffering_data_reset(); 281 voice_buffering_data_reset();
285 #endif 282 #endif
286
287 } 283 }
288 284
289 /******************************************************************************* 285 /*******************************************************************************
290 286
291 $Function: voice_memo_exit 287 $Function: voice_memo_exit
292 288
293 $Description: 289 $Description:
294 290
295
296 $Returns: 291 $Returns:
297 292
298 $Arguments: 293 $Arguments:
299 294
300 *******************************************************************************/ 295 *******************************************************************************/
301 GLOBAL void voice_memo_exit (void) 296 GLOBAL void voice_memo_exit (void)
302 { 297 {
303 TRACE_FUNCTION ("voice_memo_exit()"); 298 TRACE_FUNCTION ("voice_memo_exit()");
304 299 }
305 }
306
307
308 300
309 301
310 /******************************************************************************* 302 /*******************************************************************************
311 303
312 $Function: voice_memo_play 304 $Function: voice_memo_play
333 //create a new voice memo dialog 325 //create a new voice memo dialog
334 voice_memo_start (win, VM_PLAY); 326 voice_memo_start (win, VM_PLAY);
335 return 1; // ADDED BY RAVI - 29-11-2005 327 return 1; // ADDED BY RAVI - 29-11-2005
336 } 328 }
337 329
338 #if 0 /* FreeCalypso */ 330
339 /******************************************************************************* 331 /*******************************************************************************
340 332
341 $Function: voice_memo_storeage 333 $Function: voice_memo_record
342 334
343 $Description: 335 $Description:
344 336
345
346 $Returns: 337 $Returns:
347 338
348 $Arguments: 339 $Arguments:
349 340
350 *******************************************************************************/ 341 *******************************************************************************/
351 GLOBAL int PCM_voice_memo_storeage (MfwMnu* m, MfwMnuItem* i)
352 {
353 T_MFW_HND parent_win = mfwParent(mfw_header());
354 int txtId = TxtFFS;
355
356 TRACE_FUNCTION("mmi_camera_set_storage()");
357
358 switch (m->lCursor[m->level])
359 {
360 case 0:
361 txtId = TxtFFS;
362 FFS_flashData.PCM_voicememo_storage = SNAP_STG_FFS;
363 break;
364
365 case 1:
366 txtId = TxtNORMS;
367 FFS_flashData.PCM_voicememo_storage = SNAP_STG_NORMS;
368 break;
369
370 case 2:
371 txtId = TxtNAND;
372 FFS_flashData.PCM_voicememo_storage = SNAP_STG_NAND;
373 break;
374
375 case 3:
376 txtId = TxtTflash;
377 FFS_flashData.PCM_voicememo_storage = SNAP_STG_MMC;
378 break;
379 }
380
381 flash_write();
382 //Set the Quality Factor.
383 TRACE_EVENT_P1("STorage set to %d ", FFS_flashData.PCM_voicememo_storage);
384 //Display the dialgbox to the user.
385 voice_memo_dialog_create(parent_win,txtId,TxtSelected);
386 return MFW_EVENT_CONSUMED;
387 }
388
389 /*******************************************************************************
390
391 $Function: voice_memo_storeage
392
393 $Description:
394
395
396 $Returns:
397
398 $Arguments:
399
400 *******************************************************************************/
401 GLOBAL int voice_buffer_storeage (MfwMnu* m, MfwMnuItem* i)
402 {
403 T_MFW_HND parent_win = mfwParent(mfw_header());
404 int txtId = TxtFFS;
405
406 TRACE_FUNCTION("mmi_camera_set_storage()");
407
408 switch (m->lCursor[m->level])
409 {
410 case 0:
411 txtId = TxtFFS;
412 FFS_flashData.voicebuffer_storage = SNAP_STG_FFS;
413 break;
414
415 case 1:
416 txtId = TxtNORMS;
417 FFS_flashData.voicebuffer_storage = SNAP_STG_NORMS;
418 break;
419
420 case 2:
421 txtId = TxtNAND;
422 FFS_flashData.voicebuffer_storage = SNAP_STG_NAND;
423 break;
424
425 case 3:
426 txtId = TxtTflash;
427 FFS_flashData.voicebuffer_storage = SNAP_STG_MMC;
428 break;
429 }
430
431 flash_write();
432 //Set the Quality Factor.
433 TRACE_EVENT_P1("STorage set to %d ", FFS_flashData.voicebuffer_storage);
434 //Display the dialgbox to the user.
435 voice_memo_dialog_create(parent_win,txtId,TxtSelected);
436 return MFW_EVENT_CONSUMED;
437 }
438
439 /*******************************************************************************
440
441 $Function: voice_memo_storeage
442
443 $Description:
444
445
446 $Returns:
447
448 $Arguments:
449
450 *******************************************************************************/
451 GLOBAL int voice_memo_storeage (MfwMnu* m, MfwMnuItem* i)
452 {
453 T_MFW_HND parent_win = mfwParent(mfw_header());
454 int txtId = TxtFFS;
455
456 TRACE_FUNCTION("mmi_camera_set_storage()");
457
458 switch (m->lCursor[m->level])
459 {
460 case 0:
461 txtId = TxtFFS;
462 FFS_flashData.voicememo_storage = SNAP_STG_FFS;
463 break;
464
465 case 1:
466 txtId = TxtNORMS;
467 FFS_flashData.voicememo_storage = SNAP_STG_NORMS;
468 break;
469
470 case 2:
471 txtId = TxtNAND;
472 FFS_flashData.voicememo_storage = SNAP_STG_NAND;
473 break;
474
475 case 3:
476 txtId = TxtTflash;
477 FFS_flashData.voicememo_storage = SNAP_STG_MMC;
478 break;
479 }
480
481 flash_write();
482 //Set the Quality Factor.
483 TRACE_EVENT_P1("STorage set to %d ", FFS_flashData.voicememo_storage);
484 //Display the dialgbox to the user.
485 voice_memo_dialog_create(parent_win,txtId,TxtSelected);
486 return MFW_EVENT_CONSUMED;
487 }
488 #endif
489
490
491 /*******************************************************************************
492
493 $Function: voice_memo_record
494
495 $Description:
496
497
498 $Returns:
499
500 $Arguments:
501
502 *******************************************************************************/
503 GLOBAL int voice_memo_record (MfwMnu* m, MfwMnuItem* i) 342 GLOBAL int voice_memo_record (MfwMnu* m, MfwMnuItem* i)
504 { 343 {
505
506 T_MFW_HND win = mfw_parent(mfw_header()); 344 T_MFW_HND win = mfw_parent(mfw_header());
507 345
508 TRACE_FUNCTION ("voice_memo_record()"); 346 TRACE_FUNCTION ("voice_memo_record()");
509 347
510 //x0pleela 27 Feb, 2006 ER: OMAPA00067709 348 //x0pleela 27 Feb, 2006 ER: OMAPA00067709
541 } 379 }
542 return win; 380 return win;
543 } 381 }
544 382
545 383
546
547 /******************************************************************************* 384 /*******************************************************************************
548 385
549 $Function: vocie_memo_create 386 $Function: vocie_memo_create
550 387
551 $Description: Creation of window 388 $Description: Creation of window
604 T_MFW_WIN * win = ((T_MFW_HDR *)own_window)->data; 441 T_MFW_WIN * win = ((T_MFW_HDR *)own_window)->data;
605 T_voice_memo * data = (T_voice_memo *)win->user; 442 T_voice_memo * data = (T_voice_memo *)win->user;
606 443
607 TRACE_FUNCTION ("voice_memo_destroy()"); 444 TRACE_FUNCTION ("voice_memo_destroy()");
608 445
609 if (own_window == NULL) 446 if (own_window == NULL)
610 { 447 {
611 TRACE_EVENT ("Error : Called with NULL Pointer"); 448 TRACE_EVENT ("Error : Called with NULL Pointer");
612 return; 449 return;
613 } 450 }
614 451
615 if (data) 452 if (data)
616 { 453 {
617 /* 454 /*
618 * Exit TIMER & KEYBOARD Handle 455 * Exit TIMER & KEYBOARD Handle
636 set_voice_memo_type( NONE); 473 set_voice_memo_type( NONE);
637 #endif 474 #endif
638 } 475 }
639 476
640 477
641
642 /******************************************************************************* 478 /*******************************************************************************
643 479
644 $Function: voice_memo 480 $Function: voice_memo
645 481
646 $Description: Dialog function for voice memo dialog 482 $Description: Dialog function for voice memo dialog
656 T_voice_memo * data = (T_voice_memo *)win_data->user; 492 T_voice_memo * data = (T_voice_memo *)win_data->user;
657 493
658 // T_DISPLAY_DATA display_info; // RAVI 494 // T_DISPLAY_DATA display_info; // RAVI
659 495
660 SHORT mfw_aud_retVal = 0; /* x0039928 - Lint warning fix */ 496 SHORT mfw_aud_retVal = 0; /* x0039928 - Lint warning fix */
661 #ifdef FF_PCM_VM_VB 497 #ifdef FF_PCM_VM_VB
662 UBYTE vm_type; //to store voice memo type 498 UBYTE vm_type; //to store voice memo type
663 #endif 499 #endif
664
665 500
666 data->Identifier = value; 501 data->Identifier = value;
667 502
668 TRACE_FUNCTION ("voice_memo()"); 503 TRACE_FUNCTION ("voice_memo()");
669 504
678 /* 513 /*
679 * Create timer and keyboard handler 514 * Create timer and keyboard handler
680 */ 515 */
681 data->info_tim = tim_create (win, 1000, (T_MFW_CB)voice_memo_tim_cb); 516 data->info_tim = tim_create (win, 1000, (T_MFW_CB)voice_memo_tim_cb);
682 data->info_kbd = kbd_create (win, KEY_ALL, (T_MFW_CB)voice_memo_kbd_cb); 517 data->info_kbd = kbd_create (win, KEY_ALL, (T_MFW_CB)voice_memo_kbd_cb);
683
684 518
685 if (value EQ VM_PLAY) 519 if (value EQ VM_PLAY)
686 { 520 {
687 TRACE_EVENT ("VM_PLAY()"); 521 TRACE_EVENT ("VM_PLAY()");
688 522
803 T_voice_memo * data = (T_voice_memo *)win->user; 637 T_voice_memo * data = (T_voice_memo *)win->user;
804 638
805 TRACE_FUNCTION ("voice_memo_win_cb()"); 639 TRACE_FUNCTION ("voice_memo_win_cb()");
806 640
807 if (data EQ 0) 641 if (data EQ 0)
808 return 1; 642 return 1;
809 643
810 switch (event) 644 switch (event)
811 { 645 {
812 case E_WIN_VISIBLE: 646 case E_WIN_VISIBLE:
813 if (win->flags & E_WIN_VISIBLE) 647 if (win->flags & E_WIN_VISIBLE)
868 702
869 $Function: voice_memo_tim_cb 703 $Function: voice_memo_tim_cb
870 704
871 $Description: Callback function for the voice_memo timer. 705 $Description: Callback function for the voice_memo timer.
872 706
873
874 $Returns: MFW event handler 707 $Returns: MFW event handler
875 708
876 $Arguments: window handle event, timer control block 709 $Arguments: window handle event, timer control block
877 710
878 *******************************************************************************/ 711 *******************************************************************************/
879 static T_MFW_CB voice_memo_tim_cb (T_MFW_EVENT event, T_MFW_TIM *tc) 712 static T_MFW_CB voice_memo_tim_cb (T_MFW_EVENT event, T_MFW_TIM *tc)
880 { 713 {
881 T_MFW_HND win = mfw_parent (mfw_header()); 714 T_MFW_HND win = mfw_parent (mfw_header());
882 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data; 715 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data;
883 T_voice_memo * data = (T_voice_memo *)win_data->user; 716 T_voice_memo * data = (T_voice_memo *)win_data->user;
884 717
885 SHORT mfw_aud_retVal; 718 SHORT mfw_aud_retVal;
886 //x0pleela 27 Feb, 2006 ER:OMAPS00067709 719 //x0pleela 27 Feb, 2006 ER:OMAPS00067709
887 //to store PCM/AMR voice memo record/play duration 720 //to store PCM/AMR voice memo record/play duration
888 USHORT vm_duration = 0; /* x0039928 - Lint warning fix */ 721 USHORT vm_duration = 0; /* x0039928 - Lint warning fix */
1017 850
1018 static int voice_memo_kbd_cb (T_MFW_EVENT event, T_MFW_KBD *keyboard) 851 static int voice_memo_kbd_cb (T_MFW_EVENT event, T_MFW_KBD *keyboard)
1019 { 852 {
1020 T_MFW_HND win = mfw_parent (mfw_header()); 853 T_MFW_HND win = mfw_parent (mfw_header());
1021 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data; 854 T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data;
1022 T_voice_memo * data = (T_voice_memo *)win_data->user; 855 T_voice_memo * data = (T_voice_memo *)win_data->user;
1023 856
1024 USHORT Identifier = data->Identifier; 857 USHORT Identifier = data->Identifier;
1025 SHORT mfw_aud_retVal; 858 SHORT mfw_aud_retVal;
1026
1027 859
1028 TRACE_FUNCTION("voice_memo_kbd_cb"); 860 TRACE_FUNCTION("voice_memo_kbd_cb");
1029 861
1030 switch (keyboard->code) 862 switch (keyboard->code)
1031 { 863 {
1173 1005
1174 //x0pleela 16 Mar, 2006 ER:OMAPS00067709 1006 //x0pleela 16 Mar, 2006 ER:OMAPS00067709
1175 #ifdef FF_PCM_VM_VB 1007 #ifdef FF_PCM_VM_VB
1176 UBYTE vm_type; //to store voice memo type 1008 UBYTE vm_type; //to store voice memo type
1177 #endif 1009 #endif
1178
1179 1010
1180 //x0pleela 16 Mar, 2006 ER:OMAPS00067709 1011 //x0pleela 16 Mar, 2006 ER:OMAPS00067709
1181 #ifdef FF_PCM_VM_VB 1012 #ifdef FF_PCM_VM_VB
1182 vm_type = get_voice_memo_type(); 1013 vm_type = get_voice_memo_type();
1183 switch( vm_type ) 1014 switch( vm_type )
1270 1101
1271 default: 1102 default:
1272 break; 1103 break;
1273 } 1104 }
1274 1105
1275
1276
1277 #endif /* FF_PCM_VM_VB */ 1106 #endif /* FF_PCM_VM_VB */
1278 1107
1279 /* BEGIN ADD: Req ID: : Sumit : 14-Mar-05 */ 1108 /* BEGIN ADD: Req ID: : Sumit : 14-Mar-05 */
1280 #endif /* NEPTUNE_BOARD */ 1109 #endif /* NEPTUNE_BOARD */
1281 /* END ADD: Req ID: : Sumit : 14-Mar-05 */ 1110 /* END ADD: Req ID: : Sumit : 14-Mar-05 */
1361 1190
1362 default: 1191 default:
1363 break; 1192 break;
1364 } 1193 }
1365 1194
1366
1367
1368 #endif /* FF_PCM_VM_VB */ 1195 #endif /* FF_PCM_VM_VB */
1369 1196
1370 /* BEGIN ADD: Req ID: : Sumit : 14-Mar-05 */ 1197 /* BEGIN ADD: Req ID: : Sumit : 14-Mar-05 */
1371 #endif /* NEPTUNE_BOARD*/ 1198 #endif /* NEPTUNE_BOARD*/
1372 /* END ADD: Req ID: : Sumit : 14-Mar-05 */ 1199 /* END ADD: Req ID: : Sumit : 14-Mar-05 */
1379 /******************************************************************************* 1206 /*******************************************************************************
1380 1207
1381 $Function: pcm_voice_memo_play 1208 $Function: pcm_voice_memo_play
1382 1209
1383 $Description: Sets voice memo type to PCM_VOICE_MEMO which indicates PCM voice memo is 1210 $Description: Sets voice memo type to PCM_VOICE_MEMO which indicates PCM voice memo is
1384 active and start playing the voice 1211 active and start playing the voice
1385 1212
1386 $Returns: 1213 $Returns:
1387 1214
1388 $Arguments: 1215 $Arguments:
1389 1216
1405 /******************************************************************************* 1232 /*******************************************************************************
1406 1233
1407 $Function: pcm_voice_memo_record 1234 $Function: pcm_voice_memo_record
1408 1235
1409 $Description: Sets voice memo type to PCM_VOICE_MEMO which indicates PCM voice memo is 1236 $Description: Sets voice memo type to PCM_VOICE_MEMO which indicates PCM voice memo is
1410 active and start recording the voice 1237 active and start recording the voice
1411 1238
1412 1239
1413 $Returns: 1240 $Returns:
1414 1241
1415 $Arguments: 1242 $Arguments:
1432 /******************************************************************************* 1259 /*******************************************************************************
1433 1260
1434 $Function: voice_buffering_edit_num 1261 $Function: voice_buffering_edit_num
1435 1262
1436 $Description: Opens an edtor for the user to enter PTT number. Also resets voice buffering data 1263 $Description: Opens an edtor for the user to enter PTT number. Also resets voice buffering data
1437 with default values 1264 with default values
1438 1265
1439 $Returns: 1266 $Returns:
1440 1267
1441 $Arguments: 1268 $Arguments:
1442 1269
1539 1366
1540 /******************************************************************************* 1367 /*******************************************************************************
1541 $Function: voice_buffering_record_start 1368 $Function: voice_buffering_record_start
1542 1369
1543 $Description: Starts recording voice and conects to the PTT number if the call is not active. 1370 $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 1371 If in call, then start playing the voice
1545 1372
1546 $Returns: 1373 $Returns:
1547 1374
1548 $Arguments: 1375 $Arguments:
1549 1376
1563 1390
1564 if( voice_buffering_data.recording_possible ) 1391 if( voice_buffering_data.recording_possible )
1565 { 1392 {
1566 //create timer 1393 //create timer
1567 voice_buffering_data.voice_buffering_tim= tim_create (win, 20000, 1394 voice_buffering_data.voice_buffering_tim= tim_create (win, 20000,
1568 (T_MFW_CB)voice_buffering_tim_cb); 1395 (T_MFW_CB)voice_buffering_tim_cb);
1569 //start timer 1396 //start timer
1570 timStart(voice_buffering_data.voice_buffering_tim); 1397 timStart(voice_buffering_data.voice_buffering_tim);
1571 voice_buffering_data.buffering_phase = TRUE; 1398 voice_buffering_data.buffering_phase = TRUE;
1572 voice_buffering_data.recording_possible = FALSE; 1399 voice_buffering_data.recording_possible = FALSE;
1573 1400
1715 /******************************************************************************* 1542 /*******************************************************************************
1716 1543
1717 $Function: voice_buffering_stop_recording 1544 $Function: voice_buffering_stop_recording
1718 1545
1719 $Description: A wrapper function for record stop to invoke from other modules. 1546 $Description: A wrapper function for record stop to invoke from other modules.
1720 Stops the timer and recording 1547 Stops the timer and recording
1721 1548
1722 $Returns: 1549 $Returns:
1723 1550
1724 $Arguments: 1551 $Arguments:
1725 1552
1778 /******************************************************************************* 1605 /*******************************************************************************
1779 1606
1780 $Function: voice_memo_tim_cb 1607 $Function: voice_memo_tim_cb
1781 1608
1782 $Description: Timer callback. Stops the timer. If PTT call is not setup disconnect the call, 1609 $Description: Timer callback. Stops the timer. If PTT call is not setup disconnect the call,
1783 else call record stop 1610 else call record stop
1784 1611
1785 $Returns: 1612 $Returns:
1786 1613
1787 $Arguments: 1614 $Arguments:
1788 1615
1850 voice_buffering_data.call_active = FALSE; 1677 voice_buffering_data.call_active = FALSE;
1851 voice_buffering_data.recording_possible = TRUE; 1678 voice_buffering_data.recording_possible = TRUE;
1852 voice_buffering_data.buffering_phase = FALSE; 1679 voice_buffering_data.buffering_phase = FALSE;
1853 voice_buffering_data.incoming_call_discon = FALSE; 1680 voice_buffering_data.incoming_call_discon = FALSE;
1854 voice_buffering_data.play_stopped = FALSE; 1681 voice_buffering_data.play_stopped = FALSE;
1855 1682 }
1856 } 1683 #endif
1857 #endif