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
MainWindow Class Reference

The main window. More...

#include <mainwindow.h>

+ Inheritance diagram for MainWindow:
+ Collaboration diagram for MainWindow:

Public Slots

void onOpenSoundControl ()
 Slot to open the sound control. More...
 
bool isSoundControlSupported ()
 
void onResetNoiseLevel ()
 Slot to reset the noise level. More...
 
void onToggleMicroMute (bool checked)
 Toggle the mute button. More...
 
void onToggleSpeakerMute (bool checked)
 Toggle the mute button. More...
 
void onFileNew ()
 Slot called for creating a new file. More...
 
void onFileSave ()
 Slot to save the current file. More...
 
void onFileSaveAs ()
 Slot to save the current file as a new file. More...
 
void onFileOpen ()
 Slot to open a new file. More...
 
void onFileShare ()
 Slot to store the current file. More...
 
void onEditPianoDataSheet ()
 Slot to edit the current piano data sheet. More...
 
void onResetRecording ()
 Slot to reset the recording. More...
 
void onOptions ()
 Slot to open the options. More...
 
void onOpenPlots ()
 Slot to open the mathematical plots dialog. More...
 
void onTutorial ()
 
void onManual ()
 Slot to open the manual. More...
 
void onAbout ()
 Slot to open the about dialog. More...
 
void onViewLog ()
 Slot to open the log viewer. More...
 
void onModeIdle (bool)
 Slot to switch to idle mode. More...
 
void onModeRecord (bool)
 Slot to switch to recording mode. More...
 
void onModeCalculate (bool)
 Slot to switch to calculation mode. More...
 
void onModeTune (bool)
 Slot to switch to tuning mode. More...
 
void onSelectNextMode ()
 Slot to select the next mode. More...
 
void onSelectPreviousMode ()
 Slot to select the previous mode. More...
 
void onToggleFullscreen ()
 Slot to toggle full screen of the MainWindow. More...
 
void onToggleTuningIndictator ()
 Slot to toggle between the two tuning indicator modes. More...
 
void onExport ()
 Slot to open the export dialog. More...
 

Signals

void modeChanged (OperationMode mode)
 

Public Member Functions

 MainWindow (QWidget *parent=nullptr)
 Constructor. More...
 
virtual ~MainWindow ()
 Destructor. More...
 
void init (Core *core)
 Initialised the window using the given Core. More...
 
void start ()
 Starts the main window. More...
 
CoregetCore ()
 Getter function for the core. More...
 
- Public Member Functions inherited from MessageListener
 MessageListener (bool defaultActivation=true)
 
virtual ~MessageListener ()
 
bool isMessageListenerActive () const
 
void activateMessageListener ()
 
void deactivateMessageListener ()
 
- Public Member Functions inherited from ModeSelectorAdapter
 ModeSelectorAdapter ()
 ModeSelectorAdapter::ModeSelectorAdapter. More...
 
 ~ModeSelectorAdapter ()
 

Protected Member Functions

void closeEvent (QCloseEvent *event) override
 Reimplementation of the close event. More...
 
void handleMessage (MessagePtr m) override
 Message handling. More...
 
void changesInFileUpdated (bool b) overridefinal
 Called if changed in file are made to update the window title. More...
 
- Protected Member Functions inherited from ModeSelectorAdapter
void setMode (OperationMode m)
 Set operation mode. More...
 

Private Slots

void onVersionUpdate (VersionInformation information)
 

Private Member Functions

void updateNoteName (int key)
 Update the note name. More...
 
void updateFrequency (const Key *key)
 Update the frequency label. More...
 
void updateWindowTitle ()
 Update the window title. More...
 
void updateVolumeBar ()
 This will update the positions of the labels in the volume bar. More...
 

Private Attributes

const QString mIconPostfix
 
CoremCore
 Pointer to the Core. More...
 
Ui::MainWindow * ui
 Ui of the Mainwindow. More...
 
CalculationProgressGroupmCalculationProgressGroup
 Pointer to the CalculationProgressGroup. More...
 
SignalAnalyzerGroupBoxmSignalAnalyzerGroup
 Pointer to the SignalAnalyzerGroupBox. More...
 
TuningIndicatorGroupBoxmTuningIndicatorGroup
 Pointer to the TuningIndicatorGroupBox. More...
 
VolumeControlGroupBoxmVolumeControlGroup
 Pointer to the VolumeControlGroupBox. More...
 
KeyboardGraphicsViewmKeyboardGraphicsView
 
QToolBar * mFileToolBar
 
QToolButton * mModeToolButtons [OperationMode::MODE_COUNT]
 Tool buttons for all modes. More...
 

Additional Inherited Members

- Protected Attributes inherited from ModeSelectorAdapter
OperationMode mCurrentMode
 

Detailed Description

The main window.

Definition at line 49 of file mainwindow.h.

Constructor & Destructor Documentation

MainWindow::MainWindow ( QWidget *  parent = nullptr)
explicit

Constructor.

Parameters
parent: Parent widget or nullptr.

Definition at line 66 of file mainwindow.cpp.

+ Here is the call graph for this function:

MainWindow::~MainWindow ( )
virtual

Destructor.

This will delete the ui.

Definition at line 299 of file mainwindow.cpp.

Member Function Documentation

void MainWindow::changesInFileUpdated ( bool  b)
finaloverrideprotectedvirtual

Called if changed in file are made to update the window title.

Parameters
b: Changes are made?

Implements FileChangesCallback.

Definition at line 497 of file mainwindow.cpp.

+ Here is the call graph for this function:

void MainWindow::closeEvent ( QCloseEvent *  event)
overrideprotected

Reimplementation of the close event.

Parameters
event: The QCloseEvent

This will store the current geometry.

Definition at line 337 of file mainwindow.cpp.

+ Here is the call graph for this function:

Core* MainWindow::getCore ( )
inline

Getter function for the core.

Returns
mCore

Definition at line 90 of file mainwindow.h.

void MainWindow::handleMessage ( MessagePtr  m)
overrideprotectedvirtual

Message handling.

Parameters
m: The Message

Implements MessageListener.

Definition at line 358 of file mainwindow.cpp.

+ Here is the call graph for this function:

void MainWindow::init ( Core core)

Initialised the window using the given Core.

Parameters
core: Pointer to the Core.

Definition at line 304 of file mainwindow.cpp.

+ Here is the call graph for this function:

bool MainWindow::isSoundControlSupported ( )
slot

Definition at line 559 of file mainwindow.cpp.

void MainWindow::modeChanged ( OperationMode  mode)
signal
void MainWindow::onAbout ( )
slot

Slot to open the about dialog.

Definition at line 691 of file mainwindow.cpp.

void MainWindow::onEditPianoDataSheet ( )
slot

Slot to edit the current piano data sheet.

Definition at line 607 of file mainwindow.cpp.

+ Here is the call graph for this function:

void MainWindow::onExport ( )
slot

Slot to open the export dialog.

Definition at line 752 of file mainwindow.cpp.

+ Here is the call graph for this function:

void MainWindow::onFileNew ( )
slot

Slot called for creating a new file.

Definition at line 585 of file mainwindow.cpp.

+ Here is the call graph for this function:

void MainWindow::onFileOpen ( )
slot

Slot to open a new file.

Definition at line 597 of file mainwindow.cpp.

+ Here is the call graph for this function:

void MainWindow::onFileSave ( )
slot

Slot to save the current file.

Definition at line 589 of file mainwindow.cpp.

+ Here is the call graph for this function:

void MainWindow::onFileSaveAs ( )
slot

Slot to save the current file as a new file.

Definition at line 593 of file mainwindow.cpp.

+ Here is the call graph for this function:

void MainWindow::onFileShare ( )
slot

Slot to store the current file.

Definition at line 601 of file mainwindow.cpp.

+ Here is the call graph for this function:

void MainWindow::onManual ( )
slot

Slot to open the manual.

Definition at line 687 of file mainwindow.cpp.

+ Here is the call graph for this function:

void MainWindow::onModeCalculate ( bool  checked)
slot

Slot to switch to calculation mode.

Definition at line 714 of file mainwindow.cpp.

+ Here is the call graph for this function:

void MainWindow::onModeIdle ( bool  checked)
slot

Slot to switch to idle mode.

Definition at line 702 of file mainwindow.cpp.

+ Here is the call graph for this function:

void MainWindow::onModeRecord ( bool  checked)
slot

Slot to switch to recording mode.

Definition at line 708 of file mainwindow.cpp.

+ Here is the call graph for this function:

void MainWindow::onModeTune ( bool  checked)
slot

Slot to switch to tuning mode.

Definition at line 720 of file mainwindow.cpp.

+ Here is the call graph for this function:

void MainWindow::onOpenPlots ( )
slot

Slot to open the mathematical plots dialog.

Definition at line 622 of file mainwindow.cpp.

+ Here is the call graph for this function:

void MainWindow::onOpenSoundControl ( )
slot

Slot to open the sound control.

This is platform dependent and works on linux (gnome, pavucontrol), Mac OsX, Windows.

