1#ifndef YAZE_APP_EDITOR_MUSIC_PANELS_MUSIC_PIANO_ROLL_PANEL_H_
2#define YAZE_APP_EDITOR_MUSIC_PANELS_MUSIC_PIANO_ROLL_PANEL_H_
25 int* current_song_index,
int* current_segment_index,
26 int* current_channel_index,
40 std::string
GetId()
const override {
return "music.piano_roll"; }
59 void Draw(
bool* p_open)
override {
61 ImGui::TextDisabled(
"Music bank not loaded");
67 static_cast<int>(song->segments.size())) {
Base interface for all logical panel components.
EditorPanel wrapper for the piano roll view.
std::function< void()> on_edit_
std::string GetDisplayName() const override
Human-readable name shown in menus and title bars.
std::string GetEditorCategory() const override
Editor category this panel belongs to.
int * current_channel_index_
int GetPriority() const override
Get display priority for menu ordering.
music::MusicPlayer * music_player_
MusicPianoRollPanel(zelda3::music::MusicBank *music_bank, int *current_song_index, int *current_segment_index, int *current_channel_index, music::PianoRollView *piano_roll_view, music::MusicPlayer *music_player)
zelda3::music::MusicBank * music_bank_
music::PianoRollView * piano_roll_view_
int * current_segment_index_
std::string GetIcon() const override
Material Design icon for this panel.
void SetOnEditCallback(std::function< void()> callback)
void Draw(bool *p_open) override
Draw the panel content.
int * current_song_index_
std::string GetId() const override
Unique identifier for this panel.
Handles audio playback for the music editor using the SNES APU emulator.
void PreviewSegment(const zelda3::music::MusicSong &song, int segment_index)
Preview a specific segment of a song.
void PreviewNote(const zelda3::music::MusicSong &song, const zelda3::music::TrackEvent &event, int segment_index, int channel_index)
Preview a single note with the current instrument.
PlaybackState GetState() const
UI component for displaying and editing music tracks as a piano roll.
int GetActiveSegment() const
int GetActiveChannel() const
void SetActiveSegment(int segment)
void SetPlaybackState(bool is_playing, bool is_paused, uint32_t current_tick)
void Draw(zelda3::music::MusicSong *song, const zelda3::music::MusicBank *bank=nullptr)
Draw the piano roll view for the given song.
void SetOnNotePreview(std::function< void(const zelda3::music::TrackEvent &, int, int)> callback)
Set callback for note preview.
void SetActiveChannel(int channel)
void SetOnEditCallback(std::function< void()> callback)
Set callback for when edits occur.
void SetOnSegmentPreview(std::function< void(const zelda3::music::MusicSong &, int)> callback)
Set callback for segment preview.
Manages the collection of songs, instruments, and samples from a ROM.
MusicSong * GetSong(int index)
Get a song by index.
Represents the current playback state of the music player.
A complete song composed of segments.
A single event in a music track (note, command, or control).