ref: 3a0e440fef1a9834cd377512485c407ec0213bce
parent: b5e3eb770b7171e177583462d777d4ff10d6e9e9
author: menno <menno>
date: Tue Oct 16 13:57:52 EDT 2001
Removed wingui
--- a/wingui/.cvsignore
+++ /dev/null
@@ -1,9 +1,0 @@
-*.ncb
-*.plg
-*.aps
-*.opt
-*.aac
-*.wav
-faac_wingui.clw
-Release
-Debug
\ No newline at end of file
--- a/wingui/AbstractJob.cpp
+++ /dev/null
@@ -1,218 +1,0 @@
-// AbstractJob.cpp: implementation of the CAbstractJob class.
-// Author: Torsten Landmann
-//
-//////////////////////////////////////////////////////////////////////
-
-#include "stdafx.h"
-#include "faac_wingui.h"
-#include "AbstractJob.h"
-#include "WindowUtil.h"
-
-#ifdef _DEBUG
-#undef THIS_FILE
-static char THIS_FILE[]=__FILE__;
-#define new DEBUG_NEW
-#endif
-
-//////////////////////////////////////////////////////////////////////
-// Construction/Destruction
-//////////////////////////////////////////////////////////////////////
-
-CAbstractJob::CAbstractJob():
- m_lThisJobCountNumber(-1),
- m_lTotalNumberOfJobs(-1),
- m_lThisSubJobCountNumber(-1),
- m_lTotalNumberOfSubJobs(-1),
- m_eJobProcessingOutcome(eNotProcessed),
- m_lProcessingTime(0)
-{
-
-}
-
-CAbstractJob::CAbstractJob(const CAbstractJob &oSource)
-{
- *this=oSource;
-}
-
-CAbstractJob::~CAbstractJob()
-{
-
-}
-
-void CAbstractJob::SetJobNumberInfo(long lThisJobCountNumber, long lTotalNumberOfJobs)
-{
- m_lThisJobCountNumber=lThisJobCountNumber;
- m_lTotalNumberOfJobs=lTotalNumberOfJobs;
-}
-
-void CAbstractJob::SetSubJobNumberInfo(long lThisSubJobCountNumber, long lTotalNumberOfSubJobs)
-{
- m_lThisSubJobCountNumber=lThisSubJobCountNumber;
- m_lTotalNumberOfSubJobs=lTotalNumberOfSubJobs;
-}
-
-void CAbstractJob::GetProcessingNumberInformation(long &lThisJobCountNumber, long &lTotalNumberOfJobs, long &lThisSubJobCountNumber, long &lTotalNumberOfSubJobs) const
-{
- lThisJobCountNumber=m_lThisJobCountNumber;
- lTotalNumberOfJobs=m_lTotalNumberOfJobs;
- lThisSubJobCountNumber=m_lThisSubJobCountNumber;
- lTotalNumberOfSubJobs=m_lTotalNumberOfSubJobs;
-}
-
-void CAbstractJob::CopyAllJobNumberInfoFromJob(const CAbstractJob &oJob)
-{
- oJob.GetProcessingNumberInformation(m_lThisJobCountNumber, m_lTotalNumberOfJobs, m_lThisSubJobCountNumber, m_lTotalNumberOfSubJobs);
-}
-
-CString CAbstractJob::GetJobProcessingAdditionalCaptionBarInformation() const
-{
- // first get proper number info; must use method call for
- // that because the management might be subclassed
- long lThisJobCountNumber;
- long lTotalNumberOfJobs;
- long lThisSubJobCountNumber;
- long lTotalNumberOfSubJobs;
- GetProcessingNumberInformation(lThisJobCountNumber, lTotalNumberOfJobs, lThisSubJobCountNumber, lTotalNumberOfSubJobs);
-
- CString oJobInfo;
- if (lTotalNumberOfJobs>=0)
- {
- oJobInfo.Format(IDS_JobNofM, lThisJobCountNumber+1, lTotalNumberOfJobs);
- }
- if (lTotalNumberOfSubJobs>=0)
- {
- CString oSubJobInfo;
- oSubJobInfo.Format(IDS_SubJobNofM, lThisSubJobCountNumber+1, lTotalNumberOfSubJobs);
-
- oJobInfo+=CString(" - ")+oSubJobInfo;
- }
-
- return oJobInfo;
-}
-
-void CAbstractJob::SetProcessingOutcome(EJobProcessingOutcome eJobProcessingOutcome, long lProcessingTime, const CString &oSupplementaryInfo)
-{
- m_eJobProcessingOutcome=eJobProcessingOutcome;
- m_lProcessingTime=lProcessingTime;
- m_oSupplementaryInfo=oSupplementaryInfo;
-
- if (m_eJobProcessingOutcome==eError)
- {
- ASSERT(!m_oSupplementaryInfo.IsEmpty());
- }
-}
-
-void CAbstractJob::SetProcessingOutcomeCurTime(EJobProcessingOutcome eJobProcessingOutcome, long lProcessingStartTime, const CString &oSupplementaryInfo)
-{
- SetProcessingOutcome(eJobProcessingOutcome, ::GetTickCount()-lProcessingStartTime, oSupplementaryInfo);
-}
-
-void CAbstractJob::SetProcessingOutcome(EJobProcessingOutcome eJobProcessingOutcome, long lProcessingTime, int iSupplementaryInfoStringResource)
-{
- CString oSupplementaryInfo;
- oSupplementaryInfo.LoadString(iSupplementaryInfoStringResource);
- SetProcessingOutcome(eJobProcessingOutcome, lProcessingTime, oSupplementaryInfo);
-}
-
-void CAbstractJob::SetProcessingOutcomeCurTime(EJobProcessingOutcome eJobProcessingOutcome, long lProcessingStartTime, int iSupplementaryInfoStringResource)
-{
- CString oSupplementaryInfo;
- oSupplementaryInfo.LoadString(iSupplementaryInfoStringResource);
- SetProcessingOutcomeCurTime(eJobProcessingOutcome, lProcessingStartTime, oSupplementaryInfo);
-}
-
-void CAbstractJob::GetProcessingOutcome(EJobProcessingOutcome &eJobProcessingOutcome, long &lProcessingTime, CString &oSupplementaryInfo) const
-{
- eJobProcessingOutcome=m_eJobProcessingOutcome;
- lProcessingTime=m_lProcessingTime;
- oSupplementaryInfo=m_oSupplementaryInfo;
-}
-
-CAbstractJob::EJobProcessingOutcome CAbstractJob::GetProcessingOutcomeSimple() const
-{
- EJobProcessingOutcome eJobProcessingOutcome;
- long lProcessingTime;
- CString oSupplementaryInfo;
- GetProcessingOutcome(eJobProcessingOutcome, lProcessingTime, oSupplementaryInfo);
- return eJobProcessingOutcome;
-}
-
-CString CAbstractJob::GetProcessingOutcomeString() const
-{
- CString oToReturn;
-
- // find out the outcome data
- EJobProcessingOutcome eJobProcessingOutcome;
- long lProcessingTime;
- CString oSupplementaryInfo;
- GetProcessingOutcome(eJobProcessingOutcome, lProcessingTime, oSupplementaryInfo);
-
- // find out a simple description for the outcome
- CString oSimpleOutcomeDesc;
- int iDescBuf;
- switch (eJobProcessingOutcome)
- {
- case eNotProcessed:
- {
- iDescBuf=IDS_OutcomeUnprocessed;
- break;
- }
- case eSuccessfullyProcessed:
- {
- iDescBuf=IDS_OutcomeSuccessfullyProcessed;
- break;
- }
- case ePartiallyProcessed:
- {
- iDescBuf=IDS_OutcomePartiallyProcessed;
- break;
- }
- case eUserAbort:
- {
- iDescBuf=IDS_OutcomeUserAbort;
- break;
- }
- case eError:
- {
- iDescBuf=IDS_OutcomeError;
- break;
- }
- default:
- {
- // unknown type of outcome
- ASSERT(false);
- iDescBuf=IDS_OutcomeError;
- break;
- }
- }
- oSimpleOutcomeDesc.LoadString(iDescBuf);
-
- if (oSupplementaryInfo.IsEmpty())
- {
- oToReturn=oSimpleOutcomeDesc;
- }
- else
- {
- oToReturn=oSimpleOutcomeDesc+": "+oSupplementaryInfo;
- }
-
- if (lProcessingTime>=10)
- {
- bool bIncludeMillis=true;
- if (lProcessingTime>=1000)
- {
- bIncludeMillis=false;
- }
-
- oToReturn+=_T(" (")+CWindowUtil::GetTimeDescription(lProcessingTime, bIncludeMillis)+_T(")");
- }
-
- return oToReturn;
-}
-
-void CAbstractJob::ResetProcessingOutcome()
-{
- m_eJobProcessingOutcome=eNotProcessed;
- m_lProcessingTime=0;
- m_oSupplementaryInfo.Empty();
-}
--- a/wingui/AbstractJob.h
+++ /dev/null
@@ -1,77 +1,0 @@
-// AbstractJob.h: interface for the CAbstractJob class.
-// Author: Torsten Landmann
-//
-// This is the base class for all job types
-//
-//////////////////////////////////////////////////////////////////////
-
-#if !defined(AFX_ABSTRACTJOB_H__DFE38E74_0E81_11D5_8402_0080C88C25BD__INCLUDED_)
-#define AFX_ABSTRACTJOB_H__DFE38E74_0E81_11D5_8402_0080C88C25BD__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-#include "SupportedPropertyPagesData.h"
-#include "JobProcessingDynamicUserInputInfo.h"
-
-class CAbstractJob
-{
-public:
- CAbstractJob();
- CAbstractJob(const CAbstractJob &oSource); // copy constructor
- virtual ~CAbstractJob();
-
- virtual CSupportedPropertyPagesData GetSupportedPropertyPages() const=0;
-
- // returns if the job was completely and successfully process
- virtual bool ProcessJob(CJobProcessingDynamicUserInputInfo &oUserInputInfo)=0;
-
- // is used during the processing of the job to give the user a
- // feedback what exactly is done; may use up to 3 lines
- virtual CString GetDetailedDescriptionForStatusDialog() const=0;
-
- // job processing information; all numbers are zero based;
- // subclasses may overwrite the first three members, if they do they
- // should overwrite them all together
- virtual void SetJobNumberInfo(long lThisJobCountNumber, long lTotalNumberOfJobs);
- virtual void SetSubJobNumberInfo(long lThisSubJobCountNumber, long lTotalNumberOfSubJobs);
- virtual void GetProcessingNumberInformation(long &lThisJobCountNumber, long &lTotalNumberOfJobs, long &lThisSubJobCountNumber, long &lTotalNumberOfSubJobs) const;
- void CopyAllJobNumberInfoFromJob(const CAbstractJob &oJob);
- CString GetJobProcessingAdditionalCaptionBarInformation() const;
-
- // job processing outcome information
- enum EJobProcessingOutcome
- {
- eNotProcessed,
- eSuccessfullyProcessed,
- ePartiallyProcessed, // only for filter jobs
- eUserAbort,
- eError,
- };
- // note that supplementary info is mandatory if eOutcome==eError;
- // the processing time is specified in milliseconds;
- // SetProcessingOutcomeCurTime() requires that the second parameter is the
- // value that ::GetTickCount() returned immediately before the job processing began
- virtual void SetProcessingOutcome(EJobProcessingOutcome eJobProcessingOutcome, long lProcessingTime, const CString &oSupplementaryInfo);
- void SetProcessingOutcome(EJobProcessingOutcome eJobProcessingOutcome, long lProcessingTime, int iSupplementaryInfoStringResource);
- void SetProcessingOutcomeCurTime(EJobProcessingOutcome eJobProcessingOutcome, long lProcessingStartTime, const CString &oSupplementaryInfo);
- void SetProcessingOutcomeCurTime(EJobProcessingOutcome eJobProcessingOutcome, long lProcessingStartTime, int iSupplementaryInfoStringResource);
- virtual void GetProcessingOutcome(EJobProcessingOutcome &eJobProcessingOutcome, long &lProcessingTime, CString &oSupplementaryInfo) const;
- EJobProcessingOutcome GetProcessingOutcomeSimple() const;
- CString GetProcessingOutcomeString() const;
- // puts the job back to the "not processed" state
- virtual void ResetProcessingOutcome();
-
-private:
- long m_lThisJobCountNumber;
- long m_lTotalNumberOfJobs;
- long m_lThisSubJobCountNumber;
- long m_lTotalNumberOfSubJobs;
-
- EJobProcessingOutcome m_eJobProcessingOutcome;
- long m_lProcessingTime; // only valid if the outcome was success or user abort
- CString m_oSupplementaryInfo;
-};
-
-#endif // !defined(AFX_ABSTRACTJOB_H__DFE38E74_0E81_11D5_8402_0080C88C25BD__INCLUDED_)
--- a/wingui/AbstractPageCtrlContent.cpp
+++ /dev/null
@@ -1,44 +1,0 @@
-// AbstractPageCtrlContent.cpp: implementation of the CAbstractPageCtrlContent class.
-// Author: Torsten Landmann
-//
-//////////////////////////////////////////////////////////////////////
-
-#include "stdafx.h"
-#include "faac_wingui.h"
-#include "AbstractPageCtrlContent.h"
-
-#ifdef _DEBUG
-#undef THIS_FILE
-static char THIS_FILE[]=__FILE__;
-#define new DEBUG_NEW
-#endif
-
-//////////////////////////////////////////////////////////////////////
-// Construction/Destruction
-//////////////////////////////////////////////////////////////////////
-
-CAbstractPageCtrlContent::CAbstractPageCtrlContent():
- m_b3rdStateContent(true) // it's essential that this is initialized to true;
- // otherwise changes could be commited from pages even
- // if there had been detected errors
-{
-
-}
-
-CAbstractPageCtrlContent::~CAbstractPageCtrlContent()
-{
-
-}
-
-CAbstractPageCtrlContent& CAbstractPageCtrlContent::operator*=(
- const CAbstractPageCtrlContent &oRight)
-{
- if (Is3rdState()) return *this; // 3rd state can't be left by multiplication operator
-
- if (GetHashString()!=oRight.GetHashString())
- {
- SetIs3rdState(true);
- }
-
- return *this;
-}
--- a/wingui/AbstractPageCtrlContent.h
+++ /dev/null
@@ -1,43 +1,0 @@
-// AbstractPageCtrlContent.h: interface for the CAbstractPageCtrlContent class.
-// Author: Torsten Landmann
-//
-// This is the base class for classes that are able to hold a piece
-// of data from a property page; this is useful for "merging" the
-// data of several selected jobs so that differing data isn't overwritten
-// if not desired
-//
-//////////////////////////////////////////////////////////////////////
-
-#if !defined(AFX_ABSTRACTPAGECTRLCONTENT_H__7B47B268_0FF8_11D5_8402_0080C88C25BD__INCLUDED_)
-#define AFX_ABSTRACTPAGECTRLCONTENT_H__7B47B268_0FF8_11D5_8402_0080C88C25BD__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-class CAbstractPageCtrlContent
-{
-public:
- CAbstractPageCtrlContent();
- virtual ~CAbstractPageCtrlContent();
-
- bool Is3rdState() const { return m_b3rdStateContent; }
- void SetIs3rdState(bool b3rdState) { m_b3rdStateContent=b3rdState; }
-
- // all derived classes must implement this method;
- // it's important that identical hash strings always
- // mean identical content - also across class boundries;
- // that's why there is the following convention:
- // classes return a string <class name>-<A>
- // where <A> is the unique content in this object
- virtual CString GetHashString() const=0;
-
- // this operator connects the underlying objects so that
- // the 3rd state flag is correctly kept track of
- CAbstractPageCtrlContent& operator*=(const CAbstractPageCtrlContent &oRight);
-
-private:
- bool m_b3rdStateContent;
-};
-
-#endif // !defined(AFX_ABSTRACTPAGECTRLCONTENT_H__7B47B268_0FF8_11D5_8402_0080C88C25BD__INCLUDED_)
--- a/wingui/AbstractPropertyPageContents.cpp
+++ /dev/null
@@ -1,27 +1,0 @@
-// AbstractPropertyPageContents.cpp: implementation of the CAbstractPropertyPageContents class.
-//
-//////////////////////////////////////////////////////////////////////
-
-#include "stdafx.h"
-#include "faac_wingui.h"
-#include "AbstractPropertyPageContents.h"
-
-#ifdef _DEBUG
-#undef THIS_FILE
-static char THIS_FILE[]=__FILE__;
-#define new DEBUG_NEW
-#endif
-
-//////////////////////////////////////////////////////////////////////
-// Construction/Destruction
-//////////////////////////////////////////////////////////////////////
-
-CAbstractPropertyPageContents::CAbstractPropertyPageContents()
-{
-
-}
-
-CAbstractPropertyPageContents::~CAbstractPropertyPageContents()
-{
-
-}
--- a/wingui/AbstractPropertyPageContents.h
+++ /dev/null
@@ -1,21 +1,0 @@
-// AbstractPropertyPageContents.h: interface for the CAbstractPropertyPageContents class.
-// Author: Torsten Landmann
-//
-//////////////////////////////////////////////////////////////////////
-
-#if !defined(AFX_ABSTRACTPROPERTYPAGECONTENTS_H__7B47B265_0FF8_11D5_8402_0080C88C25BD__INCLUDED_)
-#define AFX_ABSTRACTPROPERTYPAGECONTENTS_H__7B47B265_0FF8_11D5_8402_0080C88C25BD__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-class CAbstractPropertyPageContents
-{
-public:
- CAbstractPropertyPageContents();
- virtual ~CAbstractPropertyPageContents();
-
-};
-
-#endif // !defined(AFX_ABSTRACTPROPERTYPAGECONTENTS_H__7B47B265_0FF8_11D5_8402_0080C88C25BD__INCLUDED_)
--- a/wingui/AskCreateDirectoryDialog.cpp
+++ /dev/null
@@ -1,74 +1,0 @@
-// AskCreateDirectoryDialog.cpp : implementation file
-//
-
-#include "stdafx.h"
-#include "faac_wingui.h"
-#include "AskCreateDirectoryDialog.h"
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-/////////////////////////////////////////////////////////////////////////////
-// CAskCreateDirectoryDialog dialog
-
-
-CAskCreateDirectoryDialog::CAskCreateDirectoryDialog(const CString &oDirectory, CWnd* pParent /*=NULL*/)
- : CDialog(CAskCreateDirectoryDialog::IDD, pParent)
-{
- //{{AFX_DATA_INIT(CAskCreateDirectoryDialog)
- m_oLabelTargetDir = _T("");
- //}}AFX_DATA_INIT
- m_oLabelTargetDir=oDirectory;
-}
-
-CAskCreateDirectoryDialog::~CAskCreateDirectoryDialog()
-{
-}
-
-void CAskCreateDirectoryDialog::DoDataExchange(CDataExchange* pDX)
-{
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CAskCreateDirectoryDialog)
- DDX_Text(pDX, IDC_LABELTARGETDIR, m_oLabelTargetDir);
- //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(CAskCreateDirectoryDialog, CDialog)
- //{{AFX_MSG_MAP(CAskCreateDirectoryDialog)
- ON_BN_CLICKED(IDC_BUTTONYES, OnButtonYes)
- ON_BN_CLICKED(IDC_BUTTONNO, OnButtonNo)
- ON_BN_CLICKED(IDC_BUTTONALWAYS, OnButtonAlways)
- ON_BN_CLICKED(IDC_BUTTONNEVER, OnButtonNever)
- //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// CAskCreateDirectoryDialog message handlers
-
-void CAskCreateDirectoryDialog::OnButtonYes()
-{
- // TODO: Add your control notification handler code here
- EndDialog(eYes);
-}
-
-void CAskCreateDirectoryDialog::OnButtonNo()
-{
- // TODO: Add your control notification handler code here
- EndDialog(eNo);
-}
-
-void CAskCreateDirectoryDialog::OnButtonAlways()
-{
- // TODO: Add your control notification handler code here
- EndDialog(eAlways);
-}
-
-void CAskCreateDirectoryDialog::OnButtonNever()
-{
- // TODO: Add your control notification handler code here
- EndDialog(eNever);
-}
--- a/wingui/AskCreateDirectoryDialog.h
+++ /dev/null
@@ -1,59 +1,0 @@
-#if !defined(AFX_ASKCREATEDIRECTORYDIALOG_H__5D3060C2_1CA9_11D5_8402_0080C88C25BD__INCLUDED_)
-#define AFX_ASKCREATEDIRECTORYDIALOG_H__5D3060C2_1CA9_11D5_8402_0080C88C25BD__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-// AskCreateDirectoryDialog.h : header file
-//
-
-/////////////////////////////////////////////////////////////////////////////
-// CAskCreateDirectoryDialog dialog
-
-class CAskCreateDirectoryDialog : public CDialog
-{
-// Construction
-public:
- CAskCreateDirectoryDialog(const CString &oDirectory, CWnd* pParent = NULL); // standard constructor
- virtual ~CAskCreateDirectoryDialog();
-
-// Dialog Data
- //{{AFX_DATA(CAskCreateDirectoryDialog)
- enum { IDD = IDD_ASKCREATEDIRECTORYDIALOG };
- CString m_oLabelTargetDir;
- //}}AFX_DATA
-
- // one of the following values is returned by DoModal()
- enum ECreateDirectoryDialogReturn
- {
- eNo,
- eYes,
- eAlways,
- eNever,
- };
-
-
-// Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CAskCreateDirectoryDialog)
- protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
- // Generated message map functions
- //{{AFX_MSG(CAskCreateDirectoryDialog)
- afx_msg void OnButtonYes();
- afx_msg void OnButtonNo();
- afx_msg void OnButtonAlways();
- afx_msg void OnButtonNever();
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-};
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_ASKCREATEDIRECTORYDIALOG_H__5D3060C2_1CA9_11D5_8402_0080C88C25BD__INCLUDED_)
--- a/wingui/ConcreteJobBase.cpp
+++ /dev/null
@@ -1,28 +1,0 @@
-// ConcreteJobBase.cpp: implementation of the CConcreteJobBase class.
-// Author: Torsten Landmann
-//
-//////////////////////////////////////////////////////////////////////
-
-#include "stdafx.h"
-#include "faac_wingui.h"
-#include "ConcreteJobBase.h"
-
-#ifdef _DEBUG
-#undef THIS_FILE
-static char THIS_FILE[]=__FILE__;
-#define new DEBUG_NEW
-#endif
-
-//////////////////////////////////////////////////////////////////////
-// Construction/Destruction
-//////////////////////////////////////////////////////////////////////
-
-CConcreteJobBase::CConcreteJobBase()
-{
-
-}
-
-CConcreteJobBase::~CConcreteJobBase()
-{
-
-}
--- a/wingui/ConcreteJobBase.h
+++ /dev/null
@@ -1,28 +1,0 @@
-// ConcreteJobBase.h: interface for the CConcreteJobBase class.
-// Author: Torsten Landmann
-//
-// just a helper to simplify the class hierarchy
-//
-//////////////////////////////////////////////////////////////////////
-
-#if !defined(AFX_CONCRETEJOBBASE_H__442115CF_0FD4_11D5_8402_0080C88C25BD__INCLUDED_)
-#define AFX_CONCRETEJOBBASE_H__442115CF_0FD4_11D5_8402_0080C88C25BD__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-#include "JobListCtrlDescribable.h"
-#include "AbstractJob.h"
-#include "FileSerializable.h"
-
-class CConcreteJobBase : public CJobListCtrlDescribable, public CAbstractJob,
- public CFileSerializable
-{
-public:
- CConcreteJobBase();
- virtual ~CConcreteJobBase();
-
-};
-
-#endif // !defined(AFX_CONCRETEJOBBASE_H__442115CF_0FD4_11D5_8402_0080C88C25BD__INCLUDED_)
--- a/wingui/EncoderGeneralPageDialog.cpp
+++ /dev/null
@@ -1,509 +1,0 @@
-// EncoderGeneralPageDialog.cpp : implementation file
-//
-
-#include "stdafx.h"
-#include "faac_wingui.h"
-#include "EncoderGeneralPageDialog.h"
-#include "EncoderGeneralPropertyPageContents.h"
-#include "FolderDialog.h"
-#include "FilePathCalc.h"
-#include "FileMaskAssembler.h"
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-/////////////////////////////////////////////////////////////////////////////
-// CEncoderGeneralPageDialog dialog
-
-
-CEncoderGeneralPageDialog::CEncoderGeneralPageDialog(
- const TItemList<CJob*> &oJobsToConfigure,
- CJobListUpdatable *poListContainer,
- CWnd* pParent /*=NULL*/):
- m_bInitialized(false),
- m_bLastRecursiveCheckboxVisibility(false),
- m_oJobsToConfigure(oJobsToConfigure),
- m_poListContainer(poListContainer),
- m_eCurCheckBox(eNone),
- m_bIgnoreUpdates(false)
-{
- //{{AFX_DATA_INIT(CEncoderGeneralPageDialog)
- m_oEditSourceDir = _T("");
- m_oEditSourceFile = _T("");
- m_oEditTargetDir = _T("");
- m_oEditTargetFile = _T("");
- //}}AFX_DATA_INIT
-
- Create(CEncoderGeneralPageDialog::IDD, pParent);
-}
-
-CEncoderGeneralPageDialog::~CEncoderGeneralPageDialog()
-{
- UpdateJobs();
-}
-
-void CEncoderGeneralPageDialog::DoDataExchange(CDataExchange* pDX)
-{
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CEncoderGeneralPageDialog)
- DDX_Control(pDX, IDC_CHECKRECURSIVE, m_ctrlCheckRecursive);
- DDX_Control(pDX, IDC_BUTTONBROWSETARGETFILE, m_ctrlButtonBrowseTargetFile);
- DDX_Control(pDX, IDC_BUTTONBROWSESOURCEFILE, m_ctrlButtonBrowseSourceFile);
- DDX_Text(pDX, IDC_EDITSOURCEDIR, m_oEditSourceDir);
- DDX_Text(pDX, IDC_EDITSOURCEFILE, m_oEditSourceFile);
- DDX_Text(pDX, IDC_EDITTARGETDIR, m_oEditTargetDir);
- DDX_Text(pDX, IDC_EDITTARGETFILE, m_oEditTargetFile);
- //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(CEncoderGeneralPageDialog, CDialog)
- //{{AFX_MSG_MAP(CEncoderGeneralPageDialog)
- ON_EN_KILLFOCUS(IDC_EDITSOURCEDIR, OnKillfocusEditSourceDir)
- ON_EN_KILLFOCUS(IDC_EDITSOURCEFILE, OnKillfocusEditSourceFile)
- ON_EN_KILLFOCUS(IDC_EDITTARGETDIR, OnKillfocusEditTargetDir)
- ON_EN_KILLFOCUS(IDC_EDITTARGETFILE, OnKillfocusEditTargetFile)
- ON_BN_CLICKED(IDC_BUTTONBROWSESOURCEDIR, OnButtonBrowseSourceDir)
- ON_BN_CLICKED(IDC_BUTTONBROWSETARGETDIR, OnButtonBrowseTargetDir)
- ON_BN_CLICKED(IDC_BUTTONBROWSESOURCEFILE, OnButtoBrowseSourceFile)
- ON_BN_CLICKED(IDC_BUTTONBROWSETARGETFILE, OnButtonBrowseTargetFile)
- ON_EN_CHANGE(IDC_EDITSOURCEFILE, OnChangeEditSourceFile)
- ON_BN_CLICKED(IDC_CHECKRECURSIVE, OnCheckRecursive)
- //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// CEncoderGeneralPageDialog message handlers
-
-BOOL CEncoderGeneralPageDialog::OnInitDialog()
-{
- CDialog::OnInitDialog();
-
- // TODO: Add extra initialization here
- m_bInitialized=true;
-
- if (m_oJobsToConfigure.GetNumber()>1)
- {
- // have several jobs
- //m_ctrlButtonBrowseSourceFile.ShowWindow(SW_HIDE);
- m_ctrlButtonBrowseTargetFile.ShowWindow(SW_HIDE);
- }
-
- // show our contents
- ApplyPageContents(ParseJobs());
-
- // not appropriate here (also ApplyPageContents() has done the job anyway)
- //OnChangeEditSourceFile();
-
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
-}
-
-bool CEncoderGeneralPageDialog::GetPageContents(CEncoderGeneralPropertyPageContents &oTarget)
-{
- if (!UpdateData(TRUE)) return false;
-
- oTarget.m_oSourceDirectory.SetContent(m_oEditSourceDir);
- oTarget.m_oSourceFile.SetContent(m_oEditSourceFile);
- oTarget.m_oTargetDirectory.SetContent(m_oEditTargetDir);
- oTarget.m_oTargetFile.SetContent(m_oEditTargetFile);
- oTarget.m_oSourceFileFilterIsRecursive.SetCheckCode(m_ctrlCheckRecursive.GetCheck());
-
- // not relevant
- oTarget.m_oSourceFilterRecursiveCheckboxVisible.SetIs3rdState(true);
-
- return true;
-}
-
-void CEncoderGeneralPageDialog::ApplyPageContents(const CEncoderGeneralPropertyPageContents &oPageContents)
-{
- // disabled since it could cause error messages - we're overwriting everything anyway
- //UpdateData(TRUE);
-
- m_oEditSourceDir=oPageContents.m_oSourceDirectory.GetContent();
- m_oEditSourceFile=oPageContents.m_oSourceFile.GetContent();
- m_oEditTargetDir=oPageContents.m_oTargetDirectory.GetContent();
- m_oEditTargetFile=oPageContents.m_oTargetFile.GetContent();
- oPageContents.m_oSourceFileFilterIsRecursive.ApplyCheckCodeToButton(&m_ctrlCheckRecursive);
-
- if (m_bInitialized)
- {
- UpdateData(FALSE);
-
- if (m_oEditSourceFile.IsEmpty())
- {
- if (!oPageContents.m_oSourceFilterRecursiveCheckboxVisible.Is3rdState() &&
- oPageContents.m_oSourceFilterRecursiveCheckboxVisible.GetCheckMark())
- {
- m_ctrlCheckRecursive.ShowWindow(SW_SHOW);
- }
- else
- {
- m_ctrlCheckRecursive.ShowWindow(SW_HIDE);
- }
- }
- else
- {
- OnChangeEditSourceFile();
- }
- }
-}
-
-CEncoderGeneralPropertyPageContents CEncoderGeneralPageDialog::ParseJobs()
-{
- CEncoderGeneralPropertyPageContents oToReturn;
- bool bFirstRun=true;
-
- CBListReader oReader(m_oJobsToConfigure);
- CJob *poCurJob;
- while (m_oJobsToConfigure.GetNextElemContent(oReader, poCurJob))
- {
- if (!poCurJob->GetJobType()==CJob::eEncoderJob)
- {
- // must all be encoder jobs
- ASSERT(false);
- }
- CEncoderJob *poEncoderJob=poCurJob->GetEncoderJob();
- if (bFirstRun)
- {
- oToReturn=poEncoderJob->GetGeneralPageContents();
- bFirstRun=false;
- }
- else
- {
- oToReturn*=poEncoderJob->GetGeneralPageContents();
- }
- }
-
- return oToReturn;
-}
-
-void CEncoderGeneralPageDialog::ModifyJobs(const CEncoderGeneralPropertyPageContents &oPageContents)
-{
- CBListReader oReader(m_oJobsToConfigure);
- CJob *poCurJob;
- while (m_oJobsToConfigure.GetNextElemContent(oReader, poCurJob))
- {
- if (poCurJob->GetJobType()!=CJob::eEncoderJob)
- {
- // must all be encoder jobs
- ASSERT(false);
- }
- CEncoderJob *poEncoderJob=poCurJob->GetEncoderJob();
- poEncoderJob->ApplyGeneralPageContents(oPageContents);
- }
-}
-
-void CEncoderGeneralPageDialog::UpdateJobs(bool bFinishCheckBoxSessions, bool bDlgDestructUpdate)
-{
- if (::IsWindow(*this) && !m_bIgnoreUpdates)
- {
- CEncoderGeneralPropertyPageContents oPageContents;
- if (GetPageContents(oPageContents))
- {
- if (bFinishCheckBoxSessions)
- {
- FinishCurrentCheckBoxSessionIfNecessary();
- }
-
- ModifyJobs(oPageContents);
-
- // make changes visible
- m_poListContainer->ReFillInJobListCtrl();
- }
- }
-
- if (bDlgDestructUpdate)
- {
- m_bIgnoreUpdates=true;
- }
-}
-
-void CEncoderGeneralPageDialog::OnKillfocusEditSourceDir()
-{
- // TODO: Add your control notification handler code here
- UpdateJobs();
-}
-
-void CEncoderGeneralPageDialog::OnKillfocusEditSourceFile()
-{
- // TODO: Add your control notification handler code here
- UpdateJobs();
-}
-
-void CEncoderGeneralPageDialog::OnKillfocusEditTargetDir()
-{
- // TODO: Add your control notification handler code here
- UpdateJobs();
-}
-
-void CEncoderGeneralPageDialog::OnKillfocusEditTargetFile()
-{
- // TODO: Add your control notification handler code here
- UpdateJobs();
-}
-
-void CEncoderGeneralPageDialog::OnButtonBrowseSourceDir()
-{
- CString oCaption;
- oCaption.LoadString(IDS_SelectSourceDirDlgCaption);
- CFolderDialog oFolderDialog(this, oCaption);
- if (oFolderDialog.DoModal()==IDOK)
- {
- UpdateData(TRUE);
- m_oEditSourceDir=oFolderDialog.m_oFolderPath;
- CFilePathCalc::MakePath(m_oEditSourceDir);
- UpdateData(FALSE);
- UpdateJobs();
- }
- else
- {
- if (oFolderDialog.m_bError)
- {
- AfxMessageBox(IDS_ErrorDuringDirectorySelection);
- }
- }
-}
-
-void CEncoderGeneralPageDialog::OnButtonBrowseTargetDir()
-{
- CString oCaption;
- oCaption.LoadString(IDS_SelectTargetDirDlgCaption);
- CFolderDialog oFolderDialog(this, oCaption);
- if (oFolderDialog.DoModal()==IDOK)
- {
- UpdateData(TRUE);
- m_oEditTargetDir=oFolderDialog.m_oFolderPath;
- CFilePathCalc::MakePath(m_oEditTargetDir);
- UpdateData(FALSE);
- UpdateJobs();
- }
- else
- {
- if (oFolderDialog.m_bError)
- {
- AfxMessageBox(IDS_ErrorDuringDirectorySelection);
- }
- }
-}
-
-void CEncoderGeneralPageDialog::OnButtoBrowseSourceFile()
-{
- UpdateData(TRUE);
- // determine the standard file
- CString *poStandardFile=0;
- if (!(m_oEditSourceFile.IsEmpty() || m_oEditSourceDir.IsEmpty()))
- {
- poStandardFile=new CString(m_oEditSourceDir+m_oEditSourceFile);
- }
-
- // assemble the filter string
- CString oFilter;
- {
- // assemble a list of allowed filters
- TItemList<int> oFilters;
- oFilters.AddNewElem(IDS_WavFilesFilter, 1);
- oFilters.AddNewElem(IDS_AllFilesFilter, 2);
- oFilter=CFileMaskAssembler::GetFileMask(oFilters);
- }
-
- // find out the default extension
- CString oDefaultExt;
- oDefaultExt.LoadString(IDS_EndSourceFileStandardExtension);
-
- CFileDialog oOpenDialog(
- TRUE, // file open mode
- oDefaultExt, // default extension
- (poStandardFile!=0 ? *poStandardFile : (LPCTSTR)0), // default file
- OFN_HIDEREADONLY | OFN_FILEMUSTEXIST,
- oFilter);
- if (oOpenDialog.DoModal()==IDOK)
- {
- // the file has been opened
- CString oFilePath(oOpenDialog.GetPathName());
- m_oEditSourceDir=oFilePath;
- CFilePathCalc::MakePath(m_oEditSourceDir);
- CFilePathCalc::ExtractFileName(oFilePath, m_oEditSourceFile);
- }
- else
- {
- // user abort or error
- if (CommDlgExtendedError()!=0)
- {
- // an error occured
- AfxMessageBox(IDS_ErrorDuringFileSelection);
- }
- }
-
- UpdateData(FALSE);
- UpdateJobs();
- OnChangeEditSourceFile();
-}
-
-void CEncoderGeneralPageDialog::OnButtonBrowseTargetFile()
-{
- UpdateData(TRUE);
- // determine the standard file
- CString *poStandardFile=0;
- if (!(m_oEditTargetFile.IsEmpty() || m_oEditTargetDir.IsEmpty()))
- {
- poStandardFile=new CString(m_oEditTargetDir+m_oEditTargetFile);
- }
-
- // assemble the filter string
- CString oFilter;
- {
- // assemble a list of allowed filters
- TItemList<int> oFilters;
- oFilters.AddNewElem(IDS_AacFilesFilter, 1);
- oFilters.AddNewElem(IDS_AllFilesFilter, 2);
- oFilter=CFileMaskAssembler::GetFileMask(oFilters);
- }
-
- // find out the default extension
- CString oDefaultExt;
- oDefaultExt.LoadString(IDS_EndTargetFileStandardExtension);
-
- CFileDialog oOpenDialog(
- FALSE, // file save mode
- oDefaultExt, // default extension
- (poStandardFile!=0 ? *poStandardFile : (LPCTSTR)0), // default file
- OFN_HIDEREADONLY,
- oFilter);
- if (oOpenDialog.DoModal()==IDOK)
- {
- // the file has been opened
- CString oFilePath(oOpenDialog.GetPathName());
- m_oEditTargetDir=oFilePath;
- CFilePathCalc::MakePath(m_oEditTargetDir);
- CFilePathCalc::ExtractFileName(oFilePath, m_oEditTargetFile);
- }
- else
- {
- // user abort or error
- if (CommDlgExtendedError()!=0)
- {
- // an error occured
- AfxMessageBox(IDS_ErrorDuringFileSelection);
- }
- }
-
- UpdateData(FALSE);
- UpdateJobs();
- OnChangeEditSourceFile();
-}
-
-
-void CEncoderGeneralPageDialog::OnChangeEditSourceFile()
-{
- // TODO: If this is a RICHEDIT control, the control will not
- // send this notification unless you override the CDialog::OnInitDialog()
- // function and call CRichEditCtrl().SetEventMask()
- // with the ENM_CHANGE flag ORed into the mask.
-
- // TODO: Add your control notification handler code here
- UpdateData(TRUE);
-
- bool bPreviousVisiblity=m_bLastRecursiveCheckboxVisibility;
-
- // check for a filter
- if (CFilePathCalc::IsValidFileMask(m_oEditSourceFile))
- {
- // user entered a filter
- m_ctrlCheckRecursive.ShowWindow(SW_SHOW);
- m_bLastRecursiveCheckboxVisibility=true;
- }
- else
- {
- // user did not enter a filter
- m_ctrlCheckRecursive.ShowWindow(SW_HIDE);
- m_bLastRecursiveCheckboxVisibility=false;
- }
-
- UpdateData(FALSE);
-
- // in case the source file changed from a regular file to a filter
- // or vice versa we have to switch the "Expand Filter Job" button on
- // the main dialog; the simples way to do is to update the list control
- // with the below method call
- if (bPreviousVisiblity^m_bLastRecursiveCheckboxVisibility)
- {
- m_poListContainer->EnableExpandFilterJobButton(m_bLastRecursiveCheckboxVisibility);
- }
-}
-
-
-void CEncoderGeneralPageDialog::ProcessCheckBoxClick(CButton *poCheckBox, ETypeOfCheckBox eTypeOfCheckBox)
-{
- int iCheckState=poCheckBox->GetCheck();
- if (iCheckState==2)
- {
- // 3rd state
- if (m_eCurCheckBox!=eTypeOfCheckBox)
- {
- // must not be like this
- ASSERT(false);
- }
- else
- {
- m_oCheckStateChangeStateSaver.RestoreJobs(m_oJobsToConfigure);
- FinishCurrentCheckBoxSessionIfNecessary();
- }
- }
- else
- {
- if (m_eCurCheckBox!=eTypeOfCheckBox)
- {
- FinishCurrentCheckBoxSessionIfNecessary();
-
- // current checkbox is now set to eNone
-
- m_eCurCheckBox=eTypeOfCheckBox;
-
- m_oCheckStateChangeStateSaver.SaveJobs(m_oJobsToConfigure);
- }
- }
-
- UpdateJobs(false);
-}
-
-void CEncoderGeneralPageDialog::FinishCurrentCheckBoxSessionIfNecessary()
-{
- switch (m_eCurCheckBox)
- {
- case eRecursive:
- {
- FinishCheckBoxSessionIfNecessary(&m_ctrlCheckRecursive);
- break;
- }
- case eNone:
- {
- // nothing
- break;
- }
- default:
- {
- // unkown type of check box
- break;
- }
- }
- m_eCurCheckBox=eNone;
-}
-
-void CEncoderGeneralPageDialog::FinishCheckBoxSessionIfNecessary(CButton *poCheckBox)
-{
- int iCurCheck=poCheckBox->GetCheck();
- if (iCurCheck<2)
- {
- poCheckBox->SetButtonStyle(BS_AUTOCHECKBOX);
- }
-}
-
-void CEncoderGeneralPageDialog::OnCheckRecursive()
-{
- // TODO: Add your control notification handler code here
- ProcessCheckBoxClick(&m_ctrlCheckRecursive, eRecursive);
-}
--- a/wingui/EncoderGeneralPageDialog.h
+++ /dev/null
@@ -1,100 +1,0 @@
-#if !defined(AFX_ENCODERGENERALPAGEDIALOG_H__442115C6_0FD4_11D5_8402_0080C88C25BD__INCLUDED_)
-#define AFX_ENCODERGENERALPAGEDIALOG_H__442115C6_0FD4_11D5_8402_0080C88C25BD__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-// EncoderGeneralPageDialog.h : header file
-//
-
-#include "JobListUpdatable.h"
-#include "JobListsToConfigureSaver.h"
-
-/////////////////////////////////////////////////////////////////////////////
-// CEncoderGeneralPageDialog dialog
-
-class CEncoderGeneralPageDialog : public CDialog
-{
-// Construction
-public:
- CEncoderGeneralPageDialog(const TItemList<CJob*> &oJobsToConfigure, CJobListUpdatable *poListContainer, CWnd* pParent = NULL); // standard constructor
- virtual ~CEncoderGeneralPageDialog();
-
-// Dialog Data
- //{{AFX_DATA(CEncoderGeneralPageDialog)
- enum { IDD = IDD_ENCODERGENERALPAGEDIALOG };
- CButton m_ctrlCheckRecursive;
- CButton m_ctrlButtonBrowseTargetFile;
- CButton m_ctrlButtonBrowseSourceFile;
- CString m_oEditSourceDir;
- CString m_oEditSourceFile;
- CString m_oEditTargetDir;
- CString m_oEditTargetFile;
- //}}AFX_DATA
-
-
-// Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CEncoderGeneralPageDialog)
- protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- //}}AFX_VIRTUAL
-
-public:
- // returns false in case of errors
- bool GetPageContents(CEncoderGeneralPropertyPageContents &oTarget);
- void ApplyPageContents(const CEncoderGeneralPropertyPageContents &oPageContents);
-
-// Implementation
-protected:
-
- // Generated message map functions
- //{{AFX_MSG(CEncoderGeneralPageDialog)
- virtual BOOL OnInitDialog();
- afx_msg void OnKillfocusEditSourceDir();
- afx_msg void OnKillfocusEditSourceFile();
- afx_msg void OnKillfocusEditTargetDir();
- afx_msg void OnKillfocusEditTargetFile();
- afx_msg void OnButtonBrowseSourceDir();
- afx_msg void OnButtonBrowseTargetDir();
- afx_msg void OnButtoBrowseSourceFile();
- afx_msg void OnButtonBrowseTargetFile();
- afx_msg void OnChangeEditSourceFile();
- afx_msg void OnCheckRecursive();
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-
-private:
- bool m_bInitialized;
- bool m_bLastRecursiveCheckboxVisibility;
-
- TItemList<CJob*> m_oJobsToConfigure;
-
- CJobListUpdatable *m_poListContainer;
-
- CEncoderGeneralPropertyPageContents ParseJobs();
- void ModifyJobs(const CEncoderGeneralPropertyPageContents &oPageContents);
-
-
- // called when changes have been made in the dialog and are to
- // be synchronized with both "data holders"
- void UpdateJobs(bool bFinishCheckBoxSessions=true, bool bDlgDestructUpdate=false);
- bool m_bIgnoreUpdates;
-
- // these members are used for managing the check box controls and the
- // changes that are made with them in the dialog
- enum ETypeOfCheckBox
- {
- eNone,
- eRecursive,
- } m_eCurCheckBox;
- CJobListsToConfigureSaver m_oCheckStateChangeStateSaver;
- void ProcessCheckBoxClick(CButton *poCheckBox, ETypeOfCheckBox eTypeOfCheckBox);
- void FinishCurrentCheckBoxSessionIfNecessary();
- void FinishCheckBoxSessionIfNecessary(CButton *poCheckBox);
-};
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_ENCODERGENERALPAGEDIALOG_H__442115C6_0FD4_11D5_8402_0080C88C25BD__INCLUDED_)
--- a/wingui/EncoderGeneralPropertyPageContents.cpp
+++ /dev/null
@@ -1,47 +1,0 @@
-// EncoderGeneralPropertyPageContents.cpp: implementation of the CEncoderGeneralPropertyPageContents class.
-// Author: Torsten Landmann
-//
-//////////////////////////////////////////////////////////////////////
-
-#include "stdafx.h"
-#include "faac_wingui.h"
-#include "EncoderGeneralPropertyPageContents.h"
-
-#ifdef _DEBUG
-#undef THIS_FILE
-static char THIS_FILE[]=__FILE__;
-#define new DEBUG_NEW
-#endif
-
-//////////////////////////////////////////////////////////////////////
-// Construction/Destruction
-//////////////////////////////////////////////////////////////////////
-
-CEncoderGeneralPropertyPageContents::CEncoderGeneralPropertyPageContents()
-{
-
-}
-
-CEncoderGeneralPropertyPageContents::CEncoderGeneralPropertyPageContents(const CEncoderGeneralPropertyPageContents &oSource)
-{
- *this=oSource;
-}
-
-CEncoderGeneralPropertyPageContents::~CEncoderGeneralPropertyPageContents()
-{
-
-}
-
-CEncoderGeneralPropertyPageContents& CEncoderGeneralPropertyPageContents::operator*=(
- const CEncoderGeneralPropertyPageContents &oRight)
-{
- m_oSourceDirectory*=oRight.m_oSourceDirectory;
- m_oSourceFile*=oRight.m_oSourceFile;
- m_oTargetDirectory*=oRight.m_oTargetDirectory;
- m_oTargetFile*=oRight.m_oTargetFile;
- m_oSourceFileFilterIsRecursive*=oRight.m_oSourceFileFilterIsRecursive;
-
- m_oSourceFilterRecursiveCheckboxVisible*=oRight.m_oSourceFilterRecursiveCheckboxVisible;
-
- return *this;
-}
\ No newline at end of file
--- a/wingui/EncoderGeneralPropertyPageContents.h
+++ /dev/null
@@ -1,40 +1,0 @@
-// EncoderGeneralPropertyPageContents.h: interface for the CEncoderGeneralPropertyPageContents class.
-// Author: Torsten Landmann
-//
-// encapsulates the content of the property page "general" including
-// possible 3rd states of all controls
-//
-//////////////////////////////////////////////////////////////////////
-
-#if !defined(AFX_ENCODERGENERALPROPERTYPAGECONTENTS_H__7B47B266_0FF8_11D5_8402_0080C88C25BD__INCLUDED_)
-#define AFX_ENCODERGENERALPROPERTYPAGECONTENTS_H__7B47B266_0FF8_11D5_8402_0080C88C25BD__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-#include "AbstractPropertyPageContents.h"
-#include "PageEditCtrlContent.h"
-#include "PageCheckboxCtrlContent.h"
-
-class CEncoderGeneralPropertyPageContents : public CAbstractPropertyPageContents
-{
-public:
- CEncoderGeneralPropertyPageContents();
- CEncoderGeneralPropertyPageContents(const CEncoderGeneralPropertyPageContents &oSource); // copy constructor
- virtual ~CEncoderGeneralPropertyPageContents();
-
- CPageEditCtrlContent m_oSourceDirectory;
- CPageEditCtrlContent m_oSourceFile;
- CPageEditCtrlContent m_oTargetDirectory;
- CPageEditCtrlContent m_oTargetFile;
- CPageCheckboxCtrlContent m_oSourceFileFilterIsRecursive;
-
- // not represented by real controls; just a tracker
- CPageCheckboxCtrlContent m_oSourceFilterRecursiveCheckboxVisible;
-
- // with this operator pages for several jobs can be "merged"
- CEncoderGeneralPropertyPageContents& operator*=(const CEncoderGeneralPropertyPageContents &oRight);
-};
-
-#endif // !defined(AFX_ENCODERGENERALPROPERTYPAGECONTENTS_H__7B47B266_0FF8_11D5_8402_0080C88C25BD__INCLUDED_)
--- a/wingui/EncoderId3PageDialog.cpp
+++ /dev/null
@@ -1,381 +1,0 @@
-// EncoderId3PageDialog.cpp : implementation file
-//
-
-#include "stdafx.h"
-#include "faac_wingui.h"
-#include "EncoderId3PageDialog.h"
-#include "WindowUtil.h"
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-/////////////////////////////////////////////////////////////////////////////
-// CEncoderId3PageDialog dialog
-
-
-CEncoderId3PageDialog::CEncoderId3PageDialog(
- const TItemList<CJob*> &oJobsToConfigure,
- CJobListUpdatable *poListContainer,
- CWnd* pParent /*=NULL*/):
- m_bInitialized(false),
- m_oJobsToConfigure(oJobsToConfigure),
- m_poListContainer(poListContainer),
- m_eCurCheckBox(eNone),
- m_bIgnoreUpdates(false)
-{
- //{{AFX_DATA_INIT(CEncoderId3PageDialog)
- m_oEditAlbum = _T("");
- m_oEditArtist = _T("");
- m_oEditComment = _T("");
- m_oEditComposer = _T("");
- m_oEditEncodedBy = _T("");
- m_oEditOriginalArtist = _T("");
- m_oEditTitle = _T("");
- m_oEditTrack = _T("");
- m_oEditUrl = _T("");
- m_oEditYear = _T("");
- //}}AFX_DATA_INIT
-
- Create(CEncoderId3PageDialog::IDD, pParent);
-}
-
-CEncoderId3PageDialog::~CEncoderId3PageDialog()
-{
- UpdateJobs();
-}
-
-
-void CEncoderId3PageDialog::DoDataExchange(CDataExchange* pDX)
-{
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CEncoderId3PageDialog)
- DDX_Control(pDX, IDC_EDITYEAR, m_ctrlEditYear);
- DDX_Control(pDX, IDC_EDITTRACK, m_ctrlEditTrack);
- DDX_Control(pDX, IDC_COMBOGENRE, m_ctrlComboGenre);
- DDX_Control(pDX, IDC_CHECKCOPYRIGHT, m_ctrlCheckCopyright);
- DDX_Text(pDX, IDC_EDITALBUM, m_oEditAlbum);
- DDX_Text(pDX, IDC_EDITARTIST, m_oEditArtist);
- DDX_Text(pDX, IDC_EDITCOMMENT, m_oEditComment);
- DDX_Text(pDX, IDC_EDITCOMPOSER, m_oEditComposer);
- DDX_Text(pDX, IDC_EDITENCODEDBY, m_oEditEncodedBy);
- DDX_Text(pDX, IDC_EDITORIGINALARTIST, m_oEditOriginalArtist);
- DDX_Text(pDX, IDC_EDITTITLE, m_oEditTitle);
- DDX_Text(pDX, IDC_EDITTRACK, m_oEditTrack);
- DDX_Text(pDX, IDC_EDITURL, m_oEditUrl);
- DDX_Text(pDX, IDC_EDITYEAR, m_oEditYear);
- //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(CEncoderId3PageDialog, CDialog)
- //{{AFX_MSG_MAP(CEncoderId3PageDialog)
- ON_CBN_KILLFOCUS(IDC_COMBOGENRE, OnKillfocusComboGenre)
- ON_EN_KILLFOCUS(IDC_EDITALBUM, OnKillfocusEditAlbum)
- ON_EN_KILLFOCUS(IDC_EDITARTIST, OnKillfocusEditArtist)
- ON_EN_KILLFOCUS(IDC_EDITCOMMENT, OnKillfocusEditComment)
- ON_EN_KILLFOCUS(IDC_EDITCOMPOSER, OnKillfocusEditComposer)
- ON_EN_KILLFOCUS(IDC_EDITENCODEDBY, OnKillfocusEditEncodedBy)
- ON_EN_KILLFOCUS(IDC_EDITORIGINALARTIST, OnKillfocusEditOriginalArtist)
- ON_EN_KILLFOCUS(IDC_EDITTITLE, OnKillfocusEditTitle)
- ON_EN_KILLFOCUS(IDC_EDITTRACK, OnKillfocusEditTrack)
- ON_EN_KILLFOCUS(IDC_EDITURL, OnKillfocusEditUrl)
- ON_EN_KILLFOCUS(IDC_EDITYEAR, OnKillfocusEditYear)
- ON_BN_CLICKED(IDC_CHECKCOPYRIGHT, OnCheckCopyright)
- ON_EN_UPDATE(IDC_EDITTRACK, OnUpdateEditTrack)
- ON_EN_UPDATE(IDC_EDITYEAR, OnUpdateEditYear)
- //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// CEncoderId3PageDialog message handlers
-
-BOOL CEncoderId3PageDialog::OnInitDialog()
-{
- CDialog::OnInitDialog();
-
- // TODO: Add extra initialization here
- m_bInitialized=true;
-
- // show our contents
- ApplyPageContents(ParseJobs());
-
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
-}
-
-bool CEncoderId3PageDialog::GetPageContents(CEncoderId3PropertyPageContents &oTarget)
-{
- if (!UpdateData(TRUE)) return false;
-
- oTarget.m_oArtist.SetContent(m_oEditArtist);
- oTarget.m_oTrackNo.SetContent(m_oEditTrack);
- oTarget.m_oAlbum.SetContent(m_oEditAlbum);
- oTarget.m_oYear.SetContent(m_oEditYear);
- oTarget.m_oTitle.SetContent(m_oEditTitle);
- oTarget.m_oCopyright.SetCheckCode(m_ctrlCheckCopyright.GetCheck());
- oTarget.m_oOriginalArtist.SetContent(m_oEditOriginalArtist);
- oTarget.m_oComposer.SetContent(m_oEditComposer);
- oTarget.m_oUrl.SetContent(m_oEditUrl);
- oTarget.m_oGenre.SetCurComboBoxSelectionText(&m_ctrlComboGenre);
- oTarget.m_oEncodedBy.SetContent(m_oEditEncodedBy);
- oTarget.m_oComment.SetContent(m_oEditComment);
-
- return true;
-}
-
-void CEncoderId3PageDialog::ApplyPageContents(const CEncoderId3PropertyPageContents &oPageContents)
-{
- // disabled since it could cause error messages - we're overwriting everything anyway
- //UpdateData(TRUE);
-
- m_oEditArtist=oPageContents.m_oArtist.GetContent();
- m_oEditTrack=oPageContents.m_oTrackNo.GetContent();
- m_oEditAlbum=oPageContents.m_oAlbum.GetContent();
- m_oEditYear=oPageContents.m_oYear.GetContent();
- m_oEditTitle=oPageContents.m_oTitle.GetContent();
- oPageContents.m_oCopyright.ApplyCheckCodeToButton(&m_ctrlCheckCopyright);
- m_oEditOriginalArtist=oPageContents.m_oOriginalArtist.GetContent();
- m_oEditComposer=oPageContents.m_oComposer.GetContent();
- m_oEditUrl=oPageContents.m_oUrl.GetContent();
- oPageContents.m_oGenre.ApplyToComboBoxPointer(&m_ctrlComboGenre);
- m_oEditEncodedBy=oPageContents.m_oEncodedBy.GetContent();
- m_oEditComment=oPageContents.m_oComment.GetContent();
-
- if (m_bInitialized)
- {
- UpdateData(FALSE);
- }
-}
-
-CEncoderId3PropertyPageContents CEncoderId3PageDialog::ParseJobs()
-{
- CEncoderId3PropertyPageContents oToReturn;
- bool bFirstRun=true;
-
- CBListReader oReader(m_oJobsToConfigure);
- CJob *poCurJob;
- while (m_oJobsToConfigure.GetNextElemContent(oReader, poCurJob))
- {
- if (!poCurJob->GetJobType()==CJob::eEncoderJob)
- {
- // must all be encoder jobs
- ASSERT(false);
- }
- CEncoderJob *poEncoderJob=poCurJob->GetEncoderJob();
- if (bFirstRun)
- {
- oToReturn=poEncoderJob->GetId3PageContents();
- bFirstRun=false;
- }
- else
- {
- oToReturn*=poEncoderJob->GetId3PageContents();
- }
- }
-
- return oToReturn;
-}
-
-void CEncoderId3PageDialog::ModifyJobs(const CEncoderId3PropertyPageContents &oPageContents)
-{
- CBListReader oReader(m_oJobsToConfigure);
- CJob *poCurJob;
- while (m_oJobsToConfigure.GetNextElemContent(oReader, poCurJob))
- {
- if (!poCurJob->GetJobType()==CJob::eEncoderJob)
- {
- // must all be encoder jobs
- ASSERT(false);
- }
- CEncoderJob *poEncoderJob=poCurJob->GetEncoderJob();
- poEncoderJob->ApplyId3PageContents(oPageContents);
- }
-}
-
-void CEncoderId3PageDialog::UpdateJobs(bool bFinishCheckBoxSessions, bool bDlgDestructUpdate)
-{
- if (::IsWindow(*this) && !m_bIgnoreUpdates)
- {
- CEncoderId3PropertyPageContents oPageContents;
- if (GetPageContents(oPageContents))
- {
- if (bFinishCheckBoxSessions)
- {
- FinishCurrentCheckBoxSessionIfNecessary();
- }
-
- ModifyJobs(oPageContents);
-
- // make changes visible
- m_poListContainer->ReFillInJobListCtrl();
- }
- }
-
- if (bDlgDestructUpdate)
- {
- m_bIgnoreUpdates=true;
- }
-}
-
-void CEncoderId3PageDialog::OnKillfocusComboGenre()
-{
- // TODO: Add your control notification handler code here
- UpdateJobs();
-}
-
-void CEncoderId3PageDialog::OnKillfocusEditAlbum()
-{
- // TODO: Add your control notification handler code here
- UpdateJobs();
-}
-
-void CEncoderId3PageDialog::OnKillfocusEditArtist()
-{
- // TODO: Add your control notification handler code here
- UpdateJobs();
-}
-
-void CEncoderId3PageDialog::OnKillfocusEditComment()
-{
- // TODO: Add your control notification handler code here
- UpdateJobs();
-}
-
-void CEncoderId3PageDialog::OnKillfocusEditComposer()
-{
- // TODO: Add your control notification handler code here
- UpdateJobs();
-}
-
-void CEncoderId3PageDialog::OnKillfocusEditEncodedBy()
-{
- // TODO: Add your control notification handler code here
- UpdateJobs();
-}
-
-void CEncoderId3PageDialog::OnKillfocusEditOriginalArtist()
-{
- // TODO: Add your control notification handler code here
- UpdateJobs();
-}
-
-void CEncoderId3PageDialog::OnKillfocusEditTitle()
-{
- // TODO: Add your control notification handler code here
- UpdateJobs();
-}
-
-void CEncoderId3PageDialog::OnKillfocusEditTrack()
-{
- // TODO: Add your control notification handler code here
- UpdateJobs();
-}
-
-void CEncoderId3PageDialog::OnKillfocusEditUrl()
-{
- // TODO: Add your control notification handler code here
- UpdateJobs();
-}
-
-void CEncoderId3PageDialog::OnKillfocusEditYear()
-{
- // TODO: Add your control notification handler code here
- UpdateJobs();
-}
-
-void CEncoderId3PageDialog::OnCheckCopyright()
-{
- // TODO: Add your control notification handler code here
- ProcessCheckBoxClick(&m_ctrlCheckCopyright, eCopyright);
-}
-
-void CEncoderId3PageDialog::ProcessCheckBoxClick(CButton *poCheckBox, ETypeOfCheckBox eTypeOfCheckBox)
-{
- int iCheckState=poCheckBox->GetCheck();
- if (iCheckState==2)
- {
- // 3rd state
- if (m_eCurCheckBox!=eTypeOfCheckBox)
- {
- // must not be like this
- ASSERT(false);
- }
- else
- {
- m_oCheckStateChangeStateSaver.RestoreJobs(m_oJobsToConfigure);
- FinishCurrentCheckBoxSessionIfNecessary();
- }
- }
- else
- {
- if (m_eCurCheckBox!=eTypeOfCheckBox)
- {
- FinishCurrentCheckBoxSessionIfNecessary();
-
- // current checkbox is now set to eNone
-
- m_eCurCheckBox=eTypeOfCheckBox;
-
- m_oCheckStateChangeStateSaver.SaveJobs(m_oJobsToConfigure);
- }
- }
-
- UpdateJobs(false);
-}
-
-void CEncoderId3PageDialog::FinishCurrentCheckBoxSessionIfNecessary()
-{
- switch (m_eCurCheckBox)
- {
- case eCopyright:
- {
- FinishCheckBoxSessionIfNecessary(&m_ctrlCheckCopyright);
- break;
- }
- case eNone:
- {
- // nothing
- break;
- }
- default:
- {
- // unkown type of check box
- break;
- }
- }
- m_eCurCheckBox=eNone;
-}
-
-void CEncoderId3PageDialog::FinishCheckBoxSessionIfNecessary(CButton *poCheckBox)
-{
- int iCurCheck=poCheckBox->GetCheck();
- if (iCurCheck<2)
- {
- poCheckBox->SetButtonStyle(BS_AUTOCHECKBOX);
- }
-}
-
-void CEncoderId3PageDialog::OnUpdateEditTrack()
-{
- // TODO: If this is a RICHEDIT control, the control will not
- // send this notification unless you override the CDialog::OnInitDialog()
- // function to send the EM_SETEVENTMASK message to the control
- // with the ENM_UPDATE flag ORed into the lParam mask.
-
- // TODO: Add your control notification handler code here
- CWindowUtil::ForceNumericContent(&m_ctrlEditTrack, false);
-}
-
-void CEncoderId3PageDialog::OnUpdateEditYear()
-{
- // TODO: If this is a RICHEDIT control, the control will not
- // send this notification unless you override the CDialog::OnInitDialog()
- // function to send the EM_SETEVENTMASK message to the control
- // with the ENM_UPDATE flag ORed into the lParam mask.
-
- // TODO: Add your control notification handler code here
- CWindowUtil::ForceNumericContent(&m_ctrlEditYear, false);
-}
--- a/wingui/EncoderId3PageDialog.h
+++ /dev/null
@@ -1,108 +1,0 @@
-#if !defined(AFX_ENCODERID3PAGEDIALOG_H__442115D0_0FD4_11D5_8402_0080C88C25BD__INCLUDED_)
-#define AFX_ENCODERID3PAGEDIALOG_H__442115D0_0FD4_11D5_8402_0080C88C25BD__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-// EncoderId3PageDialog.h : header file
-//
-
-#include "JobListUpdatable.h"
-#include "JobListsToConfigureSaver.h"
-
-/////////////////////////////////////////////////////////////////////////////
-// CEncoderId3PageDialog dialog
-
-class CEncoderId3PageDialog : public CDialog
-{
-// Construction
-public:
- CEncoderId3PageDialog(const TItemList<CJob*> &oJobsToConfigure, CJobListUpdatable *poListContainer, CWnd* pParent = NULL); // standard constructor
- virtual ~CEncoderId3PageDialog();
-
-// Dialog Data
- //{{AFX_DATA(CEncoderId3PageDialog)
- enum { IDD = IDD_ENCODERID3PAGEDIALOG };
- CEdit m_ctrlEditYear;
- CEdit m_ctrlEditTrack;
- CComboBox m_ctrlComboGenre;
- CButton m_ctrlCheckCopyright;
- CString m_oEditAlbum;
- CString m_oEditArtist;
- CString m_oEditComment;
- CString m_oEditComposer;
- CString m_oEditEncodedBy;
- CString m_oEditOriginalArtist;
- CString m_oEditTitle;
- CString m_oEditTrack;
- CString m_oEditUrl;
- CString m_oEditYear;
- //}}AFX_DATA
-
-
-// Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CEncoderId3PageDialog)
- protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- //}}AFX_VIRTUAL
-public:
- // returns false in case of errors
- bool GetPageContents(CEncoderId3PropertyPageContents &oTarget);
- void ApplyPageContents(const CEncoderId3PropertyPageContents &oPageContents);
-
-// Implementation
-protected:
-
- // Generated message map functions
- //{{AFX_MSG(CEncoderId3PageDialog)
- virtual BOOL OnInitDialog();
- afx_msg void OnKillfocusComboGenre();
- afx_msg void OnKillfocusEditAlbum();
- afx_msg void OnKillfocusEditArtist();
- afx_msg void OnKillfocusEditComment();
- afx_msg void OnKillfocusEditComposer();
- afx_msg void OnKillfocusEditEncodedBy();
- afx_msg void OnKillfocusEditOriginalArtist();
- afx_msg void OnKillfocusEditTitle();
- afx_msg void OnKillfocusEditTrack();
- afx_msg void OnKillfocusEditUrl();
- afx_msg void OnKillfocusEditYear();
- afx_msg void OnCheckCopyright();
- afx_msg void OnUpdateEditTrack();
- afx_msg void OnUpdateEditYear();
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-
- bool m_bInitialized;
-
- TItemList<CJob*> m_oJobsToConfigure;
-
- CJobListUpdatable *m_poListContainer;
-
- CEncoderId3PropertyPageContents ParseJobs();
- void ModifyJobs(const CEncoderId3PropertyPageContents &oPageContents);
-
- // called when changes have been made in the dialog and are to
- // be synchronized with both "data holders"
- void UpdateJobs(bool bFinishCheckBoxSessions=true, bool bDlgDestructUpdate=false);
- bool m_bIgnoreUpdates;
-
-
- // these members are used for managing the check box controls and the
- // changes that are made with them in the dialog
- enum ETypeOfCheckBox
- {
- eNone,
- eCopyright,
- } m_eCurCheckBox;
- CJobListsToConfigureSaver m_oCheckStateChangeStateSaver;
- void ProcessCheckBoxClick(CButton *poCheckBox, ETypeOfCheckBox eTypeOfCheckBox);
- void FinishCurrentCheckBoxSessionIfNecessary();
- void FinishCheckBoxSessionIfNecessary(CButton *poCheckBox);
-};
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_ENCODERID3PAGEDIALOG_H__442115D0_0FD4_11D5_8402_0080C88C25BD__INCLUDED_)
--- a/wingui/EncoderId3PropertyPageContents.cpp
+++ /dev/null
@@ -1,46 +1,0 @@
-// EncoderId3PropertyPageContents.cpp: implementation of the CEncoderId3PropertyPageContents class.
-// Author: Torsten Landmann
-//
-//////////////////////////////////////////////////////////////////////
-
-#include "stdafx.h"
-#include "faac_wingui.h"
-#include "EncoderId3PropertyPageContents.h"
-
-#ifdef _DEBUG
-#undef THIS_FILE
-static char THIS_FILE[]=__FILE__;
-#define new DEBUG_NEW
-#endif
-
-//////////////////////////////////////////////////////////////////////
-// Construction/Destruction
-//////////////////////////////////////////////////////////////////////
-
-CEncoderId3PropertyPageContents::CEncoderId3PropertyPageContents()
-{
-
-}
-
-CEncoderId3PropertyPageContents::~CEncoderId3PropertyPageContents()
-{
-
-}
-
-CEncoderId3PropertyPageContents& CEncoderId3PropertyPageContents::operator*=(const CEncoderId3PropertyPageContents &oRight)
-{
- m_oArtist*=oRight.m_oArtist;
- m_oTrackNo*=oRight.m_oTrackNo;
- m_oAlbum*=oRight.m_oAlbum;
- m_oYear*=oRight.m_oYear;
- m_oTitle*=oRight.m_oTitle;
- m_oCopyright*=oRight.m_oCopyright;
- m_oOriginalArtist*=oRight.m_oOriginalArtist;
- m_oComposer*=oRight.m_oComposer;
- m_oUrl*=oRight.m_oUrl;
- m_oGenre*=oRight.m_oGenre;
- m_oEncodedBy*=oRight.m_oEncodedBy;
- m_oComment*=oRight.m_oComment;
-
- return *this;
-}
\ No newline at end of file
--- a/wingui/EncoderId3PropertyPageContents.h
+++ /dev/null
@@ -1,44 +1,0 @@
-// EncoderId3PropertyPageContents.h: interface for the CEncoderId3PropertyPageContents class.
-// Author: Torsten Landmann
-//
-// encapsulates the content of the property page "id3" including
-// possible 3rd states of all controls
-//
-//////////////////////////////////////////////////////////////////////
-
-#if !defined(AFX_ENCODERID3PROPERTYPAGECONTENTS_H__0C2E1C01_10AE_11D5_8402_0080C88C25BD__INCLUDED_)
-#define AFX_ENCODERID3PROPERTYPAGECONTENTS_H__0C2E1C01_10AE_11D5_8402_0080C88C25BD__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-#include "AbstractPropertyPageContents.h"
-#include "PageEditCtrlContent.h"
-#include "PageCheckboxCtrlContent.h"
-#include "PageComboBoxCtrlContent.h"
-
-class CEncoderId3PropertyPageContents : public CAbstractPropertyPageContents
-{
-public:
- CEncoderId3PropertyPageContents();
- virtual ~CEncoderId3PropertyPageContents();
-
- CPageEditCtrlContent m_oArtist;
- CPageEditCtrlContent m_oTrackNo;
- CPageEditCtrlContent m_oAlbum;
- CPageEditCtrlContent m_oYear;
- CPageEditCtrlContent m_oTitle;
- CPageCheckboxCtrlContent m_oCopyright;
- CPageEditCtrlContent m_oOriginalArtist;
- CPageEditCtrlContent m_oComposer;
- CPageEditCtrlContent m_oUrl;
- CPageComboBoxCtrlContent m_oGenre;
- CPageEditCtrlContent m_oEncodedBy;
- CPageEditCtrlContent m_oComment;
-
- // with this operator pages for several jobs can be "merged"
- CEncoderId3PropertyPageContents& operator*=(const CEncoderId3PropertyPageContents &oRight);
-};
-
-#endif // !defined(AFX_ENCODERID3PROPERTYPAGECONTENTS_H__0C2E1C01_10AE_11D5_8402_0080C88C25BD__INCLUDED_)
--- a/wingui/EncoderJob.cpp
+++ /dev/null
@@ -1,734 +1,0 @@
-// EncoderJob.cpp: implementation of the CEncoderJob class.
-// Author: Torsten Landmann
-//
-//////////////////////////////////////////////////////////////////////
-
-#include "stdafx.h"
-#include "faac_wingui.h"
-#include "EncoderJob.h"
-#include "EncoderJobProcessingManager.h"
-#include "ProcessJobStatusDialog.h"
-#include "RecursiveDirectoryTraverser.h"
-
-#ifdef _DEBUG
-#undef THIS_FILE
-static char THIS_FILE[]=__FILE__;
-#define new DEBUG_NEW
-#endif
-
-//////////////////////////////////////////////////////////////////////
-// Construction/Destruction
-//////////////////////////////////////////////////////////////////////
-
-CEncoderJob::CEncoderJob():
- m_bAllowMidSide(false),
- m_bUseTns(false),
- m_bUseLtp(false),
- m_bUseLfe(false),
- m_eMpegVersion(eMpegVersion2),
- m_eAacProfile(eAacProfileMain),
- m_ulBitRate(128000),
- m_ulBandwidth(22500)
-{
-
-}
-
-CEncoderJob::CEncoderJob(const CEncoderJob &oSource)
-{
- *this=oSource;
-}
-
-CEncoderJob::~CEncoderJob()
-{
-
-}
-
-
-/*CEncoderJob& CEncoderJob::operator=(const CEncoderJob &oRight)
-{
- m_oFiles=oRight.m_oFiles;
- m_bSourceFileFilterIsRecursive=oRight.m_bSourceFileFilterIsRecursive;
- m_oTargetFileId3Info=oRight.m_oTargetFileId3Info;
-
- m_bAllowMidSide=oRight.m_bAllowMidSide;
- m_bUseTns=oRight.m_bUseTns;
- m_bUseLtp=oRight.m_bUseLtp;
- m_bUseLfe=oRight.m_bUseLfe;
- m_eAacProfile=oRight.m_eAacProfile;
-
- m_ulBitRate=oRight.m_ulBitRate;
-
- m_ulBandwidth=oRight.m_ulBandwidth;
-
- return *this;
-}*/
-
-CString CEncoderJob::DescribeJobTypeShort() const
-{
- CString oEncoderJob;
- oEncoderJob.LoadString(IDS_EncoderJobShort);
- return oEncoderJob;
-}
-
-CString CEncoderJob::DescribeJobTypeLong() const
-{
- CString oEncoderJob;
- oEncoderJob.LoadString(IDS_EncoderJobLong);
- return oEncoderJob;
-}
-
-CString CEncoderJob::DescribeJob() const
-{
- CString oToReturn;
- oToReturn.Format(
- "%s - %s - %s - %.0f kbit/s - %.0f kHz",
- GetFiles().GetSourceFileName(),
- TranslateMpegVersionToShortString(GetMpegVersion()),
- TranslateAacProfileToShortString(GetAacProfile()),
- (double)GetBitRate()/1000,
- (double)GetBandwidth()/1000
- );
- if (GetAllowMidside())
- {
- CString oMidSide;
- oMidSide.LoadString(IDS_MidSide);
- oToReturn+=CString(" - ")+oMidSide;
- }
- if (GetUseTns())
- {
- CString oTns;
- oTns.LoadString(IDS_UseTns);
- oToReturn+=CString(" - ")+oTns;
- }
-// if (GetUseLtp())
-// {
-// CString oLtp;
-// oLtp.LoadString(IDS_UseLtp);
-// oToReturn+=CString(" - ")+oLtp;
-// }
- if (GetUseLfe())
- {
- CString oLfe;
- oLfe.LoadString(IDS_UseLfe);
- oToReturn+=CString(" - ")+oLfe;
- }
- return oToReturn;
-}
-
-CSupportedPropertyPagesData CEncoderJob::GetSupportedPropertyPages() const
-{
- CSupportedPropertyPagesData toReturn;
- toReturn.ShowPage(ePageTypeEncoderGeneral);
- toReturn.ShowPage(ePageTypeEncoderQuality);
- toReturn.ShowPage(ePageTypeEncoderID3);
-
- return toReturn;
-}
-
-bool CEncoderJob::ProcessJob(CJobProcessingDynamicUserInputInfo &oUserInputInfo)
-{
- if (!CFilePathCalc::IsValidFileMask(GetFiles().GetSourceFileName()))
- {
- // it's a regular single file encoder job
-
- // create the manager that manages and performs the processing
- CEncoderJobProcessingManager oManager(this, oUserInputInfo);
- if (!oManager.MayStartProcessingWithStatusDialog())
- {
- // the manager advises that we do not even create the status dialog
- return false;
- }
-
- // create the status dialog
- CProcessJobStatusDialog oDlg(&oManager);
- return oDlg.DoModal()==IDOK;
- }
- else
- {
- // it's a filter encoder job
-
- // count which jobs we found
- long lNumberOfSuccessJobs=0;
- long lNumberOfAbortJobs=0;
- long lNumberOfErrorJobs=0;
- long lStartTime=::GetTickCount();
-
- CJobList oExpandedJobList;
- if (!ExpandFilterJob(oExpandedJobList, lNumberOfErrorJobs)) return false;
-
- CBListReader oReader(oExpandedJobList);
- CJob *poCurrentJob;
- bool bContinue=true;
- while ((poCurrentJob=oExpandedJobList.GetNextJob(oReader))!=0)
- {
- if (bContinue)
- {
- // process the job
- if (poCurrentJob->ProcessJob(oUserInputInfo))
- {
- // job has been successfully processed
- lNumberOfSuccessJobs++;
- }
- else
- {
- // error or user abort during processing
- switch (poCurrentJob->GetProcessingOutcomeSimple())
- {
- case CAbstractJob::eUserAbort:
- {
- lNumberOfAbortJobs++;
-
- // ask if to continue with remaining jobs
- CString oError;
- oError.Format(IDS_ErrorCreatingNestedEncoderJob, poCurrentJob->GetEncoderJob()->GetFiles().GetCompleteSourceFilePath(), GetFiles().GetCompleteSourceFilePath());
- if (AfxMessageBox(oError, MB_YESNO)!=IDYES)
- {
- bContinue=false;
- }
- break;
- }
- case CAbstractJob::eError:
- {
- lNumberOfErrorJobs++;
- break;
- }
- default:
- {
- // unknown return type of job processing
- ASSERT(false);
- lNumberOfErrorJobs++;
- break;
- }
- }
- }
- }
- else
- {
- // one of the remaining jobs after a "permanently aborted" one
- lNumberOfAbortJobs++;
- }
- }
-
- // save how well we processed the filter job
- EJobProcessingOutcome eJobProcessingOutcome;
- CString oSupplementaryInfo;
- oSupplementaryInfo.Format(IDS_FilterJobSupplementaryInfo, lNumberOfSuccessJobs+lNumberOfAbortJobs+lNumberOfErrorJobs, lNumberOfSuccessJobs, lNumberOfErrorJobs, lNumberOfAbortJobs);
- if (lNumberOfSuccessJobs==0)
- {
- eJobProcessingOutcome=eError;
- }
- else
- {
- if (lNumberOfAbortJobs>0 || lNumberOfErrorJobs>0)
- {
- eJobProcessingOutcome=ePartiallyProcessed;
- }
- else
- {
- eJobProcessingOutcome=eSuccessfullyProcessed;
- }
- }
- SetProcessingOutcome(eJobProcessingOutcome, ::GetTickCount()-lStartTime, oSupplementaryInfo);
-
- /*// first find out all files that actually belong to the job
- TItemList<CString> oFiles=
- CRecursiveDirectoryTraverser::FindFiles(
- GetFiles().GetSourceFileDirectory(),
- GetFiles().GetSourceFileName(),
- GetSourceFileFilterIsRecursive());
-
- if (oFiles.GetNumber()==0)
- {
- CString oError;
- oError.Format(IDS_FilterDidntFindFiles, GetFiles().GetCompleteSourceFilePath());
- AfxMessageBox(oError);
- return false;
- }
-
- long lTotalNumberOfSubJobsToProcess=oFiles.GetNumber();
- long lCurSubJobCount=0;
-
- CBListReader oReader(oFiles);
- CString oCurrentFilePath;
- while (oFiles.GetNextElemContent(oReader, oCurrentFilePath))
- {
- CEncoderJob oNewJob(*this);
- oNewJob.SetSubJobNumberInfo(lCurSubJobCount++, lTotalNumberOfSubJobsToProcess);
- if (!oNewJob.GetFiles().SetCompleteSourceFilePath(oCurrentFilePath))
- {
- CString oError;
- oError.Format(IDS_ErrorCreatingNestedEncoderJob, oCurrentFilePath, GetFiles().GetCompleteSourceFilePath());
- if (AfxMessageBox(oError, MB_YESNO)!=IDYES)
- {
- return false;
- }
- }
- // assemble the target file name and apply it to the new job
- {
- // find out the long name of the source file directory
- CString oSourceFileDir;
- {
- oSourceFileDir=GetFiles().GetSourceFileDirectory();
- CString oTemp;
- LPTSTR pDummy;
- ::GetFullPathName(oSourceFileDir,
- MAX_PATH, oTemp.GetBuffer(MAX_PATH),
- &pDummy);
- oTemp.ReleaseBuffer();
- if (oTemp[oTemp.GetLength()-1]=='\\')
- {
- oTemp.Delete(oTemp.GetLength()-1);
- }
-
- oSourceFileDir=oTemp;
- }
-
- // find out the suffix to append to the target directory
- // for our particular file
- CString oDirSuffix;
- {
- CString oFileDir(oCurrentFilePath);
- CFilePathCalc::MakePath(oFileDir);
- int iLength=oFileDir.GetLength();
- oDirSuffix=oFileDir.Right(iLength-oSourceFileDir.GetLength());
- oDirSuffix.Delete(0);
- }
-
- // determine the target directory for that particular file
- CString oTargetDir(GetFiles().GetTargetFileDirectory());
- CFilePathCalc::MakePath(oTargetDir, true);
- oTargetDir+=oDirSuffix;
- if (!CRecursiveDirectoryTraverser::MakeSureDirectoryExists(oTargetDir))
- {
- CString oError;
- oError.Format(IDS_ErrorCreatingNestedEncoderJob, oCurrentFilePath, GetFiles().GetCompleteSourceFilePath());
- AfxMessageBox("Error creating target directory", MB_OK | MB_ICONSTOP); // XXX insert resource string and ask user what to do
- return false;
- }
-
- CString oSourceFileName;
- CFilePathCalc::ExtractFileName(oCurrentFilePath, oSourceFileName);
- CString oSourceFileNameRaw;
- CString oSourceFileExtension;
- CFilePathCalc::SplitFileAndExtension(oSourceFileName, oSourceFileNameRaw, oSourceFileExtension);
- oNewJob.GetFiles().SetTargetFileDirectory(oTargetDir);
- CString oDefaultExtension;
- oDefaultExtension.LoadString(IDS_EndTargetFileStandardExtension);
- oNewJob.GetFiles().SetTargetFileName(oSourceFileNameRaw+"."+oDefaultExtension);
- }
-
- // process the new job
- if (!oNewJob.ProcessJob())
- {
- CString oError;
- oError.Format(IDS_ErrorCreatingNestedEncoderJob, oCurrentFilePath, GetFiles().GetCompleteSourceFilePath());
- if (AfxMessageBox(oError, MB_YESNO)!=IDYES)
- {
- return false;
- }
- }
- }*/
-
- return true;
- }
-}
-
-CString CEncoderJob::GetDetailedDescriptionForStatusDialog() const
-{
- CString oToReturn;
- oToReturn.Format(
- IDS_DetailedEncoderJobDescriptionString,
- GetFiles().GetCompleteSourceFilePath(),
- GetFiles().GetCompleteTargetFilePath(),
- TranslateMpegVersionToShortString(GetMpegVersion()),
- TranslateAacProfileToShortString(GetAacProfile()),
- GetBitRate(),
- GetBandwidth()
- );
- if (GetAllowMidside())
- {
- CString oMidSide;
- oMidSide.LoadString(IDS_MidSide);
- oToReturn+=CString(" - ")+oMidSide;
- }
- if (GetUseTns())
- {
- CString oTns;
- oTns.LoadString(IDS_UseTns);
- oToReturn+=CString(" - ")+oTns;
- }
-// if (GetUseLtp())
-// {
-// CString oLtp;
-// oLtp.LoadString(IDS_UseLtp);
-// oToReturn+=CString(" - ")+oLtp;
-// }
- if (GetUseLfe())
- {
- CString oLfe;
- oLfe.LoadString(IDS_UseLfe);
- oToReturn+=CString(" - ")+oLfe;
- }
- return oToReturn;
-}
-
-bool CEncoderJob::PutToArchive(CArchive &oArchive) const
-{
- // put a class version flag
- int iVersion=1;
- oArchive << iVersion;
-
- if (!m_oFiles.PutToArchive(oArchive)) return false;
- CFileSerializable::SerializeBool(oArchive, m_bSourceFileFilterIsRecursive);
- if (!m_oTargetFileId3Info.PutToArchive(oArchive)) return false;
-
- oArchive << m_eAacProfile;
- CFileSerializable::SerializeBool(oArchive, m_bAllowMidSide);
- CFileSerializable::SerializeBool(oArchive, m_bUseTns);
- CFileSerializable::SerializeBool(oArchive, m_bUseLtp);
- CFileSerializable::SerializeBool(oArchive, m_bUseLfe);
- oArchive << m_ulBitRate;
- oArchive << m_ulBandwidth;
-
- return true;
-}
-
-bool CEncoderJob::GetFromArchive(CArchive &oArchive)
-{
- // fetch the class version flag
- int iVersion;
- oArchive >> iVersion;
-
- switch (iVersion)
- {
- case 1:
- {
- if (!m_oFiles.GetFromArchive(oArchive)) return false;
- CFileSerializable::DeSerializeBool(oArchive, m_bSourceFileFilterIsRecursive);
- if (!m_oTargetFileId3Info.GetFromArchive(oArchive)) return false;
-
- oArchive >> (int&)m_eAacProfile;
- CFileSerializable::DeSerializeBool(oArchive, m_bAllowMidSide);
- CFileSerializable::DeSerializeBool(oArchive, m_bUseTns);
- CFileSerializable::DeSerializeBool(oArchive, m_bUseLtp);
- CFileSerializable::DeSerializeBool(oArchive, m_bUseLfe);
- oArchive >> m_ulBitRate;
- oArchive >> m_ulBandwidth;
-
- return true;
- }
- default:
- {
- // unknown file format version
- return false;
- }
- }
-}
-
-CString CEncoderJob::TranslateAacProfileToShortString(EAacProfile eAacProfile)
-{
- int iStringId;
- switch (eAacProfile)
- {
- case eAacProfileLc:
- {
- iStringId=IDS_AacProfileLc;
- break;
- }
- case eAacProfileMain:
- {
- iStringId=IDS_AacProfileMain;
- break;
- }
- case eAacProfileSsr:
- {
- iStringId=IDS_AacProfileSsr;
- break;
- }
- case eAacProfileLtp:
- {
- iStringId=IDS_AacProfileLtp;
- break;
- }
- default:
- {
- // unknown aac profile
- ASSERT(false);
- iStringId=0;
- break;
- }
- }
-
- CString oToReturn;
- oToReturn.Format(iStringId);
- return oToReturn;
-}
-
-CString CEncoderJob::TranslateMpegVersionToShortString(EMpegVersion eMpegVersion)
-{
- int iStringId;
- switch (eMpegVersion)
- {
- case eMpegVersion2:
- {
- iStringId=IDS_MpegVersion2;
- break;
- }
- case eMpegVersion4:
- {
- iStringId=IDS_MpegVersion4;
- break;
- }
- default:
- {
- // unknown mpeg version
- ASSERT(false);
- iStringId=0;
- break;
- }
- }
-
- CString oToReturn;
- oToReturn.LoadString(iStringId);
- return oToReturn;
-}
-
-bool CEncoderJob::ExpandFilterJob(CJobList &oTarget, long &lNumberOfErrorJobs, bool bCreateDirectories) const
-{
- if (!CFilePathCalc::IsValidFileMask(GetFiles().GetSourceFileName()))
- {
- ASSERT(false); // not a filter job
- lNumberOfErrorJobs+=oTarget.GetNumber();
- return false;
- }
- else
- {
- // it's a filter encoder job
-
- oTarget.DeleteAll();
-
- // first find out all files that actually belong to the job
- TItemList<CString> oFiles=
- CRecursiveDirectoryTraverser::FindFiles(
- GetFiles().GetSourceFileDirectory(),
- GetFiles().GetSourceFileName(),
- GetSourceFileFilterIsRecursive());
-
- if (oFiles.GetNumber()==0)
- {
- // no files there that match the filter
- return true;
- }
-
- long lTotalNumberOfSubJobsToProcess=oFiles.GetNumber();
- long lCurSubJobCount=0;
-
- CBListReader oReader(oFiles);
- CString oCurrentFilePath;
- while (oFiles.GetNextElemContent(oReader, oCurrentFilePath))
- {
- bool bCurSubJobSuccess=true;
- CEncoderJob oNewJob(*this);
- oNewJob.ResetProcessingOutcome();
- oNewJob.SetSubJobNumberInfo(lCurSubJobCount++, lTotalNumberOfSubJobsToProcess);
- if (!oNewJob.GetFiles().SetCompleteSourceFilePath(oCurrentFilePath))
- {
- bCurSubJobSuccess=false;
- }
- else
- {
- // assemble the target file name and apply it to the new job
- {
- // find out the long name of the source file directory
- CString oSourceFileDir;
- {
- oSourceFileDir=GetFiles().GetSourceFileDirectory();
- CString oTemp;
- LPTSTR pDummy;
- ::GetFullPathName(oSourceFileDir,
- MAX_PATH, oTemp.GetBuffer(MAX_PATH),
- &pDummy);
- oTemp.ReleaseBuffer();
- if (oTemp[oTemp.GetLength()-1]=='\\')
- {
- oTemp.Delete(oTemp.GetLength()-1);
- }
-
- oSourceFileDir=oTemp;
- }
-
- // find out the suffix to append to the target directory
- // for our particular file
- CString oDirSuffix;
- {
- CString oFileDir(oCurrentFilePath);
- CFilePathCalc::MakePath(oFileDir);
- int iLength=oFileDir.GetLength();
- oDirSuffix=oFileDir.Right(iLength-oSourceFileDir.GetLength());
- oDirSuffix.Delete(0);
- }
-
- // determine the target directory for that particular file
- CString oTargetDir(GetFiles().GetTargetFileDirectory());
- CFilePathCalc::MakePath(oTargetDir, true);
- oTargetDir+=oDirSuffix;
- if (bCreateDirectories)
- {
- // must display an error message at ASSERT(false) a few lines below
- // and oprionally ask the user what to do if the functionality
- // auto create directories should ever be used (i.e. we can reach
- // here)
- ASSERT(false);
- if (!CRecursiveDirectoryTraverser::MakeSureDirectoryExists(oTargetDir))
- {
- // must display an error message and oprionally ask the user what to do
- // if this functionality (auto create directories) should ever be used
- ASSERT(false);
- }
- }
-
- CString oSourceFileName;
- CFilePathCalc::ExtractFileName(oCurrentFilePath, oSourceFileName);
- CString oSourceFileNameRaw;
- CString oSourceFileExtension;
- CFilePathCalc::SplitFileAndExtension(oSourceFileName, oSourceFileNameRaw, oSourceFileExtension);
- oNewJob.GetFiles().SetTargetFileDirectory(oTargetDir);
- CString oDefaultExtension;
- oDefaultExtension.LoadString(IDS_EndTargetFileStandardExtension);
- oNewJob.GetFiles().SetTargetFileName(oSourceFileNameRaw+"."+oDefaultExtension);
- }
- }
-
- // add the job or increment the errorneous jobs counter
- if (bCurSubJobSuccess)
- {
- oTarget.AddJob(oNewJob);
- }
- else
- {
- lNumberOfErrorJobs++;
- }
- }
-
- return true;
- }
-}
-
-CEncoderGeneralPropertyPageContents CEncoderJob::GetGeneralPageContents() const
-{
- CEncoderGeneralPropertyPageContents oToReturn;
- oToReturn.m_oSourceDirectory.SetContent(GetFiles().GetSourceFileDirectory());
- oToReturn.m_oSourceFile.SetContent(GetFiles().GetSourceFileName());
- oToReturn.m_oTargetDirectory.SetContent(GetFiles().GetTargetFileDirectory());
- oToReturn.m_oTargetFile.SetContent(GetFiles().GetTargetFileName());
- oToReturn.m_oSourceFileFilterIsRecursive.SetCheckMark(GetSourceFileFilterIsRecursive());
-
- // save if this job would have the "recursive" check box enabled
- oToReturn.m_oSourceFilterRecursiveCheckboxVisible.SetCheckMark(CFilePathCalc::IsValidFileMask(GetFiles().GetSourceFileName()));
-
- return oToReturn;
-}
-
-void CEncoderJob::ApplyGeneralPageContents(const CEncoderGeneralPropertyPageContents &oPageContents)
-{
- bool bModified=false;
-
- // note: the use of getters on the righthand side is correct since they return references
- bModified=bModified || oPageContents.m_oSourceDirectory.ApplyToJob(GetFiles().GetSourceFileDirectory());
- bModified=bModified || oPageContents.m_oSourceFile.ApplyToJob(GetFiles().GetSourceFileName());
- bModified=bModified || oPageContents.m_oTargetDirectory.ApplyToJob(GetFiles().GetTargetFileDirectory());
- bModified=bModified || oPageContents.m_oTargetFile.ApplyToJob(GetFiles().GetTargetFileName());
- bModified=bModified || oPageContents.m_oSourceFileFilterIsRecursive.ApplyToJob(m_bSourceFileFilterIsRecursive);
-
- // ignore oPageContents.m_oSourceFilterRecursiveCheckboxVisible
-
- // when the job has been modified reset it to "unprocessed" state
- if (bModified)
- {
- ResetProcessingOutcome();
- }
-}
-
-CEncoderQualityPropertyPageContents CEncoderJob::GetQualityPageContents() const
-{
- CEncoderQualityPropertyPageContents oToReturn;
- oToReturn.m_oBitRate.SetContent(GetBitRateL());
- oToReturn.m_oBandwidth.SetContent(GetBandwidthL());
- oToReturn.m_oAllowMidSide.SetCheckMark(GetAllowMidside());
- oToReturn.m_oUseTns.SetCheckMark(GetUseTns());
- oToReturn.m_oUseLtp.SetCheckMark(GetUseLtp());
- oToReturn.m_oUseLfe.SetCheckMark(GetUseLfe());
- oToReturn.m_oAacProfile.SetContent(GetAacProfileL(), true);
- oToReturn.m_oMpegVersion.SetContent(GetMpegVersionL(), true);
-
- return oToReturn;
-}
-
-void CEncoderJob::ApplyQualityPageContents(const CEncoderQualityPropertyPageContents &oPageContents)
-{
- bool bModified=false;
-
- // note: the use of getters on the righthand side is correct since they return references
- bModified=bModified || oPageContents.m_oBitRate.ApplyToJob((long&)m_ulBitRate);
- bModified=bModified || oPageContents.m_oBandwidth.ApplyToJob((long&)m_ulBandwidth);
- bModified=bModified || oPageContents.m_oAllowMidSide.ApplyToJob(m_bAllowMidSide);
- bModified=bModified || oPageContents.m_oUseTns.ApplyToJob(m_bUseTns);
- bModified=bModified || oPageContents.m_oUseLtp.ApplyToJob(m_bUseLtp);
- bModified=bModified || oPageContents.m_oUseLfe.ApplyToJob(m_bUseLfe);
- long lTemp=GetAacProfileL();
- bModified=bModified || oPageContents.m_oAacProfile.ApplyToJob(lTemp);
- SetAacProfile(lTemp);
- lTemp=GetMpegVersionL();
- bModified=bModified || oPageContents.m_oMpegVersion.ApplyToJob(lTemp);
- SetMpegVersion(lTemp);
-
- // when the job has been modified reset it to "unprocessed" state
- if (bModified)
- {
- ResetProcessingOutcome();
- }
-}
-
-CEncoderId3PropertyPageContents CEncoderJob::GetId3PageContents() const
-{
- CEncoderId3PropertyPageContents oToReturn;
- oToReturn.m_oArtist.SetContent(GetTargetFileId3Info().GetArtist());
- oToReturn.m_oTrackNo.SetContent(GetTargetFileId3Info().GetTrackNo(), true);
- oToReturn.m_oAlbum.SetContent(GetTargetFileId3Info().GetAlbum());
- oToReturn.m_oYear.SetContent(GetTargetFileId3Info().GetYear(), true);
- oToReturn.m_oTitle.SetContent(GetTargetFileId3Info().GetSongTitle());
- oToReturn.m_oCopyright.SetCheckMark(GetTargetFileId3Info().GetCopyright());
- oToReturn.m_oOriginalArtist.SetContent(GetTargetFileId3Info().GetOriginalArtist());
- oToReturn.m_oComposer.SetContent(GetTargetFileId3Info().GetComposer());
- oToReturn.m_oUrl.SetContent(GetTargetFileId3Info().GetUrl());
- oToReturn.m_oGenre.SetContentText(GetTargetFileId3Info().GetGenre());
- oToReturn.m_oEncodedBy.SetContent(GetTargetFileId3Info().GetEncodedBy());
- oToReturn.m_oComment.SetContent(GetTargetFileId3Info().GetComment());
-
- return oToReturn;
-}
-
-void CEncoderJob::ApplyId3PageContents(const CEncoderId3PropertyPageContents &oPageContents)
-{
- bool bModified=false;
-
- // note: the use of getters on the righthand side is correct since they return references
- bModified=bModified || oPageContents.m_oArtist.ApplyToJob(GetTargetFileId3Info().GetArtist());
- bModified=bModified || oPageContents.m_oTrackNo.ApplyToJob(GetTargetFileId3Info().GetTrackNoRef());
- bModified=bModified || oPageContents.m_oAlbum.ApplyToJob(GetTargetFileId3Info().GetAlbum());
- bModified=bModified || oPageContents.m_oYear.ApplyToJob(GetTargetFileId3Info().GetYearRef());
- bModified=bModified || oPageContents.m_oTitle.ApplyToJob(GetTargetFileId3Info().GetSongTitle());
- bModified=bModified || oPageContents.m_oCopyright.ApplyToJob(GetTargetFileId3Info().GetCopyrightRef());
- bModified=bModified || oPageContents.m_oOriginalArtist.ApplyToJob(GetTargetFileId3Info().GetOriginalArtist());
- bModified=bModified || oPageContents.m_oComposer.ApplyToJob(GetTargetFileId3Info().GetComposer());
- bModified=bModified || oPageContents.m_oUrl.ApplyToJob(GetTargetFileId3Info().GetUrl());
- bModified=bModified || oPageContents.m_oGenre.ApplyToJob(GetTargetFileId3Info().GetGenre());
- bModified=bModified || oPageContents.m_oEncodedBy.ApplyToJob(GetTargetFileId3Info().GetEncodedBy());
- bModified=bModified || oPageContents.m_oComment.ApplyToJob(GetTargetFileId3Info().GetComment());
-
- // when the job has been modified reset it to "unprocessed" state
- if (bModified)
- {
- ResetProcessingOutcome();
- }
-}
\ No newline at end of file
--- a/wingui/EncoderJob.h
+++ /dev/null
@@ -1,147 +1,0 @@
-// EncoderJob.h: interface for the CEncoderJob class.
-// Author: Torsten Landmann
-//
-//////////////////////////////////////////////////////////////////////
-
-#if !defined(AFX_ENCODERJOB_H__DFE38E70_0E81_11D5_8402_0080C88C25BD__INCLUDED_)
-#define AFX_ENCODERJOB_H__DFE38E70_0E81_11D5_8402_0080C88C25BD__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-#include "SourceTargetFilePair.h"
-#include "Id3TagInfo.h"
-#include "ConcreteJobBase.h"
-#include "EncoderGeneralPropertyPageContents.h"
-#include "EncoderQualityPropertyPageContents.h"
-#include "EncoderId3PropertyPageContents.h"
-//#include "JobList.h" // ring include
-class CJobList;
-
-// do not derive this class from CJob;
-// rather let CJob objects contain instances of this class
-class CEncoderJob : public CConcreteJobBase
-{
-public:
- CEncoderJob();
- CEncoderJob(const CEncoderJob &oSource); // copy constructor
- virtual ~CEncoderJob();
-
- enum EMpegVersion
- {
- eMpegVersion2=0,
- eMpegVersion4=1
- };
-
- enum EAacProfile
- {
- eAacProfileMain=0, // the values of the enumerated constants
- eAacProfileLc=1, // must reflect the order of the radio
- eAacProfileSsr=2, // controls on the property page, starting with 0
- eAacProfileLtp=3
- };
-
- // property getters
- const CSourceTargetFilePair& GetFiles() const { return m_oFiles; }
- CSourceTargetFilePair& GetFiles() { return m_oFiles; }
- CSourceTargetFilePair* GetFilesPointer() { return &m_oFiles; }
- bool GetSourceFileFilterIsRecursive() const { return m_bSourceFileFilterIsRecursive; }
- const CId3TagInfo& GetTargetFileId3Info() const { return m_oTargetFileId3Info; }
- CId3TagInfo& GetTargetFileId3Info() { return m_oTargetFileId3Info; }
- CId3TagInfo* GetTargetFileId3InfoPointer() { return &m_oTargetFileId3Info; }
- bool GetAllowMidside() const { return m_bAllowMidSide; }
- bool GetUseTns() const { return m_bUseTns; }
- bool GetUseLtp() const { return m_bUseLtp; }
- bool GetUseLfe() const { return m_bUseLfe; }
- EAacProfile GetAacProfile() const { return m_eAacProfile; }
- long GetAacProfileL() const { return m_eAacProfile; }
- unsigned long GetBitRate() const { return m_ulBitRate; }
- long GetBitRateL() const { return (long)m_ulBitRate; }
- unsigned long GetBandwidth() const { return m_ulBandwidth; }
- long GetBandwidthL() const { return (long)m_ulBandwidth; }
- EMpegVersion GetMpegVersion() const { return m_eMpegVersion; }
- long GetMpegVersionL() const { return m_eMpegVersion; }
-
- // property setters
- void SetFiles(const CSourceTargetFilePair &oFiles) { m_oFiles=oFiles; }
- void SetSourceFileFilterIsRecursive(bool bIsRecursive) { m_bSourceFileFilterIsRecursive=bIsRecursive; }
- void SetTargetFileId3Info(const CId3TagInfo &oTargetFileId3Info) { m_oTargetFileId3Info=oTargetFileId3Info; }
- void SetAllowMidside(bool bAllowMidSide) { m_bAllowMidSide=bAllowMidSide; }
- void SetUseTns(bool bUseTns) { m_bUseTns=bUseTns; }
- void SetUseLtp(bool bUseLtp) { m_bUseLtp=bUseLtp; }
- void SetUseLfe(bool bUseLfe) { m_bUseLfe=bUseLfe; }
- void SetAacProfile(EAacProfile eAacProfile) { m_eAacProfile=eAacProfile; }
- void SetAacProfile(long lAacProfile) { m_eAacProfile=(EAacProfile)lAacProfile; }
- void SetBitRate(unsigned long ulBitRate) { m_ulBitRate=ulBitRate; }
- void SetBitRate(long lBitRate) { ASSERT(lBitRate>=0); m_ulBitRate=(unsigned long)lBitRate; }
- void SetBandwidth(unsigned long ulBandwidth) { m_ulBandwidth=ulBandwidth; }
- void SetBandwidth(long lBandwidth) { ASSERT(lBandwidth>=0); m_ulBandwidth=lBandwidth; }
- void SetMpegVersion(EMpegVersion eMpegVersion) { m_eMpegVersion = eMpegVersion; }
- void SetMpegVersion(long lMpegVersion) { m_eMpegVersion = (EMpegVersion)lMpegVersion; }
-
- // no more up to date (also had to call base class version at least)
- // CEncoderJob& operator=(const CEncoderJob &oRight);
-
- // property page interaction
- CEncoderGeneralPropertyPageContents GetGeneralPageContents() const;
- void ApplyGeneralPageContents(const CEncoderGeneralPropertyPageContents &oPageContents);
- CEncoderQualityPropertyPageContents GetQualityPageContents() const;
- void ApplyQualityPageContents(const CEncoderQualityPropertyPageContents &oPageContents);
- CEncoderId3PropertyPageContents GetId3PageContents() const;
- void ApplyId3PageContents(const CEncoderId3PropertyPageContents &oPageContents);
-
- // implementations to CJobListCtrlDescribable
- virtual CString DescribeJobTypeShort() const;
- virtual CString DescribeJobTypeLong() const;
- virtual CString DescribeJob() const;
-
- // implementations to CAbstractJob
- virtual CSupportedPropertyPagesData GetSupportedPropertyPages() const;
- virtual bool ProcessJob(CJobProcessingDynamicUserInputInfo &oUserInputInfo);
- virtual CString GetDetailedDescriptionForStatusDialog() const;
-
- // implementations to CFileSerializable
- virtual bool PutToArchive(CArchive &oArchive) const;
- virtual bool GetFromArchive(CArchive &oArchive);
-
- static CString TranslateAacProfileToShortString(EAacProfile eAacProfile);
- static CString TranslateMpegVersionToShortString(EMpegVersion eMpegVersion);
-
- // when <this> is an encoder job with a filter as source file this method expands
- // this job to a list of single jobs to process;
- // returns false in case of errors but displays error messages on its own;
- // the bCreateDirectories parameter specifies if the target directory structure
- // is already to be created, normally the default value false should be appropriate;
- // the lNumberOfErrorJobs parameter returns the number of jobs that failed to be created;
- // note that this method only increments the previous value if errorneous jobs are
- // encountered, it does not reset it in any kind;
- bool ExpandFilterJob(CJobList &oTarget, long &lNumberOfErrorJobs, bool bCreateDirectories=false) const;
-
-private:
- CSourceTargetFilePair m_oFiles;
- bool m_bSourceFileFilterIsRecursive;
- CId3TagInfo m_oTargetFileId3Info;
-
- // MPEG version
- EMpegVersion m_eMpegVersion;
-
- /* AAC profile */
- EAacProfile m_eAacProfile;
- /* Allow mid/side coding */
- bool m_bAllowMidSide;
- /* Use Temporal Noise Shaping */
- bool m_bUseTns;
- /* Use Long Term Prediction */
- bool m_bUseLtp;
- /* Use one of the channels as LFE channel */
- bool m_bUseLfe;
-
- /* bitrate / channel of AAC file */
- unsigned long m_ulBitRate;
-
- /* AAC file frequency bandwidth */
- unsigned long m_ulBandwidth;
-};
-
-#endif // !defined(AFX_ENCODERJOB_H__DFE38E70_0E81_11D5_8402_0080C88C25BD__INCLUDED_)
--- a/wingui/EncoderJobProcessingManager.cpp
+++ /dev/null
@@ -1,481 +1,0 @@
-// EncoderJobProcessingManager.cpp: implementation of the CEncoderJobProcessingManager class.
-//
-//////////////////////////////////////////////////////////////////////
-
-#include "stdafx.h"
-#include "faac_wingui.h"
-#include "EncoderJobProcessingManager.h"
-#include "WindowUtil.h"
-#include "RecursiveDirectoryTraverser.h"
-
-#include <sndfile.h>
-#include "faac.h"
-
-#ifdef _DEBUG
-#undef THIS_FILE
-static char THIS_FILE[]=__FILE__;
-#define new DEBUG_NEW
-#endif
-
-//#define DUMMY_ENCODERJOB_PROCESSING
-
-//////////////////////////////////////////////////////////////////////
-// Construction/Destruction
-//////////////////////////////////////////////////////////////////////
-
-CEncoderJobProcessingManager::CEncoderJobProcessingManager(
- CEncoderJob *poJobToProcess, CJobProcessingDynamicUserInputInfo &oUserInputInfo):
-
- m_poJobToProcess(poJobToProcess),
- m_poInfoTarget(0),
- m_eCurrentWorkingState(eInitial),
- m_oUserInputInfo(oUserInputInfo)
-{
-}
-
-CEncoderJobProcessingManager::~CEncoderJobProcessingManager()
-{
-}
-
-bool CEncoderJobProcessingManager::MayStartProcessingWithStatusDialog()
-{
- long lStartTimeMillis=::GetTickCount();
- CEncoderJob *poJob=m_poJobToProcess;
- // make sure the target directory exists at all
- {
- CString oTargetFileDir(poJob->GetFiles().GetTargetFileDirectory());
- if (oTargetFileDir.GetLength()<1)
- {
- CString oError;
- oError.LoadString(IDS_InvalidTargetDirectory);
- poJob->SetProcessingOutcomeCurTime(CAbstractJob::eError, lStartTimeMillis, oError);
- return false;
- }
-
- while (oTargetFileDir.GetAt(oTargetFileDir.GetLength()-1)=='\\')
- {
- oTargetFileDir.Delete(oTargetFileDir.GetLength()-1);
- }
- if (CRecursiveDirectoryTraverser::CountMatchingFiles(oTargetFileDir)<1)
- {
- // the target directory doesn't exist;
- // there are two possibilities: create it
- // or
- // abort with an error
- CString oTargetDir(poJob->GetFiles().GetTargetFileDirectory());
- if (m_oUserInputInfo.GetAutoCreateDirectoryBool(oTargetDir))
- {
- if (!CRecursiveDirectoryTraverser::MakeSureDirectoryExists(oTargetDir))
- {
- // directory couldn't be created;
- // log the error
- CString oError;
- oError.Format(IDS_ErrorCreatingDirectory, poJob->GetFiles().GetTargetFileDirectory());
- poJob->SetProcessingOutcomeCurTime(CAbstractJob::eError, lStartTimeMillis, oError);
- return false;
- }
- }
- else
- {
- // the directory doesn't exist and the user refused to create it
- poJob->SetProcessingOutcomeCurTime(CAbstractJob::eError, lStartTimeMillis, IDS_UserRefusedToCreateTargetDirectory);
- return false;
- }
- }
- else
- {
- // the directory already exists so everything is ok up to here
- }
- }
-
- return true;
-}
-
-void CEncoderJobProcessingManager::Start(
- CProcessingStatusDialogInfoFeedbackCallbackInterface *poInfoTarget)
-{
- if (poInfoTarget!=0)
- {
- m_poInfoTarget=poInfoTarget;
- }
-
- switch (m_eCurrentWorkingState)
- {
- case eInitial:
- {
- // initialize the status dialog
- {
- // define supported buttons
- m_poInfoTarget->SetAvailableActions(true, false);
-
- // set the dialog caption
- m_poInfoTarget->SetAdditionalCaptionInfo(m_poJobToProcess->GetJobProcessingAdditionalCaptionBarInformation());
- }
-
- // initialize ourselves and run the job
- m_eCurrentWorkingState=eRunning;
- m_poInfoTarget->ReturnToCaller(DoProcessing());
- break;
- }
- case ePaused:
- {
- m_eCurrentWorkingState=eRunning;
- break;
- }
- default:
- {
- // call to Start() is invalid except in the above two cases
- ASSERT(false);
- }
- }
-}
-
-void CEncoderJobProcessingManager::Stop()
-{
- switch (m_eCurrentWorkingState)
- {
- case eRunning:
- case ePaused:
- {
- m_eCurrentWorkingState=eStopped;
- break;
- }
- case eCleanup:
- {
- // ignore
- break;
- }
- default:
- {
- // call to Stop() is invalid except in the above two cases
- ASSERT(false);
- }
- }
-}
-
-void CEncoderJobProcessingManager::Pause()
-{
- switch (m_eCurrentWorkingState)
- {
- case eRunning:
- {
- m_eCurrentWorkingState=ePaused;
- break;
- }
- default:
- {
- // call to Pause() is invalid except in the above case
- ASSERT(false);
- }
- }
-}
-
-#ifdef DUMMY_ENCODERJOB_PROCESSING
-bool CEncoderJobProcessingManager::DoProcessing()
-{
- long lStartTimeMillis=::GetTickCount();
-
- const CEncoderJob *poJob=m_poJobToProcess;
-
- long lMaxCount=250*64000/(5+poJob->GetBitRate());
- for (long lPos=0; lPos<lMaxCount; lPos++)
- {
- long lMultiplicationDummy;
- for (long lPosInner=0; lPosInner<10000000; lPosInner++)
- {
- // just a pause to simulate work
- lMultiplicationDummy=234985;
- lMultiplicationDummy*=301872;
- }
-
- switch (m_eCurrentWorkingState)
- {
- case eRunning:
- {
- // just report our current state
- WriteProgress(lStartTimeMillis, lMaxCount, lPos);
- m_poInfoTarget->ProcessUserMessages();
- break;
- }
- case ePaused:
- {
- // must wait
- while (m_eCurrentWorkingState==ePaused)
- {
- // be idle
- m_poInfoTarget->ProcessUserMessages();
- Sleep(200);
- }
- break;
- }
- case eStopped:
- {
- // must interrupt
- poJob->SetProcessingOutcomeCurTime(CAbstractJob::eUserAbort, lStartTimeMillis, "");
- return false;
- }
- }
- }
-
- m_eCurrentWorkingState=eCleanup;
-
- poJob->SetProcessingOutcomeCurTime(CAbstractJob::eSuccessfullyProcessed, lStartTimeMillis, "");
-
- return true;
-}
-
-#else
-
-bool CEncoderJobProcessingManager::DoProcessing()
-{
- long lStartTimeMillis=::GetTickCount();
- CEncoderJob *poJob=m_poJobToProcess;
- bool bInterrupted=false;
-
-#ifdef _DEBUG
- // make sure preprocessing has been done properly to warn the programmer if not
- if (!MayStartProcessingWithStatusDialog())
- {
- // you should call MayStartProcessingWithStatusDialog() before starting
- // a status dialog driven processing of the job
- ASSERT(false);
- }
-#endif
-
- SNDFILE *phInFile;
- SF_INFO sctSfInfo;
-
- // open the input file
- if ((phInFile=sf_open_read(poJob->GetFiles().GetCompleteSourceFilePath(), &sctSfInfo)) != NULL)
- {
- // determine input file parameters
- long lSampleRate=sctSfInfo.samplerate;
- long lNumChannels=sctSfInfo.channels;
-
- // open and setup the encoder
- unsigned long ulInputSamplesPerLoopCycle;
- unsigned long ulMaxLoopCycleOutputSize;
- faacEncHandle hEncoder=faacEncOpen(lSampleRate, lNumChannels, &ulInputSamplesPerLoopCycle, &ulMaxLoopCycleOutputSize);
- if (hEncoder!=0)
- {
- // set encoder configuration
- faacEncConfigurationPtr pEncConfig=faacEncGetCurrentConfiguration(hEncoder);
-
- pEncConfig->allowMidside = poJob->GetAllowMidside() ? 1 : 0;
- pEncConfig->useTns = poJob->GetUseTns() ? 1 : 0;
-// pEncConfig->useLtp = poJob->GetUseLtp() ? 1 : 0;
- pEncConfig->useLfe = poJob->GetUseLfe() ? 1 : 0;
- pEncConfig->bitRate = poJob->GetBitRate();
- pEncConfig->bandWidth = poJob->GetBandwidth();
- pEncConfig->mpegVersion = GetMpegVersionConstant(poJob->GetMpegVersion());
- pEncConfig->aacObjectType = GetAacProfileConstant(poJob->GetAacProfile());
-
- /* temp fix for MPEG4 LTP object type */
-// if (pEncConfig->aacObjectType == 1)
-// pEncConfig->aacObjectType = 3;
-
- if (!faacEncSetConfiguration(hEncoder, pEncConfig))
- {
- faacEncClose(hEncoder);
- sf_close(phInFile);
-
- poJob->SetProcessingOutcomeCurTime(CAbstractJob::eError, lStartTimeMillis, IDS_FaacEncSetConfigurationFailed);
-
- return false;
- }
-
- // open the output file
- CFile *poFile;
- CArchive *poTargetFileOutputArchive;
- if (OpenOutputFileArchive(poJob->GetFiles().GetCompleteTargetFilePath(), poFile, poTargetFileOutputArchive))
- {
- long lStartTime=GetTickCount();
- long lLastUpdated=0;
- long lTotalBytesRead = 0;
-
- long lSamplesInput=0;
- long lBytesConsumed=0;
- short *parsPcmBuf;
- char *parcBitBuf;
-
- parsPcmBuf=new short[ulInputSamplesPerLoopCycle];
- parcBitBuf=new char[ulMaxLoopCycleOutputSize];
-
- while (true)
- {
- long lBytesWritten;
-
- lSamplesInput=sf_read_short(phInFile, parsPcmBuf, ulInputSamplesPerLoopCycle);
-
- lTotalBytesRead+=lSamplesInput*sizeof(short);
-
- // call the actual encoding routine
- lBytesWritten=faacEncEncode(
- hEncoder,
- parsPcmBuf,
- lSamplesInput,
- parcBitBuf,
- ulMaxLoopCycleOutputSize);
-
- switch (m_eCurrentWorkingState)
- {
- case eRunning:
- {
- // just report our current state and process waiting window messages
- WriteProgress(lStartTimeMillis, (sctSfInfo.samples*sizeof(short)*lNumChannels), lTotalBytesRead);
- m_poInfoTarget->ProcessUserMessages();
- break;
- }
- case ePaused:
- {
- // must wait
- while (m_eCurrentWorkingState==ePaused)
- {
- // be idle
- m_poInfoTarget->ProcessUserMessages();
- Sleep(200);
- }
- break;
- }
- case eStopped:
- {
- // must interrupt
- bInterrupted=true;
- break;
- }
- }
-
- if (bInterrupted)
- {
- // Stop Pressed
- poJob->SetProcessingOutcomeCurTime(CAbstractJob::eUserAbort, lStartTimeMillis, "");
- break;
- }
-
- if (lSamplesInput==0 && lBytesWritten==0)
- {
- // all done, bail out
- poJob->SetProcessingOutcomeCurTime(CAbstractJob::eSuccessfullyProcessed, lStartTimeMillis, "");
- break;
- }
-
- if (lBytesWritten < 0)
- {
- poJob->SetProcessingOutcomeCurTime(CAbstractJob::eError, lStartTimeMillis, IDS_FaacEncEncodeFrameFailed);
- bInterrupted=true;
- break;
- }
-
- poTargetFileOutputArchive->Write(parcBitBuf, lBytesWritten);
- }
-
- // close the target file
- if (poTargetFileOutputArchive!=0) delete poTargetFileOutputArchive;
- if (poFile!=0) delete poFile;
- if (parsPcmBuf!=0) delete[] parsPcmBuf;
- if (parcBitBuf!=0) delete[] parcBitBuf;
- }
-
- faacEncClose(hEncoder);
- }
-
- sf_close(phInFile);
- //MessageBeep(1); // no more done here
- }
- else
- {
- poJob->SetProcessingOutcomeCurTime(CAbstractJob::eError, lStartTimeMillis, IDS_CouldntOpenInputFile);
- bInterrupted=true;
- }
-
- return !bInterrupted;
-}
-#endif
-
-void CEncoderJobProcessingManager::WriteProgress(long lOperationStartTickCount, long lMaxSteps, long lCurSteps)
-{
- long lCurTime=::GetTickCount();
- double dProgress=100.*lCurSteps/lMaxSteps;
- if (dProgress>100) dProgress=100; // just security
- if (dProgress<0) dProgress=0; // just security
- CString oTopStatusText=m_poJobToProcess->GetDetailedDescriptionForStatusDialog();
-
- long lElapsedTime=lCurTime-lOperationStartTickCount;
- long lEstimateEntireTime=(long)((100.*lElapsedTime)/dProgress);
- long lETA=lEstimateEntireTime-lElapsedTime;
- CString oElapsedTime(CWindowUtil::GetTimeDescription(lElapsedTime));
- CString oEntireTime(CWindowUtil::GetTimeDescription(lEstimateEntireTime));
- CString oETA(CWindowUtil::GetTimeDescription(lETA));
- CString oBottomStatusText;
- oBottomStatusText.Format("%.1f %%\n\n%s / %s - %s", dProgress, oElapsedTime, oEntireTime, oETA);
-
- m_poInfoTarget->SetStatus(dProgress, oTopStatusText, oBottomStatusText);
-}
-
-int CEncoderJobProcessingManager::GetAacProfileConstant(CEncoderJob::EAacProfile eAacProfile)
-{
- switch (eAacProfile)
- {
- case CEncoderJob::eAacProfileLc:
- {
- return LOW;
- }
- case CEncoderJob::eAacProfileMain:
- {
- return MAIN;
- }
- case CEncoderJob::eAacProfileSsr:
- {
- return SSR;
- }
- case CEncoderJob::eAacProfileLtp:
- {
- return LTP;
- }
- default:
- {
- ASSERT(false);
- }
- }
-}
-
-int CEncoderJobProcessingManager::GetMpegVersionConstant(CEncoderJob::EMpegVersion eMpegVersion)
-{
- switch (eMpegVersion)
- {
- case CEncoderJob::eMpegVersion2:
- return MPEG2;
- case CEncoderJob::eMpegVersion4:
- return MPEG4;
- default:
- ASSERT(false);
- }
-}
-
-bool CEncoderJobProcessingManager::OpenOutputFileArchive(const CString &oFileName, CFile* &poFile, CArchive* &poArchive)
-{
- try
- {
- poFile=0;
- poArchive=0;
-
- // open the file
- poFile=new CFile(oFileName, CFile::modeCreate | CFile::modeWrite | CFile::shareDenyWrite);
- poArchive=new CArchive(poFile, CArchive::store);
-
- return true;
- }
- catch (...)
- {
- // error opening the file for exclusive writing
- if (poArchive!=0)
- {
- delete poArchive;
- }
- if (poFile!=0)
- {
- delete poFile;
- }
- return false;
- }
-}
\ No newline at end of file
--- a/wingui/EncoderJobProcessingManager.h
+++ /dev/null
@@ -1,69 +1,0 @@
-// EncoderJobProcessingManager.h: interface for the CEncoderJobProcessingManager class.
-// Author: Torsten Landmann
-//
-// manages the actual processing of one encoder job at a time. Note that this
-// class doesn't properly process encoder jobs that have a file mask set
-// as input file. Callers must filter out these jobs before using this class.
-//
-//////////////////////////////////////////////////////////////////////
-
-#if !defined(AFX_ENCODERJOBPROCESSINGMANAGER_H__A1444E93_1546_11D5_8402_0080C88C25BD__INCLUDED_)
-#define AFX_ENCODERJOBPROCESSINGMANAGER_H__A1444E93_1546_11D5_8402_0080C88C25BD__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-#include "EncoderJob.h"
-#include "ProcessingStartStopPauseInteractable.h"
-
-class CEncoderJobProcessingManager : public CProcessingStartStopPauseInteractable
-{
-public:
- CEncoderJobProcessingManager(CEncoderJob *poJobToProcess, CJobProcessingDynamicUserInputInfo &oUserInputInfo);
- virtual ~CEncoderJobProcessingManager();
-
- // encoder jobs should call this dialog before creating and starting the status dialog
- // for this processing manager; if this member returns false you can stop processing
- // of this job; this case is identical with that the the DoModal() function of the
- // status returns something different from IDOK
- bool MayStartProcessingWithStatusDialog();
-
- virtual void Start(CProcessingStatusDialogInfoFeedbackCallbackInterface *poInfoTarget);
-
- virtual void Stop();
- virtual void Pause();
-
- enum ECurrentWorkingState
- {
- eInitial,
- eRunning,
- ePaused,
- eStopped,
- eCleanup,
- } m_eCurrentWorkingState;
-
-private:
- CEncoderJob *m_poJobToProcess;
- CProcessingStatusDialogInfoFeedbackCallbackInterface *m_poInfoTarget;
- CJobProcessingDynamicUserInputInfo &m_oUserInputInfo;
-
- // returns true if the job has been completely processed
- bool DoProcessing();
-
- void WriteProgress(long lOperationStartTickCount, long lMaxSteps, long lCurSteps);
-
- static int GetAacProfileConstant(CEncoderJob::EAacProfile eAacProfile);
- static int GetMpegVersionConstant(CEncoderJob::EMpegVersion eMpegVersion);
-
- // opens an archive that writes in the specified file, 0 in
- // case of errors;
- // the caller must specify two pointers that are both initialized
- // by this method; the caller must delete these two objects when
- // he's finished - first the archive, then the file;
- // this method returns false in case of errors; then neither of
- // the two pointers must be tried to be deleted
- static bool OpenOutputFileArchive(const CString &oFileName, CFile* &poFile, CArchive* &poArchive);
-};
-
-#endif // !defined(AFX_ENCODERJOBPROCESSINGMANAGER_H__A1444E93_1546_11D5_8402_0080C88C25BD__INCLUDED_)
--- a/wingui/EncoderQualityPageDialog.cpp
+++ /dev/null
@@ -1,388 +1,0 @@
-// EncoderQualityPageDialog.cpp : implementation file
-//
-
-#include "stdafx.h"
-#include "faac_wingui.h"
-#include "EncoderQualityPageDialog.h"
-#include "EncoderQualityPropertyPageContents.h"
-#include "WindowUtil.h"
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-/////////////////////////////////////////////////////////////////////////////
-// CEncoderQualityPageDialog dialog
-
-
-CEncoderQualityPageDialog::CEncoderQualityPageDialog(
- const TItemList<CJob*> &oJobsToConfigure,
- CJobListUpdatable *poListContainer,
- CWnd* pParent /*=NULL*/):
- m_bInitialized(false),
- m_oJobsToConfigure(oJobsToConfigure),
- m_poListContainer(poListContainer),
- m_bIgnoreUpdates(false)
-{
- //{{AFX_DATA_INIT(CEncoderQualityPageDialog)
- m_oEditBandwidth = _T("");
- m_oEditBitRate = _T("");
- m_iRadioAacProfile = 1;
- m_iRadioMpegVersion = 0;
- //}}AFX_DATA_INIT
-
- Create(CEncoderQualityPageDialog::IDD, pParent);
-}
-
-CEncoderQualityPageDialog::~CEncoderQualityPageDialog()
-{
- UpdateJobs(true, true);
-}
-
-
-void CEncoderQualityPageDialog::DoDataExchange(CDataExchange* pDX)
-{
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CEncoderQualityPageDialog)
- DDX_Control(pDX, IDC_CHECKUSETNS, m_ctrlCheckUseTns);
- DDX_Control(pDX, IDC_CHECKUSELTP, m_ctrlCheckUseLtp);
- DDX_Control(pDX, IDC_EDITBANDWIDTH, m_ctrlEditBandwidth);
- DDX_Control(pDX, IDC_EDITBITRATE, m_ctrlEditBitRate);
- DDX_Control(pDX, IDC_CHECKUSELFE, m_ctrlCheckUseLfe);
- DDX_Control(pDX, IDC_CHECKMIDSIDE, m_ctrlCheckMidSide);
- DDX_Text(pDX, IDC_EDITBANDWIDTH, m_oEditBandwidth);
- DDX_Text(pDX, IDC_EDITBITRATE, m_oEditBitRate);
- DDX_Radio(pDX, IDC_RADIOMPEGVERSION2, m_iRadioMpegVersion);
- DDX_Radio(pDX, IDC_RADIOAACPROFILEMAIN, m_iRadioAacProfile);
- //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(CEncoderQualityPageDialog, CDialog)
- //{{AFX_MSG_MAP(CEncoderQualityPageDialog)
- ON_EN_UPDATE(IDC_EDITBITRATE, OnUpdateEditBitRate)
- ON_EN_UPDATE(IDC_EDITBANDWIDTH, OnUpdateEditBandwidth)
- ON_EN_KILLFOCUS(IDC_EDITBANDWIDTH, OnKillfocusEditBandWidth)
- ON_EN_KILLFOCUS(IDC_EDITBITRATE, OnKillfocusEditBitRate)
- ON_BN_CLICKED(IDC_CHECKMIDSIDE, OnCheckMidSide)
- ON_BN_CLICKED(IDC_CHECKUSELFE, OnCheckUseLfe)
- ON_BN_CLICKED(IDC_CHECKUSELTP, OnCheckUseLtp)
- ON_BN_CLICKED(IDC_CHECKUSETNS, OnCheckUseTns)
- ON_BN_CLICKED(IDC_RADIOAACPROFILELC, OnRadioAacProfileLc)
- ON_BN_CLICKED(IDC_RADIOAACPROFILEMAIN, OnRadioAacProfileMain)
- ON_BN_CLICKED(IDC_RADIOAACPROFILESSR, OnRadioAacProfileSsr)
- ON_BN_CLICKED(IDC_RADIOAACPROFILELTP, OnRadioAacProfileLtp)
- ON_BN_CLICKED(IDC_RADIOMPEGVERSION2, OnRadioMpegVersion2)
- ON_BN_CLICKED(IDC_RADIOMPEGVERSION4, OnRadioMpegVersion4)
- //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// CEncoderQualityPageDialog message handlers
-
-BOOL CEncoderQualityPageDialog::OnInitDialog()
-{
- CDialog::OnInitDialog();
-
- // TODO: Add extra initialization here
- m_bInitialized=true;
-
- // show our contents
- ApplyPageContents(ParseJobs());
-
- if (IsDlgButtonChecked(IDC_RADIOMPEGVERSION2) == BST_CHECKED)
- ::EnableWindow(::GetDlgItem(m_hWnd, IDC_RADIOAACPROFILELTP), FALSE);
-
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
-}
-
-void CEncoderQualityPageDialog::OnUpdateEditBitRate()
-{
- // TODO: If this is a RICHEDIT control, the control will not
- // send this notification unless you override the CDialog::OnInitDialog()
- // function to send the EM_SETEVENTMASK message to the control
- // with the ENM_UPDATE flag ORed into the lParam mask.
-
- // TODO: Add your control notification handler code here
- CWindowUtil::ForceNumericContent(&m_ctrlEditBitRate, false);
-}
-
-void CEncoderQualityPageDialog::OnUpdateEditBandwidth()
-{
- // TODO: If this is a RICHEDIT control, the control will not
- // send this notification unless you override the CDialog::OnInitDialog()
- // function to send the EM_SETEVENTMASK message to the control
- // with the ENM_UPDATE flag ORed into the lParam mask.
-
- // TODO: Add your control notification handler code here
- CWindowUtil::ForceNumericContent(&m_ctrlEditBandwidth, false);
-}
-
-
-bool CEncoderQualityPageDialog::GetPageContents(CEncoderQualityPropertyPageContents &oTarget)
-{
- if (!UpdateData(TRUE)) return false;
-
- oTarget.m_oBitRate.SetContent(m_oEditBitRate);
- oTarget.m_oBandwidth.SetContent(m_oEditBandwidth);
- oTarget.m_oAllowMidSide.SetCheckCode(m_ctrlCheckMidSide.GetCheck());
- oTarget.m_oUseTns.SetCheckCode(m_ctrlCheckUseTns.GetCheck());
- oTarget.m_oUseLtp.SetCheckCode(m_ctrlCheckUseLtp.GetCheck());
- oTarget.m_oUseLfe.SetCheckCode(m_ctrlCheckUseLfe.GetCheck());
- oTarget.m_oAacProfile.GetFromRadioGroupVariable(m_iRadioAacProfile, 4);
- oTarget.m_oMpegVersion.GetFromRadioGroupVariable(m_iRadioMpegVersion, 2);
-
- return true;
-}
-
-void CEncoderQualityPageDialog::ApplyPageContents(const CEncoderQualityPropertyPageContents &oPageContents)
-{
- // disabled since it could cause error messages - we're overwriting everything anyway
- //UpdateData(TRUE);
-
- m_oEditBitRate=oPageContents.m_oBitRate.GetContent();
- m_oEditBandwidth=oPageContents.m_oBandwidth.GetContent();
- oPageContents.m_oAllowMidSide.ApplyCheckCodeToButton(&m_ctrlCheckMidSide);
- oPageContents.m_oUseTns.ApplyCheckCodeToButton(&m_ctrlCheckUseTns);
- oPageContents.m_oUseLtp.ApplyCheckCodeToButton(&m_ctrlCheckUseLtp);
- oPageContents.m_oUseLfe.ApplyCheckCodeToButton(&m_ctrlCheckUseLfe);
- oPageContents.m_oAacProfile.ApplyToRadioGroupVariable(m_iRadioAacProfile);
- oPageContents.m_oMpegVersion.ApplyToRadioGroupVariable(m_iRadioMpegVersion);
-
- if (m_bInitialized)
- {
- UpdateData(FALSE);
- }
-}
-
-CEncoderQualityPropertyPageContents CEncoderQualityPageDialog::ParseJobs()
-{
- CEncoderQualityPropertyPageContents oToReturn;
- bool bFirstRun=true;
-
- CBListReader oReader(m_oJobsToConfigure);
- CJob *poCurJob;
- while (m_oJobsToConfigure.GetNextElemContent(oReader, poCurJob))
- {
- if (!poCurJob->GetJobType()==CJob::eEncoderJob)
- {
- // must all be encoder jobs
- ASSERT(false);
- }
- CEncoderJob *poEncoderJob=poCurJob->GetEncoderJob();
- if (bFirstRun)
- {
- oToReturn=poEncoderJob->GetQualityPageContents();
- bFirstRun=false;
- }
- else
- {
- oToReturn*=poEncoderJob->GetQualityPageContents();
- }
- }
-
- return oToReturn;
-}
-
-void CEncoderQualityPageDialog::ModifyJobs(const CEncoderQualityPropertyPageContents &oPageContents)
-{
- CBListReader oReader(m_oJobsToConfigure);
- CJob *poCurJob;
- while (m_oJobsToConfigure.GetNextElemContent(oReader, poCurJob))
- {
- if (!poCurJob->GetJobType()==CJob::eEncoderJob)
- {
- // must all be encoder jobs
- ASSERT(false);
- }
- CEncoderJob *poEncoderJob=poCurJob->GetEncoderJob();
- poEncoderJob->ApplyQualityPageContents(oPageContents);
- }
-}
-
-void CEncoderQualityPageDialog::UpdateJobs(bool bFinishCheckBoxSessions, bool bDlgDestructUpdate)
-{
- if (::IsWindow(*this) && !m_bIgnoreUpdates)
- {
- CEncoderQualityPropertyPageContents oPageContents;
- if (GetPageContents(oPageContents))
- {
- if (bFinishCheckBoxSessions)
- {
- FinishCurrentCheckBoxSessionIfNecessary();
- }
-
- ModifyJobs(oPageContents);
-
- // make changes visible
- m_poListContainer->ReFillInJobListCtrl();
- }
- }
-
- if (bDlgDestructUpdate)
- {
- m_bIgnoreUpdates=true;
- }
-}
-
-void CEncoderQualityPageDialog::OnKillfocusEditBandWidth()
-{
- // TODO: Add your control notification handler code here
- UpdateJobs();
-}
-
-void CEncoderQualityPageDialog::OnKillfocusEditBitRate()
-{
- // TODO: Add your control notification handler code here
- UpdateJobs();
-}
-
-void CEncoderQualityPageDialog::OnCheckMidSide()
-{
- // TODO: Add your control notification handler code here
- ProcessCheckBoxClick(&m_ctrlCheckMidSide, eAllowMidSide);
-}
-
-void CEncoderQualityPageDialog::OnCheckUseLfe()
-{
- // TODO: Add your control notification handler code here
- ProcessCheckBoxClick(&m_ctrlCheckUseLfe, eUseLfe);
-}
-
-void CEncoderQualityPageDialog::ProcessCheckBoxClick(CButton *poCheckBox, ETypeOfCheckBox eTypeOfCheckBox)
-{
- int iCheckState=poCheckBox->GetCheck();
- if (iCheckState==2)
- {
- // 3rd state
- if (m_eCurCheckBox!=eTypeOfCheckBox)
- {
- // must not be like this
- ASSERT(false);
- }
- else
- {
- m_oCheckStateChangeStateSaver.RestoreJobs(m_oJobsToConfigure);
- FinishCurrentCheckBoxSessionIfNecessary();
- }
- }
- else
- {
- if (m_eCurCheckBox!=eTypeOfCheckBox)
- {
- FinishCurrentCheckBoxSessionIfNecessary();
- // current checkbox is now set to eNone
-
- m_eCurCheckBox=eTypeOfCheckBox;
-
- m_oCheckStateChangeStateSaver.SaveJobs(m_oJobsToConfigure);
- }
- }
-
- UpdateJobs(false);
-}
-
-void CEncoderQualityPageDialog::FinishCurrentCheckBoxSessionIfNecessary()
-{
- switch (m_eCurCheckBox)
- {
- case eAllowMidSide:
- {
- FinishCheckBoxSessionIfNecessary(&m_ctrlCheckMidSide);
- break;
- }
- case eUseTns:
- {
- FinishCheckBoxSessionIfNecessary(&m_ctrlCheckUseTns);
- break;
- }
- case eUseLtp:
- {
- FinishCheckBoxSessionIfNecessary(&m_ctrlCheckUseLtp);
- break;
- }
- case eUseLfe:
- {
- FinishCheckBoxSessionIfNecessary(&m_ctrlCheckUseLfe);
- break;
- }
- case eNone:
- {
- // nothing
- break;
- }
- default:
- {
- // unkown type of check box
- break;
- }
- }
- m_eCurCheckBox=eNone;
-}
-
-void CEncoderQualityPageDialog::FinishCheckBoxSessionIfNecessary(CButton *poCheckBox)
-{
- int iCurCheck=poCheckBox->GetCheck();
- if (iCurCheck<2)
- {
- poCheckBox->SetButtonStyle(BS_AUTOCHECKBOX);
- }
-}
-
-void CEncoderQualityPageDialog::OnCheckUseLtp()
-{
- // TODO: Add your control notification handler code here
- ProcessCheckBoxClick(&m_ctrlCheckUseLtp, eUseLtp);
-}
-
-void CEncoderQualityPageDialog::OnCheckUseTns()
-{
- // TODO: Add your control notification handler code here
- ProcessCheckBoxClick(&m_ctrlCheckUseTns, eUseTns);
-}
-
-void CEncoderQualityPageDialog::OnRadioAacProfileLc()
-{
- // TODO: Add your control notification handler code here
- UpdateJobs();
-}
-
-void CEncoderQualityPageDialog::OnRadioAacProfileMain()
-{
- // TODO: Add your control notification handler code here
- UpdateJobs();
-}
-
-void CEncoderQualityPageDialog::OnRadioAacProfileSsr()
-{
- // TODO: Add your control notification handler code here
- UpdateJobs();
-}
-
-void CEncoderQualityPageDialog::OnRadioAacProfileLtp()
-{
- // TODO: Add your control notification handler code here
- UpdateJobs();
-}
-
-void CEncoderQualityPageDialog::OnRadioMpegVersion2()
-{
- // LTP option is unavailable
- if (IsDlgButtonChecked(IDC_RADIOAACPROFILELTP) == BST_CHECKED)
- {
- CheckDlgButton(IDC_RADIOAACPROFILELTP, BST_UNCHECKED);
- CheckDlgButton(IDC_RADIOAACPROFILELC, BST_CHECKED);
- }
- ::EnableWindow(::GetDlgItem(m_hWnd, IDC_RADIOAACPROFILELTP), FALSE);
- UpdateJobs();
-}
-
-void CEncoderQualityPageDialog::OnRadioMpegVersion4()
-{
- // LTP option is available
- ::EnableWindow(::GetDlgItem(m_hWnd, IDC_RADIOAACPROFILELTP), TRUE);
- UpdateJobs();
-}
--- a/wingui/EncoderQualityPageDialog.h
+++ /dev/null
@@ -1,113 +1,0 @@
-// Author: Torsten Landmann
-//
-//////////////////////////////////////////////////////////////////////
-
-#if !defined(AFX_ENCODERQUALITYPAGEDIALOG_H__7B47B264_0FF8_11D5_8402_0080C88C25BD__INCLUDED_)
-#define AFX_ENCODERQUALITYPAGEDIALOG_H__7B47B264_0FF8_11D5_8402_0080C88C25BD__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-// EncoderQualityPageDialog.h : header file
-//
-
-#include "JobListUpdatable.h"
-#include "JobListsToConfigureSaver.h"
-
-/////////////////////////////////////////////////////////////////////////////
-// CEncoderQualityPageDialog dialog
-
-class CEncoderQualityPageDialog : public CDialog
-{
-// Construction
-public:
- CEncoderQualityPageDialog(const TItemList<CJob*> &oJobsToConfigure, CJobListUpdatable *poListContainer, CWnd* pParent = NULL); // standard constructor
- virtual ~CEncoderQualityPageDialog();
-
-// Dialog Data
- //{{AFX_DATA(CEncoderQualityPageDialog)
- enum { IDD = IDD_ENCODERQUALITYPAGEDIALOG };
- CButton m_ctrlCheckUseTns;
- CButton m_ctrlCheckUseLtp;
- CEdit m_ctrlEditBandwidth;
- CEdit m_ctrlEditBitRate;
- CButton m_ctrlCheckUseLfe;
- CButton m_ctrlCheckMidSide;
- CString m_oEditBandwidth;
- CString m_oEditBitRate;
- int m_iRadioAacProfile;
- int m_iRadioMpegVersion;
- //}}AFX_DATA
-
-
-// Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CEncoderQualityPageDialog)
- protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- //}}AFX_VIRTUAL
-
-public:
- // returns false in case of errors
- bool GetPageContents(CEncoderQualityPropertyPageContents &oTarget);
- void ApplyPageContents(const CEncoderQualityPropertyPageContents &oPageContents);
-
-// Implementation
-protected:
-
- // Generated message map functions
- //{{AFX_MSG(CEncoderQualityPageDialog)
- virtual BOOL OnInitDialog();
- afx_msg void OnUpdateEditBitRate();
- afx_msg void OnUpdateEditBandwidth();
- afx_msg void OnKillfocusEditBandWidth();
- afx_msg void OnKillfocusEditBitRate();
- afx_msg void OnCheckMidSide();
- afx_msg void OnCheckUseLfe();
- afx_msg void OnCheckUseLtp();
- afx_msg void OnCheckUseTns();
- afx_msg void OnRadioAacProfileLc();
- afx_msg void OnRadioAacProfileMain();
- afx_msg void OnRadioAacProfileSsr();
- afx_msg void OnRadioAacProfileLtp();
- afx_msg void OnRadioMpegVersion2();
- afx_msg void OnRadioMpegVersion4();
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-
-private:
- bool m_bInitialized;
-
- TItemList<CJob*> m_oJobsToConfigure;
-
- CJobListUpdatable *m_poListContainer;
-
- CEncoderQualityPropertyPageContents ParseJobs();
- void ModifyJobs(const CEncoderQualityPropertyPageContents &oPageContents);
-
- // called when changes have been made in the dialog and are to
- // be synchronized with both "data holders"
- void UpdateJobs(bool bFinishCheckBoxSessions=true, bool bDlgDestructUpdate=false);
- bool m_bIgnoreUpdates;
-
-
- // these members are used for managing the check box controls and the
- // changes that are made with them in the dialog
- enum ETypeOfCheckBox
- {
- eNone,
- eAllowMidSide,
- eUseTns,
- eUseLtp,
- eUseLfe,
- } m_eCurCheckBox;
- CJobListsToConfigureSaver m_oCheckStateChangeStateSaver;
- void ProcessCheckBoxClick(CButton *poCheckBox, ETypeOfCheckBox eTypeOfCheckBox);
- void FinishCurrentCheckBoxSessionIfNecessary();
- void FinishCheckBoxSessionIfNecessary(CButton *poCheckBox);
-};
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_ENCODERQUALITYPAGEDIALOG_H__7B47B264_0FF8_11D5_8402_0080C88C25BD__INCLUDED_)
--- a/wingui/EncoderQualityPropertyPageContents.cpp
+++ /dev/null
@@ -1,45 +1,0 @@
-// EncoderQualityPropertyPageContents.cpp: implementation of the CEncoderQualityPropertyPageContents class.
-// Author: Torsten Landmann
-//
-//////////////////////////////////////////////////////////////////////
-
-#include "stdafx.h"
-#include "faac_wingui.h"
-#include "EncoderQualityPropertyPageContents.h"
-
-#ifdef _DEBUG
-#undef THIS_FILE
-static char THIS_FILE[]=__FILE__;
-#define new DEBUG_NEW
-#endif
-
-//////////////////////////////////////////////////////////////////////
-// Construction/Destruction
-//////////////////////////////////////////////////////////////////////
-
-CEncoderQualityPropertyPageContents::CEncoderQualityPropertyPageContents()
-{
-}
-
-CEncoderQualityPropertyPageContents::CEncoderQualityPropertyPageContents(const CEncoderQualityPropertyPageContents &oSource)
-{
- *this=oSource;
-}
-
-CEncoderQualityPropertyPageContents::~CEncoderQualityPropertyPageContents()
-{
-}
-
-CEncoderQualityPropertyPageContents& CEncoderQualityPropertyPageContents::operator*=(const CEncoderQualityPropertyPageContents &oRight)
-{
- m_oBitRate*=oRight.m_oBitRate;
- m_oBandwidth*=oRight.m_oBandwidth;;
- m_oAllowMidSide*=oRight.m_oAllowMidSide;
- m_oUseTns*=oRight.m_oUseTns;
- m_oUseLtp*=oRight.m_oUseLtp;
- m_oUseLfe*=oRight.m_oUseLfe;
- m_oAacProfile*=oRight.m_oAacProfile;
- m_oMpegVersion*=oRight.m_oMpegVersion;
-
- return *this;
-}
\ No newline at end of file
--- a/wingui/EncoderQualityPropertyPageContents.h
+++ /dev/null
@@ -1,41 +1,0 @@
-// EncoderQualityPropertyPageContents.h: interface for the CEncoderQualityPropertyPageContents class.
-// Author: Torsten Landmann
-//
-// encapsulates the content of the property page "quality" including
-// possible 3rd states of all controls
-//
-//////////////////////////////////////////////////////////////////////
-
-#if !defined(AFX_ENCODERQUALITYPROPERTYPAGECONTENTS_H__7B47B26A_0FF8_11D5_8402_0080C88C25BD__INCLUDED_)
-#define AFX_ENCODERQUALITYPROPERTYPAGECONTENTS_H__7B47B26A_0FF8_11D5_8402_0080C88C25BD__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-#include "AbstractPropertyPageContents.h"
-#include "PageEditCtrlContent.h"
-#include "PageCheckboxCtrlContent.h"
-#include "PageRadioGroupCtrlContent.h"
-
-class CEncoderQualityPropertyPageContents : public CAbstractPropertyPageContents
-{
-public:
- CEncoderQualityPropertyPageContents();
- CEncoderQualityPropertyPageContents(const CEncoderQualityPropertyPageContents &oSource); // copy constructor
- virtual ~CEncoderQualityPropertyPageContents();
-
- CPageEditCtrlContent m_oBitRate;
- CPageEditCtrlContent m_oBandwidth;
- CPageCheckboxCtrlContent m_oAllowMidSide;
- CPageCheckboxCtrlContent m_oUseTns;
- CPageCheckboxCtrlContent m_oUseLtp;
- CPageCheckboxCtrlContent m_oUseLfe;
- CPageRadioGroupCtrlContent m_oAacProfile;
- CPageRadioGroupCtrlContent m_oMpegVersion;
-
- // with this operator pages for several jobs can be "merged"
- CEncoderQualityPropertyPageContents& operator*=(const CEncoderQualityPropertyPageContents &oRight);
-};
-
-#endif // !defined(AFX_ENCODERQUALITYPROPERTYPAGECONTENTS_H__7B47B26A_0FF8_11D5_8402_0080C88C25BD__INCLUDED_)
--- a/wingui/FaacWinguiProgramSettings.cpp
+++ /dev/null
@@ -1,83 +1,0 @@
-// FaacWinguiProgramSettings.cpp: implementation of the CFaacWinguiProgramSettings class.
-// Author: Torsten Landmann
-//
-//////////////////////////////////////////////////////////////////////
-
-#include "stdafx.h"
-#include "faac_wingui.h"
-#include "FaacWinguiProgramSettings.h"
-
-#ifdef _DEBUG
-#undef THIS_FILE
-static char THIS_FILE[]=__FILE__;
-#define new DEBUG_NEW
-#endif
-
-//////////////////////////////////////////////////////////////////////
-// Construction/Destruction
-//////////////////////////////////////////////////////////////////////
-
-CFaacWinguiProgramSettings::CFaacWinguiProgramSettings():
- m_oDefaultEncSourceDir(""),
- m_oDefaultEncTargetDir(""),
- m_lDefaultEncBitRate(64000),
- m_lDefaultEncBandwith(18000),
- m_bDefaultEncAllowMidSide(true),
- m_bDefaultEncUseTns(true),
- m_bDefaultEncUseLtp(true),
- m_bDefaultEncUseLfe(false),
- m_eDefaultEncAacProfile(CEncoderJob::eAacProfileMain),
- m_bDefaultEncCopyrightBit(false),
- m_oDefaultEncEncodedBy(""),
- m_oDefaultEncComment("")
-{
- // use the temporary directory as target by standard if not otherwise
- // specified
- if (m_oDefaultEncTargetDir.IsEmpty())
- {
- CString oTempDir;
- strcpy(oTempDir.GetBuffer(1000), getenv("TEMP"));
- oTempDir.ReleaseBuffer();
- m_oDefaultEncTargetDir=oTempDir;
- }
- if (m_oDefaultEncTargetDir.IsEmpty())
- {
- CString oTempDir;
- strcpy(oTempDir.GetBuffer(1000), getenv("TMP"));
- oTempDir.ReleaseBuffer();
- m_oDefaultEncTargetDir=oTempDir;
- }
-}
-
-CFaacWinguiProgramSettings::~CFaacWinguiProgramSettings()
-{
-
-}
-
-void CFaacWinguiProgramSettings::ApplyToJob(CJob &oJob) const
-{
- CEncoderJob *poEncoderJob=oJob.GetEncoderJob();
- if (poEncoderJob==0)
- {
- ASSERT(false);
- return;
- }
-
- ApplyToJob(*poEncoderJob);
-}
-
-void CFaacWinguiProgramSettings::ApplyToJob(CEncoderJob &oJob) const
-{
- oJob.GetFiles().SetSourceFileDirectory(m_oDefaultEncSourceDir);
- oJob.GetFiles().SetTargetFileDirectory(m_oDefaultEncTargetDir);
- oJob.SetBitRate(m_lDefaultEncBitRate);
- oJob.SetBandwidth(m_lDefaultEncBandwith);
- oJob.SetAllowMidside(m_bDefaultEncAllowMidSide);
- oJob.SetUseTns(m_bDefaultEncUseTns);
- oJob.SetUseLtp(m_bDefaultEncUseLtp);
- oJob.SetUseLfe(m_bDefaultEncUseLfe);
- oJob.SetAacProfile(m_eDefaultEncAacProfile);
- oJob.GetTargetFileId3Info().SetCopyright(m_bDefaultEncCopyrightBit);
- oJob.GetTargetFileId3Info().SetEncodedBy(m_oDefaultEncEncodedBy);
- oJob.GetTargetFileId3Info().SetComment(m_oDefaultEncComment);
-}
--- a/wingui/FaacWinguiProgramSettings.h
+++ /dev/null
@@ -1,42 +1,0 @@
-// FaacWinguiProgramSettings.h: interface for the CFaacWinguiProgramSettings class.
-// Author: Torsten Landmann
-//
-// container for program defaults
-//
-//////////////////////////////////////////////////////////////////////
-
-#if !defined(AFX_FAACWINGUIPROGRAMSETTINGS_H__A1444E89_1546_11D5_8402_0080C88C25BD__INCLUDED_)
-#define AFX_FAACWINGUIPROGRAMSETTINGS_H__A1444E89_1546_11D5_8402_0080C88C25BD__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-#include "Job.h"
-#include "EncoderJob.h"
-
-class CFaacWinguiProgramSettings
-{
-public:
- CFaacWinguiProgramSettings();
- virtual ~CFaacWinguiProgramSettings();
-
- CString m_oDefaultEncSourceDir;
- CString m_oDefaultEncTargetDir;
- long m_lDefaultEncBitRate;
- long m_lDefaultEncBandwith;
- bool m_bDefaultEncAllowMidSide;
- bool m_bDefaultEncUseTns;
- bool m_bDefaultEncUseLtp;
- bool m_bDefaultEncUseLfe;
- CEncoderJob::EAacProfile m_eDefaultEncAacProfile;
- bool m_bDefaultEncCopyrightBit;
- CString m_oDefaultEncEncodedBy;
- CString m_oDefaultEncComment;
-
- // that's just necessary quite often: copy the defaults to a (new) job
- void ApplyToJob(CJob &oJob) const;
- void ApplyToJob(CEncoderJob &oJob) const;
-};
-
-#endif // !defined(AFX_FAACWINGUIPROGRAMSETTINGS_H__A1444E89_1546_11D5_8402_0080C88C25BD__INCLUDED_)
--- a/wingui/FileListQueryManager.cpp
+++ /dev/null
@@ -1,77 +1,0 @@
-// FileListQueryManager.cpp: implementation of the CFileListQueryManager class.
-// Author: Torsten Landmann
-//
-//////////////////////////////////////////////////////////////////////
-
-#include "stdafx.h"
-#include "faac_wingui.h"
-#include "FileListQueryManager.h"
-
-#ifdef _DEBUG
-#undef THIS_FILE
-static char THIS_FILE[]=__FILE__;
-#define new DEBUG_NEW
-#endif
-
-//////////////////////////////////////////////////////////////////////
-// Construction/Destruction
-//////////////////////////////////////////////////////////////////////
-
-CFileListQueryManager::CFileListQueryManager()
-{
-
-}
-
-CFileListQueryManager::~CFileListQueryManager()
-{
-
-}
-
-TItemList<CString> CFileListQueryManager::GetFilePaths(bool m_bOpenMode, const CString *poDefaultFile, const CString &oDefaultExtension, const CString &oExtensions)
-{
- TItemList<CString> toReturn;
- if (!m_bOpenMode)
- {
- // not supported
- ASSERT(false);
- return toReturn;
- }
-
- CFileDialog oOpenDialog(
- m_bOpenMode? TRUE : FALSE, // file open mode
- oDefaultExtension, // default extension
- (poDefaultFile!=0 ? *poDefaultFile : (LPCTSTR)0), // default file
- OFN_HIDEREADONLY | OFN_ALLOWMULTISELECT,
- oExtensions);
-
- // for multi selection we must set our own target pointer
- int iFileBufferSize=8096;
- oOpenDialog.m_ofn.lpstrFile=new char[iFileBufferSize];
- oOpenDialog.m_ofn.nMaxFile=iFileBufferSize;
- // the dialog crashes if we don't zero out the buffer
- memset(oOpenDialog.m_ofn.lpstrFile, 0, iFileBufferSize);
-
- if (oOpenDialog.DoModal()==IDOK)
- {
- // the files have been opened
- POSITION position=oOpenDialog.GetStartPosition();
- while (position!=0)
- {
- CString oCurFile=oOpenDialog.GetNextPathName(position);
- toReturn.AddNewElem(oCurFile);
- }
- }
- else
- {
- // user abort or error
- if (CommDlgExtendedError()!=0)
- {
- // an error occured
- AfxMessageBox(IDS_ErrorDuringFileSelection);
- }
- }
-
- delete[] oOpenDialog.m_ofn.lpstrFile;
-
- return toReturn;
-}
--- a/wingui/FileListQueryManager.h
+++ /dev/null
@@ -1,27 +1,0 @@
-// FileListQueryManager.h: interface for the CFileListQueryManager class.
-// Author: Torsten Landmann
-//
-// this class is a wrapper around CFileDialog and is used to let the user
-// select several files at a time
-//
-//////////////////////////////////////////////////////////////////////
-
-#if !defined(AFX_FILELISTQUERYMANAGER_H__A1444E8A_1546_11D5_8402_0080C88C25BD__INCLUDED_)
-#define AFX_FILELISTQUERYMANAGER_H__A1444E8A_1546_11D5_8402_0080C88C25BD__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-#include "TItemList.h"
-
-class CFileListQueryManager
-{
-public:
- CFileListQueryManager();
- virtual ~CFileListQueryManager();
-
- static TItemList<CString> GetFilePaths(bool m_bOpenMode=true, const CString *poDefaultFile=0, const CString &oDefaultExtension="", const CString &oExtensions="All Files (*.*)|*.*||");
-};
-
-#endif // !defined(AFX_FILELISTQUERYMANAGER_H__A1444E8A_1546_11D5_8402_0080C88C25BD__INCLUDED_)
--- a/wingui/FileMaskAssembler.cpp
+++ /dev/null
@@ -1,44 +1,0 @@
-// FileMaskAssembler.cpp: implementation of the CFileMaskAssembler class.
-//
-//////////////////////////////////////////////////////////////////////
-
-#include "stdafx.h"
-#include "faac_wingui.h"
-#include "FileMaskAssembler.h"
-
-#ifdef _DEBUG
-#undef THIS_FILE
-static char THIS_FILE[]=__FILE__;
-#define new DEBUG_NEW
-#endif
-
-//////////////////////////////////////////////////////////////////////
-// Construction/Destruction
-//////////////////////////////////////////////////////////////////////
-
-CFileMaskAssembler::CFileMaskAssembler()
-{
-
-}
-
-CFileMaskAssembler::~CFileMaskAssembler()
-{
-
-}
-
-CString CFileMaskAssembler::GetFileMask(TItemList<int> &oFilterStringEntries)
-{
- // assemble the filter string
- CString oFilter;
- long lCurIndex=1;
- int iCurItem;
- while (oFilterStringEntries.GetElemContent(lCurIndex++, iCurItem))
- {
- // accept aac files
- CString oBuf;
- oBuf.LoadString(iCurItem);
- oFilter+=oBuf+"|";
- }
- oFilter+="||";
- return oFilter;
-}
--- a/wingui/FileMaskAssembler.h
+++ /dev/null
@@ -1,31 +1,0 @@
-// FileMaskAssembler.h: interface for the CFileMaskAssembler class.
-// Author: Torsten Landmann
-//
-// This is an interesting class. It assembles a file mask for CFileDialog
-// from a list of integers. These integers point to entries in the
-// string table and have the following format: "Wav Files (*.wav)|*.wav"
-// without quotation marks; All list items are processed from index 1 until
-// the first missing index is found;
-// the string that's returned can be used without modification (provided
-// the substrings specified were okay)
-//
-//////////////////////////////////////////////////////////////////////
-
-#if !defined(AFX_FILEMASKASSEMBLER_H__A1444E8D_1546_11D5_8402_0080C88C25BD__INCLUDED_)
-#define AFX_FILEMASKASSEMBLER_H__A1444E8D_1546_11D5_8402_0080C88C25BD__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-class CFileMaskAssembler
-{
-public:
- CFileMaskAssembler();
- virtual ~CFileMaskAssembler();
-
- // see topmost comment in this file
- static CString GetFileMask(TItemList<int> &oFilterStringEntries);
-};
-
-#endif // !defined(AFX_FILEMASKASSEMBLER_H__A1444E8D_1546_11D5_8402_0080C88C25BD__INCLUDED_)
--- a/wingui/FilePathCalc.cpp
+++ /dev/null
@@ -1,484 +1,0 @@
-// FilePathCalc.cpp: implementation of the CFilePathCalc class.
-// Author: Torsten Landmann
-//
-//////////////////////////////////////////////////////////////////////
-
-#include "stdafx.h"
-#include "FilePathCalc.h"
-
-#ifdef _DEBUG
-#undef THIS_FILE
-static char THIS_FILE[]=__FILE__;
-#define new DEBUG_NEW
-#endif
-
-//////////////////////////////////////////////////////////////////////
-// Construction/Destruction
-//////////////////////////////////////////////////////////////////////
-
-CFilePathCalc::CFilePathCalc()
-{
-
-}
-
-CFilePathCalc::~CFilePathCalc()
-{
-
-}
-
-bool CFilePathCalc::GetRelativePosition(const CString &oFrom, const CString &oTo, CString &oRelativePath)
-{
- CString oFromPath(oFrom);
- CString oToPath(oTo);
-
- oFromPath.MakeLower();
- oToPath.MakeLower();
-
- // extract raw paths
- {
- if (!MakePath(oFromPath) || !MakePath(oToPath))
- {
- return false;
- }
- }
-
- // compare drive letters
- {
- CString oFromDrive;
- CString oToDrive;
- if (!ExtractDrive(oFromPath, oFromDrive) ||
- !ExtractDrive(oToPath, oToDrive))
- {
- return false;
- }
-
- if (oFromDrive!=oToDrive)
- {
- // drive letters are different
-
- oRelativePath=oTo;
- return true;
- }
- }
-
- // determine relative path
- {
- CString oUpPath;
- CString oDownPath;
- CString oBuf1, oBuf2;
-
- // make paths to same depth
- while (CountBackSlashes(oFromPath)>CountBackSlashes(oToPath))
- {
- oUpPath+="..\\";
- if (!RemoveOneDirFromEnd(oFromPath, oBuf1))
- {
- return false;
- }
- }
- while (CountBackSlashes(oToPath)>CountBackSlashes(oFromPath))
- {
- if (!RemoveOneDirFromEnd(oToPath, oBuf2))
- {
- return false;
- }
-
- oDownPath=oBuf2+oDownPath;
- }
-
- // keep track how deep we must go back to find
- // the directory from which we can go towards
- // the target directory
- while (oFromPath!=oToPath)
- {
- oUpPath+="..\\";
-
- if (!RemoveOneDirFromEnd(oFromPath, oBuf1))
- {
- return false;
- }
- if (!RemoveOneDirFromEnd(oToPath, oBuf2))
- {
- return false;
- }
-
- oDownPath=oBuf2+oDownPath;
- }
-
- CString oToFileName;
- if (!ExtractFileName(oTo, oToFileName))
- {
- return false;
- }
-
- oRelativePath=oUpPath+oDownPath+oToFileName;
- }
-
- return true;
-}
-
-bool CFilePathCalc::ApplyRelativePath(
- const CString &oRelativePath, CString &oAbsolutePath)
-{
- CString oRelativePathCpy(oRelativePath);
- if (oRelativePathCpy.Find(':')==1)
- {
- // relative path contains a drive specificiation
-
- oAbsolutePath=oRelativePath;
-
- return true;
- }
-
- // delete ".\"s
- {
- while (oRelativePathCpy.Find(".\\")==0)
- {
- oRelativePathCpy.Delete(0, 2);
- }
- }
-
- if (oRelativePathCpy.Find('\\')==0)
- {
- // relative path begins with a back slash
-
- CString oDrive;
- if (!ExtractDrive(oAbsolutePath, oDrive))
- {
- return false;
- }
-
- oAbsolutePath=oDrive+oRelativePathCpy;
-
- return true;
- }
-
- CString oBuf1;
- while (oRelativePathCpy.Find("..\\")!=-1)
- {
- // delete first three characters
- oRelativePathCpy.Delete(0, 3);
-
- if (!RemoveOneDirFromEnd(oAbsolutePath, oBuf1))
- {
- return false;
- }
- }
-
- oAbsolutePath+=oRelativePathCpy;
-
- return true;
-}
-
-
-bool CFilePathCalc::MakePath(CString &oStr, bool bAssumeDirectory)
-{
- long lCharPos, lCharPos2;
-
- if ((lCharPos=oStr.Find(':'))!=-1)
- {
- // there is a colon in the string
-
- if (oStr.Find(':', lCharPos+1)!=-1)
- {
- // error case: more than one colon in the string
- return false;
- }
-
- if (oStr.GetAt(lCharPos+1)!='\\')
- {
- // the colon is not followed by a back slash
- if (oStr.GetLength()>lCharPos+2)
- {
- // error case
- // something like "c:windows" was passed on
- return false;
- }
- else
- {
- // something like "c:" was passed on
- oStr+="\\";
- return true;
- }
- }
- else
- {
- // the colon is followed by a back slash
-
- if ((lCharPos=oStr.ReverseFind('.'))!=-1)
- {
- // the path description contains at least one dot
-
- if ((lCharPos2=oStr.ReverseFind('\\'))!=-1)
- {
- if (lCharPos2>lCharPos || bAssumeDirectory)
- {
- // there is a back slash behind the last
- // dot or we shall assume there is one
-
- if (oStr.GetAt(oStr.GetLength()-1)!='\\')
- {
- // last character is not yet a backslash but
- // it must become one
-
- // append a back slash
- oStr+='\\';
-
- return true;
- }
-
- // path name is ok
- return true;
- }
- else
- {
- // there is no back slash behind the last
- // dot -> the path contains a file name;
-
- // remove the file name;
- // terminate behind last back slash
- oStr.GetBuffer(0);
- oStr.SetAt(lCharPos2+1, '\0');
- oStr.ReleaseBuffer();
- return true;
- }
- }
- else
- {
- // error case: no backslash in path name
- return false;
- }
- }
- else
- {
- // the path description does not contain a dot
-
- if (oStr.GetAt(oStr.GetLength()-1)!='\\')
- {
- // last character is not a back slash
-
- // append a back slash
- oStr+='\\';
- return true;
- }
- else
- {
- // last character is a back slash
- return true;
- }
- }
- }
- }
- else
- {
- // error case: no colon in string
- return false;
- }
-}
-
-bool CFilePathCalc::ExtractFileName(const CString &oPath, CString &oFileName)
-{
- if (&oPath!=&oFileName)
- {
- oFileName=oPath;
- }
-
- long lBackSlashPos=oFileName.ReverseFind('\\');
- if (lBackSlashPos==-1)
- {
- // the path did not contain a back slash
-
- if (oFileName.Find(':')!=-1)
- {
- // the path contains a drive letter
-
- // delete first two characters
- oFileName.Delete(0, 2);
-
- return true;
- }
- else
- {
- // the path did not contain a colon
-
- return true;
- }
- }
- else
- {
- // the path contains at least one backslash
-
- // delete all characters up to the last back slash
- oFileName.Delete(0, lBackSlashPos+1);
-
- return true;
- }
-}
-
-bool CFilePathCalc::ExtractDrive(const CString &oPath, CString &oDrive)
-{
- if (&oPath!=&oDrive)
- {
- oDrive=oPath;
- }
-
- if (oDrive.Find(':')==-1)
- {
- return false;
- }
-
- oDrive.GetBuffer(0);
- oDrive.SetAt(2, '\0');
- oDrive.ReleaseBuffer();
-
- return true;
-}
-
-bool CFilePathCalc::SplitFileAndExtension(const CString &oFileName, CString &oSimpleFileName, CString &oExtension)
-{
- int iLastBackslashPos=oFileName.ReverseFind('\\');
- int iLastDotPos=oFileName.ReverseFind('.');
- int iStringLength=oFileName.GetLength();
-
- oSimpleFileName=oFileName;
- if (iLastBackslashPos>=0 && iLastDotPos>=0 && iLastBackslashPos>iLastDotPos)
- {
- // the last dot is BEFORE the last backslash
- oExtension.Empty();
- return true;
- }
-
- if (iLastDotPos==-1)
- {
- // there is no dot
- oExtension.Empty();
- return true;
- }
- else
- {
- // there is a dot
- oSimpleFileName=oFileName;
- oExtension=oSimpleFileName.Mid(iLastDotPos+1, iStringLength-iLastDotPos-1);
- oSimpleFileName.Delete(iLastDotPos, iStringLength-iLastDotPos);
- return true;
- }
-
- return false;
-}
-
-bool CFilePathCalc::IsValidFileMask(const CString &oFileMask, bool bAcceptDirectories)
-{
- CString oFileName;
- if (!ExtractFileName(oFileMask, oFileName)) return false;
- if (!bAcceptDirectories && oFileName!=oFileMask) return false; // contains a directory?
-
- if (oFileName.IsEmpty()) return false; // "too short"
-
- // make sure there's at least one joker
- CString oFileNameTemp(oFileName);
- FilterString(oFileNameTemp, "*?");
- if (oFileNameTemp.IsEmpty()) return false;
-
- CString oTemp(oFileName);
- FilterStringInverse(oTemp, "/\\:\"<>|"); // these two are invalid for files but not for filters: ?*
- if (oFileName!=oTemp) return false; // file path contained invalid characters
-
- // make sure no characters are between an asterisk and the next period
- int iCurPos=oFileName.Find('*');
- while (iCurPos>=0 && iCurPos<oFileName.GetLength()-1)
- {
- if (oFileName[iCurPos+1]!='.') return false;
- iCurPos=oFileName.Find('*', iCurPos+1);
- }
-
- // make sure the file doesn't end with a period
- if (oFileName[oFileName.GetLength()-1]=='.') return false;
-
- // make sure the extension doesn't contain spaces
- {
- CString oFileNameRaw;
- CString oExtension;
- if (!SplitFileAndExtension(oFileName, oFileNameRaw, oExtension)) return false;
- FilterString(oExtension, " ");
- if (!oExtension.IsEmpty()) return false; // extension contains spaces
- }
-
- // passed all tests
- return true;
-}
-
-bool CFilePathCalc::RemoveOneDirFromEnd(CString &oPath, CString &oRemoved)
-{
- oRemoved=oPath;
-
- // delete last back slash
- oPath.GetBuffer(0);
- oPath.SetAt(oPath.ReverseFind('\\'), '\0');
- oPath.ReleaseBuffer();
-
- long lLastBackSlashPos=
- oPath.ReverseFind('\\');
- if (lLastBackSlashPos==-1)
- {
- // error: no further back slash
- return false;
- }
-
- // truncate behind last back slash
- oPath.GetBuffer(0);
- oPath.SetAt(lLastBackSlashPos+1, '\0');
- oPath.ReleaseBuffer();
-
- oRemoved.Delete(0, lLastBackSlashPos+1);
-
- return true;
-}
-
-long CFilePathCalc::CountBackSlashes(const CString &oPath)
-{
- long lCount=0;
- long lCurPos=0;
- CString oDummy(oPath);
- while ((lCurPos=oDummy.Find('\\', lCurPos+1))!=-1)
- {
- lCount++;
- }
-
- return lCount;
-}
-
-void CFilePathCalc::FilterString(CString &oString, const CString &oAcceptedChars)
-{
- long lCurPos=0;
- while (lCurPos<oString.GetLength())
- {
- if (oAcceptedChars.Find(oString.GetAt(lCurPos))!=-1)
- {
- // character is ok
- lCurPos++;
- }
- else
- {
- // character is not ok
- oString.Delete(lCurPos);
- }
- }
-}
-
-void CFilePathCalc::FilterStringInverse(CString &oString, const CString &oCharsToRemove)
-{
- long lCurPos=0;
- while (lCurPos<oString.GetLength())
- {
- if (oCharsToRemove.Find(oString.GetAt(lCurPos))==-1)
- {
- // character is ok
- lCurPos++;
- }
- else
- {
- // character is not ok
- oString.Delete(lCurPos);
- }
- }
-}
\ No newline at end of file
--- a/wingui/FilePathCalc.h
+++ /dev/null
@@ -1,138 +1,0 @@
-// FilePathCalc.h: interface for the CFilePathCalc class.
-// this class is used to provide access to certain procedures
-// for handling file paths
-// Author: Torsten Landmann
-//
-//////////////////////////////////////////////////////////////////////
-
-#if !defined(AFX_FILEPATHCALC_H__B9F42A01_49AE_11D3_A724_50DB50C10057__INCLUDED_)
-#define AFX_FILEPATHCALC_H__B9F42A01_49AE_11D3_A724_50DB50C10057__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-class CFilePathCalc
-{
-public:
- CFilePathCalc();
- virtual ~CFilePathCalc();
-
- // oFrom may be a path or a file name
- // oTo should be a file name
- // examples:
- // 1.: oFrom: "c:\windows\system"
- // oTo: "c:\windows\media"
- // -> "..\media"
- //
- // 2.: oFrom: "c:\windows\system\test.txt"
- // oTo: "a:\test.txt"
- // -> "a:\test.txt"
- //
- // 3.: oFrom: "c:\windows\system.txt"
- // oTo: "c:\windows\system.txt"
- // -> "system.txt"
- //
- // 4.: oFrom: "c:\windows\system.txt\"
- // oTo: "c:\windows\system.txt"
- // -> "..\system.txt"
- static bool GetRelativePosition(const CString &oFrom, const CString &oTo, CString &oRelativePath);
-
- // oAbsolute path must be finished by a back slash
- // 1.: oAbsolutePath: "c:\windows\"
- // oRelativePath: "..\windos"
- // -> "c:\windos"
- //
- // 2.: oAbsolutePath: "c:\windows\new\"
- // oRelativePath: "..\windos\blah.txt"
- // -> "c:\windows\windos\blah.txt"
- //
- static bool ApplyRelativePath(const CString &oRelativePath, CString &oAbsolutePath);
-
- // "c:\windows\blah.txt" -> "c:\windows\"
- // "c:\windows" -> "c:\windows\"
- // "c:" -> "c:\"
- // "c:windows" -> error
- // "windows" -> error
- // "windows\blah.txt" -> error
- // "c:\windows\blah.txt\" -> "c:\windows\blah.txt\" // in this case blah.txt should be a directory
- // return value: success
- // make sure you NOTE: the string MUST contain a
- // drive specification
- // if bAssumeDirectory==true then the following happens:
- // "c:\windows\blah.txt" -> "c:\windows\blah.txt\"
- static bool MakePath(CString &oStr, bool bAssumeDirectory=false);
-
- // extracts the file name from a path
- // "c:\windows\blah.txt" -> "blah.txt"
- // "c:\windows\blah.txt\" -> error
- // "c:blah.txt" -> "blah.txt"
- // "blah.txt" -> "blah.txt"
- // source and target string parameter may reference the
- // same object
- static bool ExtractFileName(const CString &oPath, CString &oFileName);
-
- // "c:\windows\blah.txt" -> "c:"
- // "\windows\blah.txt" -> error
- // source and target string parameter may reference the
- // same object
- static bool ExtractDrive(const CString &oPath, CString &oDrive);
-
- // "blah.txt" -> "blah", "txt"
- // "blah" -> "blah", ""
- // "blah." -> "blah", ""
- // "somewhere\blah.txt" -> "somewhere\blah", "txt"
- // source and target string parameter may reference the
- // same object; the target objects may be the same object
- // (however behaviour is undefined in this case)
- static bool SplitFileAndExtension(const CString &oFilePath, CString &oSimpleFileName, CString &oExtension);
-
- // bAcceptDirectories==false
- // "" -> false
- // "*.txt" -> true
- // "*.something" -> true
- // "*" -> true
- // "*.*" -> true
- // "*.*.*" -> true
- // "*..txt" -> false
- // "?something.txt" -> true
- // "s?omething.*" -> true
- // "something.t xt" -> false
- // "something.txt" -> false (!)
- // "\*.*" -> false
- // "c:\temp\*.*" -> false
- // bAcceptDirectories==true
- // "" -> false
- // "*.txt" -> true
- // "*.something" -> true
- // "*" -> true
- // "*.*" -> true
- // "*.*.*" -> true
- // "*..txt" -> false
- // "?something.txt" -> true
- // "s?omething.*" -> true
- // "something.t xt" -> false
- // "something.txt" -> false (!)
- // "\*.*" -> true
- // "c:\temp\*.*" -> true
- static bool IsValidFileMask(const CString &oFileMask, bool bAcceptDirectories=false);
-
-private:
- // oPath must be a directory description finished with
- // a back slash;
- // "c:\windows\system\" -> "c:\windows\"
- // "c:\" -> error
- static bool RemoveOneDirFromEnd(CString &oPath, CString &oRemoved);
-
- // counts the number of back slashs in the string
- // and thus determines the depth of the path
- static long CountBackSlashes(const CString &oPath);
-
- // deletes all unaccepted chars from the string
- static void FilterString(CString &oString, const CString &oAcceptedChars);
-
- // deletes all specified chars from the string
- static void FilterStringInverse(CString &oString, const CString &oCharsToRemove);
-};
-
-#endif // !defined(AFX_FILEPATHCALC_H__B9F42A01_49AE_11D3_A724_50DB50C10057__INCLUDED_)
--- a/wingui/FileSerializable.cpp
+++ /dev/null
@@ -1,40 +1,0 @@
-// FileSerializable.cpp: implementation of the CFileSerializable class.
-//
-//////////////////////////////////////////////////////////////////////
-
-#include "stdafx.h"
-#include "faac_wingui.h"
-#include "FileSerializable.h"
-
-#ifdef _DEBUG
-#undef THIS_FILE
-static char THIS_FILE[]=__FILE__;
-#define new DEBUG_NEW
-#endif
-
-//////////////////////////////////////////////////////////////////////
-// Construction/Destruction
-//////////////////////////////////////////////////////////////////////
-
-CFileSerializable::CFileSerializable()
-{
-
-}
-
-CFileSerializable::~CFileSerializable()
-{
-
-}
-
-void CFileSerializable::SerializeBool(CArchive &oArchive, bool bBool)
-{
- int iBool=bBool ? 1 : 0;
- oArchive << iBool;
-}
-
-void CFileSerializable::DeSerializeBool(CArchive &oArchive, bool &bBool)
-{
- int iBool;
- oArchive >> iBool;
- bBool=iBool!=0;
-}
\ No newline at end of file
--- a/wingui/FileSerializable.h
+++ /dev/null
@@ -1,30 +1,0 @@
-// FileSerializable.h: interface for the CFileSerializable class.
-// Author: Torsten Landmann
-//
-// An interface for classes that can be serialized to or deserialized
-// from a file stream.
-// Also contains some utility methods for CArchive interaction.
-//
-//////////////////////////////////////////////////////////////////////
-
-#if !defined(AFX_FILESERIALIZABLE_H__5FC5E381_1729_11D5_8402_0080C88C25BD__INCLUDED_)
-#define AFX_FILESERIALIZABLE_H__5FC5E381_1729_11D5_8402_0080C88C25BD__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-class CFileSerializable
-{
-public:
- CFileSerializable();
- virtual ~CFileSerializable();
-
- virtual bool PutToArchive(CArchive &oArchive) const=0;
- virtual bool GetFromArchive(CArchive &oArchive)=0;
-
- static void SerializeBool(CArchive &oArchive, bool bBool);
- static void DeSerializeBool(CArchive &oArchive, bool &bBool);
-};
-
-#endif // !defined(AFX_FILESERIALIZABLE_H__5FC5E381_1729_11D5_8402_0080C88C25BD__INCLUDED_)
--- a/wingui/FileSerializableJobList.cpp
+++ /dev/null
@@ -1,130 +1,0 @@
-// FileSerializableJobList.cpp: implementation of the CFileSerializableJobList class.
-//
-//////////////////////////////////////////////////////////////////////
-
-#include "stdafx.h"
-#include "faac_wingui.h"
-#include "FileSerializableJobList.h"
-
-#ifdef _DEBUG
-#undef THIS_FILE
-static char THIS_FILE[]=__FILE__;
-#define new DEBUG_NEW
-#endif
-
-CFileSerializableJobListElem::CFileSerializableJobListElem()
-{
-}
-
-CFileSerializableJobListElem::~CFileSerializableJobListElem()
-{
-}
-
-bool CFileSerializableJobListElem::PutToArchive(CArchive &oArchive, long lSaveParams) const
-{
- switch (lSaveParams)
- {
- case 1:
- {
- return m_oJob.PutToArchive(oArchive);
- }
- default:
- {
- // unknown file format version
- return false;
- }
- }
-}
-
-bool CFileSerializableJobListElem::GetFromArchive(CArchive &oArchive, long lLoadParams)
-{
- switch (lLoadParams)
- {
- case 1:
- {
- return m_oJob.GetFromArchive(oArchive);
- }
- default:
- {
- // unknown file format version
- return false;
- }
- }
-}
-
-//////////////////////////////////////////////////////////////////////
-// Construction/Destruction
-//////////////////////////////////////////////////////////////////////
-
-CFileSerializableJobList::CFileSerializableJobList()
-{
-}
-
-CFileSerializableJobList::CFileSerializableJobList(CJobList &oJobList)
-{
- GetFromRegularJobList(oJobList);
-}
-
-CFileSerializableJobList::~CFileSerializableJobList()
-{
-
-}
-
-CFileSerializableJobList::operator CJobList()
-{
- CJobList oRegularJobList;
- CopyToRegularJobList(oRegularJobList);
- return oRegularJobList;
-}
-
-long CFileSerializableJobList::AddJob(const CJob &oJob, long lDesiredIndex)
-{
- CFileSerializableJobListElem *poNewElem=(CFileSerializableJobListElem*)Add(lDesiredIndex);
- poNewElem->m_oJob=oJob;
- return poNewElem->GetIndex();
-}
-
-CJob* CFileSerializableJobList::GetJob(long lIndex)
-{
- CFileSerializableJobListElem *poElem=(CFileSerializableJobListElem*)GetElem(lIndex);
- if (poElem==0) return 0;
- return &poElem->m_oJob;
-}
-
-CJob* CFileSerializableJobList::GetNextJob(CBListReader &oReader, long *plIndex)
-{
- CFileSerializableJobListElem *poElem=(CFileSerializableJobListElem*)ReadElem(oReader);
- if (poElem==0) return 0;
- return &poElem->m_oJob;
-}
-
-PBBaseElem CFileSerializableJobList::CreateElem()
-{
- return new CFileSerializableJobListElem;
-}
-
-void CFileSerializableJobList::GetFromRegularJobList(CJobList &oJobList)
-{
- DeleteAll();
-
- CBListReader oReader(oJobList);
- CJob *poCurJob;
- long lCurJobIndex;
- while ((poCurJob=oJobList.GetNextJob(oReader, &lCurJobIndex))!=0)
- {
- AddJob(*poCurJob, lCurJobIndex);
- }
-}
-
-void CFileSerializableJobList::CopyToRegularJobList(CJobList &oJobList)
-{
- oJobList.DeleteAll();
-
- CBListReader oReader(*this);
- CJob *poCurJob;
- long lCurJobIndex;
- while ((poCurJob=GetNextJob(oReader, &lCurJobIndex))!=0)
- {
- oJobList.AddJob(*poCurJob, lCurJobIndex);
- }
-}
\ No newline at end of file
--- a/wingui/FileSerializableJobList.h
+++ /dev/null
@@ -1,67 +1,0 @@
-// FileSerializableJobList.h: interface for the CFileSerializableJobList class.
-// Author: Torsten Landmann
-//
-// This class was necessary to be able to reuse certain existing code for
-// loading/saving lists. It can be used as a substitute to CJobList in most
-// cases. Sometimes explicit casting may be necessary in one or the other
-// direction.
-// Instances of CFileSerializableJobList have the advantage that they are
-// serializable via CBList members such as
-// SaveToFile() or LoadFromFile().
-// Instances of CFileSerializableJobList have the disadvantage that they aren't
-// instances of TItemList<CJob> so they don't provide quite some functionality.
-//
-//////////////////////////////////////////////////////////////////////
-
-#if !defined(AFX_FILESERIALIZABLEJOBLIST_H__5FC5E383_1729_11D5_8402_0080C88C25BD__INCLUDED_)
-#define AFX_FILESERIALIZABLEJOBLIST_H__5FC5E383_1729_11D5_8402_0080C88C25BD__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-#include "listobj.h"
-
-class CFileSerializableJobListElem : public CBBaseElem
-{
- friend class CFileSerializableJobList;
-
-protected:
- CFileSerializableJobListElem(); // only allowed for derivations and for CBList (=friend)
- virtual ~CFileSerializableJobListElem();
-
- // override these members if you want to put your list
- // to a stream or retreive it from there;
- // do never forget to call these ones if you override them
- virtual bool PutToArchive(CArchive &oArchive, long lSaveParams) const;
- virtual bool GetFromArchive(CArchive &oArchive, long lLoadParams);
-private:
- CJob m_oJob;
-};
-
-class CFileSerializableJobList : public CBList
-{
-public:
- CFileSerializableJobList();
- CFileSerializableJobList(CJobList &oJobList);
- virtual ~CFileSerializableJobList();
-
- operator CJobList();
-
- long AddJob(const CJob &oJob, long lDesiredIndex=-1);
- CJob* GetJob(long lIndex);
- CJob* GetNextJob(CBListReader &oReader, long *plIndex=0);
-
-private:
- // -- overridden from CBList
- // the following method must be overriden by every
- // subclass returning an element of the type of the particular
- // subclass of PBBaseElem
- virtual PBBaseElem CreateElem();
-
- void GetFromRegularJobList(CJobList &oJobList);
- void CopyToRegularJobList(CJobList &oJobList);
-};
-
-
-#endif // !defined(AFX_FILESERIALIZABLEJOBLIST_H__5FC5E383_1729_11D5_8402_0080C88C25BD__INCLUDED_)
--- a/wingui/FloatingPropertyDialog.cpp
+++ /dev/null
@@ -1,128 +1,0 @@
-// FloatingPropertyDialog.cpp : implementation file
-// Author: Torsten Landmann
-//
-///////////////////////////////////////////////////////////
-
-#include "stdafx.h"
-#include "faac_wingui.h"
-#include "FloatingPropertyDialog.h"
-#include "Faac_winguiDlg.h"
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-CFloatingPropertyDialog *CFloatingPropertyDialog::m_poFloatingPropertyDialogSingleton=0;
-
-/////////////////////////////////////////////////////////////////////////////
-// CFloatingPropertyDialog dialog
-
-
-CFloatingPropertyDialog::CFloatingPropertyDialog(CWnd* pParent /*=NULL*/):
- m_poPropertiesDummyDialog(0)
-{
- //{{AFX_DATA_INIT(CFloatingPropertyDialog)
- // NOTE: the ClassWizard will add member initialization here
- //}}AFX_DATA_INIT
-
- Create(CFloatingPropertyDialog::IDD, pParent);
-}
-
-CFloatingPropertyDialog::~CFloatingPropertyDialog()
-{
- if (m_poPropertiesDummyDialog!=0)
- {
- delete m_poPropertiesDummyDialog;
- m_poPropertiesDummyDialog=0;
-
- ((CFaac_winguiApp*)AfxGetApp())->SetGlobalPropertiesDummyParentDialogSingleton(0);
- }
-}
-
-void CFloatingPropertyDialog::DoDataExchange(CDataExchange* pDX)
-{
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CFloatingPropertyDialog)
- DDX_Control(pDX, IDC_LABELDEBUGTAG, m_ctrlLabelDebugTag);
- //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(CFloatingPropertyDialog, CDialog)
- //{{AFX_MSG_MAP(CFloatingPropertyDialog)
- ON_WM_SIZE()
- ON_WM_CLOSE()
- //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// CFloatingPropertyDialog message handlers
-
-void CFloatingPropertyDialog::CreateFloatingPropertiesDummyParentDialog()
-{
- if (m_poFloatingPropertyDialogSingleton==0)
- {
- // memory leak reported here is ok (leak is created immediately before
- // application exit)
- m_poFloatingPropertyDialogSingleton=new CFloatingPropertyDialog;
- }
-}
-
-void CFloatingPropertyDialog::InvalidateFloatingPropertiesDialog()
-{
- if (m_poFloatingPropertyDialogSingleton!=0)
- {
- delete m_poFloatingPropertyDialogSingleton;
- m_poFloatingPropertyDialogSingleton=0;
- }
-}
-
-void CFloatingPropertyDialog::OnSize(UINT nType, int cx, int cy)
-{
- CDialog::OnSize(nType, cx, cy);
-
- m_oCurrentSize=CRect(0, 0, cx, cy);
- ApplyNewSize(m_oCurrentSize);
-}
-
-BOOL CFloatingPropertyDialog::OnInitDialog()
-{
- CDialog::OnInitDialog();
-
- // TODO: Add extra initialization here
- ShowWindow(SW_SHOW);
- m_poPropertiesDummyDialog=new CPropertiesDummyParentDialog(true, this);
- ((CFaac_winguiApp*)AfxGetApp())->SetGlobalPropertiesDummyParentDialogSingleton(m_poPropertiesDummyDialog, this);
- ApplyNewSize(m_oCurrentSize);
- m_poPropertiesDummyDialog->ShowWindow(SW_SHOW);
-
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
-}
-
-void CFloatingPropertyDialog::ApplyNewSize(const CRect &oSize)
-{
- if (m_poPropertiesDummyDialog!=0)
- {
- // dialog has been initialized
-
- m_poPropertiesDummyDialog->MoveWindow(oSize);
-
- CRect oLabelRect;
- m_ctrlLabelDebugTag.GetWindowRect(&oLabelRect);
- CRect oDebugLabelRect(oSize.BottomRight(), oLabelRect.Size());
- oDebugLabelRect.OffsetRect(-oLabelRect.Size().cx, -oLabelRect.Size().cy);
- m_ctrlLabelDebugTag.MoveWindow(oDebugLabelRect);
- }
-}
-
-void CFloatingPropertyDialog::OnClose()
-{
- // TODO: Add your message handler code here and/or call default
-
- ((CFaac_winguiDlg*)AfxGetMainWnd())->HidePropertiesWindow(this);
-
- // CDialog::OnClose();
-}
--- a/wingui/FloatingPropertyDialog.h
+++ /dev/null
@@ -1,77 +1,0 @@
-// Author: Torsten Landmann
-//
-// This class represents the floating property dialog used
-// to configure the jobs
-//
-////////////////////////////////////////////////////////
-
-#if !defined(AFX_FLOATINGPROPERTYDIALOG_H__442115C9_0FD4_11D5_8402_0080C88C25BD__INCLUDED_)
-#define AFX_FLOATINGPROPERTYDIALOG_H__442115C9_0FD4_11D5_8402_0080C88C25BD__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-// FloatingPropertyDialog.h : header file
-//
-
-/////////////////////////////////////////////////////////////////////////////
-// CFloatingPropertyDialog dialog
-
-class CFloatingPropertyDialog : public CDialog
-{
-// Construction
-public:
- CFloatingPropertyDialog(CWnd* pParent = NULL); // standard constructor
- virtual ~CFloatingPropertyDialog();
-
-// Dialog Data
- //{{AFX_DATA(CFloatingPropertyDialog)
- enum { IDD = IDD_FLOATINGPROPERTYDIALOG };
- CStatic m_ctrlLabelDebugTag;
- //}}AFX_DATA
-
-
-// Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CFloatingPropertyDialog)
- protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- //}}AFX_VIRTUAL
-
-public:
- // this member creates a singelton dummy dialog that's embedded
- // in any floating window; the creation of this floating window
- // is task of this method;
- // note that this member works somewhat asynchrounous; on creation
- // of the CPropertiesDummyParentDialog window it calls the
- static void CreateFloatingPropertiesDummyParentDialog();
-
- // this member properly cleans up any floating property window, if there's
- // any
- static void InvalidateFloatingPropertiesDialog();
-
-// Implementation
-protected:
-
- // Generated message map functions
- //{{AFX_MSG(CFloatingPropertyDialog)
- afx_msg void OnSize(UINT nType, int cx, int cy);
- virtual BOOL OnInitDialog();
- afx_msg void OnClose();
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-
-private:
- static CFloatingPropertyDialog *m_poFloatingPropertyDialogSingleton;
-
- CPropertiesDummyParentDialog *m_poPropertiesDummyDialog;
-
- CRect m_oCurrentSize;
-
- void ApplyNewSize(const CRect &oSize);
-};
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_FLOATINGPROPERTYDIALOG_H__442115C9_0FD4_11D5_8402_0080C88C25BD__INCLUDED_)
--- a/wingui/FolderDialog.cpp
+++ /dev/null
@@ -1,115 +1,0 @@
-// FolderDialog.cpp: implementation of the CFolderDialog class.
-// Author: Torsten Landmann
-//
-//////////////////////////////////////////////////////////////////////
-
-#include "stdafx.h"
-#include "FolderDialog.h"
-
-#ifdef _DEBUG
-#undef THIS_FILE
-static char THIS_FILE[]=__FILE__;
-#define new DEBUG_NEW
-#endif
-
-//////////////////////////////////////////////////////////////////////
-// Construction/Destruction
-//////////////////////////////////////////////////////////////////////
-
-CFolderDialog::CFolderDialog(CWnd *poParent, const CString &oDlgCaption, unsigned int iFlags):
- m_oDlgCaption(oDlgCaption)
-{
- m_sctBrowseParams.hwndOwner=*poParent;
- m_sctBrowseParams.pidlRoot=NULL; // no special root directory (this entry is NOT the directory that is shown first)
- m_sctBrowseParams.pszDisplayName=0;
- m_sctBrowseParams.lpszTitle=0;
- m_sctBrowseParams.ulFlags=iFlags;
- m_sctBrowseParams.lpfn=NULL; // no callback
- m_sctBrowseParams.lParam=0;
-}
-
-CFolderDialog::~CFolderDialog()
-{
-
-}
-
-int CFolderDialog::DoModal()
-{
- m_sctBrowseParams.pszDisplayName=m_oFolderName.GetBuffer(_MAX_PATH);
- m_sctBrowseParams.lpszTitle=m_oDlgCaption; // better do that here
-
- LPITEMIDLIST lpSelectedItems;
- if ((lpSelectedItems=SHBrowseForFolder(&m_sctBrowseParams))!=NULL)
- {
- // OK pressed
- m_oFolderName.ReleaseBuffer();
- // unfortunately m_oFolderName only contains the name of the
- // directory selected and not its complete path; thus we have
- // some work left to do...
-
- // complicated but more flexible version of finding out the path;
- /*// find out the complete selected path; for this we'll need
- // the desktop interface (SHBrowseForFolder() returns the directory
- // position relatively to the desktop folder)
- IShellFolder *pifcFile;
- SHGetDesktopFolder(&pifcFile);
-
- // now ask the desktop interface for the relative position of the
- // folder returned
- // -- this parameter makes this version more flexible-+
- STRRET sctRet; // |
- // V
- pifcFile->GetDisplayNameOf(lpSelectedItems, SHGDN_NORMAL, &sctRet);
-
-
- // fetch the path that the user has selected
- switch (sctRet.uType)
- {
- case STRRET_CSTR:
- {
- m_oFolderPath=sctRet.cStr;
- break;
- }
- case STRRET_WSTR:
- {
- m_oFolderPath=sctRet.pOleStr;
- break;
- }
- default:
- case STRRET_OFFSET:
- {
- ASSERT(false);
- // unkown or unhandleble return type
- AfxMessageBox(IDS_InvalidReturnType);
-
- break;
- }
- }*/
-
- // conventional way of finding out the complete folder path
- BOOL bSuccess=SHGetPathFromIDList(lpSelectedItems, m_oFolderPath.GetBuffer(_MAX_PATH));
- m_oFolderPath.ReleaseBuffer();
-
- // free buffer that was returned by SHBrowseForFolder()
- IMalloc *pifcMalloc;
- SHGetMalloc(&pifcMalloc);
- pifcMalloc->Free(lpSelectedItems);
-
- if (!bSuccess)
- {
- // error finding out the complete path
- m_bError=true;
- return IDCANCEL;
- }
-
- return IDOK;
- }
- else
- {
- // cancel pressed
- m_oFolderName.ReleaseBuffer();
-
- m_bError=false;
- return IDCANCEL;
- }
-}
\ No newline at end of file
--- a/wingui/FolderDialog.h
+++ /dev/null
@@ -1,38 +1,0 @@
-// FolderDialog.h: interface for the CFolderDialog class.
-// Author: Torsten Landmann
-//
-//////////////////////////////////////////////////////////////////////
-
-#if !defined(AFX_FOLDERDIALOG_H__57C79485_9C5F_11D3_A724_007250C10000__INCLUDED_)
-#define AFX_FOLDERDIALOG_H__57C79485_9C5F_11D3_A724_007250C10000__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-class CFolderDialog
-{
-public:
- // for a flag description see BROWSEINFO in the MSDN
- CFolderDialog(CWnd *poParent, const CString &oDlgCaption, unsigned int iFlags=0);
- virtual ~CFolderDialog();
-
- // write to this member if you want to modify the parameters
- // provided at construction before calling DoModal()
- BROWSEINFO m_sctBrowseParams;
-
- // read these members after DoModal() return with IDOK
- CString m_oFolderName;
- CString m_oFolderPath;
-
- // read this member after DoModal() return with IDCANCEL
- bool m_bError;
-
- // call this member to show the dialog
- int DoModal();
-
-private:
- CString m_oDlgCaption;
-};
-
-#endif // !defined(AFX_FOLDERDIALOG_H__57C79485_9C5F_11D3_A724_007250C10000__INCLUDED_)
--- a/wingui/Id3TagInfo.cpp
+++ /dev/null
@@ -1,107 +1,0 @@
-// Id3TagInfo.cpp: implementation of the CId3TagInfo class.
-// Author: Torsten Landmann
-//
-//////////////////////////////////////////////////////////////////////
-
-#include "stdafx.h"
-#include "faac_wingui.h"
-#include "Id3TagInfo.h"
-
-#ifdef _DEBUG
-#undef THIS_FILE
-static char THIS_FILE[]=__FILE__;
-#define new DEBUG_NEW
-#endif
-
-//////////////////////////////////////////////////////////////////////
-// Construction/Destruction
-//////////////////////////////////////////////////////////////////////
-
-CId3TagInfo::CId3TagInfo():
- m_lTrackNo(-1),
- m_lYear(-1)
-{
-}
-
-CId3TagInfo::CId3TagInfo(const CId3TagInfo &oSource)
-{
- *this=oSource;
-}
-
-CId3TagInfo::~CId3TagInfo()
-{
-}
-
-
-CId3TagInfo& CId3TagInfo::operator=(const CId3TagInfo &oRight)
-{
- m_oArtist=oRight.m_oArtist;
- m_lTrackNo=oRight.m_lTrackNo;
- m_oAlbum=oRight.m_oAlbum;
- m_lYear=oRight.m_lYear;
- m_oSongTitle=oRight.m_oSongTitle;
- m_bCopyright=oRight.m_bCopyright;
- m_oOriginalArtist=oRight.m_oOriginalArtist;
- m_oComposer=oRight.m_oComposer;
- m_oUrl=oRight.m_oUrl;
- m_oGenre=oRight.m_oGenre;
- m_oEncodedBy=oRight.m_oEncodedBy;
- m_oComment=oRight.m_oComment;
-
- return *this;
-}
-
-bool CId3TagInfo::PutToArchive(CArchive &oArchive) const
-{
- // put a class version flag
- int iVersion=1;
- oArchive << iVersion;
-
- oArchive << m_oArtist;
- oArchive << m_lTrackNo;
- oArchive << m_oAlbum;
- oArchive << m_lYear;
- oArchive << m_oSongTitle;
- CFileSerializable::SerializeBool(oArchive, m_bCopyright);
- oArchive << m_oOriginalArtist;
- oArchive << m_oComposer;
- oArchive << m_oUrl;
- oArchive << m_oGenre;
- oArchive << m_oEncodedBy;
- oArchive << m_oComment;
-
- return true;
-}
-
-bool CId3TagInfo::GetFromArchive(CArchive &oArchive)
-{
- // fetch the class version flag
- int iVersion;
- oArchive >> iVersion;
-
- switch (iVersion)
- {
- case 1:
- {
- oArchive >> m_oArtist;
- oArchive >> m_lTrackNo;
- oArchive >> m_oAlbum;
- oArchive >> m_lYear;
- oArchive >> m_oSongTitle;
- CFileSerializable::DeSerializeBool(oArchive, m_bCopyright);
- oArchive >> m_oOriginalArtist;
- oArchive >> m_oComposer;
- oArchive >> m_oUrl;
- oArchive >> m_oGenre;
- oArchive >> m_oEncodedBy;
- oArchive >> m_oComment;
-
- return true;
- }
- default:
- {
- // unknown file format version
- return false;
- }
- }
-}
\ No newline at end of file
--- a/wingui/Id3TagInfo.h
+++ /dev/null
@@ -1,85 +1,0 @@
-// Id3TagInfo.h: interface for the CId3TagInfo class.
-// Author: Torsten Landmann
-//
-//////////////////////////////////////////////////////////////////////
-
-#if !defined(AFX_ID3TAGINFO_H__DFE38E72_0E81_11D5_8402_0080C88C25BD__INCLUDED_)
-#define AFX_ID3TAGINFO_H__DFE38E72_0E81_11D5_8402_0080C88C25BD__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-#include "FileSerializable.h"
-
-class CId3TagInfo : public CFileSerializable
-{
-public:
- CId3TagInfo();
- CId3TagInfo(const CId3TagInfo &oSource); // copy constructor
- virtual ~CId3TagInfo();
-
- // getters
- const CString& GetArtist() const { return m_oArtist; }
- CString &GetArtist() { return m_oArtist; }
- long GetTrackNo() const { return m_lTrackNo; }
- long& GetTrackNoRef() { return m_lTrackNo; }
- const CString& GetAlbum() const { return m_oAlbum; }
- CString &GetAlbum() { return m_oAlbum; }
- long GetYear() const { return m_lYear; }
- long& GetYearRef() { return m_lYear; }
- const CString &GetSongTitle() const { return m_oSongTitle; }
- CString& GetSongTitle() { return m_oSongTitle; }
- bool GetCopyright() const { return m_bCopyright; }
- bool& GetCopyrightRef() { return m_bCopyright; }
- const CString& GetOriginalArtist() const { return m_oOriginalArtist; }
- CString &GetOriginalArtist() { return m_oOriginalArtist; }
- const CString &GetComposer() const { return m_oComposer; }
- CString& GetComposer() { return m_oComposer; }
- const CString &GetUrl() const { return m_oUrl; }
- CString& GetUrl() { return m_oUrl; }
- const CString &GetGenre() const { return m_oGenre; }
- CString& GetGenre() { return m_oGenre; }
- const CString &GetEncodedBy() const { return m_oEncodedBy; }
- CString& GetEncodedBy() { return m_oEncodedBy; }
- const CString& GetComment() const { return m_oComment; }
- CString &GetComment() { return m_oComment; }
-
- // setters
- void SetArtist(const CString &oArtist) { m_oArtist=oArtist; }
- void SetTrackNo(long lTrackNo) { m_lTrackNo=lTrackNo; }
- void SetAlbum(const CString &oAlbum) { m_oAlbum=oAlbum; }
- void SetYear(long lYear) { m_lYear=lYear; }
- void SetSongTitle(const CString &oSongTitle) { m_oSongTitle=oSongTitle; }
- void SetCopyright(bool bCopyright) { m_bCopyright=bCopyright; }
- void SetOriginalArtist(const CString &oOriginalArtist) { m_oOriginalArtist=oOriginalArtist; }
- void SetComposer(const CString &oComposer) { m_oComposer=oComposer; }
- void SetUrl(const CString &oUrl) { m_oUrl=oUrl; }
- void SetGenre(const CString &oGenre) { m_oGenre=oGenre; }
- void SetEncodedBy(const CString &oEncodedBy) { m_oEncodedBy=oEncodedBy; }
- void SetComment(const CString &oComment) { m_oComment=oComment; }
-
- CId3TagInfo& operator=(const CId3TagInfo &oRight);
-
- // implementations to CFileSerializable
- virtual bool PutToArchive(CArchive &oArchive) const;
- virtual bool GetFromArchive(CArchive &oArchive);
-
-private:
- CString m_oArtist;
- long m_lTrackNo;
- CString m_oAlbum;
- long m_lYear;
- CString m_oSongTitle;
- bool m_bCopyright;
- CString m_oOriginalArtist;
- CString m_oComposer;
- CString m_oUrl;
- CString m_oGenre;
- CString m_oEncodedBy;
- CString m_oComment;
- // further to come (don't forget to update our assignment operator)
-
-};
-
-#endif // !defined(AFX_ID3TAGINFO_H__DFE38E72_0E81_11D5_8402_0080C88C25BD__INCLUDED_)
--- a/wingui/Job.cpp
+++ /dev/null
@@ -1,309 +1,0 @@
-// Job.cpp: implementation of the CJob class.
-// Author: Torsten Landmann
-//
-//////////////////////////////////////////////////////////////////////
-
-#include "stdafx.h"
-#include "faac_wingui.h"
-#include "Job.h"
-
-#ifdef _DEBUG
-#undef THIS_FILE
-static char THIS_FILE[]=__FILE__;
-#define new DEBUG_NEW
-#endif
-
-//////////////////////////////////////////////////////////////////////
-// Construction/Destruction
-//////////////////////////////////////////////////////////////////////
-
-CJob::CJob():
- m_eJobType(eUndefined),
- m_poJob(0)
-{
-}
-
-CJob::CJob(const CEncoderJob &oEncoderJob):
- m_eJobType(eUndefined),
- m_poJob(0)
-{
- SetEncoderJob(oEncoderJob);
-}
-
-CJob::CJob(const CJob &oSource):
- m_eJobType(eUndefined),
- m_poJob(0)
-{
- *this=oSource;
-}
-
-CJob::~CJob()
-{
- if (m_poJob!=0)
- {
- delete m_poJob;
- }
-}
-
-
-void CJob::SetEncoderJob(const CEncoderJob &oEncoderJob)
-{
- ResetContent();
-
- m_eJobType=eEncoderJob;
-
- m_poJob=new CEncoderJob(oEncoderJob);
-}
-
-CJob& CJob::operator=(const CJob &oRight)
-{
- if (this==&oRight) return *this;
- ResetContent();
-
- m_eJobType=oRight.m_eJobType;
- switch (m_eJobType)
- {
- case eEncoderJob:
- {
- m_poJob=new CEncoderJob(*((CEncoderJob*)oRight.m_poJob));
- break;
- }
- case eUndefined:
- {
- break;
- }
- default:
- {
- ASSERT(false);
- break;
- }
- }
-
- return *this;
-}
-
-CString CJob::DescribeJobTypeShort() const
-{
- if (m_poJob!=0)
- {
- return m_poJob->DescribeJobTypeShort();
- }
-
- return "U";
-}
-
-CString CJob::DescribeJobTypeLong() const
-{
- if (m_poJob!=0)
- {
- return m_poJob->DescribeJobTypeLong();
- }
-
- CString oUndefined;
- oUndefined.LoadString(IDS_UndefinedShort);
- return oUndefined;
-}
-
-CString CJob::DescribeJob() const
-{
- if (m_poJob!=0)
- {
- return m_poJob->DescribeJob();
- }
-
- CString oInvalidJob;
- oInvalidJob.LoadString(IDS_InvalidJob);
- return oInvalidJob;
-}
-
-CSupportedPropertyPagesData CJob::GetSupportedPropertyPages() const
-{
- if (m_poJob!=0)
- {
- return m_poJob->GetSupportedPropertyPages();
- }
- else
- {
- return CSupportedPropertyPagesData();
- }
-}
-
-CString CJob::GetDetailedDescriptionForStatusDialog() const
-{
- // doesn't need an implementation here; reaching here might
- // be a mistake
- ASSERT(false);
- return "";
-}
-
-void CJob::SetJobNumberInfo(long lThisJobCountNumber, long lTotalNumberOfJobs)
-{
- if (m_poJob!=0)
- {
- m_poJob->SetJobNumberInfo(lThisJobCountNumber, lTotalNumberOfJobs);
- }
- else
- {
- // must not call this method on uninitialized CJobs
- ASSERT(false);
- }
-}
-
-void CJob::SetSubJobNumberInfo(long lThisSubJobCountNumber, long lTotalNumberOfSubJobs)
-{
- if (m_poJob!=0)
- {
- m_poJob->SetSubJobNumberInfo(lThisSubJobCountNumber, lTotalNumberOfSubJobs);
- }
- else
- {
- // must not call this method on uninitialized CJobs
- ASSERT(false);
- }
-}
-
-void CJob::GetProcessingNumberInformation(long &lThisJobCountNumber, long &lTotalNumberOfJobs, long &lThisSubJobCountNumber, long &lTotalNumberOfSubJobs) const
-{
- if (m_poJob!=0)
- {
- m_poJob->GetProcessingNumberInformation(lThisJobCountNumber, lTotalNumberOfJobs, lThisSubJobCountNumber, lTotalNumberOfSubJobs);
- }
- else
- {
- // must not call this method on uninitialized CJobs
- ASSERT(false);
- }
-}
-
-void CJob::SetProcessingOutcome(EJobProcessingOutcome eJobProcessingOutcome, long lProcessingTime, const CString &oSupplementaryInfo)
-{
- if (m_poJob!=0)
- {
- m_poJob->SetProcessingOutcome(eJobProcessingOutcome, lProcessingTime, oSupplementaryInfo);
- }
- else
- {
- // must not call this method on uninitialized CJobs
- ASSERT(false);
- }
-}
-
-void CJob::GetProcessingOutcome(EJobProcessingOutcome &eJobProcessingOutcome, long &lProcessingTime, CString &oSupplementaryInfo) const
-{
- if (m_poJob!=0)
- {
- m_poJob->GetProcessingOutcome(eJobProcessingOutcome, lProcessingTime, oSupplementaryInfo);
- }
- else
- {
- // must not call this method on uninitialized CJobs
- ASSERT(false);
- }
-}
-
-void CJob::ResetProcessingOutcome()
-{
- if (m_poJob!=0)
- {
- m_poJob->ResetProcessingOutcome();
- }
- else
- {
- // it's not an error when you reach here but it might be undesired so
- // there's a little alarm here
- ASSERT(false);
- }
-}
-
-bool CJob::PutToArchive(CArchive &oArchive) const
-{
- // put a class version flag
- int iVersion=1;
- oArchive << iVersion;
-
- oArchive << m_eJobType;
-
- bool bSerializeJob=m_poJob!=0;
- CFileSerializable::SerializeBool(oArchive, bSerializeJob);
- if (bSerializeJob)
- {
- if (!m_poJob->PutToArchive(oArchive)) return false;
- }
-
- return true;
-}
-
-bool CJob::GetFromArchive(CArchive &oArchive)
-{
- // fetch the class version flag
- int iVersion;
- oArchive >> iVersion;
-
- switch (iVersion)
- {
- case 1:
- {
- oArchive >> (int&)m_eJobType;
-
- if (m_poJob!=0)
- {
- delete m_poJob;
- m_poJob=0;
- }
- bool bDeSerializeJob;
- CFileSerializable::DeSerializeBool(oArchive, bDeSerializeJob);
- if (bDeSerializeJob)
- {
- switch (m_eJobType)
- {
- case eEncoderJob:
- {
- m_poJob=new CEncoderJob;
- break;
- }
- default:
- {
- // unknown type of job
- ASSERT(false);
- return false;
- }
- }
- if (!m_poJob->GetFromArchive(oArchive)) return false;
- }
- else
- {
- m_poJob=0;
- }
-
- return true;
- }
- default:
- {
- // unknown file format version
- ASSERT(false);
- return false;
- }
- }
-}
-
-bool CJob::ProcessJob(CJobProcessingDynamicUserInputInfo &oUserInputInfo)
-{
- if (m_poJob!=0)
- {
- return m_poJob->ProcessJob(oUserInputInfo);
- }
- else
- {
- return false;
- }
-}
-
-void CJob::ResetContent()
-{
- if (m_poJob!=0)
- {
- delete m_poJob;
- }
-
- m_eJobType=eUndefined;
-}
--- a/wingui/Job.h
+++ /dev/null
@@ -1,78 +1,0 @@
-// Job.h: interface for the CJob class.
-// Author: Torsten Landmann
-//
-// represents a certain block of work (e.g. one encoding job or one
-// decoding job)
-//
-//////////////////////////////////////////////////////////////////////
-
-#if !defined(AFX_JOB_H__DFE38E6F_0E81_11D5_8402_0080C88C25BD__INCLUDED_)
-#define AFX_JOB_H__DFE38E6F_0E81_11D5_8402_0080C88C25BD__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-#include "TItemList.h"
-#include "EncoderJob.h"
-#include "ConcreteJobBase.h"
-
-class CJob : public CGenericSortable, public CConcreteJobBase
-{
-public:
- enum EJobType
- {
- eUndefined,
- eEncoderJob,
- };
-
- CJob();
- CJob(const CEncoderJob &oEncoderJob);
- CJob(const CJob &oSource); // copy constructor
- virtual ~CJob();
-
- // each of the following methods overwrites the settings
- // of a previous such method call
- void SetEncoderJob(const CEncoderJob &oEncoderJob);
-
- EJobType GetJobType() const { return m_eJobType; }
- // each of the following methods returns 0 if the content
- // of this object doesn't match the method called
- const CEncoderJob* GetEncoderJob() const { return m_eJobType==eEncoderJob ? (CEncoderJob*)m_poJob : 0; }
- CEncoderJob* GetEncoderJob() { return m_eJobType==eEncoderJob ? (CEncoderJob*)m_poJob : 0; }
-
- CJob& operator=(const CJob &oRight);
-
-
- // implementations to CJobListCtrlDescribable
- virtual CString DescribeJobTypeShort() const;
- virtual CString DescribeJobTypeLong() const;
- virtual CString DescribeJob() const;
-
- // implementations to CAbstractJob
- virtual CSupportedPropertyPagesData GetSupportedPropertyPages() const;
- virtual bool ProcessJob(CJobProcessingDynamicUserInputInfo &oUserInputInfo);
- virtual CString GetDetailedDescriptionForStatusDialog() const;
- // overrides to CAbstractJob
- virtual void SetJobNumberInfo(long lThisJobCountNumber, long lTotalNumberOfJobs);
- virtual void SetSubJobNumberInfo(long lThisSubJobCountNumber, long lTotalNumberOfSubJobs);
- virtual void GetProcessingNumberInformation(long &lThisJobCountNumber, long &lTotalNumberOfJobs, long &lThisSubJobCountNumber, long &lTotalNumberOfSubJobs) const;
- virtual void SetProcessingOutcome(EJobProcessingOutcome eJobProcessingOutcome, long lProcessingTime, const CString &oSupplementaryInfo);
- virtual void GetProcessingOutcome(EJobProcessingOutcome &eJobProcessingOutcome, long &lProcessingTime, CString &oSupplementaryInfo) const;
- virtual void ResetProcessingOutcome();
-
- // implementations to CFileSerializable
- virtual bool PutToArchive(CArchive &oArchive) const;
- virtual bool GetFromArchive(CArchive &oArchive);
-
-private:
- EJobType m_eJobType;
-
- // this member contains an object of the type defined by
- // m_eJobType
- CConcreteJobBase *m_poJob;
-
- void ResetContent();
-};
-
-#endif // !defined(AFX_JOB_H__DFE38E6F_0E81_11D5_8402_0080C88C25BD__INCLUDED_)
--- a/wingui/JobList.cpp
+++ /dev/null
@@ -1,45 +1,0 @@
-// JobList.cpp: implementation of the CJobList class.
-// Author: Torsten Landmann
-//
-//////////////////////////////////////////////////////////////////////
-
-#include "stdafx.h"
-#include "faac_wingui.h"
-#include "JobList.h"
-
-#ifdef _DEBUG
-#undef THIS_FILE
-static char THIS_FILE[]=__FILE__;
-#define new DEBUG_NEW
-#endif
-
-//////////////////////////////////////////////////////////////////////
-// Construction/Destruction
-//////////////////////////////////////////////////////////////////////
-
-CJobList::CJobList()
-{
-
-}
-
-CJobList::~CJobList()
-{
-
-}
-
-long CJobList::AddJob(const CJob &oJob, long lDesiredIndex)
-{
- return AddNewElem(oJob, lDesiredIndex);
-}
-
-CJob* CJobList::GetJob(long lIndex)
-{
- CJob *poJob;
- return GetElemContent(lIndex, poJob) ? poJob : 0;
-}
-
-CJob* CJobList::GetNextJob(CBListReader &oReader, long *plIndex)
-{
- CJob *poJob;
- return GetNextElemContent(oReader, poJob, plIndex) ? poJob : 0;
-}
\ No newline at end of file
--- a/wingui/JobList.h
+++ /dev/null
@@ -1,31 +1,0 @@
-// JobList.h: interface for the CJobList class.
-// Author: Torsten Landmann
-//
-// This class is used to save lists of jobs. Note the class
-// CFileSerializableJobList, which is used to save and load job
-// lists to and from files.
-//
-//////////////////////////////////////////////////////////////////////
-
-#if !defined(AFX_JOBLIST_H__DFE38E75_0E81_11D5_8402_0080C88C25BD__INCLUDED_)
-#define AFX_JOBLIST_H__DFE38E75_0E81_11D5_8402_0080C88C25BD__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-#include "TItemList.h"
-#include "Job.h"
-
-class CJobList : public TItemList<CJob>
-{
-public:
- CJobList();
- virtual ~CJobList();
-
- long AddJob(const CJob &oJob, long lDesiredIndex=-1);
- CJob* GetJob(long lIndex);
- CJob* GetNextJob(CBListReader &oReader, long *plIndex=0);
-};
-
-#endif // !defined(AFX_JOBLIST_H__DFE38E75_0E81_11D5_8402_0080C88C25BD__INCLUDED_)
--- a/wingui/JobListCtrlDescribable.cpp
+++ /dev/null
@@ -1,28 +1,0 @@
-// JobListCtrlDescribable.cpp: implementation of the CJobListCtrlDescribable class.
-// Author: Torsten Landmann
-//
-//////////////////////////////////////////////////////////////////////
-
-#include "stdafx.h"
-#include "faac_wingui.h"
-#include "JobListCtrlDescribable.h"
-
-#ifdef _DEBUG
-#undef THIS_FILE
-static char THIS_FILE[]=__FILE__;
-#define new DEBUG_NEW
-#endif
-
-//////////////////////////////////////////////////////////////////////
-// Construction/Destruction
-//////////////////////////////////////////////////////////////////////
-
-CJobListCtrlDescribable::CJobListCtrlDescribable()
-{
-
-}
-
-CJobListCtrlDescribable::~CJobListCtrlDescribable()
-{
-
-}
--- a/wingui/JobListCtrlDescribable.h
+++ /dev/null
@@ -1,26 +1,0 @@
-// JobListCtrlDescribable.h: interface for the CJobListCtrlDescribable class.
-// Author: Torsten Landmann
-//
-// Classes should implement this interface if they want to be used as jobs
-//
-//////////////////////////////////////////////////////////////////////
-
-#if !defined(AFX_JOBLISTCTRLDESCRIBABLE_H__DFE38E73_0E81_11D5_8402_0080C88C25BD__INCLUDED_)
-#define AFX_JOBLISTCTRLDESCRIBABLE_H__DFE38E73_0E81_11D5_8402_0080C88C25BD__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-class CJobListCtrlDescribable
-{
-public:
- CJobListCtrlDescribable();
- virtual ~CJobListCtrlDescribable();
-
- virtual CString DescribeJobTypeShort() const=0;
- virtual CString DescribeJobTypeLong() const=0;
- virtual CString DescribeJob() const=0;
-};
-
-#endif // !defined(AFX_JOBLISTCTRLDESCRIBABLE_H__DFE38E73_0E81_11D5_8402_0080C88C25BD__INCLUDED_)
--- a/wingui/JobListUpdatable.cpp
+++ /dev/null
@@ -1,27 +1,0 @@
-// JobListUpdatable.cpp: implementation of the CJobListUpdatable class.
-//
-//////////////////////////////////////////////////////////////////////
-
-#include "stdafx.h"
-#include "faac_wingui.h"
-#include "JobListUpdatable.h"
-
-#ifdef _DEBUG
-#undef THIS_FILE
-static char THIS_FILE[]=__FILE__;
-#define new DEBUG_NEW
-#endif
-
-//////////////////////////////////////////////////////////////////////
-// Construction/Destruction
-//////////////////////////////////////////////////////////////////////
-
-CJobListUpdatable::CJobListUpdatable()
-{
-
-}
-
-CJobListUpdatable::~CJobListUpdatable()
-{
-
-}
--- a/wingui/JobListUpdatable.h
+++ /dev/null
@@ -1,30 +1,0 @@
-// JobListUpdatable.h: interface for the CJobListUpdatable class.
-// Author: Torsten Landmann
-//
-// just an interface for better encapsulation
-//
-//////////////////////////////////////////////////////////////////////
-
-#if !defined(AFX_JOBLISTUPDATABLE_H__A1444E81_1546_11D5_8402_0080C88C25BD__INCLUDED_)
-#define AFX_JOBLISTUPDATABLE_H__A1444E81_1546_11D5_8402_0080C88C25BD__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-#include "ListCtrlStateSaver.h"
-
-class CJobListUpdatable
-{
-public:
- CJobListUpdatable();
- virtual ~CJobListUpdatable();
-
- // this method refills the job list control;
- // if no explicit selection state is specified the current
- // selection is preserved
- virtual void ReFillInJobListCtrl(CListCtrlStateSaver *poSelectionStateToUse=0, bool bSimpleUpdate=true)=0;
- virtual void EnableExpandFilterJobButton(bool bEnable)=0;
-};
-
-#endif // !defined(AFX_JOBLISTUPDATABLE_H__A1444E81_1546_11D5_8402_0080C88C25BD__INCLUDED_)
--- a/wingui/JobListsToConfigureSaver.cpp
+++ /dev/null
@@ -1,67 +1,0 @@
-// JobListsToConfigureSaver.cpp: implementation of the CJobListsToConfigureSaver class.
-//
-//////////////////////////////////////////////////////////////////////
-
-#include "stdafx.h"
-#include "faac_wingui.h"
-#include "JobListsToConfigureSaver.h"
-
-#ifdef _DEBUG
-#undef THIS_FILE
-static char THIS_FILE[]=__FILE__;
-#define new DEBUG_NEW
-#endif
-
-//////////////////////////////////////////////////////////////////////
-// Construction/Destruction
-//////////////////////////////////////////////////////////////////////
-
-CJobListsToConfigureSaver::CJobListsToConfigureSaver()
-{
-
-}
-
-CJobListsToConfigureSaver::CJobListsToConfigureSaver(TItemList<CJob*> &oJobs)
-{
- SaveJobs(oJobs);
-}
-
-CJobListsToConfigureSaver::~CJobListsToConfigureSaver()
-{
-
-}
-
-void CJobListsToConfigureSaver::SaveJobs(TItemList<CJob*> &oJobs)
-{
- m_oSavedJobs.DeleteAll();
- CBListReader oReader(oJobs);
- CJob *poCurJob;
- long lCurJobIndex;
- while (oJobs.GetNextElemContent(oReader, poCurJob, &lCurJobIndex))
- {
- m_oSavedJobs.AddJob(*poCurJob, lCurJobIndex);
- }
-}
-
-void CJobListsToConfigureSaver::RestoreJobs(TItemList<CJob*> &oJobs)
-{
- CBListReader oReader(oJobs);
- CJob *poCurJob;
- long lCurJobIndex;
- while (oJobs.GetNextElemContent(oReader, poCurJob, &lCurJobIndex))
- {
- // find the referring job in the list of saved jobs
- CJob *poSavedJob=m_oSavedJobs.GetJob(lCurJobIndex);
- if (poSavedJob==0)
- {
- // looks like you have modified the list structur between
- // the load and save operation
- ASSERT(false);
- }
- else
- {
- // copy in the saved content for the current job
- *poCurJob=*poSavedJob;
- }
- }
-}
\ No newline at end of file
--- a/wingui/JobListsToConfigureSaver.h
+++ /dev/null
@@ -1,38 +1,0 @@
-// JobListsToConfigureSaver.h: interface for the CJobListsToConfigureSaver class.
-// Author: Torsten Landmann
-//
-// This class is able to save jobs that are available only as pointers
-// so that their contents can be restored later; note that it is assumed
-// that the structure of the list (number and indexes of elements) does
-// not change between the save and the restore operation
-//
-//////////////////////////////////////////////////////////////////////
-
-#if !defined(AFX_JOBLISTSTOCONFIGURESAVER_H__A1444E82_1546_11D5_8402_0080C88C25BD__INCLUDED_)
-#define AFX_JOBLISTSTOCONFIGURESAVER_H__A1444E82_1546_11D5_8402_0080C88C25BD__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-#include "Job.h"
-#include "JobList.h"
-
-class CJobListsToConfigureSaver
-{
-public:
- CJobListsToConfigureSaver();
- CJobListsToConfigureSaver(TItemList<CJob*> &oJobs); // implies the save operation
- virtual ~CJobListsToConfigureSaver();
-
- // you can assume that both methods accept a const parameter; the
- // only reason that it isn't really a const parameter is that
- // we need a read session
- void SaveJobs(TItemList<CJob*> &oJobs);
- void RestoreJobs(TItemList<CJob*> &oJobs);
-
-private:
- CJobList m_oSavedJobs;
-};
-
-#endif // !defined(AFX_JOBLISTSTOCONFIGURESAVER_H__A1444E82_1546_11D5_8402_0080C88C25BD__INCLUDED_)
--- a/wingui/JobProcessingDynamicUserInputInfo.cpp
+++ /dev/null
@@ -1,92 +1,0 @@
-// JobProcessingDynamicUserInputInfo.cpp: implementation of the CJobProcessingDynamicUserInputInfo class.
-// Author: Torsten Landmann
-//
-//////////////////////////////////////////////////////////////////////
-
-#include "stdafx.h"
-#include "faac_wingui.h"
-#include "JobProcessingDynamicUserInputInfo.h"
-
-#ifdef _DEBUG
-#undef THIS_FILE
-static char THIS_FILE[]=__FILE__;
-#define new DEBUG_NEW
-#endif
-
-//////////////////////////////////////////////////////////////////////
-// Construction/Destruction
-//////////////////////////////////////////////////////////////////////
-
-CJobProcessingDynamicUserInputInfo::CJobProcessingDynamicUserInputInfo():
- m_eAutoCreateDirectories(eYes)
-{
-
-}
-
-CJobProcessingDynamicUserInputInfo::~CJobProcessingDynamicUserInputInfo()
-{
-
-}
-
-CJobProcessingDynamicUserInputInfo::EAutoCreateDirectories CJobProcessingDynamicUserInputInfo::GetAutoCreateDirectories(const CString &oCurrentDirToCreate, bool bReturnOnlyYesOrNo)
-{
- switch (m_eAutoCreateDirectories)
- {
- case eNo:
- case eYes:
- {
- // must ask the user
- CAskCreateDirectoryDialog oDlg(oCurrentDirToCreate);
- m_eAutoCreateDirectories=TranslateFromAskDialog((CAskCreateDirectoryDialog::ECreateDirectoryDialogReturn)oDlg.DoModal());
- break;
- }
- default:
- {
- // don't need to ask the user
- break;
- }
- }
-
- EAutoCreateDirectories eToReturn(m_eAutoCreateDirectories);
-
- if (bReturnOnlyYesOrNo)
- {
- if (eToReturn==eAlways) eToReturn=eYes;
- if (eToReturn==eNever) eToReturn=eNo;
- }
-
- return eToReturn;
-}
-
-bool CJobProcessingDynamicUserInputInfo::GetAutoCreateDirectoryBool(const CString &oCurrentDirToCreate)
-{
- return GetAutoCreateDirectories(oCurrentDirToCreate, true)==eYes;
-}
-
-CJobProcessingDynamicUserInputInfo::EAutoCreateDirectories CJobProcessingDynamicUserInputInfo::TranslateFromAskDialog(CAskCreateDirectoryDialog::ECreateDirectoryDialogReturn eDialogReturn)
-{
- switch (eDialogReturn)
- {
- case CAskCreateDirectoryDialog::eNo:
- {
- return eNo;
- }
- case CAskCreateDirectoryDialog::eYes:
- {
- return eYes;
- }
- case CAskCreateDirectoryDialog::eAlways:
- {
- return eAlways;
- }
- default:
- {
- // unknown parameter value
- ASSERT(false);
- }
- case CAskCreateDirectoryDialog::eNever:
- {
- return eNever;
- }
- }
-}
\ No newline at end of file
--- a/wingui/JobProcessingDynamicUserInputInfo.h
+++ /dev/null
@@ -1,44 +1,0 @@
-// JobProcessingDynamicUserInputInfo.h: interface for the CJobProcessingDynamicUserInputInfo class.
-// Author: Torsten Landmann
-//
-// This class asks questions to the user and/or saves the referring answers for
-// future reuse during the processing of a job list
-//
-//////////////////////////////////////////////////////////////////////
-
-#if !defined(AFX_JOBPROCESSINGDYNAMICUSERINPUTINFO_H__5D3060C1_1CA9_11D5_8402_0080C88C25BD__INCLUDED_)
-#define AFX_JOBPROCESSINGDYNAMICUSERINPUTINFO_H__5D3060C1_1CA9_11D5_8402_0080C88C25BD__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-#include "AskCreateDirectoryDialog.h"
-
-class CJobProcessingDynamicUserInputInfo
-{
-public:
- CJobProcessingDynamicUserInputInfo();
- virtual ~CJobProcessingDynamicUserInputInfo();
-
- enum EAutoCreateDirectories
- {
- eNo,
- eYes,
- eAlways,
- eNever,
- };
-
- // finds out if the necessary directory for a target
- // file is to be created (if not usually the
- // processing of the file will fail)
- EAutoCreateDirectories GetAutoCreateDirectories(const CString &oCurrentDirToCreate, bool bReturnOnlyYesOrNo=true);
- // this is an easier to use version of the last member
- bool GetAutoCreateDirectoryBool(const CString &oCurrentDirToCreate);
-
-private:
- EAutoCreateDirectories m_eAutoCreateDirectories;
- static EAutoCreateDirectories TranslateFromAskDialog(CAskCreateDirectoryDialog::ECreateDirectoryDialogReturn eDialogReturn);
-};
-
-#endif // !defined(AFX_JOBPROCESSINGDYNAMICUSERINPUTINFO_H__5D3060C1_1CA9_11D5_8402_0080C88C25BD__INCLUDED_)
--- a/wingui/ListCtrlStateSaver.cpp
+++ /dev/null
@@ -1,268 +1,0 @@
-// ListCtrlStateSaver.cpp: implementation of the CListCtrlStateSaver class.
-// Copyright 1999, Torsten Landmann
-// successfully compiled and tested under MSVC 6.0
-//
-//////////////////////////////////////////////////////////////////////
-
-#include "stdafx.h"
-#include "ListCtrlStateSaver.h"
-
-#ifdef _DEBUG
-#undef THIS_FILE
-static char THIS_FILE[]=__FILE__;
-#define new DEBUG_NEW
-#endif
-
-//////////////////////////////////////////////////////////////////////
-// Construction/Destruction
-//////////////////////////////////////////////////////////////////////
-
-CListCtrlStateSaver::CListCtrlStateSaver()
-{
-
-}
-
-CListCtrlStateSaver::CListCtrlStateSaver(CListCtrl *poListCtrl)
-{
- SaveState(poListCtrl);
-}
-
-CListCtrlStateSaver::~CListCtrlStateSaver()
-{
-
-}
-
-void CListCtrlStateSaver::SaveState(CListCtrl *poListCtrl)
-{
- m_bIsSaving=true;
- m_oSelectedItemLParams.DeleteAll();
- m_oCheckedItemLParams.DeleteAll();
- m_lFocusedItemLParam=-1; // no selection or don't know the selection yet
-
- if (poListCtrl!=0)
- {
- GoThroughEntireList(poListCtrl);
- }
-}
-
-void CListCtrlStateSaver::RestoreState(CListCtrl *poListCtrl)
-{
- m_bIsSaving=false;
-
- if (poListCtrl!=0)
- {
- GoThroughEntireList(poListCtrl);
- }
-}
-
-void CListCtrlStateSaver::UnselectAll()
-{
- m_oSelectedItemLParams.DeleteAll();
-}
-
-void CListCtrlStateSaver::UncheckAll()
-{
- m_oCheckedItemLParams.DeleteAll();
-}
-
-void CListCtrlStateSaver::SetToSelected(long lParam, bool bSelected)
-{
- if (bSelected)
- {
- AddSelectedItem(lParam);
- }
- else
- {
- m_oSelectedItemLParams.DeleteAllElemsWithContent(lParam);
- }
-}
-
-void CListCtrlStateSaver::SetToSelected(TItemList<long> oLParams, bool bSelected)
-{
- HRead hRead=oLParams.BeginRead();
- long lCurLParam;
- while (oLParams.GetNextElemContent(hRead, lCurLParam))
- {
- SetToSelected(lCurLParam, bSelected);
- }
- oLParams.EndRead(hRead);
-}
-
-void CListCtrlStateSaver::SetToChecked(long lParam, bool bChecked)
-{
- if (bChecked)
- {
- AddCheckedItem(lParam);
- }
- else
- {
- m_oCheckedItemLParams.DeleteAllElemsWithContent(lParam);
- }
-}
-
-void CListCtrlStateSaver::SetToChecked(TItemList<long> oLParams, bool bSelected)
-{
- HRead hRead=oLParams.BeginRead();
- long lCurLParam;
- while (oLParams.GetNextElemContent(hRead, lCurLParam))
- {
- SetToChecked(lCurLParam, bSelected);
- }
- oLParams.EndRead(hRead);
-}
-
-long CListCtrlStateSaver::GetFocusedItemLParam() const
-{
- return m_lFocusedItemLParam;
-}
-
-bool CListCtrlStateSaver::IsSelected(long lItemLParam) const
-{
- long lDummy;
- return m_oSelectedItemLParams.FindContent(lItemLParam, lDummy);
-}
-
-bool CListCtrlStateSaver::IsChecked(long lItemLParam) const
-{
- long lDummy;
- return m_oCheckedItemLParams.FindContent(lItemLParam, lDummy);
-}
-
-long CListCtrlStateSaver::GetNumberOfSelectedItems() const
-{
- return m_oSelectedItemLParams.GetNumber();
-}
-
-long CListCtrlStateSaver::GetNumberOfCheckedItems() const
-{
- return m_oCheckedItemLParams.GetNumber();
-}
-
-void CListCtrlStateSaver::AddSelectedItem(long lParam)
-{
- long lId;
- if (!m_oSelectedItemLParams.FindContent(lParam, lId))
- {
- m_oSelectedItemLParams.AddNewElem(lParam);
- }
-}
-
-void CListCtrlStateSaver::AddCheckedItem(long lParam)
-{
- long lId;
- if (!m_oCheckedItemLParams.FindContent(lParam, lId))
- {
- m_oCheckedItemLParams.AddNewElem(lParam);
- }
-}
-
-bool CListCtrlStateSaver::IsSelected(CListCtrl *poListCtrl, int iItemId)
-{
- UINT uiItemState=ListView_GetItemState(*poListCtrl, iItemId, LVIS_SELECTED);
- return uiItemState!=0;
-}
-
-bool CListCtrlStateSaver::IsInSelectedItemsList(long lParam)
-{
- long lId;
- return m_oSelectedItemLParams.FindContent(lParam, lId);
-}
-
-bool CListCtrlStateSaver::IsChecked(CListCtrl *poListCtrl, int iItemId)
-{
- return ListView_GetCheckState(*poListCtrl, iItemId)!=0;
-}
-
-bool CListCtrlStateSaver::IsInCheckedItemsList(long lParam)
-{
- long lId;
- return m_oCheckedItemLParams.FindContent(lParam, lId);
-}
-
-bool CListCtrlStateSaver::IsFocused(CListCtrl *poListCtrl, int iItemId)
-{
- UINT uiItemState=ListView_GetItemState(*poListCtrl, iItemId, LVIS_FOCUSED);
- return uiItemState!=0;
-}
-
-void CListCtrlStateSaver::SetSelectedState(CListCtrl *poListCtrl, int iItemId, bool bSelected)
-{
- if (bSelected)
- {
- ListView_SetItemState(*poListCtrl, iItemId, LVIS_SELECTED, LVIS_SELECTED);
- }
- else
- {
- ListView_SetItemState(*poListCtrl, iItemId, 0, LVIS_SELECTED);
- }
-}
-
-void CListCtrlStateSaver::SetCheckedState(CListCtrl *poListCtrl, int iItemId, bool bChecked)
-{
- // macro as written at topic "Extended list view styles"
- // in the msdn
-#ifndef ListView_SetCheckState
- #define ListView_SetCheckState(hwndLV, i, fCheck) \
- ListView_SetItemState(hwndLV, i, \
- INDEXTOSTATEIMAGEMASK((fCheck)+1), LVIS_STATEIMAGEMASK)
-#endif
-
- if (bChecked)
- {
- ListView_SetCheckState(*poListCtrl, iItemId, TRUE);
- }
- else
- {
- ListView_SetCheckState(*poListCtrl, iItemId, FALSE);
- }
-}
-
-void CListCtrlStateSaver::SetToFocused(CListCtrl *poListCtrl, int iItemId)
-{
- ListView_SetItemState(*poListCtrl, iItemId, LVIS_FOCUSED, LVIS_FOCUSED);
-}
-
-void CListCtrlStateSaver::GoThroughEntireList(CListCtrl *poListCtrl)
-{
- long lNumberOfItems=poListCtrl->GetItemCount();
- for (int iCurItemId=0; iCurItemId<lNumberOfItems; iCurItemId++)
- {
- long lCurItemLParam=poListCtrl->GetItemData(iCurItemId);
- if (m_bIsSaving)
- {
- // save the item's state
-
- if (IsSelected(poListCtrl, iCurItemId))
- {
- AddSelectedItem(lCurItemLParam);
- }
-
- if (IsChecked(poListCtrl, iCurItemId))
- {
- AddCheckedItem(lCurItemLParam);
- }
-
- if (IsFocused(poListCtrl, iCurItemId))
- {
- m_lFocusedItemLParam=lCurItemLParam;
- }
- }
- else
- {
- // restore the item's state
- SetSelectedState(poListCtrl, iCurItemId, IsInSelectedItemsList(lCurItemLParam));
- SetCheckedState(poListCtrl, iCurItemId, IsInCheckedItemsList(lCurItemLParam));
-
- if (m_lFocusedItemLParam==lCurItemLParam)
- {
- SetToFocused(poListCtrl, iCurItemId);
- }
- }
- }
-
- if (!m_bIsSaving && m_lFocusedItemLParam<0)
- {
- // no focused item
- SetToFocused(poListCtrl, -1);
- }
-}
\ No newline at end of file
--- a/wingui/ListCtrlStateSaver.h
+++ /dev/null
@@ -1,70 +1,0 @@
-// ListCtrlStateSaver.h: interface for the CListCtrlStateSaver class.
-// Copyright 1999, Torsten Landmann
-// successfully compiled and tested under MSVC 6.0
-//
-// This class is able to easily preserve the state of a list control
-// during refills of that control. It preserves information on which
-// items are selected and which items are checked. It does not preserve
-// the order.
-//
-//////////////////////////////////////////////////////////////////////
-
-#if !defined(AFX_LISTCTRLSTATESAVER_H__CAAC66A6_72CB_11D3_A724_C0C04EC10107__INCLUDED_)
-#define AFX_LISTCTRLSTATESAVER_H__CAAC66A6_72CB_11D3_A724_C0C04EC10107__INCLUDED_
-
-#include "TItemList.h"
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-class CListCtrlStateSaver
-{
-public:
- CListCtrlStateSaver(); // when using this constructor you can configure the list control using SetToSelected() and public methods below
- CListCtrlStateSaver(CListCtrl *poListCtrl);
- virtual ~CListCtrlStateSaver();
-
- void SaveState(CListCtrl *poListCtrl);
- void RestoreState(CListCtrl *poListCtrl); // not a const member; however you can assume it is one
-
- // for manual list control configuration; take effect
- // on RestoreState()
- void UnselectAll();
- void UncheckAll();
- void SetToSelected(long lParam, bool bSelected=true);
- void SetToSelected(TItemList<long> oLParams, bool bSelected=true);
- void SetToChecked(long lParam, bool bChecked=true);
- void SetToChecked(TItemList<long> oLParams, bool bSelected=true);
-
- long GetFocusedItemLParam() const; // -1 if there's no focused item
- bool IsSelected(long lItemLParam) const;
- bool IsChecked(long lItemLParam) const;
-
- long GetNumberOfSelectedItems() const;
- long GetNumberOfCheckedItems() const;
-
-private:
- long m_lFocusedItemLParam;
- TItemList<long> m_oSelectedItemLParams;
- TItemList<long> m_oCheckedItemLParams;
-
- void AddSelectedItem(long lParam);
- void AddCheckedItem(long lParam);
-
- static bool IsSelected(CListCtrl *poListCtrl, int iItemId);
- bool IsInSelectedItemsList(long lParam);
- static bool IsChecked(CListCtrl *poListCtrl, int iItemId);
- bool IsInCheckedItemsList(long lParam);
- static bool IsFocused(CListCtrl *poListCtrl, int iItemId);
-
- void SetSelectedState(CListCtrl *poListCtrl, int iItemId, bool bSelected);
- void SetCheckedState(CListCtrl *poListCtrl, int iItemId, bool bChecked);
- void SetToFocused(CListCtrl *poListCtrl, int iItemId);
-
- bool m_bIsSaving;
-
- void GoThroughEntireList(CListCtrl *poListCtrl);
-};
-
-#endif // !defined(AFX_LISTCTRLSTATESAVER_H__CAAC66A6_72CB_11D3_A724_C0C04EC10107__INCLUDED_)
--- a/wingui/Listobj.cpp
+++ /dev/null
@@ -1,730 +1,0 @@
-// list class
-// Copyright 1999, Torsten Landmann
-// successfully compiled and tested under MSVC 6.0
-//
-//////////////////////////////////////////////////////
-
-#include "stdafx.h"
-#include "Listobj.h"
-
-// definitions for class CBListReader
-CBListReader::CBListReader(CBList &oList)
-{
- m_poList=&oList;
- m_hRead=oList.BeginRead();
-
- m_piUsageStack=new int;
- *m_piUsageStack=1;
-}
-
-CBListReader::CBListReader(const CBListReader &oSource):
- m_piUsageStack(0)
-{
- *this=oSource;
-}
-
-CBListReader::~CBListReader()
-{
- AbandonCurrentContent();
-}
-
-
-CBListReader& CBListReader::operator=(const CBListReader &oRight)
-{
- if (this==&oRight) return *this;
- AbandonCurrentContent();
-
- m_poList=oRight.m_poList;
- m_hRead=oRight.m_hRead;
- m_piUsageStack=oRight.m_piUsageStack;
- if (m_piUsageStack!=0) *m_piUsageStack++;
-
- return *this;
-}
-
-CBListReader::CBListReader(CBList *poList, HRead hRead):
- m_poList(poList), m_hRead(hRead)
-{
- m_piUsageStack=new int;
- *m_piUsageStack=1;
-}
-
-void CBListReader::AbandonCurrentContent()
-{
- if (m_piUsageStack!=0)
- {
- (*m_piUsageStack)--;
- if (*m_piUsageStack==0)
- {
- // last copy of this reader destroyed
- m_poList->EndRead(m_hRead);
- delete m_piUsageStack;
- m_piUsageStack=0;
- }
- }
-}
-
-
-
-// ----------- definitions for CBBaseElem ---------
-
-CBBaseElem::CBBaseElem()
-{
- lIndex=0;
- pNext=0;
- pPrevious=0;
-}
-
-CBBaseElem::~CBBaseElem()
-{
-}
-
-signed long CBBaseElem::IsHigher(class CBBaseElem *pElem)
-{
- if (lIndex>pElem->GetIndex())
- {
- return(1);
- }
- else
- {
- if (lIndex<pElem->GetIndex())
- {
- return(-1);
- }
- else
- {
- return(0);
- }
- }
-}
-
-bool CBBaseElem::PutToArchive(CArchive &oArchive, long lSaveParams) const
-{
- oArchive << lIndex;
-
- return true;
-}
-
-bool CBBaseElem::GetFromArchive(CArchive &oArchive, long lLoadParams)
-{
- oArchive >> lIndex;
-
- return true;
-}
-
-
-// ------ definitions for CBList ---------
-
-
-CBList::CBList()
-{
- pFirst=0; pLast=0;
- lCurrentIndex=1;
- SortBeforeReading=false;
- long lCount;
- for (lCount=lMaxNumRS-1; lCount>=0; lCount--)
- {
- bReadEntryUsed[lCount]=false;
- }
- lNumOfOpenReadingSessions=0;
-}
-
-CBList::~CBList()
-{
- if (pFirst!=0)
- {
- DeleteAll();
- }
-}
-
-TBListErr CBList::DeleteAll()
-{
- if (lNumOfOpenReadingSessions>0)
- {
-#ifdef _DEBUG
- // release an error even in encapsulated code
- // (OCX controls and so on)
- char *pTest=0;
- char szTest=*pTest;
-#endif
- return siListErr;
- }
-
- PBBaseElem pCurrent=pFirst, pDummy;
- while (pCurrent!=0)
- {
- pDummy=pCurrent->pNext;
-
- OnPreDeleteItem(pCurrent); // inform sub classes of deletion
- pCurrent->pNext=0;
- delete pCurrent;
-
- pCurrent=pDummy;
- }
- pFirst=0; pLast=0;
- return siListNoErr;
-}
-
-signed long CBList::GetSmallestIndex()
- // determines the lowest available Index
-{
- long lPos=lCurrentIndex+1; // begin search at next element
- if (lPos>iMaxNumberOfCBListItems)
- {
- lPos=1;
- }
- while (Exists(lPos))
- {
- if (lPos==lCurrentIndex) // one turn with nothing found?
- {
- return(siListErr); // return error
- }
- if (lPos>iMaxNumberOfCBListItems)
- {
- lPos=1;
- }
- lPos++;
- }
- lCurrentIndex=lPos;
- return(lPos);
-}
-
-
-
-PBBaseElem CBList::Add()
-{
- if (lNumOfOpenReadingSessions>0)
- {
-#ifdef _DEBUG
- // release an error even in encapsulated code
- // (OCX controls and so on)
- char *pTest=0;
- char szTest=*pTest;
-#endif
- return 0;
- }
-
- long lIndex=GetSmallestIndex();
- PBBaseElem pElem;
- if (lIndex==siListErr)
- {
- return 0;
- }
-
- pElem=CreateElem();
-
- if (pFirst==0) pFirst=pElem;
- pElem->pPrevious=pLast;
- if (pLast!=0) pElem->pPrevious->pNext=pElem;
- pElem->pNext=0;
- pLast=pElem;
- pElem->lIndex=lIndex;
- pElem->pParentList=this;
-
- return pElem;
-}
-
-PBBaseElem CBList::Add(long lDesiredIndex)
-{
- if (lNumOfOpenReadingSessions>0)
- {
-#ifdef _DEBUG
- // release an error even in encapsulated code
- // (OCX controls and so on)
- char *pTest=0;
- char szTest=*pTest;
-#endif
- return 0;
- }
-
- long lIndex=lDesiredIndex;
-
- if (lIndex<1 || lIndex>iMaxNumberOfCBListItems ||
- Exists(lIndex))
- {
- // the desired index can't be used
- return Add();
- }
-
- PBBaseElem pElem;
-
- pElem=CreateElem();
-
-
- if (pLast==0) pLast=pElem;
- pElem->pNext=pFirst;
- if (pFirst!=0) pElem->pNext->pPrevious=pElem;
- pElem->pPrevious=0;
- pFirst=pElem;
- pElem->lIndex=lIndex;
- pElem->pParentList=this;
-
- return pElem;
-}
-
-bool CBList::OnMapHandle(CBBaseElem *poElem, long lTask, long lHint)
-{
- // do nothing; return false to avoid a waste of time
- return false;
-}
-
-
-// set to true virtual
-/*PBBaseElem CBList::CreateElem()
-{
- PBBaseElem pNewElem=new TBBaseElem;
- return pNewElem;
-}*/
-
-void CBList::OnPreDeleteItem(PBBaseElem poElem)
-{
- // do nothing here
-}
-
-TBListErr CBList::DeleteElem(long lIndex)
-{
- if (lNumOfOpenReadingSessions>0)
- {
-#ifdef _DEBUG
- // release an error even in encapsulated code
- // (OCX controls and so on)
- char *pTest=0;
- char szTest=*pTest;
-#endif
- return siListErr;
- }
-
- PBBaseElem pCurrent=pFirst;
- while (pCurrent!=0)
- {
- if (pCurrent->lIndex==lIndex) // current corresponds to searched?
- {
- OnPreDeleteItem(pCurrent); // inform sub class of deletion
-
- bool bDeleted=false;
- if (pCurrent==pFirst) // first Element to be deleted?
- {
- pFirst=pFirst->pNext;
- if (pFirst!=0)
- {
- pFirst->pPrevious=0;
- }
- bDeleted=true;
- }
- if (pCurrent==pLast) // last Element to be deleted?
- {
- pLast=pLast->pPrevious;
- if (pLast!=0)
- {
- pLast->pNext=0;
- }
- bDeleted=true;
- }
- if (!bDeleted)
- // neither first nor last element
- {
- pCurrent->pNext->pPrevious=pCurrent->pPrevious;
- pCurrent->pPrevious->pNext=pCurrent->pNext;
- }
- delete pCurrent;
- return siListNoErr;
- }
- pCurrent=pCurrent->pNext;
- }
- // if the programm reaches this point the desired element could
- // not be found
- return siListErr;
-}
-
-
-bool CBList::Exists(long lIndex) const
-{
- PBBaseElem pCurrent=pFirst;
- while (pCurrent!=0)
- {
- if (pCurrent->lIndex==lIndex) // desired element found?
- {
- return true;
- }
- pCurrent=pCurrent->pNext;
- }
- // if the program reaches this point the desired element could
- // not be found
- return false;
-}
-
-signed long CBList::GetNumber() const
-{
- PBBaseElem pCurrent=pFirst;
- long lNumber=0;
- while (pCurrent!=0)
- {
- lNumber++;
- pCurrent=pCurrent->pNext;
- }
- return lNumber;
-}
-
-
-PBBaseElem CBList::GetElem(long lIndex) const
-{
- PBBaseElem pCurrent=pFirst;
- while (pCurrent!=0)
- {
- if (pCurrent->lIndex==lIndex)
- {
- return pCurrent;
- }
- pCurrent=pCurrent->pNext;
- }
-
- // element was not found
- return 0;
-}
-
-PBBaseElem CBList::GetPos(long lPos) const
-{
- PBBaseElem pCurrent=pFirst;
- while (pCurrent!=0)
- {
- if (lPos==0)
- {
- return pCurrent;
- }
- pCurrent=pCurrent->pNext;
- lPos--;
- }
- return 0;
-}
-
-long CBList::GetIndexPos(long lIndex) const
-{
- long lCurPos=0;
- PBBaseElem pCurrent=pFirst;
- while (pCurrent!=0)
- {
- if (pCurrent->GetIndex()==lIndex)
- {
- return lCurPos;
- }
-
- pCurrent=pCurrent->pNext;
- lCurPos++;
- }
-
- // index was not found
- return siListErr;
-}
-
-
-TBListErr CBList::Sort(ESortMode eSortMode)
- // sort using methods "IsHigher()" and "Exchange()"
- // error: siListErr
-{
- if (lNumOfOpenReadingSessions>0)
- {
-#ifdef _DEBUG
- // release an error even in encapsulated code
- // (OCX controls and so on)
- char *pTest=0;
- char szTest=*pTest;
-#endif
- return siListErr;
- }
-
- return DoBubbleSort(pFirst, pLast, eSortMode);
-}
-
-bool CBList::SetSortBeforeReading(bool bNewValue)
- // returns old state
-{
- if (lNumOfOpenReadingSessions>0)
- {
-#ifdef _DEBUG
- // release an error even in encapsulated code
- // (OCX controls and so on)
- char *pTest=0;
- char szTest=*pTest;
-#endif
- return siListErr;
- }
-
- bool old=SortBeforeReading;
- SortBeforeReading=bNewValue;
- return old;
-}
-
-signed long CBList::FindOpenReadPos() const
-{
- long lPos=0;
- while (bReadEntryUsed[lPos])
- {
- if (lPos>=lMaxNumRS)
- {
- return siListErr;
- }
- lPos++;
- }
- return lPos;
-}
-
-HRead CBList::BeginRead()
-{
- HRead hNewReadingSession=FindOpenReadPos();
- if (hNewReadingSession==siListErr) return siListErr;
-
- if (SortBeforeReading) Sort();
-
- pReadPos[hNewReadingSession]=pFirst;
- bReadEntryUsed[hNewReadingSession]=true;
- lNumOfOpenReadingSessions++;
- return hNewReadingSession;
-}
-
-CBListReader CBList::BeginReadEx()
-{
- return CBListReader(this, BeginRead());
-}
-
-PBBaseElem CBList::ReadElem(HRead hRead)
-{
- PBBaseElem pCurrent=pReadPos[hRead];
- if (pReadPos[hRead]!=0)
- pReadPos[hRead]=pReadPos[hRead]->pNext;
- return pCurrent;
-}
-
-TBListErr CBList::EndRead(HRead hRead)
-{
- bReadEntryUsed[hRead]=false;
- lNumOfOpenReadingSessions--;
- return siListNoErr;
-}
-
-TBListErr CBList::EndRead(CBListReader &oReader)
-{
- oReader.EndReaderSession();
- return siListNoErr;
-}
-
-bool CBList::Map(long lTask, long lHint)
-{
- HRead hRead=BeginRead();
- CBBaseElem *poCurElem;
- while ((poCurElem=ReadElem(hRead))!=0)
- {
- if (!OnMapHandle(poCurElem, lTask, lHint))
- {
- // action was aborted
- EndRead(hRead);
- return false;
- }
- }
- EndRead(hRead);
-
- // action was not aborted
- return true;
-}
-
-
-TBListErr CBList::PutToArchive(CArchive &oArchive, long lSaveParams) const
-{
- // save the number of elements
- long lNumberOfElements=GetNumber();
- oArchive << lNumberOfElements;
-
- // go through all elements and save them
- PBBaseElem pCurrent=pFirst;
- while (pCurrent!=0)
- {
- if (!pCurrent->PutToArchive(oArchive, lSaveParams))
- {
- return siListErr;
- }
-
- pCurrent=pCurrent->pNext;
- }
-
- return siListNoErr;
-}
-
-TBListErr CBList::GetFromArchive(CArchive &oArchive, long lLoadParams)
-{
- // remove old content
- DeleteAll();
-
- // get the number of elements
- long lNumberOfElements;
- oArchive >> lNumberOfElements;
-
- // go through all elements and load them
- while (lNumberOfElements>0)
- {
- // create a new element and fill it with data from the stream;
- // we give a desired index to avoid wasting time searching
- // for an available id
- PBBaseElem poCurElem;
- if (!(poCurElem=Add(23456))->GetFromArchive(oArchive, lLoadParams))
- {
- // return siListErr; // I found this was too strict
-
- // delete the element that we've just created
- DeleteElem(poCurElem->GetIndex());
- }
-
- lNumberOfElements--;
- }
-
- return siListNoErr;
-}
-
-TBListErr CBList::SaveToFile(const char *lpszFileName, long lSaveParams)
-{
- try
- {
- // open the file
- CFile oFile(lpszFileName, CFile::modeCreate | CFile::modeWrite | CFile::shareDenyWrite);
- CArchive oArchive(&oFile, CArchive::store);
-
- // put data to it
- return PutToArchive(oArchive, lSaveParams)==siListNoErr;
- }
- catch (...)
- {
- // error opening the file for exclusive writing
- return siListSavErr;
- }
-
-}
-
-TBListErr CBList::LoadFromFile(const char *lpszFileName, long lLoadParams)
-{
- try
- {
- // open the file
- CFile oFile(lpszFileName, CFile::modeRead | CFile::shareDenyNone);
- CArchive oArchive(&oFile, CArchive::load);
-
- // get data from it
- return GetFromArchive(oArchive, lLoadParams)==siListNoErr;
- }
- catch (...)
- {
- // error opening the file for exclusive writing
- return siListErr;
- }
-}
-
-// ---- private definitions ----
-
-TBListErr CBList::Exchange(PBBaseElem pOne, PBBaseElem pTwo)
-{
- if (pOne==0 || pTwo==0) return siListErr;
- if (pOne==pTwo) return siListNoErr;
-
- PBBaseElem pBeforeOne=pOne->GetPrevious();
- PBBaseElem pBeforeTwo=pTwo->GetPrevious();
- PBBaseElem pAfterOne=pOne->GetNext();
- PBBaseElem pAfterTwo=pTwo->GetNext();
-
- // set new pFirst and pLast states, if necessary
- if (pOne==pFirst) pFirst=pTwo; else
- if (pTwo==pFirst) pFirst=pOne;
- if (pOne==pLast) pLast=pTwo; else
- if (pTwo==pLast) pLast=pOne;
-
- if (pBeforeTwo==pOne)
- { // Elements follow on each other
- if (pOne->pPrevious!=0) pOne->pPrevious->pNext=pTwo;
- if (pTwo->pNext!=0) pTwo->pNext->pPrevious=pOne;
-
- pTwo->pPrevious=pOne->pPrevious;
- pOne->pPrevious=pTwo;
-
- pOne->pNext=pTwo->pNext;
- pTwo->pNext=pOne;
- return siListNoErr;
- }
- if (pBeforeOne==pTwo)
- { // Elements follow on each other
- if (pTwo->pPrevious!=0) pTwo->pPrevious->pNext=pOne;
- if (pOne->pNext!=0) pOne->pNext->pPrevious=pTwo;
-
- pOne->pPrevious=pTwo->pPrevious;
- pTwo->pPrevious=pOne;
-
- pTwo->pNext=pOne->pNext;
- pOne->pNext=pTwo;
- return siListNoErr;
- }
-
- // if the execution comes to here both pOne and pTwo do not
- // follow each other
-
- if (pTwo->pNext!=0) pTwo->pNext->pPrevious=pOne;
- if (pTwo->pPrevious!=0) pTwo->pPrevious->pNext=pOne;
- if (pOne->pNext!=0) pOne->pNext->pPrevious=pTwo;
- if (pOne->pPrevious!=0) pOne->pPrevious->pNext=pTwo;
-
- PBBaseElem pDummy;
-
- pDummy=pOne->pNext;
- pOne->pNext=pTwo->pNext;
- pTwo->pNext=pDummy;
-
- pDummy=pOne->pPrevious;
- pOne->pPrevious=pTwo->pPrevious;
- pTwo->pPrevious=pDummy;
-
- return siListNoErr;
-}
-
-PBBaseElem CBList::FindLowest(PBBaseElem pBeginFrom, PBBaseElem pGoTo, ESortMode eSortMode)
-{ // finds the element with the lowest key in a given interval
- if (pBeginFrom==pGoTo) return pBeginFrom;
-
- PBBaseElem pCurLowest=pBeginFrom;
- while (pBeginFrom!=pGoTo->GetNext())
- {
- if (eSortMode==eAscending)
- {
- if (pBeginFrom->IsHigher(pCurLowest)==-1)
- pCurLowest=pBeginFrom;
- }
- else
- {
- if (pBeginFrom->IsHigher(pCurLowest)==1)
- pCurLowest=pBeginFrom;
- }
-
- pBeginFrom=pBeginFrom->pNext;
- }
- return pCurLowest;
-}
-
-
-TBListErr CBList::DoBubbleSort(PBBaseElem pLeft, PBBaseElem pRight, ESortMode eSortMode)
-{
- if (pLeft==0 || pRight==0) return siListNoErr; // sucessfully finished
- if (pLeft==pRight) return siListNoErr; // sucessfully finished
-
-
-
- PBBaseElem pLeftSortBorder=pLeft;
- PBBaseElem pLowestElem;
- while (pLeftSortBorder!=pRight)
- {
- pLowestElem=FindLowest(pLeftSortBorder, pRight, eSortMode);
-
- // exchanging the elements may have lead to a change of pRight
- if (pRight==pLowestElem) pRight=pLeftSortBorder;
- else if (pRight==pLeftSortBorder) pRight=pLowestElem;
-
- Exchange(pLowestElem, pLeftSortBorder);
-
- // pLowestElem's successor is now the new left sort border
- pLeftSortBorder=pLowestElem->pNext;
- }
- return siListNoErr;
-}
-
--- a/wingui/PageCheckboxCtrlContent.cpp
+++ /dev/null
@@ -1,58 +1,0 @@
-// PageCheckboxCtrlContent.cpp: implementation of the CPageCheckboxCtrlContent class.
-// Author: Torsten Landmann
-//
-//////////////////////////////////////////////////////////////////////
-
-#include "stdafx.h"
-#include "faac_wingui.h"
-#include "PageCheckboxCtrlContent.h"
-
-#ifdef _DEBUG
-#undef THIS_FILE
-static char THIS_FILE[]=__FILE__;
-#define new DEBUG_NEW
-#endif
-
-//////////////////////////////////////////////////////////////////////
-// Construction/Destruction
-//////////////////////////////////////////////////////////////////////
-
-CPageCheckboxCtrlContent::CPageCheckboxCtrlContent(bool bCheckMark):
- m_bCheckMark(bCheckMark)
-{
-
-}
-
-CPageCheckboxCtrlContent::~CPageCheckboxCtrlContent()
-{
-
-}
-
-
-CString CPageCheckboxCtrlContent::GetHashString() const
-{
- return "CPageCheckboxCtrlContent-"+CString(m_bCheckMark ? "T" : "F");
-}
-
-void CPageCheckboxCtrlContent::ApplyCheckCodeToButton(CButton *poButton) const
-{
- if (Is3rdState())
- {
- poButton->SetButtonStyle(BS_AUTO3STATE);
- poButton->SetCheck(2);
- }
- else
- {
- poButton->SetCheck(m_bCheckMark ? 1 : 0);
- }
-}
-
-bool CPageCheckboxCtrlContent::ApplyToJob(bool &bBool) const
-{
- bool bOld=bBool;
- if (!Is3rdState())
- {
- bBool=GetCheckMark();
- }
- return bOld!=bBool;
-}
\ No newline at end of file
--- a/wingui/PageCheckboxCtrlContent.h
+++ /dev/null
@@ -1,44 +1,0 @@
-// PageCheckboxCtrlContent.h: interface for the CPageCheckboxCtrlContent class.
-// Author: Torsten Landmann
-//
-// is able to save the content of a checkbox including the 3rd state
-// and perform merge operations so that data for several jobs can be
-// merged
-//
-//////////////////////////////////////////////////////////////////////
-
-#if !defined(AFX_PAGECHECKBOXCTRLCONTENT_H__7B47B269_0FF8_11D5_8402_0080C88C25BD__INCLUDED_)
-#define AFX_PAGECHECKBOXCTRLCONTENT_H__7B47B269_0FF8_11D5_8402_0080C88C25BD__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-#include "AbstractPageCtrlContent.h"
-
-class CPageCheckboxCtrlContent : public CAbstractPageCtrlContent
-{
-public:
- CPageCheckboxCtrlContent(bool bCheckMark=false);
- virtual ~CPageCheckboxCtrlContent();
-
- // setting content automatically disables the 3rd state
- void SetCheckMark(bool bCheckMark) { SetIs3rdState(false); m_bCheckMark=bCheckMark; }
- bool GetCheckMark() const { return m_bCheckMark; }
-
- // accepts values returned by CButton::GetCheck()
- void SetCheckCode(int iCheckCode) { SetIs3rdState(iCheckCode==2); m_bCheckMark=iCheckCode==1; }
- int GetCheckCode() const { if (Is3rdState()) return 2; else return m_bCheckMark ? 1 : 0; }
- void ApplyCheckCodeToButton(CButton *poButton) const; // this member should prefered over GetCheckCode() because it also enables the 3rd state, if necessary
-
- // returns if the existing value has been modified
- bool ApplyToJob(bool &bBool) const;
-
- // implementation of CAbstractPageCtrlContent method
- virtual CString GetHashString() const;
-
-private:
- bool m_bCheckMark;
-};
-
-#endif // !defined(AFX_PAGECHECKBOXCTRLCONTENT_H__7B47B269_0FF8_11D5_8402_0080C88C25BD__INCLUDED_)
--- a/wingui/PageComboBoxCtrlContent.cpp
+++ /dev/null
@@ -1,142 +1,0 @@
-// PageComboBoxCtrlContent.cpp: implementation of the CPageComboBoxCtrlContent class.
-// Author: Torsten Landmann
-//
-//////////////////////////////////////////////////////////////////////
-
-#include "stdafx.h"
-#include "faac_wingui.h"
-#include "PageComboBoxCtrlContent.h"
-
-#ifdef _DEBUG
-#undef THIS_FILE
-static char THIS_FILE[]=__FILE__;
-#define new DEBUG_NEW
-#endif
-
-//////////////////////////////////////////////////////////////////////
-// Construction/Destruction
-//////////////////////////////////////////////////////////////////////
-
-CPageComboBoxCtrlContent::CPageComboBoxCtrlContent()
-{
-
-}
-
-CPageComboBoxCtrlContent::~CPageComboBoxCtrlContent()
-{
-
-}
-
-void CPageComboBoxCtrlContent::SetContentSelection(int iSelectionId)
-{
- CString oSelection;
- oSelection.Format("%d", iSelectionId);
- SetContentText(oSelection);
-}
-
-int CPageComboBoxCtrlContent::GetContentSelection() const
-{
- CString oSelectionString(GetContentText());
- if (oSelectionString.IsEmpty()) return -1; // 3rd state
- int iSelectionId;
- if (sscanf(oSelectionString, "%d", &iSelectionId)!=1)
- {
- // error while parsing
- return -1;
- }
-
- return iSelectionId;
-}
-
-void CPageComboBoxCtrlContent::SetContentText(const CString &oText)
-{
- SetContent(oText);
-}
-
-const CString& CPageComboBoxCtrlContent::GetContentText() const
-{
- return GetContent();
-}
-
-CString& CPageComboBoxCtrlContent::GetContentText()
-{
- return GetContent();
-}
-
-void CPageComboBoxCtrlContent::SetCurComboBoxSelectionText(CComboBox *poComboBox)
-{
- int iCurSelection=poComboBox->GetCurSel();
- if (iCurSelection<0)
- {
- SetIs3rdState(true);
- return;
- }
-
- CString oText;
- poComboBox->GetLBText(iCurSelection, oText);
- SetContent(oText);
-}
-
-bool CPageComboBoxCtrlContent::ApplyToJob(CString &oNativeJobPropertyTextString) const
-{
- CString oOld(oNativeJobPropertyTextString);
- if (!Is3rdState())
- {
- oNativeJobPropertyTextString=GetContentText();
- }
- return oOld!=oNativeJobPropertyTextString;
-}
-
-bool CPageComboBoxCtrlContent::ApplyToJob(long &lNativeJobPropertySelectionLong) const
-{
- long lOld(lNativeJobPropertySelectionLong);
- int iId=GetContentSelection();
- if (iId>=0)
- {
- lNativeJobPropertySelectionLong=GetContentSelection();
- }
- return lOld!=lNativeJobPropertySelectionLong;
-}
-
-void CPageComboBoxCtrlContent::ApplyToComboBoxVariable(int &iSelectionVariable) const
-{
- int iId=GetContentSelection();
- if (iId>=0)
- {
- iSelectionVariable=GetContentSelection();
- }
-}
-
-void CPageComboBoxCtrlContent::ApplyToComboBoxVariable(CString &oSelectionVariable) const
-{
- if (!Is3rdState())
- {
- oSelectionVariable=GetContentText();
- }
-}
-
-void CPageComboBoxCtrlContent::ApplyToComboBoxPointer(CComboBox *poComboBox) const
-{
- // important: this method is only for drop down combo boxes
- // that have been used with the text feature
- CString oStringToSelect;
- if (Is3rdState())
- {
- oStringToSelect.Empty();
- }
- else
- {
- oStringToSelect=GetContent();
- }
-
- int iSelection=poComboBox->FindStringExact(0, oStringToSelect);
- if (iSelection>=0)
- {
- poComboBox->SetCurSel(iSelection);
- }
-}
-
-CString CPageComboBoxCtrlContent::GetHashString() const
-{
- return CString("CPageComboBoxCtrlContent:")+CPageEditCtrlContent::GetHashString();
-}
\ No newline at end of file
--- a/wingui/PageComboBoxCtrlContent.h
+++ /dev/null
@@ -1,70 +1,0 @@
-// PageComboBoxCtrlContent.h: interface for the CPageComboBoxCtrlContent class.
-// Author: Torsten Landmann
-//
-// is able to save the content of a combo box control including the 3rd state
-// and perform merge operations so that data for several jobs can be
-// merged
-//
-//////////////////////////////////////////////////////////////////////
-
-#if !defined(AFX_PAGECOMBOBOXCTRLCONTENT_H__C245DF24_11A6_11D5_8402_0080C88C25BD__INCLUDED_)
-#define AFX_PAGECOMBOBOXCTRLCONTENT_H__C245DF24_11A6_11D5_8402_0080C88C25BD__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-#include "PageEditCtrlContent.h"
-
-class CPageComboBoxCtrlContent : public CPageEditCtrlContent
- // I'd rather inherit from CPageEditCtrlContent as private but
- // that'd be too complicated since CAbstractPageCtrlContent implements
- // essential behaviour that must still be accessible from outside
-{
-public:
- CPageComboBoxCtrlContent();
- virtual ~CPageComboBoxCtrlContent();
-
- // note: you must not mix selection and text content
- // based management for one combo control to manage
- // at a time
-
- // data for combo controls that you wish to manage
- // based on their selection ids
- void SetContentSelection(int iSelectionId);
- int GetContentSelection() const; // returns a negative value if in 3rd state or in case of errors
-
- // data for combo controls that you wish to manage
- // based on their currently selected/entered texts
- void SetContentText(const CString &oText);
- const CString& GetContentText() const;
- CString& GetContentText();
- // this method is only for drop down combo boxes; it fetches
- // the text of the current selection and applies it via
- // SetCurrentText(const CString&)
- void SetCurComboBoxSelectionText(CComboBox *poComboBox);
-
- // return if the previous setting was modified
- bool ApplyToJob(CString &oNativeJobPropertyTextString) const;
- bool ApplyToJob(long &lNativeJobPropertySelectionLong) const;
-
- // apply to variables that are defined in the class wizard
- void ApplyToComboBoxVariable(int &iSelectionVariable) const;
- void ApplyToComboBoxVariable(CString &oSelectionVariable) const;
-
- // important: this method is only for drop down combo boxes
- // that have been used with the text feature; note
- // that the behaviour is undefined if the string that must
- // be set doesn't exist in the combo box; this includes
- // the empty string that is attempted to be set when
- // the 3rd state is detected
- void ApplyToComboBoxPointer(CComboBox *poComboBox) const;
-
- // implementation of CAbstractPageCtrlContent method
- virtual CString GetHashString() const;
-
-private:
- // this class does not need own data
-};
-
-#endif // !defined(AFX_PAGECOMBOBOXCTRLCONTENT_H__C245DF24_11A6_11D5_8402_0080C88C25BD__INCLUDED_)
--- a/wingui/PageEditCtrlContent.cpp
+++ /dev/null
@@ -1,115 +1,0 @@
-// PageEditCtrlContent.cpp: implementation of the CPageEditCtrlContent class.
-// Author: Torsten Landmann
-//
-//////////////////////////////////////////////////////////////////////
-
-#include "stdafx.h"
-#include "faac_wingui.h"
-#include "PageEditCtrlContent.h"
-#include "WindowUtil.h"
-
-#ifdef _DEBUG
-#undef THIS_FILE
-static char THIS_FILE[]=__FILE__;
-#define new DEBUG_NEW
-#endif
-
-CString CPageEditCtrlContent::s_oEmptyString="";
-
-//////////////////////////////////////////////////////////////////////
-// Construction/Destruction
-//////////////////////////////////////////////////////////////////////
-
-CPageEditCtrlContent::CPageEditCtrlContent()
-{
-}
-
-CPageEditCtrlContent::CPageEditCtrlContent(const CString &oEditCtrlContent):
- m_oEditCtrlContent(oEditCtrlContent)
-{
-}
-
-CPageEditCtrlContent::~CPageEditCtrlContent()
-{
-
-}
-
-void CPageEditCtrlContent::SetContent(const CString &oEditCtrlContent)
-{
- if (oEditCtrlContent.IsEmpty())
- {
- SetIs3rdState(true);
- }
- else
- {
- SetIs3rdState(false);
- m_oEditCtrlContent=oEditCtrlContent;
- }
-}
-
-void CPageEditCtrlContent::SetContent(long lEditCtrlContent, bool bNegativeIs3rdState)
-{
- if (bNegativeIs3rdState && lEditCtrlContent<0)
- {
- SetIs3rdState(true);
- return;
- }
-
- m_oEditCtrlContent.Format("%d", lEditCtrlContent);
- SetIs3rdState(false);
-}
-
-const CString& CPageEditCtrlContent::GetContent() const
-{
- if (Is3rdState())
- {
- return s_oEmptyString;
- }
- else
- {
- return m_oEditCtrlContent;
- }
-}
-
-CString& CPageEditCtrlContent::GetContent()
-{
- if (Is3rdState())
- {
- return s_oEmptyString;
- }
- else
- {
- return m_oEditCtrlContent;
- }
-}
-
-bool CPageEditCtrlContent::ApplyToJob(CString &oNativeJobPropertyString) const
-{
- CString oOld(oNativeJobPropertyString);
- if (!Is3rdState())
- {
- oNativeJobPropertyString=GetContent();
- }
- return oOld!=oNativeJobPropertyString;
-}
-
-bool CPageEditCtrlContent::ApplyToJob(long &lNativeJobPropertyLong) const
-{
- long lOld(lNativeJobPropertyLong);
- if (!Is3rdState())
- {
- CString oContent(GetContent());
- CWindowUtil::FilterString(oContent, "0123456789");
- long lNumber;
- if (sscanf(oContent, "%d", &lNumber)==1)
- {
- lNativeJobPropertyLong=lNumber;
- }
- }
- return lOld!=lNativeJobPropertyLong;
-}
-
-CString CPageEditCtrlContent::GetHashString() const
-{
- return "CPageEditCtrlContent-"+m_oEditCtrlContent;
-}
--- a/wingui/PageEditCtrlContent.h
+++ /dev/null
@@ -1,44 +1,0 @@
-// PageEditCtrlContent.h: interface for the CPageEditCtrlContent class.
-// Author: Torsten Landmann
-//
-// is able to save the content of an edit control including the 3rd state
-// and perform merge operations so that data for several jobs can be
-// merged
-//
-//////////////////////////////////////////////////////////////////////
-
-#if !defined(AFX_PAGEEDITCTRLCONTENT_H__7B47B267_0FF8_11D5_8402_0080C88C25BD__INCLUDED_)
-#define AFX_PAGEEDITCTRLCONTENT_H__7B47B267_0FF8_11D5_8402_0080C88C25BD__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-#include "AbstractPageCtrlContent.h"
-
-class CPageEditCtrlContent : public CAbstractPageCtrlContent
-{
-public:
- CPageEditCtrlContent();
- CPageEditCtrlContent(const CString &oEditCtrlContent);
- virtual ~CPageEditCtrlContent();
-
- // setting content automatically disables the 3rd state
- void SetContent(const CString &oEditCtrlContent);
- void SetContent(long lEditCtrlContent, bool bNegativeIs3rdState=false);
- const CString& GetContent() const;
- CString& GetContent();
-
- // return if the previous setting was modified
- bool ApplyToJob(CString &oNativeJobPropertyString) const;
- bool ApplyToJob(long &lNativeJobPropertyLong) const;
-
- // implementation of CAbstractPageCtrlContent method
- virtual CString GetHashString() const;
-
-private:
- CString m_oEditCtrlContent;
- static CString s_oEmptyString;
-};
-
-#endif // !defined(AFX_PAGEEDITCTRLCONTENT_H__7B47B267_0FF8_11D5_8402_0080C88C25BD__INCLUDED_)
--- a/wingui/PageRadioGroupCtrlContent.cpp
+++ /dev/null
@@ -1,33 +1,0 @@
-// PageRadioGroupCtrlContent.cpp: implementation of the CPageRadioGroupCtrlContent class.
-// Author: Torsten Landmann
-//
-//////////////////////////////////////////////////////////////////////
-
-#include "stdafx.h"
-#include "faac_wingui.h"
-#include "PageRadioGroupCtrlContent.h"
-
-#ifdef _DEBUG
-#undef THIS_FILE
-static char THIS_FILE[]=__FILE__;
-#define new DEBUG_NEW
-#endif
-
-//////////////////////////////////////////////////////////////////////
-// Construction/Destruction
-//////////////////////////////////////////////////////////////////////
-
-CPageRadioGroupCtrlContent::CPageRadioGroupCtrlContent()
-{
-
-}
-
-CPageRadioGroupCtrlContent::~CPageRadioGroupCtrlContent()
-{
-
-}
-
-CString CPageRadioGroupCtrlContent::GetHashString() const
-{
- return CString("CPageRadioGroupCtrlContent:")+CPageEditCtrlContent::GetHashString();
-}
\ No newline at end of file
--- a/wingui/PageRadioGroupCtrlContent.h
+++ /dev/null
@@ -1,38 +1,0 @@
-// PageRadioGroupCtrlContent.h: interface for the CPageRadioGroupCtrlContent class.
-// Author: Torsten Landmann
-//
-// is able to save the content of a radio button group including the 3rd state
-// and perform merge operations so that data for several jobs can be
-// merged
-//
-//////////////////////////////////////////////////////////////////////
-
-#if !defined(AFX_PAGERADIOGROUPCTRLCONTENT_H__9818D045_158E_11D5_8402_0080C88C25BD__INCLUDED_)
-#define AFX_PAGERADIOGROUPCTRLCONTENT_H__9818D045_158E_11D5_8402_0080C88C25BD__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-#include "PageEditCtrlContent.h"
-
-class CPageRadioGroupCtrlContent : public CPageEditCtrlContent
-{
-public:
- CPageRadioGroupCtrlContent();
- virtual ~CPageRadioGroupCtrlContent();
-
- // jobs should only call the SetContent(long) and ApplyToJob(long) methods,
- // which are inherited from CPageEditCtrlContent
-
- void GetFromRadioGroupVariable(int iVariable, long lNumberOfRadiosInGroup) { SetContent(iVariable, true); if (iVariable>=lNumberOfRadiosInGroup) SetIs3rdState(true); }
- void ApplyToRadioGroupVariable(int &iVariable) const { long lContent=-1; ApplyToJob(lContent); iVariable=lContent; }
-
- // implementation of CAbstractPageCtrlContent method
- virtual CString GetHashString() const;
-
-private:
- // have no own data members
-};
-
-#endif // !defined(AFX_PAGERADIOGROUPCTRLCONTENT_H__9818D045_158E_11D5_8402_0080C88C25BD__INCLUDED_)
--- a/wingui/ProcessJobStatusDialog.cpp
+++ /dev/null
@@ -1,211 +1,0 @@
-// ProcessJobStatusDialog.cpp : implementation file
-//
-
-#include "stdafx.h"
-#include "faac_wingui.h"
-#include "ProcessJobStatusDialog.h"
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-#ifndef SW_VIS_CODE
-#define SW_VIS_CODE(bVisible) ((bVisible) ? SW_SHOW : SW_HIDE)
-#endif
-
-CProcessJobStatusDialog *CProcessJobStatusDialog::m_poDialog=0;
-
-/////////////////////////////////////////////////////////////////////////////
-// CProcessJobStatusDialog dialog
-
-
-CProcessJobStatusDialog::CProcessJobStatusDialog(CProcessingStartStopPauseInteractable *poClient, CWnd* pParent /*=NULL*/)
- : CDialog(CProcessJobStatusDialog::IDD, pParent),
- m_poClient(poClient)
-{
- //{{AFX_DATA_INIT(CProcessJobStatusDialog)
- m_oLabelBottomStatusText = _T("");
- m_oLabelTopStatusText = _T("");
- //}}AFX_DATA_INIT
-}
-
-CProcessJobStatusDialog::~CProcessJobStatusDialog()
-{
-}
-
-void CProcessJobStatusDialog::DoDataExchange(CDataExchange* pDX)
-{
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CProcessJobStatusDialog)
- DDX_Control(pDX, IDC_BUTTONPAUSE, m_ctrlButtonPause);
- DDX_Control(pDX, IDC_BUTTONCONTINUE, m_ctrlButtonContinue);
- DDX_Control(pDX, IDC_BUTTONABORT, m_ctrlButtonAbort);
- DDX_Control(pDX, IDC_PROGRESS1, m_ctrlProgressBar);
- DDX_Text(pDX, IDC_LABELBOTTOMSTATUSTEXT, m_oLabelBottomStatusText);
- DDX_Text(pDX, IDC_LABELTOPSTATUSTEXT, m_oLabelTopStatusText);
- //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(CProcessJobStatusDialog, CDialog)
- //{{AFX_MSG_MAP(CProcessJobStatusDialog)
- ON_BN_CLICKED(IDC_BUTTONABORT, OnButtonAbort)
- ON_BN_CLICKED(IDC_BUTTONPAUSE, OnButtonPause)
- ON_BN_CLICKED(IDC_BUTTONCONTINUE, OnButtonContinue)
- ON_BN_CLICKED(IDC_BUTTONMINIMIZEAPP, OnButtonMinimizeApp)
- //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// CProcessJobStatusDialog message handlers
-
-BOOL CProcessJobStatusDialog::OnInitDialog()
-{
- CDialog::OnInitDialog();
-
- // TODO: Add extra initialization here
- m_ctrlProgressBar.SetRange32(0, 10000);
-
- // install a timer to initiiate the processing
- ASSERT(m_poDialog==0);
- m_poDialog=this;
- ::SetTimer(*this, 100, 200, TimerProc);
-
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
-}
-
-void CProcessJobStatusDialog::SetStatus(double dProgress, const CString &oTopStatusText, const CString &oBottomStatusText)
-{
- m_ctrlProgressBar.SetPos((int)dProgress*100);
- m_oLabelTopStatusText=oTopStatusText;
- m_oLabelBottomStatusText=oBottomStatusText;
- UpdateData(FALSE);
-}
-
-void CProcessJobStatusDialog::SetAvailableActions(bool bStop, bool bPause)
-{
- m_ctrlButtonAbort.ShowWindow(SW_VIS_CODE(bStop));
- m_ctrlButtonPause.ShowWindow(SW_VIS_CODE(bPause));
- m_ctrlButtonContinue.ShowWindow(SW_VIS_CODE(bPause));
-}
-
-void CProcessJobStatusDialog::ProcessUserMessages()
-{
- //MSG msg;
- //while (::PeekMessage(&msg, /**this*/0, 0, 0, PM_REMOVE))
- //{
- // ::TranslateMessage(&msg);
- // ::DispatchMessage(&msg);
- //}
-
- // copied from MSDN Topic "Idle Loop Processing"
- MSG msg;
- while ( ::PeekMessage( &msg, NULL, 0, 0, PM_NOREMOVE ) )
- {
- if ( !AfxGetApp()->PumpMessage( ) )
- {
- ASSERT(false);
- //bDoingBackgroundProcessing = FALSE;
- ::PostQuitMessage(0);
- break;
- }
- }
- // let MFC do its idle processing
- LONG lIdle = 0;
- while ( AfxGetApp()->OnIdle(lIdle++ ) )
- ;
- // Perform some background processing here
- // using another call to OnIdle
-
-}
-
-void CProcessJobStatusDialog::ReturnToCaller(bool bSuccess)
-{
- if (bSuccess)
- {
- CDialog::OnOK();
- }
- else
- {
- CDialog::OnCancel();
- }
-}
-
-void CProcessJobStatusDialog::SetAdditionalCaptionInfo(const CString &oAdditionalInfo)
-{
- if (oAdditionalInfo.GetLength()==0) return;
-
- CString oCaption;
- GetWindowText(oCaption);
-
- CString oAddInfo(oAdditionalInfo);
-
- if (oCaption.GetLength()>0)
- {
- // already a caption text there
- oAddInfo=_T(" (")+oAddInfo+")";
- }
-
- if (oCaption.GetLength()<3 || oCaption.Right(3)!="...")
- {
- oCaption+=oAddInfo;
- }
- else
- {
- oCaption.Insert(oCaption.GetLength()-3, oAddInfo);
- }
- SetWindowText(oCaption);
-}
-
-void CALLBACK EXPORT CProcessJobStatusDialog::TimerProc(
- HWND hWnd, // handle of CWnd that called SetTimer
- UINT nMsg, // WM_TIMER
- UINT nIDEvent, // timer identification
- DWORD dwTime // system time
- )
-{
- // kill the timer
- ::KillTimer(hWnd, nIDEvent);
-
- if (m_poDialog==0)
- {
- // ignore timer
- return;
- }
-
- ASSERT(m_poDialog!=0);
-
- // initiate the processing
- CProcessJobStatusDialog *poDialog=m_poDialog;
- m_poDialog=0;
- poDialog->m_poClient->Start(poDialog);
-}
-
-void CProcessJobStatusDialog::OnButtonAbort()
-{
- // TODO: Add your control notification handler code here
- m_poClient->Stop();
-}
-
-void CProcessJobStatusDialog::OnButtonPause()
-{
- // TODO: Add your control notification handler code here
- m_poClient->Pause();
-}
-
-void CProcessJobStatusDialog::OnButtonContinue()
-{
- // TODO: Add your control notification handler code here
- m_poClient->Start(0);
-}
-
-void CProcessJobStatusDialog::OnButtonMinimizeApp()
-{
- // TODO: Add your control notification handler code here
-
- // can't do that like this - don't yet know how to get it restored
- // AfxGetMainWnd()->ShowWindow(SW_MINIMIZE);
-}
--- a/wingui/ProcessJobStatusDialog.h
+++ /dev/null
@@ -1,78 +1,0 @@
-#if !defined(AFX_PROCESSJOBSTATUSDIALOG_H__A1444E8F_1546_11D5_8402_0080C88C25BD__INCLUDED_)
-#define AFX_PROCESSJOBSTATUSDIALOG_H__A1444E8F_1546_11D5_8402_0080C88C25BD__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-// ProcessJobStatusDialog.h : header file
-//
-
-#include "ProcessingStatusDialogInfoFeedbackCallbackInterface.h"
-#include "ProcessingStartStopPauseInteractable.h"
-
-/////////////////////////////////////////////////////////////////////////////
-// CProcessJobStatusDialog dialog
-
-class CProcessJobStatusDialog : public CDialog, public CProcessingStatusDialogInfoFeedbackCallbackInterface
-{
-// Construction
-public:
- CProcessJobStatusDialog(CProcessingStartStopPauseInteractable *poClient, CWnd* pParent = NULL); // standard constructor
- virtual ~CProcessJobStatusDialog();
-
-// Dialog Data
- //{{AFX_DATA(CProcessJobStatusDialog)
- enum { IDD = IDD_PROCESSJOBSTATUSDIALOG };
- CButton m_ctrlButtonPause;
- CButton m_ctrlButtonContinue;
- CButton m_ctrlButtonAbort;
- CProgressCtrl m_ctrlProgressBar;
- CString m_oLabelBottomStatusText;
- CString m_oLabelTopStatusText;
- //}}AFX_DATA
-
- // implementation to interface CProcessingStatusDialogInfoFeedbackCallbackInterface
- virtual void SetStatus(double dProgress, const CString &oTopStatusText, const CString &oBottomStatusText);
- virtual void SetAvailableActions(bool bStop, bool bPause);
- virtual void ProcessUserMessages();
- virtual void ReturnToCaller(bool bSuccess);
- virtual void SetAdditionalCaptionInfo(const CString &oAdditionalInfo);
-
- static CProcessJobStatusDialog *m_poDialog;
- static void CALLBACK EXPORT TimerProc(
- HWND hWnd, // handle of CWnd that called SetTimer
- UINT nMsg, // WM_TIMER
- UINT nIDEvent, // timer identification
- DWORD dwTime // system time
- );
-
-
-
-
-// Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CProcessJobStatusDialog)
- protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
- // Generated message map functions
- //{{AFX_MSG(CProcessJobStatusDialog)
- virtual BOOL OnInitDialog();
- afx_msg void OnButtonAbort();
- afx_msg void OnButtonPause();
- afx_msg void OnButtonContinue();
- afx_msg void OnButtonMinimizeApp();
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-
- CProcessingStartStopPauseInteractable *m_poClient;
-};
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_PROCESSJOBSTATUSDIALOG_H__A1444E8F_1546_11D5_8402_0080C88C25BD__INCLUDED_)
--- a/wingui/ProcessingStartStopPauseInteractable.cpp
+++ /dev/null
@@ -1,28 +1,0 @@
-// ProcessingStartStopPauseInteractable.cpp: implementation of the CProcessingStartStopPauseInteractable class.
-// Author: Torsten Landmann
-//
-//////////////////////////////////////////////////////////////////////
-
-#include "stdafx.h"
-#include "faac_wingui.h"
-#include "ProcessingStartStopPauseInteractable.h"
-
-#ifdef _DEBUG
-#undef THIS_FILE
-static char THIS_FILE[]=__FILE__;
-#define new DEBUG_NEW
-#endif
-
-//////////////////////////////////////////////////////////////////////
-// Construction/Destruction
-//////////////////////////////////////////////////////////////////////
-
-CProcessingStartStopPauseInteractable::CProcessingStartStopPauseInteractable()
-{
-
-}
-
-CProcessingStartStopPauseInteractable::~CProcessingStartStopPauseInteractable()
-{
-
-}
--- a/wingui/ProcessingStartStopPauseInteractable.h
+++ /dev/null
@@ -1,37 +1,0 @@
-// ProcessingStartStopPauseInteractable.h: interface for the CProcessingStartStopPauseInteractable class.
-// Author: Torsten Landmann
-//
-// this class is an interface to start, stop or pause processes (i.e. job processing)
-//
-//////////////////////////////////////////////////////////////////////
-
-#if !defined(AFX_PROCESSINGSTARTSTOPPAUSEINTERACTABLE_H__A1444E90_1546_11D5_8402_0080C88C25BD__INCLUDED_)
-#define AFX_PROCESSINGSTARTSTOPPAUSEINTERACTABLE_H__A1444E90_1546_11D5_8402_0080C88C25BD__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-#include "ProcessingStatusDialogInfoFeedbackCallbackInterface.h"
-
-class CProcessingStartStopPauseInteractable
-{
-public:
- CProcessingStartStopPauseInteractable();
- virtual ~CProcessingStartStopPauseInteractable();
-
- // the flow of the following three methods is as follows:
- // at the beginning there is a call to Start() WITH valid parameter
- // Stop() and Pause() can only occur after Start() has been called at least once;
- // When Stop() has been sent the called object should cleanup;
- // when Pause() has been sent the called object should be idle() until
- // a new call to Start() has taken place; the second call may contain
- // a 0 parameter, so the previous value is to be used
-
- virtual void Start(CProcessingStatusDialogInfoFeedbackCallbackInterface *poInfoTarget)=0;
-
- virtual void Stop()=0;
- virtual void Pause()=0;
-};
-
-#endif // !defined(AFX_PROCESSINGSTARTSTOPPAUSEINTERACTABLE_H__A1444E90_1546_11D5_8402_0080C88C25BD__INCLUDED_)
--- a/wingui/ProcessingStatusDialogInfoFeedbackCallbackInterface.cpp
+++ /dev/null
@@ -1,28 +1,0 @@
-// ProcessingStatusDialogInfoFeedbackCallbackInterface.cpp: implementation of the CProcessingStatusDialogInfoFeedbackCallbackInterface class.
-// Author: Torsten Landmann
-//
-//////////////////////////////////////////////////////////////////////
-
-#include "stdafx.h"
-#include "faac_wingui.h"
-#include "ProcessingStatusDialogInfoFeedbackCallbackInterface.h"
-
-#ifdef _DEBUG
-#undef THIS_FILE
-static char THIS_FILE[]=__FILE__;
-#define new DEBUG_NEW
-#endif
-
-//////////////////////////////////////////////////////////////////////
-// Construction/Destruction
-//////////////////////////////////////////////////////////////////////
-
-CProcessingStatusDialogInfoFeedbackCallbackInterface::CProcessingStatusDialogInfoFeedbackCallbackInterface()
-{
-
-}
-
-CProcessingStatusDialogInfoFeedbackCallbackInterface::~CProcessingStatusDialogInfoFeedbackCallbackInterface()
-{
-
-}
--- a/wingui/ProcessingStatusDialogInfoFeedbackCallbackInterface.h
+++ /dev/null
@@ -1,33 +1,0 @@
-// ProcessingStatusDialogInfoFeedbackCallbackInterface.h: interface for the CProcessingStatusDialogInfoFeedbackCallbackInterface class.
-// Author: Torsten Landmann
-//
-// This class is an interface to enable a process to update the status
-// dialog that displays the progress and further information
-//
-//////////////////////////////////////////////////////////////////////
-
-#if !defined(AFX_PROCESSINGSTATUSDIALOGINFOFEEDBACKCALLBACKINTERFACE_H__A1444E91_1546_11D5_8402_0080C88C25BD__INCLUDED_)
-#define AFX_PROCESSINGSTATUSDIALOGINFOFEEDBACKCALLBACKINTERFACE_H__A1444E91_1546_11D5_8402_0080C88C25BD__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-class CProcessingStatusDialogInfoFeedbackCallbackInterface
-{
-public:
- CProcessingStatusDialogInfoFeedbackCallbackInterface();
- virtual ~CProcessingStatusDialogInfoFeedbackCallbackInterface();
-
- // progress must be given in percent
- virtual void SetStatus(double dProgress, const CString &oTopStatusText, const CString &oBottomStatusText)=0;
- virtual void SetAvailableActions(bool bStop, bool bPause)=0;
- virtual void ProcessUserMessages()=0;
- virtual void SetAdditionalCaptionInfo(const CString &oAdditionalInfo)=0;
-
- // the return value is the status code to return to the caller;
- // if bSuccess then IDOK is returned, IDCANCEL otherwise
- virtual void ReturnToCaller(bool bSuccess)=0;
-};
-
-#endif // !defined(AFX_PROCESSINGSTATUSDIALOGINFOFEEDBACKCALLBACKINTERFACE_H__A1444E91_1546_11D5_8402_0080C88C25BD__INCLUDED_)
--- a/wingui/PropertiesDummyParentDialog.cpp
+++ /dev/null
@@ -1,146 +1,0 @@
-// PropertiesDummyParentDialog.cpp : implementation file
-//
-
-#include "stdafx.h"
-#include "faac_wingui.h"
-#include "PropertiesDummyParentDialog.h"
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-/////////////////////////////////////////////////////////////////////////////
-// CPropertiesDummyParentDialog dialog
-
-
-CPropertiesDummyParentDialog::CPropertiesDummyParentDialog(
- bool bDestroyParentWindowOnDestruction, CWnd* pParent /*=NULL*/):
- m_bDestroyParentWindowOnDestruction(bDestroyParentWindowOnDestruction),
- m_poCurrentPropertiesDialog(0),
- m_bInitialized(false),
- m_bSetContentHasBeenCalled(false)
-{
- //{{AFX_DATA_INIT(CPropertiesDummyParentDialog)
- // NOTE: the ClassWizard will add member initialization here
- //}}AFX_DATA_INIT
-
- Create(CPropertiesDummyParentDialog::IDD, pParent);
-}
-
-CPropertiesDummyParentDialog::~CPropertiesDummyParentDialog()
-{
- DestroyCurrentPropertiesPage();
-
- /*if (m_bDestroyParentWindowOnDestruction)
- {
- if (GetParent()!=0)
- {
- GetParent()->DestroyWindow();
- }
- }*/
-}
-
-void CPropertiesDummyParentDialog::DoDataExchange(CDataExchange* pDX)
-{
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CPropertiesDummyParentDialog)
- DDX_Control(pDX, IDC_LABELDEBUGTAG, m_ctrlLabelDebugTag);
- //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(CPropertiesDummyParentDialog, CDialog)
- //{{AFX_MSG_MAP(CPropertiesDummyParentDialog)
- ON_WM_SIZE()
- //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// CPropertiesDummyParentDialog message handlers
-
-void CPropertiesDummyParentDialog::SetContent(
- const CSupportedPropertyPagesData &oPagesToShow,
- const TItemList<CJob*> &oJobsToConfigure,
- CJobListUpdatable *poListContainer)
-{
- if (m_bInitialized)
- {
- m_bSetContentHasBeenCalled=false;
-
- DestroyCurrentPropertiesPage();
-
- m_poCurrentPropertiesDialog=new CPropertiesTabParentDialog(oPagesToShow, oJobsToConfigure, poListContainer, this);
- ApplyNewSize(m_oCurrentSize);
- m_poCurrentPropertiesDialog->ShowWindow(SW_SHOW);
- }
- else
- {
- m_bSetContentHasBeenCalled=true;
-
- m_oPagesToShowBuffer=oPagesToShow;
- m_oJobsToConfigureBuffer=oJobsToConfigure;
- m_poListContainer=poListContainer;
- }
-}
-
-void CPropertiesDummyParentDialog::DefineDestroyParentWindowOnDestrution(bool bDestroyParentWindowOnDestruction)
-{
- m_bDestroyParentWindowOnDestruction=bDestroyParentWindowOnDestruction;
-}
-
-void CPropertiesDummyParentDialog::OnSize(UINT nType, int cx, int cy)
-{
- CDialog::OnSize(nType, cx, cy);
-
- m_oCurrentSize=CRect(0, 0, cx, cy);
-
- // TODO: Add your message handler code here
- ApplyNewSize(m_oCurrentSize);
-}
-
-BOOL CPropertiesDummyParentDialog::OnInitDialog()
-{
- CDialog::OnInitDialog();
-
- // TODO: Add extra initialization here
- m_bInitialized=true;
-
- if (m_bSetContentHasBeenCalled)
- {
- SetContent(m_oPagesToShowBuffer, m_oJobsToConfigureBuffer, m_poListContainer);
- }
- ApplyNewSize(m_oCurrentSize);
-
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
-}
-
-void CPropertiesDummyParentDialog::ApplyNewSize(const CRect &oSize)
-{
- if (m_bInitialized)
- {
- // dialog has been initialized
-
- if (m_poCurrentPropertiesDialog!=0)
- {
- m_poCurrentPropertiesDialog->MoveWindow(oSize);
- }
-
- CRect oLabelRect;
- m_ctrlLabelDebugTag.GetWindowRect(&oLabelRect);
- CRect oDebugLabelRect(oSize.BottomRight(), oLabelRect.Size());
- oDebugLabelRect.OffsetRect(-oLabelRect.Size().cx, -oLabelRect.Size().cy);
- m_ctrlLabelDebugTag.MoveWindow(oDebugLabelRect);
- }
-}
-
-void CPropertiesDummyParentDialog::DestroyCurrentPropertiesPage()
-{
- if (m_poCurrentPropertiesDialog!=0)
- {
- delete m_poCurrentPropertiesDialog;
- m_poCurrentPropertiesDialog=0;
- }
-}
\ No newline at end of file
--- a/wingui/PropertiesDummyParentDialog.h
+++ /dev/null
@@ -1,76 +1,0 @@
-#if !defined(AFX_PROPERTIESDUMMYPARENTDIALOG_H__442115CA_0FD4_11D5_8402_0080C88C25BD__INCLUDED_)
-#define AFX_PROPERTIESDUMMYPARENTDIALOG_H__442115CA_0FD4_11D5_8402_0080C88C25BD__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-// PropertiesDummyParentDialog.h : header file
-//
-
-#include "SupportedPropertyPagesData.h"
-#include "PropertiesTabParentDialog.h"
-
-/////////////////////////////////////////////////////////////////////////////
-// CPropertiesDummyParentDialog dialog
-
-class CPropertiesDummyParentDialog : public CDialog
-{
-// Construction
-public:
- CPropertiesDummyParentDialog(bool bDestroyParentWindowOnDestruction, CWnd* pParent = NULL); // standard constructor
- virtual ~CPropertiesDummyParentDialog();
-
-// Dialog Data
- //{{AFX_DATA(CPropertiesDummyParentDialog)
- enum { IDD = IDD_PROPERTIESDUMMYPARENTDIALOG };
- CStatic m_ctrlLabelDebugTag;
- //}}AFX_DATA
-
-
-// Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CPropertiesDummyParentDialog)
- protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- //}}AFX_VIRTUAL
-
-public:
-
- void SetContent(const CSupportedPropertyPagesData &oPagesToShow, const TItemList<CJob*> &oJobsToConfigure, CJobListUpdatable *poListContainer);
-
- void DefineDestroyParentWindowOnDestrution(bool bDestroyParentWindowOnDestruction);
-
-// Implementation
-protected:
-
- // Generated message map functions
- //{{AFX_MSG(CPropertiesDummyParentDialog)
- afx_msg void OnSize(UINT nType, int cx, int cy);
- virtual BOOL OnInitDialog();
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-
- bool m_bInitialized;
-
- CPropertiesTabParentDialog *m_poCurrentPropertiesDialog;
-
- // these two members are used if SetContent is called before this
- // dialog has been initialized
- bool m_bSetContentHasBeenCalled;
- CSupportedPropertyPagesData m_oPagesToShowBuffer;
- TItemList<CJob*> m_oJobsToConfigureBuffer;
- CJobListUpdatable *m_poListContainer;
-
- bool m_bDestroyParentWindowOnDestruction;
-
- CRect m_oCurrentSize;
-
- void ApplyNewSize(const CRect &oSize);
-
- void DestroyCurrentPropertiesPage();
-};
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_PROPERTIESDUMMYPARENTDIALOG_H__442115CA_0FD4_11D5_8402_0080C88C25BD__INCLUDED_)
--- a/wingui/PropertiesTabParentDialog.cpp
+++ /dev/null
@@ -1,238 +1,0 @@
-// PropertiesTabParentDialog.cpp : implementation file
-// Author: Torsten Landmann
-//
-///////////////////////////////////////////////////////
-
-#include "stdafx.h"
-#include "faac_wingui.h"
-#include "PropertiesTabParentDialog.h"
-#include "EncoderGeneralPageDialog.h"
-#include "EncoderQualityPageDialog.h"
-#include "EncoderId3PageDialog.h"
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-int CPropertiesTabParentDialog::s_iLastTabPage=0;
-
-/////////////////////////////////////////////////////////////////////////////
-// CPropertiesTabParentDialog dialog
-
-
-CPropertiesTabParentDialog::CPropertiesTabParentDialog(
- const CSupportedPropertyPagesData &oPagesToShow,
- const TItemList<CJob*> &oJobsToConfigure,
- CJobListUpdatable *poListContainer,
- CWnd* pParent /*=NULL*/):
- m_oPagesToShow(oPagesToShow),
- m_oJobsToConfigure(oJobsToConfigure),
- m_bTabsAdded(false),
- m_bInitialized(false),
- m_poCurrentPage(0),
- m_poListContainer(poListContainer)
-{
- //{{AFX_DATA_INIT(CPropertiesTabParentDialog)
- // NOTE: the ClassWizard will add member initialization here
- //}}AFX_DATA_INIT
-
- Create(CPropertiesTabParentDialog::IDD, pParent);
-}
-
-CPropertiesTabParentDialog::~CPropertiesTabParentDialog()
-{
- if (m_poCurrentPage!=0)
- {
- delete m_poCurrentPage;
- m_poCurrentPage=0;
- }
-}
-
-void CPropertiesTabParentDialog::DoDataExchange(CDataExchange* pDX)
-{
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CPropertiesTabParentDialog)
- DDX_Control(pDX, IDC_LABELDEBUGTAG, m_ctrlLabelDebugTag);
- DDX_Control(pDX, IDC_LABELNOSELECTION, m_ctrlLabelNoSelection);
- DDX_Control(pDX, IDC_TAB1, m_ctrlTab);
- //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(CPropertiesTabParentDialog, CDialog)
- //{{AFX_MSG_MAP(CPropertiesTabParentDialog)
- ON_WM_SIZE()
- ON_NOTIFY(TCN_SELCHANGE, IDC_TAB1, OnSelchangeTab1)
- //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// CPropertiesTabParentDialog message handlers
-
-
-BOOL CPropertiesTabParentDialog::OnInitDialog()
-{
- CDialog::OnInitDialog();
-
- // TODO: Add extra initialization here
- m_bInitialized=true;
-
- ApplyNewSize(m_oCurrentSize, m_oCurrentPageSize);
-
- if (m_oPagesToShow.GetNumberOfPages()>0)
- {
- m_ctrlTab.ShowWindow(SW_SHOW);
- m_ctrlLabelNoSelection.ShowWindow(SW_HIDE);
-
- AddTabs();
-
- // restore last selected tab page
- if (s_iLastTabPage>=m_oPagesToShow.GetNumberOfPages())
- {
- s_iLastTabPage=0;
- }
- m_ctrlTab.SetCurSel(s_iLastTabPage);
- ShowPage(s_iLastTabPage);
- }
- else
- {
- m_ctrlTab.ShowWindow(SW_HIDE);
- m_ctrlLabelNoSelection.ShowWindow(SW_SHOW);
- }
-
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
-}
-
-void CPropertiesTabParentDialog::OnSize(UINT nType, int cx, int cy)
-{
- CDialog::OnSize(nType, cx, cy);
-
- m_oCurrentSize=CRect(0, 0, cx, cy);
- m_oCurrentPageSize=m_oCurrentSize;
- m_oCurrentPageSize.left+=6;
- m_oCurrentPageSize.top+=25;
- m_oCurrentPageSize.right-=6;
- m_oCurrentPageSize.bottom-=6;
-
- ApplyNewSize(m_oCurrentSize, m_oCurrentPageSize);
-}
-
-void CPropertiesTabParentDialog::AddTabs()
-{
- if (m_bTabsAdded) return;
-
- // first insert the tabs
-
- int iCurTabPage=0;
- m_oPagesToShow.Sort();
- CBListReader oReader(m_oPagesToShow);
- EPropertyPageType eCurrentPageType;
- while (m_oPagesToShow.GetNextElemContent(oReader, eCurrentPageType))
- {
- if (AddTab(eCurrentPageType, iCurTabPage))
- {
- iCurTabPage++;
- }
- }
- m_bTabsAdded=true;
-}
-
-bool CPropertiesTabParentDialog::AddTab(EPropertyPageType ePageType, int iTabId)
-{
- // create the tab page
- m_ctrlTab.InsertItem(iTabId, CSupportedPropertyPagesData::GetPageDescriptionShort(ePageType));
-
- return true;
-}
-
-
-bool CPropertiesTabParentDialog::ShowPage(int iId)
-{
- if (m_poCurrentPage!=0)
- {
- delete m_poCurrentPage;
- m_poCurrentPage=0;
- }
-
- EPropertyPageType ePageType;
- if (!m_oPagesToShow.GetPosContent(iId, ePageType))
- {
- // to many tabs
- ASSERT(false);
- return false;
- }
-
- switch (ePageType)
- {
- case ePageTypeEncoderGeneral:
- {
- m_poCurrentPage=new CEncoderGeneralPageDialog(m_oJobsToConfigure, m_poListContainer, this);
- break;
- }
- case ePageTypeEncoderQuality:
- {
- m_poCurrentPage=new CEncoderQualityPageDialog(m_oJobsToConfigure, m_poListContainer, this);
- break;
- }
- case ePageTypeEncoderID3:
- {
- m_poCurrentPage=new CEncoderId3PageDialog(m_oJobsToConfigure, m_poListContainer, this);
- break;
- }
- default:
- {
- // unknown type of property page
- ASSERT(false);
- return false;
- }
- }
- m_poCurrentPage->MoveWindow(m_oCurrentPageSize);
- m_poCurrentPage->ShowWindow(SW_SHOW);
-
- s_iLastTabPage=iId;
-
- return true;
-}
-
-void CPropertiesTabParentDialog::OnSelchangeTab1(NMHDR* pNMHDR, LRESULT* pResult)
-{
- // TODO: Add your control notification handler code here
-
- ShowPage(m_ctrlTab.GetCurSel());
-
- *pResult = 0;
-}
-
-void CPropertiesTabParentDialog::ApplyNewSize(const CRect &oSize, const CRect &oPageSize)
-{
- // TODO: Add your message handler code here
- if (m_bInitialized)
- {
- // resize the tab control
- m_ctrlTab.MoveWindow(oSize);
-
- // resize the page
- if (m_poCurrentPage!=0)
- {
- m_poCurrentPage->MoveWindow(oPageSize);
- }
-
- // move debug tag label
- CRect oLabelRect;
- m_ctrlLabelDebugTag.GetWindowRect(&oLabelRect);
- CRect oDebugLabelRect(oSize.BottomRight(), oLabelRect.Size());
- oDebugLabelRect.OffsetRect(-oLabelRect.Size().cx, -oLabelRect.Size().cy);
- m_ctrlLabelDebugTag.MoveWindow(oDebugLabelRect);
-
- // move no selection label
- m_ctrlLabelNoSelection.GetWindowRect(oLabelRect);
- CPoint oCurLabelCenter(oLabelRect.CenterPoint());
- CPoint oDesiredLabelCenter(oSize.CenterPoint());
- CPoint oOffset(oDesiredLabelCenter-oCurLabelCenter);
- oLabelRect.OffsetRect(oOffset);
- m_ctrlLabelNoSelection.MoveWindow(oLabelRect);
- }
-}
--- a/wingui/PropertiesTabParentDialog.h
+++ /dev/null
@@ -1,79 +1,0 @@
-#if !defined(AFX_PROPERTIESTABPARENTDIALOG_H__442115C1_0FD4_11D5_8402_0080C88C25BD__INCLUDED_)
-#define AFX_PROPERTIESTABPARENTDIALOG_H__442115C1_0FD4_11D5_8402_0080C88C25BD__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-// PropertiesTabParentDialog.h : header file
-//
-
-#include "SupportedPropertyPagesData.h"
-#include "TItemList.h"
-#include "Job.h"
-#include "JobListUpdatable.h"
-
-/////////////////////////////////////////////////////////////////////////////
-// CPropertiesTabParentDialog dialog
-
-class CPropertiesTabParentDialog : public CDialog
-{
-// Construction
-public:
- CPropertiesTabParentDialog(const CSupportedPropertyPagesData &oPagesToShow, const TItemList<CJob*> &oJobsToConfigure, CJobListUpdatable *poListContainer, CWnd* pParent = NULL); // standard constructor
- virtual ~CPropertiesTabParentDialog();
-
-// Dialog Data
- //{{AFX_DATA(CPropertiesTabParentDialog)
- enum { IDD = IDD_PROPERTIESTABPARENTDIALOG };
- CStatic m_ctrlLabelDebugTag;
- CStatic m_ctrlLabelNoSelection;
- CTabCtrl m_ctrlTab;
- //}}AFX_DATA
-
-
-// Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CPropertiesTabParentDialog)
- protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
- // Generated message map functions
- //{{AFX_MSG(CPropertiesTabParentDialog)
- virtual BOOL OnInitDialog();
- afx_msg void OnSize(UINT nType, int cx, int cy);
- afx_msg void OnSelchangeTab1(NMHDR* pNMHDR, LRESULT* pResult);
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-
-private:
- CSupportedPropertyPagesData m_oPagesToShow;
- TItemList<CJob*> m_oJobsToConfigure;
- CJobListUpdatable *m_poListContainer;
-
- // if this dialog has already been initialized
- bool m_bInitialized;
-
- bool m_bTabsAdded;
- void AddTabs();
- bool AddTab(EPropertyPageType ePageType, int iTabId); // also creates the tab page; returns false in case of errors
- bool ShowPage(int iId);
-
- CDialog *m_poCurrentPage;
-
- CRect m_oCurrentSize;
- CRect m_oCurrentPageSize;
-
- // this is just saved for the user's convenience
- static int s_iLastTabPage;
-
- void ApplyNewSize(const CRect &oSize, const CRect &oPageSize);
-};
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_PROPERTIESTABPARENTDIALOG_H__442115C1_0FD4_11D5_8402_0080C88C25BD__INCLUDED_)
--- a/wingui/ReadMe.txt
+++ /dev/null
@@ -1,88 +1,0 @@
-========================================================================
- MICROSOFT FOUNDATION CLASS LIBRARY : faac_wingui
-========================================================================
-
-
-AppWizard has created this faac_wingui application for you. This application
-not only demonstrates the basics of using the Microsoft Foundation classes
-but is also a starting point for writing your application.
-
-This file contains a summary of what you will find in each of the files that
-make up your faac_wingui application.
-
-faac_wingui.dsp
- This file (the project file) contains information at the project level and
- is used to build a single project or subproject. Other users can share the
- project (.dsp) file, but they should export the makefiles locally.
-
-faac_wingui.h
- This is the main header file for the application. It includes other
- project specific headers (including Resource.h) and declares the
- CFaac_winguiApp application class.
-
-faac_wingui.cpp
- This is the main application source file that contains the application
- class CFaac_winguiApp.
-
-faac_wingui.rc
- This is a listing of all of the Microsoft Windows resources that the
- program uses. It includes the icons, bitmaps, and cursors that are stored
- in the RES subdirectory. This file can be directly edited in Microsoft
- Visual C++.
-
-faac_wingui.clw
- This file contains information used by ClassWizard to edit existing
- classes or add new classes. ClassWizard also uses this file to store
- information needed to create and edit message maps and dialog data
- maps and to create prototype member functions.
-
-res\faac_wingui.ico
- This is an icon file, which is used as the application's icon. This
- icon is included by the main resource file faac_wingui.rc.
-
-res\faac_wingui.rc2
- This file contains resources that are not edited by Microsoft
- Visual C++. You should place all resources not editable by
- the resource editor in this file.
-
-
-
-
-/////////////////////////////////////////////////////////////////////////////
-
-AppWizard creates one dialog class:
-
-faac_winguiDlg.h, faac_winguiDlg.cpp - the dialog
- These files contain your CFaac_winguiDlg class. This class defines
- the behavior of your application's main dialog. The dialog's
- template is in faac_wingui.rc, which can be edited in Microsoft
- Visual C++.
-
-
-/////////////////////////////////////////////////////////////////////////////
-Other standard files:
-
-StdAfx.h, StdAfx.cpp
- These files are used to build a precompiled header (PCH) file
- named faac_wingui.pch and a precompiled types file named StdAfx.obj.
-
-Resource.h
- This is the standard header file, which defines new resource IDs.
- Microsoft Visual C++ reads and updates this file.
-
-/////////////////////////////////////////////////////////////////////////////
-Other notes:
-
-AppWizard uses "TODO:" to indicate parts of the source code you
-should add to or customize.
-
-If your application uses MFC in a shared DLL, and your application is
-in a language other than the operating system's current language, you
-will need to copy the corresponding localized resources MFC42XXX.DLL
-from the Microsoft Visual C++ CD-ROM onto the system or system32 directory,
-and rename it to be MFCLOC.DLL. ("XXX" stands for the language abbreviation.
-For example, MFC42DEU.DLL contains resources translated to German.) If you
-don't do this, some of the UI elements of your application will remain in the
-language of the operating system.
-
-/////////////////////////////////////////////////////////////////////////////
--- a/wingui/RecursiveDirectoryTraverser.cpp
+++ /dev/null
@@ -1,193 +1,0 @@
-// RecursiveDirectoryTraverser.cpp: implementation of the CRecursiveDirectoryTraverser class.
-//
-//////////////////////////////////////////////////////////////////////
-
-#include "stdafx.h"
-#include "faac_wingui.h"
-#include "RecursiveDirectoryTraverser.h"
-#include "FilePathCalc.h"
-
-#ifdef _DEBUG
-#undef THIS_FILE
-static char THIS_FILE[]=__FILE__;
-#define new DEBUG_NEW
-#endif
-
-//////////////////////////////////////////////////////////////////////
-// Construction/Destruction
-//////////////////////////////////////////////////////////////////////
-
-CRecursiveDirectoryTraverser::CRecursiveDirectoryTraverser()
-{
-
-}
-
-CRecursiveDirectoryTraverser::~CRecursiveDirectoryTraverser()
-{
-
-}
-
-int CRecursiveDirectoryTraverser::CountMatchingFiles(const CString &oFilterString)
-{
- int iToReturn=0;
-
- CFileFind oFileFind;
- CString oSearchMask=oFilterString;
-
- if (oFileFind.FindFile(oSearchMask))
- {
- BOOL bHaveMoreFiles;
- do
- {
- bHaveMoreFiles=oFileFind.FindNextFile();
- iToReturn++;
- } while (bHaveMoreFiles);
- }
-
- oFileFind.Close();
-
- return iToReturn;
-}
-
-TItemList<CString> CRecursiveDirectoryTraverser::FindFiles(const CString &oRootDirectory, const CString &oFileNameFilter, bool bRecursive, bool bAcceptDirectories)
-{
- TItemList<CString> oToReturn;
- CString oRootDir(oRootDirectory);
- if (!CFilePathCalc::MakePath(oRootDir, true) || !CFilePathCalc::IsValidFileMask(oFileNameFilter))
- {
- CString oError;
- oError.Format(IDS_SearchParametersInvalid, oRootDir, oFileNameFilter);
- AfxMessageBox(oError, MB_OK | MB_ICONSTOP);
- return oToReturn;
- }
-
- CFileFind oFileFind;
- CString oSearchMask=
- // "c:\\eigene dateien\\standard.apf";
- oRootDir+oFileNameFilter;
-
-
- if (oFileFind.FindFile(oSearchMask))
- {
- CString oFileName;
- BOOL bHaveMoreFiles;
- do
- {
- bHaveMoreFiles=oFileFind.FindNextFile();
- if (bAcceptDirectories || !oFileFind.IsDirectory())
- {
- oFileName=oFileFind.GetFilePath();
- oToReturn.AddNewElem(oFileName);
- }
- } while (bHaveMoreFiles);
- }
-
- oFileFind.Close();
-
- // if requested traverse child directories
- if (bRecursive)
- {
- oSearchMask=oRootDir+"*";
- if (oFileFind.FindFile(oSearchMask))
- {
- CString oFileName;
- BOOL bHaveMoreFiles;
- do
- {
- bHaveMoreFiles=oFileFind.FindNextFile();
- if (oFileFind.IsDirectory())
- {
- if (oFileFind.GetFileName()!="." &&
- oFileFind.GetFileName()!="..")
- {
- oToReturn+=FindFiles(oFileFind.GetFilePath(), oFileNameFilter, bRecursive);
- }
- }
- } while (bHaveMoreFiles);
- }
- }
-
- return oToReturn;
-}
-
-bool CRecursiveDirectoryTraverser::MakeSureDirectoryExists(const CString &oDirectoryPath)
-{
- CString oLocalPath(oDirectoryPath);
- CFilePathCalc::MakePath(oLocalPath);
-
- // first split the desired path in existing and "creatable" path
- CString oExistingPath;
- CString oCreatablePath;
- {
- oLocalPath.Delete(oLocalPath.GetLength()-1);
- while (CountMatchingFiles(oLocalPath)<1)
- {
- int iLastBackslashPos=oLocalPath.ReverseFind('\\');
- if (iLastBackslashPos>=0)
- {
- int iLength=oLocalPath.GetLength();
- oLocalPath.Delete(iLastBackslashPos, iLength-iLastBackslashPos);
- }
- else
- {
- // no more backslashes
- oCreatablePath=oDirectoryPath;
- break;
- }
- }
- if (oCreatablePath.IsEmpty())
- {
- // must determine the path to create
- oExistingPath=oLocalPath;
- CFilePathCalc::MakePath(oExistingPath, true);
- oCreatablePath=oDirectoryPath;
- CFilePathCalc::MakePath(oCreatablePath, true);
-
- // now we must remove directories from oCreatablePath as long
- // the string matches with oExistingPath
- long lExistingPos=0;
- while (!oCreatablePath.IsEmpty() &&
- !(lExistingPos==oExistingPath.GetLength()) &&
- oExistingPath.GetAt(lExistingPos)==oCreatablePath[0])
- {
- lExistingPos++;
- oCreatablePath.Delete(0);
- }
-
- // now the two paths are complete and we can begin creating the
- // directories
- while (!oCreatablePath.IsEmpty())
- {
- if (!CreateOneDirectory(oExistingPath, oCreatablePath))
- {
- // XXX might be useful to clean up already created directories
- // here
- return false;
- }
- }
- }
- }
- return true;
-}
-
-bool CRecursiveDirectoryTraverser::CreateOneDirectory(CString &oExistingPath, CString &oCreatablePath)
-{
- // extract the first substring from the creatable path
- int iBackslashpos=oCreatablePath.Find('\\');
- if (iBackslashpos<=0) return false;
-
- CString oNextDirectoryToCreate(oCreatablePath.Left(iBackslashpos));
-
- // first try to create the directory
- if (!::CreateDirectory(
- oExistingPath+oNextDirectoryToCreate, 0))
- {
- return false;
- }
-
- // directory was successfully created
- oCreatablePath.Delete(0, iBackslashpos+1);
- oExistingPath+=oNextDirectoryToCreate+"\\";
-
- return true;
-}
\ No newline at end of file
--- a/wingui/RecursiveDirectoryTraverser.h
+++ /dev/null
@@ -1,58 +1,0 @@
-// RecursiveDirectoryTraverser.h: interface for the CRecursiveDirectoryTraverser class.
-// Author: Torsten Landmann
-//
-// This class is made for finding files within a directory tree.
-//
-//////////////////////////////////////////////////////////////////////
-
-#if !defined(AFX_RECURSIVEDIRECTORYTRAVERSER_H__99D7AE61_17EB_11D5_8402_0080C88C25BD__INCLUDED_)
-#define AFX_RECURSIVEDIRECTORYTRAVERSER_H__99D7AE61_17EB_11D5_8402_0080C88C25BD__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-#include "TItemList.h"
-
-class CRecursiveDirectoryTraverser
-{
-public:
- CRecursiveDirectoryTraverser();
- virtual ~CRecursiveDirectoryTraverser();
-
- // the filter string may be a directory name, a file, or a directory
- // name with a file filter;
- // returns -1 in case of errors
- static int CountMatchingFiles(const CString &oFilterString);
-
- // this method finds all files that are in the specified directory
- // and match the filter; it can walk recursively through the entire
- // subtree returning all files in the subtree that match the filter;
- // in this case directory names are NOT matched against the filter;
- // return value: a list of complete paths of the files found;
- // this method displays error messages and returns an empty list in case
- // of errors; if bAcceptDirectories is true also directories that match
- // the filter will be returned
- static TItemList<CString> FindFiles(const CString &oRootDirectory, const CString &oFileNameFilter, bool bRecursive, bool bAcceptDirectories=false);
-
- // returns if the directory was found or could be created. if false is
- // returned this mostly means that there is a concurring file to
- // the first directory that needs to be created
- static bool MakeSureDirectoryExists(const CString &oDirectoryPath);
-
-private:
-
- // example:
- // before:
- // oExistingPath=="c:\somewhere\hello\"
- // oCreatablePath="somewhereelse\super\"
- // after:
- // oExistingPath=="c:\somewhere\hello\somewhereelse"
- // oCreatablePath="super\"
- //////
- // the method physically creates the directory on the disk;
- // returns false in case of errors
- static bool CreateOneDirectory(CString &oExistingPath, CString &oCreatablePath);
-};
-
-#endif // !defined(AFX_RECURSIVEDIRECTORYTRAVERSER_H__99D7AE61_17EB_11D5_8402_0080C88C25BD__INCLUDED_)
--- a/wingui/SourceTargetFilePair.cpp
+++ /dev/null
@@ -1,141 +1,0 @@
-// SourceTargetFilePair.cpp: implementation of the CSourceTargetFilePair class.
-// Author: Torsten Landmann
-//
-//////////////////////////////////////////////////////////////////////
-
-#include "stdafx.h"
-#include "faac_wingui.h"
-#include "SourceTargetFilePair.h"
-#include "FilePathCalc.h"
-
-#ifdef _DEBUG
-#undef THIS_FILE
-static char THIS_FILE[]=__FILE__;
-#define new DEBUG_NEW
-#endif
-
-//////////////////////////////////////////////////////////////////////
-// Construction/Destruction
-//////////////////////////////////////////////////////////////////////
-
-CSourceTargetFilePair::CSourceTargetFilePair()
-{
-
-}
-
-CSourceTargetFilePair::CSourceTargetFilePair(const CString &oSourceFileDirectory, const CString &oSourceFileName, const CString &oTargetFileDirectory, const CString &oTargetFileName):
- m_oSourceFileDirectory(oSourceFileName),
- m_oSourceFileName(oSourceFileName),
- m_oTargetFileDirectory(oTargetFileDirectory),
- m_oTargetFileName(oTargetFileName)
-{
-}
-
-CSourceTargetFilePair::CSourceTargetFilePair(const CString &oSourceFilePath, const CString &oTargetFilePath)
-{
- bool bSuccess=true;
-
- m_oSourceFileDirectory=oSourceFilePath;
- bSuccess&=SetCompleteSourceFilePath(oSourceFilePath);
- bSuccess&=SetCompleteTargetFilePath(oTargetFilePath);
-
- ASSERT(bSuccess);
-}
-
-CSourceTargetFilePair::CSourceTargetFilePair(const CSourceTargetFilePair &oSource)
-{
- *this=oSource;
-}
-
-CSourceTargetFilePair::~CSourceTargetFilePair()
-{
-
-}
-
-CString CSourceTargetFilePair::GetCompleteSourceFilePath() const
-{
- CString oPath(GetSourceFileDirectory());
- CFilePathCalc::MakePath(oPath);
- return oPath+GetSourceFileName();
-}
-
-CString CSourceTargetFilePair::GetCompleteTargetFilePath() const
-{
- CString oPath(GetTargetFileDirectory());
- CFilePathCalc::MakePath(oPath);
- return oPath+GetTargetFileName();
-}
-
-bool CSourceTargetFilePair::SetCompleteSourceFilePath(const CString &oPath)
-{
- bool bSuccess=true;
-
- m_oSourceFileDirectory=oPath;
- bSuccess&=CFilePathCalc::MakePath(m_oSourceFileDirectory);
- bSuccess&=CFilePathCalc::ExtractFileName(oPath, m_oSourceFileName);
-
- return bSuccess;
-}
-
-bool CSourceTargetFilePair::SetCompleteTargetFilePath(const CString &oPath)
-{
- bool bSuccess=true;
-
- m_oTargetFileDirectory=oPath;
- bSuccess&=CFilePathCalc::MakePath(m_oTargetFileDirectory);
- bSuccess&=CFilePathCalc::ExtractFileName(oPath, m_oTargetFileName);
-
- return bSuccess;
-}
-
-CSourceTargetFilePair& CSourceTargetFilePair::operator=(const CSourceTargetFilePair &oRight)
-{
- m_oSourceFileDirectory=oRight.m_oSourceFileDirectory;
- m_oSourceFileName=oRight.m_oSourceFileName;
-
- m_oTargetFileDirectory=oRight.m_oTargetFileDirectory;
- m_oTargetFileName=oRight.m_oTargetFileName;
-
- return *this;
-}
-
-bool CSourceTargetFilePair::PutToArchive(CArchive &oArchive) const
-{
- // put a class version flag
- int iVersion=1;
- oArchive << iVersion;
-
- oArchive << m_oSourceFileDirectory;
- oArchive << m_oSourceFileName;
-
- oArchive << m_oTargetFileDirectory;
- oArchive << m_oTargetFileName;
-
- return true;
-}
-
-bool CSourceTargetFilePair::GetFromArchive(CArchive &oArchive)
-{
- // fetch the class version flag
- int iVersion;
- oArchive >> iVersion;
-
- switch (iVersion)
- {
- case 1:
- {
- oArchive >> m_oSourceFileDirectory;
- oArchive >> m_oSourceFileName;
-
- oArchive >> m_oTargetFileDirectory;
- oArchive >> m_oTargetFileName;
-
- return true;
- }
- default:
- {
- // unknown file format version
- return false;
- }
- }
-}
\ No newline at end of file
--- a/wingui/SourceTargetFilePair.h
+++ /dev/null
@@ -1,64 +1,0 @@
-// SourceTargetFilePair.h: interface for the CSourceTargetFilePair class.
-// Author: Torsten Landmann
-//
-// encapsulates the source and target information of an encoding or
-// decoding job
-//
-//////////////////////////////////////////////////////////////////////
-
-#if !defined(AFX_SOURCETARGETFILEPAIR_H__DFE38E71_0E81_11D5_8402_0080C88C25BD__INCLUDED_)
-#define AFX_SOURCETARGETFILEPAIR_H__DFE38E71_0E81_11D5_8402_0080C88C25BD__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-#include "FilePathCalc.h"
-#include "FileSerializable.h"
-
-class CSourceTargetFilePair : public CFileSerializable
-{
-public:
- CSourceTargetFilePair();
- CSourceTargetFilePair(const CString &oSourceFileDirectory, const CString &oSourceFileName, const CString &oTargetFileDirectory, const CString &oTargetFileName);
- CSourceTargetFilePair(const CString &oSourceFilePath, const CString &oTargetFilePath);
- CSourceTargetFilePair(const CSourceTargetFilePair &oSource); // copy constructor
- virtual ~CSourceTargetFilePair();
-
- // property getters
- const CString& GetSourceFileDirectory() const { return m_oSourceFileDirectory; }
- CString& GetSourceFileDirectory() { return m_oSourceFileDirectory; }
- const CString& GetSourceFileName() const { return m_oSourceFileName; }
- CString& GetSourceFileName() { return m_oSourceFileName; }
- const CString& GetTargetFileDirectory() const { return m_oTargetFileDirectory; }
- CString& GetTargetFileDirectory() { return m_oTargetFileDirectory; }
- const CString& GetTargetFileName() const { return m_oTargetFileName; }
- CString& GetTargetFileName() { return m_oTargetFileName; }
-
- // property setters
- void SetSourceFileDirectory(const CString& oSourceFileDirectory) { m_oSourceFileDirectory=oSourceFileDirectory; CFilePathCalc::MakePath(m_oSourceFileDirectory); }
- void SetSourceFileName(const CString& oSourceFileName) { m_oSourceFileName=oSourceFileName; }
- void SetTargetFileDirectory(const CString& oTargetFileDirectory) { m_oTargetFileDirectory=oTargetFileDirectory; CFilePathCalc::MakePath(m_oTargetFileDirectory); }
- void SetTargetFileName(const CString& oTargetFileName) { m_oTargetFileName=oTargetFileName; }
-
- // functionality
- CString GetCompleteSourceFilePath() const;
- CString GetCompleteTargetFilePath() const;
- bool SetCompleteSourceFilePath(const CString &oPath); // returns false if the argument could not be evaluated properly
- bool SetCompleteTargetFilePath(const CString &oPath); // returns false if the argument could not be evaluated properly
-
- CSourceTargetFilePair& operator=(const CSourceTargetFilePair &oRight);
-
- // implementations to CFileSerializable
- virtual bool PutToArchive(CArchive &oArchive) const;
- virtual bool GetFromArchive(CArchive &oArchive);
-
-private:
- CString m_oSourceFileDirectory;
- CString m_oSourceFileName;
-
- CString m_oTargetFileDirectory;
- CString m_oTargetFileName;
-};
-
-#endif // !defined(AFX_SOURCETARGETFILEPAIR_H__DFE38E71_0E81_11D5_8402_0080C88C25BD__INCLUDED_)
--- a/wingui/StdAfx.cpp
+++ /dev/null
@@ -1,8 +1,0 @@
-// stdafx.cpp : source file that includes just the standard includes
-// faac_wingui.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-
-
--- a/wingui/StdAfx.h
+++ /dev/null
@@ -1,27 +1,0 @@
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#if !defined(AFX_STDAFX_H__DFE38E69_0E81_11D5_8402_0080C88C25BD__INCLUDED_)
-#define AFX_STDAFX_H__DFE38E69_0E81_11D5_8402_0080C88C25BD__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
-
-#include <afxwin.h> // MFC core and standard components
-#include <afxext.h> // MFC extensions
-#include <afxdisp.h> // MFC Automation classes
-#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
-#ifndef _AFX_NO_AFXCMN_SUPPORT
-#include <afxcmn.h> // MFC support for Windows Common Controls
-#endif // _AFX_NO_AFXCMN_SUPPORT
-
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_STDAFX_H__DFE38E69_0E81_11D5_8402_0080C88C25BD__INCLUDED_)
--- a/wingui/SupportedPropertyPagesData.cpp
+++ /dev/null
@@ -1,121 +1,0 @@
-// SupportedPropertyPagesData.cpp: implementation of the CSupportedPropertyPagesData class.
-//
-//////////////////////////////////////////////////////////////////////
-
-#include "stdafx.h"
-#include "faac_wingui.h"
-#include "SupportedPropertyPagesData.h"
-
-#ifdef _DEBUG
-#undef THIS_FILE
-static char THIS_FILE[]=__FILE__;
-#define new DEBUG_NEW
-#endif
-
-//////////////////////////////////////////////////////////////////////
-// Construction/Destruction
-//////////////////////////////////////////////////////////////////////
-
-CSupportedPropertyPagesData::CSupportedPropertyPagesData()
-{
-
-}
-
-CSupportedPropertyPagesData::CSupportedPropertyPagesData(
- const CSupportedPropertyPagesData &oSource)
-{
- *this=oSource;
-}
-
-CSupportedPropertyPagesData::~CSupportedPropertyPagesData()
-{
-
-}
-
-void CSupportedPropertyPagesData::ShowPage(EPropertyPageType ePageType)
-{
- if (!IsPageVisible(ePageType))
- {
- AddNewElem(ePageType);
- }
-}
-
-void CSupportedPropertyPagesData::HidePage(EPropertyPageType ePageType)
-{
- DeleteAllElemsWithContent(ePageType);
-}
-
-bool CSupportedPropertyPagesData::IsPageVisible(EPropertyPageType ePageType) const
-{
- return FindContent(ePageType);
-}
-
-CSupportedPropertyPagesData& CSupportedPropertyPagesData::operator=(const CSupportedPropertyPagesData &oRight)
-{
- // call inherited version
- TItemList<EPropertyPageType>::operator=(oRight);
-
- // have no own members to copy
- return *this;
-}
-
-CSupportedPropertyPagesData CSupportedPropertyPagesData::operator*(
- const CSupportedPropertyPagesData &oRight)
-{
- CSupportedPropertyPagesData oToReturn(*this);
- oToReturn*=oRight;
- return oToReturn;
-}
-
-CSupportedPropertyPagesData& CSupportedPropertyPagesData::operator*=(
- const CSupportedPropertyPagesData &oRight)
-{
- if (this!=&oRight)
- {
- // call inherited version
- TItemList<EPropertyPageType>::operator*=(oRight);
-
- // have no own members to intersect
- }
- return *this;
-}
-
-long CSupportedPropertyPagesData::GetNumberOfPages() const
-{
- TItemList<EPropertyPageType> oTempList(*this);
- oTempList.RemoveDoubleElements();
-
- return oTempList.GetNumber();
-}
-
-CString CSupportedPropertyPagesData::GetPageDescriptionShort(EPropertyPageType ePageType)
-{
- int iStringId=0;
- switch (ePageType)
- {
- case ePageTypeEncoderGeneral:
- {
- iStringId=IDS_EncoderGeneralShort;
- break;
- }
- case ePageTypeEncoderQuality:
- {
- iStringId=IDS_EncoderQualityShort;
- break;
- }
- case ePageTypeEncoderID3:
- {
- iStringId=IDS_EncoderId3Short;
- break;
- }
- default:
- {
- iStringId=IDS_TabUndefined;
- break;
- }
- }
-
- CString oToReturn;
- oToReturn.LoadString(iStringId);
- return oToReturn;
-}
--- a/wingui/SupportedPropertyPagesData.h
+++ /dev/null
@@ -1,48 +1,0 @@
-// SupportedPropertyPagesData.h: interface for the CSupportedPropertyPagesData class.
-// Author: Torsten Landmann
-//
-// This class is a wrapper around a simple TItemList<long>. It provides some
-// basic functionality to save which pages of a set of property pages shall
-// be visible.
-//
-//////////////////////////////////////////////////////////////////////
-
-#if !defined(AFX_SUPPORTEDPROPERTYPAGESDATA_H__442115C2_0FD4_11D5_8402_0080C88C25BD__INCLUDED_)
-#define AFX_SUPPORTEDPROPERTYPAGESDATA_H__442115C2_0FD4_11D5_8402_0080C88C25BD__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-#include "TItemList.h"
-
-enum EPropertyPageType
-{
- ePageTypeEncoderGeneral,
- ePageTypeEncoderQuality,
- ePageTypeEncoderID3,
-};
-
-class CSupportedPropertyPagesData : public TItemList<EPropertyPageType>
-{
-public:
- CSupportedPropertyPagesData();
- CSupportedPropertyPagesData(const CSupportedPropertyPagesData &oSource);
- virtual ~CSupportedPropertyPagesData();
-
- void ShowPage(EPropertyPageType ePageType);
- void HidePage(EPropertyPageType ePageType);
- bool IsPageVisible(EPropertyPageType ePageType) const;
- long GetNumberOfPages() const;
-
- // multiplication intersects two data objects;
- // this is useful to determine the pages that are supported by
- // a certain selection of different jobs
- CSupportedPropertyPagesData& operator=(const CSupportedPropertyPagesData &oRight);
- CSupportedPropertyPagesData operator*(const CSupportedPropertyPagesData &oRight);
- CSupportedPropertyPagesData& operator*=(const CSupportedPropertyPagesData &oRight);
-
- static CString GetPageDescriptionShort(EPropertyPageType ePageType);
-};
-
-#endif // !defined(AFX_SUPPORTEDPROPERTYPAGESDATA_H__442115C2_0FD4_11D5_8402_0080C88C25BD__INCLUDED_)
--- a/wingui/TItemList.cpp
+++ /dev/null
@@ -1,11 +1,0 @@
-// TItemList.cpp: Definition file for class template
-// TItemList; with this template you can create
-// lists that is able to hold elements of the
-// specified type; each element gets a unique
-// handle in the list that is returned on creation
-//
-/////////////////////////////////////////////////////////
-
-#include "stdafx.h"
-#include "TItemList.h"
-
--- a/wingui/TItemList.h
+++ /dev/null
@@ -1,873 +1,0 @@
-// TItemList.h: Header file for class template
-// TItemList;
-// Copyright 2000 by Torsten Landmann
-//
-// with this template you can create
-// lists that are able to hold elements of the
-// specified type; each element gets a unique
-// handle in the list that is returned on creation
-// you can choose whatever type you want as content under
-// one condition: the operators ==, =, < and > must be defined;
-// however < and > do only need to return senseful results
-// if you wish to use the sorting feature of TItemList<..>-Lists;
-// == must always be reflexive and must never return
-// true if the two elements aren't really the same C++-object or value;
-// if all this comparison operator stuff is too complicated for
-// you and you think you don't really need to pay attention to
-// it for a specific class just derive this class from
-// CGenericSortable; note however that even then the = operator
-// still needs to be implemented by you!
-//
-// revised 2001 by Torsten Landmann
-// successfully compiled and tested under MSVC 6.0
-//
-/////////////////////////////////////////////////////////
-
-#ifndef __TItemList_h__
-#define __TItemList_h__
-
-
-#include "ListObj.h"
-
-template <class ItemType> class TItemList;
-
-template <class ItemType> class TItemListElem:public CBBaseElem
-{
- friend class TItemList<ItemType>;
-
-protected:
- TItemListElem();
- virtual ~TItemListElem();
-
- void SetContent(const ItemType &etContent);
- bool GetContent(ItemType &etContent) const;
- bool GetContent(ItemType* &etContent);
- ItemType* GetContent();
- const ItemType* GetContent() const;
-
- virtual signed long IsHigher(class CBBaseElem *pElem); // overridden; used for sorting the list
-
-private:
- bool m_bContentDefined;
- ItemType m_etContent;
-};
-
-
-template <class LItemType> class TItemList:public CBList
-{
-public:
- TItemList();
- TItemList(const TItemList<LItemType> &oSource);
- virtual ~TItemList();
-
- // return value: unique handle of the new item; siListErr in
- // case of errors
- // note: if lDesiredIndex is supplied and the index is
- // 1.: >0 and
- // 2.: not yet used as index
- // then you can be sure that it is used for the new element
- long AddNewElem(const LItemType &etContent, long lDesiredIndex=-1);
-
- bool DeleteElemByContent(const LItemType &etContent); // deletes maximally one element
- void DeleteAllElemsWithContent(const LItemType &etContent);
-
- void DeleteElems(TItemList<long> &oIndices);
-
- bool GetElemContent(long lIndex, LItemType &etContent) const;
- bool GetElemContent(long lIndex, LItemType* &etContent) const;
- bool SetElemContent(long lIndex, const LItemType &etContent) const;
- bool GetPosContent(long lPos, LItemType &etContent, long *lIndex=0) const; // lIndex may be used to get the index of the element
- bool GetPosContent(long lPos, LItemType* &etContent, long *lIndex=0) const; // lIndex may be used to get the index of the element
- bool SetPosContent(long lPos, const LItemType &etContent) const;
- bool GetNextElemContent(HRead hRead, LItemType &etContent, long *lIndex=0); // lIndex may be used to get the index of the element
- bool GetNextElemContent(HRead hRead, LItemType* &etContent, long *lIndex=0); // lIndex may be used to get the index of the element
-
- bool FindContent(const LItemType &etContent) const;
- bool FindContent(const LItemType &etContent, long &lId) const;
- bool FindContent(const LItemType &etContent, long lStartSearchAfterId, long &lId) const;
- long GetContentCount(const LItemType &etContent) const;
- TItemList<long> GetContentIds(const LItemType &etContent) const;
- TItemList<long> GetAllUsedIds() const;
-
- bool GetFirstElemContent(LItemType &etContent, long &lId) const;
- bool GetFirstElemContent(LItemType* &etContent, long &lId) const;
-
- bool GetGreatestContent(LItemType &etContent, long *plId=0) const;
- bool GetGreatestContent(LItemType* &etContent, long *plId=0) const;
- bool GetSmallestContent(LItemType &etContent, long *plId=0) const;
- bool GetSmallestContent(LItemType* &etContent, long *plId=0) const;
-
- // you may also use operator= for this
- bool CopyFrom(const TItemList<LItemType> &oSource);
-
- // standard operators;
- // subtraction preserves the indices of elements while
- // addition does not necessarily!
- // however if you are sure that no index would be in the list for several
- // times after adding the other list also addition preserves the indices;
- // subtraction is not number sensitive, so one element may
- // remove several others from the target list;
- TItemList<LItemType>& operator=(const TItemList<LItemType> &oRight);
- TItemList<LItemType> operator+(const TItemList<LItemType> &oRight);
- TItemList<LItemType> operator-(const TItemList<LItemType> &oRight);
- TItemList<LItemType>& operator+=(const TItemList<LItemType> &oRight);
- TItemList<LItemType>& operator-=(const TItemList<LItemType> &oRight);
-
- // multiplication intersects the two lists
- TItemList<LItemType> operator*(const TItemList<LItemType> &oRight);
- TItemList<LItemType>& operator*=(const TItemList<LItemType> &oRight);
-
-
-
- // removes all elements that are twice or more often in the list;
- // relatively slow, use sparingly (time complexity O(n*n));
- // you may provide a faster implementation if needed using
- // an efficient sorting algorithm
- void RemoveDoubleElements();
-
-protected:
- // the following method must be overriden by every
- // subclass returning an element of the type of the particular
- // subclass of PBBaseElem
- virtual PBBaseElem CreateElem();
-
- // this method may be overriden by any sub class to perform
- // certain operations on a content before it is removed
- // from the list (and maybe also the last possibility to
- // access the content)
- // for instance, if Content is a pointer, you might want
- // to call "delete Content;" before the pointer itself is
- // removed from the list;
- // !!! EXTREMELY IMPORTANT: !!!
- // if you override this method you MUST call
- // DeleteAll() in the destructor of your class
- virtual void OnPreDeleteContent(LItemType Content);
-
-private:
- // this method is inherited and called each time
- // an element is to be deleted;
- // it extracts its content and passes it on to a call
- // of OnPreDeleteContent()
- virtual void OnPreDeleteItem(PBBaseElem poElem);
-};
-
-
-
-// ---------------- template definitions -------------------------
-
-template <class ItemType> TItemListElem<ItemType>::TItemListElem():
- CBBaseElem()
-{
- m_bContentDefined=false;
-}
-
-template <class ItemType> TItemListElem<ItemType>::~TItemListElem()
-{
-}
-
-template <class ItemType> void TItemListElem<ItemType>::SetContent(const ItemType &etContent)
-{
- m_bContentDefined=true;
- m_etContent=etContent;
-}
-
-template <class ItemType> bool TItemListElem<ItemType>::GetContent(ItemType &etContent) const
-{
- if (!m_bContentDefined) return false;
- etContent=m_etContent;
- return true;
-}
-
-template <class ItemType> bool TItemListElem<ItemType>::GetContent(ItemType* &etContent)
-{
- if (!m_bContentDefined) return false;
- etContent=&m_etContent;
- return true;
-}
-
-template <class ItemType> ItemType* TItemListElem<ItemType>::GetContent()
-{
- return &m_etContent;
-}
-
-template <class ItemType> const ItemType* TItemListElem<ItemType>::GetContent() const
-{
- return &m_etContent;
-}
-
-template <class ItemType> signed long TItemListElem<ItemType>::IsHigher(class CBBaseElem *pElem)
-{
- ItemType ParamContent;
-
- ((TItemListElem<ItemType>*)pElem)->GetContent(ParamContent);
-
- if (ParamContent<m_etContent) return 1;
- if (ParamContent>m_etContent) return -1;
- return 0;
-}
-
-
-
-template <class LItemType> TItemList<LItemType>::TItemList():
- CBList()
-{
-}
-
-template <class LItemType> TItemList<LItemType>::TItemList(const TItemList<LItemType> &oSource)
-{
- CopyFrom(oSource);
-}
-
-template <class LItemType> TItemList<LItemType>::~TItemList()
-{
-}
-
-template <class LItemType> long TItemList<LItemType>::AddNewElem(
- const LItemType &etContent, long lDesiredIndex)
-{
- TItemListElem<LItemType>* poNewElem=
- (TItemListElem<LItemType>*)Add(lDesiredIndex);
-
- if (poNewElem==0)
- {
- return siListErr;
- }
-
- poNewElem->SetContent(etContent);
- return poNewElem->GetIndex();
-}
-
-template <class LItemType> bool TItemList<LItemType>::DeleteElemByContent(const LItemType &etContent)
-{
- long lItemId;
- if (!FindContent(etContent, lItemId))
- {
- return false;
- }
- return DeleteElem(lItemId)!=siListErr;
-}
-
-template <class LItemType> void TItemList<LItemType>::DeleteAllElemsWithContent(const LItemType &etContent)
-{
- while (DeleteElemByContent(etContent))
- {
- // nothing further
- }
-}
-
-template <class LItemType> void TItemList<LItemType>::DeleteElems(TItemList<long> &oIndices)
-{
- HRead hRead=oIndices.BeginRead();
- long lCurIndex;
- while (oIndices.GetNextElemContent(hRead, lCurIndex))
- {
- DeleteElem(lCurIndex);
- }
- oIndices.EndRead(hRead);
-}
-
-template <class LItemType> bool TItemList<LItemType>::GetElemContent(
- long lIndex,
- LItemType &etContent) const
-{
- TItemListElem<LItemType>* poElem=
- (TItemListElem<LItemType>*)GetElem(lIndex);
-
- if (poElem==0) return false;
-
- return poElem->GetContent(etContent);
-}
-
-template <class LItemType> bool TItemList<LItemType>::GetElemContent(
- long lIndex,
- LItemType* &etContent) const
-{
- TItemListElem<LItemType>* poElem=
- (TItemListElem<LItemType>*)GetElem(lIndex);
-
- if (poElem==0) return false;
-
- return poElem->GetContent(etContent);
-}
-
-template <class LItemType> bool TItemList<LItemType>::SetElemContent(long lIndex, const LItemType &etContent) const
-{
- TItemListElem<LItemType>* poElem=
- (TItemListElem<LItemType>*)GetElem(lIndex);
-
- if (poElem==0) return false;
-
- poElem->SetContent(etContent);
-
- return true;
-}
-
-template <class LItemType> bool TItemList<LItemType>::GetPosContent(long lPos, LItemType &etContent, long *lIndex) const
-{
- TItemListElem<LItemType>* poElem=
- (TItemListElem<LItemType>*)GetPos(lPos);
-
- if (poElem==0) return false;
-
- if (lIndex!=0) *lIndex=poElem->GetIndex();
-
- return poElem->GetContent(etContent);
-}
-
-template <class LItemType> bool TItemList<LItemType>::GetPosContent(long lPos, LItemType* &etContent, long *lIndex) const
-{
- TItemListElem<LItemType>* poElem=
- (TItemListElem<LItemType>*)GetPos(lPos);
-
- if (poElem==0) return false;
-
- if (lIndex!=0) *lIndex=poElem->GetIndex();
-
- return poElem->GetContent(etContent);
-}
-
-template <class LItemType> bool TItemList<LItemType>::SetPosContent(long lPos, const LItemType &etContent) const
-{
- TItemListElem<LItemType>* poElem=
- (TItemListElem<LItemType>*)GetPos(lPos);
-
- if (poElem==0) return false;
-
- poElem->SetContent(etContent);
-
- return true;
-}
-
-template <class LItemType> bool TItemList<LItemType>::GetNextElemContent(HRead hRead, LItemType &etContent, long *lIndex)
-{
- TItemListElem<LItemType>* poElem=
- (TItemListElem<LItemType>*)ReadElem(hRead);
-
- if (poElem==0) return false;
-
- if (lIndex!=0)
- {
- *lIndex=poElem->GetIndex();
- }
-
- return poElem->GetContent(etContent);
-}
-
-template <class LItemType> bool TItemList<LItemType>::GetNextElemContent(
- HRead hRead, LItemType* &etContent, long *lIndex)
-{
- TItemListElem<LItemType>* poElem=
- (TItemListElem<LItemType>*)ReadElem(hRead);
-
- if (poElem==0) return false;
-
- if (lIndex!=0)
- {
- *lIndex=poElem->GetIndex();
- }
-
- return poElem->GetContent(etContent);
-}
-
-template <class LItemType> bool TItemList<LItemType>::FindContent(const LItemType &etContent) const
-{
- long lDummy;
- return FindContent(etContent, lDummy);
-}
-
-template <class LItemType> bool TItemList<LItemType>::FindContent(const LItemType &etContent, long &lId) const
-{
- // we're using non-const members though we're going
- // to reverse all changes; therefore let's disable
- // the const checking
- TItemList<LItemType> *poThis=(TItemList<LItemType>*)this;
-
- // loop through all elements and compare them with the
- // given one
- LItemType etReadContent;
- HRead hRead=poThis->BeginRead();
- while (poThis->GetNextElemContent(hRead, etReadContent, &lId))
- {
- if (etReadContent==etContent)
- {
- poThis->EndRead(hRead);
- return true;
- }
- }
-
- poThis->EndRead(hRead);
- return false;
-}
-
-template <class LItemType> bool TItemList<LItemType>::FindContent(const LItemType &etContent, long lStartSearchAfterId, long &lId) const
-{
- // we're using non-const members though we're going
- // to reverse all changes; therefore let's disable
- // the const checking
- TItemList<LItemType> *poThis=(TItemList<LItemType>*)this;
-
- // loop through all elements and compare them with the
- // given one; however wait until we've passed the item
- // with id lStartSearchAfterId
- LItemType etReadContent;
- HRead hRead=poThis->BeginRead();
- bool bSearchBegun=false;
- while (poThis->GetNextElemContent(hRead, etReadContent, &lId))
- {
- if (etReadContent==etContent && bSearchBegun)
- {
- poThis->EndRead(hRead);
- return true;
- }
-
- if (lId==lStartSearchAfterId)
- {
- bSearchBegun=true;
- }
- }
-
- poThis->EndRead(hRead);
- return false;
-}
-
-template <class LItemType> long TItemList<LItemType>::GetContentCount(const LItemType &etContent) const
-{
- long lCount=0;
-
- // we're using non-const members though we're going
- // to reverse all changes; therefore let's disable
- // the const checking
- TItemList<LItemType> *poThis=(TItemList<LItemType>*)this;
-
- // loop through all elements and compare them with the
- // given one
- LItemType etReadContent;
- HRead hRead=poThis->BeginRead();
- while (poThis->GetNextElemContent(hRead, etReadContent))
- {
- if (etReadContent==etContent)
- {
- lCount++;
- }
- }
-
- poThis->EndRead(hRead);
- return lCount;
-}
-
-template <class LItemType> TItemList<long> TItemList<LItemType>::GetContentIds(const LItemType &etContent) const
-{
- TItemList<long> oReturn;
-
- // we're using non-const members though we're going
- // to reverse all changes; therefore let's disable
- // the const checking
- TItemList<LItemType> *poThis=(TItemList<LItemType>*)this;
-
- // loop through all elements and compare them with the
- // given one
- LItemType etReadContent;
- HRead hRead=poThis->BeginRead();
- long lCurId;
- while (poThis->GetNextElemContent(hRead, etReadContent, &lCurId))
- {
- if (etReadContent==etContent)
- {
- oReturn.AddNewElem(lCurId);
- }
- }
-
- poThis->EndRead(hRead);
- return oReturn;
-}
-
-template <class LItemType> TItemList<long> TItemList<LItemType>::GetAllUsedIds() const
-{
- TItemList<long> oReturn;
-
- // we're using non-const members though we're going
- // to reverse all changes; therefore let's disable
- // the const checking
- TItemList<LItemType> *poThis=(TItemList<LItemType>*)this;
-
- // loop through all elements and collect their ids
- LItemType *etReadContent; // just a dummy
- HRead hRead=poThis->BeginRead();
- long lCurId;
- while (poThis->GetNextElemContent(hRead, etReadContent, &lCurId))
- {
- oReturn.AddNewElem(lCurId);
- }
-
- poThis->EndRead(hRead);
- return oReturn;
-}
-
-template <class LItemType> bool TItemList<LItemType>::GetFirstElemContent(
- LItemType &etContent, long &lId) const
-{
- // use another overloaded version
- LItemType *petContent;
- if (!GetFirstElemContent(petContent, lId))
- {
- return false;
- }
-
- etContent=*petContent;
-
- // return success
- return true;
-}
-
-
-template <class LItemType> bool TItemList<LItemType>::GetFirstElemContent(
- LItemType* &etContent, long &lId) const
-{
- // we're using non-const members though we're going
- // to reverse all changes; therefore let's disable
- // the const checking
- TItemList<LItemType> *poThis=(TItemList<LItemType>*)this;
-
- // try to fetch the first element
- HRead hRead=poThis->BeginRead();
- if (poThis->GetNextElemContent(hRead, etContent, &lId))
- {
- // we could read an element
- poThis->EndRead(hRead);
- return true;
- }
- else
- {
- // we could read no element
- poThis->EndRead(hRead);
- return false;
- }
-}
-
-template <class LItemType> bool TItemList<LItemType>::GetGreatestContent(
- LItemType &etContent, long *plId) const
-{
- // use another overloaded version
- LItemType *poContent;
- if (!GetGreatestContent(poContent, plId))
- {
- return false;
- }
-
- etContent=*poContent;
-}
-
-template <class LItemType> bool TItemList<LItemType>::GetGreatestContent(
- LItemType* &etContent, long *plId) const
-{
- if (GetNumber()==0) return false; // no element there
-
- // we're using non-const members though we're going
- // to reverse all changes; therefore let's disable
- // the const checking
- TItemList<LItemType> *poThis=(TItemList<LItemType>*)this;
-
- // loop through all elements and always save the greatest
- LItemType *petCurGreatestContent;
- long lCurGreatestIndex;
- if (!GetFirstElemContent(petCurGreatestContent, lCurGreatestIndex)) return false;
-
- HRead hRead=poThis->BeginRead();
- LItemType *petReadContent;
- long lCurIndex;
- while (poThis->GetNextElemContent(hRead, petReadContent, &lCurIndex))
- {
- if (*petReadContent>*petCurGreatestContent)
- {
- petCurGreatestContent=petReadContent;
- lCurGreatestIndex=lCurIndex;
- }
- }
- poThis->EndRead(hRead);
-
- // set return results
- etContent=petCurGreatestContent;
- if (plId!=0) *plId=lCurGreatestIndex;
-
-
- // return success
- return true;
-}
-
-template <class LItemType> bool TItemList<LItemType>::GetSmallestContent(
- LItemType &etContent, long *plId) const
-{
- // use another overloaded version
- LItemType *poContent;
- if (!GetSmallestContent(poContent, plId))
- {
- return false;
- }
-
- etContent=*poContent;
-
- // return success
- return true;
-}
-
-template <class LItemType> bool TItemList<LItemType>::GetSmallestContent(
- LItemType* &etContent, long *plId) const
-{
- if (GetNumber()==0) return false; // no element there
-
- // we're using non-const members though we're going
- // to reverse all changes; therefore let's disable
- // the const checking
- TItemList<LItemType> *poThis=(TItemList<LItemType>*)this;
-
- // loop through all elements and always save a pointer to the smallest
- LItemType *petCurSmallestContent;
- long lCurSmallestIndex;
- if (!GetFirstElemContent(petCurSmallestContent, lCurSmallestIndex)) return false;
-
- HRead hRead=poThis->BeginRead();
- LItemType *petReadContent;
- long lCurIndex;
- while (poThis->GetNextElemContent(hRead, petReadContent, &lCurIndex))
- {
- if (*petReadContent<*petCurSmallestContent)
- {
- petCurSmallestContent=petReadContent;
- lCurSmallestIndex=lCurIndex;
- }
- }
- poThis->EndRead(hRead);
-
- // set return results
- etContent=petCurSmallestContent;
- if (plId!=0) *plId=lCurSmallestIndex;
-
-
- // return success
- return true;
-}
-
-template <class LItemType> bool TItemList<LItemType>::CopyFrom(
- const TItemList<LItemType> &oSource)
-{
- ASSERT(&oSource!=this);
-
- // we will not have changed the state of oSource on return;
- // however we'll need non-const operations, so
- // allow ourselves to use non-const operations
- TItemList<LItemType> *poSource=(TItemList<LItemType>*)&oSource;
-
- // now begin the actual copying
- DeleteAll();
-
- HRead hRead=poSource->BeginRead();
-
- LItemType CurItem;
- long lCurItemIndex;
- while (poSource->GetNextElemContent(hRead, CurItem, &lCurItemIndex))
- {
- long lNewIndex=AddNewElem(CurItem, lCurItemIndex);
- ASSERT(lNewIndex==lCurItemIndex); // assert that the copy got the same index as the source
- }
-
- poSource->EndRead(hRead);
-
- // return success
- return true;
-}
-
-template <class LItemType> TItemList<LItemType>& TItemList<LItemType>::operator=(const TItemList<LItemType> &oRight)
-{
- CopyFrom(oRight);
- return *this;
-}
-
-template <class LItemType> TItemList<LItemType> TItemList<LItemType>::operator+(const TItemList<LItemType> &oRight)
-{
- TItemList<LItemType> oReturn;
-
- // put our elements to return
- oReturn=*this;
-
- // put the rvalue's elements to return
- oReturn+=oRight;
-
- return oReturn;
-}
-
-template <class LItemType> TItemList<LItemType> TItemList<LItemType>::operator-(const TItemList<LItemType> &oRight)
-{
- TItemList<LItemType> oReturn;
-
- // put our elements to return
- oReturn=*this;
-
- // remove the rvalue's elements from return
- oReturn-=oRight;
-
- return oReturn;
-}
-
-template <class LItemType> TItemList<LItemType>& TItemList<LItemType>::operator+=(const TItemList<LItemType> &oRight)
-{
- // we will not have changed the state of oRight on return;
- // however we'll need non-const operations, so
- // allow ourselves to use non-const operations
- TItemList<LItemType> *poRight=(TItemList<LItemType>*)&oRight;
-
- // now begin the actual adding
- HRead hRead=poRight->BeginRead();
-
- LItemType CurItem;
- long lCurItemIndex;
- while (poRight->GetNextElemContent(hRead, CurItem, &lCurItemIndex))
- {
- AddNewElem(CurItem, lCurItemIndex);
- }
-
- poRight->EndRead(hRead);
-
- return *this;
-}
-
-template <class LItemType> TItemList<LItemType>& TItemList<LItemType>::operator-=(const TItemList<LItemType> &oRight)
-{
- // go through all elements in the right list and delete them
- // from this one
-
- // we will not have changed the state of oRight on return;
- // however we'll need non-const operations, so
- // allow ourselves to use non-const operations
- TItemList<LItemType> *poRight=(TItemList<LItemType>*)&oRight;;
-
- HRead hRead=poRight->BeginRead();
- LItemType CurItem;
- while (poRight->GetNextElemContent(hRead, CurItem))
- {
- // delete the content from this list
- DeleteAllElemsWithContent(CurItem);
- }
- poRight->EndRead(hRead);
-
- return *this;
-}
-
-template <class LItemType> TItemList<LItemType>& TItemList<LItemType>::operator*=(const TItemList<LItemType> &oRight)
-{
- // we save the ids of all items that are to be removed in this list;
- // this is necessary because the list is locked when read sessions are open
- TItemList<long> oIndicesToDelete;
-
- // remove all elements that are not in the oRight list
- HRead hRead=BeginRead();
- LItemType CurItem;
- long lCurItemIndex;
- while (GetNextElemContent(hRead, CurItem, &lCurItemIndex))
- {
- long lDummy;
- if (!oRight.FindContent(CurItem, lDummy))
- {
- // the item is not in the oRight list, so save
- // it for deletion
- oIndicesToDelete.AddNewElem(lCurItemIndex);
- }
- }
- EndRead(hRead);
-
- // now delete all items that we saved for deletion
- hRead=oIndicesToDelete.BeginRead();
- while (oIndicesToDelete.GetNextElemContent(hRead, lCurItemIndex))
- {
- DeleteElem(lCurItemIndex);
- }
- oIndicesToDelete.EndRead(hRead);
-
- return *this;
-}
-
-template <class LItemType> TItemList<LItemType> TItemList<LItemType>::operator*(const TItemList<LItemType> &oRight)
-{
- TItemList<LItemType> oReturn;
-
- // put our elements to return
- oReturn=*this;
-
- // intersect the rvalue's elements with return's
- oReturn*=oRight;
-
- return oReturn;
-}
-
-template <class LItemType> void TItemList<LItemType>::RemoveDoubleElements()
-{
- // we'll copy a copy of all distinct elements in this list
- TItemList<LItemType> oResultList;
-
- // go through all elements in this list and copy them
- // to the result list if appropriate
- HRead hRead=BeginRead();
- LItemType CurItem;
- while (GetNextElemContent(hRead, CurItem))
- {
- long lDummy;
- if (!oResultList.FindContent(CurItem, lDummy))
- {
- // the content is not yet in the list, so copy
- // it
- oResultList.AddNewElem(CurItem);
- }
- }
- EndRead(hRead);
-
- // now ResultList contains only distinct elements, so
- // copy it to ourselves
- *this=oResultList;
-}
-
-
-
-template <class LItemType> PBBaseElem TItemList<LItemType>::CreateElem()
-{
- return new TItemListElem<LItemType>;
-}
-
-template <class LItemType> void TItemList<LItemType>::OnPreDeleteContent(LItemType Content)
-{
- // do nothing here
-}
-
-template <class LItemType> void TItemList<LItemType>::OnPreDeleteItem(PBBaseElem poElem)
-{
- // find out the content of the item
- LItemType Content;
- ((TItemListElem<LItemType>*)poElem)->GetContent(Content);
-
- // inform sub classes of deletion of content
- OnPreDeleteContent(Content);
-}
-
-// see comment at the top of this file for a description
-class CGenericSortable
-{
-public:
- CGenericSortable() {}
- virtual ~CGenericSortable() {}
-
- bool operator==(const CGenericSortable &oRight)
- {
- return this==&oRight;
- }
-
- bool operator<(const CGenericSortable &oRight)
- {
- return this<&oRight;
- }
-
- bool operator>(const CGenericSortable &oRight)
- {
- return &oRight<this;
- }
-};
-
-
-#endif // #ifndef __TItemList_h__
\ No newline at end of file
--- a/wingui/WindowUtil.cpp
+++ /dev/null
@@ -1,255 +1,0 @@
-// WindowUtil.cpp: implementation of the CWindowUtil class.
-// Author: Torsten Landmann
-//
-//////////////////////////////////////////////////////////////////////
-
-#include "stdafx.h"
-#include "faac_wingui.h"
-#include "WindowUtil.h"
-
-#ifdef _DEBUG
-#undef THIS_FILE
-static char THIS_FILE[]=__FILE__;
-#define new DEBUG_NEW
-#endif
-
-//////////////////////////////////////////////////////////////////////
-// Construction/Destruction
-//////////////////////////////////////////////////////////////////////
-
-CWindowUtil::CWindowUtil()
-{
-
-}
-
-CWindowUtil::~CWindowUtil()
-{
-
-}
-
-void CWindowUtil::DeleteAllListCtrlItems(CListCtrl *poListCtrl)
-{
- poListCtrl->DeleteAllItems();
-}
-
-long CWindowUtil::AddListCtrlItem(CListCtrl *poListCtrl, const char *lpszText, long lParam)
-{
- if (poListCtrl==0) return -1;
-
- LV_ITEM sctItem;
- sctItem.mask=LVIF_TEXT | LVIF_PARAM;
- sctItem.iItem=0;
- sctItem.lParam=lParam;
- sctItem.iSubItem=0;
- sctItem.pszText=(char*)lpszText; // hope we can trust the caller
- return poListCtrl->InsertItem(&sctItem);
-}
-
-void CWindowUtil::SetListCtrlItem(CListCtrl *poListCtrl, long lItemId, int iSubItemId, const char *lpszText)
-{
- if (poListCtrl==0) return;
-
- LV_ITEM sctItem;
- sctItem.mask=LVIF_TEXT;
- sctItem.iItem=lItemId;
- sctItem.iSubItem=iSubItemId;
- sctItem.pszText=(char*)lpszText; // hope we can trust the caller
- poListCtrl->SetItem(&sctItem);
-}
-
-void CWindowUtil::AddListCtrlColumn(
- CListCtrl *poListCtrl,
- int iColumnCount,
- const char *lpszText,
- double dWidth)
-{
- ASSERT(poListCtrl!=0); // valid parameter?
- if (poListCtrl==0) return;
-
- CRect cRect;
- int iWidthBuf;
-
- // determine dimensions of report list
- poListCtrl->GetWindowRect(cRect);
-
- // calculate width of new column
- iWidthBuf=dWidth>1 ?
- ((int) (dWidth)) :
- ((int) (dWidth*cRect.Width()));
-
- // create new column
- poListCtrl->InsertColumn(iColumnCount,
- lpszText,
- LVCFMT_LEFT, iWidthBuf, iColumnCount);
-}
-
-
-TItemList<long> CWindowUtil::GetAllSelectedListCtrlItemLParams(CListCtrl *poListCtrl, bool bDisableNoSelectionErrorMsg)
-{
- // buffer a pointer to the list control object
- CListCtrl* pListCtrl=poListCtrl;
- ASSERT(pListCtrl!=0); // valid list parameter?
- if (pListCtrl==0) return TItemList<long>();
-
- // create the return item
- TItemList<long> oSelectedLParams;
-
- // get a list control read pointer
- POSITION hPos=pListCtrl->GetFirstSelectedItemPosition();
- if (hPos==0)
- {
- // user did not select an item
- if (!bDisableNoSelectionErrorMsg)
- {
- AfxMessageBox(IDS_NoListItemSelected);
- }
- }
- else
- {
- // loop through all selected items and get their
- // referring lParams
- int nCurItem;
- long lCurItemData;
- while (hPos!=0)
- {
- // fetch the next element
- nCurItem=pListCtrl->GetNextSelectedItem(hPos);
-
- // find out the item data of the current element;
- lCurItemData=pListCtrl->GetItemData(nCurItem);
-
- // give our element to the list
- oSelectedLParams.AddNewElem(lCurItemData);
- }
- }
-
- return oSelectedLParams;
-}
-
-int CWindowUtil::GetListCtrlItemIdByLParam(CListCtrl *poListCtrl, long lParam, int iStartAt)
-{
- // find out the list control item that corresponds with the
- // given lParam
- LVFINDINFOA sctFindInfo;
- sctFindInfo.flags=LVFI_PARAM;
- sctFindInfo.lParam=lParam;
- return poListCtrl->FindItem(&sctFindInfo, iStartAt);
-}
-
-void CWindowUtil::SetListCtrlFullRowSelectStyle(CListCtrl *poListCtrl, bool bFullRowSelectStyle)
-{
- if (poListCtrl==0)
- {
- ASSERT(false);
- return;
- }
-
- if (bFullRowSelectStyle)
- {
- ListView_SetExtendedListViewStyleEx(*poListCtrl, LVS_EX_FULLROWSELECT, LVS_EX_FULLROWSELECT);
- }
- else
- {
- ListView_SetExtendedListViewStyleEx(*poListCtrl, LVS_EX_FULLROWSELECT, 0);
- }
-}
-
-void CWindowUtil::SetListCtrlCheckBoxStyle(CListCtrl *poListCtrl, bool bCheckboxStyle)
-{
- if (poListCtrl==0)
- {
- ASSERT(false);
- return;
- }
-
- if (bCheckboxStyle)
- {
- ListView_SetExtendedListViewStyleEx(*poListCtrl, LVS_EX_CHECKBOXES, LVS_EX_CHECKBOXES);
- }
- else
- {
- ListView_SetExtendedListViewStyleEx(*poListCtrl, LVS_EX_CHECKBOXES, 0);
- }
-}
-
-
-void CWindowUtil::ForceNumericContent(CEdit *poEdit, bool bAllowNegative)
-{
- ASSERT(poEdit!=0);
- if (poEdit==0) return;
-
-
- CString oOldString;
- poEdit->GetWindowText(oOldString);
- CString oNewString(oOldString);
- oNewString.TrimLeft();
- bool bIsNegative=false;
- if (bAllowNegative)
- {
- if (oNewString.GetAt(0)=='-')
- {
- bIsNegative=true;
- oNewString.Delete(0);
- }
- }
- FilterString(oNewString, "0123456789");
- if (bIsNegative)
- {
- oNewString=CString("-")+oNewString;
- }
- if (oNewString.GetLength()<oOldString.GetLength())
- {
- DWORD dwCurSel=poEdit->GetSel();
- // have altered the text
- poEdit->SetWindowText(oNewString);
- poEdit->SetSel(dwCurSel);
- }
-}
-
-void CWindowUtil::FilterString(CString &oString, const CString &oAcceptedChars)
-{
- long lCurPos=0;
- while (lCurPos<oString.GetLength())
- {
- if (oAcceptedChars.Find(oString.GetAt(lCurPos))!=-1)
- {
- // character is ok
- lCurPos++;
- }
- else
- {
- // character is not ok
- oString.Delete(lCurPos);
- }
- }
-}
-
-CString CWindowUtil::GetTimeDescription(long lMilliseconds, bool bIncludeMillis)
-{
- long lSeconds=lMilliseconds/1000;
- lMilliseconds=lMilliseconds%1000;
- long lMinutes=lSeconds/60;
- lSeconds=lSeconds%60;
- long lHours=lMinutes/60;
- lMinutes=lMinutes%60;
- long lDays=lHours/24;
- lHours=lHours%24;
-
- CString oToReturn;
- if (lDays>0)
- {
- oToReturn.Format("%dd:%02d:%02d:%02d", lDays, lHours, lMinutes, lSeconds);
- }
- else
- {
- oToReturn.Format("%02d:%02d:%02d", lHours, lMinutes, lSeconds);
- }
-
- if (bIncludeMillis)
- {
- CString oMillis;
- oMillis.Format(":%03d", lMilliseconds);
- oToReturn+=oMillis;
- }
- return oToReturn;
-}
\ No newline at end of file
--- a/wingui/WindowUtil.h
+++ /dev/null
@@ -1,39 +1,0 @@
-// WindowUtil.h: interface for the CWindowUtil class.
-// Author: Torsten Landmann
-//
-// some functionality to assist in work especially with windows controls
-//
-//////////////////////////////////////////////////////////////////////
-
-#if !defined(AFX_WINDOWUTIL_H__3B6C58DA_0CE8_11D5_8402_0080C88C25BD__INCLUDED_)
-#define AFX_WINDOWUTIL_H__3B6C58DA_0CE8_11D5_8402_0080C88C25BD__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-#include "TItemList.h"
-
-class CWindowUtil
-{
-public:
- CWindowUtil();
- virtual ~CWindowUtil();
-
- static void DeleteAllListCtrlItems(CListCtrl *poListCtrl);
- static long AddListCtrlItem(CListCtrl *poListCtrl, const char *lpszText, long lParam);
- static void SetListCtrlItem(CListCtrl *poListCtrl, long lItemId, int iSubItemId, const char *lpszText);
- static void AddListCtrlColumn(CListCtrl *poListCtrl, int iColumnCount, const char *lpszText, double dWidth); // for dWidth: <1: percent of the width of the list control; >1 width in pixels
- static TItemList<long> GetAllSelectedListCtrlItemLParams(CListCtrl *poListCtrl, bool bDisableNoSelectionErrorMsg);
- static int GetListCtrlItemIdByLParam(CListCtrl *poListCtrl, long lParam, int iStartAt=-1); // returns a negative value if none is found
- static void SetListCtrlFullRowSelectStyle(CListCtrl *poListCtrl, bool bFullRowSelectStyle=true);
- static void SetListCtrlCheckBoxStyle(CListCtrl *poListCtrl, bool bCheckboxStyle=true);
-
- static void ForceNumericContent(CEdit *poEdit, bool bAllowNegative);
-
- static void FilterString(CString &oString, const CString &oAcceptedChars);
-
- static CString GetTimeDescription(long lMilliseconds, bool bIncludeMillis=false);
-};
-
-#endif // !defined(AFX_WINDOWUTIL_H__3B6C58DA_0CE8_11D5_8402_0080C88C25BD__INCLUDED_)
--- a/wingui/faac_wingui.cpp
+++ /dev/null
@@ -1,122 +1,0 @@
-// faac_wingui.cpp : Defines the class behaviors for the application.
-// Author: MSVC6.0 Wizard and Torsten Landmann :)
-//
-///////////////////////////////////////////////////////////
-
-#include "stdafx.h"
-#include "faac_wingui.h"
-#include "faac_winguiDlg.h"
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-/////////////////////////////////////////////////////////////////////////////
-// CFaac_winguiApp
-
-BEGIN_MESSAGE_MAP(CFaac_winguiApp, CWinApp)
- //{{AFX_MSG_MAP(CFaac_winguiApp)
- // NOTE - the ClassWizard will add and remove mapping macros here.
- // DO NOT EDIT what you see in these blocks of generated code!
- //}}AFX_MSG
- ON_COMMAND(ID_HELP, CWinApp::OnHelp)
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// CFaac_winguiApp construction
-
-CFaac_winguiApp::CFaac_winguiApp():
- m_poCurPropertiesDummyParentDialogSingletonContainer(0)
-{
- // TODO: add construction code here,
- // Place all significant initialization in InitInstance
-}
-
-CFaac_winguiApp::~CFaac_winguiApp()
-{
-}
-
-/////////////////////////////////////////////////////////////////////////////
-// The one and only CFaac_winguiApp object
-
-CFaac_winguiApp theApp;
-
-/////////////////////////////////////////////////////////////////////////////
-// CFaac_winguiApp initialization
-
-BOOL CFaac_winguiApp::InitInstance()
-{
- AfxEnableControlContainer();
-
- // Standard initialization
- // If you are not using these features and wish to reduce the size
- // of your final executable, you should remove from the following
- // the specific initialization routines you do not need.
-
-#ifdef _AFXDLL
- Enable3dControls(); // Call this when using MFC in a shared DLL
-#else
- Enable3dControlsStatic(); // Call this when linking to MFC statically
-#endif
-
- CFaac_winguiDlg dlg;
- m_pMainWnd = &dlg;
- int nResponse = dlg.DoModal();
- if (nResponse == IDOK)
- {
- // TODO: Place code here to handle when the dialog is
- // dismissed with OK
- }
- else if (nResponse == IDCANCEL)
- {
- // TODO: Place code here to handle when the dialog is
- // dismissed with Cancel
- }
-
- PerformAppCleanup();
-
- // Since the dialog has been closed, return FALSE so that we exit the
- // application, rather than start the application's message pump.
- return FALSE;
-}
-
-void CFaac_winguiApp::SetGlobalPropertiesDummyParentDialogSingleton(
- CPropertiesDummyParentDialog *poPropertyContainer,
- CFloatingPropertyDialog *poFloatingPropertiesDialog)
-{
- if (m_poCurPropertiesDummyParentDialogSingletonContainer!=0)
- {
- //m_poCurPropertiesDummyParentDialogSingletonContainer->DestroyWindow();
- delete m_poCurPropertiesDummyParentDialogSingletonContainer;
- m_poCurPropertiesDummyParentDialogSingletonContainer=0;
- }
-
- m_poCurPropertiesDummyParentDialogSingletonContainer=poPropertyContainer;
- m_poFloatingPropertiesDialog=poFloatingPropertiesDialog;
-}
-
-CPropertiesDummyParentDialog* CFaac_winguiApp::GetGlobalPropertiesDummyParentDialogSingleton()
-{
- return m_poCurPropertiesDummyParentDialogSingletonContainer;
-}
-
-bool CFaac_winguiApp::HaveFloatingProperties() const
-{
- return m_poFloatingPropertiesDialog!=0;
-}
-
-CFloatingPropertyDialog* CFaac_winguiApp::GetFloatingPropertiesDialog() const
-{
- return m_poFloatingPropertiesDialog;
-}
-
-void CFaac_winguiApp::PerformAppCleanup()
-{
- if (m_poCurPropertiesDummyParentDialogSingletonContainer!=0)
- {
- delete m_poCurPropertiesDummyParentDialogSingletonContainer;
- m_poCurPropertiesDummyParentDialogSingletonContainer=0;
- }
-}
--- a/wingui/faac_wingui.dsp
+++ /dev/null
@@ -1,512 +1,0 @@
-# Microsoft Developer Studio Project File - Name="faac_wingui" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Application" 0x0101
-
-CFG=faac_wingui - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "faac_wingui.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "faac_wingui.mak" CFG="faac_wingui - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "faac_wingui - Win32 Release" (based on "Win32 (x86) Application")
-!MESSAGE "faac_wingui - Win32 Debug" (based on "Win32 (x86) Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "faac_wingui - Win32 Release"
-
-# PROP BASE Use_MFC 6
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 5
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "../include" /I "../common/libsndfile/src" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /Yu"stdafx.h" /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x407 /d "NDEBUG" /d "_AFXDLL"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 /nologo /subsystem:windows /machine:I386
-# ADD LINK32 /nologo /subsystem:windows /machine:I386
-
-!ELSEIF "$(CFG)" == "faac_wingui - Win32 Debug"
-
-# PROP BASE Use_MFC 6
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 5
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../include" /I "../common/libsndfile/src" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x407 /d "_DEBUG" /d "_AFXDLL"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
-
-!ENDIF
-
-# Begin Target
-
-# Name "faac_wingui - Win32 Release"
-# Name "faac_wingui - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\AbstractJob.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\AbstractPageCtrlContent.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\AbstractPropertyPageContents.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\AskCreateDirectoryDialog.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\ConcreteJobBase.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\EncoderGeneralPageDialog.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\EncoderGeneralPropertyPageContents.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\EncoderId3PageDialog.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\EncoderId3PropertyPageContents.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\EncoderJob.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\EncoderJobProcessingManager.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\EncoderQualityPageDialog.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\EncoderQualityPropertyPageContents.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\faac_wingui.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\faac_wingui.rc
-# End Source File
-# Begin Source File
-
-SOURCE=.\faac_winguiDlg.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\FaacWinguiProgramSettings.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\FileListQueryManager.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\FileMaskAssembler.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\FilePathCalc.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\FileSerializable.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\FileSerializableJobList.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\FloatingPropertyDialog.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\FolderDialog.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\Id3TagInfo.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\Job.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\JobList.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\JobListCtrlDescribable.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\JobListsToConfigureSaver.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\JobListUpdatable.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\JobProcessingDynamicUserInputInfo.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\ListCtrlStateSaver.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\Listobj.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\PageCheckboxCtrlContent.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\PageComboBoxCtrlContent.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\PageEditCtrlContent.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\PageRadioGroupCtrlContent.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\ProcessingStartStopPauseInteractable.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\ProcessingStatusDialogInfoFeedbackCallbackInterface.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\ProcessJobStatusDialog.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\PropertiesDummyParentDialog.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\PropertiesTabParentDialog.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\RecursiveDirectoryTraverser.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\SourceTargetFilePair.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\StdAfx.cpp
-# ADD CPP /Yc"stdafx.h"
-# End Source File
-# Begin Source File
-
-SOURCE=.\SupportedPropertyPagesData.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\TItemList.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\WindowUtil.cpp
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\AbstractJob.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\AbstractPageCtrlContent.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\AbstractPropertyPageContents.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\AskCreateDirectoryDialog.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\ConcreteJobBase.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\EncoderGeneralPageDialog.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\EncoderGeneralPropertyPageContents.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\EncoderId3PageDialog.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\EncoderId3PropertyPageContents.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\EncoderJob.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\EncoderJobProcessingManager.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\EncoderQualityPageDialog.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\EncoderQualityPropertyPageContents.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\include\faac.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\faac_wingui.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\faac_winguiDlg.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\FaacWinguiProgramSettings.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\FileListQueryManager.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\FileMaskAssembler.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\FilePathCalc.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\FileSerializable.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\FileSerializableJobList.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\FloatingPropertyDialog.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\FolderDialog.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\Id3TagInfo.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\Job.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\JobList.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\JobListCtrlDescribable.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\JobListsToConfigureSaver.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\JobListUpdatable.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\JobProcessingDynamicUserInputInfo.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\ListCtrlStateSaver.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\listobj.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\PageCheckboxCtrlContent.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\PageComboBoxCtrlContent.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\PageEditCtrlContent.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\PageRadioGroupCtrlContent.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\ProcessingStartStopPauseInteractable.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\ProcessingStatusDialogInfoFeedbackCallbackInterface.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\ProcessJobStatusDialog.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\PropertiesDummyParentDialog.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\PropertiesTabParentDialog.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\RecursiveDirectoryTraverser.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\Resource.h
-# End Source File
-# Begin Source File
-
-SOURCE="E:\Program Files\Microsoft Visual Studio\VC98\Include\sndfile.h"
-# End Source File
-# Begin Source File
-
-SOURCE=.\SourceTargetFilePair.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\StdAfx.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\SupportedPropertyPagesData.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\TItemList.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\WindowUtil.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# Begin Source File
-
-SOURCE=.\res\faac_wingui.ico
-# End Source File
-# Begin Source File
-
-SOURCE=.\res\faac_wingui.rc2
-# End Source File
-# Begin Source File
-
-SOURCE=.\res\toolbarm.bmp
-# End Source File
-# End Group
-# Begin Source File
-
-SOURCE=.\ReadMe.txt
-# End Source File
-# End Target
-# End Project
--- a/wingui/faac_wingui.dsw
+++ /dev/null
@@ -1,59 +1,0 @@
-Microsoft Developer Studio Workspace File, Format Version 6.00
-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
-
-###############################################################################
-
-Project: "faac_wingui"=.\faac_wingui.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name libfaac
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name libsndfile
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "libfaac"=..\libfaac\libfaac.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Project: "libsndfile"=..\common\libsndfile\Win32\libsndfile.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
-
--- a/wingui/faac_wingui.h
+++ /dev/null
@@ -1,87 +1,0 @@
-// faac_wingui.h : main header file for the FAAC_WINGUI application
-// Author: MSVC6.0 Wizard and Torsten Landmann :)
-//
-/////////////////////////////////////////////////////////////////////
-
-#if !defined(AFX_FAAC_WINGUI_H__DFE38E65_0E81_11D5_8402_0080C88C25BD__INCLUDED_)
-#define AFX_FAAC_WINGUI_H__DFE38E65_0E81_11D5_8402_0080C88C25BD__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-#ifndef __AFXWIN_H__
- #error include 'stdafx.h' before including this file for PCH
-#endif
-
-#include "resource.h" // main symbols
-#include "JobList.h"
-#include "PropertiesDummyParentDialog.h"
-#include "FaacWinguiProgramSettings.h"
-#include "FloatingPropertyDialog.h"
-
-/////////////////////////////////////////////////////////////////////////////
-// CFaac_winguiApp:
-// See faac_wingui.cpp for the implementation of this class
-//
-
-class CFaac_winguiApp : public CWinApp
-{
-public:
- CFaac_winguiApp();
- virtual ~CFaac_winguiApp();
-
-// Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CFaac_winguiApp)
- public:
- virtual BOOL InitInstance();
- //}}AFX_VIRTUAL
-
- const CJobList& GetGlobalJobList() const { return m_oGlobalJobList; }
- CJobList& GetGlobalJobList() { return m_oGlobalJobList; }
- const CFaacWinguiProgramSettings& GetGlobalProgramSettings() const { return m_oGlobalProgramSettings; }
- CFaacWinguiProgramSettings& GetGlobalProgramSettings() { return m_oGlobalProgramSettings; }
-
- // these two members are not an exact pair (getter/setter); however they
- // work closely together
- void SetGlobalPropertiesDummyParentDialogSingleton(CPropertiesDummyParentDialog *poPropertyContainer, CFloatingPropertyDialog *poFloatingPropertiesDialog=0);
- CPropertiesDummyParentDialog* GetGlobalPropertiesDummyParentDialogSingleton();
- bool HaveFloatingProperties() const;
- CFloatingPropertyDialog* GetFloatingPropertiesDialog() const;
-
-// Implementation
-
- //{{AFX_MSG(CFaac_winguiApp)
- // NOTE - the ClassWizard will add and remove member functions here.
- // DO NOT EDIT what you see in these blocks of generated code !
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-
-private:
- // this list is the global job list within this application
- CJobList m_oGlobalJobList;
-
- // this object contains all global program settings
- CFaacWinguiProgramSettings m_oGlobalProgramSettings;
-
- // global program settings
- CFaacWinguiProgramSettings m_oProgramSettings;
-
- // this member saves a pointer to the entry point to display
- // properties of jobs
- CPropertiesDummyParentDialog *m_poCurPropertiesDummyParentDialogSingletonContainer;
- CFloatingPropertyDialog *m_poFloatingPropertiesDialog;
-
-
- // something like the destructor of the application
- void PerformAppCleanup();
-};
-
-
-/////////////////////////////////////////////////////////////////////////////
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_FAAC_WINGUI_H__DFE38E65_0E81_11D5_8402_0080C88C25BD__INCLUDED_)
--- a/wingui/faac_wingui.rc
+++ /dev/null
@@ -1,908 +1,0 @@
-//Microsoft Developer Studio generated resource script.
-//
-#include "resource.h"
-
-#define APSTUDIO_READONLY_SYMBOLS
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 2 resource.
-//
-#include "afxres.h"
-
-/////////////////////////////////////////////////////////////////////////////
-#undef APSTUDIO_READONLY_SYMBOLS
-
-/////////////////////////////////////////////////////////////////////////////
-// German (Germany) resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DEU)
-#ifdef _WIN32
-LANGUAGE LANG_GERMAN, SUBLANG_GERMAN
-#pragma code_page(1252)
-#endif //_WIN32
-
-#ifdef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// TEXTINCLUDE
-//
-
-1 TEXTINCLUDE DISCARDABLE
-BEGIN
- "resource.h\0"
-END
-
-2 TEXTINCLUDE DISCARDABLE
-BEGIN
- "#include ""afxres.h""\r\n"
- "\0"
-END
-
-3 TEXTINCLUDE DISCARDABLE
-BEGIN
- "#define _AFX_NO_SPLITTER_RESOURCES\r\n"
- "#define _AFX_NO_OLE_RESOURCES\r\n"
- "#define _AFX_NO_TRACKER_RESOURCES\r\n"
- "#define _AFX_NO_PROPERTY_RESOURCES\r\n"
- "\r\n"
- "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
- "#ifdef _WIN32\r\n"
- "LANGUAGE 9, 1\r\n"
- "#pragma code_page(1252)\r\n"
- "#endif //_WIN32\r\n"
- "#include ""res\\faac_wingui.rc2"" // non-Microsoft Visual C++ edited resources\r\n"
- "#include ""afxres.rc"" // Standard components\r\n"
- "#endif\r\n"
- "\0"
-END
-
-#endif // APSTUDIO_INVOKED
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Icon
-//
-
-// Icon with lowest ID value placed first to ensure application icon
-// remains consistent on all systems.
-IDR_MAINFRAME ICON DISCARDABLE "res\\faac_wingui.ico"
-#endif // German (Germany) resources
-/////////////////////////////////////////////////////////////////////////////
-
-
-/////////////////////////////////////////////////////////////////////////////
-// English (U.S.) resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
-#ifdef _WIN32
-LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
-#pragma code_page(1252)
-#endif //_WIN32
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Dialog
-//
-
-IDD_PROPERTIESDUMMYPARENTDIALOG DIALOG DISCARDABLE 0, 0, 186, 95
-STYLE WS_CHILD
-FONT 8, "MS Sans Serif"
-BEGIN
- LTEXT "This dialog serves as an instance to normalize coordinates for different property dialog locations (docked, floating window).",
- IDC_STATIC,10,10,159,26,NOT WS_VISIBLE
- LTEXT "The order in which dialogs contain each other is as follows:\nparent window (floating, main dlg, etc.)\nthis dialog\npropertiestabparentdialog\nproperty pages",
- IDC_STATIC,10,37,159,48,NOT WS_VISIBLE
- LTEXT "Dummy",IDC_LABELDEBUGTAG,157,87,24,8,NOT WS_VISIBLE
-END
-
-IDD_ENCODERQUALITYPAGEDIALOG DIALOG DISCARDABLE 0, 0, 253, 131
-STYLE WS_CHILD
-FONT 8, "MS Sans Serif"
-BEGIN
- LTEXT "Output Bitrate",IDC_STATIC,5,10,44,8,WS_TABSTOP
- EDITTEXT IDC_EDITBITRATE,64,7,52,14,ES_AUTOHSCROLL
- LTEXT "bit/s",IDC_STATIC,119,10,15,8
- LTEXT "Bandwidth",IDC_STATIC,5,28,34,8
- EDITTEXT IDC_EDITBANDWIDTH,64,25,52,14,ES_AUTOHSCROLL
- LTEXT "Hz",IDC_STATIC,119,28,10,8
- CONTROL "Allow Mid/Side",IDC_CHECKMIDSIDE,"Button",
- BS_AUTOCHECKBOX | WS_TABSTOP,24,49,63,10
- CONTROL "Use TNS",IDC_CHECKUSETNS,"Button",BS_AUTOCHECKBOX |
- WS_TABSTOP,24,60,45,10
- CONTROL "Use LTP",IDC_CHECKUSELTP,"Button",BS_AUTOCHECKBOX | NOT
- WS_VISIBLE | WS_DISABLED | WS_TABSTOP,24,72,44,10
- CONTROL "Use LFE",IDC_CHECKUSELFE,"Button",BS_AUTOCHECKBOX |
- WS_DISABLED | WS_TABSTOP,24,83,43,10
- GROUPBOX "MPEG",IDC_STATIC,142,5,68,35
- CONTROL "Version 2",IDC_RADIOMPEGVERSION2,"Button",
- BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,152,15,45,10
- CONTROL "Version 4",IDC_RADIOMPEGVERSION4,"Button",
- BS_AUTORADIOBUTTON,152,26,45,10
- GROUPBOX "AAC Object Type",IDC_STATIC,142,45,68,59,WS_GROUP
- CONTROL "Main",IDC_RADIOAACPROFILEMAIN,"Button",
- BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,152,57,31,10
- CONTROL "LC",IDC_RADIOAACPROFILELC,"Button",BS_AUTORADIOBUTTON,
- 152,68,25,10
- CONTROL "SSR",IDC_RADIOAACPROFILESSR,"Button",BS_AUTORADIOBUTTON |
- WS_DISABLED,152,79,31,10
- CONTROL "LTP",IDC_RADIOAACPROFILELTP,"Button",BS_AUTORADIOBUTTON,
- 152,89,29,10
- DEFPUSHBUTTON "Enter Attractor",IDC_BUTTON1,198,112,50,14,NOT
- WS_VISIBLE
-END
-
-IDD_ABOUTBOX DIALOG DISCARDABLE 0, 0, 244, 66
-STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
-CAPTION "About faac_wingui"
-FONT 8, "MS Sans Serif"
-BEGIN
- ICON IDR_MAINFRAME,IDC_STATIC,11,17,21,20
- LTEXT "faac_wingui Version Alpha Release",IDC_STATIC,40,10,119,
- 8,SS_NOPREFIX
- LTEXT "Copyright (C) 2001",IDC_STATIC,40,44,119,8
- DEFPUSHBUTTON "OK",IDOK,187,45,50,14,WS_GROUP
- LTEXT "GUI written by Torsten Landmann as part of the faac Project",
- IDC_STATIC,40,22,190,8
- LTEXT "refer to http://www.audiocoding.com",IDC_STATIC,40,32,
- 118,8
-END
-
-IDD_FAAC_WINGUI_DIALOG DIALOGEX 0, 0, 479, 237
-STYLE DS_MODALFRAME | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION |
- WS_SYSMENU
-EXSTYLE WS_EX_APPWINDOW
-CAPTION "winfaac"
-FONT 8, "MS Sans Serif"
-BEGIN
- DEFPUSHBUTTON "Bye",IDOK,422,216,50,14
- CONTROL "List1",IDC_LISTJOBS,"SysListView32",LVS_REPORT |
- LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOSORTHEADER |
- WS_BORDER | WS_TABSTOP,7,7,465,167
- PUSHBUTTON "&Add File Encoder Jobs...",IDC_BUTTONADDENCODERJOB,7,
- 180,104,14
- PUSHBUTTON "&Delete Selection",IDC_BUTTONDELETEJOBS,117,198,63,14
- PUSHBUTTON "&Process Selection",IDC_BUTTONPROCESSSELECTED,249,198,
- 69,14
- CONTROL "Remove Processed Jobs From List",
- IDC_CHECKREMOVEPROCESSEDJOBS,"Button",BS_AUTOCHECKBOX |
- WS_TABSTOP,249,215,125,10
- PUSHBUTTON "&Save Joblist...",IDC_BUTTONSAVEJOBLIST,359,180,54,14,
- WS_DISABLED
- PUSHBUTTON "&Load Joblist...",IDC_BUTTONLOADJOBLIST,418,180,54,14,
- WS_DISABLED
- PUSHBUTTON "D&uplicate Selection",IDC_BUTTONDUPLICATESELECTED,117,
- 216,69,14
- PUSHBUTTON "Pro&cess All",IDC_BUTTONPROCESSALL,249,180,50,14
- PUSHBUTTON "Open Pr&operties",IDC_BUTTONOPENPROPERTIES,413,198,59,
- 14
- PUSHBUTTON "E&xpand Directory Job",IDC_BUTTONEXPANDFILTERJOB,32,216,
- 79,14,WS_DISABLED
- PUSHBUTTON "Add D&irectory Encoder Job...",
- IDC_BUTTONADDFILTERENCODERJOB,7,198,104,14
- PUSHBUTTON "Add E&mpty Encoder Job",IDC_BUTTONADDEMPTYENCODERJOB,
- 117,180,104,14
-END
-
-IDD_PROPERTIESTABPARENTDIALOG DIALOG DISCARDABLE 0, 0, 186, 95
-STYLE WS_CHILD
-FONT 8, "MS Sans Serif"
-BEGIN
- CONTROL "Tab1",IDC_TAB1,"SysTabControl32",0x0,51,44,50,30
- LTEXT "No appropriate selection of jobs",IDC_LABELNOSELECTION,
- 25,32,100,8
- LTEXT "TabParent",IDC_LABELDEBUGTAG,152,87,34,8,NOT WS_VISIBLE
-END
-
-IDD_ENCODERGENERALPAGEDIALOG DIALOG DISCARDABLE 0, 0, 253, 131
-STYLE WS_CHILD
-FONT 8, "MS Sans Serif"
-BEGIN
- LTEXT "&Source Directory",IDC_STATIC,5,5,54,8
- EDITTEXT IDC_EDITSOURCEDIR,5,14,187,14,ES_AUTOHSCROLL
- PUSHBUTTON "&Browse...",IDC_BUTTONBROWSESOURCEDIR,198,14,50,14
- LTEXT "Source &File Name:",IDC_STATIC,5,33,59,8
- EDITTEXT IDC_EDITSOURCEFILE,67,30,125,14,ES_AUTOHSCROLL
- PUSHBUTTON "Br&owse...",IDC_BUTTONBROWSESOURCEFILE,198,30,50,14
- CONTROL "&Recursive",IDC_CHECKRECURSIVE,"Button",BS_AUTOCHECKBOX |
- WS_TABSTOP,67,46,48,10
- LTEXT "&Target Directory",IDC_STATIC,5,62,52,8
- EDITTEXT IDC_EDITTARGETDIR,5,73,187,14,ES_AUTOHSCROLL
- PUSHBUTTON "Bro&wse...",IDC_BUTTONBROWSETARGETDIR,198,73,50,14
- LTEXT "Target File &Name:",IDC_STATIC,5,93,57,8
- EDITTEXT IDC_EDITTARGETFILE,67,90,125,14,ES_AUTOHSCROLL
- PUSHBUTTON "Brows&e...",IDC_BUTTONBROWSETARGETFILE,198,90,50,14
- DEFPUSHBUTTON "Enter Attractor",IDC_BUTTON1,198,112,50,14,NOT
- WS_VISIBLE
-END
-
-IDD_FLOATINGPROPERTYDIALOG DIALOGEX 0, 0, 258, 148
-STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
-EXSTYLE WS_EX_TOOLWINDOW
-CAPTION "Properties"
-FONT 8, "MS Sans Serif", 0, 0, 0x1
-BEGIN
- LTEXT "Properties",IDC_LABELDEBUGTAG,225,140,32,8,NOT
- WS_VISIBLE
-END
-
-IDD_ENCODERID3PAGEDIALOG DIALOG DISCARDABLE 0, 0, 253, 131
-STYLE WS_CHILD
-FONT 8, "MS Sans Serif"
-BEGIN
- LTEXT "Artist:",IDC_STATIC,5,10,18,8
- LTEXT "Track:",IDC_STATIC,5,27,22,8
- LTEXT "Genre",IDC_STATIC,5,95,20,8
- LTEXT "Title:",IDC_STATIC,5,44,16,8
- LTEXT "URL",IDC_STATIC,5,78,16,8
- EDITTEXT IDC_EDITARTIST,33,7,215,14,ES_AUTOHSCROLL
- EDITTEXT IDC_EDITTRACK,33,24,18,14,ES_AUTOHSCROLL
- EDITTEXT IDC_EDITTITLE,33,41,165,14,ES_AUTOHSCROLL
- EDITTEXT IDC_EDITURL,33,75,215,14,ES_AUTOHSCROLL
- LTEXT "Album:",IDC_STATIC,59,27,22,8
- EDITTEXT IDC_EDITALBUM,83,24,110,14,ES_AUTOHSCROLL
- LTEXT "Year:",IDC_STATIC,200,27,18,8
- EDITTEXT IDC_EDITYEAR,220,24,28,14,ES_AUTOHSCROLL
- LTEXT "Composer:",IDC_STATIC,131,61,34,8
- EDITTEXT IDC_EDITCOMPOSER,172,58,76,14,ES_AUTOHSCROLL
- LTEXT "Orig. Artist:",IDC_STATIC,5,61,35,8
- EDITTEXT IDC_EDITORIGINALARTIST,48,58,80,14,ES_AUTOHSCROLL
- CONTROL "Copyright",IDC_CHECKCOPYRIGHT,"Button",BS_AUTOCHECKBOX |
- WS_TABSTOP,203,43,45,10
- LTEXT "Comment",IDC_STATIC,135,95,30,8
- EDITTEXT IDC_EDITCOMMENT,135,105,113,21,ES_MULTILINE | WS_VSCROLL
- LTEXT "Encoded by:",IDC_STATIC,5,114,41,8
- EDITTEXT IDC_EDITENCODEDBY,48,111,80,14,ES_AUTOHSCROLL
- COMBOBOX IDC_COMBOGENRE,33,93,95,198,CBS_DROPDOWNLIST | CBS_SORT |
- WS_VSCROLL | WS_TABSTOP
- DEFPUSHBUTTON "Enter Attractor",IDC_BUTTON1,198,92,50,14,NOT
- WS_VISIBLE
-END
-
-IDD_PROCESSJOBSTATUSDIALOG DIALOG DISCARDABLE 0, 0, 354, 109
-STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION
-CAPTION "Processing Job..."
-FONT 8, "MS Sans Serif"
-BEGIN
- CTEXT "Static",IDC_LABELTOPSTATUSTEXT,7,7,340,39
- PUSHBUTTON "_",IDC_BUTTONMINIMIZEAPP,337,91,10,11,NOT WS_VISIBLE
- CONTROL "Progress1",IDC_PROGRESS1,"msctls_progress32",WS_BORDER,
- 23,47,307,10
- CTEXT "Static",IDC_LABELBOTTOMSTATUSTEXT,7,58,340,23
- PUSHBUTTON "Abort",IDC_BUTTONABORT,152,88,50,14,NOT WS_VISIBLE
- PUSHBUTTON "Pause",IDC_BUTTONPAUSE,207,88,50,14,NOT WS_VISIBLE
- PUSHBUTTON "Continue",IDC_BUTTONCONTINUE,262,88,50,14,NOT
- WS_VISIBLE | WS_DISABLED
-END
-
-IDD_ASKCREATEDIRECTORYDIALOG DIALOG DISCARDABLE 0, 0, 228, 85
-STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
-CAPTION "Target Directory not found"
-FONT 8, "MS Sans Serif"
-BEGIN
- CTEXT "The target directory",IDC_STATIC,7,7,214,8
- CTEXT "has not been found. Do you want to create it now?",
- IDC_STATIC,7,38,214,8
- CTEXT "Static",IDC_LABELTARGETDIR,7,18,214,19
- PUSHBUTTON "&Yes",IDC_BUTTONYES,7,60,50,14
- PUSHBUTTON "&No",IDC_BUTTONNO,62,60,50,14
- PUSHBUTTON "&Always",IDC_BUTTONALWAYS,117,60,50,14
- PUSHBUTTON "Ne&ver",IDC_BUTTONNEVER,171,60,50,14
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// DESIGNINFO
-//
-
-#ifdef APSTUDIO_INVOKED
-GUIDELINES DESIGNINFO DISCARDABLE
-BEGIN
- IDD_PROPERTIESDUMMYPARENTDIALOG, DIALOG
- BEGIN
- VERTGUIDE, 10
- VERTGUIDE, 169
- END
-
- IDD_ENCODERQUALITYPAGEDIALOG, DIALOG
- BEGIN
- LEFTMARGIN, 5
- RIGHTMARGIN, 248
- VERTGUIDE, 24
- VERTGUIDE, 64
- VERTGUIDE, 116
- VERTGUIDE, 119
- VERTGUIDE, 142
- TOPMARGIN, 5
- BOTTOMMARGIN, 126
- HORZGUIDE, 14
- HORZGUIDE, 32
- HORZGUIDE, 49
- END
-
- IDD_ABOUTBOX, DIALOG
- BEGIN
- LEFTMARGIN, 7
- RIGHTMARGIN, 237
- VERTGUIDE, 40
- TOPMARGIN, 7
- BOTTOMMARGIN, 59
- END
-
- IDD_FAAC_WINGUI_DIALOG, DIALOG
- BEGIN
- LEFTMARGIN, 7
- RIGHTMARGIN, 472
- VERTGUIDE, 111
- VERTGUIDE, 117
- VERTGUIDE, 249
- TOPMARGIN, 7
- BOTTOMMARGIN, 230
- HORZGUIDE, 187
- HORZGUIDE, 205
- END
-
- IDD_PROPERTIESTABPARENTDIALOG, DIALOG
- BEGIN
- LEFTMARGIN, 7
- TOPMARGIN, 6
- END
-
- IDD_ENCODERGENERALPAGEDIALOG, DIALOG
- BEGIN
- LEFTMARGIN, 5
- RIGHTMARGIN, 248
- VERTGUIDE, 67
- VERTGUIDE, 192
- VERTGUIDE, 198
- TOPMARGIN, 5
- BOTTOMMARGIN, 126
- HORZGUIDE, 21
- HORZGUIDE, 37
- HORZGUIDE, 51
- HORZGUIDE, 66
- HORZGUIDE, 80
- HORZGUIDE, 97
- END
-
- IDD_FLOATINGPROPERTYDIALOG, DIALOG
- BEGIN
- RIGHTMARGIN, 257
- END
-
- IDD_ENCODERID3PAGEDIALOG, DIALOG
- BEGIN
- LEFTMARGIN, 5
- RIGHTMARGIN, 248
- VERTGUIDE, 33
- VERTGUIDE, 48
- VERTGUIDE, 128
- VERTGUIDE, 135
- TOPMARGIN, 5
- BOTTOMMARGIN, 126
- HORZGUIDE, 14
- HORZGUIDE, 31
- HORZGUIDE, 48
- HORZGUIDE, 65
- HORZGUIDE, 82
- HORZGUIDE, 99
- HORZGUIDE, 118
- END
-
- IDD_PROCESSJOBSTATUSDIALOG, DIALOG
- BEGIN
- LEFTMARGIN, 7
- RIGHTMARGIN, 347
- TOPMARGIN, 7
- BOTTOMMARGIN, 102
- END
-
- IDD_ASKCREATEDIRECTORYDIALOG, DIALOG
- BEGIN
- LEFTMARGIN, 7
- RIGHTMARGIN, 221
- TOPMARGIN, 7
- BOTTOMMARGIN, 78
- HORZGUIDE, 67
- END
-END
-#endif // APSTUDIO_INVOKED
-
-
-#ifndef _MAC
-/////////////////////////////////////////////////////////////////////////////
-//
-// Version
-//
-
-VS_VERSION_INFO VERSIONINFO
- FILEVERSION 1,0,0,1
- PRODUCTVERSION 1,0,0,1
- FILEFLAGSMASK 0x3fL
-#ifdef _DEBUG
- FILEFLAGS 0x1L
-#else
- FILEFLAGS 0x0L
-#endif
- FILEOS 0x4L
- FILETYPE 0x1L
- FILESUBTYPE 0x0L
-BEGIN
- BLOCK "StringFileInfo"
- BEGIN
- BLOCK "040904B0"
- BEGIN
- VALUE "CompanyName", "\0"
- VALUE "FileDescription", "faac_wingui MFC Application\0"
- VALUE "FileVersion", "1, 0, 0, 1\0"
- VALUE "InternalName", "faac_wingui\0"
- VALUE "LegalCopyright", "Copyright (C) 2001\0"
- VALUE "LegalTrademarks", "\0"
- VALUE "OriginalFilename", "faac_wingui.EXE\0"
- VALUE "ProductName", "faac_wingui Application\0"
- VALUE "ProductVersion", "1, 0, 0, 1\0"
- END
- END
- BLOCK "VarFileInfo"
- BEGIN
- VALUE "Translation", 0x409, 1200
- END
-END
-
-#endif // !_MAC
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Dialog Info
-//
-
-IDD_ENCODERID3PAGEDIALOG DLGINIT
-BEGIN
- IDC_COMBOGENRE, 0x403, 1, 0
-"\000"
- IDC_COMBOGENRE, 0x403, 11, 0
-0x2041, 0x6143, 0x7070, 0x6c65, 0x616c, "\000"
- IDC_COMBOGENRE, 0x403, 5, 0
-0x6341, 0x6469, "\000"
- IDC_COMBOGENRE, 0x403, 10, 0
-0x6341, 0x6469, 0x4a20, 0x7a61, 0x007a,
- IDC_COMBOGENRE, 0x403, 10, 0
-0x6341, 0x6469, 0x5020, 0x6e75, 0x006b,
- IDC_COMBOGENRE, 0x403, 9, 0
-0x6341, 0x756f, 0x7473, 0x6369, "\000"
- IDC_COMBOGENRE, 0x403, 10, 0
-0x6c41, 0x2e74, 0x5220, 0x636f, 0x006b,
- IDC_COMBOGENRE, 0x403, 12, 0
-0x6c41, 0x6574, 0x6e72, 0x7461, 0x7669, 0x0065,
- IDC_COMBOGENRE, 0x403, 8, 0
-0x6d41, 0x6962, 0x6e65, 0x0074,
- IDC_COMBOGENRE, 0x403, 6, 0
-0x6e41, 0x6d69, 0x0065,
- IDC_COMBOGENRE, 0x403, 11, 0
-0x7641, 0x6e61, 0x6774, 0x7261, 0x6564, "\000"
- IDC_COMBOGENRE, 0x403, 7, 0
-0x6142, 0x6c6c, 0x6461, "\000"
- IDC_COMBOGENRE, 0x403, 5, 0
-0x6142, 0x7373, "\000"
- IDC_COMBOGENRE, 0x403, 5, 0
-0x6542, 0x7461, "\000"
- IDC_COMBOGENRE, 0x403, 6, 0
-0x6542, 0x6f62, 0x0062,
- IDC_COMBOGENRE, 0x403, 9, 0
-0x6942, 0x2067, 0x6142, 0x646e, "\000"
- IDC_COMBOGENRE, 0x403, 12, 0
-0x6c42, 0x6361, 0x206b, 0x654d, 0x6174, 0x006c,
- IDC_COMBOGENRE, 0x403, 10, 0
-0x6c42, 0x6575, 0x7267, 0x7361, 0x0073,
- IDC_COMBOGENRE, 0x403, 6, 0
-0x6c42, 0x6575, 0x0073,
- IDC_COMBOGENRE, 0x403, 11, 0
-0x6f42, 0x746f, 0x2079, 0x6142, 0x7373, "\000"
- IDC_COMBOGENRE, 0x403, 8, 0
-0x7242, 0x7469, 0x6f50, 0x0070,
- IDC_COMBOGENRE, 0x403, 8, 0
-0x6143, 0x6162, 0x6572, 0x0074,
- IDC_COMBOGENRE, 0x403, 7, 0
-0x6543, 0x746c, 0x6369, "\000"
- IDC_COMBOGENRE, 0x403, 14, 0
-0x6843, 0x6d61, 0x6562, 0x2072, 0x754d, 0x6973, 0x0063,
- IDC_COMBOGENRE, 0x403, 8, 0
-0x6843, 0x6e61, 0x6f73, 0x006e,
- IDC_COMBOGENRE, 0x403, 7, 0
-0x6843, 0x726f, 0x7375, "\000"
- IDC_COMBOGENRE, 0x403, 22, 0
-0x6843, 0x6972, 0x7473, 0x6169, 0x206e, 0x6147, 0x676e, 0x7473, 0x2061,
-0x6152, 0x0070,
- IDC_COMBOGENRE, 0x403, 14, 0
-0x6843, 0x6972, 0x7473, 0x6169, 0x206e, 0x6152, 0x0070,
- IDC_COMBOGENRE, 0x403, 15, 0
-0x6843, 0x6972, 0x7473, 0x6169, 0x206e, 0x6f52, 0x6b63, "\000"
- IDC_COMBOGENRE, 0x403, 13, 0
-0x6c43, 0x7361, 0x6973, 0x2063, 0x6f52, 0x6b63, "\000"
- IDC_COMBOGENRE, 0x403, 10, 0
-0x6c43, 0x7361, 0x6973, 0x6163, 0x006c,
- IDC_COMBOGENRE, 0x403, 5, 0
-0x6c43, 0x6275, "\000"
- IDC_COMBOGENRE, 0x403, 11, 0
-0x6c43, 0x6275, 0x482d, 0x756f, 0x6573, "\000"
- IDC_COMBOGENRE, 0x403, 7, 0
-0x6f43, 0x656d, 0x7964, "\000"
- IDC_COMBOGENRE, 0x403, 23, 0
-0x6f43, 0x746e, 0x6d65, 0x6f70, 0x6172, 0x7972, 0x4320, 0x7268, 0x7369,
-0x6974, 0x6e61, "\000"
- IDC_COMBOGENRE, 0x403, 8, 0
-0x6f43, 0x6e75, 0x7274, 0x0079,
- IDC_COMBOGENRE, 0x403, 10, 0
-0x7243, 0x736f, 0x6f73, 0x6576, 0x0072,
- IDC_COMBOGENRE, 0x403, 5, 0
-0x7543, 0x746c, "\000"
- IDC_COMBOGENRE, 0x403, 6, 0
-0x6144, 0x636e, 0x0065,
- IDC_COMBOGENRE, 0x403, 11, 0
-0x6144, 0x636e, 0x2065, 0x6148, 0x6c6c, "\000"
- IDC_COMBOGENRE, 0x403, 9, 0
-0x6144, 0x6b72, 0x6177, 0x6576, "\000"
- IDC_COMBOGENRE, 0x403, 12, 0
-0x6544, 0x7461, 0x2068, 0x654d, 0x6174, 0x006c,
- IDC_COMBOGENRE, 0x403, 6, 0
-0x6944, 0x6373, 0x006f,
- IDC_COMBOGENRE, 0x403, 6, 0
-0x7244, 0x6165, 0x006d,
- IDC_COMBOGENRE, 0x403, 12, 0
-0x7244, 0x6d75, 0x2620, 0x4220, 0x7361, 0x0073,
- IDC_COMBOGENRE, 0x403, 10, 0
-0x7244, 0x6d75, 0x5320, 0x6c6f, 0x006f,
- IDC_COMBOGENRE, 0x403, 5, 0
-0x7544, 0x7465, "\000"
- IDC_COMBOGENRE, 0x403, 15, 0
-0x6145, 0x7973, 0x4c20, 0x7369, 0x6574, 0x696e, 0x676e, "\000"
- IDC_COMBOGENRE, 0x403, 11, 0
-0x6c45, 0x6365, 0x7274, 0x6e6f, 0x6369, "\000"
- IDC_COMBOGENRE, 0x403, 7, 0
-0x7445, 0x6e68, 0x6369, "\000"
- IDC_COMBOGENRE, 0x403, 10, 0
-0x7545, 0x6f72, 0x6164, 0x636e, 0x0065,
- IDC_COMBOGENRE, 0x403, 11, 0
-0x7545, 0x6f72, 0x482d, 0x756f, 0x6573, "\000"
- IDC_COMBOGENRE, 0x403, 12, 0
-0x7545, 0x6f72, 0x542d, 0x6365, 0x6e68, 0x006f,
- IDC_COMBOGENRE, 0x403, 12, 0
-0x6146, 0x7473, 0x462d, 0x7375, 0x6f69, 0x006e,
- IDC_COMBOGENRE, 0x403, 5, 0
-0x6f46, 0x6b6c, "\000"
- IDC_COMBOGENRE, 0x403, 10, 0
-0x6f46, 0x6b6c, 0x522f, 0x636f, 0x006b,
- IDC_COMBOGENRE, 0x403, 9, 0
-0x6f46, 0x6b6c, 0x6f6c, 0x6572, "\000"
- IDC_COMBOGENRE, 0x403, 10, 0
-0x7246, 0x6565, 0x7473, 0x6c79, 0x0065,
- IDC_COMBOGENRE, 0x403, 5, 0
-0x7546, 0x6b6e, "\000"
- IDC_COMBOGENRE, 0x403, 7, 0
-0x7546, 0x6973, 0x6e6f, "\000"
- IDC_COMBOGENRE, 0x403, 5, 0
-0x6147, 0x656d, "\000"
- IDC_COMBOGENRE, 0x403, 12, 0
-0x6147, 0x676e, 0x7473, 0x2061, 0x6152, 0x0070,
- IDC_COMBOGENRE, 0x403, 4, 0
-0x6f47, 0x0061,
- IDC_COMBOGENRE, 0x403, 7, 0
-0x6f47, 0x7073, 0x6c65, "\000"
- IDC_COMBOGENRE, 0x403, 7, 0
-0x6f47, 0x6874, 0x6369, "\000"
- IDC_COMBOGENRE, 0x403, 12, 0
-0x6f47, 0x6874, 0x6369, 0x5220, 0x636f, 0x006b,
- IDC_COMBOGENRE, 0x403, 7, 0
-0x7247, 0x6e75, 0x6567, "\000"
- IDC_COMBOGENRE, 0x403, 10, 0
-0x6148, 0x6472, 0x5220, 0x636f, 0x006b,
- IDC_COMBOGENRE, 0x403, 9, 0
-0x6148, 0x6472, 0x6f63, 0x6572, "\000"
- IDC_COMBOGENRE, 0x403, 12, 0
-0x6548, 0x7661, 0x2079, 0x654d, 0x6174, 0x006c,
- IDC_COMBOGENRE, 0x403, 8, 0
-0x6948, 0x2d70, 0x6f48, 0x0070,
- IDC_COMBOGENRE, 0x403, 6, 0
-0x6f48, 0x7375, 0x0065,
- IDC_COMBOGENRE, 0x403, 7, 0
-0x7548, 0x6f6d, 0x7275, "\000"
- IDC_COMBOGENRE, 0x403, 6, 0
-0x6e49, 0x6964, 0x0065,
- IDC_COMBOGENRE, 0x403, 11, 0
-0x6e49, 0x7564, 0x7473, 0x6972, 0x6c61, "\000"
- IDC_COMBOGENRE, 0x403, 13, 0
-0x6e49, 0x7473, 0x7572, 0x656d, 0x746e, 0x6c61, "\000"
- IDC_COMBOGENRE, 0x403, 17, 0
-0x6e49, 0x7473, 0x7572, 0x656d, 0x746e, 0x6c61, 0x5020, 0x706f, "\000"
- IDC_COMBOGENRE, 0x403, 18, 0
-0x6e49, 0x7473, 0x7572, 0x656d, 0x746e, 0x6c61, 0x5220, 0x636f, 0x006b,
-
- IDC_COMBOGENRE, 0x403, 5, 0
-0x614a, 0x7a7a, "\000"
- IDC_COMBOGENRE, 0x403, 10, 0
-0x614a, 0x7a7a, 0x462b, 0x6e75, 0x006b,
- IDC_COMBOGENRE, 0x403, 5, 0
-0x504a, 0x706f, "\000"
- IDC_COMBOGENRE, 0x403, 7, 0
-0x754a, 0x676e, 0x656c, "\000"
- IDC_COMBOGENRE, 0x403, 6, 0
-0x614c, 0x6974, 0x006e,
- IDC_COMBOGENRE, 0x403, 6, 0
-0x6f4c, 0x462d, 0x0069,
- IDC_COMBOGENRE, 0x403, 11, 0
-0x654d, 0x6964, 0x6174, 0x6974, 0x6576, "\000"
- IDC_COMBOGENRE, 0x403, 9, 0
-0x654d, 0x6572, 0x676e, 0x6575, "\000"
- IDC_COMBOGENRE, 0x403, 6, 0
-0x654d, 0x6174, 0x006c,
- IDC_COMBOGENRE, 0x403, 8, 0
-0x754d, 0x6973, 0x6163, 0x006c,
- IDC_COMBOGENRE, 0x403, 14, 0
-0x614e, 0x6974, 0x6e6f, 0x6c61, 0x4620, 0x6c6f, 0x006b,
- IDC_COMBOGENRE, 0x403, 16, 0
-0x614e, 0x6974, 0x6576, 0x4120, 0x656d, 0x6972, 0x6163, 0x006e,
- IDC_COMBOGENRE, 0x403, 10, 0
-0x654e, 0x6567, 0x7072, 0x6e75, 0x006b,
- IDC_COMBOGENRE, 0x403, 8, 0
-0x654e, 0x2077, 0x6741, 0x0065,
- IDC_COMBOGENRE, 0x403, 9, 0
-0x654e, 0x2077, 0x6157, 0x6576, "\000"
- IDC_COMBOGENRE, 0x403, 6, 0
-0x6f4e, 0x7369, 0x0065,
- IDC_COMBOGENRE, 0x403, 7, 0
-0x6c4f, 0x6964, 0x7365, "\000"
- IDC_COMBOGENRE, 0x403, 6, 0
-0x704f, 0x7265, 0x0061,
- IDC_COMBOGENRE, 0x403, 6, 0
-0x744f, 0x6568, 0x0072,
- IDC_COMBOGENRE, 0x403, 6, 0
-0x6f50, 0x6b6c, 0x0061,
- IDC_COMBOGENRE, 0x403, 11, 0
-0x6f50, 0x736c, 0x206b, 0x7550, 0x6b6e, "\000"
- IDC_COMBOGENRE, 0x403, 4, 0
-0x6f50, 0x0070,
- IDC_COMBOGENRE, 0x403, 9, 0
-0x6f50, 0x2f70, 0x7546, 0x6b6e, "\000"
- IDC_COMBOGENRE, 0x403, 9, 0
-0x6f50, 0x2d70, 0x6f46, 0x6b6c, "\000"
- IDC_COMBOGENRE, 0x403, 12, 0
-0x6f50, 0x6e72, 0x4720, 0x6f72, 0x766f, 0x0065,
- IDC_COMBOGENRE, 0x403, 13, 0
-0x6f50, 0x6577, 0x2072, 0x6142, 0x6c6c, 0x6461, "\000"
- IDC_COMBOGENRE, 0x403, 7, 0
-0x7250, 0x6e61, 0x736b, "\000"
- IDC_COMBOGENRE, 0x403, 7, 0
-0x7250, 0x6d69, 0x7375, "\000"
- IDC_COMBOGENRE, 0x403, 17, 0
-0x7250, 0x676f, 0x6572, 0x7373, 0x7669, 0x2065, 0x6f52, 0x6b63, "\000"
- IDC_COMBOGENRE, 0x403, 12, 0
-0x7350, 0x6379, 0x6568, 0x6564, 0x696c, 0x0063,
- IDC_COMBOGENRE, 0x403, 17, 0
-0x7350, 0x6379, 0x6568, 0x6564, 0x696c, 0x2063, 0x6f52, 0x6b63, "\000"
- IDC_COMBOGENRE, 0x403, 5, 0
-0x7550, 0x6b6e, "\000"
- IDC_COMBOGENRE, 0x403, 10, 0
-0x7550, 0x6b6e, 0x5220, 0x636f, 0x006b,
- IDC_COMBOGENRE, 0x403, 4, 0
-0x2652, 0x0042,
- IDC_COMBOGENRE, 0x403, 4, 0
-0x6152, 0x0070,
- IDC_COMBOGENRE, 0x403, 5, 0
-0x6152, 0x6576, "\000"
- IDC_COMBOGENRE, 0x403, 7, 0
-0x6552, 0x6767, 0x6561, "\000"
- IDC_COMBOGENRE, 0x403, 6, 0
-0x6552, 0x7274, 0x006f,
- IDC_COMBOGENRE, 0x403, 8, 0
-0x6552, 0x6976, 0x6176, 0x006c,
- IDC_COMBOGENRE, 0x403, 14, 0
-0x6852, 0x7479, 0x6d68, 0x6369, 0x5320, 0x756f, 0x006c,
- IDC_COMBOGENRE, 0x403, 5, 0
-0x6f52, 0x6b63, "\000"
- IDC_COMBOGENRE, 0x403, 12, 0
-0x6f52, 0x6b63, 0x2620, 0x5220, 0x6c6f, 0x006c,
- IDC_COMBOGENRE, 0x403, 6, 0
-0x6153, 0x736c, 0x0061,
- IDC_COMBOGENRE, 0x403, 6, 0
-0x6153, 0x626d, 0x0061,
- IDC_COMBOGENRE, 0x403, 7, 0
-0x6153, 0x6974, 0x6572, "\000"
- IDC_COMBOGENRE, 0x403, 10, 0
-0x6853, 0x776f, 0x7574, 0x656e, 0x0073,
- IDC_COMBOGENRE, 0x403, 4, 0
-0x6b53, 0x0061,
- IDC_COMBOGENRE, 0x403, 9, 0
-0x6c53, 0x776f, 0x4a20, 0x6d61, "\000"
- IDC_COMBOGENRE, 0x403, 10, 0
-0x6c53, 0x776f, 0x5220, 0x636f, 0x006b,
- IDC_COMBOGENRE, 0x403, 7, 0
-0x6f53, 0x616e, 0x6174, "\000"
- IDC_COMBOGENRE, 0x403, 5, 0
-0x6f53, 0x6c75, "\000"
- IDC_COMBOGENRE, 0x403, 11, 0
-0x6f53, 0x6e75, 0x2064, 0x6c43, 0x7069, "\000"
- IDC_COMBOGENRE, 0x403, 11, 0
-0x6f53, 0x6e75, 0x7464, 0x6172, 0x6b63, "\000"
- IDC_COMBOGENRE, 0x403, 14, 0
-0x6f53, 0x7475, 0x6568, 0x6e72, 0x5220, 0x636f, 0x006b,
- IDC_COMBOGENRE, 0x403, 6, 0
-0x7053, 0x6361, 0x0065,
- IDC_COMBOGENRE, 0x403, 7, 0
-0x7053, 0x6565, 0x6863, "\000"
- IDC_COMBOGENRE, 0x403, 6, 0
-0x7753, 0x6e69, 0x0067,
- IDC_COMBOGENRE, 0x403, 15, 0
-0x7953, 0x706d, 0x6f68, 0x696e, 0x2063, 0x6f52, 0x6b63, "\000"
- IDC_COMBOGENRE, 0x403, 9, 0
-0x7953, 0x706d, 0x6f68, 0x796e, "\000"
- IDC_COMBOGENRE, 0x403, 9, 0
-0x7953, 0x746e, 0x7068, 0x706f, "\000"
- IDC_COMBOGENRE, 0x403, 6, 0
-0x6154, 0x676e, 0x006f,
- IDC_COMBOGENRE, 0x403, 7, 0
-0x6554, 0x6863, 0x6f6e, "\000"
- IDC_COMBOGENRE, 0x403, 18, 0
-0x6554, 0x6863, 0x6f6e, 0x492d, 0x646e, 0x7375, 0x7274, 0x6169, 0x006c,
-
- IDC_COMBOGENRE, 0x403, 7, 0
-0x6554, 0x7272, 0x726f, "\000"
- IDC_COMBOGENRE, 0x403, 13, 0
-0x6854, 0x6172, 0x6873, 0x4d20, 0x7465, 0x6c61, "\000"
- IDC_COMBOGENRE, 0x403, 7, 0
-0x6f54, 0x2070, 0x3034, "\000"
- IDC_COMBOGENRE, 0x403, 8, 0
-0x7254, 0x6961, 0x656c, 0x0072,
- IDC_COMBOGENRE, 0x403, 7, 0
-0x7254, 0x6e61, 0x6563, "\000"
- IDC_COMBOGENRE, 0x403, 7, 0
-0x7254, 0x6269, 0x6c61, "\000"
- IDC_COMBOGENRE, 0x403, 9, 0
-0x7254, 0x7069, 0x482d, 0x706f, "\000"
- IDC_COMBOGENRE, 0x403, 6, 0
-0x6f56, 0x6163, 0x006c,
- 0
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Toolbar
-//
-
-IDR_TOOLBARMAIN TOOLBAR DISCARDABLE 16, 15
-BEGIN
- BUTTON ID_BUTTON32771
- BUTTON ID_BUTTON32772
- BUTTON ID_BUTTON32773
- BUTTON ID_BUTTON32774
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Bitmap
-//
-
-IDR_TOOLBARMAIN BITMAP DISCARDABLE "res\\toolbarm.bmp"
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// String Table
-//
-
-STRINGTABLE DISCARDABLE
-BEGIN
- IDS_ABOUTBOX "&About faac_wingui..."
- IDS_UndefinedShort "U"
- IDS_UndefinedLong "Undefined"
- IDS_InvalidJob "Invalid Job"
- IDS_EncoderJobShort "Enc"
- IDS_EncoderJobLong "Encoder Job"
- IDS_MidSide "Mid/Side"
- IDS_UseLfe "LFE"
- IDS_NoListItemSelected "You must select a list item before this operation can be performed."
- IDS_JobTypeColumn "Type"
-END
-
-STRINGTABLE DISCARDABLE
-BEGIN
- IDS_JobInfoColumn "Job Description"
- IDS_EncoderGeneralShort "Enc. General"
- IDS_EncoderId3Short "ID3"
- IDS_TabUndefined "undefined"
- IDS_EncoderQualityShort "Enc. Quality"
- IDS_SelectSourceDirDlgCaption "Select Source Directory"
- IDS_SelectTargetDirDlgCaption "Select Target Directory"
- IDS_ErrorDuringDirectorySelection
- "Unrecognized error during directory selection."
- IDS_AllFilesFilter "All Files (*.*)|*.*"
- IDS_WavFilesFilter "Wave Files (*.wav)|*.wav"
- IDS_EndSourceFileStandardExtension "wav"
- IDS_ErrorDuringFileSelection "Unrecognized error during file selection."
- IDS_AacFilesFilter "Advanced Audio Coding Files (*.aac)|*.aac"
- IDS_EndTargetFileStandardExtension "aac"
- IDS_UseTns "TNS"
- IDS_UseLtp "LTP"
-END
-
-STRINGTABLE DISCARDABLE
-BEGIN
- IDS_AacProfileLc "LC"
- IDS_AacProfileMain "Main"
- IDS_AacProfileSsr "Ssr"
- IDS_DetailedEncoderJobDescriptionString
- "%s -> %s\nProfile: %s - %s\nParameters: %d bit/s - %d Hz"
- IDS_JobListFileFilter "Job List File (*.jbl)|*.jbl"
- IDS_JobListStandardExtension "jbl"
- IDS_ErrorWhileSavingJobList "Error while saving joblist."
- IDS_SearchParametersInvalid
- "Search Parameters dir=""%s"" filter=""%s"" are invalid."
- IDS_ErrorProcessingJobSelection
- "Error Processing Job\nDo you want to proceed with remaining jobs in the selection?"
- IDS_FilterDidntFindFiles
- "The file filter ""%s"" didn't find any files. This might be due to an error in the filter format or because no files exist.\nThe job completes with an error."
- IDS_ErrorCreatingNestedEncoderJob
- "Could not process nested file ""%s"". Would you like to continue processing remaining files of encoder job ""%s""?"
- IDS_ErrorWhileLoadingJobList "Error while loading joblist."
- IDS_JobNofM "%d of %d"
- IDS_SubJobNofM "Sub Job %d of %d"
- IDS_ErrorCreatingDirectory "The Directory ""%s"" could not be created."
- IDS_FilterJobSupplementaryInfo
- "Total of %d sub jobs: success %d, error %d, user abort %d"
-END
-
-STRINGTABLE DISCARDABLE
-BEGIN
- IDS_UserRefusedToCreateTargetDirectory
- "The user refused to create the target directory."
- IDS_FaacEncSetConfigurationFailed "faacEncSetConfiguration failed!"
- IDS_CouldntOpenInputFile "Couldn't open input file!"
- IDS_FaacEncEncodeFrameFailed "faacEncEncodeFrame failed!"
- IDS_JobProcessInfoColumn "Last Processed"
- IDS_OutcomeUnprocessed "Unprocessed"
- IDS_OutcomeSuccessfullyProcessed "Successfully processed"
- IDS_OutcomePartiallyProcessed "Partially proccessed"
- IDS_OutcomeUserAbort "User abort"
- IDS_OutcomeError "Error"
- IDS_FollowUp "follow-up"
- IDS_ErrorCreatingTargetDiretory "Error creating target directory"
- IDS_InvalidTargetDirectory "Invalid target directory!"
- IDS_HadUnsuccessfulJobs "There have been problems during job list processing. Refer to list column ""Last Processed"" for further information."
- IDS_AacProfileLtp "LTP"
- IDS_MpegVersion2 "MPEG-2"
-END
-
-STRINGTABLE DISCARDABLE
-BEGIN
- IDS_MpegVersion4 "MPEG-4"
-END
-
-#endif // English (U.S.) resources
-/////////////////////////////////////////////////////////////////////////////
-
-
-
-#ifndef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 3 resource.
-//
-#define _AFX_NO_SPLITTER_RESOURCES
-#define _AFX_NO_OLE_RESOURCES
-#define _AFX_NO_TRACKER_RESOURCES
-#define _AFX_NO_PROPERTY_RESOURCES
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
-#ifdef _WIN32
-LANGUAGE 9, 1
-#pragma code_page(1252)
-#endif //_WIN32
-#include "res\faac_wingui.rc2" // non-Microsoft Visual C++ edited resources
-#include "afxres.rc" // Standard components
-#endif
-
-/////////////////////////////////////////////////////////////////////////////
-#endif // not APSTUDIO_INVOKED
-
--- a/wingui/faac_winguiDlg.cpp
+++ /dev/null
@@ -1,987 +1,0 @@
-// faac_winguiDlg.cpp : implementation file
-// Author: Torsten Landmann
-//
-///////////////////////////////////
-
-#include "stdafx.h"
-#include "faac_wingui.h"
-#include "faac_winguiDlg.h"
-#include "WindowUtil.h"
-#include "FloatingPropertyDialog.h"
-#include "FileListQueryManager.h"
-#include "FileMaskAssembler.h"
-#include "FileSerializableJobList.h"
-#include "FolderDialog.h"
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-//#define EXTENDED_JOB_TRACKING_DURING_PROCESSING // doesn't work, yet
-
-/////////////////////////////////////////////////////////////////////////////
-// CAboutDlg dialog used for App About
-
-class CAboutDlg : public CDialog
-{
-public:
- CAboutDlg();
-
-// Dialog Data
- //{{AFX_DATA(CAboutDlg)
- enum { IDD = IDD_ABOUTBOX };
- //}}AFX_DATA
-
- // ClassWizard generated function overrides
- //{{AFX_VIRTUAL(CAboutDlg)
- protected:
- void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- //}}AFX_VIRTUAL
-
-// Implementation
-protected:
- //{{AFX_MSG(CAboutDlg)
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-};
-
-CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
-{
- //{{AFX_DATA_INIT(CAboutDlg)
- //}}AFX_DATA_INIT
-}
-
-void CAboutDlg::DoDataExchange(CDataExchange* pDX)
-{
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CAboutDlg)
- //}}AFX_DATA_MAP
-}
-
-BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
- //{{AFX_MSG_MAP(CAboutDlg)
- // No message handlers
- //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// CFaac_winguiDlg dialog
-
-CFaac_winguiDlg::CFaac_winguiDlg(CWnd* pParent /*=NULL*/)
- : CDialog(CFaac_winguiDlg::IDD, pParent),
- m_iListCtrlUpdatesCounter(-1),
- m_poCurrentStandardFile(0),
- m_poHiddenPropertiesWindow(0)
-{
- //{{AFX_DATA_INIT(CFaac_winguiDlg)
- m_bCheckRemoveProcessedJobs = FALSE;
- //}}AFX_DATA_INIT
- // Note that LoadIcon does not require a subsequent DestroyIcon in Win32
- m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
-}
-
-CFaac_winguiDlg::~CFaac_winguiDlg()
-{
- ReleaseStandardFile();
-}
-
-void CFaac_winguiDlg::DoDataExchange(CDataExchange* pDX)
-{
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CFaac_winguiDlg)
- DDX_Control(pDX, IDC_BUTTONEXPANDFILTERJOB, m_ctrlButtonExpandFilterJob);
- DDX_Control(pDX, IDC_BUTTONOPENPROPERTIES, m_ctrlButtonOpenProperties);
- DDX_Control(pDX, IDC_LISTJOBS, m_ctrlListJobs);
- DDX_Check(pDX, IDC_CHECKREMOVEPROCESSEDJOBS, m_bCheckRemoveProcessedJobs);
- //}}AFX_DATA_MAP
-}
-
-BEGIN_MESSAGE_MAP(CFaac_winguiDlg, CDialog)
- //{{AFX_MSG_MAP(CFaac_winguiDlg)
- ON_WM_SYSCOMMAND()
- ON_WM_PAINT()
- ON_WM_QUERYDRAGICON()
- ON_BN_CLICKED(IDC_BUTTONADDENCODERJOB, OnButtonAddEncoderJob)
- ON_NOTIFY(NM_CLICK, IDC_LISTJOBS, OnClickListJobs)
- ON_NOTIFY(LVN_KEYDOWN, IDC_LISTJOBS, OnKeydownListJobs)
- ON_BN_CLICKED(IDC_BUTTONDELETEJOBS, OnButtonDeleteJobs)
- ON_BN_CLICKED(IDC_BUTTONPROCESSSELECTED, OnButtonProcessSelected)
- ON_NOTIFY(NM_RCLICK, IDC_LISTJOBS, OnRclickListJobs)
- ON_BN_CLICKED(IDC_BUTTONSAVEJOBLIST, OnButtonSaveJobList)
- ON_BN_CLICKED(IDC_BUTTONLOADJOBLIST, OnButtonLoadJobList)
- ON_BN_CLICKED(IDC_BUTTONDUPLICATESELECTED, OnButtonDuplicateSelected)
- ON_BN_CLICKED(IDC_BUTTONPROCESSALL, OnButtonProcessAll)
- ON_BN_CLICKED(IDC_BUTTONOPENPROPERTIES, OnButtonOpenProperties)
- ON_WM_SHOWWINDOW()
- ON_BN_CLICKED(IDC_BUTTONEXPANDFILTERJOB, OnButtonExpandFilterJob)
- ON_BN_CLICKED(IDC_BUTTONADDFILTERENCODERJOB, OnButtonAddFilterEncoderJob)
- ON_BN_CLICKED(IDC_BUTTONADDEMPTYENCODERJOB, OnButtonAddEmptyEncoderJob)
- //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// CFaac_winguiDlg message handlers
-
-BOOL CFaac_winguiDlg::OnInitDialog()
-{
- CDialog::OnInitDialog();
-
- // Add "About..." menu item to system menu.
-
- // IDM_ABOUTBOX must be in the system command range.
- ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
- ASSERT(IDM_ABOUTBOX < 0xF000);
-
- CMenu* pSysMenu = GetSystemMenu(FALSE);
- if (pSysMenu != NULL)
- {
- CString strAboutMenu;
- strAboutMenu.LoadString(IDS_ABOUTBOX);
- if (!strAboutMenu.IsEmpty())
- {
- pSysMenu->AppendMenu(MF_SEPARATOR);
- pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
- }
- }
-
- // Set the icon for this dialog. The framework does this automatically
- // when the application's main window is not a dialog
- SetIcon(m_hIcon, TRUE); // Set big icon
- SetIcon(m_hIcon, FALSE); // Set small icon
-
- // TODO: Add extra initialization here
- {
- CString oTypeColumn;
- oTypeColumn.LoadString(IDS_JobTypeColumn);
- CString oInfoColumn;
- oInfoColumn.LoadString(IDS_JobInfoColumn);
- CString oProcessInfoColumn;
- oProcessInfoColumn.LoadString(IDS_JobProcessInfoColumn);
- CWindowUtil::AddListCtrlColumn(&m_ctrlListJobs, 0, oTypeColumn, 0.075);
- CWindowUtil::AddListCtrlColumn(&m_ctrlListJobs, 1, oInfoColumn, 0.75);
- CWindowUtil::AddListCtrlColumn(&m_ctrlListJobs, 2, oProcessInfoColumn, 0.9999);
- CWindowUtil::SetListCtrlFullRowSelectStyle(&m_ctrlListJobs);
- ReFillInJobListCtrl();
-
- // create a floating property window
- CFloatingPropertyDialog::CreateFloatingPropertiesDummyParentDialog();
- m_ctrlButtonOpenProperties.ShowWindow(SW_HIDE); // property window is open
-
- // make sure the floating window is initialized properly
- OnJobListCtrlSelChange();
-
-
- // load file specified on the command line (if any)
- {
- // Parse command line for standard shell commands, DDE, file open
- CCommandLineInfo cmdInfo;
- AfxGetApp()->ParseCommandLine(cmdInfo);
- if (cmdInfo.m_nShellCommand==CCommandLineInfo::FileNew) // prevent opening a new file on program start
- {
- cmdInfo.m_nShellCommand=CCommandLineInfo::FileNothing;
- }
- else if (cmdInfo.m_nShellCommand==CCommandLineInfo::FileOpen)
- {
- // must load a job list
- LoadJobList(cmdInfo.m_strFileName);
- }
- }
- }
-
- return TRUE; // return TRUE unless you set the focus to a control
-}
-
-void CFaac_winguiDlg::HidePropertiesWindow(CWnd *poPropertiesWindow)
-{
- // must not hide two property windows at a time
- ASSERT(m_poHiddenPropertiesWindow==0);
-
- m_poHiddenPropertiesWindow=poPropertiesWindow;
- m_poHiddenPropertiesWindow->ShowWindow(SW_HIDE);
- m_ctrlButtonOpenProperties.ShowWindow(SW_SHOW);
-}
-
-void CFaac_winguiDlg::ShowPropertiesWindow()
-{
- m_poHiddenPropertiesWindow->ShowWindow(SW_SHOW);
- m_poHiddenPropertiesWindow=0;
- m_ctrlButtonOpenProperties.ShowWindow(SW_HIDE);
-}
-
-void CFaac_winguiDlg::OnSysCommand(UINT nID, LPARAM lParam)
-{
- if ((nID & 0xFFF0) == IDM_ABOUTBOX)
- {
- CAboutDlg dlgAbout;
- dlgAbout.DoModal();
- }
- else
- {
- CDialog::OnSysCommand(nID, lParam);
- }
-}
-
-// If you add a minimize button to your dialog, you will need the code below
-// to draw the icon. For MFC applications using the document/view model,
-// this is automatically done for you by the framework.
-
-void CFaac_winguiDlg::OnPaint()
-{
- if (IsIconic())
- {
- CPaintDC dc(this); // device context for painting
-
- SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
-
- // Center icon in client rectangle
- int cxIcon = GetSystemMetrics(SM_CXICON);
- int cyIcon = GetSystemMetrics(SM_CYICON);
- CRect rect;
- GetClientRect(&rect);
- int x = (rect.Width() - cxIcon + 1) / 2;
- int y = (rect.Height() - cyIcon + 1) / 2;
-
- // Draw the icon
- dc.DrawIcon(x, y, m_hIcon);
- }
- else
- {
- CDialog::OnPaint();
- }
-}
-
-// The system calls this to obtain the cursor to display while the user drags
-// the minimized window.
-HCURSOR CFaac_winguiDlg::OnQueryDragIcon()
-{
- return (HCURSOR) m_hIcon;
-}
-
-void CFaac_winguiDlg::ReFillInJobListCtrl(CListCtrlStateSaver *poSelectionStateToUse, bool bSimpleUpdate)
-{
- if (m_iListCtrlUpdatesCounter>=0)
- {
- m_iListCtrlUpdatesCounter++;
- return;
- }
-
- CJobList *poJobList=GetGlobalJobList();
-
- if (!bSimpleUpdate)
- {
- // complete update
-
- // save the current list selection
- bool bMustDeleteSelection=false;
- if (poSelectionStateToUse==0)
- {
- poSelectionStateToUse=new CListCtrlStateSaver(&m_ctrlListJobs);
- bMustDeleteSelection=true;
- }
-
- CWindowUtil::DeleteAllListCtrlItems(&m_ctrlListJobs);
-
- // loop through all jobs and add them to the list control
- CBListReader oReader(poJobList->BeginReadEx());
- CJob *poCurrentJob;
- long lCurrentJobIndex;
- while ((poCurrentJob=poJobList->GetNextJob(oReader, &lCurrentJobIndex))!=0)
- {
- long lCurListItem=CWindowUtil::AddListCtrlItem(&m_ctrlListJobs, poCurrentJob->DescribeJobTypeShort(), lCurrentJobIndex);
- CWindowUtil::SetListCtrlItem(&m_ctrlListJobs, lCurListItem, 1, poCurrentJob->DescribeJob());
- CWindowUtil::SetListCtrlItem(&m_ctrlListJobs, lCurListItem, 2, poCurrentJob->GetProcessingOutcomeString());
- }
-
- // restore the previous list selection
- poSelectionStateToUse->RestoreState(&m_ctrlListJobs);
- if (bMustDeleteSelection)
- {
- delete poSelectionStateToUse;
- }
- }
- else
- {
- // simple update
- int iNumberOfListCtrlItems=m_ctrlListJobs.GetItemCount();
-
- for (int iCurItem=0; iCurItem<iNumberOfListCtrlItems; iCurItem++)
- {
- long lItemLParam=m_ctrlListJobs.GetItemData(iCurItem);
-
- // get the job that belongs to the item
- CJob *poCurJob=poJobList->GetJob(lItemLParam);
- CWindowUtil::SetListCtrlItem(&m_ctrlListJobs, iCurItem, 1, poCurJob->DescribeJob());
- CWindowUtil::SetListCtrlItem(&m_ctrlListJobs, iCurItem, 2, poCurJob->GetProcessingOutcomeString());
- }
- }
-}
-
-void CFaac_winguiDlg::EnableExpandFilterJobButton(bool bEnable)
-{
- // before enabling it make sure only one job is selected
- if (bEnable && CWindowUtil::GetAllSelectedListCtrlItemLParams(&m_ctrlListJobs, true).GetNumber()!=1)
- {
- // ignore or better to say disable
- m_ctrlButtonExpandFilterJob.EnableWindow(FALSE);
- return;
- }
- m_ctrlButtonExpandFilterJob.EnableWindow(bEnable ? TRUE : FALSE);
-}
-
-void CFaac_winguiDlg::OnJobListCtrlUserAction()
-{
- // check if the selection has changed
- TItemList<long> m_oSelectedJobsIds=CWindowUtil::GetAllSelectedListCtrlItemLParams(&m_ctrlListJobs, true);
-
- if (((m_lLastJobListSelection-m_oSelectedJobsIds).GetNumber()==0) &&
- ((m_oSelectedJobsIds-m_lLastJobListSelection).GetNumber()==0))
- {
- // the selection hasn't changed
- return;
- }
-
- // the selection has changed
- m_iListCtrlUpdatesCounter=0; // make sure no more than one list update is done
- m_lLastJobListSelection=m_oSelectedJobsIds;
- OnJobListCtrlSelChange();
- m_ctrlListJobs.SetFocus();
-
- if (m_iListCtrlUpdatesCounter>0)
- {
- // need a refill
- m_iListCtrlUpdatesCounter=-1;
- ReFillInJobListCtrl();
- }
- m_iListCtrlUpdatesCounter=-1;
-}
-
-void CFaac_winguiDlg::OnButtonAddEncoderJob()
-{
- CJobList *poJobList=GetGlobalJobList();
-
- CString oSourceFileExtension;
- CString oTargetFileExtension;
- oSourceFileExtension.LoadString(IDS_EndSourceFileStandardExtension);
- oTargetFileExtension.LoadString(IDS_EndTargetFileStandardExtension);
-
- // assemble the filter string
- CString oFilter;
- {
- // assemble a list of allowed filters
- TItemList<int> oFilters;
- oFilters.AddNewElem(IDS_WavFilesFilter, 1);
- oFilters.AddNewElem(IDS_AllFilesFilter, 2);
- oFilter=CFileMaskAssembler::GetFileMask(oFilters);
- }
-
- TItemList<CString> oUserSelection=
- CFileListQueryManager::GetFilePaths(
- true,
- &GetGlobalProgramSettings()->m_oDefaultEncSourceDir,
- oSourceFileExtension,
- oFilter);
-
- CBListReader oReader(oUserSelection);
- CString oCurString;
- TItemList<long> m_oIndicesOfAddedItems;
- while (oUserSelection.GetNextElemContent(oReader, oCurString))
- {
- // create a new job for the current file
- CEncoderJob oNewJob;
- GetGlobalProgramSettings()->ApplyToJob(oNewJob);
-
- CString oSourceDir(oCurString);
- CFilePathCalc::MakePath(oSourceDir);
- CString oSourceFileName;
- CFilePathCalc::ExtractFileName(oCurString, oSourceFileName);
- CString oTargetDir(oNewJob.GetFiles().GetTargetFileDirectory());
- CString oDummy;
- CString oTargetFileName;
- CFilePathCalc::SplitFileAndExtension(oSourceFileName, oTargetFileName, oDummy);
- oTargetFileName+=_T(".")+oTargetFileExtension;
-
- oNewJob.GetFiles().SetSourceFileDirectory(oSourceDir);
- oNewJob.GetFiles().SetSourceFileName(oSourceFileName);
- oNewJob.GetFiles().SetTargetFileDirectory(oTargetDir);
- oNewJob.GetFiles().SetTargetFileName(oTargetFileName);
-
- long lNewIndex=poJobList->AddJob(oNewJob);
- m_oIndicesOfAddedItems.AddNewElem(lNewIndex);
- }
-
-
- CListCtrlStateSaver oSelection;
- oSelection.SetToSelected(m_oIndicesOfAddedItems);
- ReFillInJobListCtrl(&oSelection, false);
-
- m_ctrlListJobs.SetFocus();
-
- OnJobListCtrlUserAction();
-}
-
-void CFaac_winguiDlg::OnJobListCtrlSelChange(TItemList<long> *poNewSelection)
-{
- // determine which jobs are selected
- TItemList<long> oSelectedJobsIds;
- if (poNewSelection!=0)
- {
- oSelectedJobsIds=*poNewSelection;
- }
- else
- {
- oSelectedJobsIds=CWindowUtil::GetAllSelectedListCtrlItemLParams(&m_ctrlListJobs, true);
- }
- CJobList &oJobs=((CFaac_winguiApp*)AfxGetApp())->GetGlobalJobList();
-
- CPropertiesDummyParentDialog *poPropertiesDialog=((CFaac_winguiApp*)AfxGetApp())->GetGlobalPropertiesDummyParentDialogSingleton();
- if (poPropertiesDialog==0)
- {
- // nothing to do here
- return;
- }
-
- // ask them all which pages they support
- CBListReader oReader(oSelectedJobsIds);
- long lCurJobIndex;
- CSupportedPropertyPagesData* poSupportedPages=0;
- TItemList<CJob*> oSelectedJobs;
- while (oSelectedJobsIds.GetNextElemContent(oReader, lCurJobIndex))
- {
- CJob *poCurJob=oJobs.GetJob(lCurJobIndex);
- if (poSupportedPages==0)
- {
- poSupportedPages=new CSupportedPropertyPagesData;
- *poSupportedPages=poCurJob->GetSupportedPropertyPages();
- }
- else
- {
- (*poSupportedPages)*=poCurJob->GetSupportedPropertyPages();
- }
-
- oSelectedJobs.AddNewElem(poCurJob, lCurJobIndex);
- }
-
- if (poSupportedPages==0)
- {
- // no list item selected -> no page accepted
- poSupportedPages=new CSupportedPropertyPagesData;
- }
-
- // display the property pages
- poPropertiesDialog->SetContent(*poSupportedPages, oSelectedJobs, this);
-
- if (poSupportedPages!=0)
- {
- delete poSupportedPages;
- }
-
- // enable/disable the "expand filter job" button
- {
- bool bButtonEnabled=true;
- if (oSelectedJobsIds.GetNumber()!=1)
- {
- bButtonEnabled=false;
- }
- else
- {
- long lSelectedJobId;
- long lDummy;
- oSelectedJobsIds.GetFirstElemContent(lSelectedJobId, lDummy);
- CJob *poJob=oJobs.GetJob(lSelectedJobId);
- if (poJob->GetEncoderJob()==0)
- {
- bButtonEnabled=false;
- }
- else if (!CFilePathCalc::IsValidFileMask(poJob->GetEncoderJob()->GetFiles().GetSourceFileName()))
- {
- bButtonEnabled=false;
- }
- }
-
- m_ctrlButtonExpandFilterJob.EnableWindow(bButtonEnabled ? TRUE : FALSE);
- }
-}
-
-void CFaac_winguiDlg::OnClickListJobs(NMHDR* pNMHDR, LRESULT* pResult)
-{
- // TODO: Add your control notification handler code here
- OnJobListCtrlUserAction();
-
- *pResult = 0;
-}
-
-void CFaac_winguiDlg::OnKeydownListJobs(NMHDR* pNMHDR, LRESULT* pResult)
-{
- LV_KEYDOWN* pLVKeyDow = (LV_KEYDOWN*)pNMHDR;
- // TODO: Add your control notification handler code here
-
- OnJobListCtrlUserAction();
-
- *pResult = 0;
-}
-
-void CFaac_winguiDlg::OnButtonDeleteJobs()
-{
- // TODO: Add your control notification handler code here
-
- // make sure the property pages won't crash
- OnJobListCtrlSelChange(&TItemList<long>());
-
- // delete the selection
- TItemList<long> oCurSelection(CWindowUtil::GetAllSelectedListCtrlItemLParams(&m_ctrlListJobs, false));
- GetGlobalJobList()->DeleteElems(oCurSelection);
-
- // update the list control
- ReFillInJobListCtrl(0, false);
-}
-
-void CFaac_winguiDlg::OnButtonProcessSelected()
-{
- if (!UpdateData(TRUE)) return;
-
- TItemList<long> oCurSelection(CWindowUtil::GetAllSelectedListCtrlItemLParams(&m_ctrlListJobs, false));
- ProcessJobs(oCurSelection, m_bCheckRemoveProcessedJobs!=0);
-
- CJobList *poJobList=GetGlobalJobList();
-}
-
-void CFaac_winguiDlg::OnRclickListJobs(NMHDR* pNMHDR, LRESULT* pResult)
-{
- // TODO: Add your control notification handler code here
- OnJobListCtrlUserAction();
-
- *pResult = 0;
-}
-
-void CFaac_winguiDlg::OnButtonSaveJobList()
-{
- // TODO: Add your control notification handler code here
-
- //UpdateData(TRUE);
- // determine the standard file
- CString *poStandardFile=m_poCurrentStandardFile;
-
- // assemble the filter string
- CString oFilter;
- {
- // assemble a list of allowed filters
- TItemList<int> oFilters;
- oFilters.AddNewElem(IDS_JobListFileFilter, 1);
- oFilters.AddNewElem(IDS_AllFilesFilter, 2);
- oFilter=CFileMaskAssembler::GetFileMask(oFilters);
- }
-
- // find out the default extension
- CString oDefaultExt;
- oDefaultExt.LoadString(IDS_JobListFileFilter);
-
- CFileDialog oOpenDialog(
- FALSE, // file save mode
- oDefaultExt, // default extension
- (poStandardFile!=0 ? *poStandardFile : (LPCTSTR)0), // default file
- OFN_HIDEREADONLY,
- oFilter);
- if (oOpenDialog.DoModal()==IDOK)
- {
- // the file has been selected
- ReleaseStandardFile();
- m_poCurrentStandardFile=new CString(oOpenDialog.GetPathName());
- SaveJobList(*m_poCurrentStandardFile);
- }
- else
- {
- // user abort or error
- if (CommDlgExtendedError()!=0)
- {
- // an error occured
- AfxMessageBox(IDS_ErrorDuringFileSelection);
- }
- }
-
- //UpdateData(FALSE);
-}
-
-void CFaac_winguiDlg::OnButtonLoadJobList()
-{
- // TODO: Add your control notification handler code here
- //UpdateData(TRUE);
- // determine the standard file
- CString *poStandardFile=m_poCurrentStandardFile;
-
- // assemble the filter string
- CString oFilter;
- {
- // assemble a list of allowed filters
- TItemList<int> oFilters;
- oFilters.AddNewElem(IDS_JobListFileFilter, 1);
- oFilters.AddNewElem(IDS_AllFilesFilter, 2);
- oFilter=CFileMaskAssembler::GetFileMask(oFilters);
- }
-
- // find out the default extension
- CString oDefaultExt;
- oDefaultExt.LoadString(IDS_JobListFileFilter);
-
- CFileDialog oOpenDialog(
- TRUE, // file open mode
- oDefaultExt, // default extension
- (poStandardFile!=0 ? *poStandardFile : (LPCTSTR)0), // default file
- OFN_HIDEREADONLY | OFN_FILEMUSTEXIST,
- oFilter);
- if (oOpenDialog.DoModal()==IDOK)
- {
- // the file has been selected
- ReleaseStandardFile();
- m_poCurrentStandardFile=new CString(oOpenDialog.GetPathName());
- LoadJobList(*m_poCurrentStandardFile);
- }
- else
- {
- // user abort or error
- if (CommDlgExtendedError()!=0)
- {
- // an error occured
- AfxMessageBox(IDS_ErrorDuringFileSelection);
- }
- }
-
- //UpdateData(FALSE);
-}
-
-void CFaac_winguiDlg::OnButtonDuplicateSelected()
-{
- // TODO: Add your control notification handler code here
-
- CJobList *poJobList=GetGlobalJobList();
-
- TItemList<long> oCurSelection(CWindowUtil::GetAllSelectedListCtrlItemLParams(&m_ctrlListJobs, true));
- if (oCurSelection.GetNumber()==0)
- {
- // error message corresponds to last argument of the CWindowUtil::GetAll[...] call
- // currently we don't display an error message if no item is selected
- return;
- }
- TItemList<long> oNewSelection(oCurSelection);
- //TItemList<long> oNewSelection; // enable this line instead of the previous one if you don't want to keep the previously selected items selected
-
- CBListReader oReader(oCurSelection);
- long lCurIndex;
- while (oCurSelection.GetNextElemContent(oReader, lCurIndex))
- {
- // get the current job
- CJob *poJob=poJobList->GetJob(lCurIndex);
- long lNewIndex=poJobList->AddJob(*poJob);
- oNewSelection.AddNewElem(lNewIndex);
- }
-
- // update the list control
- {
- CListCtrlStateSaver oNewSelectionState;
- oNewSelectionState.SetToSelected(oNewSelection);
- ReFillInJobListCtrl(&oNewSelectionState, false);
-
- // the selection may have changed, so make sure the property
- // dialog is updated
- OnJobListCtrlUserAction();
- }
-}
-
-void CFaac_winguiDlg::OnButtonProcessAll()
-{
- // TODO: Add your control notification handler code here
- if (!UpdateData(TRUE)) return;
-
- ProcessJobs(GetGlobalJobList()->GetAllUsedIds(), m_bCheckRemoveProcessedJobs!=0);
-}
-
-void CFaac_winguiDlg::ProcessJobs(TItemList<long> oJobIds, bool bRemoveProcessJobs)
-{
- if (oJobIds.GetNumber()==0) return;
- CJobList *poJobList=GetGlobalJobList();
-
- // disable the properties window; important - otherwise the user
- // could change selected jobs while they are being processed
- CPropertiesDummyParentDialog *poPropertiesDialog=((CFaac_winguiApp*)AfxGetApp())->GetGlobalPropertiesDummyParentDialogSingleton();
- poPropertiesDialog->EnableWindow(FALSE);
-
- CListCtrlStateSaver oListCtrlState(&m_ctrlListJobs);
-
-#ifdef EXTENDED_JOB_TRACKING_DURING_PROCESSING
- {
- TItemList<long> oSelectedItems(oJobIds);
- CWindowUtil::SetListCtrlCheckBoxStyle(&m_ctrlListJobs, true);
- CListCtrlStateSaver oTempCheckBoxState;
- oTempCheckBoxState.SetToChecked(oSelectedItems);
- oTempCheckBoxState.RestoreState(&m_ctrlListJobs);
- }
-#endif
-
- TItemList<long> oItemsToRemove;
-
- long lTotalNumberOfJobsToProcess=oJobIds.GetNumber();
- long lCurJobCount=0;
- long lSuccessfulJobs=0;
- CJobProcessingDynamicUserInputInfo oUserInputInfo; // saves dynamic input of the user
-
- CBListReader oReader(oJobIds);
- long lCurIndex;
- bool bContinue=true;
- while (oJobIds.GetNextElemContent(oReader, lCurIndex))
- {
- // only mark the currently processed job in the list control
- {
- CListCtrlStateSaver oSelection;
- oSelection.SetToSelected(lCurIndex);
- oSelection.RestoreState(&m_ctrlListJobs);
- int iCurItem=CWindowUtil::GetListCtrlItemIdByLParam(&m_ctrlListJobs, lCurIndex);
- if (iCurItem>=0)
- {
- m_ctrlListJobs.EnsureVisible(iCurItem, FALSE);
- }
- }
-
- // get the current job
- CJob *poJob=poJobList->GetJob(lCurIndex);
- poJob->SetJobNumberInfo(lCurJobCount++, lTotalNumberOfJobsToProcess);
-
- if (bContinue)
- {
- if (!poJob->ProcessJob(oUserInputInfo))
- {
- // show changes in process states
- ReFillInJobListCtrl(0, true);
- if (poJob->GetProcessingOutcomeSimple()==CAbstractJob::eUserAbort)
- {
- if (AfxMessageBox(IDS_ErrorProcessingJobSelection, MB_YESNO)!=IDYES)
- {
- bContinue=false;
- }
- }
- }
- else
- {
- // successfully processed
- lSuccessfulJobs++;
- if (bRemoveProcessJobs)
- {
- int iListItem=CWindowUtil::GetListCtrlItemIdByLParam(&m_ctrlListJobs, lCurIndex);
- ASSERT(iListItem>=0); // must exist (logically)
- m_ctrlListJobs.DeleteItem(iListItem);
-
- oItemsToRemove.AddNewElem(lCurIndex);
- }
- else
- {
- // show changes in process states
- ReFillInJobListCtrl(0, true);
- }
- }
- }
- else
- {
- // mark job as aborted
-
- // cast is necessary here because CJob masks the required overload
- // due to overriding another one
- ((CAbstractJob*)poJob)->SetProcessingOutcome(CAbstractJob::eUserAbort, 0, IDS_FollowUp);
- }
- }
-
-#ifdef EXTENDED_JOB_TRACKING_DURING_PROCESSING
- {
- CWindowUtil::SetListCtrlCheckBoxStyle(&m_ctrlListJobs, false);
- }
-#endif
-
- oListCtrlState.RestoreState(&m_ctrlListJobs);
-
- if (oItemsToRemove.GetNumber()>0)
- {
- OnJobListCtrlUserAction(); // this call is very important since the property dialog must be informed about the new selection before the underlying jobs are deleted
- poJobList->DeleteElems(oItemsToRemove);
- ReFillInJobListCtrl(0, false);
-
- // the selection may have changed, so make sure the property
- // dialog is updated
- OnJobListCtrlUserAction();
- }
- else
- {
- // show changes in process states
- ReFillInJobListCtrl(0, true);
- }
-
- // wake up the user
- MessageBeep(MB_OK);
-
- if (lSuccessfulJobs<lTotalNumberOfJobsToProcess)
- {
- AfxMessageBox(IDS_HadUnsuccessfulJobs);
- }
-
- // reenable the properties window we disabled at the beginning
- poPropertiesDialog->EnableWindow(TRUE);
-}
-
-bool CFaac_winguiDlg::LoadJobList(const CString &oCompletePath)
-{
- // the file has been selected
- CFileSerializableJobList oJobList;
- if (!oJobList.LoadFromFile(oCompletePath, 1))
- {
- AfxMessageBox(IDS_ErrorWhileLoadingJobList, MB_OK | MB_ICONSTOP);
- return false;
- }
- else
- {
- // first make sure the property window doesn't contain anything
- CWindowUtil::DeleteAllListCtrlItems(&m_ctrlListJobs);
- OnJobListCtrlUserAction();
-
- *GetGlobalJobList()=oJobList;
- ReFillInJobListCtrl(0, false);
- return true;
- }
-}
-
-bool CFaac_winguiDlg::SaveJobList(const CString &oCompletePath)
-{
- // the file has been selected
- CFileSerializableJobList oJobList(*GetGlobalJobList());
- if (!oJobList.SaveToFile(oCompletePath, 1))
- {
- AfxMessageBox(IDS_ErrorWhileSavingJobList, MB_OK | MB_ICONSTOP);
- return false;
- }
- else
- {
- return true;
- }
-}
-
-void CFaac_winguiDlg::OnButtonOpenProperties()
-{
- // TODO: Add your control notification handler code here
- ShowPropertiesWindow();
-}
-
-void CFaac_winguiDlg::OnShowWindow(BOOL bShow, UINT nStatus)
-{
- CDialog::OnShowWindow(bShow, nStatus);
-
- // TODO: Add your message handler code here
-
-}
-
-void CFaac_winguiDlg::OnButtonExpandFilterJob()
-{
- // TODO: Add your control notification handler code here
- TItemList<long> oCurSelection(CWindowUtil::GetAllSelectedListCtrlItemLParams(&m_ctrlListJobs, false));
-
- long lSelectedJobId;
- long lDummy;
- oCurSelection.GetFirstElemContent(lSelectedJobId, lDummy);
-
- CJobList *poGlobalJobList=GetGlobalJobList();
- CJob *poJob=poGlobalJobList->GetJob(lSelectedJobId);
- CJobList oExpanded;
- long lExpandErrors=0;
- if (poJob->GetEncoderJob()==0)
- {
- ASSERT(false);
- return;
- }
- else if (poJob->GetEncoderJob()->ExpandFilterJob(oExpanded, lExpandErrors, false))
- {
- int iListItemToDelete=CWindowUtil::GetListCtrlItemIdByLParam(&m_ctrlListJobs, lSelectedJobId);
- if (iListItemToDelete>=0)
- {
- m_ctrlListJobs.DeleteItem(iListItemToDelete);
- OnJobListCtrlUserAction(); // this call is very important since the property dialog must be informed about the new selection before the underlying jobs are deleted
- }
- poGlobalJobList->DeleteElem(lSelectedJobId);
- *poGlobalJobList+=oExpanded;
-
- CListCtrlStateSaver oListSelection;
- oListSelection.SetToSelected(oExpanded.GetAllUsedIds());
- ReFillInJobListCtrl(&oListSelection, false);
- OnJobListCtrlUserAction(); // again: very important call
- }
-}
-
-void CFaac_winguiDlg::OnButtonAddFilterEncoderJob()
-{
- // TODO: Add your control notification handler code here
- CJobList *poJobList=GetGlobalJobList();
-
- TItemList<long> m_oIndicesOfAddedItems;
-
- // select a directory
- CString oCaption;
- oCaption.LoadString(IDS_SelectSourceDirDlgCaption);
- CFolderDialog oFolderDialog(this, oCaption);
- if (oFolderDialog.DoModal()==IDOK)
- {
- CFilePathCalc::MakePath(oFolderDialog.m_oFolderPath);
- }
- else
- {
- if (oFolderDialog.m_bError)
- {
- AfxMessageBox(IDS_ErrorDuringDirectorySelection);
- }
- return;
- }
- CString oSourceFileExt;
- oSourceFileExt.LoadString(IDS_EndSourceFileStandardExtension);
-
- // create a new job for the current file
- CEncoderJob oNewJob;
- GetGlobalProgramSettings()->ApplyToJob(oNewJob);
-
- oNewJob.GetFiles().SetSourceFileDirectory(oFolderDialog.m_oFolderPath);
- oNewJob.GetFiles().SetSourceFileName(CString("*.")+oSourceFileExt);
- //oNewJob.GetFiles().SetTargetFileDirectory(oTargetDir); // already set by GetGlobalProgramSettings()->ApplyToJob(oNewJob);
- oNewJob.GetFiles().SetTargetFileName("");
-
- long lNewIndex=poJobList->AddJob(oNewJob);
- m_oIndicesOfAddedItems.AddNewElem(lNewIndex);
-
- CListCtrlStateSaver oSelection;
- oSelection.SetToSelected(m_oIndicesOfAddedItems);
- ReFillInJobListCtrl(&oSelection, false);
-
- m_ctrlListJobs.SetFocus();
-
- OnJobListCtrlUserAction();
-}
-
-void CFaac_winguiDlg::OnButtonAddEmptyEncoderJob()
-{
- // TODO: Add your control notification handler code here
- CJobList *poJobList=GetGlobalJobList();
-
- TItemList<long> m_oIndicesOfAddedItems;
-
- // create a new job for the current file
- CEncoderJob oNewJob;
- //GetGlobalProgramSettings()->ApplyToJob(oNewJob);
-
- oNewJob.GetFiles().SetSourceFileDirectory("");
- oNewJob.GetFiles().SetSourceFileName("");
- oNewJob.GetFiles().SetTargetFileDirectory("");
- oNewJob.GetFiles().SetTargetFileName("");
-
- long lNewIndex=poJobList->AddJob(oNewJob);
- m_oIndicesOfAddedItems.AddNewElem(lNewIndex);
-
- CListCtrlStateSaver oSelection;
- oSelection.SetToSelected(m_oIndicesOfAddedItems);
- ReFillInJobListCtrl(&oSelection, false);
-
- m_ctrlListJobs.SetFocus();
-
- OnJobListCtrlUserAction();
-}
--- a/wingui/faac_winguiDlg.h
+++ /dev/null
@@ -1,129 +1,0 @@
-// faac_winguiDlg.h : header file
-// Author: Torsten Landmann
-//
-///////////////////////////////////
-
-#if !defined(AFX_FAAC_WINGUIDLG_H__DFE38E67_0E81_11D5_8402_0080C88C25BD__INCLUDED_)
-#define AFX_FAAC_WINGUIDLG_H__DFE38E67_0E81_11D5_8402_0080C88C25BD__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-#include "ListCtrlStateSaver.h"
-#include "JobListUpdatable.h"
-
-/////////////////////////////////////////////////////////////////////////////
-// CFaac_winguiDlg dialog
-
-class CFaac_winguiDlg : public CDialog, public CJobListUpdatable
-{
-// Construction
-public:
- CFaac_winguiDlg(CWnd* pParent = NULL); // standard constructor
- virtual ~CFaac_winguiDlg();
-
-// Dialog Data
- //{{AFX_DATA(CFaac_winguiDlg)
- enum { IDD = IDD_FAAC_WINGUI_DIALOG };
- CButton m_ctrlButtonExpandFilterJob;
- CButton m_ctrlButtonOpenProperties;
- CListCtrl m_ctrlListJobs;
- BOOL m_bCheckRemoveProcessedJobs;
- //}}AFX_DATA
-
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CFaac_winguiDlg)
- protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- //}}AFX_VIRTUAL
-
-protected:
- CJobList* GetGlobalJobList() { return &((CFaac_winguiApp*)AfxGetApp())->GetGlobalJobList(); }
- CFaacWinguiProgramSettings* GetGlobalProgramSettings() { return &((CFaac_winguiApp*)AfxGetApp())->GetGlobalProgramSettings(); }
-
-public:
-
- // a properties window that hides itself should call this member first
- // so that the "Open Properties" button gets enabled; once this button
- // is pressed ShowWindow is called for the window formerly specified and
- // the button is hidden again
- void HidePropertiesWindow(CWnd *poPropertiesWindow);
- void ShowPropertiesWindow();
-
-// Implementation
-protected:
- HICON m_hIcon;
-
- // Generated message map functions
- //{{AFX_MSG(CFaac_winguiDlg)
- virtual BOOL OnInitDialog();
- afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
- afx_msg void OnPaint();
- afx_msg HCURSOR OnQueryDragIcon();
- afx_msg void OnButtonAddEncoderJob();
- afx_msg void OnClickListJobs(NMHDR* pNMHDR, LRESULT* pResult);
- afx_msg void OnKeydownListJobs(NMHDR* pNMHDR, LRESULT* pResult);
- afx_msg void OnButtonDeleteJobs();
- afx_msg void OnButtonProcessSelected();
- afx_msg void OnRclickListJobs(NMHDR* pNMHDR, LRESULT* pResult);
- afx_msg void OnButtonSaveJobList();
- afx_msg void OnButtonLoadJobList();
- afx_msg void OnButtonDuplicateSelected();
- afx_msg void OnButtonProcessAll();
- afx_msg void OnButtonOpenProperties();
- afx_msg void OnShowWindow(BOOL bShow, UINT nStatus);
- afx_msg void OnButtonExpandFilterJob();
- afx_msg void OnButtonAddFilterEncoderJob();
- afx_msg void OnButtonAddEmptyEncoderJob();
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-
- friend class CPropertiesTabParentDialog;
-
- // implementation to CJobListUpdatable;
- // this method refills the job list control;
- // if no explicit selection state is specified the current
- // selection is preserved;
- // bSimpleUpdate may be set to true; if it is, no items are added
- // or removed and only the info column is updated
- virtual void ReFillInJobListCtrl(CListCtrlStateSaver *poSelectionStateToUse=0, bool bSimpleUpdate=true);
- virtual void EnableExpandFilterJobButton(bool bEnable);
-
- TItemList<long> m_lLastJobListSelection;
- void OnJobListCtrlUserAction();
-
- // by defining the parameter you can define which new selection is
- // to be assumed; if 0 is specified the method determines the actual
- // selection
- void OnJobListCtrlSelChange(TItemList<long> *poNewSelection=0);
-
- // this is a very special variable; if it is <0 it affects nothing;
- // if, however, it is >=0 it is incremented each time a call to
- // ReFillInJobListCtrl()) is made; in this case the call is ignored
- // (no list control operation is done)
- int m_iListCtrlUpdatesCounter;
-
- // when this variable is !=0 it contains the current file to
- // propose when file interaction is done
- CString *m_poCurrentStandardFile;
- void ReleaseStandardFile() { if (m_poCurrentStandardFile!=0) delete m_poCurrentStandardFile; }
-
- // processes all jobs whose ids are in the specified list
- void ProcessJobs(TItemList<long> oJobIds, bool bRemoveProcessJobs=false);
-
- // file interaction; note that the load method also
- // takes care of refilling the list control; both methods
- // display error messages; thus their return values are
- // only informative
- bool LoadJobList(const CString &oCompletePath);
- bool SaveJobList(const CString &oCompletePath);
-
- // this member is used by the DefinePropertiesWindowToSetToEnableButton method
- CWnd *m_poHiddenPropertiesWindow;
-};
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_FAAC_WINGUIDLG_H__DFE38E67_0E81_11D5_8402_0080C88C25BD__INCLUDED_)
--- a/wingui/listobj.h
+++ /dev/null
@@ -1,266 +1,0 @@
-// list class
-// Copyright 1999, Torsten Landmann
-// successfully compiled and tested under MSVC 6.0
-//
-// revised 2001 by Torsten Landmann
-// successfully compiled and tested under MSVC 6.0
-//
-//////////////////////////////////////////////////////
-
-#ifndef __Listobj_h__
-#define __Listobj_h__
-
-#include "stdafx.h"
-
-typedef signed long TBListErr;
-
-const long iMaxNumberOfCBListItems=100000000;
-const TBListErr siListNoErr=0;
-const TBListErr siListErr=-1; // error codes
-const TBListErr siListSavErr=-2;
-const long lMaxNumRS=256; // maximum number of reading sessions
-
-// public use of this type is obsolete; use CBListReader instead
-typedef signed long HRead;
-
-// objects of this class can be compared with a moving pointer to
-// a certain element in a list; it's used during sequential reading
-// of lists;
-// this class wraps HRead and automatically finishes the read
-// session once an instance becomes destructed
-class CBListReader
-{
- friend class CBList;
-
-public:
- // simplest way to get a reader
- CBListReader(CBList &oList);
-
- // copy constructor
- CBListReader(const CBListReader &oSource);
-
- virtual ~CBListReader();
-
- // makes this class compatible with former HRead
- operator HRead() const { return m_hRead; }
-
- CBListReader& operator=(const CBListReader &oRight);
-
- void EndReaderSession() { AbandonCurrentContent(); }
-
-protected:
- CBListReader(CBList *poList, HRead hRead);
-
-private:
- CBList *m_poList;
- HRead m_hRead;
- int *m_piUsageStack;
-
- void AbandonCurrentContent();
-};
-
-enum ESortMode
-{
- eAscending,
- eDescending
-};
-
-class CBList;
-
-class CBBaseElem
-{
- friend class CBList;
-
-public:
- class CBBaseElem *GetNext() const { return pNext; }
- class CBBaseElem *GetPrevious() const { return pPrevious; }
- long GetIndex() const { return lIndex; }
- class CBList *GetParentList() const { return pParentList; }
-
- // -1: parameter element is higher
- // 0: same
- // 1: parameter element is smaller
- // in this base class elements are sorted by their index
- virtual signed long IsHigher(class CBBaseElem *pElem);
-
-protected:
- CBBaseElem(); // only allowed for derivations and for CBList (=friend)
- virtual ~CBBaseElem();
-
- // override these members if you want to put your list
- // to a stream or retreive it from there;
- // do never forget to call these ones if you override them
- virtual bool PutToArchive(CArchive &oArchive, long lSaveParams) const;
- virtual bool GetFromArchive(CArchive &oArchive, long lLoadParams);
-private:
- long lIndex;
- class CBBaseElem *pNext, *pPrevious;
- class CBList *pParentList;
-};
-
-typedef CBBaseElem *PBBaseElem;
-
-class CBList
-{
-public:
- CBList();
- virtual ~CBList();
- TBListErr DeleteAll();
-
- TBListErr DeleteElem(long lIndex);
- bool Exists(long lIndex) const;
-
- // number of elements; error: siListErr
- signed long GetNumber() const;
-
- // error: 0
- PBBaseElem GetElem(long lIndex) const;
-
- // returns the element that is at the 0-based position
- // that's given by parameter; always count from first Element
- // on; error: 0
- PBBaseElem GetPos(long lPos) const;
-
- // finds out the position of the element with the specified
- // index; siListErr in case of errors
- long GetIndexPos(long lIndex) const;
-
- // sort using method "IsHigher()"
- // error: siListErr
- TBListErr Sort(ESortMode eSortMode=eAscending);
-
- // returns old state
- bool SetSortBeforeReading(bool bNewValue);
-
-
- PBBaseElem GetFirst() { return pFirst; }
- PBBaseElem GetLast() { return pLast; }
-
-
- // *******************************************
- // using the following methods you get the elements in the order
- // in which they are in the list
- // if a call of SetSortBeforeReading(true) has taken place, the
- // list is sorted beforehands;
- // as long as reading sessions are open the list is locked
- // and no data can be changed!! this includes that you cannot
- // sort or change the sort-before-reading-state
-
- // initializes a new reading session
- // returns a handle to this reading session
- // list is sorted if set using method "setsortbeforereading()"
- // error: siListErr
- // maximum number of reading sessions is limited by constant
- // iMaxNumRS
- HRead BeginRead(); // obsolete; use CBListReader BeginReadEx() instead!
- CBListReader BeginReadEx();
-
-
- // error: 0
- PBBaseElem ReadElem(HRead hRead);
-
- // end reading session designated by hRead
- TBListErr EndRead(HRead hRead);
-
- // usually you do not need to call this method; you have the choice to
- // call oReader.EndReaderSession() instead or not explicitely ending the
- // sessiion at all;
- // explicitely ending the session might be useful if you know that the
- // parent list will be destructed before the reader;
- TBListErr EndRead(CBListReader &oReader);
-
- // performs calls the OnMapHandle() member exactly one time for
- // each of the list element in the order in which they are in
- // the list; if SetSortBeforeReading(true) has been done the list is
- // sorted;
- // the return value is true if each call of OnMapHandle() returned
- // true, false otherwise;
- // note that the first sentence in this comment isn't quite correct;
- // if OnMapHandle() returns false, the operation is not continued
- bool Map(long lTask, long lHint);
-
-
- // puts the whole list with all its data to a stream
- // or retreives it from there
- TBListErr PutToArchive(CArchive &oArchive, long lSaveParams=-1) const;
- TBListErr GetFromArchive(CArchive &oArchive, long lLoadParams=-1);
-
- // self explaining
- TBListErr SaveToFile(const char *lpszFileName, long lSaveParams=-1);
- TBListErr LoadFromFile(const char *lpszFileName, long lLoadParams=-1);
-
-protected:
- // properly inserts a new element in the list
- // a pointer to it is given back;
- // the new element has an index between (including)
- // 1 and iMaxNumberOfCBListItems
- PBBaseElem Add();
- // this version tries to give the given index
- // to the new element, if possible; negative values and 0
- // are NOT used!
- PBBaseElem Add(long lDesiredIndex);
-
- // this member works together with the Map() member; look there for
- // further information
- virtual bool OnMapHandle(CBBaseElem *poElem, long lTask, long lHint);
-
- // the following method must be overriden by every
- // subclass returning an element of the type of the particular
- // subclass of PBBaseElem
- virtual PBBaseElem CreateElem()=0;
-
- // this method is called immediately before and element is
- // to be deleted via delete;
- // it does nothing here but you may override it to free
- // other variables the content is referring to
- // !!! EXTREMELY IMPORTANT: !!!
- // if you override this method you MUST call
- // DeleteAll() in the destructor of your class
- virtual void OnPreDeleteItem(PBBaseElem poElem);
-
-private:
- // content of elements is not changed; their position in the list
- // is exchanged; error: siListErr
- TBListErr Exchange(PBBaseElem pOne, PBBaseElem pTwo);
-
- // Performs a bubble sort on the given interval
- // note that there is no validation checking (e.g. if
- // pLeft is really left of pRight)
- // (sorting algorithms like quicksort or heapsort are not
- // useful on lists. They work only good and fast on arrays,
- // so I decided to implement bubble sort)
- // pLeft and pRight refer to the pointers; a pNext-Pointer
- // always points right, so by only using pNext-Pointers on
- // pLeft you MUST reach pRight at some time; otherwise
- // the programm will be going to crash with an access
- // violation
- // return value siListErr: error (e.g. no element in list)
- TBListErr DoBubbleSort(PBBaseElem pLeft, PBBaseElem pRight, ESortMode eSortMode);
-
-
- // finds the lowest available index that can be given to
- // a new element; used by method "Add()"
- signed long GetSmallestIndex();
-
- // finds an open reading position; used by method BeginRead()
- signed long FindOpenReadPos() const;
-
- // finds the lowest element in the list; used by "DoBubbleSort()"
- PBBaseElem FindLowest(PBBaseElem pBeginFrom, PBBaseElem pGoTo, ESortMode eSortMode);
-
- PBBaseElem pFirst, pLast;
-
- PBBaseElem pReadPos[256];
- bool bReadEntryUsed[256];
- long lNumOfOpenReadingSessions;
-
- bool SortBeforeReading;
-
- // saves the last index number that has been given
- // to a new element
- long lCurrentIndex;
-
-};
-typedef CBList *PBList;
-
-#endif // #ifndef __Listobj_h__
\ No newline at end of file
binary files a/wingui/res/faac_wingui.ico /dev/null differ
--- a/wingui/res/faac_wingui.rc2
+++ /dev/null
@@ -1,13 +1,0 @@
-//
-// FAAC_WINGUI.RC2 - resources Microsoft Visual C++ does not edit directly
-//
-
-#ifdef APSTUDIO_INVOKED
- #error this file is not editable by Microsoft Visual C++
-#endif //APSTUDIO_INVOKED
-
-
-/////////////////////////////////////////////////////////////////////////////
-// Add manually edited resources here...
-
-/////////////////////////////////////////////////////////////////////////////
binary files a/wingui/res/toolbarm.bmp /dev/null differ
--- a/wingui/resource.h
+++ /dev/null
@@ -1,153 +1,0 @@
-//{{NO_DEPENDENCIES}}
-// Microsoft Developer Studio generated include file.
-// Used by faac_wingui.rc
-//
-#define IDM_ABOUTBOX 0x0010
-#define IDD_ABOUTBOX 100
-#define IDS_ABOUTBOX 101
-#define IDD_FAAC_WINGUI_DIALOG 102
-#define IDS_UndefinedShort 102
-#define IDS_UndefinedLong 103
-#define IDS_InvalidJob 104
-#define IDS_EncoderJobShort 105
-#define IDS_EncoderJobLong 106
-#define IDS_MidSide 107
-#define IDS_UseLfe 109
-#define IDS_NoListItemSelected 110
-#define IDS_JobTypeColumn 111
-#define IDS_JobInfoColumn 112
-#define IDS_EncoderGeneralShort 113
-#define IDS_EncoderId3Short 114
-#define IDS_TabUndefined 115
-#define IDS_EncoderQualityShort 116
-#define IDS_SelectSourceDirDlgCaption 117
-#define IDS_SelectTargetDirDlgCaption 118
-#define IDS_ErrorDuringDirectorySelection 119
-#define IDS_AllFilesFilter 120
-#define IDS_WavFilesFilter 121
-#define IDS_EndSourceFileStandardExtension 122
-#define IDS_ErrorDuringFileSelection 123
-#define IDS_AacFilesFilter 124
-#define IDS_EndTargetFileStandardExtension 125
-#define IDS_UseTns 126
-#define IDS_UseLtp 127
-#define IDR_MAINFRAME 128
-#define IDS_AacProfileLc 128
-#define IDD_PROPERTIESTABPARENTDIALOG 129
-#define IDS_AacProfileMain 129
-#define IDD_ENCODERGENERALPAGEDIALOG 130
-#define IDS_AacProfileSsr 130
-#define IDD_FLOATINGPROPERTYDIALOG 131
-#define IDS_DetailedEncoderJobDescriptionString 131
-#define IDD_PROPERTIESDUMMYPARENTDIALOG 132
-#define IDS_JobListFileFilter 132
-#define IDD_ENCODERID3PAGEDIALOG 133
-#define IDS_JobListStandardExtension 133
-#define IDD_ENCODERQUALITYPAGEDIALOG 134
-#define IDS_ErrorWhileSavingJobList 134
-#define IDS_SearchParametersInvalid 135
-#define IDD_PROCESSJOBSTATUSDIALOG 136
-#define IDS_ErrorProcessingJobSelection 136
-#define IDR_TOOLBARMAIN 137
-#define IDS_FilterDidntFindFiles 137
-#define IDS_ErrorCreatingNestedEncoderJob 138
-#define IDS_ErrorWhileLoadingJobList 139
-#define IDD_ASKCREATEDIRECTORYDIALOG 139
-#define IDS_JobNofM 140
-#define IDS_SubJobNofM 141
-#define IDS_ErrorCreatingDirectory 142
-#define IDS_FilterJobSupplementaryInfo 143
-#define IDS_UserRefusedToCreateTargetDirectory 144
-#define IDS_FaacEncSetConfigurationFailed 145
-#define IDS_CouldntOpenInputFile 146
-#define IDS_FaacEncEncodeFrameFailed 147
-#define IDS_JobProcessInfoColumn 148
-#define IDS_OutcomeUnprocessed 149
-#define IDS_OutcomeSuccessfullyProcessed 150
-#define IDS_OutcomePartiallyProcessed 151
-#define IDS_OutcomeUserAbort 152
-#define IDS_OutcomeError 153
-#define IDS_FollowUp 154
-#define IDS_ErrorCreatingTargetDiretory 155
-#define IDS_InvalidTargetDirectory 156
-#define IDS_HadUnsuccessfulJobs 157
-#define IDS_AacProfileLtp 158
-#define IDS_MpegVersion2 159
-#define IDS_MpegVersion4 160
-#define IDC_LISTJOBS 1000
-#define IDC_BUTTONADDENCODERJOB 1001
-#define IDC_TAB1 1002
-#define IDC_LABELNOSELECTION 1004
-#define IDC_EDITSOURCEDIR 1006
-#define IDC_BUTTONBROWSESOURCEDIR 1007
-#define IDC_EDITTARGETDIR 1008
-#define IDC_BUTTONBROWSETARGETDIR 1009
-#define IDC_EDITSOURCEFILE 1010
-#define IDC_BUTTONBROWSESOURCEFILE 1011
-#define IDC_EDITTARGETFILE 1012
-#define IDC_BUTTONBROWSETARGETFILE 1013
-#define IDC_EDITBITRATE 1014
-#define IDC_EDITBANDWIDTH 1015
-#define IDC_CHECKMIDSIDE 1016
-#define IDC_CHECKUSELFE 1017
-#define IDC_LABELDEBUGTAG 1018
-#define IDC_EDITARTIST 1019
-#define IDC_EDITTRACK 1020
-#define IDC_EDITTITLE 1021
-#define IDC_EDITURL 1023
-#define IDC_EDITALBUM 1024
-#define IDC_EDITYEAR 1025
-#define IDC_EDITCOMPOSER 1026
-#define IDC_EDITORIGINALARTIST 1027
-#define IDC_CHECKCOPYRIGHT 1029
-#define IDC_EDITCOMMENT 1030
-#define IDC_EDITENCODEDBY 1031
-#define IDC_COMBOGENRE 1032
-#define IDC_BUTTONDELETEJOBS 1033
-#define IDC_BUTTONPROCESSSELECTED 1034
-#define IDC_LABELTOPSTATUSTEXT 1035
-#define IDC_PROGRESS1 1036
-#define IDC_LABELBOTTOMSTATUSTEXT 1037
-#define IDC_BUTTONABORT 1038
-#define IDC_BUTTONPAUSE 1039
-#define IDC_BUTTONCONTINUE 1041
-#define IDC_CHECKREMOVEPROCESSEDJOBS 1042
-#define IDC_CHECKUSETNS 1043
-#define IDC_CHECKUSELTP 1044
-#define IDC_RADIOAACPROFILELC 1045
-#define IDC_RADIOAACPROFILEMAIN 1046
-#define IDC_RADIOAACPROFILESSR 1047
-#define IDC_BUTTON1 1048
-#define IDC_BUTTONSAVEJOBLIST 1049
-#define IDC_RADIOAACPROFILELTP 1049
-#define IDC_BUTTONLOADJOBLIST 1050
-#define IDC_BUTTONDUPLICATESELECTED 1051
-#define IDC_CHECKRECURSIVE 1052
-#define IDC_BUTTONPROCESSALL 1053
-#define IDC_BUTTONOPENPROPERTIES 1054
-#define IDC_BUTTONMINIMIZEAPP 1055
-#define IDC_BUTTONEXPANDFILTERJOB 1056
-#define IDC_LABELTARGETDIR 1057
-#define IDC_BUTTONNO 1058
-#define IDC_BUTTONALWAYS 1059
-#define IDC_BUTTONYES 1060
-#define IDC_BUTTONNEVER 1061
-#define IDC_BUTTONADDFILTERENCODERJOB 1062
-#define IDC_BUTTONADDEMPTYENCODERJOB 1063
-#define IDC_RADIOMPEGVERSION2 1064
-#define IDC_RADIOMPEGVERSION4 1065
-#define ID_BUTTON32771 32771
-#define ID_BUTTON32772 32772
-#define ID_BUTTON32773 32773
-#define ID_BUTTON32774 32774
-
-// Next default values for new objects
-//
-#ifdef APSTUDIO_INVOKED
-#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE 140
-#define _APS_NEXT_COMMAND_VALUE 32775
-#define _APS_NEXT_CONTROL_VALUE 1065
-#define _APS_NEXT_SYMED_VALUE 101
-#endif
-#endif