Line data Source code
1 : #pragma once 2 : 3 : #include <MIDI_Outputs/Abstract/MIDIAbsoluteEncoder.hpp> 4 : #include <MIDI_Senders/ContinuousCCSender.hpp> 5 : 6 : BEGIN_CS_NAMESPACE 7 : 8 : /** 9 : * @brief A class of MIDIOutputElement%s that read the input of a **quadrature 10 : * (rotary) encoder** and send out absolute MIDI **Control Change** 11 : * events. 12 : * 13 : * This version cannot be banked. 14 : * 15 : * @ingroup MIDIOutputElements 16 : */ 17 : class CCAbsoluteEncoder : public MIDIAbsoluteEncoder<ContinuousCCSender> { 18 : public: 19 : /** 20 : * @brief Construct a new CCAbsoluteEncoder object with the given pins, 21 : * address, channel, speed factor, and number of pulses per step. 22 : * 23 : * @param encoder 24 : * The Encoder object to use. 25 : * Usually passed as a list of the two pins connected to the 26 : * A and B outputs of the encoder, e.g. `{2, 3}`. 27 : * The internal pull-up resistors will be enabled by the Encoder 28 : * library. 29 : * @param address 30 : * The MIDI address containing the controller number [0, 119], 31 : * channel [Channel_1, Channel_16], and optional cable number 32 : * [Cable_1, Cable_16]. 33 : * @param multiplier 34 : * A constant factor to increase the speed of the rotary encoder. 35 : * The position will just be multiplied by this factor. 36 : * @param pulsesPerStep 37 : * The number of pulses per physical click of the encoder. 38 : * For a normal encoder, this is 4. If you want to increase the 39 : * resolution, for the use of Jog wheels, for example, you can go 40 : * as 1. 41 : * Whereas a greater speedMultiplier factor will increase the 42 : * speed, increasing the number of pulsesPerStep will result in a 43 : * lower speed. 44 : */ 45 1 : CCAbsoluteEncoder(AHEncoder &&encoder, MIDIAddress address, 46 : int16_t multiplier = 1, uint8_t pulsesPerStep = 4) 47 1 : : MIDIAbsoluteEncoder<ContinuousCCSender>( 48 1 : std::move(encoder), address, multiplier, pulsesPerStep, {}) {} 49 : }; 50 : 51 : END_CS_NAMESPACE