#ifndef SHUFFLE_LIST_HPP
#define SHUFFLE_LIST_HPP

#include "simplefile.hpp"

#include <vector>

// random shuffle
#include <algorithm>

class ShuffleList
{
 public:
  const Simplefile prev_track();
  const Simplefile next_track();

  void track_played(const Simplefile& e);

  void add_track(const Simplefile& e);
  void remove_track(const Simplefile& e);
  void clear() { shuffle_list.clear(); }
  int size() { return shuffle_list.size(); }
  void randomize() { std::random_shuffle(shuffle_list.begin(), shuffle_list.end()); }
  
  ShuffleList(const std::vector<Simplefile>& list);
  ShuffleList() : shuffle_pos(0) {}

 private:
  std::vector<Simplefile> shuffle_list;
  int shuffle_pos;
};

#endif
