devices/devicereclist/ordevicereclist_device.h

devices/devicereclist/ordevicereclist_device.h
#ifndef __ORDEVICE_RECLIST_DEVICE_H__
#define __ORDEVICE_RECLIST_DEVICE_H__
/***************************************************************************************
Autodesk(R) Open Reality(R) Samples
(C) 2009 Autodesk, Inc. and/or its licensors
All rights reserved.
AUTODESK SOFTWARE LICENSE AGREEMENT
Autodesk, Inc. licenses this Software to you only upon the condition that
you accept all of the terms contained in the Software License Agreement ("Agreement")
that is embedded in or that is delivered with this Software. By selecting
the "I ACCEPT" button at the end of the Agreement or by copying, installing,
uploading, accessing or using all or any portion of the Software you agree
to enter into the Agreement. A contract is then formed between Autodesk and
either you personally, if you acquire the Software for yourself, or the company
or other legal entity for which you are acquiring the software.
AUTODESK, INC., MAKES NO WARRANTY, EITHER EXPRESS OR IMPLIED, INCLUDING BUT
NOT LIMITED TO ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR
PURPOSE REGARDING THESE MATERIALS, AND MAKES SUCH MATERIALS AVAILABLE SOLELY ON AN
"AS-IS" BASIS.
IN NO EVENT SHALL AUTODESK, INC., BE LIABLE TO ANYONE FOR SPECIAL, COLLATERAL,
INCIDENTAL, OR CONSEQUENTIAL DAMAGES IN CONNECTION WITH OR ARISING OUT OF PURCHASE
OR USE OF THESE MATERIALS. THE SOLE AND EXCLUSIVE LIABILITY TO AUTODESK, INC.,
REGARDLESS OF THE FORM OF ACTION, SHALL NOT EXCEED THE PURCHASE PRICE OF THE
MATERIALS DESCRIBED HEREIN.
Autodesk, Inc., reserves the right to revise and improve its products as it sees fit.
Autodesk and Open Reality are registered trademarks or trademarks of Autodesk, Inc.,
in the U.S.A. and/or other countries. All other brand names, product names, or
trademarks belong to their respective holders.
GOVERNMENT USE
Use, duplication, or disclosure by the U.S. Government is subject to restrictions as
set forth in FAR 12.212 (Commercial Computer Software-Restricted Rights) and
DFAR 227.7202 (Rights in Technical Data and Computer Software), as applicable.
Manufacturer is Autodesk, Inc., 10 Duke Street, Montreal, Quebec, Canada, H3C 2L7.
***************************************************************************************/
//--- SDK include
#include <fbsdk/fbsdk.h>
//--- Rec flag play/rec
#define RECLIST_RECFLAG_PLAY 1
#define RECLIST_RECFLAG_REC 2
class FBPlayListEntry
{
public:
FBTime GetStartTime();
FBTime GetStopTime();
FBString mName;
FBTime mInTime;
FBTime mOutTime;
int mPreroll;
int mPostroll;
int mTakeNumber;
FBPlayListEntry()
{
mName = "NoName";
mInTime = 0;
mOutTime = 0;
mPreroll = 0;
mPostroll = 0;
mTakeNumber = 1;
}
~FBPlayListEntry()
{
}
};
//--- Registration defines
#define ORDEVICERECORDLIST__CLASSNAME ORDeviceRecordList
#define ORDEVICERECORDLIST__CLASSSTR "ORDeviceRecordList"
class ORDeviceRecordList : public FBDevice
{
//--- FiLMBOX device declaration.
FBDeviceDeclare( ORDeviceRecordList, FBDevice );
public:
//--- FiLMBOX Constructor/destructor
virtual bool FBCreate();
virtual void FBDestroy();
//--- Device functions
virtual void DeviceIONotify ( kDeviceIOs pAction,FBDeviceNotifyInfo &pDeviceNotifyInfo);
virtual bool DeviceOperation( kDeviceOperations pOperation );
//--- FBX interface
virtual bool FbxStore ( FBFbxObject* pFbxObject,kFbxObjectStore pStoreWhat);
virtual bool FbxRetrieve ( FBFbxObject* pFbxObject,kFbxObjectStore pStoreWhat);
// Device playing
void Play ();
void Stop ();
void Cue (FBTime pStart);
bool GetPlayStatus ();
bool PrepareToRecord ();
bool PrepareToPlay ();
// Playlist management
void ClearList ();
FBPlayListEntry* GetListEntry (int i);
int GetListCount ();
// Attribute management
FBTime GetReferenceTime ();
FBTime GetCurrentStartTime ();
FBTime GetCurrentStopTime ();
void SetRecFlag (bool pFlag) { mRecFlag = pFlag; }
bool GetRecFlag () { return mRecFlag; }
bool GetStandbyState () { return mStandby; }
void SetStandbyState (bool pState) { mStandby = pState; }
void SetCurrentTakeIndex (int pTake) { mCurrentTakeIndex = pTake; }
int GetCurrentTakeIndex () { return mCurrentTakeIndex; }
void LoadFile(const char *pFileName);
bool CreateNewTake(char *pName);
bool ChangeTake(char *pName);
bool SetCurrentTakeTimeSpan(FBTime pStart, FBTime pStop);
void OnUIIdleEvent(HISender pSender, HKEvent pEvent);
protected:
FBArrayTemplate<FBPlayListEntry *> mPlayList;
int mCurrentTakeIndex;
bool mRecFlag;
bool mIsPlaying;
bool mStandby;
FBPlayerControl mPlayerControl;
FBReferenceTime mRefTime;
FBSystem mSystem;
};
#endif /* __ORDEVICE_RECLIST_DEVICE_H__ */