Skip to content

Commit

Permalink
git-svn-id: file:///home/ctaf42/Downloads/tmp/MultifxVST@48 3e78e570-…
Browse files Browse the repository at this point in the history
…a0aa-6544-9a6b-7e87a0c009bc
  • Loading branch information
CTAF authored and CTAF committed Aug 23, 2004
1 parent a39bc9b commit c173c0c
Show file tree
Hide file tree
Showing 22 changed files with 318 additions and 88 deletions.
47 changes: 36 additions & 11 deletions CCVSTHost.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ CEffect * CCVSTHost::CreateEffect()

CCVSTHost::CCVSTHost()/*:CVSTHost()*/
{
int a = 0;
//int a = 0;
APP = NULL;
return;
}
Expand Down Expand Up @@ -52,7 +52,7 @@ CAppPointer * CCVSTHost::SetAPP(CAppPointer * m_diff_from_APP)
CCVSTHost::~CCVSTHost()
{
CString buf;buf.Format("DESTROY :: CCVSTHost(%d) \n", this); TRACE(buf);
int b = 0;//histoire de rien faire!
//int b = 0;//histoire de rien faire!
return;
}

Expand Down Expand Up @@ -113,8 +113,40 @@ if (!pEffect->Load(sName)) /* try to load the thing */


/**********************************************************************/
//pEffect->EffSetProgram(0);

//{
/*long lghfd = pEffect->EffGetPlugCategory() ;//kPlugCategUnknown possible
char * buffer = (char *)malloc(1000);
pEffect->EffGetProductString(buffer);
pEffect->EffIdentify();
pEffect->EffGetEffectName(buffer);// EffGetProductString(&buffer);
//pEffect->EffSetBypass(
//long lghfd = pEffect->EffGetPlugCategory() ;//kPlugCategUnknown possible
CString msg;
CString buf;
long iDD = pEffect->EffGetNextShellPlugin(buf.GetBuffer(60));
buf.ReleaseBuffer();
msg.AppendFormat("%d : %s\n",iDD,buf);
iDD = pEffect->EffGetNextShellPlugin(buf.GetBuffer(60));
buf.ReleaseBuffer();
msg.AppendFormat("%d : %s\n",iDD,buf);
AfxMessageBox(msg);
delete [] buffer;
}*/
//pEffect->pEffect->dispatcher(pEffect->pEffect,
pEffect->EffOpen(); /* open the effect */
TRACE("Open\n");
pEffect->EffSetSampleRate(fSampleRate); /* adjust its sample rate */
TRACE("SetSamplerate\n");
pEffect->EffSetBlockSize(lBlockSize); /* and block size */
TRACE("SetblockSize\n");

pEffect->EffMainsChanged(true); /* then force resume. */
TRACE("Main changed\n");

/*{
// long lghfd = pEffect->EffGetPlugCategory() ;//kPlugCategUnknown possible
char * buffer = (char *)malloc(1000);
Expand All @@ -136,9 +168,6 @@ pEffect->EffOpen(); /* open the effect */
delete [] buffer;
}*/
pEffect->EffSetSampleRate(fSampleRate); /* adjust its sample rate */
pEffect->EffSetBlockSize(lBlockSize); /* and block size */
pEffect->EffMainsChanged(true); /* then force resume. */

return nIndex;
}
Expand Down Expand Up @@ -309,9 +338,7 @@ bool CCVSTHost::OnIoChanged(int nEffect)
SetAPP();
if(APP)
{
InitDelay = APP->chaine_eff->CalculDelay(APP->current_chaine);
APP->effect->setInitialDelay(InitDelay);
APP->effect->ioChanged();
APP->chaine_eff->IoChanged(APP->current_chaine);
return 1;
}
else
Expand All @@ -322,9 +349,7 @@ bool CCVSTHost::OnIoChanged(int nEffect)
}
else
{
InitDelay = pEffect->APP->chaine_eff->CalculDelay(pEffect->APP->current_chaine);
pEffect->APP->effect->setInitialDelay(InitDelay);
pEffect->APP->effect->ioChanged();
pEffect->APP->chaine_eff->IoChanged(pEffect->APP->current_chaine);
return 1;
}
}
Expand Down
16 changes: 10 additions & 6 deletions ChainDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,9 @@ BOOL CChainDlg::SaveAll(LPCSTR Path)
return TRUE;
}CATCH(CFileException , ex)
{
return FALSE;
TRACE("###erreur de sauvegarde (save)");
return FALSE;

}END_CATCH
}

