kodi
GUIThrottleButton.h
1 /*
2  * Copyright (C) 2016-2018 Team Kodi
3  * This file is part of Kodi - https://kodi.tv
4  *
5  * SPDX-License-Identifier: GPL-2.0-or-later
6  * See LICENSES/README.md for more information.
7  */
8 
9 #pragma once
10 
11 #include "GUIFeatureButton.h"
12 
13 namespace KODI
14 {
15 namespace GAME
16 {
21 {
22 public:
23  CGUIThrottleButton(const CGUIButtonControl& buttonTemplate,
24  IConfigurationWizard* wizard,
25  const CPhysicalFeature& feature,
26  unsigned int index);
27 
28  ~CGUIThrottleButton() override = default;
29 
30  // implementation of IFeatureButton
31  bool PromptForInput(CEvent& waitEvent) override;
32  bool IsFinished() const override;
33  JOYSTICK::THROTTLE_DIRECTION GetThrottleDirection() const override;
34  void Reset() override;
35 
36 private:
37  enum class STATE
38  {
39  THROTTLE_UP,
40  THROTTLE_DOWN,
41  FINISHED,
42  };
43 
44  STATE m_state;
45 };
46 } // namespace GAME
47 } // namespace KODI
This is an Event class built from a ConditionVariable.
Definition: Event.h:35
Definition: GUIButtonControl.h:27
void Reset() override
Reset button after prompting for input has finished.
Definition: GUIThrottleButton.cpp:85
A wizard to direct user input.
Definition: IConfigurationWindow.h:240
Definition: GUIFeatureButton.h:24
bool PromptForInput(CEvent &waitEvent) override
Prompt the user for a single input element.
Definition: GUIThrottleButton.cpp:27
Definition: AudioDecoder.h:18
Definition: GUIThrottleButton.h:20
bool IsFinished() const override
Check if the button supports further calls to PromptForInput()
Definition: GUIThrottleButton.cpp:63
Definition: PhysicalFeature.h:30
JOYSTICK::THROTTLE_DIRECTION GetThrottleDirection() const override
Get the direction of the next throttle prompt.
Definition: GUIThrottleButton.cpp:68