yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::editor::MusicPlaybackControlPanel Class Reference

EditorPanel for music playback controls and status display. More...

#include <music_playback_control_panel.h>

Inheritance diagram for yaze::editor::MusicPlaybackControlPanel:

Public Member Functions

 MusicPlaybackControlPanel (zelda3::music::MusicBank *music_bank, int *current_song_index, music::MusicPlayer *music_player)
 
std::string GetId () const override
 Unique identifier for this panel.
 
std::string GetDisplayName () const override
 Human-readable name shown in menus and title bars.
 
std::string GetIcon () const override
 Material Design icon for this panel.
 
std::string GetEditorCategory () const override
 Editor category this panel belongs to.
 
int GetPriority () const override
 Get display priority for menu ordering.
 
void SetOnOpenSong (std::function< void(int)> callback)
 
void SetOnOpenPianoRoll (std::function< void(int)> callback)
 
void Draw (bool *p_open) override
 Draw the panel content.
 
- Public Member Functions inherited from yaze::editor::EditorPanel
virtual ~EditorPanel ()=default
 
virtual void OnOpen ()
 Called when panel becomes visible.
 
virtual void OnClose ()
 Called when panel is hidden.
 
virtual void OnFocus ()
 Called when panel receives focus.
 
virtual PanelCategory GetPanelCategory () const
 Get the lifecycle category for this panel.
 
virtual bool IsEnabled () const
 Check if this panel is currently enabled.
 
virtual std::string GetDisabledTooltip () const
 Get tooltip text when panel is disabled.
 
virtual std::string GetShortcutHint () const
 Get keyboard shortcut hint for display.
 
virtual float GetPreferredWidth () const
 Get preferred width for this panel (optional)
 
virtual bool IsVisibleByDefault () const
 Whether this panel should be visible by default.
 
virtual std::string GetParentPanelId () const
 Get parent panel ID for cascade behavior.
 
virtual bool CascadeCloseChildren () const
 Whether closing this panel should close child panels.
 

Private Member Functions

void DrawToolset ()
 
void DrawSongInfo ()
 
void DrawPlaybackStatus ()
 
void DrawQuickActions ()
 
void DrawDebugControls ()
 

Private Attributes

zelda3::music::MusicBankmusic_bank_ = nullptr
 
int * current_song_index_ = nullptr
 
music::MusicPlayermusic_player_ = nullptr
 
int current_volume_ = 100
 
std::function< void(int)> on_open_song_
 
std::function< void(int)> on_open_piano_roll_
 
bool debug_paused_ = false
 
music::DspDebugStatus cached_dsp_
 
music::AudioQueueStatus cached_audio_
 
music::ApuDebugStatus cached_apu_
 
std::array< music::ChannelState, 8 > cached_channels_
 
int32_t avg_queue_delta_ = 0
 
uint64_t avg_cycle_rate_ = 0
 
std::chrono::steady_clock::time_point last_stats_time_
 
uint64_t last_cycles_for_rate_ = 0
 
uint32_t last_queued_for_rate_ = 0
 

Detailed Description

EditorPanel for music playback controls and status display.

Definition at line 27 of file music_playback_control_panel.h.

Constructor & Destructor Documentation

◆ MusicPlaybackControlPanel()

yaze::editor::MusicPlaybackControlPanel::MusicPlaybackControlPanel ( zelda3::music::MusicBank * music_bank,
int * current_song_index,
music::MusicPlayer * music_player )
inline

Definition at line 29 of file music_playback_control_panel.h.

Member Function Documentation

◆ GetId()

std::string yaze::editor::MusicPlaybackControlPanel::GetId ( ) const
inlineoverridevirtual

Unique identifier for this panel.

Returns
Panel ID in format "{category}.{name}" (e.g., "dungeon.room_selector")

IDs should be:

  • Lowercase with underscores
  • Prefixed with editor category
  • Unique across all panels

Implements yaze::editor::EditorPanel.

Definition at line 40 of file music_playback_control_panel.h.

◆ GetDisplayName()

std::string yaze::editor::MusicPlaybackControlPanel::GetDisplayName ( ) const
inlineoverridevirtual

Human-readable name shown in menus and title bars.

Returns
Display name (e.g., "Room Selector")

Implements yaze::editor::EditorPanel.

Definition at line 41 of file music_playback_control_panel.h.

◆ GetIcon()

std::string yaze::editor::MusicPlaybackControlPanel::GetIcon ( ) const
inlineoverridevirtual

Material Design icon for this panel.

Returns
Icon constant (e.g., ICON_MD_LIST)

Implements yaze::editor::EditorPanel.

Definition at line 42 of file music_playback_control_panel.h.

References ICON_MD_PLAY_CIRCLE.

◆ GetEditorCategory()

std::string yaze::editor::MusicPlaybackControlPanel::GetEditorCategory ( ) const
inlineoverridevirtual

Editor category this panel belongs to.

Returns
Category name matching EditorType (e.g., "Dungeon", "Overworld")

Implements yaze::editor::EditorPanel.

Definition at line 43 of file music_playback_control_panel.h.

◆ GetPriority()

int yaze::editor::MusicPlaybackControlPanel::GetPriority ( ) const
inlineoverridevirtual

Get display priority for menu ordering.

Returns
Priority value (lower = higher in list, default 50)

Reimplemented from yaze::editor::EditorPanel.

Definition at line 44 of file music_playback_control_panel.h.

◆ SetOnOpenSong()

void yaze::editor::MusicPlaybackControlPanel::SetOnOpenSong ( std::function< void(int)> callback)
inline

