Displays the contents of a MidiFilePlayer as a piano roll view.
More...
#include <gin_midifilecomponent.h>
Inherits juce::Component, juce::Timer, and juce::FileDragAndDropTarget.
|
| std::function< void()> | onFileDropped |
| | Called when a file is loaded via drag & drop.
|
| std::function< void()> | onPlaybackStateChanged |
| | Called when playback state changes (started, stopped, or reached end).
|
Displays the contents of a MidiFilePlayer as a piano roll view.
MidiFileComponent renders MIDI notes from a MidiFilePlayer as horizontal bars on a piano roll style display. It also shows a playhead indicating the current playback position.
Key Features:
- Piano roll style MIDI visualization
- Playhead display
- Automatic refresh during playback
- Customizable colors via ColourIds
Usage:
MidiFileComponent(MidiFilePlayer &player)
Plays back MIDI files with configurable tempo.
Definition gin_midifileplayer.h:53
bool load(const juce::File &file)
Loads a MIDI file for playback.
void addAndMakeVisible(juce::Component &parent, juce::Array< juce::Component * > children)
Adds an Array of components to a parent Component.
Definition gin_componentutils.h:16
- See also
- MidiFilePlayer
◆ ColourIds
| Enumerator |
|---|
| backgroundColourId | |
| noteColourId | |
| playheadColourId | |
| outlineColourId | |
| dropHighlightColourId | |
◆ MidiFileComponent()
◆ ~MidiFileComponent()
| MidiFileComponent::~MidiFileComponent |
( |
| ) |
|
|
override |
◆ paint()
| void MidiFileComponent::paint |
( |
juce::Graphics & | g | ) |
|
|
override |
◆ timerCallback()
| void MidiFileComponent::timerCallback |
( |
| ) |
|
|
override |
◆ isInterestedInFileDrag()
| bool MidiFileComponent::isInterestedInFileDrag |
( |
const juce::StringArray & | files | ) |
|
|
override |
◆ fileDragEnter()
| void MidiFileComponent::fileDragEnter |
( |
const juce::StringArray & | files, |
|
|
int | x, |
|
|
int | y ) |
|
override |
◆ fileDragExit()
| void MidiFileComponent::fileDragExit |
( |
const juce::StringArray & | files | ) |
|
|
override |
◆ filesDropped()
| void MidiFileComponent::filesDropped |
( |
const juce::StringArray & | files, |
|
|
int | x, |
|
|
int | y ) |
|
override |
◆ onFileDropped
| std::function<void()> MidiFileComponent::onFileDropped |
Called when a file is loaded via drag & drop.
◆ onPlaybackStateChanged
| std::function<void()> MidiFileComponent::onPlaybackStateChanged |
Called when playback state changes (started, stopped, or reached end).
The documentation for this class was generated from the following file: