diff --git a/data/common/File Managers/icons.ini b/data/common/File Managers/icons.ini index ce2b23893..9d36f065c 100644 --- a/data/common/File Managers/icons.ini +++ b/data/common/File Managers/icons.ini @@ -140,6 +140,7 @@ eml=13 lif=14 3ds=15 asc=15 +vox=15 kex=16 skn=17 obj=18 diff --git a/data/common/icons16.png b/data/common/icons16.png index 6bee78126..a93a3cc5c 100644 Binary files a/data/common/icons16.png and b/data/common/icons16.png differ diff --git a/programs/cmm/lib/kolibri.h b/programs/cmm/lib/kolibri.h index 2d84dc395..3483afe2b 100644 --- a/programs/cmm/lib/kolibri.h +++ b/programs/cmm/lib/kolibri.h @@ -713,7 +713,6 @@ void ______INIT______() screen.width = GetScreenWidth()+1; screen.height = GetScreenHeight()+1; - DOUBLE_CLICK_DELAY = GetMouseDoubleClickDelay(); __generator = GetStartTime(); mem_init(); diff --git a/programs/cmm/lib/mouse.h b/programs/cmm/lib/mouse.h index 38b0fcc26..64d6d8986 100644 --- a/programs/cmm/lib/mouse.h +++ b/programs/cmm/lib/mouse.h @@ -25,13 +25,11 @@ * drag - drag the element event */ -:dword __TMP_TIME,DOUBLE_CLICK_DELAY; :struct MOUSE { signed x,y,xx,yy,lkm,mkm,pkm,key,tmp,tmp_time,hor,vert,down,up,move,click,dblclick,drag,left,top; dword handle,_; byte cmd; - void clearTime(); void get(); void set(); void center(); @@ -39,10 +37,7 @@ void slider(); void show(); } mouse; -:void MOUSE::clearTime() -{ - tmp_time = GetStartTime()+DOUBLE_CLICK_DELAY; -} + :void MOUSE::show() { if(!handle)return; @@ -147,13 +142,12 @@ down = false; drag = false; if(!move) click = true; - __TMP_TIME = GetStartTime(); - if(__TMP_TIME-tmp_time<=DOUBLE_CLICK_DELAY) + if(GetStartTime()-GetMouseDoubleClickDelay()<=tmp_time) { dblclick = true; click = false; } - tmp_time = __TMP_TIME; + tmp_time = GetStartTime(); //returns the key code key = tmp; lkm = 1&tmp; diff --git a/programs/cmm/mblocks/compile_en.bat b/programs/cmm/mblocks/compile_en.bat index 0d518f315..ea4b03bfe 100644 --- a/programs/cmm/mblocks/compile_en.bat +++ b/programs/cmm/mblocks/compile_en.bat @@ -2,7 +2,7 @@ @echo #define LANG_ENG 1 >lang.h-- @c-- mblocks.c -@del mblocks.kex +@del mblocks @rename mblocks.com mblocks @del warning.txt @del lang.h-- diff --git a/programs/cmm/pixie2/pixie.c b/programs/cmm/pixie2/pixie.c index 8a8b35e3d..759c13230 100644 --- a/programs/cmm/pixie2/pixie.c +++ b/programs/cmm/pixie2/pixie.c @@ -13,15 +13,16 @@ #include "../lib/file_system.h" #include "../lib/list_box.h" #include "../lib/gui.h" +#include "../lib/kfont.h" +#include "../lib/collection.h" -#include "../lib/obj/box_lib.h" #include "../lib/obj/libio.h" #include "../lib/obj/libimg.h" #include "../lib/obj/libini.h" +#include "../lib/obj/proc_lib.h" +#include "../lib/obj/box_lib.h" #include "../lib/patterns/libimg_load_skin.h" - -#include "../lib/obj/proc_lib.h" #include "../lib/patterns/simple_open_dialog.h" //===================================================// @@ -34,7 +35,7 @@ char default_dir[] = "/rd/1"; od_filter filter2 = { 8, "MP3\0\0" }; -#define ABOUT_MESSAGE "'Pixies Player v2.4 +#define ABOUT_MESSAGE "'Pixies Player v2.5 A tiny MP3 folder player. Controls: @@ -85,6 +86,8 @@ enum { PLAYBACK_MODE_PLAYING }; +collection music_col; + //===================================================// // // // CODE // @@ -101,7 +104,7 @@ void LoadLibraries() load_dll(libimg, #libimg_init,1); load_dll(libini, #lib_init,1); load_dll(Proc_lib, #OpenDialog_init,0); - OpenDialog_init stdcall (#o_dialog); + OpenDialog_init stdcall (#o_dialog); } void main() @@ -113,7 +116,8 @@ void main() if (!param) notify("'Pixie Player\nPress O key to open MP3 file' -St"); LoadLibraries(); LoadIniConfig(); - SetEventMask(0100111b); + kfont.init(DEFAULT_FONT); + SetEventMask(EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE + EVM_MOUSE_FILTER); loop() { WaitEventTimeout(10); @@ -185,11 +189,12 @@ void DrawPlayList() int i; int yyy; char temp_filename[4096]; + dword text_color, bg_color; for (i=0; i47) strcpy(#temp_filename+44, "..."); + //temp_filename[strlen(#temp_filename)-4] = '\0'; + //if (strlen(#temp_filename)>47) strcpy(#temp_filename+44, "..."); yyy = i*list.item_h+list.y; @@ -197,22 +202,23 @@ void DrawPlayList() if (list.cur_y - list.first == i) { if (i>=list.count) continue; - DrawBar(list.x, yyy, list.w, list.item_h, theme.color_list_active_bg); - WriteText(12,yyy+list.text_y,list.font_type, theme.color_list_active_text, #temp_filename); + bg_color = theme.color_list_active_bg; + text_color = theme.color_list_text; } //this is not selected file else { if (i>=list.count) continue; - DrawBar(list.x,yyy,list.w, list.item_h, theme.color_list_bg); - WriteText(12,yyy+list.text_y,list.font_type, theme.color_list_text, #temp_filename); + bg_color = theme.color_list_bg; + text_color = theme.color_list_text; } //this is cur_y playing file if (i + list.first == current_playing_file_n) && (playback_mode == PLAYBACK_MODE_PLAYING) { - WriteText(3, yyy+list.text_y+3,0x80, theme.color_list_active_pointer, "\x10"); - WriteText(12,yyy+list.text_y,list.font_type, theme.color_list_active_text, #temp_filename); + text_color = theme.color_list_active_text; } + DrawBar(list.x, yyy, list.w, list.item_h, bg_color); + kfont.WriteIntoWindow(12, yyy+list.text_y, bg_color, text_color, 11, #temp_filename); } DrawBar(list.x,list.visible * list.item_h + list.y, list.w, -list.visible * list.item_h + list.h, theme.color_list_bg); DrawScroller(); @@ -234,8 +240,8 @@ dword GetSongTitle() { char cur_y_playing_title[245]; strcpy(#cur_y_playing_title, #current_filename); - cur_y_playing_title[strlen(#cur_y_playing_title)-4] = '\0'; - if (strlen(#cur_y_playing_title) > 36) strcpy(#cur_y_playing_title + 34, "..."); + //cur_y_playing_title[strlen(#cur_y_playing_title)-4] = '\0'; + //if (strlen(#cur_y_playing_title) > 36) strcpy(#cur_y_playing_title + 34, "..."); return #cur_y_playing_title; } @@ -247,16 +253,16 @@ void DrawTopPanel() //Mode depended if (window_mode == WINDOW_MODE_NORMAL) { - button_y = 47; + button_y = 46; img_draw stdcall(skin.image, 0, 0, skin.w, skin.h, 0, 0); - if (playback_mode != PLAYBACK_MODE_STOPED) img_draw stdcall(skin.image, 38, button_y, 33, 17, skin.w+1, WIN_H_SMALL+1); + if (playback_mode != PLAYBACK_MODE_STOPED) img_draw stdcall(skin.image, 40, button_y, 35, 19, skin.w+1, WIN_H_SMALL+1); if /*(!list.count) && */ (!work_folder) DrawPixieTitle("Pixie"); else DrawPixieTitle(#work_folder + strrchr(#work_folder, '/')); - WriteText(10, 26, list.font_type, theme.color_top_panel_song_name, GetSongTitle()); + kfont.WriteIntoWindow(10, 26, theme.color_top_panel_bg, theme.color_top_panel_song_name, 11, GetSongTitle()); //Playing control buttons - DefineHiddenButton(7, button_y, 30, 16, BUTTON_PLAYBACK_PREV); - DefineHiddenButton(39, button_y, 30, 16, BUTTON_PLAYBACK_PLAY_PAUSE); - DefineHiddenButton(71, button_y, 30, 16, BUTTON_PLAYBACK_NEXT); + DefineHiddenButton(7, button_y, 32, 18, BUTTON_PLAYBACK_PREV); + DefineHiddenButton(41, button_y, 32, 18, BUTTON_PLAYBACK_PLAY_PAUSE); + DefineHiddenButton(75, button_y, 32, 18, BUTTON_PLAYBACK_NEXT); //Window control buttons DefineHiddenButton(Form.width - 21, 1, 20, 13, BUTTON_WINDOW_CLOSE); DefineHiddenButton(Form.width - 43, 1, 20, 13, BUTTON_WINDOW_MINIMIZE); @@ -295,7 +301,9 @@ void DrawScroller() void DrawPixieTitle(dword _title) { - WriteTextB(10, 6, list.font_type, theme.color_top_panel_folder_name, _title); + kfont.bold = true; + kfont.WriteIntoWindow(10, 6, theme.color_top_panel_bg, theme.color_top_panel_folder_name, 12, _title); + kfont.bold = false; } //===================================================// @@ -349,8 +357,8 @@ void EventStartPlayingMp3() char item_path[4096]; char notify_message[512]; EventStopPlayingMp3(); - if (current_playing_file_n > list.count) { - current_playing_file_n = list.count; + if (current_playing_file_n >= list.count) { + current_playing_file_n = list.count-1; return; } if (current_playing_file_n < 0) { @@ -362,7 +370,7 @@ void EventStartPlayingMp3() sprintf(#item_path,"-h %s/%s",#work_folder,#current_filename); DrawPlayList(); DrawTopPanel(); - if (strcmpi(#item_path+strlen(#item_path)-3,".mp3")) player_run_id = RunProgram("/sys/media/ac97snd", #item_path); + player_run_id = RunProgram("/sys/media/ac97snd", #item_path); sprintf(#notify_message,"'Now playing:\n%s' -St",#current_filename); for (i=2; i