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 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-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 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-05-16 04:16:34
|
Revision: 719 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=719&view=rev Author: pstieber Date: 2009-05-16 04:16:22 +0000 (Sat, 16 May 2009) Log Message: ----------- Fixed snap selection so recording works. Modified Paths: -------------- trunk/jazz/src/EventWindow.cpp trunk/jazz/src/EventWindow.h trunk/jazz/src/PianoWindow.cpp trunk/jazz/src/PianoWindow.h trunk/jazz/src/TrackWindow.cpp trunk/jazz/src/TrackWindow.h Modified: trunk/jazz/src/EventWindow.cpp =================================================================== --- trunk/jazz/src/EventWindow.cpp 2009-03-13 21:06:09 UTC (rev 718) +++ trunk/jazz/src/EventWindow.cpp 2009-05-16 04:16:22 UTC (rev 719) @@ -536,13 +536,13 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZEventWindow::SnapSelStart(wxMouseEvent& MouseEvent) +void JZEventWindow::SnapSelectionStart(wxMouseEvent& MouseEvent) { } //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZEventWindow::SnapSelStop(wxMouseEvent& MouseEvent) +void JZEventWindow::SnapSelectionStop(wxMouseEvent& MouseEvent) { } @@ -563,7 +563,7 @@ if (MouseEvent.LeftDown()) { { - SnapSelStart(MouseEvent); + SnapSelectionStart(MouseEvent); // if (mpSnapSel->IsSelected()) // { @@ -587,7 +587,7 @@ if (mpMouseAction == mpSnapSel) { - SnapSelStop(MouseEvent); + SnapSelectionStop(MouseEvent); // inefficient, invalidate rect first instead. Refresh(); Modified: trunk/jazz/src/EventWindow.h =================================================================== --- trunk/jazz/src/EventWindow.h 2009-03-13 21:06:09 UTC (rev 718) +++ trunk/jazz/src/EventWindow.h 2009-05-16 04:16:22 UTC (rev 719) @@ -102,9 +102,9 @@ int SnapClock(int Clock, bool Up); - virtual void SnapSelStart(wxMouseEvent& MouseEvent); + virtual void SnapSelectionStart(wxMouseEvent& MouseEvent); - virtual void SnapSelStop(wxMouseEvent& MouseEvent); + virtual void SnapSelectionStop(wxMouseEvent& MouseEvent); void DrawVerticalLine(wxDC& Dc, int XPosition) const; Modified: trunk/jazz/src/PianoWindow.cpp =================================================================== --- trunk/jazz/src/PianoWindow.cpp 2009-03-13 21:06:09 UTC (rev 718) +++ trunk/jazz/src/PianoWindow.cpp 2009-05-16 04:16:22 UTC (rev 719) @@ -1827,7 +1827,7 @@ //----------------------------------------------------------------------------- // Snapper //----------------------------------------------------------------------------- -void JZPianoWindow::SnapSelStop(wxMouseEvent& MouseEvent) +void JZPianoWindow::SnapSelectionStop(wxMouseEvent& MouseEvent) { if (mpSnapSel->IsSelected()) { @@ -1885,7 +1885,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZPianoWindow::SnapSelStart(wxMouseEvent& MouseEvent) +void JZPianoWindow::SnapSelectionStart(wxMouseEvent& MouseEvent) { mSnapCount = 0; int clk = SnapClock(mFromClock, false); @@ -2020,7 +2020,7 @@ if (MouseEvent.LeftDown()) { { - SnapSelStart(MouseEvent); + SnapSelectionStart(MouseEvent); // if (mpSnapSel->IsSelected()) // { @@ -2044,7 +2044,7 @@ if (mpMouseAction == mpSnapSel) { - SnapSelStop(MouseEvent); + SnapSelectionStop(MouseEvent); // inefficient, invalidate rect first instead. Refresh(); Modified: trunk/jazz/src/PianoWindow.h =================================================================== --- trunk/jazz/src/PianoWindow.h 2009-03-13 21:06:09 UTC (rev 718) +++ trunk/jazz/src/PianoWindow.h 2009-05-16 04:16:22 UTC (rev 719) @@ -113,10 +113,6 @@ int SnapClock(int Clock, bool Up = false); - virtual void SnapSelStart(wxMouseEvent& MouseEvent); - - virtual void SnapSelStop(wxMouseEvent& MouseEvent); - int SnapClocks(); void SetSnapDenom(int Value); @@ -187,6 +183,12 @@ void ActivateSequenceLengthDialog(); + protected: + + virtual void SnapSelectionStart(wxMouseEvent& MouseEvent); + + virtual void SnapSelectionStop(wxMouseEvent& MouseEvent); + private: JZPianoFrame* mpPianoFrame; Modified: trunk/jazz/src/TrackWindow.cpp =================================================================== --- trunk/jazz/src/TrackWindow.cpp 2009-03-13 21:06:09 UTC (rev 718) +++ trunk/jazz/src/TrackWindow.cpp 2009-05-16 04:16:22 UTC (rev 719) @@ -282,7 +282,7 @@ mEventsY, mEventsWidth, mEventsHeight); - SnapSelStop(MouseEvent); + SnapSelectionStop(MouseEvent); } else if ( Point.x >= mEventsX && Point.x < mEventsX + mEventsWidth && Modified: trunk/jazz/src/TrackWindow.h =================================================================== --- trunk/jazz/src/TrackWindow.h 2009-03-13 21:06:09 UTC (rev 718) +++ trunk/jazz/src/TrackWindow.h 2009-05-16 04:16:22 UTC (rev 719) @@ -85,10 +85,10 @@ protected: - virtual void SnapSelStop(wxMouseEvent& MouseEvent) - { - } + virtual void SnapSelectionStart(wxMouseEvent& MouseEvent); + virtual void SnapSelectionStop(wxMouseEvent& MouseEvent); + private: void OnSize(wxSizeEvent& Event); @@ -146,10 +146,6 @@ const char* GetNumberString() const; - void SnapSelectionStart(wxMouseEvent& MouseEvent); - - void SnapSelectionStop(wxMouseEvent& MouseEvent); - int x2xBar(int x); int x2wBar(int x); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2009-05-17 17:52:03
|
Revision: 722 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=722&view=rev Author: pstieber Date: 2009-05-17 17:51:49 +0000 (Sun, 17 May 2009) Log Message: ----------- 1. Changed tMouseAction to JZMouseAction, added window scrolling information to all of the virtual functions in this class, moved ProcessMouseEvent from the header to the source file, and implemented in-line functions outside of the class declaration. 2. Made SnapSelectionStart and SnapSelectionStop pure virtual in the JZEventWindow base class. 3. Removed extra header sentry check for wx/timer.h in MouseAction.h and reordered the includes. 4. Updated some function comment headers. 5. Changed tMouseMapper to JZMouseMapper, removed an unused default constructor, renamed the Button enumeration to TEButton, changed Action to GetAction, and prefixed enumeration entries with an e. 6. Removed unneeded JZSelection::Select(JZRectangle&, int, int, int, int), and changed JZSelection::Select(JZRectangle&) to JZSelection::Select(const JZRectangle&). 7. Added window scrolling information to JZSnapSelection::Snap. 8. Used a preprocessor to remove the unused tMouseButton class. 9. Updated some variable names to match the new style convention. 10. Translated a comment in the song module and fixed a typo in a comment in the track frame header. 11. Commented unused JZTrackWindow::Mark, fixed selection bugs in the track window when the window was scrolled, removed the line (y = y2yLine(y)) that forced discrete instead of smooth scrolling of the track text, and commented out unused JZTrackWindow::x2xBar and JZTrackWindow::x2wBar. x2xBar and x2wBar need to take into account scrolling if they are reinstated. Modified Paths: -------------- trunk/jazz/src/EventWindow.cpp trunk/jazz/src/EventWindow.h trunk/jazz/src/MouseAction.cpp trunk/jazz/src/MouseAction.h trunk/jazz/src/PianoWindow.cpp trunk/jazz/src/PianoWindow.h trunk/jazz/src/SampleWindow.cpp trunk/jazz/src/Song.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/EventWindow.cpp =================================================================== --- trunk/jazz/src/EventWindow.cpp 2009-05-17 17:27:44 UTC (rev 721) +++ trunk/jazz/src/EventWindow.cpp 2009-05-17 17:51:49 UTC (rev 722) @@ -552,18 +552,6 @@ } //----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -void JZEventWindow::SnapSelectionStart(wxMouseEvent& MouseEvent) -{ -} - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -void JZEventWindow::SnapSelectionStop(wxMouseEvent& MouseEvent) -{ -} - -//----------------------------------------------------------------------------- // Descriptions: // This mouse handler delegates to the subclassed event window. //----------------------------------------------------------------------------- @@ -588,7 +576,7 @@ // invalidate a rect). Refresh(); // } - mpSnapSel->ProcessMouseEvent(MouseEvent); + mpSnapSel->ProcessMouseEvent(MouseEvent, mScrolledX, mScrolledY); mpMouseAction = mpSnapSel; } } @@ -598,7 +586,7 @@ { // mpMouseAction active - if (mpMouseAction->ProcessMouseEvent(MouseEvent)) + if (mpMouseAction->ProcessMouseEvent(MouseEvent, mScrolledX, mScrolledY)) { // mpMouseAction finished Modified: trunk/jazz/src/EventWindow.h =================================================================== --- trunk/jazz/src/EventWindow.h 2009-05-17 17:27:44 UTC (rev 721) +++ trunk/jazz/src/EventWindow.h 2009-05-17 17:51:49 UTC (rev 722) @@ -26,7 +26,7 @@ #include <wx/window.h> class JZFilter; -class tMouseAction; +class JZMouseAction; class JZSnapSelection; class JZSong; class wxDialog; @@ -102,9 +102,9 @@ int SnapClock(int Clock, bool Up); - virtual void SnapSelectionStart(wxMouseEvent& MouseEvent); + virtual void SnapSelectionStart(wxMouseEvent& MouseEvent) = 0; - virtual void SnapSelectionStop(wxMouseEvent& MouseEvent); + virtual void SnapSelectionStop(wxMouseEvent& MouseEvent) = 0; void DrawVerticalLine(wxDC& Dc, int XPosition) const; @@ -126,7 +126,7 @@ JZFilter* mpFilter; - tMouseAction* mpMouseAction; + JZMouseAction* mpMouseAction; protected: Modified: trunk/jazz/src/MouseAction.cpp =================================================================== --- trunk/jazz/src/MouseAction.cpp 2009-05-17 17:27:44 UTC (rev 721) +++ trunk/jazz/src/MouseAction.cpp 2009-05-17 17:51:49 UTC (rev 722) @@ -24,52 +24,64 @@ #include "EventWindow.h" +#include <wx/brush.h> #include <wx/dcclient.h> -#include <wx/brush.h> +//DEBUG#include <iostream> + using namespace std; -// ----------------------------------------------------------------- -// tMouseMapper - map mouse button to Command-ID -// ----------------------------------------------------------------- - -tMouseMapper::tMouseMapper(const int a[12]) +//***************************************************************************** +// Description: +// This is the mouse mapper class declaration. +//***************************************************************************** +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +JZMouseMapper::JZMouseMapper(const int Actions[12]) + : mActions(), + mLeftAction(0) { for (int i = 0; i < 12; i++) - actions[i] = a[i]; - left_action = 0; + { + mActions[i] = Actions[i]; + } } -tMouseMapper::tMouseMapper() +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZMouseMapper::SetAction( + int Action, + TEButton Button, + bool Shift, + bool Ctrl) { - for (int i = 0; i < 12; i++) - actions[i] = 0; - left_action = 0; -} - -void tMouseMapper::SetAction(int code, Button but, bool shift, bool ctrl) -{ int i = 0; - switch (but) + switch (Button) { - case Left: + case eLeft: i = 0; break; - case Middle: + case eMiddle: i = 1; break; - case Right: + case eRight: i = 2; break; } - if (shift) + if (Shift) + { i += 3; - if (ctrl) + } + if (Ctrl) + { i += 6; - actions[i] = code; + } + mActions[i] = Action; } -int tMouseMapper::Action(wxMouseEvent& MouseEvent) +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +int JZMouseMapper::GetAction(wxMouseEvent& MouseEvent) { if (!MouseEvent.ButtonDown()) { @@ -77,15 +89,16 @@ } if ( - left_action > 0 && + mLeftAction > 0 && MouseEvent.LeftDown() && !MouseEvent.ShiftDown() && !MouseEvent.ControlDown()) { - return left_action; + return mLeftAction; } - int i = 0; // left down + // Assume the left button is down. + int i = 0; if (MouseEvent.MiddleDown()) { i = 1; @@ -99,15 +112,70 @@ { i += 3; } + if (MouseEvent.ControlDown()) { i += 6; } - return actions[i]; + + return mActions[i]; } //***************************************************************************** // Description: +// This is the mouse action base class definition. Derived classes are +// instantiated in the mouse handler of the event window, for example, to +// retain state during mouse operations, like drag and drop and so on. +// The ProcessMouseEvent() function is used to determine what to do with an +// incoming event. Normally, if the event is a left button down event, call +// the LeftDown function of the class, and so on. +//***************************************************************************** +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +JZMouseAction::~JZMouseAction() +{ +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +int JZMouseAction::ProcessMouseEvent( + wxMouseEvent& MouseEvent, + int ScrolledX, + int ScrolledY) +{ + if (MouseEvent.Dragging()) + { + return Dragging(MouseEvent, ScrolledX, ScrolledY); + } + else if (MouseEvent.LeftDown()) + { + return LeftDown(MouseEvent, ScrolledX, ScrolledY); + } + else if (MouseEvent.LeftUp()) + { + return LeftUp(MouseEvent, ScrolledX, ScrolledY); + } + else if (MouseEvent.MiddleDown()) + { + return MiddleDown(MouseEvent, ScrolledX, ScrolledY); + } + else if (MouseEvent.MiddleUp()) + { + return MiddleUp(MouseEvent, ScrolledX, ScrolledY); + } + else if (MouseEvent.RightDown()) + { + return RightDown(MouseEvent, ScrolledX, ScrolledY); + } + else if (MouseEvent.RightUp()) + { + return RightUp(MouseEvent, ScrolledX, ScrolledY); + } + return 0; +} + +//***************************************************************************** +// Description: // This is the selection class definition. //***************************************************************************** //----------------------------------------------------------------------------- @@ -132,26 +200,32 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -int JZSelection::ProcessMouseEvent(wxMouseEvent& MouseEvent) +int JZSelection::ProcessMouseEvent( + wxMouseEvent& MouseEvent, + int ScrolledX, + int ScrolledY) { if (MouseEvent.ButtonDown()) { - return ButtonDown(MouseEvent); + return ButtonDown(MouseEvent, ScrolledX, ScrolledY); } else if (MouseEvent.ButtonUp()) { - return ButtonUp(MouseEvent); + return ButtonUp(MouseEvent, ScrolledX, ScrolledY); } else if (MouseEvent.Dragging()) { - return Dragging(MouseEvent); + return Dragging(MouseEvent, ScrolledX, ScrolledY); } return 0; } //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -int JZSelection::ButtonDown(wxMouseEvent& MouseEvent) +int JZSelection::ButtonDown( + wxMouseEvent& MouseEvent, + int ScrolledX, + int ScrolledY) { if (!mActive) { @@ -161,14 +235,14 @@ // Continue selection JZRectangle Rectangle = mRectangle; Rectangle.SetNormal(); - Dragging(MouseEvent); + Dragging(MouseEvent, ScrolledX, ScrolledY); } else { mSelected = false; - int x = MouseEvent.GetX(); - int y = MouseEvent.GetY(); - Snap(x, y, 0); + int x = MouseEvent.GetX() + ScrolledX; + int y = MouseEvent.GetY() + ScrolledY; + Snap(x, y, ScrolledX, ScrolledY, false); mRectangle.x = x; mRectangle.y = y; mRectangle.width = 1; @@ -180,17 +254,41 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -int JZSelection::Dragging(wxMouseEvent& MouseEvent) +int JZSelection::ButtonUp( + wxMouseEvent& MouseEvent, + int ScrolledX, + int ScrolledY) { + if (mActive) + { + mActive = false; + mRectangle.SetNormal(); + + // Only select if the rectangle is larger than 3x3 pixels. + mSelected = (mRectangle.width > 3 && mRectangle.height > 3); + return 1; + } + + mpWindow->Refresh(); + return 0; +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +int JZSelection::Dragging( + wxMouseEvent& MouseEvent, + int ScrolledX, + int ScrolledY) +{ if (!mActive) { - ButtonDown(MouseEvent); + ButtonDown(MouseEvent, ScrolledX, ScrolledY); } if (mActive) { - int x = MouseEvent.GetX(); - int y = MouseEvent.GetY(); + int x = MouseEvent.GetX() + ScrolledX; + int y = MouseEvent.GetY() + ScrolledY; if (x < 0) { x = 0; @@ -199,7 +297,7 @@ { y = 0; } - Snap(x, y, 1); + Snap(x, y, ScrolledX, ScrolledY, true); mRectangle.width = x - mRectangle.x; mRectangle.height = y - mRectangle.y; @@ -209,27 +307,8 @@ } //----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -int JZSelection::ButtonUp(wxMouseEvent& MouseEvent) -{ - if (mActive) - { - mActive = false; - mRectangle.SetNormal(); - - // Only select if the rectangle is larger than 3x3 pixels. - mSelected = (mRectangle.width > 3 && mRectangle.height > 3); - return 1; - } - - mpWindow->Refresh(); - return 0; -} - -//----------------------------------------------------------------------------- // Description: -// Draw the selected rectangle, normally called from OnDraw -// in the parent window. +// Draw the selected rectangle. //----------------------------------------------------------------------------- void JZSelection::Draw(wxDC& Dc, int ScrolledX, int ScrolledY) { @@ -279,26 +358,15 @@ // It did this by drawing directly in the device context. This is bad, so I // tried changing it to invalidation instead. //----------------------------------------------------------------------------- -void JZSelection::Select(JZRectangle& Rectangle, int x, int y, int w, int h) +void JZSelection::Select(const JZRectangle& Rectangle) { - // clear old rectangle - // Draw(x, y, w, h); - // make new one mRectangle = Rectangle; mSelected = true; - // Draw(x, y, w, h); // Inefficient because should invalidate only the rectangle. mpWindow->Refresh(); } -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -void JZSelection::Select(JZRectangle& Rectangle) -{ - Select(Rectangle, 0, 0, 3000, 3000); -} - //***************************************************************************** // Description: // This is the snap selection class definition. @@ -320,47 +388,52 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZSnapSelection::Snap(int& x, int& y, bool drag) +void JZSnapSelection::Snap( + int& x, + int& y, + int ScrolledX, + int ScrolledY, + bool Up) { if (!mXCoordinates.empty()) { - SnapToVector(x, mXCoordinates, drag); + SnapToVector(x, mXCoordinates, ScrolledX, Up); } else if (mXStep) { - SnapMod(x, mXMin, mXMax, mXStep, drag); + SnapMod(x, mXMin, mXMax, mXStep, ScrolledX, Up); } if (!mYCoordinates.empty()) { - SnapToVector(y, mYCoordinates, drag); + SnapToVector(y, mYCoordinates, ScrolledY, Up); } else if (mYStep) { - SnapMod(y, mYMin, mYMax, mYStep, drag); + SnapMod(y, mYMin, mYMax, mYStep, ScrolledY, Up); } } //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZSnapSelection::SetXSnap(int XCount, int* pXVector) +void JZSnapSelection::SetXSnap(int XCount, int* pXVector, int ScrolledX) { mXCoordinates.clear(); for (int i = 0; i < XCount; ++i) { - mXCoordinates.push_back(pXVector[i]); + mXCoordinates.push_back(pXVector[i] + ScrolledX); } mXStep = 0; } //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZSnapSelection::SetYSnap(int YCount, int* pYVector) +void JZSnapSelection::SetYSnap(int YCount, int* pYVector, int ScrolledY) { mYCoordinates.clear(); for (int i = 0; i < YCount; ++i) { - mXCoordinates.push_back(pYVector[i]); + mXCoordinates.push_back(pYVector[i] + ScrolledY); } mYStep = 0; } @@ -390,8 +463,10 @@ void JZSnapSelection::SnapToVector( int& Coordinate, vector<int> Vector, + int Scrolled, bool Up) { +//DEBUG cout << "In: " << Coordinate; for (unsigned i = 0; i < Vector.size(); ++i) { if (Vector[i] > Coordinate) @@ -404,9 +479,11 @@ { Coordinate = Vector[i - 1]; } +//DEBUG cout << " Out: " << Coordinate << endl; return; } } +//DEBUG cout << " Out: " << Coordinate << endl; Coordinate = Vector[Vector.size() - 1]; } @@ -417,8 +494,10 @@ int Min, int Max, int Step, + int Scrolled, bool Up) { +//DEBUG cout << "In: " << Coordinate; if (Coordinate <= Min) { Coordinate = Min; @@ -427,13 +506,15 @@ if (Coordinate >= Max) { Coordinate = Max; +//DEBUG cout << "Max: " << Coordinate << endl; return; } - Coordinate -= (Coordinate - Min) % Step; + Coordinate -= (Coordinate - Min) % Step - (Scrolled % Step); if (Up) { Coordinate += Step; } +//DEBUG cout << " Out: " << Coordinate << endl; } @@ -461,7 +542,10 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -int tMouseCounter::LeftDown(wxMouseEvent& MouseEvent) +int tMouseCounter::LeftDown( + wxMouseEvent& MouseEvent, + int ScrolledX, + int ScrolledY) { Delta = MouseEvent.ShiftDown() ? 10 : 1; Start(Timeout); @@ -478,7 +562,10 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -int tMouseCounter::LeftUp(wxMouseEvent& MouseEvent) +int tMouseCounter::LeftUp( + wxMouseEvent& MouseEvent, + int ScrolledX, + int ScrolledY) { Stop(); ShowValue(FALSE); @@ -487,7 +574,10 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -int tMouseCounter::RightDown(wxMouseEvent& MouseEvent) +int tMouseCounter::RightDown( + wxMouseEvent& MouseEvent, + int ScrolledX, + int ScrolledY) { Delta = MouseEvent.ShiftDown() ? -10 : -1; Start(Timeout); @@ -505,7 +595,10 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -int tMouseCounter::RightUp(wxMouseEvent& MouseEvent) +int tMouseCounter::RightUp( + wxMouseEvent& MouseEvent, + int ScrolledX, + int ScrolledY) { Stop(); ShowValue(FALSE); @@ -558,7 +651,10 @@ //Frame->SetStatusText("Click Destination point"); } -int tMarkDestin::ButtonDown(wxMouseEvent& MouseEvent) +int tMarkDestin::ButtonDown( + wxMouseEvent& MouseEvent, + int ScrolledX, + int ScrolledY) { wxCursor c = wxCursor(wxCURSOR_ARROW); Canvas->SetCursor(c); @@ -571,28 +667,38 @@ x=point.x; y=point.y; - // cout<<"tMarkDestin::ButtonDown "<<x<<" "<<y<<endl; +//DEBUG cout << "tMarkDestin::ButtonDown " << x << ' ' << y <<endl; return 1; } -int tMarkDestin::RightDown(wxMouseEvent& MouseEvent) +int tMarkDestin::RightDown( + wxMouseEvent& MouseEvent, + int ScrolledX, + int ScrolledY) { - ButtonDown(MouseEvent); + ButtonDown(MouseEvent, ScrolledX, ScrolledY); Aborted = 1; //Frame->SetStatusText("Operation aborted"); return 1; } -int tMarkDestin::LeftDown(wxMouseEvent& MouseEvent) +int tMarkDestin::LeftDown( + wxMouseEvent& MouseEvent, + int ScrolledX, + int ScrolledY) { - ButtonDown(MouseEvent); + ButtonDown(MouseEvent, ScrolledX, ScrolledY); Aborted = 0; //Frame->SetStatusText(""); return 1; } +#if 0 + //***************************************************************************** -// tMouseButton - simulate a 3D button +// Description: +// This is the mouse button class definition. This class simulates a 3D +// button. //***************************************************************************** //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- @@ -640,7 +746,10 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -int tMouseButton::ProcessMouseEvent(wxMouseEvent& MouseEvent) +int tMouseButton::ProcessMouseEvent( + wxMouseEvent& MouseEvent, + int ScrolledX, + int ScrolledY) { if (MouseEvent.ButtonUp()) { @@ -663,3 +772,5 @@ } return 0; } + +#endif Modified: trunk/jazz/src/MouseAction.h =================================================================== --- trunk/jazz/src/MouseAction.h 2009-05-17 17:27:44 UTC (rev 721) +++ trunk/jazz/src/MouseAction.h 2009-05-17 17:51:49 UTC (rev 722) @@ -23,16 +23,16 @@ #ifndef JZ_MOUSEACTION_H #define JZ_MOUSEACTION_H -#ifndef wx_timerh -#include <wx/timer.h> -#endif - #include "Rectangle.h" #include <vector> +#include <wx/timer.h> + class JZEventWindow; +//***************************************************************************** +//***************************************************************************** enum TEMousePlayMode { eMouse, @@ -43,110 +43,115 @@ }; //***************************************************************************** +// Description: +// This is the mouse mapper class declaration. This class maps the state of +// the mouse and certain keyboard keys into user defined integer codes. There +// are 12 possible mouse button / keyboard key combinations. They are: +// +// 0, 1, 2 = left, middle, right down +// 3, 4, 5 = left, middle, right down + shift +// 6, 7, 8 = left, middle, right down + ctrl +// 9, 10, 11 = left, middle, right down + ctrl + shift +// +// Note that combinations or mouse buttons are not considered. +// The function GetAction converts a wxWidgets mouse event into a user +// defined code. The default code for all mouse actions is 0. //***************************************************************************** -class tMouseMapper +class JZMouseMapper { public: - // actions - // 0..2 = left/middle/right down - // 3..5 = left/middle/right down + shift - // 6..8 = left/middle/right down + ctrl - // 9..11 = left/middle/right down + ctrl + shift + JZMouseMapper(const int Actions[12]); - tMouseMapper(const int actions[12]); - - tMouseMapper(); - - enum Button + enum TEButton { - Left, - Middle, - Right + eLeft, + eMiddle, + eRight }; + int GetAction(wxMouseEvent& MouseEvent); + void SetAction( - int code, - Button but = Left, - bool shift = false, - bool ctrl = false); + int Action, + TEButton Button = eLeft, + bool Shift = false, + bool Ctrl = false); - int Action(wxMouseEvent& MouseEvent); - - void SetLeftAction(int id = 0) + void SetLeftAction(int Action = 0) { - left_action = id; + mLeftAction = Action; } private: - int actions[12]; + int mActions[12]; - int left_action; + int mLeftAction; }; //***************************************************************************** // Description: -// 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. +// This is the mouse action base class declaration. Derived classes are +// instantiated in the mouse handler of the event window, for example, to +// retain state during mouse operations, like drag and drop 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. +// incoming event. Normally, if the event is a left button down event, call +// the LeftDown function of the class, and so on. //***************************************************************************** -class tMouseAction +class JZMouseAction { public: - 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()) - { - return Dragging(MouseEvent); - } - else if (MouseEvent.LeftDown()) - { - return LeftDown(MouseEvent); - } - else if (MouseEvent.LeftUp()) - { - return LeftUp(MouseEvent); - } - else if (MouseEvent.MiddleDown()) - { - return MiddleDown(MouseEvent); - } - else if (MouseEvent.MiddleUp()) - { - return MiddleUp(MouseEvent); - } - else if (MouseEvent.RightDown()) - { - return RightDown(MouseEvent); - } - else if (MouseEvent.RightUp()) - { - return RightUp(MouseEvent); - } - return 0; - } + virtual ~JZMouseAction(); + + virtual int LeftDown( + wxMouseEvent& MouseEvent, + int ScrolledX, + int ScrolledY); + + virtual int LeftUp( + wxMouseEvent& MouseEvent, + int ScrolledX, + int ScrolledY); + + virtual int RightDown( + wxMouseEvent& MouseEvent, + int ScrolledX, + int ScrolledY); + + virtual int RightUp( + wxMouseEvent& MouseEvent, + int ScrolledX, + int ScrolledY); + + virtual int MiddleDown( + wxMouseEvent& MouseEvent, + int ScrolledX, + int ScrolledY); + + virtual int MiddleUp( + wxMouseEvent& MouseEvent, + int ScrolledX, + int ScrolledY); + + virtual int Dragging( + wxMouseEvent& MouseEvent, + int ScrolledX, + int ScrolledY); + + virtual int ProcessMouseEvent( + wxMouseEvent& MouseEvent, + int ScrolledX, + int ScrolledY); }; - //***************************************************************************** // Description: // This is the selection class declaration. This class selects events using // the mouse and draws indicating the selected events. //***************************************************************************** -class JZSelection : public tMouseAction +class JZSelection : public JZMouseAction { public: @@ -179,17 +184,34 @@ mRectangle = Rectangle; } - virtual void Snap(int& x, int& y, bool drag) + virtual void Snap( + int& x, + int& y, + int ScrolledX, + int ScrolledY, + bool Up) { } - virtual int Dragging(wxMouseEvent& MouseEvent); + virtual int Dragging( + wxMouseEvent& MouseEvent, + int ScrolledX, + int ScrolledY); - virtual int ProcessMouseEvent(wxMouseEvent& MouseEvent); + virtual int ProcessMouseEvent( + wxMouseEvent& MouseEvent, + int ScrolledX, + int ScrolledY); - virtual int ButtonDown(wxMouseEvent& MouseEvent); + virtual int ButtonDown( + wxMouseEvent& MouseEvent, + int ScrolledX, + int ScrolledY); - virtual int ButtonUp(wxMouseEvent& MouseEvent); + virtual int ButtonUp( + wxMouseEvent& MouseEvent, + int ScrolledX, + int ScrolledY); virtual void Draw(wxDC& Dc, int ScrolledX, int ScrolledY); @@ -203,17 +225,15 @@ int ClipWidth, int ClipHeight); - // May not be called while dragging. - void Select(JZRectangle& rr, int x, int y, int w, int h); + void Select(const JZRectangle& Rectangle); - void Select(JZRectangle& Rectangle); - private: bool mActive; // The following indicates if the rectangle is valid. bool mSelected; + JZRectangle mRectangle; wxWindow* mpWindow; @@ -231,11 +251,16 @@ JZSnapSelection(wxWindow* pWindow); - virtual void Snap(int& x, int& y, bool Up); + virtual void Snap( + int& x, + int& y, + int ScrolledX, + int ScrolledY, + bool Up); - void SetXSnap(int XCount, int* pXVector); + void SetXSnap(int XCount, int* pXVector, int ScrolledX); - void SetYSnap(int YCount, int* pYVector); + void SetYSnap(int YCount, int* pYVector, int ScrolledY); void SetXSnap(int XMin, int XMax, int XStep); @@ -246,6 +271,7 @@ static void SnapToVector( int& Coordinate, std::vector<int> Vector, + int Scrolled, bool Up); static void SnapMod( @@ -253,6 +279,7 @@ int Min, int Max, int Step, + int Scrolled, bool Up); protected: @@ -291,7 +318,7 @@ //***************************************************************************** // MouseCounter - let you enter numbers with left/right mouse button //***************************************************************************** -class tMouseCounter : public wxTimer, public tMouseAction +class tMouseCounter : public wxTimer, public JZMouseAction { public: @@ -314,11 +341,28 @@ int Wait; // don't inc/dec at Init tButtonLabelInterface *win; - virtual int LeftDown(wxMouseEvent& MouseEvent); - virtual int LeftUp(wxMouseEvent& MouseEvent); - virtual int RightDown(wxMouseEvent& MouseEvent); - virtual int RightUp(wxMouseEvent& MouseEvent); + virtual int LeftDown( + wxMouseEvent& MouseEvent, + int ScrolledX, + int ScrolledY); + + virtual int LeftUp( + wxMouseEvent& MouseEvent, + int ScrolledX, + int ScrolledY); + + virtual int RightDown( + wxMouseEvent& MouseEvent, + int ScrolledX, + int ScrolledY); + + virtual int RightUp( + wxMouseEvent& MouseEvent, + int ScrolledX, + int ScrolledY); + virtual void Notify(); + virtual void ShowValue(bool down); }; @@ -326,26 +370,44 @@ //***************************************************************************** // tMarkDestin - mark destination of some operation //***************************************************************************** -class tMarkDestin : public tMouseAction +class tMarkDestin : public JZMouseAction { public: + int Aborted; float x, y; - virtual int LeftDown(wxMouseEvent& MouseEvent); - virtual int RightDown(wxMouseEvent& MouseEvent); + virtual int LeftDown( + wxMouseEvent& MouseEvent, + int ScrolledX, + int ScrolledY); + + virtual int RightDown( + wxMouseEvent& MouseEvent, + int ScrolledX, + int ScrolledY); + tMarkDestin(wxWindow* canvas, wxFrame* frame, int left); private: + wxWindow *Canvas; wxFrame *Frame; - int ButtonDown(wxMouseEvent& MouseEvent); + + int ButtonDown( + wxMouseEvent& MouseEvent, + int ScrolledX, + int ScrolledY); }; +#if 0 + //***************************************************************************** -// tMouseButton - simulate a 3D button +// Description: +// This is the mouse button class declaration. This class simulates a 3D +// button. //***************************************************************************** -class tMouseButton : public tMouseAction +class tMouseButton : public JZMouseAction { public: @@ -353,11 +415,14 @@ JZEventWindow* pEventWindow, JZRectangle* pRectangle, const char* pDownString, - const char* upUpString = 0); + const char* pUpString = 0); virtual ~tMouseButton(); - virtual int ProcessMouseEvent(wxMouseEvent& MouseEvent); + virtual int ProcessMouseEvent( + wxMouseEvent& MouseEvent, + int ScrolledX, + int ScrolledY); protected: @@ -376,4 +441,87 @@ wxString mUpString; }; +#endif + +//***************************************************************************** +// Description: +// These are the mouse action class inline member functions. +//***************************************************************************** +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +inline +int JZMouseAction::LeftDown( + wxMouseEvent& MouseEvent, + int ScrolledX, + int ScrolledY) +{ + return 0; +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +inline +int JZMouseAction::LeftUp( + wxMouseEvent& MouseEvent, + int ScrolledX, + int ScrolledY) +{ + return 0; +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +inline +int JZMouseAction::RightDown( + wxMouseEvent& MouseEvent, + int ScrolledX, + int ScrolledY) +{ + return 0; +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +inline +int JZMouseAction::RightUp( + wxMouseEvent& MouseEvent, + int ScrolledX, + int ScrolledY) +{ + return 0; +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +inline +int JZMouseAction::MiddleDown( + wxMouseEvent& MouseEvent, + int ScrolledX, + int ScrolledY) +{ + return 0; +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +inline +int JZMouseAction::MiddleUp( + wxMouseEvent& MouseEvent, + int ScrolledX, + int ScrolledY) +{ + return 0; +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +inline +int JZMouseAction::Dragging( + wxMouseEvent& MouseEvent, + int ScrolledX, + int ScrolledY) +{ + return 0; +} + #endif // !defined(JZ_MOUSEACTION_H) Modified: trunk/jazz/src/PianoWindow.cpp =================================================================== --- trunk/jazz/src/PianoWindow.cpp 2009-05-17 17:27:44 UTC (rev 721) +++ trunk/jazz/src/PianoWindow.cpp 2009-05-17 17:51:49 UTC (rev 722) @@ -95,13 +95,18 @@ // Description: // JZMousePlay - Click in pianoroll //***************************************************************************** -class JZMousePlay : public tMouseAction +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +class JZMousePlay : public JZMouseAction { public: JZMousePlay(JZPianoWindow* pPianoWindow); - virtual int ProcessMouseEvent(wxMouseEvent& MouseEvent); + virtual int ProcessMouseEvent( + wxMouseEvent& MouseEvent, + int ScrolledX, + int ScrolledY); private: @@ -123,7 +128,10 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -int JZMousePlay::ProcessMouseEvent(wxMouseEvent& MouseEvent) +int JZMousePlay::ProcessMouseEvent( + wxMouseEvent& MouseEvent, + int ScrolledX, + int ScrolledY) { int x, y; MouseEvent.GetPosition(&x, &y); @@ -193,17 +201,26 @@ // Description: // tKeyLengthDragger //***************************************************************************** -class tKeyLengthDragger : public tMouseAction +class tKeyLengthDragger : public JZMouseAction { public: tKeyLengthDragger(tKeyOn* pKeyOn, JZPianoWindow* pPianoWindow); - int Dragging(wxMouseEvent& MouseEvent); + int Dragging( + wxMouseEvent& MouseEvent, + int ScrolledX, + int ScrolledY); - int ButtonUp(wxMouseEvent& MouseEvent); + int ProcessMouseEvent( + wxMouseEvent& MouseEvent, + int ScrolledX, + int ScrolledY); - int ProcessMouseEvent(wxMouseEvent& MouseEvent); + int ButtonUp( + wxMouseEvent& MouseEvent, + int ScrolledX, + int ScrolledY); private: @@ -237,22 +254,28 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -int tKeyLengthDragger::ProcessMouseEvent(wxMouseEvent& MouseEvent) +int tKeyLengthDragger::ProcessMouseEvent( + wxMouseEvent& MouseEvent, + int ScrolledX, + int ScrolledY) { if (MouseEvent.Dragging()) { - return Dragging(MouseEvent); + return Dragging(MouseEvent, ScrolledX, ScrolledY); } else if (MouseEvent.ButtonUp()) { - return ButtonUp(MouseEvent); + return ButtonUp(MouseEvent, ScrolledX, ScrolledY); } return 0; } //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -int tKeyLengthDragger::Dragging(wxMouseEvent& MouseEvent) +int tKeyLengthDragger::Dragging( + wxMouseEvent& MouseEvent, + int ScrolledX, + int ScrolledY) { wxClientDC Dc(Win); Win->PrepareDC(Dc); //to translate scrolled coordinates @@ -273,7 +296,10 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -int tKeyLengthDragger::ButtonUp(wxMouseEvent& MouseEvent) +int tKeyLengthDragger::ButtonUp( + wxMouseEvent& MouseEvent, + int ScrolledX, + int ScrolledY) { // SN++ Key_Aftertouch if (Copy->GetEventLength() < mpKeyOn->GetEventLength()) @@ -325,17 +351,26 @@ // tPlayTrackLengthDragger JAVE this is just copied from tKeyLengthDragger, // the need to be inherited somehow //***************************************************************************** -class tPlayTrackLengthDragger : public tMouseAction +class tPlayTrackLengthDragger : public JZMouseAction { public: tPlayTrackLengthDragger(tPlayTrack* k, JZPianoWindow* pPianoWindow); - int Dragging(wxMouseEvent& MouseEvent); + int Dragging( + wxMouseEvent& MouseEvent, + int ScrolledX, + int ScrolledY); - int ButtonUp(wxMouseEvent& MouseEvent); + int ProcessMouseEvent( + wxMouseEvent& MouseEvent, + int ScrolledX, + int ScrolledY); - int ProcessMouseEvent(wxMouseEvent& MouseEvent); + int ButtonUp( + wxMouseEvent& MouseEvent, + int ScrolledX, + int ScrolledY); private: tPlayTrack* mpKeyOn; @@ -365,22 +400,28 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -int tPlayTrackLengthDragger::ProcessMouseEvent(wxMouseEvent& MouseEvent) +int tPlayTrackLengthDragger::ProcessMouseEvent( + wxMouseEvent& MouseEvent, + int ScrolledX, + int ScrolledY) { if (MouseEvent.Dragging()) { - return Dragging(MouseEvent); + return Dragging(MouseEvent, ScrolledX, ScrolledY); } else if (MouseEvent.ButtonUp()) { - return ButtonUp(MouseEvent); + return ButtonUp(MouseEvent, ScrolledX, ScrolledY); } return 0; } //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -int tPlayTrackLengthDragger::Dragging(wxMouseEvent& MouseEvent) +int tPlayTrackLengthDragger::Dragging( + wxMouseEvent& MouseEvent, + int ScrolledX, + int ScrolledY) { wxClientDC Dc(Win); Win->PrepareDC(Dc); @@ -399,7 +440,10 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -int tPlayTrackLengthDragger::ButtonUp(wxMouseEvent& MouseEvent) +int tPlayTrackLengthDragger::ButtonUp( + wxMouseEvent& MouseEvent, + int ScrolledX, + int ScrolledY) { wxClientDC Dc(Win); Win->PrepareDC(Dc); @@ -441,7 +485,10 @@ Dc.SetFont(*(Win->GetFixedFont())); } - virtual int ProcessMouseEvent(wxMouseEvent& MouseEvent); + virtual int ProcessMouseEvent( + wxMouseEvent& MouseEvent, + int ScrolledX, + int ScrolledY); private: @@ -452,9 +499,12 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -int tVelocCounter::ProcessMouseEvent(wxMouseEvent& MouseEvent) +int tVelocCounter::ProcessMouseEvent( + wxMouseEvent& MouseEvent, + int ScrolledX, + int ScrolledY) { - if (tMouseCounter::ProcessMouseEvent(MouseEvent)) + if (tMouseCounter::ProcessMouseEvent(MouseEvent, ScrolledX, ScrolledY)) { tKeyOn* pKeyOnCopy = (tKeyOn *)mpKeyOn->Copy(); pKeyOnCopy->SetVelocity(Value); @@ -538,24 +588,26 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -const int play_actions[12] = +static const int PlayAreaActions[12] = { + // Depressed mouse button: // left middle right MA_PLAY, MA_CYCLE, 0, // plain MA_CYCLE, 0, 0, // shift 0, 0, 0, // ctrl - 0, 0, 0 // shift+ctrl + 0, 0, 0 // shift + ctrl }; //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -const int evnt_actions[12] = +static const int EventAreaActions[12] = { + // Depressed mouse button: // left middle right MA_SELECT, MA_CUTPASTE, MA_LENGTH, // plain MA_CONTSEL, MA_COPY, MA_LISTEN, // shift MA_VELOCITY, MA_DIALOG, MA_VELOCITY, // ctrl - MA_CUTPASTE, 0, MA_COPY // shift+ctrl + MA_CUTPASTE, 0, MA_COPY // shift + ctrl }; @@ -598,8 +650,8 @@ mpTrack(0), mTrackIndex(0), mpCtrlEdit(0), - mMousePlay(play_actions), - mMouseEvent(evnt_actions), + mMousePlay(PlayAreaActions), + mMouseEvent(EventAreaActions), mUseColors(true), mMouseLine(-1), mFontSize(12), @@ -1653,7 +1705,7 @@ else if (x > mEventsX) { // click in top line - int action = mMousePlay.Action(MouseEvent); + int action = mMousePlay.GetAction(MouseEvent); if (action) { @@ -1897,11 +1949,11 @@ } if (mSnapCount < eMaxSnaps) { - mpSnapSel->SetXSnap(mSnapCount, mSnapsX); + mpSnapSel->SetXSnap(mSnapCount, mSnapsX, 0); } else { - mpSnapSel->SetXSnap(0,0,0); + mpSnapSel->SetXSnap(0, 0, 0); } mpSnapSel->SetYSnap( mFromLine * mTrackHeight + mTopInfoHeight, @@ -2028,7 +2080,7 @@ // invalidate a rect). Refresh(); // } - mpSnapSel->ProcessMouseEvent(MouseEvent); + mpSnapSel->ProcessMouseEvent(MouseEvent, mScrolledX, mScrolledY); mpMouseAction = mpSnapSel; } } @@ -2038,7 +2090,7 @@ { // mpMouseAction active - if (mpMouseAction->ProcessMouseEvent(MouseEvent)) + if (mpMouseAction->ProcessMouseEvent(MouseEvent, mScrolledX, mScrolledY)) { // mpMouseAction finished @@ -2137,7 +2189,7 @@ //----------------------------------------------------------------------------- void JZPianoWindow::MouseEvents(wxMouseEvent& MouseEvent) { - int action = mMouseEvent.Action(MouseEvent); + int action = mMouseEvent.GetAction(MouseEvent); if (action) { @@ -2220,7 +2272,7 @@ r.SetHeight(mTopInfoHeight); tVelocCounter *VelocCounter = new tVelocCounter(this, &r, pKeyOn); - VelocCounter->ProcessMouseEvent(MouseEvent); + VelocCounter->ProcessMouseEvent(MouseEvent, mScrolledX, mScrolledY); mpMouseAction = VelocCounter; } break; @@ -2236,7 +2288,8 @@ if (MouseEvent.ButtonDown()) { mpMouseAction = new JZMousePlay(this); - int Status = mpMouseAction->ProcessMouseEvent(MouseEvent); + int Status = + mpMouseAction->ProcessMouseEvent(MouseEvent, mScrolledX, mScrolledY); if (Status == 1) { delete mpMouseAction; Modified: trunk/jazz/src/PianoWindow.h =================================================================== --- trunk/jazz/src/PianoWindow.h 2009-05-17 17:27:44 UTC (rev 721) +++ trunk/jazz/src/PianoWindow.h 2009-05-17 17:51:49 UTC (rev 722) @@ -305,8 +305,8 @@ tCtrlEditBase* mpCtrlEdit; - tMouseMapper mMousePlay; - tMouseMapper mMouseEvent; + JZMouseMapper mMousePlay; + JZMouseMapper mMouseEvent; // Number of colors to use for velocity representation. enum Modified: trunk/jazz/src/SampleWindow.cpp =================================================================== --- trunk/jazz/src/SampleWindow.cpp 2009-05-17 17:27:44 UTC (rev 721) +++ trunk/jazz/src/SampleWindow.cpp 2009-05-17 17:51:49 UTC (rev 722) @@ -42,7 +42,7 @@ #include <wx/msgdlg.h> #include <wx/scrolbar.h> -#include <iostream> +//DEBUG#include <iostream> #define MEN_LOAD 1 #define MEN_SAVE 2 @@ -158,6 +158,7 @@ int paint_length; JZSnapSelection snapsel; + // sel_fr == 0: no selection and no insertion point // sel_fr > 0 && sel_fr == sel_to: insertion point // sel_fr > 0 && sel_fr < sel_to: selected range @@ -303,7 +304,7 @@ { int cw, ch; GetClientSize(&cw, &ch); - //snapsel.SetYSnap(0, ch, ch / spl.GetChannels()); +// snapsel.SetYSnap(0, ch, ch / spl.GetChannels()); snapsel.SetYSnap(0, ch, ch); AdjustScrollbars(); @@ -340,12 +341,12 @@ { mouse_up_sets_insertion_point = 1; } - snapsel.ProcessMouseEvent(MouseEvent); + snapsel.ProcessMouseEvent(MouseEvent, 0, 0); } else if (MouseEvent.LeftUp()) { mouse_down = FALSE; - snapsel.ProcessMouseEvent(MouseEvent); + snapsel.ProcessMouseEvent(MouseEvent, 0, 0); if (snapsel.IsSelected()) { snapsel.Draw(*pDc, 0, 0); @@ -368,7 +369,7 @@ } else if (MouseEvent.Dragging() && mouse_down) { - snapsel.ProcessMouseEvent(MouseEvent); + snapsel.ProcessMouseEvent(MouseEvent, 0, 0); } } Modified: trunk/jazz/src/Song.cpp =================================================================== --- trunk/jazz/src/Song.cpp 2009-05-17 17:27:44 UTC (rev 721) +++ trunk/jazz/src/Song.cpp 2009-05-17 17:51:49 UTC (rev 722) @@ -109,7 +109,7 @@ return; } - // Clock + Bar auf Anfang naechster Takt + // Clock + Bar at the beginning of the next cycle. mClock += mTicksPerBar; ++mBarIndex; } Modified: trunk/jazz/src/TrackFrame.cpp =================================================================== --- trunk/jazz/src/TrackFrame.cpp 2009-05-17 17:27:44 UTC (rev 721) +++ trunk/jazz/src/TrackFrame.cpp 2009-05-17 17:51:49 UTC (rev 722) @@ -65,7 +65,7 @@ #include <wx/menu.h> #include <wx/msgdlg.h> -#include <iostream> +//DEBUG#include <iostream> using namespace std; Modified: trunk/jazz/src/TrackFrame.h =================================================================== --- trunk/jazz/src/TrackFrame.h 2009-05-17 17:27:44 UTC (rev 721) +++ trunk/jazz/src/TrackFrame.h 2009-05-17 17:51:49 UTC (rev 722) @@ -55,7 +55,7 @@ void NewPlayPosition(int Clock); - // Overridden tButtonLabelInterface finction. + // Overridden tButtonLabelInterface function. virtual void ButtonLabelDisplay(const wxString& Text, bool IsButtonDown); private: Modified: trunk/jazz/src/TrackWindow.cpp =================================================================== --- trunk/jazz/src/TrackWindow.cpp 2009-05-17 17:27:44 UTC (rev 721) +++ trunk/jazz/src/TrackWindow.cpp 2009-05-17 17:51:49 UTC (rev 722) @@ -33,9 +33,9 @@ #include <wx/dcmemory.h> #include <wx/msgdlg.h> -#include <iostream> -#include <sstream> #include <iomanip> +//DEBUG#include <iostream> +#include <sstream> using namespace std; @@ -211,18 +211,18 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZTrackWindow::Mark(int x, int y) -{ - Marked.SetX(x2xBar(x)); - Marked.SetY(y2yLine(y)); - Marked.SetWidth(x2wBar(x)); - Marked.SetHeight(mTrackHeight); +//void JZTrackWindow::Mark(int x, int y) +//{ +// Marked.SetX(x2xBar(x)); +// Marked.SetY(y2yLine(y)); +// Marked.SetWidth(x2wBar(x)); +// Marked.SetHeight(mTrackHeight); +// +// wxDC* pDc = new wxClientDC(this); +// LineText(*pDc, Marked.GetX(), Marked.GetY(), Marked.GetWidth(), ">"); +// delete pDc; +//} - wxDC* pDc = new wxClientDC(this); - LineText(*pDc, Marked.GetX(), Marked.GetY(), Marked.GetWidth(), ">"); - delete pDc; -} - //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- void JZTrackWindow::UnMark() @@ -273,15 +273,11 @@ { JZRectangle Rectangle( 0, - y2yLine(Point.y), - Clock2x(mpSong->GetMaxQuarters() * mpSong->GetTicksPerQuarter()), + y2yLine(Point.y + mScrolledY), + Clock2x(mpSong->GetMaxQuarters() * mpSong->GetTicksPerQuarter()) + + mScrolledX, mTrackHeight); - mpSnapSel->Select( - Rectangle, - mEventsX, - mEventsY, - mEventsWidth, - mEventsHeight); + mpSnapSel->Select(Rectangle); SnapSelectionStop(MouseEvent); } else if ( @@ -289,7 +285,8 @@ Point.y >= mEventsY && Point.y < mEventsY + mEventsHeight) { SnapSelectionStart(MouseEvent); - mpSnapSel->ButtonDown(MouseEvent); + + mpSnapSel->ButtonDown(MouseEvent, mScrolledX, mScrolledY); } } @@ -299,7 +296,7 @@ { if (MouseEvent.LeftIsDown()) { - mpSnapSel->Dragging(MouseEvent); + mpSnapSel->Dragging(MouseEvent, mScrolledX, mScrolledY); // SnapSelectionStop(MouseEvent); Refresh(false); } @@ -410,7 +407,7 @@ Point.x >= mEventsX && Point.x < mEventsX + mEventsWidth && Point.y >= mEventsY && Point.y < mEventsY + mEventsHeight) { - mpSnapSel->ButtonUp(MouseEvent); + mpSnapSel->ButtonUp(MouseEvent, mScrolledX, mScrolledY); // The point is in event area. SnapSelectionStop(MouseEvent); @@ -585,8 +582,8 @@ // Setup the brush that is used to clear the background. LocalDc.SetBackground(*wxWHITE_BRUSH); - // Clear the background using the brush that was just setup, - // in case the following drawing calls fail. + // Clear the background using the brush that was just setup, in case the + // following drawing calls fail. LocalDc.Clear(); GetClientSize(&mCanvasWidth, &mCanvasHeight); @@ -638,7 +635,6 @@ //DEBUG << "To X: " << Clock2x(mToClock) << '\n' //DEBUG << endl; - BarInfo.SetClock(mFromClock); mBarCount = 0; @@ -689,6 +685,8 @@ if (mBarCount < eMaxBars) { mBarX[mBarCount++] = x; +//DEBUG LocalDc.SetPen(*wxRED_PEN); +//DEBUG LocalDc.DrawLine(x, 0, x, mCanvasHeight); } } BarInfo.Next(); @@ -918,7 +916,6 @@ if (Height <= 0) { Height = mTrackHeight; - y = y2yLine(y); } if (Width && Height) { @@ -1177,32 +1174,31 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -int JZTrackWindow::x2xBar(int x) -{ - for (int i = 1; i < mBarCount; ++i) - { - if (x < mBarX[i]) - { - return mBarX[i - 1]; - } - } - return -1; -} +//int JZTrackWindow::x2xBar(int x) +//{ +// for (int i = 1; i < mBarCount; ++i) +// { +// if (x < mBarX[i]) +// { +// return mBarX[i - 1]; +// } +// } +// return -1; +//} - //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -int JZTrackWindow::x2wBar(int x) -{ - for (int i = 1; i < mBarCount; ++i) - { - if (x < mBarX[i]) - { - return mBarX[i] - mBarX[i - 1]; - } - } - return 0; -} +//int JZTrackWindow::x2wBar(int x) +//{ +// for (int i = 1; i < mBarCount; ++i) +// { +// if (x < mBarX[i]) +// { +// return mBarX[i] - mBarX[i - 1]; +// } +// } +// return 0; +//} //----------------------------------------------------------------------------- // Description: @@ -1437,10 +1433,10 @@ //----------------------------------------------------------------------------- void JZTrackWindow::SnapSelectionStart(wxMouseEvent& MouseEvent) { - mpSnapSel->SetXSnap(mBarCount, mBarX); + mpSnapSel->SetXSnap(mBarCount, mBarX, mScrolledX); mpSnapSel->SetYSnap( TrackIndex2y(mFromLine), - mEventsY + mEventsHeight, + mEventsY + mEventsHeight + mScrolledY, mTrackHeight); } Modified: trunk/jazz/src/TrackWindow.h =================================================================== --- trunk/jazz/src/TrackWindow.h 2009-05-17 17:27:44 UTC (rev 721) +++ trunk/jazz/src/TrackWindow.h 2009-05-17 17:51:49 UTC (rev 722) @@ -138,7 +138,7 @@ int h = -1, bool Down = false); - void Mark(int x, int y); +// void Mark(int x, int y); void UnMark(); @@ -146,9 +146,9 @@ const char* GetNumberString() const; - int x2xBar(int x); +// int x2xBar(int x); - int x2wBar(int x); +// int x2wBar(int x); int TrackIndex2y(int Track); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2009-05-18 03:46:00
|
Revision: 723 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=723&view=rev Author: pstieber Date: 2009-05-18 03:45:52 +0000 (Mon, 18 May 2009) Log Message: ----------- Changed rec_info to mpRecordingInfo in the Linux code. Modified Paths: -------------- trunk/jazz/src/AlsaDriver.cpp trunk/jazz/src/AudioDriver.cpp Modified: trunk/jazz/src/AlsaDriver.cpp =================================================================== --- trunk/jazz/src/AlsaDriver.cpp 2009-05-17 17:51:49 UTC (rev 722) +++ trunk/jazz/src/AlsaDriver.cpp 2009-05-18 03:45:52 UTC (rev 723) @@ -56,7 +56,7 @@ mHardExit(true) { mpPlayer->mpListener = this; - mpPlayer->rec_info = 0; // not recording! + mpPlayer->mpRecordingInfo = 0; // not recording! mpPlayer->running_mode = 0; // SYNC seems not to work?? so add 8 more silent buffers @@ -76,7 +76,7 @@ mHardExit(true) { mpPlayer->mpListener = this; - mpPlayer->rec_info = 0; // not recording! + mpPlayer->mpRecordingInfo = 0; // not recording! mpPlayer->running_mode = 0; mpPlayer->OpenDsp(tAlsaAudioPlayer::PLAYBACK, 0); @@ -195,7 +195,7 @@ curr_speed = midi_speed; running_mode = 0; - if (rec_info && rec_info->mpTrack->GetAudioMode()) + if (mpRecordingInfo && mpRecordingInfo->mpTrack->GetAudioMode()) { OpenDsp(CAPTURE, 1); recbuffers.ResetBufferSize(frag_byte_size[CAPTURE]); @@ -623,12 +623,12 @@ CloseDsp(true); if (RecordMode()) { - long frc = rec_info->mFromClock; + long frc = mpRecordingInfo->mFromClock; if (frc < audio_clock_offset) { frc = audio_clock_offset; } - long toc = rec_info->mToClock; + long toc = mpRecordingInfo->mToClock; if (toc > recd_clock) { toc = recd_clock; Modified: trunk/jazz/src/AudioDriver.cpp =================================================================== --- trunk/jazz/src/AudioDriver.cpp 2009-05-17 17:51:49 UTC (rev 722) +++ trunk/jazz/src/AudioDriver.cpp 2009-05-18 03:45:52 UTC (rev 723) @@ -52,7 +52,7 @@ { mpPlayer->mpListener = this; - mpPlayer->rec_info = 0; // not recording! + mpPlayer->mpRecordingInfo = 0; // not recording! // SYNC seems not to work?? so add 8 more silent buffers // to hear the end of the sample too. @@ -72,7 +72,7 @@ mHardExit(true) { mpPlayer->mpListener = this; - mpPlayer->rec_info = 0; // not recording! + mpPlayer->mpRecordingInfo = 0; // not recording! mCount = 8 + mpPlayer->mSamples.PrepareListen(&spl, fr_smpl, to_smpl); mpPlayer->OpenDsp(); @@ -184,7 +184,7 @@ int tAudioPlayer::RecordMode() const { - return rec_info != 0 && rec_info->mpTrack->GetAudioMode(); + return mpRecordingInfo != 0 && mpRecordingInfo->mpTrack->GetAudioMode(); } void tAudioPlayer::StartAudio() @@ -531,12 +531,12 @@ CloseDsp(true); if (RecordMode()) { - long frc = rec_info->mFromClock; + long frc = mpRecordingInfo->mFromClock; if (frc < start_clock) { frc = start_clock; } - long toc = rec_info->mToClock; + long toc = mpRecordingInfo->mToClock; if (toc > recd_clock) { toc = recd_clock; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2009-06-21 20:03:07
|
Revision: 728 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=728&view=rev Author: pstieber Date: 2009-06-21 20:03:06 +0000 (Sun, 21 Jun 2009) Log Message: ----------- 1. Changed mCtrlNames to mControlNames. 2. Fixed the reading of the control names. Modified Paths: -------------- trunk/jazz/src/Configuration.cpp trunk/jazz/src/Configuration.h Modified: trunk/jazz/src/Configuration.cpp =================================================================== --- trunk/jazz/src/Configuration.cpp 2009-06-21 19:45:17 UTC (rev 727) +++ trunk/jazz/src/Configuration.cpp 2009-06-21 20:03:06 UTC (rev 728) @@ -124,7 +124,7 @@ : mFileName(), mDrumNames(), mDrumSets(), - mCtrlNames(), + mControlNames(), mVoiceNames(), mBankTable() { @@ -344,7 +344,7 @@ for (int i = 0; i < 130; ++i) { - mCtrlNames.push_back(make_pair("", i)); + mControlNames.push_back(make_pair("", i)); } mVoiceNames.push_back(make_pair(pNoneString, 0)); @@ -392,8 +392,8 @@ //----------------------------------------------------------------------------- const pair<string, int>& JZConfiguration::GetCtrlName(unsigned Entry) const { - assert((Entry >= 0) && (Entry < mCtrlNames.size())); - return mCtrlNames[Entry]; + assert((Entry >= 0) && (Entry < mControlNames.size())); + return mControlNames[Entry]; } //----------------------------------------------------------------------------- @@ -795,7 +795,7 @@ pVector = &mDrumSets; break; case C_CtrlNames: - pVector = &mCtrlNames; + pVector = &mControlNames; break; case C_DrumNames: pVector = &mDrumNames; @@ -916,7 +916,7 @@ << endl; } } - else if (pVector == &mCtrlNames) + else if (pVector == &mControlNames) { // Controller names. @@ -924,10 +924,11 @@ Iss >> i; assert(0 <= i && i <= 127); - string ControllerName = - TNStringUtilities::TrimLeadingAndTrailingBlanks(Iss.str()); + string ControllerName; + getline(Iss, ControllerName); - mCtrlNames[i + 1].first = ControllerName; + mControlNames[i + 1].first = + TNStringUtilities::TrimLeadingAndTrailingBlanks(ControllerName); } else if (pVector == &mDrumNames) { Modified: trunk/jazz/src/Configuration.h =================================================================== --- trunk/jazz/src/Configuration.h 2009-06-21 19:45:17 UTC (rev 727) +++ trunk/jazz/src/Configuration.h 2009-06-21 20:03:06 UTC (rev 728) @@ -270,7 +270,7 @@ std::vector<std::pair<std::string, int> > mDrumSets; - std::vector<std::pair<std::string, int> > mCtrlNames; + std::vector<std::pair<std::string, int> > mControlNames; std::vector<std::pair<std::string, int> > mVoiceNames; @@ -323,7 +323,7 @@ const std::vector<std::pair<std::string, int> >& JZConfiguration::GetControlNames() const { - return mCtrlNames; + return mControlNames; } //----------------------------------------------------------------------------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2009-06-21 20:47:01
|
Revision: 731 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=731&view=rev Author: pstieber Date: 2009-06-21 20:46:58 +0000 (Sun, 21 Jun 2009) Log Message: ----------- 1. Updated the style of the search and replace and the transpose command classes. 2. Added function comment header lines in the source file. Modified Paths: -------------- trunk/jazz/src/Command.cpp trunk/jazz/src/Command.h Modified: trunk/jazz/src/Command.cpp =================================================================== --- trunk/jazz/src/Command.cpp 2009-06-21 20:10:22 UTC (rev 730) +++ trunk/jazz/src/Command.cpp 2009-06-21 20:46:58 UTC (rev 731) @@ -157,21 +157,21 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void tScale::Init(int ScaleNr, JZFilter* pFilter) +void tScale::Init(int ScaleIndex, JZFilter* pFilter) { for (int i = 0; i < 12; ++i) { ScaleKeys[i] = 0; } - if (ScaleNr == gScaleChromatic) + if (ScaleIndex == gScaleChromatic) { for (int i = 0; i < 12; ++i) { ScaleKeys[i] = 1; } } - else if (ScaleNr == gScaleSelected) + else if (ScaleIndex == gScaleSelected) { bool Found = false; tSelectedKeys cmd(pFilter); @@ -193,7 +193,7 @@ { for (int i = 0; i < 12; ++i) { - ScaleKeys[ (i + ScaleNr) % 12 ] = CMajor[i]; + ScaleKeys[ (i + ScaleIndex) % 12 ] = CMajor[i]; } } } @@ -318,6 +318,8 @@ { } +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void tCmdShift::ExecuteEvent(JZTrack* pTrack, JZEvent* pEvent) { JZEvent* pEventCopy = pEvent->Copy(); @@ -326,16 +328,19 @@ pTrack->Put(pEventCopy); } -// ************************************************************************ +//***************************************************************************** // tCmdErase -// ************************************************************************ - +//***************************************************************************** +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- tCmdErase::tCmdErase(JZFilter* pFilter, int lvsp) : tCommand(pFilter) { LeaveSpace = lvsp; } +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void tCmdErase::Execute(int NewUndo) { tCommand::Execute(NewUndo); @@ -350,15 +355,18 @@ } } +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void tCmdErase::ExecuteEvent(JZTrack* pTrack, JZEvent* pEvent) { pTrack->Kill(pEvent); } -// ************************************************************************ +//***************************************************************************** // tCmdQuantize -// ************************************************************************ - +//***************************************************************************** +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- tCmdQuantize::tCmdQuantize( JZFilter* pFilter, int QntClocks, @@ -375,6 +383,8 @@ { } +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- long tCmdQuantize::Quantize(int Clock, int islen) { Clock += mQntClocks / 2; @@ -388,6 +398,8 @@ return Clock > MinClock ? Clock : MinClock; } +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void tCmdQuantize::ExecuteEvent(JZTrack* pTrack, JZEvent* pEvent) { tKeyOn* pKeyOn; @@ -407,32 +419,40 @@ } } -// ************************************************************************ +//***************************************************************************** // tCmdTranspose -// ************************************************************************ - -tCmdTranspose::tCmdTranspose(JZFilter* pFilter, int notes, int ScaleNr, int fit) - : tCommand(pFilter) +//***************************************************************************** +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +tCmdTranspose::tCmdTranspose( + JZFilter* pFilter, + int Notes, + int ScaleIndex, + bool FitIntoScale) + : tCommand(pFilter), + mNotes(Notes), + mFitIntoScale(FitIntoScale), + mScale() { - Scale.Init(ScaleNr, mpFilter); - Notes = notes; - FitIntoScale = fit; + mScale.Init(ScaleIndex, mpFilter); } +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void tCmdTranspose::ExecuteEvent(JZTrack* pTrack, JZEvent* pEvent) { tKeyOn* pKeyOn; if (pEvent->IsKeyOn()) { pKeyOn = (tKeyOn *)pEvent->Copy(); - if (FitIntoScale) + if (mFitIntoScale) { - pKeyOn->SetKey(pKeyOn->GetKey() + Notes); - pKeyOn->SetKey(Scale.FitInto(pKeyOn->GetKey())); + pKeyOn->SetKey(pKeyOn->GetKey() + mNotes); + pKeyOn->SetKey(mScale.FitInto(pKeyOn->GetKey())); } - else if (Notes) + else if (mNotes) { - pKeyOn->SetKey(Scale.Transpose(pKeyOn->GetKey(), Notes)); + pKeyOn->SetKey(mScale.Transpose(pKeyOn->GetKey(), mNotes)); } pTrack->Kill(pEvent); pTrack->Put(pKeyOn); @@ -442,30 +462,33 @@ if (pEvent->IsKeyPressure()) { tKeyPressure* pKeyPressure = (tKeyPressure *)pEvent->Copy(); - if (FitIntoScale) + if (mFitIntoScale) { - pKeyPressure->SetKey(pKeyPressure->GetKey() + Notes); - pKeyPressure->SetKey(Scale.FitInto(pKeyPressure->GetKey())); + pKeyPressure->SetKey(pKeyPressure->GetKey() + mNotes); + pKeyPressure->SetKey(mScale.FitInto(pKeyPressure->GetKey())); } - else if (Notes) + else if (mNotes) { - pKeyPressure->SetKey(Scale.Transpose(pKeyPressure->GetKey(), Notes)); + pKeyPressure->SetKey(mScale.Transpose(pKeyPressure->GetKey(), mNotes)); } pTrack->Kill(pEvent); pTrack->Put(pKeyPressure); } } -// ************************************************************************ +//***************************************************************************** // tCmdSetChannel -// ************************************************************************ - +//***************************************************************************** +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- tCmdSetChannel::tCmdSetChannel(JZFilter* pFilter, int NewChannel) : tCommand(pFilter), mNewChannel(NewChannel) { } +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void tCmdSetChannel::ExecuteEvent(JZTrack* pTrack, JZEvent* pEvent) { tChannelEvent* pChannelEvent; @@ -479,10 +502,11 @@ } } -// ************************************************************************ +//***************************************************************************** // tCmdVelocity -// ************************************************************************ - +//***************************************************************************** +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- tCmdVelocity::tCmdVelocity( JZFilter* pFilter, int FromValue, @@ -495,6 +519,8 @@ { } +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void tCmdVelocity::ExecuteEvent(JZTrack* pTrack, JZEvent* pEvent) { tKeyOn* pKeyOn; @@ -528,10 +554,11 @@ } } -// ************************************************************************ +//***************************************************************************** // tCmdLength -// ************************************************************************ - +//***************************************************************************** +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- tCmdLength::tCmdLength( JZFilter* pFilter, int FromValue, @@ -544,6 +571,8 @@ { } +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void tCmdLength::ExecuteEvent(JZTrack* pTrack, JZEvent* pEvent) { tKeyOn* pKeyOn; @@ -578,14 +607,13 @@ } } - - -// ************************************************************************ +//***************************************************************************** // tCmdSeqLength // 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) : tCommand(pFilter) { @@ -593,8 +621,9 @@ this->startClock=-1000; } -/** move an event according to startclock and scale - */ +//----------------------------------------------------------------------------- +// move an event according to startclock and scale +//----------------------------------------------------------------------------- void tCmdSeqLength::ExecuteEvent(JZTrack* pTrack, JZEvent* pEvent) { // Make a copy of the current event. @@ -613,21 +642,22 @@ pTrack->Put(k); } - - -// ************************************************************************ +//***************************************************************************** // tCmdConvertToModulation // JAVE this command is supposed convert a midi note sequence // to a pitch bend/volume control sequence instead -// ************************************************************************ - +//***************************************************************************** +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- tCmdConvertToModulation::tCmdConvertToModulation(JZFilter* pFilter) : tCommand(pFilter) { } -//need to override executetrack, since we have begin/end behaviour in this filter - +//----------------------------------------------------------------------------- +// need to override executetrack, since we have begin/end behaviour in this +// filter +//----------------------------------------------------------------------------- void tCmdConvertToModulation::ExecuteTrack(JZTrack* pTrack) { // JAVE: @@ -714,11 +744,12 @@ pTrack->Cleanup(); } -// ************************************************************************ +//***************************************************************************** // tMidiDelayDlg // JAVE this is a simple midi delay line -// ************************************************************************ - +//***************************************************************************** +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- tCmdMidiDelay::tCmdMidiDelay( JZFilter* pFilter, double scale, @@ -731,6 +762,8 @@ this->repeat=repeat; } +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void tCmdMidiDelay::ExecuteEvent(JZTrack* pTrack, JZEvent* pEvent) { tKeyOn* pKeyOn; @@ -749,12 +782,11 @@ } } - - -// ************************************************************************ +//***************************************************************************** // tCmdCleanup -// ************************************************************************ - +//***************************************************************************** +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- tCmdCleanup::tCmdCleanup(JZFilter* pFilter, long clks, int so) : tCommand(pFilter) { @@ -762,12 +794,16 @@ shortenOverlaps = so; } +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void tCmdCleanup::ExecuteTrack(JZTrack* pTrack) { memset(prev_note, 0, sizeof(prev_note)); tCommand::ExecuteTrack(pTrack); } +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void tCmdCleanup::ExecuteEvent(JZTrack* pTrack, JZEvent* pEvent) { tKeyOn* pKeyOn; @@ -799,36 +835,40 @@ } } -// ************************************************************************ +//***************************************************************************** // tCmdSearchReplace -// ************************************************************************ - -tCmdSearchReplace::tCmdSearchReplace(JZFilter* pFilter, short sf, short st) - : tCommand(pFilter) +//***************************************************************************** +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +tCmdSearchReplace::tCmdSearchReplace(JZFilter* pFilter, short From, short To) + : tCommand(pFilter), + mFrom(From), + mTo(To) { - fr = sf; - to = st; } +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void tCmdSearchReplace::ExecuteEvent(JZTrack* pTrack, JZEvent* pEvent) { tControl* pControl = pEvent->IsControl(); if (pControl) { - if (pControl->GetControl() == fr) + if (pControl->GetControl() == mFrom) { tControl* pControlCopy = (tControl *)pControl->Copy(); - pControlCopy->SetControl(to); + pControlCopy->SetControl(mTo); pTrack->Kill(pControl); pTrack->Put(pControlCopy); } } } -// ************************************************************************ +//***************************************************************************** // tCmdCopyToBuffer -// ************************************************************************ - +//***************************************************************************** +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- tCmdCopyToBuffer::tCmdCopyToBuffer( JZFilter* pFilter, tEventArray* pBuffer) @@ -837,17 +877,18 @@ mpBuffer = pBuffer; } +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void tCmdCopyToBuffer::ExecuteEvent(JZTrack* pTrack, JZEvent* pEvent) { mpBuffer->Put(pEvent->Copy()); } -// ********************************************************************** +//***************************************************************************** // tCmdCopy -// ********************************************************************** - - - +//***************************************************************************** +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- tCmdCopy::tCmdCopy(JZFilter* pFilter, long dt, long dc) : tCommand(pFilter) { @@ -867,8 +908,8 @@ } } - - +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void tCmdCopy::ExecuteTrack(JZTrack *s) { long StartClock, StopClock; @@ -985,15 +1026,18 @@ } } -// ************************************************************************ +//***************************************************************************** // tCmdExchLeftRight -// ************************************************************************ - +//***************************************************************************** +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- tCmdExchLeftRight::tCmdExchLeftRight(JZFilter* pFilter) : tCommand(pFilter) { } +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void tCmdExchLeftRight::ExecuteEvent(JZTrack* pTrack, JZEvent* pEvent) { if (pEvent->IsKeyOn()) @@ -1006,16 +1050,18 @@ } } - -// ************************************************************************ +//***************************************************************************** // tCmdExchUpDown -// ************************************************************************ - +//***************************************************************************** +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- tCmdExchUpDown::tCmdExchUpDown(JZFilter* pFilter) : tCommand(pFilter) { } +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void tCmdExchUpDown::ExecuteTrack(JZTrack* pTrack) { int i; Modified: trunk/jazz/src/Command.h =================================================================== --- trunk/jazz/src/Command.h 2009-06-21 20:10:22 UTC (rev 730) +++ trunk/jazz/src/Command.h 2009-06-21 20:46:58 UTC (rev 731) @@ -199,10 +199,15 @@ //***************************************************************************** class tCmdSearchReplace : public tCommand { - short fr, to; public: - tCmdSearchReplace(JZFilter* pFilter, short fr, short to); + + tCmdSearchReplace(JZFilter* pFilter, short From, short To); + virtual void ExecuteEvent(JZTrack* pTrack, JZEvent* pEvent); + + private: + + short mFrom, mTo; }; //***************************************************************************** @@ -239,15 +244,20 @@ class tCmdTranspose : public tCommand { public: - int Notes; - int FitIntoScale; - tScale Scale; + tCmdTranspose( JZFilter* pFilter, int Notes, - int ScaleNr = 0, - int FitIntoScale = 0); + int ScaleIndex = 0, + bool FitIntoScale = false); + virtual void ExecuteEvent(JZTrack* pTrack, JZEvent* pEvent); + + private: + + int mNotes; + int mFitIntoScale; + tScale mScale; }; //***************************************************************************** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2010-04-03 14:50:56
|
Revision: 742 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=742&view=rev Author: pstieber Date: 2010-04-03 14:50:50 +0000 (Sat, 03 Apr 2010) Log Message: ----------- Removed some unneeded include files. Modified Paths: -------------- trunk/jazz/src/Dialogs.cpp trunk/jazz/src/EventWindow.cpp Modified: trunk/jazz/src/Dialogs.cpp =================================================================== --- trunk/jazz/src/Dialogs.cpp 2010-04-03 02:35:53 UTC (rev 741) +++ trunk/jazz/src/Dialogs.cpp 2010-04-03 14:50:50 UTC (rev 742) @@ -37,7 +37,6 @@ #include "PianoWindow.h" #include "Player.h" #include "ProjectManager.h" -#include "PropertyListDialog.h" #include "Song.h" #include "Synth.h" #include "Track.h" Modified: trunk/jazz/src/EventWindow.cpp =================================================================== --- trunk/jazz/src/EventWindow.cpp 2010-04-03 02:35:53 UTC (rev 741) +++ trunk/jazz/src/EventWindow.cpp 2010-04-03 14:50:50 UTC (rev 742) @@ -39,7 +39,6 @@ #include "Song.h" #include "Help.h" #include "ProjectManager.h" -#include "PropertyListDialog.h" #include <wx/dc.h> #include <wx/msgdlg.h> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2010-04-04 20:31:05
|
Revision: 743 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=743&view=rev Author: pstieber Date: 2010-04-04 20:30:59 +0000 (Sun, 04 Apr 2010) Log Message: ----------- 1. Changed ID_AUDIO_GLOBAL to ID_AUDIO_GLOBAL_SETTINGS. 2. Prepared a handler for this event. Modified Paths: -------------- trunk/jazz/src/Audio.cpp trunk/jazz/src/Resources.h trunk/jazz/src/TrackFrame.cpp trunk/jazz/src/TrackFrame.h Modified: trunk/jazz/src/Audio.cpp =================================================================== --- trunk/jazz/src/Audio.cpp 2010-04-03 14:50:50 UTC (rev 742) +++ trunk/jazz/src/Audio.cpp 2010-04-04 20:30:59 UTC (rev 743) @@ -3,7 +3,7 @@ // // Copyright (C) 1994-2000 Andreas Voss and Per Sigmond, all rights reserved. // Modifications Copyright (C) 2004 Patrick Earl -// Modifications Copyright (C) 2008 Peter J. Stieber +// Modifications Copyright (C) 2008-2010 Peter J. Stieber // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -1354,7 +1354,7 @@ return 1; } - case ID_AUDIO_GLOBAL: + case ID_AUDIO_GLOBAL_SETTINGS: GlobalSettingsDlg(); break; Modified: trunk/jazz/src/Resources.h =================================================================== --- trunk/jazz/src/Resources.h 2010-04-03 14:50:50 UTC (rev 742) +++ trunk/jazz/src/Resources.h 2010-04-04 20:30:59 UTC (rev 743) @@ -3,7 +3,7 @@ // // Copyright (C) 1994-2000 Andreas Voss and Per Sigmond, all rights reserved. // Modifications Copyright (C) 2004 Patrick Earl -// Modifications Copyright (C) 2008 Peter J. Stieber +// Modifications Copyright (C) 2008-2010 Peter J. Stieber // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -37,7 +37,7 @@ #define ID_SETTINGS_SYNTHESIZER wxID_HIGHEST + 11 #define ID_SETTINGS_MIDI_DEVICE wxID_HIGHEST + 12 -#define ID_AUDIO_GLOBAL wxID_HIGHEST + 20 +#define ID_AUDIO_GLOBAL_SETTINGS wxID_HIGHEST + 20 #define ID_AUDIO_SAMPLES wxID_HIGHEST + 21 #define ID_AUDIO_LOAD wxID_HIGHEST + 22 #define ID_AUDIO_SAVE wxID_HIGHEST + 23 Modified: trunk/jazz/src/TrackFrame.cpp =================================================================== --- trunk/jazz/src/TrackFrame.cpp 2010-04-03 14:50:50 UTC (rev 742) +++ trunk/jazz/src/TrackFrame.cpp 2010-04-04 20:30:59 UTC (rev 743) @@ -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-2009 Peter J. Stieber +// Modifications Copyright (C) 2008-2010 Peter J. Stieber // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -107,6 +107,8 @@ EVT_MENU(ID_SETTINGS_MIDI_DEVICE, JZTrackFrame::OnSettingsMidiDevice) + EVT_MENU(ID_AUDIO_GLOBAL_SETTINGS, JZTrackFrame::OnAudioGlobalSettings) + EVT_MENU(wxID_HELP_CONTENTS, JZTrackFrame::OnHelpContents) EVT_MENU(wxID_ABOUT, JZTrackFrame::OnHelpAbout) @@ -399,7 +401,7 @@ pMenuBar->Append(pSettingMenu, "&Settings"); wxMenu* pAudioMenu = new wxMenu; - pAudioMenu->Append(ID_AUDIO_GLOBAL, "&Global Settings..."); + pAudioMenu->Append(ID_AUDIO_GLOBAL_SETTINGS, "&Global Settings..."); pAudioMenu->Append(ID_AUDIO_SAMPLES, "Sample Se&ttings... "); pAudioMenu->Append(ID_AUDIO_LOAD, "&Load Set..."); pAudioMenu->Append(ID_AUDIO_SAVE, "&Save Set"); @@ -640,6 +642,13 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- +void JZTrackFrame::OnAudioGlobalSettings(wxCommandEvent& Event) +{ +// mpTrackWindow->EditAudioGlobalSettings(*this); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void JZTrackFrame::OnHelpContents(wxCommandEvent& Event) { ::wxGetApp().DisplayHelpContents(); Modified: trunk/jazz/src/TrackFrame.h =================================================================== --- trunk/jazz/src/TrackFrame.h 2010-04-03 14:50:50 UTC (rev 742) +++ trunk/jazz/src/TrackFrame.h 2010-04-04 20:30:59 UTC (rev 743) @@ -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-2009 Peter J. Stieber +// Modifications Copyright (C) 2008-2010 Peter J. Stieber // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -98,6 +98,8 @@ void OnSettingsMidiDevice(wxCommandEvent& Event); + void OnAudioGlobalSettings(wxCommandEvent& Event); + void OnHelpContents(wxCommandEvent& Event); void OnHelpAbout(wxCommandEvent& Event); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2010-04-05 03:53:49
|
Revision: 744 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=744&view=rev Author: pstieber Date: 2010-04-05 03:53:42 +0000 (Mon, 05 Apr 2010) Log Message: ----------- Getting ready to make the audio dialogs accessible. Modified Paths: -------------- trunk/jazz/src/AlsaDriver.cpp trunk/jazz/src/AlsaPlayer.cpp trunk/jazz/src/Audio.cpp trunk/jazz/src/Audio.h trunk/jazz/src/AudioDriver.cpp trunk/jazz/src/ControlEdit.cpp trunk/jazz/src/Dialogs.cpp trunk/jazz/src/EventWindow.cpp trunk/jazz/src/EventWindow.h trunk/jazz/src/PianoFrame.cpp trunk/jazz/src/PianoFrame.h trunk/jazz/src/PianoWindow.cpp trunk/jazz/src/PianoWindow.h trunk/jazz/src/Player.cpp trunk/jazz/src/Player.h trunk/jazz/src/PortMidiPlayer.cpp trunk/jazz/src/Project.cpp trunk/jazz/src/Project.h trunk/jazz/src/ProjectManager.cpp trunk/jazz/src/Sample.h trunk/jazz/src/Track.cpp trunk/jazz/src/Track.h trunk/jazz/src/TrackFrame.cpp trunk/jazz/src/TrackFrame.h trunk/jazz/src/TrackWindow.cpp trunk/jazz/src/TrackWindow.h trunk/jazz/src/mswin/WindowsAudioInterface.cpp trunk/jazz/src/mswin/WindowsPlayer.cpp Modified: trunk/jazz/src/AlsaDriver.cpp =================================================================== --- trunk/jazz/src/AlsaDriver.cpp 2010-04-04 20:30:59 UTC (rev 743) +++ trunk/jazz/src/AlsaDriver.cpp 2010-04-05 03:53:42 UTC (rev 744) @@ -125,7 +125,7 @@ tAlsaAudioPlayer::tAlsaAudioPlayer(JZSong* pSong) : tAlsaPlayer(pSong) { - AudioBuffer = new tEventArray(); + mpAudioBuffer = new tEventArray(); mInstalled = false; audio_enabled = 0; mpListener = 0; @@ -146,7 +146,7 @@ tAlsaAudioPlayer::~tAlsaAudioPlayer() { delete mpListener; - delete AudioBuffer; + delete mpAudioBuffer; if (pcm[PLAYBACK]) { snd_pcm_close(pcm[PLAYBACK]); @@ -186,12 +186,12 @@ return; } - long ticks_per_minute = Song->GetTicksPerQuarter() * Song->Speed(); - mSamples.ResetBuffers(AudioBuffer, clock, ticks_per_minute); + long ticks_per_minute = mpSong->GetTicksPerQuarter() * mpSong->Speed(); + mSamples.ResetBuffers(mpAudioBuffer, clock, ticks_per_minute); last_scount = 0; cur_pos = 0; audio_clock_offset = clock; - midi_speed = Song->Speed(); + midi_speed = mpSong->Speed(); curr_speed = midi_speed; running_mode = 0; @@ -208,7 +208,7 @@ { OpenDsp(PLAYBACK, 1); mSamples.ResetBufferSize(frag_byte_size[PLAYBACK]); - mSamples.FillBuffers(OutClock); + mSamples.FillBuffers(mOutClock); } if (running_mode == 0) @@ -412,7 +412,7 @@ WriteSamples(); // The code may hang here when swapping in pages. - mSamples.FillBuffers(OutClock); + mSamples.FillBuffers(mOutClock); WriteSamples(); } @@ -521,8 +521,8 @@ if (pcm[PLAYBACK]) { snd_pcm_drop(pcm[PLAYBACK]); -// long ticks_per_minute = Song->GetTicksPerQuarter() * Song->Speed(); -// mSamples.ResetBuffers(AudioBuffer, clock, ticks_per_minute); +// long ticks_per_minute = mpSong->GetTicksPerQuarter() * mpSong->Speed(); +// mSamples.ResetBuffers(mpAudioBuffer, clock, ticks_per_minute); } audio_clock_offset = clock; cur_pos = 0; Modified: trunk/jazz/src/AlsaPlayer.cpp =================================================================== --- trunk/jazz/src/AlsaPlayer.cpp 2010-04-04 20:30:59 UTC (rev 743) +++ trunk/jazz/src/AlsaPlayer.cpp 2010-04-05 03:53:42 UTC (rev 744) @@ -49,13 +49,13 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -tAlsaPlayer::tAlsaPlayer(JZSong *song) - : JZPlayer(song) +tAlsaPlayer::tAlsaPlayer(JZSong* pSong) + : JZPlayer(pSong) { ithru = othru = 0; mInstalled = true; - poll_millisec = 25; + mPollMillisec = 25; recd_clock = 0; echo_clock = 0; @@ -520,7 +520,7 @@ //----------------------------------------------------------------------------- void tAlsaPlayer::OutBreak() { - OutBreak(OutClock); + OutBreak(mOutClock); } //----------------------------------------------------------------------------- @@ -610,48 +610,48 @@ cout << "tAlsaPlayer::Notify rewind" << endl; ResetPlay(Now); mPlayBuffer.Clear(); - OutClock = Now + FIRST_DELTACLOCK; - PlayLoop->PrepareOutput(&mPlayBuffer, Song, Now, OutClock, 0); - if (AudioBuffer) + mOutClock = Now + FIRST_DELTACLOCK; + mpPlayLoop->PrepareOutput(&mPlayBuffer, mpSong, Now, mOutClock, 0); + if (mpAudioBuffer) { - AudioBuffer->Clear(); - PlayLoop->PrepareOutput(AudioBuffer, Song, Now, OutClock, 1); + mpAudioBuffer->Clear(); + mpPlayLoop->PrepareOutput(mpAudioBuffer, mpSong, Now, mOutClock, 1); } mPlayBuffer.Length2Keyoff(); } else { // time to put more events - if (Now >= (OutClock - ADVANCE_PLAY)) + if (Now >= (mOutClock - ADVANCE_PLAY)) { - PlayLoop->PrepareOutput( + mpPlayLoop->PrepareOutput( &mPlayBuffer, - Song, - OutClock, + mpSong, + mOutClock, Now + DELTACLOCK, 0); - if (AudioBuffer) + if (mpAudioBuffer) { - PlayLoop->PrepareOutput( - AudioBuffer, - Song, - OutClock, + mpPlayLoop->PrepareOutput( + mpAudioBuffer, + mpSong, + mOutClock, Now + DELTACLOCK, 1); } - OutClock = Now + DELTACLOCK; + mOutClock = Now + DELTACLOCK; mPlayBuffer.Length2Keyoff(); } } play_clock = Now; - if (mPlayBuffer.nEvents && mPlayBuffer.Events[0]->GetClock() < OutClock) + if (mPlayBuffer.nEvents && mPlayBuffer.Events[0]->GetClock() < mOutClock) { FlushToDevice(); } else { - OutBreak(); // does nothing unless OutClock has changed + OutBreak(); // does nothing unless mOutClock has changed } } @@ -688,8 +688,8 @@ //----------------------------------------------------------------------------- int tAlsaPlayer::start_timer(long clock) { - int time_base = Song->GetTicksPerQuarter(); - int cur_speed = Song->GetTrack(0)->GetCurrentSpeed(clock); + int time_base = mpSong->GetTicksPerQuarter(); + int cur_speed = mpSong->GetTrack(0)->GetCurrentSpeed(clock); init_queue_tempo(time_base, cur_speed); start_queue_timer(clock); return 0; @@ -923,7 +923,7 @@ { // Not all events are to be recorded. Only those filtered out and put // into the event. - pEvent->SetClock(PlayLoop->Ext2IntClock(ev->time.tick)); + pEvent->SetClock(mpPlayLoop->Ext2IntClock(ev->time.tick)); mRecdBuffer.Put(pEvent); } } @@ -947,7 +947,7 @@ if (recd_clock != old_recd_clock) { JZProjectManager::Instance()->NewPlayPosition( - PlayLoop->Ext2IntClock(recd_clock / 48 * 48)); + mpPlayLoop->Ext2IntClock(recd_clock / 48 * 48)); } return recd_clock; } Modified: trunk/jazz/src/Audio.cpp =================================================================== --- trunk/jazz/src/Audio.cpp 2010-04-04 20:30:59 UTC (rev 743) +++ trunk/jazz/src/Audio.cpp 2010-04-05 03:53:42 UTC (rev 744) @@ -203,7 +203,7 @@ adjust_audio_length = 1; has_changed = false; spl_dialog = 0; - glb_dialog = 0; + mpGlobalSettingsDialog = 0; is_playing = 0; softsync = 1; dirty = 0; @@ -744,7 +744,7 @@ if (set.is_playing) return; wxBeginBusyCursor(); - set.glb_dialog = 0; + set.mpGlobalSettingsDialog = 0; speed = atol(speedstr); set.SetSpeed(speed); set.SetChannels(stereo ? 2 : 1); @@ -782,7 +782,7 @@ } void OnCancel() { - set.glb_dialog = 0; + set.mpGlobalSettingsDialog = 0; wxForm::OnCancel(); } private: @@ -811,16 +811,16 @@ return; } - if (glb_dialog == 0) + if (mpGlobalSettingsDialog == 0) { #ifdef OBSOLETE - glb_dialog = new wxDialogBox(gpTrackWindow, "Audio Settings", false); + mpGlobalSettingsDialog = new wxDialogBox(gpTrackWindow, "Audio Settings", false); tAudioGloblForm *form = new tAudioGloblForm(*this); - form->AssociatePanel(glb_dialog); - glb_dialog->Fit(); + form->AssociatePanel(mpGlobalSettingsDialog); + mpGlobalSettingsDialog->Fit(); #endif // OBSOLETE } - glb_dialog->Show(true); + mpGlobalSettingsDialog->Show(true); } //----------------------------------------------------------------------------- @@ -898,12 +898,12 @@ // delete selection #ifdef OBSOLETE - JZSong *song = gpProject->Song; + JZSong* pSong = gpProject->mpSong; #endif const JZRecordingInfo* info = gpProject->GetRecInfo(); JZTrack* track = info->mpTrack; #ifdef OBSOLETE - song->NewUndoBuffer(); + pSong->NewUndoBuffer(); #endif tEventIterator iter(info->mpTrack); JZEvent *e = iter.Range(frc, toc); @@ -1286,9 +1286,9 @@ //----------------------------------------------------------------------------- void tSampleSet::SamplesDlg() { - if (glb_dialog) + if (mpGlobalSettingsDialog) { - glb_dialog->Show(true); + mpGlobalSettingsDialog->Show(true); return; } if (spl_dialog == 0) @@ -1363,7 +1363,7 @@ return 1; case ID_AUDIO_NEW: - if (spl_dialog == 0 && glb_dialog == 0) + if (spl_dialog == 0 && mpGlobalSettingsDialog == 0) { if (wxMessageBox("Clear Sample Set?", "Confirm", wxYES_NO) == wxNO) { Modified: trunk/jazz/src/Audio.h =================================================================== --- trunk/jazz/src/Audio.h 2010-04-04 20:30:59 UTC (rev 743) +++ trunk/jazz/src/Audio.h 2010-04-05 03:53:42 UTC (rev 744) @@ -221,6 +221,8 @@ class tSamplesDlg; +//***************************************************************************** +//***************************************************************************** class tSampleSet { private: @@ -368,6 +370,8 @@ return *samples[i]; } + void GlobalSettingsDlg(); + protected: long SampleSize(long num_samples) @@ -375,6 +379,15 @@ return channels * (bits == 8 ? 1L : 2L) * num_samples; } + long BufferClock(int i) const + { + return (long)(start_clock + i * clocks_per_buffer); + } + + void SamplesDlg(); + + protected: + long speed; // samples / second int channels; // mono = 1, stereo = 2 int bits; // must be 16! @@ -389,7 +402,6 @@ int event_index; - unsigned int bufbytes; // buffer size in byte unsigned int bufshorts; // buffer size in short tAudioBuffer *buffers[BUFCOUNT]; // all the audio buffers @@ -399,20 +411,18 @@ // return the start clock for i-th free buffer long buffers_written; // for computing buffers clock - long BufferClock(int i) const - { - return (long)(start_clock + i * clocks_per_buffer); - } - void GlobalSettingsDlg(); - void SamplesDlg(); - wxDialog *glb_dialog; - tSamplesDlg *spl_dialog; + wxDialog* mpGlobalSettingsDialog; + tSamplesDlg* spl_dialog; - tEventArray *events; + tEventArray* events; - enum { MAXPOLY = 100 }; - tSampleVoice * voices[MAXPOLY]; + enum + { + MAXPOLY = 100 + }; + + tSampleVoice* voices[MAXPOLY]; int num_voices; int adjust_audio_length; Modified: trunk/jazz/src/AudioDriver.cpp =================================================================== --- trunk/jazz/src/AudioDriver.cpp 2010-04-04 20:30:59 UTC (rev 743) +++ trunk/jazz/src/AudioDriver.cpp 2010-04-05 03:53:42 UTC (rev 744) @@ -122,7 +122,7 @@ : tSeq2Player(pSong) { long dummy = 0; - AudioBuffer = new tEventArray(); + mpAudioBuffer = new tEventArray(); mInstalled = false; dummy = gpConfig->GetValue(C_EnableAudio); audio_enabled = dummy; @@ -171,9 +171,11 @@ tAudioPlayer::~tAudioPlayer() { delete mpListener; - delete AudioBuffer; + delete mpAudioBuffer; if (dev >= 0) + { close(dev); + } } @@ -194,16 +196,16 @@ return; } - long ticks_per_minute = Song->GetTicksPerQuarter() * Song->Speed(); - mSamples.ResetBuffers(AudioBuffer, start_clock, ticks_per_minute); + long ticks_per_minute = mpSong->GetTicksPerQuarter() * mpSong->Speed(); + mSamples.ResetBuffers(mpAudioBuffer, start_clock, ticks_per_minute); if (PlaybackMode()) { - mSamples.FillBuffers(OutClock); + mSamples.FillBuffers(mOutClock); } audio_bytes = 0; midi_clock = 0; - midi_speed = Song->Speed(); + midi_speed = mpSong->Speed(); curr_speed = midi_speed; OpenDsp(); @@ -351,7 +353,7 @@ WriteSamples(); // here it may hang when swapping in pages - mSamples.FillBuffers(OutClock); + mSamples.FillBuffers(mOutClock); WriteSamples(); } Modified: trunk/jazz/src/ControlEdit.cpp =================================================================== --- trunk/jazz/src/ControlEdit.cpp 2010-04-04 20:30:59 UTC (rev 743) +++ trunk/jazz/src/ControlEdit.cpp 2010-04-05 03:53:42 UTC (rev 744) @@ -25,7 +25,7 @@ #include "EventWindow.h" #include "Filter.h" #include "PianoWindow.h" -#include "Song.h" +#include "Project.h" #include "Track.h" #include <wx/button.h> @@ -259,7 +259,7 @@ void tCtrlEditBase::OnApply() { wxBeginBusyCursor(); - mpPianoWindow->GetSong()->NewUndoBuffer(); + mpPianoWindow->GetProject()->NewUndoBuffer(); // delete old events, but skip clock 0 to preserve track defaults: // (dirty but might work...) tEventIterator iter(track); @@ -383,7 +383,7 @@ // av: called by tArrayEdit::OnPaint void tCtrlEditBase::DrawBars(wxDC* dc) { - JZBarInfo BarInfo(*mpPianoWindow->GetSong()); + JZBarInfo BarInfo(*mpPianoWindow->GetProject()); BarInfo.SetClock(from_clock); long gclk,x; int ii; @@ -541,7 +541,7 @@ static long from_clk, to_clk; wxBeginBusyCursor(); - mpPianoWindow->GetSong()->NewUndoBuffer(); + mpPianoWindow->GetProject()->NewUndoBuffer(); tEventIterator iter(track); @@ -656,7 +656,7 @@ } wxBeginBusyCursor(); - mpPianoWindow->GetSong()->NewUndoBuffer(); + mpPianoWindow->GetProject()->NewUndoBuffer(); tEventIterator iter(track); @@ -817,7 +817,7 @@ void tChannelAfterEdit::OnApply() { wxBeginBusyCursor(); - mpPianoWindow->GetSong()->NewUndoBuffer(); + mpPianoWindow->GetProject()->NewUndoBuffer(); // delete old events, but skip clock 0 to preserve track defaults: // (dirty but might work...) Modified: trunk/jazz/src/Dialogs.cpp =================================================================== --- trunk/jazz/src/Dialogs.cpp 2010-04-04 20:30:59 UTC (rev 743) +++ trunk/jazz/src/Dialogs.cpp 2010-04-05 03:53:42 UTC (rev 744) @@ -273,7 +273,7 @@ tEventDlg::tEventDlg(JZEvent *e, JZPianoWindow* w, JZTrack *t) : tPropertyListDlg( "Event" ), - ClockDlg(w->GetSong(), "Time ", e->GetClock()) + ClockDlg(w->GetProject(), "Time ", e->GetClock()) { Win = w; Track = t; @@ -954,7 +954,10 @@ case StatSetTempo: str = "Set Tempo (for track 0)"; - dlg = new tSetTempoDlg(e->IsSetTempo(), pPianoWindow, pPianoWindow->GetSong()->GetTrack(0) ); + dlg = new tSetTempoDlg( + e->IsSetTempo(), + pPianoWindow, + pPianoWindow->GetProject()->GetTrack(0)); break; case StatSysEx: @@ -1024,8 +1027,8 @@ bool tMeterChangeDlg::OnClose() { - BarNr += mpEventWindow->GetSong()->GetIntroLength(); - mpEventWindow->GetSong()->SetMeterChange(BarNr, Numerator, Denomiator); + BarNr += mpEventWindow->GetProject()->GetIntroLength(); + mpEventWindow->GetProject()->SetMeterChange(BarNr, Numerator, Denomiator); mpEventWindow->Refresh(); mpEventWindow->FinishMeterEdit(); return false; Modified: trunk/jazz/src/EventWindow.cpp =================================================================== --- trunk/jazz/src/EventWindow.cpp 2010-04-04 20:30:59 UTC (rev 743) +++ trunk/jazz/src/EventWindow.cpp 2010-04-05 03:53:42 UTC (rev 744) @@ -35,9 +35,9 @@ #include "Dialogs.h" #include "EventFrame.h" #include "Filter.h" +#include "Help.h" #include "MouseAction.h" -#include "Song.h" -#include "Help.h" +#include "Project.h" #include "ProjectManager.h" #include <wx/dc.h> @@ -59,7 +59,7 @@ //----------------------------------------------------------------------------- JZEventWindow::JZEventWindow( wxFrame* pParent, - JZSong* pSong, + JZProject* pProject, const wxPoint& Position, const wxSize& Size) : wxWindow( @@ -71,7 +71,7 @@ mpSnapSel(0), mpFilter(0), mpMouseAction(0), - mpSong(pSong), + mpProject(pProject), mpGreyColor(0), mpGreyBrush(0), mClockTicsPerPixel(36), @@ -95,7 +95,7 @@ { mpSnapSel = new JZSnapSelection(this); - mpFilter = new JZFilter(mpSong); + mpFilter = new JZFilter(mpProject); #ifdef __WXMSW__ mpGreyColor = new wxColor(192, 192, 192); @@ -181,7 +181,7 @@ if (QuantizeDialog.ShowModal() == wxID_OK) { - int Step = mpSong->GetTicksPerQuarter() * 4 / QuantizationStep; + int Step = mpProject->GetTicksPerQuarter() * 4 / QuantizationStep; tCmdQuantize QuantizeCommand( mpFilter, @@ -397,7 +397,7 @@ int& EventHeight) const { int TotalClockTics = - mpSong->GetMaxQuarters() * mpSong->GetTicksPerQuarter(); + mpProject->GetMaxQuarters() * mpProject->GetTicksPerQuarter(); EventWidth = TotalClockTics / mClockTicsPerPixel; EventHeight = 127 * mTrackHeight; } @@ -469,7 +469,7 @@ int JZEventWindow::x2BarClock(int x, int Next) { int Clock = x2Clock(x); - JZBarInfo BarInfo(*mpSong); + JZBarInfo BarInfo(*mpProject); BarInfo.SetClock(Clock); while (Next--) { Modified: trunk/jazz/src/EventWindow.h =================================================================== --- trunk/jazz/src/EventWindow.h 2010-04-04 20:30:59 UTC (rev 743) +++ trunk/jazz/src/EventWindow.h 2010-04-05 03:53:42 UTC (rev 744) @@ -28,7 +28,7 @@ class JZFilter; class JZMouseAction; class JZSnapSelection; -class JZSong; +class JZProject; class wxDialog; //***************************************************************************** @@ -42,14 +42,14 @@ JZEventWindow( wxFrame* pParent, - JZSong* pSong, + JZProject* pProject, const wxPoint& Position = wxDefaultPosition, const wxSize& Size = wxDefaultSize); virtual ~JZEventWindow(); // WARNING: non-constant access. - JZSong* GetSong() const; + JZProject* GetProject() const; bool AreEventsSelected(); @@ -130,7 +130,7 @@ protected: - JZSong* mpSong; + JZProject* mpProject; wxColor* mpGreyColor; wxBrush* mpGreyBrush; @@ -162,9 +162,9 @@ // WARNING: non-constant access. //----------------------------------------------------------------------------- inline -JZSong* JZEventWindow::GetSong() const +JZProject* JZEventWindow::GetProject() const { - return mpSong; + return mpProject; } #endif // !defined(JZ_EVENTWINDOW_H) Modified: trunk/jazz/src/PianoFrame.cpp =================================================================== --- trunk/jazz/src/PianoFrame.cpp 2010-04-04 20:30:59 UTC (rev 743) +++ trunk/jazz/src/PianoFrame.cpp 2010-04-05 03:53:42 UTC (rev 744) @@ -210,7 +210,7 @@ JZPianoFrame::JZPianoFrame( wxWindow* pParent, const wxString& Title, - JZSong* pSong, + JZProject* pProject, const wxPoint& Position, const wxSize& Size) : wxFrame( @@ -223,7 +223,7 @@ mpPianoWindow(0), // mpFileMenu(0), // mpEditMenu(0) - mpSong(pSong), + mpProject(pProject), mpToolBar(0) { CreateToolBar(); @@ -242,7 +242,7 @@ mTrackIndex = 0; mpToolBar->ToggleTool(ID_SNAP_16, TRUE); - mpPianoWindow = new JZPianoWindow(this, pSong); + mpPianoWindow = new JZPianoWindow(this, pProject); } //----------------------------------------------------------------------------- Modified: trunk/jazz/src/PianoFrame.h =================================================================== --- trunk/jazz/src/PianoFrame.h 2010-04-04 20:30:59 UTC (rev 743) +++ trunk/jazz/src/PianoFrame.h 2010-04-05 03:53:42 UTC (rev 744) @@ -29,11 +29,11 @@ #include <wx/frame.h> class JZGuitarFrame; -class JZSong; +class JZPianoWindow; +class JZProject; class JZToolBar; +class JZTrack; class tCtrlEditBase; -class JZTrack; -class JZPianoWindow; //***************************************************************************** //***************************************************************************** @@ -46,7 +46,7 @@ JZPianoFrame( wxWindow* pParent, const wxString& Title, - JZSong* pSong, + JZProject* pProject, const wxPoint& Position = wxDefaultPosition, const wxSize& Size = wxDefaultSize); @@ -132,7 +132,7 @@ JZPianoWindow* mpPianoWindow; int mClockTicsPerPixel; - JZSong* mpSong; + JZProject* mpProject; wxDialog* mpDialogBox; wxDialog* MixerForm; Modified: trunk/jazz/src/PianoWindow.cpp =================================================================== --- trunk/jazz/src/PianoWindow.cpp 2010-04-04 20:30:59 UTC (rev 743) +++ trunk/jazz/src/PianoWindow.cpp 2010-04-05 03:53:42 UTC (rev 744) @@ -241,7 +241,7 @@ Win = pPianoWindow; // BUG FIX: undo/redo - Win->GetSong()->NewUndoBuffer(); + Win->GetProject()->NewUndoBuffer(); wxClientDC Dc(Win); @@ -390,7 +390,7 @@ Win = pPianoWindow; // BUG FIX: undo/redo - Win->GetSong()->NewUndoBuffer(); + Win->GetProject()->NewUndoBuffer(); // wxClientDC Dc(Win); Win->PrepareDC(Dc); @@ -479,7 +479,7 @@ mpKeyOn = pKeyOn; // BUG FIX: undo/redo - Win->GetSong()->NewUndoBuffer(); + Win->GetProject()->NewUndoBuffer(); // wxClientDC Dc(Win); Dc.SetFont(*(Win->GetFixedFont())); @@ -639,10 +639,10 @@ //----------------------------------------------------------------------------- JZPianoWindow::JZPianoWindow( JZPianoFrame* pPianoFrame, - JZSong* pSong, + JZProject* pProject, const wxPoint& Position, const wxSize& Size) - : JZEventWindow(pPianoFrame, pSong, Position, Size), + : JZEventWindow(pPianoFrame, pProject, Position, Size), mpPianoFrame(pPianoFrame), mPlayClock(-1), mSnapCount(0), @@ -679,7 +679,7 @@ InitColors(); - mpTrack = mpSong->GetTrack(mTrackIndex); + mpTrack = mpProject->GetTrack(mTrackIndex); mFontSize = mPianoFontSizes[1]; // Must be an entry in the array. @@ -823,7 +823,7 @@ mPianoX = 0; - JZBarInfo BarInfo(*mpSong); + JZBarInfo BarInfo(*mpProject); //DEBUG cout //DEBUG << "mLeftInfoWidth: " << mLeftInfoWidth << '\n' @@ -892,7 +892,7 @@ BarInfo.SetClock(mFromClock); int StopClk = x2Clock(mCanvasWidth); int clk = BarInfo.GetClock(); - int intro = mpSong->GetIntroLength(); + int intro = mpProject->GetIntroLength(); while (clk < StopClk) { clk = BarInfo.GetClock(); @@ -1010,9 +1010,9 @@ if (mVisibleAllTracks) { - for (int i = 0; i < mpSong->GetTrackCount(); ++i) + for (int i = 0; i < mpProject->GetTrackCount(); ++i) { - JZTrack* pTrack = mpSong->GetTrack(i); + JZTrack* pTrack = mpProject->GetTrack(i); if (pTrack != mpTrack && IsVisible(pTrack)) { DrawEvents(LocalDc, pTrack, StatKeyOn, wxLIGHT_GREY_BRUSH, TRUE); @@ -1173,7 +1173,7 @@ } return true; case WXK_DOWN: - if (mTrackIndex < mpSong->GetTrackCount() - 1) + if (mTrackIndex < mpProject->GetTrackCount() - 1) { ++mTrackIndex; NewPosition(mTrackIndex, -1); @@ -1204,7 +1204,7 @@ if (TrackIndex >= 0) { mTrackIndex = TrackIndex; - mpTrack = mpSong->GetTrack(mTrackIndex); + mpTrack = mpProject->GetTrack(mTrackIndex); mpPianoFrame->SetTitle(mpTrack->GetName()); SetYScrollPosition(TrackIndex2y(mFromLines[mTrackIndex])); @@ -1732,7 +1732,7 @@ if (action) { - if (!gpMidiPlayer->Playing) + if (!gpMidiPlayer->IsPlaying()) { int Clock, LoopClock; if (action == MA_CYCLE) @@ -2000,7 +2000,7 @@ // Avoid permenent redraws when end of scroll range is reached. if ( Clock > mFromClock && - mToClock >= mpSong->GetMaxQuarters() * mpSong->GetTicksPerQuarter()) + mToClock >= mpProject->GetMaxQuarters() * mpProject->GetTicksPerQuarter()) { return; } @@ -2259,9 +2259,9 @@ else if (mVisibleAllTracks) { // event not found, maybe change to another Track - for (int i = 0; i < mpSong->GetTrackCount(); ++i) + for (int i = 0; i < mpProject->GetTrackCount(); ++i) { - JZTrack* pTrack = mpSong->GetTrack(i); + JZTrack* pTrack = mpProject->GetTrack(i); if (IsVisible(pTrack) && FindEvent(pTrack, Clock, Pitch)) { NewPosition(i, -1); @@ -2387,7 +2387,7 @@ //----------------------------------------------------------------------------- int JZPianoWindow::SnapClocks() { - int Clock = mpSong->GetTicksPerQuarter() * 4 / mSnapDenomiator; + int Clock = mpProject->GetTicksPerQuarter() * 4 / mSnapDenomiator; if (Clock < 1) { return 1; @@ -2814,7 +2814,7 @@ //----------------------------------------------------------------------------- void JZPianoWindow::Redo() { - mpSong->Redo(); + mpProject->Redo(); Refresh(); if (mpCtrlEdit && mpTrack >= 0) { @@ -2827,7 +2827,7 @@ //----------------------------------------------------------------------------- void JZPianoWindow::Undo() { - mpSong->Undo(); + mpProject->Undo(); Refresh(); if (mpCtrlEdit && mpTrack >= 0) { @@ -3024,7 +3024,7 @@ return; } - mpSong->NewUndoBuffer(); + mpProject->NewUndoBuffer(); mPasteBuffer.Clear(); mPasteBuffer.Put(pEvent->Copy()); @@ -3097,7 +3097,7 @@ Pitch = -1; } - mpSong->NewUndoBuffer(); + mpProject->NewUndoBuffer(); tEventIterator Iterator(&mPasteBuffer); JZEvent* pEvent = Iterator.First(); if (pEvent) Modified: trunk/jazz/src/PianoWindow.h =================================================================== --- trunk/jazz/src/PianoWindow.h 2010-04-04 20:30:59 UTC (rev 743) +++ trunk/jazz/src/PianoWindow.h 2010-04-05 03:53:42 UTC (rev 744) @@ -30,12 +30,12 @@ #include <wx/brush.h> +class tCtrlEditBase; +class JZEvent; +class JZFilter; class JZPianoFrame; -class JZSong; +class JZProject; class JZTrack; -class JZEvent; -class JZFilter; -class tCtrlEditBase; //***************************************************************************** //***************************************************************************** @@ -70,7 +70,7 @@ JZPianoWindow( JZPianoFrame* pFrame, - JZSong* pSong, + JZProject* pProject, const wxPoint& Position = wxDefaultPosition, const wxSize& Size = wxDefaultSize); Modified: trunk/jazz/src/Player.cpp =================================================================== --- trunk/jazz/src/Player.cpp 2010-04-04 20:30:59 UTC (rev 743) +++ trunk/jazz/src/Player.cpp 2010-04-05 03:53:42 UTC (rev 744) @@ -182,36 +182,125 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- JZPlayer::JZPlayer(JZSong* pSong) - : mSamples(pSong->GetTicksPerQuarter() * pSong->Speed()) + : mOutClock(0), + mpPlayLoop(0), + mPollMillisec(200), + mpRecordingInfo(0), + mPlaying(false), + mpSong(pSong), + mpAudioBuffer(0), + mSamples(pSong->GetTicksPerQuarter() * pSong->Speed()) { DummyDeviceList.Add("default"); - poll_millisec = 200; // default - Song = pSong; - OutClock = 0; - Playing = false; - PlayLoop = new tPlayLoop(); - AudioBuffer = 0; - mpRecordingInfo = 0; + mpPlayLoop = new tPlayLoop(); } //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- JZPlayer::~JZPlayer() { - delete PlayLoop; + delete mpPlayLoop; mPlayBuffer.Clear(); mRecdBuffer.Clear(); } //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZPlayer::ShowError() +void JZPlayer::Notify() { - wxMessageBox("could not install driver", "Error", wxOK); + // called by timer + long Now = GetRealTimeClock(); + +#ifdef DEBUG_PLAYER_NOTIFY + cout << "JZPlayer::Notify " << Now << endl; +#endif // DEBUG_PLAYER_NOTIFY + if (Now < 0) + { + return; + } + + // time to put more events + if (Now >= (mOutClock - ADVANCE_PLAY)) + { +#ifdef DEBUG_PLAYER_NOTIFY + cout << "*** Notify: more events to playbuffer" << endl; +#endif // DEBUG_PLAYER_NOTIFY + + mpPlayLoop->PrepareOutput( + &mPlayBuffer, + mpSong, + mOutClock, + Now + DELTACLOCK, + 0); + if (mpAudioBuffer) + { + mpPlayLoop->PrepareOutput( + mpAudioBuffer, + mpSong, + mOutClock, + Now + DELTACLOCK, + 1); + } + mOutClock = Now + DELTACLOCK; + mPlayBuffer.Length2Keyoff(); + } + + // optimization: + // + // if (there are some events to be played) + // send them to driver + // else + // tell the driver that there is nothing to do at the moment + if (mPlayBuffer.nEvents && mPlayBuffer.Events[0]->GetClock() < mOutClock) + { + FlushToDevice(); + } + else + { + // Does nothing unless mOutClock has changed. + OutBreak(); + } } //----------------------------------------------------------------------------- +// Description: +// Try to send all events up to mOutClock to device. //----------------------------------------------------------------------------- +void JZPlayer::FlushToDevice() +{ + int BufferFull = 0; + + tEventIterator Iterator(&mPlayBuffer); + JZEvent* pEvent = Iterator.Range(0, mOutClock); + while (!BufferFull && pEvent) + { + if (OutEvent(pEvent) != 0) + BufferFull = 1; + else + { + pEvent->Kill(); + pEvent = Iterator.Next(); + } + } + + if (!BufferFull) + OutBreak(); + mPlayBuffer.Cleanup(0); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZPlayer::OutNow(JZTrack *t, tParam *r) +{ + OutNow(t, &r->mMsb); + OutNow(t, &r->mLsb); + OutNow(t, &r->mDataMsb); + OutNow(t, &r->mResetMsb); + OutNow(t, &r->mResetLsb); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void JZPlayer::StartPlay(long Clock, long LoopClock, int Continue) { #ifdef DEBUG_PLAYER_STARTPLAY @@ -222,19 +311,19 @@ if (LoopClock > 0) { - PlayLoop->Set(Clock, LoopClock); + mpPlayLoop->Set(Clock, LoopClock); } else { - PlayLoop->Reset(); + mpPlayLoop->Reset(); } - Clock = PlayLoop->Int2ExtClock(Clock); + Clock = mpPlayLoop->Int2ExtClock(Clock); mPlayBuffer.Clear(); mRecdBuffer.Clear(); - if (AudioBuffer) + if (mpAudioBuffer) { - AudioBuffer->Clear(); + mpAudioBuffer->Clear(); } JZTrack *t; @@ -246,16 +335,16 @@ ((Clock == 0) && (gpConfig->GetValue(C_SendSynthReset) == 1))) { // fixme: we should have different synths for each device - t = Song->GetTrack(0); + t = mpSong->GetTrack(0); JZEvent* mpResetEvent = gpSynth->CreateResetEvent(); OutNow(t, mpResetEvent); delete mpResetEvent; } // Send Volume, Pan, Chorus, etc - for (i = 0; i < Song->GetTrackCount(); ++i) + for (i = 0; i < mpSong->GetTrackCount(); ++i) { - t = Song->GetTrack(i); + t = mpSong->GetTrack(i); if (t->mpBank) { OutNow(t, t->mpBank); @@ -459,7 +548,7 @@ } // for } // if !Continue - t = Song->GetTrack(0); + t = mpSong->GetTrack(0); JZEvent* pEvent = t->GetCurrentTempo(Clock); if (pEvent) { @@ -481,23 +570,34 @@ gpConfig->GetValue(C_ThruInput), gpConfig->GetValue(C_ThruOutput)); - OutClock = Clock + FIRST_DELTACLOCK; + mOutClock = Clock + FIRST_DELTACLOCK; JZProjectManager::Instance()->NewPlayPosition( - PlayLoop->Ext2IntClock(Clock)); + mpPlayLoop->Ext2IntClock(Clock)); - PlayLoop->PrepareOutput(&mPlayBuffer, Song, Clock, Clock + FIRST_DELTACLOCK, 0); - if (AudioBuffer) + mpPlayLoop->PrepareOutput( + &mPlayBuffer, + mpSong, + Clock, + Clock + FIRST_DELTACLOCK, + 0); + + if (mpAudioBuffer) { - PlayLoop->PrepareOutput(AudioBuffer, Song, Clock, Clock + FIRST_DELTACLOCK, 1); + mpPlayLoop->PrepareOutput( + mpAudioBuffer, + mpSong, + Clock, + Clock + FIRST_DELTACLOCK, + 1); } mPlayBuffer.Length2Keyoff(); // Notify() has to be called very often because voxware // midi thru is done there - Start(poll_millisec); // start wxTimer + Start(mPollMillisec); // start wxTimer - Playing = true; + mPlaying = true; } //----------------------------------------------------------------------------- @@ -506,7 +606,7 @@ { // Stop the wxTimer. Stop(); - Playing = false; + mPlaying = false; long Clock = GetRealTimeClock(); @@ -514,9 +614,9 @@ int ii; tKeyOff pKeyOff(0, 0, 0); - for (ii = 0; ii < Song->GetTrackCount(); ii++) + for (ii = 0; ii < mpSong->GetTrackCount(); ii++) { - JZTrack *Track = Song->GetTrack(ii); + JZTrack *Track = mpSong->GetTrack(ii); if (Track) { tEventIterator Iterator(Track); @@ -543,80 +643,6 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZPlayer::Notify() -{ - // called by timer - long Now = GetRealTimeClock(); - -#ifdef DEBUG_PLAYER_NOTIFY - cout << "JZPlayer::Notify " << Now << endl; -#endif // DEBUG_PLAYER_NOTIFY - if (Now < 0) - { - return; - } - - // time to put more events - if (Now >= (OutClock - ADVANCE_PLAY)) - { -#ifdef DEBUG_PLAYER_NOTIFY - cout << "*** Notify: more events to playbuffer" << endl; -#endif // DEBUG_PLAYER_NOTIFY - - PlayLoop->PrepareOutput(&mPlayBuffer, Song, OutClock, Now + DELTACLOCK, 0); - if (AudioBuffer) - { - PlayLoop->PrepareOutput(AudioBuffer, Song, OutClock, Now + DELTACLOCK, 1); - } - OutClock = Now + DELTACLOCK; - mPlayBuffer.Length2Keyoff(); - } - - // optimization: - // - // if (there are some events to be played) - // send them to driver - // else - // tell the driver that there is nothing to do at the moment - if (mPlayBuffer.nEvents && mPlayBuffer.Events[0]->GetClock() < OutClock) - { - FlushToDevice(); - } - else - { - // Does nothing unless OutClock has changed. - OutBreak(); - } -} - -//----------------------------------------------------------------------------- -// Description: -// Try to send all events up to OutClock to device. -//----------------------------------------------------------------------------- -void JZPlayer::FlushToDevice() -{ - int BufferFull = 0; - - tEventIterator Iterator(&mPlayBuffer); - JZEvent* pEvent = Iterator.Range(0, OutClock); - while (!BufferFull && pEvent) - { - if (OutEvent(pEvent) != 0) - BufferFull = 1; - else - { - pEvent->Kill(); - pEvent = Iterator.Next(); - } - } - - if (!BufferFull) - OutBreak(); - mPlayBuffer.Cleanup(0); -} - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- void JZPlayer::AllNotesOff(int Reset) { tControl NoteOff(0, 0, 0x78, 0); @@ -652,15 +678,18 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZPlayer::OutNow(JZTrack *t, tParam *r) +void JZPlayer::ShowError() { - OutNow(t, &r->mMsb); - OutNow(t, &r->mLsb); - OutNow(t, &r->mDataMsb); - OutNow(t, &r->mResetMsb); - OutNow(t, &r->mResetLsb); + wxMessageBox("could not install driver", "Error", wxOK); } +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZPlayer::EditGlobalAudioSettings(wxWindow* pParent) +{ + mSamples.GlobalSettingsDlg(); +} + #ifdef DEV_MPU401 //***************************************************************************** @@ -671,7 +700,7 @@ tMpuPlayer::tMpuPlayer(JZSong* pSong) : JZPlayer(pSong) { - poll_millisec = 25; + mPollMillisec = 25; midinethost = getenv("MIDINETHOST"); if (!midinethost || !strlen(midinethost)) { @@ -736,7 +765,7 @@ //----------------------------------------------------------------------------- void tMpuPlayer::StartPlay(long IntClock, long LoopClock, int Continue) { - long ExtClock = PlayLoop->Int2ExtClock(IntClock); + long ExtClock = mpPlayLoop->Int2ExtClock(IntClock); char *play; int playsize; @@ -794,7 +823,7 @@ // Setup Timebase char timebase[2]; timebase[0] = CMD+1; - switch (Song->GetTicksPerQuarter()) + switch (mpSong->GetTicksPerQuarter()) { case 48: timebase[1] = 0xc2; break; case 72: timebase[1] = 0xc3; break; @@ -1004,13 +1033,14 @@ //----------------------------------------------------------------------------- void tMpuPlayer::OutBreak() { - // send a break to the driver starting at PlyBytes.GetClock() and ending at OutClock + // Send a break to the driver starting at PlyBytes.GetClock() and ending at + // mOutClock. if (!PlyBytes.WriteFile(dev)) { return; } - (void)OutBreak(OutClock); + (void)OutBreak(mOutClock); PlyBytes.WriteFile(dev); } @@ -1182,14 +1212,14 @@ if ((clock_to_host_counter % 32) == 0) { JZProjectManager::Instance()->NewPlayPosition( - PlayLoop->Ext2IntClock(playclock)); + mpPlayLoop->Ext2IntClock(playclock)); } #else // Update screen every 8'th note (120 ticks/beat). if ((clock_to_host_counter % 4) == 0) { JZProjectManager::Instance()->NewPlayPosition( - PlayLoop->Ext2IntClock(playclock)); + mpPlayLoop->Ext2IntClock(playclock)); } #endif FlushOutOfBand(playclock); @@ -1225,7 +1255,7 @@ case 3: gpMidiPlayer->StopPlay(); d1 = c; - ExtClock = (d0 + (128 * d1)) * (Song->GetTicksPerQuarter() / 4); + ExtClock = (d0 + (128 * d1)) * (mpSong->GetTicksPerQuarter() / 4); receiving_song_ptr = 0; d0 = d1 = 0; gpMidiPlayer->StartPlay(ExtClock, 0, 1); @@ -1330,7 +1360,7 @@ } if (pEvent) { - pEvent->Clock = PlayLoop->Ext2IntClock(pEvent->Clock); + pEvent->Clock = mpPlayLoop->Ext2IntClock(pEvent->Clock); mRecdBuffer.Put(pEvent); } } @@ -1464,8 +1494,8 @@ tSeq2Player::tSeq2Player(JZSong* pSong) : JZPlayer(pSong) { - // got to poll fast for midi thru - poll_millisec = 10; + // The code has to poll fast for MIDI thru. + mPollMillisec = 10; recd_clock = 0; play_clock = 0; @@ -1820,7 +1850,7 @@ //----------------------------------------------------------------------------- void tSeq2Player::OutBreak() { - OutBreak(OutClock); + OutBreak(mOutClock); seqbuf_dump(); } @@ -1877,7 +1907,7 @@ recd_clock = Clock; JZProjectManager::Instance()->NewPlayPosition( - PlayLoop->Ext2IntClock(Clock)); + mpPlayLoop->Ext2IntClock(Clock)); // send initial program changes, controller etc SEQ_START_TIMER(); @@ -1889,8 +1919,8 @@ seqbuf_dump(); // setup timebase and current speed - int time_base = Song->GetTicksPerQuarter(); - int cur_speed = Song->GetTrack(0)->GetCurrentSpeed(Clock); + int time_base = mpSong->GetTicksPerQuarter(); + int cur_speed = mpSong->GetTrack(0)->GetCurrentSpeed(Clock); if (ioctl(seqfd, SNDCTL_TMR_TIMEBASE, &time_base) < 0) perror("ioctl time_base"); if (ioctl(seqfd, SNDCTL_TMR_TEMPO, &cur_speed) < 0) @@ -1929,12 +1959,12 @@ } //----------------------------------------------------------------------------- -// try to send all events up to OutClock to device +// try to send all events up to mOutClock to device //----------------------------------------------------------------------------- void tSeq2Player::FlushToDevice() { tEventIterator Iterator(&mPlayBuffer); - JZEvent* pEvent = Iterator.Range(0, OutClock); + JZEvent* pEvent = Iterator.Range(0, mOutClock); if (pEvent) { do @@ -1946,7 +1976,7 @@ mPlayBuffer.Cleanup(0); } - OutBreak(OutClock); + OutBreak(mOutClock); seqbuf_dump(); } @@ -2054,7 +2084,7 @@ if (pEvent) { - pEvent->SetClock(PlayLoop->Ext2IntClock(recd_clock)); + pEvent->SetClock(mpPlayLoop->Ext2IntClock(recd_clock)); mRecdBuffer.Put(pEvent); pEvent = 0; } @@ -2063,7 +2093,7 @@ } JZProjectManager::Instance()->NewPlayPosition( - PlayLoop->Ext2IntClock(recd_clock/48 * 48)); + mpPlayLoop->Ext2IntClock(recd_clock/48 * 48)); return recd_clock; } Modified: trunk/jazz/src/Player.h =================================================================== --- trunk/jazz/src/Player.h 2010-04-04 20:30:59 UTC (rev 743) +++ trunk/jazz/src/Player.h 2010-04-05 03:53:42 UTC (rev 744) @@ -40,40 +40,6 @@ //***************************************************************************** //***************************************************************************** -class tPlayLoop -{ - public: - - tPlayLoop(); - - void Set(long Start, long Stop); - - void Reset(); - - // external clock -> internal clock where - // external clock == physical clock - // internal clock == song position - long Ext2IntClock(long Clock); - - // the other way round - long Int2ExtClock(long Clock); - - void PrepareOutput( - tEventArray* pEventArray, - JZSong* pSong, - long ExtFr, - long ExtTo, - int mode = 0); - - private: - - long mStartClock; - - long mStopClock; -}; - -//***************************************************************************** -//***************************************************************************** enum tClockSource { CsInt = 0, @@ -131,38 +97,120 @@ //***************************************************************************** //***************************************************************************** -class JZPlayer : public wxTimer +class tPlayLoop { - protected: + public: - long OutClock; - tPlayLoop* PlayLoop; - // timer value for polling the record queue - int poll_millisec; - JZRecordingInfo* mpRecordingInfo; // 0 == not recording + tPlayLoop(); + void Set(long Start, long Stop); + void Reset(); + + // external clock -> internal clock where + // external clock == physical clock + // internal clock == song position + long Ext2IntClock(long Clock); + + // the other way round + long Int2ExtClock(long Clock); + + void PrepareOutput( + tEventArray* pEventArray, + JZSong* pSong, + long ExtFr, + long ExtTo, + int mode = 0); + + private: + + long mStartClock; + + long mStopClock; +}; + +//***************************************************************************** +//***************************************************************************** +class JZPlayer : public wxTimer +{ public: - bool Playing; // successful StartPlay + JZPlayer(JZSong* pSong); + virtual ~JZPlayer(); + + void Notify(); + + virtual void FlushToDevice(); + + // return 0 = ok, 1 = buffer full, try again later + virtual int OutEvent(JZEvent* pEvent) = 0; + + virtual void OutBreak() = 0; + + // Send event immediately ignoring the clock. + void OutNow(JZTrack *t, JZEvent* pEvent) + { + pEvent->SetDevice(t->GetDevice()); + OutNow(pEvent); + } + + void OutNow(int device, JZEvent* pEvent) + { + pEvent->SetDevice(device); + OutNow(pEvent); + } + + void OutNow(JZTrack* t, tParam* r); + + // what's played right now? + virtual long GetRealTimeClock() = 0; + + virtual void StartPlay(long Clock, long LoopClock = 0, int Continue = 0); + virtual void StopPlay(); + virtual void AllNotesOff(int Reset = 0); + + virtual void SetSoftThru(int on, int idev, int odev) + { + } + + virtual void SetHardThru(int on, int idev, int odev) + { + } + + virtual void InitMtcRec() + { + } + + virtual tMtcTime* FreezeMtcRec() + { + return 0; + } + // Tests if hardware found and successfully setup. virtual bool IsInstalled() = 0; // if unable to install, pop up a messagebox explaining why. virtual void ShowError(); - JZSong *Song; - tEventArray mPlayBuffer; - tEventArray mRecdBuffer; - void SetRecordInfo(JZRecordingInfo* inf) + const tEventArray& GetRecordBuffer() const { - mpRecordingInfo = inf; + return mRecdBuffer; } + void SetRecordInfo(JZRecordingInfo* pRecordingInfo) + { + mpRecordingInfo = pRecordingInfo; + } + + bool IsRecordBufferEmpty() const + { + return mRecdBuffer.IsEmpty(); + } + bool IsPlaying() const { - return Playing; + return mPlaying; } virtual int FindMidiDevice() @@ -170,24 +218,52 @@ return -1; } - virtual int SupportsMultipleDevices() { return 0; } - virtual tDeviceList & GetOutputDevices() { return DummyDeviceList; } - virtual tDeviceList & GetInputDevices() { return DummyDeviceList; } - virtual int GetThruInputDevice() { return 0; } - virtual int GetThruOutputDevice() { return 0; } + virtual int SupportsMultipleDevices() + { + return 0; + } + virtual tDeviceList& GetOutputDevices() + { + return DummyDeviceList; + } + virtual tDeviceList& GetInputDevices() + { + return DummyDeviceList; + } + virtual int GetThruInputDevice() + { + return 0; + } + virtual int GetThruOutputDevice() + { + return 0; + } // Audio stuff - virtual void StartAudio() {} - tEventArray *AudioBuffer; - virtual int GetAudioEnabled() const { return 0; } - virtual void SetAudioEnabled(int) { } - virtual void ListenAudio(int key, int start_stop_mode = 1) {} - virtual void ListenAudio(tSample &spl, long fr_smpl, long to_smpl) {} - virtual bool IsListening() const { return 0; } + virtual void StartAudio() + { + } + virtual int GetAudioEnabled() const + { + return 0; + } + virtual void SetAudioEnabled(int) + { + } + virtual void ListenAudio(int key, int start_stop_mode = 1) + { + } + virtual void ListenAudio(tSample &spl, long fr_smpl, long to_smpl) + { + } + virtual bool IsListening() const + { + return 0; + } virtual int OnMenuCommand(int id) { - if (Playing) + if (mPlaying) { return 0; } @@ -201,10 +277,12 @@ virtual void AdjustAudioLength(JZTrack *t) { - long ticks_per_minute = Song->GetTicksPerQuarter() * Song->Speed(); + long ticks_per_minute = mpSong->GetTicksPerQuarter() * mpSong->Speed(); mSamples.AdjustAudioLength(t, ticks_per_minute); } + void EditGlobalAudioSettings(wxWindow* pParent); + void EditSample(int key) { mSamples.Edit(key); @@ -222,66 +300,31 @@ protected: - tSampleSet mSamples; + virtual void OutNow(JZEvent* pEvent) = 0; - public: + protected: - JZPlayer(JZSong *song); + long mOutClock; - virtual ~JZPlayer(); + tPlayLoop* mpPlayLoop; - void Notify(); + // This is the timer value for polling the record queue. + int mPollMillisec; - virtual void FlushToDevice(); + // If this value is 0, then not recording. + JZRecordingInfo* mpRecordingInfo; - // return 0 = ok, 1 = buffer full, try again later - virtual int OutEvent(JZEvent* pEvent) = 0; + bool mPlaying; - virtual void OutBreak() = 0; + JZSong* mpSong; - // send event immediately ignoring clock - void OutNow(JZTrack *t, JZEvent* pEvent) - { - pEvent->SetDevice(t->GetDevice()); - OutNow(pEvent); - } + tEventArray mPlayBuffer; + tEventArray mRecdBuffer; - void OutNow(int device, JZEvent* pEvent) - { - pEvent->SetDevice(device); - OutNow(pEvent); - } + tEventArray* mpAudioBuffer; - void OutNow(JZTrack *t, tParam *r); + tSampleSet mSamples; - // what's played right now? - virtual long GetRealTimeClock() = 0; - - virtual void StartPlay(long Clock, long LoopClock = 0, int Continue = 0); - virtual void StopPlay(); - virtual void AllNotesOff(int Reset = 0); - - virtual void SetSoftThru(int on, int idev, int odev) - { - } - - virtual void SetHardThru(int on, int idev, int odev) - { - } - - virtual void InitMtcRec() - { - } - - virtual tMtcTime* FreezeMtcRec() - { - return 0; - } - - protected: - - virtual void OutNow(JZEvent* pEvent) = 0; - private: tDeviceList DummyDeviceList; @@ -576,7 +619,7 @@ public: friend class tOSSThru; - tSeq2Player(JZSong *song); + tSeq2Player(JZSong* pSong); virtual bool IsInstalled(); virtual ~tSeq2Player(); int OutEvent(JZEvent *e, int now); Modified: trunk/jazz/src/PortMidiPlayer.cpp =================================================================== --- trunk/jazz/src/PortMidiPlayer.cpp 2010-04-04 20:30:59 UTC (rev 743) +++ trunk/jazz/src/PortMidiPlayer.cpp 2010-04-05 03:53:42 UTC (rev 744) @@ -227,7 +227,7 @@ void JZPortMidiPlayer::SetTempo(int bpm, int clock) { int t1 = Clock2Time(clock); - mTicksPerMinute = bpm * Song->GetTicksPerQuarter(); + mTicksPerMinute = bpm * mpSong->GetTicksPerQuarter(); int t2 = Clock2Time(clock); mStartTime += (t1 - t2); } @@ -378,7 +378,7 @@ mStartTime = Pt_Time() + 500; mStartClock = clock; - mTicksPerMinute = Song->GetTicksPerQuarter() * Song->Speed(); + mTicksPerMinute = mpSong->GetTicksPerQuarter() * mpSong->Speed(); JZPlayer::StartPlay(clock, loopClock, cont); } @@ -406,7 +406,7 @@ long t = Pt_Time(); gpTrackWindow->NewPlayPosition( - PlayLoop->Ext2IntClock(Time2Clock(t) / 48 * 48)); + mpPlayLoop->Ext2IntClock(Time2Clock(t) / 48 * 48)); return Time2Clock(t); } Modified: trunk/jazz/src/Project.cpp =================================================================== --- trunk/jazz/src/Project.cpp 2010-04-04 20:30:59 UTC (rev 743) +++ trunk/jazz/src/Project.cpp 2010-04-05 03:53:42 UTC (rev 744) @@ -341,10 +341,8 @@ StartUpSong = mpConfig->GetStrValue(C_StartUpSong); } - FILE* pFd = fopen(StartUpSong.c_str(), "r"); - if (pFd) + if (wxFileName::IsFileReadable(StartUpSong.c_str())) { - fclose(pFd); JZStandardRead Io; Read(Io, StartUpSong.c_str()); } @@ -623,6 +621,13 @@ } //----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZProject::EditAudioGlobalSettings(wxWindow* pParent) +{ + mpMidiPlayer->EditGlobalAudioSettings(pParent); +} + +//----------------------------------------------------------------------------- // Description: // Sets the internal mpRecInfo, used for recording apparently. // JZProject will take ownership of this pointer, so don't delete it after Modified: trunk/jazz/src/Project.h =================================================================== --- trunk/jazz/src/Project.h 2010-04-04 20:30:59 UTC (rev 743) +++ trunk/jazz/src/Project.h 2010-04-05 03:53:42 UTC (rev 744) @@ -23,14 +23,14 @@ #ifndef JZ_PROJECT_H #define JZ_PROJECT_H -class JZPlayer; -class JZSynth; -class JZFilter; - #include "Song.h" #include "Metronome.h" +class JZFilter; +class JZPlayer; class JZRecordingInfo; +class JZSynth; +class wxWindow; //***************************************************************************** // Description: @@ -156,6 +156,8 @@ // Sets RecInfo, JZProject takes ownership of this object void SetRecInfo(JZRecordingInfo* pRecInfo); + void EditAudioGlobalSettings(wxWindow* pParent); + JZPlayer* GetPlayer() { return mpMidiPlayer; Modified: trunk/jazz/src/ProjectManager.cpp =================================================================== --- trunk/jazz/src/ProjectManager.cpp 2010-04-04 20:30:59 UTC (rev 743) +++ trunk/jazz/src/ProjectManager.cpp 2010-04-05 03:53:42 UTC (rev 744) @@ -66,7 +66,7 @@ mpTrackFrame = new JZTrackFrame( 0, "Jazz++", - gpSong, + gpProject, Position, Size); } @@ -96,7 +96,7 @@ mpPianoFrame = new JZPianoFrame( mpTrackFrame, "Piano", - gpSong, + gpProject, Position, Size); } Modified: trunk/jazz/src/Sample.h =================================================================== --- trunk/jazz/src/Sample.h 2010-04-04 20:30:59 UTC (rev 743) +++ trunk/jazz/src/Sample.h 2010-04-05 03:53:42 UTC (rev 744) @@ -256,14 +256,19 @@ return length; } - int IsEmpty() const { + bool IsEmpty() const + { return length == 0; } - void SetExternal(int ext) { + + void SetExternal(int ext) + { external_flag = ext; //external_time = 0; } - int GetExternal() const { + + int GetExternal() const + { return external_flag; } Modified: trunk/jazz/src/Track.cpp =================================================================== --- trunk/jazz/src/Track.cpp 2010-04-04 20:30:59 UTC (rev 743) +++ trunk/jazz/src/Track.cpp 2010-04-05 03:53:42 UTC (rev 744) @@ -1687,7 +1687,7 @@ return Events[nEvents - 1]->GetClock(); } -int tEventArray::IsEmpty() +bool tEventArray::IsEmpty() const { return nEvents == 0; } @@ -1999,8 +1999,13 @@ t->nEvents = 0; } - -void JZTrack::MergeRange(tEventArray *other, int FromClock, int ToClock, int Replace) +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZTrack::MergeRange( + const tEventArray& Other, + int FromClock, + int ToClock, + int Replace) { // Erase destin if (Replace) @@ -2015,7 +2020,7 @@ } // Merge Recorded Events - tEventIterator Copy(other); + tEventIterator Copy(&Other); JZEvent* pEvent = Copy.Range(FromClock, ToClock); while (pEvent) { Modified: trunk/jazz/src/Track.h =================================================================== --- trunk/jazz/src/Track.h 2010-04-04 20:30:59 UTC (rev 743) +++ trunk/jazz/src/Track.h 2010-04-05 03:53:42 UTC (rev 744) @@ -347,9 +347,9 @@ tDrumInstrumentParameter *NextElem( tDrumInstrumentParameter *cur ); void DelElem( int pit ); void Clear(); - int IsEmpty() + bool IsEmpty() const { - return( list == 0 ); + return list == 0; } private: @@ -524,7 +524,7 @@ void Write(JZWriteBase& Io); int GetLastClock() const; - int IsEmpty(); + bool IsEmpty() const; int GetFirstClock(); int State; // tsXXX @@ -586,11 +586,13 @@ } void Merge(tEventArray *other); + void MergeRange( - tEventArray *other, + const tEventArray& Other, int FromClock, int ToClock, int Replace = 0); + void Undo(); void Redo(); void NewUndoBuffer(); Modified: trunk/jazz/src/TrackFrame.cpp =================================================================== --- trunk/jazz/src/TrackFrame.cpp 2010-04-04 20:30:59 UTC (rev 743) +++ trunk/jazz/src/TrackFrame.cpp 2010-04-05 03:53:42 UTC (rev 744) @@ -120,14 +120,16 @@ JZTrackFrame::JZTrackFrame( wxWindow* pParent, const wxString& Title, - JZSong* pSong, + JZProject* pProject, const wxPoint& Position, const wxSize& Size) - : JZEventFrame(pParent, Title, pSong, Position, Size), + : JZEventFrame(pParent, Title, pProject, Position, Size), mpToolBar(0), mpFileMenu(0), mpEditMenu(0), mpToolsMenu(0), + mpProject(pProject), + mpTrackWindow(0), mPreviousClock(0), mPreviouslyRecording(false) { @@ -137,7 +139,7 @@ mpTrackWindow = new JZTrackWindow( this, - pSong, + pProject, wxPoint(0, 0), wxSize(600, 120)); @@ -644,7 +646,7 @@ //----------------------------------------------------------------------------- void JZTrackFrame::OnAudioGlobalSettings(wxCommandEvent& Event) { -// mpTrackWindow->EditAudioGlobalSettings(*this); + mpProject->EditAudioGlobalSettings(this); } //----------------------------------------------------------------------------- Modified: trunk/jazz/src/TrackFrame.h =================================================================== --- trunk/jazz/src/TrackFrame.h 2010-04-04 20:30:59 UTC (rev 743) +++ trunk/jazz/src/TrackFrame.h 2010-04-05 03:53:42 UTC (rev 744) @@ -28,7 +28,7 @@ #include "EventFrame.h" -class JZSong; +class JZProject; class JZToolBar; class JZTrackWindow; class JZPianoWindow; @@ -42,7 +42,7 @@ JZTrackFrame( wxWindow* pParent, const wxString& Title, - JZSong* pSong, + JZProject* pProject, const wxPoint& Position = wxDefaultPosition, const wxSize& Size = wxDefaultSize); @@ -116,6 +116,8 @@ wxMenu* mpToolsMenu; + JZProject* mpProject; + JZTrackWindow* mpTrackWindow; int mPreviousClock; Modified: trunk/jazz/src/TrackWindow.cpp =================================================================== --- trunk/jazz/src/TrackWindow.cpp 2010-04-04 20:30:59 UTC (rev 743) +++ trunk/jazz/src/TrackWindow.cpp 2010-04-05 03:53:42 UTC (rev 744) @@ -67,10 +67,10 @@ //----------------------------------------------------------------------------- JZTrackWindow::JZTrackWindow( wxFrame* pParent, - JZSong* pSong, + JZProject* pProject, const wxPoint& Position, const wxSize& Size) - : JZEventWindow(pParent, pSong, Position, Size), + : JZEventWindow(pParent, pProject, Position, Size), mPlayClock(-1), mUseColors(true), mNumberWidth(), @@ -177,7 +177,7 @@ // Avoid permanent redraws when end of scroll range is reached. if ( Clock > mFromClock && - mToClock >= mpSong->GetMaxQuarters() * mpSong->GetTicksPerQuarter()) + mToClock >= mpProject->GetMaxQuarters() * mpProject->GetTicksPerQuarter()) { return; } @@ -274,7 +274,7 @@ JZRectangle Rectangle( 0, y2yLine(Point.y + mScrolledY), - Clock2x(mpSong->GetMaxQuarters() * mpSong->GetTicksPerQuarter()) + + Clock2x(mpProject->GetMaxQuarters() * mpProject->GetTicksPerQuarter()) + mScrolledX, mTrackHeight); mpSnapSel->Select(Rectangle); @@ -618,9 +618,9 @@ DrawHorizontalLine(LocalDc, mEventsY); DrawHorizontalLine(LocalDc, mEventsY - 1); - if (mpSong) + if (mpProject) { - JZBarInfo BarInfo(*mpSong); + JZBarInfo BarInfo(*mpProject); //DEBUG cout //DEBUG << "mLeftInfoWidth: " << mLeftInfoWidth << '\n' @@ -1026,12 +1026,12 @@ //----------------------------------------------------------------------------- void JZTrackWindow::DrawEvents(wxDC& Dc) { - if (!mpSong) + if (!mpProject) { return; } - JZBarInfo BarInfo(*mpSong); + JZBarInfo BarInfo(*mpProject); Dc.SetClippingRegion(mEventsX, mEventsY, mEventsWidth, mEventsHeight); @@ -1220,7 +1220,7 @@ //----------------------------------------------------------------------------- JZTrack* JZTrackWindow::y2Track(int y) { - return mpSong->GetTrack(y2TrackIndex(y)); + return mpProject->GetTrack(y2TrackIndex(y)); } //----------------------------------------------------------------------------- @@ -1386,7 +1386,7 @@ gpProject->mStopTime = loop_clock; gpProject->Play(); - } //if(!Midi->Playing) + } else { gpProject->Stop(); @@ -1408,18 +1408,21 @@ } if ( !pRecInfo->mpTrack->GetAudioMode() && - !gpProject->GetPlayer()->mRecdBuffer.IsEmpty()) + !gpProject->GetPlayer()->IsRecordBufferEmpty()) { //int choice = wxMessageBox("Keep recorded events?", "You played", wxOK | wxCANCEL); //if (choice == wxOK) { wxBeginBusyCursor(); + gpProject->NewUndoBuffer(); + pRecInfo... [truncated message content] |
From: <pst...@us...> - 2010-04-25 03:07:03
|
Revision: 745 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=745&view=rev Author: pstieber Date: 2010-04-25 03:06:57 +0000 (Sun, 25 Apr 2010) Log Message: ----------- Made cosmetic changes. Modified Paths: -------------- trunk/jazz/src/Command.cpp trunk/jazz/src/SampleCommand.cpp Modified: trunk/jazz/src/Command.cpp =================================================================== --- trunk/jazz/src/Command.cpp 2010-04-05 03:53:42 UTC (rev 744) +++ trunk/jazz/src/Command.cpp 2010-04-25 03:06:57 UTC (rev 745) @@ -631,7 +631,7 @@ k = (tKeyOn *)pEvent->Copy(); //little hack, if clock is -1000 it means set startclock from the first event. - if(startClock==-1000) + if (startClock==-1000) { startClock = k->GetClock(); } Modified: trunk/jazz/src/SampleCommand.cpp =================================================================== --- trunk/jazz/src/SampleCommand.cpp 2010-04-05 03:53:42 UTC (rev 744) +++ trunk/jazz/src/SampleCommand.cpp 2010-04-25 03:06:57 UTC (rev 745) @@ -157,8 +157,14 @@ { register int loc1,loc2; float frac = ((float)(nsample)/(*tab)) * *(tab+1); - if(frac < 0) return(array[0]); - if(frac >= *(tab+1)) return(array[(int)*(tab+1)]); + if (frac < 0) + { + return(array[0]); + } + if (frac >= *(tab+1)) + { + return(array[(int)*(tab+1)]); + } loc1 = (int)frac; loc2 = loc1+1; frac = frac - (float)loc1; @@ -171,23 +177,34 @@ void tCMixCmd::setline(const float *p, short n_args,int length,float *array) { - double increm; - int i,j,k,points; + double increm; + int i,j,k,points; - increm = (double)(p[n_args - 2] - p[0])/(double)length; - for(j=0,i=0; j < (n_args-2); j += 2) { - points = (int)((double)(p[j+2] - p[j]) / increm +.5); - if(p[j+2] != p[j]) { - if(points <= 0) points = 1; - for(k=0; k < points; k++) { - array[i++] = ((float)k/(float)points) - * (p[j+3] - p[j+1]) + p[j+1]; - if(i == length) return; - } - } + increm = (double)(p[n_args - 2] - p[0])/(double)length; + for(j=0,i=0; j < (n_args-2); j += 2) + { + points = (int)((double)(p[j+2] - p[j]) / increm +.5); + if (p[j+2] != p[j]) + { + if (points <= 0) + { + points = 1; } - i--; - while(++i < length) array[i] = array[i-1]; + for (k=0; k < points; k++) + { + array[i++] = ((float)k/(float)points) * (p[j+3] - p[j+1]) + p[j+1]; + if (i == length) + { + return; + } + } + } + } + i--; + while(++i < length) + { + array[i] = array[i-1]; + } } @@ -395,12 +412,18 @@ k = (k+1) % reinit; samplenum1 = (float)i + (float)j * interval; - if(!sinp.GetSample(samplenum1, in)) break; + if (!sinp.GetSample(samplenum1, in)) + { + break; + } x = wintable[(int)(((float)j/reinit) * wlen)]; val1 = in[inchan] * x; samplenum2 = (float)(i) + (float)(k-off) * interval; - if(!sinp.GetSample(samplenum2, in)) break; + if (!sinp.GetSample(samplenum2, in)) + { + break; + } x = wintable[(int)(((float)k/reinit) * wlen)]; val2 = in[inchan] * x; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2010-04-25 03:09:02
|
Revision: 746 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=746&view=rev Author: pstieber Date: 2010-04-25 03:08:56 +0000 (Sun, 25 Apr 2010) Log Message: ----------- Made cosmetic changes. Modified Paths: -------------- trunk/jazz/src/Sample.cpp trunk/jazz/src/SampleCommand.cpp Modified: trunk/jazz/src/Sample.cpp =================================================================== --- trunk/jazz/src/Sample.cpp 2010-04-25 03:06:57 UTC (rev 745) +++ trunk/jazz/src/Sample.cpp 2010-04-25 03:08:56 UTC (rev 746) @@ -846,11 +846,13 @@ { int j; float wmax, xmax = 0; - for(j = 0; j < length; j++) { + for (j = 0; j < length; j++) + { if ((wmax = (float)fabs(data[j])) > xmax) xmax = wmax; } - for(j = 0; j < length; j++) { + for (j = 0; j < length; j++) + { data[j] /= xmax; } } @@ -886,14 +888,16 @@ int j,k,l,i = 0; amp2 = pvals[0]; - for(k = 1; k < nargs; k += 2) { + for (k = 1; k < nargs; k += 2) + { amp1 = amp2; amp2 = pvals[k+1]; j = i + 1; data[i] = amp1; c = (float) pow((amp2/amp1),(1./ pvals[k])); i = (j - 1) + pvals[k]; - for(l = j; l < i; l++) { + for (l = j; l < i; l++) + { if (l < size) data[l] = data[l-1] * c; } Modified: trunk/jazz/src/SampleCommand.cpp =================================================================== --- trunk/jazz/src/SampleCommand.cpp 2010-04-25 03:06:57 UTC (rev 745) +++ trunk/jazz/src/SampleCommand.cpp 2010-04-25 03:08:56 UTC (rev 746) @@ -141,7 +141,7 @@ { int i; resetval = 1000; - for(i=0; i<SIZE; i++) + for (i = 0; i < SIZE; i++) array[i] = 1; lineset = 0; } @@ -181,7 +181,7 @@ int i,j,k,points; increm = (double)(p[n_args - 2] - p[0])/(double)length; - for(j=0,i=0; j < (n_args-2); j += 2) + for (j = 0, i = 0; j < (n_args - 2); j += 2) { points = (int)((double)(p[j+2] - p[j]) / increm +.5); if (p[j+2] != p[j]) @@ -406,8 +406,8 @@ chans = sout.GetChannels(); inchan = (int)p[6]; j = 0; - for(i = 0; i < nsamps; i++) { - + for (i = 0; i < nsamps; i++)i + { j = (j+1) % reinit; k = (k+1) % reinit; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2010-04-25 03:15:20
|
Revision: 747 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=747&view=rev Author: pstieber Date: 2010-04-25 03:15:14 +0000 (Sun, 25 Apr 2010) Log Message: ----------- Made cosmetic changes. Modified Paths: -------------- trunk/jazz/src/Events.cpp trunk/jazz/src/SampleCommand.cpp trunk/jazz/src/Song.cpp Modified: trunk/jazz/src/Events.cpp =================================================================== --- trunk/jazz/src/Events.cpp 2010-04-25 03:08:56 UTC (rev 746) +++ trunk/jazz/src/Events.cpp 2010-04-25 03:15:14 UTC (rev 747) @@ -171,7 +171,7 @@ nBytes = 0; Buffer[nBytes++] = Stat | ((tChannelEvent *)pEvent)->GetChannel(); - while(Length--) + while (Length--) { Buffer[nBytes++] = *pData++; } Modified: trunk/jazz/src/SampleCommand.cpp =================================================================== --- trunk/jazz/src/SampleCommand.cpp 2010-04-25 03:08:56 UTC (rev 746) +++ trunk/jazz/src/SampleCommand.cpp 2010-04-25 03:15:14 UTC (rev 747) @@ -201,7 +201,7 @@ } } i--; - while(++i < length) + while (++i < length) { array[i] = array[i-1]; } Modified: trunk/jazz/src/Song.cpp =================================================================== --- trunk/jazz/src/Song.cpp 2010-04-25 03:08:56 UTC (rev 746) +++ trunk/jazz/src/Song.cpp 2010-04-25 03:15:14 UTC (rev 747) @@ -435,7 +435,7 @@ // looplength will be used to loop the track, for the duration of // the playtrack event. loopLength = pTrack->GetLastClock(); - while(f) + while (f) { if (f->IsEndOfTrack()) { @@ -455,7 +455,7 @@ // which start + length end up after the startloop. Then we could move the // start of those to the beginning of the loop, and shorten the length. // There would still be a problem with playtracks not even bar length. - while(loopOffset < c->eventlength) + while (loopOffset < c->eventlength) { // No more events than the length of the playtrack! and ensure the last // iteration is no longer than what is left. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2010-04-25 03:17:24
|
Revision: 748 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=748&view=rev Author: pstieber Date: 2010-04-25 03:17:18 +0000 (Sun, 25 Apr 2010) Log Message: ----------- Changed switch( to switch (. Modified Paths: -------------- trunk/jazz/src/PianoWindow.cpp trunk/jazz/src/Player.cpp trunk/jazz/src/Rhythm.cpp trunk/jazz/src/SampleDialog.cpp trunk/jazz/src/SampleWindow.cpp trunk/jazz/src/Signal2.cpp trunk/jazz/src/StandardFile.cpp Modified: trunk/jazz/src/PianoWindow.cpp =================================================================== --- trunk/jazz/src/PianoWindow.cpp 2010-04-25 03:15:14 UTC (rev 747) +++ trunk/jazz/src/PianoWindow.cpp 2010-04-25 03:17:18 UTC (rev 748) @@ -1183,7 +1183,7 @@ } else { - switch(Event.GetKeyCode()) + switch (Event.GetKeyCode()) { case WXK_DELETE: OnMenuCommand(wxID_DELETE); Modified: trunk/jazz/src/Player.cpp =================================================================== --- trunk/jazz/src/Player.cpp 2010-04-25 03:15:14 UTC (rev 747) +++ trunk/jazz/src/Player.cpp 2010-04-25 03:17:18 UTC (rev 748) @@ -1992,7 +1992,7 @@ while (i < size) { JZEvent* pEvent = 0; - switch(buf[i]) + switch (buf[i]) { case EV_TIMING: @@ -2016,7 +2016,7 @@ //unsigned char par = buf[i+5]; short val = *(short *)&buf[i+6]; //printf("got: chn %d, ctl %d, val %d\n", chn, ctl, val); - switch(buf[i+2]) { + switch (buf[i+2]) { case MIDI_CTL_CHANGE: pEvent = new tControl(0, chn, ctl, val); break; @@ -2046,7 +2046,7 @@ unsigned char chn = buf[i+3]; unsigned char key = buf[i+4]; unsigned char vel = buf[i+5]; - switch(buf[i+2]) + switch (buf[i+2]) { case MIDI_NOTEOFF: // SN++ added veloc pEvent = new tKeyOff(0, chn, key, vel); Modified: trunk/jazz/src/Rhythm.cpp =================================================================== --- trunk/jazz/src/Rhythm.cpp 2010-04-25 03:15:14 UTC (rev 747) +++ trunk/jazz/src/Rhythm.cpp 2010-04-25 03:17:18 UTC (rev 748) @@ -1200,7 +1200,7 @@ rhythm_edit->SetMeter(edit.steps_per_count, edit.count_per_bar, edit.n_bars); rand_checkbox->SetValue((bool)edit.randomize); - switch(edit.mode) + switch (edit.mode) { case MODE_CONTROL: veloc_edit->SetLabel("ctrl value"); Modified: trunk/jazz/src/SampleDialog.cpp =================================================================== --- trunk/jazz/src/SampleDialog.cpp 2010-04-25 03:15:14 UTC (rev 747) +++ trunk/jazz/src/SampleDialog.cpp 2010-04-25 03:17:18 UTC (rev 748) @@ -595,7 +595,7 @@ void tSynthDlg::OnMenuCommand(int id) { - switch(id) + switch (id) { case SYN_LOAD: { Modified: trunk/jazz/src/SampleWindow.cpp =================================================================== --- trunk/jazz/src/SampleWindow.cpp 2010-04-25 03:15:14 UTC (rev 747) +++ trunk/jazz/src/SampleWindow.cpp 2010-04-25 03:17:18 UTC (rev 748) @@ -962,7 +962,7 @@ cnvs->playpos->StopListen(); } - switch(id) + switch (id) { case MEN_EQUALIZER: if (equalizer == 0) Modified: trunk/jazz/src/Signal2.cpp =================================================================== --- trunk/jazz/src/Signal2.cpp 2010-04-25 03:15:14 UTC (rev 747) +++ trunk/jazz/src/Signal2.cpp 2010-04-25 03:17:18 UTC (rev 748) @@ -285,7 +285,7 @@ sr = xsr; delete filter; filter = 0; - switch(t) + switch (t) { case LOWPASS: filter = new tOpLowpass(); Modified: trunk/jazz/src/StandardFile.cpp =================================================================== --- trunk/jazz/src/StandardFile.cpp 2010-04-25 03:15:14 UTC (rev 747) +++ trunk/jazz/src/StandardFile.cpp 2010-04-25 03:17:18 UTC (rev 748) @@ -458,7 +458,7 @@ Stat = RunningStatus & 0xF0; Channel = RunningStatus & 0x0F; - switch(Stat) + switch (Stat) { case StatKeyOff: // SN++ added off veloc pEvent = new tKeyOff(Clock, Channel, cp[0],cp[1]); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2010-04-25 03:30:58
|
Revision: 750 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=750&view=rev Author: pstieber Date: 2010-04-25 03:30:51 +0000 (Sun, 25 Apr 2010) Log Message: ----------- Changed curly bracket placement and made cosmetic indentation changes. Modified Paths: -------------- trunk/jazz/src/FileSelector.cpp trunk/jazz/src/HarmonyBrowserAnalyzer.cpp trunk/jazz/src/HarmonyP.cpp trunk/jazz/src/Player.cpp trunk/jazz/src/Random.cpp trunk/jazz/src/Sample.cpp trunk/jazz/src/SampleCommand.cpp trunk/jazz/src/SampleDialog.cpp trunk/jazz/src/SampleWindow.cpp trunk/jazz/src/Signal2.cpp Modified: trunk/jazz/src/FileSelector.cpp =================================================================== --- trunk/jazz/src/FileSelector.cpp 2010-04-25 03:22:05 UTC (rev 749) +++ trunk/jazz/src/FileSelector.cpp 2010-04-25 03:30:51 UTC (rev 750) @@ -93,7 +93,8 @@ wxString buf; //sprintf(buf, "overwrite %s?", (char*)s); buf << "overwrite "<<s<<"?"; - if (wxMessageBox(buf, "Save ?", wxYES_NO) == wxNO) { + if (wxMessageBox(buf, "Save ?", wxYES_NO) == wxNO) + { s = wxEmptyString; } Modified: trunk/jazz/src/HarmonyBrowserAnalyzer.cpp =================================================================== --- trunk/jazz/src/HarmonyBrowserAnalyzer.cpp 2010-04-25 03:22:05 UTC (rev 749) +++ trunk/jazz/src/HarmonyBrowserAnalyzer.cpp 2010-04-25 03:30:51 UTC (rev 750) @@ -322,12 +322,16 @@ class tChordMatrix { public: - tChordMatrix() { + tChordMatrix() + { for (int i = 0; i < 12; i++) for (int j = 0; j < 12; j++) mat[i][j] = 0; } - double* operator[](int i) { return mat[i]; } + double* operator[](int i) + { + return mat[i];i + } private: double mat[12][12]; }; Modified: trunk/jazz/src/HarmonyP.cpp =================================================================== --- trunk/jazz/src/HarmonyP.cpp 2010-04-25 03:22:05 UTC (rev 749) +++ trunk/jazz/src/HarmonyP.cpp 2010-04-25 03:30:51 UTC (rev 750) @@ -212,15 +212,19 @@ void HBChord::Rotate(int semis) { - if (semis > 0) { - while (semis--) { + if (semis > 0) + { + while (semis--) + { if (keys & 0x800) keys = ((keys & ~0x800) << 1) + 1; else keys <<= 1; } } - else if (semis < 0) { - while (semis++) { + else if (semis < 0) + { + while (semis++) + { if (keys & 1) keys = (keys >> 1) | 0x800; else keys >>= 1; Modified: trunk/jazz/src/Player.cpp =================================================================== --- trunk/jazz/src/Player.cpp 2010-04-25 03:22:05 UTC (rev 749) +++ trunk/jazz/src/Player.cpp 2010-04-25 03:30:51 UTC (rev 750) @@ -1278,9 +1278,10 @@ int numbytes = 0; numbytes = get_recbuf_mpu( &recbuf ); - if (numbytes == 0) { - // No bytes in record buffer - return 0; + if (numbytes == 0) + { + // No bytes in record buffer + return 0; } // Go through the record buffer and create events @@ -1996,7 +1997,8 @@ { case EV_TIMING: - switch (buf[i+1]) { + switch (buf[i+1]) + { case TMR_WAIT_ABS: case TMR_ECHO: recd_clock = *(unsigned long *)&buf[i+4] + start_clock; @@ -2016,7 +2018,8 @@ //unsigned char par = buf[i+5]; short val = *(short *)&buf[i+6]; //printf("got: chn %d, ctl %d, val %d\n", chn, ctl, val); - switch (buf[i+2]) { + switch (buf[i+2]) + { case MIDI_CTL_CHANGE: pEvent = new tControl(0, chn, ctl, val); break; Modified: trunk/jazz/src/Random.cpp =================================================================== --- trunk/jazz/src/Random.cpp 2010-04-25 03:22:05 UTC (rev 749) +++ trunk/jazz/src/Random.cpp 2010-04-25 03:30:51 UTC (rev 750) @@ -396,12 +396,14 @@ ybar = ynul - hbar - hblk/2; hbar = hblk; - if (ybar < y) { + if (ybar < y) + { int d = y - ybar; ybar += d; hbar -= d; } - if (ybar + hbar > y + h) { + if (ybar + hbar > y + h) + { int d = (ybar + hbar) - (y + h); hbar -= d; } Modified: trunk/jazz/src/Sample.cpp =================================================================== --- trunk/jazz/src/Sample.cpp 2010-04-25 03:22:05 UTC (rev 749) +++ trunk/jazz/src/Sample.cpp 2010-04-25 03:30:51 UTC (rev 750) @@ -71,7 +71,8 @@ void tSample::SetFilename(const char *fname) { - if (strcmp(filename, fname) != 0) { + if (strcmp(filename, fname) != 0) + { dirty = 1; char *s = copystring(fname); label = copystring(wxFileNameFromPath(s)); @@ -175,7 +176,8 @@ int tSample::LoadWav() { struct stat buf; - if (stat(filename, &buf) == -1) { + if (stat(filename, &buf) == -1) + { perror(filename); return 1; } @@ -194,7 +196,8 @@ //fprintf(stderr, "%s format not recognized\n", filename); return 2; } - if (wh.format != PCM_CODE) { + if (wh.format != PCM_CODE) + { //fprintf(stderr, "%s must be PCM_CODE\n", filename); return 3; } @@ -316,13 +319,15 @@ } // convert mono -> stereo - if (channels == 1 && set.channels == 2) { + if (channels == 1 && set.channels == 2) + { short *old = data; length = length * 2; data = new short [length]; int i = 0; int j = 0; - while (i < length) { + while (i < length) + { data[i++] = old[j]; data[i++] = old[j++]; } @@ -357,7 +362,8 @@ } // apply volume and pan - if (volume != 127 || pan != 0) { + if (volume != 127 || pan != 0) + { int ch1 = volume; int ch2 = volume; int ppan = (set.channels == 2) ? pan : 0; @@ -380,7 +386,8 @@ { // determine file size struct stat buf; - if (stat(filename, &buf) == -1) { + if (stat(filename, &buf) == -1) + { perror(filename); return 1; } @@ -400,7 +407,8 @@ if (filename && filename[0] && !force && !dirty && external_flag) { struct stat buf; - if (stat(filename, &buf) == -1) { + if (stat(filename, &buf) == -1) + { perror(filename); return 1; } @@ -411,7 +419,8 @@ if (force || dirty) { FreeData(); - if (filename && filename[0]) { + if (filename && filename[0]) + { int rc = LoadWav(); dirty = 0; return rc; Modified: trunk/jazz/src/SampleCommand.cpp =================================================================== --- trunk/jazz/src/SampleCommand.cpp 2010-04-25 03:22:05 UTC (rev 749) +++ trunk/jazz/src/SampleCommand.cpp 2010-04-25 03:30:51 UTC (rev 750) @@ -428,7 +428,8 @@ val2 = in[inchan] * x; out[0] = (val1 + val2); - if (chans > 1) { + if (chans > 1) + { out[1] = (1.0 - p[7]) * out[0]; out[0] *= p[7]; } @@ -464,7 +465,8 @@ type = array[0] > 0 ? tSplFilter::LOWPASS : tSplFilter::HIGHPASS; filters[0].Init(type, sr, Index2Hertz(0), 0); // some band pass filters - for (i = 1; i < nfilters-1; i++) { + for (i = 1; i < nfilters-1; i++) + { double f = Index2Hertz(i); double f0 = Index2Hertz(i-1); double f1 = Index2Hertz(i+1); Modified: trunk/jazz/src/SampleDialog.cpp =================================================================== --- trunk/jazz/src/SampleDialog.cpp 2010-04-25 03:22:05 UTC (rev 749) +++ trunk/jazz/src/SampleDialog.cpp 2010-04-25 03:30:51 UTC (rev 750) @@ -354,11 +354,18 @@ #define N_HARM 40 -class tAddSynthArray { +class tAddSynthArray +{ public: JZRndArray arr; tRhyArrayEdit *edit; - tAddSynthArray(wxFrame *parent, const char *label, int n, int ynul, int ymax, int style) + tAddSynthArray( + wxFrame *parent, + const char *label, + int n, + int ynul, + int ymax, + int style) : arr(n, 0, ymax) { int i; @@ -368,8 +375,14 @@ edit = new tRhyArrayEdit(parent, arr, 10,10,10,10, style); edit->SetLabel(label); } - void Show(bool x) { edit->Show(x); } - void Init() { edit->Init(); } + void Show(bool x) + { + edit->Show(x); + } + void Init() + { + edit->Init(); + } }; class tAddSynth @@ -389,19 +402,22 @@ fft.edit->SetXMinMax(1, N_HARM); } - void SetDuration(int durat) { + void SetDuration(int durat) + { vol.edit->SetXMinMax(0, durat); pan.edit->SetXMinMax(0, durat); frq.edit->SetXMinMax(0, durat); } - void Refresh() { + void Refresh() + { fft.edit->Refresh(); vol.edit->Refresh(); frq.edit->Refresh(); pan.edit->Refresh(); } - void Init() { + void Init() + { fft.edit->Init(); vol.edit->Init(); frq.edit->Init(); @@ -617,7 +633,8 @@ case SYN_SAVE: { wxString fname = file_selector(default_filename, "Save Synth", 1, 0, "*.syn"); - if (fname) { + if (fname) + { ofstream os(fname); os << *this; } @@ -684,7 +701,8 @@ void tSynthDlg::AddEdits() { int i, k; - for (i = 0, k = 0; i < MAXSYNTHS; i++) { + for (i = 0, k = 0; i < MAXSYNTHS; i++) + { synths[i] = new tAddSynth(this); synths[i]->SetDuration(duration); } @@ -794,27 +812,33 @@ else #endif - if (&item == chk_vol) { + if (&item == chk_vol) + { vol_enable = chk_vol->GetValue(); resize = 1; } - else if (&item == chk_pan) { + else if (&item == chk_pan) + { pan_enable = chk_pan->GetValue(); resize = 1; } - else if (&item == chk_frq) { + else if (&item == chk_frq) + { frq_enable = chk_frq->GetValue(); resize = 1; } - else if (&item == chk_fft) { + else if (&item == chk_fft) + { fft_enable = chk_fft->GetValue(); resize = 1; } - else if (&item == chk_noise) { + else if (&item == chk_noise) + { noise_enable = chk_noise->GetValue(); resize = 1; } - else if (&item == num_synths_slider) { + else if (&item == num_synths_slider) + { int n = num_synths_slider->GetValue(); if (n != num_synths) { // avoid flashing @@ -822,9 +846,11 @@ resize = 1; } } - else if (&item == duration_slider) { + else if (&item == duration_slider) + { duration = duration_slider->GetValue(); - for (int i = 0, k = 0; i < num_synths; i++) { + for (int i = 0, k = 0; i < num_synths; i++) + { tAddSynth &s = *synths[i]; s.SetDuration(duration); } @@ -833,14 +859,15 @@ else if (&item == midi_key_slider) midi_key = midi_key_slider->GetValue(); - if (resize) { + if (resize) + { SetupEdits(); int cw, ch; GetClientSize(&cw, &ch); OnSize(cw, ch); } - - else if (redraw) { + else if (redraw) + { for (int i = 0; i < num_synths; i++) synths[i]->Refresh(); } @@ -852,7 +879,8 @@ int i; tSample &spl = win.GetSample(); JZRndArray *arr[MAXSYNTHS][4]; - for (i = 0; i < MAXSYNTHS; i++) { + for (i = 0; i < MAXSYNTHS; i++) + { arr[i][0] = &synths[i]->fft.arr; arr[i][1] = &synths[i]->vol.arr; arr[i][2] = &synths[i]->frq.arr; @@ -1112,7 +1140,8 @@ double maxfreq = (int)(win.GetSample().GetSamplingRate() / 2); // watch order of enum in signali.h typestring = 0; - for (int i = 0; filter_types[i]; i++) { + for (int i = 0; filter_types[i]; i++) + { typelist.Append((wxObject *)filter_types[i]); // ??? if (i == (int)type) typestring = copystring(filter_types[i]); Modified: trunk/jazz/src/SampleWindow.cpp =================================================================== --- trunk/jazz/src/SampleWindow.cpp 2010-04-25 03:22:05 UTC (rev 749) +++ trunk/jazz/src/SampleWindow.cpp 2010-04-25 03:30:51 UTC (rev 750) @@ -92,11 +92,13 @@ class tInsertionPoint { public: - tInsertionPoint(wxScrolledWindow *c) : cnvs(c) { + tInsertionPoint(wxScrolledWindow *c) : cnvs(c) + { last_x = 0; visible = 0; }; - void Draw(int x) { + void Draw(int x) + { last_x = x; visible ^= 1; wxDC *dc = new wxClientDC(cnvs); @@ -108,7 +110,8 @@ dc->SetPen(*wxBLACK_PEN); dc->SetLogicalFunction(wxCOPY); } - void Draw() { + void Draw() + { Draw(last_x); } int IsVisible() const { @@ -133,7 +136,8 @@ public: tSampleCnvs(tSampleWin *win, tSample &sample); virtual ~tSampleCnvs(); - void Redraw() { + void Redraw() + { OnPaint(); } virtual void OnPaint(); @@ -180,22 +184,28 @@ { public: tSmplWinSettingsForm(tSampleWin &w) - : wxForm( USED_WXFORM_BUTTONS ), win(w) {} - void EditForm(wxPanel *panel) { + : wxForm( USED_WXFORM_BUTTONS ), + win(w) + {} + void EditForm(wxPanel *panel) + { Add(wxMakeFormBool("Show Midi Time", &win.cnvs->midi_time)); Add(wxMakeFormNewLine()); AssociatePanel(panel); } - void OnOk() { + void OnOk() + { win.settings = 0; win.Redraw(); wxForm::OnOk(); } - void OnCancel() { + void OnCancel() + { win.settings = 0; wxForm::OnCancel(); } - void OnHelp() { + void OnHelp() + { gpHelpInstance->ShowTopic("Settings"); } private: @@ -214,13 +224,15 @@ x = 0; } - ~tSamplePlayPosition() { + ~tSamplePlayPosition() + { Stop(); if (visible) Draw(); } - void StopListen() { + void StopListen() + { Stop(); if (gpMidiPlayer->IsListening()) gpMidiPlayer->ListenAudio(-1); @@ -256,7 +268,8 @@ virtual void Notify() { int pos = player->GetListenerPlayPosition(); - if (pos < 0) { + if (pos < 0) + { StopListen(); return; } @@ -498,7 +511,8 @@ int sfr = win->GetPaintOffset(); int sto = sfr + win->GetPaintLength(); - if (!midi_time) { + if (!midi_time) + { // display time JZMapper Map(sfr, sto, x, x+w); int tfr = spl->Samples2Time(sfr) / 1000; @@ -542,7 +556,8 @@ // draw a tickmark line dc->DrawLine(xx, y - 5, xx, y); // draw a text - if (j == 0) { + if (j == 0) + { char buf[50]; sprintf(buf, "%d", i + 1); int fw, fh; @@ -862,7 +877,8 @@ cnvs->SetSize(xx, yy, ww, hi); hi = hh / nn; - for (int i = 0; i < num_params; i++) { + for (int i = 0; i < num_params; i++) + { int yi = yy + (i + spl.GetChannels()) * hh / nn; params[i]->SetSize(xx, yi, ww, hi); } @@ -876,7 +892,8 @@ bool tSampleWin::HaveInsertionPoint(int &offs, bool warn) { - if (cnvs->sel_fr == cnvs->sel_to && cnvs->sel_fr >= 0) { + if (cnvs->sel_fr == cnvs->sel_to && cnvs->sel_fr >= 0) + { offs = cnvs->sel_fr; return TRUE; } @@ -890,7 +907,8 @@ bool tSampleWin::HaveSelection(int &fr_smpl, int &to_smpl, HaveSelectionMode mode) { - if (cnvs->sel_fr < cnvs->sel_to && cnvs->sel_fr >= 0) { + if (cnvs->sel_fr < cnvs->sel_to && cnvs->sel_fr >= 0) + { fr_smpl = cnvs->sel_fr; to_smpl = cnvs->sel_to; return TRUE; @@ -921,7 +939,8 @@ void tSampleWin::ClrParam() { - if (num_params > 0) { + if (num_params > 0) + { int n = num_params; num_params = 0; for (int i = 0; i < n; ++i) @@ -1351,7 +1370,8 @@ } } -void tSampleWin::PlaySample() { +void tSampleWin::PlaySample() +{ cnvs->Play(); } Modified: trunk/jazz/src/Signal2.cpp =================================================================== --- trunk/jazz/src/Signal2.cpp 2010-04-25 03:22:05 UTC (rev 749) +++ trunk/jazz/src/Signal2.cpp 2010-04-25 03:30:51 UTC (rev 750) @@ -36,7 +36,8 @@ const long N = isig.GetLength() + (long)(add_seconds * sampling_rate); osig.Resize(N); tSigValue val; - for (long i = 0; i < N; i++) { + for (long i = 0; i < N; i++) + { isig.GetSample(val); osig.Out(val); current++; @@ -151,7 +152,8 @@ for (k = 0; k < N; k++) wav[k] = 0; - for (f = 0; f < arr.Size(); f++) { + for (f = 0; f < arr.Size(); f++) + { tLineMap<float>map(0, N, 0, 2*PI*(f+1)); for (k = 0; k < N; k++) wav[k] += sin(map(k)) * (float)arr[f] * (float)arr[f]; @@ -175,7 +177,8 @@ { int i, k; //cout << arr.GetLabel() << endl; - for (i = 0; i < N; i++) { + for (i = 0; i < N; i++) + { cout << i << ' '; for (k = 0; k < tSigValue::MAXCHN; k++) cout << wav[i][k] << ' '; @@ -272,11 +275,13 @@ // old Filter Interface // --------------------------------------------------------------- -tSplFilter::tSplFilter() { +tSplFilter::tSplFilter() +{ filter = 0; } -tSplFilter::~tSplFilter() { +tSplFilter::~tSplFilter() +{ delete filter; } @@ -311,7 +316,8 @@ filter->Setup(sr, f0, f0 * bw); } -float tSplFilter::Loop(float sig) { +float tSplFilter::Loop(float sig) +{ return filter->Loop(sig); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2010-04-25 16:42:25
|
Revision: 755 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=755&view=rev Author: pstieber Date: 2010-04-25 16:42:19 +0000 (Sun, 25 Apr 2010) Log Message: ----------- 1. Changed GlobalSettingsDialog to EditAudioGlobalSettings in tSampleSet and JZPlayer. 2. Activated the corresponding dialog. Modified Paths: -------------- trunk/jazz/src/Audio.cpp trunk/jazz/src/Audio.h trunk/jazz/src/Player.cpp trunk/jazz/src/Player.h trunk/jazz/src/Project.cpp Modified: trunk/jazz/src/Audio.cpp =================================================================== --- trunk/jazz/src/Audio.cpp 2010-04-25 05:19:15 UTC (rev 754) +++ trunk/jazz/src/Audio.cpp 2010-04-25 16:42:19 UTC (rev 755) @@ -803,7 +803,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void tSampleSet::GlobalSettingsDlg() +void tSampleSet::EditAudioGlobalSettings(wxWindow* pParent) { if (spl_dialog) { @@ -813,8 +813,8 @@ if (mpGlobalSettingsDialog == 0) { + mpGlobalSettingsDialog = new wxDialog(pParent, wxID_ANY, "Audio Settings"); #ifdef OBSOLETE - mpGlobalSettingsDialog = new wxDialogBox(gpTrackWindow, "Audio Settings", false); tAudioGloblForm *form = new tAudioGloblForm(*this); form->AssociatePanel(mpGlobalSettingsDialog); mpGlobalSettingsDialog->Fit(); @@ -1354,10 +1354,6 @@ return 1; } - case ID_AUDIO_GLOBAL_SETTINGS: - GlobalSettingsDlg(); - break; - case ID_AUDIO_SAMPLES: SamplesDlg(); return 1; Modified: trunk/jazz/src/Audio.h =================================================================== --- trunk/jazz/src/Audio.h 2010-04-25 05:19:15 UTC (rev 754) +++ trunk/jazz/src/Audio.h 2010-04-25 16:42:19 UTC (rev 755) @@ -370,7 +370,7 @@ return *samples[i]; } - void GlobalSettingsDlg(); + void EditAudioGlobalSettings(wxWindow* pParent); protected: Modified: trunk/jazz/src/Player.cpp =================================================================== --- trunk/jazz/src/Player.cpp 2010-04-25 05:19:15 UTC (rev 754) +++ trunk/jazz/src/Player.cpp 2010-04-25 16:42:19 UTC (rev 755) @@ -685,9 +685,9 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZPlayer::EditGlobalAudioSettings(wxWindow* pParent) +void JZPlayer::EditAudioGlobalSettings(wxWindow* pParent) { - mSamples.GlobalSettingsDlg(); + mSamples.EditAudioGlobalSettings(pParent); } #ifdef DEV_MPU401 Modified: trunk/jazz/src/Player.h =================================================================== --- trunk/jazz/src/Player.h 2010-04-25 05:19:15 UTC (rev 754) +++ trunk/jazz/src/Player.h 2010-04-25 16:42:19 UTC (rev 755) @@ -281,7 +281,7 @@ mSamples.AdjustAudioLength(t, ticks_per_minute); } - void EditGlobalAudioSettings(wxWindow* pParent); + void EditAudioGlobalSettings(wxWindow* pParent); void EditSample(int key) { Modified: trunk/jazz/src/Project.cpp =================================================================== --- trunk/jazz/src/Project.cpp 2010-04-25 05:19:15 UTC (rev 754) +++ trunk/jazz/src/Project.cpp 2010-04-25 16:42:19 UTC (rev 755) @@ -624,7 +624,7 @@ //----------------------------------------------------------------------------- void JZProject::EditAudioGlobalSettings(wxWindow* pParent) { - mpMidiPlayer->EditGlobalAudioSettings(pParent); + mpMidiPlayer->EditAudioGlobalSettings(pParent); } //----------------------------------------------------------------------------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2010-04-26 14:36:06
|
Revision: 759 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=759&view=rev Author: pstieber Date: 2010-04-26 14:35:58 +0000 (Mon, 26 Apr 2010) Log Message: ----------- Updated MIDI event class names. Modified Paths: -------------- trunk/jazz/src/AlsaPlayer.cpp trunk/jazz/src/AsciiMidiFile.cpp trunk/jazz/src/Audio.cpp trunk/jazz/src/Command.cpp trunk/jazz/src/Command.h trunk/jazz/src/ControlEdit.cpp trunk/jazz/src/Dialogs/ControllerDialog.cpp trunk/jazz/src/Dialogs/ControllerDialog.h trunk/jazz/src/Dialogs/EndOfTrackDialog.cpp trunk/jazz/src/Dialogs/EndOfTrackDialog.h trunk/jazz/src/Dialogs/KeyOnDialog.cpp trunk/jazz/src/Dialogs/KeyOnDialog.h trunk/jazz/src/Dialogs/ProgramChangeDialog.cpp trunk/jazz/src/Dialogs/ProgramChangeDialog.h trunk/jazz/src/Dialogs/SetTempoDialog.cpp trunk/jazz/src/Dialogs/SetTempoDialog.h trunk/jazz/src/Dialogs/SysexDialog.cpp trunk/jazz/src/Dialogs/SysexDialog.h trunk/jazz/src/Dialogs/TextDialog.cpp trunk/jazz/src/Dialogs/TextDialog.h trunk/jazz/src/Dialogs.cpp trunk/jazz/src/Events.cpp trunk/jazz/src/Events.h trunk/jazz/src/Harmony.cpp trunk/jazz/src/HarmonyBrowserAnalyzer.cpp trunk/jazz/src/HarmonyBrowserAnalyzer.h trunk/jazz/src/Metronome.cpp trunk/jazz/src/Metronome.h trunk/jazz/src/PianoWindow.cpp trunk/jazz/src/Player.cpp trunk/jazz/src/PortMidiPlayer.cpp trunk/jazz/src/Rhythm.cpp trunk/jazz/src/Song.cpp trunk/jazz/src/Song.h trunk/jazz/src/StandardFile.cpp trunk/jazz/src/Synth.cpp trunk/jazz/src/Synth.h trunk/jazz/src/Track.cpp trunk/jazz/src/Track.h trunk/jazz/src/mswin/WindowsPlayer.cpp Modified: trunk/jazz/src/AlsaPlayer.cpp =================================================================== --- trunk/jazz/src/AlsaPlayer.cpp 2010-04-26 03:44:22 UTC (rev 758) +++ trunk/jazz/src/AlsaPlayer.cpp 2010-04-26 14:35:58 UTC (rev 759) @@ -411,7 +411,7 @@ { case StatKeyOn: { - tKeyOn* pKeyOn = pEvent->IsKeyOn(); + JZKeyOnEvent* pKeyOn = pEvent->IsKeyOn(); set_event_header(&ev, pEvent->GetClock(), SND_SEQ_EVENT_NOTEON); ev.data.note.channel = pKeyOn->GetChannel(); ev.data.note.note = pKeyOn->GetKey(); @@ -422,7 +422,7 @@ case StatKeyOff: { - tKeyOff* pKeyOff = pEvent->IsKeyOff(); + JZKeyOffEvent* pKeyOff = pEvent->IsKeyOff(); set_event_header(&ev, pEvent->GetClock(), SND_SEQ_EVENT_NOTEOFF); ev.data.note.channel = pKeyOff->GetChannel(); ev.data.note.note = pKeyOff->GetKey(); @@ -433,7 +433,7 @@ case StatProgram: { - tProgram* pProgram = pEvent->IsProgram(); + JZProgramEvent* pProgram = pEvent->IsProgram(); set_event_header(&ev, pEvent->GetClock(), SND_SEQ_EVENT_PGMCHANGE); ev.data.control.channel = pProgram->GetChannel(); ev.data.control.value = pProgram->GetProgram(); @@ -443,7 +443,7 @@ case StatKeyPressure: { - tKeyPressure* pKeyPressure = pEvent->IsKeyPressure(); + JZKeyPressureEvent* pKeyPressure = pEvent->IsKeyPressure(); set_event_header(&ev, pEvent->GetClock(), SND_SEQ_EVENT_KEYPRESS); ev.data.note.channel = pKeyPressure->GetChannel(); ev.data.note.note = pKeyPressure->GetKey(); @@ -454,7 +454,7 @@ case StatChnPressure: { - tChnPressure *k = pEvent->IsChnPressure(); + JZChnPressureEvent *k = pEvent->IsChnPressure(); set_event_header(&ev, pEvent->GetClock(), SND_SEQ_EVENT_CHANPRESS); ev.data.control.channel = k->GetChannel(); ev.data.control.value = k->Value; @@ -464,7 +464,7 @@ case StatControl: { - tControl *k = pEvent->IsControl(); + JZControlEvent* k = pEvent->IsControl(); set_event_header(&ev, pEvent->GetClock(), SND_SEQ_EVENT_CONTROLLER); ev.data.control.channel = k->GetChannel(); ev.data.control.param = k->GetControl(); @@ -475,7 +475,7 @@ case StatPitch: { - tPitch *k = pEvent->IsPitch(); + JZPitchEvent *k = pEvent->IsPitch(); set_event_header(&ev, pEvent->GetClock(), SND_SEQ_EVENT_PITCHBEND); ev.data.control.channel = k->GetChannel(); ev.data.control.value = k->Value; @@ -495,7 +495,7 @@ case StatSysEx: { - tSysEx* pSysEx = pEvent->IsSysEx(); + JZSysExEvent* pSysEx = pEvent->IsSysEx(); // prepend 0xf0 char* pBuffer = new char[pSysEx->GetDataLength() + 1]; pBuffer[0] = 0xF0; @@ -841,7 +841,7 @@ case SND_SEQ_EVENT_NOTEON: if (ev->data.note.velocity > 0) { - pEvent = new tKeyOn( + pEvent = new JZKeyOnEvent( 0, ev->data.note.channel, ev->data.note.note, @@ -849,12 +849,16 @@ } else { - pEvent = new tKeyOff(0, ev->data.note.channel, ev->data.note.note, 0); + pEvent = new JZKeyOffEvent( + 0, + ev->data.note.channel, + ev->data.note.note, + 0); } break; case SND_SEQ_EVENT_NOTEOFF: - pEvent = new tKeyOff( + pEvent = new JZKeyOffEvent( 0, ev->data.note.channel, ev->data.note.note, @@ -862,14 +866,14 @@ break; case SND_SEQ_EVENT_PGMCHANGE: - pEvent = new tProgram( + pEvent = new JZProgramEvent( 0, ev->data.control.channel, ev->data.control.value); break; case SND_SEQ_EVENT_KEYPRESS: - pEvent = new tKeyPressure( + pEvent = new JZKeyPressureEvent( 0, ev->data.note.channel, ev->data.note.note, @@ -877,14 +881,14 @@ break; case SND_SEQ_EVENT_CHANPRESS: - pEvent = new tChnPressure( + pEvent = new JZChnPressureEvent( 0, ev->data.control.channel, ev->data.control.value); break; case SND_SEQ_EVENT_CONTROLLER: - pEvent = new tControl( + pEvent = new JZControlEvent( 0, ev->data.control.channel, ev->data.control.param, @@ -892,14 +896,14 @@ break; case SND_SEQ_EVENT_PITCHBEND: - pEvent = new tPitch( + pEvent = new JZPitchEvent( 0, ev->data.control.channel, ev->data.control.value); break; case SND_SEQ_EVENT_SYSEX: - pEvent = new tSysEx( + pEvent = new JZSysExEvent( 0, ((unsigned char *)ev->data.ext.ptr) + 1, ev->data.ext.len - 1); Modified: trunk/jazz/src/AsciiMidiFile.cpp =================================================================== --- trunk/jazz/src/AsciiMidiFile.cpp 2010-04-26 03:44:22 UTC (rev 758) +++ trunk/jazz/src/AsciiMidiFile.cpp 2010-04-26 14:35:58 UTC (rev 759) @@ -67,46 +67,46 @@ break; case StatKeyOff: - pEvent = new tKeyOff(Clock, cha, pBuffer[0]); + pEvent = new JZKeyOffEvent(Clock, cha, pBuffer[0]); break; case StatKeyOn: - pEvent = new tKeyOn(Clock, cha, pBuffer[0], pBuffer[1]); + pEvent = new JZKeyOnEvent(Clock, cha, pBuffer[0], pBuffer[1]); break; case StatControl: - pEvent = new tControl(Clock, cha, pBuffer[0], pBuffer[1]); + pEvent = new JZControlEvent(Clock, cha, pBuffer[0], pBuffer[1]); break; case StatPitch: - pEvent = new tPitch(Clock, cha, pBuffer[0], pBuffer[1]); + pEvent = new JZPitchEvent(Clock, cha, pBuffer[0], pBuffer[1]); break; case StatProgram: - pEvent = new tProgram(Clock, cha, pBuffer[0]); + pEvent = new JZProgramEvent(Clock, cha, pBuffer[0]); break; case StatText: - pEvent = new tText(Clock, pBuffer, Length); + pEvent = new JZTextEvent(Clock, pBuffer, Length); break; case StatTrackName: - pEvent = new tTrackName(Clock, pBuffer, Length); + pEvent = new JZTrackNameEvent(Clock, pBuffer, Length); break; case StatMarker: - pEvent = new tMarker(Clock, pBuffer, Length); + pEvent = new JZMarkerEvent(Clock, pBuffer, Length); break; case StatEndOfTrack: break; case StatSetTempo: - pEvent = new tSetTempo(Clock, pBuffer[0], pBuffer[1], pBuffer[2]); + pEvent = new JZSetTempoEvent(Clock, pBuffer[0], pBuffer[1], pBuffer[2]); break; case StatTimeSignat: - pEvent = new tTimeSignat( + pEvent = new JZTimeSignatEvent( Clock, pBuffer[0], pBuffer[1], @@ -115,7 +115,7 @@ break; case StatSysEx: - pEvent = new tSysEx(Clock, pBuffer, Length); + pEvent = new JZSysExEvent(Clock, pBuffer, Length); break; } @@ -160,7 +160,7 @@ //----------------------------------------------------------------------------- int JZAsciiWrite::Write(JZEvent* pEvent, unsigned char* pData, int Length) { - tChannelEvent* pChannelEvent; + JZChannelEvent* pChannelEvent; fprintf(mpFd, "%6d %02x ", pEvent->GetClock(), pEvent->GetStat()); if ((pChannelEvent = pEvent->IsChannelEvent()) != 0) Modified: trunk/jazz/src/Audio.cpp =================================================================== --- trunk/jazz/src/Audio.cpp 2010-04-26 03:44:22 UTC (rev 758) +++ trunk/jazz/src/Audio.cpp 2010-04-26 14:35:58 UTC (rev 759) @@ -465,7 +465,7 @@ } event_index++; - tKeyOn* pKeyOn = e->IsKeyOn(); + JZKeyOnEvent* pKeyOn = e->IsKeyOn(); if (pKeyOn && num_voices < MAXPOLY) { voices[num_voices++]->Start(samples[pKeyOn->GetKey()], pKeyOn->GetClock()); @@ -581,7 +581,7 @@ JZEvent *e = it.First(); while (e) { - tKeyOn* pKeyOn = e->IsKeyOn(); + JZKeyOnEvent* pKeyOn = e->IsKeyOn(); if (pKeyOn) { pKeyOn->SetLength( @@ -913,7 +913,7 @@ e = iter.Next(); } // add a noteon - tKeyOn* pKeyOn = new tKeyOn( + JZKeyOnEvent* pKeyOn = new JZKeyOnEvent( frc, track->Channel - 1, key, Modified: trunk/jazz/src/Command.cpp =================================================================== --- trunk/jazz/src/Command.cpp 2010-04-26 03:44:22 UTC (rev 758) +++ trunk/jazz/src/Command.cpp 2010-04-26 14:35:58 UTC (rev 759) @@ -138,7 +138,7 @@ //----------------------------------------------------------------------------- void tSelectedKeys::ExecuteEvent(JZTrack* pTrack, JZEvent* pEvent) { - tKeyOn* pKeyOn = pEvent->IsKeyOn(); + JZKeyOnEvent* pKeyOn = pEvent->IsKeyOn(); if (pKeyOn) { Keys[pKeyOn->GetKey()] += pKeyOn->GetEventLength(); @@ -402,10 +402,10 @@ //----------------------------------------------------------------------------- void tCmdQuantize::ExecuteEvent(JZTrack* pTrack, JZEvent* pEvent) { - tKeyOn* pKeyOn; + JZKeyOnEvent* pKeyOn; if ((pKeyOn = pEvent->IsKeyOn()) != 0) { - pKeyOn = (tKeyOn *)pEvent->Copy(); + pKeyOn = (JZKeyOnEvent *)pEvent->Copy(); if (mNoteStart) { pKeyOn->SetClock(Quantize(pKeyOn->GetClock(), 0)); @@ -441,10 +441,10 @@ //----------------------------------------------------------------------------- void tCmdTranspose::ExecuteEvent(JZTrack* pTrack, JZEvent* pEvent) { - tKeyOn* pKeyOn; + JZKeyOnEvent* pKeyOn; if (pEvent->IsKeyOn()) { - pKeyOn = (tKeyOn *)pEvent->Copy(); + pKeyOn = (JZKeyOnEvent *)pEvent->Copy(); if (mFitIntoScale) { pKeyOn->SetKey(pKeyOn->GetKey() + mNotes); @@ -461,7 +461,7 @@ // After touch. if (pEvent->IsKeyPressure()) { - tKeyPressure* pKeyPressure = (tKeyPressure *)pEvent->Copy(); + JZKeyPressureEvent* pKeyPressure = (JZKeyPressureEvent *)pEvent->Copy(); if (mFitIntoScale) { pKeyPressure->SetKey(pKeyPressure->GetKey() + mNotes); @@ -491,11 +491,11 @@ //----------------------------------------------------------------------------- void tCmdSetChannel::ExecuteEvent(JZTrack* pTrack, JZEvent* pEvent) { - tChannelEvent* pChannelEvent; + JZChannelEvent* pChannelEvent; if ((pChannelEvent = pEvent->IsChannelEvent()) != 0) { - pChannelEvent = (tChannelEvent *)pEvent->Copy(); + pChannelEvent = (JZChannelEvent *)pEvent->Copy(); pChannelEvent->SetChannel(mNewChannel); pTrack->Kill(pEvent); pTrack->Put(pChannelEvent); @@ -523,11 +523,11 @@ //----------------------------------------------------------------------------- void tCmdVelocity::ExecuteEvent(JZTrack* pTrack, JZEvent* pEvent) { - tKeyOn* pKeyOn; + JZKeyOnEvent* pKeyOn; if (pEvent->IsKeyOn() != 0) { - pKeyOn = (tKeyOn *)pEvent->Copy(); + pKeyOn = (JZKeyOnEvent *)pEvent->Copy(); int Value = 0; if (mToValue <= 0) { @@ -575,11 +575,11 @@ //----------------------------------------------------------------------------- void tCmdLength::ExecuteEvent(JZTrack* pTrack, JZEvent* pEvent) { - tKeyOn* pKeyOn; + JZKeyOnEvent* pKeyOn; if (pEvent->IsKeyOn() != 0) { - pKeyOn = (tKeyOn *)pEvent->Copy(); + pKeyOn = (JZKeyOnEvent *)pEvent->Copy(); int Value = 0; if (mToValue <= 0) { @@ -628,7 +628,7 @@ { // Make a copy of the current event. JZEvent* k; - k = (tKeyOn *)pEvent->Copy(); + k = (JZKeyOnEvent *)pEvent->Copy(); //little hack, if clock is -1000 it means set startclock from the first event. if (startClock==-1000) @@ -705,8 +705,8 @@ } pitchdiff = pEvent->GetPitch()-previouspitch; - tPitch* pitchmodulation=0; - pitchmodulation = new tPitch( + JZPitchEvent* pitchmodulation=0; + pitchmodulation = new JZPitchEvent( pEvent->GetClock(), channel, pitchsteparray[pitchdiff + 4]); @@ -715,12 +715,12 @@ pTrack->Kill(pEvent); //remove the old event - pTrack->Put(new tControl( + pTrack->Put(new JZControlEvent( pEvent->GetClock(), channel, 0x07, pEvent->IsKeyOn()->GetVelocity())); - pTrack->Put(new tControl( + pTrack->Put(new JZControlEvent( pEvent->GetClock() + pEvent->IsKeyOn()->GetEventLength(), channel, 0x07, @@ -734,7 +734,7 @@ pEvent = Iterator.Next(); } //now insert the new long event - tKeyOn* longevent = new tKeyOn( + JZKeyOnEvent* longevent = new JZKeyOnEvent( startclock, channel, startkey, @@ -766,14 +766,14 @@ //----------------------------------------------------------------------------- void tCmdMidiDelay::ExecuteEvent(JZTrack* pTrack, JZEvent* pEvent) { - tKeyOn* pKeyOn; + JZKeyOnEvent* pKeyOn; for (int i = 1; i < repeat; ++i) { if (pEvent->IsKeyOn()) { // Only echo note events. - pKeyOn = (tKeyOn *)pEvent->Copy(); + pKeyOn = (JZKeyOnEvent *)pEvent->Copy(); pKeyOn->SetClock(pKeyOn->GetClock()+ clockDelay * i); pKeyOn->SetVelocity( (unsigned char)(pow(scale, i) * pKeyOn->GetVelocity())); @@ -806,7 +806,7 @@ //----------------------------------------------------------------------------- void tCmdCleanup::ExecuteEvent(JZTrack* pTrack, JZEvent* pEvent) { - tKeyOn* pKeyOn; + JZKeyOnEvent* pKeyOn; if ((pKeyOn = pEvent->IsKeyOn()) != 0) { if (pKeyOn->GetEventLength() < lengthLimit) @@ -817,7 +817,7 @@ else if (shortenOverlaps) { // Shorten length of overlapping notes. - tKeyOn* pPreviousKeyOn = prev_note[pKeyOn->GetChannel()][pKeyOn->GetKey()]; + JZKeyOnEvent* pPreviousKeyOn = prev_note[pKeyOn->GetChannel()][pKeyOn->GetKey()]; if ( pPreviousKeyOn && pPreviousKeyOn->GetClock() + pPreviousKeyOn->GetEventLength() >= @@ -851,12 +851,12 @@ //----------------------------------------------------------------------------- void tCmdSearchReplace::ExecuteEvent(JZTrack* pTrack, JZEvent* pEvent) { - tControl* pControl = pEvent->IsControl(); + JZControlEvent* pControl = pEvent->IsControl(); if (pControl) { if (pControl->GetControl() == mFrom) { - tControl* pControlCopy = (tControl *)pControl->Copy(); + JZControlEvent* pControlCopy = (JZControlEvent *)pControl->Copy(); pControlCopy->SetControl(mTo); pTrack->Kill(pControl); pTrack->Put(pControlCopy); @@ -1042,7 +1042,7 @@ { if (pEvent->IsKeyOn()) { - tKeyOn* pKeyOn = (tKeyOn *)pEvent->Copy(); + JZKeyOnEvent* pKeyOn = (JZKeyOnEvent *)pEvent->Copy(); pKeyOn->SetClock( mpFilter->GetFromClock() + mpFilter->GetToClock() - pKeyOn->GetClock()); pTrack->Kill(pEvent); @@ -1082,7 +1082,7 @@ { if (mpFilter->IsSelected(pEvent) && pEvent->IsKeyOn()) { - tKeyOn* pKeyOn = (tKeyOn *)pEvent; + JZKeyOnEvent* pKeyOn = (JZKeyOnEvent *)pEvent; Keys[pKeyOn->GetKey()] = 1; } pEvent = Iterator.Next(); @@ -1096,7 +1096,7 @@ { if (mpFilter->IsSelected(pEvent) && pEvent->IsKeyOn()) { - tKeyOn* pKeyOn = (tKeyOn *)pEvent->Copy(); + JZKeyOnEvent* pKeyOn = (JZKeyOnEvent *)pEvent->Copy(); int n_th = 0; // the n'th key from bottom @@ -1157,7 +1157,7 @@ //----------------------------------------------------------------------------- void tCmdMapper::ExecuteEvent(JZTrack* pTrack, JZEvent* pEvent) { - tKeyOn* pKeyOn = pEvent->IsKeyOn(); + JZKeyOnEvent* pKeyOn = pEvent->IsKeyOn(); if (pKeyOn) { int sval = 0; @@ -1224,7 +1224,7 @@ { sval = 1; } - tKeyOn* pKeyOnCopy = (tKeyOn *)pKeyOn->Copy(); + JZKeyOnEvent* pKeyOnCopy = (JZKeyOnEvent *)pKeyOn->Copy(); pTrack->Kill(pKeyOn); pKeyOnCopy->SetVelocity(sval); pTrack->Put(pKeyOnCopy); @@ -1245,7 +1245,7 @@ { sval = 1; } - tKeyOn* pKeyOnCopy = (tKeyOn *)pKeyOn->Copy(); + JZKeyOnEvent* pKeyOnCopy = (JZKeyOnEvent *)pKeyOn->Copy(); pTrack->Kill(pKeyOn); pKeyOnCopy->SetKey(sval); pTrack->Put(pKeyOnCopy); @@ -1262,7 +1262,7 @@ { sval = 1; } - tKeyOn* pKeyOnCopy = (tKeyOn *)pKeyOn->Copy(); + JZKeyOnEvent* pKeyOnCopy = (JZKeyOnEvent *)pKeyOn->Copy(); pTrack->Kill(pKeyOn); pKeyOnCopy->SetLength(sval); pTrack->Put(pKeyOnCopy); @@ -1271,7 +1271,7 @@ case clock: { - tKeyOn* pKeyOnCopy = (tKeyOn *)pKeyOn->Copy(); + JZKeyOnEvent* pKeyOnCopy = (JZKeyOnEvent *)pKeyOn->Copy(); pKeyOnCopy->SetClock(pKeyOnCopy->GetClock() + sval); if (pKeyOnCopy->GetClock() < 0) { Modified: trunk/jazz/src/Command.h =================================================================== --- trunk/jazz/src/Command.h 2010-04-26 03:44:22 UTC (rev 758) +++ trunk/jazz/src/Command.h 2010-04-26 14:35:58 UTC (rev 759) @@ -32,7 +32,7 @@ class tEventArray; class JZRndArray; class JZBarInfo; -class tKeyOn; +class JZKeyOnEvent; //***************************************************************************** //***************************************************************************** @@ -188,7 +188,7 @@ { long lengthLimit; int shortenOverlaps; - tKeyOn *prev_note[16][128]; + JZKeyOnEvent *prev_note[16][128]; public: tCmdCleanup(JZFilter* pFilter, long limitClocks, int shortenOverlaps); virtual void ExecuteTrack(JZTrack* pTrack); Modified: trunk/jazz/src/ControlEdit.cpp =================================================================== --- trunk/jazz/src/ControlEdit.cpp 2010-04-26 03:44:22 UTC (rev 758) +++ trunk/jazz/src/ControlEdit.cpp 2010-04-26 14:35:58 UTC (rev 759) @@ -312,7 +312,7 @@ // edit mode: Erzeugt keine neuen Events sondern aendert den Wert // bestehender Events. // SN++ - tControl* pControlCopy; + JZControlEvent* pControlCopy; while (pEvent) { if (IsCtrlEdit(pEvent)) @@ -441,7 +441,7 @@ JZEvent * tPitchEdit::NewEvent(long clock, int val) { - return new tPitch(clock, track->Channel - 1, val); + return new JZPitchEvent(clock, track->Channel - 1, val); } // ------------------------------------------------------------------ @@ -475,7 +475,7 @@ int tCtrlEdit::IsCtrlEdit(JZEvent* pEvent) { - tControl* pControl = pEvent->IsControl(); + JZControlEvent* pControl = pEvent->IsControl(); return (pControl && pControl->GetControl() == ctrl_num); } @@ -486,7 +486,7 @@ JZEvent * tCtrlEdit::NewEvent(long clock, int val) { - return new tControl(clock, track->Channel - 1, ctrl_num, val); + return new JZControlEvent(clock, track->Channel - 1, ctrl_num, val); } // ------------------------------------------------------------------ @@ -567,10 +567,10 @@ mpPianoWindow->GetFilter()->IsSelected(pEvent)) { - tKeyOn* pKeyOn = pEvent->IsKeyOn(); + JZKeyOnEvent* pKeyOn = pEvent->IsKeyOn(); if (pKeyOn) { - tKeyOn* pKeyOnCopy = pKeyOn->Copy()->IsKeyOn(); + JZKeyOnEvent* pKeyOnCopy = pKeyOn->Copy()->IsKeyOn(); int i = Clock2i(pKeyOnCopy->GetClock()); pKeyOnCopy->SetVelocity(array[i]); @@ -634,7 +634,7 @@ int tPolyAfterEdit::GetValue(JZEvent* pEvent) { - tKeyPressure* pKeyPressure = pEvent->IsKeyPressure(); + JZKeyPressureEvent* pKeyPressure = pEvent->IsKeyPressure(); if (pKeyPressure) { return pKeyPressure->GetPressureValue(); @@ -670,7 +670,7 @@ from_clk = from_clock; to_clk = to_clock; } - tKeyOn* pKeyOn; + JZKeyOnEvent* pKeyOn; if (!ctrlmode) { @@ -684,7 +684,7 @@ !mpPianoWindow->mpSnapSel->IsSelected() || mpPianoWindow->GetFilter()->IsSelected(pEvent)) { - tKeyPressure* pKeyPressure = pEvent->IsKeyPressure(); + JZKeyPressureEvent* pKeyPressure = pEvent->IsKeyPressure(); if (pKeyPressure) { track->Kill(pKeyPressure); @@ -696,7 +696,7 @@ long key_end(-1), key_clk(-1); int key_val = -1; int key_cha(-1); - tKeyPressure* pKeyPressure; + JZKeyPressureEvent* pKeyPressure; pEvent = iter.Range(from_clk, to_clk); while (pEvent) { @@ -723,7 +723,11 @@ // und der Wert groesser als 0 ist. if (array[i] > 0 && array[i] != temp) { - pKeyPressure = new tKeyPressure(iclk, key_cha, key_val, array[i]); + pKeyPressure = new JZKeyPressureEvent( + iclk, + key_cha, + key_val, + array[i]); track->Put(pKeyPressure); temp = array[i]; } @@ -741,7 +745,7 @@ // bestehender Events. // SN++ pEvent = iter.Range(from_clk, to_clk); - tKeyPressure* pKeyPressureCopy; + JZKeyPressureEvent* pKeyPressureCopy; while (pEvent) { if ( @@ -805,7 +809,7 @@ JZEvent *tChannelAfterEdit::NewEvent(long clock, int val) { - return new tChnPressure(clock, track->Channel - 1, val); + return new JZChnPressureEvent(clock, track->Channel - 1, val); } void tChannelAfterEdit::UpDate() @@ -871,7 +875,7 @@ // edit mode: Erzeugt keine neuen Events sondern aendert den Wert // bestehender Events. // SN++ - tChnPressure* pChnPressureCopy; + JZChnPressureEvent* pChnPressureCopy; while (pEvent) { if (IsCtrlEdit(pEvent)) @@ -929,5 +933,5 @@ JZEvent * tTempoEdit::NewEvent(long clock, int val) { - return new tSetTempo(clock, val); + return new JZSetTempoEvent(clock, val); } Modified: trunk/jazz/src/Dialogs/ControllerDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/ControllerDialog.cpp 2010-04-26 03:44:22 UTC (rev 758) +++ trunk/jazz/src/Dialogs/ControllerDialog.cpp 2010-04-26 14:35:58 UTC (rev 759) @@ -39,7 +39,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- JZControllerDialog::JZControllerDialog( - tControl* pControl, + JZControlEvent* pControl, JZTrack* pTrack, wxWindow* pParent) : wxDialog(pParent, wxID_ANY, wxString("Controller")), Modified: trunk/jazz/src/Dialogs/ControllerDialog.h =================================================================== --- trunk/jazz/src/Dialogs/ControllerDialog.h 2010-04-26 03:44:22 UTC (rev 758) +++ trunk/jazz/src/Dialogs/ControllerDialog.h 2010-04-26 14:35:58 UTC (rev 759) @@ -24,7 +24,7 @@ #include <wx/dialog.h> -class tControl; +class JZControlEvent; class JZTrack; class wxListBox; @@ -35,13 +35,13 @@ public: JZControllerDialog( - tControl* pControl, + JZControlEvent* pControl, JZTrack* pTrack, wxWindow* pParent); private: - tControl* mpControl; + JZControlEvent* mpControl; wxListBox* mpControllerListBox; Modified: trunk/jazz/src/Dialogs/EndOfTrackDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/EndOfTrackDialog.cpp 2010-04-26 03:44:22 UTC (rev 758) +++ trunk/jazz/src/Dialogs/EndOfTrackDialog.cpp 2010-04-26 14:35:58 UTC (rev 759) @@ -46,7 +46,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- JZEndOfTrackDialog::JZEndOfTrackDialog( - tEndOfTrack* pEndOfTrackEvent, + JZEndOfTrackEvent* pEndOfTrackEvent, JZTrack* pTrack, wxWindow * pParent) : wxDialog(pParent, wxID_ANY, wxString("End of Track")), Modified: trunk/jazz/src/Dialogs/EndOfTrackDialog.h =================================================================== --- trunk/jazz/src/Dialogs/EndOfTrackDialog.h 2010-04-26 03:44:22 UTC (rev 758) +++ trunk/jazz/src/Dialogs/EndOfTrackDialog.h 2010-04-26 14:35:58 UTC (rev 759) @@ -23,7 +23,7 @@ #include <wx/dialog.h> -class tEndOfTrack; +class JZEndOfTrackEvent; class JZTrack; class wxTextCtrl; @@ -34,7 +34,7 @@ public: JZEndOfTrackDialog( - tEndOfTrack* pEndOfTrackEvent, + JZEndOfTrackEvent* pEndOfTrackEvent, JZTrack* pTrack, wxWindow* pParent); @@ -48,7 +48,7 @@ private: - tEndOfTrack* mpEndOfTrackEvent; + JZEndOfTrackEvent* mpEndOfTrackEvent; wxTextCtrl* mpClockEdit; Modified: trunk/jazz/src/Dialogs/KeyOnDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/KeyOnDialog.cpp 2010-04-26 03:44:22 UTC (rev 758) +++ trunk/jazz/src/Dialogs/KeyOnDialog.cpp 2010-04-26 14:35:58 UTC (rev 759) @@ -54,7 +54,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -JZKeyOnDialog::JZKeyOnDialog(tKeyOn* pEvent, wxWindow* pParent) +JZKeyOnDialog::JZKeyOnDialog(JZKeyOnEvent* pEvent, wxWindow* pParent) : wxDialog(pParent, wxID_ANY, wxString("Key On")), mpEvent(pEvent), mpPitchEdit(0), Modified: trunk/jazz/src/Dialogs/KeyOnDialog.h =================================================================== --- trunk/jazz/src/Dialogs/KeyOnDialog.h 2010-04-26 03:44:22 UTC (rev 758) +++ trunk/jazz/src/Dialogs/KeyOnDialog.h 2010-04-26 14:35:58 UTC (rev 759) @@ -25,7 +25,7 @@ class JZKnob; class JZKnobEvent; -class tKeyOn; +class JZKeyOnEvent; class wxStaticText; class wxTextCtrl; @@ -35,7 +35,7 @@ { public: - JZKeyOnDialog(tKeyOn* pEvent, wxWindow* pParent); + JZKeyOnDialog(JZKeyOnEvent* pEvent, wxWindow* pParent); private: @@ -53,7 +53,7 @@ private: - tKeyOn* mpEvent; + JZKeyOnEvent* mpEvent; wxTextCtrl* mpPitchEdit; wxStaticText* mpVelocityValue; Modified: trunk/jazz/src/Dialogs/ProgramChangeDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/ProgramChangeDialog.cpp 2010-04-26 03:44:22 UTC (rev 758) +++ trunk/jazz/src/Dialogs/ProgramChangeDialog.cpp 2010-04-26 14:35:58 UTC (rev 759) @@ -39,7 +39,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- JZProgramChangeDialog::JZProgramChangeDialog( - tProgram* pProgram, + JZProgramEvent* pProgram, JZTrack* pTrack, wxWindow* pParent) : wxDialog(pParent, wxID_ANY, wxString("Program Change")), Modified: trunk/jazz/src/Dialogs/ProgramChangeDialog.h =================================================================== --- trunk/jazz/src/Dialogs/ProgramChangeDialog.h 2010-04-26 03:44:22 UTC (rev 758) +++ trunk/jazz/src/Dialogs/ProgramChangeDialog.h 2010-04-26 14:35:58 UTC (rev 759) @@ -23,7 +23,7 @@ #include <wx/dialog.h> -class tProgram; +class JZProgramEvent; class JZTrack; class wxListBox; @@ -34,13 +34,13 @@ public: JZProgramChangeDialog( - tProgram* pProgram, + JZProgramEvent* pProgram, JZTrack* pTrack, wxWindow* pParent); private: - tProgram* mpProgram; + JZProgramEvent* mpProgram; wxListBox* mpProgramListBox; Modified: trunk/jazz/src/Dialogs/SetTempoDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/SetTempoDialog.cpp 2010-04-26 03:44:22 UTC (rev 758) +++ trunk/jazz/src/Dialogs/SetTempoDialog.cpp 2010-04-26 14:35:58 UTC (rev 759) @@ -48,7 +48,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- JZSetTempoDialog::JZSetTempoDialog( - tSetTempo* pSetTempoEvent, + JZSetTempoEvent* pSetTempoEvent, JZTrack* pTrack, wxWindow * pParent) : wxDialog(pParent, wxID_ANY, wxString("Set Tempo (for track 0)")), Modified: trunk/jazz/src/Dialogs/SetTempoDialog.h =================================================================== --- trunk/jazz/src/Dialogs/SetTempoDialog.h 2010-04-26 03:44:22 UTC (rev 758) +++ trunk/jazz/src/Dialogs/SetTempoDialog.h 2010-04-26 14:35:58 UTC (rev 759) @@ -24,8 +24,8 @@ #include <wx/dialog.h> class JZIntegerEdit; +class JZSetTempoEvent; class JZTrack; -class tSetTempo; class wxTextCtrl; //***************************************************************************** @@ -35,7 +35,7 @@ public: JZSetTempoDialog( - tSetTempo* pSetTempoEvent, + JZSetTempoEvent* pSetTempoEvent, JZTrack* pTrack, wxWindow* pParent); @@ -49,7 +49,7 @@ private: - tSetTempo* mpSetTempoEvent; + JZSetTempoEvent* mpSetTempoEvent; JZIntegerEdit* mpTempoEdit; Modified: trunk/jazz/src/Dialogs/SysexDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/SysexDialog.cpp 2010-04-26 03:44:22 UTC (rev 758) +++ trunk/jazz/src/Dialogs/SysexDialog.cpp 2010-04-26 14:35:58 UTC (rev 759) @@ -48,11 +48,11 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- JZSysexDialog::JZSysexDialog( - tSysEx* pEvent, + JZSysExEvent* pSysExEvent, JZTrack* pTrack, wxWindow* pParent) : wxDialog(pParent, wxID_ANY, wxString("System Exclusive")), - mpSysExEvent(pEvent), + mpSysExEvent(pSysExEvent), mpSysExEdit(0), mpClockEdit(0) { Modified: trunk/jazz/src/Dialogs/SysexDialog.h =================================================================== --- trunk/jazz/src/Dialogs/SysexDialog.h 2010-04-26 03:44:22 UTC (rev 758) +++ trunk/jazz/src/Dialogs/SysexDialog.h 2010-04-26 14:35:58 UTC (rev 759) @@ -25,7 +25,7 @@ class JZKnob; class JZKnobEvent; -class tSysEx; +class JZSysExEvent; class JZTrack; class wxStaticText; class wxTextCtrl; @@ -36,7 +36,10 @@ { public: - JZSysexDialog(tSysEx* pEvent, JZTrack* pTrack, wxWindow* pParent); + JZSysexDialog( + JZSysExEvent* pSysExEvent, + JZTrack* pTrack, + wxWindow* pParent); private: @@ -48,7 +51,7 @@ private: - tSysEx* mpSysExEvent; + JZSysExEvent* mpSysExEvent; wxTextCtrl* mpSysExEdit; wxTextCtrl* mpClockEdit; Modified: trunk/jazz/src/Dialogs/TextDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/TextDialog.cpp 2010-04-26 03:44:22 UTC (rev 758) +++ trunk/jazz/src/Dialogs/TextDialog.cpp 2010-04-26 14:35:58 UTC (rev 759) @@ -47,7 +47,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- JZTextDialog::JZTextDialog( - tText* pTextEvent, + JZTextEvent* pTextEvent, JZTrack* pTrack, wxWindow * pParent) : wxDialog(pParent, wxID_ANY, wxString("Text")), Modified: trunk/jazz/src/Dialogs/TextDialog.h =================================================================== --- trunk/jazz/src/Dialogs/TextDialog.h 2010-04-26 03:44:22 UTC (rev 758) +++ trunk/jazz/src/Dialogs/TextDialog.h 2010-04-26 14:35:58 UTC (rev 759) @@ -24,7 +24,7 @@ #include <wx/dialog.h> class JZTrack; -class tText; +class JZTextEvent; class wxTextCtrl; //***************************************************************************** @@ -33,7 +33,7 @@ { public: - JZTextDialog(tText* pTextEvent, JZTrack* pTrack, wxWindow* pParent); + JZTextDialog(JZTextEvent* pTextEvent, JZTrack* pTrack, wxWindow* pParent); private: @@ -45,7 +45,7 @@ private: - tText* mpTextEvent; + JZTextEvent* mpTextEvent; wxTextCtrl* mpTextEdit; wxTextCtrl* mpClockEdit; Modified: trunk/jazz/src/Dialogs.cpp =================================================================== --- trunk/jazz/src/Dialogs.cpp 2010-04-26 03:44:22 UTC (rev 758) +++ trunk/jazz/src/Dialogs.cpp 2010-04-26 14:35:58 UTC (rev 759) @@ -321,7 +321,7 @@ int Channel; - tChEventDlg(tChannelEvent* pChannelEvent, JZPianoWindow* w, JZTrack *pTrack) + tChEventDlg(JZChannelEvent* pChannelEvent, JZPianoWindow* w, JZTrack *pTrack) : tEventDlg(pChannelEvent, w, pTrack) { Channel = pChannelEvent->GetChannel() + 1; // 1..16 @@ -343,7 +343,7 @@ bool tChEventDlg::OnClose() { - ((tChannelEvent *)Copy)->SetChannel(Channel - 1); + ((JZChannelEvent *)Copy)->SetChannel(Channel - 1); tEventDlg::OnClose(); return false; } @@ -356,14 +356,14 @@ int Value; - tPitchDlg(tPitch* e, JZPianoWindow* w, JZTrack *pTrack); + tPitchDlg(JZPitchEvent* e, JZPianoWindow* w, JZTrack *pTrack); void AddProperties(); bool OnClose(); }; -tPitchDlg::tPitchDlg(tPitch *e, JZPianoWindow* w, JZTrack *pTrack) +tPitchDlg::tPitchDlg(JZPitchEvent *e, JZPianoWindow* w, JZTrack *pTrack) : tChEventDlg(e, w, pTrack) { Event = e; @@ -373,13 +373,12 @@ bool tPitchDlg::OnClose() { - ((tPitch *)Copy)->Value = Value; + ((JZPitchEvent *)Copy)->Value = Value; return tChEventDlg::OnClose(); } void tPitchDlg::AddProperties() { - //Add(wxMakeFormShort("Pitch:", &Value, wxFORM_DEFAULT, new wxList(wxMakeConstraintRange(-8191.0, 8191.0), 0))); sheet->AddProperty(new wxProperty( "Pitch:", wxPropertyValue(&Value), @@ -401,14 +400,14 @@ tNamedChoice Choice; - tPlayTrackDlg(tPlayTrack *e, JZPianoWindow* w, JZTrack *pTrack); + tPlayTrackDlg(JZPlayTrackEvent *e, JZPianoWindow* w, JZTrack *pTrack); void AddProperties(); bool OnClose(); }; -tPlayTrackDlg::tPlayTrackDlg(tPlayTrack *e, JZPianoWindow* w, JZTrack *pTrack) +tPlayTrackDlg::tPlayTrackDlg(JZPlayTrackEvent *e, JZPianoWindow* w, JZTrack *pTrack) : tEventDlg(e, w, pTrack), Choice("playtrack", gpConfig->GetControlNames(), &track) { @@ -421,7 +420,7 @@ bool tPlayTrackDlg::OnClose() { - tPlayTrack* p=(tPlayTrack*)Copy; + JZPlayTrackEvent* p=(JZPlayTrackEvent*)Copy; Choice.GetValue(); p->track = track; @@ -481,7 +480,7 @@ -1 }; - JZEvent *e = 0; + JZEvent* pEvent = 0; int i = ::wxGetSingleChoiceIndex( "Select event to create", @@ -493,36 +492,36 @@ switch (Values[i]) { case StatKeyOn: - e = new tKeyOn(Clock, Channel, Pitch, 64, 64); + pEvent = new JZKeyOnEvent(Clock, Channel, Pitch, 64, 64); break; case StatPitch: - e = new tPitch(Clock, Channel, 0); - e->SetPitch(Pitch); + pEvent = new JZPitchEvent(Clock, Channel, 0); + pEvent->SetPitch(Pitch); break; case StatControl: - e = new tControl(Clock, Channel, Pitch, 64); + pEvent = new JZControlEvent(Clock, Channel, Pitch, 64); break; case StatProgram: - e = new tProgram(Clock, Channel, Pitch); + pEvent = new JZProgramEvent(Clock, Channel, Pitch); break; case StatSetTempo: - e = new tSetTempo(Clock, 100); + pEvent = new JZSetTempoEvent(Clock, 100); break; case StatSysEx: - e = new tSysEx(Clock, (unsigned char*) "", 0); + pEvent = new JZSysExEvent(Clock, (unsigned char*) "", 0); break; case StatPlayTrack: - e = new tPlayTrack(Clock, 0, Pitch); + pEvent = new JZPlayTrackEvent(Clock, 0, Pitch); break; case StatEndOfTrack: - e = new tEndOfTrack(Clock); + pEvent = new JZEndOfTrackEvent(Clock); break; case StatText: - e = new tText(Clock, (unsigned char*)""); + pEvent = new JZTextEvent(Clock, (unsigned char*)""); break; } } - return e; + return pEvent; } //***************************************************************************** Modified: trunk/jazz/src/Events.cpp =================================================================== --- trunk/jazz/src/Events.cpp 2010-04-26 03:44:22 UTC (rev 758) +++ trunk/jazz/src/Events.cpp 2010-04-26 14:35:58 UTC (rev 759) @@ -150,11 +150,10 @@ } //***************************************************************************** -// tGetMidiBytes //***************************************************************************** //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -int tGetMidiBytes::Write(JZEvent* pEvent, unsigned char* pData, int Length) +int JZGetMidiBytes::Write(JZEvent* pEvent, unsigned char* pData, int Length) { int Stat = pEvent->GetStat(); @@ -170,7 +169,7 @@ case StatPitch: nBytes = 0; - Buffer[nBytes++] = Stat | ((tChannelEvent *)pEvent)->GetChannel(); + Buffer[nBytes++] = Stat | ((JZChannelEvent *)pEvent)->GetChannel(); while (Length--) { Buffer[nBytes++] = *pData++; @@ -190,7 +189,7 @@ // Description: // This function fixed the checksum bytes at the end of the data stream. //----------------------------------------------------------------------------- -void tMetaEvent::FixCheckSum() +void JZMetaEvent::FixCheckSum() { unsigned char Sum = 0x00; for (unsigned short i = 4; i < (mLength - 2); ++i) @@ -207,7 +206,7 @@ //***************************************************************************** //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -int tSysEx::GetPitch() const +int JZSysExEvent::GetPitch() const { edb(); Modified: trunk/jazz/src/Events.h =================================================================== --- trunk/jazz/src/Events.h 2010-04-26 03:44:22 UTC (rev 758) +++ trunk/jazz/src/Events.h 2010-04-26 14:35:58 UTC (rev 759) @@ -208,9 +208,8 @@ } //***************************************************************************** -// tGetMidiBytes //***************************************************************************** -class tGetMidiBytes : public JZWriteBase +class JZGetMidiBytes : public JZWriteBase { public: @@ -288,32 +287,32 @@ // Event-Classes class JZEvent; -class tChannelEvent; -class tMetaEvent; -class tKeyOn; -class tKeyOff; -class tPitch; -class tControl; -class tProgram; -class tSysEx; -class tSongPtr; -class tMidiClock; -class tStartPlay; -class tContPlay; -class tStopPlay; -class tText; -class tCopyright; -class tTrackName; -class tMarker; -class tSetTempo; -class tMtcOffset; -class tTimeSignat; -class tKeySignat; -class tKeyPressure; -class tJazzMeta; -class tChnPressure; -class tPlayTrack; -class tEndOfTrack; +class JZChannelEvent; +class JZMetaEvent; +class JZKeyOnEvent; +class JZKeyOffEvent; +class JZPitchEvent; +class JZControlEvent; +class JZProgramEvent; +class JZSysExEvent; +class JZSongPtrEvent; +class JZMidiClockEvent; +class JZStartPlayEvent; +class JZContPlayEvent; +class JZStopPlayEvent; +class JZTextEvent; +class JZCopyrightEvent; +class JZTrackNameEvent; +class JZMarkerEvent; +class JZSetTempoEvent; +class JZMtcOffsetEvent; +class JZTimeSignatEvent; +class JZKeySignatEvent; +class JZKeyPressureEvent; +class JZJazzMetaEvent; +class JZChnPressureEvent; +class JZPlayTrackEvent; +class JZEndOfTrackEvent; //***************************************************************************** // Description: @@ -398,32 +397,32 @@ return (mClock & KILLED_CLOCK) != 0; } - virtual tMetaEvent* IsMetaEvent() { edb(); return 0; } - virtual tChannelEvent* IsChannelEvent() { edb(); return 0; } - virtual tKeyOn* IsKeyOn() { edb(); return 0; } - virtual tKeyOff* IsKeyOff() { edb(); return 0; } - virtual tPitch* IsPitch() { edb(); return 0; } - virtual tControl* IsControl() { edb(); return 0; } - virtual tProgram* IsProgram() { edb(); return 0; } - virtual tSysEx* IsSysEx() { edb(); return 0; } - virtual tSongPtr* IsSongPtr() { edb(); return 0; } - virtual tMidiClock* IsMidiClock() { edb(); return 0; } - virtual tStartPlay* IsStartPlay() { edb(); return 0; } - virtual tContPlay* IsContPlay() { edb(); return 0; } - virtual tStopPlay* IsStopPlay() { edb(); return 0; } - virtual tText* IsText() { edb(); return 0; } - virtual tCopyright* IsCopyright() { edb(); return 0; } - virtual tTrackName* IsTrackName() { edb(); return 0; } - virtual tMarker* IsMarker() { edb(); return 0; } - virtual tSetTempo* IsSetTempo() { edb(); return 0; } - virtual tMtcOffset* IsMtcOffset() { edb(); return 0; } - virtual tTimeSignat* IsTimeSignat() { edb(); return 0; } - virtual tKeySignat* IsKeySignat() { edb(); return 0; } - virtual tKeyPressure* IsKeyPressure() { edb(); return 0; } - virtual tJazzMeta* IsJazzMeta() { edb(); return 0; } - virtual tPlayTrack* IsPlayTrack() { edb(); return 0; } - virtual tEndOfTrack* IsEndOfTrack() { edb(); return 0; } - virtual tChnPressure* IsChnPressure() { edb(); return 0; } + virtual JZMetaEvent* IsMetaEvent() { edb(); return 0; } + virtual JZChannelEvent* IsChannelEvent() { edb(); return 0; } + virtual JZKeyOnEvent* IsKeyOn() { edb(); return 0; } + virtual JZKeyOffEvent* IsKeyOff() { edb(); return 0; } + virtual JZPitchEvent* IsPitch() { edb(); return 0; } + virtual JZControlEvent* IsControl() { edb(); return 0; } + virtual JZProgramEvent* IsProgram() { edb(); return 0; } + virtual JZSysExEvent* IsSysEx() { edb(); return 0; } + virtual JZSongPtrEvent* IsSongPtr() { edb(); return 0; } + virtual JZMidiClockEvent* IsMidiClock() { edb(); return 0; } + virtual JZStartPlayEvent* IsStartPlay() { edb(); return 0; } + virtual JZContPlayEvent* IsContPlay() { edb(); return 0; } + virtual JZStopPlayEvent* IsStopPlay() { edb(); return 0; } + virtual JZTextEvent* IsText() { edb(); return 0; } + virtual JZCopyrightEvent* IsCopyright() { edb(); return 0; } + virtual JZTrackNameEvent* IsTrackName() { edb(); return 0; } + virtual JZMarkerEvent* IsMarker() { edb(); return 0; } + virtual JZSetTempoEvent* IsSetTempo() { edb(); return 0; } + virtual JZMtcOffsetEvent* IsMtcOffset() { edb(); return 0; } + virtual JZTimeSignatEvent* IsTimeSignat() { edb(); return 0; } + virtual JZKeySignatEvent* IsKeySignat() { edb(); return 0; } + virtual JZKeyPressureEvent* IsKeyPressure() { edb(); return 0; } + virtual JZJazzMetaEvent* IsJazzMeta() { edb(); return 0; } + virtual JZPlayTrackEvent* IsPlayTrack() { edb(); return 0; } + virtual JZEndOfTrackEvent* IsEndOfTrack() { edb(); return 0; } + virtual JZChnPressureEvent* IsChnPressure() { edb(); return 0; } virtual int Write(JZWriteBase& io) { @@ -523,17 +522,17 @@ //***************************************************************************** //***************************************************************************** -class tChannelEvent : public JZEvent +class JZChannelEvent : public JZEvent { public: - tChannelEvent(int Clock, unsigned char sta, int Channel) + JZChannelEvent(int Clock, unsigned char sta, int Channel) : JZEvent(Clock, sta) { mChannel = Channel; } - virtual tChannelEvent* IsChannelEvent() + virtual JZChannelEvent* IsChannelEvent() { edb(); return this; @@ -542,7 +541,7 @@ virtual JZEvent* Copy() const { edb(); - return new tChannelEvent(*this); + return new JZChannelEvent(*this); } unsigned char GetChannel() const @@ -562,17 +561,17 @@ //***************************************************************************** //***************************************************************************** -class tKeyOn : public tChannelEvent +class JZKeyOnEvent : public JZChannelEvent { public: - tKeyOn( + JZKeyOnEvent( int Clock, int Channel, unsigned char Key, unsigned char Velocity, unsigned short Length = 0) - : tChannelEvent(Clock, StatKeyOn, Channel), + : JZChannelEvent(Clock, StatKeyOn, Channel), mKey(Key), mVelocity(Velocity), mLength(Length), @@ -586,7 +585,7 @@ return io.Write(this, mKey, mVelocity); } - virtual tKeyOn* IsKeyOn() + virtual JZKeyOnEvent* IsKeyOn() { edb(); return this; @@ -595,7 +594,7 @@ virtual JZEvent* Copy() const { edb(); - return new tKeyOn(*this); + return new JZKeyOnEvent(*this); } virtual int GetValue() const @@ -679,7 +678,7 @@ unsigned char mVelocity; - // Length is 0 if a corresponding tKeyOff exists. + // Length is 0 if a corresponding JZKeyOffEvent exists. unsigned short mLength; unsigned short mOffVelocity; @@ -687,15 +686,15 @@ //***************************************************************************** //***************************************************************************** -class tKeyOff : public tChannelEvent +class JZKeyOffEvent : public JZChannelEvent { public: - tKeyOff( + JZKeyOffEvent( int Clock, int Channel, unsigned char Key, unsigned char OffVelocity = 0) - : tChannelEvent(Clock, StatKeyOff, Channel), + : JZChannelEvent(Clock, StatKeyOff, Channel), mKey(Key), mOffVelocity(OffVelocity) { @@ -707,7 +706,7 @@ return io.Write(this, mKey, mOffVelocity); } - virtual tKeyOff* IsKeyOff() + virtual JZKeyOffEvent* IsKeyOff() { edb(); return this; @@ -716,7 +715,7 @@ virtual JZEvent* Copy() const { edb(); - return new tKeyOff(*this); + return new JZKeyOffEvent(*this); } unsigned char GetKey() const @@ -743,23 +742,23 @@ //***************************************************************************** //***************************************************************************** -class tPitch : public tChannelEvent +class JZPitchEvent : public JZChannelEvent { public: short Value; - tPitch( + JZPitchEvent( int Clock, unsigned short Channel, unsigned char lo, unsigned char hi) - : tChannelEvent(Clock, StatPitch, Channel) + : JZChannelEvent(Clock, StatPitch, Channel) { Value = ((hi << 7) | lo) - 8192; } - tPitch(int Clock, unsigned short Channel, short val) - : tChannelEvent(Clock, StatPitch, Channel) + JZPitchEvent(int Clock, unsigned short Channel, short val) + : JZChannelEvent(Clock, StatPitch, Channel) { Value = val; } @@ -770,7 +769,7 @@ edb(); return io.Write(this, (unsigned char)(v & 0x7F), (unsigned char)(v >> 7)); } - virtual tPitch* IsPitch() + virtual JZPitchEvent* IsPitch() { edb(); return this; @@ -779,7 +778,7 @@ virtual JZEvent* Copy() const { edb(); - return new tPitch(*this); + return new JZPitchEvent(*this); } virtual int GetValue() const @@ -813,16 +812,16 @@ //***************************************************************************** //***************************************************************************** -class tControl : public tChannelEvent +class JZControlEvent : public JZChannelEvent { public: - tControl( + JZControlEvent( int Clock, int Channel, unsigned char Control, unsigned char Value) - : tChannelEvent(Clock, StatControl, Channel), + : JZChannelEvent(Clock, StatControl, Channel), mControl(Control), mValue(Value) { @@ -834,7 +833,7 @@ return io.Write(this, mControl, mValue); } - virtual tControl* IsControl() + virtual JZControlEvent* IsControl() { edb(); return this; @@ -843,7 +842,7 @@ virtual JZEvent* Copy() const { edb(); - return new tControl(*this); + return new JZControlEvent(*this); } virtual int GetValue() const @@ -902,12 +901,12 @@ //***************************************************************************** //***************************************************************************** -class tProgram : public tChannelEvent +class JZProgramEvent : public JZChannelEvent { public: - tProgram(int Clock, int Channel, unsigned char Program) - : tChannelEvent(Clock, StatProgram, Channel) + JZProgramEvent(int Clock, int Channel, unsigned char Program) + : JZChannelEvent(Clock, StatProgram, Channel) { mProgram = Program; } @@ -917,7 +916,7 @@ edb(); return io.Write(this, mProgram); } - virtual tProgram* IsProgram() + virtual JZProgramEvent* IsProgram() { edb(); return this; @@ -926,7 +925,7 @@ virtual JZEvent* Copy() const { edb(); - return new tProgram(*this); + return new JZProgramEvent(*this); } virtual int GetValue() const @@ -974,11 +973,11 @@ //***************************************************************************** //***************************************************************************** -class tMetaEvent : public JZEvent +class JZMetaEvent : public JZEvent { public: - tMetaEvent( + JZMetaEvent( int Clock, unsigned char sta, unsigned char* pData, @@ -995,7 +994,7 @@ mpData[Length] = 0; } - virtual ~tMetaEvent() + virtual ~JZMetaEvent() { delete [] mpData; } @@ -1006,7 +1005,7 @@ return io.Write(this, mpData, mLength); } - virtual tMetaEvent* IsMetaEvent() + virtual JZMetaEvent* IsMetaEvent() { edb(); return this; @@ -1015,7 +1014,7 @@ virtual JZEvent* Copy() const { edb(); - return new tMetaEvent(mClock, mStat, mpData, mLength); + return new JZMetaEvent(mClock, mStat, mpData, mLength); } const unsigned char* GetData() const @@ -1042,7 +1041,7 @@ // should should not go into a track itself but is read/written from/to // the file. //***************************************************************************** -class tJazzMeta : public tMetaEvent +class JZJazzMetaEvent : public JZMetaEvent { public: @@ -1051,13 +1050,13 @@ DATALEN = 20 }; - tJazzMeta(int Clock, unsigned char* pData, unsigned short Length) - : tMetaEvent(Clock, StatJazzMeta, pData, Length) + JZJazzMetaEvent(int Clock, unsigned char* pData, unsigned short Length) + : JZMetaEvent(Clock, StatJazzMeta, pData, Length) { } - tJazzMeta() - : tMetaEvent(0, StatJazzMeta, 0, DATALEN) + JZJazzMetaEvent() + : JZMetaEvent(0, StatJazzMeta, 0, DATALEN) { memset(mpData, 0, DATALEN); memcpy(mpData, "JAZ2", 4); @@ -1106,7 +1105,7 @@ mpData[9] = x; } - virtual tJazzMeta* IsJazzMeta() + virtual JZJazzMetaEvent* IsJazzMeta() { edb(); return this; @@ -1115,22 +1114,22 @@ virtual JZEvent* Copy() const { edb(); - return new tJazzMeta(mClock, mpData, mLength); + return new JZJazzMetaEvent(mClock, mpData, mLength); } }; //***************************************************************************** //***************************************************************************** -class tSysEx : public tMetaEvent +class JZSysExEvent : public JZMetaEvent { public: - tSysEx(int Clock, unsigned char* pData, unsigned short Length) - : tMetaEvent(Clock, StatSysEx, pData, Length) + JZSysExEvent(int Clock, unsigned char* pData, unsigned short Length) + : JZMetaEvent(Clock, StatSysEx, pData, Length) { } - virtual tSysEx* IsSysEx() + virtual JZSysExEvent* IsSysEx() { edb(); return this; @@ -1139,7 +1138,7 @@ virtual JZEvent* Copy() const { edb(); - return new tSysEx(mClock, mpData, mLength); + return new JZSysExEvent(mClock, mpData, mLength); } // todo @@ -1148,16 +1147,16 @@ //***************************************************************************** //***************************************************************************** -class tSongPtr : public tMetaEvent +class JZSongPtrEvent : public JZMetaEvent { public: - tSongPtr(int Clock, unsigned char* pData, unsigned short Length) - : tMetaEvent(Clock, StatSongPtr, pData, Length) + JZSongPtrEvent(int Clock, unsigned char* pData, unsigned short Length) + : JZMetaEvent(Clock, StatSongPtr, pData, Length) { } - virtual tSongPtr* IsSongPtr() + virtual JZSongPtrEvent* IsSongPtr() { edb(); return this; @@ -1166,26 +1165,26 @@ virtual JZEvent* Copy() const { edb(); - return new tSongPtr(mClock, mpData, mLength); + return new JZSongPtrEvent(mClock, mpData, mLength); } }; //***************************************************************************** //***************************************************************************** -class tMidiClock : public tMetaEvent +class JZMidiClockEvent : public JZMetaEvent { public: - tMidiClock(int Clock, unsigned char* pData, unsigned short Length) - : tMetaEvent(Clock, StatMidiClock, pData, Length) + JZMidiClockEvent(int Clock, unsigned char* pData, unsigned short Length) + : JZMetaEvent(Clock, StatMidiClock, pData, Length) { } - tMidiClock(int Clock) - : tMetaEvent(Clock, StatMidiClock, 0, 0) + JZMidiClockEvent(int Clock) + : JZMetaEvent(Clock, StatMidiClock, 0, 0) { } - virtual tMidiClock *IsMidiClock() + virtual JZMidiClockEvent *IsMidiClock() { edb(); return this; @@ -1194,27 +1193,27 @@ virtual JZEvent* Copy() const { edb(); - return new tMidiClock(mClock, mpData, mLength); + return new JZMidiClockEvent(mClock, mpData, mLength); } }; //***************************************************************************** //***************************************************************************** -class tStartPlay : public tMetaEvent +class JZStartPlayEvent : public JZMetaEvent { public: - tStartPlay(int Clock, unsigned char* pData, unsigned short Length) - : tMetaEvent(Clock, StatStartPlay, pData, Length) + JZStartPlayEvent(int Clock, unsigned char* pData, unsigned short Length) + : JZMetaEvent(Clock, StatStartPlay, pData, Length) { } - tStartPlay(int Clock) - : tMetaEvent(Clock, StatStartPlay, 0, 0) + JZStartPlayEvent(int Clock) + : JZMetaEvent(Clock, StatStartPlay, 0, 0) { } - virtual tStartPlay* IsStartPlay() + virtual JZStartPlayEvent* IsStartPlay() { edb(); return this; @@ -1223,27 +1222,27 @@ virtual JZEvent* Copy() const { edb(); - return new tStartPlay(mClock, mpData, mLength); + return new JZStartPlayEvent(mClock, mpData, mLength); } }; //***************************************************************************** //***************************************************************************** -class tContPlay : public tMetaEvent +class JZContPlayEvent : public JZMetaEvent { public: - tContPlay(int Clock, unsigned char* pData, unsigned short Length) - : tMetaEvent(Clock, StatContPlay, pData, Length) + JZContPlayEvent(int Clock, unsigned char* pData, unsigned short Length) + : JZMetaEvent(Clock, StatContPlay, pData, Length) { } - tContPlay(int Clock) - : tMetaEvent(Clock, StatContPlay, 0, 0) + JZContPlayEvent(int Clock) + : JZMetaEvent(Clock, StatContPlay, 0, 0) { } - virtual tContPlay* IsContPlay() + virtual JZContPlayEvent* IsContPlay() { edb(); return this; @@ -1252,27 +1251,27 @@ virtual JZEvent* Copy() const { edb(); - return new tContPlay(mClock, mpData, mLength); + return new JZContPlayEvent(mClock, mpData, mLength); } }; //***************************************************************************** //***************************************************************************** -class tStopPlay : public tMetaEvent +class JZStopPlayEvent : public JZMetaEvent { public: - tStopPlay(int Clock, unsigned char* pData, unsigned short Length) - : tMetaEvent(Clock, StatStopPlay, pData, Length) + JZStopPlayEvent(int Clock, unsigned char* pData, unsigned short Length) + : JZMetaEvent(Clock, StatStopPlay, pData, Length) { } - tStopPlay(int Clock) - : tMetaEvent(Clock, StatStopPlay, 0, 0) + JZStopPlayEvent(int Clock) + : JZMetaEvent(Clock, StatStopPlay, 0, 0) { } - virtual tStopPlay* IsStopPlay() + virtual JZStopPlayEvent* IsStopPlay() { edb(); return this; @@ -1281,27 +1280,27 @@ virtual JZEvent* Copy() const { edb(); - return new tStopPlay(mClock, mpData, mLength); + return new JZStopPlayEvent(mClock, mpData, mLength); } }; //***************************************************************************** //***************************************************************************** -class tText : public tMetaEvent +class JZTextEvent : public JZMetaEvent { public: - tText(int Clock, unsigned char* pData, unsigned short Length) - : tMetaEvent(Clock, StatText, pData, Length) + JZTextEvent(int Clock, unsigned char* pData, unsigned short Length) + : JZMetaEvent(Clock, StatText, pData, Length) { } - tText(int Clock, unsigned char* pData) - : tMetaEvent(Clock, StatText, pData, strlen((const char*)pData)) + JZTextEvent(int Clock, unsigned char* pData) + : JZMetaEvent(Clock, StatText, pData, strlen((const char*)pData)) { } - virtual tText* IsText() + virtual JZTextEvent* IsText() { edb(); return this; @@ -1310,7 +1309,7 @@ virtual JZEvent* Copy() const { edb(); - return new tText(mClock, mpData, mLength); + return new JZTextEvent(mClock, mpData, mLength); } virtual unsigned char* GetText() @@ -1331,16 +1330,16 @@ //***************************************************************************** //***************************************************************************** -class tCopyright : public tMetaEvent +class JZCopyrightEvent : public JZMetaEvent { public: - tCopyright(int Clock, unsigned char* pData, unsigned short Length) - : tMetaEvent(Clock, StatCopyright, pData, Length) + JZCopyrightEvent(int Clock, unsigned char* pData, unsigned short Length) + : JZMetaEvent(Clock, StatCopyright, pData, Length) { } - virtual tCopyright* IsCopyright() + virtual JZCopyrightEvent* IsCopyright() { edb(); return this; @@ -1349,18 +1348,18 @@ virtual JZEvent* Copy() const { edb(); - return new tCopyright(mClock, mpD... [truncated message content] |
From: <pst...@us...> - 2010-04-26 17:06:39
|
Revision: 760 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=760&view=rev Author: pstieber Date: 2010-04-26 17:06:32 +0000 (Mon, 26 Apr 2010) Log Message: ----------- 1. Removed old MIDI event debugging code. 2. Updated some comments. Modified Paths: -------------- trunk/jazz/src/Events.cpp trunk/jazz/src/Events.h trunk/jazz/src/Track.cpp Modified: trunk/jazz/src/Events.cpp =================================================================== --- trunk/jazz/src/Events.cpp 2010-04-26 14:35:58 UTC (rev 759) +++ trunk/jazz/src/Events.cpp 2010-04-26 17:06:32 UTC (rev 760) @@ -3,7 +3,7 @@ // // Copyright (C) 1994-2000 Andreas Voss and Per Sigmond, all rights reserved. // Modifications Copyright (C) 2004 Patrick Earl -// Modifications Copyright (C) 2008 Peter J. Stieber +// Modifications Copyright (C) 2008-2010 Peter J. Stieber // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -208,8 +208,6 @@ //----------------------------------------------------------------------------- int JZSysExEvent::GetPitch() const { - edb(); - int Id = gpSynth->GetSysexId(this); if (Id >= SX_GM_ON && Id < SX_GS_ON) Modified: trunk/jazz/src/Events.h =================================================================== --- trunk/jazz/src/Events.h 2010-04-26 14:35:58 UTC (rev 759) +++ trunk/jazz/src/Events.h 2010-04-26 17:06:32 UTC (rev 760) @@ -3,7 +3,7 @@ // // Copyright (C) 1994-2000 Andreas Voss and Per Sigmond, all rights reserved. // Modifications Copyright (C) 2004 Patrick Earl -// Modifications Copyright (C) 2008 Peter J. Stieber +// Modifications Copyright (C) 2008-2010 Peter J. Stieber // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -237,22 +237,16 @@ // Midi-Events // ******************************************************************** -/* - * Normal events (with the channel) - */ - +// Normal events (with the channel) #define StatKeyOff 0x80 #define StatKeyOn 0x90 -#define StatKeyPressure 0xA0 // Key pressure +#define StatKeyPressure 0xA0 #define StatControl 0xB0 #define StatProgram 0xC0 -#define StatChnPressure 0xD0 // SN++ Channel pressure +#define StatChnPressure 0xD0 // Channel pressure #define StatPitch 0xE0 -/* - * Meta events (no channel) - */ - +// Meta events (no channel). #define StatSysEx 0xF0 #define StatSongPtr 0xF2 #define StatSongSelect 0xF3 @@ -284,8 +278,7 @@ -// Event-Classes - +// Event classes class JZEvent; class JZChannelEvent; class JZMetaEvent; @@ -322,23 +315,6 @@ { public: -#ifdef E_DBUG - int Magic; - void edb() const - { - if (Magic != MAGIC) - { - fprintf(stderr, "Magic failed\n"); - fflush(stderr); - *(char *)0 = 0; - } - } -#else - void edb() const - { - } -#endif - unsigned char GetStat() const { return mStat; @@ -366,73 +342,61 @@ mClock(Clock), mDevice(BROADCAST_DEVICE) { -#ifdef E_DBUG - Magic = MAGIC; -#endif } virtual ~JZEvent() { - edb(); -#ifdef E_DBUG - Magic = 0L; -#endif } void Kill() { - edb(); mClock |= KILLED_CLOCK; } void UnKill() { - edb(); mClock &= ~KILLED_CLOCK; } int IsKilled() { - edb(); return (mClock & KILLED_CLOCK) != 0; } - virtual JZMetaEvent* IsMetaEvent() { edb(); return 0; } - virtual JZChannelEvent* IsChannelEvent() { edb(); return 0; } - virtual JZKeyOnEvent* IsKeyOn() { edb(); return 0; } - virtual JZKeyOffEvent* IsKeyOff() { edb(); return 0; } - virtual JZPitchEvent* IsPitch() { edb(); return 0; } - virtual JZControlEvent* IsControl() { edb(); return 0; } - virtual JZProgramEvent* IsProgram() { edb(); return 0; } - virtual JZSysExEvent* IsSysEx() { edb(); return 0; } - virtual JZSongPtrEvent* IsSongPtr() { edb(); return 0; } - virtual JZMidiClockEvent* IsMidiClock() { edb(); return 0; } - virtual JZStartPlayEvent* IsStartPlay() { edb(); return 0; } - virtual JZContPlayEvent* IsContPlay() { edb(); return 0; } - virtual JZStopPlayEvent* IsStopPlay() { edb(); return 0; } - virtual JZTextEvent* IsText() { edb(); return 0; } - virtual JZCopyrightEvent* IsCopyright() { edb(); return 0; } - virtual JZTrackNameEvent* IsTrackName() { edb(); return 0; } - virtual JZMarkerEvent* IsMarker() { edb(); return 0; } - virtual JZSetTempoEvent* IsSetTempo() { edb(); return 0; } - virtual JZMtcOffsetEvent* IsMtcOffset() { edb(); return 0; } - virtual JZTimeSignatEvent* IsTimeSignat() { edb(); return 0; } - virtual JZKeySignatEvent* IsKeySignat() { edb(); return 0; } - virtual JZKeyPressureEvent* IsKeyPressure() { edb(); return 0; } - virtual JZJazzMetaEvent* IsJazzMeta() { edb(); return 0; } - virtual JZPlayTrackEvent* IsPlayTrack() { edb(); return 0; } - virtual JZEndOfTrackEvent* IsEndOfTrack() { edb(); return 0; } - virtual JZChnPressureEvent* IsChnPressure() { edb(); return 0; } + virtual JZMetaEvent* IsMetaEvent() { return 0; } + virtual JZChannelEvent* IsChannelEvent() { return 0; } + virtual JZKeyOnEvent* IsKeyOn() { return 0; } + virtual JZKeyOffEvent* IsKeyOff() { return 0; } + virtual JZPitchEvent* IsPitch() { return 0; } + virtual JZControlEvent* IsControl() { return 0; } + virtual JZProgramEvent* IsProgram() { return 0; } + virtual JZSysExEvent* IsSysEx() { return 0; } + virtual JZSongPtrEvent* IsSongPtr() { return 0; } + virtual JZMidiClockEvent* IsMidiClock() { return 0; } + virtual JZStartPlayEvent* IsStartPlay() { return 0; } + virtual JZContPlayEvent* IsContPlay() { return 0; } + virtual JZStopPlayEvent* IsStopPlay() { return 0; } + virtual JZTextEvent* IsText() { return 0; } + virtual JZCopyrightEvent* IsCopyright() { return 0; } + virtual JZTrackNameEvent* IsTrackName() { return 0; } + virtual JZMarkerEvent* IsMarker() { return 0; } + virtual JZSetTempoEvent* IsSetTempo() { return 0; } + virtual JZMtcOffsetEvent* IsMtcOffset() { return 0; } + virtual JZTimeSignatEvent* IsTimeSignat() { return 0; } + virtual JZKeySignatEvent* IsKeySignat() { return 0; } + virtual JZKeyPressureEvent* IsKeyPressure() { return 0; } + virtual JZJazzMetaEvent* IsJazzMeta() { return 0; } + virtual JZPlayTrackEvent* IsPlayTrack() { return 0; } + virtual JZEndOfTrackEvent* IsEndOfTrack() { return 0; } + virtual JZChnPressureEvent* IsChnPressure() { return 0; } virtual int Write(JZWriteBase& io) { - edb(); return io.Write(this); } int Compare(JZEvent& Event) { - edb(); if ((unsigned)Event.mClock > (unsigned)mClock) { return -1; @@ -453,40 +417,34 @@ virtual JZEvent* Copy() const { - edb(); return new JZEvent(*this); } // Filter virtual int GetValue() const { - edb(); return 0; } virtual unsigned short GetEventLength() const { - edb(); return 16; } // Painting virtual int GetLength() const { - edb(); return 16; } // Value normalized to 0 to 127. virtual int GetPitch() const { - edb(); return 64; } virtual void SetPitch(int p) { - edb(); } virtual const wxPen* GetPen() const @@ -534,13 +492,11 @@ virtual JZChannelEvent* IsChannelEvent() { - edb(); return this; } virtual JZEvent* Copy() const { - edb(); return new JZChannelEvent(*this); } @@ -581,37 +537,31 @@ virtual int Write(JZWriteBase &io) { - edb(); return io.Write(this, mKey, mVelocity); } virtual JZKeyOnEvent* IsKeyOn() { - edb(); return this; } virtual JZEvent* Copy() const { - edb(); return new JZKeyOnEvent(*this); } virtual int GetValue() const { - edb(); return mKey; } virtual int GetPitch() const { - edb(); return mKey; } virtual void SetPitch(int p) { - edb(); mKey = p; } @@ -637,13 +587,11 @@ virtual unsigned short GetEventLength() const { - edb(); return mLength; } virtual int GetLength() const { - edb(); return mLength; } @@ -702,19 +650,16 @@ virtual int Write(JZWriteBase &io) { - edb(); return io.Write(this, mKey, mOffVelocity); } virtual JZKeyOffEvent* IsKeyOff() { - edb(); return this; } virtual JZEvent* Copy() const { - edb(); return new JZKeyOffEvent(*this); } @@ -766,36 +711,32 @@ virtual int Write(JZWriteBase &io) { int v = Value + 8192; - edb(); return io.Write(this, (unsigned char)(v & 0x7F), (unsigned char)(v >> 7)); + return + io.Write(this, (unsigned char)(v & 0x7F), (unsigned char)(v >> 7)); } virtual JZPitchEvent* IsPitch() { - edb(); return this; } virtual JZEvent* Copy() const { - edb(); return new JZPitchEvent(*this); } virtual int GetValue() const { - edb(); return Value; } virtual int GetPitch() const { - edb(); return (Value + 8192) >> 7; } virtual void SetPitch(int p) { - edb(); Value = (p << 7) - 8192; } @@ -829,37 +770,31 @@ virtual int Write(JZWriteBase& io) { - edb(); return io.Write(this, mControl, mValue); } virtual JZControlEvent* IsControl() { - edb(); return this; } virtual JZEvent* Copy() const { - edb(); return new JZControlEvent(*this); } virtual int GetValue() const { - edb(); return mControl; } virtual int GetPitch() const { - edb(); return mControl; } virtual void SetPitch(int Pitch) { - edb(); mControl = Pitch; } @@ -913,36 +848,31 @@ virtual int Write(JZWriteBase &io) { - edb(); return io.Write(this, mProgram); + return io.Write(this, mProgram); } virtual JZProgramEvent* IsProgram() { - edb(); return this; } virtual JZEvent* Copy() const { - edb(); return new JZProgramEvent(*this); } virtual int GetValue() const { - edb(); return mProgram; } virtual int GetPitch() const { - edb(); return mProgram; } virtual void SetPitch(int Pitch) { - edb(); mProgram = Pitch; } @@ -1001,19 +931,16 @@ virtual int Write(JZWriteBase &io) { - edb(); return io.Write(this, mpData, mLength); } virtual JZMetaEvent* IsMetaEvent() { - edb(); return this; } virtual JZEvent* Copy() const { - edb(); return new JZMetaEvent(mClock, mStat, mpData, mLength); } @@ -1107,13 +1034,11 @@ virtual JZJazzMetaEvent* IsJazzMeta() { - edb(); return this; } virtual JZEvent* Copy() const { - edb(); return new JZJazzMetaEvent(mClock, mpData, mLength); } }; @@ -1131,13 +1056,11 @@ virtual JZSysExEvent* IsSysEx() { - edb(); return this; } virtual JZEvent* Copy() const { - edb(); return new JZSysExEvent(mClock, mpData, mLength); } @@ -1158,13 +1081,11 @@ virtual JZSongPtrEvent* IsSongPtr() { - edb(); return this; } virtual JZEvent* Copy() const { - edb(); return new JZSongPtrEvent(mClock, mpData, mLength); } }; @@ -1186,13 +1107,11 @@ virtual JZMidiClockEvent *IsMidiClock() { - edb(); return this; } virtual JZEvent* Copy() const { - edb(); return new JZMidiClockEvent(mClock, mpData, mLength); } }; @@ -1215,13 +1134,11 @@ virtual JZStartPlayEvent* IsStartPlay() { - edb(); return this; } virtual JZEvent* Copy() const { - edb(); return new JZStartPlayEvent(mClock, mpData, mLength); } }; @@ -1244,13 +1161,11 @@ virtual JZContPlayEvent* IsContPlay() { - edb(); return this; } virtual JZEvent* Copy() const { - edb(); return new JZContPlayEvent(mClock, mpData, mLength); } }; @@ -1273,13 +1188,11 @@ virtual JZStopPlayEvent* IsStopPlay() { - edb(); return this; } virtual JZEvent* Copy() const { - edb(); return new JZStopPlayEvent(mClock, mpData, mLength); } }; @@ -1302,13 +1215,11 @@ virtual JZTextEvent* IsText() { - edb(); return this; } virtual JZEvent* Copy() const { - edb(); return new JZTextEvent(mClock, mpData, mLength); } @@ -1341,13 +1252,11 @@ virtual JZCopyrightEvent* IsCopyright() { - edb(); return this; } virtual JZEvent* Copy() const { - edb(); return new JZCopyrightEvent(mClock, mpData, mLength); } }; @@ -1377,13 +1286,11 @@ virtual JZTrackNameEvent* IsTrackName() { - edb(); return this; } virtual JZEvent* Copy() const { - edb(); return new JZTrackNameEvent(mClock, mpData, mLength); } }; @@ -1401,13 +1308,11 @@ virtual JZMarkerEvent* IsMarker() { - edb(); return this; } virtual JZEvent* Copy() const { - edb(); return new JZMarkerEvent(mClock, mpData, mLength); } }; @@ -1461,7 +1366,6 @@ virtual int GetLength() const { - edb(); return eventlength; } @@ -1473,7 +1377,6 @@ pData[1] = transpose; pData[2] = eventlength; mLength = sizeof(int) * 3; - edb(); mpData[mLength] = 0; return io.Write(this, mpData, mLength); @@ -1481,13 +1384,11 @@ virtual JZPlayTrackEvent* IsPlayTrack() { - edb(); return this; } virtual JZEvent* Copy() const { - edb(); return new JZPlayTrackEvent(mClock, track, transpose, eventlength); } @@ -1527,7 +1428,6 @@ virtual int GetBPM() const { - edb(); return int(60000000L / uSec); } @@ -1538,25 +1438,21 @@ virtual int GetPitch() const { - edb(); return GetBPM() / 2; } virtual int Write(JZWriteBase &io) { - edb(); return io.Write(this, (char)(uSec >> 16), (char)(uSec >> 8), (char)uSec); } virtual JZSetTempoEvent* IsSetTempo() { - edb(); return this; } virtual JZEvent* Copy() const { - edb(); return new JZSetTempoEvent(*this); } }; @@ -1573,13 +1469,11 @@ virtual JZMtcOffsetEvent* IsMtcOffset() { - edb(); return this; } virtual JZEvent* Copy() const { - edb(); return new JZMtcOffsetEvent(mClock, mpData, mLength); } }; @@ -1608,13 +1502,11 @@ virtual int Write(JZWriteBase &io) { - edb(); return io.Write(this, Numerator, Denomiator, Clocks, Quarter); } virtual JZTimeSignatEvent* IsTimeSignat() { - edb(); return this; } @@ -1629,7 +1521,6 @@ virtual JZEvent* Copy() const { - edb(); return new JZTimeSignatEvent(*this); } }; @@ -1648,18 +1539,16 @@ virtual int Write(JZWriteBase &io) { - edb(); return io.Write(this); + return io.Write(this); } virtual JZEndOfTrackEvent* IsEndOfTrack() { - edb(); return this; } virtual JZEvent* Copy() const { - edb(); return new JZEndOfTrackEvent(this->GetClock()); } }; @@ -1681,18 +1570,16 @@ virtual int Write(JZWriteBase &io) { - edb(); return io.Write(this, Sharps, Minor); + return io.Write(this, Sharps, Minor); } virtual JZKeySignatEvent* IsKeySignat() { - edb(); return this; } virtual JZEvent* Copy() const { - edb(); return new JZKeySignatEvent(*this); } }; @@ -1717,37 +1604,31 @@ virtual int Write(JZWriteBase &io) { - edb(); return io.Write(this, mKey, mValue); } virtual JZKeyPressureEvent* IsKeyPressure() { - edb(); return this; } virtual JZEvent* Copy() const { - edb(); return new JZKeyPressureEvent(*this); } virtual int GetValue() const { - edb(); return mValue; } virtual int GetPitch() const { - edb(); return mKey; } virtual void SetPitch(int Pitch) { - edb(); mKey = Pitch; } @@ -1793,36 +1674,31 @@ virtual int Write(JZWriteBase &io) { - edb(); return io.Write(this, Value); + return io.Write(this, Value); } virtual JZChnPressureEvent* IsChnPressure() { - edb(); return this; } virtual JZEvent* Copy() const { - edb(); return new JZChnPressureEvent(*this); } virtual int GetValue() const { - edb(); return Value; } virtual int GetPitch() const { - edb(); return 0; } virtual void SetPitch(int v) { - edb(); } virtual const wxPen* GetPen() const Modified: trunk/jazz/src/Track.cpp =================================================================== --- trunk/jazz/src/Track.cpp 2010-04-26 14:35:58 UTC (rev 759) +++ trunk/jazz/src/Track.cpp 2010-04-26 17:06:32 UTC (rev 760) @@ -3,7 +3,7 @@ // // Copyright (C) 1994-2000 Andreas Voss and Per Sigmond, all rights reserved. // Modifications Copyright (C) 2004 Patrick Earl -// Modifications Copyright (C) 2008 Peter J. Stieber +// Modifications Copyright (C) 2008-2010 Peter J. Stieber // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -429,14 +429,6 @@ void tSimpleEventArray::Clear() { int i; -#ifdef E_DBUG - { - for (int i = 0; i < nEvents; i++) - { - Events[i]->edb(); - } - } -#endif for (i = 0; i < nEvents; i++) { delete Events[i]; @@ -448,17 +440,6 @@ void tUndoBuffer::Clear() { int i; -#ifdef E_DBUG - { - for (int i = 0; i < nEvents; i++) - { - if (bits(i)) - { - Events[i]->edb(); - } - } - } -#endif for (i = 0; i < nEvents; i++) { if (bits(i)) @@ -536,15 +517,6 @@ Resize(); } Events[nEvents++] = pEvent; - -#ifdef E_DBUG - { - for (int i = 0; i < nEvents; i++) - { - Events[i]->edb(); - } - } -#endif } // Description: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2010-04-26 17:22:28
|
Revision: 761 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=761&view=rev Author: pstieber Date: 2010-04-26 17:22:22 +0000 (Mon, 26 Apr 2010) Log Message: ----------- Updated the naming convention for JZGetMidiBytes data members. Modified Paths: -------------- trunk/jazz/src/Events.cpp trunk/jazz/src/Events.h trunk/jazz/src/Player.cpp Modified: trunk/jazz/src/Events.cpp =================================================================== --- trunk/jazz/src/Events.cpp 2010-04-26 17:06:32 UTC (rev 760) +++ trunk/jazz/src/Events.cpp 2010-04-26 17:22:22 UTC (rev 761) @@ -167,12 +167,12 @@ case StatProgram: case StatChnPressure: case StatPitch: - nBytes = 0; + mByteCount = 0; - Buffer[nBytes++] = Stat | ((JZChannelEvent *)pEvent)->GetChannel(); + mBuffer[mByteCount++] = Stat | ((JZChannelEvent *)pEvent)->GetChannel(); while (Length--) { - Buffer[nBytes++] = *pData++; + mBuffer[mByteCount++] = *pData++; } return 0; Modified: trunk/jazz/src/Events.h =================================================================== --- trunk/jazz/src/Events.h 2010-04-26 17:06:32 UTC (rev 760) +++ trunk/jazz/src/Events.h 2010-04-26 17:22:22 UTC (rev 761) @@ -229,8 +229,8 @@ // Get JZEvent's bytes. int Write(JZEvent* pEvent, unsigned char* pString, int Length); - unsigned char Buffer[10]; - int nBytes; + unsigned char mBuffer[10]; + int mByteCount; }; // ******************************************************************** Modified: trunk/jazz/src/Player.cpp =================================================================== --- trunk/jazz/src/Player.cpp 2010-04-26 17:06:32 UTC (rev 760) +++ trunk/jazz/src/Player.cpp 2010-04-26 17:22:22 UTC (rev 761) @@ -941,7 +941,7 @@ JZChannelEvent *c; pEvent->Write(midi); - Stat = midi.Buffer[0]; // Status + Channel + Stat = midi.mBuffer[0]; // Status + Channel OutBreak(pEvent->GetClock()); @@ -995,7 +995,7 @@ if (Stat != TrackRunningStatus[ActiveTrack]) { - PlyBytes.Put(TRK + midi.nBytes + 1 + 1); + PlyBytes.Put(TRK + midi.mByteCount + 1 + 1); PlyBytes.Put(ActiveTrack); PlyBytes.Put(Time); PlyBytes.Put(Stat); @@ -1003,12 +1003,12 @@ } else { - PlyBytes.Put(TRK + midi.nBytes + 1); + PlyBytes.Put(TRK + midi.mByteCount + 1); PlyBytes.Put(ActiveTrack); PlyBytes.Put(Time); } - for (i = 1; i < midi.nBytes; i++) - PlyBytes.Put(midi.Buffer[i]); + for (i = 1; i < midi.mByteCount; i++) + PlyBytes.Put(midi.mBuffer[i]); TrackClock[ActiveTrack] = pEvent->GetClock(); return 0; @@ -1078,13 +1078,13 @@ JZGetMidiBytes midi; if (pEvent->Write(midi) == 0) { - char* buf = new char[midi.nBytes + 3]; + char* buf = new char[midi.mByteCount + 3]; buf[n++] = CMD+1; buf[n++] = 0xd7; - buf[n++] = DAT+midi.nBytes; - for (i = 0; i < midi.nBytes; i++) + buf[n++] = DAT + midi.mByteCount; + for (i = 0; i < midi.mByteCount; i++) { - buf[n++] = midi.Buffer[i]; + buf[n++] = midi.mBuffer[i]; } write_noack_mpu(buf, n); delete[] buf; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2010-04-26 23:25:25
|
Revision: 762 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=762&view=rev Author: pstieber Date: 2010-04-26 23:25:19 +0000 (Mon, 26 Apr 2010) Log Message: ----------- 1. Changed mStat to mStatusByte and changed constructor argument version to be clearer. 2. Changed cha to Channel in the ASCII I/O code. Modified Paths: -------------- trunk/jazz/src/AsciiMidiFile.cpp trunk/jazz/src/Events.h Modified: trunk/jazz/src/AsciiMidiFile.cpp =================================================================== --- trunk/jazz/src/AsciiMidiFile.cpp 2010-04-26 17:22:22 UTC (rev 761) +++ trunk/jazz/src/AsciiMidiFile.cpp 2010-04-26 23:25:19 UTC (rev 762) @@ -47,8 +47,15 @@ JZEvent* pEvent = 0; long Clock; - int sta, cha, Length; - if (fscanf(mpFd, "%6lu %02x %2d %d ", &Clock, &sta, &cha, &Length) != 4) + int StatusByte, Channel, Length; + if ( + fscanf( + mpFd, + "%6lu %02x %2d %d ", + &Clock, + &StatusByte, + &Channel, + &Length) != 4) { return pEvent; } @@ -61,29 +68,29 @@ pBuffer[i] = (unsigned char)d; } - switch (sta) + switch (StatusByte) { case StatUnknown: break; case StatKeyOff: - pEvent = new JZKeyOffEvent(Clock, cha, pBuffer[0]); + pEvent = new JZKeyOffEvent(Clock, Channel, pBuffer[0]); break; case StatKeyOn: - pEvent = new JZKeyOnEvent(Clock, cha, pBuffer[0], pBuffer[1]); + pEvent = new JZKeyOnEvent(Clock, Channel, pBuffer[0], pBuffer[1]); break; case StatControl: - pEvent = new JZControlEvent(Clock, cha, pBuffer[0], pBuffer[1]); + pEvent = new JZControlEvent(Clock, Channel, pBuffer[0], pBuffer[1]); break; case StatPitch: - pEvent = new JZPitchEvent(Clock, cha, pBuffer[0], pBuffer[1]); + pEvent = new JZPitchEvent(Clock, Channel, pBuffer[0], pBuffer[1]); break; case StatProgram: - pEvent = new JZProgramEvent(Clock, cha, pBuffer[0]); + pEvent = new JZProgramEvent(Clock, Channel, pBuffer[0]); break; case StatText: Modified: trunk/jazz/src/Events.h =================================================================== --- trunk/jazz/src/Events.h 2010-04-26 17:22:22 UTC (rev 761) +++ trunk/jazz/src/Events.h 2010-04-26 23:25:19 UTC (rev 762) @@ -317,7 +317,7 @@ unsigned char GetStat() const { - return mStat; + return mStatusByte; } int GetClock() const @@ -337,8 +337,8 @@ BROADCAST_DEVICE = 0 }; - JZEvent(int Clock, unsigned char Stat) - : mStat(Stat), + JZEvent(int Clock, unsigned char StatusByte) + : mStatusByte(StatusByte), mClock(Clock), mDevice(BROADCAST_DEVICE) { @@ -469,7 +469,7 @@ protected: - unsigned char mStat; + unsigned char mStatusByte; int mClock; @@ -484,8 +484,8 @@ { public: - JZChannelEvent(int Clock, unsigned char sta, int Channel) - : JZEvent(Clock, sta) + JZChannelEvent(int Clock, unsigned char StatusByte, int Channel) + : JZEvent(Clock, StatusByte) { mChannel = Channel; } @@ -909,10 +909,10 @@ JZMetaEvent( int Clock, - unsigned char sta, + unsigned char StatusByte, unsigned char* pData, unsigned short Length) - : JZEvent(Clock, sta), + : JZEvent(Clock, StatusByte), mpData(0), mLength(Length) { @@ -941,7 +941,7 @@ virtual JZEvent* Copy() const { - return new JZMetaEvent(mClock, mStat, mpData, mLength); + return new JZMetaEvent(mClock, mStatusByte, mpData, mLength); } const unsigned char* GetData() const This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2010-04-28 14:15:41
|
Revision: 770 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=770&view=rev Author: pstieber Date: 2010-04-28 14:15:35 +0000 (Wed, 28 Apr 2010) Log Message: ----------- Hooked up Audio menu entries. Modified Paths: -------------- trunk/jazz/src/Audio.cpp trunk/jazz/src/Audio.h trunk/jazz/src/Player.cpp trunk/jazz/src/Player.h trunk/jazz/src/Project.cpp trunk/jazz/src/Project.h trunk/jazz/src/Resources.h trunk/jazz/src/TrackFrame.cpp trunk/jazz/src/TrackFrame.h Modified: trunk/jazz/src/Audio.cpp =================================================================== --- trunk/jazz/src/Audio.cpp 2010-04-27 14:16:38 UTC (rev 769) +++ trunk/jazz/src/Audio.cpp 2010-04-28 14:15:35 UTC (rev 770) @@ -188,7 +188,13 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- tSampleSet::tSampleSet(long tpm) - : mDefaultFileName("noname.spl"), + : speed(22050), + channels(1), + bits(16), // dont change!! + softsync(1), + mpGlobalSettingsDialog(0), + mpSampleDialog(0), + mDefaultFileName("noname.spl"), mRecordFileName("noname.wav") { int i; @@ -202,20 +208,14 @@ adjust_audio_length = 1; has_changed = false; - spl_dialog = 0; - mpGlobalSettingsDialog = 0; is_playing = 0; - softsync = 1; dirty = 0; for (i = 0; i < MAXSMPL; i++) { - samples[i] = new tSample(*this); - samplewin[i] = 0; + mSamples[i] = new tSample(*this); + mSampleWindows[i] = 0; } - speed = 22050; - channels = 1; - bits = 16; // dont change!! for (i = 0; i < MAXPOLY; i++) { @@ -231,8 +231,8 @@ int i; for (i = 0; i < MAXSMPL; i++) { - delete samples[i]; - delete samplewin[i]; + delete mSamples[i]; + delete mSampleWindows[i]; } for (i = 0; i < MAXPOLY; i++) { @@ -248,14 +248,17 @@ //----------------------------------------------------------------------------- void tSampleSet::Edit(int key) { - if (samplewin[key] == 0) + if (mSampleWindows[key] == 0) { - tSample* spl = samples[key]; + tSample* spl = mSamples[key]; - samplewin[key] = new tSampleWin(gpTrackWindow, &samplewin[key], *spl); + mSampleWindows[key] = new tSampleWin( + gpTrackWindow, + &mSampleWindows[key], + *spl); } - samplewin[key]->Show(true); - samplewin[key]->Redraw(); + mSampleWindows[key]->Show(true); + mSampleWindows[key]->Redraw(); } //----------------------------------------------------------------------------- @@ -279,7 +282,7 @@ wxBeginBusyCursor(); for (int i = 0; i < MAXSMPL; i++) { - samples[i]->Clear(); + mSamples[i]->Clear(); } // Get the path of the sample file. @@ -317,23 +320,23 @@ continue; } assert(0 <= key && key < MAXSMPL); - samples[key]->SetFilename(SplFilePath.c_str()); - samples[key]->SetLabel(Label.c_str()); - samples[key]->SetVolume(vol); - samples[key]->SetPan(pan); - samples[key]->SetPitch(pitch); - if (samples[key]->Load()) + mSamples[key]->SetFilename(SplFilePath.c_str()); + mSamples[key]->SetLabel(Label.c_str()); + mSamples[key]->SetVolume(vol); + mSamples[key]->SetPan(pan); + mSamples[key]->SetPitch(pitch); + if (mSamples[key]->Load()) { wxString String; String << "Could not load: \"" - << samples[key]->GetFilename() + << mSamples[key]->GetFilename() << '"'; ::wxMessageBox(String, "Error", wxOK); } - if (samplewin[key]) + if (mSampleWindows[key]) { - samplewin[key]->Redraw(); + mSampleWindows[key]->Redraw(); } } wxEndBusyCursor(); @@ -346,7 +349,9 @@ void tSampleSet::ReloadSamples() { for (int i = 0; i < MAXSMPL; i++) - samples[i]->Load(dirty); + { + mSamples[i]->Load(dirty); + } dirty = 0; } @@ -358,7 +363,7 @@ os << 1 << " " << speed << " " << channels << " " << softsync << endl; for (int i = 0; i < MAXSMPL; i++) { - tSample *spl = samples[i]; + tSample *spl = mSamples[i]; const char *fname = spl->GetFilename(); const char* pLabel = spl->GetLabel(); int vol = spl->GetVolume(); @@ -382,7 +387,7 @@ { if (0 <= i && i < MAXSMPL) { - return samples[i]->GetLabel(); + return mSamples[i]->GetLabel(); } return ""; } @@ -468,7 +473,9 @@ JZKeyOnEvent* pKeyOn = e->IsKeyOn(); if (pKeyOn && num_voices < MAXPOLY) { - voices[num_voices++]->Start(samples[pKeyOn->GetKey()], pKeyOn->GetClock()); + voices[num_voices++]->Start( + mSamples[pKeyOn->GetKey()], + pKeyOn->GetClock()); } } @@ -542,7 +549,7 @@ //----------------------------------------------------------------------------- int tSampleSet::PrepareListen(int key, long fr_smpl, long to_smpl) { - tSample *spl = samples[key]; + tSample *spl = mSamples[key]; return PrepareListen(spl, fr_smpl, to_smpl); } @@ -585,7 +592,7 @@ if (pKeyOn) { pKeyOn->SetLength( - (int)Samples2Ticks(samples[pKeyOn->GetKey()]->GetLength())); + (int)Samples2Ticks(mSamples[pKeyOn->GetKey()]->GetLength())); // Is the event visble? if (pKeyOn->GetEventLength() < 15) @@ -606,7 +613,7 @@ // touch all playback sample data, so they may get swapped into memory for (int i = 0; i < MAXSMPL; i++) { - tSample *spl = samples[i]; + tSample *spl = mSamples[i]; spl->GotoRAM(); } @@ -627,9 +634,13 @@ class tSamplesDlg : public wxDialog { friend class tSampleSet; + public: - tSamplesDlg(wxWindow* pParent, tSampleSet &set); + + tSamplesDlg(wxWindow* pParent, tSampleSet& SampleSet); + ~tSamplesDlg(); + #ifdef OBSOLETE static void CloseButton(wxItem &item, wxCommandEvent& event); static void PlayButton(wxItem &item, wxCommandEvent& event); @@ -639,6 +650,7 @@ static void HelpButton(wxItem &item, wxCommandEvent& event); static void ListClick(wxItem &item, wxCommandEvent& event); #endif // OBSOLETE + void OnCloseButton(); void OnPlayButton(); void OnEditButton(); @@ -648,13 +660,13 @@ void OnListClick(); private: + tSampleSet &set; - char **names; - wxListBox *list; - wxSlider *pan; - wxSlider *vol; - wxSlider *pitch; + wxListBox* mpListBox; + wxSlider* mpPanSlider; + wxSlider* mpVolumeSlider; + wxSlider* mpPitchSlider; #ifdef OBSOLETE wxText* pLabel; wxText* pFile; @@ -805,9 +817,9 @@ //----------------------------------------------------------------------------- void tSampleSet::EditAudioGlobalSettings(wxWindow* pParent) { - if (spl_dialog) + if (mpSampleDialog) { - spl_dialog->Show(true); + mpSampleDialog->Show(true); return; } @@ -825,6 +837,77 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- +void tSampleSet::EditAudioSamples(wxWindow* pParent) +{ + SamplesDlg(); +} + +//----------------------------------------------------------------------------- +// case ID_AUDIO_LOAD_SAMPLE_SET: +//----------------------------------------------------------------------------- +void tSampleSet::LoadSampleSet(wxWindow* pParent) +{ + wxString fname = file_selector( + mDefaultFileName, + "Load Sample Set", + false, + has_changed, + "*.spl"); + if (fname) + { + Load(fname); + } +} + +//----------------------------------------------------------------------------- +// case ID_AUDIO_SAVE_SAMPLE_SET_AS: +//----------------------------------------------------------------------------- +void tSampleSet::SaveSampleSetAs(wxWindow* pParent) +{ + wxString fname = file_selector( + mDefaultFileName, + "Save Sample Set", + true, + has_changed, + "*.spl"); + if (fname) + { + Save(fname); + } +} + +//----------------------------------------------------------------------------- +// case ID_AUDIO_SAVE_SAMPLE_SET: +//----------------------------------------------------------------------------- +void tSampleSet::SaveSampleSet(wxWindow* pParent) +{ + if (mDefaultFileName == "noname.spl") + { + return SaveSampleSetAs(pParent); + } + Save(mDefaultFileName); +} + +//----------------------------------------------------------------------------- +// case ID_AUDIO_NEW_SAMPLE_SET: +//----------------------------------------------------------------------------- +void tSampleSet::ClearSampleSet(wxWindow* pParent) +{ + if (mpSampleDialog == 0 && mpGlobalSettingsDialog == 0) + { + if (wxMessageBox("Clear Sample Set?", "Confirm", wxYES_NO) == wxNO) + { + return; + } + for (int i = 0; i < MAXSMPL; ++i) + { + mSamples[i]->Clear(); + } + } +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void tSampleSet::SaveRecordingDlg(long frc, long toc, tAudioRecordBuffer &buf) { if (frc >= toc) @@ -870,7 +953,7 @@ // see if fname is already present in sample list for (i = 0; i < MAXSMPL; i++) { - spl = samples[i]; + spl = mSamples[i]; if (strcmp(spl->GetFilename(), fname) == 0) break; } @@ -881,7 +964,7 @@ // start somewhere near the top of the list for (i = 15; i < MAXSMPL; i++) { - spl = samples[i]; + spl = mSamples[i]; if (spl->GetFilename()[0] == 0) break; } @@ -1044,12 +1127,14 @@ set(s) { if (path == 0) + { path = copystring("*.wav"); + } - names = new char * [tSampleSet::MAXSMPL]; + wxArrayString SampleNames; for (int i = 0; i < tSampleSet::MAXSMPL; i++) { - names[i] = ListEntry(i); + SampleNames.Add(ListEntry(i)); } // buttons @@ -1067,29 +1152,31 @@ // list box int y = 80; SetLabelPosition(wxVERTICAL); - list = new wxListBox(this, (wxFunction)ListClick, "Samples", wxLB_SINGLE, 10, y, 300, 200, tSampleSet::MAXSMPL, names, wxNEEDED_SB); +#endif // OBSOLETE - NewLine(); + mpListBox = new wxListBox( + this, + wxID_ANY, + wxDefaultPosition, + wxDefaultSize, + SampleNames, + wxLB_SINGLE); + +#ifdef OBSOLETE SetLabelPosition(wxHORIZONTAL); +#endif // OBSOLETE // Sliders - vol = new wxSlider(this, (wxFunction)0, " ", 64, 0, 127, 200); - (void) new wxMessage(this, "Volume"); - NewLine(); - pan = new wxSlider(this, (wxFunction)0, " ", 0, -63, 63, 200); - (void) new wxMessage(this, "Panpot"); - NewLine(); - pitch = new wxSlider(this, (wxFunction)0, " ", 0, -12, 12, 200); - (void) new wxMessage(this, "Pitch"); - NewLine(); + mpVolumeSlider = new wxSlider(this, wxID_ANY, 64, 0, 127); + mpPanSlider = new wxSlider(this, wxID_ANY, 0, -63, 63); + mpPitchSlider = new wxSlider(this, wxID_ANY, 0, -12, 12); +#ifdef OBSOLETE pLabel = new wxText(this, (wxFunction)0, "Label", "", -1, -1, 300); - NewLine(); file = new wxText(this, (wxFunction)0, "File", "", -1, -1, 300); - NewLine(); #endif // OBSOLETE Fit(); Sample2Win(current); - list->SetSelection(current, true); + mpListBox->SetSelection(current); Show(true); } @@ -1098,7 +1185,7 @@ char *tSamplesDlg::ListEntry(int i) { ostringstream Oss; - Oss << i + 1 << ' ' << set.samples[i]->GetLabel(); + Oss << i + 1 << ' ' << set.mSamples[i]->GetLabel(); // KeyToString(i, buf + strlen(buf)); return copystring(Oss.str().c_str()); } @@ -1107,10 +1194,10 @@ //----------------------------------------------------------------------------- void tSamplesDlg::Sample2Win(int i) { - tSample *spl = set.samples[i]; - vol->SetValue(spl->GetVolume()); - pitch->SetValue(spl->GetPitch()); - pan->SetValue(spl->GetPan()); + tSample *spl = set.mSamples[i]; + mpVolumeSlider->SetValue(spl->GetVolume()); + mpPitchSlider->SetValue(spl->GetPitch()); + mpPanSlider->SetValue(spl->GetPan()); #ifdef OBSOLETE pLabel->SetValue((char *)spl->GetLabel()); file->SetValue((char *)spl->GetFilename()); @@ -1121,10 +1208,10 @@ //----------------------------------------------------------------------------- void tSamplesDlg::Win2Sample(int i) { - tSample *spl = set.samples[i]; - spl->SetPitch(pitch->GetValue()); - spl->SetVolume(vol->GetValue()); - spl->SetPan(pan->GetValue()); + tSample *spl = set.mSamples[i]; + spl->SetPitch(mpPitchSlider->GetValue()); + spl->SetVolume(mpVolumeSlider->GetValue()); + spl->SetPan(mpPanSlider->GetValue()); #ifdef OBSOLETE spl->SetLabel(pLabel->GetValue()); spl->SetFilename(file->GetValue()); @@ -1138,8 +1225,8 @@ if (i >= 0) { current = i; - list->SetString(current, ListEntry(current)); - list->SetSelection(current, true); + mpListBox->SetString(current, ListEntry(current)); + mpListBox->SetSelection(current, true); } } @@ -1147,9 +1234,6 @@ //----------------------------------------------------------------------------- tSamplesDlg::~tSamplesDlg() { - for (int i = 0; i < tSampleSet::MAXSMPL; i++) - delete [] names[i]; - delete [] names; } //----------------------------------------------------------------------------- @@ -1162,7 +1246,7 @@ wxBeginBusyCursor(); set.ReloadSamples(); wxEndBusyCursor(); - set.spl_dialog = 0; + set.mpSampleDialog = 0; // DELETE_THIS(); Destroy(); } @@ -1190,7 +1274,7 @@ wxBeginBusyCursor(); Win2Sample(current); SetCurrentListEntry(current); - tSample *spl = set.samples[current]; + tSample *spl = set.mSamples[current]; spl->Load(); wxEndBusyCursor(); @@ -1212,7 +1296,7 @@ } Win2Sample(current); SetCurrentListEntry(current); - tSample *spl = set.samples[current]; + tSample *spl = set.mSamples[current]; wxBeginBusyCursor(); spl->Load(); gpMidiPlayer->ListenAudio(current); @@ -1223,7 +1307,7 @@ //----------------------------------------------------------------------------- void tSamplesDlg::OnClrButton() { - tSample *spl = set.samples[current]; + tSample *spl = set.mSamples[current]; spl->Clear(); SetCurrentListEntry(current); Sample2Win(current); @@ -1241,7 +1325,7 @@ void tSamplesDlg::OnListClick() { Win2Sample(current); - int i = list->GetSelection(); + int i = mpListBox->GetSelection(); if (i >= 0) { current = i; @@ -1291,87 +1375,19 @@ mpGlobalSettingsDialog->Show(true); return; } - if (spl_dialog == 0) - spl_dialog = new tSamplesDlg(gpTrackWindow, *this); - spl_dialog->Show(true); + if (mpSampleDialog == 0) + { + mpSampleDialog = new tSamplesDlg(gpTrackWindow, *this); + } + mpSampleDialog->Show(true); } //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- void tSampleSet::RefreshDialogs() { - if (spl_dialog) - spl_dialog->Sample2Win(spl_dialog->current); -} - -// ----------------------------------------------------------------- -// -------------------------------- menu --------------------------- -// ----------------------------------------------------------------- - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -int tSampleSet::OnMenuCommand(int id) -{ - switch (id) + if (mpSampleDialog) { - case ID_AUDIO_LOAD: - { - wxString fname = file_selector( - mDefaultFileName, - "Load Sample Set", - false, - has_changed, - "*.spl"); - if (fname) - { - Load(fname); - } - return 1; - } - - case ID_AUDIO_SAVE_AS: - { - wxString fname = file_selector( - mDefaultFileName, - "Save Sample Set", - true, - has_changed, - "*.spl"); - if (fname) - { - Save(fname); - } - return 1; - } - - case ID_AUDIO_SAVE: - { - if (mDefaultFileName == "noname.spl") - { - return OnMenuCommand(ID_AUDIO_SAVE_AS); - } - Save(mDefaultFileName); - return 1; - } - - case ID_AUDIO_SAMPLES: - SamplesDlg(); - return 1; - - case ID_AUDIO_NEW: - if (spl_dialog == 0 && mpGlobalSettingsDialog == 0) - { - if (wxMessageBox("Clear Sample Set?", "Confirm", wxYES_NO) == wxNO) - { - return 1; - } - for (int i = 0; i < MAXSMPL; i++) - { - samples[i]->Clear(); - } - } - return 1; - + mpSampleDialog->Sample2Win(mpSampleDialog->current); } - return 0; } Modified: trunk/jazz/src/Audio.h =================================================================== --- trunk/jazz/src/Audio.h 2010-04-27 14:16:38 UTC (rev 769) +++ trunk/jazz/src/Audio.h 2010-04-28 14:15:35 UTC (rev 770) @@ -340,8 +340,6 @@ virtual const char *GetSampleName(int i); - int OnMenuCommand(int id); - void StartPlay(long clock); void StopPlay(); @@ -367,11 +365,21 @@ tSample &operator[](int i) { - return *samples[i]; + return *mSamples[i]; } void EditAudioGlobalSettings(wxWindow* pParent); + void EditAudioSamples(wxWindow* pParent); + + void LoadSampleSet(wxWindow* pParent); + + void SaveSampleSetAs(wxWindow* pParent); + + void SaveSampleSet(wxWindow* pParent); + + void ClearSampleSet(wxWindow* pParent); + protected: long SampleSize(long num_samples) @@ -388,20 +396,24 @@ protected: - long speed; // samples / second - int channels; // mono = 1, stereo = 2 - int bits; // must be 16! - bool softsync; // enable software midi/audio sync - enum { MAXSMPL = 128 }; - tSample *samples[MAXSMPL]; - tSampleWin *samplewin[MAXSMPL]; + long speed; // samples / second + int channels; // mono = 1, stereo = 2 + int bits; // must be 16! + bool softsync; // enable software midi/audio sync - long ticks_per_minute; // midi speed for audio/midi sync - double clocks_per_buffer; - long start_clock; // when did play start + enum + { + MAXSMPL = 128 + }; + tSample* mSamples[MAXSMPL]; + tSampleWin* mSampleWindows[MAXSMPL]; - int event_index; + long ticks_per_minute; // midi speed for audio/midi sync + double clocks_per_buffer; + long start_clock; // when did play start + int event_index; + unsigned int bufbytes; // buffer size in byte unsigned int bufshorts; // buffer size in short tAudioBuffer *buffers[BUFCOUNT]; // all the audio buffers @@ -413,7 +425,7 @@ long buffers_written; // for computing buffers clock wxDialog* mpGlobalSettingsDialog; - tSamplesDlg* spl_dialog; + tSamplesDlg* mpSampleDialog; tEventArray* events; Modified: trunk/jazz/src/Player.cpp =================================================================== --- trunk/jazz/src/Player.cpp 2010-04-27 14:16:38 UTC (rev 769) +++ trunk/jazz/src/Player.cpp 2010-04-28 14:15:35 UTC (rev 770) @@ -690,6 +690,41 @@ mSamples.EditAudioGlobalSettings(pParent); } +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZPlayer::EditAudioSamples(wxWindow* pParent) +{ + mSamples.EditAudioSamples(pParent); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZPlayer::LoadSampleSet(wxWindow* pParent) +{ + mSamples.LoadSampleSet(pParent); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZPlayer::SaveSampleSetAs(wxWindow* pParent) +{ + mSamples.SaveSampleSetAs(pParent); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZPlayer::SaveSampleSet(wxWindow* pParent) +{ + mSamples.SaveSampleSet(pParent); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZPlayer::ClearSampleSet(wxWindow* pParent) +{ + mSamples.ClearSampleSet(pParent); +} + #ifdef DEV_MPU401 //***************************************************************************** Modified: trunk/jazz/src/Player.h =================================================================== --- trunk/jazz/src/Player.h 2010-04-27 14:16:38 UTC (rev 769) +++ trunk/jazz/src/Player.h 2010-04-28 14:15:35 UTC (rev 770) @@ -261,15 +261,6 @@ return 0; } - virtual int OnMenuCommand(int id) - { - if (mPlaying) - { - return 0; - } - return mSamples.OnMenuCommand(id); - } - virtual const char *GetSampleName(int i) { return mSamples.GetSampleName(i); @@ -283,6 +274,16 @@ void EditAudioGlobalSettings(wxWindow* pParent); + void EditAudioSamples(wxWindow* pParent); + + void LoadSampleSet(wxWindow* pParent); + + void SaveSampleSetAs(wxWindow* pParent); + + void SaveSampleSet(wxWindow* pParent); + + void ClearSampleSet(wxWindow* pParent); + void EditSample(int key) { mSamples.Edit(key); Modified: trunk/jazz/src/Project.cpp =================================================================== --- trunk/jazz/src/Project.cpp 2010-04-27 14:16:38 UTC (rev 769) +++ trunk/jazz/src/Project.cpp 2010-04-28 14:15:35 UTC (rev 770) @@ -628,6 +628,41 @@ } //----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZProject::EditAudioSamples(wxWindow* pParent) +{ + mpMidiPlayer->EditAudioSamples(pParent); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZProject::LoadSampleSet(wxWindow* pParent) +{ + mpMidiPlayer->LoadSampleSet(pParent); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZProject::SaveSampleSetAs(wxWindow* pParent) +{ + mpMidiPlayer->SaveSampleSetAs(pParent); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZProject::SaveSampleSet(wxWindow* pParent) +{ + mpMidiPlayer->SaveSampleSet(pParent); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZProject::ClearSampleSet(wxWindow* pParent) +{ + mpMidiPlayer->ClearSampleSet(pParent); +} + +//----------------------------------------------------------------------------- // Description: // Sets the internal mpRecInfo, used for recording apparently. // JZProject will take ownership of this pointer, so don't delete it after Modified: trunk/jazz/src/Project.h =================================================================== --- trunk/jazz/src/Project.h 2010-04-27 14:16:38 UTC (rev 769) +++ trunk/jazz/src/Project.h 2010-04-28 14:15:35 UTC (rev 770) @@ -158,6 +158,16 @@ void EditAudioGlobalSettings(wxWindow* pParent); + void EditAudioSamples(wxWindow* pParent); + + void LoadSampleSet(wxWindow* pParent); + + void SaveSampleSetAs(wxWindow* pParent); + + void SaveSampleSet(wxWindow* pParent); + + void ClearSampleSet(wxWindow* pParent); + JZPlayer* GetPlayer() { return mpMidiPlayer; Modified: trunk/jazz/src/Resources.h =================================================================== --- trunk/jazz/src/Resources.h 2010-04-27 14:16:38 UTC (rev 769) +++ trunk/jazz/src/Resources.h 2010-04-28 14:15:35 UTC (rev 770) @@ -38,11 +38,11 @@ #define ID_SETTINGS_MIDI_DEVICE wxID_HIGHEST + 12 #define ID_AUDIO_GLOBAL_SETTINGS wxID_HIGHEST + 20 -#define ID_AUDIO_SAMPLES wxID_HIGHEST + 21 -#define ID_AUDIO_LOAD wxID_HIGHEST + 22 -#define ID_AUDIO_SAVE wxID_HIGHEST + 23 -#define ID_AUDIO_SAVE_AS wxID_HIGHEST + 24 -#define ID_AUDIO_NEW wxID_HIGHEST + 25 +#define ID_AUDIO_SAMPLE_SETTINGS wxID_HIGHEST + 21 +#define ID_AUDIO_LOAD_SAMPLE_SET wxID_HIGHEST + 22 +#define ID_AUDIO_SAVE_SAMPLE_SET wxID_HIGHEST + 23 +#define ID_AUDIO_SAVE_SAMPLE_SET_AS wxID_HIGHEST + 24 +#define ID_AUDIO_NEW_SAMPLE_SET wxID_HIGHEST + 25 #define ID_TRIM wxID_HIGHEST + 30 #define ID_QUANTIZE wxID_HIGHEST + 31 Modified: trunk/jazz/src/TrackFrame.cpp =================================================================== --- trunk/jazz/src/TrackFrame.cpp 2010-04-27 14:16:38 UTC (rev 769) +++ trunk/jazz/src/TrackFrame.cpp 2010-04-28 14:15:35 UTC (rev 770) @@ -109,6 +109,16 @@ EVT_MENU(ID_AUDIO_GLOBAL_SETTINGS, JZTrackFrame::OnAudioGlobalSettings) + EVT_MENU(ID_AUDIO_SAMPLE_SETTINGS, JZTrackFrame::OnAudioSampleSettings) + + EVT_MENU(ID_AUDIO_LOAD_SAMPLE_SET, JZTrackFrame::OnAudioLoadSampleSet) + + EVT_MENU(ID_AUDIO_SAVE_SAMPLE_SET, OnAudioSaveSampleSet) + + EVT_MENU(ID_AUDIO_SAVE_SAMPLE_SET_AS, OnAudioSaveSampleSetAs) + + EVT_MENU(ID_AUDIO_NEW_SAMPLE_SET, OnAudioNewSampleSet) + EVT_MENU(wxID_HELP_CONTENTS, JZTrackFrame::OnHelpContents) EVT_MENU(wxID_ABOUT, JZTrackFrame::OnHelpAbout) @@ -380,6 +390,14 @@ pSettingMenu->Append(MEN_SAVE_SET, "&Save settings", save_settings_menu ); #endif + wxMenu* pAudioMenu = new wxMenu; + pAudioMenu->Append(ID_AUDIO_GLOBAL_SETTINGS, "&Global Audio Settings..."); + pAudioMenu->Append(ID_AUDIO_SAMPLE_SETTINGS, "Sample Set Se&ttings... "); + pAudioMenu->Append(ID_AUDIO_LOAD_SAMPLE_SET, "&Load Sample Set..."); + pAudioMenu->Append(ID_AUDIO_SAVE_SAMPLE_SET, "&Save Sample Set"); + pAudioMenu->Append(ID_AUDIO_SAVE_SAMPLE_SET_AS, "Save Sample Set &As"); + pAudioMenu->Append(ID_AUDIO_NEW_SAMPLE_SET, "&New Sample Set"); + wxMenu* mpHelpMenu = new wxMenu; mpHelpMenu->Append(wxID_HELP_CONTENTS, "&Contents"); // mpHelpMenu->Append(MEN_HELP_JAZZ, "&Jazz"); @@ -397,17 +415,7 @@ pMenuBar->Append(mpToolsMenu, "&Tools"); pMenuBar->Append(pSettingMenu, "&Settings"); pMenuBar->Append(pMiscMenu, "&Misc"); - - wxMenu* pAudioMenu = new wxMenu; - pAudioMenu->Append(ID_AUDIO_GLOBAL_SETTINGS, "&Global Settings..."); - pAudioMenu->Append(ID_AUDIO_SAMPLES, "Sample Se&ttings... "); - pAudioMenu->Append(ID_AUDIO_LOAD, "&Load Set..."); - pAudioMenu->Append(ID_AUDIO_SAVE, "&Save Set"); - pAudioMenu->Append(ID_AUDIO_SAVE_AS, "Save Set &As"); - pAudioMenu->Append(ID_AUDIO_NEW, "&New Set"); - pMenuBar->Append(pAudioMenu, "&Audio"); - pMenuBar->Append(mpHelpMenu , "&Help"); SetMenuBar(pMenuBar); @@ -647,6 +655,38 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- +void JZTrackFrame::OnAudioSampleSettings(wxCommandEvent& Event) +{ + mpProject->EditAudioSamples(this); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZTrackFrame::OnAudioLoadSampleSet(wxCommandEvent& Event) +{ + mpProject->LoadSampleSet(this); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZTrackFrame::OnAudioSaveSampleSet(wxCommandEvent& Event) +{ +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZTrackFrame::OnAudioSaveSampleSetAs(wxCommandEvent& Event) +{ +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZTrackFrame::OnAudioNewSampleSet(wxCommandEvent& Event) +{ +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void JZTrackFrame::OnHelpContents(wxCommandEvent& Event) { ::wxGetApp().DisplayHelpContents(); Modified: trunk/jazz/src/TrackFrame.h =================================================================== --- trunk/jazz/src/TrackFrame.h 2010-04-27 14:16:38 UTC (rev 769) +++ trunk/jazz/src/TrackFrame.h 2010-04-28 14:15:35 UTC (rev 770) @@ -100,6 +100,16 @@ void OnAudioGlobalSettings(wxCommandEvent& Event); + void OnAudioSampleSettings(wxCommandEvent& Event); + + void OnAudioLoadSampleSet(wxCommandEvent& Event); + + void OnAudioSaveSampleSet(wxCommandEvent& Event); + + void OnAudioSaveSampleSetAs(wxCommandEvent& Event); + + void OnAudioNewSampleSet(wxCommandEvent& Event); + void OnHelpContents(wxCommandEvent& Event); void OnHelpAbout(wxCommandEvent& Event); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2010-04-28 21:32:21
|
Revision: 773 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=773&view=rev Author: pstieber Date: 2010-04-28 21:32:14 +0000 (Wed, 28 Apr 2010) Log Message: ----------- Started updating the menus in the sample window. Modified Paths: -------------- trunk/jazz/src/Resources.h trunk/jazz/src/SampleWindow.cpp Modified: trunk/jazz/src/Resources.h =================================================================== --- trunk/jazz/src/Resources.h 2010-04-28 16:27:52 UTC (rev 772) +++ trunk/jazz/src/Resources.h 2010-04-28 21:32:14 UTC (rev 773) @@ -37,6 +37,8 @@ #define ID_SETTINGS_SYNTHESIZER wxID_HIGHEST + 11 #define ID_SETTINGS_MIDI_DEVICE wxID_HIGHEST + 12 +#define ID_EDIT_PASTE_MERGE wxID_HIGHEST + 15 + #define ID_AUDIO_GLOBAL_SETTINGS wxID_HIGHEST + 20 #define ID_AUDIO_SAMPLE_SETTINGS wxID_HIGHEST + 21 #define ID_AUDIO_LOAD_SAMPLE_SET wxID_HIGHEST + 22 Modified: trunk/jazz/src/SampleWindow.cpp =================================================================== --- trunk/jazz/src/SampleWindow.cpp 2010-04-28 16:27:52 UTC (rev 772) +++ trunk/jazz/src/SampleWindow.cpp 2010-04-28 21:32:14 UTC (rev 773) @@ -29,6 +29,7 @@ #include "Mapper.h" #include "MouseAction.h" #include "Player.h" +#include "Resources.h" #include "Rhythm.h" #include "Sample.h" #include "SampleCommand.h" @@ -52,10 +53,6 @@ #define MEN_SAVEAS 6 #define MEN_REVERT 7 -#define MEN_PASTE 12 -#define MEN_PASTE_MIX 15 - - #define MEN_VOLUME_MAX 19 #define MEN_VOLUME_PNT 20 @@ -78,7 +75,6 @@ #define MEN_REVERB 47 #define MEN_SHIFTER 48 #define MEN_REVERSE 49 -#define MEN_SETTINGS 50 #define MEN_FILTER 51 #define MEN_CHORUS 52 #define MEN_STEREO 53 @@ -90,13 +86,17 @@ class tSamplePlayPosition; -class tInsertionPoint { +class tInsertionPoint +{ public: - tInsertionPoint(wxScrolledWindow *c) : cnvs(c) + + tInsertionPoint(wxScrolledWindow *c) + : cnvs(c) { last_x = 0; visible = 0; - }; + } + void Draw(int x) { last_x = x; @@ -110,53 +110,75 @@ dc->SetPen(*wxBLACK_PEN); dc->SetLogicalFunction(wxCOPY); } + void Draw() { Draw(last_x); } - int IsVisible() const { + + int IsVisible() const + { return visible; } - float GetX() const { + + float GetX() const + { return last_x; } + private: + int last_x; int visible; wxScrolledWindow *cnvs; }; - - class tSampleCnvs : public wxScrolledWindow { friend class tSampleWin; friend class tSmplWinSettingsForm; + public: + tSampleCnvs(tSampleWin *win, tSample &sample); + virtual ~tSampleCnvs(); + void Redraw() { OnPaint(); } + virtual void OnPaint(); + virtual void OnSize(int w, int h); + virtual void OnEvent(wxMouseEvent& MouseEvent); + void ClearSelection(); + void SetInsertionPoint(int offs); + void SetSelection(int fr, int to); int Sample2Pixel(int sample); + int Pixel2Sample(float pixel); + void Play(); + private: + void DrawSample(int channel, int x, int y, int w, int h); + + void DrawTicks(int x, int y, int w); + private: - void DrawSample(int channel, int x, int y, int w, int h); + tSampleWin *win; + tSample &spl; - void DrawTicks(int x, int y, int w); int paint_offset; int paint_length; @@ -217,8 +239,11 @@ class tSamplePlayPosition : public wxTimer { public: + tSamplePlayPosition(tSampleCnvs &c, JZPlayer *p, tSample &s) - : cnvs(c), player(p), spl(s) + : cnvs(c), + player(p), + spl(s) { visible = FALSE; x = 0; @@ -703,7 +728,7 @@ in_constructor = TRUE; cnvs = 0; - mpToolBar = 0; + mpToolBar = 0; scrol_panel = 0; pos_scrol = 0; zoom_scrol = 0; @@ -727,64 +752,73 @@ mpToolBar = new JZToolBar(this, tdefs); - wxMenuBar *menu_bar = new wxMenuBar; - wxMenu *menu = new wxMenu; - menu->Append(MEN_REVERT, "&Revert to Saved"); - menu->Append(MEN_LOAD, "&Load..."); - menu->Append(wxID_SAVE, "&Save"); - menu->Append(wxID_SAVEAS, "&Save As..."); - menu->Append(MEN_CLOSE, "&Close"); - menu_bar->Append(menu, "&File"); + // Create a menu bar, the various menus with entries, and attach them to the + // menu bar. - menu = new wxMenu; - menu->Append(wxID_CUT, "&Cut"); - menu->Append(wxID_COPY, "Co&py"); + wxMenu* pMenu = 0; + wxMenu* pSubMenu = 0; + wxMenuBar* pMenuBar = new wxMenuBar; - menu->Append(MEN_PASTE, "&Paste"); - menu->Append(MEN_PASTE_MIX, "Paste &Merge"); - wxMenu *sub = new wxMenu; - sub->Append(MEN_SILENCE_OVR, "&Replace"); - sub->Append(MEN_SILENCE_INS, "&Insert"); - sub->Append(MEN_SILENCE_APP, "&Append"); - menu->Append(MEN_SILENCE, "&Silence", sub); - sub = new wxMenu; - sub->Append(MEN_FLIP_LEFT, "Left"); - sub->Append(MEN_FLIP_RIGHT, "Right"); - menu->Append(MEN_FLIP, "In&vert Phase", sub); - menu->Append(MEN_VOLUME_MAX, "&Maximize Volume"); - menu_bar->Append(menu, "&Edit"); + // Create and populate the File menu. + pMenu = new wxMenu; - menu = new wxMenu; - menu->Append(MEN_VOLUME_PNT, "&Volume..."); - menu->Append(MEN_PAN_PNT, "&Panpot..."); - menu->Append(MEN_TRANSP_PNT, "&Pitch..."); - menu->Append(MEN_WAHWAH, "&Filter..."); - menu->Append(MEN_CANCEL, "&None..."); - menu_bar->Append(menu, "&Painters"); + pMenu->Append(MEN_REVERT, "&Revert to Saved"); + pMenu->Append(MEN_LOAD, "&Load..."); + pMenu->Append(wxID_SAVE, "&Save"); + pMenu->Append(wxID_SAVEAS, "&Save As..."); + pMenu->Append(MEN_CLOSE, "&Close"); - menu = new wxMenu; - menu->Append(MEN_EQUALIZER, "&Equalizer..."); - menu->Append(MEN_FILTER, "&Filter..."); - menu->Append(MEN_DISTORTION, "&Distortion..."); - menu->Append(MEN_REVERB, "&Reverb..."); - menu->Append(MEN_ECHO, "&Echo..."); - menu->Append(MEN_CHORUS, "&Chorus..."); - menu->Append(MEN_SHIFTER, "&Pitch shifter..."); - menu->Append(MEN_STRETCHER, "&Time stretcher..."); - menu->Append(MEN_REVERSE, "Re&verse"); - menu->Append(MEN_SYNTH, "&Synth..."); - menu_bar->Append(menu, "&Effects"); + pMenuBar->Append(pMenu, "&File"); - menu = new wxMenu; - menu->Append(MEN_TRANSP_SET, "&Pitch Painter..."); - menu->Append(MEN_WAHSETTINGS, "&Filter Painter..."); -// menu->Append(wxID_ZOOM_IN, "Zoom &In"); -// menu->Append(wxID_ZOOM_OUT, "Zoom &Out"); - menu->Append(MEN_SETTINGS, "&View Settings..."); - menu_bar->Append(menu, "&Settings"); + // Create and populate the Edit menu. + pMenu = new wxMenu; + pMenu->Append(wxID_CUT, "&Cut"); + pMenu->Append(wxID_COPY, "Co&py"); + pMenu->Append(wxID_PASTE, "&Paste"); + pMenu->Append(ID_EDIT_PASTE_MERGE, "Paste &Merge"); + pSubMenu = new wxMenu; + pSubMenu->Append(MEN_SILENCE_OVR, "&Replace"); + pSubMenu->Append(MEN_SILENCE_INS, "&Insert"); + pSubMenu->Append(MEN_SILENCE_APP, "&Append"); + pMenu->Append(MEN_SILENCE, "&Silence", pSubMenu); + pSubMenu = new wxMenu; + pSubMenu->Append(MEN_FLIP_LEFT, "Left"); + pSubMenu->Append(MEN_FLIP_RIGHT, "Right"); + pMenu->Append(MEN_FLIP, "In&vert Phase", pSubMenu); + pMenu->Append(MEN_VOLUME_MAX, "&Maximize Volume"); + pMenuBar->Append(pMenu, "&Edit"); - SetMenuBar(menu_bar); + pMenu = new wxMenu; + pMenu->Append(MEN_VOLUME_PNT, "&Volume..."); + pMenu->Append(MEN_PAN_PNT, "&Panpot..."); + pMenu->Append(MEN_TRANSP_PNT, "&Pitch..."); + pMenu->Append(MEN_WAHWAH, "&Filter..."); + pMenu->Append(MEN_CANCEL, "&None..."); + pMenuBar->Append(pMenu, "&Painters"); + pMenu = new wxMenu; + pMenu->Append(MEN_EQUALIZER, "&Equalizer..."); + pMenu->Append(MEN_FILTER, "&Filter..."); + pMenu->Append(MEN_DISTORTION, "&Distortion..."); + pMenu->Append(MEN_REVERB, "&Reverb..."); + pMenu->Append(MEN_ECHO, "&Echo..."); + pMenu->Append(MEN_CHORUS, "&Chorus..."); + pMenu->Append(MEN_SHIFTER, "&Pitch shifter..."); + pMenu->Append(MEN_STRETCHER, "&Time stretcher..."); + pMenu->Append(MEN_REVERSE, "Re&verse"); + pMenu->Append(MEN_SYNTH, "&Synth..."); + pMenuBar->Append(pMenu, "&Effects"); + + pMenu = new wxMenu; + pMenu->Append(MEN_TRANSP_SET, "&Pitch Painter..."); + pMenu->Append(MEN_WAHSETTINGS, "&Filter Painter..."); +// pMenu->Append(wxID_ZOOM_IN, "Zoom &In"); +// pMenu->Append(wxID_ZOOM_OUT, "Zoom &Out"); + pMenu->Append(MEN_SETTINGS, "&View Settings..."); + pMenuBar->Append(pMenu, "&Settings"); + + SetMenuBar(pMenuBar); + // construct a panel containing the scrollbars cnvs = new tSampleCnvs(this, spl); scrol_panel = new wxPanel(this); @@ -1220,7 +1254,7 @@ on_accept = new tCommandPainter(*this, pan_command); break; - case MEN_PASTE_MIX: + case ID_EDIT_PASTE_MERGE: { int offs; if (HaveInsertionPoint(offs)) @@ -1232,7 +1266,7 @@ } break; - case MEN_PASTE: + case wxID_PASTE: { int offs, fr, to; if (HaveInsertionPoint(offs, FALSE)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2010-04-28 21:36:32
|
Revision: 774 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=774&view=rev Author: pstieber Date: 2010-04-28 21:36:26 +0000 (Wed, 28 Apr 2010) Log Message: ----------- 1. Changed switch( to switch (. 2. Changed for( to for (. 3. Changed the style in wxPropertyValue::StringValue. 4. Changed the curly bracket style in prop.cpp. Modified Paths: -------------- trunk/jazz/src/DeprecatedWx/prop.cpp trunk/jazz/src/mswin/WindowsMidiInterface.cpp trunk/jazz/src/mswin/WindowsPlayer.cpp Modified: trunk/jazz/src/DeprecatedWx/prop.cpp =================================================================== --- trunk/jazz/src/DeprecatedWx/prop.cpp 2010-04-28 21:32:14 UTC (rev 773) +++ trunk/jazz/src/DeprecatedWx/prop.cpp 2010-04-28 21:36:26 UTC (rev 774) @@ -896,13 +896,15 @@ return m_value.boolPtr; } -wxChar *wxPropertyValue::StringValue(void) const { - if (m_type == wxPropertyValueString) - return m_value.string; - else if (m_type == wxPropertyValueStringPtr) - return *(m_value.stringPtr); - else return NULL; - } +wxChar *wxPropertyValue::StringValue(void) const +{ + if (m_type == wxPropertyValueString) + return m_value.string; + else if (m_type == wxPropertyValueStringPtr) + return *(m_value.stringPtr); + else + return NULL; +} wxChar **wxPropertyValue::StringValuePtr(void) const { @@ -1107,10 +1109,13 @@ bool wxPropertySheet::SetProperty(const wxString& Name, const wxPropertyValue& value) { wxProperty* prop = GetProperty(Name); - if(prop){ + if (prop) + { prop->SetValue(value); return true; - }else{ + } + else + { return false; } } Modified: trunk/jazz/src/mswin/WindowsMidiInterface.cpp =================================================================== --- trunk/jazz/src/mswin/WindowsMidiInterface.cpp 2010-04-28 21:32:14 UTC (rev 773) +++ trunk/jazz/src/mswin/WindowsMidiInterface.cpp 2010-04-28 21:36:26 UTC (rev 774) @@ -160,7 +160,7 @@ now = (long)timeGetTime(); - switch(wMsg) + switch (wMsg) { case MIM_DATA: // ignore active sensing and real time messages except midi stop @@ -271,7 +271,7 @@ now = (long)timeGetTime(); - switch(wMsg) + switch (wMsg) { case MIM_DATA: if ( dwParam1 == 0xf8 ) @@ -399,7 +399,7 @@ now = (long)timeGetTime(); - switch(wMsg) + switch (wMsg) { case MIM_DATA: Modified: trunk/jazz/src/mswin/WindowsPlayer.cpp =================================================================== --- trunk/jazz/src/mswin/WindowsPlayer.cpp 2010-04-28 21:32:14 UTC (rev 773) +++ trunk/jazz/src/mswin/WindowsPlayer.cpp 2010-04-28 21:36:26 UTC (rev 774) @@ -214,7 +214,7 @@ JZEvent* pEvent = 0; - switch(u.c[0] & 0xf0) + switch (u.c[0] & 0xf0) { case 0x80: pEvent = new JZKeyOffEvent(0, u.c[0] & 0x0f, u.c[1]); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |