brasero r2172 - in trunk: . libbrasero-burn libbrasero-burn/plugins/cdrdao libbrasero-burn/plugins/cdrkit libbrasero-burn/plugins/cdrtools libbrasero-burn/plugins/checksum libbrasero-burn/plugins/dvdauthor libbrasero-burn/plugins/dvdcss libbrasero-burn/plugins/growisofs libbrasero-burn/plugins/libburnia libbrasero-burn/plugins/local-track libbrasero-burn/plugins/transcode libbrasero-burn/plugins/vcdimager libbrasero-media src
- From: philippr svn gnome org
- To: svn-commits-list gnome org
- Subject: brasero r2172 - in trunk: . libbrasero-burn libbrasero-burn/plugins/cdrdao libbrasero-burn/plugins/cdrkit libbrasero-burn/plugins/cdrtools libbrasero-burn/plugins/checksum libbrasero-burn/plugins/dvdauthor libbrasero-burn/plugins/dvdcss libbrasero-burn/plugins/growisofs libbrasero-burn/plugins/libburnia libbrasero-burn/plugins/local-track libbrasero-burn/plugins/transcode libbrasero-burn/plugins/vcdimager libbrasero-media src
- Date: Sat, 28 Mar 2009 08:14:59 +0000 (UTC)
Author: philippr
Date: Sat Mar 28 08:14:58 2009
New Revision: 2172
URL: http://svn.gnome.org/viewvc/brasero?rev=2172&view=rev
Log:
2009-03-28 Philippe Rouquier <bonfire-app wanadoo fr>
Second patch to carry on splitting backend and app
Status:
No more undefined symbol in library (so basically should be usable now
Quick tests showed there are no outstanding bugs introduced
Now library API needs to be refined
* libbrasero-burn/Makefile.am:
* libbrasero-burn/brasero-burn-dialog.c
(brasero_burn_dialog_update_info),
(brasero_burn_dialog_success_run),
(brasero_burn_dialog_notify_success),
(brasero_burn_dialog_add_track_to_recent):
* libbrasero-burn/brasero-burn-options.c
(brasero_burn_options_init), (brasero_burn_options_build_contents),
(brasero_burn_options_set_property),
(brasero_burn_options_get_property),
(brasero_burn_options_class_init), (brasero_burn_options_new):
* libbrasero-burn/brasero-burn-options.h:
* libbrasero-burn/brasero-burn.c (brasero_burn_lock_dest_media),
(brasero_burn_status), (brasero_burn_ask_for_joliet),
(brasero_burn_run_tasks), (brasero_burn_check_real),
(brasero_burn_record_session), (brasero_burn_check),
(brasero_burn_same_src_dest_image):
* libbrasero-burn/brasero-cover.c
(brasero_jacket_edit_set_audio_tracks_back),
(brasero_session_edit_cover):
* libbrasero-burn/brasero-dest-selection.c
(brasero_dest_selection_set_property),
(brasero_dest_selection_get_property),
(brasero_dest_selection_format_medium_string):
* libbrasero-burn/brasero-disc-copy-dialog.c
(brasero_disc_copy_dialog_set_session),
(brasero_disc_copy_dialog_init):
* libbrasero-burn/brasero-disc-copy-dialog.h:
* 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_valid_media_cb),
(brasero_disc_option_dialog_set_session),
(brasero_disc_option_dialog_init),
(brasero_disc_option_dialog_finalize):
* libbrasero-burn/brasero-disc-option-dialog.h:
* libbrasero-burn/brasero-enums.h:
* libbrasero-burn/brasero-image-option-dialog.c
(brasero_image_option_dialog_set_session),
(brasero_image_option_dialog_init):
* libbrasero-burn/brasero-image-option-dialog.h:
* libbrasero-burn/brasero-session-cfg.c
(brasero_session_cfg_get_gconf_key),
(brasero_session_cfg_check_size),
(brasero_session_cfg_set_tracks_audio_format),
(brasero_session_cfg_update):
* libbrasero-burn/brasero-session.c
(brasero_burn_session_track_changed),
(brasero_burn_session_start_track_monitoring),
(brasero_burn_session_stop_tracks_monitoring),
(brasero_burn_session_free_tracks),
(brasero_burn_session_add_track),
(brasero_burn_session_get_input_type),
(brasero_burn_session_push_tracks),
(brasero_burn_session_pop_tracks),
(brasero_burn_session_get_src_medium),
(brasero_burn_session_get_src_drive),
(brasero_burn_session_same_src_dest_drive),
(brasero_burn_session_track_list_free),
(brasero_burn_session_finalize):
* libbrasero-burn/brasero-session.h:
* libbrasero-burn/brasero-src-image.c (brasero_src_image_save),
(brasero_src_image_update), (brasero_src_image_set_track),
(brasero_src_image_check_parent_directory_cb),
(brasero_src_image_get_info_cb), (brasero_src_image_get_format),
(brasero_src_image_changed), (brasero_src_image_clicked),
(brasero_src_image_set_parent_directory), (brasero_src_image_init),
(brasero_src_image_finalize), (_get_session_image_track),
(brasero_src_image_set_property):
* libbrasero-burn/brasero-src-image.h:
* libbrasero-burn/brasero-src-selection.c
(brasero_src_selection_medium_changed),
(brasero_src_selection_finalize), (_get_session_disc_track),
(brasero_src_selection_set_property):
* libbrasero-burn/brasero-track.c (brasero_track_type_equal),
(brasero_track_type_match), (brasero_track_get_track_type),
(brasero_track_get_size), (brasero_track_set_checksum),
(brasero_track_get_checksum), (brasero_track_get_checksum_type),
(brasero_track_tag_add), (brasero_track_tag_lookup),
(brasero_track_changed), (brasero_track_init),
(brasero_track_finalize), (brasero_track_class_init):
* libbrasero-burn/brasero-track.h:
* libbrasero-burn/burn-basics.c (brasero_string_get_localpath),
(brasero_string_get_uri), (brasero_burn_library_start):
* libbrasero-burn/burn-basics.h:
* libbrasero-burn/burn-caps.c (brasero_caps_is_compatible_type),
(brasero_burn_caps_new_checksuming_task),
(brasero_burn_caps_get_default_output_format),
(brasero_caps_get_flags_for_disc), (brasero_burn_caps_sort),
(brasero_caps_audio_new), (brasero_plugin_can_image),
(brasero_plugin_can_convert):
* libbrasero-burn/burn-debug.c
(brasero_debug_audio_format_to_string),
(brasero_burn_debug_track_type_message):
* libbrasero-burn/burn-image-format.c
(brasero_image_format_get_cdrdao_size),
(brasero_image_format_get_cue_size),
(brasero_image_format_get_iso_size),
(brasero_image_format_get_clone_size):
* libbrasero-burn/burn-image-format.h:
* libbrasero-burn/burn-job.c (brasero_job_check_output_disc_space),
(brasero_job_set_output_file),
(brasero_job_get_last_session_address),
(brasero_job_get_next_writable_address),
(brasero_job_get_session_output_size):
* libbrasero-burn/burn-job.h:
* libbrasero-burn/burn-plugin.h:
* libbrasero-burn/burn-process.c (brasero_process_finished):
* libbrasero-burn/burn-task-ctx.c (brasero_task_ctx_reset),
(brasero_task_ctx_add_track), (brasero_task_ctx_set_next_track),
(brasero_task_ctx_finished),
(brasero_task_ctx_get_session_output_size),
(brasero_task_ctx_get_progress), (brasero_task_ctx_finalize):
* libbrasero-burn/burn-task-ctx.h:
* libbrasero-burn/burn-task.c
(brasero_task_set_track_output_size_default):
* libbrasero-burn/libbrasero-marshal.list:
* libbrasero-burn/plugins/cdrdao/burn-cdrdao.c
(brasero_cdrdao_read_stderr_record),
(brasero_cdrdao_set_argv_record), (brasero_cdrdao_set_argv_image),
(brasero_cdrdao_set_argv):
* libbrasero-burn/plugins/cdrdao/burn-toc2cue.c
(brasero_toc2cue_read_stderr), (brasero_toc2cue_set_argv):
* libbrasero-burn/plugins/cdrkit/burn-genisoimage.c
(brasero_genisoimage_set_argv_image):
* libbrasero-burn/plugins/cdrkit/burn-readom.c
(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_write_inf),
(brasero_wodim_write_infs), (brasero_wodim_set_argv_record):
* libbrasero-burn/plugins/cdrtools/burn-cdrecord.c
(brasero_cdrecord_stdout_read), (brasero_cdrecord_write_inf),
(brasero_cdrecord_write_infs), (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_argv_set_iso_boundary), (brasero_readcd_get_size),
(brasero_readcd_set_argv):
* libbrasero-burn/plugins/checksum/burn-checksum-files.c
(brasero_checksum_file_process_former_line),
(brasero_checksum_files_merge_with_former_session),
(brasero_checksum_files_create_checksum),
(brasero_checksum_files_check_files), (brasero_checksum_files_end),
(brasero_checksum_files_activate):
* libbrasero-burn/plugins/checksum/burn-checksum-image.c
(brasero_checksum_image_checksum_file_input),
(brasero_checksum_image_create_checksum),
(brasero_checksum_image_image_and_checksum):
* libbrasero-burn/plugins/dvdauthor/burn-dvdauthor.c
(brasero_dvd_author_add_track),
(brasero_dvd_author_generate_xml_file):
* libbrasero-burn/plugins/dvdcss/burn-dvdcss.c
(brasero_dvdcss_thread_finished),
(brasero_dvdcss_write_image_thread), (brasero_dvdcss_start):
* libbrasero-burn/plugins/growisofs/burn-growisofs.c
(brasero_growisofs_set_mkisofs_argv),
(brasero_growisofs_set_argv_record):
* libbrasero-burn/plugins/libburnia/burn-libburn.c
(brasero_libburn_setup_session_fd),
(brasero_libburn_setup_session_file),
(brasero_libburn_start_record):
* libbrasero-burn/plugins/libburnia/burn-libisofs.c
(brasero_libisofs_thread_finished),
(brasero_libisofs_import_last_session),
(brasero_libisofs_create_volume_thread):
* libbrasero-burn/plugins/local-track/burn-local-image.c
(brasero_local_track_read_checksum),
(brasero_local_track_download_checksum),
(brasero_local_track_update_track), (brasero_local_track_start):
* libbrasero-burn/plugins/local-track/burn-uri.c
(brasero_burn_uri_explore_directory), (brasero_burn_uri_thread),
(brasero_burn_uri_start):
* libbrasero-burn/plugins/transcode/burn-normalize.c
(brasero_normalize_set_next_track):
* libbrasero-burn/plugins/transcode/burn-transcode.c
(brasero_transcode_set_boundaries),
(brasero_transcode_create_pipeline),
(brasero_transcode_set_track_size),
(brasero_transcode_create_sibling_size),
(brasero_transcode_create_sibling_image),
(brasero_transcode_search_for_sibling), (brasero_transcode_start),
(brasero_transcode_push_track), (brasero_transcode_pad),
(foreach_tag), (brasero_transcode_active_state):
* libbrasero-burn/plugins/transcode/burn-vob.c
(brasero_vob_finished), (brasero_vob_build_pipeline):
* libbrasero-burn/plugins/vcdimager/burn-vcdimager.c
(brasero_vcd_imager_generate_xml_file):
* libbrasero-media/brasero-medium.c
(brasero_medium_get_last_data_track_address),
(brasero_medium_get_last_data_track_space),
(brasero_medium_get_track_space),
(brasero_medium_get_track_address):
* libbrasero-media/brasero-medium.h:
* src/brasero-app.c (brasero_app_burn_options),
(brasero_app_burn_image), (brasero_app_copy_disc):
* src/brasero-app.h:
* src/brasero-audio-disc.c (brasero_audio_disc_iface_disc_init),
(brasero_audio_disc_set_row_from_metadata),
(brasero_audio_disc_add_uri_real), (brasero_audio_disc_remove),
(brasero_audio_disc_get_track),
(brasero_audio_disc_set_session_contents),
(brasero_audio_disc_add_track), (brasero_audio_disc_load_track),
(brasero_audio_disc_add_slices),
(brasero_audio_disc_edit_single_song_properties),
(brasero_audio_disc_inotify_remove_all),
(brasero_audio_disc_inotify_remove):
* src/brasero-data-disc.c (brasero_data_disc_set_session_contents),
(brasero_data_disc_iface_disc_init):
* src/brasero-data-project.c:
* src/brasero-data-session.c
(brasero_data_session_load_directory_contents_real):
* src/brasero-disc.c:
* src/brasero-disc.h:
* src/brasero-project-parse.c (brasero_track_clear_song),
(_read_audio_track):
* src/brasero-project-parse.h:
* src/brasero-project.c (brasero_project_burn),
(brasero_project_create_audio_cover), (_save_audio_track_xml),
(brasero_project_save_audio_project_plain_text),
(brasero_project_save_audio_project_playlist):
* src/brasero-song-properties.c (brasero_song_props_update_length),
(brasero_song_props_gap_changed_cb):
* src/brasero-split-dialog.c (brasero_split_dialog_set_boundaries),
(brasero_split_dialog_cut), (brasero_split_dialog_remove_range),
(brasero_split_dialog_cut_clicked_cb):
* src/brasero-sum-dialog.c (brasero_sum_dialog_get_disc_checksum),
(brasero_sum_dialog_check_disc_sum):
* src/brasero-utils.c (brasero_error_quark), (brasero_utils_init),
(brasero_utils_launch_app):
* src/brasero-utils.h:
* src/brasero-video-disc.c
(brasero_video_disc_set_session_contents),
(brasero_video_disc_get_track),
(brasero_video_disc_iface_disc_init):
* src/brasero-video-project.c (brasero_video_file_free),
(brasero_video_project_set_file_information),
(brasero_video_project_add_uri),
(brasero_video_project_get_contents),
(brasero_video_project_finalize):
* src/brasero-video-project.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-options.h
trunk/libbrasero-burn/brasero-burn.c
trunk/libbrasero-burn/brasero-cover.c
trunk/libbrasero-burn/brasero-dest-selection.c
trunk/libbrasero-burn/brasero-disc-copy-dialog.c
trunk/libbrasero-burn/brasero-disc-copy-dialog.h
trunk/libbrasero-burn/brasero-disc-option-dialog.c
trunk/libbrasero-burn/brasero-disc-option-dialog.h
trunk/libbrasero-burn/brasero-enums.h
trunk/libbrasero-burn/brasero-image-option-dialog.c
trunk/libbrasero-burn/brasero-image-option-dialog.h
trunk/libbrasero-burn/brasero-session-cfg.c
trunk/libbrasero-burn/brasero-session.c
trunk/libbrasero-burn/brasero-session.h
trunk/libbrasero-burn/brasero-src-image.c
trunk/libbrasero-burn/brasero-src-image.h
trunk/libbrasero-burn/brasero-src-selection.c
trunk/libbrasero-burn/brasero-track.c
trunk/libbrasero-burn/brasero-track.h
trunk/libbrasero-burn/burn-basics.c
trunk/libbrasero-burn/burn-basics.h
trunk/libbrasero-burn/burn-caps.c
trunk/libbrasero-burn/burn-debug.c
trunk/libbrasero-burn/burn-image-format.c
trunk/libbrasero-burn/burn-image-format.h
trunk/libbrasero-burn/burn-job.c
trunk/libbrasero-burn/burn-job.h
trunk/libbrasero-burn/burn-plugin.h
trunk/libbrasero-burn/burn-process.c
trunk/libbrasero-burn/burn-task-ctx.c
trunk/libbrasero-burn/burn-task-ctx.h
trunk/libbrasero-burn/burn-task.c
trunk/libbrasero-burn/libbrasero-marshal.list
trunk/libbrasero-burn/plugins/cdrdao/burn-cdrdao.c
trunk/libbrasero-burn/plugins/cdrdao/burn-toc2cue.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/dvdauthor/burn-dvdauthor.c
trunk/libbrasero-burn/plugins/dvdcss/burn-dvdcss.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-normalize.c
trunk/libbrasero-burn/plugins/transcode/burn-transcode.c
trunk/libbrasero-burn/plugins/transcode/burn-vob.c
trunk/libbrasero-burn/plugins/vcdimager/burn-vcdimager.c
trunk/libbrasero-media/brasero-medium.c
trunk/libbrasero-media/brasero-medium.h
trunk/src/brasero-app.c
trunk/src/brasero-app.h
trunk/src/brasero-audio-disc.c
trunk/src/brasero-data-disc.c
trunk/src/brasero-data-project.c
trunk/src/brasero-data-session.c
trunk/src/brasero-disc.c
trunk/src/brasero-disc.h
trunk/src/brasero-project-parse.c
trunk/src/brasero-project-parse.h
trunk/src/brasero-project.c
trunk/src/brasero-song-properties.c
trunk/src/brasero-split-dialog.c
trunk/src/brasero-sum-dialog.c
trunk/src/brasero-video-disc.c
trunk/src/brasero-video-project.c
trunk/src/brasero-video-project.h
Modified: trunk/libbrasero-burn/Makefile.am
==============================================================================
--- trunk/libbrasero-burn/Makefile.am (original)
+++ trunk/libbrasero-burn/Makefile.am Sat Mar 28 08:14:58 2009
@@ -2,7 +2,6 @@
INCLUDES = \
-I$(top_srcdir) \
- -I$(top_srcdir)/src/ \
-I$(top_builddir) \
-I$(top_srcdir)/libbrasero-utils/ \
-I$(top_builddir)/libbrasero-utils/ \
@@ -126,7 +125,15 @@
brasero-enums.h \
brasero-tags.h \
brasero-cover.c \
- brasero-cover.h
+ brasero-cover.h \
+ brasero-track-disc.c \
+ brasero-track-disc.h \
+ brasero-track-stream.c \
+ brasero-track-stream.h \
+ brasero-track-image.c \
+ brasero-track-image.h \
+ brasero-track-data.c \
+ brasero-track-data.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 Sat Mar 28 08:14:58 2009
@@ -50,11 +50,14 @@
#include "burn-basics.h"
#include "burn-debug.h"
+#include "brasero-progress.h"
+#include "brasero-cover.h"
#include "brasero-tags.h"
#include "brasero-session.h"
+#include "brasero-track-image.h"
+
#include "brasero-medium.h"
-#include "brasero-progress.h"
#include "brasero-drive.h"
#include "brasero-misc.h"
@@ -168,7 +171,7 @@
title = g_strdup (_("Brasero - Creating Image"));
}
else if (media & BRASERO_MEDIUM_DVD) {
- if (BRASERO_TRACK_TYPE_HAS_VIDEO (input)) {
+ if (BRASERO_STREAM_TRACK_HAS_VIDEO (input)) {
if (flags & BRASERO_BURN_FLAG_DUMMY) {
title = g_strdup (_("Brasero - Burning DVD (Simulation)"));
header = g_strdup_printf ("<big><b>%s</b></big>", _("Simulation of video DVD burning"));
@@ -226,7 +229,7 @@
}
}
else if (media & BRASERO_MEDIUM_CD) {
- if (BRASERO_TRACK_TYPE_HAS_VIDEO (input)) {
+ if (BRASERO_STREAM_TRACK_HAS_VIDEO (input)) {
if (flags & BRASERO_BURN_FLAG_DUMMY) {
title = g_strdup (_("Brasero - Burning CD (Simulation)"));
header = g_strdup_printf ("<big><b>%s</b></big>", _("Simulation of (S)VCD burning"));
@@ -240,7 +243,7 @@
"drive-removable-media",
GTK_ICON_SIZE_DIALOG);
}
- else if (input->type == BRASERO_TRACK_TYPE_AUDIO) {
+ else if (input->type == BRASERO_TRACK_TYPE_STREAM) {
if (flags & BRASERO_BURN_FLAG_DUMMY) {
title = g_strdup (_("Brasero - Burning CD (Simulation)"));
header = g_strdup_printf ("<big><b>%s</b></big>", _("Simulation of audio CD burning"));
@@ -297,7 +300,7 @@
GTK_ICON_SIZE_DIALOG);
}
}
- else if (BRASERO_TRACK_TYPE_HAS_VIDEO (input)) {
+ else if (BRASERO_STREAM_TRACK_HAS_VIDEO (input)) {
if (flags & BRASERO_BURN_FLAG_DUMMY) {
title = g_strdup (_("Brasero - Burning disc (Simulation)"));
header = g_strdup_printf ("<big><b>%s</b></big>", _("Simulation of video disc burning"));
@@ -311,7 +314,7 @@
"drive-removable-media",
GTK_ICON_SIZE_DIALOG);
}
- else if (input->type == BRASERO_TRACK_TYPE_AUDIO) {
+ else if (input->type == BRASERO_TRACK_TYPE_STREAM) {
if (flags & BRASERO_BURN_FLAG_DUMMY) {
title = g_strdup (_("Brasero - Burning CD (Simulation)"));
header = g_strdup_printf ("<big><b>%s</b></big>", _("Simulation of audio CD burning"));
@@ -1750,7 +1753,7 @@
if (answer == GTK_RESPONSE_CLOSE) {
GtkWidget *window;
- window = brasero_session_edit_cover (dialog->priv->session);
+ window = brasero_session_edit_cover (dialog->priv->session, GTK_WIDGET (dialog));
gtk_dialog_run (GTK_DIALOG (window));
gtk_widget_destroy (window);
return FALSE;
@@ -1776,7 +1779,7 @@
media = dialog->priv->input.subtype.media;
switch (dialog->priv->input.type) {
- case BRASERO_TRACK_TYPE_AUDIO:
+ case BRASERO_TRACK_TYPE_STREAM:
primary = g_strdup (_("Audio CD successfully burnt"));
break;
case BRASERO_TRACK_TYPE_DISC:
@@ -1842,7 +1845,7 @@
media,
dialog->priv->total_size);
- if (dialog->priv->input.type == BRASERO_TRACK_TYPE_AUDIO
+ if (dialog->priv->input.type == BRASERO_TRACK_TYPE_STREAM
|| (dialog->priv->input.type == BRASERO_TRACK_TYPE_DISC
&& (dialog->priv->input.subtype.media & BRASERO_MEDIUM_HAS_AUDIO))) {
/* since we succeed offer the possibility to create cover if that's an audio disc */
@@ -1879,7 +1882,7 @@
groups,
FALSE };
- brasero_track_get_type (track, &type);
+ brasero_track_get_track_type (track, &type);
if (type.type != BRASERO_TRACK_TYPE_IMAGE
|| type.subtype.img_format == BRASERO_IMAGE_FORMAT_NONE)
return;
@@ -1888,22 +1891,22 @@
switch (type.subtype.img_format) {
case BRASERO_IMAGE_FORMAT_BIN:
recent_data.mime_type = mimes [0];
- uri = brasero_track_get_image_source (track, TRUE);
+ uri = brasero_track_image_get_source (BRASERO_TRACK_IMAGE (track), TRUE);
break;
case BRASERO_IMAGE_FORMAT_CUE:
recent_data.mime_type = mimes [1];
- uri = brasero_track_get_toc_source (track, TRUE);
+ uri = brasero_track_image_get_toc_source (BRASERO_TRACK_IMAGE (track), TRUE);
break;
case BRASERO_IMAGE_FORMAT_CLONE:
recent_data.mime_type = mimes [2];
- uri = brasero_track_get_toc_source (track, TRUE);
+ uri = brasero_track_image_get_toc_source (BRASERO_TRACK_IMAGE (track), TRUE);
break;
case BRASERO_IMAGE_FORMAT_CDRDAO:
recent_data.mime_type = mimes [3];
- uri = brasero_track_get_toc_source (track, TRUE);
+ uri = brasero_track_image_get_toc_source (BRASERO_TRACK_IMAGE (track), TRUE);
break;
default:
Modified: trunk/libbrasero-burn/brasero-burn-options.c
==============================================================================
--- trunk/libbrasero-burn/brasero-burn-options.c (original)
+++ trunk/libbrasero-burn/brasero-burn-options.c Sat Mar 28 08:14:58 2009
@@ -46,6 +46,9 @@
#include "brasero-session.h"
#include "brasero-burn-options.h"
+#include "brasero-disc-copy-dialog.h"
+#include "brasero-image-option-dialog.h"
+#include "brasero-disc-option-dialog.h"
#include "brasero-session-cfg.h"
#include "brasero-dest-selection.h"
#include "brasero-medium-properties.h"
@@ -75,6 +78,11 @@
#define BRASERO_BURN_OPTIONS_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), BRASERO_TYPE_BURN_OPTIONS, BraseroBurnOptionsPrivate))
+enum {
+ PROP_0,
+ PROP_SESSION
+};
+
G_DEFINE_TYPE (BraseroBurnOptions, brasero_burn_options, GTK_TYPE_DIALOG);
void
@@ -377,6 +385,16 @@
static void
brasero_burn_options_init (BraseroBurnOptions *object)
{
+ gtk_dialog_set_has_separator (GTK_DIALOG (object), FALSE);
+}
+
+/**
+ * To build anything we need to have the session set first
+ */
+
+static void
+brasero_burn_options_build_contents (BraseroBurnOptions *object)
+{
BraseroBurnOptionsPrivate *priv;
GtkWidget *selection;
GtkWidget *alignment;
@@ -386,10 +404,7 @@
priv->size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
- gtk_dialog_set_has_separator (GTK_DIALOG (object), FALSE);
-
- /* Create the session */
- priv->session = brasero_session_cfg_new ();
+ /* Sets default flags for the session */
brasero_burn_session_add_flag (BRASERO_BURN_SESSION (priv->session),
BRASERO_BURN_FLAG_NOGRACE|
BRASERO_BURN_FLAG_CHECK_SIZE);
@@ -498,6 +513,57 @@
}
static void
+brasero_burn_options_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ BraseroBurnOptionsPrivate *priv;
+
+ g_return_if_fail (BRASERO_IS_BURN_OPTIONS (object));
+
+ priv = BRASERO_BURN_OPTIONS_PRIVATE (object);
+
+ switch (prop_id)
+ {
+ case PROP_SESSION: /* Readable and only writable at creation time */
+ priv->session = BRASERO_SESSION_CFG (g_value_get_object (value));
+ g_object_ref (priv->session);
+ brasero_burn_options_build_contents (BRASERO_BURN_OPTIONS (object));
+
+ g_object_notify (object, "session");
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+brasero_burn_options_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ BraseroBurnOptionsPrivate *priv;
+
+ g_return_if_fail (BRASERO_IS_BURN_OPTIONS (object));
+
+ priv = BRASERO_BURN_OPTIONS_PRIVATE (object);
+
+ switch (prop_id)
+ {
+ case PROP_SESSION:
+ g_value_set_object (value, priv->session);
+ g_object_ref (priv->session);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+static void
brasero_burn_options_class_init (BraseroBurnOptionsClass *klass)
{
GObjectClass* object_class = G_OBJECT_CLASS (klass);
@@ -505,6 +571,45 @@
g_type_class_add_private (klass, sizeof (BraseroBurnOptionsPrivate));
object_class->finalize = brasero_burn_options_finalize;
+ object_class->set_property = brasero_burn_options_set_property;
+ object_class->get_property = brasero_burn_options_get_property;
+
+ g_object_class_install_property (object_class,
+ PROP_SESSION,
+ g_param_spec_object ("session",
+ "The session",
+ "The session to work with",
+ BRASERO_TYPE_BURN_SESSION,
+ G_PARAM_READWRITE|G_PARAM_CONSTRUCT_ONLY));
}
+GtkWidget *
+brasero_burn_options_new (BraseroSessionCfg *session)
+{
+ BraseroTrackType type = { 0, };
+ 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;
+ }
+ return options;
+}
Modified: trunk/libbrasero-burn/brasero-burn-options.h
==============================================================================
--- trunk/libbrasero-burn/brasero-burn-options.h (original)
+++ trunk/libbrasero-burn/brasero-burn-options.h Sat Mar 28 08:14:58 2009
@@ -36,6 +36,7 @@
#include <gtk/gtk.h>
#include "brasero-medium-monitor.h"
+#include "brasero-session-cfg.h"
G_BEGIN_DECLS
@@ -61,6 +62,9 @@
GType brasero_burn_options_get_type (void) G_GNUC_CONST;
+GtkWidget *
+brasero_burn_options_new (BraseroSessionCfg *session);
+
BraseroBurnSession *
brasero_burn_options_get_session (BraseroBurnOptions *self);
Modified: trunk/libbrasero-burn/brasero-burn.c
==============================================================================
--- trunk/libbrasero-burn/brasero-burn.c (original)
+++ trunk/libbrasero-burn/brasero-burn.c Sat Mar 28 08:14:58 2009
@@ -45,18 +45,24 @@
#include <glib/gi18n-lib.h>
#include <glib/gstdio.h>
-#include "brasero-marshal.h"
+#include "brasero-burn.h"
+
+#include "libbrasero-marshal.h"
#include "burn-basics.h"
#include "burn-debug.h"
-#include "brasero-track.h"
-#include "brasero-session.h"
-#include "brasero-burn.h"
+#include "burn-dbus.h"
#include "burn-task-ctx.h"
#include "burn-task.h"
#include "burn-caps.h"
+
#include "brasero-volume.h"
#include "brasero-drive.h"
-#include "burn-dbus.h"
+
+#include "brasero-tags.h"
+#include "brasero-track.h"
+#include "brasero-session.h"
+#include "brasero-track-image.h"
+#include "brasero-track-disc.h"
G_DEFINE_TYPE (BraseroBurn, brasero_burn, G_TYPE_OBJECT);
@@ -870,7 +876,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_AUDIO) {
+ if (input.type == BRASERO_TRACK_TYPE_STREAM) {
/* 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
@@ -905,7 +911,7 @@
/* 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_AUDIO
+ if (input.type == BRASERO_TRACK_TYPE_STREAM
&& !(input.subtype.audio_format & (BRASERO_VIDEO_FORMAT_UNDEFINED|
BRASERO_VIDEO_FORMAT_VCD|
BRASERO_VIDEO_FORMAT_VIDEO_DVD))) {
@@ -1208,6 +1214,7 @@
gint64 *rate)
{
BraseroBurnPrivate *priv;
+ BraseroBurnResult result;
g_return_val_if_fail (BRASERO_BURN (burn), BRASERO_BURN_ERR);
@@ -1216,10 +1223,17 @@
if (!priv->task)
return BRASERO_BURN_NOT_READY;
- if (isosize)
- brasero_task_ctx_get_session_output_size (BRASERO_TASK_CTX (priv->task),
- NULL,
- isosize);
+ if (isosize) {
+ guint64 size_local = 0;
+
+ result = brasero_task_ctx_get_session_output_size (BRASERO_TASK_CTX (priv->task),
+ NULL,
+ &size_local);
+ if (result != BRASERO_BURN_OK)
+ *isosize = -1;
+ else
+ *isosize = size_local;
+ }
if (!brasero_task_is_running (priv->task))
return BRASERO_BURN_NOT_READY;
@@ -1227,8 +1241,16 @@
if (rate)
brasero_task_ctx_get_rate (BRASERO_TASK_CTX (priv->task), rate);
- if (written)
- brasero_task_ctx_get_written (BRASERO_TASK_CTX (priv->task), written);
+ if (written) {
+ gint64 written_local = 0;
+
+ result = brasero_task_ctx_get_written (BRASERO_TASK_CTX (priv->task), &written_local);
+
+ if (result != BRASERO_BURN_OK)
+ *written = -1;
+ else
+ *written = written_local;
+ }
if (!media)
return BRASERO_BURN_OK;
@@ -1271,7 +1293,7 @@
BraseroTrack *track;
track = iter->data;
- brasero_track_unset_data_fs (track, BRASERO_IMAGE_FS_JOLIET);
+ brasero_track_data_rm_fs (BRASERO_TRACK_DATA (track), BRASERO_IMAGE_FS_JOLIET);
}
return BRASERO_BURN_OK;
@@ -1756,7 +1778,7 @@
/* try to get the output size */
if (BRASERO_MEDIUM_RANDOM_WRITABLE (brasero_burn_session_get_dest_media (priv->session))) {
- gint64 len = 0;
+ guint64 len = 0;
BraseroDrive *drive;
BraseroMedium *medium;
@@ -1829,7 +1851,7 @@
BRASERO_BURN_LOG ("Starting to check track integrity");
checksum_type = brasero_track_get_checksum_type (track);
- brasero_track_get_type (track, &type);
+ 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. */
@@ -2135,36 +2157,36 @@
/* the idea is to push a new track on the stack with
* the current disc burnt and the checksum generated
* during the session recording */
- track = brasero_track_new (BRASERO_TRACK_TYPE_DISC);
- brasero_track_set_checksum (track, type, checksum);
+ track = BRASERO_TRACK (brasero_track_disc_new ());
+ brasero_track_set_checksum (BRASERO_TRACK (track), type, checksum);
}
else if (type == BRASERO_CHECKSUM_MD5_FILE) {
- track = brasero_track_new (BRASERO_TRACK_TYPE_DISC);
- brasero_track_set_checksum (track,
+ track = BRASERO_TRACK (brasero_track_disc_new ());
+ brasero_track_set_checksum (BRASERO_TRACK (track),
type,
BRASERO_MD5_FILE);
}
else if (type == BRASERO_CHECKSUM_SHA1_FILE) {
- track = brasero_track_new (BRASERO_TRACK_TYPE_DISC);
- brasero_track_set_checksum (track,
+ track = BRASERO_TRACK (brasero_track_disc_new ());
+ brasero_track_set_checksum (BRASERO_TRACK (track),
type,
BRASERO_SHA1_FILE);
}
else if (type == BRASERO_CHECKSUM_SHA256_FILE) {
- track = brasero_track_new (BRASERO_TRACK_TYPE_DISC);
- brasero_track_set_checksum (track,
+ track = BRASERO_TRACK (brasero_track_disc_new ());
+ brasero_track_set_checksum (BRASERO_TRACK (track),
type,
BRASERO_SHA256_FILE);
}
brasero_burn_session_push_tracks (priv->session);
- brasero_track_set_drive_source (track, brasero_burn_session_get_burner (priv->session));
+ brasero_track_disc_set_drive (BRASERO_TRACK_DISC (track), brasero_burn_session_get_burner (priv->session));
brasero_burn_session_add_track (priv->session, track);
/* It's good practice to unref the track afterwards as we don't need it
* anymore. BraseroBurnSession refs it. */
- brasero_track_unref (track);
+ g_object_unref (track);
/* this may be necessary for the drive to settle down and possibly be
* mounted by gnome-volume-manager (just temporarily) */
@@ -2199,7 +2221,7 @@
track_num = brasero_medium_get_track_num (medium);
BRASERO_BURN_LOG ("Last written track num == %i", track_num);
- brasero_track_set_drive_track (track, track_num);
+ brasero_track_disc_set_track_num (BRASERO_TRACK_DISC (track), track_num);
}
else {
GValue *value;
@@ -2267,7 +2289,7 @@
}
track = tracks->data;
- brasero_track_get_type (track, &type);
+ 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) {
@@ -2303,7 +2325,7 @@
{
gchar *toc = NULL;
gchar *image = NULL;
- BraseroTrack *track;
+ BraseroTrackImage *track;
BraseroTrackType output;
GError *ret_error = NULL;
BraseroBurnResult result;
@@ -2412,13 +2434,13 @@
if (result != BRASERO_BURN_OK)
goto end;
- track = brasero_track_new (BRASERO_TRACK_TYPE_IMAGE);
- brasero_track_set_image_source (track, image, toc, format);
- brasero_burn_session_add_track (priv->session, track);
+ track = brasero_track_image_new ();
+ brasero_track_image_set_source (track, image, toc, format);
+ brasero_burn_session_add_track (priv->session, BRASERO_TRACK (track));
/* It's good practice to unref the track afterwards as we don't need it
* anymore. BraseroBurnSession refs it. */
- brasero_track_unref (track);
+ g_object_unref (track);
end:
g_free (image);
Modified: trunk/libbrasero-burn/brasero-cover.c
==============================================================================
--- trunk/libbrasero-burn/brasero-cover.c (original)
+++ trunk/libbrasero-burn/brasero-cover.c Sat Mar 28 08:14:58 2009
@@ -46,6 +46,7 @@
#include "brasero-tags.h"
#include "brasero-track.h"
#include "brasero-session.h"
+#include "brasero-track-stream.h"
#include "brasero-cover.h"
@@ -99,17 +100,17 @@
gchar *num;
gchar *time;
BraseroTrack *track;
- BraseroSongInfo *info;
+ BraseroStreamInfo *info;
track = iter->data;
- if (brasero_track_get_type (track, NULL) != BRASERO_TRACK_TYPE_AUDIO)
+ if (brasero_track_get_track_type (track, NULL) != BRASERO_TRACK_TYPE_STREAM)
continue;
num = g_strdup_printf ("%i - ", g_slist_index (tracks, track) + 1);
BRASERO_JACKET_EDIT_INSERT_TAGGED_TEXT (buffer, num, "Subtitle", &start);
g_free (num);
- info = brasero_track_get_audio_info (track);
+ info = brasero_track_stream_get_info (BRASERO_TRACK_STREAM (track));
if (info) {
if (info->title) {
@@ -121,8 +122,8 @@
BRASERO_JACKET_EDIT_INSERT_TAGGED_TEXT (buffer, "\t\t", "Subtitle", &start);
- time = brasero_units_get_time_string (brasero_track_get_audio_end (track) -
- brasero_track_get_audio_start (track),
+ time = brasero_units_get_time_string (brasero_track_stream_get_end (BRASERO_TRACK_STREAM (track)) -
+ brasero_track_stream_get_start (BRASERO_TRACK_STREAM (track)),
TRUE,
FALSE);
BRASERO_JACKET_EDIT_INSERT_TAGGED_TEXT (buffer, time, "Subtitle", &start);
@@ -222,7 +223,7 @@
edit = brasero_jacket_edit_dialog_new (GTK_WIDGET (toplevel), &contents);
/* Don't go any further if it's not video */
- if (brasero_burn_session_get_input_type (session, NULL) != BRASERO_TRACK_TYPE_AUDIO)
+ if (brasero_burn_session_get_input_type (session, NULL) != BRASERO_TRACK_TYPE_STREAM)
return edit;
title = brasero_burn_session_get_label (session);
Modified: trunk/libbrasero-burn/brasero-dest-selection.c
==============================================================================
--- trunk/libbrasero-burn/brasero-dest-selection.c (original)
+++ trunk/libbrasero-burn/brasero-dest-selection.c Sat Mar 28 08:14:58 2009
@@ -54,7 +54,6 @@
#include "brasero-dest-selection.h"
#include "brasero-session-cfg.h"
-#include "brasero-utils.h"
typedef struct _BraseroDestSelectionPrivate BraseroDestSelectionPrivate;
struct _BraseroDestSelectionPrivate
@@ -286,14 +285,10 @@
priv = BRASERO_DEST_SELECTION_PRIVATE (object);
switch (property_id) {
- case PROP_SESSION:
- if (priv->session)
- g_object_unref (priv->session);
-
- session = g_value_get_object (value);
-
+ case PROP_SESSION: /* Readable and only writable at creation time */
/* NOTE: no need to unref a potential previous session since
* it's only set at construct time */
+ session = g_value_get_object (value);
priv->session = session;
g_object_ref (session);
@@ -339,6 +334,7 @@
switch (property_id) {
case PROP_SESSION:
+ g_object_ref (priv->session);
g_value_set_object (value, priv->session);
break;
@@ -484,7 +480,7 @@
}
/* format the size */
- if (input.type == BRASERO_TRACK_TYPE_AUDIO
+ if (input.type == BRASERO_TRACK_TYPE_STREAM
|| (input.type == BRASERO_TRACK_TYPE_DISC
&& (input.subtype.media & BRASERO_MEDIUM_HAS_AUDIO)))
size_string = brasero_units_get_time_string (BRASERO_BYTES_TO_DURATION (size_bytes),
Modified: trunk/libbrasero-burn/brasero-disc-copy-dialog.c
==============================================================================
--- trunk/libbrasero-burn/brasero-disc-copy-dialog.c (original)
+++ trunk/libbrasero-burn/brasero-disc-copy-dialog.c Sat Mar 28 08:14:58 2009
@@ -47,7 +47,6 @@
#include "brasero-session.h"
#include "burn-caps.h"
#include "brasero-medium.h"
-#include "brasero-utils.h"
#include "brasero-drive.h"
#include "brasero-session-cfg.h"
#include "brasero-disc-copy-dialog.h"
@@ -66,19 +65,8 @@
static GObjectClass *parent_class = NULL;
-gboolean
-brasero_disc_copy_dialog_set_drive (BraseroDiscCopyDialog *self,
- BraseroDrive *drive)
-{
- BraseroDiscCopyDialogPrivate *priv;
-
- priv = BRASERO_DISC_COPY_DIALOG_PRIVATE (self);
- return brasero_medium_selection_set_active (BRASERO_MEDIUM_SELECTION (priv->source),
- brasero_drive_get_medium (drive));
-}
-
static void
-brasero_disc_copy_dialog_init (BraseroDiscCopyDialog *obj)
+brasero_disc_copy_dialog_set_session (BraseroDiscCopyDialog *obj)
{
gchar *title_str;
BraseroBurnSession *session;
@@ -86,7 +74,6 @@
priv = BRASERO_DISC_COPY_DIALOG_PRIVATE (obj);
- gtk_window_set_title (GTK_WINDOW (obj), _("CD/DVD Copy Options"));
brasero_burn_options_add_burn_button (BRASERO_BURN_OPTIONS (obj),
_("_Copy"),
"media-optical-burn");
@@ -118,6 +105,16 @@
}
static void
+brasero_disc_copy_dialog_init (BraseroDiscCopyDialog *obj)
+{
+ gtk_window_set_title (GTK_WINDOW (obj), _("CD/DVD Copy Options"));
+ g_signal_connect (obj,
+ "notify::session",
+ G_CALLBACK (brasero_disc_copy_dialog_set_session),
+ NULL);
+}
+
+static void
brasero_disc_copy_dialog_finalize (GObject *object)
{
G_OBJECT_CLASS (parent_class)->finalize (object);
@@ -134,13 +131,3 @@
object_class->finalize = brasero_disc_copy_dialog_finalize;
}
-GtkWidget *
-brasero_disc_copy_dialog_new ()
-{
- BraseroDiscCopyDialog *obj;
-
- obj = BRASERO_DISC_COPY_DIALOG (g_object_new (BRASERO_TYPE_DISC_COPY_DIALOG,
- NULL));
-
- return GTK_WIDGET (obj);
-}
Modified: trunk/libbrasero-burn/brasero-disc-copy-dialog.h
==============================================================================
--- trunk/libbrasero-burn/brasero-disc-copy-dialog.h (original)
+++ trunk/libbrasero-burn/brasero-disc-copy-dialog.h Sat Mar 28 08:14:58 2009
@@ -58,9 +58,6 @@
GType brasero_disc_copy_dialog_get_type ();
-GtkWidget *
-brasero_disc_copy_dialog_new ();
-
gboolean
brasero_disc_copy_dialog_set_drive (BraseroDiscCopyDialog *self,
BraseroDrive *drive);
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 Sat Mar 28 08:14:58 2009
@@ -55,13 +55,10 @@
#include "brasero-session-cfg.h"
#include "brasero-burn-options.h"
-#include "brasero-disc.h"
-
G_DEFINE_TYPE (BraseroDiscOptionDialog, brasero_disc_option_dialog, BRASERO_TYPE_BURN_OPTIONS);
struct _BraseroDiscOptionDialogPrivate {
BraseroBurnCaps *caps;
- BraseroDisc *disc;
GtkWidget *joliet_toggle;
@@ -126,6 +123,25 @@
* are generated. They are used to check that flags or fs are valid.
*/
+static void
+brasero_disc_option_dialog_set_tracks_image_fs (BraseroBurnSession *session,
+ BraseroImageFS fs_type)
+{
+ GSList *tracks;
+ GSList *iter;
+
+ tracks = brasero_burn_session_get_tracks (session);
+ for (iter = tracks; iter; iter = iter->next) {
+ BraseroTrack *track;
+
+ track = iter->data;
+ if (brasero_track_get_track_type (track, NULL) != BRASERO_TRACK_TYPE_DATA)
+ continue;
+
+ brasero_track_data_add_fs (BRASERO_TRACK_DATA (track), fs_type);
+ }
+}
+
static gboolean
brasero_disc_option_dialog_update_joliet (BraseroDiscOptionDialog *dialog)
{
@@ -160,8 +176,7 @@
return FALSE;
}
- source.subtype.fs_type |= BRASERO_IMAGE_FS_JOLIET;
- brasero_burn_session_set_input_type (session, &source);
+ brasero_disc_option_dialog_set_tracks_image_fs (session, source.subtype.fs_type);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->joliet_toggle), priv->joliet_saved);
g_object_unref (session);
@@ -176,7 +191,7 @@
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_burn_session_set_input_type (session, &source);
+ brasero_disc_option_dialog_set_tracks_image_fs (session, source.subtype.fs_type);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->joliet_toggle), FALSE);
}
@@ -292,8 +307,8 @@
source.subtype.fs_type &= ~BRASERO_IMAGE_FS_JOLIET;
else
source.subtype.fs_type |= BRASERO_IMAGE_FS_JOLIET;
- brasero_burn_session_set_input_type (session, &source);
+ brasero_disc_option_dialog_set_tracks_image_fs (session, source.subtype.fs_type);
g_object_unref (session);
}
@@ -724,9 +739,28 @@
BRASERO_VIDEO_ASPECT_4_3);
}
-void
-brasero_disc_option_dialog_set_disc (BraseroDiscOptionDialog *dialog,
- BraseroDisc *disc)
+static void
+brasero_disc_option_dialog_valid_media_cb (BraseroSessionCfg *session,
+ BraseroDiscOptionDialog *self)
+{
+ BraseroDiscOptionDialogPrivate *priv;
+
+ priv = BRASERO_DISC_OPTION_DIALOG_PRIVATE (self);
+
+ if (priv->video_options)
+ gtk_widget_set_sensitive (priv->video_options, BRASERO_SESSION_IS_VALID (brasero_session_cfg_get_error (session)));
+
+ /* update the joliet button */
+ brasero_disc_option_dialog_update_joliet (self);
+
+ /* for video disc see what's the output: CD or DVD */
+ brasero_disc_option_dialog_update_video (self);
+}
+
+static void
+brasero_disc_option_dialog_set_session (GObject *dialog,
+ GParamSpec *pspec,
+ gpointer NULL_data)
{
BraseroDiscOptionDialogPrivate *priv;
BraseroBurnSession *session;
@@ -734,28 +768,21 @@
priv = BRASERO_DISC_OPTION_DIALOG_PRIVATE (dialog);
- if (priv->disc)
- g_object_unref (priv->disc);
-
- priv->disc = disc;
- g_object_ref (disc);
-
session = brasero_burn_options_get_session (BRASERO_BURN_OPTIONS (dialog));
- brasero_disc_set_session_param (disc, session);
-
brasero_burn_session_get_input_type (session, &type);
+
if (type.type == BRASERO_TRACK_TYPE_DATA) {
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 (dialog);
+ brasero_disc_option_dialog_add_data_options (BRASERO_DISC_OPTION_DIALOG (dialog));
}
- else if (type.type == BRASERO_TRACK_TYPE_AUDIO) {
+ 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)) {
brasero_burn_options_set_type_shown (BRASERO_BURN_OPTIONS (dialog),
BRASERO_MEDIA_TYPE_WRITABLE|
BRASERO_MEDIA_TYPE_FILE);
- brasero_disc_option_dialog_add_video_options (dialog);
+ brasero_disc_option_dialog_add_video_options (BRASERO_DISC_OPTION_DIALOG (dialog));
}
else {
/* No other specific options for audio */
@@ -768,57 +795,26 @@
if (brasero_burn_session_get_flags (session) & BRASERO_BURN_FLAG_MERGE)
brasero_burn_options_lock_selection (BRASERO_BURN_OPTIONS (dialog));
+ priv->valid_sig = g_signal_connect (session,
+ "is-valid",
+ G_CALLBACK (brasero_disc_option_dialog_valid_media_cb),
+ dialog);
g_object_unref (session);
}
-BraseroBurnSession *
-brasero_disc_option_dialog_get_session (BraseroDiscOptionDialog *self)
-{
- BraseroBurnSession *session;
- BraseroDiscOptionDialogPrivate *priv;
-
- priv = BRASERO_DISC_OPTION_DIALOG_PRIVATE (self);
-
- session = brasero_burn_options_get_session (BRASERO_BURN_OPTIONS (self));
- brasero_disc_set_session_contents (priv->disc, session);
-
- return session;
-}
-
-static void
-brasero_disc_option_dialog_valid_media_cb (BraseroSessionCfg *session,
- BraseroDiscOptionDialog *self)
-{
- BraseroDiscOptionDialogPrivate *priv;
-
- priv = BRASERO_DISC_OPTION_DIALOG_PRIVATE (self);
-
- if (priv->video_options)
- gtk_widget_set_sensitive (priv->video_options, BRASERO_SESSION_IS_VALID (brasero_session_cfg_get_error (session)));
-
- /* update the joliet button */
- brasero_disc_option_dialog_update_joliet (self);
-
- /* for video disc see what's the output: CD or DVD */
- brasero_disc_option_dialog_update_video (self);
-}
-
static void
brasero_disc_option_dialog_init (BraseroDiscOptionDialog *obj)
{
BraseroDiscOptionDialogPrivate *priv;
- BraseroBurnSession *session;
priv = BRASERO_DISC_OPTION_DIALOG_PRIVATE (obj);
priv->caps = brasero_burn_caps_get_default ();
-
- session = brasero_burn_options_get_session (BRASERO_BURN_OPTIONS (obj));
- priv->valid_sig = g_signal_connect (session,
- "is-valid",
- G_CALLBACK (brasero_disc_option_dialog_valid_media_cb),
- obj);
- g_object_unref (session);
+ gtk_window_set_title (GTK_WINDOW (obj), _("Disc Burning Setup"));
+ g_signal_connect (obj,
+ "notify::session",
+ G_CALLBACK (brasero_disc_option_dialog_set_session),
+ NULL);
}
static void
@@ -843,11 +839,6 @@
priv->caps = NULL;
}
- if (priv->disc) {
- g_object_unref (priv->disc);
- priv->disc = NULL;
- }
-
G_OBJECT_CLASS (parent_class)->finalize (object);
}
@@ -862,14 +853,3 @@
object_class->finalize = brasero_disc_option_dialog_finalize;
}
-GtkWidget *
-brasero_disc_option_dialog_new ()
-{
- BraseroDiscOptionDialog *obj;
-
- obj = BRASERO_DISC_OPTION_DIALOG (g_object_new (BRASERO_TYPE_DISC_OPTION_DIALOG,
- "title", _("Disc Burning Setup"),
- NULL));
-
- return GTK_WIDGET (obj);
-}
Modified: trunk/libbrasero-burn/brasero-disc-option-dialog.h
==============================================================================
--- trunk/libbrasero-burn/brasero-disc-option-dialog.h (original)
+++ trunk/libbrasero-burn/brasero-disc-option-dialog.h Sat Mar 28 08:14:58 2009
@@ -36,7 +36,6 @@
#include <gtk/gtk.h>
-#include "brasero-disc.h"
#include "brasero-burn-options.h"
G_BEGIN_DECLS
@@ -60,14 +59,6 @@
};
GType brasero_disc_option_dialog_get_type ();
-GtkWidget *brasero_disc_option_dialog_new ();
-
-void
-brasero_disc_option_dialog_set_disc (BraseroDiscOptionDialog *dialog,
- BraseroDisc *disc);
-
-BraseroBurnSession *
-brasero_disc_option_dialog_get_session (BraseroDiscOptionDialog *dialog);
G_END_DECLS
Modified: trunk/libbrasero-burn/brasero-enums.h
==============================================================================
--- trunk/libbrasero-burn/brasero-enums.h (original)
+++ trunk/libbrasero-burn/brasero-enums.h Sat Mar 28 08:14:58 2009
@@ -104,6 +104,55 @@
BRASERO_BURN_ACTION_LAST
} BraseroBurnAction;
+typedef enum {
+ BRASERO_IMAGE_FS_NONE = 0,
+ BRASERO_IMAGE_FS_ISO = 1,
+ BRASERO_IMAGE_FS_UDF = 1 << 1,
+ BRASERO_IMAGE_FS_JOLIET = 1 << 2,
+ BRASERO_IMAGE_FS_VIDEO = 1 << 3,
+
+ /* The following one conflict with UDF and JOLIET */
+ BRASERO_IMAGE_FS_SYMLINK = 1 << 4,
+
+ BRASERO_IMAGE_ISO_FS_LEVEL_3 = 1 << 5,
+ BRASERO_IMAGE_ISO_FS_DEEP_DIRECTORY = 1 << 6,
+ BRASERO_IMAGE_FS_ANY = BRASERO_IMAGE_FS_ISO|
+ BRASERO_IMAGE_FS_UDF|
+ BRASERO_IMAGE_FS_JOLIET|
+ BRASERO_IMAGE_FS_SYMLINK|
+ BRASERO_IMAGE_ISO_FS_LEVEL_3|
+ BRASERO_IMAGE_FS_VIDEO|
+ BRASERO_IMAGE_ISO_FS_DEEP_DIRECTORY
+} BraseroImageFS;
+
+typedef enum {
+ BRASERO_AUDIO_FORMAT_NONE = 0,
+ BRASERO_AUDIO_FORMAT_UNDEFINED = 1,
+ BRASERO_AUDIO_FORMAT_4_CHANNEL = 1 << 1,
+ BRASERO_AUDIO_FORMAT_RAW = 1 << 2,
+ BRASERO_AUDIO_FORMAT_AC3 = 1 << 3,
+ BRASERO_AUDIO_FORMAT_MP2 = 1 << 4,
+ BRASERO_AUDIO_FORMAT_44100 = 1 << 5,
+ BRASERO_AUDIO_FORMAT_48000 = 1 << 6,
+ BRASERO_VIDEO_FORMAT_UNDEFINED = 1 << 7,
+ BRASERO_VIDEO_FORMAT_VCD = 1 << 8,
+ BRASERO_VIDEO_FORMAT_VIDEO_DVD = 1 << 9,
+
+ BRASERO_METADATA_INFO = 1 << 10
+} BraseroStreamFormat;
+
+typedef enum {
+ BRASERO_IMAGE_FORMAT_NONE = 0,
+ BRASERO_IMAGE_FORMAT_BIN = 1,
+ BRASERO_IMAGE_FORMAT_CUE = 1 << 1,
+ BRASERO_IMAGE_FORMAT_CLONE = 1 << 2,
+ BRASERO_IMAGE_FORMAT_CDRDAO = 1 << 3,
+ BRASERO_IMAGE_FORMAT_ANY = BRASERO_IMAGE_FORMAT_BIN|
+ BRASERO_IMAGE_FORMAT_CUE|
+ BRASERO_IMAGE_FORMAT_CDRDAO|
+ BRASERO_IMAGE_FORMAT_CLONE,
+} BraseroImageFormat;
+
G_END_DECLS
#endif
Modified: trunk/libbrasero-burn/brasero-image-option-dialog.c
==============================================================================
--- trunk/libbrasero-burn/brasero-image-option-dialog.c (original)
+++ trunk/libbrasero-burn/brasero-image-option-dialog.c Sat Mar 28 08:14:58 2009
@@ -45,7 +45,6 @@
#include "burn-basics.h"
#include "brasero-drive.h"
-#include "brasero-utils.h"
#include "brasero-image-option-dialog.h"
#include "brasero-src-image.h"
#include "brasero-burn-options.h"
@@ -61,19 +60,8 @@
static GtkDialogClass *parent_class = NULL;
-void
-brasero_image_option_dialog_set_image_uri (BraseroImageOptionDialog *dialog,
- const gchar *uri)
-{
- BraseroImageOptionDialogPrivate *priv;
-
- priv = BRASERO_IMAGE_OPTION_DIALOG_PRIVATE (dialog);
-
- brasero_src_image_set_uri (BRASERO_SRC_IMAGE (priv->file), uri);
-}
-
static void
-brasero_image_option_dialog_init (BraseroImageOptionDialog *obj)
+brasero_image_option_dialog_set_session (BraseroImageOptionDialog *obj)
{
gchar *string;
BraseroBurnSession *session;
@@ -101,6 +89,16 @@
}
static void
+brasero_image_option_dialog_init (BraseroImageOptionDialog *obj)
+{
+ gtk_window_set_title (GTK_WINDOW (obj), _("Image Burning Setup"));
+ g_signal_connect (obj,
+ "notify::session",
+ G_CALLBACK (brasero_image_option_dialog_set_session),
+ NULL);
+}
+
+static void
brasero_image_option_dialog_finalize (GObject *object)
{
G_OBJECT_CLASS (parent_class)->finalize (object);
@@ -117,14 +115,3 @@
object_class->finalize = brasero_image_option_dialog_finalize;
}
-GtkWidget *
-brasero_image_option_dialog_new ()
-{
- BraseroImageOptionDialog *obj;
-
- obj = BRASERO_IMAGE_OPTION_DIALOG (g_object_new (BRASERO_TYPE_IMAGE_OPTION_DIALOG,
- "title", _("Image Burning Setup"),
- NULL));
-
- return GTK_WIDGET (obj);
-}
Modified: trunk/libbrasero-burn/brasero-image-option-dialog.h
==============================================================================
--- trunk/libbrasero-burn/brasero-image-option-dialog.h (original)
+++ trunk/libbrasero-burn/brasero-image-option-dialog.h Sat Mar 28 08:14:58 2009
@@ -61,11 +61,6 @@
};
GType brasero_image_option_dialog_get_type ();
-GtkWidget *brasero_image_option_dialog_new ();
-
-void
-brasero_image_option_dialog_set_image_uri (BraseroImageOptionDialog *dialog,
- const gchar *uri);
G_END_DECLS
Modified: trunk/libbrasero-burn/brasero-session-cfg.c
==============================================================================
--- trunk/libbrasero-burn/brasero-session-cfg.c (original)
+++ trunk/libbrasero-burn/brasero-session-cfg.c Sat Mar 28 08:14:58 2009
@@ -48,6 +48,7 @@
#include "burn-plugin-manager.h"
#include "burn-image-format.h"
+#include "brasero-track-image.h"
#include "brasero-session-cfg.h"
typedef struct _BraseroSessionCfgPrivate BraseroSessionCfgPrivate;
@@ -158,7 +159,7 @@
property);
break;
- case BRASERO_TRACK_TYPE_AUDIO:
+ case BRASERO_TRACK_TYPE_STREAM:
key = g_strdup_printf ("%s/%s/audio_%s/%s",
BRASERO_DRIVE_PROPERTIES_KEY,
display_name,
@@ -538,26 +539,15 @@
session_size = g_value_get_int64 (value);
}
else for (; iter; iter = iter->next) {
- BraseroTrackDataType type;
BraseroTrack *track;
- gint64 sectors;
track = iter->data;
- sectors = 0;
+ if (brasero_track_get_track_type (track, NULL) != BRASERO_TRACK_TYPE_DATA) {
+ guint64 sectors = 0;
- type = brasero_track_get_type (track, NULL);
- if (type == BRASERO_TRACK_TYPE_DISC)
- brasero_track_get_disc_data_size (track, §ors, NULL);
- else if (type == BRASERO_TRACK_TYPE_IMAGE)
- brasero_track_get_image_size (track, NULL, §ors, NULL, NULL);
- else if (type == BRASERO_TRACK_TYPE_AUDIO) {
- gint64 len = 0;
-
- brasero_track_get_audio_length (track, &len);
- sectors = BRASERO_DURATION_TO_SECTORS (len);
+ brasero_track_get_size (track, §ors, NULL);
+ session_size += sectors;
}
-
- session_size += sectors;
}
BRASERO_BURN_LOG ("Session size %lli/Disc size %lli",
@@ -603,6 +593,25 @@
}
static void
+brasero_session_cfg_set_tracks_audio_format (BraseroBurnSession *session,
+ BraseroStreamFormat format)
+{
+ GSList *tracks;
+ GSList *iter;
+
+ tracks = brasero_burn_session_get_tracks (session);
+ for (iter = tracks; iter; iter = iter->next) {
+ BraseroTrack *track;
+
+ track = iter->data;
+ if (brasero_track_get_track_type (track, NULL) != BRASERO_TRACK_TYPE_STREAM)
+ continue;
+
+ brasero_track_stream_set_format (BRASERO_TRACK_STREAM (track), format);
+ }
+}
+
+static void
brasero_session_cfg_update (BraseroSessionCfg *self,
gboolean update,
gboolean check)
@@ -650,7 +659,7 @@
BraseroTrack *track;
track = tracks->data;
- uri = brasero_track_get_image_source (track, TRUE);
+ uri = brasero_track_image_get_source (BRASERO_TRACK_IMAGE (track), TRUE);
if (uri) {
priv->is_valid = BRASERO_SESSION_UNKNOWN_IMAGE;
g_free (uri);
@@ -692,7 +701,8 @@
priv->CD_TEXT_modified = FALSE;
priv->configuring = TRUE;
- brasero_burn_session_set_input_type (BRASERO_BURN_SESSION (self), &source);
+ brasero_session_cfg_set_tracks_audio_format (BRASERO_BURN_SESSION (self),
+ source.subtype.audio_format);
priv->configuring = FALSE;
}
else {
@@ -710,7 +720,7 @@
BRASERO_BURN_SESSION (self),
FALSE);
if (result != BRASERO_BURN_OK
- && source.type == BRASERO_TRACK_TYPE_AUDIO
+ && source.type == BRASERO_TRACK_TYPE_STREAM
&& (source.subtype.audio_format & BRASERO_METADATA_INFO)) {
/* Another special case in case some burning backends
* don't support CD-TEXT for audio (libburn). If no
@@ -726,7 +736,8 @@
priv->CD_TEXT_modified = TRUE;
priv->configuring = TRUE;
- brasero_burn_session_set_input_type (BRASERO_BURN_SESSION (self), &source);
+ brasero_session_cfg_set_tracks_audio_format (BRASERO_BURN_SESSION (self),
+ source.subtype.audio_format);
priv->configuring = FALSE;
}
}
Modified: trunk/libbrasero-burn/brasero-session.c
==============================================================================
--- trunk/libbrasero-burn/brasero-session.c (original)
+++ trunk/libbrasero-burn/brasero-session.c Sat Mar 28 08:14:58 2009
@@ -54,6 +54,8 @@
#include "brasero-drive.h"
#include "brasero-medium-monitor.h"
+#include "brasero-track-disc.h"
+
G_DEFINE_TYPE (BraseroBurnSession, brasero_burn_session, G_TYPE_OBJECT);
#define BRASERO_BURN_SESSION_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), BRASERO_TYPE_BURN_SESSION, BraseroBurnSessionPrivate))
@@ -88,12 +90,8 @@
BraseroSessionSetting settings [1];
GSList *pile_settings;
- BraseroTrackType input;
-
GHashTable *tags;
- guint src_added_sig;
- guint src_removed_sig;
guint dest_added_sig;
guint dest_removed_sig;
@@ -161,19 +159,8 @@
}
static void
-brasero_burn_session_src_media_added (BraseroDrive *drive,
- BraseroMedium *medium,
- BraseroBurnSession *self)
-{
- g_signal_emit (self,
- brasero_burn_session_signals [INPUT_CHANGED_SIGNAL],
- 0);
-}
-
-static void
-brasero_burn_session_src_media_removed (BraseroDrive *drive,
- BraseroMedium *medium,
- BraseroBurnSession *self)
+brasero_burn_session_track_changed (BraseroDrive *drive,
+ BraseroBurnSession *self)
{
g_signal_emit (self,
brasero_burn_session_signals [INPUT_CHANGED_SIGNAL],
@@ -181,56 +168,37 @@
}
static void
-brasero_burn_session_start_src_drive_monitoring (BraseroBurnSession *self)
+brasero_burn_session_start_track_monitoring (BraseroBurnSession *self,
+ BraseroTrack *track)
{
- BraseroDrive *drive;
BraseroBurnSessionPrivate *priv;
- if (brasero_burn_session_get_input_type (self, NULL) != BRASERO_TRACK_TYPE_DISC)
- return;
-
- drive = brasero_burn_session_get_src_drive (self);
- if (!drive)
- return;
-
priv = BRASERO_BURN_SESSION_PRIVATE (self);
- priv->src_added_sig = g_signal_connect (drive,
- "medium-added",
- G_CALLBACK (brasero_burn_session_src_media_added),
- self);
- priv->src_removed_sig = g_signal_connect (drive,
- "medium-removed",
- G_CALLBACK (brasero_burn_session_src_media_removed),
- self);
+ g_signal_connect (track,
+ "changed",
+ G_CALLBACK (brasero_burn_session_track_changed),
+ self);
}
static void
-brasero_burn_session_stop_src_drive_monitoring (BraseroBurnSession *self)
+brasero_burn_session_stop_tracks_monitoring (BraseroBurnSession *self)
{
- BraseroDrive *drive;
BraseroBurnSessionPrivate *priv;
-
- if (brasero_burn_session_get_input_type (self, NULL) != BRASERO_TRACK_TYPE_DISC)
- return;
-
- drive = brasero_burn_session_get_src_drive (self);
- if (!drive)
- return;
+ GSList *iter;
priv = BRASERO_BURN_SESSION_PRIVATE (self);
- if (priv->src_added_sig) {
- g_signal_handler_disconnect (drive, priv->src_added_sig);
- priv->src_added_sig = 0;
- }
+ for (iter = priv->tracks; iter; iter = iter->next) {
+ BraseroTrack *track;
- if (priv->src_removed_sig) {
- g_signal_handler_disconnect (drive, priv->src_removed_sig);
- priv->src_removed_sig = 0;
+ track = iter->data;
+ g_signal_handlers_disconnect_by_func (track,
+ brasero_burn_session_track_changed,
+ self);
}
}
-void
+static void
brasero_burn_session_free_tracks (BraseroBurnSession *self)
{
BraseroBurnSessionPrivate *priv;
@@ -239,9 +207,9 @@
priv = BRASERO_BURN_SESSION_PRIVATE (self);
- brasero_burn_session_stop_src_drive_monitoring (self);
+ brasero_burn_session_stop_tracks_monitoring (self);
- g_slist_foreach (priv->tracks, (GFunc) brasero_track_unref, NULL);
+ g_slist_foreach (priv->tracks, (GFunc) g_object_unref, NULL);
g_slist_free (priv->tracks);
priv->tracks = NULL;
@@ -250,21 +218,6 @@
0);
}
-void
-brasero_burn_session_clear_current_track (BraseroBurnSession *self)
-{
- BraseroBurnSessionPrivate *priv;
-
- g_return_if_fail (BRASERO_IS_BURN_SESSION (self));
-
- priv = BRASERO_BURN_SESSION_PRIVATE (self);
-
- brasero_burn_session_stop_src_drive_monitoring (self);
- g_slist_foreach (priv->tracks, (GFunc) brasero_track_unref, NULL);
- g_slist_free (priv->tracks);
- priv->tracks = NULL;
-}
-
BraseroBurnResult
brasero_burn_session_add_track (BraseroBurnSession *self,
BraseroTrack *new_track)
@@ -275,16 +228,20 @@
priv = BRASERO_BURN_SESSION_PRIVATE (self);
- brasero_track_ref (new_track);
- if (!priv->tracks) {
- BraseroTrackType new_type;
+ if (!new_track) {
+ if (!priv->tracks)
+ return BRASERO_BURN_OK;
- brasero_track_get_type (new_track, &new_type);
+ brasero_burn_session_free_tracks (self);
+ return BRASERO_BURN_OK;
+ }
+ g_object_ref (new_track);
+ if (!priv->tracks) {
/* we only need to emit the signal here since if there are
* multiple tracks they must be exactly of the same time */
priv->tracks = g_slist_prepend (NULL, new_track);
- brasero_burn_session_start_src_drive_monitoring (self);
+ brasero_burn_session_start_track_monitoring (self, new_track);
/* if (!brasero_track_type_equal (priv->input, &new_type)) */
g_signal_emit (self,
@@ -294,25 +251,27 @@
return BRASERO_BURN_OK;
}
- brasero_burn_session_stop_src_drive_monitoring (self);
-
/* 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_type (new_track, NULL) != BRASERO_TRACK_TYPE_AUDIO
- || brasero_burn_session_get_input_type (self, NULL) != BRASERO_TRACK_TYPE_AUDIO) {
- g_slist_foreach (priv->tracks, (GFunc) brasero_track_unref, NULL);
+ if (brasero_track_get_track_type (new_track, NULL) != BRASERO_TRACK_TYPE_STREAM
+ || brasero_burn_session_get_input_type (self, NULL) != BRASERO_TRACK_TYPE_STREAM) {
+ brasero_burn_session_stop_tracks_monitoring (self);
+
+ g_slist_foreach (priv->tracks, (GFunc) g_object_unref, NULL);
g_slist_free (priv->tracks);
priv->tracks = g_slist_prepend (NULL, new_track);
- brasero_burn_session_start_src_drive_monitoring (self);
+ brasero_burn_session_start_track_monitoring (self, new_track);
g_signal_emit (self,
brasero_burn_session_signals [INPUT_CHANGED_SIGNAL],
0);
}
- else
+ else {
+ brasero_burn_session_start_track_monitoring (self, new_track);
priv->tracks = g_slist_append (priv->tracks, new_track);
+ }
return BRASERO_BURN_OK;
}
@@ -329,30 +288,6 @@
return priv->tracks;
}
-void
-brasero_burn_session_set_input_type (BraseroBurnSession *self,
- BraseroTrackType *type)
-{
- BraseroBurnSessionPrivate *priv;
- BraseroTrackType input = { 0, };
-
- g_return_if_fail (BRASERO_IS_BURN_SESSION (self));
- g_return_if_fail (type != NULL);
-
- priv = BRASERO_BURN_SESSION_PRIVATE (self);
-
- brasero_burn_session_get_input_type (self, &input);
- memcpy (&priv->input, type, sizeof (BraseroTrackType));
-
- if (brasero_track_type_equal (&input, type))
- return;
-
- if (!priv->tracks)
- g_signal_emit (self,
- brasero_burn_session_signals [INPUT_CHANGED_SIGNAL],
- 0);
-}
-
BraseroTrackDataType
brasero_burn_session_get_input_type (BraseroBurnSession *self,
BraseroTrackType *type)
@@ -364,17 +299,13 @@
priv = BRASERO_BURN_SESSION_PRIVATE (self);
- if (!priv->tracks) {
- if (type)
- memcpy (type, &priv->input, sizeof (BraseroTrackType));
-
- return priv->input.type;
- }
+ if (!priv->tracks)
+ return BRASERO_TRACK_TYPE_NONE;
/* there can be many tracks (in case of audio) but they must be
* all of the same kind for the moment */
track = priv->tracks->data;
- return brasero_track_get_type (track, type);
+ return brasero_track_get_track_type (track, type);
}
/**
@@ -1147,10 +1078,9 @@
priv = BRASERO_BURN_SESSION_PRIVATE (self);
- brasero_burn_session_stop_src_drive_monitoring (self);
+ brasero_burn_session_stop_tracks_monitoring (self);
- priv->pile_tracks = g_slist_prepend (priv->pile_tracks,
- priv->tracks);
+ priv->pile_tracks = g_slist_prepend (priv->pile_tracks, priv->tracks);
priv->tracks = NULL;
g_signal_emit (self,
@@ -1169,9 +1099,9 @@
priv = BRASERO_BURN_SESSION_PRIVATE (self);
if (priv->tracks) {
- brasero_burn_session_stop_src_drive_monitoring (self);
+ brasero_burn_session_stop_tracks_monitoring (self);
- g_slist_foreach (priv->tracks, (GFunc) brasero_track_unref, NULL);
+ g_slist_foreach (priv->tracks, (GFunc) g_object_unref, NULL);
g_slist_free (priv->tracks);
priv->tracks = NULL;
@@ -1190,7 +1120,12 @@
priv->pile_tracks = g_slist_remove (priv->pile_tracks, sources);
priv->tracks = sources;
- brasero_burn_session_start_src_drive_monitoring (self);
+ for (; sources; sources = sources->next) {
+ BraseroTrack *track;
+
+ track = sources->data;
+ brasero_burn_session_start_track_monitoring (self, track);
+ }
g_signal_emit (self,
brasero_burn_session_signals [INPUT_CHANGED_SIGNAL],
@@ -1234,6 +1169,7 @@
brasero_burn_session_get_src_medium (BraseroBurnSession *self)
{
BraseroTrack *track;
+ BraseroDrive *drive;
BraseroBurnSessionPrivate *priv;
g_return_val_if_fail (BRASERO_IS_BURN_SESSION (self), NULL);
@@ -1251,10 +1187,11 @@
return NULL;
track = priv->tracks->data;
- if (brasero_track_get_type (track, NULL) != BRASERO_TRACK_TYPE_DISC)
+ if (brasero_track_get_track_type (track, NULL) != BRASERO_TRACK_TYPE_DISC)
return NULL;
- return brasero_track_get_medium_source (track);
+ drive = brasero_track_disc_get_drive (BRASERO_TRACK_DISC (track));
+ return brasero_drive_get_medium (drive);
}
BraseroDrive *
@@ -1278,10 +1215,10 @@
return NULL;
track = priv->tracks->data;
- if (brasero_track_get_type (track, NULL) != BRASERO_TRACK_TYPE_DISC)
+ if (brasero_track_get_track_type (track, NULL) != BRASERO_TRACK_TYPE_DISC)
return NULL;
- return brasero_track_get_drive_source (track);
+ return brasero_track_disc_get_drive (BRASERO_TRACK_DISC (track));
}
gboolean
@@ -1307,10 +1244,10 @@
return FALSE;
track = priv->tracks->data;
- if (brasero_track_get_type (track, NULL) != BRASERO_TRACK_TYPE_DISC)
+ if (brasero_track_get_track_type (track, NULL) != BRASERO_TRACK_TYPE_DISC)
return FALSE;
- drive = brasero_track_get_drive_source (track);
+ drive = brasero_track_disc_get_drive (BRASERO_TRACK_DISC (track));
if (!drive)
return FALSE;
@@ -1479,7 +1416,7 @@
static void
brasero_burn_session_track_list_free (GSList *list)
{
- g_slist_foreach (list, (GFunc) brasero_track_unref, NULL);
+ g_slist_foreach (list, (GFunc) g_object_unref, NULL);
g_slist_free (list);
}
@@ -1572,7 +1509,7 @@
priv->dest_removed_sig = 0;
}
- brasero_burn_session_stop_src_drive_monitoring (BRASERO_BURN_SESSION (object));
+ brasero_burn_session_stop_tracks_monitoring (BRASERO_BURN_SESSION (object));
if (priv->pile_tracks) {
g_slist_foreach (priv->pile_tracks,
@@ -1585,7 +1522,7 @@
if (priv->tracks) {
g_slist_foreach (priv->tracks,
- (GFunc) brasero_track_unref,
+ (GFunc) g_object_unref,
NULL);
g_slist_free (priv->tracks);
priv->tracks = NULL;
Modified: trunk/libbrasero-burn/brasero-session.h
==============================================================================
--- trunk/libbrasero-burn/brasero-session.h (original)
+++ trunk/libbrasero-burn/brasero-session.h Sat Mar 28 08:14:58 2009
@@ -81,16 +81,10 @@
BraseroBurnResult
brasero_burn_session_add_track (BraseroBurnSession *session,
BraseroTrack *track);
-void
-brasero_burn_session_clear_current_track (BraseroBurnSession *session);
GSList *
brasero_burn_session_get_tracks (BraseroBurnSession *session);
-void
-brasero_burn_session_set_input_type (BraseroBurnSession *session,
- BraseroTrackType *type);
-
BraseroTrackDataType
brasero_burn_session_get_input_type (BraseroBurnSession *session,
BraseroTrackType *type);
Modified: trunk/libbrasero-burn/brasero-src-image.c
==============================================================================
--- trunk/libbrasero-burn/brasero-src-image.c (original)
+++ trunk/libbrasero-burn/brasero-src-image.c Sat Mar 28 08:14:58 2009
@@ -51,24 +51,20 @@
#include "brasero-image-type-chooser.h"
#include "brasero-session-cfg.h"
+#include "brasero-track-image.h"
#include "brasero-src-image.h"
#include "burn-image-format.h"
-#include "brasero-io.h"
-
typedef struct _BraseroSrcImagePrivate BraseroSrcImagePrivate;
struct _BraseroSrcImagePrivate
{
BraseroBurnSession *session;
- BraseroTrack *track;
+ BraseroTrackImage *track;
BraseroBurnCaps *caps;
- BraseroIO *io;
- BraseroIOJobBase *info_type;
-
gchar *folder;
- BraseroIOJobBase *folder_type;
+ GCancellable *cancel;
GtkWidget *format;
GtkWidget *label;
@@ -110,7 +106,7 @@
priv = BRASERO_SRC_IMAGE_PRIVATE (self);
- brasero_track_get_type (priv->track, &type);
+ 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)
return;
@@ -119,22 +115,22 @@
switch (type.subtype.img_format) {
case BRASERO_IMAGE_FORMAT_BIN:
recent_data.mime_type = (gchar *) mimes [0];
- uri = brasero_track_get_image_source (priv->track, TRUE);
+ uri = brasero_track_image_get_source (priv->track, TRUE);
break;
case BRASERO_IMAGE_FORMAT_CUE:
recent_data.mime_type = (gchar *) mimes [1];
- uri = brasero_track_get_toc_source (priv->track, TRUE);
+ uri = brasero_track_image_get_toc_source (priv->track, TRUE);
break;
case BRASERO_IMAGE_FORMAT_CLONE:
recent_data.mime_type = (gchar *) mimes [2];
- uri = brasero_track_get_toc_source (priv->track, TRUE);
+ uri = brasero_track_image_get_toc_source (priv->track, TRUE);
break;
case BRASERO_IMAGE_FORMAT_CDRDAO:
recent_data.mime_type = (gchar *) mimes [3];
- uri = brasero_track_get_toc_source (priv->track, TRUE);
+ uri = brasero_track_image_get_toc_source (priv->track, TRUE);
break;
default:
@@ -153,80 +149,59 @@
}
static void
-brasero_src_image_set_track (BraseroSrcImage *dialog,
- BraseroImageFormat format,
- const gchar *image,
- const gchar *toc)
+brasero_src_image_update (BraseroSrcImage *dialog)
{
+ gchar *uri;
gchar *path;
+ GFile *file;
gchar *string;
- gint64 size = 0;
+ guint64 size = 0;
gchar *size_string;
BraseroSrcImagePrivate *priv;
+ BraseroTrackType type = { 0, };
priv = BRASERO_SRC_IMAGE_PRIVATE (dialog);
- /* add a track every time to send a signal */
- if (priv->track) {
- gchar *uri = NULL;
- BraseroTrackType type = { 0, };
-
- /* make sure something actually changed */
- brasero_track_get_type (priv->track, &type);
-
- if (image)
- uri = brasero_track_get_image_source (priv->track, TRUE);
- else if (toc)
- uri = brasero_track_get_toc_source (priv->track, TRUE);
-
- if (!toc && !image && !uri)
- return;
-
- if((format == type.subtype.img_format)
- && uri && (image || toc)
- && !strcmp (uri, image? image:toc)) {
- g_free (uri);
- return;
- }
-
- g_free (uri);
-
- brasero_burn_session_clear_current_track (priv->session);
- brasero_track_unref (priv->track);
- }
-
- /* set image type before adding so that signal has the right type */
- priv->track = brasero_track_new (BRASERO_TRACK_TYPE_IMAGE);
- brasero_track_set_image_source (priv->track,
- image,
- toc,
- format);
- brasero_burn_session_add_track (priv->session, priv->track);
-
- if (!toc && !image && format == BRASERO_IMAGE_FORMAT_NONE)
+ if (!priv->track)
return;
- brasero_track_get_image_size (priv->track, NULL, NULL, &size, NULL);
+ /* Deal with size */
+ brasero_track_get_size (BRASERO_TRACK (priv->track), NULL, &size);
size_string = g_format_size_for_display (size);
+
+ /* Retrieve a path or an uri */
path = NULL;
- switch (format) {
+ brasero_track_get_track_type (BRASERO_TRACK (priv->track), &type);
+ switch (type.subtype.img_format) {
case BRASERO_IMAGE_FORMAT_NONE:
case BRASERO_IMAGE_FORMAT_BIN:
- path = g_filename_from_uri (image?image:toc, NULL, NULL);
- if (!path)
- path = g_uri_unescape_string (image?image:toc, NULL);
+ uri = brasero_track_image_get_source (priv->track, TRUE);
break;
+
case BRASERO_IMAGE_FORMAT_CUE:
case BRASERO_IMAGE_FORMAT_CDRDAO:
case BRASERO_IMAGE_FORMAT_CLONE:
- path = g_filename_from_uri (toc?toc:image, NULL, NULL);
- if (!path)
- path = g_uri_unescape_string (toc?toc:image, NULL);
+ uri = brasero_track_image_get_source (priv->track, TRUE);
break;
+
default:
+ path = NULL;
break;
}
+ file = g_file_new_for_uri (uri);
+ g_free (uri);
+
+ if (g_file_is_native (file)) {
+ path = g_file_get_path (file);
+ if (!path)
+ path = g_file_get_uri (file);
+ }
+ else
+ path = g_file_get_uri (file);
+
+ g_object_unref (file);
+
if (!path) {
g_free (size_string);
return;
@@ -252,6 +227,28 @@
}
static void
+brasero_src_image_set_track (BraseroSrcImage *dialog,
+ BraseroImageFormat format,
+ const gchar *image,
+ const gchar *toc)
+{
+ BraseroSrcImagePrivate *priv;
+
+ priv = BRASERO_SRC_IMAGE_PRIVATE (dialog);
+
+ /* set image type before adding so that signal has the right type */
+ brasero_track_image_set_source (priv->track,
+ image,
+ toc,
+ format);
+
+ if (!toc && !image && format == BRASERO_IMAGE_FORMAT_NONE)
+ return;
+
+ brasero_src_image_update (dialog);
+}
+
+static void
brasero_src_image_error (BraseroSrcImage *self,
GError *error)
{
@@ -262,16 +259,49 @@
}
static void
-brasero_src_image_image_info_cb (GObject *object,
- GError *error,
- const gchar *uri,
- GFileInfo *info,
- gpointer null_data)
+brasero_src_image_check_parent_directory_cb (GObject *object,
+ GAsyncResult *result,
+ gpointer data)
{
- BraseroSrcImage *dialog = BRASERO_SRC_IMAGE (object);
BraseroSrcImagePrivate *priv;
- BraseroImageFormat format;
+ GConfClient *client;
+ GFileInfo *info;
+
+ priv = BRASERO_SRC_IMAGE_PRIVATE (data);
+
+ info = g_file_query_info_finish (G_FILE (object), result, NULL);
+ if (!info)
+ return;
+
+ if (g_file_info_get_file_type (info) != G_FILE_TYPE_DIRECTORY)
+ return;
+
+ g_free (priv->folder);
+ priv->folder = g_file_get_uri (G_FILE (object));
+
+ client = gconf_client_get_default ();
+ gconf_client_set_string (client,
+ BRASERO_KEY_ISO_DIRECTORY,
+ priv->folder? priv->folder:"",
+ NULL);
+ g_object_unref (client);
+
+}
+
+static void
+brasero_src_image_get_info_cb (GObject *object,
+ GAsyncResult *result,
+ gpointer data)
+{
+ BraseroSrcImage *dialog = BRASERO_SRC_IMAGE (data);
+ BraseroSrcImagePrivate *priv;
+ GError *error = NULL;
const gchar *mime;
+ GFileInfo *info;
+ gchar *uri;
+
+ info = g_file_query_info_finish (G_FILE (object), result, &error);
+ uri = g_file_get_uri (G_FILE (object));
priv = BRASERO_SRC_IMAGE_PRIVATE (dialog);
if (error) {
@@ -282,44 +312,10 @@
/* we need to say that image can't be loaded */
brasero_src_image_error (dialog, error);
+ g_error_free (error);
return;
}
- if (priv->format) {
- brasero_image_type_chooser_get_format (BRASERO_IMAGE_TYPE_CHOOSER (priv->format), &format);
- switch (format) {
- /* Respect the user's choice regarding format */
- case BRASERO_IMAGE_FORMAT_BIN:
- brasero_src_image_set_track (dialog,
- format,
- uri,
- NULL);
- return;
- case BRASERO_IMAGE_FORMAT_CUE:
- brasero_src_image_set_track (dialog,
- format,
- NULL,
- uri);
- return;
- case BRASERO_IMAGE_FORMAT_CDRDAO:
- brasero_src_image_set_track (dialog,
- format,
- NULL,
- uri);
- return;
- case BRASERO_IMAGE_FORMAT_CLONE:
- brasero_src_image_set_track (dialog,
- format,
- NULL,
- uri);
- return;
-
- /* handle those cases afterwards */
- default:
- break;
- }
- }
-
mime = g_file_info_get_content_type (info);
if (mime
&& (!strcmp (mime, "application/x-toc")
@@ -378,61 +374,16 @@
BRASERO_IMAGE_FORMAT_NONE,
uri,
NULL);
-}
-
-static void
-brasero_src_image_folder_cb (GObject *object,
- GError *error,
- const gchar *uri,
- GFileInfo *info,
- gpointer data_update_folder)
-{
- BraseroSrcImagePrivate *priv;
- gboolean update_on_error;
- GConfClient *client;
-
- priv = BRASERO_SRC_IMAGE_PRIVATE (object);
-
- update_on_error = GPOINTER_TO_INT (data_update_folder);
-
- if (error) {
- if (!update_on_error)
- return;
-
- g_free (priv->folder);
- priv->folder = NULL;
- goto update_gconf;
- }
-
- if (g_file_info_get_file_type (info) != G_FILE_TYPE_DIRECTORY) {
- if (!update_on_error)
- return;
-
- g_free (priv->folder);
- priv->folder = NULL;
- goto update_gconf;
- }
-
- g_free (priv->folder);
- priv->folder = g_strdup (uri);
-
-update_gconf:
-
- client = gconf_client_get_default ();
- gconf_client_set_string (client,
- BRASERO_KEY_ISO_DIRECTORY,
- priv->folder? priv->folder:"",
- NULL);
- g_object_unref (client);
+ g_object_unref (info);
}
static void
brasero_src_image_get_format (BraseroSrcImage *dialog,
- const gchar *uri,
- gboolean type)
+ const gchar *uri)
{
BraseroSrcImagePrivate *priv;
+ GFile *file;
priv = BRASERO_SRC_IMAGE_PRIVATE (dialog);
@@ -444,69 +395,87 @@
return;
}
- if (!priv->io)
- priv->io = brasero_io_get_default ();
+ if (priv->format) {
+ BraseroImageFormat format;
+
+ /* NOTE: this is only used when a GtkFileChooser has been
+ * spawned */
+ brasero_image_type_chooser_get_format (BRASERO_IMAGE_TYPE_CHOOSER (priv->format), &format);
+ switch (format) {
+ /* Respect the user's choice regarding format */
+ case BRASERO_IMAGE_FORMAT_BIN:
+ brasero_src_image_set_track (dialog,
+ format,
+ uri,
+ NULL);
+ return;
+ case BRASERO_IMAGE_FORMAT_CUE:
+ brasero_src_image_set_track (dialog,
+ format,
+ NULL,
+ uri);
+ return;
+ case BRASERO_IMAGE_FORMAT_CDRDAO:
+ brasero_src_image_set_track (dialog,
+ format,
+ NULL,
+ uri);
+ return;
+ case BRASERO_IMAGE_FORMAT_CLONE:
+ brasero_src_image_set_track (dialog,
+ format,
+ NULL,
+ uri);
+ return;
+
+ /* handle those cases afterwards */
+ default:
+ break;
+ }
+ }
- if (!priv->info_type)
- priv->info_type = brasero_io_register (G_OBJECT (dialog),
- brasero_src_image_image_info_cb,
- NULL,
- NULL);
-
- brasero_io_get_file_info (priv->io,
- uri,
- priv->info_type,
- type? BRASERO_IO_INFO_MIME:BRASERO_IO_INFO_NONE,
- NULL);
+ file = g_file_new_for_uri (uri);
+ g_file_query_info_async (file,
+ G_FILE_ATTRIBUTE_STANDARD_TYPE ","
+ G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE,
+ G_FILE_QUERY_INFO_NONE,
+ 0,
+ priv->cancel,
+ brasero_src_image_get_info_cb,
+ dialog);
+ g_object_unref (file);
}
static void
brasero_src_image_changed (BraseroSrcImage *dialog)
{
gchar *uri;
- gchar *parent;
- BraseroImageFormat format;
+ GFile *file;
+ GFile *parent;
BraseroSrcImagePrivate *priv;
priv = BRASERO_SRC_IMAGE_PRIVATE (dialog);
- uri = gtk_file_chooser_get_uri (GTK_FILE_CHOOSER (priv->file));
- brasero_image_type_chooser_get_format (BRASERO_IMAGE_TYPE_CHOOSER (priv->format), &format);
-
- switch (format) {
- case BRASERO_IMAGE_FORMAT_NONE:
- brasero_src_image_get_format (dialog, uri, TRUE);
- break;
-
- /* for the following we only need the size */
- case BRASERO_IMAGE_FORMAT_BIN:
- case BRASERO_IMAGE_FORMAT_CUE:
- case BRASERO_IMAGE_FORMAT_CDRDAO:
- case BRASERO_IMAGE_FORMAT_CLONE:
- brasero_src_image_get_format (dialog, uri, TRUE);
- break;
+ /* Cancel any pending operation */
+ g_cancellable_cancel (priv->cancel);
+ g_cancellable_reset (priv->cancel);
- default:
- break;
- }
+ uri = gtk_file_chooser_get_uri (GTK_FILE_CHOOSER (priv->file));
+ brasero_src_image_get_format (dialog, uri);
- /* This is to save the parent folder location for next time */
- if (!priv->io)
- priv->io = brasero_io_get_default ();
-
- if (!priv->folder_type)
- priv->folder_type = brasero_io_register (G_OBJECT (dialog),
- brasero_src_image_folder_cb,
- NULL,
- NULL);
-
- parent = g_path_get_dirname (uri);
- brasero_io_get_file_info (priv->io,
- parent,
- priv->folder_type,
- BRASERO_IO_INFO_NONE,
- GINT_TO_POINTER (FALSE));
- g_free (parent);
+ /* Make sure it's still a valid folder */
+ file = g_file_new_for_uri (uri);
+ parent = g_file_get_parent (file);
+ g_object_unref (file);
+
+ g_file_query_info_async (parent,
+ G_FILE_ATTRIBUTE_STANDARD_TYPE,
+ G_FILE_QUERY_INFO_NONE,
+ 0,
+ priv->cancel,
+ brasero_src_image_check_parent_directory_cb,
+ dialog);
+ g_object_unref (parent);
}
static void
@@ -573,16 +542,15 @@
gtk_file_chooser_set_local_only (GTK_FILE_CHOOSER (priv->file), FALSE);
- /* if we haven't been able to get the saved parent folder type, give up */
- if (priv->folder_type)
- brasero_io_cancel_by_base (priv->io, priv->folder_type);
-
if (priv->folder) {
if (!gtk_file_chooser_set_current_folder_uri (GTK_FILE_CHOOSER (priv->file), priv->folder))
gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (priv->file), g_get_home_dir ());
}
- else
+ else {
+ /* if we haven't been able to get the saved parent folder type, give up */
+ g_cancellable_cancel (priv->cancel);
gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (priv->file), g_get_home_dir ());
+ }
filter = gtk_file_filter_new ();
gtk_file_filter_set_name (filter, _("All files"));
@@ -633,21 +601,36 @@
priv->format = NULL;
}
-void
-brasero_src_image_set_uri (BraseroSrcImage *self,
- const gchar *uri)
+static void
+brasero_src_image_set_parent_directory (GObject *object,
+ GAsyncResult *result,
+ gpointer data)
{
BraseroSrcImagePrivate *priv;
+ GConfClient *client;
+ GFileInfo *info;
- priv = BRASERO_SRC_IMAGE_PRIVATE (self);
+ priv = BRASERO_SRC_IMAGE_PRIVATE (data);
+
+ info = g_file_query_info_finish (G_FILE (object), result, NULL);
+ if (!info)
+ goto update_gconf;
+
+ if (g_file_info_get_file_type (info) != G_FILE_TYPE_DIRECTORY)
+ goto update_gconf;
+
+ g_free (priv->folder);
+ priv->folder = g_file_get_uri (G_FILE (object));
+
+update_gconf:
+
+ client = gconf_client_get_default ();
+ gconf_client_set_string (client,
+ BRASERO_KEY_ISO_DIRECTORY,
+ priv->folder? priv->folder:"",
+ NULL);
+ g_object_unref (client);
- if (uri)
- brasero_src_image_get_format (self, uri, TRUE);
- else
- brasero_src_image_set_track (self,
- BRASERO_IMAGE_FORMAT_NONE,
- NULL,
- NULL);
}
static void
@@ -663,6 +646,8 @@
priv = BRASERO_SRC_IMAGE_PRIVATE (object);
+ priv->cancel = g_cancellable_new ();
+
/* Set the parent folder to be used in gtkfilechooser. This has to be
* done now not to delay its creation when it's needed and we need to
* know if the location that was saved is still valid */
@@ -671,20 +656,18 @@
g_object_unref (client);
if (uri && uri [0] != '\0') {
- if (!priv->io)
- priv->io = brasero_io_get_default ();
+ GFile *file;
- if (!priv->folder_type)
- priv->folder_type = brasero_io_register (G_OBJECT (object),
- brasero_src_image_folder_cb,
- NULL,
- NULL);
-
- brasero_io_get_file_info (priv->io,
- uri,
- priv->folder_type,
- BRASERO_IO_INFO_NONE,
- GINT_TO_POINTER (TRUE));
+ /* Make sure it's still a valid folder */
+ file = g_file_new_for_commandline_arg (uri);
+ g_file_query_info_async (file,
+ G_FILE_ATTRIBUTE_STANDARD_TYPE,
+ G_FILE_QUERY_INFO_NONE,
+ 0,
+ priv->cancel,
+ brasero_src_image_set_parent_directory,
+ object);
+ g_object_unref (file);
}
g_free (uri);
@@ -730,25 +713,14 @@
priv->caps = NULL;
}
- if (priv->io) {
- if (priv->info_type) {
- brasero_io_cancel_by_base (priv->io, priv->info_type);
- g_free (priv->info_type);
- priv->info_type = NULL;
- }
-
- if (priv->folder_type) {
- brasero_io_cancel_by_base (priv->io, priv->folder_type);
- g_free (priv->folder_type);
- priv->folder_type = NULL;
- }
-
- g_object_unref (priv->io);
- priv->io = NULL;
+ if (priv->cancel) {
+ g_cancellable_cancel (priv->cancel);
+ g_object_unref (priv->cancel);
+ priv->cancel = NULL;
}
if (priv->track) {
- brasero_track_unref (priv->track);
+ g_object_unref (priv->track);
priv->track = NULL;
}
@@ -760,6 +732,26 @@
G_OBJECT_CLASS (brasero_src_image_parent_class)->finalize (object);
}
+static BraseroTrack *
+_get_session_image_track (BraseroBurnSession *session)
+{
+ BraseroTrack *track;
+ GSList *tracks;
+ guint num;
+
+ tracks = brasero_burn_session_get_tracks (session);
+ num = g_slist_length (tracks);
+
+ if (num != 1)
+ return NULL;
+
+ track = tracks->data;
+ if (BRASERO_IS_TRACK_IMAGE (track))
+ return track;
+
+ return NULL;
+}
+
static void
brasero_src_image_set_property (GObject *object,
guint property_id,
@@ -772,7 +764,11 @@
priv = BRASERO_SRC_IMAGE_PRIVATE (object);
switch (property_id) {
- case PROP_SESSION:
+ case PROP_SESSION: {
+ BraseroTrack *track;
+ gchar *image;
+ gchar *toc;
+
if (priv->session)
g_object_unref (priv->session);
@@ -782,7 +778,37 @@
* it's only set at construct time */
priv->session = session;
g_object_ref (session);
+
+ track = _get_session_image_track (session);
+ if (track) {
+ g_object_ref (track);
+ priv->track = BRASERO_TRACK_IMAGE (track);
+ }
+ else {
+ /* Add our own track */
+ priv->track = brasero_track_image_new ();
+ brasero_burn_session_add_track (priv->session, BRASERO_TRACK (priv->track));
+ }
+
+ /* Make sure everything fits (NOTE: no need to set format yet,
+ * since at that point no GtkFileChooser was opened.) */
+ toc = brasero_track_image_get_toc_source (priv->track, TRUE);
+ image = brasero_track_image_get_source (priv->track, TRUE);
+ if (toc || image) {
+ BraseroTrackType type = { 0, };
+
+ brasero_track_get_track_type (BRASERO_TRACK (priv->track), &type);
+ if (type.subtype.img_format != BRASERO_IMAGE_FORMAT_NONE)
+ brasero_src_image_update (BRASERO_SRC_IMAGE (object));
+ else
+ brasero_src_image_get_format (BRASERO_SRC_IMAGE (object), toc? toc:image);
+
+ g_free (image);
+ g_free (toc);
+ }
+
break;
+ }
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
Modified: trunk/libbrasero-burn/brasero-src-image.h
==============================================================================
--- trunk/libbrasero-burn/brasero-src-image.h (original)
+++ trunk/libbrasero-burn/brasero-src-image.h Sat Mar 28 08:14:58 2009
@@ -60,10 +60,6 @@
GtkWidget *
brasero_src_image_new (BraseroBurnSession *session);
-void
-brasero_src_image_set_uri (BraseroSrcImage *self,
- const gchar *uri);
-
G_END_DECLS
#endif /* _BRASERO_SRC_IMAGE_H_ */
Modified: trunk/libbrasero-burn/brasero-src-selection.c
==============================================================================
--- trunk/libbrasero-burn/brasero-src-selection.c (original)
+++ trunk/libbrasero-burn/brasero-src-selection.c Sat Mar 28 08:14:58 2009
@@ -38,10 +38,11 @@
#include "brasero-src-selection.h"
#include "brasero-medium-selection.h"
-#include "brasero-utils.h"
#include "brasero-track.h"
#include "brasero-session.h"
+#include "brasero-track-disc.h"
+
#include "brasero-drive.h"
#include "brasero-volume.h"
@@ -49,7 +50,7 @@
struct _BraseroSrcSelectionPrivate
{
BraseroBurnSession *session;
- BraseroTrack *track;
+ BraseroTrackDisc *track;
};
#define BRASERO_SRC_SELECTION_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), BRASERO_TYPE_SRC_SELECTION, BraseroSrcSelectionPrivate))
@@ -70,26 +71,11 @@
priv = BRASERO_SRC_SELECTION_PRIVATE (selection);
- if (!priv->session)
+ if (!priv->session || !priv->track)
goto chain;
drive = brasero_medium_get_drive (medium);
-
- /* NOTE: don't check for drive == NULL to set the session input type */
- if (priv->track
- && drive == brasero_burn_session_get_src_drive (priv->session))
- goto chain;
-
- if (priv->track)
- brasero_track_unref (priv->track);
-
- priv->track = brasero_track_new (BRASERO_TRACK_TYPE_DISC);
- if (!drive || brasero_drive_is_fake (drive))
- brasero_track_set_drive_source (priv->track, NULL);
- else
- brasero_track_set_drive_source (priv->track, drive);
-
- brasero_burn_session_add_track (priv->session, priv->track);
+ brasero_track_disc_set_drive (priv->track, drive);
chain:
@@ -130,13 +116,33 @@
}
if (priv->track) {
- brasero_track_unref (priv->track);
+ g_object_unref (priv->track);
priv->track = NULL;
}
G_OBJECT_CLASS (brasero_src_selection_parent_class)->finalize (object);
}
+static BraseroTrack *
+_get_session_disc_track (BraseroBurnSession *session)
+{
+ BraseroTrack *track;
+ GSList *tracks;
+ guint num;
+
+ tracks = brasero_burn_session_get_tracks (session);
+ num = g_slist_length (tracks);
+
+ if (num != 1)
+ return NULL;
+
+ track = tracks->data;
+ if (BRASERO_IS_TRACK_DISC (track))
+ return track;
+
+ return NULL;
+}
+
static void
brasero_src_selection_set_property (GObject *object,
guint property_id,
@@ -152,6 +158,8 @@
case PROP_SESSION:
{
BraseroMedium *medium;
+ BraseroDrive *drive;
+ BraseroTrack *track;
session = g_value_get_object (value);
@@ -159,16 +167,28 @@
g_object_ref (session);
if (priv->track)
- brasero_track_unref (priv->track);
+ g_object_unref (priv->track);
+
+ /* See if there was a track set; if so then use it */
+ track = _get_session_disc_track (session);
+ if (track) {
+ priv->track = BRASERO_TRACK_DISC (track);
+ g_object_ref (track);
+ }
+ else {
+ priv->track = brasero_track_disc_new ();
+ brasero_burn_session_add_track (priv->session, BRASERO_TRACK (priv->track));
+ }
- medium = brasero_burn_session_get_src_medium (session);
+ drive = brasero_track_disc_get_drive (priv->track);
+ medium = brasero_drive_get_medium (drive);
if (!medium) {
/* No medium set use set session medium source as the
* one currently active in the selection widget */
medium = brasero_medium_selection_get_active (BRASERO_MEDIUM_SELECTION (object));
brasero_src_selection_medium_changed (BRASERO_MEDIUM_SELECTION (object), medium);
}
- else /* Use the one set in the session */
+ else
brasero_medium_selection_set_active (BRASERO_MEDIUM_SELECTION (object), medium);
break;
Modified: trunk/libbrasero-burn/brasero-track.c
==============================================================================
--- trunk/libbrasero-burn/brasero-track.c (original)
+++ trunk/libbrasero-burn/brasero-track.c Sat Mar 28 08:14:58 2009
@@ -48,104 +48,30 @@
#include "brasero-drive.h"
#include "burn-mkisofs-base.h"
-struct _BraseroTrack {
+typedef struct _BraseroTrackPrivate BraseroTrackPrivate;
+struct _BraseroTrackPrivate
+{
BraseroTrackType type;
- int ref;
-
GHashTable *tags;
gchar *checksum;
BraseroChecksumType checksum_type;
};
-typedef struct {
- BraseroTrack track;
-
- GSList *grafts; /* BraseroGraftPt */
- GSList *excluded; /* list of uris (char*) that are to be always excluded */
- gint64 file_num;
-} BraseroTrackData;
-
-typedef struct {
- BraseroTrack track;
- BraseroDrive *disc;
- guint num;
-} BraseroTrackDisc;
-
-typedef struct {
- BraseroTrack track;
-
- gchar *location;
- BraseroSongInfo *info;
-
- /* mostly used when it's a song not in RAW format */
- gint64 start;
- gint64 end;
- gint64 gap;
-} BraseroTrackAudio;
-
-typedef struct {
- BraseroTrack track;
-
- gchar *image;
- gchar *toc;
-} BraseroTrackImage;
-
-void
-brasero_graft_point_free (BraseroGraftPt *graft)
-{
- if (graft->uri)
- g_free (graft->uri);
-
- g_free (graft->path);
- g_free (graft);
-}
-
-BraseroGraftPt *
-brasero_graft_point_copy (BraseroGraftPt *graft)
-{
- BraseroGraftPt *newgraft;
-
- g_return_val_if_fail (graft != NULL, NULL);
-
- newgraft = g_new0 (BraseroGraftPt, 1);
- newgraft->path = g_strdup (graft->path);
- if (graft->uri)
- newgraft->uri = g_strdup (graft->uri);
-
- return newgraft;
-}
+#define BRASERO_TRACK_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), BRASERO_TYPE_TRACK, BraseroTrackPrivate))
-void
-brasero_song_info_free (BraseroSongInfo *info)
+enum
{
- if (!info)
- return;
-
- g_free (info->title);
- g_free (info->artist);
- g_free (info->composer);
- g_free (info);
-}
+ CHANGED,
-BraseroSongInfo *
-brasero_song_info_copy (BraseroSongInfo *info)
-{
- BraseroSongInfo *copy;
+ LAST_SIGNAL
+};
- if (!info)
- return NULL;
- copy = g_new0 (BraseroSongInfo, 1);
+static guint track_signals[LAST_SIGNAL] = { 0 };
- copy->title = g_strdup (info->title);
- copy->artist = g_strdup (info->artist);
- copy->composer = g_strdup (info->composer);
- copy->isrc = info->isrc;
-
- return copy;
-}
+G_DEFINE_TYPE (BraseroTrack, brasero_track, G_TYPE_OBJECT);
gboolean
brasero_track_type_equal (const BraseroTrackType *type_A,
@@ -170,7 +96,7 @@
return FALSE;
break;
- case BRASERO_TRACK_TYPE_AUDIO:
+ case BRASERO_TRACK_TYPE_STREAM:
if (type_A->subtype.audio_format != type_B->subtype.audio_format)
return FALSE;
break;
@@ -205,7 +131,9 @@
return FALSE;
break;
- case BRASERO_TRACK_TYPE_AUDIO:
+ case BRASERO_TRACK_TYPE_STREAM:
+ if (!(type_A->subtype.img_format & type_B->subtype.img_format))
+ return FALSE;
break;
default:
@@ -215,710 +143,51 @@
return TRUE;
}
-static void
-brasero_track_clean (BraseroTrack *track)
-{
- g_return_if_fail (track != NULL);
-
- if (track->tags) {
- g_hash_table_destroy (track->tags);
- track->tags = NULL;
- }
-
- if (track->type.type == BRASERO_TRACK_TYPE_AUDIO) {
- BraseroTrackAudio *audio = (BraseroTrackAudio *) track;
-
- g_free (audio->location);
- brasero_song_info_free (audio->info);
- }
- else if (track->type.type == BRASERO_TRACK_TYPE_DATA) {
- GSList *iter;
- BraseroGraftPt *graft;
- BraseroTrackData *data = (BraseroTrackData *) track;
-
- for (iter = data->grafts; iter; iter = iter->next) {
- graft = iter->data;
-
- if (graft->uri)
- g_free (graft->uri);
- if (graft->path)
- g_free (graft->path);
-
- g_free (graft);
- }
- g_slist_free (data->grafts);
-
- g_slist_foreach (data->excluded, (GFunc) g_free, NULL);
- g_slist_free (data->excluded);
- }
- else if (track->type.type == BRASERO_TRACK_TYPE_DISC) {
- BraseroTrackDisc *drive = (BraseroTrackDisc *) track;
-
- if (drive->disc)
- g_object_unref (drive->disc);
- }
- else if (track->type.type == BRASERO_TRACK_TYPE_IMAGE) {
- BraseroTrackImage *image = (BraseroTrackImage *) track;
-
- g_free (image->image);
- g_free (image->toc);
- }
-
- g_free (track->checksum);
- memset (track, 0, sizeof (BraseroTrack));
-}
-
-void
-brasero_track_unref (BraseroTrack *track)
-{
- if (!track)
- return;
-
- track->ref--;
-
- if (track->ref >= 1)
- return;
-
- brasero_track_clean (track);
- g_free (track);
-}
-
-BraseroTrack *
-brasero_track_new (BraseroTrackDataType type)
-{
- BraseroTrack *track;
-
- switch (type) {
- case BRASERO_TRACK_TYPE_DATA:
- track = (BraseroTrack *) g_new0 (BraseroTrackAudio, 1);
- break;
- case BRASERO_TRACK_TYPE_DISC:
- track = (BraseroTrack *) g_new0 (BraseroTrackAudio, 1);
- break;
- case BRASERO_TRACK_TYPE_IMAGE:
- track = (BraseroTrack *) g_new0 (BraseroTrackAudio, 1);
- break;
- case BRASERO_TRACK_TYPE_AUDIO:
- track = (BraseroTrack *) g_new0 (BraseroTrackAudio, 1);
- break;
- default:
- return NULL;
- }
-
- track->ref = 1;
- track->type.type = type;
-
- return track;
-}
-
-void
-brasero_track_ref (BraseroTrack *track)
-{
- if (!track)
- return;
-
- track->ref ++;
-}
-
BraseroTrackDataType
-brasero_track_get_type (BraseroTrack *track,
- BraseroTrackType *type)
-{
- if (!track)
- return BRASERO_TRACK_TYPE_NONE;
-
- if (!type)
- return track->type.type;
-
- memcpy (type, &track->type, sizeof (BraseroTrackType));
- if (track->type.type == BRASERO_TRACK_TYPE_DISC) {
- BraseroTrackDisc *disc;
-
- disc = (BraseroTrackDisc *) track;
-
- if (disc->disc) {
- BraseroMedium *medium;
-
- medium = brasero_drive_get_medium (disc->disc);
- type->subtype.media = brasero_medium_get_status (medium);
- }
- else
- type->subtype.media = BRASERO_MEDIUM_NONE;
- }
-
- return track->type.type;
-}
-
-static void
-brasero_track_data_copy (BraseroTrackData *track, BraseroTrackData *copy)
-{
- GSList *iter;
-
- for (iter = track->grafts; iter; iter = iter->next) {
- BraseroGraftPt *graft;
-
- graft = iter->data;
- graft = brasero_graft_point_copy (graft);
- copy->grafts = g_slist_prepend (copy->grafts, graft);
- }
-
- for (iter = track->excluded; iter; iter = iter->next) {
- gchar *excluded;
-
- excluded = iter->data;
- copy->excluded = g_slist_prepend (copy->excluded,
- g_strdup (excluded));
- }
-}
-
-static void
-brasero_track_disc_copy (BraseroTrackDisc *track, BraseroTrackDisc *copy)
+brasero_track_get_track_type (BraseroTrack *track,
+ BraseroTrackType *type)
{
- g_object_ref (track->disc);
- copy->disc = track->disc;
-}
+ BraseroTrackClass *klass;
-static void
-brasero_track_audio_copy (BraseroTrackAudio *track, BraseroTrackAudio *copy)
-{
- copy->gap = track->gap;
- copy->start = track->start;
- copy->location = g_strdup (track->location);
- copy->info = brasero_song_info_copy (track->info);
-}
+ g_return_val_if_fail (BRASERO_IS_TRACK (track), BRASERO_TRACK_TYPE_NONE);
-static void
-brasero_track_image_copy (BraseroTrackImage *track, BraseroTrackImage *copy)
-{
- copy->toc = g_strdup (track->toc);
- copy->image = g_strdup (track->image);
-}
-
-BraseroTrack *
-brasero_track_copy (BraseroTrack *track)
-{
- BraseroTrackType type;
- BraseroTrack *copy;
-
- brasero_track_get_type (track, &type);
- copy = brasero_track_new (type.type);
-
- memcpy (copy, track, sizeof (BraseroTrack));
- if (copy->checksum)
- copy->checksum = g_strdup (copy->checksum);
-
- switch (type.type) {
- case BRASERO_TRACK_TYPE_DATA:
- brasero_track_data_copy ((BraseroTrackData *) track,
- (BraseroTrackData *) copy);
- break;
- case BRASERO_TRACK_TYPE_DISC:
- brasero_track_disc_copy ((BraseroTrackDisc *) track,
- (BraseroTrackDisc *) copy);
- break;
- case BRASERO_TRACK_TYPE_AUDIO:
- brasero_track_audio_copy ((BraseroTrackAudio *) track,
- (BraseroTrackAudio *) copy);
- break;
- case BRASERO_TRACK_TYPE_IMAGE:
- brasero_track_image_copy ((BraseroTrackImage *) track,
- (BraseroTrackImage *) copy);
- break;
- default:
- return track;
- }
-
- return copy;
-}
-
-BraseroBurnResult
-brasero_track_set_drive_source (BraseroTrack *track, BraseroDrive *drive)
-{
- BraseroTrackDisc *disc;
-
- if (track->type.type != BRASERO_TRACK_TYPE_DISC)
- return BRASERO_BURN_NOT_SUPPORTED;
-
- disc = (BraseroTrackDisc *) track;
-
- if (disc->disc)
- g_object_unref (disc->disc);
-
- disc->disc = drive;
-
- if (drive)
- g_object_ref (drive);
-
- return BRASERO_BURN_OK;
-}
-
-BraseroBurnResult
-brasero_track_set_drive_track (BraseroTrack *track,
- guint num)
-{
- BraseroTrackDisc *disc;
-
- if (track->type.type != BRASERO_TRACK_TYPE_DISC)
- return BRASERO_BURN_NOT_SUPPORTED;
-
- disc = (BraseroTrackDisc *) track;
- disc->num = num;
+ klass = BRASERO_TRACK_GET_CLASS (track);
+ if (!klass->get_type)
+ return BRASERO_TRACK_TYPE_NONE;
- return BRASERO_BURN_OK;
+ return klass->get_type (track, type);
}
BraseroBurnResult
-brasero_track_set_audio_source (BraseroTrack *track,
- const gchar *uri,
- BraseroAudioFormat format)
+brasero_track_get_size (BraseroTrack *track,
+ guint64 *blocks,
+ guint64 *size)
{
- BraseroTrackAudio *audio;
+ BraseroBurnResult res;
+ BraseroTrackClass *klass;
+ guint64 blocks_local = 0;
+ guint block_size_local = 0;
- if (track->type.type != BRASERO_TRACK_TYPE_AUDIO)
- return BRASERO_BURN_NOT_SUPPORTED;
+ g_return_val_if_fail (BRASERO_IS_TRACK (track), BRASERO_TRACK_TYPE_NONE);
- audio = (BraseroTrackAudio *) track;
-
- if (audio->location)
- g_free (audio->location);
-
- if (format == BRASERO_AUDIO_FORMAT_NONE) {
- if (uri)
- BRASERO_BURN_LOG ("Setting a NONE audio format with a valid uri");
-
- track->type.subtype.audio_format = format;
- audio->location = NULL;
+ klass = BRASERO_TRACK_GET_CLASS (track);
+ if (!klass->get_size)
return BRASERO_BURN_OK;
- }
-
- track->type.subtype.audio_format = format;
- audio->location = g_strdup (uri);
-
- return BRASERO_BURN_OK;
-}
-
-BraseroBurnResult
-brasero_track_set_audio_info (BraseroTrack *track,
- BraseroSongInfo *info)
-{
- BraseroTrackAudio *audio;
-
- if (track->type.type != BRASERO_TRACK_TYPE_AUDIO)
- return BRASERO_BURN_NOT_SUPPORTED;
-
- audio = (BraseroTrackAudio *) track;
-
- if (audio->info)
- brasero_song_info_free (audio->info);
-
- audio->info = info;
- return BRASERO_BURN_OK;
-}
-
-BraseroBurnResult
-brasero_track_set_audio_boundaries (BraseroTrack *track,
- gint64 start,
- gint64 end,
- gint64 gap)
-{
- BraseroTrackAudio *audio;
-
- if (track->type.type != BRASERO_TRACK_TYPE_AUDIO)
- return BRASERO_BURN_NOT_SUPPORTED;
-
- audio = (BraseroTrackAudio *) track;
-
- if (gap >= 0)
- audio->gap = gap;
-
- if (end > 0)
- audio->end = end;
-
- if (start >= 0)
- audio->start = start;
- return BRASERO_BURN_OK;
-}
-
-BraseroBurnResult
-brasero_track_set_data_source (BraseroTrack *track,
- GSList *grafts,
- GSList *unreadable)
-{
- BraseroTrackData *data;
-
- if (track->type.type != BRASERO_TRACK_TYPE_DATA)
- return BRASERO_BURN_NOT_SUPPORTED;
-
- data = (BraseroTrackData *) track;
-
- if (data->grafts) {
- g_slist_foreach (data->grafts, (GFunc) brasero_graft_point_free, NULL);
- g_slist_free (data->grafts);
- }
-
- if (data->excluded) {
- g_slist_foreach (data->excluded, (GFunc) g_free, NULL);
- g_slist_free (data->excluded);
- }
-
- data->grafts = grafts;
- data->excluded = unreadable;
- return BRASERO_BURN_OK;
-}
-
-BraseroBurnResult
-brasero_track_add_data_fs (BraseroTrack *track,
- BraseroImageFS fstype)
-{
- if (track->type.type != BRASERO_TRACK_TYPE_DATA)
- return BRASERO_BURN_NOT_SUPPORTED;
-
- fstype |= track->type.subtype.fs_type;
- track->type.subtype.fs_type = fstype;
-
- return BRASERO_BURN_OK;
-}
-
-BraseroBurnResult
-brasero_track_unset_data_fs (BraseroTrack *track,
- BraseroImageFS fstype)
-{
- BraseroImageFS fstypes;
-
- if (track->type.type != BRASERO_TRACK_TYPE_DATA)
- return BRASERO_BURN_NOT_SUPPORTED;
+ res = klass->get_size (track, &blocks_local, &block_size_local);
+ if (res != BRASERO_BURN_OK)
+ return res;
- fstypes = track->type.subtype.fs_type;
- fstypes &= ~fstype;
- track->type.subtype.fs_type = fstypes;
+ if (blocks)
+ *blocks = blocks_local;
- return BRASERO_BURN_OK;
-}
+ if (size)
+ *size = blocks_local * block_size_local;
-BraseroBurnResult
-brasero_track_set_data_file_num (BraseroTrack *track,
- gint64 number)
-{
- BraseroTrackData *data;
-
- if (track->type.type != BRASERO_TRACK_TYPE_DATA)
- return BRASERO_BURN_NOT_SUPPORTED;
-
- data = (BraseroTrackData *) track;
- data->file_num = number;
- return BRASERO_BURN_OK;
-}
-
-BraseroBurnResult
-brasero_track_set_image_source (BraseroTrack *track,
- const gchar *path,
- const gchar *toc,
- BraseroImageFormat format)
-{
- BraseroTrackImage *image;
-
- if (track->type.type != BRASERO_TRACK_TYPE_IMAGE)
- return BRASERO_BURN_NOT_SUPPORTED;
-
- track->type.subtype.img_format = format;
-
- image = (BraseroTrackImage *) track;
-
- if (image->image)
- g_free (image->image);
-
- if (image->toc)
- g_free (image->toc);
-
- image->image = g_strdup (path);
- image->toc = g_strdup (toc);
return BRASERO_BURN_OK;
}
/**
- * Used to retrieve the data
- */
-
-static gchar *
-brasero_track_get_localpath (const gchar *uri)
-{
- gchar *localpath;
- gchar *realuri;
- GFile *file;
-
- if (!uri)
- return NULL;
-
- if (uri [0] == '/')
- return g_strdup (uri);
-
- if (strncmp (uri, "file://", 7))
- return NULL;
-
- file = g_file_new_for_commandline_arg (uri);
- realuri = g_file_get_uri (file);
- g_object_unref (file);
-
- localpath = g_filename_from_uri (realuri, NULL, NULL);
- g_free (realuri);
-
- return localpath;
-}
-
-static gchar *
-brasero_track_get_uri (const gchar *uri)
-{
- gchar *uri_return;
- GFile *file;
-
- if (!uri)
- return NULL;
-
- if (uri [0] != '/')
- return g_strdup (uri);
-
- file = g_file_new_for_commandline_arg (uri);
- uri_return = g_file_get_uri (file);
- g_object_unref (file);
-
- return uri_return;
-}
-
-gchar *
-brasero_track_get_audio_source (BraseroTrack *track, gboolean uri)
-{
- BraseroTrackAudio *audio;
-
- if (track->type.type != BRASERO_TRACK_TYPE_AUDIO)
- return NULL;
-
- audio = (BraseroTrackAudio *) track;
- if (uri)
- return brasero_track_get_uri (audio->location);
- else
- return brasero_track_get_localpath (audio->location);
-}
-
-gint64
-brasero_track_get_audio_gap (BraseroTrack *track)
-{
- BraseroTrackAudio *audio;
-
- if (track->type.type != BRASERO_TRACK_TYPE_AUDIO)
- return -1;
-
- audio = (BraseroTrackAudio *) track;
- return audio->gap;
-}
-
-gint64
-brasero_track_get_audio_start (BraseroTrack *track)
-{
- BraseroTrackAudio *audio;
-
- if (track->type.type != BRASERO_TRACK_TYPE_AUDIO)
- return -1;
-
- audio = (BraseroTrackAudio *) track;
- return audio->start;
-}
-
-gint64
-brasero_track_get_audio_end (BraseroTrack *track)
-{
- BraseroTrackAudio *audio;
-
- if (track->type.type != BRASERO_TRACK_TYPE_AUDIO)
- return -1;
-
- audio = (BraseroTrackAudio *) track;
- return audio->end;
-}
-
-BraseroSongInfo *
-brasero_track_get_audio_info (BraseroTrack *track)
-{
- BraseroTrackAudio *audio;
-
- if (track->type.type != BRASERO_TRACK_TYPE_AUDIO)
- return NULL;
-
- audio = (BraseroTrackAudio *) track;
- return audio->info;
-}
-
-GSList *
-brasero_track_get_data_grafts_source (BraseroTrack *track)
-{
- BraseroTrackData *data;
-
- g_return_val_if_fail (track != NULL, NULL);
- if (track->type.type != BRASERO_TRACK_TYPE_DATA)
- return NULL;
-
- data = (BraseroTrackData *) track;
- return data->grafts;
-}
-
-GSList *
-brasero_track_get_data_excluded_source (BraseroTrack *track,
- gboolean copy)
-{
- BraseroTrackData *data;
- GSList *retval = NULL;
- GSList *iter;
-
- if (track->type.type != BRASERO_TRACK_TYPE_DATA)
- return NULL;
-
- data = (BraseroTrackData *) track;
- if (!copy)
- return data->excluded;
-
- for (iter = data->excluded; iter; iter = iter->next) {
- gchar *uri;
-
- uri = iter->data;
- retval = g_slist_prepend (retval, g_strdup (uri));
- }
-
- return retval;
-}
-
-BraseroBurnResult
-brasero_track_get_data_paths (BraseroTrack *track,
- gboolean use_joliet,
- const gchar *grafts_path,
- const gchar *excluded_path,
- const gchar *emptydir,
- const gchar *videodir,
- GError **error)
-{
- BraseroBurnResult result;
- BraseroTrackData *data;
-
- if (track->type.type != BRASERO_TRACK_TYPE_DATA)
- return BRASERO_BURN_ERR;
-
- data = (BraseroTrackData *) track;
- result = brasero_mkisofs_base_write_to_files (data->grafts,
- data->excluded,
- use_joliet,
- emptydir,
- videodir,
- grafts_path,
- excluded_path,
- error);
-
- return result;
-}
-
-BraseroDrive *
-brasero_track_get_drive_source (BraseroTrack *track)
-{
- BraseroTrackDisc *drive;
-
- if (track->type.type != BRASERO_TRACK_TYPE_DISC)
- return NULL;
-
- drive = (BraseroTrackDisc *) track;
-
- return drive->disc;
-}
-
-BraseroMedium *
-brasero_track_get_medium_source (BraseroTrack *track)
-{
- BraseroTrackDisc *drive;
-
- if (track->type.type != BRASERO_TRACK_TYPE_DISC)
- return NULL;
-
- drive = (BraseroTrackDisc *) track;
-
- return brasero_drive_get_medium (drive->disc);
-}
-
-gint
-brasero_track_get_drive_track (BraseroTrack *track)
-{
- BraseroTrackDisc *drive;
-
- if (track->type.type != BRASERO_TRACK_TYPE_DISC)
- return -1;
-
- drive = (BraseroTrackDisc *) track;
-
- return drive->num;
-}
-
-/** FIXME: this function is actually flawed since for cue/toc files it could
- ** return several data files. Fortunately there is usually only one. */
-
-gchar *
-brasero_track_get_image_source (BraseroTrack *track, gboolean uri)
-{
- BraseroTrackImage *image;
-
- if (track->type.type != BRASERO_TRACK_TYPE_IMAGE)
- return NULL;
-
- image = (BraseroTrackImage *) track;
-
- if (!image->image) {
- gchar *complement;
- gchar *retval;
- gchar *toc;
-
- if (!image->toc) {
- BRASERO_BURN_LOG ("Image nor toc were set");
- return NULL;
- }
-
- toc = brasero_track_get_localpath (image->toc);
- complement = brasero_image_format_get_complement (track->type.subtype.img_format, toc);
- g_free (toc);
-
- if (!complement) {
- BRASERO_BURN_LOG ("No complement could be retrieved");
- return NULL;
- }
-
- BRASERO_BURN_LOG ("Complement file retrieved %s", complement);
- if (uri)
- retval = brasero_track_get_uri (complement);
- else
- retval = brasero_track_get_localpath (complement);
-
- g_free (complement);
- return retval;
- }
-
- if (uri)
- return brasero_track_get_uri (image->image);
- else
- return brasero_track_get_localpath (image->image);
-}
-
-gchar *
-brasero_track_get_toc_source (BraseroTrack *track, gboolean uri)
-{
- BraseroTrackImage *image;
-
- if (track->type.type != BRASERO_TRACK_TYPE_IMAGE)
- return NULL;
-
- image = (BraseroTrackImage *) track;
-
- /* Don't use file complement retrieval here as it's not possible */
- if (uri)
- return brasero_track_get_uri (image->toc);
- else
- return brasero_track_get_localpath (image->toc);
-}
-
-/**
*
*/
@@ -928,20 +197,24 @@
const gchar *checksum)
{
BraseroBurnResult result = BRASERO_BURN_OK;
+ BraseroTrackPrivate *priv;
- if (type == track->checksum_type
+ g_return_val_if_fail (BRASERO_IS_TRACK (track), BRASERO_CHECKSUM_NONE);
+ priv = BRASERO_TRACK_PRIVATE (track);
+
+ if (type == priv->checksum_type
&& (type == BRASERO_CHECKSUM_MD5 || type == BRASERO_CHECKSUM_SHA1 || type == BRASERO_CHECKSUM_SHA256)
- && checksum && strcmp (checksum, track->checksum))
+ && checksum && strcmp (checksum, priv->checksum))
result = BRASERO_BURN_ERR;
- if (track->checksum)
- g_free (track->checksum);
+ if (priv->checksum)
+ g_free (priv->checksum);
- track->checksum_type = type;
+ priv->checksum_type = type;
if (checksum)
- track->checksum = g_strdup (checksum);
+ priv->checksum = g_strdup (checksum);
else
- track->checksum = NULL;
+ priv->checksum = NULL;
return result;
}
@@ -949,188 +222,23 @@
const gchar *
brasero_track_get_checksum (BraseroTrack *track)
{
- return track->checksum ? track->checksum : "";
-}
-
-BraseroChecksumType
-brasero_track_get_checksum_type (BraseroTrack *track)
-{
- return track->checksum_type;
-}
-
-/**
- * This function is merely a wrapper
- */
-
-BraseroBurnResult
-brasero_track_get_disc_capacity (BraseroTrack *track,
- gint64 *blocks,
- gint64 *size)
-{
- BraseroDrive *drive;
- BraseroMedium *medium;
-
- drive = brasero_track_get_drive_source (track);
- if (!drive)
- return BRASERO_BURN_ERR;
-
- medium = brasero_drive_get_medium (drive);
- brasero_medium_get_capacity (medium, size, blocks);
- return BRASERO_BURN_OK;
-}
-
-BraseroBurnResult
-brasero_track_get_disc_data_size (BraseroTrack *track,
- gint64 *blocks,
- gint64 *size)
-{
- BraseroDrive *drive;
- BraseroMedium *medium;
-
- drive = brasero_track_get_drive_source (track);
- if (!drive)
- return BRASERO_BURN_ERR;
-
- medium = brasero_drive_get_medium (drive);
- brasero_medium_get_data_size (medium, size, blocks);
- return BRASERO_BURN_OK;
-}
-
-BraseroBurnResult
-brasero_track_get_disc_free_space (BraseroTrack *track,
- gint64 *blocks,
- gint64 *size)
-{
- BraseroDrive *drive;
- BraseroMedium *medium;
-
- drive = brasero_track_get_drive_source (track);
- if (!drive)
- return BRASERO_BURN_ERR;
-
- medium = brasero_drive_get_medium (drive);
- brasero_medium_get_free_space (medium, size, blocks);
- return BRASERO_BURN_OK;
-}
-
-BraseroBurnResult
-brasero_track_get_image_size (BraseroTrack *track,
- gint64 *block_size,
- gint64 *blocks,
- gint64 *size,
- GError **error)
-{
- BraseroTrackImage *image;
-
- if (track->type.type != BRASERO_TRACK_TYPE_IMAGE)
- return BRASERO_BURN_ERR;
-
- image = (BraseroTrackImage *) track;
-
- /* Convenience function */
- if (track->type.subtype.img_format == BRASERO_IMAGE_FORMAT_BIN) {
- gchar *uri;
-
- if (!image->image)
- return BRASERO_BURN_ERR;
-
- uri = brasero_track_get_uri (image->image);
-
- if (!brasero_image_format_get_iso_size (uri, blocks, size, error)) {
- g_free (uri);
- return BRASERO_BURN_ERR;
- }
- g_free (uri);
-
- if (block_size)
- *block_size = 2048;
- }
- else if (track->type.subtype.img_format == BRASERO_IMAGE_FORMAT_CLONE) {
- gchar *uri;
-
- uri = brasero_track_get_image_source (track, TRUE);
-
- if (!uri)
- return BRASERO_BURN_ERR;
-
- if (!brasero_image_format_get_clone_size (uri, blocks, size, error)) {
- g_free (uri);
- return BRASERO_BURN_ERR;
- }
- g_free (uri);
-
- if (block_size)
- *block_size = 2448;
- }
- else if (track->type.subtype.img_format == BRASERO_IMAGE_FORMAT_CDRDAO) {
- gchar *uri;
-
- if (!image->toc)
- return BRASERO_BURN_ERR;
-
- uri = brasero_track_get_uri (image->toc);
- if (!brasero_image_format_get_cdrdao_size (uri, blocks, size, error)) {
- g_free (uri);
- return BRASERO_BURN_ERR;
- }
- g_free (uri);
-
- if (block_size)
- *block_size = 2352;
- }
- else if (track->type.subtype.img_format == BRASERO_IMAGE_FORMAT_CUE) {
- gchar *uri;
-
- if (!image->toc)
- return BRASERO_BURN_ERR;
+ BraseroTrackPrivate *priv;
- uri = brasero_track_get_uri (image->toc);
- if (!brasero_image_format_get_cue_size (uri, blocks, size, error)) {
- g_free (uri);
- return BRASERO_BURN_ERR;
- }
- g_free (uri);
+ g_return_val_if_fail (BRASERO_IS_TRACK (track), NULL);
+ priv = BRASERO_TRACK_PRIVATE (track);
- if (block_size)
- *block_size = 2352;
- }
-
- return BRASERO_BURN_OK;
+ return priv->checksum ? priv->checksum : "";
}
-BraseroBurnResult
-brasero_track_get_data_file_num (BraseroTrack *track,
- gint64 *num_files)
-{
- BraseroTrackData *data;
-
- g_return_val_if_fail (num_files != NULL, BRASERO_BURN_ERR);
-
- if (track->type.type != BRASERO_TRACK_TYPE_DATA)
- return BRASERO_BURN_NOT_SUPPORTED;
-
- data = (BraseroTrackData *) track;
- *num_files = data->file_num;
-
- return BRASERO_BURN_OK;
-}
-
-BraseroBurnResult
-brasero_track_get_audio_length (BraseroTrack *track,
- gint64 *length)
+BraseroChecksumType
+brasero_track_get_checksum_type (BraseroTrack *track)
{
- BraseroTrackAudio *audio;
-
- g_return_val_if_fail (length != NULL, BRASERO_BURN_ERR);
-
- audio = (BraseroTrackAudio *) track;
-
- if (audio->start < 0 || audio->end <= 0)
- return BRASERO_BURN_ERR;
+ BraseroTrackPrivate *priv;
- *length = BRASERO_AUDIO_TRACK_LENGTH (audio->start, audio->end + audio->gap);
+ g_return_val_if_fail (BRASERO_IS_TRACK (track), BRASERO_CHECKSUM_NONE);
+ priv = BRASERO_TRACK_PRIVATE (track);
- return BRASERO_BURN_OK;
+ return priv->checksum_type;
}
/**
@@ -1150,12 +258,18 @@
const gchar *tag,
GValue *value)
{
- if (!track->tags)
- track->tags = g_hash_table_new_full (g_str_hash,
- g_str_equal,
- g_free,
- brasero_track_tag_value_free);
- g_hash_table_insert (track->tags,
+ BraseroTrackPrivate *priv;
+
+ g_return_val_if_fail (BRASERO_IS_TRACK (track), BRASERO_BURN_ERR);
+
+ priv = BRASERO_TRACK_PRIVATE (track);
+
+ if (!priv->tags)
+ priv->tags = g_hash_table_new_full (g_str_hash,
+ g_str_equal,
+ g_free,
+ brasero_track_tag_value_free);
+ g_hash_table_insert (priv->tags,
g_strdup (tag),
value);
@@ -1168,11 +282,16 @@
GValue **value)
{
gpointer data;
+ BraseroTrackPrivate *priv;
+
+ g_return_val_if_fail (BRASERO_IS_TRACK (track), BRASERO_BURN_ERR);
+
+ priv = BRASERO_TRACK_PRIVATE (track);
- if (!track->tags)
+ if (!priv->tags)
return BRASERO_BURN_ERR;
- data = g_hash_table_lookup (track->tags, tag);
+ data = g_hash_table_lookup (priv->tags, tag);
if (!data)
return BRASERO_BURN_ERR;
@@ -1182,3 +301,58 @@
return BRASERO_BURN_OK;
}
+void
+brasero_track_changed (BraseroTrack *track)
+{
+ g_signal_emit (track,
+ track_signals [CHANGED],
+ 0);
+}
+
+/**
+ * GObject part
+ */
+
+static void
+brasero_track_init (BraseroTrack *object)
+{ }
+
+static void
+brasero_track_finalize (GObject *object)
+{
+ BraseroTrackPrivate *priv;
+
+ priv = BRASERO_TRACK_PRIVATE (object);
+
+ if (priv->tags) {
+ g_hash_table_destroy (priv->tags);
+ priv->tags = NULL;
+ }
+
+ if (priv->checksum) {
+ g_free (priv->checksum);
+ priv->checksum = NULL;
+ }
+
+ G_OBJECT_CLASS (brasero_track_parent_class)->finalize (object);
+}
+
+static void
+brasero_track_class_init (BraseroTrackClass *klass)
+{
+ GObjectClass* object_class = G_OBJECT_CLASS (klass);
+
+ g_type_class_add_private (klass, sizeof (BraseroTrackPrivate));
+
+ object_class->finalize = brasero_track_finalize;
+
+ track_signals[CHANGED] =
+ g_signal_new ("changed",
+ G_OBJECT_CLASS_TYPE (klass),
+ G_SIGNAL_RUN_FIRST | G_SIGNAL_NO_RECURSE,
+ G_STRUCT_OFFSET (BraseroTrackClass, changed),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0,
+ G_TYPE_NONE);
+}
Modified: trunk/libbrasero-burn/brasero-track.h
==============================================================================
--- trunk/libbrasero-burn/brasero-track.h (original)
+++ trunk/libbrasero-burn/brasero-track.h Sat Mar 28 08:14:58 2009
@@ -32,6 +32,7 @@
#define _BURN_TRACK_H
#include <glib.h>
+#include <glib-object.h>
#include <brasero-drive.h>
#include <brasero-medium.h>
@@ -44,130 +45,19 @@
/* NOTE: the order has a meaning here and is used for sorting */
typedef enum {
BRASERO_TRACK_TYPE_NONE = 0,
- BRASERO_TRACK_TYPE_AUDIO,
+ BRASERO_TRACK_TYPE_STREAM,
BRASERO_TRACK_TYPE_DATA,
BRASERO_TRACK_TYPE_IMAGE,
BRASERO_TRACK_TYPE_DISC,
} BraseroTrackDataType;
-typedef enum {
- BRASERO_IMAGE_FS_NONE = 0,
- BRASERO_IMAGE_FS_ISO = 1,
- BRASERO_IMAGE_FS_UDF = 1 << 1,
- BRASERO_IMAGE_FS_JOLIET = 1 << 2,
- BRASERO_IMAGE_FS_VIDEO = 1 << 3,
-
- /* The following one conflict with UDF and JOLIET */
- BRASERO_IMAGE_FS_SYMLINK = 1 << 4,
-
- BRASERO_IMAGE_ISO_FS_LEVEL_3 = 1 << 5,
- BRASERO_IMAGE_ISO_FS_DEEP_DIRECTORY = 1 << 6,
- BRASERO_IMAGE_FS_ANY = BRASERO_IMAGE_FS_ISO|
- BRASERO_IMAGE_FS_UDF|
- BRASERO_IMAGE_FS_JOLIET|
- BRASERO_IMAGE_FS_SYMLINK|
- BRASERO_IMAGE_ISO_FS_LEVEL_3|
- BRASERO_IMAGE_FS_VIDEO|
- BRASERO_IMAGE_ISO_FS_DEEP_DIRECTORY
-} BraseroImageFS;
-
-typedef enum {
- BRASERO_AUDIO_FORMAT_NONE = 0,
- BRASERO_AUDIO_FORMAT_UNDEFINED = 1,
- BRASERO_AUDIO_FORMAT_4_CHANNEL = 1 << 1,
- BRASERO_AUDIO_FORMAT_RAW = 1 << 2,
- BRASERO_AUDIO_FORMAT_AC3 = 1 << 3,
- BRASERO_AUDIO_FORMAT_MP2 = 1 << 4,
- BRASERO_AUDIO_FORMAT_44100 = 1 << 5,
- BRASERO_AUDIO_FORMAT_48000 = 1 << 6,
- BRASERO_VIDEO_FORMAT_UNDEFINED = 1 << 7,
- BRASERO_VIDEO_FORMAT_VCD = 1 << 8,
- BRASERO_VIDEO_FORMAT_VIDEO_DVD = 1 << 9,
-
- BRASERO_METADATA_INFO = 1 << 10
-} BraseroAudioFormat;
-
-#define BRASERO_AUDIO_CAPS_AUDIO(caps_FORMAT) ((caps_FORMAT) & 0x007F)
-#define BRASERO_AUDIO_CAPS_VIDEO(caps_FORMAT) ((caps_FORMAT) & 0x0380)
-
-typedef enum {
- BRASERO_CHECKSUM_NONE = 0,
- BRASERO_CHECKSUM_DETECT = 1, /* means the plugin handles detection of checksum type */
- BRASERO_CHECKSUM_MD5 = 1 << 1,
- BRASERO_CHECKSUM_MD5_FILE = 1 << 2,
- BRASERO_CHECKSUM_SHA1 = 1 << 3,
- BRASERO_CHECKSUM_SHA1_FILE = 1 << 4,
- BRASERO_CHECKSUM_SHA256 = 1 << 5,
- BRASERO_CHECKSUM_SHA256_FILE = 1 << 6,
-} BraseroChecksumType;
-
-#define BRASERO_MIN_AUDIO_TRACK_LENGTH ((gint64) 6 * 1000000000)
-#define BRASERO_AUDIO_TRACK_LENGTH(start, end) \
- ((end) - (start) > BRASERO_MIN_AUDIO_TRACK_LENGTH) ? \
- ((end) - (start)) : BRASERO_MIN_AUDIO_TRACK_LENGTH
-
-
-typedef enum {
- BRASERO_IMAGE_FORMAT_NONE = 0,
- BRASERO_IMAGE_FORMAT_BIN = 1,
- BRASERO_IMAGE_FORMAT_CUE = 1 << 1,
- BRASERO_IMAGE_FORMAT_CLONE = 1 << 2,
- BRASERO_IMAGE_FORMAT_CDRDAO = 1 << 3,
- BRASERO_IMAGE_FORMAT_ANY = BRASERO_IMAGE_FORMAT_BIN|
- BRASERO_IMAGE_FORMAT_CUE|
- BRASERO_IMAGE_FORMAT_CDRDAO|
- BRASERO_IMAGE_FORMAT_CLONE,
-} BraseroImageFormat;
-
-/**
- *
- */
-
-struct _BraseroGraftPt {
- gchar *uri;
- gchar *path;
-};
-typedef struct _BraseroGraftPt BraseroGraftPt;
-
-void
-brasero_graft_point_free (BraseroGraftPt *graft);
-
-BraseroGraftPt *
-brasero_graft_point_copy (BraseroGraftPt *graft);
-
-/**
- *
- */
-
-struct _BraseroSongInfo {
- gchar *title;
- gchar *artist;
- gchar *composer;
- gint isrc;
-};
-
-typedef struct _BraseroSongInfo BraseroSongInfo;
-
-void
-brasero_song_info_free (BraseroSongInfo *info);
-
-BraseroSongInfo *
-brasero_song_info_copy (BraseroSongInfo *info);
-
-/**
- *
- */
-
-typedef struct _BraseroTrack BraseroTrack;
-
struct _BraseroTrackType {
BraseroTrackDataType type;
union {
BraseroImageFormat img_format; /* used with IMAGE type */
BraseroMedia media; /* used with DISC types */
BraseroImageFS fs_type;
- BraseroAudioFormat audio_format;
- BraseroChecksumType checksum;
+ BraseroStreamFormat audio_format;
} subtype;
};
typedef struct _BraseroTrackType BraseroTrackType;
@@ -175,130 +65,74 @@
BraseroBurnResult
brasero_track_type_is_supported (BraseroTrackType *type);
-
-#define BRASERO_TRACK_TYPE_HAS_VIDEO(type_MACRO) \
- (((type_MACRO)->type == BRASERO_TRACK_TYPE_AUDIO) && \
- ((type_MACRO)->subtype.audio_format & (BRASERO_VIDEO_FORMAT_UNDEFINED| \
- BRASERO_VIDEO_FORMAT_VCD| \
- BRASERO_VIDEO_FORMAT_VIDEO_DVD)))
-
gboolean
brasero_track_type_equal (const BraseroTrackType *type_A,
const BraseroTrackType *type_B);
-/**
- *
- */
-
-BraseroTrack *
-brasero_track_new (BraseroTrackDataType type);
+#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))
+#define BRASERO_IS_TRACK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BRASERO_TYPE_TRACK))
+#define BRASERO_IS_TRACK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BRASERO_TYPE_TRACK))
+#define BRASERO_TRACK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BRASERO_TYPE_TRACK, BraseroTrackClass))
-void
-brasero_track_ref (BraseroTrack *track);
-
-void
-brasero_track_unref (BraseroTrack *track);
-
-BraseroTrackDataType
-brasero_track_get_type (BraseroTrack *track,
- BraseroTrackType *type);
-
-BraseroTrack *
-brasero_track_copy (BraseroTrack *track);
-
-/**
- * Functions to set the track contents
- */
-
-BraseroBurnResult
-brasero_track_set_audio_source (BraseroTrack *track,
- const gchar *uri,
- BraseroAudioFormat format);
+typedef struct _BraseroTrackClass BraseroTrackClass;
+typedef struct _BraseroTrack BraseroTrack;
-BraseroBurnResult
-brasero_track_set_audio_info (BraseroTrack *track,
- BraseroSongInfo *info);
+struct _BraseroTrackClass
+{
+ GObjectClass parent_class;
+
+ /* Virtual functions */
+ BraseroBurnResult (* get_size) (BraseroTrack *track,
+ guint64 *blocks,
+ guint *block_size);
-BraseroBurnResult
-brasero_track_set_audio_boundaries (BraseroTrack *track,
- gint64 start,
- gint64 end,
- gint64 gap);
+ BraseroTrackDataType (* get_type) (BraseroTrack *track,
+ BraseroTrackType *type);
-BraseroBurnResult
-brasero_track_set_data_source (BraseroTrack *track,
- GSList *grafts,
- GSList *unreadable);
-BraseroBurnResult
-brasero_track_add_data_fs (BraseroTrack *track,
- BraseroImageFS fstype);
-BraseroBurnResult
-brasero_track_unset_data_fs (BraseroTrack *track,
- BraseroImageFS fstype);
-BraseroBurnResult
-brasero_track_set_data_file_num (BraseroTrack *track,
- gint64 number);
+ /* Signals */
+ void (* changed) (BraseroTrack *track);
+};
-BraseroBurnResult
-brasero_track_set_drive_source (BraseroTrack *track,
- BraseroDrive *drive);
-BraseroBurnResult
-brasero_track_set_drive_track (BraseroTrack *track,
- guint num);
+struct _BraseroTrack
+{
+ GObject parent_instance;
+};
-BraseroBurnResult
-brasero_track_set_image_source (BraseroTrack *track,
- const gchar *image,
- const gchar *toc,
- BraseroImageFormat format);
+GType brasero_track_get_type (void) G_GNUC_CONST;
/**
- * Function to get the track contents
+ *
*/
-gchar *
-brasero_track_get_audio_source (BraseroTrack *track, gboolean uri);
-gint64
-brasero_track_get_audio_gap (BraseroTrack *track);
-gint64
-brasero_track_get_audio_start (BraseroTrack *track);
-gint64
-brasero_track_get_audio_end (BraseroTrack *track);
-
-BraseroSongInfo *
-brasero_track_get_audio_info (BraseroTrack *track);
-
-BraseroMedium *
-brasero_track_get_medium_source (BraseroTrack *track);
-BraseroDrive *
-brasero_track_get_drive_source (BraseroTrack *track);
-gint
-brasero_track_get_drive_track (BraseroTrack *track);
-
-GSList *
-brasero_track_get_data_grafts_source (BraseroTrack *track);
-GSList *
-brasero_track_get_data_excluded_source (BraseroTrack *track,
- gboolean copy);
+void
+brasero_track_changed (BraseroTrack *track);
BraseroBurnResult
-brasero_track_get_data_paths (BraseroTrack *track,
- gboolean use_joliet,
- const gchar *grafts_path,
- const gchar *excluded_path,
- const gchar *emptydir,
- const gchar *videodir,
- GError **error);
-
-gchar *
-brasero_track_get_image_source (BraseroTrack *track, gboolean uri);
-gchar *
-brasero_track_get_toc_source (BraseroTrack *track, gboolean uri);
+brasero_track_get_size (BraseroTrack *track,
+ guint64 *blocks,
+ guint64 *size);
+
+BraseroTrackDataType
+brasero_track_get_track_type (BraseroTrack *track,
+ BraseroTrackType *type);
/**
- * Allow to set and get some information about a track
+ * Checksums
*/
+typedef enum {
+ BRASERO_CHECKSUM_NONE = 0,
+ BRASERO_CHECKSUM_DETECT = 1, /* means the plugin handles detection of checksum type */
+ BRASERO_CHECKSUM_MD5 = 1 << 1,
+ BRASERO_CHECKSUM_MD5_FILE = 1 << 2,
+ BRASERO_CHECKSUM_SHA1 = 1 << 3,
+ BRASERO_CHECKSUM_SHA1_FILE = 1 << 4,
+ BRASERO_CHECKSUM_SHA256 = 1 << 5,
+ BRASERO_CHECKSUM_SHA256_FILE = 1 << 6,
+} BraseroChecksumType;
+
BraseroBurnResult
brasero_track_set_checksum (BraseroTrack *track,
BraseroChecksumType type,
@@ -311,37 +145,6 @@
brasero_track_get_checksum_type (BraseroTrack *track);
/**
- * These functions are all about sizes
- */
-BraseroBurnResult
-brasero_track_get_disc_capacity (BraseroTrack *track,
- gint64 *blocks,
- gint64 *size);
-BraseroBurnResult
-brasero_track_get_disc_data_size (BraseroTrack *track,
- gint64 *blocks,
- gint64 *size);
-BraseroBurnResult
-brasero_track_get_disc_free_space (BraseroTrack *track,
- gint64 *blocks,
- gint64 *size);
-
-BraseroBurnResult
-brasero_track_get_image_size (BraseroTrack *track,
- gint64 *block_size,
- gint64 *blocks,
- gint64 *size,
- GError **error);
-
-BraseroBurnResult
-brasero_track_get_audio_length (BraseroTrack *track,
- gint64 *length);
-
-BraseroBurnResult
-brasero_track_get_data_file_num (BraseroTrack *track,
- gint64 *num_files);
-
-/**
*
*/
@@ -355,19 +158,6 @@
const gchar *tag,
GValue **value);
-/*
- * Commonly used Tags
- */
-
-#define BRASERO_TRACK_MEDIUM_ADDRESS_START_TAG "track::medium::address::start"
-#define BRASERO_TRACK_MEDIUM_ADDRESS_END_TAG "track::medium::address::end"
-
-/**
- * Array of filenames (on medium) which have a wrong checksum value (G_TYPE_STRV)
- */
-
-#define BRASERO_TRACK_MEDIUM_WRONG_CHECKSUM_TAG "track::medium::error::checksum::list"
-
G_END_DECLS
#endif /* _BURN_TRACK_H */
Modified: trunk/libbrasero-burn/burn-basics.c
==============================================================================
--- trunk/libbrasero-burn/burn-basics.c (original)
+++ trunk/libbrasero-burn/burn-basics.c Sat Mar 28 08:14:58 2009
@@ -89,6 +89,55 @@
return _(strings [action]);
}
+/**
+ * Two utility functions
+ */
+
+gchar *
+brasero_string_get_localpath (const gchar *uri)
+{
+ gchar *localpath;
+ gchar *realuri;
+ GFile *file;
+
+ if (!uri)
+ return NULL;
+
+ if (uri [0] == '/')
+ return g_strdup (uri);
+
+ if (strncmp (uri, "file://", 7))
+ return NULL;
+
+ file = g_file_new_for_commandline_arg (uri);
+ realuri = g_file_get_uri (file);
+ g_object_unref (file);
+
+ localpath = g_filename_from_uri (realuri, NULL, NULL);
+ g_free (realuri);
+
+ return localpath;
+}
+
+gchar *
+brasero_string_get_uri (const gchar *uri)
+{
+ gchar *uri_return;
+ GFile *file;
+
+ if (!uri)
+ return NULL;
+
+ if (uri [0] != '/')
+ return g_strdup (uri);
+
+ file = g_file_new_for_commandline_arg (uri);
+ uri_return = g_file_get_uri (file);
+ g_object_unref (file);
+
+ return uri_return;
+}
+
gboolean
brasero_burn_library_start (void)
{
@@ -97,6 +146,9 @@
BRASERO_MINOR_VERSION,
BRASERO_SUB);
+ /* initialize the media library */
+ brasero_media_library_start ();
+
/* initialize all device list */
if (!medium_manager)
medium_manager = brasero_medium_monitor_get_default ();
Modified: trunk/libbrasero-burn/burn-basics.h
==============================================================================
--- trunk/libbrasero-burn/burn-basics.h (original)
+++ trunk/libbrasero-burn/burn-basics.h Sat Mar 28 08:14:58 2009
@@ -60,6 +60,12 @@
const gchar *
brasero_burn_action_to_string (BraseroBurnAction action);
+gchar *
+brasero_string_get_localpath (const gchar *uri);
+
+gchar *
+brasero_string_get_uri (const gchar *uri);
+
G_END_DECLS
#endif /* _BURN_BASICS_H */
Modified: trunk/libbrasero-burn/burn-caps.c
==============================================================================
--- trunk/libbrasero-burn/burn-caps.c (original)
+++ trunk/libbrasero-burn/burn-caps.c Sat Mar 28 08:14:58 2009
@@ -269,7 +269,7 @@
return FALSE;
break;
- case BRASERO_TRACK_TYPE_AUDIO:
+ 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|
@@ -1504,7 +1504,7 @@
list = NULL;
last_caps = NULL;
- brasero_track_get_type (track, &track_type);
+ brasero_track_get_track_type (track, &track_type);
for (iter = links; iter; iter = iter->next) {
BraseroCapsLink *link;
GSList *plugins;
@@ -2153,7 +2153,7 @@
output.type = BRASERO_TRACK_TYPE_IMAGE;
output.subtype.img_format = BRASERO_IMAGE_FORMAT_NONE;
- if (source.type == BRASERO_TRACK_TYPE_AUDIO) {
+ 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)))
return BRASERO_IMAGE_FORMAT_NONE;
@@ -2435,7 +2435,7 @@
supported_flags &= ~BRASERO_BURN_FLAG_RAW;
if ((supported_flags & BRASERO_BURN_FLAG_DAO)
- && input->type == BRASERO_TRACK_TYPE_AUDIO
+ && input->type == BRASERO_TRACK_TYPE_STREAM
&& (input->subtype.img_format & BRASERO_METADATA_INFO)) {
/* In this case, DAO is compulsory if we want to write CD-TEXT */
compulsory_flags |= BRASERO_BURN_FLAG_DAO;
@@ -2824,7 +2824,7 @@
/* This way BIN subtype is always sorted at the end */
return caps_a->type.subtype.img_format - caps_b->type.subtype.img_format;
- case BRASERO_TRACK_TYPE_AUDIO:
+ 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)
@@ -3148,7 +3148,7 @@
GSList *
brasero_caps_audio_new (BraseroPluginIOFlag flags,
- BraseroAudioFormat format)
+ BraseroStreamFormat format)
{
GSList *iter;
GSList *retval = NULL;
@@ -3156,7 +3156,7 @@
GSList *encompassing = NULL;
gboolean have_the_one = FALSE;
- BRASERO_BURN_LOG_WITH_FULL_TYPE (BRASERO_TRACK_TYPE_AUDIO,
+ BRASERO_BURN_LOG_WITH_FULL_TYPE (BRASERO_TRACK_TYPE_STREAM,
format,
flags,
"New caps required");
@@ -3165,14 +3165,14 @@
for (iter = self->priv->caps_list; iter; iter = iter->next) {
BraseroCaps *caps;
- BraseroAudioFormat common;
+ BraseroStreamFormat common;
BraseroPluginIOFlag common_io;
- BraseroAudioFormat common_audio;
- BraseroAudioFormat common_video;
+ BraseroStreamFormat common_audio;
+ BraseroStreamFormat common_video;
caps = iter->data;
- if (caps->type.type != BRASERO_TRACK_TYPE_AUDIO)
+ if (caps->type.type != BRASERO_TRACK_TYPE_STREAM)
continue;
common_io = (flags & caps->flags);
@@ -3189,19 +3189,19 @@
/* 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_AUDIO_CAPS_AUDIO (caps->type.subtype.audio_format) &
- BRASERO_AUDIO_CAPS_AUDIO (format);
+ common_audio = BRASERO_STREAM_FORMAT_AUDIO (caps->type.subtype.audio_format) &
+ BRASERO_STREAM_FORMAT_AUDIO (format);
if (common_audio == BRASERO_AUDIO_FORMAT_NONE
- && (BRASERO_AUDIO_CAPS_AUDIO (caps->type.subtype.audio_format)
- || BRASERO_AUDIO_CAPS_AUDIO (format)))
+ && (BRASERO_STREAM_FORMAT_AUDIO (caps->type.subtype.audio_format)
+ || BRASERO_STREAM_FORMAT_AUDIO (format)))
continue;
- common_video = BRASERO_AUDIO_CAPS_VIDEO (caps->type.subtype.audio_format) &
- BRASERO_AUDIO_CAPS_VIDEO (format);
+ common_video = BRASERO_STREAM_FORMAT_VIDEO (caps->type.subtype.audio_format) &
+ BRASERO_STREAM_FORMAT_VIDEO (format);
if (common_video == BRASERO_AUDIO_FORMAT_NONE
- && (BRASERO_AUDIO_CAPS_VIDEO (caps->type.subtype.audio_format)
- || BRASERO_AUDIO_CAPS_VIDEO (format)))
+ && (BRASERO_STREAM_FORMAT_VIDEO (caps->type.subtype.audio_format)
+ || BRASERO_STREAM_FORMAT_VIDEO (format)))
continue;
/* Likewise... that must be common */
@@ -3229,7 +3229,7 @@
caps = g_new0 (BraseroCaps, 1);
caps->flags = flags;
caps->type.subtype.audio_format = format;
- caps->type.type = BRASERO_TRACK_TYPE_AUDIO;
+ caps->type.type = BRASERO_TRACK_TYPE_STREAM;
if (encompassing) {
for (iter = encompassing; iter; iter = iter->next) {
@@ -3649,7 +3649,7 @@
caps = iter->data;
if (caps->type.type != BRASERO_TRACK_TYPE_IMAGE
- && caps->type.type != BRASERO_TRACK_TYPE_AUDIO
+ && caps->type.type != BRASERO_TRACK_TYPE_STREAM
&& caps->type.type != BRASERO_TRACK_TYPE_DATA)
continue;
@@ -3691,7 +3691,7 @@
caps = iter->data;
if (caps->type.type != BRASERO_TRACK_TYPE_IMAGE
- && caps->type.type != BRASERO_TRACK_TYPE_AUDIO)
+ && caps->type.type != BRASERO_TRACK_TYPE_STREAM)
continue;
destination = caps->type.type;
Modified: trunk/libbrasero-burn/burn-debug.c
==============================================================================
--- trunk/libbrasero-burn/burn-debug.c (original)
+++ trunk/libbrasero-burn/burn-debug.c Sat Mar 28 08:14:58 2009
@@ -207,7 +207,7 @@
static void
brasero_debug_audio_format_to_string (gchar *buffer,
- BraseroAudioFormat format)
+ BraseroStreamFormat format)
{
if (format & BRASERO_AUDIO_FORMAT_RAW)
strcat (buffer, "RAW ");
@@ -267,7 +267,7 @@
strcpy (buffer, "Disc ");
brasero_media_to_string (subtype, buffer);
break;
- case BRASERO_TRACK_TYPE_AUDIO:
+ case BRASERO_TRACK_TYPE_STREAM:
strcpy (buffer, "Audio ");
brasero_debug_audio_format_to_string (buffer, subtype);
Modified: trunk/libbrasero-burn/burn-image-format.c
==============================================================================
--- trunk/libbrasero-burn/burn-image-format.c (original)
+++ trunk/libbrasero-burn/burn-image-format.c Sat Mar 28 08:14:58 2009
@@ -420,8 +420,8 @@
gboolean
brasero_image_format_get_cdrdao_size (gchar *uri,
- gint64 *sectors,
- gint64 *size_img,
+ guint64 *sectors,
+ guint64 *size_img,
GError **error)
{
GFile *file;
@@ -520,8 +520,8 @@
gboolean
brasero_image_format_get_cue_size (gchar *uri,
- gint64 *blocks,
- gint64 *size_img,
+ guint64 *blocks,
+ guint64 *size_img,
GError **error)
{
GFile *file;
@@ -712,8 +712,8 @@
gboolean
brasero_image_format_get_iso_size (gchar *uri,
- gint64 *blocks,
- gint64 *size_img,
+ guint64 *blocks,
+ guint64 *size_img,
GError **error)
{
GFileInfo *info;
@@ -745,8 +745,8 @@
gboolean
brasero_image_format_get_clone_size (gchar *uri,
- gint64 *blocks,
- gint64 *size_img,
+ guint64 *blocks,
+ guint64 *size_img,
GError **error)
{
GFileInfo *info;
Modified: trunk/libbrasero-burn/burn-image-format.h
==============================================================================
--- trunk/libbrasero-burn/burn-image-format.h (original)
+++ trunk/libbrasero-burn/burn-image-format.h Sat Mar 28 08:14:58 2009
@@ -53,23 +53,23 @@
gboolean
brasero_image_format_get_cdrdao_size (gchar *uri,
- gint64 *sectors,
- gint64 *size_img,
+ guint64 *sectors,
+ guint64 *size_img,
GError **error);
gboolean
brasero_image_format_get_cue_size (gchar *uri,
- gint64 *blocks,
- gint64 *size_img,
+ guint64 *blocks,
+ guint64 *size_img,
GError **error);
gboolean
brasero_image_format_get_iso_size (gchar *uri,
- gint64 *blocks,
- gint64 *size_img,
+ guint64 *blocks,
+ guint64 *size_img,
GError **error);
gboolean
brasero_image_format_get_clone_size (gchar *uri,
- gint64 *blocks,
- gint64 *size_img,
+ guint64 *blocks,
+ guint64 *size_img,
GError **error);
G_END_DECLS
Modified: trunk/libbrasero-burn/burn-job.c
==============================================================================
--- trunk/libbrasero-burn/burn-job.c (original)
+++ trunk/libbrasero-burn/burn-job.c Sat Mar 28 08:14:58 2009
@@ -53,7 +53,7 @@
#include "burn-job.h"
#include "burn-task-ctx.h"
#include "burn-task-item.h"
-#include "brasero-marshal.h"
+#include "libbrasero-marshal.h"
#include "brasero-drive.h"
#include "brasero-medium.h"
@@ -378,7 +378,7 @@
GError **error)
{
BraseroBurnSession *session;
- gint64 output_blocks = 0;
+ guint64 output_blocks = 0;
gint64 media_blocks = 0;
BraseroJobPrivate *priv;
BraseroBurnFlag flags;
@@ -567,7 +567,7 @@
BraseroBurnResult result;
BraseroJobPrivate *priv;
BraseroBurnFlag flags;
- gint64 output_size = 0;
+ guint64 output_size = 0;
gchar *image = NULL;
gchar *toc = NULL;
@@ -669,7 +669,7 @@
image,
toc ? toc : "none");
}
- else if (priv->type.type == BRASERO_TRACK_TYPE_AUDIO) {
+ else if (priv->type.type == BRASERO_TRACK_TYPE_STREAM) {
/* NOTE: this one can only a temporary file */
result = brasero_burn_session_get_tmp_file (session,
".cdr",
@@ -1566,7 +1566,7 @@
}
BraseroBurnResult
-brasero_job_get_last_session_address (BraseroJob *self, gint64 *address)
+brasero_job_get_last_session_address (BraseroJob *self, guint64 *address)
{
BraseroBurnSession *session;
BraseroJobPrivate *priv;
@@ -1588,7 +1588,7 @@
}
BraseroBurnResult
-brasero_job_get_next_writable_address (BraseroJob *self, gint64 *address)
+brasero_job_get_next_writable_address (BraseroJob *self, guint64 *address)
{
BraseroBurnSession *session;
BraseroJobPrivate *priv;
@@ -1789,8 +1789,8 @@
BraseroBurnResult
brasero_job_get_session_output_size (BraseroJob *self,
- gint64 *blocks,
- gint64 *size)
+ guint64 *blocks,
+ guint64 *size)
{
BraseroJobPrivate *priv;
Modified: trunk/libbrasero-burn/burn-job.h
==============================================================================
--- trunk/libbrasero-burn/burn-job.h (original)
+++ trunk/libbrasero-burn/burn-job.h Sat Mar 28 08:14:58 2009
@@ -144,7 +144,7 @@
brasero_job_get_data_label (BraseroJob *job, gchar **label);
BraseroBurnResult
-brasero_job_get_session_output_size (BraseroJob *job, gint64 *blocks, gint64 *size);
+brasero_job_get_session_output_size (BraseroJob *job, guint64 *blocks, guint64 *size);
/**
* Used to get information of the destination media
@@ -163,10 +163,10 @@
brasero_job_get_media (BraseroJob *job, BraseroMedia *media);
BraseroBurnResult
-brasero_job_get_last_session_address (BraseroJob *job, gint64 *address);
+brasero_job_get_last_session_address (BraseroJob *job, guint64 *address);
BraseroBurnResult
-brasero_job_get_next_writable_address (BraseroJob *job, gint64 *address);
+brasero_job_get_next_writable_address (BraseroJob *job, guint64 *address);
BraseroBurnResult
brasero_job_get_rate (BraseroJob *job, guint64 *rate);
Modified: trunk/libbrasero-burn/burn-plugin.h
==============================================================================
--- trunk/libbrasero-burn/burn-plugin.h (original)
+++ trunk/libbrasero-burn/burn-plugin.h Sat Mar 28 08:14:58 2009
@@ -36,6 +36,8 @@
#include "brasero-medium.h"
#include "brasero-track.h"
+#include "brasero-track-stream.h"
+#include "brasero-track-data.h"
#include "brasero-enums.h"
G_BEGIN_DECLS
@@ -128,7 +130,7 @@
GSList *
brasero_caps_audio_new (BraseroPluginIOFlag flags,
- BraseroAudioFormat format);
+ BraseroStreamFormat format);
GSList *
brasero_caps_data_new (BraseroImageFS fs_type);
Modified: trunk/libbrasero-burn/burn-process.c
==============================================================================
--- trunk/libbrasero-burn/burn-process.c (original)
+++ trunk/libbrasero-burn/burn-process.c Sat Mar 28 08:14:58 2009
@@ -52,6 +52,9 @@
#include "burn-process.h"
#include "burn-job.h"
+#include "brasero-track-stream.h"
+#include "brasero-track-image.h"
+
G_DEFINE_TYPE (BraseroProcess, brasero_process, BRASERO_TYPE_JOB);
enum {
@@ -251,12 +254,12 @@
gchar *toc = NULL;
gchar *image = NULL;
- track = brasero_track_new (BRASERO_TRACK_TYPE_IMAGE);
+ track = BRASERO_TRACK (brasero_track_image_new ());
brasero_job_get_image_output (BRASERO_JOB (self),
&image,
&toc);
- brasero_track_set_image_source (track,
+ brasero_track_image_set_source (BRASERO_TRACK_IMAGE (track),
image,
toc,
type.subtype.img_format);
@@ -264,15 +267,13 @@
g_free (image);
g_free (toc);
}
- else if (type.type == BRASERO_TRACK_TYPE_AUDIO) {
+ else if (type.type == BRASERO_TRACK_TYPE_STREAM) {
gchar *uri = NULL;
- track = brasero_track_new (BRASERO_TRACK_TYPE_AUDIO);
- brasero_job_get_audio_output (BRASERO_JOB (self),
- &uri);
- brasero_track_set_audio_source (track,
- uri,
- type.subtype.audio_format);
+ 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);
g_free (uri);
}
@@ -282,7 +283,7 @@
/* It's good practice to unref the track afterwards as we don't
* need it anymore. BraseroTaskCtx refs it. */
- brasero_track_unref (track);
+ g_object_unref (track);
}
klass->post (BRASERO_JOB (self));
Modified: trunk/libbrasero-burn/burn-task-ctx.c
==============================================================================
--- trunk/libbrasero-burn/burn-task-ctx.c (original)
+++ trunk/libbrasero-burn/burn-task-ctx.c Sat Mar 28 08:14:58 2009
@@ -147,7 +147,7 @@
priv = BRASERO_TASK_CTX_PRIVATE (self);
if (priv->tracks) {
- g_slist_foreach (priv->tracks, (GFunc) brasero_track_unref, NULL);
+ g_slist_foreach (priv->tracks, (GFunc) g_object_unref, NULL);
g_slist_free (priv->tracks);
priv->tracks = NULL;
}
@@ -155,11 +155,11 @@
tracks = brasero_burn_session_get_tracks (priv->session);
BRASERO_BURN_LOG ("Setting current track (%i tracks)", g_slist_length (tracks));
if (priv->current_track)
- brasero_track_unref (priv->current_track);
+ g_object_unref (priv->current_track);
if (tracks) {
priv->current_track = tracks->data;
- brasero_track_ref (priv->current_track);
+ g_object_ref (priv->current_track);
}
else
BRASERO_BURN_LOG ("no tracks");
@@ -276,11 +276,11 @@
priv = BRASERO_TASK_CTX_PRIVATE (self);
BRASERO_BURN_LOG ("Adding track (type = %i) %s",
- brasero_track_get_type (track, NULL),
+ brasero_track_get_track_type (track, NULL),
priv->tracks? "already some tracks":"");
/* Ref the track and store it for later. */
- brasero_track_ref (track);
+ g_object_ref (track);
priv->tracks = g_slist_prepend (priv->tracks, track);
return BRASERO_BURN_OK;
}
@@ -310,10 +310,10 @@
priv->last_written = 0;
if (priv->current_track)
- brasero_track_unref (priv->current_track);
+ g_object_unref (priv->current_track);
priv->current_track = node->next->data;
- brasero_track_ref (priv->current_track);
+ g_object_ref (priv->current_track);
return BRASERO_BURN_RETRY;
}
@@ -378,7 +378,7 @@
/* It's good practice to unref the track afterwards as
* we don't need it anymore. BraseroBurnSession refs it.
*/
- brasero_track_unref (track);
+ g_object_unref (track);
}
g_slist_free (priv->tracks);
@@ -782,8 +782,8 @@
BraseroBurnResult
brasero_task_ctx_get_session_output_size (BraseroTaskCtx *self,
- gint64 *blocks,
- gint64 *size)
+ guint64 *blocks,
+ guint64 *size)
{
BraseroTaskCtxPrivate *priv;
@@ -852,7 +852,7 @@
BraseroTaskCtxPrivate *priv;
gdouble track_num = 0;
gdouble track_nb = 0;
- gint64 total = -1;
+ guint64 total = 0;
priv = BRASERO_TASK_CTX_PRIVATE (self);
@@ -984,12 +984,12 @@
}
if (priv->current_track) {
- brasero_track_unref (priv->current_track);
+ g_object_unref (priv->current_track);
priv->current_track = NULL;
}
if (priv->tracks) {
- g_slist_foreach (priv->tracks, (GFunc) brasero_track_unref, NULL);
+ g_slist_foreach (priv->tracks, (GFunc) g_object_unref, NULL);
g_slist_free (priv->tracks);
priv->tracks = NULL;
}
Modified: trunk/libbrasero-burn/burn-task-ctx.h
==============================================================================
--- trunk/libbrasero-burn/burn-task-ctx.h (original)
+++ trunk/libbrasero-burn/burn-task-ctx.h Sat Mar 28 08:14:58 2009
@@ -186,8 +186,8 @@
long *remaining);
BraseroBurnResult
brasero_task_ctx_get_session_output_size (BraseroTaskCtx *ctx,
- gint64 *blocks,
- gint64 *size);
+ guint64 *blocks,
+ guint64 *size);
BraseroBurnResult
brasero_task_ctx_get_written (BraseroTaskCtx *ctx,
gint64 *written);
Modified: trunk/libbrasero-burn/burn-task.c
==============================================================================
--- trunk/libbrasero-burn/burn-task.c (original)
+++ trunk/libbrasero-burn/burn-task.c Sat Mar 28 08:14:58 2009
@@ -397,38 +397,26 @@
BRASERO_BURN_LOG ("Trying to set a default output size");
brasero_task_ctx_get_current_track (BRASERO_TASK_CTX (self), &track);
- brasero_track_get_type (track, &input);
+ brasero_track_get_track_type (track, &input);
BRASERO_BURN_LOG_TYPE (&input, "Track type");
- if (input.type == BRASERO_TRACK_TYPE_IMAGE) {
+ if (input.type == BRASERO_TRACK_TYPE_IMAGE
+ || input.type == BRASERO_TRACK_TYPE_STREAM) {
BraseroBurnResult result;
- gint64 sectors = 0;
- gint64 size = 0;
+ guint64 sectors = 0;
+ guint64 size = 0;
- result = brasero_track_get_image_size (track,
- NULL,
- §ors,
- &size,
- error);
+ result = brasero_track_get_size (track,
+ §ors,
+ &size);
if (result != BRASERO_BURN_OK)
return result;
- BRASERO_BURN_LOG ("Got a default image track length %lli", sectors);
+ BRASERO_BURN_LOG ("Got a default image or stream track length %lli", sectors);
brasero_task_ctx_set_output_size_for_current_track (BRASERO_TASK_CTX (self),
sectors,
size);
}
- else if (input.type == BRASERO_TRACK_TYPE_AUDIO) {
- gint64 length;
-
- length = 0;
- brasero_track_get_audio_length (track, &length);
- BRASERO_BURN_LOG ("Got a default audio track length %lli", length);
-
- brasero_task_ctx_set_output_size_for_current_track (BRASERO_TASK_CTX (self),
- BRASERO_DURATION_TO_SECTORS (length),
- BRASERO_DURATION_TO_BYTES (length));
- }
return BRASERO_BURN_OK;
}
Modified: trunk/libbrasero-burn/libbrasero-marshal.list
==============================================================================
--- trunk/libbrasero-burn/libbrasero-marshal.list (original)
+++ trunk/libbrasero-burn/libbrasero-marshal.list Sat Mar 28 08:14:58 2009
@@ -1,4 +1,5 @@
INT:VOID
+INT:INT
INT:OBJECT,INT,INT
INT:POINTER,BOOLEAN
VOID:DOUBLE,DOUBLE,LONG
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 Sat Mar 28 08:14:58 2009
@@ -47,6 +47,8 @@
#include "burn-plugin.h"
#include "burn-job.h"
#include "burn-process.h"
+#include "brasero-track-disc.h"
+#include "brasero-track-image.h"
#include "brasero-drive.h"
#include "brasero-medium.h"
@@ -178,7 +180,7 @@
if (!track)
return FALSE;
- cuepath = brasero_track_get_toc_source (track, FALSE);
+ cuepath = brasero_track_image_get_toc_source (BRASERO_TRACK_IMAGE (track), FALSE);
if (!cuepath)
return FALSE;
@@ -336,7 +338,7 @@
g_ptr_array_add (argv, g_strdup ("--source-device"));
brasero_job_get_current_track (BRASERO_JOB (cdrdao), &track);
- drive = brasero_track_get_drive_source (track);
+ drive = brasero_track_disc_get_drive (BRASERO_TRACK_DISC (track));
#ifdef HAVE_CAM_LIB_H
/* FreeBSD like that better */
@@ -355,13 +357,13 @@
if (type.subtype.img_format == BRASERO_IMAGE_FORMAT_CUE) {
gchar *parent;
- cuepath = brasero_track_get_toc_source (track, FALSE);
+ cuepath = brasero_track_image_get_toc_source (BRASERO_TRACK_IMAGE (track), FALSE);
parent = g_path_get_dirname (cuepath);
brasero_process_set_working_directory (BRASERO_PROCESS (cdrdao), parent);
g_free (parent);
}
else if (type.subtype.img_format == BRASERO_IMAGE_FORMAT_CDRDAO)
- cuepath = brasero_track_get_toc_source (track, FALSE);
+ cuepath = brasero_track_image_get_toc_source (BRASERO_TRACK_IMAGE (track), FALSE);
else
BRASERO_JOB_NOT_SUPPORTED (cdrdao);
@@ -431,7 +433,7 @@
g_ptr_array_add (argv, g_strdup ("--device"));
brasero_job_get_current_track (BRASERO_JOB (cdrdao), &track);
- drive = brasero_track_get_drive_source (track);
+ drive = brasero_track_disc_get_drive (BRASERO_TRACK_DISC (track));
#ifdef HAVE_CAM_LIB_H
/* FreeBSD like that better */
@@ -520,11 +522,11 @@
BraseroTrack *track;
brasero_job_get_current_track (BRASERO_JOB (cdrdao), &track);
- input = brasero_track_get_type (track, NULL);
+ input = brasero_track_get_track_type (track, NULL);
if (input == BRASERO_TRACK_TYPE_DISC) {
- gint64 sectors = 0;
+ guint64 sectors = 0;
- brasero_track_get_disc_data_size (track, §ors, NULL);
+ brasero_track_get_size (track, §ors, NULL);
/* cdrdao won't get a track size under 300 sectors */
if (sectors < 300)
Modified: trunk/libbrasero-burn/plugins/cdrdao/burn-toc2cue.c
==============================================================================
--- trunk/libbrasero-burn/plugins/cdrdao/burn-toc2cue.c (original)
+++ trunk/libbrasero-burn/plugins/cdrdao/burn-toc2cue.c Sat Mar 28 08:14:58 2009
@@ -44,6 +44,7 @@
#include "burn-process.h"
#include "burn-cdrdao-common.h"
#include "burn-toc2cue.h"
+#include "brasero-track-image.h"
BRASERO_PLUGIN_BOILERPLATE (BraseroToc2Cue, brasero_toc2cue, BRASERO_TYPE_PROCESS, BraseroProcess);
@@ -71,11 +72,12 @@
brasero_toc2cue_read_stderr (BraseroProcess *process,
const gchar *line)
{
+ BraseroTrack *current = NULL;
BraseroToc2CuePrivate *priv;
+ BraseroTrackImage *track;
BraseroToc2Cue *self;
GError *error = NULL;
gchar *tmp_img_path;
- BraseroTrack *track;
GIOChannel *source;
guint tmp_path_len;
GIOStatus status;
@@ -119,8 +121,8 @@
}
/* get the path of the image that should remain unchanged */
- brasero_job_get_current_track (BRASERO_JOB (self), &track);
- tmp_img_path = brasero_track_get_image_source (track, FALSE);
+ brasero_job_get_current_track (BRASERO_JOB (self), ¤t);
+ tmp_img_path = brasero_track_image_get_source (BRASERO_TRACK_IMAGE (current), FALSE);
tmp_path_len = strlen (tmp_img_path);
status = g_io_channel_read_line (source, &buffer, NULL, NULL, &error);
@@ -197,8 +199,8 @@
return BRASERO_BURN_OK;
} /* symlink () could also be used */
- track = brasero_track_new (BRASERO_TRACK_TYPE_IMAGE);
- brasero_track_set_image_source (track,
+ track = brasero_track_image_new ();
+ brasero_track_image_set_source (track,
img_path,
toc_path,
BRASERO_IMAGE_FORMAT_CUE);
@@ -207,11 +209,11 @@
g_free (img_path);
g_free (toc_path);
- brasero_job_add_track (BRASERO_JOB (process), track);
+ brasero_job_add_track (BRASERO_JOB (process), BRASERO_TRACK (track));
/* It's good practice to unref the track afterwards as we don't need it
* anymore. BraseroTaskCtx refs it. */
- brasero_track_unref (track);
+ g_object_unref (track);
brasero_job_finished_track (BRASERO_JOB (process));
return BRASERO_BURN_OK;
@@ -245,7 +247,7 @@
return result;
brasero_job_get_current_track (BRASERO_JOB (self), &track);
- tocpath = brasero_track_get_toc_source (track, FALSE);
+ tocpath = brasero_track_image_get_toc_source (BRASERO_TRACK_IMAGE (track), FALSE);
priv->output = g_strdup (output);
g_remove (priv->output);
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 Sat Mar 28 08:14:58 2009
@@ -46,6 +46,7 @@
#include "burn-plugin.h"
#include "burn-cdrkit.h"
#include "burn-genisoimage.h"
+#include "brasero-track-data.h"
BRASERO_PLUGIN_BOILERPLATE (BraseroGenisoimage, brasero_genisoimage, BRASERO_TYPE_PROCESS, BraseroProcess);
@@ -240,7 +241,7 @@
if (result != BRASERO_BURN_OK)
BRASERO_JOB_NOT_READY (genisoimage);
- brasero_track_get_type (track, &type);
+ brasero_track_get_track_type (track, &type);
if (type.subtype.fs_type & BRASERO_IMAGE_FS_JOLIET)
g_ptr_array_add (argv, g_strdup ("-J"));
@@ -301,7 +302,7 @@
return result;
}
- result = brasero_track_get_data_paths (track,
+ result = brasero_track_data_get_paths (BRASERO_TRACK_DATA (track),
(type.subtype.fs_type & BRASERO_IMAGE_FS_JOLIET) != 0,
grafts_path,
excluded_path,
@@ -346,7 +347,7 @@
brasero_job_get_flags (BRASERO_JOB (genisoimage), &flags);
if (flags & (BRASERO_BURN_FLAG_APPEND|BRASERO_BURN_FLAG_MERGE)) {
- gint64 last_session = 0, next_wr_add = 0;
+ guint64 last_session = 0, next_wr_add = 0;
gchar *startpoint = NULL;
brasero_job_get_last_session_address (BRASERO_JOB (genisoimage), &last_session);
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 Sat Mar 28 08:14:58 2009
@@ -42,6 +42,9 @@
#include "burn-process.h"
#include "burn-job.h"
#include "burn-plugin.h"
+#include "brasero-tags.h"
+#include "brasero-track-disc.h"
+
#include "burn-volume.h"
#include "brasero-drive.h"
@@ -119,7 +122,7 @@
GPtrArray *argv,
GError **error)
{
- gint64 nb_blocks;
+ guint64 nb_blocks;
BraseroTrack *track;
GValue *value = NULL;
BraseroTrackType output;
@@ -153,23 +156,25 @@
end));
}
/* 0 means all disc, -1 problem */
- else if (brasero_track_get_drive_track (track) > 0) {
- gint64 start;
+ else if (brasero_track_disc_get_track_num (BRASERO_TRACK_DISC (track)) > 0) {
+ guint64 start;
+ BraseroDrive *drive;
BraseroMedium *medium;
- medium = brasero_track_get_medium_source (track);
+ drive = brasero_track_disc_get_drive (BRASERO_TRACK_DISC (track));
+ medium = brasero_drive_get_medium (drive);
brasero_medium_get_track_space (medium,
- brasero_track_get_drive_track (track),
+ brasero_track_disc_get_track_num (BRASERO_TRACK_DISC (track)),
NULL,
&nb_blocks);
brasero_medium_get_track_address (medium,
- brasero_track_get_drive_track (track),
+ brasero_track_disc_get_track_num (BRASERO_TRACK_DISC (track)),
NULL,
&start);
BRASERO_JOB_LOG (readom,
"reading %i from sector %lli to %lli",
- brasero_track_get_drive_track (track),
+ brasero_track_disc_get_track_num (BRASERO_TRACK_DISC (track)),
start,
start + nb_blocks);
g_ptr_array_add (argv, g_strdup_printf ("-sectors=%lli-%lli",
@@ -178,10 +183,12 @@
}
/* if it's BIN output just read the last track */
else if (output.subtype.img_format == BRASERO_IMAGE_FORMAT_BIN) {
- gint64 start;
+ guint64 start;
+ BraseroDrive *drive;
BraseroMedium *medium;
- medium = brasero_track_get_medium_source (track);
+ drive = brasero_track_disc_get_drive (BRASERO_TRACK_DISC (track));
+ medium = brasero_drive_get_medium (drive);
brasero_medium_get_last_data_track_space (medium,
NULL,
&nb_blocks);
@@ -197,7 +204,7 @@
start + nb_blocks));
}
else {
- brasero_track_get_disc_data_size (track, &nb_blocks, NULL);
+ brasero_track_get_size (track, &nb_blocks, NULL);
g_ptr_array_add (argv, g_strdup_printf ("-sectors=0-%lli", nb_blocks));
}
@@ -208,7 +215,7 @@
brasero_readom_get_size (BraseroReadom *self,
GError **error)
{
- gint64 blocks;
+ guint64 blocks;
GValue *value = NULL;
BraseroTrackType output;
BraseroTrack *track = NULL;
@@ -234,25 +241,29 @@
end = g_value_get_uint64 (value);
blocks = end - start;
}
- else if (brasero_track_get_drive_track (track) > 0) {
+ else if (brasero_track_disc_get_track_num (BRASERO_TRACK_DISC (track)) > 0) {
+ BraseroDrive *drive;
BraseroMedium *medium;
- medium = brasero_track_get_medium_source (track);
+ drive = brasero_track_disc_get_drive (BRASERO_TRACK_DISC (track));
+ medium = brasero_drive_get_medium (drive);
brasero_medium_get_track_space (medium,
- brasero_track_get_drive_track (track),
+ brasero_track_disc_get_track_num (BRASERO_TRACK_DISC (track)),
NULL,
&blocks);
}
else if (output.subtype.img_format == BRASERO_IMAGE_FORMAT_BIN) {
+ BraseroDrive *drive;
BraseroMedium *medium;
- medium = brasero_track_get_medium_source (track);
+ drive = brasero_track_disc_get_drive (BRASERO_TRACK_DISC (track));
+ medium = brasero_drive_get_medium (drive);
brasero_medium_get_last_data_track_space (medium,
NULL,
&blocks);
}
else
- brasero_track_get_disc_data_size (track, &blocks, NULL);
+ brasero_track_get_size (track, &blocks, NULL);
if (output.type != BRASERO_TRACK_TYPE_IMAGE)
return BRASERO_BURN_ERR;
@@ -300,7 +311,7 @@
g_ptr_array_add (argv, g_strdup ("readom"));
brasero_job_get_current_track (BRASERO_JOB (readom), &track);
- drive = brasero_track_get_drive_source (track);
+ drive = brasero_track_disc_get_drive (BRASERO_TRACK_DISC (track));
if (!brasero_drive_get_device (drive))
return BRASERO_BURN_ERR;
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 Sat Mar 28 08:14:58 2009
@@ -52,6 +52,9 @@
#include "burn-cdrkit.h"
#include "burn-wodim.h"
+#include "brasero-track-image.h"
+#include "brasero-track-stream.h"
+
BRASERO_PLUGIN_BOILERPLATE (BraseroWodim, brasero_wodim, BRASERO_TYPE_PROCESS, BraseroProcess);
struct _BraseroWodimPrivate {
@@ -284,7 +287,7 @@
priv->current_track_written = mb_written * 1048576;
if (brasero_job_get_fd_in (BRASERO_JOB (wodim), NULL) == BRASERO_BURN_OK) {
- gint64 bytes = 0;
+ guint64 bytes = 0;
/* we must ask the imager what is the total size */
brasero_job_get_session_output_size (BRASERO_JOB (wodim),
@@ -321,7 +324,7 @@
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_AUDIO) ? NULL:_("Writing cue sheet"),
+ (type.type == BRASERO_TRACK_TYPE_STREAM) ? NULL:_("Writing cue sheet"),
FALSE);
}
else if (g_str_has_prefix (line, "Re-load disk and hit <CR>")
@@ -378,12 +381,12 @@
gint fd;
gint size;
gchar *path;
- gint64 length;
+ guint64 length;
gchar *string;
gint b_written;
gint64 sectors;
gchar buffer [128];
- BraseroSongInfo *info;
+ BraseroStreamInfo *info;
BraseroWodimPrivate *priv;
int errsv;
@@ -395,7 +398,7 @@
if (brasero_job_get_fd_in (BRASERO_JOB (wodim), NULL) != BRASERO_BURN_OK) {
gchar *dot, *separator;
- path = brasero_track_get_audio_source (track, FALSE);
+ path = brasero_track_stream_get_source (BRASERO_TRACK_STREAM (track), FALSE);
dot = strrchr (path, '.');
separator = strrchr (path, G_DIR_SEPARATOR);
@@ -438,7 +441,7 @@
* It might be good in the end to write and pack CD-TEXT pack data
* ourselves so we can set a different charset from English like
* Chinese for example. */
- info = brasero_track_get_audio_info (track);
+ info = brasero_track_stream_get_info (BRASERO_TRACK_STREAM (track));
strcpy (buffer, "# created by brasero\n");
size = strlen (buffer);
@@ -571,7 +574,7 @@
goto error;
length = 0;
- brasero_track_get_audio_length (track, &length);
+ brasero_track_stream_get_length (BRASERO_TRACK_STREAM (track), &length);
sectors = BRASERO_DURATION_TO_SECTORS (length);
BRASERO_JOB_LOG (wodim, "got track length %lli %lli", length, sectors);
@@ -678,7 +681,7 @@
start = 0;
for (iter = tracks; iter; iter = iter->next) {
- gint64 length;
+ guint64 sectors;
BraseroTrack *track;
track = iter->data;
@@ -695,10 +698,10 @@
return result;
index ++;
- length = 0;
+ sectors = 0;
- brasero_track_get_audio_length (track, &length);
- start += BRASERO_DURATION_TO_SECTORS (length);
+ brasero_track_get_size (track, §ors, NULL);
+ start += sectors;
}
g_free (album);
@@ -754,7 +757,7 @@
if (brasero_job_get_fd_in (BRASERO_JOB (wodim), NULL) == BRASERO_BURN_OK) {
BraseroBurnResult result;
int buffer_size;
- gint64 sectors;
+ 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);
@@ -800,7 +803,7 @@
else
BRASERO_JOB_NOT_SUPPORTED (wodim);
}
- else if (type.type == BRASERO_TRACK_TYPE_AUDIO) {
+ else if (type.type == BRASERO_TRACK_TYPE_STREAM) {
/* 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 */
@@ -818,7 +821,7 @@
else
BRASERO_JOB_NOT_SUPPORTED (wodim);
}
- else if (type.type == BRASERO_TRACK_TYPE_AUDIO) {
+ else if (type.type == BRASERO_TRACK_TYPE_STREAM) {
BraseroBurnResult result;
GSList *tracks;
@@ -843,7 +846,7 @@
gchar *path;
track = tracks->data;
- path = brasero_track_get_audio_source (track, FALSE);
+ path = brasero_track_stream_get_source (BRASERO_TRACK_STREAM (track), FALSE);
g_ptr_array_add (argv, path);
}
}
@@ -857,7 +860,7 @@
if (type.subtype.img_format == BRASERO_IMAGE_FORMAT_NONE) {
gchar *image_path;
- image_path = brasero_track_get_image_source (track, FALSE);
+ image_path = brasero_track_image_get_source (BRASERO_TRACK_IMAGE (track), FALSE);
if (!image_path)
BRASERO_JOB_NOT_READY (wodim);
@@ -869,7 +872,7 @@
else if (type.subtype.img_format == BRASERO_IMAGE_FORMAT_BIN) {
gchar *isopath;
- isopath = brasero_track_get_image_source (track, FALSE);
+ isopath = brasero_track_image_get_source (BRASERO_TRACK_IMAGE (track), FALSE);
if (!isopath)
BRASERO_JOB_NOT_READY (wodim);
@@ -881,7 +884,7 @@
else if (type.subtype.img_format == BRASERO_IMAGE_FORMAT_CLONE) {
gchar *rawpath;
- rawpath = brasero_track_get_image_source (track, FALSE);
+ rawpath = brasero_track_image_get_source (BRASERO_TRACK_IMAGE (track), FALSE);
if (!rawpath)
BRASERO_JOB_NOT_READY (wodim);
@@ -893,7 +896,7 @@
gchar *cue_str;
gchar *cuepath;
- cuepath = brasero_track_get_toc_source (track, FALSE);
+ cuepath = brasero_track_image_get_toc_source (BRASERO_TRACK_IMAGE (track), FALSE);
if (!cuepath)
BRASERO_JOB_NOT_READY (wodim);
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 Sat Mar 28 08:14:58 2009
@@ -52,6 +52,9 @@
#include "burn-cdrtools.h"
#include "burn-cdrecord.h"
+#include "brasero-track-image.h"
+#include "brasero-track-stream.h"
+
BRASERO_PLUGIN_BOILERPLATE (BraseroCDRecord, brasero_cdrecord, BRASERO_TYPE_PROCESS, BraseroProcess);
struct _BraseroCDRecordPrivate {
@@ -272,7 +275,7 @@
priv->current_track_written = mb_written * 1048576;
if (brasero_job_get_fd_in (BRASERO_JOB (cdrecord), NULL) == BRASERO_BURN_OK) {
- gint64 bytes = 0;
+ guint64 bytes = 0;
/* we must ask the imager what is the total size */
brasero_job_get_session_output_size (BRASERO_JOB (cdrecord),
@@ -305,7 +308,7 @@
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_AUDIO) ? NULL:_("Writing cue sheet"),
+ (type.type == BRASERO_TRACK_TYPE_STREAM) ? NULL:_("Writing cue sheet"),
FALSE);
}
else if (g_str_has_prefix (line, "Re-load disk and hit <CR>")
@@ -362,12 +365,12 @@
gint fd;
gint size;
gchar *path;
- gint64 length;
+ guint64 length;
gchar *string;
gint b_written;
gint64 sectors;
gchar buffer [128];
- BraseroSongInfo *info;
+ BraseroStreamInfo *info;
BraseroCDRecordPrivate *priv;
int errsv;
@@ -379,7 +382,7 @@
if (brasero_job_get_fd_in (BRASERO_JOB (cdrecord), NULL) != BRASERO_BURN_OK) {
gchar *dot, *separator;
- path = brasero_track_get_audio_source (track, FALSE);
+ path = brasero_track_stream_get_source (BRASERO_TRACK_STREAM (track), FALSE);
dot = strrchr (path, '.');
separator = strrchr (path, G_DIR_SEPARATOR);
@@ -425,7 +428,7 @@
* It might be good in the end to write and pack CD-TEXT pack data
* ourselves so we can set a different charset from English like
* Chinese for example. */
- info = brasero_track_get_audio_info (track);
+ info = brasero_track_stream_get_info (BRASERO_TRACK_STREAM (track));
strcpy (buffer, "# created by brasero\n");
size = strlen (buffer);
@@ -558,7 +561,7 @@
goto error;
length = 0;
- brasero_track_get_audio_length (track, &length);
+ brasero_track_stream_get_length (BRASERO_TRACK_STREAM (track), &length);
sectors = BRASERO_DURATION_TO_SECTORS (length);
BRASERO_JOB_LOG (cdrecord, "got track length %lli", length);
@@ -661,7 +664,7 @@
start = 0;
for (iter = tracks; iter; iter = iter->next) {
- gint64 length;
+ guint64 sectors;
BraseroTrack *track;
track = iter->data;
@@ -678,10 +681,10 @@
return result;
index ++;
- length = 0;
+ sectors = 0;
- brasero_track_get_audio_length (track, &length);
- start += BRASERO_DURATION_TO_SECTORS (length);
+ brasero_track_get_size (track, §ors, NULL);
+ start += sectors;
}
g_free (album);
@@ -737,7 +740,7 @@
if (brasero_job_get_fd_in (BRASERO_JOB (cdrecord), NULL) == BRASERO_BURN_OK) {
BraseroBurnResult result;
int buffer_size;
- gint64 sectors;
+ 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);
@@ -782,7 +785,7 @@
else
BRASERO_JOB_NOT_SUPPORTED (cdrecord);;
}
- else if (type.type == BRASERO_TRACK_TYPE_AUDIO) {
+ else if (type.type == BRASERO_TRACK_TYPE_STREAM) {
g_ptr_array_add (argv, g_strdup ("-swab"));
g_ptr_array_add (argv, g_strdup ("-audio"));
g_ptr_array_add (argv, g_strdup ("-useinfo"));
@@ -797,7 +800,7 @@
else
BRASERO_JOB_NOT_SUPPORTED (cdrecord);
}
- else if (type.type == BRASERO_TRACK_TYPE_AUDIO) {
+ else if (type.type == BRASERO_TRACK_TYPE_STREAM) {
BraseroBurnResult result;
GSList *tracks;
@@ -822,7 +825,7 @@
gchar *path;
track = tracks->data;
- path = brasero_track_get_audio_source (track, FALSE);
+ path = brasero_track_stream_get_source (BRASERO_TRACK_STREAM (track), FALSE);
g_ptr_array_add (argv, path);
}
}
@@ -836,7 +839,7 @@
if (type.subtype.img_format == BRASERO_IMAGE_FORMAT_NONE) {
gchar *image_path;
- image_path = brasero_track_get_image_source (track, FALSE);
+ image_path = brasero_track_image_get_source (BRASERO_TRACK_IMAGE (track), FALSE);
if (!image_path)
BRASERO_JOB_NOT_READY (cdrecord);
@@ -848,7 +851,7 @@
else if (type.subtype.img_format == BRASERO_IMAGE_FORMAT_BIN) {
gchar *isopath;
- isopath = brasero_track_get_image_source (track, FALSE);
+ isopath = brasero_track_image_get_source (BRASERO_TRACK_IMAGE (track), FALSE);
if (!isopath)
BRASERO_JOB_NOT_READY (cdrecord);
@@ -860,7 +863,7 @@
else if (type.subtype.img_format == BRASERO_IMAGE_FORMAT_CLONE) {
gchar *rawpath;
- rawpath = brasero_track_get_image_source (track, FALSE);
+ rawpath = brasero_track_image_get_source (BRASERO_TRACK_IMAGE (track), FALSE);
if (!rawpath)
BRASERO_JOB_NOT_READY (cdrecord);
@@ -872,7 +875,7 @@
gchar *cue_str;
gchar *cuepath;
- cuepath = brasero_track_get_toc_source (track, FALSE);
+ cuepath = brasero_track_image_get_toc_source (BRASERO_TRACK_IMAGE (track), FALSE);
if (!cuepath)
BRASERO_JOB_NOT_READY (cdrecord);
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 Sat Mar 28 08:14:58 2009
@@ -47,6 +47,7 @@
#include "burn-plugin.h"
#include "burn-cdrtools.h"
#include "burn-mkisofs.h"
+#include "brasero-track-data.h"
BRASERO_PLUGIN_BOILERPLATE (BraseroMkisofs, brasero_mkisofs, BRASERO_TYPE_PROCESS, BraseroProcess);
@@ -241,7 +242,7 @@
if (result != BRASERO_BURN_OK)
BRASERO_JOB_NOT_READY (mkisofs);
- brasero_track_get_type (track, &type);
+ brasero_track_get_track_type (track, &type);
if (type.subtype.fs_type & BRASERO_IMAGE_FS_JOLIET)
g_ptr_array_add (argv, g_strdup ("-J"));
@@ -298,7 +299,7 @@
return result;
}
- result = brasero_track_get_data_paths (track,
+ result = brasero_track_data_get_paths (BRASERO_TRACK_DATA (track),
(type.subtype.fs_type & BRASERO_IMAGE_FS_JOLIET) != 0,
grafts_path,
excluded_path,
@@ -347,7 +348,7 @@
brasero_job_get_flags (BRASERO_JOB (mkisofs), &flags);
if (flags & (BRASERO_BURN_FLAG_APPEND|BRASERO_BURN_FLAG_MERGE)) {
- gint64 last_session = 0, next_wr_add = 0;
+ guint64 last_session = 0, next_wr_add = 0;
gchar *startpoint = NULL;
brasero_job_get_last_session_address (BRASERO_JOB (mkisofs), &last_session);
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 Sat Mar 28 08:14:58 2009
@@ -42,6 +42,9 @@
#include "burn-process.h"
#include "burn-job.h"
#include "burn-plugin.h"
+#include "brasero-tags.h"
+#include "brasero-track-disc.h"
+
#include "burn-volume.h"
#include "brasero-drive.h"
@@ -119,7 +122,7 @@
GPtrArray *argv,
GError **error)
{
- gint64 nb_blocks;
+ guint64 nb_blocks;
BraseroTrack *track;
GValue *value = NULL;
BraseroTrackType output;
@@ -153,23 +156,25 @@
end));
}
/* 0 means all disc, -1 problem */
- else if (brasero_track_get_drive_track (track) > 0) {
- gint64 start;
+ else if (brasero_track_disc_get_drive (BRASERO_TRACK_DISC (track)) > 0) {
+ guint64 start;
+ BraseroDrive *drive;
BraseroMedium *medium;
- medium = brasero_track_get_medium_source (track);
+ drive = brasero_track_disc_get_drive (BRASERO_TRACK_DISC (track));
+ medium = brasero_drive_get_medium (drive);
brasero_medium_get_track_space (medium,
- brasero_track_get_drive_track (track),
+ brasero_track_disc_get_track_num (BRASERO_TRACK_DISC (track)),
NULL,
&nb_blocks);
brasero_medium_get_track_address (medium,
- brasero_track_get_drive_track (track),
+ brasero_track_disc_get_track_num (BRASERO_TRACK_DISC (track)),
NULL,
&start);
BRASERO_JOB_LOG (readcd,
"reading %i from sector %lli to %lli",
- brasero_track_get_drive_track (track),
+ brasero_track_disc_get_track_num (BRASERO_TRACK_DISC (track)),
start,
start + nb_blocks);
g_ptr_array_add (argv, g_strdup_printf ("-sectors=%lli-%lli",
@@ -178,10 +183,12 @@
}
/* if it's BIN output just read the last track */
else if (output.subtype.img_format == BRASERO_IMAGE_FORMAT_BIN) {
- gint64 start;
+ guint64 start;
+ BraseroDrive *drive;
BraseroMedium *medium;
- medium = brasero_track_get_medium_source (track);
+ drive = brasero_track_disc_get_drive (BRASERO_TRACK_DISC (track));
+ medium = brasero_drive_get_medium (drive);
brasero_medium_get_last_data_track_space (medium,
NULL,
&nb_blocks);
@@ -197,7 +204,7 @@
start + nb_blocks));
}
else {
- brasero_track_get_disc_data_size (track, &nb_blocks, NULL);
+ brasero_track_get_size (track, &nb_blocks, NULL);
g_ptr_array_add (argv, g_strdup_printf ("-sectors=0-%lli", nb_blocks));
}
@@ -208,7 +215,7 @@
brasero_readcd_get_size (BraseroReadcd *self,
GError **error)
{
- gint64 blocks;
+ guint64 blocks;
GValue *value = NULL;
BraseroTrackType output;
BraseroTrack *track = NULL;
@@ -234,25 +241,29 @@
end = g_value_get_uint64 (value);
blocks = end - start;
}
- else if (brasero_track_get_drive_track (track) > 0) {
+ else if (brasero_track_disc_get_track_num (BRASERO_TRACK_DISC (track)) > 0) {
+ BraseroDrive *drive;
BraseroMedium *medium;
- medium = brasero_track_get_medium_source (track);
+ drive = brasero_track_disc_get_drive (BRASERO_TRACK_DISC (track));
+ medium = brasero_drive_get_medium (drive);
brasero_medium_get_track_space (medium,
- brasero_track_get_drive_track (track),
+ brasero_track_disc_get_track_num (BRASERO_TRACK_DISC (track)),
NULL,
&blocks);
}
else if (output.subtype.img_format == BRASERO_IMAGE_FORMAT_BIN) {
+ BraseroDrive *drive;
BraseroMedium *medium;
- medium = brasero_track_get_medium_source (track);
+ drive = brasero_track_disc_get_drive (BRASERO_TRACK_DISC (track));
+ medium = brasero_drive_get_medium (drive);
brasero_medium_get_last_data_track_space (medium,
NULL,
&blocks);
}
else
- brasero_track_get_disc_data_size (track, &blocks, NULL);
+ brasero_track_get_size (track, &blocks, NULL);
if (output.type != BRASERO_TRACK_TYPE_IMAGE)
return BRASERO_BURN_ERR;
@@ -301,7 +312,7 @@
g_ptr_array_add (argv, g_strdup ("readcd"));
brasero_job_get_current_track (BRASERO_JOB (readcd), &track);
- drive = brasero_track_get_drive_source (track);
+ drive = brasero_track_disc_get_drive (BRASERO_TRACK_DISC (track));
#ifdef HAVE_CAM_LIB_H
/* FreeBSD like that better */
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 Sat Mar 28 08:14:58 2009
@@ -47,9 +47,15 @@
#include "burn-plugin.h"
#include "burn-job.h"
#include "burn-checksum-files.h"
+
+#include "brasero-tags.h"
+#include "brasero-track-data.h"
+#include "brasero-track-disc.h"
+
#include "burn-volume.h"
#include "brasero-drive.h"
#include "brasero-volume.h"
+
#include "burn-volume-read.h"
BRASERO_PLUGIN_BOILERPLATE (BraseroChecksumFiles, brasero_checksum_files, BRASERO_TYPE_JOB, BraseroJob);
@@ -322,7 +328,7 @@
/* get the path string */
path = g_strdup (line + i);
- for (grafts = brasero_track_get_data_grafts_source (track); grafts; grafts = grafts->next) {
+ for (grafts = brasero_track_data_get_grafts (BRASERO_TRACK_DATA (track)); grafts; grafts = grafts->next) {
BraseroGraftPt *graft;
guint len;
@@ -380,7 +386,7 @@
BraseroTrack *track;
gchar buffer [2048];
BraseroVolSrc *vol;
- gint64 start_block;
+ guint64 start_block;
gchar *device;
priv = BRASERO_CHECKSUM_FILES_PRIVATE (self);
@@ -498,7 +504,7 @@
GError **error)
{
GSList *iter;
- gint64 file_nb;
+ guint64 file_nb;
BraseroTrack *track;
GConfClient *client;
GHashTable *excludedH;
@@ -575,7 +581,7 @@
/* we fill a hash table with all the files that are excluded globally */
excludedH = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
- iter = brasero_track_get_data_excluded_source (track, FALSE);
+ iter = brasero_track_data_get_excluded (BRASERO_TRACK_DATA (track), FALSE);
for (; iter; iter = iter->next) {
gchar *uri;
gchar *path;
@@ -596,13 +602,13 @@
file_nb = -1;
priv->file_num = 0;
- brasero_track_get_data_file_num (track, &file_nb);
+ brasero_track_data_get_file_num (BRASERO_TRACK_DATA (track), &file_nb);
if (file_nb > 0)
brasero_job_start_progress (BRASERO_JOB (self), TRUE);
else
file_nb = -1;
- iter = brasero_track_get_data_grafts_source (track);
+ iter = brasero_track_data_get_grafts (BRASERO_TRACK_DATA (track));
for (; iter; iter = iter->next) {
BraseroGraftPt *graft;
gchar *graft_path;
@@ -794,10 +800,11 @@
guint file_num;
gint checksum_len;
BraseroVolSrc *vol;
- gint64 start_block;
+ guint64 start_block;
BraseroTrack *track;
const gchar *device;
BraseroVolFile *file;
+ BraseroDrive *drive;
BraseroMedium *medium;
BraseroVolFileHandle *handle;
GChecksumType gchecksum_type;
@@ -810,7 +817,9 @@
/* get medium */
brasero_job_get_current_track (BRASERO_JOB (self), &track);
- medium = brasero_track_get_medium_source (track);
+ drive = brasero_track_disc_get_drive (BRASERO_TRACK_DISC (track));
+ medium = brasero_drive_get_medium (drive);
+
/* open volume */
if (!brasero_medium_get_last_data_track_address (medium, NULL, &start_block))
return BRASERO_BURN_ERR;
@@ -1068,8 +1077,8 @@
static gboolean
brasero_checksum_files_end (gpointer data)
{
- BraseroTrack *track;
BraseroTrackType input;
+ BraseroTrackData *track;
BraseroChecksumFiles *self;
BraseroJobAction action;
BraseroChecksumFilesPrivate *priv;
@@ -1109,12 +1118,13 @@
BraseroGraftPt *graft;
BraseroTrackType type;
GSList *new_grafts = NULL;
+ BraseroTrack *current = NULL;
/* for DATA track we add the file to the track */
- brasero_job_get_current_track (BRASERO_JOB (self), &track);
- brasero_track_get_type (track, &type);
- grafts = brasero_track_get_data_grafts_source (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;
graft = brasero_graft_point_copy (graft);
@@ -1142,20 +1152,20 @@
graft->uri);
new_grafts = g_slist_prepend (new_grafts, graft);
- excluded = brasero_track_get_data_excluded_source (track, TRUE);
+ excluded = brasero_track_data_get_excluded (BRASERO_TRACK_DATA (current), TRUE);
- track = brasero_track_new (BRASERO_TRACK_TYPE_DATA);
- brasero_track_add_data_fs (track, type.subtype.fs_type);
- brasero_track_set_data_source (track, new_grafts, excluded);
- brasero_track_set_checksum (track,
+ track = brasero_track_data_new ();
+ brasero_track_data_add_fs (track, type.subtype.fs_type);
+ brasero_track_data_set_source (track, new_grafts, excluded);
+ brasero_track_set_checksum (BRASERO_TRACK (track),
priv->checksum_type,
graft->uri);
- brasero_job_add_track (BRASERO_JOB (self), track);
+ brasero_job_add_track (BRASERO_JOB (self), BRASERO_TRACK (track));
/* It's good practice to unref the track afterwards as we don't
* need it anymore. BraseroTaskCtx refs it. */
- brasero_track_unref (track);
+ g_object_unref (track);
brasero_job_finished_track (BRASERO_JOB (self));
return FALSE;
@@ -1298,7 +1308,7 @@
* exists (possible when doing several copies) or when a simulation
* already took place before. */
brasero_job_get_current_track (job, &track);
- grafts = brasero_track_get_data_grafts_source (track);
+ grafts = brasero_track_data_get_grafts (BRASERO_TRACK_DATA (track));
for (; grafts; grafts = grafts->next) {
BraseroGraftPt *graft;
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 Sat Mar 28 08:14:58 2009
@@ -50,6 +50,8 @@
#include "burn-checksum-image.h"
#include "burn-volume.h"
#include "brasero-drive.h"
+#include "brasero-track-disc.h"
+#include "brasero-track-image.h"
BRASERO_PLUGIN_BOILERPLATE (BraseroChecksumImage, brasero_checksum_image, BRASERO_TYPE_JOB, BraseroJob);
@@ -58,8 +60,8 @@
BraseroChecksumType checksum_type;
/* That's for progress reporting */
- gint64 total;
- gint64 bytes;
+ guint64 total;
+ guint64 bytes;
/* this is for the thread and the end of it */
GThread *thread;
@@ -266,7 +268,7 @@
/* get all information */
brasero_job_get_current_track (BRASERO_JOB (self), &track);
- path = brasero_track_get_image_source (track, FALSE);
+ path = brasero_track_image_get_source (BRASERO_TRACK_IMAGE (track), FALSE);
if (!path) {
g_set_error (error,
BRASERO_BURN_ERROR,
@@ -351,10 +353,12 @@
/* see if another plugin is sending us data to checksum */
if (brasero_job_get_fd_in (BRASERO_JOB (self), NULL) == BRASERO_BURN_OK) {
BraseroMedium *medium;
+ BraseroDrive *drive;
/* we're only able to checksum ISO format at the moment so that
* means we can only handle last session */
- medium = brasero_track_get_medium_source (track);
+ drive = brasero_track_disc_get_drive (BRASERO_TRACK_DISC (track));
+ medium = brasero_drive_get_medium (drive);
brasero_medium_get_last_data_track_space (medium,
&priv->total,
NULL);
@@ -362,11 +366,9 @@
return brasero_checksum_image_checksum_fd_input (self, checksum_type, error);
}
else {
- result = brasero_track_get_image_size (track,
- NULL,
- NULL,
- &priv->total,
- error);
+ result = brasero_track_get_size (track,
+ NULL,
+ &priv->total);
if (result != BRASERO_BURN_OK)
return result;
@@ -424,11 +426,9 @@
BraseroTrack *track;
brasero_job_get_current_track (BRASERO_JOB (self), &track);
- result = brasero_track_get_image_size (track,
- NULL,
- NULL,
- &priv->total,
- error);
+ result = brasero_track_get_size (track,
+ NULL,
+ &priv->total);
if (result != BRASERO_BURN_OK)
return result;
Modified: trunk/libbrasero-burn/plugins/dvdauthor/burn-dvdauthor.c
==============================================================================
--- trunk/libbrasero-burn/plugins/dvdauthor/burn-dvdauthor.c (original)
+++ trunk/libbrasero-burn/plugins/dvdauthor/burn-dvdauthor.c Sat Mar 28 08:14:58 2009
@@ -45,6 +45,8 @@
#include "burn-job.h"
#include "burn-process.h"
#include "burn-dvdauthor.h"
+#include "brasero-track-data.h"
+#include "brasero-track-stream.h"
BRASERO_PLUGIN_BOILERPLATE (BraseroDvdAuthor, brasero_dvd_author, BRASERO_TYPE_PROCESS, BraseroProcess);
@@ -62,15 +64,15 @@
brasero_dvd_author_add_track (BraseroJob *job)
{
gchar *path;
- BraseroTrack *track;
GSList *grafts = NULL;
BraseroGraftPt *graft;
+ BraseroTrackData *track;
BraseroDvdAuthorPrivate *priv;
priv = BRASERO_DVD_AUTHOR_PRIVATE (job);
/* create the track */
- track = brasero_track_new (BRASERO_TRACK_TYPE_DATA);
+ track = brasero_track_data_new ();
/* audio */
graft = g_new (BraseroGraftPt, 1);
@@ -100,15 +102,15 @@
BRASERO_JOB_LOG (job, "Adding graft point for %s", graft->uri);
- brasero_track_add_data_fs (track,
+ brasero_track_data_add_fs (track,
BRASERO_IMAGE_FS_ISO|
BRASERO_IMAGE_FS_UDF|
BRASERO_IMAGE_FS_VIDEO);
- brasero_track_set_data_source (track,
+ brasero_track_data_set_source (track,
grafts,
NULL);
- brasero_job_add_track (job, track);
- brasero_track_unref (track);
+ brasero_job_add_track (job, BRASERO_TRACK (track));
+ g_object_unref (track);
return BRASERO_BURN_OK;
}
@@ -211,7 +213,7 @@
if (success < 0)
goto error;
- video = brasero_track_get_audio_source (track, FALSE);
+ video = brasero_track_stream_get_source (BRASERO_TRACK_STREAM (track), FALSE);
success = xmlTextWriterWriteAttribute (xml,
(xmlChar *) "file",
(xmlChar *) video);
Modified: trunk/libbrasero-burn/plugins/dvdcss/burn-dvdcss.c
==============================================================================
--- trunk/libbrasero-burn/plugins/dvdcss/burn-dvdcss.c (original)
+++ trunk/libbrasero-burn/plugins/dvdcss/burn-dvdcss.c Sat Mar 28 08:14:58 2009
@@ -48,6 +48,8 @@
#include "burn-dvdcss-private.h"
#include "burn-volume.h"
#include "brasero-medium.h"
+#include "brasero-track-image.h"
+#include "brasero-track-disc.h"
BRASERO_PLUGIN_BOILERPLATE (BraseroDvdcss, brasero_dvdcss, BRASERO_TYPE_JOB, BraseroJob);
@@ -145,10 +147,9 @@
brasero_dvdcss_thread_finished (gpointer data)
{
gchar *image = NULL;
- BraseroTrackType type;
- BraseroTrack *track = NULL;
BraseroDvdcss *self = data;
BraseroDvdcssPrivate *priv;
+ BraseroTrackImage *track = NULL;
priv = BRASERO_DVDCSS_PRIVATE (self);
priv->thread_id = 0;
@@ -162,22 +163,20 @@
return FALSE;
}
- brasero_job_get_output_type (BRASERO_JOB (self), &type);
- track = brasero_track_new (type.type);
-
+ track = brasero_track_image_new ();
brasero_job_get_image_output (BRASERO_JOB (self),
&image,
NULL);
- brasero_track_set_image_source (track,
+ brasero_track_image_set_source (track,
image,
NULL,
BRASERO_IMAGE_FORMAT_BIN);
- brasero_job_add_track (BRASERO_JOB (self), track);
+ brasero_job_add_track (BRASERO_JOB (self), BRASERO_TRACK (track));
/* It's good practice to unref the track afterwards as we don't need it
* anymore. BraseroTaskCtx refs it. */
- brasero_track_unref (track);
+ g_object_unref (track);
brasero_job_finished_track (BRASERO_JOB (self));
@@ -326,7 +325,7 @@
/* get the contents of the DVD */
brasero_job_get_current_track (BRASERO_JOB (self), &track);
- drive = brasero_track_get_drive_source (track);
+ drive = brasero_track_disc_get_drive (BRASERO_TRACK_DISC (track));
vol = brasero_volume_source_open_file (brasero_drive_get_device (drive), &priv->error);
files = brasero_volume_get_files (vol,
@@ -339,7 +338,7 @@
if (!files)
goto end;
- medium = brasero_track_get_medium_source (track);
+ medium = brasero_drive_get_medium (drive);
brasero_medium_get_data_size (medium, NULL, &volume_size);
if (volume_size == -1) {
priv->error = g_error_new (BRASERO_BURN_ERROR,
@@ -531,11 +530,11 @@
brasero_job_get_action (job, &action);
if (action == BRASERO_JOB_ACTION_SIZE) {
- gint64 blocks = 0;
+ guint64 blocks = 0;
BraseroTrack *track;
brasero_job_get_current_track (job, &track);
- brasero_track_get_disc_data_size (track, &blocks, NULL);
+ brasero_track_get_size (track, &blocks, NULL);
brasero_job_set_output_size_for_current_track (job,
blocks,
blocks * DVDCSS_BLOCK_SIZE);
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 Sat Mar 28 08:14:58 2009
@@ -49,6 +49,8 @@
#include "brasero-drive.h"
#include "burn-growisofs.h"
#include "burn-growisofs-common.h"
+#include "brasero-track-data.h"
+#include "brasero-track-image.h"
BRASERO_PLUGIN_BOILERPLATE (BraseroGrowisofs, brasero_growisofs, BRASERO_TYPE_PROCESS, BraseroProcess);
@@ -331,7 +333,7 @@
return result;
}
- result = brasero_track_get_data_paths (track,
+ result = brasero_track_data_get_paths (BRASERO_TRACK_DATA (track),
(input.subtype.fs_type & BRASERO_IMAGE_FS_JOLIET) != 0,
grafts_path,
excluded_path,
@@ -409,7 +411,7 @@
BraseroBurnResult result;
BraseroJobAction action;
BraseroBurnFlag flags;
- gint64 sectors = 0;
+ guint64 sectors = 0;
gchar *device;
guint speed;
@@ -512,7 +514,7 @@
BraseroTrack *track;
brasero_job_get_current_track (BRASERO_JOB (growisofs), &track);
- localpath = brasero_track_get_image_source (track, FALSE);
+ localpath = brasero_track_image_get_source (BRASERO_TRACK_IMAGE (track), FALSE);
if (!localpath) {
g_set_error (error,
BRASERO_BURN_ERROR,
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 Sat Mar 28 08:14:58 2009
@@ -50,6 +50,8 @@
#include "burn-libburn-common.h"
#include "burn-libburnia.h"
#include "burn-libburn.h"
+#include "brasero-track-image.h"
+#include "brasero-track-stream.h"
BRASERO_PLUGIN_BOILERPLATE (BraseroLibburn, brasero_libburn, BRASERO_TYPE_JOB, BraseroJob);
@@ -295,7 +297,7 @@
GError **error)
{
int fd;
- gint64 size = 0;
+ guint64 size = 0;
BraseroTrackType type;
BraseroLibburnPrivate *priv;
BraseroBurnResult result = BRASERO_BURN_OK;
@@ -330,7 +332,7 @@
break;
}
- case BRASERO_TRACK_TYPE_AUDIO:
+ case BRASERO_TRACK_TYPE_STREAM:
{
GSList *tracks;
@@ -339,7 +341,7 @@
BraseroTrack *track;
track = tracks->data;
- brasero_track_get_audio_length (track, &size);
+ brasero_track_stream_get_length (BRASERO_TRACK_STREAM (track), &size);
size = BRASERO_DURATION_TO_BYTES (size);
/* we dup the descriptor so the same
@@ -382,13 +384,13 @@
BraseroTrackType type;
track = tracks->data;
- brasero_track_get_type (track, &type);
- if (type.type == BRASERO_TRACK_TYPE_AUDIO) {
+ brasero_track_get_track_type (track, &type);
+ if (type.type == BRASERO_TRACK_TYPE_STREAM) {
gchar *audiopath;
- gint64 size;
+ guint64 size;
- audiopath = brasero_track_get_audio_source (track, FALSE);
- brasero_track_get_audio_length (track, &size);
+ audiopath = brasero_track_stream_get_source (BRASERO_TRACK_STREAM (track), FALSE);
+ brasero_track_stream_get_length (BRASERO_TRACK_STREAM (track), &size);
size = BRASERO_DURATION_TO_BYTES (size);
result = brasero_libburn_add_file_track (session,
@@ -402,16 +404,16 @@
}
else if (type.type == BRASERO_TRACK_TYPE_IMAGE) {
gchar *imagepath;
- gint64 size;
+ guint64 size;
gint mode;
if (type.subtype.img_format == BRASERO_IMAGE_FORMAT_BIN) {
mode = BURN_MODE1;
- imagepath = brasero_track_get_image_source (track, FALSE);
+ imagepath = brasero_track_image_get_source (BRASERO_TRACK_IMAGE (track), FALSE);
}
else if (type.subtype.img_format == BRASERO_IMAGE_FORMAT_NONE) {
mode = BURN_MODE1;
- imagepath = brasero_track_get_image_source (track, FALSE);
+ imagepath = brasero_track_image_get_source (BRASERO_TRACK_IMAGE (track), FALSE);
}
else
BRASERO_JOB_NOT_SUPPORTED (self);
@@ -419,11 +421,9 @@
if (!imagepath)
return BRASERO_BURN_ERR;
- result = brasero_track_get_image_size (track,
- NULL,
- NULL,
- &size,
- error);
+ result = brasero_track_get_size (track,
+ NULL,
+ &size);
if (result != BRASERO_BURN_OK)
return BRASERO_BURN_ERR;
@@ -478,7 +478,7 @@
GError **error)
{
guint64 rate;
- gint64 blocks = 0;
+ guint64 blocks = 0;
BraseroMedia media;
BraseroBurnFlag flags;
BraseroBurnResult result;
@@ -522,7 +522,7 @@
* handles all by himself where to start writing. */
if (BRASERO_MEDIUM_RANDOM_WRITABLE (media)
&& (flags & BRASERO_BURN_FLAG_MERGE)) {
- gint64 address = 0;
+ guint64 address = 0;
brasero_job_get_next_writable_address (BRASERO_JOB (self), &address);
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 Sat Mar 28 08:14:58 2009
@@ -49,6 +49,8 @@
#include "burn-job.h"
#include "burn-plugin.h"
#include "burn-libburn-common.h"
+#include "brasero-track-data.h"
+#include "brasero-track-image.h"
BRASERO_PLUGIN_BOILERPLATE (BraseroLibisofs, brasero_libisofs, BRASERO_TYPE_JOB, BraseroJob);
@@ -91,27 +93,24 @@
}
if (brasero_job_get_fd_out (BRASERO_JOB (self), NULL) != BRASERO_BURN_OK) {
- BraseroTrack *track = NULL;
- BraseroTrackType type;
+ BraseroTrackImage *track = NULL;
gchar *output = NULL;
/* Let's make a track */
- brasero_job_get_output_type (BRASERO_JOB (self), &type);
- track = brasero_track_new (type.type);
-
+ track = brasero_track_image_new ();
brasero_job_get_image_output (BRASERO_JOB (self),
&output,
NULL);
- brasero_track_set_image_source (track,
+ brasero_track_image_set_source (track,
output,
NULL,
BRASERO_IMAGE_FORMAT_BIN);
- brasero_job_add_track (BRASERO_JOB (self), track);
+ brasero_job_add_track (BRASERO_JOB (self), BRASERO_TRACK (track));
/* It's good practice to unref the track afterwards as we don't
* need it anymore. BraseroBurnSession refs it. */
- brasero_track_unref (track);
+ g_object_unref (track);
}
brasero_job_finished_track (BRASERO_JOB (self));
@@ -434,8 +433,8 @@
IsoReadOpts *opts;
BraseroMedia media;
IsoDataSource *src;
- gint64 start_block;
- gint64 session_block;
+ guint64 start_block;
+ guint64 session_block;
BraseroLibisofsPrivate *priv;
priv = BRASERO_LIBISOFS_PRIVATE (self);
@@ -567,7 +566,7 @@
goto end;
}
else if (flags & BRASERO_BURN_FLAG_APPEND) {
- gint64 start_block;
+ guint64 start_block;
brasero_job_get_next_writable_address (BRASERO_JOB (self), &start_block);
iso_write_opts_set_ms_block (opts, start_block);
@@ -578,12 +577,12 @@
/* copy the list as we're going to reorder it */
brasero_job_get_current_track (BRASERO_JOB (self), &track);
- grafts = brasero_track_get_data_grafts_source (track);
+ grafts = brasero_track_data_get_grafts (BRASERO_TRACK_DATA (track));
grafts = g_slist_copy (grafts);
grafts = g_slist_sort (grafts, brasero_libisofs_sort_graft_points);
/* add global exclusions */
- for (excluded = brasero_track_get_data_excluded_source (track, FALSE);
+ for (excluded = brasero_track_data_get_excluded (BRASERO_TRACK_DATA (track), FALSE);
excluded; excluded = excluded->next) {
gchar *uri, *local;
@@ -794,7 +793,7 @@
gint64 size;
BraseroTrackType type;
- brasero_track_get_type (track, &type);
+ brasero_track_get_track_type (track, &type);
if ((type.subtype.fs_type & BRASERO_IMAGE_FS_ISO)
&& (type.subtype.fs_type & BRASERO_IMAGE_ISO_FS_LEVEL_3))
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 Sat Mar 28 08:14:58 2009
@@ -50,6 +50,7 @@
#include "burn-job.h"
#include "burn-plugin.h"
#include "burn-local-image.h"
+#include "brasero-track-image.h"
BRASERO_PLUGIN_BOILERPLATE (BraseroLocalTrack, brasero_local_track, BRASERO_TYPE_JOB, BraseroJob);
@@ -414,7 +415,7 @@
/* get the name of the file that was downloaded */
brasero_job_get_current_track (BRASERO_JOB (self), &track);
- source = brasero_track_get_image_source (track, TRUE);
+ source = brasero_track_image_get_source (BRASERO_TRACK_IMAGE (track), TRUE);
name = g_path_get_basename (source);
g_free (source);
@@ -487,7 +488,7 @@
* directory to check our download integrity.
* Try all types of checksum. */
brasero_job_get_current_track (BRASERO_JOB (self), &track);
- uri = brasero_track_get_image_source (track, TRUE);
+ uri = brasero_track_image_get_source (BRASERO_TRACK_IMAGE (track), TRUE);
dest = g_file_new_for_path (priv->checksum_path);
/* Try with three difference sources */
@@ -585,14 +586,14 @@
{
BraseroTrack *track;
BraseroTrackType input;
+ BraseroTrack *current = NULL;
BraseroLocalTrackPrivate *priv;
priv = BRASERO_LOCAL_TRACK_PRIVATE (self);
/* now we update all the track with the local uris in retval */
- brasero_job_get_current_track (BRASERO_JOB (self), &track);
- track = brasero_track_copy (track);
- brasero_track_get_type (track, &input);
+ 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) {
@@ -600,8 +601,15 @@
GSList *next;
GSList *grafts;
GSList *unreadable;
+ guint64 file_num = 0;
+
+ track = BRASERO_TRACK (brasero_track_data_new ());
+ brasero_track_data_add_fs (BRASERO_TRACK_DATA (track), input.subtype.fs_type);
- grafts = brasero_track_get_data_grafts_source (track);
+ brasero_track_data_get_file_num (BRASERO_TRACK_DATA (current), &file_num);
+ brasero_track_data_set_file_num (BRASERO_TRACK_DATA (track), file_num);
+
+ grafts = brasero_track_data_get_grafts (BRASERO_TRACK_DATA (current));
for (; grafts; grafts = grafts->next) {
BraseroGraftPt *graft;
gchar *uri;
@@ -619,7 +627,7 @@
/* Translate the globally excluded.
* NOTE: if we can't find a parent for an excluded URI that
* means it shouldn't be included. */
- unreadable = brasero_track_get_data_excluded_source (track, FALSE);
+ unreadable = brasero_track_data_get_excluded (BRASERO_TRACK_DATA (current), FALSE);
for (; unreadable; unreadable = next) {
gchar *new_uri;
@@ -635,15 +643,22 @@
}
break;
- case BRASERO_TRACK_TYPE_AUDIO: {
+ case BRASERO_TRACK_TYPE_STREAM: {
gchar *uri;
gchar *newuri;
- uri = brasero_track_get_audio_source (track, TRUE);
+ uri = brasero_track_stream_get_source (BRASERO_TRACK_STREAM (current), TRUE);
newuri = brasero_local_track_translate_uri (self, uri);
- brasero_track_set_audio_source (track,
- newuri,
- input.subtype.audio_format);
+
+ track = BRASERO_TRACK (brasero_track_stream_new ());
+ 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_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)));
+ brasero_track_stream_set_info (BRASERO_TRACK_STREAM (track),
+ brasero_stream_info_copy (brasero_track_stream_get_info (BRASERO_TRACK_STREAM (current))));
g_free (uri);
}
break;
@@ -653,15 +668,17 @@
gchar *newtoc;
gchar *newimage;
- uri = brasero_track_get_image_source (track, TRUE);
+ /* FIXME: save the size */
+ uri = brasero_track_image_get_source (BRASERO_TRACK_IMAGE (current), TRUE);
newimage = brasero_local_track_translate_uri (self, uri);
g_free (uri);
- uri = brasero_track_get_toc_source (track, TRUE);
+ uri = brasero_track_image_get_toc_source (BRASERO_TRACK_IMAGE (current), TRUE);
newtoc = brasero_local_track_translate_uri (self, uri);
g_free (uri);
- brasero_track_set_image_source (track,
+ track = BRASERO_TRACK (brasero_track_image_new ());
+ brasero_track_image_set_source (BRASERO_TRACK_IMAGE (track),
newimage,
newtoc,
input.subtype.img_format);
@@ -681,7 +698,7 @@
/* It's good practice to unref the track afterwards as we don't need it
* anymore. BraseroTaskCtx refs it. */
- brasero_track_unref (track);
+ g_object_unref (track);
return BRASERO_BURN_OK;
}
@@ -932,7 +949,7 @@
switch (input.type) {
case BRASERO_TRACK_TYPE_DATA:
/* we put all the non local graft point uris in the hash */
- grafts = brasero_track_get_data_grafts_source (track);
+ grafts = brasero_track_data_get_grafts (BRASERO_TRACK_DATA (track));
for (; grafts; grafts = grafts->next) {
BraseroGraftPt *graft;
@@ -944,16 +961,16 @@
break;
- case BRASERO_TRACK_TYPE_AUDIO:
+ case BRASERO_TRACK_TYPE_STREAM:
/* NOTE: don't delete URI as they will be inserted in hash */
- uri = brasero_track_get_audio_source (track, TRUE);
+ 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:
/* NOTE: don't delete URI as they will be inserted in hash */
- uri = brasero_track_get_image_source (track, TRUE);
+ 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);
@@ -962,7 +979,7 @@
priv->download_checksum = TRUE;
- uri = brasero_track_get_toc_source (track, 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);
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 Sat Mar 28 08:14:58 2009
@@ -42,6 +42,10 @@
#include "burn-plugin.h"
#include "burn-uri.h"
+#include "brasero-track.h"
+#include "brasero-track-data.h"
+#include "brasero-track-image.h"
+
BRASERO_PLUGIN_BOILERPLATE (BraseroBurnURI, brasero_burn_uri, BRASERO_TYPE_JOB, BraseroJob);
struct _BraseroBurnURIPrivate {
@@ -133,7 +137,7 @@
}
brasero_job_get_current_track (BRASERO_JOB (self), ¤t);
- current_grafts = brasero_track_get_data_grafts_source (current);
+ current_grafts = brasero_track_data_get_grafts (BRASERO_TRACK_DATA (current));
while ((info = g_file_enumerator_next_file (enumerator, cancel, error))) {
if (g_file_info_get_file_type (info) == G_FILE_TYPE_DIRECTORY) {
@@ -297,10 +301,10 @@
BraseroTrackType type = { 0, };
BraseroTrack *current = NULL;
BraseroBurnURIPrivate *priv;
+ BraseroTrackData *track;
GSList *excluded = NULL;
GSList *grafts = NULL;
- BraseroTrack *track;
- gint64 num = 0;
+ guint64 num = 0;
GSList *src;
priv = BRASERO_BURN_URI_PRIVATE (self);
@@ -310,16 +314,17 @@
TRUE);
brasero_job_get_current_track (BRASERO_JOB (self), ¤t);
- brasero_track_get_type (current, &type);
+ brasero_track_get_track_type (current, &type);
/* This is for IMAGE tracks */
if (type.type == BRASERO_TRACK_TYPE_IMAGE) {
gchar *uri;
gchar *path_toc;
gchar *path_image;
+ BraseroTrackImage *image;
path_image = NULL;
- uri = brasero_track_get_image_source (current, TRUE);
+ uri = brasero_track_image_get_source (BRASERO_TRACK_IMAGE (current), TRUE);
if (!brasero_burn_uri_retrieve_path (self, uri, &path_image)) {
g_free (uri);
goto end;
@@ -327,7 +332,7 @@
g_free (uri);
path_toc = NULL;
- uri = brasero_track_get_image_source (current, TRUE);
+ uri = brasero_track_image_get_source (BRASERO_TRACK_IMAGE (current), TRUE);
if (!brasero_burn_uri_retrieve_path (self, uri, &path_toc)) {
g_free (path_image);
g_free (uri);
@@ -335,12 +340,12 @@
}
g_free (uri);
- track = brasero_track_new (BRASERO_TRACK_TYPE_IMAGE);
- brasero_track_set_image_source (track,
+ image = brasero_track_image_new ();
+ brasero_track_image_set_source (image,
path_image,
path_toc,
type.subtype.img_format);
- priv->track = track;
+ priv->track = BRASERO_TRACK (image);
g_free (path_toc);
g_free (path_image);
@@ -348,7 +353,7 @@
}
/* This is for DATA tracks */
- for (src = brasero_track_get_data_grafts_source (current); src; src = src->next) {
+ for (src = brasero_track_data_get_grafts (BRASERO_TRACK_DATA (current)); src; src = src->next) {
GFile *file;
GFileInfo *info;
BraseroGraftPt *graft;
@@ -458,7 +463,7 @@
grafts = g_slist_reverse (grafts);
/* remove all excluded starting by burn:// from the list */
- for (src = brasero_track_get_data_excluded_source (current, FALSE); src; src = src->next) {
+ for (src = brasero_track_data_get_excluded (BRASERO_TRACK_DATA (current), FALSE); src; src = src->next) {
gchar *uri;
uri = src->data;
@@ -473,16 +478,16 @@
}
excluded = g_slist_reverse (excluded);
- track = brasero_track_new (brasero_track_get_type (current, &type));
- brasero_track_add_data_fs (track, type.subtype.fs_type);
+ track = brasero_track_data_new ();
+ brasero_track_data_add_fs (track, type.subtype.fs_type);
- brasero_track_get_data_file_num (current, &num);
- brasero_track_set_data_file_num (track, num);
+ brasero_track_data_get_file_num (BRASERO_TRACK_DATA (current), &num);
+ brasero_track_data_set_file_num (track, num);
- brasero_track_set_data_source (track,
+ brasero_track_data_set_source (track,
grafts,
excluded);
- priv->track = track;
+ priv->track = BRASERO_TRACK (track);
end:
@@ -587,7 +592,7 @@
switch (input.type) {
case BRASERO_TRACK_TYPE_DATA:
/* we put all the non local graft point uris in the hash */
- grafts = brasero_track_get_data_grafts_source (track);
+ grafts = brasero_track_data_get_grafts (BRASERO_TRACK_DATA (track));
for (; grafts; grafts = grafts->next) {
BraseroGraftPt *graft;
@@ -601,14 +606,14 @@
case BRASERO_TRACK_TYPE_IMAGE:
/* NOTE: don't delete URI as they will be inserted in hash */
- uri = brasero_track_get_image_source (track, TRUE);
+ 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_get_toc_source (track, TRUE);
+ 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);
Modified: trunk/libbrasero-burn/plugins/transcode/burn-normalize.c
==============================================================================
--- trunk/libbrasero-burn/plugins/transcode/burn-normalize.c (original)
+++ trunk/libbrasero-burn/plugins/transcode/burn-normalize.c Sat Mar 28 08:14:58 2009
@@ -89,7 +89,7 @@
}
/* create a new one */
- uri = brasero_track_get_audio_source (track, TRUE);
+ uri = brasero_track_stream_get_source (BRASERO_TRACK_STREAM (track), TRUE);
source = gst_element_make_from_uri (GST_URI_SRC, uri, NULL);
if (source == NULL) {
g_free (uri);
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 Sat Mar 28 08:14:58 2009
@@ -188,8 +188,8 @@
/* we need to reach the song start and set a possible end; this is only
* needed when it is decoding a song. Otherwise*/
brasero_job_get_current_track (BRASERO_JOB (transcode), &track);
- start = brasero_track_get_audio_start (track);
- end = brasero_track_get_audio_end (track);
+ start = brasero_track_stream_get_start (BRASERO_TRACK_STREAM (track));
+ end = brasero_track_stream_get_end (BRASERO_TRACK_STREAM (track));
priv->segment_start = BRASERO_DURATION_TO_BYTES (start);
priv->segment_end = BRASERO_DURATION_TO_BYTES (end);
@@ -370,7 +370,7 @@
/* source */
brasero_job_get_current_track (BRASERO_JOB (transcode), &track);
- uri = brasero_track_get_audio_source (track, TRUE);
+ uri = brasero_track_stream_get_source (BRASERO_TRACK_STREAM (track), TRUE);
source = gst_element_make_from_uri (GST_URI_SRC, uri, NULL);
g_free (uri);
@@ -578,8 +578,8 @@
BraseroTrack *track;
brasero_job_get_current_track (BRASERO_JOB (transcode), &track);
- brasero_track_set_audio_boundaries (track, -1, duration, -1);
- duration += brasero_track_get_audio_gap (track);
+ brasero_track_stream_set_boundaries (BRASERO_TRACK_STREAM (track), -1, duration, -1);
+ duration += brasero_track_stream_get_gap (BRASERO_TRACK_STREAM (track));
/* if transcoding on the fly we should add some length just to make
* sure we won't be too short (gstreamer duration discrepancy) */
@@ -587,7 +587,7 @@
BRASERO_DURATION_TO_SECTORS (duration),
BRASERO_DURATION_TO_BYTES (duration));
- uri = brasero_track_get_audio_source (track, FALSE);
+ uri = brasero_track_stream_get_source (BRASERO_TRACK_STREAM (track), FALSE);
BRASERO_JOB_LOG (transcode,
"Song %s"
"\nsectors %" G_GINT64_FORMAT
@@ -607,24 +607,24 @@
BraseroTrack *src,
GError **error)
{
- BraseroSongInfo *src_info, *dest_info;
+ BraseroStreamInfo *src_info, *dest_info;
BraseroTrack *dest;
- gint64 duration;
+ guint64 duration;
/* it means the same file uri is in the selection and was already
* checked. Simply get the values for the length and other information
* and copy them. */
/* NOTE: no need to copy the length since if they are sibling that means
* that they have the same length */
- brasero_track_get_audio_length (src, &duration);
+ brasero_track_stream_get_length (BRASERO_TRACK_STREAM (src), &duration);
brasero_job_set_output_size_for_current_track (BRASERO_JOB (transcode),
BRASERO_DURATION_TO_SECTORS (duration),
BRASERO_DURATION_TO_BYTES (duration));
/* copy the info we are missing */
- src_info = brasero_track_get_audio_info (src);
+ src_info = brasero_track_stream_get_info (BRASERO_TRACK_STREAM (src));
brasero_job_get_current_track (BRASERO_JOB (transcode), &dest);
- dest_info = brasero_track_get_audio_info (dest);
+ dest_info = brasero_track_stream_get_info (BRASERO_TRACK_STREAM (dest));
if (!dest_info->artist)
dest_info->artist = g_strdup (src_info->artist);
@@ -641,16 +641,16 @@
BraseroTrack *src,
GError **error)
{
- BraseroSongInfo *info;
+ BraseroTrackStream *dest;
+ BraseroStreamInfo *info;
BraseroTrack *track;
- BraseroTrack *dest;
- gint64 length = 0;
+ guint64 length = 0;
gchar *path_dest;
gchar *path_src;
/* it means the file is already in the selection. Simply create a
* symlink pointing to first file in the selection with the same uri */
- path_src = brasero_track_get_audio_source (src, FALSE);
+ path_src = brasero_track_stream_get_source (BRASERO_TRACK_STREAM (src), FALSE);
brasero_job_get_audio_output (BRASERO_JOB (transcode), &path_dest);
if (symlink (path_src, path_dest) == -1) {
@@ -666,28 +666,28 @@
goto error;
}
- dest = brasero_track_new (BRASERO_TRACK_TYPE_AUDIO);
- brasero_track_set_audio_source (dest,
- path_dest,
- BRASERO_AUDIO_FORMAT_RAW|
- BRASERO_AUDIO_FORMAT_44100);
+ dest = brasero_track_stream_new ();
+ brasero_track_stream_set_source (dest, path_dest);
+ brasero_track_stream_set_format (dest,
+ BRASERO_AUDIO_FORMAT_RAW|
+ BRASERO_AUDIO_FORMAT_44100);
/* NOTE: there is no gap and start = 0 since these tracks are the result
* of the transformation of previous ones */
- brasero_track_get_audio_length (src, &length);
- brasero_track_set_audio_boundaries (track, 0, length, 0);
+ brasero_track_stream_get_length (BRASERO_TRACK_STREAM (src), &length);
+ brasero_track_stream_set_boundaries (dest, 0, length, 0);
/* copy all infos but from the current track */
brasero_job_get_current_track (BRASERO_JOB (transcode), &track);
- info = brasero_track_get_audio_info (track);
- info = brasero_song_info_copy (info);
- brasero_track_set_audio_info (track, info);
+ info = brasero_track_stream_get_info (BRASERO_TRACK_STREAM (track));
+ info = brasero_stream_info_copy (info);
+ brasero_track_stream_set_info (dest, info);
- brasero_job_add_track (BRASERO_JOB (transcode), dest);
+ brasero_job_add_track (BRASERO_JOB (transcode), BRASERO_TRACK (dest));
/* It's good practice to unref the track afterwards as we don't need it
* anymore. BraseroTaskCtx refs it. */
- brasero_track_unref (track);
+ g_object_unref (dest);
g_free (path_src);
g_free (path_dest);
@@ -714,9 +714,9 @@
brasero_job_get_action (BRASERO_JOB (transcode), &action);
brasero_job_get_current_track (BRASERO_JOB (transcode), &track);
- start = brasero_track_get_audio_start (track);
- end = brasero_track_get_audio_end (track);
- uri = brasero_track_get_audio_source (track, TRUE);
+ start = brasero_track_stream_get_start (BRASERO_TRACK_STREAM (track));
+ end = brasero_track_stream_get_end (BRASERO_TRACK_STREAM (track));
+ uri = brasero_track_stream_get_source (BRASERO_TRACK_STREAM (track), TRUE);
brasero_job_get_done_tracks (BRASERO_JOB (transcode), &songs);
@@ -727,19 +727,19 @@
BraseroTrack *iter_track;
iter_track = iter->data;
- iter_uri = brasero_track_get_audio_source (iter_track, TRUE);
+ iter_uri = brasero_track_stream_get_source (BRASERO_TRACK_STREAM (iter_track), TRUE);
if (strcmp (iter_uri, uri))
continue;
- iter_end = brasero_track_get_audio_end (iter_track);
+ iter_end = brasero_track_stream_get_end (BRASERO_TRACK_STREAM (iter_track));
if (!iter_end)
continue;
if (iter_end != end)
continue;
- iter_start = brasero_track_get_audio_start (track);
+ iter_start = brasero_track_stream_get_start (BRASERO_TRACK_STREAM (track));
if (iter_start == start) {
g_free (uri);
return iter_track;
@@ -799,7 +799,7 @@
* carry on with a lengthy get size and the library will do it
* itself. */
brasero_job_get_current_track (job, &track);
- if (brasero_track_get_audio_end (track) > 0)
+ if (brasero_track_stream_get_end (BRASERO_TRACK_STREAM (track)) > 0)
return BRASERO_BURN_NOT_SUPPORTED;
if (!brasero_transcode_create_pipeline (transcode, error))
@@ -935,35 +935,36 @@
static void
brasero_transcode_push_track (BraseroTranscode *transcode)
{
- gint64 length = 0;
- BraseroTrack *track;
+ guint64 length = 0;
gchar *output = NULL;
- BraseroSongInfo *info;
BraseroTrackType type;
+ BraseroStreamInfo *info;
+ BraseroTrack *src = NULL;
+ BraseroTrackStream *track;
brasero_job_get_audio_output (BRASERO_JOB (transcode), &output);
- brasero_job_get_current_track (BRASERO_JOB (transcode), &track);
+ brasero_job_get_current_track (BRASERO_JOB (transcode), &src);
- brasero_track_get_audio_length (track, &length);
+ brasero_track_stream_get_length (BRASERO_TRACK_STREAM (src), &length);
- info = brasero_track_get_audio_info (track);
- info = brasero_song_info_copy (info);
+ info = brasero_track_stream_get_info (BRASERO_TRACK_STREAM (src));
+ info = brasero_stream_info_copy (info);
brasero_job_get_output_type (BRASERO_JOB (transcode), &type);
- track = brasero_track_new (BRASERO_TRACK_TYPE_AUDIO);
- brasero_track_set_audio_source (track,
- output,
- BRASERO_AUDIO_FORMAT_RAW|
- BRASERO_AUDIO_FORMAT_44100);
- brasero_track_set_audio_boundaries (track, 0, length, 0);
- brasero_track_set_audio_info (track, info);
+ track = brasero_track_stream_new ();
+ brasero_track_stream_set_source (track, output);
+ brasero_track_stream_set_format (track,
+ BRASERO_AUDIO_FORMAT_RAW|
+ BRASERO_AUDIO_FORMAT_44100);
+ brasero_track_stream_set_boundaries (track, 0, length, 0);
+ brasero_track_stream_set_info (track, info);
- brasero_job_add_track (BRASERO_JOB (transcode), track);
+ brasero_job_add_track (BRASERO_JOB (transcode), BRASERO_TRACK (track));
/* It's good practice to unref the track afterwards as we don't need it
* anymore. BraseroTaskCtx refs it. */
- brasero_track_unref (track);
+ g_object_unref (track);
brasero_job_finished_track (BRASERO_JOB (transcode));
}
@@ -1005,7 +1006,7 @@
static gboolean
brasero_transcode_pad (BraseroTranscode *transcode, int fd, GError **error)
{
- gint64 length = 0;
+ guint64 length = 0;
gint64 bytes2write = 0;
BraseroTrack *track = NULL;
BraseroTranscodePrivate *priv;
@@ -1019,7 +1020,7 @@
* - second we must output a multiple of 2352 to respect sector
* boundaries */
brasero_job_get_current_track (BRASERO_JOB (transcode), &track);
- brasero_track_get_audio_length (track, &length);
+ brasero_track_stream_get_length (BRASERO_TRACK_STREAM (track), &length);
if (priv->pos < BRASERO_DURATION_TO_BYTES (length)) {
gint64 b_written = 0;
@@ -1248,12 +1249,12 @@
BraseroTranscode *transcode)
{
BraseroTrack *track;
- BraseroSongInfo *info;
BraseroJobAction action;
+ BraseroStreamInfo *info;
brasero_job_get_action (BRASERO_JOB (transcode), &action);
brasero_job_get_current_track (BRASERO_JOB (transcode), &track);
- info = brasero_track_get_audio_info (track);
+ info = brasero_track_stream_get_info (BRASERO_TRACK_STREAM (track));
BRASERO_JOB_LOG (transcode, "Retrieving tags");
@@ -1278,7 +1279,7 @@
/* this is only useful when we try to have the size */
gst_tag_list_get_uint64 (list, tag, &duration);
- brasero_track_set_audio_boundaries (track, 0, duration, -1);
+ brasero_track_stream_set_boundaries (BRASERO_TRACK_STREAM (track), 0, duration, -1);
}
}
@@ -1299,7 +1300,7 @@
priv->set_active_state = TRUE;
brasero_job_get_current_track (BRASERO_JOB (transcode), &track);
- uri = brasero_track_get_audio_source (track, FALSE);
+ uri = brasero_track_stream_get_source (BRASERO_TRACK_STREAM (track), FALSE);
brasero_job_get_action (BRASERO_JOB (transcode), &action);
if (action == BRASERO_JOB_ACTION_SIZE) {
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 Sat Mar 28 08:14:58 2009
@@ -50,7 +50,7 @@
GstElement *audio;
GstElement *video;
- BraseroAudioFormat format;
+ BraseroStreamFormat format;
guint svcd:1;
guint is_video_dvd:1;
@@ -90,10 +90,10 @@
static void
brasero_vob_finished (BraseroVob *vob)
{
+ BraseroTrackStream *track;
BraseroVobPrivate *priv;
BraseroTrackType type;
gchar *output = NULL;
- BraseroTrack *track;
priv = BRASERO_VOB_PRIVATE (vob);
@@ -101,13 +101,12 @@
brasero_job_get_output_type (BRASERO_JOB (vob), &type);
brasero_job_get_audio_output (BRASERO_JOB (vob), &output);
- track = brasero_track_new (BRASERO_TRACK_TYPE_AUDIO);
- brasero_track_set_audio_source (track,
- output,
- type.subtype.audio_format);
+ track = brasero_track_stream_new ();
+ brasero_track_stream_set_source (track, output);
+ brasero_track_stream_set_format (track, type.subtype.audio_format);
- brasero_job_add_track (BRASERO_JOB (vob), track);
- brasero_track_unref (track);
+ brasero_job_add_track (BRASERO_JOB (vob), BRASERO_TRACK (track));
+ g_object_unref (track);
g_free (output);
brasero_job_finished_track (BRASERO_JOB (vob));
@@ -957,7 +956,7 @@
/* source */
brasero_job_get_current_track (BRASERO_JOB (vob), &track);
- uri = brasero_track_get_audio_source (track, TRUE);
+ uri = brasero_track_stream_get_source (BRASERO_TRACK_STREAM (track), TRUE);
source = gst_element_make_from_uri (GST_URI_SRC, uri, NULL);
if (source == NULL) {
g_set_error (error,
Modified: trunk/libbrasero-burn/plugins/vcdimager/burn-vcdimager.c
==============================================================================
--- trunk/libbrasero-burn/plugins/vcdimager/burn-vcdimager.c (original)
+++ trunk/libbrasero-burn/plugins/vcdimager/burn-vcdimager.c Sat Mar 28 08:14:58 2009
@@ -41,6 +41,7 @@
#include "burn-job.h"
#include "burn-process.h"
#include "burn-vcdimager.h"
+#include "brasero-track-stream.h"
BRASERO_PLUGIN_BOILERPLATE (BraseroVcdImager, brasero_vcd_imager, BRASERO_TYPE_PROCESS, BraseroProcess);
@@ -255,7 +256,7 @@
if (success < 0)
goto error;
- video = brasero_track_get_audio_source (track, FALSE);
+ video = brasero_track_stream_get_source (BRASERO_TRACK_STREAM (track), FALSE);
success = xmlTextWriterWriteAttribute (xml,
(xmlChar *) "src",
(xmlChar *) video);
Modified: trunk/libbrasero-media/brasero-medium.c
==============================================================================
--- trunk/libbrasero-media/brasero-medium.c (original)
+++ trunk/libbrasero-media/brasero-medium.c Sat Mar 28 08:14:58 2009
@@ -366,8 +366,8 @@
/**
* brasero_medium_get_last_data_track_address:
* @medium: #BraseroMedium
- * @byte: a #gint64 * or NULL
- * @sector: a #gint64 * or NULL
+ * @byte: a #guint64 * or NULL
+ * @sector: a #guint64 * or NULL
*
* Stores in either @byte (in bytes) or in @sector (in blocks) the address where
* the last session starts. This is useful when creating a multisession image or
@@ -376,8 +376,8 @@
**/
gboolean
brasero_medium_get_last_data_track_address (BraseroMedium *medium,
- gint64 *byte,
- gint64 *sector)
+ guint64 *byte,
+ guint64 *sector)
{
GSList *iter;
BraseroMediumPrivate *priv;
@@ -396,13 +396,8 @@
track = current;
}
- if (!track) {
- if (byte)
- *byte = -1;
- if (sector)
- *sector = -1;
+ if (!track)
return FALSE;
- }
if (byte)
*byte = track->start * priv->block_size;
@@ -416,8 +411,8 @@
/**
* brasero_medium_get_last_data_track_space:
* @medium: #BraseroMedium
- * @size: a #gint64 * or NULL
- * @blocks: a #gint64 * or NULL
+ * @size: a #guint64 * or NULL
+ * @blocks: a #guint64 * or NULL
*
* Stores in either @size (in bytes) or in @blocks (in blocks) the space used by
* the last track on the medium.
@@ -425,8 +420,8 @@
**/
gboolean
brasero_medium_get_last_data_track_space (BraseroMedium *medium,
- gint64 *size,
- gint64 *blocks)
+ guint64 *size,
+ guint64 *blocks)
{
GSList *iter;
BraseroMediumPrivate *priv;
@@ -524,8 +519,8 @@
* brasero_medium_get_track_space:
* @medium: a #BraseroMedium
* @num: a #guint
- * @size: a #gint64 * or NULL
- * @blocks: a #gint64 * or NULL
+ * @size: a #guint64 * or NULL
+ * @blocks: a #guint64 * or NULL
*
* Stores in either @size (in bytes) or in @blocks (in blocks) the space used
* by session @num on the disc.
@@ -537,8 +532,8 @@
gboolean
brasero_medium_get_track_space (BraseroMedium *medium,
guint num,
- gint64 *size,
- gint64 *blocks)
+ guint64 *size,
+ guint64 *blocks)
{
BraseroMediumPrivate *priv;
BraseroMediumTrack *track;
@@ -569,8 +564,8 @@
* brasero_medium_get_track_address:
* @medium: a #BraseroMedium
* @num: a #guint
- * @byte: a #gint64 * or NULL
- * @sector: a #gint64 * or NULL
+ * @byte: a #guint64 * or NULL
+ * @sector: a #guint64 * or NULL
*
* Stores in either @byte (in bytes) or in @sector (in blocks) the address at
* which the session identified by @num starts.
@@ -582,8 +577,8 @@
gboolean
brasero_medium_get_track_address (BraseroMedium *medium,
guint num,
- gint64 *byte,
- gint64 *sector)
+ guint64 *byte,
+ guint64 *sector)
{
BraseroMediumPrivate *priv;
BraseroMediumTrack *track;
Modified: trunk/libbrasero-media/brasero-medium.h
==============================================================================
--- trunk/libbrasero-media/brasero-medium.h (original)
+++ trunk/libbrasero-media/brasero-medium.h Sat Mar 28 08:14:58 2009
@@ -111,25 +111,25 @@
gboolean
brasero_medium_get_last_data_track_space (BraseroMedium *medium,
- gint64 *size,
- gint64 *blocks);
+ guint64 *size,
+ guint64 *blocks);
gboolean
brasero_medium_get_last_data_track_address (BraseroMedium *medium,
- gint64 *byte,
- gint64 *sector);
+ guint64 *byte,
+ guint64 *sector);
gboolean
brasero_medium_get_track_space (BraseroMedium *medium,
guint num,
- gint64 *size,
- gint64 *blocks);
+ guint64 *size,
+ guint64 *blocks);
gboolean
brasero_medium_get_track_address (BraseroMedium *medium,
guint num,
- gint64 *byte,
- gint64 *sector);
+ guint64 *byte,
+ guint64 *sector);
G_END_DECLS
Modified: trunk/src/brasero-app.c
==============================================================================
--- trunk/src/brasero-app.c (original)
+++ trunk/src/brasero-app.c Sat Mar 28 08:14:58 2009
@@ -49,11 +49,12 @@
#include "brasero-tags.h"
#include "brasero-burn.h"
+#include "brasero-track-disc.h"
+#include "brasero-track-image.h"
#include "brasero-session.h"
#include "brasero-burn-lib.h"
-#include "brasero-image-option-dialog.h"
-#include "brasero-disc-copy-dialog.h"
+#include "brasero-burn-options.h"
#include "brasero-burn-dialog.h"
#include "brasero-jacket-edit.h"
@@ -695,31 +696,41 @@
return success;
}
-void
-brasero_app_burn_image (BraseroApp *app,
- const gchar *uri)
+gboolean
+brasero_app_burn_options (BraseroApp *app,
+ BraseroSessionCfg *session)
{
- BraseroBurnSession *session;
- GtkResponseType result;
GtkWidget *dialog;
+ GtkResponseType result;
- /* setup, show, and run options dialog */
- dialog = brasero_image_option_dialog_new ();
- brasero_image_option_dialog_set_image_uri (BRASERO_IMAGE_OPTION_DIALOG (dialog), uri);
-
+ dialog = brasero_burn_options_new (session);
brasero_app_set_toplevel (app, GTK_WINDOW (dialog));
-
result = gtk_dialog_run (GTK_DIALOG (dialog));
- if (result != GTK_RESPONSE_OK) {
- gtk_widget_destroy (dialog);
- return;
- }
- session = brasero_burn_options_get_session (BRASERO_BURN_OPTIONS (dialog));
/* The destruction of the dialog will bring the main window forward */
gtk_widget_destroy (dialog);
+ return (result == GTK_RESPONSE_OK);
+}
+
+void
+brasero_app_burn_image (BraseroApp *app,
+ const gchar *uri)
+{
+ BraseroSessionCfg *session;
+ BraseroTrackImage *track;
+
+ /* setup, show, and run options dialog */
+ session = brasero_session_cfg_new ();
+
+ /* FIXME: that's where we'd need a special kind of track that would
+ * identify the image type */
+ track = brasero_track_image_new ();
+ brasero_track_image_set_source (track, uri, NULL, BRASERO_IMAGE_FORMAT_BIN);
+ brasero_burn_session_add_track (BRASERO_BURN_SESSION (session), BRASERO_TRACK (track));
+
+ if (brasero_app_burn_options (app, session))
+ brasero_app_burn (app, BRASERO_BURN_SESSION (session));
- brasero_app_burn (app, session);
g_object_unref (session);
}
@@ -728,12 +739,12 @@
const gchar *device,
const gchar *cover)
{
- BraseroBurnSession *session;
- GtkResponseType result;
- GtkWidget *dialog;
+ BraseroSessionCfg *session;
+ BraseroTrackDisc *track;
- dialog = brasero_disc_copy_dialog_new ();
- brasero_app_set_toplevel (app, GTK_WINDOW (dialog));
+ session = brasero_session_cfg_new ();
+ track = brasero_track_disc_new ();
+ brasero_burn_session_add_track (BRASERO_BURN_SESSION (session), BRASERO_TRACK (track));
/* if a device is specified then get the corresponding medium */
if (device) {
@@ -744,21 +755,10 @@
drive = brasero_medium_monitor_get_drive (monitor, device);
g_object_unref (monitor);
- brasero_disc_copy_dialog_set_drive (BRASERO_DISC_COPY_DIALOG (dialog), drive);
+ brasero_track_disc_set_drive (BRASERO_TRACK_DISC (track), drive);
g_object_unref (drive);
}
- result = gtk_dialog_run (GTK_DIALOG (dialog));
- if (result != GTK_RESPONSE_OK) {
- gtk_widget_destroy (dialog);
- return;
- }
-
- session = brasero_burn_options_get_session (BRASERO_BURN_OPTIONS (dialog));
-
- /* The destruction of the dialog will bring the main window forward */
- gtk_widget_destroy (dialog);
-
/* Set a cover if any. */
if (cover) {
GValue *value;
@@ -766,12 +766,14 @@
value = g_new0 (GValue, 1);
g_value_init (value, G_TYPE_STRING);
g_value_set_string (value, cover);
- brasero_burn_session_tag_add (session,
+ brasero_burn_session_tag_add (BRASERO_BURN_SESSION (session),
BRASERO_COVER_URI,
value);
}
- brasero_app_burn (app, session);
+ if (brasero_app_burn_options (app, session))
+ brasero_app_burn (app, BRASERO_BURN_SESSION (session));
+
g_object_unref (session);
}
Modified: trunk/src/brasero-app.h
==============================================================================
--- trunk/src/brasero-app.h (original)
+++ trunk/src/brasero-app.h Sat Mar 28 08:14:58 2009
@@ -23,7 +23,7 @@
#include <glib-object.h>
#include <gtk/gtk.h>
-#include "brasero-session.h"
+#include "brasero-session-cfg.h"
G_BEGIN_DECLS
@@ -87,6 +87,10 @@
brasero_app_burn (BraseroApp *app,
BraseroBurnSession *session);
+gboolean
+brasero_app_burn_options (BraseroApp *app,
+ BraseroSessionCfg *session);
+
void
brasero_app_burn_image (BraseroApp *app,
const gchar *uri);
Modified: trunk/src/brasero-audio-disc.c
==============================================================================
--- trunk/src/brasero-audio-disc.c (original)
+++ trunk/src/brasero-audio-disc.c Sat Mar 28 08:14:58 2009
@@ -86,9 +86,6 @@
BraseroDiscTrack *track);
static BraseroDiscResult
-brasero_audio_disc_set_session_param (BraseroDisc *disc,
- BraseroBurnSession *session);
-static BraseroDiscResult
brasero_audio_disc_set_session_contents (BraseroDisc *disc,
BraseroBurnSession *session);
@@ -437,7 +434,6 @@
iface->clear = brasero_audio_disc_clear;
iface->reset = brasero_audio_disc_reset;
iface->get_track = brasero_audio_disc_get_track;
- iface->set_session_param = brasero_audio_disc_set_session_param;
iface->set_session_contents = brasero_audio_disc_set_session_contents;
iface->load_track = brasero_audio_disc_load_track;
iface->get_status = brasero_audio_disc_get_status;
@@ -1230,7 +1226,7 @@
/* make sure there is a length and it's not over the real one */
if (start >= 0 && end > 0)
- current_length = BRASERO_AUDIO_TRACK_LENGTH (start, end);
+ current_length = BRASERO_STREAM_LENGTH (start, end);
else
current_length = 0;
@@ -1254,7 +1250,7 @@
/* Just in case */
if (start > end) {
/* problem */
- start = end - BRASERO_MIN_AUDIO_TRACK_LENGTH;
+ start = end - BRASERO_MIN_STREAM_LENGTH;
if (start < 0)
start = 0;
@@ -1272,14 +1268,14 @@
-1);
/* gap counts as length */
- if (end - start + BRASERO_SECTORS_TO_TIME (gap) < BRASERO_MIN_AUDIO_TRACK_LENGTH)
+ if (end - start + BRASERO_SECTORS_TO_TIME (gap) < BRASERO_MIN_STREAM_LENGTH)
brasero_audio_disc_short_track_dialog (disc);
}
- else if (end - start < BRASERO_MIN_AUDIO_TRACK_LENGTH) {
+ else if (end - start < BRASERO_MIN_STREAM_LENGTH) {
brasero_audio_disc_short_track_dialog (disc);
}
- length = BRASERO_AUDIO_TRACK_LENGTH (start, end);
+ length = BRASERO_STREAM_LENGTH (start, end);
if (length != current_length) {
/* update global size */
if (current_length > 0)
@@ -1687,7 +1683,7 @@
gint64 gap_sectors,
gint64 start,
gint64 end,
- BraseroSongInfo *info,
+ BraseroStreamInfo *info,
GtkTreePath **path_return)
{
GtkTreeRowReference *ref;
@@ -1744,7 +1740,7 @@
gint64 length;
/* update global size */
- length = BRASERO_AUDIO_TRACK_LENGTH (start, end);
+ length = BRASERO_STREAM_LENGTH (start, end);
disc->priv->sectors += BRASERO_DURATION_TO_SECTORS (length);
brasero_audio_disc_size_changed (disc);
@@ -1856,7 +1852,7 @@
sectors = 0;
if (uri) {
if (end - start > 0)
- sectors = BRASERO_DURATION_TO_SECTORS (BRASERO_AUDIO_TRACK_LENGTH (start, end));
+ sectors = BRASERO_DURATION_TO_SECTORS (BRASERO_STREAM_LENGTH (start, end));
}
else if (length) /* gap */
sectors = BRASERO_DURATION_TO_SECTORS (length);
@@ -1997,7 +1993,7 @@
song->gap += BRASERO_DURATION_TO_SECTORS (length);
}
else {
- BraseroSongInfo *info;
+ BraseroStreamInfo *info;
song = g_new0 (BraseroDiscSong, 1);
song->uri = uri;
@@ -2007,7 +2003,7 @@
song->end = end > 0 ? end:0;
}
- info = g_new0 (BraseroSongInfo, 1);
+ info = g_new0 (BraseroStreamInfo, 1);
if (title_set)
info->title = title;
else
@@ -2037,43 +2033,20 @@
}
static BraseroDiscResult
-brasero_audio_disc_set_session_param (BraseroDisc *disc,
- BraseroBurnSession *session)
-{
- BraseroTrackType type;
- GValue *value = NULL;
-
- value = g_new0 (GValue, 1);
- g_value_init (value, G_TYPE_INT64);
- g_value_set_int64 (value, BRASERO_AUDIO_DISC (disc)->priv->sectors);
- brasero_burn_session_tag_add (session,
- BRASERO_AUDIO_TRACK_SIZE_TAG,
- value);
-
- type.type = BRASERO_TRACK_TYPE_AUDIO;
- type.subtype.audio_format = BRASERO_AUDIO_FORMAT_UNDEFINED|
- BRASERO_METADATA_INFO;
- brasero_burn_session_set_input_type (session, &type);
-
- return BRASERO_BURN_OK;
-}
-
-static BraseroDiscResult
brasero_audio_disc_set_session_contents (BraseroDisc *disc,
BraseroBurnSession *session)
{
GtkTreeIter iter;
GtkTreeModel *model;
- BraseroTrack *track;
BraseroAudioDisc *audio;
- BraseroTrackType track_type = { 0, };
+ BraseroTrackStream *track;
audio = BRASERO_AUDIO_DISC (disc);
+
model = gtk_tree_view_get_model (GTK_TREE_VIEW (audio->priv->tree));
if (!gtk_tree_model_get_iter_first (model, &iter))
return BRASERO_DISC_ERROR_EMPTY_SELECTION;
- brasero_burn_session_get_input_type (session, &track_type);
track = NULL;
do {
gchar *uri;
@@ -2084,7 +2057,7 @@
gint64 end;
gint64 start;
gint64 length;
- BraseroSongInfo *info;
+ BraseroStreamInfo *info;
gtk_tree_model_get (model, &iter,
URI_COL, &uri,
@@ -2099,32 +2072,33 @@
if (!uri) {
/* This is a gap so sectors refers to its size */
- brasero_track_set_audio_boundaries (track,
- -1,
- -1,
- length);
+ brasero_track_stream_set_boundaries (BRASERO_TRACK_STREAM (track),
+ -1,
+ -1,
+ length);
continue;
}
- info = g_new0 (BraseroSongInfo, 1);
+ info = g_new0 (BraseroStreamInfo, 1);
info->title = title;
info->artist = artist;
info->composer = composer;
info->isrc = isrc;
- track = brasero_track_new (BRASERO_TRACK_TYPE_AUDIO);
- brasero_track_set_audio_source (track,
- uri,
- track_type.subtype.audio_format);
-
- brasero_track_set_audio_boundaries (track, start, end, -1);
- brasero_track_set_audio_info (track, info);
- brasero_burn_session_add_track (session, track);
+ track = brasero_track_stream_new ();
+ brasero_track_stream_set_source (track, uri);
+ brasero_track_stream_set_format (track,
+ BRASERO_AUDIO_FORMAT_UNDEFINED|
+ BRASERO_METADATA_INFO);
+
+ brasero_track_stream_set_boundaries (track, start, end, -1);
+ brasero_track_stream_set_info (track, info);
+ brasero_burn_session_add_track (session, BRASERO_TRACK (track));
/* It's good practice to unref the track afterwards as we don't
* need it anymore. BraseroBurnSession refs it. */
- brasero_track_unref (track);
+ g_object_unref (track);
g_free (uri);
} while (gtk_tree_model_iter_next (model, &iter));
@@ -2149,7 +2123,7 @@
SONG_COL, TRUE,
-1);
- disc->priv->sectors += BRASERO_DURATION_TO_SECTORS (BRASERO_AUDIO_TRACK_LENGTH (song->start, song->end));
+ disc->priv->sectors += BRASERO_DURATION_TO_SECTORS (BRASERO_STREAM_LENGTH (song->start, song->end));
if (song->info) {
if (song->info->title)
@@ -2196,7 +2170,7 @@
for (iter = track->contents.tracks; iter; iter = iter->next) {
BraseroDiscSong *song;
- BraseroSongInfo *info;
+ BraseroStreamInfo *info;
song = iter->data;
info = song->info;
@@ -2823,9 +2797,9 @@
START_COL, &start,
END_COL, &end,
-1);
- disc->priv->sectors -= BRASERO_DURATION_TO_SECTORS (BRASERO_AUDIO_TRACK_LENGTH (start, end));
+ disc->priv->sectors -= BRASERO_DURATION_TO_SECTORS (BRASERO_STREAM_LENGTH (start, end));
- string = brasero_units_get_time_string (BRASERO_AUDIO_TRACK_LENGTH (slice->start, slice->end), TRUE, FALSE);
+ string = brasero_units_get_time_string (BRASERO_STREAM_LENGTH (slice->start, slice->end), TRUE, FALSE);
gtk_list_store_set (GTK_LIST_STORE (model), parent,
LENGTH_SET_COL, TRUE,
START_COL, slice->start,
@@ -2833,7 +2807,7 @@
SIZE_COL, string,
-1);
g_free (string);
- disc->priv->sectors += BRASERO_DURATION_TO_SECTORS (BRASERO_AUDIO_TRACK_LENGTH (slice->start, slice->end));
+ disc->priv->sectors += BRASERO_DURATION_TO_SECTORS (BRASERO_STREAM_LENGTH (slice->start, slice->end));
for (iter = slices->next; iter; iter = iter->next) {
slice = iter->data;
@@ -2841,7 +2815,7 @@
gtk_list_store_insert_after (GTK_LIST_STORE (model), &row, parent);
gtk_tree_model_iter_next (model, parent);
- string = brasero_units_get_time_string (BRASERO_AUDIO_TRACK_LENGTH (slice->start, slice->end), TRUE, FALSE);
+ string = brasero_units_get_time_string (BRASERO_STREAM_LENGTH (slice->start, slice->end), TRUE, FALSE);
gtk_list_store_set (GTK_LIST_STORE (model), &row,
URI_COL, uri,
NAME_COL, name,
@@ -2862,7 +2836,7 @@
-1);
g_free (string);
- disc->priv->sectors += BRASERO_DURATION_TO_SECTORS (BRASERO_AUDIO_TRACK_LENGTH (slice->start, slice->end));
+ disc->priv->sectors += BRASERO_DURATION_TO_SECTORS (BRASERO_STREAM_LENGTH (slice->start, slice->end));
}
g_free (icon_string);
@@ -3273,7 +3247,7 @@
return;
}
- disc->priv->sectors -= BRASERO_DURATION_TO_SECTORS (BRASERO_AUDIO_TRACK_LENGTH (start, end));
+ disc->priv->sectors -= BRASERO_DURATION_TO_SECTORS (BRASERO_STREAM_LENGTH (start, end));
brasero_song_props_get_properties (BRASERO_SONG_PROPS (props),
&artist,
&title,
@@ -3283,7 +3257,7 @@
&end,
&gap);
- length_str = brasero_units_get_time_string (BRASERO_AUDIO_TRACK_LENGTH (start, end), TRUE, FALSE);
+ length_str = brasero_units_get_time_string (BRASERO_STREAM_LENGTH (start, end), TRUE, FALSE);
gtk_tree_model_get_iter (model, &iter, treepath);
gtk_list_store_set (GTK_LIST_STORE (model), &iter,
@@ -3323,13 +3297,13 @@
ISRC_SET_COL, TRUE,
-1);
- if (end - start + BRASERO_SECTORS_TO_TIME (gap) < BRASERO_MIN_AUDIO_TRACK_LENGTH)
+ if (end - start + BRASERO_SECTORS_TO_TIME (gap) < BRASERO_MIN_STREAM_LENGTH)
brasero_audio_disc_short_track_dialog (disc);
if (gap)
brasero_audio_disc_add_gap (disc, &iter, gap);
- disc->priv->sectors += BRASERO_DURATION_TO_SECTORS (BRASERO_AUDIO_TRACK_LENGTH (start, end));
+ disc->priv->sectors += BRASERO_DURATION_TO_SECTORS (BRASERO_STREAM_LENGTH (start, end));
brasero_audio_disc_size_changed (disc);
g_free (title);
@@ -3885,7 +3859,7 @@
if (row_uri && !strncmp (row_uri, dir->uri, len)) {
if (end - start > 0)
- disc->priv->sectors -= BRASERO_DURATION_TO_SECTORS (BRASERO_AUDIO_TRACK_LENGTH (start, end));
+ disc->priv->sectors -= BRASERO_DURATION_TO_SECTORS (BRASERO_STREAM_LENGTH (start, end));
if (!gtk_list_store_remove (GTK_LIST_STORE (model), &iter)) {
g_free (row_uri);
@@ -3969,7 +3943,7 @@
-1);
if (end - start > 0)
- disc->priv->sectors -= BRASERO_DURATION_TO_SECTORS (BRASERO_AUDIO_TRACK_LENGTH (start, end));
+ disc->priv->sectors -= BRASERO_DURATION_TO_SECTORS (BRASERO_STREAM_LENGTH (start, end));
gtk_list_store_remove (GTK_LIST_STORE (model), &iter);
}
Modified: trunk/src/brasero-data-disc.c
==============================================================================
--- trunk/src/brasero-data-disc.c (original)
+++ trunk/src/brasero-data-disc.c Sat Mar 28 08:14:58 2009
@@ -59,6 +59,7 @@
#include "burn-basics.h"
#include "brasero-track.h"
+#include "brasero-track-data.h"
#include "brasero-session.h"
#include "brasero-volume.h"
@@ -1502,13 +1503,15 @@
}
static BraseroDiscResult
-brasero_data_disc_set_session_param (BraseroDisc *self,
- BraseroBurnSession *session)
+brasero_data_disc_set_session_contents (BraseroDisc *self,
+ BraseroBurnSession *session)
{
GValue *value;
BraseroFileNode *root;
- BraseroTrackType type;
+ GSList *grafts = NULL;
BraseroImageFS fs_type;
+ BraseroTrackData *track;
+ GSList *unreadable = NULL;
BraseroFileTreeStats *stats;
BraseroDataDiscPrivate *priv;
@@ -1567,57 +1570,30 @@
brasero_burn_session_set_burner (session, drive);
}
- type.type = BRASERO_TRACK_TYPE_DATA;
- type.subtype.fs_type = fs_type;
- brasero_burn_session_set_input_type (session, &type);
-
- return BRASERO_DISC_OK;
-}
-
-static BraseroDiscResult
-brasero_data_disc_set_session_contents (BraseroDisc *self,
- BraseroBurnSession *session)
-{
- BraseroTrack *track;
- BraseroFileNode *root;
- BraseroTrackType type;
- GSList *grafts = NULL;
- gboolean joliet_compat;
- GSList *unreadable = NULL;
- BraseroFileTreeStats *stats;
- BraseroDataDiscPrivate *priv;
-
- priv = BRASERO_DATA_DISC_PRIVATE (self);
-
/* there should be only one data track */
- brasero_burn_session_get_input_type (session, &type);
- track = brasero_track_new (BRASERO_TRACK_TYPE_DATA);
+ track = brasero_track_data_new ();
+ brasero_track_data_add_fs (track, fs_type);
/* Set the number of files in the tree */
- root = brasero_data_project_get_root (priv->project);
- stats = BRASERO_FILE_NODE_STATS (root);
if (stats)
- brasero_track_set_data_file_num (track, stats->children);
-
- joliet_compat = (type.subtype.fs_type & BRASERO_IMAGE_FS_JOLIET);
- brasero_track_add_data_fs (track, type.subtype.fs_type);
+ brasero_track_data_set_file_num (track, stats->children);
/* append a slash for mkisofs */
brasero_data_project_get_contents (priv->project,
&grafts,
&unreadable,
- joliet_compat,
+ (fs_type & BRASERO_IMAGE_FS_JOLIET) != 0,
TRUE);
if (!grafts)
return BRASERO_DISC_ERROR_EMPTY_SELECTION;
- brasero_track_set_data_source (track, grafts, unreadable);
- brasero_burn_session_add_track (session, track);
+ brasero_track_data_set_source (track, grafts, unreadable);
+ brasero_burn_session_add_track (session, BRASERO_TRACK (track));
/* It's good practice to unref the track afterwards as we don't need it
* anymore. BraseroBurnSession refs it. */
- brasero_track_unref (track);
+ g_object_unref (track);
return BRASERO_DISC_OK;
}
@@ -2589,7 +2565,6 @@
iface->clear = brasero_data_disc_clear;
iface->reset = brasero_data_disc_reset;
iface->get_track = brasero_data_disc_get_track;
- iface->set_session_param = brasero_data_disc_set_session_param;
iface->set_session_contents = brasero_data_disc_set_session_contents;
iface->load_track = brasero_data_disc_load_track;
iface->get_status = brasero_data_disc_get_status;
Modified: trunk/src/brasero-data-project.c
==============================================================================
--- trunk/src/brasero-data-project.c (original)
+++ trunk/src/brasero-data-project.c Sat Mar 28 08:14:58 2009
@@ -42,6 +42,7 @@
#include "brasero-utils.h"
#include "brasero-io.h"
+#include "brasero-track-data.h"
typedef struct _BraseroDataProjectPrivate BraseroDataProjectPrivate;
struct _BraseroDataProjectPrivate
Modified: trunk/src/brasero-data-session.c
==============================================================================
--- trunk/src/brasero-data-session.c (original)
+++ trunk/src/brasero-data-session.c Sat Mar 28 08:14:58 2009
@@ -275,7 +275,7 @@
GError **error)
{
BraseroDataSessionPrivate *priv;
- gint64 session_block;
+ guint64 session_block;
const gchar *device;
gint reference = -1;
Modified: trunk/src/brasero-disc.c
==============================================================================
--- trunk/src/brasero-disc.c (original)
+++ trunk/src/brasero-disc.c Sat Mar 28 08:14:58 2009
@@ -220,22 +220,6 @@
}
BraseroDiscResult
-brasero_disc_set_session_param (BraseroDisc *disc,
- BraseroBurnSession *session)
-{
- BraseroDiscIface *iface;
-
- g_return_val_if_fail (BRASERO_IS_DISC (disc), BRASERO_DISC_ERROR_UNKNOWN);
- g_return_val_if_fail (BRASERO_IS_BURN_SESSION (session), BRASERO_DISC_ERROR_UNKNOWN);
-
- iface = BRASERO_DISC_GET_IFACE (disc);
- if (iface->set_session_param)
- return (* iface->set_session_param) (disc, session);
-
- return BRASERO_DISC_ERROR_UNKNOWN;
-}
-
-BraseroDiscResult
brasero_disc_set_session_contents (BraseroDisc *disc,
BraseroBurnSession *session)
{
Modified: trunk/src/brasero-disc.h
==============================================================================
--- trunk/src/brasero-disc.h (original)
+++ trunk/src/brasero-disc.h Sat Mar 28 08:14:58 2009
@@ -89,8 +89,6 @@
BraseroDiscResult (*get_track) (BraseroDisc *disc,
BraseroDiscTrack *track);
- BraseroDiscResult (*set_session_param) (BraseroDisc *disc,
- BraseroBurnSession *session);
BraseroDiscResult (*set_session_contents) (BraseroDisc *disc,
BraseroBurnSession *session);
@@ -150,9 +148,6 @@
BraseroDiscTrack *track);
BraseroDiscResult
-brasero_disc_set_session_param (BraseroDisc *disc,
- BraseroBurnSession *session);
-BraseroDiscResult
brasero_disc_set_session_contents (BraseroDisc *disc,
BraseroBurnSession *session);
Modified: trunk/src/brasero-project-parse.c
==============================================================================
--- trunk/src/brasero-project-parse.c (original)
+++ trunk/src/brasero-project-parse.c Sat Mar 28 08:14:58 2009
@@ -45,6 +45,9 @@
#include "brasero-project-parse.h"
#include "brasero-app.h"
+#include "brasero-track-stream.h"
+#include "brasero-track-data.h"
+
static void
brasero_track_clear_song (gpointer data)
{
@@ -53,7 +56,7 @@
song = data;
if (song->info)
- brasero_song_info_free (song->info);
+ brasero_stream_info_free (song->info);
g_free (song->uri);
g_free (song);
@@ -306,7 +309,7 @@
goto error;
if (!song->info)
- song->info = g_new0 (BraseroSongInfo, 1);
+ song->info = g_new0 (BraseroStreamInfo, 1);
if (song->info->title)
g_free (song->info->title);
@@ -324,7 +327,7 @@
goto error;
if (!song->info)
- song->info = g_new0 (BraseroSongInfo, 1);
+ song->info = g_new0 (BraseroStreamInfo, 1);
if (song->info->artist)
g_free (song->info->artist);
@@ -342,7 +345,7 @@
goto error;
if (!song->info)
- song->info = g_new0 (BraseroSongInfo, 1);
+ song->info = g_new0 (BraseroStreamInfo, 1);
if (song->info->composer)
g_free (song->info->composer);
@@ -360,7 +363,7 @@
goto error;
if (!song->info)
- song->info = g_new0 (BraseroSongInfo, 1);
+ song->info = g_new0 (BraseroStreamInfo, 1);
song->info->isrc = (gint) g_ascii_strtod (isrc, NULL);
g_free (isrc);
Modified: trunk/src/brasero-project-parse.h
==============================================================================
--- trunk/src/brasero-project-parse.h (original)
+++ trunk/src/brasero-project-parse.h Sat Mar 28 08:14:58 2009
@@ -30,6 +30,7 @@
#include <glib.h>
#include "brasero-track.h"
+#include "brasero-track-stream.h"
G_BEGIN_DECLS
@@ -48,7 +49,7 @@
gint64 start;
gint64 end;
- BraseroSongInfo *info;
+ BraseroStreamInfo *info;
};
typedef struct _BraseroDiscSong BraseroDiscSong;
@@ -70,6 +71,7 @@
void
brasero_track_clear (BraseroDiscTrack *track);
+
void
brasero_track_free (BraseroDiscTrack *track);
Modified: trunk/src/brasero-project.c
==============================================================================
--- trunk/src/brasero-project.c (original)
+++ trunk/src/brasero-project.c Sat Mar 28 08:14:58 2009
@@ -64,6 +64,7 @@
#endif
#include "brasero-session-cfg.h"
+#include "brasero-burn-options.h"
#include "brasero-cover.h"
#include "brasero-project-type-chooser.h"
@@ -73,7 +74,6 @@
#include "brasero-data-disc.h"
#include "brasero-audio-disc.h"
#include "brasero-video-disc.h"
-#include "brasero-disc-option-dialog.h"
#include "brasero-uri-container.h"
#include "brasero-layout-object.h"
#include "brasero-disc-message.h"
@@ -923,7 +923,7 @@
void
brasero_project_burn (BraseroProject *project)
{
- BraseroBurnSession *session;
+ BraseroSessionCfg *session;
BraseroDiscResult result;
GtkWidget *dialog;
gboolean success;
@@ -952,26 +952,26 @@
/* This is to stop the preview widget from playing */
brasero_uri_container_uri_selected (BRASERO_URI_CONTAINER (project));
- /* setup, show, and run options dialog */
- dialog = brasero_disc_option_dialog_new ();
- brasero_disc_option_dialog_set_disc (BRASERO_DISC_OPTION_DIALOG (dialog),
- project->priv->current);
+ /* setup, show, and run options dialog */
+ session = brasero_session_cfg_new ();
+ brasero_disc_set_session_contents (project->priv->current, BRASERO_BURN_SESSION (session));
+ dialog = brasero_burn_options_new (session);
brasero_app_set_toplevel (brasero_app_get_default (), GTK_WINDOW (dialog));
result = gtk_dialog_run (GTK_DIALOG (dialog));
if (result != GTK_RESPONSE_OK) {
+ g_object_unref (session);
gtk_widget_destroy (dialog);
goto end;
}
- session = brasero_disc_option_dialog_get_session (BRASERO_DISC_OPTION_DIALOG (dialog));
gtk_widget_destroy (dialog);
- brasero_project_setup_session (project, session);
+ brasero_project_setup_session (project, BRASERO_BURN_SESSION (session));
/* now setup the burn dialog */
- success = brasero_app_burn (brasero_app_get_default (), session);
+ success = brasero_app_burn (brasero_app_get_default (), BRASERO_BURN_SESSION (session));
project->priv->burnt = success;
g_object_unref (session);
@@ -993,7 +993,6 @@
return;
session = BRASERO_BURN_SESSION (brasero_session_cfg_new ());
- brasero_disc_set_session_param (BRASERO_DISC (project->priv->current), session);
brasero_disc_set_session_contents (BRASERO_DISC (project->priv->current), session);
brasero_project_setup_session (project, session);
@@ -1868,7 +1867,7 @@
for (iter = track->contents.tracks; iter; iter = iter->next) {
BraseroDiscSong *song;
- BraseroSongInfo *info;
+ BraseroStreamInfo *info;
xmlChar *escaped;
gchar *start;
gchar *isrc;
@@ -2206,7 +2205,7 @@
for (iter = track->contents.tracks; iter; iter = iter->next) {
BraseroDiscSong *song;
- BraseroSongInfo *info;
+ BraseroStreamInfo *info;
gchar *time;
song = iter->data;
@@ -2318,7 +2317,7 @@
model = gtk_list_store_new (3, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN);
for (iter = track->contents.tracks; iter; iter = iter->next) {
BraseroDiscSong *song;
- BraseroSongInfo *info;
+ BraseroStreamInfo *info;
song = iter->data;
info = song->info;
Modified: trunk/src/brasero-song-properties.c
==============================================================================
--- trunk/src/brasero-song-properties.c (original)
+++ trunk/src/brasero-song-properties.c Sat Mar 28 08:14:58 2009
@@ -42,6 +42,7 @@
#include "brasero-misc.h"
#include "brasero-track.h"
+#include "brasero-track-stream.h"
G_DEFINE_TYPE (BraseroSongProps, brasero_song_props, GTK_TYPE_DIALOG);
@@ -77,7 +78,7 @@
start = brasero_time_button_get_value (BRASERO_TIME_BUTTON (self->priv->start));
gap = gtk_spin_button_get_value (GTK_SPIN_BUTTON (self->priv->gap)) * GST_SECOND;
- length_str = brasero_units_get_time_string (BRASERO_AUDIO_TRACK_LENGTH (start, end + gap), TRUE, FALSE);
+ length_str = brasero_units_get_time_string (BRASERO_STREAM_LENGTH (start, end + gap), TRUE, FALSE);
gtk_label_set_markup (GTK_LABEL (self->priv->length), length_str);
g_free (length_str);
}
@@ -113,7 +114,7 @@
start = brasero_time_button_get_value (BRASERO_TIME_BUTTON (self->priv->start));
gap = gtk_spin_button_get_value (GTK_SPIN_BUTTON (self->priv->gap)) * GST_SECOND;
- length_str = brasero_units_get_time_string (BRASERO_AUDIO_TRACK_LENGTH (start, end + gap), TRUE, FALSE);
+ length_str = brasero_units_get_time_string (BRASERO_STREAM_LENGTH (start, end + gap), TRUE, FALSE);
gtk_label_set_markup (GTK_LABEL (self->priv->length), length_str);
g_free (length_str);
}
Modified: trunk/src/brasero-split-dialog.c
==============================================================================
--- trunk/src/brasero-split-dialog.c (original)
+++ trunk/src/brasero-split-dialog.c Sat Mar 28 08:14:58 2009
@@ -37,6 +37,7 @@
#include "brasero-misc.h"
#include "brasero-track.h"
+#include "brasero-track-stream.h"
enum {
START_COL,
@@ -105,7 +106,7 @@
if (BRASERO_DURATION_TO_BYTES (end) % 2352)
end += BRASERO_BYTES_TO_DURATION (2352 - (BRASERO_DURATION_TO_BYTES (end) % 2352));
- if (end - start < BRASERO_MIN_AUDIO_TRACK_LENGTH)
+ if (end - start < BRASERO_MIN_STREAM_LENGTH)
return;
priv->start = start;
@@ -214,12 +215,12 @@
/* check that pos > 300 sectors ( == 4 sec ) */
if (warn
- && pos - priv->start < BRASERO_MIN_AUDIO_TRACK_LENGTH
+ && pos - priv->start < BRASERO_MIN_STREAM_LENGTH
&& !brasero_split_dialog_size_error (self))
return FALSE;
if (warn
- && end - (pos + 1) < BRASERO_MIN_AUDIO_TRACK_LENGTH
+ && end - (pos + 1) < BRASERO_MIN_STREAM_LENGTH
&& !brasero_split_dialog_size_error (self))
return FALSE;
@@ -276,12 +277,12 @@
/* check the size of the new tracks */
if (warn
- && (pos - start) < BRASERO_MIN_AUDIO_TRACK_LENGTH
+ && (pos - start) < BRASERO_MIN_STREAM_LENGTH
&& !brasero_split_dialog_size_error (self))
return FALSE;
if (warn
- && (end - (pos + 1)) < BRASERO_MIN_AUDIO_TRACK_LENGTH
+ && (end - (pos + 1)) < BRASERO_MIN_STREAM_LENGTH
&& !brasero_split_dialog_size_error (self))
return FALSE;
@@ -323,7 +324,7 @@
/* check the size of the new slice */
if (warn
- && (slice.end - slice.start) < BRASERO_MIN_AUDIO_TRACK_LENGTH
+ && (slice.end - slice.start) < BRASERO_MIN_STREAM_LENGTH
&& !brasero_split_dialog_size_error (self))
return FALSE;
}
@@ -403,17 +404,17 @@
* - 0 => start
* - end => song end
* also make sure that the track is longer than 4 sec */
- if (start - priv->start < BRASERO_MIN_AUDIO_TRACK_LENGTH
+ if (start - priv->start < BRASERO_MIN_STREAM_LENGTH
&& !brasero_split_dialog_size_error (self)) {
/* that's not necessarily a good solution */
- start = BRASERO_MIN_AUDIO_TRACK_LENGTH;
+ start = BRASERO_MIN_STREAM_LENGTH;
if (start > end)
end = start;
}
- if ((length - end) < BRASERO_MIN_AUDIO_TRACK_LENGTH
+ if ((length - end) < BRASERO_MIN_STREAM_LENGTH
&& !brasero_split_dialog_size_error (self))
- end = length - BRASERO_MIN_AUDIO_TRACK_LENGTH;
+ end = length - BRASERO_MIN_STREAM_LENGTH;
length_str = brasero_units_get_time_string (start - priv->start, TRUE, FALSE);
start_str = brasero_units_get_time_string (priv->start, TRUE, FALSE);
@@ -481,9 +482,9 @@
if (end < track_end) {
/* reduce the size but make sure the remaining
* track is > 4 sec */
- if ((track_end - end) < BRASERO_MIN_AUDIO_TRACK_LENGTH
+ if ((track_end - end) < BRASERO_MIN_STREAM_LENGTH
&& !brasero_split_dialog_size_error (self))
- end = track_end - BRASERO_MIN_AUDIO_TRACK_LENGTH;
+ end = track_end - BRASERO_MIN_STREAM_LENGTH;
start_str = brasero_units_get_time_string (end, TRUE, FALSE);
length_str = brasero_units_get_time_string (track_end - end, TRUE, FALSE);
@@ -505,9 +506,9 @@
/* reduce the size but make sure the remaining track is
* > 4 sec else change it */
- if ((start - track_start) < BRASERO_MIN_AUDIO_TRACK_LENGTH
+ if ((start - track_start) < BRASERO_MIN_STREAM_LENGTH
&& !brasero_split_dialog_size_error (self))
- start = track_start + BRASERO_MIN_AUDIO_TRACK_LENGTH;
+ start = track_start + BRASERO_MIN_STREAM_LENGTH;
start_str = brasero_units_get_time_string (start, TRUE, FALSE);
length_str = brasero_units_get_time_string (start - track_start, TRUE, FALSE);
@@ -531,9 +532,9 @@
/* create a new track with the remaining time.
* make sure the remaining track is > 4 sec */
- if ((track_end - end) < BRASERO_MIN_AUDIO_TRACK_LENGTH
+ if ((track_end - end) < BRASERO_MIN_STREAM_LENGTH
&& !brasero_split_dialog_size_error (self))
- end = track_end - BRASERO_MIN_AUDIO_TRACK_LENGTH;
+ end = track_end - BRASERO_MIN_STREAM_LENGTH;
gtk_list_store_append (priv->model, &child);
@@ -568,9 +569,9 @@
}
/* resize (make sure about the 4s) */
- if ((track_end - end) < BRASERO_MIN_AUDIO_TRACK_LENGTH
+ if ((track_end - end) < BRASERO_MIN_STREAM_LENGTH
&& !brasero_split_dialog_size_error (self))
- end = track_end - BRASERO_MIN_AUDIO_TRACK_LENGTH;
+ end = track_end - BRASERO_MIN_STREAM_LENGTH;
start_str = brasero_units_get_time_string (end, TRUE, FALSE);
length_str = brasero_units_get_time_string (track_end - end, TRUE, FALSE);
@@ -750,7 +751,7 @@
sec = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (priv->spin_sec));
sec *= 1000000000;
- if (sec < BRASERO_MIN_AUDIO_TRACK_LENGTH
+ if (sec < BRASERO_MIN_STREAM_LENGTH
&& !brasero_split_dialog_size_error (self))
return;
@@ -774,7 +775,7 @@
length = priv->end - priv->start;
step = length / parts;
- if (step < BRASERO_MIN_AUDIO_TRACK_LENGTH
+ if (step < BRASERO_MIN_STREAM_LENGTH
&& !brasero_split_dialog_size_error (self))
return;
Modified: trunk/src/brasero-sum-dialog.c
==============================================================================
--- trunk/src/brasero-sum-dialog.c (original)
+++ trunk/src/brasero-sum-dialog.c Sat Mar 28 08:14:58 2009
@@ -53,6 +53,8 @@
#include "burn-basics.h"
#include "burn-debug.h"
+#include "brasero-tags.h"
+#include "brasero-track-disc.h"
#include "brasero-burn.h"
G_DEFINE_TYPE (BraseroSumDialog, brasero_sum_dialog, BRASERO_TYPE_TOOL_DIALOG);
@@ -437,18 +439,18 @@
gchar *checksum,
GError **error)
{
- BraseroTrack *track = NULL;
+ BraseroTrackDisc *track = NULL;
BraseroBurnResult result;
BraseroBurn *burn;
- track = brasero_track_new (BRASERO_TRACK_TYPE_DISC);
- brasero_track_set_drive_source (track, drive);
- brasero_track_set_checksum (track, BRASERO_CHECKSUM_MD5, checksum);
- brasero_burn_session_add_track (self->priv->session, track);
+ track = brasero_track_disc_new ();
+ brasero_track_disc_set_drive (track, drive);
+ brasero_track_set_checksum (BRASERO_TRACK (track), BRASERO_CHECKSUM_MD5, checksum);
+ brasero_burn_session_add_track (self->priv->session, BRASERO_TRACK (track));
/* It's good practice to unref the track afterwards as we don't need it
* anymore. BraseroBurnSession refs it. */
- brasero_track_unref (track);
+ g_object_unref (track);
burn = brasero_tool_dialog_get_burn (BRASERO_TOOL_DIALOG (self));
result = brasero_burn_check (burn, self->priv->session, error);
@@ -519,24 +521,24 @@
BraseroDrive *drive)
{
BraseroBurnResult result;
+ BraseroTrackDisc *track;
GError *error = NULL;
GValue *value = NULL;
- BraseroTrack *track;
BraseroBurn *burn;
gboolean retval;
/* make track */
- track = brasero_track_new (BRASERO_TRACK_TYPE_DISC);
- brasero_track_set_drive_source (track, drive);
- brasero_track_set_checksum (track, BRASERO_CHECKSUM_DETECT, NULL);
- brasero_burn_session_add_track (self->priv->session, track);
+ track = brasero_track_disc_new ();
+ brasero_track_disc_set_drive (track, drive);
+ brasero_track_set_checksum (BRASERO_TRACK (track), BRASERO_CHECKSUM_DETECT, NULL);
+ brasero_burn_session_add_track (self->priv->session, BRASERO_TRACK (track));
/* no eject at the end (it should be default) */
brasero_burn_session_remove_flag (self->priv->session, BRASERO_BURN_FLAG_EJECT);
/* It's good practice to unref the track afterwards as we don't need it
* anymore. BraseroBurnSession refs it. */
- brasero_track_unref (track);
+ g_object_unref (track);
burn = brasero_tool_dialog_get_burn (BRASERO_TOOL_DIALOG (self));
result = brasero_burn_check (burn, self->priv->session, &error);
@@ -562,7 +564,7 @@
g_error_free (error);
- brasero_track_tag_lookup (track,
+ brasero_track_tag_lookup (BRASERO_TRACK (track),
BRASERO_TRACK_MEDIUM_WRONG_CHECKSUM_TAG,
&value);
Modified: trunk/src/brasero-video-disc.c
==============================================================================
--- trunk/src/brasero-video-disc.c (original)
+++ trunk/src/brasero-video-disc.c Sat Mar 28 08:14:58 2009
@@ -43,6 +43,7 @@
#include "brasero-multi-song-props.h"
#include "brasero-song-properties.h"
#include "brasero-session-cfg.h"
+#include "brasero-track-stream.h"
typedef struct _BraseroVideoDiscPrivate BraseroVideoDiscPrivate;
struct _BraseroVideoDiscPrivate
@@ -1320,31 +1321,6 @@
}
BraseroDiscResult
-brasero_video_disc_set_session_param (BraseroDisc *self,
- BraseroBurnSession *session)
-{
- BraseroVideoDiscPrivate *priv;
- BraseroTrackType type;
- GtkTreeModel *model;
- GValue *value;
-
- priv = BRASERO_VIDEO_DISC_PRIVATE (self);
-
- type.type = BRASERO_TRACK_TYPE_AUDIO;
- type.subtype.audio_format = BRASERO_AUDIO_FORMAT_UNDEFINED|BRASERO_VIDEO_FORMAT_UNDEFINED;
- brasero_burn_session_set_input_type (session, &type);
-
- model = gtk_tree_view_get_model (GTK_TREE_VIEW (priv->tree));
- value = g_new0 (GValue, 1);
- g_value_init (value, G_TYPE_INT64);
- g_value_set_int64 (value, brasero_video_project_get_size (BRASERO_VIDEO_PROJECT (model)));
- brasero_burn_session_tag_add (session,
- BRASERO_AUDIO_TRACK_SIZE_TAG,
- value);
- return BRASERO_BURN_OK;
-}
-
-BraseroDiscResult
brasero_video_disc_set_session_contents (BraseroDisc *self,
BraseroBurnSession *session)
{
@@ -1367,10 +1343,11 @@
/* It's good practice to unref the track afterwards as we don't
* need it anymore. BraseroBurnSession refs it. */
- brasero_track_unref (track);
+ g_object_unref (track);
}
g_slist_free (tracks);
+
return BRASERO_DISC_OK;
}
@@ -1396,15 +1373,15 @@
track = iter->data;
song = g_new0 (BraseroDiscSong, 1);
- song->uri = brasero_track_get_audio_source (track, TRUE);
- song->start = brasero_track_get_audio_start (track);
- song->end = brasero_track_get_audio_end (track);
- song->info = brasero_song_info_copy (brasero_track_get_audio_info (track));
+ song->uri = brasero_track_stream_get_source (BRASERO_TRACK_STREAM (track), TRUE);
+ song->start = brasero_track_stream_get_start (BRASERO_TRACK_STREAM (track));
+ song->end = brasero_track_stream_get_end (BRASERO_TRACK_STREAM (track));
+ song->info = brasero_stream_info_copy (brasero_track_stream_get_info (BRASERO_TRACK_STREAM (track)));
disc_track->contents.tracks = g_slist_append (disc_track->contents.tracks, song);
}
- g_slist_foreach (tracks, (GFunc) brasero_track_unref, NULL);
+ g_slist_foreach (tracks, (GFunc) g_object_unref, NULL);
g_slist_free (tracks);
return BRASERO_DISC_OK;
@@ -1453,7 +1430,6 @@
iface->reset = brasero_video_disc_reset;
iface->get_status = brasero_video_disc_get_status;
- iface->set_session_param = brasero_video_disc_set_session_param;
iface->set_session_contents = brasero_video_disc_set_session_contents;
iface->get_track = brasero_video_disc_get_track;
Modified: trunk/src/brasero-video-project.c
==============================================================================
--- trunk/src/brasero-video-project.c (original)
+++ trunk/src/brasero-video-project.c Sat Mar 28 08:14:58 2009
@@ -299,7 +299,7 @@
g_object_unref (file->snapshot);
if (file->info)
- brasero_song_info_free (file->info);
+ brasero_stream_info_free (file->info);
g_free (file);
}
@@ -523,7 +523,7 @@
/* Get the song info */
if (!file->info)
- file->info = g_new0 (BraseroSongInfo, 1);
+ file->info = g_new0 (BraseroStreamInfo, 1);
if (!file->title_set) {
if (file->info->title)
@@ -741,7 +741,7 @@
BraseroVideoFile *
brasero_video_project_add_uri (BraseroVideoProject *self,
const gchar *uri,
- BraseroSongInfo *info,
+ BraseroStreamInfo *info,
BraseroVideoFile *sibling,
gint64 start,
gint64 end)
@@ -760,7 +760,7 @@
file->uri = g_strdup (uri);
if (info) {
- file->info = brasero_song_info_copy (info);
+ file->info = brasero_stream_info_copy (info);
if (info->isrc)
file->isrc_set = TRUE;
@@ -772,7 +772,7 @@
file->composer_set = TRUE;
}
else
- file->info = g_new0 (BraseroSongInfo, 1);
+ file->info = g_new0 (BraseroStreamInfo, 1);
if (start > -1)
file->start = start;
@@ -982,11 +982,11 @@
return NULL;
for (file = priv->first; file; file = file->next) {
- BraseroSongInfo *info = NULL;
- BraseroTrack *track;
+ BraseroStreamInfo *info = NULL;
+ BraseroTrackStream *track;
if (file->info) {
- info = brasero_song_info_copy (file->info);
+ info = brasero_stream_info_copy (file->info);
if (values_set) {
if (!file->title_set) {
@@ -1008,25 +1008,25 @@
else
info = NULL;
- track = brasero_track_new (BRASERO_TRACK_TYPE_AUDIO);
- brasero_track_set_audio_source (track,
- file->uri,
- BRASERO_AUDIO_FORMAT_UNDEFINED|
- BRASERO_VIDEO_FORMAT_UNDEFINED);
+ track = brasero_track_stream_new ();
+ brasero_track_stream_set_source (track, file->uri);
+ brasero_track_stream_set_format (track,
+ BRASERO_AUDIO_FORMAT_UNDEFINED|
+ BRASERO_VIDEO_FORMAT_UNDEFINED);
if (!values_set || file->len_set)
- brasero_track_set_audio_boundaries (track,
- file->start,
- file->end,
- -1);
+ brasero_track_stream_set_boundaries (track,
+ file->start,
+ file->end,
+ -1);
else
- brasero_track_set_audio_boundaries (track,
- file->start,
- 0,
- -1);
+ brasero_track_stream_set_boundaries (track,
+ file->start,
+ 0,
+ -1);
- brasero_track_set_audio_info (track, info);
- tracks = g_slist_prepend (tracks, track);
+ brasero_track_stream_set_info (track, info);
+ tracks = g_slist_prepend (tracks, BRASERO_TRACK (track));
}
tracks = g_slist_reverse (tracks);
@@ -1053,7 +1053,7 @@
for (iter = priv->first; iter; iter = next) {
next = iter->next;
g_free (iter->uri);
- brasero_song_info_free (iter->info);
+ brasero_stream_info_free (iter->info);
g_free (iter);
}
Modified: trunk/src/brasero-video-project.h
==============================================================================
--- trunk/src/brasero-video-project.h (original)
+++ trunk/src/brasero-video-project.h Sat Mar 28 08:14:58 2009
@@ -56,7 +56,7 @@
gchar *uri;
- BraseroSongInfo *info;
+ BraseroStreamInfo *info;
guint64 start;
guint64 end;
@@ -154,7 +154,7 @@
BraseroVideoFile *
brasero_video_project_add_uri (BraseroVideoProject *project,
const gchar *uri,
- BraseroSongInfo *info,
+ BraseroStreamInfo *info,
BraseroVideoFile *sibling,
gint64 start,
gint64 end);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]