Introduced libisofs as separated development unit

master
Mario Danic 16 years ago
parent 44997a2df8
commit 33b7e9eaab

@ -0,0 +1,33 @@
from distutils.core import setup, Extension
sources = ["src/burnmodule.c", "src/disc.c", "src/drive.c",
"src/drive_info.c", "src/message.c", "src/progress.c",
"src/read_opts.c", "src/session.c", "src/source.c",
"src/toc_entry.c", "src/track.c", "src/write_opts.c"]
include_dirs = ["/usr/include", "/usr/local/include"]
library_dirs = ["/usr/lib", "/usr/local/lib"]
libraries = ["burn", "pthread"]
long_description = \
"""Python Interface to libBurn 0.2.2
pyburn is a stupid binding to libBurn, the awesome burning library"""
module = Extension('burn',
define_macros = [('MAJOR_VERSION', '0'),
('MINOR_VERSION', '1')],
include_dirs = include_dirs,
libraries = libraries,
sources = sources)
setup (name = 'burn',
version = '0.1',
description = "Stupid bindings to libBurn 0.2.2",
long_description=long_description,
author = "Anant Narayanan",
author_email = "anant@kix.in",
license = "GPLv2",
platforms = "POSIX",
url = "http://libburn.pykix.org/",
ext_modules = [module])

