resonance 1.0.1
Loading...
Searching...
No Matches
MetJukeboxBaseScreen Class Referenceabstract

Base of the three jukebox screens. More...

#include <metjukeboxbasescreen.h>

Inheritance diagram for MetJukeboxBaseScreen:
Collaboration diagram for MetJukeboxBaseScreen:

Public Member Functions

 MetJukeboxBaseScreen (MetRenderer *pRenderer, int nPriority, const HxStr &name, const HxStr &directory, const HxStr &file)
 Construct the screen with no list and no resolved object.
virtual ~MetJukeboxBaseScreen ()
 Release the two scrolling lists.
virtual void EnterAndShow ()
 Show the five detail texts, bind the lists, and select the first catalogue row.
virtual void OnPanelActivated ()
 Refresh the details and the help text, then show the playlist.
virtual void HandleCommand (const MetScreenCommand *pCommand)
 Act on a command.
virtual void UpdateIdle (float flTime)
 Advance the two song pictures while the view is showing and the details are current.
virtual void OnEnterFinished ()
 Bind the lists again and refresh both.
virtual void OnExitFinished ()
 Hide the five detail texts.
virtual void ResolveContainerViews ()
 Resolve the container views and the two fonts.
virtual void SetShowing (int nShowing)
 Show or hide the view, both scrolling lists, and the list frame.
virtual void PlaySlideSound (int nSelector)
 Overridden empty, so a jukebox screen plays no slide sound.
virtual void PlayLeaveSound (int nSelector)
 Overridden empty, so a jukebox screen plays no departure sound.
virtual void PlayHighSound (int nSelector)
 Overridden empty, so a jukebox screen plays no emphasis sound.
virtual void PlayCycleLeftSound (int nSelector)
 Overridden empty, so a jukebox screen plays no left-cycle sound.
virtual void PlayCycleRightSound (int nSelector)
 Overridden empty, so a jukebox screen plays no right-cycle sound.
virtual int GetItemCount ()=0
 Report the number of rows the list displays.
virtual void ShowRemixDetails ()
 Fill the detail texts from the selected catalogue row.
virtual void UpdateHelpText ()
 Select the help text for the playlist's state.
virtual void BindLists ()
 Bind the catalogue and the playlist from the shared MetRemixManager.
virtual int ProvideText (int nItem, int nColumn, Rnd::Text *pText, int nContext)
 Show one row of whichever list the context selects.
virtual int ProvideMesh (int nItem, int nColumn, Rnd::Mesh *pMesh, int nContext)
 Leave the cell as it is.
Public Member Functions inherited from MetScreen
 MetScreen (MetRenderer *pRenderer, int nPriority, const HxStr &name, const HxStr &directory, const HxStr &file)
 Construct a screen and start its container load.
virtual ~MetScreen ()
 Unregister from the renderer and release the container.
void DeliverCommand (const MetScreenCommand *pCommand)
 Play the sound one navigation command calls for and then act on the command.
void UpdateAnimationFrame (float flTime)
 Drive the frame of whichever animation is running and run the idle hook when none is.
void UpdateFrame (float flTime)
 Advance one screen by one frame.
virtual void PushNamedScreen (const HxStr &name)
 Bring one named screen onto the renderer's screen stack.
virtual void ActivateNamedPanel (const HxStr &name)
 Make one named screen the renderer's active panel.
virtual void ExitScreenByName (const HxStr &name)
 Start one named screen's exit animation.
virtual void BeginExit ()
 Start this screen's exit animation at the renderer's current time.
virtual void OnUnusedHook ()
 Do nothing.
virtual void OnKeyboardDismissed ()
 Take control back after the keyboard screen has finished.
virtual void OnDrawPass ()
 Contribute to the renderer's draw pass.
virtual void OnDestroying ()
 Release what the screen acquired, ahead of the rest of destruction.
virtual int PollContainerLoad ()
 Advance this screen's container load and resolve its views once the load finishes.
virtual void OnMsgScreenDismissed (const HxStr &name, int nChoice)
 Act on the choice the user made in a message dialogue.
virtual void OnMsgScreenShown (const HxStr &name)
 Act on a message dialogue becoming visible.
virtual void BeginContainerLoad (const HxStr &directory, const HxStr &file)
 Intern a container load under this screen's container name and enqueue it.
virtual void PlayErrorSound (int nSelector)
 Play the sound that accompanies a rejected input.
virtual void UpdateIdleAnimation (float flTime)
 Advance whatever the screen animates while it is neither entering nor exiting.
virtual void StartRepeatingSound (float flStartTime, float flInterval, Rnd::Button *pButton, int nCycles)
 Start alternating one button between its states 2 and 1.
virtual void UpdateRepeatingSound (float flTime)
 Advance the alternation that StartRepeatingSound() started.
virtual void OnRepeatingSoundFinished (Rnd::Button *pButton)
 Act on the alternation that StartRepeatingSound() started having finished.
virtual void StartEnterAnimation (float flTime)
 Rewind the enter animation and record the time it starts at.
virtual void UpdateEnterAnimation (float flTime)
 Drive the enter animation and finish it once it passes its end.
virtual void StartExitAnimation (float flTime)
 Record the time the exit animation starts at.
virtual void UpdateExitAnimation (float flTime)
 Drive the exit animation and hide the screen once it passes its end.
virtual void Draw ()
 Draw the view.
Public Member Functions inherited from MsgSink
void * operator new (size_t nSize)
 Allocate a sink from the tagged heap under the tag "MsgSink".
void operator delete (void *pBlock)
 Release a sink to the tagged heap.
virtual ~MsgSink ()
virtual void Dispatch (Message *pMsg)
 Accept a message.
Public Member Functions inherited from ListDataProvider
virtual ~ListDataProvider ()

Protected Attributes

int mListRowPitch
int mListRowCount
ScrollingList * mCatalogueList
ScrollingList * mPlayListList
std::vector< MetRemixRecord > * mCatalogue
Rnd::Text * mGenreText
Rnd::Text * mTempoText
Rnd::Text * mSongTitleText
Rnd::Text * mDateText
Rnd::Text * mRemixTitleText
Rnd::Text * mPlayListCaption
Rnd::Mat * mPictureMaterial
Rnd::Mat * mLogoMaterial
JukeboxPlayList * mPlayList
int mCatalogueKey
std::vector< Rnd::Text * > mAppearanceTexts
Rnd::Font * mAvailableFont
Rnd::Font * mUnavailableFont
TexturePairRecord mLogoTextures
TexturePairRecord mPictureTextures
Rnd::Mesh * mPictureMesh
Rnd::Mesh * mLogoMesh
Rnd::Text * mWarningText
int mPicturesPending
Protected Attributes inherited from MetScreen
float mAnimEndFrame
float mEnterStartTime
MetRenderer * mRenderer
int mExitChoice
int mAcceptsCommands
Rnd::View * mEnterAnim
std::vector< HxStr > mHelpKeys
int mViewsUnresolved
int mPlaysCommandSounds
int mShowsLoadedDrawables

Additional Inherited Members

Static Public Member Functions inherited from MetScreen
static std::map< HxStr, MetContainerLoad * > & ContainerLoaderMap ()
 Shared table of container loads, interned under the container name.
static std::map< HxStr, MetScreenEntry > & ScreenRegistry ()
 Shared table of live screens, interned under the screen registry key.
static MetScreen * FindScreenByName (const HxStr &name)
 Resolve one screen by its registry key.
static MetScreen * FindEndScreen (MetRenderer *pRenderer, const HxStr &name)
 Resolve one end-of-game screen by its registry key, failing fatally when it is absent.
static void CreateMainMenuScreens (MetRenderer *pRenderer)
 Create the main-menu screens.
static void DestroyAllScreens ()
 Delete every registered screen and release every container loader.
static void CreateStartupScreens (MetRenderer *pRenderer)
 Create the four screens the front end needs before its containers have loaded.
static void CreateFrontEndScreens (MetRenderer *pRenderer)
 Create every remaining front-end screen, once.
static void DestroyCategory2Screens ()
 Delete and unregister every screen in category 2.
static void DestroyCategory1Screens ()
 Delete and unregister every screen in category 1.
static void DestroyNonDefaultScreens ()
 Delete and unregister every screen outside category 0, then rewind the rndMetLocAndNet zone.
static void PollContainerLoads ()
 Poll every container load that has not finished, and hide the drawables of each that does.
Public Attributes inherited from MetScreen
Rnd::View * mView
 The container's root view.
