brasero r2212 - in trunk: . libbrasero-burn libbrasero-burn/plugins/cdrdao libbrasero-burn/plugins/cdrkit libbrasero-burn/plugins/cdrtools libbrasero-burn/plugins/checksum libbrasero-burn/plugins/growisofs libbrasero-burn/plugins/libburnia libbrasero-burn/plugins/local-track libbrasero-burn/plugins/transcode src
- From: philippr svn gnome org
- To: svn-commits-list gnome org
- Subject: brasero r2212 - in trunk: . libbrasero-burn libbrasero-burn/plugins/cdrdao libbrasero-burn/plugins/cdrkit libbrasero-burn/plugins/cdrtools libbrasero-burn/plugins/checksum libbrasero-burn/plugins/growisofs libbrasero-burn/plugins/libburnia libbrasero-burn/plugins/local-track libbrasero-burn/plugins/transcode src
- Date: Mon, 6 Apr 2009 12:55:07 +0000 (UTC)
Author: philippr
Date: Mon Apr 6 12:55:06 2009
New Revision: 2212
URL: http://svn.gnome.org/viewvc/brasero?rev=2212&view=rev
Log:
2009-04-06 Philippe Rouquier <bonfire-app wanadoo fr>
Hide the definition of BraseroTrackType structure which will allow to
expand/modify it in the future
* libbrasero-burn/Makefile.am:
* libbrasero-burn/brasero-burn-dialog.c
(brasero_burn_dialog_add_track_to_recent):
* libbrasero-burn/brasero-burn-options.c
(brasero_burn_options_new):
* libbrasero-burn/brasero-burn.c
(brasero_burn_is_loaded_dest_media_supported),
(brasero_burn_lock_dest_media), (brasero_burn_status),
(brasero_burn_check_real),
(brasero_burn_check_session_consistency), (brasero_burn_check),
(brasero_burn_same_src_dest_image):
* libbrasero-burn/brasero-caps-plugin.c (brasero_burn_caps_sort),
(brasero_caps_audio_new):
* libbrasero-burn/brasero-caps-session.c
(brasero_burn_session_get_default_output_format):
* libbrasero-burn/brasero-cover.c
(brasero_jacket_edit_set_audio_tracks_back):
* libbrasero-burn/brasero-dest-selection.c
(brasero_dest_selection_format_medium_string):
* libbrasero-burn/brasero-disc-option-dialog.c
(brasero_disc_option_dialog_set_tracks_image_fs),
(brasero_disc_option_dialog_update_joliet),
(brasero_disc_option_dialog_set_joliet),
(brasero_disc_option_dialog_joliet_widget),
(brasero_disc_option_dialog_set_session):
* libbrasero-burn/brasero-medium-properties.c
(brasero_medium_properties_get_possible_output_formats):
* libbrasero-burn/brasero-session-cfg.c
(brasero_session_cfg_set_drive_properties),
(brasero_session_cfg_check_size),
(brasero_session_cfg_set_tracks_audio_format),
(brasero_session_cfg_update):
* libbrasero-burn/brasero-session.c
(brasero_burn_session_add_track),
(brasero_burn_session_get_src_medium),
(brasero_burn_session_get_src_drive),
(brasero_burn_session_same_src_dest_drive),
(brasero_burn_session_start):
* libbrasero-burn/brasero-src-image.c (brasero_src_image_save),
(brasero_src_image_update), (brasero_src_image_set_formats),
(brasero_src_image_get_current_uri),
(brasero_src_image_set_property):
* libbrasero-burn/brasero-track-data.c (brasero_track_data_get_fs),
(brasero_track_data_get_track_type):
* libbrasero-burn/brasero-track-data.h:
* libbrasero-burn/brasero-track-disc.c
(brasero_track_disc_get_medium_type),
(brasero_track_disc_get_track_type):
* libbrasero-burn/brasero-track-disc.h:
* libbrasero-burn/brasero-track-image-cfg.c
(brasero_track_image_cfg_force_format),
(brasero_track_image_cfg_get_status):
* libbrasero-burn/brasero-track-image.c
(brasero_track_image_get_format),
(brasero_track_image_get_track_type):
* libbrasero-burn/brasero-track-image.h:
* libbrasero-burn/brasero-track-stream.c
(brasero_track_stream_get_format),
(brasero_track_stream_get_track_type):
* libbrasero-burn/brasero-track-stream.h:
* libbrasero-burn/brasero-track-type.c (brasero_track_type_new),
(brasero_track_type_free), (brasero_track_type_get_image_format),
(brasero_track_type_get_data_fs),
(brasero_track_type_get_stream_format),
(brasero_track_type_get_medium_type),
(brasero_track_type_set_image_format),
(brasero_track_type_set_data_fs),
(brasero_track_type_set_stream_format),
(brasero_track_type_set_medium_type),
(brasero_track_type_is_empty), (brasero_track_type_get_has_data),
(brasero_track_type_get_has_image),
(brasero_track_type_get_has_stream),
(brasero_track_type_get_has_medium),
(brasero_track_type_set_has_data),
(brasero_track_type_set_has_image),
(brasero_track_type_set_has_stream),
(brasero_track_type_set_has_medium), (brasero_track_type_equal),
(brasero_track_type_match), (brasero_track_type_supported):
* libbrasero-burn/brasero-track-type.h:
* libbrasero-burn/brasero-track.c:
* libbrasero-burn/brasero-track.h:
* libbrasero-burn/burn-caps.c (brasero_caps_is_compatible_type):
* libbrasero-burn/burn-caps.h:
* libbrasero-burn/burn-debug.c
(brasero_burn_debug_track_type_struct_message):
* libbrasero-burn/burn-debug.h:
* libbrasero-burn/burn-job.c:
* libbrasero-burn/burn-process.c (brasero_process_finished):
* libbrasero-burn/burn-task-ctx.c (brasero_task_ctx_add_track):
* libbrasero-burn/burn-task.c
(brasero_task_set_track_output_size_default):
* libbrasero-burn/plugins/cdrdao/burn-cdrdao.c
(brasero_cdrdao_set_argv_record), (brasero_cdrdao_set_argv_image),
(brasero_cdrdao_set_argv):
* libbrasero-burn/plugins/cdrkit/burn-genisoimage.c
(brasero_genisoimage_set_argv_image):
* libbrasero-burn/plugins/cdrkit/burn-readom.c
(brasero_readom_read_stderr),
(brasero_readom_argv_set_iso_boundary), (brasero_readom_get_size),
(brasero_readom_set_argv):
* libbrasero-burn/plugins/cdrkit/burn-wodim.c
(brasero_wodim_stdout_read), (brasero_wodim_set_argv_record):
* libbrasero-burn/plugins/cdrtools/burn-cdrecord.c
(brasero_cdrecord_stdout_read), (brasero_cdrecord_set_argv_record):
* libbrasero-burn/plugins/cdrtools/burn-mkisofs.c
(brasero_mkisofs_set_argv_image):
* libbrasero-burn/plugins/cdrtools/burn-readcd.c
(brasero_readcd_read_stderr),
(brasero_readcd_argv_set_iso_boundary), (brasero_readcd_get_size),
(brasero_readcd_set_argv):
* libbrasero-burn/plugins/checksum/burn-checksum-files.c
(brasero_checksum_files_end), (brasero_checksum_files_thread),
(brasero_checksum_files_activate):
* libbrasero-burn/plugins/checksum/burn-checksum-image.c
(brasero_checksum_image_thread):
* libbrasero-burn/plugins/growisofs/burn-growisofs.c
(brasero_growisofs_set_mkisofs_argv),
(brasero_growisofs_set_argv_record), (brasero_growisofs_set_argv):
* libbrasero-burn/plugins/libburnia/burn-libburn.c
(brasero_libburn_setup_session_fd),
(brasero_libburn_setup_session_file):
* libbrasero-burn/plugins/libburnia/burn-libisofs.c
(brasero_libisofs_create_volume_thread):
* libbrasero-burn/plugins/local-track/burn-local-image.c
(brasero_local_track_update_track), (brasero_local_track_start):
* libbrasero-burn/plugins/local-track/burn-uri.c
(brasero_burn_uri_thread), (brasero_burn_uri_start):
* libbrasero-burn/plugins/transcode/burn-transcode.c
(brasero_transcode_push_track):
* libbrasero-burn/plugins/transcode/burn-vob.c
(brasero_vob_finished), (brasero_vob_start):
* src/brasero-blank-dialog.h:
* src/brasero-data-session.c:
* src/brasero-sum-dialog.c:
* src/brasero-sum-dialog.h:
Added:
trunk/libbrasero-burn/brasero-track-type.c
trunk/libbrasero-burn/brasero-track-type.h
Modified:
trunk/ChangeLog
trunk/libbrasero-burn/Makefile.am
trunk/libbrasero-burn/brasero-burn-dialog.c
trunk/libbrasero-burn/brasero-burn-options.c
trunk/libbrasero-burn/brasero-burn.c
trunk/libbrasero-burn/brasero-caps-plugin.c
trunk/libbrasero-burn/brasero-caps-session.c
trunk/libbrasero-burn/brasero-cover.c
trunk/libbrasero-burn/brasero-dest-selection.c
trunk/libbrasero-burn/brasero-disc-option-dialog.c
trunk/libbrasero-burn/brasero-medium-properties.c
trunk/libbrasero-burn/brasero-session-cfg.c
trunk/libbrasero-burn/brasero-session.c
trunk/libbrasero-burn/brasero-src-image.c
trunk/libbrasero-burn/brasero-track-data.c
trunk/libbrasero-burn/brasero-track-data.h
trunk/libbrasero-burn/brasero-track-disc.c
trunk/libbrasero-burn/brasero-track-disc.h
trunk/libbrasero-burn/brasero-track-image-cfg.c
trunk/libbrasero-burn/brasero-track-image.c
trunk/libbrasero-burn/brasero-track-image.h
trunk/libbrasero-burn/brasero-track-stream.c
trunk/libbrasero-burn/brasero-track-stream.h
trunk/libbrasero-burn/brasero-track.c
trunk/libbrasero-burn/brasero-track.h
trunk/libbrasero-burn/burn-caps.c
trunk/libbrasero-burn/burn-caps.h
trunk/libbrasero-burn/burn-debug.c
trunk/libbrasero-burn/burn-debug.h
trunk/libbrasero-burn/burn-job.c
trunk/libbrasero-burn/burn-process.c
trunk/libbrasero-burn/burn-task-ctx.c
trunk/libbrasero-burn/burn-task.c
trunk/libbrasero-burn/plugins/cdrdao/burn-cdrdao.c
trunk/libbrasero-burn/plugins/cdrkit/burn-genisoimage.c
trunk/libbrasero-burn/plugins/cdrkit/burn-readom.c
trunk/libbrasero-burn/plugins/cdrkit/burn-wodim.c
trunk/libbrasero-burn/plugins/cdrtools/burn-cdrecord.c
trunk/libbrasero-burn/plugins/cdrtools/burn-mkisofs.c
trunk/libbrasero-burn/plugins/cdrtools/burn-readcd.c
trunk/libbrasero-burn/plugins/checksum/burn-checksum-files.c
trunk/libbrasero-burn/plugins/checksum/burn-checksum-image.c
trunk/libbrasero-burn/plugins/growisofs/burn-growisofs.c
trunk/libbrasero-burn/plugins/libburnia/burn-libburn.c
trunk/libbrasero-burn/plugins/libburnia/burn-libisofs.c
trunk/libbrasero-burn/plugins/local-track/burn-local-image.c
trunk/libbrasero-burn/plugins/local-track/burn-uri.c
trunk/libbrasero-burn/plugins/transcode/burn-transcode.c
trunk/libbrasero-burn/plugins/transcode/burn-vob.c
trunk/src/brasero-blank-dialog.h
trunk/src/brasero-data-session.c
trunk/src/brasero-sum-dialog.c
trunk/src/brasero-sum-dialog.h
Modified: trunk/libbrasero-burn/Makefile.am
==============================================================================
--- trunk/libbrasero-burn/Makefile.am (original)
+++ trunk/libbrasero-burn/Makefile.am Mon Apr 6 12:55:06 2009
@@ -37,6 +37,7 @@
brasero-enums.h \
brasero-error.h \
brasero-burn-lib.h \
+ brasero-track-type.h \
brasero-track.h \
brasero-track-data.h \
brasero-track-disc.h \
@@ -152,7 +153,10 @@
brasero-caps-burn.h \
brasero-plugin.h \
brasero-plugin-information.h \
- brasero-plugin-registration.h
+ brasero-plugin-registration.h \
+ brasero-track-type.c \
+ brasero-track-type.h \
+ brasero-track-type-private.h
EXTRA_DIST = \
libbrasero-marshal.list
Modified: trunk/libbrasero-burn/brasero-burn-dialog.c
==============================================================================
--- trunk/libbrasero-burn/brasero-burn-dialog.c (original)
+++ trunk/libbrasero-burn/brasero-burn-dialog.c Mon Apr 6 12:55:06 2009
@@ -52,6 +52,7 @@
#include "burn-debug.h"
#include "brasero-progress.h"
#include "brasero-cover.h"
+#include "brasero-track-type-private.h"
#include "brasero-tags.h"
#include "brasero-session.h"
@@ -1931,8 +1932,8 @@
brasero_burn_dialog_add_track_to_recent (BraseroTrack *track)
{
gchar *uri = NULL;
- BraseroTrackType type;
GtkRecentManager *recent;
+ BraseroImageFormat format;
gchar *groups [] = { "brasero", NULL };
gchar *mimes [] = { "application/x-cd-image",
"application/x-cue",
@@ -1940,21 +1941,21 @@
"application/x-cdrdao-toc" };
GtkRecentData recent_data = { NULL,
NULL,
-
NULL,
-
"brasero",
"brasero -p %u",
groups,
FALSE };
- brasero_track_get_track_type (track, &type);
- if (type.type != BRASERO_TRACK_TYPE_IMAGE
- || type.subtype.img_format == BRASERO_IMAGE_FORMAT_NONE)
+ if (!BRASERO_IS_TRACK_IMAGE (track))
+ return;
+
+ format = brasero_track_image_get_format (BRASERO_TRACK_IMAGE (track));
+ if (format == BRASERO_IMAGE_FORMAT_NONE)
return;
/* Add it to recent file manager */
- switch (type.subtype.img_format) {
+ switch (format) {
case BRASERO_IMAGE_FORMAT_BIN:
recent_data.mime_type = mimes [0];
uri = brasero_track_image_get_source (BRASERO_TRACK_IMAGE (track), TRUE);
Modified: trunk/libbrasero-burn/brasero-burn-options.c
==============================================================================
--- trunk/libbrasero-burn/brasero-burn-options.c (original)
+++ trunk/libbrasero-burn/brasero-burn-options.c Mon Apr 6 12:55:06 2009
@@ -585,30 +585,32 @@
GtkWidget *
brasero_burn_options_new (BraseroSessionCfg *session)
{
- BraseroTrackType type = { 0, };
+ BraseroTrackType *type;
GtkWidget *options;
- brasero_burn_session_get_input_type (BRASERO_BURN_SESSION (session), &type);
- switch (type.type) {
- case BRASERO_TRACK_TYPE_DATA:
- case BRASERO_TRACK_TYPE_STREAM:
- options = g_object_new (BRASERO_TYPE_DISC_OPTION_DIALOG,
- "session", session,
- NULL);
- break;
- case BRASERO_TRACK_TYPE_DISC:
- options = g_object_new (BRASERO_TYPE_DISC_COPY_DIALOG,
- "session", session,
- NULL);
- break;
- case BRASERO_TRACK_TYPE_IMAGE:
- options = g_object_new (BRASERO_TYPE_IMAGE_OPTION_DIALOG,
- "session", session,
- NULL);
- break;
- default:
- options = NULL;
+ type = brasero_track_type_new ();
+ brasero_burn_session_get_input_type (BRASERO_BURN_SESSION (session), type);
+
+ if (brasero_track_type_get_has_data (type)
+ || brasero_track_type_get_has_stream (type)) {
+ options = g_object_new (BRASERO_TYPE_DISC_OPTION_DIALOG,
+ "session", session,
+ NULL);
+ }
+ else if (brasero_track_type_get_has_medium (type)) {
+ options = g_object_new (BRASERO_TYPE_DISC_COPY_DIALOG,
+ "session", session,
+ NULL);
}
+ else if (brasero_track_type_get_has_image (type)) {
+ options = g_object_new (BRASERO_TYPE_IMAGE_OPTION_DIALOG,
+ "session", session,
+ NULL);
+ }
+ else
+ options = NULL;
+
+ brasero_track_type_free (type);
return options;
}
Modified: trunk/libbrasero-burn/brasero-burn.c
==============================================================================
--- trunk/libbrasero-burn/brasero-burn.c (original)
+++ trunk/libbrasero-burn/brasero-burn.c Mon Apr 6 12:55:06 2009
@@ -704,22 +704,23 @@
BraseroMedia media,
gboolean *must_blank)
{
+ BraseroTrackType *output = NULL;
BraseroMedia required_media;
BraseroBurnPrivate *priv;
BraseroBurnResult result;
BraseroMedia unsupported;
- BraseroTrackType output;
BraseroBurnFlag flags;
BraseroMedia missing;
priv = BRASERO_BURN_PRIVATE (burn);
/* make sure that media is supported */
- output.type = BRASERO_TRACK_TYPE_DISC;
- output.subtype.media = media;
+ output = brasero_track_type_new ();
+ brasero_track_type_set_has_medium (output);
+ brasero_track_type_set_medium_type (output, media);
- result = brasero_burn_session_output_supported (priv->session,
- &output);
+ result = brasero_burn_session_output_supported (priv->session, output);
+ brasero_track_type_free (output);
flags = brasero_burn_session_get_flags (priv->session);
@@ -769,10 +770,10 @@
BraseroMedia media;
gboolean must_blank;
BraseroBurnFlag flags;
- BraseroTrackType input;
BraseroMedium *medium;
BraseroBurnError berror;
BraseroBurnResult result;
+ BraseroTrackType *input = NULL;
BraseroBurnPrivate *priv = BRASERO_BURN_PRIVATE (burn);
priv->dest = brasero_burn_session_get_burner (priv->session);
@@ -784,11 +785,6 @@
return BRASERO_BURN_ERR;
}
- brasero_burn_session_get_input_type (priv->session, &input);
- flags = brasero_burn_session_get_flags (priv->session);
-
- result = BRASERO_BURN_OK;
-
medium = brasero_drive_get_medium (priv->dest);
if (!medium) {
result = BRASERO_BURN_NEED_RELOAD;
@@ -811,6 +807,7 @@
brasero_drive_get_device (priv->dest));
}
+ result = BRASERO_BURN_OK;
berror = BRASERO_BURN_ERROR_NONE;
media = brasero_medium_get_status (medium);
@@ -855,6 +852,10 @@
goto end;
}
+ input = brasero_track_type_new ();
+ brasero_burn_session_get_input_type (priv->session, input);
+ flags = brasero_burn_session_get_flags (priv->session);
+
if (must_blank) {
/* There is an error if APPEND was set since this disc is not
* supported without a prior blanking. */
@@ -870,7 +871,7 @@
else if (media & (BRASERO_MEDIUM_HAS_DATA|BRASERO_MEDIUM_HAS_AUDIO)) {
/* A few special warnings for the discs with data/audio on them
* that don't need prior blanking or can't be blanked */
- if (input.type == BRASERO_TRACK_TYPE_STREAM) {
+ if (brasero_track_type_get_has_stream (input)) {
/* We'd rather blank and rewrite a disc rather than
* append audio to appendable disc. That's because audio
* tracks have little chance to be readable by common CD
@@ -885,7 +886,7 @@
/* NOTE: if input is AUDIO we don't care since the OS
* will load the last session of DATA anyway */
if ((media & BRASERO_MEDIUM_HAS_DATA)
- && input.type == BRASERO_TRACK_TYPE_DATA
+ && brasero_track_type_get_has_data (input)
&& !(flags & BRASERO_BURN_FLAG_MERGE)) {
/* warn the users that their previous data
* session (s) will not be mounted by default by
@@ -905,17 +906,18 @@
/* NOTE: no need to error out here since the only thing
* we are interested in is if it is AUDIO or not or if
* the disc we are copying has audio tracks only or not */
- if (input.type == BRASERO_TRACK_TYPE_STREAM
- && !(input.subtype.audio_format & (BRASERO_VIDEO_FORMAT_UNDEFINED|
- BRASERO_VIDEO_FORMAT_VCD|
- BRASERO_VIDEO_FORMAT_VIDEO_DVD))) {
+ if (brasero_track_type_get_has_stream (input)
+ && !(brasero_track_type_get_stream_format (input) & (BRASERO_VIDEO_FORMAT_UNDEFINED|
+ BRASERO_VIDEO_FORMAT_VCD|
+ BRASERO_VIDEO_FORMAT_VIDEO_DVD))) {
result = brasero_burn_emit_signal (burn, WARN_REWRITABLE_SIGNAL, BRASERO_BURN_CANCEL);
if (result != BRASERO_BURN_OK)
goto end;
}
- if (input.type == BRASERO_TRACK_TYPE_DISC
- && (input.subtype.media & (BRASERO_MEDIUM_HAS_AUDIO|BRASERO_MEDIUM_HAS_DATA)) == BRASERO_MEDIUM_HAS_AUDIO) {
+ if (brasero_track_type_get_has_medium (input)
+ && (brasero_track_type_get_medium_type (input) & (BRASERO_MEDIUM_HAS_AUDIO|
+ BRASERO_MEDIUM_HAS_DATA)) == BRASERO_MEDIUM_HAS_AUDIO) {
result = brasero_burn_emit_signal (burn, WARN_REWRITABLE_SIGNAL, BRASERO_BURN_CANCEL);
if (result != BRASERO_BURN_OK)
goto end;
@@ -924,6 +926,8 @@
if (!priv->dest_locked
&& !brasero_drive_lock (priv->dest, _("Ongoing burning process"), &failure)) {
+ brasero_track_type_free (input);
+
g_set_error (error,
BRASERO_BURN_ERROR,
BRASERO_BURN_ERROR_GENERAL,
@@ -944,6 +948,8 @@
if (result == BRASERO_BURN_NEED_RELOAD && ret_error)
*ret_error = berror;
+ brasero_track_type_free (input);
+
return result;
}
@@ -1254,13 +1260,16 @@
* - brasero_burn_session_is_dest_file returns FALSE
*/
if (priv->tasks_done < priv->task_nb - 1) {
- BraseroTrackType input;
+ BraseroTrackType *input = NULL;
- brasero_burn_session_get_input_type (priv->session, &input);
- if (input.type == BRASERO_TRACK_TYPE_DISC)
- *media = input.subtype.media;
+ input = brasero_track_type_new ();
+ brasero_burn_session_get_input_type (priv->session, input);
+ if (brasero_track_type_get_has_medium (input))
+ *media = brasero_track_type_get_medium_type (input);
else
*media = BRASERO_MEDIUM_NONE;
+
+ brasero_track_type_free (input);
}
else if (brasero_burn_session_is_dest_file (priv->session))
*media = BRASERO_MEDIUM_FILE;
@@ -1835,7 +1844,6 @@
GError **error)
{
BraseroMedium *medium;
- BraseroTrackType type;
BraseroBurnResult result;
BraseroBurnPrivate *priv;
BraseroChecksumType checksum_type;
@@ -1845,7 +1853,6 @@
BRASERO_BURN_LOG ("Starting to check track integrity");
checksum_type = brasero_track_get_checksum_type (track);
- brasero_track_get_track_type (track, &type);
/* if the input is a DISC and there isn't any checksum specified that
* means the checksum file is on the disc. */
@@ -1913,10 +1920,10 @@
{
BraseroMedia media;
BraseroBurnFlag flag;
- BraseroTrackType type;
BraseroBurnFlag flags;
BraseroBurnFlag retval;
BraseroBurnResult result;
+ BraseroTrackType *type = NULL;
BraseroBurnFlag supported = BRASERO_BURN_FLAG_NONE;
BraseroBurnFlag compulsory = BRASERO_BURN_FLAG_NONE;
BraseroBurnPrivate *priv = BRASERO_BURN_PRIVATE (burn);
@@ -1924,9 +1931,13 @@
BRASERO_BURN_DEBUG (burn, "Checking session consistency");
/* make sure there is a track in the session. */
- brasero_burn_session_get_input_type (priv->session, &type);
- if (type.type == BRASERO_TRACK_TYPE_NONE
+ type = brasero_track_type_new ();
+ brasero_burn_session_get_input_type (priv->session, type);
+
+ if (brasero_track_type_is_empty (type)
|| !brasero_burn_session_get_tracks (priv->session)) {
+ brasero_track_type_free (type);
+
BRASERO_BURN_DEBUG (burn, "No track set");
g_set_error (error,
BRASERO_BURN_ERROR,
@@ -1934,6 +1945,7 @@
_("There is no track to be burnt"));
return BRASERO_BURN_ERR;
}
+ brasero_track_type_free (type);
/* make sure there is a drive set as burner. */
if (!brasero_burn_session_is_dest_file (priv->session)) {
@@ -2257,7 +2269,6 @@
{
GSList *tracks;
BraseroTrack *track;
- BraseroTrackType type;
BraseroBurnResult result;
BraseroBurnPrivate *priv;
@@ -2281,10 +2292,9 @@
}
track = tracks->data;
- brasero_track_get_track_type (track, &type);
/* if the input is a DISC, ask/check there is one and lock it (as dest) */
- if (type.type == BRASERO_TRACK_TYPE_DISC) {
+ if (BRASERO_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)
@@ -2318,11 +2328,11 @@
gchar *toc = NULL;
gchar *image = NULL;
BraseroTrackImage *track;
- BraseroTrackType output;
GError *ret_error = NULL;
BraseroBurnResult result;
BraseroBurnPrivate *priv;
BraseroImageFormat format;
+ BraseroTrackType *output = NULL;
/* we can't create a proper list of tasks here since we don't know the
* dest media type yet. So we try to find an intermediate image type and
@@ -2330,15 +2340,18 @@
priv = BRASERO_BURN_PRIVATE (self);
/* get the first possible format */
- output.type = BRASERO_TRACK_TYPE_IMAGE;
+ output = brasero_track_type_new ();
+ brasero_track_type_set_has_image (output);
+
format = BRASERO_IMAGE_FORMAT_CDRDAO;
for (; format != BRASERO_IMAGE_FORMAT_NONE; format >>= 1) {
- output.subtype.img_format = format;
+ brasero_track_type_set_image_format (output, format);
result = brasero_burn_session_output_supported (priv->session,
- &output);
+ output);
if (result == BRASERO_BURN_OK)
break;
}
+ brasero_track_type_free (output);
if (format == BRASERO_IMAGE_FORMAT_NONE) {
g_set_error (error,
Modified: trunk/libbrasero-burn/brasero-caps-plugin.c
==============================================================================
--- trunk/libbrasero-burn/brasero-caps-plugin.c (original)
+++ trunk/libbrasero-burn/brasero-caps-plugin.c Mon Apr 6 12:55:06 2009
@@ -114,15 +114,15 @@
return caps_a->type.subtype.img_format - caps_b->type.subtype.img_format;
case BRASERO_TRACK_TYPE_STREAM:
- if (caps_a->type.subtype.audio_format != caps_b->type.subtype.audio_format) {
- result = (caps_a->type.subtype.audio_format & caps_b->type.subtype.audio_format);
- if (result == caps_a->type.subtype.audio_format)
+ if (caps_a->type.subtype.stream_format != caps_b->type.subtype.stream_format) {
+ result = (caps_a->type.subtype.stream_format & caps_b->type.subtype.stream_format);
+ if (result == caps_a->type.subtype.stream_format)
return -1;
- else if (result == caps_b->type.subtype.audio_format)
+ else if (result == caps_b->type.subtype.stream_format)
return 1;
- return (gint32) caps_a->type.subtype.audio_format -
- (gint32) caps_b->type.subtype.audio_format;
+ return (gint32) caps_a->type.subtype.stream_format -
+ (gint32) caps_b->type.subtype.stream_format;
}
break;
@@ -473,7 +473,7 @@
if (common_io == BRASERO_PLUGIN_IO_NONE)
continue;
- if (caps->type.subtype.audio_format == format) {
+ if (caps->type.subtype.stream_format == format) {
/* that's the perfect fit */
have_the_one = TRUE;
retval = g_slist_prepend (retval, caps);
@@ -483,29 +483,29 @@
/* Search caps strictly encompassed or encompassing our format
* NOTE: make sure that if there is a VIDEO stream in one of
* them, the other does have a VIDEO stream too. */
- common_audio = BRASERO_STREAM_FORMAT_AUDIO (caps->type.subtype.audio_format) &
+ common_audio = BRASERO_STREAM_FORMAT_AUDIO (caps->type.subtype.stream_format) &
BRASERO_STREAM_FORMAT_AUDIO (format);
if (common_audio == BRASERO_AUDIO_FORMAT_NONE
- && (BRASERO_STREAM_FORMAT_AUDIO (caps->type.subtype.audio_format)
+ && (BRASERO_STREAM_FORMAT_AUDIO (caps->type.subtype.stream_format)
|| BRASERO_STREAM_FORMAT_AUDIO (format)))
continue;
- common_video = BRASERO_STREAM_FORMAT_VIDEO (caps->type.subtype.audio_format) &
+ common_video = BRASERO_STREAM_FORMAT_VIDEO (caps->type.subtype.stream_format) &
BRASERO_STREAM_FORMAT_VIDEO (format);
if (common_video == BRASERO_AUDIO_FORMAT_NONE
- && (BRASERO_STREAM_FORMAT_VIDEO (caps->type.subtype.audio_format)
+ && (BRASERO_STREAM_FORMAT_VIDEO (caps->type.subtype.stream_format)
|| BRASERO_STREAM_FORMAT_VIDEO (format)))
continue;
/* Likewise... that must be common */
- if ((caps->type.subtype.audio_format & BRASERO_METADATA_INFO) != (format & BRASERO_METADATA_INFO))
+ if ((caps->type.subtype.stream_format & BRASERO_METADATA_INFO) != (format & BRASERO_METADATA_INFO))
continue;
common = common_audio|common_video|(format & BRASERO_METADATA_INFO);
/* encompassed caps just add it to retval */
- if (caps->type.subtype.audio_format == common)
+ if (caps->type.subtype.stream_format == common)
retval = g_slist_prepend (retval, caps);
/* encompassing caps keep it if we need to create perfect fit */
@@ -522,7 +522,7 @@
caps = g_new0 (BraseroCaps, 1);
caps->flags = flags;
- caps->type.subtype.audio_format = format;
+ caps->type.subtype.stream_format = format;
caps->type.type = BRASERO_TRACK_TYPE_STREAM;
if (encompassing) {
Modified: trunk/libbrasero-burn/brasero-caps-session.c
==============================================================================
--- trunk/libbrasero-burn/brasero-caps-session.c (original)
+++ trunk/libbrasero-burn/brasero-caps-session.c Mon Apr 6 12:55:06 2009
@@ -975,7 +975,7 @@
if (source.type == BRASERO_TRACK_TYPE_STREAM) {
/* If that's AUDIO only without VIDEO then return */
- if (!(source.subtype.audio_format & (BRASERO_VIDEO_FORMAT_UNDEFINED|BRASERO_VIDEO_FORMAT_VCD|BRASERO_VIDEO_FORMAT_VIDEO_DVD))) {
+ if (!(source.subtype.stream_format & (BRASERO_VIDEO_FORMAT_UNDEFINED|BRASERO_VIDEO_FORMAT_VCD|BRASERO_VIDEO_FORMAT_VIDEO_DVD))) {
g_object_unref (self);
return BRASERO_IMAGE_FORMAT_NONE;
}
Modified: trunk/libbrasero-burn/brasero-cover.c
==============================================================================
--- trunk/libbrasero-burn/brasero-cover.c (original)
+++ trunk/libbrasero-burn/brasero-cover.c Mon Apr 6 12:55:06 2009
@@ -103,7 +103,7 @@
BraseroTrack *track;
track = iter->data;
- if (brasero_track_get_track_type (track, NULL) != BRASERO_TRACK_TYPE_STREAM)
+ if (!BRASERO_IS_TRACK_STREAM (track))
continue;
num = g_strdup_printf ("%i - ", g_slist_index (tracks, track) + 1);
Modified: trunk/libbrasero-burn/brasero-dest-selection.c
==============================================================================
--- trunk/libbrasero-burn/brasero-dest-selection.c (original)
+++ trunk/libbrasero-burn/brasero-dest-selection.c Mon Apr 6 12:55:06 2009
@@ -390,7 +390,7 @@
BraseroMedia media;
gint64 size_bytes = 0;
BraseroBurnFlag flags;
- BraseroTrackType input = { 0, };
+ BraseroTrackType *input = NULL;
BraseroDestSelectionPrivate *priv;
priv = BRASERO_DEST_SELECTION_PRIVATE (selection);
@@ -419,12 +419,15 @@
return NULL;
}
- brasero_burn_session_get_input_type (priv->session, &input);
- if (input.type == BRASERO_TRACK_TYPE_DISC) {
+ input = brasero_track_type_new ();
+ brasero_burn_session_get_input_type (priv->session, input);
+ if (brasero_track_type_get_has_medium (input)) {
BraseroMedium *src_medium;
src_medium = brasero_burn_session_get_src_medium (priv->session);
if (src_medium == medium) {
+ brasero_track_type_free (input);
+
/* Translators: this string is only used when the user
* wants to copy a disc using the same destination and
* source drive. It tells him that brasero will use as
@@ -454,6 +457,8 @@
}
else if (media & BRASERO_MEDIUM_CLOSED) {
if (!brasero_burn_session_can_blank (priv->session) == BRASERO_BURN_OK) {
+ brasero_track_type_free (input);
+
/* NOTE for translators, the first %s is the medium name */
label = g_strdup_printf (_("%s: no free space"), medium_name);
g_free (medium_name);
@@ -471,15 +476,17 @@
}
/* format the size */
- if (input.type == BRASERO_TRACK_TYPE_STREAM
- || (input.type == BRASERO_TRACK_TYPE_DISC
- && (input.subtype.media & BRASERO_MEDIUM_HAS_AUDIO)))
+ if (brasero_track_type_get_has_stream (input)
+ || (brasero_track_type_get_has_medium (input)
+ && (brasero_track_type_get_medium_type (input) & BRASERO_MEDIUM_HAS_AUDIO)))
size_string = brasero_units_get_time_string (BRASERO_BYTES_TO_DURATION (size_bytes),
TRUE,
TRUE);
else
size_string = g_format_size_for_display (size_bytes);
+ brasero_track_type_free (input);
+
/* NOTE for translators: the first %s is the medium name, the second %s
* is its available free space. "Free" here is the free space available. */
label = g_strdup_printf (_("%s: %s of free space"), medium_name, size_string);
Modified: trunk/libbrasero-burn/brasero-disc-option-dialog.c
==============================================================================
--- trunk/libbrasero-burn/brasero-disc-option-dialog.c (original)
+++ trunk/libbrasero-burn/brasero-disc-option-dialog.c Mon Apr 6 12:55:06 2009
@@ -134,7 +134,7 @@
BraseroTrack *track;
track = iter->data;
- if (brasero_track_get_track_type (track, NULL) != BRASERO_TRACK_TYPE_DATA)
+ if (!BRASERO_IS_TRACK_DATA (track))
continue;
brasero_track_data_add_fs (BRASERO_TRACK_DATA (track), fs_type);
@@ -144,9 +144,10 @@
static gboolean
brasero_disc_option_dialog_update_joliet (BraseroDiscOptionDialog *dialog)
{
- BraseroTrackType source;
+ BraseroImageFS fs_type;
BraseroBurnResult result;
BraseroBurnSession *session;
+ BraseroTrackType *source = NULL;
BraseroDiscOptionDialogPrivate *priv;
priv = BRASERO_DISC_OPTION_DIALOG_PRIVATE (dialog);
@@ -155,12 +156,20 @@
/* what we want to check Joliet support */
session = brasero_burn_options_get_session (BRASERO_BURN_OPTIONS (dialog));
- brasero_burn_session_get_input_type (session, &source);
- source.subtype.fs_type |= BRASERO_IMAGE_FS_JOLIET;
+ source = brasero_track_type_new ();
+ brasero_burn_session_get_input_type (session, source);
+ fs_type = brasero_track_type_get_data_fs (source);
+
+ brasero_track_type_set_data_fs (source,
+ fs_type|
+ BRASERO_IMAGE_FS_JOLIET);
+
result = brasero_burn_session_input_supported (session,
- &source,
+ source,
FALSE);
+ brasero_track_type_free (source);
+
if (result == BRASERO_BURN_OK) {
if (GTK_WIDGET_IS_SENSITIVE (priv->joliet_toggle)) {
g_object_unref (session);
@@ -174,7 +183,7 @@
return FALSE;
}
- brasero_disc_option_dialog_set_tracks_image_fs (session, source.subtype.fs_type);
+ brasero_disc_option_dialog_set_tracks_image_fs (session, fs_type);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->joliet_toggle), priv->joliet_saved);
g_object_unref (session);
@@ -188,9 +197,8 @@
priv->joliet_saved = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->joliet_toggle));
if (priv->joliet_saved) {
- source.subtype.fs_type &= ~BRASERO_IMAGE_FS_JOLIET;
- brasero_disc_option_dialog_set_tracks_image_fs (session, source.subtype.fs_type);
-
+ fs_type &= (~BRASERO_IMAGE_FS_JOLIET);
+ brasero_disc_option_dialog_set_tracks_image_fs (session, fs_type);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->joliet_toggle), FALSE);
}
@@ -288,8 +296,9 @@
brasero_disc_option_dialog_set_joliet (BraseroDiscOptionDialog *dialog)
{
BraseroDiscOptionDialogPrivate *priv;
+ BraseroTrackType *source = NULL;
BraseroBurnSession *session;
- BraseroTrackType source;
+ BraseroImageFS fs_type;
priv = BRASERO_DISC_OPTION_DIALOG_PRIVATE (dialog);
@@ -300,13 +309,15 @@
/* NOTE: we don't check for the sensitive property since when
* something is compulsory the button is active but insensitive */
- brasero_burn_session_get_input_type (session, &source);
+ source = brasero_track_type_new ();
+ brasero_burn_session_get_input_type (session, source);
if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->joliet_toggle)))
- source.subtype.fs_type &= ~BRASERO_IMAGE_FS_JOLIET;
+ fs_type = (~BRASERO_IMAGE_FS_JOLIET) & brasero_track_type_get_data_fs (source);
else
- source.subtype.fs_type |= BRASERO_IMAGE_FS_JOLIET;
+ fs_type = BRASERO_IMAGE_FS_JOLIET|brasero_track_type_get_data_fs (source);
+ brasero_track_type_free (source);
- brasero_disc_option_dialog_set_tracks_image_fs (session, source.subtype.fs_type);
+ brasero_disc_option_dialog_set_tracks_image_fs (session, fs_type);
g_object_unref (session);
}
@@ -369,8 +380,8 @@
brasero_disc_option_dialog_joliet_widget (BraseroDiscOptionDialog *dialog)
{
BraseroDiscOptionDialogPrivate *priv;
+ BraseroTrackType *type = NULL;
BraseroBurnSession *session;
- BraseroTrackType type;
priv = BRASERO_DISC_OPTION_DIALOG_PRIVATE (dialog);
@@ -382,11 +393,14 @@
* to have the joliet extension, it's because it does have some
* incompatible filenames inside */
session = brasero_burn_options_get_session (BRASERO_BURN_OPTIONS (dialog));
- brasero_burn_session_get_input_type (session, &type);
- if (type.subtype.fs_type & BRASERO_IMAGE_FS_JOLIET) {
+
+ type = brasero_track_type_new ();
+ brasero_burn_session_get_input_type (session, type);
+ if (brasero_track_type_get_data_fs (type) & BRASERO_IMAGE_FS_JOLIET) {
priv->joliet_warning = 1;
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->joliet_toggle), TRUE);
}
+ brasero_track_type_free (type);
brasero_disc_option_dialog_update_joliet (dialog);
@@ -761,22 +775,24 @@
gpointer NULL_data)
{
BraseroDiscOptionDialogPrivate *priv;
+ BraseroTrackType *type = NULL;
BraseroBurnSession *session;
- BraseroTrackType type;
priv = BRASERO_DISC_OPTION_DIALOG_PRIVATE (dialog);
session = brasero_burn_options_get_session (BRASERO_BURN_OPTIONS (dialog));
- brasero_burn_session_get_input_type (session, &type);
- if (type.type == BRASERO_TRACK_TYPE_DATA) {
+ type = brasero_track_type_new ();
+ brasero_burn_session_get_input_type (session, type);
+
+ if (brasero_track_type_get_has_data (type)) {
brasero_burn_options_set_type_shown (BRASERO_BURN_OPTIONS (dialog),
BRASERO_MEDIA_TYPE_WRITABLE|
BRASERO_MEDIA_TYPE_FILE);
brasero_disc_option_dialog_add_data_options (BRASERO_DISC_OPTION_DIALOG (dialog));
}
- else if (type.type == BRASERO_TRACK_TYPE_STREAM) {
- if (type.subtype.audio_format & (BRASERO_VIDEO_FORMAT_UNDEFINED|BRASERO_VIDEO_FORMAT_VCD|BRASERO_VIDEO_FORMAT_VIDEO_DVD)) {
+ else if (brasero_track_type_get_has_stream (type)) {
+ if (brasero_track_type_get_stream_format (type) & (BRASERO_VIDEO_FORMAT_UNDEFINED|BRASERO_VIDEO_FORMAT_VCD|BRASERO_VIDEO_FORMAT_VIDEO_DVD)) {
brasero_burn_options_set_type_shown (BRASERO_BURN_OPTIONS (dialog),
BRASERO_MEDIA_TYPE_WRITABLE|
BRASERO_MEDIA_TYPE_FILE);
@@ -788,6 +804,7 @@
BRASERO_MEDIA_TYPE_WRITABLE);
}
}
+ brasero_track_type_free (type);
/* see if we should lock the drive only with MERGE */
if (brasero_burn_session_get_flags (session) & BRASERO_BURN_FLAG_MERGE)
Modified: trunk/libbrasero-burn/brasero-medium-properties.c
==============================================================================
--- trunk/libbrasero-burn/brasero-medium-properties.c (original)
+++ trunk/libbrasero-burn/brasero-medium-properties.c Mon Apr 6 12:55:06 2009
@@ -224,8 +224,8 @@
BraseroImageFormat *formats)
{
guint num = 0;
- BraseroTrackType output;
BraseroImageFormat format;
+ BraseroTrackType *output = NULL;
BraseroMediumPropertiesPrivate *priv;
priv = BRASERO_MEDIUM_PROPERTIES_PRIVATE (self);
@@ -233,20 +233,23 @@
/* see how many output format are available */
format = BRASERO_IMAGE_FORMAT_CDRDAO;
(*formats) = BRASERO_IMAGE_FORMAT_NONE;
- output.type = BRASERO_TRACK_TYPE_IMAGE;
+
+ output = brasero_track_type_new ();
+ brasero_track_type_set_has_image (output);
for (; format > BRASERO_IMAGE_FORMAT_NONE; format >>= 1) {
BraseroBurnResult result;
- output.subtype.img_format = format;
- result = brasero_burn_session_output_supported (priv->session,
- &output);
+ brasero_track_type_set_image_format (output, format);
+ result = brasero_burn_session_output_supported (priv->session, output);
if (result == BRASERO_BURN_OK) {
(*formats) |= format;
num ++;
}
}
+ brasero_track_type_free (output);
+
return num;
}
Modified: trunk/libbrasero-burn/brasero-session-cfg.c
==============================================================================
--- trunk/libbrasero-burn/brasero-session-cfg.c (original)
+++ trunk/libbrasero-burn/brasero-session-cfg.c Mon Apr 6 12:55:06 2009
@@ -363,8 +363,8 @@
static void
brasero_session_cfg_set_drive_properties (BraseroSessionCfg *self)
{
- BraseroTrackType source = { 0, };
BraseroSessionCfgPrivate *priv;
+ BraseroTrackDataType source;
BraseroBurnFlag flags;
BraseroMedium *medium;
BraseroDrive *drive;
@@ -377,7 +377,7 @@
priv = BRASERO_SESSION_CFG_PRIVATE (self);
/* The next two must work as they were checked earlier */
- brasero_burn_session_get_input_type (BRASERO_BURN_SESSION (self), &source);
+ source = brasero_burn_session_get_input_type (BRASERO_BURN_SESSION (self), NULL);
drive = brasero_burn_session_get_burner (BRASERO_BURN_SESSION (self));
medium = brasero_drive_get_medium (drive);
@@ -440,9 +440,9 @@
flags = BRASERO_BURN_FLAG_EJECT|
BRASERO_BURN_FLAG_BURNPROOF;
- if (source.type == BRASERO_TRACK_TYPE_DATA
- || source.type == BRASERO_TRACK_TYPE_DISC
- || source.type == BRASERO_TRACK_TYPE_IMAGE)
+ if (source == BRASERO_TRACK_TYPE_DATA
+ || source == BRASERO_TRACK_TYPE_DISC
+ || source == BRASERO_TRACK_TYPE_IMAGE)
flags |= BRASERO_BURN_FLAG_NO_TMP_FILES;
}
else {
@@ -534,7 +534,7 @@
BraseroTrack *track;
track = iter->data;
- if (brasero_track_get_track_type (track, NULL) != BRASERO_TRACK_TYPE_DATA) {
+ if (!BRASERO_IS_TRACK_DATA (track)) {
guint64 sectors = 0;
brasero_track_get_size (track, §ors, NULL);
@@ -596,7 +596,7 @@
BraseroTrack *track;
track = iter->data;
- if (brasero_track_get_track_type (track, NULL) != BRASERO_TRACK_TYPE_STREAM)
+ if (!BRASERO_IS_TRACK_STREAM (track))
continue;
brasero_track_stream_set_format (BRASERO_TRACK_STREAM (track), format);
@@ -608,8 +608,8 @@
gboolean update,
gboolean check)
{
+ BraseroTrackType *source = NULL;
BraseroSessionCfgPrivate *priv;
- BraseroTrackType source = { 0, };
BraseroBurnResult result;
BraseroDrive *burner;
@@ -619,8 +619,12 @@
return;
/* Make sure there is a source */
- brasero_burn_session_get_input_type (BRASERO_BURN_SESSION (self), &source);
- if (source.type == BRASERO_TRACK_TYPE_NONE) {
+ source = brasero_track_type_new ();
+ brasero_burn_session_get_input_type (BRASERO_BURN_SESSION (self), source);
+
+ if (brasero_track_type_is_empty (source)) {
+ brasero_track_type_free (source);
+
priv->is_valid = BRASERO_SESSION_NOT_SUPPORTED;
g_signal_emit (self,
session_cfg_signals [IS_VALID_SIGNAL],
@@ -628,8 +632,10 @@
return;
}
- if (source.type == BRASERO_TRACK_TYPE_DISC
- && source.subtype.media == BRASERO_MEDIUM_NONE) {
+ if (brasero_track_type_get_has_medium (source)
+ && brasero_track_type_get_medium_type (source) == BRASERO_MEDIUM_NONE) {
+ brasero_track_type_free (source);
+
priv->is_valid = BRASERO_SESSION_NO_INPUT_MEDIUM;
g_signal_emit (self,
session_cfg_signals [IS_VALID_SIGNAL],
@@ -637,11 +643,13 @@
return;
}
- if (source.type == BRASERO_TRACK_TYPE_IMAGE
- && source.subtype.img_format == BRASERO_IMAGE_FORMAT_NONE) {
+ if (brasero_track_type_get_has_image (source)
+ && brasero_track_type_get_image_format (source) == BRASERO_IMAGE_FORMAT_NONE) {
gchar *uri;
GSList *tracks;
+ brasero_track_type_free (source);
+
tracks = brasero_burn_session_get_tracks (BRASERO_BURN_SESSION (self));
/* It can be two cases:
@@ -673,6 +681,8 @@
/* make sure there is an output set */
burner = brasero_burn_session_get_burner (BRASERO_BURN_SESSION (self));
if (!burner) {
+ brasero_track_type_free (source);
+
priv->is_valid = BRASERO_SESSION_NO_OUTPUT;
g_signal_emit (self,
session_cfg_signals [IS_VALID_SIGNAL],
@@ -684,23 +694,27 @@
if (priv->CD_TEXT_modified) {
/* Try to redo what we undid (after all a new plugin could have
* been activated in the mean time ...) and see what happens */
- source.subtype.audio_format |= BRASERO_METADATA_INFO;
+ brasero_track_type_set_image_format (source,
+ BRASERO_METADATA_INFO|
+ brasero_track_type_get_image_format (source));
result = brasero_burn_session_input_supported (BRASERO_BURN_SESSION (self),
- &source,
+ source,
FALSE);
if (result == BRASERO_BURN_OK) {
priv->CD_TEXT_modified = FALSE;
priv->configuring = TRUE;
brasero_session_cfg_set_tracks_audio_format (BRASERO_BURN_SESSION (self),
- source.subtype.audio_format);
+ brasero_track_type_get_stream_format (source));
priv->configuring = FALSE;
}
else {
/* No, nothing's changed */
- source.subtype.audio_format &= ~BRASERO_METADATA_INFO;
+ brasero_track_type_set_stream_format (source,
+ (~BRASERO_METADATA_INFO) &
+ brasero_track_type_get_stream_format (source));
result = brasero_burn_session_input_supported (BRASERO_BURN_SESSION (self),
- &source,
+ source,
FALSE);
}
}
@@ -709,15 +723,18 @@
result = brasero_burn_session_can_burn (BRASERO_BURN_SESSION (self),
FALSE);
if (result != BRASERO_BURN_OK
- && source.type == BRASERO_TRACK_TYPE_STREAM
- && (source.subtype.audio_format & BRASERO_METADATA_INFO)) {
+ && brasero_track_type_get_has_stream (source)
+ && (brasero_track_type_get_stream_format (source) & BRASERO_METADATA_INFO)) {
/* Another special case in case some burning backends
* don't support CD-TEXT for audio (libburn). If no
* other backend is available remove CD-TEXT option but
* tell user... */
- source.subtype.audio_format &= ~BRASERO_METADATA_INFO;
+ brasero_track_type_set_stream_format (source,
+ (~BRASERO_METADATA_INFO) &
+ brasero_track_type_get_stream_format (source));
+
result = brasero_burn_session_input_supported (BRASERO_BURN_SESSION (self),
- &source,
+ source,
FALSE);
BRASERO_BURN_LOG ("Tested support without Metadata information (result %d)", result);
if (result == BRASERO_BURN_OK) {
@@ -725,16 +742,16 @@
priv->configuring = TRUE;
brasero_session_cfg_set_tracks_audio_format (BRASERO_BURN_SESSION (self),
- source.subtype.audio_format);
+ brasero_track_type_get_has_stream (source));
priv->configuring = FALSE;
}
}
}
if (result != BRASERO_BURN_OK) {
- if (source.type == BRASERO_TRACK_TYPE_DISC
- && (source.subtype.media & BRASERO_MEDIUM_PROTECTED)
- && brasero_track_type_is_supported (&source) != 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) {
/* This is a special case to display a helpful message */
priv->is_valid = BRASERO_SESSION_DISC_PROTECTED;
g_signal_emit (self,
@@ -748,9 +765,12 @@
0);
}
+ brasero_track_type_free (source);
return;
}
+ brasero_track_type_free (source);
+
/* Configure flags */
priv->configuring = TRUE;
Modified: trunk/libbrasero-burn/brasero-session.c
==============================================================================
--- trunk/libbrasero-burn/brasero-session.c (original)
+++ trunk/libbrasero-burn/brasero-session.c Mon Apr 6 12:55:06 2009
@@ -254,7 +254,7 @@
/* if there is already a track, then we replace it on condition that it
* has the same type and it's not AUDIO (only one allowed to have many)
*/
- if (brasero_track_get_track_type (new_track, NULL) != BRASERO_TRACK_TYPE_STREAM
+ if (!BRASERO_IS_TRACK_STREAM (new_track)
|| brasero_burn_session_get_input_type (self, NULL) != BRASERO_TRACK_TYPE_STREAM) {
brasero_burn_session_stop_tracks_monitoring (self);
@@ -1187,7 +1187,7 @@
return NULL;
track = priv->tracks->data;
- if (brasero_track_get_track_type (track, NULL) != BRASERO_TRACK_TYPE_DISC)
+ if (!BRASERO_TRACK_DISC (track))
return NULL;
drive = brasero_track_disc_get_drive (BRASERO_TRACK_DISC (track));
@@ -1215,7 +1215,7 @@
return NULL;
track = priv->tracks->data;
- if (brasero_track_get_track_type (track, NULL) != BRASERO_TRACK_TYPE_DISC)
+ if (!BRASERO_TRACK_DISC (track))
return NULL;
return brasero_track_disc_get_drive (BRASERO_TRACK_DISC (track));
@@ -1244,7 +1244,7 @@
return FALSE;
track = priv->tracks->data;
- if (brasero_track_get_track_type (track, NULL) != BRASERO_TRACK_TYPE_DISC)
+ if (!BRASERO_TRACK_DISC (track))
return FALSE;
drive = brasero_track_disc_get_drive (BRASERO_TRACK_DISC (track));
@@ -1338,7 +1338,7 @@
gboolean
brasero_burn_session_start (BraseroBurnSession *self)
{
- BraseroTrackType type;
+ BraseroTrackType *type = NULL;
BraseroBurnSessionPrivate *priv;
g_return_val_if_fail (BRASERO_IS_BURN_SESSION (self), FALSE);
@@ -1371,11 +1371,11 @@
return FALSE;
}
-
BRASERO_BURN_LOG ("Session starting:");
- brasero_burn_session_get_input_type (self, &type);
- BRASERO_BURN_LOG_TYPE (&type, "Input\t=");
+ type = brasero_track_type_new ();
+ brasero_burn_session_get_input_type (self, type);
+ BRASERO_BURN_LOG_TYPE (type, "Input\t=");
BRASERO_BURN_LOG_FLAGS (priv->settings->flags, "flags\t=");
@@ -1387,11 +1387,13 @@
BRASERO_BURN_LOG ("speed\t= %i", priv->settings->rate);
}
else {
- type.type = BRASERO_TRACK_TYPE_IMAGE;
- type.subtype.img_format = brasero_burn_session_get_output_format (self);
- BRASERO_BURN_LOG_TYPE (&type, "output format\t=");
+ brasero_track_type_set_has_image (type);
+ brasero_track_type_set_image_format (type, brasero_burn_session_get_output_format (self));
+ BRASERO_BURN_LOG_TYPE (type, "output format\t=");
}
+ brasero_track_type_free (type);
+
return TRUE;
}
Modified: trunk/libbrasero-burn/brasero-src-image.c
==============================================================================
--- trunk/libbrasero-burn/brasero-src-image.c (original)
+++ trunk/libbrasero-burn/brasero-src-image.c Mon Apr 6 12:55:06 2009
@@ -89,8 +89,8 @@
brasero_src_image_save (BraseroSrcImage *self)
{
gchar *uri = NULL;
- BraseroTrackType type;
GtkRecentManager *recent;
+ BraseroImageFormat format;
gchar *groups [] = { "brasero",
NULL };
GtkRecentData recent_data = { NULL,
@@ -104,13 +104,12 @@
priv = BRASERO_SRC_IMAGE_PRIVATE (self);
- brasero_track_get_track_type (BRASERO_TRACK (priv->track), &type);
- if (type.type == BRASERO_TRACK_TYPE_NONE
- || type.subtype.img_format == BRASERO_IMAGE_FORMAT_NONE)
+ format = brasero_track_image_get_format (BRASERO_TRACK_IMAGE (priv->track));
+ if (format == BRASERO_IMAGE_FORMAT_NONE)
return;
/* Add it to recent file manager */
- switch (type.subtype.img_format) {
+ switch (format) {
case BRASERO_IMAGE_FORMAT_BIN:
recent_data.mime_type = (gchar *) mimes [0];
uri = brasero_track_image_get_source (BRASERO_TRACK_IMAGE (priv->track), TRUE);
@@ -178,9 +177,9 @@
guint64 size = 0;
GError *error = NULL;
BraseroBurnResult result;
+ BraseroImageFormat format;
gchar *size_string = NULL;
BraseroSrcImagePrivate *priv;
- BraseroTrackType type = { 0, };
priv = BRASERO_SRC_IMAGE_PRIVATE (self);
@@ -189,8 +188,8 @@
/* Retrieve a path or an uri */
path = NULL;
- brasero_track_get_track_type (BRASERO_TRACK (priv->track), &type);
- switch (type.subtype.img_format) {
+ format = brasero_track_image_get_format (BRASERO_TRACK_IMAGE (priv->track));
+ switch (format) {
case BRASERO_IMAGE_FORMAT_NONE:
case BRASERO_IMAGE_FORMAT_BIN:
uri = brasero_track_image_get_source (BRASERO_TRACK_IMAGE (priv->track), TRUE);
@@ -341,13 +340,10 @@
static void
brasero_src_image_set_formats (BraseroSrcImage *dialog)
{
+ BraseroTrackType *input = NULL;
BraseroSrcImagePrivate *priv;
BraseroImageFormat formats;
BraseroImageFormat format;
- BraseroTrackType output;
- BraseroTrackType input;
- BraseroMedium *medium;
- BraseroDrive *drive;
priv = BRASERO_SRC_IMAGE_PRIVATE (dialog);
@@ -355,26 +351,24 @@
return;
/* get the available image types */
- output.type = BRASERO_TRACK_TYPE_DISC;
- drive = brasero_burn_session_get_burner (priv->session);
- medium = brasero_drive_get_medium (drive);
- output.subtype.media = brasero_medium_get_status (medium);
-
- input.type = BRASERO_TRACK_TYPE_IMAGE;
+ input = brasero_track_type_new ();
+ brasero_track_type_set_has_image (input);
formats = BRASERO_IMAGE_FORMAT_NONE;
format = BRASERO_IMAGE_FORMAT_CDRDAO;
for (; format != BRASERO_IMAGE_FORMAT_NONE; format >>= 1) {
BraseroBurnResult result;
- input.subtype.img_format = format;
+ brasero_track_type_set_image_format (input, format);
result = brasero_burn_session_input_supported (priv->session,
- &input,
+ input,
FALSE);
if (result == BRASERO_BURN_OK)
formats |= format;
}
+ brasero_track_type_free (input);
+
brasero_image_type_chooser_set_formats (BRASERO_IMAGE_TYPE_CHOOSER (priv->format), formats);
format = brasero_track_image_cfg_get_forced_format (priv->track);
@@ -385,13 +379,13 @@
brasero_src_image_get_current_uri (BraseroSrcImage *self)
{
BraseroSrcImagePrivate *priv;
- BraseroTrackType type = { 0, };
+ BraseroImageFormat format;
gchar *uri = NULL;
priv = BRASERO_SRC_IMAGE_PRIVATE (self);
- brasero_track_get_track_type (BRASERO_TRACK (priv->track), &type);
- switch (type.subtype.img_format) {
+ format = brasero_track_image_get_format (BRASERO_TRACK_IMAGE (priv->track));
+ switch (format) {
case BRASERO_IMAGE_FORMAT_NONE:
case BRASERO_IMAGE_FORMAT_BIN:
uri = brasero_track_image_get_source (BRASERO_TRACK_IMAGE (priv->track), TRUE);
@@ -675,32 +669,32 @@
track = _get_session_image_track (session);
if (track) {
if (!BRASERO_IS_TRACK_IMAGE_CFG (track)) {
- BraseroTrackType type = { 0, };
+ BraseroImageFormat format;
guint64 blocks = 0;
gchar *image = NULL;
gchar *toc = NULL;
toc = brasero_track_image_get_toc_source (BRASERO_TRACK_IMAGE (track), TRUE);
image = brasero_track_image_get_source (BRASERO_TRACK_IMAGE (track), TRUE);
- brasero_track_get_track_type (BRASERO_TRACK (track), &type);
+ format = brasero_track_image_get_format (BRASERO_TRACK_IMAGE (track));
brasero_track_get_size (BRASERO_TRACK (track),
&blocks,
NULL);
priv->track = brasero_track_image_cfg_new ();
- if (blocks && type.subtype.img_format != BRASERO_IMAGE_FORMAT_NONE) {
+ if (blocks && format != BRASERO_IMAGE_FORMAT_NONE) {
/* copy all the information */
brasero_track_image_set_source (BRASERO_TRACK_IMAGE (priv->track),
image,
toc,
- type.subtype.img_format);
+ format);
brasero_track_image_set_block_num (BRASERO_TRACK_IMAGE (priv->track), blocks);
}
else {
- brasero_track_image_cfg_force_format (priv->track, type.subtype.img_format);
+ brasero_track_image_cfg_force_format (priv->track, format);
- switch (type.subtype.img_format) {
+ switch (format) {
case BRASERO_IMAGE_FORMAT_NONE:
case BRASERO_IMAGE_FORMAT_BIN:
brasero_track_image_cfg_set_source (priv->track, image);
Modified: trunk/libbrasero-burn/brasero-track-data.c
==============================================================================
--- trunk/libbrasero-burn/brasero-track-data.c (original)
+++ trunk/libbrasero-burn/brasero-track-data.c Mon Apr 6 12:55:06 2009
@@ -150,6 +150,17 @@
return BRASERO_BURN_OK;
}
+BraseroImageFS
+brasero_track_data_get_fs (BraseroTrackData *track)
+{
+ BraseroTrackDataPrivate *priv;
+
+ g_return_val_if_fail (BRASERO_IS_TRACK_DATA (track), BRASERO_IMAGE_FS_NONE);
+
+ priv = BRASERO_TRACK_DATA_PRIVATE (track);
+ return priv->fs_type;
+}
+
BraseroBurnResult
brasero_track_data_set_data_blocks (BraseroTrackData *track,
guint64 blocks)
@@ -285,8 +296,8 @@
if (!type)
return BRASERO_TRACK_TYPE_DATA;
- type->type = BRASERO_TRACK_TYPE_DATA;
- type->subtype.fs_type = priv->fs_type;
+ brasero_track_type_set_has_data (type);
+ brasero_track_type_set_data_fs (type, priv->fs_type);
return BRASERO_TRACK_TYPE_DATA;
}
Modified: trunk/libbrasero-burn/brasero-track-data.h
==============================================================================
--- trunk/libbrasero-burn/brasero-track-data.h (original)
+++ trunk/libbrasero-burn/brasero-track-data.h Mon Apr 6 12:55:06 2009
@@ -116,6 +116,9 @@
brasero_track_data_get_file_num (BraseroTrackData *track,
guint64 *num_files);
+BraseroImageFS
+brasero_track_data_get_fs (BraseroTrackData *track);
+
G_END_DECLS
#endif /* _BRASERO_TRACK_DATA_H_ */
Modified: trunk/libbrasero-burn/brasero-track-disc.c
==============================================================================
--- trunk/libbrasero-burn/brasero-track-disc.c (original)
+++ trunk/libbrasero-burn/brasero-track-disc.c Mon Apr 6 12:55:06 2009
@@ -153,6 +153,22 @@
return priv->drive;
}
+BraseroMedia
+brasero_track_disc_get_medium_type (BraseroTrackDisc *track)
+{
+ BraseroTrackDiscPrivate *priv;
+ BraseroMedium *medium;
+
+ g_return_val_if_fail (BRASERO_IS_TRACK_DISC (track), BRASERO_MEDIUM_NONE);
+
+ priv = BRASERO_TRACK_DISC_PRIVATE (track);
+ medium = brasero_drive_get_medium (priv->drive);
+ if (!medium)
+ return BRASERO_MEDIUM_NONE;
+
+ return brasero_medium_get_status (medium);
+}
+
static BraseroBurnResult
brasero_track_disc_get_size (BraseroTrack *track,
guint64 *blocks,
@@ -190,8 +206,9 @@
medium = brasero_drive_get_medium (priv->drive);
- type->type = BRASERO_TRACK_TYPE_DISC;
- type->subtype.media = brasero_medium_get_status (medium);
+ brasero_track_type_set_has_medium (type);
+ brasero_track_type_set_medium_type (type, brasero_medium_get_status (medium));
+
return BRASERO_TRACK_TYPE_DISC;
}
Modified: trunk/libbrasero-burn/brasero-track-disc.h
==============================================================================
--- trunk/libbrasero-burn/brasero-track-disc.h (original)
+++ trunk/libbrasero-burn/brasero-track-disc.h Mon Apr 6 12:55:06 2009
@@ -78,6 +78,9 @@
guint
brasero_track_disc_get_track_num (BraseroTrackDisc *track);
+BraseroMedia
+brasero_track_disc_get_medium_type (BraseroTrackDisc *track);
+
G_END_DECLS
#endif /* _BRASERO_TRACK_DISC_H_ */
Modified: trunk/libbrasero-burn/brasero-track-image-cfg.c
==============================================================================
--- trunk/libbrasero-burn/brasero-track-image-cfg.c (original)
+++ trunk/libbrasero-burn/brasero-track-image-cfg.c Mon Apr 6 12:55:06 2009
@@ -310,22 +310,22 @@
BraseroImageFormat format)
{
BraseroTrackImageCfgPrivate *priv;
- BraseroTrackType type = { 0, };
+ BraseroImageFormat current_format;
gchar *uri = NULL;
g_return_val_if_fail (BRASERO_IS_TRACK_IMAGE_CFG (track), BRASERO_BURN_NOT_SUPPORTED);
priv = BRASERO_TRACK_IMAGE_CFG_PRIVATE (track);
- brasero_track_get_track_type (BRASERO_TRACK (track), &type);
+ current_format = brasero_track_image_get_format (BRASERO_TRACK_IMAGE (track));
if (format != BRASERO_TRACK_TYPE_NONE) {
- if (type.subtype.img_format == format)
+ if (current_format == format)
return BRASERO_BURN_OK;
}
priv->format = format;
- switch (type.subtype.img_format) {
+ switch (current_format) {
case BRASERO_IMAGE_FORMAT_NONE:
case BRASERO_IMAGE_FORMAT_BIN:
uri = brasero_track_image_get_source (BRASERO_TRACK_IMAGE (track), TRUE);
@@ -358,7 +358,6 @@
GError **error)
{
BraseroTrackImageCfgPrivate *priv;
- BraseroTrackType type = { 0, };
priv = BRASERO_TRACK_IMAGE_CFG_PRIVATE (track);
@@ -373,8 +372,7 @@
}
/* See if we managed to set a format (all went well then) */
- brasero_track_get_track_type (BRASERO_TRACK (track), &type);
- if (type.subtype.img_format == BRASERO_TRACK_TYPE_NONE) {
+ if (brasero_track_image_get_format (BRASERO_TRACK_IMAGE (track)) == BRASERO_IMAGE_FORMAT_NONE) {
if (error)
g_set_error (error,
BRASERO_BURN_ERROR,
Modified: trunk/libbrasero-burn/brasero-track-image.c
==============================================================================
--- trunk/libbrasero-burn/brasero-track-image.c (original)
+++ trunk/libbrasero-burn/brasero-track-image.c Mon Apr 6 12:55:06 2009
@@ -164,6 +164,17 @@
return brasero_string_get_localpath (priv->toc);
}
+BraseroImageFormat
+brasero_track_image_get_format (BraseroTrackImage *track)
+{
+ BraseroTrackImagePrivate *priv;
+
+ g_return_val_if_fail (BRASERO_IS_TRACK_IMAGE (track), BRASERO_IMAGE_FORMAT_NONE);
+
+ priv = BRASERO_TRACK_IMAGE_PRIVATE (track);
+ return priv->format;
+}
+
static BraseroTrackDataType
brasero_track_image_get_track_type (BraseroTrack *track,
BraseroTrackType *type)
@@ -175,8 +186,8 @@
if (!type)
return BRASERO_TRACK_TYPE_IMAGE;
- type->type = BRASERO_TRACK_TYPE_IMAGE;
- type->subtype.img_format = priv->format;
+ brasero_track_type_set_has_image (type);
+ brasero_track_type_set_image_format (type, priv->format);
return BRASERO_TRACK_TYPE_IMAGE;
}
Modified: trunk/libbrasero-burn/brasero-track-image.h
==============================================================================
--- trunk/libbrasero-burn/brasero-track-image.h (original)
+++ trunk/libbrasero-burn/brasero-track-image.h Mon Apr 6 12:55:06 2009
@@ -81,6 +81,9 @@
brasero_track_image_get_toc_source (BraseroTrackImage *track,
gboolean uri);
+BraseroImageFormat
+brasero_track_image_get_format (BraseroTrackImage *track);
+
G_END_DECLS
#endif /* _BURN_TRACK_IMAGE_H_ */
Modified: trunk/libbrasero-burn/brasero-track-stream.c
==============================================================================
--- trunk/libbrasero-burn/brasero-track-stream.c (original)
+++ trunk/libbrasero-burn/brasero-track-stream.c Mon Apr 6 12:55:06 2009
@@ -74,6 +74,18 @@
return BRASERO_BURN_OK;
}
+BraseroStreamFormat
+brasero_track_stream_get_format (BraseroTrackStream *track)
+{
+ BraseroTrackStreamPrivate *priv;
+
+ g_return_val_if_fail (BRASERO_IS_TRACK_STREAM (track), BRASERO_AUDIO_FORMAT_NONE);
+
+ priv = BRASERO_TRACK_STREAM_PRIVATE (track);
+
+ return priv->format;
+}
+
BraseroBurnResult
brasero_track_stream_set_format (BraseroTrackStream *track,
BraseroStreamFormat format)
@@ -218,8 +230,8 @@
if (!type)
return BRASERO_TRACK_TYPE_STREAM;
- type->type = BRASERO_TRACK_TYPE_STREAM;
- type->subtype.audio_format = priv->format;
+ brasero_track_type_set_has_stream (type);
+ brasero_track_type_set_stream_format (type, priv->format);
return BRASERO_TRACK_TYPE_STREAM;
}
Modified: trunk/libbrasero-burn/brasero-track-stream.h
==============================================================================
--- trunk/libbrasero-burn/brasero-track-stream.h (original)
+++ trunk/libbrasero-burn/brasero-track-stream.h Mon Apr 6 12:55:06 2009
@@ -48,9 +48,9 @@
#define BRASERO_STREAM_TRACK_HAS_VIDEO(type_MACRO) \
(((type_MACRO)->type == BRASERO_TRACK_TYPE_STREAM) && \
- ((type_MACRO)->subtype.audio_format & (BRASERO_VIDEO_FORMAT_UNDEFINED| \
- BRASERO_VIDEO_FORMAT_VCD| \
- BRASERO_VIDEO_FORMAT_VIDEO_DVD)))
+ ((type_MACRO)->subtype.stream_format & (BRASERO_VIDEO_FORMAT_UNDEFINED| \
+ BRASERO_VIDEO_FORMAT_VCD| \
+ BRASERO_VIDEO_FORMAT_VIDEO_DVD)))
#define BRASERO_TYPE_TRACK_STREAM (brasero_track_stream_get_type ())
@@ -109,6 +109,9 @@
guint64
brasero_track_stream_get_gap (BraseroTrackStream *track);
+BraseroStreamFormat
+brasero_track_stream_get_format (BraseroTrackStream *track);
+
G_END_DECLS
#endif /* _BRASERO_TRACK_STREAM_H_ */
Added: trunk/libbrasero-burn/brasero-track-type.c
==============================================================================
--- (empty file)
+++ trunk/libbrasero-burn/brasero-track-type.c Mon Apr 6 12:55:06 2009
@@ -0,0 +1,323 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
+/*
+ * Libbrasero-burn
+ * Copyright (C) Philippe Rouquier 2005-2009 <bonfire-app wanadoo fr>
+ *
+ * Libbrasero-burn 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.
+ *
+ * The Libbrasero-burn authors hereby grant permission for non-GPL compatible
+ * GStreamer plugins to be used and distributed together with GStreamer
+ * and Libbrasero-burn. This permission is above and beyond the permissions granted
+ * by the GPL license by which Libbrasero-burn is covered. If you modify this code
+ * you may extend this exception to your version of the code, but you are not
+ * obligated to do so. If you do not wish to do so, delete this exception
+ * statement from your version.
+ *
+ * Libbrasero-burn 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 Library 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.
+ */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <glib.h>
+
+#include "brasero-medium.h"
+#include "brasero-drive.h"
+
+#include "burn-caps.h"
+
+
+BraseroTrackType *
+brasero_track_type_new (void)
+{
+ return g_new0 (BraseroTrackType, 1);
+}
+
+void
+brasero_track_type_free (BraseroTrackType *type)
+{
+ g_free (type);
+}
+
+BraseroImageFormat
+brasero_track_type_get_image_format (const BraseroTrackType *type)
+{
+ g_return_val_if_fail (type != NULL, BRASERO_IMAGE_FORMAT_NONE);
+
+ if (type->type != BRASERO_TRACK_TYPE_IMAGE)
+ return BRASERO_IMAGE_FORMAT_NONE;
+
+ return type->subtype.img_format;
+}
+
+BraseroImageFS
+brasero_track_type_get_data_fs (const BraseroTrackType *type)
+{
+ g_return_val_if_fail (type != NULL, BRASERO_IMAGE_FS_NONE);
+
+ if (type->type != BRASERO_TRACK_TYPE_DATA)
+ return BRASERO_IMAGE_FS_NONE;
+
+ return type->subtype.fs_type;
+}
+
+BraseroStreamFormat
+brasero_track_type_get_stream_format (const BraseroTrackType *type)
+{
+ g_return_val_if_fail (type != NULL, BRASERO_AUDIO_FORMAT_NONE);
+
+ if (type->type != BRASERO_TRACK_TYPE_STREAM)
+ return BRASERO_AUDIO_FORMAT_NONE;
+
+ return type->subtype.stream_format;
+}
+
+BraseroMedia
+brasero_track_type_get_medium_type (const BraseroTrackType *type)
+{
+ g_return_val_if_fail (type != NULL, BRASERO_MEDIUM_NONE);
+
+ if (type->type != BRASERO_TRACK_TYPE_DISC)
+ return BRASERO_MEDIUM_NONE;
+
+ return type->subtype.media;
+}
+
+void
+brasero_track_type_set_image_format (BraseroTrackType *type,
+ BraseroImageFormat format)
+{
+ g_return_if_fail (type != NULL);
+
+ if (type->type != BRASERO_TRACK_TYPE_IMAGE)
+ return;
+
+ type->subtype.img_format = format;
+}
+
+void
+brasero_track_type_set_data_fs (BraseroTrackType *type,
+ BraseroImageFS fs_type)
+{
+ g_return_if_fail (type != NULL);
+
+ if (type->type != BRASERO_TRACK_TYPE_DATA)
+ return;
+
+ type->subtype.fs_type = fs_type;
+}
+
+void
+brasero_track_type_set_stream_format (BraseroTrackType *type,
+ BraseroImageFormat format)
+{
+ g_return_if_fail (type != NULL);
+
+ if (type->type != BRASERO_TRACK_TYPE_STREAM)
+ return;
+
+ type->subtype.stream_format = format;
+}
+
+void
+brasero_track_type_set_medium_type (BraseroTrackType *type,
+ BraseroMedia media)
+{
+ g_return_if_fail (type != NULL);
+
+ if (type->type != BRASERO_TRACK_TYPE_DISC)
+ return;
+
+ type->subtype.media = media;
+}
+
+gboolean
+brasero_track_type_is_empty (const BraseroTrackType *type)
+{
+ g_return_val_if_fail (type != NULL, FALSE);
+
+ return (type->type == BRASERO_TRACK_TYPE_NONE);
+}
+
+gboolean
+brasero_track_type_get_has_data (const BraseroTrackType *type)
+{
+ g_return_val_if_fail (type != NULL, FALSE);
+
+ return type->type == BRASERO_TRACK_TYPE_DATA;
+}
+
+gboolean
+brasero_track_type_get_has_image (const BraseroTrackType *type)
+{
+ g_return_val_if_fail (type != NULL, FALSE);
+
+ return type->type == BRASERO_TRACK_TYPE_IMAGE;
+}
+
+gboolean
+brasero_track_type_get_has_stream (const BraseroTrackType *type)
+{
+ g_return_val_if_fail (type != NULL, FALSE);
+
+ return type->type == BRASERO_TRACK_TYPE_STREAM;
+}
+
+gboolean
+brasero_track_type_get_has_medium (const BraseroTrackType *type)
+{
+ g_return_val_if_fail (type != NULL, FALSE);
+
+ return type->type == BRASERO_TRACK_TYPE_DISC;
+}
+
+void
+brasero_track_type_set_has_data (BraseroTrackType *type)
+{
+ g_return_if_fail (type != NULL);
+
+ type->type = BRASERO_TRACK_TYPE_DATA;
+}
+
+void
+brasero_track_type_set_has_image (BraseroTrackType *type)
+{
+ g_return_if_fail (type != NULL);
+
+ type->type = BRASERO_TRACK_TYPE_IMAGE;
+}
+
+void
+brasero_track_type_set_has_stream (BraseroTrackType *type)
+{
+ g_return_if_fail (type != NULL);
+
+ type->type = BRASERO_TRACK_TYPE_STREAM;
+}
+
+void
+brasero_track_type_set_has_medium (BraseroTrackType *type)
+{
+ g_return_if_fail (type != NULL);
+
+ type->type = BRASERO_TRACK_TYPE_DISC;
+}
+
+gboolean
+brasero_track_type_equal (const BraseroTrackType *type_A,
+ const BraseroTrackType *type_B)
+{
+ g_return_val_if_fail (type_A != NULL, FALSE);
+ g_return_val_if_fail (type_B != NULL, FALSE);
+
+ if (type_A->type != type_B->type)
+ return FALSE;
+
+ switch (type_A->type) {
+ case BRASERO_TRACK_TYPE_DATA:
+ if (type_A->subtype.fs_type != type_B->subtype.fs_type)
+ return FALSE;
+ break;
+
+ case BRASERO_TRACK_TYPE_DISC:
+ if (type_B->subtype.media != type_A->subtype.media)
+ return FALSE;
+ break;
+
+ case BRASERO_TRACK_TYPE_IMAGE:
+ if (type_A->subtype.img_format != type_B->subtype.img_format)
+ return FALSE;
+ break;
+
+ case BRASERO_TRACK_TYPE_STREAM:
+ if (type_A->subtype.stream_format != type_B->subtype.stream_format)
+ return FALSE;
+ break;
+
+ default:
+ break;
+ }
+
+ return TRUE;
+}
+
+gboolean
+brasero_track_type_match (const BraseroTrackType *type_A,
+ const BraseroTrackType *type_B)
+{
+ g_return_val_if_fail (type_A != NULL, FALSE);
+ g_return_val_if_fail (type_B != NULL, FALSE);
+
+ if (type_A->type != type_B->type)
+ return FALSE;
+
+ switch (type_A->type) {
+ case BRASERO_TRACK_TYPE_DATA:
+ if (!(type_A->subtype.fs_type & type_B->subtype.fs_type))
+ return FALSE;
+ break;
+
+ case BRASERO_TRACK_TYPE_DISC:
+ if (!(type_A->subtype.media & type_B->subtype.media))
+ return FALSE;
+ break;
+
+ case BRASERO_TRACK_TYPE_IMAGE:
+ if (!(type_A->subtype.img_format & type_B->subtype.img_format))
+ return FALSE;
+ break;
+
+ case BRASERO_TRACK_TYPE_STREAM:
+ if (!(type_A->subtype.stream_format & type_B->subtype.stream_format))
+ return FALSE;
+ break;
+
+ default:
+ break;
+ }
+
+ return TRUE;
+}
+
+/**
+ * This is to determine whether or not a track type is supported
+ */
+
+BraseroBurnResult
+brasero_track_type_supported (BraseroTrackType *type)
+{
+ GSList *iter;
+ BraseroBurnCaps *self;
+
+ g_return_val_if_fail (type != NULL, BRASERO_BURN_ERR);
+
+ self = brasero_burn_caps_get_default ();
+
+ for (iter = self->priv->caps_list; iter; iter = iter->next) {
+ BraseroCaps *caps;
+
+ caps = iter->data;
+
+ if (brasero_caps_is_compatible_type (caps, type)
+ && brasero_burn_caps_is_input (self, caps)) {
+ g_object_unref (self);
+ return BRASERO_BURN_OK;
+ }
+ }
+
+ g_object_unref (self);
+ return BRASERO_BURN_ERR;
+}
Added: trunk/libbrasero-burn/brasero-track-type.h
==============================================================================
--- (empty file)
+++ trunk/libbrasero-burn/brasero-track-type.h Mon Apr 6 12:55:06 2009
@@ -0,0 +1,106 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
+/*
+ * Libbrasero-burn
+ * Copyright (C) Philippe Rouquier 2005-2009 <bonfire-app wanadoo fr>
+ *
+ * Libbrasero-burn 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.
+ *
+ * The Libbrasero-burn authors hereby grant permission for non-GPL compatible
+ * GStreamer plugins to be used and distributed together with GStreamer
+ * and Libbrasero-burn. This permission is above and beyond the permissions granted
+ * by the GPL license by which Libbrasero-burn is covered. If you modify this code
+ * you may extend this exception to your version of the code, but you are not
+ * obligated to do so. If you do not wish to do so, delete this exception
+ * statement from your version.
+ *
+ * Libbrasero-burn 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 Library 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 _BURN_TRACK_TYPE_H
+#define _BURN_TRACK_TYPE_H
+
+#include <glib.h>
+
+G_BEGIN_DECLS
+
+/* NOTE: the order has a meaning here and is used for sorting */
+typedef enum {
+ BRASERO_TRACK_TYPE_NONE = 0,
+ BRASERO_TRACK_TYPE_STREAM,
+ BRASERO_TRACK_TYPE_DATA,
+ BRASERO_TRACK_TYPE_IMAGE,
+ BRASERO_TRACK_TYPE_DISC,
+} BraseroTrackDataType;
+
+typedef struct _BraseroTrackType BraseroTrackType;
+
+BraseroTrackType *
+brasero_track_type_new (void);
+
+void
+brasero_track_type_free (BraseroTrackType *type);
+
+gboolean
+brasero_track_type_is_empty (const BraseroTrackType *type);
+gboolean
+brasero_track_type_get_has_data (const BraseroTrackType *type);
+gboolean
+brasero_track_type_get_has_image (const BraseroTrackType *type);
+gboolean
+brasero_track_type_get_has_stream (const BraseroTrackType *type);
+gboolean
+brasero_track_type_get_has_medium (const BraseroTrackType *type);
+
+void
+brasero_track_type_set_has_data (BraseroTrackType *type);
+void
+brasero_track_type_set_has_image (BraseroTrackType *type);
+void
+brasero_track_type_set_has_stream (BraseroTrackType *type);
+void
+brasero_track_type_set_has_medium (BraseroTrackType *type);
+
+BraseroStreamFormat
+brasero_track_type_get_stream_format (const BraseroTrackType *type);
+BraseroImageFormat
+brasero_track_type_get_image_format (const BraseroTrackType *type);
+BraseroMedia
+brasero_track_type_get_medium_type (const BraseroTrackType *type);
+BraseroImageFS
+brasero_track_type_get_data_fs (const BraseroTrackType *type);
+
+void
+brasero_track_type_set_stream_format (BraseroTrackType *type,
+ BraseroImageFormat format);
+void
+brasero_track_type_set_image_format (BraseroTrackType *type,
+ BraseroImageFormat format);
+void
+brasero_track_type_set_medium_type (BraseroTrackType *type,
+ BraseroMedia media);
+void
+brasero_track_type_set_data_fs (BraseroTrackType *type,
+ BraseroImageFS fs_type);
+
+gboolean
+brasero_track_type_equal (const BraseroTrackType *type_A,
+ const BraseroTrackType *type_B);
+
+BraseroBurnResult
+brasero_track_type_supported (BraseroTrackType *type);
+
+G_END_DECLS
+
+#endif
Modified: trunk/libbrasero-burn/brasero-track.c
==============================================================================
--- trunk/libbrasero-burn/brasero-track.c (original)
+++ trunk/libbrasero-burn/brasero-track.c Mon Apr 6 12:55:06 2009
@@ -32,28 +32,16 @@
# include <config.h>
#endif
-#include <errno.h>
#include <string.h>
#include <glib.h>
-#include <glib/gstdio.h>
-#include <glib/gi18n-lib.h>
-
-#include <gio/gio.h>
#include "brasero-track.h"
-#include "burn-debug.h"
-#include "burn-caps.h"
-#include "brasero-medium.h"
-#include "burn-image-format.h"
-#include "brasero-drive.h"
-#include "burn-mkisofs-base.h"
+
typedef struct _BraseroTrackPrivate BraseroTrackPrivate;
struct _BraseroTrackPrivate
{
- BraseroTrackType type;
-
GHashTable *tags;
gchar *checksum;
@@ -74,76 +62,6 @@
G_DEFINE_TYPE (BraseroTrack, brasero_track, G_TYPE_OBJECT);
-gboolean
-brasero_track_type_equal (const BraseroTrackType *type_A,
- const BraseroTrackType *type_B)
-{
- if (type_A->type != type_B->type)
- return FALSE;
-
- switch (type_A->type) {
- case BRASERO_TRACK_TYPE_DATA:
- if (type_A->subtype.fs_type != type_B->subtype.fs_type)
- return FALSE;
- break;
-
- case BRASERO_TRACK_TYPE_DISC:
- if (type_B->subtype.media != type_A->subtype.media)
- return FALSE;
- break;
-
- case BRASERO_TRACK_TYPE_IMAGE:
- if (type_A->subtype.img_format != type_B->subtype.img_format)
- return FALSE;
- break;
-
- case BRASERO_TRACK_TYPE_STREAM:
- if (type_A->subtype.audio_format != type_B->subtype.audio_format)
- return FALSE;
- break;
-
- default:
- break;
- }
-
- return TRUE;
-}
-
-gboolean
-brasero_track_type_match (const BraseroTrackType *type_A,
- const BraseroTrackType *type_B)
-{
- if (type_A->type != type_B->type)
- return FALSE;
-
- switch (type_A->type) {
- case BRASERO_TRACK_TYPE_DATA:
- if (!(type_A->subtype.fs_type & type_B->subtype.fs_type))
- return FALSE;
- break;
-
- case BRASERO_TRACK_TYPE_DISC:
- if (!(type_A->subtype.media & type_B->subtype.media))
- return FALSE;
- break;
-
- case BRASERO_TRACK_TYPE_IMAGE:
- if (!(type_A->subtype.img_format & type_B->subtype.img_format))
- return FALSE;
- break;
-
- case BRASERO_TRACK_TYPE_STREAM:
- if (!(type_A->subtype.img_format & type_B->subtype.img_format))
- return FALSE;
- break;
-
- default:
- break;
- }
-
- return TRUE;
-}
-
BraseroTrackDataType
brasero_track_get_track_type (BraseroTrack *track,
BraseroTrackType *type)
@@ -415,33 +333,6 @@
0);
}
-/**
- * This is to determine whether of not a track type is supported
- */
-
-BraseroBurnResult
-brasero_track_type_is_supported (BraseroTrackType *type)
-{
- GSList *iter;
- BraseroBurnCaps *self;
-
- self = brasero_burn_caps_get_default ();
-
- for (iter = self->priv->caps_list; iter; iter = iter->next) {
- BraseroCaps *caps;
-
- caps = iter->data;
-
- if (brasero_caps_is_compatible_type (caps, type)
- && brasero_burn_caps_is_input (self, caps)) {
- g_object_unref (self);
- return BRASERO_BURN_OK;
- }
- }
-
- g_object_unref (self);
- return BRASERO_BURN_ERR;
-}
/**
* GObject part
Modified: trunk/libbrasero-burn/brasero-track.h
==============================================================================
--- trunk/libbrasero-burn/brasero-track.h (original)
+++ trunk/libbrasero-burn/brasero-track.h Mon Apr 6 12:55:06 2009
@@ -39,36 +39,10 @@
#include <brasero-enums.h>
#include <brasero-error.h>
+#include <brasero-track-type.h>
G_BEGIN_DECLS
-/* NOTE: the order has a meaning here and is used for sorting */
-typedef enum {
- BRASERO_TRACK_TYPE_NONE = 0,
- BRASERO_TRACK_TYPE_STREAM,
- BRASERO_TRACK_TYPE_DATA,
- BRASERO_TRACK_TYPE_IMAGE,
- BRASERO_TRACK_TYPE_DISC,
-} BraseroTrackDataType;
-
-struct _BraseroTrackType {
- BraseroTrackDataType type;
- union {
- BraseroImageFormat img_format; /* used with IMAGE type */
- BraseroMedia media; /* used with DISC types */
- BraseroImageFS fs_type;
- BraseroStreamFormat audio_format;
- } subtype;
-};
-typedef struct _BraseroTrackType BraseroTrackType;
-
-BraseroBurnResult
-brasero_track_type_is_supported (BraseroTrackType *type);
-
-gboolean
-brasero_track_type_equal (const BraseroTrackType *type_A,
- const BraseroTrackType *type_B);
-
#define BRASERO_TYPE_TRACK (brasero_track_get_type ())
#define BRASERO_TRACK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BRASERO_TYPE_TRACK, BraseroTrack))
#define BRASERO_TRACK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BRASERO_TYPE_TRACK, BraseroTrackClass))
@@ -116,7 +90,7 @@
BraseroTrackDataType
brasero_track_get_track_type (BraseroTrack *track,
- BraseroTrackType *type);
+ BraseroTrackType *type);
/**
* Checksums
Modified: trunk/libbrasero-burn/burn-caps.c
==============================================================================
--- trunk/libbrasero-burn/burn-caps.c (original)
+++ trunk/libbrasero-burn/burn-caps.c Mon Apr 6 12:55:06 2009
@@ -51,6 +51,7 @@
#include "brasero-plugin-information.h"
#include "burn-task.h"
#include "burn-caps.h"
+#include "brasero-track-type-private.h"
#define BRASERO_ENGINE_GROUP_KEY "/apps/brasero/config/engine-group"
@@ -165,15 +166,15 @@
case BRASERO_TRACK_TYPE_STREAM:
/* There is one small special case here with video. */
- if ((caps->type.subtype.audio_format & (BRASERO_VIDEO_FORMAT_UNDEFINED|
- BRASERO_VIDEO_FORMAT_VCD|
- BRASERO_VIDEO_FORMAT_VIDEO_DVD))
- && !(type->subtype.audio_format & (BRASERO_VIDEO_FORMAT_UNDEFINED|
+ if ((caps->type.subtype.stream_format & (BRASERO_VIDEO_FORMAT_UNDEFINED|
+ BRASERO_VIDEO_FORMAT_VCD|
+ BRASERO_VIDEO_FORMAT_VIDEO_DVD))
+ && !(type->subtype.stream_format & (BRASERO_VIDEO_FORMAT_UNDEFINED|
BRASERO_VIDEO_FORMAT_VCD|
BRASERO_VIDEO_FORMAT_VIDEO_DVD)))
return FALSE;
- if ((caps->type.subtype.audio_format & type->subtype.audio_format) != type->subtype.audio_format)
+ if ((caps->type.subtype.stream_format & type->subtype.stream_format) != type->subtype.stream_format)
return FALSE;
break;
Modified: trunk/libbrasero-burn/burn-caps.h
==============================================================================
--- trunk/libbrasero-burn/burn-caps.h (original)
+++ trunk/libbrasero-burn/burn-caps.h Mon Apr 6 12:55:06 2009
@@ -35,7 +35,8 @@
#include <glib-object.h>
#include "burn-basics.h"
-#include "brasero-track.h"
+#include "brasero-track-type.h"
+#include "brasero-track-type-private.h"
#include "brasero-plugin.h"
#include "brasero-plugin-registration.h"
Modified: trunk/libbrasero-burn/burn-debug.c
==============================================================================
--- trunk/libbrasero-burn/burn-debug.c (original)
+++ trunk/libbrasero-burn/burn-debug.c Mon Apr 6 12:55:06 2009
@@ -244,6 +244,72 @@
}
void
+brasero_burn_debug_track_type_struct_message (BraseroTrackType *type,
+ BraseroPluginIOFlag flags,
+ const gchar *location,
+ const gchar *format,
+ ...)
+{
+ gchar buffer [256];
+ gchar *format_real;
+ va_list arg_list;
+
+ if (!debug)
+ return;
+
+ if (brasero_track_type_get_has_data (type)) {
+ strcpy (buffer, "Data ");
+ brasero_debug_data_fs_to_string (buffer, brasero_track_type_get_data_fs (type));
+ }
+ else if (brasero_track_type_get_has_medium (type)) {
+ strcpy (buffer, "Disc ");
+ brasero_media_to_string (brasero_track_type_get_medium_type (type), buffer);
+ }
+ else if (brasero_track_type_get_has_stream (type)) {
+ strcpy (buffer, "Audio ");
+ brasero_debug_audio_format_to_string (buffer, brasero_track_type_get_stream_format (type));
+
+ if (flags != BRASERO_PLUGIN_IO_NONE) {
+ strcat (buffer, "format accepts ");
+
+ if (flags & BRASERO_PLUGIN_IO_ACCEPT_FILE)
+ strcat (buffer, "files ");
+ if (flags & BRASERO_PLUGIN_IO_ACCEPT_PIPE)
+ strcat (buffer, "pipe ");
+ }
+ }
+ else if (brasero_track_type_get_has_image (type)) {
+ strcpy (buffer, "Image ");
+ brasero_debug_image_format_to_string (buffer, brasero_track_type_get_image_format (type));
+
+ if (flags != BRASERO_PLUGIN_IO_NONE) {
+ strcat (buffer, "format accepts ");
+
+ if (flags & BRASERO_PLUGIN_IO_ACCEPT_FILE)
+ strcat (buffer, "files ");
+ if (flags & BRASERO_PLUGIN_IO_ACCEPT_PIPE)
+ strcat (buffer, "pipe ");
+ }
+ }
+ else
+ strcpy (buffer, "Undefined");
+
+ format_real = g_strdup_printf ("At %s: %s %s",
+ location,
+ format,
+ buffer);
+
+ va_start (arg_list, format);
+ g_logv (BRASERO_BURN_LOG_DOMAIN,
+ G_LOG_LEVEL_DEBUG,
+ format_real,
+ arg_list);
+ va_end (arg_list);
+
+ g_free (format_real);
+}
+
+void
brasero_burn_debug_track_type_message (BraseroTrackDataType type,
guint subtype,
BraseroPluginIOFlag flags,
Modified: trunk/libbrasero-burn/burn-debug.h
==============================================================================
--- trunk/libbrasero-burn/burn-debug.h (original)
+++ trunk/libbrasero-burn/burn-debug.h Mon Apr 6 12:55:06 2009
@@ -65,11 +65,13 @@
format, \
##__VA_ARGS__);
-#define BRASERO_BURN_LOG_TYPE(type_MACRO, format, ...) \
- BRASERO_BURN_LOG_WITH_TYPE (type_MACRO, \
- BRASERO_PLUGIN_IO_NONE, \
- format, \
- ##__VA_ARGS__);
+#define BRASERO_BURN_LOG_TYPE(type_MACRO, format, ...) \
+ brasero_burn_debug_track_type_struct_message (type_MACRO, \
+ BRASERO_PLUGIN_IO_NONE, \
+ G_STRLOC, \
+ format, \
+ ##__VA_ARGS__);
+
#define BRASERO_BURN_LOG_WITH_TYPE(type_MACRO, flags_MACRO, format, ...) \
BRASERO_BURN_LOG_WITH_FULL_TYPE ((type_MACRO)->type, \
(type_MACRO)->subtype.media, \
@@ -91,6 +93,12 @@
brasero_burn_debug_setup_module (GModule *handle);
void
+brasero_burn_debug_track_type_struct_message (BraseroTrackType *type,
+ BraseroPluginIOFlag flags,
+ const gchar *location,
+ const gchar *format,
+ ...);
+void
brasero_burn_debug_track_type_message (BraseroTrackDataType type,
guint subtype,
BraseroPluginIOFlag flags,
Modified: trunk/libbrasero-burn/burn-job.c
==============================================================================
--- trunk/libbrasero-burn/burn-job.c (original)
+++ trunk/libbrasero-burn/burn-job.c Mon Apr 6 12:55:06 2009
@@ -45,6 +45,9 @@
#include <gio/gio.h>
+#include "brasero-drive.h"
+#include "brasero-medium.h"
+
#include "burn-basics.h"
#include "burn-debug.h"
#include "brasero-session.h"
@@ -54,8 +57,8 @@
#include "burn-task-ctx.h"
#include "burn-task-item.h"
#include "libbrasero-marshal.h"
-#include "brasero-drive.h"
-#include "brasero-medium.h"
+
+#include "brasero-track-type-private.h"
typedef struct _BraseroJobOutput {
gchar *image;
Modified: trunk/libbrasero-burn/burn-process.c
==============================================================================
--- trunk/libbrasero-burn/burn-process.c (original)
+++ trunk/libbrasero-burn/burn-process.c Mon Apr 6 12:55:06 2009
@@ -202,9 +202,9 @@
static BraseroBurnResult
brasero_process_finished (BraseroProcess *self)
{
- BraseroTrackType type;
BraseroBurnResult result;
BraseroTrack *track = NULL;
+ BraseroTrackType *type = NULL;
BraseroJobAction action = BRASERO_BURN_ACTION_NONE;
BraseroProcessPrivate *priv = BRASERO_PROCESS_PRIVATE (self);
BraseroProcessClass *klass = BRASERO_PROCESS_GET_CLASS (self);
@@ -244,13 +244,16 @@
return BRASERO_BURN_OK;
}
- result = brasero_job_get_output_type (BRASERO_JOB (self), &type);
- if (result != BRASERO_BURN_OK || type.type == BRASERO_TRACK_TYPE_DISC) {
+ type = brasero_track_type_new ();
+ result = brasero_job_get_output_type (BRASERO_JOB (self), type);
+
+ if (result != BRASERO_BURN_OK || brasero_track_type_get_has_medium (type)) {
+ brasero_track_type_free (type);
klass->post (BRASERO_JOB (self));
return BRASERO_BURN_OK;
}
- if (type.type == BRASERO_TRACK_TYPE_IMAGE) {
+ if (brasero_track_type_get_has_image (type)) {
gchar *toc = NULL;
gchar *image = NULL;
@@ -262,21 +265,23 @@
brasero_track_image_set_source (BRASERO_TRACK_IMAGE (track),
image,
toc,
- type.subtype.img_format);
+ brasero_track_type_get_image_format (type));
g_free (image);
g_free (toc);
}
- else if (type.type == BRASERO_TRACK_TYPE_STREAM) {
+ else if (brasero_track_type_get_has_stream (type)) {
gchar *uri = NULL;
track = BRASERO_TRACK (brasero_track_stream_new ());
brasero_job_get_audio_output (BRASERO_JOB (self), &uri);
brasero_track_stream_set_source (BRASERO_TRACK_STREAM (track), uri);
- brasero_track_stream_set_format (BRASERO_TRACK_STREAM (track), type.subtype.audio_format);
+ brasero_track_stream_set_format (BRASERO_TRACK_STREAM (track),
+ brasero_track_type_get_stream_format (type));
g_free (uri);
}
+ brasero_track_type_free (type);
if (track) {
brasero_job_add_track (BRASERO_JOB (self), track);
Modified: trunk/libbrasero-burn/burn-task-ctx.c
==============================================================================
--- trunk/libbrasero-burn/burn-task-ctx.c (original)
+++ trunk/libbrasero-burn/burn-task-ctx.c Mon Apr 6 12:55:06 2009
@@ -275,8 +275,8 @@
priv = BRASERO_TASK_CTX_PRIVATE (self);
- BRASERO_BURN_LOG ("Adding track (type = %i) %s",
- brasero_track_get_track_type (track, NULL),
+ BRASERO_BURN_LOG ("Adding track %s",
+// brasero_track_get_track_type (track, NULL),
priv->tracks? "already some tracks":"");
/* Ref the track and store it for later. */
Modified: trunk/libbrasero-burn/burn-task.c
==============================================================================
--- trunk/libbrasero-burn/burn-task.c (original)
+++ trunk/libbrasero-burn/burn-task.c Mon Apr 6 12:55:06 2009
@@ -43,6 +43,8 @@
#include "burn-task-item.h"
#include "burn-task-ctx.h"
+#include "brasero-track-image.h"
+#include "brasero-track-stream.h"
static void brasero_task_class_init (BraseroTaskClass *klass);
static void brasero_task_init (BraseroTask *sp);
@@ -391,17 +393,15 @@
brasero_task_set_track_output_size_default (BraseroTask *self,
GError **error)
{
- BraseroTrackType input = { 0 };
BraseroTrack *track = NULL;
BRASERO_BURN_LOG ("Trying to set a default output size");
brasero_task_ctx_get_current_track (BRASERO_TASK_CTX (self), &track);
- brasero_track_get_track_type (track, &input);
- BRASERO_BURN_LOG_TYPE (&input, "Track type");
+// BRASERO_BURN_LOG_TYPE (&input, "Track type");
- if (input.type == BRASERO_TRACK_TYPE_IMAGE
- || input.type == BRASERO_TRACK_TYPE_STREAM) {
+ if (BRASERO_IS_TRACK_IMAGE (track)
+ || BRASERO_IS_TRACK_STREAM (track)) {
BraseroBurnResult result;
guint64 sectors = 0;
guint64 size = 0;
Modified: trunk/libbrasero-burn/plugins/cdrdao/burn-cdrdao.c
==============================================================================
--- trunk/libbrasero-burn/plugins/cdrdao/burn-cdrdao.c (original)
+++ trunk/libbrasero-burn/plugins/cdrdao/burn-cdrdao.c Mon Apr 6 12:55:06 2009
@@ -310,18 +310,20 @@
brasero_cdrdao_set_argv_record (BraseroCdrdao *cdrdao,
GPtrArray *argv)
{
- BraseroTrackType type;
+ BraseroTrackType *type = NULL;
BraseroCdrdaoPrivate *priv;
priv = BRASERO_CDRDAO_PRIVATE (cdrdao);
g_ptr_array_add (argv, g_strdup ("cdrdao"));
- brasero_job_get_input_type (BRASERO_JOB (cdrdao), &type);
- if (type.type == BRASERO_TRACK_TYPE_DISC) {
+ type = brasero_track_type_new ();
+ brasero_job_get_input_type (BRASERO_JOB (cdrdao), type);
+
+ if (brasero_track_type_get_has_medium (type)) {
BraseroDrive *drive;
- BraseroBurnFlag flags;
BraseroTrack *track;
+ BraseroBurnFlag flags;
g_ptr_array_add (argv, g_strdup ("copy"));
brasero_cdrdao_set_argv_device (cdrdao, argv);
@@ -348,13 +350,13 @@
#endif
}
- else if (type.type == BRASERO_TRACK_TYPE_IMAGE) {
+ else if (brasero_track_type_get_has_image (type)) {
gchar *cuepath;
BraseroTrack *track;
brasero_job_get_current_track (BRASERO_JOB (cdrdao), &track);
- if (type.subtype.img_format == BRASERO_IMAGE_FORMAT_CUE) {
+ if (brasero_track_type_get_image_format (type) == BRASERO_IMAGE_FORMAT_CUE) {
gchar *parent;
cuepath = brasero_track_image_get_toc_source (BRASERO_TRACK_IMAGE (track), FALSE);
@@ -362,13 +364,17 @@
brasero_process_set_working_directory (BRASERO_PROCESS (cdrdao), parent);
g_free (parent);
}
- else if (type.subtype.img_format == BRASERO_IMAGE_FORMAT_CDRDAO)
+ else if (brasero_track_type_get_image_format (type) == BRASERO_IMAGE_FORMAT_CDRDAO)
cuepath = brasero_track_image_get_toc_source (BRASERO_TRACK_IMAGE (track), FALSE);
- else
+ else {
+ brasero_track_type_free (type);
BRASERO_JOB_NOT_SUPPORTED (cdrdao);
+ }
- if (!cuepath)
+ if (!cuepath) {
+ brasero_track_type_free (type);
BRASERO_JOB_NOT_READY (cdrdao);
+ }
g_ptr_array_add (argv, g_strdup ("write"));
@@ -378,9 +384,12 @@
g_ptr_array_add (argv, cuepath);
}
- else
+ else {
+ brasero_track_type_free (type);
BRASERO_JOB_NOT_SUPPORTED (cdrdao);
+ }
+ brasero_track_type_free (type);
brasero_job_set_use_average_rate (BRASERO_JOB (cdrdao), TRUE);
brasero_job_set_current_action (BRASERO_JOB (cdrdao),
BRASERO_BURN_ACTION_START_RECORDING,
@@ -422,10 +431,10 @@
GError **error)
{
gchar *image = NULL, *toc = NULL;
+ BraseroTrackType *output = NULL;
BraseroBurnResult result;
- BraseroDrive *drive;
BraseroJobAction action;
- BraseroTrackType output;
+ BraseroDrive *drive;
BraseroTrack *track;
g_ptr_array_add (argv, g_strdup ("cdrdao"));
@@ -447,29 +456,39 @@
/* This is done so that if a cue file is required we first generate
* a temporary toc file that will be later converted to a cue file.
* The datafile is written where it should be from the start. */
- brasero_job_get_output_type (BRASERO_JOB (cdrdao), &output);
- if (output.subtype.img_format == BRASERO_IMAGE_FORMAT_CDRDAO) {
+ output = brasero_track_type_new ();
+ brasero_job_get_output_type (BRASERO_JOB (cdrdao), output);
+
+ if (brasero_track_type_get_image_format (output) == BRASERO_IMAGE_FORMAT_CDRDAO) {
result = brasero_job_get_image_output (BRASERO_JOB (cdrdao),
&image,
&toc);
- if (result != BRASERO_BURN_OK)
+ if (result != BRASERO_BURN_OK) {
+ brasero_track_type_free (output);
return result;
+ }
}
else {
result = brasero_job_get_image_output (BRASERO_JOB (cdrdao),
&image,
NULL);
- if (result != BRASERO_BURN_OK)
+ if (result != BRASERO_BURN_OK) {
+ brasero_track_type_free (output);
return result;
+ }
result = brasero_job_get_tmp_file (BRASERO_JOB (cdrdao),
NULL,
&toc,
error);
- if (result != BRASERO_BURN_OK)
+ if (result != BRASERO_BURN_OK) {
+ brasero_track_type_free (output);
return result;
+ }
}
+ brasero_track_type_free (output);
+
/* it's safe to remove them: session/task make sure they don't exist
* when there is the proper flag whether it be tmp or real output. */
if (toc)
@@ -518,12 +537,10 @@
else if (action == BRASERO_JOB_ACTION_IMAGE)
return brasero_cdrdao_set_argv_image (cdrdao, argv, error);
else if (action == BRASERO_JOB_ACTION_SIZE) {
- BraseroTrackDataType input;
BraseroTrack *track;
brasero_job_get_current_track (BRASERO_JOB (cdrdao), &track);
- input = brasero_track_get_track_type (track, NULL);
- if (input == BRASERO_TRACK_TYPE_DISC) {
+ if (BRASERO_IS_TRACK_DISC (track)) {
guint64 sectors = 0;
brasero_track_get_size (track, §ors, NULL);
Modified: trunk/libbrasero-burn/plugins/cdrkit/burn-genisoimage.c
==============================================================================
--- trunk/libbrasero-burn/plugins/cdrkit/burn-genisoimage.c (original)
+++ trunk/libbrasero-burn/plugins/cdrkit/burn-genisoimage.c Mon Apr 6 12:55:06 2009
@@ -224,10 +224,10 @@
{
gchar *label = NULL;
BraseroTrack *track;
- BraseroTrackType type;
BraseroBurnFlag flags;
gchar *emptydir = NULL;
gchar *videodir = NULL;
+ BraseroImageFS image_fs;
BraseroBurnResult result;
BraseroJobAction action;
gchar *grafts_path = NULL;
@@ -240,12 +240,12 @@
if (result != BRASERO_BURN_OK)
BRASERO_JOB_NOT_READY (genisoimage);
- brasero_track_get_track_type (track, &type);
- if (type.subtype.fs_type & BRASERO_IMAGE_FS_JOLIET)
+ image_fs = brasero_track_data_get_fs (BRASERO_TRACK_DATA (track));
+ if (image_fs & BRASERO_IMAGE_FS_JOLIET)
g_ptr_array_add (argv, g_strdup ("-J"));
- if ((type.subtype.fs_type & BRASERO_IMAGE_FS_ISO)
- && (type.subtype.fs_type & BRASERO_IMAGE_ISO_FS_LEVEL_3)) {
+ if ((image_fs & BRASERO_IMAGE_FS_ISO)
+ && (image_fs & BRASERO_IMAGE_ISO_FS_LEVEL_3)) {
g_ptr_array_add (argv, g_strdup ("-iso-level"));
g_ptr_array_add (argv, g_strdup ("3"));
@@ -254,10 +254,10 @@
g_ptr_array_add (argv, g_strdup ("-allow-limited-size"));
}
- if (type.subtype.fs_type & BRASERO_IMAGE_FS_UDF)
+ if (image_fs & BRASERO_IMAGE_FS_UDF)
g_ptr_array_add (argv, g_strdup ("-udf"));
- if (type.subtype.fs_type & BRASERO_IMAGE_FS_VIDEO) {
+ if (image_fs & BRASERO_IMAGE_FS_VIDEO) {
g_ptr_array_add (argv, g_strdup ("-dvd-video"));
result = brasero_job_get_tmp_dir (BRASERO_JOB (genisoimage),
@@ -269,7 +269,7 @@
g_ptr_array_add (argv, g_strdup ("-graft-points"));
- if (type.subtype.fs_type & BRASERO_IMAGE_ISO_FS_DEEP_DIRECTORY)
+ if (image_fs & BRASERO_IMAGE_ISO_FS_DEEP_DIRECTORY)
g_ptr_array_add (argv, g_strdup ("-D")); // This is dangerous the manual says but apparently it works well
result = brasero_job_get_tmp_file (BRASERO_JOB (genisoimage),
@@ -302,7 +302,7 @@
}
result = brasero_track_data_get_paths (BRASERO_TRACK_DATA (track),
- (type.subtype.fs_type & BRASERO_IMAGE_FS_JOLIET) != 0,
+ (image_fs & BRASERO_IMAGE_FS_JOLIET) != 0,
grafts_path,
excluded_path,
emptydir,
Modified: trunk/libbrasero-burn/plugins/cdrkit/burn-readom.c
==============================================================================
--- trunk/libbrasero-burn/plugins/cdrkit/burn-readom.c (original)
+++ trunk/libbrasero-burn/plugins/cdrkit/burn-readom.c Mon Apr 6 12:55:06 2009
@@ -63,15 +63,17 @@
if ((pos = strstr (line, "addr:"))) {
gint sector;
gint64 written;
- BraseroTrackType output;
+ BraseroTrackType *output = NULL;
pos += strlen ("addr:");
sector = strtoll (pos, NULL, 10);
- brasero_job_get_output_type (BRASERO_JOB (readom), &output);
- if (output.subtype.img_format == BRASERO_IMAGE_FORMAT_BIN)
+ output = brasero_track_type_new ();
+ brasero_job_get_output_type (BRASERO_JOB (readom), output);
+
+ if (brasero_track_type_get_image_format (output) == BRASERO_IMAGE_FORMAT_BIN)
written = (gint64) ((gint64) sector * 2048ULL);
- else if (output.subtype.img_format == BRASERO_IMAGE_FORMAT_CLONE)
+ else if (brasero_track_type_get_image_format (output) == BRASERO_IMAGE_FORMAT_CLONE)
written = (gint64) ((gint64) sector * 2448ULL);
else
written = (gint64) ((gint64) sector * 2048ULL);
@@ -80,6 +82,8 @@
if (sector > 10)
brasero_job_start_progress (BRASERO_JOB (readom), FALSE);
+
+ brasero_track_type_free (output);
}
else if ((pos = strstr (line, "Capacity:"))) {
brasero_job_set_current_action (BRASERO_JOB (readom),
@@ -124,10 +128,12 @@
guint64 nb_blocks;
BraseroTrack *track;
GValue *value = NULL;
- BraseroTrackType output;
+ BraseroTrackType *output = NULL;
brasero_job_get_current_track (BRASERO_JOB (readom), &track);
- brasero_job_get_output_type (BRASERO_JOB (readom), &output);
+
+ output = brasero_track_type_new ();
+ brasero_job_get_output_type (BRASERO_JOB (readom), output);
brasero_track_tag_lookup (track,
BRASERO_TRACK_MEDIUM_ADDRESS_START_TAG,
@@ -181,7 +187,7 @@
start + nb_blocks));
}
/* if it's BIN output just read the last track */
- else if (output.subtype.img_format == BRASERO_IMAGE_FORMAT_BIN) {
+ else if (brasero_track_type_get_image_format (output) == BRASERO_IMAGE_FORMAT_BIN) {
guint64 start;
BraseroDrive *drive;
BraseroMedium *medium;
@@ -207,6 +213,8 @@
g_ptr_array_add (argv, g_strdup_printf ("-sectors=0-%lli", nb_blocks));
}
+ brasero_track_type_free (output);
+
return BRASERO_BURN_OK;
}
@@ -216,11 +224,18 @@
{
guint64 blocks;
GValue *value = NULL;
- BraseroTrackType output;
BraseroTrack *track = NULL;
+ BraseroTrackType *output = NULL;
brasero_job_get_current_track (BRASERO_JOB (self), &track);
- brasero_job_get_output_type (BRASERO_JOB (self), &output);
+
+ output = brasero_track_type_new ();
+ brasero_job_get_output_type (BRASERO_JOB (self), output);
+
+ if (!brasero_track_type_get_has_image (output)) {
+ brasero_track_type_free (output);
+ return BRASERO_BURN_ERR;
+ }
brasero_track_tag_lookup (track,
BRASERO_TRACK_MEDIUM_ADDRESS_START_TAG,
@@ -251,7 +266,7 @@
NULL,
&blocks);
}
- else if (output.subtype.img_format == BRASERO_IMAGE_FORMAT_BIN) {
+ else if (brasero_track_type_get_image_format (output) == BRASERO_IMAGE_FORMAT_BIN) {
BraseroDrive *drive;
BraseroMedium *medium;
@@ -264,21 +279,22 @@
else
brasero_track_get_size (track, &blocks, NULL);
- if (output.type != BRASERO_TRACK_TYPE_IMAGE)
- return BRASERO_BURN_ERR;
-
- if (output.subtype.img_format == BRASERO_IMAGE_FORMAT_BIN) {
+ if (brasero_track_type_get_image_format (output) == BRASERO_IMAGE_FORMAT_BIN) {
brasero_job_set_output_size_for_current_track (BRASERO_JOB (self),
blocks,
blocks * 2048ULL);
}
- else if (output.subtype.img_format == BRASERO_IMAGE_FORMAT_CLONE) {
+ else if (brasero_track_type_get_image_format (output) == BRASERO_IMAGE_FORMAT_CLONE) {
brasero_job_set_output_size_for_current_track (BRASERO_JOB (self),
blocks,
blocks * 2448ULL);
}
- else
+ else {
+ brasero_track_type_free (output);
return BRASERO_BURN_NOT_SUPPORTED;
+ }
+
+ brasero_track_type_free (output);
/* no need to go any further */
return BRASERO_BURN_NOT_RUNNING;
@@ -290,8 +306,9 @@
GError **error)
{
BraseroBurnResult result = FALSE;
+ BraseroTrackType *output = NULL;
+ BraseroImageFormat format;
BraseroJobAction action;
- BraseroTrackType output;
BraseroReadom *readom;
BraseroMedium *medium;
BraseroDrive *drive;
@@ -321,10 +338,14 @@
medium = brasero_drive_get_medium (drive);
media = brasero_medium_get_status (medium);
- brasero_job_get_output_type (BRASERO_JOB (readom), &output);
+
+ output = brasero_track_type_new ();
+ brasero_job_get_output_type (BRASERO_JOB (readom), output);
+ format = brasero_track_type_get_image_format (output);
+ brasero_track_type_free (output);
if ((media & BRASERO_MEDIUM_DVD)
- && output.subtype.img_format != BRASERO_IMAGE_FORMAT_BIN) {
+ && format != BRASERO_IMAGE_FORMAT_BIN) {
g_set_error (error,
BRASERO_BURN_ERROR,
BRASERO_BURN_ERROR_GENERAL,
@@ -332,12 +353,12 @@
return BRASERO_BURN_ERR;
}
- if (output.subtype.img_format == BRASERO_IMAGE_FORMAT_CLONE) {
+ if (format == BRASERO_IMAGE_FORMAT_CLONE) {
/* NOTE: with this option the sector size is 2448
* because it is raw96 (2352+96) otherwise it is 2048 */
g_ptr_array_add (argv, g_strdup ("-clone"));
}
- else if (output.subtype.img_format == BRASERO_IMAGE_FORMAT_BIN) {
+ else if (format == BRASERO_IMAGE_FORMAT_BIN) {
g_ptr_array_add (argv, g_strdup ("-noerror"));
/* don't do it for clone since we need the entire disc */
@@ -351,8 +372,8 @@
if (brasero_job_get_fd_out (BRASERO_JOB (readom), NULL) != BRASERO_BURN_OK) {
gchar *image;
- if (output.subtype.img_format != BRASERO_IMAGE_FORMAT_CLONE
- && output.subtype.img_format != BRASERO_IMAGE_FORMAT_BIN)
+ if (format != BRASERO_IMAGE_FORMAT_CLONE
+ && format != BRASERO_IMAGE_FORMAT_BIN)
BRASERO_JOB_NOT_SUPPORTED (readom);
result = brasero_job_get_image_output (BRASERO_JOB (readom),
@@ -365,7 +386,7 @@
g_ptr_array_add (argv, outfile_arg);
g_free (image);
}
- else if (output.subtype.img_format == BRASERO_IMAGE_FORMAT_BIN) {
+ else if (format == BRASERO_IMAGE_FORMAT_BIN) {
outfile_arg = g_strdup ("-f=-");
g_ptr_array_add (argv, outfile_arg);
}
Modified: trunk/libbrasero-burn/plugins/cdrkit/burn-wodim.c
==============================================================================
--- trunk/libbrasero-burn/plugins/cdrkit/burn-wodim.c (original)
+++ trunk/libbrasero-burn/plugins/cdrkit/burn-wodim.c Mon Apr 6 12:55:06 2009
@@ -319,15 +319,17 @@
priv->tracks_total_bytes += mb_total * 1048576;
*/ }
else if (strstr (line, "Sending CUE sheet")) {
- BraseroTrackType type;
+ BraseroTrackType *type = NULL;
/* See if we are in an audio case which would mean we're writing
* CD-TEXT */
- brasero_job_get_input_type (BRASERO_JOB (wodim), &type);
+ type = brasero_track_type_new ();
+ brasero_job_get_input_type (BRASERO_JOB (wodim), type);
brasero_job_set_current_action (BRASERO_JOB (process),
BRASERO_BURN_ACTION_RECORDING_CD_TEXT,
- (type.type == BRASERO_TRACK_TYPE_STREAM) ? NULL:_("Writing cue sheet"),
+ brasero_track_type_get_has_stream (type) ? NULL:_("Writing cue sheet"),
FALSE);
+ brasero_track_type_free (type);
}
else if (g_str_has_prefix (line, "Re-load disk and hit <CR>")
|| g_str_has_prefix (line, "send SIGUSR1 to continue")) {
@@ -729,8 +731,8 @@
{
guint speed;
BraseroBurnFlag flags;
- BraseroTrackType type;
BraseroWodimPrivate *priv;
+ BraseroTrackType *type = NULL;
priv = BRASERO_WODIM_PRIVATE (wodim);
@@ -765,15 +767,18 @@
if (flags & BRASERO_BURN_FLAG_DAO)
g_ptr_array_add (argv, g_strdup ("-dao"));
- brasero_job_get_input_type (BRASERO_JOB (wodim), &type);
+ type = brasero_track_type_new ();
+ brasero_job_get_input_type (BRASERO_JOB (wodim), type);
if (brasero_job_get_fd_in (BRASERO_JOB (wodim), NULL) == BRASERO_BURN_OK) {
BraseroBurnResult result;
int buffer_size;
guint64 sectors;
/* we need to know what is the type of the track (audio / data) */
- result = brasero_job_get_input_type (BRASERO_JOB (wodim), &type);
+ result = brasero_job_get_input_type (BRASERO_JOB (wodim), type);
if (result != BRASERO_BURN_OK) {
+ brasero_track_type_free (type);
+
BRASERO_JOB_LOG (wodim, "Imager doesn't seem to be ready");
g_set_error (error,
BRASERO_BURN_ERROR,
@@ -787,6 +792,8 @@
§ors,
NULL);
if (result != BRASERO_BURN_OK) {
+ brasero_track_type_free (type);
+
BRASERO_JOB_LOG (wodim, "The size of the session cannot be retrieved");
g_set_error (error,
BRASERO_BURN_ERROR,
@@ -804,18 +811,20 @@
buffer_size = 4;
g_ptr_array_add (argv, g_strdup_printf ("fs=%im", buffer_size));
- if (type.type == BRASERO_TRACK_TYPE_IMAGE) {
- if (type.subtype.img_format == BRASERO_IMAGE_FORMAT_BIN) {
+ if (brasero_track_type_get_has_image (type)) {
+ if (brasero_track_type_get_image_format (type) == BRASERO_IMAGE_FORMAT_BIN) {
g_ptr_array_add (argv, g_strdup_printf ("tsize=%Lis", sectors));
g_ptr_array_add (argv, g_strdup ("-data"));
g_ptr_array_add (argv, g_strdup ("-nopad"));
g_ptr_array_add (argv, g_strdup ("-"));
}
- else
+ else {
+ brasero_track_type_free (type);
BRASERO_JOB_NOT_SUPPORTED (wodim);
+ }
}
- else if (type.type == BRASERO_TRACK_TYPE_STREAM) {
+ else if (brasero_track_type_get_has_stream (type)) {
/* NOTE: when we don't want wodim to use stdin then we
* give the audio file on the command line. Otherwise we
* use the .inf */
@@ -827,13 +836,17 @@
result = brasero_wodim_write_infs (wodim,
argv,
error);
- if (result != BRASERO_BURN_OK)
+ if (result != BRASERO_BURN_OK) {
+ brasero_track_type_free (type);
return result;
+ }
}
- else
+ else {
+ brasero_track_type_free (type);
BRASERO_JOB_NOT_SUPPORTED (wodim);
+ }
}
- else if (type.type == BRASERO_TRACK_TYPE_STREAM) {
+ else if (brasero_track_type_get_has_stream (type)) {
BraseroBurnResult result;
GSList *tracks;
@@ -848,8 +861,10 @@
result = brasero_wodim_write_infs (wodim,
NULL,
error);
- if (result != BRASERO_BURN_OK)
+ if (result != BRASERO_BURN_OK) {
+ brasero_track_type_free (type);
return result;
+ }
tracks = NULL;
brasero_job_get_tracks (BRASERO_JOB (wodim), &tracks);
@@ -862,55 +877,67 @@
g_ptr_array_add (argv, path);
}
}
- else if (type.type == BRASERO_TRACK_TYPE_IMAGE) {
+ else if (brasero_track_type_get_has_image (type)) {
BraseroTrack *track = NULL;
+ BraseroImageFormat format;
brasero_job_get_current_track (BRASERO_JOB (wodim), &track);
- if (!track)
+ if (!track) {
+ brasero_track_type_free (type);
BRASERO_JOB_NOT_READY (wodim);
+ }
- if (type.subtype.img_format == BRASERO_IMAGE_FORMAT_NONE) {
+ format = brasero_track_type_get_image_format (type);
+ if (format == BRASERO_IMAGE_FORMAT_NONE) {
gchar *image_path;
image_path = brasero_track_image_get_source (BRASERO_TRACK_IMAGE (track), FALSE);
- if (!image_path)
+ if (!image_path) {
+ brasero_track_type_free (type);
BRASERO_JOB_NOT_READY (wodim);
+ }
g_ptr_array_add (argv, g_strdup ("fs=16m"));
g_ptr_array_add (argv, g_strdup ("-data"));
g_ptr_array_add (argv, g_strdup ("-nopad"));
g_ptr_array_add (argv, image_path);
}
- else if (type.subtype.img_format == BRASERO_IMAGE_FORMAT_BIN) {
+ else if (format == BRASERO_IMAGE_FORMAT_BIN) {
gchar *isopath;
isopath = brasero_track_image_get_source (BRASERO_TRACK_IMAGE (track), FALSE);
- if (!isopath)
+ if (!isopath) {
+ brasero_track_type_free (type);
BRASERO_JOB_NOT_READY (wodim);
+ }
g_ptr_array_add (argv, g_strdup ("fs=16m"));
g_ptr_array_add (argv, g_strdup ("-data"));
g_ptr_array_add (argv, g_strdup ("-nopad"));
g_ptr_array_add (argv, isopath);
}
- else if (type.subtype.img_format == BRASERO_IMAGE_FORMAT_CLONE) {
+ else if (format == BRASERO_IMAGE_FORMAT_CLONE) {
gchar *rawpath;
rawpath = brasero_track_image_get_source (BRASERO_TRACK_IMAGE (track), FALSE);
- if (!rawpath)
+ if (!rawpath) {
+ brasero_track_type_free (type);
BRASERO_JOB_NOT_READY (wodim);
+ }
g_ptr_array_add (argv, g_strdup ("fs=16m"));
g_ptr_array_add (argv, g_strdup ("-clone"));
g_ptr_array_add (argv, rawpath);
}
- else if (type.subtype.img_format == BRASERO_IMAGE_FORMAT_CUE) {
+ else if (format == BRASERO_IMAGE_FORMAT_CUE) {
gchar *cue_str;
gchar *cuepath;
cuepath = brasero_track_image_get_toc_source (BRASERO_TRACK_IMAGE (track), FALSE);
- if (!cuepath)
+ if (!cuepath) {
+ brasero_track_type_free (type);
BRASERO_JOB_NOT_READY (wodim);
+ }
g_ptr_array_add (argv, g_strdup ("fs=16m"));
@@ -918,12 +945,17 @@
g_ptr_array_add (argv, cue_str);
g_free (cuepath);
}
- else
+ else {
+ brasero_track_type_free (type);
BRASERO_JOB_NOT_SUPPORTED (wodim);
+ }
}
- else
+ else {
+ brasero_track_type_free (type);
BRASERO_JOB_NOT_SUPPORTED (wodim);
+ }
+ brasero_track_type_free (type);
brasero_job_set_current_action (BRASERO_JOB (wodim),
BRASERO_BURN_ACTION_START_RECORDING,
NULL,
Modified: trunk/libbrasero-burn/plugins/cdrtools/burn-cdrecord.c
==============================================================================
--- trunk/libbrasero-burn/plugins/cdrtools/burn-cdrecord.c (original)
+++ trunk/libbrasero-burn/plugins/cdrtools/burn-cdrecord.c Mon Apr 6 12:55:06 2009
@@ -303,15 +303,17 @@
FALSE);
}
else if (strstr (line, "Sending CUE sheet")) {
- BraseroTrackType type;
+ BraseroTrackType *type = NULL;
/* See if we are in an audio case which would mean we're writing
* CD-TEXT */
- brasero_job_get_input_type (BRASERO_JOB (cdrecord), &type);
+ type = brasero_track_type_new ();
+ brasero_job_get_input_type (BRASERO_JOB (cdrecord), type);
brasero_job_set_current_action (BRASERO_JOB (process),
BRASERO_BURN_ACTION_RECORDING_CD_TEXT,
- (type.type == BRASERO_TRACK_TYPE_STREAM) ? NULL:_("Writing cue sheet"),
+ brasero_track_type_get_has_stream (type) ? NULL:_("Writing cue sheet"),
FALSE);
+ brasero_track_type_free (type);
}
else if (g_str_has_prefix (line, "Re-load disk and hit <CR>")
|| g_str_has_prefix (line, "send SIGUSR1 to continue")) {
@@ -712,8 +714,8 @@
{
guint speed;
BraseroBurnFlag flags;
- BraseroTrackType type;
BraseroCDRecordPrivate *priv;
+ BraseroTrackType *type = NULL;
priv = BRASERO_CD_RECORD_PRIVATE (cdrecord);
@@ -748,15 +750,19 @@
if (flags & BRASERO_BURN_FLAG_DAO)
g_ptr_array_add (argv, g_strdup ("-dao"));
- brasero_job_get_input_type (BRASERO_JOB (cdrecord), &type);
+ type = brasero_track_type_new ();
+ brasero_job_get_input_type (BRASERO_JOB (cdrecord), type);
+
if (brasero_job_get_fd_in (BRASERO_JOB (cdrecord), NULL) == BRASERO_BURN_OK) {
BraseroBurnResult result;
int buffer_size;
guint64 sectors;
/* we need to know what is the type of the track (audio / data) */
- result = brasero_job_get_input_type (BRASERO_JOB (cdrecord), &type);
+ result = brasero_job_get_input_type (BRASERO_JOB (cdrecord), type);
if (result != BRASERO_BURN_OK) {
+ brasero_track_type_free (type);
+
BRASERO_JOB_LOG (cdrecord, "Imager doesn't seem to be ready")
g_set_error (error,
BRASERO_BURN_ERROR,
@@ -770,6 +776,8 @@
§ors,
NULL);
if (result != BRASERO_BURN_OK) {
+ brasero_track_type_free (type);
+
BRASERO_JOB_LOG (cdrecord, "The size of the session cannot be retrieved")
g_set_error (error,
BRASERO_BURN_ERROR,
@@ -787,17 +795,22 @@
buffer_size = 4;
g_ptr_array_add (argv, g_strdup_printf ("fs=%im", buffer_size));
- if (type.type == BRASERO_TRACK_TYPE_IMAGE) {
- if (type.subtype.img_format == BRASERO_IMAGE_FORMAT_BIN) {
+ if (brasero_track_type_get_has_image (type)) {
+ BraseroImageFormat format;
+
+ format = brasero_track_type_get_image_format (type);
+ if (format == BRASERO_IMAGE_FORMAT_BIN) {
g_ptr_array_add (argv, g_strdup_printf ("tsize=%Lis", sectors));
g_ptr_array_add (argv, g_strdup ("-data"));
g_ptr_array_add (argv, g_strdup ("-nopad"));
g_ptr_array_add (argv, g_strdup ("-"));
}
- else
- BRASERO_JOB_NOT_SUPPORTED (cdrecord);;
+ else {
+ brasero_track_type_free (type);
+ BRASERO_JOB_NOT_SUPPORTED (cdrecord);
+ }
}
- else if (type.type == BRASERO_TRACK_TYPE_STREAM) {
+ else if (brasero_track_type_get_has_stream (type)) {
g_ptr_array_add (argv, g_strdup ("-swab"));
g_ptr_array_add (argv, g_strdup ("-audio"));
g_ptr_array_add (argv, g_strdup ("-useinfo"));
@@ -806,13 +819,17 @@
result = brasero_cdrecord_write_infs (cdrecord,
argv,
error);
- if (result != BRASERO_BURN_OK)
+ if (result != BRASERO_BURN_OK) {
+ brasero_track_type_free (type);
return result;
+ }
}
- else
+ else {
+ brasero_track_type_free (type);
BRASERO_JOB_NOT_SUPPORTED (cdrecord);
+ }
}
- else if (type.type == BRASERO_TRACK_TYPE_STREAM) {
+ else if (brasero_track_type_get_has_stream (type)) {
BraseroBurnResult result;
GSList *tracks;
@@ -827,8 +844,10 @@
result = brasero_cdrecord_write_infs (cdrecord,
NULL,
error);
- if (result != BRASERO_BURN_OK)
+ if (result != BRASERO_BURN_OK) {
+ brasero_track_type_free (type);
return result;
+ }
tracks = NULL;
brasero_job_get_tracks (BRASERO_JOB (cdrecord), &tracks);
@@ -841,55 +860,67 @@
g_ptr_array_add (argv, path);
}
}
- else if (type.type == BRASERO_TRACK_TYPE_IMAGE) {
+ else if (brasero_track_type_get_has_image (type)) {
BraseroTrack *track = NULL;
+ BraseroImageFormat format;
brasero_job_get_current_track (BRASERO_JOB (cdrecord), &track);
- if (!track)
+ if (!track) {
+ brasero_track_type_free (type);
BRASERO_JOB_NOT_READY (cdrecord);
+ }
- if (type.subtype.img_format == BRASERO_IMAGE_FORMAT_NONE) {
+ format = brasero_track_type_get_image_format (type);
+ if (format == BRASERO_IMAGE_FORMAT_NONE) {
gchar *image_path;
image_path = brasero_track_image_get_source (BRASERO_TRACK_IMAGE (track), FALSE);
- if (!image_path)
+ if (!image_path) {
+ brasero_track_type_free (type);
BRASERO_JOB_NOT_READY (cdrecord);
+ }
g_ptr_array_add (argv, g_strdup ("fs=16m"));
g_ptr_array_add (argv, g_strdup ("-data"));
g_ptr_array_add (argv, g_strdup ("-nopad"));
g_ptr_array_add (argv, image_path);
}
- else if (type.subtype.img_format == BRASERO_IMAGE_FORMAT_BIN) {
+ else if (format == BRASERO_IMAGE_FORMAT_BIN) {
gchar *isopath;
isopath = brasero_track_image_get_source (BRASERO_TRACK_IMAGE (track), FALSE);
- if (!isopath)
+ if (!isopath) {
+ brasero_track_type_free (type);
BRASERO_JOB_NOT_READY (cdrecord);
+ }
g_ptr_array_add (argv, g_strdup ("fs=16m"));
g_ptr_array_add (argv, g_strdup ("-data"));
g_ptr_array_add (argv, g_strdup ("-nopad"));
g_ptr_array_add (argv, isopath);
}
- else if (type.subtype.img_format == BRASERO_IMAGE_FORMAT_CLONE) {
+ else if (format == BRASERO_IMAGE_FORMAT_CLONE) {
gchar *rawpath;
rawpath = brasero_track_image_get_source (BRASERO_TRACK_IMAGE (track), FALSE);
- if (!rawpath)
+ if (!rawpath) {
+ brasero_track_type_free (type);
BRASERO_JOB_NOT_READY (cdrecord);
+ }
g_ptr_array_add (argv, g_strdup ("fs=16m"));
g_ptr_array_add (argv, g_strdup ("-clone"));
g_ptr_array_add (argv, rawpath);
}
- else if (type.subtype.img_format == BRASERO_IMAGE_FORMAT_CUE) {
+ else if (format == BRASERO_IMAGE_FORMAT_CUE) {
gchar *cue_str;
gchar *cuepath;
cuepath = brasero_track_image_get_toc_source (BRASERO_TRACK_IMAGE (track), FALSE);
- if (!cuepath)
+ if (!cuepath) {
+ brasero_track_type_free (type);
BRASERO_JOB_NOT_READY (cdrecord);
+ }
g_ptr_array_add (argv, g_strdup ("fs=16m"));
@@ -897,11 +928,17 @@
g_ptr_array_add (argv, cue_str);
g_free (cuepath);
}
- else
+ else {
+ brasero_track_type_free (type);
BRASERO_JOB_NOT_SUPPORTED (cdrecord);
+ }
}
- else
+ else {
+ brasero_track_type_free (type);
BRASERO_JOB_NOT_SUPPORTED (cdrecord);
+ }
+
+ brasero_track_type_free (type);
brasero_job_set_current_action (BRASERO_JOB (cdrecord),
BRASERO_BURN_ACTION_START_RECORDING,
Modified: trunk/libbrasero-burn/plugins/cdrtools/burn-mkisofs.c
==============================================================================
--- trunk/libbrasero-burn/plugins/cdrtools/burn-mkisofs.c (original)
+++ trunk/libbrasero-burn/plugins/cdrtools/burn-mkisofs.c Mon Apr 6 12:55:06 2009
@@ -225,11 +225,11 @@
{
gchar *label = NULL;
BraseroTrack *track;
- BraseroTrackType type;
BraseroBurnFlag flags;
gchar *videodir = NULL;
gchar *emptydir = NULL;
BraseroJobAction action;
+ BraseroImageFS image_fs;
BraseroBurnResult result;
gchar *grafts_path = NULL;
gchar *excluded_path = NULL;
@@ -241,20 +241,20 @@
if (result != BRASERO_BURN_OK)
BRASERO_JOB_NOT_READY (mkisofs);
- brasero_track_get_track_type (track, &type);
- if (type.subtype.fs_type & BRASERO_IMAGE_FS_JOLIET)
+ image_fs = brasero_track_data_get_fs (BRASERO_TRACK_DATA (track));
+ if (image_fs & BRASERO_IMAGE_FS_JOLIET)
g_ptr_array_add (argv, g_strdup ("-J"));
- if ((type.subtype.fs_type & BRASERO_IMAGE_FS_ISO)
- && (type.subtype.fs_type & BRASERO_IMAGE_ISO_FS_LEVEL_3)) {
+ if ((image_fs & BRASERO_IMAGE_FS_ISO)
+ && (image_fs & BRASERO_IMAGE_ISO_FS_LEVEL_3)) {
g_ptr_array_add (argv, g_strdup ("-iso-level"));
g_ptr_array_add (argv, g_strdup ("3"));
}
- if (type.subtype.fs_type & BRASERO_IMAGE_FS_UDF)
+ if (image_fs & BRASERO_IMAGE_FS_UDF)
g_ptr_array_add (argv, g_strdup ("-udf"));
- if (type.subtype.fs_type & BRASERO_IMAGE_FS_VIDEO) {
+ if (image_fs & BRASERO_IMAGE_FS_VIDEO) {
g_ptr_array_add (argv, g_strdup ("-dvd-video"));
result = brasero_job_get_tmp_dir (BRASERO_JOB (mkisofs),
@@ -266,7 +266,7 @@
g_ptr_array_add (argv, g_strdup ("-graft-points"));
- if (type.subtype.fs_type & BRASERO_IMAGE_ISO_FS_DEEP_DIRECTORY)
+ if (image_fs & BRASERO_IMAGE_ISO_FS_DEEP_DIRECTORY)
g_ptr_array_add (argv, g_strdup ("-D")); // This is dangerous the manual says but apparently it works well
result = brasero_job_get_tmp_file (BRASERO_JOB (mkisofs),
@@ -299,7 +299,7 @@
}
result = brasero_track_data_get_paths (BRASERO_TRACK_DATA (track),
- (type.subtype.fs_type & BRASERO_IMAGE_FS_JOLIET) != 0,
+ (image_fs & BRASERO_IMAGE_FS_JOLIET) != 0,
grafts_path,
excluded_path,
emptydir,
Modified: trunk/libbrasero-burn/plugins/cdrtools/burn-readcd.c
==============================================================================
--- trunk/libbrasero-burn/plugins/cdrtools/burn-readcd.c (original)
+++ trunk/libbrasero-burn/plugins/cdrtools/burn-readcd.c Mon Apr 6 12:55:06 2009
@@ -63,19 +63,25 @@
if ((pos = strstr (line, "addr:"))) {
gint sector;
gint64 written;
- BraseroTrackType output;
+ BraseroImageFormat format;
+ BraseroTrackType *output = NULL;
pos += strlen ("addr:");
sector = strtoll (pos, NULL, 10);
- brasero_job_get_output_type (BRASERO_JOB (readcd), &output);
- if (output.subtype.img_format == BRASERO_IMAGE_FORMAT_BIN)
+ output = brasero_track_type_new ();
+ brasero_job_get_output_type (BRASERO_JOB (readcd), output);
+
+ format = brasero_track_type_get_image_format (output);
+ if (format == BRASERO_IMAGE_FORMAT_BIN)
written = (gint64) ((gint64) sector * 2048ULL);
- else if (output.subtype.img_format == BRASERO_IMAGE_FORMAT_CLONE)
+ else if (format == BRASERO_IMAGE_FORMAT_CLONE)
written = (gint64) ((gint64) sector * 2448ULL);
else
written = (gint64) ((gint64) sector * 2048ULL);
+ brasero_track_type_free (output);
+
brasero_job_set_written_track (BRASERO_JOB (readcd), written);
if (sector > 10)
@@ -124,10 +130,12 @@
guint64 nb_blocks;
BraseroTrack *track;
GValue *value = NULL;
- BraseroTrackType output;
+ BraseroTrackType *output = NULL;
brasero_job_get_current_track (BRASERO_JOB (readcd), &track);
- brasero_job_get_output_type (BRASERO_JOB (readcd), &output);
+
+ output = brasero_track_type_new ();
+ brasero_job_get_output_type (BRASERO_JOB (readcd), output);
brasero_track_tag_lookup (track,
BRASERO_TRACK_MEDIUM_ADDRESS_START_TAG,
@@ -181,7 +189,7 @@
start + nb_blocks));
}
/* if it's BIN output just read the last track */
- else if (output.subtype.img_format == BRASERO_IMAGE_FORMAT_BIN) {
+ else if (brasero_track_type_get_image_format (output) == BRASERO_IMAGE_FORMAT_BIN) {
guint64 start;
BraseroDrive *drive;
BraseroMedium *medium;
@@ -207,6 +215,8 @@
g_ptr_array_add (argv, g_strdup_printf ("-sectors=0-%lli", nb_blocks));
}
+ brasero_track_type_free (output);
+
return BRASERO_BURN_OK;
}
@@ -216,15 +226,27 @@
{
guint64 blocks;
GValue *value = NULL;
- BraseroTrackType output;
+ BraseroImageFormat format;
BraseroTrack *track = NULL;
+ BraseroTrackType *output = NULL;
brasero_job_get_current_track (BRASERO_JOB (self), &track);
- brasero_job_get_output_type (BRASERO_JOB (self), &output);
+ output = brasero_track_type_new ();
+ brasero_job_get_output_type (BRASERO_JOB (self), output);
+
+ if (!brasero_track_type_get_has_image (output)) {
+ brasero_track_type_free (output);
+ return BRASERO_BURN_ERR;
+ }
+
+ brasero_track_type_free (output);
+
+ format = brasero_track_type_get_image_format (output);
brasero_track_tag_lookup (track,
BRASERO_TRACK_MEDIUM_ADDRESS_START_TAG,
&value);
+
if (value) {
guint64 start, end;
@@ -251,7 +273,7 @@
NULL,
&blocks);
}
- else if (output.subtype.img_format == BRASERO_IMAGE_FORMAT_BIN) {
+ else if (format == BRASERO_IMAGE_FORMAT_BIN) {
BraseroDrive *drive;
BraseroMedium *medium;
@@ -264,15 +286,12 @@
else
brasero_track_get_size (track, &blocks, NULL);
- if (output.type != BRASERO_TRACK_TYPE_IMAGE)
- return BRASERO_BURN_ERR;
-
- if (output.subtype.img_format == BRASERO_IMAGE_FORMAT_BIN) {
+ if (format == BRASERO_IMAGE_FORMAT_BIN) {
brasero_job_set_output_size_for_current_track (BRASERO_JOB (self),
blocks,
blocks * 2048ULL);
}
- else if (output.subtype.img_format == BRASERO_IMAGE_FORMAT_CLONE) {
+ else if (format == BRASERO_IMAGE_FORMAT_CLONE) {
brasero_job_set_output_size_for_current_track (BRASERO_JOB (self),
blocks,
blocks * 2448ULL);
@@ -290,8 +309,9 @@
GError **error)
{
BraseroBurnResult result = FALSE;
+ BraseroTrackType *output = NULL;
+ BraseroImageFormat format;
BraseroJobAction action;
- BraseroTrackType output;
BraseroReadcd *readcd;
BraseroMedium *medium;
BraseroTrack *track;
@@ -331,10 +351,13 @@
medium = brasero_drive_get_medium (drive);
media = brasero_medium_get_status (medium);
- brasero_job_get_output_type (BRASERO_JOB (readcd), &output);
- if ((media & BRASERO_MEDIUM_DVD)
- && output.subtype.img_format != BRASERO_IMAGE_FORMAT_BIN) {
+ output = brasero_track_type_new ();
+ brasero_job_get_output_type (BRASERO_JOB (readcd), output);
+ format = brasero_track_type_get_image_format (output);
+ brasero_track_type_free (output);
+
+ if ((media & BRASERO_MEDIUM_DVD) && format != BRASERO_IMAGE_FORMAT_BIN) {
g_set_error (error,
BRASERO_BURN_ERROR,
BRASERO_BURN_ERROR_GENERAL,
@@ -342,12 +365,12 @@
return BRASERO_BURN_ERR;
}
- if (output.subtype.img_format == BRASERO_IMAGE_FORMAT_CLONE) {
+ if (format == BRASERO_IMAGE_FORMAT_CLONE) {
/* NOTE: with this option the sector size is 2448
* because it is raw96 (2352+96) otherwise it is 2048 */
g_ptr_array_add (argv, g_strdup ("-clone"));
}
- else if (output.subtype.img_format == BRASERO_IMAGE_FORMAT_BIN) {
+ else if (format == BRASERO_IMAGE_FORMAT_BIN) {
g_ptr_array_add (argv, g_strdup ("-noerror"));
/* don't do it for clone since we need the entire disc */
@@ -361,8 +384,8 @@
if (brasero_job_get_fd_out (BRASERO_JOB (readcd), NULL) != BRASERO_BURN_OK) {
gchar *image;
- if (output.subtype.img_format != BRASERO_IMAGE_FORMAT_CLONE
- && output.subtype.img_format != BRASERO_IMAGE_FORMAT_BIN)
+ if (format != BRASERO_IMAGE_FORMAT_CLONE
+ && format != BRASERO_IMAGE_FORMAT_BIN)
BRASERO_JOB_NOT_SUPPORTED (readcd);
result = brasero_job_get_image_output (BRASERO_JOB (readcd),
@@ -375,7 +398,7 @@
g_ptr_array_add (argv, outfile_arg);
g_free (image);
}
- else if (output.subtype.img_format == BRASERO_IMAGE_FORMAT_BIN) {
+ else if (format == BRASERO_IMAGE_FORMAT_BIN) {
outfile_arg = g_strdup ("-f=-");
g_ptr_array_add (argv, outfile_arg);
}
Modified: trunk/libbrasero-burn/plugins/checksum/burn-checksum-files.c
==============================================================================
--- trunk/libbrasero-burn/plugins/checksum/burn-checksum-files.c (original)
+++ trunk/libbrasero-burn/plugins/checksum/burn-checksum-files.c Mon Apr 6 12:55:06 2009
@@ -1077,10 +1077,9 @@
static gboolean
brasero_checksum_files_end (gpointer data)
{
- BraseroTrackType input;
- BraseroTrackData *track;
- BraseroChecksumFiles *self;
BraseroJobAction action;
+ BraseroChecksumFiles *self;
+ BraseroTrack *current = NULL;
BraseroChecksumFilesPrivate *priv;
BraseroChecksumFilesThreadCtx *ctx;
@@ -1109,21 +1108,17 @@
}
/* we were asked to create a checksum. Its type depends on the input */
- brasero_job_get_input_type (BRASERO_JOB (self), &input);
+ brasero_job_get_current_track (BRASERO_JOB (self), ¤t);
/* let's create a new DATA track with the md5 file created */
- if (input.type == BRASERO_TRACK_TYPE_DATA) {
+ if (BRASERO_IS_TRACK_DATA (current)) {
GSList *grafts;
GSList *excluded;
BraseroGraftPt *graft;
- BraseroTrackType type;
GSList *new_grafts = NULL;
- BraseroTrack *current = NULL;
+ BraseroTrackData *track = NULL;
/* for DATA track we add the file to the track */
- brasero_job_get_current_track (BRASERO_JOB (self), ¤t);
- brasero_track_get_track_type (current, &type);
-
grafts = brasero_track_data_get_grafts (BRASERO_TRACK_DATA (current));
for (; grafts; grafts = grafts->next) {
graft = grafts->data;
@@ -1155,7 +1150,7 @@
excluded = brasero_track_data_get_excluded (BRASERO_TRACK_DATA (current), TRUE);
track = brasero_track_data_new ();
- brasero_track_data_add_fs (track, type.subtype.fs_type);
+ brasero_track_data_add_fs (track, brasero_track_data_get_fs (BRASERO_TRACK_DATA (current)));
brasero_track_data_set_source (track, new_grafts, excluded);
brasero_track_set_checksum (BRASERO_TRACK (track),
priv->checksum_type,
@@ -1204,9 +1199,10 @@
static gpointer
brasero_checksum_files_thread (gpointer data)
{
- BraseroChecksumFiles *self;
GError *error = NULL;
BraseroJobAction action;
+ BraseroChecksumFiles *self;
+ BraseroTrack *current = NULL;
BraseroChecksumFilesPrivate *priv;
BraseroChecksumFilesThreadCtx *ctx;
BraseroBurnResult result = BRASERO_BURN_NOT_SUPPORTED;
@@ -1216,21 +1212,16 @@
/* check DISC types and add checksums for DATA and IMAGE-bin types */
brasero_job_get_action (BRASERO_JOB (self), &action);
+ brasero_job_get_current_track (BRASERO_JOB (self), ¤t);
if (action == BRASERO_JOB_ACTION_CHECKSUM) {
- BraseroTrack *track;
-
- brasero_job_get_current_track (BRASERO_JOB (self), &track);
- priv->checksum_type = brasero_track_get_checksum_type (track);
+ priv->checksum_type = brasero_track_get_checksum_type (current);
if (priv->checksum_type & (BRASERO_CHECKSUM_MD5_FILE|BRASERO_CHECKSUM_SHA1_FILE|BRASERO_CHECKSUM_SHA256_FILE|BRASERO_CHECKSUM_DETECT))
result = brasero_checksum_files_check_files (self, &error);
else
result = BRASERO_BURN_ERR;
}
else if (action == BRASERO_JOB_ACTION_IMAGE) {
- BraseroTrackType type;
-
- brasero_job_get_input_type (BRASERO_JOB (self), &type);
- if (type.type == BRASERO_TRACK_TYPE_DATA)
+ if (BRASERO_IS_TRACK_DATA (current))
result = brasero_checksum_files_create_checksum (self, &error);
else
result = BRASERO_BURN_ERR;
@@ -1297,12 +1288,18 @@
GError **error)
{
GSList *grafts;
- BraseroTrackType output;
BraseroTrack *track = NULL;
+ BraseroTrackType *output = NULL;
+
+ output = brasero_track_type_new ();
+ brasero_job_get_output_type (job, output);
- brasero_job_get_output_type (job, &output);
- if (output.type != BRASERO_TRACK_TYPE_DATA)
+ if (!brasero_track_type_get_has_data (output)) {
+ brasero_track_type_free (output);
return BRASERO_BURN_OK;
+ }
+
+ brasero_track_type_free (output);
/* see that a file with graft "/BRASERO_CHECKSUM_FILE" doesn't already
* exists (possible when doing several copies) or when a simulation
Modified: trunk/libbrasero-burn/plugins/checksum/burn-checksum-image.c
==============================================================================
--- trunk/libbrasero-burn/plugins/checksum/burn-checksum-image.c (original)
+++ trunk/libbrasero-burn/plugins/checksum/burn-checksum-image.c Mon Apr 6 12:55:06 2009
@@ -535,9 +535,10 @@
static gpointer
brasero_checksum_image_thread (gpointer data)
{
- BraseroChecksumImage *self;
GError *error = NULL;
BraseroJobAction action;
+ BraseroTrack *track = NULL;
+ BraseroChecksumImage *self;
BraseroChecksumImagePrivate *priv;
BraseroChecksumImageThreadCtx *ctx;
BraseroBurnResult result = BRASERO_BURN_NOT_SUPPORTED;
@@ -547,11 +548,9 @@
/* check DISC types and add checksums for DATA and IMAGE-bin types */
brasero_job_get_action (BRASERO_JOB (self), &action);
+ brasero_job_get_current_track (BRASERO_JOB (self), &track);
if (action == BRASERO_JOB_ACTION_CHECKSUM) {
- BraseroTrack *track;
-
- brasero_job_get_current_track (BRASERO_JOB (self), &track);
priv->checksum_type = brasero_track_get_checksum_type (track);
if (priv->checksum_type & (BRASERO_CHECKSUM_MD5|BRASERO_CHECKSUM_SHA1|BRASERO_CHECKSUM_SHA256))
result = brasero_checksum_image_create_checksum (self, &error);
@@ -559,10 +558,7 @@
result = BRASERO_BURN_ERR;
}
else if (action == BRASERO_JOB_ACTION_IMAGE) {
- BraseroTrackType type;
-
- brasero_job_get_input_type (BRASERO_JOB (self), &type);
- if (type.type == BRASERO_TRACK_TYPE_IMAGE)
+ if (BRASERO_IS_TRACK_IMAGE (track))
result = brasero_checksum_image_image_and_checksum (self, &error);
else
result = BRASERO_BURN_ERR;
Modified: trunk/libbrasero-burn/plugins/growisofs/burn-growisofs.c
==============================================================================
--- trunk/libbrasero-burn/plugins/growisofs/burn-growisofs.c (original)
+++ trunk/libbrasero-burn/plugins/growisofs/burn-growisofs.c Mon Apr 6 12:55:06 2009
@@ -246,7 +246,7 @@
gchar *grafts_path = NULL;
BraseroJobAction action;
BraseroBurnResult result;
- BraseroTrackType input;
+ BraseroImageFS fs_type;
gchar *emptydir = NULL;
gchar *videodir = NULL;
@@ -262,13 +262,12 @@
g_ptr_array_add (argv, g_strdup ("-r"));
brasero_job_get_current_track (BRASERO_JOB (growisofs), &track);
- brasero_job_get_input_type (BRASERO_JOB (growisofs), &input);
-
- if (input.subtype.fs_type & BRASERO_IMAGE_FS_JOLIET)
+ fs_type = brasero_track_data_get_fs (BRASERO_TRACK_DATA (track));
+ if (fs_type & BRASERO_IMAGE_FS_JOLIET)
g_ptr_array_add (argv, g_strdup ("-J"));
- if ((input.subtype.fs_type & BRASERO_IMAGE_FS_ISO)
- && (input.subtype.fs_type & BRASERO_IMAGE_ISO_FS_LEVEL_3)) {
+ if ((fs_type & BRASERO_IMAGE_FS_ISO)
+ && (fs_type & BRASERO_IMAGE_ISO_FS_LEVEL_3)) {
/* That's the safest option. A few OS don't support that though,
* like MacOSX and freebsd.*/
g_ptr_array_add (argv, g_strdup ("-iso-level"));
@@ -282,10 +281,10 @@
g_ptr_array_add (argv, g_strdup ("-allow-limited-size"));
}
- if (input.subtype.fs_type & BRASERO_IMAGE_FS_UDF)
+ if (fs_type & BRASERO_IMAGE_FS_UDF)
g_ptr_array_add (argv, g_strdup ("-udf"));
- if (input.subtype.fs_type & BRASERO_IMAGE_FS_VIDEO) {
+ if (fs_type & BRASERO_IMAGE_FS_VIDEO) {
g_ptr_array_add (argv, g_strdup ("-dvd-video"));
result = brasero_job_get_tmp_dir (BRASERO_JOB (growisofs),
@@ -302,7 +301,7 @@
g_ptr_array_add (argv, g_strdup ("-graft-points"));
- if (input.subtype.fs_type & BRASERO_IMAGE_ISO_FS_DEEP_DIRECTORY)
+ if (fs_type & BRASERO_IMAGE_ISO_FS_DEEP_DIRECTORY)
g_ptr_array_add (argv, g_strdup ("-D")); // This is dangerous the manual says but apparently it works well
result = brasero_job_get_tmp_file (BRASERO_JOB (growisofs),
@@ -335,7 +334,7 @@
}
result = brasero_track_data_get_paths (BRASERO_TRACK_DATA (track),
- (input.subtype.fs_type & BRASERO_IMAGE_FS_JOLIET) != 0,
+ (fs_type & BRASERO_IMAGE_FS_JOLIET) != 0,
grafts_path,
excluded_path,
emptydir,
@@ -483,14 +482,14 @@
return result;
}
else {
- BraseroTrackType input;
+ BraseroTrack *current = NULL;
/* apparently we are not merging but growisofs will refuse to
* write a piped image if there is one already on the disc;
* except with this option */
g_ptr_array_add (argv, g_strdup ("-use-the-force-luke=tty"));
- brasero_job_get_input_type (BRASERO_JOB (growisofs), &input);
+ brasero_job_get_current_track (BRASERO_JOB (growisofs), ¤t);
if (brasero_job_get_fd_in (BRASERO_JOB (growisofs), NULL) == BRASERO_BURN_OK) {
/* set the buffer. NOTE: apparently this needs to be a power of 2 */
/* FIXME: is it right to mess with it ?
@@ -510,12 +509,10 @@
g_ptr_array_add (argv, g_strdup_printf ("%s=/proc/self/fd/0", device));
g_free (device);
}
- else if (input.type == BRASERO_TRACK_TYPE_IMAGE) {
+ else if (BRASERO_IS_TRACK_IMAGE (current)) {
gchar *localpath;
- BraseroTrack *track;
- brasero_job_get_current_track (BRASERO_JOB (growisofs), &track);
- localpath = brasero_track_image_get_source (BRASERO_TRACK_IMAGE (track), FALSE);
+ localpath = brasero_track_image_get_source (BRASERO_TRACK_IMAGE (current), FALSE);
if (!localpath) {
g_set_error (error,
BRASERO_BURN_ERROR,
@@ -532,7 +529,7 @@
g_free (device);
g_free (localpath);
}
- else if (input.type == BRASERO_TRACK_TYPE_DATA) {
+ else if (BRASERO_IS_TRACK_DATA (current)) {
g_ptr_array_add (argv, g_strdup ("-Z"));
g_ptr_array_add (argv, device);
@@ -620,11 +617,11 @@
brasero_job_get_action (BRASERO_JOB (process), &action);
if (action == BRASERO_JOB_ACTION_SIZE) {
- BraseroTrackType input;
+ BraseroTrack *track = NULL;
/* only do it if that's DATA as input */
- brasero_job_get_input_type (BRASERO_JOB (process), &input);
- if (input.type != BRASERO_TRACK_TYPE_DATA)
+ brasero_job_get_current_track (BRASERO_JOB (process), &track);
+ if (!BRASERO_IS_TRACK_DATA (track))
return BRASERO_BURN_NOT_SUPPORTED;
result = brasero_growisofs_set_argv_record (BRASERO_GROWISOFS (process),
Modified: trunk/libbrasero-burn/plugins/libburnia/burn-libburn.c
==============================================================================
--- trunk/libbrasero-burn/plugins/libburnia/burn-libburn.c (original)
+++ trunk/libbrasero-burn/plugins/libburnia/burn-libburn.c Mon Apr 6 12:55:06 2009
@@ -298,8 +298,8 @@
{
int fd;
guint64 size = 0;
- BraseroTrackType type;
BraseroLibburnPrivate *priv;
+ BraseroTrackType *type = NULL;
BraseroBurnResult result = BRASERO_BURN_OK;
priv = BRASERO_LIBBURN_PRIVATE (self);
@@ -307,60 +307,58 @@
brasero_job_get_fd_in (BRASERO_JOB (self), &fd);
/* need to find out what type of track the imager will output */
- brasero_job_get_input_type (BRASERO_JOB (self), &type);
- switch (type.type) {
- case BRASERO_TRACK_TYPE_IMAGE:
- {
- gint mode;
+ type = brasero_track_type_new ();
+ brasero_job_get_input_type (BRASERO_JOB (self), type);
- /* FIXME: implement other IMAGE types */
- if (type.subtype.img_format == BRASERO_IMAGE_FORMAT_BIN)
- mode = BURN_MODE1;
- else
- mode = BURN_MODE1|BURN_MODE_RAW|BURN_SUBCODE_R96;
+ if (brasero_track_type_get_has_image (type)) {
+ gint mode;
+
+ /* FIXME: implement other IMAGE types */
+ if (brasero_track_type_get_image_format (type) == BRASERO_IMAGE_FORMAT_BIN)
+ mode = BURN_MODE1;
+ else
+ mode = BURN_MODE1|BURN_MODE_RAW|BURN_SUBCODE_R96;
+
+ brasero_track_type_free (type);
- brasero_job_get_session_output_size (BRASERO_JOB (self),
- NULL,
- &size);
+ brasero_job_get_session_output_size (BRASERO_JOB (self),
+ NULL,
+ &size);
+ result = brasero_libburn_add_fd_track (session,
+ fd,
+ mode,
+ size,
+ priv->pvd,
+ error);
+ }
+ else if (brasero_track_type_get_has_stream (type)) {
+ GSList *tracks;
+
+ brasero_track_type_free (type);
+
+ brasero_job_get_tracks (BRASERO_JOB (self), &tracks);
+ for (; tracks; tracks = tracks->next) {
+ BraseroTrack *track;
+
+ track = tracks->data;
+ brasero_track_stream_get_length (BRASERO_TRACK_STREAM (track), &size);
+ size = BRASERO_DURATION_TO_BYTES (size);
+
+ /* we dup the descriptor so the same
+ * will be shared by all tracks */
result = brasero_libburn_add_fd_track (session,
- fd,
- mode,
+ dup (fd),
+ BURN_AUDIO,
size,
- priv->pvd,
+ NULL,
error);
- break;
- }
-
- case BRASERO_TRACK_TYPE_STREAM:
- {
- GSList *tracks;
-
- brasero_job_get_tracks (BRASERO_JOB (self), &tracks);
- for (; tracks; tracks = tracks->next) {
- BraseroTrack *track;
-
- track = tracks->data;
- brasero_track_stream_get_length (BRASERO_TRACK_STREAM (track), &size);
- size = BRASERO_DURATION_TO_BYTES (size);
-
- /* we dup the descriptor so the same
- * will be shared by all tracks */
- result = brasero_libburn_add_fd_track (session,
- dup (fd),
- BURN_AUDIO,
- size,
- NULL,
- error);
- if (result != BRASERO_BURN_OK)
- return result;
- }
- break;
+ if (result != BRASERO_BURN_OK)
+ return result;
}
-
- default:
- BRASERO_JOB_NOT_SUPPORTED (self);
}
+ else
+ BRASERO_JOB_NOT_SUPPORTED (self);
return result;
}
@@ -381,11 +379,9 @@
brasero_job_get_tracks (BRASERO_JOB (self), &tracks);
for (; tracks; tracks = tracks->next) {
BraseroTrack *track;
- BraseroTrackType type;
track = tracks->data;
- brasero_track_get_track_type (track, &type);
- if (type.type == BRASERO_TRACK_TYPE_STREAM) {
+ if (BRASERO_IS_TRACK_STREAM (track)) {
gchar *audiopath;
guint64 size;
@@ -402,16 +398,18 @@
if (result != BRASERO_BURN_OK)
break;
}
- else if (type.type == BRASERO_TRACK_TYPE_IMAGE) {
+ else if (BRASERO_IS_TRACK_IMAGE (track)) {
+ BraseroImageFormat format;
gchar *imagepath;
guint64 size;
gint mode;
- if (type.subtype.img_format == BRASERO_IMAGE_FORMAT_BIN) {
+ format = brasero_track_image_get_format (BRASERO_TRACK_IMAGE (track));
+ if (format == BRASERO_IMAGE_FORMAT_BIN) {
mode = BURN_MODE1;
imagepath = brasero_track_image_get_source (BRASERO_TRACK_IMAGE (track), FALSE);
}
- else if (type.subtype.img_format == BRASERO_IMAGE_FORMAT_NONE) {
+ else if (format == BRASERO_IMAGE_FORMAT_NONE) {
mode = BURN_MODE1;
imagepath = brasero_track_image_get_source (BRASERO_TRACK_IMAGE (track), FALSE);
}
Modified: trunk/libbrasero-burn/plugins/libburnia/burn-libisofs.c
==============================================================================
--- trunk/libbrasero-burn/plugins/libburnia/burn-libisofs.c (original)
+++ trunk/libbrasero-burn/plugins/libburnia/burn-libisofs.c Mon Apr 6 12:55:06 2009
@@ -791,19 +791,19 @@
if (!priv->error && !priv->cancel) {
gint64 size;
- BraseroTrackType type;
+ BraseroImageFS image_fs;
- brasero_track_get_track_type (track, &type);
+ image_fs = brasero_track_data_get_fs (BRASERO_TRACK_DATA (track));
- if ((type.subtype.fs_type & BRASERO_IMAGE_FS_ISO)
- && (type.subtype.fs_type & BRASERO_IMAGE_ISO_FS_LEVEL_3))
+ if ((image_fs & BRASERO_IMAGE_FS_ISO)
+ && (image_fs & BRASERO_IMAGE_ISO_FS_LEVEL_3))
iso_write_opts_set_iso_level (opts, 3);
else
iso_write_opts_set_iso_level (opts, 2);
iso_write_opts_set_rockridge (opts, 1);
- iso_write_opts_set_joliet (opts, (type.subtype.img_format & BRASERO_IMAGE_FS_JOLIET) != 0);
- iso_write_opts_set_allow_deep_paths (opts, (type.subtype.fs_type & BRASERO_IMAGE_ISO_FS_DEEP_DIRECTORY) != 0);
+ iso_write_opts_set_joliet (opts, (image_fs & BRASERO_IMAGE_FS_JOLIET) != 0);
+ iso_write_opts_set_allow_deep_paths (opts, (image_fs & BRASERO_IMAGE_ISO_FS_DEEP_DIRECTORY) != 0);
if (iso_image_create_burn_source (image, opts, &priv->libburn_src) >= 0) {
size = priv->libburn_src->get_size (priv->libburn_src);
Modified: trunk/libbrasero-burn/plugins/local-track/burn-local-image.c
==============================================================================
--- trunk/libbrasero-burn/plugins/local-track/burn-local-image.c (original)
+++ trunk/libbrasero-burn/plugins/local-track/burn-local-image.c Mon Apr 6 12:55:06 2009
@@ -584,7 +584,6 @@
brasero_local_track_update_track (BraseroLocalTrack *self)
{
BraseroTrack *track;
- BraseroTrackType input;
BraseroTrack *current = NULL;
BraseroLocalTrackPrivate *priv;
@@ -592,11 +591,9 @@
/* now we update all the track with the local uris in retval */
brasero_job_get_current_track (BRASERO_JOB (self), ¤t);
- brasero_track_get_track_type (current, &input);
/* make a copy of the tracks instead of modifying them */
- switch (input.type) {
- case BRASERO_TRACK_TYPE_DATA: {
+ if (BRASERO_IS_TRACK_DATA (current)) {
GSList *next;
GSList *grafts;
GSList *unreadable;
@@ -604,7 +601,8 @@
track = BRASERO_TRACK (brasero_track_data_new ());
brasero_track_tag_copy_missing (BRASERO_TRACK (track), current);
- brasero_track_data_add_fs (BRASERO_TRACK_DATA (track), input.subtype.fs_type);
+
+ brasero_track_data_add_fs (BRASERO_TRACK_DATA (track), brasero_track_data_get_fs (BRASERO_TRACK_DATA (current)));
brasero_track_data_get_file_num (BRASERO_TRACK_DATA (current), &file_num);
brasero_track_data_set_file_num (BRASERO_TRACK_DATA (track), file_num);
@@ -641,9 +639,7 @@
unreadable = g_slist_remove (unreadable, unreadable->data);
}
}
- break;
-
- case BRASERO_TRACK_TYPE_STREAM: {
+ else if (BRASERO_IS_TRACK_STREAM (track)) {
gchar *uri;
gchar *newuri;
@@ -653,16 +649,14 @@
track = BRASERO_TRACK (brasero_track_stream_new ());
brasero_track_tag_copy_missing (BRASERO_TRACK (track), current);
brasero_track_stream_set_source (BRASERO_TRACK_STREAM (track), newuri);
- brasero_track_stream_set_format (BRASERO_TRACK_STREAM (track), input.subtype.audio_format);
+ brasero_track_stream_set_format (BRASERO_TRACK_STREAM (track), brasero_track_stream_get_format (BRASERO_TRACK_STREAM (current)));
brasero_track_stream_set_boundaries (BRASERO_TRACK_STREAM (track),
brasero_track_stream_get_start (BRASERO_TRACK_STREAM (current)),
brasero_track_stream_get_end (BRASERO_TRACK_STREAM (current)),
brasero_track_stream_get_gap (BRASERO_TRACK_STREAM (current)));
g_free (uri);
}
- break;
-
- case BRASERO_TRACK_TYPE_IMAGE: {
+ else if (BRASERO_IS_TRACK_IMAGE (track)) {
gchar *uri;
gchar *newtoc;
gchar *newimage;
@@ -683,14 +677,11 @@
brasero_track_image_set_source (BRASERO_TRACK_IMAGE (track),
newimage,
newtoc,
- input.subtype.img_format);
+ brasero_track_image_get_format (BRASERO_TRACK_IMAGE (current)));
brasero_track_image_set_block_num (BRASERO_TRACK_IMAGE (track), blocks);
}
- break;
-
- default:
+ else
BRASERO_JOB_NOT_SUPPORTED (self);
- }
if (priv->download_checksum)
brasero_track_set_checksum (track,
@@ -922,7 +913,6 @@
BraseroBurnResult result;
BraseroJobAction action;
BraseroLocalTrack *self;
- BraseroTrackType input;
BraseroTrack *track;
GSList *grafts;
gchar *uri;
@@ -943,14 +933,12 @@
/* can't be piped so brasero_job_get_current_track will work */
brasero_job_get_current_track (job, &track);
- brasero_job_get_input_type (job, &input);
result = BRASERO_BURN_OK;
/* make a list of all non local uris to be downloaded and put them in a
* list to avoid to download the same file twice. */
- switch (input.type) {
- case BRASERO_TRACK_TYPE_DATA:
+ if (BRASERO_IS_TRACK_DATA (track)) {
/* we put all the non local graft point uris in the hash */
grafts = brasero_track_data_get_grafts (BRASERO_TRACK_DATA (track));
for (; grafts; grafts = grafts->next) {
@@ -961,36 +949,29 @@
if (result != BRASERO_BURN_OK)
break;
}
-
- break;
-
- case BRASERO_TRACK_TYPE_STREAM:
+ }
+ else if (BRASERO_IS_TRACK_STREAM (track)) {
/* NOTE: don't delete URI as they will be inserted in hash */
uri = brasero_track_stream_get_source (BRASERO_TRACK_STREAM (track), TRUE);
result = brasero_local_track_add_if_non_local (self, uri, error);
g_free (uri);
- break;
-
- case BRASERO_TRACK_TYPE_IMAGE:
+ }
+ else if (BRASERO_IS_TRACK_IMAGE (track)) {
/* NOTE: don't delete URI as they will be inserted in hash */
uri = brasero_track_image_get_source (BRASERO_TRACK_IMAGE (track), TRUE);
result = brasero_local_track_add_if_non_local (self, uri, error);
g_free (uri);
- if (result != BRASERO_BURN_OK)
- break;
-
- priv->download_checksum = TRUE;
-
- uri = brasero_track_image_get_toc_source (BRASERO_TRACK_IMAGE (track), TRUE);
- result = brasero_local_track_add_if_non_local (self, uri, error);
- g_free (uri);
+ if (result == BRASERO_BURN_OK) {
+ priv->download_checksum = TRUE;
- break;
-
- default:
- BRASERO_JOB_NOT_SUPPORTED (self);
+ uri = brasero_track_image_get_toc_source (BRASERO_TRACK_IMAGE (track), TRUE);
+ result = brasero_local_track_add_if_non_local (self, uri, error);
+ g_free (uri);
+ }
}
+ else
+ BRASERO_JOB_NOT_SUPPORTED (self);
if (result != BRASERO_BURN_OK)
return result;
Modified: trunk/libbrasero-burn/plugins/local-track/burn-uri.c
==============================================================================
--- trunk/libbrasero-burn/plugins/local-track/burn-uri.c (original)
+++ trunk/libbrasero-burn/plugins/local-track/burn-uri.c Mon Apr 6 12:55:06 2009
@@ -298,7 +298,6 @@
brasero_burn_uri_thread (gpointer data)
{
BraseroBurnURI *self = BRASERO_BURN_URI (data);
- BraseroTrackType type = { 0, };
BraseroTrack *current = NULL;
BraseroBurnURIPrivate *priv;
BraseroTrackData *track;
@@ -314,10 +313,9 @@
TRUE);
brasero_job_get_current_track (BRASERO_JOB (self), ¤t);
- brasero_track_get_track_type (current, &type);
/* This is for IMAGE tracks */
- if (type.type == BRASERO_TRACK_TYPE_IMAGE) {
+ if (BRASERO_IS_TRACK_IMAGE (current)) {
gchar *uri;
gchar *path_toc;
gchar *path_image;
@@ -348,7 +346,7 @@
brasero_track_image_set_source (image,
path_image,
path_toc,
- type.subtype.img_format);
+ brasero_track_image_get_format (BRASERO_TRACK_IMAGE (current)));
brasero_track_image_set_block_num (image, blocks);
priv->track = BRASERO_TRACK (image);
@@ -487,7 +485,7 @@
track = brasero_track_data_new ();
brasero_track_tag_copy_missing (BRASERO_TRACK (track), current);
- brasero_track_data_add_fs (track, type.subtype.fs_type);
+ brasero_track_data_add_fs (track, brasero_track_data_get_fs (BRASERO_TRACK_DATA (current)));
brasero_track_data_get_file_num (BRASERO_TRACK_DATA (current), &num);
brasero_track_data_set_file_num (track, num);
@@ -570,7 +568,6 @@
BraseroBurnResult result;
BraseroJobAction action;
BraseroBurnURI *self;
- BraseroTrackType input;
BraseroTrack *track;
GSList *grafts;
gchar *uri;
@@ -591,14 +588,12 @@
/* can't be piped so brasero_job_get_current_track will work */
brasero_job_get_current_track (job, &track);
- brasero_job_get_input_type (job, &input);
result = BRASERO_BURN_NOT_RUNNING;
/* make a list of all non local uris to be downloaded and put them in a
* list to avoid to download the same file twice. */
- switch (input.type) {
- case BRASERO_TRACK_TYPE_DATA:
+ if (BRASERO_IS_TRACK_DATA (track)) {
/* we put all the non local graft point uris in the hash */
grafts = brasero_track_data_get_grafts (BRASERO_TRACK_DATA (track));
for (; grafts; grafts = grafts->next) {
@@ -609,27 +604,21 @@
if (result != BRASERO_BURN_NOT_RUNNING)
break;
}
-
- break;
-
- case BRASERO_TRACK_TYPE_IMAGE:
+ }
+ else if (BRASERO_IS_TRACK_IMAGE (track)) {
/* NOTE: don't delete URI as they will be inserted in hash */
uri = brasero_track_image_get_source (BRASERO_TRACK_IMAGE (track), TRUE);
result = brasero_burn_uri_start_if_found (self, uri, error);
g_free (uri);
- if (result != BRASERO_BURN_NOT_RUNNING)
- break;
-
- uri = brasero_track_image_get_toc_source (BRASERO_TRACK_IMAGE (track), TRUE);
- result = brasero_burn_uri_start_if_found (self, uri, error);
- g_free (uri);
-
- break;
-
- default:
- BRASERO_JOB_NOT_SUPPORTED (self);
+ if (result == BRASERO_BURN_NOT_RUNNING) {
+ uri = brasero_track_image_get_toc_source (BRASERO_TRACK_IMAGE (track), TRUE);
+ result = brasero_burn_uri_start_if_found (self, uri, error);
+ g_free (uri);
+ }
}
+ else
+ BRASERO_JOB_NOT_SUPPORTED (self);
if (!priv->thread)
BRASERO_JOB_LOG (self, "no burn:// URI found");
Modified: trunk/libbrasero-burn/plugins/transcode/burn-transcode.c
==============================================================================
--- trunk/libbrasero-burn/plugins/transcode/burn-transcode.c (original)
+++ trunk/libbrasero-burn/plugins/transcode/burn-transcode.c Mon Apr 6 12:55:06 2009
@@ -925,7 +925,6 @@
{
guint64 length = 0;
gchar *output = NULL;
- BraseroTrackType type;
BraseroTrack *src = NULL;
BraseroTrackStream *track;
@@ -934,8 +933,6 @@
brasero_track_stream_get_length (BRASERO_TRACK_STREAM (src), &length);
- brasero_job_get_output_type (BRASERO_JOB (transcode), &type);
-
track = brasero_track_stream_new ();
brasero_track_stream_set_source (track, output);
brasero_track_stream_set_format (track,
Modified: trunk/libbrasero-burn/plugins/transcode/burn-vob.c
==============================================================================
--- trunk/libbrasero-burn/plugins/transcode/burn-vob.c (original)
+++ trunk/libbrasero-burn/plugins/transcode/burn-vob.c Mon Apr 6 12:55:06 2009
@@ -89,23 +89,25 @@
static void
brasero_vob_finished (BraseroVob *vob)
{
+ BraseroTrackType *type = NULL;
BraseroTrackStream *track;
BraseroVobPrivate *priv;
- BraseroTrackType type;
gchar *output = NULL;
priv = BRASERO_VOB_PRIVATE (vob);
- memset (&type, 0, sizeof (BraseroTrackType));
- brasero_job_get_output_type (BRASERO_JOB (vob), &type);
+ type = brasero_track_type_new ();
+ brasero_job_get_output_type (BRASERO_JOB (vob), type);
brasero_job_get_audio_output (BRASERO_JOB (vob), &output);
track = brasero_track_stream_new ();
brasero_track_stream_set_source (track, output);
- brasero_track_stream_set_format (track, type.subtype.audio_format);
+ brasero_track_stream_set_format (track, brasero_track_type_get_stream_format (type));
brasero_job_add_track (BRASERO_JOB (vob), BRASERO_TRACK (track));
g_object_unref (track);
+
+ brasero_track_type_free (type);
g_free (output);
brasero_job_finished_track (BRASERO_JOB (vob));
@@ -1069,7 +1071,7 @@
{
BraseroVobPrivate *priv;
BraseroJobAction action;
- BraseroTrackType output;
+ BraseroTrackType *output = NULL;
brasero_job_get_action (job, &action);
if (action != BRASERO_JOB_ACTION_IMAGE)
@@ -1078,9 +1080,10 @@
priv = BRASERO_VOB_PRIVATE (job);
/* get destination medium type */
- memset (&output, 0, sizeof (BraseroTrackType));
- brasero_job_get_output_type (job, &output);
- if (output.subtype.audio_format & BRASERO_VIDEO_FORMAT_VCD) {
+ output = brasero_track_type_new ();
+ brasero_job_get_output_type (job, output);
+
+ if (brasero_track_type_get_stream_format (output) & BRASERO_VIDEO_FORMAT_VCD) {
GValue *value = NULL;
priv->is_video_dvd = FALSE;
@@ -1098,6 +1101,8 @@
priv->is_video_dvd,
priv->svcd);
+ brasero_track_type_free (output);
+
if (!brasero_vob_build_pipeline (BRASERO_VOB (job), error))
return BRASERO_BURN_ERR;
Modified: trunk/src/brasero-blank-dialog.h
==============================================================================
--- trunk/src/brasero-blank-dialog.h (original)
+++ trunk/src/brasero-blank-dialog.h Mon Apr 6 12:55:06 2009
@@ -52,6 +52,7 @@
} BraseroBlankDialogClass;
GType brasero_blank_dialog_get_type ();
+
GtkWidget *brasero_blank_dialog_new ();
G_END_DECLS
Modified: trunk/src/brasero-data-session.c
==============================================================================
--- trunk/src/brasero-data-session.c (original)
+++ trunk/src/brasero-data-session.c Mon Apr 6 12:55:06 2009
@@ -35,6 +35,8 @@
#include "brasero-medium.h"
#include "brasero-medium-monitor.h"
+#include "brasero-burn-lib.h"
+
#include "brasero-data-session.h"
#include "brasero-data-project.h"
#include "brasero-file-node.h"
Modified: trunk/src/brasero-sum-dialog.c
==============================================================================
--- trunk/src/brasero-sum-dialog.c (original)
+++ trunk/src/brasero-sum-dialog.c Mon Apr 6 12:55:06 2009
@@ -42,9 +42,10 @@
#include "brasero-sum-dialog.h"
#include "brasero-tool-dialog.h"
-#include "brasero-xfer.h"
+
#include "brasero-misc.h"
+#include "brasero-xfer.h"
#include "brasero-drive.h"
#include "brasero-medium.h"
Modified: trunk/src/brasero-sum-dialog.h
==============================================================================
--- trunk/src/brasero-sum-dialog.h (original)
+++ trunk/src/brasero-sum-dialog.h Mon Apr 6 12:55:06 2009
@@ -57,6 +57,7 @@
};
GType brasero_sum_dialog_get_type ();
+
GtkWidget *brasero_sum_dialog_new ();
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]