Skip to content

Commit

Permalink
Add a flag to disable appending Win32 port name identifier
Browse files Browse the repository at this point in the history
Closes #100.
  • Loading branch information
radarsat1 committed Aug 22, 2017
1 parent bb3b8dd commit 26c77d4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions RtMidi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@
#endif
#endif

// Default for Windows is to add an identifier to the port names; this
// flag can be undefined to disable this behaviour.
#define RTMIDI_ENSURE_UNIQUE_PORTNAMES

//*********************************************************************//
// RtMidi Definitions
//*********************************************************************//
Expand Down Expand Up @@ -2216,10 +2220,12 @@ std::string MidiInWinMM :: getPortName( unsigned int portNumber )
// Next lines added to add the portNumber to the name so that
// the device's names are sure to be listed with individual names
// even when they have the same brand name
#ifdef RTMIDI_ENSURE_UNIQUE_PORTNAMES
std::ostringstream os;
os << " ";
os << portNumber;
stringName += os.str();
#endif

return stringName;
}
Expand Down Expand Up @@ -2291,9 +2297,11 @@ std::string MidiOutWinMM :: getPortName( unsigned int portNumber )
// the device's names are sure to be listed with individual names
// even when they have the same brand name
std::ostringstream os;
#ifdef RTMIDI_ENSURE_UNIQUE_PORTNAMES
os << " ";
os << portNumber;
stringName += os.str();
#endif

return stringName;
}
Expand Down

0 comments on commit 26c77d4

Please sign in to comment.