Skip to content

Commit 3a1fdbd

Browse files
committed
updating mac osx itunes native visualizer plugin
1 parent 6f0078b commit 3a1fdbd

File tree

16 files changed

+2991
-1960
lines changed

16 files changed

+2991
-1960
lines changed

src/projectM-iTunes/Makefile.dist

Lines changed: 0 additions & 20 deletions
This file was deleted.
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
//
2+
// File: getConfigFilename.cpp
3+
//
4+
// Author: fatray
5+
//
6+
// Created on 05 December 2007, 23:39
7+
//
8+
// FIXME: portability
9+
10+
11+
// I hacked include<string> on to silence my compiler, is it valid?
12+
#include <string>
13+
#include <cstring>
14+
#include <cstdlib>
15+
#include "getConfigFilename.h"
16+
#include <fcntl.h>
17+
#include <sys/stat.h>
18+
#include <cstdio>
19+
20+
#define PROJECTM_PREFIX ""
21+
22+
// get the full pathname of a configfile
23+
std::string getConfigFilename()
24+
{
25+
char num[512];
26+
FILE *in;
27+
FILE *out;
28+
29+
char* home;
30+
// FIXME: fixed length buffers are not ideal.
31+
char projectM_home[1024];
32+
char projectM_config[1024];
33+
34+
strcpy(projectM_config, PROJECTM_PREFIX);
35+
strcpy(projectM_config + strlen(PROJECTM_PREFIX), CONFIG_FILE);
36+
projectM_config[strlen(PROJECTM_PREFIX) + strlen(CONFIG_FILE)] = '\0';
37+
printf("dir:%s \n", projectM_config);
38+
home = getenv("HOME");
39+
strcpy(projectM_home, home);
40+
strcpy(projectM_home + strlen(home), "/.projectM/config.inp");
41+
projectM_home[strlen(home) + strlen("/.projectM/config.inp")] = '\0';
42+
43+
if ((in = fopen(projectM_home, "r")))
44+
{
45+
printf("reading ~/.projectM/config.inp \n");
46+
fclose(in);
47+
return std::string(projectM_home);
48+
}
49+
50+
printf("trying to create ~/.projectM/config.inp \n");
51+
52+
projectM_home[strlen(home) + strlen("/.projectM")] = '\0';
53+
mkdir(projectM_home, 0755);
54+
55+
strcpy(projectM_home + strlen(home), "/.projectM/config.inp");
56+
projectM_home[strlen(home) + strlen("/.projectM/config.inp")] = '\0';
57+
58+
if((out = fopen(projectM_home, "w")))
59+
{
60+
if ((in = fopen(projectM_config, "r")))
61+
{
62+
while(fgets(num, 80, in)!=NULL)
63+
{
64+
fputs(num, out);
65+
}
66+
fclose(in);
67+
fclose(out);
68+
69+
70+
if ((in = fopen(projectM_home, "r")))
71+
{
72+
printf("created ~/.projectM/config.inp successfully\n");
73+
fclose(in);
74+
return std::string(projectM_home);
75+
}
76+
77+
printf("This shouldn't happen, using implementation defaults\n");
78+
abort();
79+
}
80+
printf("Cannot find projectM default config, using implementation defaults\n");
81+
abort();
82+
}
83+
84+
printf("Cannot create ~/.projectM/config.inp, using default config file\n");
85+
if ((in = fopen(projectM_config, "r")))
86+
{
87+
printf("Successfully opened default config file\n");
88+
fclose(in);
89+
return std::string(projectM_config);
90+
}
91+
92+
printf("Using implementation defaults, your system is really messed up, I'm suprised we even got this far\n");
93+
abort();
94+
}
95+
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//
2+
// File: getConfigFilename.h
3+
//
4+
// Author: fatray
5+
//
6+
// Created on 05 December 2007, 23:39
7+
//
8+
9+
#ifndef _GETCONFIGFILENAME_H
10+
#define _GETCONFIGFILENAME_H
11+
12+
//FIXME: define this here? in .cpp? or somewhere else?
13+
#define CONFIG_FILE "/share/projectM/config.inp"
14+
15+
// get the full pathname of a configfile
16+
std::string getConfigFilename();
17+
18+
#endif /* _GETCONFIGFILENAME_H */
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleDevelopmentRegion</key>
6+
<string>English</string>
7+
<key>CFBundleExecutable</key>
8+
<string>${EXECUTABLE_NAME}</string>
9+
<key>CFBundleIconFile</key>
10+
<string></string>
11+
<key>CFBundleIdentifier</key>
12+
<string>biz.int80.${PRODUCT_NAME:rfc1034identifier}</string>
13+
<key>CFBundleInfoDictionaryVersion</key>
14+
<string>6.0</string>
15+
<key>CFBundleName</key>
16+
<string>${PRODUCT_NAME}</string>
17+
<key>CFBundlePackageType</key>
18+
<string>hvpl</string>
19+
<key>CFBundleShortVersionString</key>
20+
<string>1.0</string>
21+
<key>CFBundleSignature</key>
22+
<string>hook</string>
23+
<key>CFBundleVersion</key>
24+
<string>1</string>
25+
<key>NSHumanReadableCopyright</key>
26+
<string>Copyright © 2013 projectM. All rights reserved.</string>
27+
</dict>
28+
</plist>

0 commit comments

Comments
 (0)