AeFxSxnAsset.c++ 3.59 KB
//
// AeFxSxnAsset.c++
//


#include <assert.h>
#include <stdio.h>
#include <Vk/VkApp.h>

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


Pixmap AeFxSxnAsset::fIcon = NULL;


AeFxSxnAsset::AeFxSxnAsset (const char * name) : AeAsset (name, kFxSxnType)
{
    fInput = 0;
    fOutput = 0;
    fFBCoef = 0;
    fFFCoef = 0;
    fGain = 0;
    fChorusRate = 0;
    fChorusDepth = 0;
    fFilterCoef = 0;

    if (!fIcon)
    {
	fIcon = XCreateBitmapFromData (theApplication->display (),
				       DefaultRootWindow (theApplication->display ()),
				       (char *)fxSxnIcon_bits,
				       fxSxnIcon_width,
				       fxSxnIcon_height);
    }
}


AeFxSxnAsset::~AeFxSxnAsset (void)
{

}


void
AeFxSxnAsset::GetClassName (char * name)
{
    strcpy (name, "section");
}


int
AeFxSxnAsset::GetSxnID (void)
{
    GList<AeAsset *> *	parentList;
    GList<AeAsset *> *	childList;
    AeAsset *		parent;
    int			i;

    assert (fParentList);

    if (fParentList->GetNum () == 0)
	return -1;

    assert (fParentList->GetNum () == 1);

    parent = (*fParentList)[0];
    
    assert (parent->CanContain ());

    childList = ((AeContainerAsset *)parent)->GetChildList ();

    assert (childList);

    childList->Find (this, i);

    return i;
}


int
AeFxSxnAsset::GetMaxDelay (void)
{
    GList<AeAsset *> *	parentList;
    GList<AeAsset *> *	childList;
    AeFxAsset *		parent;

    assert (fParentList);

    if (fParentList->GetNum () == 0)
	return AeFxAsset::kDelayMax;

    assert (fParentList->GetNum () == 1);

    parent = (AeFxAsset *)(*fParentList)[0];

    return parent->GetLength ();
}


void
AeFxSxnAsset::SetInputProc (AeAsset * asset, int s)
{
    assert (asset);
    ((AeFxSxnAsset *)asset)->SetInput (s);
}

void
AeFxSxnAsset::SetOutputProc (AeAsset * asset, int s)
{
    assert (asset);
    ((AeFxSxnAsset *)asset)->SetOutput (s);
}

void
AeFxSxnAsset::SetFBCoefProc (AeAsset * asset, int s)
{
    assert (asset);
    ((AeFxSxnAsset *)asset)->SetFBCoef (s);
}

void
AeFxSxnAsset::SetFFCoefProc (AeAsset * asset, int s)
{
    assert (asset);
    ((AeFxSxnAsset *)asset)->SetFFCoef (s);
}

void
AeFxSxnAsset::SetGainProc (AeAsset * asset, int s)
{
    assert (asset);
    ((AeFxSxnAsset *)asset)->SetGain (s);
}

void
AeFxSxnAsset::SetChorusRateProc (AeAsset * asset, int s)
{
    assert (asset);
    ((AeFxSxnAsset *)asset)->SetChorusRate (s);
}

void
AeFxSxnAsset::SetChorusDepthProc (AeAsset * asset, int s)
{
    assert (asset);
    ((AeFxSxnAsset *)asset)->SetChorusDepth (s);
}

void
AeFxSxnAsset::SetFilterCoefProc (AeAsset * asset, int s)
{
    assert (asset);
    ((AeFxSxnAsset *)asset)->SetFilterCoef (s);
}


int
AeFxSxnAsset::GetInputProc (AeAsset * asset)
{
    assert (asset);
    return ((AeFxSxnAsset *)asset)->GetInput ();
}

int
AeFxSxnAsset::GetOutputProc (AeAsset * asset)
{
    assert (asset);
    return ((AeFxSxnAsset *)asset)->GetOutput ();
}

int
AeFxSxnAsset::GetFBCoefProc (AeAsset * asset)
{
    assert (asset);
    return ((AeFxSxnAsset *)asset)->GetFBCoef ();
}

int
AeFxSxnAsset::GetFFCoefProc (AeAsset * asset)
{
    assert (asset);
    return ((AeFxSxnAsset *)asset)->GetFFCoef ();
}

int
AeFxSxnAsset::GetGainProc (AeAsset * asset)
{
    assert (asset);
    return ((AeFxSxnAsset *)asset)->GetGain ();
}

int
AeFxSxnAsset::GetChorusRateProc (AeAsset * asset)
{
    assert (asset);
    return ((AeFxSxnAsset *)asset)->GetChorusRate ();
}

int
AeFxSxnAsset::GetChorusDepthProc (AeAsset * asset)
{
    assert (asset);
    return ((AeFxSxnAsset *)asset)->GetChorusDepth ();
}

int
AeFxSxnAsset::GetFilterCoefProc (AeAsset * asset)
{
    assert (asset);
    return ((AeFxSxnAsset *)asset)->GetFilterCoef ();
}