Merge master into feat/4.4.0
This commit is contained in:
commit
ba6e16442b
|
|
@ -56,4 +56,4 @@
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"version": 3
|
"version": 3
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,18 @@ macro(setup_builder)
|
||||||
|
|
||||||
include_directories(${ROOT_SOURCE_DIR})
|
include_directories(${ROOT_SOURCE_DIR})
|
||||||
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -W -Wshadow -Wunused-variable -Wunused-parameter -Wunused-function -Wunused -Wno-system-headers -Wno-deprecated -Woverloaded-virtual")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \
|
||||||
|
-Wall \
|
||||||
|
-W \
|
||||||
|
-Wshadow \
|
||||||
|
-Wunused-variable \
|
||||||
|
-Wunused-parameter \
|
||||||
|
-Wunused-function \
|
||||||
|
-Wunused \
|
||||||
|
-Wno-system-headers \
|
||||||
|
-Wno-deprecated \
|
||||||
|
-Woverloaded-virtual \
|
||||||
|
")
|
||||||
if (BUILDER_ENABLE_PROFILING)
|
if (BUILDER_ENABLE_PROFILING)
|
||||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -O0")
|
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -O0")
|
||||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} --coverage")
|
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} --coverage")
|
||||||
|
|
@ -16,3 +27,7 @@ macro(setup_builder)
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
||||||
|
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
|
macro(increase_warning_level)
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wconversion -Wsign-conversion")
|
||||||
|
endmacro()
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
increase_warning_level()
|
||||||
|
|
||||||
project(midi)
|
project(midi)
|
||||||
|
|
||||||
add_library(midi STATIC
|
add_library(midi STATIC
|
||||||
|
|
|
||||||
|
|
@ -104,7 +104,7 @@ unsigned decodeSysEx(const byte* inSysEx,
|
||||||
{
|
{
|
||||||
const byte body = inSysEx[i];
|
const byte body = inSysEx[i];
|
||||||
const byte shift = inFlipHeaderBits ? 6 - byteIndex : byteIndex;
|
const byte shift = inFlipHeaderBits ? 6 - byteIndex : byteIndex;
|
||||||
const byte msb = ((msbStorage >> shift) & 1) << 7;
|
const byte msb = byte(((msbStorage >> shift) & 1) << 7);
|
||||||
byteIndex--;
|
byteIndex--;
|
||||||
outData[count++] = msb | body;
|
outData[count++] = msb | body;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
12
src/MIDI.hpp
12
src/MIDI.hpp
|
|
@ -292,7 +292,7 @@ template<class SerialPort, class Settings>
|
||||||
void MidiInterface<SerialPort, Settings>::sendPitchBend(int inPitchValue,
|
void MidiInterface<SerialPort, Settings>::sendPitchBend(int inPitchValue,
|
||||||
Channel inChannel)
|
Channel inChannel)
|
||||||
{
|
{
|
||||||
const unsigned bend = inPitchValue - MIDI_PITCHBEND_MIN;
|
const unsigned bend = unsigned(inPitchValue - int(MIDI_PITCHBEND_MIN));
|
||||||
send(PitchBend, (bend & 0x7f), (bend >> 7) & 0x7f, inChannel);
|
send(PitchBend, (bend & 0x7f), (bend >> 7) & 0x7f, inChannel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -375,7 +375,7 @@ template<class SerialPort, class Settings>
|
||||||
void MidiInterface<SerialPort, Settings>::sendTimeCodeQuarterFrame(DataByte inTypeNibble,
|
void MidiInterface<SerialPort, Settings>::sendTimeCodeQuarterFrame(DataByte inTypeNibble,
|
||||||
DataByte inValuesNibble)
|
DataByte inValuesNibble)
|
||||||
{
|
{
|
||||||
const byte data = (((inTypeNibble & 0x07) << 4) | (inValuesNibble & 0x0f));
|
const byte data = byte((((inTypeNibble & 0x07) << 4) | (inValuesNibble & 0x0f)));
|
||||||
sendTimeCodeQuarterFrame(data);
|
sendTimeCodeQuarterFrame(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -620,7 +620,7 @@ template<class SerialPort, class Settings>
|
||||||
StatusByte MidiInterface<SerialPort, Settings>::getStatus(MidiType inType,
|
StatusByte MidiInterface<SerialPort, Settings>::getStatus(MidiType inType,
|
||||||
Channel inChannel) const
|
Channel inChannel) const
|
||||||
{
|
{
|
||||||
return ((byte)inType | ((inChannel - 1) & 0x0f));
|
return StatusByte(((byte)inType | ((inChannel - 1) & 0x0f)));
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
@ -856,7 +856,7 @@ bool MidiInterface<SerialPort, Settings>::parse()
|
||||||
|
|
||||||
// Get length
|
// Get length
|
||||||
mMessage.data1 = mPendingMessageIndex & 0xff; // LSB
|
mMessage.data1 = mPendingMessageIndex & 0xff; // LSB
|
||||||
mMessage.data2 = mPendingMessageIndex >> 8; // MSB
|
mMessage.data2 = byte(mPendingMessageIndex >> 8); // MSB
|
||||||
mMessage.channel = 0;
|
mMessage.channel = 0;
|
||||||
mMessage.valid = true;
|
mMessage.valid = true;
|
||||||
|
|
||||||
|
|
@ -1116,7 +1116,7 @@ MidiType MidiInterface<SerialPort, Settings>::getTypeFromStatusByte(byte inStatu
|
||||||
template<class SerialPort, class Settings>
|
template<class SerialPort, class Settings>
|
||||||
inline Channel MidiInterface<SerialPort, Settings>::getChannelFromStatusByte(byte inStatus)
|
inline Channel MidiInterface<SerialPort, Settings>::getChannelFromStatusByte(byte inStatus)
|
||||||
{
|
{
|
||||||
return (inStatus & 0x0f) + 1;
|
return Channel((inStatus & 0x0f) + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class SerialPort, class Settings>
|
template<class SerialPort, class Settings>
|
||||||
|
|
@ -1221,7 +1221,7 @@ void MidiInterface<SerialPort, Settings>::launchCallback()
|
||||||
|
|
||||||
// Occasional messages
|
// Occasional messages
|
||||||
case TimeCodeQuarterFrame: if (mTimeCodeQuarterFrameCallback != 0) mTimeCodeQuarterFrameCallback(mMessage.data1); break;
|
case TimeCodeQuarterFrame: if (mTimeCodeQuarterFrameCallback != 0) mTimeCodeQuarterFrameCallback(mMessage.data1); break;
|
||||||
case SongPosition: if (mSongPositionCallback != 0) mSongPositionCallback((mMessage.data1 & 0x7f) | ((mMessage.data2 & 0x7f) << 7)); break;
|
case SongPosition: if (mSongPositionCallback != 0) mSongPositionCallback(unsigned((mMessage.data1 & 0x7f) | ((mMessage.data2 & 0x7f) << 7))); break;
|
||||||
case SongSelect: if (mSongSelectCallback != 0) mSongSelectCallback(mMessage.data1); break;
|
case SongSelect: if (mSongSelectCallback != 0) mSongSelectCallback(mMessage.data1); break;
|
||||||
case TuneRequest: if (mTuneRequestCallback != 0) mTuneRequestCallback(); break;
|
case TuneRequest: if (mTuneRequestCallback != 0) mTuneRequestCallback(); break;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue