Commit eb827cc9 authored by Philippe Rouquier's avatar Philippe Rouquier

Plugin based backend system

svn path=/trunk/; revision=264
parent 8caf8947
2007-07-28 Rouquier Philippe <bonfire-app@wanadoo.fr>
Preliminary work on plugin based backend (lots of changes).
Cleanups which tend to a better separation between UI and backend.
BE CAREFUL, THIS IS HIGHLY UNSTABLE.
So far, it was tested and proved to work with woodim, growisofs, genisoimage.
2007-07-28 Rouquier Philippe <bonfire-app@wanadoo.fr>
* data/Makefile.am:
fixed small problem with previous patch (maybe did not apply)
2007-07-27 Luis Medinas <lmedinas@svn.gnome.org>
* data/Makefile.am:
......
......@@ -4,19 +4,18 @@ AC_CONFIG_SRCDIR(src/main.c)
BRASERO_MAJOR_VERSION=0
BRASERO_MINOR_VERSION=6
BRASERO_SUB=0
BRASERO_SUB=90
BRASERO_VERSION=$BRASERO_MAJOR_VERSION.$BRASERO_MINOR_VERSION.$BRASERO_SUB
LT_REVISION=1
LT_AGE=1
LT_CURRENT=1
AC_SUBST(BRASERO_MAJOR_VERSION)
AC_SUBST(BRASERO_MINOR_VERSION)
AC_SUBST(BRASERO_SUB)
AC_SUBST(BRASERO_VERSION)
LT_REVISION=1
LT_AGE=1
LT_CURRENT=1
AC_SUBST(LT_CURRENT)
AC_SUBST(LT_REVISION)
AC_SUBST(LT_AGE)
......@@ -32,6 +31,7 @@ AM_CONFIG_HEADER(config.h)
dnl ***************** GENERAL **********************************
AC_DISABLE_STATIC
AC_PROG_LIBTOOL
AC_PROG_CC
AM_PROG_CC_STDC
......@@ -43,6 +43,7 @@ AC_SYS_LARGEFILE
dnl ********** GNOME2 ******************************
GLIB_REQUIRED=2.6.0
GMODULE_REQUIRED=2.6.0
GDK_REQUIRED=2.6.0
GTK_REQUIRED=2.10.0
LIBGNOME_REQUIRED=2.10.0
......@@ -53,23 +54,52 @@ GSTREAMER_BASE_REQUIRED=0.10.0
LIBXML2_REQUIRED=2.6.0
NAUTILUS_BURN_REQUIRED=2.16.0
PKG_CHECK_MODULES(BRASERO, \
glib-2.0 >= $GLIB_REQUIRED \
dnl ** used by brasero and one plugin
PKG_CHECK_MODULES(BRASERO_GSTREAMER, \
gstreamer-0.10 >= $GSTREAMER_REQUIRED \
gstreamer-plugins-base-0.10 >= $GSTREAMER_BASE_REQUIRED)
AC_SUBST(BRASERO_GSTREAMER_CFLAGS)
AC_SUBST(BRASERO_GSTREAMER_LIBS)
BRASERO_GSTREAMER_CFLAGS="$BRASERO_GSTREAMER_CFLAGS $CFLAGS"
BRASERO_GSTREAMER_LIBS="$BRASERO_GSTREAMER_LIBS $LDFLAGS"
dnl ** used by brasero and one plugin
PKG_CHECK_MODULES(BRASERO_GNOMEVFS, \
gnome-vfs-2.0 >= $GNOME_VFS_REQUIRED \
gnome-vfs-module-2.0)
AC_SUBST(BRASERO_GNOMEVFS_CFLAGS)
AC_SUBST(BRASERO_GNOMEVFS_LIBS)
BRASERO_GNOMEVFS_CFLAGS="$BRASERO_GNOMEVFS_CFLAGS $CFLAGS"
BRASERO_GNOMEVFS_LIBS="$BRASERO_GNOMEVFS_LIBS $LDFLAGS"
dnl ** used by brasero and all modules
PKG_CHECK_MODULES(BRASERO_BASE, \
libnautilus-burn >= $NAUTILUS_BURN_REQUIRED \
glib-2.0 >= $GLIB_REQUIRED)
AC_SUBST(BRASERO_BASE_CFLAGS)
AC_SUBST(BRASERO_BASE_LIBS)
BRASERO_BASE_CFLAGS="$BRASERO_BASE_CFLAGS $BRASERO_GNOMEVFS_CFLAGS $CFLAGS"
BRASERO_BASE_LIBS="$BRASERO_BASE_LIBS $LDFLAGS"
dnl ** used only by brasero app itself ***
PKG_CHECK_MODULES(BRASERO, \
gmodule-2.0 >= $GMODULE_REQUIRED \
gdk-2.0 >= $GDK_REQUIRED \
gtk+-2.0 >= $GTK_REQUIRED \
libgnome-2.0 >= $LIBGNOME_REQUIRED \
libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED \
gnome-vfs-2.0 >= $GNOME_VFS_REQUIRED \
gnome-vfs-module-2.0 \
libnautilus-burn >= $NAUTILUS_BURN_REQUIRED \
gstreamer-0.10 >= $GSTREAMER_REQUIRED \
gstreamer-plugins-base-0.10 >= $GSTREAMER_BASE_REQUIRED \
libxml-2.0 >= $LIBXML2_REQUIRED)
AC_SUBST(BRASERO_CFLAGS)
AC_SUBST(BRASERO_LIBS)
BRASERO_CFLAGS="$BRASERO_CFLAGS $CFLAGS"
BRASERO_LIBS="$BRASERO_LIBS $LDFLAGS"
BRASERO_CFLAGS="$BRASERO_BASE_CFLAGS $BRASERO_GSTREAMER_CFLAGS $BRASERO_GNOMEVFS_CFLAGS $BRASERO_CFLAGS $CFLAGS"
BRASERO_LIBS="$BRASERO_BASE_LIBS $BRASERO_BASE_LIBS $BRASERO_GNOMEVFS_LIBS $BRASERO_LIBS $LDFLAGS"
dnl ****************check for libburn (optional)**************
LIBBURN_REQUIRED=0.3.4
......@@ -244,6 +274,16 @@ data/icons/scalable/Makefile
data/icons/scalable/apps/Makefile
data/icons/scalable/actions/Makefile
data/icons/scalable/status/Makefile
src/plugins/Makefile
src/plugins/cdrdao/Makefile
src/plugins/cdrkit/Makefile
src/plugins/cdrtools/Makefile
src/plugins/growisofs/Makefile
src/plugins/libburnia/Makefile
src/plugins/transcode/Makefile
src/plugins/dvdcss/Makefile
src/plugins/checksum/Makefile
src/plugins/local-track/Makefile
po/Makefile.in
src/Makefile
])
......
SUBDIRS = plugins
DISABLE_DEPRECATED = -DG_DISABLE_DEPRECATED \
-DGDK_DISABLE_DEPRECATED \
-DGDK_PIXBUF_DISABLE_DEPRECATED \
......@@ -7,22 +7,21 @@ DISABLE_DEPRECATED = -DG_DISABLE_DEPRECATED \
-DGNOME_DISABLE_DEPRECATED
INCLUDES = \
-I$(top_srcdir) \
-I$(top_builddir) \
-I./scsi \
-I$(top_srcdir) \
-I$(top_builddir) \
-I./scsi \
-I./md5 \
-DBRASERO_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \
-DBRASERO_PREFIX=\"$(prefix)\" \
-DBRASERO_SYSCONFDIR=\"$(sysconfdir)\" \
-DBRASERO_DATADIR=\"$(datadir)/brasero\" \
-DBRASERO_LIBDIR=\"$(libdir)\" \
$(DISABLE_DEPRECATED) \
-DBRASERO_PREFIX=\"$(prefix)\" \
-DBRASERO_SYSCONFDIR=\"$(sysconfdir)\" \
-DBRASERO_DATADIR=\"$(datadir)/brasero\" \
-DBRASERO_LIBDIR=\"$(libdir)\" \
$(DISABLE_DEPRECATED) \
$(BRASERO_CFLAGS)
CLEANFILES = $(RECMARSHALFILES)
AM_CFLAGS =\
-Wall\
-g
AM_CFLAGS = -Wall -g
EXTRA_DIST = cd-content-marshal.list
......@@ -48,13 +47,11 @@ brasero_SOURCES = \
mime-filter.h \
play-list.c \
play-list.h \
player.c \
player.h \
brasero-player.c \
brasero-player.h \
menu.h \
recorder-selection.c \
recorder-selection.h \
burn-dialog.c \
burn-dialog.h \
brasero-burn-dialog.c \
brasero-burn-dialog.h \
disc-copy-dialog.c \
disc-copy-dialog.h \
blank-dialog.c \
......@@ -65,54 +62,32 @@ brasero_SOURCES = \
inotify-syscalls.h \
filtered-window.c \
filtered-window.h \
disc.c \
disc.h \
data-disc.c \
data-disc.h \
brasero-disc.c \
brasero-disc.h \
brasero-data-disc.c \
brasero-data-disc.h \
audio-disc.c \
audio-disc.h \
project.c \
project.h \
project-type-chooser.c \
project-type-chooser.h \
player-bacon.c \
player-bacon.h \
brasero-audio-disc.h \
brasero-project.c \
brasero-project.h \
brasero-project-type-chooser.c \
brasero-project-type-chooser.h \
brasero-player-bacon.c \
brasero-player-bacon.h \
progress.c \
progress.h \
brasero-progress.h \
song-properties.c \
song-properties.h \
tray.c \
tray.h \
brasero-tray.h \
burn.c \
burn.h \
burn-job.c \
burn-job.h \
burn-process.c \
burn-process.h \
burn-recorder.c \
burn-recorder.h \
burn-imager.c \
burn-imager.h \
burn-mkisofs.c \
burn-mkisofs.h \
burn-cdrecord.c \
burn-cdrecord.h \
burn-cdrdao.c \
burn-cdrdao.h \
burn-growisofs.c \
burn-growisofs.h \
burn-readcd.c \
burn-readcd.h \
burn-mkisofs-base.c \
burn-mkisofs-base.h \
burn-dvd-rw-format.c \
burn-dvd-rw-format.h \
burn-transcode.c \
burn-transcode.h \
burn-basics.h \
burn-basics.c \
burn-common.c \
burn-common.h \
burn-caps.c \
burn-caps.h \
brasero-session.c \
......@@ -126,34 +101,15 @@ brasero_SOURCES = \
brasero-layout.h \
brasero-file-chooser.c \
brasero-file-chooser.h \
burn-local-image.c \
burn-local-image.h \
brasero-project-size.c \
brasero-project-size.h \
burn-sum.c \
burn-sum.h \
burn-session.c \
burn-session.h \
burn-libburn.c \
burn-libburn.h \
burn-libisofs.c \
burn-libisofs.h \
burn-libread-disc.c \
burn-libread-disc.h \
burn-libburn-common.c \
burn-libburn-common.h \
brasero-sum-dialog.c \
brasero-sum-dialog.h \
brasero-tool-dialog.c \
brasero-tool-dialog.h \
brasero-ncb.h \
brasero-ncb.c \
burn-md5.c \
burn-md5.h \
burn-xfer.c \
burn-xfer.h \
brasero-sum-check.c \
brasero-sum-check.h \
burn-task.c \
burn-task.h \
brasero-vfs.c \
......@@ -168,19 +124,14 @@ brasero_SOURCES = \
brasero-image-option-dialog.h \
brasero-disc-option-dialog.c \
brasero-disc-option-dialog.h \
burn-toc2cue.c \
burn-toc2cue.h \
brasero-image-type-chooser.c \
brasero-image-type-chooser.h \
burn-iso9660.c \
burn-iso9660.h \
brasero-layout-object.c \
brasero-layout-object.h \
burn-dvdcss.c \
burn-dvdcss.h \
burn-volume.c \
burn-volume.h \
burn-dvdcss-private.h \
burn-susp.c \
burn-susp.h \
burn-iso-field.c \
......@@ -224,7 +175,35 @@ brasero_SOURCES = \
scsi/scsi-read-format-capacities.c \
scsi/scsi-read-format-capacities.h \
burn-debug.c \
burn-debug.h
burn-debug.h \
burn-track.h \
burn-plugin.h \
burn-plugin.c \
burn-plugin-private.h \
burn-plugin-manager.c \
burn-plugin-manager.h \
burn-task-ctx.h \
burn-task-item.c \
burn-task-item.h \
burn-task-ctx.c \
burn-mkisofs-base.c \
burn-mkisofs-base.h \
brasero-drive-selection.h \
brasero-drive-selection.c \
brasero-src-selection.h \
brasero-src-selection.c \
brasero-dest-selection.h \
brasero-dest-selection.c \
brasero-drive-info.c \
brasero-drive-info.h \
brasero-drive-properties.h \
brasero-drive-properties.c \
brasero-image-properties.h \
brasero-image-properties.c \
brasero-xfer.c \
brasero-xfer.h \
burn-session.c \
burn-track.c
brasero_LDADD = $(BRASERO_LIBS)
......@@ -267,6 +246,42 @@ brasero_LDADD = $(BRASERO_LIBS)
......
......@@ -22,15 +22,14 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <time.h>
#include <errno.h>
#include <string.h>
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <glib.h>
#include <glib/gstdio.h>
#include <glib/gi18n.h>
......@@ -65,8 +64,8 @@
#include <libgnomevfs/gnome-vfs-file-info.h>
#include "burn-basics.h"
#include "disc.h"
#include "audio-disc.h"
#include "brasero-disc.h"
#include "brasero-audio-disc.h"
#include "metadata.h"
#include "utils.h"
#include "song-properties.h"
......@@ -99,17 +98,16 @@ static BraseroDiscResult
brasero_audio_disc_get_track (BraseroDisc *disc,
BraseroDiscTrack *track);
static BraseroDiscResult
brasero_audio_disc_get_track_source (BraseroDisc *disc,
BraseroTrackSource **source,
BraseroImageFormat format);
static BraseroDiscResult
brasero_audio_disc_get_track_type (BraseroDisc *disc,
BraseroTrackSourceType *source,
BraseroImageFormat *format);
static BraseroDiscResult
brasero_audio_disc_load_track (BraseroDisc *disc,
BraseroDiscTrack *track);
static BraseroDiscResult
brasero_audio_disc_set_session_param (BraseroDisc *disc,
BraseroBurnSession *session);
static BraseroDiscResult
brasero_audio_disc_set_session_contents (BraseroDisc *disc,
BraseroBurnSession *session);
static BraseroDiscResult
brasero_audio_disc_add_uri (BraseroDisc *disc,
const char *uri);
......@@ -421,18 +419,19 @@ brasero_audio_disc_iface_disc_init (BraseroDiscIface *iface)
iface->clear = brasero_audio_disc_clear;
iface->reset = brasero_audio_disc_reset;
iface->get_track = brasero_audio_disc_get_track;
iface->get_track_source = brasero_audio_disc_get_track_source;
iface->get_track_type = brasero_audio_disc_get_track_type;
iface->set_session_param = brasero_audio_disc_set_session_param;
iface->set_session_contents = brasero_audio_disc_set_session_contents;
iface->load_track = brasero_audio_disc_load_track;
iface->get_status = brasero_audio_disc_get_status;
iface->get_selected_uri = brasero_audio_disc_get_selected_uri;
iface->fill_toolbar = brasero_audio_disc_fill_toolbar;
}
static void brasero_audio_disc_get_property (GObject * object,
guint prop_id,
GValue * value,
GParamSpec * pspec)
static void
brasero_audio_disc_get_property (GObject * object,
guint prop_id,
GValue * value,
GParamSpec * pspec)
{
BraseroAudioDisc *disc;
......@@ -448,10 +447,11 @@ static void brasero_audio_disc_get_property (GObject * object,
}
}
static void brasero_audio_disc_set_property (GObject * object,
guint prop_id,
const GValue * value,
GParamSpec * pspec)
static void
brasero_audio_disc_set_property (GObject * object,
guint prop_id,
const GValue * value,
GParamSpec * pspec)
{
BraseroAudioDisc *disc;
......@@ -1695,79 +1695,68 @@ brasero_audio_disc_get_track (BraseroDisc *disc,
}
static BraseroDiscResult
brasero_audio_disc_get_track_source (BraseroDisc *disc,
BraseroTrackSource **source,
BraseroImageFormat format)
brasero_audio_disc_set_session_param (BraseroDisc *disc,
BraseroBurnSession *session)
{
BraseroTrackType type;
type.type = BRASERO_TRACK_TYPE_AUDIO;
type.subtype.audio_format = BRASERO_AUDIO_FORMAT_UNDEFINED;
brasero_burn_session_set_input_type (session, &type);
return BRASERO_BURN_OK;
}
static BraseroDiscResult
brasero_audio_disc_set_session_contents (BraseroDisc *disc,
BraseroBurnSession *session)
{
gchar *uri;
gchar *title;
gchar *artist;
GtkTreeIter iter;
GtkTreeModel *model;
BraseroSongFile *song;
BraseroTrack *track;
BraseroAudioDisc *audio;
BraseroTrackSource *src;
audio = BRASERO_AUDIO_DISC (disc);
model = gtk_tree_view_get_model (GTK_TREE_VIEW (audio->priv->tree));
if (!gtk_tree_model_get_iter_first (model, &iter))
return BRASERO_DISC_ERROR_EMPTY_SELECTION;
src = g_new0 (BraseroTrackSource, 1);
src->type = BRASERO_TRACK_SOURCE_SONG;
song = NULL;
track = NULL;
do {
gchar *uri;
gchar *title;
gchar *artist;
gint64 sectors;
BraseroSongInfo *info;
gtk_tree_model_get (model, &iter,
URI_COL, &uri,
NAME_COL, &title,
ARTIST_COL, &artist,
SECTORS_COL, &sectors,
-1);
if (!uri) {
gint64 sectors;
g_free (title);
g_free (artist);
/* This is a gap */
gtk_tree_model_get (model, &iter,
SECTORS_COL, &sectors,
-1);
if (song)
song->gap += sectors;
brasero_track_set_audio_boundaries (track,
0,
sectors);
continue;
}
song = g_new0 (BraseroSongFile, 1);
song->uri = uri;
song->title = title;
song->artist = artist;
info = g_new0 (BraseroSongInfo, 1);
info->title = title;
info->artist = artist;
track = brasero_track_new (BRASERO_TRACK_TYPE_AUDIO);
brasero_track_set_estimated_size (track, 2352, sectors, -1);
brasero_track_set_audio_source (track, uri, BRASERO_AUDIO_FORMAT_UNDEFINED);
brasero_track_set_audio_info (track, info);
brasero_burn_session_add_track (session, track);
src->contents.songs.files = g_slist_append (src->contents.songs.files, song);
} while (gtk_tree_model_iter_next (model, &iter));
*source = src;
return BRASERO_DISC_OK;
}
static BraseroDiscResult
brasero_audio_disc_get_track_type (BraseroDisc *disc,
BraseroTrackSourceType *type,
BraseroImageFormat *format)
{
if (type)
*type = BRASERO_TRACK_SOURCE_AUDIO;
if (format)
*format = BRASERO_IMAGE_FORMAT_NONE;
return BRASERO_BURN_OK;
}
/********************************* load track **********************************/
static BraseroDiscResult
brasero_audio_disc_load_track (BraseroDisc *disc,
......
......@@ -45,171 +45,112 @@
#include <nautilus-burn-drive.h>
#include "burn-basics.h"
#include "burn-session.h"
#include "burn.h"
#include "utils.h"
#include "brasero-tool-dialog.h"
#include "blank-dialog.h"
static void brasero_blank_dialog_class_init (BraseroBlankDialogClass *klass);
static void brasero_blank_dialog_init (BraseroBlankDialog *sp);
static void brasero_blank_dialog_finalize (GObject *object);
static gboolean brasero_blank_dialog_cancel (BraseroToolDialog *dialog);
static gboolean brasero_blank_dialog_activate (BraseroToolDialog *dialog,
NautilusBurnDrive *drive);
static void brasero_blank_dialog_media_changed (BraseroToolDialog *dialog,
BraseroMediumInfo media);
static void brasero_blank_dialog_device_opts_setup (BraseroBlankDialog *dialog,
BraseroMediumInfo type);
G_DEFINE_TYPE (BraseroBlankDialog, brasero_blank_dialog, BRASERO_TYPE_TOOL_DIALOG);
struct BraseroBlankDialogPrivate {
BraseroBurn *burn;
BraseroBurnSession *session;
BraseroBurnCaps *caps;
GtkWidget *fast_enabled;
GtkWidget *dummy_toggle;
};
static GObjectClass *parent_class = NULL;
GtkWidget *fast;
GtkWidget *dummy;
GType
brasero_blank_dialog_get_type ()
{
static GType type = 0;
if (type == 0) {
static const GTypeInfo our_info = {
sizeof (BraseroBlankDialogClass),
NULL,
NULL,
(GClassInitFunc) brasero_blank_dialog_class_init,
NULL,
NULL,
sizeof (BraseroBlankDialog),
0,
(GInstanceInitFunc) brasero_blank_dialog_init,
};
type = g_type_register_static (BRASERO_TYPE_TOOL_DIALOG,
"BraseroBlankDialog",
&our_info,
0);
}
return type;
}
guint caps_sig;
guint output_sig;
static void
brasero_blank_dialog_class_init (BraseroBlankDialogClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
BraseroToolDialogClass *tool_dialog_class = BRASERO_TOOL_DIALOG_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
guint fast_saved;
guint dummy_saved;
};
typedef struct BraseroBlankDialogPrivate BraseroBlankDialogPrivate;
object_class->finalize = brasero_blank_dialog_finalize;
#define BRASERO_BLANK_DIALOG_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), BRASERO_TYPE_BLANK_DIALOG, BraseroBlankDialogPrivate))
tool_dialog_class->activate = brasero_blank_dialog_activate;
tool_dialog_class->media_changed = brasero_blank_dialog_media_changed;
tool_dialog_class->cancel = brasero_blank_dialog_cancel;
}
static GObjectClass *parent_class = NULL;
static void
brasero_blank_dialog_init (BraseroBlankDialog *obj)
static guint
brasero_blank_dialog_set_button (BraseroBurnSession *session,
guint saved,
GtkWidget *button,
BraseroBurnFlag flag,
BraseroBurnFlag supported,
BraseroBurnFlag compulsory)
{
obj->priv = g_new0 (BraseroBlankDialogPrivate, 1);
obj->priv->caps = brasero_burn_caps_get_default ();
obj->priv->fast_enabled = gtk_check_button_new_with_label (_("fast blanking"));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (obj->priv->fast_enabled), TRUE);
obj->priv->dummy_toggle = gtk_check_button_new_with_label (_("simulation"));
brasero_tool_dialog_pack_options (BRASERO_TOOL_DIALOG (obj),
obj->priv->dummy_toggle,
obj->priv->fast_enabled,