📄 aflibaudioedit.3
字号:
.TH "aflibAudioEdit" 3 "8 May 2002" "Open Source Audio Library Project" \" -*- nroff -*-.ad l.nh.SH NAMEaflibAudioEdit \- Provides functionality for audio editing. .SH SYNOPSIS.br.PP\fC#include <aflibAudioEdit.h>\fP.PPInherits \fBaflibAudio\fP..PP.SS "Public Methods".in +1c.ti -1c.RI "\fBaflibAudioEdit\fP (\fBaflibAudio\fP &audio)".br.RI "\fIConstructor - requires an \fBaflibAudio\fP object.\fP".ti -1c.RI "\fB~aflibAudioEdit\fP ()".br.RI "\fIDestructor.\fP".ti -1c.RI "void \fBaddSegment\fP (int input, long long input_start_position, long long input_stop_position, long long output_insert_position, double factor=1.0)".br.RI "\fIAdd an audio clip using samples.\fP".ti -1c.RI "void \fBaddSegment\fP (int input, double input_start_seconds, double input_stop_seconds, double output_insert_seconds, double factor=1.0)".br.RI "\fIAdd an audio clip using seconds.\fP".ti -1c.RI "void \fBremoveSegment\fP (int seg_num)".br.RI "\fIRemove an audio clip segment by segment number.\fP".ti -1c.RI "void \fBremoveSegment\fP (long long output_start_position, long long output_stop_position)".br.RI "\fIRemove an audio clip segment by samples.\fP".ti -1c.RI "void \fBremoveSegment\fP (double output_start_seconds, double output_stop_seconds)".br.RI "\fIRemove an audio clip segment by seconds.\fP".ti -1c.RI "void \fBremoveSegmentsFromInput\fP (int input)".br.RI "\fIRemove all audio segments for a specific input.\fP".ti -1c.RI "int \fBgetNumberOfSegments\fP ()".br.RI "\fIGets the current number of segments that are in the audio clip list.\fP".ti -1c.RI "void \fBgetSegment\fP (int segment_number, int &input, long long &input_start_position, long long &input_stop_position, long long &output_start_position, long long &output_stop_position, double &factor)".br.RI "\fIRetrieves information for an audio clip segment by samples.\fP".ti -1c.RI "void \fBgetSegment\fP (int segment_number, int &input, double &input_start_seconds, double &input_stop_seconds, double &output_start_seconds, double &output_stop_seconds, double &factor)".br.RI "\fIRetrieves information for an audio clip segment by seconds.\fP".ti -1c.RI "\fBaflibUndoRedo\fP \fBgetUndoRedoStatus\fP () const".br.RI "\fINot Yet Implemented.\fP".ti -1c.RI "void \fBperformUndoRedo\fP ()".br.RI "\fINot Yet Implemented.\fP".ti -1c.RI "\fBaflibStatus\fP \fBcompute_segment\fP (list< \fBaflibData\fP * > &data, long long position=-1)".br.RI "\fIMain work function.\fP".ti -1c.RI "\fBaflibData\fP * \fBprocess\fP (\fBaflibStatus\fP &ret_status, long long position, int &num_samples, bool free_memory=TRUE)".br.RI "\fIMain process function.\fP".ti -1c.RI "const char * \fBgetName\fP () const".br.RI "\fIReturns the name of the derived class.\fP".ti -1c.RI "void \fBparentWasDestroyed\fP (int parent_id)".br.RI "\fICallback to notify derived class when parent was destroyed.\fP".ti -1c.RI "void \fBparentWasAdded\fP (int parent_id)".br.RI "\fICallback to notify derived class when parent was added.\fP".ti -1c.RI "void \fBsetInputConfig\fP (const \fBaflibConfig\fP &cfg)".br.RI "\fISets the input and output audio data configuration of this object.\fP".ti -1c.RI "bool \fBisDataSizeSupported\fP (\fBaflib_data_size\fP size)".br.ti -1c.RI "bool \fBisEndianSupported\fP (\fBaflib_data_endian\fP end)".br.ti -1c.RI "bool \fBisSampleRateSupported\fP (int &rate)".br.ti -1c.RI "bool \fBisChannelsSupported\fP (int &channels)".br.in -1c.SH "DETAILED DESCRIPTION".PP Provides functionality for audio editing..PPThis is a class that simplifies audio editing. This is derived from the \fBaflibAudio\fP base class so it can be used in an audio chain. This is a complex class that aids the application programmer in writing an audio editing program. It can accept multiple inputs and allows the user to add audio clip segments, remove audio clip segments, and add or remove inputs. One can use this object in a chain so that the output of this object can be output to an audio file or device for output. Once the clip information is stored in this class it will automatically get the audio input from the correct input and route it to the output. We also provide our own process function instead of using the base classes since we need to retrieve data from different inputs. One other current limitiation is that if a data segment that is passed to the process function spans clips from different inputs then only the input in the furst clip will be used. This will be changed in the furture as well..PPADDING AND REMOVING INPUTS One can add or remove inputs to this class. The constructor does require one input. An ID number is returned when additional inputs are added. The first input specified should be assumed to have an ID of 1. When an input is removed any audio clips that are obtained from this input will be removed. If all inputs are removed then FALSE will be sent to the enable function of the \fBaflibAudio\fP base class to disable this object from the chain. When an input is added this object will be enabled again. The functions to add and remove inputs are provided by the \fBaflibChain\fP base class:.br int \fBaddParent\fP();.br void \fBremoveParent\fP();.br .br ADDING AND REMOVING AUDIO SEGMENTS Adding and removing segments is the heart of this object. This in effect allows one to map inputs to the output of this object. A typical application would be to have only one input and then add a segment that contains the entire audio segment of the input. Then the user can remove certain audio segments of this input. This makes the output look like one continuous audio stream without the segments that have been removed. The APIs here allow one to specify segments in either samples or segments. If one uses doubles then the specifcation is assumed to be seconds and if long long then samples. One can also remove a segment by the segment number. One should verify the segment number first though as segment numbers can change after segments are added, removed, or inputs removed. One can also remove all segments from a specific input. The functions to add and remove segments are: .br void addSegment( .br int input, .br long long input_start_position, .br long long input_stop_position, .br long long output_insert_position); .br void addSegment( .br int input, .br double input_start_seconds, .br double input_stop_seconds, .br double output_insert_seconds); .br void \fBremoveSegment\fP(int seg_num); .br void removeSegment( .br long long output_start_position, .br long long output_stop_position); .br void removeSegment( .br double output_start_seconds, .br double output_stop_seconds); .br void \fBremoveSegmentsFromInput\fP(int input); .br .br OBTAINING INFORMATION Several functions exist to get information on the audio segment data. One can get the total number of current segments and then one can obtain the data for any particular segment in either seconds or samples. Segments start at number 1. .br int \fBgetNumberOfSegments\fP(); .br void getSegment( .br int segment_number, .br int& input, .br long long& input_start_position, .br long long& input_stop_position, .br long long& output_start_position, .br long long& output_stop_position); .br void getSegment( .br int segment_number, .br int& input, .br double& input_start_seconds, .br double& input_stop_seconds, .br double& output_start_seconds, .br double& output_stop_seconds); .br .br UNDO / REDO In the future Undo / Redo capability will be added to undo the last audio segment addition or deletion. .PP.SH "CONSTRUCTOR & DESTRUCTOR DOCUMENTATION".PP .SS "aflibAudioEdit::aflibAudioEdit (\fBaflibAudio\fP & audio)".PPConstructor - requires an \fBaflibAudio\fP object..PPUser must create this object with at least one input. The ID for this input can be assumed to be 1. .SS "aflibAudioEdit::~aflibAudioEdit ()".PPDestructor..PP.SH "MEMBER FUNCTION DOCUMENTATION".PP .SS "void aflibAudioEdit::addSegment (int input, double input_start_seconds, double input_stop_seconds, double output_insert_seconds, double factor = 1.0)".PPAdd an audio clip using seconds..PPThis function will add a new segment at the position specified. If will push out all data after this insertion point in the existing audio clip array. This function allows one to specify the positions in seconds. .SS "void aflibAudioEdit::addSegment (int input, long long input_start_position, long long input_stop_position, long long output_insert_position, double factor = 1.0)".PPAdd an audio clip using samples..PPThis function will add a new segment at the position specified. If will push out all data after this insertion point in the existing audio clip array. This function allows one to specify the positions as samples. .SS "\fBaflibStatus\fP aflibAudioEdit::compute_segment (list< \fBaflibData\fP * > & data, long long position = -1)\fC [virtual]\fP".PPMain work function..PPWe don't do any real processing of the data. We actually only route the data. .PPReimplemented from \fBaflibAudio\fP..SS "const char* aflibAudioEdit::getName () const\fC [inline, virtual]\fP".PPReturns the name of the derived class..PPReimplemented from \fBaflibAudio\fP..SS "int aflibAudioEdit::getNumberOfSegments ()".PPGets the current number of segments that are in the audio clip list..PP.SS "void aflibAudioEdit::getSegment (int segment_number, int & input, double & input_start_seconds, double & input_stop_seconds, double & output_start_seconds, double & output_stop_seconds, double & factor)".PPRetrieves information for an audio clip segment by seconds..PPThis function will retrieve the information for a particular audio clip segment. This will allow the user to determine the input and output start and stop positions in seconds. The segment numbers start with 1. .SS "void aflibAudioEdit::getSegment (int segment_number, int & input, long long & input_start_position, long long & input_stop_position, long long & output_start_position, long long & output_stop_position, double & factor)".PPRetrieves information for an audio clip segment by samples..PPThis function will retrieve the information for a particular audio clip segment. This will allow the user to determine the input and output start and stop positions in samples. The segment numbers start with 1. .SS "\fBaflibUndoRedo\fP aflibAudioEdit::getUndoRedoStatus () const".PPNot Yet Implemented..PP.SS "bool aflibAudioEdit::isChannelsSupported (int & channels)\fC [virtual]\fP".PPReimplemented from \fBaflibAudio\fP..SS "bool aflibAudioEdit::isDataSizeSupported (\fBaflib_data_size\fP size)\fC [virtual]\fP".PPReimplemented from \fBaflibAudio\fP..SS "bool aflibAudioEdit::isEndianSupported (\fBaflib_data_endian\fP end)\fC [virtual]\fP".PPReimplemented from \fBaflibAudio\fP..SS "bool aflibAudioEdit::isSampleRateSupported (int & rate)\fC [virtual]\fP".PPReimplemented from \fBaflibAudio\fP..SS "void aflibAudioEdit::parentWasAdded (int parent_id)\fC [virtual]\fP".PPCallback to notify derived class when parent was added..PPThis is a callback that derived classes override to get notified when a parent is added. It will not get called when a parent is set in the constructor. .PPReimplemented from \fBaflibChain\fP..SS "void aflibAudioEdit::parentWasDestroyed (int parent_id)\fC [virtual]\fP".PPCallback to notify derived class when parent was destroyed..PPThis is a callback that derived classes override to get notified when a parent was removed from an object .PPReimplemented from \fBaflibChain\fP..SS "void aflibAudioEdit::performUndoRedo ()".PPNot Yet Implemented..PP.SS "\fBaflibData\fP * aflibAudioEdit::process (\fBaflibStatus\fP & ret_status, long long position, int & num_samples, bool free_memory = TRUE)\fC [virtual]\fP".PPMain process function..PPSince we have to deal with multiple inputs we override the base classes process function with our own. This will retrieve the audio data from the proper input based on position. It is responsible for mapping the output sample position to the correct input and its sample position. See the base class \fBaflibAudio::process\fP for what the process function is suppose to do. .PPReimplemented from \fBaflibAudio\fP..SS "void aflibAudioEdit::removeSegment (double output_start_seconds, double output_stop_seconds)".PPRemove an audio clip segment by seconds..PPThis function allows one to remove an audio segment by specifing a start and stop seconds position. This segment can span one or more audio segments. These seconds are referenced to the current output. .SS "void aflibAudioEdit::removeSegment (long long output_start_position, long long output_stop_position)".PPRemove an audio clip segment by samples..PPThis function allows one to remove an audio segment by specifing a start and stop samples position. This segment can span one or more audio segments. These samples are referenced to the current output. .SS "void aflibAudioEdit::removeSegment (int seg_num)".PPRemove an audio clip segment by segment number..PPThis function allows one to remove a segment from the audio clip list by its segment number. One should verify the segment first with a call to getSegment. Segment numbers can change when ever there is a change made. .SS "void aflibAudioEdit::removeSegmentsFromInput (int input)".PPRemove all audio segments for a specific input..PPThis function allows one to remove all audio segments for a specific input. .SS "void aflibAudioEdit::setInputConfig (const \fBaflibConfig\fP & cfg)\fC [virtual]\fP".PPSets the input and output audio data configuration of this object..PPThis function overrides the \fBaflibAudio\fP base class function. It will change the total samples in the output audio configuration. It will also select the best output based on the inputs. Any conversion that needs to be done will be done. This allows mixing of inputs with different sample rates, endian layouts, channels, and data sizes. .PPReimplemented from \fBaflibAudio\fP..SH "AUTHOR".PP Generated automatically by Doxygen for Open Source Audio Library Project from the source code.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -