Please join the remix-devel mailing list, linked from the homepage.
-libremix is maintained in Subversion with anonymous read access. You can
-check out the most current version of libremix from:
+libremix is maintained in Git at Github:
-svn co http://svn.metadecks.org/libremix/trunk libremix
+https://github.com/kfish/remix
A list of outstanding tasks is maintained in the TODO file of this source
distribution. When implementing anything listed in this file, please update
Copyrights
----------
-Copyright (C) 2000-2010 Conrad Parker <conrad@metadecks.org>
+Copyright (C) 2000-2011 Conrad Parker <conrad@metadecks.org>
Copyright (C) 2001, 2002 Commonwealth Scientific and Industrial Research
Organisation (CSIRO), Australia.
dnl Process this file with autoconf to produce a configure script.
AC_INIT(src/libremix/remix_base.c)
-AM_INIT_AUTOMAKE(remix, 0.2.3)
+AM_INIT_AUTOMAKE(remix, 0.2.4)
AM_CONFIG_HEADER(config.h)
+example_programs="noisedemo squaredemo"
+
+################################################################################
+# Set the shared versioning info, according to section 6.3 of the libtool info #
+# pages. CURRENT:REVISION:AGE must be updated immediately before each release: #
+# #
+# * If the library source code has changed at all since the last #
+# update, then increment REVISION (`C:R:A' becomes `C:r+1:A'). #
+# #
+# * If any interfaces have been added, removed, or changed since the #
+# last update, increment CURRENT, and set REVISION to 0. #
+# #
+# * If any interfaces have been added since the last public release, #
+# then increment AGE. #
+# #
+# * If any interfaces have been removed since the last public release, #
+# then set AGE to 0. #
+# #
+################################################################################
+SHARED_VERSION_INFO="1:0:1"
+SHLIB_VERSION_ARG=""
+
dnl Checks for programs.
AM_PROG_LIBTOOL
AC_PROG_INSTALL
dnl Detect libsndfile 1.0
dnl
+
PKG_CHECK_MODULES(SNDFILE, sndfile >= 1.0.0,
HAVE_LIBSNDFILE1="yes", HAVE_LIBSNDFILE1="no")
-AC_SUBST(SNDFILE_LIBS)
-AC_SUBST(SNDFILE_CFLAGS)
-
if test "$HAVE_LIBSNDFILE1" = "yes" ; then
AC_DEFINE([HAVE_LIBSNDFILE1], [], [Define if libsndfile version 1 found])
AC_SUBST(SNDFILE_LIBS)
AC_SUBST(SNDFILE_CFLAGS)
+ example_programs="${example_programs} sndfiledemo"
else
AC_CHECK_LIB(sndfile, sf_open, HAVE_LIBSNDFILE1="maybe")
if test "$HAVE_LIBSNDFILE1" = "maybe" ; then
AC_HELP_STRING([--enable-gcc-werror], [enable -Werror in all Makefiles]))
dnl Use -Wall if we have gcc.
-
if test "x$ac_cv_prog_gcc" = xyes ; then
CFLAGS="$CFLAGS -Wall"
fi
+AC_SUBST(SHLIB_VERSION_ARG)
+AC_SUBST(SHARED_VERSION_INFO)
+
AC_OUTPUT([
Makefile
doc/Makefile
+libremix (0.2.4) unstable; urgency=low
+
+ * Merge with svn version 0.2.4 and whitespace removed.
+ * Git: slp/pkgs/l/libremix
+ * Tag: 0.2.4
+
+ -- Prince Kumar Dubey <prince.dubey@samsung.com> Thu, 19 Jan 2012 18:38:00 +0530
+
libremix (0.2.3) unstable; urgency=low
* Initial Version.
+ * Git: slp/pkgs/l/libremix
+ * Tag: 0.2.3
-- Prince Kumar Dubey <prince.dubey@samsung.com> Govindaraju S M <govi.sm@samsung.com> Tue, 20 Sep 2011 15:00:00 +0900
\ No newline at end of file
Uploaders: Prince Kumar Dubey<prince.dubey@samsung.com> Govindaraju S M<govi.sm@samsung.com>
Maintainer: Conrad Parker <conrad@metadecks.org>
Build-Depends: cdbs, libsndfile1-dev, libsndfile1, pkg-config, libtool
-Standards-Version: 0.2.3
+Standards-Version: 0.2.4
Homepage: http://www.metadecks.org/software/remix/
Package: libremix
EXTRA_DIST = Doxyfile.in
-doc_DATA = doxygen-build.stamp
+noinst_DATA = doxygen-build.stamp
if HAVE_DOXYGEN
doxygen-build.stamp: Doxyfile $(top_srcdir)/include/remix/*.h
if test -d libremix; then \
mkdir $(dist_docdir); \
for dir in libremix/*; do \
- if test -d $$dir; then \
- b=`basename $$dir`; \
- mkdir $(dist_docdir)/$$b; \
- for f in $$dir/*; do \
- cp -p $$f $(dist_docdir)/$$b; \
- done \
- fi \
- done \
+ b=`basename $$dir`; \
+ if test $$b != "CVS"; then \
+ if test -d $$dir; then \
+ mkdir $(dist_docdir)/$$b; \
+ for f in $$dir/*; do \
+ cp -p $$f $(dist_docdir)/$$b; \
+ done \
+ fi \
+ fi \
+ done \
fi
install-data-local: doxygen-build.stamp
- $(mkinstalldirs) $(docdir)
+ $(mkinstalldirs) $(DESTDIR)$(docdir)
if test -d libremix; then \
for dir in libremix/*; do \
if test -d $$dir; then \
b=`basename $$dir`; \
- $(mkinstalldirs) $(docdir)/$$b; \
+ $(mkinstalldirs) $(DESTDIR)$(docdir)/$$b; \
for f in $$dir/*; do \
- $(INSTALL_DATA) $$f $(docdir)/$$b; \
- done \
+ $(INSTALL_DATA) $$f $(DESTDIR)$(docdir)/$$b; \
+ done \
fi \
done \
fi
uninstall-local:
- rm -rf $(docdir)
+ rm -rf $(DESTDIR)$(docdir)
clean-local:
if test -d libremix; then rm -rf libremix; fi
CDSet * remix_set_channels (RemixEnv * env, CDSet * channelset);
CDSet * remix_get_channels (RemixEnv * env);
+#if 0
+ /* XXX */
+/* Sources: Plugins, Samples etc. */
+CDList * remix_open (SOUNDRENDER env, char * filename);
+void remix_close (SOUNDRENDER env, RemixPlugin plugin);
+#endif
+
/* Base objects */
RemixPlugin * remix_find_plugin (RemixEnv * env, char * identifier);
typedef struct _RemixChunk RemixChunk;
-typedef struct _Remix_Sound_Data Remix_Sound_Data;
-
#if defined (__REMIX__)
#include "remix_private.h"
#else
#define REMIX_COUNT_MIN LONG_MIN
#define REMIX_COUNT_INFINITE REMIX_COUNT_MAX
-//TODO xxx : Change this
-typedef struct _RemixOpaque RemixOpaque;
+typedef void RemixOpaque;
#if defined (__REMIX__)
typedef struct _RemixBase RemixBase;
typedef RemixOpaque RemixBase;
#endif
-//TODO xxx : Change this
-struct _RemixOpaque {
- void * instance_data;
-};
-
typedef CDScalar RemixParameter;
typedef int RemixFlags;
#define REMIX_HINT_LOG (1<<0)
#define REMIX_HINT_TIME (1<<1)
#define REMIX_HINT_FILENAME (1<<2)
-#define REMIX_HINT_CHANNEL (1<<3)
#define REMIX_CONSTRAINT_EMPTY ((RemixConstraint){NULL})
%define name remix
-%define version 0.2.3
+%define version 0.2.4
%define release 1
%define prefix /usr
for (l = list; l; l = ln) {
ln = l->next;
-// destroy (ctx, l->data.s_pointer);
+ destroy (ctx, l->data.s_pointer);
cd_free (l);
}
INCLUDES = -I$(top_srcdir)/src/ctxdata -I$(top_srcdir)/include -I../ctxdata
if BUILD_MONITOR
-monitor_programs = noisedemo squaredemo mysquaredemo
+monitor_programs = noisedemo squaredemo
if HAVE_LIBSNDFILE1
-sndfile_programs = sndfiledemo simple_sndfiledemo
+sndfile_programs = sndfiledemo
endif
endif
squaredemo_SOURCES = squaredemo.c
squaredemo_LDADD = $(REMIX_LIBS)
-mysquaredemo_SOURCES = simple_squaredemo.c
-mysquaredemo_LDADD = $(REMIX_LIBS)
-
sndfiledemo_CFLAGS = -DSAMPLEDIR=\"$(srcdir)\"
sndfiledemo_SOURCES = sndfiledemo.c
sndfiledemo_LDADD = $(REMIX_LIBS) @SNDFILE_LIBS@
-
-simple_sndfiledemo_CFLAGS = -DSAMPLEDIR=\"$(srcdir)\"
-simple_sndfiledemo_SOURCES = simple_sndfiledemo.c
-simple_sndfiledemo_LDADD = $(REMIX_LIBS) @SNDFILE_LIBS@
+++ /dev/null
-
-#include <stdlib.h>
-#include <stdio.h>
-
-#include <remix/remix.h>
-
-int
-main (int argc, char ** argv)
-{
- RemixEnv * env;
- RemixDeck * deck;
- RemixTrack * track;
- RemixLayer * l1, * l2, * sample_layer;
- RemixBase * sf1;
- RemixBase * player;
- RemixCount length;
- RemixPlugin * sf_plugin;
- RemixPlugin * player_plugin;
-
- CDSet * sf_parms;
- int i;
- int sf_path_key;
- RemixSound * sound;
-
- env = remix_init ();
- remix_set_samplerate(env, 8000);
- printf( "remix sample rate: %f\n", remix_get_samplerate(env));
- remix_set_channels (env, REMIX_STEREO);
-
-
- //############################ Setting files for MIXING ########################
- sf_plugin = remix_find_plugin (env, "builtin::sndfile_reader"); // keep the plugin list, no need to lookup everytime
- if (sf_plugin == NULL) {
- fprintf (stderr, "sf_plugin == NULL\n");
- exit (1);
- }
- sf_parms = cd_set_new (env);
- sf_path_key = remix_get_init_parameter_key (env, sf_plugin, "path");
- sf_parms = cd_set_insert (env, sf_parms, sf_path_key, CD_STRING(SAMPLEDIR "/M1F1-int16-AFsp.wav"));
- sf1 = remix_new (env, sf_plugin, sf_parms);
-
- deck = remix_deck_new (env);
- track = remix_track_new (env, deck);
- l1 = remix_layer_new_ontop (env, track, REMIX_TIME_SAMPLES);
- remix_sound_new (env, (RemixBase *)sf1, l1, REMIX_SAMPLES(7000), REMIX_SAMPLES(35000) );
- //################################################################################
-
- ///////////////////////////////// ADDING PLAYER ////////////////
- sample_layer = remix_layer_new_ontop (env, track, REMIX_TIME_SAMPLES);
- player_plugin = remix_find_plugin (env, "stream_player"); // keep the plugin list, no need to lookup everytime
- if (player_plugin == NULL) {
- fprintf (stderr, "player_plugin == NULL\n");
- exit (1);
- }
- player = remix_new (env, player_plugin, NULL);
- remix_sound_new (env, (RemixBase *)player, sample_layer, REMIX_SAMPLES(0), REMIX_SAMPLES(35000));
- //////////////////////////////////////////////////////////////////
-
- remix_process (env, deck, 35000, RemixNone, RemixNone);
- exit (0);
-}
+++ /dev/null
-/*
- * squaredemo.c
- *
- * Copyright (C) 2001 Commonwealth Scientific and Industrial Research
- * Organisation (CSIRO), Australia.
- *
- * Permission to use, copy, modify, distribute, and sell this software and
- * its documentation for any purpose is hereby granted without fee, provided
- * that the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation. No representations are made about the suitability of this
- * software for any purpose. It is provided "as is" without express or
- * implied warranty.
- *
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include <remix/remix.h>
-
-#define remix_add_sound_B(a,s,l,t1,t2) \
- remix_sound_new ((a), (s), (l), REMIX_BEAT24S(t1), REMIX_BEAT24S(t2))
-
-#define BEAT 24
-#define HALF_BEAT 12
-#define QUARTER_BEAT 6
-#define EIGHTH_BEAT 3
-
-int
-main (int argc, char ** argv)
-{
- RemixEnv * env;
- RemixDeck * deck, * deck2;
- RemixTrack * track, * track2, * track3, * track4;
- RemixLayer * l1, * l2, * l3, * l4, * l5;
- RemixSound * s;
- RemixSquareTone * square1, * square2, * square3, * square4, * square5;
- RemixPlugin * noise_plugin;
- RemixBase * noise;
- RemixEnvelope * env1, * env2, * env3;
- RemixEnvelope * ge;
- RemixCount length;
- RemixMonitor * monitor;
- int b = 0, b2 = 0, mb;
-
- env = remix_init ();
-
- remix_set_tempo (env, 500);
- remix_set_channels (env, REMIX_STEREO);
-
- square1 = remix_squaretone_new (env, 100.0);
- remix_squaretone_add_channel (env, square1, 0 );
-
- square2 = remix_squaretone_new (env, 200.0);
- remix_squaretone_add_channel (env, square2, 0 );
- remix_squaretone_add_channel (env, square2, 1 );
-
- square3 = remix_squaretone_new (env, 385.0);
- remix_squaretone_add_channel (env, square3, 0 );
-
- // square4 = remix_squaretone_new (env, 231.0);
- // square5 = remix_squaretone_new (env, 165.0);
-
- monitor = remix_monitor_new (env);
-
- deck = remix_deck_new (env);
- track = remix_track_new (env, deck);
- l1 = remix_layer_new_ontop (env, track, REMIX_TIME_BEAT24S);
- s = remix_sound_new (env, square1, l1, REMIX_BEAT24S(0), REMIX_BEAT24S(6));
- s = remix_sound_new (env, square2, l1, REMIX_BEAT24S(8), REMIX_BEAT24S(12));
- s = remix_sound_new (env, square3, l1, REMIX_BEAT24S(21), REMIX_BEAT24S(12));
-
-/*
- remix_track_set_gain (env, track2, 0.6);
-
- ge = remix_envelope_new (env, REMIX_ENVELOPE_LINEAR);
- remix_envelope_set_timetype (env, ge, REMIX_TIME_SAMPLES);
- remix_envelope_add_point (env, ge, REMIX_BEAT24S(2), 0.6);
-*/
-
-
- length = remix_length (env, deck);
-
- l2 = remix_layer_new_ontop (env, track, REMIX_TIME_SAMPLES);
- s = remix_sound_new (env, monitor, l2, REMIX_SAMPLES(0), REMIX_SAMPLES(length));
- //remix_sound_set_gain_envelope (env, s, ge);
-
- remix_process (env, deck, length, RemixNone, RemixNone);
-
- remix_purge (env);
-
- exit (0);
-}
-
remix_set_error (env, REMIX_ERROR_INVALID);
return -1;
}
-
- remix_get_meta_text (env, base);
-
n = _remix_process (env, base, count, input, output);
if (n > 0) base->offset += n;
return n;
world->plugins = cd_list_destroy_with (env, world->plugins, remix_plugin_destroy);
remix_plugin_defaults_unload (env);
-//need to analyse why its commented in svn version ???
+
//world->bases = cd_list_destroy_with (env, world->bases, remix_destroy);
remix_channelset_defaults_destroy (env);
void
remix_dprintf (const char * fmt, ...)
{
-#if 0
+#ifdef DEBUG
va_list ap;
char buf[4096];
int i, n;
remix_envelope_init (env, (RemixBase *)envelope);
envelope->type = type;
remix_envelope_debug (env, envelope);
-
return envelope;
}
/* XXX: remove these when dynamic! */
CDList * __gain_init (RemixEnv * env);
CDList * __sndfile_init (RemixEnv * env);
-CDList * __ogg_init (RemixEnv * env);
#endif /* defined(__REMIX__) */
SF_INFO info;
float * pcm;
sf_count_t pcm_n;
- CDSet * channels;
};
REMIX_HINT_FILENAME,
};
-
-static struct _RemixParameterScheme channels_scheme = {
- "channels",
- "Channel List to play file",
- REMIX_TYPE_BOOL,
- REMIX_CONSTRAINT_TYPE_NONE,
- REMIX_CONSTRAINT_EMPTY,
- REMIX_HINT_CHANNEL,
-};
-
-
#if 0
static RemixNamedParameter types[] = {
REMIX_NAMED_PARAMETER ("WAV", CD_INT(SF_FORMAT_WAV)),
#define __REMIX__
#include "remix.h"
-typedef struct _RemixSquareToneChannelData RemixSquareToneChannelData;
+typedef struct _RemixSquareToneChannel RemixSquareToneChannel;
typedef struct _RemixSquareTone RemixSquareTone;
-struct _RemixSquareToneChannelData {
+struct _RemixSquareToneChannel {
RemixCount _cycle_offset;
};
struct _RemixSquareTone {
RemixBase base;
float frequency;
- CDSet * channel_data;
CDSet * channels;
- RemixCount length;
};
/* Optimisation dependencies: none */
static RemixSquareTone *
remix_squaretone_replace_channels (RemixEnv * env, RemixSquareTone * squaretone)
{
- RemixSquareToneChannelData * sqch;
+ RemixSquareToneChannel * sqch;
CDSet * s, * channels = remix_get_channels (env);
RemixCount offset = remix_tell (env, (RemixBase *)squaretone);
- cd_set_free_all (env, squaretone->channel_data);
+ cd_set_free_all (env, squaretone->channels);
for (s = channels; s; s = s->next) {
remix_dprintf ("[remix_squaretone_replace_channels] %p replacing channel %d\n",
squaretone, s->key);
- sqch = (RemixSquareToneChannelData *)
- remix_malloc (sizeof (struct _RemixSquareToneChannelData));
+ sqch = (RemixSquareToneChannel *)
+ remix_malloc (sizeof (struct _RemixSquareToneChannel));
sqch->_cycle_offset = 0;
- squaretone->channel_data =
- cd_set_insert (env, squaretone->channel_data, s->key, CD_POINTER(sqch));
+ squaretone->channels =
+ cd_set_insert (env, squaretone->channels, s->key, CD_POINTER(sqch));
}
if (offset > 0) remix_seek (env, (RemixBase *)squaretone, offset, SEEK_SET);
remix_squaretone_init (RemixEnv * env, RemixBase * base)
{
RemixSquareTone * squaretone = (RemixSquareTone *)base;
- squaretone->channel_data = NULL;
+ squaretone->channels = NULL;
remix_squaretone_replace_channels (env, squaretone);
remix_squaretone_optimise (env, squaretone);
return base;
remix_base_new_subclass (env, sizeof (struct _RemixSquareTone));
remix_squaretone_init (env, (RemixBase *)squaretone);
squaretone->frequency = frequency;
- squaretone->length = REMIX_COUNT_INFINITE;
return (RemixBase *)squaretone;
}
return squaretone->frequency;
}
-RemixCount
-remix_squaretone_set_length (RemixEnv * env, RemixBase * base, RemixCount length)
-{
- RemixSquareTone * squaretone = (RemixSquareTone *)base;
- RemixCount old = squaretone->length;
- squaretone->length = length;
- return old;
-}
-
-RemixCount
-remix_squaretone_get_length (RemixEnv * env, RemixBase * base)
-{
- RemixSquareTone * squaretone = (RemixSquareTone *)base;
- return squaretone->length;
-}
-
-void
-remix_squaretone_add_channel (RemixEnv * env, RemixBase * base, RemixChannelName channel )
-{
- RemixSquareTone * squaretone = (RemixSquareTone *)base;
- squaretone->channels = cd_set_replace (env, squaretone->channels, channel, CD_POINTER(NULL));;
-}
-
-void
-remix_squaretone_remove_channel (RemixEnv * env, RemixBase * base, RemixChannelName channel )
-{
- RemixSquareTone * squaretone = (RemixSquareTone *)base;
- squaretone->channels = cd_set_remove(env, squaretone->channels, channel );
-}
-
-CDSet *
-remix_squaretone_get_channels (RemixEnv * env, RemixBase * base )
-{
- RemixSquareTone * squaretone = (RemixSquareTone *)base;
- return squaretone->channels;
-}
-
-
/* An RemixChunkFunc for creating squaretone data */
static RemixCount
remix_squaretone_write_chunk (RemixEnv * env, RemixChunk * chunk,
int channelname, void * data)
{
RemixSquareTone * squaretone = (RemixSquareTone *)data;
- RemixSquareToneChannelData * sqch;
+ RemixSquareToneChannel * sqch;
RemixCount remaining = count, written = 0, n;
RemixCount wavelength;
RemixPCM * d, value;
CDScalar k;
- int channel_enabled = 0;
remix_dprintf ("[remix_squaretone_write_chunk] (+%ld) @ %ld\n",
count, offset);
- k = cd_set_find (env, squaretone->channel_data, channelname);
+ k = cd_set_find (env, squaretone->channels, channelname);
sqch = k.s_pointer;
- channel_enabled = cd_set_contains (env, squaretone->channels, channelname);
-
if (sqch == RemixNone) {
remix_dprintf ("[remix_squaretone_write_chunk] channel %d not found\n",
channelname);
value = -1.0;
}
- if(!channel_enabled ) value = 0;
-
d = &chunk->data[offset];
_remix_pcm_set (d, value, n);
remaining -= n; written += n; offset += n;
static RemixCount
remix_squaretone_length (RemixEnv * env, RemixBase * base)
{
- RemixSquareTone * squaretone = (RemixSquareTone *)base;
- return squaretone->length;
+ return REMIX_COUNT_INFINITE;
}
static RemixCount
RemixCount wavelength;
CDSet * s;
RemixCount cycle_offset;
- RemixSquareToneChannelData * sqch;
+ RemixSquareToneChannel * sqch;
wavelength = (RemixCount)(remix_get_samplerate (env) / squaretone->frequency);
cycle_offset = offset % wavelength;
- for (s = squaretone->channel_data; s; s = s->next) {
- sqch = (RemixSquareToneChannelData *)s->data.s_pointer;
+ for (s = squaretone->channels; s; s = s->next) {
+ sqch = (RemixSquareToneChannel *)s->data.s_pointer;
sqch->_cycle_offset = cycle_offset;
}