You can subscribe to this list here.
| 2008 |
Jan
|
Feb
|
Mar
(58) |
Apr
(100) |
May
(92) |
Jun
(12) |
Jul
|
Aug
|
Sep
(5) |
Oct
(1) |
Nov
(26) |
Dec
(29) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2009 |
Jan
(31) |
Feb
(20) |
Mar
(1) |
Apr
|
May
(5) |
Jun
(10) |
Jul
|
Aug
(2) |
Sep
|
Oct
(2) |
Nov
|
Dec
(1) |
| 2010 |
Jan
(1) |
Feb
(1) |
Mar
|
Apr
(36) |
May
(10) |
Jun
|
Jul
(38) |
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
|
| 2011 |
Jan
|
Feb
(6) |
Mar
(8) |
Apr
|
May
|
Jun
|
Jul
(14) |
Aug
(56) |
Sep
|
Oct
|
Nov
|
Dec
|
| 2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(13) |
Dec
(2) |
| 2013 |
Jan
(30) |
Feb
|
Mar
(43) |
Apr
(28) |
May
|
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
(10) |
Nov
(2) |
Dec
|
| 2014 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <pst...@us...> - 2010-04-27 14:15:14
|
Revision: 768
http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=768&view=rev
Author: pstieber
Date: 2010-04-27 14:15:09 +0000 (Tue, 27 Apr 2010)
Log Message:
-----------
Removed the clock dialog from the builds.
Modified Paths:
--------------
trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj
Modified: trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj
===================================================================
--- trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj 2010-04-27 14:07:18 UTC (rev 767)
+++ trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj 2010-04-27 14:15:09 UTC (rev 768)
@@ -249,10 +249,42 @@
<File
RelativePath="..\src\ClockDialog.cpp"
>
+ <FileConfiguration
+ Name="Debug GUI VC9|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release GUI VC9|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
</File>
<File
RelativePath="..\src\ClockDialog.h"
>
+ <FileConfiguration
+ Name="Debug GUI VC9|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release GUI VC9|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
</File>
<File
RelativePath="..\src\Command.cpp"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pst...@us...> - 2010-04-27 14:07:25
|
Revision: 767
http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=767&view=rev
Author: pstieber
Date: 2010-04-27 14:07:18 +0000 (Tue, 27 Apr 2010)
Log Message:
-----------
Used #if 0 to removed the sequence length and MIDI delay dialogs.
This allowed the removal of the DeprecatedWx/proplist.h include file :-)
Modified Paths:
--------------
trunk/jazz/src/Dialogs.cpp
Modified: trunk/jazz/src/Dialogs.cpp
===================================================================
--- trunk/jazz/src/Dialogs.cpp 2010-04-27 14:02:36 UTC (rev 766)
+++ trunk/jazz/src/Dialogs.cpp 2010-04-27 14:07:18 UTC (rev 767)
@@ -24,7 +24,9 @@
#include "ClockDialog.h"
#include "Command.h"
+#if 0
#include "DeprecatedWx/proplist.h"
+#endif
#include "Dialogs/ControllerDialog.h"
#include "Dialogs/EndOfTrackDialog.h"
#include "Dialogs/KeyOnDialog.h"
@@ -149,6 +151,7 @@
+#if 0
//*****************************************************************************
// seqLength
//*****************************************************************************
@@ -251,9 +254,9 @@
//System 3:
}
+#endif
-
//*****************************************************************************
// Event-Dialog
//*****************************************************************************
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pst...@us...> - 2010-04-27 14:02:42
|
Revision: 766
http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=766&view=rev
Author: pstieber
Date: 2010-04-27 14:02:36 +0000 (Tue, 27 Apr 2010)
Log Message:
-----------
Commented out the play track dialog and the event dialog.
Modified Paths:
--------------
trunk/jazz/src/Dialogs.cpp
Modified: trunk/jazz/src/Dialogs.cpp
===================================================================
--- trunk/jazz/src/Dialogs.cpp 2010-04-27 13:54:59 UTC (rev 765)
+++ trunk/jazz/src/Dialogs.cpp 2010-04-27 14:02:36 UTC (rev 766)
@@ -255,126 +255,122 @@
//*****************************************************************************
-// Event-Dialogue
+// Event-Dialog
//*****************************************************************************
+//class tEventDlg : public tPropertyListDlg
+//{
+// public:
+//
+// JZTrack *Track;
+// JZClockDialog ClockDlg;
+// JZPianoWindow* Win;
+//
+// JZEvent *Event;
+// JZEvent *Copy;
+//
+// tEventDlg(JZEvent *e, JZPianoWindow* w, JZTrack *pTrack);
+// virtual void AddProperties();
+// virtual bool OnClose();
+// virtual void OnHelp();
+// virtual void OnCancel();
+//};
-class tEventDlg : public tPropertyListDlg
-{
- public:
+//tEventDlg::tEventDlg(JZEvent *e, JZPianoWindow* w, JZTrack *pTrack)
+// : tPropertyListDlg( "Event" ),
+// ClockDlg(w->GetProject(), "Time ", e->GetClock())
+//{
+// Win = w;
+// Track = pTrack;
+// Event = e;
+// Copy = e->Copy();
+//}
- JZTrack *Track;
- JZClockDialog ClockDlg;
- JZPianoWindow* Win;
+//void tEventDlg::AddProperties()
+//{
+// sheet->AddProperty(ClockDlg.mkProperty());
+//}
- JZEvent *Event;
- JZEvent *Copy;
+//void tEventDlg::OnCancel()
+//{
+// delete Copy;
+// //tPropertyListDlg::OnCancel();
+//}
- tEventDlg(JZEvent *e, JZPianoWindow* w, JZTrack *pTrack);
- virtual void AddProperties();
- virtual bool OnClose();
- virtual void OnHelp();
- virtual void OnCancel();
-};
+//bool tEventDlg::OnClose()
+//{
+// Copy->SetClock(ClockDlg.GetClock());
+// Track->Kill(Event);
+// Track->Put(Copy);
+// Track->Cleanup();
+// Win->Refresh();
+// return tPropertyListDlg::OnClose();
+//}
+//void tEventDlg::OnHelp()
+//{
+// gpHelpInstance->ShowTopic("Piano Window");
+//}
-tEventDlg::tEventDlg(JZEvent *e, JZPianoWindow* w, JZTrack *pTrack)
- : tPropertyListDlg( "Event" ),
- ClockDlg(w->GetProject(), "Time ", e->GetClock())
-{
- Win = w;
- Track = pTrack;
- Event = e;
- Copy = e->Copy();
-}
-
-void tEventDlg::AddProperties()
-{
- sheet->AddProperty(ClockDlg.mkProperty());
-}
-
-void tEventDlg::OnCancel()
-{
- delete Copy;
- //tPropertyListDlg::OnCancel();
-}
-
-bool tEventDlg::OnClose()
-{
- Copy->SetClock(ClockDlg.GetClock());
- Track->Kill(Event);
- Track->Put(Copy);
- Track->Cleanup();
- Win->Refresh();
- return tPropertyListDlg::OnClose();
-}
-
-void tEventDlg::OnHelp()
-{
- gpHelpInstance->ShowTopic("Piano Window");
-}
-
// -------------------------------- Play track ---------------------------
-class tPlayTrackDlg : public tEventDlg
-{
- public:
+//class tPlayTrackDlg : public tEventDlg
+//{
+// public:
+//
+// int transpose;
+// int track;
+// int eventlength;
+//
+// tNamedChoice Choice;
+//
+// tPlayTrackDlg(JZPlayTrackEvent *e, JZPianoWindow* w, JZTrack *pTrack);
+//
+// void AddProperties();
+// bool OnClose();
+//};
- int transpose;
- int track;
- int eventlength;
+//tPlayTrackDlg::tPlayTrackDlg(JZPlayTrackEvent *e, JZPianoWindow* w, JZTrack *pTrack)
+// : tEventDlg(e, w, pTrack),
+// Choice("playtrack", gpConfig->GetControlNames(), &track)
+//{
+// Event = e;
+// track = e->track;
+// transpose=e->transpose;
+// eventlength=e->eventlength;
+//}
- tNamedChoice Choice;
+//bool tPlayTrackDlg::OnClose()
+//{
+// JZPlayTrackEvent* p=(JZPlayTrackEvent*)Copy;
+//
+// Choice.GetValue();
+// p->track = track;
+// p->transpose = transpose;
+// p->eventlength = eventlength;
+// return tEventDlg::OnClose();
+//}
- tPlayTrackDlg(JZPlayTrackEvent *e, JZPianoWindow* w, JZTrack *pTrack);
+//void tPlayTrackDlg::AddProperties()
+//{
+// sheet->AddProperty(new wxProperty(
+// "Track",
+// wxPropertyValue(&track),
+// "integer",
+// new wxIntegerListValidator(0, 127)));
+// sheet->AddProperty(new wxProperty(
+// "Transpose",
+// wxPropertyValue(&transpose),
+// "integer",
+// new wxIntegerListValidator(-127, 127)));
+// sheet->AddProperty(new wxProperty(
+// "Length",
+// wxPropertyValue(&eventlength),
+// "integer",
+// new wxIntegerListValidator(0, 127)));
+// tEventDlg::AddProperties();
+//}
- void AddProperties();
- bool OnClose();
-};
-
-tPlayTrackDlg::tPlayTrackDlg(JZPlayTrackEvent *e, JZPianoWindow* w, JZTrack *pTrack)
- : tEventDlg(e, w, pTrack),
- Choice("playtrack", gpConfig->GetControlNames(), &track)
-{
- Event = e;
- track = e->track;
- transpose=e->transpose;
- eventlength=e->eventlength;
-}
-
-
-bool tPlayTrackDlg::OnClose()
-{
- JZPlayTrackEvent* p=(JZPlayTrackEvent*)Copy;
-
- Choice.GetValue();
- p->track = track;
- p->transpose = transpose;
- p->eventlength = eventlength;
- return tEventDlg::OnClose();
-}
-
-void tPlayTrackDlg::AddProperties()
-{
- sheet->AddProperty(new wxProperty(
- "Track",
- wxPropertyValue(&track),
- "integer",
- new wxIntegerListValidator(0, 127)));
- sheet->AddProperty(new wxProperty(
- "Transpose",
- wxPropertyValue(&transpose),
- "integer",
- new wxIntegerListValidator(-127, 127)));
- sheet->AddProperty(new wxProperty(
- "Length",
- wxPropertyValue(&eventlength),
- "integer",
- new wxIntegerListValidator(0, 127)));
- tEventDlg::AddProperties();
-}
-
-
//*****************************************************************************
// Description:
// Display a dialog box to select an event to be created.
@@ -471,8 +467,8 @@
return;
}
- tEventDlg* pDialog = 0;
- const char* str = 0;
+// tEventDlg* pDialog = 0;
+// const char* str = 0;
switch (pEvent->GetStat())
{
case StatKeyOn:
@@ -539,8 +535,8 @@
break;
case StatPlayTrack:
- str = "Play Track";
- pDialog = new tPlayTrackDlg(pEvent->IsPlayTrack(), pPianoWindow, pTrack);
+// str = "Play Track";
+// pDialog = new tPlayTrackDlg(pEvent->IsPlayTrack(), pPianoWindow, pTrack);
break;
case StatEndOfTrack:
@@ -564,8 +560,8 @@
break;
}
- if (pDialog)
- {
- pDialog->Create();
- }
+// if (pDialog)
+// {
+// pDialog->Create();
+// }
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pst...@us...> - 2010-04-27 13:55:05
|
Revision: 765
http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=765&view=rev
Author: pstieber
Date: 2010-04-27 13:54:59 +0000 (Tue, 27 Apr 2010)
Log Message:
-----------
Removed the old channel event dialog. This dialog added a channel (1-16) select control
to the event dialog.
Modified Paths:
--------------
trunk/jazz/src/Dialogs.cpp
Modified: trunk/jazz/src/Dialogs.cpp
===================================================================
--- trunk/jazz/src/Dialogs.cpp 2010-04-27 03:39:37 UTC (rev 764)
+++ trunk/jazz/src/Dialogs.cpp 2010-04-27 13:54:59 UTC (rev 765)
@@ -313,42 +313,6 @@
gpHelpInstance->ShowTopic("Piano Window");
}
-// --------------------------- ChannelEvent ----------------------------
-
-
-class tChEventDlg : public tEventDlg
-{
- public:
-
- int Channel;
-
- tChEventDlg(JZChannelEvent* pChannelEvent, JZPianoWindow* w, JZTrack *pTrack)
- : tEventDlg(pChannelEvent, w, pTrack)
- {
- Channel = pChannelEvent->GetChannel() + 1; // 1..16
- }
- void AddProperties();
- bool OnClose();
-};
-
-void tChEventDlg::AddProperties()
-{
- sheet->AddProperty(new wxProperty(
- "Channel",
- wxPropertyValue(&Channel),
- "integer",
- new wxIntegerListValidator(1, 16)));
- tEventDlg::AddProperties();
-}
-
-
-bool tChEventDlg::OnClose()
-{
- ((JZChannelEvent *)Copy)->SetChannel(Channel - 1);
- tEventDlg::OnClose();
- return false;
-}
-
// -------------------------------- Play track ---------------------------
class tPlayTrackDlg : public tEventDlg
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pst...@us...> - 2010-04-27 03:39:43
|
Revision: 764
http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=764&view=rev
Author: pstieber
Date: 2010-04-27 03:39:37 +0000 (Tue, 27 Apr 2010)
Log Message:
-----------
1. Added a track pointer to the key on dialog constructor argument list.
2. Replaced the old pitch wheel dialog with a new empty version.
3. Simplified logic in JZSysExEvent::GetPitch().
Modified Paths:
--------------
trunk/jazz/src/Dialogs/KeyOnDialog.cpp
trunk/jazz/src/Dialogs/KeyOnDialog.h
trunk/jazz/src/Dialogs.cpp
trunk/jazz/src/Events.cpp
trunk/jazz/src/Makefile.am
trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj
Added Paths:
-----------
trunk/jazz/src/Dialogs/PitchWheelDialog.cpp
trunk/jazz/src/Dialogs/PitchWheelDialog.h
Modified: trunk/jazz/src/Dialogs/KeyOnDialog.cpp
===================================================================
--- trunk/jazz/src/Dialogs/KeyOnDialog.cpp 2010-04-27 03:37:28 UTC (rev 763)
+++ trunk/jazz/src/Dialogs/KeyOnDialog.cpp 2010-04-27 03:39:37 UTC (rev 764)
@@ -54,7 +54,10 @@
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-JZKeyOnDialog::JZKeyOnDialog(JZKeyOnEvent* pEvent, wxWindow* pParent)
+JZKeyOnDialog::JZKeyOnDialog(
+ JZKeyOnEvent* pEvent,
+ JZTrack* pTrack,
+ wxWindow* pParent)
: wxDialog(pParent, wxID_ANY, wxString("Key On")),
mpEvent(pEvent),
mpPitchEdit(0),
Modified: trunk/jazz/src/Dialogs/KeyOnDialog.h
===================================================================
--- trunk/jazz/src/Dialogs/KeyOnDialog.h 2010-04-27 03:37:28 UTC (rev 763)
+++ trunk/jazz/src/Dialogs/KeyOnDialog.h 2010-04-27 03:39:37 UTC (rev 764)
@@ -26,6 +26,7 @@
class JZKnob;
class JZKnobEvent;
class JZKeyOnEvent;
+class JZTrack;
class wxStaticText;
class wxTextCtrl;
@@ -35,7 +36,7 @@
{
public:
- JZKeyOnDialog(JZKeyOnEvent* pEvent, wxWindow* pParent);
+ JZKeyOnDialog(JZKeyOnEvent* pEvent, JZTrack* pTrack, wxWindow* pParent);
private:
Added: trunk/jazz/src/Dialogs/PitchWheelDialog.cpp
===================================================================
--- trunk/jazz/src/Dialogs/PitchWheelDialog.cpp (rev 0)
+++ trunk/jazz/src/Dialogs/PitchWheelDialog.cpp 2010-04-27 03:39:37 UTC (rev 764)
@@ -0,0 +1,87 @@
+//*****************************************************************************
+// 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 "PitchWheelDialog.h"
+
+#include "../Globals.h"
+#include "../Help.h"
+
+#include <wx/button.h>
+#include <wx/sizer.h>
+
+//*****************************************************************************
+//*****************************************************************************
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+BEGIN_EVENT_TABLE(JZPitchWheelDialog, wxDialog)
+
+ EVT_BUTTON(wxID_HELP, JZPitchWheelDialog::OnHelp)
+
+END_EVENT_TABLE()
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+JZPitchWheelDialog::JZPitchWheelDialog(
+ JZPitchEvent* pPitchEvent,
+ JZTrack* pTrack,
+ wxWindow * pParent)
+ : wxDialog(pParent, wxID_ANY, wxString("Pitch Wheel"))
+{
+ 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);
+
+ 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 JZPitchWheelDialog::TransferDataToWindow()
+{
+ return true;
+}
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+bool JZPitchWheelDialog::TransferDataFromWindow()
+{
+ return true;
+}
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+void JZPitchWheelDialog::OnHelp(wxCommandEvent& Event)
+{
+ gpHelpInstance->ShowTopic("Pitch Wheel Dialog");
+}
Property changes on: trunk/jazz/src/Dialogs/PitchWheelDialog.cpp
___________________________________________________________________
Added: svn:eol-style
+ native
Added: trunk/jazz/src/Dialogs/PitchWheelDialog.h
===================================================================
--- trunk/jazz/src/Dialogs/PitchWheelDialog.h (rev 0)
+++ trunk/jazz/src/Dialogs/PitchWheelDialog.h 2010-04-27 03:39:37 UTC (rev 764)
@@ -0,0 +1,53 @@
+//*****************************************************************************
+// 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_PITCHWHEELDIALOG_H
+#define JZ_PITCHWHEELDIALOG_H
+
+class JZPitchEvent;
+class JZTrack;
+
+#include <wx/dialog.h>
+
+//*****************************************************************************
+//*****************************************************************************
+class JZPitchWheelDialog : public wxDialog
+{
+ public:
+
+ JZPitchWheelDialog(
+ JZPitchEvent* pPitchEvent,
+ JZTrack* pTrack,
+ wxWindow* pParent);
+
+ private:
+
+ virtual bool TransferDataToWindow();
+
+ virtual bool TransferDataFromWindow();
+
+ void OnHelp(wxCommandEvent& Event);
+
+ private:
+
+ DECLARE_EVENT_TABLE();
+};
+
+#endif // !defined(JZ_PITCHWHEELDIALOG_H)
Property changes on: trunk/jazz/src/Dialogs/PitchWheelDialog.h
___________________________________________________________________
Added: svn:eol-style
+ native
Modified: trunk/jazz/src/Dialogs.cpp
===================================================================
--- trunk/jazz/src/Dialogs.cpp 2010-04-27 03:37:28 UTC (rev 763)
+++ trunk/jazz/src/Dialogs.cpp 2010-04-27 03:39:37 UTC (rev 764)
@@ -28,6 +28,7 @@
#include "Dialogs/ControllerDialog.h"
#include "Dialogs/EndOfTrackDialog.h"
#include "Dialogs/KeyOnDialog.h"
+#include "Dialogs/PitchWheelDialog.h"
#include "Dialogs/ProgramChangeDialog.h"
#include "Dialogs/SetTempoDialog.h"
#include "Dialogs/SysexDialog.h"
@@ -348,46 +349,6 @@
return false;
}
-// -------------------------------- Pitch -------------------------------
-
-class tPitchDlg : public tChEventDlg
-{
- public:
-
- int Value;
-
- tPitchDlg(JZPitchEvent* e, JZPianoWindow* w, JZTrack *pTrack);
-
- void AddProperties();
- bool OnClose();
-};
-
-
-tPitchDlg::tPitchDlg(JZPitchEvent *e, JZPianoWindow* w, JZTrack *pTrack)
- : tChEventDlg(e, w, pTrack)
-{
- Event = e;
- Value = e->Value;
-}
-
-
-bool tPitchDlg::OnClose()
-{
- ((JZPitchEvent *)Copy)->Value = Value;
- return tChEventDlg::OnClose();
-}
-
-void tPitchDlg::AddProperties()
-{
- sheet->AddProperty(new wxProperty(
- "Pitch:",
- wxPropertyValue(&Value),
- "integer",
- new wxIntegerListValidator(-8191, 8191)));
-
- tChEventDlg::AddProperties();
-}
-
// -------------------------------- Play track ---------------------------
class tPlayTrackDlg : public tEventDlg
@@ -560,16 +521,20 @@
break;
}
-// pDialog = new tKeyOnDlg(pEvent->IsKeyOn(), pPianoWindow, pTrack);
{
- JZKeyOnDialog KeyOnDialog(pEvent->IsKeyOn(), pPianoWindow);
+ JZKeyOnDialog KeyOnDialog(pEvent->IsKeyOn(), pTrack, pPianoWindow);
KeyOnDialog.ShowModal();
}
break;
case StatPitch:
- str = "Pitch Wheel";
- pDialog = new tPitchDlg(pEvent->IsPitch(), pPianoWindow, pTrack);
+ {
+ JZPitchWheelDialog PitchWheelDialog(
+ pEvent->IsPitch(),
+ pTrack,
+ pPianoWindow);
+ PitchWheelDialog.ShowModal();
+ }
break;
case StatControl:
Modified: trunk/jazz/src/Events.cpp
===================================================================
--- trunk/jazz/src/Events.cpp 2010-04-27 03:37:28 UTC (rev 763)
+++ trunk/jazz/src/Events.cpp 2010-04-27 03:39:37 UTC (rev 764)
@@ -222,8 +222,5 @@
{
return SX_GROUP_XG;
}
- else
- {
- return SX_GROUP_UNKNOWN;
- }
+ return SX_GROUP_UNKNOWN;
}
Modified: trunk/jazz/src/Makefile.am
===================================================================
--- trunk/jazz/src/Makefile.am 2010-04-27 03:37:28 UTC (rev 763)
+++ trunk/jazz/src/Makefile.am 2010-04-27 03:39:37 UTC (rev 764)
@@ -33,6 +33,7 @@
Dialogs/MeterChangeDialog.cpp \
Dialogs/MetronomeSettingsDialog.cpp \
Dialogs/MidiChannelDialog.cpp \
+Dialogs/PitchWheelDialog.cpp \
Dialogs/ProgramChangeDialog.cpp \
Dialogs/QuantizeDialog.cpp \
Dialogs/SearchAndReplaceDialog.cpp \
@@ -128,6 +129,7 @@
Dialogs/MeterChangeDialog.cpp \
Dialogs/MetronomeSettingsDialog.cpp \
Dialogs/MidiChannelDialog.cpp \
+Dialogs/PitchWheelDialog.cpp \
Dialogs/ProgramChangeDialog.cpp \
Dialogs/QuantizeDialog.cpp \
Dialogs/SearchAndReplaceDialog.cpp \
@@ -228,6 +230,7 @@
Dialogs/MeterChangeDialog.h \
Dialogs/MetronomeSettingsDialog.h \
Dialogs/MidiChannelDialog.h \
+Dialogs/PitchWheelDialog.h \
Dialogs/ProgramChangeDialog.h \
Dialogs/QuantizeDialog.h \
Dialogs/SearchAndReplaceDialog.h \
Modified: trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj
===================================================================
--- trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj 2010-04-27 03:37:28 UTC (rev 763)
+++ trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj 2010-04-27 03:39:37 UTC (rev 764)
@@ -935,6 +935,14 @@
>
</File>
<File
+ RelativePath="..\src\Dialogs\PitchWheelDialog.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\src\Dialogs\PitchWheelDialog.h"
+ >
+ </File>
+ <File
RelativePath="..\src\Dialogs\ProgramChangeDialog.cpp"
>
</File>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pst...@us...> - 2010-04-27 03:37:38
|
Revision: 763
http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=763&view=rev
Author: pstieber
Date: 2010-04-27 03:37:28 +0000 (Tue, 27 Apr 2010)
Log Message:
-----------
Made the pitch wheel available and bumped up the version to 4.1.4.
Modified Paths:
--------------
branches/jazz-4.1.3/src/about.h
branches/jazz-4.1.3/src/dialogs.cpp
branches/jazz-4.1.3/src/jazz.cpp
Modified: branches/jazz-4.1.3/src/about.h
===================================================================
--- branches/jazz-4.1.3/src/about.h 2010-04-26 23:25:19 UTC (rev 762)
+++ branches/jazz-4.1.3/src/about.h 2010-04-27 03:37:28 UTC (rev 763)
@@ -19,7 +19,7 @@
**
*/
-#define JAZZ_VERSION "4.1.3"
+#define JAZZ_VERSION "4.1.4"
#define JAZZ_FULL_VERSION JAZZ_VERSION " (" __DATE__ " " __TIME__ ")"
Modified: branches/jazz-4.1.3/src/dialogs.cpp
===================================================================
--- branches/jazz-4.1.3/src/dialogs.cpp 2010-04-26 23:25:19 UTC (rev 762)
+++ branches/jazz-4.1.3/src/dialogs.cpp 2010-04-27 03:37:28 UTC (rev 763)
@@ -1018,11 +1018,25 @@
static tEvent *CreateEventDialog(long Clock, int Channel, int Pitch)
{
static char *Names[] =
- // { "Note On", "Pitch", "Controller", "Program Change", (char *)0 };
- { "Note On", "Controller", "Program Change", "Set Tempo", "SysEx", (char *)0 };
+ {
+ "Note On",
+ "Pitch",
+ "Controller",
+ "Program Change",
+ "Set Tempo",
+ "SysEx",
+ (char *)0
+ };
static long Values[] =
- // { StatKeyOn, StatPitch, StatControl, StatProgram, -1 };
- { StatKeyOn, StatControl, StatProgram, StatSetTempo, StatSysEx, -1 };
+ {
+ StatKeyOn,
+ StatPitch,
+ StatControl,
+ StatProgram,
+ StatSetTempo,
+ StatSysEx,
+ -1
+ };
tEvent *e = 0;
int i = wxGetSingleChoiceIndex("Select event to create", "Create Event", 5, Names);
if (i >= 0)
Modified: branches/jazz-4.1.3/src/jazz.cpp
===================================================================
--- branches/jazz-4.1.3/src/jazz.cpp 2010-04-26 23:25:19 UTC (rev 762)
+++ branches/jazz-4.1.3/src/jazz.cpp 2010-04-27 03:37:28 UTC (rev 763)
@@ -684,7 +684,7 @@
return Buffer;
}
- sprintf(Buffer, "/Jazz++/4.1.3/conf/%s", fname);
+ sprintf(Buffer, "/Jazz++/4.1.4/conf/%s", fname);
if (wxFileExists(Buffer))
{
return Buffer;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pst...@us...> - 2010-04-26 23:25:25
|
Revision: 762
http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=762&view=rev
Author: pstieber
Date: 2010-04-26 23:25:19 +0000 (Mon, 26 Apr 2010)
Log Message:
-----------
1. Changed mStat to mStatusByte and changed constructor argument version to be clearer.
2. Changed cha to Channel in the ASCII I/O code.
Modified Paths:
--------------
trunk/jazz/src/AsciiMidiFile.cpp
trunk/jazz/src/Events.h
Modified: trunk/jazz/src/AsciiMidiFile.cpp
===================================================================
--- trunk/jazz/src/AsciiMidiFile.cpp 2010-04-26 17:22:22 UTC (rev 761)
+++ trunk/jazz/src/AsciiMidiFile.cpp 2010-04-26 23:25:19 UTC (rev 762)
@@ -47,8 +47,15 @@
JZEvent* pEvent = 0;
long Clock;
- int sta, cha, Length;
- if (fscanf(mpFd, "%6lu %02x %2d %d ", &Clock, &sta, &cha, &Length) != 4)
+ int StatusByte, Channel, Length;
+ if (
+ fscanf(
+ mpFd,
+ "%6lu %02x %2d %d ",
+ &Clock,
+ &StatusByte,
+ &Channel,
+ &Length) != 4)
{
return pEvent;
}
@@ -61,29 +68,29 @@
pBuffer[i] = (unsigned char)d;
}
- switch (sta)
+ switch (StatusByte)
{
case StatUnknown:
break;
case StatKeyOff:
- pEvent = new JZKeyOffEvent(Clock, cha, pBuffer[0]);
+ pEvent = new JZKeyOffEvent(Clock, Channel, pBuffer[0]);
break;
case StatKeyOn:
- pEvent = new JZKeyOnEvent(Clock, cha, pBuffer[0], pBuffer[1]);
+ pEvent = new JZKeyOnEvent(Clock, Channel, pBuffer[0], pBuffer[1]);
break;
case StatControl:
- pEvent = new JZControlEvent(Clock, cha, pBuffer[0], pBuffer[1]);
+ pEvent = new JZControlEvent(Clock, Channel, pBuffer[0], pBuffer[1]);
break;
case StatPitch:
- pEvent = new JZPitchEvent(Clock, cha, pBuffer[0], pBuffer[1]);
+ pEvent = new JZPitchEvent(Clock, Channel, pBuffer[0], pBuffer[1]);
break;
case StatProgram:
- pEvent = new JZProgramEvent(Clock, cha, pBuffer[0]);
+ pEvent = new JZProgramEvent(Clock, Channel, pBuffer[0]);
break;
case StatText:
Modified: trunk/jazz/src/Events.h
===================================================================
--- trunk/jazz/src/Events.h 2010-04-26 17:22:22 UTC (rev 761)
+++ trunk/jazz/src/Events.h 2010-04-26 23:25:19 UTC (rev 762)
@@ -317,7 +317,7 @@
unsigned char GetStat() const
{
- return mStat;
+ return mStatusByte;
}
int GetClock() const
@@ -337,8 +337,8 @@
BROADCAST_DEVICE = 0
};
- JZEvent(int Clock, unsigned char Stat)
- : mStat(Stat),
+ JZEvent(int Clock, unsigned char StatusByte)
+ : mStatusByte(StatusByte),
mClock(Clock),
mDevice(BROADCAST_DEVICE)
{
@@ -469,7 +469,7 @@
protected:
- unsigned char mStat;
+ unsigned char mStatusByte;
int mClock;
@@ -484,8 +484,8 @@
{
public:
- JZChannelEvent(int Clock, unsigned char sta, int Channel)
- : JZEvent(Clock, sta)
+ JZChannelEvent(int Clock, unsigned char StatusByte, int Channel)
+ : JZEvent(Clock, StatusByte)
{
mChannel = Channel;
}
@@ -909,10 +909,10 @@
JZMetaEvent(
int Clock,
- unsigned char sta,
+ unsigned char StatusByte,
unsigned char* pData,
unsigned short Length)
- : JZEvent(Clock, sta),
+ : JZEvent(Clock, StatusByte),
mpData(0),
mLength(Length)
{
@@ -941,7 +941,7 @@
virtual JZEvent* Copy() const
{
- return new JZMetaEvent(mClock, mStat, mpData, mLength);
+ return new JZMetaEvent(mClock, mStatusByte, mpData, mLength);
}
const unsigned char* GetData() const
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pst...@us...> - 2010-04-26 17:22:28
|
Revision: 761
http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=761&view=rev
Author: pstieber
Date: 2010-04-26 17:22:22 +0000 (Mon, 26 Apr 2010)
Log Message:
-----------
Updated the naming convention for JZGetMidiBytes data members.
Modified Paths:
--------------
trunk/jazz/src/Events.cpp
trunk/jazz/src/Events.h
trunk/jazz/src/Player.cpp
Modified: trunk/jazz/src/Events.cpp
===================================================================
--- trunk/jazz/src/Events.cpp 2010-04-26 17:06:32 UTC (rev 760)
+++ trunk/jazz/src/Events.cpp 2010-04-26 17:22:22 UTC (rev 761)
@@ -167,12 +167,12 @@
case StatProgram:
case StatChnPressure:
case StatPitch:
- nBytes = 0;
+ mByteCount = 0;
- Buffer[nBytes++] = Stat | ((JZChannelEvent *)pEvent)->GetChannel();
+ mBuffer[mByteCount++] = Stat | ((JZChannelEvent *)pEvent)->GetChannel();
while (Length--)
{
- Buffer[nBytes++] = *pData++;
+ mBuffer[mByteCount++] = *pData++;
}
return 0;
Modified: trunk/jazz/src/Events.h
===================================================================
--- trunk/jazz/src/Events.h 2010-04-26 17:06:32 UTC (rev 760)
+++ trunk/jazz/src/Events.h 2010-04-26 17:22:22 UTC (rev 761)
@@ -229,8 +229,8 @@
// Get JZEvent's bytes.
int Write(JZEvent* pEvent, unsigned char* pString, int Length);
- unsigned char Buffer[10];
- int nBytes;
+ unsigned char mBuffer[10];
+ int mByteCount;
};
// ********************************************************************
Modified: trunk/jazz/src/Player.cpp
===================================================================
--- trunk/jazz/src/Player.cpp 2010-04-26 17:06:32 UTC (rev 760)
+++ trunk/jazz/src/Player.cpp 2010-04-26 17:22:22 UTC (rev 761)
@@ -941,7 +941,7 @@
JZChannelEvent *c;
pEvent->Write(midi);
- Stat = midi.Buffer[0]; // Status + Channel
+ Stat = midi.mBuffer[0]; // Status + Channel
OutBreak(pEvent->GetClock());
@@ -995,7 +995,7 @@
if (Stat != TrackRunningStatus[ActiveTrack])
{
- PlyBytes.Put(TRK + midi.nBytes + 1 + 1);
+ PlyBytes.Put(TRK + midi.mByteCount + 1 + 1);
PlyBytes.Put(ActiveTrack);
PlyBytes.Put(Time);
PlyBytes.Put(Stat);
@@ -1003,12 +1003,12 @@
}
else
{
- PlyBytes.Put(TRK + midi.nBytes + 1);
+ PlyBytes.Put(TRK + midi.mByteCount + 1);
PlyBytes.Put(ActiveTrack);
PlyBytes.Put(Time);
}
- for (i = 1; i < midi.nBytes; i++)
- PlyBytes.Put(midi.Buffer[i]);
+ for (i = 1; i < midi.mByteCount; i++)
+ PlyBytes.Put(midi.mBuffer[i]);
TrackClock[ActiveTrack] = pEvent->GetClock();
return 0;
@@ -1078,13 +1078,13 @@
JZGetMidiBytes midi;
if (pEvent->Write(midi) == 0)
{
- char* buf = new char[midi.nBytes + 3];
+ char* buf = new char[midi.mByteCount + 3];
buf[n++] = CMD+1;
buf[n++] = 0xd7;
- buf[n++] = DAT+midi.nBytes;
- for (i = 0; i < midi.nBytes; i++)
+ buf[n++] = DAT + midi.mByteCount;
+ for (i = 0; i < midi.mByteCount; i++)
{
- buf[n++] = midi.Buffer[i];
+ buf[n++] = midi.mBuffer[i];
}
write_noack_mpu(buf, n);
delete[] buf;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pst...@us...> - 2010-04-26 17:06:39
|
Revision: 760
http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=760&view=rev
Author: pstieber
Date: 2010-04-26 17:06:32 +0000 (Mon, 26 Apr 2010)
Log Message:
-----------
1. Removed old MIDI event debugging code.
2. Updated some comments.
Modified Paths:
--------------
trunk/jazz/src/Events.cpp
trunk/jazz/src/Events.h
trunk/jazz/src/Track.cpp
Modified: trunk/jazz/src/Events.cpp
===================================================================
--- trunk/jazz/src/Events.cpp 2010-04-26 14:35:58 UTC (rev 759)
+++ trunk/jazz/src/Events.cpp 2010-04-26 17:06:32 UTC (rev 760)
@@ -3,7 +3,7 @@
//
// Copyright (C) 1994-2000 Andreas Voss and Per Sigmond, all rights reserved.
// Modifications Copyright (C) 2004 Patrick Earl
-// Modifications Copyright (C) 2008 Peter J. Stieber
+// Modifications Copyright (C) 2008-2010 Peter J. Stieber
//
// 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
@@ -208,8 +208,6 @@
//-----------------------------------------------------------------------------
int JZSysExEvent::GetPitch() const
{
- edb();
-
int Id = gpSynth->GetSysexId(this);
if (Id >= SX_GM_ON && Id < SX_GS_ON)
Modified: trunk/jazz/src/Events.h
===================================================================
--- trunk/jazz/src/Events.h 2010-04-26 14:35:58 UTC (rev 759)
+++ trunk/jazz/src/Events.h 2010-04-26 17:06:32 UTC (rev 760)
@@ -3,7 +3,7 @@
//
// Copyright (C) 1994-2000 Andreas Voss and Per Sigmond, all rights reserved.
// Modifications Copyright (C) 2004 Patrick Earl
-// Modifications Copyright (C) 2008 Peter J. Stieber
+// Modifications Copyright (C) 2008-2010 Peter J. Stieber
//
// 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
@@ -237,22 +237,16 @@
// Midi-Events
// ********************************************************************
-/*
- * Normal events (with the channel)
- */
-
+// Normal events (with the channel)
#define StatKeyOff 0x80
#define StatKeyOn 0x90
-#define StatKeyPressure 0xA0 // Key pressure
+#define StatKeyPressure 0xA0
#define StatControl 0xB0
#define StatProgram 0xC0
-#define StatChnPressure 0xD0 // SN++ Channel pressure
+#define StatChnPressure 0xD0 // Channel pressure
#define StatPitch 0xE0
-/*
- * Meta events (no channel)
- */
-
+// Meta events (no channel).
#define StatSysEx 0xF0
#define StatSongPtr 0xF2
#define StatSongSelect 0xF3
@@ -284,8 +278,7 @@
-// Event-Classes
-
+// Event classes
class JZEvent;
class JZChannelEvent;
class JZMetaEvent;
@@ -322,23 +315,6 @@
{
public:
-#ifdef E_DBUG
- int Magic;
- void edb() const
- {
- if (Magic != MAGIC)
- {
- fprintf(stderr, "Magic failed\n");
- fflush(stderr);
- *(char *)0 = 0;
- }
- }
-#else
- void edb() const
- {
- }
-#endif
-
unsigned char GetStat() const
{
return mStat;
@@ -366,73 +342,61 @@
mClock(Clock),
mDevice(BROADCAST_DEVICE)
{
-#ifdef E_DBUG
- Magic = MAGIC;
-#endif
}
virtual ~JZEvent()
{
- edb();
-#ifdef E_DBUG
- Magic = 0L;
-#endif
}
void Kill()
{
- edb();
mClock |= KILLED_CLOCK;
}
void UnKill()
{
- edb();
mClock &= ~KILLED_CLOCK;
}
int IsKilled()
{
- edb();
return (mClock & KILLED_CLOCK) != 0;
}
- virtual JZMetaEvent* IsMetaEvent() { edb(); return 0; }
- virtual JZChannelEvent* IsChannelEvent() { edb(); return 0; }
- virtual JZKeyOnEvent* IsKeyOn() { edb(); return 0; }
- virtual JZKeyOffEvent* IsKeyOff() { edb(); return 0; }
- virtual JZPitchEvent* IsPitch() { edb(); return 0; }
- virtual JZControlEvent* IsControl() { edb(); return 0; }
- virtual JZProgramEvent* IsProgram() { edb(); return 0; }
- virtual JZSysExEvent* IsSysEx() { edb(); return 0; }
- virtual JZSongPtrEvent* IsSongPtr() { edb(); return 0; }
- virtual JZMidiClockEvent* IsMidiClock() { edb(); return 0; }
- virtual JZStartPlayEvent* IsStartPlay() { edb(); return 0; }
- virtual JZContPlayEvent* IsContPlay() { edb(); return 0; }
- virtual JZStopPlayEvent* IsStopPlay() { edb(); return 0; }
- virtual JZTextEvent* IsText() { edb(); return 0; }
- virtual JZCopyrightEvent* IsCopyright() { edb(); return 0; }
- virtual JZTrackNameEvent* IsTrackName() { edb(); return 0; }
- virtual JZMarkerEvent* IsMarker() { edb(); return 0; }
- virtual JZSetTempoEvent* IsSetTempo() { edb(); return 0; }
- virtual JZMtcOffsetEvent* IsMtcOffset() { edb(); return 0; }
- virtual JZTimeSignatEvent* IsTimeSignat() { edb(); return 0; }
- virtual JZKeySignatEvent* IsKeySignat() { edb(); return 0; }
- virtual JZKeyPressureEvent* IsKeyPressure() { edb(); return 0; }
- virtual JZJazzMetaEvent* IsJazzMeta() { edb(); return 0; }
- virtual JZPlayTrackEvent* IsPlayTrack() { edb(); return 0; }
- virtual JZEndOfTrackEvent* IsEndOfTrack() { edb(); return 0; }
- virtual JZChnPressureEvent* IsChnPressure() { edb(); return 0; }
+ virtual JZMetaEvent* IsMetaEvent() { return 0; }
+ virtual JZChannelEvent* IsChannelEvent() { return 0; }
+ virtual JZKeyOnEvent* IsKeyOn() { return 0; }
+ virtual JZKeyOffEvent* IsKeyOff() { return 0; }
+ virtual JZPitchEvent* IsPitch() { return 0; }
+ virtual JZControlEvent* IsControl() { return 0; }
+ virtual JZProgramEvent* IsProgram() { return 0; }
+ virtual JZSysExEvent* IsSysEx() { return 0; }
+ virtual JZSongPtrEvent* IsSongPtr() { return 0; }
+ virtual JZMidiClockEvent* IsMidiClock() { return 0; }
+ virtual JZStartPlayEvent* IsStartPlay() { return 0; }
+ virtual JZContPlayEvent* IsContPlay() { return 0; }
+ virtual JZStopPlayEvent* IsStopPlay() { return 0; }
+ virtual JZTextEvent* IsText() { return 0; }
+ virtual JZCopyrightEvent* IsCopyright() { return 0; }
+ virtual JZTrackNameEvent* IsTrackName() { return 0; }
+ virtual JZMarkerEvent* IsMarker() { return 0; }
+ virtual JZSetTempoEvent* IsSetTempo() { return 0; }
+ virtual JZMtcOffsetEvent* IsMtcOffset() { return 0; }
+ virtual JZTimeSignatEvent* IsTimeSignat() { return 0; }
+ virtual JZKeySignatEvent* IsKeySignat() { return 0; }
+ virtual JZKeyPressureEvent* IsKeyPressure() { return 0; }
+ virtual JZJazzMetaEvent* IsJazzMeta() { return 0; }
+ virtual JZPlayTrackEvent* IsPlayTrack() { return 0; }
+ virtual JZEndOfTrackEvent* IsEndOfTrack() { return 0; }
+ virtual JZChnPressureEvent* IsChnPressure() { return 0; }
virtual int Write(JZWriteBase& io)
{
- edb();
return io.Write(this);
}
int Compare(JZEvent& Event)
{
- edb();
if ((unsigned)Event.mClock > (unsigned)mClock)
{
return -1;
@@ -453,40 +417,34 @@
virtual JZEvent* Copy() const
{
- edb();
return new JZEvent(*this);
}
// Filter
virtual int GetValue() const
{
- edb();
return 0;
}
virtual unsigned short GetEventLength() const
{
- edb();
return 16;
}
// Painting
virtual int GetLength() const
{
- edb();
return 16;
}
// Value normalized to 0 to 127.
virtual int GetPitch() const
{
- edb();
return 64;
}
virtual void SetPitch(int p)
{
- edb();
}
virtual const wxPen* GetPen() const
@@ -534,13 +492,11 @@
virtual JZChannelEvent* IsChannelEvent()
{
- edb();
return this;
}
virtual JZEvent* Copy() const
{
- edb();
return new JZChannelEvent(*this);
}
@@ -581,37 +537,31 @@
virtual int Write(JZWriteBase &io)
{
- edb();
return io.Write(this, mKey, mVelocity);
}
virtual JZKeyOnEvent* IsKeyOn()
{
- edb();
return this;
}
virtual JZEvent* Copy() const
{
- edb();
return new JZKeyOnEvent(*this);
}
virtual int GetValue() const
{
- edb();
return mKey;
}
virtual int GetPitch() const
{
- edb();
return mKey;
}
virtual void SetPitch(int p)
{
- edb();
mKey = p;
}
@@ -637,13 +587,11 @@
virtual unsigned short GetEventLength() const
{
- edb();
return mLength;
}
virtual int GetLength() const
{
- edb();
return mLength;
}
@@ -702,19 +650,16 @@
virtual int Write(JZWriteBase &io)
{
- edb();
return io.Write(this, mKey, mOffVelocity);
}
virtual JZKeyOffEvent* IsKeyOff()
{
- edb();
return this;
}
virtual JZEvent* Copy() const
{
- edb();
return new JZKeyOffEvent(*this);
}
@@ -766,36 +711,32 @@
virtual int Write(JZWriteBase &io)
{
int v = Value + 8192;
- edb(); return io.Write(this, (unsigned char)(v & 0x7F), (unsigned char)(v >> 7));
+ return
+ io.Write(this, (unsigned char)(v & 0x7F), (unsigned char)(v >> 7));
}
virtual JZPitchEvent* IsPitch()
{
- edb();
return this;
}
virtual JZEvent* Copy() const
{
- edb();
return new JZPitchEvent(*this);
}
virtual int GetValue() const
{
- edb();
return Value;
}
virtual int GetPitch() const
{
- edb();
return (Value + 8192) >> 7;
}
virtual void SetPitch(int p)
{
- edb();
Value = (p << 7) - 8192;
}
@@ -829,37 +770,31 @@
virtual int Write(JZWriteBase& io)
{
- edb();
return io.Write(this, mControl, mValue);
}
virtual JZControlEvent* IsControl()
{
- edb();
return this;
}
virtual JZEvent* Copy() const
{
- edb();
return new JZControlEvent(*this);
}
virtual int GetValue() const
{
- edb();
return mControl;
}
virtual int GetPitch() const
{
- edb();
return mControl;
}
virtual void SetPitch(int Pitch)
{
- edb();
mControl = Pitch;
}
@@ -913,36 +848,31 @@
virtual int Write(JZWriteBase &io)
{
- edb(); return io.Write(this, mProgram);
+ return io.Write(this, mProgram);
}
virtual JZProgramEvent* IsProgram()
{
- edb();
return this;
}
virtual JZEvent* Copy() const
{
- edb();
return new JZProgramEvent(*this);
}
virtual int GetValue() const
{
- edb();
return mProgram;
}
virtual int GetPitch() const
{
- edb();
return mProgram;
}
virtual void SetPitch(int Pitch)
{
- edb();
mProgram = Pitch;
}
@@ -1001,19 +931,16 @@
virtual int Write(JZWriteBase &io)
{
- edb();
return io.Write(this, mpData, mLength);
}
virtual JZMetaEvent* IsMetaEvent()
{
- edb();
return this;
}
virtual JZEvent* Copy() const
{
- edb();
return new JZMetaEvent(mClock, mStat, mpData, mLength);
}
@@ -1107,13 +1034,11 @@
virtual JZJazzMetaEvent* IsJazzMeta()
{
- edb();
return this;
}
virtual JZEvent* Copy() const
{
- edb();
return new JZJazzMetaEvent(mClock, mpData, mLength);
}
};
@@ -1131,13 +1056,11 @@
virtual JZSysExEvent* IsSysEx()
{
- edb();
return this;
}
virtual JZEvent* Copy() const
{
- edb();
return new JZSysExEvent(mClock, mpData, mLength);
}
@@ -1158,13 +1081,11 @@
virtual JZSongPtrEvent* IsSongPtr()
{
- edb();
return this;
}
virtual JZEvent* Copy() const
{
- edb();
return new JZSongPtrEvent(mClock, mpData, mLength);
}
};
@@ -1186,13 +1107,11 @@
virtual JZMidiClockEvent *IsMidiClock()
{
- edb();
return this;
}
virtual JZEvent* Copy() const
{
- edb();
return new JZMidiClockEvent(mClock, mpData, mLength);
}
};
@@ -1215,13 +1134,11 @@
virtual JZStartPlayEvent* IsStartPlay()
{
- edb();
return this;
}
virtual JZEvent* Copy() const
{
- edb();
return new JZStartPlayEvent(mClock, mpData, mLength);
}
};
@@ -1244,13 +1161,11 @@
virtual JZContPlayEvent* IsContPlay()
{
- edb();
return this;
}
virtual JZEvent* Copy() const
{
- edb();
return new JZContPlayEvent(mClock, mpData, mLength);
}
};
@@ -1273,13 +1188,11 @@
virtual JZStopPlayEvent* IsStopPlay()
{
- edb();
return this;
}
virtual JZEvent* Copy() const
{
- edb();
return new JZStopPlayEvent(mClock, mpData, mLength);
}
};
@@ -1302,13 +1215,11 @@
virtual JZTextEvent* IsText()
{
- edb();
return this;
}
virtual JZEvent* Copy() const
{
- edb();
return new JZTextEvent(mClock, mpData, mLength);
}
@@ -1341,13 +1252,11 @@
virtual JZCopyrightEvent* IsCopyright()
{
- edb();
return this;
}
virtual JZEvent* Copy() const
{
- edb();
return new JZCopyrightEvent(mClock, mpData, mLength);
}
};
@@ -1377,13 +1286,11 @@
virtual JZTrackNameEvent* IsTrackName()
{
- edb();
return this;
}
virtual JZEvent* Copy() const
{
- edb();
return new JZTrackNameEvent(mClock, mpData, mLength);
}
};
@@ -1401,13 +1308,11 @@
virtual JZMarkerEvent* IsMarker()
{
- edb();
return this;
}
virtual JZEvent* Copy() const
{
- edb();
return new JZMarkerEvent(mClock, mpData, mLength);
}
};
@@ -1461,7 +1366,6 @@
virtual int GetLength() const
{
- edb();
return eventlength;
}
@@ -1473,7 +1377,6 @@
pData[1] = transpose;
pData[2] = eventlength;
mLength = sizeof(int) * 3;
- edb();
mpData[mLength] = 0;
return io.Write(this, mpData, mLength);
@@ -1481,13 +1384,11 @@
virtual JZPlayTrackEvent* IsPlayTrack()
{
- edb();
return this;
}
virtual JZEvent* Copy() const
{
- edb();
return new JZPlayTrackEvent(mClock, track, transpose, eventlength);
}
@@ -1527,7 +1428,6 @@
virtual int GetBPM() const
{
- edb();
return int(60000000L / uSec);
}
@@ -1538,25 +1438,21 @@
virtual int GetPitch() const
{
- edb();
return GetBPM() / 2;
}
virtual int Write(JZWriteBase &io)
{
- edb();
return io.Write(this, (char)(uSec >> 16), (char)(uSec >> 8), (char)uSec);
}
virtual JZSetTempoEvent* IsSetTempo()
{
- edb();
return this;
}
virtual JZEvent* Copy() const
{
- edb();
return new JZSetTempoEvent(*this);
}
};
@@ -1573,13 +1469,11 @@
virtual JZMtcOffsetEvent* IsMtcOffset()
{
- edb();
return this;
}
virtual JZEvent* Copy() const
{
- edb();
return new JZMtcOffsetEvent(mClock, mpData, mLength);
}
};
@@ -1608,13 +1502,11 @@
virtual int Write(JZWriteBase &io)
{
- edb();
return io.Write(this, Numerator, Denomiator, Clocks, Quarter);
}
virtual JZTimeSignatEvent* IsTimeSignat()
{
- edb();
return this;
}
@@ -1629,7 +1521,6 @@
virtual JZEvent* Copy() const
{
- edb();
return new JZTimeSignatEvent(*this);
}
};
@@ -1648,18 +1539,16 @@
virtual int Write(JZWriteBase &io)
{
- edb(); return io.Write(this);
+ return io.Write(this);
}
virtual JZEndOfTrackEvent* IsEndOfTrack()
{
- edb();
return this;
}
virtual JZEvent* Copy() const
{
- edb();
return new JZEndOfTrackEvent(this->GetClock());
}
};
@@ -1681,18 +1570,16 @@
virtual int Write(JZWriteBase &io)
{
- edb(); return io.Write(this, Sharps, Minor);
+ return io.Write(this, Sharps, Minor);
}
virtual JZKeySignatEvent* IsKeySignat()
{
- edb();
return this;
}
virtual JZEvent* Copy() const
{
- edb();
return new JZKeySignatEvent(*this);
}
};
@@ -1717,37 +1604,31 @@
virtual int Write(JZWriteBase &io)
{
- edb();
return io.Write(this, mKey, mValue);
}
virtual JZKeyPressureEvent* IsKeyPressure()
{
- edb();
return this;
}
virtual JZEvent* Copy() const
{
- edb();
return new JZKeyPressureEvent(*this);
}
virtual int GetValue() const
{
- edb();
return mValue;
}
virtual int GetPitch() const
{
- edb();
return mKey;
}
virtual void SetPitch(int Pitch)
{
- edb();
mKey = Pitch;
}
@@ -1793,36 +1674,31 @@
virtual int Write(JZWriteBase &io)
{
- edb(); return io.Write(this, Value);
+ return io.Write(this, Value);
}
virtual JZChnPressureEvent* IsChnPressure()
{
- edb();
return this;
}
virtual JZEvent* Copy() const
{
- edb();
return new JZChnPressureEvent(*this);
}
virtual int GetValue() const
{
- edb();
return Value;
}
virtual int GetPitch() const
{
- edb();
return 0;
}
virtual void SetPitch(int v)
{
- edb();
}
virtual const wxPen* GetPen() const
Modified: trunk/jazz/src/Track.cpp
===================================================================
--- trunk/jazz/src/Track.cpp 2010-04-26 14:35:58 UTC (rev 759)
+++ trunk/jazz/src/Track.cpp 2010-04-26 17:06:32 UTC (rev 760)
@@ -3,7 +3,7 @@
//
// Copyright (C) 1994-2000 Andreas Voss and Per Sigmond, all rights reserved.
// Modifications Copyright (C) 2004 Patrick Earl
-// Modifications Copyright (C) 2008 Peter J. Stieber
+// Modifications Copyright (C) 2008-2010 Peter J. Stieber
//
// 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
@@ -429,14 +429,6 @@
void tSimpleEventArray::Clear()
{
int i;
-#ifdef E_DBUG
- {
- for (int i = 0; i < nEvents; i++)
- {
- Events[i]->edb();
- }
- }
-#endif
for (i = 0; i < nEvents; i++)
{
delete Events[i];
@@ -448,17 +440,6 @@
void tUndoBuffer::Clear()
{
int i;
-#ifdef E_DBUG
- {
- for (int i = 0; i < nEvents; i++)
- {
- if (bits(i))
- {
- Events[i]->edb();
- }
- }
- }
-#endif
for (i = 0; i < nEvents; i++)
{
if (bits(i))
@@ -536,15 +517,6 @@
Resize();
}
Events[nEvents++] = pEvent;
-
-#ifdef E_DBUG
- {
- for (int i = 0; i < nEvents; i++)
- {
- Events[i]->edb();
- }
- }
-#endif
}
// Description:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pst...@us...> - 2010-04-26 14:36:06
|
Revision: 759
http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=759&view=rev
Author: pstieber
Date: 2010-04-26 14:35:58 +0000 (Mon, 26 Apr 2010)
Log Message:
-----------
Updated MIDI event class names.
Modified Paths:
--------------
trunk/jazz/src/AlsaPlayer.cpp
trunk/jazz/src/AsciiMidiFile.cpp
trunk/jazz/src/Audio.cpp
trunk/jazz/src/Command.cpp
trunk/jazz/src/Command.h
trunk/jazz/src/ControlEdit.cpp
trunk/jazz/src/Dialogs/ControllerDialog.cpp
trunk/jazz/src/Dialogs/ControllerDialog.h
trunk/jazz/src/Dialogs/EndOfTrackDialog.cpp
trunk/jazz/src/Dialogs/EndOfTrackDialog.h
trunk/jazz/src/Dialogs/KeyOnDialog.cpp
trunk/jazz/src/Dialogs/KeyOnDialog.h
trunk/jazz/src/Dialogs/ProgramChangeDialog.cpp
trunk/jazz/src/Dialogs/ProgramChangeDialog.h
trunk/jazz/src/Dialogs/SetTempoDialog.cpp
trunk/jazz/src/Dialogs/SetTempoDialog.h
trunk/jazz/src/Dialogs/SysexDialog.cpp
trunk/jazz/src/Dialogs/SysexDialog.h
trunk/jazz/src/Dialogs/TextDialog.cpp
trunk/jazz/src/Dialogs/TextDialog.h
trunk/jazz/src/Dialogs.cpp
trunk/jazz/src/Events.cpp
trunk/jazz/src/Events.h
trunk/jazz/src/Harmony.cpp
trunk/jazz/src/HarmonyBrowserAnalyzer.cpp
trunk/jazz/src/HarmonyBrowserAnalyzer.h
trunk/jazz/src/Metronome.cpp
trunk/jazz/src/Metronome.h
trunk/jazz/src/PianoWindow.cpp
trunk/jazz/src/Player.cpp
trunk/jazz/src/PortMidiPlayer.cpp
trunk/jazz/src/Rhythm.cpp
trunk/jazz/src/Song.cpp
trunk/jazz/src/Song.h
trunk/jazz/src/StandardFile.cpp
trunk/jazz/src/Synth.cpp
trunk/jazz/src/Synth.h
trunk/jazz/src/Track.cpp
trunk/jazz/src/Track.h
trunk/jazz/src/mswin/WindowsPlayer.cpp
Modified: trunk/jazz/src/AlsaPlayer.cpp
===================================================================
--- trunk/jazz/src/AlsaPlayer.cpp 2010-04-26 03:44:22 UTC (rev 758)
+++ trunk/jazz/src/AlsaPlayer.cpp 2010-04-26 14:35:58 UTC (rev 759)
@@ -411,7 +411,7 @@
{
case StatKeyOn:
{
- tKeyOn* pKeyOn = pEvent->IsKeyOn();
+ JZKeyOnEvent* pKeyOn = pEvent->IsKeyOn();
set_event_header(&ev, pEvent->GetClock(), SND_SEQ_EVENT_NOTEON);
ev.data.note.channel = pKeyOn->GetChannel();
ev.data.note.note = pKeyOn->GetKey();
@@ -422,7 +422,7 @@
case StatKeyOff:
{
- tKeyOff* pKeyOff = pEvent->IsKeyOff();
+ JZKeyOffEvent* pKeyOff = pEvent->IsKeyOff();
set_event_header(&ev, pEvent->GetClock(), SND_SEQ_EVENT_NOTEOFF);
ev.data.note.channel = pKeyOff->GetChannel();
ev.data.note.note = pKeyOff->GetKey();
@@ -433,7 +433,7 @@
case StatProgram:
{
- tProgram* pProgram = pEvent->IsProgram();
+ JZProgramEvent* pProgram = pEvent->IsProgram();
set_event_header(&ev, pEvent->GetClock(), SND_SEQ_EVENT_PGMCHANGE);
ev.data.control.channel = pProgram->GetChannel();
ev.data.control.value = pProgram->GetProgram();
@@ -443,7 +443,7 @@
case StatKeyPressure:
{
- tKeyPressure* pKeyPressure = pEvent->IsKeyPressure();
+ JZKeyPressureEvent* pKeyPressure = pEvent->IsKeyPressure();
set_event_header(&ev, pEvent->GetClock(), SND_SEQ_EVENT_KEYPRESS);
ev.data.note.channel = pKeyPressure->GetChannel();
ev.data.note.note = pKeyPressure->GetKey();
@@ -454,7 +454,7 @@
case StatChnPressure:
{
- tChnPressure *k = pEvent->IsChnPressure();
+ JZChnPressureEvent *k = pEvent->IsChnPressure();
set_event_header(&ev, pEvent->GetClock(), SND_SEQ_EVENT_CHANPRESS);
ev.data.control.channel = k->GetChannel();
ev.data.control.value = k->Value;
@@ -464,7 +464,7 @@
case StatControl:
{
- tControl *k = pEvent->IsControl();
+ JZControlEvent* k = pEvent->IsControl();
set_event_header(&ev, pEvent->GetClock(), SND_SEQ_EVENT_CONTROLLER);
ev.data.control.channel = k->GetChannel();
ev.data.control.param = k->GetControl();
@@ -475,7 +475,7 @@
case StatPitch:
{
- tPitch *k = pEvent->IsPitch();
+ JZPitchEvent *k = pEvent->IsPitch();
set_event_header(&ev, pEvent->GetClock(), SND_SEQ_EVENT_PITCHBEND);
ev.data.control.channel = k->GetChannel();
ev.data.control.value = k->Value;
@@ -495,7 +495,7 @@
case StatSysEx:
{
- tSysEx* pSysEx = pEvent->IsSysEx();
+ JZSysExEvent* pSysEx = pEvent->IsSysEx();
// prepend 0xf0
char* pBuffer = new char[pSysEx->GetDataLength() + 1];
pBuffer[0] = 0xF0;
@@ -841,7 +841,7 @@
case SND_SEQ_EVENT_NOTEON:
if (ev->data.note.velocity > 0)
{
- pEvent = new tKeyOn(
+ pEvent = new JZKeyOnEvent(
0,
ev->data.note.channel,
ev->data.note.note,
@@ -849,12 +849,16 @@
}
else
{
- pEvent = new tKeyOff(0, ev->data.note.channel, ev->data.note.note, 0);
+ pEvent = new JZKeyOffEvent(
+ 0,
+ ev->data.note.channel,
+ ev->data.note.note,
+ 0);
}
break;
case SND_SEQ_EVENT_NOTEOFF:
- pEvent = new tKeyOff(
+ pEvent = new JZKeyOffEvent(
0,
ev->data.note.channel,
ev->data.note.note,
@@ -862,14 +866,14 @@
break;
case SND_SEQ_EVENT_PGMCHANGE:
- pEvent = new tProgram(
+ pEvent = new JZProgramEvent(
0,
ev->data.control.channel,
ev->data.control.value);
break;
case SND_SEQ_EVENT_KEYPRESS:
- pEvent = new tKeyPressure(
+ pEvent = new JZKeyPressureEvent(
0,
ev->data.note.channel,
ev->data.note.note,
@@ -877,14 +881,14 @@
break;
case SND_SEQ_EVENT_CHANPRESS:
- pEvent = new tChnPressure(
+ pEvent = new JZChnPressureEvent(
0,
ev->data.control.channel,
ev->data.control.value);
break;
case SND_SEQ_EVENT_CONTROLLER:
- pEvent = new tControl(
+ pEvent = new JZControlEvent(
0,
ev->data.control.channel,
ev->data.control.param,
@@ -892,14 +896,14 @@
break;
case SND_SEQ_EVENT_PITCHBEND:
- pEvent = new tPitch(
+ pEvent = new JZPitchEvent(
0,
ev->data.control.channel,
ev->data.control.value);
break;
case SND_SEQ_EVENT_SYSEX:
- pEvent = new tSysEx(
+ pEvent = new JZSysExEvent(
0,
((unsigned char *)ev->data.ext.ptr) + 1,
ev->data.ext.len - 1);
Modified: trunk/jazz/src/AsciiMidiFile.cpp
===================================================================
--- trunk/jazz/src/AsciiMidiFile.cpp 2010-04-26 03:44:22 UTC (rev 758)
+++ trunk/jazz/src/AsciiMidiFile.cpp 2010-04-26 14:35:58 UTC (rev 759)
@@ -67,46 +67,46 @@
break;
case StatKeyOff:
- pEvent = new tKeyOff(Clock, cha, pBuffer[0]);
+ pEvent = new JZKeyOffEvent(Clock, cha, pBuffer[0]);
break;
case StatKeyOn:
- pEvent = new tKeyOn(Clock, cha, pBuffer[0], pBuffer[1]);
+ pEvent = new JZKeyOnEvent(Clock, cha, pBuffer[0], pBuffer[1]);
break;
case StatControl:
- pEvent = new tControl(Clock, cha, pBuffer[0], pBuffer[1]);
+ pEvent = new JZControlEvent(Clock, cha, pBuffer[0], pBuffer[1]);
break;
case StatPitch:
- pEvent = new tPitch(Clock, cha, pBuffer[0], pBuffer[1]);
+ pEvent = new JZPitchEvent(Clock, cha, pBuffer[0], pBuffer[1]);
break;
case StatProgram:
- pEvent = new tProgram(Clock, cha, pBuffer[0]);
+ pEvent = new JZProgramEvent(Clock, cha, pBuffer[0]);
break;
case StatText:
- pEvent = new tText(Clock, pBuffer, Length);
+ pEvent = new JZTextEvent(Clock, pBuffer, Length);
break;
case StatTrackName:
- pEvent = new tTrackName(Clock, pBuffer, Length);
+ pEvent = new JZTrackNameEvent(Clock, pBuffer, Length);
break;
case StatMarker:
- pEvent = new tMarker(Clock, pBuffer, Length);
+ pEvent = new JZMarkerEvent(Clock, pBuffer, Length);
break;
case StatEndOfTrack:
break;
case StatSetTempo:
- pEvent = new tSetTempo(Clock, pBuffer[0], pBuffer[1], pBuffer[2]);
+ pEvent = new JZSetTempoEvent(Clock, pBuffer[0], pBuffer[1], pBuffer[2]);
break;
case StatTimeSignat:
- pEvent = new tTimeSignat(
+ pEvent = new JZTimeSignatEvent(
Clock,
pBuffer[0],
pBuffer[1],
@@ -115,7 +115,7 @@
break;
case StatSysEx:
- pEvent = new tSysEx(Clock, pBuffer, Length);
+ pEvent = new JZSysExEvent(Clock, pBuffer, Length);
break;
}
@@ -160,7 +160,7 @@
//-----------------------------------------------------------------------------
int JZAsciiWrite::Write(JZEvent* pEvent, unsigned char* pData, int Length)
{
- tChannelEvent* pChannelEvent;
+ JZChannelEvent* pChannelEvent;
fprintf(mpFd, "%6d %02x ", pEvent->GetClock(), pEvent->GetStat());
if ((pChannelEvent = pEvent->IsChannelEvent()) != 0)
Modified: trunk/jazz/src/Audio.cpp
===================================================================
--- trunk/jazz/src/Audio.cpp 2010-04-26 03:44:22 UTC (rev 758)
+++ trunk/jazz/src/Audio.cpp 2010-04-26 14:35:58 UTC (rev 759)
@@ -465,7 +465,7 @@
}
event_index++;
- tKeyOn* pKeyOn = e->IsKeyOn();
+ JZKeyOnEvent* pKeyOn = e->IsKeyOn();
if (pKeyOn && num_voices < MAXPOLY)
{
voices[num_voices++]->Start(samples[pKeyOn->GetKey()], pKeyOn->GetClock());
@@ -581,7 +581,7 @@
JZEvent *e = it.First();
while (e)
{
- tKeyOn* pKeyOn = e->IsKeyOn();
+ JZKeyOnEvent* pKeyOn = e->IsKeyOn();
if (pKeyOn)
{
pKeyOn->SetLength(
@@ -913,7 +913,7 @@
e = iter.Next();
}
// add a noteon
- tKeyOn* pKeyOn = new tKeyOn(
+ JZKeyOnEvent* pKeyOn = new JZKeyOnEvent(
frc,
track->Channel - 1,
key,
Modified: trunk/jazz/src/Command.cpp
===================================================================
--- trunk/jazz/src/Command.cpp 2010-04-26 03:44:22 UTC (rev 758)
+++ trunk/jazz/src/Command.cpp 2010-04-26 14:35:58 UTC (rev 759)
@@ -138,7 +138,7 @@
//-----------------------------------------------------------------------------
void tSelectedKeys::ExecuteEvent(JZTrack* pTrack, JZEvent* pEvent)
{
- tKeyOn* pKeyOn = pEvent->IsKeyOn();
+ JZKeyOnEvent* pKeyOn = pEvent->IsKeyOn();
if (pKeyOn)
{
Keys[pKeyOn->GetKey()] += pKeyOn->GetEventLength();
@@ -402,10 +402,10 @@
//-----------------------------------------------------------------------------
void tCmdQuantize::ExecuteEvent(JZTrack* pTrack, JZEvent* pEvent)
{
- tKeyOn* pKeyOn;
+ JZKeyOnEvent* pKeyOn;
if ((pKeyOn = pEvent->IsKeyOn()) != 0)
{
- pKeyOn = (tKeyOn *)pEvent->Copy();
+ pKeyOn = (JZKeyOnEvent *)pEvent->Copy();
if (mNoteStart)
{
pKeyOn->SetClock(Quantize(pKeyOn->GetClock(), 0));
@@ -441,10 +441,10 @@
//-----------------------------------------------------------------------------
void tCmdTranspose::ExecuteEvent(JZTrack* pTrack, JZEvent* pEvent)
{
- tKeyOn* pKeyOn;
+ JZKeyOnEvent* pKeyOn;
if (pEvent->IsKeyOn())
{
- pKeyOn = (tKeyOn *)pEvent->Copy();
+ pKeyOn = (JZKeyOnEvent *)pEvent->Copy();
if (mFitIntoScale)
{
pKeyOn->SetKey(pKeyOn->GetKey() + mNotes);
@@ -461,7 +461,7 @@
// After touch.
if (pEvent->IsKeyPressure())
{
- tKeyPressure* pKeyPressure = (tKeyPressure *)pEvent->Copy();
+ JZKeyPressureEvent* pKeyPressure = (JZKeyPressureEvent *)pEvent->Copy();
if (mFitIntoScale)
{
pKeyPressure->SetKey(pKeyPressure->GetKey() + mNotes);
@@ -491,11 +491,11 @@
//-----------------------------------------------------------------------------
void tCmdSetChannel::ExecuteEvent(JZTrack* pTrack, JZEvent* pEvent)
{
- tChannelEvent* pChannelEvent;
+ JZChannelEvent* pChannelEvent;
if ((pChannelEvent = pEvent->IsChannelEvent()) != 0)
{
- pChannelEvent = (tChannelEvent *)pEvent->Copy();
+ pChannelEvent = (JZChannelEvent *)pEvent->Copy();
pChannelEvent->SetChannel(mNewChannel);
pTrack->Kill(pEvent);
pTrack->Put(pChannelEvent);
@@ -523,11 +523,11 @@
//-----------------------------------------------------------------------------
void tCmdVelocity::ExecuteEvent(JZTrack* pTrack, JZEvent* pEvent)
{
- tKeyOn* pKeyOn;
+ JZKeyOnEvent* pKeyOn;
if (pEvent->IsKeyOn() != 0)
{
- pKeyOn = (tKeyOn *)pEvent->Copy();
+ pKeyOn = (JZKeyOnEvent *)pEvent->Copy();
int Value = 0;
if (mToValue <= 0)
{
@@ -575,11 +575,11 @@
//-----------------------------------------------------------------------------
void tCmdLength::ExecuteEvent(JZTrack* pTrack, JZEvent* pEvent)
{
- tKeyOn* pKeyOn;
+ JZKeyOnEvent* pKeyOn;
if (pEvent->IsKeyOn() != 0)
{
- pKeyOn = (tKeyOn *)pEvent->Copy();
+ pKeyOn = (JZKeyOnEvent *)pEvent->Copy();
int Value = 0;
if (mToValue <= 0)
{
@@ -628,7 +628,7 @@
{
// Make a copy of the current event.
JZEvent* k;
- k = (tKeyOn *)pEvent->Copy();
+ k = (JZKeyOnEvent *)pEvent->Copy();
//little hack, if clock is -1000 it means set startclock from the first event.
if (startClock==-1000)
@@ -705,8 +705,8 @@
}
pitchdiff = pEvent->GetPitch()-previouspitch;
- tPitch* pitchmodulation=0;
- pitchmodulation = new tPitch(
+ JZPitchEvent* pitchmodulation=0;
+ pitchmodulation = new JZPitchEvent(
pEvent->GetClock(),
channel,
pitchsteparray[pitchdiff + 4]);
@@ -715,12 +715,12 @@
pTrack->Kill(pEvent); //remove the old event
- pTrack->Put(new tControl(
+ pTrack->Put(new JZControlEvent(
pEvent->GetClock(),
channel,
0x07,
pEvent->IsKeyOn()->GetVelocity()));
- pTrack->Put(new tControl(
+ pTrack->Put(new JZControlEvent(
pEvent->GetClock() + pEvent->IsKeyOn()->GetEventLength(),
channel,
0x07,
@@ -734,7 +734,7 @@
pEvent = Iterator.Next();
}
//now insert the new long event
- tKeyOn* longevent = new tKeyOn(
+ JZKeyOnEvent* longevent = new JZKeyOnEvent(
startclock,
channel,
startkey,
@@ -766,14 +766,14 @@
//-----------------------------------------------------------------------------
void tCmdMidiDelay::ExecuteEvent(JZTrack* pTrack, JZEvent* pEvent)
{
- tKeyOn* pKeyOn;
+ JZKeyOnEvent* pKeyOn;
for (int i = 1; i < repeat; ++i)
{
if (pEvent->IsKeyOn())
{
// Only echo note events.
- pKeyOn = (tKeyOn *)pEvent->Copy();
+ pKeyOn = (JZKeyOnEvent *)pEvent->Copy();
pKeyOn->SetClock(pKeyOn->GetClock()+ clockDelay * i);
pKeyOn->SetVelocity(
(unsigned char)(pow(scale, i) * pKeyOn->GetVelocity()));
@@ -806,7 +806,7 @@
//-----------------------------------------------------------------------------
void tCmdCleanup::ExecuteEvent(JZTrack* pTrack, JZEvent* pEvent)
{
- tKeyOn* pKeyOn;
+ JZKeyOnEvent* pKeyOn;
if ((pKeyOn = pEvent->IsKeyOn()) != 0)
{
if (pKeyOn->GetEventLength() < lengthLimit)
@@ -817,7 +817,7 @@
else if (shortenOverlaps)
{
// Shorten length of overlapping notes.
- tKeyOn* pPreviousKeyOn = prev_note[pKeyOn->GetChannel()][pKeyOn->GetKey()];
+ JZKeyOnEvent* pPreviousKeyOn = prev_note[pKeyOn->GetChannel()][pKeyOn->GetKey()];
if (
pPreviousKeyOn &&
pPreviousKeyOn->GetClock() + pPreviousKeyOn->GetEventLength() >=
@@ -851,12 +851,12 @@
//-----------------------------------------------------------------------------
void tCmdSearchReplace::ExecuteEvent(JZTrack* pTrack, JZEvent* pEvent)
{
- tControl* pControl = pEvent->IsControl();
+ JZControlEvent* pControl = pEvent->IsControl();
if (pControl)
{
if (pControl->GetControl() == mFrom)
{
- tControl* pControlCopy = (tControl *)pControl->Copy();
+ JZControlEvent* pControlCopy = (JZControlEvent *)pControl->Copy();
pControlCopy->SetControl(mTo);
pTrack->Kill(pControl);
pTrack->Put(pControlCopy);
@@ -1042,7 +1042,7 @@
{
if (pEvent->IsKeyOn())
{
- tKeyOn* pKeyOn = (tKeyOn *)pEvent->Copy();
+ JZKeyOnEvent* pKeyOn = (JZKeyOnEvent *)pEvent->Copy();
pKeyOn->SetClock(
mpFilter->GetFromClock() + mpFilter->GetToClock() - pKeyOn->GetClock());
pTrack->Kill(pEvent);
@@ -1082,7 +1082,7 @@
{
if (mpFilter->IsSelected(pEvent) && pEvent->IsKeyOn())
{
- tKeyOn* pKeyOn = (tKeyOn *)pEvent;
+ JZKeyOnEvent* pKeyOn = (JZKeyOnEvent *)pEvent;
Keys[pKeyOn->GetKey()] = 1;
}
pEvent = Iterator.Next();
@@ -1096,7 +1096,7 @@
{
if (mpFilter->IsSelected(pEvent) && pEvent->IsKeyOn())
{
- tKeyOn* pKeyOn = (tKeyOn *)pEvent->Copy();
+ JZKeyOnEvent* pKeyOn = (JZKeyOnEvent *)pEvent->Copy();
int n_th = 0;
// the n'th key from bottom
@@ -1157,7 +1157,7 @@
//-----------------------------------------------------------------------------
void tCmdMapper::ExecuteEvent(JZTrack* pTrack, JZEvent* pEvent)
{
- tKeyOn* pKeyOn = pEvent->IsKeyOn();
+ JZKeyOnEvent* pKeyOn = pEvent->IsKeyOn();
if (pKeyOn)
{
int sval = 0;
@@ -1224,7 +1224,7 @@
{
sval = 1;
}
- tKeyOn* pKeyOnCopy = (tKeyOn *)pKeyOn->Copy();
+ JZKeyOnEvent* pKeyOnCopy = (JZKeyOnEvent *)pKeyOn->Copy();
pTrack->Kill(pKeyOn);
pKeyOnCopy->SetVelocity(sval);
pTrack->Put(pKeyOnCopy);
@@ -1245,7 +1245,7 @@
{
sval = 1;
}
- tKeyOn* pKeyOnCopy = (tKeyOn *)pKeyOn->Copy();
+ JZKeyOnEvent* pKeyOnCopy = (JZKeyOnEvent *)pKeyOn->Copy();
pTrack->Kill(pKeyOn);
pKeyOnCopy->SetKey(sval);
pTrack->Put(pKeyOnCopy);
@@ -1262,7 +1262,7 @@
{
sval = 1;
}
- tKeyOn* pKeyOnCopy = (tKeyOn *)pKeyOn->Copy();
+ JZKeyOnEvent* pKeyOnCopy = (JZKeyOnEvent *)pKeyOn->Copy();
pTrack->Kill(pKeyOn);
pKeyOnCopy->SetLength(sval);
pTrack->Put(pKeyOnCopy);
@@ -1271,7 +1271,7 @@
case clock:
{
- tKeyOn* pKeyOnCopy = (tKeyOn *)pKeyOn->Copy();
+ JZKeyOnEvent* pKeyOnCopy = (JZKeyOnEvent *)pKeyOn->Copy();
pKeyOnCopy->SetClock(pKeyOnCopy->GetClock() + sval);
if (pKeyOnCopy->GetClock() < 0)
{
Modified: trunk/jazz/src/Command.h
===================================================================
--- trunk/jazz/src/Command.h 2010-04-26 03:44:22 UTC (rev 758)
+++ trunk/jazz/src/Command.h 2010-04-26 14:35:58 UTC (rev 759)
@@ -32,7 +32,7 @@
class tEventArray;
class JZRndArray;
class JZBarInfo;
-class tKeyOn;
+class JZKeyOnEvent;
//*****************************************************************************
//*****************************************************************************
@@ -188,7 +188,7 @@
{
long lengthLimit;
int shortenOverlaps;
- tKeyOn *prev_note[16][128];
+ JZKeyOnEvent *prev_note[16][128];
public:
tCmdCleanup(JZFilter* pFilter, long limitClocks, int shortenOverlaps);
virtual void ExecuteTrack(JZTrack* pTrack);
Modified: trunk/jazz/src/ControlEdit.cpp
===================================================================
--- trunk/jazz/src/ControlEdit.cpp 2010-04-26 03:44:22 UTC (rev 758)
+++ trunk/jazz/src/ControlEdit.cpp 2010-04-26 14:35:58 UTC (rev 759)
@@ -312,7 +312,7 @@
// edit mode: Erzeugt keine neuen Events sondern aendert den Wert
// bestehender Events.
// SN++
- tControl* pControlCopy;
+ JZControlEvent* pControlCopy;
while (pEvent)
{
if (IsCtrlEdit(pEvent))
@@ -441,7 +441,7 @@
JZEvent * tPitchEdit::NewEvent(long clock, int val)
{
- return new tPitch(clock, track->Channel - 1, val);
+ return new JZPitchEvent(clock, track->Channel - 1, val);
}
// ------------------------------------------------------------------
@@ -475,7 +475,7 @@
int tCtrlEdit::IsCtrlEdit(JZEvent* pEvent)
{
- tControl* pControl = pEvent->IsControl();
+ JZControlEvent* pControl = pEvent->IsControl();
return (pControl && pControl->GetControl() == ctrl_num);
}
@@ -486,7 +486,7 @@
JZEvent * tCtrlEdit::NewEvent(long clock, int val)
{
- return new tControl(clock, track->Channel - 1, ctrl_num, val);
+ return new JZControlEvent(clock, track->Channel - 1, ctrl_num, val);
}
// ------------------------------------------------------------------
@@ -567,10 +567,10 @@
mpPianoWindow->GetFilter()->IsSelected(pEvent))
{
- tKeyOn* pKeyOn = pEvent->IsKeyOn();
+ JZKeyOnEvent* pKeyOn = pEvent->IsKeyOn();
if (pKeyOn)
{
- tKeyOn* pKeyOnCopy = pKeyOn->Copy()->IsKeyOn();
+ JZKeyOnEvent* pKeyOnCopy = pKeyOn->Copy()->IsKeyOn();
int i = Clock2i(pKeyOnCopy->GetClock());
pKeyOnCopy->SetVelocity(array[i]);
@@ -634,7 +634,7 @@
int tPolyAfterEdit::GetValue(JZEvent* pEvent)
{
- tKeyPressure* pKeyPressure = pEvent->IsKeyPressure();
+ JZKeyPressureEvent* pKeyPressure = pEvent->IsKeyPressure();
if (pKeyPressure)
{
return pKeyPressure->GetPressureValue();
@@ -670,7 +670,7 @@
from_clk = from_clock;
to_clk = to_clock;
}
- tKeyOn* pKeyOn;
+ JZKeyOnEvent* pKeyOn;
if (!ctrlmode)
{
@@ -684,7 +684,7 @@
!mpPianoWindow->mpSnapSel->IsSelected() ||
mpPianoWindow->GetFilter()->IsSelected(pEvent))
{
- tKeyPressure* pKeyPressure = pEvent->IsKeyPressure();
+ JZKeyPressureEvent* pKeyPressure = pEvent->IsKeyPressure();
if (pKeyPressure)
{
track->Kill(pKeyPressure);
@@ -696,7 +696,7 @@
long key_end(-1), key_clk(-1);
int key_val = -1;
int key_cha(-1);
- tKeyPressure* pKeyPressure;
+ JZKeyPressureEvent* pKeyPressure;
pEvent = iter.Range(from_clk, to_clk);
while (pEvent)
{
@@ -723,7 +723,11 @@
// und der Wert groesser als 0 ist.
if (array[i] > 0 && array[i] != temp)
{
- pKeyPressure = new tKeyPressure(iclk, key_cha, key_val, array[i]);
+ pKeyPressure = new JZKeyPressureEvent(
+ iclk,
+ key_cha,
+ key_val,
+ array[i]);
track->Put(pKeyPressure);
temp = array[i];
}
@@ -741,7 +745,7 @@
// bestehender Events.
// SN++
pEvent = iter.Range(from_clk, to_clk);
- tKeyPressure* pKeyPressureCopy;
+ JZKeyPressureEvent* pKeyPressureCopy;
while (pEvent)
{
if (
@@ -805,7 +809,7 @@
JZEvent *tChannelAfterEdit::NewEvent(long clock, int val)
{
- return new tChnPressure(clock, track->Channel - 1, val);
+ return new JZChnPressureEvent(clock, track->Channel - 1, val);
}
void tChannelAfterEdit::UpDate()
@@ -871,7 +875,7 @@
// edit mode: Erzeugt keine neuen Events sondern aendert den Wert
// bestehender Events.
// SN++
- tChnPressure* pChnPressureCopy;
+ JZChnPressureEvent* pChnPressureCopy;
while (pEvent)
{
if (IsCtrlEdit(pEvent))
@@ -929,5 +933,5 @@
JZEvent * tTempoEdit::NewEvent(long clock, int val)
{
- return new tSetTempo(clock, val);
+ return new JZSetTempoEvent(clock, val);
}
Modified: trunk/jazz/src/Dialogs/ControllerDialog.cpp
===================================================================
--- trunk/jazz/src/Dialogs/ControllerDialog.cpp 2010-04-26 03:44:22 UTC (rev 758)
+++ trunk/jazz/src/Dialogs/ControllerDialog.cpp 2010-04-26 14:35:58 UTC (rev 759)
@@ -39,7 +39,7 @@
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
JZControllerDialog::JZControllerDialog(
- tControl* pControl,
+ JZControlEvent* pControl,
JZTrack* pTrack,
wxWindow* pParent)
: wxDialog(pParent, wxID_ANY, wxString("Controller")),
Modified: trunk/jazz/src/Dialogs/ControllerDialog.h
===================================================================
--- trunk/jazz/src/Dialogs/ControllerDialog.h 2010-04-26 03:44:22 UTC (rev 758)
+++ trunk/jazz/src/Dialogs/ControllerDialog.h 2010-04-26 14:35:58 UTC (rev 759)
@@ -24,7 +24,7 @@
#include <wx/dialog.h>
-class tControl;
+class JZControlEvent;
class JZTrack;
class wxListBox;
@@ -35,13 +35,13 @@
public:
JZControllerDialog(
- tControl* pControl,
+ JZControlEvent* pControl,
JZTrack* pTrack,
wxWindow* pParent);
private:
- tControl* mpControl;
+ JZControlEvent* mpControl;
wxListBox* mpControllerListBox;
Modified: trunk/jazz/src/Dialogs/EndOfTrackDialog.cpp
===================================================================
--- trunk/jazz/src/Dialogs/EndOfTrackDialog.cpp 2010-04-26 03:44:22 UTC (rev 758)
+++ trunk/jazz/src/Dialogs/EndOfTrackDialog.cpp 2010-04-26 14:35:58 UTC (rev 759)
@@ -46,7 +46,7 @@
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
JZEndOfTrackDialog::JZEndOfTrackDialog(
- tEndOfTrack* pEndOfTrackEvent,
+ JZEndOfTrackEvent* pEndOfTrackEvent,
JZTrack* pTrack,
wxWindow * pParent)
: wxDialog(pParent, wxID_ANY, wxString("End of Track")),
Modified: trunk/jazz/src/Dialogs/EndOfTrackDialog.h
===================================================================
--- trunk/jazz/src/Dialogs/EndOfTrackDialog.h 2010-04-26 03:44:22 UTC (rev 758)
+++ trunk/jazz/src/Dialogs/EndOfTrackDialog.h 2010-04-26 14:35:58 UTC (rev 759)
@@ -23,7 +23,7 @@
#include <wx/dialog.h>
-class tEndOfTrack;
+class JZEndOfTrackEvent;
class JZTrack;
class wxTextCtrl;
@@ -34,7 +34,7 @@
public:
JZEndOfTrackDialog(
- tEndOfTrack* pEndOfTrackEvent,
+ JZEndOfTrackEvent* pEndOfTrackEvent,
JZTrack* pTrack,
wxWindow* pParent);
@@ -48,7 +48,7 @@
private:
- tEndOfTrack* mpEndOfTrackEvent;
+ JZEndOfTrackEvent* mpEndOfTrackEvent;
wxTextCtrl* mpClockEdit;
Modified: trunk/jazz/src/Dialogs/KeyOnDialog.cpp
===================================================================
--- trunk/jazz/src/Dialogs/KeyOnDialog.cpp 2010-04-26 03:44:22 UTC (rev 758)
+++ trunk/jazz/src/Dialogs/KeyOnDialog.cpp 2010-04-26 14:35:58 UTC (rev 759)
@@ -54,7 +54,7 @@
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-JZKeyOnDialog::JZKeyOnDialog(tKeyOn* pEvent, wxWindow* pParent)
+JZKeyOnDialog::JZKeyOnDialog(JZKeyOnEvent* pEvent, wxWindow* pParent)
: wxDialog(pParent, wxID_ANY, wxString("Key On")),
mpEvent(pEvent),
mpPitchEdit(0),
Modified: trunk/jazz/src/Dialogs/KeyOnDialog.h
===================================================================
--- trunk/jazz/src/Dialogs/KeyOnDialog.h 2010-04-26 03:44:22 UTC (rev 758)
+++ trunk/jazz/src/Dialogs/KeyOnDialog.h 2010-04-26 14:35:58 UTC (rev 759)
@@ -25,7 +25,7 @@
class JZKnob;
class JZKnobEvent;
-class tKeyOn;
+class JZKeyOnEvent;
class wxStaticText;
class wxTextCtrl;
@@ -35,7 +35,7 @@
{
public:
- JZKeyOnDialog(tKeyOn* pEvent, wxWindow* pParent);
+ JZKeyOnDialog(JZKeyOnEvent* pEvent, wxWindow* pParent);
private:
@@ -53,7 +53,7 @@
private:
- tKeyOn* mpEvent;
+ JZKeyOnEvent* mpEvent;
wxTextCtrl* mpPitchEdit;
wxStaticText* mpVelocityValue;
Modified: trunk/jazz/src/Dialogs/ProgramChangeDialog.cpp
===================================================================
--- trunk/jazz/src/Dialogs/ProgramChangeDialog.cpp 2010-04-26 03:44:22 UTC (rev 758)
+++ trunk/jazz/src/Dialogs/ProgramChangeDialog.cpp 2010-04-26 14:35:58 UTC (rev 759)
@@ -39,7 +39,7 @@
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
JZProgramChangeDialog::JZProgramChangeDialog(
- tProgram* pProgram,
+ JZProgramEvent* pProgram,
JZTrack* pTrack,
wxWindow* pParent)
: wxDialog(pParent, wxID_ANY, wxString("Program Change")),
Modified: trunk/jazz/src/Dialogs/ProgramChangeDialog.h
===================================================================
--- trunk/jazz/src/Dialogs/ProgramChangeDialog.h 2010-04-26 03:44:22 UTC (rev 758)
+++ trunk/jazz/src/Dialogs/ProgramChangeDialog.h 2010-04-26 14:35:58 UTC (rev 759)
@@ -23,7 +23,7 @@
#include <wx/dialog.h>
-class tProgram;
+class JZProgramEvent;
class JZTrack;
class wxListBox;
@@ -34,13 +34,13 @@
public:
JZProgramChangeDialog(
- tProgram* pProgram,
+ JZProgramEvent* pProgram,
JZTrack* pTrack,
wxWindow* pParent);
private:
- tProgram* mpProgram;
+ JZProgramEvent* mpProgram;
wxListBox* mpProgramListBox;
Modified: trunk/jazz/src/Dialogs/SetTempoDialog.cpp
===================================================================
--- trunk/jazz/src/Dialogs/SetTempoDialog.cpp 2010-04-26 03:44:22 UTC (rev 758)
+++ trunk/jazz/src/Dialogs/SetTempoDialog.cpp 2010-04-26 14:35:58 UTC (rev 759)
@@ -48,7 +48,7 @@
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
JZSetTempoDialog::JZSetTempoDialog(
- tSetTempo* pSetTempoEvent,
+ JZSetTempoEvent* pSetTempoEvent,
JZTrack* pTrack,
wxWindow * pParent)
: wxDialog(pParent, wxID_ANY, wxString("Set Tempo (for track 0)")),
Modified: trunk/jazz/src/Dialogs/SetTempoDialog.h
===================================================================
--- trunk/jazz/src/Dialogs/SetTempoDialog.h 2010-04-26 03:44:22 UTC (rev 758)
+++ trunk/jazz/src/Dialogs/SetTempoDialog.h 2010-04-26 14:35:58 UTC (rev 759)
@@ -24,8 +24,8 @@
#include <wx/dialog.h>
class JZIntegerEdit;
+class JZSetTempoEvent;
class JZTrack;
-class tSetTempo;
class wxTextCtrl;
//*****************************************************************************
@@ -35,7 +35,7 @@
public:
JZSetTempoDialog(
- tSetTempo* pSetTempoEvent,
+ JZSetTempoEvent* pSetTempoEvent,
JZTrack* pTrack,
wxWindow* pParent);
@@ -49,7 +49,7 @@
private:
- tSetTempo* mpSetTempoEvent;
+ JZSetTempoEvent* mpSetTempoEvent;
JZIntegerEdit* mpTempoEdit;
Modified: trunk/jazz/src/Dialogs/SysexDialog.cpp
===================================================================
--- trunk/jazz/src/Dialogs/SysexDialog.cpp 2010-04-26 03:44:22 UTC (rev 758)
+++ trunk/jazz/src/Dialogs/SysexDialog.cpp 2010-04-26 14:35:58 UTC (rev 759)
@@ -48,11 +48,11 @@
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
JZSysexDialog::JZSysexDialog(
- tSysEx* pEvent,
+ JZSysExEvent* pSysExEvent,
JZTrack* pTrack,
wxWindow* pParent)
: wxDialog(pParent, wxID_ANY, wxString("System Exclusive")),
- mpSysExEvent(pEvent),
+ mpSysExEvent(pSysExEvent),
mpSysExEdit(0),
mpClockEdit(0)
{
Modified: trunk/jazz/src/Dialogs/SysexDialog.h
===================================================================
--- trunk/jazz/src/Dialogs/SysexDialog.h 2010-04-26 03:44:22 UTC (rev 758)
+++ trunk/jazz/src/Dialogs/SysexDialog.h 2010-04-26 14:35:58 UTC (rev 759)
@@ -25,7 +25,7 @@
class JZKnob;
class JZKnobEvent;
-class tSysEx;
+class JZSysExEvent;
class JZTrack;
class wxStaticText;
class wxTextCtrl;
@@ -36,7 +36,10 @@
{
public:
- JZSysexDialog(tSysEx* pEvent, JZTrack* pTrack, wxWindow* pParent);
+ JZSysexDialog(
+ JZSysExEvent* pSysExEvent,
+ JZTrack* pTrack,
+ wxWindow* pParent);
private:
@@ -48,7 +51,7 @@
private:
- tSysEx* mpSysExEvent;
+ JZSysExEvent* mpSysExEvent;
wxTextCtrl* mpSysExEdit;
wxTextCtrl* mpClockEdit;
Modified: trunk/jazz/src/Dialogs/TextDialog.cpp
===================================================================
--- trunk/jazz/src/Dialogs/TextDialog.cpp 2010-04-26 03:44:22 UTC (rev 758)
+++ trunk/jazz/src/Dialogs/TextDialog.cpp 2010-04-26 14:35:58 UTC (rev 759)
@@ -47,7 +47,7 @@
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
JZTextDialog::JZTextDialog(
- tText* pTextEvent,
+ JZTextEvent* pTextEvent,
JZTrack* pTrack,
wxWindow * pParent)
: wxDialog(pParent, wxID_ANY, wxString("Text")),
Modified: trunk/jazz/src/Dialogs/TextDialog.h
===================================================================
--- trunk/jazz/src/Dialogs/TextDialog.h 2010-04-26 03:44:22 UTC (rev 758)
+++ trunk/jazz/src/Dialogs/TextDialog.h 2010-04-26 14:35:58 UTC (rev 759)
@@ -24,7 +24,7 @@
#include <wx/dialog.h>
class JZTrack;
-class tText;
+class JZTextEvent;
class wxTextCtrl;
//*****************************************************************************
@@ -33,7 +33,7 @@
{
public:
- JZTextDialog(tText* pTextEvent, JZTrack* pTrack, wxWindow* pParent);
+ JZTextDialog(JZTextEvent* pTextEvent, JZTrack* pTrack, wxWindow* pParent);
private:
@@ -45,7 +45,7 @@
private:
- tText* mpTextEvent;
+ JZTextEvent* mpTextEvent;
wxTextCtrl* mpTextEdit;
wxTextCtrl* mpClockEdit;
Modified: trunk/jazz/src/Dialogs.cpp
===================================================================
--- trunk/jazz/src/Dialogs.cpp 2010-04-26 03:44:22 UTC (rev 758)
+++ trunk/jazz/src/Dialogs.cpp 2010-04-26 14:35:58 UTC (rev 759)
@@ -321,7 +321,7 @@
int Channel;
- tChEventDlg(tChannelEvent* pChannelEvent, JZPianoWindow* w, JZTrack *pTrack)
+ tChEventDlg(JZChannelEvent* pChannelEvent, JZPianoWindow* w, JZTrack *pTrack)
: tEventDlg(pChannelEvent, w, pTrack)
{
Channel = pChannelEvent->GetChannel() + 1; // 1..16
@@ -343,7 +343,7 @@
bool tChEventDlg::OnClose()
{
- ((tChannelEvent *)Copy)->SetChannel(Channel - 1);
+ ((JZChannelEvent *)Copy)->SetChannel(Channel - 1);
tEventDlg::OnClose();
return false;
}
@@ -356,14 +356,14 @@
int Value;
- tPitchDlg(tPitch* e, JZPianoWindow* w, JZTrack *pTrack);
+ tPitchDlg(JZPitchEvent* e, JZPianoWindow* w, JZTrack *pTrack);
void AddProperties();
bool OnClose();
};
-tPitchDlg::tPitchDlg(tPitch *e, JZPianoWindow* w, JZTrack *pTrack)
+tPitchDlg::tPitchDlg(JZPitchEvent *e, JZPianoWindow* w, JZTrack *pTrack)
: tChEventDlg(e, w, pTrack)
{
Event = e;
@@ -373,13 +373,12 @@
bool tPitchDlg::OnClose()
{
- ((tPitch *)Copy)->Value = Value;
+ ((JZPitchEvent *)Copy)->Value = Value;
return tChEventDlg::OnClose();
}
void tPitchDlg::AddProperties()
{
- //Add(wxMakeFormShort("Pitch:", &Value, wxFORM_DEFAULT, new wxList(wxMakeConstraintRange(-8191.0, 8191.0), 0)));
sheet->AddProperty(new wxProperty(
"Pitch:",
wxPropertyValue(&Value),
@@ -401,14 +400,14 @@
tNamedChoice Choice;
- tPlayTrackDlg(tPlayTrack *e, JZPianoWindow* w, JZTrack *pTrack);
+ tPlayTrackDlg(JZPlayTrackEvent *e, JZPianoWindow* w, JZTrack *pTrack);
void AddProperties();
bool OnClose();
};
-tPlayTrackDlg::tPlayTrackDlg(tPlayTrack *e, JZPianoWindow* w, JZTrack *pTrack)
+tPlayTrackDlg::tPlayTrackDlg(JZPlayTrackEvent *e, JZPianoWindow* w, JZTrack *pTrack)
: tEventDlg(e, w, pTrack),
Choice("playtrack", gpConfig->GetControlNames(), &track)
{
@@ -421,7 +420,7 @@
bool tPlayTrackDlg::OnClose()
{
- tPlayTrack* p=(tPlayTrack*)Copy;
+ JZPlayTrackEvent* p=(JZPlayTrackEvent*)Copy;
Choice.GetValue();
p->track = track;
@@ -481,7 +480,7 @@
-1
};
- JZEvent *e = 0;
+ JZEvent* pEvent = 0;
int i = ::wxGetSingleChoiceIndex(
"Select event to create",
@@ -493,36 +492,36 @@
switch (Values[i])
{
case StatKeyOn:
- e = new tKeyOn(Clock, Channel, Pitch, 64, 64);
+ pEvent = new JZKeyOnEvent(Clock, Channel, Pitch, 64, 64);
break;
case StatPitch:
- e = new tPitch(Clock, Channel, 0);
- e->SetPitch(Pitch);
+ pEvent = new JZPitchEvent(Clock, Channel, 0);
+ pEvent->SetPitch(Pitch);
break;
case StatControl:
- e = new tControl(Clock, Channel, Pitch, 64);
+ pEvent = new JZControlEvent(Clock, Channel, Pitch, 64);
break;
case StatProgram:
- e = new tProgram(Clock, Channel, Pitch);
+ pEvent = new JZProgramEvent(Clock, Channel, Pitch);
break;
case StatSetTempo:
- e = new tSetTempo(Clock, 100);
+ pEvent = new JZSetTempoEvent(Clock, 100);
break;
case StatSysEx:
- e = new tSysEx(Clock, (unsigned char*) "", 0);
+ pEvent = new JZSysExEvent(Clock, (unsigned char*) "", 0);
break;
case StatPlayTrack:
- e = new tPlayTrack(Clock, 0, Pitch);
+ pEvent = new JZPlayTrackEvent(Clock, 0, Pitch);
break;
case StatEndOfTrack:
- e = new tEndOfTrack(Clock);
+ pEvent = new JZEndOfTrackEvent(Clock);
break;
case StatText:
- e = new tText(Clock, (unsigned char*)"");
+ pEvent = new JZTextEvent(Clock, (unsigned char*)"");
break;
}
}
- return e;
+ return pEvent;
}
//*****************************************************************************
Modified: trunk/jazz/src/Events.cpp
===================================================================
--- trunk/jazz/src/Events.cpp 2010-04-26 03:44:22 UTC (rev 758)
+++ trunk/jazz/src/Events.cpp 2010-04-26 14:35:58 UTC (rev 759)
@@ -150,11 +150,10 @@
}
//*****************************************************************************
-// tGetMidiBytes
//*****************************************************************************
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-int tGetMidiBytes::Write(JZEvent* pEvent, unsigned char* pData, int Length)
+int JZGetMidiBytes::Write(JZEvent* pEvent, unsigned char* pData, int Length)
{
int Stat = pEvent->GetStat();
@@ -170,7 +169,7 @@
case StatPitch:
nBytes = 0;
- Buffer[nBytes++] = Stat | ((tChannelEvent *)pEvent)->GetChannel();
+ Buffer[nBytes++] = Stat | ((JZChannelEvent *)pEvent)->GetChannel();
while (Length--)
{
Buffer[nBytes++] = *pData++;
@@ -190,7 +189,7 @@
// Description:
// This function fixed the checksum bytes at the end of the data stream.
//-----------------------------------------------------------------------------
-void tMetaEvent::FixCheckSum()
+void JZMetaEvent::FixCheckSum()
{
unsigned char Sum = 0x00;
for (unsigned short i = 4; i < (mLength - 2); ++i)
@@ -207,7 +206,7 @@
//*****************************************************************************
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-int tSysEx::GetPitch() const
+int JZSysExEvent::GetPitch() const
{
edb();
Modified: trunk/jazz/src/Events.h
===================================================================
--- trunk/jazz/src/Events.h 2010-04-26 03:44:22 UTC (rev 758)
+++ trunk/jazz/src/Events.h 2010-04-26 14:35:58 UTC (rev 759)
@@ -208,9 +208,8 @@
}
//*****************************************************************************
-// tGetMidiBytes
//*****************************************************************************
-class tGetMidiBytes : public JZWriteBase
+class JZGetMidiBytes : public JZWriteBase
{
public:
@@ -288,32 +287,32 @@
// Event-Classes
class JZEvent;
-class tChannelEvent;
-class tMetaEvent;
-class tKeyOn;
-class tKeyOff;
-class tPitch;
-class tControl;
-class tProgram;
-class tSysEx;
-class tSongPtr;
-class tMidiClock;
-class tStartPlay;
-class tContPlay;
-class tStopPlay;
-class tText;
-class tCopyright;
-class tTrackName;
-class tMarker;
-class tSetTempo;
-class tMtcOffset;
-class tTimeSignat;
-class tKeySignat;
-class tKeyPressure;
-class tJazzMeta;
-class tChnPressure;
-class tPlayTrack;
-class tEndOfTrack;
+class JZChannelEvent;
+class JZMetaEvent;
+class JZKeyOnEvent;
+class JZKeyOffEvent;
+class JZPitchEvent;
+class JZControlEvent;
+class JZProgramEvent;
+class JZSysExEvent;
+class JZSongPtrEvent;
+class JZMidiClockEvent;
+class JZStartPlayEvent;
+class JZContPlayEvent;
+class JZStopPlayEvent;
+class JZTextEvent;
+class JZCopyrightEvent;
+class JZTrackNameEvent;
+class JZMarkerEvent;
+class JZSetTempoEvent;
+class JZMtcOffsetEvent;
+class JZTimeSignatEvent;
+class JZKeySignatEvent;
+class JZKeyPressureEvent;
+class JZJazzMetaEvent;
+class JZChnPressureEvent;
+class JZPlayTrackEvent;
+class JZEndOfTrackEvent;
//*****************************************************************************
// Description:
@@ -398,32 +397,32 @@
return (mClock & KILLED_CLOCK) != 0;
}
- virtual tMetaEvent* IsMetaEvent() { edb(); return 0; }
- virtual tChannelEvent* IsChannelEvent() { edb(); return 0; }
- virtual tKeyOn* IsKeyOn() { edb(); return 0; }
- virtual tKeyOff* IsKeyOff() { edb(); return 0; }
- virtual tPitch* IsPitch() { edb(); return 0; }
- virtual tControl* IsControl() { edb(); return 0; }
- virtual tProgram* IsProgram() { edb(); return 0; }
- virtual tSysEx* IsSysEx() { edb(); return 0; }
- virtual tSongPtr* IsSongPtr() { edb(); return 0; }
- virtual tMidiClock* IsMidiClock() { edb(); return 0; }
- virtual tStartPlay* IsStartPlay() { edb(); return 0; }
- virtual tContPlay* IsContPlay() { edb(); return 0; }
- virtual tStopPlay* IsStopPlay() { edb(); return 0; }
- virtual tText* IsText() { edb(); return 0; }
- virtual tCopyright* IsCopyright() { edb(); return 0; }
- virtual tTrackName* IsTrackName() { edb(); return 0; }
- virtual tMarker* IsMarker() { edb(); return 0; }
- virtual tSetTempo* IsSetTempo() { edb(); return 0; }
- virtual tMtcOffset* IsMtcOffset() { edb(); return 0; }
- virtual tTimeSignat* IsTimeSignat() { edb(); return 0; }
- virtual tKeySignat* IsKeySignat() { edb(); return 0; }
- virtual tKeyPressure* IsKeyPressure() { edb(); return 0; }
- virtual tJazzMeta* IsJazzMeta() { edb(); return 0; }
- virtual tPlayTrack* IsPlayTrack() { edb(); return 0; }
- virtual tEndOfTrack* IsEndOfTrack() { edb(); return 0; }
- virtual tChnPressure* IsChnPressure() { edb(); return 0; }
+ virtual JZMetaEvent* IsMetaEvent() { edb(); return 0; }
+ virtual JZChannelEvent* IsChannelEvent() { edb(); return 0; }
+ virtual JZKeyOnEvent* IsKeyOn() { edb(); return 0; }
+ virtual JZKeyOffEvent* IsKeyOff() { edb(); return 0; }
+ virtual JZPitchEvent* IsPitch() { edb(); return 0; }
+ virtual JZControlEvent* IsControl() { edb(); return 0; }
+ virtual JZProgramEvent* IsProgram() { edb(); return 0; }
+ virtual JZSysExEvent* IsSysEx() { edb(); return 0; }
+ virtual JZSongPtrEvent* IsSongPtr() { edb(); return 0; }
+ virtual JZMidiClockEvent* IsMidiClock() { edb(); return 0; }
+ virtual JZStartPlayEvent* IsStartPlay() { edb(); return 0; }
+ virtual JZContPlayEvent* IsContPlay() { edb(); return 0; }
+ virtual JZStopPlayEvent* IsStopPlay() { edb(); return 0; }
+ virtual JZTextEvent* IsText() { edb(); return 0; }
+ virtual JZCopyrightEvent* IsCopyright() { edb(); return 0; }
+ virtual JZTrackNameEvent* IsTrackName() { edb(); return 0; }
+ virtual JZMarkerEvent* IsMarker() { edb(); return 0; }
+ virtual JZSetTempoEvent* IsSetTempo() { edb(); return 0; }
+ virtual JZMtcOffsetEvent* IsMtcOffset() { edb(); return 0; }
+ virtual JZTimeSignatEvent* IsTimeSignat() { edb(); return 0; }
+ virtual JZKeySignatEvent* IsKeySignat() { edb(); return 0; }
+ virtual JZKeyPressureEvent* IsKeyPressure() { edb(); return 0; }
+ virtual JZJazzMetaEvent* IsJazzMeta() { edb(); return 0; }
+ virtual JZPlayTrackEvent* IsPlayTrack() { edb(); return 0; }
+ virtual JZEndOfTrackEvent* IsEndOfTrack() { edb(); return 0; }
+ virtual JZChnPressureEvent* IsChnPressure() { edb(); return 0; }
virtual int Write(JZWriteBase& io)
{
@@ -523,17 +522,17 @@
//*****************************************************************************
//*****************************************************************************
-class tChannelEvent : public JZEvent
+class JZChannelEvent : public JZEvent
{
public:
- tChannelEvent(int Clock, unsigned char sta, int Channel)
+ JZChannelEvent(int Clock, unsigned char sta, int Channel)
: JZEvent(Clock, sta)
{
mChannel = Channel;
}
- virtual tChannelEvent* IsChannelEvent()
+ virtual JZChannelEvent* IsChannelEvent()
{
edb();
return this;
@@ -542,7 +541,7 @@
virtual JZEvent* Copy() const
{
edb();
- return new tChannelEvent(*this);
+ return new JZChannelEvent(*this);
}
unsigned char GetChannel() const
@@ -562,17 +561,17 @@
//*****************************************************************************
//*****************************************************************************
-class tKeyOn : public tChannelEvent
+class JZKeyOnEvent : public JZChannelEvent
{
public:
- tKeyOn(
+ JZKeyOnEvent(
int Clock,
int Channel,
unsigned char Key,
unsigned char Velocity,
unsigned short Length = 0)
- : tChannelEvent(Clock, StatKeyOn, Channel),
+ : JZChannelEvent(Clock, StatKeyOn, Channel),
mKey(Key),
mVelocity(Velocity),
mLength(Length),
@@ -586,7 +585,7 @@
return io.Write(this, mKey, mVelocity);
}
- virtual tKeyOn* IsKeyOn()
+ virtual JZKeyOnEvent* IsKeyOn()
{
edb();
return this;
@@ -595,7 +594,7 @@
virtual JZEvent* Copy() const
{
edb();
- return new tKeyOn(*this);
+ return new JZKeyOnEvent(*this);
}
virtual int GetValue() const
@@ -679,7 +678,7 @@
unsigned char mVelocity;
- // Length is 0 if a corresponding tKeyOff exists.
+ // Length is 0 if a corresponding JZKeyOffEvent exists.
unsigned short mLength;
unsigned short mOffVelocity;
@@ -687,15 +686,15 @@
//*****************************************************************************
//*****************************************************************************
-class tKeyOff : public tChannelEvent
+class JZKeyOffEvent : public JZChannelEvent
{
public:
- tKeyOff(
+ JZKeyOffEvent(
int Clock,
int Channel,
unsigned char Key,
unsigned char OffVelocity = 0)
- : tChannelEvent(Clock, StatKeyOff, Channel),
+ : JZChannelEvent(Clock, StatKeyOff, Channel),
mKey(Key),
mOffVelocity(OffVelocity)
{
@@ -707,7 +706,7 @@
return io.Write(this, mKey, mOffVelocity);
}
- virtual tKeyOff* IsKeyOff()
+ virtual JZKeyOffEvent* IsKeyOff()
{
edb();
return this;
@@ -716,7 +715,7 @@
virtual JZEvent* Copy() const
{
edb();
- return new tKeyOff(*this);
+ return new JZKeyOffEvent(*this);
}
unsigned char GetKey() const
@@ -743,23 +742,23 @@
//*****************************************************************************
//*****************************************************************************
-class tPitch : public tChannelEvent
+class JZPitchEvent : public JZChannelEvent
{
public:
short Value;
- tPitch(
+ JZPitchEvent(
int Clock,
unsigned short Channel,
unsigned char lo,
unsigned char hi)
- : tChannelEvent(Clock, StatPitch, Channel)
+ : JZChannelEvent(Clock, StatPitch, Channel)
{
Value = ((hi << 7) | lo) - 8192;
}
- tPitch(int Clock, unsigned short Channel, short val)
- : tChannelEvent(Clock, StatPitch, Channel)
+ JZPitchEvent(int Clock, unsigned short Channel, short val)
+ : JZChannelEvent(Clock, StatPitch, Channel)
{
Value = val;
}
@@ -770,7 +769,7 @@
edb(); return io.Write(this, (unsigned char)(v & 0x7F), (unsigned char)(v >> 7));
}
- virtual tPitch* IsPitch()
+ virtual JZPitchEvent* IsPitch()
{
edb();
return this;
@@ -779,7 +778,7 @@
virtual JZEvent* Copy() const
{
edb();
- return new tPitch(*this);
+ return new JZPitchEvent(*this);
}
virtual int GetValue() const
@@ -813,16 +812,16 @@
//*****************************************************************************
//*****************************************************************************
-class tControl : public tChannelEvent
+class JZControlEvent : public JZChannelEvent
{
public:
- tControl(
+ JZControlEvent(
int Clock,
int Channel,
unsigned char Control,
unsigned char Value)
- : tChannelEvent(Clock, StatControl, Channel),
+ : JZChannelEvent(Clock, StatControl, Channel),
mControl(Control),
mValue(Value)
{
@@ -834,7 +833,7 @@
return io.Write(this, mControl, mValue);
}
- virtual tControl* IsControl()
+ virtual JZControlEvent* IsControl()
{
edb();
return this;
@@ -843,7 +842,7 @@
virtual JZEvent* Copy() const
{
edb();
- return new tControl(*this);
+ return new JZControlEvent(*this);
}
virtual int GetValue() const
@@ -902,12 +901,12 @@
//*****************************************************************************
//*****************************************************************************
-class tProgram : public tChannelEvent
+class JZProgramEvent : public JZChannelEvent
{
public:
- tProgram(int Clock, int Channel, unsigned char Program)
- : tChannelEvent(Clock, StatProgram, Channel)
+ JZProgramEvent(int Clock, int Channel, unsigned char Program)
+ : JZChannelEvent(Clock, StatProgram, Channel)
{
mProgram = Program;
}
@@ -917,7 +916,7 @@
edb(); return io.Write(this, mProgram);
}
- virtual tProgram* IsProgram()
+ virtual JZProgramEvent* IsProgram()
{
edb();
return this;
@@ -926,7 +925,7 @@
virtual JZEvent* Copy() const
{
edb();
- return new tProgram(*this);
+ return new JZProgramEvent(*this);
}
virtual int GetValue() const
@@ -974,11 +973,11 @@
//*****************************************************************************
//*****************************************************************************
-class tMetaEvent : public JZEvent
+class JZMetaEvent : public JZEvent
{
public:
- tMetaEvent(
+ JZMetaEvent(
int Clock,
unsigned char sta,
unsigned char* pData,
@@ -995,7 +994,7 @@
mpData[Length] = 0;
}
- virtual ~tMetaEvent()
+ virtual ~JZMetaEvent()
{
delete [] mpData;
}
@@ -1006,7 +1005,7 @@
return io.Write(this, mpData, mLength);
}
- virtual tMetaEvent* IsMetaEvent()
+ virtual JZMetaEvent* IsMetaEvent()
{
edb();
return this;
@@ -1015,7 +1014,7 @@
virtual JZEvent* Copy() const
{
edb();
- return new tMetaEvent(mClock, mStat, mpData, mLength);
+ return new JZMetaEvent(mClock, mStat, mpData, mLength);
}
const unsigned char* GetData() const
@@ -1042,7 +1041,7 @@
// should should not go into a track itself but is read/written from/to
// the file.
//*****************************************************************************
-class tJazzMeta : public tMetaEvent
+class JZJazzMetaEvent : public JZMetaEvent
{
public:
@@ -1051,13 +1050,13 @@
DATALEN = 20
};
- tJazzMeta(int Clock, unsigned char* pData, unsigned short Length)
- : tMetaEvent(Clock, StatJazzMeta, pData, Length)
+ JZJazzMetaEvent(int Clock, unsigned char* pData, unsigned short Length)
+ : JZMetaEvent(Clock, StatJazzMeta, pData, Length)
{
}
- tJazzMeta()
- : tMetaEvent(0, StatJazzMeta, 0, DATALEN)
+ JZJazzMetaEvent()
+ : JZMetaEvent(0, StatJazzMeta, 0, DATALEN)
{
memset(mpData, 0, DATALEN);
memcpy(mpData, "JAZ2", 4);
@@ -1106,7 +1105,7 @@
mpData[9] = x;
}
- virtual tJazzMeta* IsJazzMeta()
+ virtual JZJazzMetaEvent* IsJazzMeta()
{
edb();
return this;
@@ -1115,22 +1114,22 @@
virtual JZEvent* Copy() const
{
edb();
- return new tJazzMeta(mClock, mpData, mLength);
+ return new JZJazzMetaEvent(mClock, mpData, mLength);
}
};
//*****************************************************************************
//*****************************************************************************
-class tSysEx : public tMetaEvent
+class JZSysExEvent : public JZMetaEvent
{
public:
- tSysEx(int Clock, unsigned char* pData, unsigned short Length)
- : tMetaEvent(Clock, StatSysEx, pData, Length)
+ JZSysExEvent(int Clock, unsigned char* pData, unsigned short Length)
+ : JZMetaEvent(Clock, StatSysEx, pData, Length)
{
}
- virtual tSysEx* IsSysEx()
+ virtual JZSysExEvent* IsSysEx()
{
edb();
return this;
@@ -1139,7 +1138,7 @@
virtual JZEvent* Copy() const
{
edb();
- return new tSysEx(mClock, mpData, mLength);
+ return new JZSysExEvent(mClock, mpData, mLength);
}
// todo
@@ -1148,16 +1147,16 @@
//*****************************************************************************
//*****************************************************************************
-class tSongPtr : public tMetaEvent
+class JZSongPtrEvent : public JZMetaEvent
{
public:
- tSongPtr(int Clock, unsigned char* pData, unsigned short Length)
- : tMetaEvent(Clock, StatSongPtr, pData, Length)
+ JZSongPtrEvent(int Clock, unsigned char* pData, unsigned short Length)
+ : JZMetaEvent(Clock, StatSongPtr, pData, Length)
{
}
- virtual tSongPtr* IsSongPtr()
+ virtual JZSongPtrEvent* IsSongPtr()
{
edb();
return this;
@@ -1166,26 +1165,26 @@
virtual JZEvent* Copy() const
{
edb();
- return new tSongPtr(mClock, mpData, mLength);
+ return new JZSongPtrEvent(mClock, mpData, mLength);
}
};
//*****************************************************************************
//*****************************************************************************
-class tMidiClock : public tMetaEvent
+class JZMidiClockEvent : public JZMetaEvent
{
public:
- tMidiClock(int Clock, unsigned char* pData, unsigned short Length)
- : tMetaEvent(Clock, StatMidiClock, pData, Length)
+ JZMidiClockEvent(int Clock, unsigned char* pData, unsigned short Length)
+ : JZMetaEvent(Clock, StatMidiClock, pData, Length)
{
}
- tMidiClock(int Clock)
- : tMetaEvent(Clock, StatMidiClock, 0, 0)
+ JZMidiClockEvent(int Clock)
+ : JZMetaEvent(Clock, StatMidiClock, 0, 0)
{
}
- virtual tMidiClock *IsMidiClock()
+ virtual JZMidiClockEvent *IsMidiClock()
{
edb();
return this;
@@ -1194,27 +1193,27 @@
virtual JZEvent* Copy() const
{
edb();
- return new tMidiClock(mClock, mpData, mLength);
+ return new JZMidiClockEvent(mClock, mpData, mLength);
}
};
//*****************************************************************************
//*****************************************************************************
-class tStartPlay : public tMetaEvent
+class JZStartPlayEvent : public JZMetaEvent
{
public:
- tStartPlay(int Clock, unsigned char* pData, unsigned short Length)
- : tMetaEvent(Clock, StatStartPlay, pData, Length)
+ JZStartPlayEvent(int Clock, unsigned char* pData, unsigned short Length)
+ : JZMetaEvent(Clock, StatStartPlay, pData, Length)
{
}
- tStartPlay(int Clock)
- : tMetaEvent(Clock, StatStartPlay, 0, 0)
+ JZStartPlayEvent(int Clock)
+ : JZMetaEvent(Clock, StatStartPlay, 0, 0)
{
}
- virtual tStartPlay* IsStartPlay()
+ virtual JZStartPlayEvent* IsStartPlay()
{
edb();
return this;
@@ -1223,27 +1222,27 @@
virtual JZEvent* Copy() const
{
edb();
- return new tStartPlay(mClock, mpData, mLength);
+ return new JZStartPlayEvent(mClock, mpData, mLength);
}
};
//*****************************************************************************
//*****************************************************************************
-class tContPlay : public tMetaEvent
+class JZContPlayEvent : public JZMetaEvent
{
public:
- tContPlay(int Clock, unsigned char* pData, unsigned short Length)
- : tMetaEvent(Clock, StatContPlay, pData, Length)
+ JZContPlayEvent(int Clock, unsigned char* pData, unsigned short Length)
+ : JZMetaEvent(Clock, StatContPlay, pData, Length)
{
}
- tContPlay(int Clock)
- : tMetaEvent(Clock, StatContPlay, 0, 0)
+ JZContPlayEvent(int Clock)
+ : JZMetaEvent(Clock, StatContPlay, 0, 0)
{
}
- virtual tContPlay* IsContPlay()
+ virtual JZContPlayEvent* IsContPlay()
{
edb();
return this;
@@ -1252,27 +1251,27 @@
virtual JZEvent* Copy() const
{
edb();
- return new tContPlay(mClock, mpData, mLength);
+ return new JZContPlayEvent(mClock, mpData, mLength);
}
};
//*****************************************************************************
//*****************************************************************************
-class tStopPlay : public tMetaEvent
+class JZStopPlayEvent : public JZMetaEvent
{
public:
- tStopPlay(int Clock, unsigned char* pData, unsigned short Length)
- : tMetaEvent(Clock, StatStopPlay, pData, Length)
+ JZStopPlayEvent(int Clock, unsigned char* pData, unsigned short Length)
+ : JZMetaEvent(Clock, StatStopPlay, pData, Length)
{
}
- tStopPlay(int Clock)
- : tMetaEvent(Clock, StatStopPlay, 0, 0)
+ JZStopPlayEvent(int Clock)
+ : JZMetaEvent(Clock, StatStopPlay, 0, 0)
{
}
- virtual tStopPlay* IsStopPlay()
+ virtual JZStopPlayEvent* IsStopPlay()
{
edb();
return this;
@@ -1281,27 +1280,27 @@
virtual JZEvent* Copy() const
{
edb();
- return new tStopPlay(mClock, mpData, mLength);
+ return new JZStopPlayEvent(mClock, mpData, mLength);
}
};
//*****************************************************************************
//*****************************************************************************
-class tText : public tMetaEvent
+class JZTextEvent : public JZMetaEvent
{
public:
- tText(int Clock, unsigned char* pData, unsigned short Length)
- : tMetaEvent(Clock, StatText, pData, Length)
+ JZTextEvent(int Clock, unsigned char* pData, unsigned short Length)
+ : JZMetaEvent(Clock, StatText, pData, Length)
{
}
- tText(int Clock, unsigned char* pData)
- : tMetaEvent(Clock, StatText, pData, strlen((const char*)pData))
+ JZTextEvent(int Clock, unsigned char* pData)
+ : JZMetaEvent(Clock, StatText, pData, strlen((const char*)pData))
{
}
- virtual tText* IsText()
+ virtual JZTextEvent* IsText()
{
edb();
return this;
@@ -1310,7 +1309,7 @@
virtual JZEvent* Copy() const
{
edb();
- return new tText(mClock, mpData, mLength);
+ return new JZTextEvent(mClock, mpData, mLength);
}
virtual unsigned char* GetText()
@@ -1331,16 +1330,16 @@
//*****************************************************************************
//*****************************************************************************
-class tCopyright : public tMetaEvent
+class JZCopyrightEvent : public JZMetaEvent
{
public:
- tCopyright(int Clock, unsigned char* pData, unsigned short Length)
- : tMetaEvent(Clock, StatCopyright, pData, Length)
+ JZCopyrightEvent(int Clock, unsigned char* pData, unsigned short Length)
+ : JZMetaEvent(Clock, StatCopyright, pData, Length)
{
}
- virtual tCopyright* IsCopyright()
+ virtual JZCopyrightEvent* IsCopyright()
{
edb();
return this;
@@ -1349,18 +1348,18 @@
virtual JZEvent* Copy() const
{
edb();
- return new tCopyright(mClock, mpD...
[truncated message content] |
|
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.
|
|
From: <pst...@us...> - 2010-04-26 02:08:58
|
Revision: 757
http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=757&view=rev
Author: pstieber
Date: 2010-04-26 02:08:50 +0000 (Mon, 26 Apr 2010)
Log Message:
-----------
1. Added new versions of the set temp and meter change dialog boxes.
2. Removed the old settings dialog.
3. Added the Misc menu to the track frame.
Modified Paths:
--------------
trunk/jazz/src/Dialogs.cpp
trunk/jazz/src/Dialogs.h
trunk/jazz/src/EventFrame.cpp
trunk/jazz/src/EventWindow.cpp
trunk/jazz/src/EventWindow.h
trunk/jazz/src/Makefile.am
trunk/jazz/src/PianoFrame.cpp
trunk/jazz/src/Resources.h
trunk/jazz/src/TrackFrame.cpp
trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj
Added Paths:
-----------
trunk/jazz/src/Dialogs/MeterChangeDialog.cpp
trunk/jazz/src/Dialogs/MeterChangeDialog.h
trunk/jazz/src/Dialogs/SetTempoDialog.cpp
trunk/jazz/src/Dialogs/SetTempoDialog.h
Added: trunk/jazz/src/Dialogs/MeterChangeDialog.cpp
===================================================================
--- trunk/jazz/src/Dialogs/MeterChangeDialog.cpp (rev 0)
+++ trunk/jazz/src/Dialogs/MeterChangeDialog.cpp 2010-04-26 02:08:50 UTC (rev 757)
@@ -0,0 +1,82 @@
+#include "MeterChangeDialog.h"
+
+#include "../Globals.h"
+#include "../Help.h"
+
+#include <wx/button.h>
+#include <wx/combobox.h>
+#include <wx/sizer.h>
+
+//*****************************************************************************
+//*****************************************************************************
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+BEGIN_EVENT_TABLE(JZMeterChangeDialog, wxDialog)
+
+ EVT_BUTTON(wxID_HELP, JZMeterChangeDialog::OnHelp)
+
+END_EVENT_TABLE()
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+JZMeterChangeDialog::JZMeterChangeDialog(wxWindow* pParent)
+ : wxDialog(pParent, wxID_ANY, wxString("Meter Change")),
+ mpNumeratorComboBox(0),
+ mpDenominatorComboBox(0)
+{
+ mpNumeratorComboBox = new wxComboBox(this, wxID_ANY);
+ mpNumeratorComboBox->Append("1");
+ mpNumeratorComboBox->Append("2");
+ mpNumeratorComboBox->Append("3");
+ mpNumeratorComboBox->Append("4");
+ mpNumeratorComboBox->Append("5");
+ mpNumeratorComboBox->Append("6");
+ mpNumeratorComboBox->Append("7");
+ mpNumeratorComboBox->Append("8");
+ mpNumeratorComboBox->Append("9");
+ mpNumeratorComboBox->Append("10");
+ mpNumeratorComboBox->Append("11");
+ mpNumeratorComboBox->Append("12");
+ mpNumeratorComboBox->Append("13");
+ mpNumeratorComboBox->Append("14");
+ mpNumeratorComboBox->Append("15");
+ mpNumeratorComboBox->Append("16");
+ mpNumeratorComboBox->Append("17");
+
+ mpDenominatorComboBox = new wxComboBox(this, wxID_ANY);
+ mpDenominatorComboBox->Append("2");
+ mpDenominatorComboBox->Append("4");
+ mpDenominatorComboBox->Append("8");
+ mpDenominatorComboBox->Append("16");
+ mpDenominatorComboBox->Append("32");
+
+ 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);
+
+ 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(mpNumeratorComboBox, 0, wxALIGN_CENTER | wxALL, 6);
+ pTopSizer->Add(mpDenominatorComboBox, 0, wxALIGN_CENTER | wxALL, 6);
+
+ pTopSizer->Add(pButtonSizer, 0, wxALIGN_CENTER | wxBOTTOM, 6);
+
+ SetAutoLayout(true);
+ SetSizer(pTopSizer);
+
+ pTopSizer->SetSizeHints(this);
+ pTopSizer->Fit(this);
+}
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+void JZMeterChangeDialog::OnHelp(wxCommandEvent& Event)
+{
+ gpHelpInstance->ShowTopic("Meterchange");
+}
Property changes on: trunk/jazz/src/Dialogs/MeterChangeDialog.cpp
___________________________________________________________________
Added: svn:eol-style
+ native
Added: trunk/jazz/src/Dialogs/MeterChangeDialog.h
===================================================================
--- trunk/jazz/src/Dialogs/MeterChangeDialog.h (rev 0)
+++ trunk/jazz/src/Dialogs/MeterChangeDialog.h 2010-04-26 02:08:50 UTC (rev 757)
@@ -0,0 +1,49 @@
+//*****************************************************************************
+// 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_METERCHANGEDIALOG_H
+#define JZ_METERCHANGEDIALOG_H
+
+#include <wx/dialog.h>
+
+class wxComboBox;
+
+//*****************************************************************************
+//*****************************************************************************
+class JZMeterChangeDialog : public wxDialog
+{
+ public:
+
+ JZMeterChangeDialog(wxWindow* pParent);
+
+ private:
+
+ void OnHelp(wxCommandEvent& Event);
+
+ private:
+
+ wxComboBox* mpNumeratorComboBox;
+
+ wxComboBox* mpDenominatorComboBox;
+
+ DECLARE_EVENT_TABLE();
+};
+
+#endif // !defined(JZ_METERCHANGEDIALOG_H)
Property changes on: trunk/jazz/src/Dialogs/MeterChangeDialog.h
___________________________________________________________________
Added: svn:eol-style
+ native
Added: trunk/jazz/src/Dialogs/SetTempoDialog.cpp
===================================================================
--- trunk/jazz/src/Dialogs/SetTempoDialog.cpp (rev 0)
+++ trunk/jazz/src/Dialogs/SetTempoDialog.cpp 2010-04-26 02:08:50 UTC (rev 757)
@@ -0,0 +1,143 @@
+//*****************************************************************************
+// 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 "SetTempoDialog.h"
+
+#include "../Events.h"
+#include "../Globals.h"
+#include "../Help.h"
+#include "IntegerEdit.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(JZSetTempoDialog, wxDialog)
+
+EVT_BUTTON(wxID_HELP, JZSetTempoDialog::OnHelp)
+
+END_EVENT_TABLE()
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+JZSetTempoDialog::JZSetTempoDialog(
+ tSetTempo* pSetTempoEvent,
+ JZTrack* pTrack,
+ wxWindow * pParent)
+ : wxDialog(pParent, wxID_ANY, wxString("Set Tempo (for track 0)")),
+ mpSetTempoEvent(pSetTempoEvent),
+ mpTempoEdit(0),
+ mpClockEdit(0)
+{
+ mpTempoEdit = new JZIntegerEdit(this, wxID_ANY);
+ mpTempoEdit->SetValueName("Tempo");
+ mpTempoEdit->SetMinAndMax(20, 240);
+
+ 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, "Tempo:"),
+ 0,
+ wxALIGN_CENTER_VERTICAL);
+ pFlexGridSizer->Add(
+ mpTempoEdit,
+ 0,
+ wxALIGN_CENTER_VERTICAL);
+
+ pFlexGridSizer->Add(
+ new wxStaticText(this, wxID_ANY, "Clock:"),
+ 0,
+ wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
+ pFlexGridSizer->Add(mpClockEdit, 0, wxALIGN_CENTER_VERTICAL);
+
+ pTopSizer->Add(pFlexGridSizer, 0, wxCENTER | wxALL, 10);
+
+ 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 JZSetTempoDialog::TransferDataToWindow()
+{
+ mpTempoEdit->SetNumber(mpSetTempoEvent->GetBPM());
+
+ string ClockString;
+ gpProject->ClockToString(mpSetTempoEvent->GetClock(), ClockString);
+ mpClockEdit->ChangeValue(ClockString.c_str());
+
+ return true;
+}
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+bool JZSetTempoDialog::TransferDataFromWindow()
+{
+ int BeatsPerMinute;
+ if (mpTempoEdit->GetNumber(BeatsPerMinute))
+ {
+ mpSetTempoEvent->SetBPM(BeatsPerMinute);
+
+ wxString ClockString = mpClockEdit->GetValue();
+ int Clock = gpProject->StringToClock(ClockString.c_str());
+ mpSetTempoEvent->SetClock(Clock);
+
+ return true;
+ }
+ return false;
+}
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+void JZSetTempoDialog::OnHelp(wxCommandEvent& Event)
+{
+ gpHelpInstance->ShowTopic("Set Tempo Dialog");
+}
Property changes on: trunk/jazz/src/Dialogs/SetTempoDialog.cpp
___________________________________________________________________
Added: svn:eol-style
+ native
Added: trunk/jazz/src/Dialogs/SetTempoDialog.h
===================================================================
--- trunk/jazz/src/Dialogs/SetTempoDialog.h (rev 0)
+++ trunk/jazz/src/Dialogs/SetTempoDialog.h 2010-04-26 02:08:50 UTC (rev 757)
@@ -0,0 +1,61 @@
+//*****************************************************************************
+// 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_SETTEMPODIALOG_H
+#define JZ_SETTEMPODIALOG_H
+
+#include <wx/dialog.h>
+
+class JZIntegerEdit;
+class JZTrack;
+class tSetTempo;
+class wxTextCtrl;
+
+//*****************************************************************************
+//*****************************************************************************
+class JZSetTempoDialog : public wxDialog
+{
+ public:
+
+ JZSetTempoDialog(
+ tSetTempo* pSetTempoEvent,
+ JZTrack* pTrack,
+ wxWindow* pParent);
+
+ private:
+
+ bool TransferDataToWindow();
+
+ bool TransferDataFromWindow();
+
+ void OnHelp(wxCommandEvent& Event);
+
+ private:
+
+ tSetTempo* mpSetTempoEvent;
+
+ JZIntegerEdit* mpTempoEdit;
+
+ wxTextCtrl* mpClockEdit;
+
+ DECLARE_EVENT_TABLE();
+};
+
+#endif // !defined(JZ_SETTEMPODIALOG_H)
Property changes on: trunk/jazz/src/Dialogs/SetTempoDialog.h
___________________________________________________________________
Added: svn:eol-style
+ native
Modified: trunk/jazz/src/Dialogs.cpp
===================================================================
--- trunk/jazz/src/Dialogs.cpp 2010-04-25 23:59:43 UTC (rev 756)
+++ trunk/jazz/src/Dialogs.cpp 2010-04-26 02:08:50 UTC (rev 757)
@@ -28,6 +28,8 @@
#include "Dialogs/ControllerDialog.h"
#include "Dialogs/KeyOnDialog.h"
#include "Dialogs/ProgramChangeDialog.h"
+#include "Dialogs/SetTempoDialog.h"
+#include "Dialogs/SysexDialog.h"
//#include "EventFrame.h"
#include "Events.h"
#include "EventWindow.h"
@@ -112,7 +114,7 @@
//int tSearchReplaceDlg::toCtrl = 1;
//
//tSearchReplaceDlg::tSearchReplaceDlg(JZEventWindow* w, JZFilter *f)
-// : tPropertyListDlg("Search and replace controller types" )
+// : tPropertyListDlg("Search and replace controller types")
//{
// Filter = f;
// Song = f->GetSong();
@@ -265,7 +267,7 @@
JZEvent *Event;
JZEvent *Copy;
- tEventDlg(JZEvent *e, JZPianoWindow* w, JZTrack *t);
+ tEventDlg(JZEvent *e, JZPianoWindow* w, JZTrack *pTrack);
virtual void AddProperties();
virtual bool OnClose();
virtual void OnHelp();
@@ -273,12 +275,12 @@
};
-tEventDlg::tEventDlg(JZEvent *e, JZPianoWindow* w, JZTrack *t)
+tEventDlg::tEventDlg(JZEvent *e, JZPianoWindow* w, JZTrack *pTrack)
: tPropertyListDlg( "Event" ),
ClockDlg(w->GetProject(), "Time ", e->GetClock())
{
Win = w;
- Track = t;
+ Track = pTrack;
Event = e;
Copy = e->Copy();
}
@@ -318,8 +320,8 @@
int Channel;
- tChEventDlg(tChannelEvent* pChannelEvent, JZPianoWindow* w, JZTrack *t)
- : tEventDlg(pChannelEvent, w, t)
+ tChEventDlg(tChannelEvent* pChannelEvent, JZPianoWindow* w, JZTrack *pTrack)
+ : tEventDlg(pChannelEvent, w, pTrack)
{
Channel = pChannelEvent->GetChannel() + 1; // 1..16
}
@@ -353,15 +355,15 @@
int Value;
- tPitchDlg(tPitch* e, JZPianoWindow* w, JZTrack *t);
+ tPitchDlg(tPitch* e, JZPianoWindow* w, JZTrack *pTrack);
void AddProperties();
bool OnClose();
};
-tPitchDlg::tPitchDlg(tPitch *e, JZPianoWindow* w, JZTrack *t)
- : tChEventDlg(e, w, t)
+tPitchDlg::tPitchDlg(tPitch *e, JZPianoWindow* w, JZTrack *pTrack)
+ : tChEventDlg(e, w, pTrack)
{
Event = e;
Value = e->Value;
@@ -398,15 +400,15 @@
tNamedChoice Choice;
- tPlayTrackDlg(tPlayTrack *e, JZPianoWindow* w, JZTrack *t);
+ tPlayTrackDlg(tPlayTrack *e, JZPianoWindow* w, JZTrack *pTrack);
void AddProperties();
bool OnClose();
};
-tPlayTrackDlg::tPlayTrackDlg(tPlayTrack *e, JZPianoWindow* w, JZTrack *t)
- : tEventDlg(e, w, t),
+tPlayTrackDlg::tPlayTrackDlg(tPlayTrack *e, JZPianoWindow* w, JZTrack *pTrack)
+ : tEventDlg(e, w, pTrack),
Choice("playtrack", gpConfig->GetControlNames(), &track)
{
Event = e;
@@ -457,15 +459,15 @@
int track;
tNamedChoice Choice;
- tTextDlg(tText *e, JZPianoWindow* w, JZTrack *t);
+ tTextDlg(tText *e, JZPianoWindow* w, JZTrack *pTrack);
void AddProperties();
bool OnClose();
};
-tTextDlg::tTextDlg(tText *e, JZPianoWindow* w, JZTrack *t)
- : tEventDlg(e, w, t),
+tTextDlg::tTextDlg(tText *e, JZPianoWindow* w, JZTrack *pTrack)
+ : tEventDlg(e, w, pTrack),
Choice("text", gpConfig->GetControlNames(), &track)
{
Event = e;
@@ -504,15 +506,15 @@
tNamedChoice Choice;
- tEndOfTrackDlg(tEndOfTrack *e, JZPianoWindow* w, JZTrack *t);
+ tEndOfTrackDlg(tEndOfTrack *e, JZPianoWindow* w, JZTrack *pTrack);
void AddProperties();
bool OnClose();
};
-tEndOfTrackDlg::tEndOfTrackDlg(tEndOfTrack *e, JZPianoWindow* w, JZTrack *t)
- : tEventDlg(e, w, t),
+tEndOfTrackDlg::tEndOfTrackDlg(tEndOfTrack *e, JZPianoWindow* w, JZTrack *pTrack)
+ : tEventDlg(e, w, pTrack),
Choice("End Of Track", gpConfig->GetControlNames(), &track)
{
@@ -532,211 +534,22 @@
}
-
-// -------------------------------- Set Tempo -------------------------------
-
-class tSetTempoDlg : public tEventDlg
+//*****************************************************************************
+// Description:
+// Display a dialog box to select an event to be created.
+//*****************************************************************************
+static JZEvent* CreateEventDialog(long Clock, int Channel, int Pitch)
{
- public:
-
- int Value;
-
- tSetTempoDlg(tSetTempo *e, JZPianoWindow* w, JZTrack *t);
-
- void AddProperties();
- bool OnClose();
-};
-
-
-tSetTempoDlg::tSetTempoDlg(tSetTempo *e, JZPianoWindow* w, JZTrack *t)
- : tEventDlg(e, w, t)
-{
- Event = e;
- Value = e->GetBPM();
-}
-
-
-bool tSetTempoDlg::OnClose()
-{
- ((tSetTempo *)Copy)->SetBPM( Value );
- return tEventDlg::OnClose();
-}
-
-void tSetTempoDlg::AddProperties()
-{
- // Add(wxMakeFormShort("Tempo:", &Value, wxFORM_DEFAULT, new wxList(wxMakeConstraintRange(20.0, 240.0), 0)));
- sheet->AddProperty(new wxProperty(
- "Tempo",
- wxPropertyValue(&Value),
- "integer",
- new wxIntegerListValidator(20, 240)));
- tEventDlg::AddProperties();
-}
-
-// -------------------------------- Sysex Edit-------------------------------
-
-class tSysexDlg : public tEventDlg
-{
- public:
-
- char *str;
-
- tSysexDlg(tSysEx *s, JZPianoWindow* w, JZTrack *t);
-
- void AddProperties();
- bool OnClose();
-};
-
-
-tSysexDlg::tSysexDlg(tSysEx* pSysEx, JZPianoWindow* w, JZTrack *t)
- : tEventDlg(pSysEx, w, t)
-{
- Event = pSysEx;
- char hexbyte[10];
-
- str = new char[256];
- str[0] = 0;
-
- if (pSysEx->GetDataLength())
- {
- strcat(str, "f0 ");
- }
-
- const unsigned char* pData = pSysEx->GetData();
- for (int i = 0; i < pSysEx->GetDataLength(); i++)
- {
- sprintf(hexbyte, "%02x ", pData[i]);
- strcat(str, hexbyte);
- }
-}
-
-
-bool tSysexDlg::OnClose()
-{
- int i;
- int j;
- int k;
- int len;
-
- unsigned char d[256];
- memset( d, 0, 256 );
-
- int jstop = strlen(str);
-
- unsigned int TempInteger;
- for (i = 0, j = 0; j <= jstop; j += k, ++i)
- {
- sscanf(str + j, "%02x %n", &TempInteger, &k);
-
- d[i] = static_cast<unsigned char>(TempInteger);
- if (d[i] == 0xf7)
- break;
- }
-
- int found = 0;
- for (i = 0; i < 256; i++)
- {
- if (d[i] == 0xf7)
- {
- found = 1;
- break;
- }
- }
-
- if (found)
- len = i + 1;
- else
- len = 0;
-
- long clk = ((tSysEx *)Copy)->GetClock();
- delete Copy;
- Copy = new tSysEx( clk, d + 1, len - 1 );
-
- gpSynth->FixSysexCheckSum( Copy->IsSysEx() );
-
-#if 0
- printf("Sysex:");
- for (i = 0; i < ((tSysEx *)Copy)->Length; i++)
- {
- printf( "%02x ", ((tSysEx *)Copy)->Data[i] );
- }
- printf("\n");
-
- gpMidiPlayer->OutNow( (tSysEx *)Copy );
-#endif
-
- delete str;
-
- tEventDlg::OnClose();
- return false;
-}
-
-void tSysexDlg::AddProperties()
-{
-// char label1[100];
-
- if (Event->IsSysEx()->GetDataLength())
- {
-// sprintf(
-// label1,
-// "Loaded sysex: %s",
-// tSynthSysex::GetSysexName(gpSynth->GetSysexId(Event->IsSysEx())));
-
-// Add(wxMakeFormMessage(label1));
-
- sheet->AddProperty(new wxProperty(
- "Loaded sysex",
- wxPropertyValue(tSynthSysex::GetSysexName(gpSynth->GetSysexId(
- Event->IsSysEx()))),
- "string"));//r/o
-
- const unsigned char* pData = gpSynth->GetSysexValPtr(Event->IsSysEx());
-
- if (pData)
- {
- ostringstream Oss;
- Oss
- << "First data byte is at offset "
- << pData - Event->IsSysEx()->GetData() + 1 << ", value "
- << setw(2) << hex << static_cast<int>(*pData)
- << dec << " (" << static_cast<int>(*pData) << " decimal)";
- sheet->AddProperty(new wxProperty(
- Oss.str().c_str(),
- wxPropertyValue((char*)""),
- "string"));//r/o
-// Add(wxMakeFormMessage(Oss.str().c_str()));
- }
- }
- else
- {
-// Add(wxMakeFormMessage("Example input: f0 7f 7f 04 01 00 7f f7"));
- }
-
-// Add(wxMakeFormMessage("(any DT1/RQ1 checksums will be corrected)"));
-
-// Add(wxMakeFormString("SysEx (hex):", &str, wxFORM_DEFAULT, NULL, NULL, wxVERTICAL, 300 ));
- sheet->AddProperty(new wxProperty("SysEx (hex)", wxPropertyValue((char**)&str), "string"));//r/o
-
- tEventDlg::AddProperties();
-}
-
-
-// --------------------------------------------------------------------------
-// create new event
-// --------------------------------------------------------------------------
-
-static JZEvent *CreateEventDialog(long Clock, int Channel, int Pitch)
-{
wxArrayString Names;
Names.Add("Note On");
- Names.Add( "Controller");
- Names.Add( "Program Change");
- Names.Add( "Set Tempo");
- Names.Add( "SysEx");
- Names.Add( "Play Track(experimental)");
+ Names.Add("Controller");
+ Names.Add("Program Change");
+ Names.Add("Set Tempo");
+ Names.Add("SysEx");
+ Names.Add("Play Track(experimental)");
Names.Add("End Of Track");
- Names.Add( "Text" );
+ Names.Add("Text");
static long Values[] =
{
@@ -795,51 +608,56 @@
return e;
}
-
-
-
+//*****************************************************************************
+// Description:
+// Display a dialog box to select an event to be created.
+//*****************************************************************************
void EventDialog(
- JZEvent* e,
+ JZEvent* pEvent,
JZPianoWindow* pPianoWindow,
- JZTrack* t,
+ JZTrack* pTrack,
long Clock,
int Channel,
int Pitch)
{
- if (!e)
- e = CreateEventDialog(Clock, Channel, Pitch);
- if (!e)
+ if (!pEvent)
+ {
+ pEvent = CreateEventDialog(Clock, Channel, Pitch);
+ }
+
+ if (!pEvent)
+ {
return;
+ }
- tEventDlg *dlg = 0;
+ tEventDlg* pDialog = 0;
const char* str = 0;
- switch (e->GetStat())
+ switch (pEvent->GetStat())
{
case StatKeyOn:
- if (t->GetAudioMode())
+ if (pTrack->GetAudioMode())
{
if (!gpMidiPlayer->IsPlaying())
{
- gpMidiPlayer->EditSample(e->IsKeyOn()->GetKey());
+ gpMidiPlayer->EditSample(pEvent->IsKeyOn()->GetKey());
}
break;
}
- str = "Key On";
-// dlg = new tKeyOnDlg(e->IsKeyOn(), pPianoWindow, t);
+
+// pDialog = new tKeyOnDlg(pEvent->IsKeyOn(), pPianoWindow, pTrack);
{
- JZKeyOnDialog KeyOnDialog(e->IsKeyOn(), pPianoWindow);
+ JZKeyOnDialog KeyOnDialog(pEvent->IsKeyOn(), pPianoWindow);
KeyOnDialog.ShowModal();
}
break;
case StatPitch:
str = "Pitch Wheel";
- dlg = new tPitchDlg(e->IsPitch(), pPianoWindow, t);
+ pDialog = new tPitchDlg(pEvent->IsPitch(), pPianoWindow, pTrack);
break;
case StatControl:
-// str = "Controller";
-// dlg = new tControlDlg(e->IsControl(), pPianoWindow, t);
+// pDialog = new tControlDlg(pEvent->IsControl(), pPianoWindow, pTrack);
{
JZControllerDialog ControllerDialog(pPianoWindow);
ControllerDialog.ShowModal();
@@ -847,8 +665,7 @@
break;
case StatProgram:
-// str = "Program Change";
-// dlg = new tProgramDlg(e->IsProgram(), pPianoWindow, t);
+// pDialog = new tProgramDlg(pEvent->IsProgram(), pPianoWindow, pTrack);
{
JZProgramChangeDialog ProgramChangeDialog(pPianoWindow);
ProgramChangeDialog.ShowModal();
@@ -856,88 +673,45 @@
break;
case StatSetTempo:
- str = "Set Tempo (for track 0)";
- dlg = new tSetTempoDlg(
- e->IsSetTempo(),
- pPianoWindow,
- pPianoWindow->GetProject()->GetTrack(0));
+ {
+ JZSetTempoDialog SetTempoDialog(
+ pEvent->IsSetTempo(),
+ pPianoWindow->GetProject()->GetTrack(0),
+ pPianoWindow);
+ SetTempoDialog.ShowModal();
+ }
break;
case StatSysEx:
- str = "System Exclusive";
- dlg = new tSysexDlg(e->IsSysEx(), pPianoWindow, t );
+// pDialog = new tSysexDlg(pEvent->IsSysEx(), pPianoWindow, pTrack);
+ {
+ JZSysexDialog SysexDialog(pEvent->IsSysEx(), pPianoWindow);
+ SysexDialog.ShowModal();
+ }
break;
case StatPlayTrack:
str = "Play Track";
- //dlg = new tPlayTrackDlg(e->IsPlayTrack(), pPianoWindow, t );
- dlg = new tPlayTrackDlg(e->IsPlayTrack(), pPianoWindow, t );
+ pDialog = new tPlayTrackDlg(pEvent->IsPlayTrack(), pPianoWindow, pTrack);
break;
+
case StatEndOfTrack:
str = "End Of Track";
- dlg = new tEndOfTrackDlg(e->IsEndOfTrack(), pPianoWindow, t );
+ pDialog = new tEndOfTrackDlg(pEvent->IsEndOfTrack(), pPianoWindow, pTrack);
break;
case StatText:
str = "Text";
- dlg = new tTextDlg(e->IsText(), pPianoWindow, t );
+ pDialog = new tTextDlg(pEvent->IsText(), pPianoWindow, pTrack);
break;
default:
break;
}
- if (dlg)
+
+ if (pDialog)
{
- dlg->Create();
+ pDialog->Create();
}
}
-
-//*****************************************************************************
-// MeterChange Dialog
-//*****************************************************************************
-
-int tMeterChangeDlg::Numerator = 4;
-int tMeterChangeDlg::Denomiator = 4;
-int tMeterChangeDlg::BarNr = 1;
-
-tMeterChangeDlg::tMeterChangeDlg(JZEventWindow* pEventWindow)
- : tPropertyListDlg("Meter Change"),
- mpEventWindow(pEventWindow)
-{
-}
-
-void tMeterChangeDlg::AddProperties()
-{
- sheet->AddProperty(new wxProperty(
- "BarNr",
- wxPropertyValue(&BarNr),
- "integer"));//JAVE validators here? problem is i dont know which ranges are valid FIXME
- sheet->AddProperty(new wxProperty(
- "Numerator",
- wxPropertyValue(&Numerator),
- "integer"));
- sheet->AddProperty(new wxProperty(
- "Denomiator(2,4,8,16,32)",
- wxPropertyValue(&Denomiator),
- "integer"));//JAVE should be a integer list instead FIXME
-}
-
-void tMeterChangeDlg::OnCancel()
-{
- mpEventWindow->FinishMeterEdit();
-}
-
-bool tMeterChangeDlg::OnClose()
-{
- BarNr += mpEventWindow->GetProject()->GetIntroLength();
- mpEventWindow->GetProject()->SetMeterChange(BarNr, Numerator, Denomiator);
- mpEventWindow->Refresh();
- mpEventWindow->FinishMeterEdit();
- return false;
-}
-
-void tMeterChangeDlg::OnHelp()
-{
- gpHelpInstance->ShowTopic("Meterchange");
-}
Modified: trunk/jazz/src/Dialogs.h
===================================================================
--- trunk/jazz/src/Dialogs.h 2010-04-25 23:59:43 UTC (rev 756)
+++ trunk/jazz/src/Dialogs.h 2010-04-26 02:08:50 UTC (rev 757)
@@ -111,25 +111,4 @@
int Channel,
int Pitch);
-//*****************************************************************************
-// MeterChange Dialog
-//*****************************************************************************
-class tMeterChangeDlg : public tPropertyListDlg
-{
- public:
-
- tMeterChangeDlg(JZEventWindow* pEventWindow);
-
- void AddProperties();
-
- virtual bool OnClose();
- virtual void OnCancel();
- virtual void OnHelp();
-
- JZEventWindow* mpEventWindow;
- static int Numerator;
- static int Denomiator;
- static int BarNr;
-};
-
#endif // !defined(JZ_DIALOGS_H)
Modified: trunk/jazz/src/EventFrame.cpp
===================================================================
--- trunk/jazz/src/EventFrame.cpp 2010-04-25 23:59:43 UTC (rev 756)
+++ trunk/jazz/src/EventFrame.cpp 2010-04-26 02:08:50 UTC (rev 757)
@@ -63,7 +63,8 @@
EVT_UPDATE_UI(ID_LENGTH, JZEventFrame::OnUpdateEventsSelected)
EVT_MENU(ID_LENGTH, JZEventFrame::OnLength)
- EVT_MENU(ID_METER_CHANGE, JZEventFrame::OnMeterChange)
+ EVT_MENU(ID_MISC_METER_CHANGE, JZEventFrame::OnMeterChange)
+
END_EVENT_TABLE()
//-----------------------------------------------------------------------------
Modified: trunk/jazz/src/EventWindow.cpp
===================================================================
--- trunk/jazz/src/EventWindow.cpp 2010-04-25 23:59:43 UTC (rev 756)
+++ trunk/jazz/src/EventWindow.cpp 2010-04-26 02:08:50 UTC (rev 757)
@@ -26,6 +26,7 @@
#include "Dialogs/CleanupDialog.h"
#include "Dialogs/DeleteDialog.h"
#include "Dialogs/LengthDialog.h"
+#include "Dialogs/MeterChangeDialog.h"
#include "Dialogs/MidiChannelDialog.h"
#include "Dialogs/QuantizeDialog.h"
#include "Dialogs/SearchAndReplaceDialog.h"
@@ -90,8 +91,7 @@
mFromLine(0),
mToLine(0),
mScrolledX(0),
- mScrolledY(0),
- mpSettingsDialog(0)
+ mScrolledY(0)
{
mpSnapSel = new JZSnapSelection(this);
@@ -114,7 +114,6 @@
delete mpFilter;
delete mpGreyColor;
delete mpGreyBrush;
- FinishMeterEdit();
}
//-----------------------------------------------------------------------------
@@ -346,47 +345,11 @@
//-----------------------------------------------------------------------------
void JZEventWindow::EditMeter()
{
- if (!IsEditingMeter())
- {
- if (!mpSettingsDialog)
- {
- mpSettingsDialog = new wxDialog(this, wxID_ANY, "Meter Change");
- }
- mpSettingsDialog->Show(true);
- }
- else
- {
- mpSettingsDialog->SetFocus();
- }
-// tMeterChangeDlg *dlg;
-// dlg = new tMeterChangeDlg(this);
-// dlg->Create();
+ JZMeterChangeDialog MeterChangeDialog(this);
+ MeterChangeDialog.ShowModal();
}
//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-bool JZEventWindow::IsEditingMeter() const
-{
- if (mpSettingsDialog)
- {
- return (mpSettingsDialog->GetHandle() != 0);
- }
- return false;
-}
-
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-void JZEventWindow::FinishMeterEdit()
-{
- if (mpSettingsDialog)
- {
- // Mark the dialog for destruction during idle time processing.
- mpSettingsDialog->Destroy();
- mpSettingsDialog = 0;
- }
-}
-
-//-----------------------------------------------------------------------------
// Description:
// Only consider the event portion of the window when computing the virtual
// size. Do not consider the static information of the left or top portion of
Modified: trunk/jazz/src/EventWindow.h
===================================================================
--- trunk/jazz/src/EventWindow.h 2010-04-25 23:59:43 UTC (rev 756)
+++ trunk/jazz/src/EventWindow.h 2010-04-26 02:08:50 UTC (rev 757)
@@ -76,8 +76,6 @@
void SearchReplace();
void EditMeter();
- bool IsEditingMeter() const;
- void FinishMeterEdit();
void LineText(
wxDC& Dc,
@@ -148,9 +146,6 @@
int mScrolledX, mScrolledY;
- // Settings-Dialog
- wxDialog* mpSettingsDialog;
-
DECLARE_EVENT_TABLE()
};
Modified: trunk/jazz/src/Makefile.am
===================================================================
--- trunk/jazz/src/Makefile.am 2010-04-25 23:59:43 UTC (rev 756)
+++ trunk/jazz/src/Makefile.am 2010-04-26 02:08:50 UTC (rev 757)
@@ -29,11 +29,13 @@
Dialogs/IntegerEdit.cpp \
Dialogs/LengthDialog.cpp \
Dialogs/KeyOnDialog.cpp \
+Dialogs/MeterChangeDialog.cpp \
Dialogs/MetronomeSettingsDialog.cpp \
Dialogs/MidiChannelDialog.cpp \
Dialogs/ProgramChangeDialog.cpp \
Dialogs/QuantizeDialog.cpp \
Dialogs/SearchAndReplaceDialog.cpp \
+Dialogs/SetTempoDialog.cpp \
Dialogs/ShiftDialog.cpp \
Dialogs/SnapDialog.cpp \
Dialogs/SynthesizerSettingsDialog.cpp \
@@ -120,11 +122,13 @@
Dialogs/IntegerEdit.cpp \
Dialogs/LengthDialog.cpp \
Dialogs/KeyOnDialog.cpp \
+Dialogs/MeterChangeDialog.cpp \
Dialogs/MetronomeSettingsDialog.cpp \
Dialogs/MidiChannelDialog.cpp \
Dialogs/ProgramChangeDialog.cpp \
Dialogs/QuantizeDialog.cpp \
Dialogs/SearchAndReplaceDialog.cpp \
+Dialogs/SetTempoDialog.cpp \
Dialogs/ShiftDialog.cpp \
Dialogs/SnapDialog.cpp \
Dialogs/SynthesizerSettingsDialog.cpp \
@@ -216,11 +220,13 @@
Dialogs/IntegerEdit.h \
Dialogs/LengthDialog.h \
Dialogs/KeyOnDialog.h \
+Dialogs/MeterChangeDialog.h \
Dialogs/MetronomeSettingsDialog.h \
Dialogs/MidiChannelDialog.h \
Dialogs/ProgramChangeDialog.h \
Dialogs/QuantizeDialog.h \
Dialogs/SearchAndReplaceDialog.h \
+Dialogs/SetTempoDialog.h \
Dialogs/ShiftDialog.h \
Dialogs/SnapDialog.h \
Dialogs/SynthesizerSettingsDialog.h \
Modified: trunk/jazz/src/PianoFrame.cpp
===================================================================
--- trunk/jazz/src/PianoFrame.cpp 2010-04-25 23:59:43 UTC (rev 756)
+++ trunk/jazz/src/PianoFrame.cpp 2010-04-26 02:08:50 UTC (rev 757)
@@ -69,7 +69,6 @@
#define MEN_GUITAR 29
-#define MEN_RESET 36
#define MEN_VIS_ALL_TRK 37
#define ACT_CLOSE 41
@@ -108,8 +107,8 @@
{ wxID_ZOOM_OUT, FALSE, zoomout_xpm, "zoom out"},
{ wxID_UNDO, FALSE, undo_xpm, "undo"},
{ MEN_REDO, FALSE, redo_xpm, "redo"},
- { MEN_RESET, FALSE, panic_xpm, "all notes off"},
- { ID_HELP_PIANO_WINDOW, FALSE, help_xpm, "help"},
+ { ID_MISC_RESET_MIDI, FALSE, panic_xpm, "all notes off"},
+ { ID_HELP_PIANO_WINDOW, FALSE, help_xpm, "help"},
{ JZToolBar::eToolBarEnd }
};
*/
@@ -156,7 +155,7 @@
EVT_MENU(ID_CUT_PASTE_EVENTS, JZPianoFrame::OnMCutPaste)
EVT_MENU(MEN_GUITAR, JZPianoFrame::OnGuitar)
- EVT_MENU(MEN_RESET, JZPianoFrame::OnReset)
+ EVT_MENU(ID_MISC_RESET_MIDI, JZPianoFrame::OnReset)
EVT_MENU(MEN_VIS_ALL_TRK, JZPianoFrame::OnVisibleAllTracks)
EVT_MENU(wxID_DELETE, JZPianoFrame::OnErase)
EVT_MENU(wxID_CUT, JZPianoFrame::OnCut)
@@ -339,11 +338,11 @@
edit_menu->Append(ID_SEARCH_AND_REPLACE, "&Search Replace...");
wxMenu *setting_menu = new wxMenu("", wxMENU_TEAROFF);
- setting_menu->Append(MEN_FILTER, "&Filter...");
- setting_menu->Append(ACT_SETTINGS, "&Window...");
- setting_menu->Append(MEN_VISIBLE, "&Events...");
- setting_menu->Append(ID_SNAP, "&Snap...");
- setting_menu->Append(ID_METER_CHANGE, "&Meter Change...");
+ setting_menu->Append(MEN_FILTER, "&Filter...");
+ setting_menu->Append(ACT_SETTINGS, "&Window...");
+ setting_menu->Append(MEN_VISIBLE, "&Events...");
+ setting_menu->Append(ID_SNAP, "&Snap...");
+ setting_menu->Append(ID_MISC_METER_CHANGE, "&Meter Change...");
wxMenu *misc_menu = new wxMenu("",wxMENU_TEAROFF);
misc_menu->Append(wxID_UNDO, "&Undo");
@@ -498,18 +497,6 @@
gpMidiPlayer->AllNotesOff(1);
}
-//INSER_EVENT_HANDLER_HERE
-
-/*
-
-//these wont compile nicely
-
-case MEN_VISIBLE: VisibleDialog(); break;
-
-case ID_METER_CHANGE: OnMeterChange(); break;
-
-*/
-
void JZPianoFrame::OnMSelect(wxCommandEvent& Event)
{
mpPianoWindow->MSelect();
Modified: trunk/jazz/src/Resources.h
===================================================================
--- trunk/jazz/src/Resources.h 2010-04-25 23:59:43 UTC (rev 756)
+++ trunk/jazz/src/Resources.h 2010-04-26 02:08:50 UTC (rev 757)
@@ -60,16 +60,20 @@
#define ID_METRONOME_TOGGLE wxID_HIGHEST + 43
#define ID_VELOCITY wxID_HIGHEST + 44
#define ID_LENGTH wxID_HIGHEST + 45
-#define ID_METER_CHANGE wxID_HIGHEST + 46
-#define ID_TRANSPOSE wxID_HIGHEST + 47
-#define ID_CLEANUP wxID_HIGHEST + 48
-#define ID_SEARCH_AND_REPLACE wxID_HIGHEST + 49
+#define ID_MISC_TRACK_MERGE wxID_HIGHEST + 46
+#define ID_MISC_SPLIT_TRACKS wxID_HIGHEST + 47
+#define ID_MISC_METER_CHANGE wxID_HIGHEST + 48
+#define ID_MISC_RESET_MIDI wxID_HIGHEST + 49
+#define ID_MISC_SET_COPYRIGHT wxID_HIGHEST + 50
+#define ID_TRANSPOSE wxID_HIGHEST + 51
+#define ID_CLEANUP wxID_HIGHEST + 52
+#define ID_SEARCH_AND_REPLACE wxID_HIGHEST + 53
-#define ID_PLAY wxID_HIGHEST + 50
-#define ID_PLAY_LOOP wxID_HIGHEST + 51
-#define ID_RECORD wxID_HIGHEST + 52
+#define ID_PLAY wxID_HIGHEST + 60
+#define ID_PLAY_LOOP wxID_HIGHEST + 61
+#define ID_RECORD wxID_HIGHEST + 62
-#define ID_SELECT wxID_HIGHEST + 60
+#define ID_SELECT wxID_HIGHEST + 65
#define ID_CHANGE_LENGTH wxID_HIGHEST + 70
Modified: trunk/jazz/src/TrackFrame.cpp
===================================================================
--- trunk/jazz/src/TrackFrame.cpp 2010-04-25 23:59:43 UTC (rev 756)
+++ trunk/jazz/src/TrackFrame.cpp 2010-04-26 02:08:50 UTC (rev 757)
@@ -267,24 +267,22 @@
mpEditMenu->Append(MEN_SELECTIONSUB, "Select (needs submenu)");
mpEditMenu->AppendSeparator();
+#endif
-
- // Miscellaneous Menu is Stupid.
- // Now it's a View Menu
- misc_menu = new wxMenu;
- misc_menu->Append(MEN_TMERGE, "Mer&ge Tracks...");
- misc_menu->Append(MEN_TSPLIT, "&Split Tracks...");
- misc_menu->Append(ID_METER_CHANGE, "&Meter Change...");
- misc_menu->Append(MEN_RESET, "&Reset Midi");
- misc_menu->Append(MEN_HARMONY, "&Harmony Browser...");
- misc_menu->Append(MEN_RHYTHM, "Random R&hythm...");
- misc_menu->Append(MEN_SHUFFLE, "Random Sh&uffle...");
- misc_menu->Append(MEN_GENMELDY, "Random Melod&y...");
- misc_menu->Append(MEN_ARPEGGIO, "Random Arpeggio...");
- misc_menu->Append(MEN_MAPPER, "Ma&pper...");
- misc_menu->Append(MEN_EVENTLIST, "Event &List...");
- misc_menu->Append(MEN_COPYRIGHT, "&Set Music Copyright...");
+ wxMenu* pMiscMenu = new wxMenu;
+ pMiscMenu->Append(ID_MISC_TRACK_MERGE, "Mer&ge Tracks...");
+ pMiscMenu->Append(ID_MISC_SPLIT_TRACKS, "&Split Tracks...");
+ pMiscMenu->Append(ID_MISC_METER_CHANGE, "&Meter Change...");
+ pMiscMenu->Append(ID_MISC_RESET_MIDI, "&Reset Midi");
+#if 0
+ pMiscMenu->Append(MEN_RHYTHM, "Random R&hythm...");
+ pMiscMenu->Append(MEN_SHUFFLE, "Random Sh&uffle...");
+ pMiscMenu->Append(MEN_GENMELDY, "Random Melod&y...");
+ pMiscMenu->Append(MEN_ARPEGGIO, "Random Arpeggio...");
+ pMiscMenu->Append(MEN_MAPPER, "Ma&pper...");
+ pMiscMenu->Append(MEN_EVENTLIST, "Event &List...");
#endif
+ pMiscMenu->Append(ID_MISC_SET_COPYRIGHT, "&Set Music Copyright...");
mpToolsMenu = new wxMenu;
mpToolsMenu->Append(ID_TOOLS_HARMONY_BROWSER, "&Harmony Browser...");
@@ -393,14 +391,12 @@
wxMenuBar* pMenuBar = new wxMenuBar();
pMenuBar->Append(mpFileMenu, "&File");
pMenuBar->Append(mpEditMenu, "&Edit");
- pMenuBar->Append(mpToolsMenu, "&Tools");
-
#if 0
- pMenuBar->Append(misc_menu, "&View");
pMenuBar->Append(parts_menu, "&Parts");
#endif
-
+ pMenuBar->Append(mpToolsMenu, "&Tools");
pMenuBar->Append(pSettingMenu, "&Settings");
+ pMenuBar->Append(pMiscMenu, "&Misc");
wxMenu* pAudioMenu = new wxMenu;
pAudioMenu->Append(ID_AUDIO_GLOBAL_SETTINGS, "&Global Settings...");
Modified: trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj
===================================================================
--- trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj 2010-04-25 23:59:43 UTC (rev 756)
+++ trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj 2010-04-26 02:08:50 UTC (rev 757)
@@ -903,6 +903,14 @@
>
</File>
<File
+ RelativePath="..\src\Dialogs\MeterChangeDialog.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\src\Dialogs\MeterChangeDialog.h"
+ >
+ </File>
+ <File
RelativePath="..\src\Dialogs\MetronomeSettingsDialog.cpp"
>
</File>
@@ -943,6 +951,14 @@
>
</File>
<File
+ RelativePath="..\src\Dialogs\SetTempoDialog.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\src\Dialogs\SetTempoDialog.h"
+ >
+ </File>
+ <File
RelativePath="..\src\Dialogs\ShiftDialog.cpp"
>
</File>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pst...@us...> - 2010-04-25 23:59:49
|
Revision: 756
http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=756&view=rev
Author: pstieber
Date: 2010-04-25 23:59:43 +0000 (Sun, 25 Apr 2010)
Log Message:
-----------
Started adding SysEx specific controls.
Modified Paths:
--------------
trunk/jazz/src/Dialogs/SysexDialog.cpp
trunk/jazz/src/Dialogs/SysexDialog.h
Modified: trunk/jazz/src/Dialogs/SysexDialog.cpp
===================================================================
--- trunk/jazz/src/Dialogs/SysexDialog.cpp 2010-04-25 16:42:19 UTC (rev 755)
+++ trunk/jazz/src/Dialogs/SysexDialog.cpp 2010-04-25 23:59:43 UTC (rev 756)
@@ -22,8 +22,7 @@
#include "../Events.h"
#include "../Globals.h"
-#include "../KeyStringConverters.h"
-#include "../Knob.h"
+#include "../Help.h"
#include "../Project.h"
#include "../Resources.h"
@@ -42,47 +41,20 @@
//-----------------------------------------------------------------------------
BEGIN_EVENT_TABLE(JZSysexDialog, wxDialog)
- EVT_KNOB_CHANGED(IDC_KB_VELOCITY, JZSysexDialog::OnVelocityChange)
-
- EVT_KNOB_CHANGED(IDC_KB_OFF_VELOCITY, JZSysexDialog::OnOffVelocityChange)
-
- EVT_KNOB_CHANGED(IDC_KB_CHANNEL, JZSysexDialog::OnChannelChange)
-
EVT_BUTTON(wxID_HELP, JZSysexDialog::OnHelp)
END_EVENT_TABLE()
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-JZSysexDialog::JZSysexDialog(tKeyOn* pEvent, wxWindow* pParent)
- : wxDialog(pParent, wxID_ANY, wxString("Key On")),
- mpEvent(pEvent),
- mpPitchEdit(0),
- mpVelocityValue(0),
- mpVelocityKnob(0),
- mpOffVelocityValue(0),
- mpOffVelocityKnob(0),
- mpLengthEdit(0),
- mpChannelValue(0),
- mpChannelKnob(0),
+JZSysexDialog::JZSysexDialog(tSysEx* pEvent, wxWindow* pParent)
+ : wxDialog(pParent, wxID_ANY, wxString("System Exclusive")),
+ mpSysExEvent(pEvent),
+ mpSysExEdit(0),
mpClockEdit(0)
{
- mpPitchEdit = new wxTextCtrl(this, wxID_ANY);
+ mpSysExEdit = new wxTextCtrl(this, wxID_ANY);
- mpVelocityValue = new wxStaticText(this, wxID_ANY, "000");
-
- mpVelocityKnob = new JZKnob(this, IDC_KB_VELOCITY, 0, 0, 127);
-
- mpOffVelocityValue = new wxStaticText(this, wxID_ANY, "000");
-
- mpOffVelocityKnob = new JZKnob(this, IDC_KB_OFF_VELOCITY, 0, 0, 127);
-
- mpLengthEdit = new wxTextCtrl(this, wxID_ANY);
-
- mpChannelValue = new wxStaticText(this, wxID_ANY, "00");
-
- mpChannelKnob = new JZKnob(this, IDC_KB_CHANNEL, 0, 1, 16);
-
mpClockEdit = new wxTextCtrl(this, wxID_ANY);
wxButton* pOkButton = new wxButton(this, wxID_OK, "&OK");
@@ -92,72 +64,38 @@
wxBoxSizer* pTopSizer = new wxBoxSizer(wxVERTICAL);
- wxFlexGridSizer* pFlexGridSizer;
-
- pFlexGridSizer = new wxFlexGridSizer(1, 2, 4, 2);
-
- pFlexGridSizer->Add(
- new wxStaticText(this, wxID_ANY, "Pitch:"),
+ pTopSizer->Add(
+ new wxStaticText(
+ this,
+ wxID_ANY,
+ "Example input: f0 7f 7f 04 01 00 7f f7"),
0,
- wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
- pFlexGridSizer->Add(mpPitchEdit, 0, wxALIGN_CENTER_VERTICAL);
+ wxCENTER | wxALL,
+ 5);
- pTopSizer->Add(pFlexGridSizer, 0, wxCENTER | wxALL, 2);
-
- pFlexGridSizer = new wxFlexGridSizer(2, 3, 4, 2);
-
- pFlexGridSizer->Add(
- new wxStaticText(this, wxID_ANY, "Velocity:"),
+ pTopSizer->Add(
+ new wxStaticText(
+ this,
+ wxID_ANY,
+ "Any DT1/RQ1 checksums will be corrected"),
0,
- wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
- pFlexGridSizer->Add(
- mpVelocityValue,
- 0,
- wxALIGN_CENTER_VERTICAL | wxFIXED_MINSIZE);
- pFlexGridSizer->Add(mpVelocityKnob, 0, wxALIGN_CENTER_VERTICAL);
+ wxCENTER | wxALL,
+ 5);
- pFlexGridSizer->Add(
- new wxStaticText(this, wxID_ANY, "Off Velocity:"),
- 0,
- wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
- pFlexGridSizer->Add(
- mpOffVelocityValue,
- 0,
- wxALIGN_CENTER_VERTICAL | wxFIXED_MINSIZE);
- pFlexGridSizer->Add(mpOffVelocityKnob, 0, wxALIGN_CENTER_VERTICAL);
+ wxFlexGridSizer* pFlexGridSizer;
- pTopSizer->Add(pFlexGridSizer, 0, wxALIGN_CENTER);
+ pFlexGridSizer = new wxFlexGridSizer(2, 2, 4, 2);
- pFlexGridSizer = new wxFlexGridSizer(1, 2, 4, 2);
-
pFlexGridSizer->Add(
- new wxStaticText(this, wxID_ANY, "Length:"),
+ new wxStaticText(this, wxID_ANY, "SysEx (hex):"),
0,
wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
- pFlexGridSizer->Add(mpLengthEdit, 0, wxALIGN_CENTER_VERTICAL);
+ pFlexGridSizer->Add(mpSysExEdit, 0, wxALIGN_CENTER_VERTICAL);
- pTopSizer->Add(pFlexGridSizer, 0, wxCENTER | wxALL, 2);
-
- pFlexGridSizer = new wxFlexGridSizer(1, 3, 4, 2);
-
pFlexGridSizer->Add(
- new wxStaticText(this, wxID_ANY, "Channel:"),
+ new wxStaticText(this, wxID_ANY, "Time:"),
0,
wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
- pFlexGridSizer->Add(
- mpChannelValue,
- 0,
- wxALIGN_CENTER_VERTICAL | wxFIXED_MINSIZE);
- pFlexGridSizer->Add(mpChannelKnob, 0, wxALIGN_CENTER_VERTICAL);
-
- pTopSizer->Add(pFlexGridSizer, 0, wxCENTER | wxALL, 2);
-
- pFlexGridSizer = new wxFlexGridSizer(1, 2, 4, 2);
-
- pFlexGridSizer->Add(
- new wxStaticText(this, wxID_ANY, "Clock:"),
- 0,
- wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
pFlexGridSizer->Add(mpClockEdit, 0, wxALIGN_CENTER_VERTICAL);
pTopSizer->Add(pFlexGridSizer, 0, wxCENTER | wxALL, 2);
@@ -180,35 +118,24 @@
//-----------------------------------------------------------------------------
bool JZSysexDialog::TransferDataToWindow()
{
- string KeyString;
- KeyToString(mpEvent->GetKey(), KeyString);
- mpPitchEdit->ChangeValue(KeyString.c_str());
+ const unsigned char* pSysExData = mpSysExEvent->GetData();
+ unsigned short Length = mpSysExEvent->GetDataLength();
ostringstream Oss;
- Oss << (int)mpEvent->GetVelocity();
- mpVelocityValue->SetLabel(Oss.str().c_str());
+ for (unsigned short i = 0; i < Length; ++i)
+ {
+ Oss << hex << pSysExData[i];
+ if (i < Length - 1)
+ {
+ Oss << ' ';
+ }
+ }
- mpVelocityKnob->SetValue(mpEvent->GetVelocity());
+ mpSysExEdit->ChangeValue(Oss.str().c_str());
- Oss.str("");
- Oss << (int)mpEvent->GetOffVelocity();
- mpOffVelocityValue->SetLabel(Oss.str().c_str());
-
- mpOffVelocityKnob->SetValue(mpEvent->GetOffVelocity());
-
- wxString LengthString;
- LengthString << mpEvent->GetEventLength();
- mpLengthEdit->ChangeValue(LengthString);
-
- Oss.str("");
- Oss << (int)mpEvent->GetChannel() + 1;
- mpChannelValue->SetLabel(Oss.str().c_str());
-
- mpChannelKnob->SetValue(mpEvent->GetChannel() + 1);
-
string ClockString;
- gpProject->ClockToString(mpEvent->GetClock(), ClockString);
+ gpProject->ClockToString(mpSysExEvent->GetClock(), ClockString);
mpClockEdit->ChangeValue(ClockString.c_str());
return true;
@@ -218,61 +145,62 @@
//-----------------------------------------------------------------------------
bool JZSysexDialog::TransferDataFromWindow()
{
- wxString KeyString = mpPitchEdit->GetValue();
- mpEvent->SetKey(StringToKey(KeyString.c_str()));
+ wxString KeyString = mpSysExEdit->GetValue();
- mpEvent->SetVelocity(mpVelocityKnob->GetValue());
+ //TODO Need to validate the SysEx message. The Roland SysEx message is
+ // made up of nine parts. All notation is in hex.
+ //
+ // [1] [2] [3] [4] [5] [6] [7] [8] [9]
+ // F0 41 10 42 12 40007F 00 41 F7
+ //
+ // Parts [1], [2] and [9] are part of the MIDI specification and are
+ // required by all SysEx messages. What is in between is specific to the
+ // manufacturer, identified by part [2], which is 41h in Roland's case.
+ //
+ // Part [3] is known as the Device ID. Most Roland MIDI devices use the
+ // default of 10h, but is provided for us to change as we see fit. The idea
+ // behind the Device ID is that if you have more than one MIDI device of the
+ // same type in a daisy chain (connected to one another) you can change the
+ // Device ID on each of them so that you can send SysEx messages that will
+ // be accepted by only one of them, not all.
+ //
+ // Part [4] is the Model ID. GS synthesizers will all respond to SysEx with
+ // a Model ID of 42h, however they generally have their own Model ID as well.
+ //
+ // Part [5] specifies whether we are sending (12h) or requesting (11h)
+ // information. If a synth receives a SysEx message it recognizes, it will
+ // look this part to determine whether it needs to change an internal
+ // setting or reply (with its own SysEx message) with the value of a
+ // setting.
+ //
+ // Part [6] is the start address on which the SysEx intends to act. It is
+ // at this address that you may wish to put a value (or values) or retrieve
+ // the current value(s). It always contains three bytes. Most synthesizer
+ // manuals will provide you with a long "address map" table which explains
+ // what lives at each address. Although daunting on a first perusal, once
+ // you understand its function it becomes a wonderful resource.
+ //
+ // Part [7] has two functions. If part [5] is 12h (sending data) then part
+ // [7] contains the data we are sending and can be one byte or many bytes
+ // in length. If it is 11h (requesting data) then it is the number of bytes
+ // we want the synth to send us.
+ //
+ // Part [8] is the Roland checksum.
+ //
+ // Also need a function to set SysEx event data.
+// gpSynth->FixSysexCheckSum(Copy->IsSysEx());
+// mpSysExEvent->SetData(???);
- mpEvent->SetOffVelocity(mpOffVelocityKnob->GetValue());
-
- wxString LengthString = mpLengthEdit->GetValue();
- istringstream Iss(LengthString.c_str());
- unsigned short Length;
- Iss >> Length;
- mpEvent->SetLength(Length);
-
- mpEvent->SetChannel(mpChannelKnob->GetValue() - 1);
-
wxString ClockString = mpClockEdit->GetValue();
int Clock = gpProject->StringToClock(ClockString.c_str());
- mpEvent->SetClock(Clock);
+ mpSysExEvent->SetClock(Clock);
return true;
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-void JZSysexDialog::OnVelocityChange(JZKnobEvent& Event)
-{
- int Value = Event.GetValue();
- ostringstream Oss;
- Oss << Value;
- mpVelocityValue->SetLabel(Oss.str().c_str());
-}
-
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-void JZSysexDialog::OnOffVelocityChange(JZKnobEvent& Event)
-{
- int Value = Event.GetValue();
- ostringstream Oss;
- Oss << Value;
- mpOffVelocityValue->SetLabel(Oss.str().c_str());
-}
-
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-void JZSysexDialog::OnChannelChange(JZKnobEvent& Event)
-{
- int Value = Event.GetValue();
- ostringstream Oss;
- Oss << Value;
- mpChannelValue->SetLabel(Oss.str().c_str());
-}
-
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
void JZSysexDialog::OnHelp(wxCommandEvent& Event)
{
-// gpHelpInstance->ShowTopic("Sysex Dialog");
+ gpHelpInstance->ShowTopic("Sysex Dialog");
}
Modified: trunk/jazz/src/Dialogs/SysexDialog.h
===================================================================
--- trunk/jazz/src/Dialogs/SysexDialog.h 2010-04-25 16:42:19 UTC (rev 755)
+++ trunk/jazz/src/Dialogs/SysexDialog.h 2010-04-25 23:59:43 UTC (rev 756)
@@ -25,7 +25,7 @@
class JZKnob;
class JZKnobEvent;
-class tKeyOn;
+class tSysEx;
class wxStaticText;
class wxTextCtrl;
@@ -35,7 +35,7 @@
{
public:
- JZSysexDialog(tKeyOn* pEvent, wxWindow* pParent);
+ JZSysexDialog(tSysEx* pEvent, wxWindow* pParent);
private:
@@ -43,26 +43,13 @@
virtual bool TransferDataFromWindow();
- void OnVelocityChange(JZKnobEvent& Event);
-
- void OnOffVelocityChange(JZKnobEvent& Event);
-
- void OnChannelChange(JZKnobEvent& Event);
-
void OnHelp(wxCommandEvent& Event);
private:
- tKeyOn* mpEvent;
+ tSysEx* mpSysExEvent;
- wxTextCtrl* mpPitchEdit;
- wxStaticText* mpVelocityValue;
- JZKnob* mpVelocityKnob;
- wxStaticText* mpOffVelocityValue;
- JZKnob* mpOffVelocityKnob;
- wxTextCtrl* mpLengthEdit;
- wxStaticText* mpChannelValue;
- JZKnob* mpChannelKnob;
+ wxTextCtrl* mpSysExEdit;
wxTextCtrl* mpClockEdit;
DECLARE_EVENT_TABLE();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pst...@us...> - 2010-04-25 16:42:25
|
Revision: 755
http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=755&view=rev
Author: pstieber
Date: 2010-04-25 16:42:19 +0000 (Sun, 25 Apr 2010)
Log Message:
-----------
1. Changed GlobalSettingsDialog to EditAudioGlobalSettings in tSampleSet and JZPlayer.
2. Activated the corresponding dialog.
Modified Paths:
--------------
trunk/jazz/src/Audio.cpp
trunk/jazz/src/Audio.h
trunk/jazz/src/Player.cpp
trunk/jazz/src/Player.h
trunk/jazz/src/Project.cpp
Modified: trunk/jazz/src/Audio.cpp
===================================================================
--- trunk/jazz/src/Audio.cpp 2010-04-25 05:19:15 UTC (rev 754)
+++ trunk/jazz/src/Audio.cpp 2010-04-25 16:42:19 UTC (rev 755)
@@ -803,7 +803,7 @@
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-void tSampleSet::GlobalSettingsDlg()
+void tSampleSet::EditAudioGlobalSettings(wxWindow* pParent)
{
if (spl_dialog)
{
@@ -813,8 +813,8 @@
if (mpGlobalSettingsDialog == 0)
{
+ mpGlobalSettingsDialog = new wxDialog(pParent, wxID_ANY, "Audio Settings");
#ifdef OBSOLETE
- mpGlobalSettingsDialog = new wxDialogBox(gpTrackWindow, "Audio Settings", false);
tAudioGloblForm *form = new tAudioGloblForm(*this);
form->AssociatePanel(mpGlobalSettingsDialog);
mpGlobalSettingsDialog->Fit();
@@ -1354,10 +1354,6 @@
return 1;
}
- case ID_AUDIO_GLOBAL_SETTINGS:
- GlobalSettingsDlg();
- break;
-
case ID_AUDIO_SAMPLES:
SamplesDlg();
return 1;
Modified: trunk/jazz/src/Audio.h
===================================================================
--- trunk/jazz/src/Audio.h 2010-04-25 05:19:15 UTC (rev 754)
+++ trunk/jazz/src/Audio.h 2010-04-25 16:42:19 UTC (rev 755)
@@ -370,7 +370,7 @@
return *samples[i];
}
- void GlobalSettingsDlg();
+ void EditAudioGlobalSettings(wxWindow* pParent);
protected:
Modified: trunk/jazz/src/Player.cpp
===================================================================
--- trunk/jazz/src/Player.cpp 2010-04-25 05:19:15 UTC (rev 754)
+++ trunk/jazz/src/Player.cpp 2010-04-25 16:42:19 UTC (rev 755)
@@ -685,9 +685,9 @@
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-void JZPlayer::EditGlobalAudioSettings(wxWindow* pParent)
+void JZPlayer::EditAudioGlobalSettings(wxWindow* pParent)
{
- mSamples.GlobalSettingsDlg();
+ mSamples.EditAudioGlobalSettings(pParent);
}
#ifdef DEV_MPU401
Modified: trunk/jazz/src/Player.h
===================================================================
--- trunk/jazz/src/Player.h 2010-04-25 05:19:15 UTC (rev 754)
+++ trunk/jazz/src/Player.h 2010-04-25 16:42:19 UTC (rev 755)
@@ -281,7 +281,7 @@
mSamples.AdjustAudioLength(t, ticks_per_minute);
}
- void EditGlobalAudioSettings(wxWindow* pParent);
+ void EditAudioGlobalSettings(wxWindow* pParent);
void EditSample(int key)
{
Modified: trunk/jazz/src/Project.cpp
===================================================================
--- trunk/jazz/src/Project.cpp 2010-04-25 05:19:15 UTC (rev 754)
+++ trunk/jazz/src/Project.cpp 2010-04-25 16:42:19 UTC (rev 755)
@@ -624,7 +624,7 @@
//-----------------------------------------------------------------------------
void JZProject::EditAudioGlobalSettings(wxWindow* pParent)
{
- mpMidiPlayer->EditGlobalAudioSettings(pParent);
+ mpMidiPlayer->EditAudioGlobalSettings(pParent);
}
//-----------------------------------------------------------------------------
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pst...@us...> - 2010-04-25 05:19:21
|
Revision: 754
http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=754&view=rev
Author: pstieber
Date: 2010-04-25 05:19:15 +0000 (Sun, 25 Apr 2010)
Log Message:
-----------
1. Replaced old Controller dialog with a new version. This still isn't functional.
2. Removed the tNamedValueListValidator class.
Modified Paths:
--------------
trunk/jazz/src/Dialogs.cpp
trunk/jazz/src/Dialogs.h
trunk/jazz/src/Makefile.am
trunk/jazz/src/PropertyListDialog.cpp
trunk/jazz/src/PropertyListDialog.h
trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj
Added Paths:
-----------
trunk/jazz/src/Dialogs/ControllerDialog.cpp
trunk/jazz/src/Dialogs/ControllerDialog.h
Added: trunk/jazz/src/Dialogs/ControllerDialog.cpp
===================================================================
--- trunk/jazz/src/Dialogs/ControllerDialog.cpp (rev 0)
+++ trunk/jazz/src/Dialogs/ControllerDialog.cpp 2010-04-25 05:19:15 UTC (rev 754)
@@ -0,0 +1,58 @@
+#include "ControllerDialog.h"
+
+#include "../Configuration.h"
+#include "../Globals.h"
+
+#include <wx/button.h>
+#include <wx/listbox.h>
+#include <wx/sizer.h>
+
+using namespace std;
+
+//*****************************************************************************
+//*****************************************************************************
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+BEGIN_EVENT_TABLE(JZControllerDialog, wxDialog)
+END_EVENT_TABLE()
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+JZControllerDialog::JZControllerDialog(wxWindow* pParent)
+ : wxDialog(pParent, wxID_ANY, wxString("Controller")),
+ mpControllerListBox(0)
+{
+ mpControllerListBox = new wxListBox(this, wxID_ANY);
+
+ const vector<pair<string, int> >& VoiceNames = gpConfig->GetControlNames();
+ for (
+ vector<pair<string, int> >::const_iterator iName = VoiceNames.begin();
+ iName != VoiceNames.end();
+ ++iName)
+ {
+ mpControllerListBox->Append(iName->first.c_str());
+ }
+
+ 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);
+
+ pTopSizer->Add(mpControllerListBox, 0, wxGROW | 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);
+}
Property changes on: trunk/jazz/src/Dialogs/ControllerDialog.cpp
___________________________________________________________________
Added: svn:eol-style
+ native
Added: trunk/jazz/src/Dialogs/ControllerDialog.h
===================================================================
--- trunk/jazz/src/Dialogs/ControllerDialog.h (rev 0)
+++ trunk/jazz/src/Dialogs/ControllerDialog.h 2010-04-25 05:19:15 UTC (rev 754)
@@ -0,0 +1,44 @@
+//*****************************************************************************
+// 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_CONTROLLERDIALOG_H
+#define JZ_CONTROLLERDIALOG_H
+
+
+#include <wx/dialog.h>
+
+class wxListBox;
+
+//*****************************************************************************
+//*****************************************************************************
+class JZControllerDialog : public wxDialog
+{
+ public:
+
+ JZControllerDialog(wxWindow* pParent);
+
+ private:
+
+ wxListBox* mpControllerListBox;
+
+ DECLARE_EVENT_TABLE();
+};
+
+#endif // !defined(JZ_CONTROLLERDIALOG_H)
Property changes on: trunk/jazz/src/Dialogs/ControllerDialog.h
___________________________________________________________________
Added: svn:eol-style
+ native
Modified: trunk/jazz/src/Dialogs.cpp
===================================================================
--- trunk/jazz/src/Dialogs.cpp 2010-04-25 05:07:21 UTC (rev 753)
+++ trunk/jazz/src/Dialogs.cpp 2010-04-25 05:19:15 UTC (rev 754)
@@ -25,6 +25,7 @@
#include "ClockDialog.h"
#include "Command.h"
#include "DeprecatedWx/proplist.h"
+#include "Dialogs/ControllerDialog.h"
#include "Dialogs/KeyOnDialog.h"
#include "Dialogs/ProgramChangeDialog.h"
//#include "EventFrame.h"
@@ -107,43 +108,43 @@
// SearchReplace
//*****************************************************************************
-int tSearchReplaceDlg::frCtrl = 1;
-int tSearchReplaceDlg::toCtrl = 1;
+//int tSearchReplaceDlg::frCtrl = 1;
+//int tSearchReplaceDlg::toCtrl = 1;
+//
+//tSearchReplaceDlg::tSearchReplaceDlg(JZEventWindow* w, JZFilter *f)
+// : tPropertyListDlg("Search and replace controller types" )
+//{
+// Filter = f;
+// Song = f->GetSong();
+//}
-tSearchReplaceDlg::tSearchReplaceDlg(JZEventWindow* w, JZFilter *f)
- : tPropertyListDlg("Search and replace controller types" )
-{
- Filter = f;
- Song = f->GetSong();
-}
+//bool tSearchReplaceDlg::OnClose()
+//{
+// tCmdSearchReplace sr(Filter, frCtrl - 1, toCtrl-1);
+// sr.Execute();
+//
+// JZProjectManager::Instance()->UpdateAllViews();
+//
+// return false;
+//}
-bool tSearchReplaceDlg::OnClose()
-{
- tCmdSearchReplace sr(Filter, frCtrl - 1, toCtrl-1);
- sr.Execute();
+//void tSearchReplaceDlg::AddProperties()
+//{
+// sheet->AddProperty(new wxProperty(
+// "Search",
+// tNamedValueListValue(&frCtrl, gpConfig->GetControlNames()),
+// "props",
+// new tNamedValueListValidator(gpConfig->GetControlNames())));
+//
+// sheet->AddProperty(new wxProperty(
+// "Replace",
+// tNamedValueListValue(&toCtrl, gpConfig->GetControlNames()),
+// "props",
+// new tNamedValueListValidator(gpConfig->GetControlNames())));
+//}
- JZProjectManager::Instance()->UpdateAllViews();
- return false;
-}
-void tSearchReplaceDlg::AddProperties()
-{
- sheet->AddProperty(new wxProperty(
- "Search",
- tNamedValueListValue(&frCtrl, gpConfig->GetControlNames()),
- "props",
- new tNamedValueListValidator(gpConfig->GetControlNames())));
-
- sheet->AddProperty(new wxProperty(
- "Replace",
- tNamedValueListValue(&toCtrl, gpConfig->GetControlNames()),
- "props",
- new tNamedValueListValidator(gpConfig->GetControlNames())));
-}
-
-
-
//*****************************************************************************
// seqLength
//*****************************************************************************
@@ -385,66 +386,6 @@
tChEventDlg::AddProperties();
}
-// -------------------------------- Controller ---------------------------
-
-class tControlDlg : public tChEventDlg
-{
- public:
-
- int Value;
- int Control;
- //tNamedChoice Choice;
-
- tControlDlg(tControl *e, JZPianoWindow* w, JZTrack *t);
-
- void AddProperties();
- bool OnClose();
-};
-
-
-tControlDlg::tControlDlg(tControl* pControl, JZPianoWindow* w, JZTrack *t)
- : tChEventDlg(pControl, w, t)//,
-// Choice("Controller", &gpConfig->GetCtrlName(0), &Control)
-{
- Event = pControl;
- Value = pControl->GetControlValue();
- Control = pControl->GetControl() + 1;
-}
-
-
-bool tControlDlg::OnClose()
-{
- ((tControl *)Copy)->SetControlValue(Value);
- // Choice.GetValue();
- ((tControl *)Copy)->SetControl(Control - 1);
- return tChEventDlg::OnClose();
-}
-
-void tControlDlg::AddProperties()
-{
- // Add(Choice.mkFormItem(300, 300));
-// Choice("Controller", &gpConfig->GetCtrlName(0), &Control)
- sheet->AddProperty(new wxProperty(
- "Controller",
- tNamedValueListValue(&Control, gpConfig->GetControlNames()),
- "props",
- new tNamedValueListValidator(gpConfig->GetControlNames())));
-
- sheet->AddProperty(new wxProperty(
- "Value",
- wxPropertyValue(&Value),
- "integer",
- new wxIntegerListValidator(0, 127)));
-
-// Add(wxMakeFormShort(
-// "Value:",
-// &Value,
-// wxFORM_DEFAULT,
-// new wxList(wxMakeConstraintRange(0.0, 127.0), 0)));
-
- tChEventDlg::AddProperties();
-}
-
// -------------------------------- Play track ---------------------------
class tPlayTrackDlg : public tEventDlg
@@ -591,56 +532,7 @@
}
-#ifdef DEPRECATED
-// -------------------------------- Program ---------------------------
-class tProgramDlg : public tEventDlg
-{
-public:
-
- int Program;
- // tNamedChoice Choice;
-
- tProgramDlg(tProgram *e, JZPianoWindow* w, JZTrack *t);
-
- void AddProperties();
- bool OnClose();
-};
-
-
-tProgramDlg::tProgramDlg(tProgram* pProgram, JZPianoWindow* w, JZTrack *t)
- : tEventDlg(pProgram, w, t),
- Program(pProgram->GetProgram() + 1)//,
-// Choice("Program", &gpConfig->GetVoiceName(0), &Program)
-{
- Event = pProgram;
-}
-
-
-bool tProgramDlg::OnClose()
-{
-// Choice.GetValue();
- if (Program <= 0)
- {
- Program = 1;
- }
- ((tProgram *)Copy)->SetProgram(Program - 1);
- return tEventDlg::OnClose();
-}
-
-void tProgramDlg::AddProperties()
-{
- //Add(Choice.mkFormItem(300, 300));
- sheet->AddProperty(new wxProperty(
- "Program",
- tNamedValueListValue(&Program, gpConfig->GetVoiceNames()),
- "props",
- new tNamedValueListValidator(gpConfig->GetVoiceNames())));
-}
-#endif // DEPRECATED
-
-
-
// -------------------------------- Set Tempo -------------------------------
class tSetTempoDlg : public tEventDlg
@@ -946,16 +838,20 @@
break;
case StatControl:
- str = "Controller";
- dlg = new tControlDlg(e->IsControl(), pPianoWindow, t);
+// str = "Controller";
+// dlg = new tControlDlg(e->IsControl(), pPianoWindow, t);
+ {
+ JZControllerDialog ControllerDialog(pPianoWindow);
+ ControllerDialog.ShowModal();
+ }
break;
case StatProgram:
- {
// str = "Program Change";
// dlg = new tProgramDlg(e->IsProgram(), pPianoWindow, t);
- JZProgramChangeDialog ProgramChangeDialog(pPianoWindow);
- ProgramChangeDialog.ShowModal();
+ {
+ JZProgramChangeDialog ProgramChangeDialog(pPianoWindow);
+ ProgramChangeDialog.ShowModal();
}
break;
Modified: trunk/jazz/src/Dialogs.h
===================================================================
--- trunk/jazz/src/Dialogs.h 2010-04-25 05:07:21 UTC (rev 753)
+++ trunk/jazz/src/Dialogs.h 2010-04-25 05:19:15 UTC (rev 754)
@@ -50,24 +50,24 @@
// void OnHelp();
//};
-class tSearchReplaceDlg : public tPropertyListDlg
-{
- public:
+//class tSearchReplaceDlg : public tPropertyListDlg
+//{
+// public:
+//
+// static int frCtrl;
+// static int toCtrl;
+///* tNamedChoice frList; */
+///* tNamedChoice toList; */
+//
+// JZFilter *Filter;
+// JZSong *Song;
+//
+// tSearchReplaceDlg(JZEventWindow* w, JZFilter *f);
+// void AddProperties();
+// bool OnClose();
+// void OnHelp();
+//};
- static int frCtrl;
- static int toCtrl;
-/* tNamedChoice frList; */
-/* tNamedChoice toList; */
-
- JZFilter *Filter;
- JZSong *Song;
-
- tSearchReplaceDlg(JZEventWindow* w, JZFilter *f);
- void AddProperties();
- bool OnClose();
- void OnHelp();
-};
-
// seqLength
class tSeqLengthDlg : public tPropertyListDlg
{
Modified: trunk/jazz/src/Makefile.am
===================================================================
--- trunk/jazz/src/Makefile.am 2010-04-25 05:07:21 UTC (rev 753)
+++ trunk/jazz/src/Makefile.am 2010-04-25 05:19:15 UTC (rev 754)
@@ -23,6 +23,7 @@
DeprecatedWx/propform.cpp \
DeprecatedWx/proplist.cpp \
Dialogs/CleanupDialog.cpp \
+Dialogs/ControllerDialog.cpp \
Dialogs/DeleteDialog.cpp \
Dialogs/FilterDialog.cpp \
Dialogs/IntegerEdit.cpp \
@@ -113,6 +114,7 @@
DeprecatedWx/propform.cpp \
DeprecatedWx/proplist.cpp \
Dialogs/CleanupDialog.cpp \
+Dialogs/ControllerDialog.cpp \
Dialogs/DeleteDialog.cpp \
Dialogs/FilterDialog.cpp \
Dialogs/IntegerEdit.cpp \
@@ -208,6 +210,7 @@
DeprecatedWx/proplist.h \
DeprecatedStringUtils.h \
Dialogs/CleanupDialog.h \
+Dialogs/ControllerDialog.h \
Dialogs/DeleteDialog.h \
Dialogs/FilterDialog.h \
Dialogs/IntegerEdit.h \
Modified: trunk/jazz/src/PropertyListDialog.cpp
===================================================================
--- trunk/jazz/src/PropertyListDialog.cpp 2010-04-25 05:07:21 UTC (rev 753)
+++ trunk/jazz/src/PropertyListDialog.cpp 2010-04-25 05:19:15 UTC (rev 754)
@@ -223,223 +223,3 @@
<< "tPropertyListDlg::AddProperties should never be called, override!"
<< endl;
}
-
-/////////////////////////////////////////////////////////////
-// in constructor: init the delegate with strings from the nam/value array
-
-// map integer on string and show it
-
-// map string on integer and store it
-
-tNamedValueListValidator::tNamedValueListValidator(
- const vector<pair<string, int> >& Values)
- : mValues(Values)
-{
- wxStringList* stringlist = new wxStringList();
- for (
- vector<pair<string, int> >::const_iterator iValue = mValues.begin();
- iValue != mValues.end();
- ++iValue)
- {
- // omit empty entries
- if (!iValue->first.empty())
- {
- stringlist->Add(wxString(iValue->first.c_str()));
- }
- }
-
- // copied from base(cant call base constructors)
- m_strings = stringlist;
-
- // If no constraint, we just allow the string to be edited.
- if (!m_strings && ((m_validatorFlags & wxPROP_ALLOW_TEXT_EDITING) == 0))
- {
- m_validatorFlags |= wxPROP_ALLOW_TEXT_EDITING;
- }
-}
-
-tNamedValueListValidator::~tNamedValueListValidator()
-{
-}
-
-int tNamedValueListValidator::MapName2Value(const char* Selection)
-{
- int Result = 0;
-
- if (Selection)
- {
- for (
- vector<pair<string, int> >::const_iterator iValue = mValues.begin();
- iValue != mValues.end();
- ++iValue)
- {
- if (!strcmp(Selection, iValue->first.c_str()))
- {
- Result = iValue->second;
- break;
- }
- }
- }
- return Result;
-}
-
-
-wxString tNamedValueListValidator::MapValue2Name(int value)
-{
- for (
- vector<pair<string, int> >::const_iterator iValue = mValues.begin();
- iValue != mValues.end();
- ++iValue)
- {
- if (value == iValue->second)
- {
- return wxString(iValue->first.c_str());
- }
- }
- return ::wxEmptyString;
-}
-
-// it appears not to be possible to get the validator to provide the value to
-// be displayed in the property list.
-// wxPropertyValue.GetStringRepresentation() is used for that.
-
-// fetch property value and display it
-bool tNamedValueListValidator::OnDisplayValue(
- wxProperty* pProperty,
- wxPropertyListView* pView,
- wxWindow* pParent)
-{
- if (!pView->GetValueText())
- {
- return false;
- }
-
- // fetch the int value of the property, convert it to a name
- wxString str=MapValue2Name(pProperty->GetValue().IntegerValue());
-
- pView->GetValueText()->SetValue(str);
- cout << "tNamedValueListValidator::OnDisplayValue " << str <<endl;
- if (
- m_strings &&
- pView->GetValueList() &&
- pView->GetValueList()->IsShown() &&
- pView->GetValueList()->GetCount() > 0)
- {
- pView->GetValueList()->SetStringSelection(str);
- }
- return true;
-
-// return wxStringListValidator::OnDisplayValue(pProperty, pView, pParent);
-}
-
-// update the property from the control
-bool tNamedValueListValidator::OnRetrieveValue(
- wxProperty* pProperty,
- wxPropertyListView* pView,
- wxWindow* pParent)
-{
- if (!pView->GetValueText())
- {
- return false;
- }
- wxString value(pView->GetValueText()->GetValue());
- pProperty->GetValue() = (long)MapName2Value(value);
- cout
- << "tNamedValueListValidator::OnRetrieveValue "
- << pProperty->GetValue().IntegerValue()
- << endl;
-// pView->GetValueText()->SetValue("apa!");
-
- return true;
-
-// return wxStringListValidator::OnRetrieveValue(pProperty, pView, pParent);
-}
-
-
-bool tNamedValueListValidator::OnSelect(
- bool select,
- wxProperty* pProperty,
- wxPropertyListView* pView,
- wxWindow* pParent)
-{
- return wxStringListValidator::OnSelect(select, pProperty, pView, pParent);
-}
-
-bool tNamedValueListValidator::OnDoubleClick(
- wxProperty* pProperty,
- wxPropertyListView* pView,
- wxWindow* pParent)
-{
- return wxStringListValidator::OnDoubleClick(pProperty, pView, pParent);
-}
-
-bool tNamedValueListValidator::OnValueListSelect(
- wxProperty* pProperty,
- wxPropertyListView* pView,
- wxWindow* pParent)
-{
- wxString s(pView->GetValueList()->GetStringSelection());
- cout <<"tNamedValueListValidator::OnValueListSelect "<<s<<endl;
- if (s != wxT(""))
- {
- pView->GetValueText()->SetValue(s);
- pView->RetrieveProperty(pProperty); //i think this displays the prop
- }
- return true;
-
-// return wxStringListValidator::OnValueListSelect(pProperty, pView, pParent);
-}
-
-bool tNamedValueListValidator::OnPrepareControls(
- wxProperty* pProperty,
- wxPropertyListView* pView,
- wxWindow* pParent)
-{
- return wxStringListValidator::OnPrepareControls(pProperty, pView, pParent);
-}
-
-bool tNamedValueListValidator::OnClearControls(
- wxProperty* pProperty,
- wxPropertyListView* pView,
- wxWindow* pParent)
-{
- return wxStringListValidator::OnClearControls(pProperty, pView, pParent);
-}
-
-bool tNamedValueListValidator::OnPrepareDetailControls(
- wxProperty* pProperty,
- wxPropertyListView* pView,
- wxWindow* pParent)
-{
- return wxStringListValidator::OnPrepareDetailControls(
- pProperty,
- pView,
- pParent);
-}
-
-bool tNamedValueListValidator::OnClearDetailControls(
- wxProperty* pProperty,
- wxPropertyListView* pView,
- wxWindow* pParent)
-{
- return wxStringListValidator::OnClearDetailControls(
- pProperty,
- pView,
- pParent);
-}
-
-void tNamedValueListValidator::OnEdit(
- wxProperty* pProperty,
- wxPropertyListView* pView,
- wxWindow* pParent)
-{
- return wxStringListValidator::OnEdit(pProperty, pView, pParent);
-}
-
-bool tNamedValueListValidator::OnCheckValue(
- wxProperty* pProperty,
- wxPropertyListView* pView,
- wxWindow* pParent)
-{
- return wxStringListValidator::OnCheckValue(pProperty, pView, pParent);
-}
Modified: trunk/jazz/src/PropertyListDialog.h
===================================================================
--- trunk/jazz/src/PropertyListDialog.h 2010-04-25 05:07:21 UTC (rev 753)
+++ trunk/jazz/src/PropertyListDialog.h 2010-04-25 05:19:15 UTC (rev 754)
@@ -35,140 +35,29 @@
#ifndef JZ_PROPERTYLISTDIALOG_H
#define JZ_PROPERTYLISTDIALOG_H
-#include "NamedValue.h"
#include "DeprecatedWx/proplist.h"
#include "DeprecatedWx/propform.h"
-#include <vector>
-#include <string>
-
-class tNamedValueListValue : public wxPropertyValue
+class tPropertyListDlg
{
-// DECLARE_DYNAMIC_CLASS(tNamedValueListValue)
-
public:
-// tNamedValueListValue()
-// : wxPropertyValue()
-// {
-// }
-
- tNamedValueListValue(
- int* pValue,
- const std::vector<std::pair<std::string, int> >& Pairs)
- : wxPropertyValue(pValue),
- mPairs(Pairs)
+ tPropertyListDlg(wxString title);
+ virtual ~tPropertyListDlg()
{
}
+ virtual void AddProperties();
+ void Create();
+ void CreateModal();
+ virtual bool OnClose();
+ virtual void OnPropertyChanged(wxProperty* pProperty);
- //overriding these doesnt really work in the display area
-/* virtual wxString GetStringRepresentation(void){ */
-/* cout <<"GetStringRepresentation"<<endl; */
-/* return wxString("apa"); */
-/* } */
-/* int IntegerValue(){ */
-/* return 42; */
-/* } */
+ protected:
- private:
-
-// tNamedValue* nval;
- const std::vector<std::pair<std::string, int> >& mPairs;
+ wxPropertySheet* sheet;
+ wxPropertyListView* view;
+ wxPropertyValidatorRegistry *myListValidatorRegistry;//cannot be a temporary! leads to a crash
+ wxString title;
};
-
-class tPropertyListDlg
-{
- public:
- tPropertyListDlg(wxString title);
- virtual ~tPropertyListDlg()
- {
- }
- virtual void AddProperties();
- void Create();
- void CreateModal();
- virtual bool OnClose();
- virtual void OnPropertyChanged(wxProperty* pProperty);
- protected:
- wxPropertySheet* sheet;
- wxPropertyListView* view;
- wxPropertyValidatorRegistry *myListValidatorRegistry;//cannot be a temporary! leads to a crash
- wxString title;
-
-};
-
-class tNamedValueListValidator : public wxStringListValidator
-{
- public:
-
- tNamedValueListValidator(
- const std::vector<std::pair<std::string, int> >& Values);
-
- ~tNamedValueListValidator();
-
- int MapName2Value(const char* pSelection);
-
- wxString MapValue2Name(int Value);
-
- virtual bool OnSelect(
- bool Select,
- wxProperty* pProperty,
- wxPropertyListView* pView,
- wxWindow* pParentWindow);
-
- virtual bool OnDoubleClick(
- wxProperty* WXUNUSED(pProperty),
- wxPropertyListView* WXUNUSED(pView),
- wxWindow* WXUNUSED(pParentWindow));
-
- virtual bool OnValueListSelect(
- wxProperty* pProperty,
- wxPropertyListView* pView,
- wxWindow* pParentWindow);
-
- virtual bool OnPrepareControls(
- wxProperty* WXUNUSED(pProperty),
- wxPropertyListView* WXUNUSED(pView),
- wxWindow* WXUNUSED(pParentWindow));
-
- virtual bool OnClearControls(
- wxProperty* pProperty,
- wxPropertyListView* pView,
- wxWindow* pParentWindow);
-
- virtual bool OnPrepareDetailControls(
- wxProperty* WXUNUSED(pProperty),
- wxPropertyListView* WXUNUSED(pView),
- wxWindow* WXUNUSED(pParentWindow));
-
- virtual bool OnClearDetailControls(
- wxProperty* WXUNUSED(pProperty),
- wxPropertyListView* WXUNUSED(pView),
- wxWindow* WXUNUSED(pParentWindow));
-
- virtual void OnEdit(
- wxProperty* pProperty,
- wxPropertyListView* pView,
- wxWindow* pParentWindow);
-
- virtual bool OnCheckValue(
- wxProperty* WXUNUSED(pProperty),
- wxPropertyListView* WXUNUSED(pView),
- wxWindow* WXUNUSED(pParentWindow));
-
- virtual bool OnRetrieveValue(
- wxProperty* pProperty,
- wxPropertyListView* pView,
- wxWindow* pParentWindow);
-
- virtual bool OnDisplayValue(
- wxProperty* pProperty,
- wxPropertyListView* pView,
- wxWindow *pParentWindow);
-
- private:
-
- const std::vector<std::pair<std::string, int> >& mValues;
-};
-
#endif // !defined(JZ_PROPERTYLISTDIALOG_H)
Modified: trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj
===================================================================
--- trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj 2010-04-25 05:07:21 UTC (rev 753)
+++ trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj 2010-04-25 05:19:15 UTC (rev 754)
@@ -855,6 +855,14 @@
>
</File>
<File
+ RelativePath="..\src\Dialogs\ControllerDialog.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\src\Dialogs\ControllerDialog.h"
+ >
+ </File>
+ <File
RelativePath="..\src\Dialogs\DeleteDialog.cpp"
>
</File>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pst...@us...> - 2010-04-25 05:07:27
|
Revision: 753
http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=753&view=rev
Author: pstieber
Date: 2010-04-25 05:07:21 +0000 (Sun, 25 Apr 2010)
Log Message:
-----------
Fixed a file name error.
Modified Paths:
--------------
trunk/jazz/src/Makefile.am
Modified: trunk/jazz/src/Makefile.am
===================================================================
--- trunk/jazz/src/Makefile.am 2010-04-25 04:42:41 UTC (rev 752)
+++ trunk/jazz/src/Makefile.am 2010-04-25 05:07:21 UTC (rev 753)
@@ -30,7 +30,7 @@
Dialogs/KeyOnDialog.cpp \
Dialogs/MetronomeSettingsDialog.cpp \
Dialogs/MidiChannelDialog.cpp \
-Dialogs/ProgramChannelDialog.cpp \
+Dialogs/ProgramChangeDialog.cpp \
Dialogs/QuantizeDialog.cpp \
Dialogs/SearchAndReplaceDialog.cpp \
Dialogs/ShiftDialog.cpp \
@@ -120,7 +120,7 @@
Dialogs/KeyOnDialog.cpp \
Dialogs/MetronomeSettingsDialog.cpp \
Dialogs/MidiChannelDialog.cpp \
-Dialogs/ProgramChannelDialog.cpp \
+Dialogs/ProgramChangeDialog.cpp \
Dialogs/QuantizeDialog.cpp \
Dialogs/SearchAndReplaceDialog.cpp \
Dialogs/ShiftDialog.cpp \
@@ -215,7 +215,7 @@
Dialogs/KeyOnDialog.h \
Dialogs/MetronomeSettingsDialog.h \
Dialogs/MidiChannelDialog.h \
-Dialogs/ProgramChannelDialog.h \
+Dialogs/ProgramChangeDialog.h \
Dialogs/QuantizeDialog.h \
Dialogs/SearchAndReplaceDialog.h \
Dialogs/ShiftDialog.h \
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pst...@us...> - 2010-04-25 04:42:47
|
Revision: 752
http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=752&view=rev
Author: pstieber
Date: 2010-04-25 04:42:41 +0000 (Sun, 25 Apr 2010)
Log Message:
-----------
replaced old Program Channel dialog with a new version. This still isn't functional.
Modified Paths:
--------------
trunk/jazz/src/Dialogs.cpp
trunk/jazz/src/Makefile.am
trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj
Added Paths:
-----------
trunk/jazz/src/Dialogs/ProgramChangeDialog.cpp
trunk/jazz/src/Dialogs/ProgramChangeDialog.h
Added: trunk/jazz/src/Dialogs/ProgramChangeDialog.cpp
===================================================================
--- trunk/jazz/src/Dialogs/ProgramChangeDialog.cpp (rev 0)
+++ trunk/jazz/src/Dialogs/ProgramChangeDialog.cpp 2010-04-25 04:42:41 UTC (rev 752)
@@ -0,0 +1,59 @@
+#include "ProgramChangeDialog.h"
+
+#include "../Configuration.h"
+#include "../Globals.h"
+
+#include <wx/button.h>
+#include <wx/listbox.h>
+#include <wx/sizer.h>
+
+using namespace std;
+
+//*****************************************************************************
+//*****************************************************************************
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+BEGIN_EVENT_TABLE(JZProgramChangeDialog, wxDialog)
+END_EVENT_TABLE()
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+JZProgramChangeDialog::JZProgramChangeDialog(wxWindow* pParent)
+ : wxDialog(pParent, wxID_ANY, wxString("Program Change")),
+ mpProgramListBox(0)
+{
+ mpProgramListBox = new wxListBox(this, wxID_ANY);
+
+ const vector<pair<string, int> >& VoiceNames = gpConfig->GetVoiceNames();
+ for (
+ vector<pair<string, int> >::const_iterator iName = VoiceNames.begin();
+ iName != VoiceNames.end();
+ ++iName)
+ {
+ mpProgramListBox->Append(iName->first.c_str());
+ }
+
+ 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);
+
+ pTopSizer->Add(mpProgramListBox, 0, wxGROW | 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);
+}
+
Property changes on: trunk/jazz/src/Dialogs/ProgramChangeDialog.cpp
___________________________________________________________________
Added: svn:eol-style
+ native
Added: trunk/jazz/src/Dialogs/ProgramChangeDialog.h
===================================================================
--- trunk/jazz/src/Dialogs/ProgramChangeDialog.h (rev 0)
+++ trunk/jazz/src/Dialogs/ProgramChangeDialog.h 2010-04-25 04:42:41 UTC (rev 752)
@@ -0,0 +1,43 @@
+//*****************************************************************************
+// 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_PROGRAMCHANGEDIALOG_H
+#define JZ_PROGRAMCHANGEDIALOG_H
+
+#include <wx/dialog.h>
+
+class wxListBox;
+
+//*****************************************************************************
+//*****************************************************************************
+class JZProgramChangeDialog : public wxDialog
+{
+ public:
+
+ JZProgramChangeDialog(wxWindow* pParent);
+
+ private:
+
+ wxListBox* mpProgramListBox;
+
+ DECLARE_EVENT_TABLE();
+};
+
+#endif // !defined(JZ_PROGRAMCHANGEDIALOG_H)
Property changes on: trunk/jazz/src/Dialogs/ProgramChangeDialog.h
___________________________________________________________________
Added: svn:eol-style
+ native
Modified: trunk/jazz/src/Dialogs.cpp
===================================================================
--- trunk/jazz/src/Dialogs.cpp 2010-04-25 03:54:05 UTC (rev 751)
+++ trunk/jazz/src/Dialogs.cpp 2010-04-25 04:42:41 UTC (rev 752)
@@ -26,6 +26,7 @@
#include "Command.h"
#include "DeprecatedWx/proplist.h"
#include "Dialogs/KeyOnDialog.h"
+#include "Dialogs/ProgramChangeDialog.h"
//#include "EventFrame.h"
#include "Events.h"
#include "EventWindow.h"
@@ -590,11 +591,12 @@
}
+#ifdef DEPRECATED
// -------------------------------- Program ---------------------------
class tProgramDlg : public tEventDlg
{
- public:
+public:
int Program;
// tNamedChoice Choice;
@@ -635,6 +637,7 @@
"props",
new tNamedValueListValidator(gpConfig->GetVoiceNames())));
}
+#endif // DEPRECATED
@@ -948,8 +951,12 @@
break;
case StatProgram:
- str = "Program Change";
- dlg = new tProgramDlg(e->IsProgram(), pPianoWindow, t);
+ {
+// str = "Program Change";
+// dlg = new tProgramDlg(e->IsProgram(), pPianoWindow, t);
+ JZProgramChangeDialog ProgramChangeDialog(pPianoWindow);
+ ProgramChangeDialog.ShowModal();
+ }
break;
case StatSetTempo:
Modified: trunk/jazz/src/Makefile.am
===================================================================
--- trunk/jazz/src/Makefile.am 2010-04-25 03:54:05 UTC (rev 751)
+++ trunk/jazz/src/Makefile.am 2010-04-25 04:42:41 UTC (rev 752)
@@ -30,6 +30,7 @@
Dialogs/KeyOnDialog.cpp \
Dialogs/MetronomeSettingsDialog.cpp \
Dialogs/MidiChannelDialog.cpp \
+Dialogs/ProgramChannelDialog.cpp \
Dialogs/QuantizeDialog.cpp \
Dialogs/SearchAndReplaceDialog.cpp \
Dialogs/ShiftDialog.cpp \
@@ -119,6 +120,7 @@
Dialogs/KeyOnDialog.cpp \
Dialogs/MetronomeSettingsDialog.cpp \
Dialogs/MidiChannelDialog.cpp \
+Dialogs/ProgramChannelDialog.cpp \
Dialogs/QuantizeDialog.cpp \
Dialogs/SearchAndReplaceDialog.cpp \
Dialogs/ShiftDialog.cpp \
@@ -213,6 +215,7 @@
Dialogs/KeyOnDialog.h \
Dialogs/MetronomeSettingsDialog.h \
Dialogs/MidiChannelDialog.h \
+Dialogs/ProgramChannelDialog.h \
Dialogs/QuantizeDialog.h \
Dialogs/SearchAndReplaceDialog.h \
Dialogs/ShiftDialog.h \
Modified: trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj
===================================================================
--- trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj 2010-04-25 03:54:05 UTC (rev 751)
+++ trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj 2010-04-25 04:42:41 UTC (rev 752)
@@ -911,6 +911,14 @@
>
</File>
<File
+ RelativePath="..\src\Dialogs\ProgramChangeDialog.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\src\Dialogs\ProgramChangeDialog.h"
+ >
+ </File>
+ <File
RelativePath="..\src\Dialogs\QuantizeDialog.cpp"
>
</File>
@@ -983,6 +991,10 @@
>
</File>
</Filter>
+ <File
+ RelativePath="..\src\Makefile.am"
+ >
+ </File>
</Files>
<Globals>
</Globals>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pst...@us...> - 2010-04-25 03:54:11
|
Revision: 751
http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=751&view=rev
Author: pstieber
Date: 2010-04-25 03:54:05 +0000 (Sun, 25 Apr 2010)
Log Message:
-----------
Removed a stray character.
Modified Paths:
--------------
trunk/jazz/src/SampleCommand.cpp
Modified: trunk/jazz/src/SampleCommand.cpp
===================================================================
--- trunk/jazz/src/SampleCommand.cpp 2010-04-25 03:30:51 UTC (rev 750)
+++ trunk/jazz/src/SampleCommand.cpp 2010-04-25 03:54:05 UTC (rev 751)
@@ -406,7 +406,7 @@
chans = sout.GetChannels();
inchan = (int)p[6];
j = 0;
- for (i = 0; i < nsamps; i++)i
+ for (i = 0; i < nsamps; i++)
{
j = (j+1) % reinit;
k = (k+1) % reinit;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pst...@us...> - 2010-04-25 03:30:58
|
Revision: 750
http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=750&view=rev
Author: pstieber
Date: 2010-04-25 03:30:51 +0000 (Sun, 25 Apr 2010)
Log Message:
-----------
Changed curly bracket placement and made cosmetic indentation changes.
Modified Paths:
--------------
trunk/jazz/src/FileSelector.cpp
trunk/jazz/src/HarmonyBrowserAnalyzer.cpp
trunk/jazz/src/HarmonyP.cpp
trunk/jazz/src/Player.cpp
trunk/jazz/src/Random.cpp
trunk/jazz/src/Sample.cpp
trunk/jazz/src/SampleCommand.cpp
trunk/jazz/src/SampleDialog.cpp
trunk/jazz/src/SampleWindow.cpp
trunk/jazz/src/Signal2.cpp
Modified: trunk/jazz/src/FileSelector.cpp
===================================================================
--- trunk/jazz/src/FileSelector.cpp 2010-04-25 03:22:05 UTC (rev 749)
+++ trunk/jazz/src/FileSelector.cpp 2010-04-25 03:30:51 UTC (rev 750)
@@ -93,7 +93,8 @@
wxString buf;
//sprintf(buf, "overwrite %s?", (char*)s);
buf << "overwrite "<<s<<"?";
- if (wxMessageBox(buf, "Save ?", wxYES_NO) == wxNO) {
+ if (wxMessageBox(buf, "Save ?", wxYES_NO) == wxNO)
+ {
s = wxEmptyString;
}
Modified: trunk/jazz/src/HarmonyBrowserAnalyzer.cpp
===================================================================
--- trunk/jazz/src/HarmonyBrowserAnalyzer.cpp 2010-04-25 03:22:05 UTC (rev 749)
+++ trunk/jazz/src/HarmonyBrowserAnalyzer.cpp 2010-04-25 03:30:51 UTC (rev 750)
@@ -322,12 +322,16 @@
class tChordMatrix {
public:
- tChordMatrix() {
+ tChordMatrix()
+ {
for (int i = 0; i < 12; i++)
for (int j = 0; j < 12; j++)
mat[i][j] = 0;
}
- double* operator[](int i) { return mat[i]; }
+ double* operator[](int i)
+ {
+ return mat[i];i
+ }
private:
double mat[12][12];
};
Modified: trunk/jazz/src/HarmonyP.cpp
===================================================================
--- trunk/jazz/src/HarmonyP.cpp 2010-04-25 03:22:05 UTC (rev 749)
+++ trunk/jazz/src/HarmonyP.cpp 2010-04-25 03:30:51 UTC (rev 750)
@@ -212,15 +212,19 @@
void HBChord::Rotate(int semis)
{
- if (semis > 0) {
- while (semis--) {
+ if (semis > 0)
+ {
+ while (semis--)
+ {
if (keys & 0x800)
keys = ((keys & ~0x800) << 1) + 1;
else keys <<= 1;
}
}
- else if (semis < 0) {
- while (semis++) {
+ else if (semis < 0)
+ {
+ while (semis++)
+ {
if (keys & 1)
keys = (keys >> 1) | 0x800;
else keys >>= 1;
Modified: trunk/jazz/src/Player.cpp
===================================================================
--- trunk/jazz/src/Player.cpp 2010-04-25 03:22:05 UTC (rev 749)
+++ trunk/jazz/src/Player.cpp 2010-04-25 03:30:51 UTC (rev 750)
@@ -1278,9 +1278,10 @@
int numbytes = 0;
numbytes = get_recbuf_mpu( &recbuf );
- if (numbytes == 0) {
- // No bytes in record buffer
- return 0;
+ if (numbytes == 0)
+ {
+ // No bytes in record buffer
+ return 0;
}
// Go through the record buffer and create events
@@ -1996,7 +1997,8 @@
{
case EV_TIMING:
- switch (buf[i+1]) {
+ switch (buf[i+1])
+ {
case TMR_WAIT_ABS:
case TMR_ECHO:
recd_clock = *(unsigned long *)&buf[i+4] + start_clock;
@@ -2016,7 +2018,8 @@
//unsigned char par = buf[i+5];
short val = *(short *)&buf[i+6];
//printf("got: chn %d, ctl %d, val %d\n", chn, ctl, val);
- switch (buf[i+2]) {
+ switch (buf[i+2])
+ {
case MIDI_CTL_CHANGE:
pEvent = new tControl(0, chn, ctl, val);
break;
Modified: trunk/jazz/src/Random.cpp
===================================================================
--- trunk/jazz/src/Random.cpp 2010-04-25 03:22:05 UTC (rev 749)
+++ trunk/jazz/src/Random.cpp 2010-04-25 03:30:51 UTC (rev 750)
@@ -396,12 +396,14 @@
ybar = ynul - hbar - hblk/2;
hbar = hblk;
- if (ybar < y) {
+ if (ybar < y)
+ {
int d = y - ybar;
ybar += d;
hbar -= d;
}
- if (ybar + hbar > y + h) {
+ if (ybar + hbar > y + h)
+ {
int d = (ybar + hbar) - (y + h);
hbar -= d;
}
Modified: trunk/jazz/src/Sample.cpp
===================================================================
--- trunk/jazz/src/Sample.cpp 2010-04-25 03:22:05 UTC (rev 749)
+++ trunk/jazz/src/Sample.cpp 2010-04-25 03:30:51 UTC (rev 750)
@@ -71,7 +71,8 @@
void tSample::SetFilename(const char *fname)
{
- if (strcmp(filename, fname) != 0) {
+ if (strcmp(filename, fname) != 0)
+ {
dirty = 1;
char *s = copystring(fname);
label = copystring(wxFileNameFromPath(s));
@@ -175,7 +176,8 @@
int tSample::LoadWav()
{
struct stat buf;
- if (stat(filename, &buf) == -1) {
+ if (stat(filename, &buf) == -1)
+ {
perror(filename);
return 1;
}
@@ -194,7 +196,8 @@
//fprintf(stderr, "%s format not recognized\n", filename);
return 2;
}
- if (wh.format != PCM_CODE) {
+ if (wh.format != PCM_CODE)
+ {
//fprintf(stderr, "%s must be PCM_CODE\n", filename);
return 3;
}
@@ -316,13 +319,15 @@
}
// convert mono -> stereo
- if (channels == 1 && set.channels == 2) {
+ if (channels == 1 && set.channels == 2)
+ {
short *old = data;
length = length * 2;
data = new short [length];
int i = 0;
int j = 0;
- while (i < length) {
+ while (i < length)
+ {
data[i++] = old[j];
data[i++] = old[j++];
}
@@ -357,7 +362,8 @@
}
// apply volume and pan
- if (volume != 127 || pan != 0) {
+ if (volume != 127 || pan != 0)
+ {
int ch1 = volume;
int ch2 = volume;
int ppan = (set.channels == 2) ? pan : 0;
@@ -380,7 +386,8 @@
{
// determine file size
struct stat buf;
- if (stat(filename, &buf) == -1) {
+ if (stat(filename, &buf) == -1)
+ {
perror(filename);
return 1;
}
@@ -400,7 +407,8 @@
if (filename && filename[0] && !force && !dirty && external_flag)
{
struct stat buf;
- if (stat(filename, &buf) == -1) {
+ if (stat(filename, &buf) == -1)
+ {
perror(filename);
return 1;
}
@@ -411,7 +419,8 @@
if (force || dirty)
{
FreeData();
- if (filename && filename[0]) {
+ if (filename && filename[0])
+ {
int rc = LoadWav();
dirty = 0;
return rc;
Modified: trunk/jazz/src/SampleCommand.cpp
===================================================================
--- trunk/jazz/src/SampleCommand.cpp 2010-04-25 03:22:05 UTC (rev 749)
+++ trunk/jazz/src/SampleCommand.cpp 2010-04-25 03:30:51 UTC (rev 750)
@@ -428,7 +428,8 @@
val2 = in[inchan] * x;
out[0] = (val1 + val2);
- if (chans > 1) {
+ if (chans > 1)
+ {
out[1] = (1.0 - p[7]) * out[0];
out[0] *= p[7];
}
@@ -464,7 +465,8 @@
type = array[0] > 0 ? tSplFilter::LOWPASS : tSplFilter::HIGHPASS;
filters[0].Init(type, sr, Index2Hertz(0), 0);
// some band pass filters
- for (i = 1; i < nfilters-1; i++) {
+ for (i = 1; i < nfilters-1; i++)
+ {
double f = Index2Hertz(i);
double f0 = Index2Hertz(i-1);
double f1 = Index2Hertz(i+1);
Modified: trunk/jazz/src/SampleDialog.cpp
===================================================================
--- trunk/jazz/src/SampleDialog.cpp 2010-04-25 03:22:05 UTC (rev 749)
+++ trunk/jazz/src/SampleDialog.cpp 2010-04-25 03:30:51 UTC (rev 750)
@@ -354,11 +354,18 @@
#define N_HARM 40
-class tAddSynthArray {
+class tAddSynthArray
+{
public:
JZRndArray arr;
tRhyArrayEdit *edit;
- tAddSynthArray(wxFrame *parent, const char *label, int n, int ynul, int ymax, int style)
+ tAddSynthArray(
+ wxFrame *parent,
+ const char *label,
+ int n,
+ int ynul,
+ int ymax,
+ int style)
: arr(n, 0, ymax)
{
int i;
@@ -368,8 +375,14 @@
edit = new tRhyArrayEdit(parent, arr, 10,10,10,10, style);
edit->SetLabel(label);
}
- void Show(bool x) { edit->Show(x); }
- void Init() { edit->Init(); }
+ void Show(bool x)
+ {
+ edit->Show(x);
+ }
+ void Init()
+ {
+ edit->Init();
+ }
};
class tAddSynth
@@ -389,19 +402,22 @@
fft.edit->SetXMinMax(1, N_HARM);
}
- void SetDuration(int durat) {
+ void SetDuration(int durat)
+ {
vol.edit->SetXMinMax(0, durat);
pan.edit->SetXMinMax(0, durat);
frq.edit->SetXMinMax(0, durat);
}
- void Refresh() {
+ void Refresh()
+ {
fft.edit->Refresh();
vol.edit->Refresh();
frq.edit->Refresh();
pan.edit->Refresh();
}
- void Init() {
+ void Init()
+ {
fft.edit->Init();
vol.edit->Init();
frq.edit->Init();
@@ -617,7 +633,8 @@
case SYN_SAVE:
{
wxString fname = file_selector(default_filename, "Save Synth", 1, 0, "*.syn");
- if (fname) {
+ if (fname)
+ {
ofstream os(fname);
os << *this;
}
@@ -684,7 +701,8 @@
void tSynthDlg::AddEdits()
{
int i, k;
- for (i = 0, k = 0; i < MAXSYNTHS; i++) {
+ for (i = 0, k = 0; i < MAXSYNTHS; i++)
+ {
synths[i] = new tAddSynth(this);
synths[i]->SetDuration(duration);
}
@@ -794,27 +812,33 @@
else
#endif
- if (&item == chk_vol) {
+ if (&item == chk_vol)
+ {
vol_enable = chk_vol->GetValue();
resize = 1;
}
- else if (&item == chk_pan) {
+ else if (&item == chk_pan)
+ {
pan_enable = chk_pan->GetValue();
resize = 1;
}
- else if (&item == chk_frq) {
+ else if (&item == chk_frq)
+ {
frq_enable = chk_frq->GetValue();
resize = 1;
}
- else if (&item == chk_fft) {
+ else if (&item == chk_fft)
+ {
fft_enable = chk_fft->GetValue();
resize = 1;
}
- else if (&item == chk_noise) {
+ else if (&item == chk_noise)
+ {
noise_enable = chk_noise->GetValue();
resize = 1;
}
- else if (&item == num_synths_slider) {
+ else if (&item == num_synths_slider)
+ {
int n = num_synths_slider->GetValue();
if (n != num_synths)
{ // avoid flashing
@@ -822,9 +846,11 @@
resize = 1;
}
}
- else if (&item == duration_slider) {
+ else if (&item == duration_slider)
+ {
duration = duration_slider->GetValue();
- for (int i = 0, k = 0; i < num_synths; i++) {
+ for (int i = 0, k = 0; i < num_synths; i++)
+ {
tAddSynth &s = *synths[i];
s.SetDuration(duration);
}
@@ -833,14 +859,15 @@
else if (&item == midi_key_slider)
midi_key = midi_key_slider->GetValue();
- if (resize) {
+ if (resize)
+ {
SetupEdits();
int cw, ch;
GetClientSize(&cw, &ch);
OnSize(cw, ch);
}
-
- else if (redraw) {
+ else if (redraw)
+ {
for (int i = 0; i < num_synths; i++)
synths[i]->Refresh();
}
@@ -852,7 +879,8 @@
int i;
tSample &spl = win.GetSample();
JZRndArray *arr[MAXSYNTHS][4];
- for (i = 0; i < MAXSYNTHS; i++) {
+ for (i = 0; i < MAXSYNTHS; i++)
+ {
arr[i][0] = &synths[i]->fft.arr;
arr[i][1] = &synths[i]->vol.arr;
arr[i][2] = &synths[i]->frq.arr;
@@ -1112,7 +1140,8 @@
double maxfreq = (int)(win.GetSample().GetSamplingRate() / 2);
// watch order of enum in signali.h
typestring = 0;
- for (int i = 0; filter_types[i]; i++) {
+ for (int i = 0; filter_types[i]; i++)
+ {
typelist.Append((wxObject *)filter_types[i]); // ???
if (i == (int)type)
typestring = copystring(filter_types[i]);
Modified: trunk/jazz/src/SampleWindow.cpp
===================================================================
--- trunk/jazz/src/SampleWindow.cpp 2010-04-25 03:22:05 UTC (rev 749)
+++ trunk/jazz/src/SampleWindow.cpp 2010-04-25 03:30:51 UTC (rev 750)
@@ -92,11 +92,13 @@
class tInsertionPoint {
public:
- tInsertionPoint(wxScrolledWindow *c) : cnvs(c) {
+ tInsertionPoint(wxScrolledWindow *c) : cnvs(c)
+ {
last_x = 0;
visible = 0;
};
- void Draw(int x) {
+ void Draw(int x)
+ {
last_x = x;
visible ^= 1;
wxDC *dc = new wxClientDC(cnvs);
@@ -108,7 +110,8 @@
dc->SetPen(*wxBLACK_PEN);
dc->SetLogicalFunction(wxCOPY);
}
- void Draw() {
+ void Draw()
+ {
Draw(last_x);
}
int IsVisible() const {
@@ -133,7 +136,8 @@
public:
tSampleCnvs(tSampleWin *win, tSample &sample);
virtual ~tSampleCnvs();
- void Redraw() {
+ void Redraw()
+ {
OnPaint();
}
virtual void OnPaint();
@@ -180,22 +184,28 @@
{
public:
tSmplWinSettingsForm(tSampleWin &w)
- : wxForm( USED_WXFORM_BUTTONS ), win(w) {}
- void EditForm(wxPanel *panel) {
+ : wxForm( USED_WXFORM_BUTTONS ),
+ win(w)
+ {}
+ void EditForm(wxPanel *panel)
+ {
Add(wxMakeFormBool("Show Midi Time", &win.cnvs->midi_time));
Add(wxMakeFormNewLine());
AssociatePanel(panel);
}
- void OnOk() {
+ void OnOk()
+ {
win.settings = 0;
win.Redraw();
wxForm::OnOk();
}
- void OnCancel() {
+ void OnCancel()
+ {
win.settings = 0;
wxForm::OnCancel();
}
- void OnHelp() {
+ void OnHelp()
+ {
gpHelpInstance->ShowTopic("Settings");
}
private:
@@ -214,13 +224,15 @@
x = 0;
}
- ~tSamplePlayPosition() {
+ ~tSamplePlayPosition()
+ {
Stop();
if (visible)
Draw();
}
- void StopListen() {
+ void StopListen()
+ {
Stop();
if (gpMidiPlayer->IsListening())
gpMidiPlayer->ListenAudio(-1);
@@ -256,7 +268,8 @@
virtual void Notify()
{
int pos = player->GetListenerPlayPosition();
- if (pos < 0) {
+ if (pos < 0)
+ {
StopListen();
return;
}
@@ -498,7 +511,8 @@
int sfr = win->GetPaintOffset();
int sto = sfr + win->GetPaintLength();
- if (!midi_time) {
+ if (!midi_time)
+ {
// display time
JZMapper Map(sfr, sto, x, x+w);
int tfr = spl->Samples2Time(sfr) / 1000;
@@ -542,7 +556,8 @@
// draw a tickmark line
dc->DrawLine(xx, y - 5, xx, y);
// draw a text
- if (j == 0) {
+ if (j == 0)
+ {
char buf[50];
sprintf(buf, "%d", i + 1);
int fw, fh;
@@ -862,7 +877,8 @@
cnvs->SetSize(xx, yy, ww, hi);
hi = hh / nn;
- for (int i = 0; i < num_params; i++) {
+ for (int i = 0; i < num_params; i++)
+ {
int yi = yy + (i + spl.GetChannels()) * hh / nn;
params[i]->SetSize(xx, yi, ww, hi);
}
@@ -876,7 +892,8 @@
bool tSampleWin::HaveInsertionPoint(int &offs, bool warn)
{
- if (cnvs->sel_fr == cnvs->sel_to && cnvs->sel_fr >= 0) {
+ if (cnvs->sel_fr == cnvs->sel_to && cnvs->sel_fr >= 0)
+ {
offs = cnvs->sel_fr;
return TRUE;
}
@@ -890,7 +907,8 @@
bool tSampleWin::HaveSelection(int &fr_smpl, int &to_smpl, HaveSelectionMode mode)
{
- if (cnvs->sel_fr < cnvs->sel_to && cnvs->sel_fr >= 0) {
+ if (cnvs->sel_fr < cnvs->sel_to && cnvs->sel_fr >= 0)
+ {
fr_smpl = cnvs->sel_fr;
to_smpl = cnvs->sel_to;
return TRUE;
@@ -921,7 +939,8 @@
void tSampleWin::ClrParam()
{
- if (num_params > 0) {
+ if (num_params > 0)
+ {
int n = num_params;
num_params = 0;
for (int i = 0; i < n; ++i)
@@ -1351,7 +1370,8 @@
}
}
-void tSampleWin::PlaySample() {
+void tSampleWin::PlaySample()
+{
cnvs->Play();
}
Modified: trunk/jazz/src/Signal2.cpp
===================================================================
--- trunk/jazz/src/Signal2.cpp 2010-04-25 03:22:05 UTC (rev 749)
+++ trunk/jazz/src/Signal2.cpp 2010-04-25 03:30:51 UTC (rev 750)
@@ -36,7 +36,8 @@
const long N = isig.GetLength() + (long)(add_seconds * sampling_rate);
osig.Resize(N);
tSigValue val;
- for (long i = 0; i < N; i++) {
+ for (long i = 0; i < N; i++)
+ {
isig.GetSample(val);
osig.Out(val);
current++;
@@ -151,7 +152,8 @@
for (k = 0; k < N; k++)
wav[k] = 0;
- for (f = 0; f < arr.Size(); f++) {
+ for (f = 0; f < arr.Size(); f++)
+ {
tLineMap<float>map(0, N, 0, 2*PI*(f+1));
for (k = 0; k < N; k++)
wav[k] += sin(map(k)) * (float)arr[f] * (float)arr[f];
@@ -175,7 +177,8 @@
{
int i, k;
//cout << arr.GetLabel() << endl;
- for (i = 0; i < N; i++) {
+ for (i = 0; i < N; i++)
+ {
cout << i << ' ';
for (k = 0; k < tSigValue::MAXCHN; k++)
cout << wav[i][k] << ' ';
@@ -272,11 +275,13 @@
// old Filter Interface
// ---------------------------------------------------------------
-tSplFilter::tSplFilter() {
+tSplFilter::tSplFilter()
+{
filter = 0;
}
-tSplFilter::~tSplFilter() {
+tSplFilter::~tSplFilter()
+{
delete filter;
}
@@ -311,7 +316,8 @@
filter->Setup(sr, f0, f0 * bw);
}
-float tSplFilter::Loop(float sig) {
+float tSplFilter::Loop(float sig)
+{
return filter->Loop(sig);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pst...@us...> - 2010-04-25 03:22:11
|
Revision: 749
http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=749&view=rev
Author: pstieber
Date: 2010-04-25 03:22:05 +0000 (Sun, 25 Apr 2010)
Log Message:
-----------
Changed curly bracket placement.
Modified Paths:
--------------
trunk/jazz/src/AlsaThru.cpp
Modified: trunk/jazz/src/AlsaThru.cpp
===================================================================
--- trunk/jazz/src/AlsaThru.cpp 2010-04-25 03:17:18 UTC (rev 748)
+++ trunk/jazz/src/AlsaThru.cpp 2010-04-25 03:22:05 UTC (rev 749)
@@ -83,20 +83,23 @@
snd_seq_port_subscribe_alloca(&subs);
snd_seq_port_subscribe_set_sender(subs, &src);
snd_seq_port_subscribe_set_dest(subs, &dest);
- if (snd_seq_unsubscribe_port(handle, subs) < 0) {
+ if (snd_seq_unsubscribe_port(handle, subs) < 0)
+ {
perror("unsubscribe");
}
}
void tAlsaThru::initialize()
{
- if (snd_seq_open(&handle, "hw", SND_SEQ_OPEN_DUPLEX, 0 ) < 0) {
+ if (snd_seq_open(&handle, "hw", SND_SEQ_OPEN_DUPLEX, 0 ) < 0)
+ {
perror("open");
exit(1);
}
tAlsaPlayer::set_client_info(handle, "Jazz++ Midi Thru");
- if (snd_seq_nonblock(handle, 0) < 0) {
+ if (snd_seq_nonblock(handle, 0) < 0)
+ {
perror("blocking mode");
exit(1);
}
@@ -113,7 +116,8 @@
#ifdef USE_DIRECT_CONNECTION
void tAlsaThru::Start()
{
- if (! running) {
+ if (! running)
+ {
initialize();
connect(source, destin);
running = 1;
@@ -138,8 +142,10 @@
void tAlsaThru::loop()
{
snd_seq_event_t *ev;
- while (snd_seq_event_input(handle, &ev) >= 0 && ev != 0) {
- if (ev->source.client == source.client && ev->source.port == source.port) {
+ while (snd_seq_event_input(handle, &ev) >= 0 && ev != 0)
+ {
+ if (ev->source.client == source.client && ev->source.port == source.port)
+ {
ev->flags &= ~SND_SEQ_TIME_STAMP_MASK;
ev->flags |= SND_SEQ_TIME_STAMP_TICK;
ev->time.tick = 0;
@@ -202,13 +208,16 @@
void tAlsaThru::Start()
{
- if (!running) {
+ if (!running)
+ {
worker = fork();
- if (worker < 0) {
+ if (worker < 0)
+ {
perror("fork");
exit(1);
}
- if (worker == 0) {
+ if (worker == 0)
+ {
signal(SIGHUP, stopworker);
initialize();
loop();
@@ -223,7 +232,8 @@
void tAlsaThru::Stop()
{
- if (running) {
+ if (running)
+ {
int status = 0;
kill(worker, SIGHUP);
wait(&status);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pst...@us...> - 2010-04-25 03:17:24
|
Revision: 748
http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=748&view=rev
Author: pstieber
Date: 2010-04-25 03:17:18 +0000 (Sun, 25 Apr 2010)
Log Message:
-----------
Changed switch( to switch (.
Modified Paths:
--------------
trunk/jazz/src/PianoWindow.cpp
trunk/jazz/src/Player.cpp
trunk/jazz/src/Rhythm.cpp
trunk/jazz/src/SampleDialog.cpp
trunk/jazz/src/SampleWindow.cpp
trunk/jazz/src/Signal2.cpp
trunk/jazz/src/StandardFile.cpp
Modified: trunk/jazz/src/PianoWindow.cpp
===================================================================
--- trunk/jazz/src/PianoWindow.cpp 2010-04-25 03:15:14 UTC (rev 747)
+++ trunk/jazz/src/PianoWindow.cpp 2010-04-25 03:17:18 UTC (rev 748)
@@ -1183,7 +1183,7 @@
}
else
{
- switch(Event.GetKeyCode())
+ switch (Event.GetKeyCode())
{
case WXK_DELETE:
OnMenuCommand(wxID_DELETE);
Modified: trunk/jazz/src/Player.cpp
===================================================================
--- trunk/jazz/src/Player.cpp 2010-04-25 03:15:14 UTC (rev 747)
+++ trunk/jazz/src/Player.cpp 2010-04-25 03:17:18 UTC (rev 748)
@@ -1992,7 +1992,7 @@
while (i < size)
{
JZEvent* pEvent = 0;
- switch(buf[i])
+ switch (buf[i])
{
case EV_TIMING:
@@ -2016,7 +2016,7 @@
//unsigned char par = buf[i+5];
short val = *(short *)&buf[i+6];
//printf("got: chn %d, ctl %d, val %d\n", chn, ctl, val);
- switch(buf[i+2]) {
+ switch (buf[i+2]) {
case MIDI_CTL_CHANGE:
pEvent = new tControl(0, chn, ctl, val);
break;
@@ -2046,7 +2046,7 @@
unsigned char chn = buf[i+3];
unsigned char key = buf[i+4];
unsigned char vel = buf[i+5];
- switch(buf[i+2])
+ switch (buf[i+2])
{
case MIDI_NOTEOFF: // SN++ added veloc
pEvent = new tKeyOff(0, chn, key, vel);
Modified: trunk/jazz/src/Rhythm.cpp
===================================================================
--- trunk/jazz/src/Rhythm.cpp 2010-04-25 03:15:14 UTC (rev 747)
+++ trunk/jazz/src/Rhythm.cpp 2010-04-25 03:17:18 UTC (rev 748)
@@ -1200,7 +1200,7 @@
rhythm_edit->SetMeter(edit.steps_per_count, edit.count_per_bar, edit.n_bars);
rand_checkbox->SetValue((bool)edit.randomize);
- switch(edit.mode)
+ switch (edit.mode)
{
case MODE_CONTROL:
veloc_edit->SetLabel("ctrl value");
Modified: trunk/jazz/src/SampleDialog.cpp
===================================================================
--- trunk/jazz/src/SampleDialog.cpp 2010-04-25 03:15:14 UTC (rev 747)
+++ trunk/jazz/src/SampleDialog.cpp 2010-04-25 03:17:18 UTC (rev 748)
@@ -595,7 +595,7 @@
void tSynthDlg::OnMenuCommand(int id)
{
- switch(id)
+ switch (id)
{
case SYN_LOAD:
{
Modified: trunk/jazz/src/SampleWindow.cpp
===================================================================
--- trunk/jazz/src/SampleWindow.cpp 2010-04-25 03:15:14 UTC (rev 747)
+++ trunk/jazz/src/SampleWindow.cpp 2010-04-25 03:17:18 UTC (rev 748)
@@ -962,7 +962,7 @@
cnvs->playpos->StopListen();
}
- switch(id)
+ switch (id)
{
case MEN_EQUALIZER:
if (equalizer == 0)
Modified: trunk/jazz/src/Signal2.cpp
===================================================================
--- trunk/jazz/src/Signal2.cpp 2010-04-25 03:15:14 UTC (rev 747)
+++ trunk/jazz/src/Signal2.cpp 2010-04-25 03:17:18 UTC (rev 748)
@@ -285,7 +285,7 @@
sr = xsr;
delete filter;
filter = 0;
- switch(t)
+ switch (t)
{
case LOWPASS:
filter = new tOpLowpass();
Modified: trunk/jazz/src/StandardFile.cpp
===================================================================
--- trunk/jazz/src/StandardFile.cpp 2010-04-25 03:15:14 UTC (rev 747)
+++ trunk/jazz/src/StandardFile.cpp 2010-04-25 03:17:18 UTC (rev 748)
@@ -458,7 +458,7 @@
Stat = RunningStatus & 0xF0;
Channel = RunningStatus & 0x0F;
- switch(Stat)
+ switch (Stat)
{
case StatKeyOff: // SN++ added off veloc
pEvent = new tKeyOff(Clock, Channel, cp[0],cp[1]);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pst...@us...> - 2010-04-25 03:15:20
|
Revision: 747
http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=747&view=rev
Author: pstieber
Date: 2010-04-25 03:15:14 +0000 (Sun, 25 Apr 2010)
Log Message:
-----------
Made cosmetic changes.
Modified Paths:
--------------
trunk/jazz/src/Events.cpp
trunk/jazz/src/SampleCommand.cpp
trunk/jazz/src/Song.cpp
Modified: trunk/jazz/src/Events.cpp
===================================================================
--- trunk/jazz/src/Events.cpp 2010-04-25 03:08:56 UTC (rev 746)
+++ trunk/jazz/src/Events.cpp 2010-04-25 03:15:14 UTC (rev 747)
@@ -171,7 +171,7 @@
nBytes = 0;
Buffer[nBytes++] = Stat | ((tChannelEvent *)pEvent)->GetChannel();
- while(Length--)
+ while (Length--)
{
Buffer[nBytes++] = *pData++;
}
Modified: trunk/jazz/src/SampleCommand.cpp
===================================================================
--- trunk/jazz/src/SampleCommand.cpp 2010-04-25 03:08:56 UTC (rev 746)
+++ trunk/jazz/src/SampleCommand.cpp 2010-04-25 03:15:14 UTC (rev 747)
@@ -201,7 +201,7 @@
}
}
i--;
- while(++i < length)
+ while (++i < length)
{
array[i] = array[i-1];
}
Modified: trunk/jazz/src/Song.cpp
===================================================================
--- trunk/jazz/src/Song.cpp 2010-04-25 03:08:56 UTC (rev 746)
+++ trunk/jazz/src/Song.cpp 2010-04-25 03:15:14 UTC (rev 747)
@@ -435,7 +435,7 @@
// looplength will be used to loop the track, for the duration of
// the playtrack event.
loopLength = pTrack->GetLastClock();
- while(f)
+ while (f)
{
if (f->IsEndOfTrack())
{
@@ -455,7 +455,7 @@
// which start + length end up after the startloop. Then we could move the
// start of those to the beginning of the loop, and shorten the length.
// There would still be a problem with playtracks not even bar length.
- while(loopOffset < c->eventlength)
+ while (loopOffset < c->eventlength)
{
// No more events than the length of the playtrack! and ensure the last
// iteration is no longer than what is left.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pst...@us...> - 2010-04-25 03:09:02
|
Revision: 746
http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=746&view=rev
Author: pstieber
Date: 2010-04-25 03:08:56 +0000 (Sun, 25 Apr 2010)
Log Message:
-----------
Made cosmetic changes.
Modified Paths:
--------------
trunk/jazz/src/Sample.cpp
trunk/jazz/src/SampleCommand.cpp
Modified: trunk/jazz/src/Sample.cpp
===================================================================
--- trunk/jazz/src/Sample.cpp 2010-04-25 03:06:57 UTC (rev 745)
+++ trunk/jazz/src/Sample.cpp 2010-04-25 03:08:56 UTC (rev 746)
@@ -846,11 +846,13 @@
{
int j;
float wmax, xmax = 0;
- for(j = 0; j < length; j++) {
+ for (j = 0; j < length; j++)
+ {
if ((wmax = (float)fabs(data[j])) > xmax)
xmax = wmax;
}
- for(j = 0; j < length; j++) {
+ for (j = 0; j < length; j++)
+ {
data[j] /= xmax;
}
}
@@ -886,14 +888,16 @@
int j,k,l,i = 0;
amp2 = pvals[0];
- for(k = 1; k < nargs; k += 2) {
+ for (k = 1; k < nargs; k += 2)
+ {
amp1 = amp2;
amp2 = pvals[k+1];
j = i + 1;
data[i] = amp1;
c = (float) pow((amp2/amp1),(1./ pvals[k]));
i = (j - 1) + pvals[k];
- for(l = j; l < i; l++) {
+ for (l = j; l < i; l++)
+ {
if (l < size)
data[l] = data[l-1] * c;
}
Modified: trunk/jazz/src/SampleCommand.cpp
===================================================================
--- trunk/jazz/src/SampleCommand.cpp 2010-04-25 03:06:57 UTC (rev 745)
+++ trunk/jazz/src/SampleCommand.cpp 2010-04-25 03:08:56 UTC (rev 746)
@@ -141,7 +141,7 @@
{
int i;
resetval = 1000;
- for(i=0; i<SIZE; i++)
+ for (i = 0; i < SIZE; i++)
array[i] = 1;
lineset = 0;
}
@@ -181,7 +181,7 @@
int i,j,k,points;
increm = (double)(p[n_args - 2] - p[0])/(double)length;
- for(j=0,i=0; j < (n_args-2); j += 2)
+ for (j = 0, i = 0; j < (n_args - 2); j += 2)
{
points = (int)((double)(p[j+2] - p[j]) / increm +.5);
if (p[j+2] != p[j])
@@ -406,8 +406,8 @@
chans = sout.GetChannels();
inchan = (int)p[6];
j = 0;
- for(i = 0; i < nsamps; i++) {
-
+ for (i = 0; i < nsamps; i++)i
+ {
j = (j+1) % reinit;
k = (k+1) % reinit;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pst...@us...> - 2010-04-25 03:07:03
|
Revision: 745
http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=745&view=rev
Author: pstieber
Date: 2010-04-25 03:06:57 +0000 (Sun, 25 Apr 2010)
Log Message:
-----------
Made cosmetic changes.
Modified Paths:
--------------
trunk/jazz/src/Command.cpp
trunk/jazz/src/SampleCommand.cpp
Modified: trunk/jazz/src/Command.cpp
===================================================================
--- trunk/jazz/src/Command.cpp 2010-04-05 03:53:42 UTC (rev 744)
+++ trunk/jazz/src/Command.cpp 2010-04-25 03:06:57 UTC (rev 745)
@@ -631,7 +631,7 @@
k = (tKeyOn *)pEvent->Copy();
//little hack, if clock is -1000 it means set startclock from the first event.
- if(startClock==-1000)
+ if (startClock==-1000)
{
startClock = k->GetClock();
}
Modified: trunk/jazz/src/SampleCommand.cpp
===================================================================
--- trunk/jazz/src/SampleCommand.cpp 2010-04-05 03:53:42 UTC (rev 744)
+++ trunk/jazz/src/SampleCommand.cpp 2010-04-25 03:06:57 UTC (rev 745)
@@ -157,8 +157,14 @@
{
register int loc1,loc2;
float frac = ((float)(nsample)/(*tab)) * *(tab+1);
- if(frac < 0) return(array[0]);
- if(frac >= *(tab+1)) return(array[(int)*(tab+1)]);
+ if (frac < 0)
+ {
+ return(array[0]);
+ }
+ if (frac >= *(tab+1))
+ {
+ return(array[(int)*(tab+1)]);
+ }
loc1 = (int)frac;
loc2 = loc1+1;
frac = frac - (float)loc1;
@@ -171,23 +177,34 @@
void tCMixCmd::setline(const float *p, short n_args,int length,float *array)
{
- double increm;
- int i,j,k,points;
+ double increm;
+ int i,j,k,points;
- increm = (double)(p[n_args - 2] - p[0])/(double)length;
- for(j=0,i=0; j < (n_args-2); j += 2) {
- points = (int)((double)(p[j+2] - p[j]) / increm +.5);
- if(p[j+2] != p[j]) {
- if(points <= 0) points = 1;
- for(k=0; k < points; k++) {
- array[i++] = ((float)k/(float)points)
- * (p[j+3] - p[j+1]) + p[j+1];
- if(i == length) return;
- }
- }
+ increm = (double)(p[n_args - 2] - p[0])/(double)length;
+ for(j=0,i=0; j < (n_args-2); j += 2)
+ {
+ points = (int)((double)(p[j+2] - p[j]) / increm +.5);
+ if (p[j+2] != p[j])
+ {
+ if (points <= 0)
+ {
+ points = 1;
}
- i--;
- while(++i < length) array[i] = array[i-1];
+ for (k=0; k < points; k++)
+ {
+ array[i++] = ((float)k/(float)points) * (p[j+3] - p[j+1]) + p[j+1];
+ if (i == length)
+ {
+ return;
+ }
+ }
+ }
+ }
+ i--;
+ while(++i < length)
+ {
+ array[i] = array[i-1];
+ }
}
@@ -395,12 +412,18 @@
k = (k+1) % reinit;
samplenum1 = (float)i + (float)j * interval;
- if(!sinp.GetSample(samplenum1, in)) break;
+ if (!sinp.GetSample(samplenum1, in))
+ {
+ break;
+ }
x = wintable[(int)(((float)j/reinit) * wlen)];
val1 = in[inchan] * x;
samplenum2 = (float)(i) + (float)(k-off) * interval;
- if(!sinp.GetSample(samplenum2, in)) break;
+ if (!sinp.GetSample(samplenum2, in))
+ {
+ break;
+ }
x = wintable[(int)(((float)k/reinit) * wlen)];
val2 = in[inchan] * x;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pst...@us...> - 2010-04-05 03:53:49
|
Revision: 744
http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=744&view=rev
Author: pstieber
Date: 2010-04-05 03:53:42 +0000 (Mon, 05 Apr 2010)
Log Message:
-----------
Getting ready to make the audio dialogs accessible.
Modified Paths:
--------------
trunk/jazz/src/AlsaDriver.cpp
trunk/jazz/src/AlsaPlayer.cpp
trunk/jazz/src/Audio.cpp
trunk/jazz/src/Audio.h
trunk/jazz/src/AudioDriver.cpp
trunk/jazz/src/ControlEdit.cpp
trunk/jazz/src/Dialogs.cpp
trunk/jazz/src/EventWindow.cpp
trunk/jazz/src/EventWindow.h
trunk/jazz/src/PianoFrame.cpp
trunk/jazz/src/PianoFrame.h
trunk/jazz/src/PianoWindow.cpp
trunk/jazz/src/PianoWindow.h
trunk/jazz/src/Player.cpp
trunk/jazz/src/Player.h
trunk/jazz/src/PortMidiPlayer.cpp
trunk/jazz/src/Project.cpp
trunk/jazz/src/Project.h
trunk/jazz/src/ProjectManager.cpp
trunk/jazz/src/Sample.h
trunk/jazz/src/Track.cpp
trunk/jazz/src/Track.h
trunk/jazz/src/TrackFrame.cpp
trunk/jazz/src/TrackFrame.h
trunk/jazz/src/TrackWindow.cpp
trunk/jazz/src/TrackWindow.h
trunk/jazz/src/mswin/WindowsAudioInterface.cpp
trunk/jazz/src/mswin/WindowsPlayer.cpp
Modified: trunk/jazz/src/AlsaDriver.cpp
===================================================================
--- trunk/jazz/src/AlsaDriver.cpp 2010-04-04 20:30:59 UTC (rev 743)
+++ trunk/jazz/src/AlsaDriver.cpp 2010-04-05 03:53:42 UTC (rev 744)
@@ -125,7 +125,7 @@
tAlsaAudioPlayer::tAlsaAudioPlayer(JZSong* pSong)
: tAlsaPlayer(pSong)
{
- AudioBuffer = new tEventArray();
+ mpAudioBuffer = new tEventArray();
mInstalled = false;
audio_enabled = 0;
mpListener = 0;
@@ -146,7 +146,7 @@
tAlsaAudioPlayer::~tAlsaAudioPlayer()
{
delete mpListener;
- delete AudioBuffer;
+ delete mpAudioBuffer;
if (pcm[PLAYBACK])
{
snd_pcm_close(pcm[PLAYBACK]);
@@ -186,12 +186,12 @@
return;
}
- long ticks_per_minute = Song->GetTicksPerQuarter() * Song->Speed();
- mSamples.ResetBuffers(AudioBuffer, clock, ticks_per_minute);
+ long ticks_per_minute = mpSong->GetTicksPerQuarter() * mpSong->Speed();
+ mSamples.ResetBuffers(mpAudioBuffer, clock, ticks_per_minute);
last_scount = 0;
cur_pos = 0;
audio_clock_offset = clock;
- midi_speed = Song->Speed();
+ midi_speed = mpSong->Speed();
curr_speed = midi_speed;
running_mode = 0;
@@ -208,7 +208,7 @@
{
OpenDsp(PLAYBACK, 1);
mSamples.ResetBufferSize(frag_byte_size[PLAYBACK]);
- mSamples.FillBuffers(OutClock);
+ mSamples.FillBuffers(mOutClock);
}
if (running_mode == 0)
@@ -412,7 +412,7 @@
WriteSamples();
// The code may hang here when swapping in pages.
- mSamples.FillBuffers(OutClock);
+ mSamples.FillBuffers(mOutClock);
WriteSamples();
}
@@ -521,8 +521,8 @@
if (pcm[PLAYBACK])
{
snd_pcm_drop(pcm[PLAYBACK]);
-// long ticks_per_minute = Song->GetTicksPerQuarter() * Song->Speed();
-// mSamples.ResetBuffers(AudioBuffer, clock, ticks_per_minute);
+// long ticks_per_minute = mpSong->GetTicksPerQuarter() * mpSong->Speed();
+// mSamples.ResetBuffers(mpAudioBuffer, clock, ticks_per_minute);
}
audio_clock_offset = clock;
cur_pos = 0;
Modified: trunk/jazz/src/AlsaPlayer.cpp
===================================================================
--- trunk/jazz/src/AlsaPlayer.cpp 2010-04-04 20:30:59 UTC (rev 743)
+++ trunk/jazz/src/AlsaPlayer.cpp 2010-04-05 03:53:42 UTC (rev 744)
@@ -49,13 +49,13 @@
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-tAlsaPlayer::tAlsaPlayer(JZSong *song)
- : JZPlayer(song)
+tAlsaPlayer::tAlsaPlayer(JZSong* pSong)
+ : JZPlayer(pSong)
{
ithru = othru = 0;
mInstalled = true;
- poll_millisec = 25;
+ mPollMillisec = 25;
recd_clock = 0;
echo_clock = 0;
@@ -520,7 +520,7 @@
//-----------------------------------------------------------------------------
void tAlsaPlayer::OutBreak()
{
- OutBreak(OutClock);
+ OutBreak(mOutClock);
}
//-----------------------------------------------------------------------------
@@ -610,48 +610,48 @@
cout << "tAlsaPlayer::Notify rewind" << endl;
ResetPlay(Now);
mPlayBuffer.Clear();
- OutClock = Now + FIRST_DELTACLOCK;
- PlayLoop->PrepareOutput(&mPlayBuffer, Song, Now, OutClock, 0);
- if (AudioBuffer)
+ mOutClock = Now + FIRST_DELTACLOCK;
+ mpPlayLoop->PrepareOutput(&mPlayBuffer, mpSong, Now, mOutClock, 0);
+ if (mpAudioBuffer)
{
- AudioBuffer->Clear();
- PlayLoop->PrepareOutput(AudioBuffer, Song, Now, OutClock, 1);
+ mpAudioBuffer->Clear();
+ mpPlayLoop->PrepareOutput(mpAudioBuffer, mpSong, Now, mOutClock, 1);
}
mPlayBuffer.Length2Keyoff();
}
else
{
// time to put more events
- if (Now >= (OutClock - ADVANCE_PLAY))
+ if (Now >= (mOutClock - ADVANCE_PLAY))
{
- PlayLoop->PrepareOutput(
+ mpPlayLoop->PrepareOutput(
&mPlayBuffer,
- Song,
- OutClock,
+ mpSong,
+ mOutClock,
Now + DELTACLOCK,
0);
- if (AudioBuffer)
+ if (mpAudioBuffer)
{
- PlayLoop->PrepareOutput(
- AudioBuffer,
- Song,
- OutClock,
+ mpPlayLoop->PrepareOutput(
+ mpAudioBuffer,
+ mpSong,
+ mOutClock,
Now + DELTACLOCK,
1);
}
- OutClock = Now + DELTACLOCK;
+ mOutClock = Now + DELTACLOCK;
mPlayBuffer.Length2Keyoff();
}
}
play_clock = Now;
- if (mPlayBuffer.nEvents && mPlayBuffer.Events[0]->GetClock() < OutClock)
+ if (mPlayBuffer.nEvents && mPlayBuffer.Events[0]->GetClock() < mOutClock)
{
FlushToDevice();
}
else
{
- OutBreak(); // does nothing unless OutClock has changed
+ OutBreak(); // does nothing unless mOutClock has changed
}
}
@@ -688,8 +688,8 @@
//-----------------------------------------------------------------------------
int tAlsaPlayer::start_timer(long clock)
{
- int time_base = Song->GetTicksPerQuarter();
- int cur_speed = Song->GetTrack(0)->GetCurrentSpeed(clock);
+ int time_base = mpSong->GetTicksPerQuarter();
+ int cur_speed = mpSong->GetTrack(0)->GetCurrentSpeed(clock);
init_queue_tempo(time_base, cur_speed);
start_queue_timer(clock);
return 0;
@@ -923,7 +923,7 @@
{
// Not all events are to be recorded. Only those filtered out and put
// into the event.
- pEvent->SetClock(PlayLoop->Ext2IntClock(ev->time.tick));
+ pEvent->SetClock(mpPlayLoop->Ext2IntClock(ev->time.tick));
mRecdBuffer.Put(pEvent);
}
}
@@ -947,7 +947,7 @@
if (recd_clock != old_recd_clock)
{
JZProjectManager::Instance()->NewPlayPosition(
- PlayLoop->Ext2IntClock(recd_clock / 48 * 48));
+ mpPlayLoop->Ext2IntClock(recd_clock / 48 * 48));
}
return recd_clock;
}
Modified: trunk/jazz/src/Audio.cpp
===================================================================
--- trunk/jazz/src/Audio.cpp 2010-04-04 20:30:59 UTC (rev 743)
+++ trunk/jazz/src/Audio.cpp 2010-04-05 03:53:42 UTC (rev 744)
@@ -203,7 +203,7 @@
adjust_audio_length = 1;
has_changed = false;
spl_dialog = 0;
- glb_dialog = 0;
+ mpGlobalSettingsDialog = 0;
is_playing = 0;
softsync = 1;
dirty = 0;
@@ -744,7 +744,7 @@
if (set.is_playing)
return;
wxBeginBusyCursor();
- set.glb_dialog = 0;
+ set.mpGlobalSettingsDialog = 0;
speed = atol(speedstr);
set.SetSpeed(speed);
set.SetChannels(stereo ? 2 : 1);
@@ -782,7 +782,7 @@
}
void OnCancel()
{
- set.glb_dialog = 0;
+ set.mpGlobalSettingsDialog = 0;
wxForm::OnCancel();
}
private:
@@ -811,16 +811,16 @@
return;
}
- if (glb_dialog == 0)
+ if (mpGlobalSettingsDialog == 0)
{
#ifdef OBSOLETE
- glb_dialog = new wxDialogBox(gpTrackWindow, "Audio Settings", false);
+ mpGlobalSettingsDialog = new wxDialogBox(gpTrackWindow, "Audio Settings", false);
tAudioGloblForm *form = new tAudioGloblForm(*this);
- form->AssociatePanel(glb_dialog);
- glb_dialog->Fit();
+ form->AssociatePanel(mpGlobalSettingsDialog);
+ mpGlobalSettingsDialog->Fit();
#endif // OBSOLETE
}
- glb_dialog->Show(true);
+ mpGlobalSettingsDialog->Show(true);
}
//-----------------------------------------------------------------------------
@@ -898,12 +898,12 @@
// delete selection
#ifdef OBSOLETE
- JZSong *song = gpProject->Song;
+ JZSong* pSong = gpProject->mpSong;
#endif
const JZRecordingInfo* info = gpProject->GetRecInfo();
JZTrack* track = info->mpTrack;
#ifdef OBSOLETE
- song->NewUndoBuffer();
+ pSong->NewUndoBuffer();
#endif
tEventIterator iter(info->mpTrack);
JZEvent *e = iter.Range(frc, toc);
@@ -1286,9 +1286,9 @@
//-----------------------------------------------------------------------------
void tSampleSet::SamplesDlg()
{
- if (glb_dialog)
+ if (mpGlobalSettingsDialog)
{
- glb_dialog->Show(true);
+ mpGlobalSettingsDialog->Show(true);
return;
}
if (spl_dialog == 0)
@@ -1363,7 +1363,7 @@
return 1;
case ID_AUDIO_NEW:
- if (spl_dialog == 0 && glb_dialog == 0)
+ if (spl_dialog == 0 && mpGlobalSettingsDialog == 0)
{
if (wxMessageBox("Clear Sample Set?", "Confirm", wxYES_NO) == wxNO)
{
Modified: trunk/jazz/src/Audio.h
===================================================================
--- trunk/jazz/src/Audio.h 2010-04-04 20:30:59 UTC (rev 743)
+++ trunk/jazz/src/Audio.h 2010-04-05 03:53:42 UTC (rev 744)
@@ -221,6 +221,8 @@
class tSamplesDlg;
+//*****************************************************************************
+//*****************************************************************************
class tSampleSet
{
private:
@@ -368,6 +370,8 @@
return *samples[i];
}
+ void GlobalSettingsDlg();
+
protected:
long SampleSize(long num_samples)
@@ -375,6 +379,15 @@
return channels * (bits == 8 ? 1L : 2L) * num_samples;
}
+ long BufferClock(int i) const
+ {
+ return (long)(start_clock + i * clocks_per_buffer);
+ }
+
+ void SamplesDlg();
+
+ protected:
+
long speed; // samples / second
int channels; // mono = 1, stereo = 2
int bits; // must be 16!
@@ -389,7 +402,6 @@
int event_index;
-
unsigned int bufbytes; // buffer size in byte
unsigned int bufshorts; // buffer size in short
tAudioBuffer *buffers[BUFCOUNT]; // all the audio buffers
@@ -399,20 +411,18 @@
// return the start clock for i-th free buffer
long buffers_written; // for computing buffers clock
- long BufferClock(int i) const
- {
- return (long)(start_clock + i * clocks_per_buffer);
- }
- void GlobalSettingsDlg();
- void SamplesDlg();
- wxDialog *glb_dialog;
- tSamplesDlg *spl_dialog;
+ wxDialog* mpGlobalSettingsDialog;
+ tSamplesDlg* spl_dialog;
- tEventArray *events;
+ tEventArray* events;
- enum { MAXPOLY = 100 };
- tSampleVoice * voices[MAXPOLY];
+ enum
+ {
+ MAXPOLY = 100
+ };
+
+ tSampleVoice* voices[MAXPOLY];
int num_voices;
int adjust_audio_length;
Modified: trunk/jazz/src/AudioDriver.cpp
===================================================================
--- trunk/jazz/src/AudioDriver.cpp 2010-04-04 20:30:59 UTC (rev 743)
+++ trunk/jazz/src/AudioDriver.cpp 2010-04-05 03:53:42 UTC (rev 744)
@@ -122,7 +122,7 @@
: tSeq2Player(pSong)
{
long dummy = 0;
- AudioBuffer = new tEventArray();
+ mpAudioBuffer = new tEventArray();
mInstalled = false;
dummy = gpConfig->GetValue(C_EnableAudio);
audio_enabled = dummy;
@@ -171,9 +171,11 @@
tAudioPlayer::~tAudioPlayer()
{
delete mpListener;
- delete AudioBuffer;
+ delete mpAudioBuffer;
if (dev >= 0)
+ {
close(dev);
+ }
}
@@ -194,16 +196,16 @@
return;
}
- long ticks_per_minute = Song->GetTicksPerQuarter() * Song->Speed();
- mSamples.ResetBuffers(AudioBuffer, start_clock, ticks_per_minute);
+ long ticks_per_minute = mpSong->GetTicksPerQuarter() * mpSong->Speed();
+ mSamples.ResetBuffers(mpAudioBuffer, start_clock, ticks_per_minute);
if (PlaybackMode())
{
- mSamples.FillBuffers(OutClock);
+ mSamples.FillBuffers(mOutClock);
}
audio_bytes = 0;
midi_clock = 0;
- midi_speed = Song->Speed();
+ midi_speed = mpSong->Speed();
curr_speed = midi_speed;
OpenDsp();
@@ -351,7 +353,7 @@
WriteSamples();
// here it may hang when swapping in pages
- mSamples.FillBuffers(OutClock);
+ mSamples.FillBuffers(mOutClock);
WriteSamples();
}
Modified: trunk/jazz/src/ControlEdit.cpp
===================================================================
--- trunk/jazz/src/ControlEdit.cpp 2010-04-04 20:30:59 UTC (rev 743)
+++ trunk/jazz/src/ControlEdit.cpp 2010-04-05 03:53:42 UTC (rev 744)
@@ -25,7 +25,7 @@
#include "EventWindow.h"
#include "Filter.h"
#include "PianoWindow.h"
-#include "Song.h"
+#include "Project.h"
#include "Track.h"
#include <wx/button.h>
@@ -259,7 +259,7 @@
void tCtrlEditBase::OnApply()
{
wxBeginBusyCursor();
- mpPianoWindow->GetSong()->NewUndoBuffer();
+ mpPianoWindow->GetProject()->NewUndoBuffer();
// delete old events, but skip clock 0 to preserve track defaults:
// (dirty but might work...)
tEventIterator iter(track);
@@ -383,7 +383,7 @@
// av: called by tArrayEdit::OnPaint
void tCtrlEditBase::DrawBars(wxDC* dc)
{
- JZBarInfo BarInfo(*mpPianoWindow->GetSong());
+ JZBarInfo BarInfo(*mpPianoWindow->GetProject());
BarInfo.SetClock(from_clock);
long gclk,x;
int ii;
@@ -541,7 +541,7 @@
static long from_clk, to_clk;
wxBeginBusyCursor();
- mpPianoWindow->GetSong()->NewUndoBuffer();
+ mpPianoWindow->GetProject()->NewUndoBuffer();
tEventIterator iter(track);
@@ -656,7 +656,7 @@
}
wxBeginBusyCursor();
- mpPianoWindow->GetSong()->NewUndoBuffer();
+ mpPianoWindow->GetProject()->NewUndoBuffer();
tEventIterator iter(track);
@@ -817,7 +817,7 @@
void tChannelAfterEdit::OnApply()
{
wxBeginBusyCursor();
- mpPianoWindow->GetSong()->NewUndoBuffer();
+ mpPianoWindow->GetProject()->NewUndoBuffer();
// delete old events, but skip clock 0 to preserve track defaults:
// (dirty but might work...)
Modified: trunk/jazz/src/Dialogs.cpp
===================================================================
--- trunk/jazz/src/Dialogs.cpp 2010-04-04 20:30:59 UTC (rev 743)
+++ trunk/jazz/src/Dialogs.cpp 2010-04-05 03:53:42 UTC (rev 744)
@@ -273,7 +273,7 @@
tEventDlg::tEventDlg(JZEvent *e, JZPianoWindow* w, JZTrack *t)
: tPropertyListDlg( "Event" ),
- ClockDlg(w->GetSong(), "Time ", e->GetClock())
+ ClockDlg(w->GetProject(), "Time ", e->GetClock())
{
Win = w;
Track = t;
@@ -954,7 +954,10 @@
case StatSetTempo:
str = "Set Tempo (for track 0)";
- dlg = new tSetTempoDlg(e->IsSetTempo(), pPianoWindow, pPianoWindow->GetSong()->GetTrack(0) );
+ dlg = new tSetTempoDlg(
+ e->IsSetTempo(),
+ pPianoWindow,
+ pPianoWindow->GetProject()->GetTrack(0));
break;
case StatSysEx:
@@ -1024,8 +1027,8 @@
bool tMeterChangeDlg::OnClose()
{
- BarNr += mpEventWindow->GetSong()->GetIntroLength();
- mpEventWindow->GetSong()->SetMeterChange(BarNr, Numerator, Denomiator);
+ BarNr += mpEventWindow->GetProject()->GetIntroLength();
+ mpEventWindow->GetProject()->SetMeterChange(BarNr, Numerator, Denomiator);
mpEventWindow->Refresh();
mpEventWindow->FinishMeterEdit();
return false;
Modified: trunk/jazz/src/EventWindow.cpp
===================================================================
--- trunk/jazz/src/EventWindow.cpp 2010-04-04 20:30:59 UTC (rev 743)
+++ trunk/jazz/src/EventWindow.cpp 2010-04-05 03:53:42 UTC (rev 744)
@@ -35,9 +35,9 @@
#include "Dialogs.h"
#include "EventFrame.h"
#include "Filter.h"
+#include "Help.h"
#include "MouseAction.h"
-#include "Song.h"
-#include "Help.h"
+#include "Project.h"
#include "ProjectManager.h"
#include <wx/dc.h>
@@ -59,7 +59,7 @@
//-----------------------------------------------------------------------------
JZEventWindow::JZEventWindow(
wxFrame* pParent,
- JZSong* pSong,
+ JZProject* pProject,
const wxPoint& Position,
const wxSize& Size)
: wxWindow(
@@ -71,7 +71,7 @@
mpSnapSel(0),
mpFilter(0),
mpMouseAction(0),
- mpSong(pSong),
+ mpProject(pProject),
mpGreyColor(0),
mpGreyBrush(0),
mClockTicsPerPixel(36),
@@ -95,7 +95,7 @@
{
mpSnapSel = new JZSnapSelection(this);
- mpFilter = new JZFilter(mpSong);
+ mpFilter = new JZFilter(mpProject);
#ifdef __WXMSW__
mpGreyColor = new wxColor(192, 192, 192);
@@ -181,7 +181,7 @@
if (QuantizeDialog.ShowModal() == wxID_OK)
{
- int Step = mpSong->GetTicksPerQuarter() * 4 / QuantizationStep;
+ int Step = mpProject->GetTicksPerQuarter() * 4 / QuantizationStep;
tCmdQuantize QuantizeCommand(
mpFilter,
@@ -397,7 +397,7 @@
int& EventHeight) const
{
int TotalClockTics =
- mpSong->GetMaxQuarters() * mpSong->GetTicksPerQuarter();
+ mpProject->GetMaxQuarters() * mpProject->GetTicksPerQuarter();
EventWidth = TotalClockTics / mClockTicsPerPixel;
EventHeight = 127 * mTrackHeight;
}
@@ -469,7 +469,7 @@
int JZEventWindow::x2BarClock(int x, int Next)
{
int Clock = x2Clock(x);
- JZBarInfo BarInfo(*mpSong);
+ JZBarInfo BarInfo(*mpProject);
BarInfo.SetClock(Clock);
while (Next--)
{
Modified: trunk/jazz/src/EventWindow.h
===================================================================
--- trunk/jazz/src/EventWindow.h 2010-04-04 20:30:59 UTC (rev 743)
+++ trunk/jazz/src/EventWindow.h 2010-04-05 03:53:42 UTC (rev 744)
@@ -28,7 +28,7 @@
class JZFilter;
class JZMouseAction;
class JZSnapSelection;
-class JZSong;
+class JZProject;
class wxDialog;
//*****************************************************************************
@@ -42,14 +42,14 @@
JZEventWindow(
wxFrame* pParent,
- JZSong* pSong,
+ JZProject* pProject,
const wxPoint& Position = wxDefaultPosition,
const wxSize& Size = wxDefaultSize);
virtual ~JZEventWindow();
// WARNING: non-constant access.
- JZSong* GetSong() const;
+ JZProject* GetProject() const;
bool AreEventsSelected();
@@ -130,7 +130,7 @@
protected:
- JZSong* mpSong;
+ JZProject* mpProject;
wxColor* mpGreyColor;
wxBrush* mpGreyBrush;
@@ -162,9 +162,9 @@
// WARNING: non-constant access.
//-----------------------------------------------------------------------------
inline
-JZSong* JZEventWindow::GetSong() const
+JZProject* JZEventWindow::GetProject() const
{
- return mpSong;
+ return mpProject;
}
#endif // !defined(JZ_EVENTWINDOW_H)
Modified: trunk/jazz/src/PianoFrame.cpp
===================================================================
--- trunk/jazz/src/PianoFrame.cpp 2010-04-04 20:30:59 UTC (rev 743)
+++ trunk/jazz/src/PianoFrame.cpp 2010-04-05 03:53:42 UTC (rev 744)
@@ -210,7 +210,7 @@
JZPianoFrame::JZPianoFrame(
wxWindow* pParent,
const wxString& Title,
- JZSong* pSong,
+ JZProject* pProject,
const wxPoint& Position,
const wxSize& Size)
: wxFrame(
@@ -223,7 +223,7 @@
mpPianoWindow(0),
// mpFileMenu(0),
// mpEditMenu(0)
- mpSong(pSong),
+ mpProject(pProject),
mpToolBar(0)
{
CreateToolBar();
@@ -242,7 +242,7 @@
mTrackIndex = 0;
mpToolBar->ToggleTool(ID_SNAP_16, TRUE);
- mpPianoWindow = new JZPianoWindow(this, pSong);
+ mpPianoWindow = new JZPianoWindow(this, pProject);
}
//-----------------------------------------------------------------------------
Modified: trunk/jazz/src/PianoFrame.h
===================================================================
--- trunk/jazz/src/PianoFrame.h 2010-04-04 20:30:59 UTC (rev 743)
+++ trunk/jazz/src/PianoFrame.h 2010-04-05 03:53:42 UTC (rev 744)
@@ -29,11 +29,11 @@
#include <wx/frame.h>
class JZGuitarFrame;
-class JZSong;
+class JZPianoWindow;
+class JZProject;
class JZToolBar;
+class JZTrack;
class tCtrlEditBase;
-class JZTrack;
-class JZPianoWindow;
//*****************************************************************************
//*****************************************************************************
@@ -46,7 +46,7 @@
JZPianoFrame(
wxWindow* pParent,
const wxString& Title,
- JZSong* pSong,
+ JZProject* pProject,
const wxPoint& Position = wxDefaultPosition,
const wxSize& Size = wxDefaultSize);
@@ -132,7 +132,7 @@
JZPianoWindow* mpPianoWindow;
int mClockTicsPerPixel;
- JZSong* mpSong;
+ JZProject* mpProject;
wxDialog* mpDialogBox;
wxDialog* MixerForm;
Modified: trunk/jazz/src/PianoWindow.cpp
===================================================================
--- trunk/jazz/src/PianoWindow.cpp 2010-04-04 20:30:59 UTC (rev 743)
+++ trunk/jazz/src/PianoWindow.cpp 2010-04-05 03:53:42 UTC (rev 744)
@@ -241,7 +241,7 @@
Win = pPianoWindow;
// BUG FIX: undo/redo
- Win->GetSong()->NewUndoBuffer();
+ Win->GetProject()->NewUndoBuffer();
wxClientDC Dc(Win);
@@ -390,7 +390,7 @@
Win = pPianoWindow;
// BUG FIX: undo/redo
- Win->GetSong()->NewUndoBuffer();
+ Win->GetProject()->NewUndoBuffer();
//
wxClientDC Dc(Win);
Win->PrepareDC(Dc);
@@ -479,7 +479,7 @@
mpKeyOn = pKeyOn;
// BUG FIX: undo/redo
- Win->GetSong()->NewUndoBuffer();
+ Win->GetProject()->NewUndoBuffer();
//
wxClientDC Dc(Win);
Dc.SetFont(*(Win->GetFixedFont()));
@@ -639,10 +639,10 @@
//-----------------------------------------------------------------------------
JZPianoWindow::JZPianoWindow(
JZPianoFrame* pPianoFrame,
- JZSong* pSong,
+ JZProject* pProject,
const wxPoint& Position,
const wxSize& Size)
- : JZEventWindow(pPianoFrame, pSong, Position, Size),
+ : JZEventWindow(pPianoFrame, pProject, Position, Size),
mpPianoFrame(pPianoFrame),
mPlayClock(-1),
mSnapCount(0),
@@ -679,7 +679,7 @@
InitColors();
- mpTrack = mpSong->GetTrack(mTrackIndex);
+ mpTrack = mpProject->GetTrack(mTrackIndex);
mFontSize = mPianoFontSizes[1]; // Must be an entry in the array.
@@ -823,7 +823,7 @@
mPianoX = 0;
- JZBarInfo BarInfo(*mpSong);
+ JZBarInfo BarInfo(*mpProject);
//DEBUG cout
//DEBUG << "mLeftInfoWidth: " << mLeftInfoWidth << '\n'
@@ -892,7 +892,7 @@
BarInfo.SetClock(mFromClock);
int StopClk = x2Clock(mCanvasWidth);
int clk = BarInfo.GetClock();
- int intro = mpSong->GetIntroLength();
+ int intro = mpProject->GetIntroLength();
while (clk < StopClk)
{
clk = BarInfo.GetClock();
@@ -1010,9 +1010,9 @@
if (mVisibleAllTracks)
{
- for (int i = 0; i < mpSong->GetTrackCount(); ++i)
+ for (int i = 0; i < mpProject->GetTrackCount(); ++i)
{
- JZTrack* pTrack = mpSong->GetTrack(i);
+ JZTrack* pTrack = mpProject->GetTrack(i);
if (pTrack != mpTrack && IsVisible(pTrack))
{
DrawEvents(LocalDc, pTrack, StatKeyOn, wxLIGHT_GREY_BRUSH, TRUE);
@@ -1173,7 +1173,7 @@
}
return true;
case WXK_DOWN:
- if (mTrackIndex < mpSong->GetTrackCount() - 1)
+ if (mTrackIndex < mpProject->GetTrackCount() - 1)
{
++mTrackIndex;
NewPosition(mTrackIndex, -1);
@@ -1204,7 +1204,7 @@
if (TrackIndex >= 0)
{
mTrackIndex = TrackIndex;
- mpTrack = mpSong->GetTrack(mTrackIndex);
+ mpTrack = mpProject->GetTrack(mTrackIndex);
mpPianoFrame->SetTitle(mpTrack->GetName());
SetYScrollPosition(TrackIndex2y(mFromLines[mTrackIndex]));
@@ -1732,7 +1732,7 @@
if (action)
{
- if (!gpMidiPlayer->Playing)
+ if (!gpMidiPlayer->IsPlaying())
{
int Clock, LoopClock;
if (action == MA_CYCLE)
@@ -2000,7 +2000,7 @@
// Avoid permenent redraws when end of scroll range is reached.
if (
Clock > mFromClock &&
- mToClock >= mpSong->GetMaxQuarters() * mpSong->GetTicksPerQuarter())
+ mToClock >= mpProject->GetMaxQuarters() * mpProject->GetTicksPerQuarter())
{
return;
}
@@ -2259,9 +2259,9 @@
else if (mVisibleAllTracks)
{
// event not found, maybe change to another Track
- for (int i = 0; i < mpSong->GetTrackCount(); ++i)
+ for (int i = 0; i < mpProject->GetTrackCount(); ++i)
{
- JZTrack* pTrack = mpSong->GetTrack(i);
+ JZTrack* pTrack = mpProject->GetTrack(i);
if (IsVisible(pTrack) && FindEvent(pTrack, Clock, Pitch))
{
NewPosition(i, -1);
@@ -2387,7 +2387,7 @@
//-----------------------------------------------------------------------------
int JZPianoWindow::SnapClocks()
{
- int Clock = mpSong->GetTicksPerQuarter() * 4 / mSnapDenomiator;
+ int Clock = mpProject->GetTicksPerQuarter() * 4 / mSnapDenomiator;
if (Clock < 1)
{
return 1;
@@ -2814,7 +2814,7 @@
//-----------------------------------------------------------------------------
void JZPianoWindow::Redo()
{
- mpSong->Redo();
+ mpProject->Redo();
Refresh();
if (mpCtrlEdit && mpTrack >= 0)
{
@@ -2827,7 +2827,7 @@
//-----------------------------------------------------------------------------
void JZPianoWindow::Undo()
{
- mpSong->Undo();
+ mpProject->Undo();
Refresh();
if (mpCtrlEdit && mpTrack >= 0)
{
@@ -3024,7 +3024,7 @@
return;
}
- mpSong->NewUndoBuffer();
+ mpProject->NewUndoBuffer();
mPasteBuffer.Clear();
mPasteBuffer.Put(pEvent->Copy());
@@ -3097,7 +3097,7 @@
Pitch = -1;
}
- mpSong->NewUndoBuffer();
+ mpProject->NewUndoBuffer();
tEventIterator Iterator(&mPasteBuffer);
JZEvent* pEvent = Iterator.First();
if (pEvent)
Modified: trunk/jazz/src/PianoWindow.h
===================================================================
--- trunk/jazz/src/PianoWindow.h 2010-04-04 20:30:59 UTC (rev 743)
+++ trunk/jazz/src/PianoWindow.h 2010-04-05 03:53:42 UTC (rev 744)
@@ -30,12 +30,12 @@
#include <wx/brush.h>
+class tCtrlEditBase;
+class JZEvent;
+class JZFilter;
class JZPianoFrame;
-class JZSong;
+class JZProject;
class JZTrack;
-class JZEvent;
-class JZFilter;
-class tCtrlEditBase;
//*****************************************************************************
//*****************************************************************************
@@ -70,7 +70,7 @@
JZPianoWindow(
JZPianoFrame* pFrame,
- JZSong* pSong,
+ JZProject* pProject,
const wxPoint& Position = wxDefaultPosition,
const wxSize& Size = wxDefaultSize);
Modified: trunk/jazz/src/Player.cpp
===================================================================
--- trunk/jazz/src/Player.cpp 2010-04-04 20:30:59 UTC (rev 743)
+++ trunk/jazz/src/Player.cpp 2010-04-05 03:53:42 UTC (rev 744)
@@ -182,36 +182,125 @@
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
JZPlayer::JZPlayer(JZSong* pSong)
- : mSamples(pSong->GetTicksPerQuarter() * pSong->Speed())
+ : mOutClock(0),
+ mpPlayLoop(0),
+ mPollMillisec(200),
+ mpRecordingInfo(0),
+ mPlaying(false),
+ mpSong(pSong),
+ mpAudioBuffer(0),
+ mSamples(pSong->GetTicksPerQuarter() * pSong->Speed())
{
DummyDeviceList.Add("default");
- poll_millisec = 200; // default
- Song = pSong;
- OutClock = 0;
- Playing = false;
- PlayLoop = new tPlayLoop();
- AudioBuffer = 0;
- mpRecordingInfo = 0;
+ mpPlayLoop = new tPlayLoop();
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
JZPlayer::~JZPlayer()
{
- delete PlayLoop;
+ delete mpPlayLoop;
mPlayBuffer.Clear();
mRecdBuffer.Clear();
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-void JZPlayer::ShowError()
+void JZPlayer::Notify()
{
- wxMessageBox("could not install driver", "Error", wxOK);
+ // called by timer
+ long Now = GetRealTimeClock();
+
+#ifdef DEBUG_PLAYER_NOTIFY
+ cout << "JZPlayer::Notify " << Now << endl;
+#endif // DEBUG_PLAYER_NOTIFY
+ if (Now < 0)
+ {
+ return;
+ }
+
+ // time to put more events
+ if (Now >= (mOutClock - ADVANCE_PLAY))
+ {
+#ifdef DEBUG_PLAYER_NOTIFY
+ cout << "*** Notify: more events to playbuffer" << endl;
+#endif // DEBUG_PLAYER_NOTIFY
+
+ mpPlayLoop->PrepareOutput(
+ &mPlayBuffer,
+ mpSong,
+ mOutClock,
+ Now + DELTACLOCK,
+ 0);
+ if (mpAudioBuffer)
+ {
+ mpPlayLoop->PrepareOutput(
+ mpAudioBuffer,
+ mpSong,
+ mOutClock,
+ Now + DELTACLOCK,
+ 1);
+ }
+ mOutClock = Now + DELTACLOCK;
+ mPlayBuffer.Length2Keyoff();
+ }
+
+ // optimization:
+ //
+ // if (there are some events to be played)
+ // send them to driver
+ // else
+ // tell the driver that there is nothing to do at the moment
+ if (mPlayBuffer.nEvents && mPlayBuffer.Events[0]->GetClock() < mOutClock)
+ {
+ FlushToDevice();
+ }
+ else
+ {
+ // Does nothing unless mOutClock has changed.
+ OutBreak();
+ }
}
//-----------------------------------------------------------------------------
+// Description:
+// Try to send all events up to mOutClock to device.
//-----------------------------------------------------------------------------
+void JZPlayer::FlushToDevice()
+{
+ int BufferFull = 0;
+
+ tEventIterator Iterator(&mPlayBuffer);
+ JZEvent* pEvent = Iterator.Range(0, mOutClock);
+ while (!BufferFull && pEvent)
+ {
+ if (OutEvent(pEvent) != 0)
+ BufferFull = 1;
+ else
+ {
+ pEvent->Kill();
+ pEvent = Iterator.Next();
+ }
+ }
+
+ if (!BufferFull)
+ OutBreak();
+ mPlayBuffer.Cleanup(0);
+}
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+void JZPlayer::OutNow(JZTrack *t, tParam *r)
+{
+ OutNow(t, &r->mMsb);
+ OutNow(t, &r->mLsb);
+ OutNow(t, &r->mDataMsb);
+ OutNow(t, &r->mResetMsb);
+ OutNow(t, &r->mResetLsb);
+}
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
void JZPlayer::StartPlay(long Clock, long LoopClock, int Continue)
{
#ifdef DEBUG_PLAYER_STARTPLAY
@@ -222,19 +311,19 @@
if (LoopClock > 0)
{
- PlayLoop->Set(Clock, LoopClock);
+ mpPlayLoop->Set(Clock, LoopClock);
}
else
{
- PlayLoop->Reset();
+ mpPlayLoop->Reset();
}
- Clock = PlayLoop->Int2ExtClock(Clock);
+ Clock = mpPlayLoop->Int2ExtClock(Clock);
mPlayBuffer.Clear();
mRecdBuffer.Clear();
- if (AudioBuffer)
+ if (mpAudioBuffer)
{
- AudioBuffer->Clear();
+ mpAudioBuffer->Clear();
}
JZTrack *t;
@@ -246,16 +335,16 @@
((Clock == 0) && (gpConfig->GetValue(C_SendSynthReset) == 1)))
{
// fixme: we should have different synths for each device
- t = Song->GetTrack(0);
+ t = mpSong->GetTrack(0);
JZEvent* mpResetEvent = gpSynth->CreateResetEvent();
OutNow(t, mpResetEvent);
delete mpResetEvent;
}
// Send Volume, Pan, Chorus, etc
- for (i = 0; i < Song->GetTrackCount(); ++i)
+ for (i = 0; i < mpSong->GetTrackCount(); ++i)
{
- t = Song->GetTrack(i);
+ t = mpSong->GetTrack(i);
if (t->mpBank)
{
OutNow(t, t->mpBank);
@@ -459,7 +548,7 @@
} // for
} // if !Continue
- t = Song->GetTrack(0);
+ t = mpSong->GetTrack(0);
JZEvent* pEvent = t->GetCurrentTempo(Clock);
if (pEvent)
{
@@ -481,23 +570,34 @@
gpConfig->GetValue(C_ThruInput),
gpConfig->GetValue(C_ThruOutput));
- OutClock = Clock + FIRST_DELTACLOCK;
+ mOutClock = Clock + FIRST_DELTACLOCK;
JZProjectManager::Instance()->NewPlayPosition(
- PlayLoop->Ext2IntClock(Clock));
+ mpPlayLoop->Ext2IntClock(Clock));
- PlayLoop->PrepareOutput(&mPlayBuffer, Song, Clock, Clock + FIRST_DELTACLOCK, 0);
- if (AudioBuffer)
+ mpPlayLoop->PrepareOutput(
+ &mPlayBuffer,
+ mpSong,
+ Clock,
+ Clock + FIRST_DELTACLOCK,
+ 0);
+
+ if (mpAudioBuffer)
{
- PlayLoop->PrepareOutput(AudioBuffer, Song, Clock, Clock + FIRST_DELTACLOCK, 1);
+ mpPlayLoop->PrepareOutput(
+ mpAudioBuffer,
+ mpSong,
+ Clock,
+ Clock + FIRST_DELTACLOCK,
+ 1);
}
mPlayBuffer.Length2Keyoff();
// Notify() has to be called very often because voxware
// midi thru is done there
- Start(poll_millisec); // start wxTimer
+ Start(mPollMillisec); // start wxTimer
- Playing = true;
+ mPlaying = true;
}
//-----------------------------------------------------------------------------
@@ -506,7 +606,7 @@
{
// Stop the wxTimer.
Stop();
- Playing = false;
+ mPlaying = false;
long Clock = GetRealTimeClock();
@@ -514,9 +614,9 @@
int ii;
tKeyOff pKeyOff(0, 0, 0);
- for (ii = 0; ii < Song->GetTrackCount(); ii++)
+ for (ii = 0; ii < mpSong->GetTrackCount(); ii++)
{
- JZTrack *Track = Song->GetTrack(ii);
+ JZTrack *Track = mpSong->GetTrack(ii);
if (Track)
{
tEventIterator Iterator(Track);
@@ -543,80 +643,6 @@
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-void JZPlayer::Notify()
-{
- // called by timer
- long Now = GetRealTimeClock();
-
-#ifdef DEBUG_PLAYER_NOTIFY
- cout << "JZPlayer::Notify " << Now << endl;
-#endif // DEBUG_PLAYER_NOTIFY
- if (Now < 0)
- {
- return;
- }
-
- // time to put more events
- if (Now >= (OutClock - ADVANCE_PLAY))
- {
-#ifdef DEBUG_PLAYER_NOTIFY
- cout << "*** Notify: more events to playbuffer" << endl;
-#endif // DEBUG_PLAYER_NOTIFY
-
- PlayLoop->PrepareOutput(&mPlayBuffer, Song, OutClock, Now + DELTACLOCK, 0);
- if (AudioBuffer)
- {
- PlayLoop->PrepareOutput(AudioBuffer, Song, OutClock, Now + DELTACLOCK, 1);
- }
- OutClock = Now + DELTACLOCK;
- mPlayBuffer.Length2Keyoff();
- }
-
- // optimization:
- //
- // if (there are some events to be played)
- // send them to driver
- // else
- // tell the driver that there is nothing to do at the moment
- if (mPlayBuffer.nEvents && mPlayBuffer.Events[0]->GetClock() < OutClock)
- {
- FlushToDevice();
- }
- else
- {
- // Does nothing unless OutClock has changed.
- OutBreak();
- }
-}
-
-//-----------------------------------------------------------------------------
-// Description:
-// Try to send all events up to OutClock to device.
-//-----------------------------------------------------------------------------
-void JZPlayer::FlushToDevice()
-{
- int BufferFull = 0;
-
- tEventIterator Iterator(&mPlayBuffer);
- JZEvent* pEvent = Iterator.Range(0, OutClock);
- while (!BufferFull && pEvent)
- {
- if (OutEvent(pEvent) != 0)
- BufferFull = 1;
- else
- {
- pEvent->Kill();
- pEvent = Iterator.Next();
- }
- }
-
- if (!BufferFull)
- OutBreak();
- mPlayBuffer.Cleanup(0);
-}
-
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
void JZPlayer::AllNotesOff(int Reset)
{
tControl NoteOff(0, 0, 0x78, 0);
@@ -652,15 +678,18 @@
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-void JZPlayer::OutNow(JZTrack *t, tParam *r)
+void JZPlayer::ShowError()
{
- OutNow(t, &r->mMsb);
- OutNow(t, &r->mLsb);
- OutNow(t, &r->mDataMsb);
- OutNow(t, &r->mResetMsb);
- OutNow(t, &r->mResetLsb);
+ wxMessageBox("could not install driver", "Error", wxOK);
}
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+void JZPlayer::EditGlobalAudioSettings(wxWindow* pParent)
+{
+ mSamples.GlobalSettingsDlg();
+}
+
#ifdef DEV_MPU401
//*****************************************************************************
@@ -671,7 +700,7 @@
tMpuPlayer::tMpuPlayer(JZSong* pSong)
: JZPlayer(pSong)
{
- poll_millisec = 25;
+ mPollMillisec = 25;
midinethost = getenv("MIDINETHOST");
if (!midinethost || !strlen(midinethost))
{
@@ -736,7 +765,7 @@
//-----------------------------------------------------------------------------
void tMpuPlayer::StartPlay(long IntClock, long LoopClock, int Continue)
{
- long ExtClock = PlayLoop->Int2ExtClock(IntClock);
+ long ExtClock = mpPlayLoop->Int2ExtClock(IntClock);
char *play;
int playsize;
@@ -794,7 +823,7 @@
// Setup Timebase
char timebase[2];
timebase[0] = CMD+1;
- switch (Song->GetTicksPerQuarter())
+ switch (mpSong->GetTicksPerQuarter())
{
case 48: timebase[1] = 0xc2; break;
case 72: timebase[1] = 0xc3; break;
@@ -1004,13 +1033,14 @@
//-----------------------------------------------------------------------------
void tMpuPlayer::OutBreak()
{
- // send a break to the driver starting at PlyBytes.GetClock() and ending at OutClock
+ // Send a break to the driver starting at PlyBytes.GetClock() and ending at
+ // mOutClock.
if (!PlyBytes.WriteFile(dev))
{
return;
}
- (void)OutBreak(OutClock);
+ (void)OutBreak(mOutClock);
PlyBytes.WriteFile(dev);
}
@@ -1182,14 +1212,14 @@
if ((clock_to_host_counter % 32) == 0)
{
JZProjectManager::Instance()->NewPlayPosition(
- PlayLoop->Ext2IntClock(playclock));
+ mpPlayLoop->Ext2IntClock(playclock));
}
#else
// Update screen every 8'th note (120 ticks/beat).
if ((clock_to_host_counter % 4) == 0)
{
JZProjectManager::Instance()->NewPlayPosition(
- PlayLoop->Ext2IntClock(playclock));
+ mpPlayLoop->Ext2IntClock(playclock));
}
#endif
FlushOutOfBand(playclock);
@@ -1225,7 +1255,7 @@
case 3:
gpMidiPlayer->StopPlay();
d1 = c;
- ExtClock = (d0 + (128 * d1)) * (Song->GetTicksPerQuarter() / 4);
+ ExtClock = (d0 + (128 * d1)) * (mpSong->GetTicksPerQuarter() / 4);
receiving_song_ptr = 0;
d0 = d1 = 0;
gpMidiPlayer->StartPlay(ExtClock, 0, 1);
@@ -1330,7 +1360,7 @@
}
if (pEvent)
{
- pEvent->Clock = PlayLoop->Ext2IntClock(pEvent->Clock);
+ pEvent->Clock = mpPlayLoop->Ext2IntClock(pEvent->Clock);
mRecdBuffer.Put(pEvent);
}
}
@@ -1464,8 +1494,8 @@
tSeq2Player::tSeq2Player(JZSong* pSong)
: JZPlayer(pSong)
{
- // got to poll fast for midi thru
- poll_millisec = 10;
+ // The code has to poll fast for MIDI thru.
+ mPollMillisec = 10;
recd_clock = 0;
play_clock = 0;
@@ -1820,7 +1850,7 @@
//-----------------------------------------------------------------------------
void tSeq2Player::OutBreak()
{
- OutBreak(OutClock);
+ OutBreak(mOutClock);
seqbuf_dump();
}
@@ -1877,7 +1907,7 @@
recd_clock = Clock;
JZProjectManager::Instance()->NewPlayPosition(
- PlayLoop->Ext2IntClock(Clock));
+ mpPlayLoop->Ext2IntClock(Clock));
// send initial program changes, controller etc
SEQ_START_TIMER();
@@ -1889,8 +1919,8 @@
seqbuf_dump();
// setup timebase and current speed
- int time_base = Song->GetTicksPerQuarter();
- int cur_speed = Song->GetTrack(0)->GetCurrentSpeed(Clock);
+ int time_base = mpSong->GetTicksPerQuarter();
+ int cur_speed = mpSong->GetTrack(0)->GetCurrentSpeed(Clock);
if (ioctl(seqfd, SNDCTL_TMR_TIMEBASE, &time_base) < 0)
perror("ioctl time_base");
if (ioctl(seqfd, SNDCTL_TMR_TEMPO, &cur_speed) < 0)
@@ -1929,12 +1959,12 @@
}
//-----------------------------------------------------------------------------
-// try to send all events up to OutClock to device
+// try to send all events up to mOutClock to device
//-----------------------------------------------------------------------------
void tSeq2Player::FlushToDevice()
{
tEventIterator Iterator(&mPlayBuffer);
- JZEvent* pEvent = Iterator.Range(0, OutClock);
+ JZEvent* pEvent = Iterator.Range(0, mOutClock);
if (pEvent)
{
do
@@ -1946,7 +1976,7 @@
mPlayBuffer.Cleanup(0);
}
- OutBreak(OutClock);
+ OutBreak(mOutClock);
seqbuf_dump();
}
@@ -2054,7 +2084,7 @@
if (pEvent)
{
- pEvent->SetClock(PlayLoop->Ext2IntClock(recd_clock));
+ pEvent->SetClock(mpPlayLoop->Ext2IntClock(recd_clock));
mRecdBuffer.Put(pEvent);
pEvent = 0;
}
@@ -2063,7 +2093,7 @@
}
JZProjectManager::Instance()->NewPlayPosition(
- PlayLoop->Ext2IntClock(recd_clock/48 * 48));
+ mpPlayLoop->Ext2IntClock(recd_clock/48 * 48));
return recd_clock;
}
Modified: trunk/jazz/src/Player.h
===================================================================
--- trunk/jazz/src/Player.h 2010-04-04 20:30:59 UTC (rev 743)
+++ trunk/jazz/src/Player.h 2010-04-05 03:53:42 UTC (rev 744)
@@ -40,40 +40,6 @@
//*****************************************************************************
//*****************************************************************************
-class tPlayLoop
-{
- public:
-
- tPlayLoop();
-
- void Set(long Start, long Stop);
-
- void Reset();
-
- // external clock -> internal clock where
- // external clock == physical clock
- // internal clock == song position
- long Ext2IntClock(long Clock);
-
- // the other way round
- long Int2ExtClock(long Clock);
-
- void PrepareOutput(
- tEventArray* pEventArray,
- JZSong* pSong,
- long ExtFr,
- long ExtTo,
- int mode = 0);
-
- private:
-
- long mStartClock;
-
- long mStopClock;
-};
-
-//*****************************************************************************
-//*****************************************************************************
enum tClockSource
{
CsInt = 0,
@@ -131,38 +97,120 @@
//*****************************************************************************
//*****************************************************************************
-class JZPlayer : public wxTimer
+class tPlayLoop
{
- protected:
+ public:
- long OutClock;
- tPlayLoop* PlayLoop;
- // timer value for polling the record queue
- int poll_millisec;
- JZRecordingInfo* mpRecordingInfo; // 0 == not recording
+ tPlayLoop();
+ void Set(long Start, long Stop);
+ void Reset();
+
+ // external clock -> internal clock where
+ // external clock == physical clock
+ // internal clock == song position
+ long Ext2IntClock(long Clock);
+
+ // the other way round
+ long Int2ExtClock(long Clock);
+
+ void PrepareOutput(
+ tEventArray* pEventArray,
+ JZSong* pSong,
+ long ExtFr,
+ long ExtTo,
+ int mode = 0);
+
+ private:
+
+ long mStartClock;
+
+ long mStopClock;
+};
+
+//*****************************************************************************
+//*****************************************************************************
+class JZPlayer : public wxTimer
+{
public:
- bool Playing; // successful StartPlay
+ JZPlayer(JZSong* pSong);
+ virtual ~JZPlayer();
+
+ void Notify();
+
+ virtual void FlushToDevice();
+
+ // return 0 = ok, 1 = buffer full, try again later
+ virtual int OutEvent(JZEvent* pEvent) = 0;
+
+ virtual void OutBreak() = 0;
+
+ // Send event immediately ignoring the clock.
+ void OutNow(JZTrack *t, JZEvent* pEvent)
+ {
+ pEvent->SetDevice(t->GetDevice());
+ OutNow(pEvent);
+ }
+
+ void OutNow(int device, JZEvent* pEvent)
+ {
+ pEvent->SetDevice(device);
+ OutNow(pEvent);
+ }
+
+ void OutNow(JZTrack* t, tParam* r);
+
+ // what's played right now?
+ virtual long GetRealTimeClock() = 0;
+
+ virtual void StartPlay(long Clock, long LoopClock = 0, int Continue = 0);
+ virtual void StopPlay();
+ virtual void AllNotesOff(int Reset = 0);
+
+ virtual void SetSoftThru(int on, int idev, int odev)
+ {
+ }
+
+ virtual void SetHardThru(int on, int idev, int odev)
+ {
+ }
+
+ virtual void InitMtcRec()
+ {
+ }
+
+ virtual tMtcTime* FreezeMtcRec()
+ {
+ return 0;
+ }
+
// Tests if hardware found and successfully setup.
virtual bool IsInstalled() = 0;
// if unable to install, pop up a messagebox explaining why.
virtual void ShowError();
- JZSong *Song;
- tEventArray mPlayBuffer;
- tEventArray mRecdBuffer;
- void SetRecordInfo(JZRecordingInfo* inf)
+ const tEventArray& GetRecordBuffer() const
{
- mpRecordingInfo = inf;
+ return mRecdBuffer;
}
+ void SetRecordInfo(JZRecordingInfo* pRecordingInfo)
+ {
+ mpRecordingInfo = pRecordingInfo;
+ }
+
+ bool IsRecordBufferEmpty() const
+ {
+ return mRecdBuffer.IsEmpty();
+ }
+
bool IsPlaying() const
{
- return Playing;
+ return mPlaying;
}
virtual int FindMidiDevice()
@@ -170,24 +218,52 @@
return -1;
}
- virtual int SupportsMultipleDevices() { return 0; }
- virtual tDeviceList & GetOutputDevices() { return DummyDeviceList; }
- virtual tDeviceList & GetInputDevices() { return DummyDeviceList; }
- virtual int GetThruInputDevice() { return 0; }
- virtual int GetThruOutputDevice() { return 0; }
+ virtual int SupportsMultipleDevices()
+ {
+ return 0;
+ }
+ virtual tDeviceList& GetOutputDevices()
+ {
+ return DummyDeviceList;
+ }
+ virtual tDeviceList& GetInputDevices()
+ {
+ return DummyDeviceList;
+ }
+ virtual int GetThruInputDevice()
+ {
+ return 0;
+ }
+ virtual int GetThruOutputDevice()
+ {
+ return 0;
+ }
// Audio stuff
- virtual void StartAudio() {}
- tEventArray *AudioBuffer;
- virtual int GetAudioEnabled() const { return 0; }
- virtual void SetAudioEnabled(int) { }
- virtual void ListenAudio(int key, int start_stop_mode = 1) {}
- virtual void ListenAudio(tSample &spl, long fr_smpl, long to_smpl) {}
- virtual bool IsListening() const { return 0; }
+ virtual void StartAudio()
+ {
+ }
+ virtual int GetAudioEnabled() const
+ {
+ return 0;
+ }
+ virtual void SetAudioEnabled(int)
+ {
+ }
+ virtual void ListenAudio(int key, int start_stop_mode = 1)
+ {
+ }
+ virtual void ListenAudio(tSample &spl, long fr_smpl, long to_smpl)
+ {
+ }
+ virtual bool IsListening() const
+ {
+ return 0;
+ }
virtual int OnMenuCommand(int id)
{
- if (Playing)
+ if (mPlaying)
{
return 0;
}
@@ -201,10 +277,12 @@
virtual void AdjustAudioLength(JZTrack *t)
{
- long ticks_per_minute = Song->GetTicksPerQuarter() * Song->Speed();
+ long ticks_per_minute = mpSong->GetTicksPerQuarter() * mpSong->Speed();
mSamples.AdjustAudioLength(t, ticks_per_minute);
}
+ void EditGlobalAudioSettings(wxWindow* pParent);
+
void EditSample(int key)
{
mSamples.Edit(key);
@@ -222,66 +300,31 @@
protected:
- tSampleSet mSamples;
+ virtual void OutNow(JZEvent* pEvent) = 0;
- public:
+ protected:
- JZPlayer(JZSong *song);
+ long mOutClock;
- virtual ~JZPlayer();
+ tPlayLoop* mpPlayLoop;
- void Notify();
+ // This is the timer value for polling the record queue.
+ int mPollMillisec;
- virtual void FlushToDevice();
+ // If this value is 0, then not recording.
+ JZRecordingInfo* mpRecordingInfo;
- // return 0 = ok, 1 = buffer full, try again later
- virtual int OutEvent(JZEvent* pEvent) = 0;
+ bool mPlaying;
- virtual void OutBreak() = 0;
+ JZSong* mpSong;
- // send event immediately ignoring clock
- void OutNow(JZTrack *t, JZEvent* pEvent)
- {
- pEvent->SetDevice(t->GetDevice());
- OutNow(pEvent);
- }
+ tEventArray mPlayBuffer;
+ tEventArray mRecdBuffer;
- void OutNow(int device, JZEvent* pEvent)
- {
- pEvent->SetDevice(device);
- OutNow(pEvent);
- }
+ tEventArray* mpAudioBuffer;
- void OutNow(JZTrack *t, tParam *r);
+ tSampleSet mSamples;
- // what's played right now?
- virtual long GetRealTimeClock() = 0;
-
- virtual void StartPlay(long Clock, long LoopClock = 0, int Continue = 0);
- virtual void StopPlay();
- virtual void AllNotesOff(int Reset = 0);
-
- virtual void SetSoftThru(int on, int idev, int odev)
- {
- }
-
- virtual void SetHardThru(int on, int idev, int odev)
- {
- }
-
- virtual void InitMtcRec()
- {
- }
-
- virtual tMtcTime* FreezeMtcRec()
- {
- return 0;
- }
-
- protected:
-
- virtual void OutNow(JZEvent* pEvent) = 0;
-
private:
tDeviceList DummyDeviceList;
@@ -576,7 +619,7 @@
public:
friend class tOSSThru;
- tSeq2Player(JZSong *song);
+ tSeq2Player(JZSong* pSong);
virtual bool IsInstalled();
virtual ~tSeq2Player();
int OutEvent(JZEvent *e, int now);
Modified: trunk/jazz/src/PortMidiPlayer.cpp
===================================================================
--- trunk/jazz/src/PortMidiPlayer.cpp 2010-04-04 20:30:59 UTC (rev 743)
+++ trunk/jazz/src/PortMidiPlayer.cpp 2010-04-05 03:53:42 UTC (rev 744)
@@ -227,7 +227,7 @@
void JZPortMidiPlayer::SetTempo(int bpm, int clock)
{
int t1 = Clock2Time(clock);
- mTicksPerMinute = bpm * Song->GetTicksPerQuarter();
+ mTicksPerMinute = bpm * mpSong->GetTicksPerQuarter();
int t2 = Clock2Time(clock);
mStartTime += (t1 - t2);
}
@@ -378,7 +378,7 @@
mStartTime = Pt_Time() + 500;
mStartClock = clock;
- mTicksPerMinute = Song->GetTicksPerQuarter() * Song->Speed();
+ mTicksPerMinute = mpSong->GetTicksPerQuarter() * mpSong->Speed();
JZPlayer::StartPlay(clock, loopClock, cont);
}
@@ -406,7 +406,7 @@
long t = Pt_Time();
gpTrackWindow->NewPlayPosition(
- PlayLoop->Ext2IntClock(Time2Clock(t) / 48 * 48));
+ mpPlayLoop->Ext2IntClock(Time2Clock(t) / 48 * 48));
return Time2Clock(t);
}
Modified: trunk/jazz/src/Project.cpp
===================================================================
--- trunk/jazz/src/Project.cpp 2010-04-04 20:30:59 UTC (rev 743)
+++ trunk/jazz/src/Project.cpp 2010-04-05 03:53:42 UTC (rev 744)
@@ -341,10 +341,8 @@
StartUpSong = mpConfig->GetStrValue(C_StartUpSong);
}
- FILE* pFd = fopen(StartUpSong.c_str(), "r");
- if (pFd)
+ if (wxFileName::IsFileReadable(StartUpSong.c_str()))
{
- fclose(pFd);
JZStandardRead Io;
Read(Io, StartUpSong.c_str());
}
@@ -623,6 +621,13 @@
}
//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+void JZProject::EditAudioGlobalSettings(wxWindow* pParent)
+{
+ mpMidiPlayer->EditGlobalAudioSettings(pParent);
+}
+
+//-----------------------------------------------------------------------------
// Description:
// Sets the internal mpRecInfo, used for recording apparently.
// JZProject will take ownership of this pointer, so don't delete it after
Modified: trunk/jazz/src/Project.h
===================================================================
--- trunk/jazz/src/Project.h 2010-04-04 20:30:59 UTC (rev 743)
+++ trunk/jazz/src/Project.h 2010-04-05 03:53:42 UTC (rev 744)
@@ -23,14 +23,14 @@
#ifndef JZ_PROJECT_H
#define JZ_PROJECT_H
-class JZPlayer;
-class JZSynth;
-class JZFilter;
-
#include "Song.h"
#include "Metronome.h"
+class JZFilter;
+class JZPlayer;
class JZRecordingInfo;
+class JZSynth;
+class wxWindow;
//*****************************************************************************
// Description:
@@ -156,6 +156,8 @@
// Sets RecInfo, JZProject takes ownership of this object
void SetRecInfo(JZRecordingInfo* pRecInfo);
+ void EditAudioGlobalSettings(wxWindow* pParent);
+
JZPlayer* GetPlayer()
{
return mpMidiPlayer;
Modified: trunk/jazz/src/ProjectManager.cpp
===================================================================
--- trunk/jazz/src/ProjectManager.cpp 2010-04-04 20:30:59 UTC (rev 743)
+++ trunk/jazz/src/ProjectManager.cpp 2010-04-05 03:53:42 UTC (rev 744)
@@ -66,7 +66,7 @@
mpTrackFrame = new JZTrackFrame(
0,
"Jazz++",
- gpSong,
+ gpProject,
Position,
Size);
}
@@ -96,7 +96,7 @@
mpPianoFrame = new JZPianoFrame(
mpTrackFrame,
"Piano",
- gpSong,
+ gpProject,
Position,
Size);
}
Modified: trunk/jazz/src/Sample.h
===================================================================
--- trunk/jazz/src/Sample.h 2010-04-04 20:30:59 UTC (rev 743)
+++ trunk/jazz/src/Sample.h 2010-04-05 03:53:42 UTC (rev 744)
@@ -256,14 +256,19 @@
return length;
}
- int IsEmpty() const {
+ bool IsEmpty() const
+ {
return length == 0;
}
- void SetExternal(int ext) {
+
+ void SetExternal(int ext)
+ {
external_flag = ext;
//external_time = 0;
}
- int GetExternal() const {
+
+ int GetExternal() const
+ {
return external_flag;
}
Modified: trunk/jazz/src/Track.cpp
===================================================================
--- trunk/jazz/src/Track.cpp 2010-04-04 20:30:59 UTC (rev 743)
+++ trunk/jazz/src/Track.cpp 2010-04-05 03:53:42 UTC (rev 744)
@@ -1687,7 +1687,7 @@
return Events[nEvents - 1]->GetClock();
}
-int tEventArray::IsEmpty()
+bool tEventArray::IsEmpty() const
{
return nEvents == 0;
}
@@ -1999,8 +1999,13 @@
t->nEvents = 0;
}
-
-void JZTrack::MergeRange(tEventArray *other, int FromClock, int ToClock, int Replace)
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+void JZTrack::MergeRange(
+ const tEventArray& Other,
+ int FromClock,
+ int ToClock,
+ int Replace)
{
// Erase destin
if (Replace)
@@ -2015,7 +2020,7 @@
}
// Merge Recorded Events
- tEventIterator Copy(other);
+ tEventIterator Copy(&Other);
JZEvent* pEvent = Copy.Range(FromClock, ToClock);
while (pEvent)
{
Modified: trunk/jazz/src/Track.h
===================================================================
--- trunk/jazz/src/Track.h 2010-04-04 20:30:59 UTC (rev 743)
+++ trunk/jazz/src/Track.h 2010-04-05 03:53:42 UTC (rev 744)
@@ -347,9 +347,9 @@
tDrumInstrumentParameter *NextElem( tDrumInstrumentParameter *cur );
void DelElem( int pit );
void Clear();
- int IsEmpty()
+ bool IsEmpty() const
{
- return( list == 0 );
+ return list == 0;
}
private:
@@ -524,7 +524,7 @@
void Write(JZWriteBase& Io);
int GetLastClock() const;
- int IsEmpty();
+ bool IsEmpty() const;
int GetFirstClock();
int State; // tsXXX
@@ -586,11 +586,13 @@
}
void Merge(tEventArray *other);
+
void MergeRange(
- tEventArray *other,
+ const tEventArray& Other,
int FromClock,
int ToClock,
int Replace = 0);
+
void Undo();
void Redo();
void NewUndoBuffer();
Modified: trunk/jazz/src/TrackFrame.cpp
===================================================================
--- trunk/jazz/src/TrackFrame.cpp 2010-04-04 20:30:59 UTC (rev 743)
+++ trunk/jazz/src/TrackFrame.cpp 2010-04-05 03:53:42 UTC (rev 744)
@@ -120,14 +120,16 @@
JZTrackFrame::JZTrackFrame(
wxWindow* pParent,
const wxString& Title,
- JZSong* pSong,
+ JZProject* pProject,
const wxPoint& Position,
const wxSize& Size)
- : JZEventFrame(pParent, Title, pSong, Position, Size),
+ : JZEventFrame(pParent, Title, pProject, Position, Size),
mpToolBar(0),
mpFileMenu(0),
mpEditMenu(0),
mpToolsMenu(0),
+ mpProject(pProject),
+ mpTrackWindow(0),
mPreviousClock(0),
mPreviouslyRecording(false)
{
@@ -137,7 +139,7 @@
mpTrackWindow = new JZTrackWindow(
this,
- pSong,
+ pProject,
wxPoint(0, 0),
wxSize(600, 120));
@@ -644,7 +646,7 @@
//-----------------------------------------------------------------------------
void JZTrackFrame::OnAudioGlobalSettings(wxCommandEvent& Event)
{
-// mpTrackWindow->EditAudioGlobalSettings(*this);
+ mpProject->EditAudioGlobalSettings(this);
}
//-----------------------------------------------------------------------------
Modified: trunk/jazz/src/TrackFrame.h
===================================================================
--- trunk/jazz/src/TrackFrame.h 2010-04-04 20:30:59 UTC (rev 743)
+++ trunk/jazz/src/TrackFrame.h 2010-04-05 03:53:42 UTC (rev 744)
@@ -28,7 +28,7 @@
#include "EventFrame.h"
-class JZSong;
+class JZProject;
class JZToolBar;
class JZTrackWindow;
class JZPianoWindow;
@@ -42,7 +42,7 @@
JZTrackFrame(
wxWindow* pParent,
const wxString& Title,
- JZSong* pSong,
+ JZProject* pProject,
const wxPoint& Position = wxDefaultPosition,
const wxSize& Size = wxDefaultSize);
@@ -116,6 +116,8 @@
wxMenu* mpToolsMenu;
+ JZProject* mpProject;
+
JZTrackWindow* mpTrackWindow;
int mPreviousClock;
Modified: trunk/jazz/src/TrackWindow.cpp
===================================================================
--- trunk/jazz/src/TrackWindow.cpp 2010-04-04 20:30:59 UTC (rev 743)
+++ trunk/jazz/src/TrackWindow.cpp 2010-04-05 03:53:42 UTC (rev 744)
@@ -67,10 +67,10 @@
//-----------------------------------------------------------------------------
JZTrackWindow::JZTrackWindow(
wxFrame* pParent,
- JZSong* pSong,
+ JZProject* pProject,
const wxPoint& Position,
const wxSize& Size)
- : JZEventWindow(pParent, pSong, Position, Size),
+ : JZEventWindow(pParent, pProject, Position, Size),
mPlayClock(-1),
mUseColors(true),
mNumberWidth(),
@@ -177,7 +177,7 @@
// Avoid permanent redraws when end of scroll range is reached.
if (
Clock > mFromClock &&
- mToClock >= mpSong->GetMaxQuarters() * mpSong->GetTicksPerQuarter())
+ mToClock >= mpProject->GetMaxQuarters() * mpProject->GetTicksPerQuarter())
{
return;
}
@@ -274,7 +274,7 @@
JZRectangle Rectangle(
0,
y2yLine(Point.y + mScrolledY),
- Clock2x(mpSong->GetMaxQuarters() * mpSong->GetTicksPerQuarter()) +
+ Clock2x(mpProject->GetMaxQuarters() * mpProject->GetTicksPerQuarter()) +
mScrolledX,
mTrackHeight);
mpSnapSel->Select(Rectangle);
@@ -618,9 +618,9 @@
DrawHorizontalLine(LocalDc, mEventsY);
DrawHorizontalLine(LocalDc, mEventsY - 1);
- if (mpSong)
+ if (mpProject)
{
- JZBarInfo BarInfo(*mpSong);
+ JZBarInfo BarInfo(*mpProject);
//DEBUG cout
//DEBUG << "mLeftInfoWidth: " << mLeftInfoWidth << '\n'
@@ -1026,12 +1026,12 @@
//-----------------------------------------------------------------------------
void JZTrackWindow::DrawEvents(wxDC& Dc)
{
- if (!mpSong)
+ if (!mpProject)
{
return;
}
- JZBarInfo BarInfo(*mpSong);
+ JZBarInfo BarInfo(*mpProject);
Dc.SetClippingRegion(mEventsX, mEventsY, mEventsWidth, mEventsHeight);
@@ -1220,7 +1220,7 @@
//-----------------------------------------------------------------------------
JZTrack* JZTrackWindow::y2Track(int y)
{
- return mpSong->GetTrack(y2TrackIndex(y));
+ return mpProject->GetTrack(y2TrackIndex(y));
}
//-----------------------------------------------------------------------------
@@ -1386,7 +1386,7 @@
gpProject->mStopTime = loop_clock;
gpProject->Play();
- } //if(!Midi->Playing)
+ }
else
{
gpProject->Stop();
@@ -1408,18 +1408,21 @@
}
if (
!pRecInfo->mpTrack->GetAudioMode() &&
- !gpProject->GetPlayer()->mRecdBuffer.IsEmpty())
+ !gpProject->GetPlayer()->IsRecordBufferEmpty())
{
//int choice = wxMessageBox("Keep recorded events?", "You played", wxOK | wxCANCEL);
//if (choice == wxOK)
{
wxBeginBusyCursor();
+
gpProject->NewUndoBuffer();
+
pRecInfo...
[truncated message content] |