Ticket #47172: audacity-portmixer.patch

File audacity-portmixer.patch, 9.5 KB (added by RJVB (René Bertin), 10 years ago)
  • include/pa_win_ds.h

    Description: Add features needed to make portmixer work with audacity.
    Author: Audacity Team
    Last-Update: 2011-12-07
    
     
    8686
    8787}PaWinDirectSoundStreamInfo;
    8888
     89/** Retrieve the GUID of the input device.
     90
     91 @param stream The stream to query.
     92
     93 @return A pointer to the GUID, or NULL if none.
     94*/
     95LPGUID PaWinDS_GetStreamInputGUID( PaStream* s );
     96
     97/** Retrieve the GUID of the output device.
     98
     99 @param stream The stream to query.
     100
     101 @return A pointer to the GUID, or NULL if none.
     102*/
     103LPGUID PaWinDS_GetStreamOutputGUID( PaStream* s );
    89104
    90105
    91106#ifdef __cplusplus
  • include/portaudio.h

     
    11461146signed long Pa_GetStreamWriteAvailable( PaStream* stream );
    11471147
    11481148
     1149/** Retrieve the host type handling an open stream.
     1150
     1151 @return Returns a non-negative value representing the host API type
     1152 handling an open stream or, a PaErrorCode (which are always negative)
     1153 if PortAudio is not initialized or an error is encountered.
     1154*/
     1155PaHostApiTypeId Pa_GetStreamHostApiType( PaStream* stream );
     1156
     1157
    11491158/* Miscellaneous utilities */
    11501159
    11511160
  • new file include/pa_unix_oss.h

    - +  
     1#ifndef PA_UNIX_OSS_H
     2#define PA_UNIX_OSS_H
     3
     4/*
     5 * $Id: portaudio.patch,v 1.10 2009-06-30 04:52:59 llucius Exp $
     6 * PortAudio Portable Real-Time Audio Library
     7 * OSS-specific extensions
     8 *
     9 * Copyright (c) 1999-2000 Ross Bencina and Phil Burk
     10 *
     11 * Permission is hereby granted, free of charge, to any person obtaining
     12 * a copy of this software and associated documentation files
     13 * (the "Software"), to deal in the Software without restriction,
     14 * including without limitation the rights to use, copy, modify, merge,
     15 * publish, distribute, sublicense, and/or sell copies of the Software,
     16 * and to permit persons to whom the Software is furnished to do so,
     17 * subject to the following conditions:
     18 *
     19 * The above copyright notice and this permission notice shall be
     20 * included in all copies or substantial portions of the Software.
     21 *
     22 * Any person wishing to distribute modifications to the Software is
     23 * requested to send the modifications to the original developer so that
     24 * they can be incorporated into the canonical version.
     25 *
     26 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
     27 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
     28 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
     29 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
     30 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
     31 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
     32 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
     33 *
     34 */
     35
     36/** @file
     37 * OSS-specific PortAudio API extension header file.
     38 */
     39
     40#ifdef __cplusplus
     41extern "C" {
     42#endif
     43
     44const char *PaOSS_GetStreamInputDevice( PaStream *s );
     45
     46const char *PaOSS_GetStreamOutputDevice( PaStream *s );
     47
     48#ifdef __cplusplus
     49}
     50#endif
     51
     52#endif
     53#ifndef PA_UNIX_OSS_H
     54#define PA_UNIX_OSS_H
     55
     56/*
     57 * $Id: portaudio.patch,v 1.10 2009-06-30 04:52:59 llucius Exp $
     58 * PortAudio Portable Real-Time Audio Library
     59 * OSS-specific extensions
     60 *
     61 * Copyright (c) 1999-2000 Ross Bencina and Phil Burk
     62 *
     63 * Permission is hereby granted, free of charge, to any person obtaining
     64 * a copy of this software and associated documentation files
     65 * (the "Software"), to deal in the Software without restriction,
     66 * including without limitation the rights to use, copy, modify, merge,
     67 * publish, distribute, sublicense, and/or sell copies of the Software,
     68 * and to permit persons to whom the Software is furnished to do so,
     69 * subject to the following conditions:
     70 *
     71 * The above copyright notice and this permission notice shall be
     72 * included in all copies or substantial portions of the Software.
     73 *
     74 * Any person wishing to distribute modifications to the Software is
     75 * requested to send the modifications to the original developer so that
     76 * they can be incorporated into the canonical version.
     77 *
     78 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
     79 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
     80 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
     81 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
     82 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
     83 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
     84 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
     85 *
     86 */
     87
     88/** @file
     89 * OSS-specific PortAudio API extension header file.
     90 */
     91
     92#ifdef __cplusplus
     93extern "C" {
     94#endif
     95
     96const char *PaOSS_GetStreamInputDevice( PaStream *s );
     97
     98const char *PaOSS_GetStreamOutputDevice( PaStream *s );
     99
     100#ifdef __cplusplus
     101}
     102#endif
     103
     104#endif
  • src/common/pa_front.c

     
    12161216                                  hostApiInputParametersPtr, hostApiOutputParametersPtr,
    12171217                                  sampleRate, framesPerBuffer, streamFlags, streamCallback, userData );
    12181218
    1219     if( result == paNoError )
     1219    if( result == paNoError ) {
    12201220        AddOpenStream( *stream );
     1221        PA_STREAM_REP(*stream)->hostApiType = hostApi->info.type;
     1222    }
    12211223
    12221224
    12231225    PA_LOGAPI(("Pa_OpenStream returned:\n" ));
     
    17291731    return result;
    17301732}
    17311733
     1734PaHostApiTypeId Pa_GetStreamHostApiType( PaStream* stream )
     1735{
     1736    PaError error = PaUtil_ValidateStreamPointer( stream );
     1737    PaHostApiTypeId result;
     1738
     1739#ifdef PA_LOG_API_CALLS
     1740    PaUtil_DebugPrint("Pa_GetStreamHostApiType called:\n" );
     1741    PaUtil_DebugPrint("\tPaStream* stream: 0x%p\n", stream );
     1742#endif
     1743
     1744    if( error == paNoError )
     1745    {
     1746        result = PA_STREAM_REP(stream)->hostApiType;
     1747    }
     1748    else
     1749    {
     1750        result = (PaHostApiTypeId) error;
     1751    }
     1752
     1753#ifdef PA_LOG_API_CALLS
     1754    PaUtil_DebugPrint("Pa_GetStreamHostApiType returned:\n" );
     1755    PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) );
     1756#endif
     1757
     1758    return result;
     1759}
    17321760
    17331761PaError Pa_GetSampleSize( PaSampleFormat format )
    17341762{
  • src/common/pa_stream.c

     
    9393    streamRepresentation->streamInfo.inputLatency = 0.;
    9494    streamRepresentation->streamInfo.outputLatency = 0.;
    9595    streamRepresentation->streamInfo.sampleRate = 0.;
     96
     97    streamRepresentation->hostApiType = 0;
    9698}
    9799
    98100
  • src/common/pa_stream.h

     
    152152    PaStreamFinishedCallback *streamFinishedCallback;
    153153    void *userData;
    154154    PaStreamInfo streamInfo;
     155    PaHostApiTypeId hostApiType;
    155156} PaUtilStreamRepresentation;
    156157
    157158
  • src/hostapi/coreaudio/pa_mac_core_blocking.c

     
    6666#ifdef MOSX_USE_NON_ATOMIC_FLAG_BITS
    6767# define OSAtomicOr32( a, b ) ( (*(b)) |= (a) )
    6868# define OSAtomicAnd32( a, b ) ( (*(b)) &= (a) )
     69#elif MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_3
     70# define OSAtomicOr32( a, b ) BitOrAtomic( a, (UInt32 *) b )
     71# define OSAtomicAnd32( a, b ) BitAndAtomic( a, (UInt32 *) b )
    6972#else
    7073# include <libkern/OSAtomic.h>
    7174#endif
  • src/hostapi/alsa/pa_linux_alsa.c

     
    621621    StreamDirection streamDir;
    622622
    623623    snd_pcm_channel_area_t *channelAreas;  /* Needed for channel adaption */
     624    int card;
    624625} PaAlsaStreamComponent;
    625626
    626627/* Implementation specific stream structure */
     
    18731874{
    18741875    PaError result = paNoError;
    18751876    PaSampleFormat userSampleFormat = params->sampleFormat, hostSampleFormat = paNoError;
     1877    snd_pcm_info_t* pcmInfo;
    18761878    assert( params->channelCount > 0 );
    18771879
    18781880    /* Make sure things have an initial value */
     
    19001902    self->device = params->device;
    19011903
    19021904    PA_ENSURE( AlsaOpen( &alsaApi->baseHostApiRep, params, streamDir, &self->pcm ) );
     1905
     1906    snd_pcm_info_alloca( &pcmInfo );
     1907    self->card = snd_pcm_info_get_card( pcmInfo );
    19031908    self->nfds = alsa_snd_pcm_poll_descriptors_count( self->pcm );
    19041909
    19051910    PA_ENSURE( hostSampleFormat = PaUtil_SelectClosestAvailableFormat( GetAvailableFormats( self->pcm ), userSampleFormat ) );
     
    45884593    /* XXX: More descriptive error? */
    45894594    PA_UNLESS( stream->capture.pcm, paDeviceUnavailable );
    45904595
    4591     alsa_snd_pcm_info_alloca( &pcmInfo );
    4592     PA_ENSURE( alsa_snd_pcm_info( stream->capture.pcm, pcmInfo ) );
    4593     *card = alsa_snd_pcm_info_get_card( pcmInfo );
     4596    *card = stream->capture.card;
    45944597
    45954598error:
    45964599    return result;
     
    46074610    /* XXX: More descriptive error? */
    46084611    PA_UNLESS( stream->playback.pcm, paDeviceUnavailable );
    46094612
    4610     alsa_snd_pcm_info_alloca( &pcmInfo );
    4611     PA_ENSURE( alsa_snd_pcm_info( stream->playback.pcm, pcmInfo ) );
    4612     *card = alsa_snd_pcm_info_get_card( pcmInfo );
     4613    *card = stream->playback.card;
    46134614
    46144615error:
    46154616    return result;
  • src/hostapi/oss/pa_unix_oss.c

     
    20432043#endif
    20442044}
    20452045
     2046const char *PaOSS_GetStreamInputDevice( PaStream* s )
     2047{
     2048    PaOssStream *stream = (PaOssStream*)s;
     2049
     2050    if( stream->capture )
     2051    {
     2052      return stream->capture->devName;
     2053    }
     2054
     2055   return NULL;
     2056}
     2057
     2058const char *PaOSS_GetStreamOutputDevice( PaStream* s )
     2059{
     2060    PaOssStream *stream = (PaOssStream*)s;
     2061
     2062    if( stream->playback )
     2063    {
     2064      return stream->playback->devName;
     2065    }
     2066
     2067   return NULL;
     2068}
  • configure.in

     
    405405                   DLL_LIBS="$DLL_LIBS -lossaudio"
    406406                   LIBS="$LIBS -lossaudio"
    407407           fi
     408           INCLUDES="$INCLUDES pa_unix_oss.h"
    408409           AC_DEFINE(PA_USE_OSS,1)
    409410        fi
    410411