synthclone  0.3.0
synthclone::Sample Class Reference

Contains sample data. More...

#include <synthclone/sample.h>

Inheritance diagram for synthclone::Sample:
Collaboration diagram for synthclone::Sample:

Public Slots

void setTemporary (bool temporary)
 Sets a boolean indicating whether or not the file referenced by this object will be deleted when this object is destroyed. More...
 

Signals

void temporaryChanged (bool temporary)
 Emitted when the temporary flag changes. More...
 

Public Member Functions

 Sample (bool temporary=true, QObject *parent=0)
 Initializes an empty sample object. More...
 
 Sample (const QString &path, bool temporary=false, QObject *parent=0)
 Initializes a sample object. More...
 
 Sample (const Sample &sample, bool temporary=true, QObject *parent=0)
 Initializes a sample object. More...
 
 Sample (const Sample &sample, const QString &path, bool temporary=false, QObject *parent=0)
 Initializes a sample object. More...
 
 ~Sample ()
 If the file linked to this sample object is a temporary file, then the temporary file is deleted. More...
 
QString getPath () const
 Gets the path to the file holding this sample. More...
 
bool isTemporary () const
 Returns a boolean indicating whether or not the file referenced by this object will be deleted when this object is destroyed. More...
 

Friends

class SampleInputStream
 
class SampleOutputStream
 

Detailed Description

Contains sample data.

Sample data is kept in a file to conserve memory. To access the sample data, use the SampleInputStream class. To write sample data, use the SampleOutputStream class.

Constructor & Destructor Documentation

synthclone::Sample::Sample ( bool  temporary = true,
QObject *  parent = 0 
)
explicit

Initializes an empty sample object.

Sample contents are stored in a file in the system's temporary directory. This constructor should be used when a SampleOutputStream object will be used to write data to this sample.

Parameters
temporaryWhether or not the file associated with the sample should be removed when the sample object is deleted.
parentThe parent object of the new sample.
synthclone::Sample::Sample ( const QString &  path,
bool  temporary = false,
QObject *  parent = 0 
)
explicit

Initializes a sample object.

This constructor should be used when a SampleOutputStream object will be used to write data to this sample, or when there is already sample data available at the given path.

Parameters
pathThe file path this sample object should use.
temporaryWhether or not the file associated with the sample should be removed when the sample object is deleted.
parentThe parent object of the new sample.
synthclone::Sample::Sample ( const Sample sample,
bool  temporary = true,
QObject *  parent = 0 
)
explicit

Initializes a sample object.

Sample contents are stored in a file in the system's temporary directory.

Parameters
sampleA sample object. Sample contents will be copied from this object to the new sample object.
temporaryWhether or not the file associated with the sample should be removed when the sample object is deleted.
parentThe parent object of the new sample.
synthclone::Sample::Sample ( const Sample sample,
const QString &  path,
bool  temporary = false,
QObject *  parent = 0 
)

Initializes a sample object.

Parameters
sampleA sample object. Sample contents will be copied from this object to the new sample object.
pathThe file path this sample object should use.
temporaryWhether or not the file associated with the sample should be removed when the sample object is deleted.
parentThe parent object of the new sample.
synthclone::Sample::~Sample ( )

If the file linked to this sample object is a temporary file, then the temporary file is deleted.

Otherwise, nothing happens.

Member Function Documentation

QString synthclone::Sample::getPath ( ) const

Gets the path to the file holding this sample.

Returns
The path.
bool synthclone::Sample::isTemporary ( ) const

Returns a boolean indicating whether or not the file referenced by this object will be deleted when this object is destroyed.

Returns
The specified boolean.
void synthclone::Sample::setTemporary ( bool  temporary)
slot

Sets a boolean indicating whether or not the file referenced by this object will be deleted when this object is destroyed.

Parameters
temporaryThe specified boolean.
void synthclone::Sample::temporaryChanged ( bool  temporary)
signal

Emitted when the temporary flag changes.

Parameters
temporaryThe specified flag.

Friends And Related Function Documentation

friend class SampleInputStream
friend
friend class SampleOutputStream
friend

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