~ubuntu-branches/ubuntu/breezy/muse/breezy

« back to all changes in this revision

Viewing changes to widgets/mixdowndialog.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Kobras
  • Date: 2004-02-07 15:18:22 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20040207151822-es27xxkzbcxkebjm
Tags: 0.6.3-1
* New upstream version.
* Added patches:
  + [10_alsa_init_fix] New, from upstream CVS.
    Initialize direction variable when setting Alsa parameters.
  + [10_canvas_translation_fix] New, from upstream CVS.
    Do not translate tooltips twice in canvas popup.
  + [10_checkbox_fix] New, from upstream CVS.
    Use proper set/test methods on metronome checkboxes.
  + [10_html_doc_cleanup] New.
    Fix links and HTML errors in documentation.
  + [20_allow_system_timer] New.
    The new upstream version fails by default if the real-time clock
    could not be accessed (usually the case when not running suid-root).
    This patch reverts the old behaviour of falling back to the more
    inaccurate system timer.
* Updated patches:
  + [11_PIC_fixes_fixup] Rediffed.
* Removed patches:
  + [20_no_atomic_asm] Merged upstream.
* debian/compat: Splice out debhelper compatibility level from rules file.
* debian/control: Build-depend on latest jack release by default.
  Closes: #228788
* debian/control: Bump standards version.
* debian/control: Use auto-generated debconf dependency via misc:Depends.
* debian/control: Minor tweaks to the long description.
* debian/control: Tighten fluidsynth build dependency to sane version.
* debian/muse.doc-base: New. Register HTML documentation with doc-base.
* debian/templates: Tiny rewording, and typo fix.
* debian/templates, debian/po/*: Switch to po-debconf for translations.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
//=========================================================
2
2
//  MusE
3
3
//  Linux Music Editor
4
 
//    $Id: mixdowndialog.cpp,v 1.2 2002/02/13 11:42:56 muse Exp $
 
4
//    $Id: mixdowndialog.cpp,v 1.1.1.1 2003/10/29 10:06:32 wschweer Exp $
5
5
//  (C) Copyright 2001 Werner Schweer (ws@seh.de)
6
6
//=========================================================
7
7
 
12
12
#include <qfiledialog.h>
13
13
#include <qcombobox.h>
14
14
#include <qlineedit.h>
15
 
#include "../sf/sndfile.h"
 
15
#include "wave.h"
16
16
 
17
17
//---------------------------------------------------------
18
18
//   sndFileOpen
34
34
//---------------------------------------------------------
35
35
 
36
36
MixdownFileDialog::MixdownFileDialog(const SndFile* _sf,
37
 
   QWidget* parent = 0, const char* name = 0, bool modal = false, WFlags fl = 0)
 
37
   QWidget* parent, const char* name, bool /*modal*/, WFlags fl)
38
38
   : MixdownFileDialogBase(parent, name, true, fl)
39
39
      {
40
40
      sf   = 0;
42
42
      if (_sf) {
43
43
            int channels = _sf->channels();
44
44
            int format   = _sf->format();
45
 
            int bits     = _sf->sampleBits();
46
 
            switch(bits) {
47
 
                  case 16: format = 0; break;
48
 
                  case 24: format = 1; break;
49
 
                  case 32: format = 2; break;
50
 
                  }
51
45
            switch(channels) {
52
46
                  case 1:  channels = 1; break;
53
47
                  case 2:  channels = 0; break;
65
59
 
66
60
void MixdownFileDialog::accept()
67
61
      {
68
 
printf("accept1\n");
69
62
      QString oldpath;
70
63
      unsigned channel = comboChannel->currentItem();
71
64
      unsigned format  = comboFormat->currentItem();
72
 
      int bits = 16;
73
65
      switch (channel) {
74
66
            case 0: channel = 2; break;
75
67
            case 1: channel = 1; break;
77
69
            }
78
70
      switch (format) {
79
71
            case 0:     // 16 bit wave
80
 
                  format = SF_FORMAT_WAV | SF_FORMAT_PCM;
81
 
                  bits   = 16;
 
72
                  format = SF_FORMAT_WAV | SF_FORMAT_PCM_16;
82
73
                  break;
83
74
            case 1:     // 24 bit wave
84
 
                  format = SF_FORMAT_WAV | SF_FORMAT_PCM;
85
 
                  bits   = 24;
 
75
                  format = SF_FORMAT_WAV | SF_FORMAT_PCM_24;
86
76
                  break;
87
77
            case 2:     // 32 bit float wave
88
78
                  format = SF_FORMAT_WAV | SF_FORMAT_FLOAT;
89
 
                  bits   = 32;
90
79
                  break;
91
80
            }
92
81
      QString path = editPath->text();
98
87
      if (path.right(4) != ".wav")
99
88
            path += ".wav";
100
89
      sf = new SndFile(path);
101
 
      sf->setFormat(format, channel, sampleRate, bits);
 
90
      sf->setFormat(format, channel, sampleRate);
102
91
      done(1);
103
92
      }
104
93
 
112
101
      if (sf)
113
102
            oldpath = sf->path();
114
103
      QString path = QFileDialog::getSaveFileName(
115
 
         oldpath, "Wave Files (*.wav);;All Files (*)", this, "MixdownFileDialog");
 
104
         oldpath, tr("Wave Files (*.wav);;All Files (*)"), this, "MixdownFileDialog");
116
105
      if (!path.isEmpty())
117
106
            editPath->setText(path);
118
107
      }