Commit Graph

37 Commits

Author SHA1 Message Date
Jared Boone
46b3d9d087 Disallow copy constructors/assignments.
For classes containing pointers/state that should not be copied.
2016-11-26 16:52:57 -08:00
Jared Boone
4eb0facacb Add lots of value constructors. 2016-11-26 16:50:44 -08:00
Jared Boone
5dfb53263a Extract BufferExchange, simplify threading. 2016-10-06 13:38:56 -07:00
Jared Boone
a5793b8b9d Put Reader, Writer inside "stream" namespace. 2016-10-04 17:13:21 -07:00
Jared Boone
1bdca0fd8d Extract (some) Writer classes to separate files.
TODO: PNGWriter could probably reuse this stuff too, but...
2016-10-04 09:57:13 -07:00
Jared Boone
ed791ac5bd File: Widen size/offset types for 64-bit filesystems. 2016-08-21 22:15:19 -07:00
Jared Boone
003ce4990d Move CaptureThread::static_fn into .cpp. 2016-06-21 12:15:57 -07:00
Jared Boone
81d4e59aeb Add CaptureThread success_callback. 2016-06-21 11:53:07 -07:00
Jared Boone
4ffb05212e Pass error_callback by value. 2016-06-21 11:52:05 -07:00
Jared Boone
cfaa44b02a Send CaptureThread error into app-local message queue. 2016-06-21 11:04:10 -07:00
Jared Boone
dbc2a5c9ea Hide CaptureThread event mask, only used internally. 2016-06-19 11:20:45 -07:00
Jared Boone
682a1706a3 Improve File error handling. Massive effects...
API is somewhat stolen from Rust std::fs::File. Static factories didn't work out so well, though. Move semantics made my head explode.
TODO: Still a lot of places where errors aren't handled, but it's an improvement...
2016-05-16 14:01:44 -07:00
Jared Boone
ebf0e765ce Expose Writer errors through CaptureThread. 2016-05-12 21:58:15 -07:00
Jared Boone
87505f833b Expose filesystem errors on Writer. 2016-05-12 21:57:38 -07:00
Jared Boone
b82eff51dd Refactor of capture buffer management between cores.
Instead of copying data into and out of FIFO, passing buffer pointers between cores that are sized to match preferred/ideal SD card write size.
2016-05-10 14:12:37 -07:00
Jared Boone
eeb4645242 Move lots of capture_thread code to .cpp. 2016-05-02 12:50:49 -07:00
Jared Boone
697df07501 Move Writer implementations to ui_record_view.cpp. 2016-05-02 12:34:42 -07:00
Jared Boone
68faccfd10 Update Writer default destructor syntax. 2016-05-02 11:22:14 -07:00
Jared Boone
fa8105266c WAVFileWriter saves WAV files! 2016-05-01 11:31:20 -07:00
Jared Boone
c5cae1034e Forgot virtual destructor on interface class.
So my Files weren't getting closed properly!
2016-05-01 11:29:19 -07:00
Jared Boone
0445a842db Rename args on Writer interface. 2016-05-01 11:07:50 -07:00
Jared Boone
2be105853e Shrink CaptureThread stack, undid earlier increase.
Moved File into Writer abstraction, passed in now, not created on stack.
2016-04-30 16:55:52 -07:00
Jared Boone
6a17be1f2c Abstract CaptureThread target class into Writer, implement RawFileWriter. 2016-04-30 16:34:50 -07:00
Jared Boone
b5fbab8e29 Pass a File into CaptureThread.
Groundwork for having a general output-stream interface.
2016-04-30 16:26:49 -07:00
Jared Boone
a2a2de9a23 Increase CaptureThread stack, now that File is created in new thread. 2016-04-30 15:13:54 -07:00
Jared Boone
0d6103916d Converge File object with std::fstream. Simplify LogFile.
LogFile no longer watches SD card presence and tries to open/close files dynamically.
2016-04-30 15:09:34 -07:00
Jared Boone
6ee886b90e Expose capture state to the UI. 2016-04-27 12:06:47 -07:00
Jared Boone
7430e31578 Extract CaptureConfig from StreamOutput to CaptureThread.
So capture stats can be exposed by CaptureThread.
2016-04-27 10:56:50 -07:00
Jared Boone
75159fcc00 Use static StreamOutput::fifo for accessor methods. 2016-04-27 10:52:11 -07:00
Jared Boone
dc1ba7e6f3 Move CaptureThread::write_size into run(). 2016-04-27 10:44:44 -07:00
Jared Boone
ca5dadab93 Set CaptureThread::thread to null after thread is released.
Was having a timing problem where ISR was still trying to signal thread after thread was nulled.
2016-04-27 10:13:50 -07:00
Jared Boone
4a348e2c6c Revise CaptureThread loop to not get stuck if SD write speed too slow. 2016-04-27 10:12:21 -07:00
Jared Boone
91ee2dbb67 Move FIFO and write size to CaptureConfig structure.
Now configured from baseband, where write size and appropriate FIFO size is known.
2016-04-26 22:26:30 -07:00
Jared Boone
c585f3d4ea Rename EVT_FIFO_HIGHWATER -> EVT_MASK_CAPTURE_THREAD. 2016-04-23 17:30:55 -07:00
Jared Boone
d5e21ce972 Use CaptureConfig to share state between cores.
Remove awful FIFO_HACK.
TODO: Lots of repeated code...
TODO: Capture thread is signalled too frequently.
2016-04-23 15:07:44 -07:00
Jared Boone
8b8b394792 Hide FIFO hack inside StreamOutput.
First step in a long refactor and evolution of the capture code.
2016-04-22 16:21:31 -07:00
Jared Boone
a6538bc48b Rename AudioThread -> CaptureThread.
...since it's doing baseband capturing too, and doesn't really know what kind of data it's moving.
2016-04-22 12:15:51 -07:00