Expand All @@ -338,15 +339,17 @@ BOOL CChainDlg::LoadAll(LPCSTR Path)
APP->chaine_eff->RemoveAll();


APP->chaine_eff->load(ar);
APP->chaine_eff->LoadParamsFromMem(0);
APP->effect->setParameterAutomated(0,NBChaine2float(0));
int chainnb = APP->chaine_eff->load(ar);
APP->chaine_eff->LoadParamsFromMem(chainnb);

//change de chaine
APP->effect->setParameterAutomated(0,NBChaine2float(chainnb));
//ChangeChaine(0); /* reactive current_chaine */

OnUpdate();

if(b)
APP->chaine_eff->resume(0);
APP->chaine_eff->resume(chainnb);

ar.Close();
f.Close();
Expand All @@ -372,8 +375,9 @@ BOOL CChainDlg::SaveChaine(int chaine,LPCSTR Path)
return TRUE;
}CATCH(CFileException , ex)
{
return FALSE;
TRACE("###erreur de sauvegarde (save)");
return FALSE;

}END_CATCH
}

Expand Down
21 changes: 17 additions & 4 deletions End to End/multifxVST/TODO LIST.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,23 @@ MultiFXVST - CTAF Audio - version 0.7.6
//####################################################################
//########### HISTORY ################################################
//####################################################################
//-- 22/08/2004
- improve : restaure la chaine active dans les sauvegardes du projet de l'hote (setchunk/getchunk)

//-- 19/08/2004
- improve : interface graphique
- bug : recalcul le delay quand on supprime un effet, change de chaine, ... (initialdelay)
- bug : multifxchunk => restaure la chaine qu'il y avait avant... et la sauvegarde aussi :-)
- improve : les fichiers de sauvegarde a partir de maintenant seront toujours lisible par
les nouvelles version de multifxVST

//-- 16/08/2004
- bug : changement de chaine non mis a jour dans certain cas

//-- 15/08/2004 (version 0.7.6)
- improve : amelioration du moteur audio (fade,load,loadall...)
- bug : un bon tas de bug d�e au multithread

//-- 12/08/2004
- ajout : gestion du fade pour les changements de chaine

Expand Down Expand Up @@ -241,10 +254,10 @@ MultiFXVST - CTAF Audio - version 0.7.6
/#/- fxidle
// - getTailSize (process apr�s un suspend,pour les reverbs...)
// - getTailSize transmettre les queues de reverbs et autres entre les chaines si possible
// - toujours r�initialis� le fade dans stockeffect (loadchaine,setchunk,...,remove)
// - ne calcul le delay dans le cas d'une suppression d'effet ou autre... (initialdelay)
// - critical_section => suspend/resume (processing) , ...
// - effMainsChanged => qd on active d�zactive un effet pour qu'il vide ses buffers
// - startprocess / stopprocess beginedit/stopedit et d'autres



//####################################################################
//########### CONTACT ################################################
Expand Down
Binary file modified End to End/multifxVST/multifxVST.dll
Binary file not shown.
9 changes: 5 additions & 4 deletions MainDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ void CMainDlg::SetEffect(int nbeffstk)
effstk = APP->chaine_eff->get(APP->current_chaine,nbeffstk);
ASSERT(effstk);
nbeff = effstk->effect_nb;
m_btnbypass.SetValue(effstk->bypass);
m_btnbypass.SetValue(!effstk->bypass);
m_txteff.Format("%d:%s",nbeffstk+1,APP->chaine_eff->Get_Name(APP->current_chaine,nbeffstk));
}

Expand Down Expand Up @@ -248,6 +248,7 @@ void CMainDlg::InitialiseSkin()


m_btnbypass.LoadBitmap(IDB_BYPASS,true,7,27);
m_btnbypass.SetBitmapDisp(2,0,1,1,2,0);
text=_T("Bypass un effet");
m_btnbypass.SetToolTipText(&text);

Expand Down Expand Up @@ -449,7 +450,7 @@ void CMainDlg::OpenEffect(int chaine,int nbeffectstk)

((CSmpEffect *)pEffect)->SetEditWnd(pWnd);
lResult = APP->host->EffEditOpen(nEffect, pWnd->GetSafeHwnd());
long lResult = APP->host->EffEditGetRect(nEffect, &prc);
/*long lResult =*/ APP->host->EffEditGetRect(nEffect, &prc);
pWnd->SetEffSize(prc);

ChildNotify(pWnd);
Expand Down Expand Up @@ -486,7 +487,7 @@ void CMainDlg::OpenEffectTxT(int chaine,int nbeffectstk)

