view src/filewriter/filewriter.h @ 2874:11ef2164d90b

re-written format conversion using libSAD; please test this on Big Endian system
author Andrew O. Shadoura <bugzilla@tut.by>
date Thu, 07 Aug 2008 04:16:17 +0300
parents 31d6c44ffef2
children dcd8d93ba781
line wrap: on
line source

/*  FileWriter-Plugin
 *  (C) copyright 2007 merging of Disk Writer and Out-Lame by Michael Färber
 *
 *  Original Out-Lame-Plugin:
 *  (C) copyright 2002 Lars Siebold <khandha5@gmx.net>
 *  (C) copyright 2006-2007 porting to audacious by Yoshiki Yazawa <yaz@cc.rim.or.jp>
 *
 *  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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 */

#ifndef FILEWRITER_H
#define FILEWRITER_H

#include "config.h"

#include <gtk/gtk.h>
#include <stdio.h>
#include <string.h>

#include <audacious/main.h>
#include <audacious/plugin.h>
#include <audacious/playlist.h>
#include <audacious/configdb.h>
#include <audacious/i18n.h>
#include <audacious/util.h>
#include <audacious/vfs.h>

#include <libSAD/libSAD.h>

struct format_info { 
    AFormat format;
    int frequency;
    int channels;
};

extern struct format_info input;

extern VFSFile *output_file;
extern guint64 written;
extern guint64 offset;
extern Tuple *tuple;

typedef struct _FileWriter FileWriter;

typedef gint (*write_output_callback)(void *ptr, gint length);

struct _FileWriter
{
    void (*init)(write_output_callback write_output_func);
    void (*configure)(void);
    gint (*open)(void);
    void (*write)(void *ptr, gint length);
    void (*flush)(void);
    void (*close)(void);
    gint (*free)(void);
    gint (*playing)(void);
    gint (*get_written_time)(void);
    AFormat format_required;
};

#endif