2 * playlist.h -- GTK+ 2 melted gui
3 * Copyright (C) 2012 Maksym Veremeyenko <verem@m1stereo.tv>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software Foundation,
17 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
28 #endif /* __cplusplus */
31 void playlist_init(instance_t
* app
);
32 void playlist_release(instance_t
* app
);
36 * @anchor playlist_idx_cued
38 * function check if given index is in the any player usage
40 * @param[in] app application instance handle
41 * @param[in] idx index of playlist item
42 * @param[out] player_idx index of player where item used
44 * @return 1 for success and set player_idx to proper value and zero
45 * if item is not used in any player
49 int playlist_idx_cued(instance_t
* app
, int idx
, int* player_idx
);
53 * @anchor playlist_range_cued
55 * function check if given range is in the any player usage
57 * @param[in] app application instance handle
58 * @param[in] start index of first playlist item
59 * @param[in] stop index of last playlist item
61 * @return 1 for success and zero if range is not used in any player
63 * @note idxs_in_players_range
66 int playlist_range_cued(instance_t
* app
, int start
, int stop
);
71 * @anchor playlist_insert_check
73 * function check if possible to insert into the current playlist position
75 * @param[in] app application instance handle
76 * @param[in] idx index of playlist to insert
77 * @param[out] t playlist type will be associated with insert position
79 * @return 1 for success and zero otherwise
83 int playlist_insert_check(instance_t
* app
, int idx
, playlist_item_type_t
* t
);
88 * @anchor playlist_insert_items
90 * function check if possible to insert into the current playlist position
92 * @param[in] app application instance handle
93 * @param[in] idx index of playlist to insert
94 * @param[in] items list of playlist items
95 * @param[in] count number of items in the list of playlist
99 void playlist_insert_items(instance_t
* app
, int idx
, playlist_item_t
* items
, int count
);
103 * @anchor playlist_get_selected_items_idx
105 * function tries to get list of indexes of selected items
107 * @param[in] app application instance handle
108 * @param[out] count number of items in list
110 * @return NULL if no items selected otherwise return pointer
111 * to the list of array of integers with items indexes selected
112 * and set count variable to the number of items in list
116 int* playlist_get_selected_items_idx(instance_t
* app
, int *count
);
120 * @anchor playlist_get_block
122 * function tries to find block range that include given playlist index
124 * @param[in] app application instance handle
125 * @param[in] idx playlist item index
126 * @param[out] pstart pointer where index of first item of block will be stored
127 * @param[out] pstart pointer where index of last item of block will be stored
129 * @return -1 if no range found, otherwise number of items in a block
133 int playlist_get_block(instance_t
* app
, int idx
, int* pstart
, int* pstop
);
138 * @anchor playlist_get_player_at_pos
140 * function find a player associated with playlist item
142 * @param[in] app application instance handle
143 * @param[in] idx playlist item index
145 * @return NULL if item not assiciated with player, otherwise player struct
149 player_t
*playlist_get_player_at_pos(instance_t
* app
, int pos
);
153 * @anchor playlist_get_first_selected_item_idx
155 * function tries to get index of first selected item
157 * @param[in] app application instance handle
159 * @return -1 if no items selected otherwise return index of
164 int playlist_get_first_selected_item_idx(instance_t
* app
);
169 * @anchor playlist_delete_items
171 * function delete list of items
173 * @param[in] app application instance handle
174 * @param[in] idxs list of indexes to delete
175 * @param[in] count number of indexes in the list
176 * @param[in] sel flag used to change playlist selection
177 * on first item after delete operation
181 void playlist_delete_items(instance_t
* app
, int* idxs
, int count
, int sel
);
185 * @anchor playlist_delete_selected_items
187 * function delete selected items
189 * @param[in] app application instance handle
193 void playlist_delete_selected_items(instance_t
* app
);
197 * @anchor playlist_item_index
201 int playlist_item_index(instance_t
* app
, int start
, int idx
);
206 * @anchor playlist_block
208 * function change block type of events
210 * @param[in] app application instance handle
211 * @param[in] loop flag indicating that loop type will be used
215 void playlist_block(instance_t
* app
, int loop
);
220 * @anchor playlist_item_copy
222 * function copy selected items from playlist into the clipboard
224 * @param[in] app application instance handle
228 void playlist_item_copy(instance_t
* app
);
233 * @anchor playlist_item_paste
235 * function insert items from clipboard to playlist
237 * @param[in] app application instance handle
238 * @param[in] after flag indicating that insertion is after selected
242 void playlist_item_paste(instance_t
* app
, int after
);
247 * @anchor playlist_item_swap
249 * swap first selected item with next or previous item
251 * @param[in] app application instance handle
252 * @param[in] dir swap direction
256 void playlist_item_swap(instance_t
* app
, int dir
);
259 void playlist_save(instance_t
* app
);
260 void playlist_load(instance_t
* app
);
261 void playlist_item_edit(instance_t
* app
);
262 void playlist_item_add(instance_t
* app
, int after
);
263 void playlist_relink(instance_t
* app
);
264 void playlist_item_add_from_library(instance_t
* app
, int after
);
268 #endif /* __cplusplus */
270 #endif /* PLAYLIST_H */