"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/main.cpp" between
MP3Diags-unstable-1.3.04.tar.gz and MP3Diags-unstable-1.5.01.tar.gz

About: MP3 Diags finds problems in MP3 files and helps the user to fix many of them (with a GUI). Also includes a tag editor and a file renamer.

main.cpp  (MP3Diags-unstable-1.3.04):main.cpp  (MP3Diags-unstable-1.5.01)
skipping to change at line 205 skipping to change at line 205
{ {
TRACER("Unknown error in QMp3DiagsApplication::notify"); TRACER("Unknown error in QMp3DiagsApplication::notify");
CB_ASSERT (false); CB_ASSERT (false);
} }
} }
QMp3DiagsApplication(int& argc, char** argv) : QApplication(argc, argv) {} QMp3DiagsApplication(int& argc, char** argv) : QApplication(argc, argv) {}
}; };
#ifdef MSVC_QMAKE #ifdef MSVC_QMAKE
void visStudioMessageOutput(QtMsgType, const char* szMsg) //void visStudioMessageOutput(QtMsgType, const char* szMsg)
void visStudioMessageOutput(QtMsgType, const QMessageLogContext&, const QString&
qstrMsg)
{ {
OutputDebugStringA(" "); // to stand out from the other messages that get printed OutputDebugStringA(" "); // to stand out from the other messages that get printed
OutputDebugStringA(szMsg); const string& strMsg (convStr(qstrMsg));
OutputDebugStringA(strMsg.data());
OutputDebugStringA("\r\n"); OutputDebugStringA("\r\n");
//cerr << szMsg << endl; //cerr << szMsg << endl;
//showInfo(0, "Debug message", szMsg, QMessageBox::Ok); //showInfo(0, "Debug message", szMsg, QMessageBox::Ok);
} }
#endif #endif
namespace { namespace {
class OptionInfo class OptionInfo
{ {
skipping to change at line 592 skipping to change at line 594
if (qs != ".mp3") // ttt1 unify with test in Mp3ProcThread::scan() if (qs != ".mp3") // ttt1 unify with test in Mp3ProcThread::scan()
{ {
return true; return true;
} }
Mp3Handler* mp3Handler; Mp3Handler* mp3Handler;
try try
{ {
mp3Handler = Mp3Handler::create(strFullName, false, m_qualThresholds ); mp3Handler = Mp3Handler::create(strFullName, false, m_qualThresholds );
} }
catch (Mp3Handler::FileNotFound) catch (const Mp3Handler::FileNotFound&)
{ {
cout << "File not found: " + toNativeSeparators(strFullName) << endl << endl; cout << "File not found: " + toNativeSeparators(strFullName) << endl << endl;
return false; return false;
} }
return processFile(strFullName, mp3Handler); return processFile(strFullName, mp3Handler);
} }
// returns "true" if there are no problems // returns "true" if there are no problems
bool processFullName(const string& strFullName) //ttt1 make FileSearcher tak e wildcards; then this function could take files, directories, and wildcard name s (which might match both files and directories); in particular, a FileSearcher might take the name of a specific file, and then it should list it bool processFullName(const string& strFullName) //ttt1 make FileSearcher tak e wildcards; then this function could take files, directories, and wildcard name s (which might match both files and directories); in particular, a FileSearcher might take the name of a specific file, and then it should list it
skipping to change at line 845 skipping to change at line 847
for (int i = 0, n = cSize(m_commonData.getCustomTransf()[nTransfList]); i < n; ++i) for (int i = 0, n = cSize(m_commonData.getCustomTransf()[nTransfList]); i < n; ++i)
{ {
m_vpTransf.push_back(m_commonData.getAllTransf()[m_commonData.getCus tomTransf()[nTransfList][i]]); m_vpTransf.push_back(m_commonData.getAllTransf()[m_commonData.getCus tomTransf()[nTransfList][i]]);
} }
setQualThresholds(m_commonData.getQualThresholds()); setQualThresholds(m_commonData.getQualThresholds());
m_commonData.m_strTransfLog = SessionEditorDlgImpl::getLogFileName(strSe ssFile); m_commonData.m_strTransfLog = SessionEditorDlgImpl::getLogFileName(strSe ssFile);
} }
}; };
void noMessageOutput(QtMsgType, const char*) { } void noMessageOutput(QtMsgType, const QMessageLogContext&, const QString&) { }
int cmdlineMain(const po::variables_map& options) int cmdlineMain(const po::variables_map& options)
{ {
/* /*
Notes about Windows, where it doesn't seem possible to output something to t he console from a GUI app. Notes about Windows, where it doesn't seem possible to output something to t he console from a GUI app.
- the chosen option is to use redirection, either to a file or through "more " or something similar; this is made more transparent by using MP3DiagsCLI.cmd t o redirect to a temp file and then print it - the chosen option is to use redirection, either to a file or through "more " or something similar; this is made more transparent by using MP3DiagsCLI.cmd t o redirect to a temp file and then print it
- other option would be to open Notepad and populate it using COM/OLE. Not s ure how to do it. - other option would be to open Notepad and populate it using COM/OLE. Not s ure how to do it.
- other option would be to redirect output to a file and open that file in N otepad. - other option would be to redirect output to a file and open that file in N otepad.
- other option would be to open a Qt window that only has the output from th e run and a close button. - other option would be to open a Qt window that only has the output from th e run and a close button.
- other option would be to open a new console and output the results there - other option would be to open a new console and output the results there
skipping to change at line 881 skipping to change at line 883
minLevel = options[s_severityOpt.m_szLongOpt].as<Note::Severity>(); //ttt2 see how to use default params in cmdlineDesc.add_options() minLevel = options[s_severityOpt.m_szLongOpt].as<Note::Severity>(); //ttt2 see how to use default params in cmdlineDesc.add_options()
} }
catch (...) catch (...)
{ // nothing { // nothing
} }
} }
// In cmdline mode, we want to make sure the user only sees our // In cmdline mode, we want to make sure the user only sees our
// carefully crafted messages, and no debug stuff from arbitrary // carefully crafted messages, and no debug stuff from arbitrary
// places in the program. // places in the program.
qInstallMsgHandler(noMessageOutput); qInstallMessageHandler(noMessageOutput); //ttt9 make sure this still works
string strSessFile; string strSessFile;
{ {
int nSessCnt; int nSessCnt;
bool bOpenLast; bool bOpenLast;
string strTempSessTempl; string strTempSessTempl;
string strDirSessTempl; string strDirSessTempl;
strSessFile = getActiveSession(options, nSessCnt, bOpenLast, strTempSess Templ, strDirSessTempl); strSessFile = getActiveSession(options, nSessCnt, bOpenLast, strTempSess Templ, strDirSessTempl);
} }
skipping to change at line 982 skipping to change at line 984
ostringstream o; ostringstream o;
o << 12345.78; o << 12345.78;
cout << o.str() << endl; cout << o.str() << endl;
printf("%f\n", 12345.78);//*/ printf("%f\n", 12345.78);//*/
void (*nh)() = set_new_handler(newHandler); void (*nh)() = set_new_handler(newHandler);
if (0 != nh) { cerr << "previous new handler: " << (void*)nh << endl; } if (0 != nh) { cerr << "previous new handler: " << (void*)nh << endl; }
//for (int i = 0; i < 200; ++i) { new char[1000000]; } //for (int i = 0; i < 200; ++i) { new char[1000000]; }
#ifdef MSVC_QMAKE #ifdef MSVC_QMAKE
qInstallMsgHandler(visStudioMessageOutput); qInstallMessageHandler(visStudioMessageOutput);
// see http://lists.trolltech.com/qt-interest/2006-10/msg00829.html // see http://lists.trolltech.com/qt-interest/2006-10/msg00829.html
//OutputDebugStringA("\n\ntest output\n\n\n"); // !!! this only works if act ually debugging (started with F5); //OutputDebugStringA("\n\ntest output\n\n\n"); // !!! this only works if act ually debugging (started with F5);
#endif #endif
po::options_description genericDesc ("General options"); po::options_description genericDesc ("General options");
genericDesc.add_options() genericDesc.add_options()
(s_helpOpt.m_szFullOpt, s_helpOpt.m_szDescr) (s_helpOpt.m_szFullOpt, s_helpOpt.m_szDescr)
(s_uninstOpt.m_szFullOpt, s_uninstOpt.m_szDescr) (s_uninstOpt.m_szFullOpt, s_uninstOpt.m_szDescr)
(s_sessionOpt.m_szFullOpt, po::value<string>(), s_sessionOpt.m_szDescr) (s_sessionOpt.m_szFullOpt, po::value<string>(), s_sessionOpt.m_szDescr)
; ;
 End of changes. 6 change blocks. 
6 lines changed or deleted 9 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)