CLAM-Development
1.4.0
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
src
Tools
SDIF
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
38
class
FrameHeader
39
{
40
public
:
41
//* Identifier indicating the kind of frame */
42
TypeId
mType
;
43
//* Size in bytes, of the frame, not including the type or size
44
CLAM::TInt32
mSize
;
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
63
class
DataFrameHeader
:
public
FrameHeader
64
{
65
public
:
66
//* Timestamp
67
CLAM::TFloat64
mTime
;
68
//* Stream ID @see Stream
69
CLAM::TInt32
mStreamId
;
70
//* Number of data matrixes in the frame. @see Matrix
71
CLAM::TInt32
mnMatrices
;
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
91
class
MatrixHeader
92
{
93
public
:
94
95
//* Identifier indicating the matrix type
96
TypeId
mType
;
97
//* Identifier indicating the type of data in the matrix
98
DataType
mDataType
;
99
//* Number of rows in the matrix
100
CLAM::TInt32
mnRows
;
101
//* Number of columns in the matrix
102
CLAM::TInt32
mnColumns
;
103
104
public
:
112
static
CLAM::TInt32
SizeInFile
(
void
)
113
{
114
return
115
sizeof
(
TypeId
)+
116
sizeof
(
CLAM::TInt32
)+
// mDataType
117
sizeof
(
CLAM::TInt32
)+
// mnRows
118
sizeof
(
CLAM::TInt32
);
// mnColumns
119
}
120
121
MatrixHeader
()
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
Generated by
1.8.1