Index: examples/Makefile.am
===================================================================
--- examples/Makefile.am	(revision 3ba55dd6c0f3995922d87be7bced7e3b19c84871)
+++ examples/Makefile.am	(revision 71482a9a2ec43d413ed4f34a31ff76fead727b63)
@@ -4,6 +4,6 @@
 
 # global flags
-AM_CFLAGS = -DAUBIO_PREFIX=\"$(prefix)\" -I$(top_srcdir)/src -I$(top_srcdir)/ext @LADCCA_CFLAGS@ @FFTWLIB_CFLAGS@
-AM_LDFLAGS = -L$(top_builddir)/src -L$(top_builddir)/ext -laubioext -laubio @LADCCA_LIBS@
+AM_CFLAGS = -DAUBIO_PREFIX=\"$(prefix)\" -I$(top_srcdir)/src -I$(top_srcdir)/ext @LASH_CFLAGS@ @FFTWLIB_CFLAGS@
+AM_LDFLAGS = -L$(top_builddir)/src -L$(top_builddir)/ext -laubioext -laubio @LASH_LIBS@
 #AM_SOURCES = utils.c
 
Index: examples/utils.c
===================================================================
--- examples/utils.c	(revision 3ba55dd6c0f3995922d87be7bced7e3b19c84871)
+++ examples/utils.c	(revision 71482a9a2ec43d413ed4f34a31ff76fead727b63)
@@ -13,9 +13,15 @@
 #include "utils.h"
 
-/* not supported yet */
-#ifdef LADCCA_SUPPORT
-#include <ladcca/ladcca.h>
-cca_client_t * aubio_cca_client;
-#endif /* LADCCA_SUPPORT */
+#ifdef LASH_SUPPORT
+#include <lash/lash.h>
+#include <pthread.h>
+lash_client_t * aubio_lash_client;
+lash_args_t * lash_args;
+void * lash_thread_main (void * data);
+int lash_main (void);
+void save_data (void);
+void restore_data(lash_config_t * config);
+pthread_t lash_thread;
+#endif /* LASH_SUPPORT */
 
 /* settings */
@@ -121,4 +127,7 @@
                 {NULL       , 0, NULL, 0}
         };
+#ifdef LASH_SUPPORT
+        lash_args = lash_extract_args(&argc, &argv);
+#endif /* LASH_SUPPORT */
         prog_name = argv[0];
         if( argc < 1 ) {
@@ -228,4 +237,5 @@
                 }
         }
+
         return 0;
 }
@@ -260,4 +270,21 @@
       fileout = new_aubio_sndfile_wo(file, output_filename);
   }
+#ifdef LASH_SUPPORT
+  else {
+    aubio_lash_client = lash_init(lash_args, argv[0],
+        LASH_Config_Data_Set | LASH_Terminal,
+        LASH_PROTOCOL(2, 0));
+    if (!aubio_lash_client) {
+      fprintf(stderr, "%s: could not initialise lash\n", __FUNCTION__);
+    }
+    /* tell the lash server our client id */
+    if (lash_enabled(aubio_lash_client)) {
+      lash_event_t * event = (lash_event_t *)lash_event_new_with_type(LASH_Client_Name);
+      lash_event_set_string(event, "aubio");
+      lash_send_event(aubio_lash_client, event);
+    }
+  }
+  pthread_create(&lash_thread, NULL, lash_thread_main, NULL);
+#endif /* LASH_SUPPORT */
 
   ibuf      = new_fvec(overlap_size, channels);
@@ -407,2 +434,73 @@
 }
 
+#if LASH_SUPPORT
+
+void * lash_thread_main(void *data)
+{
+	printf("LASH thread running\n");
+
+	while (!lash_main())
+		usleep(1000);
+
+	printf("LASH thread finished\n");
+	return NULL;
+}
+
+int lash_main(void) {
+	lash_event_t *event;
+	lash_config_t *config;
+
+	while ((event = lash_get_event(aubio_lash_client))) {
+		switch (lash_event_get_type(event)) {
+		case LASH_Quit:
+			lash_event_destroy(event);
+      exit(1);
+      return 1;
+		case LASH_Restore_Data_Set:
+			lash_send_event(aubio_lash_client, event);
+			break;
+		case LASH_Save_Data_Set:
+			save_data();
+			lash_send_event(aubio_lash_client, event);
+			break;
+		case LASH_Server_Lost:
+			return 1;
+		default:
+			printf("%s: received unknown LASH event of type %d",
+				   __FUNCTION__, lash_event_get_type(event));
+			lash_event_destroy(event);
+      break;
+		}
+	}
+
+	while ((config = lash_get_config(aubio_lash_client))) {
+		restore_data(config);
+		lash_config_destroy(config);
+	}
+
+	return 0;
+}
+
+void save_data() {
+	lash_config_t *config;
+
+	config = lash_config_new_with_key("threshold");
+	lash_config_set_value_double(config, threshold);
+	lash_send_config(aubio_lash_client, config);
+
+}
+
+void restore_data(lash_config_t * config) {
+	const char *key;
+
+	key = lash_config_get_key(config);
+
+	if (strcmp(key, "threshold") == 0) {
+		threshold = lash_config_get_value_double(config);
+		return;
+	}
+
+}
+
+#endif /* LASH_SUPPORT */
+
