summaryrefslogtreecommitdiff
path: root/kernel/framework/vmix_core/vmix_import_int.inc
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2013-05-03 21:08:42 +0400
committerIgor Pashev <pashev.igor@gmail.com>2013-05-03 21:08:42 +0400
commit1058def8e7827e56ce4a70afb4aeacb5dc44148f (patch)
tree4495d23e7b54ab5700e3839081e797c1eafe0db9 /kernel/framework/vmix_core/vmix_import_int.inc
downloadoss4-1058def8e7827e56ce4a70afb4aeacb5dc44148f.tar.gz
Imported Upstream version 4.2-build2006upstream/4.2-build2006upstream
Diffstat (limited to 'kernel/framework/vmix_core/vmix_import_int.inc')
-rw-r--r--kernel/framework/vmix_core/vmix_import_int.inc56
1 files changed, 56 insertions, 0 deletions
diff --git a/kernel/framework/vmix_core/vmix_import_int.inc b/kernel/framework/vmix_core/vmix_import_int.inc
new file mode 100644
index 0000000..338078d
--- /dev/null
+++ b/kernel/framework/vmix_core/vmix_import_int.inc
@@ -0,0 +1,56 @@
+/*
+ * Purpose: Recording device to local input buffer import routine for vmix (int)
+ */
+/*
+ *
+ * This file is part of Open Sound System.
+ *
+ * Copyright (C) 4Front Technologies 1996-2008.
+ *
+ * This this source file is released under GPL v2 license (no other versions).
+ * See the COPYING file included in the main directory of this source
+ * distribution for the license terms and conditions.
+ *
+ */
+
+int i, ch;
+int vol;
+
+vol = vmix_db_table[eng->outvol / 5];
+
+for (ch = 0; ch < channels; ch++)
+ {
+ int vu;
+ int *chbuf;
+
+ vu = eng->vu[ch % 2] * 65536;
+
+ op = (SAMPLE_TYPE *) inbuf;
+ op += ch;
+
+ chbuf = chbufs[ch];
+
+ for (i = 0; i < samples; i++)
+ {
+ int tmp;
+
+ tmp = INT_IMPORT (VMIX_BYTESWAP (*op));
+ tmp = (tmp * vol) / VMIX_VOL_SCALE;
+
+ op += channels;
+
+ *chbuf++ = tmp;
+
+ /* VU meter */
+ if (tmp < 0)
+ tmp = -tmp;
+ if (tmp > vu)
+ vu = tmp;
+ }
+
+ if (ch < 2)
+ {
+ vu = vu / 65536;
+ eng->vu[ch] = vu;
+ }
+ }