|
Krotos Modules 3
|
#include <WaveformViewer.h>
Classes | |
| struct | Layout |
| class | Listener |
Public Types | |
| enum | ColourIds { borderColour = 0x61010001 } |
Public Member Functions | |
| WaveformViewer (Colour waveformColour=Colours::white) | |
| void | addListener (WaveformViewer::Listener *Listener) |
| void | removeListener (WaveformViewer::Listener *Listener) |
| void | paint (Graphics &g) override |
| void | resized () override |
| virtual void | updateWaveformView (const AudioBuffer< float > &newAudio) |
| void | updateWaveformViewInterpolateBuffers (float gainSliderValue, const AudioBuffer< float > &buffer1, const AudioBuffer< float > &buffer2, float samplePosition=0.0f) |
| void | clear () |
| void | waveformZoomed (const AudioBuffer< float > &audioBuffer, int startSample, int numsamples) const |
| void | setWaveformColour (Colour waveformColour) |
| void | setTitle (const String &title) |
| void | setDropText (const String &newText) |
| void | setDrawGrid (bool drawGrid) |
| void | setShowFileName (bool showFileName) |
| void | setShowBorderOnDragHover (bool showBorder) |
| void | setUseExtendedFilePaths (bool val) |
| void | setLimitToSingleDroppedItem (bool val) |
| bool | matchesExpression (const String &expression, const String &stringToTest) |
| void | setRegexFileFilter (const String &newExpression) |
| bool | soundFileTypeIsValid (std::string fileName) |
| Array< File > | getExtendedFilePaths (const StringArray &files) |
| bool | isInterestedInFileDrag (const StringArray &files) |
| void | fileDragEnter (const StringArray &files, int x, int y) |
| void | fileDragExit (const StringArray &files) |
| void | setHoverState (bool newState) |
Public Member Functions inherited from krotos::ZoomableComponent | |
| ZoomableComponent ()=default | |
| ~ZoomableComponent () override=default | |
| void | setHorizontalZoomFactor (float factor) |
| void | setHorizontalZoomCenter (float center) |
| void | setVerticalZoomFactor (float factor) |
| void | setVerticalZoomCenter (float center) |
| void | setHorizontalZoomFromRange (const Range< float > xr) |
| void | SetTransformToFit (int width, int height) |
| float | getHorizontalZoomFactor () const |
| float | getHorizontalZoomCenter () const |
| float | getVerticalZoomFactor () const |
| float | getVerticalZoomCenter () const |
| Range< float > | getHorizontalRange () const |
| Range< float > | getVerticalRange () const |
Private Member Functions | |
| void | updateWaveformThumbnail (const AudioBuffer< float > &monoAudioBuffer) |
| void | mixStereoBufferToMono (const AudioBuffer< float > &stereo, AudioBuffer< float > &mono) const |
Private Attributes | |
| struct krotos::WaveformViewer::Layout | m_layout |
| bool | m_mouseHover {false} |
| std::unique_ptr< Drawable > | m_waveformAreaBackdropImage |
| std::unique_ptr< Drawable > | m_addIconImage |
| ListenerList< WaveformViewer::Listener > | m_listeners |
| String | m_regexFileFilter {""} |
| const Colour | DEFAULT_COLOUR {Colours::lightgrey.withAlpha(0.5f)} |
| Colour | m_waveformColour {DEFAULT_COLOUR} |
| String | m_filePath |
| String | m_fileName |
| String | m_dropText {""} |
| float | m_currentSampleRate {48000.0f} |
| std::unique_ptr< AudioFormatManager > | m_formatManager |
| std::unique_ptr< AudioFormatReader > | m_wavReader |
| std::unique_ptr< AudioThumbnailCache > | m_thumbnailCache |
| std::unique_ptr< AudioThumbnail > | m_thumbnail |
| Label | m_titleLabel |
| bool | m_drawGrid {true} |
| bool | m_showFileName {true} |
| bool | m_dragBorderShouldShow {false} |
| bool | m_draggedItemIsHovering {false} |
| bool | m_useExtendedFilePaths {false} |
| int | m_numDraggedFilesHovering {0} |
| bool | m_limitToSingleDroppedItem {false} |
Static Private Attributes | |
| static constexpr float | m_fixedSampleRate {48000.0f} |
| static constexpr float | minus96db {0.00001584893192461114f} |
Additional Inherited Members | |
Protected Member Functions inherited from krotos::ZoomableComponent | |
| void | drawNormalisedZoomedRect (Graphics &g, const Rectangle< float > &rect) const |
| void | drawNormalisedZoomedRectLine (Graphics &g, const Rectangle< float > &rect) const |
| void | drawZoomedRect (Graphics &g, const Rectangle< float > &rect) const |
| void | drawNormalisedZoomedLine (Graphics &g, Line< float > line, float thickness) const |
| void | drawZoomedLine (Graphics &g, const Line< float > &line, float thickness) const |
| void | drawNormalisedZoomedText (Graphics &g, String text, Rectangle< float > bounds) const |
| void | drawNormalisedZoomedPath (Graphics &g, const Path &path, float thickness) |
| void | drawZoomedPath (Graphics &g, Path path, float thickness) |
| void | drawNormalisedZoomedImage (Graphics &g, Image &image, const Rectangle< float > &bounds, bool fillAlphaChannelWithCurrentBrush=false) |
| void | fillNormalisedZoomedEllipse (Graphics &g, const Rectangle< float > &bounds) |
| void | drawNormalisedZoomedEllipse (Graphics &g, const Rectangle< float > &bounds) |
| void | drawZoomedEllipse (Graphics &g, const Rectangle< float > &bounds) |
| krotos::WaveformViewer::WaveformViewer | ( | Colour | waveformColour = Colours::white | ) |
| void krotos::WaveformViewer::addListener | ( | WaveformViewer::Listener * | Listener | ) |
| void krotos::WaveformViewer::clear | ( | ) |
| void krotos::WaveformViewer::fileDragEnter | ( | const StringArray & | files, |
| int | x, | ||
| int | y ) |
| void krotos::WaveformViewer::fileDragExit | ( | const StringArray & | files | ) |
| Array< File > krotos::WaveformViewer::getExtendedFilePaths | ( | const StringArray & | files | ) |
| bool krotos::WaveformViewer::isInterestedInFileDrag | ( | const StringArray & | files | ) |
| bool krotos::WaveformViewer::matchesExpression | ( | const String & | expression, |
| const String & | stringToTest ) |
|
private |
|
override |
| void krotos::WaveformViewer::removeListener | ( | WaveformViewer::Listener * | Listener | ) |
|
override |
| void krotos::WaveformViewer::setDrawGrid | ( | bool | drawGrid | ) |
| void krotos::WaveformViewer::setDropText | ( | const String & | newText | ) |
| void krotos::WaveformViewer::setHoverState | ( | bool | newState | ) |
Setter used to inform this component that the mouse pointer is within this component's boundaries. Because it is behind the top component in a stack of components this component does not intercept mouseEnter or MouseExit messages. The top component intercepts these messages and calls this method.
| val | set true when hovering, false when not |
| void krotos::WaveformViewer::setLimitToSingleDroppedItem | ( | bool | val | ) |
Setter for whether or not the component should be limited to accepting a single deopped item - either a file or a directory
| val | enables when true |
| void krotos::WaveformViewer::setRegexFileFilter | ( | const String & | newExpression | ) |
| void krotos::WaveformViewer::setShowBorderOnDragHover | ( | bool | showBorder | ) |
Setter for whether or not the component should paint a highlight border when the user has dragged a file item over the bounds
| showBorder | Paints the border when true |
| void krotos::WaveformViewer::setShowFileName | ( | bool | showFileName | ) |
| void krotos::WaveformViewer::setTitle | ( | const String & | title | ) |
| void krotos::WaveformViewer::setUseExtendedFilePaths | ( | bool | val | ) |
Setter for whether or not the component should accept multiple drag and dropped files
| val | enables when true |
| void krotos::WaveformViewer::setWaveformColour | ( | Colour | waveformColour | ) |
| bool krotos::WaveformViewer::soundFileTypeIsValid | ( | std::string | fileName | ) |
|
private |
|
virtual |
| void krotos::WaveformViewer::updateWaveformViewInterpolateBuffers | ( | float | gainSliderValue, |
| const AudioBuffer< float > & | buffer1, | ||
| const AudioBuffer< float > & | buffer2, | ||
| float | samplePosition = 0.0f ) |
| void krotos::WaveformViewer::waveformZoomed | ( | const AudioBuffer< float > & | audioBuffer, |
| int | startSample, | ||
| int | numsamples ) const |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
staticconstexprprivate |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
staticconstexprprivate |