CTRE Phoenix 6 C++ 26.0.0-beta-1
Loading...
Searching...
No Matches
AudioConfigs.hpp
Go to the documentation of this file.
1/*
2 * Copyright (C) Cross The Road Electronics.  All rights reserved.
3 * License information can be found in CTRE_LICENSE.txt
4 * For support and suggestions contact support@ctr-electronics.com or file
5 * an issue tracker at https://github.com/CrossTheRoadElec/Phoenix-Releases
6 */
7#pragma once
8
10
11
12namespace ctre {
13namespace phoenix6 {
14
15
16namespace configs {
17
18/**
19 * \brief Configs that affect audible components of the device.
20 *
21 * \details Includes configuration for the beep on boot.
22 */
24public:
25 constexpr AudioConfigs() = default;
26
27 /**
28 * \brief If true, the TalonFX will beep during boot-up. This is
29 * useful for general debugging, and defaults to true. If rotor is
30 * moving during boot-up, the beep will not occur regardless of this
31 * setting.
32 *
33 * - Default Value: True
34 */
35 bool BeepOnBoot = true;
36 /**
37 * \brief If true, the TalonFX will beep during configuration API
38 * calls if device is disabled. This is useful for general debugging,
39 * and defaults to true. Note that if the rotor is moving, the beep
40 * will not occur regardless of this setting.
41 *
42 * - Default Value: True
43 */
44 bool BeepOnConfig = true;
45 /**
46 * \brief If true, the TalonFX will allow Orchestra and MusicTone
47 * requests during disabled state. This can be used to address corner
48 * cases when music features are needed when disabled. This setting
49 * defaults to false. Note that if the rotor is moving, music
50 * features are always disabled regardless of this setting.
51 *
52 * - Default Value: False
53 */
55
56 /**
57 * \brief Modifies this configuration's BeepOnBoot parameter and returns itself for
58 * method-chaining and easier to use config API.
59 *
60 * If true, the TalonFX will beep during boot-up. This is useful for
61 * general debugging, and defaults to true. If rotor is moving during
62 * boot-up, the beep will not occur regardless of this setting.
63 *
64 * - Default Value: True
65 *
66 * \param newBeepOnBoot Parameter to modify
67 * \returns Itself
68 */
69 constexpr AudioConfigs &WithBeepOnBoot(bool newBeepOnBoot)
70 {
71 BeepOnBoot = std::move(newBeepOnBoot);
72 return *this;
73 }
74
75 /**
76 * \brief Modifies this configuration's BeepOnConfig parameter and returns itself for
77 * method-chaining and easier to use config API.
78 *
79 * If true, the TalonFX will beep during configuration API calls if
80 * device is disabled. This is useful for general debugging, and
81 * defaults to true. Note that if the rotor is moving, the beep will
82 * not occur regardless of this setting.
83 *
84 * - Default Value: True
85 *
86 * \param newBeepOnConfig Parameter to modify
87 * \returns Itself
88 */
89 constexpr AudioConfigs &WithBeepOnConfig(bool newBeepOnConfig)
90 {
91 BeepOnConfig = std::move(newBeepOnConfig);
92 return *this;
93 }
94
95 /**
96 * \brief Modifies this configuration's AllowMusicDurDisable parameter and returns itself for
97 * method-chaining and easier to use config API.
98 *
99 * If true, the TalonFX will allow Orchestra and MusicTone requests
100 * during disabled state. This can be used to address corner cases
101 * when music features are needed when disabled. This setting
102 * defaults to false. Note that if the rotor is moving, music
103 * features are always disabled regardless of this setting.
104 *
105 * - Default Value: False
106 *
107 * \param newAllowMusicDurDisable Parameter to modify
108 * \returns Itself
109 */
110 constexpr AudioConfigs &WithAllowMusicDurDisable(bool newAllowMusicDurDisable)
111 {
112 AllowMusicDurDisable = std::move(newAllowMusicDurDisable);
113 return *this;
114 }
115
116
117
118 std::string ToString() const override;
119
120 std::string Serialize() const final;
121 ctre::phoenix::StatusCode Deserialize(std::string const &to_deserialize) final;
122};
123
124}
125}
126}
Configs that affect audible components of the device.
Definition AudioConfigs.hpp:23
ctre::phoenix::StatusCode Deserialize(std::string const &to_deserialize) final
bool BeepOnConfig
If true, the TalonFX will beep during configuration API calls if device is disabled.
Definition AudioConfigs.hpp:44
bool AllowMusicDurDisable
If true, the TalonFX will allow Orchestra and MusicTone requests during disabled state.
Definition AudioConfigs.hpp:54
std::string ToString() const override
constexpr AudioConfigs & WithBeepOnBoot(bool newBeepOnBoot)
Modifies this configuration's BeepOnBoot parameter and returns itself for method-chaining and easier ...
Definition AudioConfigs.hpp:69
constexpr AudioConfigs & WithAllowMusicDurDisable(bool newAllowMusicDurDisable)
Modifies this configuration's AllowMusicDurDisable parameter and returns itself for method-chaining a...
Definition AudioConfigs.hpp:110
std::string Serialize() const final
constexpr AudioConfigs & WithBeepOnConfig(bool newBeepOnConfig)
Modifies this configuration's BeepOnConfig parameter and returns itself for method-chaining and easie...
Definition AudioConfigs.hpp:89
bool BeepOnBoot
If true, the TalonFX will beep during boot-up.
Definition AudioConfigs.hpp:35
Definition Configuration.hpp:17
Definition motor_constants.h:14