changeset 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 8f6e2ae69a6b
children 83c6933e8f90
files src/ui/bmi/mmiVoiceMemo.c
diffstat 1 files changed, 76 insertions(+), 250 deletions(-) [+]
line wrap: on
line diff
--- a/src/ui/bmi/mmiVoiceMemo.c	Tue Jan 19 04:42:34 2021 +0000
+++ b/src/ui/bmi/mmiVoiceMemo.c	Tue Jan 19 05:23:24 2021 +0000
@@ -11,12 +11,12 @@
 
  $Project name: Basic MMI
  $Project code: BMI (6349)
- $Module:   VOICEMEMO
- $File:       MmiVoiceMemo.c
- $Revision:   1.0
+ $Module:       VOICEMEMO
+ $File:         MmiVoiceMemo.c
+ $Revision:     1.0
 
- $Author:   Condat(UK)
- $Date:       09/04/01
+ $Author:       Condat(UK)
+ $Date:         09/04/01
 
 ********************************************************************************
 
@@ -35,71 +35,71 @@
 Mar 31, 2006   ER: OMAPS00067709  x0pleela
 Description: Voice Buffering implementation on C+ for PTT via PCM API
 Solution: Added prototype for voice_buffering_stop_recording
-		Updating voicebuffering data for play stopped in play callback
+Updating voicebuffering data for play stopped in play callback
 
 Mar 15, 2006   ER: OMAPS00067709  x0pleela
 Description: Voice Buffering implementation on C+ for PTT via PCM API
 Solution: Defined new macro "PCM_VOICE_MEMO_MAX_DURATION" to restrict the recording
-			timeout to 20 secs for PCM voice memo and voice buffering
-		Added prototypes of new functions inputVoiceMemoNumberEditor, voiceMemoNumberCB,
-			voice_buffering_tim_cb, voice_buffering_data_reset
-		Added following new functions:
-			pcm_voice_memo_play: Sets voice memo type to PCM_VOICE_MEMO which indicates
-									PCM voice memo is active and start playing the voice
-			pcm_voice_memo_record: Sets voice memo type to PCM_VOICE_MEMO which indicates
-									PCM voice memo is active and start recording the voice
-			voice_buffering_edit_num: Opens an edtor for the user to enter PTT number. Also resets
-									voice buffering data with default values
-			voiceMemoNumberCB: call back for number entry
-			inputVoiceMemoNumberEditor: Settings of Editor
-			voice_buffering_record_start: Starts recording voice and conects to the PTT number if the
-										call is not active. If in call, then start playing the voice
-			voice_buffering_record_stop: Stops the timer and recording. If call is not active the
-										disconnects the call
-			voice_buffering_playback_start: Starts playing the voice. If any error while playing,
-										stops timer and recording
-			voice_buffering_stop_recording: A wrapper function for record stop to invoke from other
-										modules. Stops the timer and recording
-			voice_buffering_stop_playing: A wrapper function for play stop to invoke from other modules
-			voice_buffering_tim_cb: Timer callback. Stops the timer. If PTT call is not setup disconnect
-									the call, else call record stop
-			voice_buffering_data_reset: Resets voice buffering data to default values
+timeout to 20 secs for PCM voice memo and voice buffering
+Added prototypes of new functions inputVoiceMemoNumberEditor, voiceMemoNumberCB,
+voice_buffering_tim_cb, voice_buffering_data_reset
+Added following new functions:
+pcm_voice_memo_play: Sets voice memo type to PCM_VOICE_MEMO which indicates
+PCM voice memo is active and start playing the voice
+pcm_voice_memo_record: Sets voice memo type to PCM_VOICE_MEMO which indicates
+PCM voice memo is active and start recording the voice
+voice_buffering_edit_num: Opens an edtor for the user to enter PTT number. Also resets
+voice buffering data with default values
+voiceMemoNumberCB: call back for number entry
+inputVoiceMemoNumberEditor: Settings of Editor
+voice_buffering_record_start: Starts recording voice and conects to the PTT number if the
+call is not active. If in call, then start playing the voice
+voice_buffering_record_stop: Stops the timer and recording. If call is not active the
+disconnects the call
+voice_buffering_playback_start: Starts playing the voice. If any error while playing,
+stops timer and recording
+voice_buffering_stop_recording: A wrapper function for record stop to invoke from other
+modules. Stops the timer and recording
+voice_buffering_stop_playing: A wrapper function for play stop to invoke from other modules
+voice_buffering_tim_cb: Timer callback. Stops the timer. If PTT call is not setup disconnect
+the call, else call record stop
+voice_buffering_data_reset: Resets voice buffering data to default values
 