@ -0,0 +1,267 @@
#include "disc.h"
#include "drive.h"
#include "drive_info.h"
#include "message.h"
#include "progress.h"
#include "read_opts.h"
#include "session.h"
#include "source.h"
#include "toc_entry.h"
#include "track.h"
#include "write_opts.h"
static PyObject* ErrorObject;
static PyObject* Burn_Initialize(PyObject* self, PyObject* args)
{
if (burn_initialize()) {
Py_INCREF(Py_None);
return Py_None;
}
return NULL;
}
static PyObject* Burn_Finish(PyObject* self, PyObject* args)
{
burn_finish();
Py_INCREF(Py_None);
return Py_None;
}
static PyObject* Burn_Set_Verbosity(PyObject* self, PyObject* args)
{
int level;
if (!PyArg_ParseTuple(args, "i", &level))
return NULL;
burn_set_verbosity(level);
Py_INCREF(Py_None);
return Py_None;
}
static PyObject* Burn_Preset_Device_Open(PyObject* self, PyObject* args)
{
int ex, bl, abort;
if (!PyArg_ParseTuples(args, "iii", &ex, &bl, &abort))
return NULL;
burn_preset_device_open(ex, bl, abort);
Py_INCREF(Py_None);
return Py_None;
}
static PyObject* Burn_Drive_Scan_And_Grab(PyObject* self, PyObject* args)
{
}
static PyObject* Burn_Drive_Add_Whitelist(PyObject* self, PyObject* args)
{
}
static PyObject* Burn_Drive_Clear_Whitelist(PyObject* self, PyObject* args)
{
}
static PyObject* Burn_Drive_Scan(PyObject* self, PyObject* args)
{
}
static PyObject* Burn_Drive_Info_Forget(PyObject* self, PyObject* args)
{
}
static PyObject* Burn_Drive_Info_Free(PyObject* self, PyObject* args)
{
}
static PyObject* Burn_Drive_Is_Enumerable(PyObject* self, PyObject* args)
{
}
static PyObject* Burn_Drive_Convert_FS_Address(PyObject* self, PyObject* args)
{
}
static PyObject* Burn_Drive_Convert_SCSI_Address(PyObject* self, PyObject* args)
{
}
static PyObject* Burn_Drive_Obtain_SCSI_Address(PyObject* self, PyObject* args)
{
}
static PyObject* Burn_MSF_To_Sectors(PyObject* self, PyObject* args)
{
int sectors, min, sec, frame;
if (!PyArg_ParseTuple(args, "(iii)", &min, &sec, &frame))
return NULL;
sectors = burn_msf_to_sectors(min, sec, frame);
return PyInt_FromLong(sectors);
}
static PyObject* Burn_Sectors_To_MSF(PyObject* self, PyObject* args)
{
int sectors, min, sec, frame;
if (!PyArg_ParseTuple(args, "i", &sectors))
return NULL;
burn_sectors_to_msf(sectors, &min, &sec, &frame);
return PyTuple_Pack(3, PyInt_FromLong(min),
PyInt_FromLong(sec),
PyInt_FromLong(frame));
}
static PyObject* Burn_MSF_To_LBA(PyObject* self, PyObject* args)
{
int lba, min, sec, frame;
if (!PyArg_ParseTuple(args, "(iii)", &min, &sec, &frame))
return NULL;
lba = burn_msf_to_lba(min, sec, frame);
return PyInt_FromLong(lba);
}
static PyObject* Burn_LBA_To_MSF(PyObject* self, PyObject* args)
{
int lba, min, sec, frame;
if (!PyArg_ParseTuple(args, "i", &lba))
return NULL;
burn_lba_to_msf(lba, &min, &sec, &frame);
return PyTuple_Pack(3, PyInt_FromLong(min),
PyInt_FromLong(sec),
PyInt_FromLong(frame));
}
static PyObject* Burn_Version(PyObject* self, PyObject* args)
{
int maj, min, mic;
burn_version(&maj, &min, &mic);
return PyTuple_Pack(3, PyInt_FromLong(maj),
PyInt_FromLong(min),
PyInt_FromLong(mic));
}
static PyMethodDef Burn_Methods[] = {
{"init", (PyCFunction)Burn_Initialize, METH_VARARGS,
PyDoc_STR("Initializes the libBurn library for use.")},
{"finish", (PyCFunction)Burn_Finish, METH_VARARGS,
PyDoc_STR("Shuts down the library.")},
{"set_verbosity", (PyCFunction)Burn_Set_Verbosity, METH_VARARGS,
PyDoc_STR("Sets the verbosity level of the library.")},
{"preset_device_open", (PyCFunction)Burn_Preset_Device_Open, METH_VARARGS,
PyDoc_STR("Sets parameters for behaviour on opening devices.")},
{"drive_scan_and_grab", (PyCFunction)Burn_Drive_Scan_And_Grab, METH_VARARGS,
PyDoc_STR("Acquires a drive with a known persistent address.")},
{"drive_add_whitelist", (PyCFunction)Burn_Drive_Add_Whitelist, METH_VARARGS,
PyDoc_STR("Adds a device to the list of permissible drives.")},
{"drive_clear_whitelist", (PyCFunction)Burn_Drive_Clear_Whitelist,
METH_VARARGS,
PyDoc_STR("Removes all drives from the whitelist.")},
{"drive_scan", (PyCFunction)Burn_Drive_Scan, METH_VARARGS,
PyDoc_STR("Scans for and returns drive_info objects.")},
{"drive_info_forget", (PyCFunction)Burn_Drive_Info_Forget, METH_VARARGS,
PyDoc_STR("Releases memory and frees a drive_info object.")},
{"drive_info_free", (PyCFunction)Burn_Drive_Info_Free, METH_VARARGS,
PyDoc_STR("Frees a set of drive_info objects as returned by drive_scan.")},
{"drive_is_enumerable", (PyCFunction)Burn_Drive_Is_Enumerable,
METH_VARARGS,
PyDoc_STR("Evaluates whether the given address is a possible persistent drive address.")},
{"drive_convert_fs_address", (PyCFunction)Burn_Drive_Convert_FS_Address,
METH_VARARGS,
PyDoc_STR("Converts a given filesystem address to a persistent drive address.")},
{"drive_convert_scsi_address", (PyCFunction)Burn_Drive_Convert_SCSI_Address,
METH_VARARGS,
PyDoc_STR("Converts the given SCSI address (bus, channel, target, lun) into a persistent drive address.")},
{"drive_obtain_scsi_address", (PyCFunction)Burn_Drive_Obtain_SCSI_Address,
METH_VARARGS,
PyDoc_STR("Obtains (host, channel, target, lun) from the path.")},
{"msf_to_sectors", (PyCFunction)Burn_MSF_To_Sectors, METH_VARARGS,
PyDoc_STR("Converts a (minute, second, frame) value to sector count.")},
{"sectors_to_msf", (PyCFunction)Burn_Sectors_To_MSF, METH_VARARGS,
PyDoc_STR("Converts sector count to a (minute, second, frame) value.")},
{"msf_to_lba", (PyCFunction)Burn_MSF_To_LBA, METH_VARARGS,
PyDoc_STR("Converts a (minute, second, frame) value to an LBA.")},
{"lba_to_msf", (PyCFunction)Burn_LBA_To_MSF, METH_VARARGS,
PyDoc_STR("Converts an LBA to a (minute, second, frame) value.")},
{"version", (PyCFunction)Burn_Version, METH_VARARGS,
PyDoc_STR("Returns the library's (major, minor, micro) versions.")},
{NULL, NULL}
};
static char Burn_Doc[] =
PyDoc_STR("Really stupid bindings to the awesome libBurn library.");
void initburn()
{
PyObject *module, *dict;
module = Py_InitModule3("burn", Burn_Methods, Burn_Doc);
Py_INCREF(&DiscType);
PyModule_AddObject(module, "disc", (PyObject*) &DiscType);
Py_INCREF(&DriveType);
PyModule_AddObject(module, "drive", (PyObject*) &DriveType);
Py_INCREF(&DriveInfoType);
PyModule_AddObject(module, "drive_info", (PyObject*) &DriveInfoType);
Py_INCREF(&MessageType);
PyModule_AddObject(module, "message", (PyObject*) &MessageType);
Py_INCREF(&ProgressType);
PyModule_AddObject(module, "progress", (PyObject*) &ProgressType);
Py_INCREF(&ReadOptsType);
PyModule_AddObject(module, "read_opts", (PyObject*) &ReadOptsType);
Py_INCREF(&SessionType);
PyModule_AddObject(module, "session", (PyObject*) &SessionType);
Py_INCREF(&SourceType);
PyModule_AddObject(module, "source", (PyObject*) &SourceType);
Py_INCREF(&TOCEntryType);
PyModule_AddObject(module, "toc_entry", (PyObject*) &TOCEntryType);
Py_INCREF(&TrackType);
PyModule_AddObject(module, "track", (PyObject*) &TrackType);
Py_INCREF(&WriteOptsType);
PyModule_AddObject(module, "write_opts", (PyObject*) &WriteOptsType);
dict = PyModule_GetDict(module);
ErrorObject = PyString_FromString("burn.error");
PyDict_SetItemString(dict, "error", ErrorObject);
if (PyErr_Occurred())
Py_FatalError("can't initialize module burn");
/*
if (!(dict = PyModule_GetDict(module))
|| !(tmp = PyString_FromString("0.1"))) {
if (PyErr_Occurred()) {
PyErr_SetString(PyExc_ImportError, "pyburn: init failed");
}
}
PyDict_SetItemString(dict, "Error", Error);
PyDict_SetItemString(dict, "version", tmp);
TODO: Set Constants and enums in disc and DEBUG this!
*/
}

