Skip to content

Commit

Permalink
version 0.7.9
Browse files Browse the repository at this point in the history
redimmentionnement devient correct
version ultra intermediaire

git-svn-id: file:///home/ctaf42/Downloads/tmp/MultifxVST@49 3e78e570-a0aa-6544-9a6b-7e87a0c009bc
  • Loading branch information
CTAF authored and CTAF committed Sep 1, 2004
1 parent c173c0c commit a95cddd
Show file tree
Hide file tree
Showing 23 changed files with 668 additions and 599 deletions.
22 changes: 22 additions & 0 deletions ChainDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "CCVSThost.h"
#include "stockeffet.h"
#include "multifxVSTEditor.h"
//#include "CPUMemCount.h"

//#include "vsthost/CVSThost.h"
#include "vsthost/SmpEffect.h"
Expand Down Expand Up @@ -116,6 +117,7 @@ ON_BN_CLICKED(IDC_BTNPASTETO, OnBnClickedBtnpasteto)
ON_COMMAND(ID_EFFECTS_BROWSE, OnEffectsBrowse)
ON_COMMAND(ID_EFFECTS_SHELLPLUG, OnEffectsShellplug)
ON_WM_ERASEBKGND()
ON_WM_TIMER()
END_MESSAGE_MAP()


Expand Down Expand Up @@ -179,6 +181,8 @@ BOOL CChainDlg::OnInitDialog()

InitialiseSkin();

//SetTimer(1,1000,NULL);

return TRUE; // return TRUE unless you set the focus to a control
}

Expand Down Expand Up @@ -668,3 +672,21 @@ BOOL CChainDlg::OnEraseBkgnd(CDC* pDC)
return TRUE;

}

/*void CChainDlg::OnTimer(UINT nIDEvent)
{
if(nIDEvent == 1)
{
CString value;
int val = 0;//CCPUMemCount::GetMemUsage(APP->pMainDlg->GetSafeHwnd());
value.Format("%d",val);
GetDlgItem(IDC_TXTMEM)->SetWindowText(value);
}
CDialog::OnTimer(nIDEvent);
}*/
1 change: 1 addition & 0 deletions ChainDlg.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ class CChainDlg : public CDialog
afx_msg void OnEffectsShellplug();

afx_msg BOOL OnEraseBkgnd(CDC* pDC);
//afx_msg void OnTimer(UINT nIDEvent);
};

#endif
228 changes: 6 additions & 222 deletions ControleurDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,48 +13,17 @@
IMPLEMENT_DYNAMIC(CControleurDlg, CDialog)
CControleurDlg::CControleurDlg(CWnd* pParent /*=NULL*/)
: CDialog(CControleurDlg::IDD, pParent)
, m_channel(0)
, m_action(0)
, nbsel(0)
, m_txtdesc1(_T(""))
, m_txtdesc2(_T(""))
, m_cksimple(FALSE)
, m_txtdesc3(_T(""))
, m_controleur()
, m_value1(0)
, inited(0)
, m_controleurnb(0)
{
}


static const char * const tabdesc[7][5] =
//controleur SET
{{"Midi Controler","static value:","value = <controler_value>","value = <static value>","Use static value"},
{"Midi Controler" ,"increment:" ,"value = value + <increment>\n","value = value - <increment>","Decrement"},
{"Midi Controler" ,"limit:" ,"toggle value between 0 and 127","controler_value < limit => value = 0\ncontroler_value >= limit => value = 127","Use limit"},
{"Midi Note" ,"static value:","value = note_velocity","value = <static value>","Use static value"},
{"Midi Note" ,"increment:" ,"value = value + <increment>\n","value = value - <increment>","Decrement"},
{"Midi Note" ,"" ,"toggle value between 0 and 127","NoteOn => value = 127\nNoteOff => value = 0","Use NoteOn/NoteOff"},
{"" ,"" ,"value = <program_change_value>","value =127 - <program_change_value>","Invert"}};

