summaryrefslogtreecommitdiff
path: root/Bus/IvyProbe/IvyProbeDlg.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Bus/IvyProbe/IvyProbeDlg.cpp')
-rw-r--r--Bus/IvyProbe/IvyProbeDlg.cpp71
1 files changed, 41 insertions, 30 deletions
diff --git a/Bus/IvyProbe/IvyProbeDlg.cpp b/Bus/IvyProbe/IvyProbeDlg.cpp
index 62fd7ac..dc99158 100644
--- a/Bus/IvyProbe/IvyProbeDlg.cpp
+++ b/Bus/IvyProbe/IvyProbeDlg.cpp
@@ -4,6 +4,7 @@
#include "stdafx.h"
#include "Test.h"
#include "TestDlg.h"
+#include "TestParseCmdLine.h"
#include "IvyApplication.h"
@@ -63,7 +64,7 @@ END_MESSAGE_MAP()
// CTestDlg dialog
CTestDlg::CTestDlg(CWnd* pParent /*=NULL*/)
- : ETSLayoutDialog(CTestDlg::IDD, pParent)
+ : MyDialog(CTestDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CTestDlg)
m_busnumber = "";
@@ -76,7 +77,7 @@ CTestDlg::CTestDlg(CWnd* pParent /*=NULL*/)
void CTestDlg::DoDataExchange(CDataExchange* pDX)
{
- ETSLayoutDialog::DoDataExchange(pDX);
+ MyDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CTestDlg)
DDX_Control(pDX, IDC_REGEXP, m_expr);
DDX_Control(pDX, IDC_MSG, m_msg);
@@ -92,7 +93,7 @@ void CTestDlg::DoDataExchange(CDataExchange* pDX)
//}}AFX_DATA_MAP
}
-BEGIN_MESSAGE_MAP(CTestDlg, ETSLayoutDialog)
+BEGIN_MESSAGE_MAP(CTestDlg, MyDialog)
//{{AFX_MSG_MAP(CTestDlg)
ON_WM_SYSCOMMAND()
ON_WM_QUERYDRAGICON()
@@ -108,7 +109,7 @@ END_MESSAGE_MAP()
BOOL CTestDlg::OnInitDialog()
{
- ETSLayoutDialog::OnInitDialog();
+ MyDialog::OnInitDialog();
// Add "About..." menu item to system menu.
@@ -132,7 +133,8 @@ BOOL CTestDlg::OnInitDialog()
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
-
+
+#ifndef UNDER_CE
// define the Layout
CreateRoot( VERTICAL )
<< ( pane( HORIZONTAL, ABSOLUTE_VERT )
@@ -163,7 +165,7 @@ BOOL CTestDlg::OnInitDialog()
<< item( IDC_BIND, NORESIZE )
);
UpdateLayout ();
-
+#endif
// extra initialization here
m_text.SubclassDlgItem (IDC_TEXT, this);
@@ -176,15 +178,22 @@ BOOL CTestDlg::OnInitDialog()
m_slider6.SetRange( 0, 127);
m_slider7.SetRange( 0, 127);
- m_slider0.SetWindowText( "MIDICS10:fader0 value=" );
- m_slider1.SetWindowText( "MIDICS10:fader1 value=" );
- m_slider2.SetWindowText( "MIDICS10:fader2 value=" );
- m_slider3.SetWindowText( "MIDICS10:fader3 value=" );
- m_slider4.SetWindowText( "MIDICS10:fader4 value=" );
- m_slider5.SetWindowText( "MIDICS10:fader5 value=" );
- m_slider6.SetWindowText( "MIDICS10:fader6 value=" );
- m_slider7.SetWindowText( "MIDICS10:fader7 value=" );
-
+ m_slider0.SetWindowText( TEXT("MIDICS10:fader0 value=") );
+ m_slider1.SetWindowText( TEXT("MIDICS10:fader1 value=") );
+ m_slider2.SetWindowText( TEXT("MIDICS10:fader2 value=") );
+ m_slider3.SetWindowText( TEXT("MIDICS10:fader3 value=") );
+ m_slider4.SetWindowText( TEXT("MIDICS10:fader4 value=") );
+ m_slider5.SetWindowText( TEXT("MIDICS10:fader5 value=") );
+ m_slider6.SetWindowText( TEXT("MIDICS10:fader6 value=") );
+ m_slider7.SetWindowText( TEXT("MIDICS10:fader7 value=") );
+
+ // parse command Line Info
+ TestParseCmdLine cmd;
+ AfxGetApp()->ParseCommandLine( cmd );
+
+ // Set Argument from Command Line
+ m_busnumber = cmd.m_busNumber;
+
bus = new Ivy( "TEST NT","TEST NT READY",this,FALSE);
bus->BindMsg("^MIDICS10:fader([0-7]) value=([0-9]+)", BUS_CALLBACK_OF(CTestDlg, FaderCallback));
@@ -195,7 +204,9 @@ BOOL CTestDlg::OnInitDialog()
m_busnumber = bus->GetDomain( m_busnumber );
UpdateData(FALSE);
-
+ // force bus start in case of start
+ if ( cmd.m_start )
+ OnStart();
return TRUE; // return TRUE unless you set the focus to a control
}
@@ -209,7 +220,7 @@ void CTestDlg::OnSysCommand(UINT nID, LPARAM lParam)
}
else
{
- ETSLayoutDialog::OnSysCommand(nID, lParam);
+ MyDialog::OnSysCommand(nID, lParam);
}
}
@@ -235,14 +246,14 @@ void CTestDlg::IvyCallback(IvyApplication *app, int argc, const char **argv)
{
int i;
CString text;
- TRACE(" Called function args:");
- WriteMessage( "Ivy callback %d args",argc );
+ TRACE(TEXT(" Called function args:"));
+ WriteMessage( TEXT("Ivy callback %d args"),argc );
for ( i = 0; i < argc; i++ )
{
- WriteMessage( " arg%d='%s'",i, argv[i] );
- TRACE(" '%s'",argv[i]);
+ WriteMessage( TEXT(" arg%d='%s'"),i, argv[i] );
+ TRACE(TEXT(" '%s'"),argv[i]);
}
- TRACE("\n");
+ TRACE(TEXT("\n"));
}
@@ -253,7 +264,7 @@ int fader;
int value;
if ( argc != 2 )
{
- TRACE("bad Fader call back\n");
+ TRACE(TEXT("bad Fader call back\n"));
return;
}
fader = atoi( argv[0] );
@@ -290,16 +301,16 @@ if ( argc != 2 )
void CTestDlg::OnDirectMessage(IvyApplication *app, int id, const char *arg)
{
-TRACE("Direct Msg Receive %d, %s\n",id,arg );
+TRACE(TEXT("Direct Msg Receive %d, %s\n"),id,arg );
}
void CTestDlg::OnApplicationConnected(IvyApplication *app)
{
- WriteMessage( "Application: %s ready",(LPCSTR)(app->GetName()) );
+ WriteMessage( TEXT("Application: %s ready"),(LPCSTR)(app->GetName()) );
}
void CTestDlg::OnApplicationDisconnected(IvyApplication *app)
{
- WriteMessage( "Application: %s bye",(LPCSTR)(app->GetName()) );
+ WriteMessage( TEXT("Application: %s bye"),(LPCSTR)(app->GetName()) );
}
void CTestDlg::WriteMessage(LPCTSTR format, ...)
{
@@ -316,10 +327,10 @@ void CTestDlg::WriteMessage(LPCTSTR format, ...)
void CTestDlg::OnClose()
{
// TODO: Add your message handler code here and/or call default
- TRACE ( "Quitting\n");
+ TRACE ( TEXT("Quitting\n"));
if (bus) delete bus;
- ETSLayoutDialog::OnClose();
+ MyDialog::OnClose();
}
@@ -334,7 +345,7 @@ void CTestDlg::OnSend()
{
m_msg.AddString( buffer );
}
- WriteMessage( "Sending %d message %s",count,(LPCSTR)buffer );
+ WriteMessage( TEXT("Sending %d message %s"),count,(LPCSTR)buffer );
m_msg.Clear();
}
@@ -349,6 +360,6 @@ void CTestDlg::OnBind()
{
m_expr.AddString( buffer );
}
- WriteMessage( "Binding to %s", (LPCSTR)buffer );
+ WriteMessage( TEXT("Binding to %s"), (LPCSTR)buffer );
m_expr.Clear();
}