diff --git a/ext/gstmoodbar/gstfastspectrum.cpp b/ext/gstmoodbar/gstfastspectrum.cpp index 55a9ad3df..01f03576a 100644 --- a/ext/gstmoodbar/gstfastspectrum.cpp +++ b/ext/gstmoodbar/gstfastspectrum.cpp @@ -115,7 +115,7 @@ static void gst_fastspectrum_init (GstFastSpectrum * spectrum) { spectrum->interval = DEFAULT_INTERVAL; spectrum->bands = DEFAULT_BANDS; - spectrum->channel_data_initialised = false; + spectrum->channel_data_initialized = false; g_mutex_init (&spectrum->lock); @@ -137,14 +137,14 @@ static void gst_fastspectrum_alloc_channel_data (GstFastSpectrum * spectrum) { QMutexLocker l(klass->fftw_lock); spectrum->plan = fftw_plan_dft_r2c_1d(nfft, spectrum->fft_input, spectrum->fft_output, FFTW_ESTIMATE); } - spectrum->channel_data_initialised = true; + spectrum->channel_data_initialized = true; } static void gst_fastspectrum_free_channel_data (GstFastSpectrum * spectrum) { GstFastSpectrumClass* klass = reinterpret_cast(G_OBJECT_GET_CLASS(spectrum)); - if (spectrum->channel_data_initialised) { + if (spectrum->channel_data_initialized) { { QMutexLocker l(klass->fftw_lock); fftw_destroy_plan(spectrum->plan); @@ -154,7 +154,7 @@ static void gst_fastspectrum_free_channel_data (GstFastSpectrum * spectrum) { delete[] spectrum->input_ring_buffer; delete[] spectrum->spect_magnitude; - spectrum->channel_data_initialised = false; + spectrum->channel_data_initialized = false; } } @@ -422,7 +422,7 @@ static GstFlowReturn gst_fastspectrum_transform_ip (GstBaseTransform *trans, Gst /* If we don't have a FFT context yet (or it was reset due to parameter * changes) get one and allocate memory for everything */ - if (!spectrum->channel_data_initialised) { + if (!spectrum->channel_data_initialized) { GST_DEBUG_OBJECT (spectrum, "allocating for bands %u", bands); gst_fastspectrum_alloc_channel_data (spectrum); diff --git a/ext/gstmoodbar/gstfastspectrum.h b/ext/gstmoodbar/gstfastspectrum.h index f0ad24cd1..cb28051d6 100644 --- a/ext/gstmoodbar/gstfastspectrum.h +++ b/ext/gstmoodbar/gstfastspectrum.h @@ -65,7 +65,7 @@ struct GstFastSpectrum { GstClockTime message_ts; /* starttime for next message */ /* */ - bool channel_data_initialised; + bool channel_data_initialized; double* input_ring_buffer; double* fft_input; fftw_complex* fft_output; diff --git a/ext/libstrawberry-common/core/lazy.h b/ext/libstrawberry-common/core/lazy.h index 90f1f7394..2f0e71636 100644 --- a/ext/libstrawberry-common/core/lazy.h +++ b/ext/libstrawberry-common/core/lazy.h @@ -34,25 +34,25 @@ class Lazy { Lazy() : init_([]() { return new T; }) {} T* get() const { - CheckInitialised(); + CheckInitialized(); return ptr_.get(); } typename std::add_lvalue_reference::type operator*() const { - CheckInitialised(); + CheckInitialized(); return *ptr_; } T* operator->() const { return get(); } - // Returns true if the object is not yet initialised. + // Returns true if the object is not yet initialized. explicit operator bool() const { return ptr_; } - // Deletes the underlying object and will re-run the initialisation function if the object is requested again. + // Deletes the underlying object and will re-run the initialization function if the object is requested again. void reset() { ptr_.reset(); } private: - void CheckInitialised() const { + void CheckInitialized() const { if (!ptr_) { ptr_.reset(init_(), [](T*obj) { obj->deleteLater(); }); } diff --git a/src/analyzer/analyzerbase.cpp b/src/analyzer/analyzerbase.cpp index e229a1524..769a756aa 100644 --- a/src/analyzer/analyzerbase.cpp +++ b/src/analyzer/analyzerbase.cpp @@ -40,7 +40,7 @@ // INSTRUCTIONS Base2D // 1. do anything that depends on height() in init(), Base2D will call it before you are shown -// 2. otherwise you can use the constructor to initialise things +// 2. otherwise you can use the constructor to initialize things // 3. reimplement analyze(), and paint to canvas(), Base2D will update the widget when you return control to it // 4. if you want to manipulate the scope, reimplement transform() // 5. for convenience are pre-included diff --git a/src/analyzer/analyzercontainer.cpp b/src/analyzer/analyzercontainer.cpp index fdd09bbab..852e85568 100644 --- a/src/analyzer/analyzercontainer.cpp +++ b/src/analyzer/analyzercontainer.cpp @@ -136,7 +136,7 @@ void AnalyzerContainer::ChangeAnalyzer(int id) { QObject *instance = analyzer_types_[id]->newInstance(Q_ARG(QWidget*, this)); if (!instance) { - qLog(Warning) << "Couldn't initialise a new" << analyzer_types_[id]->className(); + qLog(Warning) << "Couldn't initialize a new" << analyzer_types_[id]->className(); return; } diff --git a/src/analyzer/rainbowanalyzer.h b/src/analyzer/rainbowanalyzer.h index 9d0331c9f..55707fb52 100644 --- a/src/analyzer/rainbowanalyzer.h +++ b/src/analyzer/rainbowanalyzer.h @@ -92,7 +92,7 @@ class RainbowAnalyzer : public Analyzer::Base { } private: - // "constants" that get initialised in the constructor + // "constants" that get initialized in the constructor float band_scale_[kRainbowBands]; QPen colors_[kRainbowBands]; diff --git a/src/collection/collectionmodel.cpp b/src/collection/collectionmodel.cpp index 4af1f6601..18ad7a378 100644 --- a/src/collection/collectionmodel.cpp +++ b/src/collection/collectionmodel.cpp @@ -817,7 +817,7 @@ CollectionModel::QueryResult CollectionModel::RunQuery(CollectionItem *parent) { int child_level = parent == root_ ? 0 : parent->container_level + 1; GroupBy child_type = child_level >= 3 ? GroupBy_None : group_by_[child_level]; - // Initialise the query. child_type says what type of thing we want (artists, songs, etc.) + // Initialize the query. child_type says what type of thing we want (artists, songs, etc.) CollectionQuery q(query_options_); InitQuery(child_type, &q); @@ -1133,7 +1133,7 @@ CollectionItem *CollectionModel::InitItem(const GroupBy type, const bool signal, if (signal) beginInsertRows(ItemToIndex(parent), parent->children.count(), parent->children.count()); - // Initialise the item depending on what type it's meant to be + // Initialize the item depending on what type it's meant to be CollectionItem *item = new CollectionItem(item_type, parent); item->compilation_artist_node_ = nullptr; item->container_level = container_level; diff --git a/src/core/database.cpp b/src/core/database.cpp index 334625ac6..752dbfcc9 100644 --- a/src/core/database.cpp +++ b/src/core/database.cpp @@ -202,7 +202,7 @@ QSqlDatabase Database::Connect() { UpdateMainSchema(&db); } - // We might have to initialise the schema in some attached databases now, if they were deleted and don't match up with the main schema version. + // We might have to initialize the schema in some attached databases now, if they were deleted and don't match up with the main schema version. for (const QString &key : attached_databases_.keys()) { if (attached_databases_[key].is_temporary_ && attached_databases_[key].schema_.isEmpty()) continue; diff --git a/src/core/mainwindow.cpp b/src/core/mainwindow.cpp index 3767fcced..3eb41d55a 100644 --- a/src/core/mainwindow.cpp +++ b/src/core/mainwindow.cpp @@ -321,7 +321,7 @@ MainWindow::MainWindow(Application *app, SystemTrayIcon *tray_icon, OSDBase *osd connect(app, SIGNAL(ErrorAdded(QString)), SLOT(ShowErrorDialog(QString))); connect(app, SIGNAL(SettingsDialogRequested(SettingsDialog::Page)), SLOT(OpenSettingsDialogAtPage(SettingsDialog::Page))); - // Initialise the UI + // Initialize the UI ui_->setupUi(this); album_cover_choice_controller_->Init(app); @@ -330,7 +330,7 @@ MainWindow::MainWindow(Application *app, SystemTrayIcon *tray_icon, OSDBase *osd context_view_->Init(app_, collection_view_->view(), album_cover_choice_controller_); ui_->widget_playing->Init(app_, album_cover_choice_controller_); - // Initialise the search widget + // Initialize the search widget StyleHelper::setBaseColor(palette().color(QPalette::Highlight).darker()); // Add tabs to the fancy tab widget @@ -363,8 +363,8 @@ MainWindow::MainWindow(Application *app, SystemTrayIcon *tray_icon, OSDBase *osd track_slider_timer_->setInterval(kTrackSliderUpdateTimeMs); connect(track_slider_timer_, SIGNAL(timeout()), SLOT(UpdateTrackSliderPosition())); - // Start initialising the player - qLog(Debug) << "Initialising player"; + // Start initializing the player + qLog(Debug) << "Initializing player"; app_->player()->SetAnalyzer(ui_->analyzer); app_->player()->SetEqualizer(equalizer_.get()); app_->player()->Init(); diff --git a/src/core/player.cpp b/src/core/player.cpp index ecf497219..1326f8e71 100644 --- a/src/core/player.cpp +++ b/src/core/player.cpp @@ -166,7 +166,7 @@ void Player::Init() { CreateEngine(enginetype); } - if (!engine_->Init()) { qFatal("Error initialising audio engine"); } + if (!engine_->Init()) { qFatal("Error initializing audio engine"); } analyzer_->SetEngine(engine_.get()); diff --git a/src/device/devicelister.h b/src/device/devicelister.h index ea6341edb..dd99139a7 100644 --- a/src/device/devicelister.h +++ b/src/device/devicelister.h @@ -40,7 +40,7 @@ class DeviceLister : public QObject { DeviceLister(); ~DeviceLister() override; - // Tries to start the thread and initialise the engine. This object will be moved to the new thread. + // Tries to start the thread and initialize the engine. This object will be moved to the new thread. void Start(); virtual void ExitAsync(); diff --git a/src/device/mtpdevice.cpp b/src/device/mtpdevice.cpp index 21eb66a07..bc2546d94 100644 --- a/src/device/mtpdevice.cpp +++ b/src/device/mtpdevice.cpp @@ -47,7 +47,7 @@ class DeviceLister; class DeviceManager; -bool MtpDevice::sInitialisedLibMTP = false; +bool MtpDevice::sInitializedLibMTP = false; MtpDevice::MtpDevice(const QUrl &url, DeviceLister *lister, const QString &unique_id, DeviceManager *manager, Application *app, int database_id, bool first_time) : ConnectedDevice(url, lister, unique_id, manager, app, database_id, first_time), @@ -55,9 +55,9 @@ MtpDevice::MtpDevice(const QUrl &url, DeviceLister *lister, const QString &uniqu loader_thread_(nullptr), closing_(false) { - if (!sInitialisedLibMTP) { + if (!sInitializedLibMTP) { LIBMTP_Init(); - sInitialisedLibMTP = true; + sInitializedLibMTP = true; } } diff --git a/src/device/mtpdevice.h b/src/device/mtpdevice.h index ae73624fc..3c6ef92b8 100644 --- a/src/device/mtpdevice.h +++ b/src/device/mtpdevice.h @@ -80,7 +80,7 @@ class MtpDevice : public ConnectedDevice { int GetCapacity(LIBMTP_mtpdevice_struct* device); private: - static bool sInitialisedLibMTP; + static bool sInitializedLibMTP; MtpLoader *loader_; QThread *loader_thread_; diff --git a/src/engine/alsadevicefinder.cpp b/src/engine/alsadevicefinder.cpp index 89492f38e..5e589f764 100644 --- a/src/engine/alsadevicefinder.cpp +++ b/src/engine/alsadevicefinder.cpp @@ -35,8 +35,7 @@ #include "alsadevicefinder.h" AlsaDeviceFinder::AlsaDeviceFinder() - : DeviceFinder("alsa", {"alsa","alsasink"}) { -} + : DeviceFinder("alsa", {"alsa","alsasink"}) {} QList AlsaDeviceFinder::ListDevices() { @@ -45,7 +44,7 @@ QList AlsaDeviceFinder::ListDevices() { snd_pcm_stream_name(SND_PCM_STREAM_PLAYBACK); int card = -1; - snd_ctl_card_info_t* cardinfo; + snd_ctl_card_info_t *cardinfo = nullptr; snd_ctl_card_info_alloca(&cardinfo); while (true) { @@ -59,7 +58,7 @@ QList AlsaDeviceFinder::ListDevices() { char str[32]; snprintf(str, sizeof(str) - 1, "hw:%d", card); - snd_ctl_t* handle; + snd_ctl_t *handle = nullptr; result = snd_ctl_open(&handle, str, 0); if (result < 0) { qLog(Error) << "Unable to open soundcard" << card << ":" << snd_strerror(result); @@ -75,7 +74,7 @@ QList AlsaDeviceFinder::ListDevices() { } int dev = -1; - snd_pcm_info_t* pcminfo; + snd_pcm_info_t *pcminfo = nullptr; snd_pcm_info_alloca(&pcminfo); while (true) { diff --git a/src/engine/alsadevicefinder.h b/src/engine/alsadevicefinder.h index 06fa2d4fb..c23c87c04 100644 --- a/src/engine/alsadevicefinder.h +++ b/src/engine/alsadevicefinder.h @@ -30,7 +30,7 @@ class AlsaDeviceFinder : public DeviceFinder { public: explicit AlsaDeviceFinder(); - bool Initialise() override { return true; } + bool Initialize() override { return true; } QList ListDevices() override; }; diff --git a/src/engine/devicefinder.h b/src/engine/devicefinder.h index dc30622df..4870c399f 100644 --- a/src/engine/devicefinder.h +++ b/src/engine/devicefinder.h @@ -47,7 +47,7 @@ class DeviceFinder { void add_output(const QString output) { outputs_.append(output); } // Does any necessary setup, returning false if this DeviceFinder cannot be used. - virtual bool Initialise() = 0; + virtual bool Initialize() = 0; // Returns a list of available devices. virtual QList ListDevices() = 0; diff --git a/src/engine/devicefinders.cpp b/src/engine/devicefinders.cpp index efe59e424..c2da336b9 100644 --- a/src/engine/devicefinders.cpp +++ b/src/engine/devicefinders.cpp @@ -70,8 +70,8 @@ void DeviceFinders::Init() { #endif for (DeviceFinder *finder : device_finders) { - if (!finder->Initialise()) { - qLog(Warning) << "Failed to initialise DeviceFinder for" << finder->name(); + if (!finder->Initialize()) { + qLog(Warning) << "Failed to initialize DeviceFinder for" << finder->name(); delete finder; continue; } diff --git a/src/engine/directsounddevicefinder.h b/src/engine/directsounddevicefinder.h index 4b03f4e13..d85e8d5b6 100644 --- a/src/engine/directsounddevicefinder.h +++ b/src/engine/directsounddevicefinder.h @@ -31,7 +31,7 @@ class DirectSoundDeviceFinder : public DeviceFinder { public: explicit DirectSoundDeviceFinder(); - virtual bool Initialise() { return true; } + virtual bool Initialize() { return true; } virtual QList ListDevices(); private: diff --git a/src/engine/gstengine.cpp b/src/engine/gstengine.cpp index 4e60d6ba4..85c7c57d6 100644 --- a/src/engine/gstengine.cpp +++ b/src/engine/gstengine.cpp @@ -99,7 +99,7 @@ GstEngine::GstEngine(TaskManager *task_manager) GstEngine::~GstEngine() { - EnsureInitialised(); + EnsureInitialized(); current_pipeline_.reset(); if (latest_buffer_) { @@ -136,7 +136,7 @@ Engine::State GstEngine::state() const { void GstEngine::StartPreloading(const QUrl &stream_url, const QUrl &original_url, const bool force_stop_at_end, const qint64 beginning_nanosec, const qint64 end_nanosec) { - EnsureInitialised(); + EnsureInitialized(); QByteArray gst_url = FixupUrl(stream_url); @@ -148,7 +148,7 @@ void GstEngine::StartPreloading(const QUrl &stream_url, const QUrl &original_url bool GstEngine::Load(const QUrl &stream_url, const QUrl &original_url, Engine::TrackChangeFlags change, const bool force_stop_at_end, const quint64 beginning_nanosec, const qint64 end_nanosec) { - EnsureInitialised(); + EnsureInitialized(); Engine::Base::Load(stream_url, original_url, change, force_stop_at_end, beginning_nanosec, end_nanosec); @@ -186,7 +186,7 @@ bool GstEngine::Load(const QUrl &stream_url, const QUrl &original_url, Engine::T bool GstEngine::Play(const quint64 offset_nanosec) { - EnsureInitialised(); + EnsureInitialized(); if (!current_pipeline_ || current_pipeline_->is_buffering()) return false; @@ -344,7 +344,7 @@ const Engine::Scope &GstEngine::scope(const int chunk_length) { EngineBase::OutputDetailsList GstEngine::GetOutputsList() const { - const_cast(this)->EnsureInitialised(); + const_cast(this)->EnsureInitialized(); EngineBase::OutputDetailsList ret; @@ -369,7 +369,7 @@ EngineBase::OutputDetailsList GstEngine::GetOutputsList() const { bool GstEngine::ValidOutput(const QString &output) { - EnsureInitialised(); + EnsureInitialized(); PluginDetailsList plugins = GetPluginList("Sink/Audio"); for (const PluginDetails &plugin : plugins) { @@ -645,7 +645,7 @@ void GstEngine::BufferingFinished() { GstEngine::PluginDetailsList GstEngine::GetPluginList(const QString &classname) const { - const_cast(this)->EnsureInitialised(); + const_cast(this)->EnsureInitialized(); PluginDetailsList ret; @@ -672,7 +672,7 @@ GstEngine::PluginDetailsList GstEngine::GetPluginList(const QString &classname) QByteArray GstEngine::FixupUrl(const QUrl &url) { - EnsureInitialised(); + EnsureInitialized(); QByteArray uri; @@ -749,7 +749,7 @@ void GstEngine::StopTimers() { std::shared_ptr GstEngine::CreatePipeline() { - EnsureInitialised(); + EnsureInitialized(); std::shared_ptr ret(new GstEnginePipeline(this)); ret->set_output_device(output_, device_); diff --git a/src/engine/gstengine.h b/src/engine/gstengine.h index 226ca06e9..2cd2790fd 100644 --- a/src/engine/gstengine.h +++ b/src/engine/gstengine.h @@ -85,7 +85,7 @@ class GstEngine : public Engine::Base, public GstBufferConsumer { bool ALSADeviceSupport(const QString &output) override; void SetStartup(GstStartup *gst_startup) { gst_startup_ = gst_startup; } - void EnsureInitialised() { gst_startup_->EnsureInitialised(); } + void EnsureInitialized() { gst_startup_->EnsureInitialized(); } GstElement *CreateElement(const QString &factoryName, GstElement *bin = nullptr, const bool showerror = true); void ConsumeBuffer(GstBuffer *buffer, const int pipeline_id, const QString &format) override; diff --git a/src/engine/gstenginepipeline.cpp b/src/engine/gstenginepipeline.cpp index 28922aca2..c1cf70059 100644 --- a/src/engine/gstenginepipeline.cpp +++ b/src/engine/gstenginepipeline.cpp @@ -92,7 +92,7 @@ GstEnginePipeline::GstEnginePipeline(GstEngine *engine) next_end_offset_nanosec_(-1), ignore_next_seek_(false), ignore_tags_(false), - pipeline_is_initialised_(false), + pipeline_is_initialized_(false), pipeline_is_connected_(false), pending_seek_nanosec_(-1), last_known_position_ns_(0), @@ -480,7 +480,7 @@ GstPadProbeReturn GstEnginePipeline::EventHandoffCallback(GstPad*, GstPadProbeIn } -void GstEnginePipeline::SourceSetupCallback(GstPlayBin *bin, GParamSpec *, gpointer self) { +void GstEnginePipeline::SourceSetupCallback(GstPlayBin *bin, GParamSpec*, gpointer self) { GstEnginePipeline *instance = reinterpret_cast(self); @@ -537,7 +537,7 @@ void GstEnginePipeline::NewPadCallback(GstElement*, GstPad *pad, gpointer self) gst_pad_add_probe(pad, static_cast(GST_PAD_PROBE_TYPE_BUFFER | GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM | GST_PAD_PROBE_TYPE_EVENT_FLUSH), PlaybinProbe, instance, nullptr); instance->pipeline_is_connected_ = true; - if (instance->pending_seek_nanosec_ != -1 && instance->pipeline_is_initialised_) { + if (instance->pending_seek_nanosec_ != -1 && instance->pipeline_is_initialized_) { QMetaObject::invokeMethod(instance, "Seek", Qt::QueuedConnection, Q_ARG(qint64, instance->pending_seek_nanosec_)); } @@ -804,7 +804,7 @@ GstBusSyncReply GstEnginePipeline::BusCallbackSync(GstBus*, GstMessage *msg, gpo void GstEnginePipeline::StreamStatusMessageReceived(GstMessage *msg) { GstStreamStatusType type; - GstElement *owner; + GstElement *owner = nullptr; gst_message_parse_stream_status(msg, &type, &owner); if (type == GST_STREAM_STATUS_TYPE_CREATE) { @@ -835,9 +835,9 @@ void GstEnginePipeline::StreamStartMessageReceived() { } -void GstEnginePipeline::TaskEnterCallback(GstTask *, GThread *, gpointer) { +void GstEnginePipeline::TaskEnterCallback(GstTask*, GThread*, gpointer) { - // Bump the priority of the thread only on OS X + // Bump the priority of the thread only on macOS #ifdef Q_OS_MACOS sched_param param; @@ -875,7 +875,7 @@ void GstEnginePipeline::ErrorMessageReceived(GstMessage *msg) { g_error_free(error); g_free(debugs); - if (state() == GST_STATE_PLAYING && pipeline_is_initialised_ && next_uri_set_ && (domain == GST_RESOURCE_ERROR || domain == GST_STREAM_ERROR)) { + if (state() == GST_STATE_PLAYING && pipeline_is_initialized_ && next_uri_set_ && (domain == GST_RESOURCE_ERROR || domain == GST_STREAM_ERROR)) { // A track is still playing and the next uri is not playable. We ignore the error here so it can play until the end. // But there is no message send to the bus when the current track finishes, we have to add an EOS ourself. qLog(Info) << "Ignoring error when loading next track"; @@ -990,15 +990,15 @@ void GstEnginePipeline::StateChangedMessageReceived(GstMessage *msg) { GstState old_state, new_state, pending; gst_message_parse_state_changed(msg, &old_state, &new_state, &pending); - if (!pipeline_is_initialised_ && (new_state == GST_STATE_PAUSED || new_state == GST_STATE_PLAYING)) { - pipeline_is_initialised_ = true; + if (!pipeline_is_initialized_ && (new_state == GST_STATE_PAUSED || new_state == GST_STATE_PLAYING)) { + pipeline_is_initialized_ = true; if (pending_seek_nanosec_ != -1 && pipeline_is_connected_) { QMetaObject::invokeMethod(this, "Seek", Qt::QueuedConnection, Q_ARG(qint64, pending_seek_nanosec_)); } } - if (pipeline_is_initialised_ && new_state != GST_STATE_PAUSED && new_state != GST_STATE_PLAYING) { - pipeline_is_initialised_ = false; + if (pipeline_is_initialized_ && new_state != GST_STATE_PAUSED && new_state != GST_STATE_PLAYING) { + pipeline_is_initialized_ = false; if (next_uri_set_ && new_state == GST_STATE_READY) { // Revert uri and go back to PLAY state again @@ -1050,7 +1050,7 @@ void GstEnginePipeline::BufferingMessageReceived(GstMessage *msg) { qint64 GstEnginePipeline::position() const { - if (pipeline_is_initialised_) + if (pipeline_is_initialized_) gst_element_query_position(pipeline_, GST_FORMAT_TIME, &last_known_position_ns_); return last_known_position_ns_; @@ -1087,7 +1087,7 @@ bool GstEnginePipeline::Seek(const qint64 nanosec) { return true; } - if (!pipeline_is_connected_ || !pipeline_is_initialised_) { + if (!pipeline_is_connected_ || !pipeline_is_initialized_) { pending_seek_nanosec_ = nanosec; return true; } diff --git a/src/engine/gstenginepipeline.h b/src/engine/gstenginepipeline.h index 9315d59a6..3af36afa2 100644 --- a/src/engine/gstenginepipeline.h +++ b/src/engine/gstenginepipeline.h @@ -249,7 +249,7 @@ class GstEnginePipeline : public QObject { // Seeking while the pipeline is in the READY state doesn't work, so we have to wait until it goes to PAUSED or PLAYING. // Also we have to wait for the playbin to be connected. - bool pipeline_is_initialised_; + bool pipeline_is_initialized_; bool pipeline_is_connected_; qint64 pending_seek_nanosec_; diff --git a/src/engine/gststartup.cpp b/src/engine/gststartup.cpp index eb2f8e705..a067ca427 100644 --- a/src/engine/gststartup.cpp +++ b/src/engine/gststartup.cpp @@ -41,14 +41,12 @@ #include "gststartup.h" GstStartup::GstStartup(QObject *parent) : QObject(parent) { - initialising_ = QtConcurrent::run([=]{ InitialiseGStreamer(); }); + initializing_ = QtConcurrent::run([=]{ InitializeGStreamer(); }); } -GstStartup::~GstStartup() { - //gst_deinit(); -} +GstStartup::~GstStartup() {} -void GstStartup::InitialiseGStreamer() { +void GstStartup::InitializeGStreamer() { SetEnvironment(); diff --git a/src/engine/gststartup.h b/src/engine/gststartup.h index 94023855f..b35d45c6f 100644 --- a/src/engine/gststartup.h +++ b/src/engine/gststartup.h @@ -34,12 +34,12 @@ class GstStartup : public QObject { explicit GstStartup(QObject *parent = nullptr); ~GstStartup() override; - void EnsureInitialised() { initialising_.waitForFinished(); } + void EnsureInitialized() { initializing_.waitForFinished(); } private: - void InitialiseGStreamer(); + void InitializeGStreamer(); void SetEnvironment(); - QFuture initialising_; + QFuture initializing_; }; diff --git a/src/engine/macosdevicefinder.h b/src/engine/macosdevicefinder.h index b4c070787..a1ed7cf4d 100644 --- a/src/engine/macosdevicefinder.h +++ b/src/engine/macosdevicefinder.h @@ -31,7 +31,7 @@ class MacOsDeviceFinder : public DeviceFinder { public: explicit MacOsDeviceFinder(); - virtual bool Initialise() { return true; } + virtual bool Initialize() { return true; } virtual QList ListDevices(); }; diff --git a/src/engine/mmdevicefinder.h b/src/engine/mmdevicefinder.h index e773f8402..5ee39e81a 100644 --- a/src/engine/mmdevicefinder.h +++ b/src/engine/mmdevicefinder.h @@ -28,7 +28,7 @@ class MMDeviceFinder : public DeviceFinder { public: explicit MMDeviceFinder(); - virtual bool Initialise() { return true; } + virtual bool Initialize() { return true; } virtual QList ListDevices(); }; diff --git a/src/engine/pulsedevicefinder.cpp b/src/engine/pulsedevicefinder.cpp index b9cc98739..ff9eb66ff 100644 --- a/src/engine/pulsedevicefinder.cpp +++ b/src/engine/pulsedevicefinder.cpp @@ -37,7 +37,7 @@ PulseDeviceFinder::PulseDeviceFinder() : DeviceFinder("pulseaudio", {"pulseaudio", "pulse", "pulsesink"} ), mainloop_(nullptr), context_(nullptr) { } -bool PulseDeviceFinder::Initialise() { +bool PulseDeviceFinder::Initialize() { mainloop_ = pa_mainloop_new(); if (!mainloop_) { diff --git a/src/engine/pulsedevicefinder.h b/src/engine/pulsedevicefinder.h index 286a7d492..0de31540f 100644 --- a/src/engine/pulsedevicefinder.h +++ b/src/engine/pulsedevicefinder.h @@ -36,7 +36,7 @@ class PulseDeviceFinder : public DeviceFinder { explicit PulseDeviceFinder(); ~PulseDeviceFinder() override; - bool Initialise() override; + bool Initialize() override; QList ListDevices() override; private: diff --git a/src/engine/vlcengine.cpp b/src/engine/vlcengine.cpp index 3171dec59..765eec2b8 100644 --- a/src/engine/vlcengine.cpp +++ b/src/engine/vlcengine.cpp @@ -108,7 +108,7 @@ bool VLCEngine::Load(const QUrl &stream_url, const QUrl &original_url, const Eng Q_UNUSED(beginning_nanosec); Q_UNUSED(end_nanosec); - if (!Initialised()) return false; + if (!Initialized()) return false; // Create the media object VlcScopedRef media(libvlc_media_new_location(instance_, stream_url.toEncoded().constData())); @@ -121,7 +121,7 @@ bool VLCEngine::Load(const QUrl &stream_url, const QUrl &original_url, const Eng bool VLCEngine::Play(const quint64 offset_nanosec) { - if (!Initialised()) return false; + if (!Initialized()) return false; // Set audio output if (!output_.isEmpty() && output_ != "auto") { @@ -147,28 +147,28 @@ void VLCEngine::Stop(const bool stop_after) { Q_UNUSED(stop_after); - if (!Initialised()) return; + if (!Initialized()) return; libvlc_media_player_stop(player_); } void VLCEngine::Pause() { - if (!Initialised()) return; + if (!Initialized()) return; libvlc_media_player_pause(player_); } void VLCEngine::Unpause() { - if (!Initialised()) return; + if (!Initialized()) return; libvlc_media_player_play(player_); } void VLCEngine::Seek(const quint64 offset_nanosec) { - if (!Initialised()) return; + if (!Initialized()) return; int offset = (offset_nanosec / kNsecPerMsec); @@ -182,7 +182,7 @@ void VLCEngine::Seek(const quint64 offset_nanosec) { } void VLCEngine::SetVolumeSW(const uint percent) { - if (!Initialised()) return; + if (!Initialized()) return; if (!volume_control_ && percent != 100) return; libvlc_audio_set_volume(player_, percent); } @@ -248,7 +248,7 @@ bool VLCEngine::ALSADeviceSupport(const QString &output) { uint VLCEngine::position() const { - if (!Initialised()) return (0); + if (!Initialized()) return (0); bool is_playing = libvlc_media_player_is_playing(player_); if (!is_playing) return 0; @@ -260,7 +260,7 @@ uint VLCEngine::position() const { uint VLCEngine::length() const { - if (!Initialised()) return(0); + if (!Initialized()) return(0); bool is_playing = libvlc_media_player_is_playing(player_); if (!is_playing) return 0; diff --git a/src/engine/vlcengine.h b/src/engine/vlcengine.h index ec16f20b1..2931cfeba 100644 --- a/src/engine/vlcengine.h +++ b/src/engine/vlcengine.h @@ -72,7 +72,7 @@ class VLCEngine : public Engine::Base { libvlc_media_player_t *player_; Engine::State state_; - bool Initialised() const { return (instance_ && player_); } + bool Initialized() const { return (instance_ && player_); } uint position() const; uint length() const; bool CanDecode(const QUrl &url); diff --git a/src/main.cpp b/src/main.cpp index de29ac7c6..9183e4df2 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -110,7 +110,7 @@ int main(int argc, char* argv[]) { #ifdef Q_OS_MACOS // Do Mac specific startup to get media keys working. - // This must go before QApplication initialisation. + // This must go before QApplication initialization. mac::MacMain(); #endif @@ -134,7 +134,7 @@ int main(int argc, char* argv[]) { RegisterMetaTypes(); - // Initialise logging. Log levels are set after the commandline options are parsed below. + // Initialize logging. Log levels are set after the commandline options are parsed below. logging::Init(); g_log_set_default_handler(reinterpret_cast(&logging::GLog), nullptr); diff --git a/src/settings/backendsettingspage.cpp b/src/settings/backendsettingspage.cpp index 1ce2ffbe2..94b0caa06 100644 --- a/src/settings/backendsettingspage.cpp +++ b/src/settings/backendsettingspage.cpp @@ -104,7 +104,7 @@ void BackendSettingsPage::Load() { device_current_ = s.value("device", QVariant()); ui_->combobox_engine->setCurrentIndex(ui_->combobox_engine->findData(static_cast(enginetype))); - if (EngineInitialised()) Load_Engine(enginetype); + if (EngineInitialized()) Load_Engine(enginetype); ui_->checkbox_volume_control->setChecked(s.value("volume_control", true).toBool()); @@ -152,7 +152,7 @@ void BackendSettingsPage::Load() { ui_->widget_alsa_plugin->hide(); #endif - if (!EngineInitialised()) return; + if (!EngineInitialized()) return; if (engine()->state() == Engine::Empty) { if (ui_->combobox_engine->count() > 1) ui_->combobox_engine->setEnabled(true); @@ -207,7 +207,7 @@ void BackendSettingsPage::Load() { } -bool BackendSettingsPage::EngineInitialised() { +bool BackendSettingsPage::EngineInitialized() { if (!engine() || engine()->type() == Engine::None) { errordialog_.ShowMessage("Engine is not initialized! Please restart."); @@ -219,7 +219,7 @@ bool BackendSettingsPage::EngineInitialised() { void BackendSettingsPage::Load_Engine(const Engine::EngineType enginetype) { - if (!EngineInitialised()) return; + if (!EngineInitialized()) return; QString output = output_current_; QVariant device = device_current_; @@ -253,7 +253,7 @@ void BackendSettingsPage::Load_Engine(const Engine::EngineType enginetype) { void BackendSettingsPage::Load_Output(QString output, QVariant device) { - if (!EngineInitialised()) return; + if (!EngineInitialized()) return; if (output.isEmpty()) output = engine()->DefaultOutput(); @@ -301,7 +301,7 @@ void BackendSettingsPage::Load_Output(QString output, QVariant device) { void BackendSettingsPage::Load_Device(const QString &output, const QVariant &device) { - if (!EngineInitialised()) return; + if (!EngineInitialized()) return; int devices = 0; DeviceFinder::Device df_device; @@ -385,7 +385,7 @@ void BackendSettingsPage::Load_Device(const QString &output, const QVariant &dev void BackendSettingsPage::Save() { - if (!EngineInitialised()) return; + if (!EngineInitialized()) return; QVariant enginetype_v = ui_->combobox_engine->itemData(ui_->combobox_engine->currentIndex()); Engine::EngineType enginetype = enginetype_v.value(); @@ -447,7 +447,7 @@ void BackendSettingsPage::Cancel() { void BackendSettingsPage::EngineChanged(const int index) { - if (!configloaded_ || !EngineInitialised()) return; + if (!configloaded_ || !EngineInitialized()) return; QVariant v = ui_->combobox_engine->itemData(index); Engine::EngineType enginetype = v.value(); @@ -467,7 +467,7 @@ void BackendSettingsPage::EngineChanged(const int index) { void BackendSettingsPage::OutputChanged(const int index) { - if (!configloaded_ || !EngineInitialised()) return; + if (!configloaded_ || !EngineInitialized()) return; EngineBase::OutputDetails output = ui_->combobox_output->itemData(index).value(); Load_Device(output.name, QVariant()); @@ -476,7 +476,7 @@ void BackendSettingsPage::OutputChanged(const int index) { void BackendSettingsPage::DeviceSelectionChanged(int index) { - if (!configloaded_ || !EngineInitialised()) return; + if (!configloaded_ || !EngineInitialized()) return; EngineBase::OutputDetails output = ui_->combobox_output->itemData(ui_->combobox_output->currentIndex()).value(); QVariant device = ui_->combobox_device->itemData(index).value(); @@ -499,7 +499,7 @@ void BackendSettingsPage::DeviceSelectionChanged(int index) { void BackendSettingsPage::DeviceStringChanged() { - if (!configloaded_ || !EngineInitialised()) return; + if (!configloaded_ || !EngineInitialized()) return; EngineBase::OutputDetails output = ui_->combobox_output->itemData(ui_->combobox_output->currentIndex()).value(); bool found(false); @@ -588,7 +588,7 @@ void BackendSettingsPage::radiobutton_alsa_hw_clicked(const bool checked) { #ifdef HAVE_ALSA - if (!configloaded_ || !EngineInitialised()) return; + if (!configloaded_ || !EngineInitialized()) return; EngineBase::OutputDetails output = ui_->combobox_output->itemData(ui_->combobox_output->currentIndex()).value(); if (!engine()->ALSADeviceSupport(output.name)) return; @@ -619,7 +619,7 @@ void BackendSettingsPage::radiobutton_alsa_plughw_clicked(const bool checked) { #ifdef HAVE_ALSA - if (!configloaded_ || !EngineInitialised()) return; + if (!configloaded_ || !EngineInitialized()) return; EngineBase::OutputDetails output = ui_->combobox_output->itemData(ui_->combobox_output->currentIndex()).value(); if (!engine()->ALSADeviceSupport(output.name)) return; @@ -646,7 +646,7 @@ void BackendSettingsPage::radiobutton_alsa_plughw_clicked(const bool checked) { void BackendSettingsPage::FadingOptionsChanged() { - if (!configloaded_ || !EngineInitialised()) return; + if (!configloaded_ || !EngineInitialized()) return; EngineBase::OutputDetails output = ui_->combobox_output->itemData(ui_->combobox_output->currentIndex()).value(); if (engine()->type() == Engine::GStreamer && !(engine()->ALSADeviceSupport(output.name) && !ui_->lineedit_device->text().isEmpty()) && ui_->checkbox_volume_control->isChecked()) { diff --git a/src/settings/backendsettingspage.h b/src/settings/backendsettingspage.h index b73a97c42..3bf8525d2 100644 --- a/src/settings/backendsettingspage.h +++ b/src/settings/backendsettingspage.h @@ -76,7 +76,7 @@ private: Ui_BackendSettingsPage *ui_; - bool EngineInitialised(); + bool EngineInitialized(); void EngineChanged(Engine::EngineType enginetype); diff --git a/src/settings/collectionsettingspage.cpp b/src/settings/collectionsettingspage.cpp index e6001e3f7..ce864b15a 100644 --- a/src/settings/collectionsettingspage.cpp +++ b/src/settings/collectionsettingspage.cpp @@ -64,7 +64,7 @@ const QStringList CollectionSettingsPage::cacheUnitNames = { "KB", "MB", "GB", " CollectionSettingsPage::CollectionSettingsPage(SettingsDialog *dialog) : SettingsPage(dialog), ui_(new Ui_CollectionSettingsPage), - initialised_model_(false) + initialized_model_(false) { ui_->setupUi(this); @@ -137,13 +137,13 @@ void CollectionSettingsPage::DiskCacheEnable(const int state) { void CollectionSettingsPage::Load() { - if (!initialised_model_) { + if (!initialized_model_) { if (ui_->list->selectionModel()) { disconnect(ui_->list->selectionModel(), SIGNAL(currentRowChanged(QModelIndex, QModelIndex)), this, SLOT(CurrentRowChanged(QModelIndex))); } ui_->list->setModel(dialog()->collection_directory_model()); - initialised_model_ = true; + initialized_model_ = true; connect(ui_->list->selectionModel(), SIGNAL(currentRowChanged(QModelIndex, QModelIndex)), SLOT(CurrentRowChanged(QModelIndex))); } diff --git a/src/settings/collectionsettingspage.h b/src/settings/collectionsettingspage.h index 1f31955b2..60c8f1f7d 100644 --- a/src/settings/collectionsettingspage.h +++ b/src/settings/collectionsettingspage.h @@ -76,7 +76,7 @@ class CollectionSettingsPage : public SettingsPage { private: Ui_CollectionSettingsPage *ui_; - bool initialised_model_; + bool initialized_model_; static const QStringList cacheUnitNames; }; diff --git a/src/settings/moodbarsettingspage.cpp b/src/settings/moodbarsettingspage.cpp index f937009ad..93564e3b6 100644 --- a/src/settings/moodbarsettingspage.cpp +++ b/src/settings/moodbarsettingspage.cpp @@ -51,7 +51,7 @@ const int MoodbarSettingsPage::kMoodbarPreviewHeight = 18; MoodbarSettingsPage::MoodbarSettingsPage(SettingsDialog* dialog) : SettingsPage(dialog), ui_(new Ui_MoodbarSettingsPage), - initialised_(false) + initialized_(false) { ui_->setupUi(this); @@ -96,8 +96,8 @@ void MoodbarSettingsPage::Cancel() {} void MoodbarSettingsPage::InitMoodbarPreviews() { - if (initialised_) return; - initialised_ = true; + if (initialized_) return; + initialized_ = true; const QSize preview_size(kMoodbarPreviewWidth, kMoodbarPreviewHeight); ui_->moodbar_style->setIconSize(preview_size); diff --git a/src/settings/moodbarsettingspage.h b/src/settings/moodbarsettingspage.h index 04f34d446..4b681d378 100644 --- a/src/settings/moodbarsettingspage.h +++ b/src/settings/moodbarsettingspage.h @@ -50,7 +50,7 @@ class MoodbarSettingsPage : public SettingsPage { Ui_MoodbarSettingsPage* ui_; - bool initialised_; + bool initialized_; }; #endif // MOODBARSETTINGSPAGE_H diff --git a/src/settings/shortcutssettingspage.cpp b/src/settings/shortcutssettingspage.cpp index f1e529a6a..ba7af0ce5 100644 --- a/src/settings/shortcutssettingspage.cpp +++ b/src/settings/shortcutssettingspage.cpp @@ -57,7 +57,7 @@ const char *GlobalShortcutsSettingsPage::kSettingsGroup = "GlobalShortcuts"; GlobalShortcutsSettingsPage::GlobalShortcutsSettingsPage(SettingsDialog *dialog) : SettingsPage(dialog), ui_(new Ui_GlobalShortcutsSettingsPage), - initialised_(false), + initialized_(false), grabber_(new GlobalShortcutGrabber) { ui_->setupUi(this); @@ -105,8 +105,8 @@ void GlobalShortcutsSettingsPage::Load() { GlobalShortcuts *manager = dialog()->global_shortcuts_manager(); - if (!initialised_) { - initialised_ = true; + if (!initialized_) { + initialized_ = true; de_ = Utilities::DesktopEnvironment(); ui_->widget_warning->hide(); diff --git a/src/settings/shortcutssettingspage.h b/src/settings/shortcutssettingspage.h index 306582135..c4a71b611 100644 --- a/src/settings/shortcutssettingspage.h +++ b/src/settings/shortcutssettingspage.h @@ -78,7 +78,7 @@ class GlobalShortcutsSettingsPage : public SettingsPage { private: Ui_GlobalShortcutsSettingsPage *ui_; - bool initialised_; + bool initialized_; std::unique_ptr grabber_; QMap shortcuts_; diff --git a/src/transcoder/transcoder.cpp b/src/transcoder/transcoder.cpp index 2f0c28b14..689039bf5 100644 --- a/src/transcoder/transcoder.cpp +++ b/src/transcoder/transcoder.cpp @@ -205,7 +205,7 @@ Transcoder::Transcoder(QObject *parent, const QString &settings_postfix) if (JobFinishedEvent::sEventType == -1) JobFinishedEvent::sEventType = QEvent::registerEventType(); - // Initialise some settings for the lamemp3enc element. + // Initialize some settings for the lamemp3enc element. QSettings s; s.beginGroup("Transcoder/lamemp3enc" + settings_postfix_); diff --git a/src/widgets/stretchheaderview.cpp b/src/widgets/stretchheaderview.cpp index 5f03f8db4..e3a341ffe 100644 --- a/src/widgets/stretchheaderview.cpp +++ b/src/widgets/stretchheaderview.cpp @@ -221,7 +221,7 @@ void StretchHeaderView::SetStretchEnabled(const bool enabled) { stretch_enabled_ = enabled; if (enabled) { - // Initialise the list of widths from the current state of the widget + // Initialize the list of widths from the current state of the widget column_widths_.resize(count()); for (int i = 0; i < count(); ++i) { column_widths_[i] = ColumnWidthType(sectionSize(i)) / width(); diff --git a/src/widgets/stretchheaderview.h b/src/widgets/stretchheaderview.h index 1c7d0f55d..81b0122bc 100644 --- a/src/widgets/stretchheaderview.h +++ b/src/widgets/stretchheaderview.h @@ -70,8 +70,8 @@ class StretchHeaderView : public QHeaderView { bool is_stretch_enabled() const { return stretch_enabled_; } public slots: - // Changes the stretch mode. Enabling stretch mode will initialise the - // proportional column widths from the current state of the header. + // Changes the stretch mode. + // Enabling stretch mode will initialize the proportional column widths from the current state of the header. void ToggleStretchEnabled(); void SetStretchEnabled(const bool enabled); diff --git a/tests/src/collectionmodel_test.cpp b/tests/src/collectionmodel_test.cpp index ae75e5c6e..cb7ed0951 100644 --- a/tests/src/collectionmodel_test.cpp +++ b/tests/src/collectionmodel_test.cpp @@ -91,7 +91,7 @@ class CollectionModelTest : public ::testing::Test { bool added_dir_; }; -TEST_F(CollectionModelTest, Initialisation) { +TEST_F(CollectionModelTest, Initialization) { EXPECT_EQ(0, model_->rowCount(QModelIndex())); }