CLAM-Development  1.4.0
SDIFHeader.hxx
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2004 MUSIC TECHNOLOGY GROUP (MTG)
3  * UNIVERSITAT POMPEU FABRA
4  *
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19  *
20  */
21 
22 #ifndef __SDIFHeader__
23 #define __SDIFHeader__
24 
25 #include "SDIFType.hxx"
26 
27 namespace SDIF
28 {
29 
39  {
40  public:
41  //* Identifier indicating the kind of frame */
43  //* Size in bytes, of the frame, not including the type or size
45  public:
49  FrameHeader(const TypeId& type, CLAM::TInt32 size);
50 
51  static CLAM::TInt32 SizeInFile(void)
52  {
53  return
54  sizeof(TypeId)+ // mType
55  sizeof(CLAM::TInt32); // mSize
56  }
57  };
58 
64  {
65  public:
66  //* Timestamp
68  //* Stream ID @see Stream
70  //* Number of data matrixes in the frame. @see Matrix
72  public:
78  DataFrameHeader(const TypeId& type,CLAM::TFloat64 time=0.,CLAM::TInt32 id=0);
79 
80  static CLAM::TInt32 SizeInFile(void)
81  {
82  return
83  sizeof(CLAM::TFloat64)+ // mTime
84  sizeof(CLAM::TInt32)+ // mStreamId
85  sizeof(CLAM::TInt32); // mnMatrices
86  }
87  };
88 
92  {
93  public:
94 
95  //* Identifier indicating the matrix type
97  //* Identifier indicating the type of data in the matrix
99  //* Number of rows in the matrix
101  //* Number of columns in the matrix
103 
104  public:
113  {
114  return
115  sizeof(TypeId)+
116  sizeof(CLAM::TInt32)+ // mDataType
117  sizeof(CLAM::TInt32)+ // mnRows
118  sizeof(CLAM::TInt32); // mnColumns
119  }
120 
122  {
123  }
124 
125  MatrixHeader(
126  const TypeId& type,
127  DataType dataType,
128  CLAM::TInt32 nRows, CLAM::TInt32 nColumns);
129  };
130 
131 }
132 
133 #endif
134