/* Blinker
   Copyright 2011-2019 Stefan Schuermans <stefan@blinkenarea.org>
   Copyleft GNU public license - http://www.gnu.org/copyleft/gpl.html
   a blinkenarea.org project */

#ifndef BLINKER_SYNCRECV_H
#define BLINKER_SYNCRECV_H

#include <string>

#include "Time.h"

namespace Blinker {

/// video sync stream receiver interface
class SyncRecv
{
public:
  /// synchronization information
  struct Info {
    bool        pause; ///< if pause mode is active
    std::string name;  ///< name of current piece
    Time        pos;   ///< current position within the piece
  };

public:
  /**
   * @brief check if playlist entry name matches sync name
   * @param[in] playlist name in playlist
   * @param[in] sync name from synchronization information
   * @return true if name matches, false otherwise
   */
  static bool checkName(const std::string &playlist, const std::string &sync);

public:
  /// constructor
  SyncRecv();

  /// virtual destructor
  virtual ~SyncRecv();

public:
  /**
   * @brief send synchronization information
   * @param[in] sync sync stream name
   * @param[in] pInfo synchronization information
   */
  virtual void sendInfo(const std::string &sync, Info &info) = 0;
}; // class SyncRecv

} // namespace Blinker

#endif // #ifndef BLINKER_SYNCRECV_H

