Evas_Object *getVideoSink() const;
std::string getMediaPath() const;
const std::list<std::string> &getAttachments() const;
+ static bool isEmpty(const MsgPage &page);
private:
const MsgMedia *getMedia(const MsgPage &page, MsgMedia::Type type) const;
return nullptr;
}
+bool SmilPage::isEmpty(const MsgPage &page)
+{
+ const MsgMediaList &list = page.getMediaList();
+ for(int i = 0; i < list.getLength(); ++i)
+ {
+ const MsgMedia &media = list[i];
+ std::string filePath = media.getFilePath();
+ if(media.getType() != MsgMedia::UnknownType && FileUtils::getFileSize(filePath) > 0)
+ return false;
+ }
+ return true;
+}
+
void SmilPage::build(const MsgPage &page)
{
m_Duration = page.getPageDuration() / 1000.0 + 0.5;
const MsgPageList &pages = mms.getPageList();
for(int i = 0; i < pages.getLength(); ++i)
{
- SmilPage *smilPage = new SmilPage(getEo(), pages[i]);
- m_Duration += smilPage->getDuration();
- m_PageList.push_back(smilPage);
+ const MsgPage &page = pages[i];
+ if(!SmilPage::isEmpty(page))
+ {
+ SmilPage *smilPage = new SmilPage(getEo(), page);
+ m_Duration += smilPage->getDuration();
+ m_PageList.push_back(smilPage);
+ }
}
// Attachment:
}
createLayout();
+ createSmilPlayer();
createSubjectLayout();
createPlayerControl();
createRecipPanel();
- createSmilPlayer();
updateButtonState();
updatePlayPos();
{
if(!m_pSubjectLayout)
{
+ int numberOfPages = m_pSmilPlayer ? m_pSmilPlayer->getPages().size() : 0;
m_pSubjectLayout = new SubjectLayout(*m_pLayout);
-
- int numberOfPages = m_Msg->getPageList().getLength();
- if(!m_Msg->getAttachmentList().isEmpty())
- numberOfPages += 1;
-
m_pSubjectLayout->setNumberOfPages(numberOfPages);
m_pSubjectLayout->show();
m_pLayout->setSubject(*m_pSubjectLayout);