PageRenderTime 21ms CodeModel.GetById 17ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamStack.h

http://github.com/xbmc/xbmc
C++ Header | 57 lines | 29 code | 9 blank | 19 comment | 0 complexity | e1d16b8095ff102672ea2307b9a18f9b MD5 | raw file
 1#pragma once
 2
 3/*
 4 *      Copyright (C) 2005-2013 Team XBMC
 5 *      http://xbmc.org
 6 *
 7 *  This Program is free software; you can redistribute it and/or modify
 8 *  it under the terms of the GNU General Public License as published by
 9 *  the Free Software Foundation; either version 2, or (at your option)
10 *  any later version.
11 *
12 *  This Program is distributed in the hope that it will be useful,
13 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
14 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 *  GNU General Public License for more details.
16 *
17 *  You should have received a copy of the GNU General Public License
18 *  along with XBMC; see the file COPYING.  If not, see
19 *  <http://www.gnu.org/licenses/>.
20 *
21 */
22
23#include "DVDInputStream.h"
24#include "boost/shared_ptr.hpp"
25
26class CDVDInputStreamStack : public CDVDInputStream
27{
28public:
29  CDVDInputStreamStack();
30  virtual ~CDVDInputStreamStack();
31
32  virtual bool    Open(const char* path, const std::string &content);
33  virtual void    Close();
34  virtual int     Read(uint8_t* buf, int buf_size);
35  virtual int64_t Seek(int64_t offset, int whence);
36  virtual bool Pause(double dTime) { return false; };
37  virtual bool    IsEOF();
38  virtual int64_t GetLength();
39
40protected:
41
42  typedef boost::shared_ptr<XFILE::CFile> TFile;
43
44  struct TSeg
45  {
46    TFile   file;
47    int64_t length;
48  };
49
50  typedef std::vector<TSeg> TSegVec;
51
52  TSegVec m_files;  ///< collection of open ptr's to all files in stack
53  TFile   m_file;   ///< currently active file
54  bool    m_eof;
55  int64_t m_pos;
56  int64_t m_length;
57};