Skip to content

Commit

Permalink
CDImage: Merge bin/ecm handling into one class
Browse files Browse the repository at this point in the history
Means that cuesheets with ECM tracks will now load as expected.
  • Loading branch information
stenzek committed Nov 23, 2024
1 parent 7e23a23 commit f538e6a
Show file tree
Hide file tree
Showing 8 changed files with 510 additions and 632 deletions.
2 changes: 0 additions & 2 deletions src/util/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@ add_library(util
audio_stream.h
cd_image.cpp
cd_image.h
cd_image_bin.cpp
cd_image_cue.cpp
cd_image_chd.cpp
cd_image_device.cpp
cd_image_ecm.cpp
cd_image_hasher.cpp
cd_image_hasher.h
cd_image_m3u.cpp
Expand Down
6 changes: 1 addition & 5 deletions src/util/cd_image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,18 +83,14 @@ std::unique_ptr<CDImage> CDImage::Open(const char* filename, bool allow_patches,
image = OpenCueSheetImage(filename, error);
}
else if (StringUtil::Strcasecmp(extension, ".bin") == 0 || StringUtil::Strcasecmp(extension, ".img") == 0 ||
StringUtil::Strcasecmp(extension, ".iso") == 0)
StringUtil::Strcasecmp(extension, ".iso") == 0 || StringUtil::Strcasecmp(extension, ".ecm") == 0)
{
image = OpenBinImage(filename, error);
}
else if (StringUtil::Strcasecmp(extension, ".chd") == 0)
{
image = OpenCHDImage(filename, error);
}
else if (StringUtil::Strcasecmp(extension, ".ecm") == 0)
{
image = OpenEcmImage(filename, error);
}
else if (StringUtil::Strcasecmp(extension, ".mds") == 0)
{
image = OpenMdsImage(filename, error);
Expand Down
5 changes: 2 additions & 3 deletions src/util/cd_image.h
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,9 @@ class CDImage

// Opening disc image.
static std::unique_ptr<CDImage> Open(const char* filename, bool allow_patches, Error* error);
static std::unique_ptr<CDImage> OpenBinImage(const char* filename, Error* error);
static std::unique_ptr<CDImage> OpenCueSheetImage(const char* filename, Error* error);
static std::unique_ptr<CDImage> OpenBinImage(const char* path, Error* error);
static std::unique_ptr<CDImage> OpenCueSheetImage(const char* path, Error* error);
static std::unique_ptr<CDImage> OpenCHDImage(const char* filename, Error* error);
static std::unique_ptr<CDImage> OpenEcmImage(const char* filename, Error* error);
static std::unique_ptr<CDImage> OpenMdsImage(const char* filename, Error* error);
static std::unique_ptr<CDImage> OpenPBPImage(const char* filename, Error* error);
static std::unique_ptr<CDImage> OpenM3uImage(const char* filename, bool apply_patches, Error* error);
Expand Down
135 changes: 0 additions & 135 deletions src/util/cd_image_bin.cpp

This file was deleted.

Loading

0 comments on commit f538e6a

Please sign in to comment.