ASAPCabinetFE
 
Loading...
Searching...
No Matches
IAssetManager Class Referenceabstract

The IAssetManager interface provides methods to manage and access various assets used in the application. More...

#include <iasset_manager.h>

+ Inheritance diagram for IAssetManager:
+ Collaboration diagram for IAssetManager:

Public Member Functions

virtual ~IAssetManager ()=default
 Virtual destructor to ensure derived classes can clean up properly.
 
virtual SDL_Texture * getPlayfieldTexture ()=0
 Retrieves the texture used for the playfield.
 
virtual SDL_Texture * getWheelTexture (SDL_Renderer *renderer)=0
 Retrieves the texture used for the wheel for a specific renderer.
 
virtual SDL_Texture * getBackglassTexture ()=0
 Retrieves the texture used for the backglass.
 
virtual SDL_Texture * getDmdTexture ()=0
 Retrieves the texture used for the dot matrix display (DMD).
 
virtual SDL_Texture * getTopperTexture ()=0
 Retrieves the texture used for the topper display.
 
virtual SDL_Texture * getTitleTexture (SDL_Renderer *renderer)=0
 Retrieves the texture used for the title for a specific renderer.
 
virtual IVideoPlayergetPlayfieldVideoPlayer ()=0
 Retrieves the video player associated with the playfield.
 
virtual IVideoPlayergetBackglassVideoPlayer ()=0
 Retrieves the video player associated with the backglass.
 
virtual IVideoPlayergetDmdVideoPlayer ()=0
 Retrieves the video player associated with the dot matrix display (DMD).
 
virtual IVideoPlayergetTopperVideoPlayer ()=0
 Retrieves the video player associated with the topper display.
 
virtual IConfigServicegetSettingsManager ()=0
 Retrieves the configuration service that manages application settings.
 
virtual SDL_Rect getTitleRect ()=0
 Retrieves the rectangle that specifies the title's position and dimensions (x, y, width, height).
 
virtual void setTitlePosition (int x, int y)=0
 Sets the title's position on the display.
 
virtual void setFont (TTF_Font *font)=0
 Sets the current font for text rendering.
 
virtual void reloadTitleTexture (const std::string &title, SDL_Color color, SDL_Rect &titleRect)=0
 Reloads the title texture using a new title string and color, updating the title rectangle accordingly.
 
virtual void reloadAssets (IWindowManager *windowManager, TTF_Font *font, const std::vector< TableData > &tables, size_t index)=0
 Reloads all relevant assets with updated settings, fonts, and table data.
 
virtual void setSettingsManager (IConfigService *cm)=0
 Sets the configuration service (settings manager) responsible for application settings.
 
virtual void loadTableAssets (size_t index, const std::vector< TableData > &tables)=0
 Loads assets for a specific table based on its index and associated table data.
 
virtual void clearOldVideoPlayers ()=0
 Clears any existing video players to free resources before initializing new ones.
 
virtual void cleanupVideoPlayers ()=0
 Cleans up video players, releasing allocated resources appropriately.
 
virtual void setSoundManager (ISoundManager *soundManager)=0
 Sets the sound manager for audio playback.
 
virtual void playTableMusic (size_t index, const std::vector< TableData > &tables)=0
 Plays table-specific music.
 
virtual void applyVideoAudioSettings ()=0
 Applies audio settings to all active video players.
 

Detailed Description

The IAssetManager interface provides methods to manage and access various assets used in the application.

Interface for asset management (forward declaration).

This interface abstracts asset management functionality including handling textures, video players, configuration settings, fonts, audio, and positions for display elements. Implementations of this interface should ensure proper resource management and provide mechanisms for updating assets dynamically.

Member Function Documentation

◆ applyVideoAudioSettings()

virtual void IAssetManager::applyVideoAudioSettings ( )
pure virtual

Applies audio settings to all active video players.

Updates the volume and mute state of playfield, backglass, and DMD video players based on the current mediaAudioVol and mediaAudioMute settings.

Implemented in AssetManager.

+ Here is the caller graph for this function:

◆ cleanupVideoPlayers()

virtual void IAssetManager::cleanupVideoPlayers ( )
pure virtual

Cleans up video players, releasing allocated resources appropriately.

Implemented in AssetManager.

◆ clearOldVideoPlayers()

virtual void IAssetManager::clearOldVideoPlayers ( )
pure virtual

Clears any existing video players to free resources before initializing new ones.

Implemented in AssetManager.

◆ getBackglassTexture()

virtual SDL_Texture * IAssetManager::getBackglassTexture ( )
pure virtual

Retrieves the texture used for the backglass.

Returns
SDL_Texture* Pointer to the backglass texture.

Implemented in AssetManager.

◆ getBackglassVideoPlayer()

virtual IVideoPlayer * IAssetManager::getBackglassVideoPlayer ( )
pure virtual

Retrieves the video player associated with the backglass.

Returns
IVideoPlayer* Pointer to the backglass video player.
See also
IVideoPlayer

Implemented in AssetManager.

+ Here is the caller graph for this function:

◆ getDmdTexture()

virtual SDL_Texture * IAssetManager::getDmdTexture ( )
pure virtual

Retrieves the texture used for the dot matrix display (DMD).

Returns
SDL_Texture* Pointer to the DMD texture.

Implemented in AssetManager.

◆ getDmdVideoPlayer()

virtual IVideoPlayer * IAssetManager::getDmdVideoPlayer ( )
pure virtual

Retrieves the video player associated with the dot matrix display (DMD).

