brasero r1704 - in trunk: . docs docs/reference src src/plugins/cdrdao src/plugins/cdrkit src/plugins/cdrtools src/plugins/checksum src/plugins/dvdauthor src/plugins/dvdcss src/plugins/growisofs src/plugins/libburnia src/plugins/local-track src/plugins/transcode src/plugins/vcdimager
- From: philippr svn gnome org
- To: svn-commits-list gnome org
- Subject: brasero r1704 - in trunk: . docs docs/reference src src/plugins/cdrdao src/plugins/cdrkit src/plugins/cdrtools src/plugins/checksum src/plugins/dvdauthor src/plugins/dvdcss src/plugins/growisofs src/plugins/libburnia src/plugins/local-track src/plugins/transcode src/plugins/vcdimager
- Date: Wed, 7 Jan 2009 14:28:22 +0000 (UTC)
Author: philippr
Date: Wed Jan 7 14:28:22 2009
New Revision: 1704
URL: http://svn.gnome.org/viewvc/brasero?rev=1704&view=rev
Log:
2009-01-07 Philippe Rouquier <ykw localhost localdomain>
New library born out of splitting brasero and all media related code.
Its name is libbrasero-media.
The next patch should move it to its own directory.
* Makefile.am:
* autogen.sh:
* configure.in:
* docs/Makefile.am:
* docs/reference/Makefile.am:
* docs/reference/version.xml.in:
* libbrasero-media.pc.in:
* src/Makefile.am:
* src/brasero-dest-selection.c (brasero_dest_selection_lock),
(brasero_dest_selection_valid_session),
(brasero_dest_selection_medium_changed),
(brasero_dest_selection_set_property):
* src/brasero-medium-selection.c
(brasero_medium_selection_get_medium_string):
* src/brasero-medium-selection.h:
* src/brasero-src-selection.c
(brasero_src_selection_medium_changed):
* src/brasero-tool-dialog.c (brasero_tool_dialog_cancel):
* src/burn-basics.h:
* src/burn-caps.c:
* src/burn-debug.c (brasero_burn_debug_track_type_message):
* src/burn-drive.c (brasero_drive_get_gdrive),
(brasero_drive_get_bus_target_lun_string), (brasero_drive_is_fake),
(brasero_drive_is_door_open), (brasero_drive_can_use_exclusively),
(brasero_drive_lock), (brasero_drive_unlock),
(brasero_drive_get_display_name), (brasero_drive_get_device),
(brasero_drive_get_block_device), (brasero_drive_get_udi),
(brasero_drive_get_medium), (brasero_drive_reprobe),
(brasero_drive_hal_reprobe), (brasero_drive_check_medium_inside),
(brasero_drive_init_real), (brasero_drive_class_init):
* src/burn-drive.h:
* src/burn-hal-watch.c (brasero_hal_watch_get_ctx),
(brasero_hal_watch_destroy):
* src/burn-iso9660.c (brasero_iso9660_is_primary_descriptor),
(brasero_iso9660_read_susp), (brasero_iso9660_get_susp),
(brasero_iso9660_next_record),
(brasero_iso9660_get_first_directory_record),
(brasero_iso9660_read_file_record),
(brasero_iso9660_read_directory_record),
(brasero_iso9660_load_directory_records),
(brasero_iso9660_check_SUSP_RR_use),
(brasero_iso9660_lookup_directory_record_RR),
(brasero_iso9660_lookup_directory_records):
* src/burn-media.c (brasero_media_quark),
(brasero_media_to_string), (brasero_media_get_option_group),
(brasero_media_message):
* src/burn-media.h:
* src/burn-medium-monitor.c (brasero_medium_monitor_get_drive),
(brasero_medium_monitor_is_probing),
(brasero_medium_monitor_get_media),
(brasero_medium_monitor_inserted_cb),
(brasero_medium_monitor_removed_cb), (brasero_medium_monitor_init),
(brasero_medium_monitor_class_init):
* src/burn-medium-monitor.h:
* src/burn-medium.c (brasero_medium_test_simulate_CD_SAO),
(brasero_medium_test_simulate_CD_TAO),
(brasero_medium_test_simulate_DVDRW),
(brasero_medium_test_simulate_2A), (brasero_medium_init_caps),
(brasero_medium_get_capacity_CD_RW),
(brasero_medium_get_capacity_DVD_RW),
(brasero_medium_get_speed_mmc3),
(brasero_medium_get_page_2A_write_speed_desc),
(brasero_medium_get_page_2A_max_speed),
(brasero_medium_track_volume_size),
(brasero_medium_track_written_SAO),
(brasero_medium_track_get_info),
(brasero_medium_track_set_leadout_CDR_blank),
(brasero_medium_track_set_leadout),
(brasero_medium_add_DVD_plus_RW_leadout),
(brasero_medium_get_sessions_info), (brasero_medium_get_DVD_id),
(brasero_medium_get_contents), (brasero_medium_check_BCD_use),
(brasero_medium_get_CD_sessions_info),
(brasero_medium_old_drive_get_disc_info),
(brasero_medium_check_old_drive), (brasero_medium_get_medium_type),
(brasero_medium_get_css_feature), (brasero_medium_get_CD_TEXT),
(brasero_medium_read_CD_TEXT), (brasero_medium_init_real),
(brasero_medium_probe_thread):
* src/burn-medium.h:
* src/burn-units.c (brasero_units_get_time_string),
(brasero_units_get_time_string_from_size):
* src/burn-units.h:
* src/burn-volume-obj.c (brasero_volume_get_gvolume),
(brasero_volume_get_mount_point),
(brasero_volume_operation_timeout), (brasero_volume_umount_finish),
(brasero_volume_eject):
* src/burn-volume-read.c:
* src/burn-volume-read.h:
* src/burn-volume-source.c (brasero_volume_source_seek_fd),
(brasero_volume_source_read_fd),
(brasero_volume_source_readcd_device_handle),
(brasero_volume_source_read10_device_handle),
(brasero_volume_source_open_file), (brasero_volume_source_open_fd),
(brasero_volume_source_open_device_handle):
* src/burn-volume.c (brasero_volume_get_primary_from_file):
* src/libbrasero-marshal.list:
* src/main.c (main):
* src/plugins/cdrdao/Makefile.am:
* src/plugins/cdrkit/Makefile.am:
* src/plugins/cdrtools/Makefile.am:
* src/plugins/checksum/Makefile.am:
* src/plugins/dvdauthor/Makefile.am:
* src/plugins/dvdcss/Makefile.am:
* src/plugins/growisofs/Makefile.am:
* src/plugins/libburnia/Makefile.am:
* src/plugins/local-track/Makefile.am:
* src/plugins/transcode/Makefile.am:
* src/plugins/vcdimager/Makefile.am:
* src/scsi-cam.c:
* src/scsi-error.c (brasero_scsi_set_error):
* src/scsi-get-configuration.c (brasero_get_configuration):
* src/scsi-get-performance.c (brasero_get_performance_get_buffer),
(brasero_get_performance):
* src/scsi-mode-sense.c (brasero_spc1_mode_sense_get_page):
* src/scsi-read-disc-info.c
(brasero_mmc1_read_disc_information_std):
* src/scsi-read-toc-pma-atip.c (brasero_read_toc_pma_atip):
* src/scsi-read-track-information.c (brasero_read_track_info):
* src/scsi-sense-data.c (brasero_sense_data_print):
* src/scsi-sg.c:
* src/scsi-uscsi.c:
* src/scsi-utils.h:
Added:
trunk/docs/reference/
trunk/docs/reference/Makefile.am
trunk/docs/reference/version.xml.in
trunk/libbrasero-media.pc.in
trunk/src/burn-units.c
trunk/src/burn-units.h
trunk/src/libbrasero-marshal.list
trunk/src/plugins/checksum/burn-volume-read.c (props changed)
- copied unchanged from r1700, /trunk/src/burn-volume-read.c
trunk/src/plugins/checksum/burn-volume-read.h (props changed)
- copied unchanged from r1700, /trunk/src/burn-volume-read.h
Removed:
trunk/src/burn-volume-read.c
trunk/src/burn-volume-read.h
Modified:
trunk/ChangeLog
trunk/Makefile.am
trunk/autogen.sh
trunk/configure.in
trunk/docs/Makefile.am
trunk/src/Makefile.am
trunk/src/brasero-dest-selection.c
trunk/src/brasero-medium-selection.c
trunk/src/brasero-medium-selection.h
trunk/src/brasero-src-selection.c
trunk/src/brasero-tool-dialog.c
trunk/src/burn-basics.h
trunk/src/burn-caps.c
trunk/src/burn-debug.c
trunk/src/burn-drive.c
trunk/src/burn-drive.h
trunk/src/burn-hal-watch.c
trunk/src/burn-iso9660.c
trunk/src/burn-media.c
trunk/src/burn-media.h
trunk/src/burn-medium-monitor.c
trunk/src/burn-medium-monitor.h
trunk/src/burn-medium.c
trunk/src/burn-medium.h
trunk/src/burn-volume-obj.c
trunk/src/burn-volume-source.c
trunk/src/burn-volume.c
trunk/src/main.c
trunk/src/plugins/cdrdao/Makefile.am
trunk/src/plugins/cdrkit/Makefile.am
trunk/src/plugins/cdrtools/Makefile.am
trunk/src/plugins/checksum/Makefile.am
trunk/src/plugins/dvdauthor/Makefile.am
trunk/src/plugins/dvdcss/Makefile.am
trunk/src/plugins/growisofs/Makefile.am
trunk/src/plugins/libburnia/Makefile.am
trunk/src/plugins/local-track/Makefile.am
trunk/src/plugins/transcode/Makefile.am
trunk/src/plugins/vcdimager/Makefile.am
trunk/src/scsi-cam.c
trunk/src/scsi-error.c
trunk/src/scsi-get-configuration.c
trunk/src/scsi-get-performance.c
trunk/src/scsi-mode-sense.c
trunk/src/scsi-read-disc-info.c
trunk/src/scsi-read-toc-pma-atip.c
trunk/src/scsi-read-track-information.c
trunk/src/scsi-sense-data.c
trunk/src/scsi-sg.c
trunk/src/scsi-uscsi.c
trunk/src/scsi-utils.h
Modified: trunk/Makefile.am
==============================================================================
--- trunk/Makefile.am (original)
+++ trunk/Makefile.am Wed Jan 7 14:28:22 2009
@@ -19,12 +19,14 @@
intltool-merge.in \
intltool-update.in \
gnome-doc-utils.make \
+ libbrasero-media.pc \
m4
noinst_PROGRAMS =
-DIST_CHECK_CONFIGRE_FLAGS =
- --disable-scrollkeeper
+DIST_CHECK_CONFIGRE_FLAGS = \
+ --disable-scrollkeeper \
+ --enable-gtk-doc
DISTCLEANFILES = \
intltool-extract \
@@ -32,6 +34,9 @@
intltool-update \
gtk-doc.make
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = libbrasero-media.pc
+
# Copy all the spec files. Of cource, only one is actually used.
dist-hook:
for specfile in *.spec; do \
Modified: trunk/autogen.sh
==============================================================================
--- trunk/autogen.sh (original)
+++ trunk/autogen.sh Wed Jan 7 14:28:22 2009
@@ -18,4 +18,4 @@
echo "You need to install gnome-common from the GNOME CVS"
exit 1
}
-REQUIRED_AUTOMAKE_VERSION=1.7 . gnome-autogen.sh
+REQUIRED_AUTOMAKE_VERSION=1.7 USE_GNOME2_MACROS=1 . gnome-autogen.sh --enable-gtk-doc "$@"
Modified: trunk/configure.in
==============================================================================
--- trunk/configure.in (original)
+++ trunk/configure.in Wed Jan 7 14:28:22 2009
@@ -20,6 +20,8 @@
AC_SUBST(LT_REVISION)
AC_SUBST(LT_AGE)
+LIBBRASERO_LT_VERSION=0:0:0
+AC_SUBST(LIBBRASERO_LT_VERSION)
AC_DEFINE_UNQUOTED(BRASERO_MAJOR_VERSION, $BRASERO_MAJOR_VERSION, [major version])
AC_DEFINE_UNQUOTED(BRASERO_MINOR_VERSION, $BRASERO_MINOR_VERSION, [minor version])
@@ -47,7 +49,8 @@
dnl ***************** GENERAL **********************************
AC_DISABLE_STATIC
-AC_PROG_LIBTOOL
+AM_PROG_LIBTOOL
+
dnl ** reminder: the following set CFLAGS to -O2 -g if empty
AC_PROG_CC
AC_HEADER_STDC
@@ -121,15 +124,15 @@
GNOME_DOC_INIT
dnl ** used by brasero and one plugin
-PKG_CHECK_MODULES(BRASERO_GSTREAMER, \
- gstreamer-0.10 >= $GSTREAMER_REQUIRED \
+PKG_CHECK_MODULES(BRASERO_GSTREAMER, \
+ gstreamer-0.10 >= $GSTREAMER_REQUIRED \
+ gstreamer-interfaces-0.10 \
gstreamer-plugins-base-0.10 >= $GSTREAMER_BASE_REQUIRED)
AC_SUBST(BRASERO_GSTREAMER_CFLAGS)
AC_SUBST(BRASERO_GSTREAMER_LIBS)
-BRASERO_GSTREAMER_CFLAGS="$BRASERO_GSTREAMER_CFLAGS $CFLAGS"
-BRASERO_GSTREAMER_LIBS="$BRASERO_GSTREAMER_LIBS $LDFLAGS -lgstpbutils-0.10"
+BRASERO_GSTREAMER_LIBS="$BRASERO_GSTREAMER_LIBS -lgstpbutils-0.10"
dnl ** used by brasero and one plugin
PKG_CHECK_MODULES(BRASERO_GIO, \
@@ -138,9 +141,6 @@
AC_SUBST(BRASERO_GIO_CFLAGS)
AC_SUBST(BRASERO_GIO_LIBS)
-BRASERO_GIO_CFLAGS="$BRASERO_GIO_CFLAGS $CFLAGS"
-BRASERO_GIO_LIBS="$BRASERO_GIO_LIBS $LDFLAGS"
-
dnl ** used by brasero and one plugin
PKG_CHECK_MODULES(BRASERO_LIBXML, \
libxml-2.0 >= $LIBXML2_REQUIRED)
@@ -148,37 +148,44 @@
AC_SUBST(BRASERO_LIBXML_CFLAGS)
AC_SUBST(BRASERO_LIBXML_LIBS)
-BRASERO_LIBXML_CFLAGS="$BRASERO_LIBXML_CFLAGS $CFLAGS"
-BRASERO_LIBXML_LIBS="$BRASERO_LIBXML_LIBS $LDFLAGS"
-
dnl ** used by brasero and all modules
-PKG_CHECK_MODULES(BRASERO_BASE, \
- gconf-2.0 >= $GCONF_REQUIRED \
+PKG_CHECK_MODULES(BRASERO_GLIB, \
glib-2.0 >= $GLIB_REQUIRED)
-AC_SUBST(BRASERO_BASE_CFLAGS)
-AC_SUBST(BRASERO_BASE_LIBS)
+AC_SUBST(BRASERO_GLIB_CFLAGS)
+AC_SUBST(BRASERO_GLIB_LIBS)
-BRASERO_BASE_CFLAGS="$BRASERO_BASE_CFLAGS $BRASERO_GIO_CFLAGS $CFLAGS"
-BRASERO_BASE_LIBS="$BRASERO_BASE_LIBS $LDFLAGS"
+PKG_CHECK_MODULES(BRASERO_GCONF, \
+ gconf-2.0 >= $GCONF_REQUIRED)
-dnl ** used only by brasero app itself ***
-PKG_CHECK_MODULES(BRASERO_UI, \
- hal >= $HAL_REQUIRED \
- gmodule-2.0 >= $GMODULE_REQUIRED \
+AC_SUBST(BRASERO_GCONF_CFLAGS)
+AC_SUBST(BRASERO_GCONF_LIBS)
+
+PKG_CHECK_MODULES(BRASERO_GMODULE, \
+ gmodule-2.0 >= $GMODULE_REQUIRED)
+
+AC_SUBST(BRASERO_GMODULE_CFLAGS)
+AC_SUBST(BRASERO_GMODULE_LIBS)
+
+PKG_CHECK_MODULES(BRASERO_GTK, \
gdk-2.0 >= $GDK_REQUIRED \
- gtk+-2.0 >= $GTK_REQUIRED \
- dbus-glib-1 >= $DBUS_REQUIRED \
- sm)
+ gtk+-2.0 >= $GTK_REQUIRED)
+
+AC_SUBST(BRASERO_GTK_CFLAGS)
+AC_SUBST(BRASERO_GTK_LIBS)
-AC_SUBST(BRASERO_UI_CFLAGS)
-AC_SUBST(BRASERO_UI_LIBS)
+PKG_CHECK_MODULES(BRASERO_HAL, \
+ hal >= $HAL_REQUIRED \
+ dbus-glib-1 >= $DBUS_REQUIRED)
+
+AC_SUBST(BRASERO_HAL_CFLAGS)
+AC_SUBST(BRASERO_HAL_LIBS)
-BRASERO_CFLAGS="$BRASERO_BASE_CFLAGS $BRASERO_UI_CFLAGS $BRASERO_GSTREAMER_CFLAGS $BRASERO_GIO_CFLAGS $BRASERO_CFLAGS $CFLAGS"
-BRASERO_LIBS="$BRASERO_BASE_LIBS $BRASERO_UI_LIBS $BRASERO_GSTREAMER_LIBS $BRASERO_GIO_LIBS $BRASERO_LIBS $BRASERO_SCSI_LIBS $LDFLAGS"
+PKG_CHECK_MODULES(BRASERO_SM, \
+ sm)
-AC_SUBST(BRASERO_CFLAGS)
-AC_SUBST(BRASERO_LIBS)
+AC_SUBST(BRASERO_SM_CFLAGS)
+AC_SUBST(BRASERO_SM_LIBS)
dnl ****************Nautilus**********************************
NAUTILUS_REQUIRED=2.22.2
@@ -197,8 +204,8 @@
fi
if test x"$build_nautilus" = "xyes"; then
- NAUTILUS_EXTENSION_CFLAGS="$BRASERO_BASE_CFLAGS $BRASERO_UI_CFLAGS $NAUTILUS_EXTENSION_CFLAGS"
- NAUTILUS_EXTENSION_LIBS="$BRASERO_BASE_LIBS $BRASERO_UI_LIBS $NAUTILUS_EXTENSION_LIBS"
+ NAUTILUS_EXTENSION_CFLAGS="$BRASERO_GLIB_CFLAGS $BRASERO_UI_CFLAGS $NAUTILUS_EXTENSION_CFLAGS"
+ NAUTILUS_EXTENSION_LIBS="$BRASERO_GLIB_LIBS $BRASERO_UI_LIBS $NAUTILUS_EXTENSION_LIBS"
NAUTILUSDIR=`pkg-config --variable=extensiondir libnautilus-extension`
AC_SUBST(NAUTILUSDIR)
AM_GLIB_DEFINE_LOCALEDIR([GNOMELOCALEDIR])
@@ -283,16 +290,18 @@
[enable_search="yes"])
if test x"$enable_search" = "xyes"; then
- PKG_CHECK_MODULES(BEAGLE, libbeagle-1.0 >= $BEAGLE_REQUIRED, build_beagle=yes, build_beagle=no)
+ PKG_CHECK_MODULES(BRASERO_BEAGLE, libbeagle-1.0 >= $BEAGLE_REQUIRED, build_beagle=yes, build_beagle=no)
else
build_beagle="no"
fi
if test x"$build_beagle" = "xyes"; then
- BRASERO_CFLAGS="$BRASERO_CFLAGS $BEAGLE_CFLAGS"
- BRASERO_LIBS="$BRASERO_LIBS $BEAGLE_LIBS"
AC_DEFINE(BUILD_SEARCH, 1, [define if you want to use search pane])
+
+ AC_SUBST(BRASERO_BEAGLE_CFLAGS)
+ AC_SUBST(BRASERO_BEAGLE_LIBS)
fi
+
AM_CONDITIONAL(BUILD_SEARCH, test x"$build_search" = "xyes")
dnl ****************check for playlist (optional)**************
@@ -303,16 +312,18 @@
[enable_playlist="yes"])
if test x"$enable_playlist" = "xyes"; then
- PKG_CHECK_MODULES(TOTEM, totem-plparser >= $TOTEM_REQUIRED, build_totem=yes, build_totem=no)
+ PKG_CHECK_MODULES(BRASERO_PL_PARSER, totem-plparser >= $TOTEM_REQUIRED, build_totem=yes, build_totem=no)
else
build_totem="no"
fi
if test x"$build_totem" = "xyes"; then
- BRASERO_CFLAGS="$BRASERO_CFLAGS $TOTEM_CFLAGS"
- BRASERO_LIBS="$BRASERO_LIBS $TOTEM_LIBS"
AC_DEFINE(BUILD_PLAYLIST, 1, [define if you want to build playlist pane])
fi
+
+AC_SUBST(BRASERO_PL_PARSER_CFLAGS)
+AC_SUBST(BRASERO_PL_PARSER_LIBS)
+
AM_CONDITIONAL(BUILD_PLAYLIST, test x"$build_totem" = "xyes")
dnl ****************check for preview (optional)**************
@@ -322,16 +333,18 @@
[enable_preview="yes"])
if test x"$enable_preview" = "xyes"; then
- PKG_CHECK_MODULES(GSTREAMER_GCONF, gstreamer-plugins-base-0.10 >= $GSTREAMER_MODULE_REQUIRED, build_preview=yes, build_preview=no)
+ PKG_CHECK_MODULES(BRASERO_GSTREAMER_BASE, gstreamer-plugins-base-0.10 >= $GSTREAMER_MODULE_REQUIRED, build_preview=yes, build_preview=no)
else
build_preview="no"
fi
if test x"$build_preview" = "xyes"; then
- BRASERO_CFLAGS="$BRASERO_CFLAGS $GSTREAMER_GCONF_CFLAGS"
- BRASERO_LIBS="$BRASERO_LIBS $GSTREAMER_GCONF_LIBS -lgstinterfaces-0.10"
AC_DEFINE(BUILD_PREVIEW, 1, [define if you want to build preview pane])
fi
+
+AC_SUBST(BRASERO_GSTREAMER_BASE_CFLAGS)
+AC_SUBST(BRASERO_GSTREAMER_BASE_LIBS)
+
AM_CONDITIONAL(BUILD_PREVIEW, test x"$build_preview" = "xyes")
dnl ****************check for inotify (optional)**************
@@ -366,6 +379,9 @@
AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "${prefix}/${DATADIRNAME}/locale", [Location of package locale files])
fi
+dnl ***** API docs **********************
+GTK_DOC_CHECK(1.9)
+
dnl ***** GCONF *************************
AC_ARG_ENABLE(schemas-install,AC_HELP_STRING([--disable-schemas-install],
@@ -383,7 +399,10 @@
AC_OUTPUT([
Makefile
+libbrasero-media.pc
docs/Makefile
+docs/reference/Makefile
+docs/reference/version.xml
data/Makefile
data/brasero.desktop.in
data/brasero-open-playlist.desktop.in
Modified: trunk/docs/Makefile.am
==============================================================================
--- trunk/docs/Makefile.am (original)
+++ trunk/docs/Makefile.am Wed Jan 7 14:28:22 2009
@@ -1,2 +1,4 @@
+SUBDIRS=reference
+
man_MANS = brasero.1
EXTRA_DIST = $(man_MANS)
Added: trunk/docs/reference/Makefile.am
==============================================================================
--- (empty file)
+++ trunk/docs/reference/Makefile.am Wed Jan 7 14:28:22 2009
@@ -0,0 +1,92 @@
+## Process this file with automake to produce Makefile.in
+
+# We require automake 1.6 at least.
+AUTOMAKE_OPTIONS = 1.6
+
+# This is a blank Makefile.am for using gtk-doc.
+# Copy this to your project's API docs directory and modify the variables to
+# suit your project. See the GTK+ Makefiles in gtk+/docs/reference for examples
+# of using the various options.
+
+# The name of the module, e.g. 'glib'.
+DOC_MODULE=brasero
+
+# The top-level SGML file. You can change this if you want to.
+DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.sgml
+
+# The directory containing the source code. Relative to $(srcdir).
+# gtk-doc will search all .c & .h files beneath here for inline comments
+# documenting the functions and macros.
+# e.g. DOC_SOURCE_DIR=../../../gtk
+DOC_SOURCE_DIR=../../src
+
+# Extra options to pass to gtkdoc-scangobj. Not normally needed.
+SCANGOBJ_OPTIONS=
+
+# Extra options to supply to gtkdoc-scan.
+# e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED"
+SCAN_OPTIONS=
+
+# Extra options to supply to gtkdoc-mkdb.
+# e.g. MKDB_OPTIONS=--sgml-mode --output-format=xml
+MKDB_OPTIONS=--sgml-mode --output-format=xml
+
+# Extra options to supply to gtkdoc-mktmpl
+# e.g. MKTMPL_OPTIONS=--only-section-tmpl
+MKTMPL_OPTIONS=
+
+# Extra options to supply to gtkdoc-fixref. Not normally needed.
+# e.g. FIXXREF_OPTIONS=--extra-dir=../gdk-pixbuf/html --extra-dir=../gdk/html
+FIXXREF_OPTIONS=
+
+# Used for dependencies. The docs will be rebuilt if any of these change.
+# e.g. HFILE_GLOB=$(top_srcdir)/gtk/*.h
+# e.g. CFILE_GLOB=$(top_srcdir)/gtk/*.c
+HFILE_GLOB=$(top_srcdir)/src/*.h
+CFILE_GLOB=$(top_srcdir)/src/*.c
+
+# Header files to ignore when scanning.
+# e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h
+IGNORE_HFILES=
+
+# Images to copy into HTML directory.
+# e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png
+HTML_IMAGES=
+
+# Extra SGML files that are included by $(DOC_MAIN_SGML_FILE).
+# e.g. content_files=running.sgml building.sgml changes-2.0.sgml
+content_files=version.xml
+
+# SGML files where gtk-doc abbrevations (#GtkWidget) are expanded
+# These files must be listed here *and* in content_files
+# e.g. expand_content_files=running.sgml
+expand_content_files=
+
+# CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library.
+# Only needed if you are using gtkdoc-scangobj to dynamically query widget
+# signals and properties.
+# e.g. INCLUDES=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS)
+# e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib)
+INCLUDES= \
+ -I$(top_srcdir) \
+ -I$(top_builddir) \
+ $(BRASERO_CFLAGS)
+
+GTKDOC_LIBS=$(top_builddir)/src/libbrasero.la
+
+# This includes the standard gtk-doc make rules, copied by gtkdocize.
+include $(top_srcdir)/gtk-doc.make
+
+# Other files to distribute
+# e.g. EXTRA_DIST += version.xml.in
+EXTRA_DIST +=
+
+# Files not to distribute
+# for --rebuild-types in $(SCAN_OPTIONS), e.g. $(DOC_MODULE).types
+# for --rebuild-sections in $(SCAN_OPTIONS) e.g. $(DOC_MODULE)-sections.txt
+#DISTCLEANFILES +=
+
+# Comment this out if you want your docs-status tested during 'make check'
+#TESTS = $(GTKDOC_CHECK)
+
+
Added: trunk/docs/reference/version.xml.in
==============================================================================
--- (empty file)
+++ trunk/docs/reference/version.xml.in Wed Jan 7 14:28:22 2009
@@ -0,0 +1 @@
+ BRASERO_VERSION_MAJOR@ BRASERO_VERSION_MINOR@ BRASERO_VERSION_MICRO@
Added: trunk/libbrasero-media.pc.in
==============================================================================
--- (empty file)
+++ trunk/libbrasero-media.pc.in Wed Jan 7 14:28:22 2009
@@ -0,0 +1,13 @@
+prefix= prefix@
+exec_prefix= exec_prefix@
+libdir= libdir@
+includedir= includedir@
+gconf_serverdir= libexecdir@
+
+
+Name: libbrasero-media
+Description: Brasero Optical Media library
+Version: @VERSION@
+Requires: glib-2.0 gthread-2.0 gtk+-2.0 hal
+Libs: -L${libdir} -lbrasero-media
+Cflags: -I${includedir}/brasero/
Modified: trunk/src/Makefile.am
==============================================================================
--- trunk/src/Makefile.am (original)
+++ trunk/src/Makefile.am Wed Jan 7 14:28:22 2009
@@ -9,23 +9,152 @@
-DBRASERO_DATADIR=\"$(datadir)/brasero\" \
-DBRASERO_LIBDIR=\"$(libdir)\" \
$(DISABLE_DEPRECATED) \
- $(BRASERO_CFLAGS) \
- $(BRASERO_LIBXML_CFLAGS)
-
-EXTRA_DIST = brasero-marshal.list
-CLEANFILES = $(RECMARSHALFILES)
+ $(BRASERO_GLIB_CFLAGS) \
+ $(BRASERO_IO_CFLAGS) \
+ $(BRASERO_GCONF_CFLAGS) \
+ $(BRASERO_GSTREAMER_CFLAGS) \
+ $(BRASERO_GSTREAMER_BASE_CFLAGS) \
+ $(BRASERO_SM_CFLAGS) \
+ $(BRASERO_GTK_CFLAGS) \
+ $(BRASERO_GMODULE_CFLAGS) \
+ $(BRASERO_HAL_CFLAGS) \
+ $(BRASERO_LIBXML_CFLAGS) \
+ $(BRASERO_BEAGLE_CFLAGS) \
+ $(BRASERO_PL_PARSER_CFLAGS)
GLIB_GENMARSHAL=`pkg-config --variable=glib_genmarshal glib-2.0`
-RECMARSHALFILES = brasero-marshal.h brasero-marshal.c
+RECMARSHALFILES = brasero-marshal.h brasero-marshal.c libbrasero-marshal.h libbrasero-marshal.c
+
brasero-marshal.h: brasero-marshal.list
( $(GLIB_GENMARSHAL) --prefix=brasero_marshal $(srcdir)/brasero-marshal.list --header > brasero-marshal.h )
brasero-marshal.c: brasero-marshal.h
( $(GLIB_GENMARSHAL) --prefix=brasero_marshal $(srcdir)/brasero-marshal.list --body --header > brasero-marshal.c )
+libbrasero-marshal.h: libbrasero-marshal.list
+ ( $(GLIB_GENMARSHAL) --prefix=brasero_marshal $(srcdir)/libbrasero-marshal.list --header > libbrasero-marshal.h )
+libbrasero-marshal.c: libbrasero-marshal.h
+ ( $(GLIB_GENMARSHAL) --prefix=brasero_marshal $(srcdir)/libbrasero-marshal.list --body --header > libbrasero-marshal.c )
+
+lib_LTLIBRARIES = \
+ libbrasero-media.la
+
+libbraseromediaincludedir = $(pkgincludedir)/
+libbraseromediainclude_HEADERS = \
+ burn-drive.h \
+ burn-medium-monitor.h \
+ burn-media.h \
+ burn-units.h \
+ burn-medium.h \
+ burn-volume-obj.h \
+ brasero-medium-selection.h
+
+libbrasero_media_la_LADD = \
+ $(BRASERO_GLIB_LIBS) \
+ $(BRASERO_IO_LIBS) \
+ $(BRASERO_GTK_LIBS) \
+ $(BRASERO_HAL_LIBS) \
+ -version-info $(LIBBRASERO_LT_VERSION) \
+ -export-symbols $(srcdir)/libbrasero_drive.symbols \
+ -no-undefined \
+ $(AM_LDFLAGS)
+
+libbrasero_media_la_SOURCES = \
+ libbrasero-marshal.c \
+ libbrasero-marshal.h \
+ burn-drive.h \
+ burn-medium-monitor.h \
+ burn-media.h \
+ burn-units.h \
+ burn-medium.h \
+ burn-volume-obj.h \
+ brasero-medium-selection.h \
+ scsi-base.h \
+ scsi-command.h \
+ scsi-error.h \
+ scsi-get-configuration.c \
+ scsi-get-configuration.h \
+ scsi-mmc1.h \
+ scsi-mmc2.h \
+ scsi-opcodes.h \
+ scsi-read-disc-info.c \
+ scsi-read-disc-info.h \
+ scsi-read-toc-pma-atip.c \
+ scsi-read-toc-pma-atip.h \
+ scsi-sense-data.c \
+ scsi-sense-data.h \
+ scsi-utils.h \
+ scsi-q-subchannel.h \
+ scsi-error.c \
+ scsi-read-track-information.c \
+ scsi-read-track-information.h \
+ scsi-get-performance.c \
+ scsi-get-performance.h \
+ scsi-mmc3.h \
+ scsi-mode-pages.h \
+ scsi-mode-sense.c \
+ scsi-status-page.h \
+ scsi-spc1.h \
+ scsi-read-capacity.c \
+ scsi-read-capacity.h \
+ scsi-read-disc-structure.c \
+ scsi-read-disc-structure.h \
+ scsi-dvd-structures.h \
+ scsi-read-format-capacities.c \
+ scsi-read-format-capacities.h \
+ scsi-read-cd.h \
+ scsi-read-cd.c \
+ scsi-device.h \
+ scsi-eject.c \
+ scsi-mech-status.c \
+ scsi-mech-status.h \
+ scsi-write-page.h \
+ scsi-mode-select.c \
+ scsi-read10.c \
+ scsi-sbc.h \
+ scsi-test-unit-ready.c \
+ burn-media.c \
+ burn-hal-watch.c \
+ burn-hal-watch.h \
+ burn-medium-monitor.c \
+ burn-susp.c \
+ burn-susp.h \
+ burn-iso-field.c \
+ burn-iso-field.h \
+ burn-iso9660.c \
+ burn-iso9660.h \
+ burn-volume-source.c \
+ burn-volume-source.h \
+ burn-volume.c \
+ burn-volume.h \
+ burn-medium.c \
+ burn-volume-obj.c \
+ burn-drive.c \
+ brasero-medium-selection.c \
+ burn-units.c
+
+# FreeBSD's SCSI CAM interface
+if HAVE_CAM_LIB_H
+libbrasero_media_la_SOURCES += scsi-cam.c
+endif
+
+# Linux's SCSI CAM interface
+if HAVE_SG_IO_HDR_T
+libbrasero_media_la_SOURCES += scsi-sg.c
+endif
+
+# Solaris's USCSI interface
+if HAVE_USCSI_H
+libbrasero_media_la_SOURCES += scsi-uscsi.c
+endif
+
+
+
+
bin_PROGRAMS = brasero
brasero_SOURCES = \
- $(RECMARSHALFILES) \
+ brasero-marshal.c \
+ brasero-marshal.h \
main.c \
brasero-utils.h \
brasero-utils.c \
@@ -106,55 +235,8 @@
brasero-disc-option-dialog.h \
brasero-image-type-chooser.c \
brasero-image-type-chooser.h \
- burn-iso9660.c \
- burn-iso9660.h \
brasero-layout-object.c \
brasero-layout-object.h \
- burn-volume.c \
- burn-volume.h \
- burn-susp.c \
- burn-susp.h \
- burn-iso-field.c \
- burn-iso-field.h \
- burn-medium.h \
- burn-medium.c \
- scsi-base.h \
- scsi-command.h \
- scsi-error.h \
- scsi-get-configuration.c \
- scsi-get-configuration.h \
- scsi-mmc1.h \
- scsi-mmc2.h \
- scsi-opcodes.h \
- scsi-read-disc-info.c \
- scsi-read-disc-info.h \
- scsi-read-toc-pma-atip.c \
- scsi-read-toc-pma-atip.h \
- scsi-sense-data.c \
- scsi-sense-data.h \
- scsi-utils.h \
- scsi-q-subchannel.h \
- scsi-error.c \
- scsi-read-track-information.c \
- scsi-read-track-information.h \
- scsi-get-performance.c \
- scsi-get-performance.h \
- scsi-mmc3.h \
- scsi-mode-pages.h \
- scsi-mode-sense.c \
- scsi-status-page.h \
- scsi-spc1.h \
- scsi-read-capacity.c \
- scsi-read-capacity.h \
- scsi-read-disc-structure.c \
- scsi-read-disc-structure.h \
- scsi-dvd-structures.h \
- scsi-read-format-capacities.c \
- scsi-read-format-capacities.h \
- scsi-read-cd.h \
- scsi-read-cd.c \
- burn-debug.c \
- burn-debug.h \
burn-track.h \
burn-plugin.h \
burn-plugin.c \
@@ -213,22 +295,8 @@
brasero-disc-message.c \
baobab-cell-renderer-progress.c \
baobab-cell-renderer-progress.h \
- scsi-device.h \
brasero-io.h \
brasero-io.c \
- brasero-medium-selection.h \
- brasero-medium-selection.c \
- burn-medium-monitor.c \
- burn-medium-monitor.h \
- burn-drive.h \
- burn-drive.c \
- burn-volume-obj.c \
- burn-volume-obj.h \
- scsi-eject.c \
- scsi-mech-status.c \
- scsi-mech-status.h \
- burn-volume-read.h \
- burn-volume-read.c \
brasero-jacket-background.c \
brasero-jacket-background.h \
brasero-jacket-buffer.c \
@@ -245,18 +313,12 @@
brasero-rename.c \
brasero-notify.c \
brasero-notify.h \
- burn-volume-source.c \
- burn-volume-source.h \
brasero-video-disc.c \
brasero-video-disc.h \
brasero-video-project.h \
brasero-video-project.c \
brasero-video-tree-model.c \
brasero-video-tree-model.h \
- scsi-write-page.h \
- scsi-mode-select.c \
- scsi-read10.c \
- scsi-sbc.h \
brasero-app.c \
brasero-app.h \
brasero-session-cfg.h \
@@ -269,13 +331,10 @@
brasero-medium-properties.c \
brasero-src-image.h \
brasero-src-image.c \
- burn-media.c \
- burn-media.h \
- burn-hal-watch.c \
- burn-hal-watch.h \
- scsi-test-unit-ready.c \
brasero-tool-color-picker.h \
brasero-tool-color-picker.c \
+ burn-debug.c \
+ burn-debug.h \
eggdesktopfile.c \
eggdesktopfile.h \
eggsmclient.c \
@@ -287,21 +346,25 @@
brasero_SOURCES += brasero-file-monitor.c brasero-file-monitor.h
endif
-# FreeBSD's SCSI CAM interface
-if HAVE_CAM_LIB_H
-brasero_SOURCES += scsi-cam.c
-endif
-
-# Linux's SCSI CAM interface
-if HAVE_SG_IO_HDR_T
-brasero_SOURCES += scsi-sg.c
-endif
-
-# Solaris's USCSI interface
-if HAVE_USCSI_H
-brasero_SOURCES += scsi-uscsi.c
-endif
+brasero_LDADD = \
+ libbrasero-media.la \
+ $(BRASERO_GLIB_LIBS) \
+ $(BRASERO_IO_LIBS) \
+ $(BRASERO_GCONF_LIBS) \
+ $(BRASERO_GSTREAMER_LIBS) \
+ $(BRASERO_GSTREAMER_BASE_LIBS) \
+ $(BRASERO_SM_LIBS) \
+ $(BRASERO_GTK_LIBS) \
+ $(BRASERO_GMODULE_LIBS) \
+ $(BRASERO_LIBXML_LIBS) \
+ $(BRASERO_BEAGLE_LIBS) \
+ $(BRASERO_PL_PARSER_LIBS)
-brasero_LDADD = \
- $(BRASERO_LIBS) $(BRASERO_LIBXML_LIBS)
+EXTRA_DIST = \
+ brasero-marshal.list \
+ libbrasero-marshal.list \
+ libbrasero.symbols
+CLEANFILES = \
+ $(RECMARSHALFILES)
+
Modified: trunk/src/brasero-dest-selection.c
==============================================================================
--- trunk/src/brasero-dest-selection.c (original)
+++ trunk/src/brasero-dest-selection.c Wed Jan 7 14:28:22 2009
@@ -85,15 +85,20 @@
}
if (locked) {
- BraseroDrive *drive;
+ BraseroMedium *medium;
- drive = brasero_medium_selection_get_active_drive (BRASERO_MEDIUM_SELECTION (self));
- priv->locked_drive = drive;
+ medium = brasero_medium_selection_get_active (BRASERO_MEDIUM_SELECTION (self));
+ priv->locked_drive = brasero_medium_get_drive (medium);
- if (priv->locked_drive)
+ if (priv->locked_drive) {
+ g_object_ref (priv->locked_drive);
brasero_drive_lock (priv->locked_drive,
_("Ongoing burning process"),
NULL);
+ }
+
+ if (medium)
+ g_object_unref (medium);
}
}
@@ -102,23 +107,19 @@
BraseroDestSelection *self)
{
BraseroDestSelectionPrivate *priv;
+ BraseroMedium *medium;
BraseroDrive *burner;
- BraseroDrive *drive;
priv = BRASERO_DEST_SELECTION_PRIVATE (self);
/* make sure the current displayed drive reflects that */
burner = brasero_burn_session_get_burner (priv->session);
- drive = brasero_medium_selection_get_active_drive (BRASERO_MEDIUM_SELECTION (self));
- if (burner != drive) {
- BraseroMedium *medium;
-
- medium = brasero_drive_get_medium (drive);
+ medium = brasero_medium_selection_get_active (BRASERO_MEDIUM_SELECTION (self));
+ if (burner != brasero_medium_get_drive (medium))
brasero_medium_selection_set_active (BRASERO_MEDIUM_SELECTION (self), medium);
- }
- if (drive)
- g_object_unref (drive);
+ if (medium)
+ g_object_unref (medium);
brasero_medium_selection_update_media_string (BRASERO_MEDIUM_SELECTION (self));
}
@@ -127,32 +128,33 @@
brasero_dest_selection_medium_changed (GtkComboBox *combo)
{
BraseroDestSelectionPrivate *priv;
- BraseroDrive *drive;
+ BraseroMedium *medium;
priv = BRASERO_DEST_SELECTION_PRIVATE (combo);
if (!priv->session)
goto chain;
- drive = brasero_medium_selection_get_active_drive (BRASERO_MEDIUM_SELECTION (combo));
- if (!drive) {
+ medium = brasero_medium_selection_get_active (BRASERO_MEDIUM_SELECTION (combo));
+ if (!medium) {
gtk_widget_set_sensitive (GTK_WIDGET (combo), FALSE);
goto chain;
}
- if (drive == brasero_burn_session_get_burner (priv->session)) {
- g_object_unref (drive);
+ if (brasero_medium_get_drive (medium) == brasero_burn_session_get_burner (priv->session)) {
+ g_object_unref (medium);
goto chain;
}
- if (priv->locked_drive && priv->locked_drive != drive) {
- brasero_medium_selection_set_active (BRASERO_MEDIUM_SELECTION (combo),
- brasero_drive_get_medium (priv->locked_drive));
+ if (priv->locked_drive && priv->locked_drive != brasero_medium_get_drive (medium)) {
+ brasero_medium_selection_set_active (BRASERO_MEDIUM_SELECTION (combo), medium);
+ g_object_unref (medium);
goto chain;
}
- brasero_burn_session_set_burner (priv->session, drive);
+ brasero_burn_session_set_burner (priv->session, brasero_medium_get_drive (medium));
gtk_widget_set_sensitive (GTK_WIDGET (combo), (priv->locked_drive == NULL));
+ g_object_unref (medium);
chain:
@@ -276,7 +278,6 @@
{
BraseroDestSelectionPrivate *priv;
BraseroBurnSession *session;
- BraseroDrive *drive;
priv = BRASERO_DEST_SELECTION_PRIVATE (object);
@@ -293,15 +294,19 @@
g_object_ref (session);
if (brasero_burn_session_get_flags (session) & BRASERO_BURN_FLAG_MERGE) {
+ BraseroDrive *drive;
+
drive = brasero_burn_session_get_burner (session);
brasero_medium_selection_set_active (BRASERO_MEDIUM_SELECTION (object),
brasero_drive_get_medium (drive));
}
else {
- drive = brasero_medium_selection_get_active_drive (BRASERO_MEDIUM_SELECTION (object));
- if (drive) {
- brasero_burn_session_set_burner (session, drive);
- g_object_unref (drive);
+ BraseroMedium *medium;
+
+ medium = brasero_medium_selection_get_active (BRASERO_MEDIUM_SELECTION (object));
+ if (medium) {
+ brasero_burn_session_set_burner (session, brasero_medium_get_drive (medium));
+ g_object_unref (medium);
}
}
Modified: trunk/src/brasero-medium-selection.c
==============================================================================
--- trunk/src/brasero-medium-selection.c (original)
+++ trunk/src/brasero-medium-selection.c Wed Jan 7 14:28:22 2009
@@ -144,7 +144,7 @@
size_string);
}
else {
- size_string = brasero_utils_get_time_string_from_size (size,
+ size_string = brasero_units_get_time_string_from_size (size,
TRUE,
TRUE);
/* NOTE for translators: the first %s is the medium name, the
@@ -273,32 +273,6 @@
return medium;
}
-BraseroDrive *
-brasero_medium_selection_get_active_drive (BraseroMediumSelection *self)
-{
- BraseroMedium *medium;
- BraseroDrive *drive;
- GtkTreeModel *model;
- GtkTreeIter iter;
-
- model = gtk_combo_box_get_model (GTK_COMBO_BOX (self));
- if (!gtk_combo_box_get_active_iter (GTK_COMBO_BOX (self), &iter))
- return NULL;
-
- gtk_tree_model_get (model, &iter,
- MEDIUM_COL, &medium,
- -1);
-
- if (!medium)
- return NULL;
-
- drive = brasero_medium_get_drive (medium);
- g_object_unref (medium);
- g_object_ref (drive);
-
- return drive;
-}
-
static void
brasero_medium_selection_update_no_disc_entry (BraseroMediumSelection *self,
GtkTreeModel *model,
Modified: trunk/src/brasero-medium-selection.h
==============================================================================
--- trunk/src/brasero-medium-selection.h (original)
+++ trunk/src/brasero-medium-selection.h Wed Jan 7 14:28:22 2009
@@ -65,9 +65,6 @@
BraseroMedium *
brasero_medium_selection_get_active (BraseroMediumSelection *selection);
-BraseroDrive *
-brasero_medium_selection_get_active_drive (BraseroMediumSelection *selection);
-
gboolean
brasero_medium_selection_set_active (BraseroMediumSelection *selection,
BraseroMedium *medium);
Modified: trunk/src/brasero-src-selection.c
==============================================================================
--- trunk/src/brasero-src-selection.c (original)
+++ trunk/src/brasero-src-selection.c Wed Jan 7 14:28:22 2009
@@ -57,6 +57,7 @@
brasero_src_selection_medium_changed (GtkComboBox *combo_box)
{
BraseroSrcSelectionPrivate *priv;
+ BraseroMedium *medium = NULL;
BraseroDrive *drive = NULL;
priv = BRASERO_SRC_SELECTION_PRIVATE (combo_box);
@@ -64,7 +65,8 @@
if (!priv->session)
goto chain;
- drive = brasero_medium_selection_get_active_drive (BRASERO_MEDIUM_SELECTION (combo_box));
+ medium = brasero_medium_selection_get_active (BRASERO_MEDIUM_SELECTION (combo_box));
+ drive = brasero_medium_get_drive (medium);
/* NOTE: don't check for drive == NULL to set the session input type */
if (priv->track
@@ -84,8 +86,8 @@
chain:
- if (drive)
- g_object_unref (drive);
+ if (medium)
+ g_object_unref (medium);
gtk_widget_set_sensitive (GTK_WIDGET (combo_box), drive != NULL);
Modified: trunk/src/brasero-tool-dialog.c
==============================================================================
--- trunk/src/brasero-tool-dialog.c (original)
+++ trunk/src/brasero-tool-dialog.c Wed Jan 7 14:28:22 2009
@@ -383,7 +383,6 @@
gboolean
brasero_tool_dialog_cancel (BraseroToolDialog *self)
{
- BraseroBurnResult result = BRASERO_BURN_OK;
BraseroToolDialogClass *klass;
klass = BRASERO_TOOL_DIALOG_GET_CLASS (self);
Modified: trunk/src/burn-basics.h
==============================================================================
--- trunk/src/burn-basics.h (original)
+++ trunk/src/burn-basics.h Wed Jan 7 14:28:22 2009
@@ -31,6 +31,8 @@
G_BEGIN_DECLS
+#include "burn-units.h"
+
#define BRASERO_GET_BASENAME_FOR_DISPLAY(uri, name) \
{ \
gchar *escaped_basename; \
@@ -167,18 +169,6 @@
#define BRASERO_PLUGIN_KEY "/apps/brasero/config/plugins"
-#define BRASERO_DURATION_TO_BYTES(duration) \
- ((gint64) (duration) * 75 * 2352 / 1000000000 + \
- (((gint64) ((duration) * 75 * 2352) % 1000000000) ? 1:0))
-#define BRASERO_DURATION_TO_SECTORS(duration) \
- ((gint64) (duration) * 75 / 1000000000 + \
- (((gint64) ((duration) * 75) % 1000000000) ? 1:0))
-#define BRASERO_SIZE_TO_SECTORS(size, secsize) \
- (((size) / (secsize)) + (((size) % (secsize)) ? 1:0))
-#define BRASERO_BYTES_TO_DURATION(bytes) \
- (guint64) ((guint64) ((guint64) (bytes) * 1000000000) / (guint64) (2352 * 75) + \
- (guint64) (((guint64) ((guint64) (bytes) * 1000000000) % (guint64) (2352 * 75)) ? 1:0))
-
BraseroBurnResult
brasero_burn_library_init (void);
Modified: trunk/src/burn-caps.c
==============================================================================
--- trunk/src/burn-caps.c (original)
+++ trunk/src/burn-caps.c Wed Jan 7 14:28:22 2009
@@ -85,6 +85,19 @@
static GObjectClass *parent_class = NULL;
static BraseroBurnCaps *default_caps = NULL;
+/**
+ * These two functions are not public API and defined in burn-medium.c
+ */
+
+gboolean
+brasero_medium_support_flags (BraseroMedium *medium,
+ BraseroBurnFlag flags);
+
+BraseroBurnFlag
+brasero_medium_supported_flags (BraseroMedium *self,
+ BraseroBurnFlag flags);
+
+
#define BRASERO_BURN_CAPS_NOT_SUPPORTED_LOG(session) \
{ \
brasero_burn_session_log (session, "Unsupported type of task operation"); \
Modified: trunk/src/burn-debug.c
==============================================================================
--- trunk/src/burn-debug.c (original)
+++ trunk/src/burn-debug.c Wed Jan 7 14:28:22 2009
@@ -33,6 +33,7 @@
#include "burn-debug.h"
#include "burn-track.h"
+#include "burn-media.h"
static gboolean debug = FALSE;
@@ -163,84 +164,6 @@
}
static void
-brasero_debug_medium_info_to_string (gchar *buffer,
- BraseroMedia media)
-{
- if (media & BRASERO_MEDIUM_FILE)
- strcat (buffer, "file ");
-
- if (media & BRASERO_MEDIUM_CD)
- strcat (buffer, "CD ");
-
- if (media & BRASERO_MEDIUM_DVD)
- strcat (buffer, "DVD ");
-
- if (media & BRASERO_MEDIUM_RAM)
- strcat (buffer, "RAM ");
-
- if (media & BRASERO_MEDIUM_BD)
- strcat (buffer, "BD ");
-
- if (media & BRASERO_MEDIUM_DUAL_L)
- strcat (buffer, "DL ");
-
- /* DVD subtypes */
- if (media & BRASERO_MEDIUM_PLUS)
- strcat (buffer, "+ ");
-
- if (media & BRASERO_MEDIUM_SEQUENTIAL)
- strcat (buffer, "- (sequential) ");
-
- if (media & BRASERO_MEDIUM_RESTRICTED)
- strcat (buffer, "- (restricted) ");
-
- if (media & BRASERO_MEDIUM_JUMP)
- strcat (buffer, "- (jump) ");
-
- /* BD subtypes */
- if (media & BRASERO_MEDIUM_SRM)
- strcat (buffer, "SRM ");
-
- if (media & BRASERO_MEDIUM_POW)
- strcat (buffer, "POW ");
-
- if (media & BRASERO_MEDIUM_RANDOM)
- strcat (buffer, "RANDOM ");
-
- /* discs attributes */
- if (media & BRASERO_MEDIUM_REWRITABLE)
- strcat (buffer, "RW ");
-
- if (media & BRASERO_MEDIUM_WRITABLE)
- strcat (buffer, "W ");
-
- if (media & BRASERO_MEDIUM_ROM)
- strcat (buffer, "ROM ");
-
- /* status of the disc */
- if (media & BRASERO_MEDIUM_CLOSED)
- strcat (buffer, "closed ");
-
- if (media & BRASERO_MEDIUM_BLANK)
- strcat (buffer, "blank ");
-
- if (media & BRASERO_MEDIUM_APPENDABLE)
- strcat (buffer, "appendable ");
-
- if (media & BRASERO_MEDIUM_PROTECTED)
- strcat (buffer, "protected ");
-
- if (media & BRASERO_MEDIUM_HAS_DATA)
- strcat (buffer, "with data ");
-
- if (media & BRASERO_MEDIUM_HAS_AUDIO)
- strcat (buffer, "with audio ");
-
- if (media & BRASERO_MEDIUM_UNFORMATTED)
- strcat (buffer, "Unformatted ");
-}
-
-static void
brasero_debug_image_format_to_string (gchar *buffer,
BraseroImageFormat format)
{
@@ -332,7 +255,7 @@
break;
case BRASERO_TRACK_TYPE_DISC:
strcpy (buffer, "Disc ");
- brasero_debug_medium_info_to_string (buffer, subtype);
+ brasero_media_to_string (subtype, buffer);
break;
case BRASERO_TRACK_TYPE_AUDIO:
strcpy (buffer, "Audio ");
Modified: trunk/src/burn-drive.c
==============================================================================
--- trunk/src/burn-drive.c (original)
+++ trunk/src/burn-drive.c Wed Jan 7 14:28:22 2009
@@ -38,7 +38,6 @@
#include "burn-medium.h"
#include "burn-volume-obj.h"
#include "burn-drive.h"
-#include "burn-debug.h"
#include "burn-hal-watch.h"
#include "scsi-mmc1.h"
@@ -86,6 +85,7 @@
G_DEFINE_TYPE (BraseroDrive, brasero_drive, G_TYPE_OBJECT);
+
GDrive *
brasero_drive_get_gdrive (BraseroDrive *drive)
{
@@ -115,7 +115,7 @@
if (!device_path)
continue;
- BRASERO_BURN_LOG ("Found drive %s", device_path);
+ BRASERO_MEDIA_LOG ("Found drive %s", device_path);
if (!strcmp (device_path, volume_path)) {
gdrive = tmp;
g_free (device_path);
@@ -129,42 +129,27 @@
g_list_free (drives);
if (!drive)
- BRASERO_BURN_LOG ("No drive found for medium");
+ BRASERO_MEDIA_LOG ("No drive found for medium");
return gdrive;
}
-gboolean
-brasero_drive_get_bus_target_lun (BraseroDrive *self,
- guint *bus,
- guint *target,
- guint *lun)
-{
- BraseroDrivePrivate *priv;
-
- priv = BRASERO_DRIVE_PRIVATE (self);
-
- if (!priv->udi)
- return FALSE;
-
- if (!bus || !target || !lun)
- return FALSE;
-
- if (priv->bus < 0)
- return FALSE;
-
- *bus = priv->bus;
- *target = priv->target;
- *lun = priv->lun;
- return TRUE;
-}
+/**
+ * brasero_drive_get_bus_target_lun_string:
+ * @drive: a #BraseroDrive
+ *
+ * Returns the bus, target, lun ("{bus},{target},{lun}") as a string which is
+ * sometimes needed by some backends like cdrecord.
+ *
+ * Return value: a string or NULL.
+ **/
gchar *
-brasero_drive_get_bus_target_lun_string (BraseroDrive *self)
+brasero_drive_get_bus_target_lun_string (BraseroDrive *drive)
{
BraseroDrivePrivate *priv;
- priv = BRASERO_DRIVE_PRIVATE (self);
+ priv = BRASERO_DRIVE_PRIVATE (drive);
if (!priv->udi)
return NULL;
@@ -175,23 +160,40 @@
return g_strdup_printf ("%i,%i,%i", priv->bus, priv->target, priv->lun);
}
+/**
+ * brasero_drive_is_fake:
+ * @drive: a #BraseroDrive
+ *
+ * Returns whether or not the drive is a fake one. There is only one and
+ * corresponds to a file which is used when the user wants to burn to a file.
+ *
+ * Return value: %TRUE or %FALSE.
+ **/
gboolean
-brasero_drive_is_fake (BraseroDrive *self)
+brasero_drive_is_fake (BraseroDrive *drive)
{
BraseroDrivePrivate *priv;
- priv = BRASERO_DRIVE_PRIVATE (self);
+ priv = BRASERO_DRIVE_PRIVATE (drive);
return (priv->path == NULL);
}
+/**
+ * brasero_drive_is_door_open:
+ * @drive: a #BraseroDrive
+ *
+ * Returns whether or not the drive door is open.
+ *
+ * Return value: %TRUE or %FALSE.
+ **/
gboolean
-brasero_drive_is_door_open (BraseroDrive *self)
+brasero_drive_is_door_open (BraseroDrive *drive)
{
BraseroDrivePrivate *priv;
BraseroDeviceHandle *handle;
BraseroScsiMechStatusHdr hdr;
- priv = BRASERO_DRIVE_PRIVATE (self);
+ priv = BRASERO_DRIVE_PRIVATE (drive);
if (!priv->udi)
return FALSE;
@@ -209,16 +211,25 @@
return hdr.door_open;
}
+/**
+ * brasero_drive_can_use_exclusively:
+ * @drive: a #BraseroDrive
+ *
+ * Returns whether or not the drive can be used exclusively, that is whether or
+ * not it is currently used by another application.
+ *
+ * Return value: %TRUE or %FALSE.
+ **/
gboolean
-brasero_drive_can_use_exclusively (BraseroDrive *self)
+brasero_drive_can_use_exclusively (BraseroDrive *drive)
{
BraseroDeviceHandle *handle;
const gchar *device;
#if defined(HAVE_STRUCT_USCSI_CMD)
- device = brasero_drive_get_block_device (self);
+ device = brasero_drive_get_block_device (drive);
#else
- device = brasero_drive_get_device (self);
+ device = brasero_drive_get_device (drive);
#endif
handle = brasero_device_handle_open (device, TRUE, NULL);
@@ -229,8 +240,18 @@
return TRUE;
}
+/**
+ * brasero_drive_lock:
+ * @drive: a #BraseroDrive
+ * @reason: a string to indicate what the drive was locked for
+ * @reason_for_failure: a string to hold the reason why the locking failed
+ *
+ * Locks a #BraseroDrive. Ejection shouldn't be possible any more.
+ *
+ * Return value: %TRUE if the drive was successfully locked or %FALSE.
+ **/
gboolean
-brasero_drive_lock (BraseroDrive *self,
+brasero_drive_lock (BraseroDrive *drive,
const gchar *reason,
gchar **reason_for_failure)
{
@@ -241,7 +262,7 @@
gboolean result;
gchar *failure;
- priv = BRASERO_DRIVE_PRIVATE (self);
+ priv = BRASERO_DRIVE_PRIVATE (drive);
if (!priv->udi)
return FALSE;
@@ -266,17 +287,25 @@
dbus_free (failure);
if (result) {
- BRASERO_BURN_LOG ("Device locked");
+ BRASERO_MEDIA_LOG ("Device locked");
}
else {
- BRASERO_BURN_LOG ("Device failed to lock");
+ BRASERO_MEDIA_LOG ("Device failed to lock");
}
return result;
}
+/**
+ * brasero_drive_unlock:
+ * @drive: a #BraseroDrive
+ *
+ * Unlocks a #BraseroDrive.
+ *
+ * Return value: %TRUE if the drive was successfully unlocked or %FALSE.
+ **/
gboolean
-brasero_drive_unlock (BraseroDrive *self)
+brasero_drive_unlock (BraseroDrive *drive)
{
BraseroDrivePrivate *priv;
BraseroHALWatch *watch;
@@ -284,7 +313,7 @@
DBusError error;
gboolean result;
- priv = BRASERO_DRIVE_PRIVATE (self);
+ priv = BRASERO_DRIVE_PRIVATE (drive);
if (!priv->udi)
return FALSE;
@@ -299,18 +328,27 @@
if (dbus_error_is_set (&error))
dbus_error_free (&error);
- BRASERO_BURN_LOG ("Device unlocked");
+ BRASERO_MEDIA_LOG ("Device unlocked");
return result;
}
+/**
+ * brasero_drive_get_display_name:
+ * @drive: a #BraseroDrive
+ *
+ * Gets a string holding the name for the drive. That string can be then
+ * displayed in a user interface.
+ *
+ * Return value: a string holding the name
+ **/
gchar *
-brasero_drive_get_display_name (BraseroDrive *self)
+brasero_drive_get_display_name (BraseroDrive *drive)
{
BraseroDrivePrivate *priv;
BraseroHALWatch *watch;
LibHalContext *ctx;
- priv = BRASERO_DRIVE_PRIVATE (self);
+ priv = BRASERO_DRIVE_PRIVATE (drive);
if (!priv->udi) {
/* Translators: This is a fake drive, a file, and means that
@@ -327,45 +365,81 @@
NULL);
}
+/**
+ * brasero_drive_get_device:
+ * @drive: a #BraseroDrive
+ *
+ * Gets a string holding the device path for the drive.
+ *
+ * Return value: a string holding the device path
+ **/
const gchar *
-brasero_drive_get_device (BraseroDrive *self)
+brasero_drive_get_device (BraseroDrive *drive)
{
BraseroDrivePrivate *priv;
- priv = BRASERO_DRIVE_PRIVATE (self);
+ priv = BRASERO_DRIVE_PRIVATE (drive);
return priv->path;
}
+/**
+ * brasero_drive_get_block_device:
+ * @drive: a #BraseroDrive
+ *
+ * Gets a string holding the block device path for the drive. This can be used on
+ * some other OS, like Solaris, for burning operations instead of the device
+ * path.
+ *
+ * Return value: a string holding the block device path
+ **/
const gchar *
-brasero_drive_get_block_device (BraseroDrive *self)
+brasero_drive_get_block_device (BraseroDrive *drive)
{
BraseroDrivePrivate *priv;
- priv = BRASERO_DRIVE_PRIVATE (self);
+ priv = BRASERO_DRIVE_PRIVATE (drive);
return priv->block_path;
}
+/**
+ * brasero_drive_get_udi:
+ * @drive: a #BraseroDrive
+ *
+ * Gets a string holding the HAL udi corresponding to this device. It can be used
+ * to uniquely identify the drive.
+ *
+ * Return value: a string holding the HAL udi
+ **/
const gchar *
-brasero_drive_get_udi (BraseroDrive *self)
+brasero_drive_get_udi (BraseroDrive *drive)
{
BraseroDrivePrivate *priv;
- if (!self)
+ if (!drive)
return NULL;
- priv = BRASERO_DRIVE_PRIVATE (self);
+ priv = BRASERO_DRIVE_PRIVATE (drive);
return priv->udi;
}
+/**
+ * brasero_drive_get_medium:
+ * @drive: a #BraseroDrive
+ *
+ * Gets the medium currently inserted in the drive. If there is no medium or if
+ * the medium is not probed yet then it returns NULL.
+ *
+ * Return value: a #BraseroMedium object or NULL
+ **/
BraseroMedium *
-brasero_drive_get_medium (BraseroDrive *self)
+brasero_drive_get_medium (BraseroDrive *drive)
{
BraseroDrivePrivate *priv;
- if (!self)
+ if (!drive)
return NULL;
- priv = BRASERO_DRIVE_PRIVATE (self);
+ priv = BRASERO_DRIVE_PRIVATE (drive);
if (!priv->probed && priv->udi)
return NULL;
@@ -462,6 +536,9 @@
priv->medium);
}
+/**
+ * This is not public API. Defined in burn-monitor.h.
+ */
gboolean
brasero_drive_probing (BraseroDrive *self)
{
@@ -471,24 +548,35 @@
return priv->probed != TRUE;
}
+/**
+ * brasero_drive_reprobe:
+ * @monitor: a #BraseroDrive
+ *
+ * Reprobes the drive contents. Useful when an operation has just been performed
+ * (blanking, burning, ...) and medium status should be updated.
+ *
+ * NOTE: This operation does not block.
+ *
+ **/
+
void
-brasero_drive_reprobe (BraseroDrive *self)
+brasero_drive_reprobe (BraseroDrive *drive)
{
BraseroDrivePrivate *priv;
BraseroMedium *medium;
- priv = BRASERO_DRIVE_PRIVATE (self);
+ priv = BRASERO_DRIVE_PRIVATE (drive);
if (!priv->medium)
return;
- BRASERO_BURN_LOG ("Reprobing inserted medium");
+ BRASERO_MEDIA_LOG ("Reprobing inserted medium");
/* remove current medium */
medium = priv->medium;
priv->medium = NULL;
- g_signal_emit (self,
+ g_signal_emit (drive,
drive_signals [MEDIUM_REMOVED],
0,
medium);
@@ -497,12 +585,12 @@
/* try to get a new one */
priv->medium = g_object_new (BRASERO_TYPE_VOLUME,
- "drive", self,
+ "drive", drive,
NULL);
g_signal_connect (priv->medium,
"probed",
G_CALLBACK (brasero_drive_medium_probed),
- self);
+ drive);
}
#if 0
@@ -522,7 +610,7 @@
dbus_error_init (&error);
if (!libhal_device_reprobe (ctx, priv->udi, &error)) {
- BRASERO_BURN_LOG ("libhal_device_reprobe () failed %s",
+ BRASERO_MEDIA_LOG ("libhal_device_reprobe () failed %s",
error.message);
dbus_error_free (&error);
}
@@ -544,7 +632,7 @@
watch = brasero_hal_watch_get_default ();
ctx = brasero_hal_watch_get_ctx (watch);
- BRASERO_BURN_LOG ("Contents changed");
+ BRASERO_MEDIA_LOG ("Contents changed");
dbus_error_init (&error);
has_medium = libhal_device_get_property_bool (ctx,
@@ -559,7 +647,7 @@
}
if (has_medium) {
- BRASERO_BURN_LOG ("Medium inserted");
+ BRASERO_MEDIA_LOG ("Medium inserted");
priv->probed = FALSE;
priv->medium = g_object_new (BRASERO_TYPE_VOLUME,
@@ -574,7 +662,7 @@
else if (priv->medium) {
BraseroMedium *medium;
- BRASERO_BURN_LOG ("Medium removed");
+ BRASERO_MEDIA_LOG ("Medium removed");
medium = priv->medium;
priv->medium = NULL;
@@ -677,7 +765,7 @@
priv->target = libhal_device_get_property_int (ctx, parent, "scsi.target", NULL);
}
- BRASERO_BURN_LOG ("Drive %s has bus,target,lun = %i %i %i",
+ BRASERO_MEDIA_LOG ("Drive %s has bus,target,lun = %i %i %i",
priv->path,
priv->bus,
priv->target,
@@ -767,21 +855,37 @@
object_class->set_property = brasero_drive_set_property;
object_class->get_property = brasero_drive_get_property;
+ /**
+ * BraseroVolumeMonitor::medium-added:
+ * @drive: the object which received the signal
+ * @medium: the new medium which was added
+ *
+ * This signal gets emitted when a new medium was detected
+ *
+ */
drive_signals[MEDIUM_INSERTED] =
g_signal_new ("medium_added",
G_OBJECT_CLASS_TYPE (klass),
- G_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE | G_SIGNAL_ACTION,
- 0,
+ G_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE,
+ G_STRUCT_OFFSET (BraseroDriveClass, medium_added),
NULL, NULL,
g_cclosure_marshal_VOID__OBJECT,
G_TYPE_NONE, 1,
BRASERO_TYPE_MEDIUM);
+ /**
+ * BraseroVolumeMonitor::medium-removed:
+ * @drive: the object which received the signal
+ * @medium: the medium which was removed
+ *
+ * This signal gets emitted when a medium is not longer available
+ *
+ */
drive_signals[MEDIUM_REMOVED] =
g_signal_new ("medium_removed",
G_OBJECT_CLASS_TYPE (klass),
G_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE,
- 0,
+ G_STRUCT_OFFSET (BraseroDriveClass, medium_removed),
NULL, NULL,
g_cclosure_marshal_VOID__OBJECT,
G_TYPE_NONE, 1,
@@ -790,12 +894,16 @@
g_object_class_install_property (object_class,
PROP_UDI,
g_param_spec_string("udi",
- "udi",
"HAL udi",
+ "HAL udi as a string",
NULL,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
}
+/**
+ * This is not public API. Declared in burn-monitor.h.
+ */
+
BraseroDrive *
brasero_drive_new (const gchar *udi)
{
Modified: trunk/src/burn-drive.h
==============================================================================
--- trunk/src/burn-drive.h (original)
+++ trunk/src/burn-drive.h Wed Jan 7 14:28:22 2009
@@ -57,6 +57,14 @@
struct _BraseroDriveClass
{
GObjectClass parent_class;
+
+ /* Signals */
+
+ void (*medium_added) (BraseroDrive *drive,
+ BraseroMedium *medium);
+
+ void (*medium_removed) (BraseroDrive *drive,
+ BraseroMedium *medium);
};
struct _BraseroDrive
@@ -66,15 +74,9 @@
GType brasero_drive_get_type (void) G_GNUC_CONST;
-BraseroDrive *
-brasero_drive_new (const gchar *udi);
-
void
brasero_drive_reprobe (BraseroDrive *drive);
-gboolean
-brasero_drive_probing (BraseroDrive *drive);
-
BraseroMedium *
brasero_drive_get_medium (BraseroDrive *drive);
@@ -96,11 +98,6 @@
const gchar *
brasero_drive_get_block_device (BraseroDrive *drive);
-gboolean
-brasero_drive_get_bus_target_lun (BraseroDrive *drive,
- guint *bus,
- guint *target,
- guint *lun);
gchar *
brasero_drive_get_bus_target_lun_string (BraseroDrive *drive);
@@ -114,7 +111,7 @@
brasero_drive_is_door_open (BraseroDrive *drive);
gboolean
-brasero_drive_can_use_exclusively (BraseroDrive *drive);;
+brasero_drive_can_use_exclusively (BraseroDrive *drive);
gboolean
brasero_drive_lock (BraseroDrive *drive,
Modified: trunk/src/burn-hal-watch.c
==============================================================================
--- trunk/src/burn-hal-watch.c (original)
+++ trunk/src/burn-hal-watch.c Wed Jan 7 14:28:22 2009
@@ -30,9 +30,10 @@
#include <libhal.h>
-#include "burn-debug.h"
+#include "burn-media.h"
+
#include "burn-hal-watch.h"
-#include "brasero-marshal.h"
+#include "libbrasero-marshal.h"
typedef struct _BraseroHALWatchPrivate BraseroHALWatchPrivate;
struct _BraseroHALWatchPrivate
@@ -62,7 +63,7 @@
priv = BRASERO_HAL_WATCH_PRIVATE (self);
if (!priv->ctx)
- BRASERO_BURN_LOG ("HAL context is NULL");
+ BRASERO_MEDIA_LOG ("HAL context is NULL");
return priv->ctx;
}
@@ -241,4 +242,3 @@
singleton = NULL;
}
}
-
Modified: trunk/src/burn-iso9660.c
==============================================================================
--- trunk/src/burn-iso9660.c (original)
+++ trunk/src/burn-iso9660.c Wed Jan 7 14:28:22 2009
@@ -35,12 +35,13 @@
#include <glib.h>
#include <glib/gi18n-lib.h>
+#include "burn-units.h"
+#include "burn-media.h"
#include "burn-iso9660.h"
#include "burn-iso-field.h"
#include "burn-susp.h"
+#include "burn-media.h"
#include "burn-volume.h"
-#include "burn-basics.h"
-#include "burn-debug.h"
struct _BraseroIsoCtx {
gint num_blocks;
@@ -147,8 +148,8 @@
vol = (BraseroVolDesc *) buffer;
if (memcmp (vol->id, "CD001", 5)) {
g_set_error (error,
- BRASERO_BURN_ERROR,
- BRASERO_BURN_ERROR_IMAGE_INVALID,
+ BRASERO_MEDIA_ERROR,
+ BRASERO_MEDIA_ERROR_IMAGE_INVALID,
_("It does not appear to be a valid ISO image"));
return FALSE;
}
@@ -156,8 +157,8 @@
/* must be "1" for primary volume */
if (vol->type != 1) {
g_set_error (error,
- BRASERO_BURN_ERROR,
- BRASERO_BURN_ERROR_IMAGE_INVALID,
+ BRASERO_MEDIA_ERROR,
+ BRASERO_MEDIA_ERROR_IMAGE_INVALID,
_("It does not appear to be a valid ISO image"));
return FALSE;
}
@@ -235,7 +236,7 @@
memset (susp_ctx, 0, sizeof (BraseroSuspCtx));
if (!brasero_susp_read (susp_ctx, susp, susp_len)) {
- BRASERO_BURN_LOG ("Could not read susp area");
+ BRASERO_MEDIA_LOG ("Could not read susp area");
return FALSE;
}
@@ -245,12 +246,12 @@
guint32 offset;
guint32 len;
- BRASERO_BURN_LOG ("Continuation Area");
+ BRASERO_MEDIA_LOG ("Continuation Area");
/* we need to move to another block */
seek_res = BRASERO_VOL_SRC_SEEK (ctx->vol, susp_ctx->CE_address, SEEK_SET, NULL);
if (seek_res == -1) {
- BRASERO_BURN_LOG ("Could not seek to continuation area");
+ BRASERO_MEDIA_LOG ("Could not seek to continuation area");
result = FALSE;
break;
}
@@ -259,7 +260,7 @@
current_position = seek_res;
if (!BRASERO_VOL_SRC_READ (ctx->vol, CE_block, 1, NULL)) {
- BRASERO_BURN_LOG ("Could not get continuation area");
+ BRASERO_MEDIA_LOG ("Could not get continuation area");
result = FALSE;
break;
}
@@ -274,7 +275,7 @@
/* read all information contained in the CE area */
if (!brasero_susp_read (susp_ctx, CE_block + offset, len)) {
- BRASERO_BURN_LOG ("Could not read continuation area");
+ BRASERO_MEDIA_LOG ("Could not read continuation area");
result = FALSE;
break;
}
@@ -283,7 +284,7 @@
/* reset the reading address properly */
if (current_position != -1
&& BRASERO_VOL_SRC_SEEK (ctx->vol, current_position, SEEK_SET, NULL) == -1) {
- BRASERO_BURN_LOG ("Could not rewind to previous position");
+ BRASERO_MEDIA_LOG ("Could not rewind to previous position");
result = FALSE;
}
@@ -321,7 +322,7 @@
susp_block = ((gchar *) record) + start;
- BRASERO_BURN_LOG ("Got susp block");
+ BRASERO_MEDIA_LOG ("Got susp block");
return susp_block;
}
@@ -331,19 +332,19 @@
BraseroIsoDirRec *record;
if (ctx->offset > sizeof (ctx->buffer)) {
- BRASERO_BURN_LOG ("Invalid record size");
+ BRASERO_MEDIA_LOG ("Invalid record size");
goto error;
}
if (ctx->offset == sizeof (ctx->buffer)) {
- BRASERO_BURN_LOG ("No next record");
+ BRASERO_MEDIA_LOG ("No next record");
return BRASERO_ISO_END;
}
/* record_size already checked last time function was called */
record = (BraseroIsoDirRec *) (ctx->buffer + ctx->offset);
if (!record->record_size) {
- BRASERO_BURN_LOG ("Last record");
+ BRASERO_MEDIA_LOG ("Last record");
return BRASERO_ISO_END;
}
@@ -351,13 +352,13 @@
gint part_one, part_two;
/* This is for cross sector boundary records */
- BRASERO_BURN_LOG ("Cross sector boundary record");
+ BRASERO_MEDIA_LOG ("Cross sector boundary record");
/* some implementations write across block boundary which is
* "forbidden" by ECMA-119. But linux kernel accepts it, so ...
*/
-/* ctx->error = g_error_new (BRASERO_BURN_ERROR,
- BRASERO_BURN_ERROR_IMAGE_INVALID,
+/* ctx->error = g_error_new (BRASERO_MEDIA_ERROR,
+ BRASERO_MEDIA_ERROR_IMAGE_INVALID,
_("It does not appear to be a valid ISO image"));
goto error;
*/
@@ -391,8 +392,8 @@
error:
if (!ctx->error)
- ctx->error = g_error_new (BRASERO_BURN_ERROR,
- BRASERO_BURN_ERROR_IMAGE_INVALID,
+ ctx->error = g_error_new (BRASERO_MEDIA_ERROR,
+ BRASERO_MEDIA_ERROR_IMAGE_INVALID,
_("It does not appear to be a valid ISO image"));
return BRASERO_ISO_ERROR;
}
@@ -404,7 +405,7 @@
{
BraseroIsoResult result;
- BRASERO_BURN_LOG ("Reading directory record");
+ BRASERO_MEDIA_LOG ("Reading directory record");
result = brasero_iso9660_seek (ctx, address);
if (result != BRASERO_ISO_OK)
@@ -427,9 +428,9 @@
BraseroVolFileExtent *extent;
if (record->id_size > record->record_size - sizeof (BraseroIsoDirRec)) {
- BRASERO_BURN_LOG ("Filename is too long");
- ctx->error = g_error_new (BRASERO_BURN_ERROR,
- BRASERO_BURN_ERROR_IMAGE_INVALID,
+ BRASERO_MEDIA_LOG ("Filename is too long");
+ ctx->error = g_error_new (BRASERO_MEDIA_ERROR,
+ BRASERO_MEDIA_ERROR_IMAGE_INVALID,
_("It does not appear to be a valid ISO image"));
return NULL;
}
@@ -449,14 +450,14 @@
/* see if we've got a susp area */
if (!susp_ctx) {
- BRASERO_BURN_LOG ("New file %s", file->name);
+ BRASERO_MEDIA_LOG ("New file %s", file->name);
return file;
}
- BRASERO_BURN_LOG ("New file %s with a suspend area", file->name);
+ BRASERO_MEDIA_LOG ("New file %s with a suspend area", file->name);
if (susp_ctx->rr_name) {
- BRASERO_BURN_LOG ("Got a susp (RR) %s", susp_ctx->rr_name);
+ BRASERO_MEDIA_LOG ("Got a susp (RR) %s", susp_ctx->rr_name);
file->rr_name = susp_ctx->rr_name;
susp_ctx->rr_name = NULL;
}
@@ -476,9 +477,9 @@
BraseroVolFile *directory;
if (record->id_size > record->record_size - sizeof (BraseroIsoDirRec)) {
- BRASERO_BURN_LOG ("Filename is too long");
- ctx->error = g_error_new (BRASERO_BURN_ERROR,
- BRASERO_BURN_ERROR_IMAGE_INVALID,
+ BRASERO_MEDIA_LOG ("Filename is too long");
+ ctx->error = g_error_new (BRASERO_MEDIA_ERROR,
+ BRASERO_MEDIA_ERROR_IMAGE_INVALID,
_("It does not appear to be a valid ISO image"));
return NULL;
}
@@ -496,31 +497,31 @@
*/
susp = brasero_iso9660_get_susp (ctx, record, &susp_len);
if (!brasero_iso9660_read_susp (ctx, &susp_ctx, susp, susp_len)) {
- BRASERO_BURN_LOG ("Could not read susp area");
+ BRASERO_MEDIA_LOG ("Could not read susp area");
brasero_volume_file_free (directory);
return NULL;
}
/* look for a "CL" SUSP entry in case the directory was relocated */
if (susp_ctx.CL_address) {
- BRASERO_BURN_LOG ("Entry has a CL entry");
+ BRASERO_MEDIA_LOG ("Entry has a CL entry");
address = susp_ctx.CL_address;
}
else
address = brasero_iso9660_get_733_val (record->address);
- BRASERO_BURN_LOG ("New directory %s with susp area", directory->name);
+ BRASERO_MEDIA_LOG ("New directory %s with susp area", directory->name);
/* if this directory has a "RE" susp entry then drop it; it's
* not at the right place in the Rock Ridge file hierarchy. It
* will probably be skipped */
if (susp_ctx.has_RE) {
- BRASERO_BURN_LOG ("Rock Ridge relocated directory. Skipping entry.");
+ BRASERO_MEDIA_LOG ("Rock Ridge relocated directory. Skipping entry.");
directory->relocated = TRUE;
}
if (susp_ctx.rr_name) {
- BRASERO_BURN_LOG ("Got a susp (RR) %s", susp_ctx.rr_name);
+ BRASERO_MEDIA_LOG ("Got a susp (RR) %s", susp_ctx.rr_name);
directory->rr_name = susp_ctx.rr_name;
susp_ctx.rr_name = NULL;
}
@@ -555,7 +556,7 @@
else /* store the address of contents for later use */
directory->specific.dir.address = address;
- BRASERO_BURN_LOG ("New directory %s", directory->name);
+ BRASERO_MEDIA_LOG ("New directory %s", directory->name);
return directory;
}
@@ -575,14 +576,14 @@
max_record_size = brasero_iso9660_get_733_val (record->file_size);
max_block = ISO9660_BYTES_TO_BLOCKS (max_record_size);
- BRASERO_BURN_LOG ("Maximum directory record length %i block (= %i bytes)", max_block, max_record_size);
+ BRASERO_MEDIA_LOG ("Maximum directory record length %i block (= %i bytes)", max_block, max_record_size);
/* skip ".." */
result = brasero_iso9660_next_record (ctx, &record);
if (result != BRASERO_ISO_OK)
return NULL;
- BRASERO_BURN_LOG ("Skipped '.' and '..'");
+ BRASERO_MEDIA_LOG ("Skipped '.' and '..'");
while (1) {
BraseroIsoResult result;
@@ -626,7 +627,7 @@
* get deep directories that are flagged as files. */
susp = brasero_iso9660_get_susp (ctx, record, &susp_len);
if (!brasero_iso9660_read_susp (ctx, &susp_ctx, susp, susp_len)) {
- BRASERO_BURN_LOG ("Could not read susp area");
+ BRASERO_MEDIA_LOG ("Could not read susp area");
goto error;
}
@@ -636,7 +637,7 @@
if (susp_ctx.CL_address) {
gpointer copy;
- BRASERO_BURN_LOG ("Entry has a CL entry, keeping for later");
+ BRASERO_MEDIA_LOG ("Entry has a CL entry, keeping for later");
copy = g_new0 (gchar, record->record_size);
memcpy (copy, record, record->record_size);
directories = g_slist_prepend (directories, copy);
@@ -668,7 +669,7 @@
/* add size and addresses */
ctx->data_blocks += ISO9660_BYTES_TO_BLOCKS (entry->specific.file.size_bytes);
last = brasero_volume_file_merge (last, entry);
- BRASERO_BURN_LOG ("Multi extent file");
+ BRASERO_MEDIA_LOG ("Multi extent file");
continue;
}
}
@@ -727,10 +728,10 @@
ctx->is_root = FALSE;
if (ctx->has_susp)
- BRASERO_BURN_LOG ("File system supports system use sharing protocol");
+ BRASERO_MEDIA_LOG ("File system supports system use sharing protocol");
if (ctx->has_RR)
- BRASERO_BURN_LOG ("File system has Rock Ridge extension");
+ BRASERO_MEDIA_LOG ("File system has Rock Ridge extension");
brasero_susp_ctx_clean (&susp_ctx);
return TRUE;
@@ -815,7 +816,7 @@
* has a CL entry and rr_name. */
susp = brasero_iso9660_get_susp (ctx, record, &susp_len);
if (!brasero_iso9660_read_susp (ctx, &susp_ctx, susp, susp_len)) {
- BRASERO_BURN_LOG ("Could not read susp area");
+ BRASERO_MEDIA_LOG ("Could not read susp area");
return NULL;
}
@@ -906,7 +907,7 @@
BraseroIsoDirRec *record;
BraseroVolFile *file = NULL;
- BRASERO_BURN_LOG ("Reading directory record");
+ BRASERO_MEDIA_LOG ("Reading directory record");
result = brasero_iso9660_seek (ctx, address);
if (result != BRASERO_ISO_OK)
@@ -935,22 +936,22 @@
brasero_susp_ctx_clean (&susp_ctx);
if (ctx->has_susp)
- BRASERO_BURN_LOG ("File system supports system use sharing protocol");
+ BRASERO_MEDIA_LOG ("File system supports system use sharing protocol");
if (ctx->has_RR)
- BRASERO_BURN_LOG ("File system has Rock Ridge extension");
+ BRASERO_MEDIA_LOG ("File system has Rock Ridge extension");
}
max_record_size = brasero_iso9660_get_733_val (record->file_size);
max_block = ISO9660_BYTES_TO_BLOCKS (max_record_size);
- BRASERO_BURN_LOG ("Maximum directory record length %i block (= %i bytes)", max_block, max_record_size);
+ BRASERO_MEDIA_LOG ("Maximum directory record length %i block (= %i bytes)", max_block, max_record_size);
/* skip ".." */
result = brasero_iso9660_next_record (ctx, &record);
if (result != BRASERO_ISO_OK)
return NULL;
- BRASERO_BURN_LOG ("Skipped '.' and '..'");
+ BRASERO_MEDIA_LOG ("Skipped '.' and '..'");
end = strchr (path, '/');
if (!end)
@@ -966,25 +967,25 @@
result = brasero_iso9660_next_record (ctx, &record);
if (result == BRASERO_ISO_END) {
if (ctx->num_blocks >= max_block) {
- BRASERO_BURN_LOG ("Reached the end of directory record");
+ BRASERO_MEDIA_LOG ("Reached the end of directory record");
break;
}
result = brasero_iso9660_next_block (ctx);
if (result != BRASERO_ISO_OK) {
- BRASERO_BURN_LOG ("Failed to load next block");
+ BRASERO_MEDIA_LOG ("Failed to load next block");
return NULL;
}
continue;
}
else if (result == BRASERO_ISO_ERROR) {
- BRASERO_BURN_LOG ("Error retrieving next record");
+ BRASERO_MEDIA_LOG ("Error retrieving next record");
return NULL;
}
if (!record) {
- BRASERO_BURN_LOG ("No record !!!");
+ BRASERO_MEDIA_LOG ("No record !!!");
break;
}
@@ -1005,7 +1006,7 @@
if (file) {
/* add size and addresses */
file = brasero_volume_file_merge (file, entry);
- BRASERO_BURN_LOG ("Multi extent file");
+ BRASERO_MEDIA_LOG ("Multi extent file");
}
else
file = entry;
Modified: trunk/src/burn-media.c
==============================================================================
--- trunk/src/burn-media.c (original)
+++ trunk/src/burn-media.c Wed Jan 7 14:28:22 2009
@@ -28,16 +28,27 @@
# include <config.h>
#endif
+#include <string.h>
+
#include <glib.h>
+#include <glib/gi18n-lib.h>
#include "burn-media.h"
+static gboolean debug = 0;
+
#define BRASERO_MEDIUM_TRUE_RANDOM_WRITABLE(media) \
(BRASERO_MEDIUM_IS (media, BRASERO_MEDIUM_DVDRW_RESTRICTED) || \
BRASERO_MEDIUM_IS (media, BRASERO_MEDIUM_DVDRW_PLUS) || \
BRASERO_MEDIUM_IS (media, BRASERO_MEDIUM_DVD_RAM) || \
BRASERO_MEDIUM_IS (media, BRASERO_MEDIUM_BDRE))
+static const GOptionEntry options [] = {
+ { "brasero-media-debug", 0, 0, G_OPTION_ARG_NONE, &debug,
+ N_("Display debug statements on stdout for Brasero media library"),
+ NULL }
+};
+
static GSList *
brasero_media_add_to_list (GSList *retval,
BraseroMedia media)
@@ -342,3 +353,133 @@
return retval;
}
+
+GQuark
+brasero_media_quark (void)
+{
+ static GQuark quark = 0;
+
+ if (!quark)
+ quark = g_quark_from_static_string ("BraseroBurnError");
+
+ return quark;
+}
+
+void
+brasero_media_to_string (BraseroMedia media,
+ gchar *buffer)
+{
+ if (media & BRASERO_MEDIUM_FILE)
+ strcat (buffer, "file ");
+
+ if (media & BRASERO_MEDIUM_CD)
+ strcat (buffer, "CD ");
+
+ if (media & BRASERO_MEDIUM_DVD)
+ strcat (buffer, "DVD ");
+
+ if (media & BRASERO_MEDIUM_RAM)
+ strcat (buffer, "RAM ");
+
+ if (media & BRASERO_MEDIUM_BD)
+ strcat (buffer, "BD ");
+
+ if (media & BRASERO_MEDIUM_DUAL_L)
+ strcat (buffer, "DL ");
+
+ /* DVD subtypes */
+ if (media & BRASERO_MEDIUM_PLUS)
+ strcat (buffer, "+ ");
+
+ if (media & BRASERO_MEDIUM_SEQUENTIAL)
+ strcat (buffer, "- (sequential) ");
+
+ if (media & BRASERO_MEDIUM_RESTRICTED)
+ strcat (buffer, "- (restricted) ");
+
+ if (media & BRASERO_MEDIUM_JUMP)
+ strcat (buffer, "- (jump) ");
+
+ /* BD subtypes */
+ if (media & BRASERO_MEDIUM_SRM)
+ strcat (buffer, "SRM ");
+
+ if (media & BRASERO_MEDIUM_POW)
+ strcat (buffer, "POW ");
+
+ if (media & BRASERO_MEDIUM_RANDOM)
+ strcat (buffer, "RANDOM ");
+
+ /* discs attributes */
+ if (media & BRASERO_MEDIUM_REWRITABLE)
+ strcat (buffer, "RW ");
+
+ if (media & BRASERO_MEDIUM_WRITABLE)
+ strcat (buffer, "W ");
+
+ if (media & BRASERO_MEDIUM_ROM)
+ strcat (buffer, "ROM ");
+
+ /* status of the disc */
+ if (media & BRASERO_MEDIUM_CLOSED)
+ strcat (buffer, "closed ");
+
+ if (media & BRASERO_MEDIUM_BLANK)
+ strcat (buffer, "blank ");
+
+ if (media & BRASERO_MEDIUM_APPENDABLE)
+ strcat (buffer, "appendable ");
+
+ if (media & BRASERO_MEDIUM_PROTECTED)
+ strcat (buffer, "protected ");
+
+ if (media & BRASERO_MEDIUM_HAS_DATA)
+ strcat (buffer, "with data ");
+
+ if (media & BRASERO_MEDIUM_HAS_AUDIO)
+ strcat (buffer, "with audio ");
+
+ if (media & BRASERO_MEDIUM_UNFORMATTED)
+ strcat (buffer, "Unformatted ");
+}
+
+#define BRASERO_MEDIA_LOG_DOMAIN "BraseroMedia"
+
+const GOptionGroup *
+brasero_media_get_option_group (void)
+{
+ GOptionGroup *group;
+
+ group = g_option_group_new ("brasero-media",
+ N_("Brasero optical media library"),
+ N_("Display options for Brasero-media library"),
+ NULL,
+ NULL);
+ g_option_group_add_entries (group, options);
+ return group;
+}
+
+void
+brasero_media_message (const gchar *location,
+ const gchar *format,
+ ...)
+{
+ va_list arg_list;
+ gchar *format_real;
+
+ if (!debug)
+ return;
+
+ format_real = g_strdup_printf ("At %s: %s",
+ location,
+ format);
+
+ va_start (arg_list, format);
+ g_logv (BRASERO_MEDIA_LOG_DOMAIN,
+ G_LOG_LEVEL_DEBUG,
+ format_real,
+ arg_list);
+ va_end (arg_list);
+
+ g_free (format_real);
+}
Modified: trunk/src/burn-media.h
==============================================================================
--- trunk/src/burn-media.h (original)
+++ trunk/src/burn-media.h Wed Jan 7 14:28:22 2009
@@ -29,6 +29,46 @@
G_BEGIN_DECLS
+GQuark brasero_media_quark (void);
+#define BRASERO_MEDIA_ERROR brasero_media_quark()
+
+typedef enum {
+ BRASERO_MEDIA_ERROR_NONE,
+ BRASERO_MEDIA_ERROR_GENERAL, /******/
+
+ BRASERO_MEDIA_ERROR_PLUGIN_MISBEHAVIOR,
+
+ BRASERO_MEDIA_ERROR_SLOW_DMA,
+ BRASERO_MEDIA_ERROR_PERMISSION,
+ BRASERO_MEDIA_ERROR_DRIVE_BUSY,
+ BRASERO_MEDIA_ERROR_DISK_SPACE,
+
+ BRASERO_MEDIA_ERROR_INPUT_INVALID,
+
+ BRASERO_MEDIA_ERROR_OUTPUT_NONE,
+
+ BRASERO_MEDIA_ERROR_FILE_INVALID,
+ BRASERO_MEDIA_ERROR_FILE_NOT_FOUND,
+ BRASERO_MEDIA_ERROR_FILE_NOT_LOCAL,
+
+ BRASERO_MEDIA_ERROR_WRITE_MEDIUM,
+ BRASERO_MEDIA_ERROR_WRITE_IMAGE,
+
+ BRASERO_MEDIA_ERROR_IMAGE_INVALID, /**/
+ BRASERO_MEDIA_ERROR_IMAGE_JOLIET,
+ BRASERO_MEDIA_ERROR_IMAGE_LAST_SESSION,
+
+ BRASERO_MEDIA_ERROR_MEDIUM_NONE,
+ BRASERO_MEDIA_ERROR_MEDIUM_INVALID,
+ BRASERO_MEDIA_ERROR_MEDIUM_SPACE,
+ BRASERO_MEDIA_ERROR_MEDIUM_NO_DATA,
+ BRASERO_MEDIA_ERROR_MEDIUM_NOT_WRITABLE,
+ BRASERO_MEDIA_ERROR_MEDIUM_NOT_REWRITABLE,
+ BRASERO_MEDIA_ERROR_MEDIUM_NEED_RELOADING,
+
+ BRASERO_MEDIA_ERROR_BAD_CHECKSUM,
+} BraseroMediaError;
+
typedef enum {
BRASERO_MEDIUM_UNSUPPORTED = -2,
BRASERO_MEDIUM_BUSY = -1,
@@ -171,6 +211,27 @@
BraseroMedia
brasero_media_capabilities (BraseroMedia media);
+const GOptionGroup *
+brasero_media_get_option_group (void);
+
+/**
+ * For debugging purposes
+ */
+
+void
+brasero_media_to_string (BraseroMedia media,
+ gchar *string);
+
+#define BRASERO_MEDIA_LOG(format, ...) \
+ brasero_media_message (G_STRLOC, \
+ format, \
+ ##__VA_ARGS__);
+
+void
+brasero_media_message (const gchar *location,
+ const gchar *format,
+ ...);
+
G_END_DECLS
#endif /* _BURN_MEDIA_H */
Modified: trunk/src/burn-medium-monitor.c
==============================================================================
--- trunk/src/burn-medium-monitor.c (original)
+++ trunk/src/burn-medium-monitor.c Wed Jan 7 14:28:22 2009
@@ -37,7 +37,6 @@
#include <libhal.h>
-#include "burn-debug.h"
#include "burn-drive.h"
#include "burn-medium.h"
#include "burn-hal-watch.h"
@@ -73,14 +72,36 @@
G_DEFINE_TYPE (BraseroMediumMonitor, brasero_medium_monitor, G_TYPE_OBJECT);
+
+/**
+ * These definitions go here as they shouldn't be public and they're used only
+ * here.
+ */
+
+BraseroDrive *
+brasero_drive_new (const gchar *udi);
+
+gboolean
+brasero_drive_probing (BraseroDrive *drive);
+
+/**
+ * brasero_medium_monitor_get_drive:
+ * @monitor: a #BraseroMediumMonitor
+ * @device: the path of the device
+ *
+ * Returns the #BraseroDrive object whose path is @path.
+ *
+ * Return value: a #BraseroDrive or NULL
+ **/
+
BraseroDrive *
-brasero_medium_monitor_get_drive (BraseroMediumMonitor *self,
+brasero_medium_monitor_get_drive (BraseroMediumMonitor *monitor,
const gchar *device)
{
GSList *iter;
BraseroMediumMonitorPrivate *priv;
- priv = BRASERO_MEDIUM_MONITOR_PRIVATE (self);
+ priv = BRASERO_MEDIUM_MONITOR_PRIVATE (monitor);
for (iter = priv->drives; iter; iter = iter->next) {
BraseroDrive *drive;
const gchar *drive_device;
@@ -96,13 +117,22 @@
return NULL;
}
+/**
+ * brasero_medium_monitor_is_probing:
+ * @monitor: a #BraseroMediumMonitor
+ *
+ * Returns if the library is still probing some other media.
+ *
+ * Return value: %TRUE if it is still probing some media
+ **/
+
gboolean
-brasero_medium_monitor_is_probing (BraseroMediumMonitor *self)
+brasero_medium_monitor_is_probing (BraseroMediumMonitor *monitor)
{
GSList *iter;
BraseroMediumMonitorPrivate *priv;
- priv = BRASERO_MEDIUM_MONITOR_PRIVATE (self);
+ priv = BRASERO_MEDIUM_MONITOR_PRIVATE (monitor);
for (iter = priv->drives; iter; iter = iter->next) {
BraseroDrive *drive;
@@ -118,15 +148,25 @@
return FALSE;
}
+/**
+ * brasero_medium_monitor_get_media:
+ * @monitor: a #BraseroMediumMonitor
+ * @type: the type of #BraseroMedium that should be in the list
+ *
+ * Obtains the list of available media that are of the given type.
+ *
+ * Return value: a #GSList or NULL
+ **/
+
GSList *
-brasero_medium_monitor_get_media (BraseroMediumMonitor *self,
+brasero_medium_monitor_get_media (BraseroMediumMonitor *monitor,
BraseroMediaType type)
{
GSList *iter;
GSList *list = NULL;
BraseroMediumMonitorPrivate *priv;
- priv = BRASERO_MEDIUM_MONITOR_PRIVATE (self);
+ priv = BRASERO_MEDIUM_MONITOR_PRIVATE (monitor);
for (iter = priv->drives; iter; iter = iter->next) {
BraseroMedium *medium;
@@ -215,7 +255,7 @@
if (!libhal_device_query_capability (ctx, udi, "storage.cdrom", NULL))
return;
- BRASERO_BURN_LOG ("New drive inserted");
+ BRASERO_MEDIA_LOG ("New drive inserted");
priv = BRASERO_MEDIUM_MONITOR_PRIVATE (self);
@@ -253,7 +293,7 @@
ctx = brasero_hal_watch_get_ctx (watch);
priv = BRASERO_MEDIUM_MONITOR_PRIVATE (self);
- BRASERO_BURN_LOG ("Drive removed");
+ BRASERO_MEDIA_LOG ("Drive removed");
for (iter = priv->drives; iter; iter = next) {
const gchar *device_udi;
@@ -314,20 +354,20 @@
/* Now we get the list and cache it */
dbus_error_init (&error);
- BRASERO_BURN_LOG ("Polling for drives");
+ BRASERO_MEDIA_LOG ("Polling for drives");
devices = libhal_find_device_by_capability (ctx,
"storage.cdrom", &nb_devices,
&error);
if (dbus_error_is_set (&error)) {
- BRASERO_BURN_LOG ("Hal is not running : %s\n", error.message);
+ BRASERO_MEDIA_LOG ("Hal is not running : %s\n", error.message);
dbus_error_free (&error);
return;
}
- BRASERO_BURN_LOG ("Found %d drives", nb_devices);
+ BRASERO_MEDIA_LOG ("Found %d drives", nb_devices);
for (i = 0; i < nb_devices; i++) {
/* create the drive */
- BRASERO_BURN_LOG ("Probing %s", devices [i]);
+ BRASERO_MEDIA_LOG ("Probing %s", devices [i]);
drive = brasero_drive_new (devices [i]);
priv->drives = g_slist_prepend (priv->drives, drive);
@@ -379,21 +419,37 @@
object_class->finalize = brasero_medium_monitor_finalize;
+ /**
+ * BraseroVolumeMonitor::medium-added:
+ * @monitor: the object which received the signal
+ * @medium: the new medium which was added
+ *
+ * This signal gets emitted when a new medium was detected
+ *
+ */
medium_monitor_signals[MEDIUM_INSERTED] =
g_signal_new ("medium_added",
G_OBJECT_CLASS_TYPE (klass),
- G_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE | G_SIGNAL_ACTION,
- 0,
+ G_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE,
+ G_STRUCT_OFFSET (BraseroMediumMonitorClass, medium_added),
NULL, NULL,
g_cclosure_marshal_VOID__OBJECT,
G_TYPE_NONE, 1,
BRASERO_TYPE_MEDIUM);
+ /**
+ * BraseroVolumeMonitor::medium-removed:
+ * @monitor: the object which received the signal
+ * @medium: the medium which was removed
+ *
+ * This signal gets emitted when a medium is not longer available
+ *
+ */
medium_monitor_signals[MEDIUM_REMOVED] =
g_signal_new ("medium_removed",
G_OBJECT_CLASS_TYPE (klass),
- G_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE | G_SIGNAL_ACTION,
- 0,
+ G_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE,
+ G_STRUCT_OFFSET (BraseroMediumMonitorClass, medium_removed),
NULL, NULL,
g_cclosure_marshal_VOID__OBJECT,
G_TYPE_NONE, 1,
Modified: trunk/src/burn-medium-monitor.h
==============================================================================
--- trunk/src/burn-medium-monitor.h (original)
+++ trunk/src/burn-medium-monitor.h Wed Jan 7 14:28:22 2009
@@ -43,6 +43,14 @@
struct _BraseroMediumMonitorClass
{
GObjectClass parent_class;
+
+ /* Signals */
+
+ void (*medium_added) (BraseroMediumMonitor *monitor,
+ BraseroMedium *medium);
+
+ void (*medium_removed) (BraseroMediumMonitor *monitor,
+ BraseroMedium *medium);
};
struct _BraseroMediumMonitor
Modified: trunk/src/burn-medium.c
==============================================================================
--- trunk/src/burn-medium.c (original)
+++ trunk/src/burn-medium.c Wed Jan 7 14:28:22 2009
@@ -34,7 +34,6 @@
#include <glib/gi18n-lib.h>
#include "burn-basics.h"
-#include "burn-debug.h"
#include "burn-medium.h"
#include "burn-drive.h"
@@ -226,6 +225,10 @@
return priv->info;
}
+/**
+ * This one is not supposed to be public API. It's declared in burn-caps.c
+ */
+
BraseroBurnFlag
brasero_medium_supported_flags (BraseroMedium *self,
BraseroBurnFlag flags)
@@ -256,6 +259,10 @@
return flags;
}
+/**
+ * This one is not supposed to be public API. It's declared in burn-caps.c
+ */
+
gboolean
brasero_medium_support_flags (BraseroMedium *self,
BraseroBurnFlag flags)
@@ -704,20 +711,20 @@
priv = BRASERO_MEDIUM_PRIVATE (self);
/* Try TAO and then SAO if it isn't persistent */
- BRASERO_BURN_LOG ("Checking simulate (CD TAO)");
+ BRASERO_MEDIA_LOG ("Checking simulate (CD TAO)");
result = brasero_mmc2_get_configuration_feature (handle,
BRASERO_SCSI_FEAT_WRT_TAO,
&hdr,
&size,
code);
if (result != BRASERO_SCSI_OK) {
- BRASERO_BURN_LOG ("GET CONFIGURATION failed");
+ BRASERO_MEDIA_LOG ("GET CONFIGURATION failed");
return BRASERO_BURN_ERR;
}
desc = hdr->desc;
if (!desc->current)
- BRASERO_BURN_LOG ("Feature is not current");
+ BRASERO_MEDIA_LOG ("Feature is not current");
tao_desc = (BraseroScsiCDTAODesc *) desc->data;
priv->dummy_tao = tao_desc->dummy ? BRASERO_MEDIUM_CAP_TRUE:BRASERO_MEDIUM_CAP_FALSE;
@@ -740,20 +747,20 @@
priv = BRASERO_MEDIUM_PRIVATE (self);
- BRASERO_BURN_LOG ("Checking simulate (CD SAO)");
+ BRASERO_MEDIA_LOG ("Checking simulate (CD SAO)");
result = brasero_mmc2_get_configuration_feature (handle,
BRASERO_SCSI_FEAT_WRT_SAO_RAW,
&hdr,
&size,
code);
if (result != BRASERO_SCSI_OK) {
- BRASERO_BURN_LOG ("GET CONFIGURATION failed");
+ BRASERO_MEDIA_LOG ("GET CONFIGURATION failed");
return BRASERO_BURN_ERR;
}
desc = hdr->desc;
if (!desc->current)
- BRASERO_BURN_LOG ("Feature is not current");
+ BRASERO_MEDIA_LOG ("Feature is not current");
sao_desc = (BraseroScsiCDSAODesc *) desc->data;
priv->dummy_sao = sao_desc->dummy ? BRASERO_MEDIUM_CAP_TRUE:BRASERO_MEDIUM_CAP_FALSE;
@@ -777,20 +784,20 @@
priv = BRASERO_MEDIUM_PRIVATE (self);
/* Only DVD-R(W) support simulation */
- BRASERO_BURN_LOG ("Checking simulate (DVD-R/W)");
+ BRASERO_MEDIA_LOG ("Checking simulate (DVD-R/W)");
result = brasero_mmc2_get_configuration_feature (handle,
BRASERO_SCSI_FEAT_WRT_DVD_LESS,
&hdr,
&size,
code);
if (result != BRASERO_SCSI_OK) {
- BRASERO_BURN_LOG ("GET CONFIGURATION failed");
+ BRASERO_MEDIA_LOG ("GET CONFIGURATION failed");
return BRASERO_BURN_ERR;
}
desc = hdr->desc;
if (!desc->current)
- BRASERO_BURN_LOG ("Feature is not current");
+ BRASERO_MEDIA_LOG ("Feature is not current");
less_wrt_desc = (BraseroScsiDVDRWlessWrtDesc *) desc->data;
priv->dummy_sao = less_wrt_desc->dummy ? BRASERO_MEDIUM_CAP_TRUE:BRASERO_MEDIUM_CAP_FALSE;
@@ -823,7 +830,7 @@
&size,
code);
if (result != BRASERO_SCSI_OK) {
- BRASERO_BURN_LOG ("MODE SENSE failed");
+ BRASERO_MEDIA_LOG ("MODE SENSE failed");
return;
}
@@ -862,7 +869,7 @@
else
res = brasero_medium_test_simulate_DVDRW (self, handle, code);
- BRASERO_BURN_LOG ("Tested simulation %d %d, burnfree %d",
+ BRASERO_MEDIA_LOG ("Tested simulation %d %d, burnfree %d",
priv->dummy_tao,
priv->dummy_sao,
priv->burnfree);
@@ -871,10 +878,10 @@
return;
/* it didn't work out as expected use fallback */
- BRASERO_BURN_LOG ("Using fallback 2A page for testing simulation and burnfree");
+ BRASERO_MEDIA_LOG ("Using fallback 2A page for testing simulation and burnfree");
brasero_medium_test_simulate_2A (self, handle, code);
- BRASERO_BURN_LOG ("Re-tested simulation %d %d, burnfree %d",
+ BRASERO_MEDIA_LOG ("Re-tested simulation %d %d, burnfree %d",
priv->dummy_tao,
priv->dummy_sao,
priv->burnfree);
@@ -896,7 +903,7 @@
priv = BRASERO_MEDIUM_PRIVATE (self);
- BRASERO_BURN_LOG ("Retrieving capacity from atip");
+ BRASERO_MEDIA_LOG ("Retrieving capacity from atip");
result = brasero_mmc1_read_atip (handle,
&atip_data,
@@ -904,7 +911,7 @@
NULL);
if (result != BRASERO_SCSI_OK) {
- BRASERO_BURN_LOG ("READ ATIP failed (scsi error)");
+ BRASERO_MEDIA_LOG ("READ ATIP failed (scsi error)");
return BRASERO_BURN_ERR;
}
@@ -913,7 +920,7 @@
if (size)
g_free (atip_data);
- BRASERO_BURN_LOG ("READ ATIP failed (wrong size)");
+ BRASERO_MEDIA_LOG ("READ ATIP failed (wrong size)");
return BRASERO_BURN_ERR;
}
@@ -922,9 +929,9 @@
atip_data->desc->leadout_frame);
g_free (atip_data);
- BRASERO_BURN_LOG ("Format capacity %lli %lli",
- priv->block_num,
- priv->block_size);
+ BRASERO_MEDIA_LOG ("Format capacity %lli %lli",
+ priv->block_num,
+ priv->block_size);
return BRASERO_BURN_OK;
}
@@ -942,7 +949,7 @@
gint i, max;
gint size;
- BRASERO_BURN_LOG ("Retrieving format capacity");
+ BRASERO_MEDIA_LOG ("Retrieving format capacity");
priv = BRASERO_MEDIUM_PRIVATE (self);
result = brasero_mmc2_read_format_capacities (handle,
@@ -952,7 +959,7 @@
if (result != BRASERO_SCSI_OK) {
g_free (hdr);
- BRASERO_BURN_LOG ("READ FORMAT CAPACITIES failed");
+ BRASERO_MEDIA_LOG ("READ FORMAT CAPACITIES failed");
return BRASERO_BURN_ERR;
}
@@ -966,7 +973,7 @@
/* see if the media is already formatted */
current = hdr->max_caps;
if (!(current->type & BRASERO_SCSI_DESC_FORMATTED)) {
- BRASERO_BURN_LOG ("Unformatted media");
+ BRASERO_MEDIA_LOG ("Unformatted media");
priv->info |= BRASERO_MEDIUM_UNFORMATTED;
/* if unformatted, a DVD-RAM will return its maximum formattable
@@ -1020,7 +1027,7 @@
end:
- BRASERO_BURN_LOG ("Format capacity %lli %lli",
+ BRASERO_MEDIA_LOG ("Format capacity %lli %lli",
priv->block_num,
priv->block_size);
@@ -1068,7 +1075,7 @@
BraseroScsiWrtSpdDesc *desc;
BraseroScsiGetPerfData *wrt_perf = NULL;
- BRASERO_BURN_LOG ("Retrieving speed (Get Performance)");
+ BRASERO_MEDIA_LOG ("Retrieving speed (Get Performance)");
/* NOTE: this only work if there is RT streaming feature with
* wspd bit set to 1. At least an MMC3 drive. */
@@ -1081,7 +1088,7 @@
if (result != BRASERO_SCSI_OK) {
g_free (wrt_perf);
- BRASERO_BURN_LOG ("GET PERFORMANCE failed");
+ BRASERO_MEDIA_LOG ("GET PERFORMANCE failed");
return BRASERO_BURN_ERR;
}
@@ -1137,7 +1144,7 @@
gint max_num;
int size = 0;
- BRASERO_BURN_LOG ("Retrieving speed (2A speeds)");
+ BRASERO_MEDIA_LOG ("Retrieving speed (2A speeds)");
priv = BRASERO_MEDIUM_PRIVATE (self);
result = brasero_spc1_mode_sense_get_page (handle,
@@ -1148,7 +1155,7 @@
if (result != BRASERO_SCSI_OK) {
g_free (data);
- BRASERO_BURN_LOG ("MODE SENSE failed");
+ BRASERO_MEDIA_LOG ("MODE SENSE failed");
return BRASERO_BURN_ERR;
}
@@ -1158,7 +1165,7 @@
if (size < sizeof (BraseroScsiStatusPage)) {
g_free (data);
- BRASERO_BURN_LOG ("wrong size in page");
+ BRASERO_MEDIA_LOG ("wrong size in page");
return BRASERO_BURN_ERR;
}
@@ -1203,7 +1210,7 @@
BraseroScsiResult result;
int size = 0;
- BRASERO_BURN_LOG ("Retrieving speed (2A max)");
+ BRASERO_MEDIA_LOG ("Retrieving speed (2A max)");
priv = BRASERO_MEDIUM_PRIVATE (self);
@@ -1215,7 +1222,7 @@
if (result != BRASERO_SCSI_OK) {
g_free (data);
- BRASERO_BURN_LOG ("MODE SENSE failed");
+ BRASERO_MEDIA_LOG ("MODE SENSE failed");
return BRASERO_BURN_ERR;
}
@@ -1224,7 +1231,7 @@
if (size < 0x14) {
g_free (data);
- BRASERO_BURN_LOG ("wrong page size");
+ BRASERO_MEDIA_LOG ("wrong page size");
return BRASERO_BURN_ERR;
}
@@ -1278,7 +1285,7 @@
brasero_volume_source_close (vol);
if (!res) {
- BRASERO_BURN_LOG ("Failed to retrieve the volume size: %s",
+ BRASERO_MEDIA_LOG ("Failed to retrieve the volume size: %s",
error && error->message ?
error->message:"unknown error");
@@ -1300,7 +1307,7 @@
unsigned char buffer [2048];
BraseroScsiResult result;
- BRASERO_BURN_LOG ("Checking for TDBs in track pregap.");
+ BRASERO_MEDIA_LOG ("Checking for TDBs in track pregap.");
/* The two following sectors are readable */
result = brasero_mmc1_read_block (handle,
@@ -1318,7 +1325,7 @@
int i;
if (buffer [0] != 'T' || buffer [1] != 'D' || buffer [2] != 'I') {
- BRASERO_BURN_LOG ("Track was probably recorded in SAO mode - no TDB.");
+ BRASERO_MEDIA_LOG ("Track was probably recorded in SAO mode - no TDB.");
return TRUE;
}
@@ -1330,20 +1337,20 @@
}
if (i >= 128) {
- BRASERO_BURN_LOG ("No appropriate TDU for track");
+ BRASERO_MEDIA_LOG ("No appropriate TDU for track");
return TRUE;
}
if (buffer [8 + i * 16] == 0x80 || buffer [8 + i * 16] == 0x00) {
- BRASERO_BURN_LOG ("Track was recorded in TAO mode.");
+ BRASERO_MEDIA_LOG ("Track was recorded in TAO mode.");
return FALSE;
}
- BRASERO_BURN_LOG ("Track was recorded in Packet mode.");
+ BRASERO_MEDIA_LOG ("Track was recorded in Packet mode.");
return FALSE;
}
- BRASERO_BURN_LOG ("No pregap. That track must have been recorded in SAO mode.");
+ BRASERO_MEDIA_LOG ("No pregap. That track must have been recorded in SAO mode.");
return TRUE;
}
@@ -1360,7 +1367,7 @@
BraseroScsiResult result;
int size;
- BRASERO_BURN_LOG ("Retrieving track information for %i", track_num);
+ BRASERO_MEDIA_LOG ("Retrieving track information for %i", track_num);
priv = BRASERO_MEDIUM_PRIVATE (self);
@@ -1381,7 +1388,7 @@
code);
if (result != BRASERO_SCSI_OK) {
- BRASERO_BURN_LOG ("READ TRACK INFO failed");
+ BRASERO_MEDIA_LOG ("READ TRACK INFO failed");
return BRASERO_BURN_ERR;
}
@@ -1398,7 +1405,7 @@
* use the old value.
* That's important for checksuming to have a perfect account of
* the data size. */
- BRASERO_BURN_LOG ("300 sectors size. Checking for real size");
+ BRASERO_MEDIA_LOG ("300 sectors size. Checking for real size");
brasero_medium_track_volume_size (self, track, handle);
}
/* NOTE: for multisession CDs only
@@ -1428,7 +1435,7 @@
&& multisession
&& (priv->info & BRASERO_MEDIUM_CD)
&& !(priv->info & BRASERO_MEDIUM_ROM)) {
- BRASERO_BURN_LOG ("Data track belongs to first session of multisession CD. "
+ BRASERO_MEDIA_LOG ("Data track belongs to first session of multisession CD. "
"Checking for real size (%i sectors currently).",
track->blocks_num);
@@ -1453,19 +1460,19 @@
NULL);
if (result == BRASERO_SCSI_OK) {
- BRASERO_BURN_LOG ("Following two sectors are readable.");
+ BRASERO_MEDIA_LOG ("Following two sectors are readable.");
if (brasero_medium_track_written_SAO (handle, track_num, track->start)) {
track->blocks_num += 2;
- BRASERO_BURN_LOG ("Correcting track size (now %i)", track->blocks_num);
+ BRASERO_MEDIA_LOG ("Correcting track size (now %i)", track->blocks_num);
}
}
else
- BRASERO_BURN_LOG ("Detected runouts");
+ BRASERO_MEDIA_LOG ("Detected runouts");
}
/* NOTE: DVD+RW, DVD-RW (restricted overwrite) never reach this function */
- BRASERO_BURN_LOG ("Track %i (session %i): type = %i start = %llu size = %llu",
+ BRASERO_MEDIA_LOG ("Track %i (session %i): type = %i start = %llu size = %llu",
track_num,
track->session,
track->type,
@@ -1488,14 +1495,14 @@
priv = BRASERO_MEDIUM_PRIVATE (self);
- BRASERO_BURN_LOG ("Using fallback method for blank CDR to retrieve NWA and leadout information");
+ BRASERO_MEDIA_LOG ("Using fallback method for blank CDR to retrieve NWA and leadout information");
/* NWA is easy for blank CDRs, it's 0. So far, so good... */
priv->next_wr_add = 0;
result = brasero_mmc1_read_atip (handle, &atip, &size, code);
if (result != BRASERO_SCSI_OK) {
- BRASERO_BURN_LOG ("READ ATIP failed");
+ BRASERO_MEDIA_LOG ("READ ATIP failed");
return BRASERO_BURN_ERR;
}
@@ -1506,7 +1513,7 @@
/* of course it starts at 0 since it's empty */
leadout->start = 0;
- BRASERO_BURN_LOG ("Leadout (through READ ATIP): start = %llu size = %llu",
+ BRASERO_MEDIA_LOG ("Leadout (through READ ATIP): start = %llu size = %llu",
leadout->start,
leadout->blocks_num);
@@ -1529,12 +1536,12 @@
gint track_num;
int size;
- BRASERO_BURN_LOG ("Retrieving NWA and leadout information");
+ BRASERO_MEDIA_LOG ("Retrieving NWA and leadout information");
priv = BRASERO_MEDIUM_PRIVATE (self);
if (BRASERO_MEDIUM_RANDOM_WRITABLE (priv->info)) {
- BRASERO_BURN_LOG ("Overwritable medium => skipping");
+ BRASERO_MEDIA_LOG ("Overwritable medium => skipping");
return BRASERO_BURN_OK;
}
@@ -1549,9 +1556,9 @@
if (result == BRASERO_SCSI_OK) {
wrt_page = (BraseroScsiWritePage *) &data->page;
- BRASERO_BURN_LOG ("Former write type %d", wrt_page->write_type);
- BRASERO_BURN_LOG ("Former track mode %d", wrt_page->track_mode);
- BRASERO_BURN_LOG ("Former data block type %d", wrt_page->data_block_type);
+ BRASERO_MEDIA_LOG ("Former write type %d", wrt_page->write_type);
+ BRASERO_MEDIA_LOG ("Former track mode %d", wrt_page->track_mode);
+ BRASERO_MEDIA_LOG ("Former data block type %d", wrt_page->data_block_type);
/* "reset some stuff to be on the safe side" (words and ideas
* taken from k3b:)). */
@@ -1573,7 +1580,7 @@
g_free (data);
if (result != BRASERO_SCSI_OK) {
- BRASERO_BURN_LOG ("MODE SELECT failed");
+ BRASERO_MEDIA_LOG ("MODE SELECT failed");
/* This only for CD-R */
if (BRASERO_MEDIUM_IS (priv->info, BRASERO_MEDIUM_CDR|BRASERO_MEDIUM_BLANK))
@@ -1587,7 +1594,7 @@
}
}
else {
- BRASERO_BURN_LOG ("MODE SENSE failed");
+ BRASERO_MEDIA_LOG ("MODE SENSE failed");
/* This only for CD-R */
if (BRASERO_MEDIUM_IS (priv->info, BRASERO_MEDIUM_CDR|BRASERO_MEDIUM_BLANK))
@@ -1618,7 +1625,7 @@
else if (priv->first_open_track >= 0)
track_num = priv->first_open_track;
else {
- BRASERO_BURN_LOG ("There aren't any open session set");
+ BRASERO_MEDIA_LOG ("There aren't any open session set");
return BRASERO_BURN_ERR;
}
@@ -1636,26 +1643,26 @@
leadout,
code);
- BRASERO_BURN_LOG ("READ TRACK INFO failed");
+ BRASERO_MEDIA_LOG ("READ TRACK INFO failed");
return BRASERO_BURN_ERR;
}
- BRASERO_BURN_LOG ("Next Writable Address is %d", BRASERO_GET_32 (track_info.next_wrt_address));
+ BRASERO_MEDIA_LOG ("Next Writable Address is %d", BRASERO_GET_32 (track_info.next_wrt_address));
if (track_info.next_wrt_address_valid)
priv->next_wr_add = BRASERO_GET_32 (track_info.next_wrt_address);
else
- BRASERO_BURN_LOG ("Next Writable Address is not valid");
+ BRASERO_MEDIA_LOG ("Next Writable Address is not valid");
/* Set free space */
- BRASERO_BURN_LOG ("Free blocks %d", BRASERO_GET_32 (track_info.free_blocks));
+ BRASERO_MEDIA_LOG ("Free blocks %d", BRASERO_GET_32 (track_info.free_blocks));
leadout->blocks_num = BRASERO_GET_32 (track_info.free_blocks);
if (!leadout->blocks_num) {
leadout->blocks_num = BRASERO_GET_32 (track_info.track_size);
- BRASERO_BURN_LOG ("Using track size %d", leadout->blocks_num);
+ BRASERO_MEDIA_LOG ("Using track size %d", leadout->blocks_num);
}
- BRASERO_BURN_LOG ("Leadout: start = %llu size = %llu",
+ BRASERO_MEDIA_LOG ("Leadout: start = %llu size = %llu",
leadout->start,
leadout->blocks_num);
@@ -1706,7 +1713,7 @@
* buggy */
priv->next_wr_add = 0;
- BRASERO_BURN_LOG ("Adding fabricated leadout start = %llu length = %llu",
+ BRASERO_MEDIA_LOG ("Adding fabricated leadout start = %llu length = %llu",
leadout->start,
leadout->blocks_num);
}
@@ -1723,7 +1730,7 @@
BraseroMediumPrivate *priv;
BraseroScsiFormattedTocData *toc = NULL;
- BRASERO_BURN_LOG ("Reading Toc");
+ BRASERO_MEDIA_LOG ("Reading Toc");
priv = BRASERO_MEDIUM_PRIVATE (self);
result = brasero_mmc1_read_toc_formatted (handle,
@@ -1734,7 +1741,7 @@
if (result != BRASERO_SCSI_OK) {
g_free (toc);
- BRASERO_BURN_LOG ("READ TOC failed");
+ BRASERO_MEDIA_LOG ("READ TOC failed");
return BRASERO_BURN_ERR;
}
@@ -1748,14 +1755,14 @@
* are open: all first concatenated sessions, the last session, and the
* leadout. */
- BRASERO_BURN_LOG ("%i track(s) found", num);
+ BRASERO_MEDIA_LOG ("%i track(s) found", num);
desc = toc->desc;
for (i = 0; i < num; i ++, desc ++) {
BraseroMediumTrack *track;
if (desc->track_num == BRASERO_SCSI_TRACK_LEADOUT_START) {
- BRASERO_BURN_LOG ("Leadout reached %d",
+ BRASERO_MEDIA_LOG ("Leadout reached %d",
BRASERO_GET_32 (desc->track_start));
break;
}
@@ -1793,7 +1800,7 @@
* which have only one track: the first. Since it's not
* possible to know the amount of data that were really
* written in this session, read the filesystem. */
- BRASERO_BURN_LOG ("DVD+RW (DL) or DVD-RW (restricted overwrite) checking volume size (start = %i)", track->start);
+ BRASERO_MEDIA_LOG ("DVD+RW (DL) or DVD-RW (restricted overwrite) checking volume size (start = %i)", track->start);
track->session = 1;
track->start = 0;
result = brasero_medium_track_volume_size (self,
@@ -1807,11 +1814,11 @@
priv->info &= ~(BRASERO_MEDIUM_CLOSED|
BRASERO_MEDIUM_HAS_DATA);
- BRASERO_BURN_LOG ("Empty first session.");
+ BRASERO_MEDIA_LOG ("Empty first session.");
}
else {
priv->next_wr_add = 0;
- BRASERO_BURN_LOG ("Track 1 (session %i): type = %i start = %llu size = %llu",
+ BRASERO_MEDIA_LOG ("Track 1 (session %i): type = %i start = %llu size = %llu",
track->session,
track->type,
track->start,
@@ -1885,11 +1892,11 @@
&size,
code);
if (result != BRASERO_SCSI_OK) {
- BRASERO_BURN_LOG ("Retrieval of DVD id failed");
+ BRASERO_MEDIA_LOG ("Retrieval of DVD id failed");
return;
}
- BRASERO_BURN_LOG ("DVD id %d", BRASERO_GET_16 (hdr->data + 2));
+ BRASERO_MEDIA_LOG ("DVD id %d", BRASERO_GET_16 (hdr->data + 2));
priv->id = g_strdup_printf ("%d", BRASERO_GET_16 (hdr->data + 2));
g_free (hdr);
}
@@ -1904,7 +1911,7 @@
BraseroMediumPrivate *priv;
BraseroScsiDiscInfoStd *info = NULL;
- BRASERO_BURN_LOG ("Retrieving media status");
+ BRASERO_MEDIA_LOG ("Retrieving media status");
priv = BRASERO_MEDIUM_PRIVATE (self);
@@ -1915,13 +1922,13 @@
if (result != BRASERO_SCSI_OK) {
g_free (info);
- BRASERO_BURN_LOG ("READ DISC INFORMATION failed");
+ BRASERO_MEDIA_LOG ("READ DISC INFORMATION failed");
return BRASERO_BURN_ERR;
}
if (info->disc_id_valid) {
/* Try to get the disc identification if possible (CDs only) */
- BRASERO_BURN_LOG ("Disc id %i", BRASERO_GET_32 (info->disc_id));
+ BRASERO_MEDIA_LOG ("Disc id %i", BRASERO_GET_32 (info->disc_id));
priv->id = g_strdup_printf ("%d", BRASERO_GET_32 (info->disc_id));
}
else if (!(priv->info & BRASERO_MEDIUM_CD))
@@ -1935,13 +1942,13 @@
if (info->status == BRASERO_SCSI_DISC_EMPTY) {
BraseroMediumTrack *track;
- BRASERO_BURN_LOG ("Empty media");
+ BRASERO_MEDIA_LOG ("Empty media");
priv->info |= BRASERO_MEDIUM_BLANK;
priv->block_size = 2048;
priv->first_open_track = BRASERO_FIRST_TRACK_IN_LAST_SESSION (info);
- BRASERO_BURN_LOG ("First open track %d", priv->first_open_track);
+ BRASERO_MEDIA_LOG ("First open track %d", priv->first_open_track);
if (BRASERO_MEDIUM_RANDOM_WRITABLE (priv->info))
brasero_medium_add_DVD_plus_RW_leadout (self);
@@ -1959,16 +1966,16 @@
}
else if (info->status == BRASERO_SCSI_DISC_INCOMPLETE) {
priv->info |= BRASERO_MEDIUM_APPENDABLE;
- BRASERO_BURN_LOG ("Appendable media");
+ BRASERO_MEDIA_LOG ("Appendable media");
priv->first_open_track = BRASERO_FIRST_TRACK_IN_LAST_SESSION (info);
- BRASERO_BURN_LOG ("First track in last open session %d", priv->first_open_track);
+ BRASERO_MEDIA_LOG ("First track in last open session %d", priv->first_open_track);
result = brasero_medium_get_sessions_info (self, handle, code);
}
else if (info->status == BRASERO_SCSI_DISC_FINALIZED) {
priv->info |= BRASERO_MEDIUM_CLOSED;
- BRASERO_BURN_LOG ("Closed media");
+ BRASERO_MEDIA_LOG ("Closed media");
result = brasero_medium_get_sessions_info (self, handle, code);
}
@@ -2082,7 +2089,7 @@
* and BCD it must be 150. */
/* First find the first track and get track start address in BCD */
- BRASERO_BURN_LOG ("Retrieving track information to determine number format");
+ BRASERO_MEDIA_LOG ("Retrieving track information to determine number format");
for (i = 0; i < num; i++) {
if (desc [i].adr == BRASERO_SCSI_Q_SUB_CHANNEL_LEADIN_MODE5
@@ -2105,7 +2112,7 @@
desc [i].p_sec,
desc [i].p_frame);
- BRASERO_BURN_LOG ("Comparing to track information from READ TRACK INFO for track %i", track_num);
+ BRASERO_MEDIA_LOG ("Comparing to track information from READ TRACK INFO for track %i", track_num);
size = 36;
start_LBA -= 150;
@@ -2119,13 +2126,13 @@
code);
if (result != BRASERO_SCSI_OK) {
- BRASERO_BURN_LOG ("READ TRACK INFO failed");
+ BRASERO_MEDIA_LOG ("READ TRACK INFO failed");
*/ /* Fallback to formatted toc */
/* return 0;
}
*/
track_start = BRASERO_GET_32 (track_info.start_lba);
- BRASERO_BURN_LOG ("comparing DCB %i and LBA %i to real start address %i",
+ BRASERO_MEDIA_LOG ("comparing DCB %i and LBA %i to real start address %i",
start_BCD, start_LBA, track_start);
/* try to find a conclusive match */
@@ -2146,7 +2153,7 @@
desc [leadout].sec,
desc [leadout].frame);
- BRASERO_BURN_LOG ("Comparing to track information from READ TRACK INFO for leadout");
+ BRASERO_MEDIA_LOG ("Comparing to track information from READ TRACK INFO for leadout");
size = 36;
@@ -2158,13 +2165,13 @@
code);
if (result != BRASERO_SCSI_OK) {
- BRASERO_BURN_LOG ("READ TRACK INFO failed for leadout");
+ BRASERO_MEDIA_LOG ("READ TRACK INFO failed for leadout");
/* Fallback to formatted toc */
return 0;
}
track_start = BRASERO_GET_32 (track_info.start_lba);
- BRASERO_BURN_LOG ("comparing DCB %i and LBA %i to real start address %i",
+ BRASERO_MEDIA_LOG ("comparing DCB %i and LBA %i to real start address %i",
start_BCD, start_LBA, track_start);
/* try to find a conclusive match */
@@ -2197,7 +2204,7 @@
BraseroScsiRawTocDesc *desc;
BraseroScsiRawTocData *toc = NULL;
- BRASERO_BURN_LOG ("Reading Raw Toc");
+ BRASERO_MEDIA_LOG ("Reading Raw Toc");
priv = BRASERO_MEDIUM_PRIVATE (self);
@@ -2208,21 +2215,21 @@
&size,
code);
if (result != BRASERO_SCSI_OK) {
- BRASERO_BURN_LOG ("READ TOC failed");
+ BRASERO_MEDIA_LOG ("READ TOC failed");
return BRASERO_BURN_ERR;
}
num = (size - sizeof (BraseroScsiRawTocData)) /
sizeof (BraseroScsiRawTocDesc);
- BRASERO_BURN_LOG ("%i track(s) found", num);
+ BRASERO_MEDIA_LOG ("%i track(s) found", num);
desc = toc->desc;
use_bcd = brasero_medium_check_BCD_use (self, handle, desc, num, code);
if (!use_bcd) {
g_free (toc);
- BRASERO_BURN_LOG ("Fallback to formatted toc");
+ BRASERO_MEDIA_LOG ("Fallback to formatted toc");
return BRASERO_BURN_ERR;
}
@@ -2230,10 +2237,10 @@
use_bcd = 0;
if (use_bcd) {
- BRASERO_BURN_LOG ("Using BCD format");
+ BRASERO_MEDIA_LOG ("Using BCD format");
}
else {
- BRASERO_BURN_LOG ("Using HEX format");
+ BRASERO_MEDIA_LOG ("Using HEX format");
}
for (i = 0; i < num; i++, desc ++) {
@@ -2328,11 +2335,11 @@
/* check for tracks less that 300 sectors */
if (track->blocks_num <= 300 && track->type != BRASERO_MEDIUM_TRACK_LEADOUT) {
- BRASERO_BURN_LOG ("300 sectors size. Checking for real size");
+ BRASERO_MEDIA_LOG ("300 sectors size. Checking for real size");
brasero_medium_track_volume_size (self, track, handle);
}
- BRASERO_BURN_LOG ("Track %i: type = %i start = %llu size = %llu",
+ BRASERO_MEDIA_LOG ("Track %i: type = %i start = %llu size = %llu",
g_slist_index (priv->tracks, track),
track->type,
track->start,
@@ -2353,7 +2360,7 @@
BraseroMediumPrivate *priv;
BraseroScsiDiscInfoStd *info = NULL;
- BRASERO_BURN_LOG ("Retrieving media status for old drive");
+ BRASERO_MEDIA_LOG ("Retrieving media status for old drive");
priv = BRASERO_MEDIUM_PRIVATE (self);
@@ -2364,7 +2371,7 @@
if (result != BRASERO_SCSI_OK) {
g_free (info);
- BRASERO_BURN_LOG ("READ DISC INFORMATION failed for old drive");
+ BRASERO_MEDIA_LOG ("READ DISC INFORMATION failed for old drive");
return BRASERO_BURN_ERR;
}
@@ -2382,17 +2389,17 @@
priv->info |= BRASERO_MEDIUM_BLANK;
priv->block_size = 2048;
priv->next_wr_add = 0;
- BRASERO_BURN_LOG ("Empty media (old drive)");
+ BRASERO_MEDIA_LOG ("Empty media (old drive)");
}
else if (info->status == BRASERO_SCSI_DISC_INCOMPLETE) {
priv->info |= BRASERO_MEDIUM_APPENDABLE;
priv->block_size = 2048;
priv->next_wr_add = 0;
- BRASERO_BURN_LOG ("Appendable media (old drive)");
+ BRASERO_MEDIA_LOG ("Appendable media (old drive)");
}
else if (info->status == BRASERO_SCSI_DISC_FINALIZED) {
priv->info |= BRASERO_MEDIUM_CLOSED;
- BRASERO_BURN_LOG ("Closed media (old drive)");
+ BRASERO_MEDIA_LOG ("Closed media (old drive)");
}
/* get the contents */
@@ -2423,7 +2430,7 @@
code);
}
- BRASERO_BURN_LOG ("Not an old drive model");
+ BRASERO_MEDIA_LOG ("Not an old drive model");
return BRASERO_BURN_ERR;
}
@@ -2442,7 +2449,7 @@
BraseroScsiResult result;
int size;
- BRASERO_BURN_LOG ("Retrieving media profile");
+ BRASERO_MEDIA_LOG ("Retrieving media profile");
priv = BRASERO_MEDIUM_PRIVATE (self);
result = brasero_mmc2_get_configuration_feature (handle,
@@ -2454,7 +2461,7 @@
BraseroScsiAtipData *data = NULL;
int size = 0;
- BRASERO_BURN_LOG ("GET CONFIGURATION failed");
+ BRASERO_MEDIA_LOG ("GET CONFIGURATION failed");
/* This could be a MMC1 drive since this command was
* introduced in MMC2 and is supported onward. So it
@@ -2493,7 +2500,7 @@
if (size)
g_free (data);
- BRASERO_BURN_LOG ("READ ATIP failed (wrong size)");
+ BRASERO_MEDIA_LOG ("READ ATIP failed (wrong size)");
return BRASERO_BURN_ERR;
}
@@ -2663,7 +2670,7 @@
code);
if (result == BRASERO_SCSI_OK) {
if (hdr->desc->current) {
- BRASERO_BURN_LOG ("POW formatted medium detected");
+ BRASERO_MEDIA_LOG ("POW formatted medium detected");
priv->info |= BRASERO_MEDIUM_POW;
}
@@ -2685,7 +2692,7 @@
current = hdr->max_caps;
if (!(current->type & BRASERO_SCSI_DESC_FORMATTED)) {
- BRASERO_BURN_LOG ("Unformatted BD-R");
+ BRASERO_MEDIA_LOG ("Unformatted BD-R");
priv->info |= BRASERO_MEDIUM_UNFORMATTED;
}
@@ -2713,7 +2720,7 @@
priv = BRASERO_MEDIUM_PRIVATE (self);
- BRASERO_BURN_LOG ("Testing for Css encrypted media");
+ BRASERO_MEDIA_LOG ("Testing for Css encrypted media");
result = brasero_mmc2_get_configuration_feature (handle,
BRASERO_SCSI_FEAT_DVD_CSS,
&hdr,
@@ -2722,7 +2729,7 @@
if (result != BRASERO_SCSI_OK) {
g_free (hdr);
- BRASERO_BURN_LOG ("GET CONFIGURATION failed");
+ BRASERO_MEDIA_LOG ("GET CONFIGURATION failed");
return BRASERO_BURN_ERR;
}
@@ -2734,7 +2741,7 @@
/* here we just need to see if this feature is current or not */
if (hdr->desc->current) {
priv->info |= BRASERO_MEDIUM_PROTECTED;
- BRASERO_BURN_LOG ("media is Css protected");
+ BRASERO_MEDIA_LOG ("media is Css protected");
}
g_free (hdr);
@@ -2837,13 +2844,13 @@
g_free (priv->CD_TEXT_title);
if (!utf8_string) {
- BRASERO_BURN_LOG ("Charset convertion failed");
+ BRASERO_MEDIA_LOG ("Charset convertion failed");
priv->CD_TEXT_title = g_strdup (string);
}
else
priv->CD_TEXT_title = utf8_string;
- BRASERO_BURN_LOG ("CD-TEXT title %s", priv->CD_TEXT_title);
+ BRASERO_MEDIA_LOG ("CD-TEXT title %s", priv->CD_TEXT_title);
return TRUE;
}
@@ -2916,9 +2923,9 @@
BraseroMediumPrivate *priv;
BraseroScsiCDTextData *cd_text;
- BRASERO_BURN_LOG ("Getting CD-TEXT");
+ BRASERO_MEDIA_LOG ("Getting CD-TEXT");
if (brasero_mmc3_read_cd_text (handle, &cd_text, &size, code) != BRASERO_SCSI_OK) {
- BRASERO_BURN_LOG ("GET CD-TEXT failed");
+ BRASERO_MEDIA_LOG ("GET CD-TEXT failed");
return;
}
@@ -2957,7 +2964,7 @@
pack = (BraseroScsiCDTextPackCharset *) buffer;
charset = pack->charset;
- BRASERO_BURN_LOG ("Found language pack. Charset = %d. Start %d. End %d",
+ BRASERO_MEDIA_LOG ("Found language pack. Charset = %d. Start %d. End %d",
charset, pack->first_track, pack->last_track);
}
}
@@ -3019,11 +3026,12 @@
BraseroBurnResult result;
BraseroMediumPrivate *priv;
BraseroScsiErrCode code = 0;
+ gchar buffer [256] = { 0, };
priv = BRASERO_MEDIUM_PRIVATE (object);
name = brasero_drive_get_display_name (priv->drive);
- BRASERO_BURN_LOG ("Initializing information for medium in %s", name);
+ BRASERO_MEDIA_LOG ("Initializing information for medium in %s", name);
g_free (name);
if (priv->probe_cancelled)
@@ -3065,7 +3073,8 @@
if (priv->probe_cancelled)
return;
- BRASERO_BURN_LOG_DISC_TYPE (priv->info, "media is ");
+ brasero_media_to_string (priv->info, buffer);
+ BRASERO_MEDIA_LOG ("media is %s", buffer);
if (!priv->wr_speeds)
return;
@@ -3118,7 +3127,7 @@
/* the drive might be busy (a burning is going on) so we don't block
* but we re-try to open it every second */
- BRASERO_BURN_LOG ("Trying to open device %s", path);
+ BRASERO_MEDIA_LOG ("Trying to open device %s", path);
handle = brasero_device_handle_open (path, FALSE, &code);
while (!handle && counter <= BRASERO_MEDIUM_OPEN_ATTEMPTS) {
@@ -3139,7 +3148,7 @@
}
if (handle) {
- BRASERO_BURN_LOG ("Open () succeeded");
+ BRASERO_MEDIA_LOG ("Open () succeeded");
/* NOTE: if we wanted to know the status we'd need to read the
* error code variable which is currently NULL */
@@ -3149,18 +3158,18 @@
if (priv->probe_cancelled) {
priv->probe = NULL;
brasero_device_handle_close (handle);
- BRASERO_BURN_LOG ("Device probing cancelled");
+ BRASERO_MEDIA_LOG ("Device probing cancelled");
return NULL;
}
}
- BRASERO_BURN_LOG ("Device ready");
+ BRASERO_MEDIA_LOG ("Device ready");
brasero_medium_init_real (BRASERO_MEDIUM (self), handle);
brasero_device_handle_close (handle);
}
else
- BRASERO_BURN_LOG ("Open () failed: medium busy");
+ BRASERO_MEDIA_LOG ("Open () failed: medium busy");
priv->probe_id = g_idle_add (brasero_medium_probed, self);
priv->probe = NULL;
Modified: trunk/src/burn-medium.h
==============================================================================
--- trunk/src/burn-medium.h (original)
+++ trunk/src/burn-medium.h Wed Jan 7 14:28:22 2009
@@ -22,7 +22,6 @@
#include <glib-object.h>
-#include "burn-basics.h"
#include "burn-media.h"
#ifndef _BURN_MEDIUM_H_
@@ -50,6 +49,25 @@
#define BRASERO_RATE_TO_SPEED_DVD(rate) (gdouble) ((gdouble) (rate) / (gdouble) DVD_RATE)
#define BRASERO_RATE_TO_SPEED_BD(rate) (gdouble) ((gdouble) (rate) / (gdouble) BD_RATE)
+typedef enum {
+ BRASERO_MEDIUM_TRACK_NONE = 0,
+ BRASERO_MEDIUM_TRACK_DATA = 1,
+ BRASERO_MEDIUM_TRACK_AUDIO = 1 << 1,
+ BRASERO_MEDIUM_TRACK_COPY = 1 << 2,
+ BRASERO_MEDIUM_TRACK_PREEMP = 1 << 3,
+ BRASERO_MEDIUM_TRACK_4_CHANNELS = 1 << 4,
+ BRASERO_MEDIUM_TRACK_INCREMENTAL = 1 << 5,
+ BRASERO_MEDIUM_TRACK_LEADOUT = 1 << 6
+} BraseroMediumTrackType;
+
+struct _BraseroMediumTrack {
+ guint session;
+ BraseroMediumTrackType type;
+ guint64 start;
+ guint64 blocks_num;
+};
+typedef struct _BraseroMediumTrack BraseroMediumTrack;
+
#define BRASERO_TYPE_MEDIUM (brasero_medium_get_type ())
#define BRASERO_MEDIUM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BRASERO_TYPE_MEDIUM, BraseroMedium))
#define BRASERO_MEDIUM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BRASERO_TYPE_MEDIUM, BraseroMediumClass))
@@ -72,37 +90,10 @@
GType brasero_medium_get_type (void) G_GNUC_CONST;
-typedef enum {
- BRASERO_MEDIUM_TRACK_NONE = 0,
- BRASERO_MEDIUM_TRACK_DATA = 1,
- BRASERO_MEDIUM_TRACK_AUDIO = 1 << 1,
- BRASERO_MEDIUM_TRACK_COPY = 1 << 2,
- BRASERO_MEDIUM_TRACK_PREEMP = 1 << 3,
- BRASERO_MEDIUM_TRACK_4_CHANNELS = 1 << 4,
- BRASERO_MEDIUM_TRACK_INCREMENTAL = 1 << 5,
- BRASERO_MEDIUM_TRACK_LEADOUT = 1 << 6
-} BraseroMediumTrackType;
-
-struct _BraseroMediumTrack {
- guint session;
- BraseroMediumTrackType type;
- guint64 start;
- guint64 blocks_num;
-};
-typedef struct _BraseroMediumTrack BraseroMediumTrack;
-
BraseroMedia
brasero_medium_get_status (BraseroMedium *medium);
-gboolean
-brasero_medium_support_flags (BraseroMedium *medium,
- BraseroBurnFlag flags);
-
-BraseroBurnFlag
-brasero_medium_supported_flags (BraseroMedium *self,
- BraseroBurnFlag flags);
-
GSList *
brasero_medium_get_tracks (BraseroMedium *medium);
@@ -130,6 +121,7 @@
gint64 *byte,
gint64 *sector);
+
gint64
brasero_medium_get_next_writable_address (BraseroMedium *medium);
Added: trunk/src/burn-units.c
==============================================================================
--- (empty file)
+++ trunk/src/burn-units.c Wed Jan 7 14:28:22 2009
@@ -0,0 +1,97 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
+/*
+ * brasero
+ * Copyright (C) Philippe Rouquier 2005-2008 <bonfire-app wanadoo fr>
+ *
+ * Brasero is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * brasero is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with brasero. If not, write to:
+ * The Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <glib.h>
+#include <glib/gi18n-lib.h>
+
+#include "burn-units.h"
+
+gchar *
+brasero_units_get_time_string (guint64 time,
+ gboolean with_unit,
+ gboolean round)
+{
+ gint64 second, minute, hour;
+
+ time /= 1000000000;
+ hour = time / 3600;
+ time = time % 3600;
+ minute = time / 60;
+
+ if (round) {
+ if ((time % 60) > 30)
+ minute ++;
+
+ second = 0;
+ }
+ else
+ second = time % 60;
+
+ if (hour) {
+ if (with_unit) {
+ if (hour && minute && second)
+ return g_strdup_printf ("%lli h %02lli min %02lli",
+ hour,
+ minute,
+ second);
+ else if (hour && minute)
+ return g_strdup_printf ("%lli h %02lli",
+ hour,
+ minute);
+ else
+ return g_strdup_printf ("%lli h",hour);
+ }
+ else if (hour && minute && second)
+ return g_strdup_printf ("%lli:%02lli:%02lli",
+ hour,
+ minute,
+ second);
+ else if (hour && minute)
+ return g_strdup_printf ("%lli:%02lli", hour, minute);
+ }
+
+ if (with_unit) {
+ if (!second)
+ return g_strdup_printf (_("%lli min"), minute);
+ else
+ return g_strdup_printf (_("%lli:%02lli min"), minute, second);
+ }
+ else
+ return g_strdup_printf ("%lli:%02lli", minute, second);
+}
+
+
+gchar *
+brasero_units_get_time_string_from_size (gint64 size,
+ gboolean with_unit,
+ gboolean round)
+{
+ guint64 time = 0;
+
+ time = BRASERO_BYTES_TO_DURATION (size);
+ return brasero_units_get_time_string (time, with_unit, round);
+}
+
Added: trunk/src/burn-units.h
==============================================================================
--- (empty file)
+++ trunk/src/burn-units.h Wed Jan 7 14:28:22 2009
@@ -0,0 +1,58 @@
+/*
+ * Brasero is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Brasero is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA
+ */
+
+#ifndef _BRASERO_UNITS_H
+#define BRASERO_UNITS_H
+
+#include <glib.h>
+
+G_BEGIN_DECLS
+
+/**
+ * Used to convert between known units
+ **/
+
+#define BRASERO_DURATION_TO_BYTES(duration) \
+ ((gint64) (duration) * 75 * 2352 / 1000000000 + \
+ (((gint64) ((duration) * 75 * 2352) % 1000000000) ? 1:0))
+#define BRASERO_DURATION_TO_SECTORS(duration) \
+ ((gint64) (duration) * 75 / 1000000000 + \
+ (((gint64) ((duration) * 75) % 1000000000) ? 1:0))
+#define BRASERO_SIZE_TO_SECTORS(size, secsize) \
+ (((size) / (secsize)) + (((size) % (secsize)) ? 1:0))
+#define BRASERO_BYTES_TO_DURATION(bytes) \
+ (guint64) ((guint64) ((guint64) (bytes) * 1000000000) / (guint64) (2352 * 75) + \
+ (guint64) (((guint64) ((guint64) (bytes) * 1000000000) % (guint64) (2352 * 75)) ? 1:0))
+
+/**
+ * Used to get string
+ */
+
+gchar *
+brasero_units_get_time_string (guint64 time,
+ gboolean with_unit,
+ gboolean round);
+
+gchar *
+brasero_units_get_time_string_from_size (gint64 size,
+ gboolean with_unit,
+ gboolean round);
+
+G_END_DECLS
+
+#endif /* BRASERO_UNITS_H */
+
+
Modified: trunk/src/burn-volume-obj.c
==============================================================================
--- trunk/src/burn-volume-obj.c (original)
+++ trunk/src/burn-volume-obj.c Wed Jan 7 14:28:22 2009
@@ -29,8 +29,6 @@
#include <gio/gio.h>
-#include "burn-basics.h"
-#include "burn-debug.h"
#include "burn-volume-obj.h"
typedef struct _BraseroVolumePrivate BraseroVolumePrivate;
@@ -83,7 +81,7 @@
if (!device_path)
continue;
- BRASERO_BURN_LOG ("Found volume %s", device_path);
+ BRASERO_MEDIA_LOG ("Found volume %s", device_path);
if (!strcmp (device_path, volume_path)) {
volume = tmp;
g_free (device_path);
@@ -97,7 +95,7 @@
g_list_free (volumes);
if (!volume)
- BRASERO_BURN_LOG ("No volume found for medium");
+ BRASERO_MEDIA_LOG ("No volume found for medium");
return volume;
}
@@ -186,8 +184,8 @@
if (!root) {
g_set_error (error,
- BRASERO_BURN_ERROR,
- BRASERO_BURN_ERROR_GENERAL,
+ BRASERO_MEDIA_ERROR,
+ BRASERO_MEDIA_ERROR_GENERAL,
_("The disc mount point could not be retrieved"));
}
else {
@@ -222,7 +220,7 @@
priv = BRASERO_VOLUME_PRIVATE (self);
brasero_volume_operation_end (self);
- BRASERO_BURN_LOG ("Volume/Disc operation timed out");
+ BRASERO_MEDIA_LOG ("Volume/Disc operation timed out");
priv->timeout_id = 0;
priv->result = FALSE;
return FALSE;
@@ -312,7 +310,7 @@
result,
&priv->error);
- BRASERO_BURN_LOG ("Umount operation completed (result = %d)", priv->result);
+ BRASERO_MEDIA_LOG ("Umount operation completed (result = %d)", priv->result);
if (priv->error) {
if (priv->error->code == G_IO_ERROR_FAILED_HANDLED) {
@@ -589,7 +587,7 @@
BraseroDrive *drive;
BraseroVolumePrivate *priv;
- BRASERO_BURN_LOG ("Ejecting");
+ BRASERO_MEDIA_LOG ("Ejecting");
if (!self)
return TRUE;
@@ -599,12 +597,12 @@
drive = brasero_medium_get_drive (BRASERO_MEDIUM (self));
gdrive = brasero_drive_get_gdrive (drive);
if (!gdrive) {
- BRASERO_BURN_LOG ("No GDrive");
+ BRASERO_MEDIA_LOG ("No GDrive");
goto last_resort;
}
if (!g_drive_can_eject (gdrive)) {
- BRASERO_BURN_LOG ("GDrive can't eject");
+ BRASERO_MEDIA_LOG ("GDrive can't eject");
goto last_resort;
}
Modified: trunk/src/burn-volume-source.c
==============================================================================
--- trunk/src/burn-volume-source.c (original)
+++ trunk/src/burn-volume-source.c Wed Jan 7 14:28:22 2009
@@ -30,9 +30,9 @@
#include <stdio.h>
#include <unistd.h>
-#include "burn-debug.h"
#include "burn-volume-source.h"
#include "burn-iso9660.h"
+#include "burn-media.h"
#include "scsi-mmc1.h"
#include "scsi-mmc2.h"
@@ -68,13 +68,13 @@
if (fseeko (src->data, (guint64) (block * ISO9660_BLOCK_SIZE), whence) == -1) {
int errsv = errno;
- BRASERO_BURN_LOG ("fseeko () failed at block %i (= %lli bytes) (%s)",
- block,
- (guint64) (block * ISO9660_BLOCK_SIZE),
- g_strerror (errsv));
+ BRASERO_MEDIA_LOG ("fseeko () failed at block %i (= %lli bytes) (%s)",
+ block,
+ (guint64) (block * ISO9660_BLOCK_SIZE),
+ g_strerror (errsv));
g_set_error (error,
- BRASERO_BURN_ERROR,
- BRASERO_BURN_ERROR_GENERAL,
+ BRASERO_MEDIA_ERROR,
+ BRASERO_MEDIA_ERROR_GENERAL,
"%s",
g_strerror (errsv));
return -1;
@@ -91,16 +91,16 @@
{
guint64 bytes_read;
- BRASERO_BURN_LOG ("Using fread()");
+ BRASERO_MEDIA_LOG ("Using fread()");
bytes_read = fread (buffer, 1, ISO9660_BLOCK_SIZE * blocks, src->data);
if (bytes_read != ISO9660_BLOCK_SIZE * blocks) {
int errsv = errno;
- BRASERO_BURN_LOG ("fread () failed (%s)", g_strerror (errsv));
+ BRASERO_MEDIA_LOG ("fread () failed (%s)", g_strerror (errsv));
g_set_error (error,
- BRASERO_BURN_ERROR,
- BRASERO_BURN_ERROR_GENERAL,
+ BRASERO_MEDIA_ERROR,
+ BRASERO_MEDIA_ERROR_GENERAL,
"%s",
g_strerror (errsv));
return FALSE;
@@ -118,7 +118,7 @@
BraseroScsiResult result;
BraseroScsiErrCode code;
- BRASERO_BURN_LOG ("Using READCD. Reading with track mode %i", src->data_mode);
+ BRASERO_MEDIA_LOG ("Using READCD. Reading with track mode %i", src->data_mode);
result = brasero_mmc1_read_block (src->data,
TRUE,
src->data_mode,
@@ -136,13 +136,13 @@
/* Give it a last chance if the code is BRASERO_SCSI_INVALID_TRACK_MODE */
if (code == BRASERO_SCSI_INVALID_TRACK_MODE) {
- BRASERO_BURN_LOG ("Wrong track mode autodetecting mode for block %i",
+ BRASERO_MEDIA_LOG ("Wrong track mode autodetecting mode for block %i",
src->position);
for (src->data_mode = BRASERO_SCSI_BLOCK_TYPE_CDDA;
src->data_mode <= BRASERO_SCSI_BLOCK_TYPE_MODE2_FORM2;
src->data_mode ++) {
- BRASERO_BURN_LOG ("Re-trying with track mode %i", src->data_mode);
+ BRASERO_MEDIA_LOG ("Re-trying with track mode %i", src->data_mode);
result = brasero_mmc1_read_block (src->data,
TRUE,
src->data_mode,
@@ -160,7 +160,7 @@
}
if (code != BRASERO_SCSI_INVALID_TRACK_MODE) {
- BRASERO_BURN_LOG ("Failed with error code %i", code);
+ BRASERO_MEDIA_LOG ("Failed with error code %i", code);
src->data_mode = BRASERO_SCSI_BLOCK_TYPE_ANY;
break;
}
@@ -168,8 +168,8 @@
}
g_set_error (error,
- BRASERO_BURN_ERROR,
- BRASERO_BURN_ERROR_GENERAL,
+ BRASERO_MEDIA_ERROR,
+ BRASERO_MEDIA_ERROR_GENERAL,
"%s",
brasero_scsi_strerror (code));
@@ -185,7 +185,7 @@
BraseroScsiResult result;
BraseroScsiErrCode code;
- BRASERO_BURN_LOG ("Using READ10");
+ BRASERO_MEDIA_LOG ("Using READ10");
result = brasero_sbc_read10_block (src->data,
src->position,
blocks,
@@ -197,12 +197,12 @@
return TRUE;
}
- BRASERO_BURN_LOG ("READ10 failed %s at %i",
+ BRASERO_MEDIA_LOG ("READ10 failed %s at %i",
brasero_scsi_strerror (code),
src->position);
g_set_error (error,
- BRASERO_BURN_ERROR,
- BRASERO_BURN_ERROR_GENERAL,
+ BRASERO_MEDIA_ERROR,
+ BRASERO_MEDIA_ERROR_GENERAL,
"%s",
brasero_scsi_strerror (code));
@@ -233,10 +233,10 @@
if (!file) {
int errsv = errno;
- BRASERO_BURN_LOG ("open () failed (%s)", g_strerror (errsv));
+ BRASERO_MEDIA_LOG ("open () failed (%s)", g_strerror (errsv));
g_set_error (error,
- BRASERO_BURN_ERROR,
- BRASERO_BURN_ERROR_GENERAL,
+ BRASERO_MEDIA_ERROR,
+ BRASERO_MEDIA_ERROR_GENERAL,
"%s",
g_strerror (errsv));
return FALSE;
@@ -262,10 +262,10 @@
if (dup_fd == -1) {
int errsv = errno;
- BRASERO_BURN_LOG ("dup () failed (%s)", g_strerror (errsv));
+ BRASERO_MEDIA_LOG ("dup () failed (%s)", g_strerror (errsv));
g_set_error (error,
- BRASERO_BURN_ERROR,
- BRASERO_BURN_ERROR_GENERAL,
+ BRASERO_MEDIA_ERROR,
+ BRASERO_MEDIA_ERROR_GENERAL,
"%s",
g_strerror (errsv));
return FALSE;
@@ -277,10 +277,10 @@
close (dup_fd);
- BRASERO_BURN_LOG ("fdopen () failed (%s)", g_strerror (errsv));
+ BRASERO_MEDIA_LOG ("fdopen () failed (%s)", g_strerror (errsv));
g_set_error (error,
- BRASERO_BURN_ERROR,
- BRASERO_BURN_ERROR_GENERAL,
+ BRASERO_MEDIA_ERROR,
+ BRASERO_MEDIA_ERROR_GENERAL,
"%s",
g_strerror (errsv));
return FALSE;
@@ -315,16 +315,16 @@
&size,
NULL);
if (result != BRASERO_SCSI_OK) {
- BRASERO_BURN_LOG ("GET CONFIGURATION failed for feature READ DVD. Using READCD.");
+ BRASERO_MEDIA_LOG ("GET CONFIGURATION failed for feature READ DVD. Using READCD.");
src->read = brasero_volume_source_readcd_device_handle;
}
else if (!hdr->desc->current) {
- BRASERO_BURN_LOG ("READ DVD not current. Using READCD.");
+ BRASERO_MEDIA_LOG ("READ DVD not current. Using READCD.");
src->read = brasero_volume_source_readcd_device_handle;
g_free (hdr);
}
else {
- BRASERO_BURN_LOG ("READ DVD current. Using READ10");
+ BRASERO_MEDIA_LOG ("READ DVD current. Using READ10");
src->read = brasero_volume_source_read10_device_handle;
g_free (hdr);
}
Modified: trunk/src/burn-volume.c
==============================================================================
--- trunk/src/burn-volume.c (original)
+++ trunk/src/burn-volume.c Wed Jan 7 14:28:22 2009
@@ -39,8 +39,8 @@
#include "burn-volume-source.h"
#include "burn-volume.h"
#include "burn-iso9660.h"
-#include "burn-basics.h"
-#include "burn-debug.h"
+#include "burn-media.h"
+#include "burn-units.h"
struct _BraseroTagDesc {
guint16 id;
@@ -118,10 +118,10 @@
&& memcmp (desc->id, "NSR03", 5) /* usually UDF */
&& memcmp (desc->id, "TEA01", 5)) {
g_set_error (error,
- BRASERO_BURN_ERROR,
- BRASERO_BURN_ERROR_IMAGE_INVALID,
+ BRASERO_MEDIA_ERROR,
+ BRASERO_MEDIA_ERROR_IMAGE_INVALID,
_("It does not appear to be a valid ISO image"));
- BRASERO_BURN_LOG ("Wrong volume descriptor, got %.5s", desc->id);
+ BRASERO_MEDIA_LOG ("Wrong volume descriptor, got %.5s", desc->id);
return FALSE;
}
Added: trunk/src/libbrasero-marshal.list
==============================================================================
--- (empty file)
+++ trunk/src/libbrasero-marshal.list Wed Jan 7 14:28:22 2009
@@ -0,0 +1 @@
+VOID:STRING,STRING
Modified: trunk/src/main.c
==============================================================================
--- trunk/src/main.c (original)
+++ trunk/src/main.c Wed Jan 7 14:28:22 2009
@@ -476,6 +476,7 @@
g_option_context_add_group (context, egg_sm_client_get_option_group ());
g_option_context_add_group (context, gtk_get_option_group (TRUE));
+ g_option_context_add_group (context, brasero_media_get_option_group ());
g_option_context_add_group (context, gst_init_get_option_group ());
if (g_option_context_parse (context, &argc, &argv, NULL) == FALSE) {
g_print (_("Please type %s --help to see all available options\n"), argv [0]);
Modified: trunk/src/plugins/cdrdao/Makefile.am
==============================================================================
--- trunk/src/plugins/cdrdao/Makefile.am (original)
+++ trunk/src/plugins/cdrdao/Makefile.am Wed Jan 7 14:28:22 2009
@@ -9,14 +9,14 @@
-DBRASERO_DATADIR=\"$(datadir)/brasero\" \
-DBRASERO_LIBDIR=\"$(libdir)\" \
$(DISABLE_DEPRECATED) \
- $(BRASERO_BASE_CFLAGS)
+ $(BRASERO_GLIB_CFLAGS)
#cdrdao
cdrdaodir = $(libdir)/brasero/plugins
cdrdao_LTLIBRARIES = libbrasero-cdrdao.la
libbrasero_cdrdao_la_SOURCES = burn-cdrdao.c burn-cdrdao.h \
burn-cdrdao-common.h
-libbrasero_cdrdao_la_LIBADD = $(BRASERO_BASE_LIBS)
+libbrasero_cdrdao_la_LIBADD = $(BRASERO_GLIB_LIBS)
libbrasero_cdrdao_la_LDFLAGS = -module -avoid-version
#toc2cue
@@ -24,5 +24,5 @@
toc2cue_LTLIBRARIES = libbrasero-toc2cue.la
libbrasero_toc2cue_la_SOURCES = burn-toc2cue.c burn-toc2cue.h \
burn-cdrdao-common.h
-libbrasero_toc2cue_la_LIBADD = $(BRASERO_BASE_LIBS)
+libbrasero_toc2cue_la_LIBADD = $(BRASERO_GLIB_LIBS)
libbrasero_toc2cue_la_LDFLAGS = -module -avoid-version
Modified: trunk/src/plugins/cdrkit/Makefile.am
==============================================================================
--- trunk/src/plugins/cdrkit/Makefile.am (original)
+++ trunk/src/plugins/cdrkit/Makefile.am Wed Jan 7 14:28:22 2009
@@ -9,14 +9,15 @@
-DBRASERO_DATADIR=\"$(datadir)/brasero\" \
-DBRASERO_LIBDIR=\"$(libdir)\" \
$(DISABLE_DEPRECATED) \
- $(BRASERO_BASE_CFLAGS)
+ $(BRASERO_GLIB_CFLAGS) \
+ $(BRASERO_GCONF_CFLAGS)
#wodim
wodimdir = $(libdir)/brasero/plugins
wodim_LTLIBRARIES = libbrasero-wodim.la
libbrasero_wodim_la_SOURCES = burn-wodim.c burn-wodim.h \
burn-cdrkit.h
-libbrasero_wodim_la_LIBADD = $(BRASERO_BASE_LIBS)
+libbrasero_wodim_la_LIBADD = $(BRASERO_GLIB_LIBS) $(BRASERO_GIO_LIBS)
libbrasero_wodim_la_LDFLAGS = -module -avoid-version
#genisoimage
@@ -24,7 +25,7 @@
genisoimage_LTLIBRARIES = libbrasero-genisoimage.la
libbrasero_genisoimage_la_SOURCES = burn-genisoimage.c burn-genisoimage.h \
burn-cdrkit.h
-libbrasero_genisoimage_la_LIBADD = $(BRASERO_BASE_LIBS)
+libbrasero_genisoimage_la_LIBADD = $(BRASERO_GLIB_LIBS)
libbrasero_genisoimage_la_LDFLAGS = -module -avoid-version
#readom
@@ -32,5 +33,5 @@
readom_LTLIBRARIES = libbrasero-readom.la
libbrasero_readom_la_SOURCES = burn-readom.c burn-readom.h \
burn-cdrkit.h
-libbrasero_readom_la_LIBADD = $(BRASERO_BASE_LIBS)
+libbrasero_readom_la_LIBADD = $(BRASERO_GLIB_LIBS)
libbrasero_readom_la_LDFLAGS = -module -avoid-version
Modified: trunk/src/plugins/cdrtools/Makefile.am
==============================================================================
--- trunk/src/plugins/cdrtools/Makefile.am (original)
+++ trunk/src/plugins/cdrtools/Makefile.am Wed Jan 7 14:28:22 2009
@@ -9,14 +9,15 @@
-DBRASERO_DATADIR=\"$(datadir)/brasero\" \
-DBRASERO_LIBDIR=\"$(libdir)\" \
$(DISABLE_DEPRECATED) \
- $(BRASERO_BASE_CFLAGS)
+ $(BRASERO_GLIB_CFLAGS) \
+ $(BRASERO_GCONF_CFLAGS)
#cdrecord
cdrecorddir = $(libdir)/brasero/plugins
cdrecord_LTLIBRARIES = libbrasero-cdrecord.la
libbrasero_cdrecord_la_SOURCES = burn-cdrecord.c burn-cdrecord.h \
burn-cdrtools.h
-libbrasero_cdrecord_la_LIBADD = $(BRASERO_BASE_LIBS)
+libbrasero_cdrecord_la_LIBADD = $(BRASERO_GLIB_LIBS) $(BRASERO_GCONF_LIBS)
libbrasero_cdrecord_la_LDFLAGS = -module -avoid-version
#mkisofs
@@ -24,7 +25,7 @@
mkisofs_LTLIBRARIES = libbrasero-mkisofs.la
libbrasero_mkisofs_la_SOURCES = burn-mkisofs.c burn-mkisofs.h \
burn-cdrtools.h
-libbrasero_mkisofs_la_LIBADD = $(BRASERO_BASE_LIBS)
+libbrasero_mkisofs_la_LIBADD = $(BRASERO_GLIB_LIBS)
libbrasero_mkisofs_la_LDFLAGS = -module -avoid-version
#readcd
@@ -32,5 +33,5 @@
readcd_LTLIBRARIES = libbrasero-readcd.la
libbrasero_readcd_la_SOURCES = burn-readcd.c burn-readcd.h \
burn-cdrtools.h
-libbrasero_readcd_la_LIBADD = $(BRASERO_BASE_LIBS)
+libbrasero_readcd_la_LIBADD = $(BRASERO_GLIB_LIBS)
libbrasero_readcd_la_LDFLAGS = -module -avoid-version
Modified: trunk/src/plugins/checksum/Makefile.am
==============================================================================
--- trunk/src/plugins/checksum/Makefile.am (original)
+++ trunk/src/plugins/checksum/Makefile.am Wed Jan 7 14:28:22 2009
@@ -10,7 +10,8 @@
-DBRASERO_DATADIR=\"$(datadir)/brasero\" \
-DBRASERO_LIBDIR=\"$(libdir)\" \
$(DISABLE_DEPRECATED) \
- $(BRASERO_BASE_CFLAGS)
+ $(BRASERO_GLIB_CFLAGS) \
+ $(BRASERO_GCONF_CFLAGS)
checksumdir = $(libdir)/brasero/plugins
checksum_LTLIBRARIES = libbrasero-checksum.la
@@ -18,12 +19,14 @@
burn-checksum-image.h
libbrasero_checksum_la_LDFLAGS = -module -avoid-version
-libbrasero_checksum_la_LIBADD = $(BRASERO_BASE_LIBS)
+libbrasero_checksum_la_LIBADD = $(BRASERO_GLIB_LIBS) $(BRASERO_GCONF_LIBS)
checksumfiledir = $(libdir)/brasero/plugins
checksumfile_LTLIBRARIES = libbrasero-checksum-file.la
libbrasero_checksum_file_la_SOURCES = burn-checksum-files.c \
- burn-checksum-files.h
+ burn-checksum-files.h\
+ burn-volume-read.c \
+ burn-volume-read.h
libbrasero_checksum_file_la_LDFLAGS = -module -avoid-version
-libbrasero_checksum_file_la_LIBADD = $(BRASERO_BASE_LIBS)
+libbrasero_checksum_file_la_LIBADD = $(BRASERO_GLIB_LIBS) $(BRASERO_GCONF_LIBS)
Modified: trunk/src/plugins/dvdauthor/Makefile.am
==============================================================================
--- trunk/src/plugins/dvdauthor/Makefile.am (original)
+++ trunk/src/plugins/dvdauthor/Makefile.am Wed Jan 7 14:28:22 2009
@@ -9,13 +9,13 @@
-DBRASERO_DATADIR=\"$(datadir)/brasero\" \
-DBRASERO_LIBDIR=\"$(libdir)\" \
$(DISABLE_DEPRECATED) \
- $(BRASERO_BASE_CFLAGS) \
+ $(BRASERO_GLIB_CFLAGS) \
$(BRASERO_LIBXML_CFLAGS)
dvdauthordir = $(libdir)/brasero/plugins
dvdauthor_LTLIBRARIES = libbrasero-dvdauthor.la
libbrasero_dvdauthor_la_SOURCES = burn-dvdauthor.c burn-dvdauthor.h
-libbrasero_dvdauthor_la_LIBADD = $(BRASERO_BASE_LIBS) $(BRASERO_LIBXML_LIBS)
+libbrasero_dvdauthor_la_LIBADD = $(BRASERO_GLIB_LIBS) $(BRASERO_LIBXML_LIBS)
libbrasero_dvdauthor_la_LDFLAGS = -module -avoid-version
Modified: trunk/src/plugins/dvdcss/Makefile.am
==============================================================================
--- trunk/src/plugins/dvdcss/Makefile.am (original)
+++ trunk/src/plugins/dvdcss/Makefile.am Wed Jan 7 14:28:22 2009
@@ -10,11 +10,11 @@
-DBRASERO_DATADIR=\"$(datadir)/brasero\" \
-DBRASERO_LIBDIR=\"$(libdir)\" \
$(DISABLE_DEPRECATED) \
- $(BRASERO_BASE_CFLAGS)
+ $(BRASERO_GLIB_CFLAGS)
plugin_LTLIBRARIES = libbrasero-dvdcss.la
libbrasero_dvdcss_la_SOURCES = burn-dvdcss.c burn-dvdcss.h \
burn-dvdcss-private.h
-libbrasero_dvdcss_la_LIBADD = $(BRASERO_BASE_LIBS)
+libbrasero_dvdcss_la_LIBADD = $(BRASERO_GLIB_LIBS)
libbrasero_dvdcss_la_LDFLAGS = -module -avoid-version
Modified: trunk/src/plugins/growisofs/Makefile.am
==============================================================================
--- trunk/src/plugins/growisofs/Makefile.am (original)
+++ trunk/src/plugins/growisofs/Makefile.am Wed Jan 7 14:28:22 2009
@@ -9,19 +9,19 @@
-DBRASERO_DATADIR=\"$(datadir)/brasero\" \
-DBRASERO_LIBDIR=\"$(libdir)\" \
$(DISABLE_DEPRECATED) \
- $(BRASERO_BASE_CFLAGS)
+ $(BRASERO_GLIB_CFLAGS)
#growisofs
growisofsdir = $(libdir)/brasero/plugins
growisofs_LTLIBRARIES = libbrasero-growisofs.la
libbrasero_growisofs_la_SOURCES = burn-growisofs.c burn-growisofs.h \
burn-growisofs-common.h
-libbrasero_growisofs_la_LIBADD = $(BRASERO_BASE_LIBS)
+libbrasero_growisofs_la_LIBADD = $(BRASERO_GLIB_LIBS)
libbrasero_growisofs_la_LDFLAGS = -module -avoid-version
#dvdrwformat
dvdrwformatdir = $(libdir)/brasero/plugins
dvdrwformat_LTLIBRARIES = libbrasero-dvdrwformat.la
libbrasero_dvdrwformat_la_SOURCES = burn-dvd-rw-format.c burn-dvd-rw-format.h
-libbrasero_dvdrwformat_la_LIBADD = $(BRASERO_BASE_LIBS)
+libbrasero_dvdrwformat_la_LIBADD = $(BRASERO_GLIB_LIBS)
libbrasero_dvdrwformat_la_LDFLAGS = -module -avoid-version
Modified: trunk/src/plugins/libburnia/Makefile.am
==============================================================================
--- trunk/src/plugins/libburnia/Makefile.am (original)
+++ trunk/src/plugins/libburnia/Makefile.am Wed Jan 7 14:28:22 2009
@@ -11,7 +11,7 @@
$(DISABLE_DEPRECATED) \
$(BRASERO_LIBISOFS_CFLAGS) \
$(BRASERO_LIBBURN_CFLAGS) \
- $(BRASERO_BASE_CFLAGS)
+ $(BRASERO_GLIB_CFLAGS)
#libburn
libburndir = $(libdir)/brasero/plugins
@@ -21,7 +21,7 @@
burn-libburn-common.c \
burn-libburn-common.h \
burn-libburnia.h
-libbrasero_libburn_la_LIBADD = $(BRASERO_BASE_LIBS) $(BRASERO_LIBBURNIA_LIBS)
+libbrasero_libburn_la_LIBADD = $(BRASERO_GLIB_LIBS) $(BRASERO_LIBBURNIA_LIBS)
libbrasero_libburn_la_LDFLAGS = -module -avoid-version
#libisofs (apparently libisofs needs one libburn function)
@@ -30,5 +30,5 @@
libbrasero_libisofs_la_SOURCES = burn-libisofs.c burn-libisofs.h \
burn-libburn-common.c burn-libburn-common.h \
burn-libburnia.h
-libbrasero_libisofs_la_LIBADD = $(BRASERO_BASE_LIBS) $(BRASERO_LIBBURNIA_LIBS)
+libbrasero_libisofs_la_LIBADD = $(BRASERO_GLIB_LIBS) $(BRASERO_LIBBURNIA_LIBS)
libbrasero_libisofs_la_LDFLAGS = -module -avoid-version
Modified: trunk/src/plugins/local-track/Makefile.am
==============================================================================
--- trunk/src/plugins/local-track/Makefile.am (original)
+++ trunk/src/plugins/local-track/Makefile.am Wed Jan 7 14:28:22 2009
@@ -9,16 +9,16 @@
-DBRASERO_SYSCONFDIR=\"$(sysconfdir)\" \
-DBRASERO_DATADIR=\"$(datadir)/brasero\" \
-DBRASERO_LIBDIR=\"$(libdir)\" \
- $(DISABLE_DEPRECATED) \
- $(BRASERO_BASE_CFLAGS) \
- $(BRASERO_GNOMEVFS_CFLAGS)
+ $(DISABLE_DEPRECATED) \
+ $(BRASERO_GLIB_CFLAGS) \
+ $(BRASERO_GIO_CFLAGS)
#local-track
local_trackdir = $(libdir)/brasero/plugins
local_track_LTLIBRARIES = libbrasero-local-track.la
libbrasero_local_track_la_SOURCES = burn-local-image.c burn-local-image.h
-libbrasero_local_track_la_LIBADD = $(BRASERO_BASE_LIBS)
+libbrasero_local_track_la_LIBADD = $(BRASERO_GLIB_LIBS) $(BRASERO_GIO_LIBS)
libbrasero_local_track_la_LDFLAGS = -module -avoid-version
#burn-uri
@@ -26,5 +26,5 @@
burn_uri_LTLIBRARIES = libbrasero-burn-uri.la
libbrasero_burn_uri_la_SOURCES = burn-uri.c burn-uri.h
-libbrasero_burn_uri_la_LIBADD = $(BRASERO_BASE_LIBS)
+libbrasero_burn_uri_la_LIBADD = $(BRASERO_GLIB_LIBS) $(BRASERO_GIO_LIBS)
libbrasero_burn_uri_la_LDFLAGS = -module -avoid-version
Modified: trunk/src/plugins/transcode/Makefile.am
==============================================================================
--- trunk/src/plugins/transcode/Makefile.am (original)
+++ trunk/src/plugins/transcode/Makefile.am Wed Jan 7 14:28:22 2009
@@ -9,26 +9,26 @@
-DBRASERO_DATADIR=\"$(datadir)/brasero\" \
-DBRASERO_LIBDIR=\"$(libdir)\" \
$(DISABLE_DEPRECATED) \
- $(BRASERO_BASE_CFLAGS) \
+ $(BRASERO_GLIB_CFLAGS) \
$(BRASERO_GSTREAMER_CFLAGS)
transcodedir = $(libdir)/brasero/plugins
transcode_LTLIBRARIES = libbrasero-transcode.la
libbrasero_transcode_la_SOURCES = burn-transcode.c burn-transcode.h burn-normalize.h
-libbrasero_transcode_la_LIBADD = $(BRASERO_BASE_LIBS) $(BRASERO_GSTREAMER_CFLAGS)
+libbrasero_transcode_la_LIBADD = $(BRASERO_GLIB_LIBS) $(BRASERO_GSTREAMER_CFLAGS)
libbrasero_transcode_la_LDFLAGS = -module -avoid-version
normalizedir = $(libdir)/brasero/plugins
normalize_LTLIBRARIES = libbrasero-normalize.la
libbrasero_normalize_la_SOURCES = burn-normalize.c burn-normalize.h
-libbrasero_normalize_la_LIBADD = $(BRASERO_BASE_LIBS) $(BRASERO_GSTREAMER_CFLAGS)
+libbrasero_normalize_la_LIBADD = $(BRASERO_GLIB_LIBS) $(BRASERO_GSTREAMER_CFLAGS)
libbrasero_normalize_la_LDFLAGS = -module -avoid-version
vobdir = $(libdir)/brasero/plugins
vob_LTLIBRARIES = libbrasero-vob.la
libbrasero_vob_la_SOURCES = burn-vob.c burn-vob.h
-libbrasero_vob_la_LIBADD = $(BRASERO_BASE_LIBS) $(BRASERO_GSTREAMER_CFLAGS)
+libbrasero_vob_la_LIBADD = $(BRASERO_GLIB_LIBS) $(BRASERO_GSTREAMER_CFLAGS)
libbrasero_vob_la_LDFLAGS = -module -avoid-version
Modified: trunk/src/plugins/vcdimager/Makefile.am
==============================================================================
--- trunk/src/plugins/vcdimager/Makefile.am (original)
+++ trunk/src/plugins/vcdimager/Makefile.am Wed Jan 7 14:28:22 2009
@@ -8,14 +8,14 @@
-DBRASERO_SYSCONFDIR=\"$(sysconfdir)\" \
-DBRASERO_DATADIR=\"$(datadir)/brasero\" \
-DBRASERO_LIBDIR=\"$(libdir)\" \
- $(DISABLE_DEPRECATED) \
- $(BRASERO_BASE_CFLAGS) \
+ $(DISABLE_DEPRECATED) \
+ $(BRASERO_GLIB_CFLAGS) \
$(BRASERO_LIBXML_CFLAGS)
vcdimagerdir = $(libdir)/brasero/plugins
vcdimager_LTLIBRARIES = libbrasero-vcdimager.la
libbrasero_vcdimager_la_SOURCES = burn-vcdimager.c burn-vcdimager.h
-libbrasero_vcdimager_la_LIBADD = $(BRASERO_BASE_LIBS) $(BRASERO_LIBXML_LIBS)
+libbrasero_vcdimager_la_LIBADD = $(BRASERO_GLIB_LIBS) $(BRASERO_LIBXML_LIBS)
libbrasero_vcdimager_la_LDFLAGS = -module -avoid-version
Modified: trunk/src/scsi-cam.c
==============================================================================
--- trunk/src/scsi-cam.c (original)
+++ trunk/src/scsi-cam.c Wed Jan 7 14:28:22 2009
@@ -36,7 +36,6 @@
#include <sys/ioctl.h>
#include "scsi-command.h"
-#include "burn-debug.h"
#include "scsi-utils.h"
#include "scsi-error.h"
#include "scsi-sense-data.h"
Modified: trunk/src/scsi-error.c
==============================================================================
--- trunk/src/scsi-error.c (original)
+++ trunk/src/scsi-error.c Wed Jan 7 14:28:22 2009
@@ -26,7 +26,7 @@
#include <glib.h>
#include <glib/gi18n-lib.h>
-#include "burn-basics.h"
+#include "burn-media.h"
#include "scsi-error.h"
static const gchar *error_string [] = { N_("Unknown error"),
@@ -60,8 +60,8 @@
brasero_scsi_set_error (GError **error, BraseroScsiErrCode code)
{
g_set_error (error,
- BRASERO_BURN_ERROR,
- BRASERO_BURN_ERROR_GENERAL,
+ BRASERO_MEDIA_ERROR,
+ BRASERO_MEDIA_ERROR_GENERAL,
"%s",
brasero_scsi_strerror (code));
}
Modified: trunk/src/scsi-get-configuration.c
==============================================================================
--- trunk/src/scsi-get-configuration.c (original)
+++ trunk/src/scsi-get-configuration.c Wed Jan 7 14:28:22 2009
@@ -28,8 +28,6 @@
#include <glib.h>
-#include "burn-debug.h"
-
#include "scsi-error.h"
#include "scsi-utils.h"
#include "scsi-base.h"
@@ -116,11 +114,11 @@
/* NOTE: if size is not valid use the maximum possible size */
if ((request_size - sizeof (hdr)) % 8) {
- BRASERO_BURN_LOG ("Unaligned data (%i) setting to max (65530)", request_size);
+ BRASERO_MEDIA_LOG ("Unaligned data (%i) setting to max (65530)", request_size);
request_size = 65530;
}
else if (request_size <= sizeof (hdr)) {
- BRASERO_BURN_LOG ("Undersized data (%i) setting to max (65530)", request_size);
+ BRASERO_MEDIA_LOG ("Undersized data (%i) setting to max (65530)", request_size);
request_size = 65530;
}
@@ -140,7 +138,7 @@
sizeof (hdr.len);
if (buffer_size != request_size)
- BRASERO_BURN_LOG ("Sizes mismatch asked %i / received %i",
+ BRASERO_MEDIA_LOG ("Sizes mismatch asked %i / received %i",
request_size,
buffer_size);
Modified: trunk/src/scsi-get-performance.c
==============================================================================
--- trunk/src/scsi-get-performance.c (original)
+++ trunk/src/scsi-get-performance.c Wed Jan 7 14:28:22 2009
@@ -28,8 +28,6 @@
#include <glib.h>
-#include "burn-debug.h"
-
#include "scsi-error.h"
#include "scsi-utils.h"
#include "scsi-command.h"
@@ -114,15 +112,15 @@
/* ... check the request size ... */
if (request_size > 2048) {
- BRASERO_BURN_LOG ("Oversized data (%i) setting to max (2048)", request_size);
+ BRASERO_MEDIA_LOG ("Oversized data (%i) setting to max (2048)", request_size);
request_size = 2048;
}
else if ((request_size - sizeof (hdr)) % sizeof_descriptors) {
- BRASERO_BURN_LOG ("Unaligned data (%i) setting to max (2048)", request_size);
+ BRASERO_MEDIA_LOG ("Unaligned data (%i) setting to max (2048)", request_size);
request_size = 2048;
}
else if (request_size < sizeof (hdr)) {
- BRASERO_BURN_LOG ("Undersized data (%i) setting to max (2048)", request_size);
+ BRASERO_MEDIA_LOG ("Undersized data (%i) setting to max (2048)", request_size);
request_size = 2048;
}
@@ -190,7 +188,7 @@
/* Strangely some drives returns a buffer size that is bigger
* than the one they returned on the first time. So redo whole
* operation again but this time with the new size we got */
- BRASERO_BURN_LOG ("Sizes mismatch asked %i / received %i\n"
+ BRASERO_MEDIA_LOG ("Sizes mismatch asked %i / received %i\n"
"Re-issuing the command with received size",
request_size,
buffer_size);
@@ -208,7 +206,7 @@
g_free (tmp_hdr);
}
else if (request_size > buffer_size)
- BRASERO_BURN_LOG ("Sizes mismatch asked %i / received %i",
+ BRASERO_MEDIA_LOG ("Sizes mismatch asked %i / received %i",
request_size,
buffer_size);
*data = buffer;
Modified: trunk/src/scsi-mode-sense.c
==============================================================================
--- trunk/src/scsi-mode-sense.c (original)
+++ trunk/src/scsi-mode-sense.c Wed Jan 7 14:28:22 2009
@@ -114,7 +114,7 @@
BRASERO_SET_16 (cdb->alloc_len, sizeof (header));
bzero (&header, sizeof (header));
- BRASERO_BURN_LOG ("Getting page size");
+ BRASERO_MEDIA_LOG ("Getting page size");
res = brasero_scsi_command_issue_sync (cdb, &header, sizeof (header), error);
if (res)
goto end;
@@ -148,7 +148,7 @@
buffer = (BraseroScsiModeData *) g_new0 (uchar, request_size);
/* ... re-issue the command */
- BRASERO_BURN_LOG ("Getting page (size = %i)", request_size);
+ BRASERO_MEDIA_LOG("Getting page (size = %i)", request_size);
BRASERO_SET_16 (cdb->alloc_len, request_size);
res = brasero_scsi_command_issue_sync (cdb, buffer, request_size, error);
Modified: trunk/src/scsi-read-disc-info.c
==============================================================================
--- trunk/src/scsi-read-disc-info.c (original)
+++ trunk/src/scsi-read-disc-info.c Wed Jan 7 14:28:22 2009
@@ -28,8 +28,6 @@
#include <glib.h>
-#include "burn-debug.h"
-
#include "scsi-error.h"
#include "scsi-utils.h"
#include "scsi-base.h"
@@ -127,7 +125,7 @@
sizeof (buffer->len);
if (request_size != buffer_size)
- BRASERO_BURN_LOG ("Sizes mismatch asked %i / received %i",
+ BRASERO_MEDIA_LOG ("Sizes mismatch asked %i / received %i",
request_size,
buffer_size);
Modified: trunk/src/scsi-read-toc-pma-atip.c
==============================================================================
--- trunk/src/scsi-read-toc-pma-atip.c (original)
+++ trunk/src/scsi-read-toc-pma-atip.c Wed Jan 7 14:28:22 2009
@@ -124,11 +124,11 @@
/* NOTE: if size is not valid use the maximum possible size */
if ((request_size - sizeof (hdr)) % desc_size) {
- BRASERO_BURN_LOG ("Unaligned data (%i) setting to max (65530)", request_size);
+ BRASERO_MEDIA_LOG ("Unaligned data (%i) setting to max (65530)", request_size);
request_size = 65530;
}
else if (request_size - sizeof (hdr) < desc_size) {
- BRASERO_BURN_LOG ("Undersized data (%i) setting to max (65530)", request_size);
+ BRASERO_MEDIA_LOG ("Undersized data (%i) setting to max (65530)", request_size);
request_size = 65530;
}
Modified: trunk/src/scsi-read-track-information.c
==============================================================================
--- trunk/src/scsi-read-track-information.c (original)
+++ trunk/src/scsi-read-track-information.c Wed Jan 7 14:28:22 2009
@@ -28,8 +28,6 @@
#include <glib.h>
-#include "burn-debug.h"
-
#include "scsi-error.h"
#include "scsi-utils.h"
#include "scsi-base.h"
@@ -118,19 +116,19 @@
if (datasize > *size) {
/* it must not be over sizeof (BraseroScsiTrackInfo) */
if (datasize > sizeof (BraseroScsiTrackInfo)) {
- BRASERO_BURN_LOG ("Oversized data received (%i) setting to %i", datasize, *size);
+ BRASERO_MEDIA_LOG ("Oversized data received (%i) setting to %i", datasize, *size);
datasize = *size;
}
else
*size = datasize;
}
else if (*size < datasize) {
- BRASERO_BURN_LOG ("Oversized data required (%i) setting to %i", *size, datasize);
+ BRASERO_MEDIA_LOG ("Oversized data required (%i) setting to %i", *size, datasize);
*size = datasize;
}
}
else {
- BRASERO_BURN_LOG ("Undersized data received (%i) setting to %i", datasize, *size);
+ BRASERO_MEDIA_LOG ("Undersized data received (%i) setting to %i", datasize, *size);
datasize = *size;
}
@@ -141,7 +139,7 @@
if (res == BRASERO_SCSI_OK) {
if (datasize != BRASERO_GET_16 (info->len) + sizeof (info->len))
- BRASERO_BURN_LOG ("Sizes mismatch asked %i / received %i",
+ BRASERO_MEDIA_LOG ("Sizes mismatch asked %i / received %i",
datasize,
BRASERO_GET_16 (info->len) + sizeof (info->len));
Modified: trunk/src/scsi-sense-data.c
==============================================================================
--- trunk/src/scsi-sense-data.c (original)
+++ trunk/src/scsi-sense-data.c Wed Jan 7 14:28:22 2009
@@ -75,10 +75,10 @@
return;
/* Print that in a more sensible way */
- BRASERO_BURN_LOG ("SK=0x%02x ASC=0x%02x ASCQ=0x%02x",
- SENSE_DATA_KEY (sense_data),
- SENSE_DATA_ASC (sense_data),
- SENSE_DATA_ASCQ (sense_data));
+ BRASERO_MEDIA_LOG ("SK=0x%02x ASC=0x%02x ASCQ=0x%02x",
+ SENSE_DATA_KEY (sense_data),
+ SENSE_DATA_ASC (sense_data),
+ SENSE_DATA_ASCQ (sense_data));
printf ("Sense key: 0x%02x ", sense_data [0]);
for (i = 1; i < BRASERO_SENSE_DATA_SIZE; i ++)
Modified: trunk/src/scsi-sg.c
==============================================================================
--- trunk/src/scsi-sg.c (original)
+++ trunk/src/scsi-sg.c Wed Jan 7 14:28:22 2009
@@ -39,7 +39,6 @@
#include <scsi/sg.h>
#include "scsi-command.h"
-#include "burn-debug.h"
#include "scsi-utils.h"
#include "scsi-error.h"
#include "scsi-sense-data.h"
Modified: trunk/src/scsi-uscsi.c
==============================================================================
--- trunk/src/scsi-uscsi.c (original)
+++ trunk/src/scsi-uscsi.c Wed Jan 7 14:28:22 2009
@@ -38,12 +38,11 @@
#include <sys/scsi/impl/uscsi.h>
#include "scsi-command.h"
-#include "burn-debug.h"
#include "scsi-utils.h"
#include "scsi-error.h"
#include "scsi-sense-data.h"
-#define DEBUG BRASERO_BURN_LOG
+#define DEBUG BRASERO_MEDIA_LOG
struct _BraseroDeviceHandle {
int fd;
Modified: trunk/src/scsi-utils.h
==============================================================================
--- trunk/src/scsi-utils.h (original)
+++ trunk/src/scsi-utils.h Wed Jan 7 14:28:22 2009
@@ -25,8 +25,8 @@
#include <errno.h>
#include <glib.h>
+#include "burn-media.h"
#include "scsi-base.h"
-#include "burn-debug.h"
#ifndef _BURN_UTILS_H
#define _BURN_UTILS_H
@@ -55,11 +55,11 @@
{ \
if (code == BRASERO_SCSI_ERRNO) { \
int errsv = errno; \
- BRASERO_BURN_LOG ("SCSI command error: %s", \
- g_strerror (errsv)); \
+ BRASERO_MEDIA_LOG ("SCSI command error: %s", \
+ g_strerror (errsv)); \
} else { \
- BRASERO_BURN_LOG ("SCSI command error: %s", \
- brasero_scsi_strerror (code)); \
+ BRASERO_MEDIA_LOG ("SCSI command error: %s", \
+ brasero_scsi_strerror (code)); \
} \
if (err) \
*(err) = code; \
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]