Replace QLatin1String with operator _L1
This commit is contained in:
@@ -52,14 +52,14 @@ EngineDeviceList AlsaPCMDeviceFinder::ListDevices() {
|
||||
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(QLatin1Char(' '));
|
||||
if (!description.isEmpty()) description.append(u' ');
|
||||
description.append(QString::fromUtf8(desc_last));
|
||||
desc_last = desc_i + 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (desc_last) {
|
||||
if (!description.isEmpty()) description.append(QLatin1Char(' '));
|
||||
if (!description.isEmpty()) description.append(u' ');
|
||||
description.append(QString::fromUtf8(desc_last));
|
||||
}
|
||||
|
||||
|
||||
@@ -49,6 +49,8 @@
|
||||
# endif // _MSC_VER
|
||||
#endif // Q_OS_WIN32
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
DeviceFinders::DeviceFinders(QObject *parent) : QObject(parent) {
|
||||
|
||||
setObjectName(QLatin1String(metaObject()->className()));
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
|
||||
#include "ebur128analysis.h"
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
using std::unique_ptr;
|
||||
|
||||
namespace {
|
||||
@@ -216,16 +217,16 @@ FrameFormat::FrameFormat(GstCaps *caps) : channels(0), channel_mask(0), samplera
|
||||
channel_mask = gst_value_get_bitmask(value);
|
||||
}
|
||||
|
||||
if (format_str == QLatin1String("S16LE")) {
|
||||
if (format_str == "S16LE"_L1) {
|
||||
format = DataFormat::S16;
|
||||
}
|
||||
else if (format_str == QLatin1String("S32LE")) {
|
||||
else if (format_str == "S32LE"_L1) {
|
||||
format = DataFormat::S32;
|
||||
}
|
||||
else if (format_str == QLatin1String("F32LE")) {
|
||||
else if (format_str == "F32LE"_L1) {
|
||||
format = DataFormat::FP32;
|
||||
}
|
||||
else if (format_str == QLatin1String("F64LE")) {
|
||||
else if (format_str == "F64LE"_L1) {
|
||||
format = DataFormat::FP64;
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -41,6 +41,8 @@
|
||||
# include "settings/spotifysettingspage.h"
|
||||
#endif
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
EngineBase::EngineBase(QObject *parent)
|
||||
: QObject(parent),
|
||||
exclusive_mode_(false),
|
||||
@@ -83,8 +85,8 @@ EngineBase::~EngineBase() = default;
|
||||
|
||||
EngineBase::Type EngineBase::TypeFromName(const QString &name) {
|
||||
|
||||
if (name.compare(QLatin1String("gstreamer"), Qt::CaseInsensitive) == 0) return Type::GStreamer;
|
||||
if (name.compare(QLatin1String("vlc"), Qt::CaseInsensitive) == 0) return Type::VLC;
|
||||
if (name.compare("gstreamer"_L1, Qt::CaseInsensitive) == 0) return Type::GStreamer;
|
||||
if (name.compare("vlc"_L1, Qt::CaseInsensitive) == 0) return Type::VLC;
|
||||
|
||||
return Type::None;
|
||||
|
||||
@@ -207,7 +209,7 @@ void EngineBase::ReloadSettings() {
|
||||
bool http2_enabled = s.value("http2", false).toBool();
|
||||
if (http2_enabled != http2_enabled_) {
|
||||
http2_enabled_ = http2_enabled;
|
||||
Utilities::SetEnv("SOUP_FORCE_HTTP1", http2_enabled_ ? QLatin1String("") : QStringLiteral("1"));
|
||||
Utilities::SetEnv("SOUP_FORCE_HTTP1", http2_enabled_ ? ""_L1 : QStringLiteral("1"));
|
||||
qLog(Debug) << "SOUP_FORCE_HTTP1:" << (http2_enabled_ ? "OFF" : "ON");
|
||||
}
|
||||
|
||||
|
||||
@@ -19,29 +19,31 @@
|
||||
|
||||
#include "enginedevice.h"
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
EngineDevice::EngineDevice() : card(0), device(0) {}
|
||||
|
||||
QString EngineDevice::GuessIconName() const {
|
||||
|
||||
if (description.contains(QLatin1String("mcintosh"), Qt::CaseInsensitive)) {
|
||||
if (description.contains("mcintosh"_L1, Qt::CaseInsensitive)) {
|
||||
return QStringLiteral("mcintosh");
|
||||
}
|
||||
if (description.contains(QLatin1String("electrocompaniet"), Qt::CaseInsensitive)) {
|
||||
if (description.contains("electrocompaniet"_L1, Qt::CaseInsensitive)) {
|
||||
return QStringLiteral("electrocompaniet");
|
||||
}
|
||||
if (description.contains(QLatin1String("intel"), Qt::CaseInsensitive)) {
|
||||
if (description.contains("intel"_L1, Qt::CaseInsensitive)) {
|
||||
return QStringLiteral("intel");
|
||||
}
|
||||
if (description.contains(QLatin1String("realtek"), Qt::CaseInsensitive)) {
|
||||
if (description.contains("realtek"_L1, Qt::CaseInsensitive)) {
|
||||
return QStringLiteral("realtek");
|
||||
}
|
||||
if (description.contains(QLatin1String("nvidia"), Qt::CaseInsensitive)) {
|
||||
if (description.contains("nvidia"_L1, Qt::CaseInsensitive)) {
|
||||
return QStringLiteral("nvidia");
|
||||
}
|
||||
if (description.contains(QLatin1String("headset"), Qt::CaseInsensitive)) {
|
||||
if (description.contains("headset"_L1, Qt::CaseInsensitive)) {
|
||||
return QStringLiteral("headset");
|
||||
}
|
||||
if (description.contains(QLatin1String("pulseaudio"), Qt::CaseInsensitive)) {
|
||||
if (description.contains("pulseaudio"_L1, Qt::CaseInsensitive)) {
|
||||
return QStringLiteral("pulseaudio");
|
||||
}
|
||||
|
||||
|
||||
@@ -61,6 +61,7 @@
|
||||
#include "gstbufferconsumer.h"
|
||||
#include "enginemetadata.h"
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
using std::make_shared;
|
||||
|
||||
const char *GstEngine::kAutoSink = "autoaudiosink";
|
||||
@@ -455,24 +456,24 @@ 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));
|
||||
const QStringList classes = metadata.split(QLatin1Char('/'));
|
||||
if (classes.contains(QLatin1String("Audio"), Qt::CaseInsensitive) && (classes.contains(QLatin1String("Sink"), Qt::CaseInsensitive) || (classes.contains(QLatin1String("Source"), Qt::CaseInsensitive) && name.contains(QLatin1String("sink"))))) {
|
||||
const QStringList classes = metadata.split(u'/');
|
||||
if (classes.contains("Audio"_L1, Qt::CaseInsensitive) && (classes.contains("Sink"_L1, Qt::CaseInsensitive) || (classes.contains("Source"_L1, Qt::CaseInsensitive) && name.contains("sink"_L1)))) {
|
||||
QString description = QString::fromUtf8(gst_element_factory_get_metadata(factory, GST_ELEMENT_METADATA_DESCRIPTION));
|
||||
if (name == QLatin1String("wasapi2sink") && description == QLatin1String("Stream audio to an audio capture device through WASAPI")) {
|
||||
description.append(QLatin1Char('2'));
|
||||
if (name == "wasapi2sink"_L1 && description == "Stream audio to an audio capture device through WASAPI"_L1) {
|
||||
description.append(u'2');
|
||||
}
|
||||
else if (name == QLatin1String("pipewiresink") && description == QLatin1String("Send video to PipeWire")) {
|
||||
description = QLatin1String("Send audio to PipeWire");
|
||||
else if (name == "pipewiresink"_L1 && description == "Send video to PipeWire"_L1) {
|
||||
description = "Send audio to PipeWire"_L1;
|
||||
}
|
||||
OutputDetails output;
|
||||
output.name = name;
|
||||
output.description = description;
|
||||
if (output.name == QLatin1String(kAutoSink)) output.iconname = QLatin1String("soundcard");
|
||||
else if (output.name == QLatin1String(kALSASink) || output.name == QLatin1String(kOSS4Sink)) output.iconname = QLatin1String("alsa");
|
||||
else if (output.name == QLatin1String(kJackAudioSink)) output.iconname = QLatin1String("jack");
|
||||
else if (output.name == QLatin1String(kPulseSink)) output.iconname = QLatin1String("pulseaudio");
|
||||
else if (output.name == QLatin1String(kA2DPSink) || output.name == QLatin1String(kAVDTPSink)) output.iconname = QLatin1String("bluetooth");
|
||||
else output.iconname = QLatin1String("soundcard");
|
||||
if (output.name == QLatin1String(kAutoSink)) output.iconname = "soundcard"_L1;
|
||||
else if (output.name == QLatin1String(kALSASink) || output.name == QLatin1String(kOSS4Sink)) output.iconname = "alsa"_L1;
|
||||
else if (output.name == QLatin1String(kJackAudioSink)) output.iconname = "jack"_L1;
|
||||
else if (output.name == QLatin1String(kPulseSink)) output.iconname = "pulseaudio"_L1;
|
||||
else if (output.name == QLatin1String(kA2DPSink) || output.name == QLatin1String(kAVDTPSink)) output.iconname = "bluetooth"_L1;
|
||||
else output.iconname = "soundcard"_L1;
|
||||
outputs << output;
|
||||
}
|
||||
}
|
||||
@@ -796,22 +797,22 @@ 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 = QLatin1String("file:////") + url.host() + url.path();
|
||||
QString str = "file:////"_L1 + url.host() + url.path();
|
||||
uri = str.toUtf8();
|
||||
}
|
||||
else if (url.scheme() == QLatin1String("cdda")) {
|
||||
else if (url.scheme() == "cdda"_L1) {
|
||||
QString str;
|
||||
if (url.path().isEmpty()) {
|
||||
str = url.toString();
|
||||
str.remove(str.lastIndexOf(QLatin1Char('a')), 1);
|
||||
str.remove(str.lastIndexOf(u'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(QLatin1Char('/'));
|
||||
QStringList path = url.path().split(u'/');
|
||||
str = QStringLiteral("cdda://%1").arg(path.takeLast());
|
||||
QString device = path.join(QLatin1Char('/'));
|
||||
QString device = path.join(u'/');
|
||||
if (current_pipeline_) current_pipeline_->SetSourceDevice(device);
|
||||
}
|
||||
uri = str.toUtf8();
|
||||
@@ -1030,12 +1031,12 @@ void GstEngine::UpdateScope(const int chunk_length) {
|
||||
|
||||
scope_chunk_++;
|
||||
|
||||
if (buffer_format_.startsWith(QLatin1String("S16LE")) ||
|
||||
buffer_format_.startsWith(QLatin1String("U16LE")) ||
|
||||
buffer_format_.startsWith(QLatin1String("S24LE")) ||
|
||||
buffer_format_.startsWith(QLatin1String("S24_32LE")) ||
|
||||
buffer_format_.startsWith(QLatin1String("S32LE")) ||
|
||||
buffer_format_.startsWith(QLatin1String("F32LE"))
|
||||
if (buffer_format_.startsWith("S16LE"_L1) ||
|
||||
buffer_format_.startsWith("U16LE"_L1) ||
|
||||
buffer_format_.startsWith("S24LE"_L1) ||
|
||||
buffer_format_.startsWith("S24_32LE"_L1) ||
|
||||
buffer_format_.startsWith("S32LE"_L1) ||
|
||||
buffer_format_.startsWith("F32LE"_L1)
|
||||
) {
|
||||
memcpy(dest, source, bytes);
|
||||
}
|
||||
@@ -1102,7 +1103,7 @@ void GstEngine::StreamDiscovered(GstDiscoverer*, GstDiscovererInfo *info, GError
|
||||
GstStructure *gst_structure = gst_caps_get_structure(caps, i);
|
||||
if (!gst_structure) continue;
|
||||
QString mimetype = QString::fromUtf8(gst_structure_get_name(gst_structure));
|
||||
if (!mimetype.isEmpty() && mimetype != QLatin1String("audio/mpeg")) {
|
||||
if (!mimetype.isEmpty() && mimetype != "audio/mpeg"_L1) {
|
||||
engine_metadata.filetype = Song::FiletypeByMimetype(mimetype);
|
||||
if (engine_metadata.filetype == Song::FileType::Unknown) {
|
||||
qLog(Error) << "Unknown mimetype" << mimetype;
|
||||
|
||||
@@ -67,6 +67,8 @@
|
||||
#include "gstenginepipeline.h"
|
||||
#include "gstbufferconsumer.h"
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
namespace {
|
||||
|
||||
constexpr int GST_PLAY_FLAG_VIDEO = 0x00000001;
|
||||
@@ -296,7 +298,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 = QLatin1String("pipeline") + QLatin1Char('-') + QString::number(id()) + QLatin1Char('-') + (name.isEmpty() ? factory_name : name);
|
||||
QString unique_name = "pipeline"_L1 + u'-' + QString::number(id()) + u'-' + (name.isEmpty() ? factory_name : name);
|
||||
|
||||
GstElement *element = gst_element_factory_make(factory_name.toUtf8().constData(), unique_name.toUtf8().constData());
|
||||
if (!element) {
|
||||
@@ -491,7 +493,7 @@ bool GstEnginePipeline::InitAudioBin(QString &error) {
|
||||
if (!device.isEmpty()) {
|
||||
qLog(Debug) << "Setting device" << device << "for" << output_;
|
||||
g_object_set(G_OBJECT(audiosink_), "device", device.toUtf8().constData(), nullptr);
|
||||
if (output_ == QLatin1String(GstEngine::kALSASink) && (device.startsWith(QLatin1String("hw:")) || device.startsWith(QLatin1String("plughw:")))) {
|
||||
if (output_ == QLatin1String(GstEngine::kALSASink) && (device.startsWith("hw:"_L1) || device.startsWith("plughw:"_L1))) {
|
||||
exclusive_mode_ = true;
|
||||
}
|
||||
}
|
||||
@@ -783,7 +785,7 @@ bool GstEnginePipeline::InitAudioBin(QString &error) {
|
||||
// Link replaygain elements if enabled.
|
||||
if (rg_enabled_ && rgvolume && rglimiter && rgconverter) {
|
||||
if (!gst_element_link_many(element_link, rgvolume, rglimiter, rgconverter, nullptr)) {
|
||||
error = QLatin1String("Failed to link replaygain volume, limiter and converter elements.");
|
||||
error = "Failed to link replaygain volume, limiter and converter elements."_L1;
|
||||
return false;
|
||||
}
|
||||
element_link = rgconverter;
|
||||
@@ -796,7 +798,7 @@ bool GstEnginePipeline::InitAudioBin(QString &error) {
|
||||
"format = (string) { F32LE, F64LE }");
|
||||
GstCaps *raw_fp_audio_caps = gst_static_caps_get(&static_raw_fp_audio_caps);
|
||||
if (!gst_element_link_filtered(element_link, volume_ebur128_, raw_fp_audio_caps)) {
|
||||
error = QLatin1String("Failed to link EBU R 128 volume element.");
|
||||
error = "Failed to link EBU R 128 volume element."_L1;
|
||||
return false;
|
||||
}
|
||||
gst_caps_unref(raw_fp_audio_caps);
|
||||
@@ -806,7 +808,7 @@ bool GstEnginePipeline::InitAudioBin(QString &error) {
|
||||
// Link equalizer elements if enabled.
|
||||
if (eq_enabled_ && equalizer_ && equalizer_preamp_) {
|
||||
if (!gst_element_link_many(element_link, equalizer_preamp_, equalizer_, nullptr)) {
|
||||
error = QLatin1String("Failed to link equalizer and equalizer preamp elements.");
|
||||
error = "Failed to link equalizer and equalizer preamp elements."_L1;
|
||||
return false;
|
||||
}
|
||||
element_link = equalizer_;
|
||||
@@ -815,7 +817,7 @@ bool GstEnginePipeline::InitAudioBin(QString &error) {
|
||||
// Link stereo balancer elements if enabled.
|
||||
if (stereo_balancer_enabled_ && audiopanorama_) {
|
||||
if (!gst_element_link(element_link, audiopanorama_)) {
|
||||
error = QLatin1String("Failed to link audio panorama (stereo balancer).");
|
||||
error = "Failed to link audio panorama (stereo balancer)."_L1;
|
||||
return false;
|
||||
}
|
||||
element_link = audiopanorama_;
|
||||
@@ -824,7 +826,7 @@ bool GstEnginePipeline::InitAudioBin(QString &error) {
|
||||
// Link software volume element if enabled.
|
||||
if (volume_enabled_ && volume_sw_) {
|
||||
if (!gst_element_link(element_link, volume_sw_)) {
|
||||
error = QLatin1String("Failed to link software volume.");
|
||||
error = "Failed to link software volume."_L1;
|
||||
return false;
|
||||
}
|
||||
element_link = volume_sw_;
|
||||
@@ -833,7 +835,7 @@ bool GstEnginePipeline::InitAudioBin(QString &error) {
|
||||
// Link fading volume element if enabled.
|
||||
if (fading_enabled_ && volume_fading_) {
|
||||
if (!gst_element_link(element_link, volume_fading_)) {
|
||||
error = QLatin1String("Failed to link fading volume.");
|
||||
error = "Failed to link fading volume."_L1;
|
||||
return false;
|
||||
}
|
||||
element_link = volume_fading_;
|
||||
@@ -843,21 +845,21 @@ bool GstEnginePipeline::InitAudioBin(QString &error) {
|
||||
if (bs2b_enabled_ && bs2b) {
|
||||
qLog(Debug) << "Enabling bs2b";
|
||||
if (!gst_element_link(element_link, bs2b)) {
|
||||
error = QLatin1String("Failed to link bs2b.");
|
||||
error = "Failed to link bs2b."_L1;
|
||||
return false;
|
||||
}
|
||||
element_link = bs2b;
|
||||
}
|
||||
|
||||
if (!gst_element_link(element_link, audiosinkconverter)) {
|
||||
error = QLatin1String("Failed to link audio sink converter.");
|
||||
error = "Failed to link audio sink converter."_L1;
|
||||
return false;
|
||||
}
|
||||
|
||||
{
|
||||
GstCaps *caps = gst_caps_new_empty_simple("audio/x-raw");
|
||||
if (!caps) {
|
||||
error = QLatin1String("Failed to create caps for raw audio.");
|
||||
error = "Failed to create caps for raw audio."_L1;
|
||||
return false;
|
||||
}
|
||||
if (channels_enabled_ && channels_ > 0) {
|
||||
@@ -867,7 +869,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 = QLatin1String("Failed to link audio sink converter to audio sink with filter for ") + output_;
|
||||
error = "Failed to link audio sink converter to audio sink with filter for "_L1 + output_;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -960,7 +962,7 @@ void GstEnginePipeline::ElementAddedCallback(GstBin *bin, GstBin *sub_bin, GstEl
|
||||
const QString element_name = QString::fromUtf8(element_name_char);
|
||||
g_free(element_name_char);
|
||||
|
||||
if (bin != GST_BIN(instance->audiobin_) || element_name == QLatin1String("fake-audio-sink") || GST_ELEMENT(gst_element_get_parent(element)) != instance->audiosink_) return;
|
||||
if (bin != GST_BIN(instance->audiobin_) || element_name == "fake-audio-sink"_L1 || GST_ELEMENT(gst_element_get_parent(element)) != instance->audiosink_) return;
|
||||
|
||||
GstElement *volume = nullptr;
|
||||
if (GST_IS_STREAM_VOLUME(element)) {
|
||||
@@ -1186,10 +1188,10 @@ GstPadProbeReturn GstEnginePipeline::BufferProbeCallback(GstPad *pad, GstPadProb
|
||||
quint64 duration = GST_BUFFER_DURATION(buf);
|
||||
qint64 end_time = static_cast<qint64>(start_time + duration);
|
||||
|
||||
if (format.startsWith(QLatin1String("S16LE"))) {
|
||||
if (format.startsWith("S16LE"_L1)) {
|
||||
instance->logged_unsupported_analyzer_format_ = false;
|
||||
}
|
||||
else if (format.startsWith(QLatin1String("S32LE"))) {
|
||||
else if (format.startsWith("S32LE"_L1)) {
|
||||
|
||||
GstMapInfo map_info;
|
||||
gst_buffer_map(buf, &map_info, GST_MAP_READ);
|
||||
@@ -1210,7 +1212,7 @@ GstPadProbeReturn GstEnginePipeline::BufferProbeCallback(GstPad *pad, GstPadProb
|
||||
instance->logged_unsupported_analyzer_format_ = false;
|
||||
}
|
||||
|
||||
else if (format.startsWith(QLatin1String("F32LE"))) {
|
||||
else if (format.startsWith("F32LE"_L1)) {
|
||||
|
||||
GstMapInfo map_info;
|
||||
gst_buffer_map(buf, &map_info, GST_MAP_READ);
|
||||
@@ -1231,7 +1233,7 @@ GstPadProbeReturn GstEnginePipeline::BufferProbeCallback(GstPad *pad, GstPadProb
|
||||
|
||||
instance->logged_unsupported_analyzer_format_ = false;
|
||||
}
|
||||
else if (format.startsWith(QLatin1String("S24LE"))) {
|
||||
else if (format.startsWith("S24LE"_L1)) {
|
||||
|
||||
GstMapInfo map_info;
|
||||
gst_buffer_map(buf, &map_info, GST_MAP_READ);
|
||||
@@ -1254,7 +1256,7 @@ GstPadProbeReturn GstEnginePipeline::BufferProbeCallback(GstPad *pad, GstPadProb
|
||||
|
||||
instance->logged_unsupported_analyzer_format_ = false;
|
||||
}
|
||||
else if (format.startsWith(QLatin1String("S24_32LE"))) {
|
||||
else if (format.startsWith("S24_32LE"_L1)) {
|
||||
|
||||
GstMapInfo map_info;
|
||||
gst_buffer_map(buf, &map_info, GST_MAP_READ);
|
||||
@@ -1526,7 +1528,7 @@ void GstEnginePipeline::ErrorMessageReceived(GstMessage *msg) {
|
||||
|
||||
{
|
||||
QMutexLocker l(&mutex_redirect_url_);
|
||||
if (!redirect_url_.isEmpty() && debugstr.contains(QLatin1String("A redirect message was posted on the bus and should have been handled by the application."))) {
|
||||
if (!redirect_url_.isEmpty() && debugstr.contains("A redirect message was posted on the bus and should have been handled by the application."_L1)) {
|
||||
// mmssrc posts a message on the bus *and* makes an error message when it wants to do a redirect.
|
||||
// We handle the message, but now we have to ignore the error too.
|
||||
return;
|
||||
@@ -1567,11 +1569,11 @@ void GstEnginePipeline::TagMessageReceived(GstMessage *msg) {
|
||||
|
||||
if (!engine_metadata.title.isEmpty() && engine_metadata.artist.isEmpty() && engine_metadata.album.isEmpty()) {
|
||||
QStringList title_splitted;
|
||||
if (engine_metadata.title.contains(QLatin1String(" - "))) {
|
||||
if (engine_metadata.title.contains(" - "_L1)) {
|
||||
title_splitted = engine_metadata.title.split(QStringLiteral(" - "));
|
||||
}
|
||||
else if (engine_metadata.title.contains(QLatin1Char('~'))) {
|
||||
title_splitted = engine_metadata.title.split(QLatin1Char('~'));
|
||||
else if (engine_metadata.title.contains(u'~')) {
|
||||
title_splitted = engine_metadata.title.split(u'~');
|
||||
}
|
||||
if (!title_splitted.isEmpty() && title_splitted.count() >= 2) {
|
||||
int i = 0;
|
||||
|
||||
@@ -44,6 +44,8 @@
|
||||
|
||||
#include "gststartup.h"
|
||||
|
||||
using namespace Qt::Literals::StringLiterals;
|
||||
|
||||
GThread *GstStartup::kGThread = nullptr;
|
||||
|
||||
gpointer GstStartup::GLibMainLoopThreadFunc(gpointer) {
|
||||
@@ -115,28 +117,28 @@ void GstStartup::SetEnvironment() {
|
||||
// Set plugin root path
|
||||
QString plugin_root_path;
|
||||
# if defined(Q_OS_MACOS)
|
||||
plugin_root_path = QDir::cleanPath(app_path + QLatin1String("/../PlugIns"));
|
||||
plugin_root_path = QDir::cleanPath(app_path + "/../PlugIns"_L1);
|
||||
# elif defined(Q_OS_UNIX)
|
||||
plugin_root_path = QDir::cleanPath(app_path + QLatin1String("/../plugins"));
|
||||
plugin_root_path = QDir::cleanPath(app_path + "/../plugins"_L1);
|
||||
# elif defined(Q_OS_WIN32)
|
||||
plugin_root_path = app_path;
|
||||
# endif
|
||||
|
||||
// Set GIO module path
|
||||
const QString gio_module_path = plugin_root_path + QLatin1String("/gio-modules");
|
||||
const QString gio_module_path = plugin_root_path + "/gio-modules"_L1;
|
||||
|
||||
// Set GStreamer plugin scanner path
|
||||
QString gst_plugin_scanner;
|
||||
# if defined(Q_OS_UNIX)
|
||||
gst_plugin_scanner = plugin_root_path + QLatin1String("/gst-plugin-scanner");
|
||||
gst_plugin_scanner = plugin_root_path + "/gst-plugin-scanner"_L1;
|
||||
# endif
|
||||
|
||||
// Set GStreamer plugin path
|
||||
QString gst_plugin_path;
|
||||
# if defined(Q_OS_WIN32)
|
||||
gst_plugin_path = plugin_root_path + QLatin1String("/gstreamer-plugins");
|
||||
gst_plugin_path = plugin_root_path + "/gstreamer-plugins"_L1;
|
||||
# else
|
||||
gst_plugin_path = plugin_root_path + QLatin1String("/gstreamer");
|
||||
gst_plugin_path = plugin_root_path + "/gstreamer"_L1;
|
||||
# endif
|
||||
|
||||
if (!gio_module_path.isEmpty()) {
|
||||
|
||||
@@ -33,6 +33,8 @@
|
||||
#include "macosdevicefinder.h"
|
||||
#include "enginedevice.h"
|
||||
|
||||
using namespace Qt::Literals::StringLiterals;
|
||||
|
||||
namespace {
|
||||
|
||||
template<typename T>
|
||||
@@ -107,7 +109,7 @@ EngineDeviceList MacOsDeviceFinder::ListDevices() {
|
||||
EngineDevice device;
|
||||
device.value = id;
|
||||
device.description = QString::fromUtf8(CFStringGetCStringPtr(*device_name, CFStringGetSystemEncoding()));
|
||||
if (device.description.isEmpty()) device.description = QLatin1String("Unknown device ") + device.value.toString();
|
||||
if (device.description.isEmpty()) device.description = "Unknown device "_L1 + device.value.toString();
|
||||
device.iconname = device.GuessIconName();
|
||||
device_list.append(device);
|
||||
}
|
||||
|
||||
@@ -41,6 +41,8 @@ using namespace ABI::Windows::Foundation;
|
||||
using namespace ABI::Windows::Foundation::Collections;
|
||||
using namespace ABI::Windows::Devices::Enumeration;
|
||||
|
||||
using namespace Qt::Literals::StringLiterals;
|
||||
|
||||
UWPDeviceFinder::UWPDeviceFinder() : DeviceFinder(QStringLiteral("uwpdevice"), { QStringLiteral("wasapi2sink") }) {}
|
||||
|
||||
namespace {
|
||||
@@ -107,7 +109,7 @@ EngineDeviceList UWPDeviceFinder::ListDevices() {
|
||||
|
||||
{
|
||||
EngineDevice default_device;
|
||||
default_device.description = QStringLiteral("Default device");
|
||||
default_device.description = "Default device"_L1;
|
||||
default_device.iconname = default_device.GuessIconName();
|
||||
devices.append(default_device);
|
||||
}
|
||||
|
||||
@@ -40,6 +40,8 @@
|
||||
#include "vlcengine.h"
|
||||
#include "vlcscopedref.h"
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
VLCEngine::VLCEngine(SharedPtr<TaskManager> task_manager, QObject *parent)
|
||||
: EngineBase(parent),
|
||||
instance_(nullptr),
|
||||
@@ -131,7 +133,7 @@ bool VLCEngine::Play(const bool pause, const quint64 offset_nanosec) {
|
||||
if (!Initialized()) return false;
|
||||
|
||||
// Set audio output
|
||||
if (!output_.isEmpty() && output_ != QLatin1String("auto")) {
|
||||
if (!output_.isEmpty() && output_ != "auto"_L1) {
|
||||
int result = libvlc_audio_output_set(player_, output_.toUtf8().constData());
|
||||
if (result != 0) qLog(Error) << "Failed to set output to" << output_;
|
||||
}
|
||||
@@ -221,8 +223,8 @@ EngineBase::OutputDetailsList VLCEngine::GetOutputsList() const {
|
||||
|
||||
OutputDetailsList outputs;
|
||||
OutputDetails output_auto;
|
||||
output_auto.name = QLatin1String("auto");
|
||||
output_auto.description = QLatin1String("Automatically detected");
|
||||
output_auto.name = "auto"_L1;
|
||||
output_auto.description = "Automatically detected"_L1;
|
||||
outputs << output_auto;
|
||||
|
||||
libvlc_audio_output_t *audio_output_list = libvlc_audio_output_list_get(instance_);
|
||||
@@ -230,12 +232,12 @@ 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 == QLatin1String("auto")) output.iconname = QLatin1String("soundcard");
|
||||
else if ((output.name == QLatin1String("alsa"))||(output.name == QLatin1String("oss"))) output.iconname = QLatin1String("alsa");
|
||||
else if (output.name== QLatin1String("jack")) output.iconname = QLatin1String("jack");
|
||||
else if (output.name == QLatin1String("pulse")) output.iconname = QLatin1String("pulseaudio");
|
||||
else if (output.name == QLatin1String("afile")) output.iconname = QLatin1String("document-new");
|
||||
else output.iconname = QLatin1String("soundcard");
|
||||
if (output.name == "auto"_L1) output.iconname = "soundcard"_L1;
|
||||
else if ((output.name == "alsa"_L1)||(output.name == "oss"_L1)) output.iconname = "alsa"_L1;
|
||||
else if (output.name== "jack"_L1) output.iconname = "jack"_L1;
|
||||
else if (output.name == "pulse"_L1) output.iconname = "pulseaudio"_L1;
|
||||
else if (output.name == "afile"_L1) output.iconname = "document-new"_L1;
|
||||
else output.iconname = "soundcard"_L1;
|
||||
outputs << output;
|
||||
}
|
||||
libvlc_audio_output_list_release(audio_output_list);
|
||||
@@ -252,11 +254,11 @@ bool VLCEngine::ValidOutput(const QString &output) {
|
||||
}
|
||||
|
||||
bool VLCEngine::CustomDeviceSupport(const QString &output) const {
|
||||
return output != QLatin1String("auto");
|
||||
return output != "auto"_L1;
|
||||
}
|
||||
|
||||
bool VLCEngine::ALSADeviceSupport(const QString &output) const {
|
||||
return output == QLatin1String("alsa");
|
||||
return output == "alsa"_L1;
|
||||
}
|
||||
|
||||
bool VLCEngine::ExclusiveModeSupport(const QString &output) const {
|
||||
|
||||
@@ -37,6 +37,8 @@
|
||||
|
||||
#include "enginebase.h"
|
||||
|
||||
using namespace Qt::Literals::StringLiterals;
|
||||
|
||||
struct libvlc_event_t;
|
||||
|
||||
class TaskManager;
|
||||
@@ -67,7 +69,7 @@ class VLCEngine : public EngineBase {
|
||||
|
||||
OutputDetailsList GetOutputsList() const override;
|
||||
bool ValidOutput(const QString &output) override;
|
||||
QString DefaultOutput() const override { return QLatin1String(""); }
|
||||
QString DefaultOutput() const override { return ""_L1; }
|
||||
bool CustomDeviceSupport(const QString &output) const override;
|
||||
bool ALSADeviceSupport(const QString &output) const override;
|
||||
bool ExclusiveModeSupport(const QString &output) const override;
|
||||
|
||||
Reference in New Issue
Block a user