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...> - 2009-03-13 21:06:34
|
Revision: 718 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=718&view=rev Author: pstieber Date: 2009-03-13 21:06:09 +0000 (Fri, 13 Mar 2009) Log Message: ----------- Fixed the wxMac build instructions. Modified Paths: -------------- web/htdocs/buildingwx/index.php Modified: web/htdocs/buildingwx/index.php =================================================================== --- web/htdocs/buildingwx/index.php 2009-02-19 15:06:48 UTC (rev 717) +++ web/htdocs/buildingwx/index.php 2009-03-13 21:06:09 UTC (rev 718) @@ -207,7 +207,7 @@ </PRE> </LI> -<LI>Create a directory under your home directory. I typically use +<LI>Create a directory under your home directory. I typically use <TT>OutsideSource</TT> and change directory to that location. <PRE> @@ -217,7 +217,7 @@ </PRE> </LI> -<LI> Checkout the 2.8 branch of wxWidgets using the following command. +<LI> Checkout the 2.8 branch of wxWidgets using the following command. You must have a Subversion client loaded on your machine. <PRE> @@ -226,8 +226,8 @@ </LI> <LI> Create two directories called <TT>WxBuildRelease</TT> and -<TT>WxBuildDebug</TT> in parallel with the <TT>wxWidgets-2.8</TT> directory and -change directory to the <TT>WxBuildDebug</TT> directory. +<TT>WxBuildDebug</TT> in parallel with the <TT>wxWidgets-2.8</TT> directory +and change directory to the <TT>WxBuildDebug</TT> directory. <PRE> mkdir WxBuildRelease WxBuildDebug @@ -235,7 +235,7 @@ </PRE> </LI> -<LI> Run the wxWidgets supplied <TT>configure</TT> command with the following +<LI> Run the wxWidgets supplied <TT>configure</TT> command with the following configure options. <PRE> @@ -276,8 +276,8 @@ </PRE> </LI> -<LI>Now repeat with in the <TT>WxBuildRelease</TT> directory with the following -configure options and install the release version as root. +<LI>Now repeat with in the <TT>WxBuildRelease</TT> directory with the +following configure options and install the release version as root. <PRE> cd ../WxBuildRelease @@ -302,8 +302,8 @@ <LI> Install the release version of the wxWidgets build last to ensure this version is the default configuration. If you installed the debug version last, simply -re-install the release version. You can run the following command to determine -the default configuration. +re-install the release version. You can run the following command to +determine the default configuration. <PRE> wx-config --list @@ -314,7 +314,7 @@ <h3>Building wxWidgets for Mac OS X 10.5.2</h3> <OL> -<LI>Create a directory under your home directory. I typically use +<LI>Create a directory under your home directory. I typically use <TT>OutsideSource</TT> and change directory to that location. <PRE> @@ -332,20 +332,20 @@ file under your <TT>OutsideSource</TT> directory. </LI> -<LI> Create a directory called <TT>WxBuild</TT> in parallel with the +<LI> Create a directory called <TT>WxBuild-2.8.9</TT> in parallel with the <TT>wxMac-2.8.9</TT> directory and change directory to that location. <PRE> -mkdir WxBuild -cd WxBuild +mkdir WxBuild-2.8.9 +cd WxBuild-2.8.9 </PRE> </LI> -<LI> Run the wxWidgets supplied <TT>configure</TT> command with the following +<LI> Run the wxWidgets supplied <TT>configure</TT> command with the following configure options. <PRE> -../wxWidgets-2.8/configure \ +../wxMac-2.8.9/configure \ --prefix=$HOME/wx289 \ --disable-no_exceptions \ --disable-no_rtti \ @@ -361,8 +361,8 @@ </PRE> The <TT>prefix</TT> option is used so that the resulting wxWidgets build -will be installed in a non-standard under the user's home directory to prevent -conflicts with OS installed versions. +will be installed in a non-standard under the user's home directory to +prevent conflicts with OS installed versions. </LI> <LI> Run <TT>make</TT> using the following command. This will write a file @@ -382,8 +382,8 @@ <LI> Make sure your <TT>PATH</TT> and <TT>LD_LIBRARY_PATH</TT> environment -variables are set to find the non-stock wxWidgets binaries and libraries just -created before building Jazz++. Adding the following lines in +variables are set to find the non-stock wxWidgets binaries and libraries +just created before building Jazz++. Adding the following lines in <TT>.bash_profile</TT> will do the trick. <PRE> @@ -392,8 +392,8 @@ </PRE> After adding the above lines to your <TT>.bash_profile</TT> -file, it is necessary to reload your bash environment to make these changes -available. Use the following command to accomplish this. +file, it is necessary to reload your bash environment to make these +changes available. Use the following command to accomplish this. <PRE> source .bash_profile This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2009-02-19 15:06:51
|
Revision: 717 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=717&view=rev Author: pstieber Date: 2009-02-19 15:06:48 +0000 (Thu, 19 Feb 2009) Log Message: ----------- 1. Replaced the old piano window snap dialog with a new version. 2. Replaced the global limit steps vector with a map and updated the tNamedValueChoice class. The global limit steps map really shouldn't be global and the tNamedValueChoice class may eventually be removed. 3. Updated the interface to the piano window snap command. 4. Changed gQntSteps to gQuantizationSteps. 5. Changed a loop in the quantization dialog. Modified Paths: -------------- trunk/jazz/src/Dialogs/QuantizeDialog.cpp trunk/jazz/src/Dialogs.cpp trunk/jazz/src/Dialogs.h trunk/jazz/src/Globals.cpp trunk/jazz/src/Globals.h trunk/jazz/src/Makefile.am trunk/jazz/src/NamedValueChoice.cpp trunk/jazz/src/NamedValueChoice.h trunk/jazz/src/PianoWindow.cpp trunk/jazz/src/Project.cpp trunk/jazz/vc8/JazzPlusPlus-VC8.vcproj trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj Added Paths: ----------- trunk/jazz/src/Dialogs/SnapDialog.cpp trunk/jazz/src/Dialogs/SnapDialog.h Modified: trunk/jazz/src/Dialogs/QuantizeDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/QuantizeDialog.cpp 2009-02-17 17:36:54 UTC (rev 716) +++ trunk/jazz/src/Dialogs/QuantizeDialog.cpp 2009-02-19 15:06:48 UTC (rev 717) @@ -79,8 +79,8 @@ mpStepSizeComboBox = new wxComboBox(this, wxID_ANY); for ( - map<int, string>::const_iterator iPair = gQntSteps.begin(); - iPair != gQntSteps.end(); + map<int, string>::const_iterator iPair = gQuantizationSteps.begin(); + iPair != gQuantizationSteps.end(); ++iPair) { const string& String = iPair->second; @@ -151,16 +151,15 @@ { int Selection = 0; for ( - map<int, string>::const_iterator iPair = gQntSteps.begin(); - iPair != gQntSteps.end(); - ++iPair) + map<int, string>::const_iterator iPair = gQuantizationSteps.begin(); + iPair != gQuantizationSteps.end(); + ++iPair, ++Selection) { const int& Value = iPair->first; if (Value <= mQuantizationStep) { break; } - ++Selection; } mpStepSizeComboBox->SetSelection(Selection); @@ -188,8 +187,8 @@ wxString SelectedValue = mpStepSizeComboBox->GetValue(); string SelectedString = SelectedValue.c_str(); for ( - map<int, string>::const_iterator iPair = gQntSteps.begin(); - iPair != gQntSteps.end(); + map<int, string>::const_iterator iPair = gQuantizationSteps.begin(); + iPair != gQuantizationSteps.end(); ++iPair) { const string& String = iPair->second; Added: trunk/jazz/src/Dialogs/SnapDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/SnapDialog.cpp (rev 0) +++ trunk/jazz/src/Dialogs/SnapDialog.cpp 2009-02-19 15:06:48 UTC (rev 717) @@ -0,0 +1,136 @@ +//***************************************************************************** +// The JAZZ++ Midi Sequencer +// +// Copyright (C) 2009 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 "SnapDialog.h" + +#include "../Globals.h" +#include "../Help.h" + +#include <wx/choice.h> +#include <wx/button.h> +#include <wx/sizer.h> +#include <wx/stattext.h> + +using namespace std; + +//***************************************************************************** +//***************************************************************************** +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +BEGIN_EVENT_TABLE(JZSnapDialog, wxDialog) + + EVT_BUTTON(wxID_HELP, JZSnapDialog::OnHelp) + +END_EVENT_TABLE() + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +JZSnapDialog::JZSnapDialog(int& SnapDenominator, wxWindow* pParent) + : wxDialog(pParent, wxID_ANY, wxString("Snap")), + mSnapDenominator(SnapDenominator), + mpSnapValueChoice(0) +{ + mpSnapValueChoice = new wxChoice(this, wxID_ANY); + for ( + map<int, string>::const_iterator iLimitSteps = gLimitSteps.begin(); + iLimitSteps != gLimitSteps.end(); + ++iLimitSteps) + { + mpSnapValueChoice->Append(iLimitSteps->second); + } + + 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( + new wxStaticText(this, wxID_ANY, "Quantize Cut & Paste Events"), + 0, + wxALIGN_CENTER | wxALL, + 5); + + pTopSizer->Add(mpSnapValueChoice, 0, wxALIGN_CENTER | wxALL, 5); + + 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 JZSnapDialog::TransferDataToWindow() +{ + int Selection = 0; + for ( + map<int, string>::const_iterator iLimitSteps = gLimitSteps.begin(); + iLimitSteps != gLimitSteps.end(); + ++iLimitSteps, ++Selection) + { + const int& Value = iLimitSteps->first; + if (Value >= mSnapDenominator) + { + break; + } + } + mpSnapValueChoice->SetSelection(Selection); + + return true; +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +bool JZSnapDialog::TransferDataFromWindow() +{ + wxString SelectedValue = mpSnapValueChoice->GetStringSelection(); + string SelectedString = SelectedValue.c_str(); + for ( + map<int, string>::const_iterator iLimitSteps = gLimitSteps.begin(); + iLimitSteps != gLimitSteps.end(); + ++iLimitSteps) + { + const string& String = iLimitSteps->second; + if (SelectedString == String) + { + mSnapDenominator = iLimitSteps->first; + break; + } + } + + return true; +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZSnapDialog::OnHelp(wxCommandEvent& Event) +{ + gpHelpInstance->ShowTopic("Snap"); +} Property changes on: trunk/jazz/src/Dialogs/SnapDialog.cpp ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/jazz/src/Dialogs/SnapDialog.h =================================================================== --- trunk/jazz/src/Dialogs/SnapDialog.h (rev 0) +++ trunk/jazz/src/Dialogs/SnapDialog.h 2009-02-19 15:06:48 UTC (rev 717) @@ -0,0 +1,53 @@ +//***************************************************************************** +// The JAZZ++ Midi Sequencer +// +// Copyright (C) 2009 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_SNAPDIALOG_H +#define JZ_SNAPDIALOG_H + +#include <wx/dialog.h> + +class wxChoice; + +//***************************************************************************** +//***************************************************************************** +class JZSnapDialog : public wxDialog +{ + public: + + JZSnapDialog(int& SnapDenominator, wxWindow* pParent); + + private: + + bool TransferDataToWindow(); + + bool TransferDataFromWindow(); + + void OnHelp(wxCommandEvent& Event); + + private: + + int& mSnapDenominator; + + wxChoice* mpSnapValueChoice; + + DECLARE_EVENT_TABLE(); +}; + +#endif // !defined(JZ_SNAPDIALOG_H) Property changes on: trunk/jazz/src/Dialogs/SnapDialog.h ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/jazz/src/Dialogs.cpp =================================================================== --- trunk/jazz/src/Dialogs.cpp 2009-02-17 17:36:54 UTC (rev 716) +++ trunk/jazz/src/Dialogs.cpp 2009-02-19 15:06:48 UTC (rev 717) @@ -163,17 +163,17 @@ // How it really ought to work (except the validator might ask the "value" // for the list of allowed values). // http://sourceforge.net/tracker/?group_id=9863&atid=109863 wx bugracker - tNamedValueListValue val1 = tNamedValueListValue( - &lowLimit, - gLimitSteps); +// tNamedValueListValue val1 = tNamedValueListValue( +// &lowLimit, +// gLimitSteps); - wxPropertyValue& val = val1; - cout << "little test:" << val.GetStringRepresentation() << endl; - sheet->AddProperty(new wxProperty( - "Delete shorther than", - (tNamedValueListValue&)val1, - "props", - new tNamedValueListValidator(gLimitSteps))); +// wxPropertyValue& val = val1; +// cout << "little test:" << val.GetStringRepresentation() << endl; +// sheet->AddProperty(new wxProperty( +// "Delete shorther than", +// (tNamedValueListValue&)val1, +// "props", +// new tNamedValueListValidator(gLimitSteps))); sheet->AddProperty(new wxProperty( "Shorten overlapping", @@ -394,53 +394,6 @@ //***************************************************************************** -// Snap -//***************************************************************************** - -tSnapDlg::tSnapDlg(JZPianoWindow* pPianoWindow, int* snapptr) - : tPropertyListDlg("Snap:quantize cut/paste events"), - mpPianoWindow(pPianoWindow) -{ -//, Steps("Snap value", limitSteps, snapptr) - //limitSteps lives in util.cpp - ptr = snapptr; -} - - - -bool tSnapDlg::OnClose() -{ - //Steps.GetValue(); - // toggle the tool buttons - mpPianoWindow->SetSnapDenom(*ptr); - //tPropertyListDlg::OnClose(); - return false; -} - -void tSnapDlg::OnHelp() -{ - gpHelpInstance->ShowTopic("Snap"); -} - -void tSnapDlg::AddProperties() -{ -// panel->SetLabelPosition(wxVERTICAL); -// Add(wxMakeFormMessage("quantize cut/paste events")); -// Add(wxMakeFormNewLine()); -// Add(Steps.mkFormItem(100)); -// Add(wxMakeFormNewLine()); -// AssociatePanel(panel); - - sheet->AddProperty(new wxProperty( - "Steps", - tNamedValueListValue(ptr, gLimitSteps), - "props", - new tNamedValueListValidator(gLimitSteps))); -} - - - -//***************************************************************************** // Event-Dialogue //***************************************************************************** Modified: trunk/jazz/src/Dialogs.h =================================================================== --- trunk/jazz/src/Dialogs.h 2009-02-17 17:36:54 UTC (rev 716) +++ trunk/jazz/src/Dialogs.h 2009-02-19 15:06:48 UTC (rev 717) @@ -139,27 +139,6 @@ void OnHelp(); }; -class tSnapDlg : public tPropertyListDlg -{ - public: - - tSnapDlg(JZPianoWindow* pPianoWindow, int* snapptr); - - void AddProperties(); - - //tNamedChoice Steps; - - bool OnClose(); - - void OnHelp(); - - private: - - JZPianoWindow* mpPianoWindow; - - int* ptr; -}; - void EventDialog( JZEvent*, JZPianoWindow*, Modified: trunk/jazz/src/Globals.cpp =================================================================== --- trunk/jazz/src/Globals.cpp 2009-02-17 17:36:54 UTC (rev 716) +++ trunk/jazz/src/Globals.cpp 2009-02-19 15:06:48 UTC (rev 717) @@ -41,7 +41,7 @@ JZHelp* gpHelpInstance = 0; -vector<pair<string, int> > gLimitSteps; +map<int, string> gLimitSteps; vector<pair<string, int> > gModes; @@ -51,7 +51,7 @@ vector<pair<string, int> > gScaleNames; -map<int, string> gQntSteps; +map<int, string> gQuantizationSteps; vector<pair<string, int> > gSynthesizerTypes; Modified: trunk/jazz/src/Globals.h =================================================================== --- trunk/jazz/src/Globals.h 2009-02-17 17:36:54 UTC (rev 716) +++ trunk/jazz/src/Globals.h 2009-02-19 15:06:48 UTC (rev 717) @@ -51,12 +51,12 @@ extern JZSynth* gpSynth; extern JZPlayer* gpMidiPlayer; extern JZHelp* gpHelpInstance; -extern std::vector<std::pair<std::string, int> > gLimitSteps; +extern std::map<int, std::string> gLimitSteps; extern std::vector<std::pair<std::string, int> > gModes; extern const int gScaleChromatic; extern const int gScaleSelected; extern std::vector<std::pair<std::string, int> > gScaleNames; -extern std::map<int, std::string> gQntSteps; +extern std::map<int, std::string> gQuantizationSteps; extern std::vector<std::pair<std::string, int> > gSynthesizerTypes; extern std::vector<std::pair<std::string, int> > gSynthesierTypeFiles; extern JZProject* gpProject; Modified: trunk/jazz/src/Makefile.am =================================================================== --- trunk/jazz/src/Makefile.am 2009-02-17 17:36:54 UTC (rev 716) +++ trunk/jazz/src/Makefile.am 2009-02-19 15:06:48 UTC (rev 717) @@ -31,6 +31,7 @@ Dialogs/MidiChannelDialog.cpp \ Dialogs/QuantizeDialog.cpp \ Dialogs/ShiftDialog.cpp \ +Dialogs/SnapDialog.cpp \ Dialogs/SynthesizerSettingsDialog.cpp \ Dialogs/TrackDialog.cpp \ Dialogs/VelocityDialog.cpp \ @@ -115,6 +116,7 @@ Dialogs/MidiChannelDialog.cpp \ Dialogs/QuantizeDialog.cpp \ Dialogs/ShiftDialog.cpp \ +Dialogs/SnapDialog.cpp \ Dialogs/SynthesizerSettingsDialog.cpp \ Dialogs/TrackDialog.cpp \ Dialogs/VelocityDialog.cpp \ @@ -204,6 +206,7 @@ Dialogs/MidiChannelDialog.h \ Dialogs/QuantizeDialog.h \ Dialogs/ShiftDialog.h \ +Dialogs/SnapDialog.h \ Dialogs/SynthesizerSettingsDialog.h \ Dialogs/TrackDialog.h \ Dialogs/VelocityDialog.h \ Modified: trunk/jazz/src/NamedValueChoice.cpp =================================================================== --- trunk/jazz/src/NamedValueChoice.cpp 2009-02-17 17:36:54 UTC (rev 716) +++ trunk/jazz/src/NamedValueChoice.cpp 2009-02-19 15:06:48 UTC (rev 717) @@ -30,16 +30,16 @@ //----------------------------------------------------------------------------- tNamedValueChoice::tNamedValueChoice( wxWindow* pParent, - const vector<pair<string, int> >& Pairs) + const map<int, string>& Map) : wxChoice(pParent, wxID_ANY), - mPairs(Pairs) + mMap(Map) { for ( - vector<pair<string, int> >::const_iterator iPair = mPairs.begin(); - iPair != mPairs.end(); - ++iPair) + map<int, string>::const_iterator iMap = mMap.begin(); + iMap != mMap.end(); + ++iMap) { - Append(iPair->first); + Append(iMap->second); } } @@ -47,10 +47,20 @@ //----------------------------------------------------------------------------- int tNamedValueChoice::GetValue() { - int i = GetSelection(); - if (i >= 0) + int Selection = GetSelection(); + if (Selection >= 0) { - return mPairs[i].second; + int i = 0; + for ( + map<int, string>::const_iterator iMap = mMap.begin(); + iMap != mMap.end(); + ++iMap, ++i) + { + if (i == Selection) + { + return iMap->first; + } + } } return 16; } @@ -61,14 +71,14 @@ { int i = 0; for ( - vector<pair<string, int> >::const_iterator iPair = mPairs.begin(); - iPair != mPairs.end(); - ++iPair) + map<int, string>::const_iterator iMap = mMap.begin(); + iMap != mMap.end(); + ++iMap, ++i) { - if (iPair->second == Measure) + if (iMap->first == Measure) { SetSelection(i); + break; } - ++i; } } Modified: trunk/jazz/src/NamedValueChoice.h =================================================================== --- trunk/jazz/src/NamedValueChoice.h 2009-02-17 17:36:54 UTC (rev 716) +++ trunk/jazz/src/NamedValueChoice.h 2009-02-19 15:06:48 UTC (rev 717) @@ -25,7 +25,7 @@ #include <wx/choice.h> -#include <vector> +#include <map> #include <string> //***************************************************************************** @@ -36,7 +36,7 @@ tNamedValueChoice( wxWindow* pParent, - const std::vector<std::pair<std::string, int> >& Pairs); + const std::map<int, std::string>& Map); int GetValue(); @@ -44,7 +44,7 @@ private: - const std::vector<std::pair<std::string, int> >& mPairs; + const std::map<int, std::string>& mMap; }; #endif // !defined(JZ_NAMEDVALUECHOICE_H) Modified: trunk/jazz/src/PianoWindow.cpp =================================================================== --- trunk/jazz/src/PianoWindow.cpp 2009-02-17 17:36:54 UTC (rev 716) +++ trunk/jazz/src/PianoWindow.cpp 2009-02-19 15:06:48 UTC (rev 717) @@ -25,6 +25,7 @@ #include "Command.h" #include "ControlEdit.h" #include "Dialogs.h" +#include "Dialogs/SnapDialog.h" #include "Filter.h" #include "GuitarFrame.h" #include "Harmony.h" @@ -3114,8 +3115,8 @@ //----------------------------------------------------------------------------- void JZPianoWindow::SnapDialog() { - tSnapDlg* pSnapDialog = new tSnapDlg(this, &mSnapDenomiator); - pSnapDialog->Create(); + JZSnapDialog SnapDialog(mSnapDenomiator, this); + SnapDialog.ShowModal(); } //----------------------------------------------------------------------------- Modified: trunk/jazz/src/Project.cpp =================================================================== --- trunk/jazz/src/Project.cpp 2009-02-17 17:36:54 UTC (rev 716) +++ trunk/jazz/src/Project.cpp 2009-02-19 15:06:48 UTC (rev 717) @@ -78,14 +78,14 @@ { if (gLimitSteps.empty()) { - gLimitSteps.push_back(make_pair( "1/8", 8)); - gLimitSteps.push_back(make_pair( "1/12", 12)); - gLimitSteps.push_back(make_pair( "1/16", 16)); - gLimitSteps.push_back(make_pair( "1/24", 24)); - gLimitSteps.push_back(make_pair( "1/32", 32)); - gLimitSteps.push_back(make_pair( "1/48", 48)); - gLimitSteps.push_back(make_pair( "1/96", 96)); - gLimitSteps.push_back(make_pair("1/192", 192)); + gLimitSteps.insert(make_pair( 8, "1/8")); + gLimitSteps.insert(make_pair( 12, "1/12")); + gLimitSteps.insert(make_pair( 16, "1/16")); + gLimitSteps.insert(make_pair( 24, "1/24")); + gLimitSteps.insert(make_pair( 32, "1/32")); + gLimitSteps.insert(make_pair( 48, "1/48")); + gLimitSteps.insert(make_pair( 96, "1/96")); + gLimitSteps.insert(make_pair(192, "1/192")); } if (gModes.empty()) @@ -113,15 +113,15 @@ gScaleNames.push_back(make_pair("Selected", gScaleSelected)); } - if (gQntSteps.empty()) + if (gQuantizationSteps.empty()) { - gQntSteps.insert(make_pair(8, "1/8")); - gQntSteps.insert(make_pair(12, "1/12")); - gQntSteps.insert(make_pair(16, "1/16")); - gQntSteps.insert(make_pair(24, "1/24")); - gQntSteps.insert(make_pair(32, "1/32")); - gQntSteps.insert(make_pair(48, "1/48")); - gQntSteps.insert(make_pair(96, "1/96")); + gQuantizationSteps.insert(make_pair(8, "1/8")); + gQuantizationSteps.insert(make_pair(12, "1/12")); + gQuantizationSteps.insert(make_pair(16, "1/16")); + gQuantizationSteps.insert(make_pair(24, "1/24")); + gQuantizationSteps.insert(make_pair(32, "1/32")); + gQuantizationSteps.insert(make_pair(48, "1/48")); + gQuantizationSteps.insert(make_pair(96, "1/96")); } if (gSynthesizerTypes.empty()) Modified: trunk/jazz/vc8/JazzPlusPlus-VC8.vcproj =================================================================== --- trunk/jazz/vc8/JazzPlusPlus-VC8.vcproj 2009-02-17 17:36:54 UTC (rev 716) +++ trunk/jazz/vc8/JazzPlusPlus-VC8.vcproj 2009-02-19 15:06:48 UTC (rev 717) @@ -899,6 +899,14 @@ > </File> <File + RelativePath="..\src\Dialogs\SnapDialog.cpp" + > + </File> + <File + RelativePath="..\src\Dialogs\SnapDialog.h" + > + </File> + <File RelativePath="..\src\Dialogs\SynthesizerSettingsDialog.cpp" > </File> Modified: trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj =================================================================== --- trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj 2009-02-17 17:36:54 UTC (rev 716) +++ trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj 2009-02-19 15:06:48 UTC (rev 717) @@ -917,6 +917,14 @@ > </File> <File + RelativePath="..\src\Dialogs\SnapDialog.cpp" + > + </File> + <File + RelativePath="..\src\Dialogs\SnapDialog.h" + > + </File> + <File RelativePath="..\src\Dialogs\SynthesizerSettingsDialog.cpp" > </File> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2009-02-17 17:37:01
|
Revision: 716 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=716&view=rev Author: pstieber Date: 2009-02-17 17:36:54 +0000 (Tue, 17 Feb 2009) Log Message: ----------- Changed the declaration order of two data members. Modified Paths: -------------- trunk/jazz/src/Command.h Modified: trunk/jazz/src/Command.h =================================================================== --- trunk/jazz/src/Command.h 2009-02-17 14:45:54 UTC (rev 715) +++ trunk/jazz/src/Command.h 2009-02-17 17:36:54 UTC (rev 716) @@ -230,8 +230,8 @@ int mQntClocks; bool mNoteStart; bool mNoteLength; + int mGroove; int mDelay; - int mGroove; }; //***************************************************************************** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2009-02-17 14:45:59
|
Revision: 715 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=715&view=rev Author: pstieber Date: 2009-02-17 14:45:54 +0000 (Tue, 17 Feb 2009) Log Message: ----------- 1. Replaced the old MIDI channel and quantization dialogs with new versions. 2. Replaced the global quantization steps vector with a map. This really shouldn't be global. 3. Updated the interface to the quantization command. Modified Paths: -------------- trunk/jazz/src/Command.cpp trunk/jazz/src/Command.h trunk/jazz/src/Dialogs/LengthDialog.cpp trunk/jazz/src/Dialogs.cpp trunk/jazz/src/Dialogs.h trunk/jazz/src/EventWindow.cpp trunk/jazz/src/Globals.cpp trunk/jazz/src/Globals.h trunk/jazz/src/Makefile.am trunk/jazz/src/PianoWindow.cpp trunk/jazz/src/Project.cpp trunk/jazz/src/Resources.h trunk/jazz/vc8/JazzPlusPlus-VC8.vcproj trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj Added Paths: ----------- trunk/jazz/src/Dialogs/MidiChannelDialog.cpp trunk/jazz/src/Dialogs/MidiChannelDialog.h trunk/jazz/src/Dialogs/QuantizeDialog.cpp trunk/jazz/src/Dialogs/QuantizeDialog.h Modified: trunk/jazz/src/Command.cpp =================================================================== --- trunk/jazz/src/Command.cpp 2009-02-17 02:25:11 UTC (rev 714) +++ trunk/jazz/src/Command.cpp 2009-02-17 14:45:54 UTC (rev 715) @@ -359,25 +359,33 @@ // tCmdQuantize // ************************************************************************ -tCmdQuantize::tCmdQuantize(JZFilter* pFilter, long clks, int grov, int dly) - : tCommand(pFilter) +tCmdQuantize::tCmdQuantize( + JZFilter* pFilter, + int QntClocks, + bool NoteStart, + bool NoteLength, + int Groove, + int Delay) + : tCommand(pFilter), + mQntClocks(QntClocks), + mNoteStart(NoteStart), + mNoteLength(NoteLength), + mGroove(Groove), + mDelay(Delay) { - QntClocks = clks; - Groove = grov; - Delay = dly; - NoteStart = 1; - NoteLength = 0; } -long tCmdQuantize::Quantize(long Clock, int islen) +long tCmdQuantize::Quantize(int Clock, int islen) { - Clock += QntClocks / 2; - Clock -= Clock % QntClocks; - if (!islen && (Clock % (2 * QntClocks) != 0)) - Clock += Groove; - Clock += Delay; - long minclk = islen ? 2 : 0; - return Clock > minclk ? Clock : minclk; + Clock += mQntClocks / 2; + Clock -= Clock % mQntClocks; + if (!islen && (Clock % (2 * mQntClocks) != 0)) + { + Clock += mGroove; + } + Clock += mDelay; + int MinClock = islen ? 2 : 0; + return Clock > MinClock ? Clock : MinClock; } void tCmdQuantize::ExecuteEvent(JZTrack* pTrack, JZEvent* pEvent) @@ -386,11 +394,11 @@ if ((pKeyOn = pEvent->IsKeyOn()) != 0) { pKeyOn = (tKeyOn *)pEvent->Copy(); - if (NoteStart) + if (mNoteStart) { pKeyOn->SetClock(Quantize(pKeyOn->GetClock(), 0)); } - if (NoteLength) + if (mNoteLength) { pKeyOn->SetLength(Quantize(pKeyOn->GetEventLength(), 2)); } @@ -452,22 +460,22 @@ // tCmdSetChannel // ************************************************************************ -tCmdSetChannel::tCmdSetChannel(JZFilter* pFilter, int chan) - : tCommand(pFilter) +tCmdSetChannel::tCmdSetChannel(JZFilter* pFilter, int NewChannel) + : tCommand(pFilter), + mNewChannel(NewChannel) { - NewChannel = chan; } void tCmdSetChannel::ExecuteEvent(JZTrack* pTrack, JZEvent* pEvent) { - tChannelEvent* c; + tChannelEvent* pChannelEvent; - if ((c = pEvent->IsChannelEvent()) != 0) + if ((pChannelEvent = pEvent->IsChannelEvent()) != 0) { - c = (tChannelEvent *)pEvent->Copy(); - c->SetChannel(NewChannel); + pChannelEvent = (tChannelEvent *)pEvent->Copy(); + pChannelEvent->SetChannel(mNewChannel); pTrack->Kill(pEvent); - pTrack->Put(c); + pTrack->Put(pChannelEvent); } } Modified: trunk/jazz/src/Command.h =================================================================== --- trunk/jazz/src/Command.h 2009-02-17 02:25:11 UTC (rev 714) +++ trunk/jazz/src/Command.h 2009-02-17 14:45:54 UTC (rev 715) @@ -209,15 +209,29 @@ //***************************************************************************** class tCmdQuantize : public tCommand { - long Quantize(long Clock, int islen); public: - long QntClocks; - int NoteStart; // yes - int NoteLength; // no - int Delay; // zero - int Groove; // zero - tCmdQuantize(JZFilter* pFilter, long QntClocks, int groove, int delay); + + tCmdQuantize( + JZFilter* pFilter, + int QntClocks, + bool NoteStart, + bool NoteLength, + int Groove, + int Delay); + virtual void ExecuteEvent(JZTrack* pTrack, JZEvent* pEvent); + + private: + + long Quantize(int Clock, int islen); + + private: + + int mQntClocks; + bool mNoteStart; + bool mNoteLength; + int mDelay; + int mGroove; }; //***************************************************************************** @@ -241,9 +255,14 @@ class tCmdSetChannel : public tCommand { public: - int NewChannel; // 0 + tCmdSetChannel(JZFilter* pFilter, int NewChannel); + virtual void ExecuteEvent(JZTrack* pTrack, JZEvent* pEvent); + + private: + + int mNewChannel; }; //***************************************************************************** Modified: trunk/jazz/src/Dialogs/LengthDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/LengthDialog.cpp 2009-02-17 02:25:11 UTC (rev 714) +++ trunk/jazz/src/Dialogs/LengthDialog.cpp 2009-02-17 14:45:54 UTC (rev 715) @@ -142,7 +142,7 @@ wxALIGN_CENTER_VERTICAL | wxFIXED_MINSIZE); pFlexGridSizer->Add(mpLengthStopKnob, 0, wxALIGN_CENTER_VERTICAL); - pTopSizer->Add(pFlexGridSizer, 0, wxALIGN_CENTER); + pTopSizer->Add(pFlexGridSizer, 0, wxALIGN_CENTER | wxALL, 5); pTopSizer->Add( mpModeRadioBox, Added: trunk/jazz/src/Dialogs/MidiChannelDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/MidiChannelDialog.cpp (rev 0) +++ trunk/jazz/src/Dialogs/MidiChannelDialog.cpp 2009-02-17 14:45:54 UTC (rev 715) @@ -0,0 +1,139 @@ +//***************************************************************************** +// The JAZZ++ Midi Sequencer +// +// Copyright (C) 2009 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 "MidiChannelDialog.h" + +#include "../Globals.h" +#include "../Help.h" +#include "../Knob.h" +#include "../Resources.h" + +#include <wx/button.h> +#include <wx/sizer.h> +#include <wx/stattext.h> + +#include <sstream> + +using namespace std; + +//***************************************************************************** +//***************************************************************************** +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +BEGIN_EVENT_TABLE(JZMidiChannelDialog, wxDialog) + + EVT_KNOB_CHANGED( + IDC_KB_MIDI_CHANNEL, + JZMidiChannelDialog::OnMidiChannelChange) + + EVT_BUTTON(wxID_HELP, JZMidiChannelDialog::OnHelp) + +END_EVENT_TABLE() + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +JZMidiChannelDialog::JZMidiChannelDialog(int& MidiChannel, wxWindow* pParent) + : wxDialog(pParent, wxID_ANY, wxString("Set MIDI Channel")), + mMidiChannel(MidiChannel), + mpMidiChannelKnob(0), + mpMidiChannelValue(0) +{ + mpMidiChannelKnob = new JZKnob( + this, + IDC_KB_MIDI_CHANNEL, + 0, + 0, + 16); + mpMidiChannelValue = new wxStaticText(this, wxID_ANY, "00"); + + 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 = new wxFlexGridSizer(1, 3, 4, 2); + + pFlexGridSizer->Add( + new wxStaticText(this, wxID_ANY, "MIDI Channel:"), + 0, + wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); + pFlexGridSizer->Add( + mpMidiChannelValue, + 0, + wxALIGN_CENTER_VERTICAL | wxFIXED_MINSIZE); + pFlexGridSizer->Add(mpMidiChannelKnob, 0, wxALIGN_CENTER_VERTICAL); + + pTopSizer->Add(pFlexGridSizer, 0, wxALIGN_CENTER); + + 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 JZMidiChannelDialog::TransferDataToWindow() +{ + ostringstream Oss; + + Oss << mMidiChannel; + mpMidiChannelValue->SetLabel(Oss.str().c_str()); + + mpMidiChannelKnob->SetValue(mMidiChannel); + + return true; +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +bool JZMidiChannelDialog::TransferDataFromWindow() +{ + mMidiChannel = mpMidiChannelKnob->GetValue(); + + return true; +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZMidiChannelDialog::OnMidiChannelChange(JZKnobEvent& Event) +{ + int Value = Event.GetValue(); + ostringstream Oss; + Oss << Value; + mpMidiChannelValue->SetLabel(Oss.str().c_str()); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZMidiChannelDialog::OnHelp(wxCommandEvent& Event) +{ + gpHelpInstance->ShowTopic("Set MIDI Channel"); +} Property changes on: trunk/jazz/src/Dialogs/MidiChannelDialog.cpp ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/jazz/src/Dialogs/MidiChannelDialog.h =================================================================== --- trunk/jazz/src/Dialogs/MidiChannelDialog.h (rev 0) +++ trunk/jazz/src/Dialogs/MidiChannelDialog.h 2009-02-17 14:45:54 UTC (rev 715) @@ -0,0 +1,58 @@ +//***************************************************************************** +// The JAZZ++ Midi Sequencer +// +// Copyright (C) 2009 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_MIDICHANNELDIALOG_H +#define JZ_MIDICHANNELDIALOG_H + +#include <wx/dialog.h> + +class JZKnob; +class JZKnobEvent; +class wxStaticText; + +//***************************************************************************** +//***************************************************************************** +class JZMidiChannelDialog : public wxDialog +{ + public: + + JZMidiChannelDialog(int& MidiChannel, wxWindow* pParent); + + private: + + virtual bool TransferDataToWindow(); + + virtual bool TransferDataFromWindow(); + + void OnMidiChannelChange(JZKnobEvent& Event); + + void OnHelp(wxCommandEvent& Event); + + private: + + int& mMidiChannel; + + JZKnob* mpMidiChannelKnob; + wxStaticText* mpMidiChannelValue; + + DECLARE_EVENT_TABLE(); +}; + +#endif // !defined(JZ_MIDICHANNELDIALOG_H) Property changes on: trunk/jazz/src/Dialogs/MidiChannelDialog.h ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/jazz/src/Dialogs/QuantizeDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/QuantizeDialog.cpp (rev 0) +++ trunk/jazz/src/Dialogs/QuantizeDialog.cpp 2009-02-17 14:45:54 UTC (rev 715) @@ -0,0 +1,236 @@ +//***************************************************************************** +// The JAZZ++ Midi Sequencer +// +// Copyright (C) 2009 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 "QuantizeDialog.h" + +#include "../Globals.h" +#include "../Help.h" +#include "../Knob.h" +#include "../Resources.h" + +#include <wx/button.h> +#include <wx/checkbox.h> +#include <wx/combobox.h> +#include <wx/sizer.h> +#include <wx/stattext.h> + +#include <sstream> + +using namespace std; + +//***************************************************************************** +//***************************************************************************** +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +BEGIN_EVENT_TABLE(JZQuantizeDialog, wxDialog) + + EVT_KNOB_CHANGED( + IDC_KB_GROOVE, + JZQuantizeDialog::OnGrooveChange) + + EVT_KNOB_CHANGED( + IDC_KB_DELAY, + JZQuantizeDialog::OnDelayChange) + + EVT_BUTTON(wxID_HELP, JZQuantizeDialog::OnHelp) + +END_EVENT_TABLE() + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +JZQuantizeDialog::JZQuantizeDialog( + int& QuantizationStep, + bool& NoteStart, + bool& NoteLength, + int& Groove, + int& Delay, + wxWindow* pParent) + : wxDialog(pParent, wxID_ANY, wxString("Length")), + mQuantizationStep(QuantizationStep), + mNoteStart(NoteStart), + mNoteLength(NoteLength), + mGroove(Groove), + mDelay(Delay), + mpStepSizeComboBox(0), + mpNoteStartCheckBox(0), + mpNoteLengthCheckBox(0), + mpGrooveKnob(0), + mpGrooveValue(0), + mpDelayKnob(0), + mpDelayValue(0) +{ + mpStepSizeComboBox = new wxComboBox(this, wxID_ANY); + + for ( + map<int, string>::const_iterator iPair = gQntSteps.begin(); + iPair != gQntSteps.end(); + ++iPair) + { + const string& String = iPair->second; + mpStepSizeComboBox->Append(String.c_str()); + } + + mpNoteStartCheckBox = new wxCheckBox(this, wxID_ANY, "Note Start"); + mpNoteLengthCheckBox = new wxCheckBox(this, wxID_ANY, "Note Length"); + mpGrooveKnob = new JZKnob(this, IDC_KB_GROOVE, 0, -100, 100); + mpGrooveValue = new wxStaticText(this, wxID_ANY, "-000"); + mpDelayKnob = new JZKnob(this, IDC_KB_DELAY, 0, -100, 100); + mpDelayValue = new wxStaticText(this, wxID_ANY, "-000"); + + 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(mpStepSizeComboBox, 0, wxALIGN_CENTER | wxALL, 6); + + pTopSizer->Add(mpNoteStartCheckBox, 0, wxALIGN_CENTER | wxALL, 6); + + pTopSizer->Add(mpNoteLengthCheckBox, 0, wxALIGN_CENTER | wxALL, 6); + + wxFlexGridSizer* pFlexGridSizer = new wxFlexGridSizer(2, 3, 4, 2); + + pFlexGridSizer->Add( + new wxStaticText(this, wxID_ANY, "Groove:"), + 0, + wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); + pFlexGridSizer->Add( + mpGrooveValue, + 0, + wxALIGN_CENTER_VERTICAL | wxFIXED_MINSIZE); + pFlexGridSizer->Add(mpGrooveKnob, 0, wxALIGN_CENTER_VERTICAL); + + pFlexGridSizer->Add( + new wxStaticText(this, wxID_ANY, "Delay:"), + 0, + wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); + pFlexGridSizer->Add( + mpDelayValue, + 0, + wxALIGN_CENTER_VERTICAL | wxFIXED_MINSIZE); + pFlexGridSizer->Add(mpDelayKnob, 0, wxALIGN_CENTER_VERTICAL); + + pTopSizer->Add(pFlexGridSizer, 0, wxALIGN_CENTER | wxALL, 5); + + pTopSizer->Add(pButtonSizer, 0, wxALIGN_CENTER | wxBOTTOM, 6); + + SetAutoLayout(true); + SetSizer(pTopSizer); + + pTopSizer->SetSizeHints(this); + pTopSizer->Fit(this); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +bool JZQuantizeDialog::TransferDataToWindow() +{ + int Selection = 0; + for ( + map<int, string>::const_iterator iPair = gQntSteps.begin(); + iPair != gQntSteps.end(); + ++iPair) + { + const int& Value = iPair->first; + if (Value <= mQuantizationStep) + { + break; + } + ++Selection; + } + mpStepSizeComboBox->SetSelection(Selection); + + mpNoteStartCheckBox->SetValue(mNoteStart); + mpNoteLengthCheckBox->SetValue(mNoteLength); + + ostringstream Oss; + + Oss << mGroove; + mpGrooveValue->SetLabel(Oss.str().c_str()); + mpGrooveKnob->SetValue(mGroove); + + Oss.str(""); + Oss << mDelay; + mpDelayValue->SetLabel(Oss.str().c_str()); + mpDelayKnob->SetValue(mDelay); + + return true; +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +bool JZQuantizeDialog::TransferDataFromWindow() +{ + wxString SelectedValue = mpStepSizeComboBox->GetValue(); + string SelectedString = SelectedValue.c_str(); + for ( + map<int, string>::const_iterator iPair = gQntSteps.begin(); + iPair != gQntSteps.end(); + ++iPair) + { + const string& String = iPair->second; + if (SelectedString == String) + { + mQuantizationStep = iPair->first; + break; + } + } + + mNoteStart = mpNoteStartCheckBox->GetValue(); + mNoteLength = mpNoteLengthCheckBox->GetValue(); + mGroove = mpGrooveKnob->GetValue(); + mDelay = mpDelayKnob->GetValue(); + + return true; +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZQuantizeDialog::OnGrooveChange(JZKnobEvent& Event) +{ + int Value = Event.GetValue(); + ostringstream Oss; + Oss << Value; + mpGrooveValue->SetLabel(Oss.str().c_str()); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZQuantizeDialog::OnDelayChange(JZKnobEvent& Event) +{ + int Value = Event.GetValue(); + ostringstream Oss; + Oss << Value; + mpDelayValue->SetLabel(Oss.str().c_str()); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZQuantizeDialog::OnHelp(wxCommandEvent& Event) +{ + gpHelpInstance->ShowTopic("Quantize"); +} Property changes on: trunk/jazz/src/Dialogs/QuantizeDialog.cpp ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/jazz/src/Dialogs/QuantizeDialog.h =================================================================== --- trunk/jazz/src/Dialogs/QuantizeDialog.h (rev 0) +++ trunk/jazz/src/Dialogs/QuantizeDialog.h 2009-02-17 14:45:54 UTC (rev 715) @@ -0,0 +1,77 @@ +//***************************************************************************** +// The JAZZ++ Midi Sequencer +// +// Copyright (C) 2009 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_QUANTIZEDIALOG_H +#define JZ_QUANTIZEDIALOG_H + +#include <wx/dialog.h> + +class JZKnob; +class JZKnobEvent; +class wxComboBox; +class wxCheckBox; +class wxStaticText; + +//***************************************************************************** +//***************************************************************************** +class JZQuantizeDialog : public wxDialog +{ + public: + + JZQuantizeDialog( + int& QuantizationStep, + bool& NoteStart, + bool& NoteLength, + int& Groove, + int& Delay, + wxWindow* pParent); + + private: + + virtual bool TransferDataToWindow(); + + virtual bool TransferDataFromWindow(); + + void OnGrooveChange(JZKnobEvent& Event); + + void OnDelayChange(JZKnobEvent& Event); + + void OnHelp(wxCommandEvent& Event); + + private: + + int& mQuantizationStep; + bool& mNoteStart; + bool& mNoteLength; + int& mGroove; + int& mDelay; + + wxComboBox* mpStepSizeComboBox; + wxCheckBox* mpNoteStartCheckBox; + wxCheckBox* mpNoteLengthCheckBox; + JZKnob* mpGrooveKnob; + wxStaticText* mpGrooveValue; + JZKnob* mpDelayKnob; + wxStaticText* mpDelayValue; + + DECLARE_EVENT_TABLE(); +}; + +#endif // !defined(JZ_QUANTIZEDIALOG_H) Property changes on: trunk/jazz/src/Dialogs/QuantizeDialog.h ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/jazz/src/Dialogs.cpp =================================================================== --- trunk/jazz/src/Dialogs.cpp 2009-02-17 02:25:11 UTC (rev 714) +++ trunk/jazz/src/Dialogs.cpp 2009-02-17 14:45:54 UTC (rev 715) @@ -282,54 +282,12 @@ "bool")); } -//***************************************************************************** -// SetChannel -//***************************************************************************** -int tSetChannelDlg::NewChannel = 1; -tSetChannelDlg::tSetChannelDlg(JZFilter *f) -: tPropertyListDlg("Set MIDI Channel") -{ - Filter = f; - Song = f->GetSong(); -} -bool tSetChannelDlg::OnClose() -{ - if (NewChannel) - { - tCmdSetChannel exe(Filter, NewChannel - 1); - exe.Execute(); - } - //tPropertyListDlg::OnClose(); - return false; -} -void tSetChannelDlg::OnHelp() -{ - gpHelpInstance->ShowTopic("Set MIDI Channel"); -} - - -void tSetChannelDlg::AddProperties() -{ - // Add(wxMakeFormShort("new Channel", &NewChannel, wxFORM_DEFAULT, -// new wxList(wxMakeConstraintRange(1.0, 16.0), 0))); -// Add(wxMakeFormNewLine()); - // AssociatePanel(panel); - - sheet->AddProperty(new wxProperty( - "new Channel", - wxPropertyValue(&NewChannel), - "integer", - new wxIntegerListValidator(1, 16))); -} - - - //***************************************************************************** // seqLength //***************************************************************************** @@ -481,77 +439,7 @@ } -//***************************************************************************** -// Quantize -//***************************************************************************** -bool tQuantizeDlg::NoteStart = 1; -bool tQuantizeDlg::NoteLength = 0; -int tQuantizeDlg::QntStep = 16; -int tQuantizeDlg::Delay = 0; -int tQuantizeDlg::Groove = 0; - -//tQuantizeDlg::tQuantizeDlg(JZEventFrame *w, JZFilter *f) -tQuantizeDlg::tQuantizeDlg(JZEventWindow *w, JZFilter *f) - : tPropertyListDlg("Quantize" ) - //, Steps("steps", gQntSteps, &gQntStep) -{ - Filter = f; - Song = f->GetSong(); -} - - - -bool tQuantizeDlg::OnClose() -{ - //Steps.GetValue(); - int step = Song->GetTicksPerQuarter() * 4 / QntStep; - tCmdQuantize qnt(Filter, step, Groove * step / 100, Delay * step / 100); - qnt.NoteStart = NoteStart; - qnt.NoteLength = NoteLength; - qnt.Execute(); - - JZProjectManager::Instance()->UpdateAllViews(); - - //tPropertyListDlg::OnClose(); - return false; -} - -void tQuantizeDlg::OnHelp() -{ -// if (mpEventWindow->NextWin) -// { -// gpHelpInstance->ShowTopic("Quantize"); -// } -// else -// { -// gpHelpInstance->ShowTopic("Pianowin Quantize"); -// } -} - -void tQuantizeDlg::AddProperties() -{ - sheet->AddProperty(new wxProperty( - "Note start", - wxPropertyValue((bool*)&NoteStart), - "bool")); - sheet->AddProperty(new wxProperty( - "Note length", - wxPropertyValue((bool*)&NoteLength), - "bool")); - sheet->AddProperty(new wxProperty( - "Groove", - wxPropertyValue(&Groove), - "int", - new wxRealListValidator(-100, 100))); - sheet->AddProperty(new wxProperty( - "Delay", - wxPropertyValue(&Delay), - "int", - new wxRealListValidator(-100, 100))); -} - - //***************************************************************************** // Event-Dialogue //***************************************************************************** Modified: trunk/jazz/src/Dialogs.h =================================================================== --- trunk/jazz/src/Dialogs.h 2009-02-17 02:25:11 UTC (rev 714) +++ trunk/jazz/src/Dialogs.h 2009-02-17 14:45:54 UTC (rev 715) @@ -104,22 +104,6 @@ void OnHelp(); }; -// SetChannel -class tSetChannelDlg : public tPropertyListDlg -{ - public: - - static int NewChannel; // 0 - - JZFilter *Filter; - JZSong *Song; - - tSetChannelDlg(JZFilter *f); - void AddProperties(); - bool OnClose(); - void OnHelp(); -}; - // seqLength class tSeqLengthDlg : public tPropertyListDlg { @@ -176,28 +160,6 @@ int* ptr; }; -class tQuantizeDlg : public tPropertyListDlg -{ - public: - - static bool NoteStart; // 1 - static bool NoteLength; // 0 - static int QntStep; // 1/16 - static int Groove; // -x .. +x - static int Delay; // -x .. +x - - JZFilter *Filter; - JZSong *Song; - - long Quantize(long); - - tQuantizeDlg(JZEventWindow* w, JZFilter* pFilter); - void AddProperties(); - //tNamedChoice Steps; - bool OnClose(); - void OnHelp(); -}; - void EventDialog( JZEvent*, JZPianoWindow*, Modified: trunk/jazz/src/EventWindow.cpp =================================================================== --- trunk/jazz/src/EventWindow.cpp 2009-02-17 02:25:11 UTC (rev 714) +++ trunk/jazz/src/EventWindow.cpp 2009-02-17 14:45:54 UTC (rev 715) @@ -25,6 +25,8 @@ #include "Command.h" #include "Dialogs/DeleteDialog.h" #include "Dialogs/LengthDialog.h" +#include "Dialogs/MidiChannelDialog.h" +#include "Dialogs/QuantizeDialog.h" #include "Dialogs/ShiftDialog.h" #include "Dialogs/VelocityDialog.h" #include "Dialogs.h" @@ -161,13 +163,37 @@ { if (AreEventsSelected()) { -// wxDialogBox *panel = new wxDialogBox(this, "Quantize", FALSE ); - tQuantizeDlg* pQuantizeDlg = new tQuantizeDlg(this, mpFilter); - pQuantizeDlg->Create(); + int QuantizationStep = 16; + bool NoteStart = true; + bool NoteLength = false; + int Delay = 0; + int Groove = 0; -// tCmdQuantize QuantizeCommand(mpFilter, SnapClocks(), 0, 0); -// QuantizeCommand.Execute(1); -// JZProjectManager::Instance()->UpdateAllViews(); + JZQuantizeDialog QuantizeDialog( + QuantizationStep, + NoteStart, + NoteLength, + Groove, + Delay, + this); + + if (QuantizeDialog.ShowModal() == wxID_OK) + { + int Step = mpSong->GetTicksPerQuarter() * 4 / QuantizationStep; + + tCmdQuantize QuantizeCommand( + mpFilter, + QuantizationStep, + NoteStart, + NoteLength, + Groove * Step / 100, + Delay * Step / 100); + + QuantizeCommand.Execute(); +// QuantizeCommand.Execute(1); + + JZProjectManager::Instance()->UpdateAllViews(); + } } } @@ -175,8 +201,15 @@ //----------------------------------------------------------------------------- void JZEventWindow::SetChannel() { - tSetChannelDlg * dlg = new tSetChannelDlg(mpFilter); - dlg->Create(); + int NewChannel = 1; + + JZMidiChannelDialog MidiChannelDialog(NewChannel, this); + if (MidiChannelDialog.ShowModal() == wxID_OK) + { + tCmdSetChannel SetMidiChannelCommand(mpFilter, NewChannel - 1); + SetMidiChannelCommand.Execute(); + JZProjectManager::Instance()->UpdateAllViews(); + } } //----------------------------------------------------------------------------- Modified: trunk/jazz/src/Globals.cpp =================================================================== --- trunk/jazz/src/Globals.cpp 2009-02-17 02:25:11 UTC (rev 714) +++ trunk/jazz/src/Globals.cpp 2009-02-17 14:45:54 UTC (rev 715) @@ -51,7 +51,7 @@ vector<pair<string, int> > gScaleNames; -vector<pair<string, int> > gQntSteps; +map<int, string> gQntSteps; vector<pair<string, int> > gSynthesizerTypes; Modified: trunk/jazz/src/Globals.h =================================================================== --- trunk/jazz/src/Globals.h 2009-02-17 02:25:11 UTC (rev 714) +++ trunk/jazz/src/Globals.h 2009-02-17 14:45:54 UTC (rev 715) @@ -23,6 +23,7 @@ #ifndef JZ_GLOBALS_H #define JZ_GLOBALS_H +#include <map> #include <vector> #include <string> @@ -55,7 +56,7 @@ extern const int gScaleChromatic; extern const int gScaleSelected; extern std::vector<std::pair<std::string, int> > gScaleNames; -extern std::vector<std::pair<std::string, int> > gQntSteps; +extern std::map<int, std::string> gQntSteps; extern std::vector<std::pair<std::string, int> > gSynthesizerTypes; extern std::vector<std::pair<std::string, int> > gSynthesierTypeFiles; extern JZProject* gpProject; Modified: trunk/jazz/src/Makefile.am =================================================================== --- trunk/jazz/src/Makefile.am 2009-02-17 02:25:11 UTC (rev 714) +++ trunk/jazz/src/Makefile.am 2009-02-17 14:45:54 UTC (rev 715) @@ -28,6 +28,8 @@ Dialogs/LengthDialog.cpp \ Dialogs/KeyOnDialog.cpp \ Dialogs/MetronomeSettingsDialog.cpp \ +Dialogs/MidiChannelDialog.cpp \ +Dialogs/QuantizeDialog.cpp \ Dialogs/ShiftDialog.cpp \ Dialogs/SynthesizerSettingsDialog.cpp \ Dialogs/TrackDialog.cpp \ @@ -110,6 +112,8 @@ Dialogs/LengthDialog.cpp \ Dialogs/KeyOnDialog.cpp \ Dialogs/MetronomeSettingsDialog.cpp \ +Dialogs/MidiChannelDialog.cpp \ +Dialogs/QuantizeDialog.cpp \ Dialogs/ShiftDialog.cpp \ Dialogs/SynthesizerSettingsDialog.cpp \ Dialogs/TrackDialog.cpp \ @@ -197,6 +201,8 @@ Dialogs/LengthDialog.h \ Dialogs/KeyOnDialog.h \ Dialogs/MetronomeSettingsDialog.h \ +Dialogs/MidiChannelDialog.h \ +Dialogs/QuantizeDialog.h \ Dialogs/ShiftDialog.h \ Dialogs/SynthesizerSettingsDialog.h \ Dialogs/TrackDialog.h \ Modified: trunk/jazz/src/PianoWindow.cpp =================================================================== --- trunk/jazz/src/PianoWindow.cpp 2009-02-17 02:25:11 UTC (rev 714) +++ trunk/jazz/src/PianoWindow.cpp 2009-02-17 14:45:54 UTC (rev 715) @@ -2762,8 +2762,8 @@ { if (EventsSelected()) { - tCmdQuantize cmd(mpFilter, SnapClocks(), 0, 0); - cmd.Execute(1); + tCmdQuantize QuantizeCommand(mpFilter, SnapClocks(), true, false, 0, 0); + QuantizeCommand.Execute(1); Refresh(); } } Modified: trunk/jazz/src/Project.cpp =================================================================== --- trunk/jazz/src/Project.cpp 2009-02-17 02:25:11 UTC (rev 714) +++ trunk/jazz/src/Project.cpp 2009-02-17 14:45:54 UTC (rev 715) @@ -115,13 +115,13 @@ if (gQntSteps.empty()) { - gQntSteps.push_back(make_pair("1/8", 8)); - gQntSteps.push_back(make_pair("1/12", 12)); - gQntSteps.push_back(make_pair("1/16", 16)); - gQntSteps.push_back(make_pair("1/24", 24)); - gQntSteps.push_back(make_pair("1/32", 32)); - gQntSteps.push_back(make_pair("1/48", 48)); - gQntSteps.push_back(make_pair("1/96", 96)); + gQntSteps.insert(make_pair(8, "1/8")); + gQntSteps.insert(make_pair(12, "1/12")); + gQntSteps.insert(make_pair(16, "1/16")); + gQntSteps.insert(make_pair(24, "1/24")); + gQntSteps.insert(make_pair(32, "1/32")); + gQntSteps.insert(make_pair(48, "1/48")); + gQntSteps.insert(make_pair(96, "1/96")); } if (gSynthesizerTypes.empty()) Modified: trunk/jazz/src/Resources.h =================================================================== --- trunk/jazz/src/Resources.h 2009-02-17 02:25:11 UTC (rev 714) +++ trunk/jazz/src/Resources.h 2009-02-17 14:45:54 UTC (rev 715) @@ -91,11 +91,18 @@ #define IDC_KB_CHANNEL wxID_HIGHEST + 1102 // JZVelocityDialog resource IDs. -#define IDC_KB_VELOCITY_START wxID_HIGHEST + 1201 -#define IDC_KB_VELOCITY_STOP wxID_HIGHEST + 1202 +#define IDC_KB_VELOCITY_START wxID_HIGHEST + 1200 +#define IDC_KB_VELOCITY_STOP wxID_HIGHEST + 1201 // JZLengthDialog resource IDs. -#define IDC_KB_LENGTH_START wxID_HIGHEST + 1301 -#define IDC_KB_LENGTH_STOP wxID_HIGHEST + 1302 +#define IDC_KB_LENGTH_START wxID_HIGHEST + 1210 +#define IDC_KB_LENGTH_STOP wxID_HIGHEST + 1211 +// JZMidiChannelDialog resource IDs. +#define IDC_KB_MIDI_CHANNEL wxID_HIGHEST + 1220 + +// JZQuantizeDialog resource IDs. +#define IDC_KB_GROOVE wxID_HIGHEST + 1230 +#define IDC_KB_DELAY wxID_HIGHEST + 1231 + #endif // !defined(JZ_RESOURCES_H) Modified: trunk/jazz/vc8/JazzPlusPlus-VC8.vcproj =================================================================== --- trunk/jazz/vc8/JazzPlusPlus-VC8.vcproj 2009-02-17 02:25:11 UTC (rev 714) +++ trunk/jazz/vc8/JazzPlusPlus-VC8.vcproj 2009-02-17 14:45:54 UTC (rev 715) @@ -875,6 +875,22 @@ > </File> <File + RelativePath="..\src\Dialogs\MidiChannelDialog.cpp" + > + </File> + <File + RelativePath="..\src\Dialogs\MidiChannelDialog.h" + > + </File> + <File + RelativePath="..\src\Dialogs\QuantizeDialog.cpp" + > + </File> + <File + RelativePath="..\src\Dialogs\QuantizeDialog.h" + > + </File> + <File RelativePath="..\src\Dialogs\ShiftDialog.cpp" > </File> Modified: trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj =================================================================== --- trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj 2009-02-17 02:25:11 UTC (rev 714) +++ trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj 2009-02-17 14:45:54 UTC (rev 715) @@ -893,6 +893,22 @@ > </File> <File + RelativePath="..\src\Dialogs\MidiChannelDialog.cpp" + > + </File> + <File + RelativePath="..\src\Dialogs\MidiChannelDialog.h" + > + </File> + <File + RelativePath="..\src\Dialogs\QuantizeDialog.cpp" + > + </File> + <File + RelativePath="..\src\Dialogs\QuantizeDialog.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...> - 2009-02-17 02:25:15
|
Revision: 714 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=714&view=rev Author: pstieber Date: 2009-02-17 02:25:11 +0000 (Tue, 17 Feb 2009) Log Message: ----------- Added the new length dialog box and removed the old version. Modified Paths: -------------- trunk/jazz/src/Dialogs.cpp trunk/jazz/src/Dialogs.h trunk/jazz/src/EventWindow.cpp trunk/jazz/src/Makefile.am trunk/jazz/vc8/JazzPlusPlus-VC8.vcproj trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj Modified: trunk/jazz/src/Dialogs.cpp =================================================================== --- trunk/jazz/src/Dialogs.cpp 2009-02-17 02:08:49 UTC (rev 713) +++ trunk/jazz/src/Dialogs.cpp 2009-02-17 02:25:11 UTC (rev 714) @@ -331,67 +331,6 @@ //***************************************************************************** -// Length -//***************************************************************************** - -int tLengthDlg::FromValue = 30; -int tLengthDlg::ToValue = 0; - -JEValueAlterationMode tLengthDlg::Mode; - -tLengthDlg::tLengthDlg(JZEventWindow* w, JZFilter *f) -: tPropertyListDlg("Length") -{ - Filter = f; - Song = f->GetSong(); -} - - -bool tLengthDlg::OnClose() -{ - tCmdLength cmd(Filter, FromValue, ToValue, Mode); - cmd.Execute(); - - JZProjectManager::Instance()->UpdateAllViews(); - - //tPropertyListDlg::OnClose(); - return false; -} - -void tLengthDlg::OnHelp() -{ - gpHelpInstance->ShowTopic("Length"); -} - - -void tLengthDlg::AddProperties() -{ - sheet->AddProperty(new wxProperty( - "Ticks/Quarter", - wxPropertyValue((long)Song->GetTicksPerQuarter()), - "integer", - new wxIntegerListValidator(-16, 16))); //r/o - - sheet->AddProperty(new wxProperty( - "Start", - wxPropertyValue(&FromValue), - "integer", - new wxIntegerListValidator(0, Song->GetTicksPerQuarter() * 4))); - sheet->AddProperty(new wxProperty( - "Stop", - wxPropertyValue(&ToValue), - "integer", - new wxIntegerListValidator(0, Song->GetTicksPerQuarter() * 4))); -// sheet->AddProperty(new wxProperty( -// "Mode", -// tNamedValueListValue(&Mode, gModes), -// "props", -// new tNamedValueListValidator(gModes))); -} - - - -//***************************************************************************** // seqLength //***************************************************************************** Modified: trunk/jazz/src/Dialogs.h =================================================================== --- trunk/jazz/src/Dialogs.h 2009-02-17 02:08:49 UTC (rev 713) +++ trunk/jazz/src/Dialogs.h 2009-02-17 02:25:11 UTC (rev 714) @@ -120,24 +120,6 @@ void OnHelp(); }; -// Length -class tLengthDlg : public tPropertyListDlg -{ - public: - - static int FromValue, ToValue; - static JEValueAlterationMode Mode; - static char *mode_str; - - JZFilter *Filter; - JZSong *Song; - - tLengthDlg(JZEventWindow* win, JZFilter *f); - void AddProperties(); - bool OnClose(); - void OnHelp(); -}; - // seqLength class tSeqLengthDlg : public tPropertyListDlg { Modified: trunk/jazz/src/EventWindow.cpp =================================================================== --- trunk/jazz/src/EventWindow.cpp 2009-02-17 02:08:49 UTC (rev 713) +++ trunk/jazz/src/EventWindow.cpp 2009-02-17 02:25:11 UTC (rev 714) @@ -24,6 +24,7 @@ #include "Command.h" #include "Dialogs/DeleteDialog.h" +#include "Dialogs/LengthDialog.h" #include "Dialogs/ShiftDialog.h" #include "Dialogs/VelocityDialog.h" #include "Dialogs.h" @@ -222,8 +223,23 @@ //----------------------------------------------------------------------------- void JZEventWindow::Length() { - tLengthDlg * dlg = new tLengthDlg(this, mpFilter); - dlg->Create(); + int FromValue = 30; + int ToValue = 0; + JEValueAlterationMode Mode = eSetValues; + + JZLengthDialog LengthDialog( + this, + mpFilter->GetSong()->GetTicksPerQuarter(), + FromValue, + ToValue, + Mode); + if (LengthDialog.ShowModal() == wxID_OK) + { + tCmdLength LengthCommand(mpFilter, FromValue, ToValue, Mode); + LengthCommand.Execute(); + + JZProjectManager::Instance()->UpdateAllViews(); + } } //----------------------------------------------------------------------------- Modified: trunk/jazz/src/Makefile.am =================================================================== --- trunk/jazz/src/Makefile.am 2009-02-17 02:08:49 UTC (rev 713) +++ trunk/jazz/src/Makefile.am 2009-02-17 02:25:11 UTC (rev 714) @@ -25,6 +25,7 @@ Dialogs/DeleteDialog.cpp \ Dialogs/FilterDialog.cpp \ Dialogs/IntegerEdit.cpp \ +Dialogs/LengthDialog.cpp \ Dialogs/KeyOnDialog.cpp \ Dialogs/MetronomeSettingsDialog.cpp \ Dialogs/ShiftDialog.cpp \ @@ -103,13 +104,16 @@ DeprecatedWx/prop.cpp \ DeprecatedWx/propform.cpp \ DeprecatedWx/proplist.cpp \ +Dialogs/DeleteDialog.cpp \ Dialogs/FilterDialog.cpp \ Dialogs/IntegerEdit.cpp \ +Dialogs/LengthDialog.cpp \ Dialogs/KeyOnDialog.cpp \ Dialogs/MetronomeSettingsDialog.cpp \ Dialogs/ShiftDialog.cpp \ Dialogs/SynthesizerSettingsDialog.cpp \ Dialogs/TrackDialog.cpp \ +Dialogs/VelocityDialog.cpp \ Dialogs.cpp \ DynamicArray.cpp \ ErrorMessage.cpp \ @@ -187,13 +191,16 @@ DeprecatedWx/propform.h \ DeprecatedWx/proplist.h \ DeprecatedStringUtils.h \ +Dialogs/DeleteDialog.h \ Dialogs/FilterDialog.h \ Dialogs/IntegerEdit.h \ +Dialogs/LengthDialog.h \ Dialogs/KeyOnDialog.h \ Dialogs/MetronomeSettingsDialog.h \ Dialogs/ShiftDialog.h \ Dialogs/SynthesizerSettingsDialog.h \ Dialogs/TrackDialog.h \ +Dialogs/VelocityDialog.h \ Dialogs.h \ DynamicArray.h \ ErrorMessage.h \ Modified: trunk/jazz/vc8/JazzPlusPlus-VC8.vcproj =================================================================== --- trunk/jazz/vc8/JazzPlusPlus-VC8.vcproj 2009-02-17 02:08:49 UTC (rev 713) +++ trunk/jazz/vc8/JazzPlusPlus-VC8.vcproj 2009-02-17 02:25:11 UTC (rev 714) @@ -859,6 +859,14 @@ > </File> <File + RelativePath="..\src\Dialogs\LengthDialog.cpp" + > + </File> + <File + RelativePath="..\src\Dialogs\LengthDialog.h" + > + </File> + <File RelativePath="..\src\Dialogs\MetronomeSettingsDialog.cpp" > </File> Modified: trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj =================================================================== --- trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj 2009-02-17 02:08:49 UTC (rev 713) +++ trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj 2009-02-17 02:25:11 UTC (rev 714) @@ -877,6 +877,14 @@ > </File> <File + RelativePath="..\src\Dialogs\LengthDialog.cpp" + > + </File> + <File + RelativePath="..\src\Dialogs\LengthDialog.h" + > + </File> + <File RelativePath="..\src\Dialogs\MetronomeSettingsDialog.cpp" > </File> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2009-02-17 02:10:48
|
Revision: 712 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=712&view=rev Author: pstieber Date: 2009-02-17 02:08:02 +0000 (Tue, 17 Feb 2009) Log Message: ----------- Added resource IDs for a new length dialog. Modified Paths: -------------- trunk/jazz/src/Resources.h Modified: trunk/jazz/src/Resources.h =================================================================== --- trunk/jazz/src/Resources.h 2009-02-17 02:07:25 UTC (rev 711) +++ trunk/jazz/src/Resources.h 2009-02-17 02:08:02 UTC (rev 712) @@ -94,4 +94,8 @@ #define IDC_KB_VELOCITY_START wxID_HIGHEST + 1201 #define IDC_KB_VELOCITY_STOP wxID_HIGHEST + 1202 +// JZLengthDialog resource IDs. +#define IDC_KB_LENGTH_START wxID_HIGHEST + 1301 +#define IDC_KB_LENGTH_STOP wxID_HIGHEST + 1302 + #endif // !defined(JZ_RESOURCES_H) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2009-02-17 02:10:46
|
Revision: 711 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=711&view=rev Author: pstieber Date: 2009-02-17 02:07:25 +0000 (Tue, 17 Feb 2009) Log Message: ----------- 1. Added a comment header. 2. Fixed a cut & paste error in the length menu handler. 3. Removed an unneeded Redraw command. Modified Paths: -------------- trunk/jazz/src/EventFrame.cpp trunk/jazz/src/EventFrame.h Modified: trunk/jazz/src/EventFrame.cpp =================================================================== --- trunk/jazz/src/EventFrame.cpp 2009-02-17 01:21:46 UTC (rev 710) +++ trunk/jazz/src/EventFrame.cpp 2009-02-17 02:07:25 UTC (rev 711) @@ -1,3 +1,23 @@ +//***************************************************************************** +// The JAZZ++ Midi Sequencer +// +// Copyright (C) 2009 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 "EventFrame.h" #include "EventWindow.h" @@ -35,7 +55,7 @@ EVT_MENU(ID_VELOCITY, JZEventFrame::OnVelocity) EVT_UPDATE_UI(ID_LENGTH, JZEventFrame::OnUpdateEventsSelected) - EVT_MENU(ID_VELOCITY, JZEventFrame::OnLength) + EVT_MENU(ID_LENGTH, JZEventFrame::OnLength) END_EVENT_TABLE() @@ -79,24 +99,6 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZEventFrame::Redraw() -{ -// wxDC* dc=new wxClientDC(this); -// wxPaintEvent PaintEvent; -// cout<<"FIXME JZEventFrame::Redraw"<<endl; -// mpEventWindow->OnDraw(*dc); //this will in turn call the eventwin onpaintsub -// // the problem is that onpaint no longer takes arguments, and is supposed -// // to be called from the framework only, so it should be split. -// delete dc; - -// if (mpEventWindow) -// { -// mpEventWindow->Refresh(); -// } -} - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- void JZEventFrame::OnUpdateEventsSelected(wxUpdateUIEvent& Event) { if (mpEventWindow) Modified: trunk/jazz/src/EventFrame.h =================================================================== --- trunk/jazz/src/EventFrame.h 2009-02-17 01:21:46 UTC (rev 710) +++ trunk/jazz/src/EventFrame.h 2009-02-17 02:07:25 UTC (rev 711) @@ -1,9 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 1994-2000 Andreas Voss and Per Sigmond, all rights reserved. -// Modifications Copyright (C) 2004 Patrick Earl -// Modifications Copyright (C) 2008-2009 Peter J. Stieber +// Copyright (C) 2009 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 @@ -57,9 +55,6 @@ virtual bool OnClose(); - // Redraw - nach Aenderungen von Parametern, kein GUI-Event - virtual void Redraw(); - private: void OnUpdateEventsSelected(wxUpdateUIEvent& Event); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2009-02-17 02:10:45
|
Revision: 713 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=713&view=rev Author: pstieber Date: 2009-02-17 02:08:49 +0000 (Tue, 17 Feb 2009) Log Message: ----------- Added a new length dialog. Added Paths: ----------- trunk/jazz/src/Dialogs/LengthDialog.cpp trunk/jazz/src/Dialogs/LengthDialog.h Added: trunk/jazz/src/Dialogs/LengthDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/LengthDialog.cpp (rev 0) +++ trunk/jazz/src/Dialogs/LengthDialog.cpp 2009-02-17 02:08:49 UTC (rev 713) @@ -0,0 +1,250 @@ +//***************************************************************************** +// The JAZZ++ Midi Sequencer +// +// Copyright (C) 2009 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 "LengthDialog.h" + +#include "../Globals.h" +#include "../Help.h" +#include "../Knob.h" +#include "../Resources.h" + +#include <wx/button.h> +#include <wx/radiobox.h> +#include <wx/sizer.h> +#include <wx/stattext.h> + +#include <sstream> + +using namespace std; + +//***************************************************************************** +//***************************************************************************** +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +BEGIN_EVENT_TABLE(JZLengthDialog, wxDialog) + + EVT_KNOB_CHANGED( + IDC_KB_LENGTH_START, + JZLengthDialog::OnLengthStartChange) + + EVT_KNOB_CHANGED( + IDC_KB_LENGTH_STOP, + JZLengthDialog::OnLengthStopChange) + + EVT_BUTTON(wxID_HELP, JZLengthDialog::OnHelp) + +END_EVENT_TABLE() + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +JZLengthDialog::JZLengthDialog( + wxWindow* pParent, + int TicksPerQuarter, + int& FromValue, + int& ToValue, + JEValueAlterationMode& Mode) + : wxDialog(pParent, wxID_ANY, wxString("Length")), + mFromValue(FromValue), + mToValue(ToValue), + mMode(Mode), + mpLengthStartKnob(0), + mpLengthStartValue(0), + mpLengthStopKnob(0), + mpLengthStopValue(0), + mpModeRadioBox(0) +{ + mpLengthStartKnob = new JZKnob( + this, + IDC_KB_LENGTH_START, + 0, + 0, + 4 * TicksPerQuarter); + mpLengthStartValue = new wxStaticText(this, wxID_ANY, "000"); + + mpLengthStopKnob = new JZKnob( + this, + IDC_KB_LENGTH_STOP, + 0, + 0, + 4 * TicksPerQuarter); + mpLengthStopValue = new wxStaticText(this, wxID_ANY, "000"); + + wxString Choices[] = + { + "Set Values", + "Add To Value", + "Subtract From Values" + }; + mpModeRadioBox = new wxRadioBox( + this, + wxID_ANY, + "Value Application Mode", + wxDefaultPosition, + wxDefaultSize, + 3, + Choices, + 1, + wxRA_SPECIFY_COLS); + + 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); + + wxString String; + + String << "Ticks per Quarter: " << TicksPerQuarter; + + pTopSizer->Add( + new wxStaticText(this, wxID_ANY, String), + 0, + wxALIGN_CENTER | wxALL, + 5); + + wxFlexGridSizer* pFlexGridSizer = new wxFlexGridSizer(2, 3, 4, 2); + + pFlexGridSizer->Add( + new wxStaticText(this, wxID_ANY, "Start Length:"), + 0, + wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); + pFlexGridSizer->Add( + mpLengthStartValue, + 0, + wxALIGN_CENTER_VERTICAL | wxFIXED_MINSIZE); + pFlexGridSizer->Add(mpLengthStartKnob, 0, wxALIGN_CENTER_VERTICAL); + + pFlexGridSizer->Add( + new wxStaticText(this, wxID_ANY, "Stop Length:"), + 0, + wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); + pFlexGridSizer->Add( + mpLengthStopValue, + 0, + wxALIGN_CENTER_VERTICAL | wxFIXED_MINSIZE); + pFlexGridSizer->Add(mpLengthStopKnob, 0, wxALIGN_CENTER_VERTICAL); + + pTopSizer->Add(pFlexGridSizer, 0, wxALIGN_CENTER); + + pTopSizer->Add( + mpModeRadioBox, + 0, + wxALIGN_CENTER | wxALL, + 5); + + 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 JZLengthDialog::TransferDataToWindow() +{ + ostringstream Oss; + + Oss << mFromValue; + mpLengthStartValue->SetLabel(Oss.str().c_str()); + + mpLengthStartKnob->SetValue(mFromValue); + + Oss.str(""); + Oss << mToValue; + mpLengthStopValue->SetLabel(Oss.str().c_str()); + + mpLengthStopKnob->SetValue(mToValue); + + switch (mMode) + { + case eSetValues: + mpModeRadioBox->SetSelection(0); + break; + case eAddValues: + mpModeRadioBox->SetSelection(1); + break; + case eSubtractValues: + mpModeRadioBox->SetSelection(2); + break; + } + + return true; +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +bool JZLengthDialog::TransferDataFromWindow() +{ + mFromValue = mpLengthStartKnob->GetValue(); + + mToValue = mpLengthStopKnob->GetValue(); + + int Selection = mpModeRadioBox->GetSelection(); + if (Selection == 1) + { + mMode = eAddValues; + } + else if (Selection == 2) + { + mMode = eSubtractValues; + } + else + { + mMode = eSetValues; + } + + return true; +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZLengthDialog::OnLengthStartChange(JZKnobEvent& Event) +{ + int Value = Event.GetValue(); + ostringstream Oss; + Oss << Value; + mpLengthStartValue->SetLabel(Oss.str().c_str()); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZLengthDialog::OnLengthStopChange(JZKnobEvent& Event) +{ + int Value = Event.GetValue(); + ostringstream Oss; + Oss << Value; + mpLengthStopValue->SetLabel(Oss.str().c_str()); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZLengthDialog::OnHelp(wxCommandEvent& Event) +{ + gpHelpInstance->ShowTopic("Length"); +} Property changes on: trunk/jazz/src/Dialogs/LengthDialog.cpp ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/jazz/src/Dialogs/LengthDialog.h =================================================================== --- trunk/jazz/src/Dialogs/LengthDialog.h (rev 0) +++ trunk/jazz/src/Dialogs/LengthDialog.h 2009-02-17 02:08:49 UTC (rev 713) @@ -0,0 +1,74 @@ +//***************************************************************************** +// The JAZZ++ Midi Sequencer +// +// Copyright (C) 2009 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_LENGTHDIALOG_H +#define JZ_LENGTHDIALOG_H + +#include "../CommandUtilities.h" + +#include <wx/dialog.h> + +class JZKnob; +class JZKnobEvent; +class wxRadioBox; +class wxStaticText; + +//***************************************************************************** +//***************************************************************************** +class JZLengthDialog : public wxDialog +{ + public: + + JZLengthDialog( + wxWindow* pParent, + int TicksPerQuarter, + int& FromValue, + int& ToValue, + JEValueAlterationMode& Mode); + + private: + + virtual bool TransferDataToWindow(); + + virtual bool TransferDataFromWindow(); + + void OnLengthStartChange(JZKnobEvent& Event); + + void OnLengthStopChange(JZKnobEvent& Event); + + void OnHelp(wxCommandEvent& Event); + + private: + + int& mFromValue; + int& mToValue; + JEValueAlterationMode& mMode; + + JZKnob* mpLengthStartKnob; + wxStaticText* mpLengthStartValue; + JZKnob* mpLengthStopKnob; + wxStaticText* mpLengthStopValue; + + wxRadioBox* mpModeRadioBox; + + DECLARE_EVENT_TABLE(); +}; + +#endif // !defined(JZ_LENGTHDIALOG_H) Property changes on: trunk/jazz/src/Dialogs/LengthDialog.h ___________________________________________________________________ Added: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2009-02-17 01:21:50
|
Revision: 710 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=710&view=rev Author: pstieber Date: 2009-02-17 01:21:46 +0000 (Tue, 17 Feb 2009) Log Message: ----------- Added a forward declaration of wxRadioBox. Modified Paths: -------------- trunk/jazz/src/Dialogs/VelocityDialog.h Modified: trunk/jazz/src/Dialogs/VelocityDialog.h =================================================================== --- trunk/jazz/src/Dialogs/VelocityDialog.h 2009-02-17 01:13:18 UTC (rev 709) +++ trunk/jazz/src/Dialogs/VelocityDialog.h 2009-02-17 01:21:46 UTC (rev 710) @@ -27,6 +27,7 @@ class JZKnob; class JZKnobEvent; +class wxRadioBox; class wxStaticText; //***************************************************************************** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2009-02-17 01:13:20
|
Revision: 709 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=709&view=rev Author: pstieber Date: 2009-02-17 01:13:18 +0000 (Tue, 17 Feb 2009) Log Message: ----------- 1. Removed the ResourceDialog.cpp/.h code from the build. 2. Used the JEValueAlterationMode enumeration in the velocity and length commands. Also made the data members in the velocity and length commands private. 3. Removed the old velocity dialog. 4. Changed include paths in the delete dialog source file. 5. Implemented a new velocity dialog and started using it in the event window.. Modified Paths: -------------- trunk/jazz/src/Command.cpp trunk/jazz/src/Command.h trunk/jazz/src/Dialogs/DeleteDialog.cpp trunk/jazz/src/Dialogs/VelocityDialog.cpp trunk/jazz/src/Dialogs/VelocityDialog.h trunk/jazz/src/Dialogs.cpp trunk/jazz/src/Dialogs.h trunk/jazz/src/EventWindow.cpp trunk/jazz/src/Makefile.am trunk/jazz/src/PianoFrame.cpp trunk/jazz/src/PianoWindow.cpp trunk/jazz/vc8/JazzPlusPlus-VC8.vcproj trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj Modified: trunk/jazz/src/Command.cpp =================================================================== --- trunk/jazz/src/Command.cpp 2009-02-17 00:51:53 UTC (rev 708) +++ trunk/jazz/src/Command.cpp 2009-02-17 01:13:18 UTC (rev 709) @@ -475,12 +475,16 @@ // tCmdVelocity // ************************************************************************ -tCmdVelocity::tCmdVelocity(JZFilter* pFilter, int from, int to, int m) - : tCommand(pFilter) +tCmdVelocity::tCmdVelocity( + JZFilter* pFilter, + int FromValue, + int ToValue, + JEValueAlterationMode Mode) + : tCommand(pFilter), + mFromValue(FromValue), + mToValue(ToValue), + mMode(Mode) { - FromValue = from; - ToValue = to; - Mode = m; } void tCmdVelocity::ExecuteEvent(JZTrack* pTrack, JZEvent* pEvent) @@ -490,23 +494,27 @@ if (pEvent->IsKeyOn() != 0) { pKeyOn = (tKeyOn *)pEvent->Copy(); - long val = 0; - if (ToValue <= 0) - val = FromValue; + int Value = 0; + if (mToValue <= 0) + { + Value = mFromValue; + } else - val = Interpolate(pKeyOn->GetClock(), FromValue, ToValue); - switch (Mode) { - case 0: + Value = Interpolate(pKeyOn->GetClock(), mFromValue, mToValue); + } + switch (mMode) + { + case eSetValues: break; - case 1: - val = pKeyOn->GetVelocity() + val; + case eAddValues: + Value = pKeyOn->GetVelocity() + Value; break; - case 2: - val = pKeyOn->GetVelocity() - val; + case eSubtractValues: + Value = pKeyOn->GetVelocity() - Value; break; } - pKeyOn->SetVelocity(val < 1 ? 1 : (val > 127 ? 127 : val)); + pKeyOn->SetVelocity(Value < 1 ? 1 : (Value > 127 ? 127 : Value)); pTrack->Kill(pEvent); pTrack->Put(pKeyOn); } @@ -516,12 +524,16 @@ // tCmdLength // ************************************************************************ -tCmdLength::tCmdLength(JZFilter* pFilter, int from, int to, int m) - : tCommand(pFilter) +tCmdLength::tCmdLength( + JZFilter* pFilter, + int FromValue, + int ToValue, + JEValueAlterationMode Mode) + : tCommand(pFilter), + mFromValue(FromValue), + mToValue(ToValue), + mMode(Mode) { - FromValue = from; - ToValue = to; - Mode = m; } void tCmdLength::ExecuteEvent(JZTrack* pTrack, JZEvent* pEvent) @@ -531,24 +543,28 @@ if (pEvent->IsKeyOn() != 0) { pKeyOn = (tKeyOn *)pEvent->Copy(); - long val = 0; - if (ToValue <= 0) - val = FromValue; + int Value = 0; + if (mToValue <= 0) + { + Value = mFromValue; + } else - val = Interpolate(pKeyOn->GetClock(), FromValue, ToValue); - switch (Mode) { - case 0: + Value = Interpolate(pKeyOn->GetClock(), mFromValue, mToValue); + } + switch (mMode) + { + case eSetValues: break; - case 1: - val = pKeyOn->GetEventLength() + val; + case eAddValues: + Value = pKeyOn->GetEventLength() + Value; break; - case 2: - val = pKeyOn->GetEventLength() - val; + case eSubtractValues: + Value = pKeyOn->GetEventLength() - Value; break; } - pKeyOn->SetLength(val < 1 ? 1 : val); + pKeyOn->SetLength(Value < 1 ? 1 : Value); pTrack->Kill(pEvent); pTrack->Put(pKeyOn); } @@ -558,8 +574,8 @@ // ************************************************************************ // tCmdSeqLength -// JAVE this command is supposed to stretch/contract a sequence of events in time -// by factor "scale" from starting point "startClock" +// This command is supposed to stretch/contract a sequence of events in +// time by factor "scale" from starting point "startClock" // ************************************************************************ tCmdSeqLength::tCmdSeqLength(JZFilter* pFilter, double scale) @@ -1029,7 +1045,7 @@ tKeyOn* pKeyOn = (tKeyOn *)pEvent->Copy(); int n_th = 0; - // the n'th key from bottom .. + // the n'th key from bottom for (i = 0; i <= pKeyOn->GetKey(); i++) { n_th += Keys[i]; Modified: trunk/jazz/src/Command.h =================================================================== --- trunk/jazz/src/Command.h 2009-02-17 00:51:53 UTC (rev 708) +++ trunk/jazz/src/Command.h 2009-02-17 01:13:18 UTC (rev 709) @@ -23,6 +23,8 @@ #ifndef JZ_COMMAND_H #define JZ_COMMAND_H +#include "CommandUtilities.h" + class JZFilter; class JZEvent; class JZTrack; @@ -107,9 +109,19 @@ class tCmdVelocity : public tCommand { public: - int FromValue, ToValue, Mode; - tCmdVelocity(JZFilter* pFilter, int From, int To, int Mode); + + tCmdVelocity( + JZFilter* pFilter, + int From, + int To, + JEValueAlterationMode Mode); + virtual void ExecuteEvent(JZTrack* pTrack, JZEvent* pEvent); + + private: + + int mFromValue, mToValue; + JEValueAlterationMode mMode; }; //***************************************************************************** @@ -117,9 +129,19 @@ class tCmdLength : public tCommand { public: - int FromValue, ToValue, Mode; - tCmdLength(JZFilter* pFilter, int From, int To, int Mode); + + tCmdLength( + JZFilter* pFilter, + int FromValue, + int ToValue, + JEValueAlterationMode Mode); + virtual void ExecuteEvent(JZTrack* pTrack, JZEvent* pEvent); + + private: + + int mFromValue, mToValue; + JEValueAlterationMode mMode; }; //***************************************************************************** Modified: trunk/jazz/src/Dialogs/DeleteDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/DeleteDialog.cpp 2009-02-17 00:51:53 UTC (rev 708) +++ trunk/jazz/src/Dialogs/DeleteDialog.cpp 2009-02-17 01:13:18 UTC (rev 709) @@ -20,8 +20,8 @@ #include "DeleteDialog.h" -#include "Globals.h" -#include "Help.h" +#include "../Globals.h" +#include "../Help.h" #include <wx/button.h> #include <wx/checkbox.h> Modified: trunk/jazz/src/Dialogs/VelocityDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/VelocityDialog.cpp 2009-02-17 00:51:53 UTC (rev 708) +++ trunk/jazz/src/Dialogs/VelocityDialog.cpp 2009-02-17 01:13:18 UTC (rev 709) @@ -1,5 +1,229 @@ +//***************************************************************************** +// The JAZZ++ Midi Sequencer +// +// Copyright (C) 2009 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 "VelocityDialog.h" -JZVelocityDialog::JZVelocityDialog() +#include "../Globals.h" +#include "../Help.h" +#include "../Knob.h" +#include "../Resources.h" + +#include <wx/button.h> +#include <wx/radiobox.h> +#include <wx/sizer.h> +#include <wx/stattext.h> + +#include <sstream> + +using namespace std; + +//***************************************************************************** +//***************************************************************************** +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +BEGIN_EVENT_TABLE(JZVelocityDialog, wxDialog) + + EVT_KNOB_CHANGED( + IDC_KB_VELOCITY_START, + JZVelocityDialog::OnVelocityStartChange) + + EVT_KNOB_CHANGED( + IDC_KB_VELOCITY_STOP, + JZVelocityDialog::OnVelocityStopChange) + + EVT_BUTTON(wxID_HELP, JZVelocityDialog::OnHelp) + +END_EVENT_TABLE() + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +JZVelocityDialog::JZVelocityDialog( + wxWindow* pParent, + int& FromValue, + int& ToValue, + JEValueAlterationMode& Mode) + : wxDialog(pParent, wxID_ANY, wxString("Velocity")), + mFromValue(FromValue), + mToValue(ToValue), + mMode(Mode), + mpVelocityStartKnob(0), + mpVelocityStartValue(0), + mpVelocityStopKnob(0), + mpVelocityStopValue(0), + mpModeRadioBox(0) { + mpVelocityStartKnob = new JZKnob(this, IDC_KB_VELOCITY_START, 0, 0, 127); + mpVelocityStartValue = new wxStaticText(this, wxID_ANY, "000"); + + mpVelocityStopKnob = new JZKnob(this, IDC_KB_VELOCITY_STOP, 0, 0, 127); + mpVelocityStopValue = new wxStaticText(this, wxID_ANY, "000"); + + wxString Choices[] = + { + "Set Values", + "Add To Value", + "Subtract From Values" + }; + mpModeRadioBox = new wxRadioBox( + this, + wxID_ANY, + "Value Application Mode", + wxDefaultPosition, + wxDefaultSize, + 3, + Choices, + 1, + wxRA_SPECIFY_COLS); + + 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 = new wxFlexGridSizer(2, 3, 4, 2); + + pFlexGridSizer->Add( + new wxStaticText(this, wxID_ANY, "Start Velocity:"), + 0, + wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); + pFlexGridSizer->Add( + mpVelocityStartValue, + 0, + wxALIGN_CENTER_VERTICAL | wxFIXED_MINSIZE); + pFlexGridSizer->Add(mpVelocityStartKnob, 0, wxALIGN_CENTER_VERTICAL); + + pFlexGridSizer->Add( + new wxStaticText(this, wxID_ANY, "Stop Velocity:"), + 0, + wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); + pFlexGridSizer->Add( + mpVelocityStopValue, + 0, + wxALIGN_CENTER_VERTICAL | wxFIXED_MINSIZE); + pFlexGridSizer->Add(mpVelocityStopKnob, 0, wxALIGN_CENTER_VERTICAL); + + pTopSizer->Add(pFlexGridSizer, 0, wxALIGN_CENTER); + + pTopSizer->Add( + mpModeRadioBox, + 0, + wxALIGN_CENTER | wxALL, + 5); + + 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 JZVelocityDialog::TransferDataToWindow() +{ + ostringstream Oss; + + Oss << mFromValue; + mpVelocityStartValue->SetLabel(Oss.str().c_str()); + + mpVelocityStartKnob->SetValue(mFromValue); + + Oss.str(""); + Oss << mToValue; + mpVelocityStopValue->SetLabel(Oss.str().c_str()); + + mpVelocityStopKnob->SetValue(mToValue); + + switch (mMode) + { + case eSetValues: + mpModeRadioBox->SetSelection(0); + break; + case eAddValues: + mpModeRadioBox->SetSelection(1); + break; + case eSubtractValues: + mpModeRadioBox->SetSelection(2); + break; + } + + return true; +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +bool JZVelocityDialog::TransferDataFromWindow() +{ + mFromValue = mpVelocityStartKnob->GetValue(); + + mToValue = mpVelocityStopKnob->GetValue(); + + int Selection = mpModeRadioBox->GetSelection(); + if (Selection == 1) + { + mMode = eAddValues; + } + else if (Selection == 2) + { + mMode = eSubtractValues; + } + else + { + mMode = eSetValues; + } + + return true; +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZVelocityDialog::OnVelocityStartChange(JZKnobEvent& Event) +{ + int Value = Event.GetValue(); + ostringstream Oss; + Oss << Value; + mpVelocityStartValue->SetLabel(Oss.str().c_str()); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZVelocityDialog::OnVelocityStopChange(JZKnobEvent& Event) +{ + int Value = Event.GetValue(); + ostringstream Oss; + Oss << Value; + mpVelocityStopValue->SetLabel(Oss.str().c_str()); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZVelocityDialog::OnHelp(wxCommandEvent& Event) +{ + gpHelpInstance->ShowTopic("Velocity"); +} Modified: trunk/jazz/src/Dialogs/VelocityDialog.h =================================================================== --- trunk/jazz/src/Dialogs/VelocityDialog.h 2009-02-17 00:51:53 UTC (rev 708) +++ trunk/jazz/src/Dialogs/VelocityDialog.h 2009-02-17 01:13:18 UTC (rev 709) @@ -1,14 +1,72 @@ +//***************************************************************************** +// The JAZZ++ Midi Sequencer +// +// Copyright (C) 2009 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_VELOCITYDIALOG_H #define JZ_VELOCITYDIALOG_H +#include "../CommandUtilities.h" + #include <wx/dialog.h> +class JZKnob; +class JZKnobEvent; +class wxStaticText; + +//***************************************************************************** +//***************************************************************************** class JZVelocityDialog : public wxDialog { public: - JZVelocityDialog(); + JZVelocityDialog( + wxWindow* pParent, + int& FromValue, + int& ToValue, + JEValueAlterationMode& Mode); + private: + + virtual bool TransferDataToWindow(); + + virtual bool TransferDataFromWindow(); + + void OnVelocityStartChange(JZKnobEvent& Event); + + void OnVelocityStopChange(JZKnobEvent& Event); + + void OnHelp(wxCommandEvent& Event); + + private: + + int& mFromValue; + int& mToValue; + JEValueAlterationMode& mMode; + + JZKnob* mpVelocityStartKnob; + wxStaticText* mpVelocityStartValue; + JZKnob* mpVelocityStopKnob; + wxStaticText* mpVelocityStopValue; + + wxRadioBox* mpModeRadioBox; + + DECLARE_EVENT_TABLE(); }; #endif // !defined(JZ_VELOCITYDIALOG_H) Modified: trunk/jazz/src/Dialogs.cpp =================================================================== --- trunk/jazz/src/Dialogs.cpp 2009-02-17 00:51:53 UTC (rev 708) +++ trunk/jazz/src/Dialogs.cpp 2009-02-17 01:13:18 UTC (rev 709) @@ -331,64 +331,13 @@ //***************************************************************************** -// Velocity -//***************************************************************************** - -int tVelocityDlg::FromValue = 64; -int tVelocityDlg::ToValue = 0; -int tVelocityDlg::Mode = 0; - - -tVelocityDlg::tVelocityDlg(JZFilter *f) -: tPropertyListDlg( "Velocity" ) -{ - Filter = f; - Song = f->GetSong(); -} - - -bool tVelocityDlg::OnClose() -{ - tCmdVelocity cmd(Filter, FromValue, ToValue, Mode); - cmd.Execute(); - return false; -} - -void tVelocityDlg::OnHelp() -{ - gpHelpInstance->ShowTopic("Velocity"); -} - -void tVelocityDlg::AddProperties() -{ - sheet->AddProperty(new wxProperty( - "Start", - wxPropertyValue(&FromValue), - "integer", - new wxIntegerListValidator(0, 127))); - sheet->AddProperty(new wxProperty( - "Stop", - wxPropertyValue(&ToValue), - "integer", - new wxIntegerListValidator(0, 127))); - sheet->AddProperty(new wxProperty( - "Mode", - tNamedValueListValue(&Mode, gModes), - "props", - new tNamedValueListValidator(gModes))); -} - - - - -//***************************************************************************** // Length //***************************************************************************** int tLengthDlg::FromValue = 30; int tLengthDlg::ToValue = 0; -int tLengthDlg::Mode; +JEValueAlterationMode tLengthDlg::Mode; tLengthDlg::tLengthDlg(JZEventWindow* w, JZFilter *f) : tPropertyListDlg("Length") @@ -433,11 +382,11 @@ wxPropertyValue(&ToValue), "integer", new wxIntegerListValidator(0, Song->GetTicksPerQuarter() * 4))); - sheet->AddProperty(new wxProperty( - "Mode", - tNamedValueListValue(&Mode, gModes), - "props", - new tNamedValueListValidator(gModes))); +// sheet->AddProperty(new wxProperty( +// "Mode", +// tNamedValueListValue(&Mode, gModes), +// "props", +// new tNamedValueListValidator(gModes))); } Modified: trunk/jazz/src/Dialogs.h =================================================================== --- trunk/jazz/src/Dialogs.h 2009-02-17 00:51:53 UTC (rev 708) +++ trunk/jazz/src/Dialogs.h 2009-02-17 01:13:18 UTC (rev 709) @@ -23,6 +23,7 @@ #ifndef JZ_DIALOGS_H #define JZ_DIALOGS_H +#include "CommandUtilities.h" #include "PropertyListDialog.h" class JZPianoWindow; @@ -119,29 +120,13 @@ void OnHelp(); }; -// Velocity -class tVelocityDlg : public tPropertyListDlg -{ - public: - - static int FromValue, ToValue, Mode; - static char *mode_str; - - JZFilter *Filter; - JZSong *Song; - - tVelocityDlg(JZFilter *f); - void AddProperties(); - bool OnClose(); - void OnHelp(); -}; - // Length class tLengthDlg : public tPropertyListDlg { public: - static int FromValue, ToValue, Mode; + static int FromValue, ToValue; + static JEValueAlterationMode Mode; static char *mode_str; JZFilter *Filter; Modified: trunk/jazz/src/EventWindow.cpp =================================================================== --- trunk/jazz/src/EventWindow.cpp 2009-02-17 00:51:53 UTC (rev 708) +++ trunk/jazz/src/EventWindow.cpp 2009-02-17 01:13:18 UTC (rev 709) @@ -25,6 +25,7 @@ #include "Command.h" #include "Dialogs/DeleteDialog.h" #include "Dialogs/ShiftDialog.h" +#include "Dialogs/VelocityDialog.h" #include "Dialogs.h" #include "EventFrame.h" #include "Filter.h" @@ -205,8 +206,16 @@ //----------------------------------------------------------------------------- void JZEventWindow::Velocity() { - tVelocityDlg * dlg = new tVelocityDlg(mpFilter); - dlg->Create(); + int FromValue = 64; + int ToValue = 0; + JEValueAlterationMode Mode = eSetValues; + + JZVelocityDialog VelocityDialog(this, FromValue, ToValue, Mode); + if (VelocityDialog.ShowModal() == wxID_OK) + { + tCmdVelocity VelocityCommand(mpFilter, FromValue, ToValue, Mode); + VelocityCommand.Execute(); + } } //----------------------------------------------------------------------------- Modified: trunk/jazz/src/Makefile.am =================================================================== --- trunk/jazz/src/Makefile.am 2009-02-17 00:51:53 UTC (rev 708) +++ trunk/jazz/src/Makefile.am 2009-02-17 01:13:18 UTC (rev 709) @@ -71,7 +71,6 @@ Random.cpp \ RecordingInfo.cpp \ Rectangle.cpp \ -ResourceDialog.cpp \ Rhythm.cpp \ SampleCommand.cpp \ Sample.cpp \ @@ -152,7 +151,6 @@ Random.cpp \ RecordingInfo.cpp \ Rectangle.cpp \ -ResourceDialog.cpp \ Rhythm.cpp \ SampleCommand.cpp \ Sample.cpp \ @@ -237,7 +235,6 @@ Random.h \ RecordingInfo.h \ Rectangle.h \ -ResourceDialog.h \ Resources.h \ Rhythm.h \ SampleCommand.h \ Modified: trunk/jazz/src/PianoFrame.cpp =================================================================== --- trunk/jazz/src/PianoFrame.cpp 2009-02-17 00:51:53 UTC (rev 708) +++ trunk/jazz/src/PianoFrame.cpp 2009-02-17 01:13:18 UTC (rev 709) @@ -37,7 +37,6 @@ #include "Player.h" #include "GuitarFrame.h" #include "ToolBar.h" -#include "ResourceDialog.h" #include "Help.h" #include "Rectangle.h" Modified: trunk/jazz/src/PianoWindow.cpp =================================================================== --- trunk/jazz/src/PianoWindow.cpp 2009-02-17 00:51:53 UTC (rev 708) +++ trunk/jazz/src/PianoWindow.cpp 2009-02-17 01:13:18 UTC (rev 709) @@ -34,7 +34,6 @@ #include "PianoFrame.h" #include "Player.h" #include "ProjectManager.h" -#include "ResourceDialog.h" #include "Resources.h" #include "SelectControllerDialog.h" #include "Song.h" @@ -3131,6 +3130,7 @@ //----------------------------------------------------------------------------- void JZPianoWindow::ActivateSettingsDialog() { +/* jppResourceDialog Dialog(this, "windowSettings"); Dialog.Attach("use_colours", &mUseColors); @@ -3142,6 +3142,7 @@ SetScrollRanges(); Refresh(); } +*/ } //----------------------------------------------------------------------------- @@ -3150,6 +3151,7 @@ //----------------------------------------------------------------------------- void JZPianoWindow::ActivateMidiDelayDialog() { +/* if (!EventsSelected()) { return; @@ -3173,12 +3175,14 @@ SetScrollRanges(); Refresh(); } +*/ } //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- void JZPianoWindow::ActivateSequenceLengthDialog() { +/* if (!EventsSelected()) { return; @@ -3198,4 +3202,5 @@ SetScrollRanges(); Refresh(); } +*/ } Modified: trunk/jazz/vc8/JazzPlusPlus-VC8.vcproj =================================================================== --- trunk/jazz/vc8/JazzPlusPlus-VC8.vcproj 2009-02-17 00:51:53 UTC (rev 708) +++ trunk/jazz/vc8/JazzPlusPlus-VC8.vcproj 2009-02-17 01:13:18 UTC (rev 709) @@ -638,14 +638,6 @@ > </File> <File - RelativePath="..\src\ResourceDialog.cpp" - > - </File> - <File - RelativePath="..\src\ResourceDialog.h" - > - </File> - <File RelativePath="..\src\Resources.h" > </File> Modified: trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj =================================================================== --- trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj 2009-02-17 00:51:53 UTC (rev 708) +++ trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj 2009-02-17 01:13:18 UTC (rev 709) @@ -637,14 +637,6 @@ > </File> <File - RelativePath="..\src\ResourceDialog.cpp" - > - </File> - <File - RelativePath="..\src\ResourceDialog.h" - > - </File> - <File RelativePath="..\src\Resources.h" > </File> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2009-02-17 00:51:56
|
Revision: 708 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=708&view=rev Author: pstieber Date: 2009-02-17 00:51:53 +0000 (Tue, 17 Feb 2009) Log Message: ----------- Removed the velocity dialog code. This will eventually be handled by the base class code. Currently the piano window scrolling code is incorrect. Modified Paths: -------------- trunk/jazz/src/PianoFrame.cpp trunk/jazz/src/PianoFrame.h trunk/jazz/src/PianoWindow.cpp trunk/jazz/src/PianoWindow.h Modified: trunk/jazz/src/PianoFrame.cpp =================================================================== --- trunk/jazz/src/PianoFrame.cpp 2009-02-17 00:50:11 UTC (rev 707) +++ trunk/jazz/src/PianoFrame.cpp 2009-02-17 00:51:53 UTC (rev 708) @@ -184,7 +184,6 @@ // EVT_MENU(ID_SEARCH_AND_REPLACE, JZPianoFrame::OnSearchReplace) // EVT_MENU(ID_TRANSPOSE, JZPianoFrame::OnTranspose) // EVT_MENU(ID_SET_CHANNEL, JZPianoFrame::OnSetChannel) - EVT_MENU(ID_VELOCITY, JZPianoFrame::OnActivateVelocityDialog) // EVT_MENU(ID_LENGTH, JZPianoFrame::OnLength) EVT_MENU(MEN_MIDIDELAY, JZPianoFrame::OnActivateMidiDelayDialog) EVT_MENU(MEN_SEQLENGTH, JZPianoFrame::OnActivateSequenceLengthDialog) @@ -768,11 +767,6 @@ mpPianoWindow->ActivateSequenceLengthDialog(); } -void JZPianoFrame::OnActivateVelocityDialog(wxCommandEvent& Event) -{ - mpPianoWindow->ActivateVelocityDialog(); -} - void JZPianoFrame::ActClose(wxCommandEvent& Event) { Show(false); Modified: trunk/jazz/src/PianoFrame.h =================================================================== --- trunk/jazz/src/PianoFrame.h 2009-02-17 00:50:11 UTC (rev 707) +++ trunk/jazz/src/PianoFrame.h 2009-02-17 00:51:53 UTC (rev 708) @@ -95,7 +95,6 @@ void OnActivateSettingsDialog(wxCommandEvent& Event); void OnActivateMidiDelayDialog(wxCommandEvent& Event); void OnActivateSequenceLengthDialog(wxCommandEvent& Event); - void OnActivateVelocityDialog(wxCommandEvent& Event); void CtrlChannelAftertouchEdit(wxCommandEvent& Event); void OnCtrlPolyAftertouchEdit(wxCommandEvent& Event); Modified: trunk/jazz/src/PianoWindow.cpp =================================================================== --- trunk/jazz/src/PianoWindow.cpp 2009-02-17 00:50:11 UTC (rev 707) +++ trunk/jazz/src/PianoWindow.cpp 2009-02-17 00:51:53 UTC (rev 708) @@ -3199,39 +3199,3 @@ Refresh(); } } - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -void JZPianoWindow::ActivateVelocityDialog() -{ - int FromValue = 64; - int ToValue = 0; - int modes[] = - { - 8, // set - 12, // add - 16, // subtract - -1, // End of list - }; - - int Mode = modes[0]; - - if (!EventsSelected()) - { - return; - } - - jppResourceDialog dialog(this, "velocity"); - dialog.Attach("start" ,&FromValue); - dialog.Attach("stop", &ToValue); - dialog.Attach("mode", &Mode, modes); - - if (dialog.ShowModal() == wxID_OK) - { - //execute the command - tCmdVelocity cmd(mpFilter, FromValue, ToValue, Mode); - cmd.Execute(); - SetScrollRanges(); - Refresh(); - } -} Modified: trunk/jazz/src/PianoWindow.h =================================================================== --- trunk/jazz/src/PianoWindow.h 2009-02-17 00:50:11 UTC (rev 707) +++ trunk/jazz/src/PianoWindow.h 2009-02-17 00:51:53 UTC (rev 708) @@ -187,8 +187,6 @@ void ActivateSequenceLengthDialog(); - void ActivateVelocityDialog(); - private: JZPianoFrame* mpPianoFrame; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2009-02-17 00:50:16
|
Revision: 707 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=707&view=rev Author: pstieber Date: 2009-02-17 00:50:11 +0000 (Tue, 17 Feb 2009) Log Message: ----------- Added some resource IDs for the new velocity dialog. Modified Paths: -------------- trunk/jazz/src/Resources.h Modified: trunk/jazz/src/Resources.h =================================================================== --- trunk/jazz/src/Resources.h 2009-02-17 00:49:31 UTC (rev 706) +++ trunk/jazz/src/Resources.h 2009-02-17 00:50:11 UTC (rev 707) @@ -90,4 +90,8 @@ #define IDC_KB_OFF_VELOCITY wxID_HIGHEST + 1101 #define IDC_KB_CHANNEL wxID_HIGHEST + 1102 +// JZVelocityDialog resource IDs. +#define IDC_KB_VELOCITY_START wxID_HIGHEST + 1201 +#define IDC_KB_VELOCITY_STOP wxID_HIGHEST + 1202 + #endif // !defined(JZ_RESOURCES_H) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2009-02-17 00:49:35
|
Revision: 706 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=706&view=rev Author: pstieber Date: 2009-02-17 00:49:31 +0000 (Tue, 17 Feb 2009) Log Message: ----------- Added a header that contains an enumeration that is useful for setting the value setting mode. Added Paths: ----------- trunk/jazz/src/CommandUtilities.h Added: trunk/jazz/src/CommandUtilities.h =================================================================== --- trunk/jazz/src/CommandUtilities.h (rev 0) +++ trunk/jazz/src/CommandUtilities.h 2009-02-17 00:49:31 UTC (rev 706) @@ -0,0 +1,34 @@ +//***************************************************************************** +// The JAZZ++ Midi Sequencer +// +// Copyright (C) 2009 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_COMMANDUTILITIES_H +#define JZ_COMMANDUTILITIES_H + +//***************************************************************************** +//***************************************************************************** +enum JEValueAlterationMode +{ + eSetValues, + eAddValues, + eSubtractValues +}; + + +#endif // !defined(JZ_COMMANDUTILITIES_H) Property changes on: trunk/jazz/src/CommandUtilities.h ___________________________________________________________________ Added: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2009-02-16 22:47:30
|
Revision: 705 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=705&view=rev Author: pstieber Date: 2009-02-16 22:47:21 +0000 (Mon, 16 Feb 2009) Log Message: ----------- Removed an unused variable. Modified Paths: -------------- trunk/jazz/src/Dialogs/ShiftDialog.cpp Modified: trunk/jazz/src/Dialogs/ShiftDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/ShiftDialog.cpp 2009-02-16 22:30:19 UTC (rev 704) +++ trunk/jazz/src/Dialogs/ShiftDialog.cpp 2009-02-16 22:47:21 UTC (rev 705) @@ -87,7 +87,6 @@ 0, wxCENTER | wxALL, 5); - wxBoxSizer* pCheckBoxSizer = new wxBoxSizer(wxHORIZONTAL); pTopSizer->Add(mpStepsSlider, 0, wxCENTER | wxALL, 5); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2009-02-16 22:30:24
|
Revision: 704 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=704&view=rev Author: pstieber Date: 2009-02-16 22:30:19 +0000 (Mon, 16 Feb 2009) Log Message: ----------- 1. Implemented a new version of the delete dialog box. 2. Updated several resource IDs. 3. Added wxWidgets event table entries in the event frame base class for several menu entries. 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/Makefile.am trunk/jazz/src/PianoFrame.cpp trunk/jazz/src/Resources.h trunk/jazz/src/TrackFrame.cpp trunk/jazz/vc8/JazzPlusPlus-VC8.vcproj trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj Added Paths: ----------- trunk/jazz/src/Dialogs/DeleteDialog.cpp trunk/jazz/src/Dialogs/DeleteDialog.h Added: trunk/jazz/src/Dialogs/DeleteDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/DeleteDialog.cpp (rev 0) +++ trunk/jazz/src/Dialogs/DeleteDialog.cpp 2009-02-16 22:30:19 UTC (rev 704) @@ -0,0 +1,93 @@ +//***************************************************************************** +// The JAZZ++ Midi Sequencer +// +// Copyright (C) 2009 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 "DeleteDialog.h" + +#include "Globals.h" +#include "Help.h" + +#include <wx/button.h> +#include <wx/checkbox.h> +#include <wx/sizer.h> + +//***************************************************************************** +//***************************************************************************** +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +BEGIN_EVENT_TABLE(JZDeleteDialog, wxDialog) + + EVT_BUTTON(wxID_HELP, JZDeleteDialog::OnHelp) + +END_EVENT_TABLE() + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +JZDeleteDialog::JZDeleteDialog(wxWindow* pParent, bool& LeaveSpace) + : wxDialog(pParent, wxID_ANY, wxString("Delete Events")), + mLeaveSpace(LeaveSpace), + mpLeaveSpaceCheckBox(0) +{ + mpLeaveSpaceCheckBox = new wxCheckBox(this, wxID_ANY, "Leave Space"); + + 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(mpLeaveSpaceCheckBox, 0, wxALIGN_CENTER | 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 JZDeleteDialog::TransferDataToWindow() +{ + mpLeaveSpaceCheckBox->SetValue(mLeaveSpace); + return true; +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +bool JZDeleteDialog::TransferDataFromWindow() +{ + mLeaveSpace = mpLeaveSpaceCheckBox->GetValue(); + return true; +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZDeleteDialog::OnHelp(wxCommandEvent& Event) +{ + gpHelpInstance->ShowTopic("Delete"); +} Property changes on: trunk/jazz/src/Dialogs/DeleteDialog.cpp ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/jazz/src/Dialogs/DeleteDialog.h =================================================================== --- trunk/jazz/src/Dialogs/DeleteDialog.h (rev 0) +++ trunk/jazz/src/Dialogs/DeleteDialog.h 2009-02-16 22:30:19 UTC (rev 704) @@ -0,0 +1,53 @@ +//***************************************************************************** +// The JAZZ++ Midi Sequencer +// +// Copyright (C) 2009 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_DELETEDIALOG_H +#define JZ_DELETEDIALOG_H + +#include <wx/dialog.h> + +class wxCheckBox; + +//***************************************************************************** +//***************************************************************************** +class JZDeleteDialog : public wxDialog +{ + public: + + JZDeleteDialog(wxWindow* pParent, bool& LeaveSpace); + + private: + + virtual bool TransferDataToWindow(); + + virtual bool TransferDataFromWindow(); + + void OnHelp(wxCommandEvent& Event); + + private: + + bool& mLeaveSpace; + + wxCheckBox* mpLeaveSpaceCheckBox; + + DECLARE_EVENT_TABLE(); +}; + +#endif // !defined(JZ_DELETEDIALOG_H) Property changes on: trunk/jazz/src/Dialogs/DeleteDialog.h ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/jazz/src/Dialogs.cpp =================================================================== --- trunk/jazz/src/Dialogs.cpp 2009-02-16 21:39:33 UTC (rev 703) +++ trunk/jazz/src/Dialogs.cpp 2009-02-16 22:30:19 UTC (rev 704) @@ -548,45 +548,6 @@ //***************************************************************************** -// Delete -//***************************************************************************** - -bool tDeleteDlg::LeaveSpace = 1; - -tDeleteDlg::tDeleteDlg(JZEventWindow* w, JZFilter *f) -: tPropertyListDlg("Delete" ) -{ - Filter = f; -} - - -bool tDeleteDlg::OnClose() -{ - tCmdErase cmd(Filter, LeaveSpace); - cmd.Execute(); - - JZProjectManager::Instance()->UpdateAllViews(); - -// tPropertyListDlg::OnClose(); - return false; -} - -void tDeleteDlg::OnHelp() -{ - gpHelpInstance->ShowTopic("Delete"); -} - -void tDeleteDlg::AddProperties() -{ -// Add(wxMakeFormBool("Leave Space", &LeaveSpace)); -// AssociatePanel(panel); - sheet->AddProperty(new wxProperty("Leave Space", wxPropertyValue((bool*)&LeaveSpace), "bool")); -} - -//LAST ADDED EVENT - - -//***************************************************************************** // Snap //***************************************************************************** Modified: trunk/jazz/src/Dialogs.h =================================================================== --- trunk/jazz/src/Dialogs.h 2009-02-16 21:39:33 UTC (rev 703) +++ trunk/jazz/src/Dialogs.h 2009-02-16 22:30:19 UTC (rev 704) @@ -188,20 +188,6 @@ void OnHelp(); }; -class tDeleteDlg : public tPropertyListDlg -{ - JZFilter *Filter; - - public: - static bool LeaveSpace; // 1 - - tDeleteDlg(JZEventWindow* w, JZFilter *f); - void AddProperties(); - bool OnClose(); - void OnHelp(); -}; - - class tSnapDlg : public tPropertyListDlg { public: Modified: trunk/jazz/src/EventFrame.cpp =================================================================== --- trunk/jazz/src/EventFrame.cpp 2009-02-16 21:39:33 UTC (rev 703) +++ trunk/jazz/src/EventFrame.cpp 2009-02-16 22:30:19 UTC (rev 704) @@ -19,6 +19,24 @@ EVT_UPDATE_UI(ID_SHIFT, JZEventFrame::OnUpdateEventsSelected) EVT_MENU(ID_SHIFT, JZEventFrame::OnShift) + EVT_UPDATE_UI(ID_QUANTIZE, JZEventFrame::OnUpdateEventsSelected) + EVT_MENU(ID_QUANTIZE, JZEventFrame::OnQuantize) + + EVT_UPDATE_UI(ID_SET_CHANNEL, JZEventFrame::OnUpdateEventsSelected) + EVT_MENU(ID_SET_CHANNEL, JZEventFrame::OnSetChannel) + + EVT_UPDATE_UI(ID_TRANSPOSE, JZEventFrame::OnUpdateEventsSelected) + EVT_MENU(ID_TRANSPOSE, JZEventFrame::OnTranspose) + + EVT_UPDATE_UI(wxID_DELETE, JZEventFrame::OnUpdateEventsSelected) + EVT_MENU(wxID_DELETE, JZEventFrame::OnDelete) + + EVT_UPDATE_UI(ID_VELOCITY, JZEventFrame::OnUpdateEventsSelected) + EVT_MENU(ID_VELOCITY, JZEventFrame::OnVelocity) + + EVT_UPDATE_UI(ID_LENGTH, JZEventFrame::OnUpdateEventsSelected) + EVT_MENU(ID_VELOCITY, JZEventFrame::OnLength) + END_EVENT_TABLE() //----------------------------------------------------------------------------- @@ -95,7 +113,7 @@ //----------------------------------------------------------------------------- void JZEventFrame::OnShift(wxCommandEvent& Event) { - if (mpEventWindow) + if (mpEventWindow && mpEventWindow->AreEventsSelected()) { mpEventWindow->Shift(16); } @@ -105,7 +123,7 @@ //----------------------------------------------------------------------------- void JZEventFrame::OnQuantize(wxCommandEvent& Event) { - if (mpEventWindow) + if (mpEventWindow && mpEventWindow->AreEventsSelected()) { mpEventWindow->Quantize(); } @@ -115,7 +133,7 @@ //----------------------------------------------------------------------------- void JZEventFrame::OnSetChannel(wxCommandEvent& Event) { - if (!mpEventWindow || !mpEventWindow->AreEventsSelected()) + if (mpEventWindow && mpEventWindow->AreEventsSelected()) { mpEventWindow->SetChannel(); } @@ -125,7 +143,7 @@ //----------------------------------------------------------------------------- void JZEventFrame::OnTranspose(wxCommandEvent& Event) { - if (!mpEventWindow || !mpEventWindow->AreEventsSelected()) + if (mpEventWindow && mpEventWindow->AreEventsSelected()) { mpEventWindow->Transpose(); } @@ -135,7 +153,7 @@ //----------------------------------------------------------------------------- void JZEventFrame::OnDelete(wxCommandEvent& Event) { - if (!mpEventWindow || !mpEventWindow->AreEventsSelected()) + if (mpEventWindow && mpEventWindow->AreEventsSelected()) { mpEventWindow->Delete(); } @@ -145,7 +163,7 @@ //----------------------------------------------------------------------------- void JZEventFrame::OnVelocity(wxCommandEvent& Event) { - if (!mpEventWindow || !mpEventWindow->AreEventsSelected()) + if (mpEventWindow && mpEventWindow->AreEventsSelected()) { mpEventWindow->Velocity(); } @@ -155,7 +173,7 @@ //----------------------------------------------------------------------------- void JZEventFrame::OnLength(wxCommandEvent& Event) { - if (!mpEventWindow || !mpEventWindow->AreEventsSelected()) + if (mpEventWindow && mpEventWindow->AreEventsSelected()) { mpEventWindow->Length(); } @@ -165,7 +183,7 @@ //----------------------------------------------------------------------------- void JZEventFrame::OnConvertToModulation(wxCommandEvent& Event) { - if (!mpEventWindow || !mpEventWindow->AreEventsSelected()) + if (mpEventWindow && mpEventWindow->AreEventsSelected()) { mpEventWindow->ConvertToModulation(); } @@ -175,7 +193,7 @@ //----------------------------------------------------------------------------- void JZEventFrame::OnCleanup(wxCommandEvent& Event) { - if (!mpEventWindow || !mpEventWindow->AreEventsSelected()) + if (mpEventWindow && mpEventWindow->AreEventsSelected()) { mpEventWindow->Cleanup(); } @@ -185,7 +203,7 @@ //----------------------------------------------------------------------------- void JZEventFrame::OnSearchReplace(wxCommandEvent& Event) { - if (!mpEventWindow || !mpEventWindow->AreEventsSelected()) + if (mpEventWindow && mpEventWindow->AreEventsSelected()) { mpEventWindow->SearchReplace(); } Modified: trunk/jazz/src/EventWindow.cpp =================================================================== --- trunk/jazz/src/EventWindow.cpp 2009-02-16 21:39:33 UTC (rev 703) +++ trunk/jazz/src/EventWindow.cpp 2009-02-16 22:30:19 UTC (rev 704) @@ -23,6 +23,7 @@ #include "EventWindow.h" #include "Command.h" +#include "Dialogs/DeleteDialog.h" #include "Dialogs/ShiftDialog.h" #include "Dialogs.h" #include "EventFrame.h" @@ -188,8 +189,16 @@ //----------------------------------------------------------------------------- void JZEventWindow::Delete() { - tDeleteDlg * dlg = new tDeleteDlg(this, mpFilter); - dlg->Create(); + bool LeaveSpace = true; + + JZDeleteDialog DeleteDialog(this, LeaveSpace); + + if (DeleteDialog.ShowModal() == wxID_OK) + { + tCmdErase EraseCommand(mpFilter, LeaveSpace); + EraseCommand.Execute(); + JZProjectManager::Instance()->UpdateAllViews(); + } } //----------------------------------------------------------------------------- Modified: trunk/jazz/src/Makefile.am =================================================================== --- trunk/jazz/src/Makefile.am 2009-02-16 21:39:33 UTC (rev 703) +++ trunk/jazz/src/Makefile.am 2009-02-16 22:30:19 UTC (rev 704) @@ -22,6 +22,7 @@ DeprecatedWx/prop.cpp \ DeprecatedWx/propform.cpp \ DeprecatedWx/proplist.cpp \ +Dialogs/DeleteDialog.cpp \ Dialogs/FilterDialog.cpp \ Dialogs/IntegerEdit.cpp \ Dialogs/KeyOnDialog.cpp \ Modified: trunk/jazz/src/PianoFrame.cpp =================================================================== --- trunk/jazz/src/PianoFrame.cpp 2009-02-16 21:39:33 UTC (rev 703) +++ trunk/jazz/src/PianoFrame.cpp 2009-02-16 22:30:19 UTC (rev 704) @@ -56,11 +56,8 @@ #define MEN_FILTER 6 #define ACT_HELP_MOUSE 9 -#define MEN_SETCHAN 14 -#define MEN_TRANSP 15 #define MEN_LERI 18 #define MEN_UPDN 19 -#define MEN_LENGTH 20 #define MEN_VISIBLE 22 @@ -72,11 +69,9 @@ #define MEN_CTRL_MODUL 28 #define MEN_GUITAR 29 -#define MEN_CLEANUP 31 #define MEN_RESET 36 #define MEN_VIS_ALL_TRK 37 -#define MEN_SEARCHREP 38 #define ACT_CLOSE 41 #define MEN_CTRL_TEMPO 42 @@ -185,12 +180,12 @@ EVT_MENU(MEN_CTRL_CHANNEL_AFTER, JZPianoFrame::CtrlChannelAftertouchEdit) // FIXME PAT - We need to bring these back once Dave has figured out what // he's doing with them in relation to the track window. -// EVT_MENU(MEN_CLEANUP, JZPianoFrame::OnCleanup) -// EVT_MENU(MEN_SEARCHREP, JZPianoFrame::OnSearchReplace) -// EVT_MENU(MEN_TRANSP, JZPianoFrame::OnTranspose) -// EVT_MENU(MEN_SETCHAN, JZPianoFrame::OnSetChannel) +// EVT_MENU(ID_CLEANUP, JZPianoFrame::OnCleanup) +// EVT_MENU(ID_SEARCH_AND_REPLACE, JZPianoFrame::OnSearchReplace) +// EVT_MENU(ID_TRANSPOSE, JZPianoFrame::OnTranspose) +// EVT_MENU(ID_SET_CHANNEL, JZPianoFrame::OnSetChannel) EVT_MENU(ID_VELOCITY, JZPianoFrame::OnActivateVelocityDialog) -// EVT_MENU(MEN_LENGTH, JZPianoFrame::OnLength) +// EVT_MENU(ID_LENGTH, JZPianoFrame::OnLength) EVT_MENU(MEN_MIDIDELAY, JZPianoFrame::OnActivateMidiDelayDialog) EVT_MENU(MEN_SEQLENGTH, JZPianoFrame::OnActivateSequenceLengthDialog) @@ -331,10 +326,10 @@ edit_menu->Append(wxID_CUT, "&Cut"); edit_menu->Append(ID_SHIFT, "&Shift..."); edit_menu->Append(ID_QUANTIZE, "&Quantize..."); - edit_menu->Append(MEN_SETCHAN, "&Set MIDI Channel..."); - edit_menu->Append(MEN_TRANSP, "&Transpose..."); + edit_menu->Append(ID_SET_CHANNEL, "&Set MIDI Channel..."); + edit_menu->Append(ID_TRANSPOSE, "&Transpose..."); edit_menu->Append(ID_VELOCITY, "&Velocity..."); - edit_menu->Append(MEN_LENGTH, "&Length..."); + edit_menu->Append(ID_LENGTH, "&Length..."); edit_menu->Append(MEN_SEQLENGTH, "&Sequence Length..."); edit_menu->Append(MEN_MIDIDELAY, "&Midi Delay..."); @@ -342,8 +337,8 @@ edit_menu->Append(MEN_LERI, "&Left <-> Right"); edit_menu->Append(MEN_UPDN, "&Up <-> Down"); - edit_menu->Append(MEN_CLEANUP, "&Cleanup..."); - edit_menu->Append(MEN_SEARCHREP, "&Search Replace..."); + edit_menu->Append(ID_CLEANUP, "&Cleanup..."); + edit_menu->Append(ID_SEARCH_AND_REPLACE, "&Search Replace..."); wxMenu *setting_menu = new wxMenu("", wxMENU_TEAROFF); setting_menu->Append(MEN_FILTER, "&Filter..."); Modified: trunk/jazz/src/Resources.h =================================================================== --- trunk/jazz/src/Resources.h 2009-02-16 21:39:33 UTC (rev 703) +++ trunk/jazz/src/Resources.h 2009-02-16 22:30:19 UTC (rev 704) @@ -46,21 +46,25 @@ #define ID_TRIM wxID_HIGHEST + 30 #define ID_QUANTIZE wxID_HIGHEST + 31 -#define ID_SHIFT wxID_HIGHEST + 32 -#define ID_SHIFT_LEFT wxID_HIGHEST + 33 -#define ID_SHIFT_RIGHT wxID_HIGHEST + 34 -#define ID_SNAP wxID_HIGHEST + 35 -#define ID_SNAP_8 wxID_HIGHEST + 36 -#define ID_SNAP_8D wxID_HIGHEST + 37 -#define ID_SNAP_16 wxID_HIGHEST + 38 -#define ID_SNAP_16D wxID_HIGHEST + 39 -#define ID_MIXER wxID_HIGHEST + 40 -#define ID_PIANOWIN wxID_HIGHEST + 41 -#define ID_METRONOME_TOGGLE wxID_HIGHEST + 42 -#define ID_VELOCITY wxID_HIGHEST + 43 +#define ID_SET_CHANNEL wxID_HIGHEST + 32 +#define ID_SHIFT wxID_HIGHEST + 33 +#define ID_SHIFT_LEFT wxID_HIGHEST + 34 +#define ID_SHIFT_RIGHT wxID_HIGHEST + 35 +#define ID_SNAP wxID_HIGHEST + 36 +#define ID_SNAP_8 wxID_HIGHEST + 37 +#define ID_SNAP_8D wxID_HIGHEST + 38 +#define ID_SNAP_16 wxID_HIGHEST + 39 +#define ID_SNAP_16D wxID_HIGHEST + 40 +#define ID_MIXER wxID_HIGHEST + 41 +#define ID_PIANOWIN wxID_HIGHEST + 42 +#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_METER_CHANGE wxID_HIGHEST + 45 - #define ID_PLAY wxID_HIGHEST + 50 #define ID_PLAY_LOOP wxID_HIGHEST + 51 #define ID_RECORD wxID_HIGHEST + 52 Modified: trunk/jazz/src/TrackFrame.cpp =================================================================== --- trunk/jazz/src/TrackFrame.cpp 2009-02-16 21:39:33 UTC (rev 703) +++ trunk/jazz/src/TrackFrame.cpp 2009-02-16 22:30:19 UTC (rev 704) @@ -238,14 +238,14 @@ mpEditMenu->AppendSeparator(); -// mpEditMenu->Append(ID_QUANTIZE, "&Quantize..."); -// mpEditMenu->Append(MEN_SETCHAN, "&Set MIDI Channel..."); -// mpEditMenu->Append(MEN_TRANSP, "&Transpose..."); -// mpEditMenu->Append(ID_VELOCITY, "&Velocity..."); -// mpEditMenu->Append(MEN_LENGTH, "&Length..."); + mpEditMenu->Append(ID_QUANTIZE, "&Quantize..."); + mpEditMenu->Append(ID_SET_CHANNEL, "&Set MIDI Channel..."); + mpEditMenu->Append(ID_TRANSPOSE, "&Transpose..."); + mpEditMenu->Append(ID_VELOCITY, "&Velocity..."); + mpEditMenu->Append(ID_LENGTH, "&Length..."); mpEditMenu->Append(ID_SHIFT, "Shi&ft..."); -// mpEditMenu->Append(MEN_CLEANUP, "C&leanup..."); -// mpEditMenu->Append(MEN_SEARCHREP, "Search Re&place..."); + mpEditMenu->Append(ID_CLEANUP, "C&leanup..."); + mpEditMenu->Append(ID_SEARCH_AND_REPLACE, "Search Re&place..."); mpEditMenu->AppendSeparator(); Modified: trunk/jazz/vc8/JazzPlusPlus-VC8.vcproj =================================================================== --- trunk/jazz/vc8/JazzPlusPlus-VC8.vcproj 2009-02-16 21:39:33 UTC (rev 703) +++ trunk/jazz/vc8/JazzPlusPlus-VC8.vcproj 2009-02-16 22:30:19 UTC (rev 704) @@ -835,6 +835,14 @@ Name="Dialog Source Files" > <File + RelativePath="..\src\Dialogs\DeleteDialog.cpp" + > + </File> + <File + RelativePath="..\src\Dialogs\DeleteDialog.h" + > + </File> + <File RelativePath="..\src\Dialogs\FilterDialog.cpp" > </File> Modified: trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj =================================================================== --- trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj 2009-02-16 21:39:33 UTC (rev 703) +++ trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj 2009-02-16 22:30:19 UTC (rev 704) @@ -853,6 +853,14 @@ Name="Dialog Source Files" > <File + RelativePath="..\src\Dialogs\DeleteDialog.cpp" + > + </File> + <File + RelativePath="..\src\Dialogs\DeleteDialog.h" + > + </File> + <File RelativePath="..\src\Dialogs\FilterDialog.cpp" > </File> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2009-02-16 22:22:25
|
Revision: 702 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=702&view=rev Author: pstieber Date: 2009-02-16 21:36:54 +0000 (Mon, 16 Feb 2009) Log Message: ----------- 1. Moved dialog creation for from the event frame to the event window. This allowed the removal of the filter from the frame class. 2. Removed the mixer dialog and character handling code from the event frame class. 3. Changed the passed parent window from an event frame to an event window in several dialog box classes. Modified Paths: -------------- trunk/jazz/src/Dialogs.cpp trunk/jazz/src/Dialogs.h trunk/jazz/src/EventFrame.cpp trunk/jazz/src/EventFrame.h trunk/jazz/src/EventWindow.cpp trunk/jazz/src/EventWindow.h Modified: trunk/jazz/src/Dialogs.cpp =================================================================== --- trunk/jazz/src/Dialogs.cpp 2009-02-16 21:03:09 UTC (rev 701) +++ trunk/jazz/src/Dialogs.cpp 2009-02-16 21:36:54 UTC (rev 702) @@ -111,7 +111,7 @@ -tCleanupDlg::tCleanupDlg(JZEventFrame *w, JZFilter *f) +tCleanupDlg::tCleanupDlg(JZEventWindow* w, JZFilter *f) : tPropertyListDlg( "Clean up events" ) { Filter = f; @@ -191,7 +191,7 @@ int tSearchReplaceDlg::frCtrl = 1; int tSearchReplaceDlg::toCtrl = 1; -tSearchReplaceDlg::tSearchReplaceDlg(JZEventFrame *w, JZFilter *f) +tSearchReplaceDlg::tSearchReplaceDlg(JZEventWindow* w, JZFilter *f) : tPropertyListDlg("Search and replace controller types" ) { Filter = f; @@ -239,7 +239,7 @@ int tTransposeDlg::Scale = gScaleChromatic; bool tTransposeDlg::FitIntoScale = 0; -tTransposeDlg::tTransposeDlg(JZEventFrame *w, JZFilter *f) +tTransposeDlg::tTransposeDlg(JZEventWindow* w, JZFilter *f) : tPropertyListDlg("Transpose") { Filter = f; @@ -390,7 +390,7 @@ int tLengthDlg::Mode; -tLengthDlg::tLengthDlg(JZEventFrame *w, JZFilter *f) +tLengthDlg::tLengthDlg(JZEventWindow* w, JZFilter *f) : tPropertyListDlg("Length") { Filter = f; @@ -553,7 +553,7 @@ bool tDeleteDlg::LeaveSpace = 1; -tDeleteDlg::tDeleteDlg(JZEventFrame *w, JZFilter *f) +tDeleteDlg::tDeleteDlg(JZEventWindow* w, JZFilter *f) : tPropertyListDlg("Delete" ) { Filter = f; Modified: trunk/jazz/src/Dialogs.h =================================================================== --- trunk/jazz/src/Dialogs.h 2009-02-16 21:03:09 UTC (rev 701) +++ trunk/jazz/src/Dialogs.h 2009-02-16 21:36:54 UTC (rev 702) @@ -59,7 +59,7 @@ JZFilter *Filter; JZSong *Song; - tCleanupDlg(JZEventFrame *w, JZFilter *f); + tCleanupDlg(JZEventWindow* w, JZFilter *f); void AddProperties(); //tNamedChoice Steps; bool OnClose(); @@ -78,7 +78,7 @@ JZFilter *Filter; JZSong *Song; - tSearchReplaceDlg(JZEventFrame *w, JZFilter *f); + tSearchReplaceDlg(JZEventWindow* w, JZFilter *f); void AddProperties(); bool OnClose(); void OnHelp(); @@ -97,7 +97,7 @@ JZSong *Song; //tNamedChoice ScaleDlg; - tTransposeDlg(JZEventFrame *w, JZFilter *f); + tTransposeDlg(JZEventWindow* w, JZFilter *f); void AddProperties(); bool OnClose(); void OnHelp(); @@ -147,7 +147,7 @@ JZFilter *Filter; JZSong *Song; - tLengthDlg(JZEventFrame *win, JZFilter *f); + tLengthDlg(JZEventWindow* win, JZFilter *f); void AddProperties(); bool OnClose(); void OnHelp(); @@ -195,7 +195,7 @@ public: static bool LeaveSpace; // 1 - tDeleteDlg(JZEventFrame *w, JZFilter *f); + tDeleteDlg(JZEventWindow* w, JZFilter *f); void AddProperties(); bool OnClose(); void OnHelp(); Modified: trunk/jazz/src/EventFrame.cpp =================================================================== --- trunk/jazz/src/EventFrame.cpp 2009-02-16 21:03:09 UTC (rev 701) +++ trunk/jazz/src/EventFrame.cpp 2009-02-16 21:36:54 UTC (rev 702) @@ -1,15 +1,9 @@ #include "EventFrame.h" -#include "Command.h" -#include "Dialogs.h" #include "EventWindow.h" -#include "Filter.h" #include "Resources.h" #include "ToolBar.h" -#include <wx/dc.h> -#include <wx/msgdlg.h> - #include <iostream> using namespace std; @@ -37,26 +31,16 @@ const wxSize& Size, long WindowStyle) : wxFrame(pParent, wxID_ANY, Title, Position, Size, WindowStyle), - mpFilter(0), - MixerForm(0), mpToolBar(0), mpEventWindow(0) { - mpFilter = new JZFilter(pSong); } //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- JZEventFrame::~JZEventFrame() { - delete mpFilter; - delete mpToolBar; - - if (MixerForm) - { - delete MixerForm; - } } //----------------------------------------------------------------------------- @@ -70,13 +54,6 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -bool JZEventFrame::OnKeyEvent(wxKeyEvent& KeyEvent) -{ - return false; -} - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- bool JZEventFrame::OnClose() { return false; @@ -102,13 +79,6 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -bool JZEventFrame::OnCharHook(wxKeyEvent& KeyEvent) -{ - return OnKeyEvent(KeyEvent); -} - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- void JZEventFrame::OnUpdateEventsSelected(wxUpdateUIEvent& Event) { if (mpEventWindow) @@ -147,11 +117,8 @@ { if (!mpEventWindow || !mpEventWindow->AreEventsSelected()) { - return; + mpEventWindow->SetChannel(); } - - tSetChannelDlg * dlg = new tSetChannelDlg(mpFilter); - dlg->Create(); } //----------------------------------------------------------------------------- @@ -160,11 +127,8 @@ { if (!mpEventWindow || !mpEventWindow->AreEventsSelected()) { - return; + mpEventWindow->Transpose(); } - - tTransposeDlg * dlg = new tTransposeDlg(this, mpFilter); - dlg->Create(); } //----------------------------------------------------------------------------- @@ -173,11 +137,8 @@ { if (!mpEventWindow || !mpEventWindow->AreEventsSelected()) { - return; + mpEventWindow->Delete(); } - - tDeleteDlg * dlg = new tDeleteDlg(this, mpFilter); - dlg->Create(); } //----------------------------------------------------------------------------- @@ -186,11 +147,8 @@ { if (!mpEventWindow || !mpEventWindow->AreEventsSelected()) { - return; + mpEventWindow->Velocity(); } - - tVelocityDlg * dlg = new tVelocityDlg(mpFilter); - dlg->Create(); } //----------------------------------------------------------------------------- @@ -199,11 +157,8 @@ { if (!mpEventWindow || !mpEventWindow->AreEventsSelected()) { - return; + mpEventWindow->Length(); } - - tLengthDlg * dlg = new tLengthDlg(this, mpFilter); - dlg->Create(); } //----------------------------------------------------------------------------- @@ -212,12 +167,8 @@ { if (!mpEventWindow || !mpEventWindow->AreEventsSelected()) { - return; + mpEventWindow->ConvertToModulation(); } - - tCmdConvertToModulation cmd(mpFilter); - cmd.Execute(); - Redraw(); } //----------------------------------------------------------------------------- @@ -226,11 +177,8 @@ { if (!mpEventWindow || !mpEventWindow->AreEventsSelected()) { - return; + mpEventWindow->Cleanup(); } - - tCleanupDlg * dlg = new tCleanupDlg(this, mpFilter); - dlg->Create(); } //----------------------------------------------------------------------------- @@ -239,11 +187,8 @@ { if (!mpEventWindow || !mpEventWindow->AreEventsSelected()) { - return; + mpEventWindow->SearchReplace(); } - - tSearchReplaceDlg * dlg = new tSearchReplaceDlg(this, mpFilter); - dlg->Create(); } //----------------------------------------------------------------------------- Modified: trunk/jazz/src/EventFrame.h =================================================================== --- trunk/jazz/src/EventFrame.h 2009-02-16 21:03:09 UTC (rev 701) +++ trunk/jazz/src/EventFrame.h 2009-02-16 21:36:54 UTC (rev 702) @@ -26,7 +26,6 @@ #include <wx/frame.h> class JZEventWindow; -class JZFilter; class JZSong; class JZToolBar; class wxDialog; @@ -56,23 +55,13 @@ virtual void SetEventWindow(JZEventWindow* pEventWindow); - // Events - virtual bool OnKeyEvent(wxKeyEvent& Event); // true = processed by eventwin virtual bool OnClose(); // Redraw - nach Aenderungen von Parametern, kein GUI-Event virtual void Redraw(); - - JZFilter* mpFilter; - - // Mixer-Dialog - wxDialog* MixerForm; - private: - bool OnCharHook(wxKeyEvent& Event); - void OnUpdateEventsSelected(wxUpdateUIEvent& Event); void OnShift(wxCommandEvent& Event); Modified: trunk/jazz/src/EventWindow.cpp =================================================================== --- trunk/jazz/src/EventWindow.cpp 2009-02-16 21:03:09 UTC (rev 701) +++ trunk/jazz/src/EventWindow.cpp 2009-02-16 21:36:54 UTC (rev 702) @@ -170,6 +170,71 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- +void JZEventWindow::SetChannel() +{ + tSetChannelDlg * dlg = new tSetChannelDlg(mpFilter); + dlg->Create(); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZEventWindow::Transpose() +{ + tTransposeDlg * dlg = new tTransposeDlg(this, mpFilter); + dlg->Create(); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZEventWindow::Delete() +{ + tDeleteDlg * dlg = new tDeleteDlg(this, mpFilter); + dlg->Create(); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZEventWindow::Velocity() +{ + tVelocityDlg * dlg = new tVelocityDlg(mpFilter); + dlg->Create(); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZEventWindow::Length() +{ + tLengthDlg * dlg = new tLengthDlg(this, mpFilter); + dlg->Create(); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZEventWindow::ConvertToModulation() +{ + tCmdConvertToModulation cmd(mpFilter); + cmd.Execute(); + Refresh(); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZEventWindow::Cleanup() +{ + tCleanupDlg * dlg = new tCleanupDlg(this, mpFilter); + dlg->Create(); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZEventWindow::SearchReplace() +{ + tSearchReplaceDlg * dlg = new tSearchReplaceDlg(this, mpFilter); + dlg->Create(); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void JZEventWindow::EditMeter() { if (!IsEditingMeter()) Modified: trunk/jazz/src/EventWindow.h =================================================================== --- trunk/jazz/src/EventWindow.h 2009-02-16 21:03:09 UTC (rev 701) +++ trunk/jazz/src/EventWindow.h 2009-02-16 21:36:54 UTC (rev 702) @@ -59,6 +59,22 @@ void Quantize(); + void SetChannel(); + + void Transpose(); + + void Delete(); + + void Velocity(); + + void Length(); + + void ConvertToModulation(); + + void Cleanup(); + + void SearchReplace(); + void EditMeter(); bool IsEditingMeter() const; void FinishMeterEdit(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2009-02-16 22:22:15
|
Revision: 703 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=703&view=rev Author: pstieber Date: 2009-02-16 21:39:33 +0000 (Mon, 16 Feb 2009) Log Message: ----------- Removed old "should we create a snap selection object?" comments. Modified Paths: -------------- trunk/jazz/src/EventWindow.cpp trunk/jazz/src/PianoWindow.cpp Modified: trunk/jazz/src/EventWindow.cpp =================================================================== --- trunk/jazz/src/EventWindow.cpp 2009-02-16 21:36:54 UTC (rev 702) +++ trunk/jazz/src/EventWindow.cpp 2009-02-16 21:39:33 UTC (rev 703) @@ -487,8 +487,6 @@ { if (!mpMouseAction) { - // create mpSnapSel? - int x, y; MouseEvent.GetPosition(&x, &y); if ( Modified: trunk/jazz/src/PianoWindow.cpp =================================================================== --- trunk/jazz/src/PianoWindow.cpp 2009-02-16 21:36:54 UTC (rev 702) +++ trunk/jazz/src/PianoWindow.cpp 2009-02-16 21:39:33 UTC (rev 703) @@ -2011,8 +2011,6 @@ { if (!mpMouseAction) { - // create mpSnapSel? - int x, y; MouseEvent.GetPosition(&x, &y); if ( This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2009-02-16 21:03:14
|
Revision: 701 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=701&view=rev Author: pstieber Date: 2009-02-16 21:03:09 +0000 (Mon, 16 Feb 2009) Log Message: ----------- Removed unused data from the event frame base class. Modified Paths: -------------- trunk/jazz/src/EventFrame.cpp trunk/jazz/src/EventFrame.h Modified: trunk/jazz/src/EventFrame.cpp =================================================================== --- trunk/jazz/src/EventFrame.cpp 2009-02-16 20:49:52 UTC (rev 700) +++ trunk/jazz/src/EventFrame.cpp 2009-02-16 21:03:09 UTC (rev 701) @@ -4,7 +4,6 @@ #include "Dialogs.h" #include "EventWindow.h" #include "Filter.h" -#include "MouseAction.h" #include "Resources.h" #include "ToolBar.h" @@ -38,28 +37,18 @@ const wxSize& Size, long WindowStyle) : wxFrame(pParent, wxID_ANY, Title, Position, Size, WindowStyle), - Song(pSong), mpFilter(0), - mTopInfoHeight(40), - mEventsX(), - mEventsY(mTopInfoHeight), - mEventsWidth(0), - mEventsHeight(0), - SnapSel(0), - MouseAction(0), MixerForm(0), mpToolBar(0), mpEventWindow(0) { - mpFilter = new JZFilter(Song); + mpFilter = new JZFilter(pSong); } //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- JZEventFrame::~JZEventFrame() { - delete SnapSel; - delete mpFilter; delete mpToolBar; @@ -81,76 +70,6 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -//void JZEventFrame::SnapSelStart(wxMouseEvent& MouseEvent) -//{ -//} - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -//void JZEventFrame::SnapSelStop(wxMouseEvent& MouseEvent) -//{ -//} - -//----------------------------------------------------------------------------- -// seems to handle the "selection" rectangle. normally called from the base -// class onmouseevent handler -//----------------------------------------------------------------------------- -/* -int JZEventFrame::OnMouseEvent(wxMouseEvent& MouseEvent) -{ -// cout << "JZEventFrame::OnMouseEvent" << endl; - if (!MouseAction) - { - // create SnapSel? - int x; - int y; - MouseEvent.GetPosition(&x, &y); - if ( - mEventsX < x && - x < mEventsX + mEventsWidth && - mEventsY < y && - y < mEventsY + mEventsHeight) - { - if (MouseEvent.LeftDown()) - { - { - SnapSelStart(MouseEvent); - - if (SnapSel->IsSelected()) - { - Refresh(); //redraw the whole window instead(inefficient, we should rather invalidate a rect) - } - SnapSel->ProcessMouseEvent(MouseEvent); - MouseAction = SnapSel; - } - } - } - } - else - { - // MouseAction active - - if (MouseAction->ProcessMouseEvent(MouseEvent)) - { - // MouseAction finished - - if (MouseAction == SnapSel) - { - SnapSelStop(MouseEvent); - Redraw(); //ineficcient, invalidate rect first instead - MouseAction = 0; - return 1; - } - - MouseAction = 0; - } - } - return 0; -} -*/ - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- bool JZEventFrame::OnKeyEvent(wxKeyEvent& KeyEvent) { return false; Modified: trunk/jazz/src/EventFrame.h =================================================================== --- trunk/jazz/src/EventFrame.h 2009-02-16 20:49:52 UTC (rev 700) +++ trunk/jazz/src/EventFrame.h 2009-02-16 21:03:09 UTC (rev 701) @@ -27,10 +27,8 @@ class JZEventWindow; class JZFilter; -class JZSnapSelection; class JZSong; class JZToolBar; -class tMouseAction; class wxDialog; //***************************************************************************** @@ -40,7 +38,6 @@ // class. // Functionality: // - Settings dialog -// - Selection via Snapsel //***************************************************************************** class JZEventFrame : public wxFrame { @@ -59,11 +56,7 @@ virtual void SetEventWindow(JZEventWindow* pEventWindow); -// virtual void SnapSelStart(wxMouseEvent &e); -// virtual void SnapSelStop(wxMouseEvent &e); - // Events -// virtual int OnMouseEvent(wxMouseEvent& Event); virtual bool OnKeyEvent(wxKeyEvent& Event); // true = processed by eventwin virtual bool OnClose(); @@ -71,20 +64,8 @@ virtual void Redraw(); - - - JZSong* Song; - JZFilter* mpFilter; - int mTopInfoHeight; - - int mEventsX, mEventsY, mEventsWidth, mEventsHeight; - - // Mouse handling - JZSnapSelection* SnapSel; - tMouseAction* MouseAction; - // Mixer-Dialog wxDialog* MixerForm; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2009-02-16 20:49:59
|
Revision: 700 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=700&view=rev Author: pstieber Date: 2009-02-16 20:49:52 +0000 (Mon, 16 Feb 2009) Log Message: ----------- 1. Removed the long specifier from an int constant. 2. reduced the scope of a loop variable and used pre-increment. 3. Renamed some local variables for clarity. Modified Paths: -------------- trunk/jazz/src/PianoWindow.cpp Modified: trunk/jazz/src/PianoWindow.cpp =================================================================== --- trunk/jazz/src/PianoWindow.cpp 2009-02-16 19:59:58 UTC (rev 699) +++ trunk/jazz/src/PianoWindow.cpp 2009-02-16 20:49:52 UTC (rev 700) @@ -1117,14 +1117,14 @@ if (mTrackIndex > 0) { --mTrackIndex; - NewPosition(mTrackIndex, -1L); + NewPosition(mTrackIndex, -1); } return true; case WXK_DOWN: if (mTrackIndex < mpSong->GetTrackCount() - 1) { ++mTrackIndex; - NewPosition(mTrackIndex, -1L); + NewPosition(mTrackIndex, -1); } return true; } @@ -2148,14 +2148,14 @@ int Clock = x2Clock(x); int Pitch = y2Pitch(y); - JZEvent *m = FindEvent(mpTrack, Clock, Pitch); + JZEvent* pEvent = FindEvent(mpTrack, Clock, Pitch); tKeyOn* pKeyOn = 0; - tPlayTrack *p = 0; - if (m) + tPlayTrack* pPlayTrack = 0; + if (pEvent) { // both these events are drag length - pKeyOn = m->IsKeyOn(); - p = m->IsPlayTrack(); + pKeyOn = pEvent->IsKeyOn(); + pPlayTrack = pEvent->IsPlayTrack(); } switch (action) { @@ -2177,20 +2177,19 @@ } else { - if(p) + if (pPlayTrack) { - mpMouseAction = new tPlayTrackLengthDragger(p, this); + mpMouseAction = new tPlayTrackLengthDragger(pPlayTrack, this); } else if (mVisibleAllTracks) { // event not found, maybe change to another Track - int i; - for (i = 0; i < mpSong->GetTrackCount(); i++) + for (int i = 0; i < mpSong->GetTrackCount(); ++i) { JZTrack* pTrack = mpSong->GetTrack(i); if (IsVisible(pTrack) && FindEvent(pTrack, Clock, Pitch)) { - NewPosition(i, -1L); + NewPosition(i, -1); break; } } @@ -2200,7 +2199,7 @@ case MA_DIALOG: - EventDialog(m, this, mpTrack, Clock, mpTrack->Channel - 1, Pitch); + EventDialog(pEvent, this, mpTrack, Clock, mpTrack->Channel - 1, Pitch); break; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2009-02-16 20:00:10
|
Revision: 699 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=699&view=rev Author: pstieber Date: 2009-02-16 19:59:58 +0000 (Mon, 16 Feb 2009) Log Message: ----------- 1. Fixed piano key mouse handling. The main problem was an improperly named virtual function in tMousePlay. I changed the the virtual function name to ProcessMouseEvent, and changed wxMouseEvent object instance names to MouseEvent. 2. Changed tMousePlay -> JZMousePlay and changed the way the class destroys itself. This is causing a leak, but it is better than the crash that was caused by clicking the mouse below the bass piano keys. 3. Moved the mpMouseAction data member from the piano window to the event window base class. Gave the event window base class a mouse handler. I'm still not confident about this design. 4. Created a virtual SnalSelStart in the event window. Modified Paths: -------------- trunk/jazz/src/EventFrame.cpp trunk/jazz/src/EventFrame.h trunk/jazz/src/EventWindow.cpp trunk/jazz/src/EventWindow.h trunk/jazz/src/GuitarWindow.cpp trunk/jazz/src/GuitarWindow.h trunk/jazz/src/Harmony.cpp trunk/jazz/src/Knob.cpp trunk/jazz/src/Knob.h trunk/jazz/src/MouseAction.cpp trunk/jazz/src/MouseAction.h trunk/jazz/src/PianoFrame.h trunk/jazz/src/PianoWindow.cpp trunk/jazz/src/PianoWindow.h trunk/jazz/src/Random.cpp trunk/jazz/src/Random.h trunk/jazz/src/SampleWindow.cpp trunk/jazz/src/TrackFrame.cpp trunk/jazz/src/TrackFrame.h trunk/jazz/src/TrackWindow.cpp trunk/jazz/src/TrackWindow.h Modified: trunk/jazz/src/EventFrame.cpp =================================================================== --- trunk/jazz/src/EventFrame.cpp 2009-02-16 05:03:58 UTC (rev 698) +++ trunk/jazz/src/EventFrame.cpp 2009-02-16 19:59:58 UTC (rev 699) @@ -81,20 +81,21 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZEventFrame::SnapSelStart(wxMouseEvent& MouseEvent) -{ -} +//void JZEventFrame::SnapSelStart(wxMouseEvent& MouseEvent) +//{ +//} //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZEventFrame::SnapSelStop(wxMouseEvent& MouseEvent) -{ -} +//void JZEventFrame::SnapSelStop(wxMouseEvent& MouseEvent) +//{ +//} //----------------------------------------------------------------------------- // seems to handle the "selection" rectangle. normally called from the base // class onmouseevent handler //----------------------------------------------------------------------------- +/* int JZEventFrame::OnMouseEvent(wxMouseEvent& MouseEvent) { // cout << "JZEventFrame::OnMouseEvent" << endl; @@ -119,7 +120,7 @@ { Refresh(); //redraw the whole window instead(inefficient, we should rather invalidate a rect) } - SnapSel->Event(MouseEvent); + SnapSel->ProcessMouseEvent(MouseEvent); MouseAction = SnapSel; } } @@ -129,7 +130,7 @@ { // MouseAction active - if (MouseAction->Event(MouseEvent)) + if (MouseAction->ProcessMouseEvent(MouseEvent)) { // MouseAction finished @@ -146,6 +147,7 @@ } return 0; } +*/ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- Modified: trunk/jazz/src/EventFrame.h =================================================================== --- trunk/jazz/src/EventFrame.h 2009-02-16 05:03:58 UTC (rev 698) +++ trunk/jazz/src/EventFrame.h 2009-02-16 19:59:58 UTC (rev 699) @@ -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-2009 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 @@ -59,11 +59,11 @@ virtual void SetEventWindow(JZEventWindow* pEventWindow); - virtual void SnapSelStart(wxMouseEvent &e); - virtual void SnapSelStop(wxMouseEvent &e); +// virtual void SnapSelStart(wxMouseEvent &e); +// virtual void SnapSelStop(wxMouseEvent &e); // Events - virtual int OnMouseEvent(wxMouseEvent& Event); +// virtual int OnMouseEvent(wxMouseEvent& Event); virtual bool OnKeyEvent(wxKeyEvent& Event); // true = processed by eventwin virtual bool OnClose(); Modified: trunk/jazz/src/EventWindow.cpp =================================================================== --- trunk/jazz/src/EventWindow.cpp 2009-02-16 05:03:58 UTC (rev 698) +++ trunk/jazz/src/EventWindow.cpp 2009-02-16 19:59:58 UTC (rev 699) @@ -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-2009 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 @@ -44,8 +44,9 @@ //***************************************************************************** //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -//BEGIN_EVENT_TABLE(JZEventWindow, wxScrolledWindow) -//END_EVENT_TABLE() +BEGIN_EVENT_TABLE(JZEventWindow, wxWindow) + EVT_MOUSE_EVENTS(JZEventWindow::OnMouseEvent) +END_EVENT_TABLE() //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- @@ -62,6 +63,7 @@ wxHSCROLL | wxVSCROLL | wxNO_FULL_REPAINT_ON_RESIZE), mpSnapSel(0), mpFilter(0), + mpMouseAction(0), mpSong(pSong), mpGreyColor(0), mpGreyBrush(0), @@ -401,13 +403,72 @@ } //----------------------------------------------------------------------------- -// This mouse handler delegates to the subclased event window. //----------------------------------------------------------------------------- -//void JZEventWindow::OnMouseEvent(wxMouseEvent& MouseEvent) -//{ -// EventWin->OnMouseEvent(MouseEvent); -//} +void JZEventWindow::SnapSelStart(wxMouseEvent& MouseEvent) +{ +} +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZEventWindow::SnapSelStop(wxMouseEvent& MouseEvent) +{ +} + +//----------------------------------------------------------------------------- +// Descriptions: +// This mouse handler delegates to the subclassed event window. +//----------------------------------------------------------------------------- +void JZEventWindow::OnMouseEvent(wxMouseEvent& MouseEvent) +{ + if (!mpMouseAction) + { + // create mpSnapSel? + + int x, y; + MouseEvent.GetPosition(&x, &y); + if ( + mEventsX < x && x < mEventsX + mEventsWidth && + mEventsY < y && y < mEventsY + mEventsHeight) + { + if (MouseEvent.LeftDown()) + { + { + SnapSelStart(MouseEvent); + +// if (mpSnapSel->IsSelected()) +// { + // Redraw the whole window instead (inefficient, we should rather + // invalidate a rect). + Refresh(); +// } + mpSnapSel->ProcessMouseEvent(MouseEvent); + mpMouseAction = mpSnapSel; + } + } + } + } + else + { + // mpMouseAction active + + if (mpMouseAction->ProcessMouseEvent(MouseEvent)) + { + // mpMouseAction finished + + if (mpMouseAction == mpSnapSel) + { + SnapSelStop(MouseEvent); + + // inefficient, invalidate rect first instead. + Refresh(); + } + + mpMouseAction = 0; + } + } +} + + // JAVE the OnChar method seems to be gone in wxwin232, but its documented, so // I don't know what happened. The OnCharHook should do the same thing // basically. It was there from the start. OnChar seemd redundant. Modified: trunk/jazz/src/EventWindow.h =================================================================== --- trunk/jazz/src/EventWindow.h 2009-02-16 05:03:58 UTC (rev 698) +++ trunk/jazz/src/EventWindow.h 2009-02-16 19:59:58 UTC (rev 699) @@ -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-2009 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 @@ -26,6 +26,7 @@ #include <wx/window.h> class JZFilter; +class tMouseAction; class JZSnapSelection; class JZSong; class wxDialog; @@ -83,10 +84,12 @@ protected: - virtual void SnapSelStop(wxMouseEvent& Event) - { - } + int SnapClock(int Clock, bool Up); + virtual void SnapSelStart(wxMouseEvent& MouseEvent); + + virtual void SnapSelStop(wxMouseEvent& MouseEvent); + void DrawVerticalLine(wxDC& Dc, int XPosition) const; void DrawHorizontalLine(wxDC& Dc, int YPosition) const; @@ -99,12 +102,16 @@ int y2yLine(int y, int Up = 0); + void OnMouseEvent(wxMouseEvent& MouseEvent); + public: JZSnapSelection* mpSnapSel; JZFilter* mpFilter; + tMouseAction* mpMouseAction; + protected: JZSong* mpSong; @@ -128,7 +135,7 @@ // Settings-Dialog wxDialog* mpSettingsDialog; -// DECLARE_EVENT_TABLE() + DECLARE_EVENT_TABLE() }; //***************************************************************************** Modified: trunk/jazz/src/GuitarWindow.cpp =================================================================== --- trunk/jazz/src/GuitarWindow.cpp 2009-02-16 05:03:58 UTC (rev 698) +++ trunk/jazz/src/GuitarWindow.cpp 2009-02-16 19:59:58 UTC (rev 699) @@ -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-2009 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 @@ -341,12 +341,12 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZGuitarWindow::OnMouseMove(wxMouseEvent& Event) +void JZGuitarWindow::OnMouseMove(wxMouseEvent& MouseEvent) { wxClientDC Dc(this); PrepareDC(Dc); - wxPoint Position = Event.GetPosition(); + wxPoint Position = MouseEvent.GetPosition(); int x = Dc.DeviceToLogicalX(Position.x); int y = Dc.DeviceToLogicalY(Position.y); Modified: trunk/jazz/src/GuitarWindow.h =================================================================== --- trunk/jazz/src/GuitarWindow.h 2009-02-16 05:03:58 UTC (rev 698) +++ trunk/jazz/src/GuitarWindow.h 2009-02-16 19:59:58 UTC (rev 699) @@ -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-2009 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 @@ -76,7 +76,7 @@ void OnPaint(wxPaintEvent& Event); - void OnMouseMove(wxMouseEvent& Event); + void OnMouseMove(wxMouseEvent& MouseEvent); private: Modified: trunk/jazz/src/Harmony.cpp =================================================================== --- trunk/jazz/src/Harmony.cpp 2009-02-16 05:03:58 UTC (rev 698) +++ trunk/jazz/src/Harmony.cpp 2009-02-16 19:59:58 UTC (rev 699) @@ -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-2009 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 Modified: trunk/jazz/src/Knob.cpp =================================================================== --- trunk/jazz/src/Knob.cpp 2009-02-16 05:03:58 UTC (rev 698) +++ trunk/jazz/src/Knob.cpp 2009-02-16 19:59:58 UTC (rev 699) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2008 Peter J. Stieber +// Copyright (C) 2008-2009 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 @@ -317,11 +317,11 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZKnob::OnLeftButtonDown(wxMouseEvent& Event) +void JZKnob::OnLeftButtonDown(wxMouseEvent& MouseEvent) { SetFocus(); - mLastPoint = Event.GetPosition(); + mLastPoint = MouseEvent.GetPosition(); SetCursor(wxCursor(wxCURSOR_SIZENS)); @@ -332,18 +332,18 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZKnob::OnRightButtonDown(wxMouseEvent& Event) +void JZKnob::OnRightButtonDown(wxMouseEvent& MouseEvent) { SetFocus(); } //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZKnob::OnMouseMove(wxMouseEvent& Event) +void JZKnob::OnMouseMove(wxMouseEvent& MouseEvent) { if (mDragging) { - wxPoint Point = Event.GetPosition(); + wxPoint Point = MouseEvent.GetPosition(); int Delta = (mLastPoint.y - Point.y) / mSensitivity; @@ -361,7 +361,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZKnob::OnLeftButtonUp(wxMouseEvent& Event) +void JZKnob::OnLeftButtonUp(wxMouseEvent& MouseEvent) { if (HasCapture()) { @@ -372,7 +372,7 @@ mDragging = false; - wxPoint Point = Event.GetPosition(); + wxPoint Point = MouseEvent.GetPosition(); int Delta = (mLastPoint.y - Point.y) / mSensitivity; if (Delta) @@ -383,23 +383,23 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZKnob::OnLeftButtonDoubleClick(wxMouseEvent& Event) +void JZKnob::OnLeftButtonDoubleClick(wxMouseEvent& MouseEvent) { SetValueWithEvent(GetValue() + 1); } //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZKnob::OnRightButtonDoubleClick(wxMouseEvent& Event) +void JZKnob::OnRightButtonDoubleClick(wxMouseEvent& MouseEvent) { SetValueWithEvent(GetValue() - 1); } //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZKnob::OnMouseWheel(wxMouseEvent& Event) +void JZKnob::OnMouseWheel(wxMouseEvent& MouseEvent) { - int WheelRotation = Event.GetWheelRotation(); + int WheelRotation = MouseEvent.GetWheelRotation(); if (WheelRotation < 0) { Modified: trunk/jazz/src/Knob.h =================================================================== --- trunk/jazz/src/Knob.h 2009-02-16 05:03:58 UTC (rev 698) +++ trunk/jazz/src/Knob.h 2009-02-16 19:59:58 UTC (rev 699) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2008 Peter J. Stieber +// Copyright (C) 2008-2009 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 @@ -148,19 +148,19 @@ void OnPaint(wxPaintEvent& Event); - void OnLeftButtonDown(wxMouseEvent& Event); + void OnLeftButtonDown(wxMouseEvent& MouseEvent); - void OnRightButtonDown(wxMouseEvent& Event); + void OnRightButtonDown(wxMouseEvent& MouseEvent); - void OnMouseMove(wxMouseEvent& Event); + void OnMouseMove(wxMouseEvent& MouseEvent); - void OnLeftButtonUp(wxMouseEvent& Event); + void OnLeftButtonUp(wxMouseEvent& MouseEvent); - void OnLeftButtonDoubleClick(wxMouseEvent& Event); + void OnLeftButtonDoubleClick(wxMouseEvent& MouseEvent); - void OnRightButtonDoubleClick(wxMouseEvent& Event); + void OnRightButtonDoubleClick(wxMouseEvent& MouseEvent); - void OnMouseWheel(wxMouseEvent& Event); + void OnMouseWheel(wxMouseEvent& MouseEvent); private: Modified: trunk/jazz/src/MouseAction.cpp =================================================================== --- trunk/jazz/src/MouseAction.cpp 2009-02-16 05:03:58 UTC (rev 698) +++ trunk/jazz/src/MouseAction.cpp 2009-02-16 19:59:58 UTC (rev 699) @@ -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-2009 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 @@ -69,37 +69,37 @@ actions[i] = code; } -int tMouseMapper::Action(wxMouseEvent& Event) +int tMouseMapper::Action(wxMouseEvent& MouseEvent) { - if (!Event.ButtonDown()) + if (!MouseEvent.ButtonDown()) { return 0; } if ( left_action > 0 && - Event.LeftDown() && - !Event.ShiftDown() && - !Event.ControlDown()) + MouseEvent.LeftDown() && + !MouseEvent.ShiftDown() && + !MouseEvent.ControlDown()) { return left_action; } int i = 0; // left down - if (Event.MiddleDown()) + if (MouseEvent.MiddleDown()) { i = 1; } - else if (Event.RightDown()) + else if (MouseEvent.RightDown()) { i = 2; } - if (Event.ShiftDown()) + if (MouseEvent.ShiftDown()) { i += 3; } - if (Event.ControlDown()) + if (MouseEvent.ControlDown()) { i += 6; } @@ -132,42 +132,42 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -int JZSelection::Event(wxMouseEvent& Event) +int JZSelection::ProcessMouseEvent(wxMouseEvent& MouseEvent) { - if (Event.ButtonDown()) + if (MouseEvent.ButtonDown()) { - return ButtonDown(Event); + return ButtonDown(MouseEvent); } - else if (Event.ButtonUp()) + else if (MouseEvent.ButtonUp()) { - return ButtonUp(Event); + return ButtonUp(MouseEvent); } - else if (Event.Dragging()) + else if (MouseEvent.Dragging()) { - return Dragging(Event); + return Dragging(MouseEvent); } return 0; } //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -int JZSelection::ButtonDown(wxMouseEvent& Event) +int JZSelection::ButtonDown(wxMouseEvent& MouseEvent) { if (!mActive) { mActive = true; - if (mSelected && Event.ShiftDown()) + if (mSelected && MouseEvent.ShiftDown()) { // Continue selection JZRectangle Rectangle = mRectangle; Rectangle.SetNormal(); - Dragging(Event); + Dragging(MouseEvent); } else { mSelected = false; - int x = Event.GetX(); - int y = Event.GetY(); + int x = MouseEvent.GetX(); + int y = MouseEvent.GetY(); Snap(x, y, 0); mRectangle.x = x; mRectangle.y = y; @@ -180,17 +180,17 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -int JZSelection::Dragging(wxMouseEvent& Event) +int JZSelection::Dragging(wxMouseEvent& MouseEvent) { if (!mActive) { - ButtonDown(Event); + ButtonDown(MouseEvent); } if (mActive) { - int x = Event.GetX(); - int y = Event.GetY(); + int x = MouseEvent.GetX(); + int y = MouseEvent.GetY(); if (x < 0) { x = 0; @@ -210,7 +210,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -int JZSelection::ButtonUp(wxMouseEvent& Event) +int JZSelection::ButtonUp(wxMouseEvent& MouseEvent) { if (mActive) { @@ -461,9 +461,9 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -int tMouseCounter::LeftDown(wxMouseEvent& Event) +int tMouseCounter::LeftDown(wxMouseEvent& MouseEvent) { - Delta = Event.ShiftDown() ? 10 : 1; + Delta = MouseEvent.ShiftDown() ? 10 : 1; Start(Timeout); if (Wait) { @@ -476,7 +476,9 @@ return 0; } -int tMouseCounter::LeftUp(wxMouseEvent& Event) +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +int tMouseCounter::LeftUp(wxMouseEvent& MouseEvent) { Stop(); ShowValue(FALSE); @@ -485,9 +487,9 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -int tMouseCounter::RightDown(wxMouseEvent& Event) +int tMouseCounter::RightDown(wxMouseEvent& MouseEvent) { - Delta = Event.ShiftDown() ? -10 : -1; + Delta = MouseEvent.ShiftDown() ? -10 : -1; Start(Timeout); if (Wait) { @@ -503,7 +505,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -int tMouseCounter::RightUp(wxMouseEvent& Event) +int tMouseCounter::RightUp(wxMouseEvent& MouseEvent) { Stop(); ShowValue(FALSE); @@ -556,7 +558,7 @@ //Frame->SetStatusText("Click Destination point"); } -int tMarkDestin::ButtonDown(wxMouseEvent& Event) +int tMarkDestin::ButtonDown(wxMouseEvent& MouseEvent) { wxCursor c = wxCursor(wxCURSOR_ARROW); Canvas->SetCursor(c); @@ -564,7 +566,7 @@ //converts physical coords to logical(scrolled) coords wxClientDC* scrolledDC=new wxClientDC(Canvas); Canvas->PrepareDC(*scrolledDC); - wxPoint point = Event.GetLogicalPosition(*scrolledDC); + wxPoint point = MouseEvent.GetLogicalPosition(*scrolledDC); delete scrolledDC; x=point.x; @@ -573,17 +575,17 @@ return 1; } -int tMarkDestin::RightDown(wxMouseEvent& Event) +int tMarkDestin::RightDown(wxMouseEvent& MouseEvent) { - ButtonDown(Event); + ButtonDown(MouseEvent); Aborted = 1; //Frame->SetStatusText("Operation aborted"); return 1; } -int tMarkDestin::LeftDown(wxMouseEvent& Event) +int tMarkDestin::LeftDown(wxMouseEvent& MouseEvent) { - ButtonDown(Event); + ButtonDown(MouseEvent); Aborted = 0; //Frame->SetStatusText(""); return 1; @@ -638,7 +640,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -int tMouseButton::Event(wxMouseEvent& MouseEvent) +int tMouseButton::ProcessMouseEvent(wxMouseEvent& MouseEvent) { if (MouseEvent.ButtonUp()) { Modified: trunk/jazz/src/MouseAction.h =================================================================== --- trunk/jazz/src/MouseAction.h 2009-02-16 05:03:58 UTC (rev 698) +++ trunk/jazz/src/MouseAction.h 2009-02-16 19:59:58 UTC (rev 699) @@ -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-2009 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 @@ -55,6 +55,7 @@ // 9..11 = left/middle/right down + ctrl + shift tMouseMapper(const int actions[12]); + tMouseMapper(); enum Button @@ -70,7 +71,7 @@ bool shift = false, bool ctrl = false); - int Action(wxMouseEvent&); + int Action(wxMouseEvent& MouseEvent); void SetLeftAction(int id = 0) { @@ -89,23 +90,23 @@ // This is a base class for mouse actions. The classes are instantiated in // the mouse handler of the event window, for example, to keep state during // mouse operations, like drag and drop and so on. -// The Event() function is used to determine what to do with an incoming -// event. Normally, if the event is a drag event, call the drag function of -// the class, and so on. +// The ProcessMouseEvent() function is used to determine what to do with an +// incoming event. Normally, if the event is a drag event, call the drag +// function of the class, and so on. //***************************************************************************** class tMouseAction { public: - virtual ~tMouseAction() {} - virtual int Dragging(wxMouseEvent &) { return 0; } - virtual int LeftDown(wxMouseEvent &) { return 0; } - virtual int LeftUp(wxMouseEvent &) { return 0; } - virtual int RightDown(wxMouseEvent &) { return 0; } - virtual int RightUp(wxMouseEvent &) { return 0; } - virtual int MiddleDown(wxMouseEvent &) { return 0; } - virtual int MiddleUp(wxMouseEvent &) { return 0; } - virtual int Event(wxMouseEvent& MouseEvent) + virtual ~tMouseAction() {} + virtual int Dragging(wxMouseEvent& MouseEvent) { return 0; } + virtual int LeftDown(wxMouseEvent& MouseEvent) { return 0; } + virtual int LeftUp(wxMouseEvent& MouseEvent) { return 0; } + virtual int RightDown(wxMouseEvent& MouseEvent) { return 0; } + virtual int RightUp(wxMouseEvent& MouseEvent) { return 0; } + virtual int MiddleDown(wxMouseEvent& MouseEvent) { return 0; } + virtual int MiddleUp(wxMouseEvent& MouseEvent) { return 0; } + virtual int ProcessMouseEvent(wxMouseEvent& MouseEvent) { if (MouseEvent.Dragging()) { @@ -182,13 +183,13 @@ { } - virtual int Dragging(wxMouseEvent& Event); + virtual int Dragging(wxMouseEvent& MouseEvent); - virtual int Event(wxMouseEvent& Event); + virtual int ProcessMouseEvent(wxMouseEvent& MouseEvent); - virtual int ButtonDown(wxMouseEvent& Event); + virtual int ButtonDown(wxMouseEvent& MouseEvent); - virtual int ButtonUp(wxMouseEvent& Event); + virtual int ButtonUp(wxMouseEvent& MouseEvent); virtual void Draw(wxDC& Dc, int ScrolledX, int ScrolledY); @@ -313,10 +314,10 @@ int Wait; // don't inc/dec at Init tButtonLabelInterface *win; - virtual int LeftDown(wxMouseEvent &); - virtual int LeftUp(wxMouseEvent &); - virtual int RightDown(wxMouseEvent &); - virtual int RightUp(wxMouseEvent &); + virtual int LeftDown(wxMouseEvent& MouseEvent); + virtual int LeftUp(wxMouseEvent& MouseEvent); + virtual int RightDown(wxMouseEvent& MouseEvent); + virtual int RightUp(wxMouseEvent& MouseEvent); virtual void Notify(); virtual void ShowValue(bool down); }; @@ -327,17 +328,18 @@ //***************************************************************************** class tMarkDestin : public tMouseAction { - wxWindow *Canvas; - wxFrame *Frame; - int ButtonDown(wxMouseEvent &); + public: + int Aborted; + float x, y; -public: - int Aborted; - float x, y; + virtual int LeftDown(wxMouseEvent& MouseEvent); + virtual int RightDown(wxMouseEvent& MouseEvent); + tMarkDestin(wxWindow* canvas, wxFrame* frame, int left); - virtual int LeftDown(wxMouseEvent &); - virtual int RightDown(wxMouseEvent &); - tMarkDestin(wxWindow *canvas, wxFrame *frame, int left); + private: + wxWindow *Canvas; + wxFrame *Frame; + int ButtonDown(wxMouseEvent& MouseEvent); }; //***************************************************************************** @@ -355,7 +357,7 @@ virtual ~tMouseButton(); - virtual int Event(wxMouseEvent& MouseEvent); + virtual int ProcessMouseEvent(wxMouseEvent& MouseEvent); protected: Modified: trunk/jazz/src/PianoFrame.h =================================================================== --- trunk/jazz/src/PianoFrame.h 2009-02-16 05:03:58 UTC (rev 698) +++ trunk/jazz/src/PianoFrame.h 2009-02-16 19:59:58 UTC (rev 699) @@ -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-2009 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 @@ -76,7 +76,7 @@ int mTrackIndex; JZTrack* Track; - void MouseCutPaste(wxMouseEvent &e, bool cut); + void MouseCutPaste(wxMouseEvent& MouseEvent, bool cut); bool OnClose(); Modified: trunk/jazz/src/PianoWindow.cpp =================================================================== --- trunk/jazz/src/PianoWindow.cpp 2009-02-16 05:03:58 UTC (rev 698) +++ trunk/jazz/src/PianoWindow.cpp 2009-02-16 19:59:58 UTC (rev 699) @@ -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-2009 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 @@ -93,15 +93,16 @@ //***************************************************************************** // Description: -// tMousePlay - Click in pianoroll +// JZMousePlay - Click in pianoroll //***************************************************************************** -class tMousePlay : public tMouseAction +class JZMousePlay : public tMouseAction { public: - tMousePlay(JZPianoWindow* pPianoWindow, wxMouseEvent& Event); - int ProcessEvent(wxMouseEvent& Event); + JZMousePlay(JZPianoWindow* pPianoWindow); + virtual int ProcessMouseEvent(wxMouseEvent& MouseEvent); + private: int mPitch, mVeloc, mChannel; @@ -110,7 +111,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -tMousePlay::tMousePlay(JZPianoWindow* pPianoWindow, wxMouseEvent& Event) +JZMousePlay::JZMousePlay(JZPianoWindow* pPianoWindow) : mPitch(0), mVeloc(-1), mChannel(-1), @@ -118,39 +119,37 @@ { mChannel = mpPianoWindow->GetTrack()->Channel ? mpPianoWindow->GetTrack()->Channel - 1 : 0; - - ProcessEvent(Event); } //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -int tMousePlay::ProcessEvent(wxMouseEvent& Event) +int JZMousePlay::ProcessMouseEvent(wxMouseEvent& MouseEvent) { int x, y; - Event.GetPosition(&x, &y); + MouseEvent.GetPosition(&x, &y); int OldPitch = mPitch; - if (Event.LeftDown()) + if (MouseEvent.LeftDown()) { mPitch = mpPianoWindow->y2Pitch(y); mVeloc = 64; } - else if (Event.MiddleDown()) + else if (MouseEvent.MiddleDown()) { mPitch = mpPianoWindow->y2Pitch(y); mVeloc = 80; } - else if (Event.RightDown()) + else if (MouseEvent.RightDown()) { mPitch = mpPianoWindow->y2Pitch(y); mVeloc = 110; } - else if (Event.ButtonUp()) + else if (MouseEvent.ButtonUp()) { mPitch = 0; } - else if (Event.Dragging()) + else if (MouseEvent.Dragging()) { mPitch = mpPianoWindow->y2Pitch(y); } @@ -170,23 +169,21 @@ { if (OldPitch && OldPitch != mPitch) { - tKeyOff of(0, mChannel, OldPitch); - gpMidiPlayer->OutNow(mpPianoWindow->GetTrack(), &of); + tKeyOff KeyOff(0, mChannel, OldPitch); + gpMidiPlayer->OutNow(mpPianoWindow->GetTrack(), &KeyOff); OldPitch = 0; } if (mPitch && mPitch != OldPitch) { - tKeyOn on(0, mChannel, mPitch, mVeloc); - gpMidiPlayer->OutNow(mpPianoWindow->GetTrack(), &on); + tKeyOn KeyOn(0, mChannel, mPitch, mVeloc); + gpMidiPlayer->OutNow(mpPianoWindow->GetTrack(), &KeyOn); OldPitch = 0; } } if (!mPitch) { - mpPianoWindow->mpMouseAction = 0; - delete this; return 1; // done } return 0; @@ -202,11 +199,11 @@ tKeyLengthDragger(tKeyOn* pKeyOn, JZPianoWindow* pPianoWindow); - int Dragging(wxMouseEvent& Event); + int Dragging(wxMouseEvent& MouseEvent); - int ButtonUp(wxMouseEvent& Event); + int ButtonUp(wxMouseEvent& MouseEvent); - int Event(wxMouseEvent& Event); + int ProcessMouseEvent(wxMouseEvent& MouseEvent); private: @@ -240,28 +237,28 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -int tKeyLengthDragger::Event(wxMouseEvent& Event) +int tKeyLengthDragger::ProcessMouseEvent(wxMouseEvent& MouseEvent) { - if (Event.Dragging()) + if (MouseEvent.Dragging()) { - return Dragging(Event); + return Dragging(MouseEvent); } - else if (Event.ButtonUp()) + else if (MouseEvent.ButtonUp()) { - return ButtonUp(Event); + return ButtonUp(MouseEvent); } return 0; } //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -int tKeyLengthDragger::Dragging(wxMouseEvent& Event) +int tKeyLengthDragger::Dragging(wxMouseEvent& MouseEvent) { wxClientDC Dc(Win); Win->PrepareDC(Dc); //to translate scrolled coordinates Win->DrawEvent(Dc, Copy, Copy->GetBrush(), 1, 1); int fx, fy; - Event.GetPosition(&fx, &fy); + MouseEvent.GetPosition(&fx, &fy); int Clock = Win->x2Clock(fx); int Length = Clock - Copy->GetClock(); if (Length <= 0) @@ -276,7 +273,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -int tKeyLengthDragger::ButtonUp(wxMouseEvent& Event) +int tKeyLengthDragger::ButtonUp(wxMouseEvent& MouseEvent) { // SN++ Key_Aftertouch if (Copy->GetEventLength() < mpKeyOn->GetEventLength()) @@ -330,16 +327,21 @@ //***************************************************************************** class tPlayTrackLengthDragger : public tMouseAction { + public: + + tPlayTrackLengthDragger(tPlayTrack* k, JZPianoWindow* pPianoWindow); + + int Dragging(wxMouseEvent& MouseEvent); + + int ButtonUp(wxMouseEvent& MouseEvent); + + int ProcessMouseEvent(wxMouseEvent& MouseEvent); + + private: tPlayTrack* mpKeyOn; tPlayTrack* Copy; JZPianoWindow* Win; JZTrack* mpTrack; - - public: - tPlayTrackLengthDragger(tPlayTrack* k, JZPianoWindow* pPianoWindow); - int Dragging(wxMouseEvent& Event); - int ButtonUp(wxMouseEvent& Event); - int Event(wxMouseEvent& Event); }; //----------------------------------------------------------------------------- @@ -363,28 +365,28 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -int tPlayTrackLengthDragger::Event(wxMouseEvent& Event) +int tPlayTrackLengthDragger::ProcessMouseEvent(wxMouseEvent& MouseEvent) { - if (Event.Dragging()) + if (MouseEvent.Dragging()) { - return Dragging(Event); + return Dragging(MouseEvent); } - else if (Event.ButtonUp()) + else if (MouseEvent.ButtonUp()) { - return ButtonUp(Event); + return ButtonUp(MouseEvent); } return 0; } //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -int tPlayTrackLengthDragger::Dragging(wxMouseEvent& Event) +int tPlayTrackLengthDragger::Dragging(wxMouseEvent& MouseEvent) { wxClientDC Dc(Win); Win->PrepareDC(Dc); Win->DrawEvent(Dc, Copy, Copy->GetBrush(), 1, 1); int fx, fy; - Event.GetPosition(&fx, &fy); + MouseEvent.GetPosition(&fx, &fy); int Clock = Win->x2Clock(fx); int Length = Clock - Copy->GetClock(); if (Length <= 0) @@ -397,7 +399,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -int tPlayTrackLengthDragger::ButtonUp(wxMouseEvent& Event) +int tPlayTrackLengthDragger::ButtonUp(wxMouseEvent& MouseEvent) { wxClientDC Dc(Win); Win->PrepareDC(Dc); @@ -423,7 +425,6 @@ class tVelocCounter : public tMouseCounter { public: - int Event(wxMouseEvent& Event); tVelocCounter( JZPianoWindow* pPianoWindow, JZRectangle* pRectangle, @@ -440,6 +441,8 @@ Dc.SetFont(*(Win->GetFixedFont())); } + virtual int ProcessMouseEvent(wxMouseEvent& MouseEvent); + private: JZPianoWindow* Win; @@ -449,9 +452,9 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -int tVelocCounter::Event(wxMouseEvent& Event) +int tVelocCounter::ProcessMouseEvent(wxMouseEvent& MouseEvent) { - if (tMouseCounter::Event(Event)) + if (tMouseCounter::ProcessMouseEvent(MouseEvent)) { tKeyOn* pKeyOnCopy = (tKeyOn *)mpKeyOn->Copy(); pKeyOnCopy->SetVelocity(Value); @@ -591,7 +594,7 @@ mpPianoFrame(pPianoFrame), mPlayClock(-1), mSnapCount(0), - mpMouseAction(0), + mPasteBuffer(), mpTrack(0), mTrackIndex(0), mpCtrlEdit(0), @@ -1612,12 +1615,12 @@ // Descriptions: // This mouse handler delegates to the subclassed event window. //----------------------------------------------------------------------------- -void JZPianoWindow::OnMouseEvent(wxMouseEvent& Event) +void JZPianoWindow::OnMouseEvent(wxMouseEvent& MouseEvent) { - if (Event.Moving() && !Event.Dragging() && !mpMouseAction) + if (MouseEvent.Moving() && !MouseEvent.Dragging() && !mpMouseAction) { int fx, fy; - Event.GetPosition(&fx, &fy); + MouseEvent.GetPosition(&fx, &fy); int Pitch = y2Pitch(fy); JZProjectManager::Instance()->ShowPitch(Pitch); } @@ -1627,27 +1630,30 @@ if (!mpMouseAction) { int x, y; - Event.GetPosition(&x, &y); + MouseEvent.GetPosition(&x, &y); - if (y > mEventsY) // click in event area? + // Was the mouse event below the top line that indicates the measure? + if (y > mEventsY) { if (mPianoX < x && x < mPianoX + mPianoWidth) { - MousePiano(Event); + // The mouse event was in the piano keys area. + MousePiano(MouseEvent); } else if (mEventsX < x && x < mEventsX + mEventsWidth) { - MouseEvents(Event); + // The mouse event was in the MIDI event area. + MouseEvents(MouseEvent); } else { - OnEventWinMouseEvent(Event); + OnEventWinMouseEvent(MouseEvent); } } else if (x > mEventsX) { // click in top line - int action = mMousePlay.Action(Event); + int action = mMousePlay.Action(MouseEvent); if (action) { @@ -1685,7 +1691,8 @@ } else { - OnEventWinMouseEvent(Event); + MouseEvent.Skip(); +//NEW OnEventWinMouseEvent(MouseEvent); } } @@ -1820,7 +1827,7 @@ //----------------------------------------------------------------------------- // Snapper //----------------------------------------------------------------------------- -void JZPianoWindow::SnapSelStop(wxMouseEvent& Event) +void JZPianoWindow::SnapSelStop(wxMouseEvent& MouseEvent) { if (mpSnapSel->IsSelected()) { @@ -1865,8 +1872,21 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZPianoWindow::SnapSelStart(wxMouseEvent &) +int JZPianoWindow::SnapClock(int Clock, bool Up) { + int qnt = SnapClocks(); + Clock -= (Clock % qnt); + if (Up) + { + Clock += qnt; + } + return Clock; +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZPianoWindow::SnapSelStart(wxMouseEvent& MouseEvent) +{ mSnapCount = 0; int clk = SnapClock(mFromClock, false); int qnt = SnapClocks(); @@ -1890,19 +1910,6 @@ } //----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -int JZPianoWindow::SnapClock(int Clock, bool Up) -{ - int qnt = SnapClocks(); - Clock -= (Clock % qnt); - if (Up) - { - Clock += qnt; - } - return Clock; -} - -//----------------------------------------------------------------------------- // Description: // Update the play position to the clock argument, and trigger a redraw so // the play bar will be drawn. @@ -2000,22 +2007,22 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -int JZPianoWindow::OnEventWinMouseEvent(wxMouseEvent& Event) +int JZPianoWindow::OnEventWinMouseEvent(wxMouseEvent& MouseEvent) { if (!mpMouseAction) { // create mpSnapSel? int x, y; - Event.GetPosition(&x, &y); + MouseEvent.GetPosition(&x, &y); if ( mEventsX < x && x < mEventsX + mEventsWidth && mEventsY < y && y < mEventsY + mEventsHeight) { - if (Event.LeftDown()) + if (MouseEvent.LeftDown()) { { - SnapSelStart(Event); + SnapSelStart(MouseEvent); // if (mpSnapSel->IsSelected()) // { @@ -2023,7 +2030,7 @@ // invalidate a rect). Refresh(); // } - mpSnapSel->Event(Event); + mpSnapSel->ProcessMouseEvent(MouseEvent); mpMouseAction = mpSnapSel; } } @@ -2033,13 +2040,13 @@ { // mpMouseAction active - if (mpMouseAction->Event(Event)) + if (mpMouseAction->ProcessMouseEvent(MouseEvent)) { // mpMouseAction finished if (mpMouseAction == mpSnapSel) { - SnapSelStop(Event); + SnapSelStop(MouseEvent); // inefficient, invalidate rect first instead. Refresh(); @@ -2100,14 +2107,14 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZPianoWindow::MouseCutPaste(wxMouseEvent& Event, bool Cut) +void JZPianoWindow::MouseCutPaste(wxMouseEvent& MouseEvent, bool Cut) { wxClientDC Dc(this); PrepareDC(Dc); // Convert physical coordinates to logical (scrolled) coordinates. - wxPoint Point = Event.GetLogicalPosition(Dc); + wxPoint Point = MouseEvent.GetLogicalPosition(Dc); int x = Point.x; int y = Point.y; @@ -2130,14 +2137,14 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZPianoWindow::MouseEvents(wxMouseEvent& Event) +void JZPianoWindow::MouseEvents(wxMouseEvent& MouseEvent) { - int action = mMouseEvent.Action(Event); + int action = mMouseEvent.Action(MouseEvent); if (action) { int x, y; - Event.GetPosition(&x, &y); + MouseEvent.GetPosition(&x, &y); int Clock = x2Clock(x); int Pitch = y2Pitch(y); @@ -2153,11 +2160,11 @@ switch (action) { case MA_CUTPASTE: - MouseCutPaste(Event, 1); + MouseCutPaste(MouseEvent, 1); break; case MA_COPY: - MouseCutPaste(Event, 0); + MouseCutPaste(MouseEvent, 0); break; case MA_LENGTH: @@ -2198,12 +2205,12 @@ case MA_LISTEN: - MousePiano(Event); + MousePiano(MouseEvent); break; case MA_SELECT: case MA_CONTSEL: - OnEventWinMouseEvent(Event); + OnEventWinMouseEvent(MouseEvent); break; case MA_VELOCITY: @@ -2216,7 +2223,7 @@ r.SetHeight(mTopInfoHeight); tVelocCounter *VelocCounter = new tVelocCounter(this, &r, pKeyOn); - VelocCounter->Event(Event); + VelocCounter->ProcessMouseEvent(MouseEvent); mpMouseAction = VelocCounter; } break; @@ -2227,11 +2234,17 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZPianoWindow::MousePiano(wxMouseEvent& Event) +void JZPianoWindow::MousePiano(wxMouseEvent& MouseEvent) { - if (Event.ButtonDown()) + if (MouseEvent.ButtonDown()) { - mpMouseAction = new tMousePlay(this, Event); + mpMouseAction = new JZMousePlay(this); + int Status = mpMouseAction->ProcessMouseEvent(MouseEvent); + if (Status == 1) + { + delete mpMouseAction; + mpMouseAction = 0; + } } } Modified: trunk/jazz/src/PianoWindow.h =================================================================== --- trunk/jazz/src/PianoWindow.h 2009-02-16 05:03:58 UTC (rev 698) +++ trunk/jazz/src/PianoWindow.h 2009-02-16 19:59:58 UTC (rev 699) @@ -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-2009 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 @@ -111,12 +111,12 @@ int IsVisible(JZTrack* pTrack); - void SnapSelStart(wxMouseEvent& Event); - int SnapClock(int Clock, bool Up = false); - void SnapSelStop(wxMouseEvent& Event); + virtual void SnapSelStart(wxMouseEvent& MouseEvent); + virtual void SnapSelStop(wxMouseEvent& MouseEvent); + int SnapClocks(); void SetSnapDenom(int Value); @@ -208,8 +208,6 @@ int mSnapsX[eMaxSnaps]; - tMouseAction* mpMouseAction; - tEventArray mPasteBuffer; public: @@ -240,7 +238,7 @@ int y2TrackIndex(int y); int EventsSelected(const char *msg = 0); - int OnEventWinMouseEvent(wxMouseEvent &e); + int OnEventWinMouseEvent(wxMouseEvent& MouseEvent); void DrawEvents( wxDC& Dc, @@ -268,7 +266,7 @@ void OnPaint(wxPaintEvent& Event); - void OnMouseEvent(wxMouseEvent& Event); + void OnMouseEvent(wxMouseEvent& MouseEvent); void OnScroll(wxScrollWinEvent& Event); @@ -276,11 +274,11 @@ void VerticalScroll(wxScrollWinEvent& Event); - void MouseCutPaste(wxMouseEvent& Event, bool Cut); + void MouseCutPaste(wxMouseEvent& MouseEvent, bool Cut); - void MouseEvents(wxMouseEvent& Event); + void MouseEvents(wxMouseEvent& MouseEvent); - void MousePiano(wxMouseEvent& Event); + void MousePiano(wxMouseEvent& MouseEvent); bool OnCharHook(wxKeyEvent& Event); Modified: trunk/jazz/src/Random.cpp =================================================================== --- trunk/jazz/src/Random.cpp 2009-02-16 05:03:58 UTC (rev 698) +++ trunk/jazz/src/Random.cpp 2009-02-16 19:59:58 UTC (rev 699) @@ -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-2009 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 @@ -597,29 +597,33 @@ xmax = xma; } -int tArrayEdit::Index(wxMouseEvent &e) +int tArrayEdit::Index(wxMouseEvent& MouseEvent) { int ex, ey; - e.GetPosition(&ex, &ey); + MouseEvent.GetPosition(&ex, &ey); int i = (int)( ((short)ex - x) * n / w); i = i < 0 ? 0 : i; i = i >= n ? n-1 : i; return i; } -int tArrayEdit::Dragging(wxMouseEvent &e) +int tArrayEdit::Dragging(wxMouseEvent& MouseEvent) { if (!dragging) + { return 0; + } if (index < 0) - index = Index(e); + { + index = Index(MouseEvent); + } int val = nul; - if (e.LeftIsDown()) + if (MouseEvent.LeftIsDown()) { int ex, ey; - e.GetPosition(&ex, &ey); + MouseEvent.GetPosition(&ex, &ey); // $blk$ val = (int)( (y + h - (short)ey) * (max - min) / h + min); val = (int)( (double)(y + h - ey) * (max - min) / h + min + 0.5); val = val > max ? max : val; @@ -631,12 +635,12 @@ // in msw ex,ey are 65536 for negative values! wxDC *dc = new wxClientDC(this);//GetDC(); char buf[500]; - sprintf(buf, "x %4.0f, y %4.0f, sh %d", ex, ey, e.ShiftDown()); + sprintf(buf, "x %4.0f, y %4.0f, sh %d", ex, ey, MouseEvent.ShiftDown()); dc->DrawText(buf, 50, 50); } #endif wxDC *dc = new wxClientDC(this); // PORTING this is evil and shoud go - if (e.ShiftDown()) + if (MouseEvent.ShiftDown()) { int k; for (k = 0; k < n; k++) @@ -648,7 +652,7 @@ } } - else if (e.ControlDown()) + else if (MouseEvent.ControlDown()) { DrawBar(dc, index, 0); mArray[index] = val; @@ -656,7 +660,7 @@ } else { - int i = Index(e); + int i = Index(MouseEvent); int k = i; if (i < index) for (; i <= index; i++) @@ -678,18 +682,18 @@ return 0; } -int tArrayEdit::ButtonDown(wxMouseEvent &e) +int tArrayEdit::ButtonDown(wxMouseEvent& MouseEvent) { #ifdef __WXMSW__ CaptureMouse(); #endif dragging = 1; - index = Index(e); - Dragging(e); + index = Index(MouseEvent); + Dragging(MouseEvent); return 0; } -int tArrayEdit::ButtonUp(wxMouseEvent &e) +int tArrayEdit::ButtonUp(wxMouseEvent& MouseEvent) { #ifdef __WXMSW__ ReleaseMouse(); @@ -705,16 +709,24 @@ } -void tArrayEdit::OnMouseEvent(wxMouseEvent &e) +void tArrayEdit::OnMouseEvent(wxMouseEvent& MouseEvent) { if (!enabled) + { return; - if (e.ButtonDown()) - ButtonDown(e); - else if (e.Dragging()) - Dragging(e); - else if (e.ButtonUp()) - ButtonUp(e); + } + if (MouseEvent.ButtonDown()) + { + ButtonDown(MouseEvent); + } + else if (MouseEvent.Dragging()) + { + Dragging(MouseEvent); + } + else if (MouseEvent.ButtonUp()) + { + ButtonUp(MouseEvent); + } } void tArrayEdit::Enable(int e) Modified: trunk/jazz/src/Random.h =================================================================== --- trunk/jazz/src/Random.h 2009-02-16 05:03:58 UTC (rev 698) +++ trunk/jazz/src/Random.h 2009-02-16 19:59:58 UTC (rev 699) @@ -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-2009 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 @@ -145,7 +145,7 @@ virtual void DrawYTicks(wxDC* dc); virtual void DrawLabel(wxDC* dc); virtual void DrawNull(wxDC* dc); - int Index(wxMouseEvent &e); + int Index(wxMouseEvent& MouseEvent); int enabled; int style_bits; @@ -168,10 +168,10 @@ virtual void OnDraw(wxDC& indc); virtual void OnSize(wxSizeEvent& event); - virtual void OnMouseEvent(wxMouseEvent &e); - virtual int Dragging(wxMouseEvent &); - virtual int ButtonDown(wxMouseEvent &); - virtual int ButtonUp(wxMouseEvent &); + virtual void OnMouseEvent(wxMouseEvent& MouseEvent); + virtual int Dragging(wxMouseEvent& MouseEvent); + virtual int ButtonDown(wxMouseEvent& MouseEvent); + virtual int ButtonUp(wxMouseEvent& MouseEvent); virtual void SetLabel(char const *llabel); void Enable(int enable = 1); Modified: trunk/jazz/src/SampleWindow.cpp =================================================================== --- trunk/jazz/src/SampleWindow.cpp 2009-02-16 05:03:58 UTC (rev 698) +++ trunk/jazz/src/SampleWindow.cpp 2009-02-16 19:59:58 UTC (rev 699) @@ -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-2009 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 @@ -138,7 +138,7 @@ } virtual void OnPaint(); virtual void OnSize(int w, int h); - virtual void OnEvent(wxMouseEvent &evt); + virtual void OnEvent(wxMouseEvent& MouseEvent); void ClearSelection(); void SetInsertionPoint(int offs); void SetSelection(int fr, int to); @@ -311,7 +311,7 @@ -void tSampleCnvs::OnEvent(wxMouseEvent &e) +void tSampleCnvs::OnEvent(wxMouseEvent& MouseEvent) { // dont accept mouse events as long as the // array edit is up @@ -323,7 +323,7 @@ wxDC* pDc = new wxClientDC(this); // tSnapSel is strange. - if (e.LeftDown()) + if (MouseEvent.LeftDown()) { mouse_up_sets_insertion_point = 0; mouse_down = TRUE; @@ -340,12 +340,12 @@ { mouse_up_sets_insertion_point = 1; } - snapsel.Event(e); + snapsel.ProcessMouseEvent(MouseEvent); } - else if (e.LeftUp()) + else if (MouseEvent.LeftUp()) { mouse_down = FALSE; - snapsel.Event(e); + snapsel.ProcessMouseEvent(MouseEvent); if (snapsel.IsSelected()) { snapsel.Draw(*pDc, 0, 0); @@ -357,7 +357,7 @@ else if (mouse_up_sets_insertion_point) { int x, y; - e.GetPosition(&x, &y); + MouseEvent.GetPosition(&x, &y); sel_fr = sel_to = Pixel2Sample(x); inspt.Draw(x); } @@ -366,9 +366,9 @@ sel_fr = sel_to = -1; } } - else if (e.Dragging() && mouse_down) + else if (MouseEvent.Dragging() && mouse_down) { - snapsel.Event(e); + snapsel.ProcessMouseEvent(MouseEvent); } } Modified: trunk/jazz/src/TrackFrame.cpp =================================================================== --- trunk/jazz/src/TrackFrame.cpp 2009-02-16 05:03:58 UTC (rev 698) +++ trunk/jazz/src/TrackFrame.cpp 2009-02-16 19:59:58 UTC (rev 699) @@ -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-2009 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 @@ -665,7 +665,7 @@ // playing: // left+right: stop //----------------------------------------------------------------------------- -void JZTrackFrame::MousePlay(wxMouseEvent& Event, TEMousePlayMode Mode) +void JZTrackFrame::MousePlay(wxMouseEvent& MouseEvent, TEMousePlayMode Mode) { - mpTrackWindow->MousePlay(Event, Mode); + mpTrackWindow->MousePlay(MouseEvent, Mode); } Modified: trunk/jazz/src/TrackFrame.h =================================================================== --- trunk/jazz/src/TrackFrame.h 2009-02-16 05:03:58 UTC (rev 698) +++ trunk/jazz/src/TrackFrame.h 2009-02-16 19:59:58 UTC (rev 699) @@ -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-2009 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 @@ -102,7 +102,7 @@ void OnHelpAbout(wxCommandEvent& Event); - void MousePlay(wxMouseEvent& Event, TEMousePlayMode Mode); + void MousePlay(wxMouseEvent& MouseEvent, TEMousePlayMode Mode); private: Modified: trunk/jazz/src/TrackWindow.cpp =================================================================== --- trunk/jazz/src/TrackWindow.cpp 2009-02-16 05:03:58 UTC (rev 698) +++ trunk/jazz/src/TrackWindow.cpp 2009-02-16 19:59:58 UTC (rev 699) @@ -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-2009 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 @@ -265,9 +265,9 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZTrackWindow::OnLeftButtonDown(wxMouseEvent& Event) +void JZTrackWindow::OnLeftButtonDown(wxMouseEvent& MouseEvent) { - wxPoint Point = Event.GetPosition(); + wxPoint Point = MouseEvent.GetPosition(); if (Point.x < mNumberWidth && Point.y >= mTopInfoHeight) { @@ -282,34 +282,34 @@ mEventsY, mEventsWidth, mEventsHeight); - SnapSelStop(Event); + SnapSelStop(MouseEvent); } else if ( Point.x >= mEventsX && Point.x < mEventsX + mEventsWidth && Point.y >= mEventsY && Point.y < mEventsY + mEventsHeight) { - SnapSelectionStart(Event); - mpSnapSel->ButtonDown(Event); + SnapSelectionStart(MouseEvent); + mpSnapSel->ButtonDown(MouseEvent); } } //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZTrackWindow::OnMouseMove(wxMouseEvent& Event) +void JZTrackWindow::OnMouseMove(wxMouseEvent& MouseEvent) { - if (Event.LeftIsDown()) + if (MouseEvent.LeftIsDown()) { - mpSnapSel->Dragging(Event); -// SnapSelectionStop(Event); + mpSnapSel->Dragging(MouseEvent); +// SnapSelectionStop(MouseEvent); Refresh(false); } } //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZTrackWindow::OnLeftButtonUp(wxMouseEvent& Event) +void JZTrackWindow::OnLeftButtonUp(wxMouseEvent& MouseEvent) { - wxPoint Point = Event.GetPosition(); + wxPoint Point = MouseEvent.GetPosition(); // Check to see if the mouse was clicked in the top header. if (Point.y < mTopInfoHeight) @@ -410,10 +410,10 @@ Point.x >= mEventsX && Point.x < mEventsX + mEventsWidth && Point.y >= mEventsY && Point.y < mEventsY + mEventsHeight) { - mpSnapSel->ButtonUp(Event); + mpSnapSel->ButtonUp(MouseEvent); // The point is in event area. - SnapSelectionStop(Event); + SnapSelectionStop(MouseEvent); } } } @@ -421,9 +421,9 @@ //----------------------------------------------------------------------------- //------------------------------------------------------------------------... [truncated message content] |
From: <pst...@us...> - 2009-02-16 05:04:04
|
Revision: 698 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=698&view=rev Author: pstieber Date: 2009-02-16 05:03:58 +0000 (Mon, 16 Feb 2009) Log Message: ----------- 1. Added a placeholder for a new velocity dialog. 2. Updated some meter change resource ID. 3. Updated the names of some wxWidgets event handlers. 4. Moved the meter change dialog from the event window source files to the dialog source files. 5. Made cosmetic changes. Modified Paths: -------------- trunk/jazz/src/Dialogs.cpp trunk/jazz/src/Dialogs.h trunk/jazz/src/EventFrame.cpp trunk/jazz/src/EventFrame.h trunk/jazz/src/EventWindow.cpp trunk/jazz/src/EventWindow.h trunk/jazz/src/Makefile.am trunk/jazz/src/PianoFrame.cpp trunk/jazz/src/PianoWindow.cpp trunk/jazz/src/Resources.h trunk/jazz/src/TrackFrame.cpp trunk/jazz/vc8/JazzPlusPlus-VC8.vcproj trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj Added Paths: ----------- trunk/jazz/src/Dialogs/VelocityDialog.cpp trunk/jazz/src/Dialogs/VelocityDialog.h Added: trunk/jazz/src/Dialogs/VelocityDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/VelocityDialog.cpp (rev 0) +++ trunk/jazz/src/Dialogs/VelocityDialog.cpp 2009-02-16 05:03:58 UTC (rev 698) @@ -0,0 +1,5 @@ +#include "VelocityDialog.h" + +JZVelocityDialog::JZVelocityDialog() +{ +} Property changes on: trunk/jazz/src/Dialogs/VelocityDialog.cpp ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/jazz/src/Dialogs/VelocityDialog.h =================================================================== --- trunk/jazz/src/Dialogs/VelocityDialog.h (rev 0) +++ trunk/jazz/src/Dialogs/VelocityDialog.h 2009-02-16 05:03:58 UTC (rev 698) @@ -0,0 +1,14 @@ +#ifndef JZ_VELOCITYDIALOG_H +#define JZ_VELOCITYDIALOG_H + +#include <wx/dialog.h> + +class JZVelocityDialog : public wxDialog +{ + public: + + JZVelocityDialog(); + +}; + +#endif // !defined(JZ_VELOCITYDIALOG_H) Property changes on: trunk/jazz/src/Dialogs/VelocityDialog.h ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/jazz/src/Dialogs.cpp =================================================================== --- trunk/jazz/src/Dialogs.cpp 2009-01-22 02:24:58 UTC (rev 697) +++ trunk/jazz/src/Dialogs.cpp 2009-02-16 05:03:58 UTC (rev 698) @@ -26,6 +26,7 @@ #include "Command.h" #include "DeprecatedWx/proplist.h" #include "Dialogs/KeyOnDialog.h" +//#include "EventFrame.h" #include "Events.h" #include "EventWindow.h" #include "Filter.h" @@ -48,9 +49,9 @@ using namespace std; -// ************************************************************************** +//***************************************************************************** // Shift -// ************************************************************************* +//***************************************************************************** //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- //tShiftDlg::tShiftDlg(JZEventFrame* pEventWindow, JZFilter* pFilter, long unit) @@ -101,9 +102,9 @@ //} -// ************************************************************************** +//***************************************************************************** // Cleanup -// ************************************************************************* +//***************************************************************************** int tCleanupDlg::lowLimit = 48; bool tCleanupDlg::shortenOverlaps = 1; @@ -183,9 +184,9 @@ } -// ************************************************************************** +//***************************************************************************** // SearchReplace -// ************************************************************************* +//***************************************************************************** int tSearchReplaceDlg::frCtrl = 1; int tSearchReplaceDlg::toCtrl = 1; @@ -230,9 +231,9 @@ -// ************************************************************************** +//***************************************************************************** // Transpose -// ************************************************************************* +//***************************************************************************** int tTransposeDlg::Notes = 0; int tTransposeDlg::Scale = gScaleChromatic; @@ -281,9 +282,9 @@ "bool")); } -// ************************************************************************** +//***************************************************************************** // SetChannel -// ************************************************************************* +//***************************************************************************** int tSetChannelDlg::NewChannel = 1; @@ -329,9 +330,9 @@ -// ************************************************************************** +//***************************************************************************** // Velocity -// ************************************************************************* +//***************************************************************************** int tVelocityDlg::FromValue = 64; int tVelocityDlg::ToValue = 0; @@ -380,9 +381,9 @@ -// ************************************************************************** +//***************************************************************************** // Length -// ************************************************************************* +//***************************************************************************** int tLengthDlg::FromValue = 30; int tLengthDlg::ToValue = 0; @@ -441,9 +442,9 @@ -// ************************************************************************** +//***************************************************************************** // seqLength -// ************************************************************************* +//***************************************************************************** double tSeqLengthDlg::scale = 1.0; @@ -484,9 +485,9 @@ } -// ************************************************************************** +//***************************************************************************** // midiDelay -// ************************************************************************* +//***************************************************************************** double tMidiDelayDlg::scale = 0.5; long tMidiDelayDlg::clockDelay = 10; @@ -546,9 +547,9 @@ -// ************************************************************************* +//***************************************************************************** // Delete -// ************************************************************************* +//***************************************************************************** bool tDeleteDlg::LeaveSpace = 1; @@ -585,9 +586,9 @@ //LAST ADDED EVENT -// ************************************************************************** +//***************************************************************************** // Snap -// ************************************************************************* +//***************************************************************************** tSnapDlg::tSnapDlg(JZPianoWindow* pPianoWindow, int* snapptr) : tPropertyListDlg("Snap:quantize cut/paste events"), @@ -631,9 +632,9 @@ } -// ************************************************************************** +//***************************************************************************** // Quantize -// ************************************************************************* +//***************************************************************************** bool tQuantizeDlg::NoteStart = 1; bool tQuantizeDlg::NoteLength = 0; @@ -641,7 +642,8 @@ int tQuantizeDlg::Delay = 0; int tQuantizeDlg::Groove = 0; -tQuantizeDlg::tQuantizeDlg(JZEventFrame *w, JZFilter *f) +//tQuantizeDlg::tQuantizeDlg(JZEventFrame *w, JZFilter *f) +tQuantizeDlg::tQuantizeDlg(JZEventWindow *w, JZFilter *f) : tPropertyListDlg("Quantize" ) //, Steps("steps", gQntSteps, &gQntStep) { @@ -701,9 +703,9 @@ } -// *********************************************************************** +//***************************************************************************** // Event-Dialogue -// *********************************************************************** +//***************************************************************************** class tEventDlg : public tPropertyListDlg { @@ -1440,3 +1442,51 @@ } } +//***************************************************************************** +// 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->GetSong()->GetIntroLength(); + mpEventWindow->GetSong()->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 2009-01-22 02:24:58 UTC (rev 697) +++ trunk/jazz/src/Dialogs.h 2009-02-16 05:03:58 UTC (rev 698) @@ -238,7 +238,7 @@ long Quantize(long); - tQuantizeDlg(JZEventFrame *w, JZFilter *f); + tQuantizeDlg(JZEventWindow* w, JZFilter* pFilter); void AddProperties(); //tNamedChoice Steps; bool OnClose(); @@ -253,4 +253,25 @@ 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 2009-01-22 02:24:58 UTC (rev 697) +++ trunk/jazz/src/EventFrame.cpp 2009-02-16 05:03:58 UTC (rev 698) @@ -23,8 +23,8 @@ //----------------------------------------------------------------------------- BEGIN_EVENT_TABLE(JZEventFrame, wxFrame) - EVT_UPDATE_UI(ID_SHIFT, JZEventFrame::OnUpdateEditShift) - EVT_MENU(ID_SHIFT, JZEventFrame::OnEditShift) + EVT_UPDATE_UI(ID_SHIFT, JZEventFrame::OnUpdateEventsSelected) + EVT_MENU(ID_SHIFT, JZEventFrame::OnShift) END_EVENT_TABLE() @@ -47,7 +47,6 @@ mEventsHeight(0), SnapSel(0), MouseAction(0), - mpSettingsDialog(0), MixerForm(0), mpToolBar(0), mpEventWindow(0) @@ -189,7 +188,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZEventFrame::OnUpdateEditShift(wxUpdateUIEvent& Event) +void JZEventFrame::OnUpdateEventsSelected(wxUpdateUIEvent& Event) { if (mpEventWindow) { @@ -203,7 +202,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZEventFrame::OnEditShift(wxCommandEvent& Event) +void JZEventFrame::OnShift(wxCommandEvent& Event) { if (mpEventWindow) { @@ -215,118 +214,123 @@ //----------------------------------------------------------------------------- void JZEventFrame::OnQuantize(wxCommandEvent& Event) { - if (!mpEventWindow || !mpEventWindow->AreEventsSelected()) + if (mpEventWindow) { - return; + mpEventWindow->Quantize(); } - - // wxDialogBox *panel = new wxDialogBox(this, "Quantize", FALSE ); - tQuantizeDlg * dlg = new tQuantizeDlg(this, mpFilter); - dlg->Create(); } //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZEventFrame::MenCleanup() +void JZEventFrame::OnSetChannel(wxCommandEvent& Event) { if (!mpEventWindow || !mpEventWindow->AreEventsSelected()) { return; } - tCleanupDlg * dlg = new tCleanupDlg(this, mpFilter); + tSetChannelDlg * dlg = new tSetChannelDlg(mpFilter); dlg->Create(); } //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZEventFrame::MenSearchReplace() +void JZEventFrame::OnTranspose(wxCommandEvent& Event) { if (!mpEventWindow || !mpEventWindow->AreEventsSelected()) { return; } - tSearchReplaceDlg * dlg = new tSearchReplaceDlg(this, mpFilter); + tTransposeDlg * dlg = new tTransposeDlg(this, mpFilter); dlg->Create(); } //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZEventFrame::MenSetChannel() +void JZEventFrame::OnDelete(wxCommandEvent& Event) { if (!mpEventWindow || !mpEventWindow->AreEventsSelected()) { return; } - tSetChannelDlg * dlg = new tSetChannelDlg(mpFilter); + tDeleteDlg * dlg = new tDeleteDlg(this, mpFilter); dlg->Create(); } //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZEventFrame::MenTranspose() +void JZEventFrame::OnVelocity(wxCommandEvent& Event) { if (!mpEventWindow || !mpEventWindow->AreEventsSelected()) { return; } - tTransposeDlg * dlg = new tTransposeDlg(this, mpFilter); + tVelocityDlg * dlg = new tVelocityDlg(mpFilter); dlg->Create(); } //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZEventFrame::MenDelete() +void JZEventFrame::OnLength(wxCommandEvent& Event) { if (!mpEventWindow || !mpEventWindow->AreEventsSelected()) { return; } - tDeleteDlg * dlg = new tDeleteDlg(this, mpFilter); + tLengthDlg * dlg = new tLengthDlg(this, mpFilter); dlg->Create(); } //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZEventFrame::MenVelocity() +void JZEventFrame::OnConvertToModulation(wxCommandEvent& Event) { if (!mpEventWindow || !mpEventWindow->AreEventsSelected()) { return; } - tVelocityDlg * dlg = new tVelocityDlg(mpFilter); - dlg->Create(); + tCmdConvertToModulation cmd(mpFilter); + cmd.Execute(); + Redraw(); } //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZEventFrame::MenLength() +void JZEventFrame::OnCleanup(wxCommandEvent& Event) { if (!mpEventWindow || !mpEventWindow->AreEventsSelected()) { return; } - tLengthDlg * dlg = new tLengthDlg(this, mpFilter); + tCleanupDlg * dlg = new tCleanupDlg(this, mpFilter); dlg->Create(); } //----------------------------------------------------------------------------- -// convert to modulation //----------------------------------------------------------------------------- -void JZEventFrame::MenConvertToModulation() +void JZEventFrame::OnSearchReplace(wxCommandEvent& Event) { if (!mpEventWindow || !mpEventWindow->AreEventsSelected()) { return; } - tCmdConvertToModulation cmd(mpFilter); - cmd.Execute(); - Redraw(); + tSearchReplaceDlg * dlg = new tSearchReplaceDlg(this, mpFilter); + dlg->Create(); } + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZEventFrame::OnMeterChange(wxCommandEvent& Event) +{ + if (mpEventWindow) + { + mpEventWindow->EditMeter(); + } +} Modified: trunk/jazz/src/EventFrame.h =================================================================== --- trunk/jazz/src/EventFrame.h 2009-01-22 02:24:58 UTC (rev 697) +++ trunk/jazz/src/EventFrame.h 2009-02-16 05:03:58 UTC (rev 698) @@ -85,9 +85,6 @@ JZSnapSelection* SnapSel; tMouseAction* MouseAction; - // Settings-Dialog - wxDialog* mpSettingsDialog; - // Mixer-Dialog wxDialog* MixerForm; @@ -95,23 +92,34 @@ bool OnCharHook(wxKeyEvent& Event); - void OnUpdateEditShift(wxUpdateUIEvent& Event); - void OnEditShift(wxCommandEvent& Event); + void OnUpdateEventsSelected(wxUpdateUIEvent& Event); + void OnShift(wxCommandEvent& Event); + void OnQuantize(wxCommandEvent& Event); - void MenSetChannel(); - void MenTranspose(); - void MenDelete(); - void MenVelocity(); - void MenLength(); - void MenSeqLength(); - void MenMidiDelay(); - void MenConvertToModulation(); - void MenCleanup(); - void MenSearchReplace(); - void MenMeterChange(); + void OnSetChannel(wxCommandEvent& Event); + void OnTranspose(wxCommandEvent& Event); + + void OnDelete(wxCommandEvent& Event); + + void OnVelocity(wxCommandEvent& Event); + + void OnLength(wxCommandEvent& Event); + +// void OnSeqLength(wxCommandEvent& Event); + +// void OnMidiDelay(wxCommandEvent& Event); + + void OnConvertToModulation(wxCommandEvent& Event); + + void OnCleanup(wxCommandEvent& Event); + + void OnSearchReplace(wxCommandEvent& Event); + + void OnMeterChange(wxCommandEvent& Event); + protected: JZToolBar* mpToolBar; Modified: trunk/jazz/src/EventWindow.cpp =================================================================== --- trunk/jazz/src/EventWindow.cpp 2009-01-22 02:24:58 UTC (rev 697) +++ trunk/jazz/src/EventWindow.cpp 2009-02-16 05:03:58 UTC (rev 698) @@ -24,6 +24,7 @@ #include "Command.h" #include "Dialogs/ShiftDialog.h" +#include "Dialogs.h" #include "EventFrame.h" #include "Filter.h" #include "MouseAction.h" @@ -80,7 +81,8 @@ mFromLine(0), mToLine(0), mScrolledX(0), - mScrolledY(0) + mScrolledY(0), + mpSettingsDialog(0) { mpSnapSel = new JZSnapSelection(this); @@ -103,6 +105,7 @@ delete mpFilter; delete mpGreyColor; delete mpGreyBrush; + FinishMeterEdit(); } //----------------------------------------------------------------------------- @@ -149,17 +152,65 @@ //----------------------------------------------------------------------------- // Quantize selected events. //----------------------------------------------------------------------------- -//void JZEventWindow::Quantize() -//{ -// if (AreEventsSelected()) -// { +void JZEventWindow::Quantize() +{ + if (AreEventsSelected()) + { +// wxDialogBox *panel = new wxDialogBox(this, "Quantize", FALSE ); + tQuantizeDlg* pQuantizeDlg = new tQuantizeDlg(this, mpFilter); + pQuantizeDlg->Create(); + // tCmdQuantize QuantizeCommand(mpFilter, SnapClocks(), 0, 0); // QuantizeCommand.Execute(1); // JZProjectManager::Instance()->UpdateAllViews(); -// } -//} + } +} //----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +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(); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +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 @@ -373,7 +424,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -// void JZEventFrame::OnChar(wxKeyEvent& KeyEvent) +// void JZEventWindow::OnChar(wxKeyEvent& KeyEvent) // { // if (!OnKeyEvent(KeyEvent)) // { @@ -387,88 +438,3 @@ //{ // return EventWin->OnKeyEvent(KeyEvent); //} - -//***************************************************************************** -// MeterChange Dialog -//***************************************************************************** -class tMeterChangeDlg : public tPropertyListDlg -{ - public: - JZEventFrame *EventWin; - static int Numerator; - static int Denomiator; - static int BarNr; - tMeterChangeDlg(JZEventFrame *w); - void AddProperties(); - virtual bool OnClose(); - virtual void OnCancel(); - virtual void OnHelp(); -}; - -int tMeterChangeDlg::Numerator = 4; -int tMeterChangeDlg::Denomiator = 4; -int tMeterChangeDlg::BarNr = 1; - -tMeterChangeDlg::tMeterChangeDlg(JZEventFrame *w) - : tPropertyListDlg("Meter Change") -{ - EventWin = w; -} - -void tMeterChangeDlg::OnCancel() -{ - EventWin->mpSettingsDialog = 0; - //wxForm::OnCancel(); -} - -bool tMeterChangeDlg::OnClose() -{ - BarNr += EventWin->Song->GetIntroLength(); - EventWin->Song->SetMeterChange(BarNr, Numerator, Denomiator); - EventWin->Redraw(); - EventWin->mpSettingsDialog = 0; - //wxForm::OnOk(); - return false; -} - -void tMeterChangeDlg::OnHelp() -{ - gpHelpInstance->ShowTopic("Meterchange"); -} - -void tMeterChangeDlg::AddProperties() -{ - // Add(wxMakeFormShort("BarNr:", &BarNr, wxFORM_DEFAULT, 0,0,0,100)); -// Add(wxMakeFormNewLine()); -// Add(wxMakeFormShort("Numerator", &Numerator, wxFORM_DEFAULT, 0,0,0,100)); -// Add(wxMakeFormNewLine()); -// Add(wxMakeFormShort("Denomiator", &Denomiator, wxFORM_DEFAULT, 0,0,0,100)); -// Add(wxMakeFormNewLine()); -// Add(wxMakeFormMessage("Supported Denomiators: 2,4,8,16,32")); -// AssociatePanel(panel); - 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 JZEventFrame::MenMeterChange() -{ - tMeterChangeDlg *dlg; - if (mpSettingsDialog) - { - mpSettingsDialog->Show(TRUE); - return; - } - // mpSettingsDialog = new wxDialogBox(this, "MeterChange", FALSE ); - dlg = new tMeterChangeDlg(this); - dlg->Create(); -} Modified: trunk/jazz/src/EventWindow.h =================================================================== --- trunk/jazz/src/EventWindow.h 2009-01-22 02:24:58 UTC (rev 697) +++ trunk/jazz/src/EventWindow.h 2009-02-16 05:03:58 UTC (rev 698) @@ -28,6 +28,7 @@ class JZFilter; class JZSnapSelection; class JZSong; +class wxDialog; //***************************************************************************** // Description: @@ -55,8 +56,12 @@ void Shift(int Units); -// void Quantize(); + void Quantize(); + void EditMeter(); + bool IsEditingMeter() const; + void FinishMeterEdit(); + void LineText( wxDC& Dc, int x, @@ -120,6 +125,9 @@ int mScrolledX, mScrolledY; + // Settings-Dialog + wxDialog* mpSettingsDialog; + // DECLARE_EVENT_TABLE() }; Modified: trunk/jazz/src/Makefile.am =================================================================== --- trunk/jazz/src/Makefile.am 2009-01-22 02:24:58 UTC (rev 697) +++ trunk/jazz/src/Makefile.am 2009-02-16 05:03:58 UTC (rev 698) @@ -29,6 +29,7 @@ Dialogs/ShiftDialog.cpp \ Dialogs/SynthesizerSettingsDialog.cpp \ Dialogs/TrackDialog.cpp \ +Dialogs/VelocityDialog.cpp \ Dialogs.cpp \ DynamicArray.cpp \ ErrorMessage.cpp \ Modified: trunk/jazz/src/PianoFrame.cpp =================================================================== --- trunk/jazz/src/PianoFrame.cpp 2009-01-22 02:24:58 UTC (rev 697) +++ trunk/jazz/src/PianoFrame.cpp 2009-02-16 05:03:58 UTC (rev 698) @@ -54,7 +54,6 @@ #define ACT_SETTINGS 5 #define MEN_FILTER 6 -#define MEN_METERCH 8 #define ACT_HELP_MOUSE 9 #define MEN_SETCHAN 14 @@ -186,16 +185,16 @@ EVT_MENU(MEN_CTRL_CHANNEL_AFTER, JZPianoFrame::CtrlChannelAftertouchEdit) // FIXME PAT - We need to bring these back once Dave has figured out what // he's doing with them in relation to the track window. -// EVT_MENU(MEN_CLEANUP, JZPianoFrame::MenCleanup) -// EVT_MENU(MEN_SEARCHREP, JZPianoFrame::MenSearchReplace) -// EVT_MENU(MEN_TRANSP, JZPianoFrame::MenTranspose) -// EVT_MENU(MEN_SETCHAN, JZPianoFrame::MenSetChannel) +// EVT_MENU(MEN_CLEANUP, JZPianoFrame::OnCleanup) +// EVT_MENU(MEN_SEARCHREP, JZPianoFrame::OnSearchReplace) +// EVT_MENU(MEN_TRANSP, JZPianoFrame::OnTranspose) +// EVT_MENU(MEN_SETCHAN, JZPianoFrame::OnSetChannel) EVT_MENU(ID_VELOCITY, JZPianoFrame::OnActivateVelocityDialog) -// EVT_MENU(MEN_LENGTH, JZPianoFrame::MenLength) +// EVT_MENU(MEN_LENGTH, JZPianoFrame::OnLength) EVT_MENU(MEN_MIDIDELAY, JZPianoFrame::OnActivateMidiDelayDialog) EVT_MENU(MEN_SEQLENGTH, JZPianoFrame::OnActivateSequenceLengthDialog) -// EVT_MENU(MEN_CONVERT_TO_MODULATION, JZPianoFrame::MenConvertToModulation) +// EVT_MENU(MEN_CONVERT_TO_MODULATION, JZPianoFrame::OnnConvertToModulation) EVT_MENU(ACT_SETTINGS, JZPianoFrame::OnActivateSettingsDialog) EVT_MENU(MEN_FILTER, JZPianoFrame::OnFilter) EVT_MENU(ID_SNAP, JZPianoFrame::OnSnapDlg) @@ -346,12 +345,12 @@ edit_menu->Append(MEN_CLEANUP, "&Cleanup..."); edit_menu->Append(MEN_SEARCHREP, "&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(MEN_METERCH, "&Meterchange..."); + 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..."); wxMenu *misc_menu = new wxMenu("",wxMENU_TEAROFF); misc_menu->Append(wxID_UNDO, "&Undo"); @@ -514,7 +513,7 @@ case MEN_VISIBLE: VisibleDialog(); break; -case MEN_METERCH: MenMeterChange(); break; +case ID_METER_CHANGE: OnMeterChange(); break; */ Modified: trunk/jazz/src/PianoWindow.cpp =================================================================== --- trunk/jazz/src/PianoWindow.cpp 2009-01-22 02:24:58 UTC (rev 697) +++ trunk/jazz/src/PianoWindow.cpp 2009-02-16 05:03:58 UTC (rev 698) @@ -2017,12 +2017,12 @@ { SnapSelStart(Event); - if (mpSnapSel->IsSelected()) - { +// if (mpSnapSel->IsSelected()) +// { // Redraw the whole window instead (inefficient, we should rather // invalidate a rect). Refresh(); - } +// } mpSnapSel->Event(Event); mpMouseAction = mpSnapSel; } Modified: trunk/jazz/src/Resources.h =================================================================== --- trunk/jazz/src/Resources.h 2009-01-22 02:24:58 UTC (rev 697) +++ trunk/jazz/src/Resources.h 2009-02-16 05:03:58 UTC (rev 698) @@ -59,6 +59,8 @@ #define ID_METRONOME_TOGGLE wxID_HIGHEST + 42 #define ID_VELOCITY wxID_HIGHEST + 43 +#define ID_METER_CHANGE wxID_HIGHEST + 45 + #define ID_PLAY wxID_HIGHEST + 50 #define ID_PLAY_LOOP wxID_HIGHEST + 51 #define ID_RECORD wxID_HIGHEST + 52 Modified: trunk/jazz/src/TrackFrame.cpp =================================================================== --- trunk/jazz/src/TrackFrame.cpp 2009-01-22 02:24:58 UTC (rev 697) +++ trunk/jazz/src/TrackFrame.cpp 2009-02-16 05:03:58 UTC (rev 698) @@ -268,18 +268,18 @@ // 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(MEN_METERCH, "&Meterchange..."); - 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..."); + 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..."); #endif mpToolsMenu = new wxMenu; Modified: trunk/jazz/vc8/JazzPlusPlus-VC8.vcproj =================================================================== --- trunk/jazz/vc8/JazzPlusPlus-VC8.vcproj 2009-01-22 02:24:58 UTC (rev 697) +++ trunk/jazz/vc8/JazzPlusPlus-VC8.vcproj 2009-02-16 05:03:58 UTC (rev 698) @@ -890,6 +890,14 @@ RelativePath="..\src\Dialogs\TrackDialog.h" > </File> + <File + RelativePath="..\src\Dialogs\VelocityDialog.cpp" + > + </File> + <File + RelativePath="..\src\Dialogs\VelocityDialog.h" + > + </File> </Filter> </Files> <Globals> Modified: trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj =================================================================== --- trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj 2009-01-22 02:24:58 UTC (rev 697) +++ trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj 2009-02-16 05:03:58 UTC (rev 698) @@ -908,6 +908,14 @@ RelativePath="..\src\Dialogs\TrackDialog.h" > </File> + <File + RelativePath="..\src\Dialogs\VelocityDialog.cpp" + > + </File> + <File + RelativePath="..\src\Dialogs\VelocityDialog.h" + > + </File> </Filter> </Files> <Globals> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2009-01-22 02:25:04
|
Revision: 697 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=697&view=rev Author: pstieber Date: 2009-01-22 02:24:58 +0000 (Thu, 22 Jan 2009) Log Message: ----------- Prefixed data member with m. Modified Paths: -------------- trunk/jazz/src/AlsaPlayer.cpp Modified: trunk/jazz/src/AlsaPlayer.cpp =================================================================== --- trunk/jazz/src/AlsaPlayer.cpp 2009-01-21 06:04:36 UTC (rev 696) +++ trunk/jazz/src/AlsaPlayer.cpp 2009-01-22 02:24:58 UTC (rev 697) @@ -813,7 +813,7 @@ stop_queue_timer(); clear_input_queue(); JZProjectManager::Instance()->NewPlayPosition(-1); - RecdBuffer.Keyoff2Length(); + mRecdBuffer.Keyoff2Length(); } //----------------------------------------------------------------------------- @@ -924,7 +924,7 @@ // Not all events are to be recorded. Only those filtered out and put // into the event. pEvent->SetClock(PlayLoop->Ext2IntClock(ev->time.tick)); - RecdBuffer.Put(pEvent); + mRecdBuffer.Put(pEvent); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2009-01-21 06:04:41
|
Revision: 696 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=696&view=rev Author: pstieber Date: 2009-01-21 06:04:36 +0000 (Wed, 21 Jan 2009) Log Message: ----------- 1. Updated some resource IDs. 2. Continued with the event frame cleanup. Modified Paths: -------------- trunk/jazz/src/EventFrame.cpp trunk/jazz/src/EventFrame.h trunk/jazz/src/EventWindow.cpp trunk/jazz/src/EventWindow.h trunk/jazz/src/PianoFrame.cpp trunk/jazz/src/Resources.h trunk/jazz/src/TrackFrame.cpp Modified: trunk/jazz/src/EventFrame.cpp =================================================================== --- trunk/jazz/src/EventFrame.cpp 2009-01-20 15:03:32 UTC (rev 695) +++ trunk/jazz/src/EventFrame.cpp 2009-01-21 06:04:36 UTC (rev 696) @@ -47,7 +47,6 @@ mEventsHeight(0), SnapSel(0), MouseAction(0), - PlayClock(-1), mpSettingsDialog(0), MixerForm(0), mpToolBar(0), @@ -56,6 +55,8 @@ mpFilter = new JZFilter(Song); } +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- JZEventFrame::~JZEventFrame() { delete SnapSel; @@ -81,104 +82,45 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZEventFrame::OnUpdateEditShift(wxUpdateUIEvent& Event) +void JZEventFrame::SnapSelStart(wxMouseEvent& MouseEvent) { - if (mpEventWindow) - { - Event.Enable(mpEventWindow->AreEventsSelected()); - } - else - { - Event.Enable(false); - } } //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZEventFrame::OnEditShift(wxCommandEvent& Event) +void JZEventFrame::SnapSelStop(wxMouseEvent& MouseEvent) { - if (mpEventWindow) - { - mpEventWindow->Shift(16); - } } //----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -bool JZEventFrame::OnCharHook(wxKeyEvent& e) -{ - return OnKeyEvent(e); -} - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -//int JZEventFrame::y2Line(int y, bool Up) -//{ -// if (Up) -// { -// y += mTrackHeight; -// } -// y -= mTopInfoHeight; -// return y / mTrackHeight; -//} - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -//int JZEventFrame::Line2y(int Line) -//{ -// return Line * mTrackHeight + mTopInfoHeight; -//} - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -void JZEventFrame::Redraw() -{ -// wxDC* dc=new wxClientDC(this); -// wxPaintEvent e; -// cout<<"FIXME JZEventFrame::Redraw"<<endl; -// mpEventWindow->OnDraw(*dc); //this will in turn call the eventwin onpaintsub -// // the problem is that onpaint no longer takes arguments, and is supposed -// // to be called from the framework only, so it should be split. -// delete dc; - -// if (mpEventWindow) -// { -// mpEventWindow->Refresh(); -// } -} - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -bool JZEventFrame::OnKeyEvent(wxKeyEvent &e) -{ - return false; -} - -//----------------------------------------------------------------------------- // seems to handle the "selection" rectangle. normally called from the base // class onmouseevent handler //----------------------------------------------------------------------------- -int JZEventFrame::OnMouseEvent(wxMouseEvent &e) +int JZEventFrame::OnMouseEvent(wxMouseEvent& MouseEvent) { - // cout <<"JZEventFrame::OnMouseEvent"<<endl; +// cout << "JZEventFrame::OnMouseEvent" << endl; if (!MouseAction) { // create SnapSel? int x; int y; - e.GetPosition(&x, &y); - if (mEventsX < x && x < mEventsX + mEventsWidth && mEventsY < y && y < mEventsY + mEventsHeight) + MouseEvent.GetPosition(&x, &y); + if ( + mEventsX < x && + x < mEventsX + mEventsWidth && + mEventsY < y && + y < mEventsY + mEventsHeight) { - if (e.LeftDown()) + if (MouseEvent.LeftDown()) { { - SnapSelStart(e); + SnapSelStart(MouseEvent); if (SnapSel->IsSelected()) { Refresh(); //redraw the whole window instead(inefficient, we should rather invalidate a rect) } - SnapSel->Event(e); + SnapSel->Event(MouseEvent); MouseAction = SnapSel; } } @@ -188,13 +130,13 @@ { // MouseAction active - if (MouseAction->Event(e)) + if (MouseAction->Event(MouseEvent)) { // MouseAction finished if (MouseAction == SnapSel) { - SnapSelStop(e); + SnapSelStop(MouseEvent); Redraw(); //ineficcient, invalidate rect first instead MouseAction = 0; return 1; @@ -208,36 +150,74 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- +bool JZEventFrame::OnKeyEvent(wxKeyEvent& KeyEvent) +{ + return false; +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- bool JZEventFrame::OnClose() { - return FALSE; + return false; } //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZEventFrame::OnMenuCommand(int) +void JZEventFrame::Redraw() { +// wxDC* dc=new wxClientDC(this); +// wxPaintEvent PaintEvent; +// cout<<"FIXME JZEventFrame::Redraw"<<endl; +// mpEventWindow->OnDraw(*dc); //this will in turn call the eventwin onpaintsub +// // the problem is that onpaint no longer takes arguments, and is supposed +// // to be called from the framework only, so it should be split. +// delete dc; + +// if (mpEventWindow) +// { +// mpEventWindow->Refresh(); +// } } //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZEventFrame::SnapSelStart(wxMouseEvent& MouseEvent) +bool JZEventFrame::OnCharHook(wxKeyEvent& KeyEvent) { + return OnKeyEvent(KeyEvent); } //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZEventFrame::SnapSelStop(wxMouseEvent& MouseEvent) +void JZEventFrame::OnUpdateEditShift(wxUpdateUIEvent& Event) { + if (mpEventWindow) + { + Event.Enable(mpEventWindow->AreEventsSelected()); + } + else + { + Event.Enable(false); + } } //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZEventFrame::MenQuantize() +void JZEventFrame::OnEditShift(wxCommandEvent& Event) { + if (mpEventWindow) + { + mpEventWindow->Shift(16); + } +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZEventFrame::OnQuantize(wxCommandEvent& Event) +{ if (!mpEventWindow || !mpEventWindow->AreEventsSelected()) { - return; + return; } // wxDialogBox *panel = new wxDialogBox(this, "Quantize", FALSE ); Modified: trunk/jazz/src/EventFrame.h =================================================================== --- trunk/jazz/src/EventFrame.h 2009-01-20 15:03:32 UTC (rev 695) +++ trunk/jazz/src/EventFrame.h 2009-01-21 06:04:36 UTC (rev 696) @@ -57,50 +57,49 @@ virtual ~JZEventFrame(); - JZSong* Song; - - JZFilter* mpFilter; - virtual void SetEventWindow(JZEventWindow* pEventWindow); - int mTopInfoHeight; - - int mEventsX, mEventsY, mEventsWidth, mEventsHeight; - - // Mouse handling - JZSnapSelection* SnapSel; - tMouseAction* MouseAction; virtual void SnapSelStart(wxMouseEvent &e); virtual void SnapSelStop(wxMouseEvent &e); - int PlayClock; - // Events virtual int OnMouseEvent(wxMouseEvent& Event); virtual bool OnKeyEvent(wxKeyEvent& Event); // true = processed by eventwin - virtual void OnMenuCommand(int id); virtual bool OnClose(); // Redraw - nach Aenderungen von Parametern, kein GUI-Event virtual void Redraw(); + + + + JZSong* Song; + + JZFilter* mpFilter; + + int mTopInfoHeight; + + int mEventsX, mEventsY, mEventsWidth, mEventsHeight; + + // Mouse handling + JZSnapSelection* SnapSel; + tMouseAction* MouseAction; + // Settings-Dialog wxDialog* mpSettingsDialog; - void SettingsDialog(int piano); // Mixer-Dialog wxDialog* MixerForm; private: + bool OnCharHook(wxKeyEvent& Event); + void OnUpdateEditShift(wxUpdateUIEvent& Event); void OnEditShift(wxCommandEvent& Event); - bool OnCharHook(wxKeyEvent& Event); + void OnQuantize(wxCommandEvent& Event); - void OnChar(wxKeyEvent& Event); - - void MenQuantize(); void MenSetChannel(); void MenTranspose(); void MenDelete(); Modified: trunk/jazz/src/EventWindow.cpp =================================================================== --- trunk/jazz/src/EventWindow.cpp 2009-01-20 15:03:32 UTC (rev 695) +++ trunk/jazz/src/EventWindow.cpp 2009-01-21 06:04:36 UTC (rev 696) @@ -147,6 +147,19 @@ } //----------------------------------------------------------------------------- +// Quantize selected events. +//----------------------------------------------------------------------------- +//void JZEventWindow::Quantize() +//{ +// if (AreEventsSelected()) +// { +// tCmdQuantize QuantizeCommand(mpFilter, SnapClocks(), 0, 0); +// QuantizeCommand.Execute(1); +// JZProjectManager::Instance()->UpdateAllViews(); +// } +//} + +//----------------------------------------------------------------------------- // 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 2009-01-20 15:03:32 UTC (rev 695) +++ trunk/jazz/src/EventWindow.h 2009-01-21 06:04:36 UTC (rev 696) @@ -55,6 +55,8 @@ void Shift(int Units); +// void Quantize(); + void LineText( wxDC& Dc, int x, Modified: trunk/jazz/src/PianoFrame.cpp =================================================================== --- trunk/jazz/src/PianoFrame.cpp 2009-01-20 15:03:32 UTC (rev 695) +++ trunk/jazz/src/PianoFrame.cpp 2009-01-21 06:04:36 UTC (rev 696) @@ -54,14 +54,11 @@ #define ACT_SETTINGS 5 #define MEN_FILTER 6 -#define MEN_SNAP 7 #define MEN_METERCH 8 #define ACT_HELP_MOUSE 9 -#define MEN_QUANTIZE 12 #define MEN_SETCHAN 14 #define MEN_TRANSP 15 -#define MEN_VELOC 16 #define MEN_LERI 18 #define MEN_UPDN 19 #define MEN_LENGTH 20 @@ -81,8 +78,6 @@ #define MEN_RESET 36 #define MEN_VIS_ALL_TRK 37 #define MEN_SEARCHREP 38 -#define MEN_SHIFTL 39 -#define MEN_SHIFTR 40 #define ACT_CLOSE 41 #define MEN_CTRL_TEMPO 42 @@ -110,10 +105,10 @@ { ID_SNAP_16D, TRUE, note163_xpm, "snap 1/24"}, { JZToolBar::eToolBarSeparator }, { wxID_CUT, FALSE, cut_xpm, "cut selection"}, - { wxID_DELETE, FALSE, delete_xpm, "delete selection"}, - { MEN_QUANTIZE, FALSE, quantize_xpm, "quantize selection"}, - { MEN_SHIFTL, FALSE, shiftl_xpm, "shift selection left"}, - { MEN_SHIFTR, FALSE, shiftr_xpm, "shift selection right"}, + { wxID_DELETE, FALSE, delete_xpm, "delete selection"}, + { ID_QUANTIZE, FALSE, quantize_xpm, "quantize selection"}, + { ID_SHIFT_LEFT, FALSE, shiftl_xpm, "shift selection left"}, + { ID_SHIFT_RIGHT, FALSE, shiftr_xpm, "shift selection right"}, { MEN_VIS_ALL_TRK, TRUE, evnts_xpm, "show events from all tracks"}, { JZToolBar::eToolBarSeparator }, { wxID_ZOOM_IN, FALSE, zoomin_xpm, "zoom in"}, @@ -174,11 +169,11 @@ EVT_MENU(wxID_CUT, JZPianoFrame::OnCut) EVT_MENU(wxID_COPY, JZPianoFrame::OnCopy) EVT_MENU(ID_SHIFT, JZPianoFrame::OnShift) - EVT_MENU(MEN_SHIFTL, JZPianoFrame::OnShiftLeft) - EVT_MENU(MEN_SHIFTR, JZPianoFrame::OnShiftRight) + EVT_MENU(ID_SHIFT_LEFT, JZPianoFrame::OnShiftLeft) + EVT_MENU(ID_SHIFT_RIGHT, JZPianoFrame::OnShiftRight) EVT_MENU(MEN_LERI, JZPianoFrame::OnExchangeLeftRight) EVT_MENU(MEN_UPDN, JZPianoFrame::OnExchangeUpDown) - EVT_MENU(MEN_QUANTIZE, JZPianoFrame::OnQuantize) + EVT_MENU(ID_QUANTIZE, JZPianoFrame::OnQuantize) EVT_MENU(wxID_UNDO, JZPianoFrame::OnUndo) EVT_MENU(wxID_REDO, JZPianoFrame::OnRedo) EVT_MENU(MEN_CTRL_PITCH, JZPianoFrame::OnCtrlPitch) @@ -195,7 +190,7 @@ // EVT_MENU(MEN_SEARCHREP, JZPianoFrame::MenSearchReplace) // EVT_MENU(MEN_TRANSP, JZPianoFrame::MenTranspose) // EVT_MENU(MEN_SETCHAN, JZPianoFrame::MenSetChannel) - EVT_MENU(MEN_VELOC, JZPianoFrame::OnActivateVelocityDialog) + EVT_MENU(ID_VELOCITY, JZPianoFrame::OnActivateVelocityDialog) // EVT_MENU(MEN_LENGTH, JZPianoFrame::MenLength) EVT_MENU(MEN_MIDIDELAY, JZPianoFrame::OnActivateMidiDelayDialog) EVT_MENU(MEN_SEQLENGTH, JZPianoFrame::OnActivateSequenceLengthDialog) @@ -203,7 +198,7 @@ // EVT_MENU(MEN_CONVERT_TO_MODULATION, JZPianoFrame::MenConvertToModulation) EVT_MENU(ACT_SETTINGS, JZPianoFrame::OnActivateSettingsDialog) EVT_MENU(MEN_FILTER, JZPianoFrame::OnFilter) - EVT_MENU(MEN_SNAP, JZPianoFrame::OnSnapDlg) + EVT_MENU(ID_SNAP, JZPianoFrame::OnSnapDlg) // These are all "Patrick Approved" EVT_CLOSE(JZPianoFrame::ActCloseEvent) @@ -336,10 +331,10 @@ edit_menu->Append(wxID_COPY, "&Copy"); edit_menu->Append(wxID_CUT, "&Cut"); edit_menu->Append(ID_SHIFT, "&Shift..."); - edit_menu->Append(MEN_QUANTIZE, "&Quantize..."); + edit_menu->Append(ID_QUANTIZE, "&Quantize..."); edit_menu->Append(MEN_SETCHAN, "&Set MIDI Channel..."); edit_menu->Append(MEN_TRANSP, "&Transpose..."); - edit_menu->Append(MEN_VELOC, "&Velocity..."); + edit_menu->Append(ID_VELOCITY, "&Velocity..."); edit_menu->Append(MEN_LENGTH, "&Length..."); edit_menu->Append(MEN_SEQLENGTH, "&Sequence Length..."); @@ -355,7 +350,7 @@ setting_menu->Append(MEN_FILTER, "&Filter..."); setting_menu->Append(ACT_SETTINGS, "&Window..."); setting_menu->Append(MEN_VISIBLE, "&Events..."); - setting_menu->Append(MEN_SNAP, "&Snap..."); + setting_menu->Append(ID_SNAP, "&Snap..."); setting_menu->Append(MEN_METERCH, "&Meterchange..."); wxMenu *misc_menu = new wxMenu("",wxMENU_TEAROFF); Modified: trunk/jazz/src/Resources.h =================================================================== --- trunk/jazz/src/Resources.h 2009-01-20 15:03:32 UTC (rev 695) +++ trunk/jazz/src/Resources.h 2009-01-21 06:04:36 UTC (rev 696) @@ -49,13 +49,15 @@ #define ID_SHIFT wxID_HIGHEST + 32 #define ID_SHIFT_LEFT wxID_HIGHEST + 33 #define ID_SHIFT_RIGHT wxID_HIGHEST + 34 -#define ID_SNAP_8 wxID_HIGHEST + 35 -#define ID_SNAP_8D wxID_HIGHEST + 36 -#define ID_SNAP_16 wxID_HIGHEST + 37 -#define ID_SNAP_16D wxID_HIGHEST + 38 -#define ID_MIXER wxID_HIGHEST + 39 -#define ID_PIANOWIN wxID_HIGHEST + 40 -#define ID_METRONOME_TOGGLE wxID_HIGHEST + 41 +#define ID_SNAP wxID_HIGHEST + 35 +#define ID_SNAP_8 wxID_HIGHEST + 36 +#define ID_SNAP_8D wxID_HIGHEST + 37 +#define ID_SNAP_16 wxID_HIGHEST + 38 +#define ID_SNAP_16D wxID_HIGHEST + 39 +#define ID_MIXER wxID_HIGHEST + 40 +#define ID_PIANOWIN wxID_HIGHEST + 41 +#define ID_METRONOME_TOGGLE wxID_HIGHEST + 42 +#define ID_VELOCITY wxID_HIGHEST + 43 #define ID_PLAY wxID_HIGHEST + 50 #define ID_PLAY_LOOP wxID_HIGHEST + 51 Modified: trunk/jazz/src/TrackFrame.cpp =================================================================== --- trunk/jazz/src/TrackFrame.cpp 2009-01-20 15:03:32 UTC (rev 695) +++ trunk/jazz/src/TrackFrame.cpp 2009-01-21 06:04:36 UTC (rev 696) @@ -238,10 +238,10 @@ mpEditMenu->AppendSeparator(); -// mpEditMenu->Append(MEN_QUANTIZE, "&Quantize..."); +// mpEditMenu->Append(ID_QUANTIZE, "&Quantize..."); // mpEditMenu->Append(MEN_SETCHAN, "&Set MIDI Channel..."); // mpEditMenu->Append(MEN_TRANSP, "&Transpose..."); -// mpEditMenu->Append(MEN_VELOC, "&Velocity..."); +// mpEditMenu->Append(ID_VELOCITY, "&Velocity..."); // mpEditMenu->Append(MEN_LENGTH, "&Length..."); mpEditMenu->Append(ID_SHIFT, "Shi&ft..."); // mpEditMenu->Append(MEN_CLEANUP, "C&leanup..."); @@ -293,7 +293,7 @@ mpFileMenu->AppendSeparator(); parts_menu = new wxMenu; - parts_menu->Append(MEN_MIXER, "&Mixer..."); + parts_menu->Append(ID_MIXER, "&Mixer..."); parts_menu->Append(MEN_MASTER, "Mas&ter..."); parts_menu->Append(MEN_SOUND, "&Sound..."); parts_menu->Append(MEN_VIBRATO, "&Vibrato..."); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2009-01-20 15:03:38
|
Revision: 695 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=695&view=rev Author: pstieber Date: 2009-01-20 15:03:32 +0000 (Tue, 20 Jan 2009) Log Message: ----------- 1. Removed more code from the event frame that now is in the event Window and started using the event window version of AreEventsSelected. 2. Changed up -> Up and made it a Boolean in JZPianoWindow::SnapClock. Modified Paths: -------------- trunk/jazz/src/EventFrame.cpp trunk/jazz/src/EventFrame.h trunk/jazz/src/PianoWindow.cpp trunk/jazz/src/PianoWindow.h Modified: trunk/jazz/src/EventFrame.cpp =================================================================== --- trunk/jazz/src/EventFrame.cpp 2009-01-20 05:51:17 UTC (rev 694) +++ trunk/jazz/src/EventFrame.cpp 2009-01-20 15:03:32 UTC (rev 695) @@ -40,39 +40,19 @@ : wxFrame(pParent, wxID_ANY, Title, Position, Size, WindowStyle), Song(pSong), mpFilter(0), - mTrackHeight(0), mTopInfoHeight(40), - FontSize(12), - ClocksPerPixel(36), mEventsX(), mEventsY(mTopInfoHeight), mEventsWidth(0), mEventsHeight(0), - CanvasX(0), - CanvasY(0), - CanvasW(0), - CanvasH(0), - FromClock(0), - ToClock(0), - FromLine(0), - ToLine(0), SnapSel(0), MouseAction(0), PlayClock(-1), mpSettingsDialog(0), MixerForm(0), mpToolBar(0), - mpGreyColor(0), - mpGreyBrush(0), mpEventWindow(0) { -#ifdef __WXMSW__ - mpGreyColor = new wxColor(192, 192, 192); -#else - mpGreyColor = new wxColor(220, 220, 220); -#endif - mpGreyBrush = new wxBrush(*mpGreyColor, wxSOLID); - mpFilter = new JZFilter(Song); } @@ -80,9 +60,6 @@ { delete SnapSel; - delete mpGreyColor; - delete mpGreyBrush; - delete mpFilter; delete mpToolBar; @@ -135,77 +112,25 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -int JZEventFrame::y2Line(int y, int up) -{ - if (up) - { - y += mTrackHeight; - } - y -= mTopInfoHeight; - return y / mTrackHeight; -} +//int JZEventFrame::y2Line(int y, bool Up) +//{ +// if (Up) +// { +// y += mTrackHeight; +// } +// y -= mTopInfoHeight; +// return y / mTrackHeight; +//} //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -int JZEventFrame::Line2y(int Line) -{ - return Line * mTrackHeight + mTopInfoHeight; -} +//int JZEventFrame::Line2y(int Line) +//{ +// return Line * mTrackHeight + mTopInfoHeight; +//} -/* //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZEventFrame::LineText(wxDC *dc, int x, int y, int w, const char *str, int h, bool down) -{ - if (h <= 0) - { - h = mTrackHeight; - y = y2yLine(y); - } - if (w && h) - { - //dc->SetBrush(wxGREY_BRUSH); - dc->SetBrush(*mpGreyBrush); - dc->SetPen(*wxGREY_PEN); - #ifdef __WXMSW__ - dc->DrawRectangle(x, y, w+1, h+1); - #else - dc->DrawRectangle(x, y, w, h); - #endif - x += 1; - y += 1; - w -= 2; - h -= 2; - if (down) - { - dc->SetPen(*wxBLACK_PEN); - dc->DrawLine(x, y, x+w, y); - dc->DrawLine(x, y, x, y+h); - dc->SetPen(*wxWHITE_PEN); - dc->DrawLine(x+w, y, x+w, y+h); - dc->DrawLine(x, y+h, x+w, y+h); - } - else - { - dc->SetPen(*wxWHITE_PEN); - dc->DrawLine(x, y, x+w, y); - dc->DrawLine(x, y, x, y+h); - dc->SetPen(*wxBLACK_PEN); - dc->DrawLine(x+w, y, x+w, y+h); - dc->DrawLine(x, y+h, x+w, y+h); - } - dc->SetPen(*wxBLACK_PEN); - x -= 2; - y -= 2; - } - dc->SetTextBackground(*mpGreyColor); - dc->DrawText((char *)str, x + mLittleBit, y + mLittleBit); - dc->SetTextBackground(*wxWHITE); -} -*/ - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- void JZEventFrame::Redraw() { // wxDC* dc=new wxClientDC(this); @@ -308,26 +233,13 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -int JZEventFrame::EventsSelected(const char* msg) +void JZEventFrame::MenQuantize() { - if (!SnapSel->IsSelected()) + if (!mpEventWindow || !mpEventWindow->AreEventsSelected()) { - if (msg == 0) - { - msg = "please select some events first"; - } - wxMessageBox((char *)msg, "Error", wxOK); - return 0; + return; } - return 1; -} -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -void JZEventFrame::MenQuantize() -{ - if (!EventsSelected()) - return; // wxDialogBox *panel = new wxDialogBox(this, "Quantize", FALSE ); tQuantizeDlg * dlg = new tQuantizeDlg(this, mpFilter); dlg->Create(); @@ -337,8 +249,11 @@ //----------------------------------------------------------------------------- void JZEventFrame::MenCleanup() { - if (!EventsSelected()) - return; + if (!mpEventWindow || !mpEventWindow->AreEventsSelected()) + { + return; + } + tCleanupDlg * dlg = new tCleanupDlg(this, mpFilter); dlg->Create(); } @@ -347,8 +262,11 @@ //----------------------------------------------------------------------------- void JZEventFrame::MenSearchReplace() { - if (!EventsSelected()) - return; + if (!mpEventWindow || !mpEventWindow->AreEventsSelected()) + { + return; + } + tSearchReplaceDlg * dlg = new tSearchReplaceDlg(this, mpFilter); dlg->Create(); } @@ -357,8 +275,11 @@ //----------------------------------------------------------------------------- void JZEventFrame::MenSetChannel() { - if (!EventsSelected()) - return; + if (!mpEventWindow || !mpEventWindow->AreEventsSelected()) + { + return; + } + tSetChannelDlg * dlg = new tSetChannelDlg(mpFilter); dlg->Create(); } @@ -367,8 +288,11 @@ //----------------------------------------------------------------------------- void JZEventFrame::MenTranspose() { - if (!EventsSelected()) - return; + if (!mpEventWindow || !mpEventWindow->AreEventsSelected()) + { + return; + } + tTransposeDlg * dlg = new tTransposeDlg(this, mpFilter); dlg->Create(); } @@ -377,8 +301,11 @@ //----------------------------------------------------------------------------- void JZEventFrame::MenDelete() { - if (!EventsSelected()) - return; + if (!mpEventWindow || !mpEventWindow->AreEventsSelected()) + { + return; + } + tDeleteDlg * dlg = new tDeleteDlg(this, mpFilter); dlg->Create(); } @@ -387,8 +314,11 @@ //----------------------------------------------------------------------------- void JZEventFrame::MenVelocity() { - if (!EventsSelected()) - return; + if (!mpEventWindow || !mpEventWindow->AreEventsSelected()) + { + return; + } + tVelocityDlg * dlg = new tVelocityDlg(mpFilter); dlg->Create(); } @@ -397,8 +327,11 @@ //----------------------------------------------------------------------------- void JZEventFrame::MenLength() { - if (!EventsSelected()) - return; + if (!mpEventWindow || !mpEventWindow->AreEventsSelected()) + { + return; + } + tLengthDlg * dlg = new tLengthDlg(this, mpFilter); dlg->Create(); } @@ -408,8 +341,11 @@ //----------------------------------------------------------------------------- void JZEventFrame::MenConvertToModulation() { - if (!EventsSelected()) - return; + if (!mpEventWindow || !mpEventWindow->AreEventsSelected()) + { + return; + } + tCmdConvertToModulation cmd(mpFilter); cmd.Execute(); Redraw(); Modified: trunk/jazz/src/EventFrame.h =================================================================== --- trunk/jazz/src/EventFrame.h 2009-01-20 05:51:17 UTC (rev 694) +++ trunk/jazz/src/EventFrame.h 2009-01-20 15:03:32 UTC (rev 695) @@ -63,27 +63,16 @@ virtual void SetEventWindow(JZEventWindow* pEventWindow); - int mTrackHeight; - int mTopInfoHeight; - int FontSize; - int ClocksPerPixel; int mEventsX, mEventsY, mEventsWidth, mEventsHeight; - int CanvasX, CanvasY, CanvasW, CanvasH; // canvas coords - int FromClock, ToClock; - int FromLine, ToLine; - // Mousehandling + // Mouse handling JZSnapSelection* SnapSel; tMouseAction* MouseAction; virtual void SnapSelStart(wxMouseEvent &e); virtual void SnapSelStop(wxMouseEvent &e); - // methods - int y2Line(int y, int up = 0); - int Line2y(int line); - int PlayClock; // Events @@ -102,11 +91,6 @@ // Mixer-Dialog wxDialog* MixerForm; - // Edit-Menu - - // if selection active: TRUE, else: Errormessage + FALSE - int EventsSelected(const char* msg = 0); - private: void OnUpdateEditShift(wxUpdateUIEvent& Event); @@ -132,8 +116,6 @@ protected: JZToolBar* mpToolBar; - wxColor* mpGreyColor; - wxBrush* mpGreyBrush; JZEventWindow* mpEventWindow; Modified: trunk/jazz/src/PianoWindow.cpp =================================================================== --- trunk/jazz/src/PianoWindow.cpp 2009-01-20 05:51:17 UTC (rev 694) +++ trunk/jazz/src/PianoWindow.cpp 2009-01-20 15:03:32 UTC (rev 695) @@ -1868,7 +1868,7 @@ void JZPianoWindow::SnapSelStart(wxMouseEvent &) { mSnapCount = 0; - int clk = SnapClock(mFromClock, 0); + int clk = SnapClock(mFromClock, false); int qnt = SnapClocks(); while (clk <= mToClock && mSnapCount < eMaxSnaps) { @@ -1891,11 +1891,11 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -int JZPianoWindow::SnapClock(int Clock, int up) +int JZPianoWindow::SnapClock(int Clock, bool Up) { int qnt = SnapClocks(); Clock -= (Clock % qnt); - if (up) + if (Up) { Clock += qnt; } Modified: trunk/jazz/src/PianoWindow.h =================================================================== --- trunk/jazz/src/PianoWindow.h 2009-01-20 05:51:17 UTC (rev 694) +++ trunk/jazz/src/PianoWindow.h 2009-01-20 15:03:32 UTC (rev 695) @@ -113,7 +113,7 @@ void SnapSelStart(wxMouseEvent& Event); - int SnapClock(int Clock, int up = 0); + int SnapClock(int Clock, bool Up = false); void SnapSelStop(wxMouseEvent& Event); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2009-01-20 05:51:24
|
Revision: 694 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=694&view=rev Author: pstieber Date: 2009-01-20 05:51:17 +0000 (Tue, 20 Jan 2009) Log Message: ----------- 1. Changed Destin to pDestin in JZSong. 2. Changed buf to pEventArray in JZPlayer. 3. Added mPlayBuffer.Clear() and mRecdBuffer.Clear() calls to ~JZPlayer. 4. Prefixed several JZTrack data members with mp. 5. Fixed a leak of end-of-track events in tSimpleEventArray::RemoveEOT. Modified Paths: -------------- trunk/jazz/src/Player.cpp trunk/jazz/src/Player.h trunk/jazz/src/Song.cpp trunk/jazz/src/Track.cpp trunk/jazz/src/Track.h trunk/jazz/src/TrackWindow.cpp Modified: trunk/jazz/src/Player.cpp =================================================================== --- trunk/jazz/src/Player.cpp 2009-01-20 05:45:55 UTC (rev 693) +++ trunk/jazz/src/Player.cpp 2009-01-20 05:51:17 UTC (rev 694) @@ -136,13 +136,13 @@ // Copy events from the passed song to output buffer. //----------------------------------------------------------------------------- void tPlayLoop::PrepareOutput( - tEventArray* buf, + tEventArray* pEventArray, JZSong* pSong, long ExtFr, long ExtTo, int Mode) { - if (buf == 0) + if (pEventArray == 0) { return; } @@ -155,7 +155,7 @@ pSong->MergeTracks( From, mStopClock, - buf, + pEventArray, gpProject->GetMetronomeInfo(), Delta, Mode); @@ -170,7 +170,7 @@ pSong->MergeTracks( From, From + Size, - buf, + pEventArray, gpProject->GetMetronomeInfo(), Delta, Mode); @@ -199,6 +199,8 @@ JZPlayer::~JZPlayer() { delete PlayLoop; + mPlayBuffer.Clear(); + mRecdBuffer.Clear(); } //----------------------------------------------------------------------------- @@ -229,7 +231,7 @@ Clock = PlayLoop->Int2ExtClock(Clock); mPlayBuffer.Clear(); - RecdBuffer.Clear(); + mRecdBuffer.Clear(); if (AudioBuffer) { AudioBuffer->Clear(); @@ -262,25 +264,25 @@ { OutNow(t, t->mpBank2); } - if (t->mPatch) + if (t->mpPatch) { - OutNow(t, t->mPatch); + OutNow(t, t->mpPatch); } - if (t->Volume) + if (t->mpVolume) { - OutNow(t, t->Volume); + OutNow(t, t->mpVolume); } - if (t->Pan) + if (t->mpPan) { - OutNow(t, t->Pan); + OutNow(t, t->mpPan); } - if (t->Reverb) + if (t->mpReverb) { - OutNow(t, t->Reverb); + OutNow(t, t->mpReverb); } - if (t->Chorus) + if (t->mpChorus) { - OutNow(t, t->Chorus); + OutNow(t, t->mpChorus); } if (t->VibRate) { @@ -700,7 +702,7 @@ #if DB_WRITE //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -int dwrite(int dev, const char *buf, int size) +int dwrite(int dev, const char* buf, int size) { int i, written; //dev = 2; // stderr @@ -864,7 +866,7 @@ // Get record buffer GetRecordedData(); - RecdBuffer.Keyoff2Length(); + mRecdBuffer.Keyoff2Length(); } //----------------------------------------------------------------------------- @@ -1046,7 +1048,7 @@ tGetMidiBytes midi; if (pEvent->Write(midi) == 0) { - char *buf = new char[midi.nBytes + 3]; + char* buf = new char[midi.nBytes + 3]; buf[n++] = CMD+1; buf[n++] = 0xd7; buf[n++] = DAT+midi.nBytes; @@ -1329,7 +1331,7 @@ if (pEvent) { pEvent->Clock = PlayLoop->Ext2IntClock(pEvent->Clock); - RecdBuffer.Put(pEvent); + mRecdBuffer.Put(pEvent); } } else if (c == 0xfc) @@ -1923,7 +1925,7 @@ through = new tOSSThru(); } JZProjectManager::Instance()->NewPlayPosition(-1); - RecdBuffer.Keyoff2Length(); + mRecdBuffer.Keyoff2Length(); } //----------------------------------------------------------------------------- @@ -2053,7 +2055,7 @@ if (pEvent) { pEvent->SetClock(PlayLoop->Ext2IntClock(recd_clock)); - RecdBuffer.Put(pEvent); + mRecdBuffer.Put(pEvent); pEvent = 0; } Modified: trunk/jazz/src/Player.h =================================================================== --- trunk/jazz/src/Player.h 2009-01-20 05:45:55 UTC (rev 693) +++ trunk/jazz/src/Player.h 2009-01-20 05:51:17 UTC (rev 694) @@ -59,7 +59,7 @@ long Int2ExtClock(long Clock); void PrepareOutput( - tEventArray* buf, + tEventArray* pEventArray, JZSong* pSong, long ExtFr, long ExtTo, @@ -154,7 +154,7 @@ JZSong *Song; tEventArray mPlayBuffer; - tEventArray RecdBuffer; + tEventArray mRecdBuffer; void SetRecordInfo(JZRecordingInfo* inf) { rec_info = inf; Modified: trunk/jazz/src/Song.cpp =================================================================== --- trunk/jazz/src/Song.cpp 2009-01-20 05:45:55 UTC (rev 693) +++ trunk/jazz/src/Song.cpp 2009-01-20 05:51:17 UTC (rev 694) @@ -341,7 +341,7 @@ void JZSong::MergeTracks( int FrClock, int ToClock, - tEventArray* Destin, + tEventArray* pDestin, const JZMetronomeInfo& MetronomeInfo, int delta, int mode) @@ -349,7 +349,7 @@ // Make metronome if (MetronomeInfo.IsOn()) { - MakeMetronome(FrClock, ToClock, Destin, MetronomeInfo, delta); + MakeMetronome(FrClock, ToClock, pDestin, MetronomeInfo, delta); } // Find solo-tracks. @@ -383,11 +383,11 @@ JZEvent* pEventCopy = pEvent->Copy(); pEventCopy->SetClock(pEventCopy->GetClock() + delta); pEventCopy->SetDevice(pTrack->GetDevice()); - Destin->Put(pEventCopy); + pDestin->Put(pEventCopy); if (pEventCopy->IsPlayTrack()) { - MergePlayTrackEvent(pEventCopy->IsPlayTrack(), Destin, 0); + MergePlayTrackEvent(pEventCopy->IsPlayTrack(), pDestin, 0); } pEvent = Iterator.Next(); @@ -401,7 +401,7 @@ //----------------------------------------------------------------------------- void JZSong::MergePlayTrackEvent( tPlayTrack* c, //the playtrack event - tEventArray* Destin, + tEventArray* pDestin, int recursionDepth) { // Recursion might be simple, but we have the infinite loop problem, if a @@ -470,10 +470,10 @@ } if (d->IsPlayTrack()) { - MergePlayTrackEvent(d->IsPlayTrack(), Destin, recursionDepth); + MergePlayTrackEvent(d->IsPlayTrack(), pDestin, recursionDepth); } d->SetDevice(pTrack->GetDevice()); - Destin->Put(d); + pDestin->Put(d); f = IteratorPL.Next(); } loopOffset+=loopLength; @@ -485,7 +485,7 @@ void JZSong::MakeMetronome( int FrClock, int ToClock, - tEventArray* Destin, + tEventArray* pDestin, const JZMetronomeInfo& MetronomeInfo, int delta) { @@ -510,13 +510,13 @@ } // Insert normal click always - Destin->Put(MetronomeInfo.CreateNormalEvent(clk + delta)); + pDestin->Put(MetronomeInfo.CreateNormalEvent(clk + delta)); // On a bar? if (count == 1 && MetronomeInfo.IsAccented()) { // Insert accented click also - Destin->Put(MetronomeInfo.CreateAccentedEvent(clk + delta)); + pDestin->Put(MetronomeInfo.CreateAccentedEvent(clk + delta)); } clk += BarInfo.GetTicksPerBar() / BarInfo.GetCountsPerBar(); Modified: trunk/jazz/src/Track.cpp =================================================================== --- trunk/jazz/src/Track.cpp 2009-01-20 05:45:55 UTC (rev 693) +++ trunk/jazz/src/Track.cpp 2009-01-20 05:51:17 UTC (rev 694) @@ -505,6 +505,7 @@ { if (Events[i] != 0 && Events[i]->IsEndOfTrack()) { + delete Events[i]; ++j; --newnEvents; } @@ -579,13 +580,13 @@ tEventArray::tEventArray() : tSimpleEventArray(), mpName(0), - Copyright(0), - mPatch(0), - Speed(0), - Volume(0), - Pan(0), - Reverb(0), - Chorus(0), + mpCopyright(0), + mpPatch(0), + mpSpeed(0), + mpVolume(0), + mpPan(0), + mpReverb(0), + mpChorus(0), mpBank(0), mpBank2(0), mpReset(0) @@ -613,18 +614,23 @@ // delete mpName; mpName = 0; - Copyright = 0; +// delete mpCopyright; + mpCopyright = 0; - delete mPatch; - mPatch = 0; + delete mpPatch; + mpPatch = 0; - Volume = 0; +// delete mpVolume; + mpVolume = 0; - Pan = 0; +// delete mpPan; + mpPan = 0; - Reverb = 0; +// delete mpReverb; + mpReverb = 0; - Chorus = 0; +// delete mpChorus; + mpChorus = 0; delete mpBank; mpBank = 0; @@ -635,7 +641,9 @@ delete mpReset; mpReset = 0; - Speed = 0; +// delete mpSpeed; + mpSpeed = 0; + Channel = 1; Device = 0; @@ -754,17 +762,17 @@ // delete mpName; mpName = 0; - Copyright = 0; + mpCopyright = 0; - Speed = 0; + mpSpeed = 0; - Volume = 0; + mpVolume = 0; - Pan = 0; + mpPan = 0; - Reverb = 0; + mpReverb = 0; - Chorus = 0; + mpChorus = 0; for (i = 0; i < mspModulationSysexParameters; i++) { @@ -846,13 +854,13 @@ mpName = pEvent->IsTrackName(); } - if (!Copyright) + if (!mpCopyright) { - Copyright = pEvent->IsCopyright(); + mpCopyright = pEvent->IsCopyright(); } - if (!Speed) + if (!mpSpeed) { - Speed = pEvent->IsSetTempo(); + mpSpeed = pEvent->IsSetTempo(); } if (!MtcOffset) { @@ -863,27 +871,27 @@ switch (pControl->GetControl()) { case 0x07: - if (!Volume) + if (!mpVolume) { - Volume = pControl; + mpVolume = pControl; } break; case 0x0a: - if (!Pan) + if (!mpPan) { - Pan = pControl; + mpPan = pControl; } break; case 0x5b: - if (!Reverb) + if (!mpReverb) { - Reverb = pControl; + mpReverb = pControl; } break; case 0x5d: - if (!Chorus) + if (!mpChorus) { - Chorus = pControl; + mpChorus = pControl; } break; } @@ -1301,9 +1309,9 @@ Io.NextTrack(); // Write copyright notice first (according to spec): - if (Copyright) + if (mpCopyright) { - Copyright->Write(Io); + mpCopyright->Write(Io); } // Write MTC offset before any transmittable events (spec) @@ -1382,9 +1390,9 @@ mpBank2->Write(Io); } - if (mPatch) + if (mpPatch) { - mPatch->Write(Io); + mpPatch->Write(Io); } tJazzMeta JazzMeta; @@ -1591,21 +1599,21 @@ } else if (pEvent->IsProgram()) { - if (!mPatch) + if (!mpPatch) { - mPatch = pEvent->IsProgram(); - mPatch->SetClock(0); + mpPatch = pEvent->IsProgram(); + mpPatch->SetClock(0); SpecialEvent = true; } } else if (pEvent->IsCopyright()) { - if (!Copyright) + if (!mpCopyright) { - Copyright = pEvent->IsCopyright(); + mpCopyright = pEvent->IsCopyright(); // Just make sure clock is zero, then put into event array - Copyright->SetClock(0); + mpCopyright->SetClock(0); } } else if (pEvent->IsSysEx()) @@ -1847,9 +1855,9 @@ { trk->mpBank->Channel = trk->Channel - 1; } - if (trk->mPatch) + if (trk->mpPatch) { - trk->mPatch->Channel = trk->Channel - 1; + trk->mpPatch->Channel = trk->Channel - 1; } if (!trk->DrumParams.IsEmpty()) { @@ -2124,9 +2132,9 @@ const char* JZTrack::GetCopyright() { - if (Copyright) + if (mpCopyright) { - return (const char *)Copyright->GetData(); + return (const char *)mpCopyright->GetData(); } return ""; } @@ -2135,9 +2143,9 @@ void JZTrack::SetCopyright(char *str) { - if (Copyright) + if (mpCopyright) { - Kill(Copyright); + Kill(mpCopyright); } if (str && strlen(str)) { @@ -2177,22 +2185,22 @@ Cleanup(); } -// ------------------------ Volume ------------------------------ +// ------------------------ Volume ------------------------------ int JZTrack::GetVolume() { - if (Volume) + if (mpVolume) { - return Volume->GetControlValue() + 1; + return mpVolume->GetControlValue() + 1; } return 0; } void JZTrack::SetVolume(int Value) { - if (Volume) + if (mpVolume) { - Kill(Volume); + Kill(mpVolume); } if (Value > 0) { @@ -2205,17 +2213,17 @@ bool JZTrack::DecreaseVolume() { - if (Volume && Volume->GetControlValue() > 0) + if (mpVolume && mpVolume->GetControlValue() > 0) { - Kill(Volume); + Kill(mpVolume); - Volume->SetControlValue(Volume->GetControlValue() - 1); + mpVolume->SetControlValue(mpVolume->GetControlValue() - 1); JZEvent* pEvent = new tControl( 0, Channel - 1, 0x07, - Volume->GetControlValue()); + mpVolume->GetControlValue()); Put(pEvent); gpMidiPlayer->OutNow(this, pEvent); @@ -2228,17 +2236,17 @@ bool JZTrack::IncreaseVolume() { - if (Volume && Volume->GetControlValue() < 127) + if (mpVolume && mpVolume->GetControlValue() < 127) { - Kill(Volume); + Kill(mpVolume); - Volume->SetControlValue(Volume->GetControlValue() + 1); + mpVolume->SetControlValue(mpVolume->GetControlValue() + 1); JZEvent* pEvent = new tControl( 0, Channel - 1, 0x07, - Volume->GetControlValue()); + mpVolume->GetControlValue()); Put(pEvent); gpMidiPlayer->OutNow(this, pEvent); @@ -2250,22 +2258,22 @@ return false; } -// ------------------------ Pan ------------------------------ +// ------------------------ Pan ------------------------------ int JZTrack::GetPan() { - if (Pan) + if (mpPan) { - return Pan->GetControlValue() + 1; + return mpPan->GetControlValue() + 1; } return 0; } void JZTrack::SetPan(int Value) { - if (Pan) + if (mpPan) { - Kill(Pan); + Kill(mpPan); } if (Value > 0) { @@ -2276,22 +2284,22 @@ Cleanup(); } -// ------------------------ Reverb ------------------------------ +// ------------------------ Reverb ------------------------------ int JZTrack::GetReverb() { - if (Reverb) + if (mpReverb) { - return Reverb->GetControlValue() + 1; + return mpReverb->GetControlValue() + 1; } return 0; } void JZTrack::SetReverb(int Value) { - if (Reverb) + if (mpReverb) { - Kill(Reverb); + Kill(mpReverb); } if (Value > 0) { @@ -2302,22 +2310,22 @@ Cleanup(); } -// ------------------------ Chorus ------------------------------ +// ------------------------ Chorus ------------------------------ int JZTrack::GetChorus() { - if (Chorus) + if (mpChorus) { - return Chorus->GetControlValue() + 1; + return mpChorus->GetControlValue() + 1; } return 0; } void JZTrack::SetChorus(int Value) { - if (Chorus) + if (mpChorus) { - Kill(Chorus); + Kill(mpChorus); } if (Value > 0) { @@ -2430,24 +2438,24 @@ int JZTrack::GetPatch() { - if (mPatch) + if (mpPatch) { - return mPatch->GetProgram() + 1; + return mpPatch->GetProgram() + 1; } return 0; } void JZTrack::SetPatch(int PatchNr) { - if (mPatch) + if (mpPatch) { - delete mPatch; - mPatch = 0; + delete mpPatch; + mpPatch = 0; } if (PatchNr > 0) { - mPatch = new tProgram(0, Channel - 1, PatchNr - 1); - gpMidiPlayer->OutNow(this, mPatch); + mpPatch = new tProgram(0, Channel - 1, PatchNr - 1); + gpMidiPlayer->OutNow(this, mpPatch); mChanged = true; } } @@ -3359,13 +3367,13 @@ Cleanup(); } -// ------------------------ Speed ------------------------------ +// ------------------------ Speed ------------------------------ int JZTrack::GetDefaultSpeed() { - if (Speed) + if (mpSpeed) { - return Speed->GetBPM(); + return mpSpeed->GetBPM(); } return 120; } @@ -3374,9 +3382,9 @@ void JZTrack::SetDefaultSpeed(int bpm) { JZEvent* pEvent = new tSetTempo(0, bpm); - if (Speed) + if (mpSpeed) { - Kill(Speed); + Kill(mpSpeed); } Put(pEvent); gpMidiPlayer->OutNow(this, pEvent); @@ -3388,7 +3396,7 @@ tEventIterator Iterator(this); Sort(); JZEvent* pEvent = Iterator.Range(0, clk + 1); - tSetTempo *t = Speed; + tSetTempo* t = mpSpeed; while (pEvent) { if (pEvent->IsSetTempo()) Modified: trunk/jazz/src/Track.h =================================================================== --- trunk/jazz/src/Track.h 2009-01-20 05:45:55 UTC (rev 693) +++ trunk/jazz/src/Track.h 2009-01-20 05:51:17 UTC (rev 694) @@ -455,13 +455,13 @@ public: tTrackName* mpName; - tCopyright* Copyright; - tProgram* mPatch; - tSetTempo* Speed; - tControl* Volume; - tControl* Pan; - tControl* Reverb; - tControl* Chorus; + tCopyright* mpCopyright; + tProgram* mpPatch; + tSetTempo* mpSpeed; + tControl* mpVolume; + tControl* mpPan; + tControl* mpReverb; + tControl* mpChorus; tControl* mpBank; tControl* mpBank2; Modified: trunk/jazz/src/TrackWindow.cpp =================================================================== --- trunk/jazz/src/TrackWindow.cpp 2009-01-20 05:45:55 UTC (rev 693) +++ trunk/jazz/src/TrackWindow.cpp 2009-01-20 05:51:17 UTC (rev 694) @@ -1412,7 +1412,7 @@ } if ( !pRecInfo->mpTrack->GetAudioMode() && - !gpProject->GetPlayer()->RecdBuffer.IsEmpty()) + !gpProject->GetPlayer()->mRecdBuffer.IsEmpty()) { //int choice = wxMessageBox("Keep recorded events?", "You played", wxOK | wxCANCEL); //if (choice == wxOK) @@ -1420,7 +1420,7 @@ wxBeginBusyCursor(); gpProject->NewUndoBuffer(); pRecInfo->mpTrack->MergeRange( - &gpProject->GetPlayer()->RecdBuffer, + &gpProject->GetPlayer()->mRecdBuffer, pRecInfo->mFromClock, pRecInfo->mToClock, pRecInfo->mIsMuted); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |