Skip to content

Commit

Permalink
restored qt5.15 compatibility
Browse files Browse the repository at this point in the history
By using quint64 instead if std::uint64_t
  • Loading branch information
pedrolcl committed Aug 25, 2024
1 parent b6e37a1 commit 25b42c5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
5 changes: 2 additions & 3 deletions seqplayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ SequencePlayer::SequencePlayer()
{
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
qRegisterMetaType<std::chrono::milliseconds>();
qRegisterMetaType<std::uint64_t>();
#endif
initChannels();
}
Expand Down Expand Up @@ -280,7 +279,7 @@ void SequencePlayer::playerLoop()
using TimePoint = Clock::time_point;
static const std::type_info &beatId = typeid(BeatEvent);
int currentBar{0};
std::uint64_t echoTicks{0};
quint64 echoTicks{0};
microseconds deltaTime{microseconds::zero()}, echoDelta{m_echoResolution};
TimePoint currentTime{Clock::now()}, nextTime{currentTime}, nextEcho{currentTime},
startTime{currentTime};
Expand Down Expand Up @@ -430,7 +429,7 @@ void SequencePlayer::resetPosition()
}
}

void SequencePlayer::setPosition(uint64_t ticks)
void SequencePlayer::setPosition(quint64 ticks)
{
//qDebug() << Q_FUNC_INFO << pos;
allNotesOff();
Expand Down
9 changes: 4 additions & 5 deletions seqplayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@

#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
Q_DECLARE_METATYPE(std::chrono::milliseconds)
Q_DECLARE_METATYPE(std::uint64_t)
#endif

class SequencePlayer : public QObject
Expand Down Expand Up @@ -56,7 +55,7 @@ class SequencePlayer : public QObject
int getPitchShift();
int getVolumeFactor();
void resetPosition();
void setPosition(std::uint64_t ticks);
void setPosition(quint64 ticks);
void setPitchShift(unsigned int pitch);
void setVolumeFactor(unsigned int vol);
void allNotesOff();
Expand Down Expand Up @@ -90,7 +89,7 @@ public slots:
void songStarted();
void songFinished();
void songStopped();
void songEchoTime(std::chrono::milliseconds millis, std::uint64_t ticks);
void songEchoTime(std::chrono::milliseconds millis, quint64 ticks);
void volumeChanged(int channel, qreal newVolume);
void mutedChanged(int channel, bool);
void lockedChanged(int channel, bool);
Expand Down Expand Up @@ -123,8 +122,8 @@ private slots:

Sequence m_song;
drumstick::rt::MIDIOutput* m_port;
std::uint64_t m_songPositionTicks;
std::uint64_t m_echoResolution;
quint64 m_songPositionTicks;
quint64 m_echoResolution;
bool m_loopEnabled;
int m_loopStart;
int m_loopEnd;
Expand Down

0 comments on commit 25b42c5

Please sign in to comment.