mirror of
https://github.com/projectM-visualizer/projectm.git
synced 2026-03-01 04:55:03 +00:00
PCM moved out of beatdetect. Only projectM.hpp needs to be included, and even more headers removed from installation
git-svn-id: https://projectm.svn.sourceforge.net/svnroot/projectm/trunk@530 6778bc44-b910-0410-a7a0-be141de4315d
This commit is contained in:
@ -37,9 +37,11 @@
|
||||
#include "PCM.hpp"
|
||||
#include <cmath>
|
||||
|
||||
DLLEXPORT BeatDetect::BeatDetect() {
|
||||
DLLEXPORT BeatDetect::BeatDetect(PCM *pcm) {
|
||||
int x,y;
|
||||
|
||||
this->pcm=pcm;
|
||||
|
||||
this->vol_instant=0;
|
||||
this->vol_history=0;
|
||||
|
||||
@ -71,14 +73,11 @@ DLLEXPORT BeatDetect::BeatDetect() {
|
||||
this->bass_att = 0;
|
||||
this->vol = 0;
|
||||
|
||||
this->pcm = new PCM();
|
||||
|
||||
}
|
||||
|
||||
DLLEXPORT BeatDetect::~BeatDetect() {
|
||||
|
||||
// Free the pcm buffer
|
||||
if (pcm)
|
||||
delete(pcm);
|
||||
DLLEXPORT BeatDetect::~BeatDetect()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -62,7 +62,7 @@ class BeatDetect
|
||||
PCM *pcm;
|
||||
|
||||
/** Methods */
|
||||
DLLEXPORT BeatDetect();
|
||||
DLLEXPORT BeatDetect(PCM *pcm);
|
||||
DLLEXPORT ~BeatDetect();
|
||||
void initBeatDetect();
|
||||
void reset();
|
||||
|
||||
@ -34,5 +34,5 @@ FILE(GLOB fonts "fonts/*.ttf")
|
||||
INSTALL(FILES ${fonts} DESTINATION ${CMAKE_INSTALL_PREFIX}/share/projectM/fonts)
|
||||
INSTALL(FILES "${CMAKE_BINARY_DIR}/libprojectM.pc" DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/pkgconfig)
|
||||
INSTALL(FILES config.inp DESTINATION ${CMAKE_INSTALL_PREFIX}/share/projectM)
|
||||
INSTALL(FILES projectM.hpp BeatDetect.hpp Preset.hpp event.h KeyHandler.hpp dlldefs.h fatal.h PresetFrameIO.hpp PCM.hpp DESTINATION include/libprojectM)
|
||||
INSTALL(FILES projectM.hpp Preset.hpp event.h dlldefs.h fatal.h PresetFrameIO.hpp PCM.hpp DESTINATION include/libprojectM)
|
||||
INSTALL(TARGETS projectM DESTINATION lib)
|
||||
|
||||
@ -81,9 +81,11 @@ projectM::~projectM() {
|
||||
destroyPresetTools();
|
||||
|
||||
if (renderer)
|
||||
delete(renderer);
|
||||
delete(renderer);
|
||||
if (beatDetect)
|
||||
delete(beatDetect);
|
||||
delete(beatDetect);
|
||||
if (pcm)
|
||||
delete(pcm);
|
||||
}
|
||||
|
||||
DLLEXPORT unsigned projectM::initRenderToTexture()
|
||||
@ -350,7 +352,9 @@ void projectM::projectM_reset()
|
||||
this->nohard=fps*5;
|
||||
/** We need to initialise this before the builtin param db otherwise bass/mid etc won't bind correctly */
|
||||
assert(!beatDetect);
|
||||
beatDetect = new BeatDetect();
|
||||
|
||||
pcm = new PCM();
|
||||
beatDetect = new BeatDetect(pcm);
|
||||
|
||||
initPresetTools();
|
||||
#if 0
|
||||
|
||||
@ -66,10 +66,12 @@
|
||||
#include "event.h"
|
||||
#include "fatal.h"
|
||||
#include "PresetFrameIO.hpp"
|
||||
#include "PCM.hpp"
|
||||
|
||||
#include <memory>
|
||||
|
||||
class BeatDetect;
|
||||
class PCM;
|
||||
class Func;
|
||||
class Renderer;
|
||||
class Preset;
|
||||
@ -107,9 +109,8 @@ typedef enum {
|
||||
class projectM
|
||||
{
|
||||
public:
|
||||
|
||||
BeatDetect * beatDetect;
|
||||
|
||||
|
||||
PCM *pcm;
|
||||
|
||||
DLLEXPORT projectM(std::string config_file);
|
||||
DLLEXPORT projectM(int gx, int gy, int fps, int texsize, int width, int height,std::string preset_url,std::string title_fonturl, std::string title_menuurl);
|
||||
@ -124,6 +125,8 @@ public:
|
||||
~projectM();
|
||||
|
||||
private:
|
||||
|
||||
BeatDetect * beatDetect;
|
||||
Renderer *renderer;
|
||||
std::string presetURL;
|
||||
|
||||
|
||||
@ -12,10 +12,7 @@
|
||||
|
||||
#include <config.h>
|
||||
#include <libvisual/libvisual.h>
|
||||
#include <libprojectM/BeatDetect.hpp>
|
||||
#include <libprojectM/PCM.hpp>
|
||||
#include <libprojectM/projectM.hpp>
|
||||
#include <libprojectM/KeyHandler.hpp>
|
||||
#include "lvtoprojectM.h"
|
||||
#include "ConfigFile.h"
|
||||
|
||||
@ -234,7 +231,7 @@ extern "C" int lv_projectm_render (VisPluginData *plugin, VisVideo *video, VisAu
|
||||
addPCM16Data(pcms,512);
|
||||
*/
|
||||
|
||||
priv->PM->beatDetect->pcm->addPCMfloat(*pcm,512);
|
||||
priv->PM->pcm->addPCMfloat(*pcm,512);
|
||||
|
||||
priv->PM->renderFrame();
|
||||
|
||||
|
||||
@ -23,10 +23,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
#include <SDL/SDL.h>
|
||||
#include <libprojectM/BeatDetect.hpp>
|
||||
#include <libprojectM/PCM.hpp>
|
||||
#include <libprojectM/projectM.hpp>
|
||||
#include <libprojectM/KeyHandler.hpp>
|
||||
#include "sdltoprojectM.h"
|
||||
|
||||
#include "ConfigFile.h"
|
||||
|
||||
@ -23,10 +23,9 @@
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
#include <SDL/SDL.h>
|
||||
#include <libprojectM/BeatDetect.hpp>
|
||||
#include <libprojectM/PCM.hpp>
|
||||
|
||||
#include <libprojectM/projectM.hpp>
|
||||
#include <libprojectM/KeyHandler.hpp>
|
||||
|
||||
#include "sdltoprojectM.h"
|
||||
|
||||
#include "ConfigFile.h"
|
||||
|
||||
@ -23,10 +23,9 @@
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
#include <SDL/SDL.h>
|
||||
#include <libprojectM/BeatDetect.hpp>
|
||||
#include <libprojectM/PCM.hpp>
|
||||
|
||||
#include <libprojectM/projectM.hpp>
|
||||
#include <libprojectM/KeyHandler.hpp>
|
||||
|
||||
#include "sdltoprojectM.h"
|
||||
|
||||
#include "ConfigFile.h"
|
||||
|
||||
@ -41,10 +41,8 @@ www.gamedev.net/reference/programming/features/beatdetection/
|
||||
#include <math.h>
|
||||
#include "ConfigFile.h"
|
||||
|
||||
#include <libprojectM/BeatDetect.hpp>
|
||||
#include <libprojectM/PCM.hpp>
|
||||
#include <libprojectM/projectM.hpp>
|
||||
#include <libprojectM/KeyHandler.hpp>
|
||||
|
||||
#include "sdltoprojectM.h"
|
||||
#include "video_init.h"
|
||||
|
||||
@ -329,7 +327,7 @@ extern "C" void projectM_render_pcm(gint16 pcm_data[2][512])
|
||||
{
|
||||
//SDL_mutexP(mutex); while ( SDL_SemValue(sem)==1 )
|
||||
if ( SDL_SemValue(sem)==1 )
|
||||
globalPM->beatDetect->pcm->addPCM16(pcm_data);
|
||||
globalPM->pcm->addPCM16(pcm_data);
|
||||
|
||||
//SDL_mutexV(mutex);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user