-
Notifications
You must be signed in to change notification settings - Fork 0
/
maChainLink.h
70 lines (57 loc) · 2.17 KB
/
maChainLink.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
//
// MultiArp - Another step in the Great Midi Adventure!
// Copyright (C) 2017, 2018 Barry Neilsen
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
//////////////////////////////////////////////////////////////////////////////
#ifndef CHAINLINK_H
#define CHAINLINK_H
#include <string>
#include "maCursorKeys.h"
class PatternChain;
class ChainLink : public CursorKeys
{
public:
ChainLink();
virtual ~ChainLink();
int Pattern() { return m_Pattern; }
void SetPattern(int val) { m_Pattern = val; }
int Repeats() { return m_Repeats; }
void ClearRemaining() { m_Remaining = -1; }
int Remaining();
void SetRepeats(int val) { m_Repeats = val; }
int Jump() { return m_Jump; }
void SetJump(int val) { m_Jump = val; }
std::string ToString();
std::string ToStringForDisplay(bool forMenu = false, unsigned width = 12);
void FromString(std::string & s);
void SetParent( PatternChain * val ) { m_Parent = val; }
virtual void SetStatus();
virtual void SetFocus()
{
CursorKeys::SetFocus();
// SetStatus();
}
protected:
virtual bool HandleKey(key_type_t k);
private:
int m_Pattern = 0;
int m_Repeats = 0; // Zero means no repeat. Set to -1 for indefinite repeat.
int m_Remaining = -1; // -1 means initialize in RepeatsRemaining().
int m_Jump = -1;
int m_PosEdit = 0;
PatternChain * m_Parent = NULL;
};
#endif // CHAINLINK_H