7
7
***************************************************************************/
10
* This program is free software; you can redistribute it and/or modify
10
* Brasero is free software; you can redistribute it and/or modify
11
11
* it under the terms of the GNU General Public License as published by
12
12
* the Free Software Foundation; either version 2 of the License, or
13
13
* (at your option) any later version.
15
* This program is distributed in the hope that it will be useful,
15
* Brasero is distributed in the hope that it will be useful,
16
16
* but WITHOUT ANY WARRANTY; without even the implied warranty of
17
17
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
18
* GNU Library General Public License for more details.
20
20
* You should have received a copy of the GNU General Public License
21
* along with this program; if not, write to the Free Software
22
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21
* along with this program; if not, write to:
22
* The Free Software Foundation, Inc.,
23
* 51 Franklin Street, Fifth Floor
24
* Boston, MA 02110-1301, USA.
25
27
#ifdef HAVE_CONFIG_H
65
69
brasero_job_get_output_type (BRASERO_JOB (readom), &output);
66
70
if (output.subtype.img_format == BRASERO_IMAGE_FORMAT_BIN)
67
written = sector * 2048;
71
written = (gint64) ((gint64) sector * 2048ULL);
68
72
else if (output.subtype.img_format == BRASERO_IMAGE_FORMAT_CLONE)
69
written = sector * 2448;
73
written = (gint64) ((gint64) sector * 2448ULL);
71
written = sector * 2048;
75
written = (gint64) ((gint64) sector * 2048ULL);
73
77
brasero_job_set_written_track (BRASERO_JOB (readom), written);
84
88
else if (strstr (line, "Device not ready.")) {
85
89
brasero_job_error (BRASERO_JOB (readom),
86
90
g_error_new (BRASERO_BURN_ERROR,
87
BRASERO_BURN_ERROR_BUSY_DRIVE,
88
_("the drive is not ready")));
90
else if (strstr (line, "Device or resource busy")) {
91
if (!strstr (line, "retrying in")) {
92
brasero_job_error (BRASERO_JOB (readom),
93
g_error_new (BRASERO_BURN_ERROR,
94
BRASERO_BURN_ERROR_BUSY_DRIVE,
95
_("you don't seem to have the required permissions to access the drive")));
91
BRASERO_BURN_ERROR_DRIVE_BUSY,
92
_("The drive is busy")));
98
94
else if (strstr (line, "Cannot open SCSI driver.")) {
99
95
brasero_job_error (BRASERO_JOB (readom),
100
96
g_error_new (BRASERO_BURN_ERROR,
101
BRASERO_BURN_ERROR_BUSY_DRIVE,
102
_("you don't seem to have the required permissions to access the drive")));
97
BRASERO_BURN_ERROR_PERMISSION,
98
_("You do not have the required permissions to use this drive")));
104
100
else if (strstr (line, "Cannot send SCSI cmd via ioctl")) {
105
101
brasero_job_error (BRASERO_JOB (readom),
106
102
g_error_new (BRASERO_BURN_ERROR,
107
BRASERO_BURN_ERROR_SCSI_IOCTL,
108
_("you don't seem to have the required permissions to access the drive")));
103
BRASERO_BURN_ERROR_PERMISSION,
104
_("You do not have the required permissions to use this drive")));
106
/* we scan for this error as in this case readcd returns success */
107
else if (sscanf (line, "Input/output error. Error on sector %d not corrected. Total of %d error", &dummy1, &dummy2) == 2) {
108
brasero_job_error (BRASERO_JOB (process),
109
g_error_new (BRASERO_BURN_ERROR,
110
BRASERO_BURN_ERROR_GENERAL,
111
_("An internal error occured")));
113
else if (strstr (line, "No space left on device")) {
114
brasero_job_error (BRASERO_JOB (readom),
115
g_error_new (BRASERO_BURN_ERROR,
116
BRASERO_BURN_ERROR_DISK_SPACE,
117
_("There is no space left on the device")));
111
120
return BRASERO_BURN_OK;
119
128
gint64 nb_blocks;
120
129
BraseroTrack *track;
130
GValue *value = NULL;
121
131
BraseroTrackType output;
123
133
brasero_job_get_current_track (BRASERO_JOB (readom), &track);
124
134
brasero_job_get_output_type (BRASERO_JOB (readom), &output);
136
brasero_track_tag_lookup (track,
137
BRASERO_TRACK_MEDIUM_ADDRESS_START_TAG,
142
/* we were given an address to start */
143
start = g_value_get_uint64 (value);
145
/* get the length now */
147
brasero_track_tag_lookup (track,
148
BRASERO_TRACK_MEDIUM_ADDRESS_END_TAG,
151
end = g_value_get_uint64 (value);
153
BRASERO_JOB_LOG (readom,
154
"reading from sector %lli to %lli",
157
g_ptr_array_add (argv, g_strdup_printf ("-sectors=%lli-%lli",
126
161
/* 0 means all disc, -1 problem */
127
if (brasero_track_get_drive_track (track) > 0) {
162
else if (brasero_track_get_drive_track (track) > 0) {
129
164
BraseroMedium *medium;
218
GValue *value = NULL;
183
219
BraseroTrackType output;
184
220
BraseroTrack *track = NULL;
186
222
brasero_job_get_current_track (BRASERO_JOB (self), &track);
187
223
brasero_job_get_output_type (BRASERO_JOB (self), &output);
189
if (brasero_track_get_drive_track (track) > 0) {
225
brasero_track_tag_lookup (track,
226
BRASERO_TRACK_MEDIUM_ADDRESS_START_TAG,
231
/* we were given an address to start */
232
start = g_value_get_uint64 (value);
234
/* get the length now */
236
brasero_track_tag_lookup (track,
237
BRASERO_TRACK_MEDIUM_ADDRESS_END_TAG,
240
end = g_value_get_uint64 (value);
241
blocks = end - start;
243
else if (brasero_track_get_drive_track (track) > 0) {
190
244
BraseroMedium *medium;
192
246
medium = brasero_track_get_medium_source (track);
343
398
static BraseroBurnResult
344
399
brasero_readom_export_caps (BraseroPlugin *plugin, gchar **error)
401
BraseroBurnResult result;
350
405
brasero_plugin_define (plugin,
352
_("use readom to image CDs"),
407
_("Use readom to create disc images"),
353
408
"Philippe Rouquier",
356
/* First see if this plugin can be used, i.e. if readom is in
358
prog_name = g_find_program_in_path ("readom");
360
*error = g_strdup (_("readom could not be found in the path"));
361
return BRASERO_BURN_ERR;
411
/* First see if this plugin can be used */
412
result = brasero_process_check_path ("readom", error);
413
if (result != BRASERO_BURN_OK)
365
416
/* that's for clone mode only The only one to copy audio */
366
417
output = brasero_caps_image_new (BRASERO_PLUGIN_IO_ACCEPT_FILE,