885{
886 wxStringOutputStream o;
887 wxTextOutputStream s(o, wxEOL_UNIX);
888
890 return XO(
"Stream is active ... unable to gather information.\n")
891 .Translation();
892 }
893
894
895
896 int recDeviceNum = Pm_GetDefaultInputDeviceID();
897 int playDeviceNum = Pm_GetDefaultOutputDeviceID();
898 int cnt = Pm_CountDevices();
899
900
901 wxLogDebug(
wxT(
"PortMidi reports %d MIDI devices"), cnt);
902
903 s <<
wxT(
"==============================\n");
904 s <<
XO(
"Default recording device number: %d\n").Format( recDeviceNum );
905 s <<
XO(
"Default playback device number: %d\n").Format( playDeviceNum );
906
909
910
911 if (cnt <= 0) {
912 s <<
XO(
"No devices found\n");
913 return o.GetString();
914 }
915
916 for (int i = 0; i < cnt; i++) {
917 s <<
wxT(
"==============================\n");
918
919 const PmDeviceInfo* info = Pm_GetDeviceInfo(i);
920 if (!info) {
921 s <<
XO(
"Device info unavailable for: %d\n").Format( i );
922 continue;
923 }
924
925 wxString
name = wxSafeConvertMB2WX(info->name);
926 wxString hostName = wxSafeConvertMB2WX(info->interf);
927
928 s <<
XO(
"Device ID: %d\n").Format( i );
929 s <<
XO(
"Device name: %s\n").Format(
name );
930 s <<
XO(
"Host name: %s\n").Format( hostName );
931
932 s <<
XO(
"Supports output: %d\n").Format( info->output );
933
934 s <<
XO(
"Supports input: %d\n").Format( info->input );
935 s <<
XO(
"Opened: %d\n").Format( info->opened );
936
937 if (
name == playDevice && info->output)
938 playDeviceNum = i;
939
940 if (
name == recDevice && info->input)
941 recDeviceNum = i;
942
943
944
945 if (recDeviceNum < 0 && info->input){
946 recDeviceNum = i;
947 }
948 if (playDeviceNum < 0 && info->output){
949 playDeviceNum = i;
950 }
951 }
952
953 bool haveRecDevice = (recDeviceNum >= 0);
954 bool havePlayDevice = (playDeviceNum >= 0);
955
956 s <<
wxT(
"==============================\n");
957 if (haveRecDevice)
958 s <<
XO(
"Selected MIDI recording device: %d - %s\n").Format( recDeviceNum, recDevice );
959 else
960 s <<
XO(
"No MIDI recording device found for '%s'.\n").Format( recDevice );
961
962 if (havePlayDevice)
963 s <<
XO(
"Selected MIDI playback device: %d - %s\n").Format( playDeviceNum, playDevice );
964 else
965 s <<
XO(
"No MIDI playback device found for '%s'.\n").Format( playDevice );
966
967
968#ifdef IS_ALPHA
969
970
971 s <<
wxT(
"==============================\n");
972#ifdef EXPERIMENTAL_MIDI_IN
973 s <<
wxT(
"EXPERIMENTAL_MIDI_IN is enabled\n");
974#else
975 s <<
wxT(
"EXPERIMENTAL_MIDI_IN is NOT enabled\n");
976#endif
977
978#endif
979
980 return o.GetString();
981}
const TranslatableString name
StringSetting MIDIRecordingDevice
StringSetting MIDIPlaybackDevice
static AudioIOBase * Get()
bool Read(T *pVar) const
overload of Read returning a boolean that is true if the value was previously defined */