From: <pst...@us...> - 2010-04-28 23:14:14
|
Revision: 775 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=775&view=rev Author: pstieber Date: 2010-04-28 23:14:07 +0000 (Wed, 28 Apr 2010) Log Message: ----------- Massive curly bracket style update. Modified Paths: -------------- trunk/jazz/src/AlsaDriver.h trunk/jazz/src/AlsaPlayer.h trunk/jazz/src/Command.cpp trunk/jazz/src/ControlEdit.h trunk/jazz/src/DeprecatedWx/prop.cpp trunk/jazz/src/DeprecatedWx/prop.h trunk/jazz/src/DeprecatedWx/propform.h trunk/jazz/src/DeprecatedWx/proplist.h trunk/jazz/src/Dialogs/copyright.cpp trunk/jazz/src/Dialogs/midiThruDialog.cpp trunk/jazz/src/DynamicArray.h trunk/jazz/src/Events.h trunk/jazz/src/Harmony.cpp trunk/jazz/src/HarmonyBrowserAnalyzer.cpp trunk/jazz/src/HarmonyP.cpp trunk/jazz/src/PianoFrame.cpp trunk/jazz/src/Player.h trunk/jazz/src/Random.h trunk/jazz/src/ResourceDialog.h trunk/jazz/src/Rhythm.h trunk/jazz/src/Sample.h 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/Signal2.h trunk/jazz/src/Synth.cpp trunk/jazz/src/Synth.h trunk/jazz/src/Track.h trunk/jazz/src/gui/trackwinEnum.h trunk/jazz/src/mswin/WindowsMidiInterface.cpp trunk/jazz/src/mswin/WindowsMidiInterface.h trunk/jazz/src/mswin/WindowsPlayer.h Modified: trunk/jazz/src/AlsaDriver.h =================================================================== --- trunk/jazz/src/AlsaDriver.h 2010-04-28 21:36:26 UTC (rev 774) +++ trunk/jazz/src/AlsaDriver.h 2010-04-28 23:14:07 UTC (rev 775) @@ -47,8 +47,14 @@ { return mInstalled && tAlsaPlayer::IsInstalled(); } - virtual int GetAudioEnabled() const { return audio_enabled; } - virtual void SetAudioEnabled(int x) { audio_enabled = x; } + virtual int GetAudioEnabled() const + { + return audio_enabled; + } + virtual void SetAudioEnabled(int x) + { + audio_enabled = x; + } virtual void ListenAudio(int key, int start_stop_mode = 1); virtual void ListenAudio(tSample &spl, long fr_smpl, long to_smpl); virtual bool IsListening() const Modified: trunk/jazz/src/AlsaPlayer.h =================================================================== --- trunk/jazz/src/AlsaPlayer.h 2010-04-28 21:36:26 UTC (rev 774) +++ trunk/jazz/src/AlsaPlayer.h 2010-04-28 23:14:07 UTC (rev 775) @@ -52,8 +52,14 @@ void Notify(); bool IsInstalled(); int OutEvent(JZEvent *e, int now); - int OutEvent(JZEvent *e) { return OutEvent(e, 0); } - void OutNow(JZEvent *e) { OutEvent(e, 1); } + int OutEvent(JZEvent *e) + { + return OutEvent(e, 0); + } + void OutNow(JZEvent *e) + { + OutEvent(e, 1); + } void OutNow(tParam *r); void OutBreak(); void OutBreak(long BreakOver); @@ -61,11 +67,26 @@ void StopPlay(); long GetRealTimeClock(); virtual void SetSoftThru(int on, int idev, int odev); - virtual int SupportsMultipleDevices() { return 1; } - virtual tDeviceList & GetOutputDevices() { return oaddr; } - virtual tDeviceList & GetInputDevices() { return iaddr; } - virtual int GetThruInputDevice() { return ithru; } - virtual int GetThruOutputDevice() { return othru; } + virtual int SupportsMultipleDevices() + { + return 1; + } + virtual tDeviceList & GetOutputDevices() + { + return oaddr; + } + virtual tDeviceList & GetInputDevices() + { + return iaddr; + } + virtual int GetThruInputDevice() + { + return ithru; + } + virtual int GetThruOutputDevice() + { + return othru; + } int FindMidiDevice(); protected: @@ -94,7 +115,11 @@ unsigned DeviceCapabilities); int select_list(tAlsaDeviceList &list, const char *title, int def_device); int start_timer(long clock); - int write(snd_seq_event_t *ev) { return write(ev, 0); } // 0 == ok + int write(snd_seq_event_t *ev) + { + // 0 == ok + return write(ev, 0); + } int write(snd_seq_event_t *ev, int now); // 0 == ok void set_event_header(snd_seq_event_t *ev, long clock, int type); void set_event_header(snd_seq_event_t *ev, long clock, int len, void *ptr); Modified: trunk/jazz/src/Command.cpp =================================================================== --- trunk/jazz/src/Command.cpp 2010-04-28 21:36:26 UTC (rev 774) +++ trunk/jazz/src/Command.cpp 2010-04-28 23:14:07 UTC (rev 775) @@ -1099,7 +1099,7 @@ JZKeyOnEvent* pKeyOn = (JZKeyOnEvent *)pEvent->Copy(); int n_th = 0; - // the n'th key from bottom + // the n'th key from bottom for (i = 0; i <= pKeyOn->GetKey(); i++) { n_th += Keys[i]; Modified: trunk/jazz/src/ControlEdit.h =================================================================== --- trunk/jazz/src/ControlEdit.h 2010-04-28 21:36:26 UTC (rev 774) +++ trunk/jazz/src/ControlEdit.h 2010-04-28 23:14:07 UTC (rev 775) @@ -98,7 +98,10 @@ virtual int GetValue(JZEvent *e) = 0; - virtual JZEvent* NewEvent(long clock, int val) { return 0; } + virtual JZEvent* NewEvent(long clock, int val) + { + return 0; + } virtual void OnApply(); virtual void OnRevert(); Modified: trunk/jazz/src/DeprecatedWx/prop.cpp =================================================================== --- trunk/jazz/src/DeprecatedWx/prop.cpp 2010-04-28 21:36:26 UTC (rev 774) +++ trunk/jazz/src/DeprecatedWx/prop.cpp 2010-04-28 23:14:07 UTC (rev 775) @@ -1226,20 +1226,24 @@ wxPropertyValidator::~wxPropertyValidator(void) {} -bool wxPropertyValidator::StringToFloat (wxChar *s, float *number) { +bool wxPropertyValidator::StringToFloat (wxChar *s, float *number) +{ double num; bool ok = StringToDouble (s, &num); *number = (float) num; return ok; } -bool wxPropertyValidator::StringToDouble (wxChar *s, double *number) { +bool wxPropertyValidator::StringToDouble (wxChar *s, double *number) +{ bool ok = true; wxChar *value_ptr; *number = wxStrtod (s, &value_ptr); - if (value_ptr) { + if (value_ptr) + { int len = wxStrlen (value_ptr); - for (int i = 0; i < len; i++) { + for (int i = 0; i < len; i++) + { ok = (wxIsspace (value_ptr[i]) != 0); if (!ok) return false; } @@ -1247,20 +1251,24 @@ return ok; } -bool wxPropertyValidator::StringToInt (wxChar *s, int *number) { +bool wxPropertyValidator::StringToInt (wxChar *s, int *number) +{ long num; bool ok = StringToLong (s, &num); *number = (int) num; return ok; } -bool wxPropertyValidator::StringToLong (wxChar *s, long *number) { +bool wxPropertyValidator::StringToLong (wxChar *s, long *number) +{ bool ok = true; wxChar *value_ptr; *number = wxStrtol (s, &value_ptr, 10); - if (value_ptr) { + if (value_ptr) + { int len = wxStrlen (value_ptr); - for (int i = 0; i < len; i++) { + for (int i = 0; i < len; i++) + { ok = (wxIsspace (value_ptr[i]) != 0); if (!ok) return false; } @@ -1268,26 +1276,30 @@ return ok; } -wxChar *wxPropertyValidator::FloatToString (float number) { +wxChar *wxPropertyValidator::FloatToString (float number) +{ static wxChar buf[20]; wxSnprintf (buf, 20, wxT("%.6g"), number); return buf; } -wxChar *wxPropertyValidator::DoubleToString (double number) { +wxChar *wxPropertyValidator::DoubleToString (double number) +{ static wxChar buf[20]; wxSnprintf (buf, 20, wxT("%.6g"), number); return buf; } -wxChar *wxPropertyValidator::IntToString (int number) { +wxChar *wxPropertyValidator::IntToString (int number) +{ static wxChar buf[20]; wxSprintf (buf, wxT("%d"), number); return buf; } -wxChar *wxPropertyValidator::LongToString (long number) { +wxChar *wxPropertyValidator::LongToString (long number) +{ static wxChar buf[20]; wxSprintf (buf, wxT("%ld"), number); Modified: trunk/jazz/src/DeprecatedWx/prop.h =================================================================== --- trunk/jazz/src/DeprecatedWx/prop.h 2010-04-28 21:36:26 UTC (rev 774) +++ trunk/jazz/src/DeprecatedWx/prop.h 2010-04-28 23:14:07 UTC (rev 775) @@ -112,15 +112,22 @@ ~wxPropertyView(); // Associates and shows the view - virtual void ShowView(wxPropertySheet *WXUNUSED(propertySheet), wxWindow *WXUNUSED(panel)) {} + virtual void ShowView(wxPropertySheet *WXUNUSED(propertySheet), wxWindow *WXUNUSED(panel)) + { + } // Update this view of the viewed object, called e.g. by // the object itself. - virtual bool OnUpdateView() {return false;}; + virtual bool OnUpdateView() + { + return false; + } // Override this to do something as soon as the property changed, // if the view and validators support it. - virtual void OnPropertyChanged(wxProperty *WXUNUSED(property)) {} + virtual void OnPropertyChanged(wxProperty *WXUNUSED(property)) + { + } virtual void AddRegistry(wxPropertyValidatorRegistry *registry); inline @@ -175,9 +182,18 @@ wxPropertyValidator(long flags = 0); ~wxPropertyValidator(); - inline long GetFlags() const { return m_validatorFlags; } - inline void SetValidatorProperty(wxProperty *prop) { m_validatorProperty = prop; } - inline wxProperty *GetValidatorProperty(void) const { return m_validatorProperty; } + inline long GetFlags() const + { + return m_validatorFlags; + } + inline void SetValidatorProperty(wxProperty *prop) + { + m_validatorProperty = prop; + } + inline wxProperty *GetValidatorProperty(void) const + { + return m_validatorProperty; + } virtual bool StringToFloat (wxChar *s, float *number); virtual bool StringToDouble (wxChar *s, double *number); @@ -226,19 +242,20 @@ * Property value class */ -typedef enum { - wxPropertyValueNull, - wxPropertyValueInteger, - wxPropertyValueReal, - wxPropertyValuebool, - wxPropertyValueString, - wxPropertyValueList, - wxPropertyValueIntegerPtr, - wxPropertyValueLongPtr, - wxPropertyValueRealPtr, - wxPropertyValueDoublePtr, - wxPropertyValueboolPtr, - wxPropertyValueStringPtr +typedef enum +{ + wxPropertyValueNull, + wxPropertyValueInteger, + wxPropertyValueReal, + wxPropertyValuebool, + wxPropertyValueString, + wxPropertyValueList, + wxPropertyValueIntegerPtr, + wxPropertyValueLongPtr, + wxPropertyValueRealPtr, + wxPropertyValueDoublePtr, + wxPropertyValueboolPtr, + wxPropertyValueStringPtr } wxPropertyValueType; class wxPropertyValue: public wxObject @@ -266,8 +283,14 @@ ~wxPropertyValue(void); - virtual inline wxPropertyValueType Type(void) const { return m_type; } - virtual inline void SetType(wxPropertyValueType typ) { m_type = typ; } + virtual inline wxPropertyValueType Type(void) const + { + return m_type; + } + virtual inline void SetType(wxPropertyValueType typ) + { + m_type = typ; + } virtual long IntegerValue(void) const; virtual float RealValue(void) const; virtual bool BoolValue(void) const; @@ -316,13 +339,25 @@ // Clear list virtual void ClearList(void); - virtual inline void SetClientData(wxObject *data) { m_clientData = data; } - virtual inline wxObject *GetClientData(void) { return m_clientData; } + virtual inline void SetClientData(wxObject *data) + { + m_clientData = data; + } + virtual inline wxObject *GetClientData(void) + { + return m_clientData; + } virtual wxString GetStringRepresentation(void); - inline void SetModified(bool flag = true) { m_modifiedFlag = flag; } - inline bool GetModified(void) { return m_modifiedFlag; } + inline void SetModified(bool flag = true) + { + m_modifiedFlag = flag; + } + inline bool GetModified(void) + { + return m_modifiedFlag; + } // Operators void operator=(const wxPropertyValue& val); @@ -343,7 +378,8 @@ wxPropertyValueType m_type; bool m_modifiedFlag; - union { + union + { long integer; // Also doubles as bool wxChar* string; float real; @@ -392,11 +428,23 @@ virtual void SetName(wxString& nm); virtual void SetRole(wxString& role); void operator=(const wxPropertyValue& val); - virtual inline void SetWindow(wxWindow *win) { m_propertyWindow = win; } - virtual inline wxWindow *GetWindow(void) const { return m_propertyWindow; } + virtual inline void SetWindow(wxWindow *win) + { + m_propertyWindow = win; + } + virtual inline wxWindow *GetWindow(void) const + { + return m_propertyWindow; + } - inline void Enable(bool en) { m_enabled = en; } - inline bool IsEnabled(void) const { return m_enabled; } + inline void Enable(bool en) + { + m_enabled = en; + } + inline bool IsEnabled(void) const + { + return m_enabled; + } }; inline Modified: trunk/jazz/src/DeprecatedWx/propform.h =================================================================== --- trunk/jazz/src/DeprecatedWx/propform.h 2010-04-28 21:36:26 UTC (rev 774) +++ trunk/jazz/src/DeprecatedWx/propform.h 2010-04-28 23:14:07 UTC (rev 775) @@ -74,15 +74,36 @@ // Extend event processing to process OnCommand virtual bool ProcessEvent(wxEvent& event); - inline virtual void AssociatePanel(wxWindow *win) { m_propertyWindow = win; } - inline virtual wxWindow *GetPanel(void) const { return m_propertyWindow; } + inline virtual void AssociatePanel(wxWindow *win) + { + m_propertyWindow = win; + } + inline virtual wxWindow *GetPanel(void) const + { + return m_propertyWindow; + } - inline virtual void SetManagedWindow(wxWindow *win) { m_managedWindow = win; } - inline virtual wxWindow *GetManagedWindow(void) const { return m_managedWindow; } + inline virtual void SetManagedWindow(wxWindow *win) + { + m_managedWindow = win; + } + inline virtual wxWindow *GetManagedWindow(void) const + { + return m_managedWindow; + } - inline virtual wxButton *GetWindowCloseButton() const { return m_windowCloseButton; } - inline virtual wxButton *GetWindowCancelButton() const { return m_windowCancelButton; } - inline virtual wxButton *GetHelpButton() const { return m_windowHelpButton; } + inline virtual wxButton *GetWindowCloseButton() const + { + return m_windowCloseButton; + } + inline virtual wxButton *GetWindowCancelButton() const + { + return m_windowCancelButton; + } + inline virtual wxButton *GetHelpButton() const + { + return m_windowHelpButton; + } public: static bool sm_dialogCancelled; @@ -121,13 +142,20 @@ DECLARE_DYNAMIC_CLASS(wxPropertyFormValidator) protected: public: - wxPropertyFormValidator(long flags = 0): wxPropertyValidator(flags) { } - ~wxPropertyFormValidator(void) {} + wxPropertyFormValidator(long flags = 0): wxPropertyValidator(flags) + { + } + ~wxPropertyFormValidator(void) + { + } // Called to check value is OK (e.g. when OK is pressed) // Return false if value didn't check out; signal to restore old value. virtual bool OnCheckValue( wxProperty *WXUNUSED(property), wxPropertyFormView *WXUNUSED(view), - wxWindow *WXUNUSED(parentWindow) ) { return true; } + wxWindow *WXUNUSED(parentWindow) ) + { + return true; + } // Does the transferance from the property editing area to the property itself. // Called by the view, e.g. when closing the window. @@ -137,13 +165,21 @@ virtual bool OnDisplayValue(wxProperty *property, wxPropertyFormView *view, wxWindow *parentWindow) = 0; virtual void OnDoubleClick( wxProperty *WXUNUSED(property), wxPropertyFormView *WXUNUSED(view), - wxWindow *WXUNUSED(parentWindow) ) { } + wxWindow *WXUNUSED(parentWindow) ) + { + } virtual void OnSetFocus( wxProperty *WXUNUSED(property), wxPropertyFormView *WXUNUSED(view), - wxWindow *WXUNUSED(parentWindow) ) { } + wxWindow *WXUNUSED(parentWindow) ) + { + } virtual void OnKillFocus( wxProperty *WXUNUSED(property), wxPropertyFormView *WXUNUSED(view), - wxWindow *WXUNUSED(parentWindow) ) { } + wxWindow *WXUNUSED(parentWindow) ) + { + } virtual void OnCommand( wxProperty *WXUNUSED(property), wxPropertyFormView *WXUNUSED(view), - wxWindow *WXUNUSED(parentWindow), wxCommandEvent& WXUNUSED(event) ) {} + wxWindow *WXUNUSED(parentWindow), wxCommandEvent& WXUNUSED(event) ) + { + } private: }; @@ -160,7 +196,9 @@ { m_realMin = min; m_realMax = max; } - ~wxRealFormValidator(void) {} + ~wxRealFormValidator(void) + { + } bool OnCheckValue(wxProperty *property, wxPropertyFormView *view, wxWindow *parentWindow); bool OnRetrieveValue(wxProperty *property, wxPropertyFormView *view, wxWindow *parentWindow); @@ -181,7 +219,9 @@ { m_integerMin = min; m_integerMax = max; } - ~wxIntegerFormValidator(void) {} + ~wxIntegerFormValidator(void) + { + } bool OnCheckValue(wxProperty *property, wxPropertyFormView *view, wxWindow *parentWindow); bool OnRetrieveValue(wxProperty *property, wxPropertyFormView *view, wxWindow *parentWindow); @@ -200,7 +240,9 @@ wxBoolFormValidator(long flags = 0):wxPropertyFormValidator(flags) { } - ~wxBoolFormValidator(void) {} + ~wxBoolFormValidator(void) + { + } bool OnCheckValue(wxProperty *property, wxPropertyFormView *view, wxWindow *parentWindow); bool OnRetrieveValue(wxProperty *property, wxPropertyFormView *view, wxWindow *parentWindow); @@ -278,8 +320,14 @@ // Extend event processing to search the view's event table virtual bool ProcessEvent(wxEvent& event); - void SetView(wxPropertyFormView* view) { m_view = view; } - wxPropertyFormView* GetView() const { return m_view; } + void SetView(wxPropertyFormView* view) + { + m_view = view; + } + wxPropertyFormView* GetView() const + { + return m_view; + } private: wxPropertyFormView* m_view; @@ -311,7 +359,10 @@ // Must call this to create panel and associate view virtual bool Initialize(void); virtual wxPanel *OnCreatePanel(wxFrame *parent, wxPropertyFormView *v); - inline virtual wxPanel *GetPropertyPanel(void) const { return m_propertyPanel; } + inline virtual wxPanel *GetPropertyPanel(void) const + { + return m_propertyPanel; + } private: wxPropertyFormView* m_view; Modified: trunk/jazz/src/DeprecatedWx/proplist.h =================================================================== --- trunk/jazz/src/DeprecatedWx/proplist.h 2010-04-28 21:36:26 UTC (rev 774) +++ trunk/jazz/src/DeprecatedWx/proplist.h 2010-04-28 23:14:07 UTC (rev 775) @@ -144,23 +144,65 @@ void OnEdit(wxCommandEvent& event); void OnText(wxCommandEvent& event); - inline virtual wxListBox *GetPropertyScrollingList() const { return m_propertyScrollingList; } - inline virtual wxListBox *GetValueList() const { return m_valueList; } - inline virtual wxTextCtrl *GetValueText() const { return m_valueText; } - inline virtual wxButton *GetConfirmButton() const { return m_confirmButton; } - inline virtual wxButton *GetCancelButton() const { return m_cancelButton; } - inline virtual wxButton *GetEditButton() const { return m_editButton; } - inline virtual bool GetDetailedEditing(void) const { return m_detailedEditing; } + inline virtual wxListBox *GetPropertyScrollingList() const + { + return m_propertyScrollingList; + } + inline virtual wxListBox *GetValueList() const + { + return m_valueList; + } + inline virtual wxTextCtrl *GetValueText() const + { + return m_valueText; + } + inline virtual wxButton *GetConfirmButton() const + { + return m_confirmButton; + } + inline virtual wxButton *GetCancelButton() const + { + return m_cancelButton; + } + inline virtual wxButton *GetEditButton() const + { + return m_editButton; + } + inline virtual bool GetDetailedEditing(void) const + { + return m_detailedEditing; + } - inline virtual void AssociatePanel(wxPanel *win) { m_propertyWindow = win; } - inline virtual wxPanel *GetPanel(void) const { return m_propertyWindow; } + inline virtual void AssociatePanel(wxPanel *win) + { + m_propertyWindow = win; + } + inline virtual wxPanel *GetPanel(void) const + { + return m_propertyWindow; + } - inline virtual void SetManagedWindow(wxWindow *win) { m_managedWindow = win; } - inline virtual wxWindow *GetManagedWindow(void) const { return m_managedWindow; } + inline virtual void SetManagedWindow(wxWindow *win) + { + m_managedWindow = win; + } + inline virtual wxWindow *GetManagedWindow(void) const + { + return m_managedWindow; + } - inline virtual wxButton *GetWindowCloseButton() const { return m_windowCloseButton; } - inline virtual wxButton *GetWindowCancelButton() const { return m_windowCancelButton; } - inline virtual wxButton *GetHelpButton() const { return m_windowHelpButton; } + inline virtual wxButton *GetWindowCloseButton() const + { + return m_windowCloseButton; + } + inline virtual wxButton *GetWindowCancelButton() const + { + return m_windowCancelButton; + } + inline virtual wxButton *GetHelpButton() const + { + return m_windowHelpButton; + } bool OnClose(void); @@ -223,8 +265,12 @@ class WXDLLIMPEXP_DEPRECATED wxPropertyListValidator: public wxPropertyValidator { public: - wxPropertyListValidator(long flags = wxPROP_ALLOW_TEXT_EDITING): wxPropertyValidator(flags) { } - ~wxPropertyListValidator() {} + wxPropertyListValidator(long flags = wxPROP_ALLOW_TEXT_EDITING): wxPropertyValidator(flags) + { + } + ~wxPropertyListValidator() + { + } // Called when the property is selected or deselected: typically displays the value // in the edit control (having chosen a suitable control to display: (non)editable text or listbox) @@ -329,8 +375,14 @@ ~wxPropertyListPanel(); void OnDefaultAction(wxControl *item); - inline void SetView(wxPropertyListView* v) { m_view = v; } - inline wxPropertyListView* GetView() const { return m_view; } + inline void SetView(wxPropertyListView* v) + { + m_view = v; + } + inline wxPropertyListView* GetView() const + { + return m_view; + } // Extend event processing to search the view's event table virtual bool ProcessEvent(wxEvent& event); @@ -370,8 +422,14 @@ // Must call this to create panel and associate view virtual bool Initialize(void); virtual wxPropertyListPanel *OnCreatePanel(wxFrame *parent, wxPropertyListView *v); - inline virtual wxPropertyListPanel *GetPropertyPanel(void) const { return m_propertyPanel; } - inline wxPropertyListView* GetView() const { return m_view; } + inline virtual wxPropertyListPanel *GetPropertyPanel(void) const + { + return m_propertyPanel; + } + inline wxPropertyListView* GetView() const + { + return m_view; + } private: wxPropertyListView* m_view; @@ -392,7 +450,9 @@ // 0.0, 0.0 means no range wxRealListValidator(float min = 0.0, float max = 0.0, long flags = wxPROP_ALLOW_TEXT_EDITING):wxPropertyListValidator(flags) { m_realMin = min; m_realMax = max; } - ~wxRealListValidator() {} + ~wxRealListValidator() + { + } bool OnPrepareControls(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); @@ -421,7 +481,9 @@ { m_integerMin = min; m_integerMax = max; } - ~wxIntegerListValidator() {} + ~wxIntegerListValidator() + { + } bool OnPrepareControls(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); @@ -445,8 +507,12 @@ class WXDLLIMPEXP_DEPRECATED wxBoolListValidator: public wxPropertyListValidator { public: - wxBoolListValidator(long flags = 0):wxPropertyListValidator(flags) {} - ~wxBoolListValidator() {} + wxBoolListValidator(long flags = 0):wxPropertyListValidator(flags) + { + } + ~wxBoolListValidator() + { + } bool OnPrepareControls(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); bool OnPrepareDetailControls(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); @@ -562,7 +628,9 @@ { public: wxListOfStringsListValidator(long flags = 0); - ~wxListOfStringsListValidator() {} + ~wxListOfStringsListValidator() + { + } bool OnPrepareControls(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); Modified: trunk/jazz/src/Dialogs/copyright.cpp =================================================================== --- trunk/jazz/src/Dialogs/copyright.cpp 2010-04-28 21:36:26 UTC (rev 774) +++ trunk/jazz/src/Dialogs/copyright.cpp 2010-04-28 23:14:07 UTC (rev 775) @@ -52,7 +52,8 @@ sheet->AddProperty(copyrightProp); } -bool tCopyrightDlg::OnClose(){ +bool tCopyrightDlg::OnClose() +{ song->GetTrack(0)->SetCopyright(copyrightProp->GetValue().StringValue() ); return FALSE; } Modified: trunk/jazz/src/Dialogs/midiThruDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/midiThruDialog.cpp 2010-04-28 21:36:26 UTC (rev 774) +++ trunk/jazz/src/Dialogs/midiThruDialog.cpp 2010-04-28 23:14:07 UTC (rev 775) @@ -65,7 +65,8 @@ void tMidiThruDlg::EditForm(wxPanel *panel) { - if (Midi->SupportsMultipleDevices()) { + if (Midi->SupportsMultipleDevices()) + { Add(InputDeviceChoice.mkFormItem(300, 50)); Add(wxMakeFormNewLine()); Add(OutputDeviceChoice.mkFormItem(300, 50)); Modified: trunk/jazz/src/DynamicArray.h =================================================================== --- trunk/jazz/src/DynamicArray.h 2010-04-28 21:36:26 UTC (rev 774) +++ trunk/jazz/src/DynamicArray.h 2010-04-28 23:14:07 UTC (rev 775) @@ -216,8 +216,14 @@ JZIntArray mArray; // this works for sizeof(int) >= 4 - int index(int i) { return i >> 5; } - int mask(int i) { return 1 << (i & 31); } + int index(int i) + { + return i >> 5; + } + int mask(int i) + { + return 1 << (i & 31); + } }; Modified: trunk/jazz/src/Events.h =================================================================== --- trunk/jazz/src/Events.h 2010-04-28 21:36:26 UTC (rev 774) +++ trunk/jazz/src/Events.h 2010-04-28 23:14:07 UTC (rev 775) @@ -363,32 +363,110 @@ return (mClock & KILLED_CLOCK) != 0; } - virtual JZMetaEvent* IsMetaEvent() { return 0; } - virtual JZChannelEvent* IsChannelEvent() { return 0; } - virtual JZKeyOnEvent* IsKeyOn() { return 0; } - virtual JZKeyOffEvent* IsKeyOff() { return 0; } - virtual JZPitchEvent* IsPitch() { return 0; } - virtual JZControlEvent* IsControl() { return 0; } - virtual JZProgramEvent* IsProgram() { return 0; } - virtual JZSysExEvent* IsSysEx() { return 0; } - virtual JZSongPtrEvent* IsSongPtr() { return 0; } - virtual JZMidiClockEvent* IsMidiClock() { return 0; } - virtual JZStartPlayEvent* IsStartPlay() { return 0; } - virtual JZContPlayEvent* IsContPlay() { return 0; } - virtual JZStopPlayEvent* IsStopPlay() { return 0; } - virtual JZTextEvent* IsText() { return 0; } - virtual JZCopyrightEvent* IsCopyright() { return 0; } - virtual JZTrackNameEvent* IsTrackName() { return 0; } - virtual JZMarkerEvent* IsMarker() { return 0; } - virtual JZSetTempoEvent* IsSetTempo() { return 0; } - virtual JZMtcOffsetEvent* IsMtcOffset() { return 0; } - virtual JZTimeSignatEvent* IsTimeSignat() { return 0; } - virtual JZKeySignatEvent* IsKeySignat() { return 0; } - virtual JZKeyPressureEvent* IsKeyPressure() { return 0; } - virtual JZJazzMetaEvent* IsJazzMeta() { return 0; } - virtual JZPlayTrackEvent* IsPlayTrack() { return 0; } - virtual JZEndOfTrackEvent* IsEndOfTrack() { return 0; } - virtual JZChnPressureEvent* IsChnPressure() { return 0; } + virtual JZMetaEvent* IsMetaEvent() + { + return 0; + } + virtual JZChannelEvent* IsChannelEvent() + { + return 0; + } + virtual JZKeyOnEvent* IsKeyOn() + { + return 0; + } + virtual JZKeyOffEvent* IsKeyOff() + { + return 0; + } + virtual JZPitchEvent* IsPitch() + { + return 0; + } + virtual JZControlEvent* IsControl() + { + return 0; + } + virtual JZProgramEvent* IsProgram() + { + return 0; + } + virtual JZSysExEvent* IsSysEx() + { + return 0; + } + virtual JZSongPtrEvent* IsSongPtr() + { + return 0; + } + virtual JZMidiClockEvent* IsMidiClock() + { + return 0; + } + virtual JZStartPlayEvent* IsStartPlay() + { + return 0; + } + virtual JZContPlayEvent* IsContPlay() + { + return 0; + } + virtual JZStopPlayEvent* IsStopPlay() + { + return 0; + } + virtual JZTextEvent* IsText() + { + return 0; + } + virtual JZCopyrightEvent* IsCopyright() + { + return 0; + } + virtual JZTrackNameEvent* IsTrackName() + { + return 0; + } + virtual JZMarkerEvent* IsMarker() + { + return 0; + } + virtual JZSetTempoEvent* IsSetTempo() + { + return 0; + } + virtual JZMtcOffsetEvent* IsMtcOffset() + { + return 0; + } + virtual JZTimeSignatEvent* IsTimeSignat() + { + return 0; + } + virtual JZKeySignatEvent* IsKeySignat() + { + return 0; + } + virtual JZKeyPressureEvent* IsKeyPressure() + { + return 0; + } + virtual JZJazzMetaEvent* IsJazzMeta() + { + return 0; + } + virtual JZPlayTrackEvent* IsPlayTrack() + { + return 0; + } + virtual JZEndOfTrackEvent* IsEndOfTrack() + { + return 0; + } + virtual JZChnPressureEvent* IsChnPressure() + { + return 0; + } virtual int Write(JZWriteBase& io) { Modified: trunk/jazz/src/Harmony.cpp =================================================================== --- trunk/jazz/src/Harmony.cpp 2010-04-28 21:36:26 UTC (rev 774) +++ trunk/jazz/src/Harmony.cpp 2010-04-28 23:14:07 UTC (rev 775) @@ -382,7 +382,9 @@ class tHBPlayerForm : public wxForm { public: - tHBPlayerForm() : wxForm( USED_WXFORM_BUTTONS ) {} + tHBPlayerForm() : wxForm( USED_WXFORM_BUTTONS ) + { + } void OnHelp() { gpHelpInstance->ShowTopic("Harmony browser"); @@ -1164,9 +1166,15 @@ { public: HBSettingsForm(HBCanvas *c) - : wxForm( USED_WXFORM_BUTTONS ) - { mpHbWindow = c; } - virtual void OnOk() { mpHbWindow->OnPaint(); wxForm::OnOk(); } + : wxForm( USED_WXFORM_BUTTONS ) + { + mpHbWindow = c; + } + virtual void OnOk() + { + mpHbWindow->OnPaint(); + wxForm::OnOk(); + } virtual void OnHelp(); private: HBCanvas *mpHbWindow; @@ -1637,8 +1645,14 @@ HBChord scale; int chord_key; int scale_key; - int ChordKey(int i = 0) const { return (chord_key + i) % 12; } - int ScaleKey(int i = 0) const { return (chord_key + i) % 12; } // yes, its chord_key! + int ChordKey(int i = 0) const + { + return (chord_key + i) % 12; + } + int ScaleKey(int i = 0) const + { + return (chord_key + i) % 12; + } HBContext *pcontext; HBPlayer player; Modified: trunk/jazz/src/HarmonyBrowserAnalyzer.cpp =================================================================== --- trunk/jazz/src/HarmonyBrowserAnalyzer.cpp 2010-04-28 21:36:26 UTC (rev 774) +++ trunk/jazz/src/HarmonyBrowserAnalyzer.cpp 2010-04-28 23:14:07 UTC (rev 775) @@ -320,7 +320,8 @@ #else -class tChordMatrix { +class tChordMatrix +{ public: tChordMatrix() { Modified: trunk/jazz/src/HarmonyP.cpp =================================================================== --- trunk/jazz/src/HarmonyP.cpp 2010-04-28 21:36:26 UTC (rev 774) +++ trunk/jazz/src/HarmonyP.cpp 2010-04-28 23:14:07 UTC (rev 775) @@ -576,7 +576,8 @@ #if 0 #include <ctype.h> -struct scdef { +struct scdef +{ const char *name; const char *def; }; Modified: trunk/jazz/src/PianoFrame.cpp =================================================================== --- trunk/jazz/src/PianoFrame.cpp 2010-04-28 21:36:26 UTC (rev 774) +++ trunk/jazz/src/PianoFrame.cpp 2010-04-28 23:14:07 UTC (rev 775) @@ -563,7 +563,11 @@ JZPianoFrame *pPianoWindow; public: - tVisibleDlg(JZPianoFrame *p) : wxForm( USED_WXFORM_BUTTONS ), pPianoWindow(p) {} + tVisibleDlg(JZPianoFrame *p) + : wxForm( USED_WXFORM_BUTTONS ), + pPianoWindow(p) + { + } void EditForm(wxPanel *panel); virtual void OnOk(); virtual void OnHelp(); Modified: trunk/jazz/src/Player.h =================================================================== --- trunk/jazz/src/Player.h 2010-04-28 21:36:26 UTC (rev 774) +++ trunk/jazz/src/Player.h 2010-04-28 23:14:07 UTC (rev 775) @@ -624,8 +624,15 @@ virtual bool IsInstalled(); virtual ~tSeq2Player(); int OutEvent(JZEvent *e, int now); - int OutEvent(JZEvent *e) { OutEvent(e, 0); return 0; } - void OutNow(JZEvent *e) { OutEvent(e, 1); } + int OutEvent(JZEvent *e) + { + OutEvent(e, 0); + return 0; + } + void OutNow(JZEvent *e) + { + OutEvent(e, 1); + } void OutBreak(); void OutBreak(long BreakOver); void StartPlay(long Clock, long LoopClock = 0, int Continue = 0); @@ -635,7 +642,6 @@ void SetSoftThru(int on, int idev, int odev); int FindMidiDevice(); - protected: long play_clock; Modified: trunk/jazz/src/Random.h =================================================================== --- trunk/jazz/src/Random.h 2010-04-28 21:36:26 UTC (rev 774) +++ trunk/jazz/src/Random.h 2010-04-28 23:14:07 UTC (rev 775) @@ -57,32 +57,58 @@ public: - int Null() { return nul; } - void SetNull(int n) { nul = n; } + int Null() + { + return nul; + } + void SetNull(int n) + { + nul = n; + } JZRndArray(int n, int min, int max); JZRndArray & operator = (const JZRndArray &); JZRndArray(JZRndArray const &); virtual ~JZRndArray(); - int &operator[] (int i) { return mArray[i]; } - int operator[] (int i) const { return mArray[i]; } + int &operator[] (int i) + { + return mArray[i]; + } + int operator[] (int i) const + { + return mArray[i]; + } /* PAT - The following ifdef was removed due to changes in gcc 3.x. If it needs to be put back for compatibility purposes, it will need to return in an alternate form. */ /*#ifdef FOR_MSW*/ double operator[](double f); - float operator[](float f) { + float operator[](float f) + { /*#else double operator[](double f) const; - float operator[](float f) const { + float operator[](float f) const + { #endif*/ return (float)operator[]((double)f); } - int Size() const { return n; } - int Min() const { return min; } - int Max() const { return max; } + int Size() const + { + return n; + } + int Min() const + { + return min; + } + int Max() const + { + return max; + } void SetMinMax(int min, int max); - void Resize(int nn) { n = nn; } + void Resize(int nn) + { + n = nn; + } friend std::ostream & operator << (std::ostream &, JZRndArray const &); friend std::istream & operator >> (std::istream &, JZRndArray &); @@ -175,14 +201,22 @@ virtual void SetLabel(char const *llabel); void Enable(int enable = 1); - void SetStyle(int style) { style_bits = style; } + void SetStyle(int style) + { + style_bits = style; + } // min and max value in array (both values inclusive) void SetYMinMax(int min, int max); // for display x-axis only, does not resize the array (both values inclusive) void SetXMinMax(int xmin, int xmax); void DrawBarLine (wxDC *dc, int xx); - void SetDrawBars(tArrayEditDrawBars *x) { draw_bars = x; } - void Init() {} + void SetDrawBars(tArrayEditDrawBars *x) + { + draw_bars = x; + } + void Init() + { + } DECLARE_EVENT_TABLE() }; Modified: trunk/jazz/src/ResourceDialog.h =================================================================== --- trunk/jazz/src/ResourceDialog.h 2010-04-28 21:36:26 UTC (rev 774) +++ trunk/jazz/src/ResourceDialog.h 2010-04-28 23:14:07 UTC (rev 775) @@ -202,19 +202,28 @@ If the function returns true, the Attached data will be set and the dialog will be hidden. */ - virtual bool OnOk() { return true; } + virtual bool OnOk() + { + return true; + } /// Cancel event handler /** Called when a dialog produced by Show() has caused a wxID_CANCEL event. If the function returns true, the dialog will be hidden. */ - virtual bool OnCancel() { return true; } + virtual bool OnCancel() + { + return true; + } /// Apply event handler /** Called when a dialog produced by Show() has caused a wxID_APPLY event. If the function returns true, the Attached data will be set. */ - virtual bool OnApply() { return true; } + virtual bool OnApply() + { + return true; + } private: Modified: trunk/jazz/src/Rhythm.h =================================================================== --- trunk/jazz/src/Rhythm.h 2010-04-28 21:36:26 UTC (rev 774) +++ trunk/jazz/src/Rhythm.h 2010-04-28 23:14:07 UTC (rev 775) @@ -197,7 +197,10 @@ tArrayEdit *veloc_edit; tRhyArrayEdit *rhythm_edit; - enum { MAX_INSTRUMENTS = 20 }; + enum + { + MAX_INSTRUMENTS = 20 + }; tRhythm *instruments[MAX_INSTRUMENTS]; int n_instruments; int act_instrument; // -1 if none Modified: trunk/jazz/src/Sample.h =================================================================== --- trunk/jazz/src/Sample.h 2010-04-28 21:36:26 UTC (rev 774) +++ trunk/jazz/src/Sample.h 2010-04-28 23:14:07 UTC (rev 775) @@ -110,7 +110,10 @@ float Peak(int fr = -1, int to = -1); void Rescale(float maxval = 32766.0, int fr = -1, int to = -1); void RescaleToShort(int fr = -1, int to = -1); - float &operator[](int i) { return data[i]; } + float &operator[](int i) + { + return data[i]; + } void Initialize(int size = 0); void PasteMix(tFloatSample &src, int offs = 0); void PasteMix(tSample &src, int offs = 0); @@ -197,7 +200,8 @@ * that is offs % set.GetChannels() == 0. */ -class tSample { +class tSample +{ friend class tFloatSample; friend class tSplPan; friend class tSplPitch; @@ -216,43 +220,52 @@ // Properties void SetLabel(const char *str); - const char *GetLabel() const { + const char *GetLabel() const + { return label; } - void SetVolume(int vol) { + void SetVolume(int vol) + { dirty |= (vol != volume); volume = vol; } - int GetVolume() const { + int GetVolume() const + { return volume; } - void SetPan(int p) { + void SetPan(int p) + { dirty |= (p != pan); pan = p; } - int GetPan() const { + int GetPan() const + { return pan; } - void SetPitch(int p) { + void SetPitch(int p) + { dirty |= (p != pitch); pitch = p; } - int GetPitch() const { + int GetPitch() const + { return pitch; } void SetFilename(const char *fname); - const char *GetFilename() const { + const char *GetFilename() const + { return filename; } - int GetLength() const { + int GetLength() const + { return length; } @@ -274,14 +287,16 @@ void Clear(); - void GotoRAM() { + void GotoRAM() + { // Try to swap this sample into memory. volatile short dummy; for (int i = 0; i < length; i++) dummy = data[i]; } - short *GetData() { + short *GetData() + { return data; } @@ -290,11 +305,13 @@ * access global adustments from tSampleSet */ - tSampleSet &SampleSet() { + tSampleSet &SampleSet() + { return set; } - tSampleSet *operator->() { + tSampleSet *operator->() + { return &set; } Modified: trunk/jazz/src/SampleCommand.h =================================================================== --- trunk/jazz/src/SampleCommand.h 2010-04-28 21:36:26 UTC (rev 774) +++ trunk/jazz/src/SampleCommand.h 2010-04-28 23:14:07 UTC (rev 775) @@ -38,13 +38,19 @@ class tPaintableCommand { public: - tPaintableCommand(tSample &s) : spl(s) {} + tPaintableCommand(tSample &s) : spl(s) + { + } virtual int NumArrays() = 0; virtual JZRndArray & GetArray(int i) = 0; virtual const char * GetLabel(int i) = 0; virtual void Execute(long fr, long to) = 0; - virtual void Initialize() {} - virtual ~tPaintableCommand() {} + virtual void Initialize() + { + } + virtual ~tPaintableCommand() + { + } protected: tSample &spl; }; @@ -57,9 +63,18 @@ { public: tPaintableCommand1(tSample &s, int num, int min, int max) - : tPaintableCommand(s), arr(num, min, max) { } - virtual int NumArrays() { return 1; } - virtual JZRndArray & GetArray(int i) { return arr; } + : tPaintableCommand(s), + arr(num, min, max) + { + } + virtual int NumArrays() + { + return 1; + } + virtual JZRndArray & GetArray(int i) + { + return arr; + } virtual void Initialize(); protected: JZRndArray arr; @@ -69,27 +84,46 @@ class tSplVolume : public tPaintableCommand1 { public: - const char * GetLabel(int i) { return "volume"; } - tSplVolume(tSample &s) : tPaintableCommand1(s, 200, -100, 100) { } + const char * GetLabel(int i) + { + return "volume"; + } + tSplVolume(tSample &s) : tPaintableCommand1(s, 200, -100, 100) + { + } void Execute(long fr, long to); }; class tSplPan : public tPaintableCommand1 { public: - const char * GetLabel(int i) { return "pan"; } - tSplPan(tSample &s) : tPaintableCommand1(s, 200, -100, 100) { } + const char * GetLabel(int i) + { + return "pan"; + } + tSplPan(tSample &s) : tPaintableCommand1(s, 200, -100, 100) + { + } void Execute(long fr, long to); }; class tSplPitch : public tPaintableCommand1 { public: - const char * GetLabel(int i) { return "pitch"; } - tSplPitch(tSample &s) : tPaintableCommand1(s, 200, -100, 100) { range = 1.2f; } + const char * GetLabel(int i) + { + return "pitch"; + } + tSplPitch(tSample &s) : tPaintableCommand1(s, 200, -100, 100) + { + range = 1.2f; + } void Execute(long fr, long to); // range = frequency factor, e.g. 2 will transpose on octave up or down - void SetRange(float r) { range = r; } + void SetRange(float r) + { + range = r; + } private: float range; }; @@ -119,7 +153,10 @@ float SR; int resetval; - enum { SIZE = 512 }; + enum + { + SIZE = 512 + }; float array[SIZE]; float tabs[2]; /* for lineset */ int lineset; @@ -131,7 +168,8 @@ friend class tWahSettingsForm; public: tWahWah(tSample &s); - virtual const char * GetLabel(int i) { + virtual const char * GetLabel(int i) + { return "freq"; } virtual void Execute(long fr, long to); Modified: trunk/jazz/src/SampleDialog.cpp =================================================================== --- trunk/jazz/src/SampleDialog.cpp 2010-04-28 21:36:26 UTC (rev 774) +++ trunk/jazz/src/SampleDialog.cpp 2010-04-28 23:14:07 UTC (rev 775) @@ -336,7 +336,8 @@ double fy = ymap.XToY(arr[(float)fx]); data[i] = (short)fy; } - else { + else + { x = -x; double fx = xmap.XToY(x); double fy = ymap.XToY(arr[(float)fx]); Modified: trunk/jazz/src/SampleDialog.h =================================================================== --- trunk/jazz/src/SampleDialog.h 2010-04-28 21:36:26 UTC (rev 774) +++ trunk/jazz/src/SampleDialog.h 2010-04-28 23:14:07 UTC (rev 775) @@ -135,7 +135,10 @@ wxSlider *midi_key_slider; wxSlider *duration_slider; - enum { MAXSYNTHS = 6 }; + enum + { + MAXSYNTHS = 6 + }; tAddSynth *synths[MAXSYNTHS]; static int num_synths; static int midi_key; Modified: trunk/jazz/src/SampleWindow.cpp =================================================================== --- trunk/jazz/src/SampleWindow.cpp 2010-04-28 21:36:26 UTC (rev 774) +++ trunk/jazz/src/SampleWindow.cpp 2010-04-28 23:14:07 UTC (rev 775) @@ -273,7 +273,8 @@ Start(100); } - bool IsListening() const { + bool IsListening() const + { return gpMidiPlayer->IsListening(); } @@ -931,7 +932,8 @@ offs = cnvs->sel_fr; return TRUE; } - else { + else + { offs = -1; if (warn) wxMessageBox("please set insertion point first", "Error", wxOK); Modified: trunk/jazz/src/SampleWindow.h =================================================================== --- trunk/jazz/src/SampleWindow.h 2010-04-28 21:36:26 UTC (rev 774) +++ trunk/jazz/src/SampleWindow.h 2010-04-28 23:14:07 UTC (rev 775) @@ -52,13 +52,19 @@ virtual void OnMenuCommand(int id); void Redraw(); bool HaveInsertionPoint(int &offs, bool warn = TRUE); - enum HaveSelectionMode { SelWarn, SelNoWarn, SelAll} ; + 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(); - tSample &GetSample() { + tSample &GetSample() + { return spl; } void PlaySample(); @@ -85,7 +91,10 @@ static tSample *copy_buffer; - enum { MAXPARAM = 4 }; + enum + { + MAXPARAM = 4 + }; tArrayEdit *params[MAXPARAM]; int num_params; Modified: trunk/jazz/src/Signal2.h =================================================================== --- trunk/jazz/src/Signal2.h 2010-04-28 21:36:26 UTC (rev 774) +++ trunk/jazz/src/Signal2.h 2010-04-28 23:14:07 UTC (rev 775) @@ -82,8 +82,11 @@ class tExpoMap { public: - tExpoMap(T x, T y) : map(-x, x, -log(y), log(y)) { } - T operator()(T x) { + tExpoMap(T x, T y) : map(-x, x, -log(y), log(y)) + { + } + T operator()(T x) + { return exp(map(x)); } private: @@ -351,11 +354,14 @@ current = -1; } - virtual ~tSigInput() {} + virtual ~tSigInput() + { + } void GetSample(tSigValue &ret) { - if (synth.current >= current) { + if (synth.current >= current) + { current = synth.current + 1; NextValue(); } @@ -364,7 +370,8 @@ float GetControl() { - if (synth.current >= current) { + if (synth.current >= current) + { current = synth.current + 100; NextValue(); ctl = 0; @@ -375,15 +382,21 @@ return ctl; } - int HasChanged() const { + int HasChanged() const + { return synth.current >= current; } - virtual void Init() { // called once before performance starts + virtual void Init() + { + // called once before performance starts current = -1; } - virtual long GetLength() { return 0; } + virtual long GetLength() + { + return 0; + } virtual void NextValue() = 0; protected: @@ -401,7 +414,9 @@ class tSigOutput : public tSigInput { public: - tSigOutput(tSigSynth &synth) : tSigInput(synth) {} + tSigOutput(tSigSynth &synth) : tSigInput(synth) + { + } virtual void Out(const tSigValue &v) = 0; virtual void Resize(long) = 0; }; @@ -595,28 +610,34 @@ have_freq_control = 0; } - virtual void Init() { + virtual void Init() + { tSignalModifier::Init(); have_freq_control = (controls.size() != 0); } - tSigValue & operator[](int i) { + tSigValue & operator[](int i) + { return array[i]; } - const tSigValue & operator[](int i) const { + const tSigValue & operator[](int i) const + { return array[i]; } - void NextValue() { - if (have_freq_control && controls[0]->HasChanged()) { + void NextValue() + { + if (have_freq_control && controls[0]->HasChanged()) + { dx = array.Size() / SR * freq * fmap(controls[0]->GetControl()); } array.CyclicInterpolate(val, x); x += dx; } - long Size() const { + long Size() const + { return array.Size(); } @@ -643,19 +664,23 @@ { } - tSigValue & operator[](int i) { + tSigValue & operator[](int i) + { return array[i]; } - const tSigValue & operator[](int i) const { + const tSigValue & operator[](int i) const + { return array[i]; } - void NextValue() { + void NextValue() + { array.Interpolate(val, xmap(current)); } - long Size() const { + long Size() const + { return array.Size(); } @@ -674,7 +699,8 @@ { } - void NextValue() { + void NextValue() + { for (int i = 0; i < channels; i++) val[i] = ((rnd.asDouble() * 2.0) - 1.0) * 32000.0; } @@ -694,7 +720,9 @@ val[i] = x; } - virtual void NextValue() {} + virtual void NextValue() + { + } }; @@ -712,7 +740,8 @@ map.Initialize(0, plen, phi, phi + 2 * PI); ampl = amp; } - void NextValue() { + void NextValue() + { float y = ampl * sin(map((double)current)); for (int i = 0; i < channels; i++) val[i] = y; @@ -732,8 +761,11 @@ class tSigVolume : public tSignalModifier { public: - tSigVolume(tSigSynth &synth) : tSignalModifier(synth) {} - void NextValue() { + tSigVolume(tSigSynth &synth) : tSignalModifier(synth) + { + } + void NextValue() + { float vol = controls[0]->GetControl(); inputs[0]->GetSample(val); for (int i = 0; i < channels; i++) @@ -749,8 +781,11 @@ class tSigPanpot : public tSignalModifier { public: - tSigPanpot(tSigSynth &synth) : tSignalModifier(synth) {} - void NextValue() { + tSigPanpot(tSigSynth &synth) : tSignalModifier(synth) + { + } + void NextValue() + { float p = controls[0]->GetControl(); inputs[0]->GetSample(val); if (p > 0) @@ -840,12 +875,14 @@ virtual ~tOpHighpass() { } - virtual void Setup(float sr, float hp, float dummy) { + virtual void Setup(float sr, float hp, float dummy) + { double b = 2.0 - cos(hp * 2.0 * PI / sr); c2 = b - sqrt(b * b - 1.0); c1 = 1.0 - c2; } - virtual float Loop(float sig) { + virtual float Loop(float sig) + { float tmp = y1 = c2 * (y1 + sig); y1 -= sig; return tmp; @@ -928,12 +965,15 @@ this->freq = freq; this->bandw = bandw; } - virtual void Init() { + virtual void Init() + { tSignalModifier::Init(); have_control = (controls.size() == 1); } - void NextValue() { - if (have_control && controls[0]->HasChanged()) { + void NextValue() + { + if (have_control && controls[0]->HasChanged()) + { float f = freq * fmap(controls[0]->GetControl()); for (int i = 0; i < channels; i++) filter[i].Setup(sr, f, bandw); @@ -942,7 +982,8 @@ for (int i = 0; i < channels; i++) val[i] = filter[i].FILTER::Loop(val[i]); } - tSigValue operator()(const tSigValue &sig) { + tSigValue operator()(const tSigValue &sig) + { for (int i = 0; i < channels; i++) val[i] = filter[i].FILTER::Loop(sig[i]); return val; @@ -965,7 +1006,8 @@ { public: - tSigLowpass(tSigSynth &synth, float fg) : tSignalModifier(synth) { + tSigLowpass(tSigSynth &synth, float fg) : tSignalModifier(synth) + { fg = fg / sampling_rate; a0 = 2 * PI * fg; // b1 = a0 - 1.0; // approx @@ -979,7 +1021,8 @@ val = sig * a0 - val * b1; } - tSigValue operator()(const tSigValue &sig) { + tSigValue operator()(const tSigValue &sig) + { val = sig * a0 - val * b1; return val; } @@ -1075,7 +1118,11 @@ class tSigReverb : public tSignalModifier { public: - enum { COMBS = 4, ALPAS = 2 }; + enum + { + COMBS = 4, + ALPAS = 2 + }; tSigReverb( tSigSynth &synth, float reverb_time = 0.7, @@ -1136,11 +1183,13 @@ { lfo.Init(*this); } - virtual int operator()(tSigValue &val) { + virtual int operator()(tSigValue &val) + { if (!sig(val)) return 0; float a = (lfo() + 1)/2; // map to 0..1 - if (channels > 1) { + if (channels > 1) + { float tmp = val[0]; val[0] -= a * val[1]; val[1] -= a * tmp; @@ -1160,15 +1209,19 @@ class tSigMix2 : public tSignalModifier { public: - tSigMix2(tSigSynth &synth) : tSignalModifier(synth) {} + tSigMix2(tSigSynth &synth) : tSignalModifier(synth) + { + } - void Init() { + void Init() + { tSignalModifier::Init(); // initialize sources len1 = inputs[0]->GetLength(); len2 = inputs[1]->GetLength(); } - void NextValue() { + void NextValue() + { tSigValue v1; tSigValue v2; inputs[0]->GetSample(v1); Modified: trunk/jazz/src/Synth.cpp =================================================================== --- trunk/jazz/src/Synth.cpp 2010-04-28 21:36:26 UTC (rev 774) +++ trunk/jazz/src/Synth.cpp 2010-04-28 23:14:07 UTC (rev 775) @@ -37,10 +37,11 @@ using namespace std; -#define SXDECL(id,len,arr) do {\ - sxlen[id] = len; \ - sxdata[id] = new unsigned char[len]; \ - memcpy(sxdata[id], arr, len); \ +#define SXDECL(id,len,arr) do\ +{\ + sxlen[id] = len;\ + sxdata[id] = new unsigned char[len];\ + memcpy(sxdata[id], arr, len);\ } while (0) Modified: trunk/jazz/src/Synth.h =================================================================== --- trunk/jazz/src/Synth.h 2010-04-28 21:36:26 UTC (rev 774) +++ trunk/jazz/src/Synth.h 2010-04-28 23:14:07 UTC (rev 775) @@ -337,32 +337,79 @@ return Sysex(clk, SX_GM_MasterVol, vol ); } - virtual JZEvent* MasterPanSX( long clk, unsigned char pan ) { return 0; } + virtual JZEvent* MasterPanSX( long clk, unsigned char pan ) + { + return 0; + } - virtual JZEvent* ModSX( int index, long clk, int cha, unsigned char val ) { return 0; } + virtual JZEvent* ModSX( int index, long clk, int cha, unsigned char val ) + { + return 0; + } - virtual JZEvent* BendSX( int index, long clk, int cha, unsigned char val) { return 0; } + virtual JZEvent* BendSX( int index, long clk, int cha, unsigned char val) + { + return 0; + } - virtual JZEvent* CafSX( int index, long clk, int cha, unsigned char val ) { return 0; } + virtual JZEvent* CafSX( int index, long clk, int cha, unsigned char val ) + { + return 0; + } - virtual JZEvent* PafSX( int index, long clk, int cha, unsigned char val ) { return 0; } + virtual JZEvent* PafSX( int index, long clk, int cha, unsigned char val ) + { + return 0; + } - virtual JZEvent* CC1SX( int index, long clk, int cha, unsigned char val ) { return 0; } + virtual JZEvent* CC1SX( int index, long clk, int cha, unsigned char val ) + { + return 0; + } - virtual JZEvent* CC2SX( int index, long clk, int cha, unsigned char val ) { return 0; } + virtual JZEvent* CC2SX( int index, long clk, int cha, unsigned char val ) + { + return 0; + } - virtual JZEvent* PartialReserveSX( long clk, int cha, unsigned char *valptr ) { return 0; } - virtual JZEvent* RxChannelSX( long clk, int cha, unsigned char val ) { return 0; } - virtual JZEvent* UseForRhythmSX( long clk, int cha, unsigned char val ) { return 0; } + virtual JZEvent* PartialReserveSX( long clk, int cha, unsigned char *valptr ) + { + return 0; + } + virtual JZEvent* RxChannelSX( long clk, int cha, unsigned char val ) + { + return 0; + } + virtual JZEvent* UseForRhythmSX( long clk, int cha, unsigned char val ) + { + return 0; + } - virtual JZEvent* ControllerNumberSX( int ctrlno, long clk, int cha, unsigned char val ) { return 0; } + virtual JZEvent* ControllerNumberSX( int ctrlno, long clk, int cha, unsigned char val ) + { + return 0; + } - virtual JZEvent* ReverbMacroSX( long clk, unsigned char val, unsigned char lsb = 0 ) { return 0; } - virtual JZEvent* ReverbParamSX( int index, long clk, unsigned char val ) { return 0; } - virtual JZEvent* ChorusMacroSX( long clk, unsigned char val, unsigned char lsb = 0 ) { return 0; } - virtual JZEvent* ChorusParamSX( int index, long clk, unsigned char val ) { return 0; } + virtual JZEvent* ReverbMacroSX( long clk, unsigned char val, unsigned char lsb = 0 ) + { + return 0; + } + virtual JZEvent* ReverbParamSX( int index, long clk, unsigned char val ) + { + return 0; + } + virtual JZEvent* ChorusMacroSX( long clk, unsigned char val, unsigned char lsb = 0 ) + { + return 0; + } + virtual JZEvent* ChorusParamSX( int index, long clk, unsigned char val ) + { + return 0; } - virtual JZEvent* EqualizerMacroSX( long clk, unsigned char val ) { return 0; } + virtual JZEvent* EqualizerMacroSX( long clk, unsigned char val ) + { + return 0; + } protected: Modified: trunk/jazz/src/Track.h =================================================================== --- trunk/jazz/src/Track.h 2010-04-28 21:36:26 UTC (rev 774) +++ trunk/jazz/src/Track.h 2010-04-28 23:14:07 UTC (rev 775) @@ -609,11 +609,20 @@ void SetState(int NewState); void ToggleState(int Direction); // +1 = next, -1 = prev - int GetChannel() { return Channel; } + int GetChannel() + { + return Channel; + } void SetChannel(int NewChannel); - int GetDevice() const { return Device; } - void SetDevice(int d) { Device = d; } + int GetDevice() const + { + return Device; + } + void SetDevice(int d) + { + Device = d; + } int GetPatch(); void SetPatch(int PatchNr); Modified: trunk/jazz/src/gui/trackwinEnum.h =================================================================== --- trunk/jazz/src/gui/trackwinEnum.h 2010-04-28 21:36:26 UTC (rev 774) +++ trunk/jazz/src/gui/trackwinEnum.h 2010-04-28 23:14:07 UTC (rev 775) @@ -20,7 +20,8 @@ ** */ -enum { +enum +{ MEN_LOAD =1, MEN_SAVE =2, MEN_QUIT =3, @@ -125,4 +126,3 @@ MEN_SELECTIONSUB=107, MEN_PIANOWIN2=108 }; - Modified: trunk/jazz/src/mswin/WindowsMidiInterface.cpp =================================================================== --- trunk/jazz/src/mswin/WindowsMidiInterface.cpp 2010-04-28 21:36:26 UTC (rev 774) +++ trunk/jazz/src/mswin/WindowsMidiInterface.cpp 2010-04-28 23:14:07 UTC (rev 775) @@ -578,10 +578,12 @@ DWORD dwParam2 ) { - if (wMsg == MOM_DONE) { + if (wMsg == MOM_DONE) + { MIDIHDR *hdr = (MIDIHDR *)dwParam1; tWinSysexBuffer *buf = (tWinSysexBuffer *)hdr->dwUser; - if (buf != 0) { // ignore OutNow() buffers + if (buf != 0) + { // ignore OutNow() buffers buf->Release(); OutputDebugString("release\n"); } Modified: trunk/jazz/src/mswin/WindowsMidiInterface.h =================================================================== --- trunk/jazz/src/mswin/WindowsMidiInterface.h 2010-04-28 21:36:26 UTC (rev 774) +++ trunk/jazz/src/mswin/WindowsMidiInterface.h 2010-04-28 23:14:07 UTC (rev 775) @@ -270,7 +270,8 @@ wr = (wr + 1) % MIDI_BUFFER_SIZE; } - int empty() const { + int empty() const + { return rd == wr; } Modified: trunk/jazz/src/ms... [truncated message content] |
From: <pst...@us...> - 2010-05-10 03:10:02
|
Revision: 780 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=780&view=rev Author: pstieber Date: 2010-05-10 03:09:56 +0000 (Mon, 10 May 2010) Log Message: ----------- Updated some menu IDs. Modified Paths: -------------- trunk/jazz/src/GuitarFrame.cpp trunk/jazz/src/Harmony.cpp trunk/jazz/src/Resources.h trunk/jazz/src/Rhythm.cpp trunk/jazz/src/SampleWindow.cpp Modified: trunk/jazz/src/GuitarFrame.cpp =================================================================== --- trunk/jazz/src/GuitarFrame.cpp 2010-05-10 00:30:40 UTC (rev 779) +++ trunk/jazz/src/GuitarFrame.cpp 2010-05-10 03:09:56 UTC (rev 780) @@ -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 @@ -44,7 +44,7 @@ EVT_MENU(MEN_CLEAR, JZGuitarFrame::OnClear) - EVT_MENU(MEN_SETTINGS, JZGuitarFrame::OnSettings) + EVT_MENU(ID_VIEW_SETTINGS, JZGuitarFrame::OnSettings) EVT_MENU(wxID_HELP, JZGuitarFrame::OnHelp) @@ -68,15 +68,22 @@ // set the frame icon // SetIcon(wxICON(mondrian)); - wxMenu* pMenu = new wxMenu; - pMenu->Append(MEN_CLEAR, "C&lear"); - pMenu->Append(MEN_SETTINGS, "&Settings"); - pMenu->Append(wxID_HELP, "&Help"); - pMenu->Append(wxID_CLOSE, "&Close"); - + wxMenu* pMenu = 0; wxMenuBar* pMenuBar = new wxMenuBar; - pMenuBar->Append(pMenu, "&Menu"); + pMenu = new wxMenu; + pMenu->Append(wxID_CLOSE, "&Close"); + pMenuBar->Append(pMenu, "&File"); + + pMenu = new wxMenu; + pMenu->Append(MEN_CLEAR, "C&lear"); + pMenu->Append(ID_VIEW_SETTINGS, "&Settings"); + pMenuBar->Append(pMenu, "&View"); + + pMenu = new wxMenu; + pMenu->Append(wxID_HELP, "&Help"); + pMenuBar->Append(pMenu, "&Help"); + SetMenuBar(pMenuBar); mpFretBoardWindow = new JZGuitarWindow(this, wxPoint(0, 0), wxSize(600, 120)); Modified: trunk/jazz/src/Harmony.cpp =================================================================== --- trunk/jazz/src/Harmony.cpp 2010-05-10 00:30:40 UTC (rev 779) +++ trunk/jazz/src/Harmony.cpp 2010-05-10 03:09:56 UTC (rev 780) @@ -22,22 +22,23 @@ #include "Harmony.h" +#include "FileSelector.h" +#include "Filter.h" +#include "Globals.h" +#include "GuitarFrame.h" +#include "HarmonyBrowserAnalyzer.h" #include "HarmonyP.h" -#include "ProjectManager.h" -#include "Player.h" -#include "TrackFrame.h" -#include "TrackWindow.h" +#include "Help.h" #include "PianoFrame.h" #include "PianoWindow.h" -#include "GuitarFrame.h" +#include "Player.h" +#include "ProjectManager.h" +#include "Rectangle.h" +#include "Resources.h" #include "Song.h" -#include "Filter.h" #include "ToolBar.h" -#include "HarmonyBrowserAnalyzer.h" -#include "FileSelector.h" -#include "Rectangle.h" -#include "Globals.h" -#include "Help.h" +#include "TrackFrame.h" +#include "TrackWindow.h" #include <wx/button.h> #include <wx/checkbox.h> @@ -49,8 +50,8 @@ #include <wx/stattext.h> #include <wx/toolbar.h> +#include <fstream> #include <iostream> -#include <fstream> using namespace std; @@ -78,7 +79,6 @@ #define MEN_HAUNSCH 23 #define MEN_ANALYZE 24 #define MEN_IONSCALE 25 -#define MEN_SETTINGS 26 #include "Bitmaps/open.xpm" @@ -1492,7 +1492,7 @@ TransposeSelection(); break; - case MEN_SETTINGS: + case ID_VIEW_SETTINGS: SettingsDialog(); break; @@ -2000,7 +2000,7 @@ // EVT_MENU(MEN_ANALYZE, // EVT_MENU(MEN_TRANSPOSE, -// EVT_MENU(MEN_SETTINGS, +// EVT_MENU(ID_VIEW_SETTINGS, END_EVENT_TABLE() @@ -2028,7 +2028,7 @@ wxMenu* pSettingsMenu = new wxMenu; pSettingsMenu->Append(MEN_EDIT, "&Chord"); - pSettingsMenu->Append(MEN_SETTINGS, "&Global"); + pSettingsMenu->Append(ID_VIEW_SETTINGS, "&Global"); pSettingsMenu->Append(MEN_MIDI, "&Midi"); pSettingsMenu->Append( MEN_HAUNSCH, Modified: trunk/jazz/src/Resources.h =================================================================== --- trunk/jazz/src/Resources.h 2010-05-10 00:30:40 UTC (rev 779) +++ trunk/jazz/src/Resources.h 2010-05-10 03:09:56 UTC (rev 780) @@ -30,14 +30,19 @@ // of wxID_HIGHEST here. #define wxID_HIGHEST 5999 -#define ID_EXPORT_MIDI wxID_HIGHEST + 1 -#define ID_EXPORT_SELECTION_AS_MIDI wxID_HIGHEST + 2 +#define ID_FILE_REVERT_TO_SAVED wxID_HIGHEST + 1 +#define ID_EXPORT_MIDI wxID_HIGHEST + 2 +#define ID_EXPORT_SELECTION_AS_MIDI wxID_HIGHEST + 3 + #define ID_SETTINGS_METRONOME wxID_HIGHEST + 10 #define ID_SETTINGS_SYNTHESIZER wxID_HIGHEST + 11 #define ID_SETTINGS_MIDI_DEVICE wxID_HIGHEST + 12 +#define ID_SETTINGS_PITCH_PAINTER wxID_HIGHEST + 13 +#define ID_SETTINGS_WAHWAH wxID_HIGHEST + 14 #define ID_EDIT_PASTE_MERGE wxID_HIGHEST + 15 +#define ID_EDIT_MAXIMIZE_VOLUME wxID_HIGHEST + 16 #define ID_AUDIO_GLOBAL_SETTINGS wxID_HIGHEST + 20 #define ID_AUDIO_SAMPLE_SETTINGS wxID_HIGHEST + 21 @@ -46,49 +51,66 @@ #define ID_AUDIO_SAVE_SAMPLE_SET_AS wxID_HIGHEST + 24 #define ID_AUDIO_NEW_SAMPLE_SET wxID_HIGHEST + 25 -#define ID_TRIM wxID_HIGHEST + 30 -#define ID_QUANTIZE wxID_HIGHEST + 31 -#define ID_SET_CHANNEL wxID_HIGHEST + 32 -#define ID_SHIFT wxID_HIGHEST + 33 -#define ID_SHIFT_LEFT wxID_HIGHEST + 34 -#define ID_SHIFT_RIGHT wxID_HIGHEST + 35 -#define ID_SNAP wxID_HIGHEST + 36 -#define ID_SNAP_8 wxID_HIGHEST + 37 -#define ID_SNAP_8D wxID_HIGHEST + 38 -#define ID_SNAP_16 wxID_HIGHEST + 39 -#define ID_SNAP_16D wxID_HIGHEST + 40 -#define ID_MIXER wxID_HIGHEST + 41 -#define ID_PIANOWIN wxID_HIGHEST + 42 -#define ID_METRONOME_TOGGLE wxID_HIGHEST + 43 -#define ID_VELOCITY wxID_HIGHEST + 44 -#define ID_LENGTH wxID_HIGHEST + 45 -#define ID_MISC_TRACK_MERGE wxID_HIGHEST + 46 -#define ID_MISC_SPLIT_TRACKS wxID_HIGHEST + 47 -#define ID_MISC_METER_CHANGE wxID_HIGHEST + 48 -#define ID_MISC_RESET_MIDI wxID_HIGHEST + 49 -#define ID_MISC_SET_COPYRIGHT wxID_HIGHEST + 50 -#define ID_TRANSPOSE wxID_HIGHEST + 51 -#define ID_CLEANUP wxID_HIGHEST + 52 -#define ID_SEARCH_AND_REPLACE wxID_HIGHEST + 53 +#define ID_EFFECTS_EQUALIZER wxID_HIGHEST + 27 +#define ID_EFFECTS_FILTER wxID_HIGHEST + 28 +#define ID_EFFECTS_DISTORTION wxID_HIGHEST + 29 +#define ID_EFFECTS_REVERB wxID_HIGHEST + 30 +#define ID_EFFECTS_ECHO wxID_HIGHEST + 31 +#define ID_EFFECTS_CHORUS wxID_HIGHEST + 32 +#define ID_EFFECTS_PITCH_SHIFTER wxID_HIGHEST + 33 +#define ID_EFFECTS_STRETCHER wxID_HIGHEST + 34 +#define ID_EFFECTS_REVERSE wxID_HIGHEST + 35 +#define ID_EFFECTS_SYNTH wxID_HIGHEST + 36 -#define ID_PLAY wxID_HIGHEST + 60 -#define ID_PLAY_LOOP wxID_HIGHEST + 61 -#define ID_RECORD wxID_HIGHEST + 62 +#define ID_PAINTERS_VOLUME wxID_HIGHEST + 37 +#define ID_PAINTER_WAHWAH wxID_HIGHEST + 38 +#define ID_PAINTER_PAN wxID_HIGHEST + 39 +#define ID_PAINTER_PITCH wxID_HIGHEST + 40 +#define ID_PAINTER_NONE wxID_HIGHEST + 41 -#define ID_SELECT wxID_HIGHEST + 65 +#define ID_TRIM wxID_HIGHEST + 50 +#define ID_QUANTIZE wxID_HIGHEST + 51 +#define ID_SET_CHANNEL wxID_HIGHEST + 52 +#define ID_SHIFT wxID_HIGHEST + 53 +#define ID_SHIFT_LEFT wxID_HIGHEST + 54 +#define ID_SHIFT_RIGHT wxID_HIGHEST + 55 +#define ID_SNAP wxID_HIGHEST + 56 +#define ID_SNAP_8 wxID_HIGHEST + 57 +#define ID_SNAP_8D wxID_HIGHEST + 58 +#define ID_SNAP_16 wxID_HIGHEST + 59 +#define ID_SNAP_16D wxID_HIGHEST + 60 +#define ID_MIXER wxID_HIGHEST + 61 +#define ID_PIANOWIN wxID_HIGHEST + 62 +#define ID_METRONOME_TOGGLE wxID_HIGHEST + 63 +#define ID_VELOCITY wxID_HIGHEST + 64 +#define ID_LENGTH wxID_HIGHEST + 65 +#define ID_MISC_TRACK_MERGE wxID_HIGHEST + 66 +#define ID_MISC_SPLIT_TRACKS wxID_HIGHEST + 67 +#define ID_MISC_METER_CHANGE wxID_HIGHEST + 68 +#define ID_MISC_RESET_MIDI wxID_HIGHEST + 69 +#define ID_MISC_SET_COPYRIGHT wxID_HIGHEST + 70 +#define ID_TRANSPOSE wxID_HIGHEST + 71 +#define ID_CLEANUP wxID_HIGHEST + 72 +#define ID_SEARCH_AND_REPLACE wxID_HIGHEST + 73 -#define ID_CHANGE_LENGTH wxID_HIGHEST + 70 +#define ID_PLAY wxID_HIGHEST + 80 +#define ID_PLAY_LOOP wxID_HIGHEST + 81 +#define ID_RECORD wxID_HIGHEST + 82 -#define ID_EVENT_DIALOG wxID_HIGHEST + 81 -#define ID_CUT_PASTE_EVENTS wxID_HIGHEST + 82 -#define ID_SHOW_ALL_EVENTS_FROM_ALL_TRACKS wxID_HIGHEST + 83 +#define ID_SELECT wxID_HIGHEST + 85 +#define ID_CHANGE_LENGTH wxID_HIGHEST + 90 + +#define ID_EVENT_DIALOG wxID_HIGHEST + 91 +#define ID_CUT_PASTE_EVENTS wxID_HIGHEST + 92 +#define ID_SHOW_ALL_EVENTS_FROM_ALL_TRACKS wxID_HIGHEST + 93 + #define ID_TOOLS_HARMONY_BROWSER wxID_HIGHEST + 95 #define ID_HELP_PIANO_WINDOW wxID_HIGHEST + 100 #define MEN_CLEAR wxID_HIGHEST + 110 -#define MEN_SETTINGS wxID_HIGHEST + 120 +#define ID_VIEW_SETTINGS wxID_HIGHEST + 120 #define IDC_KB_VOLUME wxID_HIGHEST + 1000 Modified: trunk/jazz/src/Rhythm.cpp =================================================================== --- trunk/jazz/src/Rhythm.cpp 2010-05-10 00:30:40 UTC (rev 779) +++ trunk/jazz/src/Rhythm.cpp 2010-05-10 03:09:56 UTC (rev 780) @@ -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 @@ -496,9 +496,6 @@ // ============================ tRhythmWin ============================== -#define MEN_CLOSE 1 -#define MEN_LOAD 2 -#define MEN_SAVE 3 #define MEN_HELP 4 #define MEN_ADD 5 #define MEN_DEL 6 @@ -538,8 +535,8 @@ JZToolDef tdefs[] = { - { MEN_LOAD, FALSE, open_xpm, "open rhythm file" }, - { MEN_SAVE, FALSE, save_xpm, "save into rhythm file" }, + { wxID_OPEN, FALSE, open_xpm, "open rhythm file" }, + { wxID_SAVE, FALSE, save_xpm, "save into rhythm file" }, { JZToolBar::eToolBarSeparator }, { MEN_ADD, FALSE, rrgadd_xpm, "add instrument" }, { MEN_DEL, FALSE, rrgdel_xpm, "remove instrument" }, @@ -562,9 +559,9 @@ wxMenuBar *menu_bar = new wxMenuBar; wxMenu *menu = new wxMenu; - menu->Append(MEN_LOAD, "&Load"); - menu->Append(MEN_SAVE, "&Save"); - menu->Append(MEN_CLOSE, "&Close"); + menu->Append(wxID_OPEN, "&Load"); + menu->Append(wxID_SAVE, "&Save"); + menu->Append(wxID_CLOSE, "&Close"); menu_bar->Append(menu, "&File"); menu = new wxMenu; @@ -756,14 +753,14 @@ Help(); break; - case MEN_CLOSE: + case wxID_CLOSE: // motif crashes, when Show(FALSE) is called before destructor! // Show(FALSE); // DELETE_THIS(); Destroy(); break; - case MEN_LOAD: + case wxID_OPEN: { wxString fname = file_selector( default_filename, @@ -780,7 +777,7 @@ } break; - case MEN_SAVE: + case wxID_SAVE: { Win2Instrument(); wxString fname = file_selector( Modified: trunk/jazz/src/SampleWindow.cpp =================================================================== --- trunk/jazz/src/SampleWindow.cpp 2010-05-10 00:30:40 UTC (rev 779) +++ trunk/jazz/src/SampleWindow.cpp 2010-05-10 03:09:56 UTC (rev 780) @@ -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 @@ -45,41 +45,15 @@ //DEBUG#include <iostream> -#define MEN_LOAD 1 -#define MEN_SAVE 2 -#define MEN_CLOSE 3 -#define MEN_PLAY 4 #define MEN_HELP 5 -#define MEN_SAVEAS 6 -#define MEN_REVERT 7 -#define MEN_VOLUME_MAX 19 -#define MEN_VOLUME_PNT 20 - #define MEN_SILENCE 21 #define MEN_SILENCE_INS 22 #define MEN_SILENCE_APP 23 #define MEN_SILENCE_OVR 24 -#define MEN_WAHWAH 25 -#define MEN_WAHSETTINGS 26 -#define MEN_PAN_PNT 27 -#define MEN_TRANSP_PNT 28 -#define MEN_TRANSP_SET 29 - #define MEN_ACCEPT 42 -#define MEN_CANCEL 43 -#define MEN_ECHO 44 -#define MEN_DISTORTION 45 -#define MEN_EQUALIZER 46 -#define MEN_REVERB 47 -#define MEN_SHIFTER 48 -#define MEN_REVERSE 49 -#define MEN_FILTER 51 -#define MEN_CHORUS 52 -#define MEN_STEREO 53 -#define MEN_STRETCHER 54 -#define MEN_SYNTH 55 + #define MEN_FLIP 56 #define MEN_FLIP_LEFT 57 #define MEN_FLIP_RIGHT 58 @@ -692,22 +666,29 @@ #include "Bitmaps/zoomin.xpm" #include "Bitmaps/zoomout.xpm" -static JZToolDef tdefs[] = { - { MEN_LOAD, FALSE, open_xpm, "open wave file" }, - { MEN_SAVE, FALSE, save_xpm, "save wave file" }, +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" }, - { MEN_CANCEL, FALSE, cancel_xpm, "cancel painting" }, + { ID_PAINTER_NONE, FALSE, cancel_xpm, "cancel painting" }, { JZToolBar::eToolBarSeparator }, - { MEN_PLAY, FALSE, play_xpm, "play sample" }, + { ID_PLAY, FALSE, play_xpm, "play sample" }, { MEN_HELP, FALSE, help_xpm, "help" }, { JZToolBar::eToolBarEnd } }; -int tSampleWin::geo[4] = { 30, 30, 600, 300 }; +int tSampleWin::geo[4] = +{ + 30, + 30, + 600, + 300 +}; tSample *tSampleWin::copy_buffer; @@ -763,11 +744,11 @@ // Create and populate the File menu. pMenu = new wxMenu; - pMenu->Append(MEN_REVERT, "&Revert to Saved"); - pMenu->Append(MEN_LOAD, "&Load..."); + 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(MEN_CLOSE, "&Close"); + pMenu->Append(wxID_CLOSE, "&Close"); pMenuBar->Append(pMenu, "&File"); @@ -786,37 +767,37 @@ pSubMenu->Append(MEN_FLIP_LEFT, "Left"); pSubMenu->Append(MEN_FLIP_RIGHT, "Right"); pMenu->Append(MEN_FLIP, "In&vert Phase", pSubMenu); - pMenu->Append(MEN_VOLUME_MAX, "&Maximize Volume"); - pMenuBar->Append(pMenu, "&Edit"); + pMenu->Append(ID_EDIT_MAXIMIZE_VOLUME, "&Maximize Volume"); + pMenuBar->Append(pMenu, "&Edit"); pMenu = new wxMenu; - pMenu->Append(MEN_VOLUME_PNT, "&Volume..."); - pMenu->Append(MEN_PAN_PNT, "&Panpot..."); - pMenu->Append(MEN_TRANSP_PNT, "&Pitch..."); - pMenu->Append(MEN_WAHWAH, "&Filter..."); - pMenu->Append(MEN_CANCEL, "&None..."); + 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(MEN_EQUALIZER, "&Equalizer..."); - pMenu->Append(MEN_FILTER, "&Filter..."); - pMenu->Append(MEN_DISTORTION, "&Distortion..."); - pMenu->Append(MEN_REVERB, "&Reverb..."); - pMenu->Append(MEN_ECHO, "&Echo..."); - pMenu->Append(MEN_CHORUS, "&Chorus..."); - pMenu->Append(MEN_SHIFTER, "&Pitch shifter..."); - pMenu->Append(MEN_STRETCHER, "&Time stretcher..."); - pMenu->Append(MEN_REVERSE, "Re&verse"); - pMenu->Append(MEN_SYNTH, "&Synth..."); + 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(MEN_TRANSP_SET, "&Pitch Painter..."); - pMenu->Append(MEN_WAHSETTINGS, "&Filter Painter..."); + 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(MEN_SETTINGS, "&View Settings..."); - pMenuBar->Append(pMenu, "&Settings"); + pMenu->Append(ID_VIEW_SETTINGS, "&View Settings..."); + pMenuBar->Append(pMenu, "&Settings"); SetMenuBar(pMenuBar); @@ -1012,14 +993,14 @@ } // Player crashes if data disappear. - if (id != MEN_PLAY) + if (id != ID_PLAY) { cnvs->playpos->StopListen(); } switch (id) { - case MEN_EQUALIZER: + case ID_EFFECTS_EQUALIZER: if (equalizer == 0) equalizer = new tEqualizer(*this); equalizer->Show(TRUE); @@ -1032,13 +1013,13 @@ spl.Flip(1); break; - case MEN_DISTORTION: + case ID_EFFECTS_DISTORTION: if (distortion == 0) distortion = new tDistortion(*this); distortion->Show(TRUE); break; - case MEN_REVERB: + case ID_EFFECTS_REVERB: #ifdef OBSOLETE if (reverb == 0) { @@ -1054,7 +1035,7 @@ #endif break; - case MEN_REVERSE: + case ID_EFFECTS_REVERSE: { int fr, to; if (HaveSelection(fr, to)) @@ -1065,7 +1046,7 @@ } break; - case MEN_SHIFTER: + case ID_EFFECTS_PITCH_SHIFTER: #ifdef OBSOLETE if (shifter == 0) { @@ -1080,7 +1061,7 @@ #endif break; - case MEN_STRETCHER: + case ID_EFFECTS_STRETCHER: #ifdef OBSOLETE if (stretcher == 0) { @@ -1095,7 +1076,7 @@ #endif break; - case MEN_FILTER: + case ID_EFFECTS_FILTER: #ifdef OBSOLETE if (filter == 0) { @@ -1108,7 +1089,7 @@ #endif break; - case MEN_SETTINGS: + case ID_VIEW_SETTINGS: #ifdef OBSOLETE if (settings == 0) { @@ -1121,7 +1102,7 @@ #endif break; - case MEN_ECHO: + case ID_EFFECTS_ECHO: #ifdef OBSOLETE if (echo == 0) { @@ -1136,7 +1117,7 @@ #endif break; - case MEN_CHORUS: + case ID_EFFECTS_CHORUS: #ifdef OBSOLETE if (chorus == 0) { @@ -1151,7 +1132,7 @@ #endif break; - case MEN_SYNTH: + case ID_EFFECTS_SYNTH: if (synth == 0) synth = new tSynthDlg(*this); synth->Show(TRUE); @@ -1168,7 +1149,7 @@ } break; - case MEN_CANCEL: + case ID_PAINTER_NONE: if (on_accept) { delete on_accept; @@ -1209,22 +1190,22 @@ SetViewPos(0, spl.GetLength()); break; - case MEN_VOLUME_MAX: + case ID_EDIT_MAXIMIZE_VOLUME: spl.Rescale(); Redraw(); break; - case MEN_VOLUME_PNT: + case ID_PAINTERS_VOLUME: delete on_accept; on_accept = new tCommandPainter(*this, vol_command); break; - case MEN_WAHWAH: + case ID_PAINTER_WAHWAH: delete on_accept; on_accept = new tCommandPainter(*this, wah_command); break; - case MEN_WAHSETTINGS: + case ID_SETTINGS_WAHWAH: #ifdef OBSOLETE if (wah_settings == 0) { @@ -1237,7 +1218,7 @@ #endif break; - case MEN_TRANSP_SET: + case ID_SETTINGS_PITCH_PAINTER: #ifdef OBSOLETE if (pitch_settings == 0) { @@ -1251,7 +1232,7 @@ break; - case MEN_PAN_PNT: + case ID_PAINTER_PAN: delete on_accept; on_accept = new tCommandPainter(*this, pan_command); break; @@ -1319,39 +1300,46 @@ } break; - case MEN_TRANSP_PNT: + case ID_PAINTER_PITCH: delete on_accept; SetViewPos(0, spl.GetLength()); on_accept = new tCommandPainter(*this, pitch_command); break; - case MEN_REVERT: + case ID_FILE_REVERT_TO_SAVED: cnvs->ClearSelection(); if (spl.Load(TRUE)) LoadError(spl); Redraw(); break; - case MEN_CLOSE: + case wxID_CLOSE: // DELETE_THIS(); Destroy(); break; - case MEN_PLAY: + case ID_PLAY: cnvs->Play(); break; - case MEN_LOAD: + case wxID_OPEN: { char *defname = copystring(spl.GetFilename()); - wxString fname = file_selector(defname, "Load Sample", FALSE, FALSE, "*.wav"); + wxString fname = file_selector( + defname, + "Load Sample", + FALSE, + FALSE, + "*.wav"); if (!fname.empty()) { wxBeginBusyCursor(); cnvs->ClearSelection(); spl.SetFilename(fname); if (spl.Load(TRUE)) + { LoadError(spl); + } spl->RefreshDialogs(); SetTitle(fname); Redraw(); @@ -1361,14 +1349,19 @@ } break; - case MEN_SAVEAS: + case wxID_SAVEAS: { char *defname = copystring(spl.GetFilename()); - wxString fname = file_selector(defname, "Save Sample", TRUE, FALSE, "*.wav"); + wxString fname = file_selector( + defname, + "Save Sample", + TRUE, + FALSE, + "*.wav"); if (!fname.empty()) { spl.SetFilename(fname); - OnMenuCommand(MEN_SAVE); + OnMenuCommand(wxID_SAVE); spl->RefreshDialogs(); SetTitle(fname); } @@ -1376,11 +1369,11 @@ } break; - case MEN_SAVE: + case wxID_SAVE: { if (spl.GetFilename()[0] == 0) { - OnMenuCommand(MEN_SAVEAS); + OnMenuCommand(wxID_SAVEAS); } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2010-07-03 14:12:49
|
Revision: 787 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=787&view=rev Author: pstieber Date: 2010-07-03 14:12:43 +0000 (Sat, 03 Jul 2010) Log Message: ----------- 1. Separated the location of the help file into a separate function. 2. Allowed the user to opt out of finding the help file earlier in the process. Modified Paths: -------------- trunk/jazz/src/JazzPlusPlusApplication.cpp trunk/jazz/src/JazzPlusPlusApplication.h Modified: trunk/jazz/src/JazzPlusPlusApplication.cpp =================================================================== --- trunk/jazz/src/JazzPlusPlusApplication.cpp 2010-05-10 17:04:56 UTC (rev 786) +++ trunk/jazz/src/JazzPlusPlusApplication.cpp 2010-07-03 14:12:43 UTC (rev 787) @@ -145,11 +145,6 @@ mpProject = new JZProject; gpProject = mpProject; - wxConfigBase* pConfig = wxConfigBase::Get(); - - // Let the help system store the Jazz++ help configuration info. - mHelp.UseConfig(pConfig); - // Call base class function. This is needed for command line parsing. wxApp::OnInit(); @@ -161,6 +156,20 @@ // Show it and tell the application that it's our main window SetTopWindow(mpTrackFrame); + ConfigureHelp(); + + return true; +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZJazzPlusPlusApplication::ConfigureHelp() +{ + wxConfigBase* pConfig = wxConfigBase::Get(); + + // Let the help system store the Jazz++ help configuration info. + mHelp.UseConfig(pConfig); + // This code should be distributed with a HelpFiles subdirectory under // the directory the executable is stored in on Windows and under the // ${prefix}/shared/${appname} on Linux. @@ -233,8 +242,6 @@ pConfig->Write("/Paths/Help", HelpFilePath); } } - - return true; } //----------------------------------------------------------------------------- @@ -330,43 +337,56 @@ //----------------------------------------------------------------------------- // Description: -// The help file was not found so let the user search for it. If it is -// found, create a configuration entry so the code can find the help file path -// the next time it starts. +// This function walks the user through a top-level help file search. If +// the help file is found, create a configuration entry so the code can find +// the help file path the next time the application starts. +// +// Outputs: +// wxString& HelpFilePath: +// A user-selected path to the help file. The calling code should check +// to insure the help file is actually in this path. //----------------------------------------------------------------------------- bool JZJazzPlusPlusApplication::FindAndRegisterHelpFilePath( wxString& HelpFilePath) const { wxString Message; - Message = "Unable to find " + mHelpFileName; - ::wxMessageBox(Message, "Please Locate This File!"); + Message = + "Unable to find " + mHelpFileName + "\n" + + "Would you like to locate this file?"; + int Response = ::wxMessageBox( + Message, + "Cannnot Find Help File", + wxOK | wxCANCEL); - // Use an open dialog to find the help file. - wxFileDialog OpenDialog( - 0, - "Open the Help File", - HelpFilePath, - mHelpFileName, - "*.hhp", - wxFD_OPEN); - - if (OpenDialog.ShowModal() == wxID_OK) + if (Response == wxOK) { - // Generate a c-style string that contains a path to the help file. - wxString TempHelpFilePath; - TempHelpFilePath = ::wxPathOnly(OpenDialog.GetPath()); - TempHelpFilePath += ::wxFileName::GetPathSeparator(); + // Use an open dialog to find the help file. + wxFileDialog OpenDialog( + 0, + "Open the Help File", + HelpFilePath, + mHelpFileName, + "*.hhp", + wxFD_OPEN); - wxConfigBase* pConfig = wxConfigBase::Get(); - if (pConfig) + if (OpenDialog.ShowModal() == wxID_OK) { - pConfig->Write("/Paths/Help", TempHelpFilePath); - } + // Generate a string that contains a path to the help file. + wxString TempHelpFilePath; + TempHelpFilePath = ::wxPathOnly(OpenDialog.GetPath()); + TempHelpFilePath += ::wxFileName::GetPathSeparator(); - // Return the user selected help file path. - HelpFilePath = TempHelpFilePath; + wxConfigBase* pConfig = wxConfigBase::Get(); + if (pConfig) + { + pConfig->Write("/Paths/Help", TempHelpFilePath); + } - return true; + // Return the user selected help file path. + HelpFilePath = TempHelpFilePath; + + return true; + } } return false; Modified: trunk/jazz/src/JazzPlusPlusApplication.h =================================================================== --- trunk/jazz/src/JazzPlusPlusApplication.h 2010-05-10 17:04:56 UTC (rev 786) +++ trunk/jazz/src/JazzPlusPlusApplication.h 2010-07-03 14:12:43 UTC (rev 787) @@ -91,6 +91,8 @@ private: + void ConfigureHelp(); + void InsureConfigurationFileExistence() const; bool FindAndRegisterHelpFilePath(wxString& HelpFilePath) const; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2010-07-11 21:45:32
|
Revision: 789 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=789&view=rev Author: pstieber Date: 2010-07-11 21:45:22 +0000 (Sun, 11 Jul 2010) Log Message: ----------- 1. Changed GetFilename and SetFilename to GetFileName and SetFileName in tSample. 2. Changed the char* filename data member of tSample to std::string mFileName. 3. Changed the file name argument in tSampleSet::AddNote to std::string. 4. Changed TRUE to true and FALSE to false in SampleWindow.cpp. 5. Changed fname to FileName. Modified Paths: -------------- trunk/jazz/src/Audio.cpp trunk/jazz/src/Audio.h trunk/jazz/src/Sample.cpp trunk/jazz/src/Sample.h trunk/jazz/src/SampleWindow.cpp Modified: trunk/jazz/src/Audio.cpp =================================================================== --- trunk/jazz/src/Audio.cpp 2010-07-11 21:19:45 UTC (rev 788) +++ trunk/jazz/src/Audio.cpp 2010-07-11 21:45:22 UTC (rev 789) @@ -321,7 +321,7 @@ continue; } assert(0 <= key && key < eSampleCount); - mSamples[key]->SetFilename(SplFilePath.c_str()); + mSamples[key]->SetFileName(SplFilePath.c_str()); mSamples[key]->SetLabel(Label.c_str()); mSamples[key]->SetVolume(vol); mSamples[key]->SetPan(pan); @@ -331,7 +331,7 @@ wxString String; String << "Could not load: \"" - << mSamples[key]->GetFilename() + << mSamples[key]->GetFileName() << '"'; ::wxMessageBox(String, "Error", wxOK); } @@ -365,14 +365,14 @@ for (int i = 0; i < eSampleCount; i++) { tSample* pSample = mSamples[i]; - const char* fname = pSample->GetFilename(); + const string& FileName = pSample->GetFileName(); int vol = pSample->GetVolume(); int pan = pSample->GetPan(); int pitch = pSample->GetPitch(); - if (fname[0]) + if (!FileName.empty()) { Ofs << i << ' '; - WriteString(Ofs, fname); + WriteString(Ofs, FileName); Ofs << ' '; WriteString(Ofs, pSample->GetLabel()); Ofs << ' ' << pan << ' ' << vol << ' ' << pitch << endl; @@ -850,15 +850,15 @@ //----------------------------------------------------------------------------- void tSampleSet::LoadSampleSet(wxWindow* pParent) { - wxString fname = file_selector( + wxString FileName = file_selector( mDefaultFileName, "Load Sample Set", false, has_changed, "*.spl"); - if (fname) + if (FileName) { - Load(fname); + Load(FileName); } } @@ -867,15 +867,15 @@ //----------------------------------------------------------------------------- void tSampleSet::SaveSampleSetAs(wxWindow* pParent) { - wxString fname = file_selector( + wxString FileName = file_selector( mDefaultFileName, "Save Sample Set", true, has_changed, "*.spl"); - if (fname) + if (FileName) { - Save(fname); + Save(FileName); } } @@ -948,17 +948,19 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void tSampleSet::AddNote(const char *fname, long frc, long toc) +void tSampleSet::AddNote(const string& FileName, long frc, long toc) { int i; tSample *spl; - // see if fname is already present in sample list + // See if the file name is already present in sample list. for (i = 0; i < eSampleCount; i++) { spl = mSamples[i]; - if (strcmp(spl->GetFilename(), fname) == 0) + if (spl->GetFileName() == FileName) + { break; + } } // if no entry is there, add an entry @@ -968,8 +970,10 @@ for (i = 15; i < eSampleCount; i++) { spl = mSamples[i]; - if (spl->GetFilename()[0] == 0) + if (spl->GetFileName()[0] == 0) + { break; + } } } @@ -978,8 +982,8 @@ int key = i; spl->Clear(); // reset everything to defaults - spl->SetFilename(fname); - spl->SetLabel(wxFileNameFromPath((char *)fname)); + spl->SetFileName(FileName); + spl->SetLabel(wxFileNameFromPath(FileName)); spl->Load(); // reload data // delete selection @@ -1203,7 +1207,7 @@ mpPanSlider->SetValue(spl->GetPan()); #ifdef OBSOLETE pLabel->SetValue((char *)spl->GetLabel()); - file->SetValue((char *)spl->GetFilename()); + file->SetValue((char *)spl->GetFileName()); #endif } @@ -1217,7 +1221,7 @@ spl->SetPan(mpPanSlider->GetValue()); #ifdef OBSOLETE spl->SetLabel(pLabel->GetValue()); - spl->SetFilename(file->GetValue()); + spl->SetFileName(file->GetValue()); #endif } Modified: trunk/jazz/src/Audio.h =================================================================== --- trunk/jazz/src/Audio.h 2010-07-11 21:19:45 UTC (rev 788) +++ trunk/jazz/src/Audio.h 2010-07-11 21:45:22 UTC (rev 789) @@ -363,7 +363,7 @@ long toc, tAudioRecordBuffer &buf); - void AddNote(const char *fname, long frc, long toc); + void AddNote(const std::string& FileName, long frc, long toc); void RefreshDialogs(); Modified: trunk/jazz/src/Sample.cpp =================================================================== --- trunk/jazz/src/Sample.cpp 2010-07-11 21:19:45 UTC (rev 788) +++ trunk/jazz/src/Sample.cpp 2010-07-11 21:45:22 UTC (rev 789) @@ -40,13 +40,13 @@ tSample::tSample(tSampleSet &s) : set(s), - mLabel() + mLabel(), + mFileName() { data = 0; length = 0; external_flag = 1; // auto reload when file changes on disk external_time = 0; - filename = copystring(""); volume = 127; pan = 0; pitch = 0; @@ -57,7 +57,6 @@ tSample::~tSample() { delete [] data; - delete [] filename; } void tSample::SetLabel(const std::string& Label) @@ -65,25 +64,21 @@ mLabel = Label; } -void tSample::SetFilename(const char *fname) +void tSample::SetFileName(const string& FileName) { - if (strcmp(filename, fname) != 0) + if (mFileName != FileName) { dirty = 1; - char *s = copystring(fname); - mLabel = wxFileNameFromPath(s); - delete [] s; + mLabel = wxFileNameFromPath(FileName.c_str()); } - delete [] filename; - filename = copystring(fname); + mFileName = FileName; } void tSample::Clear() { FreeData(); mLabel.clear(); - delete [] filename; - filename = copystring(""); + mFileName.clear(); volume = 127; pan = 0; pitch = 0; @@ -171,15 +166,15 @@ int tSample::LoadWav() { struct stat buf; - if (stat(filename, &buf) == -1) + if (stat(mFileName.c_str(), &buf) == -1) { - perror(filename); + perror(mFileName.c_str()); return 1; } external_time = buf.st_mtime; // read and check header info - ifstream is(filename, ios::binary | ios::in); + ifstream is(mFileName.c_str(), ios::binary | ios::in); WaveHeader wh; memset(&wh, 0, sizeof(wh)); is.read((char *)&wh, sizeof(wh)); @@ -188,12 +183,12 @@ || wh.sub_chunk != FMT || wh.data_chunk != DATA) { - //fprintf(stderr, "%s format not recognized\n", filename); + //fprintf(stderr, "%s format not recognized\n", mFileName.c_str()); return 2; } if (wh.format != PCM_CODE) { - //fprintf(stderr, "%s must be PCM_CODE\n", filename); + //fprintf(stderr, "%s must be PCM_CODE\n", mFileName.c_str()); return 3; } @@ -230,9 +225,9 @@ int tSample::LoadWav() { struct stat buf; - if (stat(filename, &buf) == -1) + if (stat(mFileName.c_str(), &buf) == -1) { - perror(filename); + perror(mFileName.c_str()); return 1; } external_time = buf.st_mtime; @@ -240,7 +235,7 @@ ChunkHeader ch; // read and check header info - ifstream is(filename, ios::binary | ios::in); + ifstream is(mFileName.c_str(), ios::binary | ios::in); RIFFHeader rh; is.read((char *)&rh, sizeof(rh)); if (strncmp(rh.main_type, "RIFF", 4) || strncmp(rh.sub_type, "WAVE", 4)) @@ -381,15 +376,15 @@ { // determine file size struct stat buf; - if (stat(filename, &buf) == -1) + if (stat(mFileName.c_str(), &buf) == -1) { - perror(filename); + perror(mFileName.c_str()); return 1; } length = buf.st_size/2; external_time = buf.st_mtime; - ifstream is(filename, ios::binary | ios::in); + ifstream is(mFileName.c_str(), ios::binary | ios::in); data = new short [length]; is.read((char *)data, length * 2); return 0; @@ -399,12 +394,12 @@ int tSample::Load(int force) { // sample modified on disk? - if (filename && filename[0] && !force && !dirty && external_flag) + if (!mFileName.empty() && !force && !dirty && external_flag) { struct stat buf; - if (stat(filename, &buf) == -1) + if (stat(mFileName.c_str(), &buf) == -1) { - perror(filename); + perror(mFileName.c_str()); return 1; } if (external_time != buf.st_mtime) @@ -414,7 +409,7 @@ if (force || dirty) { FreeData(); - if (filename && filename[0]) + if (!mFileName.empty()) { int rc = LoadWav(); dirty = 0; @@ -703,9 +698,9 @@ wh.length = wh.data_length + sizeof(WaveHeader); #ifdef __WXMSW__ - unlink(filename); // buggy, sigh! + unlink(mFileName.c_str()); // buggy, sigh! #endif - ofstream os(filename, ios::out | ios::binary | ios::trunc); + ofstream os(mFileName.c_str(), ios::out | ios::binary | ios::trunc); os.write((char *)&wh, sizeof(wh)); os.write((char *)data, length * sizeof(short)); Modified: trunk/jazz/src/Sample.h =================================================================== --- trunk/jazz/src/Sample.h 2010-07-11 21:19:45 UTC (rev 788) +++ trunk/jazz/src/Sample.h 2010-07-11 21:45:22 UTC (rev 789) @@ -258,10 +258,10 @@ return pitch; } - void SetFilename(const char *fname); - const char *GetFilename() const + void SetFileName(const std::string& FileName); + const std::string& GetFileName() const { - return filename; + return mFileName; } int GetLength() const @@ -412,7 +412,7 @@ tSampleSet& set; std::string mLabel; - char* filename; + std::string mFileName; int volume; int pan; int pitch; // delta pitch Modified: trunk/jazz/src/SampleWindow.cpp =================================================================== --- trunk/jazz/src/SampleWindow.cpp 2010-07-11 21:19:45 UTC (rev 788) +++ trunk/jazz/src/SampleWindow.cpp 2010-07-11 21:45:22 UTC (rev 789) @@ -219,7 +219,7 @@ player(p), spl(s) { - visible = FALSE; + visible = false; x = 0; } @@ -301,7 +301,7 @@ sel_fr = sel_to = -1; mouse_up_sets_insertion_point = 0; playpos = new tSamplePlayPosition(*this, gpMidiPlayer, spl); - midi_time = TRUE; + midi_time = true; midi_offs = 0; mouse_down = 0; } @@ -340,7 +340,7 @@ if (MouseEvent.LeftDown()) { mouse_up_sets_insertion_point = 0; - mouse_down = TRUE; + mouse_down = true; if (snapsel.IsSelected()) { snapsel.Draw(*pDc, 0, 0); @@ -358,7 +358,7 @@ } else if (MouseEvent.LeftUp()) { - mouse_down = FALSE; + mouse_down = false; snapsel.ProcessMouseEvent(MouseEvent, 0, 0); if (snapsel.IsSelected()) { @@ -668,16 +668,16 @@ static JZToolDef tdefs[] = { - { wxID_OPEN, FALSE, open_xpm, "open wave file" }, - { wxID_SAVE, FALSE, save_xpm, "save wave file" }, + { 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" }, + { 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" }, + { ID_PLAY, false, play_xpm, "play sample" }, + { MEN_HELP, false, help_xpm, "help" }, { JZToolBar::eToolBarEnd } }; @@ -692,11 +692,11 @@ tSample *tSampleWin::copy_buffer; -tSampleWin::tSampleWin(wxWindow* pParent, tSampleWin **ref, tSample &sample) +tSampleWin::tSampleWin(wxWindow* pParent, tSampleWin **ref, tSample& sample) : wxFrame( pParent, wxID_ANY, - (char *)sample.GetFilename(), + sample.GetFileName(), wxPoint(geo[0], geo[1]), wxSize(geo[2], geo[3])), spl(sample), @@ -707,7 +707,7 @@ { this->ref = ref; - in_constructor = TRUE; + in_constructor = true; cnvs = 0; mpToolBar = 0; @@ -820,7 +820,7 @@ // zoom_scrol->SetValue(0); zoom_scrol->SetScrollbar(0, 10, 1000, 100); - in_constructor = FALSE; + in_constructor = false; // now force a resize for motif int cw, ch; @@ -858,7 +858,7 @@ bool tSampleWin::OnClose() { - return TRUE; + return true; } @@ -911,14 +911,14 @@ if (cnvs->sel_fr == cnvs->sel_to && cnvs->sel_fr >= 0) { offs = cnvs->sel_fr; - return TRUE; + return true; } else { offs = -1; if (warn) wxMessageBox("please set insertion point first", "Error", wxOK); - return FALSE; + return false; } } @@ -928,18 +928,18 @@ { fr_smpl = cnvs->sel_fr; to_smpl = cnvs->sel_to; - return TRUE; + return true; } else if (mode == SelAll) { fr_smpl = 0; to_smpl = spl.GetLength(); - return TRUE; + return true; } fr_smpl = to_smpl = -1; if (mode == SelWarn) wxMessageBox("please select samples first", "Error", wxOK); - return FALSE; + return false; } @@ -979,7 +979,7 @@ void tSampleWin::LoadError(tSample &spl) { char buf[500]; - sprintf(buf, "could not load \"%s\"", spl.GetFilename()); + sprintf(buf, "could not load \"%s\"", spl.GetFileName()); wxMessageBox(buf, "Error", wxOK); } @@ -1003,7 +1003,7 @@ case ID_EFFECTS_EQUALIZER: if (equalizer == 0) equalizer = new tEqualizer(*this); - equalizer->Show(TRUE); + equalizer->Show(true); break; case MEN_FLIP_LEFT: @@ -1016,7 +1016,7 @@ case ID_EFFECTS_DISTORTION: if (distortion == 0) distortion = new tDistortion(*this); - distortion->Show(TRUE); + distortion->Show(true); break; case ID_EFFECTS_REVERB: @@ -1031,7 +1031,7 @@ } ClearSelection(); SetViewPos(0, spl.GetLength()); - reverb->Show(TRUE); + reverb->Show(true); #endif break; @@ -1050,14 +1050,14 @@ #ifdef OBSOLETE if (shifter == 0) { - shifter = new wxDialogBox(this, "Shifter", FALSE ); + shifter = new wxDialogBox(this, "Shifter", false ); tShifterForm *form = new tShifterForm(*this); form->EditForm(shifter); shifter->Fit(); } ClearSelection(); SetViewPos(0, spl.GetLength()); - shifter->Show(TRUE); + shifter->Show(true); #endif break; @@ -1065,14 +1065,14 @@ #ifdef OBSOLETE if (stretcher == 0) { - stretcher = new wxDialogBox(this, "Stretcher", FALSE ); + stretcher = new wxDialogBox(this, "Stretcher", false ); tStretcherForm *form = new tStretcherForm(*this); form->EditForm(stretcher); stretcher->Fit(); } ClearSelection(); SetViewPos(0, spl.GetLength()); - stretcher->Show(TRUE); + stretcher->Show(true); #endif break; @@ -1080,12 +1080,12 @@ #ifdef OBSOLETE if (filter == 0) { - filter = new wxDialogBox(this, "Filter", FALSE ); + filter = new wxDialogBox(this, "Filter", false ); tSplFilterForm *form = new tSplFilterForm(*this); form->EditForm(filter); filter->Fit(); } - filter->Show(TRUE); + filter->Show(true); #endif break; @@ -1093,12 +1093,12 @@ #ifdef OBSOLETE if (settings == 0) { - settings = new wxDialogBox(this, "Settings", FALSE ); + settings = new wxDialogBox(this, "Settings", false ); tSmplWinSettingsForm *form = new tSmplWinSettingsForm(*this); form->EditForm(settings); settings->Fit(); } - settings->Show(TRUE); + settings->Show(true); #endif break; @@ -1106,14 +1106,14 @@ #ifdef OBSOLETE if (echo == 0) { - echo = new wxDialogBox(this, "Echo", FALSE ); + echo = new wxDialogBox(this, "Echo", false ); tEchoForm *form = new tEchoForm(*this); form->EditForm(echo); echo->Fit(); } ClearSelection(); SetViewPos(0, spl.GetLength()); - echo->Show(TRUE); + echo->Show(true); #endif break; @@ -1121,21 +1121,21 @@ #ifdef OBSOLETE if (chorus == 0) { - chorus = new wxDialogBox(this, "Chorus", FALSE ); + chorus = new wxDialogBox(this, "Chorus", false ); tChorusForm *form = new tChorusForm(*this); form->EditForm(chorus); chorus->Fit(); } ClearSelection(); SetViewPos(0, spl.GetLength()); - chorus->Show(TRUE); + chorus->Show(true); #endif break; case ID_EFFECTS_SYNTH: if (synth == 0) synth = new tSynthDlg(*this); - synth->Show(TRUE); + synth->Show(true); break; case MEN_ACCEPT: @@ -1209,12 +1209,12 @@ #ifdef OBSOLETE if (wah_settings == 0) { - wah_settings = new wxDialogBox(this, "Filter Painter", FALSE); + wah_settings = new wxDialogBox(this, "Filter Painter", false); tWahSettingsForm *form = new tWahSettingsForm(*this); form->EditForm(wah_settings); wah_settings->Fit(); } - wah_settings->Show(TRUE); + wah_settings->Show(true); #endif break; @@ -1227,7 +1227,7 @@ form->EditForm(pitch_settings); pitch_settings->Fit(); } - pitch_settings->Show(TRUE); + pitch_settings->Show(true); #endif break; @@ -1252,7 +1252,7 @@ case wxID_PASTE: { int offs, fr, to; - if (HaveInsertionPoint(offs, FALSE)) + if (HaveInsertionPoint(offs, false)) { spl.PasteIns(*copy_buffer, offs); cnvs->SetSelection(offs, offs + copy_buffer->GetLength()); @@ -1308,7 +1308,7 @@ case ID_FILE_REVERT_TO_SAVED: cnvs->ClearSelection(); - if (spl.Load(TRUE)) + if (spl.Load(true)) LoadError(spl); Redraw(); break; @@ -1324,54 +1324,50 @@ case wxID_OPEN: { - char *defname = copystring(spl.GetFilename()); - wxString fname = file_selector( - defname, + wxString FileName = file_selector( + spl.GetFileName(), "Load Sample", - FALSE, - FALSE, + false, + false, "*.wav"); - if (!fname.empty()) + if (!FileName.empty()) { wxBeginBusyCursor(); cnvs->ClearSelection(); - spl.SetFilename(fname); - if (spl.Load(TRUE)) + spl.SetFileName(FileName); + if (spl.Load(true)) { LoadError(spl); } spl->RefreshDialogs(); - SetTitle(fname); + SetTitle(FileName); Redraw(); wxEndBusyCursor(); } - delete [] defname; } break; case wxID_SAVEAS: { - char *defname = copystring(spl.GetFilename()); - wxString fname = file_selector( - defname, + wxString FileName = file_selector( + spl.GetFileName(), "Save Sample", - TRUE, - FALSE, + true, + false, "*.wav"); - if (!fname.empty()) + if (!FileName.empty()) { - spl.SetFilename(fname); + spl.SetFileName(FileName); OnMenuCommand(wxID_SAVE); spl->RefreshDialogs(); - SetTitle(fname); + SetTitle(FileName); } - delete [] defname; } break; case wxID_SAVE: { - if (spl.GetFilename()[0] == 0) + if (spl.GetFileName().empty()) { OnMenuCommand(wxID_SAVEAS); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2010-07-12 01:55:17
|
Revision: 791 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=791&view=rev Author: pstieber Date: 2010-07-12 01:55:11 +0000 (Mon, 12 Jul 2010) Log Message: ----------- Updated the Linux version. Modified Paths: -------------- trunk/jazz/src/AlsaDriver.cpp trunk/jazz/src/AlsaDriver.h trunk/jazz/src/AudioDriver.cpp trunk/jazz/src/AudioDriver.h Modified: trunk/jazz/src/AlsaDriver.cpp =================================================================== --- trunk/jazz/src/AlsaDriver.cpp 2010-07-12 01:21:59 UTC (rev 790) +++ trunk/jazz/src/AlsaDriver.cpp 2010-07-12 01:55:11 UTC (rev 791) @@ -127,7 +127,7 @@ { mpAudioBuffer = new tEventArray(); mInstalled = false; - audio_enabled = 0; + mAudioEnabled = false; mpListener = 0; mCanDuplex = 0; // no duplex yet. pcm[PLAYBACK] = NULL; @@ -139,7 +139,7 @@ // FIXME mCanDuplex = 1; mInstalled = true; - audio_enabled = 1; + mAudioEnabled = true; } @@ -181,7 +181,7 @@ mSamples.StartPlay(clock); tAlsaPlayer::StartPlay(clock, loopClock, cont); - if (!audio_enabled) + if (!mAudioEnabled) { return; } @@ -213,7 +213,7 @@ if (running_mode == 0) { - audio_enabled = 0; + mAudioEnabled = false; return; } @@ -241,7 +241,7 @@ void tAlsaAudioPlayer::OpenDsp(int mode, int sync_mode) { - if (!audio_enabled) + if (!mAudioEnabled) { return; } @@ -260,7 +260,7 @@ format = SND_PCM_FORMAT_S16_LE; frame_shift[mode]++; } - channels = mSamples.GetChannels(); + channels = mSamples.GetChannelCount(); if (channels > 1) { frame_shift[mode]++; @@ -276,7 +276,7 @@ SND_PCM_NONBLOCK) < 0) { perror("snd_pcm_open"); - audio_enabled = 0; + mAudioEnabled = false; return; } @@ -298,9 +298,11 @@ perror("cannot set audio channels"); goto __error; } - if (snd_pcm_hw_params_set_rate(pcm[mode], hw, mSamples.GetSpeed(), 0) < 0) + if ( + snd_pcm_hw_params_set_rate(pcm[mode], hw, mSamples.GetSamplingRate(), 0) < + 0) { - cerr << "cannot set audio rate: " << mSamples.GetSpeed() << endl; + cerr << "cannot set audio rate: " << mSamples.GetSamplingRate() << endl; goto __error; } @@ -354,7 +356,7 @@ __error: snd_pcm_close(pcm[mode]); pcm[mode] = NULL; - audio_enabled = 0; + mAudioEnabled = false; return; } @@ -405,7 +407,7 @@ void tAlsaAudioPlayer::Notify() { - if (audio_enabled) + if (mAudioEnabled) { if (pcm[PLAYBACK]) { @@ -446,7 +448,7 @@ int tAlsaAudioPlayer::WriteSamples() { - if (!audio_enabled || pcm[PLAYBACK] == NULL) + if (!mAudioEnabled || pcm[PLAYBACK] == NULL) { return 0; } @@ -495,7 +497,7 @@ void tAlsaAudioPlayer::ReadSamples() { - if (!audio_enabled || pcm[CAPTURE] == NULL) + if (!mAudioEnabled || pcm[CAPTURE] == NULL) { return; } @@ -535,7 +537,7 @@ void tAlsaAudioPlayer::MidiSync() { - if (!audio_enabled) + if (!mAudioEnabled) { return; } @@ -615,7 +617,7 @@ { mSamples.StopPlay(); tAlsaPlayer::StopPlay(); - if (!audio_enabled) + if (!mAudioEnabled) { return; } @@ -640,7 +642,7 @@ void tAlsaAudioPlayer::ListenAudio(int key, int start_stop_mode) { - if (!audio_enabled) + if (!mAudioEnabled) { return; } @@ -670,7 +672,7 @@ void tAlsaAudioPlayer::ListenAudio(tSample& spl, long fr_smpl, long to_smpl) { - if (!audio_enabled) + if (!mAudioEnabled) { return; } Modified: trunk/jazz/src/AlsaDriver.h =================================================================== --- trunk/jazz/src/AlsaDriver.h 2010-07-12 01:21:59 UTC (rev 790) +++ trunk/jazz/src/AlsaDriver.h 2010-07-12 01:55:11 UTC (rev 791) @@ -47,13 +47,13 @@ { return mInstalled && tAlsaPlayer::IsInstalled(); } - virtual int GetAudioEnabled() const + virtual bool GetAudioEnabled() const { - return audio_enabled; + return mAudioEnabled; } - virtual void SetAudioEnabled(int x) + virtual void SetAudioEnabled(bool AudioEnabled) { - audio_enabled = x; + mAudioEnabled = AudioEnabled; } virtual void ListenAudio(int key, int start_stop_mode = 1); virtual void ListenAudio(tSample &spl, long fr_smpl, long to_smpl); @@ -100,8 +100,10 @@ int running_mode; int midi_speed; // start speed in bpm int curr_speed; // actual speed in bpm - int audio_enabled; // 0 means midi only + // False means MIDI only. + bool mAudioEnabled; + int card; // card number in config std::string mDeviceNames[2]; // device names long frag_size[2]; Modified: trunk/jazz/src/AudioDriver.cpp =================================================================== --- trunk/jazz/src/AudioDriver.cpp 2010-07-12 01:21:59 UTC (rev 790) +++ trunk/jazz/src/AudioDriver.cpp 2010-07-12 01:55:11 UTC (rev 791) @@ -121,11 +121,9 @@ tAudioPlayer::tAudioPlayer(JZSong* pSong) : tSeq2Player(pSong) { - long dummy = 0; mpAudioBuffer = new tEventArray(); mInstalled = false; - dummy = gpConfig->GetValue(C_EnableAudio); - audio_enabled = dummy; + mAudioEnabled = (gpConfig->GetValue(C_EnableAudio) != 0); mpListener = 0; mCanDuplex = 0; // no duplex yet. dev = -1; @@ -164,7 +162,7 @@ } dev = -1; // closed - audio_enabled = audio_enabled && mInstalled; + mAudioEnabled = mAudioEnabled && mInstalled; } @@ -191,7 +189,7 @@ void tAudioPlayer::StartAudio() { - if (!audio_enabled) + if (!mAudioEnabled) { return; } @@ -233,7 +231,7 @@ { int tmp; - if (!audio_enabled) + if (!mAudioEnabled) { return; } @@ -269,7 +267,7 @@ if (dev < 0) { perror(AUDIO_DEVICE); - audio_enabled = 0; + mAudioEnabled = false; return; } @@ -291,13 +289,13 @@ cerr << "Unable to set the sample size" << endl; } - tmp = (mSamples.GetChannels() == 1) ? 0 : 1; + tmp = (mSamples.GetChannelCount() == 1) ? 0 : 1; if (ioctl (dev, SNDCTL_DSP_STEREO, &tmp) == -1) { cerr << "Unable to set mono/stereo" << endl; } - tmp = mSamples.GetSpeed(); + tmp = mSamples.GetSamplingRate(); if (ioctl (dev, SNDCTL_DSP_SPEED, &tmp) == -1) { perror("ioctl DSP_SPEED"); @@ -346,7 +344,7 @@ void tAudioPlayer::Notify() { - if (audio_enabled) + if (mAudioEnabled) { if (PlaybackMode()) { @@ -373,7 +371,7 @@ int tAudioPlayer::WriteSamples() { - if (!audio_enabled) + if (!mAudioEnabled) { return 0; } @@ -451,7 +449,7 @@ // everything works. In OSS, there are no docs and if it works // with kernel x it wont with kernel y. - if (!audio_enabled) + if (!mAudioEnabled) { return; } @@ -525,7 +523,7 @@ { mSamples.StopPlay(); tSeq2Player::StopPlay(); - if (!audio_enabled) + if (!mAudioEnabled) { return; } @@ -552,7 +550,7 @@ void tAudioPlayer::ListenAudio(int key, int start_stop_mode) { - if (!audio_enabled) + if (!mAudioEnabled) { return; } @@ -582,7 +580,7 @@ void tAudioPlayer::ListenAudio(tSample &spl, long fr_smpl, long to_smpl) { - if (!audio_enabled) + if (!mAudioEnabled) { return; } Modified: trunk/jazz/src/AudioDriver.h =================================================================== --- trunk/jazz/src/AudioDriver.h 2010-07-12 01:21:59 UTC (rev 790) +++ trunk/jazz/src/AudioDriver.h 2010-07-12 01:55:11 UTC (rev 791) @@ -65,14 +65,14 @@ return mInstalled && tSeq2Player::IsInstalled(); } - virtual int GetAudioEnabled() const + virtual bool GetAudioEnabled() const { - return audio_enabled; + return mAudioEnabled; } - virtual void SetAudioEnabled(int x) + virtual void SetAudioEnabled(bool AudioEnabled) { - audio_enabled = x; + mAudioEnabled = AudioEnabled; } virtual void ListenAudio(int key, int start_stop_mode = 1); @@ -113,8 +113,10 @@ long audio_bytes; int midi_speed; // start speed in bpm int curr_speed; // actual speed in bpm - int audio_enabled; // 0 means midi only + // False means MIDI only. + int mAudioEnabled; + tAudioListener* mpListener; tAudioRecordBuffer recbuffers; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2010-07-12 04:24:21
|
Revision: 792 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=792&view=rev Author: pstieber Date: 2010-07-12 04:24:15 +0000 (Mon, 12 Jul 2010) Log Message: ----------- 1. Changed the tSampleSet data member bits to mBitsPerSample. 2. Changed tSampleSet::BitsPerSample to tSampleSet::GetBitsPerSample. 3. Changed tSampleSet::clocks_per_buffer to tSampleSet::mClocksPerBuffer and added tSampleSet::GetClocksPerBuffer 4. Removed friend status of tSample and tSampleVoice from tSampleSet. Modified Paths: -------------- trunk/jazz/src/Audio.cpp trunk/jazz/src/Audio.h trunk/jazz/src/Sample.cpp Modified: trunk/jazz/src/Audio.cpp =================================================================== --- trunk/jazz/src/Audio.cpp 2010-07-12 01:55:11 UTC (rev 791) +++ trunk/jazz/src/Audio.cpp 2010-07-12 04:24:15 UTC (rev 792) @@ -90,7 +90,7 @@ return; // not this buffer - if (buffer_clock + set.clocks_per_buffer <= clock) + if (buffer_clock + set.GetClocksPerBuffer() <= clock) return; // compute offset in buffer @@ -191,7 +191,10 @@ tSampleSet::tSampleSet(long tpm) : mSamplingRate(22050), mChannelCount(1), - bits(16), // dont change!! + + // Dont change!!! + mBitsPerSample(16), + softsync(1), mpSampleDialog(0), mDefaultFileName("noname.spl"), @@ -413,7 +416,7 @@ ticks_per_minute = tpm; event_index = 0; bufshorts = BUFSHORTS; - clocks_per_buffer = Samples2Ticks(bufshorts); + mClocksPerBuffer = Samples2Ticks(bufshorts); num_voices = 0; return 0; } @@ -428,7 +431,7 @@ return 1; } bufshorts = bufsize / 2; - clocks_per_buffer = Samples2Ticks(bufshorts); + mClocksPerBuffer = Samples2Ticks(bufshorts); return 0; } @@ -454,7 +457,8 @@ } else { - nfree = (int)((last_clock - start_clock) / clocks_per_buffer) - buffers_written; + nfree = (int)( + (last_clock - start_clock) / mClocksPerBuffer) - buffers_written; } if (nfree <= 0) @@ -1024,8 +1028,8 @@ wh.modus = mChannelCount; wh.sc_len = 16; wh.sample_fq = mSamplingRate; - wh.bit_p_spl = bits; - wh.byte_p_spl = mChannelCount * (bits > 8 ? 2 : 1); + wh.bit_p_spl = mBitsPerSample; + wh.byte_p_spl = mChannelCount * (mBitsPerSample > 8 ? 2 : 1); wh.byte_p_sec = wh.byte_p_spl * wh.sample_fq; Modified: trunk/jazz/src/Audio.h =================================================================== --- trunk/jazz/src/Audio.h 2010-07-12 01:55:11 UTC (rev 791) +++ trunk/jazz/src/Audio.h 2010-07-12 04:24:15 UTC (rev 792) @@ -223,8 +223,6 @@ { private: - friend class tSampleVoice; - friend class tSample; friend class JZWindowsAudioPlayer; friend class tAudioPlayer; friend class tAlsaAudioPlayer; @@ -273,11 +271,16 @@ mChannelCount = ChannelCount; } - int BitsPerSample() const + int GetBitsPerSample() const { - return bits; + return mBitsPerSample; } + double GetClocksPerBuffer() const + { + return mClocksPerBuffer; + } + bool GetSoftSync() const { return softsync; @@ -385,12 +388,12 @@ long SampleSize(long num_samples) { - return mChannelCount * (bits == 8 ? 1L : 2L) * num_samples; + return mChannelCount * (mBitsPerSample == 8 ? 1L : 2L) * num_samples; } long BufferClock(int i) const { - return (long)(start_clock + i * clocks_per_buffer); + return (long)(start_clock + i * mClocksPerBuffer); } void SamplesDlg(); @@ -403,14 +406,16 @@ // mono = 1, stereo = 2 int mChannelCount; - int bits; // must be 16! + // This must be 16! + int mBitsPerSample; + bool softsync; // enable software midi/audio sync tSample* mSamples[eSampleCount]; tSampleWin* mSampleWindows[eSampleCount]; long ticks_per_minute; // MIDI sampling rate for audio/midi sync. - double clocks_per_buffer; + double mClocksPerBuffer; long start_clock; // when did play start int event_index; Modified: trunk/jazz/src/Sample.cpp =================================================================== --- trunk/jazz/src/Sample.cpp 2010-07-12 01:55:11 UTC (rev 791) +++ trunk/jazz/src/Sample.cpp 2010-07-12 04:24:15 UTC (rev 792) @@ -693,19 +693,20 @@ int tSample::SaveWave() { WaveHeader wh; - wh.main_chunk = RIFF; - wh.chunk_type = WAVE; - wh.sub_chunk = FMT; - wh.data_chunk = DATA; - wh.format = PCM_CODE; - wh.modus = set.GetChannelCount(); - wh.sc_len = 16; - wh.sample_fq = set.GetSamplingRate(); - wh.bit_p_spl = set.bits; - wh.byte_p_spl = set.GetChannelCount() * (set.bits > 8 ? 2 : 1); - wh.byte_p_sec = wh.byte_p_spl * wh.sample_fq; + wh.main_chunk = RIFF; + wh.chunk_type = WAVE; + wh.sub_chunk = FMT; + wh.data_chunk = DATA; + wh.format = PCM_CODE; + wh.modus = set.GetChannelCount(); + wh.sc_len = 16; + wh.sample_fq = set.GetSamplingRate(); + wh.bit_p_spl = set.GetBitsPerSample(); + wh.byte_p_spl = + set.GetChannelCount() * (set.GetBitsPerSample() > 8 ? 2 : 1); + wh.byte_p_sec = wh.byte_p_spl * wh.sample_fq; wh.data_length = length * sizeof(short); - wh.length = wh.data_length + sizeof(WaveHeader); + wh.length = wh.data_length + sizeof(WaveHeader); #ifdef __WXMSW__ unlink(mFileName.c_str()); // buggy, sigh! This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2010-07-12 04:26:33
|
Revision: 793 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=793&view=rev Author: pstieber Date: 2010-07-12 04:26:27 +0000 (Mon, 12 Jul 2010) Log Message: ----------- Changed BitsPerSample to GetBitsPerSample. 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-12 04:24:15 UTC (rev 792) +++ trunk/jazz/src/AlsaDriver.cpp 2010-07-12 04:26:27 UTC (rev 793) @@ -251,7 +251,7 @@ snd_pcm_uframes_t buffer_size, period_size; frame_shift[mode] = 0; - if (mSamples.BitsPerSample() == 8) + if (mSamples.GetBitsPerSample() == 8) { format = SND_PCM_FORMAT_U8; } Modified: trunk/jazz/src/AudioDriver.cpp =================================================================== --- trunk/jazz/src/AudioDriver.cpp 2010-07-12 04:24:15 UTC (rev 792) +++ trunk/jazz/src/AudioDriver.cpp 2010-07-12 04:26:27 UTC (rev 793) @@ -282,9 +282,9 @@ perror("ioctl DSP_SETFRAGMENT"); } - tmp = mSamples.BitsPerSample(); + tmp = mSamples.GetBitsPerSample(); ioctl(dev, SNDCTL_DSP_SAMPLESIZE, &tmp); - if (tmp != mSamples.BitsPerSample()) + if (tmp != mSamples.GetBitsPerSample()) { cerr << "Unable to set the sample size" << endl; } 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-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 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 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 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 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 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 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: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 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-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: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-19 14:13:01
|
Revision: 824 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=824&view=rev Author: pstieber Date: 2010-07-19 14:12:52 +0000 (Mon, 19 Jul 2010) Log Message: ----------- Changed MIDI file opening and saving from "File | Open..." and "File | Save" to "File | Import MIDI..." and "File | Export as MIDI...". I eventually want to put other settings in the Jazz++ project file. Modified Paths: -------------- trunk/jazz/src/Project.cpp trunk/jazz/src/Project.h trunk/jazz/src/Resources.h trunk/jazz/src/TrackFrame.cpp trunk/jazz/src/TrackFrame.h Modified: trunk/jazz/src/Project.cpp =================================================================== --- trunk/jazz/src/Project.cpp 2010-07-18 22:05:43 UTC (rev 823) +++ trunk/jazz/src/Project.cpp 2010-07-19 14:12:52 UTC (rev 824) @@ -513,14 +513,14 @@ // exists! // // Inputs: -// const wxString& SongFileName: +// const wxString& MidiFileName: // Song path and file name. //----------------------------------------------------------------------------- -void JZProject::Save(const wxString& SongFileName) +void JZProject::ExportMidiFile(const wxString& MidiFileName) { JZStandardWrite Io; - Write(Io, SongFileName); - mpConfig->Put(C_StartUpSong, SongFileName.c_str()); + Write(Io, MidiFileName); + mpConfig->Put(C_StartUpSong, MidiFileName.c_str()); } //----------------------------------------------------------------------------- Modified: trunk/jazz/src/Project.h =================================================================== --- trunk/jazz/src/Project.h 2010-07-18 22:05:43 UTC (rev 823) +++ trunk/jazz/src/Project.h 2010-07-19 14:12:52 UTC (rev 824) @@ -118,9 +118,9 @@ // already exists! // // Inputs: - // const wxString& SongFileName: - // Song path and file name. - void Save(const wxString& SongFileName); + // const wxString& MidiFileName: + // MIDI file path and file name. + void ExportMidiFile(const wxString& MidiFileName); // Here is the new play interface. For now it just acts as a layer // between the Project and the GUI. Modified: trunk/jazz/src/Resources.h =================================================================== --- trunk/jazz/src/Resources.h 2010-07-18 22:05:43 UTC (rev 823) +++ trunk/jazz/src/Resources.h 2010-07-19 14:12:52 UTC (rev 824) @@ -32,8 +32,9 @@ #define ID_FILE_REVERT_TO_SAVED wxID_HIGHEST + 1 -#define ID_EXPORT_MIDI wxID_HIGHEST + 2 -#define ID_EXPORT_SELECTION_AS_MIDI wxID_HIGHEST + 3 +#define ID_IMPORT_MIDI wxID_HIGHEST + 2 +#define ID_EXPORT_MIDI wxID_HIGHEST + 3 +#define ID_EXPORT_SELECTION_AS_MIDI wxID_HIGHEST + 4 #define ID_SETTINGS_METRONOME wxID_HIGHEST + 10 #define ID_SETTINGS_SYNTHESIZER wxID_HIGHEST + 11 Modified: trunk/jazz/src/TrackFrame.cpp =================================================================== --- trunk/jazz/src/TrackFrame.cpp 2010-07-18 22:05:43 UTC (rev 823) +++ trunk/jazz/src/TrackFrame.cpp 2010-07-19 14:12:52 UTC (rev 824) @@ -79,10 +79,20 @@ EVT_MENU(wxID_NEW, JZTrackFrame::OnFileNew) - EVT_MENU(wxID_OPEN, JZTrackFrame::OnFileOpen) + EVT_MENU(wxID_OPEN, JZTrackFrame::OnFileOpenProject) - EVT_MENU(wxID_SAVEAS, JZTrackFrame::OnFileSaveAs) + EVT_MENU(wxID_SAVE, JZTrackFrame::OnFileProjectSave) + EVT_MENU(wxID_SAVEAS, JZTrackFrame::OnFileProjectSaveAs) + + EVT_MENU(ID_IMPORT_MIDI, JZTrackFrame::OnFileImportMidi) + + EVT_MENU(ID_EXPORT_MIDI, JZTrackFrame::OnFileExportMidi) + + EVT_MENU( + ID_EXPORT_SELECTION_AS_MIDI, + JZTrackFrame::OnFileExportSelectionAsMidi) + EVT_MENU(wxID_EXIT, JZTrackFrame::OnFileExit) EVT_MENU(ID_PLAY, JZTrackFrame::OnPlay) @@ -218,17 +228,19 @@ mpFileMenu = new wxMenu; mpFileMenu->Append(wxID_NEW, "&New"); - mpFileMenu->Append(wxID_OPEN, "&Open..."); + mpFileMenu->Append(wxID_OPEN, "&Open Project..."); mpFileMenu->Append(wxID_CLOSE, "&Close"); mpFileMenu->Append(wxID_SAVE, "&Save Project"); mpFileMenu->Append(wxID_SAVEAS, "Save Project &As..."); mpFileMenu->AppendSeparator(); - mpFileMenu->Append(ID_EXPORT_MIDI, "Export as Midi..."); + mpFileMenu->Append(ID_IMPORT_MIDI, "Import MIDI..."); + + mpFileMenu->Append(ID_EXPORT_MIDI, "Export as MIDI..."); mpFileMenu->Append( ID_EXPORT_SELECTION_AS_MIDI, - "Export Selection as Midi..."); + "Export Selection as MIDI..."); mpFileMenu->AppendSeparator(); @@ -472,11 +484,26 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZTrackFrame::OnFileOpen(wxCommandEvent& Event) +void JZTrackFrame::OnFileOpenProject(wxCommandEvent& Event) { - // Use an open dialog to find the Jazz++ configuration file. - // wxFD_CHANGE_DIR - Change the current working directory to the directory - // where the file(s) chosen by the user are. +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZTrackFrame::OnFileProjectSave(wxCommandEvent& Event) +{ +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZTrackFrame::OnFileProjectSaveAs(wxCommandEvent& Event) +{ +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZTrackFrame::OnFileImportMidi(wxCommandEvent& Event) +{ wxFileDialog OpenDialog( 0, "Load MIDI File", @@ -486,9 +513,9 @@ wxFD_OPEN | wxFD_CHANGE_DIR); if (OpenDialog.ShowModal() == wxID_OK) { - wxString FileName = OpenDialog.GetPath(); - gpProject->OpenSong(FileName); - SetTitle(FileName); + wxString MidiFileName = OpenDialog.GetPath(); + gpProject->OpenSong(MidiFileName); + SetTitle(MidiFileName); // NextWin->NewPosition(1, 0); mpTrackWindow->SetScrollRanges(); // mpTrackWindow->SetScrollPosition(0, 0); @@ -500,7 +527,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZTrackFrame::OnFileSaveAs(wxCommandEvent& Event) +void JZTrackFrame::OnFileExportMidi(wxCommandEvent& Event) { // wxFD_OVERWRITE_PROMPT - For save dialog only: prompt for a confirmation // if a file will be overwritten. @@ -514,13 +541,19 @@ if (SaveAsDialog.ShowModal() == wxID_OK) { wxString FileName = SaveAsDialog.GetPath(); - gpProject->Save(FileName); + gpProject->ExportMidiFile(FileName); SetTitle(FileName); } } //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- +void JZTrackFrame::OnFileExportSelectionAsMidi(wxCommandEvent& Event) +{ +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- void JZTrackFrame::OnFileExit(wxCommandEvent& Event) { if (OnClose() == false) Modified: trunk/jazz/src/TrackFrame.h =================================================================== --- trunk/jazz/src/TrackFrame.h 2010-07-18 22:05:43 UTC (rev 823) +++ trunk/jazz/src/TrackFrame.h 2010-07-19 14:12:52 UTC (rev 824) @@ -72,10 +72,18 @@ void OnFileNew(wxCommandEvent& Event); - void OnFileOpen(wxCommandEvent& Event); + void OnFileOpenProject(wxCommandEvent& Event); - void OnFileSaveAs(wxCommandEvent& Event); + void OnFileProjectSave(wxCommandEvent& Event); + void OnFileProjectSaveAs(wxCommandEvent& Event); + + void OnFileImportMidi(wxCommandEvent& Event); + + void OnFileExportMidi(wxCommandEvent& Event); + + void OnFileExportSelectionAsMidi(wxCommandEvent& Event); + void OnFileExit(wxCommandEvent& Event); void OnZoomIn(wxCommandEvent& Event); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2010-08-28 17:24:04
|
Revision: 826 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=826&view=rev Author: pstieber Date: 2010-08-28 17:23:58 +0000 (Sat, 28 Aug 2010) Log Message: ----------- Changed the AllNotesOff argument from int to bool. Modified Paths: -------------- trunk/jazz/src/PianoFrame.cpp trunk/jazz/src/Player.cpp trunk/jazz/src/Player.h Modified: trunk/jazz/src/PianoFrame.cpp =================================================================== --- trunk/jazz/src/PianoFrame.cpp 2010-08-28 15:37:35 UTC (rev 825) +++ trunk/jazz/src/PianoFrame.cpp 2010-08-28 17:23:58 UTC (rev 826) @@ -493,7 +493,7 @@ // Send a midi reset. void JZPianoFrame::OnReset(wxCommandEvent& Event) { - gpMidiPlayer->AllNotesOff(1); + gpMidiPlayer->AllNotesOff(true); } void JZPianoFrame::OnMSelect(wxCommandEvent& Event) Modified: trunk/jazz/src/Player.cpp =================================================================== --- trunk/jazz/src/Player.cpp 2010-08-28 15:37:35 UTC (rev 825) +++ trunk/jazz/src/Player.cpp 2010-08-28 17:23:58 UTC (rev 826) @@ -643,7 +643,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZPlayer::AllNotesOff(int Reset) +void JZPlayer::AllNotesOff(bool Reset) { JZControlEvent NoteOff(0, 0, 0x78, 0); JZPitchEvent Pitch (0, 0, 0); Modified: trunk/jazz/src/Player.h =================================================================== --- trunk/jazz/src/Player.h 2010-08-28 15:37:35 UTC (rev 825) +++ trunk/jazz/src/Player.h 2010-08-28 17:23:58 UTC (rev 826) @@ -168,7 +168,7 @@ virtual void StartPlay(long Clock, long LoopClock = 0, int Continue = 0); virtual void StopPlay(); - virtual void AllNotesOff(int Reset = 0); + virtual void AllNotesOff(bool Reset = false); virtual void SetSoftThru(int on, int idev, int odev) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2011-03-23 00:39:37
|
Revision: 837 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=837&view=rev Author: pstieber Date: 2011-03-23 00:39:31 +0000 (Wed, 23 Mar 2011) Log Message: ----------- 1. Checked for an empty file name instead of trating the file name like a pointer. 2. Changed the first argument to SaveWave from const char* to const wxString&. Modified Paths: -------------- trunk/jazz/src/Audio.cpp trunk/jazz/src/Audio.h Modified: trunk/jazz/src/Audio.cpp =================================================================== --- trunk/jazz/src/Audio.cpp 2011-03-23 00:24:40 UTC (rev 836) +++ trunk/jazz/src/Audio.cpp 2011-03-23 00:39:31 UTC (rev 837) @@ -325,7 +325,7 @@ continue; } assert(0 <= key && key < eSampleCount); - mSamples[key]->SetFileName(SampleFileName.GetFullPath().c_str()); + mSamples[key]->SetFileName(SampleFileName.GetFullPath()); mSamples[key]->SetLabel(Label.c_str()); mSamples[key]->SetVolume(vol); mSamples[key]->SetPan(pan); @@ -860,7 +860,7 @@ false, has_changed, "*.spl"); - if (FileName) + if (!FileName.empty()) { Load(FileName); } @@ -877,7 +877,7 @@ true, has_changed, "*.spl"); - if (FileName) + if (!FileName.empty()) { Save(FileName); } @@ -1027,7 +1027,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- void JZSampleSet::SaveWave( - const char* pFileName, + const wxString& FileName, long frc, long toc, JZAudioRecordBuffer& buf) @@ -1060,7 +1060,7 @@ wh.data_length = (end_index - start_index) * sizeof(short); wh.length = wh.data_length + sizeof(WaveHeader); - ofstream os(pFileName, ios::out | ios::binary | ios::trunc); + ofstream os(FileName.c_str(), ios::out | ios::binary | ios::trunc); os.write((char*)&wh, sizeof(wh)); Modified: trunk/jazz/src/Audio.h =================================================================== --- trunk/jazz/src/Audio.h 2011-03-23 00:24:40 UTC (rev 836) +++ trunk/jazz/src/Audio.h 2011-03-23 00:39:31 UTC (rev 837) @@ -358,7 +358,7 @@ void SaveRecordingDlg(long frc, long toc, JZAudioRecordBuffer &buf); void SaveWave( - const char *fname, + const wxString& FileName, long frc, long toc, JZAudioRecordBuffer &buf); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2011-07-26 18:23:30
|
Revision: 841 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=841&view=rev Author: pstieber Date: 2011-07-26 18:23:24 +0000 (Tue, 26 Jul 2011) Log Message: ----------- 1. Updated the char* version of JZConfiguration::Get to use a string reference. 2. Changed JZConfiguration::Get and JZConfiguration::Put to use C++ stream I/O and std::string instead of C FILE pointers and C-style strings. Modified Paths: -------------- trunk/jazz/src/Configuration.cpp trunk/jazz/src/Configuration.h Modified: trunk/jazz/src/Configuration.cpp =================================================================== --- trunk/jazz/src/Configuration.cpp 2011-03-29 02:36:45 UTC (rev 840) +++ trunk/jazz/src/Configuration.cpp 2011-07-26 18:23:24 UTC (rev 841) @@ -543,7 +543,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -bool JZConfiguration::Get(int Entry, char* value) +bool JZConfiguration::Get(int Entry, string& Value) { assert((Entry >= 0) && (Entry < NumConfigNames)); @@ -553,42 +553,64 @@ return false; } - FILE *fd = fopen(FileName.c_str(), "r"); - const string& name = GetName(Entry); + ifstream Ifs(FileName.c_str()); + if (!Ifs) + { + return false; + } - int len = name.length(); - char buf[1000]; - bool found = false; - while (!found && fgets(buf, sizeof(buf), fd) != NULL) + const string& Name = GetName(Entry); + + string::size_type Length = Name.length(); + + string Line; + + bool Found = false; + while (!Found && !Ifs.eof() && getline(Ifs, Line)) { - if (strncmp(buf, name.c_str(), len) == 0) + // Search the beginning of the string for the name. + string::size_type Start = Line.find(Name); + if (Start == 0) { - while (isspace(buf[len])) + // Skip white space to find the value. + Start += Length; + while (isspace(Line[Start])) { - len++; + ++Start; } - int end = strlen(buf) - 1; - while (end > 0 && isspace(buf[end])) + + // Find the end of the value. + string::size_type End = Line.length() - 1; + while (End > 0 && isspace(Line[End])) { - buf[end--] = 0; + --End; } - strcpy(value, buf + len); - found = true; + + Value = Line.substr(Start, End - Start + 1); + + // Indicate a value was found. + Found = true; } } - fclose(fd); - return found; + + Ifs.close(); + + return Found; } //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -bool JZConfiguration::Get(int Entry, int& value) +bool JZConfiguration::Get(int Entry, int& Value) { - char buf[512]; - if (Get(Entry, buf)) + string String; + if (Get(Entry, String)) { - sscanf(buf, " %d ", &value); - return true; + istringstream Iss(String); + Iss >> Value; + if (!Iss.fail()) + { + return true; + } } return false; } @@ -615,35 +637,39 @@ string TempFileName(FileName); TempFileName.append(".tmp"); ofstream Os(TempFileName.c_str()); -// ofstream Os(TempFileName.GetFullPath()); if (!Os) { return false; } - FILE* inp = fopen(FileName.c_str(), "r"); + ifstream Ifs(FileName.c_str()); + if (!Ifs) + { + return false; + } + const string& ValueName = GetName(Index); - int len = ValueName.length(); - char buf[1000]; - bool found = false; - while (fgets(buf, sizeof(buf), inp) != NULL) + string Line; + bool Found = false; + while (!Ifs.eof() && getline(Ifs, Line)) { - if (strncmp(buf, ValueName.c_str(), len) == 0) + string::size_type Start = Line.find(ValueName); + if (Start == 0) { Os << ValueName << ' ' << ValueString << endl; - found = true; + Found = true; } else { - Os << buf; + Os << Line << endl; } } - if (!found) + if (!Found) { Os << ValueName << ' ' << ValueString << endl; } - fclose(inp); + Ifs.close(); Os.close(); ::wxRemoveFile(FileName.c_str()); @@ -845,7 +871,7 @@ } else if (pVector && isdigit(InputLine[0])) { - // Read named value entries. + // Read named entries. // Voice names if (pVector == &mVoiceNames) Modified: trunk/jazz/src/Configuration.h =================================================================== --- trunk/jazz/src/Configuration.h 2011-03-29 02:36:45 UTC (rev 840) +++ trunk/jazz/src/Configuration.h 2011-07-26 18:23:24 UTC (rev 841) @@ -239,7 +239,7 @@ const int& GetValue(const char* pName) const; const int& GetValue(int Index) const; - bool Get(int Entry, char* pValue); + bool Get(int Entry, std::string& Value); bool Get(int Entry, int& Value); bool Put(int Entry, const std::string& ValueString); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2011-07-26 21:15:24
|
Revision: 842 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=842&view=rev Author: pstieber Date: 2011-07-26 21:15:16 +0000 (Tue, 26 Jul 2011) Log Message: ----------- 1. Changed JZSimpleEventArray::Events to JZSimpleEventArray::mppEvents. 2. Changed JZSampleVoice::data to JZSampleVoice::mpData. 3. Changed JZFloatSample::data to JZFloatSample::mpData. 4. Updated some local variable names. Modified Paths: -------------- trunk/jazz/src/Audio.cpp trunk/jazz/src/Harmony.cpp trunk/jazz/src/Player.cpp trunk/jazz/src/Rhythm.cpp trunk/jazz/src/Sample.cpp trunk/jazz/src/Sample.h trunk/jazz/src/SampleCommand.cpp trunk/jazz/src/Song.cpp trunk/jazz/src/Track.cpp trunk/jazz/src/Track.h Modified: trunk/jazz/src/Audio.cpp =================================================================== --- trunk/jazz/src/Audio.cpp 2011-07-26 18:23:24 UTC (rev 841) +++ trunk/jazz/src/Audio.cpp 2011-07-26 21:15:16 UTC (rev 842) @@ -78,7 +78,7 @@ clock = c; first = 1; length = spl->length; - data = spl->data; + mpData = spl->mpData; prev = 0; } @@ -105,7 +105,7 @@ { // output starts somewhere in the middle of a sample long data_offs = set.Ticks2Samples(buffer_clock - clock); - data += data_offs; + mpData += data_offs; length -= data_offs; if (length <= 0) return; @@ -123,7 +123,7 @@ b += offset; while (count--) { - *b++ += *data++; + *b++ += *mpData++; } } @@ -145,7 +145,7 @@ if (fr_smpl > 0 && fr_smpl < length) { - data += fr_smpl; + mpData += fr_smpl; length -= fr_smpl; } first = false; @@ -165,7 +165,7 @@ length -= count; while (count--) { - *b++ += *data++; + *b++ += *mpData++; } } @@ -176,12 +176,12 @@ private: JZSampleSet& set; - long clock; + long clock; JZSample* spl; - short* data; - int first; - long length; - short prev; + short* mpData; + int first; + long length; + short prev; }; //***************************************************************************** @@ -477,7 +477,7 @@ // iterate the events and add sounding voices while (event_index < events->nEvents) { - JZEvent* pEvent = events->Events[event_index]; + JZEvent* pEvent = events->mppEvents[event_index]; if (pEvent->GetClock() >= last_clock) { break; @@ -1089,7 +1089,7 @@ { int bi = i / bufsize; int di = i % bufsize; - slow.write((char*)&buf.buffers[bi]->data[di], sizeof(short)); + slow.write((char*)&buf.buffers[bi]->mpData[di], sizeof(short)); } #endif } Modified: trunk/jazz/src/Harmony.cpp =================================================================== --- trunk/jazz/src/Harmony.cpp 2011-07-26 18:23:24 UTC (rev 841) +++ trunk/jazz/src/Harmony.cpp 2011-07-26 21:15:16 UTC (rev 842) @@ -727,7 +727,7 @@ JZEventArray &buf = gpTrackFrame->GetPianoWindow()->mPasteBuffer; for (int i = 0; i < buf.nEvents; i++) { - JZKeyOnEvent* pKeyOn = buf.Events[i]->IsKeyOn(); + JZKeyOnEvent* pKeyOn = buf.mppEvents[i]->IsKeyOn(); if (pKeyOn) { piano += pKeyOn->GetKey(); Modified: trunk/jazz/src/Player.cpp =================================================================== --- trunk/jazz/src/Player.cpp 2011-07-26 18:23:24 UTC (rev 841) +++ trunk/jazz/src/Player.cpp 2011-07-26 21:15:16 UTC (rev 842) @@ -251,7 +251,7 @@ // send them to driver // else // tell the driver that there is nothing to do at the moment - if (mPlayBuffer.nEvents && mPlayBuffer.Events[0]->GetClock() < mOutClock) + if (mPlayBuffer.nEvents && mPlayBuffer.mppEvents[0]->GetClock() < mOutClock) { FlushToDevice(); } Modified: trunk/jazz/src/Rhythm.cpp =================================================================== --- trunk/jazz/src/Rhythm.cpp 2011-07-26 18:23:24 UTC (rev 841) +++ trunk/jazz/src/Rhythm.cpp 2011-07-26 21:15:16 UTC (rev 842) @@ -943,7 +943,7 @@ for (int ii = 0; ii < events.nEvents; ii++) { - JZKeyOnEvent* pKeyOn = events.Events[ii]->IsKeyOn(); + JZKeyOnEvent* pKeyOn = events.mppEvents[ii]->IsKeyOn(); if (pKeyOn) { pRhythm->keys[pRhythm->n_keys++] = pKeyOn->GetKey(); Modified: trunk/jazz/src/Sample.cpp =================================================================== --- trunk/jazz/src/Sample.cpp 2011-07-26 18:23:24 UTC (rev 841) +++ trunk/jazz/src/Sample.cpp 2011-07-26 21:15:16 UTC (rev 842) @@ -43,7 +43,7 @@ mLabel(), mFileName() { - data = 0; + mpData = 0; length = 0; external_flag = 1; // auto reload when file changes on disk external_time = 0; @@ -56,7 +56,7 @@ JZSample::~JZSample() { - delete [] data; + delete [] mpData; } void JZSample::SetLabel(const std::string& Label) @@ -87,19 +87,19 @@ void JZSample::FreeData() { - delete [] data; - data = 0; + delete [] mpData; + mpData = 0; length = 0; dirty = 1; } void JZSample::MakeData(int new_length, int zero) { - delete [] data; + delete [] mpData; length = new_length; - data = new short[length]; + mpData = new short[length]; if (zero) - memset(data, 0, length * sizeof(short)); + memset(mpData, 0, length * sizeof(short)); } @@ -108,7 +108,7 @@ MakeData(fs.GetLength()); for (int i = 0; i < length; i++) { - data[i] = (short)fs[i]; + mpData[i] = (short)fs[i]; } } @@ -119,7 +119,7 @@ AssureLength(offs + len); for (int i = 0; i < len; i++) { - data[offs + i] = (short)fs[i]; + mpData[offs + i] = (short)fs[i]; } } @@ -147,17 +147,17 @@ while (i < ofs1) { - data[offs + i] = (short)(fi.XToY(i) * fs[i] + fo.XToY(i) * data[offs + i]); + mpData[offs + i] = (short)(fi.XToY(i) * fs[i] + fo.XToY(i) * mpData[offs + i]); i++; } while (i < ofs2) { - data[offs + i] = (short)fs[i]; + mpData[offs + i] = (short)fs[i]; i++; } while (i < ofs3) { - data[offs + i] = (short)(fo.XToY(i-ofs2) * fs[i] + fi.XToY(i-ofs2) * data[offs + i]); + mpData[offs + i] = (short)(fo.XToY(i-ofs2) * fs[i] + fi.XToY(i-ofs2) * mpData[offs + i]); i++; } } @@ -301,20 +301,20 @@ // load the file length = bytes / 2; - delete [] data; - data = new short [length]; - is.read((char *)data, length * 2); + delete [] mpData; + mpData = new short [length]; + is.read((char *)mpData, length * 2); // convert 8 -> 16 bit if (bits == 8) { int i; - char *tmp = (char *)data; + char *tmp = (char *)mpData; length = bytes; - data = new short [length]; + mpData = new short [length]; for (i = 0; i < length; ++i) { - data[i] = ((short) ((signed char)tmp[i] ^ (signed char)0x80)) << 8; + mpData[i] = ((short) ((signed char)tmp[i] ^ (signed char)0x80)) << 8; } delete [] tmp; } @@ -322,15 +322,15 @@ // convert mono -> stereo if (channels == 1 && set.GetChannelCount() == 2) { - short *old = data; + short *old = mpData; length = length * 2; - data = new short [length]; + mpData = new short [length]; int i = 0; int j = 0; while (i < length) { - data[i++] = old[j]; - data[i++] = old[j++]; + mpData[i++] = old[j]; + mpData[i++] = old[j++]; } delete [] old; channels = 2; @@ -338,15 +338,15 @@ // convert stereo -> mono else if (channels == 2 && set.GetChannelCount() == 1) { - short *old = data; + short *old = mpData; length = length / 2; - data = new short [length]; + mpData = new short [length]; int i = 0; int j = 0; while (i < length) { int val = ((int)old[j] + old[j+1]) / 2; - data[i++] = (short)val; + mpData[i++] = (short)val; j += 2; } delete [] old; @@ -378,8 +378,8 @@ } for (int i = 0; i < length-1; i += 2) { - data[i] = (short)((int)data[i] * ch1 >> 7); - data[i+1] = (short)((int)data[i+1] * ch2 >> 7); + mpData[i] = (short)((int)mpData[i] * ch1 >> 7); + mpData[i+1] = (short)((int)mpData[i+1] * ch2 >> 7); } } @@ -400,8 +400,8 @@ external_time = buf.st_mtime; ifstream is(mFileName.c_str(), ios::binary | ios::in); - data = new short [length]; - is.read((char *)data, length * 2); + mpData = new short [length]; + is.read((char *)mpData, length * 2); return 0; } @@ -451,7 +451,7 @@ to_smpl = (to_smpl < 0) ? length : to_smpl; int count = to_smpl - fr_smpl; dst.MakeData(count); - memcpy(dst.data, data + fr_smpl, count * sizeof(short)); + memcpy(dst.mpData, mpData + fr_smpl, count * sizeof(short)); } @@ -463,14 +463,14 @@ short *new_data = new short [new_length]; int fr_offs = fr_smpl * sizeof(short); - memcpy(new_data, data, fr_offs); + memcpy(new_data, mpData, fr_offs); memcpy( new_data + fr_smpl, - data + to_smpl, + mpData + to_smpl, (length - to_smpl) * sizeof(short)); - delete [] data; - data = new_data; + delete [] mpData; + mpData = new_data; length = new_length; } @@ -488,12 +488,12 @@ int bytes1 = pos * sizeof(short); int bytes2 = len * sizeof(short); int bytes3 = (length - pos) * sizeof(short); - memcpy(new_data, data, bytes1); + memcpy(new_data, mpData, bytes1); memset(new_data + pos, 0, bytes2); - memcpy(new_data + pos + len, data + pos, bytes3); + memcpy(new_data + pos + len, mpData + pos, bytes3); - delete [] data; - data = new_data; + delete [] mpData; + mpData = new_data; length = new_length; } @@ -502,13 +502,13 @@ { AssureLength(offs + len); while (len-- > 0) - data[offs++] = 0; + mpData[offs++] = 0; } void JZSample::PasteIns(JZSample &src, int offs) { InsertSilence(offs, src.length); - memcpy(data + offs, src.data, src.length * sizeof(short)); + memcpy(mpData + offs, src.mpData, src.length * sizeof(short)); } @@ -518,7 +518,7 @@ JZFloatSample fs(*this); for (int i = 0; i < src.length; i++) { - fs[offs + i] += src.data[i]; + fs[offs + i] += src.mpData[i]; } fs.RescaleToShort(); Set(fs); @@ -531,9 +531,9 @@ to = length - 1; while (to > fr) { - short tmp = data[fr]; - data[fr] = data[to]; - data[to] = tmp; + short tmp = mpData[fr]; + mpData[fr] = mpData[to]; + mpData[to] = tmp; to--; fr++; } @@ -546,7 +546,7 @@ int step = set.GetChannelCount(); while (i < length) { - data[i] = -data[i]; + mpData[i] = -mpData[i]; i += step; } } @@ -583,7 +583,7 @@ int peak = 0; for (int i = 0; i < length; i++) { - int d = abs(data[i]); + int d = abs(mpData[i]); if (d > peak) peak = d; } @@ -597,7 +597,7 @@ { float f = maxval / peak; for (int i = 0; i < length; i++) - data[i] = (short)(f * data[i]); + mpData[i] = (short)(f * mpData[i]); } } @@ -632,12 +632,12 @@ int k = i * channels; for (int c = 0; c < channels; c++) { - JZMapper Map(0, 1, data[j + c], data[j + channels + c]); + JZMapper Map(0, 1, mpData[j + c], mpData[j + channels + c]); new_data[k + c] = (short)Map.XToY(rem); } } - delete data; - data = new_data; + delete mpData; + mpData = new_data; length = new_length; } @@ -688,7 +688,7 @@ for (i = fr; i < to; i += channels) { for (int c = 0; c < channels; c++) - data[i + c] = filters[c].Loop(data[i + c]); + mpData[i + c] = filters[c].Loop(mpData[i + c]); } delete [] filters; } @@ -729,7 +729,7 @@ ofstream os(mFileName.c_str(), ios::out | ios::binary | ios::trunc); os.write((char *)&wh, sizeof(wh)); - os.write((char *)data, length * sizeof(short)); + os.write((char *)mpData, length * sizeof(short)); return os.bad(); } @@ -742,9 +742,9 @@ { current = 0; length = spl.length; - data = new float [length]; + mpData = new float [length]; for (int i = 0; i < length; i++) - data[i] = (float)spl.data[i]; + mpData[i] = (float)spl.mpData[i]; channels = spl->GetChannelCount(); sampling_rate = spl->GetSamplingRate(); } @@ -753,9 +753,9 @@ { current = 0; length = to - fr; - data = new float [length]; + mpData = new float [length]; for (int i = 0; i < length; i++) - data[i] = (float)spl.data[i + fr]; + mpData[i] = (float)spl.mpData[i + fr]; channels = spl->GetChannelCount(); sampling_rate = spl->GetSamplingRate(); } @@ -766,14 +766,14 @@ channels = ch; sampling_rate = sr; length = 1000; - data = new float [length]; - memset(data, 0, length * sizeof(float)); + mpData = new float [length]; + memset(mpData, 0, length * sizeof(float)); } JZFloatSample::~JZFloatSample() { - delete [] data; + delete [] mpData; } @@ -786,7 +786,7 @@ float peak = 0; for (int i = fr; i < to; i++) { - float d = fabs(data[i]); + float d = fabs(mpData[i]); if (d > peak) peak = d; } @@ -805,7 +805,7 @@ { float f = maxval / peak; for (int i = fr; i < to; i++) - data[i] *= f; + mpData[i] *= f; } } @@ -821,20 +821,20 @@ { float f = 32767.0 / peak; for (int i = fr; i < to; i++) - data[i] *= f; + mpData[i] *= f; } } void JZFloatSample::Initialize(int size) { - delete [] data; + delete [] mpData; length = 0; if (size > 0) { length = size; - data = new float [length]; - memset(data, 0, length * sizeof(float)); + mpData = new float [length]; + memset(mpData, 0, length * sizeof(float)); } } @@ -843,13 +843,13 @@ { AssureLength(offs + src.length); for (int i = 0; i < src.length; i++) - data[offs + i] += src.data[i]; + mpData[offs + i] += src.mpData[i]; } void JZFloatSample::RemoveTrailingSilence(float peak) { int len1 = length - channels; // last value - while (len1 > 0 && fabs(data[len1]) < peak) + while (len1 > 0 && fabs(mpData[len1]) < peak) len1 -= channels; length = len1 + channels; } @@ -859,7 +859,7 @@ { AssureLength(offs + src.length); for (int i = 0; i < src.length; i++) - data[offs + i] += src.data[i]; + mpData[offs + i] += src.mpData[i]; } @@ -873,12 +873,12 @@ float wmax, xmax = 0; for (j = 0; j < length; j++) { - if ((wmax = (float)fabs(data[j])) > xmax) + if ((wmax = (float)fabs(mpData[j])) > xmax) xmax = wmax; } for (j = 0; j < length; j++) { - data[j] /= xmax; + mpData[j] /= xmax; } } @@ -888,7 +888,7 @@ channels = 1; Initialize(size); for (int i = 0; i < length; i++) - data[i] = -cos(2.0*M_PI * (float)i/(float)(length)) * 0.5 + 0.5; + mpData[i] = -cos(2.0*M_PI * (float)i/(float)(length)) * 0.5 + 0.5; Normalize(); } @@ -900,7 +900,7 @@ channels = 1; Initialize(size); for (int i = 0; i < length; i++) - data[i] = 0.54 - 0.46*cos(2.0*M_PI * (float)i/(float)(length)); + mpData[i] = 0.54 - 0.46*cos(2.0*M_PI * (float)i/(float)(length)); Normalize(); } @@ -918,13 +918,13 @@ amp1 = amp2; amp2 = pvals[k+1]; j = i + 1; - data[i] = amp1; + mpData[i] = amp1; c = (float) pow((amp2/amp1),(1./ pvals[k])); i = (j - 1) + pvals[k]; for (l = j; l < i; l++) { if (l < size) - data[l] = data[l-1] * c; + mpData[l] = mpData[l-1] * c; } } Normalize(); @@ -936,7 +936,7 @@ channels = 1; Initialize(size); CMixCmd cmix(sampling_rate); - cmix.setline(pvals, nargs, size, data); + cmix.setline(pvals, nargs, size, mpData); Normalize(); } #endif @@ -973,12 +973,12 @@ int bytes1 = pos * sizeof(float); int bytes2 = len * sizeof(float); int bytes3 = (length - pos) * sizeof(float); - memcpy(new_data, data, bytes1); + memcpy(new_data, mpData, bytes1); memset(new_data + pos, 0, bytes2); - memcpy(new_data + pos + len, data + pos, bytes3); + memcpy(new_data + pos + len, mpData + pos, bytes3); - delete [] data; - data = new_data; + delete [] mpData; + mpData = new_data; length = new_length; } @@ -1020,7 +1020,7 @@ if (current >= length) AssureLength(length * 2); for (int i = 0; i < channels; i++) - data[current++] += p[i]; + mpData[current++] += p[i]; return 1; } @@ -1028,7 +1028,7 @@ int JZFloatSample::GetIn(float *p) { for (int i = 0; i < channels; i++) - p[i] = data[current++]; + p[i] = mpData[current++]; return current < length; } @@ -1047,7 +1047,7 @@ return 0; for (int c = 0; c < channels; c++) { - JZMapper Map(0, 1, data[i + c], data[i + channels + c]); + JZMapper Map(0, 1, mpData[i + c], mpData[i + channels + c]); p[c] = Map.XToY(rem); } return 1; @@ -1059,9 +1059,9 @@ // convert this sample to mono if (channels != 2) // only stereo so far return; - float *dst = data; + float *dst = mpData; for (int i = 0; i < length - 1; i += 2) - *dst++ = (data[i] + data[i+1]) / 2.0; + *dst++ = (mpData[i] + mpData[i+1]) / 2.0; length = length / 2; channels = 1; } @@ -1078,7 +1078,7 @@ int k = i - delay; for (int j = 0; k >= 0 && j < num_echos; j++) { - data[i] += data[k] * a; + mpData[i] += mpData[k] * a; a *= ampl; k -= delay; } @@ -1106,7 +1106,7 @@ int k = i - delay; for (int j = 0; k >= 0 && j < num_echos; j++) { - data[i] += data[k] * a; + mpData[i] += mpData[k] * a; a *= ampl; k -= delays[j]; } @@ -1142,10 +1142,10 @@ { float ipan = ipans[j]; float opan = opans[j]; - float val = a * ( ipan * data[k] + (1.0 - ipan) * data[k+1] ); - data[i] += opan * val; - data[i+1] += (1.0 - opan) * val; - //data[i] += data[k] * a; + float val = a * ( ipan * mpData[k] + (1.0 - ipan) * mpData[k+1] ); + mpData[i] += opan * val; + mpData[i+1] += (1.0 - opan) * val; + //mpData[i] += mpData[k] * a; a *= ampl; k -= delays[j]; } Modified: trunk/jazz/src/Sample.h =================================================================== --- trunk/jazz/src/Sample.h 2011-07-26 18:23:24 UTC (rev 841) +++ trunk/jazz/src/Sample.h 2011-07-26 21:15:16 UTC (rev 842) @@ -115,7 +115,7 @@ void RescaleToShort(int fr = -1, int to = -1); float &operator[](int i) { - return data[i]; + return mpData[i]; } void Initialize(int size = 0); void PasteMix(JZFloatSample &src, int offs = 0); @@ -168,9 +168,9 @@ return sampling_rate; } - float *GetData() + float* GetData() { - return data; + return mpData; } int GetLength() const @@ -179,23 +179,23 @@ } protected: - float* data; + float* mpData; int length; int channels; int sampling_rate; // CMIX-IO position - int current; + int current; }; //***************************************************************************** // 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 +// mpData[0] == 1st value for left channel +// mpData[1] == 1st value for right channel +// mpData[n] == 1st value for n-th channel +// mpData[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 @@ -293,12 +293,12 @@ // Try to swap this sample into memory. volatile short dummy; for (int i = 0; i < length; i++) - dummy = data[i]; + dummy = mpData[i]; } short *GetData() { - return data; + return mpData; } @@ -386,7 +386,7 @@ int speed); int length; // number of shorts - short* data; // signed shorts + short* mpData; // signed shorts JZSampleSet& set; std::string mLabel; Modified: trunk/jazz/src/SampleCommand.cpp =================================================================== --- trunk/jazz/src/SampleCommand.cpp 2011-07-26 18:23:24 UTC (rev 841) +++ trunk/jazz/src/SampleCommand.cpp 2011-07-26 21:15:16 UTC (rev 842) @@ -77,15 +77,15 @@ return; // no data float i_fact = (float)arr.Size() / (float)n; - short *data = spl.data; + short* pData = spl.mpData; for (long i = 0; i < n-1; i += 2) { float x = (float)i * i_fact; float p = arr[x]; if (p < 0) - data[fr+i] = (short)((float)data[fr+i] * (100 + p) / 100); + pData[fr+i] = (short)((float)pData[fr+i] * (100 + p) / 100); else - data[fr+i+1] = (short)((float)data[fr+i+1] * (100 - p) / 100); + pData[fr+i+1] = (short)((float)pData[fr+i+1] * (100 - p) / 100); } } @@ -102,7 +102,7 @@ long channels = spl.GetChannelCount(); float N = spl.length / channels - 2; - short *data = spl.data; + short* pData = spl.mpData; JZFloatSample out(channels, spl.GetSamplingRate()); out.SetNote(0, 0); @@ -120,7 +120,7 @@ long i = (long)ofs * channels; for (long c = 0; c < channels; c++) { - JZMapper Mapper(0, 1, data[i + c], data[i + channels + c]); + JZMapper Mapper(0, 1, pData[i + c], pData[i + channels + c]); p[c] = Mapper.XToY(rem); } out.AddOut(p); @@ -261,7 +261,7 @@ flt.Init(filter_type, SR, f, band_width); } int j = 0; - short *data = spl.GetData(); + short* pData = spl.GetData(); for (long i = channel; i < N; i += channels) { if (j-- == 0) @@ -271,7 +271,7 @@ flt.ReInit(f, band_width); j = 100; } - out[i] = flt.Loop(data[i]); + out[i] = flt.Loop(pData[i]); } } Modified: trunk/jazz/src/Song.cpp =================================================================== --- trunk/jazz/src/Song.cpp 2011-07-26 18:23:24 UTC (rev 841) +++ trunk/jazz/src/Song.cpp 2011-07-26 21:15:16 UTC (rev 842) @@ -568,7 +568,7 @@ JZTrack* pTrack = &mTracks[TrackIndex]; for (int EventIndex = 0; EventIndex < pTrack->nEvents; ++EventIndex) { - JZEvent* pEvent = pTrack->Events[EventIndex]; + JZEvent* pEvent = pTrack->mppEvents[EventIndex]; pEvent->SetClock((int)(f * pEvent->GetClock() + 0.5)); JZKeyOnEvent* pKeyOn = pEvent->IsKeyOn(); if (pKeyOn) Modified: trunk/jazz/src/Track.cpp =================================================================== --- trunk/jazz/src/Track.cpp 2011-07-26 18:23:24 UTC (rev 841) +++ trunk/jazz/src/Track.cpp 2011-07-26 21:15:16 UTC (rev 842) @@ -415,15 +415,15 @@ : wxObject(), nEvents(0), MaxEvents(0), - Events(0) + mppEvents(0) { } JZSimpleEventArray::~JZSimpleEventArray() { Clear(); - delete [] Events; - Events = 0; + delete [] mppEvents; + mppEvents = 0; } void JZSimpleEventArray::Clear() @@ -431,7 +431,7 @@ int i; for (i = 0; i < nEvents; i++) { - delete Events[i]; + delete mppEvents[i]; } nEvents = 0; } @@ -444,7 +444,7 @@ { if (bits(i)) { - delete Events[i]; + delete mppEvents[i]; } } nEvents = 0; @@ -460,7 +460,7 @@ // Copy the previuosly existing event pointers. for (i = 0; i < nEvents; ++i) { - ppEvents[i] = Events[i]; + ppEvents[i] = mppEvents[i]; } // Initialize the new event pointers to 0. @@ -470,10 +470,10 @@ } // Delete the old event pointers - delete [] Events; + delete [] mppEvents; // Set the data member to the new storage location. - Events = ppEvents; + mppEvents = ppEvents; } // Remove any end of track (EOT) events from the track. There can only be @@ -484,9 +484,9 @@ int newnEvents = nEvents; for (int i = 0; i < nEvents; ++i) { - if (Events[i] != 0 && Events[i]->IsEndOfTrack()) + if (mppEvents[i] != 0 && mppEvents[i]->IsEndOfTrack()) { - delete Events[i]; + delete mppEvents[i]; ++j; --newnEvents; } @@ -494,13 +494,13 @@ JZEvent* item; if (j <= MaxEvents) { - item = Events[j++]; + item = mppEvents[j++]; } else { item = 0; } - Events[i] = item; + mppEvents[i] = item; } nEvents = newnEvents; } @@ -516,7 +516,7 @@ { Resize(); } - Events[nEvents++] = pEvent; + mppEvents[nEvents++] = pEvent; } // Description: @@ -525,13 +525,13 @@ { Clear(); - delete [] Events; + delete [] mppEvents; - Events = src.Events; + mppEvents = src.mppEvents; nEvents = src.nEvents; MaxEvents = src.MaxEvents; - src.Events = 0; + src.mppEvents = 0; src.nEvents = 0; src.MaxEvents = 0; } @@ -567,7 +567,7 @@ nEvents = 0; MaxEvents = 0; - Events = 0; + mppEvents = 0; Channel = 0; Device = 0; ForceChannel = 0; @@ -685,11 +685,11 @@ DrumParams.Clear(); - if (Events) + if (mppEvents) { - delete [] Events; + delete [] mppEvents; } - Events = 0; + mppEvents = 0; MaxEvents = 0; State = tsPlay; @@ -716,7 +716,7 @@ void JZSimpleEventArray::Sort() { - qsort(Events, nEvents, sizeof(JZEvent *), compare); + qsort(mppEvents, nEvents, sizeof(JZEvent *), compare); } @@ -802,13 +802,13 @@ for (i = 0; i < nEvents; i++) { - if ((pEvent = Events[i])->IsKilled()) + if ((pEvent = mppEvents[i])->IsKilled()) { if (!dont_delete_killed_events) { for (int j = i; j < nEvents; j++) { - delete Events[j]; + delete mppEvents[j]; } } nEvents = i; @@ -1149,7 +1149,7 @@ for (int i = 0; i < n; i++) { JZKeyOnEvent* pKeyOn; - if ((pKeyOn = Events[i]->IsKeyOn()) != 0 && pKeyOn->GetEventLength() != 0) + if ((pKeyOn = mppEvents[i]->IsKeyOn()) != 0 && pKeyOn->GetEventLength() != 0) { // JZEvent* pKeyOff = new JZKeyOffEvent( // pKeyOn->GetClock() + pKeyOn->GetEventLength(), @@ -1180,10 +1180,10 @@ for (i = 1; i < nEvents; i++) { JZKeyOffEvent* pKeyOff; - if ((pKeyOff = Events[i]->IsKeyOff()) != 0) + if ((pKeyOff = mppEvents[i]->IsKeyOff()) != 0) { - JZEvent** ppEvent = &Events[i - 1]; - while (ppEvent >= Events) + JZEvent** ppEvent = &mppEvents[i - 1]; + while (ppEvent >= mppEvents) { JZKeyOnEvent* pKeyOn = (*ppEvent)->IsKeyOn(); if ( @@ -1208,7 +1208,7 @@ // kill all KeyOn's with non matching KeyOff's for (i = 0; i < nEvents; i++) { - JZKeyOnEvent *k = Events[i]->IsKeyOn(); + JZKeyOnEvent *k = mppEvents[i]->IsKeyOn(); if (k && k->Length <= 0) { k->Kill(); @@ -1227,12 +1227,12 @@ for (i = 0; i < nEvents; i++) { JZKeyOnEvent* pKeyOn; - if ((pKeyOn = Events[i]->IsKeyOn()) != 0 && pKeyOn->GetEventLength() == 0) + if ((pKeyOn = mppEvents[i]->IsKeyOn()) != 0 && pKeyOn->GetEventLength() == 0) { int j; for (j = i + 1; j < nEvents; j++) { - JZKeyOffEvent* pKeyOff = Events[j]->IsKeyOff(); + JZKeyOffEvent* pKeyOff = mppEvents[j]->IsKeyOff(); if ( pKeyOff && !pKeyOff->IsKilled() && @@ -1255,12 +1255,12 @@ // and kill all remaining KeyOff's for (i = 0; i < nEvents; i++) { - JZKeyOnEvent* pKeyOn = Events[i]->IsKeyOn(); + JZKeyOnEvent* pKeyOn = mppEvents[i]->IsKeyOn(); if (pKeyOn && pKeyOn->GetEventLength() <= 0) { pKeyOn->Kill(); } - JZKeyOffEvent* pKeyOff = Events[i]->IsKeyOff(); + JZKeyOffEvent* pKeyOff = mppEvents[i]->IsKeyOff(); if (pKeyOff) { pKeyOff->Kill(); @@ -1376,7 +1376,7 @@ for (int i = 0; i < nEvents; i++) { - pEvent = Events[i]; + pEvent = mppEvents[i]; WrittenBefore = 0; if (pEvent->IsControl()) { @@ -1656,7 +1656,7 @@ { return 0; } - return Events[nEvents - 1]->GetClock(); + return mppEvents[nEvents - 1]->GetClock(); } bool JZEventArray::IsEmpty() const @@ -1668,7 +1668,7 @@ { if (nEvents) { - return Events[0]->GetClock(); + return mppEvents[0]->GetClock(); } return LAST_CLOCK; } @@ -1966,7 +1966,7 @@ { for (int i = 0; i < t->nEvents; i++) { - Put(t->Events[i]); + Put(t->mppEvents[i]); } t->nEvents = 0; } @@ -1991,7 +1991,7 @@ } } - // Merge Recorded Events + // Merge Recorded mppEvents JZEventIterator Copy(&Other); JZEvent* pEvent = Copy.Range(FromClock, ToClock); while (pEvent) @@ -2030,7 +2030,7 @@ JZUndoBuffer *undo = &mUndoBuffers[mUndoIndex]; for (int i = undo->nEvents - 1; i >= 0; i--) { - JZEvent* pEvent = undo->Events[i]; + JZEvent* pEvent = undo->mppEvents[i]; if (undo->bits(i)) { undo->bits.set(i, 0); @@ -2060,7 +2060,7 @@ JZUndoBuffer *undo = &mUndoBuffers[mUndoIndex]; for (int i = 0; i < undo->nEvents; i++) { - JZEvent* pEvent = undo->Events[i]; + JZEvent* pEvent = undo->mppEvents[i]; if (undo->bits(i)) { undo->bits.set(i, 0); Modified: trunk/jazz/src/Track.h =================================================================== --- trunk/jazz/src/Track.h 2011-07-26 18:23:24 UTC (rev 841) +++ trunk/jazz/src/Track.h 2011-07-26 21:15:16 UTC (rev 842) @@ -393,15 +393,15 @@ { public: - // Actual number of events in **Events. + // Actual number of events in **mppEvents. int nEvents; - // Memory allocated in **Events + // Memory allocated in **mppEvents int MaxEvents; - JZEvent** Events; + JZEvent** mppEvents; - // Resize **Events + // Resize **mppEvents void Resize(); virtual void Clear(); @@ -776,7 +776,7 @@ while (Lo < Hi) { mActual = (Hi + Lo) / 2; - TestClock = mpTrack->Events[mActual]->GetClock(); + TestClock = mpTrack->mppEvents[mActual]->GetClock(); if (TestClock < Clock) { Lo = mActual + 1; @@ -788,11 +788,11 @@ } if (mActual < mStop - 1 && TestClock < Clock) { - TestClock = mpTrack->Events[++mActual]->GetClock(); + TestClock = mpTrack->mppEvents[++mActual]->GetClock(); } if (mActual < mStop && TestClock >= Clock) { - return mpTrack->Events[mActual]; + return mpTrack->mppEvents[mActual]; } return 0; } @@ -818,7 +818,7 @@ mStop = mActual; } mActual = mStart; - return (mActual < mStop ? mpTrack->Events[mActual] : 0); + return (mActual < mStop ? mpTrack->mppEvents[mActual] : 0); } JZEvent* Next() @@ -827,7 +827,7 @@ { ++mActual; } - return (mActual < mStop ? mpTrack->Events[mActual] : 0); + return (mActual < mStop ? mpTrack->mppEvents[mActual] : 0); } int EventsLeft() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2011-07-27 01:43:45
|
Revision: 843 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=843&view=rev Author: pstieber Date: 2011-07-27 01:43:39 +0000 (Wed, 27 Jul 2011) Log Message: ----------- Passed a reference to the event pointer to the EventDialog so the filled pointer could be used by the caller. Modified Paths: -------------- trunk/jazz/src/Dialogs.cpp trunk/jazz/src/Dialogs.h Modified: trunk/jazz/src/Dialogs.cpp =================================================================== --- trunk/jazz/src/Dialogs.cpp 2011-07-26 21:15:16 UTC (rev 842) +++ trunk/jazz/src/Dialogs.cpp 2011-07-27 01:43:39 UTC (rev 843) @@ -382,14 +382,14 @@ { wxArrayString Names; - Names.Add("Note On"); - Names.Add("Controller"); - Names.Add("Program Change"); - Names.Add("Set Tempo"); - Names.Add("SysEx"); - Names.Add("Play Track(experimental)"); - Names.Add("End Of Track"); - Names.Add("Text"); + Names.Add("Note On"); + Names.Add("Controller"); + Names.Add("Program Change"); + Names.Add("Set Tempo"); + Names.Add("SysEx"); + Names.Add("Play Track(experimental)"); + Names.Add("End Of Track"); + Names.Add("Text"); static long Values[] = { @@ -453,7 +453,7 @@ // Display a dialog box to select an event to be created. //***************************************************************************** void EventDialog( - JZEvent* pEvent, + JZEvent*& pEvent, JZPianoWindow* pPianoWindow, JZTrack* pTrack, long Clock, Modified: trunk/jazz/src/Dialogs.h =================================================================== --- trunk/jazz/src/Dialogs.h 2011-07-26 21:15:16 UTC (rev 842) +++ trunk/jazz/src/Dialogs.h 2011-07-27 01:43:39 UTC (rev 843) @@ -108,7 +108,7 @@ #endif void EventDialog( - JZEvent*, + JZEvent*&, JZPianoWindow*, JZTrack*, long Clock, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |