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

« back to all changes in this revision

Viewing changes to widgets/midisyncimpl.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: midisyncimpl.cpp,v 1.1 2002/01/30 14:54:03 muse Exp $
 
4
//  $Id: midisyncimpl.cpp,v 1.1.1.1 2003/10/29 10:06:21 wschweer Exp $
5
5
//
6
6
//  (C) Copyright 1999/2000 Werner Schweer (ws@seh.de)
7
7
//=========================================================
8
8
 
9
9
#include "midisyncimpl.h"
10
 
#include "globals.h"
11
 
// #include "seq.h"
 
10
#include "sync.h"
12
11
#include <qspinbox.h>
13
12
#include <qcombobox.h>
14
13
#include <qcheckbox.h>
16
15
#include <qpushbutton.h>
17
16
 
18
17
//---------------------------------------------------------
19
 
//   extSyncChanged
 
18
//   syncChanged
 
19
//    val = 1  -  Master Mode
 
20
//          0  -  Slave Mode
20
21
//---------------------------------------------------------
21
22
 
22
 
void MidiSyncConfig::extSyncChanged(bool val)
 
23
void MidiSyncConfig::syncChanged(int val)
23
24
      {
24
 
      intSync->setChecked(!val);
25
25
      acceptMTCCheckbox->setEnabled(val);
26
26
      acceptMCCheckbox->setEnabled(val);
27
 
      }
28
 
 
29
 
//---------------------------------------------------------
30
 
//   intSyncChanged
31
 
//---------------------------------------------------------
32
 
 
33
 
void MidiSyncConfig::intSyncChanged(bool val)
34
 
      {
35
 
      extSync->setChecked(!val);
36
 
      acceptMTCCheckbox->setEnabled(!val);
37
 
      acceptMCCheckbox->setEnabled(!val);
 
27
      acceptMMCCheckbox->setEnabled(val);
38
28
      }
39
29
 
40
30
//---------------------------------------------------------
42
32
//    Midi Sync Config
43
33
//---------------------------------------------------------
44
34
 
45
 
MidiSyncConfig::MidiSyncConfig(QWidget* parent=0, const char* name=0)
 
35
MidiSyncConfig::MidiSyncConfig(QWidget* parent, const char* name)
46
36
  : MidiSyncConfigBase(parent, name)
47
37
      {
48
38
      connect(okButton, SIGNAL(clicked()), SLOT(ok()));
49
39
      connect(applyButton, SIGNAL(clicked()), SLOT(apply()));
50
40
      connect(cancelButton, SIGNAL(clicked()), SLOT(cancel()));
51
41
 
52
 
      connect(extSync, SIGNAL(toggled(bool)), SLOT(extSyncChanged(bool)));
53
 
      connect(intSync, SIGNAL(toggled(bool)), SLOT(intSyncChanged(bool)));
54
 
 
55
 
      devId->setValue(deviceId);
56
 
      syncPort->setValue(extSyncPort + 1);
 
42
      connect(syncMode, SIGNAL(clicked(int)), SLOT(syncChanged(int)));
 
43
      bool ext = extSyncFlag.value();
 
44
      syncMode->setButton(int(ext));
 
45
 
 
46
      dstDevId->setValue(txDeviceId);
 
47
      srcDevId->setValue(rxDeviceId);
 
48
      srcSyncPort->setValue(rxSyncPort + 1);
 
49
      dstSyncPort->setValue(txSyncPort + 1);
 
50
 
57
51
      mtcSync->setChecked(genMTCSync);
58
52
      mcSync->setChecked(genMCSync);
59
53
      midiMachineControl->setChecked(genMMC);
 
54
 
 
55
      acceptMTCCheckbox->setChecked(acceptMTC);
60
56
      acceptMCCheckbox->setChecked(acceptMC);
61
 
      acceptMTCCheckbox->setChecked(acceptMTC);
 
57
      acceptMMCCheckbox->setChecked(acceptMMC);
62
58
 
63
59
      mtcSyncType->setCurrentItem(mtcType);
64
 
      syncSrc->setButton(int(extSyncFlag.value()));
65
60
 
66
61
      mtcOffH->setValue(mtcOffset.h());
67
62
      mtcOffM->setValue(mtcOffset.m());
69
64
      mtcOffF->setValue(mtcOffset.f());
70
65
      mtcOffSf->setValue(mtcOffset.sf());
71
66
 
72
 
      bool ext = extSyncFlag.value();
73
 
      acceptMTCCheckbox->setEnabled(ext);
74
 
      acceptMCCheckbox->setEnabled(ext);
 
67
      syncChanged(ext);
75
68
      }
76
69
 
77
70
//---------------------------------------------------------
99
92
 
100
93
void MidiSyncConfig::apply()
101
94
      {
102
 
      deviceId    = devId->value();
103
 
      extSyncPort = syncPort->value() - 1;
 
95
      txDeviceId  = dstDevId->value();
 
96
      rxDeviceId  = srcDevId->value();
 
97
      rxSyncPort  = srcSyncPort->value() - 1;
 
98
      txSyncPort  = dstSyncPort->value() - 1;
 
99
 
104
100
      genMTCSync  = mtcSync->isChecked();
105
101
      genMCSync   = mcSync->isChecked();
106
102
      genMMC      = midiMachineControl->isChecked();
107
103
 
108
104
      mtcType     = mtcSyncType->currentItem();
109
 
      extSyncFlag.setValue(extSync->isChecked());
 
105
      extSyncFlag.setValue(syncMode->id(syncMode->selected()));
110
106
 
111
107
      mtcOffset.setH(mtcOffH->value());
112
108
      mtcOffset.setM(mtcOffM->value());
114
110
      mtcOffset.setF(mtcOffF->value());
115
111
      mtcOffset.setSf(mtcOffSf->value());
116
112
 
117
 
      acceptMC = acceptMCCheckbox->isChecked();
 
113
      acceptMC  = acceptMCCheckbox->isChecked();
 
114
      acceptMMC = acceptMMCCheckbox->isChecked();
118
115
      acceptMTC = acceptMTCCheckbox->isChecked();
119
116
      }
 
117