Skip to content

Commit

Permalink
Merged version 1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
CutePoisonX committed Sep 25, 2014
2 parents 8769f1f + 2048864 commit 8ed1ac8
Show file tree
Hide file tree
Showing 40 changed files with 1,929 additions and 454 deletions.
26 changes: 19 additions & 7 deletions AnalyzeMedia.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
/*
* File: AnalyzeMedia.cpp
* Author: CutePoisonX
*
* Created on 10. Februar 2013, 10:14
*/
//
// Copyright 2014 CutePoisonX (CutePoisonXI@gmail.com)
//
// 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 <string>

Expand All @@ -27,7 +39,7 @@ int AnalyzeMedia::saveToVector(string& param1, string& param2, string& param3,
string& param4, string& param5, unsigned int priority,
unsigned int identifier)
{
vector<StreamPreference*>& tmp = getVector(identifier);
vector<StreamPreference*>& tmp = getVector(identifier);

tmp.push_back(new StreamPreference(param1, param2, param3, param4, param5));
}
Expand Down
24 changes: 18 additions & 6 deletions AnalyzeMedia.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
/*
* File: AnalyzeMedia.h
* Author: CutePoisonX
*
* Created on 10. Februar 2013, 10:14
*/
//
// Copyright 2014 CutePoisonX (CutePoisonXI@gmail.com)
//
// 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 ANALYZEMEDIA_H
#define ANALYZEMEDIA_H
Expand Down
16 changes: 15 additions & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,9 +1,23 @@
Version 1.4 1) Added recursive directory scanning for movies
2) Config-files are located in /opt/etc/PoisonConvert_Config-files by default
3) Added config-file for the chromecast
4) Processed files get now only deleted when conversion was successful
(this makes the "delete"-setting saver)
The success is determined by comparing the duration and streams.
5) Failed files are reverted automatically (they do not get .old etc.
appended)
6) Added makefile installer
7) Removed some bad "system" calls
8) Added functionality to specify "-" for the container in order to analyze any file
9) Bugfixes
10) Added licence
------------------------------------------------------------------------------------------
Version 1.3 1) Rewritten settings-behaviour (it is much easier now to add settings)
2) Added useful settings
3) poisonconvert can now be placed in /opt/bin/ (global scope)
4) Enhanced Logfile
5) No restart necessary after changing the config-file
6) Settings-file is now created in /opt/etc/ and will be created automatically (filename: PoisonConver_Settings)
6) Settings-file is now created in /opt/etc/ and will be created automatically (filename: PoisonConvert_Settings)
7) All temporary files are now created in /opt/tmp/
8) Changed some prompts
9) Bugfixes
Expand Down
674 changes: 674 additions & 0 deletions COPYING

Large diffs are not rendered by default.

