3rdparty/licenseReport: Add seperate LGPL checks
[haiku.git] / src / add-ons / media / media-add-ons / mixer / MixerUtils.h
blobcc01a9b43c17598eb1d0d91b215d8a53ac4f2060
1 /*
2 * Copyright 2003-2009 Haiku Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
5 * Authors:
6 * Marcus Overhagen
7 */
8 #ifndef _MIXER_UTILS_H
9 #define _MIXER_UTILS_H
12 #ifndef __SGI_STL_INTERNAL_ALGOBASE_H
13 template<class t> const t & max(const t &t1, const t &t2) { return (t1 > t2) ? t1 : t2; }
14 template<class t> const t & min(const t &t1, const t &t2) { return (t1 < t2) ? t1 : t2; }
15 #endif
16 template<class t> const t abs(const t t1) { return (t1 < 0) ? - t1 : t1; }
19 void fix_multiaudio_format(media_multi_audio_format *format);
21 int count_nonzero_bits(uint32 value);
23 uint32 GetChannelMask(int channel, uint32 all_channel_masks);
24 int GetChannelType(int channel, uint32 all_channel_masks);
26 bool HasKawamba();
28 void ZeroFill(float *_dst, int32 _dst_sample_offset, int32 _sample_count);
30 bigtime_t buffer_duration(const media_multi_audio_format & format);
32 int bytes_per_sample(const media_multi_audio_format & format);
34 int bytes_per_frame(const media_multi_audio_format & format);
35 int frames_per_buffer(const media_multi_audio_format & format);
37 int64 frames_for_duration(double framerate, bigtime_t duration);
38 bigtime_t duration_for_frames(double framerate, int64 frames);
40 int ChannelMaskToChannelType(uint32 mask);
41 uint32 ChannelTypeToChannelMask(int type);
43 double us_to_s(bigtime_t usecs);
44 bigtime_t s_to_us(double secs);
46 class MixerInput;
47 class MixerOutput;
49 const char *StringForFormat(char *buf, MixerOutput *output);
50 const char *StringForFormat(char *buf, MixerInput *input);
51 const char *StringForChannelMask(char *buf, uint32 mask);
52 const char *StringForChannelType(char *buf, int type);
54 #endif // _MIXER_UTILS_H