Definition at line 529 of file mainwindow.cpp.

void MainWindow::onOptions ( )
slot

Slot to open the options.

Definition at line 617 of file mainwindow.cpp.

void MainWindow::onResetNoiseLevel ( )
slot

Slot to reset the noise level.

Definition at line 573 of file mainwindow.cpp.

+ Here is the call graph for this function:

void MainWindow::onResetRecording ( )
slot

Slot to reset the recording.

Definition at line 611 of file mainwindow.cpp.

+ Here is the call graph for this function:

void MainWindow::onSelectNextMode ( )
slot

Slot to select the next mode.

Definition at line 726 of file mainwindow.cpp.

void MainWindow::onSelectPreviousMode ( )
slot

Slot to select the previous mode.

Definition at line 731 of file mainwindow.cpp.

void MainWindow::onToggleFullscreen ( )
slot

Slot to toggle full screen of the MainWindow.

Definition at line 736 of file mainwindow.cpp.

void MainWindow::onToggleMicroMute ( bool  checked)
slot

Toggle the mute button.

Parameters
checked: Button state

Definition at line 577 of file mainwindow.cpp.

+ Here is the call graph for this function:

void MainWindow::onToggleSpeakerMute ( bool  checked)
slot

Toggle the mute button.

Parameters
checked: Button state

Definition at line 581 of file mainwindow.cpp.

+ Here is the call graph for this function:

void MainWindow::onToggleTuningIndictator ( )
slot

Slot to toggle between the two tuning indicator modes.

Definition at line 745 of file mainwindow.cpp.

+ Here is the call graph for this function:

void MainWindow::onTutorial ( )
slot

Slot to open the tutorial.

Definition at line 627 of file mainwindow.cpp.

void MainWindow::onVersionUpdate ( VersionInformation  information)
privateslot

Definition at line 756 of file mainwindow.cpp.

+ Here is the call graph for this function:

void MainWindow::onViewLog ( )
slot

Slot to open the log viewer.

Definition at line 697 of file mainwindow.cpp.

void MainWindow::start ( )

Starts the main window.

This will initialize all label with default values.

Definition at line 324 of file mainwindow.cpp.

+ Here is the call graph for this function:

void MainWindow::updateFrequency ( const Key key)
private

Update the frequency label.

Parameters
key: The key index.

Definition at line 509 of file mainwindow.cpp.

+ Here is the call graph for this function:

void MainWindow::updateNoteName ( int  key)
private

Update the note name.

Parameters
key: The key index.

Definition at line 501 of file mainwindow.cpp.

+ Here is the call graph for this function:

void MainWindow::updateVolumeBar ( )
private

This will update the positions of the labels in the volume bar.

Definition at line 525 of file mainwindow.cpp.

+ Here is the call graph for this function:

void MainWindow::updateWindowTitle ( )
private

Update the window title.

The window title displays the current file name and a '*' if there are changes in the file.

Definition at line 521 of file mainwindow.cpp.

+ Here is the call graph for this function:

Member Data Documentation

CalculationProgressGroup* MainWindow::mCalculationProgressGroup
private

Pointer to the CalculationProgressGroup.

Definition at line 155 of file mainwindow.h.

Core* MainWindow::mCore
private

Pointer to the Core.

Definition at line 149 of file mainwindow.h.

QToolBar* MainWindow::mFileToolBar
private

Definition at line 168 of file mainwindow.h.

const QString MainWindow::mIconPostfix
private

The icon postfix set to @2x on devices with a higher pixeldensity of the display e.g. on iPad iwth retina displays

Definition at line 146 of file mainwindow.h.

KeyboardGraphicsView* MainWindow::mKeyboardGraphicsView
private

Definition at line 166 of file mainwindow.h.

QToolButton* MainWindow::mModeToolButtons[OperationMode::MODE_COUNT]
private

Tool buttons for all modes.

Definition at line 171 of file mainwindow.h.

SignalAnalyzerGroupBox* MainWindow::mSignalAnalyzerGroup
private

Pointer to the SignalAnalyzerGroupBox.

Definition at line 158 of file mainwindow.h.

TuningIndicatorGroupBox* MainWindow::mTuningIndicatorGroup
private

Pointer to the TuningIndicatorGroupBox.

Definition at line 161 of file mainwindow.h.

VolumeControlGroupBox* MainWindow::mVolumeControlGroup
private

Pointer to the VolumeControlGroupBox.

Definition at line 164 of file mainwindow.h.

Ui::MainWindow* MainWindow::ui
private

Ui of the Mainwindow.

Definition at line 152 of file mainwindow.h.


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