diff options
author | Wohlstand <admin@wohlnet.ru> | 2018-06-03 15:46:50 +0300 |
---|---|---|
committer | Wohlstand <admin@wohlnet.ru> | 2018-06-03 15:46:50 +0300 |
commit | adcf702a7e18846ad4f8753ec5a32cf56585ca23 (patch) | |
tree | d2b357b91695868c8d2b48ecf6e4cd82d2f9cfe6 /src/adlmidi_private.hpp | |
parent | c4c36c82919b3136b9592db1f7872fc7d4907589 (diff) | |
download | libADLMIDI-adcf702a7e18846ad4f8753ec5a32cf56585ca23.tar.gz libADLMIDI-adcf702a7e18846ad4f8753ec5a32cf56585ca23.tar.bz2 libADLMIDI-adcf702a7e18846ad4f8753ec5a32cf56585ca23.zip |
Bugfixes
- Fixed all MSVC 2015/2017 warnings in both 32 and 64 bit builds
- Fixed weird behavior when using adl_setHVibrato, adl_setHTremolo, adl_setScaleModulators, and adl_setVolumeRangeModel when passing the -1 "Auto" state
- Move arpeggio counter into the MIDIPlay class as originally it was a global static variable which is ugly and danger when running multiple instances of the same library
Diffstat (limited to 'src/adlmidi_private.hpp')
-rw-r--r-- | src/adlmidi_private.hpp | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/src/adlmidi_private.hpp b/src/adlmidi_private.hpp index 63b4854..0584587 100644 --- a/src/adlmidi_private.hpp +++ b/src/adlmidi_private.hpp @@ -131,13 +131,6 @@ typedef int32_t ssize_t; #define INT32_MAX 0x7fffffff #endif -#ifdef _MSC_VER -#pragma warning(disable:4319) -#pragma warning(disable:4267) -#pragma warning(disable:4244) -#pragma warning(disable:4146) -#endif - #include "fraction.hpp" #ifndef ADLMIDI_HW_OPL #include "chips/opl_chip_base.h" @@ -167,12 +160,14 @@ inline Real adl_cvtReal(int32_t x) { return x * ((Real)1 / INT16_MAX); } + inline int32_t adl_cvtS16(int32_t x) { - x = (x < INT16_MIN) ? INT16_MIN : x; - x = (x > INT16_MAX) ? INT16_MAX : x; + x = (x < INT16_MIN) ? (INT16_MIN) : x; + x = (x > INT16_MAX) ? (INT16_MAX) : x; return x; } + inline int32_t adl_cvtS8(int32_t x) { return adl_cvtS16(x) / 256; @@ -485,7 +480,7 @@ public: bool eof() { if(fp) - return std::feof(fp); + return (std::feof(fp) != 0); else return mp_tell >= mp_size; } @@ -592,9 +587,9 @@ public: } void phys_erase_at(const Phys *ph) { - unsigned pos = ph - chip_channels; - assert(pos < chip_channels_count); - for(unsigned i = pos + 1; i < chip_channels_count; ++i) + intptr_t pos = ph - chip_channels; + assert(pos < static_cast<intptr_t>(chip_channels_count)); + for(intptr_t i = pos + 1; i < static_cast<intptr_t>(chip_channels_count); ++i) chip_channels[i - 1] = chip_channels[i]; --chip_channels_count; } @@ -976,6 +971,8 @@ private: char ____padding[7]; std::vector<AdlChannel> ch; + //! Counter of arpeggio processing + size_t m_arpeggioCounter; #ifndef ADLMIDI_DISABLE_MIDI_SEQUENCER std::vector<std::vector<uint8_t> > TrackData; @@ -1199,7 +1196,7 @@ private: // Determine how good a candidate this adlchannel // would be for playing a note from this instrument. - int64_t CalculateAdlChannelGoodness(unsigned c, const MIDIchannel::NoteInfo::Phys &ins, uint16_t /*MidCh*/) const; + int64_t CalculateAdlChannelGoodness(size_t c, const MIDIchannel::NoteInfo::Phys &ins, uint16_t /*MidCh*/) const; // A new note will be played on this channel using this instrument. // Kill existing notes on this channel (or don't, if we do arpeggio) |