-add settings menu screenshot

git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@2113 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
satbaby
2012-02-18 17:16:30 +00:00
parent c85c353344
commit 382ec004ab
13 changed files with 122 additions and 22 deletions

View File

@@ -1193,7 +1193,15 @@ scrambled_channel Verschlüsselung aktiv
screensetup.lowerright grün = Bildrand unten, rechts
screensetup.upperleft rot = Bildrand oben, links
screenshot.count Screenshot Anzahl
screenshot.cover Film Cover
screenshot.defdir Screenshot Dir.
screenshot.format Screenshot Format
screenshot.info Screenshot Taste ist nicht belegt
screenshot.menu Screenshot
screenshot.osd OSD Auflösung
screenshot.scale Scale
screenshot.tv TV Auflösung
screenshot.video Screenshot mit Video Hintergrund
servicemenu.getplugins Plugins neu laden
servicemenu.getplugins_hint Plugins werden neu geladen,\nbitte warten...
servicemenu.head Service

View File

@@ -1193,7 +1193,15 @@ scrambled_channel Scrambled channel
screensetup.lowerright green = setup lower right
screensetup.upperleft red = setup upper left
screenshot.count Screenshot count
screenshot.cover Movie Cover
screenshot.defdir Screenshot dir.
screenshot.format Screenshot format
screenshot.info Screenshot Key is not used
screenshot.menu Screenshot
screenshot.osd OSD resolution
screenshot.scale Scale
screenshot.tv TV resolution
screenshot.video Screenshot with Video background
servicemenu.getplugins Reload plugins
servicemenu.getplugins_hint Reloading plugins,\nplease be patient.
servicemenu.head Service

View File

@@ -59,9 +59,9 @@ CScreenShot::CScreenShot(const std::string fname, screenshot_format_t fmt)
fd = NULL;
xres = 0;
yres = 0;
get_video = true;
get_osd = false;
scale_to_video = false;
get_video = g_settings.screenshot_video;
get_osd = g_settings.screenshot_mode;
scale_to_video = g_settings.screenshot_scale;
}
CScreenShot::~CScreenShot()
@@ -355,9 +355,7 @@ void CScreenShot::MakeFileName(const t_channel_id channel_id)
CEPGData epgData;
unsigned int pos = 0;
//TODO settings to select screenshot dir ?
sprintf(fname, "%s/", g_settings.network_nfs_recordingdir);
snprintf(fname, sizeof(fname), "%s/", g_settings.screenshot_dir.c_str());
pos = strlen(fname);
channel_name = g_Zapit->getChannelName(channel_id);

View File