@ -0,0 +1,70 @@
#include "disc.h"
void Disc_Free(Disc* self)
{
}
int Disc_Create(Disc* self, PyObject* args)
{
}
PyObject* Disc_Write(Disc* self, PyObject* args)
{
}
PyObject* Disc_Add_Session(Disc* self, PyObject* args)
{
}
PyObject* Disc_Remove_Session(Disc* self, PyObject* args)
{
}
PyObject* Disc_Get_Sessions(Disc* self, PyObject* args)
{
}
PyObject* Disc_Get_Sectors(Disc* self, PyObject* args)
{
}
static char Disc_Doc[] =
PyDoc_STR("libBurn disc object.");
static PyMethodDef Disc_Methods[] = {
{"write", (PyCFunction)Disc_Write, METH_VARARGS,
PyDoc_STR("Writes the disc with the given write options.")},
{"add_session", (PyCFunction)Disc_Add_Session, METH_VARARGS,
PyDoc_STR("Adds a session to the disc.")},
{"remove_session", (PyCFunction)Disc_Remove_Session, METH_VARARGS,
PyDoc_STR("Removes a session from the disc.")},
{"get_sessions", (PyCFunction)Disc_Get_Sessions, METH_VARARGS,
PyDoc_STR("Returns the set of sessions associated with the disc.")},
{"get_sectors", (PyCFunction)Disc_Get_Sectors, METH_VARARGS,
PyDoc_STR("Returns the number of sectors currently on the disc.")},
{NULL, NULL}
};
PyTypeObject DiscType = {
PyObject_HEAD_INIT(NULL)
.tp_name = "burn.disc",
.tp_basicsize = sizeof(Disc),
.tp_dealloc = (destructor)Disc_Free,
.tp_flags = Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE,
.tp_doc = Disc_Doc,
.tp_methods = Disc_Methods,
.tp_init = (initproc)Disc_Create,
};
extern int Disc_Setup_Types(void)
{
DiscType.tp_new = PyType_GenericNew;
return PyType_Ready(&DiscType);
}

@ -0,0 +1,24 @@
#ifndef PYBURN_DISC_H
#define PYBURN_DISC_H
#include "Python.h"
#include "libburn/libburn.h"
typedef struct {
PyObject_HEAD
struct burn_disc *disc;
} Disc;
extern PyTypeObject DiscType;
void Disc_Free(Disc* self);
int Disc_Create(Disc* self, PyObject* args);
PyObject* Disc_Write(Disc* self, PyObject* args);
PyObject* Disc_Add_Session(Disc* self, PyObject* args);
PyObject* Disc_Remove_Session(Disc* self, PyObject* args);
PyObject* Disc_Get_Sessions(Disc* self, PyObject* args);
PyObject* Disc_Get_Sectors(Disc* self, PyObject* args);
int Disc_Setup_Types(void);
#endif

@ -0,0 +1,127 @@
#include "drive.h"
void Drive_Free(Drive* self)
{
}
int Drive_Create(Drive* self, PyObject* args)
{
}
PyObject* Drive_Grab(Drive* self, PyObject* args)
{
}
PyObject* Drive_Release(Drive* self, PyObject* args)
{
}
PyObject* Drive_Get_Write_Speed(Drive* self, PyObject* args)
{
}
PyObject* Drive_Get_Read_Speed(Drive* self, PyObject* args)
{
}
PyObject* Drive_Set_Speed(Drive* self, PyObject* args)
{
}
PyObject* Drive_Cancel(Drive* self, PyObject* args)
{
}
PyObject* Drive_Get_Disc(Drive* self, PyObject* args)
{
}
PyObject* Drive_Disc_Get_Status(Drive* self, PyObject* args)
{
}
PyObject* Drive_Disc_Erasable(Drive* self, PyObject* args)
{
}
PyObject* Drive_Disc_Erase(Drive* self, PyObject* args)
{
}
PyObject* Drive_Disc_Read(Drive* self, PyObject* args)
{
}
PyObject* Drive_Get_Status(Drive* self, PyObject* args)
{
}
PyObject* Drive_New_ReadOpts(Drive* self, PyObject* args)
{
}
static char Drive_Doc[] =
PyDoc_STR("libBurn drive object.");
static PyMethodDef Drive_Methods[] = {
{"grab", (PyCFunction)Drive_Grab, METH_VARARGS,
PyDoc_STR("Grabs the drive.")},
{"release", (PyCFunction)Drive_Release, METH_VARARGS,
PyDoc_STR("Releases the drive.")},
{"get_status", (PyCFunction)Drive_Get_Status, METH_VARARGS,
PyDoc_STR("Returns the status of the drive.")},
{"get_write_speed", (PyCFunction)Drive_Get_Write_Speed, METH_VARARGS,
PyDoc_STR("Returns the write speed of the drive.")},
{"get_read_speed", (PyCFunction)Drive_Get_Read_Speed, METH_VARARGS,
PyDoc_STR("Returns the read speed of the drive.")},
{"set_speed", (PyCFunction)Drive_Set_Speed, METH_VARARGS,
PyDoc_STR("Sets the speed of the drive.")},
{"cancel", (PyCFunction)Drive_Cancel, METH_VARARGS,
PyDoc_STR("Cancels the current operation on the drive.")},
{"get_disc", (PyCFunction)Drive_Disc_Erase, METH_VARARGS,
PyDoc_STR("Returns the disc object associated with the drive.")},
{"disc_get_status", (PyCFunction)Drive_Disc_Get_Status, METH_VARARGS,
PyDoc_STR("Returns the status of the disc in the drive.")},
{"disc_erasable", (PyCFunction)Drive_Disc_Erasable, METH_VARARGS,
PyDoc_STR("Checks if the disc in the drive is erasable.")},
{"disc_erase", (PyCFunction)Drive_Disc_Erase, METH_VARARGS,
PyDoc_STR("Erases the disc in the drive.")},
{"disc_read", (PyCFunction)Drive_Disc_Read, METH_VARARGS,
PyDoc_STR("Reads the disc in the drive with the given options.")},
{"new_readopts", (PyCFunction)Drive_New_ReadOpts, METH_VARARGS,
PyDoc_STR("Returns a new ReadOpts object associated with the drive.")},
{NULL, NULL}
};
PyTypeObject DriveType = {
PyObject_HEAD_INIT(NULL)
.tp_name = "burn.drive",
.tp_basicsize = sizeof(Drive),
.tp_dealloc = (destructor)Drive_Free,
.tp_flags = Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE,
.tp_doc = Drive_Doc,
.tp_methods = Drive_Methods,
.tp_init = (initproc)Drive_Create,
// ^^?^^
};
extern int Drive_Setup_Types(void)
{
DriveType.tp_new = PyType_GenericNew;
return PyType_Ready(&DriveType);
}

