1181{
1182 wxStringOutputStream o;
1183 wxTextOutputStream s(o, wxEOL_UNIX);
1184
1186 return XO(
"Stream is active ... unable to gather information.\n")
1187 .Translation();
1188 }
1189
1190
1191
1192 int recDeviceNum = Pm_GetDefaultInputDeviceID();
1193 int playDeviceNum = Pm_GetDefaultOutputDeviceID();
1194 int cnt = Pm_CountDevices();
1195
1196
1197 wxLogDebug(
wxT(
"PortMidi reports %d MIDI devices"), cnt);
1198
1199 s <<
wxT(
"==============================\n");
1200 s <<
XO(
"Default recording device number: %d\n").Format( recDeviceNum );
1201 s <<
XO(
"Default playback device number: %d\n").Format( playDeviceNum );
1202
1205
1206
1207 if (cnt <= 0) {
1208 s <<
XO(
"No devices found\n");
1209 return o.GetString();
1210 }
1211
1212 for (int i = 0; i < cnt; i++) {
1213 s <<
wxT(
"==============================\n");
1214
1215 const PmDeviceInfo* info = Pm_GetDeviceInfo(i);
1216 if (!info) {
1217 s <<
XO(
"Device info unavailable for: %d\n").Format( i );
1218 continue;
1219 }
1220
1221 wxString
name = wxSafeConvertMB2WX(info->name);
1222 wxString hostName = wxSafeConvertMB2WX(info->interf);
1223
1224 s <<
XO(
"Device ID: %d\n").Format( i );
1225 s <<
XO(
"Device name: %s\n").Format(
name );
1226 s <<
XO(
"Host name: %s\n").Format( hostName );
1227
1228 s <<
XO(
"Supports output: %d\n").Format( info->output );
1229
1230 s <<
XO(
"Supports input: %d\n").Format( info->input );
1231 s <<
XO(
"Opened: %d\n").Format( info->opened );
1232
1233 if (
name == playDevice && info->output)
1234 playDeviceNum = i;
1235
1236 if (
name == recDevice && info->input)
1237 recDeviceNum = i;
1238
1239
1240
1241 if (recDeviceNum < 0 && info->input){
1242 recDeviceNum = i;
1243 }
1244 if (playDeviceNum < 0 && info->output){
1245 playDeviceNum = i;
1246 }
1247 }
1248
1249 bool haveRecDevice = (recDeviceNum >= 0);
1250 bool havePlayDevice = (playDeviceNum >= 0);
1251
1252 s <<
wxT(
"==============================\n");
1253 if (haveRecDevice)
1254 s <<
XO(
"Selected MIDI recording device: %d - %s\n").Format( recDeviceNum, recDevice );
1255 else
1256 s <<
XO(
"No MIDI recording device found for '%s'.\n").Format( recDevice );
1257
1258 if (havePlayDevice)
1259 s <<
XO(
"Selected MIDI playback device: %d - %s\n").Format( playDeviceNum, playDevice );
1260 else
1261 s <<
XO(
"No MIDI playback device found for '%s'.\n").Format( playDevice );
1262
1263
1264#ifdef IS_ALPHA
1265
1266
1267 s <<
wxT(
"==============================\n");
1268#ifdef EXPERIMENTAL_MIDI_OUT
1269 s <<
wxT(
"EXPERIMENTAL_MIDI_OUT is enabled\n");
1270#else
1271 s <<
wxT(
"EXPERIMENTAL_MIDI_OUT is NOT enabled\n");
1272#endif
1273#ifdef EXPERIMENTAL_MIDI_IN
1274 s <<
wxT(
"EXPERIMENTAL_MIDI_IN is enabled\n");
1275#else
1276 s <<
wxT(
"EXPERIMENTAL_MIDI_IN is NOT enabled\n");
1277#endif
1278
1279#endif
1280
1281 return o.GetString();
1282}
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 */