From 3f7f199cb940c8d5f6d48f77fd59971adffe49ef Mon Sep 17 00:00:00 2001 From: jacqueline Date: Thu, 7 Dec 2023 16:57:05 +1100 Subject: Remove pre-iterator concepts - No more IndexRecord/Result/dbGetPage nonsense - Queue is just track ids - i am so tired and have so much to do --- src/playlist/include/shuffler.hpp | 68 --------------------------------------- 1 file changed, 68 deletions(-) delete mode 100644 src/playlist/include/shuffler.hpp (limited to 'src/playlist/include/shuffler.hpp') diff --git a/src/playlist/include/shuffler.hpp b/src/playlist/include/shuffler.hpp deleted file mode 100644 index affc6301..00000000 --- a/src/playlist/include/shuffler.hpp +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright 2023 jacqueline - * - * SPDX-License-Identifier: GPL-3.0-only - */ - -#pragma once - -#include -#include -#include -#include -#include - -#include "bloom_filter.hpp" -#include "database.hpp" -#include "future_fetcher.hpp" -#include "random.hpp" -#include "source.hpp" -#include "track.hpp" - -namespace playlist { - -/* - * A source composes of other sources and/or specific extra tracks. Supports - * iteration over its contents in a random order. - */ -class Shuffler : public ISource { - public: - static auto Create() -> Shuffler*; - - explicit Shuffler( - util::IRandom* random, - std::unique_ptr> filter); - - auto Current() -> std::optional override; - auto Advance() -> std::optional override; - auto Peek(std::size_t, std::vector*) - -> std::size_t override; - - typedef std::variant> - Item; - auto Add(Item) -> void; - - /* - * Returns the enqueued items, starting from the current item, in their - * original insertion order. - */ - auto Unshuffle() -> std::vector; - - // Not copyable or movable. - - Shuffler(const Shuffler&) = delete; - Shuffler& operator=(const Shuffler&) = delete; - - private: - auto RefillBuffer() -> void; - - util::IRandom* random_; - - std::unique_ptr> already_played_; - bool out_of_items_; - - std::deque ordered_items_; - std::deque shuffled_items_buffer_; -}; - -} // namespace playlist -- cgit v1.2.3