Skip to content

Commit

Permalink
Merge pull request xbmc#22017 from notspiff/file_header_cleanup
Browse files Browse the repository at this point in the history
Some filesystem/File.h header cleanup
  • Loading branch information
notspiff committed Oct 11, 2022
2 parents d8a36ca + c0f06dd commit 98eac2e
Show file tree
Hide file tree
Showing 28 changed files with 64 additions and 35 deletions.
1 change: 1 addition & 0 deletions xbmc/addons/AddonInstaller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include "events/NotificationEvent.h"
#include "favourites/FavouritesService.h"
#include "filesystem/Directory.h"
#include "filesystem/File.h"
#include "guilib/GUIComponent.h"
#include "guilib/GUIWindowManager.h" // for callback
#include "guilib/LocalizeStrings.h"
Expand Down
1 change: 1 addition & 0 deletions xbmc/addons/FilesystemInstaller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

#include "FileItem.h"
#include "filesystem/Directory.h"
#include "filesystem/File.h"
#include "filesystem/SpecialProtocol.h"
#include "utils/FileOperationJob.h"
#include "utils/StringUtils.h"
Expand Down
1 change: 0 additions & 1 deletion xbmc/addons/settings/AddonSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#include "addons/gui/GUIDialogAddonSettings.h"
#include "addons/settings/SettingUrlEncodedString.h"
#include "filesystem/Directory.h"
#include "filesystem/File.h"
#include "guilib/GUIComponent.h"
#include "guilib/LocalizeStrings.h"
#include "messaging/ApplicationMessenger.h"
Expand Down
1 change: 1 addition & 0 deletions xbmc/application/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include "dialogs/GUIDialogKaiToast.h"
#include "events/EventLog.h"
#include "events/NotificationEvent.h"
#include "filesystem/File.h"
#include "guilib/GUIComponent.h"
#include "guilib/GUIControlProfiler.h"
#include "guilib/GUIFontManager.h"
Expand Down
3 changes: 3 additions & 0 deletions xbmc/cdrip/Encoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,16 @@

#include "Encoder.h"

#include "filesystem/File.h"
#include "utils/log.h"

#include <string.h>
#include <utility>

using namespace KODI::CDRIP;

CEncoder::CEncoder() = default;

