From 5e05f47d61ebad8aee6c3831912b21ad5dcc36e3 Mon Sep 17 00:00:00 2001 From: "B. Bogart" Date: Sat, 13 Aug 2005 01:16:59 +0000 Subject: Initial commit of readanysf~ 0.13.1 for August svn path=/trunk/externals/august/readanysf~/; revision=3426 --- include/Input.h | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 include/Input.h (limited to 'include/Input.h') diff --git a/include/Input.h b/include/Input.h new file mode 100644 index 0000000..960bbb0 --- /dev/null +++ b/include/Input.h @@ -0,0 +1,56 @@ +#ifndef _INPUT_H_ +#define _INPUT_H_ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include // open +#include // open +#include // open +#include // read +#include // for gethostbyname +#include // socket + +#include +#include +#include + + +#include // save filename +using namespace std; +#include "generic.h" + +class Input { + public: + Input(); + virtual ~ Input(); + + virtual int Open(const char *pathname); // open file or stream and return formt + virtual int Close(); // close or disconnect + virtual int Read(void *buf, unsigned int count); //read into buf count times. + + virtual long SeekSet(long offset); // lseek using SEEK_SET + virtual long SeekCur(long offset); // lseek using SEEK_CUR + virtual long SeekEnd(long offset); // lseek using SEEK_END + //int getEof() { return eof(fd); } + virtual float get_cachesize(); // return amount of buffer that is used. 0.0 for InputFile + + virtual bool get_recover( ) { return recover; } + void set_recover( bool x) { recover =x;} + + + void SetVerbosity(int d) { verbosity = d; } // set debug level 0-3 protected: + int get_fd() { return fd;} + int get_format() { return format;} + const char * get_filename() { return filename.c_str(); } + + protected: + int fd; //file descriptor for files and sockets + int format; //what format? OGG,MP3,NEXT etc. see defines above + int verbosity; //how much debugging/info to print + //we need to be able to set this dynamically for http + bool recover; // whether to recover connections on the net + string filename; // store the path/filename of what is opened for reading +}; +#endif -- cgit v1.2.1