aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/include/interpolate.h1
-rw-r--r--src/include/wavedata.h1
-rw-r--r--src/include/wdatutil.h8
-rw-r--r--src/wavedata.c14
-rw-r--r--src/wavegen.c19
-rw-r--r--src/wdatutil.c7
-rw-r--r--wscript23
7 files changed, 33 insertions, 40 deletions
diff --git a/src/include/interpolate.h b/src/include/interpolate.h
index 304a817..237008c 100644
--- a/src/include/interpolate.h
+++ b/src/include/interpolate.h
@@ -1,7 +1,6 @@
#ifndef blop_interpolate_h
#define blop_interpolate_h
-#include "lv2/lv2plug.in/ns/lv2core/lv2.h"
#include "blop_config.h"
#include "math_func.h"
diff --git a/src/include/wavedata.h b/src/include/wavedata.h
index 9d24823..97b2986 100644
--- a/src/include/wavedata.h
+++ b/src/include/wavedata.h
@@ -20,7 +20,6 @@
#ifndef blop_wavedata_h
#define blop_wavedata_h
-#include "lv2/lv2plug.in/ns/lv2core/lv2.h"
#include "blop_config.h"
#include "math_func.h"
#include "interpolate.h"
diff --git a/src/include/wdatutil.h b/src/include/wdatutil.h
index a084c7a..b87b637 100644
--- a/src/include/wdatutil.h
+++ b/src/include/wdatutil.h
@@ -21,7 +21,7 @@
#define blop_wdatutil_h
#include <stdio.h>
-#include "lv2/lv2plug.in/ns/lv2core/lv2.h"
+#include <stdint.h>
#include "math_func.h"
#include "wavedata.h"
@@ -130,9 +130,9 @@ void wavedata_generate_tables(Wavedata* w,
* Returns: 0 on success
* -1 otherwise
******************************************************************************/
-int wavedata_write(Wavedata* w,
- FILE* wdat_fp,
- char* prefix);
+int wavedata_write(Wavedata* w,
+ FILE* wdat_fp,
+ const char* prefix);
#ifdef __cplusplus
} /* extern "C" { */
diff --git a/src/wavedata.c b/src/wavedata.c
index 24d4c36..e574903 100644
--- a/src/wavedata.c
+++ b/src/wavedata.c
@@ -17,10 +17,6 @@
along with this software. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <dirent.h>
-#include <dlfcn.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -28,6 +24,16 @@
#include "blop_config.h"
#include "wavedata.h"
+#ifdef _WIN32
+# include <windows.h>
+# define dlopen(path, flags) LoadLibrary(path)
+# define dlclose(lib) FreeLibrary((HMODULE)lib)
+# define dlsym(lib, sym) GetProcAddress((HMODULE)lib, sym)
+# define snprintf _snprintf
+#else
+# include <dlfcn.h>
+#endif
+
int
wavedata_load(Wavedata* w,
const char* bundle_path,
diff --git a/src/wavegen.c b/src/wavegen.c
index 53c5db1..c722e04 100644
--- a/src/wavegen.c
+++ b/src/wavegen.c
@@ -17,13 +17,10 @@
along with this software. If not, see <http://www.gnu.org/licenses/>.
*/
-#define _POSIX_C_SOURCE 200809L // strdup
-
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <getopt.h>
-#include "lv2/lv2plug.in/ns/lv2core/lv2.h"
#include "wdatutil.h"
#include "wavedata.h"
#include "common.h"
@@ -99,9 +96,9 @@ main(int argc,
long first_note = -1;
long note_step = -1;
long min_table_size = -1;
- char* filename = NULL;
+ const char* filename = NULL;
FILE* file;
- char* prefix = NULL;
+ const char* prefix = NULL;
float gibbs = 0.0f;
int quiet = 0;
int test = 0;
@@ -154,10 +151,10 @@ main(int argc,
min_table_size = (long)atoi(optarg);
break;
case 'o':
- filename = strdup(optarg);
+ filename = optarg;
break;
case 'p':
- prefix = strdup(optarg);
+ prefix = optarg;
break;
case 'g':
gibbs = atof(optarg);
@@ -307,14 +304,6 @@ main(int argc,
}
}
- if (filename) {
- free(filename);
- }
-
- if (prefix) {
- free(prefix);
- }
-
wavedata_cleanup(w);
return 0;
diff --git a/src/wdatutil.c b/src/wdatutil.c
index 636981b..122feec 100644
--- a/src/wdatutil.c
+++ b/src/wdatutil.c
@@ -20,7 +20,6 @@
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
-#include "lv2/lv2plug.in/ns/lv2core/lv2.h"
#include "common.h"
#include "math_func.h"
#include "wavedata.h"
@@ -243,9 +242,9 @@ wavedata_generate_tables(Wavedata* w,
}
int
-wavedata_write(Wavedata* w,
- FILE* wdat_fp,
- char* data_name)
+wavedata_write(Wavedata* w,
+ FILE* wdat_fp,
+ const char* data_name)
{
Wavetable* t = 0;
unsigned long table_count;
diff --git a/wscript b/wscript
index 1f7200e..024019a 100644
--- a/wscript
+++ b/wscript
@@ -24,7 +24,10 @@ def configure(conf):
autowaf.configure(conf)
autowaf.display_header('Blop.LV2 Configuration')
- conf.env.append_unique('CFLAGS', '-std=c99')
+ if conf.env['MSVC_COMPILER']:
+ conf.env.append_unique('CFLAGS', ['-TP', '-MD'])
+ else:
+ conf.env.append_unique('CFLAGS', '-std=c99')
autowaf.check_pkg(conf, 'lv2', atleast_version='1.0.0', uselib_store='LV2')
@@ -106,8 +109,6 @@ def build(bld):
sync_square
tracker
'''.split()
-# quantiser.so
-# sequencer.so
# Simple (single source file) plugins
for i in plugins:
@@ -144,29 +145,29 @@ def build(bld):
source = ['src/wavegen.c', 'src/wdatutil.c'],
target = 'src/wavegen',
name = 'wavegen',
- after = ['parabola', 'sawtooth', 'square'],
includes = ['.', 'src/include'],
lib = ['m'],
install_path = None)
- penv = bld.env.derive()
- penv['cshlib_PATTERN'] = bld.env['pluginlib_PATTERN']
+ wavegen.post()
- bld.add_group() # Ensure wavegen is built before the following objects
-
- # Waveform data
+ # Waveform data source
for i in ['parabola', 'sawtooth', 'square']:
obj = bld(rule = '${SRC} -r 48000 -f 12 -s 1 -m 128 -g 1.0 -w %s -p %s -o ${TGT}' % (i, i),
- source = bld.path.get_bld().make_node('src/wavegen'),
+ source = wavegen.link_task.outputs[0],
target = 'src/%s_data.c' % i,
name = i)
+ penv = bld.env.derive()
+ penv['cshlib_PATTERN'] = bld.env['pluginlib_PATTERN']
+
obj = bld(features = 'c cshlib',
source = bld.path.get_bld().make_node('src/%s_data.c' % i),
target = 'blop.lv2/%s_data' % i,
includes = ['.', 'src/include'],
env = penv,
- install_path = '${LV2DIR}/blop.lv2')
+ install_path = '${LV2DIR}/blop.lv2',
+ uselib = ['LV2'])
def lint(ctx):
subprocess.call('cpplint.py --filter=+whitespace/comments,-whitespace/tab,-whitespace/braces,-whitespace/labels,-build/header_guard,-readability/casting,-readability/todo,-build/include src/* serd/*', shell=True)