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