zdk.net
AudioEndpointControl.h
1 //
2 // AudioEndpointControl.h
3 // ZDK
4 //
5 
6 #ifndef ZDK_NET_AudioEndpointControl_h
7 #define ZDK_NET_AudioEndpointControl_h
8 
9 #include "native_shared_ptr.h"
10 #include "PublicInterfaces.h"
11 #include "AudioRoutingEndpoint.h"
12 #include "EchoCancellationType.h"
13 #include "AudioSourcePresetType.h"
14 #include "AudioDevice.h"
15 #include "AutomaticGainControlType.h"
16 #include "HostAPI.h"
17 #include "AudioResampler.h"
18 #include "AudioFileFormat.h"
19 #include "Sound.h"
20 #include "AudioOutputDeviceType.h"
21 #include "AudioEventsHandler.h"
22 #include "Result.h"
23 #include "ZHandle.h"
24 
25 using namespace System::Collections::Generic;
26 
27 namespace ZDK_NET
28 {
29  ref class AudioDevice;
30  ref class Sound;
31  ref class AudioEventsHandler;
32  ref class Result;
33 
38  public ref class AudioEndpointControl : ZHandle
39  {
40  private:
41  //LISTENERS:
42  static GeneralStatusEventListener *AudioEventsHandler_Listener = nullptr;
43 
44  static bool RegisterEventListeners()
45  {
46  std::shared_ptr<GeneralStatusEventListener> AudioEventsHandler_Listener_tmp = std::make_shared<GeneralStatusEventListener>();
47  AudioEventsHandler_Listener = AudioEventsHandler_Listener_tmp.get();
48  listenersMap->try_emplace(reinterpret_cast<intptr_t>(AudioEventsHandler_Listener), std::move(AudioEventsHandler_Listener_tmp));
49  return true;
50  }
51 
52  static bool RegisteredEventListeners = RegisterEventListeners();
53  public:
54  ZDK::IAudioEndpointControl* cppRef = nullptr;
55 
56  AudioEndpointControl(ZDK::Shared::AudioEndpointControl src);
59 
68  property ZDK_NET::AudioRoutingEndpoint AudioEndpoint
69  {
70  ZDK_NET::AudioRoutingEndpoint get();
71  void set(ZDK_NET::AudioRoutingEndpoint value);
72  }
73 
82  property double MicLevel
83  {
84  double get();
85  void set(double value);
86  }
87 
99  property double OutputLevel
100  {
101  double get();
102  void set(double value);
103  }
104 
116  property double RingLevel
117  {
118  double get();
119  void set(double value);
120  }
121 
130  property ZDK_NET::EchoCancellationType EchoCancellation
131  {
132  ZDK_NET::EchoCancellationType get();
133  void set(ZDK_NET::EchoCancellationType value);
134  }
135 
145  property bool HighPassFilter
146  {
147  bool get();
148  void set(bool value);
149  }
150 
163  property float PreAmplifier
164  {
165  float get();
166  void set(float value);
167  }
168 
178  property bool NoiseSuppression
179  {
180  bool get();
181  void set(bool value);
182  }
183 
192  property ZDK_NET::AudioSourcePresetType AudioSourcePreset
193  {
194  ZDK_NET::AudioSourcePresetType get();
195  void set(ZDK_NET::AudioSourcePresetType value);
196  }
197 
204  property List<AudioDevice^>^ AudioDevices
205  {
206  List<AudioDevice^>^ get();
207  }
208 
218  property bool MicBoost
219  {
220  bool get();
221  void set(bool value);
222  }
223 
240  property bool EnableFixedSpeakerGain
241  {
242  bool get();
243  void set(bool value);
244  }
245 
276  property double FixedSpeakerGain
277  {
278  double get();
279  void set(double value);
280  }
281 
295  ZDK_NET::AutomaticGainControlType GetAutomaticGainControlMode();
296 
307 
325  ZDK_NET::Result^ SetAutomaticGainControlMode(ZDK_NET::AutomaticGainControlType type, float gain);
326 
335  ZDK_NET::Result^ HostApi(ZDK_NET::HostAPI value);
336 
352  ZDK_NET::Result^ Resampler(ZDK_NET::AudioResampler value);
353 
362  ZDK_NET::AudioDevice^ GetDeviceByName(System::String^ name);
363 
371 
380 
388 
397 
405 
414 
433  ZDK_NET::Sound^ AddSoundFromMemory(unsigned char* data, int length, int sampleLen, int frequency, bool repeat, int pauseMs);
434 
454  ZDK_NET::Sound^ AddSoundFromFile(System::String^ filePath, ZDK_NET::AudioFileFormat fileFormat, bool repeat, int pauseMs);
455 
469  ZDK_NET::Result^ StartSound(ZDK_NET::Sound^ sound, ZDK_NET::AudioOutputDeviceType outputType);
470 
482  ZDK_NET::Result^ StopSound(ZDK_NET::Sound^ sound, ZDK_NET::AudioOutputDeviceType outputType);
483 
498  ZDK_NET::Result^ StartPlayback(ZDK_NET::Sound^ sound, ZDK_NET::AudioOutputDeviceType monitorDevice);
499 
509 
526  ZDK_NET::Result^ SetCallRecordingNotifySound(ZDK_NET::Sound^ sound, ZDK_NET::AudioOutputDeviceType monitorDevice);
527 
539 
551 
559 
567 
568  virtual long long Handle() override;
569 
570  virtual void Initialize() override;
571 
572  virtual void ReleaseReference() override;
573 
574  };
575 }
576 
577 #endif
ZDK_NET::AudioEndpointControl::SetAutomaticGainControlMode
ZDK_NET::Result ^ SetAutomaticGainControlMode(ZDK_NET::AutomaticGainControlType type, float gain)
Configures the Automatic Gain Control (AGC) filter working mode.
ZDK_NET::Result
API invocation status result.
Definition: Result.h:24
ZDK_NET::AudioEndpointControl::StartSound
ZDK_NET::Result ^ StartSound(ZDK_NET::Sound^ sound, ZDK_NET::AudioOutputDeviceType outputType)
Start playback of a sound.
ZDK_NET::AudioEndpointControl::GetCurrentOutputDevice
ZDK_NET::AudioDevice ^ GetCurrentOutputDevice()
Gets the selected output audio device.
ZDK_NET::AudioEndpointControl::SetCurrentRingDevice
ZDK_NET::Result ^ SetCurrentRingDevice(ZDK_NET::AudioDevice^ device)
Select the ringing audio device.
ZDK_NET::AudioDevice
Audio device description.
Definition: AudioDevice.h:22
ZDK_NET::AudioEndpointControl::AddStatusListener
void AddStatusListener(ZDK_NET::AudioEventsHandler^ value)
Adds audio events listener.
ZDK_NET::AudioEndpointControl::SetCurrentOutputDevice
ZDK_NET::Result ^ SetCurrentOutputDevice(ZDK_NET::AudioDevice^ device)
Select the output audio device.
ZDK_NET::AudioEndpointControl::MuteInput
ZDK_NET::Result ^ MuteInput(bool value)
Mute or unmute the input device/microphone.
ZDK_NET::AudioEndpointControl::Resampler
ZDK_NET::Result ^ Resampler(ZDK_NET::AudioResampler value)
Configures the audio resampler to be used.
ZDK_NET::Sound
ZDK Sound description.
Definition: Sound.h:21
ZDK_NET::AudioEndpointControl::AddSoundFromMemory
ZDK_NET::Sound ^ AddSoundFromMemory(unsigned char *data, int length, int sampleLen, int frequency, bool repeat, int pauseMs)
Load a sound from a memory buffer.
ZDK_NET::AudioEndpointControl::SetCurrentInputDevice
ZDK_NET::Result ^ SetCurrentInputDevice(ZDK_NET::AudioDevice^ device)
Select the input audio device.
ZDK_NET::AudioEndpointControl::StopSound
ZDK_NET::Result ^ StopSound(ZDK_NET::Sound^ sound, ZDK_NET::AudioOutputDeviceType outputType)
Stops playback of a sound.
GeneralStatusEventListener
Definition: GeneralStatusEventListener.h:90
ZDK_NET::AudioEndpointControl::GetCurrentRingDevice
ZDK_NET::AudioDevice ^ GetCurrentRingDevice()
Gets the selected ringing audio device.
ZDK_NET::AudioEndpointControl::StopPlayback
ZDK_NET::Result ^ StopPlayback()
Stops any playback.
ZDK_NET::AudioEndpointControl::MuteOutput
ZDK_NET::Result ^ MuteOutput(bool value)
Mute or unmute the output device/speaker.
ZDK_NET::AudioEndpointControl::GetDeviceByName
ZDK_NET::AudioDevice ^ GetDeviceByName(System::String^ name)
Gets an audio device with the given name if exists, otherwise - nullptr.
ZDK_NET::AudioEndpointControl::GetCurrentInputDevice
ZDK_NET::AudioDevice ^ GetCurrentInputDevice()
Gets the selected input audio device.
ZDK_NET::AudioEndpointControl
Audio endpoint's main entry point.
Definition: AudioEndpointControl.h:39
ZDK_NET::AudioEventsHandler
Definition: AudioEventsHandler.h:114
ZDK_NET::AudioEndpointControl::DropStatusListener
void DropStatusListener(ZDK_NET::AudioEventsHandler^ value)
Drops audio events listener.
ZDK_NET::AudioEndpointControl::StartPlayback
ZDK_NET::Result ^ StartPlayback(ZDK_NET::Sound^ sound, ZDK_NET::AudioOutputDeviceType monitorDevice)
Starts playback over the current call.
ZDK_NET::AudioEndpointControl::HostApi
ZDK_NET::Result ^ HostApi(ZDK_NET::HostAPI value)
Configures the audio host API to be used.
ZDK_NET::AudioEndpointControl::AddSoundFromFile
ZDK_NET::Sound ^ AddSoundFromFile(System::String^ filePath, ZDK_NET::AudioFileFormat fileFormat, bool repeat, int pauseMs)
Load a sound from a file.
ZDK_NET::AudioEndpointControl::GetAutomaticGainControlMode
ZDK_NET::AutomaticGainControlType GetAutomaticGainControlMode()
Gets the configured Automatic Gain Control (AGC) filter working mode.
ZDK_NET::AudioEndpointControl::SetCallRecordingNotifySound
ZDK_NET::Result ^ SetCallRecordingNotifySound(ZDK_NET::Sound^ sound, ZDK_NET::AudioOutputDeviceType monitorDevice)
Sets the sound to be played over the current call on every recording start.
ZDK_NET::AudioEndpointControl::GetAutomaticGainControlGain
float GetAutomaticGainControlGain()
Gets the configured Automatic Gain Control (AGC) fixed gain.
ZDK_NET::ZHandle
Definition: ZHandle.h:18