Returns
IVideoPlayer* Pointer to the DMD video player.
See also
IVideoPlayer

Implemented in AssetManager.

+ Here is the caller graph for this function:

◆ getPlayfieldTexture()

virtual SDL_Texture * IAssetManager::getPlayfieldTexture ( )
pure virtual

Retrieves the texture used for the playfield.

Returns
SDL_Texture* Pointer to the playfield texture.

Implemented in AssetManager.

◆ getPlayfieldVideoPlayer()

virtual IVideoPlayer * IAssetManager::getPlayfieldVideoPlayer ( )
pure virtual

Retrieves the video player associated with the playfield.

Returns
IVideoPlayer* Pointer to the playfield video player.
See also
IVideoPlayer

Implemented in AssetManager.

+ Here is the caller graph for this function:

◆ getSettingsManager()

virtual IConfigService * IAssetManager::getSettingsManager ( )
pure virtual

Retrieves the configuration service that manages application settings.

Returns
IConfigService* Pointer to the settings manager.
See also
IConfigService

Implemented in AssetManager.

+ Here is the caller graph for this function:

◆ getTitleRect()

virtual SDL_Rect IAssetManager::getTitleRect ( )
pure virtual

Retrieves the rectangle that specifies the title's position and dimensions (x, y, width, height).

Returns
SDL_Rect The rectangle representing the title's size and position.

Implemented in AssetManager.

◆ getTitleTexture()

virtual SDL_Texture * IAssetManager::getTitleTexture ( SDL_Renderer *  renderer)
pure virtual

Retrieves the texture used for the title for a specific renderer.

Parameters
rendererThe SDL renderer to get the texture for.
Returns
SDL_Texture* Pointer to the title texture.

Implemented in AssetManager.

◆ getTopperTexture()

virtual SDL_Texture * IAssetManager::getTopperTexture ( )
pure virtual

Retrieves the texture used for the topper display.

Returns
SDL_Texture* Pointer to the topper texture.

Implemented in AssetManager.

◆ getTopperVideoPlayer()

virtual IVideoPlayer * IAssetManager::getTopperVideoPlayer ( )
pure virtual

Retrieves the video player associated with the topper display.

Returns
IVideoPlayer* Pointer to the topper video player.
See also
IVideoPlayer

Implemented in AssetManager.

+ Here is the caller graph for this function:

◆ getWheelTexture()

virtual SDL_Texture * IAssetManager::getWheelTexture ( SDL_Renderer *  renderer)
pure virtual

Retrieves the texture used for the wheel for a specific renderer.

Parameters
rendererThe SDL renderer to get the texture for.
Returns
SDL_Texture* Pointer to the wheel texture.

Implemented in AssetManager.

◆ loadTableAssets()

virtual void IAssetManager::loadTableAssets ( size_t  index,
const std::vector< TableData > &  tables 
)
pure virtual

Loads assets for a specific table based on its index and associated table data.

Parameters
indexThe index of the table to load assets for.
tablesA vector containing table data.

Implemented in AssetManager.

+ Here is the caller graph for this function:

◆ playTableMusic()

virtual void IAssetManager::playTableMusic ( size_t  index,
const std::vector< TableData > &  tables 
)
pure virtual

Plays table-specific music.

Parameters
indexThe index of the table to play music for.
tablesA vector containing table data with music paths.

Implemented in AssetManager.

◆ reloadAssets()

virtual void IAssetManager::reloadAssets ( IWindowManager windowManager,
TTF_Font *  font,
const std::vector< TableData > &  tables,
size_t  index 
)
pure virtual

Reloads all relevant assets with updated settings, fonts, and table data.

Parameters
windowManagerPointer to the window manager used for rendering.
fontPointer to the TTF_Font used for text rendering.
tablesA vector containing table data necessary for asset creation.
indexThe index of the table data to reload assets for.
See also
IWindowManager

Implemented in AssetManager.

◆ reloadTitleTexture()

virtual void IAssetManager::reloadTitleTexture ( const std::string &  title,
SDL_Color  color,
SDL_Rect &  titleRect 
)
pure virtual

Reloads the title texture using a new title string and color, updating the title rectangle accordingly.

Parameters
titleThe new title string.
colorThe color used for text rendering.
titleRect[in,out] Parameter that is updated to reflect the new title's dimensions (width and height) after the texture is reloaded.

Implemented in AssetManager.

◆ setFont()

virtual void IAssetManager::setFont ( TTF_Font *  font)
pure virtual

Sets the current font for text rendering.

Parameters
fontPointer to the TTF_Font object to be set.

Implemented in AssetManager.

◆ setSettingsManager()

virtual void IAssetManager::setSettingsManager ( IConfigService cm)
pure virtual

Sets the configuration service (settings manager) responsible for application settings.

Parameters
cmPointer to the new IConfigService instance.
See also
IConfigService

Implemented in AssetManager.

◆ setSoundManager()

virtual void IAssetManager::setSoundManager ( ISoundManager soundManager)
pure virtual

Sets the sound manager for audio playback.

Parameters
soundManagerPointer to the ISoundManager instance.
See also
ISoundManager

Implemented in AssetManager.

◆ setTitlePosition()

virtual void IAssetManager::setTitlePosition ( int  x,
int  y 
)
pure virtual

Sets the title's position on the display.

Parameters
xThe new x-coordinate for the title.
yThe new y-coordinate for the title.

Implemented in AssetManager.

+ Here is the caller graph for this function:

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