#ifndef CD_HPP
#define CD_HPP

#include "config.h"

#include <string>

class Cd
{
public:
  enum cdstatus { NODISC, TRAYOPEN, NOTREADY, OK };

  // returns true is open was succesful
  bool open();
  void close();
  cdstatus check_cddrive();
  bool data_disc();
    
  int get_nr_tracks_cd();

  std::string get_device();
  std::string get_mount_point();

#ifdef openclose
  void openclose_cddrive();
#endif

  // singleton
  static Cd* get_instance();

  ~Cd();

  int cdrom;

private:

  void cd_set_speed();

  static Cd* instance;

  Cd();

  bool cd_speed_set;
};

#endif
