Commit a7f48f35 authored by Jonatan \"jaw\" Wallmander's avatar Jonatan \"jaw\" Wallmander Committed by Rémi Denis-Courmont

Added support for audio visualization: Vovoid VSXu

Signed-off-by: default avatarRémi Denis-Courmont <remi@remlab.net>
parent 9cf66c28
......@@ -3892,6 +3892,23 @@ AS_IF([test "${enable_projectm}" != "no"],
])
])
dnl
dnl Vovoid VSXu visualization plugin
dnl
AC_ARG_ENABLE(vsxu,
[ --enable-vsxu Vovoid VSXu visualization plugin (default auto)])
AS_IF([test "${enable_vsxu}" != "no"],
[
PKG_CHECK_MODULES(VSXU, libvsxu,
[
VLC_ADD_PLUGIN([vsxu])
VLC_ADD_CXXFLAGS([vsxu],[$VSXU_CFLAGS])
VLC_ADD_LIBS([vsxu],[$VSXU_LIBS])
],[
AC_MSG_WARN([${VSXU_PKG_ERRORS}.])
])
])
dnl
dnl AtmoLight (homemade Philips Ambilight clone)
dnl
......
......@@ -368,6 +368,7 @@ $Id$
* vout_ios: iOS video output
* vout_macosx: MacOS X OpenGL provider
* vout_sdl: video output module using the SDL library
* vsxu: audio visualization using Vovoid VSXu
* wall: image wall filter
* wav: Wav demuxer
* wave: Wave video effect
......
SUBDIRS = visual
SOURCES_goom = goom.c
SOURCES_projectm = projectm.cpp
SOURCES_vsxu = vsxu.cpp cyclic_buffer.h
/*****************************************************************************
* cyclic_buffer.h cyclic buffer helper class for vlc's audio visualizations
*****************************************************************************
* Copyright © 2012 Vovoid Media Technologies
*
* Authors: Jonatan "jaw" Wallmander
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef CYCLIC_BUFFER_H
#define CYCLIC_BUFFER_H
class block_holder
{
public:
float data[512]; // data holder
mtime_t pts; // machine time when this is to be played
block_holder()
{
pts = 0; // max_int 64-bit
}
};
#define CYCLIC_BUFFER_SIZE 128
class cyclic_block_queue
{
block_holder cycl_buffer[CYCLIC_BUFFER_SIZE];
size_t consumer_pos;
size_t insertion_pos;
public:
cyclic_block_queue()
{
consumer_pos = 0;
insertion_pos = 0;
}
block_holder* consume()
{
mtime_t cur_machine_time = mdate();
size_t steps = 0;
while (
(cycl_buffer[consumer_pos].pts < cur_machine_time)
&&
(steps++ < CYCLIC_BUFFER_SIZE)
)
{
consumer_pos++;
if (consumer_pos == CYCLIC_BUFFER_SIZE)
{
consumer_pos = 0;
}
}
return &cycl_buffer[consumer_pos];
}
block_holder* get_insertion_object()
{
insertion_pos++;
if ( insertion_pos == CYCLIC_BUFFER_SIZE )
{
insertion_pos = 0;
}
return &cycl_buffer[insertion_pos];
}
void reset()
{
for (size_t i = 0; i < CYCLIC_BUFFER_SIZE; i++)
{
cycl_buffer[i].pts = 0;
consumer_pos = 0;
insertion_pos = 0;
}
}
};
#undef CYCLIC_BUFFER_SIZE
#endif // CYCLIC_BUFFER_H
This diff is collapsed.
......@@ -110,6 +110,13 @@ audio_output_t *aout_New( vlc_object_t * p_parent )
text.psz_string = (char*)"projectM";
var_Change (aout, "visual", VLC_VAR_ADDCHOICE, &val, &text);
}
/* Look for VSXu plugin */
if (module_exists ("vsxu"))
{
val.psz_string = (char *)"vsxu";
text.psz_string = (char*)"Vovoid VSXu";
var_Change (aout, "visual", VLC_VAR_ADDCHOICE, &val, &text);
}
str = var_GetNonEmptyString (aout, "effect-list");
if (str != NULL)
{
......
......@@ -615,18 +615,28 @@ static int VisualizationCallback (vlc_object_t *obj, char const *var,
ChangeFiltersString (obj, "audio-visual", "goom", false);
ChangeFiltersString (obj, "audio-visual", "visual", false);
ChangeFiltersString (obj, "audio-visual", "projectm", false);
ChangeFiltersString (obj, "audio-visual", "vsxu", false);
}
else if (!strcmp ("goom", mode))
{
ChangeFiltersString (obj, "audio-visual", "visual", false );
ChangeFiltersString (obj, "audio-visual", "goom", true );
ChangeFiltersString (obj, "audio-visual", "projectm", false );
ChangeFiltersString (obj, "audio-visual", "vsxu", false);
}
else if (!strcmp ("projectm", mode))
{
ChangeFiltersString (obj, "audio-visual", "visual", false);
ChangeFiltersString (obj, "audio-visual", "goom", false);
ChangeFiltersString (obj, "audio-visual", "projectm", true);
ChangeFiltersString (obj, "audio-visual", "vsxu", false);
}
else if (!strcmp ("vsxu", mode))
{
ChangeFiltersString (obj, "audio-visual", "visual", false);
ChangeFiltersString (obj, "audio-visual", "goom", false);
ChangeFiltersString (obj, "audio-visual", "projectm", false);
ChangeFiltersString (obj, "audio-visual", "vsxu", true);
}
else
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment