Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V.3.0.0rc #98

Merged
merged 68 commits into from
Dec 30, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
e12eb30
debug text update (very minor update)
lathoub Dec 21, 2020
28a84a7
debug update
lathoub Dec 21, 2020
9d47f31
deprecate Error callback, replace with Exception callback
lathoub Dec 21, 2020
1db81ad
removed error callback, replace with Exception
lathoub Dec 21, 2020
4e5cba4
NULL => nullptr
lathoub Dec 21, 2020
a7917d1
Update library.properties
lathoub Dec 21, 2020
80624d7
Update ESP32_Callbacks.ino
lathoub Dec 21, 2020
38a07cb
advance callbacks, added sendRtp
lathoub Dec 21, 2020
4120625
extented callbacks now optional to save weight
lathoub Dec 22, 2020
7bf2d0d
minimum memory usage example
lathoub Dec 22, 2020
397eab2
renamed EthernetShield to AVR for AVR type Arduino's
lathoub Dec 22, 2020
e29094d
min memory setup, #defines for add functions
lathoub Dec 22, 2020
a874521
Update README.md
lathoub Dec 22, 2020
2777a99
Update README.md
lathoub Dec 23, 2020
cd5a8fd
Update README.md
lathoub Dec 23, 2020
d835296
further weight reduction #define ONE_PARTICIPANT
lathoub Dec 23, 2020
2c6b047
Merge branch 'v.3.0.0rc' of https://github.com/lathoub/Arduino-AppleM…
lathoub Dec 23, 2020
cf1ba1a
Update README.md
lathoub Dec 23, 2020
f425163
furtner memory reduction
lathoub Dec 23, 2020
2824421
Merge branch 'v.3.0.0rc' of https://github.com/lathoub/Arduino-AppleM…
lathoub Dec 23, 2020
952c31d
Update README.md
lathoub Dec 23, 2020
8654ca3
Update README.md
lathoub Dec 23, 2020
8a138d1
Update README.md
lathoub Dec 23, 2020
777a698
Update AVR_NoteOnOffEverySec.ino
lathoub Dec 23, 2020
3d98cf9
Merge branch 'v.3.0.0rc' of https://github.com/lathoub/Arduino-AppleM…
lathoub Dec 23, 2020
df64cae
added Directory
lathoub Dec 24, 2020
b4a0b24
joined USE_EXT_CALLBACKS, LATENCY_CALCULATION
lathoub Dec 24, 2020
68c9082
Update AppleMIDI.h
lathoub Dec 24, 2020
88850b3
fixed crash when session name is too long (> MaxSessionName)
lathoub Dec 28, 2020
095e6d4
Create ESP32_NoteOnOffEverySec.ino
lathoub Dec 28, 2020
2f6d510
get* as const functions
lathoub Dec 28, 2020
613b767
Update README.md
lathoub Dec 28, 2020
4526bfb
Update AppleMIDI.h
lathoub Dec 28, 2020
d69f41d
Merge branch 'v.3.0.0rc' of https://github.com/lathoub/Arduino-AppleM…
lathoub Dec 28, 2020
9303945
removed extented callback from wESP32 demo
lathoub Dec 28, 2020
49e5121
added sentRtpMidiCallback, renamed send -> sent
lathoub Dec 28, 2020
2467d2d
added ssrc to ReceiveMidi calls (private functions)
lathoub Dec 28, 2020
5e3678d
receiverFeedback test is < not !=
lathoub Dec 29, 2020
ce7e8a7
receivedRtpCallback with ssrc, disconnect with ssrc
lathoub Dec 29, 2020
296717c
Update .travis.yml
lathoub Dec 29, 2020
8117dd3
Update README.md
lathoub Dec 29, 2020
9294a50
Update README.md
lathoub Dec 29, 2020
299004c
Update .travis.yml
lathoub Dec 29, 2020
2739ce6
Update .travis.yml
lathoub Dec 29, 2020
3c95ee1
Update .travis.yml
lathoub Dec 29, 2020
4f7f9ab
Update .travis.yml
lathoub Dec 29, 2020
5aa8c69
update examples
lathoub Dec 29, 2020
9f08a63
Merge branch 'v.3.0.0rc' of https://github.com/lathoub/Arduino-AppleM…
lathoub Dec 29, 2020
9c6d4c3
Update .travis.yml
lathoub Dec 29, 2020
33be4a4
fixing examples
lathoub Dec 29, 2020
ba3a300
Merge branch 'v.3.0.0rc' of https://github.com/lathoub/Arduino-AppleM…
lathoub Dec 29, 2020
8936cd7
Update .travis.yml
lathoub Dec 29, 2020
08366e5
Update .travis.yml
lathoub Dec 29, 2020
ca50b41
Update .travis.yml
lathoub Dec 29, 2020
e069ffb
Update .travis.yml
lathoub Dec 29, 2020
0fc91fd
Update .travis.yml
lathoub Dec 29, 2020
122f778
Create AVR_E3_NoteOnOffEverySec.ino
lathoub Dec 29, 2020
4e6f680
Merge branch 'v.3.0.0rc' of https://github.com/lathoub/Arduino-AppleM…
lathoub Dec 29, 2020
c0a99a5
Update .travis.yml
lathoub Dec 30, 2020
09f5f16
Update wESP32_NoteOnOffEverySec.ino
lathoub Dec 30, 2020
608ddd1
Merge branch 'v.3.0.0rc' of https://github.com/lathoub/Arduino-AppleM…
lathoub Dec 30, 2020
79cbccf
Update .travis.yml
lathoub Dec 30, 2020
ebf3cb5
Update README.md
lathoub Dec 30, 2020
2bb78db
Update README.md
lathoub Dec 30, 2020
c9a3e81
Update README.md
lathoub Dec 30, 2020
24e92b8
Update README.md
lathoub Dec 30, 2020
299286b
Update README.md
lathoub Dec 30, 2020
4dd5446
Update README.md
lathoub Dec 30, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
NULL => nullptr
  • Loading branch information
lathoub committed Dec 21, 2020
commit 4e5cba45f16704e3d19cf9cb01d36622c4f9dc5b
2 changes: 1 addition & 1 deletion src/AppleMIDI.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ class AppleMIDISession
}
else
{
if (NULL != _exceptionCallback)
if (nullptr != _exceptionCallback)
_exceptionCallback(ssrc, BufferFullException, 0);
}
}
Expand Down
56 changes: 28 additions & 28 deletions src/AppleMIDI.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ void AppleMIDISession<UdpClass, Settings, Platform>::parseControlPackets()
auto retVal = _appleMIDIParser.parse(controlBuffer, amPortType::Control);
if (retVal == parserReturn::UnexpectedData)
{
if (NULL != _exceptionCallback)
if (nullptr != _exceptionCallback)
_exceptionCallback(ssrc, ParseException, 0);

controlBuffer.pop_front();
Expand Down Expand Up @@ -81,7 +81,7 @@ void AppleMIDISession<UdpClass, Settings, Platform>::parseDataPackets()
|| retVal2 == parserReturn::NotSureGiveMeMoreData)
break; // one or the other buffer does not have enough data

if (NULL != _exceptionCallback)
if (nullptr != _exceptionCallback)
_exceptionCallback(ssrc, UnexpectedParseException, 0);

dataBuffer.pop_front();
Expand All @@ -101,7 +101,7 @@ template <class UdpClass, class Settings, class Platform>
void AppleMIDISession<UdpClass, Settings, Platform>::ReceivedControlInvitation(AppleMIDI_Invitation_t &invitation)
{
// ignore invitation of a participant already in the participant list
if (NULL != getParticipantBySSRC(invitation.ssrc))
if (nullptr != getParticipantBySSRC(invitation.ssrc))
return;

// advertise our own session name
Expand All @@ -114,7 +114,7 @@ void AppleMIDISession<UdpClass, Settings, Platform>::ReceivedControlInvitation(A
{
writeInvitation(controlPort, controlPort.remoteIP(), controlPort.remotePort(), invitation, amInvitationRejected);

if (NULL != _exceptionCallback)
if (nullptr != _exceptionCallback)
_exceptionCallback(ssrc, TooManyParticipantsException, 0);

return;
Expand All @@ -139,11 +139,11 @@ template <class UdpClass, class Settings, class Platform>
void AppleMIDISession<UdpClass, Settings, Platform>::ReceivedDataInvitation(AppleMIDI_Invitation &invitation)
{
auto participant = getParticipantBySSRC(invitation.ssrc);
if (NULL == participant)
if (nullptr == participant)
{
writeInvitation(dataPort, dataPort.remoteIP(), dataPort.remotePort(), invitation, amInvitationRejected);

if (NULL != _exceptionCallback)
if (nullptr != _exceptionCallback)
_exceptionCallback(ssrc, ParticipantNotFoundException, invitation.ssrc);

return;
Expand All @@ -159,11 +159,11 @@ void AppleMIDISession<UdpClass, Settings, Platform>::ReceivedDataInvitation(Appl
participant->kind = Listener;

// Inform that we have an established connection
if (NULL != _connectedCallback)
if (nullptr != _connectedCallback)
#ifdef KEEP_SESSION_NAME
_connectedCallback(ssrc_, invitation.sessionName);
#else
_connectedCallback(ssrc_, NULL);
_connectedCallback(ssrc_, nullptr);
#endif
}

Expand All @@ -185,7 +185,7 @@ template <class UdpClass, class Settings, class Platform>
void AppleMIDISession<UdpClass, Settings, Platform>::ReceivedControlInvitationAccepted(AppleMIDI_InvitationAccepted_t &invitationAccepted)
{
auto participant = this->getParticipantByInitiatorToken(invitationAccepted.initiatorToken);
if (NULL == participant)
if (nullptr == participant)
{
return;
}
Expand All @@ -204,7 +204,7 @@ template <class UdpClass, class Settings, class Platform>
void AppleMIDISession<UdpClass, Settings, Platform>::ReceivedDataInvitationAccepted(AppleMIDI_InvitationAccepted_t &invitationAccepted)
{
auto participant = this->getParticipantByInitiatorToken(invitationAccepted.initiatorToken);
if (NULL == participant)
if (nullptr == participant)
{
return;
}
Expand Down Expand Up @@ -257,7 +257,7 @@ template <class UdpClass, class Settings, class Platform>
void AppleMIDISession<UdpClass, Settings, Platform>::ReceivedSynchronization(AppleMIDI_Synchronization_t &synchronization)
{
auto participant = getParticipantBySSRC(synchronization.ssrc);
if (NULL == participant)
if (nullptr == participant)
{
return;
}
Expand Down Expand Up @@ -348,12 +348,12 @@ void AppleMIDISession<UdpClass, Settings, Platform>::ReceivedReceiverFeedback(Ap
// Here is where you would correct if packets are dropped (send them again)

auto participant = getParticipantBySSRC(receiverFeedback.ssrc);
if (NULL != participant) {
if (nullptr != participant) {
if (participant->sendSequenceNr != receiverFeedback.sequenceNr)
{
Serial.print("ERRORRORORORORORORRROROROROROROR");

if (NULL != _exceptionCallback)
if (nullptr != _exceptionCallback)
_exceptionCallback(ssrc, SendPacketsDropped, participant->sendSequenceNr - receiverFeedback.sequenceNr);

Serial.print(participant->sendSequenceNr);
Expand All @@ -374,7 +374,7 @@ void AppleMIDISession<UdpClass, Settings, Platform>::ReceivedEndSession(AppleMID

participants.erase(i);

if (NULL != _disconnectedCallback)
if (nullptr != _disconnectedCallback)
_disconnectedCallback(ssrc);

return;
Expand All @@ -388,7 +388,7 @@ Participant<Settings>* AppleMIDISession<UdpClass, Settings, Platform>::getPartic
for (size_t i = 0; i < participants.size(); i++)
if (ssrc == participants[i].ssrc)
return &participants[i];
return NULL;
return nullptr;
}

template <class UdpClass, class Settings, class Platform>
Expand All @@ -397,7 +397,7 @@ Participant<Settings>* AppleMIDISession<UdpClass, Settings, Platform>::getPartic
for (auto i = 0; i < participants.size(); i++)
if (initiatorToken == participants[i].initiatorToken)
return &participants[i];
return NULL;
return nullptr;
}

template <class UdpClass, class Settings, class Platform>
Expand Down Expand Up @@ -601,7 +601,7 @@ void AppleMIDISession<UdpClass, Settings, Platform>::manageSynchronizationListen
// otherwise the responder may assume that the initiator has died and terminate the session.
if (now - participant->lastSyncExchangeTime > Settings::CK_MaxTimeOut)
{
if (NULL != _exceptionCallback)
if (nullptr != _exceptionCallback)
_exceptionCallback(ssrc, ListenerTimeOutException, 0);

sendEndSession(participant);
Expand Down Expand Up @@ -667,7 +667,7 @@ void AppleMIDISession<UdpClass, Settings, Platform>::manageSynchronizationInitia
{
if (participant->synchronizationCount > DefaultSettings::MaxSynchronizationCK0Attempts)
{
if (NULL != _exceptionCallback)
if (nullptr != _exceptionCallback)
_exceptionCallback(ssrc, MaxAttemptsException, 0);

// After too many attempts, stop.
Expand Down Expand Up @@ -709,11 +709,11 @@ void AppleMIDISession<UdpClass, Settings, Platform>::manageSessionInvites()
if (participant->invitationStatus == DataInvitationAccepted)
{
// Inform that we have an established connection
if (NULL != _connectedCallback)
if (nullptr != _connectedCallback)
#ifdef KEEP_SESSION_NAME
_connectedCallback(participant->ssrc, participant->sessionName);
#else
_connectedCallback(participant->ssrc, NULL);
_connectedCallback(participant->ssrc, nullptr);
#endif
participant->invitationStatus = Connected;
}
Expand All @@ -726,7 +726,7 @@ void AppleMIDISession<UdpClass, Settings, Platform>::manageSessionInvites()
{
if (participant->connectionAttempts >= DefaultSettings::MaxSessionInvitesAttempts)
{
if (NULL != _exceptionCallback)
if (nullptr != _exceptionCallback)
_exceptionCallback(ssrc, NoResponseFromConnectionRequestException, 0);

// After too many attempts, stop.
Expand Down Expand Up @@ -840,7 +840,7 @@ void AppleMIDISession<UdpClass, Settings, Platform>::sendEndSession(Participant<
endSession.ssrc = this->ssrc;
writeEndSession(participant->remoteIP, participant->remotePort, endSession);

if (NULL != _disconnectedCallback)
if (nullptr != _disconnectedCallback)
_disconnectedCallback(participant->ssrc);
}

Expand All @@ -849,7 +849,7 @@ void AppleMIDISession<UdpClass, Settings, Platform>::ReceivedRtp(const Rtp_t& rt
{
auto participant = getParticipantBySSRC(rtp.ssrc);

if (NULL != participant)
if (nullptr != participant)
{
if (participant->doReceiverFeedback == false)
participant->receiverFeedbackStartTime = now;
Expand All @@ -864,7 +864,7 @@ void AppleMIDISession<UdpClass, Settings, Platform>::ReceivedRtp(const Rtp_t& rt

if (participant->receiveSequenceNr + 1 != rtp.sequenceNr) {

if (NULL != _exceptionCallback)
if (nullptr != _exceptionCallback)
_exceptionCallback(ssrc, ReceivedPacketsDropped, participant->receiveSequenceNr + 1 - rtp.sequenceNr);

Serial.print("___ERROR____");
Expand All @@ -875,7 +875,7 @@ void AppleMIDISession<UdpClass, Settings, Platform>::ReceivedRtp(const Rtp_t& rt

participant->receiveSequenceNr = rtp.sequenceNr;

if (NULL != _receivedRtpCallback)
if (nullptr != _receivedRtpCallback)
_receivedRtpCallback(0, rtp, latency);
}
else
Expand All @@ -887,14 +887,14 @@ void AppleMIDISession<UdpClass, Settings, Platform>::ReceivedRtp(const Rtp_t& rt
template <class UdpClass, class Settings, class Platform>
void AppleMIDISession<UdpClass, Settings, Platform>::StartReceivedMidi()
{
if (NULL != _startReceivedMidiByteCallback)
if (nullptr != _startReceivedMidiByteCallback)
_startReceivedMidiByteCallback(0);
}

template <class UdpClass, class Settings, class Platform>
void AppleMIDISession<UdpClass, Settings, Platform>::ReceivedMidi(byte value)
{
if (NULL != _receivedMidiByteCallback)
if (nullptr != _receivedMidiByteCallback)
_receivedMidiByteCallback(0, value);

inMidiBuffer.push_back(value);
Expand All @@ -903,7 +903,7 @@ void AppleMIDISession<UdpClass, Settings, Platform>::ReceivedMidi(byte value)
template <class UdpClass, class Settings, class Platform>
void AppleMIDISession<UdpClass, Settings, Platform>::EndReceivedMidi()
{
if (NULL != _endReceivedMidiByteCallback)
if (nullptr != _endReceivedMidiByteCallback)
_endReceivedMidiByteCallback(0);
}

Expand Down
4 changes: 2 additions & 2 deletions test/Arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class _serial
void print(long a, int format = DEC) { std::cout << (format == DEC ? std::dec : std::hex) << a; };
void print(unsigned long a, int format = DEC) { std::cout << (format == DEC ? std::dec : std::hex) << a; };
void print(double a, int = 2) { std::cout << a; };
void print(struct tm * timeinfo, const char * format = NULL) {};
void print(struct tm * timeinfo, const char * format = nullptr) {};
void print(IPAddress) {};

void println(const char a[]) { std::cout << a << "\n"; };
Expand All @@ -30,7 +30,7 @@ class _serial
void println(long a, int format = DEC) { std::cout << (format == DEC ? std::dec : std::hex) << a << "\n"; };
void println(unsigned long a, int format = DEC) { std::cout << (format == DEC ? std::dec : std::hex) << a << "\n"; };
void println(double a, int format = 2) { std::cout << a << "\n"; };
void println(struct tm * timeinfo, const char * format = NULL) {};
void println(struct tm * timeinfo, const char * format = nullptr) {};
void println(IPAddress) {};
void println(void) { std::cout << "\n"; };
};
Expand Down