CEncoder::~CEncoder()
{
FileClose();
Expand Down
8 changes: 6 additions & 2 deletions xbmc/cdrip/Encoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,17 @@
#pragma once

#include "IEncoder.h"
#include "filesystem/File.h"

#include <memory>
#include <stdint.h>
#include <stdio.h>
#include <string>

namespace XFILE
{
class CFile;
}

namespace KODI
{
namespace CDRIP
Expand All @@ -26,7 +30,7 @@ constexpr size_t WRITEBUFFER_SIZE = 131072; // 128k buffer
class CEncoder : public IEncoder
{
public:
CEncoder() = default;
CEncoder();
virtual ~CEncoder();

bool EncoderInit(const std::string& strFile, int iInChannels, int iInRate, int iInBits);
Expand Down
6 changes: 4 additions & 2 deletions xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESound.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
* See LICENSES/README.md for more information.
*/

#include "cores/AudioEngine/Interfaces/AESound.h"
#include "ActiveAE.h"
#include "ActiveAESound.h"

#include "ActiveAE.h"
#include "cores/AudioEngine/Interfaces/AESound.h"
#include "filesystem/File.h"
#include "utils/log.h"

extern "C" {
Expand Down
6 changes: 5 additions & 1 deletion xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESound.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,14 @@

#include "cores/AudioEngine/Engines/ActiveAE/ActiveAEBuffer.h"
#include "cores/AudioEngine/Interfaces/AESound.h"
#include "filesystem/File.h"

class DllAvUtil;

namespace XFILE
{
class CFile;
}

namespace ActiveAE
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#include "URL.h"
#include "filesystem/BlurayCallback.h"
#include "filesystem/Directory.h"
#include "filesystem/File.h"
#include "filesystem/SpecialProtocol.h"
#include "guilib/LocalizeStrings.h"
#include "settings/DiscSettings.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
#include "InputStreamMultiSource.h"

#include "DVDFactoryInputStream.h"
#include "filesystem/File.h"
#include "utils/StringUtils.h"
#include "utils/log.h"

#include <map>
Expand Down
1 change: 0 additions & 1 deletion xbmc/cores/VideoPlayer/DVDSubtitles/DVDSubtitleStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

#include "DVDInputStreams/DVDFactoryInputStream.h"
#include "DVDInputStreams/DVDInputStream.h"
#include "filesystem/File.h"
#include "utils/CharsetConverter.h"
#include "utils/CharsetDetection.h"
#include "utils/URIUtils.h"
Expand Down
14 changes: 14 additions & 0 deletions xbmc/cores/paplayer/AudioDecoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

#include "CodecFactory.h"
#include "FileItem.h"
#include "ICodec.h"
#include "ServiceBroker.h"
#include "application/Application.h"
#include "music/tags/MusicInfoTag.h"
Expand Down Expand Up @@ -141,6 +142,11 @@ AEAudioFormat CAudioDecoder::GetFormat()
return m_codec->m_format;
}

unsigned int CAudioDecoder::GetChannels()
{
return GetFormat().m_channelLayout.Count();
}

int64_t CAudioDecoder::Seek(int64_t time)
{
m_pcmBuffer.Clear();
Expand Down Expand Up @@ -328,6 +334,14 @@ int CAudioDecoder::ReadSamples(int numsamples)
return RET_SLEEP; // nothing to do
}

bool CAudioDecoder::CanSeek()
{
if (m_codec)
return m_codec->CanSeek();
else
return false;
}

float CAudioDecoder::GetReplayGain(float &peakVal)
{
#define REPLAY_GAIN_DEFAULT_LEVEL 89.0f
Expand Down
14 changes: 4 additions & 10 deletions xbmc/cores/paplayer/AudioDecoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@

#pragma once

#include "ICodec.h"
#include "cores/AudioEngine/Utils/AEChannelInfo.h"
#include "threads/CriticalSection.h"
#include "utils/RingBuffer.h"

struct AEAudioFormat;
class CFileItem;
class ICodec;

#define PACKET_SIZE 3840 // audio packet size - we keep 1 in reserve for gapless playback
// using a multiple of 1, 2, 3, 4, 5, 6 to guarantee track alignment
Expand Down Expand Up @@ -48,13 +48,7 @@ class CAudioDecoder

int ReadSamples(int numsamples);

bool CanSeek()
{
if (m_codec)
return m_codec->CanSeek();
else
return false;
}
bool CanSeek();
int64_t Seek(int64_t time);
int64_t TotalTime();
void SetTotalTime(int64_t time);
Expand All @@ -63,7 +57,7 @@ class CAudioDecoder
void SetStatus(int status) { m_status = status; }

AEAudioFormat GetFormat();
unsigned int GetChannels() { return GetFormat().m_channelLayout.Count(); }
unsigned int GetChannels();
// Data management
unsigned int GetDataSize(bool checkPktSize);
void *GetData(unsigned int samples);
Expand Down
2 changes: 2 additions & 0 deletions xbmc/cores/paplayer/PAPlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
#include "PAPlayer.h"

#include "FileItem.h"
#include "ICodec.h"
#include "ServiceBroker.h"
#include "URL.h"
#include "Util.h"
#include "cores/AudioEngine/Interfaces/AE.h"
#include "cores/AudioEngine/Interfaces/AEStream.h"
Expand Down
1 change: 1 addition & 0 deletions xbmc/cores/playercorefactory/PlayerCoreFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include "cores/VideoPlayer/Interface/InputStreamConstants.h"
#include "cores/paplayer/PAPlayer.h"
#include "dialogs/GUIDialogContextMenu.h"
#include "filesystem/File.h"
#include "guilib/LocalizeStrings.h"
#include "profiles/ProfileManager.h"
#include "settings/AdvancedSettings.h"
Expand Down
2 changes: 1 addition & 1 deletion xbmc/dialogs/GUIDialogCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#pragma once

#include "filesystem/File.h"
#include "filesystem/IFileTypes.h"
#include "threads/SystemClock.h"
#include "threads/Thread.h"

Expand Down
7 changes: 0 additions & 7 deletions xbmc/filesystem/File.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,6 @@ namespace XFILE

class IFile;

class IFileCallback
{
public:
virtual bool OnFileCallback(void* pContext, int ipercent, float avgSpeed) = 0;
virtual ~IFileCallback() = default;
};

class CFileStreamBuffer;

class CFile
Expand Down
1 change: 0 additions & 1 deletion xbmc/filesystem/FileCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include "FileCache.h"

#include "CircularCache.h"
#include "File.h"
#include "ServiceBroker.h"
#include "URL.h"
#include "settings/AdvancedSettings.h"
Expand Down
6 changes: 6 additions & 0 deletions xbmc/filesystem/IFileTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,10 @@ enum FileProperty
FILE_PROPERTY_EFFECTIVE_URL /**< Get effective URL for redirected streams */
};

class IFileCallback
{
public:
virtual bool OnFileCallback(void* pContext, int ipercent, float avgSpeed) = 0;
virtual ~IFileCallback() = default;
};
}
2 changes: 2 additions & 0 deletions xbmc/filesystem/UDFBlockInput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

#include "UDFBlockInput.h"

#include "filesystem/File.h"

#include <mutex>

#include <udfread/udfread.h>
Expand Down
6 changes: 5 additions & 1 deletion xbmc/filesystem/UDFBlockInput.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,17 @@

#pragma once

#include "filesystem/File.h"
#include "threads/CriticalSection.h"

#include <memory>

#include <udfread/blockinput.h>

namespace XFILE
{
class CFile;
}

class CUDFBlockInput
{
public:
Expand Down
1 change: 0 additions & 1 deletion xbmc/interfaces/python/XBPython.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#include "ServiceBroker.h"
#include "Util.h"
#include "cores/DllLoader/DllLoaderContainer.h"
#include "filesystem/File.h"
#include "filesystem/SpecialProtocol.h"
#include "interfaces/AnnouncementManager.h"
#include "interfaces/legacy/AddonUtils.h"
Expand Down
1 change: 1 addition & 0 deletions xbmc/network/httprequesthandler/HTTPFileHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#include "HTTPFileHandler.h"

#include "filesystem/File.h"
#include "utils/Mime.h"
#include "utils/StringUtils.h"
#include "utils/URIUtils.h"
Expand Down
1 change: 0 additions & 1 deletion xbmc/network/httprequesthandler/HTTPFileHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#pragma once

#include "XBDateTime.h"
#include "filesystem/File.h"
#include "network/httprequesthandler/IHTTPRequestHandler.h"

#include <string>
Expand Down
2 changes: 1 addition & 1 deletion xbmc/utils/FileOperationJob.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#pragma once

#include "FileItem.h"
#include "filesystem/File.h"
#include "filesystem/IFileTypes.h"
#include "utils/ProgressJob.h"

#include <string>
Expand Down
1 change: 1 addition & 0 deletions xbmc/utils/FileUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include "URIUtils.h"
#include "URL.h"
#include "Util.h"
#include "filesystem/File.h"
#include "filesystem/MultiPathDirectory.h"
#include "filesystem/SpecialProtocol.h"
#include "filesystem/StackDirectory.h"
Expand Down
2 changes: 1 addition & 1 deletion xbmc/video/VideoInfoDownloader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "VideoInfoDownloader.h"

#include "dialogs/GUIDialogProgress.h"
#include "messaging/ApplicationMessenger.h"
#include "filesystem/CurlFile.h"
#include "messaging/helpers/DialogOKHelper.h"
#include "utils/Variant.h"
#include "utils/log.h"
Expand Down
5 changes: 4 additions & 1 deletion xbmc/video/VideoInfoDownloader.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include "Episode.h"
#include "VideoInfoTag.h"
#include "addons/Scraper.h"
#include "filesystem/CurlFile.h"
#include "threads/Thread.h"

#include <string>
Expand All @@ -25,6 +24,10 @@ namespace ADDON
{
class CScraperError;
}
namespace XFILE
{
class CurlFile;
}

typedef std::vector<CScraperUrl> MOVIELIST;

Expand Down

0 comments on commit 98eac2e

Please sign in to comment.