#include "mod_musicindex.h"
#include "cache.h"
#include "inf.h"
#include <mad.h>
#include <stdio.h>
#include <sys/stat.h>
#include <ctype.h>
#include <vorbis/codec.h>
#include <vorbis/vorbisfile.h>
#include <id3tag.h>
Go to the source code of this file.
Defines | |
#define | INPUT_BUFFER_SIZE 8192 |
Input buffer size used by libmad subsystem. | |
#define | GENRE_MAX 0x94 |
Max number of digit coded genres. | |
Functions | |
mu_ent * | make_ogg_entry (apr_pool_t *pool, mu_ent *head, FILE *in, mu_config *conf, mu_ent_names *names, request_rec *r) |
Fills in the information fields about OGG data. | |
mu_ent * | make_mp3_entry (apr_pool_t *pool, mu_ent *head, FILE *in, mu_config *conf, mu_ent_names *names, request_rec *r) |
Fills in the information fields about MP3 data. | |
mu_ent * | make_music_entry (apr_pool_t *pool, request_rec *r, mu_ent *head, mu_config *conf, mu_ent_names *names) |
Add a file (and the content of the directory if requested) to the chain. | |
short | musicindex_directory (request_rec *r, mu_config *conf) |
Generates and sends a webpage listing the music files in the directory. | |
short | playlist_directory (request_rec *r, mu_config *conf) |
Creates and sends a playlist with the content of a directory. | |
short | playlist_selected (request_rec *r, mu_config *conf) |
Generates and sends a playlist with only selected items. | |
mu_ent * | new_ent (apr_pool_t *pool, mu_ent *head) |
Creates a new musical entry (mp3, ogg or directory). |
|
Max number of digit coded genres.
Definition at line 35 of file playlist.h. Referenced by make_mp3_entry(). |
|
Input buffer size used by libmad subsystem.
Definition at line 34 of file playlist.h. Referenced by make_mp3_entry(). |
|
Fills in the information fields about MP3 data. This function reads the id3 tags (using libid3tag0) from the MP3 file and fills in the struct mu_ent fields accordingly.
Definition at line 273 of file playlist.c. References mu_ent::album, mu_ent::artist, mu_ent::bitrate, mu_ent::date, mu_ent_names::filename, mu_ent::filetype, FT_MP3, mu_ent::genre, GENRE_MAX, INPUT_BUFFER_SIZE, mu_ent::length, MI_QUICKPL, mpg123_id3_genres, mpg123_mp3_ext_check(), new_ent(), mu_config::options, mu_ent::posn, mu_ent::size, mu_ent::title, mu_ent::track, and utf8_id3tag_findframe(). Referenced by make_music_entry(). |
|
Add a file (and the content of the directory if requested) to the chain. This function creates a new entry from a file. If the file is a directory and the recursive option is set, all its content is also added. If the file is an ogg vorbis or an mp3, it is simply added.
Definition at line 450 of file playlist.c. References mu_ent::album, mu_ent::artist, CA_CREATE, cache_check_dir(), cache_check_file(), mu_config::cache_path, cache_read_file(), cache_write_file(), mu_ent::file, mu_ent_names::filename, mu_ent::filetype, FT_DIR, make_mp3_entry(), make_ogg_entry(), MAX_STRING, MI_PLAYLIST, MI_RECURSIVE, MI_SEARCH, mu_cache_data::name, new_ent(), mu_config::options, mu_config::play_recursive, mu_config::search, mu_ent::title, mu_ent::uri, and mu_ent_names::uri. Referenced by musicindex_directory(), playlist_directory(), and playlist_selected(). |
|
Fills in the information fields about OGG data. This function reads the ogg tags (using libvorbisfile) from the ogg file and fills in the struct mu_ent fields accordingly. If the file is not an ogg one, the function returns p = head.
Definition at line 211 of file playlist.c. References mu_ent::album, mu_ent::artist, mu_ent::bitrate, mu_ent::date, mu_ent::filetype, FT_OGG, mu_ent::genre, mu_ent::length, MI_QUICKPL, new_ent(), mu_config::options, mu_ent::posn, mu_ent::title, and mu_ent::track. Referenced by make_music_entry(). |
|
Generates and sends a webpage listing the music files in the directory.
Definition at line 592 of file playlist.c. References make_music_entry(), MI_SEARCH, mu_config::options, quicksort(), send_directories(), send_foot(), send_head(), and send_tracks(). Referenced by handle_musicindex(). |
|
Creates a new musical entry (mp3, ogg or directory).
Definition at line 46 of file playlist.c. References mu_ent::next. Referenced by cache_read_file(), make_mp3_entry(), make_music_entry(), and make_ogg_entry(). |
|
Creates and sends a playlist with the content of a directory. This function generates a playlist containing all the files in the current directory, either recursively or not.
Definition at line 643 of file playlist.c. References make_music_entry(), MI_PLAYLIST, mu_config::options, quicksort(), and send_playlist(). Referenced by handle_musicindex(). |
|
Generates and sends a playlist with only selected items. This function parses the requests, which is the form : http://...../?file=file1&file=file2&file=file3... Note that in FORM requests, arguments have ' ' replaced by '+', other "special" characters are changed to their URI equivalent. Here is the trick : ap_unescape_url doesn't change the '+' to its URI equivalent. So we first change ' ' to '+' and then call the apache function. Easy, isn't it ?
Definition at line 691 of file playlist.c. References mu_ent_names::filename, make_music_entry(), MAX_STRING, quicksort(), send_playlist(), and mu_ent_names::uri. Referenced by handle_musicindex(). |