-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathscoreedit_guitar.cpp
103 lines (88 loc) · 2.51 KB
/
scoreedit_guitar.cpp
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
/*
Scoreview (R)
Copyright (C) 2015 Patrick Areny
All Rights Reserved.
Scoreview 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/>.
*/
#include <iterator>
#include <list>
#include <vector>
#include <assert.h>
#include <SDL2/SDL.h>
#include "gfxareas.h"
#include "mesh.h"
#include "score.h"
#include "f2n.h"
#include "keypress.h"
#include "instrumenthand.h"
#include "scoreplacement.h"
#include "scoreedit.h"
#include "scoreedit_guitar.h"
CscoreEditGuitar::CscoreEditGuitar(Ckeypress *pkstates):CscoreEdit(pkstates)
{
}
CscoreEditGuitar:: ~CscoreEditGuitar()
{
}
// Same as the others but never goes past an overflow note
bool CscoreEditGuitar::change_chord_frequency_element(CScorePlacement *pplacement, CNote *pnote, float frequency, int element_num, bool btimechange)
{
std::list<t_notefreq>::iterator iter;
int i;
bool bchange;
CInstrumentHand* phand;
phand = pplacement->get_hand();
assert(phand != NULL);
// Frequency modification
#ifdef _DEBUG
printf("frequency modification, chordnum=%d\n", element_num);
#endif
bchange = false;
if (phand->get_first_string(frequency) != OUTOFRANGE)
{
i = 0;
iter = pnote->m_freq_list.begin();
while (iter != pnote->m_freq_list.end())
{
if (i == element_num)
{
if ((*iter).f != frequency) // Practice update
{
bchange = true;
}
(*iter).f = frequency;
(*iter).string = phand->get_proper_string((*iter).f, (*iter).string);
break;
}
i++;
iter++;
}
}
#ifdef _DEBUG
printf("freqmoddone\n");
#endif
// Time modification
if (bchange || btimechange)
{
m_editstate.changed_notes_list.push_front(pnote);
return true;
}
return bchange;
}
//----------------------------------------------------------------------------------------------------------------------
// Drop D version, same thing
CscoreEditGuitarDropD::CscoreEditGuitarDropD(Ckeypress *pkstates):CscoreEditGuitar(pkstates)
{
}
CscoreEditGuitarDropD::~CscoreEditGuitarDropD()
{
}