DLS::Resource Class Reference

Abstract base class which encapsulates data structures which all DLS resources are able to provide. More...

`#include <DLS.h>`

Inheritance diagram for DLS::Resource:

## Public Member Functions

Resource * | GetParent ()
const Resource * | GetParent () const
virtual void | UpdateChunks (progress_t *pProgress)
| Update chunks with current Resource data.
virtual void | DeleteChunks ()
| Remove all RIFF chunks associated with this Resource object.
void | GenerateDLSID ()
| Generates a new DLSID for the resource.
virtual void | CopyAssign (const Resource *orig)
| Make a deep copy of the Resource object given by orig and assign it to this object.

## Static Public Member Functions

static void | GenerateDLSID (dlsid_t *pDLSID)

## Public Attributes

Info * | pInfo
| Points (in any case) to an Info object, providing additional, optional infos and comments.
dlsid_t * | pDLSID
| Points to a dlsid_t structure if the file provided a DLS ID else is NULL.

## Protected Member Functions

| Resource (Resource *Parent, RIFF::List *lstResource)
| Constructor.

## Protected Attributes

Resource * | pParent
RIFF::List * | pResourceList

## Detailed Description

Abstract base class which encapsulates data structures which all DLS resources are able to provide.

Definition at line 404 of file DLS.h.

## Constructor & Destructor Documentation

## Resource()

Resource::Resource | ( | Resource * | Parent,
|  | RIFF::List * | lstResource )

protected

Constructor.

Initializes the 'Resource' object with values provided by a given INFO list chunk and a DLID chunk (the latter optional).

Parameters

  Parent | - pointer to parent 'Resource', NULL if this is the toplevel 'Resource' object
  lstResource | - pointer to an INFO list chunk

Definition at line 539 of file DLS.cpp.

References RIFF::List::GetSubChunk(), pDLSID, pInfo, RIFF::Chunk::Read(), Resource(), and RIFF::Chunk::SetPos().

Referenced by CopyAssign(), DLS::File::File(), DLS::File::File(), DLS::Instrument::Instrument(), Resource(), and DLS::Sample::Sample().

## ~Resource()

Resource::~Resource | ( |  | ) |

protected virtual

Definition at line 558 of file DLS.cpp.

## Member Function Documentation

## CopyAssign()

void Resource::CopyAssign | ( | const Resource * | orig | ) |

virtual

Make a deep copy of the Resource object given by orig and assign it to this object.

Parameters

  orig | - original Resource object to be copied from

Definition at line 654 of file DLS.cpp.

References pInfo, and Resource().

Referenced by DLS::Region::CopyAssign(), and DLS::Sample::CopyAssignCore().

## DeleteChunks()

void Resource::DeleteChunks | ( |  | ) |

virtual

Remove all RIFF chunks associated with this Resource object.

At the moment Resource::DeleteChunks() does nothing. It is recommended to call this method explicitly though from deriving classes's own overridden implementation of this method to avoid potential future compatibility issues.

See Storage::DeleteChunks() for details.

Implements DLS::Storage.

Reimplemented in DLS::Instrument, DLS::Region, and DLS::Sample.

Definition at line 572 of file DLS.cpp.

Referenced by DLS::Instrument::DeleteChunks(), DLS::Region::DeleteChunks(), and DLS::Sample::DeleteChunks().

## GenerateDLSID() [1/2]

void Resource::GenerateDLSID | ( |  | ) |

Generates a new DLSID for the resource.

Definition at line 604 of file DLS.cpp.

References GenerateDLSID(), and pDLSID.

Referenced by gig::File::AddInstrument(), GenerateDLSID(), gig::Script::GenerateUuid(), and DLS::File::UpdateChunks().

## GenerateDLSID() [2/2]

void Resource::GenerateDLSID | ( | dlsid_t * | pDLSID | ) |

static

Definition at line 611 of file DLS.cpp.

## GetParent() [1/2]

Resource * DLS::Resource::GetParent | ( |  | ) |

inline

Definition at line 409 of file DLS.h.

## GetParent() [2/2]

const Resource * DLS::Resource::GetParent | ( |  | ) | const

inline

Definition at line 410 of file DLS.h.

## UpdateChunks()

void Resource::UpdateChunks | ( | progress_t * | pProgress | ) |

virtual

Update chunks with current Resource data.

Apply Resource data persistently below the previously given resource list chunk. This will currently only include the INFO data. The DLSID will not be applied at the moment (yet).

You have to call File::Save() to make changes persistent.

Parameters

  pProgress | - callback function for progress notification

Implements DLS::Storage.

Reimplemented in DLS::File, DLS::Instrument, DLS::Region, DLS::Sample, gig::File, gig::Instrument, gig::Region, and gig::Sample.

Definition at line 585 of file DLS.cpp.

References pInfo.

Referenced by DLS::File::UpdateChunks(), DLS::Instrument::UpdateChunks(), and DLS::Sample::UpdateChunks().

## Member Data Documentation

## pDLSID

dlsid_t* DLS::Resource::pDLSID

Points to a dlsid_t structure if the file provided a DLS ID else is NULL.

Definition at line 407 of file DLS.h.

Referenced by GenerateDLSID(), and Resource().

## pInfo

Info* DLS::Resource::pInfo

Points (in any case) to an Info object, providing additional, optional infos and comments.

Definition at line 406 of file DLS.h.

Referenced by CopyAssign(), Resource(), gig::Sample::Sample(), and UpdateChunks().

## pParent

Resource* DLS::Resource::pParent

protected

Definition at line 417 of file DLS.h.

## pResourceList

RIFF::List* DLS::Resource::pResourceList

protected

Definition at line 418 of file DLS.h.

The documentation for this class was generated from the following files:

- DLS.h
- DLS.cpp