summaryrefslogtreecommitdiffstats
path: root/kradio3/src/soundformat.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-08-10 22:19:39 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-08-10 22:19:39 +0000
commitde737d3d64188358ea9a7a474e1a6f90b41cb504 (patch)
tree957a6eb156b12c551c2f5e8b70413b8c61e4eec0 /kradio3/src/soundformat.cpp
parent2620ed602b1dc0a7bc3c3135ee12361b1af25405 (diff)
downloadtderadio-de737d3d64188358ea9a7a474e1a6f90b41cb504.tar.gz
tderadio-de737d3d64188358ea9a7a474e1a6f90b41cb504.zip
rename the following methods:
tqparent parent tqmask mask git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kradio@1246260 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kradio3/src/soundformat.cpp')
-rw-r--r--kradio3/src/soundformat.cpp44
1 files changed, 22 insertions, 22 deletions
diff --git a/kradio3/src/soundformat.cpp b/kradio3/src/soundformat.cpp
index 9ca1b5d..50e0c75 100644
--- a/kradio3/src/soundformat.cpp
+++ b/kradio3/src/soundformat.cpp
@@ -87,15 +87,15 @@ int SoundFormat::convertSampleToInt(const char *sample, bool do_scale) const
}
int scale = (sizeof(unsigned) << 3) - m_SampleBits;
- int signtqmask = do_scale ? (!m_IsSigned << ((sizeof(unsigned) << 3) - 1)) :
+ int signmask = do_scale ? (!m_IsSigned << ((sizeof(unsigned) << 3) - 1)) :
(-m_IsSigned << ((size << 3) - 1)) ;
if (do_scale) {
// map to int number space
- return (val << scale) ^ signtqmask;
+ return (val << scale) ^ signmask;
} else {
// do only sign extension
- if (val & signtqmask)
- val |= signtqmask;
+ if (val & signmask)
+ val |= signmask;
return val;
}
}
@@ -105,9 +105,9 @@ void SoundFormat::convertIntToSample(int src, char *dst, bool is_scaled) const
{
int size = sampleSize();
int scale = (sizeof(unsigned) * 8) - m_SampleBits;
- int signtqmask = (!m_IsSigned << (sizeof(unsigned) * 8 - 1));
+ int signmask = (!m_IsSigned << (sizeof(unsigned) * 8 - 1));
- unsigned val = is_scaled ? (src ^ signtqmask) >> scale : src;
+ unsigned val = is_scaled ? (src ^ signmask) >> scale : src;
if (m_Endianess == LITTLE_ENDIAN) {
for (int i = 0; i < size; ++i, ++dst) {
(unsigned char &)*dst = val & 0xFF;
@@ -127,7 +127,7 @@ void SoundFormat::convertSamplesToInts(const char *src, int *dst, size_t n, bool
{
int size = sampleSize();
int scale = (sizeof(unsigned) * 8) - m_SampleBits;
- int signtqmask = do_scale ? (!m_IsSigned << ((sizeof(unsigned) << 3) - 1)) :
+ int signmask = do_scale ? (!m_IsSigned << ((sizeof(unsigned) << 3) - 1)) :
(-m_IsSigned << ((size << 3) - 1)) ;
if (m_Endianess == LITTLE_ENDIAN) {
src = src - 1 + (size * n);
@@ -138,9 +138,9 @@ void SoundFormat::convertSamplesToInts(const char *src, int *dst, size_t n, bool
val = (val << 8) | (unsigned char)*src;
}
if (do_scale) {
- *dst = (val << scale) ^ signtqmask;
- } else if (val & signtqmask) {
- *dst = val | signtqmask;
+ *dst = (val << scale) ^ signmask;
+ } else if (val & signmask) {
+ *dst = val | signmask;
}
}
} else {
@@ -150,9 +150,9 @@ void SoundFormat::convertSamplesToInts(const char *src, int *dst, size_t n, bool
val = (val << 8) | (unsigned char)*src;
}
if (do_scale) {
- *dst = (val << scale) ^ signtqmask;
- } else if (val & signtqmask) {
- *dst = val | signtqmask;
+ *dst = (val << scale) ^ signmask;
+ } else if (val & signmask) {
+ *dst = val | signmask;
}
}
}
@@ -163,11 +163,11 @@ void SoundFormat::convertIntsToSamples(const int *src, char *dst, size_t n, bool
{
int size = sampleSize();
int scale = (sizeof(unsigned) * 8) - m_SampleBits;
- int signtqmask = (!m_IsSigned << (sizeof(unsigned) * 8 - 1));
+ int signmask = (!m_IsSigned << (sizeof(unsigned) * 8 - 1));
if (m_Endianess == LITTLE_ENDIAN) {
for (const int *end = src+n; src < end; ++src) {
- unsigned val = is_scaled ? ((unsigned)(*src ^ signtqmask)) >> scale : *src;
+ unsigned val = is_scaled ? ((unsigned)(*src ^ signmask)) >> scale : *src;
for (int i = 0; i < size; ++i, ++dst) {
(unsigned char &)*dst = val & 0xFF;
val >>= 8;
@@ -177,7 +177,7 @@ void SoundFormat::convertIntsToSamples(const int *src, char *dst, size_t n, bool
dst = dst - 1 + (size * n);
const int *end = src;
for (src = src - 1 + n; src >= end; --src) {
- unsigned val = is_scaled ? ((unsigned)(*src ^ signtqmask)) >> scale : *src;
+ unsigned val = is_scaled ? ((unsigned)(*src ^ signmask)) >> scale : *src;
for (int i = size - 1; i >= 0; --i, --dst) {
(unsigned char &)*dst = val & 0xFF;
val >>= 8;
@@ -192,7 +192,7 @@ void SoundFormat::convertSamplesToFloat(const char *_src, float **_dst, size_t n
int sample_size = sampleSize();
int frame_size = frameSize();
int scale = (sizeof(short) << 3) - m_SampleBits;
- int signtqmask = !m_IsSigned << ((sizeof(short) << 3) - 1);
+ int signmask = !m_IsSigned << ((sizeof(short) << 3) - 1);
int skip = frame_size - sample_size;
if (m_Endianess == LITTLE_ENDIAN) {
@@ -206,7 +206,7 @@ void SoundFormat::convertSamplesToFloat(const char *_src, float **_dst, size_t n
for (int i = sample_size - 1; i >= 0; --i, --src) {
val = (val << 8) | (unsigned char)*src;
}
- *dst = (float)(signed short)((val << scale) ^ signtqmask) / 32768.0f;
+ *dst = (float)(signed short)((val << scale) ^ signmask) / 32768.0f;
src = src - skip;
}
}
@@ -219,7 +219,7 @@ void SoundFormat::convertSamplesToFloat(const char *_src, float **_dst, size_t n
for (int i = 0; i < sample_size; ++i, ++src) {
val = (val << 8) | (unsigned char)*src;
}
- *dst = (float)(signed short)((val << scale) ^ signtqmask) / 32768.0f;
+ *dst = (float)(signed short)((val << scale) ^ signmask) / 32768.0f;
src = src + skip;
}
}
@@ -233,7 +233,7 @@ void SoundFormat::convertFloatsToSamples(const float **_src, char *_dst, size_t
int sample_size = sampleSize();
int frame_size = frameSize();
int scale = (sizeof(short) << 3) - m_SampleBits;
- int signtqmask = (!m_IsSigned << (sizeof(short) << 3) - 1);
+ int signmask = (!m_IsSigned << (sizeof(short) << 3) - 1);
int skip = frame_size - sample_size;
if (m_Endianess == LITTLE_ENDIAN) {
@@ -241,7 +241,7 @@ void SoundFormat::convertFloatsToSamples(const float **_src, char *_dst, size_t
const float *src = _src[ch];
char *dst = _dst + ch * sample_size;
for (const float *end = src+n; src < end; ++src) {
- unsigned val = (( ((unsigned)(*src * 32768.0f)) ^ signtqmask)) >> scale;
+ unsigned val = (( ((unsigned)(*src * 32768.0f)) ^ signmask)) >> scale;
for (int i = 0; i < sample_size; ++i, ++dst) {
(unsigned char &)*dst = val & 0xFF;
val >>= 8;
@@ -256,7 +256,7 @@ void SoundFormat::convertFloatsToSamples(const float **_src, char *_dst, size_t
const float *src = _src[ch];
const float *end = src;
for (src = src - 1 + n; src >= end; --src) {
- unsigned val = (( ((unsigned)(*src * 32768.0f)) ^ signtqmask)) >> scale;
+ unsigned val = (( ((unsigned)(*src * 32768.0f)) ^ signmask)) >> scale;
for (int i = sample_size - 1; i >= 0; --i, --dst) {
(unsigned char &)*dst = val & 0xFF;
val >>= 8;