dmake: do not set MAKEFLAGS=k
[unleashed/tickless.git] / usr / src / cmd / audio / include / AudioList.h
blob755b322bf0255f537d145a3c5693a01a7c103565
1 /*
2 * CDDL HEADER START
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
7 * with the License.
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]
20 * CDDL HEADER END
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"
32 #include <Audio.h>
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
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 {
43 private:
44 void operator=(AudioListEntry); // Assignment is illegal
45 public:
46 Audio* aptr; // pointer to audio object
47 AudioListEntry* next; // pointer to next in list
48 AudioListEntry* prev; // pointer to previous
50 // Constructor w/obj
51 AudioListEntry(
52 Audio* obj); // referenced audio object
53 ~AudioListEntry(); // Destructor
55 void newptr(Audio* newa); // Reset extent
57 // Link in new extent
58 void link(
59 AudioListEntry* after); // link after this one
61 // Split an extent
62 void split(
63 Double pos); // split at offset
66 private:
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
78 public:
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
88 // Read from position
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
103 // Insert an entry
104 virtual AudioError Insert(
105 Audio* obj); // object to insert
107 // Insert an entry
108 virtual AudioError Insert(
109 Audio* obj, // object to insert
110 Double pos); // insertion offset, in seconds
112 // Append an entry
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
119 Double& frompos,
120 Double& topos,
121 Double& limit);
124 #ifdef __cplusplus
126 #endif
128 #endif /* !_MULTIMEDIA_AUDIOLIST_H */