Taxonomy Categories:
Member Functions:
Interface Category:
API.
Inherits From:
TTime
Inherited By:
None.
Purpose:
A TTime derived class used to represent time in samples. Samples are used for measuring position within a sound in units of audio samples instead of, say, seconds or milliseconds.
Instantiation:
Allocate on the heap or the stack.
Deriving Classes:
Not intended to be derived.
Concurrency:
Not multithread safe.
Resource Use:
No special requirements.
- TSamples ()
- TSamples (PositionDelta theSamples, TAudioType :: SampleRate theSampleRate)
- TSamples (const TTime & theTime, TAudioType :: SampleRate theSampleRate)
- TSamples (const TSamples & theTime)
Interface Category:
API.
Purpose:
- Default constructor. Creates a TSamples with an undefined time value and an undefined sample rate.
- Creates a TSamples given a number of samples and a sample rate
- Creates a TSamples given an existing TTime (or TTime derived class) and a sample rate. The number of samples in this case is the TTime value multiplied by the sample rate.
- Copy constructor.
Calling Context:
- Call directly to create an undefined object that will immediately be assigned to or streamed into.
- This is the most commonly used constructor. It is called to allow you to create a TSamples based upon a number of samples and a sample rate.
- Call directly if you have an existing TTime (or TTime derived class, such as TSeconds) and you want to create a TSamples from it.
- Call directly to copy an object.
Parameters:
- Takes no parameters.
- PositionDelta theSamples -The number of samples. This is a signed quantity that can take on negative values.
- TAudioType :: SampleRate theSampleRate -The sample rate, in samples per second. This is a floating-point value.
- const TTime & -The TTime (or TTime derived class) from which you want to create a TSamples.
- TAudioType :: SampleRate theSampleRate -The sample rate, in samples per second. This is a floating-point value.
- const TSamples & theTime -The TSamples that you want to copy.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual ~ TSamples ()
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: TSamples::operator=
- TSamples & operator =(const TSamples & theSamples)
- TSamples & operator =(const TTime & theTime)
Interface Category:
API.
Purpose:
- Assignment operator.
- Assigns a TTime to a TSamples.
Calling Context:
- Call directly when an object is assigned to another compatible object.
- Call directly when a TTime is assigned to this object.
Parameters:
Return Value:
A non-const reference to the left-hand side object.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TSamples::GetSamples
PositionDelta GetSamples () const
Interface Category:
API.
Purpose:
This commonly called member function returns the number of samples represented by a TSamples. This is how you extract the sample value from the TSamples object.
Calling Context:
Call directly to get the value of this object in units of samples.
Parameters:
Return Value:
TSamples::PositionDelta -A signed quantity representing the value of this time object in units of samples.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TSamples::operator<<=
virtual TStream & operator <<= (TStream & fromWhere)
Interface Category:
API.
Purpose:
Stream-in operator.
Calling Context:
Call directly to stream in the object.
Parameters:
- TStream & fromWhere -The stream the object streams itself in from.
Return Value:
Returns a reference to the stream the object streams itself in from.
Exceptions:
Throws TInvalidVersionError if the versions don't match.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TSamples::operator>>=
virtual TStream & operator >>=(TStream & toWhere) const
Interface Category:
API.
Purpose:
Stream-out operator.
Calling Context:
Call directly to stream out the object.
Parameters:
- TStream & toWhere -The stream the object streams itself out to.
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: TSamples::Hash
virtual long Hash () const
Interface Category:
API.
Purpose:
Generates the hash value.
Calling Context:
Call this function directly.
Parameters:
Return Value:
The hash value.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TSamples::GetSampleRate
TAudioType :: SampleRate GetSampleRate () const
Interface Category:
API.
Purpose:
Returns the value of the time in samples. This is a commonly called member function, as it is the only way to get the value of the time in samples.
Calling Context:
Call this function directly.
Parameters:
Return Value:
TAudioType::SampleRate -The sample rate.
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.