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
core.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 // Core
22 //=============================================================================
23 
24 #ifndef CORE_H
25 #define CORE_H
26 
30 #include "audio/midi/midiadapter.h"
35 #include "piano/pianomanager.h"
36 #include "system/log.h"
37 
44 
45 class Core
46 {
47 public:
48  Core(ProjectManagerAdapter *projectManager,
49  AudioRecorderAdapter *recorderAdapter,
50  AudioPlayerAdapter *playerAdapter,
51  Log *log = new Log());
52  ~Core();
53 
54 
55  void init (CoreInitialisationAdapter *initAdapter);
56  void exit();
57  void start();
58  void stop();
59 
61  bool isInitialized() const {return mInitialized;}
62 
63  // Getter functions
68  MidiAdapter *getMidiInterface() {return mMidi.get();}
69 
70 private:
72  std::unique_ptr<ProjectManagerAdapter> mProjectManager;
79  std::shared_ptr<MidiAdapter> mMidi;
80 };
81 
82 #endif // CORE_H
PianoManager * getPianoManager()
Definition: core.h:67
Class for managing the sound generation in the EPT.
Abstract adapter class for recording audio signals.
Recording manager.
AudioRecorderAdapter * mRecorderAdapter
Definition: core.h:73
void stop()
Stop the core.
Definition: core.cpp:191
void start()
Start the core.
Definition: core.cpp:172
void init(CoreInitialisationAdapter *initAdapter)
Core initialization.
Definition: core.cpp:95
RecordingManager mRecordingManager
Definition: core.h:76
The PianoManager class.
Definition: pianomanager.h:39
AudioPlayerAdapter * getAudioPlayer()
Definition: core.h:66
std::unique_ptr< ProjectManagerAdapter > mProjectManager
Definition: core.h:72
AudioPlayerAdapter * mPlayerAdapter
Definition: core.h:74
ProjectManagerAdapter * getProjectManager()
Definition: core.h:64
Core initialization adapter (singleton class).
Core(ProjectManagerAdapter *projectManager, AudioRecorderAdapter *recorderAdapter, AudioPlayerAdapter *playerAdapter, Log *log=new Log())
Core constructor.
Definition: core.cpp:45
CORE : Class managing the core.
Definition: core.h:45
MidiAdapter * getMidiInterface()
Definition: core.h:68
void exit()
Thus function calls exit() of all components that were initialized.
Definition: core.cpp:146
Adapter class for reading an externally connected MIDI keyboard.
Definition: midiadapter.h:43
bool mInitialized
Definition: core.h:71
Definition: log.h:67
Signal analyzer: Fourier transformation of the recorded audio signal.
SignalAnalyzer mSignalAnalyzer
Definition: core.h:77
~Core()
Core destructor, calls stop and exit.
Definition: core.cpp:71
SoundGenerator mSoundGenerator
Definition: core.h:75
Abstract adapter class for PCM-based audio output drivers.
bool isInitialized() const
Function telling wether the core is already initialized.
Definition: core.h:61
Project manager adapter class.
PianoManager mPianoManager
Definition: core.h:78
std::shared_ptr< MidiAdapter > mMidi
Definition: core.h:79
AudioRecorderAdapter * getAudioRecorder()
Definition: core.h:65