~ubuntu-branches/ubuntu/gutsy/audacity/gutsy-backports

« back to all changes in this revision

Viewing changes to src/import/ImportRaw.cpp

  • Committer: Bazaar Package Importer
  • Author(s): John Dong
  • Date: 2008-02-18 21:58:19 UTC
  • mfrom: (13.1.2 hardy)
  • Revision ID: james.westby@ubuntu.com-20080218215819-tmbcf1rx238r8gdv
Tags: 1.3.4-1.1ubuntu1~gutsy1
Automated backport upload; no source changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
#include "../FileFormats.h"
33
33
#include "../Internat.h"
34
34
#include "../Prefs.h"
 
35
#include "../ShuttleGui.h"
35
36
#include "../WaveTrack.h"
36
37
 
37
38
#include <math.h>
238
239
 
239
240
   sf_close(sndFile);
240
241
 
241
 
   if (cancelled) {
 
242
   bool res = (!cancelled && block >= 0);
 
243
 
 
244
   if (!res) {
242
245
      for (c = 0; c < numChannels; c++)
243
246
         delete channels[c];
244
247
      delete[] channels;
245
248
 
246
249
      return 0;
247
250
   }
248
 
   else {
249
 
      for (c = 0; c < numChannels; c++)
250
 
         channels[c]->Flush();
251
 
 
252
 
      *outTracks = (Track **)channels;
253
 
 
254
 
      return numChannels;
255
 
   }
 
251
 
 
252
   for (c = 0; c < numChannels; c++)
 
253
      channels[c]->Flush();
 
254
   *outTracks = (Track **)channels;
 
255
 
 
256
   return numChannels;
256
257
}
257
258
 
258
259
//
282
283
{
283
284
   wxBoxSizer *mainSizer, *hSizer, *vSizer;
284
285
   wxFlexGridSizer *gridSizer;
285
 
   wxButton *button;
286
286
   int selection, i;
287
287
 
288
288
   mainSizer = new wxBoxSizer(wxVERTICAL);
327
327
                   wxDefaultPosition, wxDefaultSize,
328
328
                   mNumEncodings, mEncodingString);
329
329
   mEncodingChoice->SetSelection(selection);
330
 
   vSizer->Add(mEncodingChoice, 0, wxALIGN_LEFT | wxALL, 5);
 
330
   vSizer->Add(mEncodingChoice, 0, wxALIGN_CENTER | wxALL, 5);
331
331
 
332
332
   // Endian choice
333
333
 
362
362
      mEndianChoice->SetSelection(3);
363
363
      break;
364
364
   }
365
 
   vSizer->Add(mEndianChoice, 0, wxALIGN_LEFT | wxALL, 5);
 
365
   vSizer->Add(mEndianChoice, 0, wxALIGN_CENTER | wxALL, 5);
366
366
 
367
367
   // Channels choice
368
368
 
377
377
                   wxDefaultPosition, wxDefaultSize,
378
378
                   16, channelStrings);
379
379
   mChannelChoice->SetSelection(mChannels-1);
380
 
   vSizer->Add(mChannelChoice, 0, wxALIGN_LEFT | wxALL, 5);
 
380
   vSizer->Add(mChannelChoice, 0, wxALIGN_CENTER | wxALL, 5);
381
381
 
382
382
   // Offset text
383
383
 
424
424
   // Preview Pane goes here
425
425
   //
426
426
 
427
 
   wxPanel *p = new wxPanel(this, 0, wxDefaultPosition, wxSize(100, 100));
428
 
   hSizer->Add(p, 0, wxALIGN_TOP | wxALL, 5);
 
427
//   wxPanel *p = new wxPanel(this, 0, wxDefaultPosition, wxSize(100, 100));
 
428
//   hSizer->Add(p, 0, wxALIGN_TOP | wxALL, 5);
429
429
 
430
430
   mainSizer->Add(hSizer, 0, wxALIGN_CENTER | wxALL, 5);
431
431
 
433
433
   // Button row
434
434
   //
435
435
 
436
 
   hSizer = new wxBoxSizer(wxHORIZONTAL);
437
436
 
438
437
   /*
439
438
   button = new wxButton(this, PlayID, _("Play"));
440
439
   hSizer->Add(button, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5);
441
440
   */
442
441
 
443
 
   button = new wxButton(this, wxID_CANCEL, _("&Cancel"));
444
 
   hSizer->Add(button, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5);
445
 
 
446
 
   mOK = new wxButton(this, wxID_OK, _("Import"));
447
 
   mOK->SetDefault();
448
 
   hSizer->Add(mOK, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5);
449
 
 
450
 
   mainSizer->Add(hSizer, 0, wxALIGN_CENTER | wxALL, 5);
 
442
   mainSizer->Add(CreateStdButtonSizer(this, eCancelButton|eOkButton), 0, wxEXPAND);
 
443
 
 
444
   // Find the OK button, and change its text to 'Import'.
 
445
   // We MUST set mOK because it is used later.
 
446
   mOK = (wxButton *)wxWindow::FindWindowById(wxID_OK, this);
 
447
   mOK->SetLabel(_("&Import"));
451
448
 
452
449
   SetAutoLayout(true);
453
450
   SetSizer(mainSizer);
514
511
   info.channels = mChannelChoice->GetSelection() + 1;
515
512
   info.samplerate = 44100;
516
513
 
 
514
   //mOK = (wxButton *)wxWindow::FindWindowById(wxID_OK, this);
517
515
   if (sf_format_check(&info)) {
518
516
      mOK->Enable(true);
519
517
      return;