/* * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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; } TQString HPUX_getDriverName() { return "HPUX"; }