MaxDll.H  - MaxEdlSdk Interface Header File


// start maxdll.h

#pragma message("MaxDll.h")


// maxdll.h

//////////////////////////////////////////////////////////////////
// MaxDll.h - MaxDll EDL Library
//////////////////////////////////////////////////////////////////

//
//================================================================
// Overview
//
// EDLMAX MAXDLL.DLL is a "regular" DLL with extern C EXPORTED
// functions. MAXDLL provides the ability to create EDLs of any
// supported format.
//
// The library is security protected with the EDLMAX PC Dongle
// (Pro or Regular). Without the Dongle it will create a maximun
// of 10 EDL events.
//
// The MFC example project (DllDemo) demostrates its usage.
// CMainFrame::OnDebugMaxdlldemo() contains a complete example
// with comments.
//
//================================================================
// Usage
//
// == Creation and initialization:
//
// The calling application creates a mxHdl_t pointer:
// mxHdl_t hMaxDll = NULL;
// This is initialialized with:
// maxerr = mxCreateMaxdll(
// &gMaxDllHdl, // MaxDll Pointer
// gMaxErrHdl, // mxErrorStruct pointer
// (void (*)()) ErrHandler, // error callback
// (void (*)(void*)) StatusDispHandler, // status callback
// (void (*)(void*)) MsgHandler, // message callback
// (int (*)(void*, void*)) ConfirmHandler, // confirm callback
// (int (*)(void*, void*, void*, void*, void*)) WorkCounter, // progress callback
// void (*edlDisplayHandler)(void*), // display handler
// unsigned short int (*security)(void*, void*, void*, void*) // security handler
// );
//
// This creates (news) the MaxDll object and the edllist objects
// contained within. Addition parameters allow the use of error handling
// and client message callbacks. See mxCreateMaxdll() in this file for
// decription. See the example in the DllDemo project for handling
// messages and errors.
//
// From now on calls to the MaxDll lib must supply this pointer as
// the first parameter to all MaxDll functions. This allows the
// extern C functions to access the EDLMAX c++ code.
//
// Several catagories of enumerations are supplied within maxdll.h
// to assist parameter and error naming.
//
// == Creating Events:
//
// To fill the internal EDLMAX database with your data create a
// mxEventStructOut and initailize it to default values with
// mxInitEventStructOut(). Then "stuff" the mxEventStructOut with your
// data and call mxCreatEvent(). You will probable want to do this
// sequence in a loop.
//
// You must map your internal native data into the form required in
// mxEventStructOut. This is the trickiest part of your work but the
// library is designed to make this as painless as possible.
// mxCreatEvent() takes care of many details and provides error
// returns to alert you to inconsistent data.
// See the header file maxdll.h for instructions.
// See CDlldemoDoc::OnMyMakeList() of the demo app
//
// == Completing the EDL
//
// Upon finishing your data loop, fill the mxProcStruct with the
// EDL processing parameters you desire (see maxdll.h for instructions)
// and call mxCompleteList(). This will "clean" and apply the selected
// processing, including the EDL format.
//
// == Saving the EDL
//
// Call mxSaveList() with a path and file name parameter to save the
// EDL to disk.
// See CDlldemoDoc::OnFileSave() of the demo app
//
// == Loading An EDL
// To load an EDL, call mxSaveList() with a path.
// Fill an mxProcStruct with desired processing params
// and call mxCompleteList().
// See CDlldemoDoc::OnOpenDocument() of the demo app
//
// ==== Security ====
// To assure good security and to make it as easy as possible for
// you to implement, MaxDll now has the following mechanism:
//
// The mxkey.lib library contains a single function (MaxDllQuery)
// which is routed through your app to the MaxDll as a callback.
// mxkey.lib must be linked to your app or the module calling the
// MaxDll. The name of this function (MaxDllQuery) is handed into
// mxCreateMaxdll() as a callback. MaxDll now uses this callback to
// verify it is running under you.
//
// The demo version of the library actually uses the standard EDLMAX
// Rainbow dongle. The complete client security mechanism is
// demomstrated in the dlldemo app, but is inactive. When you license
// MaxDll you will be supplied with a new mxkey.lib containing an
// algorthm for your product and a new MaxDll.lib which will access it.
//================================================================
////////////////////////////////////////////////////////////////////


// once

#pragma once

#ifndef __MAXDLL_H__
#define __MAXDLL_H__


// extern c

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */


// General defines

///////////////////////////////////////////////////////////////
// General defines


#ifndef _WINDEF_
typedef int BOOL;
#endif

//typedef long TIMECODE;

#ifndef FALSE
#define FALSE 0
#endif

#ifndef TRUE
#define TRUE 1
#endif

#define MX_NO_SPEED 2147483686 // 2147483687-1 LONG_MIN



// export defines

#define MAXDLL_EXPORT __declspec (dllexport)


// typedef MaxDll Handle

///////////////////////////////////////////////////////////////
// Handle to the MaxDll
typedef struct mxMaxDllHandle *mxHdl_t;


// enum MXTVSTND

///////////////////////////////////////////////////////////////
// TV Standard

enum
{
STND_PAL = 0,
STND_NTSC = 1
};


// enum MXEFX

///////////////////////////////////////////////////////////////
// Event Type

enum
{
MX_EFXERR = 0,
MX_CUT,
MX_DISSOLVE, // tape to tape, tape to black,
// black to tape if no match found
MX_FORCE_DISSOLVE_FROM_BLACK, // Previous match cut will not be calculated
// Use to cut to black and fade up
MX_FORCE_DISSOLVE_TO_BLACK, // Inverted behavior - the mxEventStructOut data
// is used as the "from" source (first line of dissolve)
// the black "to" event is automatically generated
// Use to cut to a new tape and immediately
// fade to black
MX_WIPE, // as MX_DISSOLVE
MX_FORCE_WIPE_FROM_BLACK, // as MX_FORCE_DISSOLVE_FROM_BLACK
MX_FORCE_WIPE_TO_BLACK, // as MX_FORCE_DISSOLVE_TO_BLACK
MX_KEY // not yet implemented
};


// enum MXEDLFORMAT

///////////////////////////////////////////////////////////////
// EDL Format

enum
{
FRMT_GVG = 0,
FRMT_3400,
FRMT_3400A,
FRMT_3600,
FRMT_9100,
FRMT_910
};


// enum MXTCTYPE

///////////////////////////////////////////////////////////////
// Timecode Type enum

enum
{
TCT_NON = 0,
TCT_DROP,
TCT_PAL,
TCT_NOTSET,
TCT_UNKNOWN,
};


// mxVersion_t

///////////////////////////////////////////////////////////////
// mxVersion_t

typedef struct
{
short int major; // major release
short int minor; // minor release
short int bugrev; // bug rev release
short int stage; // stage: dev, alpha, Beta, Final
short int rev; // revision of non-released code
} mxVersion_t;


// mxEventStructOut

///////////////////////////////////////////////////////////////
// mxEventStructOut
// Fill this struct with your edit data and call mxCreateEvent()
// (probably in a loop)

//struct mxEventStructOut
typedef struct
{
// be sure to call mxInitEventStructOut() to initalize the defaults
// with each usage

// MaxDll supports 1 Video and 4 audio channels
// Set the required channels TRUE or FALSE
BOOL VOut; // default TRUE
BOOL A1Out; // default TRUE
BOOL A2Out; // default TRUE
BOOL A3Out; // default TRUE
BOOL A4Out; // default TRUE

// eventType specifies the type of event. One of:
// as enumerated, above
//MX_EFXERR = 0,
//MX_CUT,
//MX_DISSOLVE, // tape to tape, tape to black,
// // black to tape if no match found
//MX_FORCE_DISSOLVE_FROM_BLACK, // Previous match cut will not be calculated
// // Use to cut to black and fade up
//MX_FORCE_DISSOLVE_TO_BLACK, // Inverted behavior - the mxEventStructOut data
// // is used as the "from" source (first line of dissolve)
// // the black "to" event is automatically generated
// // Use to cut to a new tape and immediately
// // fade to black
//MX_WIPE, // as MX_DISSOLVE
//MX_FORCE_WIPE_FROM_BLACK, // as MX_FORCE_DISSOLVE_FROM_BLACK
//MX_FORCE_WIPE_TO_BLACK, // as MX_FORCE_DISSOLVE_TO_BLACK
//MX_KEY // not yet implemented

int eventType; // default MX_CUT

// transitionDur specifies the length of a transition (dissolve or wipe)
// ignored for other eventTypes
int transitionDur; // default 0

// SMPTEwipecode specifies the SMPTE wipe code
// ignored for other eventTypes
int SMPTEwipecode; // default 0

// sourceReelname specifies the source reelname as it will appear in the EDL
// reelnames are must be:
// 7 characters long for CMX 3400a,3600 and Sony
// 3 character integer < 254 CMX 3400
// 5 characters long for GVG

#ifndef _DEBUG
#define MAX_PATH 260
#endif

char sourceReelname[MAX_PATH]; // default sourceReelname[0] = 0;

// All timecodes positions are represented in frames
// (30 for NTSC, 25 for PAL) as unsigned long integers.
// Convert or (cast) your internal representation as required
// The source_DropFrame and record_DropFrame flags indicate the
// timecode type and are ignored if project is PAL (see mxCreateMaxdll())
// PAL 01:00:00:00 == 90000
// NTSC NON_DROP 01:00:00:00 == 108000
// NTSC DROP 01:00:00;00 == 107892

unsigned long sourceIN; // default 0
BOOL source_DropFrame; // default FALSE

// ---- SPEED ----
// source speed represented in signed long as:
// 1000000 = play
// 500000 = 1/2 speed
// 250000 = 1/4 speed
// 0 = freeze
// -1000000 = play reverse
// -500000 = 1/2 speed reverse
// - 250000 = 1/4 speed reverse
// this allows 1/1,000,000 steps between play and freeze
// and approx X 2147 and X -2146 play speed
//
// If no speed effect is applicable, speed is MX_NO_SPEED
// #define MX_NO_SPEED 2147483686 // 2147483687-1 LONG_MIN
// this is maximum reverse speed (approx X 2,147 reverse)
// and ASSUMED never used; that is, if speed == MX_NO_SPEED,
// no speed event is created - the source runs at play speed
// Do not set speed to 1000000 if the event is normal play
// speed

signed long speed; // default MX_NO_SPEED

// keyBksourceIN specifies the Background source of a KEY
// ignored for other eventTypes
// KEYS are NOT IMPLEMENTED in this Beta Version
char keyBksourceReelname[128]; // default sourceReelname[0] = 0;
unsigned long keyBksourceIN; // default 0
BOOL keyBksource_DropFrame; // default FALSE

// recorder in and out points (timeline position)
// the duration, or length, of the event is determined by these
// length must be greater than zero

unsigned long recordIN; // default 0
unsigned long recordOUT; // default 0

// recorder timecode frame type, must be the same for all events of an EDL!
// this is the "system" frame mode
// ignored if PAL
BOOL record_DropFrame; // default FALSE

} mxEventStructOut;



// mxEventStructIn

///////////////////////////////////////////////////////////////
// mxEventStructIn
// This struct is filled with EDL data with each call
// to mxReadNextEventData() (probably in a loop)

//struct mxEventStructIn
typedef struct
{
// be sure to call mxInitEventStructIn() to initalize the defaults
// with each usage

// original event number, valid only with EDL file input
int eventNumber;

// MaxDll supports 1 Video and 4 audio channels
// Set the required channels TRUE or FALSE
BOOL VOut; // default TRUE
BOOL A1Out; // default TRUE
BOOL A2Out; // default TRUE
BOOL A3Out; // default TRUE
BOOL A4Out; // default TRUE

// eventType specifies the type of event. One of:
// MX_EFXERR
// MX_CUT
// MX_DISSOLVE
// MX_WIPE
// MX_KEY
int eventType; // default MX_CUT

// transitionDur specifies the length of a transition (dissolve or wipe)
// ignored for other eventTypes
int transitionDur; // default 0

// SMPTEwipecode specifies the SMPTE wipe code
// ignored for other eventTypes
int SMPTEwipecode; // default 0

// sourceReelname specifies the source reelname as it will appear in the EDL
// reelnames are must be:
// 7 characters long for CMX 3400a,3600 and Sony
// 3 character integer < 254 CMX 3400
// 5 characters long for GVG

#ifndef _DEBUG
#define MAX_PATH 260
#endif

char sourceReelname[MAX_PATH]; // default sourceReelname[0] = 0;

// All timecodes positions are represented in frames
// (30 for NTSC, 25 for PAL) as unsigned long integers.
// Convert or (cast) your internal representation as required
// The source_DropFrame and record_DropFrame flags indicate the
// timecode type and are ignored if project is PAL (see mxCreateMaxdll())
// PAL 01:00:00:00 == 90000
// NTSC NON_DROP 01:00:00:00 == 108000
// NTSC DROP 01:00:00;00 == 107892

unsigned long sourceIN; // default 0
BOOL source_DropFrame; // default FALSE ignor if PAL

// ---- SPEED ----
// source speed represented in signed long as:
// 1000000 = play
// 500000 = 1/2 speed
// 250000 = 1/4 speed
// 0 = freeze
// -1000000 = play reverse
// -500000 = 1/2 speed reverse
// - 250000 = 1/4 speed reverse
// this allows 1/1,000,000 steps between play and freeze
// and approx X 2147 and X -2146 play speed
//
// If no speed effect is applicable, speed is MX_NO_SPEED
// #define MX_NO_SPEED 2147483686 // 2147483687-1 LONG_MIN
// this is maximum reverse speed (approx X 2,147 reverse)
// and ASSUMED never used; that is, if speed == MX_NO_SPEED,
// no speed event is created - the source runs at play speed
// Do not set speed to 1000000 if the event is normal play
// speed

signed long speed; // default MX_NO_SPEED

unsigned long recordIN; // default 0
unsigned long recordOUT; // default 0
BOOL record_DropFrame; // default FALSE, ignor if PAL


// ======== previous event information =========
char prevSourceReelname[MAX_PATH]; // default sourceReelname[0] = 0;
unsigned long prevSourceIN; // default 0
BOOL prevSource_DropFrame; // default FALSE ignor if PAL
signed long prevSpeed; // default MX_NO_SPEED

// This is the information in the 1st line of a two line
// EDL event
// Only valid if event type is MX_DISSOLVE or MX_WIPE
// KEYS are NOT IMPLEMENTED in this Beta Version

// ========= "tallied" flag ================
BOOL tallied;

// if tallied == TRUE a previous event exists in the list which is a
// match cut to the current MX_DISSOLVE or MX_WIPE event
// ReadNextEvent will have already given this event to you
// if tallied == FALSE you may need to use the data in
// prevSourceReelname, prevSourceIN, prevSource_DropFrame and prevSpeed
// to construct an event because it probably is the (somewhat rare) case
// where a transition does not have a previous match cut.

} mxEventStructIn;



// mxProcStruct

///////////////////////////////////////////////////////////////
// mxProcStruct
// Fill this struct with processing instructions
// and call mxCompleteList()

//struct mxProcStruct
typedef struct
{
// be sure to call mxInitEventStruct() to initalize the defaults
// with each usage

// EDLFormat selects the format the report generator will output:
// FRMT_GVG
// FRMT_3400
// FRMT_3400A
// FRMT_3600
// FRMT_9100
// FRMT_910
int EDLFormat; // default FRMT_3600

// The MaxDll EDL database is normally created with all
// available channels (see mxEventStruct).
// Select the the channels the report generator should output
int VOut; // default TRUE
int A1Out; // default TRUE
int A2Out; // default TRUE
int A3Out; // default TRUE
int A4Out; // default TRUE


// creates split events where possible
BOOL ProcessMakeSplits;

// arrange the list with a maximum number of "both (V+A)" events
BOOL ProcessMakeMaxAV;

// ApplyRecordStart commands MAXDLL to apply the specified
// RecordStart TC value to the recorder (dest timeline)
// NLE suppliers using a 0-based start on the timeline
// should apply a record start because EDLs should not have
// a 00:00:00:00 start time. Recommend a 01:00:00:00 start.
// PAL 01:00:00:00 == 90000
// NTSC NON_DROP 01:00:00:00 == 108000
// NTSC DROP 01:00:00:00 == 107892
BOOL ApplyRecordStart; // default FALSE (off)
long RecordStart; // default 0
BOOL RecordStart_DropFrame; // default FALSE

// Version 1.00.0x12 - May 18, 1999 - added:
// ApplySummary calculates EDL list summary and appends the results
// as notes at the bottom of the EDL
BOOL ApplySummary; // default FALSE;

} mxProcStruct;


