X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fplaylist.h;h=1ed329e3b41a98db35d093c44957c7b0f912e095;hb=HEAD;hp=fe9e22b8e1d3cfad194c4633a96505589dd75891;hpb=48dee11ecb5cc6c4006f8dcc47ca4c7cf57b8b0e;p=melted_gui diff --git a/src/playlist.h b/src/playlist.h index fe9e22b..1ed329e 100644 --- a/src/playlist.h +++ b/src/playlist.h @@ -27,20 +27,241 @@ extern "C" { #endif /* __cplusplus */ -/* - find local playlist index by given start search position value and remote playlist item index - used to associate remote item with local + +void playlist_init(instance_t* app); +void playlist_release(instance_t* app); + + +/** + * @anchor playlist_idx_cued + * + * function check if given index is in the any player usage + * + * @param[in] app application instance handle + * @param[in] idx index of playlist item + * @param[out] player_idx index of player where item used + * + * @return 1 for success and set player_idx to proper value and zero + * if item is not used in any player + * + * @{ + */ +int playlist_idx_cued(instance_t* app, int idx, int* player_idx); +/** @} */ + +/** + * @anchor playlist_range_cued + * + * function check if given range is in the any player usage + * + * @param[in] app application instance handle + * @param[in] start index of first playlist item + * @param[in] stop index of last playlist item + * + * @return 1 for success and zero if range is not used in any player + * + * @note idxs_in_players_range + * @{ + */ +int playlist_range_cued(instance_t* app, int start, int stop); +/** @} */ + + +/** + * @anchor playlist_insert_check + * + * function check if possible to insert into the current playlist position + * + * @param[in] app application instance handle + * @param[in] idx index of playlist to insert + * @param[out] t playlist type will be associated with insert position + * + * @return 1 for success and zero otherwise + * + * @{ + */ +int playlist_insert_check(instance_t* app, int idx, playlist_item_type_t* t); +/** @} */ + + +/** + * @anchor playlist_insert_items + * + * function check if possible to insert into the current playlist position + * + * @param[in] app application instance handle + * @param[in] idx index of playlist to insert + * @param[in] items list of playlist items + * @param[in] count number of items in the list of playlist + * + * @{ + */ +void playlist_insert_items(instance_t* app, int idx, playlist_item_t* items, int count); +/** @} */ + +/** + * @anchor playlist_get_selected_items_idx + * + * function tries to get list of indexes of selected items + * + * @param[in] app application instance handle + * @param[out] count number of items in list + * + * @return NULL if no items selected otherwise return pointer + * to the list of array of integers with items indexes selected + * and set count variable to the number of items in list + * + * @{ + */ +int* playlist_get_selected_items_idx(instance_t* app, int *count); +/** @} */ + +/** + * @anchor playlist_get_block + * + * function tries to find block range that include given playlist index + * + * @param[in] app application instance handle + * @param[in] idx playlist item index + * @param[out] pstart pointer where index of first item of block will be stored + * @param[out] pstart pointer where index of last item of block will be stored + * + * @return -1 if no range found, otherwise number of items in a block + * + * @{ + */ +int playlist_get_block(instance_t* app, int idx, int* pstart, int* pstop); +/** @} */ + + +/** + * @anchor playlist_get_player_at_pos + * + * function find a player associated with playlist item + * + * @param[in] app application instance handle + * @param[in] idx playlist item index + * + * @return NULL if item not assiciated with player, otherwise player struct + * + * @{ + */ +player_t *playlist_get_player_at_pos(instance_t* app, int pos); +/** @} */ + +/** + * @anchor playlist_get_first_selected_item_idx + * + * function tries to get index of first selected item + * + * @param[in] app application instance handle + * + * @return -1 if no items selected otherwise return index of + * selected item + * + * @{ + */ +int playlist_get_first_selected_item_idx(instance_t* app); +/** @} */ + + +/** + * @anchor playlist_delete_items + * + * function delete list of items + * + * @param[in] app application instance handle + * @param[in] idxs list of indexes to delete + * @param[in] count number of indexes in the list + * @param[in] sel flag used to change playlist selection + * on first item after delete operation + * + * @{ + */ +void playlist_delete_items(instance_t* app, int* idxs, int count, int sel); +/** @} */ + +/** + * @anchor playlist_delete_selected_items + * + * function delete selected items + * + * @param[in] app application instance handle + * + * @{ + */ +void playlist_delete_selected_items(instance_t* app); +/** @} */ + +/** + * @anchor playlist_item_index + * + * @{ */ int playlist_item_index(instance_t* app, int start, int idx); +/** @} */ + + +/** + * @anchor playlist_block + * + * function change block type of events + * + * @param[in] app application instance handle + * @param[in] loop flag indicating that loop type will be used + * + * @{ + */ +void playlist_block(instance_t* app, int loop); +/** @} */ + + +/** + * @anchor playlist_item_copy + * + * function copy selected items from playlist into the clipboard + * + * @param[in] app application instance handle + * + * @{ + */ +void playlist_item_copy(instance_t* app); +/** @} */ + + +/** + * @anchor playlist_item_paste + * + * function insert items from clipboard to playlist + * + * @param[in] app application instance handle + * @param[in] after flag indicating that insertion is after selected + * + * @{ + */ +void playlist_item_paste(instance_t* app, int after); +/** @} */ + + +/** + * @anchor playlist_item_swap + * + * swap first selected item with next or previous item + * + * @param[in] app application instance handle + * @param[in] dir swap direction + * + * @{ + */ +void playlist_item_swap(instance_t* app, int dir); +/** @} */ -#if 0 -void omnplay_playlist_load(omnplay_instance_t* app); -void omnplay_playlist_save(omnplay_instance_t* app); -void omnplay_playlist_relink(omnplay_instance_t* app); -void omnplay_playlist_draw(omnplay_instance_t* app); -void omnplay_playlist_draw_item(omnplay_instance_t* app, int idx); -void omnplay_playlist_draw_item_rem(omnplay_instance_t* app, int idx, char* rem); -#endif +void playlist_save(instance_t* app); +void playlist_load(instance_t* app); +void playlist_item_edit(instance_t* app); +void playlist_item_add(instance_t* app, int after); +void playlist_relink(instance_t* app); +void playlist_item_add_from_library(instance_t* app, int after); #ifdef __cplusplus };