mirror of
https://github.com/strawberrymusicplayer/strawberry
synced 2025-01-31 09:44:50 +01:00
Replace NULL with nullptr
This commit is contained in:
parent
795f95d855
commit
57d9c87de6
@ -447,12 +447,12 @@ SongLoader::Result SongLoader::LoadRemote() {
|
||||
// Connect callbacks
|
||||
GstBus *bus = gst_pipeline_get_bus(GST_PIPELINE(pipeline.get()));
|
||||
CHECKED_GCONNECT(typefind, "have-type", &TypeFound, this);
|
||||
gst_bus_set_sync_handler(bus, BusCallbackSync, this, NULL);
|
||||
gst_bus_set_sync_handler(bus, BusCallbackSync, this, nullptr);
|
||||
gst_bus_add_watch(bus, BusCallback, this);
|
||||
|
||||
// Add a probe to the sink so we can capture the data if it's a playlist
|
||||
GstPad *pad = gst_element_get_static_pad(fakesink, "sink");
|
||||
gst_pad_add_probe(pad, GST_PAD_PROBE_TYPE_BUFFER, &DataReady, this, NULL);
|
||||
gst_pad_add_probe(pad, GST_PAD_PROBE_TYPE_BUFFER, &DataReady, this, nullptr);
|
||||
gst_object_unref(pad);
|
||||
|
||||
QEventLoop loop;
|
||||
|
@ -36,7 +36,7 @@
|
||||
#include "imobiledeviceconnection.h"
|
||||
|
||||
AfcDevice::AfcDevice(const QUrl &url, DeviceLister* lister, const QString &unique_id, DeviceManager *manager, Application *app, int database_id, bool first_time)
|
||||
: GPodDevice(url, lister, unique_id, manager, app, database_id, first_time), transfer_(NULL)
|
||||
: GPodDevice(url, lister, unique_id, manager, app, database_id, first_time), transfer_(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
@ -66,7 +66,7 @@ bool AfcDevice::Init() {
|
||||
void AfcDevice::CopyFinished(bool success) {
|
||||
|
||||
transfer_->deleteLater();
|
||||
transfer_ = NULL;
|
||||
transfer_ = nullptr;
|
||||
|
||||
if (!success) {
|
||||
app_->AddError(tr("An error occurred copying the iTunes database from the device"));
|
||||
@ -147,7 +147,7 @@ bool AfcDevice::CopyToStorage(const CopyJob &job) {
|
||||
void AfcDevice::FinishCopy(bool success) {
|
||||
|
||||
// Temporarily unset the GUID so libgpod doesn't lock the device for syncing
|
||||
itdb_device_set_sysinfo(db_->device, "FirewireGuid", NULL);
|
||||
itdb_device_set_sysinfo(db_->device, "FirewireGuid", nullptr);
|
||||
|
||||
GPodDevice::FinishCopy(success);
|
||||
|
||||
@ -163,7 +163,7 @@ void AfcDevice::FinaliseDatabase() {
|
||||
|
||||
// Copy the files back to the iPod
|
||||
// No need to start another thread since we're already in the organiser thread
|
||||
AfcTransfer transfer(url_.host(), local_path_, NULL, shared_from_this());
|
||||
AfcTransfer transfer(url_.host(), local_path_, nullptr, shared_from_this());
|
||||
|
||||
itdb_start_sync(db_);
|
||||
bool success = transfer.CopyToDevice(connection_.get());
|
||||
|
@ -84,7 +84,7 @@ void CddaSongLoader::LoadSongs() {
|
||||
g_object_set(cdda_, "device", g_strdup(url_.path().toLocal8Bit().constData()), nullptr);
|
||||
}
|
||||
if (g_object_class_find_property (G_OBJECT_GET_CLASS (cdda_), "paranoia-mode")) {
|
||||
g_object_set (cdda_, "paranoia-mode", 0, NULL);
|
||||
g_object_set (cdda_, "paranoia-mode", 0, nullptr);
|
||||
}
|
||||
|
||||
// Change the element's state to ready and paused, to be able to query it
|
||||
@ -123,8 +123,8 @@ void CddaSongLoader::LoadSongs() {
|
||||
gst_tag_register_musicbrainz_tags();
|
||||
|
||||
GstElement *pipeline = gst_pipeline_new("pipeline");
|
||||
GstElement *sink = gst_element_factory_make ("fakesink", NULL);
|
||||
gst_bin_add_many (GST_BIN (pipeline), cdda_, sink, NULL);
|
||||
GstElement *sink = gst_element_factory_make ("fakesink", nullptr);
|
||||
gst_bin_add_many (GST_BIN (pipeline), cdda_, sink, nullptr);
|
||||
gst_element_link (cdda_, sink);
|
||||
gst_element_set_state(pipeline, GST_STATE_READY);
|
||||
gst_element_set_state(pipeline, GST_STATE_PAUSED);
|
||||
|
@ -104,10 +104,10 @@ QVariant iMobileDeviceConnection::GetProperty(const QString &property, const QSt
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
plist_t node = NULL;
|
||||
plist_t node = nullptr;
|
||||
QByteArray domain_ascii = domain.toUtf8();
|
||||
const char *d = domain_ascii.isEmpty() ? NULL : domain_ascii.constData();
|
||||
//const char *d = domain.isEmpty() ? NULL : "com.apple.disk_usage";
|
||||
const char *d = domain_ascii.isEmpty() ? nullptr : domain_ascii.constData();
|
||||
//const char *d = domain.isEmpty() ? nullptr : "com.apple.disk_usage";
|
||||
lockdownd_get_value(lockdown, d, property.toUtf8().constData(), &node);
|
||||
lockdownd_client_free(lockdown);
|
||||
|
||||
@ -141,14 +141,14 @@ QStringList iMobileDeviceConnection::ReadDirectory(const QString &path, QDir::Fi
|
||||
|
||||
if (!afc_) return QStringList();
|
||||
|
||||
char **list = NULL;
|
||||
char **list = nullptr;
|
||||
afc_error_t err = afc_read_directory(afc_, path.toUtf8().constData(), &list);
|
||||
if (err != AFC_E_SUCCESS || !list) {
|
||||
return QStringList();
|
||||
}
|
||||
|
||||
QStringList ret;
|
||||
for (char **p = list ; *p != NULL ; ++p) {
|
||||
for (char **p = list ; *p != nullptr ; ++p) {
|
||||
QString filename = QString::fromUtf8(*p);
|
||||
free(*p);
|
||||
|
||||
@ -184,14 +184,14 @@ QString iMobileDeviceConnection::GetFileInfo(const QString &path, const QString
|
||||
if (!afc_) return QString();
|
||||
|
||||
QString ret;
|
||||
char **infolist = NULL;
|
||||
char **infolist = nullptr;
|
||||
afc_error_t err = afc_get_file_info(afc_, path.toUtf8().constData(), &infolist);
|
||||
if (err != AFC_E_SUCCESS || !infolist) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
QString last_key;
|
||||
for (char **p = infolist ; *p != NULL ; ++p) {
|
||||
for (char **p = infolist ; *p != nullptr ; ++p) {
|
||||
if (last_key.isNull()) {
|
||||
last_key = QString::fromUtf8(*p);
|
||||
}
|
||||
|
@ -307,7 +307,7 @@ bool GstEnginePipeline::InitAudioBin() {
|
||||
// Add a data probe on the src pad of the audioconvert element for our scope.
|
||||
// We do it here because we want pre-equalized and pre-volume samples so that our visualization are not be affected by them.
|
||||
pad = gst_element_get_static_pad(event_probe, "src");
|
||||
gst_pad_add_probe(pad, GST_PAD_PROBE_TYPE_EVENT_UPSTREAM, &EventHandoffCallback, this, NULL);
|
||||
gst_pad_add_probe(pad, GST_PAD_PROBE_TYPE_EVENT_UPSTREAM, &EventHandoffCallback, this, nullptr);
|
||||
gst_object_unref(pad);
|
||||
|
||||
// Configure the fakesink properly
|
||||
@ -449,7 +449,7 @@ bool GstEnginePipeline::InitFromUrl(const QByteArray &stream_url, const QUrl ori
|
||||
CHECKED_GCONNECT(G_OBJECT(pipeline_), "notify::source", &SourceSetupCallback, this);
|
||||
|
||||
// Setting up a discoverer
|
||||
discoverer_ = gst_discoverer_new(kDiscoveryTimeoutS * GST_SECOND, NULL);
|
||||
discoverer_ = gst_discoverer_new(kDiscoveryTimeoutS * GST_SECOND, nullptr);
|
||||
if (discoverer_) {
|
||||
CHECKED_GCONNECT(G_OBJECT(discoverer_), "discovered", &StreamDiscovered, this);
|
||||
CHECKED_GCONNECT(G_OBJECT(discoverer_), "finished", &StreamDiscoveryFinished, this);
|
||||
@ -459,7 +459,7 @@ bool GstEnginePipeline::InitFromUrl(const QByteArray &stream_url, const QUrl ori
|
||||
if (!InitAudioBin()) return false;
|
||||
|
||||
// Set playbin's sink to be our costum audio-sink.
|
||||
g_object_set(GST_OBJECT(pipeline_), "audio-sink", audiobin_, NULL);
|
||||
g_object_set(GST_OBJECT(pipeline_), "audio-sink", audiobin_, nullptr);
|
||||
pipeline_is_connected_ = true;
|
||||
|
||||
return true;
|
||||
@ -550,7 +550,7 @@ void GstEnginePipeline::StreamStatusMessageReceived(GstMessage *msg) {
|
||||
const GValue *val = gst_message_get_stream_status_object(msg);
|
||||
if (G_VALUE_TYPE(val) == GST_TYPE_TASK) {
|
||||
GstTask *task = static_cast<GstTask*>(g_value_get_object(val));
|
||||
gst_task_set_enter_callback(task, &TaskEnterCallback, this, NULL);
|
||||
gst_task_set_enter_callback(task, &TaskEnterCallback, this, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -101,7 +101,7 @@ QString Chromaprinter::CreateFingerprint() {
|
||||
"format", G_TYPE_STRING, "S16LE",
|
||||
"channels", G_TYPE_INT, kDecodeChannels,
|
||||
"rate", G_TYPE_INT, kDecodeRate,
|
||||
NULL);
|
||||
nullptr);
|
||||
gst_element_link_filtered(resample, sink, caps);
|
||||
gst_caps_unref(caps);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user