Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bc78c3f3cb | ||
|
|
60b55b6d7d | ||
|
|
d45f8672cd | ||
|
|
8df599ffe5 | ||
|
|
f9c2801db1 | ||
|
|
e5774ffcdc |
@@ -140,9 +140,6 @@ else()
|
||||
set(QT_LIBRARIES Qt5::Core Qt5::Concurrent Qt5::Widgets Qt5::Network Qt5::Sql Qt5::OpenGL Qt5::Xml)
|
||||
endif()
|
||||
|
||||
# Remove GLU and GL from the link line - they're not really required and don't exist on my mingw toolchain
|
||||
list(REMOVE_ITEM QT_LIBRARIES "-lGLU -lGL")
|
||||
|
||||
# Don't try to use webkit if their include directories couldn't be found.
|
||||
if (NOT QT_QTWEBKIT_INCLUDE_DIR)
|
||||
set (QT_USE_QTWEBKIT 0)
|
||||
|
||||
@@ -2,6 +2,11 @@ Strawberry Music Player
|
||||
=======================
|
||||
ChangeLog
|
||||
|
||||
Version 0.1.6:
|
||||
* Fix crash on exit caused by NVIDIA driver
|
||||
* Fix PulseAudio device selection
|
||||
* Improvements to device selection
|
||||
|
||||
Version 0.1.5:
|
||||
* Makefile fixes for building
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
set(STRAWBERRY_VERSION_MAJOR 0)
|
||||
set(STRAWBERRY_VERSION_MINOR 1)
|
||||
set(STRAWBERRY_VERSION_PATCH 5)
|
||||
set(STRAWBERRY_VERSION_PATCH 6)
|
||||
#set(STRAWBERRY_VERSION_PRERELEASE rc1)
|
||||
|
||||
set(INCLUDE_GIT_REVISION OFF)
|
||||
@@ -36,7 +36,7 @@ if(NOT GIT_EXECUTABLE-NOTFOUND)
|
||||
)
|
||||
# Get the latest abbreviated commit hash of the working branch
|
||||
execute_process(
|
||||
COMMAND ${GIT_EXECUTABLE} describe --tags --always
|
||||
COMMAND ${GIT_EXECUTABLE} describe --long --tags --always
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
RESULT_VARIABLE GIT_INFO_RESULT
|
||||
OUTPUT_VARIABLE GIT_REVISION
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#cmakedefine HAVE_GIO
|
||||
#cmakedefine HAVE_DBUS
|
||||
#cmakedefine HAVE_UDISKS2
|
||||
#cmakedefine HAVE_ALSA
|
||||
#cmakedefine HAVE_DEVICEKIT
|
||||
#cmakedefine HAVE_IMOBILEDEVICE
|
||||
#cmakedefine HAVE_LIBARCHIVE
|
||||
|
||||
@@ -43,9 +43,13 @@
|
||||
# include <QDBusArgument>
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_UNIX
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_DARWIN
|
||||
#include <sys/resource.h>
|
||||
#include <sys/sysctl.h>
|
||||
# include <sys/resource.h>
|
||||
# include <sys/sysctl.h>
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_WIN32
|
||||
@@ -62,7 +66,7 @@
|
||||
#include "qtsinglecoreapplication.h"
|
||||
|
||||
#ifdef HAVE_DBUS
|
||||
#include "mpris.h"
|
||||
# include "mpris.h"
|
||||
#endif
|
||||
#include "utilities.h"
|
||||
#include "metatypes.h"
|
||||
@@ -222,5 +226,17 @@ int main(int argc, char* argv[]) {
|
||||
|
||||
int ret = a.exec();
|
||||
|
||||
#ifdef Q_OS_LINUX
|
||||
QFile self_maps("/proc/self/maps");
|
||||
if (self_maps.open(QIODevice::ReadOnly)) {
|
||||
QByteArray data = self_maps.readAll();
|
||||
if (data.contains("libnvidia-tls.so.")) {
|
||||
qLog(Warning) << "Exiting immediately to work around NVIDIA driver bug";
|
||||
_exit(ret);
|
||||
}
|
||||
self_maps.close();
|
||||
}
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -543,7 +543,7 @@ MainWindow::MainWindow(Application *app, SystemTrayIcon *tray_icon, OSD *osd, co
|
||||
// Windows 7 thumbbar buttons
|
||||
thumbbar_->SetActions(QList<QAction*>() << ui_->action_previous_track << ui_->action_play_pause << ui_->action_stop << ui_->action_next_track << nullptr); // spacer
|
||||
|
||||
#if (defined(Q_OS_DARWIN) && defined(HAVE_SPARKLE)) || defined(Q_OS_WIN32)
|
||||
#if (defined(Q_OS_DARWIN) && defined(HAVE_SPARKLE))
|
||||
// Add check for updates item to application menu.
|
||||
QAction *check_updates = ui_->menu_tools->addAction(tr("Check for updates..."));
|
||||
check_updates->setMenuRole(QAction::ApplicationSpecificRole);
|
||||
@@ -896,9 +896,6 @@ void MainWindow::LoadPlaybackStatus() {
|
||||
saved_playback_state_ = static_cast<Engine::State> (settings.value("playback_state", Engine::Empty).toInt());
|
||||
saved_playback_position_ = settings.value("playback_position", 0).toDouble();
|
||||
settings.endGroup();
|
||||
|
||||
qLog(Debug) << "playback_state" << saved_playback_state_;
|
||||
qLog(Debug) << "playback_position" << saved_playback_position_;
|
||||
|
||||
if (saved_playback_state_ == Engine::Empty || saved_playback_state_ == Engine::Idle) {
|
||||
return;
|
||||
|
||||
@@ -42,10 +42,10 @@ QList<DeviceFinder::Device> AlsaDeviceFinder::ListDevices() {
|
||||
|
||||
QList<Device> ret;
|
||||
|
||||
//register int err;
|
||||
int result = -1;
|
||||
int card = -1;
|
||||
int dev = -1;
|
||||
int result = -1;
|
||||
|
||||
snd_ctl_card_info_t *cardinfo;
|
||||
snd_pcm_info_t *pcminfo;
|
||||
snd_ctl_t *handle;
|
||||
@@ -53,29 +53,28 @@ QList<DeviceFinder::Device> AlsaDeviceFinder::ListDevices() {
|
||||
snd_ctl_card_info_alloca(&cardinfo);
|
||||
snd_pcm_info_alloca(&pcminfo);
|
||||
|
||||
card = -1;
|
||||
|
||||
snd_pcm_stream_name(SND_PCM_STREAM_PLAYBACK);
|
||||
|
||||
while (true) {
|
||||
|
||||
result = snd_card_next(&card);
|
||||
if (result < 0) {
|
||||
qLog(Error) << "Unable to get soundcard: " << snd_strerror(result);
|
||||
return ret;
|
||||
qLog(Error) << "Unable to get soundcard:" << snd_strerror(result);
|
||||
break;
|
||||
}
|
||||
if (card < 0) return ret;
|
||||
if (card < 0) break;
|
||||
|
||||
char name[32];
|
||||
sprintf(name, "hw:%d", card);
|
||||
|
||||
result = snd_ctl_open(&handle, name, 0);
|
||||
if (result < 0) {
|
||||
qLog(Error) << "Unable to open soundcard " << card << ": " << snd_strerror(result);
|
||||
qLog(Error) << "Unable to open soundcard" << card << ":" << snd_strerror(result);
|
||||
continue;
|
||||
}
|
||||
result = snd_ctl_card_info(handle, cardinfo);
|
||||
if (result < 0) {
|
||||
qLog(Error) << "Control hardware failure for card " << card << ": " << snd_strerror(result);
|
||||
qLog(Error) << "Control hardware failure for card" << card << ":" << snd_strerror(result);
|
||||
snd_ctl_close(handle);
|
||||
continue;
|
||||
}
|
||||
@@ -85,7 +84,7 @@ QList<DeviceFinder::Device> AlsaDeviceFinder::ListDevices() {
|
||||
|
||||
result = snd_ctl_pcm_next_device(handle, &dev);
|
||||
if (result < 0) {
|
||||
qLog(Error) << "Unable to get PCM for card " << card << ": " << snd_strerror(result);
|
||||
qLog(Error) << "Unable to get PCM for card" << card << ":" << snd_strerror(result);
|
||||
continue;
|
||||
}
|
||||
if (dev < 0) break;
|
||||
@@ -93,14 +92,13 @@ QList<DeviceFinder::Device> AlsaDeviceFinder::ListDevices() {
|
||||
snd_pcm_info_set_device(pcminfo, dev);
|
||||
snd_pcm_info_set_subdevice(pcminfo, 0);
|
||||
snd_pcm_info_set_stream(pcminfo, SND_PCM_STREAM_PLAYBACK);
|
||||
|
||||
result = snd_ctl_pcm_info(handle, pcminfo);
|
||||
if (result < 0) {
|
||||
if (result != -ENOENT) qLog(Error) << "Unable to get control digital audio info for card " << card << ": " << snd_strerror(result);
|
||||
if (result != -ENOENT) qLog(Error) << "Unable to get control digital audio info for card" << card << ":" << snd_strerror(result);
|
||||
continue;
|
||||
}
|
||||
|
||||
snd_pcm_info_get_name(pcminfo);
|
||||
|
||||
Device device;
|
||||
device.description = QString("%1 %2").arg(snd_ctl_card_info_get_name(cardinfo)).arg(snd_pcm_info_get_name(pcminfo));
|
||||
device.value = QString("hw:%1,%2").arg(card).arg(dev);
|
||||
@@ -111,9 +109,6 @@ QList<DeviceFinder::Device> AlsaDeviceFinder::ListDevices() {
|
||||
snd_ctl_close(handle);
|
||||
}
|
||||
|
||||
snd_pcm_info_free(pcminfo); pcminfo = NULL;
|
||||
snd_ctl_card_info_free(cardinfo); cardinfo = NULL;
|
||||
|
||||
snd_config_update_free_global();
|
||||
|
||||
return ret;
|
||||
|
||||
@@ -48,6 +48,9 @@ QString DeviceFinder::GuessIconName(const QString &description) {
|
||||
if (description_lower.contains("headset")) {
|
||||
return "headset";
|
||||
}
|
||||
if (description_lower.contains("pulseaudio")) {
|
||||
return "pulseaudio";
|
||||
}
|
||||
|
||||
return "soundcard";
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
#include "core/logging.h"
|
||||
|
||||
DirectSoundDeviceFinder::DirectSoundDeviceFinder()
|
||||
: DeviceFinder("directsoundsink") {
|
||||
: DeviceFinder("directsound") {
|
||||
}
|
||||
|
||||
QList<DeviceFinder::Device> DirectSoundDeviceFinder::ListDevices() {
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
#include "devicefinder.h"
|
||||
#include "enginedevice.h"
|
||||
|
||||
#ifdef Q_OS_LINUX
|
||||
#ifdef HAVE_ALSA
|
||||
# include "alsadevicefinder.h"
|
||||
#endif
|
||||
|
||||
@@ -57,7 +57,7 @@ void EngineDevice::Init() {
|
||||
|
||||
QList<DeviceFinder*> device_finders;
|
||||
|
||||
#ifdef Q_OS_LINUX
|
||||
#ifdef HAVE_ALSA
|
||||
device_finders.append(new AlsaDeviceFinder);
|
||||
#endif
|
||||
#ifdef HAVE_LIBPULSE
|
||||
@@ -81,4 +81,3 @@ void EngineDevice::Init() {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -67,21 +67,6 @@
|
||||
# include "ext/gstafc/gstafcsrc.h"
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_LINUX
|
||||
# include "alsadevicefinder.h"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LIBPULSE
|
||||
# include "pulsedevicefinder.h"
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_DARWIN
|
||||
# include "osxdevicefinder.h"
|
||||
#endif
|
||||
#ifdef Q_OS_WIN32
|
||||
# include "directsounddevicefinder.h"
|
||||
#endif
|
||||
|
||||
#include "settings/backendsettingspage.h"
|
||||
|
||||
using std::shared_ptr;
|
||||
@@ -89,12 +74,16 @@ using std::vector;
|
||||
|
||||
const char *GstEngine::kAutoSink = "autoaudiosink";
|
||||
const char *GstEngine::kALSASink = "alsasink";
|
||||
const char *GstEngine::kOpenALSASink = "openalsink";
|
||||
const char *GstEngine::kOSSSink = "osssink";
|
||||
const char *GstEngine::kOSS4Sink = "oss4sink";
|
||||
const char *GstEngine::kJackAudioSink = "jackaudiosink";
|
||||
const char *GstEngine::kPulseSink = "pulsesink";
|
||||
const char *GstEngine::kA2DPSink = "a2dpsink";
|
||||
const char *GstEngine::kAVDTPSink = "avdtpsink";
|
||||
const char *GstEngine::InterAudiosink = "interaudiosink";
|
||||
const char *GstEngine::kDirectSoundSink = "directsoundsink";
|
||||
const char *GstEngine::kOSXAudioSink = "osxaudiosink";
|
||||
|
||||
GstEngine::GstEngine(TaskManager *task_manager)
|
||||
: Engine::Base(),
|
||||
@@ -850,12 +839,6 @@ shared_ptr<GstEnginePipeline> GstEngine::CreatePipeline(const QByteArray &url, q
|
||||
|
||||
}
|
||||
|
||||
bool GstEngine::ALSADeviceSupport(const QString &name) {
|
||||
|
||||
return (name == kALSASink || name == kOSSSink || name == kPulseSink);
|
||||
|
||||
}
|
||||
|
||||
void GstEngine::AddBufferConsumer(GstBufferConsumer *consumer) {
|
||||
buffer_consumers_ << consumer;
|
||||
if (current_pipeline_) current_pipeline_->AddBufferConsumer(consumer);
|
||||
@@ -910,3 +893,23 @@ EngineBase::OutputDetailsList GstEngine::GetOutputsList() const {
|
||||
return ret;
|
||||
|
||||
}
|
||||
|
||||
bool GstEngine::ALSADeviceSupport(const QString &name) {
|
||||
return (name == kALSASink);
|
||||
}
|
||||
|
||||
bool GstEngine::PulseDeviceSupport(const QString &name) {
|
||||
return (name == kPulseSink);
|
||||
}
|
||||
|
||||
bool GstEngine::DirectSoundDeviceSupport(const QString &name) {
|
||||
return (name == kDirectSoundSink);
|
||||
}
|
||||
|
||||
bool GstEngine::OSXAudioDeviceSupport(const QString &name) {
|
||||
return (name == kOSXAudioSink);
|
||||
}
|
||||
bool GstEngine::CustomDeviceSupport(const QString &name) {
|
||||
return (name == kALSASink || name == kOpenALSASink || name == kOSSSink || name == kOSS4Sink || name == kA2DPSink || name == kAVDTPSink);
|
||||
}
|
||||
|
||||
|
||||
@@ -66,13 +66,6 @@ class GstEngine : public Engine::Base, public GstBufferConsumer {
|
||||
~GstEngine();
|
||||
|
||||
static const char *kAutoSink;
|
||||
static const char *kALSASink;
|
||||
static const char *kOSSSink;
|
||||
static const char *kOSS4Sink;
|
||||
static const char *kJackAudioSink;
|
||||
static const char *kPulseSink;
|
||||
static const char *kA2DPSink;
|
||||
static const char *kAVDTPSink;
|
||||
|
||||
bool Init();
|
||||
void EnsureInitialised() { initialising_.waitForFinished(); }
|
||||
@@ -86,15 +79,19 @@ class GstEngine : public Engine::Base, public GstBufferConsumer {
|
||||
Engine::State state() const;
|
||||
const Engine::Scope &scope(int chunk_length);
|
||||
|
||||
static bool ALSADeviceSupport(const QString &name);
|
||||
|
||||
GstElement *CreateElement(const QString &factoryName, GstElement *bin = 0, bool fatal = true, bool showerror = true);
|
||||
|
||||
// BufferConsumer
|
||||
void ConsumeBuffer(GstBuffer *buffer, int pipeline_id);
|
||||
|
||||
|
||||
bool IsEqualizerEnabled() { return equalizer_enabled_; }
|
||||
|
||||
static bool ALSADeviceSupport(const QString &name);
|
||||
static bool PulseDeviceSupport(const QString &name);
|
||||
static bool DirectSoundDeviceSupport(const QString &name);
|
||||
static bool OSXAudioDeviceSupport(const QString &name);
|
||||
static bool CustomDeviceSupport(const QString &name);
|
||||
|
||||
public slots:
|
||||
void StartPreloading(const QUrl &url, bool force_stop_at_end, qint64 beginning_nanosec, qint64 end_nanosec);
|
||||
bool Load(const QUrl &, Engine::TrackChangeFlags change, bool force_stop_at_end, quint64 beginning_nanosec, qint64 end_nanosec);
|
||||
@@ -141,6 +138,19 @@ class GstEngine : public Engine::Base, public GstBufferConsumer {
|
||||
void BufferingFinished();
|
||||
|
||||
private:
|
||||
|
||||
static const char *kALSASink;
|
||||
static const char *kOpenALSASink;
|
||||
static const char *kOSSSink;
|
||||
static const char *kOSS4Sink;
|
||||
static const char *kJackAudioSink;
|
||||
static const char *kPulseSink;
|
||||
static const char *kA2DPSink;
|
||||
static const char *kAVDTPSink;
|
||||
static const char *InterAudiosink;
|
||||
static const char *kDirectSoundSink;
|
||||
static const char *kOSXAudioSink;
|
||||
|
||||
PluginDetailsList GetPluginList(const QString &classname) const;
|
||||
|
||||
void StartFadeout();
|
||||
|
||||
@@ -62,7 +62,7 @@ std::unique_ptr<T> GetProperty(const AudioDeviceID& device_id, const AudioObject
|
||||
|
||||
|
||||
OsxDeviceFinder::OsxDeviceFinder()
|
||||
: DeviceFinder("osxaudiosink") {
|
||||
: DeviceFinder("osxaudio") {
|
||||
}
|
||||
|
||||
QList<DeviceFinder::Device> OsxDeviceFinder::ListDevices() {
|
||||
@@ -94,8 +94,7 @@ QList<DeviceFinder::Device> OsxDeviceFinder::ListDevices() {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Determine if the device is an output device (it is an output device if
|
||||
// it has output channels)
|
||||
// Determine if the device is an output device (it is an output device if it has output channels)
|
||||
address.mSelector = kAudioDevicePropertyStreamConfiguration;
|
||||
std::unique_ptr<AudioBufferList> buffer_list = GetProperty<AudioBufferList>(id, address);
|
||||
if (!buffer_list.get() || buffer_list->mNumberBuffers == 0) {
|
||||
|
||||
@@ -123,7 +123,7 @@ void PulseDeviceFinder::GetSinkInfoCallback(pa_context *c, const pa_sink_info *i
|
||||
Device dev;
|
||||
dev.description = QString::fromUtf8(info->description);
|
||||
dev.value = QString::fromUtf8(info->name);
|
||||
dev.iconname = QString::fromUtf8(pa_proplist_gets(info->proplist, "device.iconname"));
|
||||
dev.iconname = GuessIconName(dev.description);
|
||||
|
||||
state->devices.append(dev);
|
||||
}
|
||||
|
||||
@@ -193,7 +193,7 @@ void BackendSettingsPage::Load_Engine(Engine::EngineType enginetype) {
|
||||
|
||||
}
|
||||
|
||||
void BackendSettingsPage::Load_Device(QString output, QVariant device, bool alsa) {
|
||||
void BackendSettingsPage::Load_Device(QString output, QVariant device, bool alsa, bool pulseaudio, bool directsound, bool osxaudio, bool custom) {
|
||||
|
||||
int devices = 0;
|
||||
DeviceFinder::Device dfdevice;
|
||||
@@ -211,6 +211,9 @@ void BackendSettingsPage::Load_Device(QString output, QVariant device, bool alsa
|
||||
|
||||
for (DeviceFinder *f : dialog()->app()->enginedevice()->device_finders_) {
|
||||
if (f->name() == "alsa" && !alsa) continue;
|
||||
if (f->name() == "pulseaudio" && !pulseaudio) continue;
|
||||
if (f->name() == "directsound" && !directsound) continue;
|
||||
if (f->name() == "osxaudio" && !osxaudio) continue;
|
||||
for (const DeviceFinder::Device &d : f->ListDevices()) {
|
||||
devices++;
|
||||
ui_->combobox_device->addItem(IconLoader::Load(d.iconname), d.description, d.value);
|
||||
@@ -218,10 +221,10 @@ void BackendSettingsPage::Load_Device(QString output, QVariant device, bool alsa
|
||||
}
|
||||
}
|
||||
|
||||
if (alsa) ui_->combobox_device->addItem(IconLoader::Load("soundcard"), "Custom", QVariant(""));
|
||||
if (custom) ui_->combobox_device->addItem(IconLoader::Load("soundcard"), "Custom", QVariant(""));
|
||||
|
||||
bool found = false;
|
||||
if (devices > 0) ui_->combobox_device->setEnabled(true);
|
||||
if (custom || devices > 0) ui_->combobox_device->setEnabled(true);
|
||||
for (int i = 0; i < ui_->combobox_device->count(); ++i) {
|
||||
QVariant d = ui_->combobox_device->itemData(i).value<QVariant>();
|
||||
if (dfdevice.value == d) {
|
||||
@@ -232,7 +235,7 @@ void BackendSettingsPage::Load_Device(QString output, QVariant device, bool alsa
|
||||
}
|
||||
|
||||
// This allows a custom ALSA device string ie: "hw:0,0" even if it is not listed.
|
||||
if (found == false && alsa && device.type() == QVariant::String && !device.toString().isEmpty()) {
|
||||
if (found == false && custom && device.type() == QVariant::String && !device.toString().isEmpty()) {
|
||||
ui_->lineedit_device->setText(device.toString());
|
||||
}
|
||||
|
||||
@@ -247,7 +250,7 @@ void BackendSettingsPage::Gst_Load(QString output, QVariant device) {
|
||||
errordialog_.ShowMessage("GStramer not initialized! Please restart.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
GstEngine *gstengine = qobject_cast<GstEngine*>(dialog()->app()->player()->engine());
|
||||
|
||||
ui_->combobox_output->clear();
|
||||
@@ -269,7 +272,7 @@ void BackendSettingsPage::Gst_Load(QString output, QVariant device) {
|
||||
engineloaded_=Engine::GStreamer;
|
||||
ui_->groupbox_replaygain->setEnabled(true);
|
||||
|
||||
Load_Device(output, device, GstEngine::ALSADeviceSupport(output));
|
||||
Load_Device(output, device, GstEngine::ALSADeviceSupport(output), GstEngine::PulseDeviceSupport(output), GstEngine::DirectSoundDeviceSupport(output), GstEngine::OSXAudioDeviceSupport(output), GstEngine::CustomDeviceSupport(output));
|
||||
|
||||
}
|
||||
#endif
|
||||
@@ -303,7 +306,7 @@ void BackendSettingsPage::Xine_Load(QString output, QVariant device) {
|
||||
|
||||
engineloaded_=Engine::Xine;
|
||||
|
||||
Load_Device(output, device, false);
|
||||
Load_Device(output, device);
|
||||
|
||||
}
|
||||
#endif
|
||||
@@ -317,7 +320,7 @@ void BackendSettingsPage::Phonon_Load(QString output, QVariant device) {
|
||||
|
||||
engineloaded_=Engine::Phonon;
|
||||
|
||||
Load_Device(output, device, false);
|
||||
Load_Device(output, device);
|
||||
|
||||
}
|
||||
#endif
|
||||
@@ -331,7 +334,7 @@ void BackendSettingsPage::VLC_Load(QString output, QVariant device) {
|
||||
|
||||
engineloaded_=Engine::VLC;
|
||||
|
||||
Load_Device(output, device, false);
|
||||
Load_Device(output, device);
|
||||
|
||||
}
|
||||
#endif
|
||||
@@ -468,7 +471,7 @@ void BackendSettingsPage::OutputChanged(int index, Engine::EngineType enginetype
|
||||
void BackendSettingsPage::Xine_OutputChanged(int index) {
|
||||
|
||||
EngineBase::OutputDetails output = ui_->combobox_output->itemData(index).value<EngineBase::OutputDetails>();
|
||||
Load_Device(output.name, QVariant(), false);
|
||||
Load_Device(output.name, QVariant());
|
||||
|
||||
}
|
||||
#endif
|
||||
@@ -477,20 +480,20 @@ void BackendSettingsPage::Xine_OutputChanged(int index) {
|
||||
void BackendSettingsPage::Gst_OutputChanged(int index) {
|
||||
|
||||
EngineBase::OutputDetails output = ui_->combobox_output->itemData(index).value<EngineBase::OutputDetails>();
|
||||
Load_Device(output.name, QVariant(), GstEngine::ALSADeviceSupport(output.name));
|
||||
Load_Device(output.name, QVariant(), GstEngine::ALSADeviceSupport(output.name), GstEngine::PulseDeviceSupport(output.name), GstEngine::DirectSoundDeviceSupport(output.name), GstEngine::OSXAudioDeviceSupport(output.name), GstEngine::CustomDeviceSupport(output.name));
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PHONON
|
||||
void BackendSettingsPage::Phonon_OutputChanged(int index) {
|
||||
Load_Device("", QVariant(), false);
|
||||
Load_Device("", QVariant());
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_VLC
|
||||
void BackendSettingsPage::VLC_OutputChanged(int index) {
|
||||
Load_Device("", QVariant(), false);
|
||||
Load_Device("", QVariant());
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -502,14 +505,12 @@ void BackendSettingsPage::DeviceSelectionChanged(int index) {
|
||||
return;
|
||||
}
|
||||
|
||||
#if !defined(Q_OS_WIN32)
|
||||
QVariant device = ui_->combobox_device->itemData(index).value<QVariant>();
|
||||
if (device.type() == QVariant::String) {
|
||||
if (device.type() == QVariant::String && device.toString().startsWith("hw:", Qt::CaseInsensitive)) {
|
||||
ui_->lineedit_device->setEnabled(true);
|
||||
ui_->lineedit_device->setText(device.toString());
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
ui_->lineedit_device->setEnabled(false);
|
||||
ui_->lineedit_device->setText("");
|
||||
|
||||
@@ -67,7 +67,7 @@ private:
|
||||
void OutputChanged(int index, Engine::EngineType enginetype);
|
||||
|
||||
void Load_Engine(Engine::EngineType enginetype);
|
||||
void Load_Device(QString output, QVariant device, bool alsa);
|
||||
void Load_Device(QString output, QVariant device, bool alsa = false, bool pulseaudio = false, bool directsound = false, bool osxaudio = false, bool custom = false);
|
||||
|
||||
#ifdef HAVE_XINE
|
||||
void Xine_Load(QString output, QVariant device);
|
||||
|
||||
Reference in New Issue
Block a user