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

The SFGeneratorItem class represents a generator. More...

#include <generator_item.hpp>

Public Member Functions

 SFGeneratorItem ()
 Constructs a new SFGeneratorItem.
 
 SFGeneratorItem (SFGenerator op, GenAmountType amount)
 Constructs a new SFGeneratorItem using the specified properties. More...
 
 SFGeneratorItem (const SFGeneratorItem &origin)=default
 Constructs a new copy of specified SFGeneratorItem. More...
 
SFGeneratorItemoperator= (const SFGeneratorItem &origin)=default
 Copy-assigns a new value to the SFGeneratorItem, replacing its current contents. More...
 
 SFGeneratorItem (SFGeneratorItem &&origin)=default
 Acquires the contents of specified SFGeneratorItem. More...
 
SFGeneratorItemoperator= (SFGeneratorItem &&origin)=default
 Move-assigns a new value to the SFGeneratorItem, replacing its current contents. More...
 
 ~SFGeneratorItem ()=default
 Destructs the SFGeneratorItem.
 
SFGenerator op () const noexcept
 Returns the type of the generator. More...
 
void set_op (SFGenerator op)
 Sets the type of the generator. More...
 
GenAmountType amount () const noexcept
 Returns the amount of the generator. More...
 
void set_amount (GenAmountType amount)
 Sets the amount of the generator. More...
 
void set_amount (uint8_t lo, uint8_t hi)
 Sets the amount of the generator in a range. More...
 
void set_amount (int16_t amount)
 Sets the amount of the generator in an integer. More...
 
void set_amount (uint16_t amount)
 Sets the amount of the generator in an unsigned integer. More...
 

Static Public Member Functions

static bool Compare (const SFGenerator &x, const SFGenerator &y) noexcept
 Indicates a SFGenerator object is "less than" the other one. More...
 

Detailed Description

The SFGeneratorItem class represents a generator.

Remarks
This class represents the official sfGenList/sfInstGenList type.
See also
"7.5 The PGEN Sub-chunk". In SoundFont Technical Specification 2.04.
"7.9 The IGEN Sub-chunk". In SoundFont Technical Specification 2.04.

Constructor & Destructor Documentation

sf2cute::SFGeneratorItem::SFGeneratorItem ( SFGenerator  op,
GenAmountType  amount 
)

Constructs a new SFGeneratorItem using the specified properties.

Parameters
opthe type of the generator.
amountthe value to be assigned to the generator.
sf2cute::SFGeneratorItem::SFGeneratorItem ( const SFGeneratorItem origin)
default

Constructs a new copy of specified SFGeneratorItem.

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

Acquires the contents of specified SFGeneratorItem.

Parameters
origina SFGeneratorItem object.

Member Function Documentation

GenAmountType sf2cute::SFGeneratorItem::amount ( ) const
noexcept

Returns the amount of the generator.

Returns
the value represents the amount of the generator.
static bool sf2cute::SFGeneratorItem::Compare ( const SFGenerator x,
const SFGenerator y 
)
staticnoexcept

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

Parameters
xthe first SFGenerator to be compared.
ythe second SFGenerator to be compared.
Returns
true if a SFGenerator object is "less than" the other one.
Remarks
This function compares two SFGenerator enums based on the ordering requirement of a generator chunk.
SFGenerator sf2cute::SFGeneratorItem::op ( ) const
noexcept

Returns the type of the generator.

Returns
the type of the generator.
SFGeneratorItem& sf2cute::SFGeneratorItem::operator= ( const SFGeneratorItem origin)
default

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

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

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

Parameters
origina SFGeneratorItem object.
void sf2cute::SFGeneratorItem::set_amount ( GenAmountType  amount)

Sets the amount of the generator.

Parameters
amountthe value to be assigned to the generator.
void sf2cute::SFGeneratorItem::set_amount ( uint8_t  lo,
uint8_t  hi 
)

Sets the amount of the generator in a range.

Parameters
lothe low end of range.
hithe high end of range.
void sf2cute::SFGeneratorItem::set_amount ( int16_t  amount)

Sets the amount of the generator in an integer.

Parameters
amountthe value to be assigned to the generator.
void sf2cute::SFGeneratorItem::set_amount ( uint16_t  amount)

Sets the amount of the generator in an unsigned integer.

Parameters
amountthe value to be assigned to the generator.
void sf2cute::SFGeneratorItem::set_op ( SFGenerator  op)

Sets the type of the generator.

Parameters
opthe type of the generator.

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