home *** CD-ROM | disk | FTP | other *** search
/ Large Pack of OldSkool DOS MOD Trackers / beaversweeper_v101.zip / src / MixerView.cpp < prev    next >
C/C++ Source or Header  |  2003-01-06  |  3KB  |  117 lines

  1. // MixerView.cpp : implementation file
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "tracker.h"
  6. #include "MixerView.h"
  7. #include "channelmixer.h"
  8.  
  9. #ifdef _DEBUG
  10. #define new DEBUG_NEW
  11. #undef THIS_FILE
  12. static char THIS_FILE[] = __FILE__;
  13. #endif
  14.  
  15. /////////////////////////////////////////////////////////////////////////////
  16. // CMixerView
  17.  
  18. IMPLEMENT_DYNCREATE(CMixerView, CFormView)
  19.  
  20. CMixerView::CMixerView()
  21.     : CFormView(CMixerView::IDD)
  22. {
  23.     //{{AFX_DATA_INIT(CMixerView)
  24.     //}}AFX_DATA_INIT
  25. }
  26.  
  27. CMixerView::~CMixerView()
  28. {
  29. }
  30.  
  31. void CMixerView::DoDataExchange(CDataExchange* pDX)
  32. {
  33.     CFormView::DoDataExchange(pDX);
  34.     //{{AFX_DATA_MAP(CMixerView)
  35.     DDX_Control(pDX, IDC_CHMIXER_LAYOUT, m_mixerLayout);
  36.     //}}AFX_DATA_MAP
  37. }
  38.  
  39.  
  40. BEGIN_MESSAGE_MAP(CMixerView, CFormView)
  41.     //{{AFX_MSG_MAP(CMixerView)
  42.         // NOTE - the ClassWizard will add and remove mapping macros here.
  43.     //}}AFX_MSG_MAP
  44. END_MESSAGE_MAP()
  45.  
  46. /////////////////////////////////////////////////////////////////////////////
  47. // CMixerView diagnostics
  48.  
  49. #ifdef _DEBUG
  50. void CMixerView::AssertValid() const
  51. {
  52.     CFormView::AssertValid();
  53. }
  54.  
  55. void CMixerView::Dump(CDumpContext& dc) const
  56. {
  57.     CFormView::Dump(dc);
  58. }
  59. CTrackerDoc* CMixerView::GetDocument() // non-debug version is inline
  60. {
  61.     ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CTrackerDoc)));
  62.     return (CTrackerDoc*)m_pDocument;
  63. }
  64.  
  65. #endif //_DEBUG
  66.  
  67. /////////////////////////////////////////////////////////////////////////////
  68. // CMixerView message handlers
  69.  
  70. isSynth * CMixerView::GetSynth()
  71. {
  72.     CTrackerDoc *pDoc = GetDocument();
  73.     return (pDoc->synth);
  74.     
  75. }
  76. void CMixerView::OnInitialUpdate() 
  77. {
  78.     CFormView::OnInitialUpdate();
  79.  
  80.     
  81.     CRect wrect;
  82.     int h,w,i;
  83.     isSynth *synth;
  84.     CChannelMixer *dummy;    
  85.  
  86.  
  87.     CTrackerDoc *pDoc = GetDocument();
  88.     synth = GetSynth();
  89.     
  90.     
  91.  
  92.     m_mixerLayout.GetWindowRect(&wrect);
  93.     ScreenToClient(&wrect);
  94.     h = wrect.Height();
  95.     w = wrect.Width();
  96.  
  97.     for (i=0;i<16;i++)
  98.     {
  99.         dummy = new CChannelMixer();
  100.         dummy->Create (MAKEINTRESOURCE(IDD_DIALOG_MIXERCHANNEL),this);
  101.         dummy->SetSynth(synth,i);
  102.         dummy->UpdateWindow();
  103.         dummy->ShowWindow(SW_SHOW);
  104.         dummy->MoveWindow(&wrect);
  105.  
  106.         dummy->UpdateSynthData();
  107.         /*
  108.         wrect.top+=h;
  109.         wrect.bottom+=h;
  110.         */
  111.         wrect.left+=w;
  112.         wrect.right+=w;
  113.     }
  114.     // TODO: Add your specialized code here and/or call the base class
  115.     
  116. }
  117.