Just Intonation  Version 1.3.1 (19)
Explore key-independent dynamically adapting tuning in just intonation
LogFile Class Reference

Create a data log of keypress and tuning events. More...

#include <logfile.h>

Inheritance diagram for LogFile:
Inheritance graph
Collaboration diagram for LogFile:
Collaboration graph

Public Slots

void activateLogFile (bool on)
 Switch logging on and off. More...
 
void receiveMidiEvent (QMidiMessage event)
 Public slot: Receive MIDI event. More...
 
void receiveTuningCorrections (const QMap< int, double > &corrections)
 Public slot: Receive tuning corrections. More...
 

Signals

void signalNewLogMessage (QVariant str)
 

Public Member Functions

 LogFile ()
 Constructor of the LogFile, resets member variables. More...
 
void setVerbosity (int verbosity)
 Set the verbosity level of the class-specific messages. More...
 
int getVerbosity ()
 Get the actual verbosity level. More...
 

Private Member Functions

QString noteName (int key)
 Note Name of a key. More...
 
void addLine (quint64 milliseconds, const QString &line)
 Add a line to the logfile output. More...
 
void registerKeypress (int key, bool pressed)
 Public slot: Register pressed or released key. More...
 
void flushKeypress ()
 Terminate collection of multiple keypresses/releases and send them to the logfile. More...
 

Private Attributes

QElapsedTimer mTimer
 
bool isActive
 
QList< int > mPressed
 
QList< int > mReleased
 
qint64 mTimeOfLastKeypress
 
QString mTuningMessage
 

Detailed Description

Create a data log of keypress and tuning events.

This class produces a log of selected keypress and tuning events.

Definition at line 42 of file logfile.h.

Constructor & Destructor Documentation

LogFile::LogFile ( )

Constructor of the LogFile, resets member variables.

Definition at line 36 of file logfile.cpp.

Here is the call graph for this function:

Member Function Documentation

void LogFile::activateLogFile ( bool  on)
slot

Switch logging on and off.

Parameters
on: true = on, false = off

Definition at line 57 of file logfile.cpp.

void LogFile::addLine ( quint64  milliseconds,
const QString &  line 
)
private

Add a line to the logfile output.

Parameters
milliseconds: The actual time since startup in milliseconds
line: String containing the text to be sent to the logfile

Definition at line 161 of file logfile.cpp.

void LogFile::flushKeypress ( )
private

Terminate collection of multiple keypresses/releases and send them to the logfile.

Definition at line 209 of file logfile.cpp.

Here is the call graph for this function:

int Log::getVerbosity ( )
inherited

Get the actual verbosity level.

Returns
: Verbosity level (1...4)

Definition at line 118 of file log.cpp.

QString LogFile::noteName ( int  key)
private

Note Name of a key.

Parameters
key: Number of the key (0..127)
Returns
String with a human-readable name of the corresponding note

Definition at line 74 of file logfile.cpp.

void LogFile::receiveMidiEvent ( QMidiMessage  event)
slot

Public slot: Receive MIDI event.

This is the first main input slot of the class. It receieves MIDI events indicating whether a key on the keyboard has been pressed or released.

Parameters
event: A Midi message containing data about keypresses

Definition at line 92 of file logfile.cpp.

Here is the call graph for this function:

void LogFile::receiveTuningCorrections ( const QMap< int, double > &  corrections)
slot

Public slot: Receive tuning corrections.

This slot receives the tuning corrections from the tuner and sends them to the log file output. Only the first and the last tuning correction after a keypress or release are sent to the output while all adiabatically equilibrating tuning corrections in between are suppressed in order to keep the output compact.

Parameters
corrections: Map containing <key,cent> microtuning pairs

Definition at line 124 of file logfile.cpp.

Here is the call graph for this function:

void LogFile::registerKeypress ( int  key,
bool  pressed 
)
private

Public slot: Register pressed or released key.

This function registers newly pressed and released keys. If there have been suppressed tuning messages before the last one will be sent to the output as well. Multiple keypresses at the same time (in the resolution of milliseconds) will be collected in a single line. When the collection process is finished the function flushKeypress() is called.

Parameters
key: Number of the key
pressed: pressed = true, released = false

Definition at line 186 of file logfile.cpp.

Here is the call graph for this function:

void Log::setVerbosity ( int  verbosity)
inherited

Set the verbosity level of the class-specific messages.

Parameters
verbosity: Verbosity level (1...4)

Definition at line 107 of file log.cpp.

void LogFile::signalNewLogMessage ( QVariant  str)
signal

Signal sending a new string to the Qml output text area

Member Data Documentation

bool LogFile::isActive
private

Definition at line 65 of file logfile.h.

QList<int> LogFile::mPressed
private

Definition at line 66 of file logfile.h.

QList<int> LogFile::mReleased
private

Definition at line 66 of file logfile.h.

qint64 LogFile::mTimeOfLastKeypress
private

Definition at line 67 of file logfile.h.

QElapsedTimer LogFile::mTimer
private

Definition at line 64 of file logfile.h.

QString LogFile::mTuningMessage
private

Definition at line 68 of file logfile.h.


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