diff options
Diffstat (limited to 'Bus/IvyProbe/IvyProbeDlg.cpp')
-rw-r--r-- | Bus/IvyProbe/IvyProbeDlg.cpp | 48 |
1 files changed, 25 insertions, 23 deletions
diff --git a/Bus/IvyProbe/IvyProbeDlg.cpp b/Bus/IvyProbe/IvyProbeDlg.cpp index 2112270..998c5dc 100644 --- a/Bus/IvyProbe/IvyProbeDlg.cpp +++ b/Bus/IvyProbe/IvyProbeDlg.cpp @@ -5,7 +5,7 @@ #include "Test.h"
#include "TestDlg.h"
-#include "BusApplication.h"
+#include "IvyApplication.h"
#ifdef _DEBUG
#define new DEBUG_NEW
@@ -66,7 +66,7 @@ CTestDlg::CTestDlg(CWnd* pParent /*=NULL*/) : CDialog(CTestDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CTestDlg)
- m_busnumber = 0;
+ m_busnumber = "";
//}}AFX_DATA_INIT
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
@@ -89,7 +89,6 @@ void CTestDlg::DoDataExchange(CDataExchange* pDX) DDX_Control(pDX, IDC_SLIDER1, m_slider1);
DDX_Control(pDX, IDC_SLIDER0, m_slider0);
DDX_Text(pDX, IDC_BUSNUMBER, m_busnumber);
- DDV_MinMaxUInt(pDX, m_busnumber, 1024, 65535);
//}}AFX_DATA_MAP
}
@@ -135,7 +134,14 @@ BOOL CTestDlg::OnInitDialog() SetIcon(m_hIcon, FALSE); // Set small icon
// TODO: Add extra initialization here
- m_busnumber = 2010;
+ bus = new Ivy( "TEST NT","TEST NT READY",this);
+
+ bus->BindMsg("^MIDICS10:fader([0-7]) value=([0-9]+)", BUS_CALLBACK_OF(CTestDlg, FaderCallback));
+ bus->BindMsg("^MIDICS10:knob([0-5]) value=([0-9]+)", BUS_CALLBACK_OF(CTestDlg, FaderCallback));
+ bus->BindMsg("(.*)", BUS_CALLBACK_OF(CTestDlg, IvyCallback ));
+
+ //bus->BindMsg("^S( A=([0-9]+))?( B=([0-9]+))?",cb);
+ m_busnumber = bus->GetDomain( m_busnumber );
UpdateData(FALSE);
m_slider0.SetRange( 0, 127);
@@ -211,29 +217,25 @@ HCURSOR CTestDlg::OnQueryDragIcon() void CTestDlg::OnStart()
{
UpdateData(TRUE);
- bus = new Bus( "TEST NT", m_busnumber,"TEST NT READY",this);
-
- bus->BindMsg("^MIDICS10:fader([0-7]) value=([0-9]+)", BUS_CALLBACK_OF(CTestDlg, FaderCallback));
- bus->BindMsg("^MIDICS10:knob([0-5]) value=([0-9]+)", BUS_CALLBACK_OF(CTestDlg, FaderCallback));
- bus->BindMsg("(.*)", BUS_CALLBACK_OF(CTestDlg, BusCallback ));
-
- //bus->BindMsg("^S( A=([0-9]+))?( B=([0-9]+))?",cb);
- bus->start();
+ bus->stop();
+ m_busnumber = bus->GetDomain( m_busnumber );
+ bus->start(m_busnumber);
+ UpdateData(FALSE);
}
-void CTestDlg::BusCallback(BusApplication *app, int argc, const char **argv)
+void CTestDlg::IvyCallback(IvyApplication *app, int argc, const char **argv)
{
int i;
CString text;
TRACE(" Called function args:");
-// m_text.SetSel( -1, -1, FALSE );
- text.Format("Bus callback %d args\r\n",argc );
-// m_text.ReplaceSel( text );
+ m_text.SetSel( -1, -1, FALSE );
+ text.Format("Ivy callback %d args\r\n",argc );
+ m_text.ReplaceSel( text );
for ( i = 0; i < argc; i++ )
{
-// m_text.SetSel( -1, -1, FALSE );
- text.Format("Bus callback arg%d '%s'\r\n",i, argv[i] );
-// m_text.ReplaceSel( text );
+ m_text.SetSel( -1, -1, FALSE );
+ text.Format("Ivy callback arg%d '%s'\r\n",i, argv[i] );
+ m_text.ReplaceSel( text );
TRACE(" '%s'",argv[i]);
}
TRACE("\n");
@@ -247,7 +249,7 @@ void CTestDlg::OnOK() CDialog::OnOK();
}
-void CTestDlg::FaderCallback(BusApplication *app, int argc, const char **argv)
+void CTestDlg::FaderCallback(IvyApplication *app, int argc, const char **argv)
{
int fader;
int value;
@@ -288,19 +290,19 @@ UpdateData(FALSE); }
-void CTestDlg::OnDirectMessage(BusApplication *app, int id, const char *arg)
+void CTestDlg::OnDirectMessage(IvyApplication *app, int id, const char *arg)
{
TRACE("Direct Msg Receive %d, %s\n",id,arg );
}
-void CTestDlg::OnApplicationConnected(BusApplication *app)
+void CTestDlg::OnApplicationConnected(IvyApplication *app)
{
CString text;
m_text.SetSel( -1, -1, FALSE );
text.Format("Application: %s ready\r\n",(LPCSTR)(app->GetName()) );
m_text.ReplaceSel( text );
}
-void CTestDlg::OnApplicationDisconnected(BusApplication *app)
+void CTestDlg::OnApplicationDisconnected(IvyApplication *app)
{
CString text;
m_text.SetSel( -1, -1, FALSE );
|