PebbleOS
Loading...
Searching...
No Matches
Data Structures | Macros | Typedefs | Enumerations | Functions
vibe_score.h File Reference
#include <resource/resource.h>
#include <pbl/kernel/compiler.h>
#include <pbl/util/generic_attr.h>
#include <pbl/util/misc.h>

Data Structures

struct  VibeScore
 Vibe score, as stored in the resource after the signature. More...
 
struct  VibeNote
 Vibration step of a vibe score. More...
 

Macros

#define VIBE_SCORE_VERSION   (1)
 Highest vibe score format version supported.
 
#define VIBE_SIGNATURE   PBL_FOURCC('V', 'I', 'B', 'E')
 Signature at the start of a vibe score resource.
 
#define VIBE_DATA_OFFSET   sizeof(VIBE_SIGNATURE)
 Offset of the VibeScore within the resource.
 

Typedefs

typedef uint8_t VibeNoteIndex
 Index into the notes table of a vibe score.
 

Enumerations

enum  VibeAttributeId { VibeAttributeId_Invalid = 0x00 , VibeAttributeId_Notes = 0x01 , VibeAttributeId_Pattern = 0x02 , VibeAttributeId_RepeatDelay = 0x03 }
 Attributes of a vibe score. More...
 

Functions

VibeScore * vibe_score_create_with_resource_system (ResAppNum app_num, uint32_t resource_id)
 Load a vibe score from the resources of an app.
 
VibeScore * vibe_score_create_with_resource (uint32_t resource_id)
 Load a vibe score from the resources of the calling process.
 
bool vibe_score_validate (VibeScore *score, uint32_t data_size)
 Check whether a vibe score is well formed.
 
unsigned int vibe_score_get_duration_ms (VibeScore *score)
 Get the duration of one playback of a vibe score.
 
unsigned int vibe_score_get_repeat_delay_ms (VibeScore *score)
 Get the delay before a vibe score repeats.
 
void vibe_score_do_vibe (VibeScore *score)
 Play a vibe score once.
 
void vibe_score_destroy (VibeScore *score)
 Free a vibe score.