From b5803476356f97c8ad02e0c05e52ca513b37a6e9 Mon Sep 17 00:00:00 2001 From: Diogo Autilio Date: Sat, 31 Aug 2024 19:53:15 -0300 Subject: [PATCH] Document Browser --- src/audio.h | 7 ++--- src/bgm.h | 2 +- src/browser.h | 74 ++++++++++++++++++++++++++++++++++----------------- 3 files changed, 52 insertions(+), 31 deletions(-) diff --git a/src/audio.h b/src/audio.h index 115e24c..1004d56 100644 --- a/src/audio.h +++ b/src/audio.h @@ -470,7 +470,6 @@ extern void oslAudioVSync(); #define oslSetSoundLoop(s, loop) oslSetSoundEndCallback(s, (loop) ? oslSoundLoopFunc : NULL) /** - * @enum OSL_FMT_GENERAL * General audio format flags for basic settings and operations within OSLib. */ enum { @@ -478,15 +477,13 @@ enum { }; /** - * @enum OSL_FMT_GENERAL - * General audio format flags for basic settings and operations within OSLib. + * Mask flags used to isolate or filter out specific bits from format flags, typically used in bitwise operations. */ enum { OSL_FMT_MASK = 0xff //!< Mask used to isolate or filter out specific bits from format flags, typically used in bitwise operations. }; /** - * @enum OSL_FMT_AUDIO_CONFIG * Defines the audio output configuration and streaming capabilities for playback in OSLib. * These flags are used to set the properties of audio channels and to control how audio data is processed and delivered. */ @@ -497,7 +494,6 @@ enum { }; /** - * @enum OSL_FMT_SAMPLE_RATE * Sample rate options for audio playback. */ enum { @@ -613,6 +609,7 @@ extern OSL_AUDIO_VOICE osl_audioVoices[OSL_NUM_AUDIO_CHANNELS]; * @param voice The channel number on which the sound was playing. * @return Always returns 1 to indicate that the sound should continue playing. */ +extern int oslSoundLoopFunc(OSL_SOUND *s, int voice); /** @} */ // end of audio_adv diff --git a/src/bgm.h b/src/bgm.h index e8782c4..b1d4f91 100644 --- a/src/bgm.h +++ b/src/bgm.h @@ -1,5 +1,5 @@ /** - * @file osl_bgm.h + * @file bgm.h * @brief Defines the BGM_FORMAT_HEADER structure for BGM file format in OSLib. */ diff --git a/src/browser.h b/src/browser.h index 32374f1..be845da 100755 --- a/src/browser.h +++ b/src/browser.h @@ -6,44 +6,68 @@ extern "C" { #endif /** @defgroup Browser Browser - - Functions to display Sony's internet browser - @{ + @brief Functions to display Sony's internet browser. + @{ */ -/**Memory error initializing the browser*/ -#define OSL_BROWSER_ERROR_MEMORY -1 -/**Error initializing the browser*/ -#define OSL_BROWSER_ERROR_INIT -2 - -/** Initializes the internet browser. - \param url - The url to open - \param downloadDir - The default download directory - \param browserMemory - The amount of memory to allocate for the browser - \param displaymode - One of pspUtilityHtmlViewerDisplayModes - \param options - One of pspUtilityHtmlViewerOptions - \param interfacemode - One of pspUtilityHtmlViewerInterfaceModes - \param connectmode - One of pspUtilityHtmlViewerConnectModes +/** @brief Memory error initializing the browser. + */ +#define OSL_BROWSER_ERROR_MEMORY -1 -*/ +/** @brief Error initializing the browser. + */ +#define OSL_BROWSER_ERROR_INIT -2 + +/** + * @brief Initializes the internet browser. + * + * This function initializes Sony's internet browser with the specified URL and options. + * + * @param url The URL to open. + * @param downloadDir The default download directory. + * @param browserMemory The amount of memory to allocate for the browser. + * @param displaymode One of the `pspUtilityHtmlViewerDisplayModes`. + * @param options One of the `pspUtilityHtmlViewerOptions`. + * @param interfacemode One of the `pspUtilityHtmlViewerInterfaceModes`. + * @param connectmode One of the `pspUtilityHtmlViewerConnectModes`. + * + * @return Returns 0 on success, or a negative error code on failure. + */ int oslBrowserInit(char *url, char *downloadDir, int browserMemory, unsigned int displaymode, unsigned int options, unsigned int interfacemode, unsigned int connectmode); +/** + * @brief Renders the browser display. + * + * This function handles the drawing/rendering of the browser's display. + */ void oslDrawBrowser(); +/** + * @brief Gets the current status of the browser. + * + * This function returns the current status of the browser, which can be used to determine + * if the browser is still active or if there are any errors. + * + * @return The current status of the browser. + */ int oslGetBrowserStatus(); +/** + * @brief Ends the browser session. + * + * This function closes the internet browser and frees any resources allocated during initialization. + */ void oslEndBrowser(); +/** + * @brief Checks if the browser is active. + * + * This function checks whether the browser is currently active. + * + * @return Returns 1 if the browser is active, 0 otherwise. + */ int oslBrowserIsActive(); - /** @} */ // end of Browser #ifdef __cplusplus