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

Function drive_changed_cb

gtk/src/callbacks.c:5631–5666  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5629#else
5630
5631G_MODULE_EXPORT void
5632drive_changed_cb(GVolumeMonitor *gvm, GDrive *gd, signal_user_data_t *ud)
5633{
5634 gchar *device;
5635 gint state;
5636
5637 ghb_log_func();
5638 g_thread_new("Cache Volume Names", (GThreadFunc)ghb_cache_volnames, ud);
5639
5640 state = ghb_get_scan_state();
5641 device = g_drive_get_identifier(gd, G_VOLUME_IDENTIFIER_KIND_UNIX_DEVICE);
5642 if (ud->current_dvd_device == NULL ||
5643 strcmp(device, ud->current_dvd_device) != 0 ||
5644 state != GHB_STATE_IDLE )
5645 {
5646 return;
5647 }
5648 if (g_drive_has_media(gd))
5649 {
5650 if (ghb_dict_get_bool(ud->prefs, "AutoScan"))
5651 {
5652 show_scan_progress(ud);
5653 gint preview_count;
5654 preview_count = ghb_dict_get_int(ud->prefs, "preview_count");
5655 ghb_set_scan_source(device);
5656 start_scan(ud, device, 0, preview_count);
5657 }
5658 }
5659 else
5660 {
5661 ghb_hb_cleanup(TRUE);
5662 prune_logs();
5663 ghb_set_scan_source("/dev/null");
5664 start_scan(ud, "/dev/null", 0, 1);
5665 }
5666}
5667#endif
5668
5669G_MODULE_EXPORT void

Callers

nothing calls this directly

Calls 8

ghb_get_scan_stateFunction · 0.85
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