/*
    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 __GTK_TRACK_DISPLAY_H_
#define __GTK_TRACK_DISPLAY_H_

#include <gtk/gtkeventbox.h>
#include <gtk/gtkdrawingarea.h>
#include <gdam/component/gdamsonginfo.h>

typedef struct _GtkTrackDisplay GtkTrackDisplay;
typedef struct _GtkTrackDisplayClass GtkTrackDisplayClass;

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

GtkType gtk_track_display_get_type();
#define GTK_TYPE_TRACK_DISPLAY			(gtk_track_display_get_type ())
#define GTK_TRACK_DISPLAY(obj)              (GTK_CHECK_CAST ((obj), GTK_TYPE_TRACK_DISPLAY, GtkTrackDisplay))
#define GTK_TRACK_DISPLAY_CLASS(klass)      (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_TRACK_DISPLAY, GtkTrackDisplayClass))
#define GTK_IS_TRACK_DISPLAY(obj)           (GTK_CHECK_TYPE ((obj), GTK_TYPE_TRACK_DISPLAY))
#define GTK_IS_TRACK_DISPLAY_CLASS(klass)   (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_TRACK_DISPLAY))

struct _GtkTrackDisplayClass {
	//GtkEventBoxClass 		event_box_class;
	GtkDrawingAreaClass 		drawing_class;
};

struct _GtkTrackDisplay {
	GtkEventBox 			event_box;
	GdkPixmap		       *backing_pixmap;
	GdkGC			       *upper_gc;
	GdkGC			       *origin_gc;
	GdkGC			       *desc_gc;
	GdkGC			       *text_gc;
	GdkGC			       *lower_gc;
	GdkFont			       *font;
	GdamBeatInfo		       *beat_info;
	int				draw_width;
	int				draw_height;
	gdouble				length;
	gdouble				timer_origin;
	int				range_index;
	int				freeze_count;
	gboolean			changed_while_frozen;
};

GtkWidget* gtk_track_display_create_func   (const char*   name,
                                            const char*   string1,
                                            const char*   string2,
                                            int           int1,
                                            int           int2);

void gtk_track_display_set_beat_info (GtkTrackDisplay *display,
				      const GdamBeatInfo *bi);

void gtk_track_display_set_length    (GtkTrackDisplay *display,
				      gdouble          length);

void gtk_track_display_set_origin    (GtkTrackDisplay *display,
				      gdouble          origin);

void gtk_track_display_set_range_index (GtkTrackDisplay *display,
				        int             idx);

void gtk_track_display_freeze        (GtkTrackDisplay *display);
void gtk_track_display_thaw          (GtkTrackDisplay *display);

#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif
