[haiku-commits] r37009 - haiku/trunk/src/apps/soundrecorder

  • From: korli@xxxxxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Fri, 4 Jun 2010 22:21:15 +0200 (CEST)

Author: korli
Date: 2010-06-04 22:21:15 +0200 (Fri, 04 Jun 2010)
New Revision: 37009
Changeset: http://dev.haiku-os.org/changeset/37009/haiku
Ticket: http://dev.haiku-os.org/ticket/6107

Modified:
   haiku/trunk/src/apps/soundrecorder/DrawButton.cpp
   haiku/trunk/src/apps/soundrecorder/DrawingTidbits.cpp
   haiku/trunk/src/apps/soundrecorder/FileUtils.cpp
   haiku/trunk/src/apps/soundrecorder/Jamfile
   haiku/trunk/src/apps/soundrecorder/RecorderWindow.cpp
   haiku/trunk/src/apps/soundrecorder/RecorderWindow.h
   haiku/trunk/src/apps/soundrecorder/ScopeView.cpp
   haiku/trunk/src/apps/soundrecorder/SoundConsumer.cpp
   haiku/trunk/src/apps/soundrecorder/SoundListView.cpp
   haiku/trunk/src/apps/soundrecorder/SoundUtils.cpp
   haiku/trunk/src/apps/soundrecorder/TrackSlider.cpp
   haiku/trunk/src/apps/soundrecorder/TransportButton.cpp
   haiku/trunk/src/apps/soundrecorder/UpDownButton.cpp
   haiku/trunk/src/apps/soundrecorder/VUView.cpp
   haiku/trunk/src/apps/soundrecorder/VolumeSlider.cpp