// MaxDllQuery

//////////////////////////////////////////////
// MaxDllQuery - security poling of mxkey.lib
//
// The mxkey.lib library contains a single function (MaxDllQuery)
// which is routed through your app to the MaxDll as a callback.
// mxkey.lib must be linked to your app or the module calling the
// MaxDll. The name of this function (MaxDllQuery) is handed into
// mxCreateMaxdll() as a callback. MaxDll now uses this callback to
// verify it is running under you.
//
// Note this is not an export function! Rather, it is the prototype
// for the MaxDllQuery() function in mxkey.lib

unsigned short int MaxDllQuery( void * packet,
unsigned char * queryData,
unsigned short int* response,
unsigned short int length
);



// EXPORTED FUNCTIONS

// mxCreateMaxdll()

///////////////////////////////////////////////////////////////
// mxCreateMaxdll()
// Create the MaxDll and set the mxHdl_t to it
//
// call:
// CDlldemoDoc::OnNewDocument() of dlldemo for example
//
// params:
// hMxHdl - address of handle (&hMxHdl)
// mxErrStruct - pointer to mxErrorStruct struct - see maxerr.h
//
// Function pointers to client callback handlers
// Allows the calling app to handle errors, messages and user
// interactions initiated by MaxDll.
// See DllDemo MainFrame.cpp for callback examples
// errHandler
// statusHandler
// msgHandler
// confirmHandler
// progressHandler
// displayHandler
// Display Note:
// The EdlDisplayHandler callback fills the window with text
// see EdlDisplayHandler() in MainFrame.cpp. This is called back by
// MaxDll when initiated by you with a call to mxDisplayList()
// See CDlldemoView::OnUpdate()
// security handler
// Security Note:
// The mxkey.lib library contains a single function (MaxDllQuery)
// which is routed through your app to the MaxDll as a callback.
// mxkey.lib must be linked to your app or the module calling the
// MaxDll. The name of this function (MaxDllQuery) is handed into
// mxCreateMaxdll() as a callback. MaxDll now uses this callback to
// verify it is running under you.
//
// returns:
// MXERR_HANDLENOTNULL - *hMxHdl is not NULL (it must be)
// MXERR_NOMEM - new CMaxdll object failed
// MXERR_BADLISTINIT - hope you never see this
// MXERR_SECURITY - can't find dongle or security handler callback
// MXERR_NONE - happy
////////////////////////////////////////////////////////////////

MAXDLL_EXPORT MAXERR mxCreateMaxdll(mxHdl_t* hMxHdl,
mxErrHdl_t mxErrStruct,
void (*errHandler)(void*),
void (*statusHandler)(void*),
void (*msgHandler)(void*),
int (*confirmHandler)(void*, void*),
int (*progressHandler)(void*, void*, void*, void*, void*),
void (*edlDisplayHandler)(void*),
unsigned short int (*security)(void*, void*, void*, void*)
);



// mxDeleteMaxdll()

///////////////////////////////////////////////////////////////
// mxDeleteMaxdll()
// delete the MaxDll object and set the handle NULL
//
// call:
// if(mxDeleteMaxdll(&hMaxDll) != MXERR_NONE)...
// TRACE0("Error: MaxDll delete failed.\n");
//
// params:
// hMxHdl - address of handle (&hMxHdl)
//
// returns:
// MXERR_NULLPOINTER - NULL handle param
// MXERR_NONE - deleted
///////////////////////////////////////////////////////////////

MAXDLL_EXPORT MAXERR mxDeleteMaxdll(mxHdl_t* hMxHdl);


// mxInitEventStructIn

