Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Minuet
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Education
Minuet
Commits
73e88607
Commit
73e88607
authored
Jun 30, 2016
by
Sandro Andrade
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor pitch, volume, and tempo control to new architecture
parent
f2cb707a
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
43 additions
and
11 deletions
+43
-11
src/interfaces/isoundbackend.h
src/interfaces/isoundbackend.h
+7
-5
src/plugins/drumsticksoundbackend/drumsticksoundbackend.cpp
src/plugins/drumsticksoundbackend/drumsticksoundbackend.cpp
+16
-0
src/plugins/drumsticksoundbackend/drumsticksoundbackend.h
src/plugins/drumsticksoundbackend/drumsticksoundbackend.h
+2
-0
src/plugins/drumsticksoundbackend/midisequenceroutputthread.cpp
...ugins/drumsticksoundbackend/midisequenceroutputthread.cpp
+2
-2
src/plugins/drumsticksoundbackend/midisequenceroutputthread.h
...plugins/drumsticksoundbackend/midisequenceroutputthread.h
+3
-3
src/plugins/fluidsynthsoundbackend/fluidsynthsoundbackend.cpp
...plugins/fluidsynthsoundbackend/fluidsynthsoundbackend.cpp
+10
-0
src/plugins/fluidsynthsoundbackend/fluidsynthsoundbackend.h
src/plugins/fluidsynthsoundbackend/fluidsynthsoundbackend.h
+3
-1
No files found.
src/interfaces/isoundbackend.h
View file @
73e88607
...
...
@@ -36,8 +36,8 @@ class MINUETINTERFACES_EXPORT ISoundBackend : public IPlugin
{
Q_OBJECT
Q_PROPERTY
(
int
pitch
MEMBER
m_p
itch
NOTIFY
pitchChanged
)
Q_PROPERTY
(
quint8
volume
MEMBER
m_volume
NOTIFY
volumeChanged
)
Q_PROPERTY
(
qint8
pitch
MEMBER
m_pitch
WRITE
setP
itch
NOTIFY
pitchChanged
)
Q_PROPERTY
(
quint8
volume
MEMBER
m_volume
WRITE
setVolume
NOTIFY
volumeChanged
)
Q_PROPERTY
(
quint8
tempo
MEMBER
m_tempo
WRITE
setTempo
NOTIFY
tempoChanged
)
Q_PROPERTY
(
QString
playbackLabel
READ
playbackLabel
NOTIFY
playbackLabelChanged
)
Q_ENUMS
(
PlayMode
)
...
...
@@ -65,7 +65,9 @@ public:
ISoundBackend
::
State
state
()
const
;
public
Q_SLOTS
:
virtual
void
setTempo
(
quint8
tempo
)
=
0
;
virtual
void
setPitch
(
qint8
pitch
)
=
0
;
virtual
void
setVolume
(
quint8
tempo
)
=
0
;
virtual
void
setTempo
(
quint8
tempo
)
=
0
;
virtual
void
prepareFromExerciseOptions
(
QJsonArray
selectedOptions
)
=
0
;
virtual
void
prepareFromMidiFile
(
const
QString
&
fileName
)
=
0
;
...
...
@@ -75,7 +77,7 @@ public Q_SLOTS:
virtual
void
stop
()
=
0
;
Q_SIGNALS:
void
pitchChanged
(
int
newPitch
);
void
pitchChanged
(
qint8
newPitch
);
void
volumeChanged
(
quint8
newVolume
);
void
tempoChanged
(
quint8
newTempo
);
void
playbackLabelChanged
(
QString
newPlaybackLabel
);
...
...
@@ -87,7 +89,7 @@ protected:
void
setPlaybackLabel
(
const
QString
&
playbackLabel
);
void
setState
(
State
state
);
int
m_pitch
;
qint8
m_pitch
;
quint8
m_volume
;
quint8
m_tempo
;
QString
m_playbackLabel
;
...
...
src/plugins/drumsticksoundbackend/drumsticksoundbackend.cpp
View file @
73e88607
...
...
@@ -116,6 +116,22 @@ DrumstickSoundBackend::~DrumstickSoundBackend()
qCDebug
(
MINUET
)
<<
"TiMidity++ stoped!"
;
}
void
DrumstickSoundBackend
::
setPitch
(
qint8
pitch
)
{
if
(
m_midiSequencerOutputThread
->
pitch
()
!=
pitch
)
{
m_midiSequencerOutputThread
->
setPitch
(
pitch
);
emit
pitchChanged
(
pitch
);
}
}
void
DrumstickSoundBackend
::
setVolume
(
quint8
volume
)
{
if
(
m_midiSequencerOutputThread
->
volume
()
!=
volume
)
{
m_midiSequencerOutputThread
->
setVolume
(
volume
);
emit
volumeChanged
(
volume
);
}
}
void
DrumstickSoundBackend
::
setTempo
(
quint8
tempo
)
{
float
tempoFactor
=
(
tempo
*
tempo
+
100.0
*
tempo
+
20000.0
)
/
40000.0
;
...
...
src/plugins/drumsticksoundbackend/drumsticksoundbackend.h
View file @
73e88607
...
...
@@ -55,6 +55,8 @@ public:
virtual
~
DrumstickSoundBackend
()
override
;
public
Q_SLOTS
:
virtual
void
setPitch
(
qint8
pitch
);
virtual
void
setVolume
(
quint8
volume
);
virtual
void
setTempo
(
quint8
tempo
);
virtual
void
prepareFromExerciseOptions
(
QJsonArray
selectedOptions
)
override
;
...
...
src/plugins/drumsticksoundbackend/midisequenceroutputthread.cpp
View file @
73e88607
...
...
@@ -122,7 +122,7 @@ unsigned int MidiSequencerOutputThread::volume() const
return
m_volume
;
}
void
MidiSequencerOutputThread
::
setPitch
(
int
value
)
void
MidiSequencerOutputThread
::
setPitch
(
qint8
value
)
{
bool
playing
=
isRunning
();
if
(
playing
)
{
...
...
@@ -137,7 +137,7 @@ void MidiSequencerOutputThread::setPitch(int value)
start
();
}
int
MidiSequencerOutputThread
::
pitch
()
const
qint8
MidiSequencerOutputThread
::
pitch
()
const
{
return
m_pitchShift
;
}
...
...
src/plugins/drumsticksoundbackend/midisequenceroutputthread.h
View file @
73e88607
...
...
@@ -45,8 +45,8 @@ public:
virtual
unsigned
int
getInitialPosition
()
{
return
m_songPosition
;
}
void
setSong
(
Song
*
song
);
void
setPitch
(
int
value
);
int
pitch
()
const
;
void
setPitch
(
qint8
value
);
qint8
pitch
()
const
;
void
setVolume
(
unsigned
int
volume
);
unsigned
int
volume
()
const
;
void
setPosition
(
unsigned
int
pos
);
...
...
@@ -64,7 +64,7 @@ private:
drumstick
::
SequencerEvent
*
m_lastEvent
;
unsigned
int
m_volume
;
int
m_channelVolume
[
MIDI_CHANNELS
];
int
m_pitchShift
;
qint8
m_pitchShift
;
float
m_tempoFactor
;
QListIterator
<
drumstick
::
SequencerEvent
*>*
m_songIterator
;
};
...
...
src/plugins/fluidsynthsoundbackend/fluidsynthsoundbackend.cpp
View file @
73e88607
...
...
@@ -31,6 +31,16 @@ FluidSynthSoundBackend::~FluidSynthSoundBackend()
{
}
void
FluidSynthSoundBackend
::
setPitch
(
qint8
pitch
)
{
Q_UNUSED
(
pitch
);
}
void
FluidSynthSoundBackend
::
setVolume
(
quint8
volume
)
{
Q_UNUSED
(
volume
);
}
void
FluidSynthSoundBackend
::
setTempo
(
quint8
tempo
)
{
Q_UNUSED
(
tempo
);
...
...
src/plugins/fluidsynthsoundbackend/fluidsynthsoundbackend.h
View file @
73e88607
...
...
@@ -38,7 +38,9 @@ public:
virtual
~
FluidSynthSoundBackend
()
override
;
public
Q_SLOTS
:
virtual
void
setTempo
(
quint8
tempo
);
virtual
void
setPitch
(
qint8
pitch
);
virtual
void
setVolume
(
quint8
volume
);
virtual
void
setTempo
(
quint8
tempo
);
virtual
void
prepareFromExerciseOptions
(
QJsonArray
selectedOptions
)
override
;
virtual
void
prepareFromMidiFile
(
const
QString
&
fileName
)
override
;
...
...
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