A scrollable list of samples with mute/solo, play and remove buttons. As it is a subclass of PopupMenu::CustomComponent, it must be added to a PopupMenu. Populate the browser by passing in an Array of SampleBrowser::Sample objects.
More...
#include <SampleBrowser.h>
|
| class | ButtonLAF |
| |
| struct | ComponentIds |
| |
| struct | Sample |
| | Wrapper object for sample data used by the browser. The Value objects are shared reference objects which their corresponding buttons will listen to. More...
|
| |
|
| | SampleBrowser (int width, int height, int itemHeight, OwnedArray< Sample > samplesToShow) |
| | Creates a sample browser showing a list of given samples. It uses a viewport to allow scrolling through a list of all samples.
|
| |
| | ~SampleBrowser () |
| |
| void | getIdealSize (int &width, int &height) override |
| | Returns the ideal size of the browser that has been set.
|
| |
| void | resized () override |
| |
| void | setCuedSample (int sampleIndex, bool isCued) |
| | Set the sample at the given index to display as cued.
|
| |
| void | setSampleFunctionButtonsVisibility (bool isVisible) |
| | Change the visibility of the functions buttons on the individual sample list items i.e. mute, solo, and delete.
|
| |
|
| std::function< void(int sampleIndex, bool muteState)> | onSampleMuted |
| | Assign this callback to do something when a sample has been muted in the browser.
|
| |
| std::function< void(int sampleIndex, bool soloState)> | onSampleSolo |
| | Assign this callback to do something when a sample has been soloed in the browser.
|
| |
| std::function< void(int sampleIndex)> | onSampleSelected |
| | Assign this callback to do something when a sample has been selected in the browser. in the browser.
|
| |
| std::function< void(int sampleIndex)> | onSampleDeleted |
| |
A scrollable list of samples with mute/solo, play and remove buttons. As it is a subclass of PopupMenu::CustomComponent, it must be added to a PopupMenu. Populate the browser by passing in an Array of SampleBrowser::Sample objects.
◆ SampleBrowser()
| krotos::SampleBrowser::SampleBrowser |
( |
int | width, |
|
|
int | height, |
|
|
int | itemHeight, |
|
|
OwnedArray< Sample > | samplesToShow ) |
Creates a sample browser showing a list of given samples. It uses a viewport to allow scrolling through a list of all samples.
- Parameters
-
| width | The desired width of the browser. |
| height | The desired height of the browser. |
| itemHeight | The height of each sample item in the displayed list. |
| samplesToShow | The samples to show in the browser. The index of these samples corresponds to their index within the sample engine. |
◆ ~SampleBrowser()
| krotos::SampleBrowser::~SampleBrowser |
( |
| ) |
|
◆ allMuteButtonsOn()
| bool krotos::SampleBrowser::allMuteButtonsOn |
( |
| ) |
|
|
private |
◆ getIdealSize()
| void krotos::SampleBrowser::getIdealSize |
( |
int & | width, |
|
|
int & | height ) |
|
override |
Returns the ideal size of the browser that has been set.
◆ resized()
| void krotos::SampleBrowser::resized |
( |
| ) |
|
|
override |
◆ setCuedSample()
| void krotos::SampleBrowser::setCuedSample |
( |
int | sampleIndex, |
|
|
bool | isCued ) |
Set the sample at the given index to display as cued.
- Parameters
-
| sampleIndex | The index of the sample to cue. |
| isCued | True to cue the sample, false to un-cue it. |
◆ setSampleFunctionButtonsVisibility()
| void krotos::SampleBrowser::setSampleFunctionButtonsVisibility |
( |
bool | isVisible | ) |
|
Change the visibility of the functions buttons on the individual sample list items i.e. mute, solo, and delete.
- Parameters
-
| isVisible | True to show and False to hide all buttons. |
◆ m_idealHeight
| int krotos::SampleBrowser::m_idealHeight = 0 |
|
private |
◆ m_idealWidth
| int krotos::SampleBrowser::m_idealWidth = 0 |
|
private |
◆ m_itemHeight
| int krotos::SampleBrowser::m_itemHeight {34} |
|
private |
◆ m_itemsParent
| Component krotos::SampleBrowser::m_itemsParent |
|
private |
◆ m_sampleItems
| OwnedArray<SampleItem> krotos::SampleBrowser::m_sampleItems |
|
private |
◆ m_samples
| OwnedArray<Sample> krotos::SampleBrowser::m_samples |
|
private |
◆ m_scrollableArea
| Viewport krotos::SampleBrowser::m_scrollableArea |
|
private |
◆ m_textButtonLAF
| ButtonLAF krotos::SampleBrowser::m_textButtonLAF |
|
private |
◆ onSampleDeleted
| std::function<void(int sampleIndex)> krotos::SampleBrowser::onSampleDeleted |
◆ onSampleMuted
| std::function<void(int sampleIndex, bool muteState)> krotos::SampleBrowser::onSampleMuted |
Assign this callback to do something when a sample has been muted in the browser.
- Parameters
-
| sampleIndex | The index of the sample that has been muted. |
| soloState | Is mute activated. |
◆ onSampleSelected
| std::function<void(int sampleIndex)> krotos::SampleBrowser::onSampleSelected |
Assign this callback to do something when a sample has been selected in the browser. in the browser.
- Parameters
-
| sampleIndex | The index of the sample that has been selected. |
◆ onSampleSolo
| std::function<void(int sampleIndex, bool soloState)> krotos::SampleBrowser::onSampleSolo |
Assign this callback to do something when a sample has been soloed in the browser.
- Parameters
-
| sampleIndex | The index of the sample that has been soloed. |
| soloState | Is solo activated. |
The documentation for this class was generated from the following files: