mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-30 17:01:08 +02:00
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
------------------
Commit: 058766219b
Author: [CST] Focus <focus.cst@gmail.com>
Date: 2012-01-08 (Sun, 08 Jan 2012)
This commit is contained in:
@@ -38,6 +38,7 @@
|
||||
#include <gui/widget/helpbox.h>
|
||||
#include <gui/infoclock.h>
|
||||
#include <gui/plugins.h>
|
||||
#include <driver/screenshot.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@@ -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);
|
||||
|
Reference in New Issue
Block a user