<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[134108] trunk/dports/audio/portaudio</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="https://trac.macports.org/changeset/134108">134108</a></dd>
<dt>Author</dt> <dd>hum@macports.org</dd>
<dt>Date</dt> <dd>2015-03-18 08:38:41 -0700 (Wed, 18 Mar 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>portaudio: add patch-audacity-portmixer.diff to suport audacity; see #47172</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkdportsaudioportaudioPortfile">trunk/dports/audio/portaudio/Portfile</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkdportsaudioportaudiofilespatchaudacityportmixerdiff">trunk/dports/audio/portaudio/files/patch-audacity-portmixer.diff</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkdportsaudioportaudioPortfile"></a>
<div class="modfile"><h4>Modified: trunk/dports/audio/portaudio/Portfile (134107 => 134108)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/audio/portaudio/Portfile        2015-03-18 15:12:33 UTC (rev 134107)
+++ trunk/dports/audio/portaudio/Portfile        2015-03-18 15:38:41 UTC (rev 134108)
</span><span class="lines">@@ -5,6 +5,7 @@
</span><span class="cx"> 
</span><span class="cx"> name                portaudio
</span><span class="cx"> version             19.20140130
</span><ins>+revision            1
</ins><span class="cx"> categories          audio devel
</span><span class="cx"> platforms           darwin macosx
</span><span class="cx"> maintainers         hum openmaintainer
</span><span class="lines">@@ -40,7 +41,8 @@
</span><span class="cx"> # patch-configure removes -Werror, and adds -DNDEBUG.
</span><span class="cx"> patchfiles          patch-configure \
</span><span class="cx">                     patch-ltmain.sh.diff \
</span><del>-                    patch-src__common__pa_types.h
</del><ins>+                    patch-src__common__pa_types.h \
+                    patch-audacity-portmixer.diff
</ins><span class="cx"> 
</span><span class="cx"> platform darwin {
</span><span class="cx">     if {${os.major} &gt;= 10} {
</span></span></pre></div>
<a id="trunkdportsaudioportaudiofilespatchaudacityportmixerdiff"></a>
<div class="addfile"><h4>Added: trunk/dports/audio/portaudio/files/patch-audacity-portmixer.diff (0 => 134108)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/audio/portaudio/files/patch-audacity-portmixer.diff                                (rev 0)
+++ trunk/dports/audio/portaudio/files/patch-audacity-portmixer.diff        2015-03-18 15:38:41 UTC (rev 134108)
</span><span class="lines">@@ -0,0 +1,322 @@
</span><ins>+Description: Add features needed to make portmixer work with audacity.
+Author: Audacity Team
+Last-Update: 2011-12-07
+
+--- include/pa_win_ds.h
++++ include/pa_win_ds.h
+@@ -86,6 +86,21 @@

+ }PaWinDirectSoundStreamInfo;

++/** Retrieve the GUID of the input device.
++
++ @param stream The stream to query.
++
++ @return A pointer to the GUID, or NULL if none.
++*/
++LPGUID PaWinDS_GetStreamInputGUID( PaStream* s );
++
++/** Retrieve the GUID of the output device.
++
++ @param stream The stream to query.
++
++ @return A pointer to the GUID, or NULL if none.
++*/
++LPGUID PaWinDS_GetStreamOutputGUID( PaStream* s );


+ #ifdef __cplusplus
+--- include/portaudio.h
++++ include/portaudio.h
+@@ -1146,6 +1146,15 @@
+ signed long Pa_GetStreamWriteAvailable( PaStream* stream );


++/** Retrieve the host type handling an open stream.
++
++ @return Returns a non-negative value representing the host API type
++ handling an open stream or, a PaErrorCode (which are always negative)
++ if PortAudio is not initialized or an error is encountered.
++*/
++PaHostApiTypeId Pa_GetStreamHostApiType( PaStream* stream );
++
++
+ /* Miscellaneous utilities */


+--- /dev/null
++++ include/pa_unix_oss.h
+@@ -0,0 +1,104 @@
++#ifndef PA_UNIX_OSS_H
++#define PA_UNIX_OSS_H
++
++/*
++ * $Id: portaudio.patch,v 1.10 2009-06-30 04:52:59 llucius Exp $
++ * PortAudio Portable Real-Time Audio Library
++ * OSS-specific extensions
++ *
++ * Copyright (c) 1999-2000 Ross Bencina and Phil Burk
++ *
++ * Permission is hereby granted, free of charge, to any person obtaining
++ * a copy of this software and associated documentation files
++ * (the &quot;Software&quot;), to deal in the Software without restriction,
++ * including without limitation the rights to use, copy, modify, merge,
++ * publish, distribute, sublicense, and/or sell copies of the Software,
++ * and to permit persons to whom the Software is furnished to do so,
++ * subject to the following conditions:
++ *
++ * The above copyright notice and this permission notice shall be
++ * included in all copies or substantial portions of the Software.
++ *
++ * Any person wishing to distribute modifications to the Software is
++ * requested to send the modifications to the original developer so that
++ * they can be incorporated into the canonical version.
++ *
++ * THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND,
++ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
++ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
++ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
++ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
++ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
++ *
++ */
++
++/** @file
++ * OSS-specific PortAudio API extension header file.
++ */
++
++#ifdef __cplusplus
++extern &quot;C&quot; {
++#endif
++
++const char *PaOSS_GetStreamInputDevice( PaStream *s );
++
++const char *PaOSS_GetStreamOutputDevice( PaStream *s );
++
++#ifdef __cplusplus
++}
++#endif
++
++#endif
++#ifndef PA_UNIX_OSS_H
++#define PA_UNIX_OSS_H
++
++/*
++ * $Id: portaudio.patch,v 1.10 2009-06-30 04:52:59 llucius Exp $
++ * PortAudio Portable Real-Time Audio Library
++ * OSS-specific extensions
++ *
++ * Copyright (c) 1999-2000 Ross Bencina and Phil Burk
++ *
++ * Permission is hereby granted, free of charge, to any person obtaining
++ * a copy of this software and associated documentation files
++ * (the &quot;Software&quot;), to deal in the Software without restriction,
++ * including without limitation the rights to use, copy, modify, merge,
++ * publish, distribute, sublicense, and/or sell copies of the Software,
++ * and to permit persons to whom the Software is furnished to do so,
++ * subject to the following conditions:
++ *
++ * The above copyright notice and this permission notice shall be
++ * included in all copies or substantial portions of the Software.
++ *
++ * Any person wishing to distribute modifications to the Software is
++ * requested to send the modifications to the original developer so that
++ * they can be incorporated into the canonical version.
++ *
++ * THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND,
++ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
++ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
++ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
++ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
++ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
++ *
++ */
++
++/** @file
++ * OSS-specific PortAudio API extension header file.
++ */
++
++#ifdef __cplusplus
++extern &quot;C&quot; {
++#endif
++
++const char *PaOSS_GetStreamInputDevice( PaStream *s );
++
++const char *PaOSS_GetStreamOutputDevice( PaStream *s );
++
++#ifdef __cplusplus
++}
++#endif
++
++#endif
+--- src/common/pa_front.c
++++ src/common/pa_front.c
+@@ -1216,8 +1216,10 @@
+                                   hostApiInputParametersPtr, hostApiOutputParametersPtr,
+                                   sampleRate, framesPerBuffer, streamFlags, streamCallback, userData );

+-    if( result == paNoError )
++    if( result == paNoError ) {
+         AddOpenStream( *stream );
++        PA_STREAM_REP(*stream)-&gt;hostApiType = hostApi-&gt;info.type;
++    }


+     PA_LOGAPI((&quot;Pa_OpenStream returned:\n&quot; ));
+@@ -1729,6 +1731,32 @@
+     return result;
+ }

