-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Killed off the basic visualizer and added projectM and it's MilkDrop …
…Stuff! Old fft code still there but i will probably kill it
- Loading branch information
Showing
13 changed files
with
200 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#include "MilkDropVisualizer.h" | ||
|
||
#include <projectM.hpp> | ||
|
||
|
||
BEGIN_EVENT_TABLE(MilkDropVisualizer, wxGLCanvas) | ||
EVT_PAINT(MilkDropVisualizer::OnPaint) | ||
EVT_SIZE(MilkDropVisualizer::OnSize) | ||
END_EVENT_TABLE() | ||
|
||
MilkDropVisualizer::MilkDropVisualizer(wxFrame *parent, int *args) : wxGLCanvas(parent, wxID_ANY, args, wxDefaultPosition, wxDefaultSize, wxFULL_REPAINT_ON_RESIZE) | ||
{ | ||
m_context = new wxGLContext(this); | ||
SetMinSize(wxSize(64, 64)); | ||
SetBackgroundStyle(wxBG_STYLE_CUSTOM); | ||
SetCurrent(*m_context); | ||
|
||
//m_projectM = new projectM("projectM/config.inp"); | ||
m_projectM = std::make_unique<projectM>("projectM/config.inp"); | ||
|
||
} | ||
|
||
|
||
MilkDropVisualizer::~MilkDropVisualizer() | ||
{ | ||
//delete m_projectM; | ||
} | ||
|
||
void MilkDropVisualizer::OnPaint(wxPaintEvent &event) | ||
{ | ||
SetCurrent(*m_context); | ||
wxPaintDC(this); | ||
|
||
if (!IsShownOnScreen()) return; | ||
|
||
//glClearColor(1.0f, 0.0f, 1.0f, 0.0f); | ||
//glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); | ||
|
||
m_projectM->renderFrame(); | ||
|
||
SwapBuffers(); | ||
} | ||
|
||
void MilkDropVisualizer::OnSize(wxSizeEvent &event) | ||
{ | ||
Refresh(false); | ||
m_projectM->projectM_resetGL(event.GetSize().x, event.GetSize().y); | ||
} | ||
|
||
void MilkDropVisualizer::updatePCM(short *data) | ||
{ | ||
m_projectM->pcm()->addPCM16Data(data, 512); | ||
Refresh(false); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#pragma once | ||
|
||
#include <wx/wxprec.h> | ||
#ifndef WX_PRECOMP | ||
# include <wx/wx.h> | ||
#endif | ||
|
||
#include <wx/glcanvas.h> | ||
#include <memory> | ||
|
||
class projectM; | ||
|
||
class MilkDropVisualizer : public wxGLCanvas | ||
{ | ||
|
||
public: | ||
MilkDropVisualizer(wxFrame *parent, int *args); | ||
~MilkDropVisualizer(); | ||
void updatePCM(short *data); | ||
|
||
protected: | ||
void OnPaint(wxPaintEvent &event); | ||
void OnSize(wxSizeEvent &event); | ||
|
||
private: | ||
wxGLContext *m_context; | ||
std::unique_ptr<projectM> m_projectM; | ||
//projectM *m_projectM; | ||
DECLARE_EVENT_TABLE() | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.