Class: TAudioIFFSequence

Declaration: AudioSequence.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

TAudioSequence

Inherited By:

None.

Purpose:

A derived class of TAudioFile that represents an Audio Interchange File Format (AIFF) sound file.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

Not intended to be derived.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Member Function: TAudioIFFSequence::TAudioIFFSequence

  1. TAudioIFFSequence ()
  2. TAudioIFFSequence (const TFileSystemEntity & theFileName, MOpenFile::EPermissionsForMe forMe =MOpenFile::kRead, MOpenFile::EPermissionsForOthers forOthers =MOpenFile::kAllowRead)
  3. TAudioIFFSequence (const TFileSystemEntity & theFileName, const TAudioType& audioType, long numberOfChannels, MOpenFile::EPermissionsForOthers forOthers =MOpenFile::kAllowRead)
  4. TAudioIFFSequence (const TAudioIFFSequence &)

Interface Category:

API.

Purpose:

  1. Default constructor. Unitinitialized sequence.
  2. Opens an existing sound file.
  3. Creates a new sound file.
  4. Copy constructor.

Calling Context:

  1. Call directly to create an undefined object that will immediately be assigned to or streamed into.
  2. Call directly to open an existing sound file.
  3. Call directly to create a new sound file.
  4. Call directly to copy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws TTimeMediaException::kNoSequence if the data file does not exist or cannot be created. Throws TTimeMediaException::kInvalidType if the type of data in the audio file is unsupported.

Concurrency:

Not multithread safe.

Other Considerations:

Note: The file system entity parameter used in constructing objects of this class contains an absolute pathname. When streamed, objects will continue to reference a file on the machine of origin.

Member Function: TAudioIFFSequence::~TAudioIFFSequence

virtual ~ TAudioIFFSequence ()

Interface Category:

API.

Purpose:

Destructor.

Calling Context:

Called by Runtime to destroy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TAudioIFFSequence::operator=

TAudioIFFSequence & operator =(const TAudioIFFSequence &)

Interface Category:

API.

Purpose:

Assignment operator.

Calling Context:

Call directly when an object is assigned to another compatible object.

Parameters:

Return Value:

A non-const reference to the left-hand side object.

Exceptions:

Throws TTimeMediaException::kNoSequence if the data file does not exist.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TAudioIFFSequence::IsReadOnly

virtual bool IsReadOnly () const

Interface Category:

API.

Purpose:

Returns true if the sequence cannot be written.

Calling Context:

Call directly to see if the sequence cannot be written.

Parameters:

Return Value:

Returns true if the sequence cannot be written, otherwise returns false.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TAudioIFFSequence::SeekToSample

virtual void SeekToSample (TSamples :: Position position)

Interface Category:

API.

Purpose:

Seeks to a specific sample position in the sequence.

Calling Context:

Call directly to seek to a specific sample.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TAudioIFFSequence::GetPositionInSamples

virtual TSamples :: Position GetPositionInSamples () const

Interface Category:

API.

Purpose:

Returns the current position in the file.

Calling Context:

Call directly to get the position in samples.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TAudioIFFSequence::Read

virtual TSamples::Position Read (TMemorySurrogate & fillThis, TSamples::Position numberOfSamplesToRead)

Interface Category:

API.

Purpose:

Reads a block of memory from the sequence starting at the current Seek position. The Seek position is moved to the end of the block actually read.

Calling Context:

Call directly when reading data.

Parameters:

Return Value:

TSamples::Position -The number of samples actually read.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TAudioIFFSequence::Write

virtual TSamples::Position Write (const TMemorySurrogate & dataToWrite, TSamples::Position numberOfSamplesToWrite)

Interface Category:

API.

Purpose:

Writes a block of memory into the sequence starting at the current Seek position. The Seek position is moved to the end of the block actually written. The Duration of the sequence is updated if changed by Write.

Calling Context:

Call directly when writing data.

Parameters:

Return Value:

TSamples::Position -The number of samples actually written.

Exceptions:

Throws TTimeMediaException::kReadOnlySequence if the data file does not have the appropriate access permissions.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TAudioIFFSequence::CreateSubrange

virtual TMediaSequence * CreateSubrange (const TMediaRange & range) const

Interface Category:

API.

Purpose:

Creates a new audio sequence that is a subset of the audio sequence. The range specifies the start time and duration of the subset.

Calling Context:

Call directly to create a subset of an audio sequence. Unlike DeepCopy, CreateSubrange does not copy any actual data, just references to the data. This is an inexpensive operation.

Parameters:

Return Value:

TMediaSequence* -A new audio sequence that is a subset of the original.

Exceptions:

Throws TTimeMediaException::kInvalidSubrange if the duration of the subrange exceeds the current duration of the sequence.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TAudioIFFSequence::GetDurationInSamples

virtual TSamples :: Position GetDurationInSamples () const

Interface Category:

API.

Purpose:

Returns the total number of samples in the audio sequence.

Calling Context:

Call directly to determine how long the sequence is.

Parameters:

Return Value:

virtual TSamples :: Position -The number of samples.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TAudioIFFSequence::operator<<=

virtual TStream & operator <<= (TStream & fromWhere)

Interface Category:

API.

Purpose:

Stream-in operator.

Calling Context:

Call directly to stream in data.

Parameters:

Return Value:

Returns a reference to the stream the object streams itself in from.

Exceptions:

Throws TInvalidVersionError if the versions don't match. Throws TTimeMediaException::kNoSequence if the data file does not exist or cannot be created. Throws TTimeMediaException::kInvalidSubrange if the duration of the subrange exceeds the current duration of the sequence.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TAudioIFFSequence::operator>>=

virtual TStream & operator >>=(TStream & toWhere) const

Interface Category:

API.

Purpose:

Stream-out operator.

Calling Context:

Call directly to stream out data.

Parameters:

Return Value:

Returns a reference to the stream the object streams itself out to.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TAudioIFFSequence::Hash

virtual long Hash () const

Interface Category:

API.

Purpose:

Generates a hash value.

Calling Context:

Call directly to generate a hash value.

Parameters:

Return Value:

The hash value.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.