~ubuntu-branches/ubuntu/natty/kdemultimedia/natty-proposed

« back to all changes in this revision

Viewing changes to kmix/kmix-platforms.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Debian Qt/KDE Maintainers
  • Date: 2011-05-26 02:41:36 UTC
  • mfrom: (0.2.3 upstream)
  • mto: This revision was merged to the branch mainline in revision 108.
  • Revision ID: james.westby@ubuntu.com-20110526024136-jjwsigfy402jhupm
Tags: upstream-4.6.3
ImportĀ upstreamĀ versionĀ 4.6.3

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., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
21
 
 */
22
 
 
23
 
/* This code is being #include'd from mixer.cpp */
24
 
 
25
 
#include <config.h>
26
 
#include <config-alsa.h>
27
 
 
28
 
#include "mixer_backend.h"
29
 
#include "mixer.h"
30
 
 
31
 
#include <QString>
32
 
 
33
 
 
34
 
 
35
 
#if defined(sun) || defined(__sun__)
36
 
#define SUN_MIXER
37
 
#endif
38
 
 
39
 
#ifdef sgi
40
 
#include <sys/fcntl.h>
41
 
#define IRIX_MIXER
42
 
#endif
43
 
 
44
 
#ifdef __linux__
45
 
 
46
 
#ifdef HAVE_LIBASOUND2
47
 
#define ALSA_MIXER
48
 
#endif
49
 
 
50
 
#ifdef HAVE_PULSE
51
 
#define PULSE_MIXER
52
 
#endif
53
 
 
54
 
#define OSS_MIXER
55
 
#endif
56
 
 
57
 
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__) || defined(_UNIXWARE)
58
 
#define OSS_MIXER
59
 
#endif
60
 
 
61
 
#if defined(hpux)
62
 
# if defined(HAVE_ALIB_H)
63
 
#  define HPUX_MIXER
64
 
# else
65
 
#ifdef __GNUC__
66
 
#  warning ** YOU NEED to have libAlib installed to use the HP-UX-Mixer **
67
 
#endif
68
 
# endif // HAVE_ALIB_H
69
 
#endif // hpux
70
 
 
71
 
// PORTING: add #ifdef PLATFORM , commands , #endif, add your new mixer below
72
 
 
73
 
#if defined(SUN_MIXER)
74
 
#include "mixer_sun.cpp"
75
 
#endif
76
 
 
77
 
#if defined(IRIX_MIXER)
78
 
#include "mixer_irix.cpp"
79
 
#endif
80
 
 
81
 
// Alsa API's 
82
 
#if defined(ALSA_MIXER)
83
 
#include "mixer_alsa9.cpp"
84
 
#endif
85
 
 
86
 
// Pulse API
87
 
#if defined(PULSE_MIXER)
88
 
#include "mixer_pulse.cpp"
89
 
#endif
90
 
 
91
 
// OSS 3 / 4
92
 
#if defined(OSS_MIXER)
93
 
#include "mixer_oss.cpp"
94
 
 
95
 
#if !defined(__NetBSD__) && !defined(__OpenBSD__)
96
 
#include <sys/soundcard.h>
97
 
#else
98
 
#include <soundcard.h>
99
 
#endif
100
 
#if !defined(__FreeBSD__) && SOUND_VERSION >= 0x040000
101
 
#define OSS4_MIXER
102
 
#endif
103
 
#endif
104
 
 
105
 
#if defined(OSS4_MIXER)
106
 
#include "mixer_oss4.cpp"
107
 
#endif
108
 
 
109
 
#if defined(HPUX_MIXER)
110
 
#include "mixer_hpux.cpp"
111
 
#endif
112
 
 
113
 
 
114
 
typedef Mixer_Backend *getMixerFunc( Mixer* mixer, int device );
115
 
typedef QString getDriverNameFunc( );
116
 
 
117
 
struct MixerFactory {
118
 
    getMixerFunc *getMixer;
119
 
    getDriverNameFunc *getDriverName;
120
 
};
121
 
 
122
 
MixerFactory g_mixerFactories[] = {
123
 
 
124
 
#if defined(SUN_MIXER)
125
 
    { SUN_getMixer, SUN_getDriverName },
126
 
#endif
127
 
 
128
 
#if defined(IRIX_MIXER)
129
 
    { IRIX_getMixer, IRIX_getDriverName },
130
 
#endif
131
 
 
132
 
#if defined(ALSA_MIXER)
133
 
    { ALSA_getMixer, ALSA_getDriverName },
134
 
#endif
135
 
 
136
 
#if defined(OSS_MIXER)
137
 
    { OSS_getMixer, OSS_getDriverName },
138
 
#endif
139
 
 
140
 
#if defined(OSS4_MIXER)
141
 
    { OSS4_getMixer, OSS4_getDriverName },
142
 
#endif
143
 
 
144
 
#if defined(HPUX_MIXER)
145
 
    { HPUX_getMixer, HPUX_getDriverName },
146
 
#endif
147
 
 
148
 
#if defined(PULSE_MIXER)
149
 
    { PULSE_getMixer, PULSE_getDriverName },
150
 
#endif
151
 
 
152
 
    { 0, 0 }
153
 
};
154