/*
 |  Copyright (C) 2002-2010 Jorg Schuler <jcsjcs at users sourceforge net>
 |                                          Paul Richardson <phantom_sf at users.sourceforge.net>
 |  Part of the gtkpod project.
 |
 |  URL: http://www.gtkpod.org/
 |  URL: http://gtkpod.sourceforge.net/
 |
 |  This program is free software; you can redistribute it and/or modify
 |  it under the terms of the GNU General Public License as published by
 |  the Free Software Foundation; either version 2 of the License, or
 |  (at your option) any later version.
 |
 |  This program 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 General Public License for more details.
 |
 |  You should have received a copy of the GNU General Public License
 |  along with this program; if not, write to the Free Software
 |  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 |
 |  iTunes and iPod are trademarks of Apple
 |
 |  This product is not supported/written/published by Apple!
 |
 */

#ifdef HAVE_CONFIG_H
    #include <config.h>
#endif

#include "exporter_iface.h"

static void exporter_base_init(ExporterInterface *klass) {
    static gboolean initialized = FALSE;

    if (!initialized) {
        klass->export_tracks_as_files = NULL;
        klass->export_tracks_to_playlist_file = NULL;
        klass->transfer_track_glist_between_itdbs = NULL;
        klass->transfer_track_names_between_itdbs = NULL;
        initialized = TRUE;
    }
}

GType exporter_get_type(void) {
    static GType type = 0;
    if (!type) {
        static const GTypeInfo info =
            { sizeof(ExporterInterface), (GBaseInitFunc) exporter_base_init, NULL, NULL, NULL, NULL, 0, 0, NULL };
        type = g_type_register_static(G_TYPE_INTERFACE, "Exporter", &info, 0);
        g_type_interface_add_prerequisite(type, G_TYPE_OBJECT);
    }
    return type;
}

void exporter_export_tracks_as_files(Exporter *exporter, GList *tracks, GList **filenames, gboolean display, gchar *message) {
    if (! EXPORTER_IS_EXPORTER(exporter))
        return;

    EXPORTER_GET_INTERFACE(exporter)->export_tracks_as_files(tracks, filenames, display, message);
}

void exporter_export_tracks_to_playlist_file (Exporter *exporter, GList *tracks) {
    if (! EXPORTER_IS_EXPORTER(exporter))
            return;

    EXPORTER_GET_INTERFACE(exporter)->export_tracks_to_playlist_file(tracks);
}

GList *exporter_transfer_track_glist_between_itdbs (Exporter *exporter, iTunesDB *itdb_s, iTunesDB *itdb_d, GList *tracks) {
    if (! EXPORTER_IS_EXPORTER(exporter))
            return NULL;

    return EXPORTER_GET_INTERFACE(exporter)->transfer_track_glist_between_itdbs(itdb_s, itdb_d, tracks);
}

GList *exporter_transfer_track_names_between_itdbs (Exporter *exporter, iTunesDB *itdb_s, iTunesDB *itdb_d, gchar *data) {
    if (! EXPORTER_IS_EXPORTER(exporter))
            return NULL;

    return EXPORTER_GET_INTERFACE(exporter)->transfer_track_names_between_itdbs (itdb_s, itdb_d, data);
}
