You can subscribe to this list here.
2008 |
Jan
|
Feb
|
Mar
(58) |
Apr
(100) |
May
(92) |
Jun
(12) |
Jul
|
Aug
|
Sep
(5) |
Oct
(1) |
Nov
(26) |
Dec
(29) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2009 |
Jan
(31) |
Feb
(20) |
Mar
(1) |
Apr
|
May
(5) |
Jun
(10) |
Jul
|
Aug
(2) |
Sep
|
Oct
(2) |
Nov
|
Dec
(1) |
2010 |
Jan
(1) |
Feb
(1) |
Mar
|
Apr
(36) |
May
(10) |
Jun
|
Jul
(38) |
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
|
2011 |
Jan
|
Feb
(6) |
Mar
(8) |
Apr
|
May
|
Jun
|
Jul
(14) |
Aug
(56) |
Sep
|
Oct
|
Nov
|
Dec
|
2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(13) |
Dec
(2) |
2013 |
Jan
(30) |
Feb
|
Mar
(43) |
Apr
(28) |
May
|
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
(10) |
Nov
(2) |
Dec
|
2014 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <pst...@us...> - 2010-07-18 20:04:03
|
Revision: 818 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=818&view=rev Author: pstieber Date: 2010-07-18 20:03:57 +0000 (Sun, 18 Jul 2010) Log Message: ----------- Fixed ReadString. Modified Paths: -------------- trunk/jazz/src/StringReadWrite.cpp Modified: trunk/jazz/src/StringReadWrite.cpp =================================================================== --- trunk/jazz/src/StringReadWrite.cpp 2010-07-18 03:17:54 UTC (rev 817) +++ trunk/jazz/src/StringReadWrite.cpp 2010-07-18 20:03:57 UTC (rev 818) @@ -29,17 +29,17 @@ //***************************************************************************** istream& ReadString(istream& Is, string& String) { - int Character; + char Character; do { - // Ignore through the first ". - Character = Is.get(); + // Ignore through the first quote (") character. + Is >> Character; } while (Character != '"' && Is.eof()); - // This is an intention infinite for loop. + // This is an intentional infinite loop. for (;;) { - Character = Is.get(); + Is >> Character; if (Character == '"' || Is.eof()) { break; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2010-07-18 03:18:00
|
Revision: 817 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=817&view=rev Author: pstieber Date: 2010-07-18 03:17:54 +0000 (Sun, 18 Jul 2010) Log Message: ----------- Changed the way pointers and references are specified. Modified Paths: -------------- trunk/jazz/src/Audio.cpp trunk/jazz/src/Sample.h Modified: trunk/jazz/src/Audio.cpp =================================================================== --- trunk/jazz/src/Audio.cpp 2010-07-18 03:14:47 UTC (rev 816) +++ trunk/jazz/src/Audio.cpp 2010-07-18 03:17:54 UTC (rev 817) @@ -72,7 +72,7 @@ { } - void Start(JZSample *s, long c) + void Start(JZSample* s, long c) { spl = s; clock = c; @@ -82,7 +82,7 @@ prev = 0; } - void AddBuffer(short *b, long buffer_clock, unsigned int bufsize) + void AddBuffer(short* b, long buffer_clock, unsigned int bufsize) { // everything done? @@ -127,7 +127,7 @@ } } - void AddListen(short *b, long fr_smpl, long to_smpl, unsigned int bufsize) + void AddListen(short* b, long fr_smpl, long to_smpl, unsigned int bufsize) { // Is everything done? if (length <= 0) @@ -401,7 +401,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- int JZSampleSet::ResetBuffers( - JZEventArray *evnt_arr, + JZEventArray* evnt_arr, long clock, long TicksPerMinute) { @@ -513,7 +513,7 @@ { if (voices[i]->Finished()) { - JZSampleVoice *v = voices[i]; + JZSampleVoice* v = voices[i]; voices[i] = voices[num_voices-1]; voices[num_voices-1] = v; num_voices--; @@ -530,7 +530,7 @@ // Returns the number of buffers containing sound. Fills as many buffers as // possible, the last buffers may contain silence only. //----------------------------------------------------------------------------- -int JZSampleSet::PrepareListen(JZSample *spl, long fr_smpl, long to_smpl) +int JZSampleSet::PrepareListen(JZSample* spl, long fr_smpl, long to_smpl) { listen_sample = spl; @@ -559,7 +559,7 @@ //----------------------------------------------------------------------------- int JZSampleSet::PrepareListen(int key, long fr_smpl, long to_smpl) { - JZSample *spl = mSamples[key]; + JZSample* spl = mSamples[key]; return PrepareListen(spl, fr_smpl, to_smpl); } @@ -625,7 +625,7 @@ // touch all playback sample data, so they may get swapped into memory for (int i = 0; i < eSampleCount; i++) { - JZSample *spl = mSamples[i]; + JZSample* spl = mSamples[i]; spl->GotoRAM(); } @@ -655,13 +655,13 @@ ~JZSamplesDlg(); #ifdef OBSOLETE - static void CloseButton(wxItem &item, wxCommandEvent& event); - static void PlayButton(wxItem &item, wxCommandEvent& event); - static void EditButton(wxItem &item, wxCommandEvent& event); - static void AddButton(wxItem &item, wxCommandEvent& event); - static void ClrButton(wxItem &item, wxCommandEvent& event); - static void HelpButton(wxItem &item, wxCommandEvent& event); - static void ListClick(wxItem &item, wxCommandEvent& event); + static void CloseButton(wxItem& item, wxCommandEvent& event); + static void PlayButton(wxItem& item, wxCommandEvent& event); + static void EditButton(wxItem& item, wxCommandEvent& event); + static void AddButton(wxItem& item, wxCommandEvent& event); + static void ClrButton(wxItem& item, wxCommandEvent& event); + static void HelpButton(wxItem& item, wxCommandEvent& event); + static void ListClick(wxItem& item, wxCommandEvent& event); #endif // OBSOLETE void OnCloseButton(); @@ -674,7 +674,7 @@ private: - JZSampleSet &set; + JZSampleSet& set; wxListBox* mpListBox; wxSlider* mpPanSlider; @@ -688,7 +688,7 @@ static char* mpSamplePath; static int current; - char *ListEntry(int i); + char* ListEntry(int i); void Sample2Win(int index); void Win2Sample(int index); void SetCurrentListEntry(int i); @@ -700,7 +700,7 @@ class JZAudioGloblForm : public wxForm { public: - JZAudioGloblForm(JZSampleSet &s) + JZAudioGloblForm(JZSampleSet& s) : wxForm( USED_WXFORM_BUTTONS ), mSampleSet(s) { @@ -709,7 +709,7 @@ ossbug2 = gpConfig->GetValue(C_OssBug2); duplex_audio = gpConfig->GetValue(C_DuplexAudio); - static const char *speedtxt[] = + static const char* speedtxt[] = { "8000", "11025", @@ -721,7 +721,7 @@ speedstr = 0; for (int i = 0; speedtxt[i]; i++) { - strlist.Append((wxObject *)speedtxt[i]); // ??? + strlist.Append((wxObject*)speedtxt[i]); // ??? if (atol(speedtxt[i]) == speed) { speedstr = copystring(speedtxt[i]); @@ -738,8 +738,8 @@ Add(wxMakeFormBool("Enable Audio", &enable)); Add(wxMakeFormNewLine()); - //Add(wxMakeFormString("Sample Freq", (char **)&speedstr, wxFORM_CHOICE, - Add(wxMakeFormString("Sample Freq", (char **)&speedstr, wxFORM_DEFAULT, + //Add(wxMakeFormString("Sample Freq", (char**)&speedstr, wxFORM_CHOICE, + Add(wxMakeFormString("Sample Freq", (char**)&speedstr, wxFORM_DEFAULT, new wxList(wxMakeConstraintStrings(&strlist), 0), NULL, wxHORIZONTAL)); Add(wxMakeFormNewLine()); Add(wxMakeFormBool("Stereo", &stereo)); @@ -813,7 +813,7 @@ wxList strlist; long speed; - const char *speedstr; + const char* speedstr; bool enable; bool stereo; bool mSoftwareSynchonization; @@ -954,7 +954,7 @@ void JZSampleSet::AddNote(const string& FileName, long frc, long toc) { int i; - JZSample *spl; + JZSample* spl; // See if the file name is already present in sample list. for (i = 0; i < eSampleCount; i++) @@ -1023,10 +1023,10 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- void JZSampleSet::SaveWave( - const char *fname, + const char* pFileName, long frc, long toc, - JZAudioRecordBuffer &buf) + JZAudioRecordBuffer& buf) { WaveHeader wh; wh.main_chunk = RIFF; @@ -1056,9 +1056,9 @@ wh.data_length = (end_index - start_index) * sizeof(short); wh.length = wh.data_length + sizeof(WaveHeader); - ofstream os(fname, ios::out | ios::binary | ios::trunc); + ofstream os(pFileName, ios::out | ios::binary | ios::trunc); - os.write((char *)&wh, sizeof(wh)); + os.write((char*)&wh, sizeof(wh)); int start_buffer = start_index / bufsize; int start_offs = start_index % bufsize; @@ -1068,24 +1068,24 @@ // Save part of first buffer. os.write( - (char *)&buf.buffers[start_buffer]->data[start_offs], + (char*)&buf.buffers[start_buffer]->data[start_offs], 2 * start_length); // write some complete buffers for (int i = start_buffer + 1; i < end_buffer; i++) - os.write((char *)buf.buffers[i]->data, bufsize * 2); + os.write((char*)buf.buffers[i]->data, bufsize * 2); // save part of last buffer if (end_length > 0) - os.write((char *)buf.buffers[end_buffer]->data, 2 * end_length); + os.write((char*)buf.buffers[end_buffer]->data, 2 * end_length); #if 0 // very slow, but works! ofstream slow("t2.wav", ios::out | ios::bin | ios::trunc); - slow.write((char *)&wh, sizeof(wh)); + slow.write((char*)&wh, sizeof(wh)); for (long i = start_index; i < end_index; i++) { int bi = i / bufsize; int di = i % bufsize; - slow.write((char *)&buf.buffers[bi]->data[di], sizeof(short)); + slow.write((char*)&buf.buffers[bi]->data[di], sizeof(short)); } #endif } @@ -1094,7 +1094,7 @@ // ------------------------------- record ------------------------ // ----------------------------------------------------------------- -DEFINE_ARRAY(JZAudioBufferArray, JZAudioBuffer *) +DEFINE_ARRAY(JZAudioBufferArray, JZAudioBuffer*) //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- @@ -1111,7 +1111,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -JZAudioBuffer * JZAudioRecordBuffer::RequestBuffer() +JZAudioBuffer* JZAudioRecordBuffer::RequestBuffer() { if (buffers[num_buffers] == 0) buffers[num_buffers] = new JZAudioBuffer(0); @@ -1135,7 +1135,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -JZSamplesDlg::JZSamplesDlg(wxWindow* pParent, JZSampleSet &s) +JZSamplesDlg::JZSamplesDlg(wxWindow* pParent, JZSampleSet& s) : wxDialog(pParent, wxID_ANY, wxString("Sample Settings")), set(s) { @@ -1207,13 +1207,13 @@ //----------------------------------------------------------------------------- void JZSamplesDlg::Sample2Win(int i) { - JZSample *spl = set.mSamples[i]; + JZSample* spl = set.mSamples[i]; mpVolumeSlider->SetValue(spl->GetVolume()); mpPitchSlider->SetValue(spl->GetPitch()); mpPanSlider->SetValue(spl->GetPan()); #ifdef OBSOLETE - pLabel->SetValue((char *)spl->GetLabel()); - file->SetValue((char *)spl->GetFileName()); + pLabel->SetValue((char*)spl->GetLabel()); + file->SetValue((char*)spl->GetFileName()); #endif } @@ -1221,7 +1221,7 @@ //----------------------------------------------------------------------------- void JZSamplesDlg::Win2Sample(int i) { - JZSample *spl = set.mSamples[i]; + JZSample* spl = set.mSamples[i]; spl->SetPitch(mpPitchSlider->GetValue()); spl->SetVolume(mpVolumeSlider->GetValue()); spl->SetPan(mpPanSlider->GetValue()); @@ -1295,7 +1295,7 @@ wxBeginBusyCursor(); Win2Sample(current); SetCurrentListEntry(current); - JZSample *spl = set.mSamples[current]; + JZSample* spl = set.mSamples[current]; spl->Load(); wxEndBusyCursor(); @@ -1317,7 +1317,7 @@ } Win2Sample(current); SetCurrentListEntry(current); - JZSample *spl = set.mSamples[current]; + JZSample* spl = set.mSamples[current]; wxBeginBusyCursor(); spl->Load(); gpMidiPlayer->ListenAudio(current); @@ -1328,7 +1328,7 @@ //----------------------------------------------------------------------------- void JZSamplesDlg::OnClrButton() { - JZSample *spl = set.mSamples[current]; + JZSample* spl = set.mSamples[current]; spl->Clear(); SetCurrentListEntry(current); Sample2Win(current); @@ -1357,33 +1357,33 @@ #ifdef OBSOLETE -void JZSamplesDlg::CloseButton(wxItem &itm, wxCommandEvent& event) +void JZSamplesDlg::CloseButton(wxItem& itm, wxCommandEvent& event) { - ((JZSamplesDlg *)itm.GetParent())->OnCloseButton(); + ((JZSamplesDlg*)itm.GetParent())->OnCloseButton(); } -void JZSamplesDlg::PlayButton(wxItem &itm, wxCommandEvent& event) +void JZSamplesDlg::PlayButton(wxItem& itm, wxCommandEvent& event) { - ((JZSamplesDlg *)itm.GetParent())->OnPlayButton(); + ((JZSamplesDlg*)itm.GetParent())->OnPlayButton(); } -void JZSamplesDlg::EditButton(wxItem &itm, wxCommandEvent& event) +void JZSamplesDlg::EditButton(wxItem& itm, wxCommandEvent& event) { - ((JZSamplesDlg *)itm.GetParent())->OnEditButton(); + ((JZSamplesDlg*)itm.GetParent())->OnEditButton(); } -void JZSamplesDlg::AddButton(wxItem &itm, wxCommandEvent& event) +void JZSamplesDlg::AddButton(wxItem& itm, wxCommandEvent& event) { - ((JZSamplesDlg *)itm.GetParent())->OnAddButton(); + ((JZSamplesDlg*)itm.GetParent())->OnAddButton(); } -void JZSamplesDlg::ClrButton(wxItem &itm, wxCommandEvent& event) +void JZSamplesDlg::ClrButton(wxItem& itm, wxCommandEvent& event) { - ((JZSamplesDlg *)itm.GetParent())->OnClrButton(); + ((JZSamplesDlg*)itm.GetParent())->OnClrButton(); } -void JZSamplesDlg::HelpButton(wxItem &itm, wxCommandEvent& event) +void JZSamplesDlg::HelpButton(wxItem& itm, wxCommandEvent& event) { - ((JZSamplesDlg *)itm.GetParent())->OnHelpButton(); + ((JZSamplesDlg*)itm.GetParent())->OnHelpButton(); } -void JZSamplesDlg::ListClick(wxItem &itm, wxCommandEvent& event) +void JZSamplesDlg::ListClick(wxItem& itm, wxCommandEvent& event) { - ((JZSamplesDlg *)itm.GetParent())->OnListClick(); + ((JZSamplesDlg*)itm.GetParent())->OnListClick(); } #endif // OBSOLETE #endif Modified: trunk/jazz/src/Sample.h =================================================================== --- trunk/jazz/src/Sample.h 2010-07-18 03:14:47 UTC (rev 816) +++ trunk/jazz/src/Sample.h 2010-07-18 03:17:54 UTC (rev 817) @@ -304,7 +304,7 @@ // access global adustments from JZSampleSet - JZSampleSet &SampleSet() + JZSampleSet& SampleSet() { return set; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2010-07-18 03:14:53
|
Revision: 816 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=816&view=rev Author: pstieber Date: 2010-07-18 03:14:47 +0000 (Sun, 18 Jul 2010) Log Message: ----------- Added code to set the sample wav file. Modified Paths: -------------- trunk/jazz/src/Dialogs/SamplesDialog.cpp trunk/jazz/src/Dialogs/SamplesDialog.h trunk/jazz/src/Resources.h Modified: trunk/jazz/src/Dialogs/SamplesDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/SamplesDialog.cpp 2010-07-18 03:13:45 UTC (rev 815) +++ trunk/jazz/src/Dialogs/SamplesDialog.cpp 2010-07-18 03:14:47 UTC (rev 816) @@ -21,8 +21,12 @@ #include "SamplesDialog.h" #include "../Audio.h" +#include "../Resources.h" +#include "../Sample.h" #include <wx/button.h> +#include <wx/filedlg.h> +#include <wx/filename.h> #include <wx/listbox.h> #include <wx/sizer.h> #include <wx/slider.h> @@ -33,8 +37,15 @@ //***************************************************************************** //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- +BEGIN_EVENT_TABLE(JZSamplesDialog, wxDialog) + EVT_BUTTON(IDC_BN_SD_FILE_SELECT_BROWSE, OnSelectSampleFile) +END_EVENT_TABLE() + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- JZSamplesDialog::JZSamplesDialog(wxWindow* pParent, JZSampleSet& SampleSet) : wxDialog(pParent, wxID_ANY, wxString("Samples Settings")), + mSampleSet(SampleSet), mpListBox(0), mpLabelEdit(0), mpFileNameEdit(0), @@ -65,8 +76,7 @@ mpFileNameBrowseButton = new wxButton( this, - wxID_ANY, -// IDC_BN_SD_FILE_SELECT_BROWSE, + IDC_BN_SD_FILE_SELECT_BROWSE, "Browse..."); mpVolumeSlider = new wxSlider( @@ -179,3 +189,30 @@ pTopSizer->SetSizeHints(this); pTopSizer->Fit(this); } + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZSamplesDialog::OnSelectSampleFile(wxCommandEvent& Event) +{ + int Selection = mpListBox->GetSelection(); + if (Selection != wxNOT_FOUND) + { + wxFileDialog FileOpenDialog( + this, + "Choose a sound file", + wxEmptyString, + wxEmptyString, + "WAV files (*.wav)|*.wav", + wxFD_OPEN | wxFD_CHANGE_DIR); + if (FileOpenDialog.ShowModal() == wxID_OK) + { + wxFileName FileName = FileOpenDialog.GetPath(); + mSampleSet[Selection].SetFileName(FileName.GetFullPath()); + mpFileNameEdit->ChangeValue(FileName.GetFullPath()); + mpLabelEdit->ChangeValue(FileName.GetName()); + wxString Label; + Label << Selection + 1 << ' ' << FileName.GetFullName(); + mpListBox->SetString(Selection, Label); + } + } +} Modified: trunk/jazz/src/Dialogs/SamplesDialog.h =================================================================== --- trunk/jazz/src/Dialogs/SamplesDialog.h 2010-07-18 03:13:45 UTC (rev 815) +++ trunk/jazz/src/Dialogs/SamplesDialog.h 2010-07-18 03:14:47 UTC (rev 816) @@ -41,6 +41,12 @@ private: + void OnSelectSampleFile(wxCommandEvent& Event); + + private: + + JZSampleSet& mSampleSet; + wxListBox* mpListBox; wxTextCtrl* mpLabelEdit; wxTextCtrl* mpFileNameEdit; @@ -48,6 +54,8 @@ wxSlider* mpVolumeSlider; wxSlider* mpPanSlider; wxSlider* mpPitchSlider; + + DECLARE_EVENT_TABLE() }; #endif // !defined(JZ_SAMPLESDIALOG_H) Modified: trunk/jazz/src/Resources.h =================================================================== --- trunk/jazz/src/Resources.h 2010-07-18 03:13:45 UTC (rev 815) +++ trunk/jazz/src/Resources.h 2010-07-18 03:14:47 UTC (rev 816) @@ -136,4 +136,7 @@ // JZTransposeDialog resource IDs. #define IDC_KB_AMOUNT wxID_HIGHEST + 1232 +// JZSamplesDialog resource IDs. +#define IDC_BN_SD_FILE_SELECT_BROWSE wxID_HIGHEST + 1240 + #endif // !defined(JZ_RESOURCES_H) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2010-07-18 03:13:51
|
Revision: 815 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=815&view=rev Author: pstieber Date: 2010-07-18 03:13:45 +0000 (Sun, 18 Jul 2010) Log Message: ----------- Changed the way pointers and references are specified. Modified Paths: -------------- trunk/jazz/src/Audio.h Modified: trunk/jazz/src/Audio.h =================================================================== --- trunk/jazz/src/Audio.h 2010-07-17 23:52:54 UTC (rev 814) +++ trunk/jazz/src/Audio.h 2010-07-18 03:13:45 UTC (rev 815) @@ -297,7 +297,7 @@ int FillBuffers(long last_clock); - JZAudioBuffer *GetBuffer(int i) const + JZAudioBuffer* GetBuffer(int i) const { // 0 < i < BUFCOUNT return buffers[i]; @@ -367,7 +367,7 @@ void RefreshDialogs(); - JZSample &operator[](int i) + JZSample& operator[](int i) { return *mSamples[i]; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2010-07-17 23:53:00
|
Revision: 814 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=814&view=rev Author: pstieber Date: 2010-07-17 23:52:54 +0000 (Sat, 17 Jul 2010) Log Message: ----------- 1. Enabled keyboard handling in the piano window. 2. Removed commented computer keyboard code from the event window. Modified Paths: -------------- trunk/jazz/src/EventWindow.cpp trunk/jazz/src/PianoWindow.cpp trunk/jazz/src/PianoWindow.h Modified: trunk/jazz/src/EventWindow.cpp =================================================================== --- trunk/jazz/src/EventWindow.cpp 2010-07-17 23:38:12 UTC (rev 813) +++ trunk/jazz/src/EventWindow.cpp 2010-07-17 23:52:54 UTC (rev 814) @@ -590,35 +590,3 @@ } } } - - -// JAVE the OnChar method seems to be gone in wxwin232, but its documented, so -// I don't know what happened. The OnCharHook should do the same thing -// basically. It was there from the start. OnChar seemd redundant. - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -// void JZEventWindow::OnChar(wxKeyEvent& KeyEvent) -// { -// if (!EventWin->OnKeyEvent(KeyEvent)) -// { -// wxWindow::OnChar(KeyEvent); -// } -// } - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -// void JZEventWindow::OnChar(wxKeyEvent& KeyEvent) -// { -// if (!OnKeyEvent(KeyEvent)) -// { -// wxFrame::OnChar(KeyEvent); -// } -// } - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -//bool JZEventWindow::OnCharHook(wxKeyEvent& KeyEvent) -//{ -// return EventWin->OnKeyEvent(KeyEvent); -//} Modified: trunk/jazz/src/PianoWindow.cpp =================================================================== --- trunk/jazz/src/PianoWindow.cpp 2010-07-17 23:38:12 UTC (rev 813) +++ trunk/jazz/src/PianoWindow.cpp 2010-07-17 23:52:54 UTC (rev 814) @@ -625,6 +625,8 @@ EVT_PAINT(JZPianoWindow::OnPaint) + EVT_CHAR(JZPianoWindow::OnChar) + EVT_MOUSE_EVENTS(JZPianoWindow::OnMouseEvent) EVT_SCROLLWIN(JZPianoWindow::OnScroll) @@ -1122,13 +1124,6 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -bool JZPianoWindow::OnCharHook(wxKeyEvent& Event) -{ - return OnKeyEvent(Event); -} - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- void JZPianoWindow::OnMenuCommand(int Id) { switch (Id) @@ -1141,7 +1136,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -bool JZPianoWindow::OnKeyEvent(wxKeyEvent& Event) +void JZPianoWindow::OnChar(wxKeyEvent& Event) { if (Event.ControlDown()) { @@ -1149,17 +1144,17 @@ { case 'Z': OnMenuCommand(wxID_UNDO); - return true; + return; case 'Y': OnMenuCommand(wxID_REDO); - return true; + return; case 'X': OnMenuCommand(wxID_CUT); - return true; + return; case 'C': case WXK_INSERT: OnMenuCommand(wxID_COPY); - return true; + return; } } else if (Event.ShiftDown()) @@ -1172,14 +1167,14 @@ --mTrackIndex; NewPosition(mTrackIndex, -1); } - return true; + return; case WXK_DOWN: if (mTrackIndex < mpProject->GetTrackCount() - 1) { ++mTrackIndex; NewPosition(mTrackIndex, -1); } - return true; + return; } } else @@ -1188,11 +1183,11 @@ { case WXK_DELETE: OnMenuCommand(wxID_DELETE); - return true; + return; } } - return false; + Event.Skip(); } //----------------------------------------------------------------------------- Modified: trunk/jazz/src/PianoWindow.h =================================================================== --- trunk/jazz/src/PianoWindow.h 2010-07-17 23:38:12 UTC (rev 813) +++ trunk/jazz/src/PianoWindow.h 2010-07-17 23:52:54 UTC (rev 814) @@ -280,12 +280,8 @@ void MousePiano(wxMouseEvent& MouseEvent); - bool OnCharHook(wxKeyEvent& Event); - void OnChar(wxKeyEvent& Event); - bool OnKeyEvent(wxKeyEvent& Event); - void OnMenuCommand(int Id); void InitColors(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2010-07-17 23:38:18
|
Revision: 813 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=813&view=rev Author: pstieber Date: 2010-07-17 23:38:12 +0000 (Sat, 17 Jul 2010) Log Message: ----------- 1. Made an end-of-line comment and above-line comment. 2. Used pre-increment instead of post-increment. Modified Paths: -------------- trunk/jazz/src/PianoWindow.cpp Modified: trunk/jazz/src/PianoWindow.cpp =================================================================== --- trunk/jazz/src/PianoWindow.cpp 2010-07-17 21:29:09 UTC (rev 812) +++ trunk/jazz/src/PianoWindow.cpp 2010-07-17 23:38:12 UTC (rev 813) @@ -681,9 +681,10 @@ mpTrack = mpProject->GetTrack(mTrackIndex); - mFontSize = mPianoFontSizes[1]; // Must be an entry in the array. + // Must be an entry in the array. + mFontSize = mPianoFontSizes[1]; - for (int i = 0; i < eMaxTrackCount; i++) + for (int i = 0; i < eMaxTrackCount; ++i) { mFromLines[i] = 64; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2010-07-17 21:29:15
|
Revision: 812 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=812&view=rev Author: pstieber Date: 2010-07-17 21:29:09 +0000 (Sat, 17 Jul 2010) Log Message: ----------- Removed unused track index and track pointer data members from the piano frame. Modified Paths: -------------- trunk/jazz/src/PianoFrame.cpp trunk/jazz/src/PianoFrame.h Modified: trunk/jazz/src/PianoFrame.cpp =================================================================== --- trunk/jazz/src/PianoFrame.cpp 2010-07-17 21:20:08 UTC (rev 811) +++ trunk/jazz/src/PianoFrame.cpp 2010-07-17 21:29:09 UTC (rev 812) @@ -238,7 +238,6 @@ mClockTicsPerPixel = 4; - mTrackIndex = 0; mpToolBar->ToggleTool(ID_SNAP_16, TRUE); mpPianoWindow = new JZPianoWindow(this, pProject); Modified: trunk/jazz/src/PianoFrame.h =================================================================== --- trunk/jazz/src/PianoFrame.h 2010-07-17 21:20:08 UTC (rev 811) +++ trunk/jazz/src/PianoFrame.h 2010-07-17 21:29:09 UTC (rev 812) @@ -72,10 +72,6 @@ void OnSnapDlg(wxCommandEvent& Event); - // Current track. - int mTrackIndex; - JZTrack* Track; - void MouseCutPaste(wxMouseEvent& MouseEvent, bool cut); bool OnClose(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2010-07-17 21:20:15
|
Revision: 811 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=811&view=rev Author: pstieber Date: 2010-07-17 21:20:08 +0000 (Sat, 17 Jul 2010) Log Message: ----------- Added the new sample frame code. Added Paths: ----------- trunk/jazz/src/SampleFrame.cpp trunk/jazz/src/SampleFrame.h Added: trunk/jazz/src/SampleFrame.cpp =================================================================== --- trunk/jazz/src/SampleFrame.cpp (rev 0) +++ trunk/jazz/src/SampleFrame.cpp 2010-07-17 21:20:08 UTC (rev 811) @@ -0,0 +1,870 @@ +#include "SampleFrame.h" + +#include "FileSelector.h" +#include "Help.h" +#include "Mapper.h" +#include "Player.h" +#include "Resources.h" +#include "SampleDialog.h" +#include "SampleWindow.h" + +#include <wx/menu.h> +#include <wx/msgdlg.h> +#include <wx/scrolbar.h> + +#include "Bitmaps/open.xpm" +#include "Bitmaps/save.xpm" +#include "Bitmaps/play.xpm" +#include "Bitmaps/help.xpm" +#include "Bitmaps/accept.xpm" +#include "Bitmaps/cancel.xpm" +#include "Bitmaps/zoomin.xpm" +#include "Bitmaps/zoomout.xpm" + +#define MEN_HELP 5 + +#define MEN_SILENCE 21 +#define MEN_SILENCE_INS 22 +#define MEN_SILENCE_APP 23 +#define MEN_SILENCE_OVR 24 + +#define MEN_ACCEPT 42 + +#define MEN_FLIP 56 +#define MEN_FLIP_LEFT 57 +#define MEN_FLIP_RIGHT 58 + +static JZToolDef tdefs[] = +{ + { wxID_OPEN, false, open_xpm, "open wave file" }, + { wxID_SAVE, false, save_xpm, "save wave file" }, + { JZToolBar::eToolBarSeparator }, + { wxID_ZOOM_IN, false, zoomin_xpm, "zoom to selection" }, + { wxID_ZOOM_OUT, false, zoomout_xpm, "zoom out" }, + { MEN_ACCEPT, false, accept_xpm, "accept painting" }, + { ID_PAINTER_NONE, false, cancel_xpm, "cancel painting" }, + { JZToolBar::eToolBarSeparator }, + { ID_PLAY, false, play_xpm, "play sample" }, + { MEN_HELP, false, help_xpm, "help" }, + { JZToolBar::eToolBarEnd } +}; + +int JZSampleFrame::geo[4] = +{ + 30, + 30, + 600, + 300 +}; + +JZSample *JZSampleFrame::copy_buffer; + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +JZSampleFrame::JZSampleFrame( + wxWindow* pParent, + JZSampleFrame **ref, + JZSample& Sample) + : wxFrame( + pParent, + wxID_ANY, + Sample.GetFileName(), + wxPoint(geo[0], geo[1]), + wxSize(geo[2], geo[3])), + spl(Sample), + vol_command(Sample), + pan_command(Sample), + pitch_command(Sample), + wah_command(Sample) +{ + this->ref = ref; + + in_constructor = true; + + cnvs = 0; + mpToolBar = 0; + scrol_panel = 0; + pos_scrol = 0; + zoom_scrol = 0; + num_params = 0; + on_accept = 0; + equalizer = 0; + distortion = 0; + reverb = 0; + echo = 0; + shifter = 0; + stretcher = 0; + filter = 0; + settings = 0; + wah_settings = 0; + pitch_settings = 0; + chorus = 0; + synth = 0; + + if (copy_buffer == 0) + copy_buffer = new JZSample(spl.SampleSet()); + + mpToolBar = new JZToolBar(this, tdefs); + + // Create a menu bar, the various menus with entries, and attach them to the + // menu bar. + + wxMenu* pMenu = 0; + wxMenu* pSubMenu = 0; + wxMenuBar* pMenuBar = new wxMenuBar; + + // Create and populate the File menu. + pMenu = new wxMenu; + + pMenu->Append(ID_FILE_REVERT_TO_SAVED, "&Revert to Saved"); + pMenu->Append(wxID_OPEN, "&Load..."); + pMenu->Append(wxID_SAVE, "&Save"); + pMenu->Append(wxID_SAVEAS, "&Save As..."); + pMenu->Append(wxID_CLOSE, "&Close"); + + pMenuBar->Append(pMenu, "&File"); + + // Create and populate the Edit menu. + pMenu = new wxMenu; + pMenu->Append(wxID_CUT, "&Cut"); + pMenu->Append(wxID_COPY, "Co&py"); + pMenu->Append(wxID_PASTE, "&Paste"); + pMenu->Append(ID_EDIT_PASTE_MERGE, "Paste &Merge"); + pSubMenu = new wxMenu; + pSubMenu->Append(MEN_SILENCE_OVR, "&Replace"); + pSubMenu->Append(MEN_SILENCE_INS, "&Insert"); + pSubMenu->Append(MEN_SILENCE_APP, "&Append"); + pMenu->Append(MEN_SILENCE, "&Silence", pSubMenu); + pSubMenu = new wxMenu; + pSubMenu->Append(MEN_FLIP_LEFT, "Left"); + pSubMenu->Append(MEN_FLIP_RIGHT, "Right"); + pMenu->Append(MEN_FLIP, "In&vert Phase", pSubMenu); + pMenu->Append(ID_EDIT_MAXIMIZE_VOLUME, "&Maximize Volume"); + pMenuBar->Append(pMenu, "&Edit"); + + pMenu = new wxMenu; + pMenu->Append(ID_PAINTERS_VOLUME, "&Volume..."); + pMenu->Append(ID_PAINTER_PAN, "&Panpot..."); + pMenu->Append(ID_PAINTER_PITCH, "&Pitch..."); + pMenu->Append(ID_PAINTER_WAHWAH, "&Filter..."); + pMenu->Append(ID_PAINTER_NONE, "&None..."); + pMenuBar->Append(pMenu, "&Painters"); + + pMenu = new wxMenu; + pMenu->Append(ID_EFFECTS_EQUALIZER, "&Equalizer..."); + pMenu->Append(ID_EFFECTS_FILTER, "&Filter..."); + pMenu->Append(ID_EFFECTS_DISTORTION, "&Distortion..."); + pMenu->Append(ID_EFFECTS_REVERB, "&Reverb..."); + pMenu->Append(ID_EFFECTS_ECHO, "&Echo..."); + pMenu->Append(ID_EFFECTS_CHORUS, "&Chorus..."); + pMenu->Append(ID_EFFECTS_PITCH_SHIFTER, "&Pitch shifter..."); + pMenu->Append(ID_EFFECTS_STRETCHER, "&Time stretcher..."); + pMenu->Append(ID_EFFECTS_REVERSE, "Re&verse"); + pMenu->Append(ID_EFFECTS_SYNTH, "&Synth..."); + pMenuBar->Append(pMenu, "&Effects"); + + pMenu = new wxMenu; + pMenu->Append(ID_SETTINGS_PITCH_PAINTER, "&Pitch Painter..."); + pMenu->Append(ID_SETTINGS_WAHWAH, "&Filter Painter..."); +// pMenu->Append(wxID_ZOOM_IN, "Zoom &In"); +// pMenu->Append(wxID_ZOOM_OUT, "Zoom &Out"); + pMenu->Append(ID_VIEW_SETTINGS, "&View Settings..."); + pMenuBar->Append(pMenu, "&Settings"); + + SetMenuBar(pMenuBar); + + // construct a panel containing the scrollbars + cnvs = new JZSampleWindow(this, spl); + scrol_panel = new wxPanel(this); + +//OBSOLETE pos_scrol = new wxScrollBar(scrol_panel, (wxFunction)ScrollCallback); + pos_scrol = new wxScrollBar(scrol_panel, wxID_ANY); +// pos_scrol->SetObjectLength(1000); +// pos_scrol->SetViewLength(1000); +// pos_scrol->SetValue(0); + pos_scrol->SetScrollbar(0, 1000, 1000, 1000); + +//OBSOLETE zoom_scrol = new wxScrollBar(scrol_panel, (wxFunction)ScrollCallback); + zoom_scrol = new wxScrollBar(scrol_panel, wxID_ANY); +// zoom_scrol->SetObjectLength(1000); +// zoom_scrol->SetViewLength(10); +// zoom_scrol->SetPageLength(100); +// zoom_scrol->SetValue(0); + zoom_scrol->SetScrollbar(0, 10, 1000, 100); + + in_constructor = false; + + // now force a resize for motif + int cw, ch; + GetClientSize(&cw, &ch); + OnSize(cw, ch); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +JZSampleFrame::~JZSampleFrame() +{ + *ref = 0; + GetPosition(&geo[0], &geo[1]); + GetSize(&geo[2], &geo[3]); + delete mpToolBar; + delete cnvs; + delete zoom_scrol; + delete pos_scrol; + delete scrol_panel; + for (int i = 0; i < num_params; i++) + delete params[i]; + delete equalizer; + delete distortion; + delete reverb; + delete echo; + delete chorus; + delete synth; + delete shifter; + delete stretcher; + delete filter; + delete settings; + delete wah_settings; + delete pitch_settings; +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +bool JZSampleFrame::OnClose() +{ + return true; +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZSampleFrame::OnSize(int w, int h) +{ + // constructor finished? + if (in_constructor) + return; + + int cw, ch; + GetClientSize(&cw, &ch); + + wxSize ToolBarSize = mpToolBar->GetSize(); + int pw, ph; + pos_scrol->GetSize(&pw, &ph); + int zw, zh; + zoom_scrol->GetSize(&zw, &zh); + +//OBSOLETE mpToolBar->SetSize(0, 0, (int)cw, ToolBarSize.GetHeight()); + scrol_panel->SetSize(0, ch-zh-ph, cw, zh+ph); + zoom_scrol->SetSize(0, 0, cw, zh); + pos_scrol->SetSize(0, zh, cw, ph); + + // divide the remaining space on cnvs and params + int xx = 0; + int yy = ToolBarSize.GetHeight(); + int ww = cw; + int hh = ch - ToolBarSize.GetHeight() - zh - ph; + int nn = spl.GetChannelCount() + num_params; + + int hi = hh * spl.GetChannelCount() / nn; + cnvs->SetSize(xx, yy, ww, hi); + + hi = hh / nn; + for (int i = 0; i < num_params; i++) + { + int yi = yy + (i + spl.GetChannelCount()) * hh / nn; + params[i]->SetSize(xx, yi, ww, hi); + } +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZSampleFrame::Redraw() +{ + cnvs->Redraw(); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +bool JZSampleFrame::HaveInsertionPoint(int &offs, bool warn) +{ + if (cnvs->sel_fr == cnvs->sel_to && cnvs->sel_fr >= 0) + { + offs = cnvs->sel_fr; + return true; + } + else + { + offs = -1; + if (warn) + { + ::wxMessageBox("Please set the insertion point first", "Error", wxOK); + } + return false; + } +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +bool JZSampleFrame::HaveSelection( + int& fr_smpl, + int& to_smpl, + HaveSelectionMode mode) +{ + if (cnvs->sel_fr < cnvs->sel_to && cnvs->sel_fr >= 0) + { + fr_smpl = cnvs->sel_fr; + to_smpl = cnvs->sel_to; + return true; + } + else if (mode == SelAll) + { + fr_smpl = 0; + to_smpl = spl.GetLength(); + return true; + } + fr_smpl = to_smpl = -1; + if (mode == SelWarn) + { + ::wxMessageBox("Please select the samples first", "Error", wxOK); + } + return false; +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZSampleFrame::AddParam(JZRndArray *array, const char *label) +{ + params[num_params] = new JZArrayEdit(this, *array, 0, 0, 10, 10, 0); + params[num_params]->SetLabel(label); + num_params++; + int cw, ch; + GetClientSize(&cw, &ch); + OnSize(cw, ch); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZSampleFrame::ClrParam() +{ + if (num_params > 0) + { + int n = num_params; + num_params = 0; + for (int i = 0; i < n; ++i) + { + delete params[i]; + } + int cw, ch; + GetClientSize(&cw, &ch); + OnSize(cw, ch); + } +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZSampleFrame::ClearSelection() +{ + cnvs->ClearSelection(); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZSampleFrame::LoadError(JZSample& Sample) +{ + wxString Message; + Message << "Could not load " << Sample.GetFileName(); + ::wxMessageBox(Message, "Error", wxOK); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +extern int effect(JZSample &spl); + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZSampleFrame::OnMenuCommand(int id) +{ + if (gpMidiPlayer->IsPlaying()) + { + return; + } + + // Player crashes if data disappear. + if (id != ID_PLAY) + { + cnvs->playpos->StopListen(); + } + + switch (id) + { + case ID_EFFECTS_EQUALIZER: + if (equalizer == 0) + equalizer = new JZEqualizer(*this); + equalizer->Show(true); + break; + + case MEN_FLIP_LEFT: + spl.Flip(0); + break; + case MEN_FLIP_RIGHT: + spl.Flip(1); + break; + + case ID_EFFECTS_DISTORTION: + if (distortion == 0) + distortion = new JZDistortion(*this); + distortion->Show(true); + break; + + case ID_EFFECTS_REVERB: +#ifdef OBSOLETE + if (reverb == 0) + { + // Old version was not modal. + reverb = new wxDialog(this, wxID_ANY, "Reverb"); + tReverbForm *form = new tReverbForm(*this); + form->EditForm(reverb); + reverb->Fit(); + } + ClearSelection(); + SetViewPos(0, spl.GetLength()); + reverb->Show(true); +#endif + break; + + case ID_EFFECTS_REVERSE: + { + int fr, to; + if (HaveSelection(fr, to)) + { + spl.Reverse(fr, to); + Redraw(); + } + } + break; + + case ID_EFFECTS_PITCH_SHIFTER: +#ifdef OBSOLETE + if (shifter == 0) + { + shifter = new wxDialogBox(this, "Shifter", false ); + tShifterForm *form = new tShifterForm(*this); + form->EditForm(shifter); + shifter->Fit(); + } + ClearSelection(); + SetViewPos(0, spl.GetLength()); + shifter->Show(true); +#endif + break; + + case ID_EFFECTS_STRETCHER: +#ifdef OBSOLETE + if (stretcher == 0) + { + stretcher = new wxDialogBox(this, "Stretcher", false ); + tStretcherForm *form = new tStretcherForm(*this); + form->EditForm(stretcher); + stretcher->Fit(); + } + ClearSelection(); + SetViewPos(0, spl.GetLength()); + stretcher->Show(true); +#endif + break; + + case ID_EFFECTS_FILTER: +#ifdef OBSOLETE + if (filter == 0) + { + filter = new wxDialogBox(this, "Filter", false ); + tSplFilterForm *form = new tSplFilterForm(*this); + form->EditForm(filter); + filter->Fit(); + } + filter->Show(true); +#endif + break; + + case ID_VIEW_SETTINGS: +#ifdef OBSOLETE + if (settings == 0) + { + settings = new wxDialogBox(this, "Settings", false ); + JZSmplWinSettingsForm *form = new JZSmplWinSettingsForm(*this); + form->EditForm(settings); + settings->Fit(); + } + settings->Show(true); +#endif + break; + + case ID_EFFECTS_ECHO: +#ifdef OBSOLETE + if (echo == 0) + { + echo = new wxDialogBox(this, "Echo", false ); + tEchoForm *form = new tEchoForm(*this); + form->EditForm(echo); + echo->Fit(); + } + ClearSelection(); + SetViewPos(0, spl.GetLength()); + echo->Show(true); +#endif + break; + + case ID_EFFECTS_CHORUS: +#ifdef OBSOLETE + if (chorus == 0) + { + chorus = new wxDialogBox(this, "Chorus", false ); + tChorusForm *form = new tChorusForm(*this); + form->EditForm(chorus); + chorus->Fit(); + } + ClearSelection(); + SetViewPos(0, spl.GetLength()); + chorus->Show(true); +#endif + break; + + case ID_EFFECTS_SYNTH: + if (synth == 0) + synth = new JZSynthDlg(*this); + synth->Show(true); + break; + + case MEN_ACCEPT: + if (on_accept) + { + int fr = GetPaintOffset(); + int to = fr + GetPaintLength(); + on_accept->OnAccept(fr, to); + delete on_accept; + on_accept = 0; + } + break; + + case ID_PAINTER_NONE: + if (on_accept) + { + delete on_accept; + on_accept = 0; + } + break; + + case wxID_CUT: + { + int fr, to; + if (HaveSelection(fr, to, SelWarn)) + { + spl.Cut(*copy_buffer, fr, to); + cnvs->ClearSelection(); + cnvs->SetInsertionPoint(fr); + Redraw(); + } + } + break; + + case wxID_COPY: + { + int fr, to; + if (HaveSelection(fr, to, SelAll)) + spl.Copy(*copy_buffer, fr, to); + } + break; + + case wxID_ZOOM_IN: + { + int fr, to; + if (HaveSelection(fr, to, SelWarn)) + SetViewPos(fr, to); + } + break; + + case wxID_ZOOM_OUT: + SetViewPos(0, spl.GetLength()); + break; + + case ID_EDIT_MAXIMIZE_VOLUME: + spl.Rescale(); + Redraw(); + break; + + case ID_PAINTERS_VOLUME: + delete on_accept; + on_accept = new JZCommandPainter(*this, vol_command); + break; + + case ID_PAINTER_WAHWAH: + delete on_accept; + on_accept = new JZCommandPainter(*this, wah_command); + break; + + case ID_SETTINGS_WAHWAH: +#ifdef OBSOLETE + if (wah_settings == 0) + { + wah_settings = new wxDialogBox(this, "Filter Painter", false); + tWahSettingsForm *form = new tWahSettingsForm(*this); + form->EditForm(wah_settings); + wah_settings->Fit(); + } + wah_settings->Show(true); +#endif + break; + + case ID_SETTINGS_PITCH_PAINTER: +#ifdef OBSOLETE + if (pitch_settings == 0) + { + pitch_settings = new wxDialogBox(this, "Pitch Painter"); + tSplPitchForm *form = new tSplPitchForm(*this); + form->EditForm(pitch_settings); + pitch_settings->Fit(); + } + pitch_settings->Show(true); +#endif + break; + + + case ID_PAINTER_PAN: + delete on_accept; + on_accept = new JZCommandPainter(*this, pan_command); + break; + + case ID_EDIT_PASTE_MERGE: + { + int offs; + if (HaveInsertionPoint(offs)) + { + spl.PasteMix(*copy_buffer, offs); + cnvs->SetSelection(offs, offs + copy_buffer->GetLength()); + Redraw(); + } + } + break; + + case wxID_PASTE: + { + int offs, fr, to; + if (HaveInsertionPoint(offs, false)) + { + spl.PasteIns(*copy_buffer, offs); + cnvs->SetSelection(offs, offs + copy_buffer->GetLength()); + Redraw(); + } + else if (HaveSelection(fr, to, SelWarn)) + { + spl.PasteOvr(*copy_buffer, fr, to); + cnvs->SetInsertionPoint(fr); + Redraw(); + } + } + break; + + case MEN_SILENCE_INS: + { + int fr, to; + if (HaveSelection(fr, to, SelWarn)) + { + spl.InsertSilence(fr, to - fr); + Redraw(); + } + } + break; + + case MEN_SILENCE_APP: + { + int fr, to; + if (HaveSelection(fr, to, SelWarn)) + { + spl.InsertSilence(to, to - fr); + Redraw(); + } + } + break; + + case MEN_SILENCE_OVR: + { + int fr, to; + if (HaveSelection(fr, to, SelWarn)) + { + spl.ReplaceSilence(fr, to - fr); + Redraw(); + } + } + break; + + case ID_PAINTER_PITCH: + delete on_accept; + SetViewPos(0, spl.GetLength()); + on_accept = new JZCommandPainter(*this, pitch_command); + break; + + case ID_FILE_REVERT_TO_SAVED: + cnvs->ClearSelection(); + if (spl.Load(true)) + LoadError(spl); + Redraw(); + break; + + case wxID_CLOSE: +// DELETE_THIS(); + Destroy(); + break; + + case ID_PLAY: + cnvs->Play(); + break; + + case wxID_OPEN: + { + wxString FileName = file_selector( + spl.GetFileName(), + "Load Sample", + false, + false, + "*.wav"); + if (!FileName.empty()) + { + wxBeginBusyCursor(); + cnvs->ClearSelection(); + spl.SetFileName(FileName); + if (spl.Load(true)) + { + LoadError(spl); + } + spl->RefreshDialogs(); + SetTitle(FileName); + Redraw(); + wxEndBusyCursor(); + } + } + break; + + case wxID_SAVEAS: + { + wxString FileName = file_selector( + spl.GetFileName(), + "Save Sample", + true, + false, + "*.wav"); + if (!FileName.empty()) + { + spl.SetFileName(FileName); + OnMenuCommand(wxID_SAVE); + spl->RefreshDialogs(); + SetTitle(FileName); + } + } + break; + + case wxID_SAVE: + { + if (spl.GetFileName().empty()) + { + OnMenuCommand(wxID_SAVEAS); + } + else + { + wxBeginBusyCursor(); + cnvs->ClearSelection(); + int err = spl.Save(); + Redraw(); + wxEndBusyCursor(); + if (err) + { + ::wxMessageBox("Writing failed!!", "Error", wxOK); + } + } + } + break; + + case MEN_HELP: + gpHelpInstance->ShowTopic("Sample Editor"); + break; + + default: + break; + } +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZSampleFrame::PlaySample() +{ + cnvs->Play(); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +int JZSampleFrame::GetPaintLength() +{ + // return the visible amount of sample data + double sb = zoom_scrol->GetThumbPosition(); + JZMapper Map(0, 1000, spl.GetLength(), 0); + int len = static_cast<int>(Map.XToY(sb)); + return spl.Align(len); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +int JZSampleFrame::GetPaintOffset() +{ + // return the visible Offset in sample data + double sb = pos_scrol->GetThumbPosition(); + JZMapper Map(0, 1000, 0, spl.GetLength()); + int ofs = static_cast<int>(Map.XToY(sb)); + return spl.Align(ofs); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZSampleFrame::SetViewPos(int fr, int to) +{ + JZMapper Map(0, spl.GetLength(), 0, 1000); + int zval = 1000 - (int)Map.XToY(to - fr); + zoom_scrol->SetThumbPosition(zval); + + int pval = (int)Map.XToY(fr); + if (pval > zval) + pval = zval; + + // avoid motif warnings: by setting a very small length, + // every position is valid. +// pos_scrol->SetViewLength(1); +// pos_scrol->SetValue(pval); +// pos_scrol->SetViewLength(1000 - zval); +// pos_scrol->SetPageLength((1000 - zval) * 2 / 3); + pos_scrol->SetScrollbar(pval, 1, 1000 - zval, (1000 - zval) * 2 / 3); + + Redraw(); +} + +#ifdef OBSOLETE +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZSampleFrame::OnScroll(wxItem &item) +{ + int zval = zoom_scrol->GetValue(); + int pval = pos_scrol->GetValue(); + + if (pval > zval) + pval = zval; + + pos_scrol->SetValue(pval); + pos_scrol->SetViewLength(1000 - zval); + pos_scrol->SetPageLength((1000 - zval) * 2 / 3); + + Redraw(); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZSampleFrame::ScrollCallback(wxItem &itm, wxCommandEvent& Event) +{ + ((JZSampleFrame *)(itm.GetParent()->GetParent()))->OnScroll(itm); +} +#endif Property changes on: trunk/jazz/src/SampleFrame.cpp ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/jazz/src/SampleFrame.h =================================================================== --- trunk/jazz/src/SampleFrame.h (rev 0) +++ trunk/jazz/src/SampleFrame.h 2010-07-17 21:20:08 UTC (rev 811) @@ -0,0 +1,106 @@ +#ifndef JZ_SAMPLEFRAME_H +#define JZ_SAMPLEFRAME_H + +#include "SampleCommand.h" + +#include <wx/frame.h> + +class JZRndArray; +class JZToolBar; +class JZArrayEdit; +class JZCommandPainter; +class JZDistortion; +class JZEqualizer; +class JZSample; +class JZSampleWindow; +class JZSynthDlg; +class wxDialog; +class wxScrollBar; + +//***************************************************************************** +//***************************************************************************** +class JZSampleFrame : public wxFrame +{ + friend class JZSampleWindow; + friend class JZCommandPainter; + friend class JZSmplWinSettingsForm; + + public: + + JZSampleFrame(wxWindow* pParent, JZSampleFrame** ref, JZSample& Sample); + ~JZSampleFrame(); + virtual void OnSize(int w, int h); + virtual bool OnClose(); + virtual void OnMenuCommand(int id); + void Redraw(); + bool HaveInsertionPoint(int &offs, bool warn = TRUE); + enum HaveSelectionMode + { + SelWarn, + SelNoWarn, + SelAll + }; + bool HaveSelection(int &fr_smpl, int &to_smpl, HaveSelectionMode = SelAll); + + void AddParam(JZRndArray *array, const char *label); + void ClrParam(); + void ClearSelection(); + JZSample &GetSample() + { + return spl; + } + void PlaySample(); + + private: + + int GetPaintLength(); + int GetPaintOffset(); +#ifdef OBSOLETE + static void ScrollCallback(wxItem &itm, wxCommandEvent& event); + void OnScroll(wxItem &item); +#endif + void SetViewPos(int fr, int to); + void LoadError(JZSample &spl); + + private: + + JZSample& spl; + JZSampleWindow* cnvs; + wxPanel* scrol_panel; + wxScrollBar* pos_scrol; + wxScrollBar* zoom_scrol; + JZToolBar* mpToolBar; + int in_constructor; + JZSampleFrame** ref; + static int geo[4]; + + static JZSample* copy_buffer; + + enum + { + MAXPARAM = 4 + }; + JZArrayEdit* params[MAXPARAM]; + int num_params; + + JZCommandPainter* on_accept; + JZSplVolume vol_command; + JZSplPan pan_command; + JZSplPitch pitch_command; + JZWahWah wah_command; + + JZEqualizer* equalizer; + JZDistortion* distortion; + JZSynthDlg* synth; + wxDialog* reverb; + wxDialog* echo; + wxDialog* chorus; + wxDialog* shifter; + wxDialog* stretcher; + wxDialog* filter; + wxDialog* settings; + wxDialog* wah_settings; + wxDialog* pitch_settings; +}; + +#endif // !defined(JZ_SAMPLEFRAME_H) Property changes on: trunk/jazz/src/SampleFrame.h ___________________________________________________________________ Added: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2010-07-17 21:15:06
|
Revision: 810 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=810&view=rev Author: pstieber Date: 2010-07-17 21:15:00 +0000 (Sat, 17 Jul 2010) Log Message: ----------- Separated the sample frame class into its own source and header files. Modified Paths: -------------- trunk/jazz/src/Audio.cpp trunk/jazz/src/Makefile.am trunk/jazz/src/SampleDialog.cpp trunk/jazz/src/SampleWindow.cpp trunk/jazz/src/SampleWindow.h trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj Modified: trunk/jazz/src/Audio.cpp =================================================================== --- trunk/jazz/src/Audio.cpp 2010-07-17 20:17:47 UTC (rev 809) +++ trunk/jazz/src/Audio.cpp 2010-07-17 21:15:00 UTC (rev 810) @@ -34,7 +34,7 @@ #include "RecordingInfo.h" #include "Resources.h" #include "Sample.h" -#include "SampleWindow.h" +#include "SampleFrame.h" #include "StringReadWrite.h" #include "Track.h" #include "TrackFrame.h" Modified: trunk/jazz/src/Makefile.am =================================================================== --- trunk/jazz/src/Makefile.am 2010-07-17 20:17:47 UTC (rev 809) +++ trunk/jazz/src/Makefile.am 2010-07-17 21:15:00 UTC (rev 810) @@ -89,9 +89,10 @@ RecordingInfo.cpp \ Rectangle.cpp \ Rhythm.cpp \ +Sample.cpp \ SampleCommand.cpp \ -Sample.cpp \ SampleDialog.cpp \ +SampleFrame.cpp \ SampleWindow.cpp \ SelectControllerDialog.cpp \ Signal2.cpp \ @@ -188,9 +189,10 @@ RecordingInfo.cpp \ Rectangle.cpp \ Rhythm.cpp \ +Sample.cpp \ SampleCommand.cpp \ -Sample.cpp \ SampleDialog.cpp \ +SampleFrame.cpp \ SampleWindow.cpp \ SelectControllerDialog.cpp \ Signal2.cpp \ @@ -292,9 +294,10 @@ Rectangle.h \ Resources.h \ Rhythm.h \ +Sample.h \ SampleCommand.h \ SampleDialog.h \ -Sample.h \ +SampleFrame.h \ SampleWindow.h \ SelectControllerDialog.h \ Signal2.h \ Modified: trunk/jazz/src/SampleDialog.cpp =================================================================== --- trunk/jazz/src/SampleDialog.cpp 2010-07-17 20:17:47 UTC (rev 809) +++ trunk/jazz/src/SampleDialog.cpp 2010-07-17 21:15:00 UTC (rev 810) @@ -23,7 +23,7 @@ #include "SampleDialog.h" #include "Sample.h" -#include "SampleWindow.h" +#include "SampleFrame.h" #include "Mapper.h" #include "Audio.h" #include "SignalInterface.h" @@ -44,8 +44,10 @@ using namespace std; -JZCommandPainter::JZCommandPainter(JZSampleFrame &w, JZPaintableCommand &c) - : win(w), +JZCommandPainter::JZCommandPainter( + JZSampleFrame& SampleFrame, + JZPaintableCommand &c) + : win(SampleFrame), cmd(c) { c.Initialize(); @@ -104,11 +106,11 @@ int JZEqualizer::geo[4] = { 50, 80, 350, 200 }; -JZEqualizer::JZEqualizer(JZSampleFrame &w) - : JZSliderWindow(&w, "Equalizer", geo), +JZEqualizer::JZEqualizer(JZSampleFrame& SampleFrame) + : JZSliderWindow(&SampleFrame, "Equalizer", geo), array(12, -100, 100), - win(w), - spl(w.GetSample()) + win(SampleFrame), + spl(SampleFrame.GetSample()) { int i; channels = spl.GetChannelCount(); @@ -215,10 +217,10 @@ int JZDistortion::geo[4] = { 50, 80, 300, 320 }; -JZDistortion::JZDistortion(JZSampleFrame &w) -: JZSliderWindow(&w, "Distortion", geo), - arr(200, 0, 100), - win(w) +JZDistortion::JZDistortion(JZSampleFrame& SampleFrame) + : JZSliderWindow(&SampleFrame, "Distortion", geo), + arr(200, 0, 100), + win(SampleFrame) { N = 200; ymin = 0; @@ -320,7 +322,9 @@ { int fr, to; if (!win.HaveSelection(fr, to)) + { return; + } wxBeginBusyCursor(); JZSample &spl = win.GetSample(); @@ -491,9 +495,9 @@ }; -JZSynthDlg::JZSynthDlg(JZSampleFrame &w) -: JZSliderWindow(&w, "Additive Synthesis", geo, syn_tdefs), - win(w) +JZSynthDlg::JZSynthDlg(JZSampleFrame& SampleFrame) +: JZSliderWindow(&SampleFrame, "Additive Synthesis", geo, syn_tdefs), + win(SampleFrame) { Initialize(); default_filename = copystring("noname.syn"); @@ -902,9 +906,9 @@ int JZReverbForm::volume = 20; // effect volume int JZReverbForm::rvbtime = 30; // echo absorbtion -JZReverbForm::JZReverbForm(JZSampleFrame &w) +JZReverbForm::JZReverbForm(JZSampleFrame& SampleFrame) : wxForm( USED_WXFORM_BUTTONS ), - win(w) + win(SampleFrame) { } @@ -974,9 +978,9 @@ bool JZEchoForm::rand = false; -JZEchoForm::JZEchoForm(JZSampleFrame &w) -: wxForm( USED_WXFORM_BUTTONS ), - win(w) +JZEchoForm::JZEchoForm(JZSampleFrame& SampleFrame) + : wxForm(USED_WXFORM_BUTTONS), + win(SampleFrame) { wxForm::OnCancel(); } @@ -1019,9 +1023,9 @@ bool JZShifterForm::keep_length = 1; -JZShifterForm::JZShifterForm(JZSampleFrame &w) -: wxForm( USED_WXFORM_BUTTONS ), - win(w) +JZShifterForm::JZShifterForm(JZSampleFrame& SampleFrame) + : wxForm( USED_WXFORM_BUTTONS ), + win(SampleFrame) { } @@ -1119,12 +1123,19 @@ int JZSplFilterForm::lo_freq = 400; int JZSplFilterForm::hi_freq = 2000; int JZSplFilterForm::band_width = 20; // in % of corner freq -static const char *filter_types[] = { "Low Pass", "High Pass", "Band Pass", "Band Stop", 0 }; +static const char *filter_types[] = +{ + "Low Pass", + "High Pass", + "Band Pass", + "Band Stop", + 0 +}; -JZSplFilterForm::JZSplFilterForm(JZSampleFrame &w, bool p) -: wxForm( USED_WXFORM_BUTTONS ), - win(w) +JZSplFilterForm::JZSplFilterForm(JZSampleFrame& SampleFrame, bool p) + : wxForm( USED_WXFORM_BUTTONS ), + win(SampleFrame) { painter = p; } @@ -1231,9 +1242,11 @@ // filter painter settings // ------------------------------------------------------------------------- -JZWahSettingsForm::JZWahSettingsForm(JZSampleFrame &win, JZWahWah &w) - : JZSplFilterForm(win, true), - wah(w) +JZWahSettingsForm::JZWahSettingsForm( + JZSampleFrame& SampleFrame, + JZWahWah& WahWah) + : JZSplFilterForm(SampleFrame, true), + wah(WahWah) { type = (int)wah.filter_type; } @@ -1260,10 +1273,10 @@ int JZSplPitchForm::range = 1; -JZSplPitchForm::JZSplPitchForm(JZSampleFrame &w, JZSplPitch &p) -: wxForm( USED_WXFORM_BUTTONS ), - win(w), - pitch(p) +JZSplPitchForm::JZSplPitchForm(JZSampleFrame& SampleFrame, JZSplPitch& p) + : wxForm(USED_WXFORM_BUTTONS), + win(SampleFrame), + pitch(p) { } @@ -1302,9 +1315,9 @@ int JZChorusForm::pan_spread = 50; int JZChorusForm::volume = 50; -JZChorusForm::JZChorusForm(JZSampleFrame &w) -: wxForm( USED_WXFORM_BUTTONS ), - win(w) +JZChorusForm::JZChorusForm(JZSampleFrame& SampleFrame) + : wxForm( USED_WXFORM_BUTTONS ), + win(SampleFrame) { } @@ -1383,9 +1396,9 @@ int JZStereoForm::delay = 10; // millisec int JZStereoForm::stereo_spread = 50; -JZStereoForm::JZStereoForm(JZSampleFrame &w) -: wxForm( USED_WXFORM_BUTTONS ), - win(w) +JZStereoForm::JZStereoForm(JZSampleFrame& SampleFrame) + : wxForm(USED_WXFORM_BUTTONS), + win(SampleFrame) { } @@ -1444,10 +1457,10 @@ bool JZStretcherForm::keep_pitch = 1; -JZStretcherForm::JZStretcherForm(JZSampleFrame &w) -: wxForm( USED_WXFORM_BUTTONS ), - win(w), - spl(w.GetSample()) +JZStretcherForm::JZStretcherForm(JZSampleFrame& SampleFrame) + : wxForm( USED_WXFORM_BUTTONS ), + win(SampleFrame), + spl(SampleFrame.GetSample()) { } Modified: trunk/jazz/src/SampleWindow.cpp =================================================================== --- trunk/jazz/src/SampleWindow.cpp 2010-07-17 20:17:47 UTC (rev 809) +++ trunk/jazz/src/SampleWindow.cpp 2010-07-17 21:15:00 UTC (rev 810) @@ -22,161 +22,91 @@ #include "SampleWindow.h" -#include "Audio.h" -#include "FileSelector.h" -#include "Globals.h" -#include "Help.h" #include "Mapper.h" -#include "MouseAction.h" #include "Player.h" -#include "Resources.h" -#include "Rhythm.h" -#include "Sample.h" -#include "SampleCommand.h" -#include "SampleDialog.h" -#include "Song.h" -#include "SliderWindow.h" -#include "ToolBar.h" +#include "SampleFrame.h" #include <wx/dcclient.h> -#include <wx/menu.h> -#include <wx/msgdlg.h> -#include <wx/scrolbar.h> -//DEBUG#include <iostream> - -#define MEN_HELP 5 - -#define MEN_SILENCE 21 -#define MEN_SILENCE_INS 22 -#define MEN_SILENCE_APP 23 -#define MEN_SILENCE_OVR 24 - -#define MEN_ACCEPT 42 - -#define MEN_FLIP 56 -#define MEN_FLIP_LEFT 57 -#define MEN_FLIP_RIGHT 58 - -class JZSamplePlayPosition; - //***************************************************************************** //***************************************************************************** -class JZInsertionPoint +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZInsertionPoint::Draw(int x) { - public: + last_x = x; + visible ^= 1; + wxDC *dc = new wxClientDC(mpScrolledWindow); + int cw, ch; + mpScrolledWindow->GetClientSize(&cw, &ch); + dc->SetPen(*wxRED_PEN); + dc->SetLogicalFunction(wxXOR); + dc->DrawLine(x, 0, x, ch); + dc->SetPen(*wxBLACK_PEN); + dc->SetLogicalFunction(wxCOPY); +} - JZInsertionPoint(wxScrolledWindow* pScrolledWindow) - : mpScrolledWindow(pScrolledWindow) - { - last_x = 0; - visible = 0; - } - - void Draw(int x) - { - last_x = x; - visible ^= 1; - wxDC *dc = new wxClientDC(mpScrolledWindow); - int cw, ch; - mpScrolledWindow->GetClientSize(&cw, &ch); - dc->SetPen(*wxRED_PEN); - dc->SetLogicalFunction(wxXOR); - dc->DrawLine(x, 0, x, ch); - dc->SetPen(*wxBLACK_PEN); - dc->SetLogicalFunction(wxCOPY); - } - - void Draw() - { - Draw(last_x); - } - - int IsVisible() const - { - return visible; - } - - float GetX() const - { - return last_x; - } - - private: - - int last_x; - int visible; - wxScrolledWindow* mpScrolledWindow; -}; - //***************************************************************************** //***************************************************************************** -class JZSampleWindow : public wxScrolledWindow +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZSamplePlayPosition::StopListen() { - friend class JZSampleFrame; - friend class JZSmplWinSettingsForm; + Stop(); + if (gpMidiPlayer->IsListening()) + gpMidiPlayer->ListenAudio(-1); + if (visible) + Draw(); +} - public: +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZSamplePlayPosition::StartListen(int fr, int to) +{ + fr_smpl = fr; + to_smpl = to; + gpMidiPlayer->ListenAudio(spl, fr_smpl, to_smpl); + Start(100); +} - JZSampleWindow(JZSampleFrame* pSampleFrame, JZSample& Sample); +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +bool JZSamplePlayPosition::IsListening() const +{ + return gpMidiPlayer->IsListening(); +} - virtual ~JZSampleWindow(); +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZSamplePlayPosition::Draw() +{ + visible ^= 1; + wxDC *dc = new wxClientDC(&cnvs); + int cw, ch; + cnvs.GetClientSize(&cw, &ch); + dc->SetPen(*wxGREEN_PEN); + dc->SetLogicalFunction(wxXOR); + dc->DrawLine(x, 0, x, ch); + dc->SetPen(*wxBLACK_PEN); + dc->SetLogicalFunction(wxCOPY); +} - void Redraw() - { - OnPaint(); - } +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZSamplePlayPosition::Notify() +{ + int pos = mpPlayer->GetListenerPlayPosition(); + if (pos < 0) + { + StopListen(); + return; + } + if (visible) + Draw(); + x = cnvs.Sample2Pixel(fr_smpl + pos); + Draw(); +} - virtual void OnPaint(); - - virtual void OnSize(int w, int h); - - virtual void OnEvent(wxMouseEvent& MouseEvent); - - void ClearSelection(); - - void SetInsertionPoint(int offs); - - void SetSelection(int fr, int to); - - int Sample2Pixel(int sample); - - int Pixel2Sample(float pixel); - - void Play(); - - private: - - void DrawSample(int channel, int x, int y, int w, int h); - - void DrawTicks(int x, int y, int w); - - private: - - JZSampleFrame* mpSampleFrame; - - JZSample& spl; - - int paint_offset; - int paint_length; - - JZSnapSelection snapsel; - - // sel_fr == 0: no selection and no insertion point - // sel_fr > 0 && sel_fr == sel_to: insertion point - // sel_fr > 0 && sel_fr < sel_to: selected range - int sel_fr, sel_to; - JZInsertionPoint inspt; - int mouse_up_sets_insertion_point; - JZSamplePlayPosition *playpos; - - // for tickmark display - bool midi_time; - int midi_offs; - - bool mouse_down; -}; - #ifdef OBSOLETE //***************************************************************************** //***************************************************************************** @@ -215,90 +145,6 @@ //***************************************************************************** //***************************************************************************** -class JZSamplePlayPosition : public wxTimer -{ - public: - - JZSamplePlayPosition( - JZSampleWindow& SampleWindow, - JZPlayer* pPlayer, - JZSample& Sample) - : cnvs(SampleWindow), - mpPlayer(pPlayer), - spl(Sample) - { - visible = false; - x = 0; - } - - ~JZSamplePlayPosition() - { - Stop(); - if (visible) - Draw(); - } - - void StopListen() - { - Stop(); - if (gpMidiPlayer->IsListening()) - gpMidiPlayer->ListenAudio(-1); - if (visible) - Draw(); - } - - void StartListen(int fr, int to) - { - fr_smpl = fr; - to_smpl = to; - gpMidiPlayer->ListenAudio(spl, fr_smpl, to_smpl); - Start(100); - } - - bool IsListening() const - { - return gpMidiPlayer->IsListening(); - } - - void Draw() - { - visible ^= 1; - wxDC *dc = new wxClientDC(&cnvs); - int cw, ch; - cnvs.GetClientSize(&cw, &ch); - dc->SetPen(*wxGREEN_PEN); - dc->SetLogicalFunction(wxXOR); - dc->DrawLine(x, 0, x, ch); - dc->SetPen(*wxBLACK_PEN); - dc->SetLogicalFunction(wxCOPY); - } - - virtual void Notify() - { - int pos = mpPlayer->GetListenerPlayPosition(); - if (pos < 0) - { - StopListen(); - return; - } - if (visible) - Draw(); - x = cnvs.Sample2Pixel(fr_smpl + pos); - Draw(); - } - - private: - JZSampleWindow& cnvs; - JZPlayer* mpPlayer; - JZSample& spl; - bool visible; - int x; - int fr_smpl; - int to_smpl; -}; - -//***************************************************************************** -//***************************************************************************** //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- JZSampleWindow::JZSampleWindow(JZSampleFrame* pSampleFrame, JZSample& Sample) @@ -565,13 +411,15 @@ BarInfo.SetBar(BarInfo.GetBarIndex()); while (BarInfo.GetClock() < cto) { - int ticks_per_count = BarInfo.GetTicksPerBar() / BarInfo.GetCountsPerBar(); + int ticks_per_count = + BarInfo.GetTicksPerBar() / BarInfo.GetCountsPerBar(); int ticks_per_step = ticks_per_count / 4; for (int i = 0; i < BarInfo.GetCountsPerBar(); ++i) { for (int j = 0; j < 4; j++) { - int clock = BarInfo.GetClock() + i * ticks_per_count + j * ticks_per_step; + int clock = + BarInfo.GetClock() + i * ticks_per_count + j * ticks_per_step; int xx = static_cast<int>(Map.XToY(clock)); // draw a tickmark line dc->DrawLine(xx, y - 5, xx, y); @@ -675,847 +523,3 @@ } -// ---------------------------------------------------------------- -// -------------------------- JZSampleFrame -------------------------- -// ---------------------------------------------------------------- - - -#include "Bitmaps/open.xpm" -#include "Bitmaps/save.xpm" -#include "Bitmaps/play.xpm" -#include "Bitmaps/help.xpm" -#include "Bitmaps/accept.xpm" -#include "Bitmaps/cancel.xpm" -#include "Bitmaps/zoomin.xpm" -#include "Bitmaps/zoomout.xpm" - -static JZToolDef tdefs[] = -{ - { wxID_OPEN, false, open_xpm, "open wave file" }, - { wxID_SAVE, false, save_xpm, "save wave file" }, - { JZToolBar::eToolBarSeparator }, - { wxID_ZOOM_IN, false, zoomin_xpm, "zoom to selection" }, - { wxID_ZOOM_OUT, false, zoomout_xpm, "zoom out" }, - { MEN_ACCEPT, false, accept_xpm, "accept painting" }, - { ID_PAINTER_NONE, false, cancel_xpm, "cancel painting" }, - { JZToolBar::eToolBarSeparator }, - { ID_PLAY, false, play_xpm, "play sample" }, - { MEN_HELP, false, help_xpm, "help" }, - { JZToolBar::eToolBarEnd } -}; - -int JZSampleFrame::geo[4] = -{ - 30, - 30, - 600, - 300 -}; - -JZSample *JZSampleFrame::copy_buffer; - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -JZSampleFrame::JZSampleFrame( - wxWindow* pParent, - JZSampleFrame **ref, - JZSample& Sample) - : wxFrame( - pParent, - wxID_ANY, - Sample.GetFileName(), - wxPoint(geo[0], geo[1]), - wxSize(geo[2], geo[3])), - spl(Sample), - vol_command(Sample), - pan_command(Sample), - pitch_command(Sample), - wah_command(Sample) -{ - this->ref = ref; - - in_constructor = true; - - cnvs = 0; - mpToolBar = 0; - scrol_panel = 0; - pos_scrol = 0; - zoom_scrol = 0; - num_params = 0; - on_accept = 0; - equalizer = 0; - distortion = 0; - reverb = 0; - echo = 0; - shifter = 0; - stretcher = 0; - filter = 0; - settings = 0; - wah_settings = 0; - pitch_settings = 0; - chorus = 0; - synth = 0; - - if (copy_buffer == 0) - copy_buffer = new JZSample(spl.SampleSet()); - - mpToolBar = new JZToolBar(this, tdefs); - - // Create a menu bar, the various menus with entries, and attach them to the - // menu bar. - - wxMenu* pMenu = 0; - wxMenu* pSubMenu = 0; - wxMenuBar* pMenuBar = new wxMenuBar; - - // Create and populate the File menu. - pMenu = new wxMenu; - - pMenu->Append(ID_FILE_REVERT_TO_SAVED, "&Revert to Saved"); - pMenu->Append(wxID_OPEN, "&Load..."); - pMenu->Append(wxID_SAVE, "&Save"); - pMenu->Append(wxID_SAVEAS, "&Save As..."); - pMenu->Append(wxID_CLOSE, "&Close"); - - pMenuBar->Append(pMenu, "&File"); - - // Create and populate the Edit menu. - pMenu = new wxMenu; - pMenu->Append(wxID_CUT, "&Cut"); - pMenu->Append(wxID_COPY, "Co&py"); - pMenu->Append(wxID_PASTE, "&Paste"); - pMenu->Append(ID_EDIT_PASTE_MERGE, "Paste &Merge"); - pSubMenu = new wxMenu; - pSubMenu->Append(MEN_SILENCE_OVR, "&Replace"); - pSubMenu->Append(MEN_SILENCE_INS, "&Insert"); - pSubMenu->Append(MEN_SILENCE_APP, "&Append"); - pMenu->Append(MEN_SILENCE, "&Silence", pSubMenu); - pSubMenu = new wxMenu; - pSubMenu->Append(MEN_FLIP_LEFT, "Left"); - pSubMenu->Append(MEN_FLIP_RIGHT, "Right"); - pMenu->Append(MEN_FLIP, "In&vert Phase", pSubMenu); - pMenu->Append(ID_EDIT_MAXIMIZE_VOLUME, "&Maximize Volume"); - pMenuBar->Append(pMenu, "&Edit"); - - pMenu = new wxMenu; - pMenu->Append(ID_PAINTERS_VOLUME, "&Volume..."); - pMenu->Append(ID_PAINTER_PAN, "&Panpot..."); - pMenu->Append(ID_PAINTER_PITCH, "&Pitch..."); - pMenu->Append(ID_PAINTER_WAHWAH, "&Filter..."); - pMenu->Append(ID_PAINTER_NONE, "&None..."); - pMenuBar->Append(pMenu, "&Painters"); - - pMenu = new wxMenu; - pMenu->Append(ID_EFFECTS_EQUALIZER, "&Equalizer..."); - pMenu->Append(ID_EFFECTS_FILTER, "&Filter..."); - pMenu->Append(ID_EFFECTS_DISTORTION, "&Distortion..."); - pMenu->Append(ID_EFFECTS_REVERB, "&Reverb..."); - pMenu->Append(ID_EFFECTS_ECHO, "&Echo..."); - pMenu->Append(ID_EFFECTS_CHORUS, "&Chorus..."); - pMenu->Append(ID_EFFECTS_PITCH_SHIFTER, "&Pitch shifter..."); - pMenu->Append(ID_EFFECTS_STRETCHER, "&Time stretcher..."); - pMenu->Append(ID_EFFECTS_REVERSE, "Re&verse"); - pMenu->Append(ID_EFFECTS_SYNTH, "&Synth..."); - pMenuBar->Append(pMenu, "&Effects"); - - pMenu = new wxMenu; - pMenu->Append(ID_SETTINGS_PITCH_PAINTER, "&Pitch Painter..."); - pMenu->Append(ID_SETTINGS_WAHWAH, "&Filter Painter..."); -// pMenu->Append(wxID_ZOOM_IN, "Zoom &In"); -// pMenu->Append(wxID_ZOOM_OUT, "Zoom &Out"); - pMenu->Append(ID_VIEW_SETTINGS, "&View Settings..."); - pMenuBar->Append(pMenu, "&Settings"); - - SetMenuBar(pMenuBar); - - // construct a panel containing the scrollbars - cnvs = new JZSampleWindow(this, spl); - scrol_panel = new wxPanel(this); - -//OBSOLETE pos_scrol = new wxScrollBar(scrol_panel, (wxFunction)ScrollCallback); - pos_scrol = new wxScrollBar(scrol_panel, wxID_ANY); -// pos_scrol->SetObjectLength(1000); -// pos_scrol->SetViewLength(1000); -// pos_scrol->SetValue(0); - pos_scrol->SetScrollbar(0, 1000, 1000, 1000); - -//OBSOLETE zoom_scrol = new wxScrollBar(scrol_panel, (wxFunction)ScrollCallback); - zoom_scrol = new wxScrollBar(scrol_panel, wxID_ANY); -// zoom_scrol->SetObjectLength(1000); -// zoom_scrol->SetViewLength(10); -// zoom_scrol->SetPageLength(100); -// zoom_scrol->SetValue(0); - zoom_scrol->SetScrollbar(0, 10, 1000, 100); - - in_constructor = false; - - // now force a resize for motif - int cw, ch; - GetClientSize(&cw, &ch); - OnSize(cw, ch); -} - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -JZSampleFrame::~JZSampleFrame() -{ - *ref = 0; - GetPosition(&geo[0], &geo[1]); - GetSize(&geo[2], &geo[3]); - delete mpToolBar; - delete cnvs; - delete zoom_scrol; - delete pos_scrol; - delete scrol_panel; - for (int i = 0; i < num_params; i++) - delete params[i]; - delete equalizer; - delete distortion; - delete reverb; - delete echo; - delete chorus; - delete synth; - delete shifter; - delete stretcher; - delete filter; - delete settings; - delete wah_settings; - delete pitch_settings; -} - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -bool JZSampleFrame::OnClose() -{ - return true; -} - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -void JZSampleFrame::OnSize(int w, int h) -{ - // constructor finished? - if (in_constructor) - return; - - int cw, ch; - GetClientSize(&cw, &ch); - - wxSize ToolBarSize = mpToolBar->GetSize(); - int pw, ph; - pos_scrol->GetSize(&pw, &ph); - int zw, zh; - zoom_scrol->GetSize(&zw, &zh); - -//OBSOLETE mpToolBar->SetSize(0, 0, (int)cw, ToolBarSize.GetHeight()); - scrol_panel->SetSize(0, ch-zh-ph, cw, zh+ph); - zoom_scrol->SetSize(0, 0, cw, zh); - pos_scrol->SetSize(0, zh, cw, ph); - - // divide the remaining space on cnvs and params - int xx = 0; - int yy = ToolBarSize.GetHeight(); - int ww = cw; - int hh = ch - ToolBarSize.GetHeight() - zh - ph; - int nn = spl.GetChannelCount() + num_params; - - int hi = hh * spl.GetChannelCount() / nn; - cnvs->SetSize(xx, yy, ww, hi); - - hi = hh / nn; - for (int i = 0; i < num_params; i++) - { - int yi = yy + (i + spl.GetChannelCount()) * hh / nn; - params[i]->SetSize(xx, yi, ww, hi); - } -} - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -void JZSampleFrame::Redraw() -{ - cnvs->Redraw(); -} - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -bool JZSampleFrame::HaveInsertionPoint(int &offs, bool warn) -{ - if (cnvs->sel_fr == cnvs->sel_to && cnvs->sel_fr >= 0) - { - offs = cnvs->sel_fr; - return true; - } - else - { - offs = -1; - if (warn) - wxMessageBox("please set insertion point first", "Error", wxOK); - return false; - } -} - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -bool JZSampleFrame::HaveSelection( - int& fr_smpl, - int& to_smpl, - HaveSelectionMode mode) -{ - if (cnvs->sel_fr < cnvs->sel_to && cnvs->sel_fr >= 0) - { - fr_smpl = cnvs->sel_fr; - to_smpl = cnvs->sel_to; - return true; - } - else if (mode == SelAll) - { - fr_smpl = 0; - to_smpl = spl.GetLength(); - return true; - } - fr_smpl = to_smpl = -1; - if (mode == SelWarn) - wxMessageBox("please select samples first", "Error", wxOK); - return false; -} - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -void JZSampleFrame::AddParam(JZRndArray *array, const char *label) -{ - params[num_params] = new JZArrayEdit(this, *array, 0, 0, 10, 10, 0); - params[num_params]->SetLabel(label); - num_params++; - int cw, ch; - GetClientSize(&cw, &ch); - OnSize(cw, ch); -} - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -void JZSampleFrame::ClrParam() -{ - if (num_params > 0) - { - int n = num_params; - num_params = 0; - for (int i = 0; i < n; ++i) - { - delete params[i]; - } - int cw, ch; - GetClientSize(&cw, &ch); - OnSize(cw, ch); - } -} - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -void JZSampleFrame::ClearSelection() -{ - cnvs->ClearSelection(); -} - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -void JZSampleFrame::LoadError(JZSample& Sample) -{ - wxString Message; - Message << "Could not load " << Sample.GetFileName(); - ::wxMessageBox(Message, "Error", wxOK); -} - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -extern int effect(JZSample &spl); - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -void JZSampleFrame::OnMenuCommand(int id) -{ - if (gpMidiPlayer->IsPlaying()) - { - return; - } - - // Player crashes if data disappear. - if (id != ID_PLAY) - { - cnvs->playpos->StopListen(); - } - - switch (id) - { - case ID_EFFECTS_EQUALIZER: - if (equalizer == 0) - equalizer = new JZEqualizer(*this); - equalizer->Show(true); - break; - - case MEN_FLIP_LEFT: - spl.Flip(0); - break; - case MEN_FLIP_RIGHT: - spl.Flip(1); - break; - - case ID_EFFECTS_DISTORTION: - if (distortion == 0) - distortion = new JZDistortion(*this); - distortion->Show(true); - break; - - case ID_EFFECTS_REVERB: -#ifdef OBSOLETE - if (reverb == 0) - { - // Old version was not modal. - reverb = new wxDialog(this, wxID_ANY, "Reverb"); - tReverbForm *form = new tReverbForm(*this); - form->EditForm(reverb); - reverb->Fit(); - } - ClearSelection(); - SetViewPos(0, spl.GetLength()); - reverb->Show(true); -#endif - break; - - case ID_EFFECTS_REVERSE: - { - int fr, to; - if (HaveSelection(fr, to)) - { - spl.Reverse(fr, to); - Redraw(); - } - } - break; - - case ID_EFFECTS_PITCH_SHIFTER: -#ifdef OBSOLETE - if (shifter == 0) - { - shifter = new wxDialogBox(this, "Shifter", false ); - tShifterForm *form = new tShifterForm(*this); - form->EditForm(shifter); - shifter->Fit(); - } - ClearSelection(); - SetViewPos(0, spl.GetLength()); - shifter->Show(true); -#endif - break; - - case ID_EFFECTS_STRETCHER: -#ifdef OBSOLETE - if (stretcher == 0) - { - stretcher = new wxDialogBox(this, "Stretcher", false ); - tStretcherForm *form = new tStretcherForm(*this); - form->EditForm(stretcher); - stretcher->Fit(); - } - ClearSelection(); - SetViewPos(0, spl.GetLength()); - stretcher->Show(true); -#endif - break; - - case ID_EFFECTS_FILTER: -#ifdef OBSOLETE - if (filter == 0) - { - filter = new wxDialogBox(this, "Filter", false ); - tSplFilterForm *form = new tSplFilterForm(*this); - form->EditForm(filter); - filter->Fit(); - } - filter->Show(true); -#endif - break; - - case ID_VIEW_SETTINGS: -#ifdef OBSOLETE - if (settings == 0) - { - settings = new wxDialogBox(this, "Settings", false ); - JZSmplWinSettingsForm *form = new JZSmplWinSettingsForm(*this); - form->EditForm(settings); - settings->Fit(); - } - settings->Show(true); -#endif - break; - - case ID_EFFECTS_ECHO: -#ifdef OBSOLETE - if (echo == 0) - { - echo = new wxDialogBox(this, "Echo", false ); - tEchoForm *form = new tEchoForm(*this); - form->EditForm(echo); - echo->Fit(); - } - ClearSelection(); - SetViewPos(0, spl.GetLength()); - echo->Show(true); -#endif - break; - - case ID_EFFECTS_CHORUS: -#ifdef OBSOLETE - if (chorus == 0) - { - chorus = new wxDialogBox(this, "Chorus", false ); - tChorusForm *form = new tChorusForm(*this); - form->EditForm(chorus); - chorus->Fit(); - } - ClearSelection(); - SetViewPos(0, spl.GetLength()); - chorus->Show(true); -#endif - break; - - case ID_EFFECTS_SYNTH: - if (synth == 0) - synth = new JZSynthDlg(*this); - synth->Show(true); - break; - - case MEN_ACCEPT: - if (on_accept) - { - int fr = GetPaintOffset(); - int to = fr + GetPaintLength(); - on_accept->OnAccept(fr, to); - delete on_accept; - on_accept = 0; - } - break; - - case ID_PAINTER_NONE: - if (on_accept) - { - delete on_accept; - on_accept = 0; - } - break; - - case wxID_CUT: - { - int fr, to; - if (HaveSelection(fr, to, SelWarn)) - { - spl.Cut(*copy_buffer, fr, to); - cnvs->ClearSelection(); - cnvs->SetInsertionPoint(fr); - Redraw(); - } - } - break; - - case wxID_COPY: - { - int fr, to; - if (HaveSelection(fr, to, SelAll)) - spl.Copy(*copy_buffer, fr, to); - } - break; - - case wxID_ZOOM_IN: - { - int fr, to; - if (HaveSelection(fr, to, SelWarn)) - SetViewPos(fr, to); - } - break; - - case wxID_ZOOM_OUT: - SetViewPos(0, spl.GetLength()); - break; - - case ID_EDIT_MAXIMIZE_VOLUME: - spl.Rescale(); - Redraw(); - break; - - case ID_PAINTERS_VOLUME: - delete on_accept; - on_accept = new JZCommandPainter(*this, vol_command); - break; - - case ID_PAINTER_WAHWAH: - delete on_accept; - on_accept = new JZCommandPainter(*this, wah_command); - break; - - case ID_SETTINGS_WAHWAH: -#ifdef OBSOLETE - if (wah_settings == 0) - { - wah_settings = new wxDialogBox(this, "Filter Painter", false); - tWahSettingsForm *form = new tWahSettingsForm(*this); - form->EditForm(wah_settings); - wah_settings->Fit(); - } - wah_settings->Show(true); -#endif - break; - - case ID_SETTINGS_PITCH_PAINTER: -#ifdef OBSOLETE - if (pitch_settings == 0) - { - pitch_settings = new wxDialogBox(this, "Pitch Painter"); - tSplPitchForm *form = new tSplPitchForm(*this); - form->EditForm(pitch_settings); - pitch_settings->Fit(); - } - pitch_settings->Show(true); -#endif - break; - - - case ID_PAINTER_PAN: - delete on_accept; - on_accept = new JZCommandPainter(*this, pan_command); - break; - - case ID_EDIT_PASTE_MERGE: - { - int offs; - if (HaveInsertionPoint(offs)) - { - spl.PasteMix(*copy_buffer, offs); - cnvs->SetSelection(offs, offs + copy_buffer->GetLength()); - Redraw(); - } - } - break; - - case wxID_PASTE: - { - int offs, fr, to; - if (HaveInsertionPoint(offs, false)) - { - spl.PasteIns(*copy_buffer, offs); - cnvs->SetSelection(offs, offs + copy_buffer->GetLength()); - Redraw(); - } - else if (HaveSelection(fr, to, SelWarn)) - { - spl.PasteOvr(*copy_buffer, fr, to); - cnvs->SetInsertionPoint(fr); - Redraw(); - } - } - break; - - case MEN_SILENCE_INS: - { - int fr, to; - if (HaveSelection(fr, to, SelWarn)) - { - spl.InsertSilence(fr, to - fr); - Redraw(); - } - } - break; - - case MEN_SILENCE_APP: - { - int fr, to; - if (HaveSelection(fr, to, SelWarn)) - { - spl.InsertSilence(to, to - fr); - Redraw(); - } - } - break; - - case MEN_SILENCE_OVR: - { - int fr, to; - if (HaveSelection(fr, to, SelWarn)) - { - spl.ReplaceSilence(fr, to - fr); - Redraw(); - } - } - break; - - case ID_PAINTER_PITCH: - delete on_accept; - SetViewPos(0, spl.GetLength()); - on_accept = new JZCommandPainter(*this, pitch_command); - break; - - case ID_FILE_REVERT_TO_SAVED: - cnvs->ClearSelection(); - if (spl.Load(true)) - LoadError(spl); - Redraw(); - break; - - case wxID_CLOSE: -// DELETE_THIS(); - Destroy(); - break; - - case ID_PLAY: - cnvs->Play(); - break; - - case wxID_OPEN: - { - wxString FileName = file_selector( - spl.GetFileName(), - "Load Sample", - false, - false, - "*.wav"); - if (!FileName.empty()) - { - wxBeginBusyCursor(); - cnvs->ClearSelection(); - spl.SetFileName(FileName); - if (spl.Load(true)) - { - LoadError(spl); - } - spl->RefreshDialogs(); - SetTitle(FileName); - Redraw(); - wxEndBusyCursor(); - } - } - break; - - case wxID_SAVEAS: - { - wxString FileName = file_selector( - spl.GetFileName(), - "Save Sample", - true, - false, - "*.wav"); - if (!FileName.empty()) - { - spl.SetFileName(FileName); - OnMenuCommand(wxID_SAVE); - spl->RefreshDialogs(); - SetTitle(FileName); - } - } - break; - - case wxID_SAVE: - { - if (spl.GetFileName().empty()) - { - OnMenuCommand(wxID_SAVEAS); - } - else - { - wxBeginBusyCursor(); - cnvs->ClearSelection(); - int err = spl.Save(); - Redraw(); - wxEndBusyCursor(); - if (err) - { - wxMessageBox("writing failed!!", "Error", wxOK); - } - } - } - break; - - case MEN_HELP: - gpHelpInstance->ShowTopic("Sample Editor"); - break; - - default: - break; - } -} - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -void JZSampleFrame::PlaySample() -{ - cnvs->Play(); -} - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -int JZSampleFrame::GetPaintLength() -{ - // return the visible amount of sample data - double sb = zoom_scrol->GetThumbPosition(); - JZMapper Map(0, 1000, spl.GetLength(), 0); - int len = static_cast<int>(Map.XToY(sb)); - return spl.Align(len); -} - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -int JZSampleFrame::GetPaintOffset() -{ - // return the visible Offset in sample data - double sb = pos_scrol->GetThumbPosition(); - JZMapper Map(0, 1000, 0, spl.GetLength()); - int ofs = static_cast<int>(Map.XToY(sb)); - return spl.Align(ofs); -} - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -void JZSampleFrame::SetViewPos(int fr, int to) -{ - JZMapper Map(0, spl.GetLength(), 0, 1000); - int zval = 1000 - (int)Map.XToY(to - fr); - zoom_scrol->SetThumbPosition(zval); - - int pval = (int)Map.XToY(fr); - if (pval > zval) - pval = zval; - - // avoid motif warnings: by setting a very small length, - // every position is valid. -// pos_scrol->SetViewLength(1); -// pos_scrol->SetValue(pval); -// pos_scrol->SetViewLength(1000 - zval); -// pos_scrol->SetPageLength((1000 - zval) * 2 / 3); - pos_scrol->SetScrollbar(pval, 1, 1000 - zval, (1000 - zval) * 2 / 3); - - Redraw(); -} - -#ifdef OBSOLETE -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -void JZSampleFrame::OnScroll(wxItem &item) -{ - int zval = zoom_scrol->GetValue(); - int pval = pos_scrol->GetValue(); - - if (pval > zval) - pval = zval; - - pos_scrol->SetValue(pval); - pos_scrol->SetViewLength(1000 - zval); - pos_scrol->SetPageLength((1000 - zval) * 2 / 3); - - Redraw(); -} - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -void JZSampleFrame::ScrollCallback(wxItem &itm, wxCommandEvent& Event) -{ - ((JZSampleFrame *)(itm.GetParent()->GetParent()))->OnScroll(itm); -} -#endif Modified: trunk/jazz/src/SampleWindow.h =================================================================== --- trunk/jazz/src/SampleWindow.h 2010-07-17 20:17:47 UTC (rev 809) +++ trunk/jazz/src/SampleWindow.h 2010-07-17 21:15:00 UTC (rev 810) @@ -23,106 +23,163 @@ #ifndef JZ_SAMPLEWINDOW_H #define JZ_SAMPLEWINDOW_H -#include "SampleCommand.h" +#include "MouseAction.h" -#include <wx/frame.h> +#include <wx/scrolwin.h> -class JZRndArray; -class JZToolBar; -class JZArrayEdit; -class JZCommandPainter; -class JZDistortion; -class JZEqualizer; +class JZPlayer; class JZSample; +class JZSampleFrame; class JZSampleWindow; -class JZSynthDlg; -class wxDialog; -class wxScrollBar; //***************************************************************************** //***************************************************************************** -class JZSampleFrame : public wxFrame +class JZInsertionPoint { - friend class JZSampleWindow; - friend class JZCommandPainter; - friend class JZSmplWinSettingsForm; + public: + JZInsertionPoint(wxScrolledWindow* pScrolledWindow) + : mpScrolledWindow(pScrolledWindow) + { + last_x = 0; + visible = 0; + } + + void Draw(int x); + + void Draw() + { + Draw(last_x); + } + + int IsVisible() const + { + return visible; + } + + float GetX() const + { + return last_x; + } + + private: + + int last_x; + int visible; + wxScrolledWindow* mpScrolledWindow; +}; + +//***************************************************************************** +//***************************************************************************** +class JZSamplePlayPosition : public wxTimer +{ public: - JZSampleFrame(wxWindow* pParent, JZSampleFrame** ref, JZSample& Sample); - ~JZSampleFrame(); - virtual void OnSize(int w, int h); - virtual bool OnClose(); - virtual void OnMenuCommand(int id); - void Redraw(); - bool HaveInsertionPoint(int &offs, bool warn = TRUE); - enum HaveSelectionMode + JZSamplePlayPosition( + JZSampleWindow& SampleWindow, + JZPlayer* pPlayer, + JZSample& Sample) + : cnvs(SampleWindow), + mpPlayer(pPlayer), + spl(Sample) { - SelWarn, - SelNoWarn, - SelAll - }; - bool HaveSelection(int &fr_smpl, int &to_smpl, HaveSelectionMode = SelAll); + visible = false; + x = 0; + } - void AddParam(JZRndArray *array, const char *label); - void ClrParam(); - void ClearSelection(); - JZSample &GetSample() + ~JZSamplePlayPosition() { - return spl; + Stop(); + if (visible) + Draw(); } - void PlaySample(); + void StopListen(); + + void StartListen(int fr, int to); + + bool IsListening() const; + + void Draw(); + + virtual void Notify(); + private: + JZSampleWindow& cnvs; + JZPlayer* mpPlayer; + JZSample& spl; + bool visible; + int x; + int fr_smpl; + int to_smpl; +}; - int GetPaintLength(); - int GetPaintOffset(); -#ifdef OBSOLETE - static void ScrollCallback(wxItem &itm, wxCommandEvent& event); - void OnScroll(wxItem &item); -#endif - void SetViewPos(int fr, int to); - void LoadError(JZSample &spl); +//***************************************************************************** +//***************************************************************************** +class JZSampleWindow : public wxScrolledWindow +{ + friend class JZSampleFrame; + friend class JZSmplWinSettingsForm; + public: + + JZSampleWindow(JZSampleFrame* pSampleFrame, JZSample& Sample); + + virtual ~JZSampleWindow(); + + void Redraw() + { + OnPaint(); + } + + virtual void OnPaint(); + + virtual void OnSize(int w, int h); + + virtual void OnEvent(wxMouseEvent& MouseEvent); + + void ClearSelection(); + + void SetInsertionPoint(int offs); + + void SetSelection(int fr, int to); + + int Sample2Pixel(int sample); + + int Pixel2Sample(float pixel); + + void Play(); + private: + void DrawSample(int channel, int x, int y, int w, int h); + + void DrawTicks(int x, int y, int w); + + private: + + JZSampleFrame* mpSampleFrame; + JZSample& spl; - JZSampleWindow* cnvs; - wxPanel* scrol_panel; - wxScrollBar* pos_scrol; - wxScrollBar* zoom_scrol; - JZToolBar* mpToolBar; - int in_constructor; - JZSampleFrame** ref; - static int geo[4]; - static JZSample* copy_buffer; + int paint_offset; + int paint_length; - enum - { - MAXPARAM = 4 - }; - JZArrayEdit* params[MAXPARAM]; - int num_params; + JZSnapSelection snapsel; - JZCommandPainter* on_accept; - JZSplVolume vol_command; - JZSplPan pan_command; - JZSplPitch pitch_command; - JZWahWah wah_command; + // sel_fr == 0: no selection and no insertion point + // sel_fr > 0 && sel_fr == sel_to: insertion point + // sel_fr > 0 && sel_fr < sel_to: selected range + int sel_fr, sel_to; + JZInsertionPoint inspt; + int mouse_up_sets_insertion_point; + JZSamplePlayPosition *playpos; - JZEqualizer* equalizer; - JZDistortion* distortion; - JZSynthDlg* synth; - wxDialog* reverb; - wxDialog* echo; - wxDialog* chorus; - wxDialog* shifter; - wxDialog* stretcher; - wxDialog* filter; - wxDialog* settings; - wxDialog* wah_settings; - wxDialog* pitch_settings; + // for tickmark display + bool midi_time; + int midi_offs; + + bool mouse_down; }; #endif // !defined(JZ_SAMPLEWINDOW_H) Modified: trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj =================================================================== --- trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj 2010-07-17 20:17:47 UTC (rev 809) +++ trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj 2010-07-17 21:15:00 UTC (rev 810) @@ -938,6 +938,14 @@ > </File> <File + RelativePath="..\src\SampleFrame.cpp" + > + </File> + <File + RelativePath="..\src\SampleFrame.h" + > + </File> + <File RelativePath="..\src\SampleWindow.cpp" > </File> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2010-07-17 20:17:53
|
Revision: 809 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=809&view=rev Author: pstieber Date: 2010-07-17 20:17:47 +0000 (Sat, 17 Jul 2010) Log Message: ----------- Updated the style. Modified Paths: -------------- trunk/jazz/src/SampleWindow.h Modified: trunk/jazz/src/SampleWindow.h =================================================================== --- trunk/jazz/src/SampleWindow.h 2010-07-17 20:08:47 UTC (rev 808) +++ trunk/jazz/src/SampleWindow.h 2010-07-17 20:17:47 UTC (rev 809) @@ -39,13 +39,17 @@ class wxDialog; class wxScrollBar; +//***************************************************************************** +//***************************************************************************** class JZSampleFrame : public wxFrame { friend class JZSampleWindow; friend class JZCommandPainter; friend class JZSmplWinSettingsForm; + public: - JZSampleFrame(wxWindow* pParent, JZSampleFrame **ref, JZSample &); + + JZSampleFrame(wxWindow* pParent, JZSampleFrame** ref, JZSample& Sample); ~JZSampleFrame(); virtual void OnSize(int w, int h); virtual bool OnClose(); @@ -70,6 +74,7 @@ void PlaySample(); private: + int GetPaintLength(); int GetPaintOffset(); #ifdef OBSOLETE @@ -79,43 +84,45 @@ void SetViewPos(int fr, int to); void LoadError(JZSample &spl); - JZSample &spl; - JZSampleWindow *cnvs; - wxPanel *scrol_panel; - wxScrollBar *pos_scrol; - wxScrollBar *zoom_scrol; + private: + + JZSample& spl; + JZSampleWindow* cnvs; + wxPanel* scrol_panel; + wxScrollBar* pos_scrol; + wxScrollBar* zoom_scrol; JZToolBar* mpToolBar; - int in_constructor; - JZSampleFrame **ref; + int in_constructor; + JZSampleFrame** ref; static int geo[4]; - static JZSample *copy_buffer; + static JZSample* copy_buffer; enum { MAXPARAM = 4 }; - JZArrayEdit *params[MAXPARAM]; - int num_params; + JZArrayEdit* params[MAXPARAM]; + int num_params; - JZCommandPainter *on_accept; + JZCommandPainter* on_accept; JZSplVolume vol_command; - JZSplPan pan_command; - JZSplPitch pitch_command; - JZWahWah wah_command; + JZSplPan pan_command; + JZSplPitch pitch_command; + JZWahWah wah_command; - JZEqualizer *equalizer; - JZDistortion *distortion; - JZSynthDlg *synth; - wxDialog *reverb; - wxDialog *echo; - wxDialog *chorus; - wxDialog *shifter; - wxDialog *stretcher; - wxDialog *filter; - wxDialog *settings; - wxDialog *wah_settings; - wxDialog *pitch_settings; + JZEqualizer* equalizer; + JZDistortion* distortion; + JZSynthDlg* synth; + wxDialog* reverb; + wxDialog* echo; + wxDialog* chorus; + wxDialog* shifter; + wxDialog* stretcher; + wxDialog* filter; + wxDialog* settings; + wxDialog* wah_settings; + wxDialog* pitch_settings; }; #endif // !defined(JZ_SAMPLEWINDOW_H) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2010-07-17 20:08:53
|
Revision: 808 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=808&view=rev Author: pstieber Date: 2010-07-17 20:08:47 +0000 (Sat, 17 Jul 2010) Log Message: ----------- Updated the header sentry. Modified Paths: -------------- trunk/jazz/src/SampleWindow.h Modified: trunk/jazz/src/SampleWindow.h =================================================================== --- trunk/jazz/src/SampleWindow.h 2010-07-17 20:05:19 UTC (rev 807) +++ trunk/jazz/src/SampleWindow.h 2010-07-17 20:08:47 UTC (rev 808) @@ -20,8 +20,8 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#ifndef samplwin_h -#define samplwin_h +#ifndef JZ_SAMPLEWINDOW_H +#define JZ_SAMPLEWINDOW_H #include "SampleCommand.h" @@ -118,5 +118,4 @@ wxDialog *pitch_settings; }; -#endif - +#endif // !defined(JZ_SAMPLEWINDOW_H) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2010-07-17 20:05:26
|
Revision: 807 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=807&view=rev Author: pstieber Date: 2010-07-17 20:05:19 +0000 (Sat, 17 Jul 2010) Log Message: ----------- Updated copyright lines. Modified Paths: -------------- trunk/jazz/src/CommandUtilities.h trunk/jazz/src/Dialogs/CleanupDialog.cpp trunk/jazz/src/Dialogs/CleanupDialog.h trunk/jazz/src/Dialogs/DeleteDialog.cpp trunk/jazz/src/Dialogs/DeleteDialog.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/MetronomeSettingsDialog.cpp trunk/jazz/src/Dialogs/MetronomeSettingsDialog.h trunk/jazz/src/Dialogs/MidiChannelDialog.cpp trunk/jazz/src/Dialogs/MidiChannelDialog.h trunk/jazz/src/Dialogs/QuantizeDialog.cpp trunk/jazz/src/Dialogs/QuantizeDialog.h trunk/jazz/src/Dialogs/SearchAndReplaceDialog.cpp trunk/jazz/src/Dialogs/SearchAndReplaceDialog.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/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/EventFrame.cpp trunk/jazz/src/EventFrame.h trunk/jazz/src/EventWindow.cpp trunk/jazz/src/EventWindow.h trunk/jazz/src/GuitarWindow.cpp trunk/jazz/src/GuitarWindow.h trunk/jazz/src/Harmony.cpp trunk/jazz/src/MouseAction.cpp trunk/jazz/src/MouseAction.h trunk/jazz/src/PianoFrame.h trunk/jazz/src/PianoWindow.h trunk/jazz/src/Random.cpp trunk/jazz/src/Random.h trunk/jazz/src/SampleWindow.h trunk/jazz/src/StringUtilities.cpp trunk/jazz/src/StringUtilities.h trunk/jazz/src/TrackWindow.h Modified: trunk/jazz/src/CommandUtilities.h =================================================================== --- trunk/jazz/src/CommandUtilities.h 2010-07-17 19:13:48 UTC (rev 806) +++ trunk/jazz/src/CommandUtilities.h 2010-07-17 20:05:19 UTC (rev 807) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2009 Peter J. Stieber, all rights reserved. +// Copyright (C) 2009-2010 Peter J. Stieber, all rights reserved. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by Modified: trunk/jazz/src/Dialogs/CleanupDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/CleanupDialog.cpp 2010-07-17 19:13:48 UTC (rev 806) +++ trunk/jazz/src/Dialogs/CleanupDialog.cpp 2010-07-17 20:05:19 UTC (rev 807) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2009 Peter J. Stieber, all rights reserved. +// Copyright (C) 2009-2010 Peter J. Stieber, all rights reserved. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by Modified: trunk/jazz/src/Dialogs/CleanupDialog.h =================================================================== --- trunk/jazz/src/Dialogs/CleanupDialog.h 2010-07-17 19:13:48 UTC (rev 806) +++ trunk/jazz/src/Dialogs/CleanupDialog.h 2010-07-17 20:05:19 UTC (rev 807) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2009 Peter J. Stieber, all rights reserved. +// Copyright (C) 2009-2010 Peter J. Stieber, all rights reserved. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by Modified: trunk/jazz/src/Dialogs/DeleteDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/DeleteDialog.cpp 2010-07-17 19:13:48 UTC (rev 806) +++ trunk/jazz/src/Dialogs/DeleteDialog.cpp 2010-07-17 20:05:19 UTC (rev 807) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2009 Peter J. Stieber, all rights reserved. +// Copyright (C) 2009-2010 Peter J. Stieber, all rights reserved. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by Modified: trunk/jazz/src/Dialogs/DeleteDialog.h =================================================================== --- trunk/jazz/src/Dialogs/DeleteDialog.h 2010-07-17 19:13:48 UTC (rev 806) +++ trunk/jazz/src/Dialogs/DeleteDialog.h 2010-07-17 20:05:19 UTC (rev 807) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2009 Peter J. Stieber, all rights reserved. +// Copyright (C) 2009-2010 Peter J. Stieber, all rights reserved. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by Modified: trunk/jazz/src/Dialogs/FilterDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/FilterDialog.cpp 2010-07-17 19:13:48 UTC (rev 806) +++ trunk/jazz/src/Dialogs/FilterDialog.cpp 2010-07-17 20:05:19 UTC (rev 807) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2008 Peter J. Stieber, all rights reserved. +// Copyright (C) 2008-2010 Peter J. Stieber, all rights reserved. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by Modified: trunk/jazz/src/Dialogs/FilterDialog.h =================================================================== --- trunk/jazz/src/Dialogs/FilterDialog.h 2010-07-17 19:13:48 UTC (rev 806) +++ trunk/jazz/src/Dialogs/FilterDialog.h 2010-07-17 20:05:19 UTC (rev 807) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2008 Peter J. Stieber, all rights reserved. +// Copyright (C) 2008-2010 Peter J. Stieber, all rights reserved. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by Modified: trunk/jazz/src/Dialogs/IntegerEdit.cpp =================================================================== --- trunk/jazz/src/Dialogs/IntegerEdit.cpp 2010-07-17 19:13:48 UTC (rev 806) +++ trunk/jazz/src/Dialogs/IntegerEdit.cpp 2010-07-17 20:05:19 UTC (rev 807) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2008 Peter J. Stieber, all rights reserved. +// Copyright (C) 2008-2010 Peter J. Stieber, all rights reserved. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by Modified: trunk/jazz/src/Dialogs/IntegerEdit.h =================================================================== --- trunk/jazz/src/Dialogs/IntegerEdit.h 2010-07-17 19:13:48 UTC (rev 806) +++ trunk/jazz/src/Dialogs/IntegerEdit.h 2010-07-17 20:05:19 UTC (rev 807) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2008 Peter J. Stieber, all rights reserved. +// Copyright (C) 2008-2010 Peter J. Stieber, all rights reserved. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by Modified: trunk/jazz/src/Dialogs/KeyOnDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/KeyOnDialog.cpp 2010-07-17 19:13:48 UTC (rev 806) +++ trunk/jazz/src/Dialogs/KeyOnDialog.cpp 2010-07-17 20:05:19 UTC (rev 807) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2008 Peter J. Stieber, all rights reserved. +// Copyright (C) 2008-2010 Peter J. Stieber, all rights reserved. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by Modified: trunk/jazz/src/Dialogs/KeyOnDialog.h =================================================================== --- trunk/jazz/src/Dialogs/KeyOnDialog.h 2010-07-17 19:13:48 UTC (rev 806) +++ trunk/jazz/src/Dialogs/KeyOnDialog.h 2010-07-17 20:05:19 UTC (rev 807) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2008 Peter J. Stieber, all rights reserved. +// Copyright (C) 2008-2010 Peter J. Stieber, all rights reserved. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by Modified: trunk/jazz/src/Dialogs/LengthDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/LengthDialog.cpp 2010-07-17 19:13:48 UTC (rev 806) +++ trunk/jazz/src/Dialogs/LengthDialog.cpp 2010-07-17 20:05:19 UTC (rev 807) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2009 Peter J. Stieber, all rights reserved. +// Copyright (C) 2009-2010 Peter J. Stieber, all rights reserved. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by Modified: trunk/jazz/src/Dialogs/LengthDialog.h =================================================================== --- trunk/jazz/src/Dialogs/LengthDialog.h 2010-07-17 19:13:48 UTC (rev 806) +++ trunk/jazz/src/Dialogs/LengthDialog.h 2010-07-17 20:05:19 UTC (rev 807) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2009 Peter J. Stieber, all rights reserved. +// Copyright (C) 2009-2010 Peter J. Stieber, all rights reserved. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by Modified: trunk/jazz/src/Dialogs/MetronomeSettingsDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/MetronomeSettingsDialog.cpp 2010-07-17 19:13:48 UTC (rev 806) +++ trunk/jazz/src/Dialogs/MetronomeSettingsDialog.cpp 2010-07-17 20:05:19 UTC (rev 807) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2008 Peter J. Stieber, all rights reserved. +// Copyright (C) 2008-2010 Peter J. Stieber, all rights reserved. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by Modified: trunk/jazz/src/Dialogs/MetronomeSettingsDialog.h =================================================================== --- trunk/jazz/src/Dialogs/MetronomeSettingsDialog.h 2010-07-17 19:13:48 UTC (rev 806) +++ trunk/jazz/src/Dialogs/MetronomeSettingsDialog.h 2010-07-17 20:05:19 UTC (rev 807) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2008 Peter J. Stieber, all rights reserved. +// Copyright (C) 2008-2010 Peter J. Stieber, all rights reserved. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by Modified: trunk/jazz/src/Dialogs/MidiChannelDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/MidiChannelDialog.cpp 2010-07-17 19:13:48 UTC (rev 806) +++ trunk/jazz/src/Dialogs/MidiChannelDialog.cpp 2010-07-17 20:05:19 UTC (rev 807) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2009 Peter J. Stieber, all rights reserved. +// Copyright (C) 2009-2010 Peter J. Stieber, all rights reserved. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by Modified: trunk/jazz/src/Dialogs/MidiChannelDialog.h =================================================================== --- trunk/jazz/src/Dialogs/MidiChannelDialog.h 2010-07-17 19:13:48 UTC (rev 806) +++ trunk/jazz/src/Dialogs/MidiChannelDialog.h 2010-07-17 20:05:19 UTC (rev 807) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2009 Peter J. Stieber, all rights reserved. +// Copyright (C) 2009-2010 Peter J. Stieber, all rights reserved. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by Modified: trunk/jazz/src/Dialogs/QuantizeDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/QuantizeDialog.cpp 2010-07-17 19:13:48 UTC (rev 806) +++ trunk/jazz/src/Dialogs/QuantizeDialog.cpp 2010-07-17 20:05:19 UTC (rev 807) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2009 Peter J. Stieber, all rights reserved. +// Copyright (C) 2009-2010 Peter J. Stieber, all rights reserved. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by Modified: trunk/jazz/src/Dialogs/QuantizeDialog.h =================================================================== --- trunk/jazz/src/Dialogs/QuantizeDialog.h 2010-07-17 19:13:48 UTC (rev 806) +++ trunk/jazz/src/Dialogs/QuantizeDialog.h 2010-07-17 20:05:19 UTC (rev 807) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2009 Peter J. Stieber, all rights reserved. +// Copyright (C) 2009-2010 Peter J. Stieber, all rights reserved. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by Modified: trunk/jazz/src/Dialogs/SearchAndReplaceDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/SearchAndReplaceDialog.cpp 2010-07-17 19:13:48 UTC (rev 806) +++ trunk/jazz/src/Dialogs/SearchAndReplaceDialog.cpp 2010-07-17 20:05:19 UTC (rev 807) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2009 Peter J. Stieber, all rights reserved. +// Copyright (C) 2009-2010 Peter J. Stieber, all rights reserved. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by Modified: trunk/jazz/src/Dialogs/SearchAndReplaceDialog.h =================================================================== --- trunk/jazz/src/Dialogs/SearchAndReplaceDialog.h 2010-07-17 19:13:48 UTC (rev 806) +++ trunk/jazz/src/Dialogs/SearchAndReplaceDialog.h 2010-07-17 20:05:19 UTC (rev 807) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2009 Peter J. Stieber, all rights reserved. +// Copyright (C) 2009-2010 Peter J. Stieber, all rights reserved. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by Modified: trunk/jazz/src/Dialogs/ShiftDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/ShiftDialog.cpp 2010-07-17 19:13:48 UTC (rev 806) +++ trunk/jazz/src/Dialogs/ShiftDialog.cpp 2010-07-17 20:05:19 UTC (rev 807) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2008 Peter J. Stieber, all rights reserved. +// Copyright (C) 2008-2010 Peter J. Stieber, all rights reserved. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by Modified: trunk/jazz/src/Dialogs/ShiftDialog.h =================================================================== --- trunk/jazz/src/Dialogs/ShiftDialog.h 2010-07-17 19:13:48 UTC (rev 806) +++ trunk/jazz/src/Dialogs/ShiftDialog.h 2010-07-17 20:05:19 UTC (rev 807) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2008 Peter J. Stieber, all rights reserved. +// Copyright (C) 2008-2010 Peter J. Stieber, all rights reserved. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by Modified: trunk/jazz/src/Dialogs/SnapDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/SnapDialog.cpp 2010-07-17 19:13:48 UTC (rev 806) +++ trunk/jazz/src/Dialogs/SnapDialog.cpp 2010-07-17 20:05:19 UTC (rev 807) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2009 Peter J. Stieber, all rights reserved. +// Copyright (C) 2009-2010 Peter J. Stieber, all rights reserved. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by Modified: trunk/jazz/src/Dialogs/SnapDialog.h =================================================================== --- trunk/jazz/src/Dialogs/SnapDialog.h 2010-07-17 19:13:48 UTC (rev 806) +++ trunk/jazz/src/Dialogs/SnapDialog.h 2010-07-17 20:05:19 UTC (rev 807) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2009 Peter J. Stieber, all rights reserved. +// Copyright (C) 2009-2010 Peter J. Stieber, all rights reserved. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by Modified: trunk/jazz/src/Dialogs/SynthesizerSettingsDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/SynthesizerSettingsDialog.cpp 2010-07-17 19:13:48 UTC (rev 806) +++ trunk/jazz/src/Dialogs/SynthesizerSettingsDialog.cpp 2010-07-17 20:05:19 UTC (rev 807) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2008 Peter J. Stieber, all rights reserved. +// Copyright (C) 2008-2010 Peter J. Stieber, all rights reserved. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by Modified: trunk/jazz/src/Dialogs/SynthesizerSettingsDialog.h =================================================================== --- trunk/jazz/src/Dialogs/SynthesizerSettingsDialog.h 2010-07-17 19:13:48 UTC (rev 806) +++ trunk/jazz/src/Dialogs/SynthesizerSettingsDialog.h 2010-07-17 20:05:19 UTC (rev 807) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2008 Peter J. Stieber, all rights reserved. +// Copyright (C) 2008-2010 Peter J. Stieber, all rights reserved. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by Modified: trunk/jazz/src/Dialogs/SysexDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/SysexDialog.cpp 2010-07-17 19:13:48 UTC (rev 806) +++ trunk/jazz/src/Dialogs/SysexDialog.cpp 2010-07-17 20:05:19 UTC (rev 807) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2009 Peter J. Stieber, all rights reserved. +// Copyright (C) 2009-2010 Peter J. Stieber, all rights reserved. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by Modified: trunk/jazz/src/Dialogs/SysexDialog.h =================================================================== --- trunk/jazz/src/Dialogs/SysexDialog.h 2010-07-17 19:13:48 UTC (rev 806) +++ trunk/jazz/src/Dialogs/SysexDialog.h 2010-07-17 20:05:19 UTC (rev 807) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2009 Peter J. Stieber, all rights reserved. +// Copyright (C) 2009-2010 Peter J. Stieber, all rights reserved. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by Modified: trunk/jazz/src/Dialogs/TrackDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/TrackDialog.cpp 2010-07-17 19:13:48 UTC (rev 806) +++ trunk/jazz/src/Dialogs/TrackDialog.cpp 2010-07-17 20:05:19 UTC (rev 807) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2008 Peter J. Stieber, all rights reserved. +// Copyright (C) 2008-2010 Peter J. Stieber, all rights reserved. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by Modified: trunk/jazz/src/Dialogs/TrackDialog.h =================================================================== --- trunk/jazz/src/Dialogs/TrackDialog.h 2010-07-17 19:13:48 UTC (rev 806) +++ trunk/jazz/src/Dialogs/TrackDialog.h 2010-07-17 20:05:19 UTC (rev 807) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2008 Peter J. Stieber, all rights reserved. +// Copyright (C) 2008-2010 Peter J. Stieber, all rights reserved. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by Modified: trunk/jazz/src/Dialogs/TransposeDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/TransposeDialog.cpp 2010-07-17 19:13:48 UTC (rev 806) +++ trunk/jazz/src/Dialogs/TransposeDialog.cpp 2010-07-17 20:05:19 UTC (rev 807) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2009 Peter J. Stieber, all rights reserved. +// Copyright (C) 2009-2010 Peter J. Stieber, all rights reserved. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by Modified: trunk/jazz/src/Dialogs/TransposeDialog.h =================================================================== --- trunk/jazz/src/Dialogs/TransposeDialog.h 2010-07-17 19:13:48 UTC (rev 806) +++ trunk/jazz/src/Dialogs/TransposeDialog.h 2010-07-17 20:05:19 UTC (rev 807) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2009 Peter J. Stieber, all rights reserved. +// Copyright (C) 2009-2010 Peter J. Stieber, all rights reserved. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by Modified: trunk/jazz/src/Dialogs/VelocityDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/VelocityDialog.cpp 2010-07-17 19:13:48 UTC (rev 806) +++ trunk/jazz/src/Dialogs/VelocityDialog.cpp 2010-07-17 20:05:19 UTC (rev 807) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2009 Peter J. Stieber, all rights reserved. +// Copyright (C) 2009-2010 Peter J. Stieber, all rights reserved. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by Modified: trunk/jazz/src/Dialogs/VelocityDialog.h =================================================================== --- trunk/jazz/src/Dialogs/VelocityDialog.h 2010-07-17 19:13:48 UTC (rev 806) +++ trunk/jazz/src/Dialogs/VelocityDialog.h 2010-07-17 20:05:19 UTC (rev 807) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2009 Peter J. Stieber, all rights reserved. +// Copyright (C) 2009-2010 Peter J. Stieber, all rights reserved. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by Modified: trunk/jazz/src/EventFrame.cpp =================================================================== --- trunk/jazz/src/EventFrame.cpp 2010-07-17 19:13:48 UTC (rev 806) +++ trunk/jazz/src/EventFrame.cpp 2010-07-17 20:05:19 UTC (rev 807) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2009 Peter J. Stieber, all rights reserved. +// Copyright (C) 2009-2010 Peter J. Stieber, all rights reserved. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by Modified: trunk/jazz/src/EventFrame.h =================================================================== --- trunk/jazz/src/EventFrame.h 2010-07-17 19:13:48 UTC (rev 806) +++ trunk/jazz/src/EventFrame.h 2010-07-17 20:05:19 UTC (rev 807) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2009 Peter J. Stieber, all rights reserved. +// Copyright (C) 2009-2010 Peter J. Stieber, all rights reserved. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by Modified: trunk/jazz/src/EventWindow.cpp =================================================================== --- trunk/jazz/src/EventWindow.cpp 2010-07-17 19:13:48 UTC (rev 806) +++ trunk/jazz/src/EventWindow.cpp 2010-07-17 20:05:19 UTC (rev 807) @@ -3,7 +3,7 @@ // // Copyright (C) 1994-2000 Andreas Voss and Per Sigmond, all rights reserved. // Modifications Copyright (C) 2004 Patrick Earl -// Modifications Copyright (C) 2008-2009 Peter J. Stieber +// Modifications Copyright (C) 2008-2010 Peter J. Stieber // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by Modified: trunk/jazz/src/EventWindow.h =================================================================== --- trunk/jazz/src/EventWindow.h 2010-07-17 19:13:48 UTC (rev 806) +++ trunk/jazz/src/EventWindow.h 2010-07-17 20:05:19 UTC (rev 807) @@ -3,7 +3,7 @@ // // Copyright (C) 1994-2000 Andreas Voss and Per Sigmond, all rights reserved. // Modifications Copyright (C) 2004 Patrick Earl -// Modifications Copyright (C) 2008-2009 Peter J. Stieber +// Modifications Copyright (C) 2008-2010 Peter J. Stieber // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by Modified: trunk/jazz/src/GuitarWindow.cpp =================================================================== --- trunk/jazz/src/GuitarWindow.cpp 2010-07-17 19:13:48 UTC (rev 806) +++ trunk/jazz/src/GuitarWindow.cpp 2010-07-17 20:05:19 UTC (rev 807) @@ -3,7 +3,7 @@ // // Copyright (C) 1994-2000 Andreas Voss and Per Sigmond, all rights reserved. // Modifications Copyright (C) 2004 Patrick Earl -// Modifications Copyright (C) 2008-2009 Peter J. Stieber +// Modifications Copyright (C) 2008-2010 Peter J. Stieber // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by Modified: trunk/jazz/src/GuitarWindow.h =================================================================== --- trunk/jazz/src/GuitarWindow.h 2010-07-17 19:13:48 UTC (rev 806) +++ trunk/jazz/src/GuitarWindow.h 2010-07-17 20:05:19 UTC (rev 807) @@ -3,7 +3,7 @@ // // Copyright (C) 1994-2000 Andreas Voss and Per Sigmond, all rights reserved. // Modifications Copyright (C) 2004 Patrick Earl -// Modifications Copyright (C) 2008-2009 Peter J. Stieber +// Modifications Copyright (C) 2008-2010 Peter J. Stieber // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by Modified: trunk/jazz/src/Harmony.cpp =================================================================== --- trunk/jazz/src/Harmony.cpp 2010-07-17 19:13:48 UTC (rev 806) +++ trunk/jazz/src/Harmony.cpp 2010-07-17 20:05:19 UTC (rev 807) @@ -3,7 +3,7 @@ // // Copyright (C) 1994-2000 Andreas Voss and Per Sigmond, all rights reserved. // Modifications Copyright (C) 2004 Patrick Earl -// Modifications Copyright (C) 2008-2009 Peter J. Stieber +// Modifications Copyright (C) 2008-2010 Peter J. Stieber // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by Modified: trunk/jazz/src/MouseAction.cpp =================================================================== --- trunk/jazz/src/MouseAction.cpp 2010-07-17 19:13:48 UTC (rev 806) +++ trunk/jazz/src/MouseAction.cpp 2010-07-17 20:05:19 UTC (rev 807) @@ -3,7 +3,7 @@ // // Copyright (C) 1994-2000 Andreas Voss and Per Sigmond, all rights reserved. // Modifications Copyright (C) 2004 Patrick Earl -// Modifications Copyright (C) 2008-2009 Peter J. Stieber +// Modifications Copyright (C) 2008-2010 Peter J. Stieber // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by Modified: trunk/jazz/src/MouseAction.h =================================================================== --- trunk/jazz/src/MouseAction.h 2010-07-17 19:13:48 UTC (rev 806) +++ trunk/jazz/src/MouseAction.h 2010-07-17 20:05:19 UTC (rev 807) @@ -3,7 +3,7 @@ // // Copyright (C) 1994-2000 Andreas Voss and Per Sigmond, all rights reserved. // Modifications Copyright (C) 2004 Patrick Earl -// Modifications Copyright (C) 2008-2009 Peter J. Stieber +// Modifications Copyright (C) 2008-2010 Peter J. Stieber // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by Modified: trunk/jazz/src/PianoFrame.h =================================================================== --- trunk/jazz/src/PianoFrame.h 2010-07-17 19:13:48 UTC (rev 806) +++ trunk/jazz/src/PianoFrame.h 2010-07-17 20:05:19 UTC (rev 807) @@ -3,7 +3,7 @@ // // Copyright (C) 1994-2000 Andreas Voss and Per Sigmond, all rights reserved. // Modifications Copyright (C) 2004 Patrick Earl -// Modifications Copyright (C) 2008-2009 Peter J. Stieber +// Modifications Copyright (C) 2008-2010 Peter J. Stieber // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by Modified: trunk/jazz/src/PianoWindow.h =================================================================== --- trunk/jazz/src/PianoWindow.h 2010-07-17 19:13:48 UTC (rev 806) +++ trunk/jazz/src/PianoWindow.h 2010-07-17 20:05:19 UTC (rev 807) @@ -3,7 +3,7 @@ // // Copyright (C) 1994-2000 Andreas Voss and Per Sigmond, all rights reserved. // Modifications Copyright (C) 2004 Patrick Earl -// Modifications Copyright (C) 2008-2009 Peter J. Stieber +// Modifications Copyright (C) 2008-2010 Peter J. Stieber // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by Modified: trunk/jazz/src/Random.cpp =================================================================== --- trunk/jazz/src/Random.cpp 2010-07-17 19:13:48 UTC (rev 806) +++ trunk/jazz/src/Random.cpp 2010-07-17 20:05:19 UTC (rev 807) @@ -3,7 +3,7 @@ // // Copyright (C) 1994-2000 Andreas Voss and Per Sigmond, all rights reserved. // Modifications Copyright (C) 2004 Patrick Earl -// Modifications Copyright (C) 2008-2009 Peter J. Stieber +// Modifications Copyright (C) 2008-2010 Peter J. Stieber // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by Modified: trunk/jazz/src/Random.h =================================================================== --- trunk/jazz/src/Random.h 2010-07-17 19:13:48 UTC (rev 806) +++ trunk/jazz/src/Random.h 2010-07-17 20:05:19 UTC (rev 807) @@ -3,7 +3,7 @@ // // Copyright (C) 1994-2000 Andreas Voss and Per Sigmond, all rights reserved. // Modifications Copyright (C) 2004 Patrick Earl -// Modifications Copyright (C) 2008-2009 Peter J. Stieber +// Modifications Copyright (C) 2008-2010 Peter J. Stieber // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by Modified: trunk/jazz/src/SampleWindow.h =================================================================== --- trunk/jazz/src/SampleWindow.h 2010-07-17 19:13:48 UTC (rev 806) +++ trunk/jazz/src/SampleWindow.h 2010-07-17 20:05:19 UTC (rev 807) @@ -3,7 +3,7 @@ // // Copyright (C) 1994-2000 Andreas Voss and Per Sigmond, all rights reserved. // Modifications Copyright (C) 2004 Patrick Earl -// Modifications Copyright (C) 2008 Peter J. Stieber +// Modifications Copyright (C) 2008-2010 Peter J. Stieber // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by Modified: trunk/jazz/src/StringUtilities.cpp =================================================================== --- trunk/jazz/src/StringUtilities.cpp 2010-07-17 19:13:48 UTC (rev 806) +++ trunk/jazz/src/StringUtilities.cpp 2010-07-17 20:05:19 UTC (rev 807) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2008 Peter J. Stieber, all rights reserved. +// Copyright (C) 2008-2010 Peter J. Stieber, all rights reserved. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by Modified: trunk/jazz/src/StringUtilities.h =================================================================== --- trunk/jazz/src/StringUtilities.h 2010-07-17 19:13:48 UTC (rev 806) +++ trunk/jazz/src/StringUtilities.h 2010-07-17 20:05:19 UTC (rev 807) @@ -1,7 +1,7 @@ //***************************************************************************** // The JAZZ++ Midi Sequencer // -// Copyright (C) 2008 Peter J. Stieber, all rights reserved. +// Copyright (C) 2008-2010 Peter J. Stieber, all rights reserved. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by Modified: trunk/jazz/src/TrackWindow.h =================================================================== --- trunk/jazz/src/TrackWindow.h 2010-07-17 19:13:48 UTC (rev 806) +++ trunk/jazz/src/TrackWindow.h 2010-07-17 20:05:19 UTC (rev 807) @@ -3,7 +3,7 @@ // // Copyright (C) 1994-2000 Andreas Voss and Per Sigmond, all rights reserved. // Modifications Copyright (C) 2004 Patrick Earl -// Modifications Copyright (C) 2008-2009 Peter J. Stieber +// Modifications Copyright (C) 2008-2010 Peter J. Stieber // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2010-07-17 19:13:54
|
Revision: 806 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=806&view=rev Author: pstieber Date: 2010-07-17 19:13:48 +0000 (Sat, 17 Jul 2010) Log Message: ----------- Added a check box to set an audio track. Modified Paths: -------------- trunk/jazz/src/Dialogs/TrackDialog.cpp trunk/jazz/src/Dialogs/TrackDialog.h Modified: trunk/jazz/src/Dialogs/TrackDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/TrackDialog.cpp 2010-07-17 18:35:01 UTC (rev 805) +++ trunk/jazz/src/Dialogs/TrackDialog.cpp 2010-07-17 19:13:48 UTC (rev 806) @@ -27,6 +27,7 @@ #include "../Track.h" #include <wx/button.h> +#include <wx/checkbox.h> #include <wx/listbox.h> #include <wx/sizer.h> #include <wx/stattext.h> @@ -57,7 +58,8 @@ mpTrackNameEdit(0), mpPatchListBox(0), mpChannelValue(0), - mpChannelKnob(0) + mpChannelKnob(0), + mpAudioModeCheckBox(0) { mpTrackNameEdit = new wxTextCtrl(this, wxID_ANY); @@ -68,6 +70,8 @@ mpChannelKnob = new JZKnob(this, IDC_KB_CHANNEL, 0, 1, 16); + mpAudioModeCheckBox = new wxCheckBox(this, wxID_ANY, "Audio Track"); + wxButton* pOkButton = new wxButton(this, wxID_OK, "&OK"); wxButton* pCancelButton = new wxButton(this, wxID_CANCEL, "Cancel"); wxButton* pHelpButton = new wxButton(this, wxID_HELP, "Help"); @@ -103,6 +107,7 @@ pTopSizer->Add(pFlexGridSizer, 0, wxCENTER | wxALL, 2); + pTopSizer->Add(mpAudioModeCheckBox, 0, wxALL, 2); wxBoxSizer* pButtonSizer = new wxBoxSizer(wxHORIZONTAL); pButtonSizer->Add(pOkButton, 0, wxALL, 5); @@ -176,6 +181,8 @@ mpChannelKnob->SetValue(mTrack.Channel); + mpAudioModeCheckBox->SetValue(mTrack.GetAudioMode()); + return true; } @@ -194,6 +201,7 @@ mTrack.SetPatch(Patch); mTrack.SetBank(Bank); mTrack.Channel = mpChannelKnob->GetValue(); + mTrack.SetAudioMode(mpAudioModeCheckBox->GetValue()); } return true; Modified: trunk/jazz/src/Dialogs/TrackDialog.h =================================================================== --- trunk/jazz/src/Dialogs/TrackDialog.h 2010-07-17 18:35:01 UTC (rev 805) +++ trunk/jazz/src/Dialogs/TrackDialog.h 2010-07-17 19:13:48 UTC (rev 806) @@ -26,6 +26,7 @@ class JZKnob; class JZKnobEvent; class JZTrack; +class wxCheckBox; class wxListBox; class wxStaticText; class wxTextCtrl; @@ -64,6 +65,8 @@ JZKnob* mpChannelKnob; + wxCheckBox* mpAudioModeCheckBox; + DECLARE_EVENT_TABLE(); }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2010-07-17 18:35:08
|
Revision: 805 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=805&view=rev Author: pstieber Date: 2010-07-17 18:35:01 +0000 (Sat, 17 Jul 2010) Log Message: ----------- Changed JZTrack::Dialog to JZTrack::Edit. Modified Paths: -------------- trunk/jazz/src/Track.cpp trunk/jazz/src/Track.h trunk/jazz/src/TrackWindow.cpp Modified: trunk/jazz/src/Track.cpp =================================================================== --- trunk/jazz/src/Track.cpp 2010-07-17 18:18:55 UTC (rev 804) +++ trunk/jazz/src/Track.cpp 2010-07-17 18:35:01 UTC (rev 805) @@ -1902,7 +1902,7 @@ #endif // OBSOLETE -void JZTrack::Dialog(JZTrackWindow* pParent) +void JZTrack::Edit(JZTrackWindow* pParent) { JZTrackDialog TrackDialog(*this, pParent); TrackDialog.ShowModal(); Modified: trunk/jazz/src/Track.h =================================================================== --- trunk/jazz/src/Track.h 2010-07-17 18:18:55 UTC (rev 804) +++ trunk/jazz/src/Track.h 2010-07-17 18:35:01 UTC (rev 805) @@ -567,7 +567,7 @@ public: - void Dialog(JZTrackWindow* pParent); + void Edit(JZTrackWindow* pParent); bool IsEditing() const; Modified: trunk/jazz/src/TrackWindow.cpp =================================================================== --- trunk/jazz/src/TrackWindow.cpp 2010-07-17 18:18:55 UTC (rev 804) +++ trunk/jazz/src/TrackWindow.cpp 2010-07-17 18:35:01 UTC (rev 805) @@ -3,7 +3,7 @@ // // Copyright (C) 1994-2000 Andreas Voss and Per Sigmond, all rights reserved. // Modifications Copyright (C) 2004 Patrick Earl -// Modifications Copyright (C) 2008-2009 Peter J. Stieber +// Modifications Copyright (C) 2008-2010 Peter J. Stieber // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -390,7 +390,7 @@ { // The point is inside of a track name column. Edit the track // settings. - pTrack->Dialog(this); + pTrack->Edit(this); Refresh(false); } else if (Point.x >= mStateX && Point.x < mStateX + mStateWidth) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2010-07-17 18:19:01
|
Revision: 804 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=804&view=rev Author: pstieber Date: 2010-07-17 18:18:55 +0000 (Sat, 17 Jul 2010) Log Message: ----------- 1. Renamed the audio_mode data member of JZEventArray class to mAudioMode and made it a Boolean instead of an integer. 2. Made corresponding changes to other code that utilized this flag. Modified Paths: -------------- trunk/jazz/src/Events.h trunk/jazz/src/Player.cpp trunk/jazz/src/Player.h trunk/jazz/src/Song.cpp trunk/jazz/src/Song.h trunk/jazz/src/Track.cpp trunk/jazz/src/Track.h Modified: trunk/jazz/src/Events.h =================================================================== --- trunk/jazz/src/Events.h 2010-07-17 17:16:29 UTC (rev 803) +++ trunk/jazz/src/Events.h 2010-07-17 18:18:55 UTC (rev 804) @@ -1068,14 +1068,14 @@ mpData[4] = 1; // version or so } - char GetAudioMode() const + bool GetAudioMode() const { - return mpData[5]; + return mpData[5] != 0; } - void SetAudioMode(char c) + void SetAudioMode(bool AudioMode) { - mpData[5] = c; + mpData[5] = AudioMode; } char GetTrackState() const Modified: trunk/jazz/src/Player.cpp =================================================================== --- trunk/jazz/src/Player.cpp 2010-07-17 17:16:29 UTC (rev 803) +++ trunk/jazz/src/Player.cpp 2010-07-17 18:18:55 UTC (rev 804) @@ -140,7 +140,7 @@ JZSong* pSong, long ExtFr, long ExtTo, - int Mode) + bool AudioMode) { if (pEventArray == 0) { @@ -158,7 +158,7 @@ pEventArray, gpProject->GetMetronomeInfo(), Delta, - Mode); + AudioMode); Size -= mStopClock - From; From = mStartClock; @@ -173,7 +173,7 @@ pEventArray, gpProject->GetMetronomeInfo(), Delta, - Mode); + AudioMode); } } @@ -231,7 +231,7 @@ mpSong, mOutClock, Now + DELTACLOCK, - 0); + false); if (mpAudioBuffer) { mpPlayLoop->PrepareOutput( @@ -239,7 +239,7 @@ mpSong, mOutClock, Now + DELTACLOCK, - 1); + true); } mOutClock = Now + DELTACLOCK; mPlayBuffer.Length2Keyoff(); @@ -580,7 +580,7 @@ mpSong, Clock, Clock + FIRST_DELTACLOCK, - 0); + false); if (mpAudioBuffer) { @@ -589,7 +589,7 @@ mpSong, Clock, Clock + FIRST_DELTACLOCK, - 1); + true); } mPlayBuffer.Length2Keyoff(); Modified: trunk/jazz/src/Player.h =================================================================== --- trunk/jazz/src/Player.h 2010-07-17 17:16:29 UTC (rev 803) +++ trunk/jazz/src/Player.h 2010-07-17 18:18:55 UTC (rev 804) @@ -120,7 +120,7 @@ JZSong* pSong, long ExtFr, long ExtTo, - int mode = 0); + bool AudioMode = false); private: Modified: trunk/jazz/src/Song.cpp =================================================================== --- trunk/jazz/src/Song.cpp 2010-07-17 17:16:29 UTC (rev 803) +++ trunk/jazz/src/Song.cpp 2010-07-17 18:18:55 UTC (rev 804) @@ -344,7 +344,7 @@ JZEventArray* pDestin, const JZMetronomeInfo& MetronomeInfo, int delta, - int mode) + bool AudioMode) { // Make metronome if (MetronomeInfo.IsOn()) @@ -371,7 +371,7 @@ pTrack->State == tsSolo || (!DoSoloTracksExist && pTrack->State == tsPlay)) { - if (pTrack->GetAudioMode() != mode) + if (pTrack->GetAudioMode() != AudioMode) { continue; } Modified: trunk/jazz/src/Song.h =================================================================== --- trunk/jazz/src/Song.h 2010-07-17 17:16:29 UTC (rev 803) +++ trunk/jazz/src/Song.h 2010-07-17 18:18:55 UTC (rev 804) @@ -122,7 +122,7 @@ JZEventArray *Destin, const JZMetronomeInfo& MetronomeInfo, int DeltaClock = 0, - int mode = 0); + bool AudioMode = false); void MergePlayTrackEvent( JZPlayTrackEvent* c, Modified: trunk/jazz/src/Track.cpp =================================================================== --- trunk/jazz/src/Track.cpp 2010-07-17 17:16:29 UTC (rev 803) +++ trunk/jazz/src/Track.cpp 2010-07-17 18:18:55 UTC (rev 804) @@ -561,7 +561,8 @@ mpChorus(0), mpBank(0), mpBank2(0), - mpReset(0) + mpReset(0), + mAudioMode(false) { nEvents = 0; @@ -571,7 +572,6 @@ Device = 0; ForceChannel = 0; State = tsPlay; - audio_mode = 0; Clear(); } @@ -693,7 +693,7 @@ MaxEvents = 0; State = tsPlay; - audio_mode = 0; + mAudioMode = false; } @@ -1368,7 +1368,7 @@ } JZJazzMetaEvent JazzMeta; - JazzMeta.SetAudioMode(audio_mode); + JazzMeta.SetAudioMode(mAudioMode); JazzMeta.SetTrackState(State); JazzMeta.SetTrackDevice(Device); JazzMeta.SetIntroLength(gpSong->GetIntroLength()); @@ -1441,12 +1441,12 @@ SpecialEvent = false; if (pEvent->IsJazzMeta()) { - JZJazzMetaEvent* j = pEvent->IsJazzMeta(); - audio_mode = (int)j->GetAudioMode(); - State = (int)j->GetTrackState(); - Device = (int)j->GetTrackDevice(); - gpSong->SetIntroLength((int)j->GetIntroLength()); - delete j; + JZJazzMetaEvent* pJazzMetaEvent = pEvent->IsJazzMeta(); + mAudioMode = pJazzMetaEvent->GetAudioMode(); + State = (int)pJazzMetaEvent->GetTrackState(); + Device = (int)pJazzMetaEvent->GetTrackDevice(); + gpSong->SetIntroLength((int)pJazzMetaEvent->GetIntroLength()); + delete pJazzMetaEvent; continue; } if (pEvent->IsControl()) Modified: trunk/jazz/src/Track.h =================================================================== --- trunk/jazz/src/Track.h 2010-07-17 17:16:29 UTC (rev 803) +++ trunk/jazz/src/Track.h 2010-07-17 18:18:55 UTC (rev 804) @@ -531,19 +531,19 @@ public: - int GetAudioMode() const + bool GetAudioMode() const { - return audio_mode; + return mAudioMode; } - void SetAudioMode(int x) + void SetAudioMode(bool AudioMode) { - audio_mode = x; + mAudioMode = AudioMode; } protected: - int audio_mode; + bool mAudioMode; }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2010-07-17 17:16:35
|
Revision: 803 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=803&view=rev Author: pstieber Date: 2010-07-17 17:16:29 +0000 (Sat, 17 Jul 2010) Log Message: ----------- Updated Linux audio to match the latest changes. Modified Paths: -------------- trunk/jazz/src/AlsaDriver.cpp trunk/jazz/src/AudioDriver.cpp Modified: trunk/jazz/src/AlsaDriver.cpp =================================================================== --- trunk/jazz/src/AlsaDriver.cpp 2010-07-17 16:52:53 UTC (rev 802) +++ trunk/jazz/src/AlsaDriver.cpp 2010-07-17 17:16:29 UTC (rev 803) @@ -424,7 +424,7 @@ ReadSamples(); } - if (pcm[PLAYBACK] && mSamples.softsync) + if (pcm[PLAYBACK] && mSamples.GetSoftSync()) { MidiSync(); } @@ -460,7 +460,7 @@ for (; room > frag_size[PLAYBACK]; room -= frag_size[PLAYBACK]) { - JZAudioBuffer* buf = mSamples.GetFullBuffers().Get(); + JZAudioBuffer* buf = mSamples.mFullBuffers.Get(); if (buf == 0) { break; @@ -488,7 +488,7 @@ cur_scount += written; } blocks_written++; - mSamples.free_buffers.Put(buf); + mSamples.mFreeBuffers.Put(buf); } return blocks_written; Modified: trunk/jazz/src/AudioDriver.cpp =================================================================== --- trunk/jazz/src/AudioDriver.cpp 2010-07-17 16:52:53 UTC (rev 802) +++ trunk/jazz/src/AudioDriver.cpp 2010-07-17 17:16:29 UTC (rev 803) @@ -369,7 +369,7 @@ ReadSamples(); } - if (mSamples.softsync) + if (mSamples.GetSoftSync()) { MidiSync(); } @@ -401,7 +401,7 @@ for (int i = 0; i < info.fragments - 1; i++) { - JZAudioBuffer* buf = mSamples.full_buffers.Get(); + JZAudioBuffer* buf = mSamples.mFullBuffers.Get(); if (buf == 0) { break; @@ -411,7 +411,7 @@ perror("write"); } blocks_written ++; - mSamples.free_buffers.Put(buf); + mSamples.mFreeBuffers.Put(buf); } return blocks_written; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2010-07-17 16:52:59
|
Revision: 802 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=802&view=rev Author: pstieber Date: 2010-07-17 16:52:53 +0000 (Sat, 17 Jul 2010) Log Message: ----------- 1. Renamed JZSampleSet data members... softsync -> mSoftwareSynchonization ticks_per_minute -> mTicksPerMinute free_buffers -> mFreeBuffers full_buffers -> mFullBuffers driv_buffers -> mDriverBuffers 2. Started adding accessors to JZSampleSet (GetFullBuffers) to prevent the need to friend JZWindowsAudioPlayer, JZAudioPlayer, and JZAlsaAudioPlayer, but mutators are also required. I'll get there eventually. Modified Paths: -------------- trunk/jazz/src/AlsaDriver.cpp trunk/jazz/src/Audio.cpp trunk/jazz/src/Audio.h trunk/jazz/src/mswin/WindowsAudioInterface.cpp Modified: trunk/jazz/src/AlsaDriver.cpp =================================================================== --- trunk/jazz/src/AlsaDriver.cpp 2010-07-17 16:44:35 UTC (rev 801) +++ trunk/jazz/src/AlsaDriver.cpp 2010-07-17 16:52:53 UTC (rev 802) @@ -460,7 +460,7 @@ for (; room > frag_size[PLAYBACK]; room -= frag_size[PLAYBACK]) { - JZAudioBuffer* buf = mSamples.full_buffers.Get(); + JZAudioBuffer* buf = mSamples.GetFullBuffers().Get(); if (buf == 0) { break; Modified: trunk/jazz/src/Audio.cpp =================================================================== --- trunk/jazz/src/Audio.cpp 2010-07-17 16:44:35 UTC (rev 801) +++ trunk/jazz/src/Audio.cpp 2010-07-17 16:52:53 UTC (rev 802) @@ -188,23 +188,21 @@ //***************************************************************************** //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -JZSampleSet::JZSampleSet(long tpm) +JZSampleSet::JZSampleSet(long TicksPerMinute) : mSamplingRate(22050), mChannelCount(1), // Dont change!!! mBitsPerSample(16), - softsync(1), + mSoftwareSynchonization(true), + mTicksPerMinute(TicksPerMinute), mpSamplesDialog(0), mDefaultFileName("noname.spl"), mRecordFileName("noname.wav") { int i; - - ticks_per_minute = tpm; - - for (i = 0; i < BUFCOUNT; i++) + for (i = 0; i < BUFCOUNT; ++i) { buffers[i] = new JZAudioBuffer(0); } @@ -293,7 +291,7 @@ ifstream Is(FileName.c_str()); int Version; - Is >> Version >> mSamplingRate >> mChannelCount >> softsync; + Is >> Version >> mSamplingRate >> mChannelCount >> mSoftwareSynchonization; while (Is) { int key, pan, vol, pitch; @@ -364,7 +362,10 @@ { ofstream Ofs(FileName.c_str()); Ofs - << 1 << ' ' << mSamplingRate << ' ' << mChannelCount << ' ' << softsync + << 1 + << ' ' << mSamplingRate + << ' ' << mChannelCount + << ' ' << mSoftwareSynchonization << endl; for (int i = 0; i < eSampleCount; i++) { @@ -399,21 +400,24 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -int JZSampleSet::ResetBuffers(JZEventArray *evnt_arr, long clock, long tpm) +int JZSampleSet::ResetBuffers( + JZEventArray *evnt_arr, + long clock, + long TicksPerMinute) { int i; - free_buffers.Clear(); - full_buffers.Clear(); - driv_buffers.Clear(); + mFreeBuffers.Clear(); + mFullBuffers.Clear(); + mDriverBuffers.Clear(); for (i = 0; i < BUFCOUNT; i++) { - free_buffers.Put(buffers[i]); + mFreeBuffers.Put(buffers[i]); } buffers_written = 0; events = evnt_arr; start_clock = clock; - ticks_per_minute = tpm; + mTicksPerMinute = TicksPerMinute; event_index = 0; bufshorts = BUFSHORTS; mClocksPerBuffer = Samples2Ticks(bufshorts); @@ -443,7 +447,7 @@ // and compute the count of buffers that can be filled int i; - int nfree = free_buffers.Count(); + int nfree = mFreeBuffers.Count(); if (nfree <= 0) { return 0; @@ -469,14 +473,14 @@ // iterate the events and add sounding voices while (event_index < events->nEvents) { - JZEvent *e = events->Events[event_index]; - if (e->GetClock() >= last_clock) + JZEvent* pEvent = events->Events[event_index]; + if (pEvent->GetClock() >= last_clock) { break; } event_index++; - JZKeyOnEvent* pKeyOn = e->IsKeyOn(); + JZKeyOnEvent* pKeyOn = pEvent->IsKeyOn(); if (pKeyOn && num_voices < MAXPOLY) { voices[num_voices++]->Start( @@ -488,7 +492,7 @@ // add remaining sample data to the buffers for (i = 0; i < nfree; i++) { - JZAudioBuffer* buf = free_buffers.Get(); + JZAudioBuffer* buf = mFreeBuffers.Get(); buf->Clear(); long buffer_clock = BufferClock(buffers_written + i); @@ -501,7 +505,7 @@ { voices[k]->AddBuffer(buf->data, buffer_clock, bufshorts); } - full_buffers.Put(buf); + mFullBuffers.Put(buf); } // delete finished voices @@ -530,22 +534,22 @@ { listen_sample = spl; - assert(ticks_per_minute); - ResetBuffers(0, 0, ticks_per_minute); + assert(mTicksPerMinute); + ResetBuffers(0, 0, mTicksPerMinute); voices[0]->Start(spl, 0); - int nfree = free_buffers.Count(); + int nfree = mFreeBuffers.Count(); int sound_buffers = 0; for (int i = 0; i < nfree; i++) { - JZAudioBuffer* buf = free_buffers.Get(); + JZAudioBuffer* buf = mFreeBuffers.Get(); buf->Clear(); if (!voices[0]->Finished()) { voices[0]->AddListen(buf->Data(), fr_smpl, to_smpl, bufshorts); sound_buffers++; } - full_buffers.Put(buf); + mFullBuffers.Put(buf); } buffers_written = nfree; return sound_buffers; @@ -563,19 +567,19 @@ //----------------------------------------------------------------------------- int JZSampleSet::ContinueListen() { - int nfree = free_buffers.Count(); + int nfree = mFreeBuffers.Count(); int sound_buffers = 0; for (int i = 0; i < nfree; i++) { - JZAudioBuffer* buf = free_buffers.Get(); + JZAudioBuffer* buf = mFreeBuffers.Get(); buf->Clear(); if (!voices[0]->Finished()) { voices[0]->AddListen(buf->Data(), -1, -1, bufshorts); sound_buffers++; } - full_buffers.Put(buf); + mFullBuffers.Put(buf); } buffers_written += nfree; return sound_buffers; @@ -583,18 +587,20 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZSampleSet::AdjustAudioLength(JZTrack *t, long tpm) +void JZSampleSet::AdjustAudioLength(JZTrack* pTrack, long TicksPerMinute) { - if (!t->GetAudioMode() || !adjust_audio_length) + if (!pTrack->GetAudioMode() || !adjust_audio_length) + { return; + } - ticks_per_minute = tpm; + mTicksPerMinute = TicksPerMinute; - JZEventIterator it(t); - JZEvent *e = it.First(); - while (e) + JZEventIterator it(pTrack); + JZEvent* pEvent = it.First(); + while (pEvent) { - JZKeyOnEvent* pKeyOn = e->IsKeyOn(); + JZKeyOnEvent* pKeyOn = pEvent->IsKeyOn(); if (pKeyOn) { pKeyOn->SetLength( @@ -606,7 +612,7 @@ pKeyOn->SetLength(15); } } - e = it.Next(); + pEvent = it.Next(); } } @@ -728,7 +734,7 @@ enable = gpMidiPlayer->GetAudioEnabled(); stereo = (mSampleSet.GetChannelCount() == 2); - softsync = mSampleSet.GetSoftSync(); + mSoftwareSynchonization = mSampleSet.GetSoftSync(); Add(wxMakeFormBool("Enable Audio", &enable)); Add(wxMakeFormNewLine()); @@ -738,7 +744,7 @@ Add(wxMakeFormNewLine()); Add(wxMakeFormBool("Stereo", &stereo)); Add(wxMakeFormNewLine()); - Add(wxMakeFormBool("Software Midi/Audio Sync", &softsync)); + Add(wxMakeFormBool("Software Midi/Audio Sync", &mSoftwareSynchonization)); #ifdef wx_x Add(wxMakeFormNewLine()); @@ -765,7 +771,7 @@ speed = atol(speedstr); mSampleSet.SetSamplingRate(speed); mSampleSet.SetChannelCount(stereo ? 2 : 1); - mSampleSet.SetSoftSync(softsync); + mSampleSet.SetSoftSync(mSoftwareSynchonization); gpMidiPlayer->SetAudioEnabled(enable); if (gpConfig->GetValue(C_EnableAudio) != enable) @@ -810,7 +816,7 @@ const char *speedstr; bool enable; bool stereo; - bool softsync; + bool mSoftwareSynchonization; bool ossbug1; bool ossbug2; bool duplex_audio; @@ -905,7 +911,10 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZSampleSet::SaveRecordingDlg(long frc, long toc, JZAudioRecordBuffer &buf) +void JZSampleSet::SaveRecordingDlg( + long frc, + long toc, + JZAudioRecordBuffer& buf) { if (frc >= toc) { @@ -990,11 +999,11 @@ pSong->NewUndoBuffer(); #endif JZEventIterator iter(info->mpTrack); - JZEvent *e = iter.Range(frc, toc); - while (e != 0) + JZEvent* pEvent = iter.Range(frc, toc); + while (pEvent != 0) { - track->Kill(e); - e = iter.Next(); + track->Kill(pEvent); + pEvent = iter.Next(); } // add a noteon JZKeyOnEvent* pKeyOn = new JZKeyOnEvent( @@ -1057,8 +1066,11 @@ int end_buffer = end_index / bufsize; int end_length = end_index % bufsize; - // save part of first buffer - os.write((char *)&buf.buffers[start_buffer]->data[start_offs], 2 * start_length); + // Save part of first buffer. + os.write( + (char *)&buf.buffers[start_buffer]->data[start_offs], + 2 * start_length); + // write some complete buffers for (int i = start_buffer + 1; i < end_buffer; i++) os.write((char *)buf.buffers[i]->data, bufsize * 2); Modified: trunk/jazz/src/Audio.h =================================================================== --- trunk/jazz/src/Audio.h 2010-07-17 16:44:35 UTC (rev 801) +++ trunk/jazz/src/Audio.h 2010-07-17 16:52:53 UTC (rev 802) @@ -234,7 +234,7 @@ eSampleCount = 128 }; - JZSampleSet(long ticks_per_minute); + JZSampleSet(long TicksPerMinute); virtual ~JZSampleSet(); @@ -283,15 +283,15 @@ bool GetSoftSync() const { - return softsync; + return mSoftwareSynchonization; } - void SetSoftSync(bool x) + void SetSoftSync(bool SoftwareSynchonization) { - softsync = x; + mSoftwareSynchonization = SoftwareSynchonization; } - int ResetBuffers(JZEventArray *, long start_clock, long ticks_per_minute); + int ResetBuffers(JZEventArray *, long start_clock, long TicksPerMinute); int ResetBufferSize(unsigned int bytes); @@ -303,13 +303,13 @@ return buffers[i]; } - void AdjustAudioLength(JZTrack *t, long ticks_per_minute); + void AdjustAudioLength(JZTrack *t, long TicksPerMinute); long Ticks2Samples(long ticks) const { long spl = (long)( 60.0 * ticks * mSamplingRate * mChannelCount / - (double)ticks_per_minute); + (double)mTicksPerMinute); // Align to the first channel. return spl & -mChannelCount; @@ -318,18 +318,18 @@ double Samples2Ticks(long samples) const { return (double) - samples * ticks_per_minute / 60.0 / mSamplingRate / mChannelCount; + samples * mTicksPerMinute / 60.0 / mSamplingRate / mChannelCount; } // time in millisec long Ticks2Time(long ticks) const { - return (long)(60000.0 * ticks / ticks_per_minute); + return (long)(60000.0 * ticks / mTicksPerMinute); } long Time2Ticks(long time) const { - return (long)((double)time * ticks_per_minute / 60000.0); + return (long)((double)time * mTicksPerMinute / 60000.0); } long Samples2Time(long samples) const @@ -384,6 +384,8 @@ void ClearSampleSet(wxWindow* pParent); + const JZAudioBufferQueue& GetFullBuffers() const; + protected: long SampleSize(long num_samples) @@ -409,12 +411,15 @@ // This must be 16! int mBitsPerSample; - bool softsync; // enable software midi/audio sync + // Indicates if software MIDI/audio synchronization is on. + bool mSoftwareSynchonization; JZSample* mSamples[eSampleCount]; JZSampleFrame* mSampleFrames[eSampleCount]; - long ticks_per_minute; // MIDI sampling rate for audio/midi sync. + // MIDI sampling rate for audio/midi sync. + long mTicksPerMinute; + double mClocksPerBuffer; long start_clock; // when did play start @@ -423,9 +428,9 @@ unsigned int bufbytes; // buffer size in byte unsigned int bufshorts; // buffer size in short JZAudioBuffer *buffers[BUFCOUNT]; // all the audio buffers - JZAudioBufferQueue free_buffers; // to be filled with data - JZAudioBufferQueue full_buffers; // to be played by driver - JZAudioBufferQueue driv_buffers; // actually played by driver + JZAudioBufferQueue mFreeBuffers; // to be filled with data + JZAudioBufferQueue mFullBuffers; // to be played by driver + JZAudioBufferQueue mDriverBuffers; // actually played by driver // return the start clock for i-th free buffer long buffers_written; // for computing buffers clock @@ -454,4 +459,12 @@ JZSample* listen_sample; }; +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +inline +const JZAudioBufferQueue& JZSampleSet::GetFullBuffers() const +{ + return mFullBuffers; +} + #endif // !defined(JZ_AUDIO_H) Modified: trunk/jazz/src/mswin/WindowsAudioInterface.cpp =================================================================== --- trunk/jazz/src/mswin/WindowsAudioInterface.cpp 2010-07-17 16:44:35 UTC (rev 801) +++ trunk/jazz/src/mswin/WindowsAudioInterface.cpp 2010-07-17 16:52:53 UTC (rev 802) @@ -460,8 +460,8 @@ { blocks_played ++; play_buffers_needed ++; - JZAudioBuffer* buf = mSamples.driv_buffers.Get(); - mSamples.free_buffers.Put(buf); + JZAudioBuffer* buf = mSamples.mDriverBuffers.Get(); + mSamples.mFreeBuffers.Put(buf); } if (hinp_open && wMsg == MM_WIM_DATA) { @@ -496,7 +496,7 @@ if (mAudioEnabled && hout_open) { JZAudioBuffer* pAudioBuffer; - while ((pAudioBuffer = mSamples.full_buffers.Get()) != 0) + while ((pAudioBuffer = mSamples.mFullBuffers.Get()) != 0) { if ( waveOutWrite( @@ -504,12 +504,12 @@ pAudioBuffer->hdr, sizeof(WAVEHDR)) == MMSYSERR_NOERROR) { - mSamples.driv_buffers.Put(pAudioBuffer); + mSamples.mDriverBuffers.Put(pAudioBuffer); --play_buffers_needed; } else { - mSamples.full_buffers.UnGet(pAudioBuffer); + mSamples.mFullBuffers.UnGet(pAudioBuffer); break; } } @@ -533,7 +533,7 @@ } // midi time correction - if (mCanSynchronize && mSamples.softsync) + if (mCanSynchronize && mSamples.GetSoftSync()) { MMTIME mmtime; MMRESULT res; @@ -582,7 +582,7 @@ } } - if (mCanSynchronize && mSamples.softsync && !hout_open) + if (mCanSynchronize && mSamples.GetSoftSync() && !hout_open) { // midi time correction MMTIME mmtime; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2010-07-17 16:44:44
|
Revision: 801 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=801&view=rev Author: pstieber Date: 2010-07-17 16:44:35 +0000 (Sat, 17 Jul 2010) Log Message: ----------- 1. Added class and function comment headers. 2. Make lots of style updates. More updates are needed. Modified Paths: -------------- trunk/jazz/src/SampleWindow.cpp Modified: trunk/jazz/src/SampleWindow.cpp =================================================================== --- trunk/jazz/src/SampleWindow.cpp 2010-07-17 16:25:40 UTC (rev 800) +++ trunk/jazz/src/SampleWindow.cpp 2010-07-17 16:44:35 UTC (rev 801) @@ -60,12 +60,14 @@ class JZSamplePlayPosition; +//***************************************************************************** +//***************************************************************************** class JZInsertionPoint { public: - JZInsertionPoint(wxScrolledWindow *c) - : cnvs(c) + JZInsertionPoint(wxScrolledWindow* pScrolledWindow) + : mpScrolledWindow(pScrolledWindow) { last_x = 0; visible = 0; @@ -75,9 +77,9 @@ { last_x = x; visible ^= 1; - wxDC *dc = new wxClientDC(cnvs); + wxDC *dc = new wxClientDC(mpScrolledWindow); int cw, ch; - cnvs->GetClientSize(&cw, &ch); + mpScrolledWindow->GetClientSize(&cw, &ch); dc->SetPen(*wxRED_PEN); dc->SetLogicalFunction(wxXOR); dc->DrawLine(x, 0, x, ch); @@ -104,10 +106,11 @@ int last_x; int visible; - wxScrolledWindow *cnvs; + wxScrolledWindow* mpScrolledWindow; }; - +//***************************************************************************** +//***************************************************************************** class JZSampleWindow : public wxScrolledWindow { friend class JZSampleFrame; @@ -115,7 +118,7 @@ public: - JZSampleWindow(JZSampleFrame *win, JZSample &sample); + JZSampleWindow(JZSampleFrame* pSampleFrame, JZSample& Sample); virtual ~JZSampleWindow(); @@ -150,9 +153,9 @@ private: - JZSampleFrame *win; + JZSampleFrame* mpSampleFrame; - JZSample &spl; + JZSample& spl; int paint_offset; int paint_length; @@ -175,29 +178,30 @@ }; #ifdef OBSOLETE - +//***************************************************************************** +//***************************************************************************** class JZSmplWinSettingsForm : public wxForm { public: - JZSmplWinSettingsForm(JZSampleFrame &w) + JZSmplWinSettingsForm(JZSampleFrame& SampleFrame) : wxForm( USED_WXFORM_BUTTONS ), - win(w) + mpSampleFrame(w) {} void EditForm(wxPanel *panel) { - Add(wxMakeFormBool("Show Midi Time", &win.cnvs->midi_time)); + Add(wxMakeFormBool("Show Midi Time", &mpSampleFrame.cnvs->midi_time)); Add(wxMakeFormNewLine()); AssociatePanel(panel); } void OnOk() { - win.settings = 0; - win.Redraw(); + mpSampleFrame.settings = 0; + mpSampleFrame.Redraw(); wxForm::OnOk(); } void OnCancel() { - win.settings = 0; + mpSampleFrame.settings = 0; wxForm::OnCancel(); } void OnHelp() @@ -205,19 +209,23 @@ gpHelpInstance->ShowTopic("Settings"); } private: - JZSampleFrame &win; + JZSampleFrame& mpSampleFrame; }; - #endif +//***************************************************************************** +//***************************************************************************** class JZSamplePlayPosition : public wxTimer { public: - JZSamplePlayPosition(JZSampleWindow &c, JZPlayer *p, JZSample &s) - : cnvs(c), - player(p), - spl(s) + JZSamplePlayPosition( + JZSampleWindow& SampleWindow, + JZPlayer* pPlayer, + JZSample& Sample) + : cnvs(SampleWindow), + mpPlayer(pPlayer), + spl(Sample) { visible = false; x = 0; @@ -267,7 +275,7 @@ virtual void Notify() { - int pos = player->GetListenerPlayPosition(); + int pos = mpPlayer->GetListenerPlayPosition(); if (pos < 0) { StopListen(); @@ -280,24 +288,26 @@ } private: - JZSampleWindow &cnvs; - JZPlayer *player; - JZSample &spl; + JZSampleWindow& cnvs; + JZPlayer* mpPlayer; + JZSample& spl; bool visible; int x; int fr_smpl; int to_smpl; }; - - -JZSampleWindow::JZSampleWindow(JZSampleFrame *win, JZSample &sample) - : wxScrolledWindow(win), - spl(sample), +//***************************************************************************** +//***************************************************************************** +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +JZSampleWindow::JZSampleWindow(JZSampleFrame* pSampleFrame, JZSample& Sample) + : wxScrolledWindow(pSampleFrame), + mpSampleFrame(pSampleFrame), + spl(Sample), snapsel(this), inspt(this) { - this->win = win; sel_fr = sel_to = -1; mouse_up_sets_insertion_point = 0; playpos = new JZSamplePlayPosition(*this, gpMidiPlayer, spl); @@ -306,13 +316,15 @@ mouse_down = 0; } - +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- JZSampleWindow::~JZSampleWindow() { delete playpos; } - +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void JZSampleWindow::OnSize(int w, int h) { int cw, ch; @@ -323,13 +335,13 @@ AdjustScrollbars(); } - - +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void JZSampleWindow::OnEvent(wxMouseEvent& MouseEvent) { // dont accept mouse events as long as the // array edit is up - if (win->on_accept) + if (mpSampleFrame->on_accept) { return; } @@ -386,7 +398,8 @@ } } - +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void JZSampleWindow::ClearSelection() { if (snapsel.IsSelected()) @@ -402,7 +415,8 @@ sel_fr = sel_to = -1; } - +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void JZSampleWindow::SetInsertionPoint(int offs) { ClearSelection(); @@ -411,7 +425,8 @@ inspt.Draw(x); } - +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void JZSampleWindow::SetSelection(int fr, int to) { ClearSelection(); @@ -430,22 +445,24 @@ snapsel.Draw(*pDc, 0, 0); } - +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- int JZSampleWindow::Sample2Pixel(int sample) { - int offs = win->GetPaintOffset(); - int length = win->GetPaintLength(); + int offs = mpSampleFrame->GetPaintOffset(); + int length = mpSampleFrame->GetPaintLength(); int cw, ch; GetClientSize(&cw, &ch); JZMapper Map(offs, offs + length, 0, cw); return static_cast<int>(Map.XToY(sample)); } - +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- int JZSampleWindow::Pixel2Sample(float pixel) { - int offs = win->GetPaintOffset(); - int length = win->GetPaintLength(); + int offs = mpSampleFrame->GetPaintOffset(); + int length = mpSampleFrame->GetPaintLength(); int cw, ch; GetClientSize(&cw, &ch); JZMapper Map(0, cw, offs, offs + length); @@ -453,13 +470,14 @@ return spl.Align(ofs); } - +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void JZSampleWindow::OnPaint() { - paint_offset = win->GetPaintOffset(); - paint_length = win->GetPaintLength(); + paint_offset = mpSampleFrame->GetPaintOffset(); + paint_length = mpSampleFrame->GetPaintLength(); - wxDC *dc = new wxPaintDC(win); + wxDC *dc = new wxPaintDC(mpSampleFrame); //OBSOLETE dc->BeginDrawing(); if (inspt.IsVisible()) inspt.Draw(); // clear insertion point if there @@ -501,15 +519,16 @@ //OBSOLETE dc->EndDrawing(); } - +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void JZSampleWindow::DrawTicks(int x, int y, int w) { wxDC *dc = new wxClientDC(this); wxFont f = dc->GetFont(); dc->SetFont(*wxSMALL_FONT); - int sfr = win->GetPaintOffset(); - int sto = sfr + win->GetPaintLength(); + int sfr = mpSampleFrame->GetPaintOffset(); + int sto = sfr + mpSampleFrame->GetPaintLength(); if (!midi_time) { @@ -525,12 +544,13 @@ int xx = static_cast<int>(Map.XToY(t)); // draw a tickmark line dc->DrawLine(xx, y - 5, xx, y); + // draw a text - char buf[50]; - sprintf(buf, "%d.%d", sec, mil/100); + wxString Time; + Time << sec << '.' << mil / 100; int fw, fh; - dc->GetTextExtent(buf, &fw, &fh); - dc->DrawText(buf, xx - fw/2, y + 2); + dc->GetTextExtent(Time, &fw, &fh); + dc->DrawText(Time, xx - fw/2, y + 2); } } } @@ -555,14 +575,15 @@ int xx = static_cast<int>(Map.XToY(clock)); // draw a tickmark line dc->DrawLine(xx, y - 5, xx, y); + // draw a text if (j == 0) { - char buf[50]; - sprintf(buf, "%d", i + 1); + wxString String; + String << i + 1; int fw, fh; - dc->GetTextExtent(buf, &fw, &fh); - dc->DrawText(buf, xx - fw/2, y + 2); + dc->GetTextExtent(String, &fw, &fh); + dc->DrawText(String, xx - fw/2, y + 2); } } } @@ -574,7 +595,8 @@ dc->SetFont(f); } - +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void JZSampleWindow::DrawSample(int channel, int x, int y, int w, int h) { const short* data = spl.GetData(); @@ -638,7 +660,8 @@ } } - +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void JZSampleWindow::Play() { if (playpos->IsListening()) @@ -681,7 +704,6 @@ { JZToolBar::eToolBarEnd } }; - int JZSampleFrame::geo[4] = { 30, @@ -692,18 +714,23 @@ JZSample *JZSampleFrame::copy_buffer; -JZSampleFrame::JZSampleFrame(wxWindow* pParent, JZSampleFrame **ref, JZSample& sample) +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +JZSampleFrame::JZSampleFrame( + wxWindow* pParent, + JZSampleFrame **ref, + JZSample& Sample) : wxFrame( pParent, wxID_ANY, - sample.GetFileName(), + Sample.GetFileName(), wxPoint(geo[0], geo[1]), wxSize(geo[2], geo[3])), - spl(sample), - vol_command(sample), - pan_command(sample), - pitch_command(sample), - wah_command(sample) + spl(Sample), + vol_command(Sample), + pan_command(Sample), + pitch_command(Sample), + wah_command(Sample) { this->ref = ref; @@ -828,7 +855,8 @@ OnSize(cw, ch); } - +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- JZSampleFrame::~JZSampleFrame() { *ref = 0; @@ -855,13 +883,15 @@ delete pitch_settings; } - +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- bool JZSampleFrame::OnClose() { return true; } - +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void JZSampleFrame::OnSize(int w, int h) { // constructor finished? @@ -900,12 +930,15 @@ } } - +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void JZSampleFrame::Redraw() { cnvs->Redraw(); } +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- bool JZSampleFrame::HaveInsertionPoint(int &offs, bool warn) { if (cnvs->sel_fr == cnvs->sel_to && cnvs->sel_fr >= 0) @@ -922,7 +955,12 @@ } } -bool JZSampleFrame::HaveSelection(int &fr_smpl, int &to_smpl, HaveSelectionMode mode) +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +bool JZSampleFrame::HaveSelection( + int& fr_smpl, + int& to_smpl, + HaveSelectionMode mode) { if (cnvs->sel_fr < cnvs->sel_to && cnvs->sel_fr >= 0) { @@ -942,7 +980,8 @@ return false; } - +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void JZSampleFrame::AddParam(JZRndArray *array, const char *label) { params[num_params] = new JZArrayEdit(this, *array, 0, 0, 10, 10, 0); @@ -953,7 +992,8 @@ OnSize(cw, ch); } - +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void JZSampleFrame::ClrParam() { if (num_params > 0) @@ -970,21 +1010,28 @@ } } +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void JZSampleFrame::ClearSelection() { cnvs->ClearSelection(); } - -void JZSampleFrame::LoadError(JZSample &spl) +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZSampleFrame::LoadError(JZSample& Sample) { - char buf[500]; - sprintf(buf, "could not load \"%s\"", spl.GetFileName()); - wxMessageBox(buf, "Error", wxOK); + wxString Message; + Message << "Could not load " << Sample.GetFileName(); + ::wxMessageBox(Message, "Error", wxOK); } +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- extern int effect(JZSample &spl); +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void JZSampleFrame::OnMenuCommand(int id) { if (gpMidiPlayer->IsPlaying()) @@ -1395,11 +1442,15 @@ } } +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void JZSampleFrame::PlaySample() { cnvs->Play(); } +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- int JZSampleFrame::GetPaintLength() { // return the visible amount of sample data @@ -1409,7 +1460,8 @@ return spl.Align(len); } - +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- int JZSampleFrame::GetPaintOffset() { // return the visible Offset in sample data @@ -1419,6 +1471,8 @@ return spl.Align(ofs); } +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void JZSampleFrame::SetViewPos(int fr, int to) { JZMapper Map(0, spl.GetLength(), 0, 1000); @@ -1441,6 +1495,8 @@ } #ifdef OBSOLETE +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void JZSampleFrame::OnScroll(wxItem &item) { int zval = zoom_scrol->GetValue(); @@ -1456,6 +1512,8 @@ Redraw(); } +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void JZSampleFrame::ScrollCallback(wxItem &itm, wxCommandEvent& Event) { ((JZSampleFrame *)(itm.GetParent()->GetParent()))->OnScroll(itm); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2010-07-17 16:25:48
|
Revision: 800 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=800&view=rev Author: pstieber Date: 2010-07-17 16:25:40 +0000 (Sat, 17 Jul 2010) Log Message: ----------- 1. Added function comment headers. 2. Changed filename to pFileName. 3. Changed pointer specification format from type * to type*. 4. Changed mem to pMemory. 5. Updated some comments. Modified Paths: -------------- trunk/jazz/src/AudioDriver.cpp Modified: trunk/jazz/src/AudioDriver.cpp =================================================================== --- trunk/jazz/src/AudioDriver.cpp 2010-07-17 16:13:22 UTC (rev 799) +++ trunk/jazz/src/AudioDriver.cpp 2010-07-17 16:25:40 UTC (rev 800) @@ -165,7 +165,8 @@ mAudioEnabled = mAudioEnabled && mInstalled; } - +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- JZAudioPlayer::~JZAudioPlayer() { delete mpListener; @@ -176,17 +177,22 @@ } } - -int JZAudioPlayer::LoadSamples(const char *filename) +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +int JZAudioPlayer::LoadSamples(const char* pFileName) { - return mSamples.Load(filename); + return mSamples.Load(pFileName); } +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- int JZAudioPlayer::RecordMode() const { return mpRecordingInfo != 0 && mpRecordingInfo->mpTrack->GetAudioMode(); } +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void JZAudioPlayer::StartAudio() { if (!mAudioEnabled) @@ -226,7 +232,8 @@ force_read = 1; } - +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void JZAudioPlayer::OpenDsp() { int tmp; @@ -239,14 +246,14 @@ mCanDuplex = gpConfig->GetValue(C_DuplexAudio); // linux driver seems to need some real free memory, which sometimes - // is not available when operating with big samples. So allocate + // is not available when operating with big samples. So allocate // some memory here, touch it and free it. Hopefully libc returns it - // to the system and the driver grabs it on open(). NOT TESTED! + // to the system and the driver grabs it on open(). NOT TESTED! { const int size = 0x10000; // 64K - char *mem = (char *)malloc(size); - memset(mem, 0, size); - free(mem); + char* pMemory = (char *)malloc(size); + memset(pMemory, 0, size); + free(pMemory); } int mode = 0; @@ -317,7 +324,8 @@ } } - +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void JZAudioPlayer::CloseDsp(bool Reset) { if (dev >= 0) @@ -341,7 +349,8 @@ } } - +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void JZAudioPlayer::Notify() { if (mAudioEnabled) @@ -368,7 +377,8 @@ JZSeq2Player::Notify(); } - +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- int JZAudioPlayer::WriteSamples() { if (!mAudioEnabled) @@ -385,13 +395,13 @@ perror("SNDCTL_DSP_GETOSPACE"); } - // todo: this is a bug in the audiodriver in newer kernels (2.1.28) - // and the oss/linux for 2.0.29 it should be - // for (int i = 0; i < info.fragments; i++) + // TODO: This is a bug in the audiodriver in newer kernels (2.1.28) + // and the OSS/Linux for 2.0.29 it should be + // for (int i = 0; i < info.fragments; ++i) for (int i = 0; i < info.fragments - 1; i++) { - JZAudioBuffer *buf = mSamples.full_buffers.Get(); + JZAudioBuffer* buf = mSamples.full_buffers.Get(); if (buf == 0) { break; @@ -407,7 +417,8 @@ return blocks_written; } - +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void JZAudioPlayer::ReadSamples() { audio_buf_info info; @@ -425,12 +436,12 @@ } force_read = 0; - for (int i = 0; i < info.fragments; i++) + for (int i = 0; i < info.fragments; ++i) { - short *b = recbuffers.RequestBuffer()->data; + short* b = recbuffers.RequestBuffer()->data; if (read(dev, b, BUFBYTES) != BUFBYTES) { - // oss bug? It send EINTR?? on first read.. + // OSS bug? It returns EINTR?? on first read. if (errno != EINTR && errno != EAGAIN) { perror("read"); @@ -439,10 +450,10 @@ break; } } - } - +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void JZAudioPlayer::MidiSync() { // OSS is buggy! In Win32 SDK you read the docs, hack away and @@ -512,6 +523,8 @@ } } +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void JZAudioPlayer::StartPlay(long Clock, long LoopClock, int Continue) { delete mpListener; @@ -519,6 +532,8 @@ JZSeq2Player::StartPlay(Clock, LoopClock, Continue); } +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void JZAudioPlayer::StopPlay() { mSamples.StopPlay(); @@ -546,8 +561,8 @@ recbuffers.Clear(); } - - +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void JZAudioPlayer::ListenAudio(int key, int start_stop_mode) { if (!mAudioEnabled) @@ -578,6 +593,8 @@ mpListener = new JZAudioListener(this, key); } +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void JZAudioPlayer::ListenAudio(JZSample &spl, long fr_smpl, long to_smpl) { if (!mAudioEnabled) @@ -598,6 +615,8 @@ mpListener = new JZAudioListener(this, spl, fr_smpl, to_smpl); } +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- long JZAudioPlayer::GetListenerPlayPosition() { if (!mpListener) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2010-07-17 16:13:30
|
Revision: 799 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=799&view=rev Author: pstieber Date: 2010-07-17 16:13:22 +0000 (Sat, 17 Jul 2010) Log Message: ----------- 1. Used MAXERRORLENGTH for error message size instead of a hard-coded 200. 2. Wrapped a line longer than 80 columns. 3. Changed some message box formatting. Modified Paths: -------------- trunk/jazz/src/mswin/WindowsPlayer.cpp Modified: trunk/jazz/src/mswin/WindowsPlayer.cpp =================================================================== --- trunk/jazz/src/mswin/WindowsPlayer.cpp 2010-07-17 15:29:31 UTC (rev 798) +++ trunk/jazz/src/mswin/WindowsPlayer.cpp 2010-07-17 16:13:22 UTC (rev 799) @@ -114,9 +114,9 @@ } if (rc) { - char errtxt[200]; - midiInGetErrorText(rc, (LPSTR)errtxt, sizeof(errtxt)); - wxMessageBox(errtxt, "open midi input", wxOK); + char ErrorMessage[MAXERRORLENGTH]; + midiInGetErrorText(rc, (LPSTR)ErrorMessage, sizeof(ErrorMessage)); + ::wxMessageBox(ErrorMessage, "Open MIDI Input", wxOK); } } @@ -128,12 +128,17 @@ dev = MIDI_MAPPER; //UINT rc = midiOutOpen(&mpState->hout, dev, 0L, 0L, 0L); - UINT rc = midiOutOpen(&mpState->hout, dev, (DWORD)MidiOutProc, (DWORD)mpState, CALLBACK_FUNCTION); + UINT rc = midiOutOpen( + &mpState->hout, + dev, + (DWORD)MidiOutProc, + (DWORD)mpState, + CALLBACK_FUNCTION); if (rc) { - char errtxt[200]; - midiOutGetErrorText(rc, (LPSTR)errtxt, sizeof(errtxt)); - wxMessageBox(errtxt, "open midi output", wxOK); + char ErrorMessage[MAXERRORLENGTH]; + midiOutGetErrorText(rc, (LPSTR)ErrorMessage, sizeof(ErrorMessage)); + ::wxMessageBox(ErrorMessage, "Open MIDI Output", wxOK); } } @@ -148,7 +153,9 @@ timer_installed = TRUE; } if (!timer_installed) - wxMessageBox("could not install timer", "midi timer", wxOK); + { + ::wxMessageBox("Could not install timer", "MIDI timer", wxOK); + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2010-07-17 15:29:41
|
Revision: 798 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=798&view=rev Author: pstieber Date: 2010-07-17 15:29:31 +0000 (Sat, 17 Jul 2010) Log Message: ----------- Changed tAudioBuffer to JZAudioBuffer. Modified Paths: -------------- trunk/jazz/src/AudioDriver.cpp Modified: trunk/jazz/src/AudioDriver.cpp =================================================================== --- trunk/jazz/src/AudioDriver.cpp 2010-07-17 04:35:45 UTC (rev 797) +++ trunk/jazz/src/AudioDriver.cpp 2010-07-17 15:29:31 UTC (rev 798) @@ -391,7 +391,7 @@ for (int i = 0; i < info.fragments - 1; i++) { - tAudioBuffer *buf = mSamples.full_buffers.Get(); + JZAudioBuffer *buf = mSamples.full_buffers.Get(); if (buf == 0) { break; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2010-07-17 04:35:54
|
Revision: 797 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=797&view=rev Author: pstieber Date: 2010-07-17 04:35:45 +0000 (Sat, 17 Jul 2010) Log Message: ----------- Changed mpSampleDialog to mpSamplesDialog. Modified Paths: -------------- trunk/jazz/src/Audio.cpp trunk/jazz/src/Audio.h Modified: trunk/jazz/src/Audio.cpp =================================================================== --- trunk/jazz/src/Audio.cpp 2010-07-17 04:19:30 UTC (rev 796) +++ trunk/jazz/src/Audio.cpp 2010-07-17 04:35:45 UTC (rev 797) @@ -196,7 +196,7 @@ mBitsPerSample(16), softsync(1), - mpSampleDialog(0), + mpSamplesDialog(0), mDefaultFileName("noname.spl"), mRecordFileName("noname.wav") { @@ -822,9 +822,9 @@ //----------------------------------------------------------------------------- void JZSampleSet::EditAudioGlobalSettings(wxWindow* pParent) { - if (mpSampleDialog->IsShown()) + if (mpSamplesDialog->IsShown()) { - mpSampleDialog->SetFocus(); + mpSamplesDialog->SetFocus(); return; } @@ -890,7 +890,7 @@ //----------------------------------------------------------------------------- void JZSampleSet::ClearSampleSet(wxWindow* pParent) { - if (mpSampleDialog == 0) + if (mpSamplesDialog == 0) { if (wxMessageBox("Clear Sample Set?", "Confirm", wxYES_NO) == wxNO) { @@ -1249,7 +1249,7 @@ wxBeginBusyCursor(); set.ReloadSamples(); wxEndBusyCursor(); - set.mpSampleDialog = 0; + set.mpSamplesDialog = 0; // DELETE_THIS(); Destroy(); } @@ -1380,19 +1380,19 @@ //----------------------------------------------------------------------------- void JZSampleSet::SamplesDlg() { - if (mpSampleDialog == 0) + if (mpSamplesDialog == 0) { - mpSampleDialog = new JZSamplesDialog(gpTrackWindow, *this); + mpSamplesDialog = new JZSamplesDialog(gpTrackWindow, *this); } - mpSampleDialog->Show(true); + mpSamplesDialog->Show(true); } //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- void JZSampleSet::RefreshDialogs() { - if (mpSampleDialog) + if (mpSamplesDialog) { -// mpSampleDialog->Sample2Win(mpSampleDialog->current); +// mpSamplesDialog->Sample2Win(mpSamplesDialog->current); } } Modified: trunk/jazz/src/Audio.h =================================================================== --- trunk/jazz/src/Audio.h 2010-07-17 04:19:30 UTC (rev 796) +++ trunk/jazz/src/Audio.h 2010-07-17 04:35:45 UTC (rev 797) @@ -430,7 +430,7 @@ // return the start clock for i-th free buffer long buffers_written; // for computing buffers clock - JZSamplesDialog* mpSampleDialog; + JZSamplesDialog* mpSamplesDialog; JZEventArray* events; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2010-07-17 04:19:37
|
Revision: 796 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=796&view=rev Author: pstieber Date: 2010-07-17 04:19:30 +0000 (Sat, 17 Jul 2010) Log Message: ----------- Changed the way an open samples dialog is handles. Modified Paths: -------------- trunk/jazz/src/Audio.cpp Modified: trunk/jazz/src/Audio.cpp =================================================================== --- trunk/jazz/src/Audio.cpp 2010-07-17 03:49:51 UTC (rev 795) +++ trunk/jazz/src/Audio.cpp 2010-07-17 04:19:30 UTC (rev 796) @@ -822,9 +822,9 @@ //----------------------------------------------------------------------------- void JZSampleSet::EditAudioGlobalSettings(wxWindow* pParent) { - if (mpSampleDialog) + if (mpSampleDialog->IsShown()) { - mpSampleDialog->Show(true); + mpSampleDialog->SetFocus(); return; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2010-07-17 03:49:59
|
Revision: 795 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=795&view=rev Author: pstieber Date: 2010-07-17 03:49:51 +0000 (Sat, 17 Jul 2010) Log Message: ----------- Prefixed class names with JZ instead of t. Modified Paths: -------------- trunk/jazz/src/AboutDialog.cpp trunk/jazz/src/AboutDialog.h trunk/jazz/src/AlsaDriver.cpp trunk/jazz/src/AlsaDriver.h trunk/jazz/src/AlsaPlayer.cpp trunk/jazz/src/AlsaPlayer.h trunk/jazz/src/AlsaThru.cpp trunk/jazz/src/AlsaThru.h trunk/jazz/src/AsciiMidiFile.cpp trunk/jazz/src/AsciiMidiFile.h trunk/jazz/src/Audio.cpp trunk/jazz/src/Audio.h trunk/jazz/src/AudioDriver.cpp trunk/jazz/src/AudioDriver.h trunk/jazz/src/ClockDialog.cpp trunk/jazz/src/ClockDialog.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/DeprecatedStringUtils.cpp trunk/jazz/src/DeprecatedStringUtils.h trunk/jazz/src/Dialogs/AudioSettingsDialog.cpp trunk/jazz/src/Dialogs/AudioSettingsDialog.h trunk/jazz/src/Dialogs/SamplesDialog.cpp trunk/jazz/src/Dialogs/SamplesDialog.h trunk/jazz/src/Dialogs/copyDialog.cpp trunk/jazz/src/Dialogs/copyDialog.h trunk/jazz/src/Dialogs/copyright.cpp trunk/jazz/src/Dialogs/copyright.h trunk/jazz/src/Dialogs/midiThruDialog.cpp trunk/jazz/src/Dialogs/midiThruDialog.h trunk/jazz/src/Dialogs/midiTiming.cpp trunk/jazz/src/Dialogs/midiTiming.h trunk/jazz/src/Dialogs/songSettings.cpp trunk/jazz/src/Dialogs/songSettings.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/EventWindow.cpp 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/Globals.cpp trunk/jazz/src/Globals.h 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/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/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.cpp trunk/jazz/src/PortMidiPlayer.h trunk/jazz/src/Project.cpp trunk/jazz/src/Project.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/ResourceDialog.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/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/SignalInterface.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/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.h trunk/jazz/src/TrackWindow.cpp trunk/jazz/src/commands/copyCommand.cpp trunk/jazz/src/commands/copyCommand.h trunk/jazz/src/midinet.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 trunk/jazz/src/mswin/config.h Modified: trunk/jazz/src/AboutDialog.cpp =================================================================== --- trunk/jazz/src/AboutDialog.cpp 2010-07-13 05:18:08 UTC (rev 794) +++ trunk/jazz/src/AboutDialog.cpp 2010-07-17 03:49:51 UTC (rev 795) @@ -3,7 +3,7 @@ // // Copyright (C) 1994-2000 Andreas Voss and Per Sigmond, all rights reserved. // Modifications Copyright (C) 2004 Patrick Earl -// Modifications Copyright (C) 2008 Peter J. Stieber +// Modifications Copyright (C) 2008-2010 Peter J. Stieber // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by Modified: trunk/jazz/src/AboutDialog.h =================================================================== --- trunk/jazz/src/AboutDialog.h 2010-07-13 05:18:08 UTC (rev 794) +++ trunk/jazz/src/AboutDialog.h 2010-07-17 03:49:51 UTC (rev 795) @@ -3,7 +3,7 @@ // // Copyright (C) 1994-2000 Andreas Voss and Per Sigmond, all rights reserved. // Modifications Copyright (C) 2004 Patrick Earl -// Modifications Copyright (C) 2008 Peter J. Stieber +// Modifications Copyright (C) 2008-2010 Peter J. Stieber // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by Modified: trunk/jazz/src/AlsaDriver.cpp =================================================================== --- trunk/jazz/src/AlsaDriver.cpp 2010-07-13 05:18:08 UTC (rev 794) +++ trunk/jazz/src/AlsaDriver.cpp 2010-07-17 03:49:51 UTC (rev 795) @@ -3,7 +3,7 @@ // // Copyright (C) 1994-2000 Andreas Voss and Per Sigmond, all rights reserved. // Modifications Copyright (C) 2004 Patrick Earl -// Modifications Copyright (C) 2008 Peter J. Stieber +// Modifications Copyright (C) 2008-2010 Peter J. Stieber // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -46,11 +46,11 @@ #define MAX_FRAGS 16 // enough large? -class tAlsaAudioListener : public wxTimer +class JZAlsaAudioListener : public wxTimer { public: - tAlsaAudioListener(tAlsaAudioPlayer* pPlayer, int key) + JZAlsaAudioListener(JZAlsaAudioPlayer* pPlayer, int key) : wxTimer(), mpPlayer(pPlayer), mHardExit(true) @@ -61,14 +61,14 @@ // SYNC seems not to work?? so add 8 more silent buffers // to hear the end of the sample too. - mpPlayer->OpenDsp(tAlsaAudioPlayer::PLAYBACK, 0); + mpPlayer->OpenDsp(JZAlsaAudioPlayer::PLAYBACK, 0); mCount = 8 + mpPlayer->mSamples.PrepareListen(key); Start(20); } - tAlsaAudioListener( - tAlsaAudioPlayer* pPlayer, - tSample& spl, + JZAlsaAudioListener( + JZAlsaAudioPlayer* pPlayer, + JZSample& spl, long fr_smpl, long to_smpl) : wxTimer(), @@ -79,17 +79,17 @@ mpPlayer->mpRecordingInfo = 0; // not recording! mpPlayer->running_mode = 0; - mpPlayer->OpenDsp(tAlsaAudioPlayer::PLAYBACK, 0); + mpPlayer->OpenDsp(JZAlsaAudioPlayer::PLAYBACK, 0); mpPlayer->mSamples.ResetBufferSize( - mpPlayer->frag_byte_size[tAlsaAudioPlayer::PLAYBACK]); + mpPlayer->frag_byte_size[JZAlsaAudioPlayer::PLAYBACK]); mCount = 8 + mpPlayer->mSamples.PrepareListen(&spl, fr_smpl, to_smpl); Start(20); } - ~tAlsaAudioListener() + ~JZAlsaAudioListener() { Stop(); mpPlayer->CloseDsp(mHardExit); @@ -109,12 +109,12 @@ long GetPlayPosition() { - return mpPlayer->GetCurrentPosition(tAlsaAudioPlayer::PLAYBACK); + return mpPlayer->GetCurrentPosition(JZAlsaAudioPlayer::PLAYBACK); } private: - tAlsaAudioPlayer* mpPlayer; + JZAlsaAudioPlayer* mpPlayer; int mCount; @@ -122,10 +122,10 @@ }; -tAlsaAudioPlayer::tAlsaAudioPlayer(JZSong* pSong) - : tAlsaPlayer(pSong) +JZAlsaAudioPlayer::JZAlsaAudioPlayer(JZSong* pSong) + : JZAlsaPlayer(pSong) { - mpAudioBuffer = new tEventArray(); + mpAudioBuffer = new JZEventArray(); mInstalled = false; mAudioEnabled = false; mpListener = 0; @@ -143,7 +143,7 @@ } -tAlsaAudioPlayer::~tAlsaAudioPlayer() +JZAlsaAudioPlayer::~JZAlsaAudioPlayer() { delete mpListener; delete mpAudioBuffer; @@ -160,27 +160,27 @@ } -int tAlsaAudioPlayer::LoadSamples(const char *filename) +int JZAlsaAudioPlayer::LoadSamples(const char *filename) { return mSamples.Load(filename); } -int tAlsaAudioPlayer::RecordMode() const +int JZAlsaAudioPlayer::RecordMode() const { return running_mode & (1 << CAPTURE); } -int tAlsaAudioPlayer::PlayBackMode() const +int JZAlsaAudioPlayer::PlayBackMode() const { return running_mode & (1 << PLAYBACK); } -void tAlsaAudioPlayer::StartPlay(long clock, long loopClock, int cont) +void JZAlsaAudioPlayer::StartPlay(long clock, long loopClock, int cont) { delete mpListener; mSamples.StartPlay(clock); - tAlsaPlayer::StartPlay(clock, loopClock, cont); + JZAlsaPlayer::StartPlay(clock, loopClock, cont); if (!mAudioEnabled) { return; @@ -226,7 +226,7 @@ } -void tAlsaAudioPlayer::StartAudio() +void JZAlsaAudioPlayer::StartAudio() { if (pcm[PLAYBACK]) { @@ -239,7 +239,7 @@ } -void tAlsaAudioPlayer::OpenDsp(int mode, int sync_mode) +void JZAlsaAudioPlayer::OpenDsp(int mode, int sync_mode) { if (!mAudioEnabled) { @@ -361,7 +361,7 @@ } -void tAlsaAudioPlayer::CloseDsp(bool Reset) +void JZAlsaAudioPlayer::CloseDsp(bool Reset) { if (pcm) { @@ -405,7 +405,7 @@ } } -void tAlsaAudioPlayer::Notify() +void JZAlsaAudioPlayer::Notify() { if (mAudioEnabled) { @@ -429,11 +429,11 @@ MidiSync(); } } - tAlsaPlayer::Notify(); + JZAlsaPlayer::Notify(); } // number of frames (or bytes) free -int tAlsaAudioPlayer::GetFreeSpace(int mode) +int JZAlsaAudioPlayer::GetFreeSpace(int mode) { snd_pcm_status_t *info; snd_pcm_status_alloca(&info); @@ -446,7 +446,7 @@ } -int tAlsaAudioPlayer::WriteSamples() +int JZAlsaAudioPlayer::WriteSamples() { if (!mAudioEnabled || pcm[PLAYBACK] == NULL) { @@ -460,7 +460,7 @@ for (; room > frag_size[PLAYBACK]; room -= frag_size[PLAYBACK]) { - tAudioBuffer *buf = mSamples.full_buffers.Get(); + JZAudioBuffer* buf = mSamples.full_buffers.Get(); if (buf == 0) { break; @@ -495,7 +495,7 @@ } -void tAlsaAudioPlayer::ReadSamples() +void JZAlsaAudioPlayer::ReadSamples() { if (!mAudioEnabled || pcm[CAPTURE] == NULL) { @@ -517,9 +517,9 @@ } -void tAlsaAudioPlayer::ResetPlay(long clock) +void JZAlsaAudioPlayer::ResetPlay(long clock) { - tAlsaPlayer::ResetPlay(clock); + JZAlsaPlayer::ResetPlay(clock); if (pcm[PLAYBACK]) { snd_pcm_drop(pcm[PLAYBACK]); @@ -530,12 +530,12 @@ cur_pos = 0; } -long tAlsaAudioPlayer::GetCurrentPosition(int mode) +long JZAlsaAudioPlayer::GetCurrentPosition(int mode) { return cur_scount; } -void tAlsaAudioPlayer::MidiSync() +void JZAlsaAudioPlayer::MidiSync() { if (!mAudioEnabled) { @@ -613,10 +613,10 @@ } } -void tAlsaAudioPlayer::StopPlay() +void JZAlsaAudioPlayer::StopPlay() { mSamples.StopPlay(); - tAlsaPlayer::StopPlay(); + JZAlsaPlayer::StopPlay(); if (!mAudioEnabled) { return; @@ -640,7 +640,7 @@ recbuffers.Clear(); } -void tAlsaAudioPlayer::ListenAudio(int key, int start_stop_mode) +void JZAlsaAudioPlayer::ListenAudio(int key, int start_stop_mode) { if (!mAudioEnabled) { @@ -667,10 +667,10 @@ return; } - mpListener = new tAlsaAudioListener(this, key); + mpListener = new JZAlsaAudioListener(this, key); } -void tAlsaAudioPlayer::ListenAudio(tSample& spl, long fr_smpl, long to_smpl) +void JZAlsaAudioPlayer::ListenAudio(JZSample& spl, long fr_smpl, long to_smpl) { if (!mAudioEnabled) { @@ -688,10 +688,10 @@ { return; } - mpListener = new tAlsaAudioListener(this, spl, fr_smpl, to_smpl); + mpListener = new JZAlsaAudioListener(this, spl, fr_smpl, to_smpl); } -long tAlsaAudioPlayer::GetListenerPlayPosition() +long JZAlsaAudioPlayer::GetListenerPlayPosition() { if (!mpListener) { Modified: trunk/jazz/src/AlsaDriver.h =================================================================== --- trunk/jazz/src/AlsaDriver.h 2010-07-13 05:18:08 UTC (rev 794) +++ trunk/jazz/src/AlsaDriver.h 2010-07-17 03:49:51 UTC (rev 795) @@ -3,7 +3,7 @@ // // Copyright (C) 1994-2000 Andreas Voss and Per Sigmond, all rights reserved. // Modifications Copyright (C) 2004 Patrick Earl -// Modifications Copyright (C) 2008 Peter J. Stieber +// Modifications Copyright (C) 2008-2010 Peter J. Stieber // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -30,22 +30,22 @@ #include <sys/time.h> -class tSample; -class tAlsaAudioListener; +class JZSample; +class JZAlsaAudioListener; -class tAlsaAudioPlayer : public tAlsaPlayer +class JZAlsaAudioPlayer : public JZAlsaPlayer { - friend class tAlsaAudioListener; + friend class JZAlsaAudioListener; public: - tAlsaAudioPlayer(JZSong *song); - virtual ~tAlsaAudioPlayer(); + JZAlsaAudioPlayer(JZSong *song); + virtual ~JZAlsaAudioPlayer(); int LoadSamples(const char *filename); virtual void Notify(); virtual void StartPlay(long Clock, long LoopClock = 0, int Continue = 0); virtual void StopPlay(); virtual bool IsInstalled() { - return mInstalled && tAlsaPlayer::IsInstalled(); + return mInstalled && JZAlsaPlayer::IsInstalled(); } virtual bool GetAudioEnabled() const { @@ -56,7 +56,7 @@ mAudioEnabled = AudioEnabled; } virtual void ListenAudio(int key, int start_stop_mode = 1); - virtual void ListenAudio(tSample &spl, long fr_smpl, long to_smpl); + virtual void ListenAudio(JZSample &spl, long fr_smpl, long to_smpl); virtual bool IsListening() const { return mpListener != 0; @@ -111,8 +111,8 @@ int frame_shift[2]; long frame_boundary[2]; - tAlsaAudioListener* mpListener; - tAudioRecordBuffer recbuffers; + JZAlsaAudioListener* mpListener; + JZAudioRecordBuffer recbuffers; }; #endif // !defined(JZ_ALSADRIVER_H) Modified: trunk/jazz/src/AlsaPlayer.cpp =================================================================== --- trunk/jazz/src/AlsaPlayer.cpp 2010-07-13 05:18:08 UTC (rev 794) +++ trunk/jazz/src/AlsaPlayer.cpp 2010-07-17 03:49:51 UTC (rev 795) @@ -3,7 +3,7 @@ // // Copyright (C) 1994-2000 Andreas Voss and Per Sigmond, all rights reserved. // Modifications Copyright (C) 2004 Patrick Earl -// Modifications Copyright (C) 2008 Peter J. Stieber +// Modifications Copyright (C) 2008-2010 Peter J. Stieber // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -49,7 +49,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -tAlsaPlayer::tAlsaPlayer(JZSong* pSong) +JZAlsaPlayer::JZAlsaPlayer(JZSong* pSong) : JZPlayer(pSong) { ithru = othru = 0; @@ -77,7 +77,7 @@ snd_seq_poll_descriptors(handle, &pfds, 1, POLLIN|POLLOUT); //JAVE seqfd doesnt seem to be used for anything, not here nor in the base - // class JZPlayer(but heavily in tSeq2Player) + // class JZPlayer(but heavily in JZSeq2Player) // seqfd = pfds.fd; // create my input/output port @@ -192,7 +192,7 @@ if (mInstalled) { - thru = new tAlsaThru(); + thru = new JZAlsaThru(); SetSoftThru( gpConfig->GetValue(C_SoftThru), gpConfig->GetValue(C_ThruInput), @@ -202,14 +202,14 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void tAlsaPlayer::clear_input_queue() +void JZAlsaPlayer::clear_input_queue() { snd_seq_drop_input(handle); } //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void tAlsaPlayer::set_pool_sizes() +void JZAlsaPlayer::set_pool_sizes() { if (snd_seq_set_client_pool_output(handle, 2000) < 0) { @@ -227,7 +227,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void tAlsaPlayer::SetSoftThru(int on, int idev, int odev) +void JZAlsaPlayer::SetSoftThru(int on, int idev, int odev) { if (idev != ithru || odev != othru) { @@ -285,7 +285,7 @@ // Description: // Connect output addrs/queue with my client/oport. //----------------------------------------------------------------------------- -void tAlsaPlayer::subscribe_out(int outp) +void JZAlsaPlayer::subscribe_out(int outp) { if ( snd_seq_connect_to( @@ -302,7 +302,7 @@ // Description: // Connect input addrs/queue with my client/iport //----------------------------------------------------------------------------- -void tAlsaPlayer::subscribe_inp(int inp) +void JZAlsaPlayer::subscribe_inp(int inp) { snd_seq_port_subscribe_t* subs; snd_seq_port_subscribe_alloca(&subs); @@ -320,7 +320,7 @@ // Description: // Disconnect output addrs/queue with my client/oport. //----------------------------------------------------------------------------- -void tAlsaPlayer::unsubscribe_out(int outp) +void JZAlsaPlayer::unsubscribe_out(int outp) { if ( snd_seq_disconnect_to( @@ -337,7 +337,7 @@ // Description: // Connect input addrs/queue with my client/iport //----------------------------------------------------------------------------- -void tAlsaPlayer::unsubscribe_inp(int inp) +void JZAlsaPlayer::unsubscribe_inp(int inp) { snd_seq_port_subscribe_t *subs; snd_seq_port_subscribe_alloca(&subs); @@ -355,7 +355,7 @@ // Description: // Set the name of this client. //----------------------------------------------------------------------------- -void tAlsaPlayer::set_client_info(snd_seq_t *handle, const char *name) +void JZAlsaPlayer::set_client_info(snd_seq_t *handle, const char *name) { if (snd_seq_set_client_name(handle, (char *)name) < 0) { @@ -367,7 +367,7 @@ // Description: // Create a new port. //----------------------------------------------------------------------------- -int tAlsaPlayer::create_port(snd_seq_t *handle, const char *name) +int JZAlsaPlayer::create_port(snd_seq_t *handle, const char *name) { return snd_seq_create_simple_port( handle, @@ -381,14 +381,14 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -bool tAlsaPlayer::IsInstalled() +bool JZAlsaPlayer::IsInstalled() { return mInstalled; } //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -tAlsaPlayer::~tAlsaPlayer() +JZAlsaPlayer::~JZAlsaPlayer() { if (thru) { @@ -402,7 +402,7 @@ // 0 = event successfully sent to driver // 1 = try again later //----------------------------------------------------------------------------- -int tAlsaPlayer::OutEvent(JZEvent* pEvent, int now) +int JZAlsaPlayer::OutEvent(JZEvent* pEvent, int now) { int rc = 0; snd_seq_event_t ev; @@ -518,7 +518,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void tAlsaPlayer::OutBreak() +void JZAlsaPlayer::OutBreak() { OutBreak(mOutClock); } @@ -528,7 +528,7 @@ // "echos" are used to synchronize. They are supposed to be read later by // the Notify call chain. //----------------------------------------------------------------------------- -int tAlsaPlayer::compose_echo(int clock, unsigned int arg) +int JZAlsaPlayer::compose_echo(int clock, unsigned int arg) { snd_seq_event_t ev; memset(&ev, 0, sizeof(ev)); @@ -543,7 +543,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void tAlsaPlayer::OutBreak(long clock) +void JZAlsaPlayer::OutBreak(long clock) { while (echo_clock + 48 < clock) { @@ -559,7 +559,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void tAlsaPlayer::StartPlay(long clock, long loopClock, int cont) +void JZAlsaPlayer::StartPlay(long clock, long loopClock, int cont) { recd_clock = clock; echo_clock = clock; @@ -573,7 +573,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void tAlsaPlayer::ResetPlay(long clock) +void JZAlsaPlayer::ResetPlay(long clock) { // Purge queues. snd_seq_drop_output_buffer(handle); @@ -591,12 +591,12 @@ // Notify is periodically called by the timer. It will output events to the // output buffer, and update play_clock and recd_clock //----------------------------------------------------------------------------- -void tAlsaPlayer::Notify() +void JZAlsaPlayer::Notify() { // called by timer long Now = GetRealTimeClock(); - cout << "tAlsaPlayer::Notify " << Now << ' ' << play_clock << endl; + cout << "JZAlsaPlayer::Notify " << Now << ' ' << play_clock << endl; if (Now < 0) { @@ -607,7 +607,7 @@ { // rewind.. // clear and rebuild - cout << "tAlsaPlayer::Notify rewind" << endl; + cout << "JZAlsaPlayer::Notify rewind" << endl; ResetPlay(Now); mPlayBuffer.Clear(); mOutClock = Now + FIRST_DELTACLOCK; @@ -657,7 +657,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void tAlsaPlayer::set_event_header(snd_seq_event_t *ev, long clock, int type) +void JZAlsaPlayer::set_event_header(snd_seq_event_t *ev, long clock, int type) { memset(ev, 0, sizeof(*ev)); snd_seq_ev_set_source(ev, self.port); @@ -669,7 +669,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void tAlsaPlayer::set_event_header( +void JZAlsaPlayer::set_event_header( snd_seq_event_t *ev, long clock, int len, @@ -686,7 +686,7 @@ // Description: // Initialize the alsa timer. //----------------------------------------------------------------------------- -int tAlsaPlayer::start_timer(long clock) +int JZAlsaPlayer::start_timer(long clock) { int time_base = mpSong->GetTicksPerQuarter(); int cur_speed = mpSong->GetTrack(0)->GetCurrentSpeed(clock); @@ -699,7 +699,7 @@ // Description: // Set initial tempo. //----------------------------------------------------------------------------- -void tAlsaPlayer::init_queue_tempo(int time_base, int bpm) +void JZAlsaPlayer::init_queue_tempo(int time_base, int bpm) { snd_seq_queue_tempo_t *qtempo; snd_seq_queue_tempo_alloca(&qtempo); @@ -716,7 +716,7 @@ // Immediately start the alsa queue timer. Do this by sending an "start" // event to the queue. //----------------------------------------------------------------------------- -void tAlsaPlayer::start_queue_timer(long clock) +void JZAlsaPlayer::start_queue_timer(long clock) { stop_queue_timer(); // to be sure @@ -729,17 +729,17 @@ rv = write(&ev, 1); if (rv < 0) { - cout << "tAlsaPlayer::start_queue_timer write failed" << endl; + cout << "JZAlsaPlayer::start_queue_timer write failed" << endl; } snd_seq_ev_set_queue_continue(&ev, queue); rv = write(&ev, 1); if (rv < 0) { - cout << "tAlsaPlayer::start_queue_timer write failed" << endl; + cout << "JZAlsaPlayer::start_queue_timer write failed" << endl; } cout - << "tAlsaPlayer::start_queue_timer added trial-and-error start_queue" + << "JZAlsaPlayer::start_queue_timer added trial-and-error start_queue" << endl; snd_seq_start_queue(handle, queue, NULL); @@ -749,7 +749,7 @@ // Description: // Immediately stop the timer, by sending a stop event to the alsa queue. //----------------------------------------------------------------------------- -void tAlsaPlayer::stop_queue_timer() +void JZAlsaPlayer::stop_queue_timer() { snd_seq_event_t ev; memset(&ev, 0, sizeof(ev)); @@ -767,7 +767,7 @@ // int: // returns a negative value on failure. //----------------------------------------------------------------------------- -int tAlsaPlayer::write(snd_seq_event_t *ev, int now) +int JZAlsaPlayer::write(snd_seq_event_t *ev, int now) { if (now) { @@ -784,14 +784,14 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void tAlsaPlayer::flush_output() +void JZAlsaPlayer::flush_output() { snd_seq_drain_output(handle); } //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -int tAlsaPlayer::set_blocking_mode(int enable) +int JZAlsaPlayer::set_blocking_mode(int enable) { int rc; @@ -805,7 +805,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void tAlsaPlayer::StopPlay() +void JZAlsaPlayer::StopPlay() { JZPlayer::StopPlay(); ResetPlay(0); @@ -818,7 +818,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void tAlsaPlayer::StartAudio() +void JZAlsaPlayer::StartAudio() { } @@ -827,12 +827,12 @@ // Called from GetRealTimeClock. Parses events in the queue. Sets // recd_clock, from event time stamps. //----------------------------------------------------------------------------- -void tAlsaPlayer::recd_event(snd_seq_event_t* ev) +void JZAlsaPlayer::recd_event(snd_seq_event_t* ev) { JZEvent* pEvent = 0; cout - << "tAlsaPlayer::recd_event got " << (int)ev->type + << "JZAlsaPlayer::recd_event got " << (int)ev->type << " (echo is " << SND_SEQ_EVENT_ECHO << ')' << endl; @@ -938,7 +938,7 @@ // looking at time stamps on events in the queue, and also updates the // display, so the name is not well chosen. //----------------------------------------------------------------------------- -long tAlsaPlayer::GetRealTimeClock() +long JZAlsaPlayer::GetRealTimeClock() { // input recorded events (including my echo events) snd_seq_event_t *ie; @@ -960,8 +960,8 @@ // Description: // This function goes through each client, and each port on each client. //----------------------------------------------------------------------------- -void tAlsaPlayer::scan_clients( - tAlsaDeviceList& DeviceList, +void JZAlsaPlayer::scan_clients( + JZAlsaDeviceList& DeviceList, unsigned DeviceCapabilities) { snd_seq_client_info_t *cinfo; @@ -1001,7 +1001,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -int tAlsaPlayer::FindMidiDevice() +int JZAlsaPlayer::FindMidiDevice() { if (mInputDeviceIndex != -1) { @@ -1035,8 +1035,8 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -int tAlsaPlayer::select_list( - tAlsaDeviceList& list, +int JZAlsaPlayer::select_list( + JZAlsaDeviceList& list, const char* title, int def_device) { @@ -1076,7 +1076,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void tAlsaDeviceList::AsciiWrite(const string& Message) +void JZAlsaDeviceList::AsciiWrite(const string& Message) { cout << Message << endl; int i = 0; @@ -1094,7 +1094,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -unsigned tAlsaDeviceList::add(const char* pName, const snd_seq_addr_t& a) +unsigned JZAlsaDeviceList::add(const char* pName, const snd_seq_addr_t& a) { mDeviceNames.push_back(pName); addr.push_back(a); @@ -1103,7 +1103,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -snd_seq_addr_t& tAlsaDeviceList::operator[](unsigned i) +snd_seq_addr_t& JZAlsaDeviceList::operator[](unsigned i) { if (i >= addr.size()) { Modified: trunk/jazz/src/AlsaPlayer.h =================================================================== --- trunk/jazz/src/AlsaPlayer.h 2010-07-13 05:18:08 UTC (rev 794) +++ trunk/jazz/src/AlsaPlayer.h 2010-07-17 03:49:51 UTC (rev 795) @@ -3,7 +3,7 @@ // // Copyright (C) 1994-2000 Andreas Voss and Per Sigmond, all rights reserved. // Modifications Copyright (C) 2004 Patrick Earl -// Modifications Copyright (C) 2008 Peter J. Stieber +// Modifications Copyright (C) 2008-2010 Peter J. Stieber // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -30,7 +30,7 @@ #include <string> -class tAlsaDeviceList : public tDeviceList +class JZAlsaDeviceList : public JZDeviceList { public: unsigned add(const char* pName, const snd_seq_addr_t& a); @@ -42,12 +42,12 @@ -class tAlsaPlayer : public JZPlayer +class JZAlsaPlayer : public JZPlayer { - friend class tAlsaThru; + friend class JZAlsaThru; public: - tAlsaPlayer(JZSong *song); - virtual ~tAlsaPlayer(); + JZAlsaPlayer(JZSong *song); + virtual ~JZAlsaPlayer(); void Notify(); bool IsInstalled(); @@ -60,7 +60,7 @@ { OutEvent(e, 1); } - void OutNow(tParam *r); + void OutNow(JZParam *r); void OutBreak(); void OutBreak(long BreakOver); void StartPlay(long Clock, long LoopClock = 0, int Continue = 0); @@ -71,11 +71,11 @@ { return 1; } - virtual tDeviceList & GetOutputDevices() + virtual JZDeviceList & GetOutputDevices() { return oaddr; } - virtual tDeviceList & GetInputDevices() + virtual JZDeviceList & GetInputDevices() { return iaddr; } @@ -91,8 +91,8 @@ protected: snd_seq_t *handle; - tAlsaDeviceList iaddr; // addresses of input devices - tAlsaDeviceList oaddr; // addresses of output devices + JZAlsaDeviceList iaddr; // addresses of input devices + JZAlsaDeviceList oaddr; // addresses of output devices int client; // me snd_seq_addr_t self; // my address int queue; // queue @@ -111,9 +111,9 @@ void thru_connect(); void thru_disconnect(); void scan_clients( - tAlsaDeviceList& Devicelist, + JZAlsaDeviceList& Devicelist, unsigned DeviceCapabilities); - int select_list(tAlsaDeviceList &list, const char *title, int def_device); + int select_list(JZAlsaDeviceList &list, const char *title, int def_device); int start_timer(long clock); int write(snd_seq_event_t *ev) { @@ -144,7 +144,7 @@ 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 - tAlsaThru *thru; + JZAlsaThru *thru; int ithru, othru; // index in iaddr, oaddr of source/target device }; Modified: trunk/jazz/src/AlsaThru.cpp =================================================================== --- trunk/jazz/src/AlsaThru.cpp 2010-07-13 05:18:08 UTC (rev 794) +++ trunk/jazz/src/AlsaThru.cpp 2010-07-17 03:49:51 UTC (rev 795) @@ -3,7 +3,7 @@ // // Copyright (C) 1994-2000 Andreas Voss and Per Sigmond, all rights reserved. // Modifications Copyright (C) 2004 Patrick Earl -// Modifications Copyright (C) 2008 Peter J. Stieber +// Modifications Copyright (C) 2008-2010 Peter J. Stieber // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -52,13 +52,13 @@ ** with wxwin) that copies from input to output. */ -tAlsaThru::tAlsaThru() +JZAlsaThru::JZAlsaThru() { running = 0; } -tAlsaThru::~tAlsaThru() +JZAlsaThru::~JZAlsaThru() { // Calling Stop() caused the creation of an unkillable process on Mandriva // 2008.0. @@ -67,7 +67,7 @@ } -void tAlsaThru::connect(snd_seq_addr_t &src, snd_seq_addr_t &dest) +void JZAlsaThru::connect(snd_seq_addr_t &src, snd_seq_addr_t &dest) { snd_seq_port_subscribe_t *subs; snd_seq_port_subscribe_alloca(&subs); @@ -77,7 +77,7 @@ perror("subscribe"); } -void tAlsaThru::disconnect(snd_seq_addr_t &src, snd_seq_addr_t &dest) +void JZAlsaThru::disconnect(snd_seq_addr_t &src, snd_seq_addr_t &dest) { snd_seq_port_subscribe_t* subs; snd_seq_port_subscribe_alloca(&subs); @@ -89,14 +89,14 @@ } } -void tAlsaThru::initialize() +void JZAlsaThru::initialize() { if (snd_seq_open(&handle, "hw", SND_SEQ_OPEN_DUPLEX, 0 ) < 0) { perror("open"); exit(1); } - tAlsaPlayer::set_client_info(handle, "Jazz++ Midi Thru"); + JZAlsaPlayer::set_client_info(handle, "Jazz++ Midi Thru"); if (snd_seq_nonblock(handle, 0) < 0) { @@ -105,7 +105,7 @@ } self.client = snd_seq_client_id(handle); - self.port = tAlsaPlayer::create_port(handle, "Input/Output"); + self.port = JZAlsaPlayer::create_port(handle, "Input/Output"); #ifndef USE_DIRECT_CONNECTION connect(source, self); connect(self, destin); @@ -114,7 +114,7 @@ #ifdef USE_DIRECT_CONNECTION -void tAlsaThru::Start() +void JZAlsaThru::Start() { if (! running) { @@ -126,7 +126,7 @@ } // disconnect midi-thru -void tAlsaThru::Stop() +void JZAlsaThru::Stop() { if (running) { @@ -139,7 +139,7 @@ #else // USE_DIRECT_CONNECTION -void tAlsaThru::loop() +void JZAlsaThru::loop() { snd_seq_event_t *ev; while (snd_seq_event_input(handle, &ev) >= 0 && ev != 0) @@ -162,7 +162,7 @@ // thread version -void tAlsaThru::stopworker(int sig) +void JZAlsaThru::stopworker(int sig) { running = 0; snd_seq_close(handle); @@ -170,23 +170,23 @@ } -void * tAlsaThru::startworker(void *p) +void * JZAlsaThru::startworker(void *p) { running = 1; signal(SIGHUP, stopworker); - tAlsaThru *thru = (tAlsaThru *)p; + JZAlsaThru *thru = (JZAlsaThru *)p; thru->initialize(); thru->loop(); return 0; } -void tAlsaThru::Start() +void JZAlsaThru::Start() { if (!running) pthread_create(&worker, (void *)0, startworker, (void *)this); } -void tAlsaThru::Stop() +void JZAlsaThru::Stop() { if (running) pthread_kill(worker, SIGHUP); @@ -200,13 +200,13 @@ static snd_seq_t *static_handle; // ugly!! -void tAlsaThru::stopworker(int sig) +void JZAlsaThru::stopworker(int sig) { snd_seq_close(static_handle); exit(0); } -void tAlsaThru::Start() +void JZAlsaThru::Start() { if (!running) { @@ -230,7 +230,7 @@ } } -void tAlsaThru::Stop() +void JZAlsaThru::Stop() { if (running) { Modified: trunk/jazz/src/AlsaThru.h =================================================================== --- trunk/jazz/src/AlsaThru.h 2010-07-13 05:18:08 UTC (rev 794) +++ trunk/jazz/src/AlsaThru.h 2010-07-17 03:49:51 UTC (rev 795) @@ -3,7 +3,7 @@ // // Copyright (C) 1994-2000 Andreas Voss and Per Sigmond, all rights reserved. // Modifications Copyright (C) 2004 Patrick Earl -// Modifications Copyright (C) 2008 Peter J. Stieber +// Modifications Copyright (C) 2008-2010 Peter J. Stieber // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -41,12 +41,12 @@ // does not work together with wxwin $%! // #include <pthread.h> -class tAlsaThru +class JZAlsaThru { public: - tAlsaThru(); - virtual ~tAlsaThru(); + JZAlsaThru(); + virtual ~JZAlsaThru(); void SetSource(int client, int port) { Modified: trunk/jazz/src/AsciiMidiFile.cpp =================================================================== --- trunk/jazz/src/AsciiMidiFile.cpp 2010-07-13 05:18:08 UTC (rev 794) +++ trunk/jazz/src/AsciiMidiFile.cpp 2010-07-17 03:49:51 UTC (rev 795) @@ -2,7 +2,7 @@ // The JAZZ++ Midi Sequencer // // Copyright (C) 1994-2000 Andreas Voss and Per Sigmond, all rights reserved. -// Modifications Copyright (C) 2008 Peter J. Stieber +// Modifications Copyright (C) 2008-2010 Peter J. Stieber // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by Modified: trunk/jazz/src/AsciiMidiFile.h =================================================================== --- trunk/jazz/src/AsciiMidiFile.h 2010-07-13 05:18:08 UTC (rev 794) +++ trunk/jazz/src/AsciiMidiFile.h 2010-07-17 03:49:51 UTC (rev 795) @@ -2,7 +2,7 @@ // The JAZZ++ Midi Sequencer // // Copyright (C) 1994-2000 Andreas Voss and Per Sigmond, all rights reserved. -// Modifications Copyright (C) 2008 Peter J. Stieber +// Modifications Copyright (C) 2008-2010 Peter J. Stieber // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by Modified: trunk/jazz/src/Audio.cpp =================================================================== --- trunk/jazz/src/Audio.cpp 2010-07-13 05:18:08 UTC (rev 794) +++ trunk/jazz/src/Audio.cpp 2010-07-17 03:49:51 UTC (rev 795) @@ -60,19 +60,19 @@ //***************************************************************************** // Description: // This is the sample voice class declaration. This class is activated via a -// MIDI note on signal. The class copies data from a tSample object to the +// MIDI note on signal. The class copies data from a JZSample object to the // output buffer as needed by the driver. //***************************************************************************** -class tSampleVoice +class JZSampleVoice { public: - tSampleVoice(tSampleSet& s) + JZSampleVoice(JZSampleSet& s) : set(s) { } - void Start(tSample *s, long c) + void Start(JZSample *s, long c) { spl = s; clock = c; @@ -175,9 +175,9 @@ } private: - tSampleSet& set; + JZSampleSet& set; long clock; - tSample* spl; + JZSample* spl; short* data; int first; long length; @@ -188,7 +188,7 @@ //***************************************************************************** //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -tSampleSet::tSampleSet(long tpm) +JZSampleSet::JZSampleSet(long tpm) : mSamplingRate(22050), mChannelCount(1), @@ -206,7 +206,7 @@ for (i = 0; i < BUFCOUNT; i++) { - buffers[i] = new tAudioBuffer(0); + buffers[i] = new JZAudioBuffer(0); } adjust_audio_length = 1; @@ -216,26 +216,26 @@ for (i = 0; i < eSampleCount; i++) { - mSamples[i] = new tSample(*this); - mSampleWindows[i] = 0; + mSamples[i] = new JZSample(*this); + mSampleFrames[i] = 0; } for (i = 0; i < MAXPOLY; i++) { - voices[i] = new tSampleVoice(*this); + voices[i] = new JZSampleVoice(*this); } num_voices = 0; } //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -tSampleSet::~tSampleSet() +JZSampleSet::~JZSampleSet() { int i; for (i = 0; i < eSampleCount; i++) { delete mSamples[i]; - delete mSampleWindows[i]; + delete mSampleFrames[i]; } for (i = 0; i < MAXPOLY; i++) { @@ -249,24 +249,24 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void tSampleSet::Edit(int key) +void JZSampleSet::Edit(int key) { - if (mSampleWindows[key] == 0) + if (mSampleFrames[key] == 0) { - tSample* spl = mSamples[key]; + JZSample* spl = mSamples[key]; - mSampleWindows[key] = new tSampleWin( + mSampleFrames[key] = new JZSampleFrame( gpTrackWindow, - &mSampleWindows[key], + &mSampleFrames[key], *spl); } - mSampleWindows[key]->Show(true); - mSampleWindows[key]->Redraw(); + mSampleFrames[key]->Show(true); + mSampleFrames[key]->Redraw(); } //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void tSampleSet::LoadDefaultSettings() +void JZSampleSet::LoadDefaultSettings() { wxString FileName = FindFile("jazz.spl"); if (!FileName.empty()) @@ -277,7 +277,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -int tSampleSet::Load(const wxString& FileName) +int JZSampleSet::Load(const wxString& FileName) { // Enable audio when loading a sample set. gpMidiPlayer->SetAudioEnabled(true); @@ -337,9 +337,9 @@ << '"'; ::wxMessageBox(String, "Error", wxOK); } - if (mSampleWindows[key]) + if (mSampleFrames[key]) { - mSampleWindows[key]->Redraw(); + mSampleFrames[key]->Redraw(); } } wxEndBusyCursor(); @@ -349,7 +349,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void tSampleSet::ReloadSamples() +void JZSampleSet::ReloadSamples() { for (int i = 0; i < eSampleCount; i++) { @@ -360,7 +360,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -int tSampleSet::Save(const wxString& FileName) +int JZSampleSet::Save(const wxString& FileName) { ofstream Ofs(FileName.c_str()); Ofs @@ -368,7 +368,7 @@ << endl; for (int i = 0; i < eSampleCount; i++) { - tSample* pSample = mSamples[i]; + JZSample* pSample = mSamples[i]; const string& FileName = pSample->GetFileName(); int vol = pSample->GetVolume(); int pan = pSample->GetPan(); @@ -387,7 +387,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -const string& tSampleSet::GetSampleLabel(int Index) +const string& JZSampleSet::GetSampleLabel(int Index) { if (Index >= 0 && Index < eSampleCount) { @@ -399,7 +399,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -int tSampleSet::ResetBuffers(tEventArray *evnt_arr, long clock, long tpm) +int JZSampleSet::ResetBuffers(JZEventArray *evnt_arr, long clock, long tpm) { int i; free_buffers.Clear(); @@ -423,7 +423,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -int tSampleSet::ResetBufferSize(unsigned int bufsize) +int JZSampleSet::ResetBufferSize(unsigned int bufsize) { if (bufsize == 0 || bufsize > BUFBYTES || (bufsize & 1)) { @@ -437,7 +437,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -int tSampleSet::FillBuffers(long last_clock) +int JZSampleSet::FillBuffers(long last_clock) { // check if last_clock is bigger than free buffer space // and compute the count of buffers that can be filled @@ -488,7 +488,7 @@ // add remaining sample data to the buffers for (i = 0; i < nfree; i++) { - tAudioBuffer *buf = free_buffers.Get(); + JZAudioBuffer* buf = free_buffers.Get(); buf->Clear(); long buffer_clock = BufferClock(buffers_written + i); @@ -509,7 +509,7 @@ { if (voices[i]->Finished()) { - tSampleVoice *v = voices[i]; + JZSampleVoice *v = voices[i]; voices[i] = voices[num_voices-1]; voices[num_voices-1] = v; num_voices--; @@ -526,7 +526,7 @@ // Returns the number of buffers containing sound. Fills as many buffers as // possible, the last buffers may contain silence only. //----------------------------------------------------------------------------- -int tSampleSet::PrepareListen(tSample *spl, long fr_smpl, long to_smpl) +int JZSampleSet::PrepareListen(JZSample *spl, long fr_smpl, long to_smpl) { listen_sample = spl; @@ -538,7 +538,7 @@ for (int i = 0; i < nfree; i++) { - tAudioBuffer *buf = free_buffers.Get(); + JZAudioBuffer* buf = free_buffers.Get(); buf->Clear(); if (!voices[0]->Finished()) { @@ -553,22 +553,22 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -int tSampleSet::PrepareListen(int key, long fr_smpl, long to_smpl) +int JZSampleSet::PrepareListen(int key, long fr_smpl, long to_smpl) { - tSample *spl = mSamples[key]; + JZSample *spl = mSamples[key]; return PrepareListen(spl, fr_smpl, to_smpl); } //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -int tSampleSet::ContinueListen() +int JZSampleSet::ContinueListen() { int nfree = free_buffers.Count(); int sound_buffers = 0; for (int i = 0; i < nfree; i++) { - tAudioBuffer *buf = free_buffers.Get(); + JZAudioBuffer* buf = free_buffers.Get(); buf->Clear(); if (!voices[0]->Finished()) { @@ -583,14 +583,14 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void tSampleSet::AdjustAudioLength(JZTrack *t, long tpm) +void JZSampleSet::AdjustAudioLength(JZTrack *t, long tpm) { if (!t->GetAudioMode() || !adjust_audio_length) return; ticks_per_minute = tpm; - tEventIterator it(t); + JZEventIterator it(t); JZEvent *e = it.First(); while (e) { @@ -612,14 +612,14 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void tSampleSet::StartPlay(long clock) +void JZSampleSet::StartPlay(long clock) { ReloadSamples(); // touch all playback sample data, so they may get swapped into memory for (int i = 0; i < eSampleCount; i++) { - tSample *spl = mSamples[i]; + JZSample *spl = mSamples[i]; spl->GotoRAM(); } @@ -628,7 +628,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void tSampleSet::StopPlay() +void JZSampleSet::StopPlay() { is_playing = 0; } @@ -638,15 +638,15 @@ // Description: // This is the sample dialog. //***************************************************************************** -class tSamplesDlg : public wxDialog +class JZSamplesDlg : public wxDialog { - friend class tSampleSet; + friend class JZSampleSet; public: - tSamplesDlg(wxWindow* pParent, tSampleSet& SampleSet); + JZSamplesDlg(wxWindow* pParent, JZSampleSet& SampleSet); - ~tSamplesDlg(); + ~JZSamplesDlg(); #ifdef OBSOLETE static void CloseButton(wxItem &item, wxCommandEvent& event); @@ -668,7 +668,7 @@ private: - tSampleSet &set; + JZSampleSet &set; wxListBox* mpListBox; wxSlider* mpPanSlider; @@ -691,10 +691,10 @@ #ifdef OBSOLETE -class tAudioGloblForm : public wxForm +class JZAudioGloblForm : public wxForm { public: - tAudioGloblForm(tSampleSet &s) + JZAudioGloblForm(JZSampleSet &s) : wxForm( USED_WXFORM_BUTTONS ), mSampleSet(s) { @@ -803,7 +803,7 @@ wxForm::OnCancel(); } private: - tSampleSet& mSampleSet; + JZSampleSet& mSampleSet; wxList strlist; long speed; @@ -820,7 +820,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void tSampleSet::EditAudioGlobalSettings(wxWindow* pParent) +void JZSampleSet::EditAudioGlobalSettings(wxWindow* pParent) { if (mpSampleDialog) { @@ -834,7 +834,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void tSampleSet::EditAudioSamples(wxWindow* pParent) +void JZSampleSet::EditAudioSamples(wxWindow* pParent) { SamplesDlg(); } @@ -842,7 +842,7 @@ //----------------------------------------------------------------------------- // case ID_AUDIO_LOAD_SAMPLE_SET: //----------------------------------------------------------------------------- -void tSampleSet::LoadSampleSet(wxWindow* pParent) +void JZSampleSet::LoadSampleSet(wxWindow* pParent) { wxString FileName = file_selector( mDefaultFileName, @@ -859,7 +859,7 @@ //----------------------------------------------------------------------------- // case ID_AUDIO_SAVE_SAMPLE_SET_AS: //----------------------------------------------------------------------------- -void tSampleSet::SaveSampleSetAs(wxWindow* pParent) +void JZSampleSet::SaveSampleSetAs(wxWindow* pParent) { wxString FileName = file_selector( mDefaultFileName, @@ -876,7 +876,7 @@ //----------------------------------------------------------------------------- // case ID_AUDIO_SAVE_SAMPLE_SET: //----------------------------------------------------------------------------- -void tSampleSet::SaveSampleSet(wxWindow* pParent) +void JZSampleSet::SaveSampleSet(wxWindow* pParent) { if (mDefaultFileName == "noname.spl") { @@ -888,7 +888,7 @@ //----------------------------------------------------------------------------- // case ID_AUDIO_NEW_SAMPLE_SET: //----------------------------------------------------------------------------- -void tSampleSet::ClearSampleSet(wxWindow* pParent) +void JZSampleSet::ClearSampleSet(wxWindow* pParent) { if (mpSampleDialog == 0) { @@ -905,7 +905,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void tSampleSet::SaveRecordingDlg(long frc, long toc, tAudioRecordBuffer &buf) +void JZSampleSet::SaveRecordingDlg(long frc, long toc, JZAudioRecordBuffer &buf) { if (frc >= toc) { @@ -942,10 +942,10 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void tSampleSet::AddNote(const string& FileName, long frc, long toc) +void JZSampleSet::AddNote(const string& FileName, long frc, long toc) { int i; - tSample *spl; + JZSample *spl; // See if the file name is already present in sample list. for (i = 0; i < eSampleCount; i++) @@ -989,7 +989,7 @@ #ifdef OBSOLETE pSong->NewUndoBuffer(); #endif - tEventIterator iter(info->mpTrack); + JZEventIterator iter(info->mpTrack); JZEvent *e = iter.Range(frc, toc); while (e != 0) { @@ -1013,11 +1013,11 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void tSampleSet::SaveWave( +void JZSampleSet::SaveWave( const char *fname, long frc, long toc, - tAudioRecordBuffer &buf) + JZAudioRecordBuffer &buf) { WaveHeader wh; wh.main_chunk = RIFF; @@ -1082,11 +1082,11 @@ // ------------------------------- record ------------------------ // ----------------------------------------------------------------- -DEFINE_ARRAY(tAudioBufferArray, tAudioBuffer *) +DEFINE_ARRAY(JZAudioBufferArray, JZAudioBuffer *) //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void tAudioRecordBuffer::Clear() +void JZAudioRecordBuffer::Clear() { int n = buffers.GetSize(); for (int i = 0; i < n; i++) @@ -1099,10 +1099,10 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -tAudioBuffer * tAudioRecordBuffer::RequestBuffer() +JZAudioBuffer * JZAudioRecordBuffer::RequestBuffer() { if (buffers[num_buffers] == 0) - buffers[num_buffers] = new tAudioBuffer(0); + buffers[num_buffers] = new JZAudioBuffer(0); if (buffers[num_buffers] == 0) { Clear(); @@ -1118,12 +1118,12 @@ #if 0 //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -char* tSamplesDlg::mpSamplePath = 0; -int tSamplesDlg::current = 0; +char* JZSamplesDlg::mpSamplePath = 0; +int JZSamplesDlg::current = 0; //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -tSamplesDlg::tSamplesDlg(wxWindow* pParent, tSampleSet &s) +JZSamplesDlg::JZSamplesDlg(wxWindow* pParent, JZSampleSet &s) : wxDialog(pParent, wxID_ANY, wxString("Sample Settings")), set(s) { @@ -1133,7 +1133,7 @@ } wxArrayString SampleNames; - for (int i = 0; i < tSampleSet::eSampleCount; ++i) + for (int i = 0; i < JZSampleSet::eSampleCount; ++i) { SampleNames.Add(ListEntry(i)); } @@ -1183,7 +1183,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -char* tSamplesDlg::ListEntry(int i) +char* JZSamplesDlg::ListEntry(int i) { ostringstream Oss; Oss << i + 1 << ' ' << set.mSamples[i]->GetLabel(); @@ -1193,9 +1193,9 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void tSamplesDlg::Sample2Win(int i) +void JZSamplesDlg::Sample2Win(int i) { - tSample *spl = set.mSamples[i]; + JZSample *spl = set.mSamples[i]; mpVolumeSlider->SetValue(spl->GetVolume()); mpPitchSlider->SetValue(spl->GetPitch()); mpPanSlider->SetValue(spl->GetPan()); @@ -1207,9 +1207,9 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void tSamplesDlg::Win2Sample(int i) +void JZSamplesDlg::Win2Sample(int i) { - tSample *spl = set.mSamples[i]; + JZSample *spl = set.mSamples[i]; spl->SetPitch(mpPitchSlider->GetValue()); spl->SetVolume(mpVolumeSlider->GetValue()); spl->SetPan(mpPanSlider->GetValue()); @@ -1221,7 +1221,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void tSamplesDlg::SetCurrentListEntry(int i) +void JZSamplesDlg::SetCurrentListEntry(int i) { if (i >= 0) { @@ -1233,13 +1233,13 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -tSamplesDlg::~tSamplesDlg() +JZSamplesDlg::~JZSamplesDlg() { } //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void tSamplesDlg::OnCloseButton() +void JZSamplesDlg::OnCloseButton() { if (set.is_playing) { @@ -1256,7 +1256,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void tSamplesDlg::OnAddButton() +void JZSamplesDlg::OnAddButton() { wxString FileName = file_selector( mpSamplePath, @@ -1278,12 +1278,12 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void tSamplesDlg::OnEditButton() +void JZSamplesDlg::OnEditButton() { wxBeginBusyCursor(); Win2Sample(current); SetCurrentListEntry(current); - tSample *spl = set.mSamples[current]; + JZSample *spl = set.mSamples[current]; spl->Load(); wxEndBusyCursor(); @@ -1292,7 +1292,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void tSamplesDlg::OnPlayButton() +void JZSamplesDlg::OnPlayButton() { if (set.is_playing) { @@ -1305,7 +1305,7 @@ } Win2Sample(current); SetCurrentListEntry(current); - tSample *spl = set.mSamples[current]; + JZSample *spl = set.mSamples[current]; wxBeginBusyCursor(); spl->Load(); gpMidiPlayer->ListenAudio(current); @@ -1314,9 +1314,9 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void tSamplesDlg::OnClrButton() +void JZSamplesDlg::OnClrButton() { - tSample *spl = set.mSamples[current]; + JZSample *spl = set.mSamples[current]; spl->Clear(); SetCurrentListEntry(current); Sample2Win(current); @@ -1324,14 +1324,14 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void tSamplesDlg::OnHelpButton() +void JZSamplesDlg::OnHelpButton() { gpHelpInstance->ShowTopic("Sample Settings"); } //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void tSamplesDlg::OnListClick() +void JZSamplesDlg::OnListClick() { Win2Sample(current); int i = mpListBox->GetSelection(); @@ -1345,40 +1345,40 @@ ... [truncated message content] |
From: <pst...@us...> - 2010-07-13 05:18:14
|
Revision: 794 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=794&view=rev Author: pstieber Date: 2010-07-13 05:18:08 +0000 (Tue, 13 Jul 2010) Log Message: ----------- Changed the comment style from C to C++. Modified Paths: -------------- trunk/jazz/src/Sample.h Modified: trunk/jazz/src/Sample.h =================================================================== --- trunk/jazz/src/Sample.h 2010-07-12 04:26:27 UTC (rev 793) +++ trunk/jazz/src/Sample.h 2010-07-13 05:18:08 UTC (rev 794) @@ -44,7 +44,7 @@ // --------------- stolen from vplay ---------------------- // -------------------------------------------------------- -/* Definitions for Microsoft WAVE format */ +// Definitions for Microsoft WAVE format. #define RIFF 0x46464952 #define WAVE 0x45564157 @@ -61,21 +61,26 @@ // 'old' format for writing .wav files typedef struct _waveheader { - unsigned main_chunk; /* 'RIFF' */ - unsigned length; /* filelen */ - unsigned chunk_type; /* 'WAVE' */ + // 'RIFF' + unsigned main_chunk; - unsigned sub_chunk; /* 'fmt ' */ - unsigned sc_len; /* length of sub_chunk, =16 */ - unsigned short format; /* should be 1 for PCM-code */ - unsigned short modus; /* 1 Mono, 2 Stereo */ - unsigned sample_fq; /* frequence of sample */ + // File length + unsigned length; + + // 'WAVE' + unsigned chunk_type; + + unsigned sub_chunk; // 'fmt ' + unsigned sc_len; // length of sub_chunk, = 16 + unsigned short format; // should be 1 for PCM-code + unsigned short modus; // 1 Mono, 2 Stereo + unsigned sample_fq; unsigned byte_p_sec; - unsigned short byte_p_spl; /* samplesize; 1 or 2 bytes */ - unsigned short bit_p_spl; /* 8, 12 or 16 bit */ + unsigned short byte_p_spl; // samplesize; 1 or 2 bytes + unsigned short bit_p_spl; // 8, 12 or 16 bit - unsigned data_chunk; /* 'data' */ - unsigned data_length; /* # sample bytes */ + unsigned data_chunk; + unsigned data_length; // # sample bytes } WaveHeader; @@ -83,22 +88,20 @@ -/* ---------------------------------------------------------- +//***************************************************************************** +// There are two different kinds of samples, short and float. +// The class hierarchy is a little buggy, they should have been +// derived from a common base. Most of the functionality is in +// the short version. Some functionality is duplicated in +// both classes. +//***************************************************************************** -There are two different kinds of samples, short and float. -The class hierarchy is a little buggy, they should have been -derived from a common base. Most of the functionality is in -the short version. Some functionality is duplicated in -both classes. ----------------------------------------------------------- */ - -/** - * floating point representation of a sample. This simplifies - * algorithms because there is no need to take care of overruns. - * - * used for the 'big' CMIX interface too. - */ - +//***************************************************************************** +// This is the floating-point representation of a sample. This simplifies +// algorithms because there is no need to take care of overruns. +// +// used for the 'big' CMIX interface too. +//***************************************************************************** class tFloatSample // : public tCMIX { friend class tSample; @@ -142,14 +145,16 @@ void RndEcho(int num_echos, int delay, float ampl); void RndEchoStereo(int num_echos, int delay, float ampl); - /** - * see args of tSplFilter::Setup() for this. - */ - void Filter(int fr, int to, tSplFilter::Type type, int order, double freq, double bw); + // see args of tSplFilter::Setup() for this. + void Filter( + int fr, + int to, + tSplFilter::Type type, + int order, + double freq, + double bw); - /** - * signal template classes interface - */ + // signal template classes interface void AssureLength(int new_length); @@ -174,7 +179,7 @@ } protected: - float *data; + float* data; int length; int channels; int sampling_rate; @@ -184,22 +189,18 @@ }; -// ---------------------------------------------------------- - -/** - * contains data for one sample. For fastest playback access - * samples are stored as signed shorts. - * data[0] == 1st value for left channel - * data[1] == 1st value for right channel - * data[n] == 1st value for n-th channel - * data[n+1] == 2nd value for left channel - * ... - * all length values mean number of shorts and - * should be multiples of of set.GetChannelCount(). - * Offsets should start on channel boundaries, - * that is offs % set.GetChannelCount() == 0. - */ - +//***************************************************************************** +// This class contains the data for one sample. For fastest playback access +// samples are stored as signed shorts. +// data[0] == 1st value for left channel +// data[1] == 1st value for right channel +// data[n] == 1st value for n-th channel +// data[n+1] == 2nd value for left channel +// ... +// All length values mean the number of shorts and should be multiples of +// set.GetChannelCount(). Offsets should start on channel boundaries, that is +// offs % set.GetChannelCount() == 0. +//***************************************************************************** class tSample { friend class tFloatSample; @@ -301,9 +302,7 @@ } - /** - * access global adustments from tSampleSet - */ + // access global adustments from tSampleSet tSampleSet &SampleSet() { @@ -319,38 +318,26 @@ int GetSamplingRate() const; - /** - * align offset to channel boundary - */ + // align offset to channel boundary int Align(int offs) const; - /** - * copy part of the data into another tSample o. If o - * contains other data these will be erased. - */ + // copy part of the data into another tSample o. If o + // contains other data these will be erased. void Copy(tSample &dst, int fr_smpl = -1, int to_smpl = -1); - /** - * like Copy but deletes the source selection afterwards. - */ + // like Copy but deletes the source selection afterwards. void Cut(tSample &dst, int fr_smpl = -1, int to_smpl = -1); - /** - * delete part of this sample. - */ + // delete part of this sample. void Delete(int fr_smpl = -1, int to_smpl = -1); - /** - * paste some data into this sample, data are inserted - */ + // paste some data into this sample, data are inserted void PasteIns(tSample &src, int offs); - /** - * paste some data into this sample, data are mixed with - * the current contents. - */ + // paste some data into this sample, data are mixed with + // the current contents. void PasteMix(tSample &src, int offs); void PasteOvr(tSample &src, int fr, int to); void ReplaceSilence(int offs, int len); @@ -358,37 +345,27 @@ void Reverse(int fr, int to); int Peak(); - /** - * flip phase of left/right channel - */ - void Flip(int ch); + // flip phase of left/right channel + void Flip(int ch); void Transpose(float freq_factor); void TransposeSemis(float semis); - /** - * inserts some zero values at pos - */ + // inserts some zero values at pos void InsertSilence(int pos, int length); - /** - * initialize length and data from the float sample - */ + // initialize length and data from the float sample void Set(tFloatSample &fs); - /** - * replace part of the data with the data in fs, - * original data are overwritten. - */ + // replace part of the data with the data in fs, + // original data are overwritten. void Set(tFloatSample &fs, int offs); - /** - * like Set() but try to make a smooth transition - */ + // like Set() but try to make a smooth transition void SetSmooth(tFloatSample &fs, int offs, int fade_len = -1); int Seconds2Samples(float time); @@ -409,7 +386,7 @@ int speed); int length; // number of shorts - short* data; // signed shorts + short* data; // signed shorts tSampleSet& set; std::string mLabel; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |