|
From: <pst...@us...> - 2010-04-26 03:44:29
|
Revision: 758
http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=758&view=rev
Author: pstieber
Date: 2010-04-26 03:44:22 +0000 (Mon, 26 Apr 2010)
Log Message:
-----------
1. Added new text and end of track dialogs.
2. Added SetText for the text event.
3. Added a track pointer to the SysEx dialog.
4. Added arguments to the program changed and controller dialogs.
Modified Paths:
--------------
trunk/jazz/src/Dialogs/ControllerDialog.cpp
trunk/jazz/src/Dialogs/ControllerDialog.h
trunk/jazz/src/Dialogs/ProgramChangeDialog.cpp
trunk/jazz/src/Dialogs/ProgramChangeDialog.h
trunk/jazz/src/Dialogs/SysexDialog.cpp
trunk/jazz/src/Dialogs/SysexDialog.h
trunk/jazz/src/Dialogs.cpp
trunk/jazz/src/Events.h
trunk/jazz/src/Makefile.am
trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj
Added Paths:
-----------
trunk/jazz/src/Dialogs/EndOfTrackDialog.cpp
trunk/jazz/src/Dialogs/EndOfTrackDialog.h
trunk/jazz/src/Dialogs/TextDialog.cpp
trunk/jazz/src/Dialogs/TextDialog.h
Modified: trunk/jazz/src/Dialogs/ControllerDialog.cpp
===================================================================
--- trunk/jazz/src/Dialogs/ControllerDialog.cpp 2010-04-26 02:08:50 UTC (rev 757)
+++ trunk/jazz/src/Dialogs/ControllerDialog.cpp 2010-04-26 03:44:22 UTC (rev 758)
@@ -1,3 +1,23 @@
+//*****************************************************************************
+// The JAZZ++ Midi Sequencer
+//
+// Copyright (C) 2010 Peter J. Stieber, all rights reserved.
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+//*****************************************************************************
+
#include "ControllerDialog.h"
#include "../Configuration.h"
@@ -18,8 +38,12 @@
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-JZControllerDialog::JZControllerDialog(wxWindow* pParent)
+JZControllerDialog::JZControllerDialog(
+ tControl* pControl,
+ JZTrack* pTrack,
+ wxWindow* pParent)
: wxDialog(pParent, wxID_ANY, wxString("Controller")),
+ mpControl(pControl),
mpControllerListBox(0)
{
mpControllerListBox = new wxListBox(this, wxID_ANY);
Modified: trunk/jazz/src/Dialogs/ControllerDialog.h
===================================================================
--- trunk/jazz/src/Dialogs/ControllerDialog.h 2010-04-26 02:08:50 UTC (rev 757)
+++ trunk/jazz/src/Dialogs/ControllerDialog.h 2010-04-26 03:44:22 UTC (rev 758)
@@ -24,6 +24,8 @@
#include <wx/dialog.h>
+class tControl;
+class JZTrack;
class wxListBox;
//*****************************************************************************
@@ -32,10 +34,15 @@
{
public:
- JZControllerDialog(wxWindow* pParent);
+ JZControllerDialog(
+ tControl* pControl,
+ JZTrack* pTrack,
+ wxWindow* pParent);
private:
+ tControl* mpControl;
+
wxListBox* mpControllerListBox;
DECLARE_EVENT_TABLE();
Added: trunk/jazz/src/Dialogs/EndOfTrackDialog.cpp
===================================================================
--- trunk/jazz/src/Dialogs/EndOfTrackDialog.cpp (rev 0)
+++ trunk/jazz/src/Dialogs/EndOfTrackDialog.cpp 2010-04-26 03:44:22 UTC (rev 758)
@@ -0,0 +1,118 @@
+//*****************************************************************************
+// The JAZZ++ Midi Sequencer
+//
+// Copyright (C) 2010 Peter J. Stieber, all rights reserved.
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+//*****************************************************************************
+
+#include "EndOfTrackDialog.h"
+
+#include "../Globals.h"
+#include "../Help.h"
+#include "../Project.h"
+
+#include <wx/button.h>
+#include <wx/sizer.h>
+#include <wx/stattext.h>
+#include <wx/textctrl.h>
+
+#include <string>
+
+using namespace std;
+
+//*****************************************************************************
+//*****************************************************************************
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+BEGIN_EVENT_TABLE(JZEndOfTrackDialog, wxDialog)
+
+ EVT_BUTTON(wxID_HELP, JZEndOfTrackDialog::OnHelp)
+
+END_EVENT_TABLE()
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+JZEndOfTrackDialog::JZEndOfTrackDialog(
+ tEndOfTrack* pEndOfTrackEvent,
+ JZTrack* pTrack,
+ wxWindow * pParent)
+ : wxDialog(pParent, wxID_ANY, wxString("End of Track")),
+ mpEndOfTrackEvent(pEndOfTrackEvent),
+ mpClockEdit(0)
+{
+ mpClockEdit = new wxTextCtrl(this, wxID_ANY);
+
+ wxButton* pOkButton = new wxButton(this, wxID_OK, "&OK");
+ wxButton* pCancelButton = new wxButton(this, wxID_CANCEL, "Cancel");
+ wxButton* pHelpButton = new wxButton(this, wxID_HELP, "Help");
+ pOkButton->SetDefault();
+
+ wxBoxSizer* pTopSizer = new wxBoxSizer(wxVERTICAL);
+
+ wxFlexGridSizer* pFlexGridSizer;
+
+ pFlexGridSizer = new wxFlexGridSizer(1, 2, 4, 2);
+
+ pFlexGridSizer->Add(
+ new wxStaticText(this, wxID_ANY, "Time:"),
+ 0,
+ wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
+ pFlexGridSizer->Add(mpClockEdit, 0, wxALIGN_CENTER_VERTICAL);
+
+ pTopSizer->Add(pFlexGridSizer, 0, wxCENTER | wxALL, 2);
+
+ wxBoxSizer* pButtonSizer = new wxBoxSizer(wxHORIZONTAL);
+ pButtonSizer->Add(pOkButton, 0, wxALL, 5);
+ pButtonSizer->Add(pCancelButton, 0, wxALL, 5);
+ pButtonSizer->Add(pHelpButton, 0, wxALL, 5);
+
+ pTopSizer->Add(pButtonSizer, 0, wxALIGN_CENTER | wxBOTTOM, 6);
+
+ SetAutoLayout(true);
+ SetSizer(pTopSizer);
+
+ pTopSizer->SetSizeHints(this);
+ pTopSizer->Fit(this);
+}
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+bool JZEndOfTrackDialog::TransferDataToWindow()
+{
+ string ClockString;
+ gpProject->ClockToString(mpEndOfTrackEvent->GetClock(), ClockString);
+ mpClockEdit->ChangeValue(ClockString.c_str());
+
+ return true;
+}
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+bool JZEndOfTrackDialog::TransferDataFromWindow()
+{
+ wxString ClockString = mpClockEdit->GetValue();
+ int Clock = gpProject->StringToClock(ClockString.c_str());
+ mpEndOfTrackEvent->SetClock(Clock);
+
+ return true;
+}
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+void JZEndOfTrackDialog::OnHelp(wxCommandEvent& Event)
+{
+ gpHelpInstance->ShowTopic("Template");
+}
Property changes on: trunk/jazz/src/Dialogs/EndOfTrackDialog.cpp
___________________________________________________________________
Added: svn:eol-style
+ native
Added: trunk/jazz/src/Dialogs/EndOfTrackDialog.h
===================================================================
--- trunk/jazz/src/Dialogs/EndOfTrackDialog.h (rev 0)
+++ trunk/jazz/src/Dialogs/EndOfTrackDialog.h 2010-04-26 03:44:22 UTC (rev 758)
@@ -0,0 +1,58 @@
+//*****************************************************************************
+// The JAZZ++ Midi Sequencer
+//
+// Copyright (C) 2010 Peter J. Stieber, all rights reserved.
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+//*****************************************************************************
+
+#ifndef JZ_ENDOFTRACKDIALOG_H
+#define JZ_ENDOFTRACKDIALOG_H
+
+#include <wx/dialog.h>
+
+class tEndOfTrack;
+class JZTrack;
+class wxTextCtrl;
+
+//*****************************************************************************
+//*****************************************************************************
+class JZEndOfTrackDialog : public wxDialog
+{
+ public:
+
+ JZEndOfTrackDialog(
+ tEndOfTrack* pEndOfTrackEvent,
+ JZTrack* pTrack,
+ wxWindow* pParent);
+
+ private:
+
+ virtual bool TransferDataToWindow();
+
+ virtual bool TransferDataFromWindow();
+
+ void OnHelp(wxCommandEvent& Event);
+
+ private:
+
+ tEndOfTrack* mpEndOfTrackEvent;
+
+ wxTextCtrl* mpClockEdit;
+
+ DECLARE_EVENT_TABLE();
+};
+
+#endif // !defined(JZ_ENDOFTRACKDIALOG_H)
Property changes on: trunk/jazz/src/Dialogs/EndOfTrackDialog.h
___________________________________________________________________
Added: svn:eol-style
+ native
Modified: trunk/jazz/src/Dialogs/ProgramChangeDialog.cpp
===================================================================
--- trunk/jazz/src/Dialogs/ProgramChangeDialog.cpp 2010-04-26 02:08:50 UTC (rev 757)
+++ trunk/jazz/src/Dialogs/ProgramChangeDialog.cpp 2010-04-26 03:44:22 UTC (rev 758)
@@ -1,3 +1,23 @@
+//*****************************************************************************
+// The JAZZ++ Midi Sequencer
+//
+// Copyright (C) 2010 Peter J. Stieber, all rights reserved.
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+//*****************************************************************************
+
#include "ProgramChangeDialog.h"
#include "../Configuration.h"
@@ -18,8 +38,12 @@
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-JZProgramChangeDialog::JZProgramChangeDialog(wxWindow* pParent)
+JZProgramChangeDialog::JZProgramChangeDialog(
+ tProgram* pProgram,
+ JZTrack* pTrack,
+ wxWindow* pParent)
: wxDialog(pParent, wxID_ANY, wxString("Program Change")),
+ mpProgram(pProgram),
mpProgramListBox(0)
{
mpProgramListBox = new wxListBox(this, wxID_ANY);
Modified: trunk/jazz/src/Dialogs/ProgramChangeDialog.h
===================================================================
--- trunk/jazz/src/Dialogs/ProgramChangeDialog.h 2010-04-26 02:08:50 UTC (rev 757)
+++ trunk/jazz/src/Dialogs/ProgramChangeDialog.h 2010-04-26 03:44:22 UTC (rev 758)
@@ -23,6 +23,8 @@
#include <wx/dialog.h>
+class tProgram;
+class JZTrack;
class wxListBox;
//*****************************************************************************
@@ -31,10 +33,15 @@
{
public:
- JZProgramChangeDialog(wxWindow* pParent);
+ JZProgramChangeDialog(
+ tProgram* pProgram,
+ JZTrack* pTrack,
+ wxWindow* pParent);
private:
+ tProgram* mpProgram;
+
wxListBox* mpProgramListBox;
DECLARE_EVENT_TABLE();
Modified: trunk/jazz/src/Dialogs/SysexDialog.cpp
===================================================================
--- trunk/jazz/src/Dialogs/SysexDialog.cpp 2010-04-26 02:08:50 UTC (rev 757)
+++ trunk/jazz/src/Dialogs/SysexDialog.cpp 2010-04-26 03:44:22 UTC (rev 758)
@@ -47,7 +47,10 @@
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-JZSysexDialog::JZSysexDialog(tSysEx* pEvent, wxWindow* pParent)
+JZSysexDialog::JZSysexDialog(
+ tSysEx* pEvent,
+ JZTrack* pTrack,
+ wxWindow* pParent)
: wxDialog(pParent, wxID_ANY, wxString("System Exclusive")),
mpSysExEvent(pEvent),
mpSysExEdit(0),
Modified: trunk/jazz/src/Dialogs/SysexDialog.h
===================================================================
--- trunk/jazz/src/Dialogs/SysexDialog.h 2010-04-26 02:08:50 UTC (rev 757)
+++ trunk/jazz/src/Dialogs/SysexDialog.h 2010-04-26 03:44:22 UTC (rev 758)
@@ -26,6 +26,7 @@
class JZKnob;
class JZKnobEvent;
class tSysEx;
+class JZTrack;
class wxStaticText;
class wxTextCtrl;
@@ -35,7 +36,7 @@
{
public:
- JZSysexDialog(tSysEx* pEvent, wxWindow* pParent);
+ JZSysexDialog(tSysEx* pEvent, JZTrack* pTrack, wxWindow* pParent);
private:
Added: trunk/jazz/src/Dialogs/TextDialog.cpp
===================================================================
--- trunk/jazz/src/Dialogs/TextDialog.cpp (rev 0)
+++ trunk/jazz/src/Dialogs/TextDialog.cpp 2010-04-26 03:44:22 UTC (rev 758)
@@ -0,0 +1,134 @@
+//*****************************************************************************
+// The JAZZ++ Midi Sequencer
+//
+// Copyright (C) 2010 Peter J. Stieber, all rights reserved.
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+//*****************************************************************************
+
+#include "TextDialog.h"
+
+#include "../Events.h"
+#include "../Globals.h"
+#include "../Help.h"
+#include "../Project.h"
+
+#include <wx/button.h>
+#include <wx/sizer.h>
+#include <wx/stattext.h>
+#include <wx/textctrl.h>
+
+#include <string>
+
+using namespace std;
+
+//*****************************************************************************
+//*****************************************************************************
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+BEGIN_EVENT_TABLE(JZTextDialog, wxDialog)
+
+ EVT_BUTTON(wxID_HELP, JZTextDialog::OnHelp)
+
+END_EVENT_TABLE()
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+JZTextDialog::JZTextDialog(
+ tText* pTextEvent,
+ JZTrack* pTrack,
+ wxWindow * pParent)
+ : wxDialog(pParent, wxID_ANY, wxString("Text")),
+ mpTextEvent(pTextEvent),
+ mpTextEdit(0),
+ mpClockEdit(0)
+{
+ mpTextEdit = new wxTextCtrl(this, wxID_ANY);
+ mpClockEdit = new wxTextCtrl(this, wxID_ANY);
+
+ wxButton* pOkButton = new wxButton(this, wxID_OK, "&OK");
+ wxButton* pCancelButton = new wxButton(this, wxID_CANCEL, "Cancel");
+ wxButton* pHelpButton = new wxButton(this, wxID_HELP, "Help");
+ pOkButton->SetDefault();
+
+ wxBoxSizer* pTopSizer = new wxBoxSizer(wxVERTICAL);
+
+ wxFlexGridSizer* pFlexGridSizer;
+
+ pFlexGridSizer = new wxFlexGridSizer(2, 2, 4, 2);
+
+ pFlexGridSizer->Add(
+ new wxStaticText(this, wxID_ANY, "Text:"),
+ 0,
+ wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
+ pFlexGridSizer->Add(mpTextEdit, 0, wxALIGN_CENTER_VERTICAL);
+
+ pFlexGridSizer->Add(
+ new wxStaticText(this, wxID_ANY, "Time:"),
+ 0,
+ wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
+ pFlexGridSizer->Add(mpClockEdit, 0, wxALIGN_CENTER_VERTICAL);
+
+ pTopSizer->Add(pFlexGridSizer, 0, wxCENTER | wxALL, 2);
+
+ wxBoxSizer* pButtonSizer = new wxBoxSizer(wxHORIZONTAL);
+ pButtonSizer->Add(pOkButton, 0, wxALL, 5);
+ pButtonSizer->Add(pCancelButton, 0, wxALL, 5);
+ pButtonSizer->Add(pHelpButton, 0, wxALL, 5);
+
+ pTopSizer->Add(pButtonSizer, 0, wxALIGN_CENTER | wxBOTTOM, 6);
+
+ SetAutoLayout(true);
+ SetSizer(pTopSizer);
+
+ pTopSizer->SetSizeHints(this);
+ pTopSizer->Fit(this);
+}
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+bool JZTextDialog::TransferDataToWindow()
+{
+ const unsigned char* pText = mpTextEvent->GetData();
+
+ mpTextEdit->ChangeValue(pText);
+
+ string ClockString;
+ gpProject->ClockToString(mpTextEvent->GetClock(), ClockString);
+ mpClockEdit->ChangeValue(ClockString.c_str());
+
+ return true;
+}
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+bool JZTextDialog::TransferDataFromWindow()
+{
+ wxString Text = mpTextEdit->GetValue();
+ mpTextEvent->SetText(Text.c_str());
+
+ wxString ClockString = mpClockEdit->GetValue();
+ int Clock = gpProject->StringToClock(ClockString.c_str());
+ mpTextEvent->SetClock(Clock);
+
+ return true;
+}
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+void JZTextDialog::OnHelp(wxCommandEvent& Event)
+{
+ gpHelpInstance->ShowTopic("Text Dialog");
+}
Property changes on: trunk/jazz/src/Dialogs/TextDialog.cpp
___________________________________________________________________
Added: svn:eol-style
+ native
Added: trunk/jazz/src/Dialogs/TextDialog.h
===================================================================
--- trunk/jazz/src/Dialogs/TextDialog.h (rev 0)
+++ trunk/jazz/src/Dialogs/TextDialog.h 2010-04-26 03:44:22 UTC (rev 758)
@@ -0,0 +1,56 @@
+//*****************************************************************************
+// The JAZZ++ Midi Sequencer
+//
+// Copyright (C) 2010 Peter J. Stieber, all rights reserved.
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+//*****************************************************************************
+
+#ifndef JZ_TEXTDIALOG_H
+#define JZ_TEXTDIALOG_H
+
+#include <wx/dialog.h>
+
+class JZTrack;
+class tText;
+class wxTextCtrl;
+
+//*****************************************************************************
+//*****************************************************************************
+class JZTextDialog : public wxDialog
+{
+ public:
+
+ JZTextDialog(tText* pTextEvent, JZTrack* pTrack, wxWindow* pParent);
+
+ private:
+
+ bool TransferDataToWindow();
+
+ bool TransferDataFromWindow();
+
+ void OnHelp(wxCommandEvent& Event);
+
+ private:
+
+ tText* mpTextEvent;
+
+ wxTextCtrl* mpTextEdit;
+ wxTextCtrl* mpClockEdit;
+
+ DECLARE_EVENT_TABLE();
+};
+
+#endif // !defined(JZ_TEXTDIALOG_H)
Property changes on: trunk/jazz/src/Dialogs/TextDialog.h
___________________________________________________________________
Added: svn:eol-style
+ native
Modified: trunk/jazz/src/Dialogs.cpp
===================================================================
--- trunk/jazz/src/Dialogs.cpp 2010-04-26 02:08:50 UTC (rev 757)
+++ trunk/jazz/src/Dialogs.cpp 2010-04-26 03:44:22 UTC (rev 758)
@@ -26,11 +26,12 @@
#include "Command.h"
#include "DeprecatedWx/proplist.h"
#include "Dialogs/ControllerDialog.h"
+#include "Dialogs/EndOfTrackDialog.h"
#include "Dialogs/KeyOnDialog.h"
#include "Dialogs/ProgramChangeDialog.h"
#include "Dialogs/SetTempoDialog.h"
#include "Dialogs/SysexDialog.h"
-//#include "EventFrame.h"
+#include "Dialogs/TextDialog.h"
#include "Events.h"
#include "EventWindow.h"
#include "Filter.h"
@@ -425,7 +426,7 @@
Choice.GetValue();
p->track = track;
p->transpose = transpose;
- p->eventlength=eventlength;
+ p->eventlength = eventlength;
return tEventDlg::OnClose();
}
@@ -449,91 +450,7 @@
tEventDlg::AddProperties();
}
-// -------------------------------- text event ---------------------------
-class tTextDlg : public tEventDlg
-{
- public:
-
- char* text;
- int track;
- tNamedChoice Choice;
-
- tTextDlg(tText *e, JZPianoWindow* w, JZTrack *pTrack);
-
- void AddProperties();
- bool OnClose();
-};
-
-
-tTextDlg::tTextDlg(tText *e, JZPianoWindow* w, JZTrack *pTrack)
- : tEventDlg(e, w, pTrack),
- Choice("text", gpConfig->GetControlNames(), &track)
-{
- Event = e;
- text=new char[2048];
- strcpy(text, (const char*)(e->GetText()));
-}
-
-
-bool tTextDlg::OnClose()
-{
- tText* p;
- p=new tText( ((tText*)Copy)->GetClock(), (unsigned char*)text, strlen(text));
- delete Copy;
- Copy=p;
- fprintf(stderr,"text:%s",text);
- Choice.GetValue();
- delete text;
- return tEventDlg::OnClose();
-}
-
-void tTextDlg::AddProperties()
-{
- sheet->AddProperty(new wxProperty("Text", wxPropertyValue((char**)&text), "string"));
- // Add(wxMakeFormString("Text:", (char**)&text));
- tEventDlg::AddProperties();
-}
-
-
-
-// -------------------------------- EOT ---------------------------
-
-class tEndOfTrackDlg : public tEventDlg
-{
- public:
- int track;
-
- tNamedChoice Choice;
-
- tEndOfTrackDlg(tEndOfTrack *e, JZPianoWindow* w, JZTrack *pTrack);
-
- void AddProperties();
- bool OnClose();
-};
-
-
-tEndOfTrackDlg::tEndOfTrackDlg(tEndOfTrack *e, JZPianoWindow* w, JZTrack *pTrack)
- : tEventDlg(e, w, pTrack),
- Choice("End Of Track", gpConfig->GetControlNames(), &track)
-{
-
-}
-
-
-bool tEndOfTrackDlg::OnClose()
-{
-// tEndOfTrack* p=(tEndOfTrack*)Copy;
- Choice.GetValue();
- return tEventDlg::OnClose();
-}
-
-void tEndOfTrackDlg::AddProperties()
-{
- tEventDlg::AddProperties();
-}
-
-
//*****************************************************************************
// Description:
// Display a dialog box to select an event to be created.
@@ -657,17 +574,21 @@
break;
case StatControl:
-// pDialog = new tControlDlg(pEvent->IsControl(), pPianoWindow, pTrack);
{
- JZControllerDialog ControllerDialog(pPianoWindow);
+ JZControllerDialog ControllerDialog(
+ pEvent->IsControl(),
+ pTrack,
+ pPianoWindow);
ControllerDialog.ShowModal();
}
break;
case StatProgram:
-// pDialog = new tProgramDlg(pEvent->IsProgram(), pPianoWindow, pTrack);
{
- JZProgramChangeDialog ProgramChangeDialog(pPianoWindow);
+ JZProgramChangeDialog ProgramChangeDialog(
+ pEvent->IsProgram(),
+ pTrack,
+ pPianoWindow);
ProgramChangeDialog.ShowModal();
}
break;
@@ -683,9 +604,8 @@
break;
case StatSysEx:
-// pDialog = new tSysexDlg(pEvent->IsSysEx(), pPianoWindow, pTrack);
{
- JZSysexDialog SysexDialog(pEvent->IsSysEx(), pPianoWindow);
+ JZSysexDialog SysexDialog(pEvent->IsSysEx(), pTrack, pPianoWindow);
SysexDialog.ShowModal();
}
break;
@@ -696,16 +616,22 @@
break;
case StatEndOfTrack:
- str = "End Of Track";
- pDialog = new tEndOfTrackDlg(pEvent->IsEndOfTrack(), pPianoWindow, pTrack);
+ {
+ JZEndOfTrackDialog EndOfTrackDialog(
+ pEvent->IsEndOfTrack(),
+ pTrack,
+ pPianoWindow);
+ EndOfTrackDialog.ShowModal();
+ }
break;
case StatText:
- str = "Text";
- pDialog = new tTextDlg(pEvent->IsText(), pPianoWindow, pTrack);
+ {
+ JZTextDialog SysexDialog(pEvent->IsText(), pTrack, pPianoWindow);
+ SysexDialog.ShowModal();
+ }
break;
-
default:
break;
}
Modified: trunk/jazz/src/Events.h
===================================================================
--- trunk/jazz/src/Events.h 2010-04-26 02:08:50 UTC (rev 757)
+++ trunk/jazz/src/Events.h 2010-04-26 03:44:22 UTC (rev 758)
@@ -1317,6 +1317,16 @@
{
return mpData;
}
+
+ void SetText(const char* pText)
+ {
+ if (pText && strlen(pText) > 0)
+ {
+ delete [] mpData;
+ mpData = new unsigned char[strlen(pText)];
+ memcpy(mpData, pText, strlen(pText));
+ }
+ }
};
//*****************************************************************************
Modified: trunk/jazz/src/Makefile.am
===================================================================
--- trunk/jazz/src/Makefile.am 2010-04-26 02:08:50 UTC (rev 757)
+++ trunk/jazz/src/Makefile.am 2010-04-26 03:44:22 UTC (rev 758)
@@ -25,6 +25,7 @@
Dialogs/CleanupDialog.cpp \
Dialogs/ControllerDialog.cpp \
Dialogs/DeleteDialog.cpp \
+Dialogs/EndOfTrackDialog.cpp \
Dialogs/FilterDialog.cpp \
Dialogs/IntegerEdit.cpp \
Dialogs/LengthDialog.cpp \
@@ -40,6 +41,7 @@
Dialogs/SnapDialog.cpp \
Dialogs/SynthesizerSettingsDialog.cpp \
Dialogs/SysexDialog.cpp \
+Dialogs/TextDialog.cpp \
Dialogs/TrackDialog.cpp \
Dialogs/TransposeDialog.cpp \
Dialogs/VelocityDialog.cpp \
@@ -118,6 +120,7 @@
Dialogs/CleanupDialog.cpp \
Dialogs/ControllerDialog.cpp \
Dialogs/DeleteDialog.cpp \
+Dialogs/EndOfTrackDialog.cpp \
Dialogs/FilterDialog.cpp \
Dialogs/IntegerEdit.cpp \
Dialogs/LengthDialog.cpp \
@@ -133,6 +136,7 @@
Dialogs/SnapDialog.cpp \
Dialogs/SynthesizerSettingsDialog.cpp \
Dialogs/SysexDialog.cpp \
+Dialogs/TextDialog.cpp \
Dialogs/TrackDialog.cpp \
Dialogs/TransposeDialog.cpp \
Dialogs/VelocityDialog.cpp \
@@ -216,6 +220,7 @@
Dialogs/CleanupDialog.h \
Dialogs/ControllerDialog.h \
Dialogs/DeleteDialog.h \
+Dialogs/EndOfTrackDialog.h \
Dialogs/FilterDialog.h \
Dialogs/IntegerEdit.h \
Dialogs/LengthDialog.h \
@@ -231,6 +236,7 @@
Dialogs/SnapDialog.h \
Dialogs/SynthesizerSettingsDialog.h \
Dialogs/SysexDialog.h \
+Dialogs/TextDialog.h \
Dialogs/TrackDialog.h \
Dialogs/TransposeDialog.h \
Dialogs/VelocityDialog.h \
Modified: trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj
===================================================================
--- trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj 2010-04-26 02:08:50 UTC (rev 757)
+++ trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj 2010-04-26 03:44:22 UTC (rev 758)
@@ -871,6 +871,14 @@
>
</File>
<File
+ RelativePath="..\src\Dialogs\EndOfTrackDialog.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\src\Dialogs\EndOfTrackDialog.h"
+ >
+ </File>
+ <File
RelativePath="..\src\Dialogs\FilterDialog.cpp"
>
</File>
@@ -991,6 +999,14 @@
>
</File>
<File
+ RelativePath="..\src\Dialogs\TextDialog.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\src\Dialogs\TextDialog.h"
+ >
+ </File>
+ <File
RelativePath="..\src\Dialogs\TrackDialog.cpp"
>
</File>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|