1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ 2 /* 3 * Libbrasero-burn 4 * Copyright (C) Philippe Rouquier 2005-2009 <bonfire-app@wanadoo.fr> 5 * 6 * Libbrasero-burn is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or 9 * (at your option) any later version. 10 * 11 * The Libbrasero-burn authors hereby grant permission for non-GPL compatible 12 * GStreamer plugins to be used and distributed together with GStreamer 13 * and Libbrasero-burn. This permission is above and beyond the permissions granted 14 * by the GPL license by which Libbrasero-burn is covered. If you modify this code 15 * you may extend this exception to your version of the code, but you are not 16 * obligated to do so. If you do not wish to do so, delete this exception 17 * statement from your version. 18 * 19 * Libbrasero-burn is distributed in the hope that it will be useful, 20 * but WITHOUT ANY WARRANTY; without even the implied warranty of 21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 22 * GNU Library General Public License for more details. 23 * 24 * You should have received a copy of the GNU General Public License 25 * along with this program; if not, write to: 26 * The Free Software Foundation, Inc., 27 * 51 Franklin Street, Fifth Floor 28 * Boston, MA 02110-1301, USA. 29 */ 30 31 #ifndef _BURN_TRACK_H 32 #define _BURN_TRACK_H 33 34 #include <glib.h> 35 #include <glib-object.h> 36 37 #include <brasero-drive.h> 38 #include <brasero-medium.h> 39 40 #include <brasero-enums.h> 41 #include <brasero-error.h> 42 #include <brasero-status.h> 43 44 #include <brasero-track-type.h> 45 46 G_BEGIN_DECLS 47 48 #define BRASERO_TYPE_TRACK (brasero_track_get_type ()) 49 #define BRASERO_TRACK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BRASERO_TYPE_TRACK, BraseroTrack)) 50 #define BRASERO_TRACK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BRASERO_TYPE_TRACK, BraseroTrackClass)) 51 #define BRASERO_IS_TRACK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BRASERO_TYPE_TRACK)) 52 #define BRASERO_IS_TRACK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BRASERO_TYPE_TRACK)) 53 #define BRASERO_TRACK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BRASERO_TYPE_TRACK, BraseroTrackClass)) 54 55 typedef struct _BraseroTrackClass BraseroTrackClass; 56 typedef struct _BraseroTrack BraseroTrack; 57 58 struct _BraseroTrackClass 59 { 60 GObjectClass parent_class; 61 62 /* Virtual functions */ 63 BraseroBurnResult (* get_status) (BraseroTrack *track, 64 BraseroStatus *status); 65 66 BraseroBurnResult (* get_size) (BraseroTrack *track, 67 goffset *blocks, 68 goffset *block_size); 69 70 BraseroBurnResult (* get_type) (BraseroTrack *track, 71 BraseroTrackType *type); 72 73 /* Signals */ 74 void (* changed) (BraseroTrack *track); 75 }; 76 77 struct _BraseroTrack 78 { 79 GObject parent_instance; 80 }; 81 82 GType brasero_track_get_type (void) G_GNUC_CONST; 83 84 void 85 brasero_track_changed (BraseroTrack *track); 86 87 88 89 BraseroBurnResult 90 brasero_track_get_size (BraseroTrack *track, 91 goffset *blocks, 92 goffset *bytes); 93 94 BraseroBurnResult 95 brasero_track_get_track_type (BraseroTrack *track, 96 BraseroTrackType *type); 97 98 BraseroBurnResult 99 brasero_track_get_status (BraseroTrack *track, 100 BraseroStatus *status); 101 102 103 /** 104 * Checksums 105 */ 106 107 typedef enum { 108 BRASERO_CHECKSUM_NONE = 0, 109 BRASERO_CHECKSUM_DETECT = 1, /* means the plugin handles detection of checksum type */ 110 BRASERO_CHECKSUM_MD5 = 1 << 1, 111 BRASERO_CHECKSUM_MD5_FILE = 1 << 2, 112 BRASERO_CHECKSUM_SHA1 = 1 << 3, 113 BRASERO_CHECKSUM_SHA1_FILE = 1 << 4, 114 BRASERO_CHECKSUM_SHA256 = 1 << 5, 115 BRASERO_CHECKSUM_SHA256_FILE = 1 << 6, 116 } BraseroChecksumType; 117 118 BraseroBurnResult 119 brasero_track_set_checksum (BraseroTrack *track, 120 BraseroChecksumType type, 121 const gchar *checksum); 122 123 const gchar * 124 brasero_track_get_checksum (BraseroTrack *track); 125 126 BraseroChecksumType 127 brasero_track_get_checksum_type (BraseroTrack *track); 128 129 BraseroBurnResult 130 brasero_track_tag_add (BraseroTrack *track, 131 const gchar *tag, 132 GValue *value); 133 134 BraseroBurnResult 135 brasero_track_tag_lookup (BraseroTrack *track, 136 const gchar *tag, 137 GValue **value); 138 139 void 140 brasero_track_tag_copy_missing (BraseroTrack *dest, 141 BraseroTrack *src); 142 143 /** 144 * Convenience functions for tags 145 */ 146 147 BraseroBurnResult 148 brasero_track_tag_add_string (BraseroTrack *track, 149 const gchar *tag, 150 const gchar *string); 151 152 const gchar * 153 brasero_track_tag_lookup_string (BraseroTrack *track, 154 const gchar *tag); 155 156 BraseroBurnResult 157 brasero_track_tag_add_int (BraseroTrack *track, 158 const gchar *tag, 159 int value); 160 161 int 162 brasero_track_tag_lookup_int (BraseroTrack *track, 163 const gchar *tag); 164 165 G_END_DECLS 166 167 #endif /* _BURN_TRACK_H */ 168 169 170