Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

aflibAudioEdit.h

Go to the documentation of this file.
00001 /*
00002  * Copyright: (C) 1999-2001 Bruce W. Forsberg
00003  *
00004  *   This library is free software; you can redistribute it and/or
00005  *   modify it under the terms of the GNU Lesser General Public
00006  *   License as published by the Free Software Foundation; either
00007  *   version 2.1 of the License, or any later version.
00008  *
00009  *   This library is distributed in the hope that it will be useful,
00010  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  *   Lesser General Public License for more details.
00013  *
00014  *   You should have received a copy of the GNU Lesser General Public
00015  *   License along with this library; if not, write to the Free Software
00016  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
00017  *
00018  *   Bruce Forsberg  forsberg@tns.net
00019  *
00020  */
00021 
00022 
00023 #ifndef _AFLIBAUDIOEDIT_H_
00024 #define _AFLIBAUDIOEDIT_H_
00025 
00026 #include <list>
00027 #include <set>
00028 
00029 #include "aflibAudio.h"
00030 #include "aflibEditClip.h"
00031 
00116 class aflibAudioEdit : public aflibAudio {
00117 
00118 public:
00119 
00120    // Available contructors and destructors
00121    aflibAudioEdit(aflibAudio& audio);
00122    ~aflibAudioEdit();
00123 
00124    // Add and remove segments
00125    void
00126    addSegment(
00127       int  input,
00128       long long input_start_position,
00129       long long input_stop_position,
00130       long long output_insert_position,
00131       double    factor = 1.0);
00132 
00133    void
00134    addSegment(
00135       int  input,
00136       double input_start_seconds,
00137       double input_stop_seconds,
00138       double output_insert_seconds,
00139       double factor = 1.0);
00140 
00141    void
00142    removeSegment(int seg_num);
00143 
00144    void
00145    removeSegment(
00146       long long output_start_position,
00147       long long output_stop_position);
00148 
00149    void
00150    removeSegment(
00151       double output_start_seconds,
00152       double output_stop_seconds);
00153 
00154    // Obtain information
00155    int
00156    getNumberOfSegments();
00157 
00158    void
00159    getSegment(
00160       int segment_number,
00161       int&  input,
00162       long long& input_start_position,
00163       long long& input_stop_position,
00164       long long& output_start_position,
00165       long long& output_stop_position,
00166       double&    factor);
00167 
00168    void
00169    getSegment(
00170       int segment_number,
00171       int&  input,
00172       double& input_start_seconds,
00173       double& input_stop_seconds,
00174       double& output_start_seconds,
00175       double& output_stop_seconds,
00176       double& factor);
00177 
00178    // Perform Undo / Redo of an audio edit
00179    aflibUndoRedo
00180    getUndoRedoStatus() const;
00181 
00182    void
00183    performUndoRedo();
00184 
00185    aflibStatus
00186    compute_segment(
00187       list<aflibData *>& data,
00188       long long position = -1) ;
00189 
00190    aflibData *
00191    process(
00192       aflibStatus& ret_status,
00193       long long position,
00194       int& num_samples,
00195       bool free_memory = TRUE) ;
00196 
00198    const char *
00199    getName() const { return "aflibAudioEdit";};
00200 
00201    // Callbacks from afChain
00202    void
00203    parentWasDestroyed(int parent_id);
00204 
00205    void
00206    parentWasAdded(int parent_id) ;
00207 
00208    void
00209    setInputConfig(const aflibConfig& cfg);
00210 
00211    bool
00212    isDataSizeSupported(aflib_data_size size);
00213  
00214    bool
00215    isEndianSupported(aflib_data_endian end);
00216  
00217    bool
00218    isSampleRateSupported(int& rate);
00219 
00220    bool
00221    isChannelsSupported(int& channels);
00222 
00223 private:
00224 
00225    aflibAudioEdit();
00226 
00227    aflibAudioEdit(const aflibAudioEdit& op);
00228 
00229    const aflibAudioEdit&
00230    operator=(const aflibAudioEdit& op);
00231 
00232    void
00233    printClips();
00234 
00235    void
00236    recomputeConfig();
00237 
00238    // Add and remove inputs
00239    void
00240    addInput(int input);
00241 
00242    void
00243    removeInput(int input);
00244 
00245 list<int>  _input_array;
00246 set< aflibEditClip, less < aflibEditClip > > _clip_array;
00247 
00248 };
00249 
00250 
00251 #endif

Generated at Tue Aug 7 22:18:05 2001 for Open Source Audio Library Project by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001