MNX Document Model
Loading...
Searching...
No Matches
mnx::Fraction Class Reference

Represents a fraction of a whole note, for measuring musical time. More...

#include <CommonClasses.h>

+ Inheritance diagram for mnx::Fraction:

Public Types

using Initializer = std::pair< NumType, NumType >
 initializer for Fraction class (numerator, denominator)
 

Public Member Functions

 Fraction (const std::shared_ptr< json > &root, json_pointer pointer)
 Constructor to wrap a Fraction instance around existing JSON.
 
 Fraction (Base &parent, const std::string_view &key, const Initializer &value)
 Creates a new Array class as a child of a JSON element.
 
 MNX_ARRAY_ELEMENT_PROPERTY (NumType, numerator, NUMERATOR_INDEX)
 the numerator of the fraction
 
 MNX_ARRAY_ELEMENT_PROPERTY (NumType, denominator, DENOMINATOR_INDEX)
 the denominator of the fraction
 

Friends

class Base
 

Detailed Description

Represents a fraction of a whole note, for measuring musical time.

Constructor & Destructor Documentation

◆ Fraction()

mnx::Fraction::Fraction ( Base parent,
const std::string_view &  key,
const Initializer value 
)
inline

Creates a new Array class as a child of a JSON element.

Parameters
parentThe parent class instance
keyThe JSON key to use for embedding in parent.
valueThe numerator (number on top) and denominator (number on bottom) of the fraction.