From: Guenter B. <gu...@us...> - 2003-03-08 15:50:40
|
Update of /cvsroot/xine/gnome-xine/src In directory sc8-pr-cvs1:/tmp/cvs-serv18321/src Modified Files: mediamarks.c mediamarks.h menu.c script_engine.c Log Message: mediamarks import function Index: mediamarks.c =================================================================== RCS file: /cvsroot/xine/gnome-xine/src/mediamarks.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- mediamarks.c 8 Mar 2003 15:38:58 -0000 1.17 +++ mediamarks.c 8 Mar 2003 15:50:36 -0000 1.18 @@ -131,7 +131,7 @@ */ olditems = gtk_container_children (GTK_CONTAINER(submenu)); - while ( (item = (GtkWidget *) g_list_nth_data (olditems, 3)) ) { + while ( (item = (GtkWidget *) g_list_nth_data (olditems, 4)) ) { gtk_container_remove (GTK_CONTAINER (submenu), item); olditems = gtk_container_children (GTK_CONTAINER (submenu)); } @@ -537,6 +537,21 @@ return 0; return 1; +} + +void mm_import (void) { + + gchar *fname; + + fname = modal_file_dialog ("Select mediamarks file to load...", NULL); + + if (fname) { + + if (!load_mediamarks (fname)) + display_error ("Mediamarks load failed", + "Couldn't load mediamarks file" + "%s", fname); + } } void mediamarks_init (void) { Index: mediamarks.h =================================================================== RCS file: /cvsroot/xine/gnome-xine/src/mediamarks.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- mediamarks.h 1 Feb 2003 23:30:06 -0000 1.5 +++ mediamarks.h 8 Mar 2003 15:50:37 -0000 1.6 @@ -29,6 +29,6 @@ void mm_manage_show (void); void mm_add_show (void); - +void mm_import (void); #endif Index: menu.c =================================================================== RCS file: /cvsroot/xine/gnome-xine/src/menu.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- menu.c 28 Feb 2003 00:06:59 -0000 1.9 +++ menu.c 8 Mar 2003 15:50:37 -0000 1.10 @@ -235,6 +235,10 @@ action_exec ("mm_manage_show ();", NULL, NULL); } +static void mediamarks_import_cb(void) { + action_exec ("import_mediamarks ();", NULL, NULL); +} + static void about_cb(void) { action_exec ("about_show ();", NULL, NULL); } @@ -294,13 +298,14 @@ { "/View/Aspect ratio/Square",NULL, aspect_square_cb, 0, NULL}, { "/View/Aspect ratio/4:3", NULL, aspect_4_3_cb, 0, NULL}, { "/View/Aspect ratio/16:9", NULL, aspect_16_9_cb, 0, NULL}, - { "/View/Aspect ratio/Dont' touch", NULL, aspect_dt_cb, 0, NULL}, + { "/View/Aspect ratio/Don't touch", NULL, aspect_dt_cb, 0, NULL}, { "/View/sep6", NULL, NULL, 0, "<Separator>" }, { "/View/_Visualizations", NULL, NULL, 0, "<Branch>" }, { "/View/Visualizations/None", NULL, vis_none_cb, 0, "<RadioItem>"}, { "/_Media", NULL, NULL, 0, "<Branch>" }, { "/Media/_Add Mediamark...","<control>D", mediamarks_add_cb, 0, NULL }, { "/Media/_Manage Medimarks...","<control>B", mediamarks_manage_cb, 0, NULL }, + { "/Media/_Import Medimarks...",NULL, mediamarks_import_cb, 0, NULL }, { "/Media/sep5", NULL, NULL, 0, "<Separator>" }, { "/_Help", NULL, NULL, 0, "<LastBranch>" }, { "/Help/About...", NULL, about_cb, 0, NULL }, Index: script_engine.c =================================================================== RCS file: /cvsroot/xine/gnome-xine/src/script_engine.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- script_engine.c 7 Mar 2003 02:03:18 -0000 1.16 +++ script_engine.c 8 Mar 2003 15:50:37 -0000 1.17 @@ -787,6 +787,20 @@ return JS_TRUE; } +static JSBool js_import_mediamarks (JSContext *cx, JSObject *obj, uintN argc, + jsval *argv, jsval *rval) { + + /* se_t *se = (se_t *) JS_GetContextPrivate(cx); */ + +#ifdef LOG + printf ("script_engine: import_mediamarks called\n"); +#endif + + mm_import (); + + return JS_TRUE; +} + static JSBool js_set_speed (JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) { @@ -1346,6 +1360,7 @@ "preferences_show ();\n" "keybindings_show ();\n" "run_wizards ();\n" + "import_mediamarks ();\n" "\n" "playlist cotrol:\n" "playlist_clear();\n" @@ -1512,6 +1527,7 @@ JS_DefineFunction (se->cx, se->global, "log_show", js_log_show, 0, 0); JS_DefineFunction (se->cx, se->global, "stream_info_show", js_stream_info_show, 0, 0); JS_DefineFunction (se->cx, se->global, "run_wizards", js_run_wizards, 0, 0); + JS_DefineFunction (se->cx, se->global, "import_mediamarks", js_import_mediamarks, 0, 0); JS_DefineFunction (se->cx, se->global, "playlist_clear", js_playlist_clear, 0, 0); JS_DefineFunction (se->cx, se->global, "playlist_add", js_playlist_add, 0, 0); |