///////////////////////////////////////////////////////////////
// mxInitEventStruct
// Set the mxEventStruct members to defaults. see mxEventStruct.
//
// call:
// mxEventStruct mxEvent; // event struct to stuff
// errret = mxInitEventStruct(hMaxDll, &mxEvent);
//
// params:
// hMxHdl - Ignored, retained for consistency
// mxEvent - The mxEventStruct
//
// returns:
// MXERR_NULLPOINTER - mxEvent is NULL
// MXERR_NONE - OK

MAXDLL_EXPORT MAXERR mxInitEventStructIn(mxHdl_t hMxHdl, mxEventStructIn* mxEventIn);


// mxInitEventStructOut

///////////////////////////////////////////////////////////////
// mxInitEventStruct
// Set the mxEventStruct members to defaults. see mxEventStruct.
//
// call:
// mxEventStruct mxEvent; // event struct to stuff
// errret = mxInitEventStruct(hMaxDll, &mxEvent);
//
// params:
// hMxHdl - Ignored, retained for consistency
// mxEvent - The mxEventStruct
//
// returns:
// MXERR_NULLPOINTER - mxEvent is NULL
// MXERR_NONE - OK

MAXDLL_EXPORT MAXERR mxInitEventStructOut(mxHdl_t hMxHdl, mxEventStructOut* mxEventOut);


// mxSetTVStnd()

///////////////////////////////////////////////////////////////
// mxSetTVStnd
// Set the TV Standard (PAL or NTSC) of the current database
//
// call:
// errret = mxInitEventStruct(hMaxDll, &mxEvent);
//
// params:
// hMxHdl - address of handle (&hMxHdl)
// mxTVStnd - one of STND_PAL (0) or STND_NTSC (1)
//
// returns:
// MXERR_INVALIDVALUE - input param not STND_PAL (0) or STND_NTSC (1)
// MXERR_NONE - OK
//
// comments
// defaults to NTSC if not set

MAXDLL_EXPORT MAXERR mxSetTVStnd(mxHdl_t hMxHdl, int mxTVStnd);


// mxGetTVStnd()

MAXDLL_EXPORT MAXERR mxGetTVStnd(mxHdl_t hMxHdl, int* mxTVStnd);


// mxAddEdlTitle()

MAXDLL_EXPORT MAXERR mxAddEdlTitle(mxHdl_t hMxHdl, char* title);



// mxCreateEvent()

///////////////////////////////////////////////////////////////
// mxCreateEvent()
// Creates an EDL event based on info in mxEventStructOut
// see mxEventStructOut for detail
//
// call:
// mxEventStructOut mxEventOut; // must exist
// MAXERR errret = mxCreateEvent(hMxHdl, &mxEvent);
//
// params:
// hMxHdl - MaxDll handle
// mxEvent - Address of an mxEventStruct
//
// returns:
// MXERR_NULLPOINTER - mxEvent NULL
// MXERR_NOMEM - new failed
// MXERR_NONE - happy
////////////////////////////////////////////////////////////////

MAXDLL_EXPORT MAXERR mxCreateEvent(mxHdl_t hMxHdl, mxEventStructOut* mxEventOut);


// mxAddNote()

///////////////////////////////////////////////////////////////
// mxAddNote()
// Add a note to the last created event
// must be called directly after mxCreateEvent()
//
// call:
// if(mxAddNote(hMxHdl, "Some Note") != MXERR_NONE)...
//
// params:
// hMxHdl - MaxDll handle
// theNote - char string - 79 Chars MAX - automatically truncated
// Its a good idea to keep notes short -
// SONY notes will be truncated to 60 characters on output
//
// returns:
// MXERR_TRUNCATED - theNote was too long, and truncated to 79 chars
// MXERR_ZEROLEN - theNote is zero length
// MXERR_NULLEVENT - No event to attach it to, for some reason
// MXERR_NOMEM - Allocation for the note failed
// MXERR_NONE - OK
////////////////////////////////////////////////////////////////

MAXDLL_EXPORT MAXERR mxAddNote(mxHdl_t hMxHdl, char* theNote);



// mxInitProcStruct()

///////////////////////////////////////////////////////////////
// mxInitProcStruct
// Set the mxProcStruct members to defaults. see mxProcStruct.
//
// call:
// mxProcStruct mxProc; // process struct to stuff
// errret = mxInitProcStruct(hMaxDll, &mxEvent);
//
// params:
// hMxHdl - Ignored, retained for consistency
// mxProc - The mxEventStruct
//
// returns:
// MXERR_NULLPOINTER - mxProc is NULL
// MXERR_NONE - OK

