#include <glib.h>
#include <brasero-medium-selection.h>

static gboolean
check_media (BraseroDrive *drive)
{
	BraseroMedium *medium;
	medium = brasero_drive_get_medium (drive);
	g_message ("type: %s", brasero_medium_get_type_string (medium));
	return TRUE;
}

int main (int argc, char **argv)
{
	BraseroMediumMonitor *monitor;
	BraseroMedium *medium;
	BraseroDrive *drive;

	g_type_init ();
	g_thread_init (NULL);

	monitor = brasero_medium_monitor_get_default ();
	drive = brasero_medium_monitor_get_drive (monitor, "/dev/sr0");
	if (drive == NULL) {
		return FALSE;
	}

#if 0
	g_usleep (G_USEC_PER_SEC * 5);
	medium = brasero_drive_get_medium (drive);
	g_message ("type: %s", brasero_medium_get_type_string (medium));
#else
	GMainLoop *loop;
	loop = g_main_loop_new (NULL, FALSE);
	g_timeout_add (1000, (GSourceFunc) check_media, drive);
	g_main_loop_run (loop);
#endif

	return 0;
}
