1
//---------------------------------------------------------------------------------------
2
// LenMus Phonascus: The teacher of music
3
// Copyright (c) 2002-2012 LenMus project
5
// This program is free software; you can redistribute it and/or modify it under the
6
// terms of the GNU General Public License as published by the Free Software Foundation,
7
// either version 3 of the License, or (at your option) any later version.
9
// This program is distributed in the hope that it will be useful, but WITHOUT ANY
10
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11
// PARTICULAR PURPOSE. See the GNU General Public License for more details.
13
// You should have received a copy of the GNU General Public License along with this
14
// program. If not, see <http://www.gnu.org/licenses/>.
16
// For any comment, suggestion or feature request, please contact the manager of
17
// the project at cecilios@users.sourceforge.net
19
//---------------------------------------------------------------------------------------
21
#ifndef __LENMUS_METRONOME_H__ //to avoid nested includes
22
#define __LENMUS_METRONOME_H__
25
#include "lomse_metronome.h"
26
using namespace lomse;
29
#include "lenmus_injectors.h"
30
#include "lenmus_midi_server.h"
31
using namespace lenmus;
34
#include <wx/wxprec.h>
44
//forward declarations
45
class GlobalMetronome;
48
//---------------------------------------------------------------------------------------
49
class MetronomeTimer : public wxTimer
52
GlobalMetronome* m_pOwner;
55
MetronomeTimer(GlobalMetronome* pOwner) : wxTimer(), m_pOwner(pOwner) {}
61
//---------------------------------------------------------------------------------------
62
class GlobalMetronome : public Metronome
65
int m_nSound; //last click on sound
66
MetronomeTimer* m_pTimer; //timer associated to this metronome
67
MidiServer* m_pMidiServer;
70
GlobalMetronome(ApplicationScope& appScope, long nMM = 60);
73
// mandatory overrides
77
// timer events handler
81
void DoClick(bool fFirstBeatOfBar=true);
85
void ClickOn(bool fFirstBeatOfBar);
93
#endif // __LENMUS_METRONOME_H__