#include <stddef.h>
#include <stdlib.h>
#include <stdio.h>
#include "navigation.h"
#include "file.h"
#include "reader_txt.h"
#include "ctrl_access.h"
#include <string.h>
#include "reader_id3.h"
Functions | |
bool | reader_id3_album (FS_STRING sz_album, uint8_t u8_size_max) |
Return album from ID3 of current file selected. More... | |
bool | reader_id3_artist (FS_STRING sz_artist, uint8_t u8_size_max) |
Return artist from ID3 of current file selected. More... | |
uint32_t | reader_id3_duration (void) |
Return the length of the audiofile in milliseconds. More... | |
bool | reader_id3_genre (FS_STRING sz_genre, uint8_t u8_size_max) |
Return genre from ID3 of current file selected. More... | |
static St_id3ver | reader_id3_getver (void) |
Private routines for all ID3 versions. More... | |
bool | reader_id3_picture (FS_STRING mime_type, uint8_t u8_size_max, uint8_t *picture_type, uint32_t *offset) |
Return embedded image mime type, image type and offset into the file. More... | |
static uint16_t | reader_id3_read_string (FS_STRING string, uint16_t size_string, uint8_t format) |
Read an ASCII string in an ID3 field. More... | |
St_id3size | reader_id3_size (void) |
Return ID3 size from ID3 of current file selected. More... | |
static uint32_t | reader_id3_strtoul (FS_STRING string) |
Converts a string to an unsigned long. More... | |
bool | reader_id3_title (FS_STRING sz_title, uint8_t u8_size_max) |
Return title from ID3 of current file selected. More... | |
uint32_t | reader_id3_track (void) |
Return track from ID3 of current file selected. More... | |
static bool | reader_id3_v1_album (FS_STRING sz_album, uint8_t u8_size_max) |
Return album from ID3 V1. More... | |
static bool | reader_id3_v1_artist (FS_STRING sz_artist, uint8_t u8_size_max) |
Return artist from ID3 V1. More... | |
static bool | reader_id3_v1_genre (FS_STRING sz_genre, uint8_t u8_size_max) |
Return genre from ID3 V1. More... | |
static bool | reader_id3_v1_string (uint8_t pos_seek, uint8_t size, FS_STRING sz_string, uint8_t u8_size_max) |
Return a string from ID3 V1. More... | |
static bool | reader_id3_v1_title (FS_STRING sz_title, uint8_t u8_size_max) |
functions version 1 More... | |
static bool | reader_id3_v1_track (FS_STRING sz_track, uint8_t u8_size_max) |
Return a track from ID3 V1. More... | |
static bool | reader_id3_v1_year (FS_STRING sz_year, uint8_t u8_size_max) |
Return year from ID3 V1. More... | |
static bool | reader_id3_v2_album (St_id3ver ver, FS_STRING sz_album, uint8_t u8_size_max) |
Return album from ID3 V2. More... | |
static bool | reader_id3_v2_artist (St_id3ver ver, FS_STRING sz_artist, uint8_t u8_size_max) |
Return artist from ID3 V2. More... | |
static bool | reader_id3_v2_duration (St_id3ver ver, FS_STRING sz_duration, uint8_t u8_size_max) |
Return duration from ID3 V2. More... | |
static uint32_t | reader_id3_v2_findtag (St_id3ver version, char *tag) |
Get informations of ID3 version 2. More... | |
static bool | reader_id3_v2_genre (St_id3ver ver, FS_STRING sz_genre, uint8_t u8_size_max) |
Return genre from ID3 V2. More... | |
static bool | reader_id3_v2_picture (St_id3ver ver, FS_STRING mime_type, uint8_t u8_size_max, uint8_t *picture_type, uint32_t *offset) |
Get attached picture from ID3 V2. More... | |
static bool | reader_id3_v2_string (St_id3ver ver, char *tag, FS_STRING sz_string, uint8_t u8_size_max) |
Return a string corresponding at TAG V2. More... | |
static bool | reader_id3_v2_title (St_id3ver ver, FS_STRING sz_title, uint8_t u8_size_max) |
functions version 2 More... | |
static bool | reader_id3_v2_track (St_id3ver ver, FS_STRING sz_track, uint8_t u8_size_max) |
Return track from ID3 V2. More... | |
static bool | reader_id3_v2_year (St_id3ver ver, FS_STRING sz_year, uint8_t u8_size_max) |
Return year from ID3 V2. More... | |
St_id3ver | reader_id3_version (void) |
Return ID3 version from ID3 of current file selected. More... | |
uint16_t | reader_id3_year (void) |
Return year from ID3 of current file selected. More... | |
Variables | |
static _CONST_TYPE_ uint8_t | tab_genre_id3_v1 [126][18] |
Return album from ID3 of current file selected.
References file_close(), reader_id3_getver(), reader_id3_v1_album(), reader_id3_v2_album(), St_id3ver::ver1, and St_id3ver::ver10.
Return artist from ID3 of current file selected.
References file_close(), reader_id3_getver(), reader_id3_v1_artist(), reader_id3_v2_artist(), St_id3ver::ver1, and St_id3ver::ver10.
uint32_t reader_id3_duration | ( | void | ) |
Return the length of the audiofile in milliseconds.
References file_close(), nav_string_length_disable(), reader_id3_getver(), reader_id3_strtoul(), reader_id3_v2_duration(), St_id3ver::ver1, and St_id3ver::ver10.
Return genre from ID3 of current file selected.
References file_close(), reader_id3_getver(), reader_id3_v1_genre(), reader_id3_v2_genre(), St_id3ver::ver1, and St_id3ver::ver10.
|
static |
Private routines for all ID3 versions.
Open the file and return major version of ID3.
References file_close(), file_getc(), file_open(), file_seek(), FOPEN_MODE_R, FS_SEEK_END, St_id3ver::ver1, St_id3ver::ver10, St_id3ver::ver100, and version.
Referenced by reader_id3_album(), reader_id3_artist(), reader_id3_duration(), reader_id3_genre(), reader_id3_picture(), reader_id3_title(), reader_id3_track(), reader_id3_version(), and reader_id3_year().
bool reader_id3_picture | ( | FS_STRING | mime_type, |
uint8_t | u8_size_max, | ||
uint8_t * | picture_type, | ||
uint32_t * | offset | ||
) |
Return embedded image mime type, image type and offset into the file.
References file_close(), reader_id3_getver(), reader_id3_v2_picture(), and St_id3ver::ver1.
Referenced by ai_usb_ms_support_info_image().
|
static |
Read an ASCII string in an ID3 field.
References Is_unicode, reader_txt_get_line(), and reader_txt_select_format().
Referenced by reader_id3_v1_string(), reader_id3_v2_picture(), and reader_id3_v2_string().
St_id3size reader_id3_size | ( | void | ) |
Return ID3 size from ID3 of current file selected.
References St_id3size::appended_tag, file_close(), file_getc(), file_open(), file_seek(), FOPEN_MODE_R, FS_SEEK_CUR_FW, FS_SEEK_END, and St_id3size::prepended_tag.
Referenced by play_mp3().
|
static |
Converts a string to an unsigned long.
References Is_unicode.
Referenced by reader_id3_duration(), reader_id3_track(), and reader_id3_year().
Return title from ID3 of current file selected.
References file_close(), reader_id3_getver(), reader_id3_v1_title(), reader_id3_v2_title(), St_id3ver::ver1, and St_id3ver::ver10.
uint32_t reader_id3_track | ( | void | ) |
Return track from ID3 of current file selected.
References file_close(), Is_unicode, nav_string_length_disable(), reader_id3_getver(), reader_id3_strtoul(), reader_id3_v1_track(), reader_id3_v2_track(), St_id3ver::ver1, and St_id3ver::ver10.
Return genre from ID3 V1.
References file_getc(), file_seek(), FS_SEEK_END, g_b_string_length, and tab_genre_id3_v1.
Referenced by reader_id3_genre().
|
static |
Return a string from ID3 V1.
References file_seek(), FS_SEEK_END, g_b_string_length, Is_unicode, and reader_id3_read_string().
Referenced by reader_id3_v1_album(), reader_id3_v1_artist(), reader_id3_v1_title(), and reader_id3_v1_year().
functions version 1
Return title from ID3 V1.
References reader_id3_v1_string().
Referenced by reader_id3_title().
Return a track from ID3 V1.
References file_getc(), file_seek(), FS_SEEK_END, and g_b_string_length.
Referenced by reader_id3_track().
Return album from ID3 V2.
References reader_id3_v2_string(), and St_id3ver::ver10.
Referenced by reader_id3_album().
Return artist from ID3 V2.
References reader_id3_v2_string(), and St_id3ver::ver10.
Referenced by reader_id3_artist().
|
static |
Return duration from ID3 V2.
References reader_id3_v2_string(), and St_id3ver::ver10.
Referenced by reader_id3_duration().
|
static |
Get informations of ID3 version 2.
References file_getc(), file_seek(), FS_SEEK_CUR_FW, FS_SEEK_SET, MSB0, MSB1, MSB2, MSB3, and St_id3ver::ver10.
Referenced by reader_id3_v2_picture(), and reader_id3_v2_string().
Return genre from ID3 V2.
References reader_id3_v2_string(), and St_id3ver::ver10.
Referenced by reader_id3_genre().
|
static |
Get attached picture from ID3 V2.
References file_getc(), file_getpos(), g_b_string_length, Is_unicode, reader_id3_read_string(), reader_id3_v2_findtag(), and St_id3ver::ver10.
Referenced by reader_id3_picture().
|
static |
Return a string corresponding at TAG V2.
References file_getc(), g_b_string_length, Is_unicode, reader_id3_read_string(), and reader_id3_v2_findtag().
Referenced by reader_id3_v2_album(), reader_id3_v2_artist(), reader_id3_v2_duration(), reader_id3_v2_genre(), reader_id3_v2_title(), reader_id3_v2_track(), and reader_id3_v2_year().
functions version 2
Return title from ID3 V2.
References reader_id3_v2_string(), and St_id3ver::ver10.
Referenced by reader_id3_title().
Return track from ID3 V2.
References reader_id3_v2_string(), and St_id3ver::ver10.
Referenced by reader_id3_track().
Return year from ID3 V2.
References reader_id3_v2_string(), and St_id3ver::ver10.
Referenced by reader_id3_year().
St_id3ver reader_id3_version | ( | void | ) |
Return ID3 version from ID3 of current file selected.
References file_close(), reader_id3_getver(), St_id3ver::ver1, and St_id3ver::ver10.
Referenced by ai_usb_ms_mp3_support_get_metadata_version().
uint16_t reader_id3_year | ( | void | ) |
Return year from ID3 of current file selected.
References file_close(), nav_string_length_disable(), reader_id3_getver(), reader_id3_strtoul(), reader_id3_v1_year(), reader_id3_v2_year(), St_id3ver::ver1, and St_id3ver::ver10.
|
static |
Referenced by reader_id3_v1_genre().