MAXDLL_EXPORT MAXERR mxInitProcStruct(mxHdl_t hMxHdl, mxProcStruct* mxProc);


// mxCompleteList()

///////////////////////////////////////////////////////////////
// mxCompleteList()
// Finalizes the EDL database, cleans, and applies selected processing
// see mxProcStruct for detail
//
// call:
// mxProcStruct mxProc; // must exist
// MAXERR errret = mxCompleteList(hMxHdl, &mxProc);
//
// params:
// hMxHdl - MaxDll handle
// mxEvent - Address of an mxProcStruct
//
// returns:
// MXERR_NULLPOINTER - mxProc NULL
// MXERR_NOMEM - new failed
// MXERR_NONE - happy
////////////////////////////////////////////////////////////////

MAXDLL_EXPORT MAXERR mxCompleteList(mxHdl_t hMxHdl, mxProcStruct* procStruct);


// mxSaveList()

///////////////////////////////////////////////////////////////
// mxSaveList()
// Saves the EDL to disk. Checks for file exists.
//
// MaxDll uses special disk output routines. It automatically
// recognizes the disk type (DOS or RT-11), saves
// SONY in the JIS format and guarantees EDL format.
// This happens at low-level.
//
// See DllDemo // CMainFrame::OnDebugMaxdlldemo() for an example using
// mxSaveList()
//
// call:
// char savepath[_MAX_PATH];
// strcpy(savepath,"c:\\omfmax\\dlltest.edl");
// MAXERR diskret = mxSaveList(hMaxDll, savepath);
//
// params:
// hMxHdl - MaxDll handle
// pszPathName - char string containing full path
// The filename itself (xxxxxx.EDL) MUST be:
// 8 chars for DOS (including SONY)
// 6 chars to RT-11
// and MUST have ".EDL" extension
//
// returns:
// MXERR_FILEEXISTS - pszPathName found on disk
// MXERR_FORMATNOTMATCHDISK - EDL format does not match disk type
// MXERR_CANNOTOPENFILE - File did not open
// MXERR_CANNOTCREATEFILE - Cannot create file
// MXERR_NULLPOINTER - pszPathName NULL
// MXERR_DEMO - No Dongle - DEMO MODE - Max 10 events saved
// MXERR_NONE - EDL File saved

// Version 1.00.0x12 - May 18, 1999
// Added "unconditional" parameter -
// TRUE - unconditional file save - overwrites the file if it exists
// - YOU MUST CHECK FILE EXISTS!!
// FALSE - returns MXERR_FILEEXISTS if file exists
//
// the prototype id changed from:
//MAXDLL_EXPORT MAXERR mxSaveList( mxHdl_t hMxHdl, const char* pszPathName);
////////////////////////////////////////////////////////////////

MAXDLL_EXPORT MAXERR mxSaveList( mxHdl_t hMxHdl,
const char* pszPathName,
BOOL unconditional);



// mxLoadList()

///////////////////////////////////////////////////////////////
// mxLoadList()
// Loads an EDL.
//
// MaxDll uses special disk output routines. It automatically
// recognizes the disk type (DOS or RT-11), saves
// SONY in the JIS format and guarantees EDL format.
// This happens at low-level.
//
// See DllDemo // CMainFrame::OnDebugMaxdlldemo() for an example using
// mxSaveList()
//
// call:
// char savepath[_MAX_PATH];
// strcpy(savepath,"c:\\omfmax\\dlltest.edl");
// MAXERR diskret = mxSaveList(hMaxDll, savepath);
//
// params:
// hMxHdl - MaxDll handle
// pszPathName - char string containing full path
// The filename itself (xxxxxx.EDL) MUST be:
// 8 chars for DOS (including SONY)
// 6 chars to RT-11
// and MUST have ".EDL" extension
//
// returns:
// MXERR_FILEEXISTS - pszPathName found on disk
// MXERR_FORMATNOTMATCHDISK - EDL format does not match disk type
// MXERR_CANNOTOPENFILE - File did not open
// MXERR_CANNOTCREATEFILE - Cannot create file
// MXERR_NULLPOINTER - pszPathName NULL
// MXERR_DEMO - No Dongle - DEMO MODE - Max 10 events saved
// MXERR_NONE - EDL File saved
//////////////////////////////////////////////////////////////////

