From e2de64d6f1beb9e492daf5b886e19933c1fa41dd Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdemultimedia@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- mpeglib/lib/input/cdromRawAccess.cpp | 113 +++++++++++++++++++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 mpeglib/lib/input/cdromRawAccess.cpp (limited to 'mpeglib/lib/input/cdromRawAccess.cpp') diff --git a/mpeglib/lib/input/cdromRawAccess.cpp b/mpeglib/lib/input/cdromRawAccess.cpp new file mode 100644 index 00000000..b0df4747 --- /dev/null +++ b/mpeglib/lib/input/cdromRawAccess.cpp @@ -0,0 +1,113 @@ +/* + reads raw input data from cdrom (system dependent) + Copyright (C) 1999 Martin Vogt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU Library General Public License as published by + the Free Software Foundation. + + For more information look at the file COPYRIGHT in this package + + */ + + +#include + +#include "cdromRawAccess.h" + +using namespace std; + +CDRomRawAccess::CDRomRawAccess(CDRomToc* cdromToc) { + cdfile=NULL; + lOpen=false; + leof=true; + this->cdromToc=cdromToc; + lData=false; + dataStart=0; + len=0; +} + + +CDRomRawAccess::~CDRomRawAccess() { + close(); +} + + + +char* CDRomRawAccess::getBufferStart() { + return (char*)(data+dataStart); +} + +int CDRomRawAccess::getBufferLen() { + if (eof()) { + return 0; + } + return len; +} + +int CDRomRawAccess::open(const char* filename) { + if (isOpen()) { + close(); + } + if (filename==NULL) { + filename=(char*)"/dev/cdrom"; + } + if (strlen(filename) <= 1) { + filename="/dev/cdrom"; + } + char* openfile=strchr(filename,'/'); + cout << "openfile:"<isInRange(minute,second,frame); + if (lInRange == false) { + if (minute*60+second+1 > cdromToc->getEndSecond()) { + leof=true; + } + return false; + } + return readDirect(minute,second,frame); +} + + +void CDRomRawAccess::close() { + if (isOpen()) { + fclose(cdfile); + lOpen=false; + leof=true; + } +} + +int CDRomRawAccess::isData() { + return lData; +} + +int CDRomRawAccess::isOpen() { + return lOpen; +} + + + + -- cgit v1.2.1