GNU Radio Manual and C++ API Reference  v3.9.2.0-89-gb7c7001e
The Free & Open Software Radio Ecosystem
osx_impl.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2006, 2013-2014 Free Software Foundation, Inc.
4  *
5  * This file is part of GNU Radio.
6  *
7  * SPDX-License-Identifier: GPL-3.0-or-later
8  *
9  */
10 
11 #ifndef INCLUDED_AUDIO_OSX_IMPL_H
12 #define INCLUDED_AUDIO_OSX_IMPL_H
13 
14 #include <gnuradio/audio/api.h>
15 
16 #include <iostream>
17 #include <vector>
18 
19 #include <string.h>
20 
21 #include <AudioToolbox/AudioToolbox.h>
22 #include <AudioUnit/AudioUnit.h>
23 
24 // Check the version of MacOSX being used
25 #ifdef __APPLE_CC__
26 #include <AvailabilityMacros.h>
27 #ifndef MAC_OS_X_VERSION_10_6
28 #define MAC_OS_X_VERSION_10_6 1060
29 #endif
30 #if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6
31 #define GR_USE_OLD_AUDIO_UNIT
32 #endif
33 #endif
34 
35 // helper function to print an ASBD
36 
37 std::ostream& GR_AUDIO_API operator<<(std::ostream& s,
38  const AudioStreamBasicDescription& asbd);
39 
40 namespace gr {
41 namespace audio {
42 namespace osx {
43 
44 // returns the number of channels for the provided AudioDeviceID,
45 // input and/or output depending on if the pointer is valid.
46 
48  UInt32* n_input,
49  UInt32* n_output);
50 
51 // search all known audio devices, input or output, for all that
52 // match the provided device_name string (in part or in whole).
53 // Returns a vector of all matching IDs, and another of all
54 // matching names. If the device name is empty, then match all
55 // input or output devices.
56 
57 void GR_AUDIO_API find_audio_devices(const std::string& device_name,
58  bool is_input,
59  std::vector<AudioDeviceID>* all_ad_ids,
60  std::vector<std::string>* all_names);
61 
62 } /* namespace osx */
63 } /* namespace audio */
64 } /* namespace gr */
65 
66 #endif /* INCLUDED_AUDIO_OSX_IMPL_H */
#define GR_AUDIO_API
Definition: gr-audio/include/gnuradio/audio/api.h:18
void GR_AUDIO_API find_audio_devices(const std::string &device_name, bool is_input, std::vector< AudioDeviceID > *all_ad_ids, std::vector< std::string > *all_names)
void GR_AUDIO_API get_num_channels_for_audio_device_id(AudioDeviceID ad_id, UInt32 *n_input, UInt32 *n_output)
GNU Radio logging wrapper for log4cpp library (C++ port of log4j)
Definition: basic_block.h:29
std::ostream &GR_AUDIO_API operator<<(std::ostream &s, const AudioStreamBasicDescription &asbd)