comparison src/ui3/mfw/mfw_midi.h @ 420:e8ddbb0837ed

src/ui3: initial import of TCS3/LoCosto BMI & MFW code
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 21 Jan 2018 03:09:00 +0000
parents
children
comparison
equal deleted inserted replaced
419:59143cd42ec7 420:e8ddbb0837ed
1 /*
2 +--------------------------------------------------------------------+
3 | PROJECT: MMI-Framework (8417) $Workfile:: mfw_midi.h $|
4 | $Author:: NDH $Revision:: 1 $|
5 | CREATED: 21.05.04 $Modtime:: 21.05.04 14:58 $|
6 | STATE : code |
7 +--------------------------------------------------------------------+
8
9 MODULE : MFW_MIDI
10
11 PURPOSE : This module contains the definitions for the Midi Riveria Interface.
12
13 HISTORY :
14 Aug 27, 2007 REF:DRT OMAPS00137370 x0045876
15 Description: MM: MIDI/IMY file is not played correctly after listening a
16 MP3 in the Browse Midi list.
17 Solution: Param Voice_Limit is changed when MP3 or AAC file is played. So before
18 playing MP3 or AAC file, Voice_Limit should be saved.
19 Jun 06, 2006 REF:ER OMAPS00080844 xdeepadh
20 Description: duplication of midi files in ffs area
21 Solution: The code to create and load the midi files from FFS to LFS is
22 removed.
23
24 Nov 21, 2005 REF:ER OMAPS00057430 nekkareb
25 Description: AAC Ringer Implementation
26 Solution: The Midi Ringer application has been enhanced to support AAC as ringer.
27
28 Nov 04, 2005 REF:DRT OMAPS00053737 xdeepadh
29 Description: MIDI Ringer Linear Flash Support.
30 Solution: The Midi Ringer application has been enhanced to loadand play the midi files from LFS.
31
32 Nov 02, 2005 REF:ER OMAPS00039044 xdeepadh
33 Description: Mp3 Ringer Implementation
34 Solution: The Midi Ringer application has been enhanced to support mp3 as ringer.
35 The interface function names have been modified.
36
37 Apr 05, 2005 REF: ENH 29994 xdeepadh
38 Description: Implementation of Generic Midi Ringer and Modification of existing Midi Test Application
39 Solution: Generic Midi Ringer and Midi Test Application were implemented.
40
41
42 */
43 //Includes for Audio Services
44 #include "as/as_api.h"
45 #include "as/as_message.h"
46
47 #ifdef FF_MMI_FILEMANAGER
48 #define FILENAME_MAX_LEN 250
49 #else
50 #define FILENAME_MAX_LEN 47
51 #endif
52
53 /*
54 ** Midi Test Return Values
55 */
56 #define MFW_PLAYER_TEST_OK (0)
57 #define MFW_PLAYER_TEST_RIVIERA_FAILED (-1)
58 #define MFW_PLAYER_TEST_MEM_FULL (-2)
59 #define MFW_PLAYER_TEST_MEM_EMPTY (-3)
60 #define MFW_PLAYER_TEST_ERROR (-4)
61
62 #define PLAYER_EXIT_FLAG_FALSE 0
63 #define PLAYER_EXIT_FLAG_TRUE 1
64
65 #define MIDI_CHANNEL_MONO 1
66 #define MIDI_CHANNEL_STEREO 2
67
68 #ifdef FF_MP3_RINGER
69 #define MP3_CHANNEL_MONO 0
70 #define MP3_CHANNEL_STEREO 1
71 #endif //FF_MP3_RINGER
72
73 //Nov 22, 2005 REF:ER OMAPS00057430 nekkareb
74 // AAC specific macros
75 #ifdef FF_AAC_RINGER
76 #define AAC_CHANNEL_MONO 0
77 #define AAC_CHANNEL_STEREO 1
78 #endif //FF_AAC_RINGER
79
80
81 //Flash folder to store the tones
82 #define RINGER_CONTENT_DIR "/mmi/tones"
83
84
85 //Nov 04, 2005 REF:DRT OMAPS00053737 xdeepadh
86 #ifdef FF_MIDI_LOAD_FROM_LFS
87 //LFS folder to store the tones
88 #define LFS_CONTENT_DIR "/"
89
90
91 typedef enum
92 {
93 TEST_PASSED = 0, /* No error occurs */
94 TEST_FAILED = -2, /* An error occurs -> continu test suite */
95 TEST_IRRECOVERABLY_FAILED = -3 /* An error occurs -> stop test suite */
96 } T_RV_TEST_RET;
97
98 #endif //FF_MIDI_LOAD_FROM_LFS
99
100 /*
101 ** Midi Test Functions Prototypes
102 */
103
104 SHORT mfw_player_set_loop_on(void);
105 SHORT mfw_player_set_loop_off(void);
106 SHORT mfw_player_set_channel_mono(void);
107 SHORT mfw_player_set_channel_stereo(void);
108
109 /* Aug 27, 2007 DRT: OMAPS00137370 x0045876 */
110 /* Voice Limit parameter should be saved to a temp var before playing
111 MP3 or AAC file */
112 INT16 mfw_player_midi_get_voice_limit(void);
113 void mfw_player_set_voice_limit(INT16 voice_lmt);
114 SHORT mfw_player_midi_set_voice_limit(int voice_limit);
115 SHORT mfw_player_save_selected_file_idx(int index);
116 void mfw_player_init(void);
117 SHORT mfw_player_set_headset();
118 SHORT mfw_player_set_speaker();
119 SHORT mfw_ringer_set_audiopath();
120 /*
121 ** Midi ringer Function Prototypes
122 */
123 //Nov 02, 2005 REF:ER OMAPS00039044 xdeepadh
124 //The function names have been modified to be generic
125 SHORT mfw_ringer_set_memory(T_AS_PLAYER_TYPE player_type,T_AS_RINGER_MODE ringer_mode,UINT32 *memory_pointer,UINT32 size);
126 SHORT mfw_ringer_set_file(T_AS_PLAYER_TYPE player_type,T_AS_RINGER_MODE ringer_mode,const char* filename);
127 SHORT mfw_ringer_start(T_AS_RINGER_MODE ringer_mode,BOOLEAN loop,void (*callback_fn)(void *));
128 SHORT mfw_ringer_set_volume(T_AS_RINGER_MODE ringer_mode,T_AS_VOLUME volume);
129 SHORT mfw_ringer_start(T_AS_RINGER_MODE ringer_mode,BOOLEAN loop,void (*callback_fn)(void *));
130 SHORT mfw_ringer_stop(void (*callback_fn)(void *));
131 T_AS_RINGER_INFO* mfw_ringer_get_info(T_AS_RINGER_MODE ringer_mode,const T_AS_RINGER_INFO* ringer_info);
132 static void mfw_ringer_configure_callback_fn(void (*callback_fn)(void *));
133 SHORT mfw_player_start_memory(T_AS_PLAYER_TYPE player_type,const UINT32* address, UINT32 size,T_AS_VOLUME volume,BOOLEAN loop,void (*callback_fn)(void *));
134 #ifdef FF_MMI_FILEMANAGER
135 SHORT mfw_player_start_file(T_AS_PLAYER_TYPE player_type, UINT16 * filename,T_AS_VOLUME volume,BOOLEAN loop,void (*callback_fn)(void *));
136 #else
137 SHORT mfw_player_start_file(T_AS_PLAYER_TYPE player_type,const char * filename,T_AS_VOLUME volume,BOOLEAN loop,void (*callback_fn)(void *));
138 #endif
139
140 SHORT mfw_player_stop(void (*callback_fn)(void *));
141 SHORT mfw_player_midi_set_params(INT16 voicelimit,INT16 channel);
142 #ifdef FF_MP3_RINGER
143 SHORT mfw_player_mp3_set_params(UINT32 size_file_start,BOOLEAN mono_stereo);
144 #endif //FF_MP3_RINGER
145
146 //Nov 22, 2005 REF:ER OMAPS00057430 nekkareb
147 // Added function prototype for aac set paramaters
148 #ifdef FF_AAC_RINGER
149 SHORT mfw_player_aac_set_params(UINT32 size_file_start,BOOLEAN mono_stereo);
150 #endif //FF_AAC_RINGER
151
152
153 T_AS_PLAYER_TYPE mfw_ringer_deduce_player_type(const char * filename);
154 SHORT mfw_player_get_params(T_AS_PLAYER_TYPE player_type,const T_AS_PLAYER_PARAMS* player_para);
155