#include "player.h"

#ifndef STANDALONE
#include "../audio.hpp"
#endif

#include "strmanip.h"

int IPlayer::get_playlist_length()
{
#ifndef STANDALONE
  Audio *audio = Audio::get_instance();
  return audio->playlist_size();
#else
  return 0;
#endif
}

int IPlayer::get_playlist_position()
{
#ifndef STANDALONE
  Audio *audio = Audio::get_instance();
  return audio->playlist_pos_int;
#else
  return 0;
#endif
}

std::string IPlayer::get_playlist_item(int at)
{
#ifndef STANDALONE
  Audio *audio = Audio::get_instance();

  if (at < 0 || audio->playlist.size() == 0 || at >= audio->playlist.size())
    return "";

  return path_simplifyer(vector_lookup(audio->playlist, at).path);
#else
  return "";
#endif
}

void IPlayer::reset_selection() {}
