Replace all (applicable) instances of __int64 with long long. (All except those in foreign header files.)
Originally committed to SVN as r1540.
This commit is contained in:
parent
e9f05f84eb
commit
8909ea48e2
33 changed files with 186 additions and 188 deletions
|
@ -203,8 +203,8 @@ void AudioDisplay::UpdateImage(bool weak) {
|
|||
lineEnd = 0;
|
||||
selStartCap = 0;
|
||||
selEndCap = 0;
|
||||
__int64 drawSelStart = 0;
|
||||
__int64 drawSelEnd = 0;
|
||||
long long drawSelStart = 0;
|
||||
long long drawSelEnd = 0;
|
||||
if (dialogue) {
|
||||
GetDialoguePos(lineStart,lineEnd,false);
|
||||
hasSel = true;
|
||||
|
@ -247,7 +247,7 @@ void AudioDisplay::UpdateImage(bool weak) {
|
|||
|
||||
// Draw seconds boundaries
|
||||
if (draw_boundary_lines) {
|
||||
__int64 start = Position*samples;
|
||||
long long start = Position*samples;
|
||||
int rate = provider->GetSampleRate();
|
||||
int pixBounds = rate / samples;
|
||||
dc.SetPen(wxPen(Options.AsColour(_T("Audio Seconds Boundaries")),1,wxDOT));
|
||||
|
@ -302,7 +302,7 @@ void AudioDisplay::UpdateImage(bool weak) {
|
|||
if (!spectrum) dc.SetTextForeground(Options.AsColour(_T("Audio Syllable text")));
|
||||
else dc.SetTextForeground(wxColour(255,255,255));
|
||||
size_t karn = karaoke->syllables.size();
|
||||
__int64 pos1,pos2;
|
||||
long long pos1,pos2;
|
||||
int len,curpos;
|
||||
wxCoord tw=0,th=0;
|
||||
AudioKaraokeSyllable *curSyl;
|
||||
|
@ -479,13 +479,13 @@ void AudioDisplay::DrawTimescale(wxDC &dc) {
|
|||
dc.SetFont(scaleFont);
|
||||
|
||||
// Timescale ticks
|
||||
__int64 start = Position*samples;
|
||||
long long start = Position*samples;
|
||||
int rate = provider->GetSampleRate();
|
||||
for (int i=1;i<32;i*=2) {
|
||||
int pixBounds = rate / (samples * 4 / i);
|
||||
if (pixBounds >= 8) {
|
||||
for (int x=0;x<w;x++) {
|
||||
__int64 pos = (x*samples)+start;
|
||||
long long pos = (x*samples)+start;
|
||||
// Second boundary
|
||||
if (pos % rate < samples) {
|
||||
dc.DrawLine(x,h+2,x,h+8);
|
||||
|
@ -541,7 +541,7 @@ void AudioDisplay::DrawWaveform(wxDC &dc,bool weak) {
|
|||
// Draw pre-selection
|
||||
if (!hasSel) selStartCap = w;
|
||||
dc.SetPen(wxPen(Options.AsColour(_T("Audio Waveform"))));
|
||||
for (__int64 i=0;i<selStartCap;i++) {
|
||||
for (long long i=0;i<selStartCap;i++) {
|
||||
dc.DrawLine(i,peak[i],i,min[i]-1);
|
||||
}
|
||||
|
||||
|
@ -551,13 +551,13 @@ void AudioDisplay::DrawWaveform(wxDC &dc,bool weak) {
|
|||
if (NeedCommit && !karaoke->enabled) dc.SetPen(wxPen(Options.AsColour(_T("Audio Waveform Modified"))));
|
||||
else dc.SetPen(wxPen(Options.AsColour(_T("Audio Waveform Selected"))));
|
||||
}
|
||||
for (__int64 i=selStartCap;i<selEndCap;i++) {
|
||||
for (long long i=selStartCap;i<selEndCap;i++) {
|
||||
dc.DrawLine(i,peak[i],i,min[i]-1);
|
||||
}
|
||||
|
||||
// Draw post-selection
|
||||
dc.SetPen(wxPen(Options.AsColour(_T("Audio Waveform"))));
|
||||
for (__int64 i=selEndCap;i<w;i++) {
|
||||
for (long long i=selEndCap;i<w;i++) {
|
||||
dc.DrawLine(i,peak[i],i,min[i]-1);
|
||||
}
|
||||
}
|
||||
|
@ -618,7 +618,7 @@ void AudioDisplay::DrawSpectrum(wxDC &finaldc,bool weak) {
|
|||
|
||||
//////////////////////////
|
||||
// Get selection position
|
||||
void AudioDisplay::GetDialoguePos(__int64 &selStart,__int64 &selEnd, bool cap) {
|
||||
void AudioDisplay::GetDialoguePos(long long &selStart,long long &selEnd, bool cap) {
|
||||
selStart = GetXAtMS(curStartMS);
|
||||
selEnd = GetXAtMS(curEndMS);
|
||||
|
||||
|
@ -633,7 +633,7 @@ void AudioDisplay::GetDialoguePos(__int64 &selStart,__int64 &selEnd, bool cap) {
|
|||
|
||||
////////////////////////
|
||||
// Get karaoke position
|
||||
void AudioDisplay::GetKaraokePos(__int64 &karStart,__int64 &karEnd, bool cap) {
|
||||
void AudioDisplay::GetKaraokePos(long long &karStart,long long &karEnd, bool cap) {
|
||||
try {
|
||||
// Wrap around
|
||||
int nsyls = (int)karaoke->syllables.size();
|
||||
|
@ -759,7 +759,7 @@ void AudioDisplay::SetSamplesPercent(int percent,bool update,float pivot) {
|
|||
// Center scroll
|
||||
int oldSamples = samples;
|
||||
UpdateSamples();
|
||||
PositionSample += __int64((oldSamples-samples)*w*pivot);
|
||||
PositionSample += long long((oldSamples-samples)*w*pivot);
|
||||
if (PositionSample < 0) PositionSample = 0;
|
||||
|
||||
// Update
|
||||
|
@ -776,7 +776,7 @@ void AudioDisplay::SetSamplesPercent(int percent,bool update,float pivot) {
|
|||
void AudioDisplay::UpdateSamples() {
|
||||
// Set samples
|
||||
if (!provider) return;
|
||||
__int64 totalSamples = provider->GetNumSamples();
|
||||
long long totalSamples = provider->GetNumSamples();
|
||||
int total = totalSamples / w;
|
||||
int max = 5760000 / w; // 2 minutes at 48 kHz maximum
|
||||
if (total > max) total = max;
|
||||
|
@ -949,42 +949,42 @@ void AudioDisplay::UpdateScrollbar() {
|
|||
|
||||
//////////////////////////////////////////////
|
||||
// Gets the sample number at the x coordinate
|
||||
__int64 AudioDisplay::GetSampleAtX(int x) {
|
||||
long long AudioDisplay::GetSampleAtX(int x) {
|
||||
return (x+Position)*samples;
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////
|
||||
// Gets the x coordinate corresponding to sample
|
||||
int AudioDisplay::GetXAtSample(__int64 n) {
|
||||
int AudioDisplay::GetXAtSample(long long n) {
|
||||
return samples ? (n/samples)-Position : 0;
|
||||
}
|
||||
|
||||
|
||||
/////////////////
|
||||
// Get MS from X
|
||||
int AudioDisplay::GetMSAtX(__int64 x) {
|
||||
int AudioDisplay::GetMSAtX(long long x) {
|
||||
return (PositionSample+(x*samples)) * 1000 / provider->GetSampleRate();
|
||||
}
|
||||
|
||||
|
||||
/////////////////
|
||||
// Get X from MS
|
||||
int AudioDisplay::GetXAtMS(__int64 ms) {
|
||||
int AudioDisplay::GetXAtMS(long long ms) {
|
||||
return ((ms * provider->GetSampleRate() / 1000)-PositionSample)/samples;
|
||||
}
|
||||
|
||||
|
||||
////////////////////
|
||||
// Get MS At sample
|
||||
int AudioDisplay::GetMSAtSample(__int64 x) {
|
||||
int AudioDisplay::GetMSAtSample(long long x) {
|
||||
return x * 1000 / provider->GetSampleRate();
|
||||
}
|
||||
|
||||
|
||||
////////////////////
|
||||
// Get Sample at MS
|
||||
__int64 AudioDisplay::GetSampleAtMS(__int64 ms) {
|
||||
long long AudioDisplay::GetSampleAtMS(long long ms) {
|
||||
return ms * provider->GetSampleRate() / 1000;
|
||||
}
|
||||
|
||||
|
@ -1026,7 +1026,7 @@ void AudioDisplay::Play(int start,int end) {
|
|||
|
||||
// Set defaults
|
||||
wxLogDebug(_T("AudioDisplay::Play: initialising playback"));
|
||||
__int64 num_samples = provider->GetNumSamples();
|
||||
long long num_samples = provider->GetNumSamples();
|
||||
start = GetSampleAtMS(start);
|
||||
if (end != -1) end = GetSampleAtMS(end);
|
||||
else end = num_samples-1;
|
||||
|
@ -1301,8 +1301,8 @@ void AudioDisplay::OnPaint(wxPaintEvent& event) {
|
|||
// Mouse event
|
||||
void AudioDisplay::OnMouseEvent(wxMouseEvent& event) {
|
||||
// Get x,y
|
||||
__int64 x = event.GetX();
|
||||
__int64 y = event.GetY();
|
||||
long long x = event.GetX();
|
||||
long long y = event.GetY();
|
||||
bool karMode = karaoke->enabled;
|
||||
bool shiftDown = event.m_shiftDown;
|
||||
int timelineHeight = Options.AsBool(_T("Audio Draw Timeline")) ? 20 : 0;
|
||||
|
@ -1511,7 +1511,7 @@ void AudioDisplay::OnMouseEvent(wxMouseEvent& event) {
|
|||
// Karaoke mode
|
||||
else {
|
||||
// Look for a syllable
|
||||
__int64 pos,len,curpos;
|
||||
long long pos,len,curpos;
|
||||
AudioKaraokeSyllable *curSyl;
|
||||
size_t karn = karaoke->syllables.size();
|
||||
for (size_t i=0;i<karn;i++) {
|
||||
|
@ -1625,7 +1625,7 @@ void AudioDisplay::OnMouseEvent(wxMouseEvent& event) {
|
|||
pos = GetXAtMS(curStartMS+(len+curpos)*10);
|
||||
if (x != pos) {
|
||||
// Calculate delta in centiseconds
|
||||
int delta = ((__int64)(x-pos)*samples*100)/provider->GetSampleRate();
|
||||
int delta = ((long long)(x-pos)*samples*100)/provider->GetSampleRate();
|
||||
|
||||
// Apply delta
|
||||
int deltaMode = 0;
|
||||
|
@ -1701,7 +1701,7 @@ int AudioDisplay::GetBoundarySnap(int ms,int rangeX,bool shiftHeld,bool start) {
|
|||
bool snapKey = Options.AsBool(_T("Audio snap to keyframes"));
|
||||
if (shiftHeld) snapKey = !snapKey;
|
||||
if (snapKey && VideoContext::Get()->KeyFramesLoaded() && Options.AsBool(_T("Audio Draw Keyframes"))) {
|
||||
__int64 keyMS;
|
||||
long long keyMS;
|
||||
wxArrayInt keyFrames = VideoContext::Get()->GetKeyFrames();
|
||||
int frame;
|
||||
for (unsigned int i=0;i<keyFrames.Count();i++) {
|
||||
|
@ -1799,11 +1799,11 @@ int AudioDisplay::GetBoundarySnap(int ms,int rangeX,bool shiftHeld,bool start) {
|
|||
// Scrub
|
||||
if (scrubbing && scrubButton) {
|
||||
// Get current data
|
||||
__int64 exactPos = MAX(0,GetSampleAtX(x));
|
||||
long long exactPos = MAX(0,GetSampleAtX(x));
|
||||
int curScrubTime = clock();
|
||||
int scrubDeltaTime = curScrubTime - scrubTime;
|
||||
bool invert = exactPos < scrubLastPos;
|
||||
__int64 curScrubPos = exactPos;
|
||||
long long curScrubPos = exactPos;
|
||||
|
||||
if (scrubDeltaTime > 0) {
|
||||
// Get derived data
|
||||
|
@ -1811,7 +1811,7 @@ int AudioDisplay::GetBoundarySnap(int ms,int rangeX,bool shiftHeld,bool start) {
|
|||
int curRate = MID(int(scrubLastRate-rateChange),abs(int(exactPos - scrubLastPos)) * CLOCKS_PER_SEC / scrubDeltaTime,int(scrubLastRate+rateChange));
|
||||
if (abs(curRate-scrubLastRate) < rateChange) curRate = scrubLastRate;
|
||||
curScrubPos = scrubLastPos + (curRate * scrubDeltaTime / CLOCKS_PER_SEC * (invert ? -1 : 1));
|
||||
__int64 scrubDelta = curScrubPos - scrubLastPos;
|
||||
long long scrubDelta = curScrubPos - scrubLastPos;
|
||||
scrubLastRate = curRate;
|
||||
|
||||
// Copy data to buffer
|
||||
|
@ -1913,7 +1913,7 @@ void AudioDisplay::OnUpdateTimer(wxTimerEvent &event) {
|
|||
// Draw cursor
|
||||
int curpos = -1;
|
||||
if (player->IsPlaying()) {
|
||||
__int64 curPos = player->GetCurrentPosition();
|
||||
long long curPos = player->GetCurrentPosition();
|
||||
if (curPos > player->GetStartPosition() && curPos < player->GetEndPosition()) {
|
||||
// Scroll if needed
|
||||
int posX = GetXAtSample(curPos);
|
||||
|
|
|
@ -71,10 +71,10 @@ private:
|
|||
wxBitmap *origImage;
|
||||
wxBitmap *spectrumDisplay;
|
||||
wxBitmap *spectrumDisplaySelected;
|
||||
__int64 PositionSample;
|
||||
long long PositionSample;
|
||||
float scale;
|
||||
int samples;
|
||||
__int64 Position;
|
||||
long long Position;
|
||||
int samplesPercent;
|
||||
int oldCurPos;
|
||||
bool hasFocus;
|
||||
|
@ -86,12 +86,12 @@ private:
|
|||
bool diagUpdated;
|
||||
bool holding;
|
||||
bool draggingScale;
|
||||
__int64 selStart;
|
||||
__int64 selEnd;
|
||||
__int64 lineStart;
|
||||
__int64 lineEnd;
|
||||
__int64 selStartCap;
|
||||
__int64 selEndCap;
|
||||
long long selStart;
|
||||
long long selEnd;
|
||||
long long lineStart;
|
||||
long long lineEnd;
|
||||
long long selStartCap;
|
||||
long long selEndCap;
|
||||
int hold;
|
||||
int lastX;
|
||||
int lastDragX;
|
||||
|
@ -103,7 +103,7 @@ private:
|
|||
int *min;
|
||||
|
||||
int scrubTime;
|
||||
__int64 scrubLastPos;
|
||||
long long scrubLastPos;
|
||||
bool scrubbing;
|
||||
int scrubLastRate;
|
||||
|
||||
|
@ -122,8 +122,8 @@ private:
|
|||
void DrawInactiveLines(wxDC &dc);
|
||||
void DrawWaveform(wxDC &dc,bool weak);
|
||||
void DrawSpectrum(wxDC &dc,bool weak);
|
||||
void GetDialoguePos(__int64 &start,__int64 &end,bool cap);
|
||||
void GetKaraokePos(__int64 &start,__int64 &end,bool cap);
|
||||
void GetDialoguePos(long long &start,long long &end,bool cap);
|
||||
void GetKaraokePos(long long &start,long long &end,bool cap);
|
||||
void UpdatePosition(int pos,bool IsSample=false);
|
||||
|
||||
int GetBoundarySnap(int x,int range,bool shiftHeld,bool start=true);
|
||||
|
@ -169,12 +169,12 @@ public:
|
|||
void Play(int start,int end);
|
||||
void Stop();
|
||||
|
||||
__int64 GetSampleAtX(int x);
|
||||
int GetXAtSample(__int64 n);
|
||||
int GetMSAtX(__int64 x);
|
||||
int GetXAtMS(__int64 ms);
|
||||
int GetMSAtSample(__int64 x);
|
||||
__int64 GetSampleAtMS(__int64 ms);
|
||||
long long GetSampleAtX(int x);
|
||||
int GetXAtSample(long long n);
|
||||
int GetMSAtX(long long x);
|
||||
int GetXAtMS(long long ms);
|
||||
int GetMSAtSample(long long x);
|
||||
long long GetSampleAtMS(long long ms);
|
||||
int GetSyllableAtX(int x);
|
||||
|
||||
void GetTimesDialogue(int &start,int &end);
|
||||
|
|
|
@ -67,7 +67,7 @@ public:
|
|||
virtual void OpenStream() {}
|
||||
virtual void CloseStream() {}
|
||||
|
||||
virtual void Play(__int64 start,__int64 count)=0; // Play sample range
|
||||
virtual void Play(long long start,long long count)=0; // Play sample range
|
||||
virtual void Stop(bool timerToo=true)=0; // Stop playing
|
||||
virtual void RequestStop(); // Request it to stop playing in a thread-safe way
|
||||
virtual bool IsPlaying()=0;
|
||||
|
@ -75,11 +75,11 @@ public:
|
|||
virtual void SetVolume(double volume)=0;
|
||||
virtual double GetVolume()=0;
|
||||
|
||||
virtual __int64 GetStartPosition()=0;
|
||||
virtual __int64 GetEndPosition()=0;
|
||||
virtual __int64 GetCurrentPosition()=0;
|
||||
virtual void SetEndPosition(__int64 pos)=0;
|
||||
virtual void SetCurrentPosition(__int64 pos)=0;
|
||||
virtual long long GetStartPosition()=0;
|
||||
virtual long long GetEndPosition()=0;
|
||||
virtual long long GetCurrentPosition()=0;
|
||||
virtual void SetEndPosition(long long pos)=0;
|
||||
virtual void SetCurrentPosition(long long pos)=0;
|
||||
|
||||
virtual wxMutex *GetMutex();
|
||||
|
||||
|
|
|
@ -85,15 +85,15 @@ public:
|
|||
void OpenStream();
|
||||
void CloseStream();
|
||||
|
||||
void Play(__int64 start,__int64 count);
|
||||
void Play(long long start,long long count);
|
||||
void Stop(bool timerToo=true);
|
||||
bool IsPlaying();
|
||||
|
||||
__int64 GetStartPosition();
|
||||
__int64 GetEndPosition();
|
||||
__int64 GetCurrentPosition();
|
||||
void SetEndPosition(__int64 pos);
|
||||
void SetCurrentPosition(__int64 pos);
|
||||
long long GetStartPosition();
|
||||
long long GetEndPosition();
|
||||
long long GetCurrentPosition();
|
||||
void SetEndPosition(long long pos);
|
||||
void SetCurrentPosition(long long pos);
|
||||
|
||||
void SetVolume(double vol) { volume = vol; }
|
||||
double GetVolume() { return volume; }
|
||||
|
@ -311,7 +311,7 @@ void AlsaPlayer::CloseStream()
|
|||
|
||||
////////
|
||||
// Play
|
||||
void AlsaPlayer::Play(__int64 start,__int64 count)
|
||||
void AlsaPlayer::Play(long long start,long long count)
|
||||
{
|
||||
if (playing) {
|
||||
// Quick reset
|
||||
|
@ -367,7 +367,7 @@ bool AlsaPlayer::IsPlaying()
|
|||
|
||||
///////////
|
||||
// Set end
|
||||
void AlsaPlayer::SetEndPosition(__int64 pos)
|
||||
void AlsaPlayer::SetEndPosition(long long pos)
|
||||
{
|
||||
end_frame = pos;
|
||||
}
|
||||
|
@ -375,19 +375,19 @@ void AlsaPlayer::SetEndPosition(__int64 pos)
|
|||
|
||||
////////////////////////
|
||||
// Set current position
|
||||
void AlsaPlayer::SetCurrentPosition(__int64 pos)
|
||||
void AlsaPlayer::SetCurrentPosition(long long pos)
|
||||
{
|
||||
cur_frame = pos;
|
||||
}
|
||||
|
||||
|
||||
__int64 AlsaPlayer::GetStartPosition()
|
||||
long long AlsaPlayer::GetStartPosition()
|
||||
{
|
||||
return start_frame;
|
||||
}
|
||||
|
||||
|
||||
__int64 AlsaPlayer::GetEndPosition()
|
||||
long long AlsaPlayer::GetEndPosition()
|
||||
{
|
||||
return end_frame;
|
||||
}
|
||||
|
@ -395,7 +395,7 @@ __int64 AlsaPlayer::GetEndPosition()
|
|||
|
||||
////////////////////////
|
||||
// Get current position
|
||||
__int64 AlsaPlayer::GetCurrentPosition()
|
||||
long long AlsaPlayer::GetCurrentPosition()
|
||||
{
|
||||
// FIXME: this should be based on not duration played but actual sample being heard
|
||||
// (during vidoeo playback, cur_frame might get changed to resync)
|
||||
|
|
|
@ -88,9 +88,9 @@ private:
|
|||
int offset;
|
||||
DWORD bufSize;
|
||||
|
||||
volatile __int64 playPos;
|
||||
__int64 startPos;
|
||||
volatile __int64 endPos;
|
||||
volatile long long playPos;
|
||||
long long startPos;
|
||||
volatile long long endPos;
|
||||
DWORD startTime;
|
||||
|
||||
IDirectSound8 *directSound;
|
||||
|
@ -107,15 +107,15 @@ public:
|
|||
void OpenStream();
|
||||
void CloseStream();
|
||||
|
||||
void Play(__int64 start,__int64 count);
|
||||
void Play(long long start,long long count);
|
||||
void Stop(bool timerToo=true);
|
||||
bool IsPlaying() { return playing; }
|
||||
|
||||
__int64 GetStartPosition() { return startPos; }
|
||||
__int64 GetEndPosition() { return endPos; }
|
||||
__int64 GetCurrentPosition();
|
||||
void SetEndPosition(__int64 pos);
|
||||
void SetCurrentPosition(__int64 pos);
|
||||
long long GetStartPosition() { return startPos; }
|
||||
long long GetEndPosition() { return endPos; }
|
||||
long long GetCurrentPosition();
|
||||
void SetEndPosition(long long pos);
|
||||
void SetCurrentPosition(long long pos);
|
||||
|
||||
void SetVolume(double vol) { volume = vol; }
|
||||
double GetVolume() { return volume; }
|
||||
|
@ -318,7 +318,7 @@ RetryLock:
|
|||
|
||||
////////
|
||||
// Play
|
||||
void DirectSoundPlayer::Play(__int64 start,__int64 count) {
|
||||
void DirectSoundPlayer::Play(long long start,long long count) {
|
||||
// Make sure that it's stopped
|
||||
Stop();
|
||||
// The thread is now guaranteed dead
|
||||
|
@ -389,14 +389,14 @@ void DirectSoundPlayer::Stop(bool timerToo) {
|
|||
|
||||
///////////
|
||||
// Set end
|
||||
void DirectSoundPlayer::SetEndPosition(__int64 pos) {
|
||||
void DirectSoundPlayer::SetEndPosition(long long pos) {
|
||||
if (playing) endPos = pos;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////
|
||||
// Set current position
|
||||
void DirectSoundPlayer::SetCurrentPosition(__int64 pos) {
|
||||
void DirectSoundPlayer::SetCurrentPosition(long long pos) {
|
||||
startPos = playPos = pos;
|
||||
startTime = GetTickCount();
|
||||
}
|
||||
|
@ -404,14 +404,14 @@ void DirectSoundPlayer::SetCurrentPosition(__int64 pos) {
|
|||
|
||||
////////////////////////
|
||||
// Get current position
|
||||
__int64 DirectSoundPlayer::GetCurrentPosition() {
|
||||
long long DirectSoundPlayer::GetCurrentPosition() {
|
||||
// Check if buffer is loaded
|
||||
if (!buffer || !playing) return 0;
|
||||
|
||||
// FIXME: this should be based on not duration played but actual sample being heard
|
||||
// (during vidoeo playback, cur_frame might get changed to resync)
|
||||
DWORD curtime = GetTickCount();
|
||||
__int64 tdiff = curtime - startTime;
|
||||
long long tdiff = curtime - startTime;
|
||||
return startPos + tdiff * provider->GetSampleRate() / 1000;
|
||||
}
|
||||
|
||||
|
|
|
@ -95,15 +95,15 @@ public:
|
|||
void OpenStream();
|
||||
void CloseStream();
|
||||
|
||||
void Play(__int64 start,__int64 count);
|
||||
void Play(long long start,long long count);
|
||||
void Stop(bool timerToo=true);
|
||||
bool IsPlaying();
|
||||
|
||||
__int64 GetStartPosition();
|
||||
__int64 GetEndPosition();
|
||||
__int64 GetCurrentPosition();
|
||||
void SetEndPosition(__int64 pos);
|
||||
void SetCurrentPosition(__int64 pos);
|
||||
long long GetStartPosition();
|
||||
long long GetEndPosition();
|
||||
long long GetCurrentPosition();
|
||||
void SetEndPosition(long long pos);
|
||||
void SetCurrentPosition(long long pos);
|
||||
|
||||
void SetVolume(double vol) { volume = vol; }
|
||||
double GetVolume() { return volume; }
|
||||
|
@ -217,7 +217,7 @@ void OpenALPlayer::CloseStream()
|
|||
|
||||
////////
|
||||
// Play
|
||||
void OpenALPlayer::Play(__int64 start,__int64 count)
|
||||
void OpenALPlayer::Play(long long start,long long count)
|
||||
{
|
||||
if (playing) {
|
||||
// Quick reset
|
||||
|
@ -354,7 +354,7 @@ bool OpenALPlayer::IsPlaying()
|
|||
|
||||
///////////
|
||||
// Set end
|
||||
void OpenALPlayer::SetEndPosition(__int64 pos)
|
||||
void OpenALPlayer::SetEndPosition(long long pos)
|
||||
{
|
||||
end_frame = pos;
|
||||
}
|
||||
|
@ -362,19 +362,19 @@ void OpenALPlayer::SetEndPosition(__int64 pos)
|
|||
|
||||
////////////////////////
|
||||
// Set current position
|
||||
void OpenALPlayer::SetCurrentPosition(__int64 pos)
|
||||
void OpenALPlayer::SetCurrentPosition(long long pos)
|
||||
{
|
||||
cur_frame = pos;
|
||||
}
|
||||
|
||||
|
||||
__int64 OpenALPlayer::GetStartPosition()
|
||||
long long OpenALPlayer::GetStartPosition()
|
||||
{
|
||||
return start_frame;
|
||||
}
|
||||
|
||||
|
||||
__int64 OpenALPlayer::GetEndPosition()
|
||||
long long OpenALPlayer::GetEndPosition()
|
||||
{
|
||||
return end_frame;
|
||||
}
|
||||
|
@ -382,7 +382,7 @@ __int64 OpenALPlayer::GetEndPosition()
|
|||
|
||||
////////////////////////
|
||||
// Get current position
|
||||
__int64 OpenALPlayer::GetCurrentPosition()
|
||||
long long OpenALPlayer::GetCurrentPosition()
|
||||
{
|
||||
// FIXME: this should be based on not duration played but actual sample being heard
|
||||
// (during vidoeo playback, cur_frame might get changed to resync)
|
||||
|
|
|
@ -67,12 +67,12 @@ private:
|
|||
bool playing;
|
||||
float volume;
|
||||
|
||||
volatile __int64 playPos;
|
||||
volatile __int64 startPos;
|
||||
volatile __int64 endPos;
|
||||
volatile long long playPos;
|
||||
volatile long long startPos;
|
||||
volatile long long endPos;
|
||||
void *stream;
|
||||
PaTimestamp paStart;
|
||||
volatile __int64 realPlayPos;
|
||||
volatile long long realPlayPos;
|
||||
|
||||
#ifndef HAVE_PA_GETSTREAMTIME
|
||||
static int paCallback(void *inputBuffer, void *outputBuffer, unsigned long framesPerBuffer, PaTimestamp outTime, void *userData);
|
||||
|
@ -90,15 +90,15 @@ public:
|
|||
void OpenStream();
|
||||
void CloseStream();
|
||||
|
||||
void Play(__int64 start,__int64 count);
|
||||
void Play(long long start,long long count);
|
||||
void Stop(bool timerToo=true);
|
||||
bool IsPlaying() { return playing; }
|
||||
|
||||
__int64 GetStartPosition() { return startPos; }
|
||||
__int64 GetEndPosition() { return endPos; }
|
||||
__int64 GetCurrentPosition() { return realPlayPos; }
|
||||
void SetEndPosition(__int64 pos) { endPos = pos; }
|
||||
void SetCurrentPosition(__int64 pos) { playPos = pos; realPlayPos = pos; }
|
||||
long long GetStartPosition() { return startPos; }
|
||||
long long GetEndPosition() { return endPos; }
|
||||
long long GetCurrentPosition() { return realPlayPos; }
|
||||
void SetEndPosition(long long pos) { endPos = pos; }
|
||||
void SetCurrentPosition(long long pos) { playPos = pos; realPlayPos = pos; }
|
||||
|
||||
void SetVolume(double vol) { volume = vol; }
|
||||
double GetVolume() { return volume; }
|
||||
|
@ -150,10 +150,6 @@ PortAudioPlayer::~PortAudioPlayer() {
|
|||
if (!--pa_refcount) Pa_Terminate();
|
||||
}
|
||||
|
||||
#ifdef __WINDOWS__
|
||||
typedef unsigned __int64 uint64_t;
|
||||
#endif
|
||||
|
||||
//////////////////////
|
||||
// PortAudio callback
|
||||
#ifndef HAVE_PA_GETSTREAMTIME
|
||||
|
@ -169,8 +165,8 @@ int PortAudioPlayer::paCallback(const void *inputBuffer, void *outputBuffer,
|
|||
int end = 0;
|
||||
|
||||
// Calculate how much left
|
||||
__int64 lenAvailable = player->endPos - player->playPos;
|
||||
uint64_t avail = 0;
|
||||
long long lenAvailable = player->endPos - player->playPos;
|
||||
unsigned long long avail = 0;
|
||||
if (lenAvailable > 0) {
|
||||
avail = lenAvailable;
|
||||
if (avail > framesPerBuffer) {
|
||||
|
@ -198,7 +194,7 @@ int PortAudioPlayer::paCallback(const void *inputBuffer, void *outputBuffer,
|
|||
// Set play position (and real one)
|
||||
player->playPos += framesPerBuffer;
|
||||
#ifndef __APPLE__
|
||||
player->realPlayPos = (__int64)(Pa_StreamTime(player->stream) - player->paStart) + player->startPos;
|
||||
player->realPlayPos = (long long)(Pa_StreamTime(player->stream) - player->paStart) + player->startPos;
|
||||
#else
|
||||
// AudioDeviceGetCurrentTime(), used by Pa_StreamTime() on OS X, is buggered, so use playPos for now
|
||||
player->realPlayPos = player->playPos;
|
||||
|
@ -211,7 +207,7 @@ int PortAudioPlayer::paCallback(const void *inputBuffer, void *outputBuffer,
|
|||
|
||||
////////
|
||||
// Play
|
||||
void PortAudioPlayer::Play(__int64 start,__int64 count) {
|
||||
void PortAudioPlayer::Play(long long start,long long count) {
|
||||
// Stop if it's already playing
|
||||
wxMutexLocker locker(PAMutex);
|
||||
|
||||
|
|
|
@ -100,15 +100,15 @@ public:
|
|||
void OpenStream();
|
||||
void CloseStream();
|
||||
|
||||
void Play(__int64 start,__int64 count);
|
||||
void Play(long long start,long long count);
|
||||
void Stop(bool timerToo=true);
|
||||
bool IsPlaying();
|
||||
|
||||
__int64 GetStartPosition();
|
||||
__int64 GetEndPosition();
|
||||
__int64 GetCurrentPosition();
|
||||
void SetEndPosition(__int64 pos);
|
||||
void SetCurrentPosition(__int64 pos);
|
||||
long long GetStartPosition();
|
||||
long long GetEndPosition();
|
||||
long long GetCurrentPosition();
|
||||
void SetEndPosition(long long pos);
|
||||
void SetCurrentPosition(long long pos);
|
||||
|
||||
void SetVolume(double vol) { volume = vol; }
|
||||
double GetVolume() { return volume; }
|
||||
|
@ -271,7 +271,7 @@ void PulseAudioPlayer::CloseStream()
|
|||
|
||||
////////
|
||||
// Play
|
||||
void PulseAudioPlayer::Play(__int64 start,__int64 count)
|
||||
void PulseAudioPlayer::Play(long long start,long long count)
|
||||
{
|
||||
//printf("Starting PulseAudio playback\n");
|
||||
if (!open) OpenStream();
|
||||
|
@ -365,7 +365,7 @@ bool PulseAudioPlayer::IsPlaying()
|
|||
|
||||
///////////
|
||||
// Set end
|
||||
void PulseAudioPlayer::SetEndPosition(__int64 pos)
|
||||
void PulseAudioPlayer::SetEndPosition(long long pos)
|
||||
{
|
||||
end_frame = pos;
|
||||
}
|
||||
|
@ -373,19 +373,19 @@ void PulseAudioPlayer::SetEndPosition(__int64 pos)
|
|||
|
||||
////////////////////////
|
||||
// Set current position
|
||||
void PulseAudioPlayer::SetCurrentPosition(__int64 pos)
|
||||
void PulseAudioPlayer::SetCurrentPosition(long long pos)
|
||||
{
|
||||
cur_frame = pos;
|
||||
}
|
||||
|
||||
|
||||
__int64 PulseAudioPlayer::GetStartPosition()
|
||||
long long PulseAudioPlayer::GetStartPosition()
|
||||
{
|
||||
return start_frame;
|
||||
}
|
||||
|
||||
|
||||
__int64 PulseAudioPlayer::GetEndPosition()
|
||||
long long PulseAudioPlayer::GetEndPosition()
|
||||
{
|
||||
return end_frame;
|
||||
}
|
||||
|
@ -393,7 +393,7 @@ __int64 PulseAudioPlayer::GetEndPosition()
|
|||
|
||||
////////////////////////
|
||||
// Get current position
|
||||
__int64 PulseAudioPlayer::GetCurrentPosition()
|
||||
long long PulseAudioPlayer::GetCurrentPosition()
|
||||
{
|
||||
if (!is_playing) return 0;
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@ int AudioProvider::GetChannels() {
|
|||
|
||||
//////////////////////////
|
||||
// Get number of samples
|
||||
__int64 AudioProvider::GetNumSamples() {
|
||||
long long AudioProvider::GetNumSamples() {
|
||||
return num_samples;
|
||||
}
|
||||
|
||||
|
@ -96,7 +96,7 @@ wxString AudioProvider::GetFilename() {
|
|||
|
||||
////////////////
|
||||
// Get waveform
|
||||
void AudioProvider::GetWaveForm(int *min,int *peak,__int64 start,int w,int h,int samples,float scale) {
|
||||
void AudioProvider::GetWaveForm(int *min,int *peak,long long start,int w,int h,int samples,float scale) {
|
||||
// Setup
|
||||
int channels = GetChannels();
|
||||
int n = w * samples;
|
||||
|
@ -161,7 +161,7 @@ void AudioProvider::GetWaveForm(int *min,int *peak,__int64 start,int w,int h,int
|
|||
|
||||
/////////////////////////
|
||||
// Get audio with volume
|
||||
void AudioProvider::GetAudioWithVolume(void *buf, __int64 start, __int64 count, double volume) {
|
||||
void AudioProvider::GetAudioWithVolume(void *buf, long long start, long long count, double volume) {
|
||||
GetAudio(buf,start,count);
|
||||
if (volume == 1.0) return;
|
||||
|
||||
|
@ -171,7 +171,7 @@ void AudioProvider::GetAudioWithVolume(void *buf, __int64 start, __int64 count,
|
|||
int value;
|
||||
|
||||
// Modify
|
||||
for (__int64 i=0;i<count;i++) {
|
||||
for (long long i=0;i<count;i++) {
|
||||
value = (int)(buffer[i]*volume+0.5);
|
||||
if (value < -0x8000) value = -0x8000;
|
||||
if (value > 0x7FFF) value = 0x7FFF;
|
||||
|
|
|
@ -58,7 +58,7 @@ private:
|
|||
|
||||
protected:
|
||||
int channels;
|
||||
__int64 num_samples; // for one channel, ie. number of PCM frames
|
||||
long long num_samples; // for one channel, ie. number of PCM frames
|
||||
int sample_rate;
|
||||
int bytes_per_sample;
|
||||
|
||||
|
@ -69,15 +69,15 @@ public:
|
|||
virtual ~AudioProvider();
|
||||
|
||||
virtual wxString GetFilename();
|
||||
virtual void GetAudio(void *buf, __int64 start, __int64 count)=0;
|
||||
void GetAudioWithVolume(void *buf, __int64 start, __int64 count, double volume);
|
||||
virtual void GetAudio(void *buf, long long start, long long count)=0;
|
||||
void GetAudioWithVolume(void *buf, long long start, long long count, double volume);
|
||||
|
||||
__int64 GetNumSamples();
|
||||
long long GetNumSamples();
|
||||
int GetSampleRate();
|
||||
int GetBytesPerSample();
|
||||
int GetChannels();
|
||||
|
||||
void GetWaveForm(int *min,int *peak,__int64 start,int w,int h,int samples,float scale);
|
||||
void GetWaveForm(int *min,int *peak,long long start,int w,int h,int samples,float scale);
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -66,8 +66,8 @@ public:
|
|||
|
||||
wxString GetFilename();
|
||||
|
||||
void GetAudio(void *buf, __int64 start, __int64 count);
|
||||
void GetWaveForm(int *min,int *peak,__int64 start,int w,int h,int samples,float scale);
|
||||
void GetAudio(void *buf, long long start, long long count);
|
||||
void GetWaveForm(int *min,int *peak,long long start,int w,int h,int samples,float scale);
|
||||
};
|
||||
|
||||
|
||||
|
@ -206,10 +206,10 @@ wxString AvisynthAudioProvider::GetFilename() {
|
|||
|
||||
/////////////
|
||||
// Get audio
|
||||
void AvisynthAudioProvider::GetAudio(void *buf, __int64 start, __int64 count) {
|
||||
void AvisynthAudioProvider::GetAudio(void *buf, long long start, long long count) {
|
||||
// Requested beyond the length of audio
|
||||
if (start+count > num_samples) {
|
||||
__int64 oldcount = count;
|
||||
long long oldcount = count;
|
||||
count = num_samples-start;
|
||||
if (count < 0) count = 0;
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ DummyAudioProvider::DummyAudioProvider(unsigned long dur_ms, bool _noise) {
|
|||
channels = 1;
|
||||
sample_rate = 44100;
|
||||
bytes_per_sample = 2;
|
||||
num_samples = (__int64)dur_ms * sample_rate / 1000;
|
||||
num_samples = (long long)dur_ms * sample_rate / 1000;
|
||||
}
|
||||
|
||||
|
||||
|
@ -59,7 +59,7 @@ DummyAudioProvider::~DummyAudioProvider() {
|
|||
|
||||
/////////////
|
||||
// Get audio
|
||||
void DummyAudioProvider::GetAudio(void *buf, __int64 start, __int64 count) {
|
||||
void DummyAudioProvider::GetAudio(void *buf, long long start, long long count) {
|
||||
short *workbuf = (short*)buf;
|
||||
|
||||
if (noise) {
|
||||
|
|
|
@ -52,5 +52,5 @@ public:
|
|||
DummyAudioProvider(unsigned long dur_ms, bool _noise);
|
||||
~DummyAudioProvider();
|
||||
|
||||
void GetAudio(void *buf, __int64 start, __int64 count);
|
||||
void GetAudio(void *buf, long long start, long long count);
|
||||
};
|
||||
|
|
|
@ -78,7 +78,7 @@ HDAudioProvider::HDAudioProvider(AudioProvider *source) {
|
|||
// Write to disk
|
||||
int block = 4096;
|
||||
char *temp = new char[block * channels * bytes_per_sample];
|
||||
for (__int64 i=0;i<num_samples && !canceled; i+=block) {
|
||||
for (long long i=0;i<num_samples && !canceled; i+=block) {
|
||||
if (block+i > num_samples) block = num_samples - i;
|
||||
source->GetAudio(temp,i,block);
|
||||
file_cache.Write(temp,block * channels * bytes_per_sample);
|
||||
|
@ -107,10 +107,10 @@ HDAudioProvider::~HDAudioProvider() {
|
|||
|
||||
/////////////
|
||||
// Get audio
|
||||
void HDAudioProvider::GetAudio(void *buf, __int64 start, __int64 count) {
|
||||
void HDAudioProvider::GetAudio(void *buf, long long start, long long count) {
|
||||
// Requested beyond the length of audio
|
||||
if (start+count > num_samples) {
|
||||
__int64 oldcount = count;
|
||||
long long oldcount = count;
|
||||
count = num_samples-start;
|
||||
if (count < 0) count = 0;
|
||||
|
||||
|
|
|
@ -58,5 +58,5 @@ public:
|
|||
HDAudioProvider(AudioProvider *source);
|
||||
~HDAudioProvider();
|
||||
|
||||
void GetAudio(void *buf, __int64 start, __int64 count);
|
||||
void GetAudio(void *buf, long long start, long long count);
|
||||
};
|
||||
|
|
|
@ -80,7 +80,7 @@ private:
|
|||
public:
|
||||
LAVCAudioProvider(wxString _filename);
|
||||
virtual ~LAVCAudioProvider();
|
||||
virtual void GetAudio(void *buf, __int64 start, __int64 count);
|
||||
virtual void GetAudio(void *buf, long long start, long long count);
|
||||
};
|
||||
|
||||
|
||||
|
@ -151,7 +151,7 @@ LAVCAudioProvider::LAVCAudioProvider(wxString _filename)
|
|||
resample_ratio = (float)sample_rate / (float)codecContext->sample_rate;
|
||||
|
||||
double length = (double)stream->duration * av_q2d(stream->time_base);
|
||||
num_samples = (__int64)(length * sample_rate);
|
||||
num_samples = (long long)(length * sample_rate);
|
||||
|
||||
buffer = (int16_t *)malloc(AVCODEC_MAX_AUDIO_FRAME_SIZE);
|
||||
if (!buffer)
|
||||
|
@ -181,10 +181,10 @@ void LAVCAudioProvider::Destroy()
|
|||
lavcfile->Release();
|
||||
}
|
||||
|
||||
void LAVCAudioProvider::GetAudio(void *buf, __int64 start, __int64 count)
|
||||
void LAVCAudioProvider::GetAudio(void *buf, long long start, long long count)
|
||||
{
|
||||
int16_t *_buf = (int16_t *)buf;
|
||||
__int64 _count = num_samples - start;
|
||||
long long _count = num_samples - start;
|
||||
if (count < _count)
|
||||
_count = count;
|
||||
if (_count < 0)
|
||||
|
@ -203,8 +203,8 @@ void LAVCAudioProvider::GetAudio(void *buf, __int64 start, __int64 count)
|
|||
|
||||
samples = bytesout >> 1;
|
||||
if (rsct) {
|
||||
if ((__int64)(samples * resample_ratio / codecContext->channels) > _count)
|
||||
samples = (__int64)(_count / resample_ratio * codecContext->channels);
|
||||
if ((long long)(samples * resample_ratio / codecContext->channels) > _count)
|
||||
samples = (long long)(_count / resample_ratio * codecContext->channels);
|
||||
samples = audio_resample(rsct, _buf, buffer, samples / codecContext->channels);
|
||||
|
||||
assert(samples <= _count);
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
#include <stdint.h>
|
||||
|
||||
|
||||
void PCMAudioProvider::GetAudio(void *buf, __int64 start, __int64 count)
|
||||
void PCMAudioProvider::GetAudio(void *buf, long long start, long long count)
|
||||
{
|
||||
// We'll be seeking in the file so state can become inconsistent
|
||||
wxMutexLocker _fml(filemutex);
|
||||
|
@ -217,7 +217,7 @@ public:
|
|||
delete provider;
|
||||
}
|
||||
|
||||
void GetAudio(void *buf, __int64 start, __int64 count)
|
||||
void GetAudio(void *buf, long long start, long long count)
|
||||
{
|
||||
if (count == 0) return;
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ protected:
|
|||
IndexVector index_points;
|
||||
|
||||
public:
|
||||
virtual void GetAudio(void *buf, __int64 start, __int64 count);
|
||||
virtual void GetAudio(void *buf, long long start, long long count);
|
||||
};
|
||||
|
||||
// Construct the right PCM audio provider (if any) for the file
|
||||
|
|
|
@ -55,7 +55,7 @@ RAMAudioProvider::RAMAudioProvider(AudioProvider *source) {
|
|||
blockcount = 0;
|
||||
|
||||
// Allocate cache
|
||||
__int64 ssize = source->GetNumSamples() * source->GetBytesPerSample();
|
||||
long long ssize = source->GetNumSamples() * source->GetBytesPerSample();
|
||||
blockcount = (ssize + CacheBlockSize - 1) >> CacheBits;
|
||||
blockcache = new char*[blockcount];
|
||||
for (int i = 0; i < blockcount; i++) {
|
||||
|
@ -124,10 +124,10 @@ void RAMAudioProvider::Clear() {
|
|||
|
||||
/////////////
|
||||
// Get audio
|
||||
void RAMAudioProvider::GetAudio(void *buf, __int64 start, __int64 count) {
|
||||
void RAMAudioProvider::GetAudio(void *buf, long long start, long long count) {
|
||||
// Requested beyond the length of audio
|
||||
if (start+count > num_samples) {
|
||||
__int64 oldcount = count;
|
||||
long long oldcount = count;
|
||||
count = num_samples-start;
|
||||
if (count < 0) count = 0;
|
||||
|
||||
|
@ -151,7 +151,7 @@ void RAMAudioProvider::GetAudio(void *buf, __int64 start, __int64 count) {
|
|||
char *charbuf = (char *)buf;
|
||||
int i = (start*bytes_per_sample) >> CacheBits;
|
||||
int start_offset = (start*bytes_per_sample) & (CacheBlockSize-1);
|
||||
__int64 bytesremaining = count*bytes_per_sample;
|
||||
long long bytesremaining = count*bytes_per_sample;
|
||||
|
||||
// Copy
|
||||
while (bytesremaining) {
|
||||
|
|
|
@ -55,5 +55,5 @@ public:
|
|||
RAMAudioProvider(AudioProvider *source);
|
||||
~RAMAudioProvider();
|
||||
|
||||
void GetAudio(void *buf, __int64 start, __int64 count);
|
||||
void GetAudio(void *buf, long long start, long long count);
|
||||
};
|
||||
|
|
|
@ -67,9 +67,9 @@ StreamAudioProvider::~StreamAudioProvider() {
|
|||
|
||||
/////////////
|
||||
// Get audio
|
||||
void StreamAudioProvider::GetAudio(void *buf, __int64 start, __int64 count) {
|
||||
void StreamAudioProvider::GetAudio(void *buf, long long start, long long count) {
|
||||
// Write
|
||||
__int64 left = count;
|
||||
long long left = count;
|
||||
int written = 0;
|
||||
int toWrite;
|
||||
short *dst = (short*) buf;
|
||||
|
@ -101,7 +101,7 @@ void StreamAudioProvider::GetAudio(void *buf, __int64 start, __int64 count) {
|
|||
// Still left, fill with zero
|
||||
if (left > 0) {
|
||||
hasBuf = false;
|
||||
for (__int64 i=written;i<count;i++) {
|
||||
for (long long i=written;i<count;i++) {
|
||||
dst[i] = 0;
|
||||
}
|
||||
}
|
||||
|
@ -110,9 +110,9 @@ void StreamAudioProvider::GetAudio(void *buf, __int64 start, __int64 count) {
|
|||
|
||||
//////////////////////////
|
||||
// Append audio to stream
|
||||
void StreamAudioProvider::Append(void *voidptr, __int64 count) {
|
||||
void StreamAudioProvider::Append(void *voidptr, long long count) {
|
||||
// Read
|
||||
__int64 left = count;
|
||||
long long left = count;
|
||||
int read = 0;
|
||||
int toRead;
|
||||
short *src = (short*) voidptr;
|
||||
|
|
|
@ -68,7 +68,7 @@ public:
|
|||
StreamAudioProvider();
|
||||
~StreamAudioProvider();
|
||||
|
||||
void GetAudio(void *buf, __int64 start, __int64 count);
|
||||
void Append(void *buf, __int64 count);
|
||||
void GetAudio(void *buf, long long start, long long count);
|
||||
void Append(void *buf, long long count);
|
||||
void SetParams(int channels,int rate,int bps);
|
||||
};
|
||||
|
|
|
@ -167,7 +167,7 @@ public:
|
|||
// line_length is half of the number of samples used to calculate a line, since half of the output from
|
||||
// a Fourier transform of real data is redundant, and not interesting for the purpose of creating
|
||||
// a frequenmcy/power spectrum.
|
||||
__int64 sample = start * line_length*2 + overlap*overlap_offset;
|
||||
long long sample = start * line_length*2 + overlap*overlap_offset;
|
||||
|
||||
for (unsigned long i = 0; i < length; ++i) {
|
||||
provider->GetAudio(raw_sample_data, sample, line_length*2);
|
||||
|
@ -405,7 +405,7 @@ AudioSpectrum::AudioSpectrum(AudioProvider *_provider)
|
|||
else
|
||||
fft_overlaps = 1 << quality_index;
|
||||
|
||||
__int64 _num_lines = provider->GetNumSamples() / line_length / 2;
|
||||
long long _num_lines = provider->GetNumSamples() / line_length / 2;
|
||||
//assert (_num_lines < (1<<31)); // hope it fits into 32 bits...
|
||||
num_lines = (unsigned long)_num_lines;
|
||||
|
||||
|
@ -438,7 +438,7 @@ AudioSpectrum::~AudioSpectrum()
|
|||
}
|
||||
|
||||
|
||||
void AudioSpectrum::RenderRange(__int64 range_start, __int64 range_end, bool selected, unsigned char *img, int imgleft, int imgwidth, int imgpitch, int imgheight)
|
||||
void AudioSpectrum::RenderRange(long long range_start, long long range_end, bool selected, unsigned char *img, int imgleft, int imgwidth, int imgpitch, int imgheight)
|
||||
{
|
||||
unsigned long first_line = (unsigned long)(fft_overlaps * range_start / line_length / 2);
|
||||
unsigned long last_line = (unsigned long)(fft_overlaps * range_end / line_length / 2);
|
||||
|
|
|
@ -67,7 +67,7 @@ public:
|
|||
AudioSpectrum(AudioProvider *_provider);
|
||||
~AudioSpectrum();
|
||||
|
||||
void RenderRange(__int64 range_start, __int64 range_end, bool selected, unsigned char *img, int imgleft, int imgwidth, int imgpitch, int imgheight);
|
||||
void RenderRange(long long range_start, long long range_end, bool selected, unsigned char *img, int imgleft, int imgwidth, int imgpitch, int imgheight);
|
||||
|
||||
void SetScaling(float _power_scale);
|
||||
};
|
||||
|
|
|
@ -157,7 +157,7 @@ void MatroskaWrapper::Parse() {
|
|||
//CompressedStream *cs = NULL;
|
||||
|
||||
// Timecode scale
|
||||
__int64 timecodeScale = mkv_TruncFloat(trackInfo->TimecodeScale) * segInfo->TimecodeScale;
|
||||
longlong timecodeScale = mkv_TruncFloat(trackInfo->TimecodeScale) * segInfo->TimecodeScale;
|
||||
|
||||
// Mask other tracks away
|
||||
mkv_SetTrackMask(file, ~(1 << track));
|
||||
|
@ -376,7 +376,7 @@ void MatroskaWrapper::GetSubtitles(AssFile *target) {
|
|||
|
||||
// Read timecode scale
|
||||
SegmentInfo *segInfo = mkv_GetFileInfo(file);
|
||||
__int64 timecodeScale = mkv_TruncFloat(trackInfo->TimecodeScale) * segInfo->TimecodeScale;
|
||||
longlong timecodeScale = mkv_TruncFloat(trackInfo->TimecodeScale) * segInfo->TimecodeScale;
|
||||
|
||||
// Prepare STD vector to get lines inserted
|
||||
std::vector<wxString> subList;
|
||||
|
@ -407,8 +407,8 @@ void MatroskaWrapper::GetSubtitles(AssFile *target) {
|
|||
wxString blockString(tmp,wxConvUTF8);
|
||||
|
||||
// Get start and end times
|
||||
//__int64 timecodeScaleLow = timecodeScale / 100;
|
||||
__int64 timecodeScaleLow = 1000000;
|
||||
//longlong timecodeScaleLow = timecodeScale / 100;
|
||||
longlong timecodeScaleLow = 1000000;
|
||||
AssTime subStart,subEnd;
|
||||
subStart.SetMS(startTime / timecodeScaleLow);
|
||||
subEnd.SetMS(endTime / timecodeScaleLow);
|
||||
|
|
|
@ -68,14 +68,14 @@ class MkvFrame {
|
|||
public:
|
||||
double time;
|
||||
bool isKey;
|
||||
__int64 filePos;
|
||||
long long filePos;
|
||||
|
||||
MkvFrame() {
|
||||
time = 0;
|
||||
isKey = false;
|
||||
filePos = -1;
|
||||
}
|
||||
MkvFrame(bool keyframe,double timecode,__int64 _filePos) {
|
||||
MkvFrame(bool keyframe,double timecode,long long _filePos) {
|
||||
isKey = keyframe;
|
||||
time = timecode;
|
||||
filePos = _filePos;
|
||||
|
|
|
@ -18,8 +18,10 @@
|
|||
|
||||
#include <stdwx.h>
|
||||
|
||||
typedef int64_t __int64;
|
||||
typedef uint64_t __uint64;
|
||||
// These shouldn't be needed any longer, if there are
|
||||
// any occurrences of __int64 replace them with long long.
|
||||
//typedef int64_t __int64;
|
||||
//typedef uint64_t __uint64;
|
||||
#define abs64 llabs
|
||||
|
||||
#include "res.h"
|
||||
|
|
|
@ -651,7 +651,7 @@ void SubtitlesGrid::OnRecombine(wxCommandEvent &event) {
|
|||
//////////////
|
||||
// Export audio clip of line
|
||||
void SubtitlesGrid::OnAudioClip(wxCommandEvent &event) {
|
||||
__int64 num_samples,start=0,end=0,temp;
|
||||
long long num_samples,start=0,end=0,temp;
|
||||
AudioDisplay *audioDisplay = parentFrame->audioBox->audioDisplay;
|
||||
AudioProvider *provider = audioDisplay->provider;
|
||||
AssDialogue *cur;
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
#ifndef __LINUX__
|
||||
//////////////////////////
|
||||
// Absolute of 64 bit int
|
||||
__int64 abs64(__int64 input) {
|
||||
long long abs64(long long input) {
|
||||
if (input < 0) return -input;
|
||||
return input;
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@ typedef std::vector<std::pair<int,int> > IntPairVector;
|
|||
///////////////////////
|
||||
// Function prototypes
|
||||
#ifndef __LINUX__
|
||||
__int64 abs64(__int64 input);
|
||||
long long abs64(long long input);
|
||||
#endif
|
||||
int CountMatches(wxString parent,wxString child);
|
||||
bool CopyFile(wxString src,wxString dst);
|
||||
|
|
|
@ -742,8 +742,8 @@ void VideoContext::OnPlayTimer(wxTimerEvent &event) {
|
|||
|
||||
// Sync audio
|
||||
if (keepAudioSync && nextFrame % 10 == 0 && audio && audio->provider && audio->player) {
|
||||
__int64 audPos = audio->GetSampleAtMS(VFR_Output.GetTimeAtFrame(nextFrame));
|
||||
__int64 curPos = audio->player->GetCurrentPosition();
|
||||
long long audPos = audio->GetSampleAtMS(VFR_Output.GetTimeAtFrame(nextFrame));
|
||||
long long curPos = audio->player->GetCurrentPosition();
|
||||
int delta = int(audPos-curPos);
|
||||
if (delta < 0) delta = -delta;
|
||||
int maxDelta = audio->provider->GetSampleRate();
|
||||
|
|
|
@ -84,7 +84,7 @@ private:
|
|||
wxArrayInt bytePos;
|
||||
|
||||
bool isMkv;
|
||||
__int64 lastDecodeTime;
|
||||
long long lastDecodeTime;
|
||||
int frameNumber;
|
||||
int length;
|
||||
AegiVideoFrame curFrame;
|
||||
|
@ -375,16 +375,16 @@ const AegiVideoFrame LAVCVideoProvider::DoGetFrame(int n) {
|
|||
// Needs to seek
|
||||
else {
|
||||
// Prepare seek
|
||||
__int64 seekTo;
|
||||
long long seekTo;
|
||||
int result = 0;
|
||||
|
||||
#if 0
|
||||
// Get time to seek to
|
||||
if (isMkv) {
|
||||
//__int64 base = AV_TIME_BASE;
|
||||
//__int64 time = VFR_Output.GetTimeAtFrame(n,true) * base / 1000000;
|
||||
//seekTo = av_rescale(time,stream->time_base.den,AV_TIME_BASE * __int64(stream->time_base.num));
|
||||
//seekTo = __int64(n) * 1000 * stream->r_frame_rate.den / stream->r_frame_rate.num;
|
||||
//long long base = AV_TIME_BASE;
|
||||
//long long time = VFR_Output.GetTimeAtFrame(n,true) * base / 1000000;
|
||||
//seekTo = av_rescale(time,stream->time_base.den,AV_TIME_BASE * long long(stream->time_base.num));
|
||||
//seekTo = long long(n) * 1000 * stream->r_frame_rate.den / stream->r_frame_rate.num;
|
||||
//seekTo = bytePos[n];
|
||||
|
||||
//result = av_seek_frame(formatContext,vidStream,seekTo,AVSEEK_FLAG_BACKWARD | AVSEEK_FLAG_BYTE);
|
||||
|
@ -392,8 +392,8 @@ const AegiVideoFrame LAVCVideoProvider::DoGetFrame(int n) {
|
|||
// Prepare mkv seek
|
||||
ulonglong startTime, endTime, filePos;
|
||||
unsigned int rt, frameSize, frameFlags;
|
||||
ulonglong targetTime = __int64(VFR_Output.GetTimeAtFrame(n,true,true))*1000000;
|
||||
//ulonglong targetTime = __int64(n) * 1000 * stream->r_frame_rate.den / stream->r_frame_rate.num;
|
||||
ulonglong targetTime = (long long)(VFR_Output.GetTimeAtFrame(n,true,true))*1000000;
|
||||
//ulonglong targetTime = (long long)(n) * 1000 * stream->r_frame_rate.den / stream->r_frame_rate.num;
|
||||
//ulonglong targetTime = mkv.rawFrames[n].time * 1000000;
|
||||
mkv_Seek(mkv.file,targetTime,MKVF_SEEK_TO_PREV_KEYFRAME);
|
||||
|
||||
|
|
|
@ -101,7 +101,7 @@ int VideoSlider::GetValueAtX(int x) {
|
|||
if (w <= 10) return 0;
|
||||
|
||||
// Calculate
|
||||
return __int64(x-5)*__int64(max-min)/__int64(w-10)+min;
|
||||
return (long long)(x-5)*(long long)(max-min)/(long long)(w-10)+min;
|
||||
}
|
||||
|
||||
|
||||
|
@ -116,7 +116,7 @@ int VideoSlider::GetXAtValue(int value) {
|
|||
if (max-min <= 0) return 0;
|
||||
|
||||
// Calculate
|
||||
return __int64(value-min)*__int64(w-10)/__int64(max-min)+5;
|
||||
return (long long)(value-min)*(long long)(w-10)/(long long)(max-min)+5;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue