|
From: <pst...@us...> - 2008-04-01 04:40:15
|
Revision: 380
http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=380&view=rev
Author: pstieber
Date: 2008-03-31 21:40:13 -0700 (Mon, 31 Mar 2008)
Log Message:
-----------
Updated the clock dialog and JZSong::String2Clock.
Modified Paths:
--------------
trunk/jazz/src/ClockDialog.cpp
trunk/jazz/src/ClockDialog.h
trunk/jazz/src/Dialogs.cpp
trunk/jazz/src/Filter.cpp
trunk/jazz/src/Song.cpp
Modified: trunk/jazz/src/ClockDialog.cpp
===================================================================
--- trunk/jazz/src/ClockDialog.cpp 2008-03-31 04:12:45 UTC (rev 379)
+++ trunk/jazz/src/ClockDialog.cpp 2008-04-01 04:40:13 UTC (rev 380)
@@ -29,28 +29,40 @@
#include "DeprecatedWx/proplist.h"
//*****************************************************************************
-// tClockDlg
+// Description:
+// This is the clock dialog class declaration.
//*****************************************************************************
-tClockDlg::tClockDlg(JZSong *s, char *t, long c)
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+JZClockDialog::JZClockDialog(JZSong* pSong, char* pTitle, int Clock)
{
- char buf[500];
- s->Clock2String(c, buf);
- String = copystring(buf);
- Title = t;
- Song = s;
+ char Buffer[500];
+ pSong->Clock2String(Clock, Buffer);
+ mpString = copystring(Buffer);
+ mpTitle = pTitle;
+ mpSong = pSong;
}
-tClockDlg::~tClockDlg()
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+JZClockDialog::~JZClockDialog()
{
- delete String;
+ delete mpString;
}
-wxProperty* tClockDlg::mkProperty()
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+wxProperty* JZClockDialog::mkProperty()
{
- return new wxProperty(Title, wxPropertyValue((char**)&String), "string");
+ return new wxProperty(
+ mpTitle,
+ wxPropertyValue((char**)&mpString),
+ "string");
}
-long tClockDlg::GetClock()
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+int JZClockDialog::GetClock()
{
- return Song->String2Clock(String);
+ return mpSong->String2Clock(mpString);
}
Modified: trunk/jazz/src/ClockDialog.h
===================================================================
--- trunk/jazz/src/ClockDialog.h 2008-03-31 04:12:45 UTC (rev 379)
+++ trunk/jazz/src/ClockDialog.h 2008-04-01 04:40:13 UTC (rev 380)
@@ -26,18 +26,29 @@
class JZSong;
class wxProperty;
-class tClockDlg
+//*****************************************************************************
+//*****************************************************************************
+class JZClockDialog
{
- char *String;
- char *Title;
- JZSong *Song;
+ public:
- public:
- tClockDlg(JZSong *s, char *title, long clk);
- ~tClockDlg();
- //wxFormItem *mkFormItem(int w);
+ JZClockDialog(JZSong* pSong, char* pTitle, int Clock);
+
+ ~JZClockDialog();
+
+// wxFormItem *mkFormItem(int w);
+
wxProperty* mkProperty();
- long GetClock();
+
+ int GetClock();
+
+ private:
+
+ char* mpString;
+
+ char* mpTitle;
+
+ JZSong* mpSong;
};
#endif // !defined(JZ_CLOCKDIALOG_H)
Modified: trunk/jazz/src/Dialogs.cpp
===================================================================
--- trunk/jazz/src/Dialogs.cpp 2008-03-31 04:12:45 UTC (rev 379)
+++ trunk/jazz/src/Dialogs.cpp 2008-04-01 04:40:13 UTC (rev 380)
@@ -741,7 +741,7 @@
public:
JZTrack *Track;
- tClockDlg ClockDlg;
+ JZClockDialog ClockDlg;
JZPianoWindow* Win;
JZEvent *Event;
Modified: trunk/jazz/src/Filter.cpp
===================================================================
--- trunk/jazz/src/Filter.cpp 2008-03-31 04:12:45 UTC (rev 379)
+++ trunk/jazz/src/Filter.cpp 2008-04-01 04:40:13 UTC (rev 380)
@@ -113,7 +113,7 @@
class tFilterDlg : public tPropertyListDlg
{
JZFilter *Filter;
- tClockDlg FromClockDlg, ToClockDlg;
+ JZClockDialog FromClockDlg, ToClockDlg;
public:
tFilterDlg(JZFilter *f, JZSong *s, int ShowEventStats);
Modified: trunk/jazz/src/Song.cpp
===================================================================
--- trunk/jazz/src/Song.cpp 2008-03-31 04:12:45 UTC (rev 379)
+++ trunk/jazz/src/Song.cpp 2008-04-01 04:40:13 UTC (rev 380)
@@ -161,19 +161,19 @@
clk % TicksPerCount);
}
-int JZSong::String2Clock(const char *buf)
+int JZSong::String2Clock(const char* buf)
{
- int bar = 1;
- int clk = 0;
- int cnt = 1;
- sscanf(buf, "%d:%d:%d", &bar, &cnt, &clk);
- -- bar;
- -- cnt;
- bar += intro_length; // buf is from user input!
- JZBarInfo b(this);
- b.SetBar(bar);
- int TicksPerCount = b.TicksPerBar / b.CountsPerBar;
- return b.Clock + cnt * TicksPerCount + clk;
+ int Bar = 1;
+ int Clock = 0;
+ int Count = 1;
+ sscanf(buf, "%d:%d:%d", &Bar, &Count, &Clock);
+ --Bar;
+ --Count;
+ Bar += intro_length; // buf is from user input!
+ JZBarInfo BarInfo(this);
+ BarInfo.SetBar(Bar);
+ int TicksPerCount = BarInfo.TicksPerBar / BarInfo.CountsPerBar;
+ return BarInfo.Clock + Count * TicksPerCount + Clock;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pst...@us...> - 2008-04-02 13:46:07
|
Revision: 387
http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=387&view=rev
Author: pstieber
Date: 2008-04-02 06:46:04 -0700 (Wed, 02 Apr 2008)
Log Message:
-----------
Changed a char * argument to const char*.
Modified Paths:
--------------
trunk/jazz/src/AlsaPlayer.cpp
trunk/jazz/src/AlsaPlayer.h
Modified: trunk/jazz/src/AlsaPlayer.cpp
===================================================================
--- trunk/jazz/src/AlsaPlayer.cpp 2008-04-02 04:40:09 UTC (rev 386)
+++ trunk/jazz/src/AlsaPlayer.cpp 2008-04-02 13:46:04 UTC (rev 387)
@@ -930,7 +930,7 @@
//-----------------------------------------------------------------------------
int tAlsaPlayer::select_list(
tAlsaDeviceList& list,
- char* title,
+ const char* title,
int def_device)
{
if (list.GetCount() > 0)
Modified: trunk/jazz/src/AlsaPlayer.h
===================================================================
--- trunk/jazz/src/AlsaPlayer.h 2008-04-02 04:40:09 UTC (rev 386)
+++ trunk/jazz/src/AlsaPlayer.h 2008-04-02 13:46:04 UTC (rev 387)
@@ -90,7 +90,7 @@
void scan_clients(
tAlsaDeviceList& Devicelist,
unsigned DeviceCapabilities);
- int select_list(tAlsaDeviceList &list, char *title, int def_device);
+ 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, int now); // 0 == ok
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pst...@us...> - 2008-04-03 04:42:42
|
Revision: 390
http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=390&view=rev
Author: pstieber
Date: 2008-04-02 21:42:40 -0700 (Wed, 02 Apr 2008)
Log Message:
-----------
Changed char* to const char* in many places.
Modified Paths:
--------------
trunk/jazz/src/ClockDialog.cpp
trunk/jazz/src/ClockDialog.h
trunk/jazz/src/Dialogs.cpp
trunk/jazz/src/Filter.h
trunk/jazz/src/KeyDialog.cpp
trunk/jazz/src/KeyDialog.h
trunk/jazz/src/KeyStringConverters.cpp
trunk/jazz/src/NamedChoice.cpp
trunk/jazz/src/NamedChoice.h
trunk/jazz/src/Track.cpp
trunk/jazz/src/Track.h
Modified: trunk/jazz/src/ClockDialog.cpp
===================================================================
--- trunk/jazz/src/ClockDialog.cpp 2008-04-03 03:45:45 UTC (rev 389)
+++ trunk/jazz/src/ClockDialog.cpp 2008-04-03 04:42:40 UTC (rev 390)
@@ -34,7 +34,7 @@
//*****************************************************************************
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-JZClockDialog::JZClockDialog(JZSong* pSong, char* pTitle, int Clock)
+JZClockDialog::JZClockDialog(JZSong* pSong, const char* pTitle, int Clock)
{
char Buffer[500];
pSong->Clock2String(Clock, Buffer);
Modified: trunk/jazz/src/ClockDialog.h
===================================================================
--- trunk/jazz/src/ClockDialog.h 2008-04-03 03:45:45 UTC (rev 389)
+++ trunk/jazz/src/ClockDialog.h 2008-04-03 04:42:40 UTC (rev 390)
@@ -32,7 +32,7 @@
{
public:
- JZClockDialog(JZSong* pSong, char* pTitle, int Clock);
+ JZClockDialog(JZSong* pSong, const char* pTitle, int Clock);
~JZClockDialog();
@@ -46,7 +46,7 @@
char* mpString;
- char* mpTitle;
+ const char* mpTitle;
JZSong* mpSong;
};
Modified: trunk/jazz/src/Dialogs.cpp
===================================================================
--- trunk/jazz/src/Dialogs.cpp 2008-04-03 03:45:45 UTC (rev 389)
+++ trunk/jazz/src/Dialogs.cpp 2008-04-03 04:42:40 UTC (rev 390)
@@ -1473,7 +1473,7 @@
return;
tEventDlg *dlg = 0;
- char *str = 0;
+ const char* str = 0;
switch (e->Stat)
{
case StatKeyOn:
Modified: trunk/jazz/src/Filter.h
===================================================================
--- trunk/jazz/src/Filter.h 2008-04-03 03:45:45 UTC (rev 389)
+++ trunk/jazz/src/Filter.h 2008-04-03 04:42:40 UTC (rev 390)
@@ -45,7 +45,7 @@
{
public:
int Stat;
- char *Name;
+ const char* Name;
bool Selected;
int MinValue, MaxValue;
int FromValue, ToValue;
Modified: trunk/jazz/src/KeyDialog.cpp
===================================================================
--- trunk/jazz/src/KeyDialog.cpp 2008-04-03 03:45:45 UTC (rev 389)
+++ trunk/jazz/src/KeyDialog.cpp 2008-04-03 04:42:40 UTC (rev 390)
@@ -27,33 +27,34 @@
#include "DeprecatedStringUtils.h"
#include "DeprecatedWx/proplist.h"
-tKeyDlg::tKeyDlg(char *t, int Key)
+tKeyDlg::tKeyDlg(const char* pTitle, int Key)
{
char buf[50];
Key2Str(Key, buf);
- String = copystring(buf);
- Title = t;
+ mpString = copystring(buf);
+ mpTitle = pTitle;
}
tKeyDlg::~tKeyDlg()
{
- delete String;
+ delete mpString;
}
#ifdef OBSOLETE
wxFormItem *tKeyDlg::mkFormItem(int w)
{
- return wxMakeFormString(Title, &String, wxFORM_DEFAULT,0,0,0,w);
+ return wxMakeFormString(mpTitle, &mpString, wxFORM_DEFAULT, 0, 0, 0, w);
}
#endif
-wxProperty* tKeyDlg::mkProperty(){
- return new wxProperty(Title, wxPropertyValue((char**)&String), "string");
+wxProperty* tKeyDlg::mkProperty()
+{
+ return new wxProperty(mpTitle, wxPropertyValue((char**)&mpString), "string");
}
int tKeyDlg::GetKey()
{
- return Str2Key(String);
+ return Str2Key(mpString);
}
Modified: trunk/jazz/src/KeyDialog.h
===================================================================
--- trunk/jazz/src/KeyDialog.h 2008-04-03 03:45:45 UTC (rev 389)
+++ trunk/jazz/src/KeyDialog.h 2008-04-03 04:42:40 UTC (rev 390)
@@ -27,12 +27,9 @@
class tKeyDlg
{
- char *String;
- char *Title;
-
public:
- tKeyDlg(char *title, int Key);
+ tKeyDlg(const char* pTitle, int Key);
~tKeyDlg();
@@ -41,6 +38,12 @@
wxProperty* mkProperty();
int GetKey();
+
+ private:
+
+ char* mpString;
+
+ const char* mpTitle;
};
#endif // !defined(JZ_KEYDIALOG_H)
Modified: trunk/jazz/src/KeyStringConverters.cpp
===================================================================
--- trunk/jazz/src/KeyStringConverters.cpp 2008-04-03 03:45:45 UTC (rev 389)
+++ trunk/jazz/src/KeyStringConverters.cpp 2008-04-03 04:42:40 UTC (rev 390)
@@ -26,7 +26,7 @@
void Key2Str(int Key, char* pString)
{
- static char* pNames[] =
+ static const char* pNames[] =
{
"C",
"C#",
@@ -48,8 +48,8 @@
int Str2Key(const char *pString)
{
- static char sKey[] = "cCdDeEfFgGaAbB";
- static int nKey[] =
+ static const char sKey[] = "cCdDeEfFgGaAbB";
+ static int nKey[] =
{
0,
0,
Modified: trunk/jazz/src/NamedChoice.cpp
===================================================================
--- trunk/jazz/src/NamedChoice.cpp 2008-04-03 03:45:45 UTC (rev 389)
+++ trunk/jazz/src/NamedChoice.cpp 2008-04-03 04:42:40 UTC (rev 390)
@@ -30,7 +30,7 @@
using namespace std;
tNamedChoice::tNamedChoice(
- char* pTitle,
+ const char* pTitle,
const std::vector<std::pair<std::string, int> >& Pairs,
int* pResult)
: //mpTitle(pTitle),
@@ -56,8 +56,15 @@
list->Append((wxObject *)copystring(mpValues[i].Name));
wxFormItemConstraint *constraint = wxMakeConstraintStrings(list);
- return wxMakeFormString(mpTitle, &mpSelection, wxFORM_SINGLE_LIST, new wxList(constraint, 0),
- 0, 0, w, h);
+ return wxMakeFormString(
+ mpTitle,
+ &mpSelection,
+ wxFORM_SINGLE_LIST,
+ new wxList(constraint, 0),
+ 0,
+ 0,
+ w,
+ h);
}
#endif
Modified: trunk/jazz/src/NamedChoice.h
===================================================================
--- trunk/jazz/src/NamedChoice.h 2008-04-03 03:45:45 UTC (rev 389)
+++ trunk/jazz/src/NamedChoice.h 2008-04-03 04:42:40 UTC (rev 390)
@@ -37,7 +37,7 @@
public:
tNamedChoice(
- char* pTitle,
+ const char* pTitle,
const std::vector<std::pair<std::string, int> >& Pairs,
int* pResult);
Modified: trunk/jazz/src/Track.cpp
===================================================================
--- trunk/jazz/src/Track.cpp 2008-04-03 03:45:45 UTC (rev 389)
+++ trunk/jazz/src/Track.cpp 2008-04-03 04:42:40 UTC (rev 390)
@@ -2089,11 +2089,11 @@
// ----------------------- Copyright ------------------------------------
-char* JZTrack::GetCopyright()
+const char* JZTrack::GetCopyright()
{
if (Copyright)
{
- return (char *)Copyright->Data;
+ return (const char *)Copyright->Data;
}
return "";
}
@@ -2120,11 +2120,11 @@
// ----------------------- Name ------------------------------------
-char* JZTrack::GetName()
+const char* JZTrack::GetName()
{
if (mName)
{
- return (char *)mName->Data;
+ return (const char*)mName->Data;
}
return "";
}
@@ -3335,7 +3335,7 @@
// ------------------------- State ----------------------------------
-char *JZTrack::GetStateChar()
+const char* JZTrack::GetStateChar()
{
switch (State)
{
Modified: trunk/jazz/src/Track.h
===================================================================
--- trunk/jazz/src/Track.h 2008-04-03 03:45:45 UTC (rev 389)
+++ trunk/jazz/src/Track.h 2008-04-03 04:42:40 UTC (rev 390)
@@ -440,20 +440,24 @@
}
void Merge(tEventArray *other);
- void MergeRange(tEventArray *other, int FromClock, int ToClock, int Replace = 0);
+ void MergeRange(
+ tEventArray *other,
+ int FromClock,
+ int ToClock,
+ int Replace = 0);
void Undo();
void Redo();
void NewUndoBuffer();
void Clear();
void Cleanup();
- char *GetName();
+ const char* GetName();
void SetName(char *Name);
- char *GetCopyright();
+ const char* GetCopyright();
void SetCopyright(char *Copyright);
- char *GetStateChar();
+ const char* GetStateChar();
void SetState(int NewState);
void ToggleState(int Direction); // +1 = next, -1 = prev
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pst...@us...> - 2008-04-03 05:13:18
|
Revision: 392
http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=392&view=rev
Author: pstieber
Date: 2008-04-02 22:13:17 -0700 (Wed, 02 Apr 2008)
Log Message:
-----------
Changed char* to const char*.
Modified Paths:
--------------
trunk/jazz/src/ControlEdit.h
trunk/jazz/src/Player.cpp
Modified: trunk/jazz/src/ControlEdit.h
===================================================================
--- trunk/jazz/src/ControlEdit.h 2008-04-03 05:06:06 UTC (rev 391)
+++ trunk/jazz/src/ControlEdit.h 2008-04-03 05:13:17 UTC (rev 392)
@@ -35,7 +35,9 @@
class tCtrlPanel : public wxPanel
{
public:
- friend class tCtrlEditBase;
+
+ friend class tCtrlEditBase;
+
tCtrlPanel(
tCtrlEditBase* e,
wxWindow* pParent,
@@ -44,11 +46,12 @@
int width=-1,
int height=-1,
long style=0,
- char *name = "panel")
- : wxPanel(pParent, x, y, width, height, style, name)
+ const char* pName = "panel")
+ : wxPanel(pParent, x, y, width, height, style, pName)
{
edit = e;
}
+
tCtrlEditBase *edit;
};
Modified: trunk/jazz/src/Player.cpp
===================================================================
--- trunk/jazz/src/Player.cpp 2008-04-03 05:06:06 UTC (rev 391)
+++ trunk/jazz/src/Player.cpp 2008-04-03 05:13:17 UTC (rev 392)
@@ -1455,56 +1455,69 @@
}
- int tSeq2Player::FindMidiDevice()
- {
- struct synth_info si;
- int i, nrsynths, ninp;
+int tSeq2Player::FindMidiDevice()
+{
+ struct synth_info si;
+ int i, nrsynths, ninp;
- if (ioctl(seqfd, SNDCTL_SEQ_NRSYNTHS, &nrsynths) == -1) {
- perror("SNDCTL_SEQ_NRSYNTHS");
- return -1;
- }
+ if (ioctl(seqfd, SNDCTL_SEQ_NRSYNTHS, &nrsynths) == -1)
+ {
+ perror("SNDCTL_SEQ_NRSYNTHS");
+ return -1;
+ }
- wxString *devs = new wxString[nrsynths];
+ wxString *devs = new wxString[nrsynths];
- ninp = 0;
- for (i = 0; i < nrsynths; i++) {
- si.device = i;
- if (ioctl(seqfd, SNDCTL_SYNTH_INFO, &si) == -1) {
- perror("SNDCTL_SYNTH_INFO");
- return -1;
- }
- //if (si.synth_type == SYNTH_TYPE_MIDI || si.synth_type == SYNTH_TYPE_SAMPLE)
- {
- devs[ninp] = si.name;
- ninp++;
- }
- }
+ ninp = 0;
+ for (i = 0; i < nrsynths; i++)
+ {
+ si.device = i;
+ if (ioctl(seqfd, SNDCTL_SYNTH_INFO, &si) == -1)
+ {
+ perror("SNDCTL_SYNTH_INFO");
+ return -1;
+ }
+ // if (si.synth_type == SYNTH_TYPE_MIDI || si.synth_type == SYNTH_TYPE_SAMPLE)
+ {
+ devs[ninp] = si.name;
+ ninp++;
+ }
+ }
- if (ninp > 0) {
- char *title = "MIDI Device";
- wxSingleChoiceDialog *dialog = new wxSingleChoiceDialog(gpTrackWindow,
- title,
- title,
- ninp,
- devs);
- if(mididev != -1) dialog->SetSelection(mididev);
+ if (ninp > 0)
+ {
+ const char* pTitle = "MIDI Device";
+ wxSingleChoiceDialog *dialog = new wxSingleChoiceDialog(
+ gpTrackWindow,
+ pTitle,
+ pTitle,
+ ninp,
+ devs);
- int res = dialog->ShowModal();
- int k = dialog->GetSelection();
- dialog->Destroy();
+ if (mididev != -1)
+ {
+ dialog->SetSelection(mididev);
+ }
- delete [] devs;
+ int res = dialog->ShowModal();
+ int k = dialog->GetSelection();
+ dialog->Destroy();
- if(res == wxCANCEL) k = -1;
+ delete [] devs;
- return k;
+ if (res == wxCANCEL)
+ {
+ k = -1;
+ }
- } else {
- delete [] devs;
- cerr << "no midi device found!\n";
- return -1;
- }
+ return k;
+ }
+ else
+ {
+ delete [] devs;
+ cerr << "no midi device found!\n";
+ return -1;
+ }
}
void tSeq2Player::SetSoftThru(int on, int idummy, int odummy)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pst...@us...> - 2008-04-05 05:19:55
|
Revision: 396
http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=396&view=rev
Author: pstieber
Date: 2008-04-04 22:19:53 -0700 (Fri, 04 Apr 2008)
Log Message:
-----------
Commented some code that caused an unkillable process on Mandriva 2008.0 and removed some debug output.
Modified Paths:
--------------
trunk/jazz/src/AlsaDriver.cpp
trunk/jazz/src/AlsaPlayer.cpp
trunk/jazz/src/AlsaThru.cpp
trunk/jazz/src/JazzPlusPlusApplication.cpp
trunk/jazz/src/Player.cpp
trunk/jazz/src/Project.cpp
Modified: trunk/jazz/src/AlsaDriver.cpp
===================================================================
--- trunk/jazz/src/AlsaDriver.cpp 2008-04-05 01:37:46 UTC (rev 395)
+++ trunk/jazz/src/AlsaDriver.cpp 2008-04-05 05:19:53 UTC (rev 396)
@@ -135,7 +135,6 @@
tAlsaAudioPlayer::~tAlsaAudioPlayer()
{
- cout << "Deleting ALSA audio driver start..." << endl;
delete listener;
delete AudioBuffer;
if (pcm[PLAYBACK])
@@ -148,7 +147,6 @@
snd_pcm_close(pcm[CAPTURE]);
pcm[CAPTURE] = NULL;
}
- cout << "Done." << endl;
}
Modified: trunk/jazz/src/AlsaPlayer.cpp
===================================================================
--- trunk/jazz/src/AlsaPlayer.cpp 2008-04-05 01:37:46 UTC (rev 395)
+++ trunk/jazz/src/AlsaPlayer.cpp 2008-04-05 05:19:53 UTC (rev 396)
@@ -301,7 +301,8 @@
{
delete thru;
}
- snd_seq_close(handle);
+ // The following call caused an unkillable process on Mandriva 2008.0.
+// snd_seq_close(handle);
}
//-----------------------------------------------------------------------------
@@ -437,7 +438,6 @@
ev.source = self;
ev.dest = self;
snd_seq_ev_schedule_tick(&ev, queue, 0, clock);
- cout << "scheduling echo for " << clock << endl;
snd_seq_ev_set_fixed(&ev);
ev.type = SND_SEQ_EVENT_ECHO;
ev.data.raw32.d[0] = arg;
@@ -464,7 +464,6 @@
//-----------------------------------------------------------------------------
void tAlsaPlayer::StartPlay(long clock, long loopClock, int cont)
{
- cout << "tAlsaPlayer::StartPlay" << endl;
recd_clock = clock;
echo_clock = clock;
play_clock = clock;
Modified: trunk/jazz/src/AlsaThru.cpp
===================================================================
--- trunk/jazz/src/AlsaThru.cpp 2008-04-05 01:37:46 UTC (rev 395)
+++ trunk/jazz/src/AlsaThru.cpp 2008-04-05 05:19:53 UTC (rev 396)
@@ -62,8 +62,10 @@
tAlsaThru::~tAlsaThru()
{
- if (running)
- Stop();
+ // Calling Stop() caused the creation of an unkillable process on Mandriva
+ // 2008.0.
+// if (running)
+// Stop();
}
@@ -124,7 +126,8 @@
// disconnect midi-thru
void tAlsaThru::Stop()
{
- if (running) {
+ if (running)
+ {
initialize();
disconnect(source, destin);
running = 0;
Modified: trunk/jazz/src/JazzPlusPlusApplication.cpp
===================================================================
--- trunk/jazz/src/JazzPlusPlusApplication.cpp 2008-04-05 01:37:46 UTC (rev 395)
+++ trunk/jazz/src/JazzPlusPlusApplication.cpp 2008-04-05 05:19:53 UTC (rev 396)
@@ -47,10 +47,6 @@
#endif
-#include <iostream>
-
-using namespace std;
-
//*****************************************************************************
// Description:
// This is the JazzPlusPlus application class definition.
@@ -108,7 +104,6 @@
//-----------------------------------------------------------------------------
JZJazzPlusPlusApplication::~JZJazzPlusPlusApplication()
{
- cout << "In the application desstructor" << endl;
}
//-----------------------------------------------------------------------------
@@ -172,7 +167,6 @@
// Prevent reported leaks from the configuration class.
delete wxConfigBase::Set(0);
- cout << "Done in OnExit" << endl;
return 0;
}
Modified: trunk/jazz/src/Player.cpp
===================================================================
--- trunk/jazz/src/Player.cpp 2008-04-05 01:37:46 UTC (rev 395)
+++ trunk/jazz/src/Player.cpp 2008-04-05 05:19:53 UTC (rev 396)
@@ -205,7 +205,9 @@
JZPlayer::~JZPlayer()
{
+ cout << "JZPlayer delete start..." << endl;
delete PlayLoop;
+ cout << "JZPlayer delete end..." << endl;
}
Modified: trunk/jazz/src/Project.cpp
===================================================================
--- trunk/jazz/src/Project.cpp 2008-04-05 01:37:46 UTC (rev 395)
+++ trunk/jazz/src/Project.cpp 2008-04-05 05:19:53 UTC (rev 396)
@@ -170,19 +170,24 @@
mpMidiPlayer = new tAudioPlayer(this);
if (!mpMidiPlayer->Installed())
{
+ cerr << "tAudioPlayer didn't install." << endl;
+
delete mpMidiPlayer;
mpMidiPlayer = new tSeq2Player(this);
}
if (!mpMidiPlayer->Installed())
{
+ cerr << "tSeq2Player didn't install." << endl;
+
perror("/dev/music");
- cerr
- << "(dev_sequencer2)Jazz will start with no play/record ability."
- << endl;
+
+ cerr << "Jazz will start with no play/record ability." << endl;
+ delete mpMidiPlayer;
mpMidiPlayer = new tNullPlayer(this);
}
#else
- cerr << "This programm lacks OSS driver support" << endl;
+ cerr << "This programm lacks OSS driver support." << endl;
+ cerr << "Jazz will start with no play/record ability." << endl;
mpMidiPlayer = new tNullPlayer(this);
#endif // DEV_SEQUENCER2
}
@@ -192,20 +197,25 @@
mpMidiPlayer = new tAlsaAudioPlayer(this);
if (!mpMidiPlayer->Installed())
{
+ cerr << "tAlsaAudioPlayer didn't install." << endl;
+
delete mpMidiPlayer;
- cout << "creating alsa player" << endl;
mpMidiPlayer = new tAlsaPlayer(this);
}
if (!mpMidiPlayer->Installed())
{
+ cerr << "tAlsaPlayer didn't install." << endl;
+
cerr
<< "Could not install alsa driver." << '\n'
<< "Jazz will start with no play/record ability."
<< endl;
+ delete mpMidiPlayer;
mpMidiPlayer = new tNullPlayer(this);
}
#else
cerr << "This programm lacks ALSA driver support" << endl;
+ cerr << "Jazz will start with no play/record ability." << endl;
mpMidiPlayer = new tNullPlayer(this);
#endif
}
@@ -215,15 +225,19 @@
mpMidiPlayer = new tMpuPlayer(this);
if (!mpMidiPlayer->Installed())
{
+ cerr << "tMpuPlayer didn't install." << endl;
+
cerr
<< "Could not connect to midinet server at host \""
<< %midinethost << "\"\n"
<< "Jazz will start with no play/record ability."
<< endl;
+ delete mpMidiPlayer;
mpMidiPlayer = new tNullPlayer(this);
}
#else
cerr << "This programm lacks JAZZ/MPU401 driver support" << endl;
+ cerr << "Jazz will start with no play/record ability." << endl;
mpMidiPlayer = new tNullPlayer(this);
#endif
}
@@ -325,7 +339,6 @@
delete mpSynth;
delete mpRecInfo;
delete mpConfig;
- cout << "Done Deleting the project." << endl;
}
//-----------------------------------------------------------------------------
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pst...@us...> - 2008-04-05 20:12:13
|
Revision: 398
http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=398&view=rev
Author: pstieber
Date: 2008-04-05 13:12:11 -0700 (Sat, 05 Apr 2008)
Log Message:
-----------
1. Removed the include of WxWidgets from some header files.
2. Made cosmetic changes in Audio.h and reduced the number of casts by reordering
operations.
Modified Paths:
--------------
trunk/jazz/src/Audio.h
trunk/jazz/src/ResourceDialog.cpp
trunk/jazz/src/ResourceDialog.h
trunk/jazz/src/Sample.cpp
Modified: trunk/jazz/src/Audio.h
===================================================================
--- trunk/jazz/src/Audio.h 2008-04-05 05:23:55 UTC (rev 397)
+++ trunk/jazz/src/Audio.h 2008-04-05 20:12:11 UTC (rev 398)
@@ -23,10 +23,6 @@
#ifndef JZ_AUDIO_H
#define JZ_AUDIO_H
-#include "WxWidgets.h"
-
-//#include "config.h"
-
#include "DynamicArray.h"
#include "Project.h"
@@ -84,75 +80,95 @@
#define WAVEHDR void
#endif
-struct tAudioBuffer {
+struct tAudioBuffer
+{
+ // This is a Microsoft Windows for mswin wavehdr
+ WAVEHDR* hdr;
+ short* data;
- WAVEHDR *hdr; // for mswin wavehdr
- short *data;
-
- tAudioBuffer(int dummy) {
+ tAudioBuffer(int dummy)
+ {
hdr = 0;
data = new short [BUFSHORTS];
// in case recording stops inside a buffer
memset(data, 0, BUFBYTES);
}
- ~tAudioBuffer() {
+ ~tAudioBuffer()
+ {
delete [] data;
}
- void Clear() {
+ void Clear()
+ {
memset(data, 0, BUFBYTES);
}
- short *Data() {
+ short* Data()
+ {
return data;
}
-
-
};
DECLARE_ARRAY(tAudioBufferArray, tAudioBuffer*)
-class tAudioBufferQueue {
+class tAudioBufferQueue
+{
public:
- tAudioBufferQueue() {
+
+ tAudioBufferQueue()
+ {
Clear();
}
- ~tAudioBufferQueue() {
+ ~tAudioBufferQueue()
+ {
}
- void Clear() {
+ void Clear()
+ {
written = read = 0;
for (int i = 0; i < BUFCOUNT; i++)
+ {
array[i] = 0;
+ }
}
- int Count() const {
+ int Count() const
+ {
return written - read;
}
- int Empty() const {
+ int Empty() const
+ {
return written == read;
}
- void Put(tAudioBuffer *buf) {
+ void Put(tAudioBuffer *buf)
+ {
array[written++ % BUFCOUNT] = buf;
}
- tAudioBuffer *Get() {
+ tAudioBuffer* Get()
+ {
if (written == read)
+ {
return 0;
+ }
return(array[read++ % BUFCOUNT]);
}
- void UnGet(tAudioBuffer *buf) {
+
+ void UnGet(tAudioBuffer* buf)
+ {
array[ --read % BUFCOUNT ] = buf;
}
private:
- tAudioBuffer *array[BUFCOUNT];
+
+ tAudioBuffer* array[BUFCOUNT];
+
int read, written;
};
@@ -162,24 +178,32 @@
{
friend class tSampleSet;
friend class tWinAudioPlayer;
+
public:
- tAudioRecordBuffer() {
+
+ tAudioRecordBuffer()
+ {
num_buffers = 0;
}
- ~tAudioRecordBuffer() {
+
+ ~tAudioRecordBuffer()
+ {
Clear();
}
void Clear();
tAudioBuffer * RequestBuffer();
- void UndoRequest() {
+ void UndoRequest()
+ {
num_buffers--;
}
- void ResetBufferSize(int size) {
+ void ResetBufferSize(int size)
+ {
bufbytes = size;
}
private:
+
tAudioBufferArray buffers;
int num_buffers;
int bufbytes;
@@ -207,7 +231,9 @@
public:
tSampleSet(long ticks_per_minute);
+
virtual ~tSampleSet();
+
int Load(const wxString& FileName);
// load jazz.spl
@@ -272,8 +298,10 @@
long Ticks2Samples(long ticks) const
{
- long spl = (long)((double)ticks * 60.0 * speed * channels / (double)ticks_per_minute);
- // align to first channel
+ long spl =
+ (long)(60.0 * ticks * speed * channels / (double)ticks_per_minute);
+
+ // Align to the first channel.
return spl & -channels;
}
@@ -285,7 +313,7 @@
// time in millisec
long Ticks2Time(long ticks) const
{
- return (long)((double)ticks * 60000.0 / ticks_per_minute);
+ return (long)(60000.0 * ticks / ticks_per_minute);
}
long Time2Ticks(long time) const
@@ -295,7 +323,7 @@
long Samples2Time(long samples) const
{
- return (long)(1000.0 * (double)samples / speed / channels);
+ return (long)(1000.0 * samples / speed / channels);
}
long Time2Samples(long time) const
@@ -304,17 +332,28 @@
}
virtual const char *GetSampleName(int i);
+
int OnMenuCommand(int id);
+
void StartPlay(long clock);
+
void StopPlay();
// returns number of buffers prepared. Output starts at offs.
int PrepareListen(int key, long fr_smpl = -1, long to_smpl = -1);
+
int PrepareListen(tSample *spl, long fr_smpl = -1, long to_smpl = -1);
+
int ContinueListen(); // return number of buffers
void SaveRecordingDlg(long frc, long toc, tAudioRecordBuffer &buf);
- void SaveWave(const char *fname, long frc, long toc, tAudioRecordBuffer &buf);
+
+ void SaveWave(
+ const char *fname,
+ long frc,
+ long toc,
+ tAudioRecordBuffer &buf);
+
void AddNote(const char *fname, long frc, long toc);
void RefreshDialogs();
@@ -380,7 +419,7 @@
int dirty; // needs reloading
// to communicate between PrepareListen and ContinueListen
- tSample *listen_sample;
+ tSample* listen_sample;
};
#endif // !defined(JZ_AUDIO_H)
Modified: trunk/jazz/src/ResourceDialog.cpp
===================================================================
--- trunk/jazz/src/ResourceDialog.cpp 2008-04-05 05:23:55 UTC (rev 397)
+++ trunk/jazz/src/ResourceDialog.cpp 2008-04-05 20:12:11 UTC (rev 398)
@@ -16,6 +16,8 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+#include "WxWidgets.h"
+
#include <wx/fs_zip.h>
#include <wx/xrc/xmlres.h>
Modified: trunk/jazz/src/ResourceDialog.h
===================================================================
--- trunk/jazz/src/ResourceDialog.h 2008-04-05 05:23:55 UTC (rev 397)
+++ trunk/jazz/src/ResourceDialog.h 2008-04-05 20:12:11 UTC (rev 398)
@@ -23,8 +23,6 @@
#ifndef JZ_RESOURCEDIALOG_H
#define JZ_RESOURCEDIALOG_H
-#include "WxWidgets.h"
-
#include <list>
/// Used by jppResourceDialog to store "Attach" entries.
@@ -35,7 +33,8 @@
fields should all be set to zero, except the one that needs to be filled.
The constructor will set all the fields to zero. */
-class jppResourceElement {
+class jppResourceElement
+{
public:
/// ID of the widget in the XRC resource.
wxString resource;
Modified: trunk/jazz/src/Sample.cpp
===================================================================
--- trunk/jazz/src/Sample.cpp 2008-04-05 05:23:55 UTC (rev 397)
+++ trunk/jazz/src/Sample.cpp 2008-04-05 20:12:11 UTC (rev 398)
@@ -20,7 +20,8 @@
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
//*****************************************************************************
-//#include "config.h"
+#include "WxWidgets.h"
+
#include "Sample.h"
#include "Audio.h"
#include "Random.h"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pst...@us...> - 2008-04-05 23:43:44
|
Revision: 399
http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=399&view=rev
Author: pstieber
Date: 2008-04-05 16:43:43 -0700 (Sat, 05 Apr 2008)
Log Message:
-----------
1. Changes JZPlayer::samples to mSamples.
2. Made several stylistic changes in the Windows audio interface code.
3. Started making similar changes to the Linux version.
4. Made cosmetic changes.
Modified Paths:
--------------
trunk/jazz/src/AlsaDriver.cpp
trunk/jazz/src/AlsaDriver.h
trunk/jazz/src/AudioDriver.cpp
trunk/jazz/src/AudioDriver.h
trunk/jazz/src/Player.cpp
trunk/jazz/src/Player.h
trunk/jazz/src/mswin/WindowsAudioInterface.cpp
trunk/jazz/src/mswin/WindowsAudioInterface.h
Modified: trunk/jazz/src/AlsaDriver.cpp
===================================================================
--- trunk/jazz/src/AlsaDriver.cpp 2008-04-05 20:12:11 UTC (rev 398)
+++ trunk/jazz/src/AlsaDriver.cpp 2008-04-05 23:43:43 UTC (rev 399)
@@ -45,89 +45,100 @@
using namespace std;
-#define snd_pcm_write(pcm,data,size) snd_pcm_writei(pcm,data,size)
-#define snd_pcm_read(pcm,data,size) snd_pcm_readi(pcm,data,size)
-
#define MAX_FRAGS 16 // enough large?
-
-
class tAlsaAudioListener : public wxTimer
{
public:
- tAlsaAudioListener(tAlsaAudioPlayer *p, int key)
+
+ tAlsaAudioListener(tAlsaAudioPlayer* pPlayer, int key)
+ : wxTimer(),
+ mpPlayer(pPlayer),
{
- hard_exit = TRUE;
- player = p;
- player->listener = this;
- player->rec_info = 0; // not recording!
- player->running_mode = 0;
-
+ mHardExit = TRUE;
+ mpPlayer->mpListener = this;
+ mpPlayer->rec_info = 0; // not recording!
+ mpPlayer->running_mode = 0;
+
// SYNC seems not to work?? so add 8 more silent buffers
// to hear the end of the sample too.
- player->OpenDsp(tAlsaAudioPlayer::PLAYBACK, 0);
- count = 8 + player->samples.PrepareListen(key);
+ mpPlayer->OpenDsp(tAlsaAudioPlayer::PLAYBACK, 0);
+ mCount = 8 + mpPlayer->mSamples.PrepareListen(key);
Start(20);
}
- tAlsaAudioListener(tAlsaAudioPlayer *p, tSample &spl, long fr_smpl, long to_smpl)
+ tAlsaAudioListener(
+ tAlsaAudioPlayer* pPlayer,
+ tSample& spl,
+ long fr_smpl,
+ long to_smpl)
+ : wxTimer(),
+ mpPlayer(pPlayer),
{
- hard_exit = TRUE;
- player = p;
- player->listener = this;
- player->rec_info = 0; // not recording!
- player->running_mode = 0;
+ mHardExit = TRUE;
+ mpPlayer->mpListener = this;
+ mpPlayer->rec_info = 0; // not recording!
+ mpPlayer->running_mode = 0;
- player->OpenDsp(tAlsaAudioPlayer::PLAYBACK, 0);
- player->samples.ResetBufferSize(player->frag_byte_size[tAlsaAudioPlayer::PLAYBACK]);
- count = 8 + player->samples.PrepareListen(&spl, fr_smpl, to_smpl);
+ mpPlayer->OpenDsp(tAlsaAudioPlayer::PLAYBACK, 0);
+
+ mpPlayer->mSamples.ResetBufferSize(
+ mpPlayer->frag_byte_size[tAlsaAudioPlayer::PLAYBACK]);
+
+ mCount = 8 + mpPlayer->mSamples.PrepareListen(&spl, fr_smpl, to_smpl);
+
Start(20);
}
~tAlsaAudioListener()
{
Stop();
- player->CloseDsp(hard_exit);
- player->listener = 0;
+ mpPlayer->CloseDsp(mHardExit);
+ mpPlayer->mpListener = 0;
}
virtual void Notify()
{
- count -= player->WriteSamples();
- count += player->samples.ContinueListen();
- if (count <= 0)
+ mCount -= mpPlayer->WriteSamples();
+ mCount += mpPlayer->mSamples.ContinueListen();
+ if (mCount <= 0)
{
- hard_exit = FALSE;
+ mHardExit = FALSE;
delete this;
}
}
long GetPlayPosition()
{
- return player->GetCurrentPosition(tAlsaAudioPlayer::PLAYBACK);
+ return mpPlayer->GetCurrentPosition(tAlsaAudioPlayer::PLAYBACK);
}
private:
- tAlsaAudioPlayer *player;
- int count;
- int hard_exit;
+
+ tAlsaAudioPlayer* mpPlayer;
+
+ int mCount;
+
+ int mHardExit;
};
-tAlsaAudioPlayer::tAlsaAudioPlayer(JZSong *song)
- : tAlsaPlayer(song)
+tAlsaAudioPlayer::tAlsaAudioPlayer(JZSong* pSong)
+ : tAlsaPlayer(pSong)
{
AudioBuffer = new tEventArray();
installed = 0;
audio_enabled = 0;
- listener = 0;
- can_duplex = 0; // no duplex yet.
+ mpListener = 0;
+ mCanDuplex = 0; // no duplex yet.
pcm[PLAYBACK] = NULL;
pcm[CAPTURE] = NULL;
dev[PLAYBACK] = gpConfig->StrValue(C_AlsaAudioOutputDevice);
dev[CAPTURE] = gpConfig->StrValue(C_AlsaAudioInputDevice);
- can_duplex = 1; /* FIXME */
+
+ // FIXME
+ mCanDuplex = 1;
installed = 1;
audio_enabled = 1;
}
@@ -135,7 +146,7 @@
tAlsaAudioPlayer::~tAlsaAudioPlayer()
{
- delete listener;
+ delete mpListener;
delete AudioBuffer;
if (pcm[PLAYBACK])
{
@@ -152,7 +163,7 @@
int tAlsaAudioPlayer::LoadSamples(const char *filename)
{
- return samples.Load(filename);
+ return mSamples.Load(filename);
}
int tAlsaAudioPlayer::RecordMode() const
@@ -167,8 +178,8 @@
void tAlsaAudioPlayer::StartPlay(long clock, long loopClock, int cont)
{
- delete listener;
- samples.StartPlay(clock);
+ delete mpListener;
+ mSamples.StartPlay(clock);
tAlsaPlayer::StartPlay(clock, loopClock, cont);
if (!audio_enabled)
@@ -177,7 +188,7 @@
}
long ticks_per_minute = Song->TicksPerQuarter * Song->Speed();
- samples.ResetBuffers(AudioBuffer, clock, ticks_per_minute);
+ mSamples.ResetBuffers(AudioBuffer, clock, ticks_per_minute);
last_scount = 0;
cur_pos = 0;
audio_clock_offset = clock;
@@ -191,11 +202,11 @@
recbuffers.ResetBufferSize(frag_byte_size[CAPTURE]);
}
- if (dev[CAPTURE] != dev[PLAYBACK] || can_duplex || running_mode == 0)
+ if (dev[CAPTURE] != dev[PLAYBACK] || mCanDuplex || running_mode == 0)
{
OpenDsp(PLAYBACK, 1);
- samples.ResetBufferSize(frag_byte_size[PLAYBACK]);
- samples.FillBuffers(OutClock);
+ mSamples.ResetBufferSize(frag_byte_size[PLAYBACK]);
+ mSamples.FillBuffers(OutClock);
}
if (running_mode == 0)
@@ -216,31 +227,42 @@
void tAlsaAudioPlayer::StartAudio()
{
if (pcm[PLAYBACK])
+ {
snd_pcm_start(pcm[PLAYBACK]);
+ }
if (pcm[CAPTURE])
+ {
snd_pcm_start(pcm[CAPTURE]);
+ }
}
void tAlsaAudioPlayer::OpenDsp(int mode, int sync_mode)
{
if (!audio_enabled)
+ {
return;
+ }
unsigned int channels;
snd_pcm_format_t format;
snd_pcm_uframes_t buffer_size, period_size;
frame_shift[mode] = 0;
- if (samples.BitsPerSample() == 8)
+ if (mSamples.BitsPerSample() == 8)
+ {
format = SND_PCM_FORMAT_U8;
- else {
+ }
+ else
+ {
format = SND_PCM_FORMAT_S16_LE;
frame_shift[mode]++;
}
- channels = samples.GetChannels();
+ channels = mSamples.GetChannels();
if (channels > 1)
+ {
frame_shift[mode]++;
+ }
snd_pcm_stream_t stream = (mode == PLAYBACK) ?
SND_PCM_STREAM_PLAYBACK : SND_PCM_STREAM_CAPTURE;
@@ -269,20 +291,22 @@
perror("cannot set audio channels");
goto __error;
}
- if (snd_pcm_hw_params_set_rate(pcm[mode], hw, samples.GetSpeed(), 0) < 0)
+ if (snd_pcm_hw_params_set_rate(pcm[mode], hw, mSamples.GetSpeed(), 0) < 0)
{
- cerr << "cannot set audio rate: " << samples.GetSpeed() << endl;
+ cerr << "cannot set audio rate: " << mSamples.GetSpeed() << endl;
goto __error;
}
period_size = FRAGBYTES >> frame_shift[mode];
- if ((period_size = snd_pcm_hw_params_set_period_size_near(pcm[mode], hw, &period_size, 0)) < 0)
+ if (
+ (period_size = snd_pcm_hw_params_set_period_size_near(pcm[mode], hw, &period_size, 0)) < 0)
{
perror("cannot set audio period");
goto __error;
}
buffer_size = period_size * MAX_FRAGS;
- if ((buffer_size = snd_pcm_hw_params_set_buffer_size_near(pcm[mode], hw, &buffer_size)) < 0)
+ if (
+ (buffer_size = snd_pcm_hw_params_set_buffer_size_near(pcm[mode], hw, &buffer_size)) < 0)
{
perror("cannot set audio buffer");
goto __error;
@@ -302,9 +326,14 @@
snd_pcm_sw_params_alloca(&sw);
snd_pcm_sw_params_current(pcm[mode], sw);
if (sync_mode)
- snd_pcm_sw_params_set_start_threshold(pcm[mode], sw, 0x7fffffff); /* FIXME */
+ {
+ // FIXME
+ snd_pcm_sw_params_set_start_threshold(pcm[mode], sw, 0x7fffffff);
+ }
else
+ {
snd_pcm_sw_params_set_start_threshold(pcm[mode], sw, 1);
+ }
if (snd_pcm_sw_params(pcm[mode], sw) < 0)
{
perror("snd_pcm_sw_params");
@@ -323,41 +352,47 @@
}
-void tAlsaAudioPlayer::CloseDsp(int reset)
+void tAlsaAudioPlayer::CloseDsp(bool Reset)
{
if (pcm)
{
- if (reset)
+ if (Reset)
{
if (pcm[PLAYBACK])
{
if (snd_pcm_drop(pcm[PLAYBACK]) < 0)
+ {
perror("playback drop");
+ }
}
}
else
{
if (pcm[PLAYBACK])
{
- if (snd_pcm_drain(pcm[PLAYBACK]) < 0 )
+ if (snd_pcm_drain(pcm[PLAYBACK]) < 0)
+ {
perror("playback drain");
+ }
}
if (pcm[CAPTURE])
{
- if (snd_pcm_drain(pcm[CAPTURE]) < 0 )
+ if (snd_pcm_drain(pcm[CAPTURE]) < 0)
+ {
perror("capture drain");
+ }
}
}
if (pcm[PLAYBACK])
{
snd_pcm_close(pcm[PLAYBACK]);
pcm[PLAYBACK] = NULL;
- }
+ }
if (pcm[CAPTURE])
{
snd_pcm_close(pcm[CAPTURE]);
pcm[CAPTURE] = NULL;
- }
+ }
}
}
@@ -368,15 +403,22 @@
if (pcm[PLAYBACK])
{
WriteSamples();
- // here it may hang when swapping in pages
- samples.FillBuffers(OutClock);
+
+ // The code may hang here when swapping in pages.
+ mSamples.FillBuffers(OutClock);
+
WriteSamples();
}
+
if (pcm[CAPTURE])
+ {
ReadSamples();
+ }
- if (pcm[PLAYBACK] && samples.softsync)
+ if (pcm[PLAYBACK] && mSamples.softsync)
+ {
MidiSync();
+ }
}
tAlsaPlayer::Notify();
}
@@ -398,7 +440,9 @@
int tAlsaAudioPlayer::WriteSamples()
{
if (!audio_enabled || pcm[PLAYBACK] == NULL)
+ {
return 0;
+ }
int blocks_written = 0;
int room;
@@ -407,11 +451,19 @@
for (; room > frag_size[PLAYBACK]; room -= frag_size[PLAYBACK])
{
- tAudioBuffer *buf = samples.full_buffers.Get();
+ tAudioBuffer *buf = mSamples.full_buffers.Get();
if (buf == 0)
+ {
break;
- ssize_t written = snd_pcm_writei(pcm[PLAYBACK], buf->Data(), frag_size[PLAYBACK]);
- if (written < 0) {
+ }
+
+ ssize_t written = snd_pcm_writei(
+ pcm[PLAYBACK],
+ buf->Data(),
+ frag_size[PLAYBACK]);
+
+ if (written < 0)
+ {
if (written == -EPIPE)
{
cerr << "xrun!!" << endl;
@@ -423,9 +475,11 @@
}
}
if (written > 0)
+ {
cur_scount += written;
+ }
blocks_written++;
- samples.free_buffers.Put(buf);
+ mSamples.free_buffers.Put(buf);
}
return blocks_written;
@@ -435,14 +489,16 @@
void tAlsaAudioPlayer::ReadSamples()
{
if (!audio_enabled || pcm[CAPTURE] == NULL)
+ {
return;
+ }
int room = GetFreeSpace(CAPTURE);
for (; room > frag_size[CAPTURE]; room -= frag_size[CAPTURE])
{
short *b = recbuffers.RequestBuffer()->data;
- if (snd_pcm_read(pcm[CAPTURE], b, frag_size[CAPTURE]) !=
+ if (snd_pcm_readi(pcm[CAPTURE], b, frag_size[CAPTURE]) !=
frag_size[CAPTURE])
{
recbuffers.UndoRequest();
@@ -459,7 +515,7 @@
{
snd_pcm_drop(pcm[PLAYBACK]);
//long ticks_per_minute = Song->TicksPerQuarter * Song->Speed();
- //samples.ResetBuffers(AudioBuffer, clock, ticks_per_minute);
+ //mSamples.ResetBuffers(AudioBuffer, clock, ticks_per_minute);
}
audio_clock_offset = clock;
cur_pos = 0;
@@ -473,15 +529,23 @@
void tAlsaAudioPlayer::MidiSync()
{
if (!audio_enabled)
+ {
return;
+ }
int mode;
if (pcm[PLAYBACK])
+ {
mode = PLAYBACK;
+ }
else if (pcm[CAPTURE])
+ {
mode = CAPTURE;
+ }
else
+ {
return; // disabled
+ }
long scount = GetCurrentPosition(mode);
@@ -499,12 +563,17 @@
qtick = snd_seq_queue_status_get_tick_time(status);
int samplediff;
if (scount < last_scount)
+ {
samplediff = frame_boundary[mode] - (last_scount - scount);
+ }
else
+ {
samplediff = scount - last_scount;
+ }
last_scount = scount;
cur_pos += samplediff;
- long audio_clock = (long)samples.Samples2Ticks(cur_pos) + audio_clock_offset;
+ long audio_clock =
+ (long)mSamples.Samples2Ticks(cur_pos) + audio_clock_offset;
int delta_clock = audio_clock - qtick;
int new_speed = midi_speed + delta_clock;
@@ -527,26 +596,24 @@
snd_seq_ev_set_subs(&ev);
snd_seq_ev_set_direct(&ev);
snd_seq_ev_set_fixed(&ev);
- int us = (int)( 60.0E6 / (double)new_speed );
+ int us = (int)(60.0E6 / new_speed);
snd_seq_ev_set_queue_tempo(&ev, queue, us);
write(&ev, 1);
curr_speed = new_speed;
- // xview has reentrancy problems!!
- // gpTrackWindow->DrawSpeed(curr_speed);
}
}
}
void tAlsaAudioPlayer::StopPlay()
{
- samples.StopPlay();
+ mSamples.StopPlay();
tAlsaPlayer::StopPlay();
if (!audio_enabled)
{
return;
}
- CloseDsp(TRUE);
+ CloseDsp(true);
if (RecordMode())
{
long frc = rec_info->mFromClock;
@@ -559,53 +626,67 @@
{
toc = recd_clock;
}
- samples.SaveRecordingDlg(frc, toc, recbuffers);
+ mSamples.SaveRecordingDlg(frc, toc, recbuffers);
}
recbuffers.Clear();
- // xview has reentrancy problems!!
- // gpTrackWindow->DrawSpeed(midi_speed);
}
void tAlsaAudioPlayer::ListenAudio(int key, int start_stop_mode)
{
if (!audio_enabled)
+ {
return;
+ }
- // when already listening then stop listening
- if (listener)
+ // If already listening then stop listening.
+ if (mpListener)
{
- delete listener;
- listener = 0;
+ delete mpListener;
+ mpListener = 0;
if (start_stop_mode)
+ {
return;
+ }
}
if (key < 0)
+ {
return;
+ }
if (pcm[PLAYBACK]) // device busy (playing)
+ {
return;
- listener = new tAlsaAudioListener(this, key);
+ }
+
+ mpListener = new tAlsaAudioListener(this, key);
}
-void tAlsaAudioPlayer::ListenAudio(tSample &spl, long fr_smpl, long to_smpl)
+void tAlsaAudioPlayer::ListenAudio(tSample& spl, long fr_smpl, long to_smpl)
{
if (!audio_enabled)
+ {
return;
+ }
- // when already listening then stop listening
- if (listener)
+ // If already listening then stop listening.
+ if (mpListener)
{
- delete listener;
- listener = 0;
+ delete mpListener;
+ mpListener = 0;
}
+
if (pcm[PLAYBACK]) // device busy (playing)
+ {
return;
- listener = new tAlsaAudioListener(this, spl, fr_smpl, to_smpl);
+ }
+ mpListener = new tAlsaAudioListener(this, spl, fr_smpl, to_smpl);
}
long tAlsaAudioPlayer::GetListenerPlayPosition()
{
- if (!listener)
+ if (!mpListener)
+ {
return -1L;
- return listener->GetPlayPosition();
+ }
+ return mpListener->GetPlayPosition();
}
Modified: trunk/jazz/src/AlsaDriver.h
===================================================================
--- trunk/jazz/src/AlsaDriver.h 2008-04-05 20:12:11 UTC (rev 398)
+++ trunk/jazz/src/AlsaDriver.h 2008-04-05 23:43:43 UTC (rev 399)
@@ -48,31 +48,39 @@
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 {
- return listener != 0;
+ virtual bool IsListening() const
+ {
+ return mpListener != 0;
}
virtual long GetListenerPlayPosition();
virtual void StartAudio();
virtual void ResetPlay(long clock);
- enum { PLAYBACK = 0, CAPTURE };
+ enum
+ {
+ PLAYBACK = 0,
+ CAPTURE
+ };
// for recording
int RecordMode() const;
int PlayBackMode() const;
private:
- int can_duplex; // TRUE = can do full duplex record/play
int WriteSamples();
void ReadSamples();
void MidiSync();
void OpenDsp(int mode, int sync_mode);
- void CloseDsp(int reset);
+ void CloseDsp(bool Reset);
+
long GetCurrentPosition(int mode);
int GetFreeSpace(int mode);
+ // If true can do full duplex record/play.
+ int mCanDuplex;
+
snd_pcm_t *pcm[2];
int installed;
@@ -92,7 +100,7 @@
int frame_shift[2];
long frame_boundary[2];
- tAlsaAudioListener *listener;
+ tAlsaAudioListener* mpListener;
tAudioRecordBuffer recbuffers;
};
Modified: trunk/jazz/src/AudioDriver.cpp
===================================================================
--- trunk/jazz/src/AudioDriver.cpp 2008-04-05 20:12:11 UTC (rev 398)
+++ trunk/jazz/src/AudioDriver.cpp 2008-04-05 23:43:43 UTC (rev 399)
@@ -34,63 +34,83 @@
#include <fcntl.h>
-
#define AUDIO_DEVICE "/dev/dsp"
class tAudioListener : public wxTimer
{
public:
- tAudioListener(tAudioPlayer *p, int key) {
- hard_exit = TRUE;
- player = p;
- player->listener = this;
- player->rec_info = 0; // not recording!
+ tAudioListener(tAudioPlayer* pPlayer, int key)
+ : wxTimer(),
+ mpPlayer(pPlayer),
+ mCount(0),
+ mHardExit(true)
+ {
+ mpPlayer->mpListener = this;
+
+ mpPlayer->rec_info = 0; // not recording!
+
// SYNC seems not to work?? so add 8 more silent buffers
// to hear the end of the sample too.
- count = 8 + player->samples.PrepareListen(key);
- player->OpenDsp();
+ mCount = 8 + mpPlayer->samples.PrepareListen(key);
+ mpPlayer->OpenDsp();
Start(20);
}
- tAudioListener(tAudioPlayer *p, tSample &spl, long fr_smpl, long to_smpl) {
- hard_exit = TRUE;
- player = p;
- player->listener = this;
- player->rec_info = 0; // not recording!
+ tAudioListener(
+ tAudioPlayer* pPlayer,
+ tSample& spl,
+ long fr_smpl,
+ long to_smpl)
+ : wxTimer(),
+ mpPlayer(pPlayer),
+ mCount(0),
+ mHardExit(true),
+ {
+ mpPlayer = p;
+ mpPlayer->mpListener = this;
+ mpPlayer->rec_info = 0; // not recording!
- count = 8 + player->samples.PrepareListen(&spl, fr_smpl, to_smpl);
- player->OpenDsp();
+ mCount = 8 + mpPlayer->samples.PrepareListen(&spl, fr_smpl, to_smpl);
+ mpPlayer->OpenDsp();
Start(20);
}
- ~tAudioListener() {
+ ~tAudioListener()
+ {
Stop();
- player->CloseDsp(hard_exit);
- player->listener = 0;
+ mpPlayer->CloseDsp(mHardExit);
+ mpPlayer->mpListener = 0;
}
- virtual void Notify() {
- count -= player->WriteSamples();
- count += player->samples.ContinueListen();
- if (count <= 0)
+ virtual void Notify()
+ {
+ mCount -= mpPlayer->WriteSamples();
+ mCount += mpPlayer->samples.ContinueListen();
+ if (mCount <= 0)
{
- hard_exit = FALSE;
+ mHardExit = false;
delete this;
}
}
- long GetPlayPosition() {
+ long GetPlayPosition()
+ {
count_info cinfo;
- if (ioctl(player->dev, SNDCTL_DSP_GETOPTR, &cinfo) == -1)
+ if (ioctl(mpPlayer->dev, SNDCTL_DSP_GETOPTR, &cinfo) == -1)
+ {
perror("SNDCTL_DSP_GETOPTR");
+ }
return (cinfo.bytes - cinfo.ptr) / sizeof(short);
}
private:
- tAudioPlayer *player;
- int count;
- int hard_exit;
+
+ tAudioPlayer* mpPlayer;
+
+ int mCount;
+
+ int mHardExit;
};
@@ -99,41 +119,55 @@
: tSeq2Player(song)
{
long dummy = 0;
- AudioBuffer = new tEventArray();
- installed = 0;
+ AudioBuffer = new tEventArray();
+ installed = 0;
dummy = gpConfig->GetValue(C_EnableAudio);
audio_enabled = dummy;
- listener = 0;
- can_duplex = 0; // no duplex yet.
- dev = -1;
+ mpListener = 0;
+ mCanDuplex = 0; // no duplex yet.
+ dev = -1;
// check for device
dev = open(AUDIO_DEVICE, O_WRONLY, 0);
- if (dev >= 0) {
+ if (dev >= 0)
+ {
// check device caps
int caps;
ioctl(dev, SNDCTL_DSP_GETCAPS, &caps);
if (caps & DSP_CAP_REALTIME)
+ {
; // fprintf(stderr, AUDIO " supports REALTIME, good!\n");
+ }
+
if (caps & DSP_CAP_DUPLEX)
- can_duplex = 1; // good soundcard!
+ {
+ mCanDuplex = 1; // good soundcard!
+ }
+
if (!(caps & DSP_CAP_TRIGGER))
- fprintf(stderr, "no CAP_TRIGGER support!\n");
+ {
+ cerr << "no CAP_TRIGGER support!" << endl;
+ }
else
+ {
installed = 1;
+ }
+
close(dev);
}
else
+ {
perror(AUDIO_DEVICE);
+ }
+
dev = -1; // closed
audio_enabled = audio_enabled && installed;
-
}
tAudioPlayer::~tAudioPlayer()
{
- delete listener;
+ delete mpListener;
delete AudioBuffer;
if (dev >= 0)
close(dev);
@@ -153,12 +187,16 @@
void tAudioPlayer::StartAudio()
{
if (!audio_enabled)
+ {
return;
+ }
long ticks_per_minute = Song->TicksPerQuarter * Song->Speed();
samples.ResetBuffers(AudioBuffer, start_clock, ticks_per_minute);
if (PlaybackMode())
+ {
samples.FillBuffers(OutClock);
+ }
audio_bytes = 0;
midi_clock = 0;
@@ -191,9 +229,11 @@
int tmp;
if (!audio_enabled)
+ {
return;
+ }
- can_duplex = gpConfig->GetValue(C_DuplexAudio);
+ mCanDuplex = gpConfig->GetValue(C_DuplexAudio);
// linux driver seems to need some real free memory, which sometimes
// is not available when operating with big samples. So allocate
@@ -207,61 +247,91 @@
}
int mode = 0;
- if (can_duplex)
+ if (mCanDuplex)
+ {
mode = O_RDWR;
+ }
else if (RecordMode())
+ {
mode = O_RDONLY;
+ }
else
+ {
mode = O_WRONLY;
+ }
dev = open(AUDIO_DEVICE, mode, 0);
- if (dev < 0) {
+ if (dev < 0)
+ {
perror(AUDIO_DEVICE);
audio_enabled = 0;
return;
}
- if (can_duplex)
+ if (mCanDuplex)
+ {
ioctl(dev, SNDCTL_DSP_SETDUPLEX, 0);
+ }
tmp = 0xffff0000 | FRAGBITS;
- if (ioctl(dev, SNDCTL_DSP_SETFRAGMENT, &tmp)==-1)
+ if (ioctl(dev, SNDCTL_DSP_SETFRAGMENT, &tmp) == -1)
+ {
perror("ioctl DSP_SETFRAGMENT");
+ }
tmp = samples.BitsPerSample();
ioctl(dev, SNDCTL_DSP_SAMPLESIZE, &tmp);
if (tmp != samples.BitsPerSample())
- fprintf(stderr, "Unable to set the sample size\n");
+ {
+ cerr << "Unable to set the sample size" << endl;
+ }
tmp = (samples.GetChannels() == 1) ? 0 : 1;
- if (ioctl (dev, SNDCTL_DSP_STEREO, &tmp)==-1)
- fprintf (stderr, "Unable to set mono/stereo\n");
+ if (ioctl (dev, SNDCTL_DSP_STEREO, &tmp) == -1)
+ {
+ cerr << "Unable to set mono/stereo" << endl;
+ }
tmp = samples.GetSpeed();
if (ioctl (dev, SNDCTL_DSP_SPEED, &tmp) == -1)
+ {
perror("ioctl DSP_SPEED");
+ }
- // check if fragsize was ok
- ioctl (dev, SNDCTL_DSP_GETBLKSIZE, &tmp);
+ // Check to see if the fragment size was OK.
+ ioctl(dev, SNDCTL_DSP_GETBLKSIZE, &tmp);
if (tmp < 1)
- perror ("GETBLKSIZE");
+ {
+ perror("GETBLKSIZE");
+ }
else if (tmp != FRAGBYTES)
- fprintf(stderr, "Unable to verify FRAGMENT %d, fbytes = %d, fshorts = %d\n", tmp, FRAGBYTES, FRAGSHORTS);
+ {
+ cerr
+ << "Unable to verify FRAGMENT " << tmp
+ << ", fbytes = " << FRAGBYTES
+ << ", fshorts = " << FRAGSHORTS
+ << endl;
+ }
}
-void tAudioPlayer::CloseDsp(int reset)
+void tAudioPlayer::CloseDsp(bool Reset)
{
if (dev >= 0)
{
- if (reset)
+ if (Reset)
{
if (ioctl(dev, SNDCTL_DSP_RESET, 0) == -1)
+ {
perror("SNDCTL_DSP_RESET");
+ }
}
- else {
+ else
+ {
if (ioctl (dev, SNDCTL_DSP_SYNC, NULL) < 0)
+ {
perror("SNDCTL_DSP_SYNC");
+ }
}
close(dev);
dev = -1;
@@ -271,18 +341,26 @@
void tAudioPlayer::Notify()
{
- if (audio_enabled) {
- if (PlaybackMode()) {
+ if (audio_enabled)
+ {
+ if (PlaybackMode())
+ {
WriteSamples();
+
// here it may hang when swapping in pages
samples.FillBuffers(OutClock);
+
WriteSamples();
}
if (RecordMode())
+ {
ReadSamples();
+ }
if (samples.softsync)
+ {
MidiSync();
+ }
}
tSeq2Player::Notify();
}
@@ -291,25 +369,34 @@
int tAudioPlayer::WriteSamples()
{
if (!audio_enabled)
+ {
return 0;
+ }
int blocks_written = 0;
// number of blocks to be written
audio_buf_info info;
if (ioctl(dev, SNDCTL_DSP_GETOSPACE, &info) == -1)
+ {
perror("SNDCTL_DSP_GETOSPACE");
+ }
// todo: this is a bug in the audiodriver in newer kernels (2.1.28)
// and the oss/linux for 2.0.29 it should be
- // for (int i = 0; i < info.fragments; i++) {
+ // for (int i = 0; i < info.fragments; i++)
- for (int i = 0; i < info.fragments - 1; i++) {
+ for (int i = 0; i < info.fragments - 1; i++)
+ {
tAudioBuffer *buf = samples.full_buffers.Get();
if (buf == 0)
+ {
break;
+ }
if (write(dev, buf->Data(), BUFBYTES) != BUFBYTES)
+ {
perror("write");
+ }
blocks_written ++;
samples.free_buffers.Put(buf);
}
@@ -322,21 +409,29 @@
{
audio_buf_info info;
if (ioctl(dev, SNDCTL_DSP_GETISPACE, &info) == -1)
+ {
perror("SNDCTL_DSP_GETISPACE");
+ }
// a oss bug: if read is not called, there will be
// no recording. probably recording does NOT start
// exactly in sync with midi - but who knows.
if (force_read && !info.fragments)
+ {
info.fragments = 1;
+ }
force_read = 0;
- for (int i = 0; i < info.fragments; i++) {
+ for (int i = 0; i < info.fragments; i++)
+ {
short *b = recbuffers.RequestBuffer()->data;
- if (read(dev, b, BUFBYTES) != BUFBYTES) {
+ if (read(dev, b, BUFBYTES) != BUFBYTES)
+ {
// oss bug? It send EINTR?? on first read..
if (errno != EINTR && errno != EAGAIN)
+ {
perror("read");
+ }
recbuffers.UndoRequest();
break;
}
@@ -347,21 +442,27 @@
void tAudioPlayer::MidiSync()
{
- // OSS is buggy! In Win32 SDK you read the docs, hack away and
- // everything works. In OSS, there are no docs and if it works
+ // OSS is buggy! In Win32 SDK you read the docs, hack away and
+ // everything works. In OSS, there are no docs and if it works
// with kernel x it wont with kernel y.
if (!audio_enabled)
+ {
return;
+ }
int command = SNDCTL_DSP_GETOPTR;
if (!PlaybackMode())
+ {
command = SNDCTL_DSP_GETIPTR;
+ }
// get realtime info for audio/midi sync
count_info cinfo;
if (ioctl(dev, command, &cinfo) == -1)
+ {
perror("SNDCTL_DSP_GETOPTR");
+ }
// search for SNDCTL_DSP_GETOPTR in linux/drivers/sound/dmabuf
// before trying to understand the next line
@@ -370,12 +471,16 @@
{
// driver has processed some bytes or whole fragment
if (ioctl(seqfd, SNDCTL_SEQ_GETTIME, &midi_clock) < 0)
- perror("ioctl SNDCTL_SEQ_GETTIME failed - please get a newer kernel (2.1.28 or up)");
+ {
+ perror(
+ "ioctl SNDCTL_SEQ_GETTIME failed - "
+ "please get a newer kernel (2.1.28 or up)");
+ }
audio_bytes = new_bytes;
// OSS bug?: mpu401 does not like speed changes too often
- long audio_clock = (long)samples.Samples2Ticks(audio_bytes/2);
- int delta_clock = audio_clock - midi_clock;
+ long audio_clock = (long)samples.Samples2Ticks(audio_bytes / 2);
+ int delta_clock = audio_clock - midi_clock;
int new_speed = midi_speed + delta_clock;
// limit speed changes to some reasonable values
@@ -392,20 +497,21 @@
if (new_speed != curr_speed)
{
if (ioctl(seqfd, SNDCTL_TMR_TEMPO, &new_speed) < 0)
- // this sometimes happens with mpu-401 timer
+ {
+ // Sometimes this happens with mpu-401 timer.
; // perror("SNDCTL_TMR_TEMPO");
+ }
else
+ {
curr_speed = new_speed;
- // xview has reentrancy problems!!
- // gpTrackWindow->DrawSpeed(curr_speed);
+ }
}
-
}
}
void tAudioPlayer::StartPlay(long Clock, long LoopClock, int Continue)
{
- delete listener;
+ delete mpListener;
samples.StartPlay(Clock);
tSeq2Player::StartPlay(Clock, LoopClock, Continue);
}
@@ -415,21 +521,26 @@
samples.StopPlay();
tSeq2Player::StopPlay();
if (!audio_enabled)
+ {
return;
- CloseDsp(TRUE);
+ }
+
+ CloseDsp(true);
if (RecordMode())
{
long frc = rec_info->mFromClock;
if (frc < start_clock)
+ {
frc = start_clock;
+ }
long toc = rec_info->mToClock;
if (toc > recd_clock)
+ {
toc = recd_clock;
+ }
samples.SaveRecordingDlg(frc, toc, recbuffers);
}
recbuffers.Clear();
- // xview has reentrancy problems!!
- // gpTrackWindow->DrawSpeed(midi_speed);
}
@@ -437,42 +548,58 @@
void tAudioPlayer::ListenAudio(int key, int start_stop_mode)
{
if (!audio_enabled)
+ {
return;
+ }
// when already listening then stop listening
- if (listener)
+ if (mpListener)
{
- delete listener;
- listener = 0;
+ delete mpListener;
+ mpListener = 0;
if (start_stop_mode)
+ {
return;
+ }
}
if (key < 0)
+ {
return;
+ }
if (dev >= 0) // device busy (playing)
+ {
return;
- listener = new tAudioListener(this, key);
+ }
+
+ mpListener = new tAudioListener(this, key);
}
void tAudioPlayer::ListenAudio(tSample &spl, long fr_smpl, long to_smpl)
{
if (!audio_enabled)
+ {
return;
+ }
// when already listening then stop listening
- if (listener)
- delete listener;
+ if (mpListener)
+ {
+ delete mpListener;
+ }
+
if (dev >= 0) // device busy (playing)
+ {
return;
- listener = new tAudioListener(this, spl, fr_smpl, to_smpl);
+ }
+ mpListener = new tAudioListener(this, spl, fr_smpl, to_smpl);
}
-long tAudioPlayer::GetListenerPlayPosition() {
- if (!listener)
+long tAudioPlayer::GetListenerPlayPosition()
+{
+ if (!mpListener)
+ {
return -1L;
- return listener->GetPlayPosition();
+ }
+ return mpListener->GetPlayPosition();
}
-
-
-
Modified: trunk/jazz/src/AudioDriver.h
===================================================================
--- trunk/...
[truncated message content] |
|
From: <pst...@us...> - 2008-04-05 23:49:14
|
Revision: 400
http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=400&view=rev
Author: pstieber
Date: 2008-04-05 16:49:12 -0700 (Sat, 05 Apr 2008)
Log Message:
-----------
Finished making changes that are similar to the ones made for the Windows version.
Modified Paths:
--------------
trunk/jazz/src/AlsaDriver.cpp
trunk/jazz/src/AudioDriver.cpp
Modified: trunk/jazz/src/AlsaDriver.cpp
===================================================================
--- trunk/jazz/src/AlsaDriver.cpp 2008-04-05 23:43:43 UTC (rev 399)
+++ trunk/jazz/src/AlsaDriver.cpp 2008-04-05 23:49:12 UTC (rev 400)
@@ -54,8 +54,8 @@
tAlsaAudioListener(tAlsaAudioPlayer* pPlayer, int key)
: wxTimer(),
mpPlayer(pPlayer),
+ mHardExit(true)
{
- mHardExit = TRUE;
mpPlayer->mpListener = this;
mpPlayer->rec_info = 0; // not recording!
mpPlayer->running_mode = 0;
@@ -74,8 +74,8 @@
long to_smpl)
: wxTimer(),
mpPlayer(pPlayer),
+ mHardExit(true)
{
- mHardExit = TRUE;
mpPlayer->mpListener = this;
mpPlayer->rec_info = 0; // not recording!
mpPlayer->running_mode = 0;
@@ -103,7 +103,7 @@
mCount += mpPlayer->mSamples.ContinueListen();
if (mCount <= 0)
{
- mHardExit = FALSE;
+ mHardExit = false;
delete this;
}
}
@@ -119,7 +119,7 @@
int mCount;
- int mHardExit;
+ bool mHardExit;
};
Modified: trunk/jazz/src/AudioDriver.cpp
===================================================================
--- trunk/jazz/src/AudioDriver.cpp 2008-04-05 23:43:43 UTC (rev 399)
+++ trunk/jazz/src/AudioDriver.cpp 2008-04-05 23:49:12 UTC (rev 400)
@@ -27,13 +27,16 @@
#include "Configuration.h"
#include "Globals.h"
+#include <iostream>
#include <unistd.h>
-#include <stdlib.h>
+//#include <stdlib.h>
#include <sys/ioctl.h>
#include <errno.h>
#include <fcntl.h>
+using namespace std;
+
#define AUDIO_DEVICE "/dev/dsp"
class tAudioListener : public wxTimer
@@ -52,7 +55,7 @@
// SYNC seems not to work?? so add 8 more silent buffers
// to hear the end of the sample too.
- mCount = 8 + mpPlayer->samples.PrepareListen(key);
+ mCount = 8 + mpPlayer->mSamples.PrepareListen(key);
mpPlayer->OpenDsp();
Start(20);
}
@@ -65,13 +68,12 @@
: wxTimer(),
mpPlayer(pPlayer),
mCount(0),
- mHardExit(true),
+ mHardExit(true)
{
- mpPlayer = p;
mpPlayer->mpListener = this;
mpPlayer->rec_info = 0; // not recording!
- mCount = 8 + mpPlayer->samples.PrepareListen(&spl, fr_smpl, to_smpl);
+ mCount = 8 + mpPlayer->mSamples.PrepareListen(&spl, fr_smpl, to_smpl);
mpPlayer->OpenDsp();
Start(20);
}
@@ -86,7 +88,7 @@
virtual void Notify()
{
mCount -= mpPlayer->WriteSamples();
- mCount += mpPlayer->samples.ContinueListen();
+ mCount += mpPlayer->mSamples.ContinueListen();
if (mCount <= 0)
{
mHardExit = false;
@@ -176,7 +178,7 @@
int tAudioPlayer::LoadSamples(const char *filename)
{
- return samples.Load(filename);
+ return mSamples.Load(filename);
}
int tAudioPlayer::RecordMode() const
@@ -192,10 +194,10 @@
}
long ticks_per_minute = Song->TicksPerQuarter * Song->Speed();
- samples.ResetBuffers(AudioBuffer, start_clock, ticks_per_minute);
+ mSamples.ResetBuffers(AudioBuffer, start_clock, ticks_per_minute);
if (PlaybackMode())
{
- samples.FillBuffers(OutClock);
+ mSamples.FillBuffers(OutClock);
}
audio_bytes = 0;
@@ -279,20 +281,20 @@
perror("ioctl DSP_SETFRAGMENT");
}
- tmp = samples.BitsPerSample();
+ tmp = mSamples.BitsPerSample();
ioctl(dev, SNDCTL_DSP_SAMPLESIZE, &tmp);
- if (tmp != samples.BitsPerSample())
+ if (tmp != mSamples.BitsPerSample())
{
cerr << "Unable to set the sample size" << endl;
}
- tmp = (samples.GetChannels() == 1) ? 0 : 1;
+ tmp = (mSamples.GetChannels() == 1) ? 0 : 1;
if (ioctl (dev, SNDCTL_DSP_STEREO, &tmp) == -1)
{
cerr << "Unable to set mono/stereo" << endl;
}
- tmp = samples.GetSpeed();
+ tmp = mSamples.GetSpeed();
if (ioctl (dev, SNDCTL_DSP_SPEED, &tmp) == -1)
{
perror("ioctl DSP_SPEED");
@@ -348,7 +350,7 @@
WriteSamples();
// here it may hang when swapping in pages
- samples.FillBuffers(OutClock);
+ mSamples.FillBuffers(OutClock);
WriteSamples();
}
@@ -357,7 +359,7 @@
ReadSamples();
}
- if (samples.softsync)
+ if (mSamples.softsync)
{
MidiSync();
}
@@ -388,7 +390,7 @@
for (int i = 0; i < info.fragments - 1; i++)
{
- tAudioBuffer *buf = samples.full_buffers.Get();
+ tAudioBuffer *buf = mSamples.full_buffers.Get();
if (buf == 0)
{
break;
@@ -398,7 +400,7 @@
perror("write");
}
blocks_written ++;
- samples.free_buffers.Put(buf);
+ mSamples.free_buffers.Put(buf);
}
return blocks_written;
@@ -479,7 +481,7 @@
audio_bytes = new_bytes;
// OSS bug?: mpu401 does not like speed changes too often
- long audio_clock = (long)samples.Samples2Ticks(audio_bytes / 2);
+ long audio_clock = (long)mSamples.Samples2Ticks(audio_bytes / 2);
int delta_clock = audio_clock - midi_clock;
int new_speed = midi_speed + delta_clock;
@@ -512,13 +514,13 @@
void tAudioPlayer::StartPlay(long Clock, long LoopClock, int Continue)
{
delete mpListener;
- samples.StartPlay(Clock);
+ mSamples.StartPlay(Clock);
tSeq2Player::StartPlay(Clock, LoopClock, Continue);
}
void tAudioPlayer::StopPlay()
{
- samples.StopPlay();
+ mSamples.StopPlay();
tSeq2Player::StopPlay();
if (!audio_enabled)
{
@@ -538,7 +540,7 @@
{
toc = recd_clock;
}
- samples.SaveRecordingDlg(frc, toc, recbuffers);
+ mSamples.SaveRecordingDlg(frc, toc, recbuffers);
}
recbuffers.Clear();
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pst...@us...> - 2008-04-06 01:48:10
|
Revision: 404
http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=404&view=rev
Author: pstieber
Date: 2008-04-05 18:48:08 -0700 (Sat, 05 Apr 2008)
Log Message:
-----------
Got toggling the metronome in the track frame working.
Modified Paths:
--------------
trunk/jazz/src/Metronome.cpp
trunk/jazz/src/Metronome.h
trunk/jazz/src/Player.cpp
trunk/jazz/src/Project.cpp
trunk/jazz/src/Project.h
trunk/jazz/src/Resources.h
trunk/jazz/src/Song.cpp
trunk/jazz/src/Song.h
trunk/jazz/src/TrackFrame.cpp
trunk/jazz/src/TrackFrame.h
Modified: trunk/jazz/src/Metronome.cpp
===================================================================
--- trunk/jazz/src/Metronome.cpp 2008-04-06 01:46:32 UTC (rev 403)
+++ trunk/jazz/src/Metronome.cpp 2008-04-06 01:48:08 UTC (rev 404)
@@ -27,31 +27,45 @@
#include "Globals.h"
#include "Events.h"
-tMetronomeInfo::tMetronomeInfo()
- : KeyAcc(36),
- KeyNorm(37),
- Veloc(127),
- IsOn(0),
- IsAccented(1)
+JZMetronomeInfo::JZMetronomeInfo()
+ : mKeyNormal(37),
+ mKeyAccented(36),
+ mVelocity(127),
+ mIsOn(false),
+ mIsAccented(true)
{
}
-tKeyOn* tMetronomeInfo::Normal(int clock)
+void JZMetronomeInfo::ReadFromConfiguration()
{
+ mIsAccented = (gpConfig->GetValue(C_MetroIsAccented) != 0);
+ mVelocity = gpConfig->GetValue(C_MetroVelocity);
+ mKeyNormal = gpConfig->GetValue(C_MetroNormalClick);
+ mKeyAccented = gpConfig->GetValue(C_MetroAccentedClick);
+}
+
+void JZMetronomeInfo::ToggleIsOn()
+{
+ mIsOn = !mIsOn;
+}
+
+tKeyOn* JZMetronomeInfo::CreateNormalEvent(int Clock) const
+{
return new tKeyOn(
- clock,
+ Clock,
gpConfig->GetValue(C_DrumChannel) - 1,
- KeyNorm,
- Veloc,
+ mKeyNormal,
+ mVelocity,
15);
}
-tKeyOn* tMetronomeInfo::Accented(int clock)
+tKeyOn* JZMetronomeInfo::CreateAccentedEvent(int Clock) const
{
return new tKeyOn(
- clock,
+ Clock,
gpConfig->GetValue(C_DrumChannel) - 1,
- KeyAcc,
- Veloc,
+ mKeyAccented,
+ mVelocity,
15);
}
+
Modified: trunk/jazz/src/Metronome.h
===================================================================
--- trunk/jazz/src/Metronome.h 2008-04-06 01:46:32 UTC (rev 403)
+++ trunk/jazz/src/Metronome.h 2008-04-06 01:48:08 UTC (rev 404)
@@ -25,21 +25,49 @@
class tKeyOn;
-class tMetronomeInfo
+//*****************************************************************************
+//*****************************************************************************
+class JZMetronomeInfo
{
public:
- tMetronomeInfo();
+ JZMetronomeInfo();
- tKeyOn* Normal(int clock);
+ void ReadFromConfiguration();
- tKeyOn* Accented(int clock);
+ bool IsOn() const;
- unsigned char KeyAcc;
- unsigned char KeyNorm;
- unsigned char Veloc;
- int IsOn;
- int IsAccented;
+ bool IsAccented() const;
+
+ void ToggleIsOn();
+
+ tKeyOn* CreateNormalEvent(int Clock) const;
+
+ tKeyOn* CreateAccentedEvent(int Clock) const;
+
+ private:
+
+ unsigned char mKeyNormal;
+
+ unsigned char mKeyAccented;
+
+ unsigned char mVelocity;
+
+ bool mIsOn;
+
+ bool mIsAccented;
};
+inline
+bool JZMetronomeInfo::IsOn() const
+{
+ return mIsOn;
+}
+
+inline
+bool JZMetronomeInfo::IsAccented() const
+{
+ return mIsAccented;
+}
+
#endif // !defined(JZ_METRONOME_H)
Modified: trunk/jazz/src/Player.cpp
===================================================================
--- trunk/jazz/src/Player.cpp 2008-04-06 01:46:32 UTC (rev 403)
+++ trunk/jazz/src/Player.cpp 2008-04-06 01:48:08 UTC (rev 404)
@@ -166,7 +166,7 @@
From,
mStopClock,
buf,
- &gpProject->mMetronomeInfo,
+ gpProject->GetMetronomeInfo(),
Delta,
Mode);
@@ -181,7 +181,7 @@
From,
From + Size,
buf,
- &gpProject->mMetronomeInfo,
+ gpProject->GetMetronomeInfo(),
Delta,
Mode);
}
Modified: trunk/jazz/src/Project.cpp
===================================================================
--- trunk/jazz/src/Project.cpp 2008-04-06 01:46:32 UTC (rev 403)
+++ trunk/jazz/src/Project.cpp 2008-04-06 01:48:08 UTC (rev 404)
@@ -141,10 +141,7 @@
mNumBars = 0;
- mMetronomeInfo.IsAccented = mpConfig->GetValue(C_MetroIsAccented);
- mMetronomeInfo.Veloc = mpConfig->GetValue(C_MetroVelocity);
- mMetronomeInfo.KeyNorm = mpConfig->GetValue(C_MetroNormalClick);
- mMetronomeInfo.KeyAcc = mpConfig->GetValue(C_MetroAccentedClick);
+ mMetronomeInfo.ReadFromConfiguration();
if (mpConfig->StrValue(C_SynthType))
{
@@ -581,14 +578,34 @@
}
//-----------------------------------------------------------------------------
+// Description:
+// Returns a constant reference to the metronome.
//-----------------------------------------------------------------------------
-tMetronomeInfo JZProject::GetMetronome()
+const JZMetronomeInfo& JZProject::GetMetronomeInfo()
{
return mMetronomeInfo;
}
//-----------------------------------------------------------------------------
// Description:
+// Toggles the "is on" state of the metronome.
+//-----------------------------------------------------------------------------
+void JZProject::ToggleMetronome()
+{
+ mMetronomeInfo.ToggleIsOn();
+}
+
+//-----------------------------------------------------------------------------
+// Description:
+// Returns the "is on" state of the metronome.
+//-----------------------------------------------------------------------------
+bool JZProject::IsMetronomeOn() const
+{
+ return mMetronomeInfo.IsOn();
+}
+
+//-----------------------------------------------------------------------------
+// Description:
// Returns a constant pointer to the internal RecInfo member.
//-----------------------------------------------------------------------------
JZRecordingInfo* JZProject::GetRecInfo()
Modified: trunk/jazz/src/Project.h
===================================================================
--- trunk/jazz/src/Project.h 2008-04-06 01:46:32 UTC (rev 403)
+++ trunk/jazz/src/Project.h 2008-04-06 01:48:08 UTC (rev 404)
@@ -67,12 +67,18 @@
// Not yet sure what this does
JZFilter* Filter;
- // Stores metrome information
- tMetronomeInfo mMetronomeInfo;
+ // Description:
+ // Returns a constant reference to the metronome.
+ const JZMetronomeInfo& GetMetronomeInfo();
- // Returns the internal pointer to the metronome
- tMetronomeInfo GetMetronome();
+ // Description:
+ // Toggles the "is on" state of the metronome.
+ void ToggleMetronome();
+ // Description:
+ // Returns the "is on" state of the metronome.
+ bool IsMetronomeOn() const;
+
// Number of bars
int mNumBars;
@@ -169,6 +175,9 @@
JZRecordingInfo* mpRecInfo;
+ // Stores metronome information.
+ JZMetronomeInfo mMetronomeInfo;
+
bool mChanged;
bool mIsPlaying;
Modified: trunk/jazz/src/Resources.h
===================================================================
--- trunk/jazz/src/Resources.h 2008-04-06 01:46:32 UTC (rev 403)
+++ trunk/jazz/src/Resources.h 2008-04-06 01:48:08 UTC (rev 404)
@@ -45,7 +45,7 @@
#define ID_SNAP_16D wxID_HIGHEST + 11
#define ID_MIXER wxID_HIGHEST + 12
#define ID_PIANOWIN wxID_HIGHEST + 13
-#define ID_METRONOME_ON wxID_HIGHEST + 14
+#define ID_METRONOME_TOGGLE wxID_HIGHEST + 14
#define ID_PLAY wxID_HIGHEST + 15
#define ID_PLAY_LOOP wxID_HIGHEST + 16
Modified: trunk/jazz/src/Song.cpp
===================================================================
--- trunk/jazz/src/Song.cpp 2008-04-06 01:46:32 UTC (rev 403)
+++ trunk/jazz/src/Song.cpp 2008-04-06 01:48:08 UTC (rev 404)
@@ -181,15 +181,17 @@
int FrClock,
int ToClock,
tEventArray *Destin,
- tMetronomeInfo *MetronomeInfo,
+ const JZMetronomeInfo& MetronomeInfo,
int delta,
int mode)
{
int i;
// Make metronome
- if (MetronomeInfo->IsOn)
- MakeMetronome( FrClock, ToClock, Destin, MetronomeInfo, delta );
+ if (MetronomeInfo.IsOn())
+ {
+ MakeMetronome(FrClock, ToClock, Destin, MetronomeInfo, delta);
+ }
// Find Solo-Tracks
int solo = 0;
@@ -305,7 +307,7 @@
int FrClock,
int ToClock,
tEventArray *Destin,
- tMetronomeInfo *MetronomeInfo,
+ const JZMetronomeInfo& MetronomeInfo,
int delta)
{
JZBarInfo BarInfo( this );
@@ -329,13 +331,13 @@
}
// Insert normal click always
- Destin->Put( MetronomeInfo->Normal(clk + delta) );
+ Destin->Put(MetronomeInfo.CreateNormalEvent(clk + delta));
// On a bar?
- if ( (count == 1) && (MetronomeInfo->IsAccented) )
+ if (count == 1 && MetronomeInfo.IsAccented())
{
// Insert accented click also
- Destin->Put( MetronomeInfo->Accented(clk + delta) );
+ Destin->Put(MetronomeInfo.CreateAccentedEvent(clk + delta));
}
clk += BarInfo.TicksPerBar / BarInfo.CountsPerBar;
Modified: trunk/jazz/src/Song.h
===================================================================
--- trunk/jazz/src/Song.h 2008-04-06 01:46:32 UTC (rev 403)
+++ trunk/jazz/src/Song.h 2008-04-06 01:48:08 UTC (rev 404)
@@ -27,7 +27,7 @@
#include "Configuration.h"
#include "Globals.h"
-class tMetronomeInfo;
+class JZMetronomeInfo;
class JZSong;
class JZBarInfo
@@ -64,7 +64,7 @@
int FrClock,
int ToClock,
tEventArray *Destin,
- tMetronomeInfo* MetronomeInfo,
+ const JZMetronomeInfo& MetronomeInfo,
int delta = 0);
public:
@@ -103,7 +103,7 @@
int FrClock,
int ToClock,
tEventArray *Destin,
- tMetronomeInfo* MetronomeInfo,
+ const JZMetronomeInfo& MetronomeInfo,
int DeltaClock = 0,
int mode = 0);
Modified: trunk/jazz/src/TrackFrame.cpp
===================================================================
--- trunk/jazz/src/TrackFrame.cpp 2008-04-06 01:46:32 UTC (rev 403)
+++ trunk/jazz/src/TrackFrame.cpp 2008-04-06 01:48:08 UTC (rev 404)
@@ -82,7 +82,7 @@
EVT_MENU(ID_PIANOWIN, JZTrackFrame::OnPianoWindow)
- EVT_MENU(ID_METRONOME_ON, JZTrackFrame::OnMetroOn)
+ EVT_MENU(ID_METRONOME_TOGGLE, JZTrackFrame::OnMetroOn)
EVT_MENU(wxID_ZOOM_IN, JZTrackFrame::OnZoomIn)
@@ -134,11 +134,6 @@
// "Piano",
// wxDefaultPosition,
// wxSize(640, 480));
-
- MetronomeInfo.IsAccented = gpConfig->GetValue(C_MetroIsAccented);
- MetronomeInfo.Veloc = gpConfig->GetValue(C_MetroVelocity);
- MetronomeInfo.KeyNorm = gpConfig->GetValue(C_MetroNormalClick);
- MetronomeInfo.KeyAcc = gpConfig->GetValue(C_MetroAccentedClick);
}
//-----------------------------------------------------------------------------
@@ -164,10 +159,10 @@
{ ID_MIXER, false, mixer_xpm, "mixer" },
{ ID_PIANOWIN, false, pianowin_xpm, "show piano window" },
{ JZToolBar::eToolBarSeparator },
- { ID_PLAY, false, play_xpm, "start play"},
- { ID_PLAY_LOOP, false, playloop_xpm, "loop play"},
- { ID_RECORD, false, record_xpm, "record"},
- { ID_METRONOME, true, metro_xpm, "metronome" },
+ { ID_PLAY, false, play_xpm, "start play"},
+ { ID_PLAY_LOOP, false, playloop_xpm, "loop play"},
+ { ID_RECORD, false, record_xpm, "record"},
+ { ID_METRONOME_TOGGLE, true, metro_xpm, "metronome" },
{ JZToolBar::eToolBarSeparator },
{ wxID_ZOOM_IN, false, zoomin_xpm, "zoom in" },
{ wxID_ZOOM_OUT, false, zoomout_xpm, "zoom out"},
@@ -517,7 +512,7 @@
//-----------------------------------------------------------------------------
void JZTrackFrame::OnMetroOn(wxCommandEvent& Event)
{
- MetronomeInfo.IsOn = !MetronomeInfo.IsOn;
+ gpProject->ToggleMetronome();
}
//-----------------------------------------------------------------------------
Modified: trunk/jazz/src/TrackFrame.h
===================================================================
--- trunk/jazz/src/TrackFrame.h 2008-04-06 01:46:32 UTC (rev 403)
+++ trunk/jazz/src/TrackFrame.h 2008-04-06 01:48:08 UTC (rev 404)
@@ -54,8 +54,6 @@
// Overridden tButtonLabelInterface finction.
virtual void ButtonLabelDisplay(const wxString& Text, bool IsButtonDown);
- tMetronomeInfo MetronomeInfo;
-
private:
void OnMetroOn(wxCommandEvent& Event);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pst...@us...> - 2008-04-06 02:17:56
|
Revision: 408
http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=408&view=rev
Author: pstieber
Date: 2008-04-05 19:17:53 -0700 (Sat, 05 Apr 2008)
Log Message:
-----------
Updated the copyright line and removed the knob.
Modified Paths:
--------------
trunk/jazz/src/SynthesizerSettingsDialog.cpp
trunk/jazz/src/SynthesizerSettingsDialog.h
Modified: trunk/jazz/src/SynthesizerSettingsDialog.cpp
===================================================================
--- trunk/jazz/src/SynthesizerSettingsDialog.cpp 2008-04-06 02:17:20 UTC (rev 407)
+++ trunk/jazz/src/SynthesizerSettingsDialog.cpp 2008-04-06 02:17:53 UTC (rev 408)
@@ -1,7 +1,7 @@
//*****************************************************************************
// The JAZZ++ Midi Sequencer
//
-// Copyright (C) 2008 Peter J. Stieber
+// Copyright (C) 2008 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
@@ -23,7 +23,6 @@
#include "SynthesizerSettingsDialog.h"
#include "Configuration.h"
#include "Globals.h"
-#include "Knob.h"
using namespace std;
@@ -36,8 +35,6 @@
mpSynthesizerListbox(0),
mpStartListbox(0)
{
- JZKnob* pKnob = new JZKnob(this, wxID_ANY, 100, 0, 128);
-
mpSynthesizerListbox = new wxListBox(this, wxID_ANY);
int Selection = 0;
@@ -75,8 +72,6 @@
wxBoxSizer* pLeftSizer = new wxBoxSizer(wxVERTICAL);
wxBoxSizer* pRightSizer = new wxBoxSizer(wxVERTICAL);
- pLeftSizer->Add(pKnob, 0, wxALL, 2);
-
pLeftSizer->Add(
new wxStaticText(this, wxID_ANY, "Synthesizer Type"),
0,
Modified: trunk/jazz/src/SynthesizerSettingsDialog.h
===================================================================
--- trunk/jazz/src/SynthesizerSettingsDialog.h 2008-04-06 02:17:20 UTC (rev 407)
+++ trunk/jazz/src/SynthesizerSettingsDialog.h 2008-04-06 02:17:53 UTC (rev 408)
@@ -1,7 +1,7 @@
//*****************************************************************************
// The JAZZ++ Midi Sequencer
//
-// Modifications Copyright (C) 2008 Peter J. Stieber
+// Copyright (C) 2008 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
@@ -36,4 +36,4 @@
wxListBox* mpStartListbox;
};
-#endif // !defined()
+#endif // !defined(JZ_SYNTHESIZERSETTINGDIALOG_H)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pst...@us...> - 2008-04-06 02:18:52
|
Revision: 409
http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=409&view=rev
Author: pstieber
Date: 2008-04-05 19:18:50 -0700 (Sat, 05 Apr 2008)
Log Message:
-----------
Getting ready for the metronome settings dialog.
WARNING: This will break the build for a short period of time.
Modified Paths:
--------------
trunk/jazz/src/TrackFrame.cpp
trunk/jazz/src/TrackFrame.h
Modified: trunk/jazz/src/TrackFrame.cpp
===================================================================
--- trunk/jazz/src/TrackFrame.cpp 2008-04-06 02:17:53 UTC (rev 408)
+++ trunk/jazz/src/TrackFrame.cpp 2008-04-06 02:18:50 UTC (rev 409)
@@ -35,6 +35,7 @@
#include "Globals.h"
#include "Configuration.h"
#include "Harmony.h"
+#include "Dialogs/MetronomeSettingsDialog.h"
#include "SynthesizerSettingsDialog.h"
#include "AboutDialog.h"
@@ -90,6 +91,8 @@
EVT_MENU(ID_TOOLS_HARMONY_BROWSER, JZTrackFrame::OnToolsHarmonyBrowser)
+ EVT_MENU(ID_SETTINGS_METRONOME, JZTrackFrame::OnSettingsMetronome)
+
EVT_MENU(ID_SETTINGS_SYNTH, JZTrackFrame::OnSettingsSynthesizerType)
EVT_MENU(wxID_HELP_CONTENTS, JZTrackFrame::OnHelpContents)
@@ -324,7 +327,9 @@
pSettingMenu->Append(MEN_FILTER, "&Filter...");
pSettingMenu->Append(MEN_TWSETTING, "&Window...");
pSettingMenu->Append(MEN_SONG, "&Song...");
- pSettingMenu->Append(MEN_METRONOME, "&Metronome...");
+#endif
+ pSettingMenu->Append(ID_SETTINGS_METRONOME, "&Metronome...");
+#if 0
pSettingMenu->Append(MEN_EFFECTS, "&Effects...");
pSettingMenu->Append(MEN_TIMING, "&Timing...");
pSettingMenu->Append(MEN_MIDI_THRU, "&Midi Thru...");
@@ -538,6 +543,20 @@
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
+void JZTrackFrame::OnSettingsMetronome(wxCommandEvent& Event)
+{
+ JZMetronomeInfo MetronomeInfo = gpProject->GetMetronomeInfo();
+ JZMetronomeSettingsDialog MetronomeSettingsDialog(
+ this,
+ MetronomeInfo);
+ if (
+ MetronomeSettingsDialog.ShowModal() == wxID_OK)
+ {
+ }
+}
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
void JZTrackFrame::OnSettingsSynthesizerType(wxCommandEvent& Event)
{
JZSynthesizerDialog SynthesizerDialog(this);
Modified: trunk/jazz/src/TrackFrame.h
===================================================================
--- trunk/jazz/src/TrackFrame.h 2008-04-06 02:17:53 UTC (rev 408)
+++ trunk/jazz/src/TrackFrame.h 2008-04-06 02:18:50 UTC (rev 409)
@@ -84,6 +84,8 @@
void OnToolsHarmonyBrowser(wxCommandEvent& Event);
+ void OnSettingsMetronome(wxCommandEvent& Event);
+
void OnSettingsSynthesizerType(wxCommandEvent& Event);
void OnHelpContents(wxCommandEvent& Event);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pst...@us...> - 2008-04-06 02:22:38
|
Revision: 411
http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=411&view=rev
Author: pstieber
Date: 2008-04-05 19:22:31 -0700 (Sat, 05 Apr 2008)
Log Message:
-----------
Renamed DialogsTemporary to Dialogs to finally get the case change I want.
Added Paths:
-----------
trunk/jazz/src/Dialogs/
Removed Paths:
-------------
trunk/jazz/src/DialogsTemporary/
Copied: trunk/jazz/src/Dialogs (from rev 410, trunk/jazz/src/DialogsTemporary)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pst...@us...> - 2008-04-06 05:09:40
|
Revision: 416
http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=416&view=rev
Author: pstieber
Date: 2008-04-05 22:09:36 -0700 (Sat, 05 Apr 2008)
Log Message:
-----------
Added events for the knob control.
Modified Paths:
--------------
trunk/jazz/src/Knob.cpp
trunk/jazz/src/Knob.h
Modified: trunk/jazz/src/Knob.cpp
===================================================================
--- trunk/jazz/src/Knob.cpp 2008-04-06 02:37:34 UTC (rev 415)
+++ trunk/jazz/src/Knob.cpp 2008-04-06 05:09:36 UTC (rev 416)
@@ -29,6 +29,47 @@
//*****************************************************************************
// Description:
+// This is the knob control event class definition.
+//*****************************************************************************
+//-----------------------------------------------------------------------------
+// Define the knob control event types.
+// I think the following insures the event IDs are unique.
+//-----------------------------------------------------------------------------
+DEFINE_EVENT_TYPE(wxEVT_KNOB_CHANGED)
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+IMPLEMENT_DYNAMIC_CLASS(JZKnobEvent, wxCommandEvent)
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+JZKnobEvent::JZKnobEvent()
+ : wxCommandEvent(),
+ mValue(0)
+{
+}
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+JZKnobEvent::JZKnobEvent(
+ JZKnob* pKnobCtrl,
+ wxEventType Type)
+ : wxCommandEvent(Type, pKnobCtrl->GetId()),
+ mValue(0)
+{
+ mValue = pKnobCtrl->GetValue();
+}
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+JZKnobEvent::JZKnobEvent(JZKnob* pKnobCtrl, int Value, wxEventType Type)
+ : wxCommandEvent(Type, pKnobCtrl->GetId()),
+ mValue(Value)
+{
+}
+
+//*****************************************************************************
+// Description:
// This is the knob class definition.
//*****************************************************************************
//-----------------------------------------------------------------------------
@@ -109,8 +150,8 @@
SetInitialSize(Size);
- mMin = MinValue;
- mMax = MaxValue;
+ mMinValue = MinValue;
+ mMaxValue = MaxValue;
Range %= 360;
MinAngle %= 360;
mMaxAngle = (MinAngle + 360 - Range) % 360;
@@ -125,9 +166,9 @@
{
if (MinValue < MaxValue)
{
- mMin = MinValue;
- mMax = MaxValue;
- SetValue(mSetting);
+ mMinValue = MinValue;
+ mMaxValue = MaxValue;
+ SetValueWithEvent(mSetting);
}
}
@@ -135,13 +176,13 @@
//-----------------------------------------------------------------------------
int JZKnob::SetValue(int Value)
{
- if (Value < mMin)
+ if (Value < mMinValue)
{
- Value = mMin;
+ Value = mMinValue;
}
- if (Value > mMax)
+ if (Value > mMaxValue)
{
- Value = mMax;
+ Value = mMaxValue;
}
if (Value != mSetting)
@@ -155,6 +196,19 @@
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
+int JZKnob::SetValueWithEvent(int Value)
+{
+ int ActualValue = SetValue(Value);
+
+ JZKnobEvent Event(this, ActualValue, wxEVT_KNOB_CHANGED);
+ Event.SetEventObject(this);
+ GetEventHandler()->ProcessEvent(Event);
+
+ return ActualValue;
+}
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
void JZKnob::OnSize(wxSizeEvent& Event)
{
int Width, Height;
@@ -181,7 +235,8 @@
wxSize Size = GetSize();
double Theta = gDegreesToRadians *
- (mMaxAngle + (((double)mMax - mSetting) / (mMax - mMin)) * mRange);
+ (mMaxAngle +
+ (((double)mMaxValue - mSetting) / (mMaxValue - mMinValue)) * mRange);
double DeltaX = cos(Theta);
@@ -241,14 +296,14 @@
if (Event.GetWheelRotation() < 0)
{
- SetValue(GetValue() - 1);
+ SetValueWithEvent(GetValue() - 1);
Event.Skip();
return;
}
if (Event.GetWheelRotation() > 0)
{
- SetValue(GetValue() + 1);
+ SetValueWithEvent(GetValue() + 1);
Event.Skip();
return;
}
@@ -278,9 +333,10 @@
{
return;
}
- int NewValue = int(mMax - (DeltaTheta / mRange) * (mMax - mMin));
+ int NewValue = int(
+ mMaxValue - (DeltaTheta / mRange) * (mMaxValue - mMinValue));
- SetValue(NewValue);
+ SetValueWithEvent(NewValue);
if (Event.Dragging() || Event.ButtonUp())
{
if (Event.ButtonUp())
Modified: trunk/jazz/src/Knob.h
===================================================================
--- trunk/jazz/src/Knob.h 2008-04-06 02:37:34 UTC (rev 415)
+++ trunk/jazz/src/Knob.h 2008-04-06 05:09:36 UTC (rev 416)
@@ -21,8 +21,62 @@
#ifndef JZ_KNOB_H
#define JZ_KNOB_H
+class JZKnobEvent;
+class JZKnob;
+
//*****************************************************************************
// Description:
+// Declare knob control event types and macros for handling them.
+//*****************************************************************************
+//-----------------------------------------------------------------------------
+// Description:
+// The second argument to DECLARE_EVENT_TYPE is unused. wxWidgets assigns a
+// unique evant ID at run time.
+//-----------------------------------------------------------------------------
+BEGIN_DECLARE_EVENT_TYPES()
+ DECLARE_EVENT_TYPE(wxEVT_KNOB_CHANGED, 1)
+END_DECLARE_EVENT_TYPES()
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+typedef void (wxEvtHandler::*wxKnobEventFunction)(JZKnobEvent&);
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+#define EVT_KNOB_CHANGED(Id, Function) \
+ DECLARE_EVENT_TABLE_ENTRY( \
+ wxEVT_KNOB_CHANGED, \
+ Id, \
+ -1, \
+ (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) \
+ (wxKnobEventFunction)& Function, \
+ (wxObject *) NULL),
+
+//*****************************************************************************
+// Description:
+// This is the knob control event class declaration.
+//*****************************************************************************
+class JZKnobEvent : public wxCommandEvent
+{
+ public:
+
+ JZKnobEvent();
+
+ JZKnobEvent(JZKnob* pKnobCtrl, wxEventType Type);
+
+ JZKnobEvent(JZKnob* pKnobCtrl, int Value, wxEventType Type);
+
+ int GetValue() const;
+
+ private:
+
+ int mValue;
+
+ DECLARE_DYNAMIC_CLASS(JZKnobEvent)
+};
+
+//*****************************************************************************
+// Description:
// This is the knob class declaration. This is a custom control that looks
// like a mixer knob.
//*****************************************************************************
@@ -79,6 +133,8 @@
int SetValue(int Value);
+ int SetValueWithEvent(int Value);
+
private:
void GetCenter(int& x, int& y) const;
@@ -93,9 +149,9 @@
private:
- int mMin;
+ int mMinValue;
- int mMax;
+ int mMaxValue;
int mSetting;
@@ -110,6 +166,18 @@
//*****************************************************************************
// Description:
+// These are the knob control event inline member functions.
+//*****************************************************************************
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+inline
+int JZKnobEvent::GetValue() const
+{
+ return mValue;
+}
+
+//*****************************************************************************
+// Description:
// These are the knob inline member functions.
//*****************************************************************************
//-----------------------------------------------------------------------------
@@ -117,7 +185,7 @@
inline
int JZKnob::GetMin() const
{
- return mMin;
+ return mMinValue;
}
//-----------------------------------------------------------------------------
@@ -125,7 +193,7 @@
inline
int JZKnob::GetMax() const
{
- return mMax;
+ return mMaxValue;
}
//-----------------------------------------------------------------------------
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pst...@us...> - 2008-04-06 05:44:52
|
Revision: 419
http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=419&view=rev
Author: pstieber
Date: 2008-04-05 22:44:50 -0700 (Sat, 05 Apr 2008)
Log Message:
-----------
Started recording data from the metronome dialog.
Modified Paths:
--------------
trunk/jazz/src/Dialogs/MetronomeSettingsDialog.cpp
trunk/jazz/src/Dialogs/MetronomeSettingsDialog.h
trunk/jazz/src/Metronome.cpp
trunk/jazz/src/Metronome.h
trunk/jazz/src/Project.cpp
trunk/jazz/src/Project.h
trunk/jazz/src/TrackFrame.cpp
Modified: trunk/jazz/src/Dialogs/MetronomeSettingsDialog.cpp
===================================================================
--- trunk/jazz/src/Dialogs/MetronomeSettingsDialog.cpp 2008-04-06 05:11:03 UTC (rev 418)
+++ trunk/jazz/src/Dialogs/MetronomeSettingsDialog.cpp 2008-04-06 05:44:50 UTC (rev 419)
@@ -145,10 +145,29 @@
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
+bool JZMetronomeSettingsDialog::TransferDataToWindow()
+{
+ mpVelocityKnob->SetValueWithEvent(mMetronomeInfo.GetVelocity());
+ mpAccentedCheckBox->SetValue(mMetronomeInfo.IsAccented());
+ return true;
+}
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+bool JZMetronomeSettingsDialog::TransferDataFromWindow()
+{
+ mMetronomeInfo.SetVelocity(static_cast<unsigned char>(
+ mpVelocityKnob->GetValue()));
+ mMetronomeInfo.SetIsAccented(mpAccentedCheckBox->GetValue());
+ return true;
+}
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
void JZMetronomeSettingsDialog::OnVolumeChange(JZKnobEvent& Event)
{
int Value = Event.GetValue();
ostringstream Oss;
Oss << Value;
mpVelocityValue->SetLabel(Oss.str().c_str());
-}
\ No newline at end of file
+}
Modified: trunk/jazz/src/Dialogs/MetronomeSettingsDialog.h
===================================================================
--- trunk/jazz/src/Dialogs/MetronomeSettingsDialog.h 2008-04-06 05:11:03 UTC (rev 418)
+++ trunk/jazz/src/Dialogs/MetronomeSettingsDialog.h 2008-04-06 05:44:50 UTC (rev 419)
@@ -37,6 +37,10 @@
private:
+ virtual bool TransferDataToWindow();
+
+ virtual bool TransferDataFromWindow();
+
void OnVolumeChange(JZKnobEvent& Event);
private:
Modified: trunk/jazz/src/Metronome.cpp
===================================================================
--- trunk/jazz/src/Metronome.cpp 2008-04-06 05:11:03 UTC (rev 418)
+++ trunk/jazz/src/Metronome.cpp 2008-04-06 05:44:50 UTC (rev 419)
@@ -27,6 +27,8 @@
#include "Globals.h"
#include "Events.h"
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
JZMetronomeInfo::JZMetronomeInfo()
: mKeyNormal(37),
mKeyAccented(36),
@@ -36,6 +38,42 @@
{
}
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+JZMetronomeInfo& JZMetronomeInfo::operator = (const JZMetronomeInfo& Rhs)
+{
+ if (this != &Rhs)
+ {
+ mKeyNormal = Rhs.mKeyNormal;
+ mKeyAccented = Rhs.mKeyAccented;
+ mVelocity = Rhs.mVelocity;
+ mIsOn = Rhs.mIsOn;
+ mIsAccented = Rhs.mIsAccented;
+ }
+ return *this;
+}
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+bool JZMetronomeInfo::operator == (const JZMetronomeInfo& Rhs) const
+{
+ return
+ mKeyNormal == Rhs.mKeyNormal &&
+ mKeyAccented == Rhs.mKeyAccented &&
+ mVelocity == Rhs.mVelocity &&
+ mIsOn == Rhs.mIsOn &&
+ mIsAccented == Rhs.mIsAccented;
+}
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+bool JZMetronomeInfo::operator != (const JZMetronomeInfo& Rhs) const
+{
+ return !operator == (Rhs);
+}
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
void JZMetronomeInfo::ReadFromConfiguration()
{
mIsAccented = (gpConfig->GetValue(C_MetroIsAccented) != 0);
@@ -44,11 +82,15 @@
mKeyAccented = gpConfig->GetValue(C_MetroAccentedClick);
}
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
void JZMetronomeInfo::ToggleIsOn()
{
mIsOn = !mIsOn;
}
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
tKeyOn* JZMetronomeInfo::CreateNormalEvent(int Clock) const
{
return new tKeyOn(
@@ -59,6 +101,8 @@
15);
}
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
tKeyOn* JZMetronomeInfo::CreateAccentedEvent(int Clock) const
{
return new tKeyOn(
@@ -69,3 +113,16 @@
15);
}
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+void JZMetronomeInfo::SetVelocity(unsigned char Velocity)
+{
+ mVelocity = Velocity;
+}
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+void JZMetronomeInfo::SetIsAccented(bool IsAccented)
+{
+ mIsAccented = IsAccented;
+}
Modified: trunk/jazz/src/Metronome.h
===================================================================
--- trunk/jazz/src/Metronome.h 2008-04-06 05:11:03 UTC (rev 418)
+++ trunk/jazz/src/Metronome.h 2008-04-06 05:44:50 UTC (rev 419)
@@ -33,12 +33,24 @@
JZMetronomeInfo();
+ JZMetronomeInfo& operator = (const JZMetronomeInfo& Rhs);
+
+ bool operator == (const JZMetronomeInfo& Rhs) const;
+
+ bool operator != (const JZMetronomeInfo& Rhs) const;
+
void ReadFromConfiguration();
+ unsigned char GetVelocity() const;
+
+ void SetVelocity(unsigned char Velocity);
+
bool IsOn() const;
bool IsAccented() const;
+ void SetIsAccented(bool IsAccented);
+
void ToggleIsOn();
tKeyOn* CreateNormalEvent(int Clock) const;
@@ -59,6 +71,12 @@
};
inline
+unsigned char JZMetronomeInfo::GetVelocity() const
+{
+ return mVelocity;
+}
+
+inline
bool JZMetronomeInfo::IsOn() const
{
return mIsOn;
Modified: trunk/jazz/src/Project.cpp
===================================================================
--- trunk/jazz/src/Project.cpp 2008-04-06 05:11:03 UTC (rev 418)
+++ trunk/jazz/src/Project.cpp 2008-04-06 05:44:50 UTC (rev 419)
@@ -581,13 +581,22 @@
// Description:
// Returns a constant reference to the metronome.
//-----------------------------------------------------------------------------
-const JZMetronomeInfo& JZProject::GetMetronomeInfo()
+const JZMetronomeInfo& JZProject::GetMetronomeInfo() const
{
return mMetronomeInfo;
}
//-----------------------------------------------------------------------------
// Description:
+// Sets the metronome data.
+//-----------------------------------------------------------------------------
+void JZProject::SetMetronomeInfo(const JZMetronomeInfo& MetronomeInfo)
+{
+ mMetronomeInfo = MetronomeInfo;
+}
+
+//-----------------------------------------------------------------------------
+// Description:
// Toggles the "is on" state of the metronome.
//-----------------------------------------------------------------------------
void JZProject::ToggleMetronome()
Modified: trunk/jazz/src/Project.h
===================================================================
--- trunk/jazz/src/Project.h 2008-04-06 05:11:03 UTC (rev 418)
+++ trunk/jazz/src/Project.h 2008-04-06 05:44:50 UTC (rev 419)
@@ -69,9 +69,13 @@
// Description:
// Returns a constant reference to the metronome.
- const JZMetronomeInfo& GetMetronomeInfo();
+ const JZMetronomeInfo& GetMetronomeInfo() const;
// Description:
+ // Sets the metronome data.
+ void SetMetronomeInfo(const JZMetronomeInfo& MetronomeInfo);
+
+ // Description:
// Toggles the "is on" state of the metronome.
void ToggleMetronome();
Modified: trunk/jazz/src/TrackFrame.cpp
===================================================================
--- trunk/jazz/src/TrackFrame.cpp 2008-04-06 05:11:03 UTC (rev 418)
+++ trunk/jazz/src/TrackFrame.cpp 2008-04-06 05:44:50 UTC (rev 419)
@@ -550,8 +550,10 @@
this,
MetronomeInfo);
if (
- MetronomeSettingsDialog.ShowModal() == wxID_OK)
+ MetronomeSettingsDialog.ShowModal() == wxID_OK &&
+ MetronomeInfo != gpProject->GetMetronomeInfo())
{
+ gpProject->SetMetronomeInfo(MetronomeInfo);
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pst...@us...> - 2008-04-06 18:26:28
|
Revision: 420
http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=420&view=rev
Author: pstieber
Date: 2008-04-06 11:26:26 -0700 (Sun, 06 Apr 2008)
Log Message:
-----------
1. Changed tHelp to JZHelp.
2. Removed the global help instance from Help.cpp/.h and placed it in the global modules.
2. Changed the metronome class and dialog so that it records changes.
Modified Paths:
--------------
trunk/jazz/src/Dialogs/MetronomeSettingsDialog.cpp
trunk/jazz/src/Dialogs/MetronomeSettingsDialog.h
trunk/jazz/src/Globals.cpp
trunk/jazz/src/Globals.h
trunk/jazz/src/GuitarFrame.cpp
trunk/jazz/src/Help.cpp
trunk/jazz/src/Help.h
trunk/jazz/src/Metronome.cpp
trunk/jazz/src/Metronome.h
Modified: trunk/jazz/src/Dialogs/MetronomeSettingsDialog.cpp
===================================================================
--- trunk/jazz/src/Dialogs/MetronomeSettingsDialog.cpp 2008-04-06 05:44:50 UTC (rev 419)
+++ trunk/jazz/src/Dialogs/MetronomeSettingsDialog.cpp 2008-04-06 18:26:26 UTC (rev 420)
@@ -28,7 +28,7 @@
#include "../Knob.h"
#include "../Resources.h"
-#include <vector>
+#include <iostream>
#include <sstream>
using namespace std;
@@ -41,6 +41,8 @@
EVT_KNOB_CHANGED(IDC_KB_VOLUME, JZMetronomeSettingsDialog::OnVolumeChange)
+ EVT_BUTTON(wxID_HELP, JZMetronomeSettingsDialog::OnHelp)
+
END_EVENT_TABLE()
//-----------------------------------------------------------------------------
@@ -50,12 +52,42 @@
JZMetronomeInfo& MetronomeInfo)
: wxDialog(pParent, wxID_ANY, wxString("Metronome Settings")),
mMetronomeInfo(MetronomeInfo),
+ mIndexToName(),
+ mIndexToPitch(),
+ mPitchToIndex(),
+ mKeyNormalName(),
+ mKeyAccentedName(),
mpVelocityKnob(0),
mpVelocityValue(0),
mpAccentedCheckBox(0),
mpNormalListbox(0),
mpAccentedListbox(0)
{
+ int Index = 0;
+ const vector<pair<string, int> >& DrumNames = gpConfig->GetDrumNames();
+ for (
+ vector<pair<string, int> >::const_iterator iDrumName = DrumNames.begin();
+ iDrumName != DrumNames.end();
+ ++iDrumName)
+ {
+ const string& DrumName = iDrumName->first;
+ const int& Value = iDrumName->second;
+
+ if (!DrumName.empty())
+ {
+ mIndexToName.push_back(DrumName);
+ mIndexToPitch.push_back(Value - 1);
+ mPitchToIndex.insert(make_pair(Value - 1, Index++));
+ }
+ }
+
+ mKeyNormalName =
+ mIndexToName[mPitchToIndex[mMetronomeInfo.GetKeyNormal()]];
+
+
+ mKeyAccentedName =
+ mIndexToName[mPitchToIndex[mMetronomeInfo.GetKeyAccented()]];
+
mpVelocityKnob = new JZKnob(this, IDC_KB_VOLUME, 100, 0, 127);
mpVelocityValue = new wxStaticText(this, wxID_ANY, "127");
@@ -64,29 +96,18 @@
mpNormalListbox = new wxListBox(this, wxID_ANY);
- int Selection = 0;
- int Index = 0;
+ mpAccentedListbox = new wxListBox(this, wxID_ANY);
+
for (
- vector<pair<string, int> >::const_iterator iPair = gSynthesizerTypes.begin();
- iPair != gSynthesizerTypes.end();
- ++iPair, ++Index)
+ vector<string>::const_iterator iName = mIndexToName.begin();
+ iName != mIndexToName.end();
+ ++iName)
{
- mpNormalListbox->Append(iPair->first.c_str());
- if (strcmp(iPair->first.c_str(), gpConfig->StrValue(C_SynthType)) == 0)
- {
- Selection = Index;
- }
+ const string& DrumName = *iName;
+ mpNormalListbox->Append(DrumName.c_str());
+ mpAccentedListbox->Append(DrumName.c_str());
}
- mpNormalListbox->SetSelection(Selection);
- mpAccentedListbox = new wxListBox(this, wxID_ANY);
-
- mpAccentedListbox->Append("Never");
- mpAccentedListbox->Append("Song Start");
- mpAccentedListbox->Append("Start Play");
-
- mpAccentedListbox->SetSelection(gpConfig->GetValue(C_SendSynthReset));
-
wxButton* pOkButton = new wxButton(this, wxID_OK, "&OK");
wxButton* pCancelButton = new wxButton(this, wxID_CANCEL, "Cancel");
wxButton* pHelpButton = new wxButton(this, wxID_HELP, "Help");
@@ -149,6 +170,41 @@
{
mpVelocityKnob->SetValueWithEvent(mMetronomeInfo.GetVelocity());
mpAccentedCheckBox->SetValue(mMetronomeInfo.IsAccented());
+
+ int Selection, Index;
+
+ Selection = 0;
+ Index = 0;
+ for (
+ vector<string>::const_iterator iName = mIndexToName.begin();
+ iName != mIndexToName.end();
+ ++iName, ++Index)
+ {
+ const string& DrumName = *iName;
+ if (DrumName == mKeyNormalName)
+ {
+ Selection = Index;
+ break;
+ }
+ }
+ mpNormalListbox->SetSelection(Selection);
+
+ Selection = 0;
+ Index = 0;
+ for (
+ vector<string>::const_iterator iName = mIndexToName.begin();
+ iName != mIndexToName.end();
+ ++iName, ++Index)
+ {
+ const string& DrumName = *iName;
+ if (DrumName == mKeyAccentedName)
+ {
+ Selection = Index;
+ break;
+ }
+ }
+ mpAccentedListbox->SetSelection(Selection);
+
return true;
}
@@ -159,6 +215,21 @@
mMetronomeInfo.SetVelocity(static_cast<unsigned char>(
mpVelocityKnob->GetValue()));
mMetronomeInfo.SetIsAccented(mpAccentedCheckBox->GetValue());
+
+ int Selection;
+
+ Selection = mpNormalListbox->GetSelection();
+ if (Selection != wxNOT_FOUND)
+ {
+ mMetronomeInfo.SetKeyNormal(mIndexToPitch[Selection]);
+ }
+
+ Selection = mpAccentedListbox->GetSelection();
+ if (Selection != wxNOT_FOUND)
+ {
+ mMetronomeInfo.SetKeyAccented(mIndexToPitch[Selection]);
+ }
+
return true;
}
@@ -171,3 +242,10 @@
Oss << Value;
mpVelocityValue->SetLabel(Oss.str().c_str());
}
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+void JZMetronomeSettingsDialog::OnHelp(wxCommandEvent& Event)
+{
+// gpHelpInstance->ShowTopic("Metronome Settings");
+}
Modified: trunk/jazz/src/Dialogs/MetronomeSettingsDialog.h
===================================================================
--- trunk/jazz/src/Dialogs/MetronomeSettingsDialog.h 2008-04-06 05:44:50 UTC (rev 419)
+++ trunk/jazz/src/Dialogs/MetronomeSettingsDialog.h 2008-04-06 18:26:26 UTC (rev 420)
@@ -25,6 +25,10 @@
class JZKnob;
class JZKnobEvent;
+#include <vector>
+#include <string>
+#include <map>
+
//*****************************************************************************
//*****************************************************************************
class JZMetronomeSettingsDialog : public wxDialog
@@ -43,10 +47,22 @@
void OnVolumeChange(JZKnobEvent& Event);
+ void OnHelp(wxCommandEvent& Event);
+
private:
JZMetronomeInfo& mMetronomeInfo;
+ std::vector<std::string> mIndexToName;
+
+ std::vector<int> mIndexToPitch;
+
+ std::map<int, int> mPitchToIndex;
+
+ std::string mKeyNormalName;
+
+ std::string mKeyAccentedName;
+
JZKnob* mpVelocityKnob;
wxStaticText* mpVelocityValue;
Modified: trunk/jazz/src/Globals.cpp
===================================================================
--- trunk/jazz/src/Globals.cpp 2008-04-06 05:44:50 UTC (rev 419)
+++ trunk/jazz/src/Globals.cpp 2008-04-06 18:26:26 UTC (rev 420)
@@ -39,7 +39,7 @@
JZPlayer* gpMidiPlayer = 0;
-tHelp* HelpInstance = 0;
+JZHelp* gpHelpInstance = 0;
vector<pair<string, int> > gLimitSteps;
Modified: trunk/jazz/src/Globals.h
===================================================================
--- trunk/jazz/src/Globals.h 2008-04-06 05:44:50 UTC (rev 419)
+++ trunk/jazz/src/Globals.h 2008-04-06 18:26:26 UTC (rev 420)
@@ -33,7 +33,7 @@
class JZSong;
class JZSynth;
class JZPlayer;
-class tHelp;
+class JZHelp;
class JZProject;
class JZTrackFrame;
class JZTrackWindow;
@@ -49,7 +49,7 @@
extern JZSong* gpSong;
extern JZSynth* gpSynth;
extern JZPlayer* gpMidiPlayer;
-extern tHelp* HelpInstance;
+extern JZHelp* gpHelpInstance;
extern std::vector<std::pair<std::string, int> > gLimitSteps;
extern std::vector<std::pair<std::string, int> > gModes;
extern const int gScaleChromatic;
Modified: trunk/jazz/src/GuitarFrame.cpp
===================================================================
--- trunk/jazz/src/GuitarFrame.cpp 2008-04-06 05:44:50 UTC (rev 419)
+++ trunk/jazz/src/GuitarFrame.cpp 2008-04-06 18:26:26 UTC (rev 420)
@@ -113,7 +113,7 @@
//-----------------------------------------------------------------------------
void JZGuitarFrame::OnHelp(wxCommandEvent& event)
{
-// HelpInstance->ShowTopic("Guitar board");
+// gpHelpInstance->ShowTopic("Guitar board");
}
//-----------------------------------------------------------------------------
Modified: trunk/jazz/src/Help.cpp
===================================================================
--- trunk/jazz/src/Help.cpp 2008-04-06 05:44:50 UTC (rev 419)
+++ trunk/jazz/src/Help.cpp 2008-04-06 18:26:26 UTC (rev 420)
@@ -25,36 +25,46 @@
#include "wx/html/helpctrl.h"
#include "Help.h"
+#include "Globals.h"
#include <iostream>
using namespace std;
-tHelp* gpHelpInstance = 0;
-
-tHelp::tHelp(const char* pHelpFleName)
+//*****************************************************************************
+// Description:
+// This is the help class definition.
+//*****************************************************************************
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+JZHelp::JZHelp(const char* pHelpFleName)
: mpHelp(0),
mHelpFile(pHelpFleName)
{
mpHelp = new wxHtmlHelpController();
mpHelp->Initialize(mHelpFile);
- cout << "tHelp::tHelp " << mHelpFile << endl;
+ cout << "JZHelp::JZHelp " << mHelpFile << endl;
}
-tHelp::~tHelp()
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+JZHelp::~JZHelp()
{
delete mpHelp;
}
-void tHelp::ShowTopic(const char* pTopic)
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+void JZHelp::ShowTopic(const char* pTopic)
{
mpHelp->LoadFile(mHelpFile.c_str());
mpHelp->KeywordSearch(pTopic);
}
-void tHelp::DisplayContents()
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+void JZHelp::DisplayContents()
{
mpHelp->LoadFile(mHelpFile.c_str());
mpHelp->DisplayContents();
}
-
Modified: trunk/jazz/src/Help.h
===================================================================
--- trunk/jazz/src/Help.h 2008-04-06 05:44:50 UTC (rev 419)
+++ trunk/jazz/src/Help.h 2008-04-06 18:26:26 UTC (rev 420)
@@ -25,14 +25,18 @@
class wxHtmlHelpController;
-// a wrapper around the wx help classes.
-class tHelp
+//*****************************************************************************
+// Description:
+// This is the help class definition. This class implements a wrapper
+// around the wxWidgets help classes.
+//*****************************************************************************
+class JZHelp
{
public:
- tHelp(const char* pHelpFleName);
+ JZHelp(const char* pHelpFleName);
- ~tHelp();
+ ~JZHelp();
void ShowTopic(const char* pTopic);
@@ -45,6 +49,4 @@
wxString mHelpFile;
};
-extern tHelp* gpHelpInstance;
-
#endif // !defined(JZ_HELP_H)
Modified: trunk/jazz/src/Metronome.cpp
===================================================================
--- trunk/jazz/src/Metronome.cpp 2008-04-06 05:44:50 UTC (rev 419)
+++ trunk/jazz/src/Metronome.cpp 2008-04-06 18:26:26 UTC (rev 420)
@@ -115,6 +115,20 @@
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
+void JZMetronomeInfo::SetKeyNormal(unsigned char KeyNormal)
+{
+ mKeyNormal = KeyNormal;
+}
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+void JZMetronomeInfo::SetKeyAccented(unsigned char KeyAccented)
+{
+ mKeyAccented = KeyAccented;
+}
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
void JZMetronomeInfo::SetVelocity(unsigned char Velocity)
{
mVelocity = Velocity;
Modified: trunk/jazz/src/Metronome.h
===================================================================
--- trunk/jazz/src/Metronome.h 2008-04-06 05:44:50 UTC (rev 419)
+++ trunk/jazz/src/Metronome.h 2008-04-06 18:26:26 UTC (rev 420)
@@ -41,6 +41,14 @@
void ReadFromConfiguration();
+ unsigned char GetKeyNormal() const;
+
+ void SetKeyNormal(unsigned char KeyNormal);
+
+ unsigned char GetKeyAccented() const;
+
+ void SetKeyAccented(unsigned char KeyAccented);
+
unsigned char GetVelocity() const;
void SetVelocity(unsigned char Velocity);
@@ -71,6 +79,18 @@
};
inline
+unsigned char JZMetronomeInfo::GetKeyNormal() const
+{
+ return mKeyNormal;
+}
+
+inline
+unsigned char JZMetronomeInfo::GetKeyAccented() const
+{
+ return mKeyAccented;
+}
+
+inline
unsigned char JZMetronomeInfo::GetVelocity() const
{
return mVelocity;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pst...@us...> - 2008-04-06 22:47:56
|
Revision: 427
http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=427&view=rev
Author: pstieber
Date: 2008-04-06 15:47:54 -0700 (Sun, 06 Apr 2008)
Log Message:
-----------
Changed to record settings.
Modified Paths:
--------------
trunk/jazz/src/SynthesizerSettingsDialog.cpp
trunk/jazz/src/SynthesizerSettingsDialog.h
Modified: trunk/jazz/src/SynthesizerSettingsDialog.cpp
===================================================================
--- trunk/jazz/src/SynthesizerSettingsDialog.cpp 2008-04-06 22:47:03 UTC (rev 426)
+++ trunk/jazz/src/SynthesizerSettingsDialog.cpp 2008-04-06 22:47:54 UTC (rev 427)
@@ -30,6 +30,14 @@
//*****************************************************************************
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
+BEGIN_EVENT_TABLE(JZSynthesizerDialog, wxDialog)
+
+ EVT_BUTTON(wxID_HELP, JZSynthesizerDialog::OnHelp)
+
+END_EVENT_TABLE()
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
JZSynthesizerDialog::JZSynthesizerDialog(wxWindow* pParent)
: wxDialog(pParent, wxID_ANY, wxString("Synthesizer Settings")),
mpSynthesizerListbox(0),
@@ -37,20 +45,14 @@
{
mpSynthesizerListbox = new wxListBox(this, wxID_ANY);
- int Selection = 0;
- int Index = 0;
for (
- vector<pair<string, int> >::const_iterator iPair = gSynthesizerTypes.begin();
+ vector<pair<string, int> >::const_iterator iPair =
+ gSynthesizerTypes.begin();
iPair != gSynthesizerTypes.end();
- ++iPair, ++Index)
+ ++iPair)
{
mpSynthesizerListbox->Append(iPair->first.c_str());
- if (strcmp(iPair->first.c_str(), gpConfig->StrValue(C_SynthType)) == 0)
- {
- Selection = Index;
- }
}
- mpSynthesizerListbox->SetSelection(Selection);
mpStartListbox = new wxListBox(this, wxID_ANY);
@@ -58,8 +60,6 @@
mpStartListbox->Append("Song Start");
mpStartListbox->Append("Start Play");
- mpStartListbox->SetSelection(gpConfig->GetValue(C_SendSynthReset));
-
wxButton* pOkButton = new wxButton(this, wxID_OK, "&OK");
wxButton* pCancelButton = new wxButton(this, wxID_CANCEL, "Cancel");
wxButton* pHelpButton = new wxButton(this, wxID_HELP, "Help");
@@ -103,3 +103,64 @@
pTopSizer->SetSizeHints(this);
pTopSizer->Fit(this);
}
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+bool JZSynthesizerDialog::TransferDataToWindow()
+{
+ int Selection(0), Index(0);
+ for (
+ vector<pair<string, int> >::const_iterator iPair =
+ gSynthesizerTypes.begin();
+ iPair != gSynthesizerTypes.end();
+ ++iPair, ++Index)
+ {
+ if (strcmp(iPair->first.c_str(), gpConfig->StrValue(C_SynthType)) == 0)
+ {
+ mOldSynthTypeName = iPair->first;
+ Selection = Index;
+ }
+ }
+ mpSynthesizerListbox->SetSelection(Selection);
+
+ mpStartListbox->SetSelection(gpConfig->GetValue(C_SendSynthReset));
+
+ return true;
+}
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+bool JZSynthesizerDialog::TransferDataFromWindow()
+{
+ string SynthTypeName(mOldSynthTypeName);
+ wxString SelectionString = mpSynthesizerListbox->GetStringSelection();
+ if (!SelectionString.empty())
+ {
+ SynthTypeName = SelectionString;
+ }
+
+ int Selection = mpStartListbox->GetSelection();
+ if (Selection != wxNOT_FOUND)
+ {
+ gpConfig->Put(C_SendSynthReset, Selection);
+ }
+
+ if (mOldSynthTypeName != SynthTypeName)
+ {
+ gpConfig->Put(C_SynthType, SynthTypeName.c_str());
+
+ ::wxMessageBox(
+ "Restart jazz for the synthesizer type change to take effect",
+ "Info",
+ wxOK);
+ }
+
+ return true;
+}
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+void JZSynthesizerDialog::OnHelp(wxCommandEvent& Event)
+{
+// gpHelpInstance->ShowTopic("Synthesizer Type Settings");
+}
Modified: trunk/jazz/src/SynthesizerSettingsDialog.h
===================================================================
--- trunk/jazz/src/SynthesizerSettingsDialog.h 2008-04-06 22:47:03 UTC (rev 426)
+++ trunk/jazz/src/SynthesizerSettingsDialog.h 2008-04-06 22:47:54 UTC (rev 427)
@@ -21,6 +21,8 @@
#ifndef JZ_SYNTHESIZERSETTINGDIALOG_H
#define JZ_SYNTHESIZERSETTINGDIALOG_H
+#include <string>
+
//*****************************************************************************
//*****************************************************************************
class JZSynthesizerDialog : public wxDialog
@@ -31,9 +33,21 @@
private:
+ virtual bool TransferDataToWindow();
+
+ virtual bool TransferDataFromWindow();
+
+ void OnHelp(wxCommandEvent& Event);
+
+ private:
+
+ std::string mOldSynthTypeName;
+
wxListBox* mpSynthesizerListbox;
wxListBox* mpStartListbox;
+
+ DECLARE_EVENT_TABLE();
};
#endif // !defined(JZ_SYNTHESIZERSETTINGDIALOG_H)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pst...@us...> - 2008-04-07 00:07:01
|
Revision: 432
http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=432&view=rev
Author: pstieber
Date: 2008-04-06 17:06:59 -0700 (Sun, 06 Apr 2008)
Log Message:
-----------
Replaced tab characters with spaces.
Modified Paths:
--------------
trunk/jazz/src/AlsaThru.cpp
trunk/jazz/src/AudioDriver.cpp
trunk/jazz/src/Dialogs/copyDialog.cpp
trunk/jazz/src/Dialogs/copyDialog.h
trunk/jazz/src/Dialogs/midiThruDialog.cpp
trunk/jazz/src/Dialogs/midiTiming.cpp
trunk/jazz/src/Dialogs/midiTiming.h
trunk/jazz/src/SignalInterface.h
trunk/jazz/src/commands/copyCommand.cpp
trunk/jazz/src/mswin/jazz.rc
Modified: trunk/jazz/src/AlsaThru.cpp
===================================================================
--- trunk/jazz/src/AlsaThru.cpp 2008-04-06 23:58:31 UTC (rev 431)
+++ trunk/jazz/src/AlsaThru.cpp 2008-04-07 00:06:59 UTC (rev 432)
@@ -21,7 +21,7 @@
//
// Changes
//
-// 2000.03.18 Takashi Iwai <iw...@ww...>
+// 2000.03.18 Takashi Iwai <iw...@ww...>
// - Modified for ALSA 0.5.x
// - Thru-connection is done inside ALSA sequencer core if
// USE_DIRECT_CONNECTION is defined in alsathru.h.
Modified: trunk/jazz/src/AudioDriver.cpp
===================================================================
--- trunk/jazz/src/AudioDriver.cpp 2008-04-06 23:58:31 UTC (rev 431)
+++ trunk/jazz/src/AudioDriver.cpp 2008-04-07 00:06:59 UTC (rev 432)
@@ -101,7 +101,7 @@
count_info cinfo;
if (ioctl(mpPlayer->dev, SNDCTL_DSP_GETOPTR, &cinfo) == -1)
{
- perror("SNDCTL_DSP_GETOPTR");
+ perror("SNDCTL_DSP_GETOPTR");
}
return (cinfo.bytes - cinfo.ptr) / sizeof(short);
}
@@ -143,7 +143,7 @@
if (caps & DSP_CAP_DUPLEX)
{
- mCanDuplex = 1; // good soundcard!
+ mCanDuplex = 1; // good soundcard!
}
if (!(caps & DSP_CAP_TRIGGER))
@@ -325,7 +325,7 @@
{
if (ioctl(dev, SNDCTL_DSP_RESET, 0) == -1)
{
- perror("SNDCTL_DSP_RESET");
+ perror("SNDCTL_DSP_RESET");
}
}
else
@@ -432,7 +432,7 @@
// oss bug? It send EINTR?? on first read..
if (errno != EINTR && errno != EAGAIN)
{
- perror("read");
+ perror("read");
}
recbuffers.UndoRequest();
break;
@@ -501,11 +501,11 @@
if (ioctl(seqfd, SNDCTL_TMR_TEMPO, &new_speed) < 0)
{
// Sometimes this happens with mpu-401 timer.
- ; // perror("SNDCTL_TMR_TEMPO");
+ ; // perror("SNDCTL_TMR_TEMPO");
}
else
{
- curr_speed = new_speed;
+ curr_speed = new_speed;
}
}
}
Modified: trunk/jazz/src/Dialogs/copyDialog.cpp
===================================================================
--- trunk/jazz/src/Dialogs/copyDialog.cpp 2008-04-06 23:58:31 UTC (rev 431)
+++ trunk/jazz/src/Dialogs/copyDialog.cpp 2008-04-07 00:06:59 UTC (rev 432)
@@ -26,7 +26,7 @@
void tCopyDlg::OnHelp()
{
- HelpInstance->ShowTopic("Replicate");
+ HelpInstance->ShowTopic("Replicate");
}
Modified: trunk/jazz/src/Dialogs/copyDialog.h
===================================================================
--- trunk/jazz/src/Dialogs/copyDialog.h 2008-04-06 23:58:31 UTC (rev 431)
+++ trunk/jazz/src/Dialogs/copyDialog.h 2008-04-07 00:06:59 UTC (rev 432)
@@ -31,16 +31,30 @@
{
tCopyCommand *cp;
- public:
- tCopyDlg(tCopyCommand *c)
- : wxForm( USED_WXFORM_BUTTONS ) { cp = c; }
- void OnOk() { cp->OnOk(); wxForm::OnOk(); }
- void OnCancel() { cp->OnCancel(); wxForm::OnCancel(); }
- void OnHelp();
- void EditForm(wxPanel *panel);
+ public:
+ tCopyDlg(tCopyCommand *c)
+ : wxForm( USED_WXFORM_BUTTONS )
+ {
+ cp = c;
+ }
+
+ void OnOk()
+ {
+ cp->OnOk();
+ wxForm::OnOk();
+ }
+
+ void OnCancel()
+ {
+ cp->OnCancel();
+ wxForm::OnCancel();
+ }
+
+ void OnHelp();
+
+ void EditForm(wxPanel *panel);
};
#endif // Porting
#endif // COPYDIALOG
-
Modified: trunk/jazz/src/Dialogs/midiThruDialog.cpp
===================================================================
--- trunk/jazz/src/Dialogs/midiThruDialog.cpp 2008-04-06 23:58:31 UTC (rev 431)
+++ trunk/jazz/src/Dialogs/midiThruDialog.cpp 2008-04-07 00:06:59 UTC (rev 432)
@@ -37,7 +37,7 @@
void tMidiThruDlg::OnHelp()
{
- HelpInstance->ShowTopic("Midi Thru");
+ HelpInstance->ShowTopic("Midi Thru");
}
Modified: trunk/jazz/src/Dialogs/midiTiming.cpp
===================================================================
--- trunk/jazz/src/Dialogs/midiTiming.cpp 2008-04-06 23:58:31 UTC (rev 431)
+++ trunk/jazz/src/Dialogs/midiTiming.cpp 2008-04-07 00:06:59 UTC (rev 432)
@@ -116,10 +116,12 @@
{
int i;
char *str = copystring( ClkSrcListBox->GetStringSelection() );
- for (i = 0; i < 4; i++) {
- if (!strcmp(str,ClkSrcArray[i])) {
- break;
- }
+ for (i = 0; i < 4; i++)
+ {
+ if (!strcmp(str,ClkSrcArray[i]))
+ {
+ break;
+ }
}
delete str;
if (i > 3)
@@ -144,7 +146,7 @@
case CsFsk:
case CsInt:
default:
- Midi = new tWinAudioPlayer(EventWin->Song);
+ Midi = new tWinAudioPlayer(EventWin->Song);
break;
}
if (!Midi->Installed())
@@ -157,11 +159,13 @@
tMtcType MtcType;
str = copystring( MtcTypeListBox->GetStringSelection() );
- for (i = 0; i < 4; i++) {
- if (!strcmp(str,MtcTypeArray[i])) {
- MtcType = (tMtcType) i;
- break;
- }
+ for (i = 0; i < 4; i++)
+ {
+ if (!strcmp(str,MtcTypeArray[i]))
+ {
+ MtcType = (tMtcType) i;
+ break;
+ }
}
delete str;
if (i > 3)
@@ -177,7 +181,7 @@
void tTimingDlg::OnHelp()
{
- HelpInstance->ShowTopic("Timing");
+ HelpInstance->ShowTopic("Timing");
}
@@ -191,11 +195,15 @@
panel->NewLine();
panel->SetLabelPosition(wxVERTICAL);
- ClkSrcListBox = new wxListBox( panel,
- NULL,
- "Clock Source",
- wxSINGLE|wxALWAYS_SB,
- -1, -1, -1, -1 );
+ ClkSrcListBox = new wxListBox(
+ panel,
+ NULL,
+ "Clock Source",
+ wxSINGLE | wxALWAYS_SB,
+ -1,
+ -1,
+ -1,
+ -1);
#ifdef wx_msw
ClkSrcListBox->Append( ClkSrcArray[CsInt] );
@@ -221,13 +229,14 @@
char str[80];
tMtcTime *offs = t->GetMtcOffset();
offs->ToString( str );
- MtcOffsetEntry = new wxText( panel,
- NULL,
- "MTC offset",
- str,
- -1,
- -1,
- 100 );
+ MtcOffsetEntry = new wxText(
+ panel,
+ NULL,
+ "MTC offset",
+ str,
+ -1,
+ -1,
+ 100);
panel->NewLine();
@@ -237,11 +246,16 @@
panel->NewLine();
#endif
- MtcTypeListBox = new wxListBox( panel,
- NULL,
- "MTC Type",
- wxSINGLE|wxALWAYS_SB,
- -1, -1, -1, -1 );
+ MtcTypeListBox = new wxListBox(
+ panel,
+ NULL,
+ "MTC Type",
+ wxSINGLE|wxALWAYS_SB,
+ -1,
+ -1,
+ -1,
+ -1);
+
MtcTypeListBox->Append( MtcTypeArray[0] );
MtcTypeListBox->Append( MtcTypeArray[1] );
MtcTypeListBox->Append( MtcTypeArray[2] );
@@ -250,14 +264,13 @@
delete offs;
panel->NewLine();
- RealTimeCheckBox = new wxCheckBox( panel,
- NULL,
- "Realtime to MIDI Out" );
+ RealTimeCheckBox = new wxCheckBox(
+ panel,
+ NULL,
+ "Realtime to MIDI Out");
+
RealTimeCheckBox->SetValue( Config(C_RealTimeOut) );
panel->NewLine();
}
-
-
#endif // Porting
-
Modified: trunk/jazz/src/Dialogs/midiTiming.h
===================================================================
--- trunk/jazz/src/Dialogs/midiTiming.h 2008-04-06 23:58:31 UTC (rev 431)
+++ trunk/jazz/src/Dialogs/midiTiming.h 2008-04-07 00:06:59 UTC (rev 432)
@@ -57,11 +57,20 @@
static void HelpFunc( tMidiButton& button, wxCommandEvent& event );
};
-class tMidiButton : public wxButton {
+class tMidiButton : public wxButton
+{
public:
- tMidiButton( tTimingDlg *dlg,
- wxPanel *panel, wxFunction func, char *label, int x = -1, int y = -1,
- int width = -1, int height = -1, long style = 0, char *name = "button")
+ tMidiButton(
+ tTimingDlg *dlg,
+ wxPanel *panel,
+ wxFunction func,
+ char *label,
+ int x = -1,
+ int y = -1,
+ int width = -1,
+ int height = -1,
+ long style = 0,
+ char *name = "button")
: wxButton( panel, func, label, x, y, width, height, style, name )
{
midiDlg = dlg;
Modified: trunk/jazz/src/SignalInterface.h
===================================================================
--- trunk/jazz/src/SignalInterface.h 2008-04-06 23:58:31 UTC (rev 431)
+++ trunk/jazz/src/SignalInterface.h 2008-04-07 00:06:59 UTC (rev 432)
@@ -36,7 +36,7 @@
float pitch_range, // 1 = one octave
float pan_freq, // in Hz
float pan_spread, // 0..1
- float volume // -1..1
+ float volume // -1..1
);
void sig_reverb(
@@ -47,12 +47,12 @@
float room_val); // echo delay
void sig_wavsynth(
- tSample& spl, // destin
- double durat, // length in seconds
- int midi_key, // base freq
- double fshift, // frequeny modulation factor
- int N, // number of wavetables to be mixed
- JZRndArray* arr[][4], // (fft, vol, pitch, pan) * N
+ tSample& spl, // destin
+ double durat, // length in seconds
+ int midi_key, // base freq
+ double fshift, // frequeny modulation factor
+ int N, // number of wavetables to be mixed
+ JZRndArray* arr[][4], // (fft, vol, pitch, pan) * N
int noisegen // first array is noise filter
);
Modified: trunk/jazz/src/commands/copyCommand.cpp
===================================================================
--- trunk/jazz/src/commands/copyCommand.cpp 2008-04-06 23:58:31 UTC (rev 431)
+++ trunk/jazz/src/commands/copyCommand.cpp 2008-04-07 00:06:59 UTC (rev 432)
@@ -48,9 +48,13 @@
if (Mouse->Aborted)
{
if (CopyDlg)
- CopyDlg->OnCancel();
+ {
+ CopyDlg->OnCancel();
+ }
else
- Execute(0);
+ {
+ Execute(0);
+ }
}
else if (!MarkRepeat)
{
Modified: trunk/jazz/src/mswin/jazz.rc
===================================================================
--- trunk/jazz/src/mswin/jazz.rc 2008-04-06 23:58:31 UTC (rev 431)
+++ trunk/jazz/src/mswin/jazz.rc 2008-04-07 00:06:59 UTC (rev 432)
@@ -18,45 +18,45 @@
tb_note83 BITMAP "..\\bitmaps\\note83.bmp"
tb_note16 BITMAP "..\\bitmaps\\note16.bmp"
tb_note163 BITMAP "..\\bitmaps\\note163.bmp"
-tb_majscale BITMAP "..\\bitmaps\\majscale.bmp"
-tb_harscale BITMAP "..\\bitmaps\\harscale.bmp"
-tb_melscale BITMAP "..\\bitmaps\\melscale.bmp"
-tb_ionscale BITMAP "..\\bitmaps\\ionscale.bmp"
-tb_same4 BITMAP "..\\bitmaps\\same4.bmp"
-tb_same3 BITMAP "..\\bitmaps\\same3.bmp"
-tb_same2 BITMAP "..\\bitmaps\\same2.bmp"
-tb_same1 BITMAP "..\\bitmaps\\same1.bmp"
-tb_sameh BITMAP "..\\bitmaps\\sameh.bmp"
-tb_sameb BITMAP "..\\bitmaps\\sameb.bmp"
-tb_same0 BITMAP "..\\bitmaps\\same0.bmp"
-tb_std251 BITMAP "..\\bitmaps\\std251.bmp"
-tb_tritone BITMAP "..\\bitmaps\\tritone.bmp"
-tb_haunsch BITMAP "..\\bitmaps\\haunsch.bmp"
-tb_piano BITMAP "..\\bitmaps\\piano.bmp"
-tb_transpos BITMAP "..\\bitmaps\\transpos.bmp"
-tb_analyze BITMAP "..\\bitmaps\\analyze.bmp"
-tb_delchord BITMAP "..\\bitmaps\\delchord.bmp"
-tb_shiftl BITMAP "..\\bitmaps\\shiftl.bmp"
-tb_shiftr BITMAP "..\\bitmaps\\shiftr.bmp"
-tb_rrgadd BITMAP "..\\bitmaps\\rrgadd.bmp"
-tb_rrgdel BITMAP "..\\bitmaps\\rrgdel.bmp"
-tb_rrgup BITMAP "..\\bitmaps\\rrgup.bmp"
-tb_rrgdown BITMAP "..\\bitmaps\\rrgdown.bmp"
-tb_rrggen BITMAP "..\\bitmaps\\rrggen.bmp"
-tb_pianowin BITMAP "..\\bitmaps\\pianowin.bmp"
+tb_majscale BITMAP "..\\bitmaps\\majscale.bmp"
+tb_harscale BITMAP "..\\bitmaps\\harscale.bmp"
+tb_melscale BITMAP "..\\bitmaps\\melscale.bmp"
+tb_ionscale BITMAP "..\\bitmaps\\ionscale.bmp"
+tb_same4 BITMAP "..\\bitmaps\\same4.bmp"
+tb_same3 BITMAP "..\\bitmaps\\same3.bmp"
+tb_same2 BITMAP "..\\bitmaps\\same2.bmp"
+tb_same1 BITMAP "..\\bitmaps\\same1.bmp"
+tb_sameh BITMAP "..\\bitmaps\\sameh.bmp"
+tb_sameb BITMAP "..\\bitmaps\\sameb.bmp"
+tb_same0 BITMAP "..\\bitmaps\\same0.bmp"
+tb_std251 BITMAP "..\\bitmaps\\std251.bmp"
+tb_tritone BITMAP "..\\bitmaps\\tritone.bmp"
+tb_haunsch BITMAP "..\\bitmaps\\haunsch.bmp"
+tb_piano BITMAP "..\\bitmaps\\piano.bmp"
+tb_transpos BITMAP "..\\bitmaps\\transpos.bmp"
+tb_analyze BITMAP "..\\bitmaps\\analyze.bmp"
+tb_delchord BITMAP "..\\bitmaps\\delchord.bmp"
+tb_shiftl BITMAP "..\\bitmaps\\shiftl.bmp"
+tb_shiftr BITMAP "..\\bitmaps\\shiftr.bmp"
+tb_rrgadd BITMAP "..\\bitmaps\\rrgadd.bmp"
+tb_rrgdel BITMAP "..\\bitmaps\\rrgdel.bmp"
+tb_rrgup BITMAP "..\\bitmaps\\rrgup.bmp"
+tb_rrgdown BITMAP "..\\bitmaps\\rrgdown.bmp"
+tb_rrggen BITMAP "..\\bitmaps\\rrggen.bmp"
+tb_pianowin BITMAP "..\\bitmaps\\pianowin.bmp"
-tb_select BITMAP "..\\bitmaps\\select.bmp"
-tb_length BITMAP "..\\bitmaps\\length.bmp"
-tb_dialog BITMAP "..\\bitmaps\\dialog.bmp"
+tb_select BITMAP "..\\bitmaps\\select.bmp"
+tb_length BITMAP "..\\bitmaps\\length.bmp"
+tb_dialog BITMAP "..\\bitmaps\\dialog.bmp"
-tb_play BITMAP "..\\bitmaps\\play.bmp"
-tb_playloop BITMAP "..\\bitmaps\\playloop.bmp"
-tb_record BITMAP "..\\bitmaps\\record.bmp"
-tb_metro BITMAP "..\\bitmaps\\metro.bmp"
+tb_play BITMAP "..\\bitmaps\\play.bmp"
+tb_playloop BITMAP "..\\bitmaps\\playloop.bmp"
+tb_record BITMAP "..\\bitmaps\\record.bmp"
+tb_metro BITMAP "..\\bitmaps\\metro.bmp"
-tb_accept BITMAP "..\\bitmaps\\accept.bmp"
-tb_cancel BITMAP "..\\bitmaps\\cancel.bmp"
-tb_zoomin BITMAP "..\\bitmaps\\zoomin.bmp"
-tb_zoomout BITMAP "..\\bitmaps\\zoomout.bmp"
-tb_cutpaste BITMAP "..\\bitmaps\\cutpaste.bmp"
+tb_accept BITMAP "..\\bitmaps\\accept.bmp"
+tb_cancel BITMAP "..\\bitmaps\\cancel.bmp"
+tb_zoomin BITMAP "..\\bitmaps\\zoomin.bmp"
+tb_zoomout BITMAP "..\\bitmaps\\zoomout.bmp"
+tb_cutpaste BITMAP "..\\bitmaps\\cutpaste.bmp"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pst...@us...> - 2008-04-07 00:26:39
|
Revision: 433
http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=433&view=rev
Author: pstieber
Date: 2008-04-06 17:26:38 -0700 (Sun, 06 Apr 2008)
Log Message:
-----------
Changed to get chords playing in the harmony browser.
The harmony browser code needs lots of work.
Modified Paths:
--------------
trunk/jazz/src/Harmony.cpp
trunk/jazz/src/Harmony.h
Modified: trunk/jazz/src/Harmony.cpp
===================================================================
--- trunk/jazz/src/Harmony.cpp 2008-04-07 00:06:59 UTC (rev 432)
+++ trunk/jazz/src/Harmony.cpp 2008-04-07 00:26:38 UTC (rev 433)
@@ -46,7 +46,7 @@
using namespace std;
#define MEN_CLOSE 1
-#define MEN_MIDI 2
+#define MEN_MIDI 2
#define MEN_TRANSPOSE 4
#define MEN_CLEARSEQ 6
#define MEN_EDIT 7
@@ -127,52 +127,81 @@
};
-// ------------------------ HBPlayer ------------------------
-
-/** handle playing of the harmony*/
+//*****************************************************************************
+// Description:
+// This class handles the playing of the harmony.
+//*****************************************************************************
class HBPlayer : public wxTimer
{
friend class HBCanvas;
+
public:
+
HBPlayer();
+
void StartPlay(const HBContext &);
+
void Paste(tEventArray &);
+
void StopPlay();
+
void SettingsDialog(wxFrame *parent);
- int IsPlaying() const { return playing; }
- const HBContext &Context() { return context; }
+ int IsPlaying() const
+ {
+ return playing;
+ }
+
+ const HBContext& Context()
+ {
+ return context;
+ }
+
virtual void Notify();
- int GetChordKeys(int *out, const HBContext &);
- int GetMeldyKeys(int *out, const HBContext &);
- int GetBassKey(const HBContext &);
+ int GetChordKeys(int *out, const HBContext &);
+ int GetMeldyKeys(int *out, const HBContext &);
+
+ int GetBassKey(const HBContext &);
+
private:
+
HBContext context;
+
static int bass_channel, bass_veloc;
+
static int chord_channel, chord_veloc;
+
static int meldy_channel, meldy_veloc;
- static bool bass_enabled, chord_enabled, meldy_enabled;
+
+ static bool mBassEnabled, mChordEnabled, meldy_enabled;
+
static int bass_pitch, chord_pitch, meldy_pitch;
+
static int meldy_speed;
int bass_key, chord_keys[12], n_chord_keys;
+
int meldy_keys[12], n_meldy_keys, meldy_index;
+
int note_length;
+
int playing;
+
int device;
+
};
-bool HBPlayer::bass_enabled = 1;
+bool HBPlayer::mBassEnabled = true;
int HBPlayer::bass_channel = 1;
int HBPlayer::bass_veloc = 90;
int HBPlayer::bass_pitch = 40;
-bool HBPlayer::chord_enabled = 1;
-int HBPlayer::chord_channel = 2;
-int HBPlayer::chord_veloc = 90;
-int HBPlayer::chord_pitch = 60;
+bool HBPlayer::mChordEnabled = true;
+int HBPlayer::chord_channel = 2;
+int HBPlayer::chord_veloc = 90;
+int HBPlayer::chord_pitch = 60;
bool HBPlayer::meldy_enabled = 0;
int HBPlayer::meldy_channel = 3;
@@ -234,13 +263,13 @@
void HBPlayer::Paste(tEventArray &arr)
{
- if (bass_enabled)
+ if (mBassEnabled)
{
tKeyOn e(0, bass_channel - 1, bass_key, bass_veloc, note_length);
arr.Put(e.Copy());
}
- if (chord_enabled)
+ if (mChordEnabled)
{
for (int i = 0; i < n_chord_keys; i++)
{
@@ -267,13 +296,13 @@
n_meldy_keys = GetMeldyKeys(meldy_keys, context);
// Generate KeyOn's
- if (bass_enabled)
+ if (mBassEnabled)
{
tKeyOn e(0, bass_channel - 1, bass_key, bass_veloc);
gpMidiPlayer->OutNow(device, &e);
}
- if (chord_enabled)
+ if (mChordEnabled)
{
for (i = 0; i < n_chord_keys; i++)
{
@@ -308,14 +337,15 @@
playing = 0;
int i;
+
// Generate KeyOff's
- if (bass_enabled)
+ if (mBassEnabled)
{
tKeyOff e(0, bass_channel - 1, bass_key);
gpMidiPlayer->OutNow(device, &e);
}
- if (chord_enabled)
+ if (mChordEnabled)
{
for (i = 0; i < n_chord_keys; i++)
{
@@ -363,7 +393,7 @@
panel->SetLabelPosition(wxHORIZONTAL);
- form->Add(wxMakeFormBool("Bass enable", &bass_enabled));
+ form->Add(wxMakeFormBool("Bass enable", &mBassEnabled));
form->Add(wxMakeFormNewLine());
form->Add(wxMakeFormShort("Channel", &bass_channel, wxFORM_DEFAULT, new wxList(wxMakeConstraintRange(1.0, 16.0), 0)));
form->Add(wxMakeFormNewLine());
@@ -372,7 +402,7 @@
form->Add(wxMakeFormShort("Pitch", &bass_pitch, wxFORM_DEFAULT, new wxList(wxMakeConstraintRange(30.0, 99.0), 0)));
form->Add(wxMakeFormNewLine());
- form->Add(wxMakeFormBool("Chord enable", &chord_enabled));
+ form->Add(wxMakeFormBool("Chord enable", &mChordEnabled));
form->Add(wxMakeFormNewLine());
form->Add(wxMakeFormShort("Channel", &chord_channel, wxFORM_DEFAULT, new wxList(wxMakeConstraintRange(1.0, 16.0), 0)));
form->Add(wxMakeFormNewLine());
@@ -401,9 +431,9 @@
#endif
}
-// =============================================================
+//*****************************************************************************
// HBCanvas
-// =============================================================
+//*****************************************************************************
/** painting component for the harmony browser*/
class HBCanvas : public wxScrolledWindow
@@ -413,13 +443,15 @@
friend class HBMatchMarkers;
friend ostream & operator << (ostream &os, HBCanvas const &a);
friend istream & operator >> (istream &is, HBCanvas &a);
+
public:
+
HBCanvas(wxFrame *parent, int x, int y, int w, int h);
virtual ~HBCanvas();
virtual void OnDraw(wxDC& dc);
void DrawMarkers(const HBContext &c, wxDC* dc);
+
void ClearSeq();
- virtual void OnEvent(wxMouseEvent &e);
int SeqDefined() { return n_seq > 0; }
int GetChordKeys(int *out, int step, int n_steps);
@@ -441,6 +473,7 @@
HBAnalyzer * getAnalyzer();
protected:
+
static const int ScFa;
void ChordRect(JZRectangle &r, const HBContext &ct);
void DrawChord(const HBContext &ct);
@@ -449,6 +482,10 @@
private:
+ virtual void OnMouseEvent(wxMouseEvent& MouseEvent);
+
+ private:
+
float xchord, ychord, wchord, hchord;
float ofs;
wxFrame *parent;
@@ -480,6 +517,8 @@
static tScaleType scale_type;
void SetScaleType(int menu_id, tScaleType st, wxToolBar *tb);
+
+ DECLARE_EVENT_TABLE()
};
tScaleType HBCanvas::scale_type = Major;
@@ -487,7 +526,14 @@
int HBCanvas::transpose_res = 8;
int HBCanvas::analyze_res = 8;
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+BEGIN_EVENT_TABLE(HBCanvas, wxScrolledWindow)
+ EVT_MOUSE_EVENTS(HBCanvas::OnMouseEvent)
+
+END_EVENT_TABLE()
+
HBCanvas::HBCanvas(wxFrame *p, int x, int y, int w, int h)
: wxScrolledWindow(p, -1, wxPoint(x, y), wxSize(w, h))
{
@@ -901,7 +947,6 @@
return msg[2] ? 1 : 0;
}
-
void HBCanvas::DrawMarkers(const HBContext &ct, wxDC* dc)
{
JZRectangle r;
@@ -967,18 +1012,21 @@
}
-void HBCanvas::OnEvent(wxMouseEvent &e)
+void HBCanvas::OnMouseEvent(wxMouseEvent& MouseEvent)
{
wxDC* dc= new wxClientDC(this);
HBContext context;
int x, y;
- e.GetPosition(&x, &y);
+ MouseEvent.GetPosition(&x, &y);
if (Find(x, y, context))
{
- if (e.ButtonDown())
+ if (MouseEvent.ButtonDown())
{
player.StartPlay(context);
- if (e.LeftDown() && e.ShiftDown() || e.MiddleDown())
+ if (
+ MouseEvent.LeftDown() &&
+ MouseEvent.ShiftDown() ||
+ MouseEvent.MiddleDown())
{
if (context.SeqNr())
{
@@ -1010,13 +1058,14 @@
}
}
}
- else if (e.Dragging() && player.IsPlaying() && context != player.Context())
+ else if (
+ MouseEvent.Dragging() && player.IsPlaying() && context != player.Context())
{
player.StopPlay();
player.StartPlay(context);
}
- if (e.LeftDown() || e.MiddleDown()) // && context != mouse_context)
+ if (MouseEvent.LeftDown() || MouseEvent.MiddleDown()) // && context != mouse_context)
{
DrawMarkers(mouse_context, dc);
mouse_context = context;
@@ -1024,7 +1073,7 @@
DrawMarkers(mouse_context, dc);
// paste to PianoWin buffer
- if (!mark_piano)
+ if (!mark_piano && gpTrackFrame->GetPianoWindow())
{
tEventArray &buf = gpTrackFrame->GetPianoWindow()->mPasteBuffer;
buf.Clear();
@@ -1032,18 +1081,24 @@
gpTrackFrame->GetPianoWindow()->Refresh();
}
- // Show in GuitarWin
- JZGuitarFrame* guitar = gpTrackFrame->GetPianoWindow()->GetGuitarFrame();
- if (guitar)
+ if (gpTrackFrame->GetPianoWindow())
{
- guitar->ShowPitch(0); // remove actual pianowin/mouse position
-// guitar->Redraw();
- guitar->Update();
+ // Show in GuitarWin
+ JZGuitarFrame* guitar = gpTrackFrame->GetPianoWindow()->GetGuitarFrame();
+ if (guitar)
+ {
+ // Remove actual pianowin/mouse position
+ guitar->ShowPitch(0);
+// guitar->Redraw();
+ guitar->Update();
+ }
}
}
}
- if (e.ButtonUp() && player.IsPlaying())
+ if (MouseEvent.ButtonUp() && player.IsPlaying())
+ {
player.StopPlay();
+ }
delete dc;
}
Modified: trunk/jazz/src/Harmony.h
===================================================================
--- trunk/jazz/src/Harmony.h 2008-04-07 00:06:59 UTC (rev 432)
+++ trunk/jazz/src/Harmony.h 2008-04-07 00:26:38 UTC (rev 433)
@@ -34,17 +34,25 @@
class tHBInterface
{
public:
+
virtual ~tHBInterface()
{
}
+
virtual int SeqDefined() = 0; // true = yes
- // return number of keys in out
+ // Return number of keys in out
+
virtual int GetChordKeys(int *out, int step, int n_steps) = 0;
+
virtual int GetBassKeys(int *out, int step, int n_steps) = 0;
+
virtual int GetSelectedChord(int *out) = 0; // returns # keys
+
virtual int GetSelectedScale(int *out) = 0; // returns # keys
+
virtual HBAnalyzer * getAnalyzer() = 0;
+
virtual void TransposeSelection() = 0;
};
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pst...@us...> - 2008-04-07 01:06:00
|
Revision: 434
http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=434&view=rev
Author: pstieber
Date: 2008-04-06 18:05:58 -0700 (Sun, 06 Apr 2008)
Log Message:
-----------
1. Fixed scrolled drawing.
2. Made cosmetic changes.
Modified Paths:
--------------
trunk/jazz/src/Harmony.cpp
trunk/jazz/src/HarmonyP.cpp
trunk/jazz/src/HarmonyP.h
Modified: trunk/jazz/src/Harmony.cpp
===================================================================
--- trunk/jazz/src/Harmony.cpp 2008-04-07 00:26:38 UTC (rev 433)
+++ trunk/jazz/src/Harmony.cpp 2008-04-07 01:05:58 UTC (rev 434)
@@ -383,7 +383,7 @@
void HBPlayer::SettingsDialog(wxFrame *parent)
{
#ifdef OBSOLETE
- wxDialogBox *panel = new wxDialogBox(parent, "MIDI settings", FALSE );
+ wxDialogBox *panel = new wxDialogBox(pParent, "MIDI settings", FALSE );
tHBPlayerForm *form = new tHBPlayerForm;
form->Add(wxMakeFormMessage("Note Length for paste into piano window"));
@@ -432,10 +432,9 @@
}
//*****************************************************************************
-// HBCanvas
+// Description:
+// This is the harmony browser window.
//*****************************************************************************
-
-/** painting component for the harmony browser*/
class HBCanvas : public wxScrolledWindow
{
friend class HBSettingsDlg;
@@ -446,21 +445,33 @@
public:
- HBCanvas(wxFrame *parent, int x, int y, int w, int h);
+ HBCanvas(wxFrame* pParent, int x, int y, int w, int h);
+
virtual ~HBCanvas();
- virtual void OnDraw(wxDC& dc);
- void DrawMarkers(const HBContext &c, wxDC* dc);
+ virtual void OnDraw(wxDC& Dc);
+
+ void DrawMarkers(wxDC& Dc, const HBContext &c);
+
void ClearSeq();
- int SeqDefined() { return n_seq > 0; }
+ int SeqDefined()
+ {
+ return n_seq > 0;
+ }
+
int GetChordKeys(int *out, int step, int n_steps);
+
int GetSelectedChord(int *out);
+
int GetSelectedScale(int *out);
+
int GetBassKeys(int *out, int step, int n_steps);
- void SettingsDialog(wxFrame *parent);
+ void SettingsDialog();
+
void OnMenuCommand(int id, wxToolBar *mpToolBar);
+
void TransposeSelection();
HBPlayer player;
@@ -470,54 +481,76 @@
SEQMAX = 256
};
- HBAnalyzer * getAnalyzer();
+ HBAnalyzer* getAnalyzer();
protected:
static const int ScFa;
- void ChordRect(JZRectangle &r, const HBContext &ct);
- void DrawChord(const HBContext &ct);
- void UnDrawChord(const HBContext &ct);
+
+ void ChordRect(JZRectangle& Rectangle, const HBContext &ct);
+
+ void DrawChord(wxDC& Dc, const HBContext &ct);
+
+ void UnDrawChord(wxDC& Dc, const HBContext &ct);
+
bool Find(float x, float y, HBContext &out);
private:
virtual void OnMouseEvent(wxMouseEvent& MouseEvent);
+ void SetMarker(int id, wxToolBar *mpToolBar);
+
+ void SetScaleType(int menu_id, tScaleType st, wxToolBar *tb);
+
private:
+ static tScaleType scale_type;
+
+ static int transpose_res;
+
+ static int analyze_res;
+
float xchord, ychord, wchord, hchord;
+
float ofs;
- wxFrame *parent;
- HBContext *seq[SEQMAX];
+// wxFrame* parent;
+
+ HBContext* seq[SEQMAX];
+
int n_seq;
- char *default_filename;
+ char* default_filename;
+
bool has_changed;
HBContext mouse_context;
bool haunschild_layout;
+
bool mark_4_common;
+
bool mark_3_common;
+
bool mark_2_common;
+
bool mark_1_common;
+
bool mark_b_common;
+
bool mark_0_common;
+
bool mark_1_semi;
+
bool mark_251;
+
bool mark_tritone;
+
bool mark_piano;
- void SetMarker(int id, wxToolBar *mpToolBar);
+
int active_marker;
- static int transpose_res;
- static int analyze_res;
-
- static tScaleType scale_type;
- void SetScaleType(int menu_id, tScaleType st, wxToolBar *tb);
-
DECLARE_EVENT_TABLE()
};
@@ -534,10 +567,12 @@
END_EVENT_TABLE()
-HBCanvas::HBCanvas(wxFrame *p, int x, int y, int w, int h)
- : wxScrolledWindow(p, -1, wxPoint(x, y), wxSize(w, h))
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+HBCanvas::HBCanvas(wxFrame* pParent, int x, int y, int w, int h)
+ : wxScrolledWindow(pParent, wxID_ANY, wxPoint(x, y), wxSize(w, h))
{
- parent = p;
+// parent = pParent;
n_seq = 0;
active_marker = 0;
@@ -688,66 +723,70 @@
}
-void HBCanvas::ChordRect(JZRectangle &r, const HBContext &ct)
+void HBCanvas::ChordRect(JZRectangle& Rectangle, const HBContext &ct)
{
if (ct.SeqNr())
{
- r.x = (int)(xchord + (ct.SeqNr() - 1) % 8 * wchord);
- r.y = (int)(hchord * ((ct.SeqNr() -1) / 8 + 0.5));
+ Rectangle.x = (int)(xchord + (ct.SeqNr() - 1) % 8 * wchord);
+ Rectangle.y = (int)(hchord * ((ct.SeqNr() -1) / 8 + 0.5));
}
else if (!haunschild_layout)
{
- r.x = (int)(xchord + ct.ChordNr() * wchord);
- r.y = (int)(ychord + ct.ScaleNr() * hchord);
+ Rectangle.x = (int)(xchord + ct.ChordNr() * wchord);
+ Rectangle.y = (int)(ychord + ct.ScaleNr() * hchord);
}
else
{
- r.x = (int)(xchord + (5 * ct.ChordNr() % 7 + 5 * ct.ScaleNr() % 12) % 7 * wchord);
- r.y = (int)(ychord + (5 * ct.ScaleNr() % 12) * hchord);
+ Rectangle.x = (int)(xchord + (5 * ct.ChordNr() % 7 + 5 * ct.ScaleNr() % 12) % 7 * wchord);
+ Rectangle.y = (int)(ychord + (5 * ct.ScaleNr() % 12) * hchord);
}
- r.x += (int)ofs;
- r.y -= (int)ofs;
- r.width = (int)(wchord - 2 * ofs);
- r.height = (int)(hchord - 2 * ofs);
+ Rectangle.x += (int)ofs;
+ Rectangle.y -= (int)ofs;
+ Rectangle.width = (int)(wchord - 2 * ofs);
+ Rectangle.height = (int)(hchord - 2 * ofs);
}
-void HBCanvas::DrawChord(const HBContext &ct)
+void HBCanvas::DrawChord(wxDC& Dc, const HBContext &ct)
{
- // draw surrounding box
- JZRectangle r;
- ChordRect(r, ct);
- wxDC *dc = new wxClientDC(this);//GetDC();
- dc->DrawRectangle(r.x, r.y, r.width, r.height);
+ // Draw the surrounding box.
+ JZRectangle Rectangle;
+ ChordRect(Rectangle, ct);
+ Dc.DrawRectangle(
+ Rectangle.x,
+ Rectangle.y,
+ Rectangle.width,
+ Rectangle.height);
+
int w, h;
- const char *name = ct.ChordName();
- dc->GetTextExtent(name, &w, &h);
- dc->DrawText((char *)name, r.x + (r.width - w)/2, r.y + (r.height - h)/2);
- delete dc;
+ const char* pName = ct.ChordName();
+ Dc.GetTextExtent(pName, &w, &h);
+ Dc.DrawText(pName, Rectangle.x + (Rectangle.width - w)/2, Rectangle.y + (Rectangle.height - h)/2);
}
-void HBCanvas::UnDrawChord(const HBContext &ct)
+void HBCanvas::UnDrawChord(wxDC& Dc, const HBContext& ct)
{
// draw surrounding box
- JZRectangle r;
- ChordRect(r, ct);
+ JZRectangle Rectangle;
+ ChordRect(Rectangle, ct);
- wxDC *dc = new wxClientDC(this);//GetDC();
- dc->SetPen(*wxWHITE_PEN);
- dc->DrawRectangle(r.x, r.y, r.width, r.height);
- dc->SetPen(*wxBLACK_PEN);
- delete dc;
+ Dc.SetPen(*wxWHITE_PEN);
+ Dc.DrawRectangle(
+ Rectangle.x,
+ Rectangle.y,
+ Rectangle.width,
+ Rectangle.height);
+ Dc.SetPen(*wxBLACK_PEN);
}
-void HBCanvas::OnDraw(wxDC& dcref)
+void HBCanvas::OnDraw(wxDC& Dc)
{
- wxDC *dc = &dcref; //im just lazy, didnt want to change old code
- dc->Clear();
- dc->DrawText("Seq", 5, 5);
+ Dc.Clear();
+ Dc.DrawText("Seq", 5, 5);
ychord = (n_seq/8 + 1) * hchord + (n_seq % 8 ? hchord : 0) + hchord;
@@ -757,33 +796,33 @@
while (iter())
{
const HBContext &ct = iter.Context();
- DrawChord(ct);
+ DrawChord(Dc, ct);
if (ct.ChordNr() == 0 && ct.SeqNr() == 0)
{
- JZRectangle r;
- ChordRect(r, ct);
- dc->DrawText((char *)ct.ScaleName(), 5, r.y);
+ JZRectangle Rectangle;
+ ChordRect(Rectangle, ct);
+ Dc.DrawText(ct.ScaleName(), 5, Rectangle.y);
}
}
- DrawMarkers(mouse_context, dc);
+ DrawMarkers(Dc, mouse_context);
if (!haunschild_layout)
{
for (int j = 0; j < 7; j++)
{
HBContext ct(0, j, scale_type);
- JZRectangle r;
- ChordRect(r, ct);
- r.y -= (int)hchord;
+ JZRectangle Rectangle;
+ ChordRect(Rectangle, ct);
+ Rectangle.y -= (int)hchord;
int w, h;
const char *name = ct.ChordNrName();
- dc->GetTextExtent(name, &w, &h);
- dc->DrawText((char *)name, r.x + (r.width - w)/2, r.y + (r.height - h)/2);
+ Dc.GetTextExtent(name, &w, &h);
+ Dc.DrawText((char *)name, Rectangle.x + (Rectangle.width - w)/2, Rectangle.y + (Rectangle.height - h)/2);
const char *type = ct.ContextName();
- dc->GetTextExtent(type, &w, &h);
- dc->DrawText((char *)type, r.x + (r.width - w)/2, r.y + (r.height - h)/2 - h);
+ Dc.GetTextExtent(type, &w, &h);
+ Dc.DrawText((char *)type, Rectangle.x + (Rectangle.width - w)/2, Rectangle.y + (Rectangle.height - h)/2 - h);
}
}
@@ -814,10 +853,10 @@
#endif
-void HBCanvas::SettingsDialog(wxFrame *parent)
+void HBCanvas::SettingsDialog()
{
#ifdef OBSOLETE
- wxDialogBox *panel = new wxDialogBox(parent, "settings", FALSE );
+ wxDialogBox *panel = new wxDialogBox(this, "settings", FALSE );
wxForm *form = new HBSettingsForm(this);
panel->SetLabelPosition(wxHORIZONTAL);
@@ -947,42 +986,41 @@
return msg[2] ? 1 : 0;
}
-void HBCanvas::DrawMarkers(const HBContext &ct, wxDC* dc)
+void HBCanvas::DrawMarkers(wxDC& Dc, const HBContext &ct)
{
- JZRectangle r;
- //wxDC *dc = GetDC();
- dc->SetLogicalFunction(wxXOR);
- dc->SetBrush(*wxTRANSPARENT_BRUSH);
+ JZRectangle Rectangle;
+ Dc.SetLogicalFunction(wxXOR);
+ Dc.SetBrush(*wxTRANSPARENT_BRUSH);
HBMatchMarkers match(ct, this);
HBContextIterator iter(match);
iter.SetSequence(seq, n_seq);
iter.SetScaleType(scale_type);
while (iter())
{
- ChordRect(r, iter.Context());
- r.x += 3;
- r.y += 3;
- r.width -= 6;
- r.height -= 6;
- dc->DrawRectangle(r.x, r.y, r.width, r.height);
+ ChordRect(Rectangle, iter.Context());
+ Rectangle.x += 3;
+ Rectangle.y += 3;
+ Rectangle.width -= 6;
+ Rectangle.height -= 6;
+ Dc.DrawRectangle(Rectangle.x, Rectangle.y, Rectangle.width, Rectangle.height);
}
// invert actual chord
if (ct.ScaleType() == scale_type)
{
- dc->SetBrush(*wxBLACK_BRUSH);
- ChordRect(r, ct);
- dc->DrawRectangle(r.x, r.y, r.width, r.height);
+ Dc.SetBrush(*wxBLACK_BRUSH);
+ ChordRect(Rectangle, ct);
+ Dc.DrawRectangle(Rectangle.x, Rectangle.y, Rectangle.width, Rectangle.height);
if (ct.SeqNr() > 0)
{
HBContext c(ct);
c.SetSeqNr(0);
- ChordRect(r, c);
- dc->DrawRectangle(r.x, r.y, r.width, r.height);
+ ChordRect(Rectangle, c);
+ Dc.DrawRectangle(Rectangle.x, Rectangle.y, Rectangle.width, Rectangle.height);
}
}
- dc->SetLogicalFunction(wxCOPY);
- dc->SetBrush(*wxWHITE_BRUSH);
+ Dc.SetLogicalFunction(wxCOPY);
+ Dc.SetBrush(*wxWHITE_BRUSH);
}
bool HBCanvas::Find(float x, float y, HBContext &out)
@@ -992,9 +1030,9 @@
iter.SetScaleType(scale_type);
while (iter())
{
- JZRectangle r;
- ChordRect(r, iter.Context());
- if (r.IsInside((int)x, (int)y))
+ JZRectangle Rectangle;
+ ChordRect(Rectangle, iter.Context());
+ if (Rectangle.IsInside((int)x, (int)y))
{
out = iter.Context();
return TRUE;
@@ -1014,7 +1052,9 @@
void HBCanvas::OnMouseEvent(wxMouseEvent& MouseEvent)
{
- wxDC* dc= new wxClientDC(this);
+ wxClientDC Dc(this);
+ DoPrepareDC(Dc);
+
HBContext context;
int x, y;
MouseEvent.GetPosition(&x, &y);
@@ -1036,12 +1076,12 @@
// remove markers first
if (mouse_context.SeqNr() == n_seq)
{
- DrawMarkers(mouse_context, dc);
+ DrawMarkers(Dc, mouse_context);
mouse_context.SetSeqNr(0);
- DrawMarkers(mouse_context, dc);
+ DrawMarkers(Dc, mouse_context);
}
-- n_seq;
- UnDrawChord(context);
+ UnDrawChord(Dc, context);
context.SetSeqNr(0);
Refresh();
}
@@ -1051,9 +1091,9 @@
// add a chord
context.SetSeqNr(n_seq + 1);
*seq[n_seq ++] = context;
- DrawMarkers(mouse_context, dc);
- DrawChord(context);
- DrawMarkers(mouse_context, dc);
+ DrawMarkers(Dc, mouse_context);
+ DrawChord(Dc, context);
+ DrawMarkers(Dc, mouse_context);
Refresh();
}
}
@@ -1067,10 +1107,10 @@
if (MouseEvent.LeftDown() || MouseEvent.MiddleDown()) // && context != mouse_context)
{
- DrawMarkers(mouse_context, dc);
+ DrawMarkers(Dc, mouse_context);
mouse_context = context;
//mouse_context.SetSeqNr(0);
- DrawMarkers(mouse_context, dc);
+ DrawMarkers(Dc, mouse_context);
// paste to PianoWin buffer
if (!mark_piano && gpTrackFrame->GetPianoWindow())
@@ -1099,7 +1139,6 @@
{
player.StopPlay();
}
- delete dc;
}
@@ -1204,7 +1243,7 @@
break;
case MEN_SETTINGS:
- SettingsDialog(parent);
+ SettingsDialog();
break;
default:
Modified: trunk/jazz/src/HarmonyP.cpp
===================================================================
--- trunk/jazz/src/HarmonyP.cpp 2008-04-07 00:26:38 UTC (rev 433)
+++ trunk/jazz/src/HarmonyP.cpp 2008-04-07 01:05:58 UTC (rev 434)
@@ -265,14 +265,51 @@
const char *const HBContext::context_names[nScaleTypes][7] =
{
- { "ion", "dor", "phry", "lyd", "mixo", "aeol", "locr"},
- { "harm", "locr 13", "ion #5", "dor #11", "HM5", "lyd #9", "har dim"},
- { "melod", "dor b9", "lyd #5", "mixo #11", "mixo b13", "locr 9", "superlocr"},
- { "ion b13", "dor b5", "harm alt", "melod #11", "mixo b9", "lyd #9#5", "locr dim"},
+ {
+ "ion",
+ "dor",
+ "phry",
+ "lyd",
+ "mixo",
+ "aeol",
+ "locr"
+ },
+ {
+ "harm",
+ "locr 13",
+ "ion #5",
+ "dor #11",
+ "HM5",
+ "lyd #9",
+ "har dim"
+ },
+ {
+ "melod",
+ "dor b9",
+ "lyd #5",
+ "mixo #11",
+ "mixo b13",
+ "locr 9",
+ "superlocr"
+ },
+ {
+ "ion b13",
+ "dor b5",
+ "harm alt",
+ "melod #11",
+ "mixo b9",
+ "lyd #9#5",
+ "locr dim"
+ },
};
-const char *const HBContext::scale_type_names[nScaleTypes] =
- { "J", "HM", "MM", "HJ" };
+const char* const HBContext::scale_type_names[nScaleTypes] =
+{
+ "J",
+ "HM",
+ "MM",
+ "HJ"
+};
HBContext::HBContext(int sn, int cn, tScaleType st)
@@ -367,12 +404,16 @@
HBChord chord;
int key = scale_nr;
for (i = 0; i < chord_nr; i++)
+ {
key = scale.Iter(key);
+ }
chord += key;
for (i = 1; i < 4; i++)
{
for (j = 0; j < 2; j++)
+ {
key = scale.Iter(key);
+ }
chord += key;
}
return chord;
@@ -383,7 +424,9 @@
{
int key = scale_nr;
for (int i = 0; i < chord_nr; i++)
+ {
key = scale.Iter(key);
+ }
return key % 12;
}
Modified: trunk/jazz/src/HarmonyP.h
===================================================================
--- trunk/jazz/src/HarmonyP.h 2008-04-07 00:26:38 UTC (rev 433)
+++ trunk/jazz/src/HarmonyP.h 2008-04-07 01:05:58 UTC (rev 434)
@@ -258,60 +258,122 @@
public:
HBContext(int sn, int cn = 0, tScaleType st = Major);
+
HBContext();
- HBChord *PScale() { return &scale; }
- HBChord Scale() const { return scale; }
- HBChord *PChord() { return &chord; }
- HBChord Chord() const { return chord; }
- int ScaleKey() const { return scale_nr; }
- int ChordKey() const { return chord_key; }
- int ChordNr() const { return chord_nr; }
- int ScaleNr() const { return scale_nr; }
- tScaleType ScaleType() const { return scale_type; }
- int SeqNr() const { return seq_nr; }
- void SetSeqNr(int n = 0) { seq_nr = n; }
+ HBChord *PScale()
+ {
+ return &scale;
+ }
- const char * ChordName() const; // "Dm75-"
- const char * ChordNrName() const; // "IV"
- const char * ContextName() const // "mixo#11"
+ HBChord Scale() const
{
+ return scale;
+ }
+
+ HBChord *PChord()
+ {
+ return &chord;
+ }
+
+ HBChord Chord() const
+ {
+ return chord;
+ }
+
+ int ScaleKey() const
+ {
+ return scale_nr;
+ }
+
+ int ChordKey() const
+ {
+ return chord_key;
+ }
+
+ int ChordNr() const
+ {
+ return chord_nr;
+ }
+
+ int ScaleNr() const
+ {
+ return scale_nr;
+ }
+
+ tScaleType ScaleType() const
+ {
+ return scale_type;
+ }
+
+ int SeqNr() const
+ {
+ return seq_nr;
+ }
+
+ void SetSeqNr(int n = 0)
+ {
+ seq_nr = n;
+ }
+
+ const char* ChordName() const; // "Dm75-"
+
+ const char* ChordNrName() const; // "IV"
+
+ const char* ContextName() const // "mixo#11"
+ {
return context_names[scale_type][chord_nr];
}
- const char * ScaleName() const; // "C#"
- const char * ScaleTypeName() const; // "major"
- int operator == (const HBContext &o) const
+ const char* ScaleName() const; // "C#"
+
+ const char* ScaleTypeName() const; // "major"
+
+ int operator == (const HBContext& Rhs) const
{
- return scale_type == o.scale_type &&
- scale_nr == o.scale_nr &&
- chord_nr == o.chord_nr;
+ return
+ scale_type == Rhs.scale_type &&
+ scale_nr == Rhs.scale_nr &&
+ chord_nr == Rhs.chord_nr;
}
- int operator != (const HBContext &o) const { return !operator==(o); }
+ int operator != (const HBContext& Rhs) const
+ {
+ return !operator == (Rhs);
+ }
+
private:
+
void Initialize();
+
HBChord MakeScale() const;
+
HBChord MakeChord() const;
+
int MakeChordKey() const;
tScaleType scale_type;
+
int scale_nr;
+
int chord_nr;
+
int seq_nr;
HBChord chord;
+
HBChord scale;
+
int chord_key;
#if NAME_TABLE
static const char *const chord_names[nScaleTypes][7];
#endif
- static const char *const chord_nr_names[7];
- static const char *const scale_type_names[nScaleTypes];
+ static const char* const chord_nr_names[7];
+ static const char* const scale_type_names[nScaleTypes];
static const int flat_keys[12];
- static const char *const context_names[nScaleTypes][7];
+ static const char* const context_names[nScaleTypes][7];
};
@@ -353,21 +415,46 @@
class HBContextIterator
{
public:
+
HBContextIterator();
+
HBContextIterator(HBMatch &);
- void SetSequence(HBContext *s[], int n) { seq = s; n_seq = n; }
- void SetScaleType(tScaleType st) { scale_type = st; }
+
+ void SetSequence(HBContext *s[], int n)
+ {
+ seq = s;
+ n_seq = n;
+ }
+
+ void SetScaleType(tScaleType st)
+ {
+ scale_type = st;
+ }
+
bool operator()();
- const HBContext *operator->() const { return &context; }
- const HBContext &Context() const { return context; }
+ const HBContext *operator->() const
+ {
+ return &context;
+ }
+
+ const HBContext& Context() const
+ {
+ return context;
+ }
+
private:
+
HBContext context;
- HBMatch &match;
+
+ HBMatch& match;
+
HBMatch def_match;
- HBContext **seq;
+ HBContext** seq;
+
int i_seq, n_seq;
+
tScaleType scale_type;
};
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pst...@us...> - 2008-04-07 04:34:03
|
Revision: 435
http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=435&view=rev
Author: pstieber
Date: 2008-04-06 21:33:58 -0700 (Sun, 06 Apr 2008)
Log Message:
-----------
1. Changed the interface to CreateHarmonyBrowser.
2. Changed getAnalyzer to GetAnalyzer.
3. Added file loading, sequence clearing...
4. Fixed initial scrolled window layout.
Modified Paths:
--------------
trunk/jazz/src/Harmony.cpp
trunk/jazz/src/Harmony.h
trunk/jazz/src/PianoWindow.cpp
trunk/jazz/src/TrackFrame.cpp
Modified: trunk/jazz/src/Harmony.cpp
===================================================================
--- trunk/jazz/src/Harmony.cpp 2008-04-07 01:05:58 UTC (rev 434)
+++ trunk/jazz/src/Harmony.cpp 2008-04-07 04:33:58 UTC (rev 435)
@@ -22,7 +22,6 @@
#include "WxWidgets.h"
-//#include "config.h"
#include "Harmony.h"
#include "HarmonyP.h"
#include "Player.h"
@@ -45,32 +44,32 @@
using namespace std;
-#define MEN_CLOSE 1
-#define MEN_MIDI 2
-#define MEN_TRANSPOSE 4
-#define MEN_CLEARSEQ 6
+#define MEN_CLOSE 1
+#define MEN_MIDI 2
+#define MEN_TRANSPOSE 4
+#define MEN_CLEARSEQ 6
#define MEN_EDIT 7
-#define MEN_MOUSE 8
+#define MEN_MOUSE 8
#define MEN_HELP 9
-#define MEN_MAJSCALE 10
-#define MEN_HARSCALE 11
-#define MEN_MELSCALE 12
+#define MEN_MAJSCALE 10
+#define MEN_HARSCALE 11
+#define MEN_MELSCALE 12
-#define MEN_EQ4 13
-#define MEN_EQ3 14
-#define MEN_EQ2 15
-#define MEN_EQ1 16
-#define MEN_EQH 17
-#define MEN_EQ0 18
-#define MEN_251 19
-#define MEN_TRITONE 20
-#define MEN_PIANO 21
-#define MEN_EQB 22
-#define MEN_HAUNSCH 23
-#define MEN_ANALYZE 24
-#define MEN_IONSCALE 25
-#define MEN_SETTINGS 26
+#define MEN_EQ4 13
+#define MEN_EQ3 14
+#define MEN_EQ2 15
+#define MEN_EQ1 16
+#define MEN_EQH 17
+#define MEN_EQ0 18
+#define MEN_251 19
+#define MEN_TRITONE 20
+#define MEN_PIANO 21
+#define MEN_EQB 22
+#define MEN_HAUNSCH 23
+#define MEN_ANALYZE 24
+#define MEN_IONSCALE 25
+#define MEN_SETTINGS 26
#define MEN_LOAD 27
#define MEN_SAVE 28
@@ -99,30 +98,30 @@
static JZToolDef tdefs[] =
{
- { MEN_LOAD, FALSE, open_xpm, "open harmony file" },
- { MEN_SAVE, FALSE, save_xpm, "save harmony file" },
+ { MEN_LOAD, false, open_xpm, "open harmony file" },
+ { MEN_SAVE, false, save_xpm, "save harmony file" },
{ JZToolBar::eToolBarSeparator },
- { MEN_MAJSCALE, TRUE, majscale_xpm, "major scale" },
- { MEN_HARSCALE, TRUE, harscale_xpm, "harmonic scale" },
- { MEN_MELSCALE, TRUE, melscale_xpm, "melodic scale" },
- { MEN_IONSCALE, TRUE, ionscale_xpm, "ionic b13 scale" },
+ { MEN_MAJSCALE, true, majscale_xpm, "major scale" },
+ { MEN_HARSCALE, true, harscale_xpm, "harmonic scale" },
+ { MEN_MELSCALE, true, melscale_xpm, "melodic scale" },
+ { MEN_IONSCALE, true, ionscale_xpm, "ionic b13 scale" },
{ JZToolBar::eToolBarSeparator },
- { MEN_EQ4, TRUE, same4_xpm, "4 common notes" },
- { MEN_EQ3, TRUE, same3_xpm, "3 common notes" },
- { MEN_EQ2, TRUE, same2_xpm, "2 common notes" },
- { MEN_EQ1, TRUE, same1_xpm, "1 common note" },
- { MEN_EQ0, TRUE, same0_xpm, "0 common notes" },
- { MEN_EQH, TRUE, sameh_xpm, "one half note difference" },
- { MEN_251, TRUE, std251_xpm, "next in 2-5-1 move" },
- { MEN_EQB, TRUE, sameb_xpm, "same base note" },
- { MEN_TRITONE, TRUE, tritone_xpm, "tritone substitute" },
- { MEN_PIANO, TRUE, piano_xpm, "pianowin copy buffer" },
+ { MEN_EQ4, true, same4_xpm, "4 common notes" },
+ { MEN_EQ3, true, same3_xpm, "3 common notes" },
+ { MEN_EQ2, true, same2_xpm, "2 common notes" },
+ { MEN_EQ1, true, same1_xpm, "1 common note" },
+ { MEN_EQ0, true, same0_xpm, "0 common notes" },
+ { MEN_EQH, true, sameh_xpm, "one half note difference" },
+ { MEN_251, true, std251_xpm, "next in 2-5-1 move" },
+ { MEN_EQB, true, sameb_xpm, "same base note" },
+ { MEN_TRITONE, true, tritone_xpm, "tritone substitute" },
+ { MEN_PIANO, true, piano_xpm, "pianowin copy buffer" },
{ JZToolBar::eToolBarSeparator },
- { MEN_HAUNSCH, TRUE, haunsch_xpm, "haunschild layout" },
+ { MEN_HAUNSCH, true, haunsch_xpm, "haunschild layout" },
{ JZToolBar::eToolBarSeparator },
- { MEN_TRANSPOSE, FALSE, transpos_xpm, "transpose trackwin selection" },
- { MEN_ANALYZE, FALSE, analyze_xpm, "analyze trackwin selection" },
- { MEN_CLEARSEQ, FALSE, delchord_xpm, "clear harmonies" },
+ { MEN_TRANSPOSE, false, transpos_xpm, "transpose trackwin selection" },
+ { MEN_ANALYZE, false, analyze_xpm, "analyze trackwin selection" },
+ { MEN_CLEARSEQ, false, delchord_xpm, "clear harmonies" },
{ JZToolBar::eToolBarEnd }
};
@@ -175,7 +174,7 @@
static int meldy_channel, meldy_veloc;
- static bool mBassEnabled, mChordEnabled, meldy_enabled;
+ static bool mBassEnabled, mChordEnabled, mMeldyEnabled;
static int bass_pitch, chord_pitch, meldy_pitch;
@@ -203,11 +202,11 @@
int HBPlayer::chord_veloc = 90;
int HBPlayer::chord_pitch = 60;
-bool HBPlayer::meldy_enabled = 0;
-int HBPlayer::meldy_channel = 3;
-int HBPlayer::meldy_veloc = 90;
-int HBPlayer::meldy_pitch = 70;
-int HBPlayer::meldy_speed = 100;
+bool HBPlayer::mMeldyEnabled = false;
+int HBPlayer::meldy_channel = 3;
+int HBPlayer::meldy_veloc = 90;
+int HBPlayer::meldy_pitch = 70;
+int HBPlayer::meldy_speed = 100;
HBPlayer::HBPlayer()
@@ -240,7 +239,9 @@
// build bass note
int key = context.ChordKey() + bass_pitch - bass_pitch % 12;
if (key < bass_pitch)
+ {
key += 12;
+ }
return key;
}
@@ -287,7 +288,9 @@
device = gpSong->GetTrack(0)->GetDevice();
if (playing)
+ {
StopPlay();
+ }
playing = 1;
context = ct;
@@ -318,7 +321,7 @@
void HBPlayer::Notify()
{
- if (meldy_enabled)
+ if (mMeldyEnabled)
{
tKeyOff of(0, meldy_channel - 1, meldy_keys[meldy_index]);
gpMidiPlayer->OutNow(device, &of);
@@ -332,7 +335,9 @@
void HBPlayer::StopPlay()
{
if (!playing)
+ {
return;
+ }
Stop();
playing = 0;
@@ -354,7 +359,7 @@
}
}
- if (meldy_enabled)
+ if (mMeldyEnabled)
{
for (i = 0; i < n_meldy_keys; i++)
{
@@ -383,7 +388,7 @@
void HBPlayer::SettingsDialog(wxFrame *parent)
{
#ifdef OBSOLETE
- wxDialogBox *panel = new wxDialogBox(pParent, "MIDI settings", FALSE );
+ wxDialogBox *panel = new wxDialogBox(pParent, "MIDI settings", false );
tHBPlayerForm *form = new tHBPlayerForm;
form->Add(wxMakeFormMessage("Note Length for paste into piano window"));
@@ -412,7 +417,7 @@
form->Add(wxMakeFormNewLine());
#if 0
- form->Add(wxMakeFormBool("Scale enable", &meldy_enabled));
+ form->Add(wxMakeFormBool("Scale enable", &mMeldyEnabled));
form->Add(wxMakeFormNewLine());
form->Add(wxMakeFormShort("Channel", &meldy_channel, wxFORM_DEFAULT, new wxList(wxMakeConstraintRange(1.0, 16.0), 0)));
form->Add(wxMakeFormNewLine());
@@ -427,7 +432,7 @@
form->AssociatePanel(panel);
panel->Fit();
- panel->Show(TRUE);
+ panel->Show(true);
#endif
}
@@ -457,7 +462,7 @@
int SeqDefined()
{
- return n_seq > 0;
+ return mSequenceCount > 0;
}
int GetChordKeys(int *out, int step, int n_steps);
@@ -470,6 +475,10 @@
void SettingsDialog();
+ void ToggleHaunschildLayout();
+
+ void FileLoad();
+
void OnMenuCommand(int id, wxToolBar *mpToolBar);
void TransposeSelection();
@@ -481,7 +490,7 @@
SEQMAX = 256
};
- HBAnalyzer* getAnalyzer();
+ HBAnalyzer* GetAnalyzer();
protected:
@@ -511,7 +520,7 @@
static int analyze_res;
- float xchord, ychord, wchord, hchord;
+ float mChordX, mChordY, mChordWidth, mChordHeight;
float ofs;
@@ -519,15 +528,15 @@
HBContext* seq[SEQMAX];
- int n_seq;
+ int mSequenceCount;
- char* default_filename;
+ std::string mDefaultFileName;
bool has_changed;
HBContext mouse_context;
- bool haunschild_layout;
+ bool mHaunschildLayout;
bool mark_4_common;
@@ -549,11 +558,13 @@
bool mark_piano;
- int active_marker;
+ int active_marker;
DECLARE_EVENT_TABLE()
};
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
tScaleType HBCanvas::scale_type = Major;
const int HBCanvas::ScFa = 50;
int HBCanvas::transpose_res = 8;
@@ -573,10 +584,10 @@
: wxScrolledWindow(pParent, wxID_ANY, wxPoint(x, y), wxSize(w, h))
{
// parent = pParent;
- n_seq = 0;
+ mSequenceCount = 0;
active_marker = 0;
- haunschild_layout = 0;
+ mHaunschildLayout = false;
mark_4_common = 0;
mark_3_common = 0;
mark_2_common = 0;
@@ -589,72 +600,87 @@
mark_piano = 0;
for (int i = 0; i < SEQMAX; i++)
+ {
seq[i] = new HBContext();
+ }
- wxDC *dc = new wxClientDC(this);//GetDC();
+ wxClientDC Dc(this);
- dc->SetFont(*wxSMALL_FONT);
- int tw, th;
- dc->GetTextExtent("xD#j75+9-x", &tw, &th);
+ Dc.SetFont(*wxSMALL_FONT);
+ int TextWidth, TextHeight;
+ Dc.GetTextExtent("xD#j75+9-x", &TextWidth, &TextHeight);
- delete dc;
+ mChordWidth = 1.2 * TextWidth;
+ mChordHeight = 2.5 * TextHeight;
+ mChordX = 50;
+ mChordY = 4 * mChordHeight;
+ ofs = TextHeight / 4;
- wchord = 1.2 * tw;
- hchord = 2.5 * th;
- xchord = 50;
- ychord = 4 * hchord;
- ofs = th/4;
-
- default_filename = copystring("noname.har");
+ mDefaultFileName = "noname.har";
has_changed = false;
- SetScrollbars(0, (int)(hchord + 0.5), 0, 12 + SEQMAX/8 + 2, 0, 4);
+ SetScrollbars(0, (int)(mChordHeight + 0.5), 0, 12 + SEQMAX / 8 + 2, 0, 0);
}
-
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
HBCanvas::~HBCanvas()
{
if (player.IsPlaying())
+ {
player.StopPlay();
+ }
for (int i = 0; i < SEQMAX; i++)
+ {
delete seq[i];
+ }
}
-
-inline ostream & operator << (ostream &os, HBCanvas const &a)
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+ostream & operator << (ostream& Os, HBCanvas const &a)
{
int i;
- os << 1 << endl;
- os << a.n_seq << endl;
- for (i = 0; i < a.n_seq; i++)
- os << *a.seq[i];
- return os;
+ Os << 1 << endl;
+ Os << a.mSequenceCount << endl;
+ for (i = 0; i < a.mSequenceCount; i++)
+ {
+ Os << *a.seq[i];
+ }
+ return Os;
}
-
-inline istream & operator >> (istream &is, HBCanvas &a)
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+istream& operator >> (istream& Is, HBCanvas &a)
{
int i, version;
- is >> version;
- if (version != 1) {
+ Is >> version;
+ if (version != 1)
+ {
wxMessageBox("Wrong file format!", "Error", wxOK);
- return is;
+ return Is;
}
- is >> a.n_seq;
- for (i = 0; i < a.n_seq; i++)
- is >> *a.seq[i];
+ Is >> a.mSequenceCount;
+ for (i = 0; i < a.mSequenceCount; i++)
+ {
+ Is >> *a.seq[i];
+ }
a.Refresh();
- return is;
+ return Is;
}
-
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
void HBCanvas::SetMarker(int id, wxToolBar *mpToolBar)
{
if (id != active_marker)
{
if (active_marker && mpToolBar->GetToolState(active_marker))
- mpToolBar->ToggleTool(active_marker, FALSE);
- mpToolBar->ToggleTool(id, TRUE);
+ {
+ mpToolBar->ToggleTool(active_marker, false);
+ }
+ mpToolBar->ToggleTool(id, true);
active_marker = id;
}
@@ -683,71 +709,82 @@
case MEN_PIANO: mark_piano = 1; break;
}
-#ifndef wx_xt
if (id > 0 && !mpToolBar->GetToolState(id))
- mpToolBar->ToggleTool(id, TRUE);
-#endif
+ {
+ mpToolBar->ToggleTool(id, true);
+ }
Refresh();
-
}
-
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
int HBCanvas::GetChordKeys(int *out, int step, int n_steps)
{
- if (n_seq == 0)
+ if (mSequenceCount == 0)
+ {
return 0;
- int i = step * n_seq / n_steps;
+ }
+ int i = step * mSequenceCount / n_steps;
return player.GetChordKeys(out, *seq[i]);
}
-
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
int HBCanvas::GetSelectedChord(int *out)
{
return player.GetChordKeys(out, mouse_context);
}
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
int HBCanvas::GetSelectedScale(int *out)
{
return player.GetMeldyKeys(out, mouse_context);
}
-
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
int HBCanvas::GetBassKeys(int *out, int step, int n_steps)
{
- if (n_seq == 0)
+ if (mSequenceCount == 0)
+ {
return 0;
- int i = step * n_seq / n_steps;
+ }
+ int i = step * mSequenceCount / n_steps;
out[0] = player.GetBassKey(*seq[i]);
return 1;
}
-
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
void HBCanvas::ChordRect(JZRectangle& Rectangle, const HBContext &ct)
{
if (ct.SeqNr())
{
- Rectangle.x = (int)(xchord + (ct.SeqNr() - 1) % 8 * wchord);
- Rectangle.y = (int)(hchord * ((ct.SeqNr() -1) / 8 + 0.5));
+ Rectangle.x = (int)(mChordX + (ct.SeqNr() - 1) % 8 * mChordWidth);
+ Rectangle.y = (int)(mChordHeight * ((ct.SeqNr() -1) / 8 + 0.5));
}
- else if (!haunschild_layout)
+ else if (!mHaunschildLayout)
{
- Rectangle.x = (int)(xchord + ct.ChordNr() * wchord);
- Rectangle.y = (int)(ychord + ct.ScaleNr() * hchord);
+ Rectangle.x = (int)(mChordX + ct.ChordNr() * mChordWidth);
+ Rectangle.y = (int)(mChordY + ct.ScaleNr() * mChordHeight);
}
else
{
- Rectangle.x = (int)(xchord + (5 * ct.ChordNr() % 7 + 5 * ct.ScaleNr() % 12) % 7 * wchord);
- Rectangle.y = (int)(ychord + (5 * ct.ScaleNr() % 12) * hchord);
+ Rectangle.x = (int)(
+ mChordX + (5 * ct.ChordNr() % 7 + 5 * ct.ScaleNr() % 12) % 7 * mChordWidth);
+ Rectangle.y = (int)(mChordY + (5 * ct.ScaleNr() % 12) * mChordHeight);
}
Rectangle.x += (int)ofs;
Rectangle.y -= (int)ofs;
- Rectangle.width = (int)(wchord - 2 * ofs);
- Rectangle.height = (int)(hchord - 2 * ofs);
+ Rectangle.width = (int)(mChordWidth - 2 * ofs);
+ Rectangle.height = (int)(mChordHeight - 2 * ofs);
}
-
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
void HBCanvas::DrawChord(wxDC& Dc, const HBContext &ct)
{
// Draw the surrounding box.
@@ -763,10 +800,14 @@
int w, h;
const char* pName = ct.ChordName();
Dc.GetTextExtent(pName, &w, &h);
- Dc.DrawText(pName, Rectangle.x + (Rectangle.width - w)/2, Rectangle.y + (Rectangle.height - h)/2);
+ Dc.DrawText(
+ pName,
+ Rectangle.x + (Rectangle.width - w) / 2,
+ Rectangle.y + (Rectangle.height - h) / 2);
}
-
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
void HBCanvas::UnDrawChord(wxDC& Dc, const HBContext& ct)
{
// draw surrounding box
@@ -782,16 +823,22 @@
Dc.SetPen(*wxBLACK_PEN);
}
-
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
void HBCanvas::OnDraw(wxDC& Dc)
{
Dc.Clear();
+
+ Dc.SetFont(*wxSMALL_FONT);
+
Dc.DrawText("Seq", 5, 5);
- ychord = (n_seq/8 + 1) * hchord + (n_seq % 8 ? hchord : 0) + hchord;
+ mChordY =
+ (mSequenceCount / 8 + 1) * mChordHeight + (mSequenceCount % 8 ? mChordHeight : 0) +
+ mChordHeight;
HBContextIterator iter;
- iter.SetSequence(seq, n_seq);
+ iter.SetSequence(seq, mSequenceCount);
iter.SetScaleType(scale_type);
while (iter())
{
@@ -806,14 +853,14 @@
}
DrawMarkers(Dc, mouse_context);
- if (!haunschild_layout)
+ if (!mHaunschildLayout)
{
for (int j = 0; j < 7; j++)
{
HBContext ct(0, j, scale_type);
JZRectangle Rectangle;
ChordRect(Rectangle, ct);
- Rectangle.y -= (int)hchord;
+ Rectangle.y -= (int)mChordHeight;
int w, h;
const char *name = ct.ChordNrName();
@@ -825,7 +872,6 @@
Dc.DrawText((char *)type, Rectangle.x + (Rectangle.width - w)/2, Rectangle.y + (Rectangle.height - h)/2 - h);
}
}
-
}
// -----------------------------------------------------------------------------
@@ -833,30 +879,25 @@
// -----------------------------------------------------------------------------
#ifdef OBSOLETE
-
class HBSettingsForm : public wxForm
{
public:
HBSettingsForm(HBCanvas *c)
: wxForm( USED_WXFORM_BUTTONS )
- { cnvs = c; }
- virtual void OnOk() { cnvs->OnPaint(); wxForm::OnOk(); }
+ { mpHbWindow = c; }
+ virtual void OnOk() { mpHbWindow->OnPaint(); wxForm::OnOk(); }
virtual void OnHelp();
private:
- HBCanvas *cnvs;
+ HBCanvas *mpHbWindow;
};
-
-void HBSettingsForm::OnHelp()
-{
- gpHelpInstance->ShowTopic("Harmony browser");
-}
-
#endif
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
void HBCanvas::SettingsDialog()
{
#ifdef OBSOLETE
- wxDialogBox *panel = new wxDialogBox(this, "settings", FALSE );
+ wxDialogBox *panel = new wxDialogBox(this, "settings", false );
wxForm *form = new HBSettingsForm(this);
panel->SetLabelPosition(wxHORIZONTAL);
@@ -872,23 +913,44 @@
form->AssociatePanel(panel);
panel->Fit();
- panel->Show(TRUE);
+ panel->Show(true);
#endif
}
-// -----------------------------------------------------------------------------
-// HBMatchMarkers
-// -----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+void HBCanvas::ToggleHaunschildLayout()
+{
+ mHaunschildLayout = !mHaunschildLayout;
+ Refresh();
+}
+
+
+
+
+
+//*****************************************************************************
+// HBMatchMarkers
+//*****************************************************************************
class HBMatchMarkers : public HBMatch
{
public:
+
HBMatchMarkers(const HBContext &ct, HBCanvas *cv);
+
virtual bool operator()(const HBContext &);
- const char * GetText() { return msg + 2; } // + 2 for ", "
+
+ const char * GetText()
+ {
+ // + 2 for ", "
+ return msg + 2;
+ }
+
private:
- HBCanvas *cnvs;
+
+ HBCanvas* mpHbWindow;
HBContext context;
HBChord chord;
HBChord scale;
@@ -906,7 +968,7 @@
HBMatchMarkers::HBMatchMarkers(const HBContext &ct, HBCanvas *cv)
: context(ct)
{
- cnvs = cv;
+ mpHbWindow = cv;
chord = context.Chord();
n_chord = chord.Count();
chord_key = context.ChordKey();
@@ -923,14 +985,16 @@
tritone = (chord_key + 6) % 12;
- if (cnvs->mark_piano)
+ if (mpHbWindow->mark_piano)
{
tEventArray &buf = gpTrackFrame->GetPianoWindow()->mPasteBuffer;
for (int i = 0; i < buf.nEvents; i++)
{
tKeyOn *on = buf.Events[i]->IsKeyOn();
if (on)
+ {
piano += on->Key;
+ }
}
}
}
@@ -947,53 +1011,72 @@
msg[0] = 0;
msg[2] = 0;
- if (cnvs->mark_piano && o_chord.Contains(piano))
+ if (mpHbWindow->mark_piano && o_chord.Contains(piano))
+ {
strcat(msg, ", P");
+ }
- if (cnvs->mark_4_common && o_chord == chord)
+ if (mpHbWindow->mark_4_common && o_chord == chord)
+ {
strcat(msg, ", =4");
+ }
- if (cnvs->mark_3_common && n_common == 3)
+ if (mpHbWindow->mark_3_common && n_common == 3)
+ {
strcat(msg, ", =3");
+ }
- if (cnvs->mark_2_common && n_common == 2)
+ if (mpHbWindow->mark_2_common && n_common == 2)
+ {
strcat(msg, ", =2");
+ }
- if (cnvs->mark_1_common && n_common == 1)
+ if (mpHbWindow->mark_1_common && n_common == 1)
+ {
strcat(msg, ", =1");
+ }
- if (cnvs->mark_0_common && n_common == 0)
+ if (mpHbWindow->mark_0_common && n_common == 0)
+ {
strcat(msg, ", =0");
+ }
- if (cnvs->mark_1_semi && n_common == n_chord - 1)
+ if (mpHbWindow->mark_1_semi && n_common == n_chord - 1)
{
HBChord delta = chord ^ o_chord;
int key = delta.Iter(0);
if (delta.Contains(key + 1) || delta.Contains(key - 1))
+ {
strcat(msg, ", 1/2");
+ }
}
- if (cnvs->mark_251 && key251 == o_chord_key)
+ if (mpHbWindow->mark_251 && key251 == o_chord_key)
+ {
strcat(msg, ", 251");
+ }
- if (cnvs->mark_b_common && chord_key == o_chord_key)
+ if (mpHbWindow->mark_b_common && chord_key == o_chord_key)
+ {
strcat(msg, ", =B");
+ }
- if (cnvs->mark_tritone && o_chord_key == tritone)
+ if (mpHbWindow->mark_tritone && o_chord_key == tritone)
+ {
strcat(msg, ", =T");
+ }
-
return msg[2] ? 1 : 0;
}
-void HBCanvas::DrawMarkers(wxDC& Dc, const HBContext &ct)
+void HBCanvas::DrawMarkers(wxDC& Dc, const HBContext& ct)
{
JZRectangle Rectangle;
Dc.SetLogicalFunction(wxXOR);
Dc.SetBrush(*wxTRANSPARENT_BRUSH);
HBMatchMarkers match(ct, this);
HBContextIterator iter(match);
- iter.SetSequence(seq, n_seq);
+ iter.SetSequence(seq, mSequenceCount);
iter.SetScaleType(scale_type);
while (iter())
{
@@ -1002,7 +1085,11 @@
Rectangle.y += 3;
Rectangle.width -= 6;
Rectangle.height -= 6;
- Dc.DrawRectangle(Rectangle.x, Rectangle.y, Rectangle.width, Rectangle.height);
+ Dc.DrawRectangle(
+ Rectangle.x,
+ Rectangle.y,
+ Rectangle.width,
+ Rectangle.height);
}
// invert actual chord
@@ -1010,13 +1097,21 @@
{
Dc.SetBrush(*wxBLACK_BRUSH);
ChordRect(Rectangle, ct);
- Dc.DrawRectangle(Rectangle.x, Rectangle.y, Rectangle.width, Rectangle.height);
+ Dc.DrawRectangle(
+ Rectangle.x,
+ Rectangle.y,
+ Rectangle.width,
+ Rectangle.height);
if (ct.SeqNr() > 0)
{
HBContext c(ct);
c.SetSeqNr(0);
ChordRect(Rectangle, c);
- Dc.DrawRectangle(Rectangle.x, Rectangle.y, Rectangle.width, Rectangle.height);
+ Dc.DrawRectangle(
+ Rectangle.x,
+ Rectangle.y,
+ Rectangle.width,
+ Rectangle.height);
}
}
Dc.SetLogicalFunction(wxCOPY);
@@ -1026,7 +1121,7 @@
bool HBCanvas::Find(float x, float y, HBContext &out)
{
HBContextIterator iter;
- iter.SetSequence(seq, n_seq);
+ iter.SetSequence(seq, mSequenceCount);
iter.SetScaleType(scale_type);
while (iter())
{
@@ -1035,16 +1130,16 @@
if (Rectangle.IsInside((int)x, (int)y))
{
out = iter.Context();
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
void HBCanvas::ClearSeq()
{
- n_seq = 0;
+ mSequenceCount = 0;
mouse_context.SetSeqNr(0);
Refresh();
}
@@ -1053,8 +1148,11 @@
void HBCanvas::OnMouseEvent(wxMouseEvent& MouseEvent)
{
wxClientDC Dc(this);
+
DoPrepareDC(Dc);
+ Dc.SetFont(*wxSMALL_FONT);
+
HBContext context;
int x, y;
MouseEvent.GetPosition(&x, &y);
@@ -1071,26 +1169,26 @@
if (context.SeqNr())
{
// remove a chord
- if (context.SeqNr() == n_seq)
+ if (context.SeqNr() == mSequenceCount)
{
// remove markers first
- if (mouse_context.SeqNr() == n_seq)
+ if (mouse_context.SeqNr() == mSequenceCount)
{
DrawMarkers(Dc, mouse_context);
mouse_context.SetSeqNr(0);
DrawMarkers(Dc, mouse_context);
}
- -- n_seq;
+ --mSequenceCount;
UnDrawChord(Dc, context);
context.SetSeqNr(0);
Refresh();
}
}
- else if (n_seq < SEQMAX)
+ else if (mSequenceCount < SEQMAX)
{
// add a chord
- context.SetSeqNr(n_seq + 1);
- *seq[n_seq ++] = context;
+ context.SetSeqNr(mSequenceCount + 1);
+ *seq[mSequenceCount++] = context;
DrawMarkers(Dc, mouse_context);
DrawChord(Dc, context);
DrawMarkers(Dc, mouse_context);
@@ -1145,11 +1243,11 @@
void HBCanvas::SetScaleType(int menu_id, tScaleType st, wxToolBar *tb)
{
scale_type = st;
- tb->ToggleTool(MEN_MAJSCALE, FALSE);
- tb->ToggleTool(MEN_HARSCALE, FALSE);
- tb->ToggleTool(MEN_MELSCALE, FALSE);
- tb->ToggleTool(MEN_IONSCALE, FALSE);
- tb->ToggleTool(menu_id, TRUE);
+ tb->ToggleTool(MEN_MAJSCALE, false);
+ tb->ToggleTool(MEN_HARSCALE, false);
+ tb->ToggleTool(MEN_MELSCALE, false);
+ tb->ToggleTool(MEN_IONSCALE, false);
+ tb->ToggleTool(menu_id, true);
Refresh();
}
@@ -1164,36 +1262,33 @@
if (gpTrackWindow->EventsSelected("please select destination range in track window"))
{
wxBeginBusyCursor();
- HBAnalyzer analyzer(seq, n_seq);
+ HBAnalyzer analyzer(seq, mSequenceCount);
analyzer.Transpose(gpTrackWindow->mpFilter, transpose_res);
wxEndBusyCursor();
}
}
+void HBCanvas::FileLoad()
+{
+ wxString FileName = file_selector(
+ mDefaultFileName.c_str(),
+ "Load Harmonies",
+ false,
+ has_changed,
+ "*.har");
+
+ ifstream Is(FileName.c_str());
+ Is >> *this;
+}
+
void HBCanvas::OnMenuCommand(int id, wxToolBar *mpToolBar)
{
switch (id)
{
- case MEN_LOAD:
- {
- wxString fname = file_selector(
- default_filename,
- "Load Harmonies",
- false,
- has_changed,
- "*.har");
- if (fname)
- {
- ifstream is(fname);
- is >> *this;
- }
- }
- break;
-
case MEN_SAVE:
{
wxString fname = file_selector(
- default_filename,
+ mDefaultFileName.c_str(),
"Save Harmonies",
true,
has_changed,
@@ -1222,17 +1317,12 @@
SetScaleType(id, Ionb13, mpToolBar);
break;
- case MEN_HAUNSCH:
- haunschild_layout = !haunschild_layout;
- Refresh();
- break;
-
case MEN_ANALYZE:
if (gpTrackWindow->EventsSelected("please select source range in track window"))
{
wxBeginBusyCursor();
HBAnalyzer analyzer(seq, (int)SEQMAX);
- n_seq = analyzer.Analyze(gpTrackWindow->mpFilter, analyze_res);
+ mSequenceCount = analyzer.Analyze(gpTrackWindow->mpFilter, analyze_res);
Refresh();
wxEndBusyCursor();
}
@@ -1254,11 +1344,11 @@
}
-HBAnalyzer * HBCanvas::getAnalyzer()
+HBAnalyzer * HBCanvas::GetAnalyzer()
{
- if (n_seq > 0 && gpTrackWindow->mpSnapSel->Selected)
+ if (mSequenceCount > 0 && gpTrackWindow->mpSnapSel->Selected)
{
- HBAnalyzer *analyzer = new HBAnalyzer(seq, n_seq);
+ HBAnalyzer *analyzer = new HBAnalyzer(seq, mSequenceCount);
analyzer->Init(gpTrackWindow->mpFilter, transpose_res);
return analyzer;
}
@@ -1371,7 +1461,7 @@
private:
- HBCanvas *cnvs;
+ HBCanvas* mpHbWindow;
wxCheckBox *chord_chk[12];
wxCheckBox *scale_chk[12];
wxListBox *chord_lst;
@@ -1401,7 +1491,7 @@
{
int i;
- cnvs = c;
+ mpHbWindow = c;
pcontext = pct;
chord = pcontext->Chord();
scale = pcontext->Scale();
@@ -1427,15 +1517,32 @@
int h = 40;
int y = 80;
- const char *notename[12] = { "1", 0, "9", 0, "3", "11", 0, "5", 0, "13", 0, "7" };
+ const char* notename[12] =
+ {
+ "1",
+ 0,
+ "9",
+ 0,
+ "3",
+ "11",
+ 0,
+ "5",
+ 0,
+ "13",
+ 0,
+ "7"
+ };
+
for (i = 0; i < 12; i++)
{
int x = w * i + 10;
- chord_chk[i] = new wxCheckBox(this, -1, " ", wxPoint(x, y+1*h));//(wxFunction)ChordCheck,
- scale_chk[i] = new wxCheckBox(this, -1, " ", wxPoint(x, y+2*h));//(wxFunction)ScaleCheck,
+ chord_chk[i] = new wxCheckBox(this, wxID_ANY, " ", wxPoint(x, y+1*h));//(wxFunction)ChordCheck,
+ scale_chk[i] = new wxCheckBox(this, wxID_ANY, " ", wxPoint(x, y+2*h));//(wxFunction)ScaleCheck,
if (notename[i])
- (void) new wxStaticText(this, -1, (char *)notename[i], wxPoint(x, y+3*h));
- (void) new wxStaticText(this, -1, (char *)HBChord::ScaleName(i + chord_key), wxPoint(x, y+0*h));
+ {
+ (void) new wxStaticText(this, wxID_ANY, (char *)notename[i], wxPoint(x, y+3*h));
+ }
+ (void) new wxStaticText(this, wxID_ANY, (char *)HBChord::ScaleName(i + chord_key), wxPoint(x, y+0*h));
}
y += 4*h;
@@ -1447,7 +1554,9 @@
wxString* cnames = new wxString[n_chord_names];
for (i = 0; i < n_chord_names; i++)
+ {
cnames[i] = (char *)chord_names[i].name;
+ }
chord_lst = new wxListBox(this, -1, wxPoint(10, y), wxSize(100, 200), n_chord_names, cnames, wxLB_SINGLE| wxLB_NEEDED_SB);//"Chords"
@@ -1455,20 +1564,32 @@
wxString* snames = new wxString[n_scale_names];
for (i = 0; i < n_scale_names; i++)
+ {
snames[i] = (char *)scale_names[i].name;
- scale_lst = new wxListBox(this, -1, wxPoint(200, y), wxSize(300, 200), n_scale_names, snames, wxLB_SINGLE| wxLB_NEEDED_SB);//"Scales",
+ }
+ scale_lst = new wxListBox(
+ ...
[truncated message content] |
|
From: <pst...@us...> - 2008-04-07 04:54:18
|
Revision: 437
http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=437&view=rev
Author: pstieber
Date: 2008-04-06 21:54:17 -0700 (Sun, 06 Apr 2008)
Log Message:
-----------
Added a Save As... capability.
Modified Paths:
--------------
trunk/jazz/src/Harmony.cpp
trunk/jazz/src/Harmony.h
Modified: trunk/jazz/src/Harmony.cpp
===================================================================
--- trunk/jazz/src/Harmony.cpp 2008-04-07 04:49:52 UTC (rev 436)
+++ trunk/jazz/src/Harmony.cpp 2008-04-07 04:54:17 UTC (rev 437)
@@ -44,7 +44,6 @@
using namespace std;
-#define MEN_CLOSE 1
#define MEN_MIDI 2
#define MEN_TRANSPOSE 4
#define MEN_CLEARSEQ 6
@@ -71,7 +70,6 @@
#define MEN_IONSCALE 25
#define MEN_SETTINGS 26
#define MEN_LOAD 27
-#define MEN_SAVE 28
#include "Bitmaps/open.xpm"
@@ -99,7 +97,7 @@
static JZToolDef tdefs[] =
{
{ MEN_LOAD, false, open_xpm, "open harmony file" },
- { MEN_SAVE, false, save_xpm, "save harmony file" },
+ { wxID_SAVEAS, false, save_xpm, "save harmony file" },
{ JZToolBar::eToolBarSeparator },
{ MEN_MAJSCALE, true, majscale_xpm, "major scale" },
{ MEN_HARSCALE, true, harscale_xpm, "harmonic scale" },
@@ -479,6 +477,8 @@
void FileLoad();
+ void FileSaveAs();
+
void OnMenuCommand(int id, wxToolBar *mpToolBar);
void TransposeSelection();
@@ -522,17 +522,15 @@
float mChordX, mChordY, mChordWidth, mChordHeight;
- float ofs;
+ int mMargin;
-// wxFrame* parent;
-
HBContext* seq[SEQMAX];
int mSequenceCount;
std::string mDefaultFileName;
- bool has_changed;
+ bool mHasChanged;
HBContext mouse_context;
@@ -614,10 +612,15 @@
mChordHeight = 2.5 * TextHeight;
mChordX = 50;
mChordY = 4 * mChordHeight;
- ofs = TextHeight / 4;
+ mMargin = TextHeight / 4;
+ if (mMargin <= 0)
+ {
+ mMargin = 1;
+ }
+
mDefaultFileName = "noname.har";
- has_changed = false;
+ mHasChanged = false;
SetScrollbars(0, (int)(mChordHeight + 0.5), 0, 12 + SEQMAX / 8 + 2, 0, 0);
}
@@ -777,10 +780,10 @@
Rectangle.y = (int)(mChordY + (5 * ct.ScaleNr() % 12) * mChordHeight);
}
- Rectangle.x += (int)ofs;
- Rectangle.y -= (int)ofs;
- Rectangle.width = (int)(mChordWidth - 2 * ofs);
- Rectangle.height = (int)(mChordHeight - 2 * ofs);
+ Rectangle.x += mMargin;
+ Rectangle.y -= mMargin;
+ Rectangle.width = (int)(mChordWidth - 2 * mMargin);
+ Rectangle.height = (int)(mChordHeight - 2 * mMargin);
}
//-----------------------------------------------------------------------------
@@ -1274,33 +1277,36 @@
mDefaultFileName.c_str(),
"Load Harmonies",
false,
- has_changed,
+ mHasChanged,
"*.har");
- ifstream Is(FileName.c_str());
- Is >> *this;
+ if (!FileName.empty())
+ {
+ ifstream Is(FileName.c_str());
+ Is >> *this;
+ }
}
+void HBCanvas::FileSaveAs()
+{
+ wxString FileName = file_selector(
+ mDefaultFileName.c_str(),
+ "Save Harmonies",
+ true,
+ mHasChanged,
+ "*.har");
+
+ if (!FileName.empty())
+ {
+ ofstream os(FileName.c_str());
+ os << *this;
+ }
+}
+
void HBCanvas::OnMenuCommand(int id, wxToolBar *mpToolBar)
{
switch (id)
{
- case MEN_SAVE:
- {
- wxString fname = file_selector(
- mDefaultFileName.c_str(),
- "Save Harmonies",
- true,
- has_changed,
- "*.har");
- if (fname)
- {
- ofstream os(fname);
- os << *this;
- }
- }
- break;
-
case MEN_MAJSCALE:
SetScaleType(id, Major, mpToolBar);
break;
@@ -1770,6 +1776,8 @@
EVT_MENU(MEN_LOAD, HBFrame::OnFileLoad)
+ EVT_MENU(wxID_SAVEAS, HBFrame::OnFileSaveAs)
+
EVT_MENU(MEN_MIDI, HBFrame::OnSettingsMidi)
EVT_MENU(MEN_HAUNSCH, HBFrame::OnSettingsHaunschild)
@@ -1801,8 +1809,8 @@
wxMenu* pFileMenu = new wxMenu;
pFileMenu->Append(MEN_LOAD, "&Load...");
- pFileMenu->Append(MEN_SAVE, "&Save");
- pFileMenu->Append(MEN_CLOSE, "&Close");
+ pFileMenu->Append(wxID_SAVEAS, "Save &As...");
+ pFileMenu->Append(wxID_CLOSE, "&Close");
wxMenu* pSettingsMenu = new wxMenu;
pSettingsMenu->Append(MEN_EDIT, "&Chord");
@@ -1943,8 +1951,7 @@
mpHbWindow->seq[mpHbWindow->mouse_context.SeqNr() - 1]);
break;
- case MEN_CLOSE:
-// DELETE_THIS();
+ case wxID_CLOSE:
Destroy();
break;
@@ -1977,6 +1984,13 @@
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
+void HBFrame::OnFileSaveAs(wxCommandEvent& Event)
+{
+ mpHbWindow->FileSaveAs();
+}
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
void HBFrame::OnActionClearSequence(wxCommandEvent& Event)
{
mpHbWindow->ClearSeq();
Modified: trunk/jazz/src/Harmony.h
===================================================================
--- trunk/jazz/src/Harmony.h 2008-04-07 04:49:52 UTC (rev 436)
+++ trunk/jazz/src/Harmony.h 2008-04-07 04:54:17 UTC (rev 437)
@@ -69,13 +69,13 @@
int SeqDefined();
- int GetChordKeys(int *out, int step, int n_steps);
+ int GetChordKeys(int* out, int step, int n_steps);
- int GetSelectedChord(int *out);
+ int GetSelectedChord(int* out);
- int GetSelectedScale(int *out);
+ int GetSelectedScale(int* out);
- int GetBassKeys(int *out, int step, int n_steps);
+ int GetBassKeys(int* out, int step, int n_steps);
HBAnalyzer* GetAnalyzer();
@@ -89,6 +89,8 @@
void OnFileLoad(wxCommandEvent& Event);
+ void OnFileSaveAs(wxCommandEvent& Event);
+
void OnSettingsMidi(wxCommandEvent& Event);
void OnSettingsHaunschild(wxCommandEvent& Event);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pst...@us...> - 2008-04-07 06:14:58
|
Revision: 438
http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=438&view=rev
Author: pstieber
Date: 2008-04-06 23:14:55 -0700 (Sun, 06 Apr 2008)
Log Message:
-----------
1. Fixed some save as menu entries.
2. Added more harmony browser functionality. The DrawMarkers logic is incorrect,
but I'm close.
Modified Paths:
--------------
trunk/jazz/src/Harmony.cpp
trunk/jazz/src/Harmony.h
trunk/jazz/src/SampleWindow.cpp
trunk/jazz/src/TrackFrame.cpp
Modified: trunk/jazz/src/Harmony.cpp
===================================================================
--- trunk/jazz/src/Harmony.cpp 2008-04-07 04:54:17 UTC (rev 437)
+++ trunk/jazz/src/Harmony.cpp 2008-04-07 06:14:55 UTC (rev 438)
@@ -69,7 +69,6 @@
#define MEN_ANALYZE 24
#define MEN_IONSCALE 25
#define MEN_SETTINGS 26
-#define MEN_LOAD 27
#include "Bitmaps/open.xpm"
@@ -96,7 +95,7 @@
static JZToolDef tdefs[] =
{
- { MEN_LOAD, false, open_xpm, "open harmony file" },
+ { wxID_OPEN, false, open_xpm, "open harmony file" },
{ wxID_SAVEAS, false, save_xpm, "save harmony file" },
{ JZToolBar::eToolBarSeparator },
{ MEN_MAJSCALE, true, majscale_xpm, "major scale" },
@@ -151,7 +150,7 @@
const HBContext& Context()
{
- return context;
+ return mContext;
}
virtual void Notify();
@@ -164,7 +163,7 @@
private:
- HBContext context;
+ HBContext mContext;
static int bass_channel, bass_veloc;
@@ -217,10 +216,10 @@
}
-int HBPlayer::GetChordKeys(int *out, const HBContext &context)
+int HBPlayer::GetChordKeys(int *out, const HBContext& Context)
{
// build chord keys
- HBChord chord = context.Chord();
+ HBChord chord = Context.Chord();
int key = chord.Iter(chord_pitch - 1);
int n = chord.Count();
for (int i = 0; i < n; i++)
@@ -232,10 +231,10 @@
}
-int HBPlayer::GetBassKey(const HBContext &context)
+int HBPlayer::GetBassKey(const HBContext& Context)
{
// build bass note
- int key = context.ChordKey() + bass_pitch - bass_pitch % 12;
+ int key = Context.ChordKey() + bass_pitch - bass_pitch % 12;
if (key < bass_pitch)
{
key += 12;
@@ -244,10 +243,10 @@
}
-int HBPlayer::GetMeldyKeys(int *out, const HBContext &context)
+int HBPlayer::GetMeldyKeys(int *out, const HBContext &Context)
{
// build melody keys
- HBChord scale = context.Scale();
+ HBChord scale = Context.Scale();
int n = scale.Count();
int key = scale.Iter(meldy_pitch);
@@ -279,7 +278,7 @@
}
-void HBPlayer::StartPlay(const HBContext &ct)
+void HBPlayer::StartPlay(const HBContext& Context)
{
int i;
@@ -290,11 +289,11 @@
StopPlay();
}
playing = 1;
- context = ct;
+ mContext = Context;
- bass_key = GetBassKey(context);
- n_chord_keys = GetChordKeys(chord_keys, context);
- n_meldy_keys = GetMeldyKeys(meldy_keys, context);
+ bass_key = GetBassKey(mContext);
+ n_chord_keys = GetChordKeys(chord_keys, mContext);
+ n_meldy_keys = GetMeldyKeys(meldy_keys, mContext);
// Generate KeyOn's
if (mBassEnabled)
@@ -454,11 +453,11 @@
virtual void OnDraw(wxDC& Dc);
- void DrawMarkers(wxDC& Dc, const HBContext &c);
+ void DrawMarkers(wxDC& Dc, const HBContext& Context);
void ClearSeq();
- int SeqDefined()
+ bool IsSequenceDefined()
{
return mSequenceCount > 0;
}
@@ -479,7 +478,7 @@
void FileSaveAs();
- void OnMenuCommand(int id, wxToolBar *mpToolBar);
+ void MenuCommand(int MenuId, wxToolBar *mpToolBar);
void TransposeSelection();
@@ -496,11 +495,11 @@
static const int ScFa;
- void ChordRect(JZRectangle& Rectangle, const HBContext &ct);
+ void ChordRect(JZRectangle& Rectangle, const HBContext& Context);
- void DrawChord(wxDC& Dc, const HBContext &ct);
+ void DrawChord(wxDC& Dc, const HBContext& Context);
- void UnDrawChord(wxDC& Dc, const HBContext &ct);
+ void UnDrawChord(wxDC& Dc, const HBContext& Context);
bool Find(float x, float y, HBContext &out);
@@ -508,13 +507,13 @@
virtual void OnMouseEvent(wxMouseEvent& MouseEvent);
- void SetMarker(int id, wxToolBar *mpToolBar);
+ void SetMarker(int MenuId, wxToolBar* pToolBar);
- void SetScaleType(int menu_id, tScaleType st, wxToolBar *tb);
+ void SetScaleType(int MenuId, tScaleType ScaleType, wxToolBar* pToolBar);
private:
- static tScaleType scale_type;
+ static tScaleType mScaleType;
static int transpose_res;
@@ -524,7 +523,7 @@
int mMargin;
- HBContext* seq[SEQMAX];
+ HBContext* mSequence[SEQMAX];
int mSequenceCount;
@@ -532,38 +531,38 @@
bool mHasChanged;
- HBContext mouse_context;
+ HBContext mMouseContext;
bool mHaunschildLayout;
- bool mark_4_common;
+ bool mMark4Common;
- bool mark_3_common;
+ bool mMark3Common;
- bool mark_2_common;
+ bool mMark2Common;
- bool mark_1_common;
+ bool mMark1Common;
- bool mark_b_common;
+ bool mMarkBCommon;
- bool mark_0_common;
+ bool mMark0Common;
- bool mark_1_semi;
+ bool mMark1Semi;
- bool mark_251;
+ bool mMark251;
- bool mark_tritone;
+ bool mMarkTritone;
- bool mark_piano;
+ bool mMarkPiano;
- int active_marker;
+ int mActiveMarker;
DECLARE_EVENT_TABLE()
};
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-tScaleType HBCanvas::scale_type = Major;
+tScaleType HBCanvas::mScaleType = Major;
const int HBCanvas::ScFa = 50;
int HBCanvas::transpose_res = 8;
int HBCanvas::analyze_res = 8;
@@ -581,25 +580,24 @@
HBCanvas::HBCanvas(wxFrame* pParent, int x, int y, int w, int h)
: wxScrolledWindow(pParent, wxID_ANY, wxPoint(x, y), wxSize(w, h))
{
-// parent = pParent;
mSequenceCount = 0;
- active_marker = 0;
+ mActiveMarker = 0;
mHaunschildLayout = false;
- mark_4_common = 0;
- mark_3_common = 0;
- mark_2_common = 0;
- mark_1_common = 0;
- mark_b_common = 0;
- mark_0_common = 0;
- mark_1_semi = 0;
- mark_251 = 0;
- mark_tritone = 0;
- mark_piano = 0;
+ mMark4Common = false;
+ mMark3Common = false;
+ mMark2Common = false;
+ mMark1Common = false;
+ mMarkBCommon = false;
+ mMark0Common = false;
+ mMark1Semi = false;
+ mMark251 = false;
+ mMarkTritone = false;
+ mMarkPiano = false;
for (int i = 0; i < SEQMAX; i++)
{
- seq[i] = new HBContext();
+ mSequence[i] = new HBContext();
}
wxClientDC Dc(this);
@@ -635,7 +633,7 @@
}
for (int i = 0; i < SEQMAX; i++)
{
- delete seq[i];
+ delete mSequence[i];
}
}
@@ -648,7 +646,7 @@
Os << a.mSequenceCount << endl;
for (i = 0; i < a.mSequenceCount; i++)
{
- Os << *a.seq[i];
+ Os << *a.mSequence[i];
}
return Os;
}
@@ -667,7 +665,7 @@
Is >> a.mSequenceCount;
for (i = 0; i < a.mSequenceCount; i++)
{
- Is >> *a.seq[i];
+ Is >> *a.mSequence[i];
}
a.Refresh();
return Is;
@@ -675,46 +673,66 @@
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-void HBCanvas::SetMarker(int id, wxToolBar *mpToolBar)
+void HBCanvas::SetMarker(int MenuId, wxToolBar* pToolBar)
{
- if (id != active_marker)
+ if (MenuId != mActiveMarker)
{
- if (active_marker && mpToolBar->GetToolState(active_marker))
+ if (mActiveMarker && pToolBar->GetToolState(mActiveMarker))
{
- mpToolBar->ToggleTool(active_marker, false);
+ pToolBar->ToggleTool(mActiveMarker, false);
}
- mpToolBar->ToggleTool(id, true);
- active_marker = id;
+ pToolBar->ToggleTool(MenuId, true);
+ mActiveMarker = MenuId;
}
- mark_4_common = 0;
- mark_3_common = 0;
- mark_2_common = 0;
- mark_1_common = 0;
- mark_b_common = 0;
- mark_0_common = 0;
- mark_1_semi = 0;
- mark_251 = 0;
- mark_tritone = 0;
- mark_piano = 0;
+ mMark4Common = false;
+ mMark3Common = false;
+ mMark2Common = false;
+ mMark1Common = false;
+ mMarkBCommon = false;
+ mMark0Common = false;
+ mMark1Semi = false;
+ mMark251 = false;
+ mMarkTritone = false;
+ mMarkPiano = false;
- switch (id)
+ switch (MenuId)
{
- case MEN_EQ4: mark_4_common = 1; break;
- case MEN_EQ3: mark_3_common = 1; break;
- case MEN_EQ2: mark_2_common = 1; break;
- case MEN_EQ1: mark_1_common = 1; break;
- case MEN_EQB: mark_b_common = 1; break;
- case MEN_EQH: mark_1_semi = 1; break;
- case MEN_EQ0: mark_0_common = 1; break;
- case MEN_251: mark_251 = 1; break;
- case MEN_TRITONE: mark_tritone = 1; break;
- case MEN_PIANO: mark_piano = 1; break;
+ case MEN_EQ4:
+ mMark4Common = true;
+ break;
+ case MEN_EQ3:
+ mMark3Common = true;
+ break;
+ case MEN_EQ2:
+ mMark2Common = true;
+ break;
+ case MEN_EQ1:
+ mMark1Common = true;
+ break;
+ case MEN_EQB:
+ mMarkBCommon = true;
+ break;
+ case MEN_EQH:
+ mMark1Semi = true;
+ break;
+ case MEN_EQ0:
+ mMark0Common = true;
+ break;
+ case MEN_251:
+ mMark251 = true;
+ break;
+ case MEN_TRITONE:
+ mMarkTritone = true;
+ break;
+ case MEN_PIANO:
+ mMarkPiano = true;
+ break;
}
- if (id > 0 && !mpToolBar->GetToolState(id))
+ if (MenuId > 0 && !pToolBar->GetToolState(MenuId))
{
- mpToolBar->ToggleTool(id, true);
+ pToolBar->ToggleTool(MenuId, true);
}
Refresh();
@@ -729,21 +747,21 @@
return 0;
}
int i = step * mSequenceCount / n_steps;
- return player.GetChordKeys(out, *seq[i]);
+ return player.GetChordKeys(out, *mSequence[i]);
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
int HBCanvas::GetSelectedChord(int *out)
{
- return player.GetChordKeys(out, mouse_context);
+ return player.GetChordKeys(out, mMouseContext);
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
int HBCanvas::GetSelectedScale(int *out)
{
- return player.GetMeldyKeys(out, mouse_context);
+ return player.GetMeldyKeys(out, mMouseContext);
}
//-----------------------------------------------------------------------------
@@ -755,29 +773,30 @@
return 0;
}
int i = step * mSequenceCount / n_steps;
- out[0] = player.GetBassKey(*seq[i]);
+ out[0] = player.GetBassKey(*mSequence[i]);
return 1;
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-void HBCanvas::ChordRect(JZRectangle& Rectangle, const HBContext &ct)
+void HBCanvas::ChordRect(JZRectangle& Rectangle, const HBContext& Context)
{
- if (ct.SeqNr())
+ if (Context.SeqNr())
{
- Rectangle.x = (int)(mChordX + (ct.SeqNr() - 1) % 8 * mChordWidth);
- Rectangle.y = (int)(mChordHeight * ((ct.SeqNr() -1) / 8 + 0.5));
+ Rectangle.x = (int)(mChordX + (Context.SeqNr() - 1) % 8 * mChordWidth);
+ Rectangle.y = (int)(mChordHeight * ((Context.SeqNr() -1) / 8 + 0.5));
}
else if (!mHaunschildLayout)
{
- Rectangle.x = (int)(mChordX + ct.ChordNr() * mChordWidth);
- Rectangle.y = (int)(mChordY + ct.ScaleNr() * mChordHeight);
+ Rectangle.x = (int)(mChordX + Context.ChordNr() * mChordWidth);
+ Rectangle.y = (int)(mChordY + Context.ScaleNr() * mChordHeight);
}
else
{
Rectangle.x = (int)(
- mChordX + (5 * ct.ChordNr() % 7 + 5 * ct.ScaleNr() % 12) % 7 * mChordWidth);
- Rectangle.y = (int)(mChordY + (5 * ct.ScaleNr() % 12) * mChordHeight);
+ mChordX + (5 * Context.ChordNr() % 7 +
+ 5 * Context.ScaleNr() % 12) % 7 * mChordWidth);
+ Rectangle.y = (int)(mChordY + (5 * Context.ScaleNr() % 12) * mChordHeight);
}
Rectangle.x += mMargin;
@@ -788,11 +807,11 @@
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-void HBCanvas::DrawChord(wxDC& Dc, const HBContext &ct)
+void HBCanvas::DrawChord(wxDC& Dc, const HBContext& Context)
{
// Draw the surrounding box.
JZRectangle Rectangle;
- ChordRect(Rectangle, ct);
+ ChordRect(Rectangle, Context);
Dc.DrawRectangle(
Rectangle.x,
@@ -801,7 +820,7 @@
Rectangle.height);
int w, h;
- const char* pName = ct.ChordName();
+ const char* pName = Context.ChordName();
Dc.GetTextExtent(pName, &w, &h);
Dc.DrawText(
pName,
@@ -811,11 +830,11 @@
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-void HBCanvas::UnDrawChord(wxDC& Dc, const HBContext& ct)
+void HBCanvas::UnDrawChord(wxDC& Dc, const HBContext& Context)
{
// draw surrounding box
JZRectangle Rectangle;
- ChordRect(Rectangle, ct);
+ ChordRect(Rectangle, Context);
Dc.SetPen(*wxWHITE_PEN);
Dc.DrawRectangle(
@@ -837,44 +856,52 @@
Dc.DrawText("Seq", 5, 5);
mChordY =
- (mSequenceCount / 8 + 1) * mChordHeight + (mSequenceCount % 8 ? mChordHeight : 0) +
+ (mSequenceCount / 8 + 1) * mChordHeight +
+ (mSequenceCount % 8 ? mChordHeight : 0) +
mChordHeight;
HBContextIterator iter;
- iter.SetSequence(seq, mSequenceCount);
- iter.SetScaleType(scale_type);
+ iter.SetSequence(mSequence, mSequenceCount);
+ iter.SetScaleType(mScaleType);
while (iter())
{
- const HBContext &ct = iter.Context();
- DrawChord(Dc, ct);
- if (ct.ChordNr() == 0 && ct.SeqNr() == 0)
+ const HBContext& Context = iter.Context();
+ DrawChord(Dc, Context);
+ if (Context.ChordNr() == 0 && Context.SeqNr() == 0)
{
JZRectangle Rectangle;
- ChordRect(Rectangle, ct);
- Dc.DrawText(ct.ScaleName(), 5, Rectangle.y);
+ ChordRect(Rectangle, Context);
+ Dc.DrawText(Context.ScaleName(), 5, Rectangle.y);
}
}
- DrawMarkers(Dc, mouse_context);
-
+ DrawMarkers(Dc, mMouseContext);
+/*
if (!mHaunschildLayout)
{
for (int j = 0; j < 7; j++)
{
- HBContext ct(0, j, scale_type);
+ HBContext Context(0, j, mScaleType);
JZRectangle Rectangle;
- ChordRect(Rectangle, ct);
+ ChordRect(Rectangle, Context);
Rectangle.y -= (int)mChordHeight;
int w, h;
- const char *name = ct.ChordNrName();
- Dc.GetTextExtent(name, &w, &h);
- Dc.DrawText((char *)name, Rectangle.x + (Rectangle.width - w)/2, Rectangle.y + (Rectangle.height - h)/2);
+ const char* pName = Context.ChordNrName();
+ Dc.GetTextExtent(pName, &w, &h);
+ Dc.DrawText(
+ pName,
+ Rectangle.x + (Rectangle.width - w) / 2,
+ Rectangle.y + (Rectangle.height - h) / 2);
- const char *type = ct.ContextName();
- Dc.GetTextExtent(type, &w, &h);
- Dc.DrawText((char *)type, Rectangle.x + (Rectangle.width - w)/2, Rectangle.y + (Rectangle.height - h)/2 - h);
+ const char* pType = Context.ContextName();
+ Dc.GetTextExtent(pType, &w, &h);
+ Dc.DrawText(
+ pType,
+ Rectangle.x + (Rectangle.width - w) / 2,
+ Rectangle.y + (Rectangle.height - h) / 2 - h);
}
}
+ */
}
// -----------------------------------------------------------------------------
@@ -941,7 +968,7 @@
{
public:
- HBMatchMarkers(const HBContext &ct, HBCanvas *cv);
+ HBMatchMarkers(const HBContext& Context, HBCanvas *cv);
virtual bool operator()(const HBContext &);
@@ -954,7 +981,7 @@
private:
HBCanvas* mpHbWindow;
- HBContext context;
+ HBContext mContext;
HBChord chord;
HBChord scale;
int n_chord;
@@ -968,27 +995,27 @@
};
-HBMatchMarkers::HBMatchMarkers(const HBContext &ct, HBCanvas *cv)
- : context(ct)
+HBMatchMarkers::HBMatchMarkers(const HBContext& Context, HBCanvas *cv)
+ : mContext(Context)
{
mpHbWindow = cv;
- chord = context.Chord();
+ chord = mContext.Chord();
n_chord = chord.Count();
- chord_key = context.ChordKey();
- scale = context.Scale();
+ chord_key = mContext.ChordKey();
+ scale = mContext.Scale();
msg[0] = 0;
msg[2] = 0;
{
// 251-move
- HBContext tmp(ct.ScaleNr(), ct.ChordNr() + 3, ct.ScaleType());
+ HBContext tmp(Context.ScaleNr(), Context.ChordNr() + 3, Context.ScaleType());
key251 = tmp.ChordKey();
}
tritone = (chord_key + 6) % 12;
- if (mpHbWindow->mark_piano)
+ if (mpHbWindow->mMarkPiano && gpTrackFrame->GetPianoWindow())
{
tEventArray &buf = gpTrackFrame->GetPianoWindow()->mPasteBuffer;
for (int i = 0; i < buf.nEvents; i++)
@@ -1014,37 +1041,37 @@
msg[0] = 0;
msg[2] = 0;
- if (mpHbWindow->mark_piano && o_chord.Contains(piano))
+ if (mpHbWindow->mMarkPiano && o_chord.Contains(piano))
{
strcat(msg, ", P");
}
- if (mpHbWindow->mark_4_common && o_chord == chord)
+ if (mpHbWindow->mMark4Common && o_chord == chord)
{
strcat(msg, ", =4");
}
- if (mpHbWindow->mark_3_common && n_common == 3)
+ if (mpHbWindow->mMark3Common && n_common == 3)
{
strcat(msg, ", =3");
}
- if (mpHbWindow->mark_2_common && n_common == 2)
+ if (mpHbWindow->mMark2Common && n_common == 2)
{
strcat(msg, ", =2");
}
- if (mpHbWindow->mark_1_common && n_common == 1)
+ if (mpHbWindow->mMark1Common && n_common == 1)
{
strcat(msg, ", =1");
}
- if (mpHbWindow->mark_0_common && n_common == 0)
+ if (mpHbWindow->mMark0Common && n_common == 0)
{
strcat(msg, ", =0");
}
- if (mpHbWindow->mark_1_semi && n_common == n_chord - 1)
+ if (mpHbWindow->mMark1Semi && n_common == n_chord - 1)
{
HBChord delta = chord ^ o_chord;
int key = delta.Iter(0);
@@ -1054,17 +1081,17 @@
}
}
- if (mpHbWindow->mark_251 && key251 == o_chord_key)
+ if (mpHbWindow->mMark251 && key251 == o_chord_key)
{
strcat(msg, ", 251");
}
- if (mpHbWindow->mark_b_common && chord_key == o_chord_key)
+ if (mpHbWindow->mMarkBCommon && chord_key == o_chord_key)
{
strcat(msg, ", =B");
}
- if (mpHbWindow->mark_tritone && o_chord_key == tritone)
+ if (mpHbWindow->mMarkTritone && o_chord_key == tritone)
{
strcat(msg, ", =T");
}
@@ -1072,15 +1099,15 @@
return msg[2] ? 1 : 0;
}
-void HBCanvas::DrawMarkers(wxDC& Dc, const HBContext& ct)
+void HBCanvas::DrawMarkers(wxDC& Dc, const HBContext& Context)
{
JZRectangle Rectangle;
Dc.SetLogicalFunction(wxXOR);
Dc.SetBrush(*wxTRANSPARENT_BRUSH);
- HBMatchMarkers match(ct, this);
+ HBMatchMarkers match(Context, this);
HBContextIterator iter(match);
- iter.SetSequence(seq, mSequenceCount);
- iter.SetScaleType(scale_type);
+ iter.SetSequence(mSequence, mSequenceCount);
+ iter.SetScaleType(mScaleType);
while (iter())
{
ChordRect(Rectangle, iter.Context());
@@ -1095,19 +1122,19 @@
Rectangle.height);
}
- // invert actual chord
- if (ct.ScaleType() == scale_type)
+ // Invert the actual chord.
+ if (Context.ScaleType() == mScaleType)
{
Dc.SetBrush(*wxBLACK_BRUSH);
- ChordRect(Rectangle, ct);
+ ChordRect(Rectangle, Context);
Dc.DrawRectangle(
Rectangle.x,
Rectangle.y,
Rectangle.width,
Rectangle.height);
- if (ct.SeqNr() > 0)
+ if (Context.SeqNr() > 0)
{
- HBContext c(ct);
+ HBContext c(Context);
c.SetSeqNr(0);
ChordRect(Rectangle, c);
Dc.DrawRectangle(
@@ -1117,6 +1144,7 @@
Rectangle.height);
}
}
+
Dc.SetLogicalFunction(wxCOPY);
Dc.SetBrush(*wxWHITE_BRUSH);
}
@@ -1124,8 +1152,8 @@
bool HBCanvas::Find(float x, float y, HBContext &out)
{
HBContextIterator iter;
- iter.SetSequence(seq, mSequenceCount);
- iter.SetScaleType(scale_type);
+ iter.SetSequence(mSequence, mSequenceCount);
+ iter.SetScaleType(mScaleType);
while (iter())
{
JZRectangle Rectangle;
@@ -1143,7 +1171,7 @@
void HBCanvas::ClearSeq()
{
mSequenceCount = 0;
- mouse_context.SetSeqNr(0);
+ mMouseContext.SetSeqNr(0);
Refresh();
}
@@ -1156,65 +1184,66 @@
Dc.SetFont(*wxSMALL_FONT);
- HBContext context;
+ HBContext Context;
int x, y;
MouseEvent.GetPosition(&x, &y);
- if (Find(x, y, context))
+ if (Find(x, y, Context))
{
if (MouseEvent.ButtonDown())
{
- player.StartPlay(context);
+ player.StartPlay(Context);
if (
- MouseEvent.LeftDown() &&
- MouseEvent.ShiftDown() ||
+ (MouseEvent.LeftDown() && MouseEvent.ShiftDown()) ||
MouseEvent.MiddleDown())
{
- if (context.SeqNr())
+ if (Context.SeqNr())
{
- // remove a chord
- if (context.SeqNr() == mSequenceCount)
+ // Remove a chord.
+ if (Context.SeqNr() == mSequenceCount)
{
- // remove markers first
- if (mouse_context.SeqNr() == mSequenceCount)
+ // Remove markers first.
+ if (mMouseContext.SeqNr() == mSequenceCount)
{
- DrawMarkers(Dc, mouse_context);
- mouse_context.SetSeqNr(0);
- DrawMarkers(Dc, mouse_context);
+ DrawMarkers(Dc, mMouseContext);
+ mMouseContext.SetSeqNr(0);
+ DrawMarkers(Dc, mMouseContext);
}
--mSequenceCount;
- UnDrawChord(Dc, context);
- context.SetSeqNr(0);
+ UnDrawChord(Dc, Context);
+ Context.SetSeqNr(0);
Refresh();
}
}
else if (mSequenceCount < SEQMAX)
{
- // add a chord
- context.SetSeqNr(mSequenceCount + 1);
- *seq[mSequenceCount++] = context;
- DrawMarkers(Dc, mouse_context);
- DrawChord(Dc, context);
- DrawMarkers(Dc, mouse_context);
+ // Add a chord.
+ Context.SetSeqNr(mSequenceCount + 1);
+ *mSequence[mSequenceCount++] = Context;
+ DrawMarkers(Dc, mMouseContext);
+ DrawChord(Dc, Context);
+ DrawMarkers(Dc, mMouseContext);
Refresh();
}
}
}
else if (
- MouseEvent.Dragging() && player.IsPlaying() && context != player.Context())
+ MouseEvent.Dragging() &&
+ player.IsPlaying() &&
+ Context != player.Context())
{
player.StopPlay();
- player.StartPlay(context);
+ player.StartPlay(Context);
}
- if (MouseEvent.LeftDown() || MouseEvent.MiddleDown()) // && context != mouse_context)
+ if (MouseEvent.LeftDown() || MouseEvent.MiddleDown()) // && Context != mMouseContext)
{
- DrawMarkers(Dc, mouse_context);
- mouse_context = context;
- //mouse_context.SetSeqNr(0);
- DrawMarkers(Dc, mouse_context);
+ DrawMarkers(Dc, mMouseContext);
+ mMouseContext = Context;
+// mMouseContext.SetSeqNr(0);
+ DrawMarkers(Dc, mMouseContext);
// paste to PianoWin buffer
- if (!mark_piano && gpTrackFrame->GetPianoWindow())
+ if (!mMarkPiano && gpTrackFrame->GetPianoWindow())
{
tEventArray &buf = gpTrackFrame->GetPianoWindow()->mPasteBuffer;
buf.Clear();
@@ -1225,13 +1254,14 @@
if (gpTrackFrame->GetPianoWindow())
{
// Show in GuitarWin
- JZGuitarFrame* guitar = gpTrackFrame->GetPianoWindow()->GetGuitarFrame();
- if (guitar)
+ JZGuitarFrame* pGuitarFrame =
+ gpTrackFrame->GetPianoWindow()->GetGuitarFrame();
+ if (pGuitarFrame)
{
// Remove actual pianowin/mouse position
- guitar->ShowPitch(0);
-// guitar->Redraw();
- guitar->Update();
+ pGuitarFrame->ShowPitch(0);
+// pGuitarFrame->Redraw();
+ pGuitarFrame->Update();
}
}
}
@@ -1243,21 +1273,24 @@
}
-void HBCanvas::SetScaleType(int menu_id, tScaleType st, wxToolBar *tb)
+void HBCanvas::SetScaleType(
+ int MenuId,
+ tScaleType ScaleType,
+ wxToolBar* pToolBar)
{
- scale_type = st;
- tb->ToggleTool(MEN_MAJSCALE, false);
- tb->ToggleTool(MEN_HARSCALE, false);
- tb->ToggleTool(MEN_MELSCALE, false);
- tb->ToggleTool(MEN_IONSCALE, false);
- tb->ToggleTool(menu_id, true);
+ mScaleType = ScaleType;
+ pToolBar->ToggleTool(MEN_MAJSCALE, false);
+ pToolBar->ToggleTool(MEN_HARSCALE, false);
+ pToolBar->ToggleTool(MEN_MELSCALE, false);
+ pToolBar->ToggleTool(MEN_IONSCALE, false);
+ pToolBar->ToggleTool(MenuId, true);
Refresh();
}
void HBCanvas::TransposeSelection()
{
- if (!SeqDefined())
+ if (!IsSequenceDefined())
{
wxMessageBox("define a chord sequence first", "error", wxOK);
return;
@@ -1265,7 +1298,7 @@
if (gpTrackWindow->EventsSelected("please select destination range in track window"))
{
wxBeginBusyCursor();
- HBAnalyzer analyzer(seq, mSequenceCount);
+ HBAnalyzer analyzer(mSequence, mSequenceCount);
analyzer.Transpose(gpTrackWindow->mpFilter, transpose_res);
wxEndBusyCursor();
}
@@ -1303,31 +1336,31 @@
}
}
-void HBCanvas::OnMenuCommand(int id, wxToolBar *mpToolBar)
+void HBCanvas::MenuCommand(int MenuId, wxToolBar* pToolBar)
{
- switch (id)
+ switch (MenuId)
{
case MEN_MAJSCALE:
- SetScaleType(id, Major, mpToolBar);
+ SetScaleType(MenuId, Major, pToolBar);
break;
case MEN_HARSCALE:
- SetScaleType(id, Harmon, mpToolBar);
+ SetScaleType(MenuId, Harmon, pToolBar);
break;
case MEN_MELSCALE:
- SetScaleType(id, Melod, mpToolBar);
+ SetScaleType(MenuId, Melod, pToolBar);
break;
case MEN_IONSCALE:
- SetScaleType(id, Ionb13, mpToolBar);
+ SetScaleType(MenuId, Ionb13, pToolBar);
break;
case MEN_ANALYZE:
if (gpTrackWindow->EventsSelected("please select source range in track window"))
{
wxBeginBusyCursor();
- HBAnalyzer analyzer(seq, (int)SEQMAX);
+ HBAnalyzer analyzer(mSequence, (int)SEQMAX);
mSequenceCount = analyzer.Analyze(gpTrackWindow->mpFilter, analyze_res);
Refresh();
wxEndBusyCursor();
@@ -1343,9 +1376,8 @@
break;
default:
- SetMarker(id, mpToolBar);
+ SetMarker(MenuId, pToolBar);
break;
-
}
}
@@ -1354,7 +1386,7 @@
{
if (mSequenceCount > 0 && gpTrackWindow->mpSnapSel->Selected)
{
- HBAnalyzer *analyzer = new HBAnalyzer(seq, mSequenceCount);
+ HBAnalyzer *analyzer = new HBAnalyzer(mSequence, mSequenceCount);
analyzer->Init(gpTrackWindow->mpFilter, transpose_res);
return analyzer;
}
@@ -1367,7 +1399,7 @@
struct tNamedChord
{
- const char *name;
+ const char* mpName;
int bits;
};
@@ -1375,70 +1407,71 @@
const int n_scale_names = 45;
-tNamedChord chord_names[n_chord_names] = {
- { " j7", 0x891},
- { " m7", 0x489},
- { " 7", 0x491},
- { " m75-", 0x449},
- { " mj7", 0x889},
- { " j75+", 0x911},
- { " dim", 0x249},
- { " sus4", 0xa1},
+tNamedChord chord_names[n_chord_names] =
+{
+ { " j7", 0x891},
+ { " m7", 0x489},
+ { " 7", 0x491},
+ { " m75-", 0x449},
+ { " mj7", 0x889},
+ { " j75+", 0x911},
+ { " dim", 0x249},
+ { " sus4", 0xa1},
{ " 7sus4", 0x4a1},
- { " j7sus4", 0x8a1},
- { " alt (79+13-)", 0x519},
- { " 75-", 0x451},
+ { " j7sus4", 0x8a1},
+ { " alt (79+13-)", 0x519},
+ { " 75-", 0x451},
};
-tNamedChord scale_names[n_scale_names] = {
- { "***** major scales *****", 0x0},
- { "maj I (ionic)", 0xab5},
- { "maj IV (lydic)", 0xad5},
- { "har III (ion #5)", 0xb35},
- { "har VI (lyd #9)", 0xad9},
- { "mel III (lyd #5)", 0xb55},
- { "augmented", 0x333},
- { "hj I (ionic b13)", 0x9b5},
- { "***** minor scales *****", 0x0},
- { "minor penta", 0x4a9},
- { "maj VI (aeolic)", 0x5ad},
- { "maj II (doric)", 0x6ad},
- { "mel II (doric b9)", 0x6ab},
- { "maj III (phrygic)", 0x5ab},
- { "japan penta", 0x4a3},
- { "har IV (dor #11)", 0x6cd},
- { "har I (harmonic minor)", 0x9ad},
- { "mel I (melodic minor)", 0xaad},
- { "gipsy", 0x9cd},
- { "hj IV (melodic #11)", 0xacd},
- { "***** dominant scales *****", 0x0},
- { "major penta", 0x295},
- { "ind. penta", 0x4b1},
- { "maj V (mixolyd)", 0x6b5},
- { "har V (har dominant)", 0x5b3},
- { "mel IV (mixo #11)", 0x6d5},
- { "mixo #11b9", 0x6d3},
- { "mel V (mixo b13)", 0x5b5},
- { "hj V (mixo b9)", 0x6b3},
- { "full", 0x555},
- { "hj III (har alt)", 0x59b},
- { "mel VII (alt)", 0x55b},
- { "half/full", 0x6db},
- { "***** semi dimin *****", 0x0},
- { "maj VII (locr)", 0x56b},
- { "mel VI (locr 9)", 0x56d},
- { "har II (locr 13)", 0x66b},
- { "hj II (doric b5)", 0x66d},
- { "***** dimin *****", 0x0},
- { "har VII (har dim)", 0x35b},
- { "full/half", 0xa6d},
- { "hj VII (locr dim)", 0x36b},
- { "***** blues scales *****", 0x0},
- { "minor penta b5", 0x4e9},
- { "blues scale", 0x4f9},
+tNamedChord scale_names[n_scale_names] =
+{
+ { "***** major scales *****", 0x0},
+ { "maj I (ionic)", 0xab5},
+ { "maj IV (lydic)", 0xad5},
+ ...
[truncated message content] |
|
From: <pst...@us...> - 2008-04-06 00:02:10
|
Revision: 401
http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=401&view=rev
Author: pstieber
Date: 2008-04-05 17:02:09 -0700 (Sat, 05 Apr 2008)
Log Message:
-----------
Updating the end-of-line styles to native for a bunch of files.
Modified Paths:
--------------
trunk/jazz/src/Bitmaps/JazzLogo.xpm
trunk/jazz/src/Project.cpp
trunk/jazz/src/Project.h
trunk/jazz/src/RecordingInfo.cpp
trunk/jazz/src/RecordingInfo.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
Property Changed:
----------------
trunk/jazz/src/Bitmaps/JazzLogo.xpm
trunk/jazz/src/Bitmaps/accept.xpm
trunk/jazz/src/Bitmaps/alea.xpm
trunk/jazz/src/Bitmaps/analyze.xpm
trunk/jazz/src/Bitmaps/cancel.xpm
trunk/jazz/src/Bitmaps/cut.xpm
trunk/jazz/src/Bitmaps/cutpaste.xpm
trunk/jazz/src/Bitmaps/delchord.xpm
trunk/jazz/src/Bitmaps/delete.xpm
trunk/jazz/src/Bitmaps/dialog.xpm
trunk/jazz/src/Bitmaps/evnts.xpm
trunk/jazz/src/Bitmaps/harscale.xpm
trunk/jazz/src/Bitmaps/haunsch.xpm
trunk/jazz/src/Bitmaps/help.xpm
trunk/jazz/src/Bitmaps/ionscale.xpm
trunk/jazz/src/Bitmaps/length.xpm
trunk/jazz/src/Bitmaps/majscale.xpm
trunk/jazz/src/Bitmaps/melscale.xpm
trunk/jazz/src/Bitmaps/metro.xpm
trunk/jazz/src/Bitmaps/mixer.xpm
trunk/jazz/src/Bitmaps/new.xpm
trunk/jazz/src/Bitmaps/note16.xpm
trunk/jazz/src/Bitmaps/note163.xpm
trunk/jazz/src/Bitmaps/note8.xpm
trunk/jazz/src/Bitmaps/note83.xpm
trunk/jazz/src/Bitmaps/open.xpm
trunk/jazz/src/Bitmaps/panic.xpm
trunk/jazz/src/Bitmaps/piano.xpm
trunk/jazz/src/Bitmaps/pianowin.xpm
trunk/jazz/src/Bitmaps/play.xpm
trunk/jazz/src/Bitmaps/playloop.xpm
trunk/jazz/src/Bitmaps/quantize.xpm
trunk/jazz/src/Bitmaps/record.xpm
trunk/jazz/src/Bitmaps/redo.xpm
trunk/jazz/src/Bitmaps/repl.xpm
trunk/jazz/src/Bitmaps/rrgadd.xpm
trunk/jazz/src/Bitmaps/rrgdel.xpm
trunk/jazz/src/Bitmaps/rrgdown.xpm
trunk/jazz/src/Bitmaps/rrggen.xpm
trunk/jazz/src/Bitmaps/rrgup.xpm
trunk/jazz/src/Bitmaps/same0.xpm
trunk/jazz/src/Bitmaps/same1.xpm
trunk/jazz/src/Bitmaps/same2.xpm
trunk/jazz/src/Bitmaps/same3.xpm
trunk/jazz/src/Bitmaps/same4.xpm
trunk/jazz/src/Bitmaps/sameb.xpm
trunk/jazz/src/Bitmaps/sameh.xpm
trunk/jazz/src/Bitmaps/save.xpm
trunk/jazz/src/Bitmaps/select.xpm
trunk/jazz/src/Bitmaps/shiftl.xpm
trunk/jazz/src/Bitmaps/shiftr.xpm
trunk/jazz/src/Bitmaps/std251.xpm
trunk/jazz/src/Bitmaps/transpos.xpm
trunk/jazz/src/Bitmaps/tritone.xpm
trunk/jazz/src/Bitmaps/undo.xpm
trunk/jazz/src/Bitmaps/zoomin.xpm
trunk/jazz/src/Bitmaps/zoomout.xpm
trunk/jazz/src/Project.cpp
trunk/jazz/src/Project.h
trunk/jazz/src/RecordingInfo.cpp
trunk/jazz/src/RecordingInfo.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/metronomeSettings.cpp
trunk/jazz/src/dialogs/metronomeSettings.h
trunk/jazz/src/dialogs/midiDelay.xrc
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/sequenceLength.xrc
trunk/jazz/src/dialogs/songSettings.cpp
trunk/jazz/src/dialogs/songSettings.h
trunk/jazz/src/dialogs/synthSettings.cpp
trunk/jazz/src/dialogs/synthSettings.h
trunk/jazz/src/dialogs/velocity.xrc
trunk/jazz/src/dialogs/windowSettings.xrc
trunk/jazz/src/gui/trackwinEnum.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/jazz.rc
trunk/jazz/src/stamp-h.in
Modified: trunk/jazz/src/Bitmaps/JazzLogo.xpm
===================================================================
--- trunk/jazz/src/Bitmaps/JazzLogo.xpm 2008-04-05 23:49:12 UTC (rev 400)
+++ trunk/jazz/src/Bitmaps/JazzLogo.xpm 2008-04-06 00:02:09 UTC (rev 401)
@@ -1,201 +1,201 @@
-/* XPM */
-static const char* JazzLogo_xpm[] = {
-/* width height ncolors chars_per_pixel */
-"450 67 127 2",
-/* colors */
-" c black",
-" . c #1919FD",
-" X c #FA0402",
-" o c #CF5126",
-" O c #416AD4",
-" + c #FA9546",
-" @ c #FB3116",
-" # c #8D8D8D",
-" $ c #8FD5FF",
-" % c #D8411E",
-" & c #004DAE",
-" * c #2E2EAA",
-" = c #0068BB",
-" - c #0808E8",
-" ; c #2C91FA",
-" : c #E4E4AD",
-" > c #0C0DCE",
-" , c #E0E06A",
-" < c #BF8840",
-" 1 c #CECEAB",
-" 2 c #BD843E",
-" 3 c #2788D7",
-" 4 c #757578",
-" 5 c #7777FB",
-" 6 c #9A411F",
-" 7 c #F5D564",
-" 8 c #FAAF52",
-" 9 c #CE0100",
-" 0 c #FAE76C",
-" q c #0B0DA8",
-" w c #CBCBCC",
-" e c #668DC2",
-" r c #0071F9",
-" t c #0035F6",
-" y c #4B80C5",
-" u c #3E4CC9",
-" i c #5555AE",
-" p c #DEDE71",
-" a c #3636D5",
-" s c #2B2BE8",
-" d c #CBD272",
-" f c #7272B3",
-" g c #F2C65D",
-" h c #9D4821",
-" j c #D4AC50",
-" k c #A4411E",
-" l c #AA5327",
-" z c #E8E86D",
-" x c #0035A9",
-" c c #FC5025",
-" v c #FCEE70",
-" b c #FF411E",
-" n c #303096",
-" m c #7B7B3A",
-" M c #AFAFA2",
-" N c #0E0E99",
-" B c #3472CB",
-" V c #013799",
-" C c #5050FE",
-" Z c #51ADFB",
-" A c #686831",
-" S c #B3B3D4",
-" D c #E8E873",
-" F c #C8C878",
-" G c #FEFE78",
-" H c #909076",
-" J c #7BB2F6",
-" K c #00459B",
-" L c #3049BD",
-" P c #922F15",
-" I c #ACD7FE",
-" U c #D8D866",
-" Y c #018EF1",
-" T c #B00201",
-" R c #3174FC",
-" E c #0037CC",
-" W c #B0B08E",
-" Q c #AFAF58",
-" ! c #FB6E33",
-" ~ c #78A3DB",
-" ^ c #1B1BEA",
-" / c #D0D08C",
-" ( c #518EFA",
-" ) c #9DE0FF",
-" _ c #35A8F2",
-" ` c #B2B254",
-" ' c #8888CD",
-" ] c #545490",
-" [ c #8F8FF8",
-" { c #CD833D",
-" } c #D6D66D",
-" | c #CF7235",
-". c #8C8C42",
-".. c #AEB1F5",
-".X c #84ADDC",
-".o c #C6C65D",
-".O c #6895FC",
-".+ c #89AFF8",
-".@ c #A6A64E",
-".# c #D12F16",
-".$ c #E6E686",
-".% c #EFEF71",
-".& c #B8B866",
-".* c #AFE7FF",
-".= c #CFCF62",
-".- c #8E0402",
-".; c #B47034",
-".: c #6F6FC7",
-".> c #790201",
-"., c #C0C0F2",
-".< c #4A74FF",
-".1 c #8F8FAE",
-".2 c #BCBC59",
-".3 c #C99345",
-".4 c #0071CD",
-".5 c #C8C868",
-".6 c #008ADA",
-".7 c #9A9A48",
-".8 c #71C7FD",
-".9 c #4F4FCF",
-".0 c #71718D",
-".q c #0051CD",
-".w c #0153F9",
-".e c #FA833D",
-".r c #4D4D24",
-".t c #AC3418",
-".y c #0002FF",
-/* pixels */
-".y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y",
-".y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y.y",
-".y.y G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G.y.y",
-".y.y G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G.y.y",
-".y.y G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G.y.y",
-".y.y G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G.y.y",
-".y.y G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G.y.y",
-".y.y G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G.y.y",
-".y.y G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G f.:.: f G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G /.:.:.:.1 G G G G G G G G G M '.:.: f / G G G G G G G G.1.:.:.:.:.:.:.:.:.:.:.:.: f W G G.1.:.:.:.:.:.:.:.:.:.:.:.: f W G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G /.:.: f W G G G G G G G G G G G G G.1.:.: f.$ G G M.:.: f / G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G.y.y",
-".y.y G G G G G G G G G G G G G G G G G G G G G G G G G G G G.$ f G G G G.$.y r r s G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G.1 r r.4.9 G G G G G G G G.$ s Y.w r.q f G G G G G G G G . r r r r r r r r r r r r.q M G G ^ r r r r r r r r r r r r.q.1 G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G.: r r.q M G G G G G G G G G G G G G . r r q G G G.9 r r x / G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G.y.y",
-".y.y G G G G G G G G G G G G G G G G G G G G G G G G G G G M C n G G G G W r Y &.0 G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G.9 Y Y & # G G G G G G G G ' ;.6 x Y & ] G G G G G G G /.w & & & & & & & & & x &.4 x p G D.w & & & & & & & & & x &.4 x / G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G.9 Y.4 x p G G G G G G G G G G G G /.w Y & n G G G . Y.4 q G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G.y.y",
-".y.y G G G G G G G G G G G G G G G G G G G G G G G G G / 5 (.4 ] G G G G.1 r Y & # G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G ^ Y.4 & / G G G G G G G / R ; & E Y.4 * G G G G G G G W * * * * * * * *...:.. ; & N G G W * * * * * * * *...:.. _ & N G G G G G G.$ M M W G G G G G G G G G G G G G M M W / G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G a s * n G G G G G G G G G G G G G M r Y &.0 G G.$ s s * ] G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G.y.y",
-".y.y G G G G G G G G G G G G G G G G G G G G G G G G G.1 ; Y & # G G G G.9 Y.4 x / G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G.$.w Y.4 q G G G G G G G G.: ;.6 V s r.4 q G G G G G G G G G G G G G G G G w.* _ & N F G G G G G G G G G G G w.* Z & N W G G G G G G.1 r r.q.$ G G G G G G G G G G G G.y r.w.1 G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G.: r.6 & W G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G.$ M.1.1.1 W G G G G G G G G G G G M.1.1 M G G G G G G G G G G G W.1.1 / G G G.$.$.$.$ G G G.$.$.$.$ G G G G G.$.$.$.$ G G G G G G G / M.1.1 / G G G G G G G G.$.$.$.$ G G / M.1 M G G G G G G G G G G / M.1.1 / G G G G G G G G G G.$ M.1.1 W G G G G G G G G.$.$.$ G G G M.1 W G G G G G G G G G G G G G G G G G G G G G G G G G G G.y.y",
-".y.y G G G G G G G G G G G G G G G G G G G G G G G.$.$ a Y.4 x W / D G G . Y.4 q G G.$ M.1 M.$ G G G G G G G G G /.1.1.1 / G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G W r Y & n G G G G G G G / R Y & n.: r.6 x p G G G G G G G G G G G G G G w I Z = V W G G G G G G G G G G G w I Z = V # G G G G G G G.1 r.6 x D G G G G G G G G G G G G.y Y & # G G G G G G G G G G G G G G G G G G G G G G G G G G G.$.$.$ G G G M.1 M.$ G G G G / M.1 M G G G G G G G / / / D G G G G G G /.1.1 M D G G a Y.4 x p G G.$ / / / G G G G G G G G G G G G G G G G G G G G G G.$.:.w r r r r r -.1 G G G G G G.$.:.w r r r r -.1 G G G G G G G 1 s r r r.w a.$ W.w.w.w.1 G G G s.w.w > G G G G /.w.w.w.9 G G G G G / C.w r r r r a W G G G G G W.w.w.w f.$.:.w r r r > / G G G G G G 1 C.w r r r r a W G G G G G G /.:.w r r r r ^ W G G G G G M.w.w.q M.$ 5 r r q.$ G G G G G G G G G G G G G G G G G G G G G G G G G G.y.y",
-".y.y G G G G G G G G G G G G G G G G G G G G G G G s.w.w.w.w E.w.q.1 G.$.w Y & n.$.:.y r r r - W G G G G G G M s r r r r.w.9.$ G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G f r Y & ] G G G G G G G C ;.4 V W.1 r Y & W G G G G G G G G G G G G G 1 I.8 = V # G G G G G G G G G G G 1 I.8.4 V.0 G G G G G G G G.1 r.6 x D G G G G G G G G G G G G.y Y & # G G G G G G G G G G G G G G G G G G G G G G G G G G f.w.w.q / M . r r r - M G.$.:.w r r r > / G G G G.:.w.w.q M G G G G.$ 5 r r r r -.1 G.y Y = N G G G.9.w.w.q / G G G G G G G G G G G G G G G G G G G G.$.. Z.4 & & &.4.4 Y.w f G G G G.$., (.4 & & &.4 Y.q f G G G G G w $ Z.4 & &.q.4 a f r Y & / G G.$.w Y.4 n G G G G.1 r Y & # G G G G :.. ;.4 & &.q r r > / G G G G.1 r Y &.9 [ B &.q.4 Y.4 * G G G G G w.O Y.4 & &.q r r.q W G G G G :.. Z.4 & &.q.4 r.q W G G G G.: r.4 x W I Z.4 K.0 G G G G G G G G G G G G G G G G G G G G G G G G G G G.y.y",
-".y.y G G G G G G G G G G G G G G G G G G G G G G.$.y.4.w r r.4.4 x p G M r Y & n [ B &.q.4 Y.4 > D G G G G w J Y & & &.q Y r a D G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G.9 Y.6 & # G G G G G G M R Y & n D W r Y & # G G G G G G G G D D D D 1 I.8.4 V ] D D D G G G D D D D D / I $.4 V ] D D D G G G G G G.1 r.6 x D G G G G G G G G G G G G.y Y & # G G G G G G G G G G G G G G G G G G G G G G G G G G.9 r.4 q ] J &.q.4 Y.4 > W.. B &.q.4 Y.4 * G G G G a r.4 x p G G G.$.. Z Y & & &.4.q f.w Y & ] G G G.y Y.4 q D G G G G G G G G G G G G G G G G G G G G C Z & N.0 # # *.q.4.q E / G G.$ [.* = V ] # f > r r.q / G G G 1 $.8 & N ].0 *.q.q - Y.4 q G G G M r Y &.0 G G G G.9 Y.6 & / G G G 1 I.8 K N.0 # i.w r.4 * G G G G.9 Y.4 q.. V ] # i.w Y.6 & / G G G w.* Z & N ].0 *.q r.4 q G G G.$.+ $ & N.0 # i > Y.4 > G G G G s Y.4 q.9 y x x q D G G G G G G G G G G G G G G G G G G G G G G G G G G G.y.y",
-".y.y G G G G G G G G G G G G G G G G G G G G G G W s q t Y q q * ] G G f r.6 q [ N ] # f - Y Y & # G G G S I Z V n # # a.w Y.q f G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G . Y.4 x.& D D G G G G C ;.4 V.& p F.w Y & ] G G G G G G G D D p } /.. $.4 K n } } } D D D D D p } } /.. $.6 K n.5 } p D D D D D D D.1 r.6 x p G G G G G G G G G G G G.y Y &.0 G G G G G G G G G G G G G G G G G G G G G G G G G G . Y &.: e n # f - Y.6 & [ q ] # i.w Y.6 x D G G G.y Y = q D D D.$ 5 $.4 V n.0 i >.4 > r Y &.0 D D /.w Y & n D D G G G G G G G G G G G G G G G G G G /.w Y &.0 G G G G.0 q ].0 / G G.: Z.6 V # G G G W.w Y &.0 G G G s _ = N W G G G.9.w t Y & n G G G f r.6 & # G G G G ^ Y.4 q G G G G C.8 = N F G G G.9 r.6 & / G G G . Y =.. N W G G G s r.6 & W G G /.< Z & N.& G G G i r & & W G G C Z = N W G G G f.w Y & W G G G.y Y &.9 B n W D D G G G G G G G G G G G G G G G G G G G G G G G G G G G G.y.y",
-".y.y G G G G G G G G G G G G G G G G G G G G G G G G.: r.6 & # D D G G.9 Y.4.+ N H D D G.9 r Y & # G G / R Z & n D G G G ^ r.4 q G G G G G G G G G G G G G G G G G G G G G G G G G G G G G /.w Y.4 q } p D G G G.1 ; Y K ] } } }.y Y.4 * D G G G G G G D } } F.. $.6 K n.&.5.5.5 } D D D } }.5 F.. $ Y K N.&.5.5 } } D.9.w.w.w.w.w.w Y.q.w.w.w.w.w M G /.w.w.w.w.w.w Y x.w.w.w.w.w.9 G G G G G G G G G G G G G G G G G G G G /.w Y x.: ] G G G.9 r Y q * # G G G . Y.4 x D G G /.w Y & n } D D.: ; Y V ] G G G W - > t.6 &.& D D.1 r Y & ] } D D G G G G G G G G G G G G G G G G G / r Y.q * W G G G G G G G G G /.w Y & n G G G G G.y Y.4 * G G.1 r Y V.0 G G G G.$.y E Y &.0 G G G a Y.4 x p G G G.$.w Y & n G G G.1 r Y K.0 G G G G W r Y & # G G.$.w Y &.O W G G G G s Y.4 x F G G.9 Y.6 V # G G G G W * ].0 / G M r Y K ] G G G G /.w Y &.0 G G /.w Y q.9 ] G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G.y.y",
-".y.y G G G G G G G G G G G G G G G G G G G G G G G G s Y.4 x.& D D D G . Y.q.< 4.5 } D G.9 r.6 & W G G.9 Y.4 V W G G G G f r.6 x / G G G G G G G G G G G G G G G G G G G G G G G G G G G G M r Y & n.5 } p D G.$ s ; = V.& }.5.5 s r.4 q D D G G G G D D } F...* Y & N H Q Q Q.&.5 } D } }.5.&.. I _ & N H Q Q.&.5.5 }.9 r Y Y Y Y r.6 Y Y Y Y Y & W G / r Y Y Y Y Y Y r Y Y Y Y & ] G G G G G G G G G G G G G G G G G G G G M r Y.X N G G G G.9 Y Y & ] G G G G.w Y.4 q G G G.1 r Y &.0 } } F . Y & N D G G G G.9 r.w.4 x.5 } p.: r.6 & 4.5 } D G G G G G G G G G G G G G G G G G G - r Y.4.w ^.9 W G G G G G G.1 r Y &.0 G G G G G s Y.4 * G G s Y.4 N D G G G G G s.w Y & # G G G.y Y.4 q G G G G M r Y &.0 G G G s Y.4 x F G G G G /.w Y &.0 G G M r Y.O n G G G G D.y Y.4 q G G.$.y Y = N G G G G G G G G G G G.9 Y.6 x W G G G G D.w Y & ] G G.1 r Y L N D G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G G.y.y",
-".y.y G G G G G G G G G G G G G G G G G G G G G G G D.y Y.4 q } } D D /.w r.4 N.&.5 } p D s Y.4 x F G D.y Y = N G G G G G.1 r.6 & W G G G G G G G G G G G G G G G G G G G G G G G G G G G G f r Y & ].5 } p D G.: ;.6 K.0 }.5.&.& a r.4 x F D G G G G G D p S.* _ & V H Q Q Q.&.5 } } D D } } S.* _ & V H Q Q Q.&.5 } p ].q & & & &.4 r x & & & & & W G /.w & & & & x r & & & & & & ] G G G G G G G G G G G G G G G G G G G G.: r.q ( # G G G G . Y.4 V F G G G W r Y & n G G G.: r.6 & H } p f r Y K.0 G G G G G.1 r r = N.5 } } a Y.4 x.& } p D G G G G G G G G G G G G G G G G G G.1.q.4.6 Y Y r.w ^.1 G G G G.9 Y.6.q.w.w.w.w.w.w.w Y.4 * G G.w Y & n G D D D D D s r.4 x F G G /.w Y & ] G G G G.: r.6 & # G G G.y Y.4 E.w.w.w.w.w.w.w Y &.0 G G f r.6 &.0 D D D D W.w Y & n G G M r Y & ] G D D D D D G G G G G ^ Y.4.q.w.w.w.w.w.w.w Y & ] G G.: r.4 ( # D D D D G G G G G G G G G G G G G G G G G G G G G G G G G G G G G.y.y",
-".y.y G G G G G G G G G G G G G G G G G G G G G G G W r Y & n } } } D.1 r Y & ].&.5.5 } p.y Y.4 q G G W r Y.4 t.w.w.w.w.w q.w.6 & W G G G G G G G G G G G G G G G G G G G G G G G G G G G G a Y.6 &.0.5 } p D / s Y = N # # # #.0 a r.6 & W D G G G G G D S.* Z = N H.&.& Q.&.&.5 } p D D D w I Z = N 4.& Q Q Q.&.5 } D W # # # #.9 r.6 x.0 # # # # p G D # # # # #.y Y & ] # # # # W G G G G G G G G G G G G G G G G G G G G a Y _ x F D D D /.w Y = N G G G D.1 r Y &.0 G G G s Y.4 x F } D.9 Y.4 x F D D D D D.1 r Y & ].5.5 p.y Y = N.5 } D D G G G G G G G G G G G G G G G G G G G # * E.q.4.6 Y Y.q f G G G a r.q.w & & & & & & & & & n G /.w Y &.0 D D D D D D.y r.4 q D D D.1 r Y &.0 D D G G a Y.4 x F D G /.w Y.w q & & & & & & & & & # G G.9 Y Y x.& D D D D.1 r Y & ] G G.1 r Y & # D D D D D D D D G G G.y Y.w x & & & & & & & & &.0 G G s r.q N F D D D D D D G G G G G G G G G G G G G G G G G G G G G G G G G G G.y.y",
-".y.y G G G G G G G G G G G G G G G G G G G G G G G.1 r Y & ].5.5 } } f r.6 & 4.&.5.5 } W r Y & n G G.1 r Y.w & & & & & & & & & x F G G G G G G G G G G G G G G G G G G G G G G G G G G G G.y Y.4 x.&.5 } p D C ;.q.q r r r r r r r r Y & # D G G G G G 1 I.8 = V 4.5.5.&.&.&.&.5 } D G G 1 I.8.4 V.0.5.5.&.& Q.&.5 } D D G G G D.1 r.6 x p D G G G G G G G G G D D.y Y &.0 D G G G G G G G G G G G G G G G G G G G G G G G G.y Y.4 q D D D D # r Y & ] D D D D.9 Y.6 & # D D D.y Y = N D p D s Y.4 q D D D D D D f r Y & 4.5.5 W.w Y & n } p D G G G G G G G G G G G G G G G G G G G G D D W ] q.q.4 Y.6.q W G G s r.4 x.0.0.0.0.0.0.0 # # W G W r Y &.0 D p } } } W.w Y & n D D D.9 Y.6 & W D D D D.y = = N D D D /.w Y & * #.0.0.0.0.0.0 # # p G G . Y = N } } } } }.9 r.6 & # D G f r.6 & # D p p } } p D D D G G.y Y & q #.0.0.0.0.0.0 # # F G D.y Y ; n p p } p p D D G G G G G G G G G G G G G G G G G G G G G G G G G G G.y.y",
-".y.y G G G G G G G G G G G G G G G G G G G G G G D.9 Y.6 & 4.5.5.5 } a Y.4 x.&.&.&.5.5 f r Y &.0 D D.1 r Y &.9.0.0.0.0.0.0.0 # # D G G G G G G G G G G G G G G G G G G G / M.1.1 G G G G /.w Y = N.5.5 } D M R Y r.4.4.4.4.4.4.4.4.4 Y & ] D G G G G 1 I.8.4 V ] p }.5.5.5.5.5 } D D G 1 I.8.4 V ] D }.5.5.&.&.5 } D D G G G G D.1 r.6 x F D G G G G G G G G G D }.y Y &.0 D G G G G G G G G G G G G G G G G G G G G G G G /.w Y & n p p p } f r.6 & # D D D p ^ Y.4 x F D D W r Y & ] D D D . Y.4 q D D } } } } s r.4 & H.&.5.1 r Y &.0 } D D G G G G G G G G G G G G G G G G G G G D p p } }.5 # ^ r Y & # D D.9 r.4 x F } } } } } } p D D D W r Y &.0 p } } } }.: r Y &.0 } p D s Y.4 x F p D D M.w Y & ] } p D D.y Y & n } } } } } } } p D D D /.w Y & n } } } } } s Y.4 x.& D D f r.6 & # } } } } f.9 f # F D D ^ Y.4 q } } } } } } } p p D D W r r & ] } } } } p D D G G G G G G G G G G G G G G G G G G G G G G G G G G G.y.y",
-".y.y G G G G G G G G G G G G G G G G G G G G G G D s Y.4 x H.5.5.5 }.y Y.4 q.5.&.5.5.5.9 Y.6 & H D D W r Y &.0 } } } } } } p D D D G G G G G G G G G G G G G G G G G G G.y r r s G G G G.1 r Y & ].5.5 } p C ;.4 V x x x x x x x x.q Y.4 * D G G G.$ I $.4 K ] D } }.5.5.5.5 } p D G.$.. $.6 K n p p }.5.5.5.5.5 } D D D G D D } f r.4 x.& } D D G G G G G D D } }.y Y &.0 } D D D G G G G G G G G G G G G G G G G G G G G.1 r Y &.0 } } } } a Y.4 x.& } p } F.w Y = N D D D.1 r Y &.0 D D D ^ Y.4 q p } } } } W R.4.4 q.&.&.5.9 r.6 & # } D D G G G G G G G G G G G G G G G G /.9 ^.w a } }.5.5.5.: r.6 & # D D.1.w.6 & # } } } } '.9 f # D D /.w Y.4 q p } } } / [.q.6 & H } } }.y Y.4 q } } p.$...w Y &.0 } } p D a r.4 q.& } } } p 5.9 f W } D.1 r Y &.0.5.5 } } p.y Y = N } } D.1.w Y &.0 } } } / 5 r r q W D D.9 r.6 q.& } } } p.:.: f W } D.1 r Y &.0.5.5.5 } p D D G G G G G G G G G G G G G G G G G G G G G G G G G G G.y.y",
-".y.y G G G G G G G G G G G G G G G G G G G G G G D.w Y.4 q.&.5.5.5 W.w Y & n.5.&.5.5.5 ^ Y.4 x F } p p.y Y.4 * } } } } W 5.9.1 F D D G G G G G G G G G G G G G G G G G G . Y.4 q / G G D [ ;.4 V H.5.5 }.1 R Y & n F.&.&.5.5.5.&.& q Y.4 q D G G.$.. $.6 K n D D } }.5.5.5 } p D D.$.. $.6 K n p D }.5.5.5.5.5 } D D D D D D } } f r & x.& } } D D D G D D D } }.5.y.4 &.0.5 } p D D D G G G G G G G G G G G G G G G G G G.: r.6 & H } } } } . Y.4 q.5 } } } # r Y & ] } p p.9 Y.6 &.& p p p a r.6 & # } } } } S O Y & n.&.&.5 s Y.4 x F } D D G G G G G G G G G G G G G G G G D > r Y.q i.&.5 F f 5 Z = V F D D F - r.4 > # }.&.:.* r.q a } p } ^ r.6.q * W W f 5 u.w.4 x.&.5 } }.y Y.6 x # } W 5 *.y.6 & H.5 } } D #.w Y.q *.& } W 5 I r & # } } f r.6 & H.5.5 } } W r Y & n.5 } D p - r.4 > #.& # C.*.6 K ] } p D W.w r.q > W } W ' I r.q f } }.9 Y.6 & H.5.5.5 } D D D G G G G G G G G G G G G G G G G G G G G G G G G G G G.y.y",
-".y.y G G G G G G G G G G G G G G G G G G G G G G /.w Y.4 q.0 # W }.1 r Y & ].5.5.5.5 F.w Y = N.5 } } } i r.6.q i.& F.1 [ ).4 q W p D G G G G G G G G G G G G G G G G G G.9 r Y.q >.9.9 . ( _ & n.5 } } F s ;.4 V H.5.5.5.5 } }.5.5 a r.4 q p G G [.8 Y q E N s s s s ^ ^ ^ ^ ^ f G [ J ; q E N s s s s ^ ^ ^ ^ ^ f D D D D } }.5 # a n n.&.5 } } D D D D D } }.5.& a n n 4.5.5 } } D D D G G G G G G G G G G G G G G G G G a Y.4 x.&.5 } }.&.w Y & n.5.5 } } f r Y &.0 } } } s Y.4 x F } } } f r Y.4 > #.& W.: ~.w Y & ].&.5.5.y Y = N } } p D G G G G G G G G G G G G G G G G G #.q.4.4 r.w.w.w r ;.4 V.0 D D p }.0.q.4.4.w t.w r ; K N.& } } }.0.w.6 Y r.w.w r & E Y = N.5.5.5.5 a r Y.4.w t.w x.y Y.4 q.5.5.5 } } D a.4.6 r.w t.w ;.4 V ].5.5 } a Y.4 x.&.&.5 } } f r Y & ].5.5 } D f.q.4.4.w.w r Y 3 K n F } } p D i.q.4.4.w t.w r 3 V n.&.5 } s Y.4 q.&.&.5.5 } D D G G G G G G G G G G G G G G G G G G G G G G G G G G G G.y.y",
-".y.y G G G G G G G G G G G G G G G G G G G G G G /.w Y Y r.w.q.1 }.9 r.6 & H.5.5.5.5 # r Y & ].5.5.5 } F >.q.4 r.w.w r ; & N 4.5 } D D G G G G G G G G G G G G G G G G G W.w.4 Y Y r r Y Y & V H.5 } }.: ; Y & n }.5.&.5.5...
[truncated message content] |
|
From: <pst...@us...> - 2008-04-06 02:21:00
|
Revision: 410
http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=410&view=rev
Author: pstieber
Date: 2008-04-05 19:20:52 -0700 (Sat, 05 Apr 2008)
Log Message:
-----------
Renamed the dialogs directory to a temporary name. I just want to change the
case of the directory name, but since some OSs are case insensitive (Windows)
I have to do this in two steps.
Added Paths:
-----------
trunk/jazz/src/DialogsTemporary/
trunk/jazz/src/DialogsTemporary/MetronomeSettingsDialog.cpp
trunk/jazz/src/DialogsTemporary/MetronomeSettingsDialog.h
trunk/jazz/src/DialogsTemporary/copyDialog.cpp
trunk/jazz/src/DialogsTemporary/copyDialog.h
trunk/jazz/src/DialogsTemporary/copyright.cpp
trunk/jazz/src/DialogsTemporary/copyright.h
trunk/jazz/src/DialogsTemporary/metronomeSettings.cpp
trunk/jazz/src/DialogsTemporary/metronomeSettings.h
trunk/jazz/src/DialogsTemporary/midiDelay.xrc
trunk/jazz/src/DialogsTemporary/midiThruDialog.cpp
trunk/jazz/src/DialogsTemporary/midiThruDialog.h
trunk/jazz/src/DialogsTemporary/midiTiming.cpp
trunk/jazz/src/DialogsTemporary/midiTiming.h
trunk/jazz/src/DialogsTemporary/sequenceLength.xrc
trunk/jazz/src/DialogsTemporary/songSettings.cpp
trunk/jazz/src/DialogsTemporary/songSettings.h
trunk/jazz/src/DialogsTemporary/synthSettings.cpp
trunk/jazz/src/DialogsTemporary/synthSettings.h
trunk/jazz/src/DialogsTemporary/velocity.xrc
trunk/jazz/src/DialogsTemporary/windowSettings.xrc
Removed Paths:
-------------
trunk/jazz/src/DialogsTemporary/copyDialog.cpp
trunk/jazz/src/DialogsTemporary/copyDialog.h
trunk/jazz/src/DialogsTemporary/copyright.cpp
trunk/jazz/src/DialogsTemporary/copyright.h
trunk/jazz/src/DialogsTemporary/metronomeSettings.cpp
trunk/jazz/src/DialogsTemporary/metronomeSettings.h
trunk/jazz/src/DialogsTemporary/midiDelay.xrc
trunk/jazz/src/DialogsTemporary/midiThruDialog.cpp
trunk/jazz/src/DialogsTemporary/midiThruDialog.h
trunk/jazz/src/DialogsTemporary/midiTiming.cpp
trunk/jazz/src/DialogsTemporary/midiTiming.h
trunk/jazz/src/DialogsTemporary/sequenceLength.xrc
trunk/jazz/src/DialogsTemporary/songSettings.cpp
trunk/jazz/src/DialogsTemporary/songSettings.h
trunk/jazz/src/DialogsTemporary/synthSettings.cpp
trunk/jazz/src/DialogsTemporary/synthSettings.h
trunk/jazz/src/DialogsTemporary/velocity.xrc
trunk/jazz/src/DialogsTemporary/windowSettings.xrc
trunk/jazz/src/dialogs/
Copied: trunk/jazz/src/DialogsTemporary (from rev 401, trunk/jazz/src/dialogs)
Copied: trunk/jazz/src/DialogsTemporary/MetronomeSettingsDialog.cpp (from rev 409, trunk/jazz/src/dialogs/MetronomeSettingsDialog.cpp)
===================================================================
--- trunk/jazz/src/DialogsTemporary/MetronomeSettingsDialog.cpp (rev 0)
+++ trunk/jazz/src/DialogsTemporary/MetronomeSettingsDialog.cpp 2008-04-06 02:20:52 UTC (rev 410)
@@ -0,0 +1,110 @@
+//*****************************************************************************
+// The JAZZ++ Midi Sequencer
+//
+// Copyright (C) 2008 Peter J. Stieber, all rights reserved.
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+//*****************************************************************************
+
+#include "WxWidgets.h"
+
+#include "MetronomeSettingsDialog.h"
+
+#include "../Metronome.h"
+#include "../Knob.h"
+
+using namespace std;
+
+//*****************************************************************************
+//*****************************************************************************
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+JZMetronomeSettingsDialog::JZMetronomeSettingsDialog(wxWindow* pParent)
+ : wxDialog(pParent, wxID_ANY, wxString("Metronome Settings")),
+ mpSynthesizerListbox(0),
+ mpStartListbox(0)
+{
+ JZKnob* pKnob = new JZKnob(this, wxID_ANY, 100, 0, 128);
+
+ mpSynthesizerListbox = new wxListBox(this, wxID_ANY);
+
+ int Selection = 0;
+ int Index = 0;
+ for (
+ vector<pair<string, int> >::const_iterator iPair = gSynthesizerTypes.begin();
+ iPair != gSynthesizerTypes.end();
+ ++iPair, ++Index)
+ {
+ mpSynthesizerListbox->Append(iPair->first.c_str());
+ if (strcmp(iPair->first.c_str(), gpConfig->StrValue(C_SynthType)) == 0)
+ {
+ Selection = Index;
+ }
+ }
+ mpSynthesizerListbox->SetSelection(Selection);
+
+ mpStartListbox = new wxListBox(this, wxID_ANY);
+
+ mpStartListbox->Append("Never");
+ mpStartListbox->Append("Song Start");
+ mpStartListbox->Append("Start Play");
+
+ mpStartListbox->SetSelection(gpConfig->GetValue(C_SendSynthReset));
+
+ wxButton* pOkButton = new wxButton(this, wxID_OK, "&OK");
+ wxButton* pCancelButton = new wxButton(this, wxID_CANCEL, "Cancel");
+ wxButton* pHelpButton = new wxButton(this, wxID_HELP, "Help");
+ pOkButton->SetDefault();
+
+ wxBoxSizer* pTopSizer = new wxBoxSizer(wxVERTICAL);
+ wxBoxSizer* pListControlSizer = new wxBoxSizer(wxHORIZONTAL);
+ wxBoxSizer* pButtonSizer = new wxBoxSizer(wxHORIZONTAL);
+
+ wxBoxSizer* pLeftSizer = new wxBoxSizer(wxVERTICAL);
+ wxBoxSizer* pRightSizer = new wxBoxSizer(wxVERTICAL);
+
+ pLeftSizer->Add(pKnob, 0, wxALL, 2);
+
+ pLeftSizer->Add(
+ new wxStaticText(this, wxID_ANY, "Synthesizer Type"),
+ 0,
+ wxALL,
+ 2);
+ pLeftSizer->Add(mpSynthesizerListbox, 0, wxGROW | wxALL, 2);
+
+ pRightSizer->Add(
+ new wxStaticText(this, wxID_ANY, "Send MIDI Reset"),
+ 0,
+ wxALL,
+ 2);
+ pRightSizer->Add(mpStartListbox, 0, wxALL, 2);
+
+ pListControlSizer->Add(pLeftSizer, 0, wxALL, 3);
+ pListControlSizer->Add(pRightSizer, 0, wxALL, 3);
+
+ pTopSizer->Add(pListControlSizer, 0, wxCENTER);
+
+ pButtonSizer->Add(pOkButton, 0, wxALL, 5);
+ pButtonSizer->Add(pCancelButton, 0, wxALL, 5);
+ pButtonSizer->Add(pHelpButton, 0, wxALL, 5);
+
+ pTopSizer->Add(pButtonSizer, 0, wxALIGN_CENTER | wxBOTTOM, 6);
+
+ SetAutoLayout(true);
+ SetSizer(pTopSizer);
+
+ pTopSizer->SetSizeHints(this);
+ pTopSizer->Fit(this);
+}
Copied: trunk/jazz/src/DialogsTemporary/MetronomeSettingsDialog.h (from rev 409, trunk/jazz/src/dialogs/MetronomeSettingsDialog.h)
===================================================================
--- trunk/jazz/src/DialogsTemporary/MetronomeSettingsDialog.h (rev 0)
+++ trunk/jazz/src/DialogsTemporary/MetronomeSettingsDialog.h 2008-04-06 02:20:52 UTC (rev 410)
@@ -0,0 +1,45 @@
+//*****************************************************************************
+// The JAZZ++ Midi Sequencer
+//
+// Copyright (C) 2008 Peter J. Stieber, all rights reserved.
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+//*****************************************************************************
+
+#ifndef JZ_METRONOMESETTINGDIALOG_H
+#define JZ_METRONOMESETTINGDIALOG_H
+
+class JZMetronomeInfo;
+
+//*****************************************************************************
+//*****************************************************************************
+class JZMetronomeSettingsDialog : public wxDialog
+{
+ public:
+
+ JZMetronomeSettingsDialog(
+ wxWindow* pParent,
+ JZMetronomeInfo& MetronomeInfo);
+
+ private:
+
+ JZMetronomeInfo& mMetronomeInfo;
+
+ wxListBox* mpSynthesizerListbox;
+
+ wxListBox* mpStartListbox;
+};
+
+#endif // !defined(JZ_METRONOMESETTINGDIALOG_H)
Deleted: trunk/jazz/src/DialogsTemporary/copyDialog.cpp
===================================================================
--- trunk/jazz/src/dialogs/copyDialog.cpp 2008-04-06 00:02:09 UTC (rev 401)
+++ trunk/jazz/src/DialogsTemporary/copyDialog.cpp 2008-04-06 02:20:52 UTC (rev 410)
@@ -1,43 +0,0 @@
-/*
-** Alacrity Midi Sequencer
-**
-** Some Code Copyright (C) 1994-2000 Andreas Voss and Per Sigmond, all rights reserved.
-** I don't know why it says "All Rights Reserved" and then is licensed GPL
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-**
-*/
-
-#include "copyDialog.h"
-
-#ifndef __PORTING
-
-void tCopyDlg::OnHelp()
-{
- HelpInstance->ShowTopic("Replicate");
-}
-
-
-void tCopyDlg::EditForm(wxPanel *panel)
-{
- Add(wxMakeFormBool("Erase Destin", &cp->EraseDestin));
- Add(wxMakeFormBool("Repeat Copy", &cp->RepeatCopy));
- Add(wxMakeFormNewLine());
- Add(wxMakeFormBool("Erase Source", &cp->EraseSource));
- Add(wxMakeFormBool("Insert Space", &cp->InsertSpace));
- AssociatePanel(panel);
-}
-
-#endif // Porting
Copied: trunk/jazz/src/DialogsTemporary/copyDialog.cpp (from rev 409, trunk/jazz/src/dialogs/copyDialog.cpp)
===================================================================
--- trunk/jazz/src/DialogsTemporary/copyDialog.cpp (rev 0)
+++ trunk/jazz/src/DialogsTemporary/copyDialog.cpp 2008-04-06 02:20:52 UTC (rev 410)
@@ -0,0 +1,43 @@
+/*
+** Alacrity Midi Sequencer
+**
+** Some Code Copyright (C) 1994-2000 Andreas Voss and Per Sigmond, all rights reserved.
+** I don't know why it says "All Rights Reserved" and then is licensed GPL
+**
+** This program is free software; you can redistribute it and/or modify
+** it under the terms of the GNU General Public License as published by
+** the Free Software Foundation; either version 2 of the License, or
+** (at your option) any later version.
+**
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+** GNU General Public License for more details.
+**
+** You should have received a copy of the GNU General Public License
+** along with this program; if not, write to the Free Software
+** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+**
+*/
+
+#include "copyDialog.h"
+
+#ifndef __PORTING
+
+void tCopyDlg::OnHelp()
+{
+ HelpInstance->ShowTopic("Replicate");
+}
+
+
+void tCopyDlg::EditForm(wxPanel *panel)
+{
+ Add(wxMakeFormBool("Erase Destin", &cp->EraseDestin));
+ Add(wxMakeFormBool("Repeat Copy", &cp->RepeatCopy));
+ Add(wxMakeFormNewLine());
+ Add(wxMakeFormBool("Erase Source", &cp->EraseSource));
+ Add(wxMakeFormBool("Insert Space", &cp->InsertSpace));
+ AssociatePanel(panel);
+}
+
+#endif // Porting
Deleted: trunk/jazz/src/DialogsTemporary/copyDialog.h
===================================================================
--- trunk/jazz/src/dialogs/copyDialog.h 2008-04-06 00:02:09 UTC (rev 401)
+++ trunk/jazz/src/DialogsTemporary/copyDialog.h 2008-04-06 02:20:52 UTC (rev 410)
@@ -1,46 +0,0 @@
-/*
-** Alacrity Midi Sequencer
-**
-** Some Code Copyright (C) 1994-2000 Andreas Voss and Per Sigmond, all rights reserved.
-** I don't know why it says "All Rights Reserved" and then is licensed GPL
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-**
-*/
-
-#ifndef COPYDIALOG
-#define COPYDIALOG
-
-#include "../commands/copyCommand.h"
-
-#ifndef __PORTING
-
-class tCopyDlg : public wxForm
-{
- tCopyCommand *cp;
-
- public:
- tCopyDlg(tCopyCommand *c)
- : wxForm( USED_WXFORM_BUTTONS ) { cp = c; }
- void OnOk() { cp->OnOk(); wxForm::OnOk(); }
- void OnCancel() { cp->OnCancel(); wxForm::OnCancel(); }
- void OnHelp();
- void EditForm(wxPanel *panel);
-};
-
-#endif // Porting
-
-#endif // COPYDIALOG
-
Copied: trunk/jazz/src/DialogsTemporary/copyDialog.h (from rev 409, trunk/jazz/src/dialogs/copyDialog.h)
===================================================================
--- trunk/jazz/src/DialogsTemporary/copyDialog.h (rev 0)
+++ trunk/jazz/src/DialogsTemporary/copyDialog.h 2008-04-06 02:20:52 UTC (rev 410)
@@ -0,0 +1,46 @@
+/*
+** Alacrity Midi Sequencer
+**
+** Some Code Copyright (C) 1994-2000 Andreas Voss and Per Sigmond, all rights reserved.
+** I don't know why it says "All Rights Reserved" and then is licensed GPL
+**
+** This program is free software; you can redistribute it and/or modify
+** it under the terms of the GNU General Public License as published by
+** the Free Software Foundation; either version 2 of the License, or
+** (at your option) any later version.
+**
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+** GNU General Public License for more details.
+**
+** You should have received a copy of the GNU General Public License
+** along with this program; if not, write to the Free Software
+** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+**
+*/
+
+#ifndef COPYDIALOG
+#define COPYDIALOG
+
+#include "../commands/copyCommand.h"
+
+#ifndef __PORTING
+
+class tCopyDlg : public wxForm
+{
+ tCopyCommand *cp;
+
+ public:
+ tCopyDlg(tCopyCommand *c)
+ : wxForm( USED_WXFORM_BUTTONS ) { cp = c; }
+ void OnOk() { cp->OnOk(); wxForm::OnOk(); }
+ void OnCancel() { cp->OnCancel(); wxForm::OnCancel(); }
+ void OnHelp();
+ void EditForm(wxPanel *panel);
+};
+
+#endif // Porting
+
+#endif // COPYDIALOG
+
Deleted: trunk/jazz/src/DialogsTemporary/copyright.cpp
===================================================================
--- trunk/jazz/src/dialogs/copyright.cpp 2008-04-06 00:02:09 UTC (rev 401)
+++ trunk/jazz/src/DialogsTemporary/copyright.cpp 2008-04-06 02:20:52 UTC (rev 410)
@@ -1,59 +0,0 @@
-/*
-** Alacrity Midi Sequencer
-**
-** Some Code Copyright (C) 1994-2000 Andreas Voss and Per Sigmond, all rights reserved.
-** I don't know why it says "All Rights Reserved" and then is licensed GPL
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-**
-*/
-
-#include "copyright.h"
-#include "song.h"
-
-////////////////////////////////////////////////////////////////////////////////
-// ******************************************************************
-// Copyright dialog
-// ******************************************************************
-
-tCopyrightDlg::tCopyrightDlg(tSong* song):tPropertyListDlg("Music Copyright")
-{
- this->song=song;
-}
-
-void tCopyrightDlg::AddProperties()
-{
- copyrightProp=new wxProperty("Copyright notice","string","string");
- char *cs = song->GetTrack(0)->GetCopyright();
-
-
- if ( cs && strlen(cs) )
- {
- String = copystring( cs );
- }
- else
- {
- String = copystring( "Copyright (C) <year> <owner>" );
- }
-
- copyrightProp->SetValue(wxPropertyValue(String));
- sheet->AddProperty(copyrightProp);
- }
-
-bool tCopyrightDlg::OnClose(){
- song->GetTrack(0)->SetCopyright(copyrightProp->GetValue().StringValue() );
- return FALSE;
-}
-
Copied: trunk/jazz/src/DialogsTemporary/copyright.cpp (from rev 409, trunk/jazz/src/dialogs/copyright.cpp)
===================================================================
--- trunk/jazz/src/DialogsTemporary/copyright.cpp (rev 0)
+++ trunk/jazz/src/DialogsTemporary/copyright.cpp 2008-04-06 02:20:52 UTC (rev 410)
@@ -0,0 +1,59 @@
+/*
+** Alacrity Midi Sequencer
+**
+** Some Code Copyright (C) 1994-2000 Andreas Voss and Per Sigmond, all rights reserved.
+** I don't know why it says "All Rights Reserved" and then is licensed GPL
+**
+** This program is free software; you can redistribute it and/or modify
+** it under the terms of the GNU General Public License as published by
+** the Free Software Foundation; either version 2 of the License, or
+** (at your option) any later version.
+**
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+** GNU General Public License for more details.
+**
+** You should have received a copy of the GNU General Public License
+** along with this program; if not, write to the Free Software
+** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+**
+*/
+
+#include "copyright.h"
+#include "song.h"
+
+////////////////////////////////////////////////////////////////////////////////
+// ******************************************************************
+// Copyright dialog
+// ******************************************************************
+
+tCopyrightDlg::tCopyrightDlg(tSong* song):tPropertyListDlg("Music Copyright")
+{
+ this->song=song;
+}
+
+void tCopyrightDlg::AddProperties()
+{
+ copyrightProp=new wxProperty("Copyright notice","string","string");
+ char *cs = song->GetTrack(0)->GetCopyright();
+
+
+ if ( cs && strlen(cs) )
+ {
+ String = copystring( cs );
+ }
+ else
+ {
+ String = copystring( "Copyright (C) <year> <owner>" );
+ }
+
+ copyrightProp->SetValue(wxPropertyValue(String));
+ sheet->AddProperty(copyrightProp);
+ }
+
+bool tCopyrightDlg::OnClose(){
+ song->GetTrack(0)->SetCopyright(copyrightProp->GetValue().StringValue() );
+ return FALSE;
+}
+
Deleted: trunk/jazz/src/DialogsTemporary/copyright.h
===================================================================
--- trunk/jazz/src/dialogs/copyright.h 2008-04-06 00:02:09 UTC (rev 401)
+++ trunk/jazz/src/DialogsTemporary/copyright.h 2008-04-06 02:20:52 UTC (rev 410)
@@ -1,42 +0,0 @@
-/*
-** Alacrity Midi Sequencer
-**
-** Some Code Copyright (C) 1994-2000 Andreas Voss and Per Sigmond, all rights reserved.
-** I don't know why it says "All Rights Reserved" and then is licensed GPL
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-**
-*/
-
-#ifndef COPYRIGHTDIALOG
-#define COPYRIGHTDIALOG
-
-#include "proplistdlg.h"
-
-/** new tCopyrightDlg using new baseclass tPropertyListDlg*/
-class tCopyrightDlg : public tPropertyListDlg
-{
-public:
- tCopyrightDlg(tSong* song);
- virtual void AddProperties();
- virtual bool OnClose();
-
-protected:
- tSong* song;
- wxProperty* copyrightProp;
- char* String;
-};
-
-#endif //COPYRIGHTDIALOG
Copied: trunk/jazz/src/DialogsTemporary/copyright.h (from rev 409, trunk/jazz/src/dialogs/copyright.h)
===================================================================
--- trunk/jazz/src/DialogsTemporary/copyright.h (rev 0)
+++ trunk/jazz/src/DialogsTemporary/copyright.h 2008-04-06 02:20:52 UTC (rev 410)
@@ -0,0 +1,42 @@
+/*
+** Alacrity Midi Sequencer
+**
+** Some Code Copyright (C) 1994-2000 Andreas Voss and Per Sigmond, all rights reserved.
+** I don't know why it says "All Rights Reserved" and then is licensed GPL
+**
+** This program is free software; you can redistribute it and/or modify
+** it under the terms of the GNU General Public License as published by
+** the Free Software Foundation; either version 2 of the License, or
+** (at your option) any later version.
+**
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+** GNU General Public License for more details.
+**
+** You should have received a copy of the GNU General Public License
+** along with this program; if not, write to the Free Software
+** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+**
+*/
+
+#ifndef COPYRIGHTDIALOG
+#define COPYRIGHTDIALOG
+
+#include "proplistdlg.h"
+
+/** new tCopyrightDlg using new baseclass tPropertyListDlg*/
+class tCopyrightDlg : public tPropertyListDlg
+{
+public:
+ tCopyrightDlg(tSong* song);
+ virtual void AddProperties();
+ virtual bool OnClose();
+
+protected:
+ tSong* song;
+ wxProperty* copyrightProp;
+ char* String;
+};
+
+#endif //COPYRIGHTDIALOG
Deleted: trunk/jazz/src/DialogsTemporary/metronomeSettings.cpp
===================================================================
--- trunk/jazz/src/dialogs/metronomeSettings.cpp 2008-04-06 00:02:09 UTC (rev 401)
+++ trunk/jazz/src/DialogsTemporary/metronomeSettings.cpp 2008-04-06 02:20:52 UTC (rev 410)
@@ -1,129 +0,0 @@
-/*
-** Alacrity Midi Sequencer
-**
-** Some Code Copyright (C) 1994-2000 Andreas Voss and Per Sigmond, all rights reserved.
-** I don't know why it says "All Rights Reserved" and then is licensed GPL
-**
-** This program is free software; you can redistribute it and/or modify
-** it under the terms of the GNU General Public License as published by
-** the Free Software Foundation; either version 2 of the License, or
-** (at your option) any later version.
-**
-** This program is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-** GNU General Public License for more details.
-**
-** You should have received a copy of the GNU General Public License
-** along with this program; if not, write to the Free Software
-** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-**
-*/
-
-#include "metronomeSettings.h"
-
-#ifndef __PORTING
-
-
-tMetronomeSettingsDlg::tMetronomeSettingsDlg(tEventWin *w)
-: wxForm( USED_WXFORM_BUTTONS )
-{
- EventWin = w;
- IsAccented = ((tTrackWin*)EventWin)->MetronomeInfo.IsAccented;
- KeyAcc = ((tTrackWin*)EventWin)->MetronomeInfo.KeyAcc;
- KeyNorm = ((tTrackWin*)EventWin)->MetronomeInfo.KeyNorm;
- Veloc = ((tTrackWin*)EventWin)->MetronomeInfo.Veloc;
-
- numNames = 0;
- for (int i = 0; Config.DrumName(i).Name; i++)
- {
- if (Config.DrumName(i).Name[0])
- {
- index2Pitch[numNames] = Config.DrumName(i).Value - 1;
- pitch2Index[Config.DrumName(i).Value - 1] = numNames;
- index2Name[numNames++] = Config.DrumName(i).Name;
- }
- }
- KeyAccName = copystring( index2Name[ pitch2Index[ KeyAcc ] ] );
- KeyNormName = copystring( index2Name[ pitch2Index[ KeyNorm ] ] );
-}
-
-
-void tMetronomeSettingsDlg::OnHelp()
-{
- HelpInstance->ShowTopic("Metronome Settings");
-}
-
-
-void tMetronomeSettingsDlg::OnCancel()
-{
- EventWin->DialogBox = 0;
- wxForm::OnCancel();
-}
-
-
-void tMetronomeSettingsDlg::OnOk()
-{
- ((tTrackWin*)EventWin)->MetronomeInfo.IsAccented = IsAccented;
- int i;
- for (i = 0; i < numNames; i++)
- {
- if ( !strcmp(index2Name[i], KeyNormName) )
- break;
- }
- if (i < numNames)
- ((tTrackWin*)EventWin)->MetronomeInfo.KeyNorm = index2Pitch[i];
- for (i = 0; i < numNames; i++)
- {
- if (!strcmp( index2Name[i], KeyAccName ) )
- break;
- }
- if (i < numNames)
- ((tTrackWin*)EventWin)->MetronomeInfo.KeyAcc = index2Pitch[i];
- ((tTrackWin*)EventWin)->MetronomeInfo.Veloc = Veloc;
- EventWin->Redraw();
- EventWin->DialogBox = 0;
- wxForm::OnOk();
-}
-
-
-
-void tMetronomeSettingsDlg::EditForm(wxPanel *panel)
-{
- Add(wxMakeFormBool( "Accented", &IsAccented ));
- Add(wxMakeFormNewLine());
- Add(wxMakeFormShort( " Velocity:", &Veloc, wxFORM_DEFAULT,
- new wxList(wxMakeConstraintRange(0.0, 127.0), 0)));
- Add(wxMakeFormNewLine());
- Add(wxMakeFormString( "Normal click:",
- &KeyNormName,
- wxFORM_DEFAULT,
- new wxList(wxMakeConstraintStrings(
- index2Name[ pitch2Index[ 37 ] ],
- index2Name[ pitch2Index[ 42 ] ],
- index2Name[ pitch2Index[ 56 ] ],
- 0 ), 0),
- NULL,
- wxVERTICAL
- )
- );
- Add(wxMakeFormNewLine());
- Add(wxMakeFormString( "Accented click:",
- &KeyAccName,
- wxFORM_DEFAULT,
- new wxList(wxMakeConstraintStrings(
- index2Name[ pitch2Index[ 36 ] ],
- index2Name[ pitch2Index[ 38 ] ],
- index2Name[ pitch2Index[ 54 ] ],
- 0 ), 0),
- NULL,
- wxVERTICAL
- )
- );
- AssociatePanel(panel);
-}
-
-
-
-#endif // Porting
-
Copied: trunk/jazz/src/DialogsTemporary/metronomeSettings.cpp (from rev 409, trunk/jazz/src/dialogs/metronomeSettings.cpp)
===================================================================
--- trunk/jazz/src/DialogsTemporary/metronomeSettings.cpp (rev 0)
+++ trunk/jazz/src/DialogsTemporary/metronomeSettings.cpp 2008-04-06 02:20:52 UTC (rev 410)
@@ -0,0 +1,129 @@
+/*
+** Alacrity Midi Sequencer
+**
+** Some Code Copyright (C) 1994-2000 Andreas Voss and Per Sigmond, all rights reserved.
+** I don't know why it says "All Rights Reserved" and then is licensed GPL
+**
+** This program is free software; you can redistribute it and/or modify
+** it under the terms of the GNU General Public License as published by
+** the Free Software Foundation; either version 2 of the License, or
+** (at your option) any later version.
+**
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+** GNU General Public License for more details.
+**
+** You should have received a copy of the GNU General Public License
+** along with this program; if not, write to the Free Software
+** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+**
+*/
+
+#include "metronomeSettings.h"
+
+#ifndef __PORTING
+
+
+tMetronomeSettingsDlg::tMetronomeSettingsDlg(tEventWin *w)
+: wxForm( USED_WXFORM_BUTTONS )
+{
+ EventWin = w;
+ IsAccented = ((tTrackWin*)EventWin)->MetronomeInfo.IsAccented;
+ KeyAcc = ((tTrackWin*)EventWin)->MetronomeInfo.KeyAcc;
+ KeyNorm = ((tTrackWin*)EventWin)->MetronomeInfo.KeyNorm;
+ Veloc = ((tTrackWin*)EventWin)->MetronomeInfo.Veloc;
+
+ numNames = 0;
+ for (int i = 0; Config.DrumName(i).Name; i++)
+ {
+ if (Config.DrumName(i).Name[0])
+ {
+ index2Pitch[numNames] = Config.DrumName(i).Value - 1;
+ pitch2Index[Config.DrumName(i).Value - 1] = numNames;
+ index2Name[numNames++] = Config.DrumName(i).Name;
+ }
+ }
+ KeyAccName = copystring( index2Name[ pitch2Index[ KeyAcc ] ] );
+ KeyNormName = copystring( index2Name[ pitch2Index[ KeyNorm ] ] );
+}
+
+
+void tMetronomeSettingsDlg::OnHelp()
+{
+ HelpInstance->ShowTopic("Metronome Settings");
+}
+
+
+void tMetronomeSettingsDlg::OnCancel()
+{
+ EventWin->DialogBox = 0;
+ wxForm::OnCancel();
+}
+
+
+void tMetronomeSettingsDlg::OnOk()
+{
+ ((tTrackWin*)EventWin)->MetronomeInfo.IsAccented = IsAccented;
+ int i;
+ for (i = 0; i < numNames; i++)
+ {
+ if ( !strcmp(index2Name[i], KeyNormName) )
+ break;
+ }
+ if (i < numNames)
+ ((tTrackWin*)EventWin)->MetronomeInfo.KeyNorm = index2Pitch[i];
+ for (i = 0; i < numNames; i++)
+ {
+ if (!strcmp( index2Name[i], KeyAccName ) )
+ break;
+ }
+ if (i < numNames)
+ ((tTrackWin*)EventWin)->MetronomeInfo.KeyAcc = index2Pitch[i];
+ ((tTrackWi...
[truncated message content] |
|
From: <pst...@us...> - 2008-04-08 04:35:06
|
Revision: 441
http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=441&view=rev
Author: pstieber
Date: 2008-04-07 21:34:59 -0700 (Mon, 07 Apr 2008)
Log Message:
-----------
1. Changed tScaleType to TEScaleType.
2. Added some menu entry update handlers.
Modified Paths:
--------------
trunk/jazz/src/Harmony.cpp
trunk/jazz/src/Harmony.h
trunk/jazz/src/HarmonyP.cpp
trunk/jazz/src/HarmonyP.h
Modified: trunk/jazz/src/Harmony.cpp
===================================================================
--- trunk/jazz/src/Harmony.cpp 2008-04-07 14:01:49 UTC (rev 440)
+++ trunk/jazz/src/Harmony.cpp 2008-04-08 04:34:59 UTC (rev 441)
@@ -481,6 +481,8 @@
public:
+ static TEScaleType GetScaleType();
+
HBCanvas(wxFrame* pParent, int x, int y, int w, int h);
virtual ~HBCanvas();
@@ -508,6 +510,8 @@
void ToggleHaunschildLayout();
+ bool IsUsingHaunschildLayout() const;
+
void FileLoad();
void FileSaveAs();
@@ -543,11 +547,11 @@
void SetMarker(int MenuId, wxToolBar* pToolBar);
- void SetScaleType(int MenuId, tScaleType ScaleType, wxToolBar* pToolBar);
+ void SetScaleType(int MenuId, TEScaleType ScaleType, wxToolBar* pToolBar);
private:
- static tScaleType mScaleType;
+ static TEScaleType mScaleType;
static int transpose_res;
@@ -594,6 +598,12 @@
DECLARE_EVENT_TABLE()
};
+inline
+bool HBCanvas::IsUsingHaunschildLayout() const
+{
+ return mHaunschildLayout;
+}
+
//*****************************************************************************
// Description:
// This is the harmony browser match markers class definition.
@@ -712,13 +722,20 @@
//*****************************************************************************
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-tScaleType HBCanvas::mScaleType = Major;
+TEScaleType HBCanvas::mScaleType = Major;
const int HBCanvas::ScFa = 50;
int HBCanvas::transpose_res = 8;
int HBCanvas::analyze_res = 8;
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
+TEScaleType HBCanvas::GetScaleType()
+{
+ return mScaleType;
+}
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
BEGIN_EVENT_TABLE(HBCanvas, wxScrolledWindow)
EVT_MOUSE_EVENTS(HBCanvas::OnMouseEvent)
@@ -1291,7 +1308,7 @@
//-----------------------------------------------------------------------------
void HBCanvas::SetScaleType(
int MenuId,
- tScaleType ScaleType,
+ TEScaleType ScaleType,
wxToolBar* pToolBar)
{
mScaleType = ScaleType;
@@ -1836,10 +1853,19 @@
//-----------------------------------------------------------------------------
BEGIN_EVENT_TABLE(HBFrame, wxFrame)
+
+ EVT_UPDATE_UI(MEN_MAJSCALE, HBFrame::OnUpdateMajorScale)
EVT_MENU(MEN_MAJSCALE, HBFrame::OnToolBarSelect)
+
+ EVT_UPDATE_UI(MEN_HARSCALE, HBFrame::OnUpdateHarmonicMinorScale)
EVT_MENU(MEN_HARSCALE, HBFrame::OnToolBarSelect)
+
+ EVT_UPDATE_UI(MEN_MELSCALE, HBFrame::OnUpdateMelodicMinorScale)
EVT_MENU(MEN_MELSCALE, HBFrame::OnToolBarSelect)
+
+ EVT_UPDATE_UI(MEN_IONSCALE, HBFrame::OnUpdateIonicScale)
EVT_MENU(MEN_IONSCALE, HBFrame::OnToolBarSelect)
+
EVT_MENU(MEN_EQ4, HBFrame::OnToolBarSelect)
EVT_MENU(MEN_EQ3, HBFrame::OnToolBarSelect)
EVT_MENU(MEN_EQ2, HBFrame::OnToolBarSelect)
@@ -1859,6 +1885,7 @@
EVT_MENU(MEN_MIDI, HBFrame::OnSettingsMidi)
+ EVT_UPDATE_UI(MEN_MAJSCALE, HBFrame::OnUpdateHaunschildLayout)
EVT_MENU(MEN_HAUNSCH, HBFrame::OnSettingsHaunschild)
EVT_MENU(MEN_CLEARSEQ, HBFrame::OnActionClearSequence)
@@ -1899,13 +1926,17 @@
pSettingsMenu->Append(MEN_EDIT, "&Chord");
pSettingsMenu->Append(MEN_SETTINGS, "&Global");
pSettingsMenu->Append(MEN_MIDI, "&Midi");
- pSettingsMenu->Append(MEN_HAUNSCH, "&Haunschild Layout");
+ pSettingsMenu->Append(
+ MEN_HAUNSCH,
+ "&Haunschild Layout",
+ "Display using Haunschild Layout",
+ true);
wxMenu* pScaleMenu = new wxMenu;
- pScaleMenu->Append(MEN_MAJSCALE, "&Major");
- pScaleMenu->Append(MEN_HARSCALE, "&Harmonic Minor");
- pScaleMenu->Append(MEN_MELSCALE, "&Melodic Minor");
- pScaleMenu->Append(MEN_IONSCALE, "&Ionic");
+ pScaleMenu->Append(MEN_MAJSCALE, "&Major", "Use Major Scales", true);
+ pScaleMenu->Append(MEN_HARSCALE, "&Harmonic Minor", "Use Harmonic Minor Scales", true);
+ pScaleMenu->Append(MEN_MELSCALE, "&Melodic Minor", "Use Melodic Minor Scales", true);
+ pScaleMenu->Append(MEN_IONSCALE, "&Ionic", "Use Ionic Scales", true);
wxMenu* pShowMenu = new wxMenu;
pShowMenu->Append(MEN_EQ4, "&4 equal notes");
@@ -2018,6 +2049,34 @@
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
+void HBFrame::OnUpdateMajorScale(wxUpdateUIEvent& Event)
+{
+ Event.Check(HBCanvas::GetScaleType() == Major);
+}
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+void HBFrame::OnUpdateHarmonicMinorScale(wxUpdateUIEvent& Event)
+{
+ Event.Check(HBCanvas::GetScaleType() == Harmon);
+}
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+void HBFrame::OnUpdateMelodicMinorScale(wxUpdateUIEvent& Event)
+{
+ Event.Check(HBCanvas::GetScaleType() == Melod);
+}
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+void HBFrame::OnUpdateIonicScale(wxUpdateUIEvent& Event)
+{
+ Event.Check(HBCanvas::GetScaleType() == Ionb13);
+}
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
void HBFrame::OnToolBarSelect(wxCommandEvent& Event)
{
mpHbWindow->MenuCommand(
@@ -2048,6 +2107,13 @@
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
+void HBFrame::OnUpdateHaunschildLayout(wxUpdateUIEvent& Event)
+{
+ Event.Check(mpHbWindow->IsUsingHaunschildLayout());
+}
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
void HBFrame::OnSettingsHaunschild(wxCommandEvent& Event)
{
mpHbWindow->ToggleHaunschildLayout();
Modified: trunk/jazz/src/Harmony.h
===================================================================
--- trunk/jazz/src/Harmony.h 2008-04-07 14:01:49 UTC (rev 440)
+++ trunk/jazz/src/Harmony.h 2008-04-08 04:34:59 UTC (rev 441)
@@ -86,6 +86,11 @@
protected:
+ void OnUpdateMajorScale(wxUpdateUIEvent& Event);
+ void OnUpdateHarmonicMinorScale(wxUpdateUIEvent& Event);
+ void OnUpdateMelodicMinorScale(wxUpdateUIEvent& Event);
+ void OnUpdateIonicScale(wxUpdateUIEvent& Event);
+
void OnToolBarSelect(wxCommandEvent& Event);
void OnFileLoad(wxCommandEvent& Event);
@@ -96,6 +101,7 @@
void OnSettingsMidi(wxCommandEvent& Event);
+ void OnUpdateHaunschildLayout(wxUpdateUIEvent& Event);
void OnSettingsHaunschild(wxCommandEvent& Event);
void OnActionClearSequence(wxCommandEvent& Event);
Modified: trunk/jazz/src/HarmonyP.cpp
===================================================================
--- trunk/jazz/src/HarmonyP.cpp 2008-04-07 14:01:49 UTC (rev 440)
+++ trunk/jazz/src/HarmonyP.cpp 2008-04-08 04:34:59 UTC (rev 441)
@@ -147,7 +147,9 @@
buf[i++] = '-';
}
if (c.Contains(2))
+ {
buf[i++] = '9';
+ }
if (sharp9)
{
@@ -312,7 +314,7 @@
};
-HBContext::HBContext(int sn, int cn, tScaleType st)
+HBContext::HBContext(int sn, int cn, TEScaleType st)
{
scale_type = st;
scale_nr = sn % 12;
@@ -454,7 +456,7 @@
int sc;
is >> sc >> a.scale_nr >> a.chord_nr >> a.seq_nr >> a.chord_key;
is >> a.chord >> a.scale;
- a.scale_type = (tScaleType)sc;
+ a.scale_type = (TEScaleType)sc;
return is;
}
@@ -470,7 +472,7 @@
HBContextIterator::HBContextIterator()
: match(def_match)
{
- context.scale_type = (tScaleType)0;
+ context.scale_type = (TEScaleType)0;
context.scale_nr = 0;
context.chord_nr = -1;
i_seq = n_seq = 0;
@@ -480,7 +482,7 @@
HBContextIterator::HBContextIterator(HBMatch &m)
: match(m)
{
- context.scale_type = (tScaleType)0;
+ context.scale_type = (TEScaleType)0;
context.scale_nr = 0;
context.chord_nr = -1;
i_seq = n_seq = 0;
@@ -495,7 +497,7 @@
{
if (scale_type != nScaleTypes && context.scale_type != scale_type)
{
- context.scale_type = (tScaleType)((int)context.scale_type + 1);
+ context.scale_type = (TEScaleType)((int)context.scale_type + 1);
continue;
}
@@ -512,7 +514,7 @@
context.scale_nr ++;
}
context.scale_nr = 0;
- context.scale_type = (tScaleType)((int)context.scale_type + 1);
+ context.scale_type = (TEScaleType)((int)context.scale_type + 1);
}
while (i_seq < n_seq)
Modified: trunk/jazz/src/HarmonyP.h
===================================================================
--- trunk/jazz/src/HarmonyP.h 2008-04-07 14:01:49 UTC (rev 440)
+++ trunk/jazz/src/HarmonyP.h 2008-04-08 04:34:59 UTC (rev 441)
@@ -29,7 +29,14 @@
// HBChord
// ------------------------------------------------------------------
-enum tScaleType { Major, Harmon, Melod, Ionb13, nScaleTypes };
+enum TEScaleType
+{
+ Major,
+ Harmon,
+ Melod,
+ Ionb13,
+ nScaleTypes
+};
class HBChord
@@ -257,7 +264,7 @@
public:
- HBContext(int sn, int cn = 0, tScaleType st = Major);
+ HBContext(int sn, int cn = 0, TEScaleType st = Major);
HBContext();
@@ -301,7 +308,7 @@
return scale_nr;
}
- tScaleType ScaleType() const
+ TEScaleType ScaleType() const
{
return scale_type;
}
@@ -352,7 +359,7 @@
int MakeChordKey() const;
- tScaleType scale_type;
+ TEScaleType scale_type;
int scale_nr;
@@ -426,7 +433,7 @@
n_seq = n;
}
- void SetScaleType(tScaleType st)
+ void SetScaleType(TEScaleType st)
{
scale_type = st;
}
@@ -455,7 +462,7 @@
int i_seq, n_seq;
- tScaleType scale_type;
+ TEScaleType scale_type;
};
#endif // !defined(JZ_HARMONYP_H)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|