-		Function: voice_memo_play, voice_memo_record, voice_memo_destroy
-		Changes: Added code to set voice memo type
+	Function: voice_memo_play, voice_memo_record, voice_memo_destroy
+	Changes: Added code to set voice memo type
 
-		Function: voice_memo
-		Changes: Added code to handle record start, play start for PCM voice memo
+	Function: voice_memo
+	Changes: Added code to handle record start, play start for PCM voice memo
 
-		Function: voice_memo_tim_cb
-		Changes: Added code to handle record stop, play stop for PCM voice memo
+	Function: voice_memo_tim_cb
+	Changes: Added code to handle record stop, play stop for PCM voice memo
 
-		Function: voice_memo_riv_play_cb
-		Changes: Added code to allow user to accept ant incoming call after the buffering phase
+	Function: voice_memo_riv_play_cb
+	Changes: Added code to allow user to accept ant incoming call after the buffering phase
 
 Feb 27, 2006    ER: OMAPS00067709 x0pleela
 Description: Voice Buffering implementation on C+ for PTT via PCM API
 Solution: Defined a global variable gPcm_voice_Memo which indicates which Voice memo is active
-		and corresponding audio APIs will be invoked and duplication of code is avoided
+and corresponding audio APIs will be invoked and duplication of code is avoided
 
 Feb 24, 2006    ER: OMAPS00067709 x0pleela
 Description: Voice Buffering implementation on C+ for PTT via PCM API
 Solution: Defined new macro PCM_VOICE_MEMO_MAX_DURATION which defines maximum
-			recording and playing duration for PCM voice memo and voice buffering
-		Implemented following functions to support PCM voice memo feature
-			pcm_voice_memo_init: Initialization of PCM voice memo
-			pcm_voice_memo_exit:Termination of PCM voice memo
-			pcm_voice_memo_play:Starts PCM voice memo play functionality
-			pcm_voice_memo_record:Starts PCM voice memo record functionality
-			pcm_voice_memo_start: create a new voicememo dialog
-			pcm_voice_memo_create: Creation of window
-			pcm_voice_memo_destroy: Destruction of an dialog
-			pcm_voice_memo: Dialog function for PCM voice memo dialog
-			pcm_voice_memo_win_cb:Callback function for information dialog
-			pcm_voice_memo_tim_cb: Callback function for the PCM voice_memo timer.
-			pcm_voice_memo_kbd_cb: Keyboard event handler
-			pcm_voice_memo_riv_record_cb: Callback that handles the return status for PCM voice memo recording
-			pcm_voice_memo_riv_play_cb:Callback that handles the return status for PCM voice memo palying
+recording and playing duration for PCM voice memo and voice buffering
+Implemented following functions to support PCM voice memo feature
+pcm_voice_memo_init: Initialization of PCM voice memo
+pcm_voice_memo_exit:Termination of PCM voice memo
+pcm_voice_memo_play:Starts PCM voice memo play functionality
+pcm_voice_memo_record:Starts PCM voice memo record functionality
+pcm_voice_memo_start: create a new voicememo dialog
+pcm_voice_memo_create: Creation of window
+pcm_voice_memo_destroy: Destruction of an dialog
+pcm_voice_memo: Dialog function for PCM voice memo dialog
+pcm_voice_memo_win_cb:Callback function for information dialog
+pcm_voice_memo_tim_cb: Callback function for the PCM voice_memo timer.
+pcm_voice_memo_kbd_cb: Keyboard event handler
+pcm_voice_memo_riv_record_cb: Callback that handles the return status for PCM voice memo recording
+pcm_voice_memo_riv_play_cb:Callback that handles the return status for PCM voice memo palying
 
   09/04/01      Original Condat(UK) BMI version.
 
@@ -108,8 +108,6 @@
 *******************************************************************************/
 
 
-
-
 /*******************************************************************************
 
                                 Include files
@@ -159,7 +157,6 @@
 
 #include "dspl.h"
 
-
 #include "MmiMmi.h"
 #include "MmiDummy.h"
 #include "MmiDialogs.h"
@@ -208,12 +205,12 @@
  * Internal events
  */
 #define VM_INIT           500
