Segment

A Segment consists basically of an audio frame (Audio attribute) and an aggregate of Frames. This aggregate is implemented as a list so as to favor fast insertions and deletions and supposing that access is usually going to be sequential. This list of frames can be searched upon, using its begin time as the sorting criteria. Apart from this, the Segment follows a composite pattern so a segment can in turn hold an aggregate of other Segments (which are known as children). In the composite structure, only the root segment may hold data (frames and audio) but this data may be accessed from a child located at any level. For doing so, all children have a pointer to their parent. In order to know if the Segment holds data or not, a structural attribute is included, which may be accessed through the GetHoldsData/SetHoldsData interface. The SetHoldsData method is not just an accessor, if set to true, the child will actually detach itself from its parent and copy the data that corresponds to its time interval. If set to false the child will remove the data attributes (frames and audio).

A Segment also has two informative attributes: BeginTime and EndTime.

The UML class diagram3.1 in figure 3.3 illustrates the inner structure of the Segment class and its associates:

Figure 3.3: CLAM Segment
\includegraphics[%
width=0.55\textwidth]{/home/xamat/xamat_cvs/Thesis/images/ch3-CLAM/ps/Segment.ps}

2004-10-18