From: <pst...@us...> - 2009-01-20 00:46:09
|
Revision: 688 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=688&view=rev Author: pstieber Date: 2009-01-20 00:46:00 +0000 (Tue, 20 Jan 2009) Log Message: ----------- Replaced tab characters with spaces. Modified Paths: -------------- branches/jazz-4.1.3/src/audiodrv.h branches/jazz-4.1.3/src/ctrledit.h branches/jazz-4.1.3/src/events.cpp branches/jazz-4.1.3/src/eventwin.h branches/jazz-4.1.3/src/filter.cpp branches/jazz-4.1.3/src/filter.h branches/jazz-4.1.3/src/genmeldy.cpp branches/jazz-4.1.3/src/guitar.cpp branches/jazz-4.1.3/src/harmonyp.cpp branches/jazz-4.1.3/src/harmonyp.h branches/jazz-4.1.3/src/hbanalyz.cpp branches/jazz-4.1.3/src/jazz.h branches/jazz-4.1.3/src/maction.cpp branches/jazz-4.1.3/src/maction.h branches/jazz-4.1.3/src/mapper.cpp branches/jazz-4.1.3/src/mapper.h branches/jazz-4.1.3/src/mstdfile.h branches/jazz-4.1.3/src/pianowin.cpp branches/jazz-4.1.3/src/pianowin.h branches/jazz-4.1.3/src/player.cpp branches/jazz-4.1.3/src/random.cpp branches/jazz-4.1.3/src/random.h branches/jazz-4.1.3/src/rhythm.cpp branches/jazz-4.1.3/src/rhythm.h branches/jazz-4.1.3/src/samplcmd.cpp branches/jazz-4.1.3/src/samplcmd.h branches/jazz-4.1.3/src/sampldlg.cpp branches/jazz-4.1.3/src/sample.cpp branches/jazz-4.1.3/src/sample.h branches/jazz-4.1.3/src/samplwin.cpp branches/jazz-4.1.3/src/sb_scrol.c branches/jazz-4.1.3/src/shuffle.cpp branches/jazz-4.1.3/src/shuffle.h branches/jazz-4.1.3/src/sig2.cpp branches/jazz-4.1.3/src/sig2.h branches/jazz-4.1.3/src/signali.h branches/jazz-4.1.3/src/song.cpp branches/jazz-4.1.3/src/song.h branches/jazz-4.1.3/src/splcmplx.cpp branches/jazz-4.1.3/src/splcmplx.h branches/jazz-4.1.3/src/synth.cpp branches/jazz-4.1.3/src/synth.h branches/jazz-4.1.3/src/track.cpp branches/jazz-4.1.3/src/track.h branches/jazz-4.1.3/src/trackwin.cpp branches/jazz-4.1.3/src/trackwin.h branches/jazz-4.1.3/src/util.cpp branches/jazz-4.1.3/src/util.h branches/jazz-4.1.3/src/winaudio.cpp branches/jazz-4.1.3/src/winaudio.h Modified: branches/jazz-4.1.3/src/audiodrv.h =================================================================== --- branches/jazz-4.1.3/src/audiodrv.h 2009-01-19 21:43:48 UTC (rev 687) +++ branches/jazz-4.1.3/src/audiodrv.h 2009-01-20 00:46:00 UTC (rev 688) @@ -28,7 +28,7 @@ // in oss/free (from kernel 2.0.29) the following is not implemented // but this works for oss/linux for 2.0.29 // #ifndef SNDCTL_SEQ_GETTIME -// #define SNDCTL_SEQ_GETTIME _IOR ('Q',19, int) +// #define SNDCTL_SEQ_GETTIME _IOR ('Q',19, int) // #endif #include <sys/time.h> @@ -67,7 +67,7 @@ } private: - int can_duplex; // TRUE = can do full duplex record/play + int can_duplex; // TRUE = can do full duplex record/play int WriteSamples(); void ReadSamples(); @@ -87,10 +87,9 @@ tAudioListener *listener; tAudioRecordBuffer recbuffers; - int force_read; // needed by buggy audio driver ... + int force_read; // needed by buggy audio driver ... }; - #endif // AUDIO #endif Modified: branches/jazz-4.1.3/src/ctrledit.h =================================================================== --- branches/jazz-4.1.3/src/ctrledit.h 2009-01-19 21:43:48 UTC (rev 687) +++ branches/jazz-4.1.3/src/ctrledit.h 2009-01-20 00:46:00 UTC (rev 688) @@ -83,7 +83,7 @@ int sticky; // SN++ - int x_off; + int x_off; int ctrlmode; tTrack *track; long from_clock; Modified: branches/jazz-4.1.3/src/events.cpp =================================================================== --- branches/jazz-4.1.3/src/events.cpp 2009-01-19 21:43:48 UTC (rev 687) +++ branches/jazz-4.1.3/src/events.cpp 2009-01-20 00:46:00 UTC (rev 688) @@ -79,15 +79,17 @@ { #ifndef wx_msw FILE *testfd = fopen(fname, "r"); - if (testfd) { - fclose( testfd ); - char *syscmd; - syscmd = new char[ strlen( "cp" ) + 2*strlen( fname ) + strlen( ".backup" ) + 3 ]; - sprintf( syscmd, "cp %s %s.backup", fname, fname ); - if (system( syscmd ) != 0) { - fprintf(stderr, "Could not make backup file %s.backup\n", fname ); - } - delete syscmd; + if (testfd) + { + fclose( testfd ); + char *syscmd; + syscmd = new char[ strlen( "cp" ) + 2*strlen( fname ) + strlen( ".backup" ) + 3 ]; + sprintf( syscmd, "cp %s %s.backup", fname, fname ); + if (system( syscmd ) != 0) + { + fprintf(stderr, "Could not make backup file %s.backup\n", fname ); + } + delete syscmd; } #endif fd = fopen(fname, "wb"); Modified: branches/jazz-4.1.3/src/eventwin.h =================================================================== --- branches/jazz-4.1.3/src/eventwin.h 2009-01-19 21:43:48 UTC (rev 687) +++ branches/jazz-4.1.3/src/eventwin.h 2009-01-20 00:46:00 UTC (rev 688) @@ -95,8 +95,8 @@ // Setup() wxFont *Font; - wxFont *FixedFont; // bleibt bei 12pt - int hFixedFont; // Hoehe eines Buchstaben + wxFont *FixedFont; // bleibt bei 12pt + int hFixedFont; // Hoehe eines Buchstaben long LittleBit; long hLine; @@ -113,7 +113,7 @@ // filled by OnPaint() wxDC *dc; long xEvents, yEvents, wEvents, hEvents; - long xx, yy, ww, hh; // canvas coords + long xx, yy, ww, hh; // canvas coords long FromClock, ToClock; long FromLine, ToLine; @@ -162,7 +162,7 @@ // Edit-Menu - int EventsSelected(const char *msg = 0); // if selection active: TRUE, else: Errormessage + FALSE + int EventsSelected(const char *msg = 0); // if selection active: TRUE, else: Errormessage + FALSE void MenQuantize(); void MenSetChannel(); void MenTranspose(); Modified: branches/jazz-4.1.3/src/filter.cpp =================================================================== --- branches/jazz-4.1.3/src/filter.cpp 2009-01-19 21:43:48 UTC (rev 687) +++ branches/jazz-4.1.3/src/filter.cpp 2009-01-20 00:46:00 UTC (rev 688) @@ -34,14 +34,14 @@ const tFltEvent FltEvents[nFltEvents] = { - { StatKeyOn, "Note", 1, 0, 127}, - { StatKeyPressure, "Poly Aftertouch",1, 0, 127}, - { StatControl, "Controller", 1, 0, 127}, - { StatProgram, "Patch", 1, 0, 127}, - { StatPitch, "Pitch", 1, -8192, 8192}, - { StatTimeSignat, "Meter", 1, 0, 0}, - { StatChnPressure, "Channel Aftertouch",1, 0, 0}, - { StatSysEx, "SysEx", 1, 0, 0} + { StatKeyOn, "Note", 1, 0, 127}, + { StatKeyPressure, "Poly Aftertouch", 1, 0, 127}, + { StatControl, "Controller", 1, 0, 127}, + { StatProgram, "Patch", 1, 0, 127}, + { StatPitch, "Pitch", 1, -8192, 8192}, + { StatTimeSignat, "Meter", 1, 0, 0}, + { StatChnPressure, "Channel Aftertouch", 1, 0, 0}, + { StatSysEx, "SysEx", 1, 0, 0} }; @@ -152,11 +152,11 @@ { Add(wxMakeFormShort("Min:", &Filter->FltEvents[i].FromValue, wxFORM_DEFAULT,0,0,0,90)); Add(wxMakeFormShort("Max:", &Filter->FltEvents[i].ToValue, wxFORM_DEFAULT,0,0,0,90)); - Add(wxMakeFormBool(Filter->FltEvents[i].Name, &Filter->FltEvents[i].Selected, wxFORM_DEFAULT)); + Add(wxMakeFormBool(Filter->FltEvents[i].Name, &Filter->FltEvents[i].Selected, wxFORM_DEFAULT)); Add(wxMakeFormNewLine()); } else - Add(wxMakeFormBool(Filter->FltEvents[i].Name, &Filter->FltEvents[i].Selected, wxFORM_DEFAULT)); + Add(wxMakeFormBool(Filter->FltEvents[i].Name, &Filter->FltEvents[i].Selected, wxFORM_DEFAULT)); } Add(wxMakeFormBool("Other", &Filter->OtherSelected)); Modified: branches/jazz-4.1.3/src/filter.h =================================================================== --- branches/jazz-4.1.3/src/filter.h 2009-01-19 21:43:48 UTC (rev 687) +++ branches/jazz-4.1.3/src/filter.h 2009-01-20 00:46:00 UTC (rev 688) @@ -35,16 +35,16 @@ class tTrack; -#define FltKeyOn 0 +#define FltKeyOn 0 #define FltKeyPressure 1 // SN++ PolyAftertouch gehoert to KeyOn Events! -#define FltControl 2 -#define FltProgram 3 -#define FltPitch 4 -#define FltTempo 5 +#define FltControl 2 +#define FltProgram 3 +#define FltPitch 4 +#define FltTempo 5 #define FltChnPressure 6 // SN++ Channel Aftertouch #define FltSysEx 7 -#define nFltEvents 8 +#define nFltEvents 8 class tFltEvent @@ -71,8 +71,8 @@ Bool OtherSelected; tSong *Song; - long FromClock, ToClock; // einschl .. ausschl - int FromTrack, ToTrack; // 1..n einschl .. einschl + long FromClock, ToClock; // include .. drop + int FromTrack, ToTrack; // 1..n include .. drop void Dialog(wxFrame *parent, int ShowEventStats = 1); @@ -88,24 +88,24 @@ for (int i = 0; i < nFltEvents; i++) { if (e->Stat == FltEvents[i].Stat) - { - // SN++ Aftertouch gehoert eigendlich zu KeyOn Events. - if (e->Stat == StatKeyPressure) { + { + // SN++ Aftertouch gehoert eigendlich zu KeyOn Events. + if (e->Stat == StatKeyPressure) { int aval = e->IsKeyPressure()->Key; return FltEvents[i].Selected && - FltEvents[i].FromValue <= aval && aval <= FltEvents[i].ToValue; - } - if( e->Stat == StatTimeSignat) - return FltEvents[i].Selected; - // SN++ + FltEvents[i].FromValue <= aval && aval <= FltEvents[i].ToValue; + } + if( e->Stat == StatTimeSignat) + return FltEvents[i].Selected; + // SN++ if( e->Stat == StatChnPressure) - return FltEvents[i].Selected; + return FltEvents[i].Selected; if (e->Stat == StatSysEx) - return FltEvents[i].Selected; + return FltEvents[i].Selected; return FltEvents[i].Selected && FltEvents[i].FromValue <= val && val <= FltEvents[i].ToValue; - } + } } return OtherSelected; } Modified: branches/jazz-4.1.3/src/genmeldy.cpp =================================================================== --- branches/jazz-4.1.3/src/genmeldy.cpp 2009-01-19 21:43:48 UTC (rev 687) +++ branches/jazz-4.1.3/src/genmeldy.cpp 2009-01-20 00:46:00 UTC (rev 688) @@ -45,24 +45,25 @@ #include "../bitmaps/play.xpm" #include "../bitmaps/help.xpm" -static tToolDef tdefs[] = { - { MEN_LOAD, FALSE, 0, tb_open }, - { MEN_SAVE, FALSE, 1, tb_save }, - { MEN_GEN, FALSE, 0, tb_rrggen }, - { MEN_TRANSP, FALSE, 0, tb_transpos }, - { MEN_PLAY, FALSE, 1, tb_play }, - { MEN_HELP, FALSE, 0, tb_help } +static tToolDef tdefs[] = +{ + { MEN_LOAD, FALSE, 0, tb_open }, + { MEN_SAVE, FALSE, 1, tb_save }, + { MEN_GEN, FALSE, 0, tb_rrggen }, + { MEN_TRANSP, FALSE, 0, tb_transpos }, + { MEN_PLAY, FALSE, 1, tb_play }, + { MEN_HELP, FALSE, 0, tb_help } }; #else static tToolDef tdefs[] = { - { MEN_LOAD, FALSE, 0, "tb_open", "load settings" }, - { MEN_SAVE, FALSE, 1, "tb_save", "save settings" }, - { MEN_GEN, FALSE, 0, "tb_rrggen", "generate" }, - { MEN_TRANSP, FALSE, 0, "tb_transpos", "transpose trackwin selection" }, - { MEN_PLAY, FALSE, 1, "tb_play", "play" }, - { MEN_HELP, FALSE, 0, "tb_help", "help" } + { MEN_LOAD, FALSE, 0, "tb_open", "load settings" }, + { MEN_SAVE, FALSE, 1, "tb_save", "save settings" }, + { MEN_GEN, FALSE, 0, "tb_rrggen", "generate" }, + { MEN_TRANSP, FALSE, 0, "tb_transpos", "transpose trackwin selection" }, + { MEN_PLAY, FALSE, 1, "tb_play", "play" }, + { MEN_HELP, FALSE, 0, "tb_help", "help" } }; #endif @@ -156,8 +157,9 @@ case MEN_LOAD: { char * fname = file_selector(default_filename, "Load Generator", 0, 0, "*.mel"); - if (fname) { - ifstream is(fname); + if (fname) + { + ifstream is(fname); int x; is >> x; // version is >> pitch_center; @@ -184,8 +186,9 @@ case MEN_SAVE: { char * fname = file_selector(default_filename, "Save Generator", 1, 0, "*.mel"); - if (fname) { - ofstream os(fname); + if (fname) + { + ofstream os(fname); os << 1 << endl; os << pitch_center << " "; os << pitch_range << " "; @@ -214,8 +217,8 @@ break; case MEN_HELP: - HelpInstance->ShowTopic("Random Melody Generator"); - break; + HelpInstance->ShowTopic("Random Melody Generator"); + break; } } Modified: branches/jazz-4.1.3/src/guitar.cpp =================================================================== --- branches/jazz-4.1.3/src/guitar.cpp 2009-01-19 21:43:48 UTC (rev 687) +++ branches/jazz-4.1.3/src/guitar.cpp 2009-01-20 00:46:00 UTC (rev 688) @@ -89,11 +89,11 @@ static const int bass_pitches[4]; int ww, hh; - int hstring, wfret; // rounded values + int hstring, wfret; // rounded values float wtext, htext; - int act_pitch; // mouse move - int play_pitch; // sound - long put_clock; // left up + int act_pitch; // mouse move + int play_pitch; // sound + long put_clock; // left up wxFont *font; }; @@ -116,7 +116,9 @@ public: tGuitarSettingsDlg(tGuitarCanvas *c) - : wxForm( USED_WXFORM_BUTTONS ), cnvs(c) {} + : wxForm( USED_WXFORM_BUTTONS ), cnvs(c) + { + } void EditForm(wxPanel *panel); virtual void OnOk(); virtual void OnHelp(); @@ -249,22 +251,22 @@ case 0: case 11: case 23: - dc->DrawLine(x+2, y1, x+2, y2); - break; + dc->DrawLine(x+2, y1, x+2, y2); + break; case 4: case 6: case 16: case 18: - dc->DrawLine(x+2, y1+d1, x+2, y2-d1); - break; + dc->DrawLine(x+2, y1+d1, x+2, y2-d1); + break; default: case 2: case 8: case 14: case 20: - break; + break; } } @@ -316,7 +318,7 @@ { for (int i = 0; i < n_strings; i++) for (int p = pitch % 12; p < 127; p += 12) - DrawPitch(p, i, show); + DrawPitch(p, i, show); } else for (int i = 0; i < n_strings; i++) @@ -364,8 +366,8 @@ } if (pitch) { - tKeyOn on(0, piano->Channel(), pitch, 80); - Midi->OutNow(piano->Track, &on); + tKeyOn on(0, piano->Channel(), pitch, 80); + Midi->OutNow(piano->Track, &on); } play_pitch = pitch; } @@ -412,10 +414,10 @@ // tGuitarWin // ==================================================================== -#define MEN_CLEAR 1 -#define MEN_SETTINGS 2 -#define MEN_CLOSE 3 -#define MEN_HELP 4 +#define MEN_CLEAR 1 +#define MEN_SETTINGS 2 +#define MEN_CLOSE 3 +#define MEN_HELP 4 tGuitarWin::tGuitarWin(tPianoWin *parent) : wxFrame(0, "Guitar board", 20, 20, 600, 120) @@ -424,12 +426,12 @@ int w = 600, h = 120; piano = parent; wxMenu *menu = new wxMenu; - menu->Append(MEN_CLEAR, "C&lear"); - menu->Append(MEN_SETTINGS, "&Settings"); - menu->Append(MEN_HELP, "&Help"); - menu->Append(MEN_CLOSE, "&Close"); + menu->Append(MEN_CLEAR, "C&lear"); + menu->Append(MEN_SETTINGS, "&Settings"); + menu->Append(MEN_HELP, "&Help"); + menu->Append(MEN_CLOSE, "&Close"); wxMenuBar *menu_bar = new wxMenuBar; - menu_bar->Append(menu, "&Menu"); + menu_bar->Append(menu, "&Menu"); SetMenuBar(menu_bar); canvas = new tGuitarCanvas(this, piano, 0, 0, w, h); } Modified: branches/jazz-4.1.3/src/harmonyp.cpp =================================================================== --- branches/jazz-4.1.3/src/harmonyp.cpp 2009-01-19 21:43:48 UTC (rev 687) +++ branches/jazz-4.1.3/src/harmonyp.cpp 2009-01-20 00:46:00 UTC (rev 688) @@ -29,7 +29,8 @@ // HBChord // ======================================================================== -const char *const HBChord::scale_names[2][12] = { +const char *const HBChord::scale_names[2][12] = +{ { "C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B" }, { "C", "Db", "D", "Eb", "E", "F", "Gb", "G", "Ab", "A", "Bb", "B" } }; @@ -205,15 +206,19 @@ void HBChord::Rotate(int semis) { - if (semis > 0) { - while (semis--) { + if (semis > 0) + { + while (semis--) + { if (keys & 0x800) keys = ((keys & ~0x800) << 1) + 1; else keys <<= 1; } } - else if (semis < 0) { - while (semis++) { + else if (semis < 0) + { + while (semis++) + { if (keys & 1) keys = (keys >> 1) | 0x800; else keys >>= 1; @@ -526,70 +531,71 @@ }; scdef scales[] = { - { "***** major scales *****", ""}, - { "major penta", "1 9 3 5 13" }, - { "ionic", "1 9 3 11 5 13 j7" }, - { "lydic", "1 9 3 11+ 5 13 j7"}, - { "har III (ion 5+)", "1 9 3 11 5+ 13 j7"}, - { "har VI (lyd 9+)", "1 9+ 3 11+ 5 13 j7"}, - { "mel III (lyd 5+)", "1 9 3 11+ 5+ 13 j7"}, - { "augmented", "1 9- 3 11 5+ 13"}, - { "ionic 13-", "1 9 3 11 5 13- j7"}, - { "***** minor scales *****", ""}, - { "minor penta", "1 3- 11 5 7"}, - { "aeolic", "1 9 3- 11 5 13- 7"}, - { "doric", "1 9 3- 11 5 13 7"}, - { "mel II (doric 9-)","1 9- 3- 11 5 13 7"}, - { "phrygic", "1 9- 3- 11 5 13- 7"}, - { "jap. penta", "1 9- 11 5 7"}, - { "har IV (dor 11+)", "1 9 3- 11+ 5 13 7"}, - { "harmonic minor", "1 9 3- 11 5 13- j7"}, - { "melodic minor", "1 9 3- 11 5 13 j7"}, - { "gipsy", "1 9 3- 11+ 5 13- j7" }, - { "melodic 11+", "1 9 3- 11+ 5 13 j7" }, - { "***** dominant scales *****", "" }, - { "major penta", "1 9 3 5 13" }, - { "ind. penta", "1 3 11 5 7" }, - { "mixolyd", "1 9 3 11 5 13 7" }, - { "har V (har dominant)", "1 9- 3 11 5 13- 7" }, - { "mel IV (mixo 11+)","1 9 3 11+ 5 13 7" }, - { "mixo 11+9-", "1 9- 3 11+ 5 13 7" }, - { "mel V (mixo 13-)", "1 9 3 11 5 13- 7" }, - { "mixo 9-", "1 9- 3 11 5 13 7" }, - { "full 1", "1 9 3 5- 13- 7" }, - { "full 2", "1 9 3 11+ 5+ 7" }, - { "har alt", "1 9- 9+ 3 5 13- 7" }, - { "mel VII (altered)","1 9- 9+ 3 11+ 13- 7" }, - { "semi/full", "1 9- 9+ 3 11+ 5 13 7" }, - { "***** semi dimin *****", ""}, - { "locrian", "1 9- 3- 11 5- 13- 7" }, - { "mel VI (locrian 9)", "1 9 3- 11 5- 13- 7" }, - { "har II (locrian 13)", "1 9- 3- 11 5- 13 7" }, - { "doric 5-", "1 9 3- 11 5- 13 7" }, - { "***** dimin *****", ""}, - { "har VII (har dim)","1 9- 3- 11- 5- 13- 7-"}, - { "full/semi", "1 9 3- 11 5- 13 7- 15-"}, - { "locrian dim", "1 9- 3- 11 5- 13- 7-" }, - { "***** blues scales *****", "" }, - { "minor penta 5-", "1 3- 11 5- 5 7" }, - { "blues scale", "1 3- 3 11 5- 5 7"}, + { "***** major scales *****", ""}, + { "major penta", "1 9 3 5 13"}, + { "ionic", "1 9 3 11 5 13 j7"}, + { "lydic", "1 9 3 11+ 5 13 j7"}, + { "har III (ion 5+)", "1 9 3 11 5+ 13 j7"}, + { "har VI (lyd 9+)", "1 9+ 3 11+ 5 13 j7"}, + { "mel III (lyd 5+)", "1 9 3 11+ 5+ 13 j7"}, + { "augmented", "1 9- 3 11 5+ 13"}, + { "ionic 13-", "1 9 3 11 5 13- j7"}, + { "***** minor scales *****", ""}, + { "minor penta", "1 3- 11 5 7"}, + { "aeolic", "1 9 3- 11 5 13- 7"}, + { "doric", "1 9 3- 11 5 13 7"}, + { "mel II (doric 9-)", "1 9- 3- 11 5 13 7"}, + { "phrygic", "1 9- 3- 11 5 13- 7"}, + { "jap. penta", "1 9- 11 5 7"}, + { "har IV (dor 11+)", "1 9 3- 11+ 5 13 7"}, + { "harmonic minor", "1 9 3- 11 5 13- j7"}, + { "melodic minor", "1 9 3- 11 5 13 j7"}, + { "gipsy", "1 9 3- 11+ 5 13- j7"}, + { "melodic 11+", "1 9 3- 11+ 5 13 j7"}, + { "***** dominant scales *****", ""}, + { "major penta", "1 9 3 5 13"}, + { "ind. penta", "1 3 11 5 7"}, + { "mixolyd", "1 9 3 11 5 13 7"}, + { "har V (har dominant)", "1 9- 3 11 5 13- 7"}, + { "mel IV (mixo 11+)", "1 9 3 11+ 5 13 7"}, + { "mixo 11+9-", "1 9- 3 11+ 5 13 7"}, + { "mel V (mixo 13-)", "1 9 3 11 5 13- 7"}, + { "mixo 9-", "1 9- 3 11 5 13 7"}, + { "full 1", "1 9 3 5- 13- 7"}, + { "full 2", "1 9 3 11+ 5+ 7"}, + { "har alt", "1 9- 9+ 3 5 13- 7"}, + { "mel VII (altered)", "1 9- 9+ 3 11+ 13- 7"}, + { "semi/full", "1 9- 9+ 3 11+ 5 13 7"}, + { "***** semi dimin *****", ""}, + { "locrian", "1 9- 3- 11 5- 13- 7"}, + { "mel VI (locrian 9)", "1 9 3- 11 5- 13- 7"}, + { "har II (locrian 13)", "1 9- 3- 11 5- 13 7"}, + { "doric 5-", "1 9 3- 11 5- 13 7"}, + { "***** dimin *****", ""}, + { "har VII (har dim)", "1 9- 3- 11- 5- 13- 7-"}, + { "full/semi", "1 9 3- 11 5- 13 7- 15-"}, + { "locrian dim", "1 9- 3- 11 5- 13- 7-"}, + { "***** blues scales *****", ""}, + { "minor penta 5-", "1 3- 11 5- 5 7"}, + { "blues scale", "1 3- 3 11 5- 5 7"}, { 0, 0 } }; -scdef chords[] = { - { "j7", "1 3 5 j7"}, - { "m7", "1 3- 5 7" }, - { "7", "1 3 5 7" }, - { "m75-", "1 3- 5- 7" }, - { "mj7", "1 3- 5 j7" }, - { "j75+", "1 3 5+ j7" }, - { "0", "1 3- 5- 6" }, - { "sus4", "1 4 5" }, - { "7sus4", "1 4 5 7" }, - { "j7sus4", "1 4 5 j7" }, - { "alt (79+13-)", "1 3 9+ 13- 7" }, - { "75-", "1 3 5- 7" }, +scdef chords[] = +{ + { "j7", "1 3 5 j7"}, + { "m7", "1 3- 5 7"}, + { "7", "1 3 5 7"}, + { "m75-", "1 3- 5- 7"}, + { "mj7", "1 3- 5 j7"}, + { "j75+", "1 3 5+ j7"}, + { "0", "1 3- 5- 6"}, + { "sus4", "1 4 5"}, + { "7sus4", "1 4 5 7"}, + { "j7sus4", "1 4 5 j7"}, + { "alt (79+13-)", "1 3 9+ 13- 7"}, + { "75-", "1 3 5- 7"}, }; long scansc(const char *s) Modified: branches/jazz-4.1.3/src/harmonyp.h =================================================================== --- branches/jazz-4.1.3/src/harmonyp.h 2009-01-19 21:43:48 UTC (rev 687) +++ branches/jazz-4.1.3/src/harmonyp.h 2009-01-20 00:46:00 UTC (rev 688) @@ -40,19 +40,19 @@ friend istream & operator >> (istream &is, HBChord &a); public: - HBChord() { keys = 0; } - HBChord(long k) { keys = k; } + HBChord() { keys = 0; } + HBChord(long k) { keys = k; } HBChord(int a, int b, int c = -1, int d = -1, int e = -1, int f = -1, int g = -1, int h = -1, int i = -1, int k = -1, int l = -1); void Rotate(int semis); - int Fit(int key); // nearest key in chord - int Count() const; // # keys in chord - int Iter(int key) const; // next key in chord + int Fit(int key); // nearest key in chord + int Count() const; // # keys in chord + int Iter(int key) const; // next key in chord - void Clear() { keys = 0; } - long Keys() const { return keys; } + void Clear() { keys = 0; } + long Keys() const { return keys; } - bool Contains(int key) const // key in chord? + bool Contains(int key) const // key in chord? { return (1L << ((key + 240) % 12)) & keys; } @@ -191,32 +191,32 @@ // scales, msb = highest note const HBChord major_scale (0xab5L); -const HBChord harmonic_scale (0x9adL); -const HBChord melodic_scale (0xaadL); -const HBChord ionb13_scale (0x9b5L); +const HBChord harmonic_scale (0x9adL); +const HBChord melodic_scale (0xaadL); +const HBChord ionb13_scale (0x9b5L); -const HBChord altered_scale (0, 1, 3, 4, 6, 8, 10); +const HBChord altered_scale (0, 1, 3, 4, 6, 8, 10); const HBChord dimin_scale (0xb6dL); -const HBChord chromatic_scale (0xfffL); +const HBChord chromatic_scale (0xfffL); // chords, based to C -const HBChord Cj7 (0,4,7,11); -const HBChord Cj7b5 (0,4,6,11); -const HBChord Cj7s5 (0,4,8,11); +const HBChord Cj7(0,4,7,11); +const HBChord Cj7b5(0,4,6,11); +const HBChord Cj7s5(0,4,8,11); -const HBChord C7 (0,4,7,10); -const HBChord C7b5 (0,4,6,10); -const HBChord C7s5 (0,4,8,10); +const HBChord C7(0,4,7,10); +const HBChord C7b5(0,4,6,10); +const HBChord C7s5(0,4,8,10); -const HBChord Cm7 (0,3,7,10); -const HBChord Cm7b5 (0,3,6,10); -const HBChord Cm7s5 (0,3,8,10); +const HBChord Cm7(0,3,7,10); +const HBChord Cm7b5(0,3,6,10); +const HBChord Cm7s5(0,3,8,10); -const HBChord Cmj7 (0,3,7,11); -const HBChord Cmj7b5 (0,3,6,11); -const HBChord Cmj7s5 (0,3,8,11); +const HBChord Cmj7(0,3,7,11); +const HBChord Cmj7b5(0,3,6,11); +const HBChord Cmj7s5(0,3,8,11); -const HBChord C0 (0,3,6,9); +const HBChord C0(0,3,6,9); // ------------------------------------------------------------------ // HBContext @@ -234,27 +234,27 @@ 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; } + 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; } + 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" + 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" + const char * ScaleName() const; // "C#" + const char * ScaleTypeName() const; // "major" int operator == (const HBContext &o) const { @@ -262,7 +262,10 @@ scale_nr == o.scale_nr && chord_nr == o.chord_nr; } - int operator != (const HBContext &o) const { return !operator==(o); } + int operator != (const HBContext &o) const + { + return !operator==(o); + } private: void Initialize(); @@ -297,7 +300,10 @@ class HBMatch { public: - virtual bool operator()(const HBContext &) { return true; } + virtual bool operator()(const HBContext &) + { + return true; + } }; class HBMatchContains : public HBMatch @@ -315,11 +321,15 @@ public: HBContextIterator(); HBContextIterator(HBMatch &); - void SetSequence(HBContext *s[], int n) { seq = s; n_seq = n; } + 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; Modified: branches/jazz-4.1.3/src/hbanalyz.cpp =================================================================== --- branches/jazz-4.1.3/src/hbanalyz.cpp 2009-01-19 21:43:48 UTC (rev 687) +++ branches/jazz-4.1.3/src/hbanalyz.cpp 2009-01-20 00:46:00 UTC (rev 688) @@ -49,7 +49,7 @@ void HBAnalyzer::Init(tFilter *f, int epc) { - Exit(); // cleanup from previous run + Exit(); // cleanup from previous run filter = f; start_clock = f->FromClock; @@ -57,7 +57,7 @@ eighths_per_chord = epc; if (eighths_per_chord == 0) - steps = max_seq; // map number of chords to selection + steps = max_seq; // map number of chords to selection else { tBarInfo BarInfo(filter->Song); @@ -133,10 +133,10 @@ tEvent *e = Events.Range(filter->FromClock, filter->ToClock); while (e) { - tKeyOn *on = e->IsKeyOn(); - if (on) - (this->*Action)(on, t); - e = Events.Next(); + tKeyOn *on = e->IsKeyOn(); + if (on) + (this->*Action)(on, t); + e = Events.Next(); } t->Cleanup(); } @@ -161,9 +161,9 @@ if (on->Clock + on->Length >= start && on->Clock < stop) { if (on->Clock > start) - start = on->Clock; + start = on->Clock; if (on->Clock + on->Length < stop) - stop = on->Clock + on->Length; + stop = on->Clock + on->Length; count[i][on->Key % 12] += stop - start; } } @@ -182,20 +182,20 @@ long fr = start; long to = stop; if (on->Clock > fr) - fr = on->Clock; + fr = on->Clock; if (on->Clock + on->Length < to) - to = on->Clock + on->Length; + to = on->Clock + on->Length; // transpose if most of key length belongs to this step // OR: it covers the whole step if (to - fr >= on->Length/2 || (fr == start && to == stop)) { - tKeyOn *cp = (tKeyOn *)on->Copy(); - cp->Key += delta[i][on->Key % 12]; - track->Kill(on); - track->Put(cp); + tKeyOn *cp = (tKeyOn *)on->Copy(); + cp->Key += delta[i][on->Key % 12]; + track->Kill(on); + track->Put(cp); - // do not transpose again + // do not transpose again break; } } @@ -304,7 +304,7 @@ tChordMatrix() { for (int i = 0; i < 12; i++) for (int j = 0; j < 12; j++) - mat[i][j] = 0; + mat[i][j] = 0; } double* operator[](int i) { return mat[i]; } private: @@ -336,12 +336,12 @@ for (j = 0; j < 12; j++) { double cost = 0; - if (!chord.Contains(j)) - cost += not_in_chord_costs; - if (!scale.Contains(j)) - cost += not_in_scale_costs; - cost += fabs(i-j) * costs_per_semitone; - cost *= count[step][i]; + if (!chord.Contains(j)) + cost += not_in_chord_costs; + if (!scale.Contains(j)) + cost += not_in_scale_costs; + cost += fabs(i-j) * costs_per_semitone; + cost *= count[step][i]; mat[i][j] = cost; } } @@ -393,12 +393,11 @@ } if (best[i] == -1 || err < best[i]) { - *seq[i] = ct; - seq[i]->SetSeqNr(i+1); - best[i] = err; + *seq[i] = ct; + seq[i]->SetSeqNr(i+1); + best[i] = err; } } } delete [] best; } - Modified: branches/jazz-4.1.3/src/jazz.h =================================================================== --- branches/jazz-4.1.3/src/jazz.h 2009-01-19 21:43:48 UTC (rev 687) +++ branches/jazz-4.1.3/src/jazz.h 2009-01-20 00:46:00 UTC (rev 688) @@ -119,17 +119,21 @@ int Value; char* StrValue; public: - tConfigEntry( char* name, int ival ) - : Name(name), - Value(ival), - StrValue(0), - Type( ConfigEntryTypeInt ) {} - tConfigEntry( char* name, char* sval ); - tConfigEntry( char* name ) - : Name(name), - Value(0), - StrValue(0), - Type( ConfigEntryTypeEmpty ) {} + tConfigEntry( char* name, int ival ) + : Name(name), + Value(ival), + StrValue(0), + Type( ConfigEntryTypeInt ) + { + } + tConfigEntry( char* name, char* sval ); + tConfigEntry( char* name ) + : Name(name), + Value(0), + StrValue(0), + Type( ConfigEntryTypeEmpty ) + { + } }; class tConfig @@ -162,14 +166,14 @@ char* Name( int entry ) { - assert( (entry >= 0) && (entry < NumConfigNames) ); - return Names[entry]->Name; + assert( (entry >= 0) && (entry < NumConfigNames) ); + return Names[entry]->Name; } char*& StrValue( int entry ) { - assert( (entry >= 0) && (entry < NumConfigNames) ); - return Names[entry]->StrValue; + assert( (entry >= 0) && (entry < NumConfigNames) ); + return Names[entry]->StrValue; } int& operator () ( char* name ); @@ -218,9 +222,9 @@ extern tSong *TheSong; extern tSynth *Synth; -#define USED_WXFORM_BUTTONS (wxFORM_BUTTON_OK | \ - wxFORM_BUTTON_CANCEL | \ - wxFORM_BUTTON_HELP) +#define USED_WXFORM_BUTTONS (wxFORM_BUTTON_OK | \ + wxFORM_BUTTON_CANCEL | \ + wxFORM_BUTTON_HELP) #ifndef MIN #define MIN(x, y) ( ((x) < (y)) ? (x) : (y) ) Modified: branches/jazz-4.1.3/src/maction.cpp =================================================================== --- branches/jazz-4.1.3/src/maction.cpp 2009-01-19 21:43:48 UTC (rev 687) +++ branches/jazz-4.1.3/src/maction.cpp 2009-01-20 00:46:00 UTC (rev 688) @@ -73,7 +73,7 @@ if (left_action > 0 && e.LeftDown() &&!e.ShiftDown() && !e.ControlDown()) return left_action; - int i = 0; // left down + int i = 0; // left down if (e.MiddleDown()) i = 1; else @@ -130,7 +130,7 @@ tRect rr = r; rr.SetNormal(); if (rr.w && rr.h) - dc->DrawRectangle(rr.x, rr.y, rr.w, rr.h); + dc->DrawRectangle(rr.x, rr.y, rr.w, rr.h); Dragging(e); } else @@ -182,9 +182,9 @@ dc->SetBrush(back); dc->SetLogicalFunction(wxXOR); if (r1.w && r1.h) - dc->DrawRectangle(r1.x, r1.y, r1.w, r1.h); + dc->DrawRectangle(r1.x, r1.y, r1.w, r1.h); if (r2.w && r2.h) - dc->DrawRectangle(r2.x, r2.y, r2.w, r2.h); + dc->DrawRectangle(r2.x, r2.y, r2.w, r2.h); dc->SetLogicalFunction(wxCOPY); } } @@ -272,7 +272,7 @@ if (Coords[i] > x) { if (up || i == 0) - x = Coords[i]; + x = Coords[i]; else x = Coords[i-1]; return; Modified: branches/jazz-4.1.3/src/maction.h =================================================================== --- branches/jazz-4.1.3/src/maction.h 2009-01-19 21:43:48 UTC (rev 687) +++ branches/jazz-4.1.3/src/maction.h 2009-01-20 00:46:00 UTC (rev 688) @@ -63,23 +63,23 @@ class tMouseAction { public: - virtual ~tMouseAction() {} - virtual int Dragging(wxMouseEvent &) { return 0; }; - virtual int LeftDown(wxMouseEvent &) { return 0; }; - virtual int LeftUp(wxMouseEvent &) { return 0; }; - virtual int RightDown(wxMouseEvent &) { return 0; }; - virtual int RightUp(wxMouseEvent &) { return 0; }; - virtual int MiddleDown(wxMouseEvent &) { return 0; }; - virtual int MiddleUp(wxMouseEvent &) { return 0; }; + virtual ~tMouseAction() {} + virtual int Dragging(wxMouseEvent &) { return 0; }; + virtual int LeftDown(wxMouseEvent &) { return 0; }; + virtual int LeftUp(wxMouseEvent &) { return 0; }; + virtual int RightDown(wxMouseEvent &) { return 0; }; + virtual int RightUp(wxMouseEvent &) { return 0; }; + virtual int MiddleDown(wxMouseEvent &) { return 0; }; + virtual int MiddleUp(wxMouseEvent &) { return 0; }; virtual int Event(wxMouseEvent &e) { - if (e.Dragging()) return Dragging(e); - else if (e.LeftDown()) return LeftDown(e); - else if (e.LeftUp()) return LeftUp(e); - else if (e.MiddleDown()) return MiddleDown(e); - else if (e.MiddleUp()) return MiddleUp(e); - else if (e.RightDown()) return RightDown(e); - else if (e.RightUp()) return RightUp(e); + if (e.Dragging()) return Dragging(e); + else if (e.LeftDown()) return LeftDown(e); + else if (e.LeftUp()) return LeftUp(e); + else if (e.MiddleDown()) return MiddleDown(e); + else if (e.MiddleUp()) return MiddleUp(e); + else if (e.RightDown()) return RightDown(e); + else if (e.RightUp()) return RightUp(e); return 0; } }; @@ -99,7 +99,7 @@ int Active; virtual void Snap(float &x, float &y, int drag) {} tRect r; - int Selected; // r is valid + int Selected; // r is valid virtual int Dragging(wxMouseEvent &); virtual int Event(wxMouseEvent &e); virtual int ButtonDown(wxMouseEvent &); @@ -138,7 +138,7 @@ { int Min, Max, Delta; int Timeout; - int Wait; // don't inc/dec at Init + int Wait; // don't inc/dec at Init tEventWin *win; virtual int LeftDown(wxMouseEvent &); Modified: branches/jazz-4.1.3/src/mapper.cpp =================================================================== --- branches/jazz-4.1.3/src/mapper.cpp 2009-01-19 21:43:48 UTC (rev 687) +++ branches/jazz-4.1.3/src/mapper.cpp 2009-01-20 00:46:00 UTC (rev 688) @@ -134,7 +134,7 @@ if (in_create) return; - if (!enable != !enabled) // avoid flickering + if (!enable != !enabled) // avoid flickering { steps_per_count_slider->Enable(enable); count_per_bar_slider->Enable(enable); @@ -179,13 +179,13 @@ wxMenuBar *menu_bar = new wxMenuBar; wxMenu *menu = new wxMenu; - menu->Append(MEN_HELP, "&Help"); - //menu->Append(MEN_LOAD, "&Load"); - //menu->Append(MEN_SAVE, "&Save"); - menu->Append(MEN_CLOSE, "&Close"); - //menu->Append(MEN_EQUAL, "&Equal"); - //menu->Append(MEN_ANALYZE, "&Analyze"); - menu_bar->Append(menu, "&Menu"); + menu->Append(MEN_HELP, "&Help"); +// menu->Append(MEN_LOAD, "&Load"); +// menu->Append(MEN_SAVE, "&Save"); + menu->Append(MEN_CLOSE, "&Close"); +// menu->Append(MEN_EQUAL, "&Equal"); +// menu->Append(MEN_ANALYZE, "&Analyze"); + menu_bar->Append(menu, "&Menu"); SetMenuBar(menu_bar); int w, h; @@ -255,21 +255,23 @@ case MEN_LOAD: { - char * fname = wxFileSelector("Load Rhythm", NULL, NULL, NULL, "*.rhy"); - if (fname) { - ifstream is(fname); - is >> *this; - } + char * fname = wxFileSelector("Load Rhythm", NULL, NULL, NULL, "*.rhy"); + if (fname) + { + ifstream is(fname); + is >> *this; + } } break; case MEN_SAVE: { - char * fname = wxFileSelector("Save Rhythm", NULL, NULL, NULL, "*.rhy"); - if (fname) { - ofstream os(fname); - os << *this; - } + char * fname = wxFileSelector("Save Rhythm", NULL, NULL, NULL, "*.rhy"); + if (fname) + { + ofstream os(fname); + os << *this; + } } break; Modified: branches/jazz-4.1.3/src/mapper.h =================================================================== --- branches/jazz-4.1.3/src/mapper.h 2009-01-19 21:43:48 UTC (rev 687) +++ branches/jazz-4.1.3/src/mapper.h 2009-01-20 00:46:00 UTC (rev 688) @@ -43,16 +43,16 @@ edits[n_edits++] = edit; } private: - Bool enabled; - Bool in_create; - wxSlider *steps_per_count_slider; - wxSlider *count_per_bar_slider; - wxSlider *n_bars_slider; - int steps_per_count; - int count_per_bar; - int n_bars; - tRhyArrayEdit *edits[20]; - int n_edits; + Bool enabled; + Bool in_create; + wxSlider* steps_per_count_slider; + wxSlider* count_per_bar_slider; + wxSlider* n_bars_slider; + int steps_per_count; + int count_per_bar; + int n_bars; + tRhyArrayEdit* edits[20]; + int n_edits; static void ItemCallback(wxItem& item, wxCommandEvent& event); void ItemChanged(); }; Modified: branches/jazz-4.1.3/src/mstdfile.h =================================================================== --- branches/jazz-4.1.3/src/mstdfile.h 2009-01-19 21:43:48 UTC (rev 687) +++ branches/jazz-4.1.3/src/mstdfile.h 2009-01-20 00:46:00 UTC (rev 688) @@ -35,13 +35,13 @@ class tStdChunk { - long Size; // Groesse von Base - long nRead; // soviele Bytes aus Datei gelesen + long Size; // Groesse von Base + long nRead; // soviele Bytes aus Datei gelesen unsigned char *Base; // Puffer fuer Daten - unsigned char *cp; // Aktueller Schreib/Lese Pointer - long Clock; // Absolute Clock - int EofSeen; // endoftrack meta-event gelesen - int RunningStatus; // letzter Status + unsigned char *cp; // Aktueller Schreib/Lese Pointer + long Clock; // Absolute Clock + int EofSeen; // endoftrack meta-event gelesen + int RunningStatus; // letzter Status void Resize(int SizeNeeded); void PutVar(ulong val); @@ -49,14 +49,14 @@ public: - int IsEof(); // nur nach Load, Save hat nie Eof + int IsEof(); // nur nach Load, Save hat nie Eof void Load(FILE *fd); - void Save(FILE *fd); // haengt EndOfTrack an + void Save(FILE *fd); // haengt EndOfTrack an tStdChunk(); ~tStdChunk(); void Put(tEvent *e, uchar *Data, int Length); - tEvent *Get(); // NULL bei Trackende - void Rewind(); // Schreib/Lesezeiger zur\x81cksetzen + tEvent *Get(); // NULL bei Trackende + void Rewind(); // Schreib/Lesezeiger zur\x81cksetzen }; Modified: branches/jazz-4.1.3/src/pianowin.cpp =================================================================== --- branches/jazz-4.1.3/src/pianowin.cpp 2009-01-19 21:43:48 UTC (rev 687) +++ branches/jazz-4.1.3/src/pianowin.cpp 2009-01-20 00:46:00 UTC (rev 688) @@ -885,7 +885,7 @@ { long OldFromClock = FromClock; tEventWin::OnPaint(x, y); -// SN++ Since jazz has a redo function. Fixes a little +// SN++ Since jazz has a redo function. Fixes a little // Update problem with multiple zoomOut. // Active Ctrl window redraw or reinitialization. @@ -969,7 +969,8 @@ // draw chords from harmony-browser - if (VisibleHBChord && the_harmony_browser && !Track->IsDrumTrack()) { + if (VisibleHBChord && the_harmony_browser && !Track->IsDrumTrack()) + { HBAnalyzer *an = the_harmony_browser->getAnalyzer(); if (an != 0) { Modified: branches/jazz-4.1.3/src/pianowin.h =================================================================== --- branches/jazz-4.1.3/src/pianowin.h 2009-01-19 21:43:48 UTC (rev 687) +++ branches/jazz-4.1.3/src/pianowin.h 2009-01-20 00:46:00 UTC (rev 688) @@ -70,7 +70,7 @@ wxFont *DrumFont; long SnapClocks(); - long SnapDenomiator; // 16 fuer 16-tel + long SnapDenomiator; // 16 fuer 16-tel long SnapClock(long Clock, int up = 0); tPianoWin(wxFrame *frame, char *title, tSong *song, int x, int y, int width, int height); @@ -79,7 +79,7 @@ void Setup(); void NewPosition(int TrackNr, long Clock); void ShowPitch(int pitch); - int Channel(); // Channel of actual track 0..15 + int Channel(); // Channel of actual track 0..15 void OnMenuCommand(int Id); void OnPaint(long x, long y); @@ -87,7 +87,7 @@ void SnapSelStop(wxMouseEvent &e); void SnapDlg(); - int TrackNr; // aktueller Track + int TrackNr; // aktueller Track tTrack *Track; tEventArray PasteBuffer; @@ -116,7 +116,10 @@ virtual Bool OnClose(); virtual void OnSize(int w, int h); - tGuitarWin *GetGuitarWin() { return GuitarWin; } + tGuitarWin *GetGuitarWin() + { + return GuitarWin; + } void SetSnapDenom(long value); void PressRadio(int id = 0); Modified: branches/jazz-4.1.3/src/player.cpp =================================================================== --- branches/jazz-4.1.3/src/player.cpp 2009-01-19 21:43:48 UTC (rev 687) +++ branches/jazz-4.1.3/src/player.cpp 2009-01-20 00:46:00 UTC (rev 688) @@ -591,7 +591,7 @@ CMD+1, 0x98, CMD+1, 0x9a, CMD+1, 0x9c, CMD+1, 0x9e, // channel-ref-tables off CMD+1, 0xec, - DAT+1, ACTIVE_TRACKS_MASK, // active tracks + DAT+1, ACTIVE_TRACKS_MASK, // active tracks CMD+1, 0xb8, // clear play counters CMD+1, 0x90, // real time affection off (yes!) CMD+1, 0x2a // stand by record Modified: branches/jazz-4.1.3/src/random.cpp =================================================================== --- branches/jazz-4.1.3/src/random.cpp 2009-01-19 21:43:48 UTC (rev 687) +++ branches/jazz-4.1.3/src/random.cpp 2009-01-20 00:46:00 UTC (rev 688) @@ -147,7 +147,7 @@ int tRndArray::Interval(int seed) { - if (seed < 0) // initial ? + if (seed < 0) // initial ? seed = int(rnd.asDouble() * n); int delta = Random(); if (rnd.asDouble() < 0.5) @@ -260,7 +260,7 @@ xmin = 0; xmax = n; - x = 0; // draw to topleft corner of canvas + x = 0; // draw to topleft corner of canvas y = 0; w = ww; h = hh; @@ -475,11 +475,11 @@ for (int val = min; val < max; val += step) { const char *buf = GetYText(val); - //sprintf(buf, "%d", val); - dc->GetTextExtent((char *)buf, &tw, &th); - float yy = y + h - h * (val - min) / (max - min) - th/2; - dc->DrawText(buf, x - tw - TICK_LINE, yy); - //dc->DrawLine(x - TICK_LINE, yy, x, yy); + //sprintf(buf, "%d", val); + dc->GetTextExtent((char *)buf, &tw, &th); + float yy = y + h - h * (val - min) / (max - min) - th/2; + dc->DrawText(buf, x - tw - TICK_LINE, yy); + //dc->DrawLine(x - TICK_LINE, yy, x, yy); } } } @@ -629,16 +629,16 @@ if (i < index) for (; i <= index; i++) { - DrawBar(i, 0); - array[i] = val; - DrawBar(i, 1); + DrawBar(i, 0); + array[i] = val; + DrawBar(i, 1); } else for (; i >= index; i--) { - DrawBar(i, 0); - array[i] = val; - DrawBar(i, 1); + DrawBar(i, 0); + array[i] = val; + DrawBar(i, 1); } index = k; } Modified: branches/jazz-4.1.3/src/random.h =================================================================== --- branches/jazz-4.1.3/src/random.h 2009-01-19 21:43:48 UTC (rev 687) +++ branches/jazz-4.1.3/src/random.h 2009-01-20 00:46:00 UTC (rev 688) @@ -38,7 +38,7 @@ //#define USE_ACG 1 #if USE_ACG -#include <ACG.h> // random generator from libg++ +#include <ACG.h> // random generator from libg++ extern ACG rnd; #else @@ -64,19 +64,31 @@ friend class tArrayEdit; protected: tIntArray array; - int n; // number of elements in array + int n; // number of elements in array int nul, min, max; public: - int Null() { return nul; } - void SetNull(int n) { nul = n; } + int Null() + { + return nul; + } + void SetNull(int n) + { + nul = n; + } tRndArray(int n, int min, int max); tRndArray & operator = (const tRndArray &); tRndArray(tRndArray const &); virtual ~tRndArray(); - int &operator[] (int i) { return array[i]; } - int operator[] (int i) const { return array[i]; } + int &operator[] (int i) + { + return array[i]; + } + int operator[] (int i) const + { + return array[i]; + } #ifdef FOR_MSW double operator[](double f); float operator[](float f) { @@ -86,17 +98,29 @@ #endif return (float)operator[]((double)f); } - int Size() const { return n; } - int Min() const { return min; } - int Max() const { return max; } + int Size() const + { + return n; + } + int Min() const + { + return min; + } + int Max() const + { + return max; + } void SetMinMax(int min, int max); - void Resize(int nn) { n = nn; } + void Resize(int nn) + { + n = nn; + } friend ostream & operator << (ostream &, tRndArray const &); friend istream & operator >> (istream &, tRndArray &); - int Random(); // returns index 0..n-1 (arrayvalues -> empiric distribution) - int Random(double rndval); // returns index 0..n-1 (arrayvalues -> empiric distribution) + int Random(); // returns index 0..n-1 (arrayvalues -> empiric distribution) + int Random(double rndval); // returns index 0..n-1 (arrayvalues -> empiric distribution) int Random(int i); // return 0/1 int Interval(int seed); @@ -109,16 +133,17 @@ }; -#define ARED_GAP 1 -#define ARED_XTICKS 2 -#define ARED_YTICKS 4 -#define ARED_MINMAX 8 -#define ARED_RHYTHM 16 -#define ARED_BLOCKS 32 -#define ARED_LINES 64 +#define ARED_GAP 1 +#define ARED_XTICKS 2 +#define ARED_YTICKS 4 +#define ARED_MINMAX 8 +#define ARED_RHYTHM 16 +#define ARED_BLOCKS 32 +#define ARED_LINES 64 -class tArrayEditDrawBars { +class tArrayEditDrawBars +{ public: virtual void DrawBars() = 0; }; @@ -131,11 +156,11 @@ long x, y, w, h, ynul; void DrawBar(int i, int black); - int dragging; // Dragging-Event valid - int index; // ctrl down: drag this one + int dragging; // Dragging-Event valid + int index; // ctrl down: drag this one tRndArray &array; - int &n, &min, &max, &nul; // shorthand for array.n, array.min, ... + int &n, &min, &max, &nul; // shorthand for array.n, array.min, ... char *label; tArrayEditDrawBars *draw_bars; Modified: branches/jazz-4.1.3/src/rhythm.cpp =================================================================== --- branches/jazz-4.1.3/src/rhythm.cpp 2009-01-19 21:43:48 UTC (rev 687) +++ branches/jazz-4.1.3/src/rhythm.cpp 2009-01-20 00:46:00 UTC (rev 688) @@ -65,10 +65,10 @@ // pseudo key nr's for harmony browser and sound effects -static const int MODE_ALL_OF = -1; -static const int MODE_ONE_OF = -2; -static const int MODE_PIANO = -3; -static const int MODE_CONTROL = -4; +static const int MODE_ALL_OF = -1; +static const int MODE_ONE_OF = -2; +static const int MODE_PIANO = -3; +static const int MODE_CONTROL = -4; tRhythm::tRhythm(int k) @@ -301,17 +301,17 @@ if (the_harmony_browser) { long step = (clock - fr_clock) * total_steps / (to_clock - fr_clock); - int keys[12], n_keys; + int keys[12], n_keys; if (key == CHORD_KEY) n_keys = the_harmony_browser->GetChordKeys(keys, (int)step, (int)total_steps); else n_keys = the_harmony_browser->GetBassKeys(keys, (int)step, (int)total_steps); for (int j = 0; j < n_keys; j++) { - tKeyOn *k = new tKeyOn(clock, chan, keys[j], vel, len - clocks_per_step/2); - track->Put(k); - } - } + tKeyOn *k = new tKeyOn(clock, chan, keys[j], vel, len - clocks_per_step/2); + track->Put(k); + } + } } // paste pianowin buffer @@ -323,23 +323,24 @@ tKeyOn *on = src.Events[ii]->IsKeyOn(); if (on) { - tKeyOn *k = new tKeyOn(clock, chan, on->Key, vel, len - clocks_per_step/2); - track->Put(k); + tKeyOn *k = new tKeyOn(clock, chan, on->Key, vel, len - clocks_per_step/2); + track->Put(k); } - } + } } // generate controller - else if (key == CONTROL_KEY) { - tControl *c = new tControl(clock, chan, parm - 1, vel); - track->Put(c); + else if (key == CONTROL_KEY) + { + tControl *c = new tControl(clock, chan, parm - 1, vel); + track->Put(c); } // generate note on events else { - tKeyOn *k = new tKeyOn(clock, chan, key, vel, len - clocks_per_step/2); - track->Put(k); + tKeyOn *k = new tKeyOn(clock, chan, key, vel, len - clocks_per_step/2); + track->Put(k); } clock += len; @@ -367,10 +368,10 @@ long clock = bi.Clock; while (clock < bi.Clock + bi.TicksPerBar) { - int i = Clock2i(clock, bi); - int j = r->Clock2i(clock, bi); - tmp[i] = r->history[j]; - clock += clocks_per_step; + int i = Clock2i(clock, bi); + int j = r->Clock2i(clock, bi); + tmp[i] = r->history[j]; + clock += clocks_per_step; } out.SetUnion(tmp, fuzz); } @@ -390,9 +391,9 @@ { GenGroup(tmp, gi, bi, rhy, n_rhy); if (groups[gi].listen > 0) - rrg.SetIntersection(tmp, groups[gi].listen); + rrg.SetIntersection(tmp, groups[gi].listen); else - rrg.SetDifference(tmp, -groups[gi].listen); + rrg.SetDifference(tmp, -groups[gi].listen); } } @@ -456,31 +457,31 @@ #include "../bitmaps/rrggen.xpm" #include "../bitmaps/help.xpm" static tToolDef tdefs[] = { - { MEN_LOAD, FALSE, 0, tb_open }, - { MEN_SAVE, FALSE, 1, tb_save }, + { MEN_LOAD, FALSE, 0, tb_open }, + { MEN_SAVE, FALSE, 1, tb_save }, - { MEN_ADD, FALSE, 0, tb_rrgadd }, - { MEN_DEL, FALSE, 0, tb_rrgdel }, - { MEN_UP, FALSE, 0, tb_rrgup }, - { MEN_DOWN, FALSE, 0, tb_rrgdown }, - { MEN_GEN, FALSE, 1, tb_rrggen }, + { MEN_ADD, FALSE, 0, tb_rrgadd }, + { MEN_DEL, FALSE, 0, tb_rrgdel }, + { MEN_UP, FALSE, 0, tb_rrgup }, + { MEN_DOWN, FALSE, 0, tb_rrgdown }, + { MEN_GEN, FALSE, 1, tb_rrggen }, - { MEN_HELP, FALSE, 0, tb_help } + { MEN_HELP, FALSE, 0, tb_help } }; #else static tToolDef tdefs[] = { - { MEN_LOAD, FALSE, 0, "tb_open", "open rhythm file" }, - { MEN_SAVE, FALSE, 1, "tb_save", "save into rhythm file" }, + { MEN_LOAD, FALSE, 0, "tb_open", "open rhythm file" }, + { MEN_SAVE, FALSE, 1, "tb_save", "save into rhythm file" }, - { MEN_ADD, FALSE, 0, "tb_rrgadd", "add instrumten" }, - { MEN_DEL, FALSE, 0, "tb_rrgdel", "remove instrument" }, - { MEN_UP, FALSE, 0, "tb_rrgup", "move instrument up" }, - { MEN_DOWN, FALSE, 0, "tb_rrgdown", "move instrument down" }, - { MEN_GEN, FALSE, 1, "tb_rrggen", "generate events into trackwin selection" }, + { MEN_ADD, FALSE, 0, "tb_rrgadd", "add instrumten" }, + { MEN_DEL, FALSE, 0, "tb_rrgdel", "remove instrument" }, + { MEN_UP, FALSE, 0, "tb_rrgup", "move instrument up" }, + { MEN_DOWN, FALSE, 0, "tb_rrgdown", "move instrument down" }, + { MEN_GEN, FALSE, 1, "tb_rrggen", "generate events into trackwin selection" }, - { MEN_HELP, FALSE, 0, "tb_help", "help" } + { MEN_HELP, FALSE, 0, "tb_help", "help" } }; #endif @@ -508,22 +509,22 @@ wxMenuBar *menu_bar = new wxMenuBar; wxMenu *menu = new wxMenu; - menu->Append(MEN_LOAD, "&Load"); - menu->Append(MEN_SAVE, "&Save"); - menu->Append(MEN_CLOSE, "&Close"); - menu_bar->Append(menu, "&File"); + menu->Append(MEN_LOAD, "&Load"); + menu->Append(MEN_SAVE, "&Save"); + menu->Append(MEN_CLOSE, "&Close"); + menu_bar->Append(menu, "&File"); menu = new wxMenu; - menu->Append(MEN_ADD, "&Add"); - menu->Append(MEN_DEL, "&Delete"); - menu->Append(MEN_UP, "&Up"); - menu->Append(MEN_DOWN, "&Down"); - menu->Append(MEN_GEN, "&Generate"); - menu_bar->Append(menu, "&Instrument"); + menu->Append(MEN_ADD, "&Add"); + menu->Append(MEN_DEL, "&Delete"); + menu->Append(MEN_UP, "&Up"); + menu->Append(MEN_DOWN, "&Down"); + menu->Append(MEN_GEN, "&Generate"); + menu_bar->Append(menu, "&Instrument"); menu = new wxMenu; - menu->Append(MEN_HELP, "&Help"); - menu_bar->Append(menu, "Help"); + menu->Append(MEN_HELP, "&Help"); + menu_bar->Append(menu, "Help"); SetMenuBar(menu_bar); @@ -670,23 +671,28 @@ } } -void tRhythmWin::OnMenuCommand(int id) { - switch (id) { - case MEN_HELP: Help(); break; +void tRhythmWin::OnMenuCommand(int id) +{ + switch (id) + { + case MEN_HELP: + Help(); + break; case MEN_CLOSE: - // motif crashes, when Show(FALSE) is called before destructor! - // Show(FALSE); - DELETE_THIS(); - break; + // motif crashes, when Show(FALSE) is called before destructor! + // Show(FALSE); + DELETE_THIS(); + break; case MEN_LOAD: { char * fname = file_selector(default_filename, "Load Rhythm", 0, has_changed, "*.rhy"); - if (fname) { - ifstream is(fname); - is >> *this; + if (fname) + { + ifstream is(fname); + is >> *this; OnPaint(); - } + } } break; @@ -694,10 +700,10 @@ { Win2Instrument(); char * fname = file_selector(default_filename, "Save Rhythm", 1, has_changed, "*.rhy"); - if (fname) { - ofstream os(fname); - os << *this; - } + if (fname) { + ofstream os(fname); + os << *this; + } } break; @@ -823,26 +829,27 @@ r->mode = keys[i]; tEventArray events; tCmdCopyToBuffer cmd(TrackWin->GetPianoWin()->Filter, &events); - cmd.Execute(0); // no UNDO + cmd.Execute(0); // no UNDO for (int ii = 0; ii < events.nEvents; ii++) { - tKeyOn *on = events.Events[ii]->IsKeyOn(); - if (on) { - r->keys[r->n_keys++] = on->Key; - if (r->n_keys > 1) - strcat(buf, ", "); - Key2Str(on->Key, buf + strlen(buf)); - if (r->n_keys >= MAX_KEYS) - break; - } + tKeyOn *on = events.Events[ii]->IsKeyOn(); + if (on) { + r->keys[r->n_keys++] = on->Key; + if (r->n_keys > 1) + strcat(buf, ", "); + Key2Str(on->Key, buf + strlen(buf)); + if (r->n_keys >= MAX_KEYS) + break; + } } r->SetLabel(buf); - if (r->n_keys == 0) { + if (r->n_keys == 0) + { wxMessageBox("select some notes in pianowin first", "Error", wxOK); - delete r; - r = 0; + delete r; + r = 0; } } Modified: branches/jazz-4.1.3/src/rhythm.h =================================================================== --- branches/jazz-4.1.3/src/rhythm.h 2009-01-19 21:43:48 UTC (rev 687) +++ branches/jazz-4.1.3/src/rhythm.h 2009-01-20 00:46:00 UTC (rev 688) @@ -147,7 +147,7 @@ enum { MAX_INSTRUMENTS = 20 }; tRhythm *instruments[MAX_INSTRUMENTS]; int n_instruments; - int act_instrument; // -1 if none + int act_instrument; // -1 if none // this one is edited and copied from/to instruments[i] tRhythm edit; @@ -164,8 +164,8 @@ static void Generate(wxButton &but, wxCommandEvent& event); static void Help(); - void Instrument2Win(int i = -1); // instrument[act_instrument] -> win - void Win2Instrument(int i = -1); // win -> instrument[act_instrument] + void Instrument2Win(int i = -1); // instrument[act_instrument] -> win + void Win2Instrument(int i = -1); // win -> instrument[act_instrument] void AddInstrumentDlg(); void AddInstrument(tRhythm *r); void DelInstrument(); Modified: branches/jazz-4.1.3/src/samplcmd.cpp =================================================================== --- branches/jazz-4.1.3/src/samplcmd.cpp 2009-01-19 21:43:48 UTC (rev 687) +++ branches/jazz-4.1.3/src/samplcmd.cpp 2009-01-20 00:46:00 UTC (rev 688) @@ -150,14 +150,14 @@ float tCMixCmd::tablei(long nsample, float *array, float *tab) { - register int loc1,loc2; - float frac = ((float)(nsample)/(*tab)) * *(tab+1); - if(frac < 0) return(array[0]); - if(frac >= *(tab+1)) return(array[(int)*(tab+1)]); - loc1 = (int)frac; - loc2 = loc1+1; - frac = frac - (float)loc1; - return(*(array+loc1) + frac * (*(array+loc2) - *(array+loc1))); + register int loc1,loc2; + float frac = ((float)(nsample)/(*tab)) * *(tab+1); + if(frac < 0) return(array[0]); + if(frac >= *(tab+1)) return(array[(int)*(tab+1)]); + loc1 = (int)frac; + loc2 = loc1+1; + frac = frac - (float)loc1; + return(*(array+loc1) + frac * (*(array+loc2) - *(array+loc1))); } /* p0,2,4,5,6,8,10.. are times, p1,3,5,7,9,11.. are amps, total number of @@ -166,23 +166,23 @@ void tCMixCmd::setline(const float *p, short n_args,int length,float *array) { - double increm; - int i,j,k,points; + double increm; + int i,j,k,points; - increm = (double)(p[n_args - 2] - p[0])/(double)length; - for(j=0,i=0; j < (n_args-2); j += 2) { - points = (int)((double)(p[j+2] - p[j]) / increm +.5); - if(p[j+2] != p[j]) { - if(points <= 0) points = 1; - for(k=0; k < points; k++) { - array[i++] = ((float)k/(float)points) - * (p[j+3] - p[j+1]) + p[j+1]; - if(i == length) return; - } - } - } - i--; - while(++i < length) array[i] = array[i-1]; + increm = (double)(p[n_args - 2] - p[0])/(double)length; + for(j=0,i=0; j < (n_args-2); j += 2) { + points = (int)((double)(p[j+2] - p[j]) / increm +.5); + if(p[j+2] != p[j]) { + if(points <= 0) points = 1; + for(k=0; k < points; k++) { + array[i++] = ((float)k/(f... [truncated message content] |