MAXDLL_EXPORT MAXERR mxLoadList(mxHdl_t hMxHdl, const char* pszPathName);


// mxPrepListForRead()

MAXDLL_EXPORT MAXERR mxPrepListForRead(mxHdl_t hMxHdl);


// mxReadEdlTitle()

MAXDLL_EXPORT MAXERR mxReadEdlTitle(mxHdl_t hMxHdl, char* titlebuf);


// mxReadNextEventData()

MAXDLL_EXPORT MAXERR mxReadNextEventData(mxHdl_t hMxHdl, mxEventStructIn* mxEventIn);


// mxClearList()

MAXDLL_EXPORT MAXERR mxClearList(mxHdl_t hMxHdl);


// mxDisplayList()

MAXDLL_EXPORT MAXERR mxDisplayList(mxHdl_t hMxHdl, int* totallines);


// mxQueryListEmpty()

MAXDLL_EXPORT MAXERR mxQueryListEmpty(mxHdl_t hMxHdl);


// mxGetVersion()

MAXDLL_EXPORT MAXERR mxGetVersion(mxHdl_t hMxHdl, mxVersion_t* mxVersion);



// --- ERROR ---


// mxGetLastError()

///////////////////////////////////////////////////////////////
// mxGetLastErr()
// Gets extended info about the last error generated by calls into MaxDll.
//
// mxGetLastErr() is a second optional mechanism in addition to using
// client supplied error and message callbacks. See mxCreateMaxdll() and
// DllDemo for callback examples.
//
// See DllDemo CMainFrame::OnDebugMaxdlldemo() for examples
//
// Usage:
// The messaging mechamism relies on the mxErrorStruct.
// Errors and messages originated by MaxDll stuff this struct
// mxGetLastErr() can then recover the extended message.
//
// You must create a mxErrorStruct somewhere, and a global
// pointer to it. This pointer is handed in to mxCreateMaxdll()
// to inform MaxDll of the mxErrorStruct address:
//
// // create an mxErrorStruct as an automatic
// struct mxErrorStruct mxErrStruct;
// // set the gMaxErrHdl pointer to it
// gMaxErrHdl = (mxErrHdl_t) &mxErrStruct;
// call mxCreateMaxdll() to inform MaxDll of the mxErrorStruct address
// // create a string
// char clientErrString[128];
//
// call:
// mxGetLastErr(gMaxDllHdl, clientErrString);
//
// params:
// hMxHdl - MaxDll handle
// clientErrString - client supplied buffer
//
// returns:
// MXERR_FILEEXISTS - pszPathName found on disk
// MXERR_FORMATNOTMATCHDISK - EDL format does not match disk type
// MXERR_CANNOTOPENFILE - File did not open
// MXERR_CANNOTCREATEFILE - Cannot create file
// MXERR_NULLPOINTER - pszPathName NULL
// XERR_DEMO - No Dongle - DEMO MODE - Max 10 events saved
// MXERR_NONE - EDL File saved
////////////////////////////////////////////////////////////////

MAXDLL_EXPORT MAXERR mxGetLastErr(mxHdl_t hMxHdl,
char* clientErrString);


// --- utilities ---

// mxIntToString()

MAXDLL_EXPORT MAXERR mxIntToString(mxHdl_t hMxHdl,
char* targetStr,
int integer,
int digits);


// mxTCToString()

MAXDLL_EXPORT MAXERR mxTcToString(mxHdl_t hMxHdl,
char* targetStr,
unsigned long frames,
int TCType,
int EdlFormat);


// mxStringToTc()

MAXDLL_EXPORT MAXERR mxStringToTc(mxHdl_t hMxHdl,
char* TCString,
unsigned long* Frames,
int* TCType);


// extern c

#ifdef __cplusplus
}
#endif



// end once

#endif // #ifndef __MAXERR_H__


// end

#pragma message("end maxdll.h")