@ -0,0 +1,35 @@
#ifndef PYBURN_DRIVE_H
#define PYBURN_DRIVE_H
#include "Python.h"
#include "libburn/libburn.h"
typedef struct {
PyObject_HEAD
struct burn_drive *drive;
} Drive;
extern PyTypeObject DriveType;
void Drive_Free(Drive* self);
/* For Private Use Only?! */
int Drive_Create(Drive* self, PyObject* args);
PyObject* Drive_Grab(Drive* self, PyObject* args);
PyObject* Drive_Release(Drive* self, PyObject* args);
PyObject* Drive_Get_Status(Drive* self, PyObject* args);
PyObject* Drive_Get_Write_Speed(Drive* self, PyObject* args);
PyObject* Drive_Get_Read_Speed(Drive* self, PyObject* args);
PyObject* Drive_Set_Speed(Drive* self, PyObject* args);
PyObject* Drive_Cancel(Drive* self, PyObject* args);
PyObject* Drive_Get_Disc(Drive* self, PyObject* args);
PyObject* Drive_Disc_Get_Status(Drive* self, PyObject* args);
PyObject* Drive_Disc_Erasable(Drive* self, PyObject* args);
PyObject* Drive_Disc_Erase(Drive* self, PyObject* args);
PyObject* Drive_Disc_Read(Drive* self, PyObject* args);
PyObject* Drive_New_ReadOpts(Drive* self, PyObject* args);
int Drive_Setup_Types(void);
#endif

@ -0,0 +1,43 @@
#include "drive_info.h"
void DriveInfo_Free(DriveInfo* self)
{
}
int DriveInfo_Create(DriveInfo* self, PyObject* args)
{
}
PyObject* DriveInfo_Get_Address(DriveInfo* self, PyObject* args)
{
}
static char DriveInfo_Doc[] =
PyDoc_STR("libBurn drive info object.");
static PyMethodDef DriveInfo_Methods[] = {
{"get_address", (PyCFunction)DriveInfo_Get_Address, METH_VARARGS,
PyDoc_STR("Returns the peristent address of the drive associated.")},
{NULL, NULL}
};
PyTypeObject DriveInfoType = {
PyObject_HEAD_INIT(NULL)
.tp_name = "burn.drive_info",
.tp_basicsize = sizeof(DriveInfo),
.tp_dealloc = (destructor)DriveInfo_Free,
.tp_flags = Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE,
.tp_doc = DriveInfo_Doc,
.tp_methods = DriveInfo_Methods,
.tp_init = (initproc)DriveInfo_Create,
};
extern int DriveInfo_Setup_Types(void)
{
DriveInfoType.tp_new = PyType_GenericNew;
return PyType_Ready(&DriveInfoType);
}

@ -0,0 +1,21 @@
#ifndef PYBURN_DRIVE_INFO_H
#define PYBURN_DRIVE_INFO_H
#include "Python.h"
#include "libburn/libburn.h"
typedef struct {
PyObject_HEAD
struct burn_drive_info *info;
} DriveInfo;
extern PyTypeObject DriveInfoType;
void DriveInfo_Free(DriveInfo* self);
/* For private use only?! */
int DriveInfo_Create(DriveInfo* self, PyObject* args);
PyObject* DriveInfo_Get_Address(DriveInfo* self, PyObject* args);
int DriveInfo_Setup_Types(void);
#endif

