From 8909ea48e20ad8aa30ccc358cd563c66ed708d52 Mon Sep 17 00:00:00 2001 From: Niels Martin Hansen Date: Wed, 29 Aug 2007 13:36:30 +0000 Subject: [PATCH] Replace all (applicable) instances of __int64 with long long. (All except those in foreign header files.) Originally committed to SVN as r1540. --- aegisub/audio_display.cpp | 58 +++++++++++++++--------------- aegisub/audio_display.h | 34 +++++++++--------- aegisub/audio_player.h | 12 +++---- aegisub/audio_player_alsa.cpp | 24 ++++++------- aegisub/audio_player_dsound.cpp | 28 +++++++-------- aegisub/audio_player_openal.cpp | 24 ++++++------- aegisub/audio_player_portaudio.cpp | 32 ++++++++--------- aegisub/audio_player_pulse.cpp | 24 ++++++------- aegisub/audio_provider.cpp | 8 ++--- aegisub/audio_provider.h | 10 +++--- aegisub/audio_provider_avs.cpp | 8 ++--- aegisub/audio_provider_dummy.cpp | 4 +-- aegisub/audio_provider_dummy.h | 2 +- aegisub/audio_provider_hd.cpp | 6 ++-- aegisub/audio_provider_hd.h | 2 +- aegisub/audio_provider_lavc.cpp | 12 +++---- aegisub/audio_provider_pcm.cpp | 4 +-- aegisub/audio_provider_pcm.h | 2 +- aegisub/audio_provider_ram.cpp | 8 ++--- aegisub/audio_provider_ram.h | 2 +- aegisub/audio_provider_stream.cpp | 10 +++--- aegisub/audio_provider_stream.h | 4 +-- aegisub/audio_spectrum.cpp | 6 ++-- aegisub/audio_spectrum.h | 2 +- aegisub/mkv_wrap.cpp | 8 ++--- aegisub/mkv_wrap.h | 4 +-- aegisub/posix/defines.h | 6 ++-- aegisub/subs_grid.cpp | 2 +- aegisub/utils.cpp | 2 +- aegisub/utils.h | 2 +- aegisub/video_context.cpp | 4 +-- aegisub/video_provider_lavc.cpp | 16 ++++----- aegisub/video_slider.cpp | 4 +-- 33 files changed, 186 insertions(+), 188 deletions(-) diff --git a/aegisub/audio_display.cpp b/aegisub/audio_display.cpp index 3fb7e073e..a19366cf6 100644 --- a/aegisub/audio_display.cpp +++ b/aegisub/audio_display.cpp @@ -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;xenabled) dc.SetPen(wxPen(Options.AsColour(_T("Audio Waveform Modified")))); else dc.SetPen(wxPen(Options.AsColour(_T("Audio Waveform Selected")))); } - for (__int64 i=selStartCap;isyllables.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;iGetSampleRate(); + 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 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); diff --git a/aegisub/audio_display.h b/aegisub/audio_display.h index 99d5e093b..d29c5b949 100644 --- a/aegisub/audio_display.h +++ b/aegisub/audio_display.h @@ -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); diff --git a/aegisub/audio_player.h b/aegisub/audio_player.h index 4e2ce13d9..00a2af597 100644 --- a/aegisub/audio_player.h +++ b/aegisub/audio_player.h @@ -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(); diff --git a/aegisub/audio_player_alsa.cpp b/aegisub/audio_player_alsa.cpp index 928fdd1cd..f8e264eb5 100644 --- a/aegisub/audio_player_alsa.cpp +++ b/aegisub/audio_player_alsa.cpp @@ -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) diff --git a/aegisub/audio_player_dsound.cpp b/aegisub/audio_player_dsound.cpp index 16efe7c64..1f3641ce1 100644 --- a/aegisub/audio_player_dsound.cpp +++ b/aegisub/audio_player_dsound.cpp @@ -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; } diff --git a/aegisub/audio_player_openal.cpp b/aegisub/audio_player_openal.cpp index 574d02cce..359b454e1 100644 --- a/aegisub/audio_player_openal.cpp +++ b/aegisub/audio_player_openal.cpp @@ -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) diff --git a/aegisub/audio_player_portaudio.cpp b/aegisub/audio_player_portaudio.cpp index 3d9755f99..e0000951c 100644 --- a/aegisub/audio_player_portaudio.cpp +++ b/aegisub/audio_player_portaudio.cpp @@ -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); diff --git a/aegisub/audio_player_pulse.cpp b/aegisub/audio_player_pulse.cpp index 1d269f159..9fe8611db 100644 --- a/aegisub/audio_player_pulse.cpp +++ b/aegisub/audio_player_pulse.cpp @@ -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; diff --git a/aegisub/audio_provider.cpp b/aegisub/audio_provider.cpp index 286b3c81d..0e66d845c 100644 --- a/aegisub/audio_provider.cpp +++ b/aegisub/audio_provider.cpp @@ -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 0x7FFF) value = 0x7FFF; diff --git a/aegisub/audio_provider.h b/aegisub/audio_provider.h index 1442a69c4..e4157b5c2 100644 --- a/aegisub/audio_provider.h +++ b/aegisub/audio_provider.h @@ -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); }; diff --git a/aegisub/audio_provider_avs.cpp b/aegisub/audio_provider_avs.cpp index 09c5b0136..c05846c44 100644 --- a/aegisub/audio_provider_avs.cpp +++ b/aegisub/audio_provider_avs.cpp @@ -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; diff --git a/aegisub/audio_provider_dummy.cpp b/aegisub/audio_provider_dummy.cpp index 40384b068..e4db7b20b 100644 --- a/aegisub/audio_provider_dummy.cpp +++ b/aegisub/audio_provider_dummy.cpp @@ -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) { diff --git a/aegisub/audio_provider_dummy.h b/aegisub/audio_provider_dummy.h index 4a977861d..779b2f012 100644 --- a/aegisub/audio_provider_dummy.h +++ b/aegisub/audio_provider_dummy.h @@ -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); }; diff --git a/aegisub/audio_provider_hd.cpp b/aegisub/audio_provider_hd.cpp index d4ccf7bd2..0546b36fa 100644 --- a/aegisub/audio_provider_hd.cpp +++ b/aegisub/audio_provider_hd.cpp @@ -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) 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; diff --git a/aegisub/audio_provider_hd.h b/aegisub/audio_provider_hd.h index 677ac5bae..dff356456 100644 --- a/aegisub/audio_provider_hd.h +++ b/aegisub/audio_provider_hd.h @@ -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); }; diff --git a/aegisub/audio_provider_lavc.cpp b/aegisub/audio_provider_lavc.cpp index 6ee132f26..4e608cbd5 100644 --- a/aegisub/audio_provider_lavc.cpp +++ b/aegisub/audio_provider_lavc.cpp @@ -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); diff --git a/aegisub/audio_provider_pcm.cpp b/aegisub/audio_provider_pcm.cpp index fb28e7233..1a1066c0b 100644 --- a/aegisub/audio_provider_pcm.cpp +++ b/aegisub/audio_provider_pcm.cpp @@ -41,7 +41,7 @@ #include -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; diff --git a/aegisub/audio_provider_pcm.h b/aegisub/audio_provider_pcm.h index 8da5a0997..d6a668c0f 100644 --- a/aegisub/audio_provider_pcm.h +++ b/aegisub/audio_provider_pcm.h @@ -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 diff --git a/aegisub/audio_provider_ram.cpp b/aegisub/audio_provider_ram.cpp index 68f1763cb..3aef69295 100644 --- a/aegisub/audio_provider_ram.cpp +++ b/aegisub/audio_provider_ram.cpp @@ -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) { diff --git a/aegisub/audio_provider_ram.h b/aegisub/audio_provider_ram.h index fe3feaba6..5d58efd21 100644 --- a/aegisub/audio_provider_ram.h +++ b/aegisub/audio_provider_ram.h @@ -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); }; diff --git a/aegisub/audio_provider_stream.cpp b/aegisub/audio_provider_stream.cpp index 8e79cec92..5a7ec555b 100644 --- a/aegisub/audio_provider_stream.cpp +++ b/aegisub/audio_provider_stream.cpp @@ -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;iGetAudio(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); diff --git a/aegisub/audio_spectrum.h b/aegisub/audio_spectrum.h index 6c4197344..e3975b454 100644 --- a/aegisub/audio_spectrum.h +++ b/aegisub/audio_spectrum.h @@ -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); }; diff --git a/aegisub/mkv_wrap.cpp b/aegisub/mkv_wrap.cpp index ed0b4f86b..bbe00f7a1 100644 --- a/aegisub/mkv_wrap.cpp +++ b/aegisub/mkv_wrap.cpp @@ -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 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); diff --git a/aegisub/mkv_wrap.h b/aegisub/mkv_wrap.h index ed22d7b7d..c6633ecd4 100644 --- a/aegisub/mkv_wrap.h +++ b/aegisub/mkv_wrap.h @@ -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; diff --git a/aegisub/posix/defines.h b/aegisub/posix/defines.h index 1be3c0eaa..69a55ff24 100644 --- a/aegisub/posix/defines.h +++ b/aegisub/posix/defines.h @@ -18,8 +18,10 @@ #include -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" diff --git a/aegisub/subs_grid.cpp b/aegisub/subs_grid.cpp index 590ec3ffa..39dae6e6d 100644 --- a/aegisub/subs_grid.cpp +++ b/aegisub/subs_grid.cpp @@ -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; diff --git a/aegisub/utils.cpp b/aegisub/utils.cpp index 255a20d89..92befbdf6 100644 --- a/aegisub/utils.cpp +++ b/aegisub/utils.cpp @@ -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; } diff --git a/aegisub/utils.h b/aegisub/utils.h index 4b464cf2b..ff96a6664 100644 --- a/aegisub/utils.h +++ b/aegisub/utils.h @@ -51,7 +51,7 @@ typedef std::vector > 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); diff --git a/aegisub/video_context.cpp b/aegisub/video_context.cpp index bf63fd5ce..d843cc0e7 100644 --- a/aegisub/video_context.cpp +++ b/aegisub/video_context.cpp @@ -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(); diff --git a/aegisub/video_provider_lavc.cpp b/aegisub/video_provider_lavc.cpp index 8c0bda704..3619d7efa 100644 --- a/aegisub/video_provider_lavc.cpp +++ b/aegisub/video_provider_lavc.cpp @@ -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); diff --git a/aegisub/video_slider.cpp b/aegisub/video_slider.cpp index 8bc8387cb..83bc59f12 100644 --- a/aegisub/video_slider.cpp +++ b/aegisub/video_slider.cpp @@ -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; }