idx = idxs[j] - j;
/* fix block types */
- if(idx)
- app->playlist.item[idx - 1].type = (playlist_item_type_t)(app->playlist.item[idx - 1].type |
- OMNPLAY_PLAYLIST_BLOCK_END);
- if(idx + 1 < app->playlist.count)
- app->playlist.item[idx + 1].type = (playlist_item_type_t)(app->playlist.item[idx + 1].type |
- OMNPLAY_PLAYLIST_BLOCK_BEGIN);
+ if( app->playlist.item[idx].type != OMNPLAY_PLAYLIST_ITEM_BLOCK_BODY &&
+ app->playlist.item[idx].type != OMNPLAY_PLAYLIST_ITEM_LOOP_BODY)
+ {
+ if(idx)
+ app->playlist.item[idx - 1].type = (playlist_item_type_t)(app->playlist.item[idx - 1].type |
+ OMNPLAY_PLAYLIST_BLOCK_END);
+ if(idx + 1 < app->playlist.count)
+ app->playlist.item[idx + 1].type = (playlist_item_type_t)(app->playlist.item[idx + 1].type |
+ OMNPLAY_PLAYLIST_BLOCK_BEGIN);
+ };
/* shift playlist items */
memmove
return FALSE;
};
+static gboolean on_library_grid_button(GtkWidget *widget, GdkEventButton *event, gpointer data)
+{
+ if(event->button==1 && event->type==GDK_2BUTTON_PRESS)
+ {
+ omnplay_library_add((omnplay_instance_t* )data, 0);
+ return TRUE;
+ };
+
+ return FALSE;
+};
+
+static gboolean on_playlist_grid_button(GtkWidget *widget, GdkEventButton *event, gpointer data)
+{
+ if(event->button==1 && event->type==GDK_2BUTTON_PRESS)
+ {
+ omnplay_ctl((omnplay_instance_t* )data, BUTTON_PLAYER_CUE);
+ return TRUE;
+ };
+
+ return FALSE;
+};
+
void omnplay_init(omnplay_instance_t* app)
{
int i;
gtk_signal_connect(GTK_OBJECT(app->library_grid), "key-press-event",
GTK_SIGNAL_FUNC(on_library_grid_key), app);
+ gtk_signal_connect(GTK_OBJECT(app->playlist_grid), "button-press-event",
+ GTK_SIGNAL_FUNC(on_playlist_grid_button), app);
+
+ gtk_signal_connect(GTK_OBJECT(app->library_grid), "button-press-event",
+ GTK_SIGNAL_FUNC(on_library_grid_button), app);
+
/* create lock */
pthread_mutex_init(&app->players.lock, &attr);