| 5440 | gboolean ghb_is_cd(GDrive *gd); |
| 5441 | |
| 5442 | static GList* |
| 5443 | dvd_device_list (void) |
| 5444 | { |
| 5445 | GList *dvd_devices = NULL; |
| 5446 | |
| 5447 | #if defined(_WIN32) |
| 5448 | gint ii, drives; |
| 5449 | gchar drive[5]; |
| 5450 | |
| 5451 | strcpy(drive, "A:" G_DIR_SEPARATOR_S); |
| 5452 | drives = GetLogicalDrives(); |
| 5453 | for (ii = 0; ii < 26; ii++) |
| 5454 | { |
| 5455 | if (drives & 0x01) |
| 5456 | { |
| 5457 | guint dtype; |
| 5458 | |
| 5459 | drive[0] = 'A' + ii; |
| 5460 | dtype = GetDriveType(drive); |
| 5461 | if (dtype == DRIVE_CDROM) |
| 5462 | { |
| 5463 | dvd_devices = g_list_append(dvd_devices, |
| 5464 | (gpointer)g_strdup(drive)); |
| 5465 | } |
| 5466 | } |
| 5467 | drives >>= 1; |
| 5468 | } |
| 5469 | #else |
| 5470 | GVolumeMonitor *gvm; |
| 5471 | GList *drives, *link; |
| 5472 | |
| 5473 | gvm = g_volume_monitor_get (); |
| 5474 | drives = g_volume_monitor_get_connected_drives (gvm); |
| 5475 | link = drives; |
| 5476 | while (link != NULL) |
| 5477 | { |
| 5478 | GDrive *gd; |
| 5479 | |
| 5480 | gd = (GDrive*)link->data; |
| 5481 | if (ghb_is_cd(gd)) |
| 5482 | { |
| 5483 | dvd_devices = g_list_append(dvd_devices, gd); |
| 5484 | } |
| 5485 | else |
| 5486 | g_object_unref (gd); |
| 5487 | link = link->next; |
| 5488 | } |
| 5489 | g_list_free(drives); |
| 5490 | #endif |
| 5491 | |
| 5492 | return dvd_devices; |
| 5493 | } |
| 5494 | |
| 5495 | gboolean |
| 5496 | ghb_is_cd(GDrive *gd) |
no test coverage detected