@ -0,0 +1,31 @@
#include "message.h"
void Message_Free(Message* self)
{
}
int Message_Create(Message* self, PyObject* args)
{
}
static char Message_Doc[] =
PyDoc_STR("libBurn message object.");
PyTypeObject MessageType = {
PyObject_HEAD_INIT(NULL)
.tp_name = "burn.message",
.tp_basicsize = sizeof(Message),
.tp_dealloc = (destructor)Message_Free,
.tp_flags = Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE,
.tp_doc = Message_Doc,
.tp_init = (initproc)Message_Create,
};
extern int Message_Setup_Types(void)
{
MessageType.tp_new = PyType_GenericNew;
return PyType_Ready(&MessageType);
}

@ -0,0 +1,18 @@
#ifndef PYBURN_MESSAGE_H
#define PYBURN_MESSAGE_H
#include "Python.h"
#include "libburn/libburn.h"
typedef struct {
PyObject_HEAD
struct burn_message *message;
} Message;
extern PyTypeObject MessageType;
void Message_Free(Message* self);
int Message_Create(Message* self, PyObject* args);
int Message_Setup_Types(void);
#endif

@ -0,0 +1,31 @@
#include "progress.h"
void Progress_Free(Progress* self)
{
}
int Progress_Create(Progress* self, PyObject* args)
{
}
static char Progress_Doc[] =
PyDoc_STR("libBurn progress object.");
PyTypeObject ProgressType = {
PyObject_HEAD_INIT(NULL)
.tp_name = "burn.progress",
.tp_basicsize = sizeof(Progress),
.tp_dealloc = (destructor)Progress_Free,
.tp_flags = Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE,
.tp_doc = Progress_Doc,
.tp_init = (initproc)Progress_Create,
};
extern int Progress_Setup_Types(void)
{
ProgressType.tp_new = PyType_GenericNew;
return PyType_Ready(&ProgressType);
}

@ -0,0 +1,18 @@
#ifndef PYBURN_PROGRESS_H
#define PYBURN_PROGRESS_H
#include "Python.h"
#include "libburn/libburn.h"
typedef struct {
PyObject_HEAD
struct burn_progress *progress;
} Progress;
extern PyTypeObject ProgressType;
void Progress_Free(Progress* self);
int Progress_Create(Progress* self, PyObject* args);
int Progress_Setup_Types(void);
#endif

@ -0,0 +1,97 @@
#include "read_opts.h"
void ReadOpts_Free(ReadOpts* self)
{
}
int ReadOpts_Create(ReadOpts* self, PyObject* args)
{
}
PyObject* ReadOpts_Set_Raw(ReadOpts* self, PyObject* args)
{
}
PyObject* ReadOpts_Set_C2Errors(ReadOpts* self, PyObject* args)
{
}
PyObject* ReadOpts_Read_Subcodes_Audio(ReadOpts* self, PyObject* args)
{
}
PyObject* ReadOpts_Read_Subcodes_Data(ReadOpts* self, PyObject* args)
{
}
PyObject* ReadOpts_Set_Hardware_Error_Recovery(ReadOpts* self, PyObject* args)
{
}
PyObject* ReadOpts_Report_Recovered_Errors(ReadOpts* self, PyObject* args)
{
}
PyObject* ReadOpts_Transfer_Damaged_Blocks(ReadOpts* self, PyObject* args)
{
}
PyObject* ReadOpts_Set_Hardware_Error_Retries(ReadOpts* self, PyObject* args)
{
}
static char ReadOpts_Doc[] =
PyDoc_STR("libBurn read_opts object.");
static PyMethodDef ReadOpts_Methods[] = {
{"set_raw", (PyCFunction)ReadOpts_Set_Raw, METH_VARARGS,
PyDoc_STR("Sets whether reading is in raw mode.")},
{"set_c2errors", (PyCFunction)ReadOpts_Set_C2Errors, METH_VARARGS,
PyDoc_STR("Sets whether c2 errors are reported.")},
{"read_subcodes_audio", (PyCFunction)ReadOpts_Read_Subcodes_Audio,
METH_VARARGS,
PyDoc_STR("Sets whether subcodes from audio tracks are read.")},
{"read_subcodes_data", (PyCFunction)ReadOpts_Read_Subcodes_Data,
METH_VARARGS,
PyDoc_STR("Sets whether subcodes from data tracks are read.")},
{"set_hardware_error_recovery",
(PyCFunction)ReadOpts_Set_Hardware_Error_Recovery, METH_VARARGS,
PyDoc_STR("Sets whether error recovery should be performed.")},
{"report_recovered_errors", (PyCFunction)ReadOpts_Report_Recovered_Errors,
METH_VARARGS,
PyDoc_STR("Sets whether recovered errors are reported.")},
{"transfer_damaged_blocks", (PyCFunction)ReadOpts_Transfer_Damaged_Blocks,
METH_VARARGS,
PyDoc_STR("Sets whether blocks with unrecoverable errors are read.")},
{"set_hardware_error_retries",
(PyCFunction)ReadOpts_Set_Hardware_Error_Retries, METH_VARARGS,
PyDoc_STR("Sets the number of attempts when correcting an error.")},
{NULL, NULL}
};
PyTypeObject ReadOptsType = {
PyObject_HEAD_INIT(NULL)
.tp_name = "burn.read_opts",
.tp_basicsize = sizeof(ReadOpts),
.tp_dealloc = (destructor)ReadOpts_Free,
.tp_flags = Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE,
.tp_doc = ReadOpts_Doc,
.tp_methods = ReadOpts_Methods,
.tp_init = (initproc)ReadOpts_Create,
};
extern int ReadOpts_Setup_Types(void)
{
ReadOptsType.tp_new = PyType_GenericNew;
return PyType_Ready(&ReadOptsType);
}

