mic_gain_slider_controller.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // Copyright 2020 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef ASH_SYSTEM_AUDIO_MIC_GAIN_SLIDER_CONTROLLER_H_
  5. #define ASH_SYSTEM_AUDIO_MIC_GAIN_SLIDER_CONTROLLER_H_
  6. #include "ash/ash_export.h"
  7. #include "ash/system/unified/unified_slider_view.h"
  8. #include "base/callback_forward.h"
  9. namespace ash {
  10. class MicGainSliderView;
  11. // Controller for mic gain sliders situated in audio detailed
  12. // view in the system tray.
  13. class ASH_EXPORT MicGainSliderController : public UnifiedSliderListener {
  14. public:
  15. MicGainSliderController();
  16. ~MicGainSliderController() override;
  17. // Create a slider view for a specific input device.
  18. std::unique_ptr<MicGainSliderView> CreateMicGainSlider(uint64_t device_id,
  19. bool internal);
  20. using MapDeviceSliderCallback =
  21. base::RepeatingCallback<void(uint64_t, views::View*)>;
  22. static void SetMapDeviceSliderCallbackForTest(
  23. MapDeviceSliderCallback* test_slider_device_callback);
  24. // UnifiedSliderListener:
  25. views::View* CreateView() override;
  26. void SliderValueChanged(views::Slider* sender,
  27. float value,
  28. float old_value,
  29. views::SliderChangeReason reason) override;
  30. void SliderButtonPressed();
  31. };
  32. } // namespace ash
  33. #endif // ASH_SYSTEM_AUDIO_MIC_GAIN_SLIDER_CONTROLLER_H_