1 /*
2 	Audio File Library
3 	Copyright (C) 2000, Silicon Graphics, Inc.
4 
5 	This library is free software; you can redistribute it and/or
6 	modify it under the terms of the GNU Lesser General Public
7 	License as published by the Free Software Foundation; either
8 	version 2.1 of the License, or (at your option) any later version.
9 
10 	This library is distributed in the hope that it will be useful,
11 	but WITHOUT ANY WARRANTY; without even the implied warranty of
12 	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13 	Lesser General Public License for more details.
14 
15 	You should have received a copy of the GNU Lesser General Public
16 	License along with this library; if not, write to the
17 	Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 	Boston, MA  02110-1301  USA
19 */
20 
21 /*
22 	track.h
23 */
24 
25 #ifndef TRACK_H
26 #define TRACK_H
27 
28 #include "AudioFormat.h"
29 #include "Shared.h"
30 #include "afinternal.h"
31 
32 class ModuleState;
33 class PacketTable;
34 struct Marker;
35 struct MarkerSetup;
36 
37 struct TrackSetup
38 {
39 	int id;
40 
41 	AudioFormat f;
42 
43 	bool rateSet, sampleFormatSet, sampleWidthSet, byteOrderSet,
44 		channelCountSet, compressionSet, aesDataSet, markersSet,
45 		dataOffsetSet, frameCountSet;
46 
47 	int markerCount;
48 	MarkerSetup *markers;
49 
50 	AFfileoffset dataOffset;
51 	AFframecount frameCount;
52 };
53 
54 struct Track
55 {
56 	Track();
57 	~Track();
58 
59 	int	id;	/* usually AF_DEFAULT_TRACKID */
60 
61 	AudioFormat f, v;	/* file and virtual audio formats */
62 
63 	SharedPtr<PacketTable> m_packetTable;
64 
65 	double *channelMatrix;
66 
67 	int markerCount;
68 	Marker *markers;
69 
70 	bool hasAESData;	/* Is AES nonaudio data present? */
71 	unsigned char aesData[24];	/* AES nonaudio data */
72 
73 	AFframecount totalfframes;		/* frameCount */
74 	AFframecount nextfframe;		/* currentFrame */
75 	AFframecount frames2ignore;
76 	AFfileoffset fpos_first_frame;	/* dataStart */
77 	AFfileoffset fpos_next_frame;
78 	AFfileoffset fpos_after_data;
79 	AFframecount totalvframes;
80 	AFframecount nextvframe;
81 	AFfileoffset data_size;		/* trackBytes */
82 
83 	SharedPtr<ModuleState> ms;
84 
85 	double taper, dynamic_range;
86 	bool ratecvt_filter_params_set;
87 
88 	bool filemodhappy;
89 
90 	void print();
91 
92 	Marker *getMarker(int markerID);
93 	status copyMarkers(TrackSetup *setup);
94 
95 	void computeTotalFileFrames();
96 };
97 
98 #endif
99