int mEnterPending
 Set when the screen was pushed before its container load finished.
int mActivatePending
 Set when the screen was activated as a panel before its container load finished.
float mRepeatScale
 Scale on the input auto-repeat interval.
Protected Member Functions inherited from MetScreen
virtual void DispatchPriv (Message *pMsg)
 Act on a message.
void ResolveAnimationViews ()
 Resolves the two animation views from the screen name and records the enter animation's end frame.

Detailed Description

Base of the three jukebox screens.

Its RTTI descriptor is at 0x00902330. It has two public non-virtual bases at fixed offsets, MetScreen at +0x00 and ListDataProvider at +140. The class therefore starts its members at +144. The constructor fixes the object at 0x150 bytes by writing +0x14c as its last member.

The constructor is at 0x0021dcc0. It takes the renderer, the load priority, and the three names, and all three children run it rather than inlining it.

Three classes derive from the class, MetJukeboxCustomRemixesScreen, MetJukeboxEditPlaylistScreen, and MetJukeboxFactoryRemixesScreen. None of the three declares a data member. Each writes mCatalogueKey in its constructor, and those writes make mCatalogueKey protected.

Two vtables belong to the class. The primary table at 0x007ec6d0 has 43 entries, four more than the MetScreen table, so the class declares four virtuals of its own at slots 39 through 42. Slot 39 stores the __pure_virtual handler at 0x005381a8, which makes the original class abstract, and the three children supply it. The secondary table at 0x007ec6a8 has four entries, is addressed by the ListDataProvider vptr, adjusts this by -140 in every entry, and supplies the two ListDataProvider pure virtuals at 0x0021ef30 and 0x00224ae8. The ListDataProvider table itself is at 0x007ec830, also with four entries, and its slots 2 and 3 are the two pure ones.

The constructor resolves no object name. It builds the two TexturePairRecord members from gSongLogo1.tex with gSongLogo2.tex and gSongLabel1.tex with gSongLabel2.tex, at 0x007ec520 through 0x007ec550.

Fifteen slots of the primary table differ from the MetScreen table. Slots 20 through 24 are two-instruction jr ra stubs, so a jukebox screen plays none of those five sounds. Slot 25 is inherited unchanged, so the error sound still plays.

Every member of the class is protected. The slot 33, 38, 39, 40, and 41 overrides of the three children read or write most of the block directly, including the two scrolling lists, the five drawables, the two row-count pointers, and the three words at +0x140. A few members appear only in this class's own code, and they are not separated out, because the register attribution in the larger child overrides is not firm enough to assert that a given member is untouched there.

Constructor & Destructor Documentation

◆ MetJukeboxBaseScreen()

MetJukeboxBaseScreen::MetJukeboxBaseScreen ( MetRenderer * pRenderer,
int nPriority,
const HxStr & name,
const HxStr & directory,
const HxStr & file )

Construct the screen with no list and no resolved object.

The five drawables from mGenreText through mRemixTitleText start null and slot 5 runs Rnd::Drawable::SetShowing() on each without a null check, so a screen whose slot 38 has not run yet faults there.

Parameters
pRendererThe front-end renderer this screen registers on.
nPriorityThe load priority.
nameThe screen name.
directoryThe directory the container loads from.
fileThe container name, without the .rnd suffix.
Ghidra address:
NTSC-U/C: 0x0021dcc0
Ghidra address:
PAL: 0x00230830

◆ ~MetJukeboxBaseScreen()

virtual MetJukeboxBaseScreen::~MetJukeboxBaseScreen ( )
virtual

Release the two scrolling lists.

Ghidra address:
NTSC-U/C: 0x0021dfc0
Ghidra address:
PAL: 0x00230bb0

Member Function Documentation

◆ EnterAndShow()

virtual void MetJukeboxBaseScreen::EnterAndShow ( )
virtual

Show the five detail texts, bind the lists, and select the first catalogue row.

Slot 5. The MetScreen body runs first. The playlist selection moves to its last entry, both lists are refreshed, the two song pictures are hidden, and slot 40 fills the details.

Ghidra address:
NTSC-U/C: 0x0021e908
Ghidra address:
PAL: 0x00231540

Reimplemented from MetScreen.

◆ OnPanelActivated()

virtual void MetJukeboxBaseScreen::OnPanelActivated ( )
virtual

Refresh the details and the help text, then show the playlist.

Slot 7. Runs slot 33, then slot 41, then shows mPlayListList.

Ghidra address:
NTSC-U/C: 0x00224a90
Ghidra address:
PAL: 0x00237a20

Reimplemented from MetScreen.

Reimplemented in MetJukeboxEditPlaylistScreen.

◆ HandleCommand()

virtual void MetJukeboxBaseScreen::HandleCommand ( const MetScreenCommand * pCommand)
virtual

Act on a command.

Previous and next move the catalogue selection and refresh the details and the help text. Select refreshes the help text and, while the playlist has room for another entry, appends the selected remix when its album is the one the jukebox plays. Every other command is ignored.

Parameters
pCommandThe command.
Ghidra address:
NTSC-U/C: 0x0021e268
Ghidra address:
PAL: 0x00230ea0

Reimplemented from MetScreen.

Reimplemented in MetJukeboxEditPlaylistScreen.

◆ UpdateIdle()

virtual void MetJukeboxBaseScreen::UpdateIdle ( float flTime)
virtual

Advance the two song pictures while the view is showing and the details are current.

Each TexturePairRecord that advances hides its mesh, and shows it again with the new texture on the first stage of its material when the list has rows and the selected remix belongs to the jukebox album. mPicturesPending is cleared once both pictures are shown.

Parameters
flTimeThe renderer's current animation frame position, which the body does not read.
Ghidra address:
NTSC-U/C: 0x0021fc88
Ghidra address:
PAL: 0x00232a80

Reimplemented from MetScreen.

◆ OnEnterFinished()

virtual void MetJukeboxBaseScreen::OnEnterFinished ( )
virtual

Bind the lists again and refresh both.

Slot 33. Runs slot 42, then refreshes mCatalogueList when it exists and mPlayListList without a null check.

Ghidra address:
NTSC-U/C: 0x00224990
Ghidra address:
PAL: 0x00237920

Reimplemented from MetScreen.

Reimplemented in MetJukeboxEditPlaylistScreen.

◆ OnExitFinished()

virtual void MetJukeboxBaseScreen::OnExitFinished ( )
virtual

Hide the five detail texts.

Slot 36.

Ghidra address:
NTSC-U/C: 0x002249e0
Ghidra address:
PAL: 0x00237970

Reimplemented from MetScreen.

◆ ResolveContainerViews()

virtual void MetJukeboxBaseScreen::ResolveContainerViews ( )
virtual

Resolve the container views and the two fonts.

Slot 38. The MetScreen body runs first, then font1_pink_2 and font1_pinkgrey_2 are resolved into mAvailableFont and mUnavailableFont.

Ghidra address:
NTSC-U/C: 0x0021e0f0
Ghidra address:
PAL: 0x00230ce0

Reimplemented from MetScreen.

Reimplemented in MetJukeboxCustomRemixesScreen, MetJukeboxEditPlaylistScreen, and MetJukeboxFactoryRemixesScreen.

◆ SetShowing()

virtual void MetJukeboxBaseScreen::SetShowing ( int nShowing)
virtual

Show or hide the view, both scrolling lists, and the list frame.

Slot 17. The base implementation runs first and the rest of the body is skipped while the container load has not finished. MetScreen::mViewsUnresolved records the unfinished load, and this read is the evidence that makes MetScreen::mViewsUnresolved protected. Hiding the screen passes zero to mPlayListList without a null check, so a screen hidden before slot 38 has run faults.

Parameters
nShowingNon-zero to draw the screen.
Ghidra address:
NTSC-U/C: 0x00224af0
Ghidra address:
PAL: 0x00237a80

Reimplemented from MetScreen.

◆ PlaySlideSound()

virtual void MetJukeboxBaseScreen::PlaySlideSound ( int nSelector)
virtual

Overridden empty, so a jukebox screen plays no slide sound.

Parameters
nSelectorDeclared by the slot and ignored.
Ghidra address:
NTSC-U/C: 0x00224968
Ghidra address:
PAL: 0x002378f8

Reimplemented from MetScreen.

◆ PlayLeaveSound()

virtual void MetJukeboxBaseScreen::PlayLeaveSound ( int nSelector)
virtual

Overridden empty, so a jukebox screen plays no departure sound.

