Audacity 3.2.0
|
Helper class based on wxOutputStream used to get a png file in text format. More...
Public Member Functions | |
SourceOutputStream () | |
int | OpenFile (const FilePath &Filename) |
Opens the file and also adds a standard comment at the start of it. More... | |
virtual | ~SourceOutputStream () |
Destructor. We close our text stream in here. More... | |
Protected Member Functions | |
size_t | OnSysWrite (const void *buffer, size_t bufsize) override |
Protected Attributes | |
wxFile | File |
int | nBytes |
Helper class based on wxOutputStream used to get a png file in text format.
Allows us to capture output of the Save .png and 'pipe' it into our own output function which gives a series of numbers.
The trick used here is that wxWidgets can write a PNG image to a stream. By writing to a custom stream, we get to see each byte of data in turn, convert it to text, put in commas, and then write that out to our own text stream.
This class is currently used by Theme to pack its images into the image cache. Perhaps someday we will improve FlowPacker and make it more flexible, and use it for toolbar and window layouts too.
|
virtual |
|
overrideprotected |
This is the 'callback' function called with each write of PNG data to the stream. This is where we conveet to text and add commas.
Definition at line 525 of file Theme.cpp.
References File, nBytes, and wxT().
int SourceOutputStream::OpenFile | ( | const FilePath & | Filename | ) |
Opens the file and also adds a standard comment at the start of it.
Definition at line 506 of file Theme.cpp.
References File, nBytes, and wxT().
Referenced by ThemeBase::CreateOneImageCache().
|
protected |
Definition at line 501 of file Theme.cpp.
Referenced by OnSysWrite(), OpenFile(), and ~SourceOutputStream().
|
protected |
Definition at line 502 of file Theme.cpp.
Referenced by OnSysWrite(), and OpenFile().