Commit 620910aa authored by Philippe Rouquier's avatar Philippe Rouquier

Merge local changes (in a local git tree pulled from SVN) meant to port...

Merge local changes (in a local git tree pulled from SVN) meant to port nautilus extension to libbrasero-burn
parent 4a3bbf84
This diff is collapsed.
## Process this file with automake to produce Makefile.in.
SUBDIRS = libbrasero-utils libbrasero-media libbrasero-burn src po data docs help
SUBDIRS = libbrasero-utils libbrasero-media libbrasero-burn plugins src po data docs help
if BUILD_NAUTILUS
SUBDIRS += nautilus
......
......@@ -424,18 +424,18 @@ libbrasero-media/brasero-media.h
libbrasero-utils/Makefile
libbrasero-burn/Makefile
libbrasero-burn/brasero-burn-lib.h
libbrasero-burn/plugins/Makefile
libbrasero-burn/plugins/cdrdao/Makefile
libbrasero-burn/plugins/cdrkit/Makefile
libbrasero-burn/plugins/cdrtools/Makefile
libbrasero-burn/plugins/growisofs/Makefile
libbrasero-burn/plugins/libburnia/Makefile
libbrasero-burn/plugins/transcode/Makefile
libbrasero-burn/plugins/dvdcss/Makefile
libbrasero-burn/plugins/dvdauthor/Makefile
libbrasero-burn/plugins/checksum/Makefile
libbrasero-burn/plugins/local-track/Makefile
libbrasero-burn/plugins/vcdimager/Makefile
plugins/Makefile
plugins/cdrdao/Makefile
plugins/cdrkit/Makefile
plugins/cdrtools/Makefile
plugins/growisofs/Makefile
plugins/libburnia/Makefile
plugins/transcode/Makefile
plugins/dvdcss/Makefile
plugins/dvdauthor/Makefile
plugins/checksum/Makefile
plugins/local-track/Makefile
plugins/vcdimager/Makefile
po/Makefile.in
src/Makefile
])
......
SUBDIRS = plugins
INCLUDES = \
-I$(top_srcdir) \
-I$(top_builddir) \
......@@ -48,7 +46,10 @@ libbraseroburninclude_HEADERS = \
brasero-burn.h \
brasero-session-cfg.h \
brasero-burn-options.h \
brasero-burn-dialog.h
brasero-burn-dialog.h \
brasero-tool-dialog.h \
brasero-sum-dialog.h \
brasero-blank-dialog.h
libbrasero_burn_la_LIBADD = \
../libbrasero-media/libbrasero-media.la \
......@@ -63,14 +64,23 @@ libbrasero_burn_la_LIBADD = \
libbrasero_burn_la_LDFLAGS = \
-version-info $(LIBBRASERO_LT_VERSION) \
-no-undefined \
-export-dynamic \
$(AM_LDFLAGS)
# -export-symbols ./libbrasero-burn.symbols
libbrasero_burn_la_SOURCES = \
libbrasero-marshal.c \
libbrasero-marshal.h \
brasero-tool-dialog.c \
brasero-tool-dialog.h \
brasero-sum-dialog.c \
brasero-sum-dialog.h \
brasero-blank-dialog.c \
brasero-blank-dialog.h \
brasero-burn.c \
brasero-burn.h \
brasero-xfer.c \
brasero-xfer.h \
burn-basics.h \
burn-caps.h \
burn-dbus.h \
......@@ -156,7 +166,11 @@ libbrasero_burn_la_SOURCES = \
brasero-plugin-registration.h \
brasero-track-type.c \
brasero-track-type.h \
brasero-track-type-private.h
brasero-track-type-private.h \
brasero-status.c \
brasero-status.h \
brasero-status-dialog.c \
brasero-status-dialog.h
EXTRA_DIST = \
libbrasero-marshal.list
......
......@@ -180,7 +180,8 @@ brasero_burn_dialog_update_info (BraseroBurnDialog *dialog,
title = g_strdup (_("Brasero - Creating Image"));
}
else if (media & BRASERO_MEDIUM_DVD) {
if (BRASERO_STREAM_TRACK_HAS_VIDEO (input)) {
if (input->type == BRASERO_TRACK_TYPE_STREAM
&& BRASERO_STREAM_FORMAT_HAS_VIDEO (input->subtype.stream_format)) {
if (flags & BRASERO_BURN_FLAG_DUMMY) {
title = g_strdup (_("Brasero - Burning DVD (Simulation)"));
header = g_strdup_printf ("<big><b>%s</b></big>", _("Simulation of video DVD burning"));
......@@ -238,7 +239,8 @@ brasero_burn_dialog_update_info (BraseroBurnDialog *dialog,
}
}
else if (media & BRASERO_MEDIUM_CD) {
if (BRASERO_STREAM_TRACK_HAS_VIDEO (input)) {
if (input->type == BRASERO_TRACK_TYPE_STREAM
&& BRASERO_STREAM_FORMAT_HAS_VIDEO (input->subtype.stream_format)) {
if (flags & BRASERO_BURN_FLAG_DUMMY) {
title = g_strdup (_("Brasero - Burning CD (Simulation)"));
header = g_strdup_printf ("<big><b>%s</b></big>", _("Simulation of (S)VCD burning"));
......@@ -309,7 +311,8 @@ brasero_burn_dialog_update_info (BraseroBurnDialog *dialog,
GTK_ICON_SIZE_DIALOG);
}
}
else if (BRASERO_STREAM_TRACK_HAS_VIDEO (input)) {
else if (input->type == BRASERO_TRACK_TYPE_STREAM
&& BRASERO_STREAM_FORMAT_HAS_VIDEO (input->subtype.stream_format)) {
if (flags & BRASERO_BURN_FLAG_DUMMY) {
title = g_strdup (_("Brasero - Burning disc (Simulation)"));
header = g_strdup_printf ("<big><b>%s</b></big>", _("Simulation of video disc burning"));
......@@ -496,7 +499,6 @@ brasero_burn_dialog_insert_disc_cb (BraseroBurn *burn,
gchar *drive_name;
GtkWindow *window;
GtkWidget *message;
BraseroMedium *medium;
gboolean hide = FALSE;
BraseroBurnDialogPrivate *priv;
gchar *main_message = NULL, *secondary_message = NULL;
......@@ -609,21 +611,9 @@ brasero_burn_dialog_insert_disc_cb (BraseroBurn *burn,
gtk_widget_destroy (message);
/* see if we should update the infos */
medium = brasero_burn_session_get_src_medium (priv->session);
if (priv->input.type == BRASERO_TRACK_TYPE_DISC) {
BraseroDrive *src;
/* see if the drive is the source */
src = brasero_burn_session_get_src_drive (priv->session);
if (drive == src)
brasero_burn_dialog_update_info (dialog,
&priv->input,
brasero_medium_get_status (medium));
}
else
brasero_burn_dialog_update_info (dialog,
&priv->input,
brasero_medium_get_status (medium));
brasero_burn_dialog_update_info (dialog,
&priv->input,
brasero_burn_session_get_dest_media (priv->session));
if (hide)
gtk_widget_hide (GTK_WIDGET (dialog));
......@@ -1397,13 +1387,17 @@ static void
brasero_burn_dialog_activity_start (BraseroBurnDialog *dialog)
{
GdkCursor *cursor;
GdkWindow *window;
BraseroBurnDialogPrivate *priv;
priv = BRASERO_BURN_DIALOG_PRIVATE (dialog);
cursor = gdk_cursor_new (GDK_WATCH);
gdk_window_set_cursor (GTK_WIDGET (dialog)->window, NULL);
gdk_cursor_unref (cursor);
window = gtk_widget_get_window (GTK_WIDGET (dialog));
if (window) {
cursor = gdk_cursor_new (GDK_WATCH);
gdk_window_set_cursor (window, NULL);
gdk_cursor_unref (cursor);
}
gtk_button_set_use_stock (GTK_BUTTON (priv->cancel), TRUE);
gtk_button_set_label (GTK_BUTTON (priv->cancel), GTK_STOCK_CANCEL);
......@@ -2082,6 +2076,44 @@ brasero_burn_dialog_record_session (BraseroBurnDialog *dialog,
return BRASERO_BURN_OK;
}
static gboolean
brasero_burn_dialog_wait_for_ready_state (BraseroBurnDialog *dialog)
{
BraseroBurnDialogPrivate *priv;
BraseroBurnResult result;
BraseroStatus *status;
priv = BRASERO_BURN_DIALOG_PRIVATE (dialog);
status = brasero_status_new ();
result = brasero_burn_session_get_status (priv->session, status);
while (brasero_status_get_result (status) == BRASERO_BURN_NOT_READY) {
gdouble progress;
gchar *action;
action = brasero_status_get_current_action (status);
brasero_burn_dialog_action_changed_real (dialog,
BRASERO_BURN_ACTION_GETTING_SIZE,
action);
g_free (action);
progress = brasero_status_get_progress (status);
brasero_burn_dialog_progress_changed_real (dialog,
0,
0,
0,
progress,
progress,
-1.0,
brasero_burn_session_get_dest_media (priv->session));
result = brasero_burn_session_get_status (priv->session, status);
}
brasero_status_free (status);
return (result == BRASERO_BURN_OK);
}
gboolean
brasero_burn_dialog_run (BraseroBurnDialog *dialog,
BraseroBurnSession *session)
......@@ -2095,6 +2127,10 @@ brasero_burn_dialog_run (BraseroBurnDialog *dialog,
g_object_ref (session);
priv->session = session;
/* wait for ready state */
if (!brasero_burn_dialog_wait_for_ready_state (dialog))
return FALSE;
/* disable autoconfiguration */
if (BRASERO_IS_SESSION_CFG (priv->session))
brasero_session_cfg_disable (BRASERO_SESSION_CFG (priv->session));
......
......@@ -33,7 +33,9 @@
#include <glib.h>
#include <brasero-enums.h>
#include <brasero-error.h>
#include <brasero-track-type.h>
G_BEGIN_DECLS
......@@ -78,6 +80,9 @@ brasero_burn_library_get_plugins_list (void);
gboolean
brasero_burn_library_can_checksum (void);
BraseroBurnResult
brasero_burn_library_input_supported (BraseroTrackType *type);
BraseroMedia
brasero_burn_library_get_media_capabilities (BraseroMedia media);
......
......@@ -51,6 +51,8 @@
#include "brasero-session-cfg.h"
#include "brasero-dest-selection.h"
#include "brasero-medium-properties.h"
#include "brasero-status-dialog.h"
#include "brasero-track-stream.h"
#include "brasero-notify.h"
#include "brasero-misc.h"
......@@ -72,6 +74,9 @@ struct _BraseroBurnOptionsPrivate
GtkWidget *options;
GtkWidget *button;
guint not_ready_id;
GtkWidget *status_dialog;
guint is_valid:1;
};
......@@ -137,7 +142,7 @@ brasero_burn_options_add_options (BraseroBurnOptions *self,
priv = BRASERO_BURN_OPTIONS_PRIVATE (self);
gtk_container_add (GTK_CONTAINER (priv->options), options);
gtk_box_pack_start (GTK_BOX (priv->options), options, FALSE, TRUE, 0);
gtk_widget_show (priv->options);
}
......@@ -246,16 +251,37 @@ brasero_burn_options_update_no_medium_warning (BraseroBurnOptions *self)
BRASERO_BURN_OPTIONS_NO_MEDIUM_WARNING);
}
static gboolean
brasero_burn_options_not_ready_dialog_cb (gpointer data)
{
BraseroBurnOptionsPrivate *priv;
GtkWidget *status_dialog;
BraseroBurnResult result;
priv = BRASERO_BURN_OPTIONS_PRIVATE (data);
priv->not_ready_id = 0;
status_dialog = brasero_status_dialog_new ();
result = brasero_status_dialog_wait_for_session (BRASERO_STATUS_DIALOG (status_dialog),
GTK_WIDGET (data),
BRASERO_BURN_SESSION (priv->session));
gtk_widget_destroy (status_dialog);
if (result != BRASERO_BURN_OK)
gtk_dialog_response (GTK_DIALOG (data), GTK_RESPONSE_CANCEL);
return FALSE;
}
static void
brasero_burn_options_valid_media_cb (BraseroSessionCfg *session,
BraseroBurnOptions *self)
brasero_burn_options_update_valid (BraseroBurnOptions *self)
{
BraseroBurnOptionsPrivate *priv;
BraseroSessionError valid;
valid = brasero_session_cfg_get_error (session);
priv = BRASERO_BURN_OPTIONS_PRIVATE (self);
valid = brasero_session_cfg_get_error (priv->session);
priv->is_valid = BRASERO_SESSION_IS_VALID (valid);
gtk_widget_set_sensitive (priv->button, priv->is_valid);
......@@ -271,6 +297,26 @@ brasero_burn_options_valid_media_cb (BraseroSessionCfg *session,
brasero_notify_message_remove (BRASERO_NOTIFY (priv->message_output),
BRASERO_NOTIFY_CONTEXT_SIZE);
if (valid == BRASERO_SESSION_NOT_READY) {
if (!priv->not_ready_id && !priv->status_dialog) {
gtk_widget_set_sensitive (GTK_WIDGET (self), FALSE);
priv->not_ready_id = g_timeout_add_seconds (1,
brasero_burn_options_not_ready_dialog_cb,
self);
}
}
else {
gtk_widget_set_sensitive (GTK_WIDGET (self), TRUE);
if (priv->status_dialog)
gtk_dialog_response (GTK_DIALOG (priv->status_dialog),
GTK_RESPONSE_CANCEL);
if (priv->not_ready_id) {
g_source_remove (priv->not_ready_id);
priv->not_ready_id = 0;
}
}
if (valid == BRASERO_SESSION_INSUFFICIENT_SPACE) {
brasero_notify_message_add (BRASERO_NOTIFY (priv->message_output),
_("Please choose another CD or DVD or insert a new one."),
......@@ -292,6 +338,34 @@ brasero_burn_options_valid_media_cb (BraseroSessionCfg *session,
-1,
BRASERO_NOTIFY_CONTEXT_SIZE);
}
else if (valid == BRASERO_SESSION_EMPTY) {
BraseroTrackType *type;
BraseroBurnResult result;
type = brasero_track_type_new ();
result = brasero_burn_session_get_input_type (BRASERO_BURN_SESSION (priv->session), type);
if (brasero_track_type_get_has_data (type))
brasero_notify_message_add (BRASERO_NOTIFY (priv->message_output),
_("Please add files."),
_("The project is empty"),
-1,
BRASERO_NOTIFY_CONTEXT_SIZE);
else if (!BRASERO_STREAM_FORMAT_HAS_VIDEO (brasero_track_type_get_stream_format (type)))
brasero_notify_message_add (BRASERO_NOTIFY (priv->message_output),
_("Please add songs."),
_("The project is empty"),
-1,
BRASERO_NOTIFY_CONTEXT_SIZE);
else
brasero_notify_message_add (BRASERO_NOTIFY (priv->message_output),
_("Please add videos."),
_("The project is empty"),
-1,
BRASERO_NOTIFY_CONTEXT_SIZE);
brasero_track_type_free (type);
return;
}
else if (valid == BRASERO_SESSION_NO_INPUT_MEDIUM) {
GtkWidget *message;
......@@ -368,7 +442,7 @@ brasero_burn_options_valid_media_cb (BraseroSessionCfg *session,
G_CALLBACK (brasero_burn_options_message_response_cb),
self);
}
else if (brasero_burn_session_same_src_dest_drive (BRASERO_BURN_SESSION (session))) {
else if (brasero_burn_session_same_src_dest_drive (BRASERO_BURN_SESSION (priv->session))) {
/* The medium is valid but it's a special case */
brasero_notify_message_add (BRASERO_NOTIFY (priv->message_output),
_("The drive that holds the source disc will also be the one used to record."),
......@@ -381,6 +455,13 @@ brasero_burn_options_valid_media_cb (BraseroSessionCfg *session,
gtk_window_resize (GTK_WINDOW (self), 10, 10);
}
static void
brasero_burn_options_valid_cb (BraseroSessionCfg *session,
BraseroBurnOptions *self)
{
brasero_burn_options_update_valid (self);
}
static void
brasero_burn_options_init (BraseroBurnOptions *object)
{
......@@ -472,17 +553,23 @@ brasero_burn_options_build_contents (BraseroBurnOptions *object)
0);
/* Create a lower box for options */
priv->options = gtk_alignment_new (0.0, 0.5, 1.0, 1.0);
alignment = gtk_alignment_new (0.0, 0.5, 1.0, 1.0);
gtk_widget_show (alignment);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (object)->vbox),
priv->options,
alignment,
FALSE,
TRUE,
0);
priv->options = gtk_vbox_new (FALSE, 0);
gtk_container_add (GTK_CONTAINER (alignment), priv->options);
priv->valid_sig = g_signal_connect (priv->session,
"is-valid",
G_CALLBACK (brasero_burn_options_valid_media_cb),
G_CALLBACK (brasero_burn_options_valid_cb),
object);
brasero_burn_options_update_valid (object);
}
static void
......@@ -492,6 +579,11 @@ brasero_burn_options_finalize (GObject *object)
priv = BRASERO_BURN_OPTIONS_PRIVATE (object);
if (priv->not_ready_id) {
g_source_remove (priv->not_ready_id);
priv->not_ready_id = 0;
}
if (priv->valid_sig) {
g_signal_handler_disconnect (priv->session,
priv->valid_sig);
......@@ -528,9 +620,9 @@ brasero_burn_options_set_property (GObject *object,
case PROP_SESSION: /* Readable and only writable at creation time */
priv->session = BRASERO_SESSION_CFG (g_value_get_object (value));
g_object_ref (priv->session);
brasero_burn_options_build_contents (BRASERO_BURN_OPTIONS (object));
g_object_notify (object, "session");
brasero_burn_options_build_contents (BRASERO_BURN_OPTIONS (object));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
......
......@@ -2294,7 +2294,7 @@ brasero_burn_check (BraseroBurn *self,
track = tracks->data;
/* if the input is a DISC, ask/check there is one and lock it (as dest) */
if (BRASERO_TRACK_IMAGE (track)) {
if (BRASERO_IS_TRACK_IMAGE (track)) {
/* make sure there is a disc. If not, ask one and lock it */
result = brasero_burn_lock_checksum_media (self, error);
if (result != BRASERO_BURN_OK)
......@@ -2542,6 +2542,10 @@ brasero_burn_record (BraseroBurn *burn,
priv = BRASERO_BURN_PRIVATE (burn);
/* make sure we're ready */
if (brasero_burn_session_get_status (session, NULL) != BRASERO_BURN_OK)
return BRASERO_BURN_ERR;
g_object_ref (session);
priv->session = session;
......
......@@ -470,7 +470,7 @@ brasero_drive_properties_set_drive (BraseroDriveProperties *self,
GtkTreeModel *model;
gchar *display_name;
GtkTreeIter iter;
gint64 *rates;
guint64 *rates;
gchar *header;
gchar *text;
guint i;
......
......@@ -46,6 +46,7 @@ typedef enum {
BRASERO_BURN_ERROR_DRIVE_BUSY,
BRASERO_BURN_ERROR_DISK_SPACE,
BRASERO_BURN_ERROR_EMPTY,
BRASERO_BURN_ERROR_INPUT_INVALID,
BRASERO_BURN_ERROR_OUTPUT_NONE,
......
......@@ -50,6 +50,7 @@
#include "brasero-tags.h"
#include "brasero-track-image.h"
#include "brasero-session-cfg.h"
#include "brasero-burn-lib.h"
typedef struct _BraseroSessionCfgPrivate BraseroSessionCfgPrivate;
struct _BraseroSessionCfgPrivate
......@@ -611,6 +612,7 @@ brasero_session_cfg_update (BraseroSessionCfg *self,
BraseroTrackType *source = NULL;
BraseroSessionCfgPrivate *priv;
BraseroBurnResult result;
BraseroStatus *status;
BraseroDrive *burner;
priv = BRASERO_SESSION_CFG_PRIVATE (self);
......@@ -618,6 +620,40 @@ brasero_session_cfg_update (BraseroSessionCfg *self,
if (priv->configuring)
return;
/* Make sure the session is ready */
status = brasero_status_new ();
result = brasero_burn_session_get_status (BRASERO_BURN_SESSION (self), status);
if (result == BRASERO_BURN_NOT_READY) {
brasero_status_free (status);
priv->is_valid = BRASERO_SESSION_NOT_READY;
g_signal_emit (self,
session_cfg_signals [IS_VALID_SIGNAL],
0);
return;
}
else if (result == BRASERO_BURN_ERR) {
GError *error;
error = brasero_status_get_error (status);
if (error) {
if (error->code == BRASERO_BURN_ERROR_EMPTY) {
brasero_status_free (status);
g_error_free (error);
priv->is_valid = BRASERO_SESSION_EMPTY;
g_signal_emit (self,
session_cfg_signals [IS_VALID_SIGNAL],
0);
return;
}
g_error_free (error);
}
}
brasero_status_free (status);
/* Make sure there is a source */
source = brasero_track_type_new ();
brasero_burn_session_get_input_type (BRASERO_BURN_SESSION (self), source);
......@@ -751,7 +787,7 @@ brasero_session_cfg_update (BraseroSessionCfg *self,
if (result != BRASERO_BURN_OK) {
if (brasero_track_type_get_has_medium (source)
&& (brasero_track_type_get_medium_type (source) & BRASERO_MEDIUM_PROTECTED)
&& brasero_track_type_supported (source) != BRASERO_BURN_OK) {
&& brasero_burn_library_input_supported (source) != BRASERO_BURN_OK) {
/* This is a special case to display a helpful message */
priv->is_valid = BRASERO_SESSION_DISC_PROTECTED;
g_signal_emit (self,
......
......@@ -72,7 +72,9 @@ GType brasero_session_cfg_get_type (void) G_GNUC_CONST;
typedef enum {
BRASERO_SESSION_VALID = 0,
BRASERO_SESSION_NO_CD_TEXT = 1,
BRASERO_SESSION_NO_INPUT_IMAGE = 2,
BRASERO_SESSION_NOT_READY,
BRASERO_SESSION_EMPTY,
BRASERO_SESSION_NO_INPUT_IMAGE,
BRASERO_SESSION_UNKNOWN_IMAGE,
BRASERO_SESSION_NO_INPUT_MEDIUM,
BRASERO_SESSION_NO_OUTPUT,
......
......@@ -288,6 +288,108 @@ brasero_burn_session_get_tracks (BraseroBurnSession *self)
return priv->tracks;
}
BraseroBurnResult
brasero_burn_session_get_status (BraseroBurnSession *session,
BraseroStatus *status)
{
BraseroBurnSessionPrivate *priv;
BraseroStatus *track_status;
gdouble num_tracks = 0.0;
gdouble done = -1.0;
guint not_ready = 0;
GSList *iter;
g_return_val_if_fail (BRASERO_IS_BURN_SESSION (session), BRASERO_TRACK_TYPE_NONE);
priv = BRASERO_BURN_SESSION_PRIVATE (session);
if (!priv->tracks)
return BRASERO_BURN_ERR;
track_status = brasero_status_new ();
for (iter = priv->tracks; iter; iter = iter->next) {
BraseroTrack *track;
BraseroBurnResult result;
track = iter->data;
result = brasero_track_get_status (track, track_status);
num_tracks ++;
if (result == BRASERO_BURN_NOT_READY)
not_ready ++;
else if (result != BRASERO_BURN_OK) {
brasero_status_free (track_status);
return brasero_track_get_status (track, status);
}
if (brasero_status_get_progress (track_status) != -1.0)
done += brasero_status_get_progress (track_status);
}
brasero_status_free (track_status);
if (not_ready > 0) {
if (status) {
if (done != -1.0)
brasero_status_set_not_ready (status,
(gdouble) ((gdouble) (done) / (gdouble) (num_tracks)),
NULL);
else
brasero_status_set_not_ready (status, -1.0, NULL);
}
return BRASERO_BURN_NOT_READY;
}
if (status)
brasero_status_set_completed (status);
return BRASERO_BURN_OK;
}
BraseroBurnResult
brasero_burn_session_get_size (BraseroBurnSession *session,
gsize *blocks,
gsize *bytes)
{
BraseroBurnSessionPrivate *priv;
gsize session_blocks = 0;
gsize session_bytes = 0;
GSList *iter;
g_return_val_if_fail (BRASERO_IS_BURN_SESSION (session), BRASERO_TRACK_TYPE_NONE);
priv = BRASERO_BURN_SESSION_PRIVATE (session);
if (!priv->tracks)
return BRASERO_BURN_ERR;
for (iter = priv->tracks; iter; iter = iter->next) {
BraseroBurnResult res;
BraseroTrack *track;
gsize track_blocks;
gsize track_bytes;
track = iter->data;
track_blocks = 0;
track_bytes = 0;
res = brasero_track_get_size (track, &track_blocks, &track_bytes);
/* That way we get the size even if the track has not completed
* what's it's doing which allows to show progress */
if (res != BRASERO_BURN_OK && res != BRASERO_BURN_NOT_READY)
continue;
session_blocks += track_blocks;
session_bytes += track_bytes;
}
if (blocks)
*blocks = session_blocks;
if (bytes)
*bytes = session_bytes;
return BRASERO_BURN_OK;
}
/* FIXME: change this return type */
BraseroTrackDataType
brasero_burn_session_get_input_type (BraseroBurnSession *self,
BraseroTrackType *type)
......@@ -1215,7 +1317,7 @@ brasero_burn_session_get_src_drive (BraseroBurnSession *self)
return NULL;
track = priv->tracks->data;
if (!BRASERO_TRACK_DISC (track))
if (!BRASERO_IS_TRACK_DISC (track))
return NULL;
return brasero_track_disc_get_drive (BRASERO_TRACK_DISC (track));
......@@ -1244,7 +1346,7 @@ brasero_burn_session_same_src_dest_drive (BraseroBurnSession *self)
return FALSE;