SF2cute  0.1
Modern C++ Library for SoundFont 2
sf2cute::SFModulator Class Reference

The SFModulator class represents a controller in a modulator. More...

#include <modulator.hpp>

Public Member Functions

 SFModulator ()
 Constructs a new SFModulator with no controller.
 
 SFModulator (uint16_t value)
 Constructs a new SFModulator from a pre-encoded integer. More...
 
 SFModulator (SFGeneralController controller, SFControllerDirection direction, SFControllerPolarity polarity, SFControllerType type)
 Constructs a new SFModulator with a general controller. More...
 
 SFModulator (SFMidiController controller, SFControllerDirection direction, SFControllerPolarity polarity, SFControllerType type)
 Constructs a new SFModulator with a MIDI controller. More...
 
 SFModulator (const SFModulator &origin)=default
 Constructs a new copy of specified SFModulator. More...
 
SFModulatoroperator= (const SFModulator &origin)=default
 Copy-assigns a new value to the SFModulator, replacing its current contents. More...
 
 SFModulator (SFModulator &&origin)=default
 Acquires the contents of specified SFModulator. More...
 
SFModulatoroperator= (SFModulator &&origin)=default
 Move-assigns a new value to the SFModulator, replacing its current contents. More...
 
 ~SFModulator ()=default
 Destructs the SFModulator.
 
uint8_t controller () const noexcept
 Returns the index of the controller. More...
 
SFGeneralController general_controller () const noexcept
 Returns the type of this general controller. More...
 
SFMidiController midi_controller () const noexcept
 Returns the type of this MIDI controller. More...
 
void set_controller (uint8_t controller)
 Sets the index of the controller. More...
 
void set_general_controller (SFGeneralController controller)
 Sets the general controller index and the type of controller palette. More...
 
void set_midi_controller (SFMidiController controller)
 Sets the MIDI controller index and the type of controller palette. More...
 
SFControllerPalette controller_palette () const noexcept
 Returns the type of controller palette. More...
 
void set_controller_palette (SFControllerPalette controller_palette)
 Sets the type of controller palette. More...
 
SFControllerDirection direction () const noexcept
 Returns the direction of the controller. More...
 
void set_direction (SFControllerDirection direction)
 Sets the direction of the controller. More...
 
SFControllerPolarity polarity () const noexcept
 Returns the polarity of the controller. More...
 
void set_polarity (SFControllerPolarity polarity)
 Sets the polarity of the controller. More...
 
SFControllerType type () const noexcept
 Returns the source type of the controller. More...
 
void set_type (SFControllerType type)
 Sets the source type of the controller. More...
 
 operator uint16_t () const noexcept
 Converts SFModulator to an integer value.
 

Friends

bool operator== (const SFModulator &x, const SFModulator &y) noexcept
 Indicates a SFModulator object is "equal to" the other one. More...
 
bool operator!= (const SFModulator &x, const SFModulator &y) noexcept
 Indicates a SFModulator object is "not equal to" the other one. More...
 
bool operator< (const SFModulator &x, const SFModulator &y) noexcept
 Indicates a SFModulator object is "less than" the other one. More...
 
bool operator<= (const SFModulator &x, const SFModulator &y) noexcept
 Indicates a SFModulator object is "less than or equal to" the other one. More...
 
bool operator> (const SFModulator &x, const SFModulator &y) noexcept
 Indicates a SFModulator object is "greater than" the other one. More...
 
bool operator>= (const SFModulator &x, const SFModulator &y) noexcept
 Indicates a SFModulator object is "greater than or equal to" the other one. More...
 

Detailed Description

The SFModulator class represents a controller in a modulator.

Remarks
This class represents the official sfModulator type.
See also
"8.2 Modulator Source Enumerators". In SoundFont Technical Specification 2.04.

Constructor & Destructor Documentation

sf2cute::SFModulator::SFModulator ( uint16_t  value)
explicit

Constructs a new SFModulator from a pre-encoded integer.

Parameters
valuethe value that represents a SFModulator
sf2cute::SFModulator::SFModulator ( SFGeneralController  controller,
SFControllerDirection  direction,
SFControllerPolarity  polarity,
SFControllerType  type 
)

Constructs a new SFModulator with a general controller.

Parameters
controllerthe type of general controller.
directionthe direction of the controller.
polaritythe polarity of the controller.
typethe source type of the controller.
sf2cute::SFModulator::SFModulator ( SFMidiController  controller,
SFControllerDirection  direction,
SFControllerPolarity  polarity,
SFControllerType  type 
)

Constructs a new SFModulator with a MIDI controller.

Parameters
controllerthe type of MIDI controller.
directionthe direction of the controller.
polaritythe polarity of the controller.
typethe source type of the controller.
sf2cute::SFModulator::SFModulator ( const SFModulator origin)
default

Constructs a new copy of specified SFModulator.

Parameters
origina SFModulator object.
sf2cute::SFModulator::SFModulator ( SFModulator &&  origin)
default

Acquires the contents of specified SFModulator.

Parameters
origina SFModulator object.

Member Function Documentation

uint8_t sf2cute::SFModulator::controller ( ) const
noexcept

Returns the index of the controller.

Returns
the index of the controller
Remarks
Using general_controller() or midi_controller() is recommended if you want to process a specific controller type.
See also
general_controller()
midi_controller()
controller_palette()
SFControllerPalette sf2cute::SFModulator::controller_palette ( ) const
noexcept

Returns the type of controller palette.

Returns
the type of controller palette.
SFControllerDirection sf2cute::SFModulator::direction ( ) const
noexcept

Returns the direction of the controller.

Returns
the direction of the controller.
SFGeneralController sf2cute::SFModulator::general_controller ( ) const
noexcept

Returns the type of this general controller.

Returns
the type of this general controller.
Remarks
Verify the type of controller palette before getting the value.
See also
controller_palette()
SFMidiController sf2cute::SFModulator::midi_controller ( ) const
noexcept

Returns the type of this MIDI controller.

Returns
the type of this MIDI controller.
Remarks
Verify the type of controller palette before getting the value.
See also
controller_palette()
SFModulator& sf2cute::SFModulator::operator= ( const SFModulator origin)
default

Copy-assigns a new value to the SFModulator, replacing its current contents.

Parameters
origina SFModulator object.
SFModulator& sf2cute::SFModulator::operator= ( SFModulator &&  origin)
default

Move-assigns a new value to the SFModulator, replacing its current contents.

Parameters
origina SFModulator object.
SFControllerPolarity sf2cute::SFModulator::polarity ( ) const
noexcept

Returns the polarity of the controller.

Returns
the polarity of the controller.
void sf2cute::SFModulator::set_controller ( uint8_t  controller)

Sets the index of the controller.

Parameters
controllerthe index of the controller.
Remarks
Using set_general_controller(SFGeneralController) or set_midi_controller(SFMidiController) is recommended if you want to process a specific controller type.
See also
set_general_controller(SFGeneralController)
set_midi_controller(SFMidiController)
void sf2cute::SFModulator::set_controller_palette ( SFControllerPalette  controller_palette)

Sets the type of controller palette.

Parameters
controller_palettethe type of controller palette.
Remarks
Using set_general_controller(SFGeneralController) or set_midi_controller(SFMidiController) is recommended.
See also
set_general_controller(SFGeneralController)
set_midi_controller(SFGeneralController)
void sf2cute::SFModulator::set_direction ( SFControllerDirection  direction)

Sets the direction of the controller.

Parameters
directionthe direction of the controller.
void sf2cute::SFModulator::set_general_controller ( SFGeneralController  controller)

Sets the general controller index and the type of controller palette.

Parameters
controllerthe type of general controller.
void sf2cute::SFModulator::set_midi_controller ( SFMidiController  controller)

Sets the MIDI controller index and the type of controller palette.

Parameters
controllerthe type of MIDI controller.
void sf2cute::SFModulator::set_polarity ( SFControllerPolarity  polarity)

Sets the polarity of the controller.

Parameters
polaritythe polarity of the controller.
void sf2cute::SFModulator::set_type ( SFControllerType  type)

Sets the source type of the controller.

Parameters
typethe source type of the controller.
SFControllerType sf2cute::SFModulator::type ( ) const
noexcept

Returns the source type of the controller.

Returns
the source type of the controller.

Friends And Related Function Documentation

bool operator!= ( const SFModulator x,
const SFModulator y 
)
friend

Indicates a SFModulator object is "not equal to" the other one.

Parameters
xthe first object to be compared.
ythe second object to be compared.
Returns
true if a SFModulator object is "not equal to" the other one.
bool operator< ( const SFModulator x,
const SFModulator y 
)
friend

Indicates a SFModulator object is "less than" the other one.

Parameters
xthe first object to be compared.
ythe second object to be compared.
Returns
true if a SFModulator object is "less than" the other one.
bool operator<= ( const SFModulator x,
const SFModulator y 
)
friend

Indicates a SFModulator object is "less than or equal to" the other one.

Parameters
xthe first object to be compared.
ythe second object to be compared.
Returns
true if a SFModulator object is "less than or equal to" the other one.
bool operator== ( const SFModulator x,
const SFModulator y 
)
friend

Indicates a SFModulator object is "equal to" the other one.

Parameters
xthe first object to be compared.
ythe second object to be compared.
Returns
true if a SFModulator object is "equal to" the other one.
bool operator> ( const SFModulator x,
const SFModulator y 
)
friend

Indicates a SFModulator object is "greater than" the other one.

Parameters
xthe first object to be compared.
ythe second object to be compared.
Returns
true if a SFModulator object is "greater than" the other one.
bool operator>= ( const SFModulator x,
const SFModulator y 
)
friend

Indicates a SFModulator object is "greater than or equal to" the other one.

Parameters
xthe first object to be compared.
ythe second object to be compared.
Returns
true if a SFModulator object is "greater than or equal to" the other one.

The documentation for this class was generated from the following file: