Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ RtMidi is a set of C++ classes (`RtMidiIn`, `RtMidiOut`, and API specific classe

MIDI input and output functionality are separated into two classes, `RtMidiIn` and `RtMidiOut`. Each class instance supports only a single MIDI connection. RtMidi does not provide timing functionality (i.e., output messages are sent immediately). Input messages are timestamped with delta times in seconds (via a `double` floating point type). MIDI data is passed to the user as raw bytes using an `std::vector<unsigned char>`.

RtMidi is also offered as a module, which is enabled with `RTMIDI_BUILD_MODULES`, and is accessed with `import rt.midi;`. Namespaces are inlined, so classes can be accessed through namespace `rt::midi` or through the global namespace (for example, `rt::midi::MidiApi` and `::MidiApi` are both valid).
RtMidi is also offered as a module, which is enabled with `RTMIDI_BUILD_MODULES`, and is accessed with `import rt.midi;`. Namespaces are implicitly imported (unless disabled with `RTMIDI_USE_NAMESPACE`), so classes can be accessed through namespace `rt::midi` or through the global namespace (for example, `rt::midi::MidiApi` and `::MidiApi` are both valid).

## Windows

Expand Down
6 changes: 1 addition & 5 deletions RtMidi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@
#include "RtMidi.h"
#include <sstream>

inline namespace rt {
inline namespace midi {
using namespace rt::midi;

#if defined(__APPLE__)
#include <TargetConditionals.h>
Expand Down Expand Up @@ -5274,6 +5273,3 @@ void MidiOutAndroid :: sendMessage( const unsigned char *message, size_t size )
}

#endif // __AMIDI__

}
}
8 changes: 5 additions & 3 deletions RtMidi.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,7 @@
#include <string>
#include <vector>

inline namespace rt {
inline namespace midi {
namespace rt::midi {

/************************************************************************/
/*! \class RtMidiError
Expand Down Expand Up @@ -677,6 +676,9 @@ inline void RtMidiOut :: sendMessage( const unsigned char *message, size_t size
inline void RtMidiOut :: setErrorCallback( RtMidiErrorCallback errorCallback, void *userData ) { rtapi_->setErrorCallback(errorCallback, userData); }

}
}

#endif

#ifndef RTMIDI_USE_NAMESPACE
using namespace rt::midi;
#endif
13 changes: 4 additions & 9 deletions modules/RtMidi.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,7 @@ module;

export module rt.midi;

export
#ifdef RTMIDI_USE_NAMESPACE
inline namespace rt {
inline namespace midi {
#else
namespace rt::midi {
#endif
export namespace rt::midi {
using rt::midi::RtMidiError;
using rt::midi::RtMidiErrorCallback;
using rt::midi::RtMidi;
Expand All @@ -20,6 +14,7 @@ namespace rt::midi {
using rt::midi::MidiInApi;
using rt::midi::MidiOutApi;
}
#ifdef RTMIDI_USE_NAMESPACE
}

#ifndef RTMIDI_USE_NAMESPACE
using namespace rt::midi;
#endif
Loading