From e2de64d6f1beb9e492daf5b886e19933c1fa41dd Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdemultimedia@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kmix/mixer_hpux.cpp | 257 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 257 insertions(+) create mode 100644 kmix/mixer_hpux.cpp (limited to 'kmix/mixer_hpux.cpp') diff --git a/kmix/mixer_hpux.cpp b/kmix/mixer_hpux.cpp new file mode 100644 index 00000000..e7ca0a83 --- /dev/null +++ b/kmix/mixer_hpux.cpp @@ -0,0 +1,257 @@ +/* + * KMix -- KDE's full featured mini mixer + * + * + * Copyright (C) 1996-2000 Christian Esken + * esken@kde.org + * + * HP/UX-Port: Copyright (C) 1999 by Helge Deller + * deller@gmx.de + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the Free + * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#include "mixer_hpux.h" + +#warning "HP/UX mixer (maybe) doesn't work yet !" + +#define HPUX_ERROR_OFFSET 1024 + +#define myGain AUnityGain /* AUnityGain or AZeroGain */ + +#define GAIN_OUT_DIFF ((long) ((int)aMaxOutputGain(audio) - (int)aMinOutputGain(audio))) +#define GAIN_OUT_MIN ((long) aMinOutputGain(audio)) +#define GAIN_IN_DIFF ((long) ((int)aMaxInputGain(audio) - (int)aMinInputGain(audio))) +#define GAIN_IN_MIN ((long) aMinOutputGain(audio)) + +/* standard */ +#define ID_PCM 4 + +/* AInputSrcType: */ /*OSS:*/ +#define ID_IN_MICROPHONE 7 /* AISTMonoMicrophone */ +#define ID_IN_AUX 6 /* AISTLeftAuxiliary, AISTRightAuxiliary */ + +/* AOutputDstType: */ +#define ID_OUT_INT_SPEAKER 0 /* AODTMonoIntSpeaker */ + +/* not yet implemented: + AODTLeftJack, AODTRightJack, + AODTLeftLineOut, AODTRightLineOut, + AODTLeftHeadphone, AODTRightHeadphone + +const char* MixerDevNames[32]={"Volume" , "Bass" , "Treble" , "Synth" , "Pcm" , \ + "Speaker" , "Line" , "Microphone", "CD" , "Mix" , \ + "Pcm2" , "RecMon" , "IGain" , "OGain" , "Line1", \ + "Line2" , "Line3" , "Digital1" , "Digital2", "Digital3", \ + "PhoneIn" , "PhoneOut", "Video" , "Radio" , "Monitor", \ + "3D-depth", "3D-center", "unknown" , "unknown" , "unknown", \ + "unknown" , "unused" }; +*/ + + + +Mixer_HPUX::Mixer_HPUX(int devnum) : Mixer_Backend(devnum) +{ + char ServerName[10]; + ServerName[0] = 0; + audio = AOpenAudio(ServerName,NULL); +} + +Mixer_HPUX::~Mixer_HPUX() +{ + if (audio) { + ACloseAudio(audio,0); + audio = 0; + } +} + + +int Mixer_HPUX::open() +{ + if (audio==0) { + return Mixer::ERR_OPEN; + } + else + { + /* Mixer is open. Now define properties */ + stereodevs = devmask = (1<= HPUX_ERROR_OFFSET) { + char errorstr[200]; + AGetErrorText(audio, (AError) (mixer_error-HPUX_ERROR_OFFSET), + errorstr, sizeof(errorstr)); + printf("kmix: %s: %s\n",mixerName().data(), errorstr); + l_s_errmsg = errorstr; + } else + switch (mixer_error) + { + case Mixer::ERR_OPEN: + // should use i18n... + l_s_errmsg = "kmix: HP-UX Alib-Mixer cannot be found.\n" \ + "Please check that you have:\n" \ + " 1. Installed the libAlib package and\n" \ + " 2. started the Aserver program from the /opt/audio/bin directory\n"; + break; + default: + l_s_errmsg = Mixer_Backend::errorText(mixer_error); + break; + } + return l_s_errmsg; +} + +QString HPUX_getDriverName() { + return "HPUX"; +} + -- cgit v1.2.3