decoder-core.h
author nathan
Sat, 29 Dec 2007 14:49:09 +0100
branchtrunk
changeset 2 4c1f7b705009
parent 0 474a1293c3c0
child 25 887faebaba0a
permissions -rw-r--r--
release 0.10.1
     1 /*
     2  * MP3/MPlayer plugin to VDR (C++)
     3  *
     4  * (C) 2001-2005 Stefan Huelswitt <s.huelswitt@gmx.de>
     5  *
     6  * This code is free software; you can redistribute it and/or
     7  * modify it under the terms of the GNU General Public License
     8  * as published by the Free Software Foundation; either version 2
     9  * of the License, or (at your option) any later version.
    10  *
    11  * This code is distributed in the hope that it will be useful,
    12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    14  * GNU General Public License for more details.
    15  *
    16  * You should have received a copy of the GNU General Public License
    17  * along with this program; if not, write to the Free Software
    18  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
    19  * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
    20  */
    21 
    22 #ifndef ___DECODER_CORE_H
    23 #define ___DECODER_CORE_H
    24 
    25 #include "decoder.h"
    26 
    27 #define DEC_ID(a,b,c,d) (((a)<<24)+((b)<<16)+((c)<<8)+(d))
    28 
    29 // ----------------------------------------------------------------
    30 
    31 enum eDecodeStatus { dsOK=0, dsPlay, dsSkip, dsEof, dsError, dsSoftError };
    32 
    33 struct Decode {
    34   eDecodeStatus status;
    35   int index;
    36   struct mad_pcm *pcm;
    37   };
    38 
    39 // ----------------------------------------------------------------
    40 
    41 #define CACHE_VERSION 7
    42 
    43 class cCacheData : public cSongInfo, public cFileInfo, public cListObject {
    44 friend class cInfoCache;
    45 private:
    46   int hash, version;
    47   time_t touch;
    48   cMutex lock;
    49 protected:
    50   bool Save(FILE *f);
    51   bool Load(FILE *f);
    52   bool Upgrade(void);
    53   void Touch(void);
    54   bool Purge(void);
    55   void Create(cFileInfo *fi, cSongInfo *si);
    56 public:
    57   cCacheData(void);
    58   void Lock(void) { lock.Lock(); }
    59   void Unlock(void) { lock.Unlock(); }
    60   };
    61 
    62 // ----------------------------------------------------------------
    63 
    64 #endif //___DECODER_CORE_H