~ubuntu-branches/ubuntu/hoary/kdemultimedia/hoary

« back to all changes in this revision

Viewing changes to noatun/noatun/library/conversion.h

  • Committer: Bazaar Package Importer
  • Author(s): Martin Schulze
  • Date: 2003-01-22 15:00:51 UTC
  • Revision ID: james.westby@ubuntu.com-20030122150051-uihwkdoxf15mi1tn
Tags: upstream-2.2.2
ImportĀ upstreamĀ versionĀ 2.2.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef NOATUN_CONVERT_H
 
2
#define NOATUN_CONVERT_H
 
3
 
 
4
/**
 
5
 * convert between sample types
 
6
 **/
 
7
namespace Conversion
 
8
{
 
9
/**
 
10
 * Convert a mono 8 bit group to float
 
11
 **/
 
12
void convertMono8ToFloat(unsigned long samples, unsigned char *from, float *to);
 
13
/**
 
14
 * convert a mono 8 bit group to float, at a different speed
 
15
 **/
 
16
void interpolateMono8ToFloat(unsigned long samples, double start, double speed,
 
17
                             unsigned char *from, float *to);
 
18
 
 
19
/**
 
20
 * convert a mono 16 bit little-endian stream to float
 
21
 **/
 
22
void convertMono16leToFloat(unsigned long samples, unsigned char *from, float *to);
 
23
 
 
24
/**
 
25
 * convert a mono 16 bit little-endian stream to float at a different speed
 
26
 **/
 
27
void interpolateMono16leToFloat(unsigned long samples, double startpos, double speed,
 
28
                                unsigned char *from, float *to);
 
29
 
 
30
/**
 
31
 * convert an stereo 8-bit interleaved (Alternating left/right channel) to floats
 
32
 **/
 
33
void convertStereoI8To2Float(unsigned long samples, unsigned char *from,
 
34
                             float *left, float *right);
 
35
 
 
36
/**
 
37
 * convert a stereo 8-bit interleaved (alternating left/right channel) to floats, 
 
38
 * at a different speed
 
39
 **/
 
40
void interpolateStereoI8To2Float(unsigned long samples, double startpos, double speed,
 
41
                                 unsigned char *from, float *left, float *right);
 
42
/**
 
43
 * convert an interleaved 16 bit little endian stream to two floats
 
44
 **/
 
45
void convertStereoI16leTo2Float(unsigned long samples, unsigned char *from, float *left,
 
46
                                float *right);
 
47
 
 
48
/**
 
49
 * convert an interleaved 16 bit little endian stream to two floats at a different
 
50
 * speed
 
51
 **/
 
52
void interpolateStereoI16leTo2Float(unsigned long samples, double startpos, double speed,
 
53
                                    unsigned char *from, float *left, float *right);
 
54
 
 
55
/**
 
56
 * convert a float to a float, but at a different speed
 
57
 **/
 
58
void interpolateMonoFloatToFloat(unsigned long samples, double startpos, double speed,
 
59
                                 float *from, float *to);
 
60
 
 
61
/**
 
62
 * convert a stereo interleaved float to two floats
 
63
 **/
 
64
void convertStereoIFloatTo2Float(unsigned long samples, float *from, float *left,
 
65
                                 float *right);
 
66
 
 
67
/**
 
68
 * convert a stereo interleaved float to two floats at a different speed
 
69
 **/
 
70
void interpolateStereoIFloatTo2Float(unsigned long samples, double startpos,
 
71
                                     double speed, float *from, float *left,
 
72
                                     float *right);
 
73
 
 
74
/**
 
75
 * convert a mono float to a 16 bit little endian float
 
76
 **/
 
77
void convertMonoFloatTo16le(unsigned long samples, float *from, unsigned char *to);
 
78
 
 
79
/**
 
80
 * convert a two floats to a 16 bit little endian interleaved float
 
81
 **/
 
82
void convertStereo2FloatToI16le(unsigned long samples, float *left, float *right,
 
83
                                unsigned char *to);
 
84
 
 
85
/**
 
86
 * convert a mono float to an 8 bit stream
 
87
 **/
 
88
void convertMonoFloatTo8(unsigned long samples, float *from, unsigned char *to);
 
89
 
 
90
/**
 
91
 * convert two floats to an 8 bit interleaved stream
 
92
 **/
 
93
void convertStereo2FloatToI8(unsigned long samples,     float *left, float *right,
 
94
                             unsigned char *to);
 
95
 
 
96
/**
 
97
 * to little endian (Intel) with swapEndian
 
98
 * does nothing if this is an intel
 
99
 **/
 
100
inline void toLittleEndian(unsigned long len, char *buffer);
 
101
 
 
102
/**
 
103
 * to big endian with swapEndian
 
104
 * does nothing if this isn't an intel
 
105
 **/
 
106
inline void toBigEndian(unsigned long len, char *buffer);
 
107
 
 
108
/**
 
109
 * swap the endian, does so on every platform
 
110
 * operates on 16 bits at a time. so loads 16, swaps, and copies them
 
111
 **/
 
112
void swapEndian(unsigned long length, char *buffer);
 
113
 
 
114
 
 
115
}
 
116
 
 
117
 
 
118
#endif
 
119