|
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.
|