907{
908 wxStringOutputStream o;
909 wxTextOutputStream s(o, wxEOL_UNIX);
910
912 return XO(
"Stream is active ... unable to gather information.\n")
913 .Translation();
914 }
915
916
917
918 int recDeviceNum = Pm_GetDefaultInputDeviceID();
919 int playDeviceNum = Pm_GetDefaultOutputDeviceID();
920 int cnt = Pm_CountDevices();
921
922
923 wxLogDebug(
wxT(
"PortMidi reports %d MIDI devices"), cnt);
924
925 s <<
wxT(
"==============================\n");
926 s <<
XO(
"Default recording device number: %d\n").Format( recDeviceNum );
927 s <<
XO(
"Default playback device number: %d\n").Format( playDeviceNum );
928
931
932
933 if (cnt <= 0) {
934 s <<
XO(
"No devices found\n");
935 return o.GetString();
936 }
937
938 for (int i = 0; i < cnt; i++) {
939 s <<
wxT(
"==============================\n");
940
941 const PmDeviceInfo* info = Pm_GetDeviceInfo(i);
942 if (!info) {
943 s <<
XO(
"Device info unavailable for: %d\n").Format( i );
944 continue;
945 }
946
947 wxString
name = wxSafeConvertMB2WX(info->name);
948 wxString hostName = wxSafeConvertMB2WX(info->interf);
949
950 s <<
XO(
"Device ID: %d\n").Format( i );
951 s <<
XO(
"Device name: %s\n").Format(
name );
952 s <<
XO(
"Host name: %s\n").Format( hostName );
953
954 s <<
XO(
"Supports output: %d\n").Format( info->output );
955
956 s <<
XO(
"Supports input: %d\n").Format( info->input );
957 s <<
XO(
"Opened: %d\n").Format( info->opened );
958
959 if (
name == playDevice && info->output)
960 playDeviceNum = i;
961
962 if (
name == recDevice && info->input)
963 recDeviceNum = i;
964
965
966
967 if (recDeviceNum < 0 && info->input){
968 recDeviceNum = i;
969 }
970 if (playDeviceNum < 0 && info->output){
971 playDeviceNum = i;
972 }
973 }
974
975 bool haveRecDevice = (recDeviceNum >= 0);
976 bool havePlayDevice = (playDeviceNum >= 0);
977
978 s <<
wxT(
"==============================\n");
979 if (haveRecDevice)
980 s <<
XO(
"Selected MIDI recording device: %d - %s\n").Format( recDeviceNum, recDevice );
981 else
982 s <<
XO(
"No MIDI recording device found for '%s'.\n").Format( recDevice );
983
984 if (havePlayDevice)
985 s <<
XO(
"Selected MIDI playback device: %d - %s\n").Format( playDeviceNum, playDevice );
986 else
987 s <<
XO(
"No MIDI playback device found for '%s'.\n").Format( playDevice );
988
989
990#ifdef IS_ALPHA
991
992
993 s <<
wxT(
"==============================\n");
994#ifdef EXPERIMENTAL_MIDI_OUT
995 s <<
wxT(
"EXPERIMENTAL_MIDI_OUT is enabled\n");
996#else
997 s <<
wxT(
"EXPERIMENTAL_MIDI_OUT is NOT enabled\n");
998#endif
999#ifdef EXPERIMENTAL_MIDI_IN
1000 s <<
wxT(
"EXPERIMENTAL_MIDI_IN is enabled\n");
1001#else
1002 s <<
wxT(
"EXPERIMENTAL_MIDI_IN is NOT enabled\n");
1003#endif
1004
1005#endif
1006
1007 return o.GetString();
1008}
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 */