Merge pull request #2 from projectM-visualizer/master

merge from master fork
This commit is contained in:
mbellew
2019-01-03 09:35:35 -08:00
committed by GitHub
7 changed files with 73 additions and 12 deletions

View File

@ -1,4 +1,6 @@
[![Build Status](https://travis-ci.org/projectM-visualizer/projectm.svg?branch=master)](https://travis-ci.org/projectM-visualizer/projectm)
[![Backers on Open Collective](https://opencollective.com/projectm/backers/badge.svg)](#backers)
[![Sponsors on Open Collective](https://opencollective.com/projectm/sponsors/badge.svg)](#sponsors)
![Logo](https://github.com/projectM-visualizer/projectm/raw/master/web/logo.png)
@ -19,6 +21,10 @@ Its purpose in life is to read in audio input and produce mesmerizing visuals, d
### Download
Get it from the [Releases](https://github.com/projectM-visualizer/projectm/releases) tab
### Demo Video
[![](http://img.youtube.com/vi/2dSam8zwSFw/0.jpg)](http://www.youtube.com/watch?v=2dSam8zwSFw "Demo")
### Project Status
You can read more about how it works and the current state of development [here](https://lwn.net/Articles/750152/).
@ -80,6 +86,11 @@ Silverjuke (FOSS Jukebox)
projectM supports OpenGL ES 2 and 3 for embedded systems. Be sure to configure with the `--enable--gles` flag.
### Raspberry Pi (and other embedded systems)
* projectM is arch-independent, although there are some SSE2 enhancements for x86
* [Notes on running on raspberry pi](https://github.com/projectM-visualizer/projectm/issues/115)
# Using the library
At its core projectM is a library, [libprojectM](src/libprojectM). This library is responsible for parsing presets, analyzing audio PCM data with beat detection and FFT, applying the preset to the audio feature data and rendering the resulting output with openGL. It can render to an openGL context or a texture.
@ -117,5 +128,35 @@ If you maintain packages of libprojectM, we are happy to work with you! Please n
## Authors
[Authors](https://github.com/projectM-visualizer/projectm/raw/master/AUTHORS.txt)
## Contributors
This project exists thanks to all the people who contribute.
<a href="https://github.com/projectM-visualizer/projectm/graphs/contributors"><img src="https://opencollective.com/projectm/contributors.svg?width=890&button=false" /></a>
## Backers
Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/projectm#backer)]
<a href="https://opencollective.com/projectm#backers" target="_blank"><img src="https://opencollective.com/projectm/backers.svg?width=890"></a>
## Sponsors
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/projectm#sponsor)]
<a href="https://opencollective.com/projectm/sponsor/0/website" target="_blank"><img src="https://opencollective.com/projectm/sponsor/0/avatar.svg"></a>
<a href="https://opencollective.com/projectm/sponsor/1/website" target="_blank"><img src="https://opencollective.com/projectm/sponsor/1/avatar.svg"></a>
<a href="https://opencollective.com/projectm/sponsor/2/website" target="_blank"><img src="https://opencollective.com/projectm/sponsor/2/avatar.svg"></a>
<a href="https://opencollective.com/projectm/sponsor/3/website" target="_blank"><img src="https://opencollective.com/projectm/sponsor/3/avatar.svg"></a>
<a href="https://opencollective.com/projectm/sponsor/4/website" target="_blank"><img src="https://opencollective.com/projectm/sponsor/4/avatar.svg"></a>
<a href="https://opencollective.com/projectm/sponsor/5/website" target="_blank"><img src="https://opencollective.com/projectm/sponsor/5/avatar.svg"></a>
<a href="https://opencollective.com/projectm/sponsor/6/website" target="_blank"><img src="https://opencollective.com/projectm/sponsor/6/avatar.svg"></a>
<a href="https://opencollective.com/projectm/sponsor/7/website" target="_blank"><img src="https://opencollective.com/projectm/sponsor/7/avatar.svg"></a>
<a href="https://opencollective.com/projectm/sponsor/8/website" target="_blank"><img src="https://opencollective.com/projectm/sponsor/8/avatar.svg"></a>
<a href="https://opencollective.com/projectm/sponsor/9/website" target="_blank"><img src="https://opencollective.com/projectm/sponsor/9/avatar.svg"></a>
## License
[LGPL](https://github.com/projectM-visualizer/projectm/raw/master/LICENSE.txt)

View File

@ -908,7 +908,7 @@
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_OPTIMIZATION_LEVEL = 1;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"USE_THREADS=1",

View File

@ -735,6 +735,13 @@ static void *thread_callback(void *prjm) {
void projectM::switchPreset(const bool hardCut) {
std::string result;
// if we're already switching, promote the current m_activePreset2
// see note in switchPreset() about not having too many presets allocated at once
if (m_activePreset2 != nullptr)
m_activePreset.swap(m_activePreset2);
m_activePreset2 = nullptr;
if (!hardCut) {
result = switchPreset(m_activePreset2);
} else {
@ -803,6 +810,17 @@ std::string projectM::switchPreset(std::unique_ptr<Preset> & targetPreset) {
pthread_mutex_lock(&preset_mutex);
#endif
try {
// NOTE SUBTLE BUG!
// MilkdropPresetFactory acts as if there can only ever be two presets allocated at a time, and so only
// allocates two PresetOutputs objects. However, this is not true. If we are in the middle of a soft transition
// already, we can have three. m_activePreset, m_activePreset2, and the one we are about to allocate()
// to avoid very strange missing objects (waves/shapes), make sure to free the targetPreset BEFORE calling allocate()
// but wait there is more...
// Just because we make sure we never have two presets allocated at once, isn't enough. We actually
// have make sure we release the first allocated preset (or both presets) to make sure we're alternating.
// Otherwise, the two allocated presets may be pointing at the same PresetOutputs object.
// CONSIDER actually allocating or ref-counting PresetOutputs, or allocating more of them or something.
targetPreset = nullptr;
targetPreset = m_presetPos->allocate();
} catch (const PresetFactoryException & e) {
#ifdef SYNC_PRESET_SWITCHES

View File

@ -13,14 +13,14 @@ void initProjectM( VisualPluginData * visualPluginData, std::string presetPath )
// hardcoded settings - disabled
projectM::Settings settings;
settings.meshX = 100;
settings.meshY = 100;
settings.meshX = 140;
settings.meshY = 110;
settings.fps = 60;
settings.textureSize = 2048; // idk?
settings.windowWidth = 1920;
settings.windowHeight = 1280;
settings.smoothPresetDuration = 1; // seconds
settings.presetDuration = 9; // seconds
settings.smoothPresetDuration = 0.5; // seconds
settings.presetDuration = 15; // seconds
settings.beatSensitivity = 3;
settings.aspectCorrection = 1;
settings.easterEgg = 0; // ???

View File

@ -21,9 +21,6 @@
C345215C1BF025A9001707D2 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C345215B1BF025A9001707D2 /* OpenGL.framework */; };
C345215E1BF025CF001707D2 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C345215D1BF025CF001707D2 /* CoreFoundation.framework */; };
C34521651BF025E5001707D2 /* libbz2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C345215F1BF025E5001707D2 /* libbz2.a */; };
C34521661BF025E5001707D2 /* libfreetype.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C34521601BF025E5001707D2 /* libfreetype.a */; };
C34521671BF025E5001707D2 /* libftgl.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C34521611BF025E5001707D2 /* libftgl.a */; };
C34521681BF025E5001707D2 /* libGLEW.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C34521621BF025E5001707D2 /* libGLEW.a */; };
C34521691BF025E5001707D2 /* libpng15.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C34521631BF025E5001707D2 /* libpng15.a */; };
C345216A1BF025E5001707D2 /* libz.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C34521641BF025E5001707D2 /* libz.a */; };
/* End PBXBuildFile section */
@ -185,9 +182,6 @@
C345215E1BF025CF001707D2 /* CoreFoundation.framework in Frameworks */,
C345215C1BF025A9001707D2 /* OpenGL.framework in Frameworks */,
C34521651BF025E5001707D2 /* libbz2.a in Frameworks */,
C34521661BF025E5001707D2 /* libfreetype.a in Frameworks */,
C34521671BF025E5001707D2 /* libftgl.a in Frameworks */,
C34521681BF025E5001707D2 /* libGLEW.a in Frameworks */,
C34521691BF025E5001707D2 /* libpng15.a in Frameworks */,
C345216A1BF025E5001707D2 /* libz.a in Frameworks */,
1612C997207A80A200862A3A /* libprojectM.a in Frameworks */,
@ -425,7 +419,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/bash;
shellScript = "POUT=\"$BUILT_PRODUCTS_DIR\"/\"$CONTENTS_FOLDER_PATH/Resources/presets\"\nPIN=\"$SRCROOT\"/../../presets\n\nmkdir -p \"$POUT\"\nfor preset_dir in \"$PIN/\"*; do\n cp \"$preset_dir/\"* \"$POUT/\"\ndone\necho \"Copied presets to $POUT\"";
shellScript = "POUT=\"$BUILT_PRODUCTS_DIR\"/\"$CONTENTS_FOLDER_PATH/Resources/presets\"\nPIN=\"$SRCROOT\"/../../presets\n\nmkdir -p \"$POUT\"\nfor preset_dir in \"$PIN/\"*; do\n cp \"$preset_dir/\"* \"$POUT/\"\ndone\necho \"Copied presets to $POUT\"\n";
};
168F715D21124CF8001806E7 /* Generate Installer Package */ = {
isa = PBXShellScriptBuildPhase;
@ -595,6 +589,7 @@
MACOSX_DEPLOYMENT_TARGET = 10.11;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = "-DDATADIR_PATH='\"/usr/local/share/projectM\"'";
};
name = Debug;
};
@ -644,6 +639,7 @@
LIBRARY_SEARCH_PATHS = "$(SRCROOT)/../projectM-iTunes/macos/contrib";
MACOSX_DEPLOYMENT_TARGET = 10.11;
MTL_ENABLE_DEBUG_INFO = NO;
OTHER_CFLAGS = "-DDATADIR_PATH='\"/usr/local/share/projectM\"'";
};
name = Release;
};

View File

@ -336,3 +336,7 @@ void projectMSDL::renderTexture() {
glDisable(GL_DEPTH_TEST);
}
void projectMSDL::presetSwitchedEvent(bool isHardCut, size_t index) const {
std::string presetName = getPresetName(index);
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, "Displaying preset: %s\n", presetName.c_str());
}

View File

@ -44,6 +44,8 @@ public:
void maximize();
std::string getActivePresetName();
void addFakePCM();
virtual void presetSwitchedEvent(bool isHardCut, size_t index) const;
private:
SDL_Window *win;