Welcome to the Rockbox Technical Forums!
/* get tag info from new_id3v1 and display it*/ char* title_display; rb->snprintf(title_display, 37, "Title: %s", new_id3v1.title); char* artist_display; rb->snprintf(artist_display, 38, "Artist: %s", new_id3v1.artist); char* album_display; rb->snprintf(album_display, 37, "Album: %s", new_id3v1.album); char* year_display; rb->snprintf(year_display, 10, "Year: %s", new_id3v1.year); char* comment_display; rb->snprintf(comment_display, 37, "Comment: %s", new_id3v1.comment); MENUITEM_STRINGLIST(edittags_menu, "Select a tag to edit", NULL, /* this is the line 229 */ title_display, artist_display, album_display, year_display, comment_display, "Save", "Return",); switch (rb->do_menu(&edittags_menu, NULL, NULL, false)) { default: /* no matter what the user selects, we will always return back */ return true; }
char* filename_display; rb->snprintf(filename_display, MAX_PATH, "Filename: %s", opened_file); char* tagtype_display; tagtype_display = "Tag type: ID3v1"; /*in the future this will show the real tag type; for now it's a placeholder. */ MENUITEM_STRINGLIST(fileinfo_menu, "File information", NULL, /* this is the line 197 */ filename_display, tagtype_display, "Return",); switch (rb->do_menu(&fileinfo_menu, NULL, NULL, false)) { default: /* no matter what the user selects, we will always return back */ return true; }
gabriel@somePC:~/rockbox/build$ makeCC apps/plugins/id3_editor.c/home/gabriel/rockbox/apps/plugins/id3_editor.c: In function ‘show_file_info’:/home/gabriel/rockbox/apps/plugins/id3_editor.c:197: error: initializer element is not constant/home/gabriel/rockbox/apps/plugins/id3_editor.c:197: error: (near initialization for ‘fileinfo_menu_[0]’)/home/gabriel/rockbox/apps/plugins/id3_editor.c:197: error: initializer element is not constant/home/gabriel/rockbox/apps/plugins/id3_editor.c:197: error: (near initialization for ‘fileinfo_menu_[1]’)/home/gabriel/rockbox/apps/plugins/id3_editor.c: In function ‘show_edittags_menu’:/home/gabriel/rockbox/apps/plugins/id3_editor.c:229: error: initializer element is not constant/home/gabriel/rockbox/apps/plugins/id3_editor.c:229: error: (near initialization for ‘edittags_menu_[0]’)/home/gabriel/rockbox/apps/plugins/id3_editor.c:229: error: initializer element is not constant/home/gabriel/rockbox/apps/plugins/id3_editor.c:229: error: (near initialization for ‘edittags_menu_[1]’)/home/gabriel/rockbox/apps/plugins/id3_editor.c:229: error: initializer element is not constant/home/gabriel/rockbox/apps/plugins/id3_editor.c:229: error: (near initialization for ‘edittags_menu_[2]’)/home/gabriel/rockbox/apps/plugins/id3_editor.c:229: error: initializer element is not constant/home/gabriel/rockbox/apps/plugins/id3_editor.c:229: error: (near initialization for ‘edittags_menu_[3]’)/home/gabriel/rockbox/apps/plugins/id3_editor.c:229: error: initializer element is not constant/home/gabriel/rockbox/apps/plugins/id3_editor.c:229: error: (near initialization for ‘edittags_menu_[4]’)make: ** [/home/gabriel/rockbox/build/apps/plugins/id3_editor.o] Erro 1gabriel@somePC:~/rockbox/build$ gabriel@GabrielUbuntuDesktop:~/rockbox/build$ makeCC apps/plugins/id3_editor.c/home/gabriel/rockbox/apps/plugins/id3_editor.c: In function ‘show_file_info’:/home/gabriel/rockbox/apps/plugins/id3_editor.c:197: error: initializer element is not constant/home/gabriel/rockbox/apps/plugins/id3_editor.c:197: error: (near initialization for ‘fileinfo_menu_[0]’)/home/gabriel/rockbox/apps/plugins/id3_editor.c:197: error: initializer element is not constant/home/gabriel/rockbox/apps/plugins/id3_editor.c:197: error: (near initialization for ‘fileinfo_menu_[1]’)/home/gabriel/rockbox/apps/plugins/id3_editor.c: In function ‘show_edittags_menu’:/home/gabriel/rockbox/apps/plugins/id3_editor.c:229: error: initializer element is not constant/home/gabriel/rockbox/apps/plugins/id3_editor.c:229: error: (near initialization for ‘edittags_menu_[0]’)/home/gabriel/rockbox/apps/plugins/id3_editor.c:229: error: initializer element is not constant/home/gabriel/rockbox/apps/plugins/id3_editor.c:229: error: (near initialization for ‘edittags_menu_[1]’)/home/gabriel/rockbox/apps/plugins/id3_editor.c:229: error: initializer element is not constant/home/gabriel/rockbox/apps/plugins/id3_editor.c:229: error: (near initialization for ‘edittags_menu_[2]’)/home/gabriel/rockbox/apps/plugins/id3_editor.c:229: error: initializer element is not constant/home/gabriel/rockbox/apps/plugins/id3_editor.c:229: error: (near initialization for ‘edittags_menu_[3]’)/home/gabriel/rockbox/apps/plugins/id3_editor.c:229: error: initializer element is not constant/home/gabriel/rockbox/apps/plugins/id3_editor.c:229: error: (near initialization for ‘edittags_menu_[4]’)make: ** [/home/gabriel/rockbox/build/apps/plugins/id3_editor.o] Erro 1gabriel@GabrielUbuntuDesktop:~/rockbox/build$
MENUITEM_STRINGLIST(main_menu, "Tag editor", NULL, "File information", "Edit tags", "Exit",);
/* get tag info from new_id3v1 and display it*/ char* title_display; rb->snprintf(title_display, 37, "Title: %s", new_id3v1.title);
tagtype_display = "Tag type: ID3v1"
rb->snprintf(tagtype_display, 15, "Tag type: ID3v1");
gabriel@somePC:~/rockbox/build$ makeCC apps/plugins/id3_editor.c/home/gabriel/rockbox/apps/plugins/id3_editor.c: In function ‘show_file_info’:/home/gabriel/rockbox/apps/plugins/id3_editor.c:207: error: initializer element is not constant/home/gabriel/rockbox/apps/plugins/id3_editor.c:207: error: (near initialization for ‘fileinfo_menu_[0]’)/home/gabriel/rockbox/apps/plugins/id3_editor.c:207: error: initializer element is not constant/home/gabriel/rockbox/apps/plugins/id3_editor.c:207: error: (near initialization for ‘fileinfo_menu_[1]’)/home/gabriel/rockbox/apps/plugins/id3_editor.c: In function ‘show_edittags_menu’:/home/gabriel/rockbox/apps/plugins/id3_editor.c:239: error: initializer element is not constant/home/gabriel/rockbox/apps/plugins/id3_editor.c:239: error: (near initialization for ‘edittags_menu_[0]’)/home/gabriel/rockbox/apps/plugins/id3_editor.c:239: error: initializer element is not constant/home/gabriel/rockbox/apps/plugins/id3_editor.c:239: error: (near initialization for ‘edittags_menu_[1]’)/home/gabriel/rockbox/apps/plugins/id3_editor.c:239: error: initializer element is not constant/home/gabriel/rockbox/apps/plugins/id3_editor.c:239: error: (near initialization for ‘edittags_menu_[2]’)/home/gabriel/rockbox/apps/plugins/id3_editor.c:239: error: initializer element is not constant/home/gabriel/rockbox/apps/plugins/id3_editor.c:239: error: (near initialization for ‘edittags_menu_[3]’)/home/gabriel/rockbox/apps/plugins/id3_editor.c:239: error: initializer element is not constant/home/gabriel/rockbox/apps/plugins/id3_editor.c:239: error: (near initialization for ‘edittags_menu_[4]’)make: ** [/home/gabriel/rockbox/build/apps/plugins/id3_editor.o] Erro 1
bool show_test_menu(void){ char[14] item1text = "Item 1 example"; char[14] item2text = "Item 2 example"; MENUITEM_RETURNVALUE_DYNTEXT(dyn_item1, CALL1, NULL, item1text, NULL, NULL, ICON_NOICON); MENUITEM_RETURNVALUE_DYNTEXT(dyn_item2, CALL2, NULL, item2text, NULL, NULL, ICON_NOICON); /* I don't know if ICON_NOICON exists... */ /*and then tell to draw the menu... */ MAKE_MENU(test_menu, "Test menu", item_callback, Icon_Rockbox, &dyn_item1, &dyn_item2);}/*have a function that handles item selection... */static int item_callback(int action, const struct menu_item_ex *this_item) { /* a switch would be in here... just not sure what to switch between...? between CALL1 and CALL2? */}
/* As above, except the text is dynamic */#define MENUITEM_FUNCTION_DYNTEXT(name, flags, func, param, \ text_callback, voice_callback, \ text_cb_data, callback, icon) \ static const struct menu_get_name_and_icon name##_ \ = {callback,text_callback,voice_callback,text_cb_data,icon}; \ static const struct menu_func name##__ = {{(void*)func}, param}; \ static const struct menu_item_ex name = \ { MT_FUNCTION_CALL|MENU_DYNAMIC_DESC|flags, \ { .function = & name##__}, {.menu_get_name_and_icon = & name##_}};
Page created in 0.076 seconds with 15 queries.