Browse Source

Reverted Windows UNICODE portname fix to previous solution by Wilcox.

Gary Scavone 11 years ago
parent
commit
a4347457ef
3 changed files with 6 additions and 5 deletions
  1. 2 2
      RtMidi.cpp
  2. 0 1
      doc/release.txt
  3. 4 2
      readme

+ 2 - 2
RtMidi.cpp

@@ -2203,7 +2203,7 @@ std::string MidiInWinMM :: getPortName( unsigned int portNumber )
 
 
 #if defined( UNICODE ) || defined( _UNICODE )
 #if defined( UNICODE ) || defined( _UNICODE )
   int length = WideCharToMultiByte(CP_UTF8, 0, deviceCaps.szPname, -1, NULL, 0, NULL, NULL) - 1;
   int length = WideCharToMultiByte(CP_UTF8, 0, deviceCaps.szPname, -1, NULL, 0, NULL, NULL) - 1;
-  stringName.resize( --length );
+  stringName.assign( length, 0 );
   length = WideCharToMultiByte(CP_UTF8, 0, deviceCaps.szPname, static_cast<int>(wcslen(deviceCaps.szPname)), &stringName[0], length, NULL, NULL);
   length = WideCharToMultiByte(CP_UTF8, 0, deviceCaps.szPname, static_cast<int>(wcslen(deviceCaps.szPname)), &stringName[0], length, NULL, NULL);
 #else
 #else
   stringName = std::string( deviceCaps.szPname );
   stringName = std::string( deviceCaps.szPname );
@@ -2277,7 +2277,7 @@ std::string MidiOutWinMM :: getPortName( unsigned int portNumber )
 
 
 #if defined( UNICODE ) || defined( _UNICODE )
 #if defined( UNICODE ) || defined( _UNICODE )
   int length = WideCharToMultiByte(CP_UTF8, 0, deviceCaps.szPname, -1, NULL, 0, NULL, NULL) - 1;
   int length = WideCharToMultiByte(CP_UTF8, 0, deviceCaps.szPname, -1, NULL, 0, NULL, NULL) - 1;
-  stringName.resize( --length );
+  stringName.assign( length, 0 );
   length = WideCharToMultiByte(CP_UTF8, 0, deviceCaps.szPname, static_cast<int>(wcslen(deviceCaps.szPname)), &stringName[0], length, NULL, NULL);
   length = WideCharToMultiByte(CP_UTF8, 0, deviceCaps.szPname, static_cast<int>(wcslen(deviceCaps.szPname)), &stringName[0], length, NULL, NULL);
 #else
 #else
   stringName = std::string( deviceCaps.szPname );
   stringName = std::string( deviceCaps.szPname );

+ 0 - 1
doc/release.txt

@@ -11,7 +11,6 @@ v2.1.0: (?? 2014)
 - fix for international character support in CoreMidi (Martin Finke)
 - fix for international character support in CoreMidi (Martin Finke)
 - fix for unicode conversion in WinMM (Dan Wilcox)
 - fix for unicode conversion in WinMM (Dan Wilcox)
 - added custom error hook that allows the client to capture an RtMidi error outside of the RtMidi code
 - added custom error hook that allows the client to capture an RtMidi error outside of the RtMidi code
-- fix for portnames in Windows when UNICODE is defined
 - added RtMidi::isPortOpen function
 - added RtMidi::isPortOpen function
 - updated OS-X sysex sending mechanism (ptarabbia)
 - updated OS-X sysex sending mechanism (ptarabbia)
 - Windows update to avoid lockups when shutting down while sending/receiving sysex messages (ptarabbia)
 - Windows update to avoid lockups when shutting down while sending/receiving sysex messages (ptarabbia)

+ 4 - 2
readme

@@ -1,6 +1,6 @@
 RtMidi - a set of C++ classes that provide a common API for realtime MIDI input/output across Linux (ALSA & Jack), Macintosh OS X (CoreMidi) and Windows (Multimedia & Kernel Streaming).
 RtMidi - a set of C++ classes that provide a common API for realtime MIDI input/output across Linux (ALSA & Jack), Macintosh OS X (CoreMidi) and Windows (Multimedia & Kernel Streaming).
 
 
-By Gary P. Scavone, 2003-2012.
+By Gary P. Scavone, 2003-2014.
 
 
 This distribution of RtMidi contains the following:
 This distribution of RtMidi contains the following:
 
 
@@ -9,6 +9,8 @@ tests:    example RtMidi programs
 
 
 On unix systems, type "./configure" in the top level directory, then "make" in the tests/ directory to compile the test programs.  In Windows, open the Visual C++ workspace file located in the tests/ directory.
 On unix systems, type "./configure" in the top level directory, then "make" in the tests/ directory to compile the test programs.  In Windows, open the Visual C++ workspace file located in the tests/ directory.
 
 
+If you checked out the code from git, please run "autoconf" before "./configure".
+
 OVERVIEW:
 OVERVIEW:
 
 
 RtMidi is a set of C++ classes (RtMidiIn, RtMidiOut, and API specific classes) that provide a common API (Application Programming Interface) for realtime MIDI input/output across Linux (ALSA, Jack), Macintosh OS X (CoreMidi, Jack), SGI, and Windows (Multimedia Library, Kernel Streming) operating systems.  RtMidi significantly simplifies the process of interacting with computer MIDI hardware and software.  It was designed with the following goals:
 RtMidi is a set of C++ classes (RtMidiIn, RtMidiOut, and API specific classes) that provide a common API (Application Programming Interface) for realtime MIDI input/output across Linux (ALSA, Jack), Macintosh OS X (CoreMidi, Jack), SGI, and Windows (Multimedia Library, Kernel Streming) operating systems.  RtMidi significantly simplifies the process of interacting with computer MIDI hardware and software.  It was designed with the following goals:
@@ -30,7 +32,7 @@ LEGAL AND ETHICAL:
 The RtMidi license is similar to the the MIT License, with the added "feature" that modifications be sent to the developer.
 The RtMidi license is similar to the the MIT License, with the added "feature" that modifications be sent to the developer.
 
 
     RtMidi: realtime MIDI i/o C++ classes
     RtMidi: realtime MIDI i/o C++ classes
-    Copyright (c) 2003-2012 Gary P. Scavone
+    Copyright (c) 2003-2014 Gary P. Scavone
 
 
     Permission is hereby granted, free of charge, to any person
     Permission is hereby granted, free of charge, to any person
     obtaining a copy of this software and associated documentation files
     obtaining a copy of this software and associated documentation files