nathan@0: /* nathan@0: * MP3/MPlayer plugin to VDR (C++) nathan@0: * nathan@0: * (C) 2001-2005 Stefan Huelswitt nathan@0: * nathan@0: * This code is free software; you can redistribute it and/or nathan@0: * modify it under the terms of the GNU General Public License nathan@0: * as published by the Free Software Foundation; either version 2 nathan@0: * of the License, or (at your option) any later version. nathan@0: * nathan@0: * This code is distributed in the hope that it will be useful, nathan@0: * but WITHOUT ANY WARRANTY; without even the implied warranty of nathan@0: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the nathan@0: * GNU General Public License for more details. nathan@0: * nathan@0: * You should have received a copy of the GNU General Public License nathan@0: * along with this program; if not, write to the Free Software nathan@0: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. nathan@0: * Or, point your browser to http://www.gnu.org/copyleft/gpl.html nathan@0: */ nathan@0: nathan@0: #ifndef ___DECODER_CORE_H nathan@0: #define ___DECODER_CORE_H nathan@0: nathan@0: #include "decoder.h" nathan@0: nathan@0: #define DEC_ID(a,b,c,d) (((a)<<24)+((b)<<16)+((c)<<8)+(d)) nathan@0: nathan@0: // ---------------------------------------------------------------- nathan@0: nathan@0: enum eDecodeStatus { dsOK=0, dsPlay, dsSkip, dsEof, dsError, dsSoftError }; nathan@0: nathan@0: struct Decode { nathan@0: eDecodeStatus status; nathan@0: int index; nathan@0: struct mad_pcm *pcm; nathan@0: }; nathan@0: nathan@0: // ---------------------------------------------------------------- nathan@0: nathan@0: #define CACHE_VERSION 7 nathan@0: nathan@0: class cCacheData : public cSongInfo, public cFileInfo, public cListObject { nathan@0: friend class cInfoCache; nathan@0: private: nathan@0: int hash, version; nathan@0: time_t touch; nathan@0: cMutex lock; nathan@0: protected: nathan@0: bool Save(FILE *f); nathan@0: bool Load(FILE *f); nathan@0: bool Upgrade(void); nathan@0: void Touch(void); nathan@0: bool Purge(void); nathan@0: void Create(cFileInfo *fi, cSongInfo *si); nathan@0: public: nathan@0: cCacheData(void); nathan@0: void Lock(void) { lock.Lock(); } nathan@0: void Unlock(void) { lock.Unlock(); } nathan@0: }; nathan@0: nathan@0: // ---------------------------------------------------------------- nathan@0: nathan@0: #endif //___DECODER_CORE_H