ASAPCabinetFE
 
Loading...
Searching...
No Matches
iasset_manager.h
Go to the documentation of this file.
1
10#ifndef IASSET_MANAGER_H
11#define IASSET_MANAGER_H
12
13#include <SDL.h>
14#include <SDL_ttf.h>
15#include <memory>
16#include <string>
17#include <vector>
19#include "tables/itable_loader.h"
21#include "ivideo_player.h"
22
27class ISoundManager;
28
37public:
41 virtual ~IAssetManager() = default;
42
43 // Texture accessors
48 virtual SDL_Texture* getPlayfieldTexture() = 0;
49
55 virtual SDL_Texture* getWheelTexture(SDL_Renderer* renderer) = 0;
56
61 virtual SDL_Texture* getBackglassTexture() = 0;
62
67 virtual SDL_Texture* getDmdTexture() = 0;
68
73 virtual SDL_Texture* getTopperTexture() = 0;
74
80 virtual SDL_Texture* getTitleTexture(SDL_Renderer* renderer) = 0;
81
82 // Video player accessors
89
96
103
110
111 // Settings and positioning
118
123 virtual SDL_Rect getTitleRect() = 0;
124
130 virtual void setTitlePosition(int x, int y) = 0;
131
132 // Font management
137 virtual void setFont(TTF_Font* font) = 0;
138
145 virtual void reloadTitleTexture(const std::string& title, SDL_Color color, SDL_Rect& titleRect) = 0;
146
147 // Asset management
156 virtual void reloadAssets(IWindowManager* windowManager, TTF_Font* font, const std::vector<TableData>& tables, size_t index) = 0;
157
163 virtual void setSettingsManager(IConfigService* cm) = 0;
164
170 virtual void loadTableAssets(size_t index, const std::vector<TableData>& tables) = 0;
171
175 virtual void clearOldVideoPlayers() = 0;
176
180 virtual void cleanupVideoPlayers() = 0;
181
187 virtual void setSoundManager(ISoundManager* soundManager) = 0;
188
194 virtual void playTableMusic(size_t index, const std::vector<TableData>& tables) = 0;
195
202 virtual void applyVideoAudioSettings() = 0;
203};
204
205#endif // IASSET_MANAGER_H
The IAssetManager interface provides methods to manage and access various assets used in the applicat...
Definition iasset_manager.h:36
virtual SDL_Texture * getDmdTexture()=0
Retrieves the texture used for the dot matrix display (DMD).
virtual void setSettingsManager(IConfigService *cm)=0
Sets the configuration service (settings manager) responsible for application settings.
virtual void clearOldVideoPlayers()=0
Clears any existing video players to free resources before initializing new ones.
virtual SDL_Rect getTitleRect()=0
Retrieves the rectangle that specifies the title's position and dimensions (x, y, width,...
virtual SDL_Texture * getTopperTexture()=0
Retrieves the texture used for the topper display.
virtual void applyVideoAudioSettings()=0
Applies audio settings to all active video players.
virtual SDL_Texture * getWheelTexture(SDL_Renderer *renderer)=0
Retrieves the texture used for the wheel for a specific renderer.
virtual void setTitlePosition(int x, int y)=0
Sets the title's position on the display.
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 SDL_Texture * getPlayfieldTexture()=0
Retrieves the texture used for the playfield.
virtual IVideoPlayer * getTopperVideoPlayer()=0
Retrieves the video player associated with the topper display.
virtual SDL_Texture * getTitleTexture(SDL_Renderer *renderer)=0
Retrieves the texture used for the title for a specific renderer.
virtual void playTableMusic(size_t index, const std::vector< TableData > &tables)=0
Plays table-specific music.
virtual SDL_Texture * getBackglassTexture()=0
Retrieves the texture used for the backglass.
virtual void setSoundManager(ISoundManager *soundManager)=0
Sets the sound manager for audio playback.
virtual IVideoPlayer * getBackglassVideoPlayer()=0
Retrieves the video player associated with the backglass.
virtual void setFont(TTF_Font *font)=0
Sets the current font for text rendering.
virtual IVideoPlayer * getDmdVideoPlayer()=0
Retrieves the video player associated with the dot matrix display (DMD).
virtual ~IAssetManager()=default
Virtual destructor to ensure derived classes can clean up properly.
virtual IConfigService * getSettingsManager()=0
Retrieves the configuration service that manages application settings.
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 accordingl...
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 cleanupVideoPlayers()=0
Cleans up video players, releasing allocated resources appropriately.
virtual IVideoPlayer * getPlayfieldVideoPlayer()=0
Retrieves the video player associated with the playfield.
Interface for configuration services (forward declaration).
Definition iconfig_service.h:30
Interface for managing sound operations.
Definition isound_manager.h:14
Interface for a video player.
Definition ivideo_player.h:19
Interface for managing SDL windows and renderers.
Definition iwindow_manager.h:27
Defines the IConfigService interface for managing configuration in ASAPCabinetFE.
Defines the IWindowManager interface for managing SDL windows and renderers in ASAPCabinetFE.