@ -0,0 +1,27 @@
#ifndef PYBURN_READ_OPTS_H
#define PYBURN_READ_OPTS_H
#include "Python.h"
#include "libburn/libburn.h"
typedef struct {
PyObject_HEAD
struct burn_read_opts *opts;
} ReadOpts;
extern PyTypeObject ReadOptsType;
void ReadOpts_Free(ReadOpts* self);
int ReadOpts_Create(ReadOpts* self, PyObject* args);
PyObject* ReadOpts_Set_Raw(ReadOpts* self, PyObject* args);
PyObject* ReadOpts_Set_C2Errors(ReadOpts* self, PyObject* args);
PyObject* ReadOpts_Read_Subcodes_Audio(ReadOpts* self, PyObject* args);
PyObject* ReadOpts_Read_Subcodes_Data(ReadOpts* self, PyObject* args);
PyObject* ReadOpts_Set_Hardware_Recovery(ReadOpts* self, PyObject* args);
PyObject* ReadOpts_Report_Recovered_Errors(ReadOpts* self, PyObject* args);
PyObject* ReadOpts_Transfer_Damaged_Blocks(ReadOpts* self, PyObject* args);
PyObject* ReadOpts_Set_Hardware_Retries(ReadOpts* self, PyObject* args);
int ReadOpts_Setup_Types(void);
#endif

@ -0,0 +1,84 @@
#include "session.h"
void Session_Free(Session* self)
{
}
int Session_Create(Session* self, PyObject* args)
{
}
PyObject* Session_Add_Track(Session* self, PyObject* args)
{
}
PyObject* Session_Remove_Track(Session* self, PyObject* args)
{
}
PyObject* Session_Set_Hidefirst(Session* self, PyObject* args)
{
}
PyObject* Session_Get_Hidefirst(Session* self, PyObject* args)
{
}
PyObject* Session_Get_Leadout_Entry(Session* self, PyObject* args)
{
}
PyObject* Session_Get_Tracks(Session* self, PyObject* args)
{
}
PyObject* Session_Get_Sectors(Session* self, PyObject* args)
{
}
static char Session_Doc[] =
PyDoc_STR("libBurn session object.");
static PyMethodDef Session_Methods[] = {
{"add_track", (PyCFunction)Session_Add_Track, METH_VARARGS,
PyDoc_STR("Adds a track at the specified position in the session.")},
{"remove_track", (PyCFunction)Session_Remove_Track, METH_VARARGS,
PyDoc_STR("Removes the track from the session.")},
{"set_hidefirst", (PyCFunction)Session_Set_Hidefirst, METH_VARARGS,
PyDoc_STR("Sets whether the first track is to be hidden in pregrap.")},
{"get_hidefirst", (PyCFunction)Session_Get_Hidefirst, METH_VARARGS,
PyDoc_STR("Returns whether the first track is hidden in pregap.")},
{"get_leadout_entry", (PyCFunction)Session_Get_Leadout_Entry, METH_VARARGS,
PyDoc_STR("Returns the TOC entry object of the session's leadout")},
{"get_tracks", (PyCFunction)Session_Get_Tracks, METH_VARARGS,
PyDoc_STR("Returns the set of tracks associated with the session.")},
{"get_sectors", (PyCFunction)Session_Get_Sectors, METH_VARARGS,
PyDoc_STR("Returns the number of sectors of the session.")},
{NULL, NULL}
};
PyTypeObject SessionType = {
PyObject_HEAD_INIT(NULL)
.tp_name = "burn.session",
.tp_basicsize = sizeof(Session),
.tp_dealloc = (destructor)Session_Free,
.tp_flags = Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE,
.tp_doc = Session_Doc,
.tp_methods = Session_Methods,
.tp_init = (initproc)Session_Create,
};
extern int Session_Setup_Types(void)
{
SessionType.tp_new = PyType_GenericNew;
return PyType_Ready(&SessionType);
}

@ -0,0 +1,26 @@
#ifndef PYBURN_SESSION_H
#define PYBURN_SESSION_H
#include "Python.h"
#include "libburn/libburn.h"
typedef struct {
PyObject_HEAD
struct burn_session *session;
} Session;
extern PyTypeObject SessionType;
void Session_Free(Session* self);
int Session_Create(Session* self, PyObject* args);
PyObject* Session_Add_Track(Session* self, PyObject* args);
PyObject* Session_Remove_Track(Session* self, PyObject* args);
PyObject* Session_Set_Hidefirst(Session* self, PyObject* args);
PyObject* Session_Get_Hidefirst(Session* self, PyObject* args);
PyObject* Session_Get_Leadout_Entry(Session* self, PyObject* args);
PyObject* Session_Get_Tracks(Session* self, PyObject* args);
PyObject* Session_Get_Sectors(Session* self, PyObject* args);
int Session_Setup_Types(void);
#endif

