/*
    GDAM - Geoff & Dave's Audio Mixer
    Copyright (C) 1999    Dave Benson, Geoff Matters.

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
    version 2 of the License, or (at your option) any later version.

    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public
    License along with this library; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA

    Contact:
        daveb@ffem.org <Dave Benson>
        geoff@ugcs.caltech.edu <Geoff Matters>
*/
#ifndef __GDAS_SEQUENCER_H_
#define __GDAS_SEQUENCER_H_

typedef struct _GdasSequencerElement GdasSequencerElement;
typedef struct _GdasSequencer GdasSequencer;

#include "gdassource.h"
#include "gdamcachebuffer.h"

GtkType gdas_sequencer_get_type();
#define GDAS_TYPE_SEQUENCER              (gdas_sequencer_get_type ())
#define GDAS_SEQUENCER(obj)              (GTK_CHECK_CAST ((obj), GDAS_TYPE_SEQUENCER, GdasSequencer))
#define GDAS_SEQUENCER_CLASS(klass)      (GTK_CHECK_CLASS_CAST ((klass), GDAS_TYPE_SEQUENCER, GdasSequencerClass))
#define GDAM_IS_SEQUENCER(obj)           (GTK_CHECK_TYPE ((obj), GDAS_TYPE_SEQUENCER))
#define GDAM_IS_SEQUENCER_CLASS(klass)   (GTK_CHECK_CLASS_TYPE ((klass), GDAS_TYPE_SEQUENCER))

struct _GdasSequencerElement {
	/* Index of the first sample in the loop to fill with this
	 * the first sample of this element. */
	int			start_offset;

	/* Speedup/slowdown */
	GdamFixed		resample;

	/* Revolumize */
	GdamFixed		volume;


	/* First sample to output. */
	int			in_buffer_offset;

	/* Number of samples to output with this element. */
	GdamFixed		sample_output_length;

	/* The buffer this sample comes from. */
        GdamCacheBuffer        *buffer;
};

struct _GdasSequencer {
	GdasSource		source;
	int			sequence_length;
	int			position;
        GSList                 *elements;
};

#endif
