#include <aflibAudioRecorder.h>
Inheritance diagram for aflibAudioRecorder::
Public Methods | |
aflibAudioRecorder (aflibAudio &audio) | |
Constructor that requires an audio parent. | |
aflibAudioRecorder () | |
Empty constructor. More... | |
~aflibAudioRecorder () | |
Destructor. | |
void | addRecordItem (const aflibDateTime &start_date, const aflibDateTime &stop_date, const string &file, const string &file_type, long long max_limit, long long each_limit, aflibConfig &config) |
Adds an item to the record list. More... | |
void | removeRecordItem (int item) |
Removes a audio record item. More... | |
int | getNumberOfRecordItems () const |
Gets number of current record items. | |
void | getRecordItem (int item, aflibDateTime &start_date, aflibDateTime &stop_date, string &file, string &file_type, long long &max_limit, long long &each_limit, aflibConfig &config) const |
Gets the data for a record item. | |
aflibStatus | compute_segment (list< aflibData *> &data, long long position=-1) |
Work function, must be implemented by derived class. | |
const char* | getName () const |
Returns the name of the derived class. |
This is a class that performs audio timer recording. This is derived from the aflibAudio base class so it can be used in an audio chain. This is a complex class that aids the user in developing functionality to their audio application that will perform like a VCR does for video. One creates audio record items. You supply start times, stop times, size limits, and info. Then you form this as part of a chain and loop on the process function of this objects base class. When the start time is reached for an item it will start recording. It will stop on several criteria. One can specify multiple items and in fact they can even overlap in time.
ADDING RECORD ITEMS One can add record items by calling addRecordItem. One specifies all the necessary information and then make it part of the audio chain and it is ready to go. If this audio object is destroyed then the record information is lost. If one wants to start recording right away then make the start time before the current time. The recording will stop based upon when one of two criteria is reached. If the stop time is reached then recording will stop. There are also two file size limits that can be set. If these are reached before the stop time then recording will be stopped. There is a max file size limit. This will allow one to set an upper limit on the disk space that will be used by the recording. This is useful when you only have a certain amount of disk space available. There is also an each file size limit. This will allow you to set a limit on how big each audio file will be. When that limit is reached then that file will be closed and a new one will be created. The new name will be called the original name plus _<number> before the extension. As many files will be created until either the stop time is reached or the max file size limit is reached. For each file mode the max file size limit means the total size of all audio files created. Each file mode is useful for portable MP3 players that have a memory limit. If you want to record a long show just set a each file size limit of 30M then the show will be stored to sperate files of 30M each. Just big enough to store on a MP3 player.
REMOVING RECORD ITEMS One can delete already stored items by calling removeRecordItem. Just pass the item number. The item number can be obtained from calls to getNumberOfRecordItems, getRecordItem. getNumberOfRecordItems will return the total number of items stored so far. getRecordItem will return all the information for an item. The numbering of items start at one.
|
Constructor that requires an audio parent.
|
|
Empty constructor. A empty constructor is provided for the case where this object will serve as a data collector keeping record segments stored. When it is ready to be used as part of a chain then the addParent in the base class should be called with the audio parent object. |
|
Destructor.
|
|
Adds an item to the record list. This function will add a record item to the list of record elements. Enter a start and stop date and time. A file and file type. The file_type argument must be a supported format. The list of formats can be returned from the call returnSupportedFormats from the aflibFile base class. This is a static function so it can be called at anytime. The max_limit is the total maximum disk space that can be used. Recording will stop when this value has been reached. To bypass the max file limit use -1. There is also an each_limit that can be bypassed with a -1 as well. This will split the audio into multiple files. It will start recording to a new file when this limit has been reached. Finally the config parameter will tell this class how to setup your audio file. |
|
Work function, must be implemented by derived class.
Reimplemented from aflibAudio. |
|
Returns the name of the derived class.
Reimplemented from aflibAudio. |
|
Gets number of current record items.
|
|
Gets the data for a record item.
|
|
Removes a audio record item. This will remove the specified item. The item number is obtained from calling getNumberOfRecordItems and getRecordItem. Item numbers start at 1. |