MCPcopy Create free account
hub / github.com/HandBrake/HandBrake / handle_media_change

Function handle_media_change

gtk/src/callbacks.c:5523–5574  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5521
5522#if defined(_WIN32)
5523static void
5524handle_media_change(const gchar *device, gboolean insert, signal_user_data_t *ud)
5525{
5526 guint dtype;
5527 static gint ins_count = 0;
5528 static gint rem_count = 0;
5529
5530 // The media change event in windows bounces around a bit
5531 // so I debounce it here
5532 // DVD insertion detected. Scan it.
5533 dtype = GetDriveType(device);
5534 if (dtype != DRIVE_CDROM)
5535 return;
5536 if (insert)
5537 {
5538 rem_count = 0;
5539 ins_count++;
5540 if (ins_count == 2)
5541 {
5542 g_thread_new("Cache Volume Names",
5543 (GThreadFunc)ghb_cache_volnames, ud);
5544 if (ghb_dict_get_bool(ud->prefs, "AutoScan") &&
5545 ud->current_dvd_device != NULL &&
5546 strcmp(device, ud->current_dvd_device) == 0)
5547 {
5548 show_scan_progress(ud);
5549 gint preview_count;
5550 preview_count = ghb_dict_get_int(ud->prefs, "preview_count");
5551 ghb_set_scan_source(device);
5552 start_scan(ud, device, 0, preview_count);
5553 }
5554 }
5555 }
5556 else
5557 {
5558 ins_count = 0;
5559 rem_count++;
5560 if (rem_count == 2)
5561 {
5562 g_thread_new("Cache Volume Names",
5563 (GThreadFunc)ghb_cache_volnames, ud);
5564 if (ud->current_dvd_device != NULL &&
5565 strcmp(device, ud->current_dvd_device) == 0)
5566 {
5567 ghb_hb_cleanup(TRUE);
5568 prune_logs();
5569 ghb_set_scan_source("/dev/null");
5570 start_scan(ud, "/dev/null", 0, 1);
5571 }
5572 }
5573 }
5574}
5575
5576static gchar
5577FindDriveFromMask(ULONG unitmask)

Callers 1

wm_drive_changedFunction · 0.85

Calls 7

ghb_dict_get_boolFunction · 0.85
show_scan_progressFunction · 0.85
ghb_dict_get_intFunction · 0.85
ghb_set_scan_sourceFunction · 0.85
start_scanFunction · 0.85
ghb_hb_cleanupFunction · 0.85
prune_logsFunction · 0.85

Tested by

no test coverage detected