#pragma once #include #include #define LOOP_FOREVER (-1) namespace fs = std::filesystem; struct PlaylistEntry { double speed; double tempo; double pitch; int loops; int stream_idx; fs::path path; }; class Playlist { friend class LooperXspfReaderCallback; std::vector entries; fs::path path; using vec = std::vector; using iterator = vec::iterator; using const_iterator = vec::const_iterator; using reverse_iterator = vec::reverse_iterator; using const_reverse_iterator = vec::const_reverse_iterator; public: void save(fs::path output_file); inline PlaylistEntry &operator[](int idx) { return entries[idx]; } iterator begin(); iterator end(); const_iterator cbegin(); const_iterator cend(); reverse_iterator rbegin(); reverse_iterator rend(); const_reverse_iterator crbegin(); const_reverse_iterator crend(); Playlist(fs::path input_file); Playlist() = default; };