|
From: <pst...@us...> - 2011-08-08 04:28:39
|
Revision: 908
http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=908&view=rev
Author: pstieber
Date: 2011-08-08 04:28:33 +0000 (Mon, 08 Aug 2011)
Log Message:
-----------
Changed long to int in several places on the Linux side.
Modified Paths:
--------------
trunk/jazz/src/AlsaDriver.cpp
trunk/jazz/src/AlsaDriver.h
trunk/jazz/src/AlsaPlayer.cpp
trunk/jazz/src/AlsaPlayer.h
trunk/jazz/src/AudioDriver.cpp
trunk/jazz/src/AudioDriver.h
trunk/jazz/src/Player.h
Modified: trunk/jazz/src/AlsaDriver.cpp
===================================================================
--- trunk/jazz/src/AlsaDriver.cpp 2011-08-08 04:11:58 UTC (rev 907)
+++ trunk/jazz/src/AlsaDriver.cpp 2011-08-08 04:28:33 UTC (rev 908)
@@ -69,8 +69,8 @@
JZAlsaAudioListener(
JZAlsaAudioPlayer* pPlayer,
JZSample& spl,
- long fr_smpl,
- long to_smpl)
+ int fr_smpl,
+ int to_smpl)
: wxTimer(),
mpPlayer(pPlayer),
mHardExit(true)
@@ -107,7 +107,7 @@
}
}
- long GetPlayPosition()
+ int GetPlayPosition()
{
return mpPlayer->GetCurrentPosition(JZAlsaAudioPlayer::PLAYBACK);
}
@@ -175,7 +175,7 @@
return running_mode & (1 << PLAYBACK);
}
-void JZAlsaAudioPlayer::StartPlay(long clock, long loopClock, int cont)
+void JZAlsaAudioPlayer::StartPlay(int clock, int loopClock, int cont)
{
delete mpListener;
mSamples.StartPlay(clock);
@@ -186,7 +186,7 @@
return;
}
- long ticks_per_minute = mpSong->GetTicksPerQuarter() * mpSong->Speed();
+ int ticks_per_minute = mpSong->GetTicksPerQuarter() * mpSong->Speed();
mSamples.ResetBuffers(mpAudioBuffer, clock, ticks_per_minute);
last_scount = 0;
cur_pos = 0;
@@ -517,20 +517,20 @@
}
-void JZAlsaAudioPlayer::ResetPlay(long clock)
+void JZAlsaAudioPlayer::ResetPlay(int clock)
{
JZAlsaPlayer::ResetPlay(clock);
if (pcm[PLAYBACK])
{
snd_pcm_drop(pcm[PLAYBACK]);
-// long ticks_per_minute = mpSong->GetTicksPerQuarter() * mpSong->Speed();
+// int ticks_per_minute = mpSong->GetTicksPerQuarter() * mpSong->Speed();
// mSamples.ResetBuffers(mpAudioBuffer, clock, ticks_per_minute);
}
audio_clock_offset = clock;
cur_pos = 0;
}
-long JZAlsaAudioPlayer::GetCurrentPosition(int mode)
+int JZAlsaAudioPlayer::GetCurrentPosition(int mode)
{
return cur_scount;
}
@@ -556,7 +556,7 @@
return; // disabled
}
- long scount = GetCurrentPosition(mode);
+ int scount = GetCurrentPosition(mode);
// get realtime info for audio/midi sync
if (scount != last_scount)
@@ -581,8 +581,8 @@
}
last_scount = scount;
cur_pos += samplediff;
- long audio_clock =
- (long)mSamples.Samples2Ticks(cur_pos) + audio_clock_offset;
+ int audio_clock =
+ (int)mSamples.Samples2Ticks(cur_pos) + audio_clock_offset;
int delta_clock = audio_clock - qtick;
int new_speed = midi_speed + delta_clock;
@@ -625,12 +625,12 @@
CloseDsp(true);
if (RecordMode())
{
- long frc = mpRecordingInfo->mFromClock;
+ int frc = mpRecordingInfo->mFromClock;
if (frc < audio_clock_offset)
{
frc = audio_clock_offset;
}
- long toc = mpRecordingInfo->mToClock;
+ int toc = mpRecordingInfo->mToClock;
if (toc > recd_clock)
{
toc = recd_clock;
@@ -670,7 +670,7 @@
mpListener = new JZAlsaAudioListener(this, key);
}
-void JZAlsaAudioPlayer::ListenAudio(JZSample& spl, long fr_smpl, long to_smpl)
+void JZAlsaAudioPlayer::ListenAudio(JZSample& spl, int fr_smpl, int to_smpl)
{
if (!mAudioEnabled)
{
@@ -691,7 +691,7 @@
mpListener = new JZAlsaAudioListener(this, spl, fr_smpl, to_smpl);
}
-long JZAlsaAudioPlayer::GetListenerPlayPosition()
+int JZAlsaAudioPlayer::GetListenerPlayPosition()
{
if (!mpListener)
{
Modified: trunk/jazz/src/AlsaDriver.h
===================================================================
--- trunk/jazz/src/AlsaDriver.h 2011-08-08 04:11:58 UTC (rev 907)
+++ trunk/jazz/src/AlsaDriver.h 2011-08-08 04:28:33 UTC (rev 908)
@@ -41,7 +41,7 @@
virtual ~JZAlsaAudioPlayer();
int LoadSamples(const char *filename);
virtual void Notify();
- virtual void StartPlay(long Clock, long LoopClock = 0, int Continue = 0);
+ virtual void StartPlay(int Clock, int LoopClock = 0, int Continue = 0);
virtual void StopPlay();
virtual bool IsInstalled()
{
@@ -56,14 +56,14 @@
mAudioEnabled = AudioEnabled;
}
virtual void ListenAudio(int key, int start_stop_mode = 1);
- virtual void ListenAudio(JZSample &spl, long fr_smpl, long to_smpl);
+ virtual void ListenAudio(JZSample &spl, int fr_smpl, int to_smpl);
virtual bool IsListening() const
{
return mpListener != 0;
}
- virtual long GetListenerPlayPosition();
+ virtual int GetListenerPlayPosition();
virtual void StartAudio();
- virtual void ResetPlay(long clock);
+ virtual void ResetPlay(int clock);
enum
{
@@ -84,7 +84,7 @@
void CloseDsp(bool Reset);
- long GetCurrentPosition(int mode);
+ int GetCurrentPosition(int mode);
int GetFreeSpace(int mode);
// If true can do full duplex record/play.
@@ -93,10 +93,10 @@
snd_pcm_t *pcm[2];
bool mInstalled;
- long audio_clock_offset;
- long cur_pos;
- long last_scount;
- long cur_scount;
+ int audio_clock_offset;
+ int cur_pos;
+ int last_scount;
+ int cur_scount;
int running_mode;
int midi_speed; // start speed in bpm
int curr_speed; // actual speed in bpm
@@ -106,10 +106,10 @@
int card; // card number in config
std::string mDeviceNames[2]; // device names
- long frag_size[2];
- long frag_byte_size[2];
+ int frag_size[2];
+ int frag_byte_size[2];
int frame_shift[2];
- long frame_boundary[2];
+ int frame_boundary[2];
JZAlsaAudioListener* mpListener;
JZAudioRecordBuffer recbuffers;
Modified: trunk/jazz/src/AlsaPlayer.cpp
===================================================================
--- trunk/jazz/src/AlsaPlayer.cpp 2011-08-08 04:11:58 UTC (rev 907)
+++ trunk/jazz/src/AlsaPlayer.cpp 2011-08-08 04:28:33 UTC (rev 908)
@@ -543,7 +543,7 @@
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-void JZAlsaPlayer::OutBreak(long clock)
+void JZAlsaPlayer::OutBreak(int clock)
{
while (echo_clock + 48 < clock)
{
@@ -559,7 +559,7 @@
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-void JZAlsaPlayer::StartPlay(long clock, long loopClock, int cont)
+void JZAlsaPlayer::StartPlay(int clock, int loopClock, int cont)
{
recd_clock = clock;
echo_clock = clock;
@@ -573,7 +573,7 @@
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-void JZAlsaPlayer::ResetPlay(long clock)
+void JZAlsaPlayer::ResetPlay(int clock)
{
// Purge queues.
snd_seq_drop_output_buffer(handle);
@@ -594,7 +594,7 @@
void JZAlsaPlayer::Notify()
{
// called by timer
- long Now = GetRealTimeClock();
+ int Now = GetRealTimeClock();
cout << "JZAlsaPlayer::Notify " << Now << ' ' << play_clock << endl;
@@ -657,7 +657,7 @@
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-void JZAlsaPlayer::set_event_header(snd_seq_event_t *ev, long clock, int type)
+void JZAlsaPlayer::set_event_header(snd_seq_event_t *ev, int clock, int type)
{
memset(ev, 0, sizeof(*ev));
snd_seq_ev_set_source(ev, self.port);
@@ -671,7 +671,7 @@
//-----------------------------------------------------------------------------
void JZAlsaPlayer::set_event_header(
snd_seq_event_t *ev,
- long clock,
+ int clock,
int len,
void *ptr)
{
@@ -686,7 +686,7 @@
// Description:
// Initialize the alsa timer.
//-----------------------------------------------------------------------------
-int JZAlsaPlayer::start_timer(long clock)
+int JZAlsaPlayer::start_timer(int clock)
{
int time_base = mpSong->GetTicksPerQuarter();
int cur_speed = mpSong->GetTrack(0)->GetCurrentSpeed(clock);
@@ -716,7 +716,7 @@
// Immediately start the alsa queue timer. Do this by sending an "start"
// event to the queue.
//-----------------------------------------------------------------------------
-void JZAlsaPlayer::start_queue_timer(long clock)
+void JZAlsaPlayer::start_queue_timer(int clock)
{
stop_queue_timer(); // to be sure
@@ -938,11 +938,11 @@
// looking at time stamps on events in the queue, and also updates the
// display, so the name is not well chosen.
//-----------------------------------------------------------------------------
-long JZAlsaPlayer::GetRealTimeClock()
+int JZAlsaPlayer::GetRealTimeClock()
{
// input recorded events (including my echo events)
snd_seq_event_t *ie;
- long old_recd_clock = recd_clock;
+ int old_recd_clock = recd_clock;
while (snd_seq_event_input(handle, &ie) >= 0 && ie != 0)
{
recd_event(ie);
Modified: trunk/jazz/src/AlsaPlayer.h
===================================================================
--- trunk/jazz/src/AlsaPlayer.h 2011-08-08 04:11:58 UTC (rev 907)
+++ trunk/jazz/src/AlsaPlayer.h 2011-08-08 04:28:33 UTC (rev 908)
@@ -62,10 +62,10 @@
}
void OutNow(JZParam *r);
void OutBreak();
- void OutBreak(long BreakOver);
- void StartPlay(long Clock, long LoopClock = 0, int Continue = 0);
+ void OutBreak(int BreakOver);
+ void StartPlay(int Clock, int LoopClock = 0, int Continue = 0);
void StopPlay();
- long GetRealTimeClock();
+ int GetRealTimeClock();
virtual void SetSoftThru(int on, int idev, int odev);
virtual int SupportsMultipleDevices()
{
@@ -114,17 +114,17 @@
JZAlsaDeviceList& Devicelist,
unsigned DeviceCapabilities);
int select_list(JZAlsaDeviceList &list, const char *title, int def_device);
- int start_timer(long clock);
+ int start_timer(int clock);
int write(snd_seq_event_t *ev)
{
// 0 == ok
return write(ev, 0);
}
int write(snd_seq_event_t *ev, int now); // 0 == ok
- void set_event_header(snd_seq_event_t *ev, long clock, int type);
- void set_event_header(snd_seq_event_t *ev, long clock, int len, void *ptr);
+ void set_event_header(snd_seq_event_t *ev, int clock, int type);
+ void set_event_header(snd_seq_event_t *ev, int clock, int len, void *ptr);
void init_queue_tempo(int time_base, int bpm);
- void start_queue_timer(long clock);
+ void start_queue_timer(int clock);
void stop_queue_timer();
void recd_event(snd_seq_event_t *ev);
void flush_output();
@@ -134,15 +134,15 @@
void set_pool_sizes();
int compose_echo(int clock, unsigned int arg = 0);
virtual void StartAudio();
- virtual void ResetPlay(long clock);
+ virtual void ResetPlay(int clock);
int sync_master();
void sync_master_remove();
int sync_slave();
void sync_slave_remove();
- long play_clock; // current clock
- long recd_clock; // clock received so far from recorded events or echo events
- long echo_clock; // echo events have been sent up to this clock
+ int play_clock; // current clock
+ int recd_clock; // clock received so far from recorded events or echo events
+ int echo_clock; // echo events have been sent up to this clock
JZAlsaThru *thru;
int ithru, othru; // index in iaddr, oaddr of source/target device
Modified: trunk/jazz/src/AudioDriver.cpp
===================================================================
--- trunk/jazz/src/AudioDriver.cpp 2011-08-08 04:11:58 UTC (rev 907)
+++ trunk/jazz/src/AudioDriver.cpp 2011-08-08 04:28:33 UTC (rev 908)
@@ -64,8 +64,8 @@
JZAudioListener(
JZAudioPlayer* pPlayer,
JZSample& spl,
- long fr_smpl,
- long to_smpl)
+ int fr_smpl,
+ int to_smpl)
: wxTimer(),
mpPlayer(pPlayer),
mCount(0),
@@ -97,7 +97,7 @@
}
}
- long GetPlayPosition()
+ int GetPlayPosition()
{
count_info cinfo;
if (ioctl(mpPlayer->dev, SNDCTL_DSP_GETOPTR, &cinfo) == -1)
@@ -200,7 +200,7 @@
return;
}
- long ticks_per_minute = mpSong->GetTicksPerQuarter() * mpSong->Speed();
+ int ticks_per_minute = mpSong->GetTicksPerQuarter() * mpSong->Speed();
mSamples.ResetBuffers(mpAudioBuffer, start_clock, ticks_per_minute);
if (PlaybackMode())
{
@@ -480,7 +480,7 @@
// search for SNDCTL_DSP_GETOPTR in linux/drivers/sound/dmabuf
// before trying to understand the next line
- long new_bytes = cinfo.bytes - cinfo.ptr; // info.ptr is garbage!!
+ int new_bytes = cinfo.bytes - cinfo.ptr; // info.ptr is garbage!!
if (new_bytes != audio_bytes)
{
// driver has processed some bytes or whole fragment
@@ -493,7 +493,7 @@
audio_bytes = new_bytes;
// OSS bug?: mpu401 does not like speed changes too often
- long audio_clock = (long)mSamples.Samples2Ticks(audio_bytes / 2);
+ int audio_clock = (int)mSamples.Samples2Ticks(audio_bytes / 2);
int delta_clock = audio_clock - midi_clock;
int new_speed = midi_speed + delta_clock;
@@ -525,7 +525,7 @@
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-void JZAudioPlayer::StartPlay(long Clock, long LoopClock, int Continue)
+void JZAudioPlayer::StartPlay(int Clock, int LoopClock, int Continue)
{
delete mpListener;
mSamples.StartPlay(Clock);
@@ -546,12 +546,12 @@
CloseDsp(true);
if (RecordMode())
{
- long frc = mpRecordingInfo->mFromClock;
+ int frc = mpRecordingInfo->mFromClock;
if (frc < start_clock)
{
frc = start_clock;
}
- long toc = mpRecordingInfo->mToClock;
+ int toc = mpRecordingInfo->mToClock;
if (toc > recd_clock)
{
toc = recd_clock;
@@ -595,7 +595,7 @@
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-void JZAudioPlayer::ListenAudio(JZSample &spl, long fr_smpl, long to_smpl)
+void JZAudioPlayer::ListenAudio(JZSample &spl, int fr_smpl, int to_smpl)
{
if (!mAudioEnabled)
{
@@ -617,7 +617,7 @@
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-long JZAudioPlayer::GetListenerPlayPosition()
+int JZAudioPlayer::GetListenerPlayPosition()
{
if (!mpListener)
{
Modified: trunk/jazz/src/AudioDriver.h
===================================================================
--- trunk/jazz/src/AudioDriver.h 2011-08-08 04:11:58 UTC (rev 907)
+++ trunk/jazz/src/AudioDriver.h 2011-08-08 04:28:33 UTC (rev 908)
@@ -54,7 +54,7 @@
virtual void Notify();
- virtual void StartPlay(long Clock, long LoopClock = 0, int Continue = 0);
+ virtual void StartPlay(int Clock, int LoopClock = 0, int Continue = 0);
virtual void StopPlay();
@@ -77,14 +77,14 @@
virtual void ListenAudio(int key, int start_stop_mode = 1);
- virtual void ListenAudio(JZSample &spl, long fr_smpl, long to_smpl);
+ virtual void ListenAudio(JZSample &spl, int fr_smpl, int to_smpl);
virtual bool IsListening() const
{
return mpListener != 0;
}
- virtual long GetListenerPlayPosition();
+ virtual int GetListenerPlayPosition();
// for recording
int RecordMode() const;
@@ -109,8 +109,8 @@
int dev;
bool mInstalled;
- long midi_clock;
- long audio_bytes;
+ int midi_clock;
+ int audio_bytes;
int midi_speed; // start speed in bpm
int curr_speed; // actual speed in bpm
Modified: trunk/jazz/src/Player.h
===================================================================
--- trunk/jazz/src/Player.h 2011-08-08 04:11:58 UTC (rev 907)
+++ trunk/jazz/src/Player.h 2011-08-08 04:28:33 UTC (rev 908)
@@ -293,7 +293,7 @@
virtual int GetListenerPlayPosition()
{
- return -1L;
+ return -1;
}
void LoadDefaultSettings()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|