minimal playlist operating implemented
[melted_gui] / src / playlist.h
index fe9e22b..7d0910b 100644 (file)
@@ -27,11 +27,193 @@ 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);
+/** @} */
 
 #if 0
 void omnplay_playlist_load(omnplay_instance_t* app);