[Scummvm-cvs-logs] SF.net SVN: scummvm:[46438] tools/branches/gsoc2009-gui

sev at users.sourceforge.net sev at users.sourceforge.net
Sun Dec 20 20:42:02 CET 2009


Revision: 46438
          http://scummvm.svn.sourceforge.net/scummvm/?rev=46438&view=rev
Author:   sev
Date:     2009-12-20 19:42:02 +0000 (Sun, 20 Dec 2009)

Log Message:
-----------
Fix misleading behavior with temp file extention being always .mp3 when run via GUI.

Modified Paths:
--------------
    tools/branches/gsoc2009-gui/compress.cpp
    tools/branches/gsoc2009-gui/compress.h
    tools/branches/gsoc2009-gui/tool.cpp
    tools/branches/gsoc2009-gui/tool.h

Modified: tools/branches/gsoc2009-gui/compress.cpp
===================================================================
--- tools/branches/gsoc2009-gui/compress.cpp	2009-12-20 19:22:47 UTC (rev 46437)
+++ tools/branches/gsoc2009-gui/compress.cpp	2009-12-20 19:42:02 UTC (rev 46438)
@@ -910,17 +910,14 @@
 	// Need workaround to be sign-correct
 	switch (_format) {
 	case AUDIO_MP3:
-		tempEncoded = TEMP_MP3;
 		if (!processMp3Parms())
 			throw ToolException("Could not parse command line arguments, use --help for options");
 		break;
 	case AUDIO_VORBIS:
-		tempEncoded = TEMP_OGG;
 		if (!processOggParms())
 			throw ToolException("Could not parse command line arguments, use --help for options");
 		break;
 	case AUDIO_FLAC:
-		tempEncoded = TEMP_FLAC;
 		if (!processFlacParms())
 			throw ToolException("Could not parse arguments: Use --help for options");
 		break;
@@ -929,6 +926,22 @@
 	}
 }
 
+void CompressionTool::setTempFileName() {
+	switch (_format) {
+	case AUDIO_MP3:
+		tempEncoded = TEMP_MP3;
+		break;
+	case AUDIO_VORBIS:
+		tempEncoded = TEMP_OGG;
+		break;
+	case AUDIO_FLAC:
+		tempEncoded = TEMP_FLAC;
+		break;
+	default: // cannot occur but we check anyway to avoid compiler warnings
+		throw ToolException("Unknown audio format, should be impossible!");
+	}
+}
+
 std::string CompressionTool::getHelp() const {
 	std::ostringstream os;
 	

Modified: tools/branches/gsoc2009-gui/compress.h
===================================================================
--- tools/branches/gsoc2009-gui/compress.h	2009-12-20 19:22:47 UTC (rev 46437)
+++ tools/branches/gsoc2009-gui/compress.h	2009-12-20 19:42:02 UTC (rev 46438)
@@ -127,6 +127,8 @@
 	bool processOggParms();
 	bool processFlacParms();
 
+	void setTempFileName();
+
 	void extractAndEncodeVOC(const char *outName, File &input, AudioFormat compMode);
 	void extractAndEncodeWAV(const char *outName, File &input, AudioFormat compMode);
 

Modified: tools/branches/gsoc2009-gui/tool.cpp
===================================================================
--- tools/branches/gsoc2009-gui/tool.cpp	2009-12-20 19:22:47 UTC (rev 46437)
+++ tools/branches/gsoc2009-gui/tool.cpp	2009-12-20 19:42:02 UTC (rev 46438)
@@ -135,6 +135,8 @@
 	_abort = false;
 	
 
+	setTempFileName();
+
 	// Change output to directory if necessary
 	if (_outputToDirectory && _outputPath.empty() == false) {
 		// Ensure last character is a /, this way we force directory output
@@ -259,6 +261,9 @@
 void Tool::parseAudioArguments() {
 }
 
+void Tool::setTempFileName() {
+}
+
 void Tool::parseOutputArguments() {
 	if (_arguments.empty())
 		return;

Modified: tools/branches/gsoc2009-gui/tool.h
===================================================================
--- tools/branches/gsoc2009-gui/tool.h	2009-12-20 19:22:47 UTC (rev 46437)
+++ tools/branches/gsoc2009-gui/tool.h	2009-12-20 19:42:02 UTC (rev 46438)
@@ -190,6 +190,7 @@
 
 protected:
 	virtual void parseAudioArguments();
+	virtual void setTempFileName();
 	void parseOutputArguments();
 
 	/** Parses the arguments only this tool takes. */


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list