|
From: <pst...@us...> - 2008-03-29 21:23:57
|
Revision: 351
http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=351&view=rev
Author: pstieber
Date: 2008-03-29 14:23:55 -0700 (Sat, 29 Mar 2008)
Log Message:
-----------
1. Changed tPlayer to JZPlayer.
2. Wrapped some debug code with preprocessor checks in Player.cpp.
Modified Paths:
--------------
trunk/jazz/src/AlsaPlayer.cpp
trunk/jazz/src/AlsaPlayer.h
trunk/jazz/src/Globals.cpp
trunk/jazz/src/Globals.h
trunk/jazz/src/Player.cpp
trunk/jazz/src/Player.h
trunk/jazz/src/Project.h
trunk/jazz/src/SampleWindow.cpp
trunk/jazz/src/mswin/WindowsPlayer.cpp
trunk/jazz/src/mswin/WindowsPlayer.h
Modified: trunk/jazz/src/AlsaPlayer.cpp
===================================================================
--- trunk/jazz/src/AlsaPlayer.cpp 2008-03-21 06:16:33 UTC (rev 350)
+++ trunk/jazz/src/AlsaPlayer.cpp 2008-03-29 21:23:55 UTC (rev 351)
@@ -47,7 +47,7 @@
using namespace std;
tAlsaPlayer::tAlsaPlayer(JZSong *song)
- : tPlayer(song)
+ : JZPlayer(song)
{
ithru = othru = 0;
@@ -74,7 +74,7 @@
snd_seq_poll_descriptors(handle, &pfds, 1, POLLIN|POLLOUT);
//JAVE seqfd doesnt seem to be used for anything, not here nor in the base
- // class tPlayer(but heavily in tSeq2Player)
+ // class JZPlayer(but heavily in tSeq2Player)
// seqfd = pfds.fd;
// create my input/output port
@@ -412,7 +412,7 @@
play_clock = clock;
flush_output();
start_timer(clock);
- tPlayer::StartPlay(clock, loopClock, cont);
+ JZPlayer::StartPlay(clock, loopClock, cont);
Notify();
//flush_output();
}
@@ -590,7 +590,7 @@
void tAlsaPlayer::StopPlay()
{
- tPlayer::StopPlay();
+ JZPlayer::StopPlay();
ResetPlay(0);
flush_output();
stop_queue_timer();
Modified: trunk/jazz/src/AlsaPlayer.h
===================================================================
--- trunk/jazz/src/AlsaPlayer.h 2008-03-21 06:16:33 UTC (rev 350)
+++ trunk/jazz/src/AlsaPlayer.h 2008-03-29 21:23:55 UTC (rev 351)
@@ -40,7 +40,7 @@
-class tAlsaPlayer : public tPlayer
+class tAlsaPlayer : public JZPlayer
{
friend class tAlsaThru;
public:
Modified: trunk/jazz/src/Globals.cpp
===================================================================
--- trunk/jazz/src/Globals.cpp 2008-03-21 06:16:33 UTC (rev 350)
+++ trunk/jazz/src/Globals.cpp 2008-03-29 21:23:55 UTC (rev 351)
@@ -39,7 +39,7 @@
JZSynth* gpSynth = 0;
-tPlayer* gpMidiPlayer = 0;
+JZPlayer* gpMidiPlayer = 0;
tHelp* HelpInstance = 0;
Modified: trunk/jazz/src/Globals.h
===================================================================
--- trunk/jazz/src/Globals.h 2008-03-21 06:16:33 UTC (rev 350)
+++ trunk/jazz/src/Globals.h 2008-03-29 21:23:55 UTC (rev 351)
@@ -32,7 +32,7 @@
class tConfig;
class JZSong;
class JZSynth;
-class tPlayer;
+class JZPlayer;
class tHelp;
class JZProject;
class JZTrackFrame;
@@ -49,7 +49,7 @@
extern std::string gpStartUpSong;
extern JZSong* gpSong;
extern JZSynth* gpSynth;
-extern tPlayer* gpMidiPlayer;
+extern JZPlayer* gpMidiPlayer;
extern tHelp* HelpInstance;
extern std::vector<std::pair<std::string, int> > gLimitSteps;
extern std::vector<std::pair<std::string, int> > gModes;
Modified: trunk/jazz/src/Player.cpp
===================================================================
--- trunk/jazz/src/Player.cpp 2008-03-21 06:16:33 UTC (rev 350)
+++ trunk/jazz/src/Player.cpp 2008-03-29 21:23:55 UTC (rev 351)
@@ -187,10 +187,10 @@
}
}
-// ------------------------- tPlayer ---------------------
+// ------------------------- JZPlayer ---------------------
-tPlayer::tPlayer(JZSong *song)
+JZPlayer::JZPlayer(JZSong *song)
: samples( song->TicksPerQuarter * song->Speed() )
{
DummyDeviceList.Add("default");
@@ -203,20 +203,22 @@
rec_info = 0;
}
-tPlayer::~tPlayer()
+JZPlayer::~JZPlayer()
{
delete PlayLoop;
}
-void tPlayer::ShowError()
+void JZPlayer::ShowError()
{
wxMessageBox("could not install driver", "Error", wxOK);
}
-void tPlayer::StartPlay(long Clock, long LoopClock, int Continue)
+void JZPlayer::StartPlay(long Clock, long LoopClock, int Continue)
{
- cout<< "tPlayer::StartPlay" << endl;
+#ifdef DEBUG_PLAYER_STARTPLAY
+ cout << "JZPlayer::StartPlay" << endl;
+#endif // DEBUG_PLAYER_STARTPLAY
int i;
@@ -496,7 +498,7 @@
}
-void tPlayer::StopPlay()
+void JZPlayer::StopPlay()
{
// Stop the wxTimer.
Stop();
@@ -536,11 +538,14 @@
}
-void tPlayer::Notify()
+void JZPlayer::Notify()
{
// called by timer
long Now = GetRealTimeClock();
- cout << "tPlayer::Notify " << Now << endl;
+
+#ifdef DEBUG_PLAYER_NOTIFY
+ cout << "JZPlayer::Notify " << Now << endl;
+#endif // DEBUG_PLAYER_NOTIFY
if (Now < 0)
{
return;
@@ -549,7 +554,9 @@
// time to put more events
if (Now >= (OutClock - ADVANCE_PLAY))
{
+#ifdef DEBUG_PLAYER_NOTIFY
cout << "*** Notify: more events to playbuffer" << endl;
+#endif // DEBUG_PLAYER_NOTIFY
PlayLoop->PrepareOutput(&mPlayBuffer, Song, OutClock, Now + DELTACLOCK, 0);
if (AudioBuffer)
@@ -578,7 +585,7 @@
}
-void tPlayer::FlushToDevice()
+void JZPlayer::FlushToDevice()
// try to send all events up to OutClock to device
{
int BufferFull = 0;
@@ -602,7 +609,7 @@
}
-void tPlayer::AllNotesOff(int Reset)
+void JZPlayer::AllNotesOff(int Reset)
{
tControl NoteOff(0, 0, 0x78, 0);
tPitch Pitch (0, 0, 0);
@@ -635,7 +642,8 @@
-void tPlayer::OutNow(JZTrack *t, tParam *r) {
+void JZPlayer::OutNow(JZTrack *t, tParam *r)
+{
OutNow(t, &r->Msb);
OutNow(t, &r->Lsb);
OutNow(t, &r->DataMsb);
@@ -650,7 +658,7 @@
#ifdef DEV_MPU401
tMpuPlayer::tMpuPlayer(JZSong *song)
- : tPlayer(song)
+ : JZPlayer(song)
{
poll_millisec = 25;
midinethost = getenv("MIDINETHOST");
@@ -778,7 +786,7 @@
write_ack_mpu(timebase, 2);
OutOfBandEvents.Clear();
- tPlayer::StartPlay(IntClock, LoopClock, Continue);
+ JZPlayer::StartPlay(IntClock, LoopClock, Continue);
// Supress realtime messages to MIDI Out port?
if (!Config(C_RealTimeOut)) {
@@ -815,7 +823,7 @@
}
write_ack_mpu(clocksource, 2);
- tPlayer::Notify();
+ JZPlayer::Notify();
// Start play
write_ack_mpu( play, playsize );
@@ -827,7 +835,7 @@
void tMpuPlayer::StopPlay()
{
static const char stop = RES;
- tPlayer::StopPlay();
+ JZPlayer::StopPlay();
// Reset mpu
write_ack_mpu( &stop, 1);
PlyBytes.Clear();
@@ -1378,7 +1386,7 @@
tSeq2Player::tSeq2Player(JZSong *song)
- : tPlayer(song)
+ : JZPlayer(song)
{
// got to poll fast for midi thru
poll_millisec = 10;
@@ -1734,7 +1742,7 @@
// send initial program changes, controller etc
SEQ_START_TIMER();
seqbuf_dump();
- tPlayer::StartPlay(Clock, LoopClock, Continue);
+ JZPlayer::StartPlay(Clock, LoopClock, Continue);
seqbuf_dump();
ioctl(seqfd, SNDCTL_SEQ_SYNC);
SEQ_STOP_TIMER();
@@ -1751,7 +1759,7 @@
// start play
SEQ_START_TIMER();
StartAudio();
- tPlayer::Notify();
+ JZPlayer::Notify();
seqbuf_dump();
}
@@ -1764,7 +1772,7 @@
ioctl(seqfd, SNDCTL_SEQ_RESET, 0);
SEQ_START_TIMER();
- tPlayer::StopPlay();
+ JZPlayer::StopPlay();
AllNotesOff();
SEQ_STOP_TIMER();
seqbuf_dump();
Modified: trunk/jazz/src/Player.h
===================================================================
--- trunk/jazz/src/Player.h 2008-03-21 06:16:33 UTC (rev 350)
+++ trunk/jazz/src/Player.h 2008-03-29 21:23:55 UTC (rev 351)
@@ -145,7 +145,7 @@
tDeviceList& operator = (const tDeviceList &);
};
-class tPlayer : public wxTimer
+class JZPlayer : public wxTimer
{
protected:
@@ -229,8 +229,8 @@
tSampleSet samples;
public:
- tPlayer(JZSong *song);
- virtual ~tPlayer();
+ JZPlayer(JZSong *song);
+ virtual ~JZPlayer();
void Notify();
@@ -451,7 +451,7 @@
#define ACTIVE_TRACKS 7
#define ACTIVE_TRACKS_MASK 0x7f
-class tMpuPlayer : public tPlayer
+class tMpuPlayer : public JZPlayer
{
int dev;
tBuffer PlyBytes;
@@ -495,12 +495,12 @@
// ------------------------------ null-driver -------------------------------
-class tNullPlayer : public tPlayer
+class tNullPlayer : public JZPlayer
{
public:
tNullPlayer(JZSong* pSong)
- : tPlayer(pSong)
+ : JZPlayer(pSong)
{
}
@@ -565,7 +565,7 @@
-class tSeq2Player : public tPlayer
+class tSeq2Player : public JZPlayer
{
public:
friend class tOSSThru;
Modified: trunk/jazz/src/Project.h
===================================================================
--- trunk/jazz/src/Project.h 2008-03-21 06:16:33 UTC (rev 350)
+++ trunk/jazz/src/Project.h 2008-03-29 21:23:55 UTC (rev 351)
@@ -23,7 +23,7 @@
#ifndef JZ_PROJECT_H
#define JZ_PROJECT_H
-class tPlayer;
+class JZPlayer;
class JZSynth;
class tFilter;
@@ -135,7 +135,7 @@
// Sets RecInfo, JZProject takes ownership of this object
void SetRecInfo(JZRecordingInfo* pRecInfo);
- tPlayer* GetPlayer()
+ JZPlayer* GetPlayer()
{
return mpMidiPlayer;
}
@@ -152,7 +152,7 @@
tConfig* mpConfig;
- tPlayer* mpMidiPlayer;
+ JZPlayer* mpMidiPlayer;
JZSynth* mpSynth;
Modified: trunk/jazz/src/SampleWindow.cpp
===================================================================
--- trunk/jazz/src/SampleWindow.cpp 2008-03-21 06:16:33 UTC (rev 350)
+++ trunk/jazz/src/SampleWindow.cpp 2008-03-29 21:23:55 UTC (rev 351)
@@ -202,7 +202,7 @@
class tSamplePlayPosition : public wxTimer
{
public:
- tSamplePlayPosition(tSampleCnvs &c, tPlayer *p, tSample &s)
+ tSamplePlayPosition(tSampleCnvs &c, JZPlayer *p, tSample &s)
: cnvs(c), player(p), spl(s)
{
visible = FALSE;
@@ -263,7 +263,7 @@
private:
tSampleCnvs &cnvs;
- tPlayer *player;
+ JZPlayer *player;
tSample &spl;
bool visible;
int x;
Modified: trunk/jazz/src/mswin/WindowsPlayer.cpp
===================================================================
--- trunk/jazz/src/mswin/WindowsPlayer.cpp 2008-03-21 06:16:33 UTC (rev 350)
+++ trunk/jazz/src/mswin/WindowsPlayer.cpp 2008-03-29 21:23:55 UTC (rev 351)
@@ -46,7 +46,7 @@
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
tWinPlayer::tWinPlayer(JZSong* pSong)
- : tPlayer(pSong)
+ : JZPlayer(pSong)
{
poll_millisec = 25;
timer_installed = FALSE;
@@ -631,7 +631,7 @@
OutOfBandEvents.Clear();
gpTrackWindow->NewPlayPosition(PlayLoop->Ext2IntClock(Clock));
state->playing = TRUE; // allow for SetTempo in OutNow()
- tPlayer::StartPlay(Clock, LoopClock, Continue);
+ JZPlayer::StartPlay(Clock, LoopClock, Continue);
if (gpConfig->GetValue(C_RealTimeOut))
{
@@ -700,7 +700,7 @@
{
wxBeginBusyCursor();
state->playing = FALSE;
- tPlayer::StopPlay();
+ JZPlayer::StopPlay();
if (gpConfig->GetValue(C_RealTimeOut))
{
tStopPlay *e = new tStopPlay(0);
Modified: trunk/jazz/src/mswin/WindowsPlayer.h
===================================================================
--- trunk/jazz/src/mswin/WindowsPlayer.h 2008-03-21 06:16:33 UTC (rev 350)
+++ trunk/jazz/src/mswin/WindowsPlayer.h 2008-03-29 21:23:55 UTC (rev 351)
@@ -34,7 +34,7 @@
//*****************************************************************************
//*****************************************************************************
-class tWinPlayer : public tPlayer
+class tWinPlayer : public JZPlayer
{
public:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|