Subversion Repositories Kolibri OS

Rev

Rev 7348 | Rev 7484 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. #define MEMSIZE 4096 * 50
  2.  
  3. //===================================================//
  4. //                                                   //
  5. //                       LIB                         //
  6. //                                                   //
  7. //===================================================//
  8.  
  9. #include "../lib/fs.h"
  10. #include "../lib/list_box.h"
  11. #include "../lib/gui.h"
  12. #include "../lib/random.h"
  13. #include "../lib/kfont.h"
  14.  
  15. #include "../lib/obj/libio.h"
  16. #include "../lib/obj/libimg.h"
  17. #include "../lib/obj/libini.h"
  18. #include "../lib/obj/proc_lib.h"
  19. #include "../lib/obj/box_lib.h"
  20.  
  21. #include "../lib/patterns/simple_open_dialog.h"
  22.  
  23. //===================================================//
  24. //                                                   //
  25. //                       DATA                        //
  26. //                                                   //
  27. //===================================================//
  28.  
  29. //simple open dialog data
  30. char default_dir[] = "/rd/1";
  31. od_filter filter2 = { 15, "MP3\0WAV\0XM\0\0" };
  32.  
  33. #define ABOUT_MESSAGE "Pixie Player v2.92 Final
  34.  
  35.      A tiny music folder player.
  36.      Supports MP3, WAV, XM audio file formats.
  37.  
  38. Hot keys:
  39.  Open file: O key
  40.  Play/Stop: Space or P key
  41.  Start playing selected file: Enter
  42.  Goto next/previous track: Ctrl + Left/Right
  43.  Change sound volume: Left/Right key
  44.  Remove from the list: Delete
  45.  Permanently delete file: Shift + Delete
  46.  Repeat: R
  47.  Shuffle: S
  48.  Mute: M
  49.  
  50. kolibri-n.org & aspero.pro"
  51.  
  52. scroll_bar scroll1 = { 5,200,398,44,0,2,115,15,0,0xeeeeee,0xBBBbbb,0xeeeeee,
  53.         0,0,0,0,0,0,0,0,0,0,0,0,0,1,1};
  54.  
  55. proc_info Form;
  56. llist list;
  57.  
  58. char pixie_ini_path[4096];
  59. char work_folder[4096];
  60. char current_filename[256];
  61.  
  62. enum {
  63.         BUTTON_WINDOW_CLOSE = 1,
  64.         BUTTON_WINDOW_MINIMIZE,
  65.         BUTTON_WINDOW_REDUCE,
  66.         BUTTON_PLAYBACK_PLAY_PAUSE = 10,
  67.         BUTTON_PLAYBACK_PREV,
  68.         BUTTON_PLAYBACK_NEXT,
  69.         BUTTON_REPEAT,
  70.         BUTTON_SHUFFLE,
  71.         BUTTON_OPEN_DIALOG,
  72.         BUTTON_SHOW_VOLUME
  73. };
  74.  
  75. int player_run_id;
  76. int notify_run_id;
  77.  
  78. bool repeat;
  79. bool shuffle;
  80.  
  81. int current_playing_file_n=0;
  82.  
  83. word win_x_normal, win_y_normal;
  84. word win_x_small, win_y_small;
  85.  
  86. byte window_mode;
  87. enum {
  88.         WINDOW_MODE_NORMAL,
  89.         WINDOW_MODE_SMALL
  90. };
  91.  
  92. byte playback_mode;
  93. enum {
  94.         PLAYBACK_MODE_STOPED,
  95.         PLAYBACK_MODE_PLAYING
  96. };
  97.  
  98. #define LAST_FOLDER_EXISTS 1
  99.  
  100. //===================================================//
  101. //                                                   //
  102. //                       CODE                        //
  103. //                                                   //
  104. //===================================================//
  105.  
  106. #include "get_files_list.h"
  107. #include "settings.h"
  108.  
  109. void LoadLibraries()
  110. {
  111.         load_dll(boxlib, #box_lib_init,0);
  112.         load_dll(libio, #libio_init,1);
  113.         load_dll(libimg, #libimg_init,1);
  114.         load_dll(libini, #lib_init,1);
  115.         load_dll(Proc_lib, #OpenDialog_init,0);
  116.         OpenDialog_init stdcall (#o_dialog);
  117. }
  118.  
  119. void main()
  120. {
  121.         list.SetFont(8, 16, 13);
  122.         LoadLibraries();
  123.         LoadIniConfig();
  124.         if (!param) {
  125.                 notify("'Pixie Player\nPress O key to open MP3/WAV/XM file' -St");
  126.                 if (work_folder) param=LAST_FOLDER_EXISTS;
  127.         }
  128.         kfont.init(DEFAULT_FONT);      
  129.         SetEventMask(EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE + EVM_MOUSE_FILTER);
  130.         loop()
  131.         {
  132.           WaitEventTimeout(10);
  133.           switch(EAX & 0xFF) {
  134.                 case evMouse:
  135.                         if (!CheckActiveProcess(Form.ID)) break;
  136.                         mouse.get();
  137.                         scrollbar_v_mouse (#scroll1);
  138.                         if (list.first != scroll1.position)
  139.                         {
  140.                                 list.first = scroll1.position;
  141.                                 DrawPlayList();
  142.                                 break;
  143.                         }
  144.                         if (list.MouseOver(mouse.x, mouse.y))
  145.                         {
  146.                                 if (mouse.vert) && (list.MouseScroll(mouse.vert)) DrawPlayList();
  147.                                 if (mouse.dblclick) EventStartPlayingSelectedItem();
  148.                                 if (mouse.down) && (mouse.key&MOUSE_LEFT)
  149.                                         && (list.ProcessMouse(mouse.x, mouse.y)) DrawPlayList();
  150.                                 if (mouse.down) && (mouse.key&MOUSE_RIGHT) EventShowAbout();
  151.                         }
  152.                         if(mouse.key&MOUSE_LEFT) && (mouse.x<14)
  153.                                 && (window_mode == WINDOW_MODE_SMALL) EventDragWindow();
  154.                         break;
  155.                 case evButton:
  156.                         switch(GetButtonID()) {
  157.                                 case BUTTON_WINDOW_CLOSE: EventExitApp(); break;
  158.                                 case BUTTON_WINDOW_MINIMIZE: MinimizeWindow(); break;
  159.                                 case BUTTON_WINDOW_REDUCE: EventChangeWindowMode(); break;
  160.                                 case BUTTON_PLAYBACK_PREV: EventPlaybackPrevious();     break;
  161.                                 case BUTTON_PLAYBACK_NEXT: EventPlaybackNext(); break;
  162.                                 case BUTTON_PLAYBACK_PLAY_PAUSE: EventPlayAndPause(); break;
  163.                                 case BUTTON_REPEAT: EventRepeatClick(); break;
  164.                                 case BUTTON_SHUFFLE: EventShuffleClick(); break;
  165.                                 case BUTTON_OPEN_DIALOG: EventFileDialogOpen(); break;
  166.                                 case BUTTON_SHOW_VOLUME: RunProgram("/sys/@VOLUME", NULL); break;
  167.                         }
  168.                         break;   
  169.                 case evKey:
  170.                         GetKeys();
  171.                         if (key_modifier&KEY_LCTRL) || (key_modifier&KEY_RCTRL) {
  172.                                 if (key_scancode==SCAN_CODE_LEFT) EventPlaybackPrevious();
  173.                                 if (key_scancode==SCAN_CODE_RIGHT) EventPlaybackNext();
  174.                                 break;
  175.                         }
  176.                         if (key_modifier&KEY_LSHIFT) || (key_modifier&KEY_RSHIFT) {
  177.                                 if (key_scancode==SCAN_CODE_DEL) EventPermanentlyDeleteFile();
  178.                                 break;
  179.                         }
  180.                         if (key_scancode==SCAN_CODE_KEY_O) EventFileDialogOpen();
  181.                         if (key_scancode==SCAN_CODE_KEY_M) RunProgram("/sys/@VOLUME", "m");
  182.                         if (key_scancode==SCAN_CODE_KEY_R) EventRepeatClick();
  183.                         if (key_scancode==SCAN_CODE_KEY_S) EventShuffleClick();
  184.                         if (key_scancode==SCAN_CODE_KEY_I) EventShowTagInfo();
  185.                         if (key_scancode==SCAN_CODE_RIGHT) RunProgram("/sys/@VOLUME", "+");
  186.                         if (key_scancode==SCAN_CODE_LEFT)  RunProgram("/sys/@VOLUME", "-");
  187.                         if (key_scancode==SCAN_CODE_ENTER) EventStartPlayingSelectedItem();
  188.                         if (key_scancode==SCAN_CODE_DEL) EventRemoveItemFromList();
  189.                         if (key_scancode==SCAN_CODE_KEY_P)||(key_scancode==SCAN_CODE_SPACE) EventPlayAndPause();
  190.                         if (key_scancode==SCAN_CODE_F1) EventShowAbout();
  191.                         if (list.ProcessKey(key_scancode)) DrawPlayList();
  192.                         break;
  193.                 case evReDraw:
  194.                         if (window_mode == WINDOW_MODE_NORMAL)
  195.                                 DefineDragableWindow(win_x_normal, win_y_normal, skin.w - 1, skin.h + list.h-1);
  196.                         if (window_mode == WINDOW_MODE_SMALL)
  197.                                 DefineDragableWindow(win_x_small, win_y_small, WIN_W_SMALL, WIN_H_SMALL);
  198.                         draw_window();
  199.                         if (param[0]) {
  200.                                 if (param==LAST_FOLDER_EXISTS) EventOpenFolder(NULL);
  201.                                 else EventOpenFolder(#param);
  202.                                 param[0] = NULL;
  203.                         }
  204.                         break;
  205.                 default:
  206.                         EventCheckSongFinished();
  207.           }
  208.   }
  209. }
  210.  
  211.  
  212. void DrawPlayList()
  213. {
  214.         int i;
  215.         int yyy;
  216.         int kfont_width;
  217.         char temp_filename[4096];
  218.         dword text_color, bg_color;
  219.         for (i=0; i<list.visible; i++;)
  220.         {
  221.                 strcpy(#temp_filename, files_mas[i + list.first] * 304 + buf + 72);
  222.                 temp_filename[strrchr(#temp_filename, '.')-1] = '\0';
  223.                
  224.                 yyy = i*list.item_h+list.y;
  225.                
  226.                 //this is selected file
  227.                 if (list.cur_y - list.first == i)
  228.                 {
  229.                         if (i>=list.count) continue;
  230.                         bg_color = theme.color_list_active_bg;
  231.                         text_color = theme.color_list_text;
  232.                 }
  233.                 //this is not selected file
  234.                 else
  235.                 {
  236.                         if (i>=list.count) continue;
  237.                         bg_color = theme.color_list_bg;
  238.                         text_color = theme.color_list_text;
  239.                 }
  240.                 //this is cur_y playing file
  241.                 if (i + list.first == current_playing_file_n)
  242.                 && (playback_mode == PLAYBACK_MODE_PLAYING)
  243.                 {
  244.                         text_color = theme.color_list_active_text;
  245.                 }
  246.                 DrawBar(list.x, yyy, list.w, list.item_h, bg_color);
  247.                 kfont_width = kfont.WriteIntoWindow(6, yyy+list.text_y, bg_color,
  248.                         text_color, list.font_type, #temp_filename);
  249.                 if (kfont_width>skin.w-15) DrawBar(skin.w-1, yyy, 1, list.item_h, theme.color_list_border);
  250.         }
  251.         DrawBar(list.x,list.visible * list.item_h + list.y, list.w,
  252.                 -list.visible * list.item_h + list.h, theme.color_list_bg);
  253.         DrawScroller();
  254. }
  255.  
  256.  
  257. void draw_window() {
  258.         GetProcessInfo(#Form, SelfInfo);
  259.         DrawTopPanel();
  260.         IF (Form.status_window>=2) return;
  261.         if (window_mode == WINDOW_MODE_NORMAL)
  262.         {
  263.                 DrawPlayList();
  264.                 DrawRectangle(0, skin.h-1, skin.w-1, list.h+1, theme.color_list_border);
  265.         }
  266. }
  267.  
  268. void DrawTopPanel()
  269. {
  270.         int kfont_width;
  271.         int button_y;
  272.         //Mode depended
  273.         if (window_mode == WINDOW_MODE_NORMAL)
  274.         {
  275.                 button_y = 46;
  276.                 img_draw stdcall(skin.image, 0, 0, skin.w, skin.h, 0, 0);
  277.                 if (playback_mode != PLAYBACK_MODE_STOPED)
  278.                         img_draw stdcall(skin.image, 47, button_y, 41, 21, skin.w+1, WIN_H_SMALL+1);
  279.                 if (repeat)
  280.                         img_draw stdcall(skin.image, 217, button_y+2, 17,17,skin.w+43, WIN_H_SMALL+1);
  281.                 if (shuffle)
  282.                         img_draw stdcall(skin.image, 236, button_y+2, 17,17, skin.w+62, WIN_H_SMALL+1);
  283.  
  284.                 if (!work_folder) DrawPixieTitle("Pixie");
  285.                 else DrawPixieTitle(#work_folder + strrchr(#work_folder, '/'));
  286.                 kfont_width = kfont.WriteIntoWindow(8, 24, theme.color_top_panel_bg,
  287.                         theme.color_top_panel_song_name, list.font_type, #current_filename);
  288.                 if (kfont_width>skin.w-15) DrawBar(skin.w-1, 24, 1, list.item_h, theme.color_list_border);
  289.                 //Playing control buttons
  290.                 DefineHiddenButton(7, button_y, 38, 20, BUTTON_PLAYBACK_PREV);
  291.                 DefineHiddenButton(48, button_y, 38, 20, BUTTON_PLAYBACK_PLAY_PAUSE);
  292.                 DefineHiddenButton(87, button_y, 38, 20, BUTTON_PLAYBACK_NEXT);
  293.                 //Window control buttons
  294.                 DefineHiddenButton(Form.width - 27, 1, 26, 15, BUTTON_WINDOW_CLOSE);
  295.                 DefineHiddenButton(Form.width - 55, 1, 26, 15, BUTTON_WINDOW_MINIMIZE);
  296.                 DefineHiddenButton(Form.width - 83, 1, 26, 15, BUTTON_WINDOW_REDUCE);
  297.                 //Other buttons
  298.                 DefineHiddenButton(218, button_y+3, 17, 16, BUTTON_REPEAT);
  299.                 DefineHiddenButton(237, button_y+3, 17, 16, BUTTON_SHUFFLE);
  300.                 DefineHiddenButton(270, button_y+3, 17, 16, BUTTON_OPEN_DIALOG);
  301.                 DefineHiddenButton(289, button_y+3, 17, 16, BUTTON_SHOW_VOLUME);
  302.         }
  303.         else if (window_mode == WINDOW_MODE_SMALL)
  304.         {
  305.                 button_y = 7;
  306.                 img_draw stdcall(skin.image, 0, 0, WIN_W_SMALL, WIN_H_SMALL, skin.w-1, 0);
  307.                 if (playback_mode != PLAYBACK_MODE_STOPED)
  308.                         img_draw stdcall(skin.image, 46, button_y-1, 27, 19, skin.w+83, WIN_H_SMALL+1);
  309.                 DefineHiddenButton(0, 0, WIN_W_SMALL, WIN_H_SMALL, 99 + BT_NOFRAME);
  310.                 //Playing control buttons
  311.                 DefineHiddenButton(20, button_y, 24, 16, BUTTON_PLAYBACK_PREV);
  312.                 DefineHiddenButton(46, button_y, 24, 16, BUTTON_PLAYBACK_PLAY_PAUSE);
  313.                 DefineHiddenButton(72, button_y, 24, 16, BUTTON_PLAYBACK_NEXT);
  314.                 //Window control buttons
  315.                 DefineHiddenButton(Form.width - 20, 1, 19, 13, BUTTON_WINDOW_CLOSE);
  316.                 DefineHiddenButton(Form.width - 20, 16, 19, 13, BUTTON_WINDOW_REDUCE);
  317.         }
  318. }
  319.  
  320.  
  321. void DrawScroller()
  322. {
  323.         scroll1.max_area = list.count;
  324.         scroll1.cur_area = list.visible;
  325.         scroll1.position = list.first;
  326.         scroll1.all_redraw = 0;
  327.         scroll1.start_x = skin.w - scroll1.size_x-1;
  328.         scroll1.start_y = list.y-1;
  329.         scroll1.size_y = list.h+2;
  330.         if (list.count > list.visible) scrollbar_v_draw(#scroll1);
  331. }
  332.  
  333. void DrawPixieTitle(dword _title)
  334. {
  335.         kfont.WriteIntoWindow(8, 5, theme.color_top_panel_bg,
  336.                 theme.color_top_panel_folder_name, list.font_type, _title);
  337. }
  338.  
  339. //===================================================//
  340. //                                                   //
  341. //                     EVENTS                        //
  342. //                                                   //
  343. //===================================================//
  344.  
  345.  
  346. void EventOpenFolder(dword _open_path)
  347. {
  348.         if (!_open_path)
  349.         {
  350.                 OpenDirectory(#work_folder);
  351.         }
  352.         else
  353.         {
  354.                 strcpy(#work_folder, _open_path);
  355.                 work_folder[strrchr(#work_folder, '/')-1]='\0';
  356.                 OpenDirectory(#work_folder);
  357.                 SetOpenedFileFirst(_open_path);
  358.         }
  359.         list.SetSizes(1, skin.h, skin.w-1, 22*15, 22);
  360.         if (list.count <= list.visible)
  361.         {
  362.                 list.h = list.count * list.item_h;
  363.                 list.visible = list.count;
  364.                 list.w -= 1;
  365.         }
  366.         else
  367.         {
  368.                 list.w -= scroll1.size_x;
  369.         }
  370.         if (window_mode==WINDOW_MODE_NORMAL) MoveSize(OLD, OLD, OLD, skin.h + list.h);
  371.         list.KeyHome();
  372.         current_playing_file_n=0;
  373.         EventStopPlaying();
  374.         if (_open_path) EventStartPlaying();   
  375. }
  376.  
  377.  
  378. void EventStopPlaying()
  379. {
  380.         if (player_run_id) player_run_id = KillProcess(player_run_id);
  381.         if (notify_run_id) notify_run_id = KillProcess(notify_run_id);
  382.         playback_mode = PLAYBACK_MODE_STOPED;
  383.         DrawTopPanel();
  384.         DrawPlayList();
  385. }
  386.  
  387.  
  388. void EventStartPlaying()
  389. {
  390.         word i;
  391.         char item_path[4096];
  392.         char notify_message[512];
  393.         EventStopPlaying();
  394.         if (current_playing_file_n >= list.count) {
  395.                 current_playing_file_n = list.count-1;
  396.                 return;
  397.         }
  398.         if (current_playing_file_n < 0) {
  399.                 current_playing_file_n = 0;
  400.                 return;
  401.         }
  402.         playback_mode = PLAYBACK_MODE_PLAYING;
  403.         strlcpy(#current_filename, GetPlayingItemName(), sizeof(current_filename));
  404.         sprintf(#item_path,"-h %s/%s",#work_folder,#current_filename);
  405.         current_filename[strrchr(#current_filename, '.')-1] = '\0';
  406.         DrawPlayList();
  407.         DrawTopPanel();
  408.         player_run_id = RunProgram("/sys/media/ac97snd", #item_path);  
  409.         sprintf(#notify_message,"'Now playing:\n%s' -St",#current_filename);
  410.         if (!repeat) && (window_mode==WINDOW_MODE_SMALL)
  411.         {
  412.                 for (i=2; i<strlen(#notify_message)-6; i++)
  413.                 {
  414.                         //replace ' char to avoid @notify misunderstood
  415.                         if (notify_message[i]=='\'') notify_message[i]=96;
  416.                 }
  417.                 notify_run_id = notify(#notify_message);
  418.         }
  419. }
  420.  
  421.  
  422. void EventPlayAndPause()
  423. {
  424.         if (playback_mode == PLAYBACK_MODE_PLAYING)
  425.         {
  426.                 playback_mode = PLAYBACK_MODE_STOPED;
  427.                 EventStopPlaying();
  428.         }
  429.         else
  430.         {
  431.                 playback_mode = PLAYBACK_MODE_PLAYING;
  432.                 EventStartPlaying();
  433.         }
  434. }
  435.  
  436.  
  437. void EventChangeWindowMode()
  438. {
  439.         if (window_mode == WINDOW_MODE_NORMAL)
  440.         {
  441.                 window_mode = WINDOW_MODE_SMALL;
  442.                 win_x_normal = Form.left;
  443.                 win_y_normal = Form.top;
  444.                 MoveSize(OLD, OLD, WIN_W_SMALL-1, WIN_H_SMALL-1);
  445.                 MoveSize(OLD, win_y_small, OLD, OLD);
  446.                 MoveSize(win_x_small, OLD, OLD, OLD);
  447.         }
  448.         else
  449.         {
  450.                 window_mode = WINDOW_MODE_NORMAL;
  451.                 win_x_small = Form.left;
  452.                 win_y_small = Form.top;
  453.                 MoveSize(win_x_normal, win_y_normal, skin.w -1 ,skin.h + list.h);
  454.         }
  455. }
  456.  
  457. void EventExitApp()
  458. {
  459.         EventStopPlaying();
  460.         SaveIniConfig();
  461.         ExitProcess();
  462. }
  463.  
  464. void EventPlaybackPrevious()
  465. {
  466.         if (shuffle) current_playing_file_n = random(list.count);
  467.         else current_playing_file_n--;
  468.         EventStartPlaying();
  469. }
  470.  
  471. void EventPlaybackNext()
  472. {
  473.         if (shuffle) current_playing_file_n = random(list.count);
  474.         else current_playing_file_n++;
  475.         EventStartPlaying();
  476. }
  477.  
  478. void EventStartPlayingSelectedItem()
  479. {
  480.         current_playing_file_n=list.cur_y;
  481.         EventStartPlaying();
  482. }
  483.  
  484. void EventFileDialogOpen()
  485. {
  486.         OpenDialog_start stdcall (#o_dialog);
  487.         if (o_dialog.status==1) EventOpenFolder(#openfile_path);
  488. }
  489.  
  490. void EventCheckSongFinished()
  491. {
  492.         if (playback_mode == PLAYBACK_MODE_PLAYING)
  493.         && (!GetProcessSlot(player_run_id)) {
  494.                 if (repeat) EventStartPlaying();
  495.                 else EventPlaybackNext();
  496.         }
  497. }
  498.  
  499. void EventRepeatClick()
  500. {
  501.         repeat ^= 1;
  502.         DrawTopPanel();
  503. }
  504.  
  505. void EventShuffleClick()
  506. {
  507.         shuffle ^= 1;
  508.         DrawTopPanel();
  509. }
  510.  
  511. void EventRemoveItemFromList()
  512. {
  513.         int i;
  514.         if (list.cur_y == current_playing_file_n) EventStopPlaying();
  515.         for (i=list.cur_y; i<list.count; i++) files_mas[i] = files_mas[i+1];
  516.         list.count--;
  517.         if (list.cur_y <= current_playing_file_n) current_playing_file_n--;
  518.         list.CheckDoesValuesOkey();
  519.         if (list.count <= list.visible)
  520.         {
  521.                 list.h = list.count * list.item_h;
  522.                 list.visible = list.count;
  523.                 if (window_mode==WINDOW_MODE_NORMAL) MoveSize(OLD, OLD, OLD, skin.h + list.h);
  524.         }
  525.         else DrawPlayList();
  526. }
  527.  
  528. void EventPermanentlyDeleteFile()
  529. {
  530.         char item_path[4096];
  531.         sprintf(#item_path,"%s/%s",#work_folder,GetSelectedItemName());
  532.         DeleteFile(#item_path);
  533.         EventRemoveItemFromList();
  534. }
  535.  
  536. void EventShowAbout()
  537. {
  538.         CreateThread(#ShowAboutThread,#menu_stak+4092);
  539. }
  540.  
  541. void ShowAboutThread()
  542. {
  543.         proc_info pop_up;
  544.         loop() switch(WaitEvent())
  545.         {
  546.                 case evButton:
  547.                         ExitProcess();
  548.                         break;
  549.                 case evKey:
  550.                         GetKeys();
  551.                         if (key_scancode == SCAN_CODE_ESC) ExitProcess();
  552.                         break;
  553.                 case evReDraw:
  554.                         DefineDragableWindow(150, 200, 400, 368);
  555.                         GetProcessInfo(#pop_up, SelfInfo);
  556.  
  557.                         DrawBar(0, 0, pop_up.width, pop_up.height, theme.color_top_panel_bg);
  558.                         DrawRectangle(0, 0, pop_up.width, pop_up.height, theme.color_list_border);
  559.  
  560.                         DefineHiddenButton(pop_up.width - 27, 1, 26, 15, BUTTON_WINDOW_CLOSE);
  561.                         img_draw stdcall(skin.image, pop_up.width-28, 0, 28, 18, skin.w - 29, 0);
  562.                         DrawCaptButton(pop_up.width-10-80, pop_up.height - 34, 80, 24, 2,
  563.                           theme.color_list_active_bg, theme.color_top_panel_song_name, "Cool");
  564.                        
  565.                         WriteTextLines(10, 10, 0x90, theme.color_top_panel_song_name, ABOUT_MESSAGE, 19);
  566.                         DrawIcon32(10, 48, theme.color_top_panel_bg, 65);
  567.  
  568.         }
  569. }
  570.  
  571. /*
  572. struct {
  573.         char tag[4];
  574.         char title[60];
  575.         char artist[60];
  576.         char album[60];
  577.         char speed;
  578.         char genre[30];
  579.         char start_time[6];
  580.         char end_time[6];
  581. } tag11;
  582.  
  583. struct {
  584.         char tag[3];
  585.         char title[30];
  586.         char artist[30];
  587.         char album[30];
  588.         char year[4];
  589.         char comment[30];
  590.         unsigned char genre; //https://www.w3.org/People/Bos/MP3tag/mp3tag.c
  591. } tag10;
  592. */
  593.  
  594. void EventShowTagInfo()
  595. {
  596.         char item_path[4096];
  597.         sprintf(#item_path,"%s/%s",#work_folder,GetSelectedItemName());
  598.         RunProgram("/sys/media/mp3info", #item_path);
  599. }
  600.  
  601.  
  602. stop:
  603.  
  604. char menu_stak[4096];