summaryrefslogtreecommitdiffhomepage
path: root/mixlib/mix_vm.c
diff options
context:
space:
mode:
Diffstat (limited to 'mixlib/mix_vm.c')
-rw-r--r--mixlib/mix_vm.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/mixlib/mix_vm.c b/mixlib/mix_vm.c
index 9a39247..39b3e6f 100644
--- a/mixlib/mix_vm.c
+++ b/mixlib/mix_vm.c
@@ -76,8 +76,10 @@ mix_vm_new (void)
vm->devices[i] = NULL;
vm->clock = mix_vm_clock_new ();
+ vm->factory = mix_device_new;
vm_reset_ (vm);
+
return vm;
}
@@ -116,6 +118,15 @@ mix_vm_connect_device (mix_vm_t *vm, mix_device_t *device)
return old;
}
+/* install a device factory for automatic connection */
+void
+mix_vm_set_device_factory (mix_vm_t *vm, mix_device_factory_t factory)
+{
+ g_return_if_fail (vm != NULL);
+ g_return_if_fail (factory != NULL);
+ vm->factory = factory;
+}
+
/* Reset a vm (set state as of a newly created one) */
void
mix_vm_reset (mix_vm_t * vm)