-#define VM_DESTROY       501
+#define VM_DESTROY        501
 #define VM_PLAY           502
 #define VM_RECORD         503
 #define VM_DELETE_BUFFER  504
 
-#define VOICE_MEMO_MAX_DURATION 10					// 10 Secs
+#define VOICE_MEMO_MAX_DURATION 10			// 10 Secs
 
 typedef struct
 {
@@ -224,8 +221,8 @@
   T_MFW_HND       info_kbd;
   USHORT          Identifier;
   USHORT          time;
-  char         elapsed_time[7];
-  int			  play_sk2;
+  char            elapsed_time[7];
+  int		  play_sk2;
 } T_voice_memo;
 
 //x0pleela 09 Mar, 2006   ER:OMAPS00067709
@@ -247,7 +244,7 @@
 static int        voice_memo_win_cb (T_MFW_EVENT event, T_MFW_WIN * win);
 static T_MFW_CB     voice_memo_tim_cb (T_MFW_EVENT event, T_MFW_TIM * tc);
 static int        voice_memo_kbd_cb (T_MFW_EVENT event, T_MFW_KBD * keyboard);
-static void			voice_memo_dialog_create(T_MFW_HND win, int str1, int str2);
+static void	voice_memo_dialog_create(T_MFW_HND win, int str1, int str2);
 void          voice_memo_dialog_cb (T_MFW_HND win, UBYTE identifier, UBYTE reason);
 GLOBAL void voice_buffering_playback_start(void );
 /*
@@ -283,7 +280,6 @@
   #ifdef FF_PCM_VM_VB
     voice_buffering_data_reset();
   #endif
-
 }
 
 /*******************************************************************************
@@ -292,7 +288,6 @@
 
  $Description:
 
-
  $Returns:
 
  $Arguments:
@@ -301,12 +296,9 @@
 GLOBAL void voice_memo_exit (void)
 {
   TRACE_FUNCTION ("voice_memo_exit()");
-
 }
 
 
-
-
 /*******************************************************************************
 
  $Function:     voice_memo_play
@@ -335,158 +327,6 @@
   return 1;  // ADDED BY RAVI - 29-11-2005
 }
 
-#if 0	/* FreeCalypso */
-/*******************************************************************************
-
- $Function:     voice_memo_storeage
-
- $Description:
-
-
- $Returns:
-
- $Arguments:
-
-*******************************************************************************/
-GLOBAL int PCM_voice_memo_storeage (MfwMnu* m, MfwMnuItem* i)
-{
-	T_MFW_HND parent_win = mfwParent(mfw_header());
-	int txtId = TxtFFS;
-
-	TRACE_FUNCTION("mmi_camera_set_storage()");
-
-	switch (m->lCursor[m->level])
-	{
-		case 0:
-			txtId = TxtFFS;
-			FFS_flashData.PCM_voicememo_storage = SNAP_STG_FFS;
-		break;
-
-		case 1:
-			txtId = TxtNORMS;
-			FFS_flashData.PCM_voicememo_storage = SNAP_STG_NORMS;
-		break;
-
-		case 2:
-			txtId = TxtNAND;
-			FFS_flashData.PCM_voicememo_storage = SNAP_STG_NAND;
-		break;
-
-		case 3:
-			txtId = TxtTflash;
-			FFS_flashData.PCM_voicememo_storage = SNAP_STG_MMC;
-		break;
-	}
-
-	flash_write();
-	//Set the Quality Factor.
-	TRACE_EVENT_P1("STorage set to %d ", FFS_flashData.PCM_voicememo_storage);
-	//Display the dialgbox to the user.
-	voice_memo_dialog_create(parent_win,txtId,TxtSelected);
-	return MFW_EVENT_CONSUMED;
-}
-
-/*******************************************************************************
-
- $Function:     voice_memo_storeage
-
- $Description:
-
-
- $Returns:
-
- $Arguments:
-
-*******************************************************************************/
-GLOBAL int voice_buffer_storeage (MfwMnu* m, MfwMnuItem* i)
-{
-	T_MFW_HND parent_win = mfwParent(mfw_header());
-	int txtId = TxtFFS;
-
-	TRACE_FUNCTION("mmi_camera_set_storage()");
-
-	switch (m->lCursor[m->level])
-	{
-		case 0:
-			txtId = TxtFFS;
-			FFS_flashData.voicebuffer_storage = SNAP_STG_FFS;
-		break;
-
-		case 1:
-			txtId = TxtNORMS;
-			FFS_flashData.voicebuffer_storage = SNAP_STG_NORMS;
-		break;
-
-		case 2:
-			txtId = TxtNAND;
-			FFS_flashData.voicebuffer_storage = SNAP_STG_NAND;
-		break;
-
-		case 3:
-			txtId = TxtTflash;
-			FFS_flashData.voicebuffer_storage = SNAP_STG_MMC;
-		break;
-	}
-
-	flash_write();
-	//Set the Quality Factor.
-	TRACE_EVENT_P1("STorage set to %d ", FFS_flashData.voicebuffer_storage);
-	//Display the dialgbox to the user.
-	voice_memo_dialog_create(parent_win,txtId,TxtSelected);
-	return MFW_EVENT_CONSUMED;
-}
-
-/*******************************************************************************
-
- $Function:     voice_memo_storeage
-
- $Description:
-
-
- $Returns:
-
- $Arguments:
-
-*******************************************************************************/
-GLOBAL int voice_memo_storeage (MfwMnu* m, MfwMnuItem* i)
-{
-	T_MFW_HND parent_win = mfwParent(mfw_header());
-	int txtId = TxtFFS;
-
-	TRACE_FUNCTION("mmi_camera_set_storage()");
-
-	switch (m->lCursor[m->level])
-	{
-		case 0:
-			txtId = TxtFFS;
-			FFS_flashData.voicememo_storage = SNAP_STG_FFS;
-		break;
-
-		case 1:
-			txtId = TxtNORMS;
-			FFS_flashData.voicememo_storage = SNAP_STG_NORMS;
-		break;
-
-		case 2:
-			txtId = TxtNAND;
-			FFS_flashData.voicememo_storage = SNAP_STG_NAND;
-		break;
-
-		case 3:
-			txtId = TxtTflash;
-			FFS_flashData.voicememo_storage = SNAP_STG_MMC;
-		break;
-	}
-
-	flash_write();
-	//Set the Quality Factor.
-	TRACE_EVENT_P1("STorage set to %d ", FFS_flashData.voicememo_storage);
-	//Display the dialgbox to the user.
-	voice_memo_dialog_create(parent_win,txtId,TxtSelected);
-	return MFW_EVENT_CONSUMED;
-}
-#endif
-
 
 /*******************************************************************************
 
@@ -494,7 +334,6 @@
 
  $Description:
 
-
  $Returns:
 
  $Arguments:
@@ -502,7 +341,6 @@
 *******************************************************************************/
 GLOBAL int voice_memo_record (MfwMnu* m, MfwMnuItem* i)
 {
-
   T_MFW_HND win = mfw_parent(mfw_header());
 
   TRACE_FUNCTION ("voice_memo_record()");
@@ -543,7 +381,6 @@
 }
 
 