static int const tabvisible[7][2] =
{{0x1001,0x1011},
{0x1111,0x1111},
{0x1001,0x1011},
{0x1001,0x1011},
{0x1111,0x1111},
{0x1001,0x1001},
{0x0001,0x0001}};

CControleurDlg::~CControleurDlg()
{

}

void CControleurDlg::Update()
{
APP->controleur->ViewControleur(m_lstcontroleur,nbsel);
// APP->controleur->ViewControleur(m_lstcontroleur,nbsel);
}

void CControleurDlg::SetAPP(CAppPointer * m_APP)
Expand All @@ -66,29 +35,10 @@ void CControleurDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Control(pDX, IDC_LSTCONTROLER, m_lstcontroleur);
DDX_CBIndex(pDX, IDC_CBCHANNEL, m_channel);
DDX_CBIndex(pDX, IDC_CBACTION, m_action);
DDX_Text(pDX, IDC_TXTDESC1, m_txtdesc1);
DDX_Text(pDX, IDC_DESC2, m_txtdesc2);
DDX_Check(pDX, IDC_CKSIMPLE, m_cksimple);
DDX_Text(pDX, IDC_TXTDESC3, m_txtdesc3);
DDX_Control(pDX, IDC_CBNOTE, m_cbnote);
DDX_CBIndex(pDX, IDC_CBNOTE, m_controleur);
DDX_Text(pDX, IDC_TXTINCREMENT, m_value1);
DDV_MinMaxLong(pDX, m_value1, 0, 127);
DDX_Control(pDX, IDC_CB_CONTROLEUR, m_cbcontroleur);
DDX_CBIndex(pDX, IDC_CB_CONTROLEUR, m_controleurnb);
}

BEGIN_MESSAGE_MAP(CControleurDlg, CDialog)
ON_WM_CTLCOLOR()
ON_BN_CLICKED(IDC_BTNVALIDATE, OnBnClickedBtnvalidate)
ON_CBN_SELCHANGE(IDC_CBACTION, OnCbnSelchangeCbaction)
ON_NOTIFY(NM_CLICK, IDC_LSTCONTROLER, OnNMClickLstcontroler)
ON_BN_CLICKED(IDC_CKSIMPLE, OnBnClickedCksimple)
ON_BN_CLICKED(IDC_BTNLOADMIDI2, OnBnClickedBtnloadmidi2)
ON_BN_CLICKED(IDC_BTNSAVE3, OnBnClickedBtnsave3)
ON_CBN_DROPDOWN(IDC_CB_CONTROLEUR, OnCbnDropdownCbControleur)
END_MESSAGE_MAP()

// Gestionnaires de messages CControleurDlg
Expand All @@ -104,7 +54,6 @@ BOOL CControleurDlg::OnInitDialog()
{
CDialog::OnInitDialog();
//INITIALISE LA LISTE
initialied = false;
m_lstcontroleur.Init();
/*m_lstcontroleur.g_MyClrFgHi = RGB(35,12,200);
m_lstcontroleur.g_MyClrBgHi = RGB(20,242,0);
Expand All @@ -120,22 +69,18 @@ BOOL CControleurDlg::OnInitDialog()
font.CreateFontIndirect(&lf);
m_lstcontroleur.SetFont(&font, TRUE);

m_lstcontroleur.InsertColumn(0, "#", LVCFMT_LEFT, 20);
m_lstcontroleur.InsertColumn(1, "Midi channel", LVCFMT_LEFT, 58);
m_lstcontroleur.InsertColumn(2, "Controleur/Note", LVCFMT_LEFT, 80);
m_lstcontroleur.InsertColumn(3, "Action", LVCFMT_LEFT, 100);
m_lstcontroleur.InsertColumn(4, "Value", LVCFMT_LEFT, 60);
m_lstcontroleur.InsertColumn(5, "Invert", LVCFMT_LEFT, 60);
m_lstcontroleur.InsertColumn(0, "Midi Controleur", LVCFMT_LEFT, 60);
m_lstcontroleur.InsertColumn(1, "Effect", LVCFMT_LEFT, 60);
m_lstcontroleur.InsertColumn(2, "Parameters", LVCFMT_LEFT, 60);

/*m_lstcontroleur.InsertColumn(6, "Min", LVCFMT_LEFT, 60);
m_lstcontroleur.InsertColumn(7, "Max", LVCFMT_LEFT, 60);
m_lstcontroleur.InsertColumn(9, "Controleur value", LVCFMT_LEFT, 60);*/



ListView_SetExtendedListViewStyle(m_lstcontroleur.m_hWnd, LVS_EX_FULLROWSELECT | LVS_EX_HEADERDRAGDROP);
inited = true;
OnCbnSelchangeCbaction();
inited = false;

return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION : les pages de propriétés OCX devraient retourner FALSE
}
Expand All @@ -153,165 +98,4 @@ HBRUSH CControleurDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
return brush2;
}