@ -0,0 +1,31 @@
#include "source.h"
void Source_Free(Source* self)
{
}
int Source_Create(Source* self, PyObject* args, PyObject* kwargs)
{
}
static char Source_Doc[] =
PyDoc_STR("libBurn source object.");
PyTypeObject SourceType = {
PyObject_HEAD_INIT(NULL)
.tp_name = "burn.source",
.tp_basicsize = sizeof(Source),
.tp_dealloc = (destructor)Source_Free,
.tp_flags = Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE,
.tp_doc = Source_Doc,
.tp_init = (initproc)Source_Create,
};
extern int Source_Setup_Types(void)
{
SourceType.tp_new = PyType_GenericNew;
return PyType_Ready(&SourceType);
}

@ -0,0 +1,18 @@
#ifndef PYBURN_SOURCE_H
#define PYBURN_SOURCE_H
#include "Python.h"
#include "libburn/libburn.h"
typedef struct {
PyObject_HEAD
struct burn_source *source;
} Source;
extern PyTypeObject SourceType;
void Source_Free(Source* self);
int Source_Create(Source* self, PyObject* args, PyObject* kwargs);
int Source_Setup_Types(void);
#endif

@ -0,0 +1,31 @@
#include "toc_entry.h"
void TOCEntry_Free(TOCEntry* self)
{
}
int TOCEntry_Create(TOCEntry* self, PyObject* args)
{
}
static char TOCEntry_Doc[] =
PyDoc_STR("libBurn toc_entry object.");
PyTypeObject TOCEntryType = {
PyObject_HEAD_INIT(NULL)
.tp_name = "burn.toc_entry",
.tp_basicsize = sizeof(TOCEntry),
.tp_dealloc = (destructor)TOCEntry_Free,
.tp_flags = Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE,
.tp_doc = TOCEntry_Doc,
.tp_init = (initproc)TOCEntry_Create,
};
extern int TOCEntry_Setup_Types(void)
{
TOCEntryType.tp_new = PyType_GenericNew;
return PyType_Ready(&TOCEntryType);
}

@ -0,0 +1,18 @@
#ifndef PYBURN_TOC_ENTRY_H
#define PYBURN_TOC_ENTRY_H
#include "Python.h"
#include "libburn/libburn.h"
typedef struct {
PyObject_HEAD
struct burn_toc_entry *entry;
} TOCEntry;
extern PyTypeObject TOCEntryType;
void TOCEntry_Free(TOCEntry* self);
int TOCEntry_Create(TOCEntry* self, PyObject* args);
int TOCEntry_Setup_Types(void);
#endif

@ -0,0 +1,84 @@
#include "track.h"
void Track_Free(Track* self)
{
}
int Track_Create(Track* self, PyObject* args)
{
}
PyObject* Track_Define_Data(Track* self, PyObject* args)
{
}
PyObject* Track_Set_Isrc(Track* self, PyObject* args)
{
}
PyObject* Track_Clear_Isrc(Track* self, PyObject* args)
{
}
PyObject* Track_Set_Source(Track* self, PyObject* args)
{
}
PyObject* Track_Get_Sectors(Track* self, PyObject* args)
{
}
PyObject* Track_Get_Entry(Track* self, PyObject* args)
{
}
PyObject* Track_Get_Mode(Track* self, PyObject* args)
{
}
static char Track_Doc[] =
PyDoc_STR("libBurn track object.");
static PyMethodDef Track_Methods[] = {
{"define_data", (PyCFunction)Track_Define_Data, METH_VARARGS,
PyDoc_STR("Defines the data in the track.")},
{"set_isrc", (PyCFunction)Track_Set_Isrc, METH_VARARGS,
PyDoc_STR("Sets the ISRC details for the track.")},
{"clear_isrc", (PyCFunction)Track_Clear_Isrc, METH_VARARGS,
PyDoc_STR("Clears all ISRC details for the track.")},
{"set_source", (PyCFunction)Track_Set_Source, METH_VARARGS,
PyDoc_STR("Sets the track's data source.")},
{"get_sectors", (PyCFunction)Track_Get_Sectors, METH_VARARGS,
PyDoc_STR("Returns the number of sectors currently on the track.")},
{"get_entry", (PyCFunction)Track_Get_Entry, METH_VARARGS,
PyDoc_STR("Returns the TOC entry associated with the track.")},
{"get_mode", (PyCFunction)Track_Get_Mode, METH_VARARGS,
PyDoc_STR("Returns the current mode of the track.")},
{NULL, NULL}
};
PyTypeObject TrackType = {
PyObject_HEAD_INIT(NULL)
.tp_name = "burn.track",
.tp_basicsize = sizeof(Track),
.tp_dealloc = (destructor)Track_Free,
.tp_flags = Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE,
.tp_doc = Track_Doc,
.tp_methods = Track_Methods,
.tp_init = (initproc)Track_Create,
};
extern int Track_Setup_Types(void)
{
TrackType.tp_new = PyType_GenericNew;
return PyType_Ready(&TrackType);
}

