naspro

changeset 169:54b611b34083 trunk

Removed useless NDF bridge + a little fix in NASPRO core
author Stefano D'Angelo <zanga.mail@gmail.com>
date Thu Mar 11 05:47:49 2010 +0200 (23 months ago)
parents c7f1f52651be
children cebccb1b4718
files naspro-bridges-bad/Makefile naspro-bridges-bad/dssi/lv2api.c naspro-bridges-bad/ndf/Makefile naspro-bridges-bad/ndf/collection.c naspro-bridges-bad/ndf/collection.h naspro-bridges-bad/ndf/manifest.c naspro-bridges-bad/ndf/manifest.ttl naspro-bridges-bad/ndf/parser.y naspro-bridges-bad/ndf/scanner.l naspro-core/src/manifest.c
line diff
     1.1 --- a/naspro-bridges-bad/Makefile	Sat Sep 12 18:43:25 2009 +0200
     1.2 +++ b/naspro-bridges-bad/Makefile	Thu Mar 11 05:47:49 2010 +0200
     1.3 @@ -5,17 +5,14 @@
     1.4  all:
     1.5  	$(MAKE) ladspa-bridge
     1.6  	$(MAKE) dssi-bridge
     1.7 -	$(MAKE) ndf-bridge
     1.8  
     1.9  install:
    1.10  	$(MAKE) ladspa-bridge-install
    1.11  	$(MAKE) dssi-bridge-install
    1.12 -	$(MAKE) ndf-bridge-install
    1.13  
    1.14  clean:
    1.15  	$(MAKE) ladspa-bridge-clean
    1.16  	$(MAKE) dssi-bridge-clean
    1.17 -	$(MAKE) ndf-bridge-clean
    1.18  
    1.19  ladspa-bridge:
    1.20  	cd ladspa && $(MAKE) && cd ..
    1.21 @@ -34,12 +31,3 @@
    1.22  
    1.23  dssi-bridge-clean:
    1.24  	cd dssi && $(MAKE) clean && cd ..
    1.25 -
    1.26 -ndf-bridge:
    1.27 -	cd ndf && $(MAKE) && cd ..
    1.28 -
    1.29 -ndf-bridge-install:
    1.30 -	cd ndf && $(MAKE) install && cd ..
    1.31 -
    1.32 -ndf-bridge-clean:
    1.33 -	cd ndf && $(MAKE) clean && cd ..
     2.1 --- a/naspro-bridges-bad/dssi/lv2api.c	Sat Sep 12 18:43:25 2009 +0200
     2.2 +++ b/naspro-bridges-bad/dssi/lv2api.c	Thu Mar 11 05:47:49 2010 +0200
     2.3 @@ -212,13 +212,9 @@
     2.4  				break;
     2.5  			  }
     2.6  
     2.7 -#if 0
     2.8 -			if ((alsa_ev.type == SND_SEQ_EVENT_NONE)
     2.9 -			    || (alsa_ev.type == SND_SEQ_EVENT_CONTROLLER)
    2.10 -			    || (alsa_ev.type == SND_SEQ_EVENT_PGMCHANGE)
    2.11 -			    || (alsa_ev.type == SND_SEQ_EVENT_CHANPRESS))
    2.12 +			if ((alsa_ev.type == SND_SEQ_EVENT_CONTROLLER)
    2.13 +			    || (alsa_ev.type == SND_SEQ_EVENT_PGMCHANGE))
    2.14  				continue;
    2.15 -#endif
    2.16  
    2.17  			alsa_ev.time.tick = lv2_ev->frames;
    2.18  
     3.1 --- a/naspro-bridges-bad/ndf/Makefile	Sat Sep 12 18:43:25 2009 +0200
     3.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.3 @@ -1,42 +0,0 @@
     3.4 -.POSIX:
     3.5 -
     3.6 -.SUFFIXES:
     3.7 -
     3.8 -### Change this...
     3.9 -
    3.10 -PREFIX = /usr/local
    3.11 -LIB_DIR = $(PREFIX)/lib
    3.12 -
    3.13 -LV2_DIR = $(LIB_DIR)/lv2
    3.14 -
    3.15 -NDF_BRIDGE_BUNDLE_DIR = $(LV2_DIR)/naspro-ndf.lv2
    3.16 -
    3.17 -CC = gcc
    3.18 -CFLAGS = -O2 -ansi -pedantic -Wall -fPIC
    3.19 -
    3.20 -DL_LDFLAGS = -ldl
    3.21 -LDFLAGS = -shared $(DL_LDFLAGS)
    3.22 -
    3.23 -SO_FILE_EXT = .so
    3.24 -
    3.25 -### ... but not this
    3.26 -
    3.27 -TARGETS = ndf.so
    3.28 -
    3.29 -NDF_BRIDGE_SOURCES = collection.c \
    3.30 -		     collection.h \
    3.31 -		     manifest.c
    3.32 -NDF_BRIDGE_LIBS = -lnacore
    3.33 -
    3.34 -all: $(TARGETS)
    3.35 -
    3.36 -ndf.so: $(NDF_BRIDGE_SOURCES)
    3.37 -	$(CC) $(CFLAGS) $(LDFLAGS) $(NDF_BRIDGE_SOURCES) \
    3.38 -		$(NDF_BRIDGE_LIBS) -o $@
    3.39 -
    3.40 -install: $(TARGETS) manifest.ttl
    3.41 -	mkdir -p $(NDF_BRIDGE_BUNDLE_DIR)
    3.42 -	cp ndf.so manifest.ttl $(NDF_BRIDGE_BUNDLE_DIR)
    3.43 -
    3.44 -clean:
    3.45 -	rm -f $(TARGETS)
     4.1 --- a/naspro-bridges-bad/ndf/collection.c	Sat Sep 12 18:43:25 2009 +0200
     4.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.3 @@ -1,81 +0,0 @@
     4.4 -/*
     4.5 - * NASPRO - NASPRO Architecture for Sound Processing
     4.6 - * NDF (NASPRO Digital Filters)
     4.7 - *
     4.8 - * Copyright (C) 2007-2009  Stefano D'Angelo  <zanga.mail@gmail.com>
     4.9 - *
    4.10 - * See the COPYING file for license conditions.
    4.11 - */
    4.12 -
    4.13 -#include <stdlib.h>
    4.14 -#include <string.h>
    4.15 -
    4.16 -#include <NASPRO/core/lib.h>
    4.17 -
    4.18 -#include "collection.h"
    4.19 -
    4.20 -nacore_avl_tree_t _nandf_collection_desc_tree = NULL;
    4.21 -
    4.22 -static void
    4.23 -load_file(const char *file, const char *basename, void *data)
    4.24 -{
    4.25 -	
    4.26 -}
    4.27 -
    4.28 -static char
    4.29 -ndf_filter(const char *file)
    4.30 -{
    4.31 -	size_t file_len;
    4.32 -
    4.33 -	file_len = strlen(file);
    4.34 -
    4.35 -	if (file_len <= 4)
    4.36 -		return 0;
    4.37 -
    4.38 -	if (file[file_len - 4] != '.')
    4.39 -		return 0;
    4.40 -	if ((file[file_len - 3] != 'n') && (file[file_len - 3] != 'N'))
    4.41 -		return 0;
    4.42 -	if ((file[file_len - 2] != 'd') && (file[file_len - 2] != 'D'))
    4.43 -		return 0;
    4.44 -	if ((file[file_len - 1] != 'f') && (file[file_len - 1] != 'F'))
    4.45 -		return 0;
    4.46 -
    4.47 -	return 1;
    4.48 -}
    4.49 -
    4.50 -char
    4.51 -_nandf_collection_load_all()
    4.52 -{
    4.53 -	char *ndf_path;
    4.54 -
    4.55 -	_nandf_collection_desc_tree = nacore_avl_tree_new(
    4.56 -		nacore_content_cmp_descriptor_by_uri,
    4.57 -		nacore_key_cmp_descriptor_by_uri);
    4.58 -	if (_nandf_collection_desc_tree == NULL)
    4.59 -		return 0;
    4.60 -
    4.61 -	ndf_path = nacore_env_get_var("NDF_PATH");
    4.62 -	if (NACORE_STRING_IS_NULL_OR_EMPTY(ndf_path))
    4.63 -	  {
    4.64 -		/* TODO: This is *nix-only - use XDG_DATA_HOME or
    4.65 -		 *	 XDG_DATA_DIRS */
    4.66 -		nacore_path_home_for_each(".ndf", load_file, ndf_filter, NULL);
    4.67 -		nacore_path_for_each("/usr/local/share/ndf:/usr/share/ndf",
    4.68 -				     load_file, ndf_filter, NULL);
    4.69 -	  }
    4.70 -	else
    4.71 -		nacore_path_for_each(ndf_path, load_file, ndf_filter, NULL);
    4.72 -
    4.73 -	if (ndf_path != NULL)
    4.74 -		nacore_env_free_var_value(ndf_path);
    4.75 -	
    4.76 -	return 1;
    4.77 -}
    4.78 -
    4.79 -void
    4.80 -_nandf_collection_unload_all()
    4.81 -{
    4.82 -	nacore_avl_tree_free(_nandf_collection_desc_tree);
    4.83 -	_nandf_collection_desc_tree = NULL;
    4.84 -}
     5.1 --- a/naspro-bridges-bad/ndf/collection.h	Sat Sep 12 18:43:25 2009 +0200
     5.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.3 @@ -1,20 +0,0 @@
     5.4 -/*
     5.5 - * NASPRO - NASPRO Architecture for Sound Processing
     5.6 - * NDF (NASPRO Digital Filters)
     5.7 - *
     5.8 - * Copyright (C) 2007-2009  Stefano D'Angelo  <zanga.mail@gmail.com>
     5.9 - *
    5.10 - * See the COPYING file for license conditions.
    5.11 - */
    5.12 -
    5.13 -#ifndef _NANDF_COLLECTION_H
    5.14 -#define _NANDF_COLLECTION_H
    5.15 -
    5.16 -#include <NASPRO/core/lib.h>
    5.17 -
    5.18 -char _nandf_collection_load_all();
    5.19 -void _nandf_collection_unload_all();
    5.20 -
    5.21 -nacore_avl_tree_t _nandf_collection_desc_tree;
    5.22 -
    5.23 -#endif /* !_NANDF_COLLECTION_H */
     6.1 --- a/naspro-bridges-bad/ndf/manifest.c	Sat Sep 12 18:43:25 2009 +0200
     6.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.3 @@ -1,71 +0,0 @@
     6.4 -/*
     6.5 - * NASPRO - NASPRO Architecture for Sound Processing
     6.6 - * NDF (NASPRO Digital Filters)
     6.7 - *
     6.8 - * Copyright (C) 2007-2009  Stefano D'Angelo  <zanga.mail@gmail.com>
     6.9 - *
    6.10 - * See the COPYING file for license conditions.
    6.11 - */
    6.12 -
    6.13 -#include <stdio.h>
    6.14 -#include <stddef.h>
    6.15 -
    6.16 -#include <lv2_dyn_manifest.h>
    6.17 -
    6.18 -#include <NASPRO/core/lib.h>
    6.19 -
    6.20 -#include "collection.h"
    6.21 -
    6.22 -/* TODO: Until a serious rescan/automagical discovery policy emerges, we perform
    6.23 - *       discovery only once at initialization time. */
    6.24 -
    6.25 -static char inited = 0;
    6.26 -static char init_ok = 0;
    6.27 -
    6.28 -int
    6.29 -lv2_dyn_manifest_open(LV2_Dyn_Manifest_Handle *handle,
    6.30 -                      const LV2_Feature *const *features)
    6.31 -{
    6.32 -	static char called = 0;
    6.33 -
    6.34 -	if (called)
    6.35 -		return -1;
    6.36 -	called = 1;
    6.37 -	
    6.38 -	if (!inited)
    6.39 -	  {
    6.40 -		init_ok = _nandf_collection_load_all();
    6.41 -		inited = 1;
    6.42 -	  }
    6.43 -
    6.44 -	*handle = NULL;
    6.45 -
    6.46 -	called = 0;
    6.47 -
    6.48 -	return 0;
    6.49 -}
    6.50 -
    6.51 -static void __attribute__((destructor))
    6.52 -fini()
    6.53 -{
    6.54 -	if (init_ok)
    6.55 -		_nandf_collection_unload_all();
    6.56 -}
    6.57 -
    6.58 -int
    6.59 -lv2_dyn_manifest_get_subjects(LV2_Dyn_Manifest_Handle handle, FILE *fp)
    6.60 -{
    6.61 -	return 0;
    6.62 -}
    6.63 -
    6.64 -int
    6.65 -lv2_dyn_manifest_get_data(LV2_Dyn_Manifest_Handle handle, FILE *fp,
    6.66 -			  const char *uri)
    6.67 -{
    6.68 -	return 0;
    6.69 -}
    6.70 -
    6.71 -void
    6.72 -lv2_dyn_manifest_close(LV2_Dyn_Manifest_Handle handle)
    6.73 -{
    6.74 -}
     7.1 --- a/naspro-bridges-bad/ndf/manifest.ttl	Sat Sep 12 18:43:25 2009 +0200
     7.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.3 @@ -1,14 +0,0 @@
     7.4 -#
     7.5 -# NASPRO - NASPRO Architecture for Sound Processing
     7.6 -# NDF (NASPRO Digital Filters)
     7.7 -#
     7.8 -# Copyright (C) 2007-2009  Stefano D'Angelo  <zanga.mail@gmail.com>
     7.9 -#
    7.10 -# See the COPYING file for license conditions.
    7.11 -#
    7.12 -
    7.13 -@prefix lv2:  <http://lv2plug.in/ns/lv2core#>.
    7.14 -@prefix dman: <http://lv2plug.in/ns/ext/dynmanifest#>.
    7.15 -
    7.16 -<http://naspro.atheme.org/ndf> a dman:DynManifest;
    7.17 -	lv2:binary <ndf.so>.
     8.1 --- a/naspro-bridges-bad/ndf/parser.y	Sat Sep 12 18:43:25 2009 +0200
     8.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.3 @@ -1,32 +0,0 @@
     8.4 -%{
     8.5 -static void
     8.6 -yyerror(const char *str)
     8.7 -{
     8.8 -}
     8.9 -
    8.10 -static int
    8.11 -yywrap()
    8.12 -{
    8.13 -	return 1;
    8.14 -}
    8.15 -%}
    8.16 -
    8.17 -%union
    8.18 -  {
    8.19 -	float	f;
    8.20 -  }
    8.21 -
    8.22 -%token IN OUT MONO STEREO COLON SEP
    8.23 -%token <f> FLOAT
    8.24 -
    8.25 -%%
    8.26 -
    8.27 -file:	SEP s2 SEP s3 SEP s4 SEP s5 ;
    8.28 -
    8.29 -s2:	;
    8.30 -
    8.31 -s3:	;
    8.32 -
    8.33 -s4:	;
    8.34 -
    8.35 -s5:	;
     9.1 --- a/naspro-bridges-bad/ndf/scanner.l	Sat Sep 12 18:43:25 2009 +0200
     9.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.3 @@ -1,82 +0,0 @@
     9.4 -/*
     9.5 - * NASPRO - NASPRO Architecture for Sound Processing
     9.6 - * NDF (NASPRO Digital Filters)
     9.7 - *
     9.8 - * Copyright (C) 2007-2009  Stefano D'Angelo  <zanga.mail@gmail.com>
     9.9 - *
    9.10 - * See the COPYING file for license conditions.
    9.11 - */
    9.12 -
    9.13 -%x S1 S2 S3 S4
    9.14 -
    9.15 -NEWLINE (\n|\n\r|\r\n)
    9.16 -
    9.17 -%%
    9.18 -
    9.19 -^NDF0002T/{NEWLINE}				BEGIN S1;
    9.20 -
    9.21 -<S1>uri						return URI;
    9.22 -<S1>name					return NAME;
    9.23 -<S1>creator					return CREATOR;
    9.24 -<S1>rights					return RIGHTS;
    9.25 -<S1>class					return CLASS;
    9.26 -<S1>generator					return GENERATOR;
    9.27 -<S1>instrument					return INSTRUMENT;
    9.28 -<S1>oscillator					return OSCILLATOR;
    9.29 -<S1>utility					return UTILITY;
    9.30 -<S1>converter					return CONVERTER;
    9.31 -<S1>analyser					return ANALYSER;
    9.32 -<S1>simulator					return SIMULATOR;
    9.33 -<S1>delay					return DELAY;
    9.34 -<S1>modulator					return MODULATOR;
    9.35 -<S1>reverb					return REVERB;
    9.36 -<S1>phaser					return PHASER;
    9.37 -<S1>flanger					return FLANGER;
    9.38 -<S1>chorus					return CHORUS;
    9.39 -<S1>filter					return FILTER;
    9.40 -<S1>lowpass					return LOWPASS;
    9.41 -<S1>bandpass					return BANDPASS;
    9.42 -<S1>highpass					return HIGHPASS;
    9.43 -<S1>comb					return COMB;
    9.44 -<S1>allpass					return ALLPASS;
    9.45 -<S1>eq						return EQ;
    9.46 -<S1>paraeq					return PARAEQ;
    9.47 -<S1>multieq					return MULTIEQ;
    9.48 -<S1>spectral					return SPECTRAL;
    9.49 -<S1>pitch					return PITCH;
    9.50 -<S1>amplifier					return AMPLIFIER;
    9.51 -<S1>distortion					return DISTORTION;
    9.52 -<S1>waveshaper					return WAVESHAPER;
    9.53 -<S1>dynamics					return DYNAMICS;
    9.54 -<S1>compressor					return COMPRESSOR;
    9.55 -<S1>expander					return EXPANDER;
    9.56 -<S1>limiter					return LIMITER;
    9.57 -<S1>gate					return GATE;
    9.58 -
    9.59 -<S1>^"%%"/{NEWLINE}				BEGIN S2; return SEP;
    9.60 -
    9.61 -<S2>audio					return AUDIO;
    9.62 -<S2>control					return CONTROL;
    9.63 -<S2>in						return IN;
    9.64 -<S2>out						return OUT;
    9.65 -<S2>as						return AS;
    9.66 -<S2>to						return TO;
    9.67 -<S2>default					return DEFAULT;
    9.68 -<S2>minimum					return MINIMUM;
    9.69 -<S2>maximum					return MAXIMUM;
    9.70 -
    9.71 -<S2>^"%%"/{NEWLINE}				BEGIN S3; return SEP;
    9.72 -
    9.73 -<S3>include					return INCLUDE;
    9.74 -<S3>sample_rate					return SAMPLE_RATE;
    9.75 -
    9.76 -<S1,S2>\"([:print:]{-}[{NEWLINE}]|\\\")*\"	return STRING;
    9.77 -<S2,S3>,					return COMA;
    9.78 -<S1,S2>:					return COLON;
    9.79 -<S1,S2,S3>;					return SEMICOLON;
    9.80 -<S1,S2,S3>[_a-zA-Z][_0-9a-zA-Z]*		return IDENTIFIER;
    9.81 -
    9.82 -<S3>\(						return LPAR;
    9.83 -<S3>\)						return RPAR;
    9.84 -<S3>\{						return LBRACE;
    9.85 -<S3>\}						return RBRACE;
    10.1 --- a/naspro-core/src/manifest.c	Sat Sep 12 18:43:25 2009 +0200
    10.2 +++ b/naspro-core/src/manifest.c	Thu Mar 11 05:47:49 2010 +0200
    10.3 @@ -198,8 +198,8 @@
    10.4  	fprintf(fp, "\tdoap:name \"");
    10.5  	print_escaped_string(fp, desc->name);
    10.6  	fprintf(fp, "\" ;\n");
    10.7 -	fprintf(fp, "\tdoap:license \"%s\" ;\n",
    10.8 -		"http://usefulinc.com/doap/licenses/unknown");
    10.9 +	fprintf(fp, "\tdoap:license "
   10.10 +		"<http://usefulinc.com/doap/licenses/unknown> ;\n");
   10.11  	if (desc->creator != NULL)
   10.12  	  {
   10.13  		fprintf(fp, "\tdc:creator \"");