From 7c26f655c00f49ff5c304141865ddeff10d07b89 Mon Sep 17 00:00:00 2001 From: Eric Petit Date: Tue, 3 Jun 2003 12:06:29 +0000 Subject: [PATCH] modules/gui/beos/* : fixed the screenshot format selection I broke lately --- modules/gui/beos/BeOS.cpp | 6 ++++-- modules/gui/beos/VideoOutput.cpp | 19 +++++++++++++++---- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/modules/gui/beos/BeOS.cpp b/modules/gui/beos/BeOS.cpp index dc5460b54d..840aa2f172 100644 --- a/modules/gui/beos/BeOS.cpp +++ b/modules/gui/beos/BeOS.cpp @@ -2,7 +2,7 @@ * beos.cpp : BeOS plugin for vlc ***************************************************************************** * Copyright (C) 2000, 2001 VideoLAN - * $Id: BeOS.cpp,v 1.10 2003/05/07 14:49:19 titer Exp $ + * $Id: BeOS.cpp,v 1.11 2003/06/03 12:06:29 titer Exp $ * * Authors: Jean-Marc Dressler * Samuel Hocevar @@ -46,10 +46,12 @@ void E_(CloseVideo) ( vlc_object_t * ); /***************************************************************************** * Module descriptor *****************************************************************************/ +static char * ppsz_screenshotformat[] = { "TGA", "PPM", "PNG", "JPEG", "BMP", NULL }; + vlc_module_begin(); add_bool( "beos-dvdmenus", 0, NULL, "Use DVD Menus", "", VLC_TRUE ); add_string( "beos-screenshotpath", "/boot/home/", NULL, "Screenshot Path", "", VLC_TRUE ); - add_string( "beos-screenshotformat", NULL, NULL, "Screenshot Format", "", VLC_TRUE ); + add_string_from_list( "beos-screenshotformat", "PNG", ppsz_screenshotformat, NULL, "Screenshot Format", "", VLC_TRUE ); set_description( _("BeOS standard API interface") ); add_submodule(); set_capability( "interface", 100 ); diff --git a/modules/gui/beos/VideoOutput.cpp b/modules/gui/beos/VideoOutput.cpp index bd5f863b48..f7f5979a05 100644 --- a/modules/gui/beos/VideoOutput.cpp +++ b/modules/gui/beos/VideoOutput.cpp @@ -2,7 +2,7 @@ * vout_beos.cpp: beos video output display method ***************************************************************************** * Copyright (C) 2000, 2001 VideoLAN - * $Id: VideoOutput.cpp,v 1.19 2003/05/08 10:40:31 titer Exp $ + * $Id: VideoOutput.cpp,v 1.20 2003/06/03 12:06:29 titer Exp $ * * Authors: Jean-Marc Dressler * Samuel Hocevar @@ -383,12 +383,23 @@ VideoWindow::MessageReceived( BMessage *p_message ) dst += dstBpr; src += srcBpr; } - char* path = config_GetPsz( p_vout, "beos-screenshotpath" ); + char * path = config_GetPsz( p_vout, "beos-screenshotpath" ); if ( !path ) path = strdup( DEFAULT_SCREEN_SHOT_PATH ); - /* TODO: handle the format */ - /* config_GetPsz( p_vout, "beos-screenshotformat" ); */ + + /* FIXME - we should check which translators are + actually available */ + char * psz_format = config_GetPsz( p_vout, "beos-screenshotformat" ); int32 format = DEFAULT_SCREEN_SHOT_FORMAT; + if( !strcmp( psz_format, "TGA" ) ) + format = 'TGA '; + else if( !strcmp( psz_format, "PPM" ) ) + format = 'PPM '; + else if( !strcmp( psz_format, "JPEG" ) ) + format = 'JPEG'; + else if( !strcmp( psz_format, "BMP" ) ) + format = 'BMP '; + _SaveScreenShot( temp, path, format ); } else -- 2.39.2