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
508
brasero_burn_session_get_file_complement (BraseroBurnSession *self,
509
BraseroImageFormat format,
509
brasero_burn_session_get_image_complement (BraseroBurnSession *self,
510
BraseroImageFormat format,
512
513
gchar *retval = NULL;
513
514
BraseroBurnSessionPrivate *priv;
515
516
priv = BRASERO_BURN_SESSION_PRIVATE (self);
517
518
if (format == BRASERO_IMAGE_FORMAT_CLONE) {
518
if (g_str_has_suffix (path, ".toc"))
519
retval = g_strdup_printf ("%.*sraw",
519
if (g_str_has_suffix (path, ".raw"))
520
retval = g_strdup_printf ("%.*stoc",
520
521
strlen (path) - 3,
523
retval = g_strdup_printf ("%s.raw", path);
524
retval = g_strdup_printf ("%s.toc", path);
525
526
else if (format == BRASERO_IMAGE_FORMAT_CUE) {
526
if (g_str_has_suffix (path, ".cue"))
527
retval = g_strdup_printf ("%.*sbin",
527
if (g_str_has_suffix (path, ".bin"))
528
retval = g_strdup_printf ("%.*scue",
528
529
strlen (path) - 3,
531
532
retval = g_strdup_printf ("%s.bin", path);
533
534
else if (format == BRASERO_IMAGE_FORMAT_CDRDAO) {
534
if (g_str_has_suffix (path, ".toc"))
535
retval = g_strdup_printf ("%.*sbin",
535
if (g_str_has_suffix (path, ".bin"))
536
retval = g_strdup_printf ("%.*stoc",
536
537
strlen (path) - 3,
539
retval = g_strdup_printf ("%s.bin", path);
540
retval = g_strdup_printf ("%s.toc", path);
657
658
return BRASERO_BURN_ERR;
660
/* output paths were set so test them and returns them if OK */
661
if (priv->settings->image) {
662
result = brasero_burn_session_file_test (self,
663
priv->settings->image,
665
if (result != BRASERO_BURN_OK) {
666
BRASERO_BURN_LOG ("Problem with image existence");
671
BRASERO_BURN_LOG ("no output specified");
675
BRASERO_BURN_ERROR_GENERAL,
676
_("no output specified"));
677
return BRASERO_BURN_ERR;
680
if (priv->settings->toc) {
681
result = brasero_burn_session_file_test (self,
684
if (result != BRASERO_BURN_OK) {
685
BRASERO_BURN_LOG ("Problem with toc existence");
691
*image = g_strdup (priv->settings->image);
662
/* output paths were set so test them and returns them if OK */
663
if (priv->settings->image) {
664
result = brasero_burn_session_file_test (self,
665
priv->settings->image,
667
if (result != BRASERO_BURN_OK) {
668
BRASERO_BURN_LOG ("Problem with image existence");
672
*image = g_strdup (priv->settings->image);
674
else if (priv->settings->toc) {
677
/* get the cuesheet complement */
678
complement = brasero_image_format_get_complement (priv->settings->format,
679
priv->settings->toc);
681
BRASERO_BURN_LOG ("no output specified");
685
BRASERO_BURN_ERROR_GENERAL,
686
_("no output specified"));
687
return BRASERO_BURN_ERR;
690
result = brasero_burn_session_file_test (self,
693
if (result != BRASERO_BURN_OK) {
694
BRASERO_BURN_LOG ("Problem with image existence");
701
BRASERO_BURN_LOG ("no output specified");
705
BRASERO_BURN_ERROR_GENERAL,
706
_("no output specified"));
707
return BRASERO_BURN_ERR;
712
if (priv->settings->toc) {
713
result = brasero_burn_session_file_test (self,
716
if (result != BRASERO_BURN_OK) {
717
BRASERO_BURN_LOG ("Problem with toc existence");
693
722
*toc = g_strdup (priv->settings->toc);
695
725
return BRASERO_BURN_OK;
769
799
return BRASERO_BURN_OK;
773
brasero_burn_session_set_image_output (BraseroBurnSession *self,
774
BraseroImageFormat format,
777
BraseroBurnSessionPrivate *priv;
778
BraseroBurnResult result;
783
g_return_val_if_fail (BRASERO_IS_BURN_SESSION (self), BRASERO_BURN_ERR);
785
priv = BRASERO_BURN_SESSION_PRIVATE (self);
787
/* find the file complement */
788
complement = brasero_burn_session_get_file_complement (self,
792
brasero_burn_session_set_image_output_retval (self,
799
result = brasero_burn_session_set_image_output_full (self,
957
950
if (format != BRASERO_IMAGE_FORMAT_BIN) {
958
951
/* toc tmp file */
959
complement = brasero_burn_session_get_file_complement (self, format, path);
952
complement = brasero_burn_session_get_image_complement (self, format, path);
960
953
if (complement) {
961
954
result = brasero_burn_session_file_test (self,
1097
1090
BraseroBurnResult
1091
brasero_burn_session_tag_remove (BraseroBurnSession *self,
1094
BraseroBurnSessionPrivate *priv;
1096
g_return_val_if_fail (BRASERO_IS_BURN_SESSION (self), BRASERO_BURN_ERR);
1098
priv = BRASERO_BURN_SESSION_PRIVATE (self);
1100
return BRASERO_BURN_ERR;
1102
g_hash_table_remove (priv->tags, tag);
1103
return BRASERO_BURN_OK;
1098
1107
brasero_burn_session_tag_add (BraseroBurnSession *self,
1099
1108
const gchar *tag,
1438
1447
if (!priv->session)
1442
message = g_strdup_vprintf (format, arg_list);
1444
message = g_strdup (format);
1450
message = g_strdup_vprintf (format, arg_list);
1446
1452
/* we also need to validate the messages to be in UTF-8 */
1447
1453
if (!g_utf8_validate (message, -1, (const gchar**) &offending))
1604
1610
g_strdelimit (disc_type, " +()", '_');
1612
display_name = display_name ? display_name : "";
1613
disc_type = disc_type ? disc_type : "";
1606
1615
switch (brasero_burn_session_get_input_type (self, NULL)) {
1607
1616
case BRASERO_TRACK_TYPE_NONE:
1608
1617
key = g_strdup_printf ("%s/%s/none_%s/%s",