setting up presets/shaders/config/fonts for osx package install

This commit is contained in:
Mischa S
2013-08-11 22:23:13 -07:00
parent 355d0d9e08
commit 2bf7b2fcba
7 changed files with 373 additions and 19 deletions

View File

@ -34,7 +34,7 @@ class PresetLoader {
~PresetLoader();
/// Load a preset by specifying it's unique identifier given when the preset url
/// Load a preset by specifying its unique identifier given when the preset url
/// was added to this loader
std::auto_ptr<Preset> loadPreset(unsigned int index) const;
std::auto_ptr<Preset> loadPreset ( const std::string & url ) const;

View File

@ -0,0 +1,21 @@
# config.inp
# Configuration File for projectM
Texture Size = 2048 # Size of internal rendering texture
Mesh X = 4 # Width of PerPixel Equation mesh
Mesh Y = 3 # Height of PerPixel Equation mesh
FPS = 60 # Frames Per Second
Fullscreen = false
Window Width = 512 # startup window width
Window Height = 512 # startup window height
Smooth Transition Duration = 5 # in seconds
Preset Duration = 30 # in seconds
Easter Egg Parameter = 1
Hard Cut Sensitivity = 10 # Lower to make hard cuts more frequent
Aspect Correction = true # Custom Shape Aspect Correction
Preset Path = /usr/local/share/projectM/presets # preset location
Title Font = /usr/local/share/projectM/fonts/Vera.ttf
Menu Font = /usr/local/share/projectM/fonts/VeraMono.ttf

View File

@ -18,6 +18,10 @@
C3FAE5A117B88C4B00F4B110 /* libMilkdropPresetFactory.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C3FAE5A017B88C4B00F4B110 /* libMilkdropPresetFactory.a */; };
C3FAE5A317B88C5000F4B110 /* libNativePresetFactory.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C3FAE5A217B88C5000F4B110 /* libNativePresetFactory.a */; };
C3FAE5AA17B898C200F4B110 /* iProjectM-pkg.plist in CopyFiles */ = {isa = PBXBuildFile; fileRef = C3FAE5A717B898B000F4B110 /* iProjectM-pkg.plist */; };
C3FAF97417B89F1C00F4B110 /* presets in CopyFiles */ = {isa = PBXBuildFile; fileRef = C3FAF96717B89C7C00F4B110 /* presets */; };
C3FAF97717B89F7400F4B110 /* shaders in CopyFiles */ = {isa = PBXBuildFile; fileRef = C3FAF97617B89F7200F4B110 /* shaders */; };
C3FAF97817B89F7B00F4B110 /* config.inp in CopyFiles */ = {isa = PBXBuildFile; fileRef = C3FAF97517B89F7200F4B110 /* config.inp */; };
C3FAF97B17B8A45200F4B110 /* fonts in CopyFiles */ = {isa = PBXBuildFile; fileRef = C3FAF97917B8A43B00F4B110 /* fonts */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
@ -31,6 +35,19 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
C3FAF97317B89F1700F4B110 /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = share;
dstSubfolderSpec = 16;
files = (
C3FAF97417B89F1C00F4B110 /* presets in CopyFiles */,
C3FAF97717B89F7400F4B110 /* shaders in CopyFiles */,
C3FAF97B17B8A45200F4B110 /* fonts in CopyFiles */,
C3FAF97817B89F7B00F4B110 /* config.inp in CopyFiles */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
@ -54,6 +71,15 @@
C3FAE5A017B88C4B00F4B110 /* libMilkdropPresetFactory.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libMilkdropPresetFactory.a; path = ../libprojectM/MilkdropPresetFactory/libMilkdropPresetFactory.a; sourceTree = "<group>"; };
C3FAE5A217B88C5000F4B110 /* libNativePresetFactory.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libNativePresetFactory.a; path = ../libprojectM/NativePresetFactory/libNativePresetFactory.a; sourceTree = "<group>"; };
C3FAE5A717B898B000F4B110 /* iProjectM-pkg.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "iProjectM-pkg.plist"; sourceTree = SOURCE_ROOT; };
C3FAF96717B89C7C00F4B110 /* presets */ = {isa = PBXFileReference; lastKnownFileType = folder; name = presets; path = ../../presets; sourceTree = "<group>"; };
C3FAF96817B89C7C00F4B110 /* presets_milkdrop */ = {isa = PBXFileReference; lastKnownFileType = folder; name = presets_milkdrop; path = ../../presets_milkdrop; sourceTree = "<group>"; };
C3FAF96917B89C7C00F4B110 /* presets_milkdrop_104 */ = {isa = PBXFileReference; lastKnownFileType = folder; name = presets_milkdrop_104; path = ../../presets_milkdrop_104; sourceTree = "<group>"; };
C3FAF96A17B89C7C00F4B110 /* presets_milkdrop_200 */ = {isa = PBXFileReference; lastKnownFileType = folder; name = presets_milkdrop_200; path = ../../presets_milkdrop_200; sourceTree = "<group>"; };
C3FAF96B17B89C7C00F4B110 /* presets_projectM */ = {isa = PBXFileReference; lastKnownFileType = folder; name = presets_projectM; path = ../../presets_projectM; sourceTree = "<group>"; };
C3FAF96C17B89C7C00F4B110 /* presets_yin */ = {isa = PBXFileReference; lastKnownFileType = folder; name = presets_yin; path = ../../presets_yin; sourceTree = "<group>"; };
C3FAF97517B89F7200F4B110 /* config.inp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = config.inp; sourceTree = "<group>"; };
C3FAF97617B89F7200F4B110 /* shaders */ = {isa = PBXFileReference; lastKnownFileType = folder; path = shaders; sourceTree = "<group>"; };
C3FAF97917B8A43B00F4B110 /* fonts */ = {isa = PBXFileReference; lastKnownFileType = folder; name = fonts; path = ../../fonts; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@ -76,6 +102,7 @@
C3F9D7A617B82CC3009E58CB = {
isa = PBXGroup;
children = (
C3FAF97A17B8A44100F4B110 /* share */,
C3FAE5A417B88C5B00F4B110 /* libprojectM */,
C3FAE59917B88B9000F4B110 /* iProjectM */,
C3FAE59017B87D8700F4B110 /* getConfigFilename.cpp */,
@ -148,6 +175,30 @@
name = libprojectM;
sourceTree = "<group>";
};
C3FAE5AC17B89C3100F4B110 /* presets */ = {
isa = PBXGroup;
children = (
C3FAF96717B89C7C00F4B110 /* presets */,
C3FAF96817B89C7C00F4B110 /* presets_milkdrop */,
C3FAF96917B89C7C00F4B110 /* presets_milkdrop_104 */,
C3FAF96A17B89C7C00F4B110 /* presets_milkdrop_200 */,
C3FAF96B17B89C7C00F4B110 /* presets_projectM */,
C3FAF96C17B89C7C00F4B110 /* presets_yin */,
);
name = presets;
sourceTree = "<group>";
};
C3FAF97A17B8A44100F4B110 /* share */ = {
isa = PBXGroup;
children = (
C3FAF97917B8A43B00F4B110 /* fonts */,
C3FAF97517B89F7200F4B110 /* config.inp */,
C3FAF97617B89F7200F4B110 /* shaders */,
C3FAE5AC17B89C3100F4B110 /* presets */,
);
name = share;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
@ -157,9 +208,9 @@
buildPhases = (
C3F9D7AB17B82CC3009E58CB /* Sources */,
C3F9D7AC17B82CC3009E58CB /* Frameworks */,
C3F9D7AD17B82CC3009E58CB /* Resources */,
C3FAE5A917B898BB00F4B110 /* CopyFiles */,
C3FAE5AB17B898F800F4B110 /* ShellScript */,
C3FAF97317B89F1700F4B110 /* CopyFiles */,
C3FAE5AB17B898F800F4B110 /* Generate Installer Package */,
);
buildRules = (
);
@ -196,29 +247,20 @@
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
C3F9D7AD17B82CC3009E58CB /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
C3FAE5AB17B898F800F4B110 /* ShellScript */ = {
C3FAE5AB17B898F800F4B110 /* Generate Installer Package */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Generate Installer Package";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/bash;
shellScript = "pkgbuild --component-plist $SRCROOT/iProjectM-pkg.plist --root $DSTROOT $SRCROOT/iProjectM.pkg\n";
shellScript = "mkdir -p $DSTROOT/usr/local/share/projectM\ncp -r $CONFIGURATION_BUILD_DIR/share/* $DSTROOT/usr/local/share/projectM\npkgbuild --component-plist $SRCROOT/iProjectM-pkg.plist --root $DSTROOT $SRCROOT/iProjectM.pkg\n";
};
/* End PBXShellScriptBuildPhase section */

View File

@ -94,7 +94,7 @@ struct VisualPluginData;
#endif
#define kInfoTimeOutInSeconds 10 // draw info/artwork for N seconds when it changes or playback starts
#define kPlayingPulseRateInHz 30 // when iTunes is playing, draw N times a second
#define kPlayingPulseRateInHz 60 // when iTunes is playing, draw N times a second
#define kStoppedPulseRateInHz 5 // when iTunes is not playing, draw N times a second
struct VisualPluginData

View File

@ -8,13 +8,17 @@
// projectM
void initProjectM( VisualPluginData * visualPluginData ) {
std::string config_filename = getConfigFilename();
projectM *pm = new projectM(config_filename);
// std::string config_filename = getConfigFilename();
projectM *pm = new projectM("/usr/local/share/projectM/config.inp");
visualPluginData->pm = pm;
// start off with a random preset
unsigned int playlistSize = pm->getPlaylistSize();
unsigned int index = rand() % playlistSize;
pm->selectPreset(index, false);
}
//-------------------------------------------------------------------------------------------------
// ProcessRenderData
//-------------------------------------------------------------------------------------------------

View File

@ -0,0 +1,151 @@
struct outtype {float4 color : COLOR;};
uniform float4 srctexsize;
outtype blur1(float2 uv : TEXCOORD0, uniform sampler2D sampler_blur : TEX0)
{
float2 uv2 = uv.xy + srctexsize.zw*float2(1,1);
float d=.00175;
float3 val = tex2D(sampler_blur, float2(uv.x-d, uv.y)).xyz;
val += tex2D(sampler_blur, float2(uv.x+d, uv.y)).xyz;
val += tex2D(sampler_blur, float2(uv.x, uv.y + d)).xyz;
val += tex2D(sampler_blur, float2(uv.x, uv.y - d)).xyz;
float3 val2 = tex2D(sampler_blur, float2(uv.x-d, uv.y -d)).xyz;
val += tex2D(sampler_blur, float2(uv.x-d, uv.y +d)).xyz;
val += tex2D(sampler_blur, float2(uv.x+d, uv.y + d)).xyz;
val += tex2D(sampler_blur, float2(uv.x +d, uv.y - d)).xyz;
outtype OUT;
val *= 0.65;
val2 *= 0.35;
OUT.color.xyz = val* 0.25 + val2 * 0.25;
OUT.color.w = 1;
return OUT;
}
outtype blur2(float2 uv : TEXCOORD0, uniform sampler2D sampler_blur : TEX0)
{
float2 uv2 = uv.xy + srctexsize.zw*float2(1,0);
float d = srctexsize.z;
d=.0015;
float3 val = tex2D(sampler_blur, float2(uv.x-d, uv.y)).xyz;
val += tex2D(sampler_blur, float2(uv.x+d, uv.y)).xyz;
val += tex2D(sampler_blur, float2(uv.x, uv.y + d)).xyz;
val += tex2D(sampler_blur, float2(uv.x, uv.y - d)).xyz;
val *= 0.25;
float t = min( min(uv.x, uv.y), 1-max(uv.x,uv.y) );
t = sqrt(t);
float minimum = 0.5;
float variance = 0.5;
float size = 50;
t = minimum + variance*saturate(t*size);
t = 1;
val.xyz *= t;
outtype OUT;
OUT.color.xyz = val;
OUT.color.w = 1;
return OUT;
}
outtype blurHoriz(float2 uv : TEXCOORD0, uniform sampler2D sampler_blur : TEX0)
{
// LONG HORIZ. PASS 1:
const float w[8] = { 4.0, 3.8, 3.5, 2.9, 1.9, 1.2, 0.7, 0.3 };
const float w1 = w[0] + w[1];
const float w2 = w[2] + w[3];
const float w3 = w[4] + w[5];
const float w4 = w[6] + w[7];
const float d1 = 0 + 2*w[1]/w1;
const float d2 = 2 + 2*w[3]/w2;
const float d3 = 4 + 2*w[5]/w3;
const float d4 = 6 + 2*w[7]/w4;
const float w_div = 0.5/(w1+w2+w3+w4);
float fscale = 1;
float fbias = 0;
// note: if you just take one sample at exactly uv.xy, you get an avg of 4 pixels.
//float2 uv2 = uv.xy;// + srctexsize.zw*float2(0.5,0.5);
float2 uv2 = uv.xy + srctexsize.zw*float2(1,1); // + moves blur UP, LEFT by 1-pixel increments
float3 blur =
( tex2D( sampler_blur, uv2 + float2( d1*srctexsize.z,0) ).xyz
+ tex2D( sampler_blur, uv2 + float2(-d1*srctexsize.z,0) ).xyz)*w1 +
( tex2D( sampler_blur, uv2 + float2( d2*srctexsize.z,0) ).xyz
+ tex2D( sampler_blur, uv2 + float2(-d2*srctexsize.z,0) ).xyz)*w2 +
( tex2D( sampler_blur, uv2 + float2( d3*srctexsize.z,0) ).xyz
+ tex2D( sampler_blur, uv2 + float2(-d3*srctexsize.z,0) ).xyz)*w3 +
( tex2D( sampler_blur, uv2 + float2( d4*srctexsize.z,0) ).xyz
+ tex2D( sampler_blur, uv2 + float2(-d4*srctexsize.z,0) ).xyz)*w4
;
blur.xyz *= w_div;
blur.xyz = blur.xyz*fscale + fbias;
outtype OUT;
OUT.color.xyz = blur;
OUT.color.w = 1;
return OUT;
}
outtype blurVert(float2 uv : TEXCOORD0, uniform sampler2D sampler_blur : TEX0)
{
//SHORT VERTICAL PASS 2:
const float w[8] = { 4.0, 3.8, 3.5, 2.9, 1.9, 1.2, 0.7, 0.3 };
const float w1 = w[0]+w[1] + w[2]+w[3];
const float w2 = w[4]+w[5] + w[6]+w[7];
const float d1 = 0 + 2*((w[2]+w[3])/w1);
const float d2 = 2 + 2*((w[6]+w[7])/w2);
const float w_div = 1.0/((w1+w2)*2);
// note: if you just take one sample at exactly uv.xy, you get an avg of 4 pixels.
//float2 uv2 = uv.xy;// + srctexsize.zw*float2(-0.5,-0.5);
float2 uv2 = uv.xy + srctexsize.zw*float2(1,0); // + moves blur UP, LEFT by TWO-pixel increments! (since texture is 1/2 the size of blur1_ps)
float3 blur =
( tex2D( sampler_blur, uv2 + float2(0, d1*srctexsize.w) ).xyz
+ tex2D( sampler_blur, uv2 + float2(0,-d1*srctexsize.w) ).xyz)*w1 +
( tex2D( sampler_blur, uv2 + float2(0, d2*srctexsize.w) ).xyz
+ tex2D( sampler_blur, uv2 + float2(0,-d2*srctexsize.w) ).xyz)*w2
;
blur.xyz *= w_div;
// tone it down at the edges: (only happens on 1st X pass!)
float t = min( min(uv.x, uv.y), 1-max(uv.x,uv.y) );
float minimum = 0.5;
float variance = 0.5;
float size = 50;
blur.xyz *= t;
t = sqrt(t);
t = minimum + variance*saturate(t*size);
t=1;
blur.xyz *= t;
outtype OUT;
OUT.color.xyz = blur;
OUT.color.w = 1;
return OUT;
}

View File

@ -0,0 +1,136 @@
#define M_PI 3.14159265359
#define M_PI_2 6.28318530718
#define M_INV_PI_2 0.159154943091895
#define q1 _qa.x
#define q2 _qa.y
#define q3 _qa.z
#define q4 _qa.w
#define q5 _qb.x
#define q6 _qb.y
#define q7 _qb.z
#define q8 _qb.w
#define q9 _qc.x
#define q10 _qc.y
#define q11 _qc.z
#define q12 _qc.w
#define q13 _qd.x
#define q14 _qd.y
#define q15 _qd.z
#define q16 _qd.w
#define q17 _qe.x
#define q18 _qe.y
#define q19 _qe.z
#define q20 _qe.w
#define q21 _qf.x
#define q22 _qf.y
#define q23 _qf.z
#define q24 _qf.w
#define q25 _qg.x
#define q26 _qg.y
#define q27 _qg.z
#define q28 _qg.w
#define q29 _qh.x
#define q30 _qh.y
#define q31 _qh.z
#define q32 _qh.w
#define lum(x) (dot(x,float3(0.32,0.49,0.29)))
#define tex2d tex2D
#define tex3d tex3D
#define sampler sampler2D
#define getrad sqrt((uv.x-0.5)*2*(uv.x-0.5)*2+(uv.y-0.5)*2*(uv.y-0.5)*2)*.7071067
#define getang atan2(((uv.y-0.5)*2),((uv.x-0.5)*2))
#define GetMain(uv) (tex2D(sampler_main,uv).xyz)
#define GetPixel(uv) (tex2D(sampler_main,uv).xyz)
#define uv_orig uv
uniform sampler2D sampler_main;
uniform sampler2D sampler_fw_main;
uniform sampler2D sampler_pw_main;
uniform sampler2D sampler_fc_main;
uniform sampler2D sampler_pc_main;
uniform sampler2D sampler_noise_lq;
uniform sampler2D sampler_noise_lq_lite;
uniform sampler2D sampler_noise_mq;
uniform sampler2D sampler_noise_hq;
uniform sampler2D sampler_noise_perlin;
uniform sampler3D sampler_noisevol_lq;
uniform sampler3D sampler_noisevol_hq;
uniform sampler2D sampler_blur1;
uniform sampler2D sampler_blur2;
uniform sampler2D sampler_blur3;
float4 texsize_noise_lq;
float4 texsize_noise_mq;
float4 texsize_noise_hq;
float4 texsize_noise_perlin;
float4 texsize_noise_lq_lite;
float4 _qa;
float4 _qb;
float4 _qc;
float4 _qd;
float4 _qe;
float4 _qf;
float4 _qg;
float4 _qh;
float blur1_min;
float blur1_max;
float blur2_min;
float blur2_max;
float blur3_min;
float blur3_max;
#define GetBlur1(uv) (tex2D(sampler_blur1,uv).xyz*blur1_max+blur1_min)
#define GetBlur2(uv) (tex2D(sampler_blur2,uv).xyz*blur2_max+blur2_min)
#define GetBlur3(uv) (tex2D(sampler_blur3,uv).xyz*blur3_max+blur3_min)
float4 slow_roam_cos;
float4 roam_cos;
float4 slow_roam_sin;
float4 roam_sin;
float time;
float4 rand_preset;
float4 rand_frame;
float progress;
float frame;
float fps;
float bass;
float mid;
float treb;
float vol;
float bass_att;
float mid_att;
float treb_att;
float vol_att;
float4 texsize;
float4 aspect;
float max( float a, float b ) {
return (a > b ? a : b);
}
float3 max(float3 a, float4 b) {
return float3( a.x > b.x ? a.x : b.x,
a.y > b.y ? a.y : b.y,
a.z > b.z ? a.z : b.z );
}
float3 max(float3 a, float3 b) {
return float3( a.x > b.x ? a.x : b.x,
a.y > b.y ? a.y : b.y,
a.z > b.z ? a.z : b.z );
}
struct outtype {float4 color : COLOR;};
outtype OUT;
float3 ret;