30 changes: 21 additions & 9 deletions ConfigMode.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
/*
* File: ConfigMode.cpp
* Author: CutePoisonX
*
* Created on 04. Februar 2013, 14:34
*/
//
// Copyright 2014 CutePoisonX (CutePoisonXI@gmail.com)
//
// 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 "ConfigMode.h"
#include "UserInterface.h"
Expand Down Expand Up @@ -1559,10 +1571,10 @@ int ConfigMode::listRule(string& param_prompt1, string& param_prompt2,
ui_.writeString(" is ");
ui_.writeString(param1_);
}
ui_.writeString(", ");
}
if (param2_ != "-")
{
ui_.writeString(", ");
ui_.writeString(param_prompt2);
if (param2_.compare(0, 3, "NOT") == 0)
{
Expand Down Expand Up @@ -1718,10 +1730,10 @@ int ConfigMode::deleteConfig()
ui_.writeString(" Do you want to delete an output-stream or a rule?", true);
ui_.writeString(" [");
ui_.writeString("rule", false, "yellow");
ui_.writeString("] - create new rule", true); //OK
ui_.writeString("] - delete rule", true);
ui_.writeString(" [");
ui_.writeString("target", false, "yellow");
ui_.writeString("] - create new output-stream", true);
ui_.writeString("] - delete output-stream", true);
ui_.writeString(" [");
ui_.writeString("exit", false, "yellow");
ui_.writeString("] - go back", true);
Expand Down
24 changes: 18 additions & 6 deletions ConfigMode.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
/*
* File: ConfigMode.h
* Author: CutePoisonX
*
* Created on 04. Februar 2013, 14:34
*/
//
// Copyright 2014 CutePoisonX (CutePoisonXI@gmail.com)
//
// 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 CONFIGMODE_H
#define CONFIGMODE_H
Expand Down
26 changes: 19 additions & 7 deletions FileException.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
/*
* File: FileException.cpp
* Author: CutePoisonX
*
* Created on 08. Februar 2013, 10:43
*/
//
// Copyright 2014 CutePoisonX (CutePoisonXI@gmail.com)
//
// 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 "FileException.h"

Expand All @@ -22,4 +34,4 @@ FileException::~FileException() throw()
const char* FileException::what() const throw()
{
return "There occured an error at reading out a file";
}
}
24 changes: 18 additions & 6 deletions FileException.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
/*
* File: FileException.h
* Author: CutePoisonX
*
* Created on 08. Februar 2013, 10:43
*/
//
// Copyright 2014 CutePoisonX (CutePoisonXI@gmail.com)
//
// 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 FILEEXCEPTION_H
#define FILEEXCEPTION_H
Expand Down
52 changes: 43 additions & 9 deletions FileManager.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
/*
* File: FileManager.cpp
* Author: CutePoisonX
*
* Created on 08. Februar 2013, 09:29
*/
//
// Copyright 2014 CutePoisonX (CutePoisonXI@gmail.com)
//
// 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 "FileManager.h"
#include "FileWriteException.h"
Expand Down Expand Up @@ -397,12 +409,12 @@ void FileManager::readImportantFiles(vector<string>& filenames) throw (FileReadE
readfile.close();
}

void FileManager::readProperties(string filename) throw (FileReadException, OpenFileException)
void FileManager::readProperties(string filename, string& duration) throw (FileReadException, OpenFileException)
{
ifstream readfile;
string line;
string params[5] = {"poison"};

unsigned int position = 0;
unsigned int position_two = 0;
unsigned int position_video = 0;
Expand All @@ -417,7 +429,29 @@ void FileManager::readProperties(string filename) throw (FileReadException, Open
do
{
getline(readfile, line, '\n');
if (line.find("Stream", 0) != string::npos)

if (line.find("Duration", 0) != string::npos)
{
unsigned int duration_pos_beg = line.find_first_of(":") + 2;
unsigned int duration_pos_end = line.find_first_of(",");
string tmp_duration;

line = line.substr(duration_pos_beg, duration_pos_end - duration_pos_beg);
if (line.find(".") != string::npos) //we don't need to compare fractions of seconds ...
{
tmp_duration = line.substr(0, line.find("."));
}
else
{
tmp_duration = line;
}

if (tmp_duration.empty() == false)
{
duration = tmp_duration;
}
}
else if (line.find("Stream", 0) != string::npos)
{
position = line.find("): ", 0);
position = position + 3;
Expand Down
26 changes: 19 additions & 7 deletions FileManager.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
/*
* File: FileManager.h
* Author: CutePoisonX
*
* Created on 08. Februar 2013, 09:29
*/
//
// Copyright 2014 CutePoisonX (CutePoisonXI@gmail.com)
//
// 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 FILEMANAGER_H
#define FILEMANAGER_H
Expand Down Expand Up @@ -37,7 +49,7 @@ class FileManager {
string checkPathToConfig();
void readImportantFiles(vector<string>& filenames) throw (FileReadException,
OpenFileException);
void readProperties(string filename) throw (FileReadException, OpenFileException);
void readProperties(string filename, string& duration) throw (FileReadException, OpenFileException);
void readPropsVideo(string line, unsigned int pos_start, string (&params)[5]);
void readPropsAudio(string line, unsigned int pos_start, string (&params)[5]);
void readPropsSub(string line, unsigned int pos_start, string& param0,
Expand Down
24 changes: 18 additions & 6 deletions FileReadException.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
/*
* File: FileSettingsException.cpp
* Author: CutePoisonX
*
* Created on 08. Februar 2013, 10:46
*/
//
// Copyright 2014 CutePoisonX (CutePoisonXI@gmail.com)
//
// 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 "FileReadException.h"

Expand Down
Loading

0 comments on commit 8ed1ac8

Please sign in to comment.