From 6c498bfbc54627944bd08b242fa620b2b5c6b7c9 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Sat, 29 Jun 2019 12:11:40 +0200 Subject: Rename DrumkitLoader::loadKit to loadKitAudio to avoid confusion with loadkit (lower-case k) in the same class. --- src/drumkitloader.cc | 12 ++++++------ src/drumkitloader.h | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/drumkitloader.cc b/src/drumkitloader.cc index 77b7021..933e415 100644 --- a/src/drumkitloader.cc +++ b/src/drumkitloader.cc @@ -189,14 +189,14 @@ bool DrumKitLoader::loadkit(const std::string& file) settings.drumkit_version = kit.getVersion(); settings.drumkit_samplerate = kit.getSamplerate(); - loadKit(&kit); + loadKitAudio(kit); DEBUG(loadkit, "loadkit: Success\n"); return true; } -void DrumKitLoader::loadKit(DrumKit *kit) +void DrumKitLoader::loadKitAudio(const DrumKit& kit) { // std::lock_guard guard(mutex); @@ -207,7 +207,7 @@ void DrumKitLoader::loadKit(DrumKit *kit) DEBUG(loader, "cache_enable: %s\n", cache_enable?"true":"false"); - auto number_of_files = kit->getNumberOfFiles(); + auto number_of_files = kit.getNumberOfFiles(); if(cache_enable && number_of_files > 0) { auto cache_limit_per_file = cache_limit / number_of_files; @@ -237,13 +237,13 @@ void DrumKitLoader::loadKit(DrumKit *kit) // Count total number of files that need loading: settings.number_of_files.store(0); - for(auto& instr_ptr: kit->instruments) + for(const auto& instr_ptr: kit.instruments) { settings.number_of_files.fetch_add(instr_ptr->audiofiles.size()); } // Now actually queue them for loading: - for(auto& instr_ptr: kit->instruments) + for(const auto& instr_ptr: kit.instruments) { for(auto& audiofile: instr_ptr->audiofiles) { @@ -254,7 +254,7 @@ void DrumKitLoader::loadKit(DrumKit *kit) DEBUG(loader, "Queued %d (size: %d) AudioFiles for loading.\n", (int)settings.number_of_files.load(), (int)load_queue.size()); - audio_cache.updateChunkSize(kit->channels.size()); + audio_cache.updateChunkSize(kit.channels.size()); semaphore.post(); // Start loader loop. } diff --git a/src/drumkitloader.h b/src/drumkitloader.h index b6e0a8e..a2531d5 100644 --- a/src/drumkitloader.h +++ b/src/drumkitloader.h @@ -68,7 +68,7 @@ public: //! Signal the loader to start loading all audio files contained in the kit. //! All other AudioFiles in queue will be removed before the new ones are //! scheduled. - void loadKit(DrumKit *kit); + void loadKitAudio(const DrumKit& kit); //! Skip all queued AudioFiles. void skip(); -- cgit v1.2.3