Commit 47f2a72b authored by Adam Honse's avatar Adam Honse

Code cleanup for version 4.0

parent 3fda2ff0
#-------------------------------------------------
#
# Project created by QtCreator 2016-12-18T13:03:22
#
#-------------------------------------------------
QT += core gui
#-----------------------------------------------------------------------#
# Keyboard Visualizer 4.x QMake Project #
# #
# Adam Honse (CalcProgrammer1) 5/15/2020 #
#-----------------------------------------------------------------------#
#-----------------------------------------------------------------------#
# Qt Configuration #
#-----------------------------------------------------------------------#
QT += \
core \
gui \
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = KeyboardVisualizer
TEMPLATE = app
macx: {
LIBS += -framework OpenAL
}
unix:!macx {
LIBS += -lopenal
}
DISTFILES +=
#-----------------------------------------------------------------------#
# Application Configuration #
#-----------------------------------------------------------------------#
TARGET = KeyboardVisualizer
TEMPLATE = app
INCLUDEPATH += \
OpenRGB/ \
OpenRGB/dependencies/libe131/src/ \
OpenRGB/net_port/ \
OpenRGB/RGBController/ \
OpenRGB/qt/ \
#-----------------------------------------------------------------------#
# Keyboard Visualizer #
#-----------------------------------------------------------------------#
HEADERS += \
KeyboardVisualizerCommon/chuck_fft.h \
KeyboardVisualizerCommon/hsv.h \
KeyboardVisualizerCommon/Visualizer.h \
KeyboardVisualizerCommon/VisualizerDefines.h \
KeyboardVisualizerQT/KeyboardVisDlg.h \
SOURCES += \
KeyboardVisualizerCommon/hsv.cpp \
......@@ -35,38 +36,41 @@ SOURCES += \
KeyboardVisualizerQT/KeyboardVisDlg.cpp \
KeyboardVisualizerQT/main.cpp \
# From OpenRGB
SOURCES += \
OpenRGB/NetworkClient.cpp \
OpenRGB/net_port/net_port.cpp \
OpenRGB/RGBController/RGBController.cpp \
OpenRGB/RGBController/RGBController_Network.cpp \
RESOURCES += \
KeyboardVisualizerQT/resources.qrc
HEADERS += \
KeyboardVisualizerCommon/chuck_fft.h \
KeyboardVisualizerCommon/hsv.h \
KeyboardVisualizerCommon/Visualizer.h \
KeyboardVisualizerCommon/VisualizerDefines.h \
KeyboardVisualizerQT/KeyboardVisDlg.h \
FORMS += \
KeyboardVisualizerQT/keyboardvisualizer.ui
RC_ICONS += \
KeyboardVisualizerQT/KeyboardVisualizer.ico
DISTFILES += \
#-----------------------------------------------------------------------#
# OpenRGB SDK #
#-----------------------------------------------------------------------#
INCLUDEPATH += \
OpenRGB/ \
OpenRGB/net_port/ \
OpenRGB/RGBController/ \
# From OpenRGB
HEADERS += \
HEADERS += \
OpenRGB/NetworkClient.h \
OpenRGB/NetworkProtocol.h \
OpenRGB/net_port/net_port.h \
OpenRGB/RGBController/RGBController.h \
OpenRGB/RGBController/RGBController_Network.h \
RESOURCES += \
KeyboardVisualizerQT/resources.qrc
FORMS += \
KeyboardVisualizerQT/keyboardvisualizer.ui
#-----------------------------------------------
# Windows specific project configuration
#-----------------------------------------------
SOURCES += \
OpenRGB/NetworkClient.cpp \
OpenRGB/net_port/net_port.cpp \
OpenRGB/RGBController/RGBController.cpp \
OpenRGB/RGBController/RGBController_Network.cpp \
#-----------------------------------------------------------------------#
# Windows-specific Configuration #
#-----------------------------------------------------------------------#
win32:contains(QMAKE_TARGET.arch, x86_64) {
LIBS += \
-lws2_32 \
......@@ -88,3 +92,17 @@ win32:DEFINES += \
_CRT_SECURE_NO_WARNINGS \
_WINSOCK_DEPRECATED_NO_WARNINGS \
WIN32_LEAN_AND_MEAN
#-----------------------------------------------------------------------#
# Linux-specific Configuration #
#-----------------------------------------------------------------------#
unix:!macx {
LIBS += -lopenal
}
#-----------------------------------------------------------------------#
# MacOS-specific Configuration #
#-----------------------------------------------------------------------#
macx: {
LIBS += -framework OpenAL
}
......@@ -5,24 +5,29 @@
\*---------------------------------------------------------*/
#include "Visualizer.h"
#include <string.h>
#ifndef TRUE
#define TRUE 1
#define FALSE 0
#endif
char * net_string;
int ledstrip_sections_size = 1;
int matrix_setup_pos;
int matrix_setup_size;
float fft_nrml[256];
float fft_fltr[256];
bool ledstrip_mirror_x = false;
bool ledstrip_mirror_y = false;
bool ledstrip_single_color = false;
int ledstrip_rotate_x = 0;
/*---------------------------------------------------------*\
| Global variables |
\*---------------------------------------------------------*/
char * net_string;
int ledstrip_sections_size = 1;
int matrix_setup_pos;
int matrix_setup_size;
float fft_nrml[256];
float fft_fltr[256];
bool ledstrip_mirror_x = false;
bool ledstrip_mirror_y = false;
bool ledstrip_single_color = false;
int ledstrip_rotate_x = 0;
/*---------------------------------------------------------*\
| Visualizer class implementation |
\*---------------------------------------------------------*/
Visualizer::Visualizer()
{
......
......@@ -7,41 +7,51 @@
#ifndef VISUALIZER_H
#define VISUALIZER_H
/*---------------------------------------------------------*\
| C/C++ Standard Library Includes |
\*---------------------------------------------------------*/
#include <math.h>
#include <fstream>
#include <string>
#include <string.h>
#include <vector>
#include <thread>
//Project includes
/*---------------------------------------------------------*\
| Project Includes |
\*---------------------------------------------------------*/
#include "VisualizerDefines.h"
#include "chuck_fft.h"
#include "hsv.h"
#include "net_port.h"
//OpenRGB SDK
/*---------------------------------------------------------*\
| OpenRGB SDK Includes |
\*---------------------------------------------------------*/
#include "OpenRGB.h"
#include "NetworkClient.h"
#include "RGBController.h"
//If building on Windows, use WASAPI
#ifdef WIN32
/*---------------------------------------------------------*\
| Audio Library Includes |
\*---------------------------------------------------------*/
#ifdef _WIN32
#include <mmsystem.h>
#include <mmdeviceapi.h>
#include <audioclient.h>
#include <initguid.h>
#include <mmdeviceapi.h>
#include <functiondiscoverykeys_devpkey.h>
#endif
//If not building on Windows, use OpenAL
#else
#ifdef __APPLE__
#include <OpenAL/al.h>
#include <OpenAL/alc.h>
#else
#ifdef __linux__
#include <AL/al.h>
#include <AL/alc.h>
#endif
#ifdef __APPLE__
#include <OpenAL/al.h>
#include <OpenAL/alc.h>
#endif
typedef struct
......
......@@ -7,16 +7,17 @@
#ifndef VISUALIZER_DEFINES_H
#define VISUALIZER_DEFINES_H
/*---------------------------------------------------------*\
| Project Includes |
\*---------------------------------------------------------*/
#include "RGBController.h"
#ifdef WIN32
#ifndef _WINDOWS_
#endif
#else
//Includes for non-Windows builds
/*---------------------------------------------------------*\
| Define Windows types for non-Windows builds |
\*---------------------------------------------------------*/
#ifndef _WIN32
#include <unistd.h>
//Define Windows types for non-Windows Builds
typedef unsigned int COLORREF;
typedef unsigned char BYTE;
typedef bool boolean;
......
<!DOCTYPE RCC><RCC version="1.0">
<qresource>
<file>Icon.png</file>
</qresource>
<RCC>
<qresource prefix="/">
<file>Icon.png</file>
</qresource>
</RCC>
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