Disable automatic conversions from 8-bit strings
This commit is contained in:
@@ -31,7 +31,7 @@
|
||||
#include "alsadevicefinder.h"
|
||||
#include "enginedevice.h"
|
||||
|
||||
AlsaDeviceFinder::AlsaDeviceFinder() : DeviceFinder(QStringLiteral("alsa"), { "alsa", "alsasink" }) {}
|
||||
AlsaDeviceFinder::AlsaDeviceFinder() : DeviceFinder(QStringLiteral("alsa"), { QStringLiteral("alsa"), QStringLiteral("alsasink") }) {}
|
||||
|
||||
EngineDeviceList AlsaDeviceFinder::ListDevices() {
|
||||
|
||||
@@ -91,7 +91,7 @@ EngineDeviceList AlsaDeviceFinder::ListDevices() {
|
||||
}
|
||||
|
||||
EngineDevice device;
|
||||
device.description = QStringLiteral("%1 %2").arg(snd_ctl_card_info_get_name(cardinfo), snd_pcm_info_get_name(pcminfo));
|
||||
device.description = QStringLiteral("%1 %2").arg(QString::fromUtf8(snd_ctl_card_info_get_name(cardinfo)), QString::fromUtf8(snd_pcm_info_get_name(pcminfo)));
|
||||
device.iconname = device.GuessIconName();
|
||||
device.card = card;
|
||||
device.device = dev;
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#include "alsapcmdevicefinder.h"
|
||||
#include "enginedevice.h"
|
||||
|
||||
AlsaPCMDeviceFinder::AlsaPCMDeviceFinder() : DeviceFinder(QStringLiteral("alsa"), { "alsa", "alsasink" }) {}
|
||||
AlsaPCMDeviceFinder::AlsaPCMDeviceFinder() : DeviceFinder(QStringLiteral("alsa"), { QStringLiteral("alsa"), QStringLiteral("alsasink") }) {}
|
||||
|
||||
EngineDeviceList AlsaPCMDeviceFinder::ListDevices() {
|
||||
|
||||
@@ -45,22 +45,22 @@ EngineDeviceList AlsaPCMDeviceFinder::ListDevices() {
|
||||
char *hint_desc = snd_device_name_get_hint(*n, "DESC");
|
||||
if (hint_io && hint_name && hint_desc && strcmp(hint_io, "Output") == 0) {
|
||||
|
||||
QString name(hint_name);
|
||||
const QString name = QString::fromUtf8(hint_name);
|
||||
|
||||
char *desc_last = hint_desc;
|
||||
QString description;
|
||||
for (char *desc_i = hint_desc; desc_i && *desc_i != '\0'; ++desc_i) {
|
||||
if (*desc_i == '\n') {
|
||||
*desc_i = '\0';
|
||||
if (!description.isEmpty()) description.append(' ');
|
||||
description.append(desc_last);
|
||||
if (!description.isEmpty()) description.append(QLatin1Char(' '));
|
||||
description.append(QString::fromUtf8(desc_last));
|
||||
desc_last = desc_i + 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (desc_last) {
|
||||
if (!description.isEmpty()) description.append(' ');
|
||||
description.append(desc_last);
|
||||
if (!description.isEmpty()) description.append(QLatin1Char(' '));
|
||||
description.append(QString::fromUtf8(desc_last));
|
||||
}
|
||||
|
||||
EngineDevice device;
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#include "enginedevice.h"
|
||||
#include "core/logging.h"
|
||||
|
||||
AsioDeviceFinder::AsioDeviceFinder() : DeviceFinder("asio", { "asiosink" }) {}
|
||||
AsioDeviceFinder::AsioDeviceFinder() : DeviceFinder(QStringLiteral("asio"), { QStringLiteral("asiosink") }) {}
|
||||
|
||||
EngineDeviceList AsioDeviceFinder::ListDevices() {
|
||||
|
||||
|
||||
@@ -183,7 +183,7 @@ QString Chromaprinter::CreateFingerprint() {
|
||||
gst_element_set_state(pipeline, GST_STATE_NULL);
|
||||
gst_object_unref(pipeline);
|
||||
|
||||
return fingerprint;
|
||||
return QString::fromUtf8(fingerprint);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
#include "enginedevice.h"
|
||||
#include "core/logging.h"
|
||||
|
||||
DirectSoundDeviceFinder::DirectSoundDeviceFinder() : DeviceFinder("directsound", { "directsound", "dsound", "directsoundsink", "directx", "directx2", "waveformsink" }) {}
|
||||
DirectSoundDeviceFinder::DirectSoundDeviceFinder() : DeviceFinder(QStringLiteral("directsound"), { QStringLiteral("directsound"), QStringLiteral("dsound"), QStringLiteral("directsoundsink"), QStringLiteral("directx"), QStringLiteral("directx2"), QStringLiteral("waveformsink") }) {}
|
||||
|
||||
EngineDeviceList DirectSoundDeviceFinder::ListDevices() {
|
||||
State state;
|
||||
|
||||
@@ -208,7 +208,7 @@ class EBUR128AnalysisImpl {
|
||||
FrameFormat::FrameFormat(GstCaps *caps) : channels(0), channel_mask(0), samplerate(0) {
|
||||
|
||||
GstStructure *structure = gst_caps_get_structure(caps, 0);
|
||||
QString format_str = gst_structure_get_string(structure, "format");
|
||||
QString format_str = QString::fromUtf8(gst_structure_get_string(structure, "format"));
|
||||
gst_structure_get_int(structure, "rate", &samplerate);
|
||||
gst_structure_get_int(structure, "channels", &channels);
|
||||
const GValue *value = gst_structure_get_value(structure, "channel-mask");
|
||||
@@ -216,16 +216,16 @@ FrameFormat::FrameFormat(GstCaps *caps) : channels(0), channel_mask(0), samplera
|
||||
channel_mask = gst_value_get_bitmask(value);
|
||||
}
|
||||
|
||||
if (format_str == "S16LE") {
|
||||
if (format_str == QStringLiteral("S16LE")) {
|
||||
format = DataFormat::S16;
|
||||
}
|
||||
else if (format_str == "S32LE") {
|
||||
else if (format_str == QStringLiteral("S32LE")) {
|
||||
format = DataFormat::S32;
|
||||
}
|
||||
else if (format_str == "F32LE") {
|
||||
else if (format_str == QStringLiteral("F32LE")) {
|
||||
format = DataFormat::FP32;
|
||||
}
|
||||
else if (format_str == "F64LE") {
|
||||
else if (format_str == QStringLiteral("F64LE")) {
|
||||
format = DataFormat::FP64;
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#include "utilities/envutils.h"
|
||||
#include "utilities/timeconstants.h"
|
||||
#include "core/networkproxyfactory.h"
|
||||
#include "core/settings.h"
|
||||
#include "enginebase.h"
|
||||
#include "settings/backendsettingspage.h"
|
||||
#include "settings/networkproxysettingspage.h"
|
||||
@@ -161,7 +162,7 @@ void EngineBase::SetVolume(const uint volume) {
|
||||
|
||||
void EngineBase::ReloadSettings() {
|
||||
|
||||
QSettings s;
|
||||
Settings s;
|
||||
|
||||
s.beginGroup(BackendSettingsPage::kSettingsGroup);
|
||||
|
||||
|
||||
@@ -416,22 +416,22 @@ EngineBase::OutputDetailsList GstEngine::GetOutputsList() const {
|
||||
GstElementFactory *factory = GST_ELEMENT_FACTORY(future->data);
|
||||
const QString metadata = QString::fromUtf8(gst_element_factory_get_metadata(factory, GST_ELEMENT_METADATA_KLASS));
|
||||
const QString name = QString::fromUtf8(gst_plugin_feature_get_name(future->data));
|
||||
if (metadata.startsWith(QLatin1String("Sink/Audio"), Qt::CaseInsensitive) || name == "pipewiresink" || (metadata.startsWith(QLatin1String("Source/Audio"), Qt::CaseInsensitive) && name.contains(QLatin1String("sink")))) {
|
||||
if (metadata.startsWith(QLatin1String("Sink/Audio"), Qt::CaseInsensitive) || name == QStringLiteral("pipewiresink") || (metadata.startsWith(QLatin1String("Source/Audio"), Qt::CaseInsensitive) && name.contains(QLatin1String("sink")))) {
|
||||
QString description = QString::fromUtf8(gst_element_factory_get_metadata(factory, GST_ELEMENT_METADATA_DESCRIPTION));
|
||||
if (name == "wasapi2sink" && description == "Stream audio to an audio capture device through WASAPI") {
|
||||
description.append("2");
|
||||
if (name == QStringLiteral("wasapi2sink") && description == QStringLiteral("Stream audio to an audio capture device through WASAPI")) {
|
||||
description.append(QLatin1Char('2'));
|
||||
}
|
||||
else if (name == "pipewiresink" && description == "Send video to PipeWire") {
|
||||
else if (name == QStringLiteral("pipewiresink") && description == QStringLiteral("Send video to PipeWire")) {
|
||||
description = QStringLiteral("Send audio to PipeWire");
|
||||
}
|
||||
OutputDetails output;
|
||||
output.name = name;
|
||||
output.description = description;
|
||||
if (output.name == kAutoSink) output.iconname = QStringLiteral("soundcard");
|
||||
else if (output.name == kALSASink || output.name == kOSS4Sink) output.iconname = QStringLiteral("alsa");
|
||||
else if (output.name == kJackAudioSink) output.iconname = QStringLiteral("jack");
|
||||
else if (output.name == kPulseSink) output.iconname = QStringLiteral("pulseaudio");
|
||||
else if (output.name == kA2DPSink || output.name == kAVDTPSink) output.iconname = QStringLiteral("bluetooth");
|
||||
if (output.name == QLatin1String(kAutoSink)) output.iconname = QStringLiteral("soundcard");
|
||||
else if (output.name == QLatin1String(kALSASink) || output.name == QLatin1String(kOSS4Sink)) output.iconname = QStringLiteral("alsa");
|
||||
else if (output.name == QLatin1String(kJackAudioSink)) output.iconname = QStringLiteral("jack");
|
||||
else if (output.name == QLatin1String(kPulseSink)) output.iconname = QStringLiteral("pulseaudio");
|
||||
else if (output.name == QLatin1String(kA2DPSink) || output.name == QLatin1String(kAVDTPSink)) output.iconname = QStringLiteral("bluetooth");
|
||||
else output.iconname = QStringLiteral("soundcard");
|
||||
outputs << output;
|
||||
}
|
||||
@@ -453,22 +453,22 @@ bool GstEngine::ValidOutput(const QString &output) {
|
||||
}
|
||||
|
||||
bool GstEngine::CustomDeviceSupport(const QString &output) {
|
||||
return (output == kALSASink || output == kOpenALSASink || output == kOSSSink || output == kOSS4Sink || output == kPulseSink || output == kA2DPSink || output == kAVDTPSink || output == kJackAudioSink);
|
||||
return output == QLatin1String(kALSASink) || output == QLatin1String(kOpenALSASink) || output == QLatin1String(kOSSSink) || output == QLatin1String(kOSS4Sink) || output == QLatin1String(kPulseSink) || output == QLatin1String(kA2DPSink) || output == QLatin1String(kAVDTPSink) || output == QLatin1String(kJackAudioSink);
|
||||
}
|
||||
|
||||
bool GstEngine::ALSADeviceSupport(const QString &output) {
|
||||
return (output == kALSASink);
|
||||
return output == QLatin1String(kALSASink);
|
||||
}
|
||||
|
||||
bool GstEngine::ExclusiveModeSupport(const QString &output) {
|
||||
return output == kWASAPISink;
|
||||
return output == QLatin1String(kWASAPISink);
|
||||
}
|
||||
|
||||
void GstEngine::ReloadSettings() {
|
||||
|
||||
EngineBase::ReloadSettings();
|
||||
|
||||
if (output_.isEmpty()) output_ = kAutoSink;
|
||||
if (output_.isEmpty()) output_ = QLatin1String(kAutoSink);
|
||||
|
||||
}
|
||||
|
||||
@@ -722,20 +722,20 @@ QByteArray GstEngine::FixupUrl(const QUrl &url) {
|
||||
// QUrl::fromLocalFile does this when given a \\host\share\file path on Windows.
|
||||
// Munge it back into a path that gstreamer will recognise.
|
||||
if (url.isLocalFile() && !url.host().isEmpty()) {
|
||||
QString str = "file:////" + url.host() + url.path();
|
||||
QString str = QStringLiteral("file:////") + url.host() + url.path();
|
||||
uri = str.toUtf8();
|
||||
}
|
||||
else if (url.scheme() == "cdda") {
|
||||
else if (url.scheme() == QStringLiteral("cdda")) {
|
||||
QString str;
|
||||
if (url.path().isEmpty()) {
|
||||
str = url.toString();
|
||||
str.remove(str.lastIndexOf(QChar('a')), 1);
|
||||
str.remove(str.lastIndexOf(QLatin1Char('a')), 1);
|
||||
}
|
||||
else {
|
||||
// Currently, Gstreamer can't handle input CD devices inside cdda URL.
|
||||
// So we handle them ourselves: we extract the track number and re-create a URL with only cdda:// + the track number (which can be handled by Gstreamer).
|
||||
// We keep the device in mind, and we will set it later using SourceSetupCallback
|
||||
QStringList path = url.path().split('/');
|
||||
QStringList path = url.path().split(QLatin1Char('/'));
|
||||
str = QStringLiteral("cdda://%1").arg(path.takeLast());
|
||||
QString device = path.join(QStringLiteral("/"));
|
||||
if (current_pipeline_) current_pipeline_->SetSourceDevice(device);
|
||||
@@ -918,8 +918,8 @@ void GstEngine::StreamDiscovered(GstDiscoverer*, GstDiscovererInfo *info, GError
|
||||
|
||||
GstDiscovererResult result = gst_discoverer_info_get_result(info);
|
||||
if (result != GST_DISCOVERER_OK) {
|
||||
QString error_message = GSTdiscovererErrorMessage(result);
|
||||
qLog(Error) << QStringLiteral("Stream discovery for %1 failed: %2").arg(discovered_url, error_message);
|
||||
const QString error_message = GSTdiscovererErrorMessage(result);
|
||||
qLog(Error) << QStringLiteral("Stream discovery for %1 failed: %2").arg(QString::fromUtf8(discovered_url), error_message);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -949,8 +949,8 @@ void GstEngine::StreamDiscovered(GstDiscoverer*, GstDiscovererInfo *info, GError
|
||||
for (guint i = 0; i < caps_size; ++i) {
|
||||
GstStructure *gst_structure = gst_caps_get_structure(caps, i);
|
||||
if (!gst_structure) continue;
|
||||
QString mimetype = gst_structure_get_name(gst_structure);
|
||||
if (!mimetype.isEmpty() && mimetype != "audio/mpeg") {
|
||||
QString mimetype = QString::fromUtf8(gst_structure_get_name(gst_structure));
|
||||
if (!mimetype.isEmpty() && mimetype != QStringLiteral("audio/mpeg")) {
|
||||
engine_metadata.filetype = Song::FiletypeByMimetype(mimetype);
|
||||
if (engine_metadata.filetype == Song::FileType::Unknown) {
|
||||
qLog(Error) << "Unknown mimetype" << mimetype;
|
||||
@@ -960,7 +960,7 @@ void GstEngine::StreamDiscovered(GstDiscoverer*, GstDiscovererInfo *info, GError
|
||||
|
||||
if (engine_metadata.filetype == Song::FileType::Unknown) {
|
||||
gchar *codec_description = gst_pb_utils_get_codec_description(caps);
|
||||
QString filetype_description = (codec_description ? QString(codec_description) : QString());
|
||||
QString filetype_description = (codec_description ? QString::fromUtf8(codec_description) : QString());
|
||||
g_free(codec_description);
|
||||
if (!filetype_description.isEmpty()) {
|
||||
engine_metadata.filetype = Song::FiletypeByDescription(filetype_description);
|
||||
|
||||
@@ -78,7 +78,7 @@ class GstEngine : public EngineBase, public GstBufferConsumer {
|
||||
|
||||
OutputDetailsList GetOutputsList() const override;
|
||||
bool ValidOutput(const QString &output) override;
|
||||
QString DefaultOutput() override { return kAutoSink; }
|
||||
QString DefaultOutput() override { return QLatin1String(kAutoSink); }
|
||||
bool CustomDeviceSupport(const QString &output) override;
|
||||
bool ALSADeviceSupport(const QString &output) override;
|
||||
bool ExclusiveModeSupport(const QString &output) override;
|
||||
|
||||
@@ -321,7 +321,7 @@ QString GstEnginePipeline::GstStateText(const GstState state) {
|
||||
|
||||
GstElement *GstEnginePipeline::CreateElement(const QString &factory_name, const QString &name, GstElement *bin, QString &error) const {
|
||||
|
||||
QString unique_name = QStringLiteral("pipeline") + "-" + QString::number(id_) + "-" + (name.isEmpty() ? factory_name : name);
|
||||
QString unique_name = QStringLiteral("pipeline") + QLatin1Char('-') + QString::number(id_) + QLatin1Char('-') + (name.isEmpty() ? factory_name : name);
|
||||
|
||||
GstElement *element = gst_element_factory_make(factory_name.toUtf8().constData(), unique_name.toUtf8().constData());
|
||||
if (!element) {
|
||||
@@ -366,7 +366,7 @@ bool GstEnginePipeline::InitFromUrl(const QUrl &media_url, const QUrl &stream_ur
|
||||
}
|
||||
#else
|
||||
if (volume_enabled_ && !volume_) {
|
||||
if (output_ == GstEngine::kAutoSink) {
|
||||
if (output_ == QLatin1String(GstEngine::kAutoSink)) {
|
||||
element_added_cb_id_ = CHECKED_GCONNECT(G_OBJECT(audiobin_), "deep-element-added", &ElementAddedCallback, this);
|
||||
element_removed_cb_id_ = CHECKED_GCONNECT(G_OBJECT(audiobin_), "deep-element-removed", &ElementRemovedCallback, this);
|
||||
}
|
||||
@@ -835,7 +835,7 @@ bool GstEnginePipeline::InitAudioBin(QString &error) {
|
||||
const bool link_filtered_result = gst_element_link_filtered(audiosinkconverter, audiosink_, caps);
|
||||
gst_caps_unref(caps);
|
||||
if (!link_filtered_result) {
|
||||
error = "Failed to link audio sink converter to audio sink with filter for " + output_;
|
||||
error = QStringLiteral("Failed to link audio sink converter to audio sink with filter for ") + output_;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -923,7 +923,7 @@ void GstEnginePipeline::ElementAddedCallback(GstBin *bin, GstBin*, GstElement *e
|
||||
GstEnginePipeline *instance = reinterpret_cast<GstEnginePipeline*>(self);
|
||||
|
||||
gchar *element_name_char = gst_element_get_name(element);
|
||||
const QString element_name(element_name_char);
|
||||
const QString element_name = QString::fromUtf8(element_name_char);
|
||||
g_free(element_name_char);
|
||||
|
||||
if (bin != GST_BIN(instance->audiobin_) || element_name == QStringLiteral("fake-audio-sink") || GST_ELEMENT(gst_element_get_parent(element)) != instance->audiosink_) return;
|
||||
@@ -1456,7 +1456,7 @@ void GstEnginePipeline::ErrorMessageReceived(GstMessage *msg) {
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
// Ignore non-error received for directsoundsink: "IDirectSoundBuffer_GetStatus The operation completed successfully"
|
||||
if (code == GST_RESOURCE_ERROR_OPEN_WRITE && message.contains("IDirectSoundBuffer_GetStatus The operation completed successfully.")) {
|
||||
if (code == GST_RESOURCE_ERROR_OPEN_WRITE && message.contains(QStringLiteral("IDirectSoundBuffer_GetStatus The operation completed successfully."))) {
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
@@ -1488,8 +1488,8 @@ void GstEnginePipeline::TagMessageReceived(GstMessage *msg) {
|
||||
if (engine_metadata.title.contains(QLatin1String(" - "))) {
|
||||
title_splitted = engine_metadata.title.split(QStringLiteral(" - "));
|
||||
}
|
||||
else if (engine_metadata.title.contains('~')) {
|
||||
title_splitted = engine_metadata.title.split('~');
|
||||
else if (engine_metadata.title.contains(QLatin1Char('~'))) {
|
||||
title_splitted = engine_metadata.title.split(QLatin1Char('~'));
|
||||
}
|
||||
if (!title_splitted.isEmpty() && title_splitted.count() >= 2) {
|
||||
int i = 0;
|
||||
|
||||
@@ -115,28 +115,28 @@ void GstStartup::SetEnvironment() {
|
||||
// Set plugin root path
|
||||
QString plugin_root_path;
|
||||
# if defined(Q_OS_MACOS)
|
||||
plugin_root_path = QDir::cleanPath(app_path + "/../PlugIns");
|
||||
plugin_root_path = QDir::cleanPath(app_path + QStringLiteral("/../PlugIns"));
|
||||
# elif defined(Q_OS_UNIX)
|
||||
plugin_root_path = QDir::cleanPath(app_path + "/../plugins");
|
||||
plugin_root_path = QDir::cleanPath(app_path + QStringLiteral("/../plugins"));
|
||||
# elif defined(Q_OS_WIN32)
|
||||
plugin_root_path = app_path;
|
||||
# endif
|
||||
|
||||
// Set GIO module path
|
||||
const QString gio_module_path = plugin_root_path + "/gio-modules";
|
||||
const QString gio_module_path = plugin_root_path + QStringLiteral("/gio-modules");
|
||||
|
||||
// Set GStreamer plugin scanner path
|
||||
QString gst_plugin_scanner;
|
||||
# if defined(Q_OS_UNIX)
|
||||
gst_plugin_scanner = plugin_root_path + "/gst-plugin-scanner";
|
||||
gst_plugin_scanner = plugin_root_path + QStringLiteral("/gst-plugin-scanner");
|
||||
# endif
|
||||
|
||||
// Set GStreamer plugin path
|
||||
QString gst_plugin_path;
|
||||
# if defined(Q_OS_WIN32)
|
||||
gst_plugin_path = plugin_root_path + "/gstreamer-plugins";
|
||||
gst_plugin_path = plugin_root_path + QStringLiteral("/gstreamer-plugins");
|
||||
# else
|
||||
gst_plugin_path = plugin_root_path + "/gstreamer";
|
||||
gst_plugin_path = plugin_root_path + QStringLiteral("/gstreamer");
|
||||
# endif
|
||||
|
||||
if (!gio_module_path.isEmpty()) {
|
||||
@@ -175,7 +175,7 @@ void GstStartup::SetEnvironment() {
|
||||
|
||||
|
||||
#if defined(Q_OS_WIN32) || defined(Q_OS_MACOS)
|
||||
QString gst_registry_filename = QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + QString("/gst-registry-%1-bin").arg(QCoreApplication::applicationVersion());
|
||||
QString gst_registry_filename = QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + QStringLiteral("/gst-registry-%1-bin").arg(QCoreApplication::applicationVersion());
|
||||
qLog(Debug) << "Setting GStreamer registry file to" << gst_registry_filename;
|
||||
Utilities::SetEnv("GST_REGISTRY", gst_registry_filename);
|
||||
#endif
|
||||
|
||||
@@ -63,7 +63,7 @@ std::unique_ptr<T> GetProperty(const AudioDeviceID &device_id, const AudioObject
|
||||
} // namespace
|
||||
|
||||
|
||||
MacOsDeviceFinder::MacOsDeviceFinder() : DeviceFinder("osxaudio", { "osxaudio", "osx", "osxaudiosink" }) {}
|
||||
MacOsDeviceFinder::MacOsDeviceFinder() : DeviceFinder(QStringLiteral("osxaudio"), { QStringLiteral("osxaudio"), QStringLiteral("osx"), QStringLiteral("osxaudiosink") }) {}
|
||||
|
||||
EngineDeviceList MacOsDeviceFinder::ListDevices() {
|
||||
|
||||
@@ -107,7 +107,7 @@ EngineDeviceList MacOsDeviceFinder::ListDevices() {
|
||||
EngineDevice device;
|
||||
device.value = id;
|
||||
device.description = QString::fromUtf8(CFStringGetCStringPtr(*device_name, CFStringGetSystemEncoding()));
|
||||
if (device.description.isEmpty()) device.description = QString("Unknown device " + device.value.toString());
|
||||
if (device.description.isEmpty()) device.description = QStringLiteral("Unknown device ") + device.value.toString();
|
||||
device.iconname = device.GuessIconName();
|
||||
device_list.append(device);
|
||||
}
|
||||
@@ -115,4 +115,3 @@ EngineDeviceList MacOsDeviceFinder::ListDevices() {
|
||||
return device_list;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
DEFINE_GUID(CLSID_MMDeviceEnumerator, 0xbcde0395, 0xe52f, 0x467c, 0x8e, 0x3d, 0xc4, 0x57, 0x92, 0x91, 0x69, 0x2e);
|
||||
#endif
|
||||
|
||||
MMDeviceFinder::MMDeviceFinder() : DeviceFinder("mmdevice", { "wasapisink" }) {}
|
||||
MMDeviceFinder::MMDeviceFinder() : DeviceFinder(QStringLiteral("mmdevice"), { QStringLiteral("wasapisink") }) {}
|
||||
|
||||
EngineDeviceList MMDeviceFinder::ListDevices() {
|
||||
|
||||
@@ -49,7 +49,7 @@ EngineDeviceList MMDeviceFinder::ListDevices() {
|
||||
|
||||
EngineDeviceList devices;
|
||||
EngineDevice default_device;
|
||||
default_device.description = "Default device";
|
||||
default_device.description = QStringLiteral("Default device");
|
||||
default_device.iconname = default_device.GuessIconName();
|
||||
devices.append(default_device);
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
#include "pulsedevicefinder.h"
|
||||
#include "enginedevice.h"
|
||||
|
||||
PulseDeviceFinder::PulseDeviceFinder() : DeviceFinder(QStringLiteral("pulseaudio"), { "pulseaudio", "pulse", "pulsesink" }), mainloop_(nullptr), context_(nullptr) {}
|
||||
PulseDeviceFinder::PulseDeviceFinder() : DeviceFinder(QStringLiteral("pulseaudio"), { QStringLiteral("pulseaudio"), QStringLiteral("pulse"), QStringLiteral("pulsesink") }), mainloop_(nullptr), context_(nullptr) {}
|
||||
|
||||
bool PulseDeviceFinder::Initialize() {
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ using namespace ABI::Windows::Foundation;
|
||||
using namespace ABI::Windows::Foundation::Collections;
|
||||
using namespace ABI::Windows::Devices::Enumeration;
|
||||
|
||||
UWPDeviceFinder::UWPDeviceFinder() : DeviceFinder("uwpdevice", { "wasapi2sink" }) {}
|
||||
UWPDeviceFinder::UWPDeviceFinder() : DeviceFinder(QStringLiteral("uwpdevice"), { QStringLiteral("wasapi2sink") }) {}
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -107,7 +107,7 @@ EngineDeviceList UWPDeviceFinder::ListDevices() {
|
||||
|
||||
{
|
||||
EngineDevice default_device;
|
||||
default_device.description = "Default device";
|
||||
default_device.description = QStringLiteral("Default device");
|
||||
default_device.iconname = default_device.GuessIconName();
|
||||
devices.append(default_device);
|
||||
}
|
||||
|
||||
@@ -129,7 +129,7 @@ bool VLCEngine::Play(const quint64 offset_nanosec) {
|
||||
if (!Initialized()) return false;
|
||||
|
||||
// Set audio output
|
||||
if (!output_.isEmpty() && output_ != "auto") {
|
||||
if (!output_.isEmpty() && output_ != QStringLiteral("auto")) {
|
||||
int result = libvlc_audio_output_set(player_, output_.toUtf8().constData());
|
||||
if (result != 0) qLog(Error) << "Failed to set output to" << output_;
|
||||
}
|
||||
@@ -235,11 +235,11 @@ EngineBase::OutputDetailsList VLCEngine::GetOutputsList() const {
|
||||
OutputDetails output;
|
||||
output.name = QString::fromUtf8(audio_output->psz_name);
|
||||
output.description = QString::fromUtf8(audio_output->psz_description);
|
||||
if (output.name == "auto") output.iconname = QStringLiteral("soundcard");
|
||||
else if ((output.name == "alsa")||(output.name == "oss")) output.iconname = QStringLiteral("alsa");
|
||||
else if (output.name== "jack") output.iconname = QStringLiteral("jack");
|
||||
else if (output.name == "pulse") output.iconname = QStringLiteral("pulseaudio");
|
||||
else if (output.name == "afile") output.iconname = QStringLiteral("document-new");
|
||||
if (output.name == QStringLiteral("auto")) output.iconname = QStringLiteral("soundcard");
|
||||
else if ((output.name == QStringLiteral("alsa"))||(output.name == QStringLiteral("oss"))) output.iconname = QStringLiteral("alsa");
|
||||
else if (output.name== QStringLiteral("jack")) output.iconname = QStringLiteral("jack");
|
||||
else if (output.name == QStringLiteral("pulse")) output.iconname = QStringLiteral("pulseaudio");
|
||||
else if (output.name == QStringLiteral("afile")) output.iconname = QStringLiteral("document-new");
|
||||
else output.iconname = QStringLiteral("soundcard");
|
||||
outputs << output;
|
||||
}
|
||||
@@ -257,11 +257,11 @@ bool VLCEngine::ValidOutput(const QString &output) {
|
||||
}
|
||||
|
||||
bool VLCEngine::CustomDeviceSupport(const QString &output) {
|
||||
return (output != "auto");
|
||||
return (output != QStringLiteral("auto"));
|
||||
}
|
||||
|
||||
bool VLCEngine::ALSADeviceSupport(const QString &output) {
|
||||
return (output == "alsa");
|
||||
return (output == QStringLiteral("alsa"));
|
||||
}
|
||||
|
||||
bool VLCEngine::ExclusiveModeSupport(const QString &output) {
|
||||
|
||||
Reference in New Issue
Block a user