26 #include "../../messages/messageprojectfile.h"
27 #include "../../messages/messagekeyselectionchanged.h"
28 #include "../../messages/messagemodechanged.h"
31 : mAudioRecorder (audioRecorder),
34 mSelectedKey(nullptr),
36 mNumberOfSelectedKey(-1)
58 auto mpf(std::static_pointer_cast<MessageProjectFile>(m));
76 auto mmc(std::static_pointer_cast<MessageModeChanged>(m));
100 auto message(std::static_pointer_cast<MessageKeySelectionChanged>(m));
139 std::vector<double> ftab;
152 const double f1 = peaks.begin()->first;
155 if (f1>0)
for (
auto &e : peaks)
157 if (++N > numberOfStroboscopicPartials)
break;
166 for (
int n=1; n<=3; ++n) ftab.push_back(n*fc*sqrt((1+B*n*n)/1+B));
void setFramesPerSecond(double fps)
Stroboscope::setFramesPerSecond.
std::shared_ptr< Message > MessagePtr
Global type of a shared message pointer.
Stroboscope * getStroboscope()
Abstract adapter class for recording audio signals.
void setWaitingFlag(bool flag)
virtual void handleMessage(MessagePtr m)
Listen to messages and take action accordingly.
const double FPS_SLOW
Stroboscopic fps during non-recording.
const PeakListType & getPeaks() const
Get a read-only reference to mPeaks.
const Key * mSelectedKey
Currently selected key.
Message that a change was made with the current project file.
void updateStroboscopicFrequencies()
Update the stroboscopic frequencies.
const Piano * mPiano
Poitner to the actual piano.
Message that the operation mode has changed.
Mode for recording the piano keys.
void stop()
Stop the stroboscope.
Message that a key has been selected.
const Keyboard & getKeyboard() const
double getComputedFrequency() const
Get computed frequency.
void start()
Start the stroboscope.
int mNumberOfSelectedKey
Number of actually selected key.
void setFrequencies(const std::vector< double > &frequencies)
Stroboscope::setFrequencies.
const double FPS_FAST
Stroboscopic fps during recording.
RecordingManager(AudioRecorderAdapter *audioRecorder)
Mode for manually tuning the piano.
int mKeyNumberOfA4
Total number of keys.
int getKeyNumberOfA4() const
const double & getConcertPitch() const
OperationMode mOperationMode
Current operation mode.
double getExpectedInharmonicity(double f) const
Compute expected approximative inharmonicity.
analysis of the signal ended
std::map< double, double > PeakListType
Type for a peak map.
void setStandby(bool flag)
keystroke recognized and recording started
AudioRecorderAdapter * mAudioRecorder
Pointer to the audio device.