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

« back to all changes in this revision

Viewing changes to widgets/poseditplug.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
 
//=========================================================
2
 
//  MusE
3
 
//  Linux Music Editor
4
 
//    $Id: poseditplug.cpp,v 1.1 2002/01/30 14:54:03 muse Exp $
5
 
//  (C) Copyright 2001 Werner Schweer (ws@seh.de)
6
 
//=========================================================
7
 
 
8
 
#include <qwidgetplugin.h>
9
 
#include "posedit.h"
10
 
#include "poslabel.h"
11
 
#include "pitchedit.h"
12
 
#include "pitchlabel.h"
13
 
#include "sig.h"
14
 
#include "tempo.h"
15
 
 
16
 
int sampleRate = 44100;
17
 
int division = 384;
18
 
int mtcType = 0;
19
 
bool hIsB = false;
20
 
 
21
 
static const char *posedit_pixmap[] = {
22
 
          "22 22 8 1",
23
 
          "  c Gray100",
24
 
          ". c Gray97",
25
 
          "X c #4f504f",
26
 
          "o c #00007f",
27
 
          "O c Gray0",
28
 
          "+ c none",
29
 
          "@ c Gray0",
30
 
          "# c Gray0",
31
 
          "++++++++++++++++++++++",
32
 
          "++++++++++++++++++++++",
33
 
          "++++++++++++++++++++++",
34
 
          "++++++++++++++++++++++",
35
 
          "+OOOOOOOOOOOOOOOOOOOO+",
36
 
          "OOXXXXXXXXXXXXXXXXXXOO",
37
 
          "OXX.          OO OO  O",
38
 
          "OX.      oo     O    O",
39
 
          "OX.      oo     O   .O",
40
 
          "OX  ooo  oooo   O    O",
41
 
          "OX    oo oo oo  O    O",
42
 
          "OX  oooo oo oo  O    O",
43
 
          "OX oo oo oo oo  O    O",
44
 
          "OX oo oo oo oo  O    O",
45
 
          "OX  oooo oooo   O    O",
46
 
          "OX            OO OO  O",
47
 
          "OO..................OO",
48
 
          "+OOOOOOOOOOOOOOOOOOOO+",
49
 
          "++++++++++++++++++++++",
50
 
          "++++++++++++++++++++++",
51
 
          "++++++++++++++++++++++",
52
 
          "++++++++++++++++++++++"
53
 
      };
54
 
 
55
 
static const char *pitchedit_pixmap[] = {
56
 
          "22 22 8 1",
57
 
          "  c Gray100",
58
 
          ". c Gray97",
59
 
          "X c #4f504f",
60
 
          "o c #00007f",
61
 
          "O c Gray0",
62
 
          "+ c none",
63
 
          "@ c Gray0",
64
 
          "# c Gray0",
65
 
          "++++++++++++++++++++++",
66
 
          "++++++++++++++++++++++",
67
 
          "++++++++++++++++++++++",
68
 
          "++++++++++++++++++++++",
69
 
          "+OOOOOOOOOOOOOOOOOOOO+",
70
 
          "OOXXXXXXXXXXXXXXXXXXOO",
71
 
          "OXX.          OO OO  O",
72
 
          "OX.      o      O    O",
73
 
          "OX.      oo     O   .O",
74
 
          "OX       o o    O    O",
75
 
          "OX       o      O    O",
76
 
          "OX     o o      O    O",
77
 
          "OX    oooo      O    O",
78
 
          "OX     o        O    O",
79
 
          "OX              O    O",
80
 
          "OX            OO OO  O",
81
 
          "OO..................OO",
82
 
          "+OOOOOOOOOOOOOOOOOOOO+",
83
 
          "++++++++++++++++++++++",
84
 
          "++++++++++++++++++++++",
85
 
          "++++++++++++++++++++++",
86
 
          "++++++++++++++++++++++"
87
 
      };
88
 
 
89
 
