yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
tracker_view.h
Go to the documentation of this file.
1#ifndef YAZE_EDITOR_MUSIC_TRACKER_VIEW_H
2#define YAZE_EDITOR_MUSIC_TRACKER_VIEW_H
3
4#include <functional>
5
8
9namespace yaze {
10namespace editor {
11namespace music {
12
13using namespace yaze::zelda3::music;
14
22 public:
23 TrackerView() = default;
24 ~TrackerView() = default;
25
31 void Draw(MusicSong* song, const MusicBank* bank = nullptr);
32
36 void SetOnEditCallback(std::function<void()> callback) { on_edit_ = callback; }
37
38 private:
39 // UI Helper methods
40 void DrawToolbar(MusicSong* song);
41 void DrawGrid(MusicSong* song, const MusicBank* bank);
42 void DrawChannelHeader(int channel_idx);
43 void DrawEventCell(MusicTrack& track, int event_index, int channel_idx, uint16_t tick, const MusicBank* bank);
44
45 // State
47 float row_height_ = 20.0f;
48 bool follow_playback_ = false;
50
51 // Selection
53 int selected_col_ = 0; // 0 = Tick column (not selectable), 1-8 = Channels
56
57 // Input handling
59 void HandleNavigation();
61
62 // Editing callbacks
63 std::function<void()> on_edit_;
64};
65
66} // namespace music
67} // namespace editor
68} // namespace yaze
69
70#endif // YAZE_EDITOR_MUSIC_TRACKER_VIEW_H
UI component for displaying and editing music tracks.
void DrawChannelHeader(int channel_idx)
void HandleKeyboardInput(MusicSong *song)
std::function< void()> on_edit_
void HandleEditShortcuts(MusicSong *song)
void SetOnEditCallback(std::function< void()> callback)
Set callback for when edits occur (to trigger undo save)
void DrawEventCell(MusicTrack &track, int event_index, int channel_idx, uint16_t tick, const MusicBank *bank)
void DrawGrid(MusicSong *song, const MusicBank *bank)
void DrawToolbar(MusicSong *song)
void Draw(MusicSong *song, const MusicBank *bank=nullptr)
Draw the tracker view for the given song.
Manages the collection of songs, instruments, and samples from a ROM.
Definition music_bank.h:27
Contains classes and functions for handling music data in Zelda 3.
A complete song composed of segments.
Definition song_data.h:334
One of 8 channels in a music segment.
Definition song_data.h:291