diff --git a/README.md b/README.md index 3c98145..21564be 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,29 @@ NXMP support most popular video format , it support HTTP and FTP streaming and i Installation ---- +Edit config.ini +``` +[Main] + +[Network] + +[Enigma2] +``` + +Netowrk have syntax + +``` +[Network] +source=TESTFtp|ftp://user:pass@192.168.1.10:21/path/ +source=TestHTTP|http://192.168.1.10/path/ +``` + +Eningma2 have syntax +``` +[Enigma2] +e2address=http://192.168.1.10/ +``` + Copy "nxmp" folder to switch sdcard (/switch/nxmp) Usage diff --git a/include/gui.h b/include/gui.h index 8e094c0..17f3137 100644 --- a/include/gui.h +++ b/include/gui.h @@ -32,7 +32,7 @@ typedef struct { MENU_STATES state = MENU_STATE_HOME; MENU_STATES laststate = MENU_STATE_FILEBROWSER; int selected = 0; - std::string localpath = "/"; + std::string localpath = "/switch/nxmp"; std::string enigma2bouquet = ""; std::vector localfileentries; std::vector networksources; diff --git a/source/UI/filebrowser.cpp b/source/UI/filebrowser.cpp index f7e9a23..ff94ea4 100644 --- a/source/UI/filebrowser.cpp +++ b/source/UI/filebrowser.cpp @@ -19,7 +19,7 @@ namespace Windows { *focus = true; } if (ImGui::BeginMenuBar()) { - ImGui::TextUnformatted("current path: %s",item.localpath.c_str()); + ImGui::Text("current path: %s",item.localpath.c_str()); ImGui::EndMenuBar(); } if (ImGui::BeginListBox("File Browser Menu",ImVec2(1280.0f, 720.0f))){ diff --git a/source/UI/mainMenu.cpp b/source/UI/mainMenu.cpp index ebd5c2f..398d641 100644 --- a/source/UI/mainMenu.cpp +++ b/source/UI/mainMenu.cpp @@ -52,10 +52,14 @@ namespace Windows { } if(n==2){ std::string e2uri = configini->getEnigma(); - urlschema e2schema = Utility::parseUrl(e2uri); - enigma2->enigma2ip = e2schema.server; - enigma2->getServices(); - item.state = MENU_STATE_ENIGMABROWSER; + if(e2uri == ""){ + item.state = MENU_STATE_ENIGMABROWSER; + }else{ + urlschema e2schema = Utility::parseUrl(e2uri); + enigma2->enigma2ip = e2schema.server; + enigma2->getServices(); + item.state = MENU_STATE_ENIGMABROWSER; + } } } if (is_selected) diff --git a/source/config.cpp b/source/config.cpp index 0fb4961..e7a546a 100644 --- a/source/config.cpp +++ b/source/config.cpp @@ -25,6 +25,7 @@ std::vector Config::getNetworks(){ std::vector tmpret; CSimpleIniA::TNamesDepend values; ini->GetAllValues("Network", "source", values); + if(values.size() == 0)return tmpret; CSimpleIniA::TNamesDepend::const_iterator it; for (it = values.begin(); it != values.end(); ++it) { diff --git a/source/main.cpp b/source/main.cpp index 9c5b294..15aee1e 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -94,7 +94,7 @@ int main() { printf("Loading Config\n"); - configini = new Config("config.ini"); + configini = new Config("config-test.ini"); /* if(rc<0){