Open Reality Reference Guide
fbaudio.h
Go to the documentation of this file.
1#ifndef __FBAUDIO_H__
2#define __FBAUDIO_H__
3/**************************************************************************
4 Copyright (c) 1994 - 2009 Autodesk, Inc. and/or its licensors.
5 All Rights Reserved.
6
7 The coded instructions, statements, computer programs, and/or related
8 material (collectively the "Data") in these files contain unpublished
9 information proprietary to Autodesk, Inc. and/or its licensors, which is
10 protected by Canada and United States of America federal copyright law
11 and by international treaties.
12
13 The Data may not be disclosed or distributed to third parties, in whole
14 or in part, without the prior written consent of Autodesk, Inc.
15 ("Autodesk").
16
17 THE DATA IS PROVIDED "AS IS" AND WITHOUT WARRANTY.
18 ALL WARRANTIES ARE EXPRESSLY EXCLUDED AND DISCLAIMED. AUTODESK MAKES NO
19 WARRANTY OF ANY KIND WITH RESPECT TO THE DATA, EXPRESS, IMPLIED OR
20 ARISING BY CUSTOM OR TRADE USAGE, AND DISCLAIMS ANY IMPLIED WARRANTIES
21 OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR
22 PURPOSE OR USE. WITHOUT LIMITING THE FOREGOING, AUTODESK DOES NOT
23 WARRANT THAT THE OPERATION OF THE DATA WILL BE UNINTERRUPTED OR ERROR
24 FREE.
25
26 IN NO EVENT SHALL AUTODESK, ITS AFFILIATES, PARENT COMPANIES, LICENSORS
27 OR SUPPLIERS ("AUTODESK GROUP") BE LIABLE FOR ANY LOSSES, DAMAGES OR
28 EXPENSES OF ANY KIND (INCLUDING WITHOUT LIMITATION PUNITIVE OR MULTIPLE
29 DAMAGES OR OTHER SPECIAL, DIRECT, INDIRECT, EXEMPLARY, INCIDENTAL, LOSS
30 OF PROFITS, REVENUE OR DATA, COST OF COVER OR CONSEQUENTIAL LOSSES OR
31 DAMAGES OF ANY KIND), HOWEVER CAUSED, AND REGARDLESS OF THE THEORY OF
32 LIABILITY, WHETHER DERIVED FROM CONTRACT, TORT (INCLUDING, BUT NOT
33 LIMITED TO, NEGLIGENCE), OR OTHERWISE, ARISING OUT OF OR RELATING TO THE
34 DATA OR ITS USE OR ANY OTHER PERFORMANCE, WHETHER OR NOT AUTODESK HAS
35 BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSS OR DAMAGE.
36
37**************************************************************************/
38
43#include <kaydaradef.h>
44#ifndef FBSDK_DLL
48 #define FBSDK_DLL K_DLLIMPORT
49#endif
50
51#include <fbsdk/fbcomponent.h>
52#include <fbsdk/fbaudiofmt.h>
53
54#ifdef FBSDKUseNamespace
55 namespace FBSDKNamespace {
56#endif
57
63FB_DEFINE_COMPONENT( FBSDK_DLL, AudioClip );
64
69};
70
76};
77
83};
84
90};
91
98};
99
100FB_DEFINE_ENUM(FBSDK_DLL, AccessMode);
101FB_DEFINE_ENUM(FBSDK_DLL, UseChnMode);
102FB_DEFINE_ENUM(FBSDK_DLL, TriggerStyle);
103FB_DEFINE_ENUM(FBSDK_DLL, ExistingClipAction);
104FB_DEFINE_ENUM(FBSDK_DLL, ExistingFileAction);
105
107// FBAudioIn
109
190{
191 //--- Open Reality declaration.
193public:
194
198 FBAudioIn(HIObject pObject=NULL);
199
200
205 bool SetOnline( bool pOnline );
206
210 bool IsOnline() const;
211
212
221 bool PrepareToRecord( const char* pRecordingPath,
222 FBExistingClipAction pExistingClipAction = kFBExistingClipAskUser,
223 FBExistingFileAction pExistingFileAction = kFBExistingFileAskUser );
224
229
233 bool IsReadyToRecord() const;
234
235
240
245 bool SetRecordingFormat( FBAudioFmt pAudioFormat );
246
251
252
257 bool SetDelay( FBTime& pDelay );
258
263
264
269 bool SetDestination( FBAudioOut* pAudioOut );
270
275};
276
278// FBAudioOut
280
284{
285 //--- Open Reality declaration.
287public:
288
292 FBAudioOut(HIObject pObject=NULL);
293};
294
297
299// FBAudioClip
301
305{
306 //--- Open Reality declaration.
308public:
309
315 FBAudioClip(const char* pFileName, bool pSetToDefaultDest=true, HIObject pObject=NULL);
316
319 virtual void FBDelete() override;
320
326 bool Play(FBTriggerStyle pStyle=kFBTriggerStyleContinue, FBAudioOut* pDestination=NULL);
327
331 void Stop(FBAudioOut* pDestination=NULL);
332
337
342 bool FileOpen(char const * pPath);
343
344
347
352 FBPropertyAccessMode AccessMode;
353 FBPropertyUseChnMode UseChannel;
355
359
363
367
368 FBPropertyTake CurrentTake;
369 FBPropertyAudioOut Destination;
370
373};
374
378{
379public:
385 FBAudioIn* operator[](int pIndex);
386};
387
390{
391public:
397 FBAudioOut* operator[](int pIndex);
398};
399
402{
403public:
410};
411
412#ifdef FBSDKUseNamespace
413 }
414#endif
415#endif /* this must be the last line of this file */
Used to play audio clips and access their properties.
Definition: fbaudio.h:305
FBAudioClip(const char *pFileName, bool pSetToDefaultDest=true, HIObject pObject=NULL)
Constructor.
FBPropertyTake CurrentTake
Read Write Property: The take this media belongs to.
Definition: fbaudio.h:368
virtual void FBDelete() override
Virtual FBDelete function.
bool Play(FBTriggerStyle pStyle=kFBTriggerStyleContinue, FBAudioOut *pDestination=NULL)
Play audio clip now.
FBPropertyTime DstEnd
Read Write Property: Total duration of this audio clip.
Definition: fbaudio.h:362
FBPropertyDouble ClipSpeed
Read Write Property: The speed of the media when being played.
Definition: fbaudio.h:354
FBPropertyInt Channels
Read Only Property: the number of channels in use.
Definition: fbaudio.h:349
FBPropertyBool LockClipSpeed
Read Write Property: Indicates whether to lock the current playing speed.
Definition: fbaudio.h:366
FBPropertyTime SrcEnd
Read Only Property: The end time of media.
Definition: fbaudio.h:358
FBPropertyUseChnMode UseChannel
Read Write Property: Enables you to control which track are used with stereo clips.
Definition: fbaudio.h:353
bool IsMediaReady()
Check if the audio clip constructed properly.
FBPropertyTime SrcDuration
Read Only Property: The duration time of media.
Definition: fbaudio.h:357
FBPropertyInt Format
Read Only Property: Data format of media, including rate, bits and channels count....
Definition: fbaudio.h:348
FBPropertyDouble Pitch
Read Write Property: The audio clip pitch value. To write to this property, you must first set LockPi...
Definition: fbaudio.h:371
FBPropertyBool LockPitchToSpeed
Read Write Property: Time stretch enabled factor.
Definition: fbaudio.h:372
FBPropertyString RelativePath
Read Only Property: Relative path of media.
Definition: fbaudio.h:346
FBPropertyAccessMode AccessMode
Read Write Property: Specify the media data access mode between disk or memory.
Definition: fbaudio.h:352
FBPropertyTime DstDuration
Read Write Property: When not used in the Story, this specify when the clips stops playing.
Definition: fbaudio.h:361
FBPropertyTime SrcIn
Read Only Property: The begin time of media.
Definition: fbaudio.h:356
FBPropertyBool Scrubbing
Read Write Property: Control which clip (one at a time) can shuttle when playing a various speeds.
Definition: fbaudio.h:365
FBPropertyInt Bits
Read Only Property: the bits of media.
Definition: fbaudio.h:351
FBPropertyString Path
Read Only Property: Full Path of the media.
Definition: fbaudio.h:345
void Stop(FBAudioOut *pDestination=NULL)
Stop any playing triggered audio clip on a specified destination.
FBPropertyAudioOut Destination
Read Write Property: The audio output destination where the clip will be played.
Definition: fbaudio.h:369
bool FileOpen(char const *pPath)
Load an audio clip file.
FBPropertyInt Rate
Read Only Property: the rate of media.
Definition: fbaudio.h:350
FBPropertyTime DstIn
Read Write Property: When not used in the Story, this specify when the clips begin to play.
Definition: fbaudio.h:360
FBPropertyBool ConstrainDstToTake
Read Write Property: Indicates whether to constrain the EndPoint to the end of the take.
Definition: fbaudio.h:364
Audio In class.
Definition: fbaudio.h:190
FBAudioIn(HIObject pObject=NULL)
Constructor.
FBAudioFmt GetSupportedFormats() const
Returns all the Audio In supported formats (i.e.
bool IsOnline() const
Is the Audio In online?
bool SetDelay(FBTime &pDelay)
Sets the delay to use.
bool PrepareToRecord(const char *pRecordingPath, FBExistingClipAction pExistingClipAction=kFBExistingClipAskUser, FBExistingFileAction pExistingFileAction=kFBExistingFileAskUser)
Prepares the Audio In for recording (similar as checking the "Record" checkbox in the UI).
bool SetRecordingFormat(FBAudioFmt pAudioFormat)
Sets the recording format (i.e.
bool IsReadyToRecord() const
Is the Audio In ready to record (has it been prepared properly)?
bool SetDestination(FBAudioOut *pAudioOut)
Sets the Audio Out object to be used as the destination.
bool TurnOffRecording()
Turns off the Audio In recording (similar as un-checking the "Record" checkbox in the UI).
FBAudioFmt GetRecordingFormat() const
Returns the recording format (i.e.
FBTime GetDelay() const
Returns the delay currently set.
FBAudioOut * GetDestination() const
Returns the Audio Out object currently used as the destination.
bool SetOnline(bool pOnline)
Turns Audio In online or offline.
Audio Out class.
Definition: fbaudio.h:284
FBAudioOut(HIObject pObject=NULL)
Constructor.
MotionBuilder SDK base class.
Definition: fbcomponent.h:651
List: AudioClip
Definition: fbaudio.h:402
FBAudioClip * operator[](int pIndex)
Get the audio clip at pIndex.
List: AudioIn
Definition: fbaudio.h:378
FBAudioIn * operator[](int pIndex)
Get the audio input at pIndex.
List: AudioOut
Definition: fbaudio.h:390
FBAudioOut * operator[](int pIndex)
Get the audio output at pIndex.
PropertyList: Concrete class for PropertyList of component
Definition: fbcomponent.h:536
Property class: const char * (String).
Time data structure.
Definition: fbtime.h:88
#define FBSDK_DLL
Be sure that FBSDK_DLL is defined only once...
Definition: fbaudio.h:48
FBUseChnMode
Use Channel modes.
Definition: fbaudio.h:72
@ kFBUseChannelBoth
Default mode, where each channel play in its respective speaker.
Definition: fbaudio.h:75
@ kFBUseChannelLeftOnly
Left channel will be played in both speakers.
Definition: fbaudio.h:73
@ kFBUseChannelRightOnly
Right channel will be played in both speakers.
Definition: fbaudio.h:74
FBAccessMode
Data access modes.
Definition: fbaudio.h:66
@ kFBAccessModeMemory
Access data from memory, which means that it will copyed entirely into it.
Definition: fbaudio.h:68
@ kFBAccessModeDisk
Access data directly to disk using a cache system.
Definition: fbaudio.h:67
FBTriggerStyle
Audio clips' trigger styles.
Definition: fbaudio.h:79
@ kFBTriggerStyleContinue
Previously triggered clips that are still playing won't be stopped and mixing will occur.
Definition: fbaudio.h:80
@ kFBTriggerStyleCut
Previously triggered clips that are still playing will be stopped.
Definition: fbaudio.h:81
@ kFBTriggerStyleToggle
If a previously triggered clip is playing, it will only be stopped, otherwise a new starts playing....
Definition: fbaudio.h:82
FBExistingClipAction
Action to perform, when preparing an Audio In object to record, when the action clip associated to th...
Definition: fbaudio.h:86
@ kFBExistingClipAskUser
Ask the user for desired operation via a dialog.
Definition: fbaudio.h:87
@ kFBExistingClipAbortOperation
Cancel preparing the audio in to record.
Definition: fbaudio.h:89
@ kFBExistingClipRemove
Remove the action clip from the scene.
Definition: fbaudio.h:88
K_DLLIMPORT FBAudioOut * FBAudioOutGetDefault()
Get default audio output.
FBExistingFileAction
Action to perform, when preparing an Audio In object to record, when the action clip associated to th...
Definition: fbaudio.h:93
@ kFBExistingFileOverwrite
Overwrite the existing file on disk.
Definition: fbaudio.h:95
@ kFBExistingFileAskUser
Ask the user for desired operation via a dialog.
Definition: fbaudio.h:94
@ kFBExistingFileAppend
Append the new recording to existing recording. Warning: Be sure that the current file format match y...
Definition: fbaudio.h:96
@ kFBExistingFileAbortOperation
Cancel preparing the audio in to record.
Definition: fbaudio.h:97
Audio formats definition.
int FBAudioFmt
Definition: fbaudiofmt.h:56
Basic class definitions.
#define __FBClassDeclare(Name, Parent)
For internal use only.
Definition: fbcomponent.h:131
FB_DEFINE_COMPONENT(K_DLLIMPORT, AnimationNode)
Animation node class.
class K_DLLIMPORT FBPropertyBase< int, kFBPT_int > FBPropertyInt
Property: int
class K_DLLIMPORT FBPropertyBase< bool, kFBPT_bool > FBPropertyBool
Property: bool
class K_DLLIMPORT FBPropertyBase< FBTime, kFBPT_Time > FBPropertyTime
Property: FBTime
#define FB_DEFINE_ENUM(DllTag, Type)
Define an enum and give it the ability to be a property.
Definition: fbproperties.h:150
class K_DLLIMPORT FBPropertyBase< double, kFBPT_double > FBPropertyDouble
Property: double
#define __FB_FORWARD(ClassName)
Forwarding of class and typedef declaration.
Definition: fbtypes.h:68