This repository has been archived by the owner on Oct 16, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from nyanpasu64/hires-fft-v2
Hi-res FFT v2
- Loading branch information
Showing
14 changed files
with
1,778 additions
and
1,815 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
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,50 @@ | ||
/* | ||
** FamiTracker - NES/Famicom sound tracker | ||
** Copyright (C) 2005-2014 Jonathan Liss | ||
** | ||
** 0CC-FamiTracker is (C) 2014-2017 HertzDevil | ||
** | ||
** 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 | ||
** Library General Public License for more details. To obtain a | ||
** copy of the GNU Library General Public License, write to the Free | ||
** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
** | ||
** Any permitted reproduction of these routines, in whole or in part, | ||
** must bear this legend. | ||
*/ | ||
|
||
#include "VisualizerBase.h" | ||
|
||
void CVisualizerBase::Create(int Width, int Height) | ||
{ | ||
memset(&m_bmi, 0, sizeof(BITMAPINFO)); | ||
m_bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); | ||
m_bmi.bmiHeader.biBitCount = 32; | ||
m_bmi.bmiHeader.biHeight = -Height; | ||
m_bmi.bmiHeader.biWidth = Width; | ||
m_bmi.bmiHeader.biPlanes = 1; | ||
|
||
m_iWidth = Width; | ||
m_iHeight = Height; | ||
m_pBlitBuffer = std::make_unique<COLORREF[]>(Width * Height); // // // | ||
} | ||
|
||
void CVisualizerBase::SetSampleData(short *pSamples, unsigned int iCount) | ||
{ | ||
m_pSamples = pSamples; | ||
m_iSampleCount = iCount; | ||
} | ||
|
||
void CVisualizerBase::Display(CDC *pDC, bool bPaintMsg) { // // // | ||
StretchDIBits(pDC->m_hDC, | ||
0, 0, m_iWidth, m_iHeight, | ||
0, 0, m_iWidth, m_iHeight, | ||
m_pBlitBuffer.get(), &m_bmi, DIB_RGB_COLORS, SRCCOPY); | ||
} |
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,53 @@ | ||
/* | ||
** FamiTracker - NES/Famicom sound tracker | ||
** Copyright (C) 2005-2014 Jonathan Liss | ||
** | ||
** 0CC-FamiTracker is (C) 2014-2017 HertzDevil | ||
** | ||
** 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 | ||
** Library General Public License for more details. To obtain a | ||
** copy of the GNU Library General Public License, write to the Free | ||
** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
** | ||
** Any permitted reproduction of these routines, in whole or in part, | ||
** must bear this legend. | ||
*/ | ||
|
||
|
||
#pragma once | ||
|
||
#include "stdafx.h" | ||
#include <memory> // // // | ||
|
||
class CVisualizerBase { // // // | ||
public: | ||
virtual ~CVisualizerBase() = default; | ||
|
||
// Create the visualizer | ||
virtual void Create(int Width, int Height); | ||
// Set rate of samples | ||
virtual void SetSampleRate(int SampleRate) = 0; | ||
// Set new sample data | ||
virtual void SetSampleData(short *iSamples, unsigned int iCount); | ||
// Render an image from the sample data | ||
virtual void Draw() = 0; | ||
// Display the image | ||
virtual void Display(CDC *pDC, bool bPaintMsg); // // // | ||
|
||
protected: | ||
BITMAPINFO m_bmi; | ||
std::unique_ptr<COLORREF[]> m_pBlitBuffer; // // // | ||
|
||
int m_iWidth = 0; | ||
int m_iHeight = 0; | ||
|
||
unsigned int m_iSampleCount = 0; | ||
short *m_pSamples = nullptr; | ||
}; |
Oops, something went wrong.