{
int nEffect = APP->chaine_eff->get_effect(APP->current_chaine,nbeffectstk);
CEffect *pEffect = APP->host->GetAt(nEffect);
//CEffect *pEffect = APP->host->GetAt(nEffect);


CEffectTxTDlg *pWnd = (CEffectTxTDlg *) new CEffectTxTDlg(this,APP);
Expand Down Expand Up @@ -1116,7 +1117,7 @@ void CMainDlg::UpdateBouton(int btn)
void CMainDlg::OnBnClickedBtnbypass()
{
bool bypass = APP->chaine_eff->GetByPass(APP->current_chaine,nbeffstk);
APP->chaine_eff->SetByPass(APP->current_chaine,nbeffstk,!bypass);
APP->chaine_eff->SetByPass(APP->current_chaine,nbeffstk,bypass);
}

//void CMainDlg::OnBnClickedBtneffecttxt2()
Expand Down
36 changes: 30 additions & 6 deletions Skin/HoverButton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,24 @@ CHoverButton::CHoverButton()
m_bTracking = FALSE;
OnOff = false;
m_value = false;

m_hoverOn = 0;
m_hoverOff = 0;
m_clickOn = 1;
m_clickOff = 1;
m_normalOn = 0;
m_normalOff= 2;

}
void CHoverButton::SetBitmapDisp(int m_hoverOn,int m_hoverOff,int m_clickOn,int m_clickOff,int m_normalOn,int m_normalOff)
{
this->m_hoverOn = m_hoverOn;
this->m_hoverOff = m_hoverOff;
this->m_clickOn = m_clickOn ;
this->m_clickOff = m_clickOff ;
this->m_normalOn = m_normalOn;
this->m_normalOff= m_normalOff;
RedrawWindow();
}

