Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Education
Minuet
Commits
64c61807
Commit
64c61807
authored
Mar 28, 2016
by
Sandro Andrade
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'Applications/16.04'
parents
646b2e1e
14c969e1
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
43 additions
and
37 deletions
+43
-37
Messages.sh
Messages.sh
+2
-1
exercises/chords-root-position.json
exercises/chords-root-position.json
+1
-1
exercises/intervals-ascending-melodic.json
exercises/intervals-ascending-melodic.json
+1
-1
exercises/intervals-descending-melodic.json
exercises/intervals-descending-melodic.json
+1
-1
exercises/rhythm-easy.json
exercises/rhythm-easy.json
+1
-1
exercises/rhythm-medium.json
exercises/rhythm-medium.json
+1
-1
exercises/scales-major-and-its-modes.json
exercises/scales-major-and-its-modes.json
+1
-2
src/main.cpp
src/main.cpp
+2
-1
src/qml/ExerciseView.qml
src/qml/ExerciseView.qml
+20
-15
src/qml/Main.qml
src/qml/Main.qml
+5
-5
src/qml/MinuetMenu.qml
src/qml/MinuetMenu.qml
+8
-8
No files found.
Messages.sh
View file @
64c61807
#! /usr/bin/env bash
$EXTRACTRC
`
find
.
-name
\*
.ui
-o
-name
\*
.rc
-o
-name
\*
.kcfg
`
>>
rc.cpp
find exercises/
-name
*
.json |
while
read
FILE
;
do
cat
$FILE
|
sed
-n
's/"name"\s*:\s*"\(.*\)",/\1/p'
|
sed
-n
's/\s*//p'
>>
strings.txt
;
done
cat
strings.txt |
while
read
STR
;
do
printf
"i18nc(
\"
technical term, do you have a musician friend?
\"
,
\"
$STR
\"
)
\n
"
>>
rc.cpp
;
done
find exercises/
-name
*
.json |
while
read
FILE
;
do
cat
$FILE
|
sed
-n
's/"userMessage"\s*:\s*"\(.*\)",/\1/p'
|
sed
-n
's/\s*//p'
>>
strings.txt
;
done
sort
-u
strings.txt |
while
read
STR
;
do
printf
"i18nc(
\"
technical term, do you have a musician friend?
\"
,
\"
$STR
\"
)
\n
"
>>
rc.cpp
;
done
$XGETTEXT
`
find
.
-name
\*
.cpp
-o
-name
\*
.qml
`
-o
$podir
/minuet.pot
rm
-f
rc.cpp
rm
-f
strings.txt
exercises/chords-root-position.json
View file @
64c61807
...
...
@@ -4,7 +4,7 @@
"name"
:
"Chords"
,
"root"
:
"21..104"
,
"playMode"
:
"chord"
,
"
typ
e"
:
"chord"
,
"
userMessag
e"
:
"
the
chord"
,
"children"
:
[
{
"name"
:
"Root Position"
,
...
...
exercises/intervals-ascending-melodic.json
View file @
64c61807
...
...
@@ -4,7 +4,7 @@
"name"
:
"Intervals"
,
"root"
:
"21..104"
,
"playMode"
:
"scale"
,
"
typ
e"
:
"interval"
,
"
userMessag
e"
:
"
the
interval"
,
"children"
:
[
{
"name"
:
"Ascending Melodic Intervals"
,
...
...
exercises/intervals-descending-melodic.json
View file @
64c61807
...
...
@@ -4,7 +4,7 @@
"name"
:
"Intervals"
,
"root"
:
"21..104"
,
"playMode"
:
"scale"
,
"
typ
e"
:
"interval"
,
"
userMessag
e"
:
"
the
interval"
,
"children"
:
[
{
"name"
:
"Descending Melodic Intervals"
,
...
...
exercises/rhythm-easy.json
View file @
64c61807
...
...
@@ -3,7 +3,7 @@
{
"name"
:
"Rhythm"
,
"playMode"
:
"rhythm"
,
"
typ
e"
:
"rhythm"
,
"
userMessag
e"
:
"
the
rhythm"
,
"template"
:
"lilypond-templates/rhythm.ly.tmpl"
,
"children"
:
[
{
...
...
exercises/rhythm-medium.json
View file @
64c61807
...
...
@@ -3,7 +3,7 @@
{
"name"
:
"Rhythm"
,
"playMode"
:
"rhythm"
,
"
typ
e"
:
"rhythm"
,
"
userMessag
e"
:
"
the
rhythm"
,
"template"
:
"lilypond-templates/rhythm.ly.tmpl"
,
"children"
:
[
{
...
...
exercises/scales-major-and-its-modes.json
View file @
64c61807
...
...
@@ -4,11 +4,10 @@
"name"
:
"Scales"
,
"root"
:
"21..104"
,
"playMode"
:
"scale"
,
"
typ
e"
:
"scale"
,
"
userMessag
e"
:
"
the
scale"
,
"children"
:
[
{
"name"
:
"Major Scale and its Modes"
,
"playMode"
:
"scale"
,
"options"
:
[
{
"name"
:
"Ionian"
,
...
...
src/main.cpp
View file @
64c61807
...
...
@@ -49,7 +49,8 @@ int main(int argc, char **argv)
KAboutLicense
::
GPL
,
i18n
(
"(c) 2016, Sandro S. Andrade (sandroandrade@kde.org)"
));
aboutData
.
addAuthor
(
i18n
(
"Sandro S. Andrade"
),
i18n
(
"Author"
),
QStringLiteral
(
"sandroandrade@kde.org"
));
aboutData
.
addAuthor
(
i18n
(
"Sandro S. Andrade"
),
i18n
(
"Developer"
),
QStringLiteral
(
"alessandro.longo@kdemail.net"
));
aboutData
.
addAuthor
(
i18n
(
"Alessandro Longo"
),
i18n
(
"Minuet Icon Designer"
),
QStringLiteral
(
"sandroandrade@kde.org"
));
application
.
setWindowIcon
(
QIcon
::
fromTheme
(
QStringLiteral
(
"minuet"
)));
QCommandLineParser
parser
;
parser
.
addHelpOption
();
...
...
src/qml/ExerciseView.qml
View file @
64c61807
...
...
@@ -28,7 +28,7 @@ Item {
property
var
chosenExercises
property
var
chosenColors
:
[
4
]
property
string
exerciseTyp
e
property
string
userMessag
e
property
Item
answerRectangle
property
var
colors
:
[
"
#8dd3c7
"
,
"
#ffffb3
"
,
"
#bebada
"
,
"
#fb8072
"
,
"
#80b1d3
"
,
"
#fdb462
"
,
"
#b3de69
"
,
"
#fccde5
"
,
"
#d9d9d9
"
,
"
#bc80bd
"
,
"
#ccebc5
"
,
"
#ffed6f
"
,
"
#a6cee3
"
,
"
#1f78b4
"
,
"
#b2df8a
"
,
"
#33a02c
"
,
"
#fb9a99
"
,
"
#e31a1c
"
,
"
#fdbf6f
"
,
"
#ff7f00
"
,
"
#cab2d6
"
,
"
#6a3d9a
"
,
"
#ffff99
"
,
"
#b15928
"
]
...
...
@@ -66,8 +66,8 @@ Item {
exerciseView
.
visible
=
true
exerciseView
.
state
=
"
initial
"
}
function
change
ExerciseType
(
typ
e
)
{
exerciseType
=
typ
e
function
change
UserMessage
(
messag
e
)
{
userMessage
=
messag
e
}
function
checkAnswers
(
answers
)
{
var
answersOk
=
true
...
...
@@ -94,7 +94,8 @@ Item {
horizontalAlignment
:
Text
.
AlignHCenter
font.pointSize
:
18
textFormat
:
Text
.
RichText
text
:
i18n
(
"
Hear the %1 and then choose an answer from options below!<br/>Click 'play question' if you want to hear again!
"
,
exerciseType
)
text
:
i18n
(
"
Hear %1 and then choose an answer from options below!<br/>Click 'play question' if you want to hear again!
"
,
i18nc
(
"
technical term, do you have a musician friend?
"
,
userMessage
))
}
Row
{
anchors
{
horizontalCenter
:
parent
.
horizontalCenter
}
...
...
@@ -113,11 +114,13 @@ Item {
chosenColors
[
i
]
=
answerGrid
.
children
[
j
].
color
break
}
messageText
.
text
=
i18n
(
"
Hear the %1 and then choose an answer from options below!<br/>Click 'play question' if you want to hear again!
"
,
exerciseType
)
if
(
exerciseType
!=
"
rhythm
"
)
messageText
.
text
=
i18n
(
"
Hear %1 and then choose an answer from options below!<br/>Click 'play question' if you want to hear again!
"
,
i18nc
(
"
technical term, do you have a musician friend?
"
,
userMessage
))
if
(
userMessage
!=
"
the rhythm
"
)
answerHoverEnter
(
0
,
exerciseController
.
chosenRootNote
(),
0
,
"
white
"
)
exerciseController
.
playChoosenExercise
()
}
style
:
MinuetButtonStyle
{
labelHorizontalAlignment
:
Qt
.
AlignHCenter
}
}
Button
{
id
:
playQuestionButton
...
...
@@ -125,6 +128,7 @@ Item {
width
:
124
;
height
:
44
text
:
i18n
(
"
play question
"
)
onClicked
:
exerciseController
.
playChoosenExercise
()
style
:
MinuetButtonStyle
{
labelHorizontalAlignment
:
Qt
.
AlignHCenter
}
}
Button
{
id
:
giveUpButton
...
...
@@ -132,7 +136,7 @@ Item {
width
:
124
;
height
:
44
text
:
i18n
(
"
give up
"
)
onClicked
:
{
if
(
exerciseTyp
e
!=
"
rhythm
"
)
{
if
(
userMessag
e
!=
"
the
rhythm
"
)
{
highlightRightAnswer
()
}
else
{
...
...
@@ -140,6 +144,7 @@ Item {
exerciseView
.
state
=
"
nextQuestion
"
}
}
style
:
MinuetButtonStyle
{
labelHorizontalAlignment
:
Qt
.
AlignHCenter
}
}
}
Rectangle
{
...
...
@@ -162,14 +167,14 @@ Item {
property
var
model
property
int
index
width
:
(
exerciseTyp
e
!=
"
rhythm
"
)
?
120
:
119
height
:
(
exerciseTyp
e
!=
"
rhythm
"
)
?
40
:
59
width
:
(
userMessag
e
!=
"
the
rhythm
"
)
?
120
:
119
height
:
(
userMessag
e
!=
"
the
rhythm
"
)
?
40
:
59
Text
{
id
:
option
property
string
originalText
:
model
.
name
visible
:
exerciseTyp
e
!=
"
rhythm
"
visible
:
userMessag
e
!=
"
the
rhythm
"
text
:
i18nc
(
"
technical term, do you have a musician friend?
"
,
model
.
name
)
width
:
parent
.
width
-
4
anchors.centerIn
:
parent
...
...
@@ -181,14 +186,14 @@ Item {
id
:
rhythmImage
anchors.centerIn
:
parent
visible
:
exerciseTyp
e
==
"
rhythm
"
source
:
(
exerciseTyp
e
==
"
rhythm
"
)
?
"
exercise-images/
"
+
model
.
name
+
"
.png
"
:
""
visible
:
userMessag
e
==
"
the
rhythm
"
source
:
(
userMessag
e
==
"
the
rhythm
"
)
?
"
exercise-images/
"
+
model
.
name
+
"
.png
"
:
""
fillMode
:
Image
.
Pad
}
MouseArea
{
anchors.fill
:
parent
onClicked
:
{
if
(
exerciseTyp
e
!=
"
rhythm
"
)
{
if
(
userMessag
e
!=
"
the
rhythm
"
)
{
onExited
()
if
(
option
.
originalText
==
chosenExercises
[
0
])
messageText
.
text
=
i18n
(
"
Congratulations!<br/>You answered correctly!
"
)
...
...
@@ -204,7 +209,7 @@ Item {
hoverEnabled
:
true
onEntered
:
{
answerRectangle
.
color
=
Qt
.
darker
(
answerRectangle
.
color
,
1.1
)
if
(
exerciseTyp
e
!=
"
rhythm
"
)
{
if
(
userMessag
e
!=
"
the
rhythm
"
)
{
model
.
sequence
.
split
(
'
'
).
forEach
(
function
(
note
)
{
answerHoverEnter
(
0
,
exerciseController
.
chosenRootNote
()
+
parseInt
(
note
),
0
,
colors
[
answerRectangle
.
index
])
})
...
...
@@ -212,7 +217,7 @@ Item {
}
onExited
:
{
answerRectangle
.
color
=
colors
[
answerRectangle
.
index
]
if
(
exerciseTyp
e
!=
"
rhythm
"
)
{
if
(
userMessag
e
!=
"
the
rhythm
"
)
{
if
(
!
animation
.
running
)
model
.
sequence
.
split
(
'
'
).
forEach
(
function
(
note
)
{
answerHoverExit
(
0
,
exerciseController
.
chosenRootNote
()
+
parseInt
(
note
),
0
)
...
...
src/qml/Main.qml
View file @
64c61807
...
...
@@ -29,9 +29,9 @@ Item {
property
int
menuBarWidth
:
280
function
exerciseTyp
eChanged
(
typ
e
)
{
pianoView
.
visible
=
(
typ
e
!=
"
rhythm
"
&&
typ
e
!=
"
exercise
"
)
rhythmAnswerView
.
visible
=
(
typ
e
==
"
rhythm
"
)
function
userMessag
eChanged
(
messag
e
)
{
pianoView
.
visible
=
(
messag
e
!=
"
the
rhythm
"
&&
messag
e
!=
"
exercise
"
)
rhythmAnswerView
.
visible
=
(
messag
e
==
"
the
rhythm
"
)
}
function
exerciseViewStateChanged
(
state
)
{
if
(
state
==
"
waitingForAnswer
"
)
...
...
@@ -83,8 +83,8 @@ Item {
minuetMenu
.
breadcrumbPressed
.
connect
(
exerciseView
.
clearExerciseGrid
)
minuetMenu
.
breadcrumbPressed
.
connect
(
rhythmAnswerView
.
resetAnswers
)
minuetMenu
.
itemChanged
.
connect
(
exerciseView
.
itemChanged
)
minuetMenu
.
exerciseTyp
eChanged
.
connect
(
exerciseView
.
change
ExerciseTyp
e
)
minuetMenu
.
exerciseTyp
eChanged
.
connect
(
mainItem
.
exerciseTyp
eChanged
)
minuetMenu
.
userMessag
eChanged
.
connect
(
exerciseView
.
change
UserMessag
e
)
minuetMenu
.
userMessag
eChanged
.
connect
(
mainItem
.
userMessag
eChanged
)
minuetMenu
.
itemChanged
.
connect
(
rhythmAnswerView
.
resetAnswers
)
sequencer
.
noteOn
.
connect
(
pianoView
.
noteOn
)
...
...
src/qml/MinuetMenu.qml
View file @
64c61807
...
...
@@ -30,11 +30,11 @@ Item {
id
:
minuetMenu
property
Item
selectedMenuItem
property
string
typ
e
property
string
messag
e
signal
breadcrumbPressed
signal
itemChanged
(
var
model
)
signal
exerciseTyp
eChanged
(
string
typ
e
)
signal
userMessag
eChanged
(
string
messag
e
)
function
itemClicked
(
delegateRect
,
index
)
{
var
model
=
delegateRect
.
ListView
.
view
.
model
[
index
].
options
...
...
@@ -54,9 +54,9 @@ Item {
minuetMenu
.
breadcrumbPressed
()
selectedMenuItem
=
null
stackView
.
pop
()
exerciseTyp
eChanged
(
"
exercise
"
)
userMessag
eChanged
(
"
exercise
"
)
if
(
stackView
.
depth
==
1
)
typ
e
=
"
exercise
"
messag
e
=
"
exercise
"
}
}
StackView
{
...
...
@@ -77,13 +77,13 @@ Item {
text
:
i18nc
(
"
technical term, do you have a musician friend?
"
,
modelData
.
name
)
checkable
:
(
!
delegateRect
.
ListView
.
view
.
model
[
index
].
children
)
?
true
:
false
onClicked
:
{
var
exerciseTyp
e
=
delegateRect
.
ListView
.
view
.
model
[
index
].
typ
e
if
(
exerciseTyp
e
!=
undefined
)
type
=
exerciseTyp
e
var
userMessag
e
=
delegateRect
.
ListView
.
view
.
model
[
index
].
userMessag
e
if
(
userMessag
e
!=
undefined
)
message
=
userMessag
e
var
children
=
delegateRect
.
ListView
.
view
.
model
[
index
].
children
if
(
!
children
)
{
if
(
selectedMenuItem
!=
undefined
)
selectedMenuItem
.
checked
=
false
exerciseTyp
eChanged
(
typ
e
)
userMessag
eChanged
(
messag
e
)
itemClicked
(
delegateRect
,
index
)
selectedMenuItem
=
delegateRect
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment