jet.h revision 5257e139e49727f9eaab95f4f9390f629ccfe06d
1/*----------------------------------------------------------------------------
2 *
3 * File:
4 * jet.h
5 *
6 * Contents and purpose:
7 * Public interface for JET sound engine
8 *
9 * Copyright (c) 2006 Sonic Network Inc.
10
11 * Licensed under the Apache License, Version 2.0 (the "License");
12 * you may not use this file except in compliance with the License.
13 * You may obtain a copy of the License at
14 *
15 *      http://www.apache.org/licenses/LICENSE-2.0
16 *
17 * Unless required by applicable law or agreed to in writing, software
18 * distributed under the License is distributed on an "AS IS" BASIS,
19 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20 * See the License for the specific language governing permissions and
21 * limitations under the License.
22 *----------------------------------------------------------------------------
23 * Revision Control:
24 *   $Revision: 554 $
25 *   $Date: 2007-02-02 11:06:10 -0800 (Fri, 02 Feb 2007) $
26 *----------------------------------------------------------------------------
27*/
28
29#ifndef _JET_H
30#define _JET_H
31
32#include "eas_types.h"
33#include "eas.h"
34
35/* for C++ linkage */
36#ifdef __cplusplus
37extern "C" {
38#endif
39
40/* opaque handle types for JET interface */
41typedef struct s_jet_data_tag *JET_DATA_HANDLE;
42
43typedef struct s_jet_config_tag
44{
45	EAS_U8		appEventRangeLow;
46	EAS_U8		appEventRangeHigh;
47} S_JET_CONFIG;
48
49typedef struct s_jet_status_tag
50{
51	EAS_INT 	currentUserID;
52	EAS_INT 	segmentRepeatCount;
53	EAS_INT 	numQueuedSegments;
54	EAS_BOOL 	paused;
55} S_JET_STATUS;
56
57typedef struct s_jet_event_tag
58{
59	EAS_U8		segment;
60	EAS_U8		channel;
61	EAS_U8		track;
62	EAS_U8		controller;
63	EAS_U8		value;
64} S_JET_EVENT;
65
66/*----------------------------------------------------------------------------
67 * JET_Init()
68 *----------------------------------------------------------------------------
69 * Initializes the JET library, allocates memory, etc. Call
70 * JET_Shutdown to de-allocate memory. Pass NULL for pConfig
71 * to use defaults. If passing config data, configSize should be
72 * sizeof(S_JET_CONFIG). This allows for future expansion of the
73 * config structure while maintaining compatibility.
74 *----------------------------------------------------------------------------
75*/
76EAS_PUBLIC EAS_RESULT JET_Init (EAS_DATA_HANDLE easHandle, const S_JET_CONFIG *pConfig, EAS_INT configSize);
77
78/*----------------------------------------------------------------------------
79 * JET_Shutdown()
80 *----------------------------------------------------------------------------
81 * Frees any memory used by the JET library
82 *----------------------------------------------------------------------------
83*/
84EAS_PUBLIC EAS_RESULT JET_Shutdown (EAS_DATA_HANDLE easHandle);
85
86/*----------------------------------------------------------------------------
87 * JET_OpenFile()
88 *----------------------------------------------------------------------------
89 * Opens a JET content file for playback
90 *----------------------------------------------------------------------------
91*/
92EAS_PUBLIC EAS_RESULT JET_OpenFile (EAS_DATA_HANDLE easHandle, EAS_FILE_LOCATOR locator);
93
94/*----------------------------------------------------------------------------
95 * JET_GetAppData()
96 *----------------------------------------------------------------------------
97 * Returns location and size of application data in the JET file
98 *----------------------------------------------------------------------------
99*/
100EAS_RESULT JET_GetAppData (EAS_DATA_HANDLE easHandle, EAS_I32 *pAppDataOffset, EAS_I32 *pAppDataSize);
101
102/*----------------------------------------------------------------------------
103 * JET_CloseFile()
104 *----------------------------------------------------------------------------
105 * Closes a JET content file and releases associated resources
106 *----------------------------------------------------------------------------
107*/
108EAS_PUBLIC EAS_RESULT JET_CloseFile (EAS_DATA_HANDLE easHandle);
109
110/*----------------------------------------------------------------------------
111 * JET_Status()
112 *----------------------------------------------------------------------------
113 * Returns current status
114 *----------------------------------------------------------------------------
115*/
116EAS_PUBLIC EAS_RESULT JET_Status (EAS_DATA_HANDLE easHandle, S_JET_STATUS *pStatus);
117
118/*----------------------------------------------------------------------------
119 * JET_GetEvent()
120 *----------------------------------------------------------------------------
121 * Checks for application events
122 *----------------------------------------------------------------------------
123*/
124EAS_BOOL JET_GetEvent (EAS_DATA_HANDLE easHandle, EAS_U32 *pEventRaw, S_JET_EVENT *pEvent);
125
126/*----------------------------------------------------------------------------
127 * JET_ParseEvent()
128 *----------------------------------------------------------------------------
129 * Returns current status
130 *----------------------------------------------------------------------------
131*/
132EAS_PUBLIC void JET_ParseEvent (EAS_U32 event, S_JET_EVENT *pEvent);
133
134/*----------------------------------------------------------------------------
135 * JET_QueueSegment()
136 *----------------------------------------------------------------------------
137 * Queue a segment for playback
138 *----------------------------------------------------------------------------
139*/
140EAS_PUBLIC EAS_RESULT JET_QueueSegment (EAS_DATA_HANDLE easHandle, EAS_INT segmentNum, EAS_INT libNum, EAS_INT repeatCount, EAS_INT transpose, EAS_U32 muteFlags, EAS_U8 userID);
141
142/*----------------------------------------------------------------------------
143 * JET_Play()
144 *----------------------------------------------------------------------------
145 * Starts playback of the file
146 *----------------------------------------------------------------------------
147*/
148EAS_PUBLIC EAS_RESULT JET_Play (EAS_DATA_HANDLE easHandle);
149
150/*----------------------------------------------------------------------------
151 * JET_Pause()
152 *----------------------------------------------------------------------------
153 * Pauses playback of the file
154 *----------------------------------------------------------------------------
155*/
156EAS_PUBLIC EAS_RESULT JET_Pause (EAS_DATA_HANDLE easHandle);
157
158/*----------------------------------------------------------------------------
159 * JET_SetMuteFlags()
160 *----------------------------------------------------------------------------
161 * Change the state of the mute flags
162 *----------------------------------------------------------------------------
163*/
164EAS_PUBLIC EAS_RESULT JET_SetMuteFlags (EAS_DATA_HANDLE easHandle, EAS_U32 muteFlags, EAS_BOOL sync);
165
166/*----------------------------------------------------------------------------
167 * JET_SetMuteFlag()
168 *----------------------------------------------------------------------------
169 * Change the state of a single mute flag
170 *----------------------------------------------------------------------------
171*/
172EAS_PUBLIC EAS_RESULT JET_SetMuteFlag (EAS_DATA_HANDLE easHandle, EAS_INT trackNum, EAS_BOOL muteFlag, EAS_BOOL sync);
173
174/*----------------------------------------------------------------------------
175 * JET_TriggerClip()
176 *----------------------------------------------------------------------------
177 * Unmute a track and then mute it when it is complete
178 *----------------------------------------------------------------------------
179*/
180EAS_PUBLIC EAS_RESULT JET_TriggerClip (EAS_DATA_HANDLE easHandle, EAS_INT clipID);
181
182#ifdef __cplusplus
183} /* end extern "C" */
184#endif
185
186
187#endif
188
189