2016-07-10 18:36:52 -04:00
|
|
|
//
|
|
|
|
// PCMTrack.hpp
|
|
|
|
// Clock Signal
|
|
|
|
//
|
|
|
|
// Created by Thomas Harte on 10/07/2016.
|
|
|
|
// Copyright © 2016 Thomas Harte. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef PCMTrack_hpp
|
|
|
|
#define PCMTrack_hpp
|
|
|
|
|
2017-09-22 22:39:23 -04:00
|
|
|
#include "Track.hpp"
|
2016-12-17 21:13:57 -05:00
|
|
|
#include "PCMSegment.hpp"
|
2016-07-10 18:36:52 -04:00
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
namespace Storage {
|
2016-08-27 17:15:09 -04:00
|
|
|
namespace Disk {
|
2016-07-10 18:36:52 -04:00
|
|
|
|
|
|
|
/*!
|
|
|
|
A subclass of @c Track that provides its @c Events by querying a pulse-code modulated record of original
|
|
|
|
flux detections, with an implied index hole at the very start of the data.
|
|
|
|
|
|
|
|
The data may consist of a single @c PCMSegment or of multiple, allowing a PCM-format track to contain
|
|
|
|
multiple distinct segments of data, each with a separate clock rate.
|
|
|
|
*/
|
|
|
|
class PCMTrack: public Track {
|
|
|
|
public:
|
|
|
|
/*!
|
|
|
|
Creates a @c PCMTrack consisting of multiple segments of data, permitting multiple clock rates.
|
|
|
|
*/
|
2016-12-30 14:23:26 -05:00
|
|
|
PCMTrack(const std::vector<PCMSegment> &);
|
2016-07-10 18:36:52 -04:00
|
|
|
|
|
|
|
/*!
|
|
|
|
Creates a @c PCMTrack consisting of a single continuous run of data, implying a constant clock rate.
|
2016-08-01 08:41:16 -04:00
|
|
|
The segment's @c length_of_a_bit will be ignored and therefore need not be filled in.
|
2016-07-10 18:36:52 -04:00
|
|
|
*/
|
2016-12-30 14:23:26 -05:00
|
|
|
PCMTrack(const PCMSegment &);
|
|
|
|
|
|
|
|
/*!
|
|
|
|
Copy constructor; required for Tracks in order to support modifiable disks.
|
|
|
|
*/
|
|
|
|
PCMTrack(const PCMTrack &);
|
2016-07-10 18:36:52 -04:00
|
|
|
|
|
|
|
// as per @c Track
|
|
|
|
Event get_next_event();
|
2016-12-17 16:26:45 -05:00
|
|
|
Time seek_to(const Time &time_since_index_hole);
|
2016-12-30 17:25:39 -05:00
|
|
|
Track *clone();
|
2016-07-10 18:36:52 -04:00
|
|
|
|
|
|
|
private:
|
|
|
|
// storage for the segments that describe this track
|
2016-12-18 21:37:05 -05:00
|
|
|
std::vector<PCMSegmentEventSource> segment_event_sources_;
|
2016-07-10 18:36:52 -04:00
|
|
|
|
|
|
|
// a pointer to the first bit to consider as the next event
|
2016-12-03 11:59:28 -05:00
|
|
|
size_t segment_pointer_;
|
2016-12-18 21:37:05 -05:00
|
|
|
|
|
|
|
PCMTrack();
|
2016-07-10 18:36:52 -04:00
|
|
|
};
|
|
|
|
|
2016-08-27 17:15:09 -04:00
|
|
|
}
|
2016-07-10 18:36:52 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* PCMTrack_hpp */
|