![]() |
CRM64Pro GDK v0.14.0
A free cross-platform game development kit built on top of SDL 3.0
|
Config Manager class. More...
Config Manager class.
Public Member Functions | |
| bool | info (Sint32 iMode=0) override |
| Request Configuration Manager information. | |
| bool | audioInit (eAudioFreq eAF=AF_DEFAULT, eAudioSample eAS=AS_DEFAULT, eAudioMode eAM=AM_DEFAULT) |
| Initialize the audio system. | |
| bool | audioStatus (eAudioFreq *eAF=nullptr, eAudioSample *eAS=nullptr, eAudioMode *eAM=nullptr) |
| Check audio system status. | |
| bool | audioClose () |
| Close the audio system. | |
| bool | audioSetDriver (eConfigAudioDriver eCAD) |
| Set the audio driver. | |
| eConfigAudioDriver | audioGetDriver () const |
| Get the audio driver. | |
| const char * | audioGetDriverInUse () const |
| Get the audio driver name in use. | |
| bool | audioSetMasterGain (float fGain) |
| Set Master gain (Volume). | |
| float | audioGetMasterGain () const |
| Get Master gain (Volume). | |
| bool | audioSetTagGain (eAudioTrackTag eTag, float fGain) |
| Set Gain (Volume) for a specific audio track tag category. | |
| float | audioGetTagGain (eAudioTrackTag eTag) const |
| Get the current gain for a specific audio track tag category. | |
| MIX_Mixer * | audioGetMixer () const |
| Get the internal SDL3 Mixer Device handle. | |
| Sint32 | create (const string &sName, Uint32 iUnused=0) override |
| Create a new screen. | |
| bool | close (Sint32 idScreen) override |
| Close and destroy a screen. | |
| Sint32 | getCount () const override |
| Get number of loaded objects. | |
| Sint32 | setName (Sint32 idScreen, const string &sName) override |
| Change the object name. | |
| void | reset (Sint32 iMode=0) |
| Set all default values, close audio system, remove all existing screens and create the "default" screen. | |
| Screen * | get (Sint32 idScreen=0) |
| Get a pointer to the screen using its handle. | |
| Screen * | get (SDL_Window *wScreen) |
| Get a pointer to the screen using a SDL_Window pointer. | |
| Sint32 | save (const string &sConfigXML, const string &sCDCFile="") |
| Save current audio/screens configuration. | |
| Sint32 | loadFromFile (const string &sConfigXML) |
| Load audio/screen configuration from a file. | |
| Sint32 | load (const string &sCDCFile, const string &sConfigXML) |
| Load audio/screen configuration from a CDC file. | |
| Sint32 | load (const Sint32 idCDC, const string &sConfigXML) |
| Load audio/screen configuration from a CDC file. | |
| Sint32 | setup (const string &sConfigXML, const string &sConfigCDC="", const string &sCustomSetupXML="") |
| Open the setup window for configuring audio/screen settings. | |
| Sint32 | setup (const string &sConfigXML, Sint32 idConfigCDC, const string &sCustomSetupXML="") |
| Open the setup window for configuring audio/screen settings. | |
Public Attributes | |
| Uint8 | iMTFriendly |
|
override |
Request Configuration Manager information.
Writes manager information to the default log. Displays: general settings (multithread friendly flag), graphics information (displays, renderer drivers, screens), and audio information (devices, drivers, output).
| iMode | -1 to display only manager information. 0 (default) to display manager and all screens. Specific object ID to display manager and only that screen. |
| bool CRM64Pro::ConfigMgr::audioInit | ( | eAudioFreq | eAF = AF_DEFAULT, |
| eAudioSample | eAS = AS_DEFAULT, | ||
| eAudioMode | eAM = AM_DEFAULT ) |
Initialize the audio system.
The first call to this method initializes the SDL audio subsystem.
| eAF | Audio frequency. Default AF_DEFAULT (44100Hz). |
| eAS | Audio sample format. Default AS_DEFAULT (S16SYS). |
| eAM | Audio mode. Default AM_DEFAULT (Stereo). |
| bool CRM64Pro::ConfigMgr::audioStatus | ( | eAudioFreq * | eAF = nullptr, |
| eAudioSample * | eAS = nullptr, | ||
| eAudioMode * | eAM = nullptr ) |
Check audio system status.
| eAF | ::eAudioFreq enum pointer filled in with audio frequency. If nullptr (default), this value is not retrieved. |
| eAS | ::eAudioSample enum pointer filled in with audio sampling. If nullptr (default), this value is not retrieved. |
| eAM | ::eAudioMode enum pointer filled in with audio mode. If nullptr (default), this value is not retrieved. |
| bool CRM64Pro::ConfigMgr::audioClose | ( | ) |
Close the audio system.
Recommended to call at the very end of your application, after closing all resources and before Main::Terminate(). If not called, it will be automatically called on Main::Terminate().
| bool CRM64Pro::ConfigMgr::audioSetDriver | ( | eConfigAudioDriver | eCAD | ) |
Set the audio driver.
| eCAD | audio driver. Check ::eConfigAudioDriver enum for further information. |
| eConfigAudioDriver CRM64Pro::ConfigMgr::audioGetDriver | ( | ) | const |
Get the audio driver.
Returns the audio driver set by default or by audioSetDriver() method. Note that it could differ from the driver in use. Use audioGetDriverInUse() to get the actual driver.
| const char * CRM64Pro::ConfigMgr::audioGetDriverInUse | ( | ) | const |
Get the audio driver name in use.
Returns the audio driver name in use (e.g., "wasapi", "directsound", "pulseaudio"). The audio must be initialized.
| bool CRM64Pro::ConfigMgr::audioSetMasterGain | ( | float | fGain | ) |
Set Master gain (Volume).
Sets the global volume for the mixer device.
| fGain | Volume float (0.0f to 2.0f). 1.0f is nominal. |
| float CRM64Pro::ConfigMgr::audioGetMasterGain | ( | ) | const |
Get Master gain (Volume).
| bool CRM64Pro::ConfigMgr::audioSetTagGain | ( | eAudioTrackTag | eTag, |
| float | fGain ) |
Set Gain (Volume) for a specific audio track tag category.
Updates the stored volume for the tag category and immediately updates all active tracks of that type.
| eTag | The tag category to update (Music, SFX, etc). |
| fGain | Volume (0.0f - 2.0f). 1.0f is nominal. |
| float CRM64Pro::ConfigMgr::audioGetTagGain | ( | eAudioTrackTag | eTag | ) | const |
Get the current gain for a specific audio track tag category.
Retrieves the stored volume multiplier for the given tag.
| eTag | The tag category to query (Music, SFX, etc). |
| MIX_Mixer * CRM64Pro::ConfigMgr::audioGetMixer | ( | ) | const |
Get the internal SDL3 Mixer Device handle.
Returns the raw pointer to the initialized MIX_Mixer device. This is primarily used internally by AudioTrackMgr to create tracks.
|
override |
Create a new screen.
| sName | the name to give to the screen object (e.g. 'myScreen'). The object name must be unique with a maximum of 64 characters or will be truncated. |
| iUnused | unused for the time being. |
|
override |
Close and destroy a screen.
| idScreen | 0 for closing all screens or the Screen id. This removes the screen and all associated resources (SDL window, SDL renderer, etc.). Additionally, it informs ImageMgr to remove all textures created for the screen. |
|
override |
Get number of loaded objects.
|
override |
Change the object name.
| idScreen | Screen id. |
| sName | the name to give to the screen object (e.g. 'myScreen'). The object name must be unique with a maximum of 64 characters or will be truncated. |
| void CRM64Pro::ConfigMgr::reset | ( | Sint32 | iMode = 0 | ) |
Set all default values, close audio system, remove all existing screens and create the "default" screen.
| iMode | 0 for resetting general, audio and screen values or 1 for resetting only the screen values. |
| Screen * CRM64Pro::ConfigMgr::get | ( | Sint32 | idScreen = 0 | ) |
Get a pointer to the screen using its handle.
| idScreen | Screen id. By default, selects the default screen. |
| Screen * CRM64Pro::ConfigMgr::get | ( | SDL_Window * | wScreen | ) |
Get a pointer to the screen using a SDL_Window pointer.
| wScreen | SDL_Window pointer. |
| Uint8 CRM64Pro::ConfigMgr::iMTFriendly |
When set to 1 or greater, yields to the OS scheduler for at least this many milliseconds after each render frame. Disabled by default (0).