class PosEditPlugin : public QWidgetPlugin {
90
 
   public:
91
 
      PosEditPlugin() {}
92
 
      virtual ~PosEditPlugin() {}
93
 
      virtual QStringList keys() const;
94
 
      virtual QWidget* create(const QString& key, QWidget* parent=0,
95
 
        const char* name = 0);
96
 
      virtual QString group(const QString& key) const;
97
 
      virtual QIconSet iconSet(const QString& key) const;
98
 
      virtual QString includeFile(const QString& key) const;
99
 
      virtual QString toolTip(const QString& key) const;
100
 
      virtual QString whatsThis(const QString& key) const;
101
 
      virtual bool isContainer(const QString& key) const;
102
 
      };
103
 
 
104
 
QStringList PosEditPlugin::keys() const
105
 
      {
106
 
      QStringList list;
107
 
      list << "PosEdit" << "PitchEdit"
108
 
         << "PosLabel" << "PitchLabel";
109
 
      return list;
110
 
      }
111
 
 
112
 
QWidget* PosEditPlugin::create(const QString& key, QWidget* parent=0,
113
 
   const char* name = 0)
114
 
      {
115
 
      if (key == "PosEdit")
116
 
            return new PosEdit(parent, name);
117
 
      else if (key == "PitchEdit")
118
 
            return new PitchEdit(parent, name);
119
 
      else if (key == "PitchLabel")
120
 
            return new PitchLabel(parent, name);
121
 
      else if (key == "PosLabel")
122
 
            return new PosLabel(parent, name);
123
 
      return 0;
124
 
      }
125
 
 
126
 
QString PosEditPlugin::group (const QString& /*key*/) const
127
 
      {
128
 
      return QString("MusE");
129
 
      }
130
 
 
131
 
QIconSet PosEditPlugin::iconSet (const QString& key) const
132
 
      {
133
 
      if (key == "PosEdit" || key == "PosLabel")
134
 
            return QIconSet(QPixmap(posedit_pixmap));
135
 
      else if (key == "PitchEdit" || key == "PitchLabel")
136
 
            return QIconSet(QPixmap(pitchedit_pixmap));
137
 
      return QIconSet();
138
 
      }
139
 
 
140
 
QString PosEditPlugin::includeFile (const QString& key) const
141
 
      {
142
 
      if (key == "PosEdit")
143
 
            return "posedit.h";
144
 
      else if (key == "PitchEdit")
145
 
            return "pitchedit.h";
146
 
      else if (key == "PitchLabel")
147
 
            return "pitchlabel.h";
148
 
      else if (key == "PosLabel")
149
 
            return "poslabel.h";
150
 
      return QString::null;
151
 
      }
152
 
 
153
 
QString PosEditPlugin::toolTip (const QString& key) const
154
 
      {
155
 
      if (key == "PosEdit")
156
 
            return QString("midi time position editor");
157
 
      else if (key == "PitchEdit")
158
 
            return QString("midi pitch spinbox");
159
 
      else if (key == "PitchLabel")
160
 
            return QString("midi pitch label");
161
 
      else if (key == "PosLabel")
162
 
            return QString("midi time position label");
163
 
      return QString::null;
164
 
      }
165
 
 
166
 
QString PosEditPlugin::whatsThis (const QString& key) const
167
 
      {
168
 
      if (key == "PosEdit")
169
 
            return QString("midi time position editor");
170
 
      else if (key == "PitchEdit")
171
 
            return QString("midi pitch spinbox");
172
 
      else if (key == "PitchLabel")
173
 
            return QString("midi pitch label");
174
 
      else if (key == "PosLabel")
175
 
            return QString("midi time position label");
176
 
      return QString::null;
177
 
      }
178
 
 
179
 
bool PosEditPlugin::isContainer (const QString& /*key*/) const
180
 
      {
181
 
      return false;
182
 
      }
183
 
 
184
 
Q_EXPORT_PLUGIN(PosEditPlugin)
185