[DEV] good load of metadata and better display, add fullscreen and back button

This commit is contained in:
Edouard DUPIN 2017-04-27 22:35:49 +02:00
parent f99ffecc31
commit 6e0d0e2ffc
10 changed files with 221 additions and 37 deletions

View File

@ -62,7 +62,8 @@ void appl::Windows::load_db() {
appl::Windows::Windows():
m_id(0) {
m_id(0),
m_fullScreen(false) {
addObjectType("appl::Windows");
propertyTitle.setDirectCheck(std::string("sample ") + PROJECT_NAME);
}
@ -85,6 +86,7 @@ void appl::Windows::init() {
m_listViewer->signalSelect.connect(sharedFromThis(), &appl::Windows::onCallbackSelectMedia);
}
subBind(ewol::widget::Button, "access-fast-back", signalPressed, sharedFromThis(), &appl::Windows::onCallbackSelectBack);
subBind(ewol::widget::Button, "access-fast-home", signalPressed, sharedFromThis(), &appl::Windows::onCallbackSelectHome);
subBind(ewol::widget::Button, "access-fast-group", signalPressed, sharedFromThis(), &appl::Windows::onCallbackSelectGroup);
// Direct display list:
@ -92,7 +94,8 @@ void appl::Windows::init() {
subBind(ewol::widget::Menu, "menu-bar", signalSelect, sharedFromThis(), &appl::Windows::onCallbackMenuEvent);
shortCutAdd("alt+F4", "menu:exit");
shortCutAdd("F12", "menu:reload-shader");
shortCutAdd("F11", "menu:connect");
shortCutAdd("F9", "menu:connect");
shortCutAdd("F11", "menu:full-screen");
signalShortcut.connect(sharedFromThis(), &appl::Windows::onCallbackShortCut);
// TODO: try to connect the last connection availlable ...
if (m_clientProp == nullptr) {
@ -141,8 +144,18 @@ void appl::Windows::onCallbackMenuEvent(const std::string& _value) {
tmpWidget->signalCancel.connect(sharedFromThis(), &appl::Windows::onCallbackConnectionCancel);
// add the widget as windows pop-up ...
popUpWidgetPush(tmpWidget);
} else if (_value == "menu:full-screen") {
if (m_fullScreen == false) {
m_fullScreen = true;
} else {
m_fullScreen = false;
}
gale::getContext().setFullScreen(m_fullScreen);
} else if (_value == "menu:exit") {
gale::getContext().stop();
} else if (_value == "menu:back") {
ewol::propertySetOnObjectNamed("view-selection", "select", "ws-name-list-viewer");
m_listViewer->backHistory();
} else if (_value == "menu:home") {
ewol::propertySetOnObjectNamed("view-selection", "select", "ws-name-list-viewer");
m_listViewer->searchElements("");

View File

@ -53,6 +53,9 @@ namespace appl {
void onCallbackSelectOneManShow();
void onCallbackSelectSourses();
void onCallbackSelectMedia(const uint32_t& _value);
void onCallbackSelectBack() {
onCallbackMenuEvent("menu:back");
}
void onCallbackSelectGroup() {
onCallbackMenuEvent("menu:group");
}
@ -62,5 +65,7 @@ namespace appl {
void onCallbackPlayerPrevious();
void onCallbackPlayerNext();
void onCallbackPlayerFinished();
protected:
bool m_fullScreen;
};
}

View File

@ -326,6 +326,7 @@ void appl::ElementProperty::loadData() {
}
return true;
});
//elem->m_thumb = remoteServiceVideo.mediaThumbGet(it, 128).wait().get();
return true;
});
}
@ -335,7 +336,18 @@ bool appl::ElementProperty::LoadDataEnded() {
return m_metadataUpdated == appl::statusLoadingData::done;
}
void appl::widget::ListViewer::searchElementsInternal(const std::string& _filter, const std::string& _group) {
void appl::widget::ListViewer::backHistory() {
if (m_history.size() == 0) {
// nothing to do ...
return;
}
auto value = m_history.back();
m_history.pop_back();
searchElementsInternal(value.first, value.second, false);
}
void appl::widget::ListViewer::searchElementsInternal(const std::string& _filter, const std::string& _group, bool _storeHistory) {
m_listElement.clear();
m_listElementGroup.clear();
m_listDisplay.clear();
@ -344,6 +356,10 @@ void appl::widget::ListViewer::searchElementsInternal(const std::string& _filter
APPL_ERROR("No client Availlable ...");
return;
}
if ( m_currentFilter != ""
&& _storeHistory == true) {
m_history.push_back(std::make_pair(m_currentFilter, m_currentGroup));
}
m_currentFilter = _filter;
m_currentGroup = _group;
markToRedraw();
@ -374,7 +390,8 @@ void appl::widget::ListViewer::searchElementsInternal(const std::string& _filter
std::vector<std::string> returnValues = listElem.get();
APPL_INFO("Get some Values: " << returnValues << "");
if (returnValues.size() == 1) {
// TODO : maybe something to do for series
// TODO: if we have a single element and this is requested as a group ==> just jump in it
}
for (auto &it : returnValues) {
auto elem = ememory::makeShared<ElementPropertyGroup>();
@ -383,7 +400,12 @@ void appl::widget::ListViewer::searchElementsInternal(const std::string& _filter
continue;
}
elem->m_id = 0;
elem->m_title = it;
elem->m_filter = it;
if (m_currentGroup == "saison") {
elem->m_title = TRANSLATE("_T{saison} ") + it;
} else {
elem->m_title = it;
}
//elem->m_thumb = remoteServiceVideo.mediaThumbGet(it, 128).wait().get();
m_listElementGroup.push_back(elem);
}
@ -402,11 +424,7 @@ void appl::widget::ListViewer::searchElementsInternal(const std::string& _filter
continue;
}
elem->m_id = it;
/*
// TODO : Type the "andThen" to simplify user experience
// TODO : Add the reference on the typed future in the function andTrn ... ==> then we can add later the cancel
*/
//elem->m_thumb = remoteServiceVideo.mediaThumbGet(it, 128).wait().get();
// ==> loading is done when display is requested ...
m_listElement.push_back(elem);
}
}
@ -628,10 +646,10 @@ void appl::ElementDisplayed::generateDisplay(vec2 _startPos, vec2 _size) {
// TODO: m_text.setClipping(originText, vec2(originText.x()+_size.x()-_size.y(), _size.y()));
std::string textToDisplay;
if (m_property != nullptr) {
std::unique_lock<std::mutex> lock(m_property->m_mutex);
if (m_property->LoadDataEnded() == false) {
textToDisplay += "<br/><i>Loading in progress</i>";
} else {
std::unique_lock<std::mutex> lock(m_property->m_mutex);
//m_text.setClipping(drawClippingPos, drawClippingSize);
textToDisplay = "<b>" + m_property->m_title + "</b><br/>";
bool newLine = false;
@ -661,7 +679,7 @@ void appl::ElementDisplayed::generateDisplay(vec2 _startPos, vec2 _size) {
} else {
std::unique_lock<std::mutex> lock(m_propertyGroup->m_mutex);
//m_text.setClipping(drawClippingPos, drawClippingSize);
textToDisplay = "<b>" + m_propertyGroup->m_title + "</b><br/>";
textToDisplay = "<br/><b>" + m_propertyGroup->m_title + "</b><br/>";
}
m_text.printDecorated(textToDisplay);
@ -739,9 +757,9 @@ bool appl::widget::ListViewer::onEventInput(const ewol::event::Input& _event) {
}
std::string newGroup = "";
if (m_currentGroup == "type") {
if (prop->m_title == "film") {
if (prop->m_filter == "film") {
newGroup = "production-methode";
} else if (prop->m_title == "tv-show") {
} else if (prop->m_filter == "tv-show") {
newGroup = "production-methode";
}
} else if (m_currentGroup == "production-methode") {
@ -754,9 +772,9 @@ bool appl::widget::ListViewer::onEventInput(const ewol::event::Input& _event) {
newGroup = "album";
}
if (m_currentFilter == "*") {
searchElementsInternal("'" + m_currentGroup + "' == '" + prop->m_title + "'", newGroup);
searchElementsInternal("'" + m_currentGroup + "' == '" + prop->m_filter + "'", newGroup);
} else {
searchElementsInternal(m_currentFilter + " AND '" + m_currentGroup + "' == '" + prop->m_title + "'", newGroup);
searchElementsInternal(m_currentFilter + " AND '" + m_currentGroup + "' == '" + prop->m_filter + "'", newGroup);
}
}
return true;

View File

@ -62,6 +62,7 @@ namespace appl {
std::mutex m_mutex;
uint64_t m_id; //!< Remote Id of the Media
std::string m_title; //!< Title of the Group
std::string m_filter; //!< element to add in the filter
};
class ElementDisplayed {
public:
@ -124,8 +125,12 @@ namespace appl {
m_clientProp = _prop;
}
void searchElements(std::string _filter="");
void searchElementsInternal(const std::string& _filter, const std::string& _group="");
void searchElementsInternal(const std::string& _filter, const std::string& _group="", bool _storeHistory=true);
bool onEventInput(const ewol::event::Input& _event) override;
protected:
std::vector<std::pair<std::string,std::string>> m_history;
public:
void backHistory();
public:
/**
* @brief Generate the event with the previous file property

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="64" height="64">
<path style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:4px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 39.26828,62 -35,-30.008475 L 39.265019,2.0107803 39.26828,22 61.299356,21.912346 v 20 L 39.26828,42 Z"/>
</svg>

After

Width:  |  Height:  |  Size: 360 B

View File

@ -1,7 +1,141 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="64" height="64">
<g transform="matrix(1.2000035,0,0,1.2000035,-76.201658,-63.592236)">
<path d="M 111.858,93.287 93.524,62.64 C 91.67,59.542 88.639,59.543 86.789,62.641 L 68.476,93.286 c -1.851,3.098 -0.413,5.633 3.197,5.633 h 36.993 c 3.608,-10e-4 5.045,-2.535 3.192,-5.632 z M 88.2,73.367 c 0,-1.084 0.887,-1.969 1.969,-1.969 1.083,0 1.969,0.885 1.969,1.969 v 9.192 c 0,1.085 -0.886,1.969 -1.969,1.969 -1.082,0 -1.969,-0.884 -1.969,-1.969 v -9.192 z m 1.969,19.596 c -1.449,0 -2.625,-1.177 -2.625,-2.625 0,-1.451 1.176,-2.624 2.625,-2.624 1.45,0 2.625,1.173 2.625,2.624 0,1.449 -1.175,2.625 -2.625,2.625 z"
style="fill:#333333" />
</g>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="64"
height="64"
version="1.1"
id="svg6"
sodipodi:docname="Light.svg"
inkscape:version="0.92.1 r">
<metadata
id="metadata12">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs10" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1918"
inkscape:window-height="1038"
id="namedview8"
showgrid="false"
inkscape:zoom="10.429825"
inkscape:cx="22.628239"
inkscape:cy="38.093414"
inkscape:window-x="0"
inkscape:window-y="20"
inkscape:window-maximized="1"
inkscape:current-layer="svg6" />
<circle
style="fill:#000000;fill-opacity:1;stroke:#001bdb;stroke-width:2.12360883;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path14"
cx="32"
cy="32"
r="10.938195" />
<ellipse
cy="-36.231922"
cx="40.995861"
id="circle16-3-6"
style="fill:#ffffff;fill-opacity:1;stroke:#ff9e14;stroke-width:0.80070943;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
rx="1.0529675"
ry="16.153893"
transform="rotate(71.170664)"
inkscape:transform-center-x="-15.873455"
inkscape:transform-center-y="-5.2126341" />
<ellipse
cy="-59.698811"
cx="14.477135"
id="circle16-3-7"
style="fill:#ffffff;fill-opacity:1;stroke:#ff9e14;stroke-width:0.80070943;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
rx="1.0529675"
ry="16.153893"
transform="rotate(117.13007)"
inkscape:transform-center-x="-14.781804"
inkscape:transform-center-y="7.7869389" />
<ellipse
cy="-58.794544"
cx="-16.205757"
id="circle16-3-3"
style="fill:#ffffff;fill-opacity:1;stroke:#ff9e14;stroke-width:0.80070943;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
rx="1.0529675"
ry="16.153893"
transform="rotate(156.79793)"
inkscape:transform-center-x="-6.4077244"
inkscape:transform-center-y="15.429818" />
<ellipse
cy="2.5022852"
cx="41.15004"
id="circle16-3-56"
style="fill:#ffffff;fill-opacity:1;stroke:#ff9e14;stroke-width:0.80070943;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
rx="1.0529675"
ry="16.153893"
transform="rotate(20.818855)"
inkscape:transform-center-x="-6.114797"
inkscape:transform-center-y="-15.548228" />
<ellipse
cy="25.44776"
cx="16.414482"
id="circle16-3-2"
style="fill:#ffffff;fill-opacity:1;stroke:#ff9e14;stroke-width:0.80070943;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
rx="1.0529675"
ry="16.153893"
transform="rotate(-23.433656)"
inkscape:transform-center-x="6.4700399"
inkscape:transform-center-y="-15.403791" />
<ellipse
cy="25.161406"
cx="-17.297213"
id="circle16-3-9"
style="fill:#ffffff;fill-opacity:1;stroke:#ff9e14;stroke-width:0.80070943;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
rx="1.0529675"
ry="16.153893"
transform="rotate(-67.070503)"
inkscape:transform-center-x="15.312476"
inkscape:transform-center-y="-6.6832793" />
<ellipse
cy="-0.18523881"
cx="-41.99403"
id="circle16-3-1"
style="fill:#ffffff;fill-opacity:1;stroke:#ff9e14;stroke-width:0.80070943;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
rx="1.0529675"
ry="16.153893"
transform="rotate(-113.27051)"
inkscape:transform-center-x="15.422153"
inkscape:transform-center-y="6.4261504" />
<ellipse
cy="-34.265141"
cx="-41.278408"
id="circle16-3-27"
style="fill:#ffffff;fill-opacity:1;stroke:#ff9e14;stroke-width:0.80070943;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
rx="1.0529675"
ry="16.153893"
transform="rotate(-157.60552)"
inkscape:transform-center-x="6.5400051"
inkscape:transform-center-y="15.374214" />
<circle
r="10.938195"
cy="32"
cx="32"
id="circle16"
style="fill:#ffffff;fill-opacity:1;stroke:#ff9e14;stroke-width:2.12360883;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
</svg>

Before

Width:  |  Height:  |  Size: 724 B

After

Width:  |  Height:  |  Size: 4.8 KiB

View File

@ -1,7 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="64" height="64">
<path style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:4px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 15,2 H 27 V 62 H 15 Z"/>
<path style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:4px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 37,2 H 49 V 62 H 37 Z"/>
<rect width="14" height="44" x="10" y="10" style="fill:#000000;stroke:#ffffff;stroke-width:4px;"/>
<rect width="14" height="44" x="40" y="10" style="fill:#000000;stroke:#ffffff;stroke-width:4px;"/>
</svg>

Before

Width:  |  Height:  |  Size: 467 B

After

Width:  |  Height:  |  Size: 293 B

View File

@ -2,12 +2,12 @@
<svg width="64" height="64">
<g transform="matrix(1.300523,0,0,1.300523,-4.3338536,-458.79144)">
<polygon points="16.142,372.236 26.103,362.274 26.103,394.151 16.142,384.189 7.177,384.189 7.177,372.236 "
style="fill:#333333" />
style="fill:#333333;stroke:#ffffff;stroke-width:4px;" />
<path d="m 34.567,369.749 -2.816,2.816 c 1.447,1.446 2.344,3.444 2.344,5.647 0,2.203 -0.896,4.201 -2.344,5.646 l 2.816,2.816 c 2.168,-2.168 3.512,-5.161 3.512,-8.463 0,-3.302 -1.344,-6.293 -3.512,-8.462 z"
style="fill:#333333" />
style="fill:#333333;stroke:#ffffff;stroke-width:2px;" />
<path d="m 39.704,365.025 -2.816,2.816 c 2.645,2.645 4.283,6.297 4.283,10.324 0,4.027 -1.639,7.68 -4.283,10.324 l 2.816,2.816 c 3.365,-3.367 5.451,-8.015 5.451,-13.141 0,-5.123 -2.086,-9.771 -5.451,-13.139 z"
style="fill:#333333" />
style="fill:#333333;stroke:#ffffff;stroke-width:2px;" />
<path d="m 44.56,359.854 -2.816,2.816 c 3.982,3.982 6.449,9.48 6.449,15.543 0,6.063 -2.467,11.561 -6.447,15.543 l 2.814,2.816 c 4.705,-4.704 7.617,-11.197 7.617,-18.359 0,-7.162 -2.914,-13.655 -7.617,-18.359 z"
style="fill:#333333" />
style="fill:#333333;stroke:#ffffff;stroke-width:2px;" />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -1,5 +1,5 @@
<sizer mode="vert" fill="true" expand="false,true" gravity="right">
<image name="[{ID}]appl-upbar-image" src="DATA:Volume.svg" size="8,8mm"/>
<image name="[{ID}]appl-upbar-image" src="DATA:Volume.svg" size="8,8mm" fill="true" expand="true,false"/>
<appl_VolumeBar name="[{ID}]appl-upbar-range" expand="false,true" fill="true" step="0.3" value="0" min="-40" danger="0.2" max="6" mode="vert"/>
<label name="[{ID}]appl-upbar-label">0dB</label>
</sizer>

View File

@ -14,15 +14,19 @@
<player name="ws-name-player" fill="true" expand="true"/>
</wslider>
<sizer mode="hori" fill="true" expand="true,false" lock="true">
<button name="access-fast-home" shape="">
<image src="DATA:Home.svg" size="8,8mm" />
</button>
<button name="access-fast-group" shape="">
<image src="DATA:Group.svg" size="8,8mm" />
</button>
<spacer expand="true,false"/>
<button name="access-fast-back" shape="">
<image src="DATA:Back.svg" size="8,8mm" />
</button>
<spacer expand="true,false"/>
<button name="access-fast-home" shape="">
<image src="DATA:Home.svg" size="8,8mm" />
</button>
<spacer expand="true,false"/>
<button name="access-fast-group" shape="">
<image src="DATA:Group.svg" size="8,8mm" />
</button>
<spacer expand="true,false"/>
<!--
<button name="access-fast-tv">
<image src="DATA:Tv.svg" size="8,8mm" />
@ -54,6 +58,8 @@
<elem title="_T{Adult TV}" image="" event="menu:TV-adult"/>
</elem>
<separator/>
<elem title="_T{Full screen}" image="DATA:FullScreen.svg" event="menu:full-screen"/>
<separator/>
<elem title="_T{Exit}" image="DATA:Exit.svg" event="menu:exit"/>
</elem>
</menu>