/*****************************************************************************
-* maemo_interface.c : Interface creation of the maemo plugin
-*****************************************************************************
-* Copyright (C) 2008 the VideoLAN team
-* $Id$
-*
-* Authors: Antoine Lejeune <phytos@videolan.org>
-*
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
-*****************************************************************************/
+ * maemo_interface.c : Interface creation of the maemo plugin
+ *****************************************************************************
+ * Copyright (C) 2008 the VideoLAN team
+ * $Id$
+ *
+ * Authors: Antoine Lejeune <phytos@videolan.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
#include <vlc_common.h>
#include "maemo.h"
#include "maemo_callbacks.h"
#include "maemo_interface.h"
+#include "maemo_input.h"
static void scan_maemo_for_media ( intf_thread_t *p_intf );
static void find_media_in_dir ( const char *psz_dir, GList **pp_list );
static const char *ppsz_media_dirs[] =
{ "/media/mmc1", "/media/mmc2", "/home/user/MyDocs/.videos", NULL };
-#define ADD_MENU_ITEM( label, callback ) \
- item = gtk_menu_item_new_with_label( label ); \
- gtk_menu_append( main_menu, item ); \
- g_signal_connect( GTK_OBJECT( item ), "activate", G_CALLBACK( callback ), \
- p_intf );
-#define ADD_CHECK_MENU_ITEM( label, callback ) \
- item = gtk_check_menu_item_new_with_label( label ); \
- gtk_menu_append( main_menu, item ); \
- g_signal_connect( GTK_OBJECT( item ), "toggled", G_CALLBACK( callback ), \
- p_intf );
-#define ADD_SEPARATOR \
- item = gtk_separator_menu_item_new(); \
- gtk_menu_append( main_menu, item );
-
-void create_menu( intf_thread_t *p_intf )
-{
- /* Needed variables */
- GtkWidget *main_menu;
- GtkWidget *item;
- int i_skip;
-
- /* Creating the main menu */
- main_menu = gtk_menu_new();
-
- /* Getting ffmpeg-skip-frame value */
- i_skip = config_GetInt( p_intf, "ffmpeg-skip-frame" );
-
- /* Filling the menu */
- ADD_MENU_ITEM( "Open", open_cb );
- ADD_MENU_ITEM( "Open Address", open_address_cb );
- ADD_MENU_ITEM( "Open Webcam", open_webcam_cb );
- ADD_SEPARATOR;
- ADD_MENU_ITEM( "Take a snapshot", snapshot_cb );
- ADD_CHECK_MENU_ITEM( "Drop frames", dropframe_cb );
- if( i_skip )
- gtk_check_menu_item_set_active( GTK_CHECK_MENU_ITEM( item ), true );
- ADD_SEPARATOR;
- ADD_MENU_ITEM( "Close", delete_event_cb );
-
- hildon_window_set_menu( HILDON_WINDOW( p_intf->p_sys->p_main_window ),
- GTK_MENU( main_menu ) );
-
- gtk_widget_show_all( main_menu );
-}
-
-#undef ADD_MENU
-#undef ADD_CHECK_MENU_ITEM
-#undef ADD_SEPARATOR
-
void create_playlist( intf_thread_t *p_intf )
{
GtkWidget *playlist;
playlist = gtk_tree_view_new();
playlist_store = gtk_list_store_new( 1, G_TYPE_STRING );
- p_intf->p_sys->p_playlist_store = GTK_WIDGET( playlist_store );
+ p_intf->p_sys->p_playlist_store = playlist_store;
gtk_tree_view_set_model( GTK_TREE_VIEW( playlist ),
GTK_TREE_MODEL( playlist_store ) );
scroll = gtk_scrolled_window_new( NULL, NULL );
gtk_container_add( GTK_CONTAINER( scroll ), playlist );
- gtk_notebook_append_page( GTK_NOTEBOOK( p_intf->p_sys->p_tabs ), scroll,
- gtk_image_new_from_stock( "vlc-playlist",
- GTK_ICON_SIZE_DIALOG ) );
- gtk_notebook_set_tab_label_packing( GTK_NOTEBOOK( p_intf->p_sys->p_tabs ), scroll,
- FALSE, FALSE, GTK_PACK_START );
+ p_intf->p_sys->p_playlist_window = scroll;
g_signal_connect( playlist, "row-activated",
G_CALLBACK( pl_row_activated_cb ), NULL );
+
+ // Set callback with the vlc core
+ var_AddCallback( p_intf->p_sys->p_playlist, "item-change",
+ item_changed_cb, p_intf );
+ var_AddCallback( p_intf->p_sys->p_playlist, "item-current",
+ playlist_current_cb, p_intf );
+ var_AddCallback( p_intf->p_sys->p_playlist, "activity",
+ activity_cb, p_intf );
+}
+
+void delete_playlist( intf_thread_t *p_intf )
+{
+ var_DelCallback( p_intf->p_sys->p_playlist, "item-change",
+ item_changed_cb, p_intf );
+ var_DelCallback( p_intf->p_sys->p_playlist, "item-current",
+ playlist_current_cb, p_intf );
+ var_DelCallback( p_intf->p_sys->p_playlist, "activity",
+ activity_cb, p_intf );
}
static void scan_maemo_for_media( intf_thread_t *p_intf )