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