Parameters
nSelectorThe pad index of the command, which the body does not read.
Ghidra address:
NTSC-U/C: 0x00224970
Ghidra address:
PAL: 0x00237900

Reimplemented from MetScreen.

◆ PlayHighSound()

virtual void MetJukeboxBaseScreen::PlayHighSound ( int nSelector)
virtual

Overridden empty, so a jukebox screen plays no emphasis sound.

Parameters
nSelectorDeclared by the slot and ignored.
Ghidra address:
NTSC-U/C: 0x00224978
Ghidra address:
PAL: 0x00237908

Reimplemented from MetScreen.

◆ PlayCycleLeftSound()

virtual void MetJukeboxBaseScreen::PlayCycleLeftSound ( int nSelector)
virtual

Overridden empty, so a jukebox screen plays no left-cycle sound.

Parameters
nSelectorDeclared by the slot and ignored.
Ghidra address:
NTSC-U/C: 0x00224980
Ghidra address:
PAL: 0x00237910

Reimplemented from MetScreen.

◆ PlayCycleRightSound()

virtual void MetJukeboxBaseScreen::PlayCycleRightSound ( int nSelector)
virtual

Overridden empty, so a jukebox screen plays no right-cycle sound.

Parameters
nSelectorDeclared by the slot and ignored.
Ghidra address:
NTSC-U/C: 0x00224988
Ghidra address:
PAL: 0x00237918

Reimplemented from MetScreen.

◆ GetItemCount()

virtual int MetJukeboxBaseScreen::GetItemCount ( )
pure virtual

Report the number of rows the list displays.

Slot 39, pure here. Each of the three children divides the byte span of one vector by its element size and returns the quotient, which is what fixes both the return type and the empty argument list. The name is inferred from that arithmetic and from the ListDataProvider role of the class.

Returns
The row count.
Ghidra address:
NTSC-U/C: 0x005381a8
Ghidra address:
PAL: 0x00577a68

Implemented in MetJukeboxCustomRemixesScreen, MetJukeboxEditPlaylistScreen, and MetJukeboxFactoryRemixesScreen.

◆ ShowRemixDetails()

virtual void MetJukeboxBaseScreen::ShowRemixDetails ( )
virtual

Fill the detail texts from the selected catalogue row.

Slot 40. Every detail text is emptied, the warning text mWarningText is hidden, and mPicturesPending is cleared. An empty or absent catalogue stops there. A remix from another album shows the warning and hides both song pictures. Otherwise both TexturePairRecord members load the song's logo and picture paths, and the genre and tempo texts take the configuration values of codes 0x321 and 0x322 for the record's level name, the tempo followed by bpm. Every remix shows its name, the user name of each player appearance, and its date. A remix of the jukebox album also shows the value of code 0x325, or of code 0x327 when the first is wider than the text wraps at, and sets mPicturesPending. The selected row is read without testing mCatalogueList for null. The title is inferred.

Ghidra address:
NTSC-U/C: 0x0021f3e8
Ghidra address:
PAL: 0x00232060

Reimplemented in MetJukeboxEditPlaylistScreen.

◆ UpdateHelpText()

virtual void MetJukeboxBaseScreen::UpdateHelpText ( )
virtual

Select the help text for the playlist's state.

Slot 41. A playlist below the limit at 0x0069ad78 selects the met_jukebox_base_screen_help_tab layout and posts met_jukebox_base_screen_ticker_tape. A full playlist selects met_jukebox_base_screen_error_tab and posts met_jukebox_base_screen_error_ticker_tape. The title is inferred. The European release looks the layouts and the texts up in the current language.

Ghidra address:
NTSC-U/C: 0x0021fe98
Ghidra address:
PAL: 0x00232c90

Reimplemented in MetJukeboxEditPlaylistScreen.

◆ BindLists()

virtual void MetJukeboxBaseScreen::BindLists ( )
virtual

Bind the catalogue and the playlist from the shared MetRemixManager.

Slot 42. mPlayList becomes the manager's playlist and mCatalogue the manager's remix list for the slot mCatalogueKey identifies, inserted empty when absent. The row counts are pushed into both scrolling lists, and the playlist selection moves to its last entry. SetShowing() runs it before anything else it does. The title is inferred.

