AeFxAsset.c++ 1.79 KB
/*****************************************************************************
 *  File:  AeFxAsset.c++ 
 *
 *  AeFxAsset Class Implementations
 *
 ****************************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <Vk/VkApp.h>

#include "AeAsset.h"
#include "GList.h"
#include "fxIcon.xbm"


const int AeFxAsset::kDelayMin = 0;
const int AeFxAsset::kDelayMax = 60000;
const int AeFxAsset::kDelayDef = 0;

#define kLengthDef 	50



Pixmap AeFxAsset::fIcon = NULL;


AeFxAsset::AeFxAsset (const char * name) : AeContainerAsset (name, kFxType)
{
    if (!fIcon)
    {
	fIcon = XCreateBitmapFromData (theApplication->display (),
				       DefaultRootWindow (theApplication->display ()),
				       (char *)fxIcon_bits,
				       fxIcon_width,
				       fxIcon_height);
    }

    fLength = kLengthDef;		// default to non-zero length filter
    fFxType = kFxCustomType;
}


AeFxAsset::~AeFxAsset (void)
{

}


void
AeFxAsset::GetClassName (char * name)
{
    strcpy (name, "effect");
}


void
AeFxAsset::AppendChild (AeAsset * child)
{
    TString63	name;
    int		id;

    AeContainerAsset::AppendChild (child);

    fChildList->Find (child, id);

    sprintf (name, "%.60s%d", fName, id+1);
    child->SetName (name);
}


void
AeFxAsset::SetLengthProc (AeAsset * asset, int length)
{
    assert (asset);
    ((AeFxAsset *)asset)->SetLength (length);
}

int
AeFxAsset::GetLengthProc (AeAsset * asset)
{
    assert (asset);
    return ((AeFxAsset *)asset)->GetLength ();
}


#if NOT_SUPPORTED
void
AeFxAsset::SetFxTypeProc (AeAsset * asset, TAssetType type)
{
    assert (asset);
    ((AeFxAsset *)asset)->SetFxType (type);
}


int
AeFxAsset::GetFxTypeProc (AeAsset * asset)
{
    assert (asset);
    return ((AeFxAsset *)asset)->GetFxType ();
}
#endif