PageFirst.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. /******************************************************************************
  2. |* THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
  3. |* ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
  4. |* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
  5. |* PARTICULAR PURPOSE.
  6. |*
  7. |* Copyright 1995-2005 Nero AG. All Rights Reserved.
  8. |*-----------------------------------------------------------------------------
  9. |* NeroSDK / NVAPIExample
  10. |*
  11. |* PROGRAM: PageFirst.h
  12. |*
  13. |* PURPOSE: Implementation of the first page.
  14. ******************************************************************************/
  15. #ifndef _NVAPIEXAMPLE_PAGE_FIRST_H_
  16. #define _NVAPIEXAMPLE_PAGE_FIRST_H_
  17. #if _MSC_VER > 1000
  18. #pragma once
  19. #endif // _MSC_VER > 1000
  20. #include "Page.h"
  21. #include "PageData.h"
  22. /////////////////////////////////////////////////////////////////////////////
  23. // CPageFirst dialog
  24. class CPageFirst
  25. : public CPage
  26. , CNVAPIExamplePage<CPageFirst>
  27. {
  28. protected:
  29. // The tree items on the first level can be of the CONTENTTYPE type.
  30. //
  31. enum CONTENTTYPE
  32. {
  33. VIDEOTITLE = 0,
  34. SLIDESHOW,
  35. };
  36. // The tree items on the second level of a SLIDESHOW can be of the
  37. // AUDIOTYPE type. IMAGEPATH means an image path. T_NONE means no
  38. // transition.
  39. //
  40. enum SUBITEMTYPE
  41. {
  42. ST_VIDEOPATH = -5,
  43. ST_AUDIOPATH = -4,
  44. ST_IMAGEPATH = -3,
  45. ST_VIDEOSTREAM = -2,
  46. ST_AUDIOSTREAM = -1,
  47. ST_NONEEFFECT = 0,
  48. ST_EFFECT,
  49. };
  50. // These two ints hold the sequence numbers for newly inserted video
  51. // and slideshow items. They are used for automatic unique naming of
  52. // new items.
  53. //
  54. int m_iVideoItemSequence;
  55. int m_iSlideshowItemSequence;
  56. int m_iVideoStreamSequence;
  57. CImageList m_ilIcons;
  58. bool m_bLoadAndBurn;
  59. // Construction
  60. public:
  61. CPageFirst(CSheet * pParentSheet);
  62. // Dialog Data
  63. //{{AFX_DATA(CPageFirst)
  64. enum { IDD = IDD_FIRST_PAGE };
  65. CButton c_InsertAudioStream;
  66. CButton c_InsertVideoStream;
  67. CComboBox c_EncodingType;
  68. CButton c_RemoveAll;
  69. CButton c_Export;
  70. CButton c_Preview;
  71. CButton c_InsertAudio;
  72. CButton c_Save;
  73. CButton c_Remove;
  74. CComboBox c_ProjectType;
  75. CButton c_Load;
  76. CButton c_InsertVideo;
  77. CButton c_InsertSlide;
  78. CButton c_InsertImage;
  79. CComboBox c_TransitionType;
  80. CTreeCtrl c_Content;
  81. int m_iProjectType;
  82. int m_iEncodingType;
  83. //}}AFX_DATA
  84. // Overrides
  85. // ClassWizard generated virtual function overrides
  86. //{{AFX_VIRTUAL(CPageFirst)
  87. protected:
  88. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  89. //}}AFX_VIRTUAL
  90. // Implementation
  91. protected:
  92. // Generated message map functions
  93. //{{AFX_MSG(CPageFirst)
  94. virtual BOOL OnInitDialog();
  95. afx_msg void OnLoad();
  96. afx_msg void OnSave();
  97. afx_msg void OnInsertVideo();
  98. afx_msg void OnRemove();
  99. afx_msg void OnInsertSlide();
  100. afx_msg void OnSelchangedContent(NMHDR* pNMHDR, LRESULT* pResult);
  101. afx_msg void OnSelchangeTransitionType();
  102. afx_msg void OnInsertImage();
  103. afx_msg void OnBeginlabeleditContent(NMHDR* pNMHDR, LRESULT* pResult);
  104. afx_msg void OnInsertAudio();
  105. afx_msg void OnLoadAndBurn();
  106. afx_msg void OnDestroy();
  107. afx_msg void OnPreview();
  108. afx_msg void OnExport();
  109. afx_msg void OnRemoveall();
  110. afx_msg void OnInsertVideoStream();
  111. afx_msg void OnInsertAudioStream();
  112. //}}AFX_MSG
  113. DECLARE_MESSAGE_MAP()
  114. afx_msg LRESULT OnQuitWithDelay (WPARAM wParam, LPARAM lParam);
  115. void ChangeTransition (HTREEITEM hItem, const int transitionIndex);
  116. void UpdateControls (void);
  117. IXMLDOMDocumentPtr BuildXML (void);
  118. void ParseXMLDocument (const IXMLDOMDocumentPtr pDocument);
  119. void ParseNeroVisionProject (const IXMLDOMElementPtr pProject);
  120. void ParseSubproject (const IXMLDOMElementPtr pSubProject);
  121. void ParseContent (const IXMLDOMElementPtr pContent);
  122. void ParseVideotitle (const IXMLDOMElementPtr pVideotitle);
  123. void ParseSlideshow (const IXMLDOMElementPtr pSlideshow);
  124. HTREEITEM InsertVideo (LPCSTR psVideoItemName, LPCSTR psPath);
  125. void InsertAudio (HTREEITEM hVideoItem, LPCSTR psAudioPath);
  126. HTREEITEM InsertSlideshow (LPCSTR psSlideshowName);
  127. void InsertTransition (HTREEITEM hSlideItem, const int transitionIndex = ST_NONEEFFECT);
  128. void InsertImage (HTREEITEM hSlideItem, LPCSTR psImagePath);
  129. HTREEITEM InsertVideoStream (LPCSTR psVideoStreamName, LPCSTR psVideoStreamContent);
  130. void InsertAudioStream (HTREEITEM hVideoItem, LPCSTR psAudioStreamName);
  131. _bstr_t PrettyFormatXML (/*[in]*/ BSTR bstrInputXML);
  132. bool IsTransition (const int transition) const { return transition >= 0; }
  133. bool IsAudioStream(LPCSTR psAudioPath);
  134. bool IsVideoStream(LPCSTR psVideoPath);
  135. // CPage implementation
  136. public:
  137. bool Create (void);
  138. bool OnNext (void);
  139. void OnChangeState (bool bActivate, bool bForward);
  140. };
  141. //{{AFX_INSERT_LOCATION}}
  142. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  143. #endif