Generate an accompaniement for a given melody
|
#include <Database.hpp>
Public Member Functions | |
Data (std::string name, ChordProgression c, Melody m) | |
constructor for Data More... | |
Data (std::string name, std::string fileMelody, std::string fileChords) | |
constructor for Data from files More... | |
std::string | getName () const __attribute__((pure)) |
ChordProgression | getChords () const __attribute__((pure)) |
Melody | getMelody () const __attribute__((pure)) |
void | setName (std::string d) |
Sets the name of the data. More... | |
void | setChords (ChordProgression c) |
Sets the chords. More... | |
void | setMelody (Melody m) |
Sets the melody. More... | |
This class is used to store a data in the database. The Chords and the Melody are exactly what their name says. The name is used to find a specific data in the database In fact it will be usefull if and only if there is a mistake. A mistake is storing a pop-music data in jazz.
Data::Data | ( | std::string | name, |
ChordProgression | c, | ||
Melody | m | ||
) |
constructor for Data
name | name of the entry |
c | chord progression |
m | melody |
Data::Data | ( | std::string | name, |
std::string | fileMelody, | ||
std::string | fileChords | ||
) |
constructor for Data from files
name | name of the entry |
fileMelody | file where the melody is stored |
fileChords | file where the chordProgression is stored |
std::runtime_error | if something want wrong when reading/parsing the given files |
ChordProgression Data::getChords | ( | ) | const |
Returns the Chords
Melody Data::getMelody | ( | ) | const |
Returns the melody
std::string Data::getName | ( | ) | const |
Returns the name of the data
void Data::setChords | ( | ChordProgression | c | ) |
Sets the chords.
k | The Chords. |
void Data::setMelody | ( | Melody | m | ) |
Sets the melody.
k | The melody. |
void Data::setName | ( | std::string | d | ) |
Sets the name of the data.
k | The Name of the data. |