home *** CD-ROM | disk | FTP | other *** search
/ Large Pack of OldSkool DOS MOD Trackers / beaversweeper_v101.zip / src / tracker.cpp < prev    next >
C/C++ Source or Header  |  2005-10-23  |  6KB  |  223 lines

  1. // tracker.cpp : Defines the class behaviors for the application.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "tracker.h"
  6.  
  7. #include "MainFrm.h"
  8. #include "ChildFrm.h"
  9. #include "trackerDoc.h"
  10. #include "trackerView.h"
  11. #include "sampleView.h"
  12. #include "mixerview.h"
  13. #include "tkerror.h"
  14. #include "globals.h"
  15. #include "SendFxView10.h"
  16. #include "SamplePoolEditor.h"
  17.  
  18. #ifdef _DEBUG
  19. #define new DEBUG_NEW
  20. #undef THIS_FILE
  21. static char THIS_FILE[] = __FILE__;
  22. #endif
  23. /*
  24.     ON_COMMAND(ID_FILE_NEW, CMSDIWinApp::OnFileNew)
  25.     ON_COMMAND(ID_FILE_OPEN, CMSDIWinApp::OnFileOpen)
  26. */
  27.  
  28. /////////////////////////////////////////////////////////////////////////////
  29. // CTrackerApp
  30.  
  31. BEGIN_MESSAGE_MAP(CTrackerApp, CMSDIWinApp)
  32.     //{{AFX_MSG_MAP(CTrackerApp)
  33.     ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
  34.         // NOTE - the ClassWizard will add and remove mapping macros here.
  35.         //    DO NOT EDIT what you see in these blocks of generated code!
  36.     //}}AFX_MSG_MAP
  37.     // Standard file based document commands
  38.     // Standard print setup command
  39.     ON_COMMAND(ID_FILE_PRINT_SETUP, CMSDIWinApp::OnFilePrintSetup)
  40. END_MESSAGE_MAP()
  41.  
  42. /////////////////////////////////////////////////////////////////////////////
  43. // CTrackerApp construction
  44.  
  45. CTrackerApp::CTrackerApp()
  46. {
  47.     // TODO: add construction code here,
  48.     // Place all significant initialization in InitInstance    
  49. }
  50.  
  51. /////////////////////////////////////////////////////////////////////////////
  52. // The one and only CTrackerApp object
  53.  
  54. CTrackerApp theApp;
  55.  
  56. /////////////////////////////////////////////////////////////////////////////
  57. // CTrackerApp initialization
  58.  
  59. BOOL CTrackerApp::InitInstance()
  60. {
  61.     AfxEnableControlContainer();
  62.  
  63.     // Standard initialization
  64.     // If you are not using these features and wish to reduce the size
  65.     //  of your final executable, you should remove from the following
  66.     //  the specific initialization routines you do not need.
  67.  
  68. #ifdef _AFXDLL
  69.     Enable3dControls();            // Call this when using MFC in a shared DLL
  70. #else
  71.     Enable3dControlsStatic();    // Call this when linking to MFC statically
  72. #endif
  73.  
  74.     GLOBALS_INIT();
  75.  
  76.     // Change the registry key under which our settings are stored.
  77.     // TODO: You should modify this string to be something appropriate
  78.     // such as the name of your company or organization.
  79.     SetRegistryKey(_T("Local AppWizard-Generated Applications"));
  80.  
  81.     LoadStdProfileSettings();  // Load standard INI file options (including MRU)
  82.  
  83.     //SetWindowColor
  84.  
  85.     tdbg_open("debug.txt");
  86.     
  87.     // Register the application's document templates.  Document templates
  88.     //  serve as the connection between documents, frame windows and views.
  89.  
  90.     CMultiDocTemplate* pDocTemplate;
  91.     pDocTemplate = new CMultiDocTemplate(
  92.         IDR_TRACKETYPE,
  93.         RUNTIME_CLASS(CTrackerDoc),
  94.         RUNTIME_CLASS(CViewFrame), // custom MDI child frame
  95.         RUNTIME_CLASS(CPatternView));
  96.     AddDocTemplate(pDocTemplate);
  97.  
  98.     CMultiDocTemplate *pInstrEditorTemplate;
  99.     pInstrEditorTemplate = new CMultiDocTemplate(
  100.         IDR_SAMPLETYPE,
  101.         RUNTIME_CLASS(CTrackerDoc),
  102.         RUNTIME_CLASS(CViewFrame),
  103.         RUNTIME_CLASS(CInstrEditor));
  104.     AddDocTemplate(pInstrEditorTemplate);
  105.  
  106.     CMultiDocTemplate *pMixerViewTemplate;
  107.     pMixerViewTemplate = new CMultiDocTemplate(
  108.         IDR_SAMPLETYPE,
  109.         RUNTIME_CLASS(CTrackerDoc),
  110.         RUNTIME_CLASS(CViewFrame),
  111.         RUNTIME_CLASS(CMixerView));
  112.     AddDocTemplate(pMixerViewTemplate);
  113.  
  114.     CMultiDocTemplate *pSendFxTemplate;
  115.     pSendFxTemplate = new CMultiDocTemplate(
  116.         IDR_SAMPLETYPE,
  117.         RUNTIME_CLASS(CTrackerDoc),
  118.         RUNTIME_CLASS(CViewFrame),
  119.         RUNTIME_CLASS(CSendFxView));
  120.     AddDocTemplate(pSendFxTemplate);
  121.  
  122.     CMultiDocTemplate *pSPoolTemplate;
  123.     pSPoolTemplate = new CMultiDocTemplate(
  124.         IDR_SAMPLETYPE,
  125.         RUNTIME_CLASS(CTrackerDoc),
  126.         RUNTIME_CLASS(CViewFrame),
  127.         RUNTIME_CLASS(CSamplePoolEditor));
  128.     AddDocTemplate(pSPoolTemplate);
  129.     
  130.     // create main MDI Frame window
  131.     CMainFrame* pMainFrame = new CMainFrame;
  132.     if (!pMainFrame->LoadFrame(IDR_MAINFRAME))
  133.         return FALSE;
  134.     m_pMainWnd = pMainFrame;
  135.  
  136.     // Parse command line for standard shell commands, DDE, file open
  137.     CCommandLineInfo cmdInfo;
  138.     ParseCommandLine(cmdInfo);
  139.  
  140.     // Dispatch commands specified on the command line
  141.     if (!ProcessShellCommand(cmdInfo))
  142.         return FALSE;
  143.  
  144.     // The main window has been initialized, so show and update it.
  145.     pMainFrame->ShowWindow(m_nCmdShow);
  146.     pMainFrame->UpdateWindow();
  147.  
  148.  
  149.     return TRUE;
  150. }
  151.  
  152.  
  153. /////////////////////////////////////////////////////////////////////////////
  154. // CAboutDlg dialog used for App About
  155.  
  156.  
  157. class CAboutDlg : public CDialog
  158. {
  159. public:
  160.     CAboutDlg();
  161.  
  162. // Dialog Data
  163.     //{{AFX_DATA(CAboutDlg)
  164.     enum { IDD = IDD_ABOUTBOX };
  165.     CString    m_BuildNr;
  166.     //}}AFX_DATA
  167.  
  168.     // ClassWizard generated virtual function overrides
  169.     //{{AFX_VIRTUAL(CAboutDlg)
  170.     protected:
  171.     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
  172.     //}}AFX_VIRTUAL
  173.  
  174. // Implementation
  175. protected:
  176.     //{{AFX_MSG(CAboutDlg)
  177.         // No message handlers
  178.     //}}AFX_MSG
  179.     DECLARE_MESSAGE_MAP()
  180. };
  181.  
  182. CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
  183. {
  184.     //{{AFX_DATA_INIT(CAboutDlg)
  185.     m_BuildNr = _T("");
  186.     //}}AFX_DATA_INIT
  187. }
  188.  
  189. void CAboutDlg::DoDataExchange(CDataExchange* pDX)
  190. {
  191.     CDialog::DoDataExchange(pDX);
  192.     //{{AFX_DATA_MAP(CAboutDlg)
  193.     DDX_Text(pDX, IDC_STATIC_BUILD, m_BuildNr);
  194.     //}}AFX_DATA_MAP
  195. }
  196.  
  197. BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
  198.     //{{AFX_MSG_MAP(CAboutDlg)
  199.         // No message handlers
  200.     //}}AFX_MSG_MAP
  201. END_MESSAGE_MAP()
  202.  
  203. // App command to run the dialog
  204. void CTrackerApp::OnAppAbout()
  205. {
  206.     CAboutDlg aboutDlg;
  207.     aboutDlg.m_BuildNr.Format ("%s",__DATE__);
  208.     aboutDlg.DoModal();
  209. }
  210.  
  211. /////////////////////////////////////////////////////////////////////////////
  212. // CTrackerApp message handlers
  213.  
  214.  
  215. int CTrackerApp::ExitInstance() 
  216. {
  217.     // TODO: Add your specialized code here and/or call the base class
  218.     tdbg_close();
  219.     GLOBALS_DESTROY();
  220.     
  221.     return CMSDIWinApp::ExitInstance();
  222. }
  223.