SDIFFrame.hxx

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2004 MUSIC TECHNOLOGY GROUP (MTG)
00003  *                         UNIVERSITAT POMPEU FABRA
00004  *
00005  *
00006  * This program is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU General Public License as published by
00008  * the Free Software Foundation; either version 2 of the License, or
00009  * (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019  *
00020  */
00021 
00022 #ifndef __SDIFFrame__
00023 #define __SDIFFrame__
00024 
00025 #include "SDIFHeader.hxx"
00026 #include <list>
00027 
00028 namespace SDIF
00029 {
00030         class Matrix;
00031 
00034         class OpeningsFrame {
00035         public:
00036                 FrameHeader mHeader;
00037                 CLAM::TInt32 mSpecVersion;
00038                 CLAM::TInt32 mStandardTypesVersion;
00039         public: 
00041                 OpeningsFrame():
00042                         mHeader("SDIF",sizeof(CLAM::TInt32)+sizeof(CLAM::TInt32)),
00043                         mSpecVersion(3),mStandardTypesVersion(1)
00044                 {
00045                 }
00046         };
00047 
00052         class Frame {
00053         friend class File;
00054         friend class Collection;
00055         public:
00056                 typedef std::list<Matrix*>::const_iterator MatrixIterator;
00057         private:
00058                 DataFrameHeader mHeader;
00059                 std::list<Matrix*> mMatrixList;
00060         public:
00066                 Frame(const TypeId& type = TypeId::sDefault,
00067                         CLAM::TFloat64 time =0.,CLAM::TInt32 streamId = 0);
00068                 ~Frame();
00069 
00073                 void Add(Matrix* pMatrix);
00074                 
00075                 Matrix* GetMatrixAt(int i)
00076                 {
00077                         MatrixIterator it = mMatrixList.begin();
00078                         std::advance(it,i);
00079                         return *it;
00080                 }
00081                 
00082                 MatrixIterator Begin(void) const { return mMatrixList.begin(); }
00083                 MatrixIterator End(void) const { return mMatrixList.end(); }
00084                 
00085                 CLAM::TFloat64 Time(void) { return mHeader.mTime; }
00086                 TypeId Type(void) {return mHeader.mType;}
00087                 
00088         };
00089 }
00090 
00091 #endif
00092 
Generated by  doxygen 1.6.3