yocto_audioout.h
Go to the documentation of this file.
1 /*********************************************************************
2  *
3  * $Id: yocto_audioout.h 28748 2017-10-03 08:23:39Z seb $
4  *
5  * Declares yFindAudioOut(), the high-level API for AudioOut functions
6  *
7  * - - - - - - - - - License information: - - - - - - - - -
8  *
9  * Copyright (C) 2011 and beyond by Yoctopuce Sarl, Switzerland.
10  *
11  * Yoctopuce Sarl (hereafter Licensor) grants to you a perpetual
12  * non-exclusive license to use, modify, copy and integrate this
13  * file into your software for the sole purpose of interfacing
14  * with Yoctopuce products.
15  *
16  * You may reproduce and distribute copies of this file in
17  * source or object form, as long as the sole purpose of this
18  * code is to interface with Yoctopuce products. You must retain
19  * this notice in the distributed source file.
20  *
21  * You should refer to Yoctopuce General Terms and Conditions
22  * for additional information regarding your rights and
23  * obligations.
24  *
25  * THE SOFTWARE AND DOCUMENTATION ARE PROVIDED 'AS IS' WITHOUT
26  * WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING
27  * WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, FITNESS
28  * FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO
29  * EVENT SHALL LICENSOR BE LIABLE FOR ANY INCIDENTAL, SPECIAL,
30  * INDIRECT OR CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA,
31  * COST OF PROCUREMENT OF SUBSTITUTE GOODS, TECHNOLOGY OR
32  * SERVICES, ANY CLAIMS BY THIRD PARTIES (INCLUDING BUT NOT
33  * LIMITED TO ANY DEFENSE THEREOF), ANY CLAIMS FOR INDEMNITY OR
34  * CONTRIBUTION, OR OTHER SIMILAR COSTS, WHETHER ASSERTED ON THE
35  * BASIS OF CONTRACT, TORT (INCLUDING NEGLIGENCE), BREACH OF
36  * WARRANTY, OR OTHERWISE.
37  *
38  *********************************************************************/
39 
40 
41 #ifndef YOCTO_AUDIOOUT_H
42 #define YOCTO_AUDIOOUT_H
43 
44 #include "yocto_api.h"
45 #include <cfloat>
46 #include <cmath>
47 #include <map>
48 
49 //--- (YAudioOut return codes)
50 //--- (end of YAudioOut return codes)
51 //--- (YAudioOut definitions)
52 class YAudioOut; // forward declaration
53 
54 typedef void (*YAudioOutValueCallback)(YAudioOut *func, const string& functionValue);
55 #ifndef _Y_MUTE_ENUM
56 #define _Y_MUTE_ENUM
57 typedef enum {
61 } Y_MUTE_enum;
62 #endif
63 #define Y_VOLUME_INVALID (YAPI_INVALID_UINT)
64 #define Y_VOLUMERANGE_INVALID (YAPI_INVALID_STRING)
65 #define Y_SIGNAL_INVALID (YAPI_INVALID_INT)
66 #define Y_NOSIGNALFOR_INVALID (YAPI_INVALID_INT)
67 //--- (end of YAudioOut definitions)
68 
69 //--- (YAudioOut declaration)
76 #ifdef __BORLANDC__
77 #pragma option push -w-8022
78 #endif
79 //--- (end of YAudioOut declaration)
80 protected:
81  //--- (YAudioOut attributes)
82  // Attributes (function value cache)
83  int _volume;
85  string _volumeRange;
86  int _signal;
89 
90  friend YAudioOut *yFindAudioOut(const string& func);
91  friend YAudioOut *yFirstAudioOut(void);
92 
93  // Function-specific method for parsing of JSON output and caching result
94  virtual int _parseAttr(YJSONObject* json_val);
95 
96  // Constructor is protected, use yFindAudioOut factory function to instantiate
97  YAudioOut(const string& func);
98  //--- (end of YAudioOut attributes)
99 
100 public:
101  ~YAudioOut();
102  //--- (YAudioOut accessors declaration)
103 
104  static const int VOLUME_INVALID = YAPI_INVALID_UINT;
105  static const Y_MUTE_enum MUTE_FALSE = Y_MUTE_FALSE;
106  static const Y_MUTE_enum MUTE_TRUE = Y_MUTE_TRUE;
107  static const Y_MUTE_enum MUTE_INVALID = Y_MUTE_INVALID;
108  static const string VOLUMERANGE_INVALID;
109  static const int SIGNAL_INVALID = YAPI_INVALID_INT;
110  static const int NOSIGNALFOR_INVALID = YAPI_INVALID_INT;
111 
119  int get_volume(void);
120 
121  inline int volume(void)
122  { return this->get_volume(); }
123 
133  int set_volume(int newval);
134  inline int setVolume(int newval)
135  { return this->set_volume(newval); }
136 
144  Y_MUTE_enum get_mute(void);
145 
146  inline Y_MUTE_enum mute(void)
147  { return this->get_mute(); }
148 
159  int set_mute(Y_MUTE_enum newval);
160  inline int setMute(Y_MUTE_enum newval)
161  { return this->set_mute(newval); }
162 
173  string get_volumeRange(void);
174 
175  inline string volumeRange(void)
176  { return this->get_volumeRange(); }
177 
185  int get_signal(void);
186 
187  inline int signal(void)
188  { return this->get_signal(); }
189 
197  int get_noSignalFor(void);
198 
199  inline int noSignalFor(void)
200  { return this->get_noSignalFor(); }
201 
229  static YAudioOut* FindAudioOut(string func);
230 
242  virtual int registerValueCallback(YAudioOutValueCallback callback);
244 
245  virtual int _invokeValueCallback(string value);
246 
247 
248  inline static YAudioOut* Find(string func)
249  { return YAudioOut::FindAudioOut(func); }
250 
258  YAudioOut *nextAudioOut(void);
259  inline YAudioOut *next(void)
260  { return this->nextAudioOut();}
261 
271  static YAudioOut* FirstAudioOut(void);
272  inline static YAudioOut* First(void)
273  { return YAudioOut::FirstAudioOut();}
274 #ifdef __BORLANDC__
275 #pragma option pop
276 #endif
277  //--- (end of YAudioOut accessors declaration)
278 };
279 
280 //--- (YAudioOut functions declaration)
281 
309 inline YAudioOut* yFindAudioOut(const string& func)
310 { return YAudioOut::FindAudioOut(func);}
321 { return YAudioOut::FirstAudioOut();}
322 
323 //--- (end of YAudioOut functions declaration)
324 
325 #endif
YAudioOut * yFindAudioOut(const string &func)
Y_MUTE_enum mute(void)
Y_MUTE_enum
Definition: yocto_audioin.h:57
int signal(void)
int _noSignalFor
YAudioOut * next(void)
int setMute(Y_MUTE_enum newval)
#define YAPI_INVALID_UINT
Definition: yocto_api.h:71
int volume(void)
Y_MUTE_enum
YAudioOutValueCallback _valueCallbackAudioOut
virtual int _parseAttr(YJSONObject *json_val)
Definition: yocto_api.cpp:2367
Y_MUTE_enum _mute
static const string VOLUMERANGE_INVALID
YAudioOut * yFirstAudioOut(void)
static YAudioOut * First(void)
int setVolume(int newval)
virtual int registerValueCallback(YFunctionValueCallback callback)
Definition: yocto_api.cpp:2544
static YAudioOut * FirstAudioOut(void)
#define YOCTO_CLASS_EXPORT
Definition: yocto_api.h:61
static YAudioOut * Find(string func)
static YAudioOut * FindAudioOut(string func)
string volumeRange(void)
int noSignalFor(void)
void(* YAudioOutValueCallback)(YAudioOut *func, const string &functionValue)
string _volumeRange
#define YAPI_INVALID_INT
Definition: yocto_api.h:70
virtual int _invokeValueCallback(string value)
Definition: yocto_api.cpp:2563


yoctopuce_altimeter
Author(s): Anja Sheppard
autogenerated on Mon Jun 10 2019 15:49:11