Hi all,
I managed to get the patch compiling. Spectrum analyzer does not work, there is a code change which I have no idea how to adapt.
One variable was a short and is now a float.
What does work are the small icons and the spinning disc, so everything but the spectrum analyzer. Spectrum Analyzer leads to a segfault.
Patch for current xbmc-nightly ubuntu ppa (git201211252059~23d85ee) can be found here:
http://files.coolinger.net/imon.patch
Perhaps someone can have a look at the code and fix it...
The problem should be this part:
xbmc/linux/XLCDproc.cpp:
Code:
void XLCDproc::SetSpectrumAnalyzerAudioData(const float* psAudioData,
int piAudioDataLength, float *pfFreqData, int piFreqDataLength)
{
unsigned int i = 0;
int c = 0, y = 0;
float val;
int* xscale;
// scaling for the spectrum analyzer
if (m_iColumns == 16)
{
// for 16 char-displays
int scales[] =
{ 0, 1, 2, 3, 5, 7, 10, 14, 20, 28, 40, 54, 74, 101, 137, 187, 255 };
xscale = scales;
}
else //if (m_iColumns == 20)
{
// for 20 char-displays
int scales[] =
{ 0, 1, 3, 5, 9, 13, 19, 26, 34, 43, 53, 64, 76, 89, 105, 120, 140, 160,
187, 220, 255 };
xscale = scales;
}
// CLog::Log(LOGINFO, "XLCDproc::%s", __FUNCTION__);
for (i = 0; i < m_iColumns; i++)
{
for (c = xscale[i], y = 0; c < xscale[i + 1]; c++)
{
if (c < piAudioDataLength)
{
if(psAudioData[c] * 255.0 > y)
y = (int) (psAudioData[c] * 255.0);
}
else
continue;
}
y >>= 7;
if (y > 0)
val = (logf(y) * scale);
else
val = 0;
if (audioDataBeforeDisplaying == 1)
heights[i] = val;
else
heights[i] += val;
// CLog::Log(LOGINFO, "XLCDproc::%s y=%d f%f, i=%d", __FUNCTION__, y, heights[i], i);
}
audioDataBeforeDisplaying++;
}
I had to change psAudioData from short to float, and did only that.
Greetings Coolinger