2022-09-25 21:49:24 +00:00
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
//
|
2022-12-05 17:58:23 +00:00
|
|
|
|
// SCSI Target Emulator PiSCSI
|
2022-09-25 21:49:24 +00:00
|
|
|
|
// for Raspberry Pi
|
|
|
|
|
//
|
|
|
|
|
// Copyright (C) 2001-2006 PI.(ytanaka@ipc-tokai.or.jp)
|
|
|
|
|
// Copyright (C) 2014-2020 GIMONS
|
|
|
|
|
// Copyright (C) akuker
|
|
|
|
|
//
|
2022-10-04 15:23:42 +00:00
|
|
|
|
// Licensed under the BSD 3-Clause License.
|
2022-09-25 21:49:24 +00:00
|
|
|
|
// See LICENSE file in the project root folder.
|
|
|
|
|
//
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2023-10-15 06:38:15 +00:00
|
|
|
|
#include <cstdint>
|
2022-10-25 08:29:57 +00:00
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
|
|
using namespace std;
|
2022-09-25 21:49:24 +00:00
|
|
|
|
|
|
|
|
|
class CDTrack final
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
CDTrack() = default;
|
|
|
|
|
~CDTrack() = default;
|
|
|
|
|
|
2022-10-08 17:26:04 +00:00
|
|
|
|
void Init(int track, uint32_t first, uint32_t last);
|
2022-09-25 21:49:24 +00:00
|
|
|
|
|
|
|
|
|
// Properties
|
2022-10-25 08:29:57 +00:00
|
|
|
|
void SetPath(bool, string_view); // Set the path
|
|
|
|
|
string GetPath() const; // Get the path
|
2022-09-25 21:49:24 +00:00
|
|
|
|
uint32_t GetFirst() const; // Get the start LBA
|
|
|
|
|
uint32_t GetLast() const; // Get the last LBA
|
|
|
|
|
uint32_t GetBlocks() const; // Get the number of blocks
|
|
|
|
|
int GetTrackNo() const; // Get the track number
|
2022-10-08 17:26:04 +00:00
|
|
|
|
bool IsValid(uint32_t lba) const; // Is this a valid LBA?
|
2022-09-25 21:49:24 +00:00
|
|
|
|
bool IsAudio() const; // Is this an audio track?
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
bool valid = false; // Valid track
|
|
|
|
|
int track_no = -1; // Track number
|
|
|
|
|
uint32_t first_lba = 0; // First LBA
|
|
|
|
|
uint32_t last_lba = 0; // Last LBA
|
|
|
|
|
bool audio = false; // Audio track flag
|
2022-10-25 08:29:57 +00:00
|
|
|
|
|
|
|
|
|
string imgpath; // Image file path
|
2022-09-25 21:49:24 +00:00
|
|
|
|
};
|