/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright (c) 1992-2001 by Sun Microsystems, Inc.
* All rights reserved.
*/
#ifndef _MULTIMEDIA_AUDIOTYPES_H
#define _MULTIMEDIA_AUDIOTYPES_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef NO_EXTERN_C
#ifdef __cplusplus
extern "C" {
#endif
#endif /* NO_EXTERN_C */
#include <math.h>
#include <stdlib.h>
#include <float.h>
#include <limits.h>
#include <fcntl.h>
#include <audio_hdr.h>
// Types used in the audio API
// Values used for indeterminate size (e.g., data passed through a pipe)
// Error severity
enum AudioSeverity {
};
// Used in SetPosition methods
// XXX - classes that ought to be defined elsewhere
// A Boolean 'primitive type' with values TRUE and FALSE
// undefine these in case they're defined elsewhere
// use bool_t 'cause boolean_t is already used under 5.0
// so use aud_bool_t
{ }
inline operator int() // Cast to integer
};
// A 'primitive type' for file access modes
enum fileaccess_t {
};
{ return (mode); }
inline operator int() { // Cast to integer
switch (mode) {
case NoAccess: return (-1);
}
}
// These tests depend on the actual enum values
{ return ((int)mode & 1); }
{ return ((int)mode & 2); }
{ return ((int)mode & 4); }
};
// Define a small number corresponding to minor floating-point bit errors
// Define a 'double' class that allows some leeway in magnitude checking
// to try to correct for small errors due to floating-point imprecision
double val;
inline int Undefined() const
{ return (val == AUDIO_UNKNOWN_TIME); }
inline operator double() const
{ return (val); }
};
// inline double fabs(double x)
// { return ((x >= 0.) ? x : -x); }
return (((double)x < (double)y) ? (double)x : (double)y);
}
return (((double)x < (double)y) ? (double)x : (double)y);
}
return (((double)x < (double)y) ? (double)x : (double)y);
}
return (((double)x > (double)y) ? (double)x : (double)y);
}
return (((double)x > (double)y) ? (double)x : (double)y);
}
return (((double)x > (double)y) ? (double)x : (double)y);
}
return (fabs((double)x - (double)y) <= AUDIO_MINFLOAT);
}
return (fabs((double)x - (double)y) <= AUDIO_MINFLOAT);
}
return (fabs((double)x - (double)y) <= AUDIO_MINFLOAT);
}
return (!(x == y));
}
return (!(x == y));
}
return (!(x == y));
}
return (((double)x < (double)y) || (x == y));
}
return (((double)x < (double)y) || (x == y));
}
{ return (((double)x < (double)y) || (x == y)); }
{ return (((double)x > (double)y) || (x == y)); }
return (((double)x > (double)y) || (x == y));
}
return (((double)x > (double)y) || (x == y));
}
return (!(x >= y));
}
return (!(x >= y));
}
return (!(x >= y));
}
return (!(x <= y));
}
return (!(x <= y));
}
return (!(x <= y));
}
return (x += (double)y);
}
return (x += (double)y);
}
return (x -= (double)y);
}
return (x -= (double)y);
}
return (x.Undefined());
}
inline int Undefined(double x) {
return (x == AUDIO_UNKNOWN_TIME);
}
#ifdef NO_EXTERN_C
#ifdef __cplusplus
}
#endif
#endif /* NO_EXTERN_C */
#endif /* !_MULTIMEDIA_AUDIOTYPES_H */