-
 /*******************************************************************************
 
  $Function:     vocie_memo_create
@@ -606,11 +443,11 @@
 
   TRACE_FUNCTION ("voice_memo_destroy()");
 
-	if (own_window == NULL)
-	{
-		TRACE_EVENT ("Error : Called with NULL Pointer");
-		return;
-	}
+  if (own_window == NULL)
+  {
+	TRACE_EVENT ("Error : Called with NULL Pointer");
+	return;
+  }
 
   if (data)
   {
@@ -638,7 +475,6 @@
 }
 
 
-
 /*******************************************************************************
 
  $Function:     voice_memo
@@ -658,11 +494,10 @@
  // T_DISPLAY_DATA display_info;   // RAVI
 
   SHORT	mfw_aud_retVal = 0; /* x0039928 - Lint warning fix */
- #ifdef FF_PCM_VM_VB
+#ifdef FF_PCM_VM_VB
   UBYTE vm_type; //to store voice memo type
 #endif
 
-
   data->Identifier = value;
 
   TRACE_FUNCTION ("voice_memo()");
@@ -681,7 +516,6 @@
     data->info_tim = tim_create (win, 1000, (T_MFW_CB)voice_memo_tim_cb);
     data->info_kbd = kbd_create (win, KEY_ALL, (T_MFW_CB)voice_memo_kbd_cb);
 
