From 096ff605c2bed65039d8b926f5aeabe48df341ba Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Sun, 8 Jan 2012 10:40:38 +0000 Subject: [PATCH] movieplayer: sample code to save screenshot git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@2047 e54a6e83-5905-42d5-8d5c-058d10e6a962 Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/058766219bb47bab0708497a34a56fdf4a634eea Author: [CST] Focus Date: 2012-01-08 (Sun, 08 Jan 2012) ------------------ This commit was generated by Migit --- src/gui/movieplayer.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 6bb281cc9..e91327f00 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -38,6 +38,7 @@ #include #include #include +#include #include #include @@ -578,6 +579,21 @@ void CMoviePlayerGui::PlayFile(void) } if(restore) FileTime.show(position); + } else if (msg == (neutrino_msg_t) g_settings.key_screenshot) { + std::string fname = full_name; + std::string::size_type pos = fname.find_last_of('.'); + if(pos != std::string::npos) { + fname.replace(pos, fname.length(), ".jpg"); + } else + fname += ".jpg"; + +#if 0 // TODO disable overwrite ? + if(!access(fname.c_str(), F_OK)) { + } +#endif + CScreenShot * sc = new CScreenShot(fname); + sc->Start(); + } else if ( msg == NeutrinoMessages::ANNOUNCE_RECORD || msg == NeutrinoMessages::RECORD_START) { CNeutrinoApp::getInstance()->handleMsg(msg, data);