void CControleurDlg::OnBnClickedBtnvalidate()
{
int n = m_lstcontroleur.GetCurSel();
CControleurStk * param;
if(n<0)
{
return ;
}

UpdateData();
param = APP->controleur->Get(n);
param->midi_channel = m_channel;
param->midi_controleur = m_controleur;
param->invert = m_cksimple;
param->action = m_action ;
param->value1 = m_value1;
param->controleurnb = m_controleurnb+1;

APP->controleur->ViewControleur(m_lstcontroleur,n);
}

void CControleurDlg::OnCbnSelchangeCbaction()
{



bool note = m_action > 2;
UpdateData();
if (m_action<0)return;

m_txtdesc1 = tabdesc[m_action][0];
m_txtdesc2 = tabdesc[m_action][1];
if (m_cksimple)
m_txtdesc3 = tabdesc[m_action][3];
else
m_txtdesc3 = tabdesc[m_action][2];

GetDlgItem(IDC_CKSIMPLE)->SetWindowText(tabdesc[m_action][4]);

UpdateData(FALSE);

int val = tabvisible[m_action][m_cksimple];
if( val & 0x1000)
{
GetDlgItem(IDC_CBNOTE)->ShowWindow(SW_SHOW);
GetDlgItem(IDC_TXTDESC1)->ShowWindow(SW_SHOW);
}
else
{
GetDlgItem(IDC_CBNOTE)->ShowWindow(SW_HIDE);
GetDlgItem(IDC_TXTDESC1)->ShowWindow(SW_HIDE);
}


if( val & 0x0001)
GetDlgItem(IDC_CKSIMPLE)->ShowWindow(SW_SHOW);
else
GetDlgItem(IDC_CKSIMPLE)->ShowWindow(SW_HIDE);

if( val & 0x0010)
{ GetDlgItem(IDC_TXTINCREMENT)->ShowWindow(SW_SHOW);
GetDlgItem(IDC_DESC2)->ShowWindow(SW_SHOW);
}
else
{
GetDlgItem(IDC_TXTINCREMENT)->ShowWindow(SW_HIDE);
GetDlgItem(IDC_DESC2)->ShowWindow(SW_HIDE);
}

int nb = m_cbnote.GetCurSel();
if( (!initialied || note) && m_action <= 2)
{
initialied = true;
m_cbnote.SetRedraw(FALSE);
m_cbnote.ResetContent();
for(int i = 0;i<128;i++)
{
m_cbnote.AddString(tabmidi[i][0]);
}
m_cbnote.SetRedraw(TRUE);
m_cbnote.SetCurSel(nb);

}else if((!initialied || !note) && m_action > 2)
{ initialied = true;
m_cbnote.SetRedraw(FALSE);
m_cbnote.ResetContent();
for(int i = 0;i<128;i++)
{
m_cbnote.AddString(tabmidi[i][1]);
}
m_cbnote.SetRedraw(TRUE);
m_cbnote.SetCurSel(nb);

}

}


