1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ 2 3 /* 4 Rosegarden 5 A sequencer and musical notation editor. 6 Copyright 2000-2021 the Rosegarden development team. 7 See the AUTHORS file for more details. 8 9 This program is free software; you can redistribute it and/or 10 modify it under the terms of the GNU General Public License as 11 published by the Free Software Foundation; either version 2 of the 12 License, or (at your option) any later version. See the file 13 COPYING included with this distribution for more information. 14 */ 15 16 #ifndef RG_MIDI_METRONOME_H 17 #define RG_MIDI_METRONOME_H 18 19 #include "Instrument.h" 20 #include "MidiProgram.h" 21 22 namespace Rosegarden { 23 24 // A mapped MIDI instrument - a drum track click for example 25 // 26 class MidiMetronome 27 { 28 public: 29 MidiMetronome(InstrumentId instrument, 30 MidiByte barPitch = 37, 31 MidiByte beatPitch = 37, 32 MidiByte subBeatPitch = 37, 33 int depth = 2, 34 MidiByte barVely = 120, 35 MidiByte beatVely = 100, 36 MidiByte subBeatVely = 80) : m_instrument(instrument)37 m_instrument(instrument), 38 m_barPitch(barPitch), 39 m_beatPitch(beatPitch), 40 m_subBeatPitch(subBeatPitch), 41 m_depth(depth), 42 m_barVelocity(barVely), 43 m_beatVelocity(beatVely), 44 m_subBeatVelocity(subBeatVely) 45 { 46 // nothing else 47 } 48 getInstrument()49 InstrumentId getInstrument() const { return m_instrument; } getBarPitch()50 MidiByte getBarPitch() const { return m_barPitch; } getBeatPitch()51 MidiByte getBeatPitch() const { return m_beatPitch; } getSubBeatPitch()52 MidiByte getSubBeatPitch() const { return m_subBeatPitch; } getDepth()53 int getDepth() const { return m_depth; } getBarVelocity()54 MidiByte getBarVelocity() const { return m_barVelocity; } getBeatVelocity()55 MidiByte getBeatVelocity() const { return m_beatVelocity; } getSubBeatVelocity()56 MidiByte getSubBeatVelocity() const { return m_subBeatVelocity; } 57 setInstrument(InstrumentId id)58 void setInstrument(InstrumentId id) { m_instrument = id; } setBarPitch(MidiByte pitch)59 void setBarPitch(MidiByte pitch) { m_barPitch = pitch; } setBeatPitch(MidiByte pitch)60 void setBeatPitch(MidiByte pitch) { m_beatPitch = pitch; } setSubBeatPitch(MidiByte pitch)61 void setSubBeatPitch(MidiByte pitch) { m_subBeatPitch = pitch; } setDepth(int depth)62 void setDepth(int depth) { m_depth = depth; } setBarVelocity(MidiByte barVely)63 void setBarVelocity(MidiByte barVely) { m_barVelocity = barVely; } setBeatVelocity(MidiByte beatVely)64 void setBeatVelocity(MidiByte beatVely) { m_beatVelocity = beatVely; } setSubBeatVelocity(MidiByte subBeatVely)65 void setSubBeatVelocity(MidiByte subBeatVely) { m_subBeatVelocity = subBeatVely; } 66 67 private: 68 InstrumentId m_instrument; 69 MidiByte m_barPitch; 70 MidiByte m_beatPitch; 71 MidiByte m_subBeatPitch; 72 int m_depth; 73 MidiByte m_barVelocity; 74 MidiByte m_beatVelocity; 75 MidiByte m_subBeatVelocity; 76 }; 77 78 } 79 80 #endif 81 82