Log:
Patch from Karvjorm (ticket #6107): Localization for SoundRecorder.


Modified: haiku/trunk/src/apps/soundrecorder/DrawButton.cpp
===================================================================
--- haiku/trunk/src/apps/soundrecorder/DrawButton.cpp   2010-06-04 19:59:33 UTC 
(rev 37008)
+++ haiku/trunk/src/apps/soundrecorder/DrawButton.cpp   2010-06-04 20:21:15 UTC 
(rev 37009)
@@ -8,8 +8,8 @@
 #include "DrawButton.h"
 #include "DrawingTidbits.h"
 
-DrawButton::DrawButton(BRect frame, const char *name, const unsigned char *on, 
const unsigned char *off,
-                                               BMessage *msg, int32 resize, 
int32 flags)
+DrawButton::DrawButton(BRect frame, const char *name, const unsigned char *on, 
+       const unsigned char *off, BMessage *msg, int32 resize, int32 flags)
        : BControl(frame, name, "", msg, resize, flags | B_WILL_DRAW),
                fOn(frame, B_CMAP8),
                fOff(frame, B_CMAP8),

Modified: haiku/trunk/src/apps/soundrecorder/DrawingTidbits.cpp
===================================================================
--- haiku/trunk/src/apps/soundrecorder/DrawingTidbits.cpp       2010-06-04 
19:59:33 UTC (rev 37008)
+++ haiku/trunk/src/apps/soundrecorder/DrawingTidbits.cpp       2010-06-04 
20:21:15 UTC (rev 37009)
@@ -2,7 +2,8 @@
  * Copyright 2005, Jérôme Duval. All rights reserved.
  * Distributed under the terms of the MIT License.
  *
- * Inspired by SoundCapture from Be newsletter (Media Kit Basics: Consumers 
and Producers)
+ * Inspired by SoundCapture from Be newsletter (Media Kit Basics: Consumers 
+ * and Producers)
  */
 
 #include <Bitmap.h>
@@ -48,7 +49,8 @@
 void
 ReplaceColor(BBitmap *bitmap, rgb_color from, rgb_color to)
 {
-       ASSERT(bitmap->ColorSpace() == B_CMAP8); // other color spaces not 
implemented yet
+       ASSERT(bitmap->ColorSpace() == B_CMAP8);
+       // other color spaces not implemented yet
        
        BScreen screen(B_MAIN_SCREEN_ID);
        uint32 fromIndex = screen.IndexForColor(from);
@@ -64,7 +66,8 @@
 void 
 ReplaceTransparentColor(BBitmap *bitmap, rgb_color with)
 {
-       ASSERT(bitmap->ColorSpace() == B_CMAP8); // other color spaces not 
implemented yet
+       ASSERT(bitmap->ColorSpace() == B_CMAP8);
+       // other color spaces not implemented yet
        
        BScreen screen(B_MAIN_SCREEN_ID);
        uint8 withIndex = screen.IndexForColor(with); 

Modified: haiku/trunk/src/apps/soundrecorder/FileUtils.cpp
===================================================================
--- haiku/trunk/src/apps/soundrecorder/FileUtils.cpp    2010-06-04 19:59:33 UTC 
(rev 37008)
+++ haiku/trunk/src/apps/soundrecorder/FileUtils.cpp    2010-06-04 20:21:15 UTC 
(rev 37009)
@@ -1,4 +1,4 @@
-/*******************************************************************************
+/******************************************************************************
 /
 /      File:                   FileUtils.cpp
 /
@@ -6,7 +6,7 @@
 /
 /      Copyright 1998-1999, Be Incorporated, All Rights Reserved
 /
-*******************************************************************************/
+******************************************************************************/
 #include "FileUtils.h"
 
 #include <new>
@@ -102,8 +102,8 @@
                }
                // NOTE: Attributes of size 0 are perfectly valid!
                while (read >= 0) {
-                       ssize_t written = dst.WriteAttr(attrName, info.type, 
offset, buffer,
-                               read);
+                       ssize_t written = dst.WriteAttr(attrName, info.type, 
offset, 
+                               buffer, read);
                        if (written != read) {
                                fprintf(stderr, "Error writing attribute 
'%s'\n", attrName);
                                if (written < 0)

Modified: haiku/trunk/src/apps/soundrecorder/Jamfile
===================================================================
--- haiku/trunk/src/apps/soundrecorder/Jamfile  2010-06-04 19:59:33 UTC (rev 
37008)
+++ haiku/trunk/src/apps/soundrecorder/Jamfile  2010-06-04 20:21:15 UTC (rev 
37009)
@@ -20,7 +20,15 @@
        UpDownButton.cpp
        VUView.cpp
        VolumeSlider.cpp
-       : be media tracker $(TARGET_LIBSTDC++)
+       : be locale media tracker $(TARGET_LIBSTDC++)
        : SoundRecorder.rdef
 ;
 
+DoCatalogs SoundRecorder :
+       x-vnd.Haiku-SoundRecorder
+       :
+       RecorderWindow.cpp
+       SoundListView.cpp
+;
+
+

Modified: haiku/trunk/src/apps/soundrecorder/RecorderWindow.cpp
===================================================================
--- haiku/trunk/src/apps/soundrecorder/RecorderWindow.cpp       2010-06-04 
19:59:33 UTC (rev 37008)
+++ haiku/trunk/src/apps/soundrecorder/RecorderWindow.cpp       2010-06-04 
20:21:15 UTC (rev 37009)
@@ -56,6 +56,10 @@
 #define CONNECT FPRINTF
 #define WINDOW FPRINTF
 
+#undef B_TRANSLATE_CONTEXT
+#define B_TRANSLATE_CONTEXT "RecorderWindow"
+
+
 // default window positioning
 static const float MIN_WIDTH = 400.0f;
 static const float MIN_HEIGHT = 336.0f;
@@ -108,7 +112,8 @@
                fPlayFrames(0),
                fLooping(false),
                fSavePanel(NULL),
-               fInitCheck(B_OK)
+               fInitCheck(B_OK),
+               fAppCatalog(NULL)
 {
        fRoster = NULL;
        fRecordButton = NULL;
@@ -124,12 +129,18 @@
 
        CalcSizes(MIN_WIDTH, MIN_HEIGHT);
 
+       be_locale->GetAppCatalog(&fAppCatalog);
+       
+       SetTitle(B_TRANSLATE("SoundRecorder"));
+       
        fInitCheck = InitWindow();
        if (fInitCheck != B_OK) {
                if (fInitCheck == B_NAME_NOT_FOUND)
-                       ErrorAlert("find default audio hardware", fInitCheck);
+                       ErrorAlert(B_TRANSLATE("Cannot find default audio 
hardware"), 
+                               fInitCheck);
                else
-                       ErrorAlert("connect to media server", fInitCheck);
+                       ErrorAlert(B_TRANSLATE("Cannot connect to media 
server"), 
+                               fInitCheck);
                PostMessage(B_QUIT_REQUESTED);
        } else
                Show();
@@ -277,7 +288,7 @@
                //      Button for rewinding
                buttonRect = BRect(BPoint(0,0), kSkipButtonSize);
                buttonRect.OffsetTo(background->Bounds().LeftBottom() - 
BPoint(-7, 25));
-               fRewindButton = new TransportButton(buttonRect, "Rewind",
+               fRewindButton = new TransportButton(buttonRect, 
B_TRANSLATE("Rewind"),
                        kSkipBackBitmapBits, kPressedSkipBackBitmapBits, 
                        kDisabledSkipBackBitmapBits, new BMessage(REWIND));
                background->AddChild(fRewindButton);
@@ -285,7 +296,7 @@
                //      Button for stopping recording or playback
                buttonRect = BRect(BPoint(0,0), kStopButtonSize);
                buttonRect.OffsetTo(background->Bounds().LeftBottom() - 
BPoint(-48, 25));
-               fStopButton = new TransportButton(buttonRect, "Stop",
+               fStopButton = new TransportButton(buttonRect, 
B_TRANSLATE("Stop"),
                        kStopButtonBitmapBits, kPressedStopButtonBitmapBits, 
                        kDisabledStopButtonBitmapBits, new BMessage(STOP));
                background->AddChild(fStopButton);
@@ -293,14 +304,14 @@
                //      Button for starting playback of selected sound
                BRect playRect(BPoint(0,0), kPlayButtonSize);
                playRect.OffsetTo(background->Bounds().LeftBottom() - 
BPoint(-82, 25));
-               fPlayButton = new PlayPauseButton(playRect, "Play",
+               fPlayButton = new PlayPauseButton(playRect, B_TRANSLATE("Play"),
                        new BMessage(PLAY), new BMessage(PLAY_PERIOD), ' ', 0);
                background->AddChild(fPlayButton);
 
                //      Button for forwarding
                buttonRect = BRect(BPoint(0,0), kSkipButtonSize);
                buttonRect.OffsetTo(background->Bounds().LeftBottom() - 
BPoint(-133, 25));
-               fForwardButton = new TransportButton(buttonRect, "Forward",
+               fForwardButton = new TransportButton(buttonRect, 
B_TRANSLATE("Forward"),
                        kSkipForwardBitmapBits, kPressedSkipForwardBitmapBits,
                        kDisabledSkipForwardBitmapBits, new BMessage(FORWARD));
                background->AddChild(fForwardButton);
@@ -308,14 +319,14 @@
                //      Button to start recording (or waiting for sound)
                buttonRect = BRect(BPoint(0,0), kRecordButtonSize);
                buttonRect.OffsetTo(background->Bounds().LeftBottom() - 
BPoint(-174, 25));
-               fRecordButton = new RecordButton(buttonRect, "Record",
+               fRecordButton = new RecordButton(buttonRect, 
B_TRANSLATE("Record"),
                        new BMessage(RECORD), new BMessage(RECORD_PERIOD));
                background->AddChild(fRecordButton);
 
                //      Button for saving selected sound
                buttonRect = BRect(BPoint(0,0), kDiskButtonSize);
                buttonRect.OffsetTo(background->Bounds().LeftBottom() - 
BPoint(-250, 21));
-               fSaveButton = new TransportButton(buttonRect, "Save",
+               fSaveButton = new TransportButton(buttonRect, 
B_TRANSLATE("Save"),
                        kDiskButtonBitmapsBits, kPressedDiskButtonBitmapsBits,
                        kDisabledDiskButtonBitmapsBits, new BMessage(SAVE));
                fSaveButton->SetResizingMode(B_FOLLOW_RIGHT | B_FOLLOW_TOP);
@@ -324,7 +335,7 @@
                //      Button Loop
                buttonRect = BRect(BPoint(0,0), kArrowSize);
                buttonRect.OffsetTo(background->Bounds().RightBottom() - 
BPoint(23, 48));
-               fLoopButton = new DrawButton(buttonRect, "Loop",
+               fLoopButton = new DrawButton(buttonRect, B_TRANSLATE("Loop"),
                        kLoopArrowBits, kArrowBits, new BMessage(LOOP));
                fLoopButton->SetResizingMode(B_FOLLOW_RIGHT | B_FOLLOW_TOP);
                fLoopButton->SetTarget(this);
@@ -366,7 +377,8 @@
                r.top += 4;
                r.right -= B_V_SCROLL_BAR_WIDTH;
                r.bottom -= 25;
-               fSoundList = new SoundListView(r, "Sound List", B_FOLLOW_ALL);
+               fSoundList = new SoundListView(r, B_TRANSLATE("Sound List"), 
+                       B_FOLLOW_ALL);
                fSoundList->SetSelectionMessage(new BMessage(SOUND_SELECTED));
                fSoundList->SetViewColor(216, 216, 216);
                BScrollView *scroller = new BScrollView("scroller", fSoundList, 
@@ -379,43 +391,46 @@
                r.InsetBy(10, 8);
                r.top -= 1;
                fFileInfoBox = new BBox(r, "fileinfo", B_FOLLOW_LEFT | 
B_FOLLOW_BOTTOM);
-               fFileInfoBox->SetLabel("File info");
+               fFileInfoBox->SetLabel(B_TRANSLATE("File info"));
 
                r = fFileInfoBox->Bounds();
                r.left = 8;
                r.top = 13;
                r.bottom = r.top + 15;
                r.right -= 10;
-               fFilename = new BStringView(r, "filename", "File name:");
+               fFilename = new BStringView(r, "filename", B_TRANSLATE("File 
name:"));
                fFileInfoBox->AddChild(fFilename);
                r.top += 13;
                r.bottom = r.top + 15;
-               fFormat = new BStringView(r, "format", "Format:");
+               fFormat = new BStringView(r, "format", B_TRANSLATE("Format:"));
                fFileInfoBox->AddChild(fFormat);
                r.top += 13;
                r.bottom = r.top + 15;
-               fCompression = new BStringView(r, "compression", 
"Compression:");
+               fCompression = new BStringView(r, "compression", 
+                       B_TRANSLATE("Compression:"));
                fFileInfoBox->AddChild(fCompression);
                r.top += 13;
                r.bottom = r.top + 15;
-               fChannels = new BStringView(r, "channels", "Channels:");
+               fChannels = new BStringView(r, "channels", 
B_TRANSLATE("Channels:"));
                fFileInfoBox->AddChild(fChannels);
                r.top += 13;
                r.bottom = r.top + 15;
-               fSampleSize = new BStringView(r, "samplesize", "Sample size:");
+               fSampleSize = new BStringView(r, "samplesize", 
+                       B_TRANSLATE("Sample size:"));
                fFileInfoBox->AddChild(fSampleSize);
                r.top += 13;
                r.bottom = r.top + 15;
-               fSampleRate = new BStringView(r, "samplerate", "Sample rate:");
+               fSampleRate = new BStringView(r, "samplerate", 
+                       B_TRANSLATE("Sample rate:"));
                fFileInfoBox->AddChild(fSampleRate);
                r.top += 13;
                r.bottom = r.top + 15;
-               fDuration = new BStringView(r, "duration", "Duration:");
+               fDuration = new BStringView(r, "duration", 
B_TRANSLATE("Duration:"));
                fFileInfoBox->AddChild(fDuration);
 
                //      Input selection lists all available physical inputs 
that produce
                //      buffers with B_MEDIA_RAW_AUDIO format data.
-               popup = new BPopUpMenu("Input");
+               popup = new BPopUpMenu(B_TRANSLATE("Input"));
                const int maxInputCount = 64;
                dormant_node_info dni[maxInputCount];
 
@@ -456,8 +471,8 @@
                r.right = (r.left + r.right) / 2;
                r.InsetBy(10,10);
                r.top = r.bottom - 18;
-               fInputField = new BMenuField(r, "Input", "Input:", popup);
-               fInputField->SetDivider(fInputField->StringWidth("Input:") + 
4.0f);
+               fInputField = new BMenuField(r, "Input", B_TRANSLATE("Input:"), 
popup);
+               
fInputField->SetDivider(fInputField->StringWidth(B_TRANSLATE("Input:")) + 4.0f);
                fBottomBox->AddChild(fInputField);
 
                fBottomBox->AddChild(fFileInfoBox);
@@ -624,27 +639,31 @@
        //      Create a file with a temporary name
        status_t err = NewTempName(name);
        if (err < B_OK) {
-               ErrorAlert("find an unused name to use for the new recording", 
err);
+               ErrorAlert(B_TRANSLATE("Cannot find an unused name to use for 
the "
+                       "new recording"), err);
                return;
        }
        //      Find the file so we can refer to it later
        err = fTempDir.FindEntry(name, &fRecEntry);
        if (err < B_OK) {
-               ErrorAlert("find the temporary file created to hold the new 
recording", err);
+               ErrorAlert(B_TRANSLATE("Cannot find the temporary file created 
to "
+                       "hold the new recording"), err);
                return;
        }
        err = fRecFile.SetTo(&fTempDir, name, O_RDWR);
        if (err < B_OK) {
-               ErrorAlert("open the temporary file created to hold the new 
recording", err);
+               ErrorAlert(B_TRANSLATE("Cannot open the temporary file created 
to "
+                       "hold the new recording"), err);
                fRecEntry.Unset();
                return;
        }
        //      Reserve space on disk (creates fewer fragments)
        err = fRecFile.SetSize(4 * fRecordFormat.u.raw_audio.channel_count 
-               * fRecordFormat.u.raw_audio.frame_rate * 
(fRecordFormat.u.raw_audio.format 
-                               & media_raw_audio_format::B_AUDIO_SIZE_MASK));
+               * fRecordFormat.u.raw_audio.frame_rate 
+               * (fRecordFormat.u.raw_audio.format 
+                       & media_raw_audio_format::B_AUDIO_SIZE_MASK));
        if (err < B_OK) {
-               ErrorAlert("record a sound that long", err);
+               ErrorAlert(B_TRANSLATE("Cannot record a sound that long"), err);
                fRecEntry.Remove();
                fRecEntry.Unset();
                return;
@@ -656,7 +675,8 @@
        //      Hook up input
        err = MakeRecordConnection(fAudioInputNode);
        if (err < B_OK) {
-               ErrorAlert("connect to the selected sound input", err);
+               ErrorAlert(B_TRANSLATE("Cannot connect to the selected sound 
input"), 
+                       err);
                fRecEntry.Remove();
                fRecEntry.Unset();
                return;
@@ -692,7 +712,7 @@
        fPlayButton->SetPlaying();
 
        if (!fPlayTrack) {
-               ErrorAlert("get the file to play", B_ERROR);
+               ErrorAlert(B_TRANSLATE("Cannot get the file to play"), B_ERROR);
                return;
        }
 
@@ -702,7 +722,8 @@
        fPlayFrame = fPlayTrack->CurrentFrame();
 
        // Create our internal Node which plays sound, and register it.
-       fPlayer = new BSoundPlayer(fAudioMixerNode, &fPlayFormat.u.raw_audio, 
"Sound Player");
+       fPlayer = new BSoundPlayer(fAudioMixerNode, &fPlayFormat.u.raw_audio, 
+               "Sound Player");
        status_t err = fPlayer->InitCheck();
        if (err < B_OK) {
                return;
@@ -830,7 +851,7 @@
                return;
        status_t err = UpdatePlayFile(pItem, true);
        if (err != B_OK) {
-               ErrorAlert("recognize this file as a media file", 
+               ErrorAlert(B_TRANSLATE("Cannot recognize this file as a media 
file"), 
                        err == B_MEDIA_NO_HANDLER ? B_OK : err);
                RemoveCurrentSoundItem();
        }
@@ -913,8 +934,10 @@
                return err;
        }
 
-       //      Using the same structs for input and output is OK in 
BMediaRoster::Connect().
-       err = fRoster->Connect(fAudioOutput.source, fRecInput.destination, 
&fRecordFormat, &fAudioOutput, &fRecInput);
+       //      Using the same structs for input and output is OK in 
+       //  BMediaRoster::Connect().
+       err = fRoster->Connect(fAudioOutput.source, fRecInput.destination, 
+               &fRecordFormat, &fAudioOutput, &fRecInput);
        if (err < B_OK) {
                CONNECT((stderr, "RecorderWindow::MakeRecordConnection():"
                        " failed to connect sound recorder to audio input 
node.\n"));
@@ -978,7 +1001,8 @@
                fRecFile.Seek(0, SEEK_SET);
                fRecFile.Write(&header, sizeof(header));
 
-               fRecFile.SetSize(fRecSize + sizeof(header));    //      We 
reserve space; make sure we cut off any excess at the end.
+               fRecFile.SetSize(fRecSize + sizeof(header));
+               //      We reserve space; make sure we cut off any excess at 
the end.
                AddSoundItem(fRecEntry, true);
        }
        else {
@@ -1037,7 +1061,8 @@
 }
 
 #ifndef __HAIKU__
-extern "C" status_t DecodedFormat__11BMediaTrackP12media_format(BMediaTrack 
*self, media_format *inout_format);
+extern "C" status_t DecodedFormat__11BMediaTrackP12media_format(
+       BMediaTrack *self, media_format *inout_format);
 #endif
 
 
@@ -1093,31 +1118,32 @@
        if (!updateDisplay)
                return B_OK;
 
-       BString filename = "File name: ";
+       BString filename = B_TRANSLATE("File name: ");
        filename << ref.name;
        fFilename->SetText(filename.String());
 
-       BString format = "Format: ";
+       BString format = B_TRANSLATE("Format: ");
        media_file_format file_format;
        if (fPlayFile->GetFileFormatInfo(&file_format) == B_OK)
                format << file_format.short_name;
-       BString compression = "Compression: ";
+       BString compression = B_TRANSLATE("Compression: ");
        media_codec_info codec_info;
        if (fPlayTrack->GetCodecInfo(&codec_info) == B_OK) {
                if (strcmp(codec_info.short_name, "raw")==0)
-                       compression << "None";
+                       compression << B_TRANSLATE("None");
                else
                        compression << codec_info.short_name;
        }
-       BString channels = "Channels: ";
+       BString channels = B_TRANSLATE("Channels: ");
        channels << fPlayFormat.u.raw_audio.channel_count;
-       BString samplesize = "Sample size: ";
-       samplesize << 8 * (fPlayFormat.u.raw_audio.format & 0xf) << " bits";
-       BString samplerate = "Sample rate: ";
+       BString samplesize = B_TRANSLATE("Sample size: ");
+       samplesize << 8 * (fPlayFormat.u.raw_audio.format & 0xf) 
+               << B_TRANSLATE(" bits");
+       BString samplerate = B_TRANSLATE("Sample rate: ");
        samplerate << (int)fPlayFormat.u.raw_audio.frame_rate;
-       BString durationString = "Duration: ";
+       BString durationString = B_TRANSLATE("Duration: ");
        bigtime_t duration = fPlayTrack->Duration();
-       durationString << (float)(duration / 1000000.0) << " seconds";
+       durationString << (float)(duration / 1000000.0) << B_TRANSLATE(" 
seconds");
 
        fFormat->SetText(format.String());
        fCompression->SetText(compression.String());
@@ -1140,10 +1166,10 @@
 {
        char msg[300];
        if (err != B_OK)
-               sprintf(msg, "Cannot %s: %s. [%lx]", action, strerror(err), 
(int32) err);
+               sprintf(msg, "%s: %s. [%lx]", action, strerror(err), (int32) 
err);
        else
-               sprintf(msg, "Cannot %s.", action);
-       (new BAlert("", msg, "Stop"))->Go();
+               sprintf(msg, "%s.", action);
+       (new BAlert("", msg, B_TRANSLATE("Stop")))->Go();
 }
 
 
@@ -1302,13 +1328,15 @@
        }
 
        if (countBad > 0 && countGood == 0)
-               (new BAlert("Nothing to play", "None of the files appear to be "
-                       "audio files", "OK", NULL, NULL, B_WIDTH_AS_USUAL, 
B_STOP_ALERT))->Go();
+               (new BAlert(B_TRANSLATE("Nothing to play"), B_TRANSLATE("None 
of the "
+                       "files appear to be audio files"), B_TRANSLATE("OK"), 
NULL, NULL, 
+                       B_WIDTH_AS_USUAL, B_STOP_ALERT))->Go();
        else if (countGood > 0) {
                if (countBad > 0)
-                       (new BAlert("Invalid audio files", "Some of the files "
-                               "don't appear to be audio files", "OK", NULL, 
NULL, 
-                               B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go();
+                       (new BAlert(B_TRANSLATE("Invalid audio files"), 
B_TRANSLATE("Some "
+                               "of the files don't appear to be audio files"), 
+                               B_TRANSLATE("OK"), NULL, NULL, 
B_WIDTH_AS_USUAL, 
+                               B_WARNING_ALERT))->Go();
                fSoundList->Select(fSoundList->CountItems() - 1);
        }
 }
@@ -1332,7 +1360,8 @@
                                bigtime_t start = fTrackSlider->LeftTime();
                                
                                // write data
-                               bigtime_t diffTime = fTrackSlider->RightTime() 
- fTrackSlider->LeftTime();
+                               bigtime_t diffTime = fTrackSlider->RightTime() 
+                                       - fTrackSlider->LeftTime();
                                int64 framesToWrite = (int64) (diffTime
                                        * fPlayFormat.u.raw_audio.frame_rate / 
1000000LL);
                                int32 frameSize = 
(fPlayFormat.u.raw_audio.format & 0xf) 
@@ -1340,17 +1369,21 @@
 
                                wave_struct header;
                                header.riff.riff_id = FOURCC('R','I','F','F');
-                               header.riff.len = (frameSize * framesToWrite) + 
sizeof(header) - 8;
+                               header.riff.len 
+                                       = (frameSize * framesToWrite) + 
sizeof(header) - 8;
                                header.riff.wave_id = FOURCC('W','A','V','E');
                                header.format_chunk.fourcc = 
FOURCC('f','m','t',' ');
                                header.format_chunk.len = sizeof(header.format);
                                header.format.format_tag = 1;
                                header.format.channels = 
fPlayFormat.u.raw_audio.channel_count;
-                               header.format.samples_per_sec = 
(uint32)fPlayFormat.u.raw_audio.frame_rate;
-                               header.format.avg_bytes_per_sec = 
(uint32)(fPlayFormat.u.raw_audio.frame_rate 
+                               header.format.samples_per_sec 
+                                       = 
(uint32)fPlayFormat.u.raw_audio.frame_rate;
+                               header.format.avg_bytes_per_sec 
+                                       = 
(uint32)(fPlayFormat.u.raw_audio.frame_rate 
                                        * fPlayFormat.u.raw_audio.channel_count
                                        * (fPlayFormat.u.raw_audio.format & 
0xf));
-                               header.format.bits_per_sample = 
(fPlayFormat.u.raw_audio.format & 0xf) * 8;
+                               header.format.bits_per_sample 
+                                       = (fPlayFormat.u.raw_audio.format & 
0xf) * 8;
                                header.format.block_align = frameSize;
                                header.data_chunk.fourcc = 
FOURCC('d','a','t','a');
                                header.data_chunk.len = frameSize * 
framesToWrite;

Modified: haiku/trunk/src/apps/soundrecorder/RecorderWindow.h
===================================================================
--- haiku/trunk/src/apps/soundrecorder/RecorderWindow.h 2010-06-04 19:59:33 UTC 
(rev 37008)
+++ haiku/trunk/src/apps/soundrecorder/RecorderWindow.h 2010-06-04 20:21:15 UTC 
(rev 37009)
@@ -8,10 +8,12 @@
 #ifndef RECORDERWINDOW_H
 #define RECORDERWINDOW_H
 
+#include <Catalog.h>
 #include <Directory.h>
 #include <Entry.h>
 #include <File.h>
 #include <FilePanel.h>
+#include <Locale.h>
 #include <MediaFile.h>
 #include <MediaNode.h>
 #include <MediaTrack.h>
@@ -167,6 +169,7 @@
                                
                void RefsReceived(BMessage *msg);
                void CopyTarget(BMessage *msg);
+               BCatalog fAppCatalog;
 };
 
 #endif /*      RECORDERWINDOW_H */

Modified: haiku/trunk/src/apps/soundrecorder/ScopeView.cpp
===================================================================
--- haiku/trunk/src/apps/soundrecorder/ScopeView.cpp    2010-06-04 19:59:33 UTC 
(rev 37008)
+++ haiku/trunk/src/apps/soundrecorder/ScopeView.cpp    2010-06-04 20:21:15 UTC 
(rev 37009)
@@ -121,7 +121,8 @@
        int64 framesCount = fMediaTrack->CountFrames() / SAMPLES_COUNT;
        if (framesCount <= 0)
                return;
-       T samples[fPlayFormat.u.raw_audio.buffer_size / 
(fPlayFormat.u.raw_audio.format 
+       T samples[fPlayFormat.u.raw_audio.buffer_size 
+               / (fPlayFormat.u.raw_audio.format 
                & media_raw_audio_format::B_AUDIO_SIZE_MASK)];
        int64 frames = 0;
        U sum = 0;
@@ -149,7 +150,8 @@
                                break;
                        
                        if (sumCount >= framesCount) {
-                               //TRACE("computing block %ld, sumCount %ld\n", 
previewIndex, sumCount);
+                               // TRACE("computing block %ld, sumCount %ld\n", 
previewIndex, 
+                               // sumCount);
                                fPreview[previewIndex] = (int32)(sum 
                                        / fPlayFormat.u.raw_audio.channel_count 
/ framesCount);
                                if (previewMax < fPreview[previewIndex])
@@ -164,7 +166,8 @@
        if (previewMax <= 0)
                return;
        for (int i = 0; i < SAMPLES_COUNT; i++)
-               fPreview[i] = (int32)(fPreview[i] * 1.0 / previewMax * middle + 
middle);
+               fPreview[i] = (int32)(fPreview[i] * 1.0 / previewMax 
+                       * middle + middle);
 }
 
 

Modified: haiku/trunk/src/apps/soundrecorder/SoundConsumer.cpp
===================================================================
--- haiku/trunk/src/apps/soundrecorder/SoundConsumer.cpp        2010-06-04 
19:59:33 UTC (rev 37008)
+++ haiku/trunk/src/apps/soundrecorder/SoundConsumer.cpp        2010-06-04 
20:21:15 UTC (rev 37009)
@@ -1,4 +1,4 @@
-/*******************************************************************************
+/******************************************************************************
 /
 /      File:                   SoundConsumer.cpp
 /
@@ -6,7 +6,7 @@
 /
 /      Copyright 1998-1999, Be Incorporated, All Rights Reserved
 /
-*******************************************************************************/
+******************************************************************************/
 #include "SoundConsumer.h"
 
 #include <new>

Modified: haiku/trunk/src/apps/soundrecorder/SoundListView.cpp
===================================================================
--- haiku/trunk/src/apps/soundrecorder/SoundListView.cpp        2010-06-04 
19:59:33 UTC (rev 37008)
+++ haiku/trunk/src/apps/soundrecorder/SoundListView.cpp        2010-06-04 
20:21:15 UTC (rev 37009)
@@ -2,13 +2,20 @@
  * Copyright 2005, Jérôme Duval. All rights reserved.
  * Distributed under the terms of the MIT License.
  *
- * Inspired by SoundCapture from Be newsletter (Media Kit Basics: Consumers 
and Producers)
+ * Inspired by SoundCapture from Be newsletter (Media Kit Basics: Consumers 
+ * and Producers)
  */
+#include <Catalog.h>
 #include <Entry.h>
+#include <Locale.h>
 
 #include "SoundListView.h"
 
 
+#undef B_TRANSLATE_CONTEXT
+#define B_TRANSLATE_CONTEXT "SoundListView"
+
+
 SoundListView::SoundListView(
        const BRect & area,
        const char * name,
@@ -36,12 +43,12 @@
                SetFont(&font);
                font_height height;
                font.GetHeight(&height);
-               float width = font.StringWidth("Drop files here");
+               float width = font.StringWidth(B_TRANSLATE("Drop files here"));
 
                BPoint pt;
                pt.x = (Bounds().Width() - width) / 2;
                pt.y = (Bounds().Height() + height.ascent + height.descent)/ 2;
-               DrawString("Drop files here", pt);
+               DrawString(B_TRANSLATE("Drop files here"), pt);
        }
        BListView::Draw(updateRect);
 }

Modified: haiku/trunk/src/apps/soundrecorder/SoundUtils.cpp
===================================================================
--- haiku/trunk/src/apps/soundrecorder/SoundUtils.cpp   2010-06-04 19:59:33 UTC 
(rev 37008)
+++ haiku/trunk/src/apps/soundrecorder/SoundUtils.cpp   2010-06-04 20:21:15 UTC 
(rev 37009)
@@ -1,4 +1,4 @@
-/*******************************************************************************
+/******************************************************************************
 /
 /      File:                   SoundUtils.cpp
 /
@@ -6,7 +6,7 @@
 /
 /      Copyright 1998-1999, Be Incorporated, All Rights Reserved
 /
-*******************************************************************************/
+******************************************************************************/
 
 #include <math.h>
 #include "SoundUtils.h"
@@ -58,13 +58,15 @@
        //      Figuring out duration is easy. We take extra precaution to
        //      not divide by zero or return irrelevant results.
        bigtime_t duration = 0;
-       if (format.buffer_size > 0 && format.frame_rate > 0 && 
bytes_per_frame(format) > 0) {
+       if (format.buffer_size > 0 && format.frame_rate > 0 
+               && bytes_per_frame(format) > 0) {
                //      In these kinds of calculations, it's always useful to 
double-check
                //      the unit conversions. (Anyone remember high school 
physics?)
                //      bytes/(bytes/frame) / frames/sec
                //      = frames * sec/frames
                //      = secs                            which is what we want.
-               duration = s_to_us((format.buffer_size / 
bytes_per_frame(format)) / format.frame_rate);
+               duration = s_to_us((format.buffer_size / 
bytes_per_frame(format)) 
+                       / format.frame_rate);
        }
        return duration;
 }
@@ -87,10 +89,12 @@
        const media_raw_audio_format & format, bigtime_t duration)
 {
        // Double-checking those unit conversions again:
-       // secs * ( (frames/sec) / (frames/buffer) ) = secs * (buffers/sec) = 
buffers
+       // secs * ( (frames/sec) / (frames/buffer) ) = secs * (buffers/sec) 
+       // = buffers
        int buffers = 0;
        if (frames_per_buffer(format) > 0) {
-               buffers = (int) 
ceil(us_to_s(duration)*(format.frame_rate/frames_per_buffer(format)));
+               buffers = (int) ceil(us_to_s(duration)
+                       *(format.frame_rate/frames_per_buffer(format)));
        }
        return buffers;
 }

Modified: haiku/trunk/src/apps/soundrecorder/TrackSlider.cpp
===================================================================
--- haiku/trunk/src/apps/soundrecorder/TrackSlider.cpp  2010-06-04 19:59:33 UTC 
(rev 37008)
+++ haiku/trunk/src/apps/soundrecorder/TrackSlider.cpp  2010-06-04 20:21:15 UTC 
(rev 37009)
@@ -2,7 +2,8 @@
  * Copyright 2005, Jérôme Duval. All rights reserved.
  * Distributed under the terms of the MIT License.
  *
- * Inspired by SoundCapture from Be newsletter (Media Kit Basics: Consumers 
and Producers)
+ * Inspired by SoundCapture from Be newsletter (Media Kit Basics: Consumers 
+ * and Producers)
  */
  
 #include <stdio.h>
@@ -12,11 +13,20 @@
 #include "TrackSlider.h"
 #include "icon_button.h"
 
-TrackSlider::TrackSlider(BRect rect, const char *title, BMessage *msg, uint32 
resizeFlags)
-       : BControl(rect, "slider", NULL, msg, resizeFlags, B_WILL_DRAW | 
B_FRAME_EVENTS),
-       fLeftTime(0), fRightTime(1000000), fMainTime(0), fTotalTime(1000000),
-       fLeftTracking(false), fRightTracking(false), fMainTracking(false),
-       fBitmap(NULL), fBitmapView(NULL)
+TrackSlider::TrackSlider(BRect rect, const char *title, BMessage *msg, 
+       uint32 resizeFlags)
+       : 
+       BControl(rect, "slider", NULL, msg, resizeFlags, B_WILL_DRAW 
+               | B_FRAME_EVENTS),
+       fLeftTime(0),
+       fRightTime(1000000),
+       fMainTime(0),
+       fTotalTime(1000000),
+       fLeftTracking(false),
+       fRightTracking(false), 
+       fMainTracking(false),
+       fBitmap(NULL),
+       fBitmapView(NULL)
 {
        fFont.SetSize(8.0);
        fFont.SetFlags(B_DISABLE_ANTIALIASING);
@@ -74,9 +84,12 @@
                fBitmapView->fRightX = fBitmapView->fRight;
                fBitmapView->fPositionX = 15;
        } else {
-               fBitmapView->fLeftX = 14 + (fBitmapView->fRight - 15) * 
((double)fLeftTime / fTotalTime);
-               fBitmapView->fRightX = 15 + (fBitmapView->fRight - 16) * 
((double)fRightTime / fTotalTime);
-               fBitmapView->fPositionX = 15 + (fBitmapView->fRight - 14) * 
((double)fMainTime / fTotalTime);
+               fBitmapView->fLeftX = 14 + (fBitmapView->fRight - 15) 
+                       * ((double)fLeftTime / fTotalTime);
+               fBitmapView->fRightX = 15 + (fBitmapView->fRight - 16) 
+                       * ((double)fRightTime / fTotalTime);
+               fBitmapView->fPositionX = 15 + (fBitmapView->fRight - 14) 
+                       * ((double)fMainTime / fTotalTime);
        }
 }
 
@@ -132,20 +145,29 @@
        
        BeginLineArray(4);
        if (!isTracking) {
-               AddLine(BPoint(counterX-halfwidth-3,SLIDER_BASE+1), 
BPoint(counterX+halfwidth+3,SLIDER_BASE+1), gray);
-               AddLine(BPoint(counterX+halfwidth+4,SLIDER_BASE+1), 
BPoint(counterX+halfwidth+4,SLIDER_BASE-8), gray);
-               AddLine(BPoint(counterX-halfwidth-4,SLIDER_BASE+1), 
BPoint(counterX-halfwidth-4,SLIDER_BASE-9), white);
-               AddLine(BPoint(counterX-halfwidth-3,SLIDER_BASE-9), 
BPoint(counterX+halfwidth+4,SLIDER_BASE-9), white);
+               AddLine(BPoint(counterX-halfwidth-3,SLIDER_BASE+1), 
+                       BPoint(counterX+halfwidth+3,SLIDER_BASE+1), gray);
+               AddLine(BPoint(counterX+halfwidth+4,SLIDER_BASE+1), 
+                       BPoint(counterX+halfwidth+4,SLIDER_BASE-8), gray);
+               AddLine(BPoint(counterX-halfwidth-4,SLIDER_BASE+1), 
+                       BPoint(counterX-halfwidth-4,SLIDER_BASE-9), white);
+               AddLine(BPoint(counterX-halfwidth-3,SLIDER_BASE-9), 
+                       BPoint(counterX+halfwidth+4,SLIDER_BASE-9), white);
                SetHighColor(216,216,216);
        } else {
-               AddLine(BPoint(counterX-halfwidth-3,SLIDER_BASE+1), 
BPoint(counterX+halfwidth+3,SLIDER_BASE+1), blue);
-               AddLine(BPoint(counterX+halfwidth+4,SLIDER_BASE+1), 
BPoint(counterX+halfwidth+4,SLIDER_BASE-9), blue2);
-               AddLine(BPoint(counterX-halfwidth-4,SLIDER_BASE+1), 
BPoint(counterX-halfwidth-4,SLIDER_BASE-9), blue2);
-               AddLine(BPoint(counterX-halfwidth-3,SLIDER_BASE-9), 
BPoint(counterX+halfwidth+3,SLIDER_BASE-9), blue2);
+               AddLine(BPoint(counterX-halfwidth-3,SLIDER_BASE+1), 
+                       BPoint(counterX+halfwidth+3,SLIDER_BASE+1), blue);
+               AddLine(BPoint(counterX+halfwidth+4,SLIDER_BASE+1), 
+                       BPoint(counterX+halfwidth+4,SLIDER_BASE-9), blue2);
+               AddLine(BPoint(counterX-halfwidth-4,SLIDER_BASE+1), 
+                       BPoint(counterX-halfwidth-4,SLIDER_BASE-9), blue2);
+               AddLine(BPoint(counterX-halfwidth-3,SLIDER_BASE-9), 
+                       BPoint(counterX+halfwidth+3,SLIDER_BASE-9), blue2);
                SetHighColor(48,48,241);
        }
        EndLineArray();
-       
FillRect(BRect(counterX-halfwidth-3,SLIDER_BASE-8,counterX+halfwidth+3,SLIDER_BASE));
+       FillRect(BRect(counterX-halfwidth-3,SLIDER_BASE-8,counterX+halfwidth+3,
+               SLIDER_BASE));
 
 #ifdef __HAIKU__
        SetDrawingMode(B_OP_OVER);
@@ -174,36 +196,58 @@
        rgb_color white = {255,255,255};
                
        BeginLineArray(30);
-       AddLine(BPoint(position,SLIDER_BASE+7), 
BPoint(position-4,SLIDER_BASE+3), black);
-       AddLine(BPoint(position-4,SLIDER_BASE+3), 
BPoint(position-4,SLIDER_BASE+1), black);
-       AddLine(BPoint(position-4,SLIDER_BASE+1), 
BPoint(position+4,SLIDER_BASE+1), black);
-       AddLine(BPoint(position+4,SLIDER_BASE+1), 
BPoint(position+4,SLIDER_BASE+3), black);
-       AddLine(BPoint(position+4,SLIDER_BASE+3), 
BPoint(position,SLIDER_BASE+7), black);
+       AddLine(BPoint(position,SLIDER_BASE+7), 
BPoint(position-4,SLIDER_BASE+3), 
+               black);
+       AddLine(BPoint(position-4,SLIDER_BASE+3), 
BPoint(position-4,SLIDER_BASE+1),
+               black);
+       AddLine(BPoint(position-4,SLIDER_BASE+1), 
BPoint(position+4,SLIDER_BASE+1),
+               black);
+       AddLine(BPoint(position+4,SLIDER_BASE+1), 
BPoint(position+4,SLIDER_BASE+3),
+               black);
+       AddLine(BPoint(position+4,SLIDER_BASE+3), 
BPoint(position,SLIDER_BASE+7),
+               black);
        
        
-       AddLine(BPoint(position-3,SLIDER_BASE+2), 
BPoint(position+3,SLIDER_BASE+2), rose);
-       AddLine(BPoint(position-3,SLIDER_BASE+3), 
BPoint(position-1,SLIDER_BASE+5), rose);
+       AddLine(BPoint(position-3,SLIDER_BASE+2), 
BPoint(position+3,SLIDER_BASE+2),
+               rose);
+       AddLine(BPoint(position-3,SLIDER_BASE+3), 
BPoint(position-1,SLIDER_BASE+5),
+               rose);
        
-       AddLine(BPoint(position-2,SLIDER_BASE+3), 
BPoint(position+2,SLIDER_BASE+3), red);
-       AddLine(BPoint(position-1,SLIDER_BASE+4), 
BPoint(position+1,SLIDER_BASE+4), red);
-       AddLine(BPoint(position,SLIDER_BASE+5), BPoint(position,SLIDER_BASE+5), 
red);
+       AddLine(BPoint(position-2,SLIDER_BASE+3), 
BPoint(position+2,SLIDER_BASE+3),
+               red);
+       AddLine(BPoint(position-1,SLIDER_BASE+4), 
BPoint(position+1,SLIDER_BASE+4),
+               red);
+       AddLine(BPoint(position,SLIDER_BASE+5), BPoint(position,SLIDER_BASE+5),
+               red);
        
-       AddLine(BPoint(position,SLIDER_BASE+6), 
BPoint(position+3,SLIDER_BASE+3), bordeau);
+       AddLine(BPoint(position,SLIDER_BASE+6), 
BPoint(position+3,SLIDER_BASE+3),
+               bordeau);
        
-       AddLine(BPoint(position,SLIDER_BASE+12), 
BPoint(position-4,SLIDER_BASE+16), black);
-       AddLine(BPoint(position-4,SLIDER_BASE+16), 
BPoint(position-4,SLIDER_BASE+17), black);
-       AddLine(BPoint(position-4,SLIDER_BASE+17), 
BPoint(position+4,SLIDER_BASE+17), black);
-       AddLine(BPoint(position+4,SLIDER_BASE+17), 
BPoint(position+4,SLIDER_BASE+16), black);
-       AddLine(BPoint(position+4,SLIDER_BASE+16), 
BPoint(position,SLIDER_BASE+12), black);
-       AddLine(BPoint(position-4,SLIDER_BASE+18), 
BPoint(position+4,SLIDER_BASE+18), white);
+       AddLine(BPoint(position,SLIDER_BASE+12), 
BPoint(position-4,SLIDER_BASE+16),
+               black);
+       AddLine(BPoint(position-4,SLIDER_BASE+16), BPoint(position-4,
+               SLIDER_BASE+17), black);
+       AddLine(BPoint(position-4,SLIDER_BASE+17), BPoint(position+4,
+               SLIDER_BASE+17), black);
+       AddLine(BPoint(position+4,SLIDER_BASE+17), BPoint(position+4,
+               SLIDER_BASE+16), black);
+       AddLine(BPoint(position+4,SLIDER_BASE+16), 
BPoint(position,SLIDER_BASE+12),
+               black);
+       AddLine(BPoint(position-4,SLIDER_BASE+18), BPoint(position+4,
+               SLIDER_BASE+18), white);
        
-       AddLine(BPoint(position-3,SLIDER_BASE+16), 
BPoint(position,SLIDER_BASE+13), rose);
+       AddLine(BPoint(position-3,SLIDER_BASE+16), 
BPoint(position,SLIDER_BASE+13),
+               rose);
        
-       AddLine(BPoint(position-2,SLIDER_BASE+16), 
BPoint(position+2,SLIDER_BASE+16), red);
-       AddLine(BPoint(position-1,SLIDER_BASE+15), 
BPoint(position+1,SLIDER_BASE+15), red);
-       AddLine(BPoint(position,SLIDER_BASE+14), 
BPoint(position,SLIDER_BASE+14), red);
+       AddLine(BPoint(position-2,SLIDER_BASE+16), BPoint(position+2,
+               SLIDER_BASE+16), red);
+       AddLine(BPoint(position-1,SLIDER_BASE+15), BPoint(position+1,
+               SLIDER_BASE+15), red);
+       AddLine(BPoint(position,SLIDER_BASE+14), BPoint(position,
+               SLIDER_BASE+14), red);
        
-       AddLine(BPoint(position+1,SLIDER_BASE+14), 
BPoint(position+3,SLIDER_BASE+16), bordeau);
+       AddLine(BPoint(position+1,SLIDER_BASE+14), BPoint(position+3,
+               SLIDER_BASE+16), bordeau);
        
        EndLineArray();
 }
@@ -237,7 +281,8 @@
 
        _UpdatePosition(point);
        SetTracking(true);
-       SetMouseEventMask(B_POINTER_EVENTS, B_NO_POINTER_HISTORY | 
B_LOCK_WINDOW_FOCUS);
+       SetMouseEventMask(B_POINTER_EVENTS, B_NO_POINTER_HISTORY 
+               | B_LOCK_WINDOW_FOCUS);
 }
 
 
@@ -262,14 +307,19 @@
 void
 TrackSlider::_UpdatePosition(BPoint point)
 {
-       BRect leftRect(fBitmapView->fLeftX-9, SLIDER_BASE+3, 
fBitmapView->fLeftX, SLIDER_BASE+16);
-       BRect rightRect(fBitmapView->fRightX, SLIDER_BASE+3, 
fBitmapView->fRightX+9, SLIDER_BASE+16);
+       BRect leftRect(fBitmapView->fLeftX-9, SLIDER_BASE+3, 
fBitmapView->fLeftX, 
+               SLIDER_BASE+16);
+       BRect rightRect(fBitmapView->fRightX, SLIDER_BASE+3, 
+               fBitmapView->fRightX+9, SLIDER_BASE+16);
        
-       if (!(fRightTracking || fMainTracking) && (fLeftTracking || ((point.x < 
fBitmapView->fPositionX-4) && leftRect.Contains(point)))) {
+       if (!(fRightTracking || fMainTracking) && (fLeftTracking 
+               || ((point.x < fBitmapView->fPositionX-4) && 
leftRect.Contains(point)))) {
                if (!IsTracking())
                        fBitmapView->fLastX = point.x - fBitmapView->fLeftX;
-               fBitmapView->fLeftX = MIN(MAX(point.x - fBitmapView->fLastX, 
15), fBitmapView->fRight);
-               fLeftTime = (bigtime_t)(MAX(MIN((fBitmapView->fLeftX - 15) / 
(fBitmapView->fRight - 14),1), 0) * fTotalTime);
+               fBitmapView->fLeftX = MIN(MAX(point.x - fBitmapView->fLastX, 
15), 
+                       fBitmapView->fRight);
+               fLeftTime = (bigtime_t)(MAX(MIN((fBitmapView->fLeftX - 15) 
+                       / (fBitmapView->fRight - 14),1), 0) * fTotalTime);
                fLeftTracking = true;
                
                BMessage msg = *Message();
@@ -290,11 +340,15 @@
                _RenderBitmap();
                
                //printf("fLeftPos : %Ld\n", fLeftTime);
-       } else if (!fMainTracking && (fRightTracking || ((point.x > 
fBitmapView->fPositionX+4) && rightRect.Contains(point)))) {
+       } else if (!fMainTracking && (fRightTracking 
+               || ((point.x > fBitmapView->fPositionX+4) 
+               && rightRect.Contains(point)))) {
                if (!IsTracking())
                        fBitmapView->fLastX = point.x - fBitmapView->fRightX;
-               fBitmapView->fRightX = MIN(MAX(point.x - fBitmapView->fLastX, 
15), fBitmapView->fRight);
-               fRightTime = (bigtime_t)(MAX(MIN((fBitmapView->fRightX - 15) / 
(fBitmapView->fRight - 14),1), 0) * fTotalTime);
+               fBitmapView->fRightX = MIN(MAX(point.x - fBitmapView->fLastX, 
15), 
+                       fBitmapView->fRight);
+               fRightTime = (bigtime_t)(MAX(MIN((fBitmapView->fRightX - 15) 
+                       / (fBitmapView->fRight - 14),1), 0) * fTotalTime);
                fRightTracking = true;
                
                BMessage msg = *Message();
@@ -317,7 +371,8 @@
                //printf("fRightPos : %Ld\n", fRightTime);
        } else {
                fBitmapView->fPositionX = MIN(MAX(point.x, 15), 
fBitmapView->fRight);
-               fMainTime = (bigtime_t)(MAX(MIN((fBitmapView->fPositionX - 15) 
/ (fBitmapView->fRight - 14),1), 0) * fTotalTime);
+               fMainTime = (bigtime_t)(MAX(MIN((fBitmapView->fPositionX - 15) 
+                       / (fBitmapView->fRight - 14),1), 0) * fTotalTime);
                fMainTracking = true;
                
                BMessage msg = *Message();
@@ -353,8 +408,8 @@
        uint32 seconds = timestamp / 1000000LL;
        timestamp -= seconds * 1000000LL;
        uint32 centiseconds = timestamp / 10000LL;
-       sprintf(string, "%02ld:%02ld:%02ld:%02ld", hours, minutes, seconds, 
centiseconds);
-
+       sprintf(string, "%02ld:%02ld:%02ld:%02ld", hours, minutes, seconds, 
+               centiseconds);
 }
 
 
@@ -362,12 +417,15 @@
 TrackSlider::SetMainTime(bigtime_t timestamp, bool reset)
 {
        fMainTime = timestamp;
-       fBitmapView->fPositionX = 15 + (fBitmapView->fRight - 14) * 
((double)fMainTime / fTotalTime);
+       fBitmapView->fPositionX = 15 + (fBitmapView->fRight - 14) 
+               * ((double)fMainTime / fTotalTime);
        if (reset) {
                fRightTime = fTotalTime;
                fLeftTime = 0;
-               fBitmapView->fLeftX = 14 + (fBitmapView->fRight - 15) * 
((double)fLeftTime / fTotalTime);
-               fBitmapView->fRightX = 15 + (fBitmapView->fRight - 16) * 
((double)fRightTime / fTotalTime);
+               fBitmapView->fLeftX = 14 + (fBitmapView->fRight - 15) 
+                       * ((double)fLeftTime / fTotalTime);
+               fBitmapView->fRightX = 15 + (fBitmapView->fRight - 16) 
+                       * ((double)fRightTime / fTotalTime);
                _RenderBitmap();
        }
        Invalidate();
@@ -382,9 +440,12 @@
                fRightTime = fTotalTime;
                fLeftTime = 0;
        }
-       fBitmapView->fPositionX = 15 + (fBitmapView->fRight - 14) * 
((double)fMainTime / fTotalTime);
-       fBitmapView->fLeftX = 14 + (fBitmapView->fRight - 15) * 
((double)fLeftTime / fTotalTime);
-       fBitmapView->fRightX = 15 + (fBitmapView->fRight - 16) * 
((double)fRightTime / fTotalTime);
+       fBitmapView->fPositionX = 15 + (fBitmapView->fRight - 14) 
+               * ((double)fMainTime / fTotalTime);
+       fBitmapView->fLeftX = 14 + (fBitmapView->fRight - 15) 
+               * ((double)fLeftTime / fTotalTime);
+       fBitmapView->fRightX = 15 + (fBitmapView->fRight - 16) 
+               * ((double)fRightTime / fTotalTime);
        _RenderBitmap();
        Invalidate();
 }
@@ -394,7 +455,8 @@
 TrackSlider::ResetMainTime()
 {
        fMainTime = fLeftTime;
-       fBitmapView->fPositionX = 15 + (fBitmapView->fRight - 14) * 
((double)fMainTime / fTotalTime);
+       fBitmapView->fPositionX = 15 + (fBitmapView->fRight - 14) 
+               * ((double)fMainTime / fTotalTime);
        Invalidate();
 }
 
@@ -403,10 +465,13 @@
 TrackSlider::FrameResized(float width, float height)
 {
        fBitmapView->fRight = Bounds().right - kLeftRightTrackSliderWidth;
-       fBitmapView->fPositionX = 15 + (fBitmapView->fRight - 14) * 
((double)fMainTime / fTotalTime);
+       fBitmapView->fPositionX = 15 + (fBitmapView->fRight - 14) 
+               * ((double)fMainTime / fTotalTime);
        _InitBitmap();
-       fBitmapView->fLeftX = 14 + (fBitmapView->fRight - 15) * 
((double)fLeftTime / fTotalTime);
-       fBitmapView->fRightX = 15 + (fBitmapView->fRight - 16) * 
((double)fRightTime / fTotalTime);
+       fBitmapView->fLeftX = 14 + (fBitmapView->fRight - 15) 
+               * ((double)fLeftTime / fTotalTime);
+       fBitmapView->fRightX = 15 + (fBitmapView->fRight - 16) 
+               * ((double)fRightTime / fTotalTime);
        _RenderBitmap();
        Invalidate();

[... truncated: 488 lines follow ...]

Other related posts:

  • » [haiku-commits] r37009 - haiku/trunk/src/apps/soundrecorder - korli