diff --git a/CHANGELOG.md b/CHANGELOG.md index aea9228..b7614ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ # NXMP Changelog ## [0.8.2] + +### Added + +- Added initial i18n (partial) +- Error messages on network share connection failure + ### Changes - Update ImGui to last release @@ -10,7 +16,6 @@ - SubFont Color fix - ## [0.8.1] ### Fixed diff --git a/Makefile b/Makefile index bb92404..a680eda 100644 --- a/Makefile +++ b/Makefile @@ -39,9 +39,9 @@ include $(DEVKITPRO)/libnx/switch_rules #--------------------------------------------------------------------------------- TARGET := $(notdir $(CURDIR)) BUILD := build -SOURCES := source/backends source/backends/glfw3-opengl3 source/iniparser source/imgloader source/networkshareclass source/UI/textscroller source/vout source/mediaprobe libs/imgui_toggle source/fileBrowser source/logger source/stats libs/imgui libs/imgui/misc/freetype source source/updater source/curldownloader source/touchcontrols source/playlist source/shadermania source/eqpreset source/database source/UI source/remotefs/UPNP source/remotefs/nfsDir source/remotefs/smb2 source/remotefs/sshDir source/remotefs/Enigma2 source/localfs source/localfs/usb source/remotefs/ftplib source/remotefs/HTTPDir source/themes +SOURCES := source/i18n source/backends source/backends/glfw3-opengl3 source/iniparser source/imgloader source/networkshareclass source/UI/textscroller source/vout source/mediaprobe libs/imgui_toggle source/fileBrowser source/logger source/stats libs/imgui libs/imgui/misc/freetype source source/updater source/curldownloader source/touchcontrols source/playlist source/shadermania source/eqpreset source/database source/UI source/remotefs/UPNP source/remotefs/nfsDir source/remotefs/smb2 source/remotefs/sshDir source/remotefs/Enigma2 source/localfs source/localfs/usb source/remotefs/ftplib source/remotefs/HTTPDir source/themes DATA := data -INCLUDES := source/backends source/backends/glfw3-opengl3 source/iniparser source/imgloader source/networkshareclass source/UI/textscroller source/vout source/mediaprobe libs/imgui_toggle source/fileBrowser source/logger source/stats libs/simpleini libs/imgui include source/curldownloader source/updater source/touchcontrols source/playlist source/shadermania source/eqpreset source/database source/remotefs/UPNP source/remotefs/nfsDir source/remotefs/smb2 source/remotefs/sshDir source/remotefs/Enigma2 source/localfs source/localfs/usb source/remotefs/ftplib source/remotefs/HTTPDir source/themes +INCLUDES := source/i18n source/backends source/backends/glfw3-opengl3 source/iniparser source/imgloader source/networkshareclass source/UI/textscroller source/vout source/mediaprobe libs/imgui_toggle source/fileBrowser source/logger source/stats libs/simpleini libs/imgui include source/curldownloader source/updater source/touchcontrols source/playlist source/shadermania source/eqpreset source/database source/remotefs/UPNP source/remotefs/nfsDir source/remotefs/smb2 source/remotefs/sshDir source/remotefs/Enigma2 source/localfs source/localfs/usb source/remotefs/ftplib source/remotefs/HTTPDir source/themes ROMFS := romfs GITREV:= -D'GITREV="$(shell git rev-parse --short HEAD)"' diff --git a/README.md b/README.md index 96e7a48..236154e 100644 --- a/README.md +++ b/README.md @@ -91,7 +91,7 @@ Thanks to - sashka69 @ GBATemp forum for beta testing - bodyXY @ GBATemp forum for banner and icons - Godorowski @ GBATemp forum for player UI design and icons -- nWo @ GBATemp for beta testing +- Jorge E. García "nWo" for beta testing - docgold @ GBATemp forum for Enigma2 samples and support on decoders - tataniko @ GBATemp forum for suggestions and bug hunting - All guys on GBAtemp diff --git a/include/gui.h b/include/gui.h index 924890a..a3a9bc6 100644 --- a/include/gui.h +++ b/include/gui.h @@ -315,6 +315,8 @@ extern std::string themefontpath; extern float themefontsize; extern float themefontsmall; + + /* extern float swipex; extern float swipey; diff --git a/romfs/DroidSans.ttf b/romfs/DroidSans.ttf deleted file mode 100644 index ad1efca..0000000 Binary files a/romfs/DroidSans.ttf and /dev/null differ diff --git a/romfs/NotoSansCJKjp-Medium.otf b/romfs/NotoSansCJKjp-Medium.otf deleted file mode 100644 index 6cff951..0000000 Binary files a/romfs/NotoSansCJKjp-Medium.otf and /dev/null differ diff --git a/romfs/Pacifico.ttf b/romfs/Pacifico.ttf deleted file mode 100644 index 6d47cdc..0000000 Binary files a/romfs/Pacifico.ttf and /dev/null differ diff --git a/romfs/Source Han Sans CN Light.otf b/romfs/Source Han Sans CN Light.otf new file mode 100644 index 0000000..1cff8e6 Binary files /dev/null and b/romfs/Source Han Sans CN Light.otf differ diff --git a/romfs/code2000.ttf b/romfs/code2000.ttf deleted file mode 100644 index f6a95cb..0000000 Binary files a/romfs/code2000.ttf and /dev/null differ diff --git a/source/UI/UniBrowser.cpp b/source/UI/UniBrowser.cpp index a45d19e..356ac18 100644 --- a/source/UI/UniBrowser.cpp +++ b/source/UI/UniBrowser.cpp @@ -6,6 +6,7 @@ #include "localfiles.h" #include "Enigma2.h" +#include "nxmp-i18n.h" namespace Windows { @@ -56,12 +57,20 @@ namespace Windows { ImGui::SetCursorPosY( (ImGui::GetWindowHeight() - ImGui::CalcTextSize(filebrowser->errormsg.c_str()).y) / 2.f); ImGui::Text("%s",filebrowser->errormsg.c_str()); }else{ - if (ImGui::BeginTable("table1", 3,ImGuiTableFlags_RowBg)){ - ImGui::TableSetupColumn("name", ImGuiTableColumnFlags_WidthFixed, (940.0f*multiplyRes -2 * ImGui::GetStyle().ItemSpacing.x)); // Default to 100.0f - ImGui::TableSetupColumn("size", ImGuiTableColumnFlags_WidthFixed, 130.0f*multiplyRes); // Default to 200.0f - ImGui::TableSetupColumn("date", ImGuiTableColumnFlags_WidthFixed,210.f*multiplyRes); // Default to auto + if (ImGui::BeginTable("table1", 3,ImGuiTableFlags_RowBg|ImGuiTableFlags_ScrollY)){ + ImGui::TableSetupColumn("Name", ImGuiTableColumnFlags_WidthFixed, (940.0f*multiplyRes -2 * ImGui::GetStyle().ItemSpacing.x)); // Default to 100.0f + ImGui::TableSetupColumn("Size", ImGuiTableColumnFlags_WidthFixed, 125.0f*multiplyRes); // Default to 200.0f + ImGui::TableSetupColumn("Date", ImGuiTableColumnFlags_WidthFixed,215.f*multiplyRes); // Default to auto ImGui::TableSetupScrollFreeze(0, 1); - ImGui::TableHeadersRow(); + //ImGui::TableHeadersRow(); + ImGui::TableNextRow(ImGuiTableRowFlags_Headers); + ImGui::TableSetColumnIndex(0); + ImGui::Text(Common_STR[NXCOMMON_NAME]); + ImGui::TableSetColumnIndex(1); + ImGui::Text(Common_STR[NXCOMMON_SIZE]); + ImGui::TableSetColumnIndex(2); + ImGui::Text(Common_STR[NXCOMMON_DATE]); + ImGuiListClipper clipper; clipper.Begin(thislist.size()); while (clipper.Step()) @@ -183,10 +192,11 @@ namespace Windows { } } - ImGui::EndTable(); if(item.popupstate == POPUP_STATE_NONE){ ImGui::SetWindowFocus(); } + ImGui::EndTable(); + } } ImGui::EndChild(); @@ -196,7 +206,7 @@ namespace Windows { GUI::NXMPImage((void*)(intptr_t)imgloader->icons.GUI_D_DOWN.id, ImVec2(30,30)); ImGui::SameLine(); ImGui::AlignTextToFramePadding(); - ImGui::Text("Navigation"); + ImGui::Text(Common_STR[NXCOMMON_NAVIGATION]); ImGui::SameLine(); ImGui::SetCursorPosX(ImGui::GetCursorPosX()+50.0f*multiplyRes); GUI::NXMPImage((void*)(intptr_t)imgloader->icons.GUI_D_LEFT.id, ImVec2(30,30)); @@ -208,25 +218,25 @@ namespace Windows { GUI::NXMPImage((void*)(intptr_t)imgloader->icons.GUI_A_BUT.id, ImVec2(30,30)); ImGui::SameLine(); ImGui::AlignTextToFramePadding(); - ImGui::Text("Select/Play"); + ImGui::Text(Common_STR[NXCOMMON_SELECTPLAY]); ImGui::SameLine(); ImGui::SetCursorPosX(ImGui::GetCursorPosX()+50.0f*multiplyRes); GUI::NXMPImage((void*)(intptr_t)imgloader->icons.GUI_B_BUT.id, ImVec2(30,30)); ImGui::SameLine(); ImGui::AlignTextToFramePadding(); - ImGui::Text("Back"); + ImGui::Text(Common_STR[NXCOMMON_BACK]); ImGui::SameLine(); ImGui::SetCursorPosX(ImGui::GetCursorPosX()+50.0f*multiplyRes); GUI::NXMPImage((void*)(intptr_t)imgloader->icons.GUI_X_BUT.id, ImVec2(30,30)); ImGui::SameLine(); ImGui::AlignTextToFramePadding(); - ImGui::Text("Context Menu"); + ImGui::Text(Common_STR[NXCOMMON_CONTEXTMENU]); ImGui::SameLine(); ImGui::SetCursorPosX(ImGui::GetCursorPosX()+50.0f*multiplyRes); GUI::NXMPImage((void*)(intptr_t)imgloader->icons.GUI_Y_BUT.id, ImVec2(30,30)); ImGui::SameLine(); ImGui::AlignTextToFramePadding(); - ImGui::Text("NXMP Home"); + ImGui::Text(Common_STR[NXCOMMON_HOME]); ImGui::EndChild(); diff --git a/source/UI/apppopups.cpp b/source/UI/apppopups.cpp index 9dd3079..508e3f3 100644 --- a/source/UI/apppopups.cpp +++ b/source/UI/apppopups.cpp @@ -4,7 +4,7 @@ #include "imgui_internal.h" #include "utils.h" - +#include "nxmp-i18n.h" namespace Popups{ @@ -94,14 +94,14 @@ namespace Popups{ } void SaveSettingsPopup(void) { - Popups::SetupPopup("Save Settings"); + Popups::SetupPopup(Popup_STR[NXPOPUP_SAVESETTINGS]); - if (ImGui::BeginPopupModal("Save Settings", nullptr, ImGuiWindowFlags_AlwaysAutoResize)) { + if (ImGui::BeginPopupModal(Popup_STR[NXPOPUP_SAVESETTINGS], nullptr, ImGuiWindowFlags_AlwaysAutoResize)) { - ImGui::Text("Save Settings?"); + ImGui::Text("%s?",Popup_STR[NXPOPUP_SAVESETTINGS]); ImVec2 button_size(ImGui::GetFontSize() * 7.0f, 0.0f); - if (ImGui::Button("Yes", button_size)) + if (ImGui::Button(Common_STR[NXCOMMON_YES], button_size)) { item.state = MENU_STATE_HOME; item.popupstate = POPUP_STATE_NONE; @@ -112,7 +112,7 @@ namespace Popups{ } ImGui::SameLine(); - if (ImGui::Button("No", button_size)) + if (ImGui::Button(Common_STR[NXCOMMON_NO], button_size)) { configini->ReadConfig(); item.state = MENU_STATE_HOME; @@ -125,16 +125,16 @@ namespace Popups{ } void ResumePopup(void) { - Popups::SetupPopup("Resume Play"); + Popups::SetupPopup(Popup_STR[NXPOPUP_RESUMEPLAY]); - if (ImGui::BeginPopupModal("Resume Play", nullptr, ImGuiWindowFlags_AlwaysAutoResize)) { + if (ImGui::BeginPopupModal(Popup_STR[NXPOPUP_RESUMEPLAY], nullptr, ImGuiWindowFlags_AlwaysAutoResize)) { - ImGui::Text("Resume Playback?"); + ImGui::Text("%s?",Popup_STR[NXPOPUP_RESUMEPLAY]); - ImGui::Text("Resume Playback @ %s",Utility::formatTimeShort(libmpv->getFileInfo()->resume).c_str()); + ImGui::Text("%s @ %s",Popup_STR[NXPOPUP_RESUMEPLAY],Utility::formatTimeShort(libmpv->getFileInfo()->resume).c_str()); ImVec2 button_size(ImGui::GetFontSize() * 7.0f, 0.0f); - if (ImGui::Button("Yes", button_size)) + if (ImGui::Button(Common_STR[NXCOMMON_YES], button_size)) { libmpv->seek(libmpv->getFileInfo()->resume,false); item.popupstate = POPUP_STATE_NONE; @@ -142,7 +142,7 @@ namespace Popups{ } ImGui::SameLine(); - if (ImGui::Button("No", button_size)) + if (ImGui::Button(Common_STR[NXCOMMON_NO], button_size)) { @@ -369,15 +369,15 @@ namespace Popups{ //bordercolorend void DBUpdatedPopup(void) { - Popups::SetupPopup("Database Updated"); - if (ImGui::BeginPopupModal("Database Updated", nullptr, ImGuiWindowFlags_AlwaysAutoResize)) { - ImGui::Text("Database was Updated"); - ImGui::Text("DB Version: %s",sqlitedb->getDbVersion().c_str()); + Popups::SetupPopup(Popup_STR[NXPOPUP_DBUPDATED]); + if (ImGui::BeginPopupModal(Popup_STR[NXPOPUP_DBUPDATED], nullptr, ImGuiWindowFlags_AlwaysAutoResize)) { + ImGui::Text(Popup_STR[NXPOPUP_DBWASUPDATED]); + ImGui::Text("%s %s",SettingsMenu_STR[NXSET_DATABASEVERSION],sqlitedb->getDbVersion().c_str()); - if(ImGui::Button("OK",ImVec2(ImGui::GetContentRegionAvail().x,0.0f))){ + if(ImGui::Button(Common_STR[NXCOMMON_OK],ImVec2(ImGui::GetContentRegionAvail().x,0.0f))){ item.popupstate = POPUP_STATE_NONE; } - ImGui::SetFocusID(ImGui::GetID("OK"), ImGui::GetCurrentWindow()); + ImGui::SetFocusID(ImGui::GetID(Common_STR[NXCOMMON_OK]), ImGui::GetCurrentWindow()); ImGuiContext& g = *ImGui::GetCurrentContext(); g.NavDisableHighlight = false; @@ -386,9 +386,9 @@ namespace Popups{ } void NetMenuPopup(void) { - Popups::SetupPopup("Network Menu Popup"); + Popups::SetupPopup(Popup_STR[NXPOPUP_NETWORKPOPUP]); - if (ImGui::BeginPopupModal("Network Menu Popup", nullptr, ImGuiWindowFlags_AlwaysAutoResize)) { + if (ImGui::BeginPopupModal(Popup_STR[NXPOPUP_NETWORKPOPUP], nullptr, ImGuiWindowFlags_AlwaysAutoResize)) { ImGui::Text("%s",item.networksources[Windows::netwinselected].name.c_str()); @@ -396,7 +396,7 @@ namespace Popups{ if(Windows::netwinselected == 0){ ImGui::BeginDisabled(); } - if (ImGui::Button("Move Up", button_size)) + if (ImGui::Button(Common_STR[NXCOMMON_MOVEUP], button_size)) { oldnetworkSource v1 = item.networksources[Windows::netwinselected]; @@ -416,7 +416,7 @@ namespace Popups{ if(Windows::netwinselected == item.networksources.size()-1){ ImGui::BeginDisabled(); } - if (ImGui::Button("Move Down", button_size)) + if (ImGui::Button(Common_STR[NXCOMMON_MOVEDOWN], button_size)) { oldnetworkSource v1 = item.networksources[Windows::netwinselected]; oldnetworkSource v2 = item.networksources[Windows::netwinselected+1]; @@ -433,7 +433,7 @@ namespace Popups{ ImGui::PushStyleColor(ImGuiCol_Button, (ImVec4)ImColor::HSV(0.0f, 0.6f, 0.6f)); ImGui::PushStyleColor(ImGuiCol_ButtonHovered, (ImVec4)ImColor::HSV(0.0f, 0.7f, 0.7f)); ImGui::PushStyleColor(ImGuiCol_ButtonActive, (ImVec4)ImColor::HSV(0.0f, 0.8f, 0.8f)); - if (ImGui::Button("Delete", button_size)) + if (ImGui::Button(Common_STR[NXCOMMON_DELETE], button_size)) { item.networksources.erase(item.networksources.begin() + Windows::netwinselected); item.popupstate = POPUP_STATE_NONE; @@ -443,7 +443,7 @@ namespace Popups{ - if (ImGui::Button("Exit", button_size)) + if (ImGui::Button(Common_STR[NXCOMMON_EXIT], button_size)) { item.popupstate = POPUP_STATE_NONE; ImGui::CloseCurrentPopup(); @@ -455,12 +455,12 @@ namespace Popups{ void FileContextPopup(void) { - Popups::SetupPopup("File Context Menu Popup"); + Popups::SetupPopup(Popup_STR[NXPOPUP_FILEMENU]); if(FilePopupTextScroller == nullptr){ FilePopupTextScroller = new CTextScroller("##filepopuptextscroll"); } - if (ImGui::BeginPopupModal("File Context Menu Popup", nullptr, ImGuiWindowFlags_AlwaysAutoResize)) { + if (ImGui::BeginPopupModal(Popup_STR[NXPOPUP_FILEMENU], nullptr, ImGuiWindowFlags_AlwaysAutoResize)) { ImVec2 button_size(400.0f, 0.0f); std::vector selectionlist = filebrowser->getChecked(); @@ -488,13 +488,13 @@ namespace Popups{ ImGui::SetCursorPosX(ImGui::GetCursorPosX() + off); if(filebrowser->sortOrder == FS::FS_NAME_ASCENDINGORDER){ - if (ImGui::Button("Sort Descending (Name)",button_size)) + if (ImGui::Button(Popup_STR[NXPOPUP_SORTDESC_NAME],button_size)) { filebrowser->setSordOrder(FS::FS_NAME_DESCENDINGORDER); item.popupstate = POPUP_STATE_NONE; } }else{ - if (ImGui::Button("Sort Ascending (Name)",button_size)) + if (ImGui::Button(Popup_STR[NXPOPUP_SORTASC_NAME],button_size)) { filebrowser->setSordOrder(FS::FS_NAME_ASCENDINGORDER); item.popupstate = POPUP_STATE_NONE; @@ -504,13 +504,13 @@ namespace Popups{ if (off > 0.0f) ImGui::SetCursorPosX(ImGui::GetCursorPosX() + off); if(filebrowser->sortOrder == FS::FS_DATE_ASCENDINGORDER){ - if (ImGui::Button("Sort Descending (Date)",button_size)) + if (ImGui::Button(Popup_STR[NXPOPUP_SORTDESC_DATE],button_size)) { filebrowser->setSordOrder(FS::FS_DATE_DESCENDINGORDER); item.popupstate = POPUP_STATE_NONE; } }else{ - if (ImGui::Button("Sort Ascending (Date)",button_size)) + if (ImGui::Button(Popup_STR[NXPOPUP_SORTASC_DATE],button_size)) { filebrowser->setSordOrder(FS::FS_DATE_ASCENDINGORDER); item.popupstate = POPUP_STATE_NONE; @@ -520,13 +520,13 @@ namespace Popups{ if (off > 0.0f) ImGui::SetCursorPosX(ImGui::GetCursorPosX() + off); if(filebrowser->sortOrder == FS::FS_SIZE_ASCENDINGORDER){ - if (ImGui::Button("Sort Descending (Size)",button_size)) + if (ImGui::Button(Popup_STR[NXPOPUP_SORTDESC_SIZE],button_size)) { filebrowser->setSordOrder(FS::FS_SIZE_DESCENDINGORDER); item.popupstate = POPUP_STATE_NONE; } }else{ - if (ImGui::Button("Sort Ascending (Size)",button_size)) + if (ImGui::Button(Popup_STR[NXPOPUP_SORTASC_SIZE],button_size)) { filebrowser->setSordOrder(FS::FS_SIZE_ASCENDINGORDER); item.popupstate = POPUP_STATE_NONE; @@ -537,7 +537,7 @@ namespace Popups{ ImGui::SetCursorPosX(ImGui::GetCursorPosX() + off); if(selectionlist.size()!=0){ - if (ImGui::Button("Add Checked to Playlist",button_size)) + if (ImGui::Button(Popup_STR[NXPOPUP_ADDSELEPLAYLIST],button_size)) { for(int i=0;iappendFile(filebrowser->getCurrList()[item.fileHoveredidx],filebrowser->getOpenUrlPart()+filebrowser->getCurrList()[item.fileHoveredidx].path); item.popupstate = POPUP_STATE_NONE; @@ -556,7 +556,7 @@ namespace Popups{ if (off > 0.0f) ImGui::SetCursorPosX(ImGui::GetCursorPosX() + off); - if (ImGui::Button("Exit", button_size)) + if (ImGui::Button(Common_STR[NXCOMMON_EXIT], button_size)) { item.popupstate = POPUP_STATE_NONE; ImGui::CloseCurrentPopup(); @@ -600,7 +600,7 @@ namespace Popups{ if (off > 0.0f) ImGui::SetCursorPosX(ImGui::GetCursorPosX() + off); - if (ImGui::Button("Set as Starting element",button_size)) + if (ImGui::Button(Popup_STR[NXPOPUP_SETASSTARTING],button_size)) { playlist->setPlaylistIdx(item.playlistitemHighlighted); item.popupstate = POPUP_STATE_NONE; @@ -612,7 +612,7 @@ namespace Popups{ if (off > 0.0f) ImGui::SetCursorPosX(ImGui::GetCursorPosX() + off); - if (ImGui::Button("Move Up Element",button_size)) + if (ImGui::Button(Common_STR[NXCOMMON_MOVEUP],button_size)) { playlist->moveBack(item.playlistitemHighlighted); item.popupstate = POPUP_STATE_NONE; @@ -628,7 +628,7 @@ namespace Popups{ if (off > 0.0f) ImGui::SetCursorPosX(ImGui::GetCursorPosX() + off); - if (ImGui::Button("Move Down",button_size)) + if (ImGui::Button(Common_STR[NXCOMMON_MOVEDOWN],button_size)) { playlist->moveForw(item.playlistitemHighlighted); item.popupstate = POPUP_STATE_NONE; @@ -640,7 +640,7 @@ namespace Popups{ if (off > 0.0f) ImGui::SetCursorPosX(ImGui::GetCursorPosX() + off); - if (ImGui::Button("Remove Element",button_size)) + if (ImGui::Button(Popup_STR[NXPOPUP_REMOVEELEMENT],button_size)) { playlist->RemoveElement(item.playlistitemHighlighted); item.popupstate = POPUP_STATE_NONE; @@ -653,7 +653,7 @@ namespace Popups{ if (off > 0.0f) ImGui::SetCursorPosX(ImGui::GetCursorPosX() + off); - if (ImGui::Button("Clear Playlist",button_size)) + if (ImGui::Button(Popup_STR[NXPOPUP_CLEARPLAYLIST],button_size)) { playlist->clearPlaylist(); item.popupstate = POPUP_STATE_NONE; @@ -663,7 +663,7 @@ namespace Popups{ if (off > 0.0f) ImGui::SetCursorPosX(ImGui::GetCursorPosX() + off); - if (ImGui::Button("Exit", button_size)) + if (ImGui::Button(Common_STR[NXCOMMON_EXIT], button_size)) { item.popupstate = POPUP_STATE_NONE; ImGui::CloseCurrentPopup(); diff --git a/source/UI/mainMenu.cpp b/source/UI/mainMenu.cpp index c3b3203..6e09823 100644 --- a/source/UI/mainMenu.cpp +++ b/source/UI/mainMenu.cpp @@ -7,9 +7,12 @@ #include "Enigma2.h" #include "curldownloader.h" +#include "nxmp-i18n.h" + namespace Windows { - static std::vector topmenu {"Local Files","USB","Stream Url","Network","UPNP","Enigma2","Playlist","Settings","Info","Exit"}; + //static std::vector topmenu {"Local Files","USB","Stream Url","Network","UPNP","Enigma2","Playlist","Settings","Info","Exit"}; + //static std::vector topmenu {"Local Files","USB","Stream Url","Network","UPNP","Enigma2","Playlist","Settings","Info","Exit"}; void MainMenuWindow(bool *focus, bool *first_item) { @@ -28,41 +31,38 @@ namespace Windows { ImGui::TableSetupColumn("name", ImGuiTableColumnFlags_WidthStretch); // Default to 200.0f static int selected = -1; - for (unsigned int n = 0; n < topmenu.size(); n++){ + for (unsigned int n = 0; n < NX_MAINMENU_STR_NR_ITEMS; n++){ ImGui::TableNextRow(); std::string itemid = "##" + std::to_string(n); ImGui::TableSetColumnIndex(0); - if(topmenu[n] == "Local Files"){ + if(n == MM_LOCALFILES){ GUI::NXMPImage((void*)(intptr_t)imgloader->icons.SdCardTexture.id, ImVec2(50,50)); } - else if(topmenu[n] == "USB"){ + else if(n == MM_USB){ GUI::NXMPImage((void*)(intptr_t)imgloader->icons.UsbTexture.id, ImVec2(50,50)); } - else if(topmenu[n] == "Network"){ + else if(n == MM_NETWORK){ GUI::NXMPImage((void*)(intptr_t)imgloader->icons.NetworkTexture.id, ImVec2(50,50)); } - else if(topmenu[n] == "UPNP"){ + else if(n == MM_UPNP){ GUI::NXMPImage((void*)(intptr_t)imgloader->icons.UPNPTexture.id, ImVec2(50,50)); } - else if(topmenu[n] == "Enigma2"){ + else if(n == MM_ENIGMA){ GUI::NXMPImage((void*)(intptr_t)imgloader->icons.Enigma2Texture.id, ImVec2(50,50)); } - else if(topmenu[n] == "Playlist"){ + else if(n == MM_PLAYLIST){ GUI::NXMPImage((void*)(intptr_t)imgloader->icons.PlaylistTexture.id, ImVec2(50,50)); } - else if(topmenu[n] == "Stream Url"){ + else if(n == MM_STREAM){ GUI::NXMPImage((void*)(intptr_t)imgloader->icons.NetworkTexture.id, ImVec2(50,50)); } - else if(topmenu[n] == "MTP"){ - GUI::NXMPImage((void*)(intptr_t)imgloader->icons.PlaylistTexture.id, ImVec2(50,50)); - } - else if(topmenu[n] == "Info"){ + else if(n == MM_INFO){ GUI::NXMPImage((void*)(intptr_t)imgloader->icons.InfoTexture.id, ImVec2(50,50)); } - else if(topmenu[n] == "Settings"){ + else if(n == MM_SETTINGS){ GUI::NXMPImage((void*)(intptr_t)imgloader->icons.SettingsTexture.id, ImVec2(50,50)); } - else if(topmenu[n] == "Exit"){ + else if(n == MM_EXIT){ GUI::NXMPImage((void*)(intptr_t)imgloader->icons.ExitTexture.id, ImVec2(50,50)); } @@ -72,13 +72,13 @@ namespace Windows { ImGui::SetCursorPos({ImGui::GetCursorPos().x, ImGui::GetCursorPos().y + ((50*multiplyRes) - ImGui::GetFont()->FontSize) / 2}); if (ImGui::Selectable(itemid.c_str(), selected == n)){ - if(topmenu[n] == "Local Files"){ + if(n == MM_LOCALFILES){ item.state = MENU_STATE_FILEBROWSER; filebrowser = new CFileBrowser(configini->getStartPath(),playlist); filebrowser->DirList(configini->getStartPath(),true,Utility::getMediaExtensions()); item.first_item = true; } - if(topmenu[n] == "USB"){ + if(n == MM_USB){ usbInit(); if(MyUSBMount==nullptr){ MyUSBMount=new USBMounter(playlist); @@ -87,19 +87,19 @@ namespace Windows { filebrowser = new CFileBrowser("",playlist,MyUSBMount); } - if(topmenu[n] == "Network"){ + if(n == MM_NETWORK){ item.networksources.clear(); item.networksources = configini->getNetworks(); item.state = MENU_STATE_NETWORKBROWSER; item.first_item = true; } - if(topmenu[n] == "UPNP"){ + if(n == MM_UPNP){ nxupnp = new NXUPnP(); nxupnp->Discovery(); item.state = MENU_STATE_UPNPBROWSER; item.first_item = true; } - if(topmenu[n] == "Enigma2"){ + if(n == MM_ENIGMA){ enigma2 = new Enigma2(configini->getEnigma()); item.first_item = true; if(configini->getEnigma() == ""){ @@ -109,13 +109,13 @@ namespace Windows { item.state = MENU_STATE_ENIGMABROWSER; } } - if(topmenu[n] == "Settings"){ + if(n == MM_SETTINGS){ //configini->setLongSeek(configini->getLongSeek(false)); //configini->setShortSeek(configini->getShortSeek(false)); if(sqlitedb != nullptr)sqlitedb->UpdateDbStats(); item.state = MENU_STATE_SETTINGS; } - if(topmenu[n] == "Playlist"){ + if(n == MM_PLAYLIST){ item.state = MENU_STATE_PLAYLISTBROWSER; if(MediaProbe == nullptr){ MediaProbe = new CMediaProbe(playlist); @@ -123,19 +123,14 @@ namespace Windows { } } - if(topmenu[n] == "MTP"){ - item.state = MENU_STATE_MTPSERVER; - mtp = new CMTP(); - mtp->StartServer(); - } - if(topmenu[n] == "Info"){ + if(n == MM_INFO){ item.state = MENU_STATE_INFO; } - if(topmenu[n] == "Exit"){ + if(n == MM_EXIT){ renderloopdone = true; } - if(topmenu[n] == "Stream Url"){ - //i need move this, work in progress. + if(n == MM_STREAM){ + //i need move this, work in progress. std::string namefile = "Streaming from Url..."; std::string received = Utility::KeyboardCall ("Write the Url to start the streaming\n(Fembed, JKAnime, Bitly or Direct URL...)", tempKbUrl); @@ -175,7 +170,7 @@ namespace Windows { ImGui::SameLine(); //ImGui::SetCursorPos({ImGui::GetCursorPos().x, ImGui::GetCursorPos().y + ((50*multiplyRes) - ImGui::GetFont()->FontSize) / 2}); - ImGui::Text("%s",topmenu[n].c_str()); + ImGui::Text("%s",MainMenu_STR[n]); diff --git a/source/UI/networkBrowser.cpp b/source/UI/networkBrowser.cpp index d97c277..5b6f5ed 100644 --- a/source/UI/networkBrowser.cpp +++ b/source/UI/networkBrowser.cpp @@ -6,22 +6,28 @@ #include "localfiles.h" #include "Enigma2.h" +#include "nxmp-i18n.h" + namespace Windows { int netwinselected = -1; + + CFileBrowser * sharecheck = nullptr; + void ShareAddWindow(bool *focus, bool *first_item){ Windows::SetupWindow(); - if (ImGui::Begin("Add Share", nullptr, ImGuiWindowFlags_NoScrollbar|ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoCollapse|ImGuiWindowFlags_MenuBar)) { + if (ImGui::Begin(Network_STR[NXNET_ADDSHARE], nullptr, ImGuiWindowFlags_NoScrollbar|ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoCollapse|ImGuiWindowFlags_MenuBar)) { if (ImGui::BeginMenuBar()) { - ImGui::Text("Add Share Menu"); + ImGui::Text(Network_STR[NXNET_ADDSHAREMENU]); ImGui::EndMenuBar(); } + ImGui::SeparatorText(Network_STR[NXNET_SHARECONFIG]); NewNetworkShare->name = InputSwitchKeyboard("##sharename","Share Name:",NewNetworkShare->name); - ImGui::Text("Protocol: "); + ImGui::Text(Network_STR[NXNET_PROTOCOL]); ImGui::SameLine(); static const char* item_current = NULL; if (ImGui::BeginCombo("##protocombo", item_current, 0)) // The second parameter is the label previewed before opening the combo. @@ -67,29 +73,55 @@ namespace Windows { } if(NewNetworkShare->type >= 1){ - NewNetworkShare->address = InputSwitchKeyboard("##address","IP Address:",NewNetworkShare->address); + ImGui::SeparatorText(Network_STR[NXNET_CREDENTIALS]); + NewNetworkShare->address = InputSwitchKeyboard("##address",Network_STR[NXNET_ADDRESS],NewNetworkShare->address); if(NewNetworkShare->type ==3 || NewNetworkShare->type ==4){ }else{ - NewNetworkShare->port = std::stoi(InputSwitchKeyboard("##port","Port:",std::to_string(NewNetworkShare->port))); + NewNetworkShare->port = std::stoi(InputSwitchKeyboard("##port",Network_STR[NXNET_PORT],std::to_string(NewNetworkShare->port))); } ImGui::Checkbox("Anonymous", &NewNetworkShare->anon); if(!NewNetworkShare->anon){ - NewNetworkShare->username = InputSwitchKeyboard("##username","Username:",NewNetworkShare->username); - NewNetworkShare->password = InputSwitchKeyboard("##password","Password:",NewNetworkShare->password); + NewNetworkShare->username = InputSwitchKeyboard("##username",Network_STR[NXNET_USERNAME],NewNetworkShare->username); + NewNetworkShare->password = InputSwitchKeyboard("##password",Network_STR[NXNET_PASSWORD],NewNetworkShare->password); } - NewNetworkShare->remoteshare = InputSwitchKeyboard("##remoteshare","Remote Path:",NewNetworkShare->remoteshare); + ImGui::SeparatorText("Path"); + NewNetworkShare->remoteshare = InputSwitchKeyboard("##remoteshare",Network_STR[NXNET_REMOTEPATH],NewNetworkShare->remoteshare); if(NewNetworkShare->type == 3){ - ImGui::Text("Remote share on server (share not path)"); + ImGui::Text(Network_STR[NXNET_REMOTESHAREDESC]); }else if(NewNetworkShare->type == 4){ ImGui::Text("Remote export on server"); }else{ - ImGui::Text("Remote path on server example: /movie/"); + ImGui::Text(Network_STR[NXNET_REMOTEPATHDESC]); } } + if(!NewNetworkShare->isValidShare()){ + ImGui::BeginDisabled(); + } + if (ImGui::Button(Network_STR[NXNET_TESTCONNECTION])){ + if(sharecheck == nullptr){ + sharecheck = new CFileBrowser(NewNetworkShare->GenConfigLine().url,NULL,NULL); + sharecheck->DirList(sharecheck->getBasePath(),configini->getshowHidden(false),Utility::getMediaExtensions()); + }else{ + delete sharecheck; + sharecheck = new CFileBrowser(NewNetworkShare->GenConfigLine().url,NULL,NULL); + sharecheck->DirList(sharecheck->getBasePath(),configini->getshowHidden(false),Utility::getMediaExtensions()); + } + } + if(!NewNetworkShare->isValidShare()){ + ImGui::EndDisabled(); + } + if(sharecheck != nullptr){ + if(sharecheck->connected){ + ImGui::TextColored(ImVec4(0.0f,1.0f,0.0f,1.0f),Network_STR[NXNET_TESTOK]); + }else{ + ImGui::TextColored(ImVec4(1.0f,0.0f,0.0f,1.0f),Network_STR[NXNET_TESTERROR]); + ImGui::Text(sharecheck->errormsg.c_str()); + } + } ImGui::SetCursorPosX(ImGui::GetWindowSize().x/2); ImGui::SetCursorPosY(ImGui::GetWindowSize().y -50); @@ -102,7 +134,7 @@ namespace Windows { ImGui::BeginDisabled(); } - if (ImGui::Button("Save")){ + if (ImGui::Button(Common_STR[NXCOMMON_SAVE])){ configini->addNetworkShare(NewNetworkShare->GenConfigLine()); item.state = MENU_STATE_NETWORKBROWSER; } @@ -111,7 +143,7 @@ namespace Windows { } ImGui::PopStyleColor(3); ImGui::SameLine(0,50); - if (ImGui::Button("Cancel")){ + if (ImGui::Button(Common_STR[NXCOMMON_CANCEL])){ item.state = MENU_STATE_NETWORKBROWSER; } @@ -125,7 +157,7 @@ namespace Windows { void NetworkWindow(bool *focus, bool *first_item) { Windows::SetupWindow(); - if (ImGui::Begin("Network Source Selection", nullptr, ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoCollapse|ImGuiWindowFlags_MenuBar)) { + if (ImGui::Begin(Network_STR[NXNET_NETWORKSOURCESEL], nullptr, ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoCollapse|ImGuiWindowFlags_MenuBar)) { GUI::cloktimeText(ImVec2((1180.0f*multiplyRes)-ImGui::CalcTextSize(nxmpstats->currentTime).x-(10.0*multiplyRes),2.0f*multiplyRes),true,nxmpstats->currentTime); GUI::newbatteryIcon(ImVec2(1180.0f*multiplyRes,2.0f*multiplyRes),true,batteryPercent,40,20,true); @@ -135,7 +167,7 @@ namespace Windows { if(item.networkselect){ ImGui::BeginChild("##tablecontainer",ImVec2(total_w,total_h-30*multiplyRes)); - if (ImGui::BeginTable("Network Source Menu",1)){ + if (ImGui::BeginTable(Network_STR[NXNET_NETWORKSOURCEMENU],1)){ ImGui::TableSetupColumn("name", ImGuiTableColumnFlags_WidthFixed, (1280.0f*multiplyRes-2 * ImGui::GetStyle().ItemSpacing.x)*multiplyRes); // Default to 100.0f ImGui::TableNextRow(); ImGui::TableSetColumnIndex(0); @@ -143,7 +175,7 @@ namespace Windows { ImGui::SameLine(); ImGui::SetCursorPos({ImGui::GetCursorPos().x, ImGui::GetCursorPos().y + (50 - ImGui::GetFont()->FontSize) / 2}); static int selected = -1; - if (ImGui::Selectable("Add Share", selected == 0)){ + if (ImGui::Selectable(Network_STR[NXNET_ADDSHARE], selected == 0)){ NewNetworkShare = new CNetworkShare(); item.state = MENU_STATE_ADDSHARE; } @@ -228,19 +260,19 @@ namespace Windows { GUI::NXMPImage((void*)(intptr_t)imgloader->icons.GUI_D_DOWN.id, ImVec2(30,30)); ImGui::SameLine(); ImGui::AlignTextToFramePadding(); - ImGui::Text("Navigation"); + ImGui::Text(Common_STR[NXCOMMON_NAVIGATION]); ImGui::SameLine(); ImGui::SetCursorPosX(ImGui::GetCursorPosX()+50.0f*multiplyRes); GUI::NXMPImage((void*)(intptr_t)imgloader->icons.GUI_A_BUT.id, ImVec2(30,30)); ImGui::SameLine(); ImGui::AlignTextToFramePadding(); - ImGui::Text("Select"); + ImGui::Text(Common_STR[NXCOMMON_SELECT]); ImGui::SameLine(); ImGui::SetCursorPosX(ImGui::GetCursorPosX()+50.0f*multiplyRes); GUI::NXMPImage((void*)(intptr_t)imgloader->icons.GUI_Y_BUT.id, ImVec2(30,30)); ImGui::SameLine(); ImGui::AlignTextToFramePadding(); - ImGui::Text("NXMP Home"); + ImGui::Text(Common_STR[NXCOMMON_HOME]); ImGui::EndChild(); diff --git a/source/UI/playerWindows.cpp b/source/UI/playerWindows.cpp index abdec39..5d72b19 100644 --- a/source/UI/playerWindows.cpp +++ b/source/UI/playerWindows.cpp @@ -146,8 +146,6 @@ namespace playerWindows{ } } - //ImGui::Checkbox("Power Stats", &item.showstats); - //ImGui::Checkbox("Dec Stats", &item.showdecstats); const ImVec4 green(0.16f, 0.66f, 0.45f, 1.0f); const ImVec4 green_hover(0.0f, 1.0f, 0.57f, 1.0f); const ImVec4 offgreen(0.31f, 0.39f, 0.52f, 1.0f); @@ -1112,6 +1110,9 @@ namespace playerWindows{ ImGui::Text("CPU %s %s %s %s",nxmpstats->CPU_Hz_c ,nxmpstats->CPU_Usage0,nxmpstats->CPU_Usage1,nxmpstats->CPU_Usage2); ImGui::Text("GPU %s %s",nxmpstats->GPU_Hz_c ,nxmpstats->GPU_Load_c); ImGui::Text("%s",nxmpstats->Battery_c); + + ImGui::Text("%s",nxmpstats->loopstat_c); + ImGui::PopStyleColor(2); ImGui::PopStyleVar(); diff --git a/source/UI/settingsMenu.cpp b/source/UI/settingsMenu.cpp index e801fba..05e450d 100644 --- a/source/UI/settingsMenu.cpp +++ b/source/UI/settingsMenu.cpp @@ -8,6 +8,8 @@ #include "themes.h" #include "updater.h" +#include "nxmp-i18n.h" + namespace Windows { @@ -31,19 +33,19 @@ namespace Windows { if (ImGui::BeginTabBar("Settings Tab bar", 0)) { - if (ImGui::BeginTabItem("Generals")) { - ImGui::Text("File Browser"); + if (ImGui::BeginTabItem(SettingsMenu_STR[NXSET_GENERALS])) { + ImGui::Text(SettingsMenu_STR[NXSET_FILEBROWSER]); ImGui::Separator(); bool showhiddenbool = configini->getshowHidden(true); - if(ImGui::Checkbox("Show Hidden Files", &showhiddenbool)){ + if(ImGui::Checkbox(SettingsMenu_STR[NXSET_HIDDENFILES], &showhiddenbool)){ configini->setshowHidden(showhiddenbool); } - ImGui::Dummy(ImVec2(0.0f,30.0f)); - ImGui::Text("Navigation"); + ImGui::Dummy(ImVec2(0.0f,20.0f)); + ImGui::Text(SettingsMenu_STR[NXSET_NAVIGATION]); ImGui::Separator(); bool touchbool = configini->getTouchEnable(true); - if(ImGui::Checkbox("Enable Touch Controls", &touchbool)){ + if(ImGui::Checkbox(SettingsMenu_STR[NXSET_TOUCHCONTROL], &touchbool)){ configini->setTouchEnable(touchbool); if(touchbool){ ImGuiIO &io = ImGui::GetIO(); @@ -53,34 +55,65 @@ namespace Windows { io.ConfigFlags |= ImGuiConfigFlags_NoMouse; } } - ImGui::Dummy(ImVec2(0.0f,30.0f)); - ImGui::Text("OverClock"); + ImGui::Dummy(ImVec2(0.0f,20.0f)); + ImGui::Text(SettingsMenu_STR[NXSET_OVERCLOCK]); ImGui::Separator(); bool ocdefault = configini->getUseOc(true); - if(ImGui::Checkbox("OverClock at Startup", &ocdefault)){ + if(ImGui::Checkbox(SettingsMenu_STR[NXSET_OVERCLOCK_STARTUP], &ocdefault)){ configini->setUseOc(ocdefault); } - ImGui::Text("Misc (Need Restart))"); + ImGui::Dummy(ImVec2(0.0f,20.0f)); + ImGui::Text(SettingsMenu_STR[NXSET_MISC]); ImGui::Separator(); bool vsyncdefault = configini->getVSYNC(true); - if(ImGui::Checkbox("VSYNC", &vsyncdefault)){ + if(ImGui::Checkbox(SettingsMenu_STR[NXSET_VSYNC], &vsyncdefault)){ configini->setVSYNC(vsyncdefault); } + ImGui::Dummy(ImVec2(0.0f,20.0f)); + ImGui::SeparatorText("I18N"); + ImGui::PushItemWidth(300); + if (ImGui::BeginCombo(SettingsMenu_STR[NXSET_INTLANG], NXLANGNAME[configini->getInterfaceLang(true)], 0)) + { + for (int n = 0; n < NX_LANGS_NR_ITEMS; n++) + { + const bool is_selected = (configini->getInterfaceLang(true) == n); + if(!NXLANGACTIVE[n]){ + ImGui::BeginDisabled(); + } + if (ImGui::Selectable(NXLANGNAME[n], is_selected)){ + configini->setInterfaceLang(n); + InitLang((NX_LANGS)n); + } + if(!NXLANGACTIVE[n]){ + ImGui::EndDisabled(); + } + + if (is_selected) + ImGui::SetItemDefaultFocus(); + } + ImGui::EndCombo(); + } + ImGui::Text("%s translation by %s",NXLANGNAME[configini->getInterfaceLang(true)],NXLANGAUTHORS[configini->getInterfaceLang(true)]); + if(NXLANGNATIVE[configini->getInterfaceLang(true)]){ + ImGui::TextColored(ImVec4(0.0f,1.0f,0.0f,1.0f),"Translated into native language"); + }else{ + ImGui::TextColored(ImVec4(1.0f,0.7f,0.0f,1.0f),"Translated using online translator"); + } ImGui::EndTabItem(); } - if (ImGui::BeginTabItem("Player Settings")) + if (ImGui::BeginTabItem(SettingsMenu_STR[NXSET_PLAYERSETTINGS])) { - ImGui::Text("Decoder"); + ImGui::Text(SettingsMenu_STR[NXSET_DECODER]); ImGui::Separator(); bool hwdecdefault = configini->getHWDec(true); - if(ImGui::Checkbox("HW Decoder", &hwdecdefault)){ + if(ImGui::Checkbox(SettingsMenu_STR[NXSET_HWDECODER], &hwdecdefault)){ configini->setHWDec(hwdecdefault); } - ImGui::Text("Demux Cache"); + ImGui::Text(SettingsMenu_STR[NXSET_DEMUXCACHE]); ImGui::Separator(); - ImGui::Text("Demux Cache Sec"); + ImGui::Text(SettingsMenu_STR[NXSET_DEMUXCACHESEC]); ImGui::SameLine(240,spacing); ImGui::PushButtonRepeat(true); if (ImGui::ArrowButton("##demuxleft", ImGuiDir_Left)) { @@ -99,11 +132,11 @@ namespace Windows { - ImGui::Text("Audio"); + ImGui::Text(SettingsMenu_STR[NXSET_AUDIO]); ImGui::Separator(); std::vector aout_preview_value = {"SDL","Audren"}; //ImGui::BeginDisabled(); - if (ImGui::BeginCombo("Audio Output", aout_preview_value[configini->getAout(true)].c_str(), 0)) + if (ImGui::BeginCombo(SettingsMenu_STR[NXSET_AUDIOOUTPUT], aout_preview_value[configini->getAout(true)].c_str(), 0)) { for (int n = 0; n < aout_preview_value.size(); n++) { @@ -117,9 +150,9 @@ namespace Windows { ImGui::EndCombo(); } //ImGui::EndDisabled(); - ImGui::Text("Seek"); + ImGui::Text(SettingsMenu_STR[NXSET_SEEK]); ImGui::Separator(); - ImGui::Text("Short Seek Time"); + ImGui::Text(SettingsMenu_STR[NXSET_SHORTSEEK]); ImGui::SameLine(240,spacing); ImGui::PushButtonRepeat(true); if (ImGui::ArrowButton("##shortleft", ImGuiDir_Left)) { @@ -135,7 +168,7 @@ namespace Windows { ImGui::SameLine(); ImGui::Text("%d sec", configini->getShortSeek(true)); - ImGui::Text("Long Seek Time"); + ImGui::Text(SettingsMenu_STR[NXSET_LONGSEEK]); ImGui::SameLine(240,spacing); ImGui::PushButtonRepeat(true); if (ImGui::ArrowButton("##longleft", ImGuiDir_Left)) { @@ -174,10 +207,10 @@ namespace Windows { ImGui::Dummy(ImVec2(0.0f,30.0f)); - ImGui::Text("Language"); + ImGui::Text(SettingsMenu_STR[NXSET_LANG]); ImGui::Separator(); bool alangbool = configini->getUseAlang(true); - if(ImGui::Checkbox("Use Auto Audio Language", &alangbool)){ + if(ImGui::Checkbox(SettingsMenu_STR[NXSET_USEALANG], &alangbool)){ configini->setUseAlang(alangbool); } @@ -187,7 +220,7 @@ namespace Windows { const char* combo_preview_value = Utility::getLanguages()[configini->getAlang(true)].lang3.c_str(); // Pass in the preview value visible before opening the combo (it could be anything) ImGui::PushItemWidth(300); - if (ImGui::BeginCombo("Audio Language", combo_preview_value, 0)) + if (ImGui::BeginCombo(SettingsMenu_STR[NXSET_ALANG], combo_preview_value, 0)) { for (int n = 0; n < Utility::getLanguages().size(); n++) { @@ -207,7 +240,7 @@ namespace Windows { //Slang ImGui::Dummy(ImVec2(0.0f,10.0f)); bool slangbool = configini->getUseSlang(true); - if(ImGui::Checkbox("Use Auto Subtitles Language", &slangbool)){ + if(ImGui::Checkbox(SettingsMenu_STR[NXSET_USESLANG], &slangbool)){ configini->setUseSlang(slangbool); } @@ -218,7 +251,7 @@ namespace Windows { const char* combo_preview_value_2 = Utility::getLanguages()[configini->getSlang(true)].lang3.c_str(); // Pass in the preview value visible before opening the combo (it could be anything) ImGui::PushItemWidth(300); - if (ImGui::BeginCombo("Subtitles Language", combo_preview_value_2, 0)) + if (ImGui::BeginCombo(SettingsMenu_STR[NXSET_SLANG], combo_preview_value_2, 0)) { for (int n = 0; n < Utility::getLanguages().size(); n++) { @@ -236,9 +269,9 @@ namespace Windows { } //End Slang ImGui::Dummy(ImVec2(0.0f,30.0f)); - ImGui::Text("Subtitle"); + ImGui::Text(SettingsMenu_STR[NXSET_SUBTITLE]); ImGui::Separator(); - ImGui::Text("Sub Font Size"); + ImGui::Text(SettingsMenu_STR[NXSET_SUBFONTSIZE]); ImGui::SameLine(240,spacing); ImGui::PushButtonRepeat(true); if (ImGui::ArrowButton("##subsizeleft", ImGuiDir_Left)) { @@ -258,7 +291,7 @@ namespace Windows { ImGui::Dummy(ImVec2(0.0f,10.0f)); //SubFontScale - ImGui::Text("Sub Font Scale"); + ImGui::Text(SettingsMenu_STR[NXSET_SUBFONTSCALE]); ImGui::SameLine(240,spacing); ImGui::PushButtonRepeat(true); if (ImGui::ArrowButton("##subsizescaleleft", ImGuiDir_Left)) { @@ -277,12 +310,12 @@ namespace Windows { ImGui::Text("%.2f", configini->getSubFontScale(true)); ImGui::Dummy(ImVec2(0.0f,30.0f)); //endSubFontScale - ImGui::Text("Video"); + ImGui::Text(SettingsMenu_STR[NXSET_VIDEO]); ImGui::Separator(); std::vector deintmenu = {"No","Yes","Auto"}; const char* combo_deintpreview_value = deintmenu[configini->getDeinterlace(true)].c_str(); ImGui::PushItemWidth(300); - if (ImGui::BeginCombo("Deinterlace", combo_deintpreview_value, 0)) + if (ImGui::BeginCombo(SettingsMenu_STR[NXSET_VIDEODEINT], combo_deintpreview_value, 0)) { for (int n = 0; n < deintmenu.size(); n++) { @@ -300,9 +333,9 @@ namespace Windows { ImGui::PopItemWidth(); ImGui::EndTabItem(); } - if (ImGui::BeginTabItem("Database")) { + if (ImGui::BeginTabItem(SettingsMenu_STR[NXSET_DATABASE])) { bool usedbbool = configini->getDbActive(true); - if(ImGui::Checkbox("Use Database", &usedbbool)){ + if(ImGui::Checkbox(SettingsMenu_STR[NXSET_USEDATABASE], &usedbbool)){ if(sqlitedb != nullptr){ delete sqlitedb; sqlitedb = nullptr; @@ -317,22 +350,22 @@ namespace Windows { if(sqlitedb->getCorrupted()){ ImGui::TextColored(ImVec4(1.0f, 0.0f, 0.0f, 1.0f),"Database File Corrupted"); }else{ - ImGui::Text("Database File Version: "); + ImGui::Text(SettingsMenu_STR[NXSET_DATABASEVERSION]); ImGui::SameLine(); ImGui::TextColored(ImVec4(0.0f, 1.0f, 0.0f, 1.0f),sqlitedb->getDbVersion().c_str()); } - ImGui::Text("SQLite Version: "); + ImGui::Text(SettingsMenu_STR[NXSET_SQLITEVERSION]); ImGui::SameLine(); ImGui::TextColored(ImVec4(0.0f, 1.0f, 0.0f, 1.0f),sqlitedb->getSQLiteVersion().c_str()); int recnum = 0; int reccom = 0; if(sqlitedb!=nullptr)sqlitedb->GetDbStats(recnum,reccom); ImGui::SetCursorPosY(ImGui::GetCursorPosY()+30); - ImGui::Text("Resume point count: %d\n",recnum); - ImGui::Text("Completed view: %d\n",reccom); + ImGui::Text("%s%d\n",SettingsMenu_STR[NXSET_RESUMEPOINTCOUNT],recnum); + ImGui::Text("%s%d\n",SettingsMenu_STR[NXSET_COMPLETEDCOUNT],reccom); ImGui::Separator(); ImGui::SetCursorPosY(ImGui::GetCursorPosY()+50); - ImGui::Text("Start saving resume info:"); + ImGui::Text(SettingsMenu_STR[NXSET_STARTSAVINGINFO]); //ImGui::SameLine(400,spacing); ImGui::PushButtonRepeat(true); if (ImGui::ArrowButton("##resumestartleft", ImGuiDir_Left)) { @@ -349,7 +382,7 @@ namespace Windows { ImGui::Text("%d%%", configini->getResumeStartPerc(true)); - ImGui::Text("Stop saving resume info:"); + ImGui::Text(SettingsMenu_STR[NXSET_STOPSAVINGINFO]); //ImGui::SameLine(400,spacing); ImGui::PushButtonRepeat(true); if (ImGui::ArrowButton("##resumestopleft", ImGuiDir_Left)) { @@ -370,14 +403,14 @@ namespace Windows { }else{ - ImGui::Text("Database not active"); + ImGui::Text(SettingsMenu_STR[NXSET_DATABASENOTACTIVE]); } ImGui::EndTabItem(); } - if (ImGui::BeginTabItem("Touch Settings")) { + if (ImGui::BeginTabItem(SettingsMenu_STR[NXSET_TOUCHSETTINGS])) { ImGui::Text("One Finger Swipe during playback"); static int touchseekradio = configini->getPlayerSwipeSeek(true); @@ -504,69 +537,23 @@ namespace Windows { GUI::NXMPImage((void*)(intptr_t)imgloader->icons.GUI_D_DOWN.id, ImVec2(30,30)); ImGui::SameLine(); ImGui::AlignTextToFramePadding(); - ImGui::Text("Navigation"); + ImGui::Text(Common_STR[NXCOMMON_NAVIGATION]); ImGui::SameLine(); ImGui::SetCursorPosX(ImGui::GetCursorPosX()+50.0f*multiplyRes); GUI::NXMPImage((void*)(intptr_t)imgloader->icons.GUI_A_BUT.id, ImVec2(30,30)); ImGui::SameLine(); ImGui::AlignTextToFramePadding(); - ImGui::Text("Select"); + ImGui::Text(Common_STR[NXCOMMON_SELECT]); ImGui::SameLine(); ImGui::SetCursorPosX(ImGui::GetCursorPosX()+50.0f*multiplyRes); GUI::NXMPImage((void*)(intptr_t)imgloader->icons.GUI_Y_BUT.id, ImVec2(30,30)); ImGui::SameLine(); ImGui::AlignTextToFramePadding(); - ImGui::Text("NXMP Home/Save"); + ImGui::Text(Common_STR[NXCOMMON_HOMESAVE]); ImGui::EndChild(); - //ImGui::SetCursorPosX(ImGui::GetWindowSize().x/2); - //ImGui::SetCursorPosY(ImGui::GetWindowSize().y -50); - - /* - ImGui::PushStyleColor(ImGuiCol_Button, (ImVec4)ImColor::HSV(0.0f, 0.6f, 0.6f)); - ImGui::PushStyleColor(ImGuiCol_ButtonHovered, (ImVec4)ImColor::HSV(0.0f, 0.7f, 0.7f)); - ImGui::PushStyleColor(ImGuiCol_ButtonActive, (ImVec4)ImColor::HSV(0.0f, 0.8f, 0.8f)); - if (ImGui::Button("Save")){ - item.popupstate = POPUP_STATE_SAVE_SETTINGS; - } - ImGui::PopStyleColor(3); - ImGui::SameLine(0,50); - if (ImGui::Button("Cancel")){ - configini->setLongSeek(configini->getLongSeek(false)); - configini->setShortSeek(configini->getShortSeek(false)); - configini->setAlang(configini->getAlang(false)); - //Slang - configini->setSlang(configini->getSlang(false)); - //end Slang - - configini->setThemeName(configini->getThemeName(false)); - - configini->setSubFontSize(configini->getSubFontSize(false)); - configini->setSubFontScale(configini->getSubFontScale(false)); - configini->setSubFontColor(configini->getSubFontColor(false)); - //bordercolor - configini->setSubBorderColor(configini->getSubBorderColor(false)); - //endbordercolor - configini->setDbActive(configini->getDeinterlace(false)); - - - configini->setshowHidden(configini->getshowHidden(false)); - configini->setTouchEnable(configini->getTouchEnable(false)); - configini->setPlayerSwipeSeek(configini->getPlayerSwipeSeek(false)); - if(configini->getTouchEnable(false)){ - ImGuiIO &io = ImGui::GetIO(); - io.ConfigFlags &= ~ImGuiConfigFlags_NoMouse; - }else{ - ImGuiIO &io = ImGui::GetIO(); - io.ConfigFlags |= ImGuiConfigFlags_NoMouse; - } - - - item.state = MENU_STATE_HOME; - } - */ } Windows::ExitWindow(); } diff --git a/source/backends/glfw3-opengl3/imgui_impl_glfw.cpp b/source/backends/glfw3-opengl3/imgui_impl_glfw.cpp index 48bb7cc..78f6bf6 100644 --- a/source/backends/glfw3-opengl3/imgui_impl_glfw.cpp +++ b/source/backends/glfw3-opengl3/imgui_impl_glfw.cpp @@ -750,6 +750,7 @@ static void ImGui_ImplGlfw_UpdateGamepads() MAP_BUTTON(ImGuiKey_GamepadL3, GLFW_GAMEPAD_BUTTON_LEFT_THUMB, 8); MAP_BUTTON(ImGuiKey_GamepadR3, GLFW_GAMEPAD_BUTTON_RIGHT_THUMB, 9); */ + /* MAP_ANALOG(ImGuiKey_GamepadLStickLeft, GLFW_GAMEPAD_AXIS_LEFT_X, 0, -0.25f, -1.0f); MAP_ANALOG(ImGuiKey_GamepadLStickRight, GLFW_GAMEPAD_AXIS_LEFT_X, 0, +0.25f, +1.0f); MAP_ANALOG(ImGuiKey_GamepadLStickUp, GLFW_GAMEPAD_AXIS_LEFT_Y, 1, -0.25f, -1.0f); @@ -760,6 +761,14 @@ static void ImGui_ImplGlfw_UpdateGamepads() MAP_ANALOG(ImGuiKey_GamepadRStickDown, GLFW_GAMEPAD_AXIS_RIGHT_Y, 3, +0.25f, +1.0f); /* */ + MAP_ANALOG(ImGuiKey_UpArrow, GLFW_GAMEPAD_AXIS_LEFT_Y,0, -0.25f, -1.0f); + MAP_ANALOG(ImGuiKey_DownArrow, GLFW_GAMEPAD_AXIS_LEFT_Y, 1, +0.25f, +1.0f); + MAP_ANALOG(ImGuiKey_LeftArrow, GLFW_GAMEPAD_AXIS_LEFT_X,0, -0.25f, -1.0f); + MAP_ANALOG(ImGuiKey_RightArrow, GLFW_GAMEPAD_AXIS_LEFT_Y, 1, +0.25f, +1.0f); + + MAP_ANALOG(ImGuiKey_GamepadLStickUp, GLFW_GAMEPAD_AXIS_RIGHT_Y, 3, -0.25f, -1.0f); + MAP_ANALOG(ImGuiKey_GamepadLStickDown, GLFW_GAMEPAD_AXIS_RIGHT_Y, 3, +0.25f, +1.0f); + #undef MAP_BUTTON #undef MAP_ANALOG } diff --git a/source/backends/nxmp-gfx.cpp b/source/backends/nxmp-gfx.cpp index e80cd5c..6a8ed7b 100644 --- a/source/backends/nxmp-gfx.cpp +++ b/source/backends/nxmp-gfx.cpp @@ -42,6 +42,16 @@ namespace nxmpgfx{ bool B_PLUS_PRESS = false; bool B_MINUS_PRESS = false; + bool B_AX_L_UP_PRESS = false; + bool B_AX_L_DOWN_PRESS = false; + bool B_AX_L_LEFT_PRESS = false; + bool B_AX_L_RIGHT_PRESS = false; + + bool B_AX_R_UP_PRESS = false; + bool B_AX_R_DOWN_PRESS = false; + bool B_AX_R_LEFT_PRESS = false; + bool B_AX_R_RIGHT_PRESS = false; + static void errorCallback(int errorCode, const char* description) { @@ -165,7 +175,7 @@ namespace nxmpgfx{ (void) io; //io.ConfigFlags |= ImGuiConfigFlags_IsTouchScreen; io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad; - //io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; + io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; io.IniFilename = nullptr; io.MouseDrawCursor = false; @@ -270,20 +280,20 @@ namespace nxmpgfx{ } - if(state.buttons[GLFW_GAMEPAD_BUTTON_RIGHT_BUMPER] == GLFW_PRESS && !B_R_PRESS){ - ret_event = bit_set(ret_event,BUT_R); + if(state.axes[GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER] > 0.25f && !B_ZR_PRESS){ + ret_event = bit_set(ret_event,BUT_ZR); } - if(state.buttons[GLFW_GAMEPAD_BUTTON_LEFT_BUMPER] == GLFW_PRESS && !B_L_PRESS){ - ret_event = bit_set(ret_event,BUT_L); + if(state.axes[GLFW_GAMEPAD_AXIS_LEFT_TRIGGER] > 0.25f && !B_ZL_PRESS){ + ret_event = bit_set(ret_event,BUT_ZL); } - if(state.buttons[GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER] >0.25f && !B_ZR_PRESS){ - ret_event = bit_set(ret_event,BUT_ZR); + if(state.buttons[GLFW_GAMEPAD_BUTTON_RIGHT_BUMPER] == GLFW_PRESS && !B_R_PRESS){ + ret_event = bit_set(ret_event,BUT_R); } - if(state.buttons[GLFW_GAMEPAD_AXIS_LEFT_TRIGGER] >0.25f && !B_ZL_PRESS){ - ret_event = bit_set(ret_event,BUT_ZL); + if(state.buttons[GLFW_GAMEPAD_BUTTON_LEFT_BUMPER] == GLFW_PRESS && !B_L_PRESS){ + ret_event = bit_set(ret_event,BUT_L); } if(state.buttons[GLFW_GAMEPAD_BUTTON_RIGHT_THUMB] == GLFW_PRESS && !B_TR_PRESS){ @@ -302,8 +312,36 @@ namespace nxmpgfx{ ret_event = bit_set(ret_event,BUT_MINUS); } - B_ZL_PRESS = state.axes[GLFW_GAMEPAD_AXIS_LEFT_TRIGGER]>0.25f; - B_ZR_PRESS = state.axes[GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER]>0.25f; + + if(state.axes[GLFW_GAMEPAD_AXIS_LEFT_Y]<-0.25f && !B_AX_L_UP_PRESS){ + ret_event = bit_set(ret_event,B_AX_L_UP); + } + if(state.axes[GLFW_GAMEPAD_AXIS_LEFT_Y]>0.25f && !B_AX_L_DOWN_PRESS){ + ret_event = bit_set(ret_event,B_AX_L_DOWN); + } + if(state.axes[GLFW_GAMEPAD_AXIS_LEFT_X]>0.25f && !B_AX_L_RIGHT_PRESS){ + ret_event = bit_set(ret_event,B_AX_L_RIGHT); + } + if(state.axes[GLFW_GAMEPAD_AXIS_LEFT_X]<-0.25f && !B_AX_L_LEFT_PRESS){ + ret_event = bit_set(ret_event,B_AX_L_LEFT); + } + + if(state.axes[GLFW_GAMEPAD_AXIS_RIGHT_Y]>0.25f && !B_AX_R_UP_PRESS){ + ret_event = bit_set(ret_event,B_AX_R_UP); + } + if(state.axes[GLFW_GAMEPAD_AXIS_RIGHT_Y]<-0.25f && !B_AX_R_DOWN_PRESS){ + ret_event = bit_set(ret_event,B_AX_R_DOWN); + } + if(state.axes[GLFW_GAMEPAD_AXIS_RIGHT_X]>0.25f && !B_AX_R_RIGHT_PRESS){ + ret_event = bit_set(ret_event,B_AX_R_RIGHT); + } + if(state.axes[GLFW_GAMEPAD_AXIS_RIGHT_X]<-0.25f && !B_AX_R_LEFT_PRESS){ + ret_event = bit_set(ret_event,B_AX_R_LEFT); + } + + + B_ZL_PRESS = state.axes[GLFW_GAMEPAD_AXIS_LEFT_TRIGGER]>-0.75f; + B_ZR_PRESS = state.axes[GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER]>-0.75f; B_A_PRESS = state.buttons[GLFW_GAMEPAD_BUTTON_A] == GLFW_PRESS; B_X_PRESS = state.buttons[GLFW_GAMEPAD_BUTTON_X] == GLFW_PRESS; @@ -322,6 +360,20 @@ namespace nxmpgfx{ B_PLUS_PRESS = state.buttons[GLFW_GAMEPAD_BUTTON_START] == GLFW_PRESS; B_MINUS_PRESS = state.buttons[GLFW_GAMEPAD_BUTTON_BACK] == GLFW_PRESS; + + + + B_AX_L_UP_PRESS = state.axes[GLFW_GAMEPAD_AXIS_LEFT_Y]<-0.25f; + B_AX_L_DOWN_PRESS = state.axes[GLFW_GAMEPAD_AXIS_LEFT_Y]>0.25f; + B_AX_L_LEFT_PRESS = state.axes[GLFW_GAMEPAD_AXIS_LEFT_X]>0.25f; + B_AX_L_RIGHT_PRESS = state.axes[GLFW_GAMEPAD_AXIS_LEFT_X]<-0.25f; + + B_AX_R_UP_PRESS = state.axes[GLFW_GAMEPAD_AXIS_RIGHT_Y]>0.25f; + B_AX_R_DOWN_PRESS = state.axes[GLFW_GAMEPAD_AXIS_RIGHT_Y]<-0.25f; + B_AX_R_LEFT_PRESS = state.axes[GLFW_GAMEPAD_AXIS_RIGHT_X]>0.25f; + B_AX_R_RIGHT_PRESS = state.axes[GLFW_GAMEPAD_AXIS_RIGHT_X]<-0.25f; + + } diff --git a/source/backends/nxmp-gfx.h b/source/backends/nxmp-gfx.h index d326bcd..c9033ed 100644 --- a/source/backends/nxmp-gfx.h +++ b/source/backends/nxmp-gfx.h @@ -47,7 +47,18 @@ namespace nxmpgfx{ BUT_TL, BUT_PLUS, - BUT_MINUS + BUT_MINUS, + + B_AX_L_UP, + B_AX_L_DOWN, + B_AX_L_LEFT, + B_AX_L_RIGHT, + + + B_AX_R_UP, + B_AX_R_DOWN, + B_AX_R_LEFT, + B_AX_R_RIGHT, }; diff --git a/source/fileBrowser/fileBrowserClass.cpp b/source/fileBrowser/fileBrowserClass.cpp index 05c1983..6231c8e 100644 --- a/source/fileBrowser/fileBrowserClass.cpp +++ b/source/fileBrowser/fileBrowserClass.cpp @@ -67,7 +67,8 @@ errormsg = mysamba->errormsg; } if(myssh!= nullptr){ - myssh->DirList(path,showHidden,extensions); + connected = myssh->DirList(path,showHidden,extensions); + errormsg = myssh->errormsg; } if(myftp!= nullptr){ myftp->DirList(path,extensions); diff --git a/source/gui.cpp b/source/gui.cpp index aa77b83..84d8565 100644 --- a/source/gui.cpp +++ b/source/gui.cpp @@ -427,7 +427,27 @@ namespace GUI { uint64_t event_ret = nxmpgfx::Process_UI_Events(); + if(event_ret>0){ + + if(is_bit_set(event_ret,nxmpgfx::B_AX_L_UP)){ + //ImGui::PushButtonRepeat(true); + //ImGui::GetIO().AddKeyEvent(ImGuiKey_GamepadDpadUp,true); + //ImGui::PopButtonRepeat(); + } + + if(is_bit_set(event_ret,nxmpgfx::B_AX_L_DOWN)){ + //ImGui::GetIO().AddKeyEvent(ImGuiKey_GamepadDpadDown,true); + } + + if(is_bit_set(event_ret,nxmpgfx::B_AX_L_LEFT)){ + ImGui::GetIO().AddKeyEvent(ImGuiKey_GamepadDpadLeft,true); + } + + if(is_bit_set(event_ret,nxmpgfx::B_AX_L_RIGHT)){ + ImGui::GetIO().AddKeyEvent(ImGuiKey_GamepadDpadRight,true); + } + if(is_bit_set(event_ret,nxmpgfx::BUT_Y)){ if(item.state != MENU_STATE_HOME && item.state != MENU_STATE_PLAYER && item.popupstate == POPUP_STATE_NONE){ @@ -476,13 +496,13 @@ namespace GUI { } } - if (is_bit_set(event_ret,nxmpgfx::BUT_DUP)){ + if (is_bit_set(event_ret,nxmpgfx::BUT_DUP) || is_bit_set(event_ret,nxmpgfx::B_AX_L_UP)){ if(item.state == MENU_STATE_PLAYER && !item.masterlock && item.rightmenustate == PLAYER_RIGHT_MENU_PLAYER && item.popupstate == POPUP_STATE_NONE){ } } - if (is_bit_set(event_ret,nxmpgfx::BUT_DDOWN)){ + if (is_bit_set(event_ret,nxmpgfx::BUT_DDOWN) || is_bit_set(event_ret,nxmpgfx::B_AX_L_DOWN)){ if(item.state == MENU_STATE_PLAYER && !item.masterlock && item.rightmenustate == PLAYER_RIGHT_MENU_PLAYER && item.popupstate == POPUP_STATE_NONE){ if(item.playercontrolstate == PLAYER_CONTROL_STATE_NONE){ item.playercontrolstate = PLAYER_CONTROL_STATE_CONTROLS; @@ -937,9 +957,13 @@ namespace GUI { item.first_item = true; while (!renderloopdone && appletMainLoop()) { + nxmpstats->starttime = std::chrono::system_clock::now(); HandleEvents(); + nxmpstats->eventtime = std::chrono::system_clock::now(); HandleLayers(); + nxmpstats->layertime = std::chrono::system_clock::now(); HandleRender(); + nxmpstats->rendertime = std::chrono::system_clock::now(); //if(dochangethemefont){ // changeFontTheme(); // dochangethemefont = false; @@ -978,7 +1002,8 @@ namespace GUI { reinit(); } } - + nxmpstats->endtime = std::chrono::system_clock::now(); + nxmpstats->CalcDelay(); } return 0; diff --git a/source/i18n/nxmp-cn.h b/source/i18n/nxmp-cn.h new file mode 100644 index 0000000..19d8dc3 --- /dev/null +++ b/source/i18n/nxmp-cn.h @@ -0,0 +1,136 @@ +#ifndef NXMP_I18N_CN_H +#define NXMP_I18N_CN_H + +/* Default Language */ +const char *cn_i18n_author = "proconsule"; +bool cn_i18n_status = true; +bool cn_i18n_native = false; + +const char *MainMenu_STR_CN[] = { + "本地文件", + "USB", + "串流網址", + "網路", + "UPNP", + "Enigma2", + "播放清單", + "設定", + "資訊", + "出口" +}; + +const char *Common_STR_CN[] = { + "是的", + "不", + "OK", + "汽車", + "導航", + "選擇", + "選擇/表演", + "家", + "家/保存", + "後邊", + "內容選單", + "姓名", + "尺寸", + "日期", + "提升", + "下移", + "刪除", + "出口", + "取消", + "保存", +}; + + +const char *Popup_STR_CN[] = { + "Save Settings", + "Resume Play", + "Database Update", + "Database was updated", + "Network Menu Popup", + "File Context Menu Popup", + "Sort Ascending (Name)", + "Sort Ascending (Size)", + "Sort Ascending (Date)", + "Sort Descending (Name)", + "Sort Descending (Size)", + "Sort Descending (Date)", + "Add File to Playlist", + "Add Checked to Playlist", + "Remove Element", + "Clear Playlist", + "Set as starting element" +}; + +const char *SettingsMenu_STR_CN[] = { + "Generals", + "File Browser", + "Show Hidden Files", + "Navigation", + "Enable Touch Controls", + "Overclock", + "Enable Overclock on Startup", + "Misc (need restart)", + "VSYNC", + "Interface Language", + "Player Settings", + "Decoder", + "HW Decoder", + "Demux Cache", + "Demux Cache Sec", + "Audio", + "Audio Output", + "Seek", + "Short Seek", + "Long Seek", + "Language", + "Use Auto Audio Language", + "Audio Language", + "Use Auto Subtitles Language", + "Subtitles Language", + "Subtitles", + "Sub Font Size", + "Sub Font Scale", + "Video", + "Video Deinterlace", + "Database", + "Use Database", + "Database version :", + "SQLite version :", + "Resume point count: ", + "Completed view: ", + "Database not active", + "Start saving resume info:", + "Stop saving resume info:", + + "Touch Settings", +}; + +const char *Network_STR_CN[] = { + "Add Share", + "Add Share Menu", + "Share Config", + "Share Name:", + "Protocol: ", + "Credentials", + "IP Address:", + "Port:", + "Username:", + "Password:", + "Anonymous", + "Remote Path:", + "Remote path on server example: /movie/", + "Remote share on server (share not path)", + "Test Connection", + "Connection OK", + "Connection Error", + "Network Source Selection", + "Network Source Menu", +}; + + + + + +#endif \ No newline at end of file diff --git a/source/i18n/nxmp-de.h b/source/i18n/nxmp-de.h new file mode 100644 index 0000000..79ae970 --- /dev/null +++ b/source/i18n/nxmp-de.h @@ -0,0 +1,135 @@ +#ifndef NXMP_DE_H +#define NXMP_DE_H + +const char *de_i18n_author = "proconsule"; +bool de_i18n_status = true; +bool de_i18n_native = false; + + +const char *MainMenu_STR_DE[] = { + "Lokale Dateien", + "USB", + "Stream Url", + "Netzwerk", + "UPNP", + "Enigma2", + "Wiedergabeliste", + "Einstellungen", + "Die Info", + "Ausfahrt" +}; + +const char *Common_STR_DE[] = { + "Ja", + "Nein", + "OK", + "Auto", + "Navigation", + "Wählen", + "Wählen/Spielen", + "Heim", + "Heim/Speichern", + "Zurück", + "Kontextmenü", + "Name", + "Größe", + "Datum", + "Nach oben bewegen", + "Sich abwärts bewegen", + "Löschen", + "Ausfahrt", + "Cancel", + "Save", + +}; + + +const char *Popup_STR_DE[] = { + "Einstellungen speichern", + "Spiel fortsetzen", + "Datenbankaktualisierung", + "Datenbank wurde aktualisiert", + "Netzwerkmenü Popup", + "Popup des Dateikontextmenüs", + "Aufsteigend sortieren (Name)", + "Aufsteigend sortieren (Size)", + "Aufsteigend sortieren (Date)", + "Absteigend sortieren (Name)", + "Absteigend sortieren (Size)", + "Absteigend sortieren (Date)", + "Add File to Playlist", + "Add Checked to Playlist", + "Remove Element", + "Clear Playlist", + "Set as starting element" +}; + +const char *SettingsMenu_STR_DE[] = { + "Generals", + "File Browser", + "Show Hidden Files", + "Navigation", + "Enable Touch Controls", + "Overclock", + "Enable Overclock on Startup", + "Misc (need restart)", + "VSYNC", + "Interface Language", + "Player Settings", + "Decoder", + "HW Decoder", + "Demux Cache", + "Demux Cache Sec", + "Audio", + "Audio Output", + "Seek", + "Short Seek", + "Long Seek", + "Language", + "Use Auto Audio Language", + "Audio Language", + "Use Auto Subtitles Language", + "Subtitles Language", + "Subtitles", + "Sub Font Size", + "Sub Font Scale", + "Video", + "Video Deinterlace", + "Database", + "Use Database", + "Database version :", + "SQLite version :", + "Resume point count: ", + "Completed view: ", + "Database not active", + "Start saving resume info:", + "Stop saving resume info:", + + "Touch Settings", +}; + +const char *Network_STR_DE[] = { + "Add Share", + "Add Share Menu", + "Share Config", + "Share Name:", + "Protocol: ", + "Credentials", + "IP Address:", + "Port:", + "Username:", + "Password:", + "Anonymous", + "Remote Path:", + "Remote path on server example: /movie/", + "Remote share on server (share not path)", + "Test Connection", + "Connection OK", + "Connection Error", + "Network Source Selection", + "Network Source Menu", +}; + + + +#endif \ No newline at end of file diff --git a/source/i18n/nxmp-en.h b/source/i18n/nxmp-en.h new file mode 100644 index 0000000..2d22465 --- /dev/null +++ b/source/i18n/nxmp-en.h @@ -0,0 +1,136 @@ +#ifndef NXMP_I18N_EN_H +#define NXMP_I18N_EN_H + +/* Default Language */ +const char *en_i18n_author = "proconsule"; +bool en_i18n_status = true; +bool en_i18n_native = true; + +const char *MainMenu_STR_EN[] = { + "Local Files", + "USB", + "Stream Url", + "Network", + "UPNP", + "Enigma2", + "Playlist", + "Settings", + "Info", + "Exit" +}; + +const char *Common_STR_EN[] = { + "Yes", + "No", + "OK", + "Auto", + "Navigation", + "Select", + "Select/Play", + "Home", + "Home/Save", + "Back", + "Conext Menu", + "Name", + "Size", + "Date", + "Move Up", + "Move Down", + "Delete", + "Exit", + "Cancel", + "Save", +}; + + +const char *Popup_STR_EN[] = { + "Save Settings", + "Resume Play", + "Database Update", + "Database was updated", + "Network Menu Popup", + "File Context Menu Popup", + "Sort Ascending (Name)", + "Sort Ascending (Size)", + "Sort Ascending (Date)", + "Sort Descending (Name)", + "Sort Descending (Size)", + "Sort Descending (Date)", + "Add File to Playlist", + "Add Checked to Playlist", + "Remove Element", + "Clear Playlist", + "Set as starting element" +}; + +const char *SettingsMenu_STR_EN[] = { + "Generals", + "File Browser", + "Show Hidden Files", + "Navigation", + "Enable Touch Controls", + "Overclock", + "Enable Overclock on Startup", + "Misc (need restart)", + "VSYNC", + "Interface Language", + "Player Settings", + "Decoder", + "HW Decoder", + "Demux Cache", + "Demux Cache Sec", + "Audio", + "Audio Output", + "Seek", + "Short Seek", + "Long Seek", + "Language", + "Use Auto Audio Language", + "Audio Language", + "Use Auto Subtitles Language", + "Subtitles Language", + "Subtitles", + "Sub Font Size", + "Sub Font Scale", + "Video", + "Video Deinterlace", + "Database", + "Use Database", + "Database version :", + "SQLite version :", + "Resume point count: ", + "Completed view: ", + "Database not active", + "Start saving resume info:", + "Stop saving resume info:", + + "Touch Settings", +}; + +const char *Network_STR_EN[] = { + "Add Share", + "Add Share Menu", + "Share Config", + "Share Name:", + "Protocol: ", + "Credentials", + "IP Address:", + "Port:", + "Username:", + "Password:", + "Anonymous", + "Remote Path:", + "Remote path on server example: /movie/", + "Remote share on server (share not path)", + "Test Connection", + "Connection OK", + "Connection Error", + "Network Source Selection", + "Network Source Menu", +}; + + + + + +#endif \ No newline at end of file diff --git a/source/i18n/nxmp-es.h b/source/i18n/nxmp-es.h new file mode 100644 index 0000000..38ad5df --- /dev/null +++ b/source/i18n/nxmp-es.h @@ -0,0 +1,131 @@ +#ifndef NXMP_I18N_ES_H +#define NXMP_I18N_ES_H + +const char *es_i18n_author = "nWo"; +bool es_i18n_status = true; +bool es_i18n_native = true; + +const char *MainMenu_STR_ES[] = { + "Archivos Locales", + "USB", + "Stream Url", + "Network", + "UPNP", + "Enigma2", + "Playlist", + "Ajustes", + "Info", + "Salir" +}; + +const char *Common_STR_ES[] = { + "Si", + "No", + "OK", + "Auto", + "Navegacion", + "Seleccionar", + "Seleccionar/Reproducir", + "Home", + "Home/Guardar", + "Atras", + "Menu de contexto", + "Nombre", + "Tamaño", + "Fecha", + "Mover Arriba", + "Mover Abajo", + "Borrar", + "Salir", + +}; + + +const char *Popup_STR_ES[] = { + "Guardar Ajustes", + "Resumir Reproduccion", + "Actualizacion Base De Datos", + "Base De Datos Actualizada", + "Menu De Network Popup", + "File Context Menu Popup", + "Orden Ascendente (Nombre)", + "Orden Ascendente (Tamaño)", + "Orden Ascendente (Fecha)", + "Orden Descendiente (Nombre)", + "Orden Descendiente (Tamaño)", + "Orden Descendiente (Fecha)", + "Agregar Archivo A La Playlist", + "Agregar Elegidas A La Playlist", + "Remover Elemento", + "Borrar Playlist", + "Elegir Como Elemento De Inicio" +}; + +const char *SettingsMenu_STR_ES[] = { + "Generals", + "Navegador De Archivos", + "Mostrar Archivos Ocultos", + "Navegacion", + "Permitir Controles Tactiles", + "Overclock", + "Permitir Overclock Al Iniciar", + "Varios (Reseteo necesario para que tomen efecto)", + "VSYNC", + "Lenguaje De Interfaz", + "Ajustes Del Reproductor", + "Decodificador", + "Decodificador HW", + "Demux Cache", + "Demux Cache Sec", + "Audio", + "Salida De Audio", + "Adelantar", + "Adelantar Corto", + "Adelantar Largo", + "Lenguaje", + "Usar Lenguaje De Audio Automatico", + "Lenguaje De Audio", + "Usar Lenguaje Automatico De Subtitulos", + "Lenguaje De Subtitulos", + "Subtitulos", + "Tamaño De Sub", + "Escala De Sub", + "Video", + "Video Deinterlace", + "Base De Datos", + "Usar Base De Datos", + "Version De Base De Datos :", + "SQLite version :", + "Conteo De Puntos De Reanudacion: ", + "Vista Completada: ", + "Base De Datos No Activa", + "Comenzar Resumen De Informacion:", + "Detener Resumen De Informacion:", + + "Ajustes Tactiles", +}; + +const char *Network_STR_ES[] = { + "Add Share", + "Add Share Menu", + "Share Config", + "Share Name:", + "Protocol: ", + "Credentials", + "IP Address:", + "Port:", + "Username:", + "Password:", + "Anonymous", + "Remote Path:", + "Remote path on server example: /movie/", + "Remote share on server (share not path)", + "Test Connection", + "Connection OK", + "Connection Error", + "Network Source Selection", + "Network Source Menu", +}; + + +#endif \ No newline at end of file diff --git a/source/i18n/nxmp-fr.h b/source/i18n/nxmp-fr.h new file mode 100644 index 0000000..9b6bf30 --- /dev/null +++ b/source/i18n/nxmp-fr.h @@ -0,0 +1,136 @@ +#ifndef NXMP_I18N_FR_H +#define NXMP_I18N_FR_H + +/* Default Language */ +const char *fr_i18n_author = "proconsule"; +bool fr_i18n_status = false; +bool fr_i18n_native = true; + +const char *MainMenu_STR_FR[] = { + "Local Files", + "USB", + "Stream Url", + "Network", + "UPNP", + "Enigma2", + "Playlist", + "Settings", + "Info", + "Exit" +}; + +const char *Common_STR_FR[] = { + "Yes", + "No", + "OK", + "Auto", + "Navigation", + "Select", + "Select/Play", + "Home", + "Home/Save", + "Back", + "Conext Menu", + "Name", + "Size", + "Date", + "Move Up", + "Move Down", + "Delete", + "Exit", + "Cancel", + "Save", +}; + + +const char *Popup_STR_FR[] = { + "Save Settings", + "Resume Play", + "Database Update", + "Database was updated", + "Network Menu Popup", + "File Context Menu Popup", + "Sort Ascending (Name)", + "Sort Ascending (Size)", + "Sort Ascending (Date)", + "Sort Descending (Name)", + "Sort Descending (Size)", + "Sort Descending (Date)", + "Add File to Playlist", + "Add Checked to Playlist", + "Remove Element", + "Clear Playlist", + "Set as starting element" +}; + +const char *SettingsMenu_STR_FR[] = { + "Generals", + "File Browser", + "Show Hidden Files", + "Navigation", + "Enable Touch Controls", + "Overclock", + "Enable Overclock on Startup", + "Misc (need restart)", + "VSYNC", + "Interface Language", + "Player Settings", + "Decoder", + "HW Decoder", + "Demux Cache", + "Demux Cache Sec", + "Audio", + "Audio Output", + "Seek", + "Short Seek", + "Long Seek", + "Language", + "Use Auto Audio Language", + "Audio Language", + "Use Auto Subtitles Language", + "Subtitles Language", + "Subtitles", + "Sub Font Size", + "Sub Font Scale", + "Video", + "Video Deinterlace", + "Database", + "Use Database", + "Database version :", + "SQLite version :", + "Resume point count: ", + "Completed view: ", + "Database not active", + "Start saving resume info:", + "Stop saving resume info:", + + "Touch Settings", +}; + +const char *Network_STR_FR[] = { + "Add Share", + "Add Share Menu", + "Share Config", + "Share Name:", + "Protocol: ", + "Credentials", + "IP Address:", + "Port:", + "Username:", + "Password:", + "Anonymous", + "Remote Path:", + "Remote path on server example: /movie/", + "Remote share on server (share not path)", + "Test Connection", + "Connection OK", + "Connection Error", + "Network Source Selection", + "Network Source Menu", +}; + + + + + +#endif \ No newline at end of file diff --git a/source/i18n/nxmp-i18n.cpp b/source/i18n/nxmp-i18n.cpp new file mode 100644 index 0000000..7397625 --- /dev/null +++ b/source/i18n/nxmp-i18n.cpp @@ -0,0 +1,210 @@ +#include "nxmp-i18n.h" + +#include "nxmp-en.h" +#include "nxmp-it.h" +#include "nxmp-es.h" +#include "nxmp-de.h" +#include "nxmp-fr.h" +#include "nxmp-pt.h" +#include "nxmp-jp.h" +#include "nxmp-cn.h" + +char *MainMenu_STR[NX_MAINMENU_STR_NR_ITEMS]; +char *Common_STR[NX_COMMON_STR_NR_ITEMS]; +char *Popup_STR[NX_COMMON_STR_NR_ITEMS]; +char *SettingsMenu_STR[NX_SETTINGS_STR_NR_ITEMS]; +char *Network_STR[NX_NETWORK_STR_NR_ITEMS]; + +const char *NXLANGNAME[] = { + "English", + "Italiano", + "Español", + "Deutsch", + "Français", + "Português", + "日本語", + "中国人", +}; + +char *NXLANGAUTHORS[NX_LANGS_NR_ITEMS]; +bool NXLANGACTIVE[NX_LANGS_NR_ITEMS]; +bool NXLANGNATIVE[NX_LANGS_NR_ITEMS]; + +void InitLang(NX_LANGS mylang){ + + + /* Clear Previous allocs if exists */ + DestroyLang(); + + /* DUP Strings */ + NXLANGAUTHORS[English] = strdup(en_i18n_author); + NXLANGAUTHORS[Italian] = strdup(it_i18n_author); + NXLANGAUTHORS[Spanish] = strdup(es_i18n_author); + NXLANGAUTHORS[Deutsch] = strdup(de_i18n_author); + NXLANGAUTHORS[French] = strdup(fr_i18n_author); + NXLANGAUTHORS[Portuguese] = strdup(pt_i18n_author); + NXLANGAUTHORS[Japanese] = strdup(jp_i18n_author); + NXLANGAUTHORS[Chinese] = strdup(cn_i18n_author); + + + NXLANGACTIVE[English] = en_i18n_status; + NXLANGACTIVE[Italian] = it_i18n_status; + NXLANGACTIVE[Spanish] = es_i18n_status; + NXLANGACTIVE[Deutsch] = de_i18n_status; + NXLANGACTIVE[French] = fr_i18n_status; + NXLANGACTIVE[Portuguese] = pt_i18n_status; + NXLANGACTIVE[Japanese] = jp_i18n_status; + NXLANGACTIVE[Chinese] = cn_i18n_status; + + NXLANGNATIVE[English] = en_i18n_native; + NXLANGNATIVE[Italian] = it_i18n_native; + NXLANGNATIVE[Spanish] = es_i18n_native; + NXLANGNATIVE[Deutsch] = de_i18n_native; + NXLANGNATIVE[French] = fr_i18n_native; + NXLANGNATIVE[Portuguese] = pt_i18n_native; + NXLANGNATIVE[Japanese] = jp_i18n_native; + NXLANGNATIVE[Chinese] = cn_i18n_native; + + for(int i=0;i +#include +#include + +enum NX_LANGS{ + English, + Italian, + Spanish, + Deutsch, + French, + Portuguese, + Japanese, + Chinese, + NX_LANGS_NR_ITEMS +}; + +extern const char *NXLANGNAME[]; +extern char *NXLANGAUTHORS[NX_LANGS_NR_ITEMS]; +extern bool NXLANGACTIVE[NX_LANGS_NR_ITEMS]; +extern bool NXLANGNATIVE[NX_LANGS_NR_ITEMS]; + +enum NX_MAINMENU_STR{ + MM_LOCALFILES, + MM_USB, + MM_STREAM, + MM_NETWORK, + MM_UPNP, + MM_ENIGMA, + MM_PLAYLIST, + MM_SETTINGS, + MM_INFO, + MM_EXIT, + NX_MAINMENU_STR_NR_ITEMS +}; + +enum NX_COMMON_STR{ + NXCOMMON_YES, + NXCOMMON_NO, + NXCOMMON_OK, + NXCOMMON_AUTO, + NXCOMMON_NAVIGATION, + NXCOMMON_SELECT, + NXCOMMON_SELECTPLAY, + NXCOMMON_HOME, + NXCOMMON_HOMESAVE, + NXCOMMON_BACK, + NXCOMMON_CONTEXTMENU, + NXCOMMON_NAME, + NXCOMMON_SIZE, + NXCOMMON_DATE, + NXCOMMON_MOVEUP, + NXCOMMON_MOVEDOWN, + NXCOMMON_DELETE, + NXCOMMON_EXIT, + NXCOMMON_CANCEL, + NXCOMMON_SAVE, + + NX_COMMON_STR_NR_ITEMS +}; + +enum NX_POPUP_STR{ + NXPOPUP_SAVESETTINGS, + NXPOPUP_RESUMEPLAY, + NXPOPUP_DBUPDATED, + NXPOPUP_DBWASUPDATED, + NXPOPUP_NETWORKPOPUP, + NXPOPUP_FILEMENU, + NXPOPUP_SORTASC_NAME, + NXPOPUP_SORTASC_SIZE, + NXPOPUP_SORTASC_DATE, + NXPOPUP_SORTDESC_NAME, + NXPOPUP_SORTDESC_SIZE, + NXPOPUP_SORTDESC_DATE, + NXPOPUP_ADDFILEPLAYLIST, + NXPOPUP_ADDSELEPLAYLIST, + NXPOPUP_REMOVEELEMENT, + NXPOPUP_CLEARPLAYLIST, + NXPOPUP_SETASSTARTING, + + NX_POPUP_STR_NR_ITEMS +}; + + +enum NX_SETTINGS_STR{ + /* GENERAL TAB */ + NXSET_GENERALS, + NXSET_FILEBROWSER, + NXSET_HIDDENFILES, + NXSET_NAVIGATION, + NXSET_TOUCHCONTROL, + NXSET_OVERCLOCK, + NXSET_OVERCLOCK_STARTUP, + NXSET_MISC, + NXSET_VSYNC, + NXSET_INTLANG, + /* PLAYER SETTINGS TAB */ + NXSET_PLAYERSETTINGS, + NXSET_DECODER, + NXSET_HWDECODER, + NXSET_DEMUXCACHE, + NXSET_DEMUXCACHESEC, + NXSET_AUDIO, + NXSET_AUDIOOUTPUT, + NXSET_SEEK, + NXSET_SHORTSEEK, + NXSET_LONGSEEK, + NXSET_LANG, + NXSET_USEALANG, + NXSET_ALANG, + NXSET_USESLANG, + NXSET_SLANG, + NXSET_SUBTITLE, + NXSET_SUBFONTSIZE, + NXSET_SUBFONTSCALE, + NXSET_VIDEO, + NXSET_VIDEODEINT, + /* DATABASE TAB */ + NXSET_DATABASE, + NXSET_USEDATABASE, + NXSET_DATABASEVERSION, + NXSET_SQLITEVERSION, + NXSET_RESUMEPOINTCOUNT, + NXSET_COMPLETEDCOUNT, + NXSET_DATABASENOTACTIVE, + NXSET_STARTSAVINGINFO, + NXSET_STOPSAVINGINFO, + /* TOUCH SETTINGS TAB */ + NXSET_TOUCHSETTINGS, + + NX_SETTINGS_STR_NR_ITEMS +}; + + +enum NX_NETWORK_STR{ + NXNET_ADDSHARE, + NXNET_ADDSHAREMENU, + NXNET_SHARECONFIG, + NXNET_SHARENAME, + NXNET_PROTOCOL, + NXNET_CREDENTIALS, + NXNET_ADDRESS, + NXNET_PORT, + NXNET_USERNAME, + NXNET_PASSWORD, + NXNET_ANONYMOUS, + NXNET_REMOTEPATH, + NXNET_REMOTEPATHDESC, + NXNET_REMOTESHAREDESC, + NXNET_TESTCONNECTION, + NXNET_TESTOK, + NXNET_TESTERROR, + NXNET_NETWORKSOURCESEL, + NXNET_NETWORKSOURCEMENU, + + + NX_NETWORK_STR_NR_ITEMS +}; + + +extern char *MainMenu_STR[NX_MAINMENU_STR_NR_ITEMS]; +extern char *Common_STR[NX_COMMON_STR_NR_ITEMS]; +extern char *Popup_STR[NX_COMMON_STR_NR_ITEMS]; +extern char *SettingsMenu_STR[NX_SETTINGS_STR_NR_ITEMS]; +extern char *Network_STR[NX_NETWORK_STR_NR_ITEMS]; + +void InitLang(NX_LANGS mylang); +void DestroyLang(); + + + +#endif \ No newline at end of file diff --git a/source/i18n/nxmp-it.h b/source/i18n/nxmp-it.h new file mode 100644 index 0000000..5fb74d4 --- /dev/null +++ b/source/i18n/nxmp-it.h @@ -0,0 +1,133 @@ +#ifndef NXMP_I18N_IT_H +#define NXMP_I18N_IT_H + +const char *it_i18n_author = "proconsule"; +bool it_i18n_status = true; +bool it_i18n_native = true; + + +const char *MainMenu_STR_IT[] = { + "File Locali", + "USB", + "Stream Url", + "Rete", + "UPNP", + "Enigma2", + "Playlist", + "Settaggi", + "Info", + "Esci" +}; + +const char *Common_STR_IT[] = { + "Si", + "No", + "OK", + "Auto", + "Navigazione", + "Scegli", + "Scegli/Play", + "Home", + "Home/Salva", + "Indietro", + "Conext Menu", + "Nome", + "Dimensione", + "Data", + "Sposta Su", + "Sposta giu", + "Cancella", + "Esci", + "Annulla", + "Salva", + +}; + +const char *Popup_STR_IT[] = { + "Salva Settaggi", + "Riprendi Riproduzione", + "Database Aggiornato", + "Il Database è stato aggiornato", + "Network Menu Popup", + "File Context Menu Popup", + "Ordinamento Crescente (Name)", + "Ordinamento Crescente (Size)", + "Ordinamento Crescente (Date)", + "Ordinamento Decrescente (Name)", + "Ordinamento Decrescente (Size)", + "Ordinamento Decrescente (Date)", + "Aggiungi file alla Playlist", + "Aggiungi selezionati alla Playlist", + "Rimuovi Elemento", + "Pulisci Playlist", + "Setta come elemento di partenza" +}; + +const char *SettingsMenu_STR_IT[] = { + "Generali", + "File Browser", + "Mostra file nascosti", + "Navigazione", + "Abilita Controlli Touch", + "Overclock", + "Abilita Overclock all'avvio", + "Misc (richiede riavvio)", + "VSYNC", + "Lingua Interfaccia", + "Settaggi Player", + "Decoder", + "HW Decoder", + "Demux Cache", + "Demux Cache Sec", + "Audio", + "Uscita audio", + "Seek", + "Short Seek", + "Long Seek", + "Lingua", + "Use Auto Audio Language", + "Lingua Audio", + "Use Auto Subtitles Language", + "Lingua Sottotitoli", + "Sottotitoli", + "Sub Font Size", + "Sub Font Scale", + "Video", + "Video Deinterlace", + "Database", + "Usa Database", + "Database versione :", + "SQLite versione :", + "Numero di resume point: ", + "Completed view: ", + "Database non attivo", + "Inizia a salvere il resume:", + "Smetti di salvere il resume:", + "Settaggi Touch", +}; + +const char *Network_STR_IT[] = { + "Add Share", + "Add Share Menu", + "Share Config", + "Share Name:", + "Protocol: ", + "Credentials", + "IP Address:", + "Port:", + "Username:", + "Password:", + "Anonymous", + "Remote Path:", + "Remote path on server example: /movie/", + "Remote share on server (share not path)", + "Test Connection", + "Connection OK", + "Connection Error", + "Network Source Selection", + "Network Source Menu", +}; + + + +#endif \ No newline at end of file diff --git a/source/i18n/nxmp-jp.h b/source/i18n/nxmp-jp.h new file mode 100644 index 0000000..a8b9c67 --- /dev/null +++ b/source/i18n/nxmp-jp.h @@ -0,0 +1,133 @@ + +#ifndef NXMP_I18N_JP_H +#define NXMP_I18N_JP_H + +const char *jp_i18n_author = "mossan0101"; +bool jp_i18n_status = true; +bool jp_i18n_native = true; + +const char *MainMenu_STR_JP[] = { + "ローカルファイル", + "USB", + "ストリーム URL", + "ネットワーク", + "UPNP", + "Enigma2", + "プレイリスト", + "設定", + "情報", + "終了" +}; + +const char *Common_STR_JP[] = { + "はい", + "いいえ", + "OK", + "自動", + "ナビゲーション", + "セレクト", + "セレクト/再生", + "ホーム", + "ホーム/保存", + "もどる", + "コンテキストメニュー", + "名前", + "サイズ", + "日付時刻", + "上に移動", + "下に移動", + "削除", + "とじる", + "キャンセル", + "保存", +}; + + +const char *Popup_STR_JP[] = { + "設定を保存する", + "再生を再開する", + "データベースの更新", + "データベースが更新されました", + "ネットワークメニューポップアップ", + "ファイルコンテキストメニューポップアップ", + "昇順で並べ替える (名前)", + "昇順で並べ替える (サイズ)", + "昇順で並べ替える (日付時刻)", + "降順で並べ替える (名前)", + "降順で並べ替える (サイズ)", + "降順で並べ替える (日付時刻)", + "ファイルをプレイリストに追加", + "選択したものをプレイリストに追加", + "要素の削除", + "プレイリストをクリアする", + "開始要素として設定" +}; + +const char *SettingsMenu_STR_JP[] = { + "一般設定", + "ファイルブラウザー", + "隠しファイルを表示する", + "ナビゲーション", + "タッチコントロールを有効にする", + "オーバークロック", + "起動時にオーバークロックを有効にする", + "その他 (再起動が必要)", + "VSYNC", + "インターフェース言語", + "プレーヤー設定", + "デコーダー", + "HW デコーダー", + "Demux Cache", + "Demux Cache Sec", + "オーディオ", + "オーディオ出力", + "シーク", + "Short シーク", + "Long シーク", + "言語", + "自動で音声を切り替える", + "音声言語", + "自動で字幕を切り替える", + "字幕言語", + "字幕", + "字幕のフォントサイズ", + "字幕のフォントスケール", + "ビデオ", + "デインターレース", + "データベース", + "データベースを使用する", + "データベースのバージョン:", + "SQLite のバージョン:", + "再開ポイント数: ", + "完了したビュー: ", + "データベースがアクティブではありません", + "再開情報の保存を開始する:", + "再開情報の保存を停止する:", + + "タッチ設定", +}; + +const char *Network_STR_JP[] = { + "共有を追加", + "共有メニューを追加", + "構成を共有する", + "共有名:", + "プロトコル: ", + "資格", + "IP アドレス:", + "ポート: ", + "ユーザー名:", + "パスワード:", + "匿名", + "リモートパス: ", + "サーバー上のリモートパスの例: /movie/", + "サーバー上のリモート共有 (パスではなく共有)", + "接続テスト", + "接続 OK", + "接続エラー", + "ネットワークソースの選択", + "ネットワークソースメニュー", +}; + + +#endif \ No newline at end of file diff --git a/source/i18n/nxmp-pt.h b/source/i18n/nxmp-pt.h new file mode 100644 index 0000000..9a0361e --- /dev/null +++ b/source/i18n/nxmp-pt.h @@ -0,0 +1,136 @@ +#ifndef NXMP_I18N_PT_H +#define NXMP_I18N_PT_H + +/* Default Language */ +const char *pt_i18n_author = "proconsule"; +bool pt_i18n_status = false; +bool pt_i18n_native = true; + +const char *MainMenu_STR_PT[] = { + "Local Files", + "USB", + "Stream Url", + "Network", + "UPNP", + "Enigma2", + "Playlist", + "Settings", + "Info", + "Exit" +}; + +const char *Common_STR_PT[] = { + "Yes", + "No", + "OK", + "Auto", + "Navigation", + "Select", + "Select/Play", + "Home", + "Home/Save", + "Back", + "Conext Menu", + "Name", + "Size", + "Date", + "Move Up", + "Move Down", + "Delete", + "Exit", + "Cancel", + "Save", +}; + + +const char *Popup_STR_PT[] = { + "Save Settings", + "Resume Play", + "Database Update", + "Database was updated", + "Network Menu Popup", + "File Context Menu Popup", + "Sort Ascending (Name)", + "Sort Ascending (Size)", + "Sort Ascending (Date)", + "Sort Descending (Name)", + "Sort Descending (Size)", + "Sort Descending (Date)", + "Add File to Playlist", + "Add Checked to Playlist", + "Remove Element", + "Clear Playlist", + "Set as starting element" +}; + +const char *SettingsMenu_STR_PT[] = { + "Generals", + "File Browser", + "Show Hidden Files", + "Navigation", + "Enable Touch Controls", + "Overclock", + "Enable Overclock on Startup", + "Misc (need restart)", + "VSYNC", + "Interface Language", + "Player Settings", + "Decoder", + "HW Decoder", + "Demux Cache", + "Demux Cache Sec", + "Audio", + "Audio Output", + "Seek", + "Short Seek", + "Long Seek", + "Language", + "Use Auto Audio Language", + "Audio Language", + "Use Auto Subtitles Language", + "Subtitles Language", + "Subtitles", + "Sub Font Size", + "Sub Font Scale", + "Video", + "Video Deinterlace", + "Database", + "Use Database", + "Database version :", + "SQLite version :", + "Resume point count: ", + "Completed view: ", + "Database not active", + "Start saving resume info:", + "Stop saving resume info:", + + "Touch Settings", +}; + +const char *Network_STR_PT[] = { + "Add Share", + "Add Share Menu", + "Share Config", + "Share Name:", + "Protocol: ", + "Credentials", + "IP Address:", + "Port:", + "Username:", + "Password:", + "Anonymous", + "Remote Path:", + "Remote path on server example: /movie/", + "Remote share on server (share not path)", + "Test Connection", + "Connection OK", + "Connection Error", + "Network Source Selection", + "Network Source Menu", +}; + + + + + +#endif \ No newline at end of file diff --git a/source/iniparser/iniparser.cpp b/source/iniparser/iniparser.cpp index c46e540..93ce5fe 100644 --- a/source/iniparser/iniparser.cpp +++ b/source/iniparser/iniparser.cpp @@ -6,6 +6,8 @@ #include #include +#include "nxmp-i18n.h" + bool string_to_bool(std::string boolstring){ if(boolstring == "true"){ @@ -213,6 +215,19 @@ void CIniParser::setSlang(int lang){ } //end Slang +int CIniParser::getInterfaceLang(bool tmpvalue){ + if(tmpvalue){ + return nxmptmpconfig.intlang; + } + return nxmpconfig.intlang; +} + +void CIniParser::setInterfaceLang(int lang){ + isModified = true; + nxmptmpconfig.intlang = lang; +} + + bool CIniParser::getUseOc(bool tmpvalue){ if(tmpvalue){ return nxmptmpconfig.useoc; @@ -526,6 +541,9 @@ void CIniParser::ReadConfig(){ if(inidata["Main"].has("slang")){ nxmpconfig.slang = Utility::getLanguagesIdx(inidata.get("Main").get("slang")); } + if(inidata["Main"].has("intlang")){ + nxmpconfig.intlang = string_to_int(inidata.get("Main").get("intlang")); + } if(inidata["Main"].has("subfontsize")){ nxmpconfig.subfontsize = string_to_int(inidata.get("Main").get("subfontsize")); } @@ -584,6 +602,7 @@ void CIniParser::ReadConfig(){ nxmpconfig.e2addr = inidata.get("Enigma2").get("e2address"); } + InitLang((NX_LANGS)nxmpconfig.intlang); } @@ -616,6 +635,7 @@ void CIniParser::saveSettings(){ {"alang", Utility::getLanguages()[nxmpconfig.alang].lang3}, {"useslang", bool_to_string(nxmpconfig.useslang)}, {"slang",Utility::getLanguages()[nxmpconfig.slang].lang3}, + {"intlang",int_to_string(nxmpconfig.intlang)}, {"subfontsize", int_to_string(nxmpconfig.subfontsize)}, {"subfontscale", float_to_string(nxmpconfig.subfontscale)}, {"subfontcolor", getSubFontColorHex(true)}, diff --git a/source/iniparser/iniparser.h b/source/iniparser/iniparser.h index 5bcbd46..9a1e01b 100644 --- a/source/iniparser/iniparser.h +++ b/source/iniparser/iniparser.h @@ -19,6 +19,7 @@ typedef struct{ int alang = 0; bool useslang = false; int slang = 0; + int intlang = 0; bool useoc = false; bool hwdec = true; bool vsync = true; @@ -95,6 +96,9 @@ class CIniParser{ int getSubFontSize(bool tmpvalue); void setSubFontSize(int val); + + int getInterfaceLang(bool tmpvalue); + void setInterfaceLang(int lang); //subscale float getSubFontScale(bool tmpvalue); diff --git a/source/main.cpp b/source/main.cpp index 884d951..6f3c5db 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -23,7 +23,7 @@ #include "NX-UPNP.h" #include "nfsDir.h" - +#include "nxmp-i18n.h" #include "imgui.h" @@ -306,6 +306,8 @@ int main() { configini->PrintConfig(); } + + eqpreset = new EQPreset("eqpresets.ini"); playlist = new Playlist(); diff --git a/source/remotefs/nfsDir/nfsDir.cpp b/source/remotefs/nfsDir/nfsDir.cpp index f8737bb..36dfced 100644 --- a/source/remotefs/nfsDir/nfsDir.cpp +++ b/source/remotefs/nfsDir/nfsDir.cpp @@ -27,7 +27,7 @@ nfsDir::nfsDir(std::string _url,Playlist * _playlist){ } -void nfsDir::DirList(std::string _path,bool showHidden,const std::vector &extensions){ +bool nfsDir::DirList(std::string _path,bool showHidden,const std::vector &extensions){ struct nfs_context *nfs = NULL; struct client client; struct nfs_url *_url = NULL; @@ -42,13 +42,18 @@ void nfsDir::DirList(std::string _path,bool showHidden,const std::vector &extensions); + bool DirList(std::string path,bool showHidden,const std::vector &extensions); std::vector getCurrList(); void backDir(); @@ -28,6 +28,8 @@ class nfsDir{ void SetFileDbStatus(int idx,int dbstatus); void ResetDbStatus(); + std::string errormsg = ""; + private: std::vector currentlist; std::string url; diff --git a/source/remotefs/sshDir/sshDir.cpp b/source/remotefs/sshDir/sshDir.cpp index adbc1b4..1edc03b 100644 --- a/source/remotefs/sshDir/sshDir.cpp +++ b/source/remotefs/sshDir/sshDir.cpp @@ -21,7 +21,7 @@ sshDir::sshDir(std::string _url,Playlist * _playlist){ } -void sshDir::DirList(std::string path,bool showHidden,const std::vector &extensions){ +bool sshDir::DirList(std::string path,bool showHidden,const std::vector &extensions){ int rc, sock; struct sockaddr_in sin; //const char *fingerprint; @@ -37,6 +37,8 @@ void sshDir::DirList(std::string path,bool showHidden,const std::vector &extensions); + bool DirList(std::string path,bool showHidden,const std::vector &extensions); std::vector getCurrList(); void backDir(); @@ -30,6 +30,8 @@ class sshDir{ void SetFileDbStatus(int idx,int dbstatus); void ResetDbStatus(); + std::string errormsg = ""; + private: std::vector currentlist; std::string url; diff --git a/source/stats/stats.cpp b/source/stats/stats.cpp index 2b7b87b..c459315 100644 --- a/source/stats/stats.cpp +++ b/source/stats/stats.cpp @@ -43,6 +43,17 @@ CStats::~CStats(){ nvExit(); } +void CStats::CalcDelay(){ + auto myeventdelay = std::chrono::duration_cast(eventtime - starttime); + auto mylayerdelay = std::chrono::duration_cast(layertime - eventtime); + auto myrenderdelay = std::chrono::duration_cast(rendertime - layertime); + + event_time_delay = myeventdelay.count(); + layer_time_delay = mylayerdelay.count(); + render_time_delay = myrenderdelay.count(); +} + + void CheckCore0(void *arg) { CStats * ctx = (CStats *)arg; while (!ctx->threadexit) { @@ -257,6 +268,9 @@ void CStats::UpdateStats(){ int year = timeStruct->tm_year +1900; int wday = timeStruct->tm_wday; sprintf(currentTime,"%02i:%02i", hours, minutes); + + sprintf(loopstat_c,"Event time: %.3f Layer time: %.3f Render Time: %.3f",event_time_delay/1000.0,layer_time_delay/1000.0,render_time_delay/1000.0); + } void BatteryChecker(void*arg) { diff --git a/source/stats/stats.h b/source/stats/stats.h index ef959ef..cb9a402 100644 --- a/source/stats/stats.h +++ b/source/stats/stats.h @@ -3,6 +3,7 @@ #include #include +#include #include "max17050.h" #include "logger.h" @@ -103,6 +104,8 @@ class CStats{ void StartThreads(); void CloseThreads(); void UpdateStats(); + void CalcDelay(); + bool threadexit=false; @@ -207,6 +210,20 @@ class CStats{ char currentTime[32]; + + + char loopstat_c[320]; + std::chrono::time_point starttime; + std::chrono::time_point eventtime; + std::chrono::time_point layertime; + std::chrono::time_point rendertime; + std::chrono::time_point endtime; + + int event_time_delay; + int layer_time_delay; + int render_time_delay; + + }; diff --git a/source/utils.cpp b/source/utils.cpp index c2e573a..6f3ff0e 100644 --- a/source/utils.cpp +++ b/source/utils.cpp @@ -603,7 +603,18 @@ void Utility::FontLoader(std::string fontpath,float fontSize,ImGuiIO &io){ io.Fonts->AddFontFromFileTTF("romfs:/DejaVuSans.ttf", fontSize, &font_cfg, io.Fonts->GetGlyphRangesCyrillic()); font_cfg.MergeMode = true; - io.Fonts->AddFontFromFileTTF("romfs:/NotoSansCJKjp-Medium.otf", fontSize, &font_cfg, io.Fonts->GetGlyphRangesJapanese()); + //io.Fonts->AddFontFromFileTTF("romfs:/Source Han Sans CN Light.otf", fontSize, &font_cfg, io.Fonts->GetGlyphRangesJapanese()); + //io.Fonts->AddFontFromFileTTF("romfs:/Source Han Sans CN Light.otf", fontSize, &font_cfg, io.Fonts->GetGlyphRangesChineseFull()); + + static ImFontGlyphRangesBuilder range; + range.Clear(); + static ImVector gr; + gr.clear(); + range.AddRanges(ImGui::GetIO().Fonts->GetGlyphRangesChineseFull()); + range.AddRanges(ImGui::GetIO().Fonts->GetGlyphRangesJapanese()); + range.BuildRanges(&gr); + io.Fonts->AddFontFromFileTTF("romfs:/Source Han Sans CN Light.otf", fontSize, &font_cfg, gr.Data); + io.Fonts->Flags |= ImFontAtlasFlags_NoPowerOfTwoHeight;