++PaHostApiTypeId Pa_GetStreamHostApiType( PaStream* stream )
++{
++    PaError error = PaUtil_ValidateStreamPointer( stream );
++    PaHostApiTypeId result;
++
++#ifdef PA_LOG_API_CALLS
++    PaUtil_DebugPrint(&quot;Pa_GetStreamHostApiType called:\n&quot; );
++    PaUtil_DebugPrint(&quot;\tPaStream* stream: 0x%p\n&quot;, stream );
++#endif
++
++    if( error == paNoError )
++    {
++        result = PA_STREAM_REP(stream)-&gt;hostApiType;
++    }
++    else
++    {
++        result = (PaHostApiTypeId) error;
++    }
++
++#ifdef PA_LOG_API_CALLS
++    PaUtil_DebugPrint(&quot;Pa_GetStreamHostApiType returned:\n&quot; );
++    PaUtil_DebugPrint(&quot;\tPaError: %d ( %s )\n\n&quot;, result, Pa_GetErrorText( result ) );
++#endif
++
++    return result;
++}

+ PaError Pa_GetSampleSize( PaSampleFormat format )
+ {
+--- src/common/pa_stream.c
++++ src/common/pa_stream.c
+@@ -93,6 +93,8 @@
+     streamRepresentation-&gt;streamInfo.inputLatency = 0.;
+     streamRepresentation-&gt;streamInfo.outputLatency = 0.;
+     streamRepresentation-&gt;streamInfo.sampleRate = 0.;
++
++    streamRepresentation-&gt;hostApiType = 0;
+ }


+--- src/common/pa_stream.h
++++ src/common/pa_stream.h
+@@ -152,6 +152,7 @@
+     PaStreamFinishedCallback *streamFinishedCallback;
+     void *userData;
+     PaStreamInfo streamInfo;
++    PaHostApiTypeId hostApiType;
+ } PaUtilStreamRepresentation;


