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. |