Entropy Piano Tuner  1.1.3 (documentation not yet complete)
An open-source experimental software for piano tuning by entropy minimization
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
pianomanager.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Copyright 2015 Haye Hinrichsen, Christoph Wick
3  *
4  * This file is part of Entropy Piano Tuner.
5  *
6  * Entropy Piano Tuner is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by the
8  * Free Software Foundation, either version 3 of the License, or (at your
9  * option) any later version.
10  *
11  * Entropy Piano Tuner is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14  * more details.
15  *
16  * You should have received a copy of the GNU General Public License along with
17  * Entropy Piano Tuner. If not, see http://www.gnu.org/licenses/.
18  *****************************************************************************/
19 
20 //=============================================================================
21 // Piano-Manager
22 //=============================================================================
23 
24 #ifndef PIANOMANAGER_H
25 #define PIANOMANAGER_H
26 
27 #include "../system/prerequisites.h"
28 #include "piano.h"
29 #include "../messages/messagelistener.h"
30 #include "../adapters/modeselectoradapter.h"
31 
38 
40 {
41 public:
42  PianoManager();
44 
45  Piano &getPiano() {return mPiano;}
46  const Piano &getPiano() const {return mPiano;}
47 
48  void resetPitches ();
49 
50 protected:
51  void handleMessage(MessagePtr m) override final;
52 
53 private:
54  void handleNewKey (int keynumber, std::shared_ptr<Key> keyptr);
55  int findNextKey (int keynumber);
56 
61 
62 };
63 
64 #endif // PIANOMANAGER_H
std::shared_ptr< Message > MessagePtr
Global type of a shared message pointer.
Definition: message.h:98
OperationMode
Operation mode of the tuner.
Definition: prerequisites.h:66
void handleNewKey(int keynumber, std::shared_ptr< Key > keyptr)
Handle the event that a key has been successfully indentified.
int findNextKey(int keynumber)
Find the next key to be recorded.
Definition: piano.h:40
Piano & getPiano()
Definition: pianomanager.h:45
Piano mPiano
Instance of the piano.
Definition: pianomanager.h:57
void resetPitches()
Reset all recorded keys and send a message to redraw all elements.
The PianoManager class.
Definition: pianomanager.h:39
bool mForcedRecording
Flag for forced recording.
Definition: pianomanager.h:59
OperationMode mOperationMode
Local copy of the operation mode.
Definition: pianomanager.h:60
void handleMessage(MessagePtr m) overridefinal
Message listener and dispatcher.
const Piano & getPiano() const
Definition: pianomanager.h:46
int mSelectedKey
Local copy of the selected key.
Definition: pianomanager.h:58
PianoManager()
Constructor, resets member variables.