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

#include <gtk/gtkobject.h>
#include <gtk/gtksignal.h>

gboolean gdam_file_exists(const char* filename);

void
gtk_marshal_NONE__DOUBLE (GtkObject * object,
                           GtkSignalFunc func,
                           gpointer func_data, GtkArg * args);
void
gtk_marshal_NONE__DOUBLE_DOUBLE (GtkObject * object,
                           GtkSignalFunc func,
                           gpointer func_data, GtkArg * args);

void
gtk_marshal_DOUBLE__NONE (GtkObject * object,
                           GtkSignalFunc func,
                           gpointer func_data, GtkArg * args);

void
gtk_marshal_NONE__DOUBLE_INT (GtkObject * object,
                              GtkSignalFunc func,
                              gpointer func_data,
                              GtkArg * args);

void
gtk_marshal_NONE__DOUBLE_POINTER 
			     (GtkObject * object,
                              GtkSignalFunc func,
                              gpointer func_data,
                              GtkArg * args);

void gdam_do_nothing();

/* Returns the frequency associated with a given midi note index,
 * where a note value of 57 corresponds to A at 440 hz, using a
 * perfectly logarithmic scale. */
gdouble gdam_hz_from_midi_note_idx (int midi_index);



/*   gdam_monitor_object_destroy (GtkObject **obj_ptr)
 *
 * Watch a member object for destruction, NULL the pointer
 * and unref.  Object should have been reffed when obj_ptr
 * was assigned, and should be unreffed whenever the pointer
 * is NULLed.   Assumes the host struct will be valid until
 * after the object has been destroyed.
 */
void gdam_monitor_object_destroy (GtkObject **obj_ptr);

#endif
