To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.

The primary repository for this project is hosted at https://github.com/sonic-visualiser/sv-dependency-builds .
This repository is a read-only copy which is updated automatically every hour.

Statistics Download as Zip
| Branch: | Tag: | Revision:

root / src / portaudio_20161030_catalina_patch / bindings / cpp / source / portaudiocpp / CFunCallbackStream.cxx @ 164:9fa11135915a

History | View | Annotate | Download (995 Bytes)

1
#include "portaudiocpp/CFunCallbackStream.hxx"
2

    
3
#include "portaudiocpp/StreamParameters.hxx"
4
#include "portaudiocpp/Exception.hxx"
5

    
6
namespace portaudio
7
{
8
        CFunCallbackStream::CFunCallbackStream()
9
        {
10
        }
11

    
12
        CFunCallbackStream::CFunCallbackStream(const StreamParameters &parameters, PaStreamCallback *funPtr, void *userData)
13
        {
14
                open(parameters, funPtr, userData);
15
        }
16

    
17
        CFunCallbackStream::~CFunCallbackStream()
18
        {
19
                try
20
                {
21
                        close();
22
                }
23
                catch (...)
24
                {
25
                        // ignore all errors
26
                }
27
        }
28

    
29
        // ---------------------------------------------------------------------------------==
30

    
31
        void CFunCallbackStream::open(const StreamParameters &parameters, PaStreamCallback *funPtr, void *userData)
32
        {
33
                PaError err = Pa_OpenStream(&stream_, parameters.inputParameters().paStreamParameters(), parameters.outputParameters().paStreamParameters(), 
34
                        parameters.sampleRate(), parameters.framesPerBuffer(), parameters.flags(), funPtr, userData);
35

    
36
                if (err != paNoError)
37
                {
38
                        throw PaException(err);
39
                }
40
        }
41
}