1b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org/*
2b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org *  Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
3b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org *
4b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org *  Use of this source code is governed by a BSD-style license
5b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org *  that can be found in the LICENSE file in the root of the source
6b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org *  tree. An additional intellectual property rights grant can be found
7b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org *  in the file PATENTS.  All contributing project authors may
8b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org *  be found in the AUTHORS file in the root of the source tree.
9b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org */
10b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org
11b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org#ifndef WEBRTC_MODULES_AUDIO_CONFERENCE_MIXER_SOURCE_LEVEL_INDICATOR_H_
12b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org#define WEBRTC_MODULES_AUDIO_CONFERENCE_MIXER_SOURCE_LEVEL_INDICATOR_H_
13b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org
140c836bfad33cbd3517e2c145cc24241fb98967d8pbos@webrtc.org#include "webrtc/typedefs.h"
15b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org
16b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.orgnamespace webrtc {
17b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.orgclass LevelIndicator
18b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org{
19b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.orgpublic:
20b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org    enum{TICKS_BEFORE_CALCULATION = 10};
21b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org
22b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org    LevelIndicator();
23b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org    ~LevelIndicator();
24b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org
25b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org    // Updates the level.
2674f9bbbf9efe39e1f7df99aa7d6cb02d57978a5cpbos@webrtc.org    void ComputeLevel(const int16_t* speech,
2774f9bbbf9efe39e1f7df99aa7d6cb02d57978a5cpbos@webrtc.org                      const uint16_t nrOfSamples);
28b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org
2974f9bbbf9efe39e1f7df99aa7d6cb02d57978a5cpbos@webrtc.org    int32_t GetLevel();
30b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.orgprivate:
3174f9bbbf9efe39e1f7df99aa7d6cb02d57978a5cpbos@webrtc.org    int32_t  _max;
3274f9bbbf9efe39e1f7df99aa7d6cb02d57978a5cpbos@webrtc.org    uint32_t _count;
3374f9bbbf9efe39e1f7df99aa7d6cb02d57978a5cpbos@webrtc.org    uint32_t _currentLevel;
34b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org};
353b89e10f31160da35b408fd00cb8f89d2b08862dpbos@webrtc.org}  // namespace webrtc
36b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org
37b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org#endif // WEBRTC_MODULES_AUDIO_CONFERENCE_MIXER_SOURCE_LEVEL_INDICATOR_H_
38