Skip to content

Commit

Permalink
add player.h
Browse files Browse the repository at this point in the history
  • Loading branch information
Azq2 committed Mar 18, 2024
1 parent a80f02e commit acbd57f
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 19 deletions.
1 change: 1 addition & 0 deletions swilib/include/swilib.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
#include "swilib/file.h"
#include "swilib/explorer.h"
#include "swilib/sound.h"
#include "swilib/player.h"
#include "swilib/obs.h"
#include "swilib/settings.h"
#include "swilib/system.h"
Expand Down
Binary file removed swilib/include/swilib.h.gch
Binary file not shown.
47 changes: 47 additions & 0 deletions swilib/include/swilib/player.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#pragma once

#ifndef __IN_SWILIB__
#include "base.h"
#include "wstring.h"
#endif

__swilib_begin

/**
* @addtogroup Player
* @brief Functions for working with builtin media player.
*
* Usage: `#include <swilib.h>` or `#include <swilib/player.h>`
* @{
*/

/**
* Pointer to the magic value for controlling media player.
* @return pointer
*
* ```C
* uint32_t ctrl_code = *RamMPlayer_CtrlCode();
* ```
* */
__swi_begin(0x80E1)
uint32_t *RamMPlayer_CtrlCode()
__swi_end(0x80E1, RamMPlayer_CtrlCode, ());

/**
* Play previous song in standart media player.
* */
__swi_begin(0x1FF)
void MEDIA_PLAYLAST()
__swi_end(0x1FF, MEDIA_PLAYLAST, ());

/**
* Get the filename of the current song in the media player.
* @return pointer to the WSHDR
* */
__swi_begin(0x082)
const WSHDR *GetCurrentTrackFilename()
__swi_end(0x082, GetCurrentTrackFilename, ());

__swilib_end

/** @} */
19 changes: 0 additions & 19 deletions swilib/include/swilib/sound.h
Original file line number Diff line number Diff line change
Expand Up @@ -441,25 +441,6 @@ __swi_begin(0x09A)
int ChangeVolume(uint8_t volume)
__swi_end(0x09A, ChangeVolume, (volume));

/**
* Pointer to the magic value for controlling media player.
* @return pointer
*
* ```C
* uint32_t ctrl_code = *RamMPlayer_CtrlCode();
* ```
* */
__swi_begin(0x80E1)
uint32_t *RamMPlayer_CtrlCode()
__swi_end(0x80E1, RamMPlayer_CtrlCode, ());

/**
* Play previous song in standart media player.
* */
__swi_begin(0x1FF)
void MEDIA_PLAYLAST()
__swi_end(0x1FF, MEDIA_PLAYLAST, ());

__swilib_end

/** @} */

0 comments on commit acbd57f

Please sign in to comment.