aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMemphiz <memphis@machzwo.de>2011-08-25 18:34:24 +0200
committerMemphiz <memphis@machzwo.de>2011-08-29 18:19:03 +0200
commit73b542c86ba3bc34c93278e1b96e51832fa445b1 (patch)
tree7bf6ea647c25f678797078d11862cac9c856f72e
parent0fe75132725be9ffdeb2768d0acf18641daa3eb8 (diff)
[refactor] - refactored GLESSpectrum into OpenGLSpectrum and Waveform viz
-rw-r--r--xbmc/visualizations/OpenGLSpectrum/Makefile.in16
-rw-r--r--xbmc/visualizations/OpenGLSpectrum/opengl_spectrum.cpp226
-rw-r--r--xbmc/visualizations/WaveForm/Main_gles.cpp326
-rw-r--r--xbmc/visualizations/WaveForm/Makefile.in17
4 files changed, 552 insertions, 33 deletions
diff --git a/xbmc/visualizations/OpenGLSpectrum/Makefile.in b/xbmc/visualizations/OpenGLSpectrum/Makefile.in
index f96cb77a62..a70d157cf5 100644
--- a/xbmc/visualizations/OpenGLSpectrum/Makefile.in
+++ b/xbmc/visualizations/OpenGLSpectrum/Makefile.in
@@ -1,18 +1,28 @@
ARCH=@ARCH@
-DEFINES+=-DHAS_SDL_OPENGL -DHAS_SDL
+DEFINES+=-DHAS_SDL
CXXFLAGS=-fPIC
OBJS=opengl_spectrum.o
SLIB=@abs_top_srcdir@/addons/visualization.glspectrum/opengl_spectrum.vis
+ifeq (@ARCH@, arm-osx)
+ OBJS+=../EGLHelpers/Shader.o ../EGLHelpers/GUIShader.o ../../guilib/MatrixGLES.o
+ DEFINES+=-DHAS_GLES
+else
+ DEFINES+=-DHAS_SDL_OPENGL
+endif
+
$(SLIB): $(OBJS)
ifeq ($(findstring osx,$(ARCH)), osx)
+ ifeq (@ARCH@, arm-osx)
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -bundle -undefined dynamic_lookup -read_only_relocs suppress -o $@ $(OBJS) -framework OpenGLES
+ else
$(CXX) $(CXXFLAGS) $(LDFLAGS) -Wl,-alias_list,@abs_top_srcdir@/xbmc/cores/DllLoader/exports/wrapper_mach_alias \
-bundle -undefined dynamic_lookup -read_only_relocs suppress -o $@ \
- @abs_top_srcdir@/xbmc/cores/DllLoader/exports/wrapper.o $(OBJS)
+ @abs_top_srcdir@/xbmc/cores/DllLoader/exports/wrapper.o $(OBJS)
+ endif
else
$(CXX) $(CXXFLAGS) $(LDFLAGS) -shared -g -o $(SLIB) $(OBJS)
endif
include @abs_top_srcdir@/Makefile.include
-
diff --git a/xbmc/visualizations/OpenGLSpectrum/opengl_spectrum.cpp b/xbmc/visualizations/OpenGLSpectrum/opengl_spectrum.cpp
index 9e9a307aee..3ef93ca280 100644
--- a/xbmc/visualizations/OpenGLSpectrum/opengl_spectrum.cpp
+++ b/xbmc/visualizations/OpenGLSpectrum/opengl_spectrum.cpp
@@ -25,23 +25,90 @@
/*
* Ported to XBMC by d4rk
* Also added 'hSpeed' to animate transition between bar heights
+ *
+ * Ported to GLES 2.0 by Gimli
*/
-
#include "addons/include/xbmc_vis_dll.h"
#include <string.h>
#include <math.h>
+
+#if defined(HAS_GLES)
+
+#if defined(__APPLE__)
+#include <OpenGLES/ES2/gl.h>
+#include <OpenGLES/ES2/glext.h>
+#else
+#include <GLES/gl.h>
+#endif//__APPLE__
+
+#include "xbmc/guilib/MatrixGLES.h"
+#include "xbmc/visualizations/EGLHelpers/GUIShader.h"
+
+#ifndef M_PI
+#define M_PI 3.141592654f
+#endif
+#define DEG2RAD(d) ( (d) * M_PI/180.0f )
+
+//OpenGL wrapper - allows us to use same code of functions draw_bars and render
+#define GL_PROJECTION MM_PROJECTION
+#define GL_MODELVIEW MM_MODELVIEW
+
+#define glPushMatrix() g_matrices.PushMatrix()
+#define glPopMatrix() g_matrices.PopMatrix()
+#define glTranslatef(x,y,z) g_matrices.Translatef(x,y,z)
+#define glRotatef(a,x,y,z) g_matrices.Rotatef(DEG2RAD(a),x,y,z)
+#define glPolygonMode(a,b) ;
+#define glBegin(a) m_shader->Enable()
+#define glEnd() m_shader->Disable()
+#define glMatrixMode(a) g_matrices.MatrixMode(a)
+#define glLoadIdentity() g_matrices.LoadIdentity()
+#define glFrustum(a,b,c,d,e,f) g_matrices.Frustum(a,b,c,d,e,f)
+
+GLenum g_mode = GL_TRIANGLES;
+float g_fWaveform[2][512];
+std::string frag = "precision mediump float; \n"
+ "varying lowp vec4 m_colour; \n"
+ "void main () \n"
+ "{ \n"
+ " gl_FragColor = m_colour; \n"
+ "}\n";
+
+std::string vert = "attribute vec4 m_attrpos;\n"
+ "attribute vec4 m_attrcol;\n"
+ "attribute vec4 m_attrcord0;\n"
+ "attribute vec4 m_attrcord1;\n"
+ "varying vec4 m_cord0;\n"
+ "varying vec4 m_cord1;\n"
+ "varying lowp vec4 m_colour;\n"
+ "uniform mat4 m_proj;\n"
+ "uniform mat4 m_model;\n"
+ "void main ()\n"
+ "{\n"
+ " mat4 mvp = m_proj * m_model;\n"
+ " gl_Position = mvp * m_attrpos;\n"
+ " m_colour = m_attrcol;\n"
+ " m_cord0 = m_attrcord0;\n"
+ " m_cord1 = m_attrcord1;\n"
+ "}\n";
+
+CGUIShader *m_shader = NULL;
+
+#elif defined(HAS_SDL_OPENGL)
#include <GL/glew.h>
+GLenum g_mode = GL_FILL;
+#endif
+
#define NUM_BANDS 16
-GLfloat y_angle = 45.0, y_speed = 0.5;
GLfloat x_angle = 20.0, x_speed = 0.0;
+GLfloat y_angle = 45.0, y_speed = 0.5;
GLfloat z_angle = 0.0, z_speed = 0.0;
GLfloat heights[16][16], cHeights[16][16], scale;
GLfloat hSpeed = 0.05;
-GLenum g_mode = GL_FILL;
+#if defined(HAS_SDL_OPENGL)
void draw_rectangle(GLfloat x1, GLfloat y1, GLfloat z1, GLfloat x2, GLfloat y2, GLfloat z2)
{
if(y1 == y2)
@@ -95,20 +162,83 @@ void draw_bar(GLfloat x_offset, GLfloat z_offset, GLfloat height, GLfloat red, G
draw_rectangle(x_offset + width, 0.0, z_offset , x_offset + width, height, z_offset + 0.1);
}
+#elif defined(HAS_GLES)
+
+void draw_bar(GLfloat x_offset, GLfloat z_offset, GLfloat height, GLfloat red, GLfloat green, GLfloat blue )
+{
+ GLfloat col[] = {
+ red * 0.1f, green * 0.1f, blue * 0.1f,
+ red * 0.2f, green * 0.2f, blue * 0.2f,
+ red * 0.3f, green * 0.3f, blue * 0.3f,
+ red * 0.4f, green * 0.4f, blue * 0.4f,
+ red * 0.5f, green * 0.5f, blue * 0.5f,
+ red * 0.6f, green * 0.6f, blue * 0.6f,
+ red * 0.7f, green * 0.7f, blue * 0.7f,
+ red * 0.8f, green * 0.8f, blue *0.8f
+ };
+ GLfloat ver[] = {
+ x_offset + 0.0f, 0.0f, z_offset + 0.0f,
+ x_offset + 0.1f, 0.0f, z_offset + 0.0f,
+ x_offset + 0.1f, 0.0f, z_offset + 0.1f,
+ x_offset + 0.0f, 0.0f, z_offset + 0.1f,
+ x_offset + 0.0f, height, z_offset + 0.0f,
+ x_offset + 0.1f, height, z_offset + 0.0f,
+ x_offset + 0.1f, height, z_offset + 0.1f,
+ x_offset + 0.0f, height, z_offset + 0.1f
+ };
+
+ GLubyte idx[] = {
+ // Bottom
+ 0, 1, 2,
+ 0, 2, 3,
+ // Left
+ 0, 4, 7,
+ 0, 7, 3,
+ // Back
+ 3, 7, 6,
+ 3, 6, 2,
+ // Right
+ 1, 5, 6,
+ 1, 6, 2,
+ // Front
+ 0, 4, 5,
+ 0, 5, 1,
+ // Top
+ 4, 5, 6,
+ 4, 6, 7
+ };
+
+ GLint posLoc = m_shader->GetPosLoc();
+ GLint colLoc = m_shader->GetColLoc();
+
+ glVertexAttribPointer(colLoc, 3, GL_FLOAT, 0, 0, col);
+ glVertexAttribPointer(posLoc, 3, GL_FLOAT, 0, 0, ver);
+
+ glEnableVertexAttribArray(posLoc);
+ glEnableVertexAttribArray(colLoc);
+
+ glDrawElements(g_mode, 36, GL_UNSIGNED_BYTE, idx);
+
+ glDisableVertexAttribArray(posLoc);
+ glDisableVertexAttribArray(colLoc);
+}
+#endif
+
void draw_bars(void)
{
int x,y;
GLfloat x_offset, z_offset, r_base, b_base;
- //glClearColor(0,0,0,0);
glClear(GL_DEPTH_BUFFER_BIT);
glPushMatrix();
glTranslatef(0.0,-0.5,-5.0);
glRotatef(x_angle,1.0,0.0,0.0);
glRotatef(y_angle,0.0,1.0,0.0);
glRotatef(z_angle,0.0,0.0,1.0);
+
glPolygonMode(GL_FRONT_AND_BACK, g_mode);
glBegin(GL_TRIANGLES);
+
for(y = 0; y < 16; y++)
{
z_offset = -1.6 + ((15 - y) * 0.2);
@@ -118,7 +248,7 @@ void draw_bars(void)
for(x = 0; x < 16; x++)
{
- x_offset = -1.6 + (x * 0.2);
+ x_offset = -1.6 + ((float)x * 0.2);
if (::fabs(cHeights[y][x]-heights[y][x])>hSpeed)
{
if (cHeights[y][x]<heights[y][x])
@@ -127,8 +257,8 @@ void draw_bars(void)
cHeights[y][x] -= hSpeed;
}
draw_bar(x_offset, z_offset,
- cHeights[y][x], r_base - (x * (r_base / 15.0)),
- x * (1.0 / 15), b_base);
+ cHeights[y][x], r_base - (float(x) * (r_base / 15.0)),
+ (float)x * (1.0 / 15), b_base);
}
}
glEnd();
@@ -146,6 +276,21 @@ ADDON_STATUS ADDON_Create(void* hdl, void* props)
scale = 1.0 / log(256.0);
+#if defined(HAS_GLES)
+ m_shader = new CGUIShader(vert, frag);
+
+ if(!m_shader)
+ return ADDON_STATUS_UNKNOWN;
+
+ if(!m_shader->CompileAndLink())
+ {
+ delete m_shader;
+ return ADDON_STATUS_UNKNOWN;
+ }
+#endif
+
+ scale = 1.0 / log(256.0);
+
return ADDON_STATUS_NEED_SETTINGS;
}
@@ -309,6 +454,13 @@ extern "C" void ADDON_Stop()
//-----------------------------------------------------------------------------
extern "C" void ADDON_Destroy()
{
+#if defined(HAS_GLES)
+ if(m_shader)
+ {
+ m_shader->Free();
+ delete m_shader;
+ }
+#endif
}
//-- HasSettings --------------------------------------------------------------
@@ -356,26 +508,7 @@ extern "C" ADDON_STATUS ADDON_SetSetting(const char *strSetting, const void* val
if (!strSetting || !value)
return ADDON_STATUS_UNKNOWN;
- if (strcmp(strSetting, "mode")==0)
- {
- switch (*(int*) value)
- {
- case 1:
- g_mode = GL_LINE;
- break;
-
- case 2:
- g_mode = GL_POINT;
- break;
-
- case 0:
- default:
- g_mode = GL_FILL;
- break;
- }
- return ADDON_STATUS_OK;
- }
- else if (strcmp(strSetting, "bar_height")==0)
+ if (strcmp(strSetting, "bar_height")==0)
{
switch (*(int*) value)
{
@@ -429,6 +562,45 @@ extern "C" ADDON_STATUS ADDON_SetSetting(const char *strSetting, const void* val
}
return ADDON_STATUS_OK;
}
+ else if (strcmp(strSetting, "mode")==0)
+ {
+#if defined(HAS_SDL_OPENGL)
+ switch (*(int*) value)
+ {
+ case 1:
+ g_mode = GL_LINE;
+ break;
+
+ case 2:
+ g_mode = GL_POINT;
+ break;
+
+ case 0:
+ default:
+ g_mode = GL_FILL;
+ break;
+ }
+#else
+ switch (*(int*) value)
+ {
+ case 1:
+ g_mode = GL_LINE_LOOP;
+ break;
+
+ case 2:
+ g_mode = GL_LINES; //no points on gles!
+ break;
+
+ case 0:
+ default:
+ g_mode = GL_TRIANGLES;
+ break;
+ }
+
+#endif
+
+ return ADDON_STATUS_OK;
+ }
return ADDON_STATUS_UNKNOWN;
}
diff --git a/xbmc/visualizations/WaveForm/Main_gles.cpp b/xbmc/visualizations/WaveForm/Main_gles.cpp
new file mode 100644
index 0000000000..aa9624f5df
--- /dev/null
+++ b/xbmc/visualizations/WaveForm/Main_gles.cpp
@@ -0,0 +1,326 @@
+/* XMMS - Cross-platform multimedia player
+ * Copyright (C) 1998-2000 Peter Alm, Mikael Alm, Olle Hallnas, Thomas Nilsson and 4Front Technologies
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+/*
+ * Wed May 24 10:49:37 CDT 2000
+ * Fixes to threading/context creation for the nVidia X4 drivers by
+ * Christian Zander <phoenix@minion.de>
+ */
+
+/*
+ * Ported to GLES by gimli
+ */
+
+
+#ifdef HAS_GLES
+
+#include "addons/include/xbmc_vis_dll.h"
+#include <string.h>
+#include <math.h>
+#if defined(__APPLE__)
+#include <OpenGLES/ES2/gl.h>
+#include <OpenGLES/ES2/glext.h>
+#else
+#include <GLES/gl.h>
+#endif
+
+#include "xbmc/guilib/MatrixGLES.h"
+#include "xbmc/visualizations/EGLHelpers/GUIShader.h"
+
+#define NUM_BANDS 16
+
+#ifndef M_PI
+#define M_PI 3.141592654f
+#endif
+#define DEG2RAD(d) ( (d) * M_PI/180.0f )
+
+/*GLfloat x_angle = 20.0f, x_speed = 0.0f;
+GLfloat y_angle = 45.0f, y_speed = 0.5f;
+GLfloat z_angle = 0.0f, z_speed = 0.0f;
+GLfloat heights[16][16], cHeights[16][16], scale;
+GLfloat hSpeed = 0.025f;
+GLenum g_mode = GL_TRIANGLES;
+*/
+float g_fWaveform[2][512];
+
+std::string frag = "precision mediump float; \n"
+ "varying lowp vec4 m_colour; \n"
+ "void main () \n"
+ "{ \n"
+ " gl_FragColor = m_colour; \n"
+ "}\n";
+
+std::string vert = "attribute vec4 m_attrpos;\n"
+ "attribute vec4 m_attrcol;\n"
+ "attribute vec4 m_attrcord0;\n"
+ "attribute vec4 m_attrcord1;\n"
+ "varying vec4 m_cord0;\n"
+ "varying vec4 m_cord1;\n"
+ "varying lowp vec4 m_colour;\n"
+ "uniform mat4 m_proj;\n"
+ "uniform mat4 m_model;\n"
+ "void main ()\n"
+ "{\n"
+ " mat4 mvp = m_proj * m_model;\n"
+ " gl_Position = mvp * m_attrpos;\n"
+ " m_colour = m_attrcol;\n"
+ " m_cord0 = m_attrcord0;\n"
+ " m_cord1 = m_attrcord1;\n"
+ "}\n";
+
+CGUIShader *m_shader = NULL;
+
+//-- Create -------------------------------------------------------------------
+// Called on load. Addon should fully initalize or return error status
+//-----------------------------------------------------------------------------
+ADDON_STATUS ADDON_Create(void* hdl, void* props)
+{
+ if (!props)
+ return ADDON_STATUS_UNKNOWN;
+
+ m_shader = new CGUIShader(vert, frag);
+
+ if(!m_shader)
+ return ADDON_STATUS_UNKNOWN;
+
+ if(!m_shader->CompileAndLink())
+ {
+ delete m_shader;
+ return ADDON_STATUS_UNKNOWN;
+ }
+
+ return ADDON_STATUS_NEED_SETTINGS;
+}
+
+//-- Render -------------------------------------------------------------------
+// Called once per frame. Do all rendering here.
+//-----------------------------------------------------------------------------
+extern "C" void Render()
+{
+ GLfloat col[256][3];
+ GLfloat ver[256][3];
+ GLubyte idx[256];
+
+ glDisable(GL_BLEND);
+
+ g_matrices.MatrixMode(MM_PROJECTION);
+ g_matrices.PushMatrix();
+ g_matrices.LoadIdentity();
+ //g_matrices.Frustum(-1.0f, 1.0f, -1.0f, 1.0f, 1.5f, 10.0f);
+ g_matrices.MatrixMode(MM_MODELVIEW);
+ g_matrices.PushMatrix();
+ g_matrices.LoadIdentity();
+
+ g_matrices.PushMatrix();
+ g_matrices.Translatef(0.0f ,0.0f ,-1.0f);
+ g_matrices.Rotatef(0.0f, 1.0f, 0.0f, 0.0f);
+ g_matrices.Rotatef(0.0f, 0.0f, 1.0f, 0.0f);
+ g_matrices.Rotatef(0.0f, 0.0f, 0.0f, 1.0f);
+
+ m_shader->Enable();
+
+ GLint posLoc = m_shader->GetPosLoc();
+ GLint colLoc = m_shader->GetColLoc();
+
+ glVertexAttribPointer(colLoc, 3, GL_FLOAT, 0, 0, col);
+ glVertexAttribPointer(posLoc, 3, GL_FLOAT, 0, 0, ver);
+
+ glEnableVertexAttribArray(posLoc);
+ glEnableVertexAttribArray(colLoc);
+
+ for (int i = 0; i < 256; i++)
+ {
+ col[i][0] = 128;
+ col[i][1] = 128;
+ col[i][2] = 128;
+ //ver[i][0] = g_viewport.X + ((i / 255.0f) * g_viewport.Width);
+ //ver[i][1] = g_viewport.Y + g_viewport.Height * 0.33f + (g_fWaveform[0][i] * g_viewport.Height * 0.15f);
+ ver[i][0] = -1.0f + ((i / 255.0f) * 2.0f);
+ ver[i][1] = 0.5f + (g_fWaveform[0][i] * 0.000015f);
+ ver[i][2] = 1.0f;
+ idx[i] = i;
+ }
+
+ glDrawElements(GL_LINE_STRIP, 256, GL_UNSIGNED_BYTE, idx);
+
+ // Right channel
+ for (int i = 0; i < 256; i++)
+ {
+ col[i][0] = 128;
+ col[i][1] = 128;
+ col[i][2] = 128;
+ //ver[i][0] = g_viewport.X + ((i / 255.0f) * g_viewport.Width);
+ //ver[i][1] = g_viewport.Y + g_viewport.Height * 0.66f + (g_fWaveform[1][i] * g_viewport.Height * 0.15f);
+ ver[i][0] = -1.0f + ((i / 255.0f) * 2.0f);
+ ver[i][1] = -0.5f + (g_fWaveform[1][i] * 0.000015f);
+ ver[i][2] = 1.0f;
+ idx[i] = i;
+
+ }
+
+ glDrawElements(GL_LINE_STRIP, 256, GL_UNSIGNED_BYTE, idx);
+
+ glDisableVertexAttribArray(posLoc);
+ glDisableVertexAttribArray(colLoc);
+
+ m_shader->Disable();
+
+ g_matrices.PopMatrix();
+
+ g_matrices.PopMatrix();
+ g_matrices.MatrixMode(MM_PROJECTION);
+ g_matrices.PopMatrix();
+
+ glEnable(GL_BLEND);
+
+}
+extern "C" void AudioData(const short* pAudioData, int iAudioDataLength, float *pFreqData, int iFreqDataLength)
+{
+ int ipos=0;
+ while (ipos < 512)
+ {
+ for (int i=0; i < iAudioDataLength; i+=2)
+ {
+ g_fWaveform[0][ipos] = pAudioData[i ]; // left channel
+ g_fWaveform[1][ipos] = pAudioData[i+1]; // right channel
+ ipos++;
+ if (ipos >= 512) break;
+ }
+ }
+}
+
+
+//-- GetInfo ------------------------------------------------------------------
+// Tell XBMC our requirements
+//-----------------------------------------------------------------------------
+extern "C" void GetInfo(VIS_INFO* pInfo)
+{
+ pInfo->bWantsFreq = false;
+ pInfo->iSyncDelay = 0;
+}
+
+
+//-- GetSubModules ------------------------------------------------------------
+// Return any sub modules supported by this vis
+//-----------------------------------------------------------------------------
+extern "C" unsigned int GetSubModules(char ***names)
+{
+ return 0; // this vis supports 0 sub modules
+}
+
+//-- OnAction -----------------------------------------------------------------
+// Handle XBMC actions such as next preset, lock preset, album art changed etc
+//-----------------------------------------------------------------------------
+extern "C" bool OnAction(long flags, const void *param)
+{
+ bool ret = false;
+ return ret;
+}
+
+//-- GetPresets ---------------------------------------------------------------
+// Return a list of presets to XBMC for display
+//-----------------------------------------------------------------------------
+extern "C" unsigned int GetPresets(char ***presets)
+{
+ return 0;
+}
+
+//-- GetPreset ----------------------------------------------------------------
+// Return the index of the current playing preset
+//-----------------------------------------------------------------------------
+extern "C" unsigned GetPreset()
+{
+ return 0;
+}
+
+//-- IsLocked -----------------------------------------------------------------
+// Returns true if this add-on use settings
+//-----------------------------------------------------------------------------
+extern "C" bool IsLocked()
+{
+ return false;
+}
+
+//-- Stop ---------------------------------------------------------------------
+// This dll must cease all runtime activities
+// !!! Add-on master function !!!
+//-----------------------------------------------------------------------------
+extern "C" void ADDON_Stop()
+{
+}
+
+//-- Destroy ------------------------------------------------------------------
+// Do everything before unload of this add-on
+// !!! Add-on master function !!!
+//-----------------------------------------------------------------------------
+extern "C" void ADDON_Destroy()
+{
+ if(m_shader)
+ {
+ m_shader->Free();
+ delete m_shader;
+ }
+}
+
+//-- HasSettings --------------------------------------------------------------
+// Returns true if this add-on use settings
+// !!! Add-on master function !!!
+//-----------------------------------------------------------------------------
+extern "C" bool ADDON_HasSettings()
+{
+ return true;
+}
+
+//-- GetStatus ---------------------------------------------------------------
+// Returns the current Status of this visualisation
+// !!! Add-on master function !!!
+//-----------------------------------------------------------------------------
+extern "C" ADDON_STATUS ADDON_GetStatus()
+{
+ return ADDON_STATUS_OK;
+}
+
+//-- GetSettings --------------------------------------------------------------
+// Return the settings for XBMC to display
+// !!! Add-on master function !!!
+//-----------------------------------------------------------------------------
+extern "C" unsigned int ADDON_GetSettings(ADDON_StructSetting ***sSet)
+{
+ return 0;
+}
+
+//-- FreeSettings --------------------------------------------------------------
+// Free the settings struct passed from XBMC
+// !!! Add-on master function !!!
+//-----------------------------------------------------------------------------
+
+extern "C" void ADDON_FreeSettings()
+{
+}
+
+//-- SetSetting ---------------------------------------------------------------
+// Set a specific Setting value (called from XBMC)
+// !!! Add-on master function !!!
+//-----------------------------------------------------------------------------
+extern "C" ADDON_STATUS ADDON_SetSetting(const char *strSetting, const void* value)
+{
+// return ADDON_STATUS_OK;
+ return ADDON_STATUS_UNKNOWN;
+}
+
+#endif
diff --git a/xbmc/visualizations/WaveForm/Makefile.in b/xbmc/visualizations/WaveForm/Makefile.in
index bf704bc583..d078c8bb17 100644
--- a/xbmc/visualizations/WaveForm/Makefile.in
+++ b/xbmc/visualizations/WaveForm/Makefile.in
@@ -1,15 +1,26 @@
ARCH=@ARCH@
-DEFINES+=-DHAS_SDL_OPENGL -DHAS_SDL
+DEFINES+=-DHAS_SDL
CXXFLAGS=-fPIC
OBJS=Main.o
SLIB=@abs_top_srcdir@/addons/visualization.waveform/Waveform.vis
+ifeq (@ARCH@, arm-osx)
+ OBJS=Main_gles.o ../EGLHelpers/Shader.o ../EGLHelpers/GUIShader.o ../../guilib/MatrixGLES.o
+ DEFINES+=-DHAS_GLES
+else
+ DEFINES+=-DHAS_SDL_OPENGL
+endif
+
$(SLIB): $(OBJS)
ifeq ($(findstring osx,$(ARCH)), osx)
+ ifeq (@ARCH@, arm-osx)
+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -bundle -undefined dynamic_lookup -read_only_relocs suppress -o $@ $(OBJS) -framework OpenGLES
+ else
$(CXX) $(LDFLAGS) -Wl,-alias_list,@abs_top_srcdir@/xbmc/cores/DllLoader/exports/wrapper_mach_alias \
- -bundle -undefined dynamic_lookup -read_only_relocs suppress -o $(SLIB) \
- @abs_top_srcdir@/xbmc/cores/DllLoader/exports/wrapper.o $(OBJS)
+ -bundle -undefined dynamic_lookup -read_only_relocs suppress -o $(SLIB) \
+ @abs_top_srcdir@/xbmc/cores/DllLoader/exports/wrapper.o $(OBJS)
+ endif
else
$(CXX) $(CFLAGS) $(LDFLAGS) -shared -g -o $(SLIB) $(OBJS)
endif