CHoverButton::~CHoverButton()
Expand Down Expand Up @@ -141,7 +159,13 @@ void CHoverButton::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
if(lpDrawItemStruct->itemState & ODS_SELECTED)
{
if(OnOff)
mydc->BitBlt(0,0,m_ButtonSize.cx,m_ButtonSize.cy,pMemDC,m_ButtonSize.cx,0,SRCCOPY);
{
if(m_value) //activé
mydc->BitBlt(0,0,m_ButtonSize.cx,m_ButtonSize.cy,pMemDC,m_ButtonSize.cx*m_clickOn,0,SRCCOPY);
else
mydc->BitBlt(0,0,m_ButtonSize.cx,m_ButtonSize.cy,pMemDC,m_ButtonSize.cx*m_clickOff,0,SRCCOPY);

}
else
mydc->BitBlt(0,0,m_ButtonSize.cx,m_ButtonSize.cy,pMemDC,m_ButtonSize.cx*2,0,SRCCOPY);
}
Expand All @@ -151,10 +175,10 @@ void CHoverButton::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
{
if(OnOff)
{
/*if(m_value) //activé
mydc->BitBlt(0,0,m_ButtonSize.cx,m_ButtonSize.cy,pMemDC,m_ButtonSize.cx*2,0,SRCCOPY);
if(m_value) //activé
mydc->BitBlt(0,0,m_ButtonSize.cx,m_ButtonSize.cy,pMemDC,m_ButtonSize.cx*m_hoverOn,0,SRCCOPY);
else //desactivé*/
mydc->BitBlt(0,0,m_ButtonSize.cx,m_ButtonSize.cy,pMemDC,0,0,SRCCOPY);
mydc->BitBlt(0,0,m_ButtonSize.cx,m_ButtonSize.cy,pMemDC,m_ButtonSize.cx*m_hoverOff,0,SRCCOPY);
}
else
{
Expand All @@ -165,9 +189,9 @@ void CHoverButton::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
if(OnOff)
{
if(!m_value)//desactivé
mydc->BitBlt(0,0,m_ButtonSize.cx,m_ButtonSize.cy,pMemDC,m_ButtonSize.cx*2,0,SRCCOPY);
mydc->BitBlt(0,0,m_ButtonSize.cx,m_ButtonSize.cy,pMemDC,m_ButtonSize.cx*m_normalOff,0,SRCCOPY);
else //activé
mydc->BitBlt(0,0,m_ButtonSize.cx,m_ButtonSize.cy,pMemDC,0,0,SRCCOPY);
mydc->BitBlt(0,0,m_ButtonSize.cx,m_ButtonSize.cy,pMemDC,m_ButtonSize.cx*m_normalOn,0,SRCCOPY);
}
else
{
Expand Down
2 changes: 2 additions & 0 deletions Skin/HoverButton.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class CHoverButton : public CBitmapButton
// Implementation
public:
BOOL LoadBitmap(UINT bitmapid,bool OnOff = false,int x = 0 ,int y = 0);
void SetBitmapDisp(int m_hoverOn,int m_hoverOff,int m_clickOn,int m_clickOff,int m_normalOn,int m_normalOff);
virtual ~CHoverButton();

// Generated message map functions
Expand All @@ -56,6 +57,7 @@ class CHoverButton : public CBitmapButton
afx_msg LRESULT OnMouseHover(WPARAM wparam, LPARAM lparam) ;
//}}AFX_MSG

int m_hoverOn,m_hoverOff,m_clickOn,m_clickOff,m_normalOn,m_normalOff;
DECLARE_MESSAGE_MAP()
public:
// afx_msg void OnLButtonDown(UINT nFlags, ::CPoint point);
Expand Down
20 changes: 10 additions & 10 deletions Skin/WithoutSliderCtrl/WithoutSliderCtrl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ void CWithoutSliderCtrl::OnPaint()
{
CPaintDC memDC(this); // device context for painting
//CMemDC memDC(&dc);
int nMin = GetRangeMin();
int nMax = GetRangeMax();
/* int nMin = GetRangeMin();
int nMax = GetRangeMax();*/
int scalepos = ConvertNOTIN400(pos);
CString buf;

Expand Down Expand Up @@ -104,8 +104,8 @@ bool CWithoutSliderCtrl::SetKnobPos(float nPos)
{
float nOldPos = pos;

int nMin = GetRangeMin();
int nMax = GetRangeMax();
/* int nMin = GetRangeMin();
int nMax = GetRangeMax();*/

if(nPos < 0)
nPos =0;
Expand Down Expand Up @@ -137,8 +137,8 @@ bool CWithoutSliderCtrl::UpdateKnobPos(int nDelta)
{
if(!nDelta)return false;

int nMin = GetRangeMin();
int nMax = GetRangeMax();
/* int nMin = GetRangeMin();
int nMax = GetRangeMax();*/

//pos += delta;

Expand Down Expand Up @@ -293,17 +293,17 @@ BOOL CWithoutSliderCtrl::OnWndMsg(UINT message, WPARAM wParam, LPARAM lParam, LR

if(message == TBM_GETPOS )
{
int nMin = GetRangeMin();
int nMax = GetRangeMax();
/*int nMin = GetRangeMin();
int nMax = GetRangeMax();*/
BOOL b = CSliderCtrl::OnWndMsg(message, wParam, lParam, pResult);
if(!b)//on fait que si il a fait qqch (normalement tjs)
int((*((int *)pResult))) = ConvertNOTIN400(pos);
return 1;

}else if(message == TBM_SETPOS)
{
int nMin = GetRangeMin();
int nMax = GetRangeMax();
/*int nMin = GetRangeMin();
int nMax = GetRangeMax();*/

BOOL b = CSliderCtrl::OnWndMsg(message, wParam, lParam, pResult);
if(!b)//on fait que si il a fait qqch (normalement tjs)
Expand Down
Binary file modified multifxVST.aps
Binary file not shown.
20 changes: 17 additions & 3 deletions multifxVST.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,14 @@ long multifxVST::setChunk(void *data,long byteSize,bool isPreset)
}

APP.chaine_eff->RemoveAll(false);
APP.chaine_eff->load(ar);
APP.chaine_eff->LoadParamsFromMem(APP.current_chaine);
int newchain = APP.chaine_eff->load(ar);
APP.chaine_eff->ChangeChaine(APP.current_chaine,newchain);

APP.chaine_eff->LoadParamsFromMem(newchain);

if(b)
{
APP.chaine_eff->resume(APP.current_chaine);
APP.chaine_eff->resume(newchain);
}
ar.Close();
f.Detach();//sinon memory leak! car ca detruit le buffer et Boumm
Expand Down Expand Up @@ -212,6 +214,18 @@ void multifxVST::suspend ()
APP.chaine_eff->suspend(APP.current_chaine);
}

long multifxVST::startProcess() // Called one time before the start of process call
{
APP.chaine_eff->startProcess();
return 0; //default
}

long multifxVST::stopProcess() // Called after the stop of process call
{
APP.chaine_eff->stopProcess();
return 0;//default
}

//-----------------------------------------------------------------------------
bool multifxVST::keysRequired ()
{
Expand Down
Loading

0 comments on commit c173c0c

Please sign in to comment.