void CControleurDlg::OnNMClickLstcontroler(NMHDR *pNMHDR, LRESULT *pResult)
{
// TODO : ajoutez ici le code de votre gestionnaire de notification de contrôle
int n = m_lstcontroleur.GetCurSel();
CControleurStk * param;
if(n<0)return ;

UpdateData();
nbsel = n;
param = APP->controleur->Get(n);
m_channel = param->midi_channel;
m_controleur = param->midi_controleur;
m_action = param->action;
m_value1 = param->value1;
m_cksimple = param->invert;
UpdateData(FALSE);

OnCbnSelchangeCbaction();
*pResult = 0;
}

void CControleurDlg::OnBnClickedCksimple()
{
OnCbnSelchangeCbaction();
// TODO : ajoutez ici le code de votre gestionnaire de notification de contrôle
}


void CControleurDlg::OnBnClickedBtnloadmidi2()
{
CControleurStk clf;
int nb = APP->controleur->Add(clf);
APP->controleur->ViewControleur(m_lstcontroleur,nb);
}

void CControleurDlg::OnBnClickedBtnsave3()
{
int nb = m_lstcontroleur.GetCurSel();
if(nb < 0)return;
int nbafft = nb -1;
if(nbafft < 0) nbafft = 0;
APP->controleur->Suppr(nb);
APP->controleur->ViewControleur(m_lstcontroleur,nbafft);
}

void CControleurDlg::OnCbnDropdownCbControleur()
{
if(!inited)
{ inited = true;
CString buf;
m_cbcontroleur.ResetContent();
m_cbcontroleur.SetRedraw(FALSE);
int i,j = APP->parameter->GetCount();

for(i= 0; i < j;i++)
{
buf.Format("%d",i+1);
m_cbcontroleur.AddString(buf);
}
m_cbcontroleur.SetRedraw();
m_cbcontroleur.SetCurSel(0);
}
// TODO : ajoutez ici le code de votre gestionnaire de notification de contrôle
}
24 changes: 1 addition & 23 deletions ControleurDlg.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,27 +30,5 @@ class CControleurDlg : public CDialog
virtual BOOL OnInitDialog();
CSkinListCtrl m_lstcontroleur;
afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
afx_msg void OnBnClickedBtnvalidate();
afx_msg void OnCbnSelchangeCbaction();
// afx_msg void OnLvnItemchangedLstcontroler(NMHDR *pNMHDR, LRESULT *pResult);
afx_msg void OnNMClickLstcontroler(NMHDR *pNMHDR, LRESULT *pResult);
int m_channel;
int m_action;
int nbsel;
bool initialied;
BOOL inited;
CString m_txtdesc1;
CString m_txtdesc2;
BOOL m_cksimple;
CString m_txtdesc3;
afx_msg void OnBnClickedCksimple();
CComboBox m_cbnote;
int m_controleur;
afx_msg void OnCbnSelchangeCombo2();
long m_value1;
CComboBox m_cbcontroleur;
afx_msg void OnBnClickedBtnloadmidi2();
afx_msg void OnBnClickedBtnsave3();
afx_msg void OnCbnDropdownCbControleur();
int m_controleurnb;

};
4 changes: 2 additions & 2 deletions EffectWnd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,9 @@ SetEffSize(&rc);

void CEffectWnd::OnSize(UINT nType, int cx, int cy)
{
CWnd::OnSize(nType, cx, cy);
//CWnd::OnSize(nType, cx, cy);
if((cx != 0)&&(cy != 0))
APP->pMainDlg->ChildNotify(this/*,true*/);
APP->pMainDlg->ChildNotify(this,cx,cy/*,true*/);
}

/*****************************************************************************/
Expand Down
Loading

0 comments on commit a95cddd

Please sign in to comment.