/***************************************************************************
 *   Copyright (C) 2005 by Roland Weigert   *
 *   roweigert@t-online.de   *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/

using namespace std;

#ifndef _CDIDGENERATOR_H_
#define _CDIDGENERATOR_H_

#define CDROM "/dev/cdrom"

#include <iostream>

#include <sys/ioctl.h>
#include <fcntl.h>
#include <errno.h>

#include <qstring.h>

//workaround for kernelsources not working with the normal code
#undef __STRICT_ANSI__
#include <asm/types.h>
#ifndef __le64
       #define __le64 __u64
#endif
#ifndef __le32
       #define __le32 __u32
#endif
#ifndef __le16
       #define __le16 __u16
#endif
#ifndef __be64
       #define __be64 __u64
#endif
#ifndef __be32
       #define __be32 __u32
#endif
#ifndef __be16
       #define __be16 __u16
#endif
#include <linux/cdrom.h>

struct toc
{
    int min;
    int sec;
    int frame;
    int mode;
    int frameoffset;
};

class cdrominfo
{
public:
    cdrominfo();
    ~cdrominfo()
    {}
    ;
    bool discreadok;
    int trackcount;
    QString discid;
    QString cddbquery;
    struct toc cdtoc[100];
private:
    unsigned long calcdiscid(int);
};

#endif//_CDIDGENERATOR_H_
