Changeset 188 for smplayer/trunk/src/deviceinfo.cpp
- Timestamp:
- Jan 24, 2017, 12:41:54 PM (9 years ago)
- Location:
- smplayer/trunk
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
src/deviceinfo.cpp (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
smplayer/trunk
- Property svn:mergeinfo changed
/smplayer/vendor/current merged: 186
- Property svn:mergeinfo changed
-
smplayer/trunk/src/deviceinfo.cpp
r181 r188 1 1 /* smplayer, GUI front-end for mplayer. 2 Copyright (C) 2006-201 6Ricardo Villalba <[email protected]>2 Copyright (C) 2006-201 Ricardo Villalba <[email protected]> 3 3 4 4 This program is free software; you can redistribute it and/or modify … … 22 22 #include <QFile> 23 23 #include <QSettings> 24 24 25 25 26 #ifdef Q_OS_WIN 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 26 93 27 94 DeviceList DeviceInfo::retrieveDevices(DeviceType type) { … … 71 138 return l; 72 139 } 140 73 141 74 142 DeviceList DeviceInfo::dsoundDevices() { … … 82 150 #else 83 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 84 200 DeviceList DeviceInfo::alsaDevices() { 85 201 qDebug("DeviceInfo::alsaDevices"); … … 127 243 return l; 128 244 } 129 245 #endif 246 247 #ifdef USE_XV_ADAPTORS 130 248 DeviceList DeviceInfo::xvAdaptors() { 131 249 qDebug("DeviceInfo::xvAdaptors"); … … 171 289 return l; 172 290 } 173 291 #endif 292 #endif 293 294 #if MPV_AUDIO_DEVICES 295 QString DeviceInfo::mpv_bin; 296 297 #if USE_MPV_ALSA_DEVICES 298 DeviceList DeviceInfo::mpvAlsaDevices() { 299 static DeviceList l; 300 if (!l.isEmpty()) return l; 301 l = mpvAudioDevices("alsa"); 302 return l; 303 } 304 #endif 305 306 #if USE_MPV_WASAPI_DEVICES 307 DeviceList DeviceInfo::mpvWasapiDevices() { 308 static DeviceList l; 309 if (!l.isEmpty()) return l; 310 l = mpvAudioDevices("wasapi"); 311 return l; 312 } 313 #endif 314 315 DeviceList DeviceInfo::mpvAudioDevices(const QString & filter) { 316 DeviceList l; 317 if (!mpv_bin.isEmpty()) l = mpvAudioDevices(mpv_bin, filter); 318 return l; 319 } 320 321 DeviceList DeviceInfo::mpvAudioDevices(const QString & mpv_bin, const QString & filter) { 322 qDebug("DeviceInfo::mpvAudioDevices"); 323 324 DeviceList l; 325 326 QRegExp rx("'" + filter + "\\/(.*)'\\s+\\((.*)\\)"); 327 328 QProcess p; 329 p.setProcessChannelMode( QProcess::MergedChannels ); 330 331 p.start(mpv_bin, QStringList() << "--audio-device=help"); 332 333 QString device; 334 QString name; 335 //int index = 0; 336 337 if (p.waitForFinished()) { 338 QString line; 339 while (p.canReadLine()) { 340 line = QString::fromUtf8(p.readLine().trimmed()); 341 qDebug() << "DeviceInfo::mpvAudioDevices:" << line; 342 343 if (rx.indexIn(line) > -1 ) { 344 device = rx.cap(1); 345 name = rx.cap(2); 346 qDebug() << "DeviceInfo::mpvAudioDevices: device:" << device << "name:" << name; 347 l.append( DeviceData(device, name) ); 348 //index++; 349 } 350 } 351 } 352 353 return l; 354 } 174 355 #endif 175 356 … … 201 382 } 202 383 #endif 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404
Note:
See TracChangeset
for help on using the changeset viewer.
