mod_musicindex
1.4.1
|
HTML (and assimilated) code generation. More...
Go to the source code of this file.
Functions | |
static unsigned short | list_songs (request_rec *r, const mu_pack *const pack, const int customlist) |
Formats the list of songs to be sent. | |
static void | send_url (request_rec *r, const char *const restrict uri, const char *const restrict command, const short html) |
Formats a complete url string to be sent to client. | |
void | send_head (request_rec *r) |
Sends HTML page headers and top of the page. | |
void | send_directories (request_rec *r, const mu_pack *const pack) |
Sends directory listing for the current folder. | |
void | send_tracks (request_rec *r, const mu_pack *const pack) |
Sends track listing for the current folder. | |
void | send_customlist (request_rec *r, const mu_pack *const pack) |
Sends track listing for the current custom playlist. | |
void | send_playlist (request_rec *r, const mu_pack *const pack) |
Sends playlist with url and EXTM3U info to the client. | |
void | send_rss (request_rec *r, const mu_pack *const pack) |
Sends RSS feed. | |
void | send_randomdir (request_rec *r) |
Sends a random directory location. | |
void | send_foot (request_rec *r, const STRUCTTV *tvbegin, const STRUCTTV *tvprocess) |
Sends HTML page footers. |
Variables | |
static const char const | Gfavicon [] = "sound.png" |
static const char const | Gcd_icon [] = "general.png" |
static const char const | Gorigcss [] = "musicindex.css" |
static const char *const | Gcovericns [] |
Cover icon names to look for in a directory. |
HTML (and assimilated) code generation.
That file groups all functions related to HTML and assimilated generation, that is to say functions that are used to send data to the client. It is mainly (X)HTML, but also playlist (in M3U format) and RSS.
still some work on the custom table
Replace text with eye-candy icons wherever possible
reduce the size of this file & optimize functions
Fix search box collide on long path names
Definition in file html.c.
|
static |
Formats the list of songs to be sent.
This function formats a list of tracks (if any) to be sent to the client, as found in the pack passed in argument. Depending on config options, it allows streaming/shuffle etc.
Sort option for recursive search?
Keep sort conf on userside (using cookie(s)).
We have the basis of doing per file permissions in the Select panel stuff which also needs to be rewritten and simplified
r | Apache request_rec struct to handle connection details. |
pack | pack of songs to display. |
customlist | Whether the list of entries p is a custom list or not |
Definition at line 93 of file html.c.
References _, mu_ent::album, apr_base64_encode, apr_base64_encode_len, mu_ent::artist, mu_ent::bitrate, mu_ent::date, EF_ALLOWDWNLD, EF_ALLOWSTREAM, EF_ALLOWTARBALL, EF_VBR, mu_pack::fhead, mu_config::fields, mu_ent::file, mu_ent::filename, filetype, mu_ent::filetype, mu_ent::flags, mu_ent::freq, mu_pack::fsize, FT_MAX, mu_ent::genre, mu_ent::length, MI_ALLOWDWNLD, MI_ALLOWSTREAM, MI_ALLOWTARBALL, MI_QUICKPL, MI_RECURSIVE, musicindex_module, ftype::nametype, mu_ent::next, mu_config::options, mu_ent::posn, SB_ALBUM, SB_ARTIST, SB_BITRATE, SB_DATE, SB_FILENAME, SB_FILETYPE, SB_FREQ, SB_GENRE, SB_LENGTH, SB_POSN, SB_SIZE, SB_TITLE, SB_TRACK, mu_config::search, mu_ent::size, mu_ent::title, mu_ent::track, and mu_ent::uri.
Referenced by send_customlist(), and send_tracks().
void send_customlist | ( | request_rec * | r, |
const mu_pack *const | pack | ||
) |
Sends track listing for the current custom playlist.
This function takes care of preparing and sending to the client the list (if any) of the available songs in the current custom pack list, retrieved from a cookie. Depending on config options, it allows streaming/shuffle etc.
r | Apache request_rec struct to handle connection details. |
pack | A pack of music entries. |
Definition at line 873 of file html.c.
References _, mu_pack::fhead, mu_pack::filenb, and list_songs().
Referenced by handle_musicindex().
void send_directories | ( | request_rec * | r, |
const mu_pack *const | pack | ||
) |
Sends directory listing for the current folder.
This function takes care of preparing and sending to the client the list (if any) of the available directories in the current folder. Depending on config options, it allows streaming/shuffle etc.
r | Apache request_rec struct to handle connection details. |
pack | A pack of music entries. |
Definition at line 713 of file html.c.
References _, mu_config::dir_per_line, mu_pack::dirnb, EF_ALLOWRSS, EF_ALLOWSTREAM, EF_ALLOWTARBALL, mu_ent::file, mu_ent::filetype, mu_ent::flags, mu_pack::head, musicindex_module, mu_ent::next, and mu_ent::title.
Referenced by handle_musicindex().
Sends HTML page footers.
This function takes care of the formating of the HTML page footers. It sends the data that is common to all pages generated by the handler.
r | Apache request_rec struct to handle connection details. |
tvbegin | when available, a timeval struct containing timing info for the beginning of the page generation. |
tvprocess | when available a timeval struct containing end of processing time |
< Version string
< Version string
Definition at line 1143 of file html.c.
References _, ap_sub_req_lookup_uri, apr_pstrcat, mu_config::directory, MUSIC_AUTHORS_STRING, MUSIC_VERSION_STRING, and musicindex_module.
Referenced by handle_musicindex().
void send_head | ( | request_rec * | r | ) |
Sends HTML page headers and top of the page.
This function takes care of the formating of the HTML page headers. It sends the data that is common to all pages generated by the handler.
r | Apache request_rec struct to handle connection details. |
Definition at line 482 of file html.c.
References _, ap_sub_req_lookup_uri, apr_pstrcat, apr_pstrdup, mu_config::css, mu_config::directory, Gcd_icon, Gcovericns, Gfavicon, Gorigcss, MI_ACTIVE, MI_ALLOWSEARCH, MI_ALLOWSTREAM, MI_ALLOWTARBALL, MUSIC_HEADER_STRING, musicindex_module, mu_config::options, mu_config::rss_items, and mu_config::title.
Referenced by handle_musicindex().
void send_playlist | ( | request_rec * | r, |
const mu_pack *const | pack | ||
) |
Sends playlist with url and EXTM3U info to the client.
This function prepares an m3u playlist (with extra information where available: length, artist, title, album) and sends it to the client.
r | Apache request_rec struct to handle connection details. |
pack | A pack of music entries. |
Definition at line 918 of file html.c.
References mu_ent::album, mu_ent::artist, EF_ALLOWSTREAM, mu_pack::fhead, mu_ent::flags, mu_ent::length, mu_ent::next, send_url(), mu_ent::title, and mu_ent::uri.
Referenced by handle_musicfile(), and handle_musicindex().
void send_randomdir | ( | request_rec * | r | ) |
Sends a random directory location.
This function constructs a new URL relative to the current directory, corresponding to a random subdirectory. It might stop at an arbitrary sublevel, even at the current dir.
XXX A better (or at least different) implementation would only accounts for actual folders, and setup a random threshold level at which the function stops recursing.
r | Apache request_rec struct to handle connection details. |
Definition at line 1067 of file html.c.
References ap_is_directory, apr_pstrcat, apr_pstrdup, and apr_table_setn.
Referenced by handle_musicindex().
void send_rss | ( | request_rec * | r, |
const mu_pack *const | pack | ||
) |
Sends RSS feed.
see http://blogs.law.harvard.edu/tech/rss and http://feedvalidator.org/docs/rss2.html
r | Apache request_rec struct to handle connection details. |
pack | A pack of music entries. |
Definition at line 953 of file html.c.
References _, EF_VBR, mu_pack::fhead, filetype, FT_MAX, MI_ALLOWDWNLD, MI_ALLOWSTREAM, MI_PODCAST, ftype::mimetype, MUSIC_HEADER_STRING, musicindex_module, ftype::nametype, mu_ent::next, mu_config::options, mu_config::rss_items, and send_url().
Referenced by handle_musicindex().
void send_tracks | ( | request_rec * | r, |
const mu_pack *const | pack | ||
) |
Sends track listing for the current folder.
This function takes care of preparing and sending to the client the list (if any) of the available songs in the current pack list. Depending on config options, it allows streaming/shuffle etc.
r | Apache request_rec struct to handle connection details. |
pack | A pack of music entries. |
Definition at line 794 of file html.c.
References _, mu_pack::filenb, list_songs(), MI_ALLOWSTREAM, MI_ALLOWTARBALL, musicindex_module, mu_config::options, mu_config::order, SB_MAX, and mu_config::search.
Referenced by handle_musicindex().
|
static |
Formats a complete url string to be sent to client.
This function does all the URL formatting, in the form: http://[user:][passwd@]hostname[:port]/uri/
If the admin sets a conf->iceserver too big (>MAX_PREFIX) the ices url will be truncated. If hostname+auth+etc is too long this function aborts... There's no user-modifiable data here, we assume admins know what they're doing.
It appears this function cannot deal with IPv6 numeric URLs for now. -> fixed with AP24
r | Apache request_rec struct to handle connection details. |
uri | A string (basically a path) to be sent to form a complete url. |
command | An eventual command (like ?action=playall). |
html | 1 ? html output : normally escaped URL output. |
Definition at line 388 of file html.c.
References apr_base64_decode, apr_base64_decode_len, apr_table_get, mu_config::iceserver, MAX_PREFIX, mi_rerror, MI_RSS, musicindex_module, mu_config::options, REQUEST_USER, and unlikely.
Referenced by send_playlist(), and send_rss().
|
static |
Definition at line 61 of file html.c.
Referenced by send_head().
|
static |
Cover icon names to look for in a directory.
Definition at line 64 of file html.c.
Referenced by send_head().
|
static |
Definition at line 60 of file html.c.
Referenced by send_head().
|
static |
Definition at line 62 of file html.c.
Referenced by send_head().