-
     if (value EQ VM_PLAY)
     {
       TRACE_EVENT ("VM_PLAY()");
@@ -805,7 +639,7 @@
     TRACE_FUNCTION ("voice_memo_win_cb()");
 
     if (data EQ 0)
-  return 1;
+	return 1;
 
     switch (event)
   {
@@ -870,7 +704,6 @@
 
  $Description:  Callback function for the voice_memo timer.
 
-
  $Returns:    MFW event handler
 
  $Arguments:  window handle event, timer control block
@@ -880,7 +713,7 @@
 {
   T_MFW_HND       win  = mfw_parent (mfw_header());
   T_MFW_WIN     * win_data = ((T_MFW_HDR *)win)->data;
-  T_voice_memo   * data = (T_voice_memo *)win_data->user;
+  T_voice_memo  * data = (T_voice_memo *)win_data->user;
 
   SHORT	mfw_aud_retVal;
   //x0pleela 27 Feb, 2006   ER:OMAPS00067709
@@ -1019,11 +852,10 @@
 {
   T_MFW_HND       win  = mfw_parent (mfw_header());
   T_MFW_WIN     * win_data = ((T_MFW_HDR *)win)->data;
-  T_voice_memo   * data = (T_voice_memo *)win_data->user;
+  T_voice_memo  * data = (T_voice_memo *)win_data->user;
 
   USHORT          Identifier = data->Identifier;
-	SHORT			mfw_aud_retVal;
-
+  SHORT		  mfw_aud_retVal;
 
   TRACE_FUNCTION("voice_memo_kbd_cb");
 
@@ -1176,7 +1008,6 @@
 	UBYTE vm_type; //to store voice memo type
 #endif
 
-
 //x0pleela 16 Mar, 2006  ER:OMAPS00067709
 #ifdef FF_PCM_VM_VB
   vm_type = get_voice_memo_type();
@@ -1272,8 +1103,6 @@
     break;
     }
 
-
-
 #endif /* FF_PCM_VM_VB */
 
 /* BEGIN ADD: Req ID: : Sumit : 14-Mar-05 */
@@ -1363,8 +1192,6 @@
     break;
     }
 
-
-
 #endif /* FF_PCM_VM_VB */
 
 /* BEGIN ADD: Req ID: : Sumit : 14-Mar-05 */
@@ -1381,7 +1208,7 @@
  $Function:     pcm_voice_memo_play
 
  $Description: Sets voice memo type to PCM_VOICE_MEMO which indicates PCM voice memo is
- 			active and start playing the voice
+		active and start playing the voice
 
  $Returns:
 
@@ -1407,7 +1234,7 @@
  $Function:     pcm_voice_memo_record
 
  $Description: Sets voice memo type to PCM_VOICE_MEMO which indicates PCM voice memo is
- 			active and start recording the voice
+		active and start recording the voice
 
 
  $Returns:
@@ -1434,7 +1261,7 @@
  $Function:     voice_buffering_edit_num
 
  $Description: Opens an edtor for the user to enter PTT number. Also resets voice buffering data
- 			with default values
+		with default values
 
  $Returns:
 
@@ -1541,7 +1368,7 @@
  $Function:     voice_buffering_record_start
 
  $Description: Starts recording voice and conects to the PTT number if the call is not active.
- 			If in call, then start playing the voice
+		If in call, then start playing the voice
 
  $Returns:
 
@@ -1565,7 +1392,7 @@
   {
     //create timer
     voice_buffering_data.voice_buffering_tim= tim_create (win, 20000,
-      													  (T_MFW_CB)voice_buffering_tim_cb);
+					  (T_MFW_CB)voice_buffering_tim_cb);
     //start timer
     timStart(voice_buffering_data.voice_buffering_tim);
     voice_buffering_data.buffering_phase = TRUE;
@@ -1717,7 +1544,7 @@
  $Function:     voice_buffering_stop_recording
 
  $Description: A wrapper function for record stop to invoke from other modules.
- 			Stops the timer and recording
+		Stops the timer and recording
 
  $Returns:
 
@@ -1780,7 +1607,7 @@
  $Function:     voice_memo_tim_cb
 
  $Description: Timer callback. Stops the timer. If PTT call is not setup disconnect the call,
- 			else call record stop
+		else call record stop
 
  $Returns:
 
@@ -1852,6 +1679,5 @@
   voice_buffering_data.buffering_phase = FALSE;
   voice_buffering_data.incoming_call_discon = FALSE;
   voice_buffering_data.play_stopped = FALSE;
-
 }
 #endif