enjoy/src/bin/private.h

87 lines
2.4 KiB
C
Raw Normal View History

add basic enjoy code to svn. WARNING: there is not much to see here yet! I'm just adding to svn as people seems interested in help, and it is impossible to help without the base code. IF YOU DON'T WANT TO HELP WITH CODE, DON'T EVEN BOTHER COMPILING IT YET! Enjoy is (will be) a music player fully based on Enlightenment Foundation Libraries (EFL), the goal is to have a simple yet useful music player that works on desktop and mobiles with the minimum set of dependencies and maximum efficiency. It is based on LightMediaScanner (my code[1]) to scan directories for music and create a database and does so in a very and safe efficient way by having a scanner process with lower nice priority. It is also smart enough to hint to your kernel you'll not need the scanned files anymore (posix_fadvise()) and thus it will not pollute your RAM with useless file system cache. So far it is not creating the database on its own, neither have a a library manager to add/remove directories. In order to run Enjoy you must first create your own database using "test" program from lightmediascanner sources: {{{ cd lightmediascanner ./configure && make && make install mkdir -p $HOME/.config/enjoy/media.db ./src/bin/test -i 5000 -p id3 -s $HOME/Music $HOME/.config/enjoy/media.db }}} The GUI is pretty much ugly and needs huge work. It is almost fully done in Edje, so C part is quite lean, however I did no Edje work yet, just the basics to show something (uses r | g | b rectangles for actions, you have to guess what's what ;-)) = HOW TO HELP = Read TODO file. If you're more like a coder: * src/bin/db.c follow the propsed stubs and db_songs_get() example; * src/bin/page.c add recursive paging with "folder" pages; * src/bin/win.c start/stop ecore_thread with lms_process() + lms_check(); * src/bin/win.c write library manager: rescan collection (thread as above item), add directories, remove directories. If you're more like an edje guy: * data/themes: follow eve's style, focus on the bottom toolbar, then the list items, then the page/songs. Use dummy icons (copy from eve or efenniht), we'll provide proper icons soon * add nowplaying screen * add volume using dragable (copy from efenniht's slider) [1] download code from http://git.profusion.mobi/cgit.cgi/lightmediascanner.git/ or http://lms.garage.maemo.org/ SVN revision: 52658
2010-09-23 18:37:54 -07:00
#ifndef ENJOY_PRIVATE_H
#define ENJOY_PRIVATE_H
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <Elementary.h>
#include <limits.h>
#define stringify(X) #X
typedef struct _App App;
typedef struct _Song Song;
typedef struct _DB DB;
extern int _log_domain;
#define CRITICAL(...) EINA_LOG_DOM_CRIT(_log_domain, __VA_ARGS__)
#define ERR(...) EINA_LOG_DOM_ERR(_log_domain, __VA_ARGS__)
#define WRN(...) EINA_LOG_DOM_WARN(_log_domain, __VA_ARGS__)
#define INF(...) EINA_LOG_DOM_INFO(_log_domain, __VA_ARGS__)
#define DBG(...) EINA_LOG_DOM_DBG(_log_domain, __VA_ARGS__)
struct _App
{
Eina_List *add_dirs;
Eina_List *del_dirs;
char configdir[PATH_MAX];
Evas_Object *win;
};
Evas_Object *win_new(App *app);
Evas_Object *list_add(Evas_Object *parent);
Eina_Bool list_populate(Evas_Object *list, DB *db);
Song *list_selected_get(const Evas_Object *list);
Eina_Bool list_next_exists(const Evas_Object *list);
Song *list_next_go(Evas_Object *list);
Eina_Bool list_prev_exists(const Evas_Object *list);
Song *list_prev_go(Evas_Object *list);
Evas_Object *page_songs_add(Evas_Object *parent, Eina_Iterator *it, const char *title);
Song *page_songs_selected_get(const Evas_Object *obj);
Eina_Bool page_songs_next_exists(const Evas_Object *obj);
Song *page_songs_next_go(Evas_Object *obj);
Eina_Bool page_songs_prev_exists(const Evas_Object *obj);
Song *page_songs_prev_go(Evas_Object *obj);
DB *db_open(const char *path);
Eina_Bool db_close(DB *db);
struct _Song
{
const char *path;
const char *title;
const char *album;
const char *artist;
const char *genre;
int64_t id;
int64_t album_id;
int64_t artist_id;
int64_t genre_id;
int size; /* file size in bytes */
int trackno;
int rating;
int playcnt;
int length;
struct {
unsigned int path;
unsigned int title;
unsigned int album;
unsigned int artist;
unsigned int genre;
} len; /* strlen of string fields */
};
Eina_Iterator *db_songs_get(DB *db); /* walks over 'const Song*' */
Song *db_song_copy(const Song *orig);
void db_song_free(Song *song);
Eina_Bool db_song_rating_set(DB *db, Song *song, int rating);
Eina_Bool db_song_length_set(DB *db, Song *song, int length);
#endif