xbmc
CDDAFile.h
1 /*
2  * Copyright (C) 2005-2018 Team Kodi
3  * This file is part of Kodi - https://kodi.tv
4  *
5  * SPDX-License-Identifier: GPL-2.0-or-later
6  * See LICENSES/README.md for more information.
7  */
8 
9 #pragma once
10 
11 #include "IFile.h"
12 #include "storage/cdioSupport.h"
13 
14 namespace XFILE
15 {
16 class CFileCDDA : public IFile
17 {
18 public:
19  CFileCDDA(void);
20  ~CFileCDDA(void) override;
21  bool Open(const CURL& url) override;
22  bool Exists(const CURL& url) override;
23  int Stat(const CURL& url, struct __stat64* buffer) override;
24 
25  ssize_t Read(void* lpBuf, size_t uiBufSize) override;
26  int64_t Seek(int64_t iFilePosition, int iWhence = SEEK_SET) override;
27  void Close() override;
28  int64_t GetPosition() override;
29  int64_t GetLength() override;
30  int GetChunkSize() override;
31 
32 protected:
33  bool IsValidFile(const CURL& url);
34  int GetTrackNum(const CURL& url);
35 
36 protected:
37  CdIo_t* m_pCdIo;
38  lsn_t m_lsnStart = CDIO_INVALID_LSN; // Start of m_iTrack in logical sector number
39  lsn_t m_lsnCurrent = CDIO_INVALID_LSN; // Position inside the track in logical sector number
40  lsn_t m_lsnEnd = CDIO_INVALID_LSN; // End of m_iTrack in logical sector number
41  int m_iSectorCount; // max number of sectors to read at once
42  std::shared_ptr<MEDIA_DETECT::CLibcdio> m_cdio;
43 };
44 }
ssize_t Read(void *lpBuf, size_t uiBufSize) override
Attempt to read bufSize bytes from currently opened file into buffer bufPtr.
Definition: CDDAFile.cpp:104
Definition: Scraper.h:41
Definition: URL.h:20
int Stat(const CURL &url, struct __stat64 *buffer) override
Fills struct __stat64 with information about file specified by url.
Definition: CDDAFile.cpp:90
Definition: CDDAFile.h:16
Definition: IFile.h:42