comparison audacious/main.c @ 2088:db3172fb53f0 trunk

[svn] - update main.c to new API
author nenolod
date Mon, 11 Dec 2006 04:34:17 -0800
parents c291952bf462
children f18a5b617c34
comparison
equal deleted inserted replaced
2087:bc47a2129067 2088:db3172fb53f0
600 { 600 {
601 GList *node; 601 GList *node;
602 gchar *str; 602 gchar *str;
603 gint i, cur_pb_time; 603 gint i, cur_pb_time;
604 ConfigDb *db; 604 ConfigDb *db;
605 Playlist *playlist = playlist_get_active();
605 606
606 cfg.disabled_iplugins = input_stringify_disabled_list(); 607 cfg.disabled_iplugins = input_stringify_disabled_list();
607 608
608 609
609 db = bmp_cfg_db_open(); 610 db = bmp_cfg_db_open();
621 *bmp_numents[i].ie_vloc); 622 *bmp_numents[i].ie_vloc);
622 623
623 /* This is a bit lame .. it'll end up being written twice, 624 /* This is a bit lame .. it'll end up being written twice,
624 * could do with being done a bit neater. -larne */ 625 * could do with being done a bit neater. -larne */
625 bmp_cfg_db_set_int(db, NULL, "playlist_position", 626 bmp_cfg_db_set_int(db, NULL, "playlist_position",
626 playlist_get_position()); 627 playlist_get_position(playlist));
627 628
628 bmp_cfg_db_set_bool(db, NULL, "mainwin_use_xfont", 629 bmp_cfg_db_set_bool(db, NULL, "mainwin_use_xfont",
629 cfg.mainwin_use_xfont); 630 cfg.mainwin_use_xfont);
630 631
631 for (i = 0; i < ncfgsent; ++i) { 632 for (i = 0; i < ncfgsent; ++i) {
704 bmp_cfg_db_set_int(db, NULL, "resume_playback_on_startup_time", 705 bmp_cfg_db_set_int(db, NULL, "resume_playback_on_startup_time",
705 cfg.resume_playback_on_startup_time); 706 cfg.resume_playback_on_startup_time);
706 707
707 bmp_cfg_db_close(db); 708 bmp_cfg_db_close(db);
708 709
709 playlist_save(bmp_paths[BMP_PATH_PLAYLIST_FILE]); 710 playlist_save(playlist, bmp_paths[BMP_PATH_PLAYLIST_FILE]);
710 } 711 }
711 712
712 static void 713 static void
713 bmp_set_default_icon(void) 714 bmp_set_default_icon(void)
714 { 715 {
1023 1024
1024 gint 1025 gint
1025 main(gint argc, gchar ** argv) 1026 main(gint argc, gchar ** argv)
1026 { 1027 {
1027 gboolean gtk_init_check_ok; 1028 gboolean gtk_init_check_ok;
1029 Playlist *playlist;
1028 1030
1029 /* Setup l10n early so we can print localized error messages */ 1031 /* Setup l10n early so we can print localized error messages */
1030 gtk_set_locale(); 1032 gtk_set_locale();
1031 bindtextdomain(PACKAGE_NAME, LOCALEDIR); 1033 bindtextdomain(PACKAGE_NAME, LOCALEDIR);
1032 bind_textdomain_codeset(PACKAGE_NAME, "UTF-8"); 1034 bind_textdomain_codeset(PACKAGE_NAME, "UTF-8");
1119 } 1121 }
1120 1122
1121 GDK_THREADS_ENTER(); 1123 GDK_THREADS_ENTER();
1122 } 1124 }
1123 1125
1124 playlist_load(bmp_paths[BMP_PATH_PLAYLIST_FILE]); 1126 playlist = playlist_get_active();
1125 playlist_set_position(cfg.playlist_position); 1127 playlist_load(playlist, bmp_paths[BMP_PATH_PLAYLIST_FILE]);
1128 playlist_set_position(playlist, cfg.playlist_position);
1126 1129
1127 /* this needs to be called after all 3 windows are created and 1130 /* this needs to be called after all 3 windows are created and
1128 * input plugins are setup'ed 1131 * input plugins are setup'ed
1129 * but not if we're running headless --nenolod 1132 * but not if we're running headless --nenolod
1130 */ 1133 */
1170 starting_up = FALSE; 1173 starting_up = FALSE;
1171 1174
1172 has_x11_connection = TRUE; 1175 has_x11_connection = TRUE;
1173 1176
1174 if (cfg.resume_playback_on_startup) { 1177 if (cfg.resume_playback_on_startup) {
1175 if (cfg.resume_playback_on_startup_time != -1 && playlist_get_length() > 0) { 1178 if (cfg.resume_playback_on_startup_time != -1 && playlist_get_length(playlist) > 0) {
1176 int i; 1179 int i;
1177 gint l=0, r=0; 1180 gint l=0, r=0;
1178 while (gtk_events_pending()) gtk_main_iteration(); 1181 while (gtk_events_pending()) gtk_main_iteration();
1179 output_get_volume(&l, &r); 1182 output_get_volume(&l, &r);
1180 output_set_volume(0,0); 1183 output_set_volume(0,0);