| 1 | /* |
| 2 | * $Id$ |
| 3 | * Portable Audio I/O Library |
| 4 | * stream interface |
| 5 | * |
| 6 | * Based on the Open Source API proposed by Ross Bencina |
| 7 | * Copyright (c) 2008 Ross Bencina |
| 8 | * |
| 9 | * Permission is hereby granted, free of charge, to any person obtaining |
| 10 | * a copy of this software and associated documentation files |
| 11 | * (the "Software"), to deal in the Software without restriction, |
| 12 | * including without limitation the rights to use, copy, modify, merge, |
| 13 | * publish, distribute, sublicense, and/or sell copies of the Software, |
| 14 | * and to permit persons to whom the Software is furnished to do so, |
| 15 | * subject to the following conditions: |
| 16 | * |
| 17 | * The above copyright notice and this permission notice shall be |
| 18 | * included in all copies or substantial portions of the Software. |
| 19 | * |
| 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
| 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 22 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
| 23 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR |
| 24 | * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF |
| 25 | * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
| 26 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| 27 | */ |
| 28 | |
| 29 | /* |
| 30 | * The text above constitutes the entire PortAudio license; however, |
| 31 | * the PortAudio community also makes the following non-binding requests: |
| 32 | * |
| 33 | * Any person wishing to distribute modifications to the Software is |
| 34 | * requested to send the modifications to the original developer so that |
| 35 | * they can be incorporated into the canonical version. It is also |
| 36 | * requested that these non-binding requests be included along with the |
| 37 | * license above. |
| 38 | */ |
| 39 | |
| 40 | /** @file |
| 41 | @ingroup common_src |
| 42 | |
| 43 | @brief Stream interfaces, representation structures and helper functions |
| 44 | used to interface between pa_front.c host API implementations. |
| 45 | */ |
| 46 | |
| 47 | |
| 48 | #include "pa_stream.h"cxx . . $ `<file>/external/portaudio/pa_stream.h`/ |
| 49 | |
| 50 | |
| 51 | void PaUtil_InitializeStreamInterfacecxx . . $ PaUtil_InitializeStreamInterface(4b35ac35495e68b2).( PaUtilStreamInterfacecxx . . $ PaUtilStreamInterface# *streamInterface, |
| 52 | PaErrorcxx . . $ PaError# (*Close)( PaStreamcxx . . $ PaStream#* ), |
| 53 | PaErrorcxx . . $ PaError# (*Start)( PaStreamcxx . . $ PaStream#* ), |
| 54 | PaErrorcxx . . $ PaError# (*Stop)( PaStreamcxx . . $ PaStream#* ), |
| 55 | PaErrorcxx . . $ PaError# (*Abort)( PaStreamcxx . . $ PaStream#* ), |
| 56 | PaErrorcxx . . $ PaError# (*IsStopped)( PaStreamcxx . . $ PaStream#* ), |
| 57 | PaErrorcxx . . $ PaError# (*IsActive)( PaStreamcxx . . $ PaStream#* ), |
| 58 | PaTimecxx . . $ PaTime# (*GetTime)( PaStreamcxx . . $ PaStream#* ), |
| 59 | double (*GetCpuLoad)( PaStreamcxx . . $ PaStream#* ), |
| 60 | PaErrorcxx . . $ PaError# (*Read)( PaStreamcxx . . $ PaStream#*, void *, unsigned long ), |
| 61 | PaErrorcxx . . $ PaError# (*Write)( PaStreamcxx . . $ PaStream#*, const void *, unsigned long ), |
| 62 | signed long (*GetReadAvailable)( PaStreamcxx . . $ PaStream#* ), |
| 63 | signed long (*GetWriteAvailable)( PaStreamcxx . . $ PaStream#* ) ) |
| 64 | { |
| 65 | streamInterface->Closecxx . . $ $anonymous_type_f57c9f8091ab1748_0#Close. = Close; |
| 66 | streamInterface->Startcxx . . $ $anonymous_type_f57c9f8091ab1748_0#Start. = Start; |
| 67 | streamInterface->Stopcxx . . $ $anonymous_type_f57c9f8091ab1748_0#Stop. = Stop; |
| 68 | streamInterface->Abortcxx . . $ $anonymous_type_f57c9f8091ab1748_0#Abort. = Abort; |
| 69 | streamInterface->IsStoppedcxx . . $ $anonymous_type_f57c9f8091ab1748_0#IsStopped. = IsStopped; |
| 70 | streamInterface->IsActivecxx . . $ $anonymous_type_f57c9f8091ab1748_0#IsActive. = IsActive; |
| 71 | streamInterface->GetTimecxx . . $ $anonymous_type_f57c9f8091ab1748_0#GetTime. = GetTime; |
| 72 | streamInterface->GetCpuLoadcxx . . $ $anonymous_type_f57c9f8091ab1748_0#GetCpuLoad. = GetCpuLoad; |
| 73 | streamInterface->Readcxx . . $ $anonymous_type_f57c9f8091ab1748_0#Read. = Read; |
| 74 | streamInterface->Writecxx . . $ $anonymous_type_f57c9f8091ab1748_0#Write. = Write; |
| 75 | streamInterface->GetReadAvailablecxx . . $ $anonymous_type_f57c9f8091ab1748_0#GetReadAvailable. = GetReadAvailable; |
| 76 | streamInterface->GetWriteAvailablecxx . . $ $anonymous_type_f57c9f8091ab1748_0#GetWriteAvailable. = GetWriteAvailable; |
| 77 | } |
| 78 | |
| 79 | |
| 80 | void PaUtil_InitializeStreamRepresentationcxx . . $ PaUtil_InitializeStreamRepresentation(7f7193855de7d48b).( PaUtilStreamRepresentationcxx . . $ PaUtilStreamRepresentation# *streamRepresentation, |
| 81 | PaUtilStreamInterfacecxx . . $ PaUtilStreamInterface# *streamInterface, |
| 82 | PaStreamCallbackcxx . . $ PaStreamCallback# *streamCallback, |
| 83 | void *userData ) |
| 84 | { |
| 85 | streamRepresentation->magiccxx . . $ PaUtilStreamRepresentation#magic. = PA_STREAM_MAGICcxx . . $ `external/portaudio/pa_stream.h:58:9`!; |
| 86 | streamRepresentation->nextOpenStreamcxx . . $ PaUtilStreamRepresentation#nextOpenStream. = 0; |
| 87 | streamRepresentation->streamInterfacecxx . . $ PaUtilStreamRepresentation#streamInterface. = streamInterface; |
| 88 | streamRepresentation->streamCallbackcxx . . $ PaUtilStreamRepresentation#streamCallback. = streamCallback; |
| 89 | streamRepresentation->streamFinishedCallbackcxx . . $ PaUtilStreamRepresentation#streamFinishedCallback. = 0; |
| 90 | |
| 91 | streamRepresentation->userDatacxx . . $ PaUtilStreamRepresentation#userData. = userData; |
| 92 | |
| 93 | streamRepresentation->streamInfocxx . . $ PaUtilStreamRepresentation#streamInfo..inputLatencycxx . . $ PaStreamInfo#inputLatency. = 0.; |
| 94 | streamRepresentation->streamInfocxx . . $ PaUtilStreamRepresentation#streamInfo..outputLatencycxx . . $ PaStreamInfo#outputLatency. = 0.; |
| 95 | streamRepresentation->streamInfocxx . . $ PaUtilStreamRepresentation#streamInfo..sampleRatecxx . . $ PaStreamInfo#sampleRate. = 0.; |
| 96 | } |
| 97 | |
| 98 | |
| 99 | void PaUtil_TerminateStreamRepresentationcxx . . $ PaUtil_TerminateStreamRepresentation(d99c7cce07513a60).( PaUtilStreamRepresentationcxx . . $ PaUtilStreamRepresentation# *streamRepresentation ) |
| 100 | { |
| 101 | streamRepresentation->magiccxx . . $ PaUtilStreamRepresentation#magic. = 0; |
| 102 | } |
| 103 | |
| 104 | |
| 105 | PaErrorcxx . . $ PaError# PaUtil_DummyReadcxx . . $ PaUtil_DummyRead(c5040b39c98d43dd).( PaStreamcxx . . $ PaStream#* stream, |
| 106 | void *buffer, |
| 107 | unsigned long frames ) |
| 108 | { |
| 109 | (void)stream; /* unused parameter */ |
| 110 | (void)buffer; /* unused parameter */ |
| 111 | (void)frames; /* unused parameter */ |
| 112 | |
| 113 | return paCanNotReadFromACallbackStreamcxx . . $ paCanNotReadFromACallbackStream.; |
| 114 | } |
| 115 | |
| 116 | |
| 117 | PaErrorcxx . . $ PaError# PaUtil_DummyWritecxx . . $ PaUtil_DummyWrite(72e086fd9bc8337a).( PaStreamcxx . . $ PaStream#* stream, |
| 118 | const void *buffer, |
| 119 | unsigned long frames ) |
| 120 | { |
| 121 | (void)stream; /* unused parameter */ |
| 122 | (void)buffer; /* unused parameter */ |
| 123 | (void)frames; /* unused parameter */ |
| 124 | |
| 125 | return paCanNotWriteToACallbackStreamcxx . . $ paCanNotWriteToACallbackStream.; |
| 126 | } |
| 127 | |
| 128 | |
| 129 | signed long PaUtil_DummyGetReadAvailablecxx . . $ PaUtil_DummyGetReadAvailable(72c1818a5177f981).( PaStreamcxx . . $ PaStream#* stream ) |
| 130 | { |
| 131 | (void)stream; /* unused parameter */ |
| 132 | |
| 133 | return paCanNotReadFromACallbackStreamcxx . . $ paCanNotReadFromACallbackStream.; |
| 134 | } |
| 135 | |
| 136 | |
| 137 | signed long PaUtil_DummyGetWriteAvailablecxx . . $ PaUtil_DummyGetWriteAvailable(72c1818a5177f981).( PaStreamcxx . . $ PaStream#* stream ) |
| 138 | { |
| 139 | (void)stream; /* unused parameter */ |
| 140 | |
| 141 | return paCanNotWriteToACallbackStreamcxx . . $ paCanNotWriteToACallbackStream.; |
| 142 | } |
| 143 | |
| 144 | |
| 145 | double PaUtil_DummyGetCpuLoadcxx . . $ PaUtil_DummyGetCpuLoad(a405b17f82753acc).( PaStreamcxx . . $ PaStream#* stream ) |
| 146 | { |
| 147 | (void)stream; /* unused parameter */ |
| 148 | |
| 149 | return 0.0; |
| 150 | } |