+--- src/hostapi/coreaudio/pa_mac_core_blocking.c
++++ src/hostapi/coreaudio/pa_mac_core_blocking.c
+@@ -66,6 +66,9 @@
+ #ifdef MOSX_USE_NON_ATOMIC_FLAG_BITS
+ # define OSAtomicOr32( a, b ) ( (*(b)) |= (a) )
+ # define OSAtomicAnd32( a, b ) ( (*(b)) &amp;= (a) )
++#elif MAC_OS_X_VERSION_MAX_ALLOWED &lt;= MAC_OS_X_VERSION_10_3
++# define OSAtomicOr32( a, b ) BitOrAtomic( a, (UInt32 *) b )
++# define OSAtomicAnd32( a, b ) BitAndAtomic( a, (UInt32 *) b )
+ #else
+ # include &lt;libkern/OSAtomic.h&gt;
+ #endif
+--- src/hostapi/alsa/pa_linux_alsa.c
++++ src/hostapi/alsa/pa_linux_alsa.c
+@@ -621,6 +621,7 @@
+     StreamDirection streamDir;

+     snd_pcm_channel_area_t *channelAreas;  /* Needed for channel adaption */
++    int card;
+ } PaAlsaStreamComponent;

+ /* Implementation specific stream structure */
+@@ -1873,6 +1874,7 @@
+ {
+     PaError result = paNoError;
+     PaSampleFormat userSampleFormat = params-&gt;sampleFormat, hostSampleFormat = paNoError;
++    snd_pcm_info_t* pcmInfo;
+     assert( params-&gt;channelCount &gt; 0 );

+     /* Make sure things have an initial value */
+@@ -1900,6 +1902,9 @@
+     self-&gt;device = params-&gt;device;

+     PA_ENSURE( AlsaOpen( &amp;alsaApi-&gt;baseHostApiRep, params, streamDir, &amp;self-&gt;pcm ) );
++
++    snd_pcm_info_alloca( &amp;pcmInfo );
++    self-&gt;card = snd_pcm_info_get_card( pcmInfo );
+     self-&gt;nfds = alsa_snd_pcm_poll_descriptors_count( self-&gt;pcm );

+     PA_ENSURE( hostSampleFormat = PaUtil_SelectClosestAvailableFormat( GetAvailableFormats( self-&gt;pcm ), userSampleFormat ) );
+@@ -4588,9 +4593,7 @@
+     /* XXX: More descriptive error? */
+     PA_UNLESS( stream-&gt;capture.pcm, paDeviceUnavailable );

+-    alsa_snd_pcm_info_alloca( &amp;pcmInfo );
+-    PA_ENSURE( alsa_snd_pcm_info( stream-&gt;capture.pcm, pcmInfo ) );
+-    *card = alsa_snd_pcm_info_get_card( pcmInfo );
++    *card = stream-&gt;capture.card;

+ error:
+     return result;
+@@ -4607,9 +4610,7 @@
+     /* XXX: More descriptive error? */
+     PA_UNLESS( stream-&gt;playback.pcm, paDeviceUnavailable );

+-    alsa_snd_pcm_info_alloca( &amp;pcmInfo );
+-    PA_ENSURE( alsa_snd_pcm_info( stream-&gt;playback.pcm, pcmInfo ) );
+-    *card = alsa_snd_pcm_info_get_card( pcmInfo );
++    *card = stream-&gt;playback.card;

+ error:
+     return result;
+--- src/hostapi/oss/pa_unix_oss.c
++++ src/hostapi/oss/pa_unix_oss.c
+@@ -2043,3 +2043,26 @@
+ #endif
+ }

++const char *PaOSS_GetStreamInputDevice( PaStream* s )
++{
++    PaOssStream *stream = (PaOssStream*)s;
++
++    if( stream-&gt;capture )
++    {
++      return stream-&gt;capture-&gt;devName;
++    }
++
++   return NULL;
++}
++
++const char *PaOSS_GetStreamOutputDevice( PaStream* s )
++{
++    PaOssStream *stream = (PaOssStream*)s;
++
++    if( stream-&gt;playback )
++    {
++      return stream-&gt;playback-&gt;devName;
++    }
++
++   return NULL;
++}
+--- configure.in
++++ configure.in
+@@ -405,6 +405,7 @@
+                    DLL_LIBS=&quot;$DLL_LIBS -lossaudio&quot;
+                    LIBS=&quot;$LIBS -lossaudio&quot;
+            fi
++           INCLUDES=&quot;$INCLUDES pa_unix_oss.h&quot;
+            AC_DEFINE(PA_USE_OSS,1)
+         fi

</ins></span></pre>
</div>
</div>

</body>
</html>