[DEV] start rework connection methode (GUI)
This commit is contained in:
parent
5f35b6e912
commit
fe53d10b86
64
tools/player-video/appl/ClientProperty.cpp
Normal file
64
tools/player-video/appl/ClientProperty.cpp
Normal file
@ -0,0 +1,64 @@
|
||||
/** @file
|
||||
* @author Edouard DUPIN
|
||||
* @copyright 2016, Edouard DUPIN, all right reserved
|
||||
* @license GPL v3 (see license file)
|
||||
*/
|
||||
|
||||
#include <appl/debug.hpp>
|
||||
#include <ewol/widget/Widget.hpp>
|
||||
|
||||
|
||||
|
||||
#include <appl/ClientProperty.hpp>
|
||||
#include <appl/debug.hpp>
|
||||
#include <appl/widget/ListViewer.hpp>
|
||||
#include <ewol/object/Manager.hpp>
|
||||
#include <etk/tool.hpp>
|
||||
|
||||
#include <egami/egami.hpp>
|
||||
#include <zeus/zeus.hpp>
|
||||
#include <zeus/Client.hpp>
|
||||
#include <zeus/service/ProxyVideo.hpp>
|
||||
#include <zeus/ProxyFile.hpp>
|
||||
#include <zeus/ObjectRemote.hpp>
|
||||
#include <echrono/Steady.hpp>
|
||||
#include <zeus/FutureGroup.hpp>
|
||||
#include <etk/stdTools.hpp>
|
||||
#include <ejson/ejson.hpp>
|
||||
|
||||
void appl::ClientProperty::connect() {
|
||||
// Generate IP and Port in the client interface
|
||||
connection.propertyIp.set(address);
|
||||
connection.propertyPort.set(port);
|
||||
// Connection depending on the mode requested
|
||||
if (fromUser == toUser) {
|
||||
bool ret = connection.connect(fromUser, pass);
|
||||
if (ret == false) {
|
||||
APPL_ERROR(" ==> NOT Authentify with '" << toUser << "'");
|
||||
return;
|
||||
} else {
|
||||
APPL_INFO(" ==> Authentify with '" << toUser << "'");
|
||||
}
|
||||
} else if (fromUser != "") {
|
||||
bool ret = connection.connect(fromUser, toUser, pass);
|
||||
if (ret == false) {
|
||||
APPL_ERROR(" ==> NOT Connected to '" << toUser << "' with '" << fromUser << "'");
|
||||
return;
|
||||
} else {
|
||||
APPL_INFO(" ==> Connected with '" << toUser << "'");
|
||||
}
|
||||
} else {
|
||||
bool ret = connection.connect(toUser);
|
||||
if (ret == false) {
|
||||
APPL_ERROR(" ==> NOT Connected with 'anonymous' to '" << toUser << "'");
|
||||
return;
|
||||
} else {
|
||||
APPL_INFO(" ==> Connected with 'anonymous' to '" << toUser << "'");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#include <esignal/details/Signal.hxx>
|
||||
ESIGNAL_DECLARE_SIGNAL(ememory::SharedPtr<appl::ClientProperty>);
|
||||
|
31
tools/player-video/appl/ClientProperty.hpp
Normal file
31
tools/player-video/appl/ClientProperty.hpp
Normal file
@ -0,0 +1,31 @@
|
||||
/** @file
|
||||
* @author Edouard DUPIN
|
||||
* @copyright 2016, Edouard DUPIN, all right reserved
|
||||
* @license GPL v3 (see license file)
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <ewol/widget/WidgetScrolled.hpp>
|
||||
#include <ewol/compositing/Image.hpp>
|
||||
#include <ewol/compositing/Text.hpp>
|
||||
#include <ewol/compositing/Drawing.hpp>
|
||||
#include <ewol/widget/Manager.hpp>
|
||||
#include <esignal/Signal.hpp>
|
||||
|
||||
#include <zeus/Client.hpp>
|
||||
|
||||
namespace appl {
|
||||
class ClientProperty {
|
||||
public:
|
||||
std::string fromUser;
|
||||
std::string toUser;
|
||||
std::string pass;
|
||||
std::string address;
|
||||
uint16_t port;
|
||||
zeus::Client connection;
|
||||
void connect();
|
||||
void disconnect();
|
||||
};
|
||||
}
|
||||
|
@ -348,6 +348,7 @@ void appl::MediaDecoder::init(ememory::SharedPtr<ClientProperty> _property, uint
|
||||
void appl::MediaDecoder::init(const std::string& _filename) {
|
||||
m_updateVideoTimeStampAfterSeek = false;
|
||||
m_sourceFilename = _filename;
|
||||
ethread::setName("ffmpegThread");
|
||||
// open input file, and allocate format context
|
||||
if (avformat_open_input(&m_formatContext, m_sourceFilename.c_str(), nullptr, nullptr) < 0) {
|
||||
APPL_ERROR("Could not open source file " << m_sourceFilename);
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include <gale/Thread.hpp>
|
||||
#include <audio/channel.hpp>
|
||||
#include <audio/format.hpp>
|
||||
#include <appl/widget/ListViewer.hpp>
|
||||
#include <appl/ClientProperty.hpp>
|
||||
|
||||
extern "C" {
|
||||
#include <libavutil/imgutils.h>
|
||||
|
@ -74,7 +74,7 @@ void appl::Windows::init() {
|
||||
subBind(appl::widget::VideoDisplay, "displayer", signalPosition, sharedFromThis(), &appl::Windows::onCallbackPosition);
|
||||
subBind(ewol::widget::Slider, "progress-bar", signalChange, sharedFromThis(), &appl::Windows::onCallbackSeekRequest);
|
||||
|
||||
|
||||
/*
|
||||
subBind(ewol::widget::Entry, "connect-login", signalModify, sharedFromThis(), &appl::Windows::onCallbackConnectLogin);
|
||||
subBind(ewol::widget::Entry, "connect-password", signalModify, sharedFromThis(), &appl::Windows::onCallbackConnectPassword);
|
||||
subBind(ewol::widget::Button, "connect-bt", signalPressed, sharedFromThis(), &appl::Windows::onCallbackConnectConnect);
|
||||
@ -87,10 +87,19 @@ void appl::Windows::init() {
|
||||
subBind(ewol::widget::Button, "bt-theater", signalPressed, sharedFromThis(), &appl::Windows::onCallbackSelectTeather);
|
||||
subBind(ewol::widget::Button, "bt-one-man-show", signalPressed, sharedFromThis(), &appl::Windows::onCallbackSelectOneManShow);
|
||||
subBind(ewol::widget::Button, "bt-courses", signalPressed, sharedFromThis(), &appl::Windows::onCallbackSelectSourses);
|
||||
|
||||
*/
|
||||
|
||||
propertySetOnWidgetNamed("connect-login", "value", m_login);
|
||||
propertySetOnWidgetNamed("connect-password", "value", m_password);
|
||||
|
||||
// Direct display list:
|
||||
ewol::propertySetOnObjectNamed("view-selection", "select", "ws-name-list-viewer");
|
||||
// check if we are connected:
|
||||
if (m_login == "") {
|
||||
// must create pop-up connection
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
181
tools/player-video/appl/widget/Connection.cpp
Normal file
181
tools/player-video/appl/widget/Connection.cpp
Normal file
@ -0,0 +1,181 @@
|
||||
/** @file
|
||||
* @author Edouard DUPIN
|
||||
* @copyright 2011, Edouard DUPIN, all right reserved
|
||||
* @license MPL v2.0 (see license file)
|
||||
*/
|
||||
|
||||
|
||||
#include <ewol/widget/meta/Connection.hpp>
|
||||
#include <ewol/widget/Sizer.hpp>
|
||||
#include <ewol/widget/List.hpp>
|
||||
#include <ewol/widget/Button.hpp>
|
||||
#include <ewol/widget/CheckBox.hpp>
|
||||
#include <ewol/widget/ListFileSystem.hpp>
|
||||
#include <ewol/widget/Entry.hpp>
|
||||
#include <ewol/widget/Spacer.hpp>
|
||||
#include <ewol/widget/Image.hpp>
|
||||
#include <ewol/widget/Composer.hpp>
|
||||
#include <ewol/widget/Manager.hpp>
|
||||
//#include <vector>
|
||||
#include <vector>
|
||||
#include <etk/tool.hpp>
|
||||
#include <etk/os/FSNode.hpp>
|
||||
|
||||
extern "C" {
|
||||
// file browsing ...
|
||||
#include <dirent.h>
|
||||
}
|
||||
|
||||
#include <ewol/ewol.hpp>
|
||||
|
||||
appl::widget::Connection::Connection() :
|
||||
signalCancel(this, "cancel", ""),
|
||||
signalValidate(this, "validate", "") {
|
||||
addObjectType("appl::widget::Connection");
|
||||
}
|
||||
|
||||
void appl::widget::Connection::init(ememory::SharedPtr<appl::ClientProperty> _baseProperty) {
|
||||
appl::widget::Composer::init();
|
||||
m_baseProperty = _baseProperty;
|
||||
loadFromFile("DATA:gui-connection.xml", getId());
|
||||
subBind(appl::widget::CheckBox, "[" + etk::to_string(getId()) + "]file-shooser:show-hiden-file", signalValue, sharedFromThis(), &appl::widget::Connection::onCallbackHidenFileChangeChangeValue);
|
||||
subBind(appl::widget::Button, "[" + etk::to_string(getId()) + "]file-shooser:button-validate", signalPressed, sharedFromThis(), &appl::widget::Connection::onCallbackListValidate);
|
||||
subBind(appl::widget::Button, "[" + etk::to_string(getId()) + "]file-shooser:button-cancel", signalPressed, sharedFromThis(), &appl::widget::Connection::onCallbackButtonCancelPressed);
|
||||
subBind(appl::widget::ListFileSystem, "[" + etk::to_string(getId()) + "]file-shooser:list-folder", signalFolderValidate, sharedFromThis(), &appl::widget::Connection::onCallbackListFolderSelectChange);
|
||||
subBind(appl::widget::ListFileSystem, "[" + etk::to_string(getId()) + "]file-shooser:list-files", signalFileSelect, sharedFromThis(), &appl::widget::Connection::onCallbackListFileSelectChange);
|
||||
subBind(appl::widget::ListFileSystem, "[" + etk::to_string(getId()) + "]file-shooser:list-files", signalFileValidate, sharedFromThis(), &appl::widget::Connection::onCallbackListFileValidate);
|
||||
subBind(appl::widget::Entry, "[" + etk::to_string(getId()) + "]file-shooser:entry-file", signalModify, sharedFromThis(), &appl::widget::Connection::onCallbackEntryFileChangeValue);
|
||||
subBind(appl::widget::Entry, "[" + etk::to_string(getId()) + "]file-shooser:entry-file", signalEnter, sharedFromThis(), &appl::widget::Connection::onCallbackListFileValidate);
|
||||
subBind(appl::widget::Entry, "[" + etk::to_string(getId()) + "]file-shooser:entry-folder", signalModify, sharedFromThis(), &appl::widget::Connection::onCallbackEntryFolderChangeValue);
|
||||
//composerBind(appl::widget::CheckBox, "[" + etk::to_string(getId()) + "]file-shooser:entry-folder", signalEnter, sharedFromThis(), &appl::widget::Connection::);
|
||||
subBind(appl::widget::Image, "[" + etk::to_string(getId()) + "]file-shooser:img-home", signalPressed, sharedFromThis(), &appl::widget::Connection::onCallbackHomePressed);
|
||||
// set the default Folder properties:
|
||||
updateCurrentFolder();
|
||||
propertyCanFocus.set(true);
|
||||
}
|
||||
|
||||
void appl::widget::Connection::onGetFocus() {
|
||||
// transfert focus on a specific widget...
|
||||
propertySetOnWidgetNamed("[" + etk::to_string(getId()) + "]file-shooser:entry-file", "focus", "true");
|
||||
}
|
||||
|
||||
appl::widget::Connection::~Connection() {
|
||||
|
||||
}
|
||||
|
||||
void appl::widget::Connection::onChangePropertyPath() {
|
||||
propertyPath.getDirect() = *propertyPath + "/";
|
||||
updateCurrentFolder();
|
||||
}
|
||||
|
||||
void appl::widget::Connection::onChangePropertyFile() {
|
||||
propertySetOnWidgetNamed("[" + etk::to_string(getId()) + "]file-shooser:entry-file", "value", propertyFile);
|
||||
//updateCurrentFolder();
|
||||
}
|
||||
|
||||
void appl::widget::Connection::onChangePropertyLabelTitle() {
|
||||
propertySetOnWidgetNamed("[" + etk::to_string(getId()) + "]file-shooser:title-label", "value", propertyLabelTitle);
|
||||
}
|
||||
|
||||
void appl::widget::Connection::onChangePropertyLabelValidate() {
|
||||
propertySetOnWidgetNamed("[" + etk::to_string(getId()) + "]file-shooser:validate-label", "value", propertyLabelValidate);
|
||||
}
|
||||
|
||||
void appl::widget::Connection::onChangePropertyLabelCancel() {
|
||||
propertySetOnWidgetNamed("[" + etk::to_string(getId()) + "]file-shooser:cancel-label", "value", propertyLabelCancel);
|
||||
}
|
||||
|
||||
void appl::widget::Connection::onCallbackEntryFolderChangeValue(const std::string& _value) {
|
||||
// == > change the folder name
|
||||
// TODO : change the folder, if it exit ...
|
||||
}
|
||||
|
||||
void appl::widget::Connection::onCallbackEntryFileChangeValue(const std::string& _value) {
|
||||
// == > change the file name
|
||||
propertyFile.setDirect(_value);
|
||||
// update the selected file in the list :
|
||||
propertySetOnWidgetNamed("[" + etk::to_string(getId()) + "]file-shooser:list-files", "select", propertyFile);
|
||||
}
|
||||
|
||||
void appl::widget::Connection::onCallbackButtonCancelPressed() {
|
||||
// == > Auto remove ...
|
||||
signalCancel.emit();
|
||||
autoDestroy();
|
||||
}
|
||||
|
||||
void appl::widget::Connection::onCallbackHidenFileChangeChangeValue(const bool& _value) {
|
||||
if (_value == true) {
|
||||
propertySetOnWidgetNamed("[" + etk::to_string(getId()) + "]file-shooser:list-folder", "show-hidden", "true");
|
||||
propertySetOnWidgetNamed("[" + etk::to_string(getId()) + "]file-shooser:list-files", "show-hidden", "true");
|
||||
} else {
|
||||
propertySetOnWidgetNamed("[" + etk::to_string(getId()) + "]file-shooser:list-folder", "show-hidden", "false");
|
||||
propertySetOnWidgetNamed("[" + etk::to_string(getId()) + "]file-shooser:list-files", "show-hidden", "false");
|
||||
}
|
||||
}
|
||||
|
||||
void appl::widget::Connection::onCallbackListFolderSelectChange(const std::string& _value) {
|
||||
// == > this is an internal event ...
|
||||
EWOL_DEBUG(" old PATH: '" << *propertyPath << "' + '" << _value << "'");
|
||||
propertyPath.setDirect(propertyPath.get() + _value);
|
||||
EWOL_DEBUG("new PATH: '" << *propertyPath << "'");
|
||||
propertyPath.setDirect(etk::simplifyPath(*propertyPath));
|
||||
propertyFile.setDirect("");
|
||||
updateCurrentFolder();
|
||||
}
|
||||
|
||||
void appl::widget::Connection::onCallbackListFileSelectChange(const std::string& _value) {
|
||||
propertyFile.set(_value);
|
||||
/*
|
||||
std::string tmpFileCompleatName = m_folder;
|
||||
tmpFileCompleatName += m_file;
|
||||
// TODO : generateEventId(_msg.getMessage(), tmpFileCompleatName);
|
||||
*/
|
||||
}
|
||||
|
||||
void appl::widget::Connection::onCallbackListFileValidate(const std::string& _value) {
|
||||
// select the file == > generate a validate
|
||||
propertyFile.set(_value);
|
||||
EWOL_VERBOSE(" generate a fiel opening : '" << propertyPath << "' / '" << propertyFile << "'");
|
||||
signalValidate.emit(getCompleateFileName());
|
||||
autoDestroy();
|
||||
}
|
||||
|
||||
void appl::widget::Connection::onCallbackListValidate() {
|
||||
if (propertyFile.get() == "") {
|
||||
EWOL_WARNING(" Validate : '" << propertyPath << "' / '" << propertyFile << "' ==> error No name ...");
|
||||
return;
|
||||
}
|
||||
EWOL_DEBUG(" generate a file opening : '" << propertyPath << "' / '" << propertyFile << "'");
|
||||
signalValidate.emit(getCompleateFileName());
|
||||
autoDestroy();
|
||||
}
|
||||
|
||||
void appl::widget::Connection::onCallbackHomePressed() {
|
||||
std::string tmpUserFolder = etk::getUserHomeFolder();
|
||||
EWOL_DEBUG("new PATH : \"" << tmpUserFolder << "\"");
|
||||
|
||||
propertyPath.setDirect(etk::simplifyPath(tmpUserFolder));
|
||||
|
||||
propertyFile.setDirect("");
|
||||
updateCurrentFolder();
|
||||
}
|
||||
|
||||
void appl::widget::Connection::updateCurrentFolder() {
|
||||
if (*propertyPath != "") {
|
||||
if (propertyPath.get()[propertyPath->size()-1] != '/') {
|
||||
propertyPath.getDirect() += "/";
|
||||
}
|
||||
}
|
||||
propertySetOnWidgetNamed("[" + etk::to_string(getId()) + "]file-shooser:list-files", "path", propertyPath);
|
||||
propertySetOnWidgetNamed("[" + etk::to_string(getId()) + "]file-shooser:list-folder", "path", propertyPath);
|
||||
propertySetOnWidgetNamed("[" + etk::to_string(getId()) + "]file-shooser:entry-folder", "value", propertyPath);
|
||||
markToRedraw();
|
||||
}
|
||||
|
||||
std::string appl::widget::Connection::getCompleateFileName() {
|
||||
std::string tmpString = propertyPath;
|
||||
tmpString += "/";
|
||||
tmpString += propertyFile;
|
||||
etk::FSNode node(tmpString);
|
||||
return node.getName();
|
||||
}
|
102
tools/player-video/appl/widget/Connection.hpp
Normal file
102
tools/player-video/appl/widget/Connection.hpp
Normal file
@ -0,0 +1,102 @@
|
||||
/** @file
|
||||
* @author Edouard DUPIN
|
||||
* @copyright 2011, Edouard DUPIN, all right reserved
|
||||
* @license MPL v2.0 (see license file)
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <etk/types.hpp>
|
||||
#include <ewol/debug.hpp>
|
||||
#include <ewol/widget/Composer.hpp>
|
||||
#include <esignal/Signal.hpp>
|
||||
#include <appl/ClientProperty.hpp>
|
||||
|
||||
namespace appl {
|
||||
namespace widget {
|
||||
class Connection;
|
||||
using ConnectionShared = ememory::SharedPtr<appl::widget::Connection>;
|
||||
using ConnectionWeak = ememory::WeakPtr<appl::widget::Connection>;
|
||||
/**
|
||||
* @brief File Chooser is a simple selector of file for opening, saving, and what you want ...
|
||||
*
|
||||
* As all other pop-up methode ( wost case we can have) the creating is simple , but event back is not all the time simple:
|
||||
*
|
||||
* Fist global static declaration and inclusion:
|
||||
* [code style=c++]
|
||||
* #include <ewol/widget/meta/Connection.h>
|
||||
* [/code]
|
||||
*
|
||||
* The first step is to create the file chooser pop-up : (never in the constructor!!!)
|
||||
* [code style=c++]
|
||||
* ewol::widget::ConnectionShared tmpWidget = ewol::Widget::Connection::create();
|
||||
* if (tmpWidget == nullptr) {
|
||||
* APPL_ERROR("Can not open File chooser !!! ");
|
||||
* return -1;
|
||||
* }
|
||||
* // register on the Validate event:
|
||||
* tmpWidget->signalValidate.connect(sharedFromThis(), &****::onCallbackOpenFile);
|
||||
* // no need of this event watching ...
|
||||
* tmpWidget->signalCancel.connect(sharedFromThis(), &****::onCallbackClosePopUp);
|
||||
* // set the title:
|
||||
* tmpWidget->propertyLabelTitle.set("Open files ...");
|
||||
* // Set the validate Label:
|
||||
* tmpWidget->propertyLabelValidate.set("Open");
|
||||
* // simply set a folder (by default this is the home folder)
|
||||
* //tmpWidget->propertyPath.set("/home/me");
|
||||
* // add the widget as windows pop-up ...
|
||||
* ewol::widget::WindowsShared tmpWindows = getWindows();
|
||||
* if (tmpWindows == nullptr) {
|
||||
* APPL_ERROR("Can not get the current windows !!! ");
|
||||
* return -1;
|
||||
* }
|
||||
* tmpWindows->popUpWidgetPush(tmpWidget);
|
||||
* [/code]
|
||||
*
|
||||
* Now we just need to wait the the open event message.
|
||||
*
|
||||
* [code style=c++]
|
||||
* void ****::onCallbackOpenFile(const std::string& _value) {
|
||||
* APPL_INFO("Request open file : '" << _value << "'");
|
||||
* }
|
||||
* void ****::onCallbackClosePopUp() {
|
||||
* APPL_INFO("The File chooser has been closed");
|
||||
* }
|
||||
* [/code]
|
||||
* This is the best example of a Meta-widget.
|
||||
*/
|
||||
class Connection : public ewol::widget::Composer {
|
||||
public: // signals
|
||||
esignal::Signal<> signalCancel; //!< abort the display of the pop-up or press cancel button
|
||||
esignal::Signal<ememory::SharedPtr<appl::ClientProperty>> signalValidate; //!< select file(s)
|
||||
protected:
|
||||
ememory::SharedPtr<appl::ClientProperty> m_baseProperty;
|
||||
Connection();
|
||||
void init(ememory::SharedPtr<appl::ClientProperty> _baseProperty=nullptr) override;
|
||||
public:
|
||||
DECLARE_WIDGET_FACTORY(Connection, "Connection");
|
||||
virtual ~Connection();
|
||||
private:
|
||||
std::string getCompleateFileName();
|
||||
void updateCurrentFolder();
|
||||
public:
|
||||
void onGetFocus() override;
|
||||
private:
|
||||
// callback functions:
|
||||
void onCallbackEntryFolderChangeValue(const std::string& _value);
|
||||
void onCallbackEntryFileChangeValue(const std::string& _value);
|
||||
void onCallbackButtonCancelPressed();
|
||||
void onCallbackHidenFileChangeChangeValue(const bool& _value);
|
||||
void onCallbackListFolderSelectChange(const std::string& _value);
|
||||
void onCallbackListFileSelectChange(const std::string& _value);
|
||||
void onCallbackListFileValidate(const std::string& _value);
|
||||
void onCallbackListValidate();
|
||||
void onCallbackHomePressed();
|
||||
protected:
|
||||
virtual void onChangePropertyPath();
|
||||
virtual void onChangePropertyFile();
|
||||
virtual void onChangePropertyLabelTitle();
|
||||
virtual void onChangePropertyLabelValidate();
|
||||
virtual void onChangePropertyLabelCancel();
|
||||
};
|
||||
};
|
||||
};
|
@ -24,38 +24,6 @@
|
||||
#include <zeus/FutureGroup.hpp>
|
||||
#include <etk/stdTools.hpp>
|
||||
#include <ejson/ejson.hpp>
|
||||
void appl::ClientProperty::connect() {
|
||||
|
||||
// Generate IP and Port in the client interface
|
||||
connection.propertyIp.set(address);
|
||||
connection.propertyPort.set(port);
|
||||
// Connection depending on the mode requested
|
||||
if (fromUser == toUser) {
|
||||
bool ret = connection.connect(fromUser, pass);
|
||||
if (ret == false) {
|
||||
APPL_ERROR(" ==> NOT Authentify with '" << toUser << "'");
|
||||
return;
|
||||
} else {
|
||||
APPL_INFO(" ==> Authentify with '" << toUser << "'");
|
||||
}
|
||||
} else if (fromUser != "") {
|
||||
bool ret = connection.connect(fromUser, toUser, pass);
|
||||
if (ret == false) {
|
||||
APPL_ERROR(" ==> NOT Connected to '" << toUser << "' with '" << fromUser << "'");
|
||||
return;
|
||||
} else {
|
||||
APPL_INFO(" ==> Connected with '" << toUser << "'");
|
||||
}
|
||||
} else {
|
||||
bool ret = connection.connect(toUser);
|
||||
if (ret == false) {
|
||||
APPL_ERROR(" ==> NOT Connected with 'anonymous' to '" << toUser << "'");
|
||||
return;
|
||||
} else {
|
||||
APPL_INFO(" ==> Connected with 'anonymous' to '" << toUser << "'");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
appl::widget::ListViewer::ListViewer() :
|
||||
signalSelect(this, "select", "Select a media to view") {
|
||||
@ -129,6 +97,7 @@ void appl::widget::ListViewer::searchElements(std::string _filter) {
|
||||
appl::widget::ListViewerShared tmpWidget = ememory::staticPointerCast<appl::widget::ListViewer>(sharedFromThis());
|
||||
remoteServiceVideo.mediaMetadataGetKey(it, "title")
|
||||
.andThen([=](zeus::FutureBase _fut) mutable {
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(200));
|
||||
zeus::Future<std::string> futTmp(_fut);
|
||||
APPL_INFO(" [" << elem->m_id << "] get title: " << futTmp.get());
|
||||
{
|
||||
@ -140,6 +109,7 @@ void appl::widget::ListViewer::searchElements(std::string _filter) {
|
||||
});
|
||||
remoteServiceVideo.mediaMetadataGetKey(it, "series-name")
|
||||
.andThen([=](zeus::FutureBase _fut) mutable {
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(200));
|
||||
zeus::Future<std::string> futTmp(_fut);
|
||||
APPL_ERROR(" [" << elem->m_id << "] get serie: " << futTmp.get());
|
||||
{
|
||||
@ -151,6 +121,7 @@ void appl::widget::ListViewer::searchElements(std::string _filter) {
|
||||
});
|
||||
remoteServiceVideo.mediaMetadataGetKey(it, "saison")
|
||||
.andThen([=](zeus::FutureBase _fut) mutable {
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(200));
|
||||
zeus::Future<std::string> futTmp(_fut);
|
||||
APPL_INFO(" [" << elem->m_id << "] get saison: " << futTmp.get());
|
||||
{
|
||||
@ -162,6 +133,7 @@ void appl::widget::ListViewer::searchElements(std::string _filter) {
|
||||
});
|
||||
remoteServiceVideo.mediaMetadataGetKey(it, "episode")
|
||||
.andThen([=](zeus::FutureBase _fut) mutable {
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(200));
|
||||
zeus::Future<std::string> futTmp(_fut);
|
||||
APPL_INFO(" [" << elem->m_id << "] get episode: " << futTmp.get());
|
||||
{
|
||||
@ -173,6 +145,7 @@ void appl::widget::ListViewer::searchElements(std::string _filter) {
|
||||
});
|
||||
remoteServiceVideo.mediaMetadataGetKey(it, "description")
|
||||
.andThen([=](zeus::FutureBase _fut) mutable {
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(200));
|
||||
zeus::Future<std::string> futTmp(_fut);
|
||||
APPL_INFO(" [" << elem->m_id << "] get description: " << futTmp.get());
|
||||
{
|
||||
@ -184,6 +157,7 @@ void appl::widget::ListViewer::searchElements(std::string _filter) {
|
||||
});
|
||||
remoteServiceVideo.mediaMineTypeGet(it)
|
||||
.andThen([=](zeus::FutureBase _fut) mutable {
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(200));
|
||||
zeus::Future<std::string> futTmp(_fut);
|
||||
APPL_INFO(" [" << elem->m_id << "] get mine-type: " << futTmp.get());
|
||||
{
|
||||
@ -231,10 +205,11 @@ void appl::widget::ListViewer::onDraw() {
|
||||
}
|
||||
it->draw();
|
||||
}
|
||||
WidgetScrolled::onDraw();
|
||||
ewol::widget::WidgetScrolled::onDraw();
|
||||
}
|
||||
|
||||
void appl::widget::ListViewer::onRegenerateDisplay() {
|
||||
ewol::widget::WidgetScrolled::onRegenerateDisplay();
|
||||
//!< Check if we really need to redraw the display, if not needed, we redraw the previous data ...
|
||||
if (needRedraw() == false) {
|
||||
return;
|
||||
@ -361,7 +336,7 @@ void appl::widget::ListViewer::onRegenerateDisplay() {
|
||||
m_maxSize.setX(m_size.x());
|
||||
m_maxSize.setY((float)m_listElement.size()*elementSize.y());
|
||||
// call the herited class...
|
||||
WidgetScrolled::onRegenerateDisplay();
|
||||
ewol::widget::WidgetScrolled::onRegenerateDisplay();
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -14,19 +14,9 @@
|
||||
#include <esignal/Signal.hpp>
|
||||
|
||||
#include <zeus/Client.hpp>
|
||||
#include <appl/ClientProperty.hpp>
|
||||
|
||||
namespace appl {
|
||||
class ClientProperty {
|
||||
public:
|
||||
std::string fromUser;
|
||||
std::string toUser;
|
||||
std::string pass;
|
||||
std::string address;
|
||||
uint16_t port;
|
||||
zeus::Client connection;
|
||||
void connect();
|
||||
void disconnect();
|
||||
};
|
||||
class ElementProperty {
|
||||
public:
|
||||
std::mutex m_mutex;
|
||||
|
@ -248,6 +248,7 @@ void appl::widget::VideoDisplay::onRegenerateDisplay() {
|
||||
|
||||
void appl::widget::VideoDisplay::periodicEvent(const ewol::event::Time& _event) {
|
||||
if (m_isPalying == true) {
|
||||
APPL_INFO("tick: " << _event);
|
||||
m_currentTime += _event.getDeltaCallDuration();
|
||||
}
|
||||
if (m_decoder == nullptr) {
|
||||
|
11
tools/player-video/data/gui-connection.xml
Normal file
11
tools/player-video/data/gui-connection.xml
Normal file
@ -0,0 +1,11 @@
|
||||
<PopUp >
|
||||
<sizer mode="vert" fill="true,true" expand="false,false" lock="true,true" addmode="invert" min-size="45,10%">
|
||||
<label>login</label>
|
||||
<entry name="[{ID}]connect-login" fill="true,false" expand="true,false"/>
|
||||
<label>password</label>
|
||||
<entry name="[{ID}]connect-password" fill="true,false" expand="true,false"/>
|
||||
<button name="[{ID}]connect-bt" toggle="false" fill="false,false" expand="true,false" gravity="right">
|
||||
<label>Connect</label>
|
||||
</button>
|
||||
</sizer>
|
||||
</PopUp>
|
@ -1,37 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<sizer mode="vert" fill="true,true" expand="true,true" addmode="invert">
|
||||
<sizer mode="hori" fill="true,true" expand="true,false">
|
||||
<button name="menu-bt">
|
||||
<image src="DATA:List.svg" size='8,8mm'/>
|
||||
</button>
|
||||
<entry name="search-entry" fill="true,false" expand="true,false"/>
|
||||
<button name="search-bt">
|
||||
<image src="DATA:Search.svg" size='8,8mm' />
|
||||
</button>
|
||||
</sizer>
|
||||
<sizer mode="hori" fill="true,true" expand="true,false">
|
||||
<button name="access-fast-home">
|
||||
<image src="DATA:Home.svg" size='8,8mm' />
|
||||
</button>
|
||||
<button name="access-fast-page-previous">
|
||||
<image src="DATA:Previous.svg" size='8,8mm' />
|
||||
</button>
|
||||
<button name="access-fast-page-next">
|
||||
<image src="DATA:Next.svg" size='8,8mm' />
|
||||
</button>
|
||||
</sizer>
|
||||
<sizer mode="vert" fill="true,true" expand="true,true">
|
||||
<wslider name="view-selection" fill="true,true" expand="true,true">
|
||||
<PopUp name="ws-name-connect" >
|
||||
<sizer mode="vert" fill="true,true" expand="false,false" lock="true,true" addmode="invert" min-size="45,10%">
|
||||
<label>login</label>
|
||||
<entry name="connect-login" fill="true,false" expand="true,false"/>
|
||||
<label>password</label>
|
||||
<entry name="connect-password" fill="true,false" expand="true,false"/>
|
||||
<button name="connect-bt" toggle="false" fill="false,false" expand="true,false" gravity="right">
|
||||
<label>Connect</label>
|
||||
</button>
|
||||
</sizer>
|
||||
</PopUp>
|
||||
<!--
|
||||
<sizer mode="vert" name="ws-name-list" fill="true,true" expand="true,true" addmode="invert">
|
||||
<button name="bt-film-picture" expand="true,false" fill="true,true">
|
||||
<label>Films</label>
|
||||
@ -56,6 +26,7 @@
|
||||
</button>
|
||||
<spacer fill="true,true" expand="true,true"/>
|
||||
</sizer>
|
||||
-->
|
||||
<ListViewer name="ws-name-list-viewer" fill="true,true" expand="true,true"/>
|
||||
<sizer mode="vert" name="ws-name-player" fill="true,true" expand="true,true">
|
||||
<sizer mode="hori" fill="true,true" expand="true,false">
|
||||
@ -85,4 +56,24 @@
|
||||
<VideoDisplay name="displayer" expand="true" fill="true"/>
|
||||
</sizer>
|
||||
</wslider>
|
||||
<sizer mode="hori" fill="true,true" expand="true,false" lock="true,true">
|
||||
<button name="access-fast-home">
|
||||
<image src="DATA:Home.svg" size='8,8mm' />
|
||||
</button>
|
||||
<button name="access-fast-page-previous">
|
||||
<image src="DATA:Previous.svg" size='8,8mm' />
|
||||
</button>
|
||||
<button name="access-fast-page-next">
|
||||
<image src="DATA:Next.svg" size='8,8mm' />
|
||||
</button>
|
||||
</sizer>
|
||||
<sizer mode="hori" fill="true,false" expand="true,false" lock="true,true">
|
||||
<button name="menu-bt">
|
||||
<image src="DATA:List.svg" size='8,8mm'/>
|
||||
</button>
|
||||
<entry name="search-entry" fill="true,false" expand="true,false"/>
|
||||
<button name="search-bt">
|
||||
<image src="DATA:Search.svg" size='8,8mm' />
|
||||
</button>
|
||||
</sizer>
|
||||
</sizer>
|
Loading…
x
Reference in New Issue
Block a user