Skip to content
Browse files

ditch the now unused CDDAReader class

  • Loading branch information...
1 parent 9e63d50 commit a3d7289bec0942cb737e5bd7d6a3d83dca75f84c spiff committed Jun 1, 2012
View
4 project/VS2010Express/XBMC.vcxproj
@@ -1389,7 +1389,6 @@
<ClCompile Include="..\..\xbmc\addons\Scraper.cpp" />
<ClCompile Include="..\..\xbmc\addons\ScreenSaver.cpp" />
<ClCompile Include="..\..\xbmc\addons\Visualisation.cpp" />
- <ClCompile Include="..\..\xbmc\cdrip\CDDAReader.cpp" />
<ClCompile Include="..\..\xbmc\cdrip\CDDARipJob.cpp" />
<ClCompile Include="..\..\xbmc\cdrip\CDDARipper.cpp" />
<ClCompile Include="..\..\xbmc\cdrip\Encoder.cpp" />
@@ -2187,7 +2186,6 @@
<ClInclude Include="..\..\xbmc\addons\Scraper.h" />
<ClInclude Include="..\..\xbmc\addons\ScreenSaver.h" />
<ClInclude Include="..\..\xbmc\addons\Visualisation.h" />
- <ClInclude Include="..\..\xbmc\cdrip\CDDAReader.h" />
<ClInclude Include="..\..\xbmc\cdrip\CDDARipJob.h" />
<ClInclude Include="..\..\xbmc\cdrip\CDDARipper.h" />
<ClInclude Include="..\..\xbmc\cdrip\DllLameenc.h" />
@@ -2284,4 +2282,4 @@
</VisualStudio>
</ProjectExtensions>
<Import Project="$(SolutionDir)\$(ProjectFileName).targets.user" Condition="Exists('$(SolutionDir)\$(ProjectFileName).targets.user')" />
-</Project>
+</Project>
View
6 project/VS2010Express/XBMC.vcxproj.filters
@@ -849,9 +849,6 @@
<ClCompile Include="..\..\xbmc\music\Song.cpp">
<Filter>music</Filter>
</ClCompile>
- <ClCompile Include="..\..\xbmc\cdrip\CDDAReader.cpp">
- <Filter>cdrip</Filter>
- </ClCompile>
<ClCompile Include="..\..\xbmc\cdrip\CDDARipper.cpp">
<Filter>cdrip</Filter>
</ClCompile>
@@ -3342,9 +3339,6 @@
<ClInclude Include="..\..\xbmc\cdrip\EncoderWav.h">
<Filter>cdrip</Filter>
</ClInclude>
- <ClInclude Include="..\..\xbmc\cdrip\CDDAReader.h">
- <Filter>cdrip</Filter>
- </ClInclude>
<ClInclude Include="..\..\xbmc\cdrip\CDDARipJob.h">
<Filter>cdrip</Filter>
</ClInclude>
View
150 xbmc/cdrip/CDDAReader.cpp
@@ -1,150 +0,0 @@
-/*
- * Copyright (C) 2005-2008 Team XBMC
- * http://www.xbmc.org
- *
- * This Program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This Program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- */
-
-#include "system.h"
-
-#ifdef HAS_CDDA_RIPPER
-
-#include "CDDAReader.h"
-#include <cdio/cdio.h>
-#include "utils/log.h"
-
-#define SECTOR_COUNT 52
-
-CCDDAReader::CCDDAReader() : CThread("CCDDAReader")
-{
- m_sRipBuffer[0].pbtStream = NULL;
- m_sRipBuffer[1].pbtStream = NULL;
-
- m_iCurrentBuffer = 0;
-}
-
-CCDDAReader::~CCDDAReader()
-{
- m_bStop = true;
- StopThread();
-
- if (m_sRipBuffer[0].pbtStream) delete []m_sRipBuffer[0].pbtStream;
- if (m_sRipBuffer[1].pbtStream) delete []m_sRipBuffer[1].pbtStream;
-}
-
-bool CCDDAReader::Init(const char* strFileName)
-{
- // Open the Ripper session
- if (!m_fileCdda.Open(strFileName))
- return false;
-
- CLog::Log(LOGINFO, "%s, Sectors %"PRId64, strFileName, m_fileCdda.GetLength() / CDIO_CD_FRAMESIZE_RAW);
-
- // allocate 2 buffers
- // read around 128k per chunk. This makes the cd reading less noisy.
- m_sRipBuffer[0].pbtStream = new BYTE[CDIO_CD_FRAMESIZE_RAW * SECTOR_COUNT];
- m_sRipBuffer[1].pbtStream = new BYTE[CDIO_CD_FRAMESIZE_RAW * SECTOR_COUNT];
-
- Create(false, THREAD_MINSTACKSIZE);
-
- return true;
-}
-
-bool CCDDAReader::DeInit()
-{
- m_bStop = true;
- StopThread();
-
- m_iCurrentBuffer = 0;
-
- // free buffers
- if (m_sRipBuffer[0].pbtStream) delete []m_sRipBuffer[0].pbtStream;
- m_sRipBuffer[0].pbtStream = NULL;
- if (m_sRipBuffer[1].pbtStream) delete []m_sRipBuffer[1].pbtStream;
- m_sRipBuffer[1].pbtStream = NULL;
-
- // Close the Ripper session
- m_fileCdda.Close();
-
- return true;
-}
-
-int CCDDAReader::GetPercent()
-{
- return (int)((m_fileCdda.GetPosition()*100) / m_fileCdda.GetLength());
-}
-
-int CCDDAReader::GetTrackLength()
-{
- return (int)m_fileCdda.GetLength();
-}
-
-int CCDDAReader::ReadChunk()
-{
- // Read data
- DWORD dwBytesRead = m_fileCdda.Read(m_sRipBuffer[m_iCurrentBuffer].pbtStream, SECTOR_COUNT * CDIO_CD_FRAMESIZE_RAW);
- if (dwBytesRead == 0)
- {
- m_sRipBuffer[m_iCurrentBuffer].lBytesRead = 0;
- return CDDARIP_ERR;
- }
-
- m_sRipBuffer[m_iCurrentBuffer].lBytesRead = dwBytesRead;
-
- if (m_fileCdda.GetPosition() == m_fileCdda.GetLength()) return CDDARIP_DONE;
-
- return CDDARIP_OK;
-}
-
-void CCDDAReader::Process()
-{
- // fill first buffer
- m_iCurrentBuffer = 0;
-
- m_sRipBuffer[0].iRipError = ReadChunk();
- m_hDataReadyEvent.Set();
-
- while (!m_bStop)
- {
- // wait until someone called GetData()
- if (AbortableWait(m_hReadEvent) == WAIT_SIGNALED)
- {
- // event generated by m_hReadEvent, continue
- // switch buffer and start reading in this one
- m_iCurrentBuffer = m_iCurrentBuffer ? 0 : 1;
- m_sRipBuffer[m_iCurrentBuffer].iRipError = ReadChunk();
-
- m_hDataReadyEvent.Set();
- }
- }
-}
-
-int CCDDAReader::GetData(BYTE** stream, long& lBytes)
-{
- // wait until we are sure we have a buffer that is filled
- AbortableWait(m_hDataReadyEvent);
-
- int iError = m_sRipBuffer[m_iCurrentBuffer].iRipError;
- *stream = m_sRipBuffer[m_iCurrentBuffer].pbtStream;
- lBytes = m_sRipBuffer[m_iCurrentBuffer].lBytesRead;
-
- // got data buffer, signal thread so it can start filling the other buffer
- m_hReadEvent.Set();
- return iError;
-}
-
-#endif
View
70 xbmc/cdrip/CDDAReader.h
@@ -1,70 +0,0 @@
-#ifndef _CCDDAREADER_H
-#define _CCDDAREADER_H
-
-/*
- * Copyright (C) 2005-2008 Team XBMC
- * http://www.xbmc.org
- *
- * This Program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This Program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- */
-
-#define CDDARIP_OK 0
-#define CDDARIP_ERR 1
-#define CDDARIP_DONE 2
-
-#include "threads/Thread.h"
-
-#include "FileItem.h"
-#include "filesystem/File.h"
-#include "threads/Event.h"
-
-struct RipBuffer
-{
- int iRipError;
- long lBytesRead;
- BYTE* pbtStream;
- HANDLE hEvent;
-};
-
-class CCDDAReader : public CThread
-{
-public:
- CCDDAReader();
- virtual ~CCDDAReader();
- int GetData(BYTE** stream, long& lBytes);
- bool Init(const char* strFileName);
- bool DeInit();
- int GetPercent();
- int GetTrackLength();
-protected:
- void Process();
- int ReadChunk();
-
- long m_lBufferSize;
-
- RipBuffer m_sRipBuffer[2]; // hold space for 2 buffers
- int m_iCurrentBuffer; // 0 or 1
-
- CEvent m_hReadEvent; // data is fetched
- CEvent m_hDataReadyEvent; // data is ready to be fetched
-
- bool m_iInitialized;
-
- XFILE::CFile m_fileCdda;
-};
-
-#endif // _CCDDAREADER_H
View
1 xbmc/cdrip/Makefile.in
@@ -1,6 +1,5 @@
SRCS=CDDARipJob.cpp \
CDDARipper.cpp \
- CDDAReader.cpp \
Encoder.cpp \
EncoderFFmpeg.cpp \
EncoderFlac.cpp \

0 comments on commit a3d7289

Please sign in to comment.
Something went wrong with that request. Please try again.