-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New command line options and small bugfixes
- Loading branch information
Christoph Ebner
authored and
Christoph Ebner
committed
Jun 15, 2015
1 parent
440f142
commit 798f819
Showing
45 changed files
with
6,798 additions
and
440 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
* DestinationFolderSetting.cpp | ||
* | ||
* Created on: 02.06.2015 | ||
* Author: Christoph | ||
*/ | ||
|
||
#include "DestinationFolderSetting.h" | ||
#include "UserInterface.h" | ||
|
||
DestinationFolderSetting::DestinationFolderSetting(UserInterface const& ui) | ||
: FolderSetting(ui, "destination", "Where to save processed movies", | ||
"Please enter the path where poisonconvert should save processed movies " | ||
"(if you leave the optoin empty, processed movies stay in their source directory).", | ||
"Destination equals source") | ||
{ | ||
} | ||
|
||
DestinationFolderSetting::~DestinationFolderSetting() | ||
{ | ||
} | ||
|
||
DestinationFolderSetting::PARAM_CHANGE_RETURN DestinationFolderSetting::checkParam(string const& new_param, | ||
bool ui_output) | ||
{ | ||
if (new_param.empty() || "Destination equals source") | ||
{ | ||
if (ui_output) | ||
{ | ||
ui_.writeString("The video will not be moved after processing has finished.", true); | ||
} | ||
return PARAM_CHANGE_SUCCESS; | ||
} | ||
else | ||
{ | ||
return FolderSetting::checkParam(new_param, ui_output); | ||
} | ||
} | ||
|
||
void DestinationFolderSetting::changeParam(string const& new_param) | ||
//We can assume that new_param is either y or n since checkParam was called before ... | ||
{ | ||
if (new_param.empty()) | ||
{ | ||
settings_param_ = "Destination equals source"; | ||
} | ||
else | ||
{ | ||
settings_param_ = new_param; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* DestinationFolderSetting.h | ||
* | ||
* Created on: 02.06.2015 | ||
* Author: Christoph | ||
*/ | ||
|
||
#ifndef DESTINATIONFOLDERSETTING_H_ | ||
#define DESTINATIONFOLDERSETTING_H_ | ||
|
||
#include "FolderSetting.h" | ||
|
||
class DestinationFolderSetting: public FolderSetting { | ||
public: | ||
DestinationFolderSetting(UserInterface const& ui); | ||
virtual ~DestinationFolderSetting(); | ||
|
||
private: | ||
virtual PARAM_CHANGE_RETURN checkParam(string const& new_param, bool ui_output); | ||
void changeParam(string const& new_param); | ||
}; | ||
|
||
#endif /* DESTINATIONFOLDERSETTING_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// | ||
// Copyright 2014 CutePoisonX ([email protected]) | ||
// | ||
// This file is part of PoisonConvert. | ||
// | ||
// PoisonConvert is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// PoisonConvert is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with PoisonConvert. If not, see <http://www.gnu.org/licenses/>. | ||
// | ||
|
||
#include "FileSetting.h" | ||
|
||
#include "UserInterface.h" | ||
|
||
FileSetting::FileSetting(UserInterface ui, string name, string description, | ||
string settings_change_prompt, string default_param, | ||
string error_promp_str) | ||
: Settings(ui, name, description, settings_change_prompt, default_param), | ||
error_promp_str_(error_promp_str) | ||
{ | ||
} | ||
|
||
FileSetting::FileSetting(const Settings& orig) | ||
: Settings(orig) | ||
{ | ||
} | ||
|
||
FileSetting::~FileSetting() | ||
{ | ||
} | ||
|
||
FileSetting::PARAM_CHANGE_RETURN FileSetting::checkParam(string const& new_param, bool ui_output) | ||
//note: this method does not check whether a file actually exists, but | ||
//only if the string provided by "new_param" is non-empty! | ||
{ | ||
if(new_param.empty()) | ||
{ | ||
if (ui_output) | ||
{ | ||
ui_.writeString(error_promp_str_, true); | ||
} | ||
return PARAM_CHANGE_ERROR; | ||
} | ||
|
||
return PARAM_CHANGE_SUCCESS; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// | ||
// Copyright 2014 CutePoisonX ([email protected]) | ||
// | ||
// This file is part of PoisonConvert. | ||
// | ||
// PoisonConvert is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// PoisonConvert is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with PoisonConvert. If not, see <http://www.gnu.org/licenses/>. | ||
// | ||
|
||
#ifndef FILESETTING_H | ||
#define FILESETTING_H | ||
|
||
#include "Settings.h" | ||
#include <string> | ||
|
||
class UserInterface; | ||
using namespace std; | ||
|
||
class FileSetting : public Settings { | ||
public: | ||
FileSetting(UserInterface ui, string name, string description, | ||
string settings_change_prompt, string default_param, | ||
string error_promp_str); | ||
FileSetting(const Settings& orig); | ||
virtual ~FileSetting(); | ||
|
||
protected: | ||
virtual PARAM_CHANGE_RETURN checkParam(string const& new_param, bool ui_output); | ||
|
||
string error_promp_str_; | ||
|
||
}; | ||
|
||
#endif /* FILESETTING_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.