~ubuntu-branches/ubuntu/hoary/kdemultimedia/hoary

« back to all changes in this revision

Viewing changes to kmix/kmix-platforms.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Martin Schulze
  • Date: 2003-01-22 15:00:51 UTC
  • Revision ID: james.westby@ubuntu.com-20030122150051-uihwkdoxf15mi1tn
Tags: upstream-2.2.2
ImportĀ upstreamĀ versionĀ 2.2.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *              KMix -- KDE's full featured mini mixer
 
3
 *
 
4
 *
 
5
 *              Copyright (C) 1996-2000 Christian Esken
 
6
 *                        esken@kde.org
 
7
 *
 
8
 * This program is free software; you can redistribute it and/or
 
9
 * modify it under the terms of the GNU Library General Public
 
10
 * License as published by the Free Software Foundation; either
 
11
 * version 2 of the License, or (at your option) any later version.
 
12
 *
 
13
 * This program is distributed in the hope that it will be useful,
 
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
16
 * Library General Public License for more details.
 
17
 *
 
18
 * You should have received a copy of the GNU Library General Public
 
19
 * License along with this program; if not, write to the Free
 
20
 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
21
 */
 
22
 
 
23
/* This code is being #include'd from mixer.cpp */
 
24
 
 
25
#include <config.h>
 
26
 
 
27
#if defined(sun) || defined(__sun__)
 
28
#define SUN_MIXER
 
29
#endif
 
30
 
 
31
#ifdef sgi
 
32
#include <sys/fcntl.h>
 
33
#define IRIX_MIXER
 
34
#endif
 
35
 
 
36
#ifdef __linux__
 
37
 
 
38
#ifdef ALSA
 
39
#define ALSA_MIXER
 
40
#endif
 
41
 
 
42
#define OSS_MIXER
 
43
#endif
 
44
 
 
45
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__bsdi__) || defined(_UNIXWARE)
 
46
#define OSS_MIXER
 
47
#endif
 
48
 
 
49
#if defined(hpux)
 
50
# if defined(HAVE_ALIB_H)
 
51
#  define HPUX_MIXER
 
52
# else
 
53
#  warning ** YOU NEED to have libAlib installed to use the HP-UX-Mixer **
 
54
# endif // HAVE_ALIB_H
 
55
#endif // hpux
 
56
 
 
57
// PORTING: add #ifdef PLATFORM , commands , #endif, add your new mixer below
 
58
#if defined(NAS_MIXER)
 
59
#include "mixer_nas.cpp"
 
60
#endif
 
61
 
 
62
#if defined(SUN_MIXER)
 
63
#include "mixer_sun.cpp"
 
64
#endif
 
65
 
 
66
#if defined(IRIX_MIXER)
 
67
#include "mixer_irix.cpp"
 
68
#endif
 
69
 
 
70
#if defined(ALSA_MIXER)
 
71
#include "mixer_alsa.cpp"
 
72
#endif
 
73
 
 
74
#if defined(OSS_MIXER)
 
75
#include "mixer_oss.cpp"
 
76
#endif
 
77
 
 
78
#if defined(HPUX_MIXER)
 
79
#include "mixer_hpux.cpp"
 
80
#endif
 
81
 
 
82
/*
 
83
#else
 
84
// We cannot handle this! I install a dummy mixer instead.
 
85
#define NO_MIXER
 
86
#include "mixer_none.cpp"
 
87
#endif
 
88
*/
 
89
 
 
90
typedef Mixer *getMixerFunc( int device, int card );
 
91
typedef Mixer *getMixerSetFunc( MixSet set, int device, int card );
 
92
 
 
93
struct MixerFactory {
 
94
    getMixerFunc *getMixer;
 
95
    getMixerSetFunc *getMixerSet;
 
96
};
 
97
 
 
98
MixerFactory g_mixerFactories[] = {
 
99
 
 
100
#if defined(NAS_MIXER)
 
101
    { NAS_getMixer, 0 },
 
102
#endif
 
103
 
 
104
#if defined(SUN_MIXER)
 
105
    { SUN_getMixer, SUN_getMixerSet },
 
106
#endif
 
107
 
 
108
#if defined(IRIX_MIXER)
 
109
    { IRIX_getMixer, 0 },
 
110
#endif
 
111
 
 
112
#if defined(ALSA_MIXER)
 
113
    { ALSA_getMixer, ALSA_getMixerSet },
 
114
#endif
 
115
 
 
116
#if defined(OSS_MIXER)
 
117
    { OSS_getMixer, OSS_getMixerSet },
 
118
#endif
 
119
 
 
120
#if defined(HPUX_MIXER)
 
121
    { HPUX_getMixer, 0 },
 
122
#endif
 
123
 
 
124
    { 0, 0 }
 
125
};