jet.h revision e442bb7cd6a085b33a4dd52c0e20a157ada7feb1
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/* opaque handle types for JET interface */
36typedef struct s_jet_data_tag *JET_DATA_HANDLE;
37
38typedef struct s_jet_config_tag
39{
40	EAS_U8		appEventRangeLow;
41	EAS_U8		appEventRangeHigh;
42} S_JET_CONFIG;
43
44typedef struct s_jet_status_tag
45{
46	EAS_INT 	currentUserID;
47	EAS_INT 	segmentRepeatCount;
48	EAS_INT 	numQueuedSegments;
49	EAS_BOOL 	paused;
50} S_JET_STATUS;
51
52typedef struct s_jet_event_tag
53{
54	EAS_U8		segment;
55	EAS_U8		channel;
56	EAS_U8		track;
57	EAS_U8		controller;
58	EAS_U8		value;
59} S_JET_EVENT;
60
61/*----------------------------------------------------------------------------
62 * JET_Init()
63 *----------------------------------------------------------------------------
64 * Initializes the JET library, allocates memory, etc. Call
65 * JET_Shutdown to de-allocate memory. Pass NULL for pConfig
66 * to use defaults. If passing config data, configSize should be
67 * sizeof(S_JET_CONFIG). This allows for future expansion of the
68 * config structure while maintaining compatibility.
69 *----------------------------------------------------------------------------
70*/
71EAS_PUBLIC EAS_RESULT JET_Init (EAS_DATA_HANDLE easHandle, const S_JET_CONFIG *pConfig, EAS_INT configSize);
72
73/*----------------------------------------------------------------------------
74 * JET_Shutdown()
75 *----------------------------------------------------------------------------
76 * Frees any memory used by the JET library
77 *----------------------------------------------------------------------------
78*/
79EAS_PUBLIC EAS_RESULT JET_Shutdown (EAS_DATA_HANDLE easHandle);
80
81/*----------------------------------------------------------------------------
82 * JET_OpenFile()
83 *----------------------------------------------------------------------------
84 * Opens a JET content file for playback
85 *----------------------------------------------------------------------------
86*/
87EAS_PUBLIC EAS_RESULT JET_OpenFile (EAS_DATA_HANDLE easHandle, EAS_FILE_LOCATOR locator);
88
89/*----------------------------------------------------------------------------
90 * JET_GetAppData()
91 *----------------------------------------------------------------------------
92 * Returns location and size of application data in the JET file
93 *----------------------------------------------------------------------------
94*/
95EAS_RESULT JET_GetAppData (EAS_DATA_HANDLE easHandle, EAS_I32 *pAppDataOffset, EAS_I32 *pAppDataSize);
96
97/*----------------------------------------------------------------------------
98 * JET_CloseFile()
99 *----------------------------------------------------------------------------
100 * Closes a JET content file and releases associated resources
101 *----------------------------------------------------------------------------
102*/
103EAS_PUBLIC EAS_RESULT JET_CloseFile (EAS_DATA_HANDLE easHandle);
104
105/*----------------------------------------------------------------------------
106 * JET_Status()
107 *----------------------------------------------------------------------------
108 * Returns current status
109 *----------------------------------------------------------------------------
110*/
111EAS_PUBLIC EAS_RESULT JET_Status (EAS_DATA_HANDLE easHandle, S_JET_STATUS *pStatus);
112
113/*----------------------------------------------------------------------------
114 * JET_GetEvent()
115 *----------------------------------------------------------------------------
116 * Checks for application events
117 *----------------------------------------------------------------------------
118*/
119EAS_BOOL JET_GetEvent (EAS_DATA_HANDLE easHandle, EAS_U32 *pEventRaw, S_JET_EVENT *pEvent);
120
121/*----------------------------------------------------------------------------
122 * JET_ParseEvent()
123 *----------------------------------------------------------------------------
124 * Returns current status
125 *----------------------------------------------------------------------------
126*/
127EAS_PUBLIC void JET_ParseEvent (EAS_U32 event, S_JET_EVENT *pEvent);
128
129/*----------------------------------------------------------------------------
130 * JET_QueueSegment()
131 *----------------------------------------------------------------------------
132 * Queue a segment for playback
133 *----------------------------------------------------------------------------
134*/
135EAS_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);
136
137/*----------------------------------------------------------------------------
138 * JET_Play()
139 *----------------------------------------------------------------------------
140 * Starts playback of the file
141 *----------------------------------------------------------------------------
142*/
143EAS_PUBLIC EAS_RESULT JET_Play (EAS_DATA_HANDLE easHandle);
144
145/*----------------------------------------------------------------------------
146 * JET_Pause()
147 *----------------------------------------------------------------------------
148 * Pauses playback of the file
149 *----------------------------------------------------------------------------
150*/
151EAS_PUBLIC EAS_RESULT JET_Pause (EAS_DATA_HANDLE easHandle);
152
153/*----------------------------------------------------------------------------
154 * JET_SetMuteFlags()
155 *----------------------------------------------------------------------------
156 * Change the state of the mute flags
157 *----------------------------------------------------------------------------
158*/
159EAS_PUBLIC EAS_RESULT JET_SetMuteFlags (EAS_DATA_HANDLE easHandle, EAS_U32 muteFlags, EAS_BOOL sync);
160
161/*----------------------------------------------------------------------------
162 * JET_SetMuteFlag()
163 *----------------------------------------------------------------------------
164 * Change the state of a single mute flag
165 *----------------------------------------------------------------------------
166*/
167EAS_PUBLIC EAS_RESULT JET_SetMuteFlag (EAS_DATA_HANDLE easHandle, EAS_INT trackNum, EAS_BOOL muteFlag, EAS_BOOL sync);
168
169/*----------------------------------------------------------------------------
170 * JET_TriggerClip()
171 *----------------------------------------------------------------------------
172 * Unmute a track and then mute it when it is complete
173 *----------------------------------------------------------------------------
174*/
175EAS_PUBLIC EAS_RESULT JET_TriggerClip (EAS_DATA_HANDLE easHandle, EAS_INT clipID);
176
177#endif
178
179