|
Krotos Modules 3
|
#include <WaveformViewerAndEditor.h>
Classes | |
| struct | ColourDefinitions |
| struct | Layout |
| class | Listener |
Public Types | |
| enum class | ZoomStyle { start , centre , playhead } |
Public Member Functions | |
| WaveformViewerAndEditor (Colour waveformColour, bool minimumSelectionAreaOn, bool enableAreaSelection=true) | |
| ~WaveformViewerAndEditor () override=default | |
| void | paintOverChildren (Graphics &g) override |
| void | timerCallback () override |
| void | addListener (Listener *Listener) |
| void | removeListener (Listener *Listener) |
| void | resized () override |
| String | getFileName () |
| String | getLoadedFilePathsAsCSV () |
| void | update (AudioBuffer< float > *newAudio, int sampleRate) |
| void | update (KrotosSampleOscillatorSound &sound) |
| void | setViewerDropText (String newText) |
| void | setViewCentre (float newRangeStart) |
| WaveformViewer * | getWaveformViewer () |
| void | clear () |
| void | setSelectionEnabled (bool newState) |
| void | setStartPosInPercentage (float startPos, float nonModulatedValue=-1.0f) |
| void | setEndPosInPercentage (float endPos) |
| void | setGrainData (Grain *grains, int numSamples, int numChannels) |
| void | copySampleEngineSegmentToSelector (Selector &selector, int segmentIndex) |
| void | copySegmentsToSelectors () |
| void | setSampleEngineToDisplay (KrotosSampleOscillatorSound *sampEngine) |
| void | setZooms (const Range< float > newRange) |
| void | zoomIn () |
| void | zoomOut () |
| void | setZoomStyle (ZoomStyle) |
| Array< File > | getExtendedFilePaths (const StringArray &fileNames) |
| void | setChildComponentIds (String newId) |
| int | mouseXToSampleX (int x) |
| void | showFileChooser () |
| Show the waveform view file chooser. | |
| void | zoomToSegment (size_t segmentIndex) |
| Centres the waveform viewer around a given segment, so that the segment fills the entire viewer window. | |
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 Types | |
| enum | HoverMode { noHover , segmentDrag , selectionDrag , leftEdgeDrag , rightEdgeDrag , undecidedDrag , NUM_HOVER_MODES } |
Private Member Functions | |
| void | moveSelectionStart (int segmentIndex, int diff) |
| void | setSelectionStart (int segmentIndex, int sampleIndex) |
| void | moveSelectionEnd (int segmentIndex, int diff) |
| void | setSelectionEnd (int segmentIndex, int sampleIndex) |
| void | moveSelection (int segmentIndex, int diff) |
| Range< int > | getSelection (int segmentIndex) |
| void | setHoverFromDirection (int segmentIndex, int mouseDeltaX) |
| MouseCursor | hoverModeToMouseCursor (HoverMode hMode) |
| HoverMode | deduceSegmentHoverMode (int segmentIndex) |
| void | zoomByDelta (float delta) |
| void | reportAnyInvalidFiles (const StringArray &filelist) |
| void | mouseDrag (const MouseEvent &event) override |
| void | mouseWheelMove (const MouseEvent &e, const MouseWheelDetails &wheel) override |
| void | mouseUp (const MouseEvent &event) override |
| void | mouseDown (const MouseEvent &event) override |
| void | mouseMove (const MouseEvent &event) override |
| void | mouseEnter (const MouseEvent &event) override |
| void | mouseExit (const MouseEvent &event) override |
| bool | isInterestedInFileDrag (const StringArray &files) override |
| void | filesDropped (const StringArray &files, int x, int y) override |
| void | fileDragEnter (const StringArray &files, int x, int y) override |
| void | fileDragExit (const StringArray &files) override |
| void | mouseMove () |
Static Private Attributes | |
| static const int | FRAME_COOLDOWN {30} |
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) |
|
private |
|
strong |
Zoom options. Note that the mouse wheel zoom will prefer mouse X over zoom style
| Enumerator | |
|---|---|
| start | Zoom in/out at the start of the waveform |
| centre | Zoom in/out at the middle of the waveform |
| playhead | Zoom in/out at the playhead |
| WaveformViewerAndEditor::WaveformViewerAndEditor | ( | Colour | waveformColour, |
| bool | minimumSelectionAreaOn, | ||
| bool | enableAreaSelection = true ) |
|
overridedefault |
| void WaveformViewerAndEditor::addListener | ( | Listener * | Listener | ) |
| void WaveformViewerAndEditor::clear | ( | ) |
| void WaveformViewerAndEditor::copySampleEngineSegmentToSelector | ( | Selector & | selector, |
| int | segmentIndex ) |
| void WaveformViewerAndEditor::copySegmentsToSelectors | ( | ) |
Copy all the sample engine segments over to our vector of selectors
|
private |
|
overrideprivate |
|
overrideprivate |
|
overrideprivate |
| Array< File > WaveformViewerAndEditor::getExtendedFilePaths | ( | const StringArray & | fileNames | ) |
| String WaveformViewerAndEditor::getFileName | ( | ) |
| String WaveformViewerAndEditor::getLoadedFilePathsAsCSV | ( | ) |
|
private |
| WaveformViewer * WaveformViewerAndEditor::getWaveformViewer | ( | ) |
|
private |
|
overrideprivate |
|
overrideprivate |
|
overrideprivate |
|
overrideprivate |
|
overrideprivate |
|
private |
|
overrideprivate |
|
overrideprivate |
|
overrideprivate |
| int WaveformViewerAndEditor::mouseXToSampleX | ( | int | x | ) |
Calculate mousex position as a sample index into the sound buffer
|
private |
|
private |
|
private |
|
override |
| void WaveformViewerAndEditor::removeListener | ( | Listener * | Listener | ) |
|
private |
|
override |
| void WaveformViewerAndEditor::setChildComponentIds | ( | String | newId | ) |
Sets the componentID of all child components
| [in] | newId | The new component ID that will be applied to all components |
|
inline |
| void WaveformViewerAndEditor::setGrainData | ( | Grain * | grains, |
| int | numSamples, | ||
| int | numChannels ) |
|
private |
| void WaveformViewerAndEditor::setSampleEngineToDisplay | ( | KrotosSampleOscillatorSound * | sampEngine | ) |
| void WaveformViewerAndEditor::setSelectionEnabled | ( | bool | newState | ) |
Enable/disable waveform viewer range selection
| newState | Set true to enable, false to disable |
|
private |
|
private |
|
inline |
| void WaveformViewerAndEditor::setViewCentre | ( | float | newRangeStart | ) |
Move the zoom window by specifying a new normalised start position.
| void WaveformViewerAndEditor::setViewerDropText | ( | String | newText | ) |
|
inline |
Set the zoom ranges for all the stacked components in the waveform view.
| void WaveformViewerAndEditor::setZoomStyle | ( | ZoomStyle | zoomStyle | ) |
Change the
| void WaveformViewerAndEditor::showFileChooser | ( | ) |
Show the waveform view file chooser.
|
override |
| void WaveformViewerAndEditor::update | ( | AudioBuffer< float > * | newAudio, |
| int | sampleRate ) |
| void WaveformViewerAndEditor::update | ( | KrotosSampleOscillatorSound & | sound | ) |
|
private |
| void WaveformViewerAndEditor::zoomIn | ( | ) |
Make waveform view bigger
| void WaveformViewerAndEditor::zoomOut | ( | ) |
Make waveform view smaller
| void WaveformViewerAndEditor::zoomToSegment | ( | size_t | segmentIndex | ) |
Centres the waveform viewer around a given segment, so that the segment fills the entire viewer window.
| segmentIndex | The index of the segment in the sample engine to zoom to. |
|
staticprivate |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |