~ubuntu-branches/ubuntu/oneiric/oss4/oneiric-proposed

« back to all changes in this revision

Viewing changes to kernel/framework/vmix_core/vmix_import_int.inc

  • Committer: Bazaar Package Importer
  • Author(s): Stefano Rivera
  • Date: 2011-06-16 20:37:48 UTC
  • mfrom: (5.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20110616203748-jbrxik6ql33z54co
Tags: 4.2-build2004-1ubuntu1
* Merge from Debian unstable.
  - Supports our current kernel (LP: #746048)
  Remaining changes:
  - debian/oss4-dkms.dkms.in: s/source/build/ in Kernel headers paths.
* ld-as-needed.patch: Re-order CC arguments to enable building with ld
  --as-needed (LP: #770972)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Purpose: Recording device to local input buffer import routine for vmix (int)
 
3
 */
 
4
/*
 
5
 *
 
6
 * This file is part of Open Sound System.
 
7
 *
 
8
 * Copyright (C) 4Front Technologies 1996-2008.
 
9
 *
 
10
 * This this source file is released under GPL v2 license (no other versions).
 
11
 * See the COPYING file included in the main directory of this source
 
12
 * distribution for the license terms and conditions.
 
13
 *
 
14
 */
 
15
 
 
16
int i, ch;
 
17
int vol;
 
18
 
 
19
vol = vmix_db_table[eng->outvol / 5];
 
20
 
 
21
for (ch = 0; ch < channels; ch++)
 
22
  {
 
23
    int vu;
 
24
    int *chbuf;
 
25
 
 
26
    vu = eng->vu[ch % 2] * 65536;
 
27
 
 
28
    op = (SAMPLE_TYPE *) inbuf;
 
29
    op += ch;
 
30
 
 
31
    chbuf = chbufs[ch];
 
32
 
 
33
    for (i = 0; i < samples; i++)
 
34
      {
 
35
        int tmp;
 
36
 
 
37
        tmp = INT_IMPORT (VMIX_BYTESWAP (*op));
 
38
        tmp = (tmp * vol) / VMIX_VOL_SCALE;
 
39
 
 
40
        op += channels;
 
41
 
 
42
        *chbuf++ = tmp;
 
43
 
 
44
        /* VU meter */
 
45
        if (tmp < 0)
 
46
          tmp = -tmp;
 
47
        if (tmp > vu)
 
48
          vu = tmp;
 
49
      }
 
50
 
 
51
    if (ch < 2)
 
52
      {
 
53
        vu = vu / 65536;
 
54
        eng->vu[ch] = vu;
 
55
      }
 
56
  }