Formatting
This commit is contained in:
@@ -83,7 +83,7 @@ void CddaSongLoader::LoadSongs() {
|
||||
if (!url_.isEmpty()) {
|
||||
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")) {
|
||||
if (g_object_class_find_property(G_OBJECT_GET_CLASS(cdda_), "paranoia-mode")) {
|
||||
g_object_set(cdda_, "paranoia-mode", 0, nullptr);
|
||||
}
|
||||
|
||||
@@ -144,9 +144,9 @@ void CddaSongLoader::LoadSongs() {
|
||||
gst_tag_register_musicbrainz_tags();
|
||||
|
||||
GstElement *pipeline = gst_pipeline_new("pipeline");
|
||||
GstElement *sink = gst_element_factory_make ("fakesink", nullptr);
|
||||
gst_bin_add_many (GST_BIN (pipeline), cdda_, sink, nullptr);
|
||||
gst_element_link (cdda_, sink);
|
||||
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);
|
||||
|
||||
@@ -168,7 +168,7 @@ void CddaSongLoader::LoadSongs() {
|
||||
// Handle TOC message: get tracks duration
|
||||
if (msg_toc) {
|
||||
GstToc *toc = nullptr;
|
||||
gst_message_parse_toc (msg_toc, &toc, nullptr);
|
||||
gst_message_parse_toc(msg_toc, &toc, nullptr);
|
||||
if (toc) {
|
||||
GList *entries = gst_toc_get_entries(toc);
|
||||
if (entries && static_cast<guint>(songs.size()) <= g_list_length(entries)) {
|
||||
@@ -177,7 +177,7 @@ void CddaSongLoader::LoadSongs() {
|
||||
GstTocEntry *entry = static_cast<GstTocEntry*>(node->data);
|
||||
quint64 duration = 0;
|
||||
gint64 start = 0, stop = 0;
|
||||
if (gst_toc_entry_get_start_stop_times (entry, &start, &stop)) duration = stop - start;
|
||||
if (gst_toc_entry_get_start_stop_times(entry, &start, &stop)) duration = stop - start;
|
||||
songs[i++].set_length_nanosec(duration);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ DeviceDatabaseBackend::DeviceList DeviceDatabaseBackend::GetAllDevices() {
|
||||
int schema_version = q.value(5).toInt();
|
||||
dev.transcode_mode_ = MusicStorage::TranscodeMode(q.value(6).toInt());
|
||||
dev.transcode_format_ = Song::FileType(q.value(7).toInt());
|
||||
if (schema_version < kDeviceSchemaVersion) { // Device is using old schema, drop it.
|
||||
if (schema_version < kDeviceSchemaVersion) { // Device is using old schema, drop it.
|
||||
old_devices << dev;
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -84,10 +84,8 @@ class DeviceInfo : public SimpleTreeItem<DeviceInfo> {
|
||||
// Sometimes the same device is discovered more than once. In this case the device will have multiple "backends".
|
||||
struct Backend {
|
||||
explicit Backend(DeviceLister *lister = nullptr, const QString &id = QString())
|
||||
:
|
||||
lister_(lister),
|
||||
unique_id_(id)
|
||||
{}
|
||||
: lister_(lister),
|
||||
unique_id_(id) {}
|
||||
|
||||
DeviceLister *lister_; // nullptr if not physically connected
|
||||
QString unique_id_;
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
# include "gpoddevice.h"
|
||||
#endif
|
||||
#ifdef HAVE_GIO
|
||||
# include "giolister.h" // Needs to be last because of #undef signals.
|
||||
# include "giolister.h" // Needs to be last because of #undef signals.
|
||||
#endif
|
||||
|
||||
const int DeviceManager::kDeviceIconSize = 32;
|
||||
|
||||
@@ -55,4 +55,4 @@ class DeviceStateFilterModel : public QSortFilterProxyModel {
|
||||
DeviceManager::State state_;
|
||||
};
|
||||
|
||||
#endif // DEVICESTATEFILTERMODEL_H
|
||||
#endif // DEVICESTATEFILTERMODEL_H
|
||||
|
||||
@@ -43,8 +43,9 @@ class DeviceLister;
|
||||
|
||||
FilesystemDevice::FilesystemDevice(const QUrl &url, DeviceLister *lister, const QString &unique_id, DeviceManager *manager, Application *app, const int database_id, const bool first_time, QObject *parent)
|
||||
: FilesystemMusicStorage(url.toLocalFile()),
|
||||
ConnectedDevice(url, lister, unique_id, manager, app, database_id, first_time, parent),
|
||||
watcher_(new CollectionWatcher(Song::Source_Device)), watcher_thread_(new QThread(this)) {
|
||||
ConnectedDevice(url, lister, unique_id, manager, app, database_id, first_time, parent),
|
||||
watcher_(new CollectionWatcher(Song::Source_Device)),
|
||||
watcher_thread_(new QThread(this)) {
|
||||
|
||||
watcher_->moveToThread(watcher_thread_);
|
||||
watcher_thread_->start(QThread::IdlePriority);
|
||||
|
||||
@@ -42,7 +42,7 @@ class DeviceManager;
|
||||
class FilesystemDevice : public ConnectedDevice, public virtual FilesystemMusicStorage {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
public:
|
||||
Q_INVOKABLE FilesystemDevice(const QUrl &url, DeviceLister *lister, const QString &unique_id, DeviceManager *manager, Application *app, const int database_id, const bool first_time, QObject *parent = nullptr);
|
||||
~FilesystemDevice() override;
|
||||
|
||||
@@ -55,10 +55,10 @@ public:
|
||||
void Close() override;
|
||||
void ExitFinished();
|
||||
|
||||
private:
|
||||
private:
|
||||
CollectionWatcher *watcher_;
|
||||
QThread *watcher_thread_;
|
||||
QList<QObject*> wait_for_exit_;
|
||||
};
|
||||
|
||||
#endif // FILESYSTEMDEVICE_H
|
||||
#endif // FILESYSTEMDEVICE_H
|
||||
|
||||
@@ -77,7 +77,7 @@ class GioLister : public DeviceLister {
|
||||
|
||||
private:
|
||||
struct DeviceInfo {
|
||||
DeviceInfo() : drive_removable(false), filesystem_size(0),filesystem_free(0), invalid_enclosing_mount(false) {}
|
||||
DeviceInfo() : drive_removable(false), filesystem_size(0), filesystem_free(0), invalid_enclosing_mount(false) {}
|
||||
|
||||
QString unique_id() const;
|
||||
bool is_suitable() const;
|
||||
|
||||
@@ -101,4 +101,4 @@ class GPodDevice : public ConnectedDevice, public virtual MusicStorage {
|
||||
QList<std::shared_ptr<QTemporaryFile>> cover_files_;
|
||||
};
|
||||
|
||||
#endif // GPODDEVICE_H
|
||||
#endif // GPODDEVICE_H
|
||||
|
||||
Reference in New Issue
Block a user