1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072 |
- // NeroDlg1.cpp : implementation file
- //
- #include "stdafx.h"
- #include "LYFZIPManage.h"
- #include "NeroDlg.h"
-
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- //#pragma comment(lib, "NeroAPIGlue.lib")
- /////////////////////////////////////////////////////////////////////////////
- // CNeroDlg dialog
- CNeroDlg* pDlg;
- CNeroDlg::CNeroDlg(CWnd* pParent /*=NULL*/)
- : CDialog(CNeroDlg::IDD, pParent)
- {
- //{{AFX_DATA_INIT(CNeroDlg)
- m_bFromDir = 0;
- m_bDvd = 0;
- m_checkphoto1 = 1;
- m_checkphoto2 = FALSE;
- m_checkphoto3 = FALSE;
- m_checkphoto4 = FALSE;
- m_checkphoto5 = FALSE;
- m_checkphoto6 = FALSE;
- //}}AFX_DATA_INIT
- pDlg=this;
- NowDoingBurn=false;
- m_nphotos=0;
- m_nspase=0;
- m_nphotos1=0;
- m_nspase1=0;
- m_nphotos2=0;
- m_nspase2=0;
- m_nphotos3=0;
- m_nspase3=0;
- m_nphotos4=0;
- m_nspase4=0;
- m_nphotos5=0;
- m_nspase5=0;
- m_nphotos6=0;
- m_nspase6=0;
- }
- void CNeroDlg::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CNeroDlg)
- DDX_Control(pDX, IDC_PROGRESS1, m_Progress);
- DDX_Radio(pDX, IDC_RADIO3, m_bFromDir);
- DDX_Radio(pDX, IDC_RADIO1, m_bDvd);
- DDX_Check(pDX, IDC_CHECK1, m_checkphoto1);
- DDX_Check(pDX, IDC_CHECK2, m_checkphoto2);
- DDX_Check(pDX, IDC_CHECK3, m_checkphoto3);
- DDX_Check(pDX, IDC_CHECK4, m_checkphoto4);
- DDX_Check(pDX, IDC_CHECK5, m_checkphoto5);
- DDX_Check(pDX, IDC_CHECK6, m_checkphoto6);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(CNeroDlg, CDialog)
- //{{AFX_MSG_MAP(CNeroDlg)
- ON_BN_CLICKED(IDC_RADIO3, OnRadio3)
- ON_BN_CLICKED(IDC_RADIO4, OnRadio4)
- ON_BN_CLICKED(IDC_BUTchoosedir, OnBUTchoosedir)
- ON_BN_CLICKED(IDC_CHECK1, OnCheck1)
- ON_BN_CLICKED(IDC_CHECK2, OnCheck2)
- ON_BN_CLICKED(IDC_CHECK3, OnCheck3)
- ON_BN_CLICKED(IDC_CHECK4, OnCheck4)
- ON_BN_CLICKED(IDC_CHECK5, OnCheck5)
- ON_BN_CLICKED(IDC_CHECK6, OnCheck6)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CNeroDlg message handlers
- BOOL CNeroDlg::OnInitDialog()
- {
- CDialog::OnInitDialog();
-
- m_Progress.SetRange(0,100);
- EnableCtrls();
- OnCheck1();
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
- }
- bool NERO_CALLBACK_ATTR CNeroDlg::IdleCallback(void *pUserData)
- {
- /*
- static MSG msg;
- while (!(((CNeroMFCappDlg*)pUserData)->mbAborted) &&::PeekMessage(&msg,NULL,NULL,NULL,PM_NOREMOVE))
- {
- if (!AfxGetThread()->PumpMessage())
- {
- break;
- }
- }
- return ((CNeroMFCappDlg*)pUserData)->mbAborted;
- */
- // AfxMessageBox("dsfsf",1,1);
- return true;
- }
- NeroUserDlgInOut NERO_CALLBACK_ATTR CNeroDlg::UserDialog(void *pUserData, NeroUserDlgInOut type, void *data)
- {
- AfxMessageBox("Dlg_USERDIALOG",1,1);
- switch (type)
- {
- case DLG_AUTO_INSERT:
- AfxMessageBox("Dlg_AUTO_INSET",1,1);
- return DLG_RETURN_CONTINUE;
- break;
- AfxMessageBox("Dlg_RETURN_CONTINUE",1,1);
- case DLG_DISCONNECT_RESTART:
- AfxMessageBox("Dlg_DISCONNECT_RESTART",1,1);
- return DLG_RETURN_ON_RESTART;
- break;
- case DLG_DISCONNECT:
- AfxMessageBox("Dlg_DISCONNECT",1,1);
- return DLG_RETURN_CONTINUE;
- break;
- case DLG_AUTO_INSERT_RESTART:
- AfxMessageBox("Dlg_AUTO_INSERT_RESTART",1,1);
- return DLG_RETURN_EXIT;
- break;
- case DLG_RESTART:
- AfxMessageBox("Dlg_RESTART",1,1);
- return DLG_RETURN_EXIT;
- break;
- case DLG_SETTINGS_RESTART:
- AfxMessageBox("DLG_SETTINGS_RESTART:",1,1);
- return DLG_RETURN_CONTINUE;
- break;
- case DLG_OVERBURN:
- AfxMessageBox("DLG_OVERBURN::",1,1);
- return DLG_RETURN_TRUE;
- break;
- case DLG_AUDIO_PROBLEMS:
- AfxMessageBox("DLG_AUDIO_PROBLEMS:",1,1);
- return DLG_RETURN_EXIT;
- break;
- case DLG_WAITCD:
- AfxMessageBox("Please insert a CDR or just click OK if you are using the Image Recorder.");
- return DLG_RETURN_EXIT;
- break;
- case DLG_WAITCD_REMINDER:
- break;
- case DLG_WAITCD_DONE:
- return DLG_RETURN_EXIT;
- break;
- case DLG_FILESEL_IMAGE:
- {
- static char BASED_CODE szFilter[] = "Image Files(*.nrg)|*.nrg|All Files (*.*)|*.*||";
- CFileDialog dlgOpen(TRUE, NULL, "test.nrg", OFN_OVERWRITEPROMPT,
- szFilter, ((CNeroDlg*)pUserData));
- if (dlgOpen.DoModal() == IDOK)
- {
- strcpy((char*)data,dlgOpen.GetPathName());
- return DLG_RETURN_TRUE;
- }
- else
- {
- return DLG_BURNIMAGE_CANCEL;
- }
- }
- break;
- default:
- break;
- }
- return DLG_RETURN_EXIT;
- }
- BOOL NERO_CALLBACK_ATTR CNeroDlg::ProgressCallback(void *pUserData, DWORD dwProgressInPercent)
- {
- ((CNeroDlg*)pUserData)->m_Progress.SetPos(dwProgressInPercent);
- //return ((CNeroMFCappDlg*)pUserData)->mbAborted;
- //AfxMessageBox("dsfsdf");
- return true;
- }
- BOOL NERO_CALLBACK_ATTR CNeroDlg::AbortedCallback(void *pUserData)
- {
- //return ((CNeroMFCappDlg*)pUserData)->mbAborted;
- return true;
- }
- void NERO_CALLBACK_ATTR CNeroDlg::AddLogLine(void *pUserData, NERO_TEXT_TYPE type, const char *text)
- {
-
- //((CNeroMFCappDlg*)pUserData)->AppendString("Log line:" +(CString)*text);
- return;
- }
- void NERO_CALLBACK_ATTR CNeroDlg::SetPhaseCallback(void *pUserData, const char *text)
- {
- //((CNeroMFCappDlg*)pUserData)->AppendString("Phase: " +(CString)*text);
- return;
- }
- void GenSPhoto(CString dir, CStringArray &array)
- { //AfxMessageBox(dir);
- using namespace helper_coffs;
- ffsco o;
- o.dirs(0);
- o.find(LPCSTR(dir), LPCSTR("*.*"));
- ffsco::typeT coo;
- ffsco::typeT::iterator it;
- coo = o.co_file();
- CString str;
- for (it = coo.begin();
- coo.end() != it;
- it ++)
- {
- str=(*it).c_str();
- if(str.GetAt (str.ReverseFind ('\\')+1)=='s')continue;
- if(str.Right (2)=="ok")continue;
- array.Add (str);
- }
- }
- int GetChildCount(CString str, CStringArray &array)
- {
- CString dirname=str.Right (str.GetLength ()-str.ReverseFind ('\\')-1);
- int count=array.GetSize ();
- CString temp;
- for(int i=0; i<array.GetSize (); i++)
- {
- if(array.ElementAt (i)==str)
- count--;
- else if(array.ElementAt (i).Find (str)==-1)
- count--;
- else
- {
- temp=array.ElementAt (i);
- temp=temp.Left (temp.ReverseFind ('\\'));
- if(temp!=str)
- count--;
- }
- }
- return count;
- }
- void CNeroDlg::OnCancel()
- {
- // TODO: Add extra cleanup here
- if(NowDoingBurn) //如果正在工作 则不能取消
- {
- if(m_Burn.NeroBurnOK)
- {
- CDialog::OnOK();
- return;
- }
- if(m_Burn.NeroWorkError)
- {
- CDialog::OnCancel();
- return;
- }
- AfxMessageBox("已经开始刻录了,不能中断");
- return;
- }
- CDialog::OnCancel(); //否则取消
- }
- void CNeroDlg::DoBurnOrNot()
- {
- m_Burn.NeroAPIInit();
- m_Burn.NeroAPIBurn();
- }
- BOOL CNeroDlg::PreTranslateMessage(MSG* pMsg)
- {
- return CDialog::PreTranslateMessage(pMsg);
- }
- void CNeroDlg::EnableCtrls()
- {
- GetDlgItem(IDC_CHECK1)->EnableWindow(!m_bFromDir);
- GetDlgItem(IDC_CHECK2)->EnableWindow(!m_bFromDir);
- GetDlgItem(IDC_CHECK3)->EnableWindow(!m_bFromDir);
- GetDlgItem(IDC_CHECK4)->EnableWindow(!m_bFromDir);
- GetDlgItem(IDC_CHECK5)->EnableWindow(!m_bFromDir);
- GetDlgItem(IDC_CHECK6)->EnableWindow(!m_bFromDir);
- GetDlgItem(IDC_BUTchoosedir)->EnableWindow(m_bFromDir);
- }
- void CNeroDlg::OnRadio3()
- {
- // TODO: Add your control notification handler code here
- UpdateData();
- EnableCtrls();
- }
- void CNeroDlg::OnRadio4()
- {
- // TODO: Add your control notification handler code here
- OnRadio3();
- }
- void CNeroDlg::OnBUTchoosedir()
- {
- // TODO: Add your control notification handler code here
- CString dir;
- GetSavePath(dir);
- dir.IsEmpty();
- GetDlgItem(IDC_EDIT1)->SetWindowText(dir);
- m_photoarray7.RemoveAll ();
- CString path;
- path =dir;
-
- CStringArray dirarray;
- CString str;
- using namespace helper_coffs;
- ffsco o;
- o.dirs(1);
- o.find(LPCSTR(path), LPCSTR("*.*"));
- ffsco::typeT coo;
- ffsco::typeT::iterator it;
- coo = o.co_dir();
- for (it = coo.begin();
- coo.end() != it;
- it ++)
- {
- str=(*it).c_str();
- if(FindArray(&dirarray, str)==-1)
- {
- dirarray.Add (str);
- }
- }
- for(int i=0; i<dirarray.GetSize (); i++)
- {
- using namespace helper_coffs;
- ffsco o;
- o.dirs(0);
- o.find(LPCSTR(dirarray.ElementAt (i)), LPCSTR("*.jpg"));
- ffsco::typeT coo;
- ffsco::typeT::iterator it;
- coo = o.co_file();
- for (it = coo.begin();
- coo.end() != it;
- it ++)
- {
- str=(*it).c_str();
- // if(str.GetAt (str.ReverseFind ('\\')+1)=='s')continue;
- m_photoarray7.Add (str);
- }
- }
- if(m_photoarray7.GetSize ()==0)
- {
- AfxMessageBox("警告:目录中无照片!", MB_ICONSTOP);
- }
- m_nphotos=m_photoarray7.GetSize ();
- m_nspase=0;
- for( i=0; i<m_photoarray7.GetSize (); i++)
- {
- CFile fp;
- if(fp.Open (m_photoarray7.ElementAt (i), CFile::modeRead))
- {
- m_nspase+=fp.GetLength ();
- fp.Close ();
- }
- }
-
- m_nspase/=(1024*1024);
- str.Format ("照片:%d 占用空间:%dM", m_nphotos, m_nspase);
- GetDlgItem(IDC_STATIC7)->SetWindowText(str);
- }
- void CNeroDlg::OnCheck1()
- {
- // TODO: Add your control notification handler code here
- UpdateData();
- if(m_checkphoto1)
- {
- if(m_photoarray1.GetSize ()==0)
- {
- CString path;
- path=g_path4+"\\";
- path+=m_id;
- path +="\\";
-
- CStringArray dirarray;
- CString str;
- using namespace helper_coffs;
- ffsco o;
- o.dirs(1);
- o.find(LPCSTR(path), LPCSTR("*.*"));
- ffsco::typeT coo;
- ffsco::typeT::iterator it;
- coo = o.co_dir();
- for (it = coo.begin();
- coo.end() != it;
- it ++)
- {
- str=(*it).c_str();
- if(FindArray(&dirarray, str)==-1)
- {
- dirarray.Add (str);
- }
- }
- for(int i=0; i<dirarray.GetSize (); i++)
- {
- using namespace helper_coffs;
- ffsco o;
- o.dirs(0);
- o.find(LPCSTR(dirarray.ElementAt (i)), LPCSTR("*.jpg"));
- ffsco::typeT coo;
- ffsco::typeT::iterator it;
- coo = o.co_file();
- for (it = coo.begin();
- coo.end() != it;
- it ++)
- {
- str=(*it).c_str();
- if(str.GetAt (str.ReverseFind ('\\')+1)=='s')continue;
- m_photoarray1.Add (str);
- }
- }
- if(m_photoarray1.GetSize ()==0)
- {
- AfxMessageBox("警告:此单未导片!", MB_ICONSTOP);
- }
- m_nphotos1=m_photoarray1.GetSize ();
- m_nspase1=0;
- for( i=0; i<m_photoarray1.GetSize (); i++)
- {
- CFile fp;
- if(fp.Open (m_photoarray1.ElementAt (i), CFile::modeRead))
- {
- m_nspase1+=fp.GetLength ();
- fp.Close ();
- }
- }
- m_nspase1temp=m_nspase1;
- }
- else
- {
- m_nphotos1=m_photoarray1.GetSize ();
- m_nspase1=m_nspase1temp;
- }
- }
- else
- {
- m_nphotos1=0;
- m_nspase1=0;
- }
- CString str;
- str.Format ("照片:%d 占用空间:%dM", m_nphotos1, m_nspase1/(1024*1024));
- GetDlgItem(IDC_STATIC1)->SetWindowText(str);
- m_nphotos=m_nphotos1+m_nphotos2+m_nphotos3+m_nphotos4+m_nphotos5+m_nphotos6;
- m_nspase=(m_nspase1+m_nspase2+m_nspase3+m_nspase4+m_nspase5+m_nspase6)/(1024*1024);
- }
- void CNeroDlg::OnCheck2()
- {
- // TODO: Add your control notification handler code here
- UpdateData();
- if(m_checkphoto2)
- {
- if(m_checkphoto5)
- m_checkphoto5=0;
- UpdateData(false);
- OnCheck5();
- if(m_photoarray2.GetSize ()==0)
- {
- CString path;
- path=g_path2+"\\";
- path+=m_id;
- path +="\\";
- CString filter="id='"+m_id+"'";
- g_sendhead.bsql=0;
- g_sendhead.code[0]=50;
- g_sendhead.tabcount=1;
- g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
- CArray<CStringArray, CStringArray>sparray;
- DataToArray( &sparray);
- CString str,spname;
- CStringArray noarray;
- CStringArray spnamearray;
-
- for(int i=0; i<sparray.GetSize (); i++)
- {
- str=sparray.ElementAt (i).ElementAt (6);
- spname=sparray.ElementAt (i).ElementAt (5);
- GetNo(str, noarray);
- }
- if(noarray.GetSize ()==0)
- {
- AfxMessageBox("此单未选片!", MB_ICONINFORMATION);
- return;
- }
-
- for(i=0; i<noarray.GetSize (); i++)
- {
- str.Format ("%s%s.jpg", path, noarray.ElementAt (i));
- if(::PathFileExists (str))
- {
- m_photoarray2.Add (str);
- }
- }
- if(m_photoarray2.GetSize ()==0)
- {
- AfxMessageBox("警告:此单未导片!", MB_ICONSTOP);
- }
- m_nphotos2=m_photoarray2.GetSize ();
- m_nspase2=0;
- for( i=0; i<m_photoarray2.GetSize (); i++)
- {
- CFile fp;
- if(fp.Open (m_photoarray2.ElementAt (i), CFile::modeRead))
- {
- m_nspase2+=fp.GetLength ();
- fp.Close ();
- }
- }
- m_nspase2temp=m_nspase2;
- }
- else
- {
- m_nphotos2=m_photoarray2.GetSize ();
- m_nspase2=m_nspase2temp;
- }
- }
- else
- {
- m_nphotos2=0;
- m_nspase2=0;
- }
- CString str;
- str.Format ("照片:%d 占用空间:%dM", m_nphotos2, m_nspase2/(1024*1024));
- GetDlgItem(IDC_STATIC2)->SetWindowText(str);
- m_nphotos=m_nphotos1+m_nphotos2+m_nphotos3+m_nphotos4+m_nphotos5+m_nphotos6;
- m_nspase=(m_nspase1+m_nspase2+m_nspase3+m_nspase4+m_nspase5+m_nspase6)/(1024*1024);
- }
- void CNeroDlg::OnCheck3()
- {
- // TODO: Add your control notification handler code here
- UpdateData();
- if(m_checkphoto3)
- {
- if(m_checkphoto4)
- m_checkphoto4=0;
- UpdateData(false);
- OnCheck4();
- if(m_photoarray3.GetSize ()==0)
- {
- CString path;
- path=g_path1+"\\";
- path+=m_id;
- path +="\\";
- CString filter="id='"+m_id+"'";
- g_sendhead.bsql=0;
- g_sendhead.code[0]=50;
- g_sendhead.tabcount=1;
- g_pMainWnd->ProcessChatMessageRequest2(filter);if(g_bSendOK==0)return;
- CArray<CStringArray, CStringArray>sparray;
- DataToArray( &sparray);
- CString str,spname;
- CStringArray noarray;
- CStringArray spnamearray;
-
- for(int i=0; i<sparray.GetSize (); i++)
- {
- str=sparray.ElementAt (i).ElementAt (6);
- spname=sparray.ElementAt (i).ElementAt (5);
- GetNo(str, noarray);
- }
- if(noarray.GetSize ()==0)
- {
- AfxMessageBox("此单未选片!", MB_ICONINFORMATION);
- return;
- }
-
- for(i=0; i<noarray.GetSize (); i++)
- {
- str.Format ("%s%s.jpg", path, noarray.ElementAt (i));
- if(::PathFileExists (str))
- {
- m_photoarray3.Add (str);
- }
- }
- if(m_photoarray3.GetSize ()==0)
- {
- AfxMessageBox("警告:此单未导片!", MB_ICONSTOP);
- }
- m_nphotos3=m_photoarray3.GetSize ();
- m_nspase3=0;
- for( i=0; i<m_photoarray3.GetSize (); i++)
- {
- CFile fp;
- if(fp.Open (m_photoarray3.ElementAt (i), CFile::modeRead))
- {
- m_nspase3+=fp.GetLength ();
- fp.Close ();
- }
- }
- m_nspase3temp=m_nspase3;
- }
- else
- {
- m_nphotos3=m_photoarray3.GetSize ();
- m_nspase3=m_nspase3temp;
- }
- }
- else
- {
- m_nphotos3=0;
- m_nspase3=0;
- }
- CString str;
- str.Format ("照片:%d 占用空间:%dM", m_nphotos3, m_nspase3/(1024*1024));
- GetDlgItem(IDC_STATIC3)->SetWindowText(str);
- m_nphotos=m_nphotos1+m_nphotos2+m_nphotos3+m_nphotos4+m_nphotos5+m_nphotos6;
- m_nspase=(m_nspase1+m_nspase2+m_nspase3+m_nspase4+m_nspase5+m_nspase6)/(1024*1024);
- }
- void CNeroDlg::OnCheck4()
- {
- // TODO: Add your control notification handler code here
- UpdateData();
- if(m_checkphoto4)
- {
- if(m_checkphoto3)
- m_checkphoto3=0;
- UpdateData(false);
- OnCheck3();
- if(m_photoarray4.GetSize ()==0)
- {
- CString path;
- path=g_path1+"\\";
- path+=m_id;
- path +="\\";
-
- CStringArray dirarray;
- CString str;
- using namespace helper_coffs;
- ffsco o;
- o.dirs(1);
- o.find(LPCSTR(path), LPCSTR("*.*"));
- ffsco::typeT coo;
- ffsco::typeT::iterator it;
- coo = o.co_dir();
- for (it = coo.begin();
- coo.end() != it;
- it ++)
- {
- str=(*it).c_str();
- if(FindArray(&dirarray, str)==-1)
- {
- dirarray.Add (str);
- }
- }
- for(int i=0; i<dirarray.GetSize (); i++)
- {
- using namespace helper_coffs;
- ffsco o;
- o.dirs(0);
- o.find(LPCSTR(dirarray.ElementAt (i)), LPCSTR("*.jpg"));
- ffsco::typeT coo;
- ffsco::typeT::iterator it;
- coo = o.co_file();
- for (it = coo.begin();
- coo.end() != it;
- it ++)
- {
- str=(*it).c_str();
- if(str.GetAt (str.ReverseFind ('\\')+1)=='s')continue;
- m_photoarray4.Add (str);
- }
- }
- if(m_photoarray4.GetSize ()==0)
- {
- AfxMessageBox("警告:此单未导片!", MB_ICONSTOP);
- }
- m_nphotos4=m_photoarray4.GetSize ();
- m_nspase4=0;
- for( i=0; i<m_photoarray4.GetSize (); i++)
- {
- CFile fp;
- if(fp.Open (m_photoarray4.ElementAt (i), CFile::modeRead))
- {
- m_nspase4+=fp.GetLength ();
- fp.Close ();
- }
- }
- m_nspase4temp=m_nspase4;
- }
- else
- {
- m_nphotos4=m_photoarray4.GetSize ();
- m_nspase4=m_nspase4temp;
- }
- }
- else
- {
- m_nphotos4=0;
- m_nspase4=0;
- }
- CString str;
- str.Format ("照片:%d 占用空间:%dM", m_nphotos4, m_nspase4/(1024*1024));
- GetDlgItem(IDC_STATIC4)->SetWindowText(str);
- m_nphotos=m_nphotos1+m_nphotos2+m_nphotos3+m_nphotos4+m_nphotos5+m_nphotos6;
- m_nspase=(m_nspase1+m_nspase2+m_nspase3+m_nspase4+m_nspase5+m_nspase6)/(1024*1024);
- }
- void CNeroDlg::OnCheck5()
- {
- // TODO: Add your control notification handler code here
- UpdateData();
- if(m_checkphoto5)
- {
- if(m_checkphoto2)
- m_checkphoto2=0;
- UpdateData(false);
- OnCheck2();
- if(m_photoarray5.GetSize ()==0)
- {
- CString path;
- path=g_path2+"\\";
- path+=m_id;
- path +="\\";
-
- CStringArray dirarray;
- CString str;
- using namespace helper_coffs;
- ffsco o;
- o.dirs(1);
- o.find(LPCSTR(path), LPCSTR("*.*"));
- ffsco::typeT coo;
- ffsco::typeT::iterator it;
- coo = o.co_dir();
- for (it = coo.begin();
- coo.end() != it;
- it ++)
- {
- str=(*it).c_str();
- if(FindArray(&dirarray, str)==-1)
- {
- dirarray.Add (str);
- }
- }
- for(int i=0; i<dirarray.GetSize (); i++)
- {
- using namespace helper_coffs;
- ffsco o;
- o.dirs(0);
- o.find(LPCSTR(dirarray.ElementAt (i)), LPCSTR("*.jpg"));
- ffsco::typeT coo;
- ffsco::typeT::iterator it;
- coo = o.co_file();
- for (it = coo.begin();
- coo.end() != it;
- it ++)
- {
- str=(*it).c_str();
- if(str.GetAt (str.ReverseFind ('\\')+1)=='s')continue;
- m_photoarray5.Add (str);
- }
- }
- if(m_photoarray5.GetSize ()==0)
- {
- AfxMessageBox("警告:此单未导片!", MB_ICONSTOP);
- }
- m_nphotos5=m_photoarray5.GetSize ();
- m_nspase5=0;
- for( i=0; i<m_photoarray5.GetSize (); i++)
- {
- CFile fp;
- if(fp.Open (m_photoarray5.ElementAt (i), CFile::modeRead))
- {
- m_nspase5+=fp.GetLength ();
- fp.Close ();
- }
- }
- m_nspase5temp=m_nspase5;
- }
- else
- {
- m_nphotos5=m_photoarray5.GetSize ();
- m_nspase5=m_nspase5temp;
- }
- }
- else
- {
- m_nphotos5=0;
- m_nspase5=0;
- }
- CString str;
- str.Format ("照片:%d 占用空间:%dM", m_nphotos5, m_nspase5/(1024*1024));
- GetDlgItem(IDC_STATIC5)->SetWindowText(str);
- m_nphotos=m_nphotos1+m_nphotos2+m_nphotos3+m_nphotos4+m_nphotos5+m_nphotos6;
- m_nspase=(m_nspase1+m_nspase2+m_nspase3+m_nspase4+m_nspase5+m_nspase6)/(1024*1024);
- }
- void CNeroDlg::OnCheck6()
- {
- // TODO: Add your control notification handler code here
- UpdateData();
- if(m_checkphoto6)
- {
- if(m_photoarray6.GetSize ()==0)
- {
- CString path;
- path=g_path3+"\\";
- path+=m_id;
- path +="\\";
-
- CStringArray dirarray;
- CString str;
- using namespace helper_coffs;
- ffsco o;
- o.dirs(1);
- o.find(LPCSTR(path), LPCSTR("*.*"));
- ffsco::typeT coo;
- ffsco::typeT::iterator it;
- coo = o.co_dir();
- for (it = coo.begin();
- coo.end() != it;
- it ++)
- {
- str=(*it).c_str();
- if(FindArray(&dirarray, str)==-1)
- {
- dirarray.Add (str);
- }
- }
- for(int i=0; i<dirarray.GetSize (); i++)
- {
- using namespace helper_coffs;
- ffsco o;
- o.dirs(0);
- o.find(LPCSTR(dirarray.ElementAt (i)), LPCSTR("*.jpg"));
- ffsco::typeT coo;
- ffsco::typeT::iterator it;
- coo = o.co_file();
- for (it = coo.begin();
- coo.end() != it;
- it ++)
- {
- str=(*it).c_str();
- if(str.GetAt (str.ReverseFind ('\\')+1)=='s')continue;
- m_photoarray6.Add (str);
- }
- }
- if(m_photoarray6.GetSize ()==0)
- {
- AfxMessageBox("警告:此单未导片!", MB_ICONSTOP);
- }
- m_nphotos6=m_photoarray6.GetSize ();
- m_nspase6=0;
- for( i=0; i<m_photoarray6.GetSize (); i++)
- {
- CFile fp;
- if(fp.Open (m_photoarray6.ElementAt (i), CFile::modeRead))
- {
- m_nspase6+=fp.GetLength ();
- fp.Close ();
- }
- }
- m_nspase6temp=m_nspase6;
- }
- else
- {
- m_nphotos6=m_photoarray6.GetSize ();
- m_nspase6=m_nspase6temp;
- }
- }
- else
- {
- m_nphotos6=0;
- m_nspase6=0;
- }
- CString str;
- str.Format ("照片:%d 占用空间:%dM", m_nphotos6, m_nspase6/(1024*1024));
- GetDlgItem(IDC_STATIC6)->SetWindowText(str);
- m_nphotos=m_nphotos1+m_nphotos2+m_nphotos3+m_nphotos4+m_nphotos5+m_nphotos6;
- m_nspase=(m_nspase1+m_nspase2+m_nspase3+m_nspase4+m_nspase5+m_nspase6)/(1024*1024);
- }
- void CNeroDlg::GetNo(CString str, CStringArray &array)
- {
- if(!str.IsEmpty ())
- {
- int pos=str.Find (",");
- while(pos!=-1)
- {
- if(FindArray(&array, str.Left (pos))==-1)
- array.Add (str.Left (pos));
- str=str.Right (str.GetLength ()-pos-1);
- pos=str.Find (",");
- }
- if(FindArray(&array, str)==-1)
- array.Add(str);
- }
- }
- void CNeroDlg::OnOK()
- {
- UpdateData();
- if(m_nphotos==0)
- {
- AfxMessageBox("未选中照片!", MB_ICONSTOP);
- return;
- }
- if(m_nspase>650 && m_bDvd==0)
- {
- AfxMessageBox("光盘空间不足!", MB_ICONSTOP);
- return;
- }
- m_Burn.m_DirArray.RemoveAll ();
- m_Burn.m_DirRealNameArray.RemoveAll ();
- GetDlgItem(IDOK)->SetWindowText("刻录中, 请稍候...");
- GetDlgItem(IDOK)->EnableWindow(0);
- if(NowDoingBurn)
- return;
-
-
- CStringArray dirarray;
-
- using namespace helper_coffs;
- CStringArray srcarray;
- if(m_bFromDir)
- {
- CString str;
- GetDlgItemText(IDC_EDIT1, str);
- str.TrimRight ('\\');
- m_Burn.m_DirArray.Add (str);
- m_Burn.m_DirRealNameArray.Add (str);
- }
- else
- {
- if(m_checkphoto1)
- {
- m_Burn.m_DirArray.Add (g_path4+"\\"+m_id);
- m_Burn.m_DirRealNameArray.Add (g_path4+"\\"+m_id+"(精修)");
- }
-
- if(m_checkphoto5)
- {
- m_Burn.m_DirArray.Add (g_path2+"\\"+m_id);
- m_Burn.m_DirRealNameArray.Add (g_path2+"\\"+m_id+"(初修)");
- }
-
-
- if(m_checkphoto4)
- {
- m_Burn.m_DirArray.Add (g_path1+"\\"+m_id);
- m_Burn.m_DirRealNameArray.Add (g_path1+"\\"+m_id+"(原片)");
- }
- if(m_checkphoto6)
- {
- m_Burn.m_DirArray.Add (g_path3+"\\"+m_id);
- m_Burn.m_DirRealNameArray.Add (g_path3+"\\"+m_id+"(设计片)");
- }
- }
- CString str;
- for(int i=0; i<m_Burn.m_DirArray.GetSize (); i++)
- {
- ffsco o;
- o.dirs(1);
- o.find(LPCSTR(m_Burn.m_DirArray.ElementAt (i)), LPCSTR("*.*"));
- ffsco::typeT coo;
- ffsco::typeT::iterator it;
- coo = o.co_dir();
- for (it = coo.begin();
- coo.end() != it;
- it ++)
- {
- str=(*it).c_str();
- str.TrimRight("\\");
- if(FindArray(&dirarray, str)==-1)
- {
- dirarray.Add (str);
- }
- }
- }
- int addcount=0;
- if(m_bFromDir==0)
- {
- if(m_checkphoto2)addcount++;
- if(m_checkphoto3)addcount++;
- }
- if((dirarray.GetSize ()+addcount)==0)return;
- CStringArray *photosarray=new CStringArray[dirarray.GetSize()+addcount];
- for( i=0; i<dirarray.GetSize (); i++)
- {
- GenSPhoto(dirarray.ElementAt (i), photosarray[i]);
- }
- if(m_bFromDir==0)
- {
- int pos=dirarray.GetSize ();
- if(m_checkphoto2)
- {
- m_Burn.m_DirArray.Add (g_path2+"\\"+m_id);
- m_Burn.m_DirRealNameArray.Add (g_path2+"\\"+m_id+"(初修)");
- dirarray.Add(g_path2+"\\"+m_id);
- photosarray[pos].Copy (m_photoarray2);
- pos++;
- }
- if(m_checkphoto3)
- {
- m_Burn.m_DirArray.Add (g_path1+"\\"+m_id);
- m_Burn.m_DirRealNameArray.Add (g_path1+"\\"+m_id+"(原片)");
- dirarray.Add(g_path1+"\\"+m_id);
- photosarray[pos].Copy (m_photoarray3);
- }
- }
- m_Burn.m_pDir=&dirarray;
- m_Burn.m_pPhotoArray=photosarray;
-
-
- if(m_Burn.NeroAPIInit()==0)
- {
- m_Burn.NeroWorkError=1;
- delete []photosarray;
- return;
- }
- m_Burn.m_name=m_name;
- m_Burn.m_bDvd=m_bDvd;
- m_Burn.NeroAPIBurn();
- NowDoingBurn=true; delete []photosarray;
-
- }
|