@ -0,0 +1,26 @@
#ifndef PYBURN_TRACK_H
#define PYBURN_TRACK_H
#include "Python.h"
#include "libburn/libburn.h"
typedef struct {
PyObject_HEAD
struct burn_track *track;
} Track;
extern PyTypeObject TrackType;
void Track_Free(Track* self);
int Track_Create(Track* self, PyObject* args);
PyObject* Track_Define_Data(Track* self, PyObject* args);
PyObject* Track_Set_Isrc(Track* self, PyObject* args);
PyObject* Track_Clear_Isrc(Track* self, PyObject* args);
PyObject* Track_Set_Source(Track* self, PyObject* args);
PyObject* Track_Get_Sectors(Track* self, PyObject* args);
PyObject* Track_Get_Entry(Track* self, PyObject* args);
PyObject* Track_Get_Mode(Track* self, PyObject* args);
int Track_Setup_Types(void);
#endif

@ -0,0 +1,94 @@
#include "write_opts.h"
void WriteOpts_Free(WriteOpts* self)
{
}
int WriteOpts_Create(WriteOpts* self, PyObject* args)
{
}
PyObject* WriteOpts_Set_Write_Type(WriteOpts* self, PyObject* args)
{
}
PyObject* WriteOpts_Set_TOC_Entries(WriteOpts* self, PyObject* args)
{
}
PyObject* WriteOpts_Set_Format(WriteOpts* self, PyObject* args)
{
}
PyObject* WriteOpts_Set_Simulate(WriteOpts* self, PyObject* args)
{
}
PyObject* WriteOpts_Set_Underrun_Proof(WriteOpts* self, PyObject* args)
{
}
PyObject* WriteOpts_Set_Perform_OPC(WriteOpts* self, PyObject* args)
{
}
PyObject* WriteOpts_Set_Has_Mediacatalog(WriteOpts* self, PyObject* args)
{
}
PyObject* WriteOpts_Set_Mediacatalog(WriteOpts* self, PyObject* args)
{
}
static char WriteOpts_Doc[] =
PyDoc_STR("libBurn write_opts object.");
static PyMethodDef WriteOpts_Methods[] = {
{"set_write_type", (PyCFunction)WriteOpts_Set_Write_Type, METH_VARARGS,
PyDoc_STR("Sets the write type.")},
{"set_toc_entries", (PyCFunction)WriteOpts_Set_TOC_Entries, METH_VARARGS,
PyDoc_STR("Supplies TOC entries for writing.")},
{"set_format", (PyCFunction)WriteOpts_Set_Format, METH_VARARGS,
PyDoc_STR("Sets the session format for a disc.")},
{"set_simulate", (PyCFunction)WriteOpts_Set_Simulate, METH_VARARGS,
PyDoc_STR("Sets whether a simulation is performed.")},
{"set_underrun_proof", (PyCFunction)WriteOpts_Set_Underrun_Proof,
METH_VARARGS,
PyDoc_STR("Contols buffer underrun prevention.")},
{"set_perform_opc", (PyCFunction)WriteOpts_Set_Perform_OPC, METH_VARARGS,
PyDoc_STR("Sets whether OPC is used.")},
{"set_has_mediacatalog", (PyCFunction)WriteOpts_Set_Has_Mediacatalog,
METH_VARARGS,
PyDoc_STR("Controls whether the session will have a Mediacatalog.")},
{"set_mediacatalog",
(PyCFunction)WriteOpts_Set_Mediacatalog, METH_VARARGS,
PyDoc_STR("Sets the Mediacatalog for the session.")},
{NULL, NULL}
};
PyTypeObject WriteOptsType = {
PyObject_HEAD_INIT(NULL)
.tp_name = "burn.read_opts",
.tp_basicsize = sizeof(WriteOpts),
.tp_dealloc = (destructor)WriteOpts_Free,
.tp_flags = Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE,
.tp_doc = WriteOpts_Doc,
.tp_methods = WriteOpts_Methods,
.tp_init = (initproc)WriteOpts_Create,
};
extern int WriteOpts_Setup_Types(void)
{
WriteOptsType.tp_new = PyType_GenericNew;
return PyType_Ready(&WriteOptsType);
}

@ -0,0 +1,27 @@
#ifndef PYBURN_WRITE_OPTS_H
#define PYBURN_WRITE_OPTS_H
#include "Python.h"
#include "libburn/libburn.h"
typedef struct {
PyObject_HEAD
struct burn_read_opts *opts;
} WriteOpts;
extern PyTypeObject WriteOptsType;
void WriteOpts_Free(WriteOpts* self);
int WriteOpts_Create(WriteOpts* self, PyObject* args);
PyObject* WriteOpts_Set_Write_Type(WriteOpts* self, PyObject* args);
PyObject* WriteOpts_Set_TOC_Entries(WriteOpts* self, PyObject* args);
PyObject* WriteOpts_Set_Format(WriteOpts* self, PyObject* args);
PyObject* WriteOpts_Set_Simulate(WriteOpts* self, PyObject* args);
PyObject* WriteOpts_Set_Underrun_Proof(WriteOpts* self, PyObject* args);
PyObject* WriteOpts_Set_Perform_OPC(WriteOpts* self, PyObject* args);
PyObject* WriteOpts_Set_Has_Mediacatalog(WriteOpts* self, PyObject* args);
PyObject* WriteOpts_Set_Mediacatalog(WriteOpts* self, PyObject* args);
int WriteOpts_Setup_Types(void);
#endif

@ -0,0 +1,5 @@
Developers:
Mario Danic
Thomas Schmitt
Lorenzo Taylor

@ -0,0 +1,2 @@
Joe Neeman
Philippe Rouquier

@ -0,0 +1,280 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component