Ghidra address:
NTSC-U/C: 0x0021e3f8
Ghidra address:
PAL: 0x00231030

◆ ProvideText()

virtual int MetJukeboxBaseScreen::ProvideText ( int nItem,
int nColumn,
Rnd::Text * pText,
int nContext )
virtual

Show one row of whichever list the context selects.

Context 0 is the remix catalogue at mCatalogue. Its row shows the record's name, in mAvailableFont when the record's albumNumber matches GetAlbumJukeboxValue() and in mUnavailableFont otherwise. Context 1 is the playlist at mPlayList. The body copies the whole entry vector first and shows the indexed name from the copy. An index past the end empties the text in both contexts, and any other context does not change the cell. The column is not read.

Parameters
nItemThe row.
nColumnThe cell index, which the body does not read.
pTextThe cell.
nContext0 for the catalogue and 1 for the playlist.
Returns
Always 1.
Ghidra address:
NTSC-U/C: 0x0021ef30
Ghidra address:
PAL: 0x00231b68

Implements ListDataProvider.

Reimplemented in MetJukeboxEditPlaylistScreen.

◆ ProvideMesh()

virtual int MetJukeboxBaseScreen::ProvideMesh ( int nItem,
int nColumn,
Rnd::Mesh * pMesh,
int nContext )
virtual

Leave the cell as it is.

Parameters
nItemThe row, which the body does not read.
nColumnThe cell index, which the body does not read.
pMeshThe cell, which the body does not read.
nContextThe list context, which the body does not read.
Returns
Always 0.
Ghidra address:
NTSC-U/C: 0x00224ae8
Ghidra address:
PAL: 0x00237a78

Implements ListDataProvider.

Member Data Documentation

◆ mListRowPitch

int MetJukeboxBaseScreen::mListRowPitch
protected

◆ mListRowCount

int MetJukeboxBaseScreen::mListRowCount
protected

◆ mCatalogueList

ScrollingList* MetJukeboxBaseScreen::mCatalogueList
protected

◆ mPlayListList

ScrollingList* MetJukeboxBaseScreen::mPlayListList
protected

◆ mCatalogue

std::vector<MetRemixRecord>* MetJukeboxBaseScreen::mCatalogue
protected

◆ mGenreText

Rnd::Text* MetJukeboxBaseScreen::mGenreText
protected

◆ mTempoText

Rnd::Text* MetJukeboxBaseScreen::mTempoText
protected

◆ mSongTitleText

Rnd::Text* MetJukeboxBaseScreen::mSongTitleText
protected

◆ mDateText

Rnd::Text* MetJukeboxBaseScreen::mDateText
protected

◆ mRemixTitleText

Rnd::Text* MetJukeboxBaseScreen::mRemixTitleText
protected

◆ mPlayListCaption

Rnd::Text* MetJukeboxBaseScreen::mPlayListCaption
protected

◆ mPictureMaterial

Rnd::Mat* MetJukeboxBaseScreen::mPictureMaterial
protected

◆ mLogoMaterial

Rnd::Mat* MetJukeboxBaseScreen::mLogoMaterial
protected

◆ mPlayList

JukeboxPlayList* MetJukeboxBaseScreen::mPlayList
protected

◆ mCatalogueKey

int MetJukeboxBaseScreen::mCatalogueKey
protected

◆ mAppearanceTexts

std::vector<Rnd::Text *> MetJukeboxBaseScreen::mAppearanceTexts
protected

◆ mAvailableFont

Rnd::Font* MetJukeboxBaseScreen::mAvailableFont
protected

◆ mUnavailableFont

Rnd::Font* MetJukeboxBaseScreen::mUnavailableFont
protected

◆ mLogoTextures

TexturePairRecord MetJukeboxBaseScreen::mLogoTextures
protected

◆ mPictureTextures

TexturePairRecord MetJukeboxBaseScreen::mPictureTextures
protected

◆ mPictureMesh

Rnd::Mesh* MetJukeboxBaseScreen::mPictureMesh
protected

◆ mLogoMesh

Rnd::Mesh* MetJukeboxBaseScreen::mLogoMesh
protected

◆ mWarningText

Rnd::Text* MetJukeboxBaseScreen::mWarningText
protected

◆ mPicturesPending

int MetJukeboxBaseScreen::mPicturesPending
protected

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