Commit Graph

48 Commits

Author SHA1 Message Date
Kyle Reed
8d7fdeb633
Add edit support for Notepad (#1093)
* WIP file editing

* WIP file editing

* Add "on_pop" handler to navigation.

* WIP Editing

* WIP for draft

* Fix mock and unit tests,  support +newline at end.

* Clean up Painter API and use string_view

* Fix optional rvalue functions

* Fix Result 'take' to be more standard

* FileWrapper stack buffer reads

* Grasping at straws

* Nit

* Move set_on_pop impl to cpp

* Workaround "Open" when file not dirty.

---------

Co-authored-by: kallanreed <kallanreed@outlook.com>
2023-06-01 15:45:55 -07:00
Kyle Reed
e50d8dc148
Move file_wrapper and make testable. (#1085)
* WIP Move file_wrapper and make testable.

* More tests, get text_editor compiling

* Back to working

* Run formatter

---------

Co-authored-by: kallanreed <kallanreed@outlook.com>
2023-05-28 08:44:21 -07:00
Kyle Reed
00667cecf9
Notepad menu (#1072)
* WIP notepad menu
2023-05-26 10:02:17 +02:00
Kyle Reed
98f3bf151f
Lazy line caching for Notepad (#1042)
* easier 'now', start adding text editor

* Adding scrolling to notepad

* Better scrolling

* Better scrolling, off-by-1 bugs

* MVP fit and finish

* Add tiny font and use in Notepad

* Font tweaking, tiny font cursor

* Fix warning

* Format changed files

* WIP No file limit

* WIP - adding CircularBuffer type

* WIP Caching

* add  unit test for circular_buffer

* WIP still have a bug when moving cache forward

* Finish lazy line caching

---------

Co-authored-by: kallanreed <kallanreed@outlook.com>
2023-05-22 13:08:59 -07:00
jLynx
033c4e9a5b
Formatted code (#1007)
* Updated style

* Updated files

* fixed new line

* Updated spacing

* File fix WIP

* Updated to clang 13

* updated comment style

* Removed old comment code
2023-05-19 08:16:05 +12:00
Kyle Reed
a8cdde7bea
Logging Updates (#978)
* log_file ensures directory exists
* Fix audio timestamp path
* Fix auto inc, add subfolder for recordings
* Fix auto inc and support subfolder
2023-05-12 20:08:07 +02:00
Kyle Reed
a832bd433d
Fileman icon toolbar (#975)
* Add cut/copy/paste menu with icons
* Add icons, file limit to fileman
2023-05-11 22:46:38 +02:00
Kyle Reed
8cae998146
Fileman copy/paste support (#970)
* Add copy/paste UI instead of file save
2023-05-10 18:51:09 +02:00
Kyle Reed
c6316f5aa6 Fileman fit and finish 2023-05-03 13:13:15 -07:00
Kyle Reed
2cba96ff36 Support for partner file rename/delete 2023-05-01 09:25:32 -07:00
Kyle Reed
bf4ed416bd Remove expensive path.string() calls, UI changes 2023-04-30 22:42:28 -07:00
notpike
e00d91e1d2 Added return codes for delete_file() and rename_file() for file.hpp 2022-02-01 10:37:38 -08:00
furrtek
441a266dc4 Added back scanning in BHT TX
Added file creation date display in File Manager
2018-01-09 21:12:19 +00:00
furrtek
1b93dd53e8 Tone generator class 2017-11-10 00:25:04 +00:00
furrtek
37ce81383d Added file manager 2017-09-19 20:14:56 +01:00
furrtek
5ce1b8fa60 File size + credits 2017-04-07 00:41:32 +01:00
furrtek
089eeeafe4 Tones bugfix, numbers station voice files search 2017-03-22 03:21:06 +00:00
furrtek
15f66eb74e Soundboard bugfix: shouldn't crash with long file names 2017-02-01 23:31:16 +00:00
furrtek
5e40669cbc Merge 'upstream/master' - At least it builds... 2017-01-16 03:45:44 +00:00
Jared Boone
431aae333a Move additional FR_* error values to file.hpp for public use. 2016-12-06 09:34:45 -08:00
Jared Boone
aed58f2a3f File: Stop copying path when iterating.
TODO: I bet I've made this mistake a billion other places...
2016-10-01 10:47:21 -07:00
Jared Boone
86f672af2b File: Add misc useful API from C++17. 2016-10-01 10:44:11 -07:00
Jared Boone
b87d1456a2 File: Make path a first-class object, add some methods from C++17. 2016-09-08 12:57:34 -07:00
Jared Boone
f80706cb34 File: Extract function to convert path to string. 2016-09-07 22:20:51 -07:00
Jared Boone
79330015ed File: Clean up directory_iterator construction, preserve pattern.
FatFs requires pattern pointer to be stable during search.
2016-09-07 20:46:45 -07:00
furrtek
808f99647e Soundboard: Arbitrary samplerate support for wave files
Screenshots
2016-08-26 09:54:17 +02:00
furrtek
f7e0f36bd9 Added Soundboard
file.cpp: scan_root_files
proc_audiotx.cpp: bandwidth setting
ui_widget.cpp: button on_focus
2016-08-26 08:11:24 +02:00
Jared Boone
ed791ac5bd File: Widen size/offset types for 64-bit filesystems. 2016-08-21 22:15:19 -07:00
Jared Boone
f7bfde73b6 FatFs: Enable long file name support.
Lots of re-plumbing to make this work, including a bunch of Unicode stuff now in the binary. Bloat City, I'm sure.

TODO: FatFs using unsigned (uint16_t) for UTF16 representation is kinda inconvenient. Lots of reinterpret_cast<>().
2016-08-21 18:06:39 -07:00
Jared Boone
ffa797b926 File: Remove puts(), add write_line(), cascade changes in interface. 2016-07-24 20:39:21 -07:00
Jared Boone
ff17f8f293 File: Do not use f_error() in puts(), it doesn't return the reason for failure.
TODO: Improve puts() behavior to return a more specific error than FR_EOF.
2016-07-24 19:13:39 -07:00
Jared Boone
d556ef38b4 File: Make incomplete write()s return FR_DISK_FULL. 2016-07-24 19:12:37 -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
d905c446bf Fix integer width oops calculating disk space(). 2016-05-13 18:10:23 -07:00
Jared Boone
1df505331a Handle File errors beyond FatFs. 2016-05-12 21:55:01 -07:00
Jared Boone
b21758781c Preserve File error state once error occurs. 2016-05-12 21:54:13 -07:00
Jared Boone
4567db2fdb Add std::filesystem::filesystem_error object.
Not a standards-compliant implementation, but has the same vague shape, so should be easier to port later(?).
2016-05-12 18:19:28 -07:00
Jared Boone
f157c13442 Implement std::filesystem::space(). 2016-05-11 10:58:57 -07:00
Jared Boone
80f94cbc29 Add File seek support. 2016-05-01 11:29:44 -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
12b8a1b2a9 Change next-file naming functions to work on filename stems.
This paves the way for writing metadata files with similar prefixes, and avoids confusing numbering of capture files with different extensions (e.g. BAD_0000.S16 and BBD_0000.S8).
2016-04-29 11:27:12 -07:00
Jared Boone
f49d04fe7a Functions to select next filename based on matching pattern.
Used for capture, audio, screenshot file naming.
2016-04-20 09:57:17 -07:00
Jared Boone
7492984144 Add filesystem directory enumeration.
Borrow API from std::filesystem -- Boost and C++17.
2016-04-20 09:56:35 -07:00
Jared Boone
0a9d7ec8d8 Add File::open_for_reading().
Barf.
2016-04-10 15:56:34 -07:00
Jared Boone
38ba02a68f Change File::open to File::open_for_writing.
Not thrilled about the File API right now...
2016-04-10 15:55:01 -07:00
Jared Boone
083711ceb2 Add File::open(), use inside File::open_for_append(). 2016-02-18 21:33:38 -08:00
Jared Boone
3172fb1ad6 Make assorted arguments pass-by-reference. 2016-02-06 16:23:20 -08:00
Jared Boone
fc7a7d753d Extract general File class from LogFile. 2016-01-17 14:20:02 -08:00