comparison g23m/condat/ms/src/mfw/mfw_midi.h @ 0:509db1a7b7b8

initial import: leo2moko-r1
author Space Falcon <falcon@ivan.Harhan.ORG>
date Mon, 01 Jun 2015 03:24:05 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:509db1a7b7b8
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
15 Nov 21, 2005 REF:ER OMAPS00057430 nekkareb
16 Description: AAC Ringer Implementation
17 Solution: The Midi Ringer application has been enhanced to support AAC as ringer.
18
19 Nov 04, 2005 REF:DRT OMAPS00053737 xdeepadh
20 Description: MIDI Ringer Linear Flash Support.
21 Solution: The Midi Ringer application has been enhanced to loadand play the midi files from LFS.
22
23 Nov 02, 2005 REF:ER OMAPS00039044 xdeepadh
24 Description: Mp3 Ringer Implementation
25 Solution: The Midi Ringer application has been enhanced to support mp3 as ringer.
26 The interface function names have been modified.
27
28 Apr 05, 2005 REF: ENH 29994 xdeepadh
29 Description: Implementation of Generic Midi Ringer and Modification of existing Midi Test Application
30 Solution: Generic Midi Ringer and Midi Test Application were implemented.
31
32
33 */
34 //Includes for Audio Services
35 #include "as/as_api.h"
36 #include "as/as_message.h"
37
38 /*
39 ** Midi Test Return Values
40 */
41 #define MFW_PLAYER_TEST_OK (0)
42 #define MFW_PLAYER_TEST_RIVIERA_FAILED (-1)
43 #define MFW_PLAYER_TEST_MEM_FULL (-2)
44 #define MFW_PLAYER_TEST_MEM_EMPTY (-3)
45
46 #define PLAYER_EXIT_FLAG_FALSE 0
47 #define PLAYER_EXIT_FLAG_TRUE 1
48
49 #define MIDI_CHANNEL_MONO 1
50 #define MIDI_CHANNEL_STEREO 2
51
52 #ifdef FF_MP3_RINGER
53 #define MP3_CHANNEL_MONO 0
54 #define MP3_CHANNEL_STEREO 1
55 #endif //FF_MP3_RINGER
56
57 //Nov 22, 2005 REF:ER OMAPS00057430 nekkareb
58 // AAC specific macros
59 #ifdef FF_AAC_RINGER
60 #define AAC_CHANNEL_MONO 0
61 #define AAC_CHANNEL_STEREO 1
62 #endif //FF_AAC_RINGER
63
64
65 //Flash folder to store the tones
66 #define RINGER_CONTENT_DIR "/mmi/tones"
67
68 //Nov 04, 2005 REF:DRT OMAPS00053737 xdeepadh
69 #ifdef FF_MIDI_LOAD_FROM_LFS
70 //LFS folder to store the tones
71 #define LFS_CONTENT_DIR "/"
72
73 typedef struct T_RAM_FILEInfo
74 {
75 void *data;
76 int dataSize;
77 } T_RAM_FILE;
78
79 typedef enum
80 {
81 TEST_PASSED = 0, /* No error occurs */
82 TEST_FAILED = -2, /* An error occurs -> continu test suite */
83 TEST_IRRECOVERABLY_FAILED = -3 /* An error occurs -> stop test suite */
84 } T_RV_TEST_RET;
85
86 #endif //FF_MIDI_LOAD_FROM_LFS
87
88 /*
89 ** Midi Test Functions Prototypes
90 */
91
92 SHORT mfw_player_set_loop_on(void);
93 SHORT mfw_player_set_loop_off(void);
94 SHORT mfw_player_set_channel_mono(void);
95 SHORT mfw_player_set_channel_stereo(void);
96 SHORT mfw_player_midi_set_voice_limit(int voice_limit);
97 SHORT mfw_player_save_selected_file_idx(int index);
98 void mfw_player_init(void);
99 SHORT mfw_player_set_headset();
100 SHORT mfw_player_set_speaker();
101 SHORT mfw_ringer_set_audiopath();
102 /*
103 ** Midi ringer Function Prototypes
104 */
105 //Nov 02, 2005 REF:ER OMAPS00039044 xdeepadh
106 //The function names have been modified to be generic
107 SHORT mfw_ringer_set_memory(T_AS_PLAYER_TYPE player_type,T_AS_RINGER_MODE ringer_mode,UINT32 *memory_pointer,UINT32 size);
108 SHORT mfw_ringer_set_file(T_AS_PLAYER_TYPE player_type,T_AS_RINGER_MODE ringer_mode,const char* filename);
109 SHORT mfw_ringer_start(T_AS_RINGER_MODE ringer_mode,BOOLEAN loop,void (*callback_fn)(void *));
110 SHORT mfw_ringer_set_volume(T_AS_RINGER_MODE ringer_mode,T_AS_VOLUME volume);
111 SHORT mfw_ringer_start(T_AS_RINGER_MODE ringer_mode,BOOLEAN loop,void (*callback_fn)(void *));
112 SHORT mfw_ringer_stop(void (*callback_fn)(void *));
113 T_AS_RINGER_INFO* mfw_ringer_get_info(T_AS_RINGER_MODE ringer_mode,const T_AS_RINGER_INFO* ringer_info);
114 static void mfw_ringer_configure_callback_fn(void (*callback_fn)(void *));
115 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 *));
116 SHORT mfw_player_start_file(T_AS_PLAYER_TYPE player_type,const char * filename,T_AS_VOLUME volume,BOOLEAN loop,void (*callback_fn)(void *));
117 SHORT mfw_player_stop(void (*callback_fn)(void *));
118 SHORT mfw_player_midi_set_params(INT16 voicelimit,INT16 channel);
119 #ifdef FF_MP3_RINGER
120 SHORT mfw_player_mp3_set_params(UINT32 size_file_start,BOOLEAN mono_stereo);
121 #endif //FF_MP3_RINGER
122
123 //Nov 22, 2005 REF:ER OMAPS00057430 nekkareb
124 // Added function prototype for aac set paramaters
125 #ifdef FF_AAC_RINGER
126 SHORT mfw_player_aac_set_params(UINT32 size_file_start,BOOLEAN mono_stereo);
127 #endif //FF_AAC_RINGER
128
129
130 T_AS_PLAYER_TYPE mfw_ringer_deduce_player_type(const char * filename);
131 SHORT mfw_player_get_params(T_AS_PLAYER_TYPE player_type,const T_AS_PLAYER_PARAMS* player_para);
132 //Nov 04, 2005 REF:DRT OMAPS00053737 xdeepadh
133 #ifdef FF_MIDI_LOAD_FROM_LFS
134 T_RV_TEST_RET ram_write_lfs(T_RAM_FILE * ram_file,char* filename );
135 T_RAM_FILE *ram_load_file(char* filename);
136 void ram_remove_file(T_RAM_FILE* file_buf);
137 #endif //FF_MIDI_LOAD_FROM_LFS
138