X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=afs.h;h=4d3feb4840ec21f4d315c0a2fce9926377e6d9e9;hp=57cecebdf648920dcf14c981a3f437632ebdf654;hb=1e8a6c4a550a6d9cf7c1f0ae691cd3219e94d55a;hpb=c2ac39f76d245816a919d94790672fb66e9a7253 diff --git a/afs.h b/afs.h index 57cecebd..4d3feb48 100644 --- a/afs.h +++ b/afs.h @@ -35,12 +35,9 @@ enum afs_events { AUDIO_FILE_RENAME, AUDIO_FILE_ADD, AUDIO_FILE_REMOVE, - LYRICS_ADD, - LYRICS_REMOVE, - LYRICS_RENAME, - IMAGE_ADD, - IMAGE_REMOVE, - IMAGE_RENAME, + BLOB_ADD, + BLOB_RENAME, + BLOB_REMOVE, }; @@ -60,19 +57,6 @@ struct afsi_change_event_data { struct afs_info *old_afsi; }; -union afs_event_data { - struct { - const char *name; - unsigned char bitnum; - } rmatt_event_data; - struct osl_row *row; - struct { - const struct osl_row *row; - struct afs_info *old_afsi; - } afsi_change; - -}; - struct afs_table { void (*init)(struct afs_table *t); const char *name; @@ -88,11 +72,16 @@ enum play_mode {PLAY_MODE_MOOD, PLAY_MODE_PLAYLIST}; struct audio_file_data { enum play_mode current_play_mode; + int fd; long score; struct afs_info afsi; struct audio_format_info afhi; char *path; - struct osl_object map; +}; + +enum afs_server_code { + NEXT_AUDIO_FILE, + AFD_CHANGE }; /** Flags passed to for_each_matching_row(). */ @@ -140,7 +129,6 @@ int send_option_arg_callback_request(struct osl_object *options, int stdin_command(int fd, struct osl_object *arg_obj, callback_function *f, unsigned max_len, struct osl_object *result); int string_compare(const struct osl_object *obj1, const struct osl_object *obj2); -int open_next_audio_file(struct audio_file_data *afd); int close_audio_file(struct audio_file_data *afd); int for_each_matching_row(struct pattern_match_data *pmd); @@ -154,6 +142,7 @@ int score_add(const struct osl_row *row, long score); int score_update(const struct osl_row *aft_row, long new_score); int get_num_admissible_files(unsigned *num); int score_delete(const struct osl_row *aft_row); +int clear_score_table(void); int row_belongs_to_score_table(const struct osl_row *aft_row, unsigned *rank); /* attribute */ @@ -166,6 +155,7 @@ int get_attribute_text(uint64_t *atts, const char *delim, char **text); void aft_init(struct afs_table *t); int aft_get_row_of_path(const char *path, struct osl_row **row); int open_and_update_audio_file(struct osl_row *aft_row, struct audio_file_data *afd); +int load_afd(int shmid, struct audio_file_data *afd); int load_afsi(struct afs_info *afsi, struct osl_object *obj); void save_afsi(struct afs_info *afsi, struct osl_object *obj); int get_afsi_of_row(const struct osl_row *row, struct afs_info *afsi); @@ -178,6 +168,7 @@ int aft_check_callback(const struct osl_object *query, struct osl_object *result /* mood */ int change_current_mood(char *mood_name); +void close_current_mood(void); int reload_current_mood(void); int mood_check_callback(__a_unused const struct osl_object *query, struct osl_object *result); @@ -185,6 +176,7 @@ int mood_check_callback(__a_unused const struct osl_object *query, /* playlist */ int playlist_open(char *name); +void playlist_close(void); int playlist_update_audio_file(struct osl_row *aft_row); int playlist_check_callback(__a_unused const struct osl_object *query, struct osl_object *result);