From: <pst...@us...> - 2011-07-28 13:25:15
|
Revision: 847 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=847&view=rev Author: pstieber Date: 2011-07-28 13:25:07 +0000 (Thu, 28 Jul 2011) Log Message: ----------- Removed the old clock code. Modified Paths: -------------- trunk/jazz/src/Makefile.am Removed Paths: ------------- trunk/jazz/src/ClockDialog.cpp trunk/jazz/src/ClockDialog.h Deleted: trunk/jazz/src/ClockDialog.cpp =================================================================== --- trunk/jazz/src/ClockDialog.cpp 2011-07-28 12:52:40 UTC (rev 846) +++ trunk/jazz/src/ClockDialog.cpp 2011-07-28 13:25:07 UTC (rev 847) @@ -1,67 +0,0 @@ -//***************************************************************************** -// 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-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 -// 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 "ClockDialog.h" - -#include "Song.h" -#include "DeprecatedStringUtils.h" -#include "DeprecatedWx/proplist.h" - -#include <string> - -using namespace std; - -//***************************************************************************** -// Description: -// This is the clock dialog class declaration. -//***************************************************************************** -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -JZClockDialog::JZClockDialog(JZSong* pSong, const char* pTitle, int Clock) -{ - pSong->ClockToString(Clock, mString); - mpTitle = pTitle; - mpSong = pSong; -} - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -JZClockDialog::~JZClockDialog() -{ -} - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -wxProperty* JZClockDialog::mkProperty() -{ - return new wxProperty( - mpTitle, - wxPropertyValue((char**)&mString.c_str()), - "string"); -} - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -int JZClockDialog::GetClock() -{ - return mpSong->StringToClock(mString.c_str()); -} Deleted: trunk/jazz/src/ClockDialog.h =================================================================== --- trunk/jazz/src/ClockDialog.h 2011-07-28 12:52:40 UTC (rev 846) +++ trunk/jazz/src/ClockDialog.h 2011-07-28 13:25:07 UTC (rev 847) @@ -1,54 +0,0 @@ -//***************************************************************************** -// 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-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 -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -//***************************************************************************** - -#ifndef JZ_CLOCKDIALOG_H -#define JZ_CLOCKDIALOG_H - -class JZSong; -class wxProperty; - -//***************************************************************************** -//***************************************************************************** -class JZClockDialog -{ - public: - - JZClockDialog(JZSong* pSong, const char* pTitle, int Clock); - - ~JZClockDialog(); - -// wxFormItem *mkFormItem(int w); - - wxProperty* mkProperty(); - - int GetClock(); - - private: - - char* mpString; - - const char* mpTitle; - - JZSong* mpSong; -}; - -#endif // !defined(JZ_CLOCKDIALOG_H) Modified: trunk/jazz/src/Makefile.am =================================================================== --- trunk/jazz/src/Makefile.am 2011-07-28 12:52:40 UTC (rev 846) +++ trunk/jazz/src/Makefile.am 2011-07-28 13:25:07 UTC (rev 847) @@ -14,7 +14,6 @@ AsciiMidiFile.cpp \ Audio.cpp \ AudioDriver.cpp \ -ClockDialog.cpp \ Command.cpp \ Configuration.cpp \ ControlEdit.cpp \ @@ -112,7 +111,6 @@ AboutDialog.cpp \ AsciiMidiFile.cpp \ Audio.cpp \ -ClockDialog.cpp \ Command.cpp \ Configuration.cpp \ ControlEdit.cpp \ @@ -215,7 +213,6 @@ AsciiMidiFile.h \ Audio.h \ AudioDriver.h \ -ClockDialog.h \ Command.h \ Configuration.h \ ControlEdit.h \ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2011-08-05 01:44:35
|
Revision: 878 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=878&view=rev Author: pstieber Date: 2011-08-05 01:44:29 +0000 (Fri, 05 Aug 2011) Log Message: ----------- Changed to use wxStrings. Modified Paths: -------------- trunk/jazz/src/NamedChoice.cpp trunk/jazz/src/NamedChoice.h Modified: trunk/jazz/src/NamedChoice.cpp =================================================================== --- trunk/jazz/src/NamedChoice.cpp 2011-08-05 01:42:09 UTC (rev 877) +++ trunk/jazz/src/NamedChoice.cpp 2011-08-05 01:44:29 UTC (rev 878) @@ -29,7 +29,7 @@ JZNamedChoice::JZNamedChoice( const char* pTitle, - const std::vector<std::pair<std::string, int> >& Pairs, + const std::vector<std::pair<wxString, int> >& Pairs, int* pResult) : //mpTitle(pTitle), mPairs(Pairs), @@ -74,16 +74,16 @@ // Return a string list validator to use in the wxproplist dialogs. wxStringListValidator* JZNamedChoice::GetStringListValidator() { - wxStringList* StringList = new wxStringList(); + wxArrayString* StringList = new wxArrayString(); for ( - vector<pair<string, int> >::const_iterator iPair = mPairs.begin(); + vector<pair<wxString, int> >::const_iterator iPair = mPairs.begin(); iPair != mPairs.end(); ++iPair) { // Omit empty entries. if (!iPair->first.empty()) { - StringList->Add(wxString(iPair->first.c_str())); + StringList->Add(iPair->first); } } return new wxStringListValidator(StringList); @@ -92,7 +92,7 @@ void JZNamedChoice::GetValue() { for ( - vector<pair<string, int> >::const_iterator iPair = mPairs.begin(); + vector<pair<wxString, int> >::const_iterator iPair = mPairs.begin(); iPair != mPairs.end(); ++iPair) { @@ -107,7 +107,7 @@ void JZNamedChoice::SetValue() { for ( - vector<pair<string, int> >::const_iterator iPair = mPairs.begin(); + vector<pair<wxString, int> >::const_iterator iPair = mPairs.begin(); iPair != mPairs.end(); ++iPair) { Modified: trunk/jazz/src/NamedChoice.h =================================================================== --- trunk/jazz/src/NamedChoice.h 2011-08-05 01:42:09 UTC (rev 877) +++ trunk/jazz/src/NamedChoice.h 2011-08-05 01:44:29 UTC (rev 878) @@ -40,7 +40,7 @@ JZNamedChoice( const char* pTitle, - const std::vector<std::pair<std::string, int> >& Pairs, + const std::vector<std::pair<wxString, int> >& Pairs, int* pResult); virtual ~JZNamedChoice(); @@ -57,7 +57,7 @@ // char* mpTitle; - const std::vector<std::pair<std::string, int> >& mPairs; + const std::vector<std::pair<wxString, int> >& mPairs; std::string mSelection; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2011-08-05 20:44:45
|
Revision: 890 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=890&view=rev Author: pstieber Date: 2011-08-05 20:44:39 +0000 (Fri, 05 Aug 2011) Log Message: ----------- Converted std::string to wxString. Modified Paths: -------------- trunk/jazz/src/MidiDeviceDialog.cpp trunk/jazz/src/MidiDeviceDialog.h Modified: trunk/jazz/src/MidiDeviceDialog.cpp =================================================================== --- trunk/jazz/src/MidiDeviceDialog.cpp 2011-08-05 20:42:36 UTC (rev 889) +++ trunk/jazz/src/MidiDeviceDialog.cpp 2011-08-05 20:44:39 UTC (rev 890) @@ -41,7 +41,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- JZMidiDeviceDialog::JZMidiDeviceDialog( - const vector<pair<string, int> >& MidiDevices, + const vector<pair<wxString, int> >& MidiDevices, int& DeviceIndex, wxWindow* pParent, const wxString& Title) @@ -52,13 +52,13 @@ mpMidiDeviceListBox = new wxListBox(this, wxID_ANY); for ( - vector<pair<string, int> >::const_iterator iMidiDevice = + vector<pair<wxString, int> >::const_iterator iMidiDevice = MidiDevices.begin(); iMidiDevice != MidiDevices.end(); ++iMidiDevice) { - const string& MidiDeviceName = iMidiDevice->first; - mpMidiDeviceListBox->Append(MidiDeviceName.c_str()); + const wxString& MidiDeviceName = iMidiDevice->first; + mpMidiDeviceListBox->Append(MidiDeviceName); } if (mDeviceIndex < static_cast<int>(mpMidiDeviceListBox->GetCount())) Modified: trunk/jazz/src/MidiDeviceDialog.h =================================================================== --- trunk/jazz/src/MidiDeviceDialog.h 2011-08-05 20:42:36 UTC (rev 889) +++ trunk/jazz/src/MidiDeviceDialog.h 2011-08-05 20:44:39 UTC (rev 890) @@ -26,7 +26,6 @@ #include <wx/dialog.h> #include <vector> -#include <string> class wxListBox; @@ -39,7 +38,7 @@ public: JZMidiDeviceDialog( - const std::vector<std::pair<std::string, int> >& MidiDevices, + const std::vector<std::pair<wxString, int> >& MidiDevices, int& DeviceIndex, wxWindow* pParent = 0, const wxString& Title = wxEmptyString); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2011-08-06 21:28:20
|
Revision: 898 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=898&view=rev Author: pstieber Date: 2011-08-06 21:28:14 +0000 (Sat, 06 Aug 2011) Log Message: ----------- Removed empty event table code. Modified Paths: -------------- trunk/jazz/src/JazzPlusPlusApplication.cpp trunk/jazz/src/JazzPlusPlusApplication.h Modified: trunk/jazz/src/JazzPlusPlusApplication.cpp =================================================================== --- trunk/jazz/src/JazzPlusPlusApplication.cpp 2011-08-06 16:52:31 UTC (rev 897) +++ trunk/jazz/src/JazzPlusPlusApplication.cpp 2011-08-06 21:28:14 UTC (rev 898) @@ -78,11 +78,6 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -BEGIN_EVENT_TABLE(JZJazzPlusPlusApplication, wxApp) -END_EVENT_TABLE() - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- JZJazzPlusPlusApplication::JZJazzPlusPlusApplication() : wxApp(), mpProject(0), Modified: trunk/jazz/src/JazzPlusPlusApplication.h =================================================================== --- trunk/jazz/src/JazzPlusPlusApplication.h 2011-08-06 16:52:31 UTC (rev 897) +++ trunk/jazz/src/JazzPlusPlusApplication.h 2011-08-06 21:28:14 UTC (rev 898) @@ -106,8 +106,6 @@ JZTrackFrame* mpTrackFrame; mutable wxHtmlHelpController mHelp; - - DECLARE_EVENT_TABLE() }; DECLARE_APP(JZJazzPlusPlusApplication) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2011-08-06 22:29:10
|
Revision: 899 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=899&view=rev Author: pstieber Date: 2011-08-06 22:29:04 +0000 (Sat, 06 Aug 2011) Log Message: ----------- Creation of a timer relies on access to application traits in wx 2.9. Access to application traits requires the setting of the global application instance. The old code had a static instance of a JZListen class that was derived from wxTimer. This object was created before the application and this was causing problems. I changed the JZListen class to be implemented as a singleton. Modified Paths: -------------- trunk/jazz/src/PianoWindow.cpp trunk/jazz/src/PianoWindow.h Modified: trunk/jazz/src/PianoWindow.cpp =================================================================== --- trunk/jazz/src/PianoWindow.cpp 2011-08-06 21:28:14 UTC (rev 898) +++ trunk/jazz/src/PianoWindow.cpp 2011-08-06 22:29:04 UTC (rev 899) @@ -52,8 +52,32 @@ //***************************************************************************** //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- +JZListen* JZListen::mpInstance = 0; + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +JZListen* JZListen::Instance() +{ + if (!mpInstance) + { + mpInstance = new JZListen; + } + return mpInstance; +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZListen::Destroy() +{ + delete mpInstance; + mpInstance = 0; +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- JZListen::JZListen() - : mActive(false), + : wxTimer(), + mActive(false), mPitch(-1), mChannel(-1), mpTrack(0) @@ -635,7 +659,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -JZListen JZPianoWindow::mListen; +//JZListen JZPianoWindow::mListen; //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- @@ -3042,7 +3066,7 @@ } else { - mListen.KeyOn( + JZListen::Instance()->KeyOn( pTrack, pKeyOn->GetKey(), pKeyOn->GetChannel(), @@ -3137,7 +3161,7 @@ } else { - mListen.KeyOn( + JZListen::Instance()->KeyOn( pTrack, pKeyOn->GetKey(), pKeyOn->GetChannel(), Modified: trunk/jazz/src/PianoWindow.h =================================================================== --- trunk/jazz/src/PianoWindow.h 2011-08-06 21:28:14 UTC (rev 898) +++ trunk/jazz/src/PianoWindow.h 2011-08-06 22:29:04 UTC (rev 899) @@ -43,19 +43,27 @@ { public: - JZListen(); + static JZListen* Instance(); + static void Destroy(); + void KeyOn( - JZTrack *t, + JZTrack* pTrack, int Pitch, int Channel, int Velocity = 64, int MilliSeconds = 100); - void Notify(); + virtual void Notify(); private: + JZListen(); + + private: + + static JZListen* mpInstance; + bool mActive; int mPitch, mChannel; @@ -293,7 +301,7 @@ private: - static JZListen mListen; +// static JZListen mListen; JZTrack* mpTrack; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2011-08-08 00:13:06
|
Revision: 903 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=903&view=rev Author: pstieber Date: 2011-08-08 00:13:00 +0000 (Mon, 08 Aug 2011) Log Message: ----------- Made updates to the frequency table code. Modified Paths: -------------- trunk/jazz/src/FrequencyTable.cpp trunk/jazz/src/FrequencyTable.h trunk/jazz/src/Signal2.cpp Modified: trunk/jazz/src/FrequencyTable.cpp =================================================================== --- trunk/jazz/src/FrequencyTable.cpp 2011-08-07 23:17:05 UTC (rev 902) +++ trunk/jazz/src/FrequencyTable.cpp 2011-08-08 00:13:00 UTC (rev 903) @@ -27,27 +27,31 @@ using namespace std; -FreqTab::FreqTab() +//***************************************************************************** +//***************************************************************************** +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +JZFrequencyTable::JZFrequencyTable() { - double fac = pow(2.0, 1.0 / 12.0); - double frq = 440 * pow(fac, 3.0) / 32.0; - tab.reserve(128); - for (int i = 0; i < 128; i++) + double Factor = pow(2.0, 1.0 / 12.0); + double Frequency = 440 * pow(Factor, 3.0) / 32.0; + mFrequencyTable.reserve(128); + for (int i = 0; i < 128; ++i) { - tab.push_back(frq); - frq *= fac; + mFrequencyTable.push_back(Frequency); + Frequency *= Factor; } } -inline double dabs(double a, double b) +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +size_t JZFrequencyTable::GetKey(double Frequency) { - return a > b ? a - b : b - a; -} + // Do a binary search. + vector<double>::iterator Position = + lower_bound(mFrequencyTable.begin(), mFrequencyTable.end(), Frequency); -int FreqTab::key(double f) -{ - // do a binary search - vector<double>::iterator pos = lower_bound(tab.begin(), tab.end(), f); - // todo: if f is only a very little bigger than *pos, f is nearer to pos-1 - return pos - tab.begin(); + // TODO: If Frequency is only a very little bigger than *Position, Frequency + // is nearer to Position - 1. + return Position - mFrequencyTable.begin(); } Modified: trunk/jazz/src/FrequencyTable.h =================================================================== --- trunk/jazz/src/FrequencyTable.h 2011-08-07 23:17:05 UTC (rev 902) +++ trunk/jazz/src/FrequencyTable.h 2011-08-08 00:13:00 UTC (rev 903) @@ -25,22 +25,24 @@ #include <vector> -class FreqTab +//***************************************************************************** +//***************************************************************************** +class JZFrequencyTable { public: - FreqTab(); + JZFrequencyTable(); - int key(double frq); + size_t GetKey(double Frequency); - double freq(int key) const + double GetFrequency(int Key) const { - return tab[key]; + return mFrequencyTable[Key]; } private: - std::vector<double> tab; + std::vector<double> mFrequencyTable; }; #endif // !defined(JZ_FREQUENCYTABLE_H) Modified: trunk/jazz/src/Signal2.cpp =================================================================== --- trunk/jazz/src/Signal2.cpp 2011-08-07 23:17:05 UTC (rev 902) +++ trunk/jazz/src/Signal2.cpp 2011-08-08 00:13:00 UTC (rev 903) @@ -190,20 +190,20 @@ } void sig_wavsynth( - JZSample &spl, // destin - double duration, // length in seconds - int midi_key, // base frequency + JZSample &spl, // destin + double duration, // length in seconds + int midi_key, // base frequency double fshift, // frequeny modulation factor, 0 = off - int ntables, // number of wavetables to be mixed - JZRndArray *arr[][4], // (fft, vol, pitch, pan) * N + int ntables, // number of wavetables to be mixed + JZRndArray *arr[][4], // (fft, vol, pitch, pan) * N int noisegen // first array is noise filter ) { long sr = spl.GetSamplingRate(); long ch = spl.GetChannelCount(); JZSigSynth synth(sr, ch); - FreqTab ft; - double freq = ft.freq(midi_key); + JZFrequencyTable FrequencyTable; + double freq = FrequencyTable.GetFrequency(midi_key); JZFloatSample obuf(ch, sr); tFloatIter *osig = new tFloatIter(synth, obuf); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2011-08-08 04:12:05
|
Revision: 907 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=907&view=rev Author: pstieber Date: 2011-08-08 04:11:58 +0000 (Mon, 08 Aug 2011) Log Message: ----------- Changed int to long because they are the same size even on a 64-bit Windows platform. 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/PortMidiPlayer.cpp trunk/jazz/src/PortMidiPlayer.h trunk/jazz/src/mswin/WindowsAudioInterface.cpp trunk/jazz/src/mswin/WindowsAudioInterface.h trunk/jazz/src/mswin/WindowsConsole.cpp trunk/jazz/src/mswin/WindowsMidiInterface.cpp trunk/jazz/src/mswin/WindowsMidiInterface.h trunk/jazz/src/mswin/WindowsPlayer.cpp trunk/jazz/src/mswin/WindowsPlayer.h Modified: trunk/jazz/src/Audio.cpp =================================================================== --- trunk/jazz/src/Audio.cpp 2011-08-08 01:09:19 UTC (rev 906) +++ trunk/jazz/src/Audio.cpp 2011-08-08 04:11:58 UTC (rev 907) @@ -622,7 +622,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZSampleSet::StartPlay(long clock) +void JZSampleSet::StartPlay(int clock) { ReloadSamples(); Modified: trunk/jazz/src/Audio.h =================================================================== --- trunk/jazz/src/Audio.h 2011-08-08 01:09:19 UTC (rev 906) +++ trunk/jazz/src/Audio.h 2011-08-08 04:11:58 UTC (rev 907) @@ -344,7 +344,7 @@ virtual const std::string& GetSampleLabel(int Index); - void StartPlay(long clock); + void StartPlay(int clock); void StopPlay(); Modified: trunk/jazz/src/Player.cpp =================================================================== --- trunk/jazz/src/Player.cpp 2011-08-08 01:09:19 UTC (rev 906) +++ trunk/jazz/src/Player.cpp 2011-08-08 04:11:58 UTC (rev 907) @@ -107,7 +107,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZPlayLoop::Set(long Start, long Stop) +void JZPlayLoop::Set(int Start, int Stop) { mStartClock = Start; mStopClock = Stop; @@ -115,7 +115,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -long JZPlayLoop::Ext2IntClock(long Clock) +int JZPlayLoop::Ext2IntClock(int Clock) { if (mStopClock) { @@ -126,7 +126,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -long JZPlayLoop::Int2ExtClock(long Clock) +int JZPlayLoop::Int2ExtClock(int Clock) { return Clock; } @@ -138,8 +138,8 @@ void JZPlayLoop::PrepareOutput( JZEventArray* pEventArray, JZSong* pSong, - long ExtFr, - long ExtTo, + int ExtFr, + int ExtTo, bool AudioMode) { if (pEventArray == 0) @@ -147,9 +147,9 @@ return; } - long From = Ext2IntClock(ExtFr); - long Delta = ExtFr - From; - long Size = ExtTo - ExtFr; + int From = Ext2IntClock(ExtFr); + int Delta = ExtFr - From; + int Size = ExtTo - ExtFr; while (mStopClock && From + Size > mStopClock) { pSong->MergeTracks( @@ -209,7 +209,7 @@ void JZPlayer::Notify() { // called by timer - long Now = GetRealTimeClock(); + int Now = GetRealTimeClock(); #ifdef DEBUG_PLAYER_NOTIFY cout << "JZPlayer::Notify " << Now << endl; @@ -301,7 +301,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZPlayer::StartPlay(long Clock, long LoopClock, int Continue) +void JZPlayer::StartPlay(int Clock, int LoopClock, int Continue) { #ifdef DEBUG_PLAYER_STARTPLAY cout << "JZPlayer::StartPlay" << endl; @@ -608,7 +608,7 @@ Stop(); mPlaying = false; - long Clock = GetRealTimeClock(); + int Clock = GetRealTimeClock(); // SN++ Patch: Notes off for not GM/GS devices int ii; @@ -798,9 +798,9 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZMpuPlayer::StartPlay(long IntClock, long LoopClock, int Continue) +void JZMpuPlayer::StartPlay(int IntClock, int LoopClock, int Continue) { - long ExtClock = mpPlayLoop->Int2ExtClock(IntClock); + int ExtClock = mpPlayLoop->Int2ExtClock(IntClock); char *play; int playsize; @@ -1025,7 +1025,7 @@ ActiveTrack = 6; } - long Time = pEvent->GetClock() - TrackClock[ActiveTrack]; + int Time = pEvent->GetClock() - TrackClock[ActiveTrack]; assert(Time < 240); if (Stat != TrackRunningStatus[ActiveTrack]) @@ -1081,7 +1081,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZMpuPlayer::OutBreak(long BreakOver) +void JZMpuPlayer::OutBreak(int BreakOver) { int OverFlow = 1; @@ -1183,7 +1183,7 @@ //----------------------------------------------------------------------------- // try to send all out of band events up to Clock to device //----------------------------------------------------------------------------- -void JZMpuPlayer::FlushOutOfBand(long Clock) +void JZMpuPlayer::FlushOutOfBand(int Clock) { JZEventIterator Iterator(&OutOfBandEvents); JZEvent* pEvent = Iterator.Range(0, Clock); @@ -1229,10 +1229,10 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -long JZMpuPlayer::GetRealTimeClock() +int JZMpuPlayer::GetRealTimeClock() { static int receiving_song_ptr = 0; - static long d0, d1; + static int d0, d1; int c; while ((c = RecBytes.Get(dev)) >= 0) { @@ -1278,7 +1278,7 @@ // Song pointer received receiving_song_ptr++; - long ExtClock; + int ExtClock; switch (receiving_song_ptr) { @@ -1306,7 +1306,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -long JZMpuPlayer::GetRecordedData() +int JZMpuPlayer::GetRecordedData() { int c, i; unsigned char *recbuf = NULL; @@ -1862,7 +1862,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZSeq2Player::OutBreak(long clock) +void JZSeq2Player::OutBreak(int clock) { if (play_clock < clock) { @@ -1892,7 +1892,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZSeq2Player::StartPlay(long Clock, long LoopClock, int Continue) +void JZSeq2Player::StartPlay(int Clock, int LoopClock, int Continue) { char buf[512]; cout<<"JZSeq2Player::StartPlay"<<endl; @@ -2018,7 +2018,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -long JZSeq2Player::GetRealTimeClock() +int JZSeq2Player::GetRealTimeClock() { unsigned char buf[256]; int size; @@ -2036,7 +2036,7 @@ { case TMR_WAIT_ABS: case TMR_ECHO: - recd_clock = *(unsigned long *)&buf[i+4] + start_clock; + recd_clock = *(unsigned int *)&buf[i+4] + start_clock; break; default: Modified: trunk/jazz/src/Player.h =================================================================== --- trunk/jazz/src/Player.h 2011-08-08 01:09:19 UTC (rev 906) +++ trunk/jazz/src/Player.h 2011-08-08 04:11:58 UTC (rev 907) @@ -102,30 +102,30 @@ JZPlayLoop(); - void Set(long Start, long Stop); + void Set(int Start, int Stop); void Reset(); // external clock -> internal clock where // external clock == physical clock // internal clock == song position - long Ext2IntClock(long Clock); + int Ext2IntClock(int Clock); // the other way round - long Int2ExtClock(long Clock); + int Int2ExtClock(int Clock); void PrepareOutput( JZEventArray* pEventArray, JZSong* pSong, - long ExtFr, - long ExtTo, + int ExtFr, + int ExtTo, bool AudioMode = false); private: - long mStartClock; + int mStartClock; - long mStopClock; + int mStopClock; }; //***************************************************************************** @@ -163,9 +163,9 @@ void OutNow(JZTrack* t, JZParam* r); // what's played right now? - virtual long GetRealTimeClock() = 0; + virtual int GetRealTimeClock() = 0; - virtual void StartPlay(long Clock, long LoopClock = 0, int Continue = 0); + virtual void StartPlay(int Clock, int LoopClock = 0, int Continue = 0); virtual void StopPlay(); virtual void AllNotesOff(bool Reset = false); @@ -255,7 +255,7 @@ virtual void ListenAudio(int key, int start_stop_mode = 1) { } - virtual void ListenAudio(JZSample &spl, long fr_smpl, long to_smpl) + virtual void ListenAudio(JZSample &spl, int fr_smpl, int to_smpl) { } virtual bool IsListening() const @@ -270,7 +270,7 @@ virtual void AdjustAudioLength(JZTrack *t) { - long ticks_per_minute = mpSong->GetTicksPerQuarter() * mpSong->Speed(); + int ticks_per_minute = mpSong->GetTicksPerQuarter() * mpSong->Speed(); mSamples.AdjustAudioLength(t, ticks_per_minute); } @@ -291,7 +291,7 @@ mSamples.Edit(key); } - virtual long GetListenerPlayPosition() + virtual int GetListenerPlayPosition() { return -1L; } @@ -307,7 +307,7 @@ protected: - long mOutClock; + int mOutClock; JZPlayLoop* mpPlayLoop; @@ -354,7 +354,7 @@ public: - long Clock; + int Clock; int RunningStatus; void Clear() @@ -398,9 +398,9 @@ return (int)sizeof(Buffer) - Written; } - void PutVar(long val) + void PutVar(int val) { - unsigned long buf; + unsigned int buf; buf = val & 0x7f; while ((val >>= 7) > 0) { @@ -419,9 +419,9 @@ } } - long GetVar(int dev) + int GetVar(int dev) { - unsigned long val; + unsigned int val; int c; val = Get(dev); if (val & 0x80) @@ -504,11 +504,11 @@ int dev; JZBuffer PlyBytes; JZBuffer RecBytes; - long playclock; + int playclock; int clock_to_host_counter; int ActiveTrack; - long TrackClock[ACTIVE_TRACKS]; + int TrackClock[ACTIVE_TRACKS]; int TrackRunningStatus[ACTIVE_TRACKS]; JZEventArray OutOfBandEvents; @@ -520,15 +520,15 @@ int OutEvent(JZEvent *e); void OutNow(JZEvent *e); void OutBreak(); - void OutBreak(long BreakOver); - void StartPlay(long Clock, long LoopClock = 0, int Continue = 0); + void OutBreak(int BreakOver); + void StartPlay(int Clock, int LoopClock = 0, int Continue = 0); void StopPlay(); - long GetRealTimeClock(); + int GetRealTimeClock(); virtual bool IsInstalled(); - long GetRecordedData(); + int GetRecordedData(); void SetHardThru(int on, int idev, int odev); - void FlushOutOfBand( long Clock ); + void FlushOutOfBand( int Clock ); }; #define TRK (0<<6) @@ -576,7 +576,7 @@ { } - void StartPlay(long Clock, long LoopClock = 0, int Continue = 0) + void StartPlay(int Clock, int LoopClock = 0, int Continue = 0) { } @@ -584,7 +584,7 @@ { } - long GetRealTimeClock() + int GetRealTimeClock() { return 0; } @@ -636,20 +636,20 @@ OutEvent(e, 1); } void OutBreak(); - void OutBreak(long BreakOver); - void StartPlay(long Clock, long LoopClock = 0, int Continue = 0); + void OutBreak(int BreakOver); + void StartPlay(int Clock, int LoopClock = 0, int Continue = 0); void StopPlay(); - long GetRealTimeClock(); + int GetRealTimeClock(); virtual void FlushToDevice(); void SetSoftThru(int on, int idev, int odev); int FindMidiDevice(); protected: - long play_clock; - long recd_clock; - long start_clock; - long echo_clock; + int play_clock; + int recd_clock; + int start_clock; + int echo_clock; JZOssThru *through; int card_id; Modified: trunk/jazz/src/PortMidiPlayer.cpp =================================================================== --- trunk/jazz/src/PortMidiPlayer.cpp 2011-08-08 01:09:19 UTC (rev 906) +++ trunk/jazz/src/PortMidiPlayer.cpp 2011-08-08 04:11:58 UTC (rev 907) @@ -401,7 +401,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -long JZPortMidiPlayer::GetRealTimeClock() +int JZPortMidiPlayer::GetRealTimeClock() { long t = Pt_Time(); Modified: trunk/jazz/src/PortMidiPlayer.h =================================================================== --- trunk/jazz/src/PortMidiPlayer.h 2011-08-08 01:09:19 UTC (rev 906) +++ trunk/jazz/src/PortMidiPlayer.h 2011-08-08 04:11:58 UTC (rev 907) @@ -36,7 +36,7 @@ void StartPlay(int Clock, int LoopClock = 0, int Continue = 0); void StopPlay(); - long GetRealTimeClock(); + int GetRealTimeClock(); int Clock2Time(int clock); int Time2Clock(int time); void SetTempo(int bpm, int clock); Modified: trunk/jazz/src/mswin/WindowsAudioInterface.cpp =================================================================== --- trunk/jazz/src/mswin/WindowsAudioInterface.cpp 2011-08-08 01:09:19 UTC (rev 906) +++ trunk/jazz/src/mswin/WindowsAudioInterface.cpp 2011-08-08 04:11:58 UTC (rev 907) @@ -76,8 +76,8 @@ JZAudioListener( JZWindowsAudioPlayer* pPlayer, JZSample& spl, - long fr_smpl, - long to_smpl) + int fr_smpl, + int to_smpl) : wxTimer(), mpPlayer(pPlayer), mCount(0), @@ -123,7 +123,7 @@ } } - long GetPlayPosition() + int GetPlayPosition() { MMTIME mmtime; mmtime.wType = TIME_SAMPLES; @@ -135,11 +135,11 @@ JZWindowsAudioPlayer* mpPlayer; - long mCount; + int mCount; bool mHardExit; - long mChannels; + int mChannels; }; //----------------------------------------------------------------------------- @@ -556,13 +556,13 @@ res = waveOutGetPosition(hout, &mmtime, sizeof(mmtime)); if (res == MMSYSERR_NOERROR && mmtime.wType == TIME_SAMPLES) { - long time_now = (long)timeGetTime(); - long audio_now = (long)( + int time_now = (int)timeGetTime(); + int audio_now = (int)( (double)start_time + 1000.0 * mmtime.u.sample / mSamples.GetSamplingRate()); // low pass filter for time-correction (not really necessary) - const long low = 50; + const int low = 50; mpState->time_correction = (low * mpState->time_correction + (100 - low) * (audio_now - time_now) ) / 100L; @@ -609,13 +609,13 @@ res = waveInGetPosition(hinp, &mmtime, sizeof(mmtime)); if (res == MMSYSERR_NOERROR && mmtime.wType == TIME_SAMPLES) { - long time_now = (long)timeGetTime(); - long audio_now = (long)( + int time_now = (int)timeGetTime(); + int audio_now = (int)( (double)mpState->start_time + 1000.0 * mmtime.u.sample / mSamples.GetSamplingRate()); // Low pass filter for time-correction (not really necessary). - const long low = 50; + const int low = 50; mpState->time_correction = (low * mpState->time_correction + (100 - low) * (audio_now - time_now)) / 100L; @@ -631,7 +631,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZWindowsAudioPlayer::StartPlay(long Clock, long LoopClock, int Continue) +void JZWindowsAudioPlayer::StartPlay(int Clock, int LoopClock, int Continue) { mSamples.StartPlay(Clock); JZWindowsIntPlayer::StartPlay(Clock, LoopClock, Continue); @@ -665,11 +665,11 @@ mSamples.StopPlay(); if (RecordMode()) { - long frc = mpRecordingInfo->mFromClock; + int frc = mpRecordingInfo->mFromClock; if (frc < start_clock) frc = start_clock; - long toc = mpRecordingInfo->mToClock; - long play_clock = Time2Clock(mpState->play_time); + int toc = mpRecordingInfo->mToClock; + int play_clock = Time2Clock(mpState->play_time); if (toc > play_clock) toc = play_clock; mSamples.SaveRecordingDlg(frc, toc, recbuffers); @@ -712,8 +712,8 @@ //----------------------------------------------------------------------------- void JZWindowsAudioPlayer::ListenAudio( JZSample &spl, - long fr_smpl, - long to_smpl) + int fr_smpl, + int to_smpl) { if (!mAudioEnabled) { @@ -736,11 +736,11 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -long JZWindowsAudioPlayer::GetListenerPlayPosition() +int JZWindowsAudioPlayer::GetListenerPlayPosition() { if (!mpListener) { - return -1L; + return -1; } return mpListener->GetPlayPosition(); } Modified: trunk/jazz/src/mswin/WindowsAudioInterface.h =================================================================== --- trunk/jazz/src/mswin/WindowsAudioInterface.h 2011-08-08 01:09:19 UTC (rev 906) +++ trunk/jazz/src/mswin/WindowsAudioInterface.h 2011-08-08 04:11:58 UTC (rev 907) @@ -60,7 +60,7 @@ virtual void Notify(); - virtual void StartPlay(long Clock, long LoopClock = 0, int Continue = 0); + virtual void StartPlay(int Clock, int LoopClock = 0, int Continue = 0); virtual void StopPlay(); @@ -83,9 +83,9 @@ virtual void ListenAudio(int key, int start_stop_mode = 1); - virtual void ListenAudio(JZSample &spl, long fr_smpl, long to_smpl); + virtual void ListenAudio(JZSample &spl, int fr_smpl, int to_smpl); - virtual long GetListenerPlayPosition(); + virtual int GetListenerPlayPosition(); virtual bool IsListening() const { @@ -141,11 +141,11 @@ // A value of false means MIDI only. bool mAudioEnabled; - long blocks_played; // # of blocks written to device + int blocks_played; // # of blocks written to device int play_buffers_needed; // driver requests more output buffers - long start_clock; // when did play start - long start_time; // play start time (not altered by SetTempo) + int start_clock; // when did play start + int start_time; // play start time (not altered by SetTempo) JZAudioListener* mpListener; HWAVEOUT hout; Modified: trunk/jazz/src/mswin/WindowsConsole.cpp =================================================================== --- trunk/jazz/src/mswin/WindowsConsole.cpp 2011-08-08 01:09:19 UTC (rev 906) +++ trunk/jazz/src/mswin/WindowsConsole.cpp 2011-08-08 04:11:58 UTC (rev 907) @@ -40,7 +40,7 @@ void RedirectIoToConsole() { int hConHandle; - long lStdHandle; + HANDLE lStdHandle; CONSOLE_SCREEN_BUFFER_INFO coninfo; FILE *fp; @@ -57,22 +57,22 @@ coninfo.dwSize); // redirect unbuffered STDOUT to the console - lStdHandle = (long)GetStdHandle(STD_OUTPUT_HANDLE); - hConHandle = _open_osfhandle(lStdHandle, _O_TEXT); + lStdHandle = GetStdHandle(STD_OUTPUT_HANDLE); + hConHandle = _open_osfhandle((intptr_t)lStdHandle, _O_TEXT); fp = _fdopen(hConHandle, "w"); *stdout = *fp; setvbuf(stdout, NULL, _IONBF, 0); // redirect unbuffered STDIN to the console - lStdHandle = (long)GetStdHandle(STD_INPUT_HANDLE); - hConHandle = _open_osfhandle(lStdHandle, _O_TEXT); + lStdHandle = GetStdHandle(STD_INPUT_HANDLE); + hConHandle = _open_osfhandle((intptr_t)lStdHandle, _O_TEXT); fp = _fdopen(hConHandle, "r"); *stdin = *fp; setvbuf(stdin, NULL, _IONBF, 0); // redirect unbuffered STDERR to the console - lStdHandle = (long)GetStdHandle(STD_ERROR_HANDLE); - hConHandle = _open_osfhandle(lStdHandle, _O_TEXT); + lStdHandle = GetStdHandle(STD_ERROR_HANDLE); + hConHandle = _open_osfhandle((intptr_t)lStdHandle, _O_TEXT); fp = _fdopen(hConHandle, "w"); *stderr = *fp; setvbuf(stderr, NULL, _IONBF, 0); Modified: trunk/jazz/src/mswin/WindowsMidiInterface.cpp =================================================================== --- trunk/jazz/src/mswin/WindowsMidiInterface.cpp 2011-08-08 01:09:19 UTC (rev 906) +++ trunk/jazz/src/mswin/WindowsMidiInterface.cpp 2011-08-08 04:11:58 UTC (rev 907) @@ -156,9 +156,9 @@ DWORD dwParam2) { tWinPlayerState *state = (tWinPlayerState *)dwInstance; - long now; + int now; - now = (long)timeGetTime(); + now = (int)timeGetTime(); switch (wMsg) { @@ -215,7 +215,7 @@ (void)state->thru_buffer.get(); } - state->play_time = (long)timeGetTime() + state->time_correction; + state->play_time = (int)timeGetTime() + state->time_correction; midi_event* m = state->play_buffer.peek(); while (m) @@ -253,15 +253,15 @@ } // compute delta time for next interrupt - long delay = 100; // default in millisec + int delay = 100; // default in millisec if (m) { - delay = (long)m->ref - (long)state->play_time; + delay = (int)m->ref - (int)state->play_time; } - if (delay < (long)state->min_timer_period) - delay = (long)state->min_timer_period; - else if (delay > (long)state->max_timer_period) - delay = (long)state->max_timer_period; + if (delay < (int)state->min_timer_period) + delay = (int)state->min_timer_period; + else if (delay > (int)state->max_timer_period) + delay = (int)state->max_timer_period; timeSetEvent( (UINT) delay, state->min_timer_period, @@ -279,9 +279,9 @@ DWORD dwParam2) { tWinPlayerState *state = (tWinPlayerState *)dwInstance; - long now; + int now; - now = (long)timeGetTime(); + now = (int)timeGetTime(); switch (wMsg) { @@ -348,9 +348,9 @@ (void)state->thru_buffer.get(); } - state->play_time = (long)timeGetTime(); + state->play_time = (int)timeGetTime(); /* How many ticks since last signal? */ - long delta_clock = ((state->play_time - state->signal_time) * 1000L) / state->time_per_tick; + int delta_clock = ((state->play_time - state->signal_time) * 1000L) / state->time_per_tick; if (delta_clock > (2 * state->ticks_per_signal)) /* Too many? */ { @@ -364,7 +364,7 @@ midi_event *m = state->play_buffer.peek(); while (m) { - if ((long)m->ref > state->play_clock) + if ((int)m->ref > state->play_clock) break; if (m->data) @@ -391,16 +391,16 @@ } // compute delta time for next interrupt - long delay = 100; // default in millisec + int delay = 100; // default in millisec if (m) { - delay = (((long)m->ref - state->play_clock) * state->time_per_tick) / 1000L; + delay = (((int)m->ref - state->play_clock) * state->time_per_tick) / 1000L; } - if (delay < (long)state->min_timer_period) - delay = (long)state->min_timer_period; - else if (delay > (long)state->max_timer_period) - delay = (long)state->max_timer_period; + if (delay < (int)state->min_timer_period) + delay = (int)state->min_timer_period; + else if (delay > (int)state->max_timer_period) + delay = (int)state->max_timer_period; timeSetEvent( (UINT) delay, @@ -419,9 +419,9 @@ DWORD dwParam2) { tWinPlayerState *state = (tWinPlayerState *)dwInstance; - long now; + int now; - now = (long)timeGetTime(); + now = (int)timeGetTime(); switch (wMsg) { @@ -476,7 +476,7 @@ state->mtc_start.type = ((u.c[1] & 0x06) >> 1); if (state->qfm_bits == 0xff) { - long mtc_time; + int mtc_time; state->signal_time = now; Mtc2Frames( state ); GetMtcTime( state, mtc_time ); @@ -495,7 +495,7 @@ { if (state->mtc_valid) { - long mtc_time; + int mtc_time; GetMtcTime( state, mtc_time ); state->recd_buffer.put(dwParam1, mtc_time + (now - state->signal_time) ); } @@ -549,7 +549,7 @@ (void)state->thru_buffer.get(); } - long now = (long)timeGetTime(); + int now = (int)timeGetTime(); if ( state->mtc_valid ) { GetMtcTime( state, state->play_time ); @@ -592,15 +592,15 @@ } // compute delta time for next interrupt - long delay = 100; // default in millisec + int delay = 100; // default in millisec if (m) { - delay = (long)m->ref - (long)state->play_time; + delay = (int)m->ref - (int)state->play_time; } - if (delay < (long)state->min_timer_period) - delay = (long)state->min_timer_period; - else if (delay > (long)state->max_timer_period) - delay = (long)state->max_timer_period; + if (delay < (int)state->min_timer_period) + delay = (int)state->min_timer_period; + else if (delay > (int)state->max_timer_period) + delay = (int)state->max_timer_period; timeSetEvent( (UINT) delay, state->min_timer_period, Modified: trunk/jazz/src/mswin/WindowsMidiInterface.h =================================================================== --- trunk/jazz/src/mswin/WindowsMidiInterface.h 2011-08-08 01:09:19 UTC (rev 906) +++ trunk/jazz/src/mswin/WindowsMidiInterface.h 2011-08-08 04:11:58 UTC (rev 907) @@ -320,16 +320,16 @@ HMIDIIN hinp; HMIDIOUT hout; - long start_time; - long play_time; - long start_clock; - long ticks_per_minute; + int start_time; + int play_time; + int start_clock; + int ticks_per_minute; - long play_clock; - long virtual_clock; - long ticks_per_signal; - long signal_time; - long time_per_tick; + int play_clock; + int virtual_clock; + int ticks_per_signal; + int signal_time; + int time_per_tick; tWinPlayerMtcTime mtc_start; DWORD mtc_frames; @@ -349,7 +349,7 @@ JZMidiQueue thru_buffer; JZWindowsAudioPlayer* audio_player; - long time_correction; + int time_correction; JZWinSysexBufferArray* isx_buffers; JZWinSysexBufferArray* osx_buffers; Modified: trunk/jazz/src/mswin/WindowsPlayer.cpp =================================================================== --- trunk/jazz/src/mswin/WindowsPlayer.cpp 2011-08-08 01:09:19 UTC (rev 906) +++ trunk/jazz/src/mswin/WindowsPlayer.cpp 2011-08-08 04:11:58 UTC (rev 907) @@ -369,21 +369,21 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -long JZWindowsPlayer::Clock2Time(long clock) +int JZWindowsPlayer::Clock2Time(int clock) { if (clock < mpState->start_clock) return mpState->start_time; - return (long)( (double)(clock - mpState->start_clock) * 60000.0 / + return (int)( (double)(clock - mpState->start_clock) * 60000.0 / (double)mpState->ticks_per_minute + mpState->start_time); } //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -long JZWindowsPlayer::Time2Clock(long time) +int JZWindowsPlayer::Time2Clock(int time) { if (time < mpState->start_time) return mpState->start_clock; - return (long)( + return (int)( (double)(time - mpState->start_time) * (double)mpState->ticks_per_minute / 60000.0 + mpState->start_clock); @@ -391,30 +391,30 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZWindowsPlayer::SetTempo(long bpm, long clock) +void JZWindowsPlayer::SetTempo(int bpm, int clock) { - long t1 = Clock2Time(clock); - mpState->ticks_per_minute = (long)bpm * (long)mpSong->GetTicksPerQuarter(); - long t2 = Clock2Time(clock); + int t1 = Clock2Time(clock); + mpState->ticks_per_minute = (int)bpm * (int)mpSong->GetTicksPerQuarter(); + int t2 = Clock2Time(clock); mpState->start_time += (t1 - t2); } //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -long JZWindowsPlayer::RealTimeClock2Time(long clock) +int JZWindowsPlayer::RealTimeClock2Time(int clock) { if (clock < mpState->start_clock) return real_start_time; - return (long)( (double)(clock - mpState->start_clock) * 60000.0 / (double)real_ticks_per_minute + real_start_time); + return (int)( (double)(clock - mpState->start_clock) * 60000.0 / (double)real_ticks_per_minute + real_start_time); } //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -long JZWindowsPlayer::Time2RealTimeClock(long time) +int JZWindowsPlayer::Time2RealTimeClock(int time) { if (time < real_start_time) return mpState->start_clock; - return (long)( + return (int)( (double)(time - real_start_time) * (double)real_ticks_per_minute / 60000.0 + mpState->start_clock); @@ -422,11 +422,11 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZWindowsPlayer::SetRealTimeTempo(long bpm, long clock) +void JZWindowsPlayer::SetRealTimeTempo(int bpm, int clock) { - long t1 = RealTimeClock2Time(clock); - real_ticks_per_minute = (long)bpm * (long)mpSong->GetTicksPerQuarter(); - long t2 = RealTimeClock2Time(clock); + int t1 = RealTimeClock2Time(clock); + real_ticks_per_minute = (int)bpm * (int)mpSong->GetTicksPerQuarter(); + int t2 = RealTimeClock2Time(clock); real_start_time += (t1 - t2); } @@ -532,7 +532,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZWindowsPlayer::FillMidiClocks(long to) +void JZWindowsPlayer::FillMidiClocks(int to) { while (midiClockOut <= to) { @@ -545,7 +545,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZWindowsPlayer::OutBreak(long clock) +void JZWindowsPlayer::OutBreak(int clock) { if (gpConfig->GetValue(C_RealTimeOut)) { @@ -560,7 +560,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZWindowsMidiPlayer::OutBreak(long clock) +void JZWindowsMidiPlayer::OutBreak(int clock) { if (gpConfig->GetValue(C_RealTimeOut)) { @@ -607,7 +607,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZWindowsPlayer::StartPlay(long Clock, long LoopClock, int Continue) +void JZWindowsPlayer::StartPlay(int Clock, int LoopClock, int Continue) { mpState->play_buffer.clear(); mpState->recd_buffer.clear(); @@ -637,7 +637,7 @@ } else { - mpState->start_time = (long)timeGetTime() + 500; + mpState->start_time = (int)timeGetTime() + 500; real_start_time = mpState->start_time; mpState->start_clock = Clock; } @@ -800,7 +800,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZWindowsPlayer::FlushToDevice(long clock) +void JZWindowsPlayer::FlushToDevice(int clock) { JZEventIterator Iterator(&mPlayBuffer); JZEvent* pEvent = Iterator.Range(0, clock); @@ -819,7 +819,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -long JZWindowsIntPlayer::GetRealTimeClock() +int JZWindowsIntPlayer::GetRealTimeClock() { while (!mpState->recd_buffer.empty()) { @@ -834,8 +834,8 @@ } } - long clock = Time2RealTimeClock( - (long)timeGetTime() + mpState->time_correction); + int clock = Time2RealTimeClock( + (int)timeGetTime() + mpState->time_correction); JZProjectManager::Instance()->NewPlayPosition( mpPlayLoop->Ext2IntClock(clock / 48 * 48)); @@ -865,9 +865,9 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -long JZWindowsMidiPlayer::GetRealTimeClock() +int JZWindowsMidiPlayer::GetRealTimeClock() { - long clock; + int clock; while (!mpState->recd_buffer.empty()) { @@ -889,7 +889,7 @@ gpMidiPlayer->StopPlay(); u.w = m->data; clock = - ((long)u.c[1] + (128L * (long)u.c[2])) * + ((int)u.c[1] + (128L * (int)u.c[2])) * (mpSong->GetTicksPerQuarter() / 4); gpMidiPlayer->StartPlay( clock, 0, 1 ); return -1; @@ -904,7 +904,7 @@ } } - long delta_clock = (((long)timeGetTime() - mpState->signal_time) * 1000L) / mpState->time_per_tick; + int delta_clock = (((int)timeGetTime() - mpState->signal_time) * 1000L) / mpState->time_per_tick; if (delta_clock > (2 * mpState->ticks_per_signal)) { @@ -923,9 +923,9 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -long JZWindowsMtcPlayer::GetRealTimeClock() +int JZWindowsMtcPlayer::GetRealTimeClock() { - long clock; + int clock; while (!mpState->recd_buffer.empty()) { @@ -951,7 +951,7 @@ if (mpState->mtc_valid) { - if ( ((long)timeGetTime() - mpState->signal_time) > 500 ) + if ( ((int)timeGetTime() - mpState->signal_time) > 500 ) { /* Assume tape stopped */ disable(); @@ -1017,7 +1017,7 @@ StopPlay(); mpState->doing_mtc_rec = FALSE; return(new JZMtcTime( - (long) GetMtcTime(mpState), + (int) GetMtcTime(mpState), (tMtcType) mpState->mtc_start.type)); } Modified: trunk/jazz/src/mswin/WindowsPlayer.h =================================================================== --- trunk/jazz/src/mswin/WindowsPlayer.h 2011-08-08 01:09:19 UTC (rev 906) +++ trunk/jazz/src/mswin/WindowsPlayer.h 2011-08-08 04:11:58 UTC (rev 907) @@ -47,10 +47,10 @@ void OutNow(JZEvent *e); void OutNow(JZParam *r); void OutBreak(); - virtual void OutBreak(long BreakOver); - void StartPlay(long Clock, long LoopClock = 0, int Continue = 0); + virtual void OutBreak(int BreakOver); + void StartPlay(int Clock, int LoopClock = 0, int Continue = 0); void StopPlay(); - virtual long GetRealTimeClock() = 0; + virtual int GetRealTimeClock() = 0; virtual void FlushToDevice(); void SetSoftThru(int on, int InputDevice, int OutputDevice); @@ -75,21 +75,21 @@ tWinPlayerState* mpState; DWORD Event2Dword(JZEvent *e); JZEvent* Dword2Event(DWORD dw); - long Clock2Time(long clock); - long Time2Clock(long time); - void SetTempo(long bpm, long clock); + int Clock2Time(int clock); + int Time2Clock(int time); + void SetTempo(int bpm, int clock); BOOL timer_installed; - long midiClockOut; - long lastValidMtcClock; - void FillMidiClocks(long to); - void FlushToDevice(long clock); + int midiClockOut; + int lastValidMtcClock; + void FillMidiClocks(int to); + void FlushToDevice(int clock); JZEventArray OutOfBandEvents; - long RealTimeClock2Time(long clock); - long Time2RealTimeClock(long time); - void SetRealTimeTempo(long bpm, long clock); - long real_start_time; - long real_ticks_per_minute; + int RealTimeClock2Time(int clock); + int Time2RealTimeClock(int time); + void SetRealTimeTempo(int bpm, int clock); + int real_start_time; + int real_ticks_per_minute; // buffer for sysexdata HANDLE hSysHdr; @@ -110,7 +110,7 @@ { } - virtual long GetRealTimeClock(); + virtual int GetRealTimeClock(); }; //***************************************************************************** @@ -124,9 +124,9 @@ { } - virtual long GetRealTimeClock(); + virtual int GetRealTimeClock(); virtual int OutEvent(JZEvent* pEvent); - virtual void OutBreak(long clock); + virtual void OutBreak(int clock); }; //***************************************************************************** @@ -139,7 +139,7 @@ { } - virtual long GetRealTimeClock(); + virtual int GetRealTimeClock(); virtual void InitMtcRec(); virtual JZMtcTime* FreezeMtcRec(); }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2011-08-08 04:28:39
|
Revision: 908 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=908&view=rev Author: pstieber Date: 2011-08-08 04:28:33 +0000 (Mon, 08 Aug 2011) Log Message: ----------- Changed long to int in several places on the Linux side. Modified Paths: -------------- trunk/jazz/src/AlsaDriver.cpp trunk/jazz/src/AlsaDriver.h trunk/jazz/src/AlsaPlayer.cpp trunk/jazz/src/AlsaPlayer.h trunk/jazz/src/AudioDriver.cpp trunk/jazz/src/AudioDriver.h trunk/jazz/src/Player.h Modified: trunk/jazz/src/AlsaDriver.cpp =================================================================== --- trunk/jazz/src/AlsaDriver.cpp 2011-08-08 04:11:58 UTC (rev 907) +++ trunk/jazz/src/AlsaDriver.cpp 2011-08-08 04:28:33 UTC (rev 908) @@ -69,8 +69,8 @@ JZAlsaAudioListener( JZAlsaAudioPlayer* pPlayer, JZSample& spl, - long fr_smpl, - long to_smpl) + int fr_smpl, + int to_smpl) : wxTimer(), mpPlayer(pPlayer), mHardExit(true) @@ -107,7 +107,7 @@ } } - long GetPlayPosition() + int GetPlayPosition() { return mpPlayer->GetCurrentPosition(JZAlsaAudioPlayer::PLAYBACK); } @@ -175,7 +175,7 @@ return running_mode & (1 << PLAYBACK); } -void JZAlsaAudioPlayer::StartPlay(long clock, long loopClock, int cont) +void JZAlsaAudioPlayer::StartPlay(int clock, int loopClock, int cont) { delete mpListener; mSamples.StartPlay(clock); @@ -186,7 +186,7 @@ return; } - long ticks_per_minute = mpSong->GetTicksPerQuarter() * mpSong->Speed(); + int ticks_per_minute = mpSong->GetTicksPerQuarter() * mpSong->Speed(); mSamples.ResetBuffers(mpAudioBuffer, clock, ticks_per_minute); last_scount = 0; cur_pos = 0; @@ -517,20 +517,20 @@ } -void JZAlsaAudioPlayer::ResetPlay(long clock) +void JZAlsaAudioPlayer::ResetPlay(int clock) { JZAlsaPlayer::ResetPlay(clock); if (pcm[PLAYBACK]) { snd_pcm_drop(pcm[PLAYBACK]); -// long ticks_per_minute = mpSong->GetTicksPerQuarter() * mpSong->Speed(); +// int ticks_per_minute = mpSong->GetTicksPerQuarter() * mpSong->Speed(); // mSamples.ResetBuffers(mpAudioBuffer, clock, ticks_per_minute); } audio_clock_offset = clock; cur_pos = 0; } -long JZAlsaAudioPlayer::GetCurrentPosition(int mode) +int JZAlsaAudioPlayer::GetCurrentPosition(int mode) { return cur_scount; } @@ -556,7 +556,7 @@ return; // disabled } - long scount = GetCurrentPosition(mode); + int scount = GetCurrentPosition(mode); // get realtime info for audio/midi sync if (scount != last_scount) @@ -581,8 +581,8 @@ } last_scount = scount; cur_pos += samplediff; - long audio_clock = - (long)mSamples.Samples2Ticks(cur_pos) + audio_clock_offset; + int audio_clock = + (int)mSamples.Samples2Ticks(cur_pos) + audio_clock_offset; int delta_clock = audio_clock - qtick; int new_speed = midi_speed + delta_clock; @@ -625,12 +625,12 @@ CloseDsp(true); if (RecordMode()) { - long frc = mpRecordingInfo->mFromClock; + int frc = mpRecordingInfo->mFromClock; if (frc < audio_clock_offset) { frc = audio_clock_offset; } - long toc = mpRecordingInfo->mToClock; + int toc = mpRecordingInfo->mToClock; if (toc > recd_clock) { toc = recd_clock; @@ -670,7 +670,7 @@ mpListener = new JZAlsaAudioListener(this, key); } -void JZAlsaAudioPlayer::ListenAudio(JZSample& spl, long fr_smpl, long to_smpl) +void JZAlsaAudioPlayer::ListenAudio(JZSample& spl, int fr_smpl, int to_smpl) { if (!mAudioEnabled) { @@ -691,7 +691,7 @@ mpListener = new JZAlsaAudioListener(this, spl, fr_smpl, to_smpl); } -long JZAlsaAudioPlayer::GetListenerPlayPosition() +int JZAlsaAudioPlayer::GetListenerPlayPosition() { if (!mpListener) { Modified: trunk/jazz/src/AlsaDriver.h =================================================================== --- trunk/jazz/src/AlsaDriver.h 2011-08-08 04:11:58 UTC (rev 907) +++ trunk/jazz/src/AlsaDriver.h 2011-08-08 04:28:33 UTC (rev 908) @@ -41,7 +41,7 @@ virtual ~JZAlsaAudioPlayer(); int LoadSamples(const char *filename); virtual void Notify(); - virtual void StartPlay(long Clock, long LoopClock = 0, int Continue = 0); + virtual void StartPlay(int Clock, int LoopClock = 0, int Continue = 0); virtual void StopPlay(); virtual bool IsInstalled() { @@ -56,14 +56,14 @@ mAudioEnabled = AudioEnabled; } virtual void ListenAudio(int key, int start_stop_mode = 1); - virtual void ListenAudio(JZSample &spl, long fr_smpl, long to_smpl); + virtual void ListenAudio(JZSample &spl, int fr_smpl, int to_smpl); virtual bool IsListening() const { return mpListener != 0; } - virtual long GetListenerPlayPosition(); + virtual int GetListenerPlayPosition(); virtual void StartAudio(); - virtual void ResetPlay(long clock); + virtual void ResetPlay(int clock); enum { @@ -84,7 +84,7 @@ void CloseDsp(bool Reset); - long GetCurrentPosition(int mode); + int GetCurrentPosition(int mode); int GetFreeSpace(int mode); // If true can do full duplex record/play. @@ -93,10 +93,10 @@ snd_pcm_t *pcm[2]; bool mInstalled; - long audio_clock_offset; - long cur_pos; - long last_scount; - long cur_scount; + int audio_clock_offset; + int cur_pos; + int last_scount; + int cur_scount; int running_mode; int midi_speed; // start speed in bpm int curr_speed; // actual speed in bpm @@ -106,10 +106,10 @@ int card; // card number in config std::string mDeviceNames[2]; // device names - long frag_size[2]; - long frag_byte_size[2]; + int frag_size[2]; + int frag_byte_size[2]; int frame_shift[2]; - long frame_boundary[2]; + int frame_boundary[2]; JZAlsaAudioListener* mpListener; JZAudioRecordBuffer recbuffers; Modified: trunk/jazz/src/AlsaPlayer.cpp =================================================================== --- trunk/jazz/src/AlsaPlayer.cpp 2011-08-08 04:11:58 UTC (rev 907) +++ trunk/jazz/src/AlsaPlayer.cpp 2011-08-08 04:28:33 UTC (rev 908) @@ -543,7 +543,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZAlsaPlayer::OutBreak(long clock) +void JZAlsaPlayer::OutBreak(int clock) { while (echo_clock + 48 < clock) { @@ -559,7 +559,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZAlsaPlayer::StartPlay(long clock, long loopClock, int cont) +void JZAlsaPlayer::StartPlay(int clock, int loopClock, int cont) { recd_clock = clock; echo_clock = clock; @@ -573,7 +573,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZAlsaPlayer::ResetPlay(long clock) +void JZAlsaPlayer::ResetPlay(int clock) { // Purge queues. snd_seq_drop_output_buffer(handle); @@ -594,7 +594,7 @@ void JZAlsaPlayer::Notify() { // called by timer - long Now = GetRealTimeClock(); + int Now = GetRealTimeClock(); cout << "JZAlsaPlayer::Notify " << Now << ' ' << play_clock << endl; @@ -657,7 +657,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZAlsaPlayer::set_event_header(snd_seq_event_t *ev, long clock, int type) +void JZAlsaPlayer::set_event_header(snd_seq_event_t *ev, int clock, int type) { memset(ev, 0, sizeof(*ev)); snd_seq_ev_set_source(ev, self.port); @@ -671,7 +671,7 @@ //----------------------------------------------------------------------------- void JZAlsaPlayer::set_event_header( snd_seq_event_t *ev, - long clock, + int clock, int len, void *ptr) { @@ -686,7 +686,7 @@ // Description: // Initialize the alsa timer. //----------------------------------------------------------------------------- -int JZAlsaPlayer::start_timer(long clock) +int JZAlsaPlayer::start_timer(int clock) { int time_base = mpSong->GetTicksPerQuarter(); int cur_speed = mpSong->GetTrack(0)->GetCurrentSpeed(clock); @@ -716,7 +716,7 @@ // Immediately start the alsa queue timer. Do this by sending an "start" // event to the queue. //----------------------------------------------------------------------------- -void JZAlsaPlayer::start_queue_timer(long clock) +void JZAlsaPlayer::start_queue_timer(int clock) { stop_queue_timer(); // to be sure @@ -938,11 +938,11 @@ // looking at time stamps on events in the queue, and also updates the // display, so the name is not well chosen. //----------------------------------------------------------------------------- -long JZAlsaPlayer::GetRealTimeClock() +int JZAlsaPlayer::GetRealTimeClock() { // input recorded events (including my echo events) snd_seq_event_t *ie; - long old_recd_clock = recd_clock; + int old_recd_clock = recd_clock; while (snd_seq_event_input(handle, &ie) >= 0 && ie != 0) { recd_event(ie); Modified: trunk/jazz/src/AlsaPlayer.h =================================================================== --- trunk/jazz/src/AlsaPlayer.h 2011-08-08 04:11:58 UTC (rev 907) +++ trunk/jazz/src/AlsaPlayer.h 2011-08-08 04:28:33 UTC (rev 908) @@ -62,10 +62,10 @@ } void OutNow(JZParam *r); void OutBreak(); - void OutBreak(long BreakOver); - void StartPlay(long Clock, long LoopClock = 0, int Continue = 0); + void OutBreak(int BreakOver); + void StartPlay(int Clock, int LoopClock = 0, int Continue = 0); void StopPlay(); - long GetRealTimeClock(); + int GetRealTimeClock(); virtual void SetSoftThru(int on, int idev, int odev); virtual int SupportsMultipleDevices() { @@ -114,17 +114,17 @@ JZAlsaDeviceList& Devicelist, unsigned DeviceCapabilities); int select_list(JZAlsaDeviceList &list, const char *title, int def_device); - int start_timer(long clock); + int start_timer(int clock); int write(snd_seq_event_t *ev) { // 0 == ok return write(ev, 0); } int write(snd_seq_event_t *ev, int now); // 0 == ok - void set_event_header(snd_seq_event_t *ev, long clock, int type); - void set_event_header(snd_seq_event_t *ev, long clock, int len, void *ptr); + void set_event_header(snd_seq_event_t *ev, int clock, int type); + void set_event_header(snd_seq_event_t *ev, int clock, int len, void *ptr); void init_queue_tempo(int time_base, int bpm); - void start_queue_timer(long clock); + void start_queue_timer(int clock); void stop_queue_timer(); void recd_event(snd_seq_event_t *ev); void flush_output(); @@ -134,15 +134,15 @@ void set_pool_sizes(); int compose_echo(int clock, unsigned int arg = 0); virtual void StartAudio(); - virtual void ResetPlay(long clock); + virtual void ResetPlay(int clock); int sync_master(); void sync_master_remove(); int sync_slave(); void sync_slave_remove(); - long play_clock; // current clock - long recd_clock; // clock received so far from recorded events or echo events - long echo_clock; // echo events have been sent up to this clock + int play_clock; // current clock + int recd_clock; // clock received so far from recorded events or echo events + int echo_clock; // echo events have been sent up to this clock JZAlsaThru *thru; int ithru, othru; // index in iaddr, oaddr of source/target device Modified: trunk/jazz/src/AudioDriver.cpp =================================================================== --- trunk/jazz/src/AudioDriver.cpp 2011-08-08 04:11:58 UTC (rev 907) +++ trunk/jazz/src/AudioDriver.cpp 2011-08-08 04:28:33 UTC (rev 908) @@ -64,8 +64,8 @@ JZAudioListener( JZAudioPlayer* pPlayer, JZSample& spl, - long fr_smpl, - long to_smpl) + int fr_smpl, + int to_smpl) : wxTimer(), mpPlayer(pPlayer), mCount(0), @@ -97,7 +97,7 @@ } } - long GetPlayPosition() + int GetPlayPosition() { count_info cinfo; if (ioctl(mpPlayer->dev, SNDCTL_DSP_GETOPTR, &cinfo) == -1) @@ -200,7 +200,7 @@ return; } - long ticks_per_minute = mpSong->GetTicksPerQuarter() * mpSong->Speed(); + int ticks_per_minute = mpSong->GetTicksPerQuarter() * mpSong->Speed(); mSamples.ResetBuffers(mpAudioBuffer, start_clock, ticks_per_minute); if (PlaybackMode()) { @@ -480,7 +480,7 @@ // search for SNDCTL_DSP_GETOPTR in linux/drivers/sound/dmabuf // before trying to understand the next line - long new_bytes = cinfo.bytes - cinfo.ptr; // info.ptr is garbage!! + int new_bytes = cinfo.bytes - cinfo.ptr; // info.ptr is garbage!! if (new_bytes != audio_bytes) { // driver has processed some bytes or whole fragment @@ -493,7 +493,7 @@ audio_bytes = new_bytes; // OSS bug?: mpu401 does not like speed changes too often - long audio_clock = (long)mSamples.Samples2Ticks(audio_bytes / 2); + int audio_clock = (int)mSamples.Samples2Ticks(audio_bytes / 2); int delta_clock = audio_clock - midi_clock; int new_speed = midi_speed + delta_clock; @@ -525,7 +525,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZAudioPlayer::StartPlay(long Clock, long LoopClock, int Continue) +void JZAudioPlayer::StartPlay(int Clock, int LoopClock, int Continue) { delete mpListener; mSamples.StartPlay(Clock); @@ -546,12 +546,12 @@ CloseDsp(true); if (RecordMode()) { - long frc = mpRecordingInfo->mFromClock; + int frc = mpRecordingInfo->mFromClock; if (frc < start_clock) { frc = start_clock; } - long toc = mpRecordingInfo->mToClock; + int toc = mpRecordingInfo->mToClock; if (toc > recd_clock) { toc = recd_clock; @@ -595,7 +595,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZAudioPlayer::ListenAudio(JZSample &spl, long fr_smpl, long to_smpl) +void JZAudioPlayer::ListenAudio(JZSample &spl, int fr_smpl, int to_smpl) { if (!mAudioEnabled) { @@ -617,7 +617,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -long JZAudioPlayer::GetListenerPlayPosition() +int JZAudioPlayer::GetListenerPlayPosition() { if (!mpListener) { Modified: trunk/jazz/src/AudioDriver.h =================================================================== --- trunk/jazz/src/AudioDriver.h 2011-08-08 04:11:58 UTC (rev 907) +++ trunk/jazz/src/AudioDriver.h 2011-08-08 04:28:33 UTC (rev 908) @@ -54,7 +54,7 @@ virtual void Notify(); - virtual void StartPlay(long Clock, long LoopClock = 0, int Continue = 0); + virtual void StartPlay(int Clock, int LoopClock = 0, int Continue = 0); virtual void StopPlay(); @@ -77,14 +77,14 @@ virtual void ListenAudio(int key, int start_stop_mode = 1); - virtual void ListenAudio(JZSample &spl, long fr_smpl, long to_smpl); + virtual void ListenAudio(JZSample &spl, int fr_smpl, int to_smpl); virtual bool IsListening() const { return mpListener != 0; } - virtual long GetListenerPlayPosition(); + virtual int GetListenerPlayPosition(); // for recording int RecordMode() const; @@ -109,8 +109,8 @@ int dev; bool mInstalled; - long midi_clock; - long audio_bytes; + int midi_clock; + int audio_bytes; int midi_speed; // start speed in bpm int curr_speed; // actual speed in bpm Modified: trunk/jazz/src/Player.h =================================================================== --- trunk/jazz/src/Player.h 2011-08-08 04:11:58 UTC (rev 907) +++ trunk/jazz/src/Player.h 2011-08-08 04:28:33 UTC (rev 908) @@ -293,7 +293,7 @@ virtual int GetListenerPlayPosition() { - return -1L; + return -1; } void LoadDefaultSettings() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2012-12-21 16:56:58
|
Revision: 925 http://sourceforge.net/p/jazzplusplus/code/925 Author: pstieber Date: 2012-12-21 16:56:55 +0000 (Fri, 21 Dec 2012) Log Message: ----------- Update wx_str to mb_str. Modified Paths: -------------- trunk/jazz/src/Audio.cpp trunk/jazz/src/Configuration.cpp trunk/jazz/src/Harmony.cpp trunk/jazz/src/JazzPlusPlusApplication.cpp trunk/jazz/src/Rhythm.cpp trunk/jazz/src/SampleDialog.cpp Modified: trunk/jazz/src/Audio.cpp =================================================================== --- trunk/jazz/src/Audio.cpp 2012-11-30 15:53:45 UTC (rev 924) +++ trunk/jazz/src/Audio.cpp 2012-12-21 16:56:55 UTC (rev 925) @@ -289,7 +289,7 @@ // Get the path of the sample file. wxString SplFilePath = ::wxPathOnly(FileName); - ifstream Is(FileName.wx_str()); + ifstream Is(FileName.mb_str()); int Version; Is >> Version >> mSamplingRate >> mChannelCount >> mSoftwareSynchonization; while (Is && !Is.eof()) @@ -364,7 +364,7 @@ //----------------------------------------------------------------------------- int JZSampleSet::Save(const wxString& FileName) { - ofstream Ofs(FileName.wx_str()); + ofstream Ofs(FileName.mb_str()); Ofs << 1 << ' ' << mSamplingRate @@ -1060,7 +1060,7 @@ wh.data_length = (end_index - start_index) * sizeof(short); wh.length = wh.data_length + sizeof(WaveHeader); - ofstream os(FileName.wx_str(), ios::out | ios::binary | ios::trunc); + ofstream os(FileName.mb_str(), ios::out | ios::binary | ios::trunc); os.write((char*)&wh, sizeof(wh)); Modified: trunk/jazz/src/Configuration.cpp =================================================================== --- trunk/jazz/src/Configuration.cpp 2012-11-30 15:53:45 UTC (rev 924) +++ trunk/jazz/src/Configuration.cpp 2012-12-21 16:56:55 UTC (rev 925) @@ -553,7 +553,7 @@ return false; } - ifstream Ifs(FileName.wx_str()); + ifstream Ifs(FileName.mb_str()); if (!Ifs) { return false; @@ -642,7 +642,7 @@ return false; } - ifstream Ifs(FileName.wx_str()); + ifstream Ifs(FileName.mb_str()); if (!Ifs) { return false; @@ -734,7 +734,7 @@ << " \"" << mFileName << '"' << endl; - ifstream* pIs = new ifstream(mFileName.wx_str()); + ifstream* pIs = new ifstream(mFileName.mb_str()); InputFileStreams.push(pIs); if (!*InputFileStreams.top()) @@ -848,7 +848,7 @@ } else { - pIs = new ifstream(IncludeFileName.wx_str()); + pIs = new ifstream(IncludeFileName.mb_str()); InputFileStreams.push(pIs); } Modified: trunk/jazz/src/Harmony.cpp =================================================================== --- trunk/jazz/src/Harmony.cpp 2012-11-30 15:53:45 UTC (rev 924) +++ trunk/jazz/src/Harmony.cpp 2012-12-21 16:56:55 UTC (rev 925) @@ -1449,7 +1449,7 @@ if (!FileName.empty()) { - ifstream Is(FileName.wx_str()); + ifstream Is(FileName.mb_str()); Is >> *this; } } @@ -1467,7 +1467,7 @@ if (!FileName.empty()) { - ofstream os(FileName.wx_str()); + ofstream os(FileName.mb_str()); os << *this; } } Modified: trunk/jazz/src/JazzPlusPlusApplication.cpp =================================================================== --- trunk/jazz/src/JazzPlusPlusApplication.cpp 2012-11-30 15:53:45 UTC (rev 924) +++ trunk/jazz/src/JazzPlusPlusApplication.cpp 2012-12-21 16:56:55 UTC (rev 925) @@ -191,7 +191,7 @@ // Test for the existence of the help file. bool HelpFileFound = false; ifstream Is; - Is.open(HelpFileNameAndPath.wx_str()); + Is.open(HelpFileNameAndPath.mb_str()); if (!Is) { // Ask the user to find the help file. @@ -202,7 +202,7 @@ // Try one more time. Is.close(); Is.clear(); - Is.open(HelpFileNameAndPath.wx_str()); + Is.open(HelpFileNameAndPath.mb_str()); if (!Is) { wxString Message = "Failed to add the Jazz++ book " + mHelpFileName; Modified: trunk/jazz/src/Rhythm.cpp =================================================================== --- trunk/jazz/src/Rhythm.cpp 2012-11-30 15:53:45 UTC (rev 924) +++ trunk/jazz/src/Rhythm.cpp 2012-12-21 16:56:55 UTC (rev 925) @@ -769,7 +769,7 @@ "*.rhy"); if (!FileName.empty()) { - ifstream Is(FileName.wx_str()); + ifstream Is(FileName.mb_str()); Is >> *this; OnPaint(); } @@ -787,7 +787,7 @@ "*.rhy"); if (!FileName.empty()) { - ofstream Os(FileName.wx_str()); + ofstream Os(FileName.mb_str()); Os << *this; } } Modified: trunk/jazz/src/SampleDialog.cpp =================================================================== --- trunk/jazz/src/SampleDialog.cpp 2012-11-30 15:53:45 UTC (rev 924) +++ trunk/jazz/src/SampleDialog.cpp 2012-12-21 16:56:55 UTC (rev 925) @@ -626,7 +626,7 @@ "*.syn"); if (!FileName.empty()) { - ifstream is(FileName.wx_str()); + ifstream is(FileName.mb_str()); is >> *this; SetupEdits(); int cw, ch; @@ -648,7 +648,7 @@ "*.syn"); if (!FileName.empty()) { - ofstream os(FileName.wx_str()); + ofstream os(FileName.mb_str()); os << *this; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2013-01-02 17:08:02
|
Revision: 927 http://sourceforge.net/p/jazzplusplus/code/927 Author: pstieber Date: 2013-01-02 17:07:59 +0000 (Wed, 02 Jan 2013) Log Message: ----------- Updated the interface to the control panel. Modified Paths: -------------- trunk/jazz/src/ControlEdit.cpp trunk/jazz/src/ControlEdit.h Modified: trunk/jazz/src/ControlEdit.cpp =================================================================== --- trunk/jazz/src/ControlEdit.cpp 2012-12-21 17:12:57 UTC (rev 926) +++ trunk/jazz/src/ControlEdit.cpp 2013-01-02 17:07:59 UTC (rev 927) @@ -70,7 +70,7 @@ clocks_per_pixel = 0; sticky = 1; - panel = new JZControlPanel(this, mpPianoWindow, x, y, dx, h, 0, "Controller Edit"); + panel = new JZControlPanel(this, mpPianoWindow, wxPoint(x, y), wxSize(dx, h), 0, "Controller Edit"); //(void) new wxMessage(panel, (char *)label); //panel->NewLine(); Modified: trunk/jazz/src/ControlEdit.h =================================================================== --- trunk/jazz/src/ControlEdit.h 2012-12-21 17:12:57 UTC (rev 926) +++ trunk/jazz/src/ControlEdit.h 2013-01-02 17:07:59 UTC (rev 927) @@ -44,13 +44,11 @@ JZControlPanel( JZCtrlEditBase* e, wxWindow* pParent, - int x=-1, - int y=-1, - int width=-1, - int height=-1, + const wxPoint& Position = wxDefaultPosition, + const wxSize& Size = wxDefaultSize, long style=0, const char* pName = "panel") - : wxPanel(pParent, x, y, width, height, style, pName) + : wxPanel(pParent, wxID_ANY, Position, Size, style, pName) { edit = e; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2013-01-06 22:49:38
|
Revision: 942 http://sourceforge.net/p/jazzplusplus/code/942 Author: pstieber Date: 2013-01-06 22:49:35 +0000 (Sun, 06 Jan 2013) Log Message: ----------- 1. Changed const char* to const std::string& in the JZConfigurationEntry constructors and removed and extra constructor for a string value. 2. Changed the return value for JZConfigurationEntry::GetValue from const int& to int. 3. Changed the return value for JZConfiguration::GetValue(const char* pName) and JZConfiguration::GetValue(int Index) from const int& to int. 4. Removed c_str() usage. 5. Changed const char* pNoneString to const string NoneString. Modified Paths: -------------- trunk/jazz/src/Configuration.cpp trunk/jazz/src/Configuration.h Modified: trunk/jazz/src/Configuration.cpp =================================================================== --- trunk/jazz/src/Configuration.cpp 2013-01-06 22:40:42 UTC (rev 941) +++ trunk/jazz/src/Configuration.cpp 2013-01-06 22:49:35 UTC (rev 942) @@ -46,66 +46,35 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- JZConfigurationEntry::JZConfigurationEntry( - const char* pName, + const string& Name, int IntegerValue) : mType(eConfigEntryTypeInt), - mName(), + mName(Name), mValue(IntegerValue), mStringValue() { - if (pName) - { - mName = pName; - } } //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- JZConfigurationEntry::JZConfigurationEntry( - const char* pName, - const char* pStringValue) + const string& Name, + const string& StringValue) : mType(eConfigEntryTypeStr), - mName(), + mName(Name), mValue(0), - mStringValue() + mStringValue(StringValue) { - if (pName) - { - mName = pName; - } - - if (pStringValue) - { - mStringValue = pStringValue; - } } //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -JZConfigurationEntry::JZConfigurationEntry( - const char* pName, - const string& StringValue) -{ - if (pName) - { - mName = pName; - } - - mStringValue = StringValue; -} - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -JZConfigurationEntry::JZConfigurationEntry(const char* pName) +JZConfigurationEntry::JZConfigurationEntry(const string& Name) : mType(eConfigEntryTypeEmpty), - mName(), + mName(Name), mValue(0), mStringValue() { - if (pName) - { - mName = pName; - } } //----------------------------------------------------------------------------- @@ -134,8 +103,6 @@ mNames[i] = 0; } - const char* pNoneString = "None"; - // search for midi device mNames[C_Seq2Device] = new JZConfigurationEntry(".device", -1); @@ -295,12 +262,12 @@ // Default synthesizer type. mNames[C_SynthType] = new JZConfigurationEntry( ".synth_type", - gSynthesizerTypes[SynthTypeGS].first.c_str()); + gSynthesizerTypes[SynthTypeGS].first); // Default synthesizer configuration file. mNames[C_SynthConfig] = new JZConfigurationEntry( ".synth_config", - gSynthesierTypeFiles[SynthTypeGS].first.c_str()); + gSynthesierTypeFiles[SynthTypeGS].first); // When to send synthesizer reset (0 = never, 1 = song start, // 2 = start play). @@ -337,7 +304,9 @@ mDrumNames.push_back(make_pair("", i)); } - mDrumSets.push_back(make_pair(pNoneString, 0)); + const string NoneString = "None"; + + mDrumSets.push_back(make_pair(NoneString, 0)); for (int i = 1; i < 130; ++i) { mDrumSets.push_back(make_pair("", i)); @@ -348,7 +317,7 @@ mControlNames.push_back(make_pair("", i)); } - mVoiceNames.push_back(make_pair(pNoneString, 0)); + mVoiceNames.push_back(make_pair(NoneString, 0)); mVoiceNames.push_back(make_pair("", 0)); } @@ -525,7 +494,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -const int& JZConfiguration::GetValue(const char* pName) const +int JZConfiguration::GetValue(const char* pName) const { int i = Check(pName); @@ -536,7 +505,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -const int& JZConfiguration::GetValue(int Index) const +int JZConfiguration::GetValue(int Index) const { assert((Index >= 0) && (Index < NumConfigNames)); return mNames[Index]->GetValue(); Modified: trunk/jazz/src/Configuration.h =================================================================== --- trunk/jazz/src/Configuration.h 2013-01-06 22:40:42 UTC (rev 941) +++ trunk/jazz/src/Configuration.h 2013-01-06 22:49:35 UTC (rev 942) @@ -137,19 +137,19 @@ { public: - JZConfigurationEntry(const char* pName, int IntegerValue); + JZConfigurationEntry(const std::string& Name, int IntegerValue); - JZConfigurationEntry(const char* pName, const char* pStringValue); + JZConfigurationEntry( + const std::string& Name, + const std::string& StringValue); - JZConfigurationEntry(const char* pName, const std::string& StringValue); + JZConfigurationEntry(const std::string& Name); - JZConfigurationEntry(const char* pName); - TEConfigEntryType GetType() const; const std::string& GetName() const; - const int& GetValue() const; + int GetValue() const; void SetValue(const int& Value); @@ -188,7 +188,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- inline -const int& JZConfigurationEntry::GetValue() const +int JZConfigurationEntry::GetValue() const { return mValue; } @@ -236,8 +236,8 @@ const std::string& GetStrValue(int Entry) const; - const int& GetValue(const char* pName) const; - const int& GetValue(int Index) const; + int GetValue(const char* pName) const; + int GetValue(int Index) const; bool Get(int Entry, std::string& Value); bool Get(int Entry, int& Value); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2013-01-07 15:32:58
|
Revision: 951 http://sourceforge.net/p/jazzplusplus/code/951 Author: pstieber Date: 2013-01-07 15:32:52 +0000 (Mon, 07 Jan 2013) Log Message: ----------- 1. Changed header sentries to #pragma once. 2. Updated copyright years. Modified Paths: -------------- trunk/jazz/src/AboutDialog.cpp trunk/jazz/src/AboutDialog.h trunk/jazz/src/AsciiMidiFile.cpp trunk/jazz/src/AsciiMidiFile.h trunk/jazz/src/Audio.cpp trunk/jazz/src/Audio.h trunk/jazz/src/Command.cpp trunk/jazz/src/Command.h trunk/jazz/src/Configuration.cpp trunk/jazz/src/Configuration.h trunk/jazz/src/ControlEdit.cpp trunk/jazz/src/ControlEdit.h trunk/jazz/src/Dialogs/AudioSettingsDialog.h trunk/jazz/src/Dialogs/CleanupDialog.cpp trunk/jazz/src/Dialogs/CleanupDialog.h trunk/jazz/src/Dialogs/ControllerDialog.h trunk/jazz/src/Dialogs/DeleteDialog.cpp trunk/jazz/src/Dialogs/DeleteDialog.h trunk/jazz/src/Dialogs/EndOfTrackDialog.h trunk/jazz/src/Dialogs/FilterDialog.cpp trunk/jazz/src/Dialogs/FilterDialog.h trunk/jazz/src/Dialogs/IntegerEdit.cpp trunk/jazz/src/Dialogs/IntegerEdit.h trunk/jazz/src/Dialogs/KeyOnDialog.cpp trunk/jazz/src/Dialogs/KeyOnDialog.h trunk/jazz/src/Dialogs/LengthDialog.cpp trunk/jazz/src/Dialogs/LengthDialog.h trunk/jazz/src/Dialogs/MeterChangeDialog.h trunk/jazz/src/Dialogs/MetronomeSettingsDialog.cpp trunk/jazz/src/Dialogs/MetronomeSettingsDialog.h trunk/jazz/src/Dialogs/MidiChannelDialog.cpp trunk/jazz/src/Dialogs/MidiChannelDialog.h trunk/jazz/src/Dialogs/PitchWheelDialog.h trunk/jazz/src/Dialogs/ProgramChangeDialog.h trunk/jazz/src/Dialogs/QuantizeDialog.cpp trunk/jazz/src/Dialogs/QuantizeDialog.h trunk/jazz/src/Dialogs/SamplesDialog.h trunk/jazz/src/Dialogs/SearchAndReplaceDialog.cpp trunk/jazz/src/Dialogs/SearchAndReplaceDialog.h trunk/jazz/src/Dialogs/SetTempoDialog.h trunk/jazz/src/Dialogs/ShiftDialog.cpp trunk/jazz/src/Dialogs/ShiftDialog.h trunk/jazz/src/Dialogs/SnapDialog.cpp trunk/jazz/src/Dialogs/SnapDialog.h trunk/jazz/src/Dialogs/SynthesizerSettingsDialog.cpp trunk/jazz/src/Dialogs/SynthesizerSettingsDialog.h trunk/jazz/src/Dialogs/SysexDialog.cpp trunk/jazz/src/Dialogs/SysexDialog.h trunk/jazz/src/Dialogs/TextDialog.h trunk/jazz/src/Dialogs/TrackDialog.cpp trunk/jazz/src/Dialogs/TrackDialog.h trunk/jazz/src/Dialogs/TransposeDialog.cpp trunk/jazz/src/Dialogs/TransposeDialog.h trunk/jazz/src/Dialogs/VelocityDialog.cpp trunk/jazz/src/Dialogs/VelocityDialog.h trunk/jazz/src/Dialogs.cpp trunk/jazz/src/Dialogs.h trunk/jazz/src/DynamicArray.cpp trunk/jazz/src/DynamicArray.h trunk/jazz/src/ErrorMessage.cpp trunk/jazz/src/ErrorMessage.h trunk/jazz/src/EventFrame.cpp trunk/jazz/src/EventFrame.h trunk/jazz/src/EventWindow.cpp trunk/jazz/src/EventWindow.h trunk/jazz/src/Events.cpp trunk/jazz/src/Events.h trunk/jazz/src/FileSelector.cpp trunk/jazz/src/FileSelector.h trunk/jazz/src/Filter.cpp trunk/jazz/src/Filter.h trunk/jazz/src/FindFile.cpp trunk/jazz/src/FindFile.h trunk/jazz/src/FrequencyTable.cpp trunk/jazz/src/FrequencyTable.h trunk/jazz/src/GetOptionIndex.h trunk/jazz/src/Globals.cpp trunk/jazz/src/Globals.h trunk/jazz/src/GuitarFrame.cpp trunk/jazz/src/GuitarFrame.h trunk/jazz/src/GuitarSettings.cpp trunk/jazz/src/GuitarSettings.h trunk/jazz/src/GuitarSettingsDialog.cpp trunk/jazz/src/GuitarSettingsDialog.h trunk/jazz/src/GuitarWindow.cpp trunk/jazz/src/GuitarWindow.h trunk/jazz/src/Harmony.cpp trunk/jazz/src/Harmony.h trunk/jazz/src/HarmonyBrowserAnalyzer.cpp trunk/jazz/src/HarmonyBrowserAnalyzer.h trunk/jazz/src/HarmonyP.cpp trunk/jazz/src/HarmonyP.h trunk/jazz/src/Help.cpp trunk/jazz/src/Help.h trunk/jazz/src/JazzPlusPlusApplication.cpp trunk/jazz/src/JazzPlusPlusApplication.h trunk/jazz/src/KeyStringConverters.cpp trunk/jazz/src/KeyStringConverters.h trunk/jazz/src/Knob.cpp trunk/jazz/src/Knob.h trunk/jazz/src/Mapper.cpp trunk/jazz/src/Mapper.h trunk/jazz/src/MeasureChoice.cpp trunk/jazz/src/MeasureChoice.h trunk/jazz/src/Metronome.cpp trunk/jazz/src/Metronome.h trunk/jazz/src/MidiDeviceDialog.cpp trunk/jazz/src/MidiDeviceDialog.h trunk/jazz/src/MouseAction.cpp trunk/jazz/src/MouseAction.h trunk/jazz/src/NamedChoice.cpp trunk/jazz/src/NamedChoice.h trunk/jazz/src/NamedValue.cpp trunk/jazz/src/NamedValue.h trunk/jazz/src/NamedValueChoice.cpp trunk/jazz/src/NamedValueChoice.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.h trunk/jazz/src/Project.cpp trunk/jazz/src/Project.h trunk/jazz/src/ProjectManager.h trunk/jazz/src/PropertyListDialog.cpp trunk/jazz/src/PropertyListDialog.h trunk/jazz/src/Random.cpp trunk/jazz/src/Random.h trunk/jazz/src/RecordingInfo.cpp trunk/jazz/src/RecordingInfo.h trunk/jazz/src/Rectangle.cpp trunk/jazz/src/Rectangle.h trunk/jazz/src/Resources.h trunk/jazz/src/Rhythm.cpp trunk/jazz/src/Rhythm.h trunk/jazz/src/Sample.cpp trunk/jazz/src/Sample.h trunk/jazz/src/SampleCommand.cpp trunk/jazz/src/SampleCommand.h trunk/jazz/src/SampleDialog.cpp trunk/jazz/src/SampleDialog.h trunk/jazz/src/SampleFrame.h trunk/jazz/src/SampleWindow.cpp trunk/jazz/src/SampleWindow.h trunk/jazz/src/SelectControllerDialog.cpp trunk/jazz/src/SelectControllerDialog.h trunk/jazz/src/Signal2.cpp trunk/jazz/src/Signal2.h trunk/jazz/src/SliderWindow.cpp trunk/jazz/src/SliderWindow.h trunk/jazz/src/Song.cpp trunk/jazz/src/Song.h trunk/jazz/src/StandardFile.cpp trunk/jazz/src/StandardFile.h trunk/jazz/src/StringReadWrite.cpp trunk/jazz/src/StringReadWrite.h trunk/jazz/src/StringUtilities.cpp trunk/jazz/src/StringUtilities.h trunk/jazz/src/Synth.cpp trunk/jazz/src/Synth.h trunk/jazz/src/ToolBar.cpp trunk/jazz/src/ToolBar.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/WindowsAudioInterface.h trunk/jazz/src/mswin/WindowsConsole.cpp trunk/jazz/src/mswin/WindowsConsole.h trunk/jazz/src/mswin/WindowsMidiInterface.cpp trunk/jazz/src/mswin/WindowsMidiInterface.h trunk/jazz/src/mswin/WindowsPlayer.cpp trunk/jazz/src/mswin/WindowsPlayer.h Modified: trunk/jazz/src/AboutDialog.cpp =================================================================== --- trunk/jazz/src/AboutDialog.cpp 2013-01-07 05:35:32 UTC (rev 950) +++ trunk/jazz/src/AboutDialog.cpp 2013-01-07 15:32:52 UTC (rev 951) @@ -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-2010 Peter J. Stieber +// Modifications Copyright (C) 2008-2013 Peter J. Stieber // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by Modified: trunk/jazz/src/AboutDialog.h =================================================================== --- trunk/jazz/src/AboutDialog.h 2013-01-07 05:35:32 UTC (rev 950) +++ trunk/jazz/src/AboutDialog.h 2013-01-07 15:32:52 UTC (rev 951) @@ -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-2010 Peter J. Stieber +// Modifications Copyright (C) 2008-2013 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 @@ -20,8 +20,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#ifndef JZ_ABOUTDIALOG_H -#define JZ_ABOUTDIALOG_H +#pragma once #include <wx/dialog.h> @@ -52,5 +51,3 @@ DECLARE_EVENT_TABLE() }; - -#endif // !defined(JZ_ABOUTDIALOG_H) Modified: trunk/jazz/src/AsciiMidiFile.cpp =================================================================== --- trunk/jazz/src/AsciiMidiFile.cpp 2013-01-07 05:35:32 UTC (rev 950) +++ trunk/jazz/src/AsciiMidiFile.cpp 2013-01-07 15:32:52 UTC (rev 951) @@ -2,7 +2,7 @@ // The JAZZ++ Midi Sequencer // // Copyright (C) 1994-2000 Andreas Voss and Per Sigmond, all rights reserved. -// Modifications Copyright (C) 2008-2010 Peter J. Stieber +// Modifications Copyright (C) 2008-2013 Peter J. Stieber // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by Modified: trunk/jazz/src/AsciiMidiFile.h =================================================================== --- trunk/jazz/src/AsciiMidiFile.h 2013-01-07 05:35:32 UTC (rev 950) +++ trunk/jazz/src/AsciiMidiFile.h 2013-01-07 15:32:52 UTC (rev 951) @@ -2,7 +2,7 @@ // The JAZZ++ Midi Sequencer // // Copyright (C) 1994-2000 Andreas Voss and Per Sigmond, all rights reserved. -// Modifications Copyright (C) 2008-2010 Peter J. Stieber +// Modifications Copyright (C) 2008-2013 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 @@ -19,8 +19,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#ifndef JZ_ASCIIMIDIFILE_H -#define JZ_ASCIIMIDIFILE_H +#pragma once #include "Events.h" @@ -52,6 +51,3 @@ virtual void NextTrack(); }; - - -#endif // !defined(JZ_ASCIIMIDIFILE_H) Modified: trunk/jazz/src/Audio.cpp =================================================================== --- trunk/jazz/src/Audio.cpp 2013-01-07 05:35:32 UTC (rev 950) +++ trunk/jazz/src/Audio.cpp 2013-01-07 15:32:52 UTC (rev 951) @@ -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-2010 Peter J. Stieber +// Modifications Copyright (C) 2008-2013 Peter J. Stieber // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by Modified: trunk/jazz/src/Audio.h =================================================================== --- trunk/jazz/src/Audio.h 2013-01-07 05:35:32 UTC (rev 950) +++ trunk/jazz/src/Audio.h 2013-01-07 15:32:52 UTC (rev 951) @@ -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-2010 Peter J. Stieber +// Modifications Copyright (C) 2008-2013 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 @@ -20,8 +20,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#ifndef JZ_AUDIO_H -#define JZ_AUDIO_H +#pragma once #include "DynamicArray.h" #include "Project.h" @@ -466,5 +465,3 @@ { return mFullBuffers; } - -#endif // !defined(JZ_AUDIO_H) Modified: trunk/jazz/src/Command.cpp =================================================================== --- trunk/jazz/src/Command.cpp 2013-01-07 05:35:32 UTC (rev 950) +++ trunk/jazz/src/Command.cpp 2013-01-07 15:32:52 UTC (rev 951) @@ -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-2010 Peter J. Stieber +// Modifications Copyright (C) 2008-2013 Peter J. Stieber // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by Modified: trunk/jazz/src/Command.h =================================================================== --- trunk/jazz/src/Command.h 2013-01-07 05:35:32 UTC (rev 950) +++ trunk/jazz/src/Command.h 2013-01-07 15:32:52 UTC (rev 951) @@ -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-2010 Peter J. Stieber +// Modifications Copyright (C) 2008-2013 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 @@ -20,8 +20,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#ifndef JZ_COMMAND_H -#define JZ_COMMAND_H +#pragma once #include "CommandUtilities.h" @@ -367,5 +366,3 @@ JZBarInfo* mpBarInfo; JZRndArray& mRandomArray; }; - -#endif // !defined(JZ_COMMAND_H) Modified: trunk/jazz/src/Configuration.cpp =================================================================== --- trunk/jazz/src/Configuration.cpp 2013-01-07 05:35:32 UTC (rev 950) +++ trunk/jazz/src/Configuration.cpp 2013-01-07 15:32:52 UTC (rev 951) @@ -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-2010 Peter J. Stieber +// Modifications Copyright (C) 2008-2013 Peter J. Stieber // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by Modified: trunk/jazz/src/Configuration.h =================================================================== --- trunk/jazz/src/Configuration.h 2013-01-07 05:35:32 UTC (rev 950) +++ trunk/jazz/src/Configuration.h 2013-01-07 15:32:52 UTC (rev 951) @@ -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-2010 Peter J. Stieber +// Modifications Copyright (C) 2008-2013 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 @@ -20,8 +20,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#ifndef JZ_CONFIGURATION_H -#define JZ_CONFIGURATION_H +#pragma once #include <string> #include <vector> @@ -334,5 +333,3 @@ { return mVoiceNames; } - -#endif // !defined(JZ_CONFIGURATION_H) Modified: trunk/jazz/src/ControlEdit.cpp =================================================================== --- trunk/jazz/src/ControlEdit.cpp 2013-01-07 05:35:32 UTC (rev 950) +++ trunk/jazz/src/ControlEdit.cpp 2013-01-07 15:32:52 UTC (rev 951) @@ -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-2010 Peter J. Stieber +// Modifications Copyright (C) 2008-2013 Peter J. Stieber // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by Modified: trunk/jazz/src/ControlEdit.h =================================================================== --- trunk/jazz/src/ControlEdit.h 2013-01-07 05:35:32 UTC (rev 950) +++ trunk/jazz/src/ControlEdit.h 2013-01-07 15:32:52 UTC (rev 951) @@ -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-2010 Peter J. Stieber +// Modifications Copyright (C) 2008-2013 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 @@ -20,8 +20,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#ifndef JZ_CONTROLEDIT_H -#define JZ_CONTROLEDIT_H +#pragma once #include "Random.h" @@ -278,5 +277,3 @@ virtual int GetValue(JZEvent *e); virtual JZEvent * NewEvent(long clock, int val); }; - -#endif // !defined(JZ_CONTROLEDIT_H) Modified: trunk/jazz/src/Dialogs/AudioSettingsDialog.h =================================================================== --- trunk/jazz/src/Dialogs/AudioSettingsDialog.h 2013-01-07 05:35:32 UTC (rev 950) +++ trunk/jazz/src/Dialogs/AudioSettingsDialog.h 2013-01-07 15:32:52 UTC (rev 951) @@ -18,8 +18,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#ifndef JZ_AUDIOSETTINGSDIALOG_H -#define JZ_AUDIOSETTINGSDIALOG_H +#pragma once #include <wx/dialog.h> @@ -44,5 +43,3 @@ wxCheckBox* mpStereoCheckBox; wxCheckBox* mpSoftwareMidiAudioSyncCheckBox; }; - -#endif // !defined(JZ_AUDIOSETTINGSDIALOG_H) Modified: trunk/jazz/src/Dialogs/CleanupDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/CleanupDialog.cpp 2013-01-07 05:35:32 UTC (rev 950) +++ trunk/jazz/src/Dialogs/CleanupDialog.cpp 2013-01-07 15:32:52 UTC (rev 951) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2009-2010 Peter J. Stieber, all rights reserved. +// Copyright (C) 2009-2013 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 Modified: trunk/jazz/src/Dialogs/CleanupDialog.h =================================================================== --- trunk/jazz/src/Dialogs/CleanupDialog.h 2013-01-07 05:35:32 UTC (rev 950) +++ trunk/jazz/src/Dialogs/CleanupDialog.h 2013-01-07 15:32:52 UTC (rev 951) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2009-2010 Peter J. Stieber, all rights reserved. +// Copyright (C) 2009-2013 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 @@ -18,8 +18,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#ifndef JZ_CLEANUPDIALOG_H -#define JZ_CLEANUPDIALOG_H +#pragma once #include <wx/dialog.h> @@ -57,5 +56,3 @@ DECLARE_EVENT_TABLE(); }; - -#endif // !defined(JZ_CLEANUPDIALOG_H) Modified: trunk/jazz/src/Dialogs/ControllerDialog.h =================================================================== --- trunk/jazz/src/Dialogs/ControllerDialog.h 2013-01-07 05:35:32 UTC (rev 950) +++ trunk/jazz/src/Dialogs/ControllerDialog.h 2013-01-07 15:32:52 UTC (rev 951) @@ -18,10 +18,8 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#ifndef JZ_CONTROLLERDIALOG_H -#define JZ_CONTROLLERDIALOG_H +#pragma once - #include <wx/dialog.h> class JZControlEvent; @@ -47,5 +45,3 @@ DECLARE_EVENT_TABLE(); }; - -#endif // !defined(JZ_CONTROLLERDIALOG_H) Modified: trunk/jazz/src/Dialogs/DeleteDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/DeleteDialog.cpp 2013-01-07 05:35:32 UTC (rev 950) +++ trunk/jazz/src/Dialogs/DeleteDialog.cpp 2013-01-07 15:32:52 UTC (rev 951) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2009-2010 Peter J. Stieber, all rights reserved. +// Copyright (C) 2009-2013 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 Modified: trunk/jazz/src/Dialogs/DeleteDialog.h =================================================================== --- trunk/jazz/src/Dialogs/DeleteDialog.h 2013-01-07 05:35:32 UTC (rev 950) +++ trunk/jazz/src/Dialogs/DeleteDialog.h 2013-01-07 15:32:52 UTC (rev 951) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2009-2010 Peter J. Stieber, all rights reserved. +// Copyright (C) 2009-2013 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 @@ -18,8 +18,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#ifndef JZ_DELETEDIALOG_H -#define JZ_DELETEDIALOG_H +#pragma once #include <wx/dialog.h> @@ -49,5 +48,3 @@ DECLARE_EVENT_TABLE(); }; - -#endif // !defined(JZ_DELETEDIALOG_H) Modified: trunk/jazz/src/Dialogs/EndOfTrackDialog.h =================================================================== --- trunk/jazz/src/Dialogs/EndOfTrackDialog.h 2013-01-07 05:35:32 UTC (rev 950) +++ trunk/jazz/src/Dialogs/EndOfTrackDialog.h 2013-01-07 15:32:52 UTC (rev 951) @@ -18,8 +18,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#ifndef JZ_ENDOFTRACKDIALOG_H -#define JZ_ENDOFTRACKDIALOG_H +#pragma once #include <wx/dialog.h> @@ -54,5 +53,3 @@ DECLARE_EVENT_TABLE(); }; - -#endif // !defined(JZ_ENDOFTRACKDIALOG_H) Modified: trunk/jazz/src/Dialogs/FilterDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/FilterDialog.cpp 2013-01-07 05:35:32 UTC (rev 950) +++ trunk/jazz/src/Dialogs/FilterDialog.cpp 2013-01-07 15:32:52 UTC (rev 951) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2008-2010 Peter J. Stieber, all rights reserved. +// Copyright (C) 2008-2013 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 Modified: trunk/jazz/src/Dialogs/FilterDialog.h =================================================================== --- trunk/jazz/src/Dialogs/FilterDialog.h 2013-01-07 05:35:32 UTC (rev 950) +++ trunk/jazz/src/Dialogs/FilterDialog.h 2013-01-07 15:32:52 UTC (rev 951) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2008-2010 Peter J. Stieber, all rights reserved. +// Copyright (C) 2008-2013 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 @@ -18,8 +18,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#ifndef JZ_FILTERDIALOG_H -#define JZ_FILTERDIALOG_H +#pragma once #include <wx/dialog.h> @@ -84,6 +83,3 @@ DECLARE_EVENT_TABLE(); }; - - -#endif // !defined(JZ_FILTERDIALOG_H) Modified: trunk/jazz/src/Dialogs/IntegerEdit.cpp =================================================================== --- trunk/jazz/src/Dialogs/IntegerEdit.cpp 2013-01-07 05:35:32 UTC (rev 950) +++ trunk/jazz/src/Dialogs/IntegerEdit.cpp 2013-01-07 15:32:52 UTC (rev 951) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2008-2010 Peter J. Stieber, all rights reserved. +// Copyright (C) 2008-2013 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 Modified: trunk/jazz/src/Dialogs/IntegerEdit.h =================================================================== --- trunk/jazz/src/Dialogs/IntegerEdit.h 2013-01-07 05:35:32 UTC (rev 950) +++ trunk/jazz/src/Dialogs/IntegerEdit.h 2013-01-07 15:32:52 UTC (rev 951) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2008-2010 Peter J. Stieber, all rights reserved. +// Copyright (C) 2008-2013 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 Modified: trunk/jazz/src/Dialogs/KeyOnDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/KeyOnDialog.cpp 2013-01-07 05:35:32 UTC (rev 950) +++ trunk/jazz/src/Dialogs/KeyOnDialog.cpp 2013-01-07 15:32:52 UTC (rev 951) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2008-2010 Peter J. Stieber, all rights reserved. +// Copyright (C) 2008-2013 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 Modified: trunk/jazz/src/Dialogs/KeyOnDialog.h =================================================================== --- trunk/jazz/src/Dialogs/KeyOnDialog.h 2013-01-07 05:35:32 UTC (rev 950) +++ trunk/jazz/src/Dialogs/KeyOnDialog.h 2013-01-07 15:32:52 UTC (rev 951) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2008-2010 Peter J. Stieber, all rights reserved. +// Copyright (C) 2008-2013 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 @@ -18,8 +18,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#ifndef JZ_KEYONDIALOG_H -#define JZ_KEYONDIALOG_H +#pragma once #include <wx/dialog.h> @@ -68,5 +67,3 @@ DECLARE_EVENT_TABLE(); }; - -#endif // !defined(JZ_KEYONDIALOG_H) Modified: trunk/jazz/src/Dialogs/LengthDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/LengthDialog.cpp 2013-01-07 05:35:32 UTC (rev 950) +++ trunk/jazz/src/Dialogs/LengthDialog.cpp 2013-01-07 15:32:52 UTC (rev 951) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2009-2010 Peter J. Stieber, all rights reserved. +// Copyright (C) 2009-2013 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 Modified: trunk/jazz/src/Dialogs/LengthDialog.h =================================================================== --- trunk/jazz/src/Dialogs/LengthDialog.h 2013-01-07 05:35:32 UTC (rev 950) +++ trunk/jazz/src/Dialogs/LengthDialog.h 2013-01-07 15:32:52 UTC (rev 951) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2009-2010 Peter J. Stieber, all rights reserved. +// Copyright (C) 2009-2013 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 @@ -18,8 +18,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#ifndef JZ_LENGTHDIALOG_H -#define JZ_LENGTHDIALOG_H +#pragma once #include "../CommandUtilities.h" @@ -70,5 +69,3 @@ DECLARE_EVENT_TABLE(); }; - -#endif // !defined(JZ_LENGTHDIALOG_H) Modified: trunk/jazz/src/Dialogs/MeterChangeDialog.h =================================================================== --- trunk/jazz/src/Dialogs/MeterChangeDialog.h 2013-01-07 05:35:32 UTC (rev 950) +++ trunk/jazz/src/Dialogs/MeterChangeDialog.h 2013-01-07 15:32:52 UTC (rev 951) @@ -18,8 +18,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#ifndef JZ_METERCHANGEDIALOG_H -#define JZ_METERCHANGEDIALOG_H +#pragma once #include <wx/dialog.h> @@ -45,5 +44,3 @@ DECLARE_EVENT_TABLE(); }; - -#endif // !defined(JZ_METERCHANGEDIALOG_H) Modified: trunk/jazz/src/Dialogs/MetronomeSettingsDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/MetronomeSettingsDialog.cpp 2013-01-07 05:35:32 UTC (rev 950) +++ trunk/jazz/src/Dialogs/MetronomeSettingsDialog.cpp 2013-01-07 15:32:52 UTC (rev 951) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2008-2010 Peter J. Stieber, all rights reserved. +// Copyright (C) 2008-2013 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 Modified: trunk/jazz/src/Dialogs/MetronomeSettingsDialog.h =================================================================== --- trunk/jazz/src/Dialogs/MetronomeSettingsDialog.h 2013-01-07 05:35:32 UTC (rev 950) +++ trunk/jazz/src/Dialogs/MetronomeSettingsDialog.h 2013-01-07 15:32:52 UTC (rev 951) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2008-2010 Peter J. Stieber, all rights reserved. +// Copyright (C) 2008-2013 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 @@ -18,8 +18,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#ifndef JZ_METRONOMESETTINGDIALOG_H -#define JZ_METRONOMESETTINGDIALOG_H +#pragma once #include <wx/dialog.h> @@ -80,5 +79,3 @@ DECLARE_EVENT_TABLE(); }; - -#endif // !defined(JZ_METRONOMESETTINGDIALOG_H) Modified: trunk/jazz/src/Dialogs/MidiChannelDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/MidiChannelDialog.cpp 2013-01-07 05:35:32 UTC (rev 950) +++ trunk/jazz/src/Dialogs/MidiChannelDialog.cpp 2013-01-07 15:32:52 UTC (rev 951) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2009-2010 Peter J. Stieber, all rights reserved. +// Copyright (C) 2009-2013 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 Modified: trunk/jazz/src/Dialogs/MidiChannelDialog.h =================================================================== --- trunk/jazz/src/Dialogs/MidiChannelDialog.h 2013-01-07 05:35:32 UTC (rev 950) +++ trunk/jazz/src/Dialogs/MidiChannelDialog.h 2013-01-07 15:32:52 UTC (rev 951) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2009-2010 Peter J. Stieber, all rights reserved. +// Copyright (C) 2009-2013 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 @@ -18,8 +18,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#ifndef JZ_MIDICHANNELDIALOG_H -#define JZ_MIDICHANNELDIALOG_H +#pragma once #include <wx/dialog.h> @@ -54,5 +53,3 @@ DECLARE_EVENT_TABLE(); }; - -#endif // !defined(JZ_MIDICHANNELDIALOG_H) Modified: trunk/jazz/src/Dialogs/PitchWheelDialog.h =================================================================== --- trunk/jazz/src/Dialogs/PitchWheelDialog.h 2013-01-07 05:35:32 UTC (rev 950) +++ trunk/jazz/src/Dialogs/PitchWheelDialog.h 2013-01-07 15:32:52 UTC (rev 951) @@ -18,8 +18,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#ifndef JZ_PITCHWHEELDIALOG_H -#define JZ_PITCHWHEELDIALOG_H +#pragma once class JZPitchEvent; class JZTrack; @@ -49,5 +48,3 @@ DECLARE_EVENT_TABLE(); }; - -#endif // !defined(JZ_PITCHWHEELDIALOG_H) Modified: trunk/jazz/src/Dialogs/ProgramChangeDialog.h =================================================================== --- trunk/jazz/src/Dialogs/ProgramChangeDialog.h 2013-01-07 05:35:32 UTC (rev 950) +++ trunk/jazz/src/Dialogs/ProgramChangeDialog.h 2013-01-07 15:32:52 UTC (rev 951) @@ -18,8 +18,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#ifndef JZ_PROGRAMCHANGEDIALOG_H -#define JZ_PROGRAMCHANGEDIALOG_H +#pragma once #include <wx/dialog.h> @@ -46,5 +45,3 @@ DECLARE_EVENT_TABLE(); }; - -#endif // !defined(JZ_PROGRAMCHANGEDIALOG_H) Modified: trunk/jazz/src/Dialogs/QuantizeDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/QuantizeDialog.cpp 2013-01-07 05:35:32 UTC (rev 950) +++ trunk/jazz/src/Dialogs/QuantizeDialog.cpp 2013-01-07 15:32:52 UTC (rev 951) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2009-2010 Peter J. Stieber, all rights reserved. +// Copyright (C) 2009-2013 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 Modified: trunk/jazz/src/Dialogs/QuantizeDialog.h =================================================================== --- trunk/jazz/src/Dialogs/QuantizeDialog.h 2013-01-07 05:35:32 UTC (rev 950) +++ trunk/jazz/src/Dialogs/QuantizeDialog.h 2013-01-07 15:32:52 UTC (rev 951) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2009-2010 Peter J. Stieber, all rights reserved. +// Copyright (C) 2009-2013 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 @@ -18,8 +18,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#ifndef JZ_QUANTIZEDIALOG_H -#define JZ_QUANTIZEDIALOG_H +#pragma once #include <wx/dialog.h> @@ -73,5 +72,3 @@ DECLARE_EVENT_TABLE(); }; - -#endif // !defined(JZ_QUANTIZEDIALOG_H) Modified: trunk/jazz/src/Dialogs/SamplesDialog.h =================================================================== --- trunk/jazz/src/Dialogs/SamplesDialog.h 2013-01-07 05:35:32 UTC (rev 950) +++ trunk/jazz/src/Dialogs/SamplesDialog.h 2013-01-07 15:32:52 UTC (rev 951) @@ -18,8 +18,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#ifndef JZ_SAMPLESDIALOG_H -#define JZ_SAMPLESDIALOG_H +#pragma once #include <wx/dialog.h> @@ -57,5 +56,3 @@ DECLARE_EVENT_TABLE() }; - -#endif // !defined(JZ_SAMPLESDIALOG_H) Modified: trunk/jazz/src/Dialogs/SearchAndReplaceDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/SearchAndReplaceDialog.cpp 2013-01-07 05:35:32 UTC (rev 950) +++ trunk/jazz/src/Dialogs/SearchAndReplaceDialog.cpp 2013-01-07 15:32:52 UTC (rev 951) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2009-2010 Peter J. Stieber, all rights reserved. +// Copyright (C) 2009-2013 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 Modified: trunk/jazz/src/Dialogs/SearchAndReplaceDialog.h =================================================================== --- trunk/jazz/src/Dialogs/SearchAndReplaceDialog.h 2013-01-07 05:35:32 UTC (rev 950) +++ trunk/jazz/src/Dialogs/SearchAndReplaceDialog.h 2013-01-07 15:32:52 UTC (rev 951) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2009-2010 Peter J. Stieber, all rights reserved. +// Copyright (C) 2009-2013 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 @@ -18,8 +18,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#ifndef JZ_SEARCHANDREPLACEDIALOG_H -#define JZ_SEARCHANDREPLACEDIALOG_H +#pragma once #include <wx/dialog.h> @@ -47,5 +46,3 @@ DECLARE_EVENT_TABLE(); }; - -#endif // !defined(JZ_SEARCHANDREPLACEDIALOG_H) Modified: trunk/jazz/src/Dialogs/SetTempoDialog.h =================================================================== --- trunk/jazz/src/Dialogs/SetTempoDialog.h 2013-01-07 05:35:32 UTC (rev 950) +++ trunk/jazz/src/Dialogs/SetTempoDialog.h 2013-01-07 15:32:52 UTC (rev 951) @@ -18,8 +18,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#ifndef JZ_SETTEMPODIALOG_H -#define JZ_SETTEMPODIALOG_H +#pragma once #include <wx/dialog.h> @@ -57,5 +56,3 @@ DECLARE_EVENT_TABLE(); }; - -#endif // !defined(JZ_SETTEMPODIALOG_H) Modified: trunk/jazz/src/Dialogs/ShiftDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/ShiftDialog.cpp 2013-01-07 05:35:32 UTC (rev 950) +++ trunk/jazz/src/Dialogs/ShiftDialog.cpp 2013-01-07 15:32:52 UTC (rev 951) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2008-2010 Peter J. Stieber, all rights reserved. +// Copyright (C) 2008-2013 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 Modified: trunk/jazz/src/Dialogs/ShiftDialog.h =================================================================== --- trunk/jazz/src/Dialogs/ShiftDialog.h 2013-01-07 05:35:32 UTC (rev 950) +++ trunk/jazz/src/Dialogs/ShiftDialog.h 2013-01-07 15:32:52 UTC (rev 951) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2008-2010 Peter J. Stieber, all rights reserved. +// Copyright (C) 2008-2013 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 @@ -18,8 +18,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#ifndef JZ_SHIFTDIALOG_H -#define JZ_SHIFTDIALOG_H +#pragma once #include <wx/dialog.h> @@ -61,5 +60,3 @@ DECLARE_EVENT_TABLE(); }; - -#endif // !defined(JZ_SHIFTDIALOG_H) Modified: trunk/jazz/src/Dialogs/SnapDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/SnapDialog.cpp 2013-01-07 05:35:32 UTC (rev 950) +++ trunk/jazz/src/Dialogs/SnapDialog.cpp 2013-01-07 15:32:52 UTC (rev 951) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2009-2010 Peter J. Stieber, all rights reserved. +// Copyright (C) 2009-2013 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 Modified: trunk/jazz/src/Dialogs/SnapDialog.h =================================================================== --- trunk/jazz/src/Dialogs/SnapDialog.h 2013-01-07 05:35:32 UTC (rev 950) +++ trunk/jazz/src/Dialogs/SnapDialog.h 2013-01-07 15:32:52 UTC (rev 951) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2009-2010 Peter J. Stieber, all rights reserved. +// Copyright (C) 2009-2013 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 @@ -18,8 +18,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#ifndef JZ_SNAPDIALOG_H -#define JZ_SNAPDIALOG_H +#pragma once #include <wx/dialog.h> @@ -49,5 +48,3 @@ DECLARE_EVENT_TABLE(); }; - -#endif // !defined(JZ_SNAPDIALOG_H) Modified: trunk/jazz/src/Dialogs/SynthesizerSettingsDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/SynthesizerSettingsDialog.cpp 2013-01-07 05:35:32 UTC (rev 950) +++ trunk/jazz/src/Dialogs/SynthesizerSettingsDialog.cpp 2013-01-07 15:32:52 UTC (rev 951) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2008-2010 Peter J. Stieber, all rights reserved. +// Copyright (C) 2008-2013 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 Modified: trunk/jazz/src/Dialogs/SynthesizerSettingsDialog.h =================================================================== --- trunk/jazz/src/Dialogs/SynthesizerSettingsDialog.h 2013-01-07 05:35:32 UTC (rev 950) +++ trunk/jazz/src/Dialogs/SynthesizerSettingsDialog.h 2013-01-07 15:32:52 UTC (rev 951) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2008-2010 Peter J. Stieber, all rights reserved. +// Copyright (C) 2008-2013 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 @@ -18,8 +18,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#ifndef JZ_SYNTHESIZERSETTINGDIALOG_H -#define JZ_SYNTHESIZERSETTINGDIALOG_H +#pragma once #include <wx/dialog.h> @@ -53,5 +52,3 @@ DECLARE_EVENT_TABLE(); }; - -#endif // !defined(JZ_SYNTHESIZERSETTINGDIALOG_H) Modified: trunk/jazz/src/Dialogs/SysexDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/SysexDialog.cpp 2013-01-07 05:35:32 UTC (rev 950) +++ trunk/jazz/src/Dialogs/SysexDialog.cpp 2013-01-07 15:32:52 UTC (rev 951) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2009-2010 Peter J. Stieber, all rights reserved. +// Copyright (C) 2009-2013 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 Modified: trunk/jazz/src/Dialogs/SysexDialog.h =================================================================== --- trunk/jazz/src/Dialogs/SysexDialog.h 2013-01-07 05:35:32 UTC (rev 950) +++ trunk/jazz/src/Dialogs/SysexDialog.h 2013-01-07 15:32:52 UTC (rev 951) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2009-2010 Peter J. Stieber, all rights reserved. +// Copyright (C) 2009-2013 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 @@ -18,8 +18,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#ifndef JZ_SYSEXDIALOG_H -#define JZ_SYSEXDIALOG_H +#pragma once #include <wx/dialog.h> @@ -58,5 +57,3 @@ DECLARE_EVENT_TABLE(); }; - -#endif // !defined(JZ_SYSEXDIALOG_H) Modified: trunk/jazz/src/Dialogs/TextDialog.h =================================================================== --- trunk/jazz/src/Dialogs/TextDialog.h 2013-01-07 05:35:32 UTC (rev 950) +++ trunk/jazz/src/Dialogs/TextDialog.h 2013-01-07 15:32:52 UTC (rev 951) @@ -18,8 +18,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#ifndef JZ_TEXTDIALOG_H -#define JZ_TEXTDIALOG_H +#pragma once #include <wx/dialog.h> @@ -52,5 +51,3 @@ DECLARE_EVENT_TABLE(); }; - -#endif // !defined(JZ_TEXTDIALOG_H) Modified: trunk/jazz/src/Dialogs/TrackDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/TrackDialog.cpp 2013-01-07 05:35:32 UTC (rev 950) +++ trunk/jazz/src/Dialogs/TrackDialog.cpp 2013-01-07 15:32:52 UTC (rev 951) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2008-2010 Peter J. Stieber, all rights reserved. +// Copyright (C) 2008-2013 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 Modified: trunk/jazz/src/Dialogs/TrackDialog.h =================================================================== --- trunk/jazz/src/Dialogs/TrackDialog.h 2013-01-07 05:35:32 UTC (rev 950) +++ trunk/jazz/src/Dialogs/TrackDialog.h 2013-01-07 15:32:52 UTC (rev 951) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2008-2010 Peter J. Stieber, all rights reserved. +// Copyright (C) 2008-2013 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 @@ -18,8 +18,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#ifndef JZ_TRACKDIALOG_H -#define JZ_TRACKDIALOG_H +#pragma once #include <wx/dialog.h> @@ -69,5 +68,3 @@ DECLARE_EVENT_TABLE(); }; - -#endif // !defined(JZ_TRACKDIALOG_H) Modified: trunk/jazz/src/Dialogs/TransposeDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/TransposeDialog.cpp 2013-01-07 05:35:32 UTC (rev 950) +++ trunk/jazz/src/Dialogs/TransposeDialog.cpp 2013-01-07 15:32:52 UTC (rev 951) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2009-2010 Peter J. Stieber, all rights reserved. +// Copyright (C) 2009-2013 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 Modified: trunk/jazz/src/Dialogs/TransposeDialog.h =================================================================== --- trunk/jazz/src/Dialogs/TransposeDialog.h 2013-01-07 05:35:32 UTC (rev 950) +++ trunk/jazz/src/Dialogs/TransposeDialog.h 2013-01-07 15:32:52 UTC (rev 951) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2009-2010 Peter J. Stieber, all rights reserved. +// Copyright (C) 2009-2013 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 @@ -18,8 +18,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#ifndef JZ_TRANSPOSEDIALOG_H -#define JZ_TRANSPOSEDIALOG_H +#pragma once #include <wx/dialog.h> @@ -65,5 +64,3 @@ DECLARE_EVENT_TABLE(); }; - -#endif // !defined(JZ_TRANSPOSEDIALOG_H) Modified: trunk/jazz/src/Dialogs/VelocityDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/VelocityDialog.cpp 2013-01-07 05:35:32 UTC (rev 950) +++ trunk/jazz/src/Dialogs/VelocityDialog.cpp 2013-01-07 15:32:52 UTC (rev 951) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2009-2010 Peter J. Stieber, all rights reserved. +// Copyright (C) 2009-2013 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 Modified: trunk/jazz/src/Dialogs/VelocityDialog.h =================================================================== --- trunk/jazz/src/Dialogs/VelocityDialog.h 2013-01-07 05:35:32 UTC (rev 950) +++ trunk/jazz/src/Dialogs/VelocityDialog.h 2013-01-07 15:32:52 UTC (rev 951) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2009-2010 Peter J. Stieber, all rights reserved. +// Copyright (C) 2009-2013 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 @@ -18,8 +18,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#ifndef JZ_VELOCITYDIALOG_H -#define JZ_VELOCITYDIALOG_H +#pragma once #include "../CommandUtilities.h" @@ -69,5 +68,3 @@ DECLARE_EVENT_TABLE(); }; - -#endif // !defined(JZ_VELOCITYDIALOG_H) Modified: trunk/jazz/src/Dialogs.cpp =================================================================== --- trunk/jazz/src/Dialogs.cpp 2013-01-07 05:35:32 UTC (rev 950) +++ trunk/jazz/src/Dialogs.cpp 2013-01-07 15:32:52 UTC (rev 951) @@ -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-2010 Peter J. Stieber +// Modifications Copyright (C) 2008-2013 Peter J. Stieber // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by Modified: trunk/jazz/src/Dialogs.h =================================================================== --- trunk/jazz/src/Dialogs.h 2013-01-07 05:35:32 UTC (rev 950) +++ trunk/jazz/src/Dialogs.h 2013-01-07 15:32:52 UTC (rev 951) @@ -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-2010 Peter J. Stieber +// Modifications Copyright (C) 2008-2013 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 @@ -20,8 +20,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#ifndef JZ_DIALOGS_H -#define JZ_DIALOGS_H +#pragma once #if 0 #include "CommandUtilities.h" @@ -114,5 +113,3 @@ long Clock, int Channel, int Pitch); - -#endif // !defined(JZ_DIALOGS_H) Modified: trunk/jazz/src/DynamicArray.cpp =================================================================== --- trunk/jazz/src/DynamicArray.cpp 2013-01-07 05:35:32 UTC (rev 950) +++ trunk/jazz/src/DynamicArray.cpp 2013-01-07 15:32:52 UTC (rev 951) @@ -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-2010 Peter J. Stieber +// Modifications Copyright (C) 2008-2013 Peter J. Stieber // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by Modified: trunk/jazz/src/DynamicArray.h =================================================================== --- trunk/jazz/src/DynamicArray.h 2013-01-07 05:35:32 UTC (rev 950) +++ trunk/jazz/src/DynamicArray.h 2013-01-07 15:32:52 UTC (rev 951) @@ -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-2010 Peter J. Stieber +// Modifications Copyright (C) 2008-2013 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 @@ -20,8 +20,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#ifndef JZ_DYNAMICARRAY_H -#define JZ_DYNAMICARRAY_H +#pragma once #include <assert.h> @@ -226,7 +225,4 @@ } }; - DECLARE_ARRAY(JZVoidPtrArray, void *) - -#endif // !defined(JZ_DYNAMICARRAY_H) Modified: trunk/jazz/src/ErrorMessage.cpp =================================================================== --- trunk/jazz/src/ErrorMessage.cpp 2013-01-07 05:35:32 UTC (rev 950) +++ trunk/jazz/src/ErrorMessage.cpp 2013-01-07 15:32:52 UTC (rev 951) @@ -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-2010 Peter J. Stieber +// Modifications Copyright (C) 2008-2013 Peter J. Stieber // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by Modified: trunk/jazz/src/ErrorMessage.h =================================================================== --- trunk/jazz/src/ErrorMessage.h 2013-01-07 05:35:32 UTC (rev 950) +++ trunk/jazz/src/ErrorMessage.h 2013-01-07 15:32:52 UTC (rev 951) @@ -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-2010 Peter J. Stieber +// Modifications Copyright (C) 2008-2013 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 @@ -20,13 +20,10 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#ifndef JZ_ERRORMESSAGE_H -#define JZ_ERRORMESSAGE_H +#pragma once #include <string> //***************************************************************************** //***************************************************************************** void Error(const std::string& ErrorMessage); - -#endif // !defined(JZ_ERRORMESSAGE_H) Modified: trunk/jazz/src/EventFrame.cpp =================================================================== --- trunk/jazz/src/EventFrame.cpp 2013-01-07 05:35:32 UTC (rev 950) +++ trunk/jazz/src/EventFrame.cpp 2013-01-07 15:32:52 UTC (rev 951) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2009-2010 Peter J. Stieber, all rights reserved. +// Copyright (C) 2009-2013 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 Modified: trunk/jazz/src/EventFrame.h =================================================================== --- trunk/jazz/src/EventFrame.h 2013-01-07 05:35:32 UTC (rev 950) +++ trunk/jazz/src/EventFrame.h 2013-01-07 15:32:52 UTC (rev 951) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2009-2010 Peter J. Stieber, all rights reserved. +// Copyright (C) 2009-2013 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 @@ -18,8 +18,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#ifndef JZ_EVENTFRAME_H -#define JZ_EVENTFRAME_H +#pragma once #include <wx/frame.h> @@ -93,5 +92,3 @@ DECLARE_EVENT_TABLE() }; - -#endif // !defined(JZ_EVENTFRAME_H) Modified: trunk/jazz/src/EventWindow.cpp =================================================================== --- trunk/jazz/src/EventWindow.cpp 2013-01-07 05:35:32 UTC (rev 950) +++ trunk/jazz/src/EventWindow.cpp 2013-01-07 15:32:52 UTC (rev 951) @@ -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-2010 Peter J. Stieber +// Modifications Copyright (C) 2008-2013 Peter J. Stieber // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by Modified: trunk/jazz/src/EventWindow.h =================================================================== --- trunk/jazz/src/EventWindow.h 2013-01-07 05:35:32 UTC (rev 950) +++ trunk/jazz/src/EventWindow.h 2013-01-07 15:32:52 UTC (rev 951) @@ -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-2010 Peter J. Stieber +// Modifications Copyright (C) 2008-2013 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 @@ -20,8 +20,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#ifndef JZ_EVENTWINDOW_H -#define JZ_EVENTWINDOW_H +#pragma once #include <wx/window.h> @@ -161,5 +160,3 @@ { return mpProject; } - -#endif // !defined(JZ_EVENTWINDOW_H) Modified: trunk/jazz/src/Events.cpp =============... [truncated message content] |
From: <pst...@us...> - 2013-01-08 04:34:53
|
Revision: 952 http://sourceforge.net/p/jazzplusplus/code/952 Author: pstieber Date: 2013-01-08 04:34:49 +0000 (Tue, 08 Jan 2013) Log Message: ----------- Changed header sentries to #pragma once. Modified Paths: -------------- trunk/jazz/src/AlsaDriver.h trunk/jazz/src/AlsaPlayer.h trunk/jazz/src/AlsaThru.h trunk/jazz/src/AudioDriver.h trunk/jazz/src/CommandUtilities.h trunk/jazz/src/ResourceDialog.h trunk/jazz/src/SignalInterface.h Modified: trunk/jazz/src/AlsaDriver.h =================================================================== --- trunk/jazz/src/AlsaDriver.h 2013-01-07 15:32:52 UTC (rev 951) +++ trunk/jazz/src/AlsaDriver.h 2013-01-08 04:34:49 UTC (rev 952) @@ -20,8 +20,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#ifndef JZ_ALSADRIVER_H -#define JZ_ALSADRIVER_H +#pragma once #include "Events.h" #include "Player.h" @@ -114,5 +113,3 @@ JZAlsaAudioListener* mpListener; JZAudioRecordBuffer recbuffers; }; - -#endif // !defined(JZ_ALSADRIVER_H) Modified: trunk/jazz/src/AlsaPlayer.h =================================================================== --- trunk/jazz/src/AlsaPlayer.h 2013-01-07 15:32:52 UTC (rev 951) +++ trunk/jazz/src/AlsaPlayer.h 2013-01-08 04:34:49 UTC (rev 952) @@ -20,8 +20,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#ifndef JZ_ALSAPLAY_H -#define JZ_ALSAPLAY_H +#pragma once #include "Player.h" #include "AlsaThru.h" @@ -147,6 +146,3 @@ JZAlsaThru *thru; int ithru, othru; // index in iaddr, oaddr of source/target device }; - - -#endif // !defined(JZ_ALSAPLAY_H) Modified: trunk/jazz/src/AlsaThru.h =================================================================== --- trunk/jazz/src/AlsaThru.h 2013-01-07 15:32:52 UTC (rev 951) +++ trunk/jazz/src/AlsaThru.h 2013-01-08 04:34:49 UTC (rev 952) @@ -20,8 +20,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#ifndef JZ_ALSATHRU_H -#define JZ_ALSATHRU_H +#pragma once #include <stdlib.h> #include <errno.h> @@ -95,5 +94,3 @@ pid_t worker; int running; }; - -#endif // !defined(JZ_ALSATHRU_H) Modified: trunk/jazz/src/AudioDriver.h =================================================================== --- trunk/jazz/src/AudioDriver.h 2013-01-07 15:32:52 UTC (rev 951) +++ trunk/jazz/src/AudioDriver.h 2013-01-08 04:34:49 UTC (rev 952) @@ -20,8 +20,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#ifndef JZ_AUDIODRIVER_H -#define JZ_AUDIODRIVER_H +#pragma once #include <sys/soundcard.h> // in oss/free (from kernel 2.0.29) the following is not implemented @@ -123,5 +122,3 @@ // Needed by buggy audio driver ... int force_read; }; - -#endif // !define(JZ_AUDIODRIVER_H) Modified: trunk/jazz/src/CommandUtilities.h =================================================================== --- trunk/jazz/src/CommandUtilities.h 2013-01-07 15:32:52 UTC (rev 951) +++ trunk/jazz/src/CommandUtilities.h 2013-01-08 04:34:49 UTC (rev 952) @@ -18,8 +18,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#ifndef JZ_COMMANDUTILITIES_H -#define JZ_COMMANDUTILITIES_H +#pragma once //***************************************************************************** //***************************************************************************** @@ -29,6 +28,3 @@ eAddValues, eSubtractValues }; - - -#endif // !defined(JZ_COMMANDUTILITIES_H) Modified: trunk/jazz/src/ResourceDialog.h =================================================================== --- trunk/jazz/src/ResourceDialog.h 2013-01-07 15:32:52 UTC (rev 951) +++ trunk/jazz/src/ResourceDialog.h 2013-01-08 04:34:49 UTC (rev 952) @@ -20,8 +20,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#ifndef JZ_RESOURCEDIALOG_H -#define JZ_RESOURCEDIALOG_H +#pragma once #include <list> @@ -245,5 +244,3 @@ /// The name of the dialog resource. Used in error reporting. wxString dialogName; }; - -#endif // !defined(JZ_RESOURCEDIALOG_H) Modified: trunk/jazz/src/SignalInterface.h =================================================================== --- trunk/jazz/src/SignalInterface.h 2013-01-07 15:32:52 UTC (rev 951) +++ trunk/jazz/src/SignalInterface.h 2013-01-08 04:34:49 UTC (rev 952) @@ -20,8 +20,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#ifndef JZ_SIGNALINTERFACE_H -#define JZ_SIGNALINTERFACE_H +#pragma once class JZRndArray; class JZSample; @@ -87,5 +86,3 @@ JZOpFilter* filter; float sr; }; - -#endif // !defined(JZ_SIGNALINTERFACE_H) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2013-03-17 10:18:23
|
Revision: 957 http://sourceforge.net/p/jazzplusplus/code/957 Author: pstieber Date: 2013-03-17 10:18:20 +0000 (Sun, 17 Mar 2013) Log Message: ----------- Added code to handle application close via the X while playing. Modified Paths: -------------- trunk/jazz/src/TrackFrame.cpp trunk/jazz/src/TrackFrame.h Modified: trunk/jazz/src/TrackFrame.cpp =================================================================== --- trunk/jazz/src/TrackFrame.cpp 2013-01-10 04:23:56 UTC (rev 956) +++ trunk/jazz/src/TrackFrame.cpp 2013-03-17 10:18:20 UTC (rev 957) @@ -77,6 +77,8 @@ //----------------------------------------------------------------------------- BEGIN_EVENT_TABLE(JZTrackFrame, JZEventFrame) + EVT_CLOSE(JZTrackFrame::OnClose) + EVT_MENU(wxID_NEW, JZTrackFrame::OnFileNew) EVT_MENU(wxID_OPEN, JZTrackFrame::OnFileOpenProject) @@ -472,6 +474,34 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- +void JZTrackFrame::OnClose(wxCloseEvent& CloseEvent) +{ + if (CloseEvent.CanVeto() && mpProject && mpProject->IsPlaying()) + { + if ( + wxMessageBox( + "Currently playing the MIDI file... continue closing?", + "Please confirm", + wxICON_QUESTION | wxYES_NO) != wxYES ) + { + CloseEvent.Veto(); + return; + } + } + + if (mpProject && mpProject->IsPlaying()) + { + // Since we cannont veto the close event, stop a playing project. + mpProject->Stop(); + } + + // At this point, we can either call Destroy(), or CloseEvent.Skip() + // since the default event handler also calls Destroy(). + CloseEvent.Skip(); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void JZTrackFrame::OnFileNew(wxCommandEvent& Event) { if (wxMessageBox("Clear Song?", "Sure?", wxOK | wxCANCEL) == wxOK) Modified: trunk/jazz/src/TrackFrame.h =================================================================== --- trunk/jazz/src/TrackFrame.h 2013-01-10 04:23:56 UTC (rev 956) +++ trunk/jazz/src/TrackFrame.h 2013-03-17 10:18:20 UTC (rev 957) @@ -69,6 +69,8 @@ void CreateMenu(); + void OnClose(wxCloseEvent& CloseEvent); + void OnFileNew(wxCommandEvent& Event); void OnFileOpenProject(wxCommandEvent& Event); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2013-03-17 10:53:50
|
Revision: 958 http://sourceforge.net/p/jazzplusplus/code/958 Author: pstieber Date: 2013-03-17 10:53:46 +0000 (Sun, 17 Mar 2013) Log Message: ----------- Added a "Visit Web Site..." button to the about dialog. Modified Paths: -------------- trunk/jazz/src/AboutDialog.cpp trunk/jazz/src/AboutDialog.h trunk/jazz/src/JazzPlusPlusApplication.h trunk/jazz/src/Resources.h Modified: trunk/jazz/src/AboutDialog.cpp =================================================================== --- trunk/jazz/src/AboutDialog.cpp 2013-03-17 10:18:20 UTC (rev 957) +++ trunk/jazz/src/AboutDialog.cpp 2013-03-17 10:53:46 UTC (rev 958) @@ -45,6 +45,8 @@ //----------------------------------------------------------------------------- BEGIN_EVENT_TABLE(JZAboutDialog, wxDialog) + EVT_BUTTON(IDC_BN_VISIT_WEB_SITE, JZAboutDialog::OnVisitWebSite) + EVT_BUTTON(wxID_HELP, JZAboutDialog::OnHelp) END_EVENT_TABLE() @@ -102,11 +104,6 @@ // + Paragraph2String + // "</p>" - "<p><center>" - "<a href=\"http://jazzplusplus.sourceforge.net/\">" - "http://jazzplusplus.sourceforge.net/</a>" - "</center></p>" - "<p><center>" + InformationString + "</center></p>" "<center><h5>" + "Credits" + "</h5></center>" @@ -167,6 +164,11 @@ wxBoxSizer* pButtonsSizer = new wxBoxSizer(wxHORIZONTAL); pButtonsSizer->Add(new wxButton(this, wxID_OK, "OK"), 0, wxALL, 10); + pButtonsSizer->Add( + new wxButton(this, IDC_BN_VISIT_WEB_SITE, "Visit Web Site..."), + 0, + wxALL, + 10); pButtonsSizer->Add(new wxButton(this, wxID_HELP, "Help"), 0, wxALL, 10); pTopSizer->Add(pButtonsSizer, 0, wxALIGN_CENTER); @@ -190,6 +192,13 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- +void JZAboutDialog::OnVisitWebSite(wxCommandEvent&) +{ + wxLaunchDefaultBrowser("http://jazzplusplus.sourceforge.net/"); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void JZAboutDialog::OnHelp(wxCommandEvent& Event) { ::wxGetApp().DisplayHelpContents(); Modified: trunk/jazz/src/AboutDialog.h =================================================================== --- trunk/jazz/src/AboutDialog.h 2013-03-17 10:18:20 UTC (rev 957) +++ trunk/jazz/src/AboutDialog.h 2013-03-17 10:53:46 UTC (rev 958) @@ -41,6 +41,8 @@ protected: + void OnVisitWebSite(wxCommandEvent& Event); + void OnHelp(wxCommandEvent& Event); protected: Modified: trunk/jazz/src/JazzPlusPlusApplication.h =================================================================== --- trunk/jazz/src/JazzPlusPlusApplication.h 2013-03-17 10:18:20 UTC (rev 957) +++ trunk/jazz/src/JazzPlusPlusApplication.h 2013-03-17 10:53:46 UTC (rev 958) @@ -164,9 +164,11 @@ // looking at old commit messages. // 11 1/21/2008 See minor version 3. // 12 9/1/2008 See minor version 4. +// 13 3/17/2013 Fixed closing while recording and/or playing back. +// 14 3/17/2013 Added "Visit Web Site..." button to the about dialog. //----------------------------------------------------------------------------- inline int JZJazzPlusPlusApplication::GetBuildNumber() const { - return 12; + return 14; } Modified: trunk/jazz/src/Resources.h =================================================================== --- trunk/jazz/src/Resources.h 2013-03-17 10:18:20 UTC (rev 957) +++ trunk/jazz/src/Resources.h 2013-03-17 10:53:46 UTC (rev 958) @@ -29,112 +29,114 @@ // of wxID_HIGHEST here. #define wxID_HIGHEST 5999 -#define ID_FILE_REVERT_TO_SAVED wxID_HIGHEST + 1 +#define ID_FILE_REVERT_TO_SAVED (wxID_HIGHEST + 1) -#define ID_IMPORT_MIDI wxID_HIGHEST + 2 -#define ID_EXPORT_MIDI wxID_HIGHEST + 3 -#define ID_EXPORT_SELECTION_AS_MIDI wxID_HIGHEST + 4 +#define ID_IMPORT_MIDI (wxID_HIGHEST + 2) +#define ID_EXPORT_MIDI (wxID_HIGHEST + 3) +#define ID_EXPORT_SELECTION_AS_MIDI (wxID_HIGHEST + 4) -#define ID_SETTINGS_METRONOME wxID_HIGHEST + 10 -#define ID_SETTINGS_SYNTHESIZER wxID_HIGHEST + 11 -#define ID_SETTINGS_MIDI_DEVICE wxID_HIGHEST + 12 -#define ID_SETTINGS_PITCH_PAINTER wxID_HIGHEST + 13 -#define ID_SETTINGS_WAHWAH wxID_HIGHEST + 14 +#define ID_SETTINGS_METRONOME (wxID_HIGHEST + 10) +#define ID_SETTINGS_SYNTHESIZER (wxID_HIGHEST + 11) +#define ID_SETTINGS_MIDI_DEVICE (wxID_HIGHEST + 12) +#define ID_SETTINGS_PITCH_PAINTER (wxID_HIGHEST + 13) +#define ID_SETTINGS_WAHWAH (wxID_HIGHEST + 14) -#define ID_EDIT_PASTE_MERGE wxID_HIGHEST + 15 -#define ID_EDIT_MAXIMIZE_VOLUME wxID_HIGHEST + 16 +#define ID_EDIT_PASTE_MERGE (wxID_HIGHEST + 15) +#define ID_EDIT_MAXIMIZE_VOLUME (wxID_HIGHEST + 16) -#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 -#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_AUDIO_GLOBAL_SETTINGS (wxID_HIGHEST + 20) +#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_EFFECTS_EQUALIZER wxID_HIGHEST + 27 -#define ID_EFFECTS_FILTER wxID_HIGHEST + 28 -#define ID_EFFECTS_DISTORTION wxID_HIGHEST + 29 -#define ID_EFFECTS_REVERB wxID_HIGHEST + 30 -#define ID_EFFECTS_ECHO wxID_HIGHEST + 31 -#define ID_EFFECTS_CHORUS wxID_HIGHEST + 32 -#define ID_EFFECTS_PITCH_SHIFTER wxID_HIGHEST + 33 -#define ID_EFFECTS_STRETCHER wxID_HIGHEST + 34 -#define ID_EFFECTS_REVERSE wxID_HIGHEST + 35 -#define ID_EFFECTS_SYNTH wxID_HIGHEST + 36 +#define ID_EFFECTS_EQUALIZER (wxID_HIGHEST + 27) +#define ID_EFFECTS_FILTER (wxID_HIGHEST + 28) +#define ID_EFFECTS_DISTORTION (wxID_HIGHEST + 29) +#define ID_EFFECTS_REVERB (wxID_HIGHEST + 30) +#define ID_EFFECTS_ECHO (wxID_HIGHEST + 31) +#define ID_EFFECTS_CHORUS (wxID_HIGHEST + 32) +#define ID_EFFECTS_PITCH_SHIFTER (wxID_HIGHEST + 33) +#define ID_EFFECTS_STRETCHER (wxID_HIGHEST + 34) +#define ID_EFFECTS_REVERSE (wxID_HIGHEST + 35) +#define ID_EFFECTS_SYNTH (wxID_HIGHEST + 36) -#define ID_PAINTERS_VOLUME wxID_HIGHEST + 37 -#define ID_PAINTER_WAHWAH wxID_HIGHEST + 38 -#define ID_PAINTER_PAN wxID_HIGHEST + 39 -#define ID_PAINTER_PITCH wxID_HIGHEST + 40 -#define ID_PAINTER_NONE wxID_HIGHEST + 41 +#define ID_PAINTERS_VOLUME (wxID_HIGHEST + 37) +#define ID_PAINTER_WAHWAH (wxID_HIGHEST + 38) +#define ID_PAINTER_PAN (wxID_HIGHEST + 39) +#define ID_PAINTER_PITCH (wxID_HIGHEST + 40) +#define ID_PAINTER_NONE (wxID_HIGHEST + 41) -#define ID_TRIM wxID_HIGHEST + 50 -#define ID_QUANTIZE wxID_HIGHEST + 51 -#define ID_SET_CHANNEL wxID_HIGHEST + 52 -#define ID_SHIFT wxID_HIGHEST + 53 -#define ID_SHIFT_LEFT wxID_HIGHEST + 54 -#define ID_SHIFT_RIGHT wxID_HIGHEST + 55 -#define ID_SNAP wxID_HIGHEST + 56 -#define ID_SNAP_8 wxID_HIGHEST + 57 -#define ID_SNAP_8D wxID_HIGHEST + 58 -#define ID_SNAP_16 wxID_HIGHEST + 59 -#define ID_SNAP_16D wxID_HIGHEST + 60 -#define ID_MIXER wxID_HIGHEST + 61 -#define ID_PIANOWIN wxID_HIGHEST + 62 -#define ID_METRONOME_TOGGLE wxID_HIGHEST + 63 -#define ID_VELOCITY wxID_HIGHEST + 64 -#define ID_LENGTH wxID_HIGHEST + 65 -#define ID_MISC_TRACK_MERGE wxID_HIGHEST + 66 -#define ID_MISC_SPLIT_TRACKS wxID_HIGHEST + 67 -#define ID_MISC_METER_CHANGE wxID_HIGHEST + 68 -#define ID_MISC_RESET_MIDI wxID_HIGHEST + 69 -#define ID_MISC_SET_COPYRIGHT wxID_HIGHEST + 70 -#define ID_TRANSPOSE wxID_HIGHEST + 71 -#define ID_CLEANUP wxID_HIGHEST + 72 -#define ID_SEARCH_AND_REPLACE wxID_HIGHEST + 73 +#define ID_TRIM (wxID_HIGHEST + 50) +#define ID_QUANTIZE (wxID_HIGHEST + 51) +#define ID_SET_CHANNEL (wxID_HIGHEST + 52) +#define ID_SHIFT (wxID_HIGHEST + 53) +#define ID_SHIFT_LEFT (wxID_HIGHEST + 54) +#define ID_SHIFT_RIGHT (wxID_HIGHEST + 55) +#define ID_SNAP (wxID_HIGHEST + 56) +#define ID_SNAP_8 (wxID_HIGHEST + 57) +#define ID_SNAP_8D (wxID_HIGHEST + 58) +#define ID_SNAP_16 (wxID_HIGHEST + 59) +#define ID_SNAP_16D (wxID_HIGHEST + 60) +#define ID_MIXER (wxID_HIGHEST + 61) +#define ID_PIANOWIN (wxID_HIGHEST + 62) +#define ID_METRONOME_TOGGLE (wxID_HIGHEST + 63) +#define ID_VELOCITY (wxID_HIGHEST + 64) +#define ID_LENGTH (wxID_HIGHEST + 65) +#define ID_MISC_TRACK_MERGE (wxID_HIGHEST + 66) +#define ID_MISC_SPLIT_TRACKS (wxID_HIGHEST + 67) +#define ID_MISC_METER_CHANGE (wxID_HIGHEST + 68) +#define ID_MISC_RESET_MIDI (wxID_HIGHEST + 69) +#define ID_MISC_SET_COPYRIGHT (wxID_HIGHEST + 70) +#define ID_TRANSPOSE (wxID_HIGHEST + 71) +#define ID_CLEANUP (wxID_HIGHEST + 72) +#define ID_SEARCH_AND_REPLACE (wxID_HIGHEST + 73) -#define ID_PLAY wxID_HIGHEST + 80 -#define ID_PLAY_LOOP wxID_HIGHEST + 81 -#define ID_RECORD wxID_HIGHEST + 82 +#define ID_PLAY (wxID_HIGHEST + 80) +#define ID_PLAY_LOOP (wxID_HIGHEST + 81) +#define ID_RECORD (wxID_HIGHEST + 82) -#define ID_SELECT wxID_HIGHEST + 85 +#define ID_SELECT (wxID_HIGHEST + 85) -#define ID_CHANGE_LENGTH wxID_HIGHEST + 90 +#define ID_CHANGE_LENGTH (wxID_HIGHEST + 90) -#define ID_EVENT_DIALOG wxID_HIGHEST + 91 -#define ID_CUT_PASTE_EVENTS wxID_HIGHEST + 92 -#define ID_SHOW_ALL_EVENTS_FROM_ALL_TRACKS wxID_HIGHEST + 93 +#define ID_EVENT_DIALOG (wxID_HIGHEST + 91) +#define ID_CUT_PASTE_EVENTS (wxID_HIGHEST + 92) +#define ID_SHOW_ALL_EVENTS_FROM_ALL_TRACKS (wxID_HIGHEST + 93) -#define ID_TOOLS_HARMONY_BROWSER wxID_HIGHEST + 95 +#define ID_TOOLS_HARMONY_BROWSER (wxID_HIGHEST + 95) -#define ID_HELP_PIANO_WINDOW wxID_HIGHEST + 100 +#define ID_HELP_PIANO_WINDOW (wxID_HIGHEST + 100) -#define MEN_CLEAR wxID_HIGHEST + 110 -#define ID_VIEW_SETTINGS wxID_HIGHEST + 120 +#define MEN_CLEAR (wxID_HIGHEST + 110) +#define ID_VIEW_SETTINGS (wxID_HIGHEST + 120) -#define IDC_KB_VOLUME wxID_HIGHEST + 1000 +#define IDC_BN_VISIT_WEB_SITE (wxID_HIGHEST + 1000) -#define IDC_KB_VELOCITY wxID_HIGHEST + 1100 -#define IDC_KB_OFF_VELOCITY wxID_HIGHEST + 1101 -#define IDC_KB_CHANNEL wxID_HIGHEST + 1102 +#define IDC_KB_VOLUME (wxID_HIGHEST + 1050) +#define IDC_KB_VELOCITY (wxID_HIGHEST + 1100) +#define IDC_KB_OFF_VELOCITY (wxID_HIGHEST + 1101) +#define IDC_KB_CHANNEL (wxID_HIGHEST + 1102) + // JZVelocityDialog resource IDs. -#define IDC_KB_VELOCITY_START wxID_HIGHEST + 1200 -#define IDC_KB_VELOCITY_STOP wxID_HIGHEST + 1201 +#define IDC_KB_VELOCITY_START (wxID_HIGHEST + 1200) +#define IDC_KB_VELOCITY_STOP (wxID_HIGHEST + 1201) // JZLengthDialog resource IDs. -#define IDC_KB_LENGTH_START wxID_HIGHEST + 1210 -#define IDC_KB_LENGTH_STOP wxID_HIGHEST + 1211 +#define IDC_KB_LENGTH_START (wxID_HIGHEST + 1210) +#define IDC_KB_LENGTH_STOP (wxID_HIGHEST + 1211) // JZMidiChannelDialog resource IDs. -#define IDC_KB_MIDI_CHANNEL wxID_HIGHEST + 1220 +#define IDC_KB_MIDI_CHANNEL (wxID_HIGHEST + 1220) // JZQuantizeDialog resource IDs. -#define IDC_KB_GROOVE wxID_HIGHEST + 1230 -#define IDC_KB_DELAY wxID_HIGHEST + 1231 +#define IDC_KB_GROOVE (wxID_HIGHEST + 1230) +#define IDC_KB_DELAY (wxID_HIGHEST + 1231) // JZTransposeDialog resource IDs. -#define IDC_KB_AMOUNT wxID_HIGHEST + 1232 +#define IDC_KB_AMOUNT (wxID_HIGHEST + 1232) // JZSamplesDialog resource IDs. -#define IDC_BN_SD_FILE_SELECT_BROWSE wxID_HIGHEST + 1240 +#define IDC_BN_SD_FILE_SELECT_BROWSE (wxID_HIGHEST + 1240) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2013-03-17 23:02:57
|
Revision: 962 http://sourceforge.net/p/jazzplusplus/code/962 Author: pstieber Date: 2013-03-17 23:02:54 +0000 (Sun, 17 Mar 2013) Log Message: ----------- 1. Updated to use std::string for file names. 2. Updated read and write code and removed old commented code and added several events. Modified Paths: -------------- trunk/jazz/src/AsciiMidiFile.cpp trunk/jazz/src/AsciiMidiFile.h Modified: trunk/jazz/src/AsciiMidiFile.cpp =================================================================== --- trunk/jazz/src/AsciiMidiFile.cpp 2013-03-17 23:01:02 UTC (rev 961) +++ trunk/jazz/src/AsciiMidiFile.cpp 2013-03-17 23:02:54 UTC (rev 962) @@ -21,26 +21,34 @@ #include "AsciiMidiFile.h" +#include "ErrorMessage.h" + #include <iomanip> +#include <sstream> using namespace std; //***************************************************************************** +// Description: +// This is the ASCII reader class. This is used to debug MIDI events. //***************************************************************************** //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -int JZAsciiRead::Open(const char* pFileName) +int JZAsciiRead::Open(const string& FileName) { + mIfs.open(FileName.c_str()); + if (!mIfs) + { + ostringstream Oss; + Oss << "Error opening file " << FileName; + Error(Oss.str()); + return 0; + } + int TrackCount, TicksPerQuarter; string Junk; - mIfs >> Junk >> TrackCount >> Junk >> TicksPerQuarter; + mIfs >> Junk >> TrackCount >> Junk >> Junk >> TicksPerQuarter; if (mIfs.fail()) -// if ( -// fscanf( -// mpFd, -// "Tracks %d, TicksPerQuarter %d\n", -// &TrackCount, -// &TicksPerQuarter) != 2) { return 0; } @@ -55,16 +63,8 @@ int Clock; int StatusByte, Channel, Length; - mIfs >> Clock >> StatusByte >> Channel >> Length; + mIfs >> Clock >> hex >> StatusByte >> dec >> Channel >> Length; if (mIfs.fail()) -// if ( -// fscanf( -// mpFd, -// "%6lu %02x %2d %d ", -// &Clock, -// &StatusByte, -// &Channel, -// &Length) != 4) { return pEvent; } @@ -73,8 +73,12 @@ for (int i = 0; i < Length; ++i) { int d; - mIfs >> d; -// fscanf(mpFd, "%02x ", &d); + mIfs >> hex >> d >> dec; + if (mIfs.fail()) + { + delete [] pBuffer; + return pEvent; + } pBuffer[i] = (unsigned char)d; } @@ -91,22 +95,58 @@ pEvent = new JZKeyOnEvent(Clock, Channel, pBuffer[0], pBuffer[1]); break; + case StatKeyPressure: + pEvent = new JZKeyPressureEvent(Clock, Channel, pBuffer[0], pBuffer[1]); + break; + case StatControl: pEvent = new JZControlEvent(Clock, Channel, pBuffer[0], pBuffer[1]); break; + case StatProgram: + pEvent = new JZProgramEvent(Clock, Channel, pBuffer[0]); + break; + + case StatChnPressure: + pEvent = new JZChnPressureEvent(Clock, Channel, pBuffer[0]); + break; + case StatPitch: pEvent = new JZPitchEvent(Clock, Channel, pBuffer[0], pBuffer[1]); break; - case StatProgram: - pEvent = new JZProgramEvent(Clock, Channel, pBuffer[0]); + case StatSysEx: + pEvent = new JZSysExEvent(Clock, pBuffer, Length); break; + case StatSongPtr: + pEvent = new JZSongPtrEvent(Clock, pBuffer, Length); + break; + + case StatMidiClock: + pEvent = new JZMidiClockEvent(Clock, pBuffer, Length); + break; + + case StatStartPlay: + pEvent = new JZStartPlayEvent(Clock, pBuffer, Length); + break; + + case StatContPlay: + pEvent = new JZContPlayEvent(Clock, pBuffer, Length); + break; + + case StatStopPlay: + pEvent = new JZStopPlayEvent(Clock, pBuffer, Length); + break; + case StatText: pEvent = new JZTextEvent(Clock, pBuffer, Length); break; + case StatCopyright: + pEvent = new JZCopyrightEvent(Clock, pBuffer, Length); + break; + case StatTrackName: pEvent = new JZTrackNameEvent(Clock, pBuffer, Length); break; @@ -116,12 +156,17 @@ break; case StatEndOfTrack: + pEvent = new JZEndOfTrackEvent(Clock); break; case StatSetTempo: pEvent = new JZSetTempoEvent(Clock, pBuffer[0], pBuffer[1], pBuffer[2]); break; + case StatMtcOffset: + pEvent = new JZMtcOffsetEvent(Clock, pBuffer, Length); + break; + case StatTimeSignat: pEvent = new JZTimeSignatEvent( Clock, @@ -131,9 +176,28 @@ pBuffer[3]); break; - case StatSysEx: - pEvent = new JZSysExEvent(Clock, pBuffer, Length); + case StatKeySignat: + pEvent = new JZKeySignatEvent(Clock, pBuffer[0], pBuffer[1]); break; + + case StatJazzMeta: + if (memcmp(pBuffer, "JAZ2", 4) == 0) + { + pEvent = new JZJazzMetaEvent(Clock, pBuffer, Length); + } + else + { + pEvent = new JZMetaEvent(Clock, StatusByte, pBuffer, Length); + } + break; + + case StatPlayTrack: + pEvent = new JZPlayTrackEvent(Clock, pBuffer, Length); + break; + + case 33: + pEvent = new JZMetaEvent(Clock, StatusByte, pBuffer, Length); + break; } delete [] pBuffer; @@ -148,33 +212,31 @@ string String; mIfs >> String; return String == "NextTrack"; -// return fscanf(mpFd, "NextTrack\n") == 0; } //***************************************************************************** // Description: -// Ascii-Output (debug) +// This is the ASCII writer class. This is used to debug MIDI events. //***************************************************************************** //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- int JZAsciiWrite::Open( - const char* pFileName, + const string& FileName, int TrackCount, int TicksPerQuarter) { - if (!JZWriteBase::Open(pFileName, TrackCount, TicksPerQuarter)) + mOfs.open(FileName.c_str()); + if (!mOfs) { + ostringstream Oss; + Oss << "Error opening file " << FileName; + Error(Oss.str()); return 0; } mOfs << "Tracks " << TrackCount << ", TicksPerQuarter " << TicksPerQuarter << endl; -// fprintf( -// mpFd, -// "Tracks %d, TicksPerQuarter %d\n", -// TrackCount, -// TicksPerQuarter); return TrackCount; } @@ -187,29 +249,24 @@ mOfs << setw(6) << pEvent->GetClock() - << ' ' << setw(2) << hex << pEvent->GetStat() - << ' ' << dec; -// fprintf(mpFd, "%6d %02x ", pEvent->GetClock(), pEvent->GetStat()); + << ' ' << setw(2) << hex << static_cast<unsigned>(pEvent->GetStat()) + << dec; if ((pChannelEvent = pEvent->IsChannelEvent()) != 0) { - mOfs << setw(2) << pChannelEvent->GetChannel() << ' '; -// fprintf(mpFd, "%2d ", pChannelEvent->GetChannel()); + mOfs + << ' ' << setw(2) << static_cast<unsigned>(pChannelEvent->GetChannel()); } else { - mOfs << "-1 "; -// fprintf(mpFd, "-1 "); + mOfs << " -1"; } - mOfs << Length << ' '; -// fprintf(mpFd, "%d ", Length); + mOfs << ' ' << Length; for (int i = 0; i < Length; ++i) { - mOfs << setw(2) << hex << pData[i] << dec; -// fprintf(mpFd, "%02x ", pData[i]); + mOfs << ' ' << setw(2) << hex << static_cast<unsigned>(pData[i]) << dec; } - mOfs << '\n'; -// fprintf(mpFd, "\n"); + mOfs << endl; return 0; } @@ -219,5 +276,4 @@ void JZAsciiWrite::NextTrack() { mOfs << "NextTrack" << endl; -// fprintf(mpFd, "NextTrack\n"); } Modified: trunk/jazz/src/AsciiMidiFile.h =================================================================== --- trunk/jazz/src/AsciiMidiFile.h 2013-03-17 23:01:02 UTC (rev 961) +++ trunk/jazz/src/AsciiMidiFile.h 2013-03-17 23:02:54 UTC (rev 962) @@ -29,7 +29,7 @@ { public: - virtual int Open(const char* pFileName); + virtual int Open(const std::string& FileName); virtual JZEvent* Read(); @@ -43,7 +43,7 @@ public: virtual int Open( - const char* pFileName, + const std::string& FileName, int TrackCount, int TicksPerQuarter); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2013-03-17 23:04:55
|
Revision: 963 http://sourceforge.net/p/jazzplusplus/code/963 Author: pstieber Date: 2013-03-17 23:04:53 +0000 (Sun, 17 Mar 2013) Log Message: ----------- 1. Updated to use std::string for file names. 2. Updated to use C++ streams instead of C-style I/O. Modified Paths: -------------- trunk/jazz/src/Events.cpp trunk/jazz/src/Events.h Modified: trunk/jazz/src/Events.cpp =================================================================== --- trunk/jazz/src/Events.cpp 2013-03-17 23:02:54 UTC (rev 962) +++ trunk/jazz/src/Events.cpp 2013-03-17 23:04:53 UTC (rev 963) @@ -27,10 +27,6 @@ #include "JazzPlusPlusApplication.h" #include "Synth.h" -#include <cassert> -#include <cstdarg> -#include <cstdio> -#include <cstdlib> #include <sstream> using namespace std; @@ -42,7 +38,7 @@ JZReadBase::JZReadBase() : mTicksPerQuarter(0), mTrackCount(0), - mpFd(NULL) + mIfs() { } @@ -54,23 +50,16 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -int JZReadBase::Open(const char* pFileName) +int JZReadBase::Open(const string& FileName) { - if (pFileName == NULL) + mIfs.open(FileName.c_str(), ios::binary); + if (!mIfs) { - mpFd = stdin; + ostringstream Oss; + Oss << "Error opening file " << FileName; + Error(Oss.str()); + return 0; } - else - { - mpFd = fopen(pFileName, "rb"); - if (mpFd == NULL) - { - ostringstream Oss; - Oss << "Error opening file " << pFileName; - Error(Oss.str()); - return 0; - } - } return 1; } @@ -78,10 +67,7 @@ //----------------------------------------------------------------------------- void JZReadBase::Close() { - if (mpFd != stdin) - { - fclose(mpFd); - } + mIfs.close(); } //***************************************************************************** @@ -89,7 +75,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- JZWriteBase::JZWriteBase() - : mpFd(NULL) + : mOfs() { } @@ -102,40 +88,18 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- int JZWriteBase::Open( - const char* pFileName, + const string& FileName, int TrackCount, int TicksPerQuarter) { - if (pFileName == NULL) + mOfs.open(FileName.c_str(), ios::binary); + if (!mOfs) { - mpFd = stdout; + ostringstream Oss; + Oss << "Error opening file " << FileName; + Error(Oss.str()); + return 0; } - else - { -#ifndef __WXMSW__ - FILE *testfd = fopen(pFileName, "r"); - if (testfd) - { - fclose(testfd); - char *syscmd; - syscmd = new char[strlen("cp") + 2 * strlen(pFileName) + strlen(".backup") + 3]; - sprintf(syscmd, "cp %s %s.backup", pFileName, pFileName); - if (system(syscmd) != 0) - { - fprintf(stderr, "Could not make backup file %s.backup\n", pFileName); - } - delete syscmd; - } -#endif - mpFd = fopen(pFileName, "wb"); - if (mpFd == NULL) - { - ostringstream Oss; - Oss << "Error opening file " << pFileName; - Error(Oss.str()); - return 0; - } - } return TrackCount; } @@ -143,10 +107,7 @@ //----------------------------------------------------------------------------- void JZWriteBase::Close() { - if (mpFd != stdout) - { - fclose(mpFd); - } + mOfs.close(); } //***************************************************************************** Modified: trunk/jazz/src/Events.h =================================================================== --- trunk/jazz/src/Events.h 2013-03-17 23:02:54 UTC (rev 962) +++ trunk/jazz/src/Events.h 2013-03-17 23:04:53 UTC (rev 963) @@ -22,7 +22,8 @@ #pragma once -#include <cstdio> +#include <fstream> +#include <string> #include <wx/pen.h> @@ -42,7 +43,7 @@ virtual ~JZReadBase(); - virtual int Open(const char* pFileName); + virtual int Open(const std::string& FileName); virtual void Close(); @@ -59,7 +60,7 @@ int mTrackCount; - FILE* mpFd; + std::ifstream mIfs; }; //***************************************************************************** @@ -85,7 +86,7 @@ virtual ~JZWriteBase(); virtual int Open( - const char* pFileName, + const std::string& FileName, int TrackCount, int TicksPerQuarter); @@ -122,7 +123,7 @@ protected: - FILE* mpFd; + std::ofstream mOfs; }; //***************************************************************************** @@ -212,7 +213,7 @@ { public: - int Open(const char* pFileName, int nTracks, int TicksPerQuarter) + int Open(const std::string& FileName, int nTracks, int TicksPerQuarter) { return 1; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2013-03-17 23:07:42
|
Revision: 965 http://sourceforge.net/p/jazzplusplus/code/965 Author: pstieber Date: 2013-03-17 23:07:39 +0000 (Sun, 17 Mar 2013) Log Message: ----------- Updated to use std::string for file names. Modified Paths: -------------- trunk/jazz/src/Song.cpp trunk/jazz/src/Song.h Modified: trunk/jazz/src/Song.cpp =================================================================== --- trunk/jazz/src/Song.cpp 2013-03-17 23:06:42 UTC (rev 964) +++ trunk/jazz/src/Song.cpp 2013-03-17 23:07:39 UTC (rev 965) @@ -170,7 +170,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZSong::Read(JZReadBase& Io, const char* pFileName) +void JZSong::Read(JZReadBase& Io, const string& FileName) { int i; wxBeginBusyCursor(); @@ -178,7 +178,7 @@ { mTracks[i].Clear(); } - int n = Io.Open(pFileName); + int n = Io.Open(FileName); for (i = 0; i < n && i < eMaxTrackCount; ++i) { mTracks[i].Read(Io); @@ -207,7 +207,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZSong::Write(JZWriteBase& Io, const char* pFileName) +void JZSong::Write(JZWriteBase& Io, const string& FileName) { // Make sure track 0 has a synth reset if (!mTracks[0].mpReset) @@ -217,7 +217,7 @@ } int n = NumUsedTracks(); - if (!Io.Open(pFileName, n, mTicksPerQuarter)) + if (!Io.Open(FileName, n, mTicksPerQuarter)) { return; } Modified: trunk/jazz/src/Song.h =================================================================== --- trunk/jazz/src/Song.h 2013-03-17 23:06:42 UTC (rev 964) +++ trunk/jazz/src/Song.h 2013-03-17 23:07:39 UTC (rev 965) @@ -94,9 +94,9 @@ void Clear(); - void Read(JZReadBase& Io, const char* pFileName = 0); + void Read(JZReadBase& Io, const std::string& FileName); - void Write(JZWriteBase& Io, const char* pFileName = 0); + void Write(JZWriteBase& Io, const std::string& FileName); JZTrack* GetTrack(int TrackIndex); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2013-03-17 23:12:02
|
Revision: 966 http://sourceforge.net/p/jazzplusplus/code/966 Author: pstieber Date: 2013-03-17 23:12:01 +0000 (Sun, 17 Mar 2013) Log Message: ----------- 1. Updated include files. 2. Updated to use std::string for file names. 3. Updated to use C++ stream instead of C-style I/O. Modified Paths: -------------- trunk/jazz/src/StandardFile.cpp trunk/jazz/src/StandardFile.h Modified: trunk/jazz/src/StandardFile.cpp =================================================================== --- trunk/jazz/src/StandardFile.cpp 2013-03-17 23:07:39 UTC (rev 965) +++ trunk/jazz/src/StandardFile.cpp 2013-03-17 23:12:01 UTC (rev 966) @@ -25,11 +25,10 @@ #include "ErrorMessage.h" #include <cassert> -#include <cstdio> #include <cstdlib> -#include <cstdarg> +#include <cstring> +#include <iostream> #include <sstream> -#include <string.h> using namespace std; @@ -85,9 +84,9 @@ int IsEof(); // Only after Load, Save never has Eof. - void Load(FILE* fd); + void Load(std::istream& Is); - void Save(FILE* fd); // Depends on EndOfTrack + void Save(std::ostream& Os); // Depends on EndOfTrack void Put(JZEvent* pEvent, unsigned char* pData, int Length); @@ -98,17 +97,17 @@ private: - long Size; // Size of base - long nRead; // Number of bytes read from the file + int Size; // Size of base + int nRead; // Number of bytes read from the file unsigned char* mpBase; // Buffer for data. unsigned char* cp; // Aktueller Schreib/Lese pointer - long Clock; // Absolute Clock + int Clock; // Absolute Clock int EofSeen; // endoftrack meta-event read int RunningStatus; void Resize(int SizeNeeded); - void PutVar(unsigned long val); - unsigned long GetVar(); + void PutVar(unsigned int val); + unsigned int GetVar(); }; //***************************************************************************** @@ -147,8 +146,8 @@ inline void JZStandardChunk::Resize(int Needed) { - long Used = cp - mpBase; - long i, n = Size; + int Used = cp - mpBase; + int i, n = Size; if (Size - Used < Needed) { do @@ -177,9 +176,9 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZStandardChunk::PutVar(unsigned long val) +void JZStandardChunk::PutVar(unsigned int val) { - unsigned long buf; + unsigned int buf; buf = val & 0x7f; while ((val >>= 7) > 0) { @@ -200,9 +199,9 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -unsigned long JZStandardChunk::GetVar() +unsigned int JZStandardChunk::GetVar() { - unsigned long val; + unsigned int val; char c; if ((val = *cp++) & 0x80) { @@ -219,7 +218,7 @@ void JZStandardChunk::Put(JZEvent* pEvent, unsigned char* Data, int Length) { unsigned char Stat; - long dif; + int dif; Resize(Length + 20); dif = pEvent->GetClock() - Clock; @@ -302,9 +301,9 @@ } break; - /* - * Meta-Events - */ + // + // Meta-Events + // case StatText: case StatTrackName: @@ -315,7 +314,7 @@ case StatKeySignat: case StatMtcOffset: - default: /* hopefully */ + default: // hopefully #if 0 if (1) @@ -446,7 +445,7 @@ RunningStatus = 0; return pEvent; - default: // Text und andere ignorieren + default: // Text and ignore others len = GetVar(); pEvent = new JZMetaEvent(Clock, Stat, cp, len); cp += len; @@ -456,7 +455,7 @@ default: - if (cp[0] & 0x80) // neuer Running Status? + if (cp[0] & 0x80) // new Running Status? RunningStatus = *cp++; Stat = RunningStatus & 0xF0; Channel = RunningStatus & 0x0F; @@ -516,22 +515,22 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZStandardChunk::Load(FILE* pFd) +void JZStandardChunk::Load(istream& Is) { char Type[4]; int Size; - fread(Type, 4, 1, pFd); - fread(&Size, 4, 1, pFd); + Is.read(Type, 4); + Is.read((char*)&Size, sizeof(Size)); SwapL(&Size); Resize(Size); - fread(mpBase, Size, 1, pFd); + Is.read((char*)mpBase, Size); nRead = Size; } //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZStandardChunk::Save(FILE* pFd) +void JZStandardChunk::Save(ostream& Os) { int Size, hSize; @@ -540,11 +539,11 @@ *cp++ = 0xff; *cp++ = 0x2f; *cp++ = 0x00; - fwrite("MTrk", 4, 1, pFd); + Os.write("MTrk", 4); Size = hSize = cp - mpBase; SwapL(&hSize); - fwrite(&hSize, 4, 1, pFd); - fwrite(mpBase, Size, 1, pFd); + Os.write((char*)&hSize, sizeof(hSize)); + Os.write((char*)mpBase, Size); } //***************************************************************************** @@ -589,22 +588,22 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -int JZStandardRead::Open(const char* pFileName) +int JZStandardRead::Open(const string& FileName) { JZFileHeader FileHeader; int hSize; int i; char Type[4]; - if (!JZReadBase::Open(pFileName)) + if (!JZReadBase::Open(FileName)) { ostringstream Oss; - Oss << "Can't open " << pFileName; + Oss << "Can't open " << FileName; Error(Oss.str()); return 0; } - fread(Type, 4, 1, mpFd); + mIfs.read(Type, 4); if (strncmp("MThd", Type, 4) != 0) { @@ -612,11 +611,11 @@ return 0; } - fread(&hSize, 4, 1, mpFd); + mIfs.read((char*)&hSize, 4); SwapL(&hSize); assert (hSize == sizeof(FileHeader)); - fread(&FileHeader, 6, 1, mpFd); + mIfs.read((char*)&FileHeader, 6); FileHeader.Swap(); mTrackCount = FileHeader.mTrackCount; mTicksPerQuarter = FileHeader.Unit; @@ -624,7 +623,7 @@ mpTracks = new JZStandardChunk [mTrackCount]; for (i = 0; i < mTrackCount; i++) { - mpTracks[i].Load(mpFd); + mpTracks[i].Load(mIfs); } mTrackIndex = -1; @@ -678,11 +677,11 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- int JZStandardWrite::Open( - const char* pFileName, + const string& FileName, int TrackCount, int TicksPerQuarter) { - if (!JZWriteBase::Open(pFileName, TrackCount, TicksPerQuarter)) + if (!JZWriteBase::Open(FileName, TrackCount, TicksPerQuarter)) { return 0; } @@ -698,23 +697,22 @@ //----------------------------------------------------------------------------- void JZStandardWrite::Close() { - long Size; - JZFileHeader FileHeader; - int i; + mOfs.write("MThd", 4); - fwrite("MThd", 4, 1, mpFd); - Size = 6; + int Size = 6; SwapL(&Size); - fwrite(&Size, 4, 1, mpFd); + mOfs.write((char*)&Size, sizeof(Size)); + + JZFileHeader FileHeader; FileHeader.Unit = mTicksPerQuarter; FileHeader.Format = 1; FileHeader.mTrackCount = mTrackCount; FileHeader.Swap(); - fwrite(&FileHeader, 6, 1, mpFd); + mOfs.write((char*) &FileHeader, sizeof(FileHeader)); - for (i = 0; i < mTrackCount; i++) + for (int i = 0; i < mTrackCount; ++i) { - mpTracks[i].Save(mpFd); + mpTracks[i].Save(mOfs); } JZWriteBase::Close(); Modified: trunk/jazz/src/StandardFile.h =================================================================== --- trunk/jazz/src/StandardFile.h 2013-03-17 23:07:39 UTC (rev 965) +++ trunk/jazz/src/StandardFile.h 2013-03-17 23:12:01 UTC (rev 966) @@ -24,8 +24,6 @@ #include "Events.h" -#include <stdio.h> - class JZEvent; class JZStandardChunk; @@ -39,7 +37,7 @@ virtual ~JZStandardRead(); - virtual int Open(const char* pFileName); + virtual int Open(const std::string& FileName); virtual void Close(); @@ -65,7 +63,7 @@ virtual ~JZStandardWrite(); virtual int Open( - const char* pFileName, + const std::string& FileName, int TrackCount, int TicksPerQuarter); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2013-03-17 23:13:46
|
Revision: 967 http://sourceforge.net/p/jazzplusplus/code/967 Author: pstieber Date: 2013-03-17 23:13:43 +0000 (Sun, 17 Mar 2013) Log Message: ----------- Started updating and implementing the rhythm generator. Modified Paths: -------------- trunk/jazz/src/Globals.cpp trunk/jazz/src/Globals.h trunk/jazz/src/Rhythm.cpp trunk/jazz/src/Rhythm.h Modified: trunk/jazz/src/Globals.cpp =================================================================== --- trunk/jazz/src/Globals.cpp 2013-03-17 23:12:01 UTC (rev 966) +++ trunk/jazz/src/Globals.cpp 2013-03-17 23:13:43 UTC (rev 967) @@ -65,6 +65,8 @@ JZHarmonyBrowserInterface* gpHarmonyBrowser = 0; +JZRhythmGeneratorFrame* gpRhythmGeneratorFrame = 0; + const double gDegreesToRadians = 0.01745329251994330212; const double gRadiansToDegrees = 57.2957795130823; @@ -105,4 +107,3 @@ return TokenIndex; } - Modified: trunk/jazz/src/Globals.h =================================================================== --- trunk/jazz/src/Globals.h 2013-03-17 23:12:01 UTC (rev 966) +++ trunk/jazz/src/Globals.h 2013-03-17 23:13:43 UTC (rev 967) @@ -35,6 +35,7 @@ class JZPlayer; class JZHelp; class JZProject; +class JZRhythmGeneratorFrame; class JZTrackFrame; class JZTrackWindow; class JZHarmonyBrowserInterface; @@ -62,6 +63,7 @@ extern JZTrackFrame* gpTrackFrame; extern JZTrackWindow* gpTrackWindow; extern JZHarmonyBrowserInterface* gpHarmonyBrowser; +extern JZRhythmGeneratorFrame* gpRhythmGeneratorFrame; extern const double gDegreesToRadians; extern const double gRadiansToDegrees; Modified: trunk/jazz/src/Rhythm.cpp =================================================================== --- trunk/jazz/src/Rhythm.cpp 2013-03-17 23:12:01 UTC (rev 966) +++ trunk/jazz/src/Rhythm.cpp 2013-03-17 23:13:43 UTC (rev 967) @@ -41,6 +41,7 @@ #include <wx/checkbox.h> #include <wx/choicdlg.h> #include <wx/listbox.h> +#include <wx/menu.h> #include <wx/msgdlg.h> #include <wx/slider.h> #include <wx/toolbar.h> @@ -50,8 +51,6 @@ using namespace std; -JZRhythmWindow* rhythm_win = 0; - void tRhyGroup::write(ostream& Os) const { Os << listen << " "; @@ -1236,7 +1235,6 @@ delete instruments[i]; } delete mpToolBar; - rhythm_win = 0; } bool JZRhythmWindow::OnClose() @@ -1298,3 +1296,106 @@ return Is; } +//***************************************************************************** +//***************************************************************************** +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +JZRhythmGeneratorWindow::JZRhythmGeneratorWindow( + wxFrame* pParent, + const wxPoint& Position, + const wxSize& Size) + : wxWindow(pParent, wxID_ANY, Position, Size), + mRhythm(0), + mpLengthEdit(0), + mpVelocityEdit(0), + mpRhythmEdit(0) +{ + int x = 0; + int y = 0; + int Width, Height; + GetClientSize(&Width, &Height); + + mpLengthEdit = new JZArrayEdit( + pParent, + mRhythm.length, + x, + y + Height / 2, + Width / 2, + Height / 4 - 4); + mpLengthEdit->SetXMinMax(1, 8); + mpLengthEdit->SetLabel("length/interval"); + + mpVelocityEdit = new JZArrayEdit( + pParent, + mRhythm.veloc, + x + Width / 2, + y + Height / 2, + Width / 2, + Height / 4 - 4); + mpVelocityEdit->SetXMinMax(1, 127); + mpVelocityEdit->SetLabel("velocity"); + + mpRhythmEdit = new JZRhyArrayEdit( + pParent, + mRhythm.rhythm, + x, + y + 3 * Height / 4, + Width, + Height/ 4 - 4); + mpRhythmEdit->SetMeter( + mRhythm.steps_per_count, + mRhythm.count_per_bar, + mRhythm.n_bars); + mpRhythmEdit->SetLabel("rhythm"); +} + +//***************************************************************************** +//***************************************************************************** +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +JZRhythmGeneratorFrame::JZRhythmGeneratorFrame() + : wxFrame( + 0, + wxID_ANY, + "Rhythm Generator", + wxPoint( + gpConfig->GetValue(C_RhythmXpos), + gpConfig->GetValue(C_RhythmYpos)), + wxSize(640, 580)), + mpRhythmGeneratorWindow(0) +{ + wxMenu* pFileMenu = new wxMenu; + pFileMenu->Append(wxID_OPEN, "&Load..."); + pFileMenu->Append(wxID_SAVEAS, "Save &As..."); + pFileMenu->Append(wxID_CLOSE, "&Close"); + + wxMenuBar* pMenuBar = new wxMenuBar; + pMenuBar->Append(pFileMenu, "&File"); + + SetMenuBar(pMenuBar); + + int Width, Height; + GetClientSize(&Width, &Height); + mpRhythmGeneratorWindow = + new JZRhythmGeneratorWindow(this, wxPoint(0, 0), wxSize(Width, Height)); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +JZRhythmGeneratorFrame::~JZRhythmGeneratorFrame() +{ + delete mpRhythmGeneratorWindow; + + gpRhythmGeneratorFrame = 0; +} + +//***************************************************************************** +//***************************************************************************** +void CreateRhythmGenerator() +{ + if (!gpRhythmGeneratorFrame) + { + gpRhythmGeneratorFrame = new JZRhythmGeneratorFrame(); + } + ((JZRhythmGeneratorFrame*)gpRhythmGeneratorFrame)->Show(true); +} Modified: trunk/jazz/src/Rhythm.h =================================================================== --- trunk/jazz/src/Rhythm.h 2013-03-17 23:12:01 UTC (rev 966) +++ trunk/jazz/src/Rhythm.h 2013-03-17 23:13:43 UTC (rev 967) @@ -22,6 +22,7 @@ #pragma once +#include "Globals.h" #include "Random.h" #include "ToolBar.h" @@ -30,10 +31,10 @@ #include <iostream> -class JZTrack; +class JZBarInfo; class JZEventWindow; class JZSong; -class JZBarInfo; +class JZTrack; class wxButton; class wxCheckBox; class wxListBox; @@ -75,6 +76,7 @@ class JZRhythm { friend class JZRhythmWindow; + friend class JZRhythmGeneratorWindow; private: @@ -176,20 +178,20 @@ friend std::ostream& operator << (std::ostream& os, JZRhythmWindow const& a); friend std::istream& operator >> (std::istream& Is, JZRhythmWindow& a); - wxPanel *inst_panel; + wxPanel* inst_panel; #ifdef OBSOLETE wxText *label; #endif - wxSlider *steps_per_count; - wxSlider *count_per_bar; - wxSlider *n_bars; - wxListBox *instrument_list; - wxCheckBox *rand_checkbox; + wxSlider* steps_per_count; + wxSlider* count_per_bar; + wxSlider* n_bars; + wxListBox* instrument_list; + wxCheckBox* rand_checkbox; - wxPanel *group_panel; - wxListBox *group_list; - wxSlider *group_contrib; - wxSlider *group_listen; + wxPanel* group_panel; + wxListBox* group_list; + wxSlider* group_contrib; + wxSlider* group_listen; int act_group; JZArrayEdit *length_edit; @@ -240,7 +242,41 @@ void UpInstrument(); void DownInstrument(); void InitInstrumentList(); +}; +//***************************************************************************** +//***************************************************************************** +class JZRhythmGeneratorWindow : public wxWindow +{ + public: + + JZRhythmGeneratorWindow( + wxFrame* pParent, + const wxPoint& Position, + const wxSize& Size); + + private: + + JZRhythm mRhythm; + + JZArrayEdit* mpLengthEdit; + JZArrayEdit* mpVelocityEdit; + JZRhyArrayEdit* mpRhythmEdit; }; -extern JZRhythmWindow *rhythm_win; +//***************************************************************************** +//***************************************************************************** +class JZRhythmGeneratorFrame : public wxFrame +{ + public: + + JZRhythmGeneratorFrame(); + + ~JZRhythmGeneratorFrame(); + + private: + + JZRhythmGeneratorWindow* mpRhythmGeneratorWindow; +}; + +extern void CreateRhythmGenerator(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2013-03-17 23:18:13
|
Revision: 968 http://sourceforge.net/p/jazzplusplus/code/968 Author: pstieber Date: 2013-03-17 23:18:10 +0000 (Sun, 17 Mar 2013) Log Message: ----------- Started adding rhythm generator and added import and export of ASCII MIDI files, but commented out the menu entries because this is for debugging. Modified Paths: -------------- trunk/jazz/src/Project.cpp trunk/jazz/src/Project.h trunk/jazz/src/Track.cpp trunk/jazz/src/Track.h trunk/jazz/src/TrackFrame.cpp trunk/jazz/src/TrackFrame.h Modified: trunk/jazz/src/Project.cpp =================================================================== --- trunk/jazz/src/Project.cpp 2013-03-17 23:13:43 UTC (rev 967) +++ trunk/jazz/src/Project.cpp 2013-03-17 23:18:10 UTC (rev 968) @@ -22,6 +22,7 @@ #include "Project.h" +#include "AsciiMidiFile.h" #include "Filter.h" #include "GetOptionIndex.h" #include "Globals.h" @@ -515,12 +516,28 @@ { JZStandardRead Io; Clear(); - Read(Io, SongFileName.c_str()); + Read(Io, SongFileName); mpConfig->Put(C_StartUpSong, SongFileName); } //----------------------------------------------------------------------------- // Description: +// Open and read an ASCII MIDI file. +// +// Inputs: +// const wxString& SongFileName: +// Song path and file name. +//----------------------------------------------------------------------------- +void JZProject::OpenAndReadAsciiMidiFile(const wxString& AsciiMidiFileName) +{ + JZAsciiRead AsciiRead; + Clear(); + Read(AsciiRead, AsciiMidiFileName); +// mpConfig->Put(C_StartUpSong, SongFileName); +} + +//----------------------------------------------------------------------------- +// Description: // Save a MIDI file. This function will overwrite the file if it already // exists! // @@ -531,12 +548,20 @@ void JZProject::ExportMidiFile(const wxString& MidiFileName) { JZStandardWrite Io; - Write(Io, MidiFileName.c_str()); + Write(Io, MidiFileName); mpConfig->Put(C_StartUpSong, MidiFileName); } //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- +void JZProject::ExportAsciiMidiFile(const wxString& AsciiMidiFileName) +{ + JZAsciiWrite AsciiWrite; + Write(AsciiWrite, AsciiMidiFileName); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void JZProject::Play() { mIsPlaying = true; Modified: trunk/jazz/src/Project.h =================================================================== --- trunk/jazz/src/Project.h 2013-03-17 23:13:43 UTC (rev 967) +++ trunk/jazz/src/Project.h 2013-03-17 23:18:10 UTC (rev 968) @@ -112,6 +112,8 @@ // Song path and file name. void OpenSong(const wxString& SongFileName); + void OpenAndReadAsciiMidiFile(const wxString& AsciiMidiFileName); + // Description: // Save a MIDI file. This function will overwrite the file if it // already exists! @@ -121,6 +123,8 @@ // MIDI file path and file name. void ExportMidiFile(const wxString& MidiFileName); + void ExportAsciiMidiFile(const wxString& AsciiMidiFileName); + // Here is the new play interface. For now it just acts as a layer // between the Project and the GUI. // Returns true during playback Modified: trunk/jazz/src/Track.cpp =================================================================== --- trunk/jazz/src/Track.cpp 2013-03-17 23:13:43 UTC (rev 967) +++ trunk/jazz/src/Track.cpp 2013-03-17 23:18:10 UTC (rev 968) @@ -23,8 +23,8 @@ #include "Track.h" #include "Configuration.h" +#include "Dialogs/TrackDialog.h" #include "DrumUtilities.h" -#include "Dialogs/TrackDialog.h" #include "Globals.h" #include "JazzPlusPlusApplication.h" #include "Player.h" @@ -44,7 +44,7 @@ return mMsb.Write(Io) + mLsb.Write(Io) + mDataMsb.Write(Io); } -void JZParam::SetCha(unsigned char Channel) +void JZParam::SetChannel(unsigned char Channel) { mMsb.SetChannel(Channel); mLsb.SetChannel(Channel); @@ -68,7 +68,7 @@ unsigned char *data) { int length = 9 + datalen; - unsigned char *mess = new unsigned char[length]; + unsigned char* mess = new unsigned char[length]; mess[0] = 0x41; mess[1] = 0x10; mess[2] = 0x42; @@ -185,15 +185,15 @@ String = Oss.str(); } -JZMtcOffsetEvent *JZMtcTime::ToOffset() +JZMtcOffsetEvent* JZMtcTime::ToOffset() { - unsigned char *mess = new unsigned char[5]; + unsigned char* mess = new unsigned char[5]; mess[0] = (unsigned char) hour | ((unsigned char) type << 5); mess[1] = (unsigned char) min; mess[2] = (unsigned char) sec; mess[3] = (unsigned char) fm; mess[4] = 0x00; - JZMtcOffsetEvent *s = new JZMtcOffsetEvent(0, mess, 5); + JZMtcOffsetEvent* s = new JZMtcOffsetEvent(0, mess, 5); delete mess; return s; } @@ -205,7 +205,7 @@ return msec; } -JZDrumInstrumentParameter::JZDrumInstrumentParameter(JZNrpn *par) +JZDrumInstrumentParameter::JZDrumInstrumentParameter(JZNrpn* par) : mPitch(par->mLsb.GetControlValue()), mpNext(0) { @@ -216,18 +216,18 @@ param[drumParam2Index(par->mMsb.GetControlValue())] = par; } -JZNrpn *JZDrumInstrumentParameter::Get(int index) +JZNrpn* JZDrumInstrumentParameter::Get(int index) { assert((index >= drumPitchIndex) && (index < numDrumParameters)); return(param[index]); } -void JZDrumInstrumentParameter::Put(JZNrpn *par) +void JZDrumInstrumentParameter::Put(JZNrpn* par) { param[par->mLsb.GetControlValue()] = par; } -JZDrumInstrumentParameter *JZDrumInstrumentParameter::Next() +JZDrumInstrumentParameter* JZDrumInstrumentParameter::Next() { return mpNext; } @@ -237,10 +237,10 @@ return mPitch; } -JZDrumInstrumentParameter -*JZDrumInstrumentParameterList::GetElem(int pit) +JZDrumInstrumentParameter* +JZDrumInstrumentParameterList::GetElem(int pit) { - JZDrumInstrumentParameter *ptr = list; + JZDrumInstrumentParameter* ptr = list; while (ptr) { if (ptr->mPitch == pit) @@ -252,9 +252,9 @@ return ptr; } -JZNrpn *JZDrumInstrumentParameterList::GetParam(int pit, int index) +JZNrpn* JZDrumInstrumentParameterList::GetParam(int pit, int index) { - JZDrumInstrumentParameter *ptr = GetElem(pit); + JZDrumInstrumentParameter* ptr = GetElem(pit); if (ptr) { return ptr->Get(index); @@ -262,7 +262,7 @@ return 0; } -void JZDrumInstrumentParameterList::PutParam(JZNrpn *par) +void JZDrumInstrumentParameterList::PutParam(JZNrpn* par) { JZDrumInstrumentParameter* ptr = GetElem(par->mLsb.GetControlValue()); if (!ptr) @@ -281,7 +281,7 @@ { if (list) { - JZDrumInstrumentParameter *elem = GetElem(pit); + JZDrumInstrumentParameter* elem = GetElem(pit); if (elem) { if (elem->Get(index)) @@ -300,8 +300,8 @@ DelParam(pit, i); } - JZDrumInstrumentParameter *ptr = list; - JZDrumInstrumentParameter *prev = 0; + JZDrumInstrumentParameter* ptr = list; + JZDrumInstrumentParameter* prev = 0; while (ptr) { if (ptr->mPitch == pit) @@ -322,17 +322,17 @@ } } -JZDrumInstrumentParameter *JZDrumInstrumentParameterList::FirstElem() +JZDrumInstrumentParameter* JZDrumInstrumentParameterList::FirstElem() { return list; } -JZDrumInstrumentParameter *JZDrumInstrumentParameterList::NextElem( - JZDrumInstrumentParameter *cur) +JZDrumInstrumentParameter* JZDrumInstrumentParameterList::NextElem( + JZDrumInstrumentParameter* cur) { if (cur) { - JZDrumInstrumentParameter *ptr = GetElem(cur->mPitch); + JZDrumInstrumentParameter* ptr = GetElem(cur->mPitch); if (ptr) { return ptr->mpNext; @@ -350,7 +350,7 @@ void JZDrumInstrumentParameterList::Clear() { - JZDrumInstrumentParameter *ptr = list; + JZDrumInstrumentParameter* ptr = list; while (ptr) { list = ptr->mpNext; @@ -655,17 +655,17 @@ -static int compare(const void *p1, const void *p2) +static int compare(const void* p1, const void* p2) { - JZEvent *e1 = *(JZEvent **)p1; - JZEvent *e2 = *(JZEvent **)p2; + JZEvent* e1 = *(JZEvent **)p1; + JZEvent* e2 = *(JZEvent **)p2; return e1->Compare(*e2); } void JZSimpleEventArray::Sort() { - qsort(mppEvents, nEvents, sizeof(JZEvent *), compare); + qsort(mppEvents, nEvents, sizeof(JZEvent*), compare); } @@ -1157,7 +1157,7 @@ // kill all KeyOn's with non matching KeyOff's for (i = 0; i < nEvents; i++) { - JZKeyOnEvent *k = mppEvents[i]->IsKeyOn(); + JZKeyOnEvent* k = mppEvents[i]->IsKeyOn(); if (k && k->Length <= 0) { k->Kill(); @@ -1286,7 +1286,7 @@ BendPitchSens->Write(Io); } - JZDrumInstrumentParameter *dpar = DrumParams.FirstElem(); + JZDrumInstrumentParameter* dpar = DrumParams.FirstElem(); while (dpar) { int index; @@ -1630,7 +1630,7 @@ class JZTrackDlg : public wxForm { JZTrackWindow* TrackWin; - JZTrack *trk; + JZTrack* trk; std::string& mTrackName; JZNamedChoice PatchChoice; JZNamedChoice DeviceChoice; @@ -1641,15 +1641,15 @@ int AudioMode; public: - JZTrackDlg::JZTrackDlg(JZTrackWindow *w, JZTrack *t); - void EditForm(wxPanel *panel); + JZTrackDlg::JZTrackDlg(JZTrackWindow* w, JZTrack* t); + void EditForm(wxPanel* panel); virtual void OnOk(); virtual void OnCancel(); virtual void OnHelp(); }; -JZTrackDlg::JZTrackDlg(JZTrackWindow *w, JZTrack *t) +JZTrackDlg::JZTrackDlg(JZTrackWindow* w, JZTrack* t) : wxForm(USED_WXFORM_BUTTONS), PatchChoice( "Patch", @@ -1698,7 +1698,7 @@ trk->SetDevice(Device); if (trk->ForceChannel) { - JZChannelEvent *c; + JZChannelEvent* c; JZSysExEvent* s; JZEventIterator Iterator(trk); trk->Sort(); @@ -1707,7 +1707,7 @@ { if ((c = pEvent->IsChannelEvent()) != 0) { - c = (JZChannelEvent *)pEvent->Copy(); + c = (JZChannelEvent*)pEvent->Copy(); c->SetChannel(trk->Channel - 1); trk->Kill(pEvent); trk->Put(c); @@ -1728,7 +1728,7 @@ *pChannel |= sysex_channel(trk->Channel); } - s = (JZSysExEvent *) pEvent->Copy(); + s = (JZSysExEvent*) pEvent->Copy(); trk->Kill(pEvent); trk->Put(s); } @@ -1738,39 +1738,39 @@ if (trk->VibRate) { - trk->VibRate->SetCha(trk->Channel - 1); + trk->VibRate->SetChannel(trk->Channel - 1); } if (trk->VibDepth) { - trk->VibDepth->SetCha(trk->Channel - 1); + trk->VibDepth->SetChannel(trk->Channel - 1); } if (trk->VibDelay) { - trk->VibDelay->SetCha(trk->Channel - 1); + trk->VibDelay->SetChannel(trk->Channel - 1); } if (trk->Cutoff) { - trk->Cutoff->SetCha(trk->Channel - 1); + trk->Cutoff->SetChannel(trk->Channel - 1); } if (trk->Resonance) { - trk->Resonance->SetCha(trk->Channel - 1); + trk->Resonance->SetChannel(trk->Channel - 1); } if (trk->EnvAttack) { - trk->EnvAttack->SetCha(trk->Channel - 1); + trk->EnvAttack->SetChannel(trk->Channel - 1); } if (trk->EnvDecay) { - trk->EnvDecay->SetCha(trk->Channel - 1); + trk->EnvDecay->SetChannel(trk->Channel - 1); } if (trk->EnvRelease) { - trk->EnvRelease->SetCha(trk->Channel - 1); + trk->EnvRelease->SetChannel(trk->Channel - 1); } if (trk->BendPitchSens) { - trk->BendPitchSens->SetCha(trk->Channel - 1); + trk->BendPitchSens->SetChannel(trk->Channel - 1); } if (trk->mpBank) { @@ -1782,14 +1782,14 @@ } if (!trk->DrumParams.IsEmpty()) { - JZDrumInstrumentParameter *dpar = trk->DrumParams.FirstElem(); + JZDrumInstrumentParameter* dpar = trk->DrumParams.FirstElem(); while (dpar) { for (int index = drumPitchIndex; index < numDrumParameters; ++index) { if (dpar->Get(index)) { - dpar->Get(index)->SetCha(trk->Channel - 1); + dpar->Get(index)->SetChannel(trk->Channel - 1); } } dpar = trk->DrumParams.NextElem(dpar); @@ -1801,7 +1801,7 @@ wxForm::OnOk(); } -void JZTrackDlg::EditForm(wxPanel *panel) +void JZTrackDlg::EditForm(wxPanel* panel) { PatchNr = trk->GetPatch() + (trk->GetBank() << 8); Device = trk->GetDevice(); @@ -1911,7 +1911,7 @@ return Channel == gpConfig->GetValue(C_DrumChannel); } -void JZTrack::Merge(JZEventArray *t) +void JZTrack::Merge(JZEventArray* t) { for (int i = 0; i < t->nEvents; i++) { @@ -1976,7 +1976,7 @@ { if (mUndoCount > 0) { - JZUndoBuffer *undo = &mUndoBuffers[mUndoIndex]; + JZUndoBuffer* undo = &mUndoBuffers[mUndoIndex]; for (int i = undo->nEvents - 1; i >= 0; i--) { JZEvent* pEvent = undo->mppEvents[i]; @@ -2006,7 +2006,7 @@ { mUndoIndex = (mUndoIndex + 1) % MaxUndo; - JZUndoBuffer *undo = &mUndoBuffers[mUndoIndex]; + JZUndoBuffer* undo = &mUndoBuffers[mUndoIndex]; for (int i = 0; i < undo->nEvents; i++) { JZEvent* pEvent = undo->mppEvents[i]; @@ -2060,14 +2060,14 @@ { if (mpCopyright) { - return (const char *)mpCopyright->GetData(); + return (const char*)mpCopyright->GetData(); } return ""; } -void JZTrack::SetCopyright(char *str) +void JZTrack::SetCopyright(char* str) { if (mpCopyright) { @@ -2080,7 +2080,7 @@ { len = strlen(str); } - Put(new JZCopyrightEvent(0, (unsigned char *)str, len)); + Put(new JZCopyrightEvent(0, (unsigned char*)str, len)); } Cleanup(); } @@ -2106,7 +2106,7 @@ { Put(new JZTrackNameEvent( 0, - (unsigned char *)pTrackName, + (unsigned char*)pTrackName, strlen(pTrackName))); } Cleanup(); @@ -2608,7 +2608,7 @@ { if (!DrumParams.IsEmpty()) { - JZNrpn *par = DrumParams.GetParam(pitch, index); + JZNrpn* par = DrumParams.GetParam(pitch, index); if (par) { return(par->GetVal() + 1); @@ -2761,7 +2761,7 @@ if (pValue) { - return *pValue + 1; + return* pValue + 1; } return 0; @@ -2955,7 +2955,7 @@ int JZTrack::GetChorusType(int lsb) { - const unsigned char *pValue = gpSynth->GetSysexValPtr(ChorusType); + const unsigned char* pValue = gpSynth->GetSysexValPtr(ChorusType); if (pValue) { @@ -3112,7 +3112,7 @@ return 0; } -void JZTrack::SetPartRsrv(unsigned char *rsrv) +void JZTrack::SetPartRsrv(unsigned char* rsrv) { if (PartialReserve) { @@ -3318,7 +3318,7 @@ Cleanup(); } -JZSetTempoEvent *JZTrack::GetCurrentTempo(int clk) +JZSetTempoEvent* JZTrack::GetCurrentTempo(int clk) { JZEventIterator Iterator(this); Sort(); @@ -3338,7 +3338,7 @@ int JZTrack::GetCurrentSpeed(int clk) { - JZSetTempoEvent *t = GetCurrentTempo(clk); + JZSetTempoEvent* t = GetCurrentTempo(clk); if (t) { return t->GetBPM(); Modified: trunk/jazz/src/Track.h =================================================================== --- trunk/jazz/src/Track.h 2013-03-17 23:13:43 UTC (rev 967) +++ trunk/jazz/src/Track.h 2013-03-17 23:18:10 UTC (rev 968) @@ -79,18 +79,18 @@ public: JZParam( - int clk, - int cha, + int Clock, + int Channel, unsigned char id1, unsigned char msb, unsigned char id2, unsigned char lsb, unsigned char msbval) - : mMsb(clk, cha, id1, msb), - mLsb(clk, cha, id2, lsb), - mDataMsb(clk, cha, 0x06, msbval), - mResetMsb(clk, cha, id1, 0x7f), - mResetLsb(clk, cha, id2, 0x7f) + : mMsb(Clock, Channel, id1, msb), + mLsb(Clock, Channel, id2, lsb), + mDataMsb(Clock, Channel, 0x06, msbval), + mResetMsb(Clock, Channel, id1, 0x7f), + mResetLsb(Clock, Channel, id2, 0x7f) { } @@ -100,7 +100,7 @@ virtual int Write(JZWriteBase& Io); - virtual void SetCha(unsigned char cha); + virtual void SetChannel(unsigned char Channel); virtual int GetVal() { @@ -121,12 +121,12 @@ public: JZNrpn( - int clk, - int cha, + int Clock, + int Channel, unsigned char msb, unsigned char lsb, unsigned char msbval) - : JZParam(clk, cha, 0x63, msb, 0x62, lsb, msbval) + : JZParam(Clock, Channel, 0x63, msb, 0x62, lsb, msbval) { } }; @@ -138,12 +138,12 @@ public: JZRpn( - int clk, - int cha, + int Clock, + int Channel, unsigned char msb, unsigned char lsb, unsigned char msbval) - : JZParam(clk, cha, 0x65, msb, 0x64, lsb, msbval) + : JZParam(Clock, Channel, 0x65, msb, 0x64, lsb, msbval) { } }; @@ -386,7 +386,7 @@ void GrabData(JZSimpleEventArray &src); - void Copy(JZSimpleEventArray& src, int frclk, int toclk); + void Copy(JZSimpleEventArray& src, int frClock, int toClock); JZSimpleEventArray(); @@ -692,9 +692,9 @@ int GetDefaultSpeed(); // beats per minute void SetDefaultSpeed(int bpm); - int GetCurrentSpeed( int clk ); // beats per minute + int GetCurrentSpeed(int Clock); // beats per minute - JZSetTempoEvent *GetCurrentTempo( int clk ); + JZSetTempoEvent* GetCurrentTempo(int Clock); int GetMasterVol(); void SetMasterVol(int MasterVol); Modified: trunk/jazz/src/TrackFrame.cpp =================================================================== --- trunk/jazz/src/TrackFrame.cpp 2013-03-17 23:13:43 UTC (rev 967) +++ trunk/jazz/src/TrackFrame.cpp 2013-03-17 23:18:10 UTC (rev 968) @@ -22,20 +22,21 @@ #include "TrackFrame.h" +#include "AboutDialog.h" +#include "Configuration.h" +#include "Dialogs/MetronomeSettingsDialog.h" +#include "Dialogs/SynthesizerSettingsDialog.h" +#include "Globals.h" +#include "Harmony.h" #include "JazzPlusPlusApplication.h" #include "Player.h" #include "Project.h" #include "ProjectManager.h" +#include "RecordingInfo.h" #include "Resources.h" -#include "RecordingInfo.h" +#include "Rhythm.h" #include "TrackWindow.h" #include "ToolBar.h" -#include "Globals.h" -#include "Configuration.h" -#include "Harmony.h" -#include "Dialogs/MetronomeSettingsDialog.h" -#include "Dialogs/SynthesizerSettingsDialog.h" -#include "AboutDialog.h" #ifdef __WXMSW__ #include "mswin/WindowsPlayer.h" @@ -89,8 +90,12 @@ EVT_MENU(ID_IMPORT_MIDI, JZTrackFrame::OnFileImportMidi) + EVT_MENU(ID_IMPORT_ASCII_MIDI, JZTrackFrame::OnFileImportAscii) + EVT_MENU(ID_EXPORT_MIDI, JZTrackFrame::OnFileExportMidi) + EVT_MENU(ID_EXPORT_ASCII_MIDI, JZTrackFrame::OnFileExportAscii) + EVT_MENU( ID_EXPORT_SELECTION_AS_MIDI, JZTrackFrame::OnFileExportSelectionAsMidi) @@ -113,6 +118,8 @@ EVT_MENU(ID_TOOLS_HARMONY_BROWSER, JZTrackFrame::OnToolsHarmonyBrowser) + EVT_MENU(ID_TOOLS_RHYTHM_GENERATOR, JZTrackFrame::OnToolsRhythmGenerator) + EVT_MENU(ID_SETTINGS_METRONOME, JZTrackFrame::OnSettingsMetronome) EVT_MENU(ID_SETTINGS_SYNTHESIZER, JZTrackFrame::OnSettingsSynthesizerType) @@ -238,8 +245,9 @@ mpFileMenu->AppendSeparator(); mpFileMenu->Append(ID_IMPORT_MIDI, "Import MIDI..."); - +//DEBUG mpFileMenu->Append(ID_IMPORT_ASCII_MIDI, "Import ASCII..."); mpFileMenu->Append(ID_EXPORT_MIDI, "Export as MIDI..."); +//DEBUG mpFileMenu->Append(ID_EXPORT_ASCII_MIDI, "Export as ASCII..."); mpFileMenu->Append( ID_EXPORT_SELECTION_AS_MIDI, "Export Selection as MIDI..."); @@ -309,7 +317,8 @@ pMiscMenu->Append(ID_MISC_SET_COPYRIGHT, "&Set Music Copyright..."); mpToolsMenu = new wxMenu; - mpToolsMenu->Append(ID_TOOLS_HARMONY_BROWSER, "&Harmony Browser..."); + mpToolsMenu->Append(ID_TOOLS_HARMONY_BROWSER, "&Harmony Browser..."); + mpToolsMenu->Append(ID_TOOLS_RHYTHM_GENERATOR, "&Rhythm Generator..."); #if 0 // Move to Project Menu @@ -468,6 +477,7 @@ // } delete gpHarmonyBrowser; + delete gpRhythmGeneratorFrame; return true; } @@ -557,6 +567,27 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- +void JZTrackFrame::OnFileImportAscii(wxCommandEvent&) +{ + wxFileDialog OpenDialog( + 0, + "Load ASCII File", + "", + "", + "ASCII MIDI files (txt)|*.txt|All files (*.*)|*.*", + wxFD_OPEN | wxFD_CHANGE_DIR); + if (OpenDialog.ShowModal() == wxID_OK) + { + wxString AsciiMidiFileName = OpenDialog.GetPath(); + gpProject->OpenAndReadAsciiMidiFile(AsciiMidiFileName); + SetTitle(AsciiMidiFileName); + mpTrackWindow->SetScrollRanges(); + mpTrackWindow->Refresh(false); + } +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void JZTrackFrame::OnFileExportMidi(wxCommandEvent& Event) { // wxFD_OVERWRITE_PROMPT - For save dialog only: prompt for a confirmation @@ -578,6 +609,27 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- +void JZTrackFrame::OnFileExportAscii(wxCommandEvent&) +{ + // wxFD_OVERWRITE_PROMPT - For save dialog only: prompt for a confirmation + // if a file will be overwritten. + wxFileDialog SaveAsDialog( + 0, + "Save MIDI File as ASCII", + "", + "", + "ASCII MIDI files (txt)|*.txt|All files (*.*)|*.*", + wxFD_SAVE | wxFD_OVERWRITE_PROMPT); + if (SaveAsDialog.ShowModal() == wxID_OK) + { + wxString FileName = SaveAsDialog.GetPath(); + gpProject->ExportAsciiMidiFile(FileName); + SetTitle(FileName); + } +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void JZTrackFrame::OnFileExportSelectionAsMidi(wxCommandEvent& Event) { } @@ -654,6 +706,13 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- +void JZTrackFrame::OnToolsRhythmGenerator(wxCommandEvent& Event) +{ + CreateRhythmGenerator(); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void JZTrackFrame::OnSettingsMetronome(wxCommandEvent& Event) { JZMetronomeInfo MetronomeInfo = gpProject->GetMetronomeInfo(); Modified: trunk/jazz/src/TrackFrame.h =================================================================== --- trunk/jazz/src/TrackFrame.h 2013-03-17 23:13:43 UTC (rev 967) +++ trunk/jazz/src/TrackFrame.h 2013-03-17 23:18:10 UTC (rev 968) @@ -81,8 +81,12 @@ void OnFileImportMidi(wxCommandEvent& Event); + void OnFileImportAscii(wxCommandEvent& Event); + void OnFileExportMidi(wxCommandEvent& Event); + void OnFileExportAscii(wxCommandEvent& Event); + void OnFileExportSelectionAsMidi(wxCommandEvent& Event); void OnFileExit(wxCommandEvent& Event); @@ -101,6 +105,8 @@ void OnToolsHarmonyBrowser(wxCommandEvent& Event); + void OnToolsRhythmGenerator(wxCommandEvent& Event); + void OnSettingsMetronome(wxCommandEvent& Event); void OnSettingsSynthesizerType(wxCommandEvent& Event); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2013-03-18 18:45:05
|
Revision: 970 http://sourceforge.net/p/jazzplusplus/code/970 Author: pstieber Date: 2013-03-18 18:45:02 +0000 (Mon, 18 Mar 2013) Log Message: ----------- Started adding a new control to alter arrays. Added Paths: ----------- trunk/jazz/src/ArrayControl.cpp trunk/jazz/src/ArrayControl.h Added: trunk/jazz/src/ArrayControl.cpp =================================================================== --- trunk/jazz/src/ArrayControl.cpp (rev 0) +++ trunk/jazz/src/ArrayControl.cpp 2013-03-18 18:45:02 UTC (rev 970) @@ -0,0 +1,110 @@ +#include "ArrayControl.h" + +#include "Random.h" + +#include <wx/dcclient.h> + +//***************************************************************************** +// Description: +// This is the array control class definition. +//***************************************************************************** +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +BEGIN_EVENT_TABLE(JZArrayControl, wxControl) + EVT_SIZE(JZArrayControl::OnSize) + EVT_PAINT(JZArrayControl::OnPaint) +END_EVENT_TABLE() + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +JZArrayControl::JZArrayControl( + wxWindow* pParent, + wxWindowID Id, + const JZRndArray& RandomArray, + const wxPoint& Position, + const wxSize& Size, + long WindowStyle, + const wxValidator& Validator, + const wxString& Name) + : wxControl(), + mpRandomArray(0) +{ + mpRandomArray = new JZRndArray(RandomArray); + + Create( + pParent, + Id, + RandomArray, + Position, + Size, + WindowStyle, + Validator, + Name); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +JZArrayControl::~JZArrayControl() +{ + delete mpRandomArray; +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZArrayControl::Create( + wxWindow* pParent, + wxWindowID Id, + const JZRndArray& RandomArray, + const wxPoint& Position, + const wxSize& Size, + long WindowStyle, + const wxValidator& Validator, + const wxString& Name) +{ + wxControl::Create( + pParent, + Id, + Position, + Size, + WindowStyle | wxNO_BORDER, + Validator, + Name); + + SetInitialSize(Size); + + *mpRandomArray = RandomArray; +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZArrayControl::OnSize(wxSizeEvent& SizeEvent) +{ + int Width = SizeEvent.GetSize().GetWidth(); + int Height = SizeEvent.GetSize().GetHeight(); + + SizeEvent.Skip(); + + wxClientDC Dc(this); + + int TextWidth, TextHeight; + Dc.GetTextExtent("123", &TextWidth, &TextHeight); + +#if 0 + if (mStyleBits & ARED_XTICKS) + { + Height -= TextHeight; + } + if (mStyleBits & (ARED_MINMAX | ARED_YTICKS)) + { + x = (int)(TextWidth + TICK_LINE); + Width -= (int)(TextWidth + TICK_LINE); + } + ynul = y + height - Height * (nul - min) / (max - min); +#endif +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZArrayControl::OnPaint(wxPaintEvent& Event) +{ +} Property changes on: trunk/jazz/src/ArrayControl.cpp ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: trunk/jazz/src/ArrayControl.h =================================================================== --- trunk/jazz/src/ArrayControl.h (rev 0) +++ trunk/jazz/src/ArrayControl.h 2013-03-18 18:45:02 UTC (rev 970) @@ -0,0 +1,46 @@ +#pragma once + +#include <wx/control.h> + +class JZRndArray; + +//***************************************************************************** +//***************************************************************************** +class JZArrayControl : public wxControl +{ + public: + + JZArrayControl( + wxWindow* pParent, + wxWindowID Id, + const JZRndArray& RandomArray, + const wxPoint& Position = wxDefaultPosition, + const wxSize& Size = wxSize(40, 40), + long WindowStyle = wxNO_BORDER, + const wxValidator& Validator = wxDefaultValidator, + const wxString& Name = wxT("arraycontrol")); + + virtual ~JZArrayControl(); + + void Create( + wxWindow* pParent, + wxWindowID Id, + const JZRndArray& RandomArray, + const wxPoint& Position = wxDefaultPosition, + const wxSize& Size = wxSize(40, 40), + long WindowStyle = wxNO_BORDER, + const wxValidator& Validator = wxDefaultValidator, + const wxString& Name = wxT("arraycontrol")); + + private: + + void OnSize(wxSizeEvent& Event); + + void OnPaint(wxPaintEvent& Event); + + private: + + JZRndArray* mpRandomArray; + + DECLARE_EVENT_TABLE() +}; Property changes on: trunk/jazz/src/ArrayControl.h ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2013-03-18 18:52:02
|
Revision: 973 http://sourceforge.net/p/jazzplusplus/code/973 Author: pstieber Date: 2013-03-18 18:51:59 +0000 (Mon, 18 Mar 2013) Log Message: ----------- 1. Updated to use wxDC& instead of wxDC*. 2. Renamed JZArrayEdit::style_bits to mStyleBits. 3. Made some cosmetic indentation changes. 4. Made stack client DCs instead of heap. 5. Put curly brackets around for/if blocks. 6. Updated some comments. Modified Paths: -------------- trunk/jazz/src/Random.cpp trunk/jazz/src/Random.h Modified: trunk/jazz/src/Random.cpp =================================================================== --- trunk/jazz/src/Random.cpp 2013-03-18 18:47:25 UTC (rev 972) +++ trunk/jazz/src/Random.cpp 2013-03-18 18:51:59 UTC (rev 973) @@ -260,7 +260,14 @@ // length of tickmark line #define TICK_LINE 0 -JZArrayEdit::JZArrayEdit(wxFrame *frame, JZRndArray &ar, int xx, int yy, int ww, int hh, int sty) +JZArrayEdit::JZArrayEdit( + wxFrame *frame, + JZRndArray &ar, + int xx, + int yy, + int ww, + int hh, + int StyleBits) : wxScrolledWindow(frame, wxID_ANY, wxPoint(xx, yy), wxSize(ww, hh)), mArray(ar), n(ar.n), @@ -272,7 +279,7 @@ enabled = 1; dragging = 0; index = -1; - style_bits = sty; + mStyleBits = StyleBits; xmin = 0; xmax = n; @@ -284,17 +291,17 @@ int tw, th; - wxDC *dc = new wxClientDC(this); - dc->SetFont(*wxSMALL_FONT); - dc->GetTextExtent("123", &tw, &th); + wxClientDC Dc(this); + Dc.SetFont(*wxSMALL_FONT); + Dc.GetTextExtent("123", &tw, &th); - if (style_bits & ARED_XTICKS) + if (mStyleBits & ARED_XTICKS) { // leave space for bottomline h -= (int)th; } - if (style_bits & (ARED_MINMAX | ARED_YTICKS)) + if (mStyleBits & (ARED_MINMAX | ARED_YTICKS)) { // leave space to display min / max x = (int)(tw + TICK_LINE); @@ -319,13 +326,12 @@ int tw, th; - wxClientDC* dc=new wxClientDC(this); - dc->GetTextExtent("123", &tw, &th); - delete dc; + wxClientDC Dc(this); + Dc.GetTextExtent("123", &tw, &th); - if (style_bits & ARED_XTICKS) + if (mStyleBits & ARED_XTICKS) h -= (int)th; - if (style_bits & (ARED_MINMAX | ARED_YTICKS)) + if (mStyleBits & (ARED_MINMAX | ARED_YTICKS)) { x = (int)(tw + TICK_LINE); w -= (int)(tw + TICK_LINE); @@ -337,13 +343,13 @@ { } -void JZArrayEdit::DrawBar(wxDC *dc, int i, int black) +void JZArrayEdit::DrawBar(wxDC& Dc, int i, int black) { - if (style_bits & ARED_LINES) + if (mStyleBits & ARED_LINES) { if (!black) { - dc->SetPen(*wxWHITE_PEN); + Dc.SetPen(*wxWHITE_PEN); } JZMapper XMap(0, n, 0, w); @@ -356,23 +362,25 @@ // draw line to prev position int x0 = (int)XMap.XToY(i - 0.5); int y0 = (int)YMap.XToY(mArray[i-1]); - dc->DrawLine(x0, y0, x1, y1); + Dc.DrawLine(x0, y0, x1, y1); } if (i < n-1) { // draw line to next position int x2 = (int)XMap.XToY(i + 1.5); int y2 = (int)YMap.XToY(mArray[i+1]); - dc->DrawLine(x1, y1, x2, y2); + Dc.DrawLine(x1, y1, x2, y2); } if (!black) - dc->SetPen(*wxBLACK_PEN); + { + Dc.SetPen(*wxBLACK_PEN); + } return; } int gap = 0; - if (style_bits & ARED_GAP) + if (mStyleBits & ARED_GAP) { gap = w / n / 6; if (!gap && w / n > 3) @@ -384,7 +392,7 @@ xbar = x + i * w / n + gap; hbar = h * (mArray[i] - nul) / (max - min); - if (style_bits & ARED_BLOCKS) + if (mStyleBits & ARED_BLOCKS) { /* ybar = ynul - hbar; @@ -425,15 +433,17 @@ if (!black) { - dc->SetBrush(*wxWHITE_BRUSH); - dc->SetPen(*wxWHITE_PEN); + Dc.SetBrush(*wxWHITE_BRUSH); + Dc.SetPen(*wxWHITE_PEN); } if (wbar && hbar) - dc->DrawRectangle(xbar, ybar, wbar, hbar); + { + Dc.DrawRectangle(xbar, ybar, wbar, hbar); + } if (!black) { - dc->SetBrush(*wxBLACK_BRUSH); - dc->SetPen(*wxBLACK_PEN); + Dc.SetBrush(*wxBLACK_BRUSH); + Dc.SetPen(*wxBLACK_PEN); } } @@ -451,18 +461,19 @@ return buf; } -void JZArrayEdit::DrawXTicks(wxDC* dc) +void JZArrayEdit::DrawXTicks(wxDC& Dc) { int tw, th; - if (!(style_bits & ARED_XTICKS)) + if (!(mStyleBits & ARED_XTICKS)) + { return; + } + Dc.SetFont(*wxSMALL_FONT); - dc->SetFont(*wxSMALL_FONT); - // compute tickmark x-distance - dc->GetTextExtent("-123", &tw, &th); + Dc.GetTextExtent("-123", &tw, &th); int max_labels = (int)(w / (tw + tw/2)); if (max_labels > 0) { @@ -473,30 +484,30 @@ { const char *buf = GetXText(val); //sprintf(buf, "%d", val); - dc->GetTextExtent((char *)buf, &tw, &th); + Dc.GetTextExtent((char *)buf, &tw, &th); float yy = y + h; float xx = x + w * (val - xmin) / (xmax - xmin + 1); xx -= tw/2; // center text xx += 0.5 * w / n; // middle of bar - dc->DrawText(buf, (int)xx, (int)yy); - //dc->DrawLine(x - TICK_LINE, yy, x, yy); + Dc.DrawText(buf, (int)xx, (int)yy); + //Dc.DrawLine(x - TICK_LINE, yy, x, yy); } } - dc->SetFont(*wxNORMAL_FONT); + Dc.SetFont(*wxNORMAL_FONT); } -void JZArrayEdit::DrawYTicks(wxDC* dc) +void JZArrayEdit::DrawYTicks(wxDC& Dc) { - dc->SetFont(*wxSMALL_FONT); + Dc.SetFont(*wxSMALL_FONT); - if (style_bits & ARED_YTICKS) + if (mStyleBits & ARED_YTICKS) { // compute tickmark y-distance int tw, th; - dc->GetTextExtent("-123", &tw, &th); + Dc.GetTextExtent("-123", &tw, &th); int max_labels = (int)(h / (th + th/2)); if (max_labels > 0) { @@ -507,88 +518,98 @@ { const char *buf = GetYText(val); //sprintf(buf, "%d", val); - dc->GetTextExtent((char *)buf, &tw, &th); + Dc.GetTextExtent((char *)buf, &tw, &th); float yy = y + h - h * (val - min) / (max - min) - th/2; - dc->DrawText(buf, x - tw - TICK_LINE, (int)yy); - //dc->DrawLine(x - TICK_LINE, yy, x, yy); + Dc.DrawText(buf, x - tw - TICK_LINE, (int)yy); + //Dc.DrawLine(x - TICK_LINE, yy, x, yy); } } } - else if (style_bits & ARED_MINMAX) + else if (mStyleBits & ARED_MINMAX) { // min/max int tw, th; char buf[20]; sprintf(buf, "%d", max); - dc->GetTextExtent(buf, &tw, &th); - dc->DrawText(buf, x - tw, y); + Dc.GetTextExtent(buf, &tw, &th); + Dc.DrawText(buf, x - tw, y); sprintf(buf, "%d", min); - dc->GetTextExtent(buf, &tw, &th); - dc->DrawText(buf, x - tw, y + h - th); + Dc.GetTextExtent(buf, &tw, &th); + Dc.DrawText(buf, x - tw, y + h - th); } - dc->SetFont(*wxNORMAL_FONT); + Dc.SetFont(*wxNORMAL_FONT); } -void JZArrayEdit::DrawLabel(wxDC* dc) +void JZArrayEdit::DrawLabel(wxDC& Dc) { - dc->SetFont(*wxSMALL_FONT); + Dc.SetFont(*wxSMALL_FONT); if (!mLabel.empty()) { - dc->DrawText(mLabel.c_str(), x + 5, y + 2); + Dc.DrawText(mLabel.c_str(), x + 5, y + 2); } - dc->SetFont(*wxNORMAL_FONT); + Dc.SetFont(*wxNORMAL_FONT); } -void JZArrayEdit::OnDraw(wxDC& indc) +void JZArrayEdit::OnDraw(wxDC& Dc) { int i; - wxDC *dc = &indc; //just lazy... // surrounding rectangle - dc->Clear(); + Dc.Clear(); if (enabled) - dc->SetBrush(*wxWHITE_BRUSH); + { + Dc.SetBrush(*wxWHITE_BRUSH); + } else - dc->SetBrush(*wxGREY_BRUSH); - dc->SetPen(*wxBLACK_PEN); + { + Dc.SetBrush(*wxGREY_BRUSH); + } + + Dc.SetPen(*wxBLACK_PEN); if (w && h) - dc->DrawRectangle(x, y, w, h); + { + Dc.DrawRectangle(x, y, w, h); + } // sliders - dc->SetBrush(*wxBLACK_BRUSH); - for (i = 0; i < n; i++) - DrawBar(dc, i, 1); + Dc.SetBrush(*wxBLACK_BRUSH); + for (i = 0; i < n; ++i) + { + DrawBar(Dc, i, 1); + } - DrawXTicks(dc); - DrawLabel(dc); - DrawYTicks(dc); - DrawNull(dc); + DrawXTicks(Dc); + DrawLabel(Dc); + DrawYTicks(Dc); + DrawNull(Dc); if (draw_bars) - draw_bars->DrawBars(dc); + { + draw_bars->DrawBars(Dc); + } } -void JZArrayEdit::DrawNull(wxDC* dc) +void JZArrayEdit::DrawNull(wxDC& Dc) { - dc->SetPen(*wxCYAN_PEN); + Dc.SetPen(*wxCYAN_PEN); // draw y-null line if (min < nul && nul < max) - dc->DrawLine(x, ynul, x+w, ynul); + Dc.DrawLine(x, ynul, x+w, ynul); // draw x-null line if (xmin < 0 && 0 < xmax) { int x0 = w * (0 - xmin) / (xmax - xmin); - dc->DrawLine(x0, y, x0, y + h); + Dc.DrawLine(x0, y, x0, y + h); } - dc->SetPen(*wxBLACK_PEN); + Dc.SetPen(*wxBLACK_PEN); } @@ -621,44 +642,46 @@ index = Index(MouseEvent); } + wxClientDC Dc(this); // PORTING this is evil and shoud go + int val = nul; if (MouseEvent.LeftIsDown()) { int ex, ey; MouseEvent.GetPosition(&ex, &ey); + +#if 0 + { + // in msw ex,ey are 65536 for negative values! + char buf[500]; + sprintf(buf, "x %4.0f, y %4.0f, sh %d", ex, ey, MouseEvent.ShiftDown()); + Dc.DrawText(buf, 50, 50); + } +#endif + // $blk$ val = (int)( (y + h - (short)ey) * (max - min) / h + min); val = (int)( (double)(y + h - ey) * (max - min) / h + min + 0.5); val = val > max ? max : val; val = val < min ? min : val; } -#if 0 - { - // in msw ex,ey are 65536 for negative values! - wxDC *dc = new wxClientDC(this);//GetDC(); - char buf[500]; - sprintf(buf, "x %4.0f, y %4.0f, sh %d", ex, ey, MouseEvent.ShiftDown()); - dc->DrawText(buf, 50, 50); - } -#endif - wxDC *dc = new wxClientDC(this); // PORTING this is evil and shoud go if (MouseEvent.ShiftDown()) { int k; for (k = 0; k < n; k++) { - DrawBar(dc, k, 0); + DrawBar(Dc, k, 0); mArray[k] = val; - DrawBar(dc, k, 1); + DrawBar(Dc, k, 1); } } else if (MouseEvent.ControlDown()) { - DrawBar(dc, index, 0); + DrawBar(Dc, index, 0); mArray[index] = val; - DrawBar(dc, index, 1); + DrawBar(Dc, index, 1); } else { @@ -667,20 +690,20 @@ if (i < index) for (; i <= index; i++) { - DrawBar(dc, i, 0); + DrawBar(Dc, i, 0); mArray[i] = val; - DrawBar(dc, i, 1); + DrawBar(Dc, i, 1); } else for (; i >= index; i--) { - DrawBar(dc, i, 0); + DrawBar(Dc, i, 0); mArray[i] = val; - DrawBar(dc, i, 1); + DrawBar(Dc, i, 1); } index = k; } - delete dc; + return 0; } @@ -702,10 +725,9 @@ #endif dragging = 0; index = -1; -// wxDC *dc = new wxClientDC(this); // PORTING this is evil and shoud go -// DrawLabel(dc); -// DrawNull(dc); -// delete dc; +// wxClientDC Dc(this); // PORTING this is evil and shoud go +// DrawLabel(Dc); +// DrawNull(Dc); Refresh(); return 0; } @@ -747,16 +769,15 @@ ynul = y + h - h * (nul - min) / (max - min); } -void JZArrayEdit::DrawBarLine (wxDC *dc, int xx) +void JZArrayEdit::DrawBarLine(wxDC& Dc, int xx) { - // wxDC *dc = new wxClientDC(this);//GetDC(); - // fprintf(stderr,"x: %ld, xx: %ld\n",x,xx); +// cerr << "x: " << x << " xx: " << xx << endl; if (xx > x && xx + 1 < x + w) - { - dc->SetPen (*wxLIGHT_GREY_PEN); - dc->DrawLine (xx, y + 1, xx, y + h - 2); - dc->SetPen (*wxBLACK_PEN); - } + { + Dc.SetPen(*wxLIGHT_GREY_PEN); + Dc.DrawLine(xx, y + 1, xx, y + h - 2); + Dc.SetPen(*wxBLACK_PEN); + } } @@ -768,8 +789,8 @@ int yy, int ww, int hh, - int sty) - : JZArrayEdit(parent, Array, xx, yy, ww, hh, sty) + int StyleBits) + : JZArrayEdit(parent, Array, xx, yy, ww, hh, StyleBits) { steps_per_count = 4; count_per_bar = 4; @@ -786,20 +807,19 @@ } -void JZRhyArrayEdit::DrawXTicks(wxDC* dc) +void JZRhyArrayEdit::DrawXTicks(wxDC& Dc) { - if (!(style_bits & ARED_RHYTHM)) + if (!(mStyleBits & ARED_RHYTHM)) { - JZArrayEdit::DrawXTicks(dc); + JZArrayEdit::DrawXTicks(Dc); return; } char buf[20]; int tw, th; + Dc.SetFont(*wxSMALL_FONT); - dc->SetFont(*wxSMALL_FONT); - // tick marks assert(steps_per_count && count_per_bar && n_bars); int i; @@ -809,10 +829,9 @@ sprintf(buf, "%d", mark); int yy = y + h; int xx = (int)(x + (i + 0.5) * w / n); - dc->GetTextExtent(buf, &tw, &th); + Dc.GetTextExtent(buf, &tw, &th); xx -= (int)(tw/2.0); - dc->DrawText(buf, xx, yy); + Dc.DrawText(buf, xx, yy); } - dc->SetFont(*wxNORMAL_FONT); + Dc.SetFont(*wxNORMAL_FONT); } - Modified: trunk/jazz/src/Random.h =================================================================== --- trunk/jazz/src/Random.h 2013-03-18 18:47:25 UTC (rev 972) +++ trunk/jazz/src/Random.h 2013-03-18 18:51:59 UTC (rev 973) @@ -143,7 +143,7 @@ { } - virtual void DrawBars(wxDC* pDc) = 0; + virtual void DrawBars(wxDC& Dc) = 0; }; @@ -153,7 +153,7 @@ // paint position int x, y, w, h, ynul; - void DrawBar(wxDC *dc, int i, int black); + void DrawBar(wxDC& Dc, int i, int black); int dragging; // Dragging-Event valid int index; // ctrl down: drag this one @@ -166,14 +166,14 @@ // array size is mapped to this range for x-tick marks int xmin, xmax; - virtual void DrawXTicks(wxDC* dc); - virtual void DrawYTicks(wxDC* dc); - virtual void DrawLabel(wxDC* dc); - virtual void DrawNull(wxDC* dc); - int Index(wxMouseEvent& MouseEvent); + virtual void DrawXTicks(wxDC& Dc); + virtual void DrawYTicks(wxDC& Dc); + virtual void DrawLabel(wxDC& Dc); + virtual void DrawNull(wxDC& Dc); + int Index(wxMouseEvent& MouseEvent); - int enabled; - int style_bits; + int enabled; + int mStyleBits; virtual const char *GetXText(int xval); // Text for x-tickmarks virtual const char *GetYText(int yval); // Text for y-tickmarks @@ -187,11 +187,11 @@ int yy, int ww, int hh, - int style_bits = (ARED_GAP | ARED_XTICKS)); + int StyleBits = (ARED_GAP | ARED_XTICKS)); virtual ~JZArrayEdit(); - virtual void OnDraw(wxDC& indc); + virtual void OnDraw(wxDC& Dc); virtual void OnSize(wxSizeEvent& event); virtual void OnMouseEvent(wxMouseEvent& MouseEvent); virtual int Dragging(wxMouseEvent& MouseEvent); @@ -200,15 +200,15 @@ virtual void SetLabel(char const *llabel); void Enable(int enable = 1); - void SetStyle(int style) + void SetStyle(int StyleBits) { - style_bits = style; + mStyleBits = StyleBits; } // min and max value in array (both values inclusive) void SetYMinMax(int min, int max); // for display x-axis only, does not resize the array (both values inclusive) void SetXMinMax(int xmin, int xmax); - void DrawBarLine (wxDC *dc, int xx); + void DrawBarLine (wxDC& Dc, int xx); void SetDrawBars(JZArrayEditDrawBars *x) { draw_bars = x; @@ -233,13 +233,13 @@ int yy, int ww, int hh, - int style_bits = (ARED_GAP | ARED_XTICKS | ARED_RHYTHM)); + int StyleBits = (ARED_GAP | ARED_XTICKS | ARED_RHYTHM)); void SetMeter(int steps_per_count, int count_per_bar, int n_bars); protected: - virtual void DrawXTicks(wxDC* dc); + virtual void DrawXTicks(wxDC& Dc); private: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2013-03-18 18:56:03
|
Revision: 975 http://sourceforge.net/p/jazzplusplus/code/975 Author: pstieber Date: 2013-03-18 18:56:00 +0000 (Mon, 18 Mar 2013) Log Message: ----------- Updated JZSnapSelection vector processing to use std::vector instead of C-style arrays. Modified Paths: -------------- trunk/jazz/src/MouseAction.cpp trunk/jazz/src/MouseAction.h Modified: trunk/jazz/src/MouseAction.cpp =================================================================== --- trunk/jazz/src/MouseAction.cpp 2013-03-18 18:54:14 UTC (rev 974) +++ trunk/jazz/src/MouseAction.cpp 2013-03-18 18:56:00 UTC (rev 975) @@ -397,7 +397,7 @@ { if (!mXCoordinates.empty()) { - SnapToVector(x, mXCoordinates, ScrolledX, Up); + SnapToXVector(x, ScrolledX, Up); } else if (mXStep) { @@ -406,7 +406,7 @@ if (!mYCoordinates.empty()) { - SnapToVector(y, mYCoordinates, ScrolledY, Up); + SnapToYVector(y, ScrolledY, Up); } else if (mYStep) { @@ -416,24 +416,32 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZSnapSelection::SetXSnap(int XCount, int* pXVector, int ScrolledX) +void JZSnapSelection::SetXSnap(const vector<int>& XVector, int ScrolledX) { mXCoordinates.clear(); - for (int i = 0; i < XCount; ++i) + for ( + vector<int>::const_iterator iXValue = XVector.begin(); + iXValue != XVector.end(); + ++iXValue) { - mXCoordinates.push_back(pXVector[i] + ScrolledX); + const int& XValue = *iXValue; + mXCoordinates.push_back(XValue + ScrolledX); } mXStep = 0; } //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZSnapSelection::SetYSnap(int YCount, int* pYVector, int ScrolledY) +void JZSnapSelection::SetYSnap(const vector<int>& YVector, int ScrolledY) { mYCoordinates.clear(); - for (int i = 0; i < YCount; ++i) + for ( + vector<int>::const_iterator iYValue = YVector.begin(); + iYValue != YVector.end(); + ++iYValue) { - mXCoordinates.push_back(pYVector[i] + ScrolledY); + const int& YValue = *iYValue; + mYCoordinates.push_back(YValue + ScrolledY); } mYStep = 0; } @@ -460,35 +468,62 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZSnapSelection::SnapToVector( +void JZSnapSelection::SnapToXVector( int& Coordinate, - vector<int> Vector, int Scrolled, - bool Up) + bool Up) const { //DEBUG cout << "In: " << Coordinate; - for (unsigned i = 0; i < Vector.size(); ++i) + for (unsigned i = 0; i < mXCoordinates.size(); ++i) { - if (Vector[i] > Coordinate) + if (mXCoordinates[i] > Coordinate) { if (Up || i == 0) { - Coordinate = Vector[i]; + Coordinate = mXCoordinates[i]; } else { - Coordinate = Vector[i - 1]; + Coordinate = mXCoordinates[i - 1]; } //DEBUG cout << " Out: " << Coordinate << endl; return; } } //DEBUG cout << " Out: " << Coordinate << endl; - Coordinate = Vector[Vector.size() - 1]; + Coordinate = mXCoordinates[mXCoordinates.size() - 1]; } //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- +void JZSnapSelection::SnapToYVector( + int& Coordinate, + int Scrolled, + bool Up) const +{ +//DEBUG cout << "In: " << Coordinate; + for (unsigned i = 0; i < mYCoordinates.size(); ++i) + { + if (mYCoordinates[i] > Coordinate) + { + if (Up || i == 0) + { + Coordinate = mYCoordinates[i]; + } + else + { + Coordinate = mYCoordinates[i - 1]; + } +//DEBUG cout << " Out: " << Coordinate << endl; + return; + } + } +//DEBUG cout << " Out: " << Coordinate << endl; + Coordinate = mYCoordinates[mYCoordinates.size() - 1]; +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void JZSnapSelection::SnapMod( int& Coordinate, int Min, Modified: trunk/jazz/src/MouseAction.h =================================================================== --- trunk/jazz/src/MouseAction.h 2013-03-18 18:54:14 UTC (rev 974) +++ trunk/jazz/src/MouseAction.h 2013-03-18 18:56:00 UTC (rev 975) @@ -257,9 +257,9 @@ int ScrolledY, bool Up); - void SetXSnap(int XCount, int* pXVector, int ScrolledX); + void SetXSnap(const std::vector<int>& XVector, int ScrolledX); - void SetYSnap(int YCount, int* pYVector, int ScrolledY); + void SetYSnap(const std::vector<int>& YVector, int ScrolledY); void SetXSnap(int XMin, int XMax, int XStep); @@ -267,12 +267,10 @@ private: - static void SnapToVector( - int& Coordinate, - std::vector<int> Vector, - int Scrolled, - bool Up); + void SnapToXVector(int& Coordinate, int Scrolled, bool Up) const; + void SnapToYVector(int& Coordinate, int Scrolled, bool Up) const; + static void SnapMod( int& Coordinate, int Min, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2013-03-18 18:57:46
|
Revision: 976 http://sourceforge.net/p/jazzplusplus/code/976 Author: pstieber Date: 2013-03-18 18:57:43 +0000 (Mon, 18 Mar 2013) Log Message: ----------- Replaced data members for X snap locations with a local std::vector<int>. Modified Paths: -------------- trunk/jazz/src/PianoWindow.cpp trunk/jazz/src/PianoWindow.h Modified: trunk/jazz/src/PianoWindow.cpp =================================================================== --- trunk/jazz/src/PianoWindow.cpp 2013-03-18 18:56:00 UTC (rev 975) +++ trunk/jazz/src/PianoWindow.cpp 2013-03-18 18:57:43 UTC (rev 976) @@ -668,7 +668,6 @@ : JZEventWindow(pPianoFrame, pProject, Position, Size), mpPianoFrame(pPianoFrame), mPlayClock(-1), - mSnapCount(0), mPasteBuffer(), mpTrack(0), mTrackIndex(0), @@ -2014,22 +2013,16 @@ //----------------------------------------------------------------------------- void JZPianoWindow::SnapSelectionStart(wxMouseEvent& MouseEvent) { - mSnapCount = 0; int clk = SnapClock(mFromClock, false); int qnt = SnapClocks(); - while (clk <= mToClock && mSnapCount < eMaxSnaps) + vector<int> XSnaps; + while (clk <= mToClock) { - mSnapsX[mSnapCount++] = Clock2x(clk); + XSnaps.push_back(Clock2x(clk)); clk += qnt; } - if (mSnapCount < eMaxSnaps) - { - mpSnapSel->SetXSnap(mSnapCount, mSnapsX, 0); - } - else - { - mpSnapSel->SetXSnap(0, 0, 0); - } + mpSnapSel->SetXSnap(XSnaps, 0); + mpSnapSel->SetYSnap( mFromLine * mTrackHeight + mTopInfoHeight, mEventsY + mEventsHeight, Modified: trunk/jazz/src/PianoWindow.h =================================================================== --- trunk/jazz/src/PianoWindow.h 2013-03-18 18:56:00 UTC (rev 975) +++ trunk/jazz/src/PianoWindow.h 2013-03-18 18:57:43 UTC (rev 976) @@ -206,15 +206,8 @@ int mPlayClock; - enum TESizes - { - eMaxSnaps = 500 - }; + public: - int mSnapCount; - - int mSnapsX[eMaxSnaps]; - JZEventArray mPasteBuffer; public: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |