Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055 #if !defined(ALIZE_FeatureInputStreamModifier_h)
00056 #define ALIZE_FeatureInputStreamModifier_h
00057
00058 #if defined(_WIN32)
00059 #if defined(ALIZE_EXPORTS)
00060 #define ALIZE_API __declspec(dllexport)
00061 #else
00062 #define ALIZE_API __declspec(dllimport)
00063 #endif
00064 #else
00065 #define ALIZE_API
00066 #endif
00067
00068 #include "FeatureInputStream.h"
00069 #include "alizeString.h"
00070 #include "Feature.h"
00071 #include "ULongVector.h"
00072
00073 namespace alize
00074 {
00088 class ALIZE_API FeatureInputStreamModifier : public FeatureInputStream
00089 {
00090
00091 friend class TestFeatureInputStreamModifier;
00092
00093 public :
00094
00099 FeatureInputStreamModifier(FeatureInputStream& is,
00100 const String& m = "NO_MASK", bool ownStream = false);
00101 static FeatureInputStreamModifier& create(FeatureInputStream& is,
00102 const String& m = "NO_MASK", bool ownStream = false);
00103
00113 void setMask(const String& m);
00114
00115 virtual bool readFeature(Feature& f, unsigned long step = 1);
00116
00117 virtual bool writeFeature(const Feature& f, unsigned long step = 1);
00118
00123 virtual unsigned long getFeatureCount();
00124
00129 virtual unsigned long getVectSize();
00130
00135 virtual const FeatureFlags& getFeatureFlags();
00136
00141 virtual real_t getSampleRate();
00142
00145 virtual void reset();
00146
00149 virtual void close();
00150
00154 virtual unsigned long getSourceCount();
00155
00160 virtual unsigned long getFeatureCountOfASource(unsigned long srcIdx);
00161
00166 virtual unsigned long getFeatureCountOfASource(const String& src);
00167
00173 virtual unsigned long getFirstFeatureIndexOfASource(unsigned long srcIdx);
00174
00180 virtual unsigned long getFirstFeatureIndexOfASource(const String& srcName);
00181
00187 virtual const String& getNameOfASource(unsigned long srcIdx);
00188
00189 virtual void seekFeature(unsigned long featureNbr,
00190 const String& srcName);
00191
00192 virtual ~FeatureInputStreamModifier();
00193
00194 virtual String getClassName() const;
00195 virtual String toString() const;
00196
00197 private:
00198
00199 FeatureInputStream* _pInput;
00200 Feature _feature;
00201 String _mask;
00202 String _tmpMask;
00203 ULongVector _selection;
00204 unsigned long _selectionSize;
00205 bool _useMask;
00206 bool _ownStream;
00207
00208 void updateMask(const String& begin, const String& end);
00209 };
00210
00211 }
00212
00213 #endif // !defined(ALIZE_FeatureInputStreamModifier_h)
00214