summaryrefslogtreecommitdiffhomepage
path: root/mixlib/xmix_device.c
diff options
context:
space:
mode:
Diffstat (limited to 'mixlib/xmix_device.c')
-rw-r--r--mixlib/xmix_device.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/mixlib/xmix_device.c b/mixlib/xmix_device.c
index b0ec547..47b6397 100644
--- a/mixlib/xmix_device.c
+++ b/mixlib/xmix_device.c
@@ -24,6 +24,8 @@
#include "xmix_device.h"
+gchar *DEV_DIR_ = NULL;
+
const char *DEV_EXT_ = ".dev";
const char *DEF_NAMES_[] = {
@@ -58,14 +60,11 @@ const mix_fmode_t FMODES_[] = {
void
construct_device_ (mix_device_t *result, mix_device_type_t type)
{
- result->type = type;
- if (type != mix_dev_CONSOLE) {
- result->file = MIX_IOCHANNEL(mix_file_new_with_def_ext (DEF_NAMES_[type],
- FMODES_[type],
- DEV_EXT_));
- } else
- result->file = mix_io_new (stdout);
- result->vtable = DEF_DEV_VTABLE_;
+ gchar *name;
+ name = DEV_DIR_ ? g_strdup_printf ("%s/%s", DEV_DIR_, DEF_NAMES_[type])
+ : g_strdup (DEF_NAMES_[type]);
+ construct_device_with_name_ (result, type, name);
+ g_free (name);
}