1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ 2 /* 3 * Libbrasero-media 4 * Copyright (C) Philippe Rouquier 2005-2009 <bonfire-app@wanadoo.fr> 5 * 6 * Libbrasero-media 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-media authors hereby grant permission for non-GPL compatible 12 * GStreamer plugins to be used and distributed together with GStreamer 13 * and Libbrasero-media. This permission is above and beyond the permissions granted 14 * by the GPL license by which Libbrasero-media 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-media 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 _BRASERO_MEDIUM_MONITOR_H_ 32 #define _BRASERO_MEDIUM_MONITOR_H_ 33 34 #include <glib-object.h> 35 36 #include <brasero-medium.h> 37 #include <brasero-drive.h> 38 39 G_BEGIN_DECLS 40 41 #define BRASERO_TYPE_MEDIUM_MONITOR (brasero_medium_monitor_get_type ()) 42 #define BRASERO_MEDIUM_MONITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BRASERO_TYPE_MEDIUM_MONITOR, BraseroMediumMonitor)) 43 #define BRASERO_MEDIUM_MONITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BRASERO_TYPE_MEDIUM_MONITOR, BraseroMediumMonitorClass)) 44 #define BRASERO_IS_MEDIUM_MONITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BRASERO_TYPE_MEDIUM_MONITOR)) 45 #define BRASERO_IS_MEDIUM_MONITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BRASERO_TYPE_MEDIUM_MONITOR)) 46 #define BRASERO_MEDIUM_MONITOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BRASERO_TYPE_MEDIUM_MONITOR, BraseroMediumMonitorClass)) 47 48 typedef struct _BraseroMediumMonitorClass BraseroMediumMonitorClass; 49 typedef struct _BraseroMediumMonitor BraseroMediumMonitor; 50 51 52 struct _BraseroMediumMonitorClass 53 { 54 GObjectClass parent_class; 55 56 /* Signals */ 57 void (* drive_added) (BraseroMediumMonitor *monitor, 58 BraseroDrive *drive); 59 60 void (* drive_removed) (BraseroMediumMonitor *monitor, 61 BraseroDrive *drive); 62 63 void (* medium_added) (BraseroMediumMonitor *monitor, 64 BraseroMedium *medium); 65 66 void (* medium_removed) (BraseroMediumMonitor *monitor, 67 BraseroMedium *medium); 68 }; 69 70 struct _BraseroMediumMonitor 71 { 72 GObject parent_instance; 73 }; 74 75 GType brasero_medium_monitor_get_type (void) G_GNUC_CONST; 76 77 BraseroMediumMonitor * 78 brasero_medium_monitor_get_default (void); 79 80 typedef enum { 81 BRASERO_MEDIA_TYPE_NONE = 0, 82 BRASERO_MEDIA_TYPE_FILE = 1, 83 BRASERO_MEDIA_TYPE_DATA = 1 << 1, 84 BRASERO_MEDIA_TYPE_AUDIO = 1 << 2, 85 BRASERO_MEDIA_TYPE_WRITABLE = 1 << 3, 86 BRASERO_MEDIA_TYPE_REWRITABLE = 1 << 4, 87 BRASERO_MEDIA_TYPE_ANY_IN_BURNER = 1 << 5, 88 89 /* If combined with other flags it will filter. 90 * if alone all CDs are returned. 91 * It can't be combined with FILE type. */ 92 BRASERO_MEDIA_TYPE_CD = 1 << 6, 93 94 BRASERO_MEDIA_TYPE_ALL_BUT_FILE = 0xFE, 95 BRASERO_MEDIA_TYPE_ALL = 0xFF 96 } BraseroMediaType; 97 98 typedef enum { 99 BRASERO_DRIVE_TYPE_NONE = 0, 100 BRASERO_DRIVE_TYPE_FILE = 1, 101 BRASERO_DRIVE_TYPE_WRITER = 1 << 1, 102 BRASERO_DRIVE_TYPE_READER = 1 << 2, 103 BRASERO_DRIVE_TYPE_ALL_BUT_FILE = 0xFE, 104 BRASERO_DRIVE_TYPE_ALL = 0xFF 105 } BraseroDriveType; 106 107 GSList * 108 brasero_medium_monitor_get_media (BraseroMediumMonitor *monitor, 109 BraseroMediaType type); 110 111 GSList * 112 brasero_medium_monitor_get_drives (BraseroMediumMonitor *monitor, 113 BraseroDriveType type); 114 115 BraseroDrive * 116 brasero_medium_monitor_get_drive (BraseroMediumMonitor *monitor, 117 const gchar *device); 118 119 gboolean 120 brasero_medium_monitor_is_probing (BraseroMediumMonitor *monitor); 121 122 G_END_DECLS 123 124 #endif /* _BRASERO_MEDIUM_MONITOR_H_ */ 125