@@ -848,7 +848,10 @@ void CInfoViewer::loop(bool show_dot)
while (!(res & (messages_return::cancel_info | messages_return::cancel_all))) {
g_RCInput->getMsgAbsoluteTimeout (&msg, &data, &timeoutEnd);
if (msg == CRCInput::RC_sat || msg == CRCInput::RC_favorites) {
if (msg == (neutrino_msg_t) g_settings.key_screenshot) {
res = CNeutrinoApp::getInstance()->handleMsg(msg, data);
} else if (msg == CRCInput::RC_sat || msg == CRCInput::RC_favorites) {
g_RCInput->postMsg (msg, 0);
res = messages_return::cancel_info;
}

View File

@@ -146,14 +146,6 @@ const CMenuOptionChooser::keyval KEYBINDINGMENU_BOUQUETHANDLING_OPTIONS[KEYBINDI
{ 2, LOCALE_KEYBINDINGMENU_ALLCHANNELS_ON_OK }
};
#define KEYBINDINGMENU_SCREENSHOT_FMT_OPTION_COUNT 3
const CMenuOptionChooser::keyval_ext KEYBINDINGMENU_SCREENSHOT_FMT_OPTIONS[KEYBINDINGMENU_SCREENSHOT_FMT_OPTION_COUNT] =
{
{ CScreenShot::FORMAT_PNG, NONEXISTANT_LOCALE, "PNG" },
{ CScreenShot::FORMAT_JPG, NONEXISTANT_LOCALE, "JPEG" },
{ CScreenShot::FORMAT_BMP, NONEXISTANT_LOCALE, "BMP" }
};
typedef struct key_settings_t
{
const neutrino_locale_t keydescription;
@@ -290,8 +282,6 @@ void CKeybindSetup::showKeyBindSetup(CMenuWidget *bindSettings)
//bindSettings->addItem(new CMenuForwarder(keydescription[KEY_PLUGIN], true, NULL, keychooser[KEY_PLUGIN]));
bindSettings->addItem(new CMenuForwarder(key_settings[KEY_UNLOCK].keydescription, true, keychooser[KEY_UNLOCK]->getKeyName(), keychooser[KEY_UNLOCK]));
bindSettings->addItem(new CMenuForwarder(key_settings[KEY_SCREENSHOT].keydescription, true, keychooser[KEY_SCREENSHOT]->getKeyName(), keychooser[KEY_SCREENSHOT]));
bindSettings->addItem(new CMenuOptionNumberChooser(LOCALE_SCREENSHOT_COUNT, &g_settings.screenshot_count, true, 1, 5, NULL));
bindSettings->addItem(new CMenuOptionChooser(LOCALE_SCREENSHOT_FORMAT, &g_settings.screenshot_format, KEYBINDINGMENU_SCREENSHOT_FMT_OPTIONS, KEYBINDINGMENU_SCREENSHOT_FMT_OPTION_COUNT, true));
//bindSettings->addItem(new CMenuOptionChooser(LOCALE_EXTRA_ZAP_CYCLE, &g_settings.zap_cycle, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true));
bindSettings->addItem(new CMenuOptionChooser(LOCALE_EXTRA_MENU_LEFT_EXIT, &g_settings.menu_left_exit, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true));
bindSettings->addItem(new CMenuOptionChooser(LOCALE_EXTRA_AUDIO_RUN_PLAYER, &g_settings.audio_run_player, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true));

View File

@@ -586,18 +586,33 @@ void CMoviePlayerGui::PlayFile(void)
if(restore)
FileTime.show(position);
} else if (msg == (neutrino_msg_t) g_settings.key_screenshot) {
char ending[(sizeof(int)*2) + 6] = ".jpg";
if(!g_settings.screenshot_cover)
snprintf(ending, sizeof(ending) - 1, "_%x.jpg", position);
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");
fname.replace(pos, fname.length(), ending);
} else
fname += ".jpg";
fname += ending;
if(!g_settings.screenshot_cover){
pos = fname.find_last_of('/');
if(pos != std::string::npos) {
std::string fname_scr=fname;
fname.replace(0, pos, g_settings.screenshot_dir);
}
}
#if 0 // TODO disable overwrite ?
if(!access(fname.c_str(), F_OK)) {
}
#endif
CScreenShot * sc = new CScreenShot(fname);
if(g_settings.screenshot_cover && !g_settings.screenshot_video)
sc->EnableVideo(true);
sc->Start();
} else if ( msg == NeutrinoMessages::ANNOUNCE_RECORD ||

View File

@@ -52,6 +52,7 @@
#include <gui/widget/stringinput.h>
#include <driver/screen_max.h>
#include <driver/screenshot.h>
#include <system/debug.h>
@@ -257,6 +258,11 @@ int COsdSetup::exec(CMenuTarget* parent, const std::string &actionKey)
chooserDir(g_settings.logo_hdd_dir, false, action_str);
return menu_return::RETURN_REPAINT;
}
else if(actionKey=="screenshot_dir") {
const char *action_str = "screenshot";
chooserDir(g_settings.screenshot_dir, true, action_str);
return menu_return::RETURN_REPAINT;
}
else if(strncmp(actionKey.c_str(), "fontsize.d", 10) == 0) {
for (int i = 0; i < 6; i++) {
if (actionKey == font_sizes_groups[i].actionkey) {
@@ -413,6 +419,11 @@ int COsdSetup::showOsdSetup()
showOsdChanlistSetup(osd_menu_chanlist);
osd_menu->addItem( new CMenuForwarder(LOCALE_MISCSETTINGS_CHANNELLIST, true, NULL, osd_menu_chanlist, NULL, CRCInput::RC_2));
//screenshot
CMenuWidget *osd_menu_screenshot = new CMenuWidget(LOCALE_MAINMENU_SETTINGS, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_OSDSETUP_SCREENSHOT);
showOsdScreenshottSetup(osd_menu_screenshot);
osd_menu->addItem( new CMenuForwarder(LOCALE_SCREENSHOT_MENU, true, NULL, osd_menu_screenshot, NULL, CRCInput::RC_3));
//monitor
//CScreenPresetNotifier * presetNotify = new CScreenPresetNotifier();
//osd_menu->addItem(new CMenuOptionChooser(LOCALE_COLORMENU_OSD_PRESET, &g_settings.screen_preset, OSD_PRESET_OPTIONS, OSD_PRESET_OPTIONS_COUNT, true, presetNotify));
@@ -619,9 +630,9 @@ void COsdSetup::showOsdChanlistSetup(CMenuWidget *menu_chanlist)
{
menu_chanlist->addIntroItems(LOCALE_MISCSETTINGS_CHANNELLIST);
menu_chanlist->addItem(new CMenuOptionChooser(LOCALE_MISCSETTINGS_CHANNELLIST_EPGTEXT_ALIGN, &g_settings.channellist_epgtext_align_right, CHANNELLIST_EPGTEXT_ALIGN_RIGHT_OPTIONS, CHANNELLIST_EPGTEXT_ALIGN_RIGHT_OPTIONS_COUNT, true));
menu_chanlist->addItem(new CMenuOptionChooser(LOCALE_CHANNELLIST_EXTENDED, &g_settings.channellist_extended, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true));
menu_chanlist->addItem(new CMenuOptionChooser(LOCALE_CHANNELLIST_FOOT, &g_settings.channellist_foot, CHANNELLIST_FOOT_OPTIONS, CHANNELLIST_FOOT_OPTIONS_COUNT, true));
menu_chanlist->addItem(new CMenuOptionChooser(LOCALE_MISCSETTINGS_CHANNELLIST_EPGTEXT_ALIGN, &g_settings.channellist_epgtext_align_right, CHANNELLIST_EPGTEXT_ALIGN_RIGHT_OPTIONS, CHANNELLIST_EPGTEXT_ALIGN_RIGHT_OPTIONS_COUNT, true));
menu_chanlist->addItem(new CMenuOptionChooser(LOCALE_CHANNELLIST_EXTENDED, &g_settings.channellist_extended, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true));
menu_chanlist->addItem(new CMenuOptionChooser(LOCALE_CHANNELLIST_FOOT, &g_settings.channellist_foot, CHANNELLIST_FOOT_OPTIONS, CHANNELLIST_FOOT_OPTIONS_COUNT, true));
menu_chanlist->addItem(new CMenuOptionChooser(LOCALE_MISCSETTINGS_CHANNELLIST_COLORED_EVENTS, &g_settings.colored_events_channellist, OPTIONS_COLORED_EVENTS_OPTIONS, OPTIONS_COLORED_EVENTS_OPTION_COUNT, true));
}
@@ -696,3 +707,34 @@ int COsdSetup::showContextChanlistMenu()
delete menu_chanlist;
return res;
}
//screenshot
#define SCREENSHOT_FMT_OPTION_COUNT 3
const CMenuOptionChooser::keyval_ext SCREENSHOT_FMT_OPTIONS[SCREENSHOT_FMT_OPTION_COUNT] =
{
{ CScreenShot::FORMAT_PNG, NONEXISTANT_LOCALE, "PNG" },
{ CScreenShot::FORMAT_JPG, NONEXISTANT_LOCALE, "JPEG" },
{ CScreenShot::FORMAT_BMP, NONEXISTANT_LOCALE, "BMP" }
};
#define SCREENSHOT_OPTION_COUNT 2
const CMenuOptionChooser::keyval SCREENSHOT_OPTIONS[SCREENSHOT_OPTION_COUNT] =
{
{ 0, LOCALE_SCREENSHOT_TV },
{ 1, LOCALE_SCREENSHOT_OSD }
};
void COsdSetup::showOsdScreenshottSetup(CMenuWidget *menu_screenshot)
{
menu_screenshot->addIntroItems(LOCALE_SCREENSHOT_MENU);
if((uint)g_settings.key_screenshot == CRCInput::RC_nokey)
menu_screenshot->addItem( new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_SCREENSHOT_INFO));
menu_screenshot->addItem(new CMenuOptionNumberChooser(LOCALE_SCREENSHOT_COUNT, &g_settings.screenshot_count, true, 1, 5, NULL));
menu_screenshot->addItem(new CMenuOptionChooser(LOCALE_SCREENSHOT_FORMAT, &g_settings.screenshot_format, SCREENSHOT_FMT_OPTIONS, SCREENSHOT_FMT_OPTION_COUNT, true));
menu_screenshot->addItem(new CMenuForwarder(LOCALE_SCREENSHOT_DEFDIR, true, g_settings.screenshot_dir, this, "screenshot_dir"));
menu_screenshot->addItem(new CMenuOptionChooser(LOCALE_SCREENSHOT_MENU, &g_settings.screenshot_mode, SCREENSHOT_OPTIONS, SCREENSHOT_OPTION_COUNT, true));
menu_screenshot->addItem(new CMenuOptionChooser(LOCALE_SCREENSHOT_VIDEO, &g_settings.screenshot_video, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true));
// menu_screenshot->addItem(new CMenuOptionChooser(LOCALE_SCREENSHOT_SCALE, &g_settings.screenshot_scale, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true));
menu_screenshot->addItem(new CMenuOptionChooser(LOCALE_SCREENSHOT_COVER, &g_settings.screenshot_cover, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true));
}

View File

@@ -57,6 +57,7 @@ class COsdSetup : public CMenuTarget, public CChangeObserver
void showOsdTimeoutSetup(CMenuWidget *menu_timeout);
void showOsdInfobarSetup(CMenuWidget *menu_infobar);
void showOsdChanlistSetup(CMenuWidget *menu_chanlist);
void showOsdScreenshottSetup(CMenuWidget *menu_screenshot);
void AddFontSettingItem(CMenuWidget &font_Settings, const SNeutrinoSettings::FONT_TYPES number_of_fontsize_entry);

View File

@@ -585,6 +585,12 @@ int CNeutrinoApp::loadSetup(const char * fname)
g_settings.screenshot_count = configfile.getInt32( "screenshot_count", 1);
g_settings.screenshot_format = configfile.getInt32( "screenshot_format", 1);
g_settings.screenshot_cover = configfile.getInt32( "screenshot_cover", 0);
g_settings.screenshot_mode = configfile.getInt32( "screenshot_mode", 0);
g_settings.screenshot_video = configfile.getInt32( "screenshot_video", 1);
g_settings.screenshot_scale = configfile.getInt32( "screenshot_scale", 0);
g_settings.screenshot_dir = configfile.getString( "screenshot_dir", "/media/sda1/movies" );
g_settings.cacheTXT = configfile.getInt32( "cacheTXT", 0);
g_settings.minimode = configfile.getInt32( "minimode", 0);
g_settings.mode_clock = configfile.getInt32( "mode_clock", 0);
@@ -995,6 +1001,12 @@ void CNeutrinoApp::saveSetup(const char * fname)
//printf("set: key_unlock =============== %d\n", g_settings.key_unlock);
configfile.setInt32( "screenshot_count", g_settings.screenshot_count );
configfile.setInt32( "screenshot_format", g_settings.screenshot_format );
configfile.setInt32( "screenshot_cover", g_settings.screenshot_cover );
configfile.setInt32( "screenshot_mode", g_settings.screenshot_mode );
configfile.setInt32( "screenshot_video", g_settings.screenshot_video );
configfile.setInt32( "screenshot_scale", g_settings.screenshot_scale );
configfile.setString( "screenshot_dir", g_settings.screenshot_dir);
configfile.setInt32( "cacheTXT", g_settings.cacheTXT );
configfile.setInt32( "minimode", g_settings.minimode );
configfile.setInt32( "mode_clock", g_settings.mode_clock );

View File

@@ -60,6 +60,7 @@ enum MN_WIDGET_ID
MN_WIDGET_ID_OSDSETUP_INFOBAR,
MN_WIDGET_ID_OSDSETUP_MENUCOLORS,
MN_WIDGET_ID_OSDSETUP_TIMEOUT,
MN_WIDGET_ID_OSDSETUP_SCREENSHOT,
//actually it does not matter, but these 6 entries must be the same order as in menu
MN_WIDGET_ID_OSDSETUP_FONTSIZE_MENU,
MN_WIDGET_ID_OSDSETUP_FONTSIZE_CHANNELLIST,

View File

@@ -1220,7 +1220,15 @@ typedef enum
LOCALE_SCREENSETUP_LOWERRIGHT,
LOCALE_SCREENSETUP_UPPERLEFT,
LOCALE_SCREENSHOT_COUNT,
LOCALE_SCREENSHOT_COVER,
LOCALE_SCREENSHOT_DEFDIR,
LOCALE_SCREENSHOT_FORMAT,
LOCALE_SCREENSHOT_INFO,
LOCALE_SCREENSHOT_MENU,
LOCALE_SCREENSHOT_OSD,
LOCALE_SCREENSHOT_SCALE,
LOCALE_SCREENSHOT_TV,
LOCALE_SCREENSHOT_VIDEO,
LOCALE_SERVICEMENU_GETPLUGINS,
LOCALE_SERVICEMENU_GETPLUGINS_HINT,
LOCALE_SERVICEMENU_HEAD,

View File

@@ -1220,7 +1220,15 @@ const char * locale_real_names[] =
"screensetup.lowerright",
"screensetup.upperleft",
"screenshot.count",
"screenshot.cover",
"screenshot.defdir",
"screenshot.format",
"screenshot.info",
"screenshot.menu",
"screenshot.osd",
"screenshot.scale",
"screenshot.tv",
"screenshot.video",
"servicemenu.getplugins",
"servicemenu.getplugins_hint",
"servicemenu.head",

View File

@@ -371,9 +371,15 @@ struct SNeutrinoSettings
int key_plugin;
int key_unlock;
int key_screenshot;
int screenshot_count;
int screenshot_format;
int screenshot_cover;
int screenshot_mode;
int screenshot_video;
int screenshot_scale;
std::string screenshot_dir;
int key_current_transponder;