Definition at line 50 of file music_playback_control_panel.h.

References on_open_song_.

◆ SetOnOpenPianoRoll()

void yaze::editor::MusicPlaybackControlPanel::SetOnOpenPianoRoll ( std::function< void(int)> callback)
inline

Definition at line 54 of file music_playback_control_panel.h.

References on_open_piano_roll_.

◆ Draw()

void yaze::editor::MusicPlaybackControlPanel::Draw ( bool * p_open)
inlineoverridevirtual

Draw the panel content.

Parameters
p_openPointer to visibility flag (nullptr if not closable)

Called by PanelManager when the panel is visible. Do NOT call ImGui::Begin/End - the PanelWindow wrapper handles that. Just draw your content directly.

Implements yaze::editor::EditorPanel.

Definition at line 62 of file music_playback_control_panel.h.

References current_song_index_, DrawDebugControls(), DrawPlaybackStatus(), DrawQuickActions(), DrawSongInfo(), DrawToolset(), ICON_MD_KEYBOARD, and music_bank_.

◆ DrawToolset()

◆ DrawSongInfo()

void yaze::editor::MusicPlaybackControlPanel::DrawSongInfo ( )
inlineprivate

Definition at line 180 of file music_playback_control_panel.h.

References current_song_index_, yaze::zelda3::music::MusicBank::GetSong(), ICON_MD_EDIT, and music_bank_.

Referenced by Draw().

Here is the call graph for this function:

◆ DrawPlaybackStatus()

void yaze::editor::MusicPlaybackControlPanel::DrawPlaybackStatus ( )
inlineprivate

Definition at line 199 of file music_playback_control_panel.h.

References current_song_index_, yaze::zelda3::music::MusicBank::GetSong(), yaze::editor::music::MusicPlayer::GetState(), music_bank_, and music_player_.

Referenced by Draw().

Here is the call graph for this function:

◆ DrawQuickActions()

void yaze::editor::MusicPlaybackControlPanel::DrawQuickActions ( )
inlineprivate

◆ DrawDebugControls()

Member Data Documentation

◆ music_bank_

zelda3::music::MusicBank* yaze::editor::MusicPlaybackControlPanel::music_bank_ = nullptr
private

◆ current_song_index_

int* yaze::editor::MusicPlaybackControlPanel::current_song_index_ = nullptr
private

◆ music_player_

music::MusicPlayer* yaze::editor::MusicPlaybackControlPanel::music_player_ = nullptr
private

◆ current_volume_

int yaze::editor::MusicPlaybackControlPanel::current_volume_ = 100
private

Definition at line 574 of file music_playback_control_panel.h.

Referenced by DrawToolset().

◆ on_open_song_

std::function<void(int)> yaze::editor::MusicPlaybackControlPanel::on_open_song_
private

Definition at line 576 of file music_playback_control_panel.h.

Referenced by DrawQuickActions(), and SetOnOpenSong().

◆ on_open_piano_roll_

std::function<void(int)> yaze::editor::MusicPlaybackControlPanel::on_open_piano_roll_
private

Definition at line 577 of file music_playback_control_panel.h.

Referenced by DrawQuickActions(), and SetOnOpenPianoRoll().

◆ debug_paused_

bool yaze::editor::MusicPlaybackControlPanel::debug_paused_ = false
private

Definition at line 580 of file music_playback_control_panel.h.

Referenced by DrawDebugControls().

◆ cached_dsp_

music::DspDebugStatus yaze::editor::MusicPlaybackControlPanel::cached_dsp_
private

Definition at line 581 of file music_playback_control_panel.h.

Referenced by DrawDebugControls().

◆ cached_audio_

music::AudioQueueStatus yaze::editor::MusicPlaybackControlPanel::cached_audio_
private

Definition at line 582 of file music_playback_control_panel.h.

Referenced by DrawDebugControls().

◆ cached_apu_

music::ApuDebugStatus yaze::editor::MusicPlaybackControlPanel::cached_apu_
private

Definition at line 583 of file music_playback_control_panel.h.

Referenced by DrawDebugControls().

◆ cached_channels_

std::array<music::ChannelState, 8> yaze::editor::MusicPlaybackControlPanel::cached_channels_
private

Definition at line 584 of file music_playback_control_panel.h.

Referenced by DrawDebugControls().

◆ avg_queue_delta_

int32_t yaze::editor::MusicPlaybackControlPanel::avg_queue_delta_ = 0
private

Definition at line 585 of file music_playback_control_panel.h.

Referenced by DrawDebugControls().

◆ avg_cycle_rate_

uint64_t yaze::editor::MusicPlaybackControlPanel::avg_cycle_rate_ = 0
private

Definition at line 586 of file music_playback_control_panel.h.

Referenced by DrawDebugControls().

◆ last_stats_time_

std::chrono::steady_clock::time_point yaze::editor::MusicPlaybackControlPanel::last_stats_time_
private

Definition at line 589 of file music_playback_control_panel.h.

Referenced by DrawDebugControls().

◆ last_cycles_for_rate_

uint64_t yaze::editor::MusicPlaybackControlPanel::last_cycles_for_rate_ = 0
private

Definition at line 590 of file music_playback_control_panel.h.

Referenced by DrawDebugControls().

◆ last_queued_for_rate_

uint32_t yaze::editor::MusicPlaybackControlPanel::last_queued_for_rate_ = 0
private

Definition at line 591 of file music_playback_control_panel.h.

Referenced by DrawDebugControls().


The documentation for this class was generated from the following file: