8322 nl: misleading-indentation
[unleashed/tickless.git] / usr / src / cmd / audio / utilities / AudioCopy.cc
blob6a159f84e573570f7adb95db8f72dabefec8b414
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 #pragma ident "%Z%%M% %I% %E% SMI"
29 #include <stdlib.h>
30 #include <errno.h>
31 #include <Audio.h>
32 #include <AudioBuffer.h>
33 #include <AudioLib.h>
35 // Generic Audio functions
38 // Data format translation occurs transparently
39 AudioError
40 AudioCopy(
41 Audio* from, // input source
42 Audio* to) // output sink
44 Double frompos = 0.;
45 Double topos = 0.;
46 Double limit = AUDIO_UNKNOWN_TIME;
48 return (AudioCopy(from, to, frompos, topos, limit));
51 // Copy a data stream
52 // Data format translation occurs transparently
53 AudioError
54 AudioCopy(
55 Audio* from, // input source
56 Audio* to, // output sink
57 Double& frompos, // input position (updated)
58 Double& topos, // output position (updated)
59 Double& limit) // amount to copy (updated)
61 return (from->Copy(to, frompos, topos, limit));
64 // Copy one segment of a data stream
65 // Data format translation occurs transparently
66 AudioError
67 AudioAsyncCopy(
68 Audio* from, // input source
69 Audio* to, // output sink
70 Double& frompos, // input position (updated)
71 Double& topos, // output position (updated)
72 Double& limit) // amount to copy (updated)
74 return (from->AsyncCopy(to, frompos, topos, limit));