4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright (c) 1990-2001 by Sun Microsystems, Inc.
24 * All rights reserved.
27 #ifndef _MULTIMEDIA_AUDIOLIST_H
28 #define _MULTIMEDIA_AUDIOLIST_H
30 #pragma ident "%Z%%M% %I% %E% SMI"
38 // This is the 'base' class for a list of extents of audio objects
39 class AudioList
: public Audio
{
41 // Define a linked list nested class
42 class AudioListEntry
{
44 void operator=(AudioListEntry
); // Assignment is illegal
46 Audio
* aptr
; // pointer to audio object
47 AudioListEntry
* next
; // pointer to next in list
48 AudioListEntry
* prev
; // pointer to previous
52 Audio
* obj
); // referenced audio object
53 ~AudioListEntry(); // Destructor
55 void newptr(Audio
* newa
); // Reset extent
59 AudioListEntry
* after
); // link after this one
63 Double pos
); // split at offset
67 AudioListEntry head
; // list head
69 AudioListEntry
* first() const; // Return first extent
71 // Locate extent/offset
72 virtual Boolean
getposition(
73 Double
& pos
, // target position (updated)
74 AudioListEntry
*& ep
) const; // returned entry pointer
76 AudioList
operator=(AudioList
); // Assignment is illegal
79 AudioList(const char *name
= "[list]"); // Constructor
80 virtual ~AudioList(); // Destructor
82 // class Audio methods specialized here
83 virtual Double
GetLength() const; // Get length, in secs
84 virtual char *GetName() const; // Get name string
85 virtual AudioHdr
GetHeader(); // Get header
86 virtual AudioHdr
GetHeader(Double pos
); // Get header at pos
89 virtual AudioError
ReadData(
90 void* buf
, // buffer to fill
91 size_t& len
, // buffer length (updated)
92 Double
& pos
); // start position (updated)
94 // Write is prohibited
95 virtual AudioError
WriteData(
96 void* buf
, // buffer to copy
97 size_t& len
, // buffer length (updated)
98 Double
& pos
); // start position (updated)
100 virtual Boolean
isList() const { return (TRUE
); }
102 // list manipulation methods
104 virtual AudioError
Insert(
105 Audio
* obj
); // object to insert
108 virtual AudioError
Insert(
109 Audio
* obj
, // object to insert
110 Double pos
); // insertion offset, in seconds
113 virtual AudioError
Append(
114 Audio
* obj
); // object to append
116 // copy to another audio obj.
117 virtual AudioError
AsyncCopy(
118 Audio
* ap
, // dest audio object
128 #endif /* !_MULTIMEDIA_AUDIOLIST_H */