~ubuntu-branches/ubuntu/precise/puredata/precise

« back to all changes in this revision

Viewing changes to portmidi/pm_linux/pmlinux.c

  • Committer: Bazaar Package Importer
  • Author(s): Paul Brossier
  • Date: 2009-12-22 21:29:31 UTC
  • mfrom: (1.2.6 upstream) (4.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091222212931-nhwkzapjwsmjao1l
Tags: 0.42.5-3
* debian/control:
  - add community site to homepage field
  - improve long description
  - remove Replaces and Conflicts fields
  - add Suggests on pd-csound, pd-pdp, pd-zexy, pd-aubio
* debian/rules: add per-arch configuration flags
* debian/patches/02_kfreebsd.diff:
  - also define pd_tilde_dllextent on FreeBSD
  - fix typo (really closing #414414 this time)
  - also add hurd glue
* debian/patches/04_hurd.diff:
  - add hurd glue and s_midi_dummy.c

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* pmlinux.c -- PortMidi os-dependent code */
 
2
 
 
3
/* This file only needs to implement pm_init(), which calls various
 
4
   routines to register the available midi devices. This file must
 
5
   be separate from the main portmidi.c file because it is system
 
6
   dependent, and it is separate from, pmlinuxalsa.c, because it
 
7
   might need to register non-alsa devices as well.
 
8
 
 
9
   NOTE: if you add non-ALSA support, you need to fix :alsa_poll()
 
10
   in pmlinuxalsa.c, which assumes all input devices are ALSA.
 
11
 */
 
12
 
 
13
#include "stdlib.h"
 
14
#include "portmidi.h"
 
15
#ifdef PMALSA
 
16
  #include "pmlinuxalsa.h"
 
17
#endif
 
18
 
 
19
#ifdef PMNULL
 
20
  #include "pmlinuxnull.h"
 
21
#endif
 
22
 
 
23
PmError pm_init()
 
24
{
 
25
    /* Note: it is not an error for PMALSA to fail to initialize. 
 
26
     * It may be a design error that the client cannot query what subsystems
 
27
     * are working properly other than by looking at the list of available
 
28
     * devices.
 
29
     */
 
30
    #ifdef PMALSA
 
31
        pm_linuxalsa_init();
 
32
    #endif
 
33
    #ifdef PMNULL
 
34
        pm_linuxnull_init();
 
35
    #endif
 
36
    return pmNoError;
 
37
}
 
38
 
 
39
void pm_term(void)
 
40
{
 
41
    #ifdef PMALSA
 
42
        pm_linuxalsa_term();
 
43
    #endif
 
44
}
 
45
 
 
46
PmDeviceID pm_default_input_device_id = -1;
 
47
PmDeviceID pm_default_output_device_id = -1;
 
48
 
 
49
PmDeviceID Pm_GetDefaultInputDeviceID() { 
 
50
    return pm_default_input_device_id; 
 
51
}
 
52
 
 
53
PmDeviceID Pm_GetDefaultOutputDeviceID() { 
 
54
    return pm_default_output_device_id; 
 
55
}
 
56
 
 
57
void *pm_alloc(size_t s) { return malloc(s); }
 
58
 
 
59
void pm_free(void *ptr) { free(ptr); }
 
60