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

#include <glib.h>
#include "gdambeatinfo.h"
#include <gnome-xml/tree.h>

/*
 * Describe an mp3 (or any format) audio file.
 *
 * Also may include fully peripheral data- like id3 tag stuff
 * or what encoder was used.
 */
typedef struct _GdamSongInfo GdamSongInfo;

struct _GdamSongInfo {
    int            ref_count;
    float          length;
    float          gain;
    int            order;
    GdamBeatInfo*  beat_info;
    GHashTable*    song_properties;
    char*          filename;
};

GdamSongInfo*        gdam_song_info_new         (const char*       filename,
                                                 float             bpm,
                                                 float             first_beat);
GdamSongInfo*        gdam_song_info_copy        (GdamSongInfo*	   song_info);
gboolean             gdam_song_info_add_property(GdamSongInfo*     song_info,
                                                 const char*       key,
						 const char*       value);
void                 gdam_song_info_ref         (GdamSongInfo*     song_info);
void                 gdam_song_info_unref       (GdamSongInfo*     song_info);
void          	     gdam_song_info_set_beat_info
						(GdamSongInfo*     song_info,
						 const GdamBeatInfo* beat_info);
void                 gdam_song_info_to_xml      (GdamSongInfo*     song_info,
                                                 xmlNode*          parent);
GdamSongInfo*        gdam_song_info_from_xml    (xmlNode*          xml_node);

#endif
