diff options
Diffstat (limited to 'muse2/muse/widgets')
166 files changed, 1601 insertions, 1536 deletions
diff --git a/muse2/muse/widgets/aboutbox_impl.cpp b/muse2/muse/widgets/aboutbox_impl.cpp index 36ba299e..b53e246f 100644 --- a/muse2/muse/widgets/aboutbox_impl.cpp +++ b/muse2/muse/widgets/aboutbox_impl.cpp @@ -24,7 +24,7 @@ #include "config.h" #include "icons.h" -namespace MusEWidget { +namespace MusEGui { AboutBoxImpl::AboutBoxImpl() { diff --git a/muse2/muse/widgets/aboutbox_impl.h b/muse2/muse/widgets/aboutbox_impl.h index 3ad3cd93..132bf83a 100644 --- a/muse2/muse/widgets/aboutbox_impl.h +++ b/muse2/muse/widgets/aboutbox_impl.h @@ -25,7 +25,7 @@ #include "ui_aboutbox.h" -namespace MusEWidget { +namespace MusEGui { class AboutBoxImpl : public QDialog, public Ui::AboutBox { diff --git a/muse2/muse/widgets/action.h b/muse2/muse/widgets/action.h index efc7c2ee..2a9f3849 100644 --- a/muse2/muse/widgets/action.h +++ b/muse2/muse/widgets/action.h @@ -25,7 +25,7 @@ #include <QAction> -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // Action diff --git a/muse2/muse/widgets/bigtime.cpp b/muse2/muse/widgets/bigtime.cpp index f4162041..af49cea1 100644 --- a/muse2/muse/widgets/bigtime.cpp +++ b/muse2/muse/widgets/bigtime.cpp @@ -33,9 +33,11 @@ #include "app.h" #include "gconfig.h" +namespace MusEGlobal { extern int mtcType; +} -namespace MusEWidget { +namespace MusEGui { // // the bigtime widget @@ -189,8 +191,8 @@ void BigTime::fmtButtonToggled(bool v) void BigTime::configChanged() { - setBgColor(MusEConfig::config.bigTimeBackgroundColor); - setFgColor(MusEConfig::config.bigTimeForegroundColor); + setBgColor(MusEGlobal::config.bigTimeBackgroundColor); + setFgColor(MusEGlobal::config.bigTimeForegroundColor); } //--------------------------------------------------------- @@ -228,7 +230,7 @@ bool BigTime::setString(unsigned v) return true; } - unsigned absFrame = tempomap.tick2frame(v); + unsigned absFrame = MusEGlobal::tempomap.tick2frame(v); int bar, beat; unsigned tick; AL::sigmap.tickValues(v, &bar, &beat, &tick); @@ -238,7 +240,7 @@ bool BigTime::setString(unsigned v) int min = int(time) / 60; int sec = int(time) % 60; double rest = time - (min * 60 + sec); - switch(mtcType) { + switch(MusEGlobal::mtcType) { case 0: // 24 frames sec rest *= 24; break; @@ -360,8 +362,8 @@ void BigTime::resizeEvent(QResizeEvent *ev) //dwin->setFont(f); QString fstr = QString("font-size:%1px; font-family:'Courier'; ").arg(fs); // Tim p4.0.8 dwin->setStyleSheet(fstr); - setBgColor(MusEConfig::config.bigTimeBackgroundColor); - setFgColor(MusEConfig::config.bigTimeForegroundColor); + setBgColor(MusEGlobal::config.bigTimeBackgroundColor); + setFgColor(MusEGlobal::config.bigTimeForegroundColor); int digitWidth = dwin->fontMetrics().width(QString("0")); int vspace = (ev->size().height() - (fs*2)) / 3; @@ -471,4 +473,4 @@ void BigTime::setBgColor(QColor c) setPalette(newpalette); } -} // namespace MusEWidget +} // namespace MusEGui diff --git a/muse2/muse/widgets/bigtime.h b/muse2/muse/widgets/bigtime.h index 636abfb3..3e3a2480 100644 --- a/muse2/muse/widgets/bigtime.h +++ b/muse2/muse/widgets/bigtime.h @@ -28,11 +28,9 @@ class QCheckBox; class QLabel; -namespace MusEApp { -class MusE; -} +namespace MusEGui { -namespace MusEWidget { +class MusE; //--------------------------------------------------------- // BigTime @@ -42,7 +40,7 @@ class BigTime : public QWidget { Q_OBJECT bool tickmode; - MusEApp::MusE* seq; + MusE* seq; bool setString(unsigned); @@ -78,6 +76,6 @@ class BigTime : public QWidget { BigTime(QWidget* parent); }; -} // namespace MusEWidget +} // namespace MusEGui #endif diff --git a/muse2/muse/widgets/canvas.cpp b/muse2/muse/widgets/canvas.cpp index 811561e3..41c5f4a4 100644 --- a/muse2/muse/widgets/canvas.cpp +++ b/muse2/muse/widgets/canvas.cpp @@ -46,7 +46,7 @@ #define ABS(x) ((x) < 0) ? -(x) : (x) -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // Canvas @@ -73,13 +73,13 @@ Canvas::Canvas(QWidget* parent, int sx, int sy, const char* name) drag = DRAG_OFF; _tool = PointerTool; - pos[0] = song->cpos(); - pos[1] = song->lpos(); - pos[2] = song->rpos(); + pos[0] = MusEGlobal::song->cpos(); + pos[1] = MusEGlobal::song->lpos(); + pos[2] = MusEGlobal::song->rpos(); curPart = NULL; curPartId = -1; curItem = NULL; - connect(song, SIGNAL(posChanged(int, unsigned, bool)), this, SLOT(setPos(int, unsigned, bool))); + connect(MusEGlobal::song, SIGNAL(posChanged(int, unsigned, bool)), this, SLOT(setPos(int, unsigned, bool))); } Canvas::~Canvas() @@ -103,10 +103,10 @@ void Canvas::setPos(int idx, unsigned val, bool adjustScrollbar) int npos = mapx(val); if (adjustScrollbar && idx == 0) { - switch (song->follow()) { - case Song::NO: + switch (MusEGlobal::song->follow()) { + case MusECore::Song::NO: break; - case Song::JUMP: + case MusECore::Song::JUMP: if (npos >= width()) { int ppos = val - xorg - rmapxDev(width()/8); if (ppos < 0) @@ -124,7 +124,7 @@ void Canvas::setPos(int idx, unsigned val, bool adjustScrollbar) npos = mapx(val); } break; - case Song::CONTINUOUS: + case MusECore::Song::CONTINUOUS: if (npos > (width()/2)) { int ppos = pos[idx] - xorg - rmapxDev(width()/2); if (ppos < 0) @@ -409,8 +409,8 @@ void Canvas::draw(QPainter& p, const QRect& rect) int my = mapy(y); //int y2 = y + h; int my2 = mapy(y + h); - MarkerList* marker = song->marker(); - for (iMarker m = marker->begin(); m != marker->end(); ++m) { + MusECore::MarkerList* marker = MusEGlobal::song->marker(); + for (MusECore::iMarker m = marker->begin(); m != marker->end(); ++m) { int xp = m->second.tick(); if (xp >= x && xp < x+w) { p.setPen(Qt::green); @@ -489,7 +489,7 @@ void Canvas::wheelEvent(QWheelEvent* ev) if (shift) { // scroll horizontally int delta = -ev->delta() / WHEEL_DELTA; - int xpixelscale = 5*fast_log10(rmapxDev(1)); + int xpixelscale = 5*MusECore::fast_log10(rmapxDev(1)); if (xpixelscale <= 0) xpixelscale = 1; @@ -1539,7 +1539,7 @@ void Canvas::canvasPopup(int n) emit toolChanged(n); } -void Canvas::setCurrentPart(Part* part) +void Canvas::setCurrentPart(MusECore::Part* part) { curItem = NULL; deselectAll(); @@ -1548,4 +1548,4 @@ void Canvas::setCurrentPart(Part* part) curPartChanged(); } -} // namespace MusEWidget +} // namespace MusEGui diff --git a/muse2/muse/widgets/canvas.h b/muse2/muse/widgets/canvas.h index 954b865d..38024feb 100644 --- a/muse2/muse/widgets/canvas.h +++ b/muse2/muse/widgets/canvas.h @@ -35,7 +35,7 @@ class QMenu; -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // Canvas @@ -81,7 +81,7 @@ class Canvas : public View { CItemList items; CItemList moving; CItem* curItem; - Part* curPart; + MusECore::Part* curPart; int curPartId; DragMode drag; @@ -194,12 +194,12 @@ class Canvas : public View { bool isSingleSelection(); int selectionSize(); Tool tool() const { return _tool; } - Part* part() const { return curPart; } - void setCurrentPart(Part*); + MusECore::Part* part() const { return curPart; } + void setCurrentPart(MusECore::Part*); void setCanvasTools(int n) { canvasTools = n; } }; -} // namespace MusEWidget +} // namespace MusEGui #endif diff --git a/muse2/muse/widgets/checkbox.cpp b/muse2/muse/widgets/checkbox.cpp index def23730..66ef129b 100644 --- a/muse2/muse/widgets/checkbox.cpp +++ b/muse2/muse/widgets/checkbox.cpp @@ -24,7 +24,7 @@ #include <QMouseEvent> -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // CheckBox @@ -73,4 +73,4 @@ void CheckBox::mouseReleaseEvent(QMouseEvent *e) emit checkboxReleased(_id); } -} // namespace MusEWidget +} // namespace MusEGui diff --git a/muse2/muse/widgets/checkbox.h b/muse2/muse/widgets/checkbox.h index d50b31d3..f486f3b6 100644 --- a/muse2/muse/widgets/checkbox.h +++ b/muse2/muse/widgets/checkbox.h @@ -25,7 +25,7 @@ #include <QCheckBox> -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // CheckBox @@ -56,7 +56,7 @@ class CheckBox : public QCheckBox { void setId(int i) { _id = i; } }; -} // namespace MusEWidget +} // namespace MusEGui #endif diff --git a/muse2/muse/widgets/citem.cpp b/muse2/muse/widgets/citem.cpp index 1fe861a0..4c830223 100644 --- a/muse2/muse/widgets/citem.cpp +++ b/muse2/muse/widgets/citem.cpp @@ -24,7 +24,7 @@ #include "citem.h" #include <stdio.h> -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // CItem @@ -43,8 +43,8 @@ CItem::CItem(const QPoint&p, const QRect& r) } // Changed by Tim. p3.3.20 -//CItem::CItem(Event e, Part* p) -CItem::CItem(const Event& e, Part* p) +//CItem::CItem(MusECore::Event e, Part* p) +CItem::CItem(const MusECore::Event& e, MusECore::Part* p) { _event = e; _part = p; @@ -108,4 +108,4 @@ void CItemList::add(CItem* item) std::multimap<int, CItem*, std::less<int> >::insert(std::pair<const int, CItem*> (item->bbox().x(), item)); } -} // namespace MusEWidget +} // namespace MusEGui diff --git a/muse2/muse/widgets/citem.h b/muse2/muse/widgets/citem.h index e2ddd8a0..1777eb23 100644 --- a/muse2/muse/widgets/citem.h +++ b/muse2/muse/widgets/citem.h @@ -29,10 +29,11 @@ #include "event.h" -class Event; +namespace MusECore { class Part; +} -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // CItem @@ -41,8 +42,8 @@ namespace MusEWidget { class CItem { private: - Event _event; - Part* _part; + MusECore::Event _event; + MusECore::Part* _part; protected: bool _isMoving; @@ -54,8 +55,8 @@ class CItem { CItem(const QPoint& p, const QRect& r); CItem(); // Changed by Tim. p3.3.20 - //CItem(Event e, Part* p); - CItem(const Event& e, Part* p); + //CItem(MusECore::Event e, MusECore::Part* p); + CItem(const MusECore::Event& e, MusECore::Part* p); bool isMoving() const { return _isMoving; } void setMoving(bool f) { _isMoving = f; } @@ -82,10 +83,10 @@ class CItem { bool contains(const QPoint& p) const { return _bbox.contains(p); } bool intersects(const QRect& r) const { return r.intersects(_bbox); } - Event event() const { return _event; } - void setEvent(Event& e) { _event = e; } - Part* part() const { return _part; } - void setPart(Part* p) { _part = p; } + MusECore::Event event() const { return _event; } + void setEvent(MusECore::Event& e) { _event = e; } + MusECore::Part* part() const { return _part; } + void setPart(MusECore::Part* p) { _part = p; } }; typedef std::multimap<int, CItem*, std::less<int> >::iterator iCItem; @@ -108,7 +109,7 @@ class CItemList: public std::multimap<int, CItem*, std::less<int> > { } }; -} // namespace MusEWidget +} // namespace MusEGui #endif diff --git a/muse2/muse/widgets/comboQuant.cpp b/muse2/muse/widgets/comboQuant.cpp index c455851a..aee7ad5c 100644 --- a/muse2/muse/widgets/comboQuant.cpp +++ b/muse2/muse/widgets/comboQuant.cpp @@ -28,7 +28,7 @@ #include "comboQuant.h" -namespace MusEWidget { +namespace MusEGui { static int quantTable[] = { 1, 16, 32, 64, 128, 256, 512, 1024, @@ -109,4 +109,4 @@ void ComboQuant::setValue(int val) setCurrentIndex(0); } -} // namespace MusEWidget +} // namespace MusEGui diff --git a/muse2/muse/widgets/comboQuant.h b/muse2/muse/widgets/comboQuant.h index 8e1d80ea..e8d1b462 100644 --- a/muse2/muse/widgets/comboQuant.h +++ b/muse2/muse/widgets/comboQuant.h @@ -30,7 +30,7 @@ class QWidget; class QTableWidget; -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // ComboQuant diff --git a/muse2/muse/widgets/combobox.cpp b/muse2/muse/widgets/combobox.cpp index d32685d0..c85ca750 100644 --- a/muse2/muse/widgets/combobox.cpp +++ b/muse2/muse/widgets/combobox.cpp @@ -26,7 +26,7 @@ #include "combobox.h" -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // ComboBox @@ -105,4 +105,4 @@ void ComboBox::addAction(const QString& s, int id) itemlist << id; } -} // namespace MusEWidget +} // namespace MusEGui diff --git a/muse2/muse/widgets/combobox.h b/muse2/muse/widgets/combobox.h index 8de82989..6f57bd8d 100644 --- a/muse2/muse/widgets/combobox.h +++ b/muse2/muse/widgets/combobox.h @@ -28,7 +28,7 @@ class QMenu; class QSignalMapper; -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // ComboBox @@ -59,7 +59,7 @@ class ComboBox : public QToolButton { void addAction(const QString& s, int id = -1); }; -} // namespace MusEWidget +} // namespace MusEGui #endif diff --git a/muse2/muse/widgets/comment.cpp b/muse2/muse/widgets/comment.cpp index 99fd8487..f070cac0 100644 --- a/muse2/muse/widgets/comment.cpp +++ b/muse2/muse/widgets/comment.cpp @@ -26,7 +26,7 @@ #include <QWidget> -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // Comment @@ -51,13 +51,13 @@ void Comment::textChanged() // TrackComment //--------------------------------------------------------- -TrackComment::TrackComment(Track* t, QWidget* parent) +TrackComment::TrackComment(MusECore::Track* t, QWidget* parent) : Comment(parent) { setAttribute(Qt::WA_DeleteOnClose); setWindowTitle(tr("MusE: Track Comment")); track = t; - connect(song, SIGNAL(songChanged(int)), SLOT(songChanged(int))); + connect(MusEGlobal::song, SIGNAL(songChanged(int)), SLOT(songChanged(int))); textentry->setText(track->comment()); textentry->moveCursor(QTextCursor::End); connect(textentry, SIGNAL(textChanged()), SLOT(textChanged())); @@ -75,8 +75,8 @@ void TrackComment::songChanged(int flags) return; // check if track still exists: - TrackList* tl = song->tracks(); - iTrack it; + MusECore::TrackList* tl = MusEGlobal::song->tracks(); + MusECore::iTrack it; for (it = tl->begin(); it != tl->end(); ++it) { if (track == *it) break; @@ -101,7 +101,7 @@ void TrackComment::songChanged(int flags) void TrackComment::setText(const QString& s) { track->setComment(s); - song->update(SC_TRACK_MODIFIED); + MusEGlobal::song->update(SC_TRACK_MODIFIED); } -} // namespace MusEWidget +} // namespace MusEGui diff --git a/muse2/muse/widgets/comment.h b/muse2/muse/widgets/comment.h index 4fc0bd33..f06757d2 100644 --- a/muse2/muse/widgets/comment.h +++ b/muse2/muse/widgets/comment.h @@ -25,11 +25,15 @@ #include "ui_commentbase.h" +class QWidget; + + +namespace MusECore { class Xml; class Track; -class QWidget; +} -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // Comment @@ -55,7 +59,7 @@ class Comment : public QWidget, public Ui::CommentBase { class TrackComment : public Comment { Q_OBJECT - Track* track; + MusECore::Track* track; private: @@ -65,10 +69,10 @@ class TrackComment : public Comment { void songChanged(int); public: - TrackComment(Track*, QWidget*); + TrackComment(MusECore::Track*, QWidget*); }; -} // namespace MusEWidget +} // namespace MusEGui #endif diff --git a/muse2/muse/widgets/ctrlcombo.cpp b/muse2/muse/widgets/ctrlcombo.cpp index 61a7e50f..c22bab4b 100644 --- a/muse2/muse/widgets/ctrlcombo.cpp +++ b/muse2/muse/widgets/ctrlcombo.cpp @@ -23,7 +23,7 @@ #include "ctrlcombo.h" -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // CtrlComboBox @@ -71,4 +71,4 @@ CtrlComboBox::CtrlComboBox(QWidget* parent) insertItem(i, QString(ctxt[i])); } -} // namespace MusEWidget +} // namespace MusEGui diff --git a/muse2/muse/widgets/ctrlcombo.h b/muse2/muse/widgets/ctrlcombo.h index dca3d91e..cbeb9a63 100644 --- a/muse2/muse/widgets/ctrlcombo.h +++ b/muse2/muse/widgets/ctrlcombo.h @@ -26,7 +26,7 @@ #include <QComboBox> -namespace MusEWidget { +namespace MusEGui { class CtrlComboBox : public QComboBox { Q_OBJECT @@ -34,7 +34,7 @@ class CtrlComboBox : public QComboBox { CtrlComboBox(QWidget* parent); }; -} // namespace MusEWidget +} // namespace MusEGui #endif diff --git a/muse2/muse/widgets/dentry.cpp b/muse2/muse/widgets/dentry.cpp index 7c7237f7..ddaa5ffd 100644 --- a/muse2/muse/widgets/dentry.cpp +++ b/muse2/muse/widgets/dentry.cpp @@ -36,7 +36,7 @@ #define TIMEC2 20 #define TIMER4 50 -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // Dentry @@ -173,7 +173,7 @@ void Dentry::repeat() switch (button) { case Qt::LeftButton: - if (!MusEConfig::config.leftMouseButtonCanDecrease) + if (!MusEGlobal::config.leftMouseButtonCanDecrease) return; // else fall through case Qt::MidButton: @@ -260,4 +260,4 @@ void Dentry::setValue(double v) val = v; } -} // namespace MusEWidget +} // namespace MusEGui diff --git a/muse2/muse/widgets/dentry.h b/muse2/muse/widgets/dentry.h index 1e429187..7ad62866 100644 --- a/muse2/muse/widgets/dentry.h +++ b/muse2/muse/widgets/dentry.h @@ -27,7 +27,7 @@ #include "sliderbase.h" -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // Dentry @@ -88,6 +88,6 @@ class Dentry : public QLineEdit { void setSlider(SliderBase* s) { _slider = s; } }; -} // namespace MusEWidget +} // namespace MusEGui #endif diff --git a/muse2/muse/widgets/didyouknow.h b/muse2/muse/widgets/didyouknow.h index 212e9254..b117b121 100644 --- a/muse2/muse/widgets/didyouknow.h +++ b/muse2/muse/widgets/didyouknow.h @@ -23,7 +23,7 @@ class QDialog; -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // DidYouKnowWidget @@ -38,4 +38,4 @@ class DidYouKnowWidget : public QDialog, public Ui::DidYouKnow DidYouKnowWidget(QDialog *parent = 0) : QDialog(parent) { setupUi(this); } }; -} // namespace MusEWidget +} // namespace MusEGui diff --git a/muse2/muse/widgets/dimap.cpp b/muse2/muse/widgets/dimap.cpp index 7fff9115..5a3e540a 100644 --- a/muse2/muse/widgets/dimap.cpp +++ b/muse2/muse/widgets/dimap.cpp @@ -26,7 +26,7 @@ #include "dimap.h" #include "mmath.h" -namespace MusEWidget { +namespace MusEGui { const double DiMap::LogMin = 1.0e-150; const double DiMap::LogMax = 1.0e150; @@ -113,7 +113,7 @@ DiMap::~DiMap() bool DiMap::contains(double x) const { - return ( (x >= MusEUtil::qwtMin(d_x1, d_x1)) && (x <= MusEUtil::qwtMax(d_x1, d_x2))); + return ( (x >= MusECore::qwtMin(d_x1, d_x1)) && (x <= MusECore::qwtMax(d_x1, d_x2))); } //------------------------------------------------------------ @@ -130,7 +130,7 @@ bool DiMap::contains(double x) const bool DiMap::contains(int x) const { - return ( (x >= MusEUtil::qwtMin(d_y1, d_y1)) && (x <= MusEUtil::qwtMax(d_y1, d_y2))); + return ( (x >= MusECore::qwtMin(d_y1, d_y1)) && (x <= MusECore::qwtMax(d_y1, d_y2))); } //------------------------------------------------------------ @@ -269,10 +269,10 @@ double DiMap::invTransform(int y) const int DiMap::limTransform(double x) const { - if ( x > MusEUtil::qwtMax(d_x1, d_x2) ) - x = MusEUtil::qwtMax(d_x1, d_x2); - else if ( x < MusEUtil::qwtMin(d_x1, d_x2)) - x = MusEUtil::qwtMin(d_x1, d_x2); + if ( x > MusECore::qwtMax(d_x1, d_x2) ) + x = MusECore::qwtMax(d_x1, d_x2); + else if ( x < MusECore::qwtMin(d_x1, d_x2)) + x = MusECore::qwtMin(d_x1, d_x2); return transform(x); } @@ -320,4 +320,4 @@ void DiMap::newFactor() d_cnv = 0.0; } -} // namespace MusEWidget +} // namespace MusEGui diff --git a/muse2/muse/widgets/dimap.h b/muse2/muse/widgets/dimap.h index fc522b4e..42efbc64 100644 --- a/muse2/muse/widgets/dimap.h +++ b/muse2/muse/widgets/dimap.h @@ -27,7 +27,7 @@ #include <QtGlobal> -namespace MusEWidget { +namespace MusEGui { class DiMap { @@ -65,6 +65,6 @@ class DiMap bool logarithmic() const { return d_log;} }; -} // namespace MusEWidget +} // namespace MusEGui #endif diff --git a/muse2/muse/widgets/doublelabel.cpp b/muse2/muse/widgets/doublelabel.cpp index 00d9e2fa..dbf7e035 100644 --- a/muse2/muse/widgets/doublelabel.cpp +++ b/muse2/muse/widgets/doublelabel.cpp @@ -24,7 +24,7 @@ #include "doublelabel.h" -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // DoubleLabel @@ -209,4 +209,4 @@ QSize DoubleLabel::minimumSizeHint() const return sizeHint(); } -} // namespace MusEWidget +} // namespace MusEGui diff --git a/muse2/muse/widgets/doublelabel.h b/muse2/muse/widgets/doublelabel.h index d02546e6..bfec39c1 100644 --- a/muse2/muse/widgets/doublelabel.h +++ b/muse2/muse/widgets/doublelabel.h @@ -25,7 +25,7 @@ #include "dentry.h" -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // DoubleLabel @@ -75,6 +75,6 @@ class DoubleLabel : public Dentry { void setSuffix(const QString& s) { _suffix = s; } }; -} // namespace MusEWidget +} // namespace MusEGui #endif diff --git a/muse2/muse/widgets/drange.cpp b/muse2/muse/widgets/drange.cpp index 18868b2c..7669c18c 100644 --- a/muse2/muse/widgets/drange.cpp +++ b/muse2/muse/widgets/drange.cpp @@ -29,7 +29,7 @@ #include "mmath.h" #include "drange.h" -namespace MusEWidget { +namespace MusEGui { const double DoubleRange::MinRelStep = 1.0e-10; const double DoubleRange::DefaultRelStep = 1.0e-2; @@ -73,8 +73,8 @@ void DoubleRange::setNewValue(double x, bool align) { d_prevValue = d_value; - double vmin = MusEUtil::qwtMin(d_minValue, d_maxValue); - double vmax = MusEUtil::qwtMax(d_minValue, d_maxValue); + double vmin = MusECore::qwtMin(d_minValue, d_maxValue); + double vmax = MusECore::qwtMax(d_minValue, d_maxValue); // Range check @@ -106,11 +106,11 @@ void DoubleRange::setNewValue(double x, bool align) d_value = d_minValue; // correct rounding error at the border - if (fabs(d_value - d_maxValue) < MinEps * MusEUtil::qwtAbs(d_step)) + if (fabs(d_value - d_maxValue) < MinEps * MusECore::qwtAbs(d_step)) d_value = d_maxValue; // correct rounding error if value = 0 - if (fabs(d_value) < MinEps * MusEUtil::qwtAbs(d_step)) + if (fabs(d_value) < MinEps * MusECore::qwtAbs(d_step)) d_value = 0.0; } if (d_prevValue != d_value) @@ -179,7 +179,7 @@ void DoubleRange::setRange(double vmin, double vmax, double vstep, int pageSize) // // limit page size // - d_pageSize = MusEUtil::qwtLim(pageSize,0, int(MusEUtil::qwtAbs((d_maxValue - d_minValue) / d_step))); + d_pageSize = MusECore::qwtLim(pageSize,0, int(MusECore::qwtAbs((d_maxValue - d_minValue) / d_step))); // // If the value lies out of the range, it @@ -273,7 +273,7 @@ void DoubleRange::incPages(int nPages) double DoubleRange::step() const { - return MusEUtil::qwtAbs(d_step); + return MusECore::qwtAbs(d_step); } -} // namespace MusEWidget +} // namespace MusEGui diff --git a/muse2/muse/widgets/drange.h b/muse2/muse/widgets/drange.h index 938b70c6..76432f50 100644 --- a/muse2/muse/widgets/drange.h +++ b/muse2/muse/widgets/drange.h @@ -25,7 +25,7 @@ #ifndef __DOUBLE_RANGE_H__ #define __DOUBLE_RANGE_H__ -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // DoubleRange @@ -79,6 +79,6 @@ class DoubleRange double step() const; }; -} // namespace MusEWidget +} // namespace MusEGui #endif diff --git a/muse2/muse/widgets/editnotedialogbase.ui b/muse2/muse/widgets/editnotedialogbase.ui index 165bdf02..afc56f6d 100644 --- a/muse2/muse/widgets/editnotedialogbase.ui +++ b/muse2/muse/widgets/editnotedialogbase.ui @@ -156,7 +156,7 @@ </widget> </item> <item row="2" column="1"> - <widget class="MusEWidget::PitchEdit" name="pl" native="true"/> + <widget class="MusEGui::PitchEdit" name="pl" native="true"/> </item> </layout> </widget> @@ -169,7 +169,7 @@ <container>0</container> </customwidget> <customwidget> - <class>MusEWidget::PitchEdit</class> + <class>MusEGui::PitchEdit</class> <extends>QWidget</extends> <header>pitchedit.h</header> </customwidget> diff --git a/muse2/muse/widgets/filedialog.cpp b/muse2/muse/widgets/filedialog.cpp index 4e3c1fb2..df391b45 100644 --- a/muse2/muse/widgets/filedialog.cpp +++ b/muse2/muse/widgets/filedialog.cpp @@ -34,7 +34,7 @@ #include "../globals.h" #include "gconfig.h" -namespace MusEWidget { +namespace MusEGui { MFileDialog::ViewType MFileDialog::lastViewUsed = GLOBAL_VIEW; //QString MFileDialog::lastUserDir = ""; @@ -149,7 +149,7 @@ void MFileDialog::projectToggled(bool flag) // if project path is uninitialized, meaning it is still set to museProjectInitPath. // then project path is set to current pwd instead. //s = QString(getcwd(0,0)) + QString("/"); - s = MusEConfig::config.projectBaseFolder; + s = MusEGlobal::config.projectBaseFolder; } else s = MusEGlobal::museProject + QString("/"); // + baseDir; @@ -563,4 +563,4 @@ FILE* MFile::open(const char* mode, const QStringList& pattern, return f; } -} // namespace MusEWidget +} // namespace MusEGui diff --git a/muse2/muse/widgets/filedialog.h b/muse2/muse/widgets/filedialog.h index 74297210..e5687494 100644 --- a/muse2/muse/widgets/filedialog.h +++ b/muse2/muse/widgets/filedialog.h @@ -26,7 +26,7 @@ class QStringList; -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // FileDialogButtonsWidget @@ -125,4 +125,4 @@ class MFile { bool warnIfOverwrite, const QString& caption); }; -} // namespace MusEWidget +} // namespace MusEGui diff --git a/muse2/muse/widgets/function_dialogs/crescendo.cpp b/muse2/muse/widgets/function_dialogs/crescendo.cpp index f8245b24..fa94f58e 100644 --- a/muse2/muse/widgets/function_dialogs/crescendo.cpp +++ b/muse2/muse/widgets/function_dialogs/crescendo.cpp @@ -24,7 +24,7 @@ #include "crescendo.h" #include "xml.h" -namespace MusEDialog { +namespace MusEGui { Crescendo::Crescendo(QWidget* parent) : QDialog(parent) @@ -66,18 +66,18 @@ int Crescendo::exec() return QDialog::exec(); } -void Crescendo::read_configuration(Xml& xml) +void Crescendo::read_configuration(MusECore::Xml& xml) { for (;;) { - Xml::Token token = xml.parse(); - if (token == Xml::Error || token == Xml::End) + MusECore::Xml::Token token = xml.parse(); + if (token == MusECore::Xml::Error || token == MusECore::Xml::End) break; const QString& tag = xml.s1(); switch (token) { - case Xml::TagStart: + case MusECore::Xml::TagStart: if (tag == "range") range=xml.parseInt(); else if (tag == "start") @@ -90,7 +90,7 @@ void Crescendo::read_configuration(Xml& xml) xml.unknown("Crescendo"); break; - case Xml::TagEnd: + case MusECore::Xml::TagEnd: if (tag == "crescendo") return; @@ -100,7 +100,7 @@ void Crescendo::read_configuration(Xml& xml) } } -void Crescendo::write_configuration(int level, Xml& xml) +void Crescendo::write_configuration(int level, MusECore::Xml& xml) { xml.tag(level++, "crescendo"); xml.intTag(level, "range", range); @@ -128,4 +128,4 @@ void Crescendo::absolute_changed(bool val) } } -} // namespace MusEDialog +} // namespace MusEGui diff --git a/muse2/muse/widgets/function_dialogs/crescendo.h b/muse2/muse/widgets/function_dialogs/crescendo.h index c0871ab8..ccd3030e 100644 --- a/muse2/muse/widgets/function_dialogs/crescendo.h +++ b/muse2/muse/widgets/function_dialogs/crescendo.h @@ -26,9 +26,12 @@ #include "ui_crescendobase.h" class QButtonGroup; + +namespace MusECore { class Xml; +} -namespace MusEDialog { +namespace MusEGui { class Crescendo : public QDialog, public Ui::CrescendoBase { @@ -49,8 +52,8 @@ class Crescendo : public QDialog, public Ui::CrescendoBase int end_val; bool absolute; - void read_configuration(Xml& xml); - void write_configuration(int level, Xml& xml); + void read_configuration(MusECore::Xml& xml); + void write_configuration(int level, MusECore::Xml& xml); public slots: @@ -60,7 +63,7 @@ class Crescendo : public QDialog, public Ui::CrescendoBase void absolute_changed(bool); }; -} // namespace MusEDialog +} // namespace MusEGui #endif diff --git a/muse2/muse/widgets/function_dialogs/deloverlaps.cpp b/muse2/muse/widgets/function_dialogs/deloverlaps.cpp index 0841b6e9..b6a0bf3f 100644 --- a/muse2/muse/widgets/function_dialogs/deloverlaps.cpp +++ b/muse2/muse/widgets/function_dialogs/deloverlaps.cpp @@ -24,7 +24,7 @@ #include "deloverlaps.h" #include "xml.h" -namespace MusEDialog { +namespace MusEGui { DelOverlaps::DelOverlaps(QWidget* parent) : QDialog(parent) @@ -59,25 +59,25 @@ int DelOverlaps::exec() return QDialog::exec(); } -void DelOverlaps::read_configuration(Xml& xml) +void DelOverlaps::read_configuration(MusECore::Xml& xml) { for (;;) { - Xml::Token token = xml.parse(); - if (token == Xml::Error || token == Xml::End) + MusECore::Xml::Token token = xml.parse(); + if (token == MusECore::Xml::Error || token == MusECore::Xml::End) break; const QString& tag = xml.s1(); switch (token) { - case Xml::TagStart: + case MusECore::Xml::TagStart: if (tag == "range") range=xml.parseInt(); else xml.unknown("DelOverlaps"); break; - case Xml::TagEnd: + case MusECore::Xml::TagEnd: if (tag == "del_overlaps") return; @@ -87,11 +87,11 @@ void DelOverlaps::read_configuration(Xml& xml) } } -void DelOverlaps::write_configuration(int level, Xml& xml) +void DelOverlaps::write_configuration(int level, MusECore::Xml& xml) { xml.tag(level++, "del_overlaps"); xml.intTag(level, "range", range); xml.tag(level, "/del_overlaps"); } -} // namespace MusEDialog +} // namespace MusEGui diff --git a/muse2/muse/widgets/function_dialogs/deloverlaps.h b/muse2/muse/widgets/function_dialogs/deloverlaps.h index 2fc470cd..0036a2d4 100644 --- a/muse2/muse/widgets/function_dialogs/deloverlaps.h +++ b/muse2/muse/widgets/function_dialogs/deloverlaps.h @@ -26,9 +26,12 @@ #include "ui_deloverlapsbase.h" class QButtonGroup; + +namespace MusECore { class Xml; +} -namespace MusEDialog { +namespace MusEGui { class DelOverlaps : public QDialog, public Ui::DelOverlapsBase { @@ -46,14 +49,14 @@ class DelOverlaps : public QDialog, public Ui::DelOverlapsBase int range; - void read_configuration(Xml& xml); - void write_configuration(int level, Xml& xml); + void read_configuration(MusECore::Xml& xml); + void write_configuration(int level, MusECore::Xml& xml); public slots: int exec(); }; -} // namespace MusEDialog +} // namespace MusEGui #endif diff --git a/muse2/muse/widgets/function_dialogs/gatetime.cpp b/muse2/muse/widgets/function_dialogs/gatetime.cpp index 537260ca..987e53a5 100644 --- a/muse2/muse/widgets/function_dialogs/gatetime.cpp +++ b/muse2/muse/widgets/function_dialogs/gatetime.cpp @@ -28,7 +28,7 @@ #include "xml.h" #include "song.h" -namespace MusEDialog { +namespace MusEGui { //--------------------------------------------------------- // GateTime @@ -83,18 +83,18 @@ int GateTime::exec() } -void GateTime::read_configuration(Xml& xml) +void GateTime::read_configuration(MusECore::Xml& xml) { for (;;) { - Xml::Token token = xml.parse(); - if (token == Xml::Error || token == Xml::End) + MusECore::Xml::Token token = xml.parse(); + if (token == MusECore::Xml::Error || token == MusECore::Xml::End) break; const QString& tag = xml.s1(); switch (token) { - case Xml::TagStart: + case MusECore::Xml::TagStart: if (tag == "range") range=xml.parseInt(); else if (tag == "rate") @@ -105,7 +105,7 @@ void GateTime::read_configuration(Xml& xml) xml.unknown("ModLen"); break; - case Xml::TagEnd: + case MusECore::Xml::TagEnd: if (tag == "mod_len") return; @@ -115,7 +115,7 @@ void GateTime::read_configuration(Xml& xml) } } -void GateTime::write_configuration(int level, Xml& xml) +void GateTime::write_configuration(int level, MusECore::Xml& xml) { xml.tag(level++, "mod_len"); xml.intTag(level, "range", range); @@ -124,4 +124,4 @@ void GateTime::write_configuration(int level, Xml& xml) xml.tag(level, "/mod_len"); } -} // namespace MusEDialog +} // namespace MusEGui diff --git a/muse2/muse/widgets/function_dialogs/gatetime.h b/muse2/muse/widgets/function_dialogs/gatetime.h index 20d28948..b0c3987b 100644 --- a/muse2/muse/widgets/function_dialogs/gatetime.h +++ b/muse2/muse/widgets/function_dialogs/gatetime.h @@ -26,9 +26,12 @@ #include "ui_gatetimebase.h" class QButtonGroup; + +namespace MusECore { class Xml; +} -namespace MusEDialog { +namespace MusEGui { //--------------------------------------------------------- // GateTime @@ -51,15 +54,15 @@ class GateTime : public QDialog, public Ui::GateTimeBase { int rateVal; int offsetVal; - void read_configuration(Xml& xml); - void write_configuration(int level, Xml& xml); + void read_configuration(MusECore::Xml& xml); + void write_configuration(int level, MusECore::Xml& xml); public slots: int exec(); }; -} // namespace MusEDialog +} // namespace MusEGui #endif diff --git a/muse2/muse/widgets/function_dialogs/legato.cpp b/muse2/muse/widgets/function_dialogs/legato.cpp index 5ca6e29b..0d31017c 100644 --- a/muse2/muse/widgets/function_dialogs/legato.cpp +++ b/muse2/muse/widgets/function_dialogs/legato.cpp @@ -24,7 +24,7 @@ #include "legato.h" #include "xml.h" -namespace MusEDialog { +namespace MusEGui { Legato::Legato(QWidget* parent) : QDialog(parent) @@ -63,18 +63,18 @@ int Legato::exec() return QDialog::exec(); } -void Legato::read_configuration(Xml& xml) +void Legato::read_configuration(MusECore::Xml& xml) { for (;;) { - Xml::Token token = xml.parse(); - if (token == Xml::Error || token == Xml::End) + MusECore::Xml::Token token = xml.parse(); + if (token == MusECore::Xml::Error || token == MusECore::Xml::End) break; const QString& tag = xml.s1(); switch (token) { - case Xml::TagStart: + case MusECore::Xml::TagStart: if (tag == "range") range=xml.parseInt(); else if (tag == "min_len") @@ -85,7 +85,7 @@ void Legato::read_configuration(Xml& xml) xml.unknown("Legato"); break; - case Xml::TagEnd: + case MusECore::Xml::TagEnd: if (tag == "legato") return; @@ -95,7 +95,7 @@ void Legato::read_configuration(Xml& xml) } } -void Legato::write_configuration(int level, Xml& xml) +void Legato::write_configuration(int level, MusECore::Xml& xml) { xml.tag(level++, "legato"); xml.intTag(level, "range", range); @@ -104,4 +104,4 @@ void Legato::write_configuration(int level, Xml& xml) xml.tag(level, "/legato"); } -} // namespace MusEDialog +} // namespace MusEGui diff --git a/muse2/muse/widgets/function_dialogs/legato.h b/muse2/muse/widgets/function_dialogs/legato.h index c2cbeabc..1c25fef1 100644 --- a/muse2/muse/widgets/function_dialogs/legato.h +++ b/muse2/muse/widgets/function_dialogs/legato.h @@ -26,9 +26,12 @@ #include "ui_legatobase.h" class QButtonGroup; + +namespace MusECore { class Xml; +} -namespace MusEDialog { +namespace MusEGui { class Legato : public QDialog, public Ui::LegatoBase { @@ -48,15 +51,15 @@ class Legato : public QDialog, public Ui::LegatoBase int min_len; bool allow_shortening; - void read_configuration(Xml& xml); - void write_configuration(int level, Xml& xml); + void read_configuration(MusECore::Xml& xml); + void write_configuration(int level, MusECore::Xml& xml); public slots: int exec(); }; -} // namespace MusEDialog +} // namespace MusEGui #endif diff --git a/muse2/muse/widgets/function_dialogs/move.cpp b/muse2/muse/widgets/function_dialogs/move.cpp index 2529cb68..e0a1fddf 100644 --- a/muse2/muse/widgets/function_dialogs/move.cpp +++ b/muse2/muse/widgets/function_dialogs/move.cpp @@ -24,7 +24,7 @@ #include "move.h" #include "xml.h" -namespace MusEDialog { +namespace MusEGui { Move::Move(QWidget* parent) : QDialog(parent) @@ -62,18 +62,18 @@ int Move::exec() } -void Move::read_configuration(Xml& xml) +void Move::read_configuration(MusECore::Xml& xml) { for (;;) { - Xml::Token token = xml.parse(); - if (token == Xml::Error || token == Xml::End) + MusECore::Xml::Token token = xml.parse(); + if (token == MusECore::Xml::Error || token == MusECore::Xml::End) break; const QString& tag = xml.s1(); switch (token) { - case Xml::TagStart: + case MusECore::Xml::TagStart: if (tag == "range") range=xml.parseInt(); else if (tag == "amount") @@ -82,7 +82,7 @@ void Move::read_configuration(Xml& xml) xml.unknown("Move"); break; - case Xml::TagEnd: + case MusECore::Xml::TagEnd: if (tag == "move") return; @@ -92,7 +92,7 @@ void Move::read_configuration(Xml& xml) } } -void Move::write_configuration(int level, Xml& xml) +void Move::write_configuration(int level, MusECore::Xml& xml) { xml.tag(level++, "move"); xml.intTag(level, "range", range); @@ -100,4 +100,4 @@ void Move::write_configuration(int level, Xml& xml) xml.tag(level, "/move"); } -} // namespace MusEDialog +} // namespace MusEGui diff --git a/muse2/muse/widgets/function_dialogs/move.h b/muse2/muse/widgets/function_dialogs/move.h index 39718134..c3c8b83c 100644 --- a/muse2/muse/widgets/function_dialogs/move.h +++ b/muse2/muse/widgets/function_dialogs/move.h @@ -26,9 +26,12 @@ #include "ui_movebase.h" class QButtonGroup; + +namespace MusECore { class Xml; +} -namespace MusEDialog { +namespace MusEGui { class Move : public QDialog, public Ui::MoveBase { @@ -47,15 +50,15 @@ class Move : public QDialog, public Ui::MoveBase int range; int amount; - void read_configuration(Xml& xml); - void write_configuration(int level, Xml& xml); + void read_configuration(MusECore::Xml& xml); + void write_configuration(int level, MusECore::Xml& xml); public slots: int exec(); }; -} // namespace MusEDialog +} // namespace MusEGui #endif diff --git a/muse2/muse/widgets/function_dialogs/quantize.cpp b/muse2/muse/widgets/function_dialogs/quantize.cpp index 0841e106..df7c0298 100644 --- a/muse2/muse/widgets/function_dialogs/quantize.cpp +++ b/muse2/muse/widgets/function_dialogs/quantize.cpp @@ -24,7 +24,7 @@ #include "quantize.h" #include "xml.h" -namespace MusEDialog { +namespace MusEGui { Quantize::Quantize(QWidget* parent) : QDialog(parent) @@ -69,18 +69,18 @@ int Quantize::exec() return QDialog::exec(); } -void Quantize::read_configuration(Xml& xml) +void Quantize::read_configuration(MusECore::Xml& xml) { for (;;) { - Xml::Token token = xml.parse(); - if (token == Xml::Error || token == Xml::End) + MusECore::Xml::Token token = xml.parse(); + if (token == MusECore::Xml::Error || token == MusECore::Xml::End) break; const QString& tag = xml.s1(); switch (token) { - case Xml::TagStart: + case MusECore::Xml::TagStart: if (tag == "range") range=xml.parseInt(); else if (tag == "strength") @@ -97,7 +97,7 @@ void Quantize::read_configuration(Xml& xml) xml.unknown("Quantize"); break; - case Xml::TagEnd: + case MusECore::Xml::TagEnd: if (tag == "quantize") return; @@ -107,7 +107,7 @@ void Quantize::read_configuration(Xml& xml) } } -void Quantize::write_configuration(int level, Xml& xml) +void Quantize::write_configuration(int level, MusECore::Xml& xml) { xml.tag(level++, "quantize"); xml.intTag(level, "range", range); @@ -119,5 +119,5 @@ void Quantize::write_configuration(int level, Xml& xml) xml.tag(level, "/quantize"); } -} // namespace MusEDialog +} // namespace MusEGui diff --git a/muse2/muse/widgets/function_dialogs/quantize.h b/muse2/muse/widgets/function_dialogs/quantize.h index 69498810..6ce74215 100644 --- a/muse2/muse/widgets/function_dialogs/quantize.h +++ b/muse2/muse/widgets/function_dialogs/quantize.h @@ -26,9 +26,12 @@ #include "ui_quantbase.h" class QButtonGroup; + +namespace MusECore { class Xml; +} -namespace MusEDialog { +namespace MusEGui { class Quantize : public QDialog, public Ui::QuantBase { @@ -51,15 +54,15 @@ class Quantize : public QDialog, public Ui::QuantBase int swing; bool quant_len; - void read_configuration(Xml& xml); - void write_configuration(int level, Xml& xml); + void read_configuration(MusECore::Xml& xml); + void write_configuration(int level, MusECore::Xml& xml); public slots: int exec(); }; -} // namespace MusEDialog +} // namespace MusEGui #endif diff --git a/muse2/muse/widgets/function_dialogs/remove.cpp b/muse2/muse/widgets/function_dialogs/remove.cpp index 69558fc3..c0b31ec4 100644 --- a/muse2/muse/widgets/function_dialogs/remove.cpp +++ b/muse2/muse/widgets/function_dialogs/remove.cpp @@ -24,7 +24,7 @@ #include "remove.h" #include "xml.h" -namespace MusEDialog { +namespace MusEGui { Remove::Remove(QWidget* parent) : QDialog(parent) @@ -67,18 +67,18 @@ int Remove::exec() return QDialog::exec(); } -void Remove::read_configuration(Xml& xml) +void Remove::read_configuration(MusECore::Xml& xml) { for (;;) { - Xml::Token token = xml.parse(); - if (token == Xml::Error || token == Xml::End) + MusECore::Xml::Token token = xml.parse(); + if (token == MusECore::Xml::Error || token == MusECore::Xml::End) break; const QString& tag = xml.s1(); switch (token) { - case Xml::TagStart: + case MusECore::Xml::TagStart: if (tag == "range") range=xml.parseInt(); else if (tag == "velo_threshold") @@ -93,7 +93,7 @@ void Remove::read_configuration(Xml& xml) xml.unknown("Erase"); break; - case Xml::TagEnd: + case MusECore::Xml::TagEnd: if (tag == "erase") return; @@ -103,7 +103,7 @@ void Remove::read_configuration(Xml& xml) } } -void Remove::write_configuration(int level, Xml& xml) +void Remove::write_configuration(int level, MusECore::Xml& xml) { xml.tag(level++, "erase"); xml.intTag(level, "range", range); @@ -114,5 +114,5 @@ void Remove::write_configuration(int level, Xml& xml) xml.tag(level, "/erase"); } -} // namespace MusEDialog +} // namespace MusEGui diff --git a/muse2/muse/widgets/function_dialogs/remove.h b/muse2/muse/widgets/function_dialogs/remove.h index aba05909..a572be62 100644 --- a/muse2/muse/widgets/function_dialogs/remove.h +++ b/muse2/muse/widgets/function_dialogs/remove.h @@ -26,9 +26,12 @@ #include "ui_removebase.h" class QButtonGroup; + +namespace MusECore { class Xml; +} -namespace MusEDialog { +namespace MusEGui { class Remove : public QDialog, public Ui::RemoveBase { @@ -50,15 +53,15 @@ class Remove : public QDialog, public Ui::RemoveBase int len_threshold; bool len_thres_used; - void read_configuration(Xml& xml); - void write_configuration(int level, Xml& xml); + void read_configuration(MusECore::Xml& xml); + void write_configuration(int level, MusECore::Xml& xml); public slots: int exec(); }; -} // namespace MusEDialog +} // namespace MusEGui #endif diff --git a/muse2/muse/widgets/function_dialogs/setlen.cpp b/muse2/muse/widgets/function_dialogs/setlen.cpp index 81a589ae..4154f8e5 100644 --- a/muse2/muse/widgets/function_dialogs/setlen.cpp +++ b/muse2/muse/widgets/function_dialogs/setlen.cpp @@ -24,7 +24,7 @@ #include "setlen.h" #include "xml.h" -namespace MusEDialog { +namespace MusEGui { Setlen::Setlen(QWidget* parent) : QDialog(parent) @@ -61,18 +61,18 @@ int Setlen::exec() return QDialog::exec(); } -void Setlen::read_configuration(Xml& xml) +void Setlen::read_configuration(MusECore::Xml& xml) { for (;;) { - Xml::Token token = xml.parse(); - if (token == Xml::Error || token == Xml::End) + MusECore::Xml::Token token = xml.parse(); + if (token == MusECore::Xml::Error || token == MusECore::Xml::End) break; const QString& tag = xml.s1(); switch (token) { - case Xml::TagStart: + case MusECore::Xml::TagStart: if (tag == "range") range=xml.parseInt(); else if (tag == "len") @@ -81,7 +81,7 @@ void Setlen::read_configuration(Xml& xml) xml.unknown("SetLen"); break; - case Xml::TagEnd: + case MusECore::Xml::TagEnd: if (tag == "setlen") return; @@ -91,7 +91,7 @@ void Setlen::read_configuration(Xml& xml) } } -void Setlen::write_configuration(int level, Xml& xml) +void Setlen::write_configuration(int level, MusECore::Xml& xml) { xml.tag(level++, "setlen"); xml.intTag(level, "range", range); @@ -99,4 +99,4 @@ void Setlen::write_configuration(int level, Xml& xml) xml.tag(level, "/setlen"); } -} // namespace MusEDialog +} // namespace MusEGui diff --git a/muse2/muse/widgets/function_dialogs/setlen.h b/muse2/muse/widgets/function_dialogs/setlen.h index fea6a5dd..dc577e6b 100644 --- a/muse2/muse/widgets/function_dialogs/setlen.h +++ b/muse2/muse/widgets/function_dialogs/setlen.h @@ -26,9 +26,12 @@ #include "ui_setlenbase.h" class QButtonGroup; + +namespace MusECore { class Xml; +} -namespace MusEDialog { +namespace MusEGui { class Setlen : public QDialog, public Ui::SetlenBase { @@ -47,15 +50,15 @@ class Setlen : public QDialog, public Ui::SetlenBase int range; int len; - void read_configuration(Xml& xml); - void write_configuration(int level, Xml& xml); + void read_configuration(MusECore::Xml& xml); + void write_configuration(int level, MusECore::Xml& xml); public slots: int exec(); }; -} // namespace MusEDialog +} // namespace MusEGui #endif diff --git a/muse2/muse/widgets/function_dialogs/transpose.cpp b/muse2/muse/widgets/function_dialogs/transpose.cpp index dd642050..c4088d99 100644 --- a/muse2/muse/widgets/function_dialogs/transpose.cpp +++ b/muse2/muse/widgets/function_dialogs/transpose.cpp @@ -24,7 +24,7 @@ #include "transpose.h" #include "xml.h" -namespace MusEDialog { +namespace MusEGui { Transpose::Transpose(QWidget* parent) : QDialog(parent) @@ -61,18 +61,18 @@ int Transpose::exec() return QDialog::exec(); } -void Transpose::read_configuration(Xml& xml) +void Transpose::read_configuration(MusECore::Xml& xml) { for (;;) { - Xml::Token token = xml.parse(); - if (token == Xml::Error || token == Xml::End) + MusECore::Xml::Token token = xml.parse(); + if (token == MusECore::Xml::Error || token == MusECore::Xml::End) break; const QString& tag = xml.s1(); switch (token) { - case Xml::TagStart: + case MusECore::Xml::TagStart: if (tag == "range") range=xml.parseInt(); else if (tag == "amount") @@ -81,7 +81,7 @@ void Transpose::read_configuration(Xml& xml) xml.unknown("Transpose"); break; - case Xml::TagEnd: + case MusECore::Xml::TagEnd: if (tag == "transpose") return; @@ -91,7 +91,7 @@ void Transpose::read_configuration(Xml& xml) } } -void Transpose::write_configuration(int level, Xml& xml) +void Transpose::write_configuration(int level, MusECore::Xml& xml) { xml.tag(level++, "transpose"); xml.intTag(level, "range", range); @@ -99,4 +99,4 @@ void Transpose::write_configuration(int level, Xml& xml) xml.tag(level, "/transpose"); } -} // namespace MusEDialog +} // namespace MusEGui diff --git a/muse2/muse/widgets/function_dialogs/transpose.h b/muse2/muse/widgets/function_dialogs/transpose.h index b6363ae5..5e0bd82f 100644 --- a/muse2/muse/widgets/function_dialogs/transpose.h +++ b/muse2/muse/widgets/function_dialogs/transpose.h @@ -26,9 +26,12 @@ #include "ui_transposebase.h" class QButtonGroup; + +namespace MusECore { class Xml; +} -namespace MusEDialog { +namespace MusEGui { class Transpose : public QDialog, public Ui::TransposeBase { @@ -45,15 +48,15 @@ class Transpose : public QDialog, public Ui::TransposeBase int range; int amount; - void read_configuration(Xml& xml); - void write_configuration(int level, Xml& xml); + void read_configuration(MusECore::Xml& xml); + void write_configuration(int level, MusECore::Xml& xml); public slots: int exec(); }; -} // namespace MusEDialog +} // namespace MusEGui #endif diff --git a/muse2/muse/widgets/function_dialogs/velocity.cpp b/muse2/muse/widgets/function_dialogs/velocity.cpp index 81655b5f..2db17b6d 100644 --- a/muse2/muse/widgets/function_dialogs/velocity.cpp +++ b/muse2/muse/widgets/function_dialogs/velocity.cpp @@ -24,7 +24,7 @@ #include "velocity.h" #include "xml.h" -namespace MusEDialog { +namespace MusEGui { //--------------------------------------------------------- // Velocity @@ -77,18 +77,18 @@ int Velocity::exec() return QDialog::exec(); } -void Velocity::read_configuration(Xml& xml) +void Velocity::read_configuration(MusECore::Xml& xml) { for (;;) { - Xml::Token token = xml.parse(); - if (token == Xml::Error || token == Xml::End) + MusECore::Xml::Token token = xml.parse(); + if (token == MusECore::Xml::Error || token == MusECore::Xml::End) break; const QString& tag = xml.s1(); switch (token) { - case Xml::TagStart: + case MusECore::Xml::TagStart: if (tag == "range") range=xml.parseInt(); else if (tag == "rate") @@ -99,7 +99,7 @@ void Velocity::read_configuration(Xml& xml) xml.unknown("ModVelo"); break; - case Xml::TagEnd: + case MusECore::Xml::TagEnd: if (tag == "mod_velo") return; @@ -109,7 +109,7 @@ void Velocity::read_configuration(Xml& xml) } } -void Velocity::write_configuration(int level, Xml& xml) +void Velocity::write_configuration(int level, MusECore::Xml& xml) { xml.tag(level++, "mod_velo"); xml.intTag(level, "range", range); @@ -118,4 +118,4 @@ void Velocity::write_configuration(int level, Xml& xml) xml.tag(level, "/mod_velo"); } -} // namespace MusEDialog +} // namespace MusEGui diff --git a/muse2/muse/widgets/function_dialogs/velocity.h b/muse2/muse/widgets/function_dialogs/velocity.h index 9ef6cd2a..e73b8207 100644 --- a/muse2/muse/widgets/function_dialogs/velocity.h +++ b/muse2/muse/widgets/function_dialogs/velocity.h @@ -26,9 +26,12 @@ #include "ui_velocitybase.h" class QButtonGroup; + +namespace MusECore { class Xml; +} -namespace MusEDialog { +namespace MusEGui { //--------------------------------------------------------- // Velocity @@ -51,15 +54,15 @@ class Velocity : public QDialog, public Ui::VelocityBase { int rateVal; int offsetVal; - void read_configuration(Xml& xml); - void write_configuration(int level, Xml& xml); + void read_configuration(MusECore::Xml& xml); + void write_configuration(int level, MusECore::Xml& xml); public slots: int exec(); }; -} // namespace MusEDialog +} // namespace MusEGui #endif diff --git a/muse2/muse/widgets/genset.cpp b/muse2/muse/widgets/genset.cpp index 1a317d0b..d7642b3b 100644 --- a/muse2/muse/widgets/genset.cpp +++ b/muse2/muse/widgets/genset.cpp @@ -34,7 +34,7 @@ #include "globals.h" #include "icons.h" -namespace MusEWidget { +namespace MusEGui { static int rtcResolutions[] = { 1024, 2048, 4096, 8192, 16384, 32768 @@ -62,51 +62,51 @@ GlobalSettingsConfig::GlobalSettingsConfig(QWidget* parent) startSongGroup->addButton(startEmptyButton, 1); startSongGroup->addButton(startSongButton, 2); for (unsigned i = 0; i < sizeof(rtcResolutions)/sizeof(*rtcResolutions); ++i) { - if (rtcResolutions[i] == MusEConfig::config.rtcTicks) { + if (rtcResolutions[i] == MusEGlobal::config.rtcTicks) { rtcResolutionSelect->setCurrentIndex(i); break; } } for (unsigned i = 0; i < sizeof(divisions)/sizeof(*divisions); ++i) { - if (divisions[i] == MusEConfig::config.division) { + if (divisions[i] == MusEGlobal::config.division) { midiDivisionSelect->setCurrentIndex(i); break; } } for (unsigned i = 0; i < sizeof(divisions)/sizeof(*divisions); ++i) { - if (divisions[i] == MusEConfig::config.guiDivision) { + if (divisions[i] == MusEGlobal::config.guiDivision) { guiDivisionSelect->setCurrentIndex(i); break; } } for (unsigned i = 0; i < sizeof(dummyAudioBufSizes)/sizeof(*dummyAudioBufSizes); ++i) { - if (dummyAudioBufSizes[i] == MusEConfig::config.dummyAudioBufSize) { + if (dummyAudioBufSizes[i] == MusEGlobal::config.dummyAudioBufSize) { dummyAudioSize->setCurrentIndex(i); break; } } for (unsigned i = 0; i < sizeof(minControlProcessPeriods)/sizeof(*minControlProcessPeriods); ++i) { - if (minControlProcessPeriods[i] == MusEConfig::config.minControlProcessPeriod) { + if (minControlProcessPeriods[i] == MusEGlobal::config.minControlProcessPeriod) { minControlProcessPeriodComboBox->setCurrentIndex(i); break; } } - userInstrumentsPath->setText(MusEConfig::config.userInstrumentsDir); + userInstrumentsPath->setText(MusEGlobal::config.userInstrumentsDir); selectInstrumentsDirButton->setIcon(*openIcon); defaultInstrumentsDirButton->setIcon(*undoIcon); connect(selectInstrumentsDirButton, SIGNAL(clicked()), SLOT(selectInstrumentsPath())); connect(defaultInstrumentsDirButton, SIGNAL(clicked()), SLOT(defaultInstrumentsPath())); - guiRefreshSelect->setValue(MusEConfig::config.guiRefresh); - minSliderSelect->setValue(int(MusEConfig::config.minSlider)); - minMeterSelect->setValue(MusEConfig::config.minMeter); - freewheelCheckBox->setChecked(MusEConfig::config.freewheelMode); - denormalCheckBox->setChecked(MusEConfig::config.useDenormalBias); - outputLimiterCheckBox->setChecked(MusEConfig::config.useOutputLimiter); - vstInPlaceCheckBox->setChecked(MusEConfig::config.vstInPlace); - dummyAudioRate->setValue(MusEConfig::config.dummyAudioSampleRate); + guiRefreshSelect->setValue(MusEGlobal::config.guiRefresh); + minSliderSelect->setValue(int(MusEGlobal::config.minSlider)); + minMeterSelect->setValue(MusEGlobal::config.minMeter); + freewheelCheckBox->setChecked(MusEGlobal::config.freewheelMode); + denormalCheckBox->setChecked(MusEGlobal::config.useDenormalBias); + outputLimiterCheckBox->setChecked(MusEGlobal::config.useOutputLimiter); + vstInPlaceCheckBox->setChecked(MusEGlobal::config.vstInPlace); + dummyAudioRate->setValue(MusEGlobal::config.dummyAudioSampleRate); //DummyAudioDevice* dad = dynamic_cast<DummyAudioDevice*>(audioDevice); //dummyAudioRealRate->setText(dad ? QString().setNum(sampleRate) : "---"); @@ -120,40 +120,40 @@ Period affects midi playback resolution. Shorter periods are desirable.</string> </property> */ - startSongEntry->setText(MusEConfig::config.startSong); - startSongGroup->button(MusEConfig::config.startMode)->setChecked(true); - - showTransport->setChecked(MusEConfig::config.transportVisible); - showBigtime->setChecked(MusEConfig::config.bigTimeVisible); - //showMixer->setChecked(MusEConfig::config.mixerVisible); - showMixer->setChecked(MusEConfig::config.mixer1Visible); - showMixer2->setChecked(MusEConfig::config.mixer2Visible); - - mainX->setValue(MusEConfig::config.geometryMain.x()); - mainY->setValue(MusEConfig::config.geometryMain.y()); - mainW->setValue(MusEConfig::config.geometryMain.width()); - mainH->setValue(MusEConfig::config.geometryMain.height()); - - transportX->setValue(MusEConfig::config.geometryTransport.x()); - transportY->setValue(MusEConfig::config.geometryTransport.y()); - - bigtimeX->setValue(MusEConfig::config.geometryBigTime.x()); - bigtimeY->setValue(MusEConfig::config.geometryBigTime.y()); - bigtimeW->setValue(MusEConfig::config.geometryBigTime.width()); - bigtimeH->setValue(MusEConfig::config.geometryBigTime.height()); - - //mixerX->setValue(MusEConfig::config.geometryMixer.x()); - //mixerY->setValue(MusEConfig::config.geometryMixer.y()); - //mixerW->setValue(MusEConfig::config.geometryMixer.width()); - //mixerH->setValue(MusEConfig::config.geometryMixer.height()); - mixerX->setValue(MusEConfig::config.mixer1.geometry.x()); - mixerY->setValue(MusEConfig::config.mixer1.geometry.y()); - mixerW->setValue(MusEConfig::config.mixer1.geometry.width()); - mixerH->setValue(MusEConfig::config.mixer1.geometry.height()); - mixer2X->setValue(MusEConfig::config.mixer2.geometry.x()); - mixer2Y->setValue(MusEConfig::config.mixer2.geometry.y()); - mixer2W->setValue(MusEConfig::config.mixer2.geometry.width()); - mixer2H->setValue(MusEConfig::config.mixer2.geometry.height()); + startSongEntry->setText(MusEGlobal::config.startSong); + startSongGroup->button(MusEGlobal::config.startMode)->setChecked(true); + + showTransport->setChecked(MusEGlobal::config.transportVisible); + showBigtime->setChecked(MusEGlobal::config.bigTimeVisible); + //showMixer->setChecked(MusEGlobal::config.mixerVisible); + showMixer->setChecked(MusEGlobal::config.mixer1Visible); + showMixer2->setChecked(MusEGlobal::config.mixer2Visible); + + mainX->setValue(MusEGlobal::config.geometryMain.x()); + mainY->setValue(MusEGlobal::config.geometryMain.y()); + mainW->setValue(MusEGlobal::config.geometryMain.width()); + mainH->setValue(MusEGlobal::config.geometryMain.height()); + + transportX->setValue(MusEGlobal::config.geometryTransport.x()); + transportY->setValue(MusEGlobal::config.geometryTransport.y()); + + bigtimeX->setValue(MusEGlobal::config.geometryBigTime.x()); + bigtimeY->setValue(MusEGlobal::config.geometryBigTime.y()); + bigtimeW->setValue(MusEGlobal::config.geometryBigTime.width()); + bigtimeH->setValue(MusEGlobal::config.geometryBigTime.height()); + + //mixerX->setValue(MusEGlobal::config.geometryMixer.x()); + //mixerY->setValue(MusEGlobal::config.geometryMixer.y()); + //mixerW->setValue(MusEGlobal::config.geometryMixer.width()); + //mixerH->setValue(MusEGlobal::config.geometryMixer.height()); + mixerX->setValue(MusEGlobal::config.mixer1.geometry.x()); + mixerY->setValue(MusEGlobal::config.mixer1.geometry.y()); + mixerW->setValue(MusEGlobal::config.mixer1.geometry.width()); + mixerH->setValue(MusEGlobal::config.mixer1.geometry.height()); + mixer2X->setValue(MusEGlobal::config.mixer2.geometry.x()); + mixer2Y->setValue(MusEGlobal::config.mixer2.geometry.y()); + mixer2W->setValue(MusEGlobal::config.mixer2.geometry.width()); + mixer2H->setValue(MusEGlobal::config.mixer2.geometry.height()); //setMixerCurrent->setEnabled(MusEGlobal::muse->mixerWindow()); setMixerCurrent->setEnabled(MusEGlobal::muse->mixer1Window()); @@ -162,15 +162,15 @@ Shorter periods are desirable.</string> setBigtimeCurrent->setEnabled(MusEGlobal::muse->bigtimeWindow()); setTransportCurrent->setEnabled(MusEGlobal::muse->transportWindow()); - showSplash->setChecked(MusEConfig::config.showSplashScreen); - showDidYouKnow->setChecked(MusEConfig::config.showDidYouKnow); - externalWavEditorSelect->setText(MusEConfig::config.externalWavEditor); - oldStyleStopCheckBox->setChecked(MusEConfig::config.useOldStyleStopShortCut); - moveArmedCheckBox->setChecked(MusEConfig::config.moveArmedCheckBox); - projectSaveCheckBox->setChecked(MusEConfig::config.useProjectSaveDialog); - popsDefStayOpenCheckBox->setChecked(MusEConfig::config.popupsDefaultStayOpen); - lmbDecreasesCheckBox->setChecked(MusEConfig::config.leftMouseButtonCanDecrease); - rangeMarkerWithoutMMBCheckBox->setChecked(MusEConfig::config.rangeMarkerWithoutMMB); + showSplash->setChecked(MusEGlobal::config.showSplashScreen); + showDidYouKnow->setChecked(MusEGlobal::config.showDidYouKnow); + externalWavEditorSelect->setText(MusEGlobal::config.externalWavEditor); + oldStyleStopCheckBox->setChecked(MusEGlobal::config.useOldStyleStopShortCut); + moveArmedCheckBox->setChecked(MusEGlobal::config.moveArmedCheckBox); + projectSaveCheckBox->setChecked(MusEGlobal::config.useProjectSaveDialog); + popsDefStayOpenCheckBox->setChecked(MusEGlobal::config.popupsDefaultStayOpen); + lmbDecreasesCheckBox->setChecked(MusEGlobal::config.leftMouseButtonCanDecrease); + rangeMarkerWithoutMMBCheckBox->setChecked(MusEGlobal::config.rangeMarkerWithoutMMB); //updateSettings(); // TESTING @@ -214,84 +214,84 @@ void GlobalSettingsConfig::addMdiSettings(TopWin::ToplevelType t) void GlobalSettingsConfig::updateSettings() { for (unsigned i = 0; i < sizeof(rtcResolutions)/sizeof(*rtcResolutions); ++i) { - if (rtcResolutions[i] == MusEConfig::config.rtcTicks) { + if (rtcResolutions[i] == MusEGlobal::config.rtcTicks) { rtcResolutionSelect->setCurrentIndex(i); break; } } for (unsigned i = 0; i < sizeof(divisions)/sizeof(*divisions); ++i) { - if (divisions[i] == MusEConfig::config.division) { + if (divisions[i] == MusEGlobal::config.division) { midiDivisionSelect->setCurrentIndex(i); break; } } for (unsigned i = 0; i < sizeof(divisions)/sizeof(*divisions); ++i) { - if (divisions[i] == MusEConfig::config.guiDivision) { + if (divisions[i] == MusEGlobal::config.guiDivision) { guiDivisionSelect->setCurrentIndex(i); break; } } for (unsigned i = 0; i < sizeof(dummyAudioBufSizes)/sizeof(*dummyAudioBufSizes); ++i) { - if (dummyAudioBufSizes[i] == MusEConfig::config.dummyAudioBufSize) { + if (dummyAudioBufSizes[i] == MusEGlobal::config.dummyAudioBufSize) { dummyAudioSize->setCurrentIndex(i); break; } } for (unsigned i = 0; i < sizeof(minControlProcessPeriods)/sizeof(*minControlProcessPeriods); ++i) { - if (minControlProcessPeriods[i] == MusEConfig::config.minControlProcessPeriod) { + if (minControlProcessPeriods[i] == MusEGlobal::config.minControlProcessPeriod) { minControlProcessPeriodComboBox->setCurrentIndex(i); break; } } - guiRefreshSelect->setValue(MusEConfig::config.guiRefresh); - minSliderSelect->setValue(int(MusEConfig::config.minSlider)); - minMeterSelect->setValue(MusEConfig::config.minMeter); - freewheelCheckBox->setChecked(MusEConfig::config.freewheelMode); - denormalCheckBox->setChecked(MusEConfig::config.useDenormalBias); - outputLimiterCheckBox->setChecked(MusEConfig::config.useOutputLimiter); - vstInPlaceCheckBox->setChecked(MusEConfig::config.vstInPlace); - dummyAudioRate->setValue(MusEConfig::config.dummyAudioSampleRate); + guiRefreshSelect->setValue(MusEGlobal::config.guiRefresh); + minSliderSelect->setValue(int(MusEGlobal::config.minSlider)); + minMeterSelect->setValue(MusEGlobal::config.minMeter); + freewheelCheckBox->setChecked(MusEGlobal::config.freewheelMode); + denormalCheckBox->setChecked(MusEGlobal::config.useDenormalBias); + outputLimiterCheckBox->setChecked(MusEGlobal::config.useOutputLimiter); + vstInPlaceCheckBox->setChecked(MusEGlobal::config.vstInPlace); + dummyAudioRate->setValue(MusEGlobal::config.dummyAudioSampleRate); //DummyAudioDevice* dad = dynamic_cast<DummyAudioDevice*>(audioDevice); //dummyAudioRealRate->setText(dad ? QString().setNum(sampleRate) : "---"); //dummyAudioRealRate->setText(QString().setNum(sampleRate)); // Not used any more. p4.0.20 - startSongEntry->setText(MusEConfig::config.startSong); - startSongGroup->button(MusEConfig::config.startMode)->setChecked(true); - - showTransport->setChecked(MusEConfig::config.transportVisible); - showBigtime->setChecked(MusEConfig::config.bigTimeVisible); - //showMixer->setChecked(MusEConfig::config.mixerVisible); - showMixer->setChecked(MusEConfig::config.mixer1Visible); - showMixer2->setChecked(MusEConfig::config.mixer2Visible); - - mainX->setValue(MusEConfig::config.geometryMain.x()); - mainY->setValue(MusEConfig::config.geometryMain.y()); - mainW->setValue(MusEConfig::config.geometryMain.width()); - mainH->setValue(MusEConfig::config.geometryMain.height()); - - transportX->setValue(MusEConfig::config.geometryTransport.x()); - transportY->setValue(MusEConfig::config.geometryTransport.y()); - - bigtimeX->setValue(MusEConfig::config.geometryBigTime.x()); - bigtimeY->setValue(MusEConfig::config.geometryBigTime.y()); - bigtimeW->setValue(MusEConfig::config.geometryBigTime.width()); - bigtimeH->setValue(MusEConfig::config.geometryBigTime.height()); - - //mixerX->setValue(MusEConfig::config.geometryMixer.x()); - //mixerY->setValue(MusEConfig::config.geometryMixer.y()); - //mixerW->setValue(MusEConfig::config.geometryMixer.width()); - //mixerH->setValue(MusEConfig::config.geometryMixer.height()); - mixerX->setValue(MusEConfig::config.mixer1.geometry.x()); - mixerY->setValue(MusEConfig::config.mixer1.geometry.y()); - mixerW->setValue(MusEConfig::config.mixer1.geometry.width()); - mixerH->setValue(MusEConfig::config.mixer1.geometry.height()); - mixer2X->setValue(MusEConfig::config.mixer2.geometry.x()); - mixer2Y->setValue(MusEConfig::config.mixer2.geometry.y()); - mixer2W->setValue(MusEConfig::config.mixer2.geometry.width()); - mixer2H->setValue(MusEConfig::config.mixer2.geometry.height()); + startSongEntry->setText(MusEGlobal::config.startSong); + startSongGroup->button(MusEGlobal::config.startMode)->setChecked(true); + + showTransport->setChecked(MusEGlobal::config.transportVisible); + showBigtime->setChecked(MusEGlobal::config.bigTimeVisible); + //showMixer->setChecked(MusEGlobal::config.mixerVisible); + showMixer->setChecked(MusEGlobal::config.mixer1Visible); + showMixer2->setChecked(MusEGlobal::config.mixer2Visible); + + mainX->setValue(MusEGlobal::config.geometryMain.x()); + mainY->setValue(MusEGlobal::config.geometryMain.y()); + mainW->setValue(MusEGlobal::config.geometryMain.width()); + mainH->setValue(MusEGlobal::config.geometryMain.height()); + + transportX->setValue(MusEGlobal::config.geometryTransport.x()); + transportY->setValue(MusEGlobal::config.geometryTransport.y()); + + bigtimeX->setValue(MusEGlobal::config.geometryBigTime.x()); + bigtimeY->setValue(MusEGlobal::config.geometryBigTime.y()); + bigtimeW->setValue(MusEGlobal::config.geometryBigTime.width()); + bigtimeH->setValue(MusEGlobal::config.geometryBigTime.height()); + + //mixerX->setValue(MusEGlobal::config.geometryMixer.x()); + //mixerY->setValue(MusEGlobal::config.geometryMixer.y()); + //mixerW->setValue(MusEGlobal::config.geometryMixer.width()); + //mixerH->setValue(MusEGlobal::config.geometryMixer.height()); + mixerX->setValue(MusEGlobal::config.mixer1.geometry.x()); + mixerY->setValue(MusEGlobal::config.mixer1.geometry.y()); + mixerW->setValue(MusEGlobal::config.mixer1.geometry.width()); + mixerH->setValue(MusEGlobal::config.mixer1.geometry.height()); + mixer2X->setValue(MusEGlobal::config.mixer2.geometry.x()); + mixer2Y->setValue(MusEGlobal::config.mixer2.geometry.y()); + mixer2W->setValue(MusEGlobal::config.mixer2.geometry.width()); + mixer2H->setValue(MusEGlobal::config.mixer2.geometry.height()); //setMixerCurrent->setEnabled(MusEGlobal::muse->mixerWindow()); setMixerCurrent->setEnabled(MusEGlobal::muse->mixer1Window()); @@ -300,15 +300,15 @@ void GlobalSettingsConfig::updateSettings() setBigtimeCurrent->setEnabled(MusEGlobal::muse->bigtimeWindow()); setTransportCurrent->setEnabled(MusEGlobal::muse->transportWindow()); - showSplash->setChecked(MusEConfig::config.showSplashScreen); - showDidYouKnow->setChecked(MusEConfig::config.showDidYouKnow); - externalWavEditorSelect->setText(MusEConfig::config.externalWavEditor); - oldStyleStopCheckBox->setChecked(MusEConfig::config.useOldStyleStopShortCut); - moveArmedCheckBox->setChecked(MusEConfig::config.moveArmedCheckBox); - projectSaveCheckBox->setChecked(MusEConfig::config.useProjectSaveDialog); - popsDefStayOpenCheckBox->setChecked(MusEConfig::config.popupsDefaultStayOpen); - lmbDecreasesCheckBox->setChecked(MusEConfig::config.leftMouseButtonCanDecrease); - rangeMarkerWithoutMMBCheckBox->setChecked(MusEConfig::config.rangeMarkerWithoutMMB); + showSplash->setChecked(MusEGlobal::config.showSplashScreen); + showDidYouKnow->setChecked(MusEGlobal::config.showDidYouKnow); + externalWavEditorSelect->setText(MusEGlobal::config.externalWavEditor); + oldStyleStopCheckBox->setChecked(MusEGlobal::config.useOldStyleStopShortCut); + moveArmedCheckBox->setChecked(MusEGlobal::config.moveArmedCheckBox); + projectSaveCheckBox->setChecked(MusEGlobal::config.useProjectSaveDialog); + popsDefStayOpenCheckBox->setChecked(MusEGlobal::config.popupsDefaultStayOpen); + lmbDecreasesCheckBox->setChecked(MusEGlobal::config.leftMouseButtonCanDecrease); + rangeMarkerWithoutMMBCheckBox->setChecked(MusEGlobal::config.rangeMarkerWithoutMMB); updateMdiSettings(); } @@ -342,110 +342,110 @@ void GlobalSettingsConfig::showEvent(QShowEvent* e) void GlobalSettingsConfig::apply() { int rtcticks = rtcResolutionSelect->currentIndex(); - MusEConfig::config.guiRefresh = guiRefreshSelect->value(); - MusEConfig::config.minSlider = minSliderSelect->value(); - MusEConfig::config.minMeter = minMeterSelect->value(); - MusEConfig::config.freewheelMode = freewheelCheckBox->isChecked(); - MusEConfig::config.useDenormalBias = denormalCheckBox->isChecked(); - MusEConfig::config.useOutputLimiter = outputLimiterCheckBox->isChecked(); - MusEConfig::config.vstInPlace = vstInPlaceCheckBox->isChecked(); - MusEConfig::config.rtcTicks = rtcResolutions[rtcticks]; - MusEConfig::config.userInstrumentsDir = userInstrumentsPath->text(); - MusEConfig::config.startSong = startSongEntry->text(); - MusEConfig::config.startMode = startSongGroup->checkedId(); + MusEGlobal::config.guiRefresh = guiRefreshSelect->value(); + MusEGlobal::config.minSlider = minSliderSelect->value(); + MusEGlobal::config.minMeter = minMeterSelect->value(); + MusEGlobal::config.freewheelMode = freewheelCheckBox->isChecked(); + MusEGlobal::config.useDenormalBias = denormalCheckBox->isChecked(); + MusEGlobal::config.useOutputLimiter = outputLimiterCheckBox->isChecked(); + MusEGlobal::config.vstInPlace = vstInPlaceCheckBox->isChecked(); + MusEGlobal::config.rtcTicks = rtcResolutions[rtcticks]; + MusEGlobal::config.userInstrumentsDir = userInstrumentsPath->text(); + MusEGlobal::config.startSong = startSongEntry->text(); + MusEGlobal::config.startMode = startSongGroup->checkedId(); int das = dummyAudioSize->currentIndex(); - MusEConfig::config.dummyAudioBufSize = dummyAudioBufSizes[das]; - MusEConfig::config.dummyAudioSampleRate = dummyAudioRate->value(); + MusEGlobal::config.dummyAudioBufSize = dummyAudioBufSizes[das]; + MusEGlobal::config.dummyAudioSampleRate = dummyAudioRate->value(); int mcp = minControlProcessPeriodComboBox->currentIndex(); - MusEConfig::config.minControlProcessPeriod = minControlProcessPeriods[mcp]; + MusEGlobal::config.minControlProcessPeriod = minControlProcessPeriods[mcp]; int div = midiDivisionSelect->currentIndex(); - MusEConfig::config.division = divisions[div]; + MusEGlobal::config.division = divisions[div]; div = guiDivisionSelect->currentIndex(); - MusEConfig::config.guiDivision = divisions[div]; + MusEGlobal::config.guiDivision = divisions[div]; - MusEConfig::config.transportVisible = showTransport->isChecked(); - MusEConfig::config.bigTimeVisible = showBigtime->isChecked(); - //MusEConfig::config.mixerVisible = showMixer->isChecked(); - MusEConfig::config.mixer1Visible = showMixer->isChecked(); - MusEConfig::config.mixer2Visible = showMixer2->isChecked(); - - MusEConfig::config.geometryMain.setX(mainX->value()); - MusEConfig::config.geometryMain.setY(mainY->value()); - MusEConfig::config.geometryMain.setWidth(mainW->value()); - MusEConfig::config.geometryMain.setHeight(mainH->value()); - - MusEConfig::config.geometryTransport.setX(transportX->value()); - MusEConfig::config.geometryTransport.setY(transportY->value()); - MusEConfig::config.geometryTransport.setWidth(0); - MusEConfig::config.geometryTransport.setHeight(0); - - MusEConfig::config.geometryBigTime.setX(bigtimeX->value()); - MusEConfig::config.geometryBigTime.setY(bigtimeY->value()); - MusEConfig::config.geometryBigTime.setWidth(bigtimeW->value()); - MusEConfig::config.geometryBigTime.setHeight(bigtimeH->value()); - - //MusEConfig::config.geometryMixer.setX(mixerX->value()); - //MusEConfig::config.geometryMixer.setY(mixerY->value()); - //MusEConfig::config.geometryMixer.setWidth(mixerW->value()); - //MusEConfig::config.geometryMixer.setHeight(mixerH->value()); - MusEConfig::config.mixer1.geometry.setX(mixerX->value()); - MusEConfig::config.mixer1.geometry.setY(mixerY->value()); - MusEConfig::config.mixer1.geometry.setWidth(mixerW->value()); - MusEConfig::config.mixer1.geometry.setHeight(mixerH->value()); - MusEConfig::config.mixer2.geometry.setX(mixer2X->value()); - MusEConfig::config.mixer2.geometry.setY(mixer2Y->value()); - MusEConfig::config.mixer2.geometry.setWidth(mixer2W->value()); - MusEConfig::config.mixer2.geometry.setHeight(mixer2H->value()); - - MusEConfig::config.showSplashScreen = showSplash->isChecked(); - MusEConfig::config.showDidYouKnow = showDidYouKnow->isChecked(); - MusEConfig::config.externalWavEditor = externalWavEditorSelect->text(); - MusEConfig::config.useOldStyleStopShortCut = oldStyleStopCheckBox->isChecked(); - MusEConfig::config.moveArmedCheckBox = moveArmedCheckBox->isChecked(); - MusEConfig::config.useProjectSaveDialog = projectSaveCheckBox->isChecked(); - MusEConfig::config.popupsDefaultStayOpen = popsDefStayOpenCheckBox->isChecked(); - MusEConfig::config.leftMouseButtonCanDecrease = lmbDecreasesCheckBox->isChecked(); - MusEConfig::config.rangeMarkerWithoutMMB = rangeMarkerWithoutMMBCheckBox->isChecked(); - - //MusEGlobal::muse->showMixer(MusEConfig::config.mixerVisible); - MusEGlobal::muse->showMixer1(MusEConfig::config.mixer1Visible); - MusEGlobal::muse->showMixer2(MusEConfig::config.mixer2Visible); + MusEGlobal::config.transportVisible = showTransport->isChecked(); + MusEGlobal::config.bigTimeVisible = showBigtime->isChecked(); + //MusEGlobal::config.mixerVisible = showMixer->isChecked(); + MusEGlobal::config.mixer1Visible = showMixer->isChecked(); + MusEGlobal::config.mixer2Visible = showMixer2->isChecked(); + + MusEGlobal::config.geometryMain.setX(mainX->value()); + MusEGlobal::config.geometryMain.setY(mainY->value()); + MusEGlobal::config.geometryMain.setWidth(mainW->value()); + MusEGlobal::config.geometryMain.setHeight(mainH->value()); + + MusEGlobal::config.geometryTransport.setX(transportX->value()); + MusEGlobal::config.geometryTransport.setY(transportY->value()); + MusEGlobal::config.geometryTransport.setWidth(0); + MusEGlobal::config.geometryTransport.setHeight(0); + + MusEGlobal::config.geometryBigTime.setX(bigtimeX->value()); + MusEGlobal::config.geometryBigTime.setY(bigtimeY->value()); + MusEGlobal::config.geometryBigTime.setWidth(bigtimeW->value()); + MusEGlobal::config.geometryBigTime.setHeight(bigtimeH->value()); + + //MusEGlobal::config.geometryMixer.setX(mixerX->value()); + //MusEGlobal::config.geometryMixer.setY(mixerY->value()); + //MusEGlobal::config.geometryMixer.setWidth(mixerW->value()); + //MusEGlobal::config.geometryMixer.setHeight(mixerH->value()); + MusEGlobal::config.mixer1.geometry.setX(mixerX->value()); + MusEGlobal::config.mixer1.geometry.setY(mixerY->value()); + MusEGlobal::config.mixer1.geometry.setWidth(mixerW->value()); + MusEGlobal::config.mixer1.geometry.setHeight(mixerH->value()); + MusEGlobal::config.mixer2.geometry.setX(mixer2X->value()); + MusEGlobal::config.mixer2.geometry.setY(mixer2Y->value()); + MusEGlobal::config.mixer2.geometry.setWidth(mixer2W->value()); + MusEGlobal::config.mixer2.geometry.setHeight(mixer2H->value()); + + MusEGlobal::config.showSplashScreen = showSplash->isChecked(); + MusEGlobal::config.showDidYouKnow = showDidYouKnow->isChecked(); + MusEGlobal::config.externalWavEditor = externalWavEditorSelect->text(); + MusEGlobal::config.useOldStyleStopShortCut = oldStyleStopCheckBox->isChecked(); + MusEGlobal::config.moveArmedCheckBox = moveArmedCheckBox->isChecked(); + MusEGlobal::config.useProjectSaveDialog = projectSaveCheckBox->isChecked(); + MusEGlobal::config.popupsDefaultStayOpen = popsDefStayOpenCheckBox->isChecked(); + MusEGlobal::config.leftMouseButtonCanDecrease = lmbDecreasesCheckBox->isChecked(); + MusEGlobal::config.rangeMarkerWithoutMMB = rangeMarkerWithoutMMBCheckBox->isChecked(); + + //MusEGlobal::muse->showMixer(MusEGlobal::config.mixerVisible); + MusEGlobal::muse->showMixer1(MusEGlobal::config.mixer1Visible); + MusEGlobal::muse->showMixer2(MusEGlobal::config.mixer2Visible); - MusEGlobal::muse->showBigtime(MusEConfig::config.bigTimeVisible); - MusEGlobal::muse->showTransport(MusEConfig::config.transportVisible); + MusEGlobal::muse->showBigtime(MusEGlobal::config.bigTimeVisible); + MusEGlobal::muse->showTransport(MusEGlobal::config.transportVisible); QWidget* w = MusEGlobal::muse->transportWindow(); if (w) { - w->resize(MusEConfig::config.geometryTransport.size()); - w->move(MusEConfig::config.geometryTransport.topLeft()); + w->resize(MusEGlobal::config.geometryTransport.size()); + w->move(MusEGlobal::config.geometryTransport.topLeft()); } //w = MusEGlobal::muse->mixerWindow(); //if (w) { - // w->resize(MusEConfig::config.geometryMixer.size()); - // w->move(MusEConfig::config.geometryMixer.topLeft()); + // w->resize(MusEGlobal::config.geometryMixer.size()); + // w->move(MusEGlobal::config.geometryMixer.topLeft()); // } w = MusEGlobal::muse->mixer1Window(); if (w) { - w->resize(MusEConfig::config.mixer1.geometry.size()); - w->move(MusEConfig::config.mixer1.geometry.topLeft()); + w->resize(MusEGlobal::config.mixer1.geometry.size()); + w->move(MusEGlobal::config.mixer1.geometry.topLeft()); } w = MusEGlobal::muse->mixer2Window(); if (w) { - w->resize(MusEConfig::config.mixer2.geometry.size()); - w->move(MusEConfig::config.mixer2.geometry.topLeft()); + w->resize(MusEGlobal::config.mixer2.geometry.size()); + w->move(MusEGlobal::config.mixer2.geometry.topLeft()); } w = MusEGlobal::muse->bigtimeWindow(); if (w) { - w->resize(MusEConfig::config.geometryBigTime.size()); - w->move(MusEConfig::config.geometryBigTime.topLeft()); + w->resize(MusEGlobal::config.geometryBigTime.size()); + w->move(MusEGlobal::config.geometryBigTime.topLeft()); } - MusEGlobal::muse->resize(MusEConfig::config.geometryMain.size()); - MusEGlobal::muse->move(MusEConfig::config.geometryMain.topLeft()); + MusEGlobal::muse->resize(MusEGlobal::config.geometryMain.size()); + MusEGlobal::muse->move(MusEGlobal::config.geometryMain.topLeft()); - MusEGlobal::museUserInstruments = MusEConfig::config.userInstrumentsDir; + MusEGlobal::museUserInstruments = MusEGlobal::config.userInstrumentsDir; MusEGlobal::muse->setHeartBeat(); // set guiRefresh - midiSeq->msgSetRtc(); // set midi tick rate + MusEGlobal::midiSeq->msgSetRtc(); // set midi tick rate applyMdiSettings(); @@ -550,7 +550,7 @@ void GlobalSettingsConfig::selectInstrumentsPath() { QString dir = QFileDialog::getExistingDirectory(this, tr("Selects instruments directory"), - MusEConfig::config.userInstrumentsDir); + MusEGlobal::config.userInstrumentsDir); userInstrumentsPath->setText(dir); } @@ -598,5 +598,5 @@ void GlobalSettingsConfig::borlandPreset() updateMdiSettings(); } -} // namespace MusEWidget +} // namespace MusEGui diff --git a/muse2/muse/widgets/genset.h b/muse2/muse/widgets/genset.h index 6068c429..0e1697ee 100644 --- a/muse2/muse/widgets/genset.h +++ b/muse2/muse/widgets/genset.h @@ -31,7 +31,7 @@ #include <QShowEvent> #include <list> -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // GlobalSettingsConfig @@ -68,6 +68,6 @@ class GlobalSettingsConfig : public QDialog, public Ui::GlobalSettingsDialogBase GlobalSettingsConfig(QWidget* parent=0); }; -} // namespace MusEWidget +} // namespace MusEGui #endif diff --git a/muse2/muse/widgets/header.cpp b/muse2/muse/widgets/header.cpp index 8e2efe21..2c1057c3 100644 --- a/muse2/muse/widgets/header.cpp +++ b/muse2/muse/widgets/header.cpp @@ -28,23 +28,23 @@ #include <QStandardItemModel> #include <QMouseEvent> -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // readStatus //--------------------------------------------------------- -void Header::readStatus(Xml& xml) +void Header::readStatus(MusECore::Xml& xml) { for (;;) { - Xml::Token token = xml.parse(); + MusECore::Xml::Token token = xml.parse(); const QString& tag = xml.s1(); switch (token) { - case Xml::Error: - case Xml::End: + case MusECore::Xml::Error: + case MusECore::Xml::End: return; - case Xml::Text: + case MusECore::Xml::Text: { QStringList l = tag.split(QString(" "), QString::SkipEmptyParts); int index = count() -1; @@ -76,10 +76,10 @@ void Header::readStatus(Xml& xml) } } break; - case Xml::TagStart: + case MusECore::Xml::TagStart: xml.unknown("Header"); break; - case Xml::TagEnd: + case MusECore::Xml::TagEnd: if (tag ==objectName()) return; default: @@ -92,10 +92,10 @@ void Header::readStatus(Xml& xml) // writeStatus //--------------------------------------------------------- -void Header::writeStatus(int level, Xml& xml) const +void Header::writeStatus(int level, MusECore::Xml& xml) const { //xml.nput(level, "<%s> ", name()); - xml.nput(level, "<%s> ", Xml::xmlString(objectName()).toLatin1().constData()); + xml.nput(level, "<%s> ", MusECore::Xml::xmlString(objectName()).toLatin1().constData()); int n = count(); for (int i = n; i >= 0; --i) { if (isSectionHidden(logicalIndex(i))) @@ -104,7 +104,7 @@ void Header::writeStatus(int level, Xml& xml) const xml.nput("%d ", logicalIndex(i)); } //xml.put("</%s>", name()); - xml.put("</%s>", Xml::xmlString(objectName()).toLatin1().constData()); + xml.put("</%s>", MusECore::Xml::xmlString(objectName()).toLatin1().constData()); } //--------------------------------------------------------- @@ -192,4 +192,4 @@ void Header::changeColumns(QAction *a) hideSection(section); } -} // namespace MusEWidget +} // namespace MusEGui diff --git a/muse2/muse/widgets/header.h b/muse2/muse/widgets/header.h index 47c79192..f88ba750 100644 --- a/muse2/muse/widgets/header.h +++ b/muse2/muse/widgets/header.h @@ -28,9 +28,11 @@ class QStandardItemModel; +namespace MusECore { class Xml; +} -namespace MusEWidget { +namespace MusEGui { class Header : public QHeaderView { Q_OBJECT @@ -39,8 +41,8 @@ class Header : public QHeaderView { public: Header(QWidget* parent=0, const char* name=0); - void writeStatus(int level, Xml&) const; - void readStatus(Xml&); + void writeStatus(int level, MusECore::Xml&) const; + void readStatus(MusECore::Xml&); void setColumnLabel( const QString & s, int col, int width = -1 ); void setToolTip(int col, const QString &text); void setWhatsThis(int col, const QString &text); @@ -49,7 +51,7 @@ class Header : public QHeaderView { void changeColumns(QAction* a); }; -} // namespace MusEWidget +} // namespace MusEGui #endif diff --git a/muse2/muse/widgets/hitscale.cpp b/muse2/muse/widgets/hitscale.cpp index 6db0172d..a24eff9c 100644 --- a/muse2/muse/widgets/hitscale.cpp +++ b/muse2/muse/widgets/hitscale.cpp @@ -29,7 +29,7 @@ #include "song.h" -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // HitScale @@ -39,12 +39,12 @@ HitScale::HitScale(int* r, QWidget* parent, int xs) : View(parent, xs, 1) { raster = r; - pos[0] = song->cpos(); - pos[1] = song->lpos(); - pos[2] = song->rpos(); + pos[0] = MusEGlobal::song->cpos(); + pos[1] = MusEGlobal::song->lpos(); + pos[2] = MusEGlobal::song->rpos(); button = Qt::NoButton; setMouseTracking(true); - connect(song, SIGNAL(posChanged(int, unsigned, bool)), this, SLOT(setPos(int, unsigned, bool))); + connect(MusEGlobal::song, SIGNAL(posChanged(int, unsigned, bool)), this, SLOT(setPos(int, unsigned, bool))); setFixedHeight(18); } @@ -98,7 +98,7 @@ void HitScale::viewMouseMoveEvent(QMouseEvent* event) i = 1; break; case Qt::RightButton: - if ((MusEConfig::config.rangeMarkerWithoutMMB) && (event->modifiers() & Qt::ControlModifier)) + if ((MusEGlobal::config.rangeMarkerWithoutMMB) && (event->modifiers() & Qt::ControlModifier)) i = 1; else i = 2; @@ -106,8 +106,8 @@ void HitScale::viewMouseMoveEvent(QMouseEvent* event) default: return; } - Pos p(x, true); - song->setPos(i, p); + MusECore::Pos p(x, true); + MusEGlobal::song->setPos(i, p); } //--------------------------------------------------------- diff --git a/muse2/muse/widgets/hitscale.h b/muse2/muse/widgets/hitscale.h index cf43ef4a..fdc8d810 100644 --- a/muse2/muse/widgets/hitscale.h +++ b/muse2/muse/widgets/hitscale.h @@ -27,7 +27,7 @@ class MidiEditor; -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // HitScale @@ -60,7 +60,7 @@ class HitScale : public View { HitScale(int* raster, QWidget* parent, int xscale); }; -} // namespace MusEWidget +} // namespace MusEGui #endif diff --git a/muse2/muse/widgets/intlabel.cpp b/muse2/muse/widgets/intlabel.cpp index 6884adfb..f71a5b50 100644 --- a/muse2/muse/widgets/intlabel.cpp +++ b/muse2/muse/widgets/intlabel.cpp @@ -25,7 +25,7 @@ #include "intlabel.h" #include "utils.h" -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // IntLabel @@ -41,7 +41,7 @@ IntLabel::IntLabel(int _val, int _min, int _max, QWidget* parent, val = _val+1; // dont optimize away off = _off; setValue(_val); - int len = MusEUtil::num2cols(min, max); + int len = MusECore::num2cols(min, max); setSize(len); } @@ -59,7 +59,7 @@ void IntLabel::setRange(int mn, int mx) { min = mn; max = mx; - setSize(MusEUtil::num2cols(min, max)); + setSize(MusECore::num2cols(min, max)); int v = val; if(val < mn) v = mn; @@ -155,4 +155,4 @@ void IntLabel::setOff(int v) setString(val); } -} // namespace MusEWidget +} // namespace MusEGui diff --git a/muse2/muse/widgets/intlabel.h b/muse2/muse/widgets/intlabel.h index 34c075d8..bcc3c6b2 100644 --- a/muse2/muse/widgets/intlabel.h +++ b/muse2/muse/widgets/intlabel.h @@ -28,7 +28,7 @@ class QString; -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // IntLabel @@ -60,6 +60,6 @@ class IntLabel : public Nentry { void setRange(int, int); }; -} // namespace MusEWidget +} // namespace MusEGui #endif diff --git a/muse2/muse/widgets/itransformbase.ui b/muse2/muse/widgets/itransformbase.ui index 2e9fb602..52c29a7e 100644 --- a/muse2/muse/widgets/itransformbase.ui +++ b/muse2/muse/widgets/itransformbase.ui @@ -533,7 +533,7 @@ </widget> </item> <item row="2" column="1"> - <widget class="MusEWidget::SpinBoxFP" name="procVal1a"> + <widget class="MusEGui::SpinBoxFP" name="procVal1a"> <property name="maximum" stdset="0"> <number>99999999</number> </property> @@ -736,21 +736,21 @@ </widget> </item> <item row="2" column="2"> - <widget class="MusEWidget::SpinBoxFP" name="procVal2a"> + <widget class="MusEGui::SpinBoxFP" name="procVal2a"> <property name="maximum" stdset="0"> <number>99999999</number> </property> </widget> </item> <item row="2" column="3"> - <widget class="MusEWidget::SpinBoxFP" name="procPortVala"> + <widget class="MusEGui::SpinBoxFP" name="procPortVala"> <property name="maximum" stdset="0"> <number>99999999</number> </property> </widget> </item> <item row="2" column="4"> - <widget class="MusEWidget::SpinBoxFP" name="procChannelVala"> + <widget class="MusEGui::SpinBoxFP" name="procChannelVala"> <property name="maximum" stdset="0"> <number>99999999</number> </property> @@ -1106,7 +1106,7 @@ <layoutdefault spacing="6" margin="11"/> <customwidgets> <customwidget> - <class>MusEWidget::SpinBoxFP</class> + <class>MusEGui::SpinBoxFP</class> <extends>QDoubleSpinBox</extends> <header>spinboxFP.h</header> </customwidget> diff --git a/muse2/muse/widgets/knob.cpp b/muse2/muse/widgets/knob.cpp index ac035065..920d2028 100644 --- a/muse2/muse/widgets/knob.cpp +++ b/muse2/muse/widgets/knob.cpp @@ -34,7 +34,7 @@ #include <QPaintEvent> #include <QResizeEvent> -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // The QwtKnob widget imitates look and behaviour of a volume knob on a radio. @@ -329,15 +329,15 @@ void Knob::rangeChange() void Knob::resizeEvent(QResizeEvent* ev) { - MusEWidget::SliderBase::resizeEvent(ev); + SliderBase::resizeEvent(ev); int width, width_2; const QRect& r = rect(); // printf("resize %d %d %d\n", r.height(), r.width(), d_knobWidth); -// width = MusEUtil::qwtMin(MusEUtil::qwtMin(r.height(), r.width()), d_knobWidth); - width = MusEUtil::qwtMin(r.height(), r.width()); +// width = MusECore::qwtMin(MusECore::qwtMin(r.height(), r.width()), d_knobWidth); + width = MusECore::qwtMin(r.height(), r.width()); width_2 = width / 2; int x = r.x() + r.width() / 2 - width_2; @@ -426,7 +426,7 @@ void Knob::drawMarker(QPainter *p, double arc, const QColor &c) p->setBrush(c); p->setPen(Qt::NoPen); - rb = double(MusEUtil::qwtMax(radius - 4 - d_dotWidth / 2, 0)); + rb = double(MusECore::qwtMax(radius - 4 - d_dotWidth / 2, 0)); p->drawEllipse(xm - int(rint(sa * rb)) - d_dotWidth / 2, ym - int(rint(ca * rb)) - d_dotWidth / 2, d_dotWidth, d_dotWidth); @@ -439,8 +439,8 @@ void Knob::drawMarker(QPainter *p, double arc, const QColor &c) pn.setWidth(2); p->setPen(pn); - rb = MusEUtil::qwtMax(double((radius - 1) / 3.0), 0.0); - re = MusEUtil::qwtMax(double(radius - 1), 0.0); + rb = MusECore::qwtMax(double((radius - 1) / 3.0), 0.0); + re = MusECore::qwtMax(double(radius - 1), 0.0); p->setRenderHint(QPainter::Antialiasing, true); p->drawLine( xm, @@ -471,7 +471,7 @@ void Knob::drawMarker(QPainter *p, double arc, const QColor &c) //------------------------------------------------------------ void Knob::setKnobWidth(int w) { - d_knobWidth = MusEUtil::qwtMax(w,5); + d_knobWidth = MusECore::qwtMax(w,5); resize(size()); repaint(); } @@ -490,7 +490,7 @@ void Knob::setKnobWidth(int w) //------------------------------------------------------------ void Knob::setBorderWidth(int bw) { - d_borderWidth = MusEUtil::qwtMax(bw, 0); + d_borderWidth = MusECore::qwtMax(bw, 0); resize(size()); repaint(); } @@ -574,4 +574,4 @@ void Knob::setMarkerColor(const QColor c) repaint(); } -} // namespace MusEWidget +} // namespace MusEGui diff --git a/muse2/muse/widgets/knob.h b/muse2/muse/widgets/knob.h index 257ff0c7..483fafa6 100644 --- a/muse2/muse/widgets/knob.h +++ b/muse2/muse/widgets/knob.h @@ -30,7 +30,7 @@ #include <QResizeEvent> #include <QPaintEvent> -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // Knob @@ -104,6 +104,6 @@ class Knob : public SliderBase, public ScaleIf void setMarkerColor(const QColor c); }; -} // namespace MusEWidget +} // namespace MusEGui #endif diff --git a/muse2/muse/widgets/lcombo.cpp b/muse2/muse/widgets/lcombo.cpp index ca17e5e3..06041df4 100644 --- a/muse2/muse/widgets/lcombo.cpp +++ b/muse2/muse/widgets/lcombo.cpp @@ -25,7 +25,7 @@ #include <QHBoxLayout> #include <QLabel> -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // LabelCombo @@ -66,4 +66,4 @@ void LabelCombo::setCurrentIndex(int i) box->setCurrentIndex(r); } -} // namespace MusEWidget +} // namespace MusEGui diff --git a/muse2/muse/widgets/lcombo.h b/muse2/muse/widgets/lcombo.h index f500dc60..5813877c 100644 --- a/muse2/muse/widgets/lcombo.h +++ b/muse2/muse/widgets/lcombo.h @@ -29,7 +29,7 @@ class QString; -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // LabelCombo @@ -57,6 +57,6 @@ class LabelCombo : public QWidget { void setFocusPolicy ( Qt::FocusPolicy fp ) { box->setFocusPolicy(fp); } }; -} // namespace MusEWidget +} // namespace MusEGui #endif diff --git a/muse2/muse/widgets/mdisettings.cpp b/muse2/muse/widgets/mdisettings.cpp index 24bf7c7c..257cd593 100644 --- a/muse2/muse/widgets/mdisettings.cpp +++ b/muse2/muse/widgets/mdisettings.cpp @@ -34,6 +34,8 @@ #include "globals.h" #include "icons.h" +namespace MusEGui { + MdiSettings::MdiSettings(TopWin::ToplevelType t, QWidget* parent) : QWidget(parent) { _type=t; @@ -57,3 +59,5 @@ void MdiSettings::apply_settings() TopWin::_sharesWhenSubwin[_type] = shareSubwinCheckbox->isChecked(); TopWin::_sharesWhenFree[_type] = shareFreeCheckbox->isChecked(); } + +} // namespace MusEGui diff --git a/muse2/muse/widgets/mdisettings.h b/muse2/muse/widgets/mdisettings.h index 482f9f49..80f6db57 100644 --- a/muse2/muse/widgets/mdisettings.h +++ b/muse2/muse/widgets/mdisettings.h @@ -28,6 +28,8 @@ #include "ui_mdisettings_base.h" #include "cobject.h" +namespace MusEGui { + //--------------------------------------------------------- // GlobalSettingsConfig //--------------------------------------------------------- @@ -46,4 +48,6 @@ class MdiSettings : public QWidget, private Ui::MdiSettingsBase TopWin::ToplevelType type() { return _type; } }; +} // namespace MusEGui + #endif diff --git a/muse2/muse/widgets/menutitleitem.cpp b/muse2/muse/widgets/menutitleitem.cpp index c15c8c64..5315651f 100644 --- a/muse2/muse/widgets/menutitleitem.cpp +++ b/muse2/muse/widgets/menutitleitem.cpp @@ -22,7 +22,7 @@ #include "menutitleitem.h" -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // MenuTitleItem @@ -50,4 +50,4 @@ QWidget* MenuTitleItem::createWidget(QWidget *parent) return l; } -} // namespace MusEWidget +} // namespace MusEGui diff --git a/muse2/muse/widgets/menutitleitem.h b/muse2/muse/widgets/menutitleitem.h index 98573c72..94d7b610 100644 --- a/muse2/muse/widgets/menutitleitem.h +++ b/muse2/muse/widgets/menutitleitem.h @@ -25,7 +25,7 @@ #include <QWidgetAction> -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // MenuTitleItem @@ -43,5 +43,5 @@ class MenuTitleItem : public QWidgetAction { QWidget* createWidget(QWidget* /*parent*/); }; -} // namespace MusEWidget +} // namespace MusEGui #endif diff --git a/muse2/muse/widgets/meter.cpp b/muse2/muse/widgets/meter.cpp index 590e7f65..5c79ffb2 100644 --- a/muse2/muse/widgets/meter.cpp +++ b/muse2/muse/widgets/meter.cpp @@ -38,7 +38,7 @@ // Just an experiment. Some undesirable effects, see below... //#define _USE_CLIPPER 1 -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // Meter @@ -63,7 +63,7 @@ Meter::Meter(QWidget* parent, MeterType type) last_ymax = 0; val = 0.0; maxVal = 0.0; - minScale = mtype == DBMeter ? MusEConfig::config.minMeter : 0.0; // min value in dB or int + minScale = mtype == DBMeter ? MusEGlobal::config.minMeter : 0.0; // min value in dB or int maxScale = mtype == DBMeter ? 10.0 : 127.0; yellowScale = -10; redScale = 0; @@ -164,7 +164,7 @@ void Meter::setVal(double v, double max, bool ovl) { maxVal = max; if(mtype == DBMeter) - cur_ymax = maxVal == 0 ? fw : int(((maxScale - (fast_log10(maxVal) * 20.0)) * h)/range); + cur_ymax = maxVal == 0 ? fw : int(((maxScale - (MusECore::fast_log10(maxVal) * 20.0)) * h)/range); else cur_ymax = maxVal == 0 ? fw : int(((maxScale - maxVal) * h)/range); if(cur_ymax > h) cur_ymax = h; @@ -179,7 +179,7 @@ void Meter::setVal(double v, double max, bool ovl) if(ud) { if(mtype == DBMeter) - cur_yv = val == 0 ? h : int(((maxScale - (fast_log10(val) * 20.0)) * h)/range); + cur_yv = val == 0 ? h : int(((maxScale - (MusECore::fast_log10(val) * 20.0)) * h)/range); else cur_yv = val == 0 ? h : int(((maxScale - val) * h)/range); if(cur_yv > h) cur_yv = h; @@ -247,8 +247,8 @@ void Meter::paintEvent(QPaintEvent* ev) { if(mtype == DBMeter) { - cur_yv = val == 0 ? h : int(((maxScale - (fast_log10(val) * 20.0)) * h)/range); - cur_ymax = maxVal == 0 ? fw : int(((maxScale - (fast_log10(maxVal) * 20.0)) * h)/range); + cur_yv = val == 0 ? h : int(((maxScale - (MusECore::fast_log10(val) * 20.0)) * h)/range); + cur_ymax = maxVal == 0 ? fw : int(((maxScale - (MusECore::fast_log10(maxVal) * 20.0)) * h)/range); } else { @@ -547,4 +547,4 @@ void Meter::mousePressEvent(QMouseEvent*) emit mousePress(); } -} // namespace MusEWidget +} // namespace MusEGui diff --git a/muse2/muse/widgets/meter.h b/muse2/muse/widgets/meter.h index 1de3841f..114dfa89 100644 --- a/muse2/muse/widgets/meter.h +++ b/muse2/muse/widgets/meter.h @@ -34,7 +34,7 @@ class QMouseEvent; class QPainter; class QPainterPath; -namespace MusEWidget { +namespace MusEGui { class Meter : public QFrame { Q_OBJECT @@ -103,7 +103,7 @@ class Meter : public QFrame { void setRange(double min, double max); }; -} // namespace MusEWidget +} // namespace MusEGui #endif diff --git a/muse2/muse/widgets/metronome.cpp b/muse2/muse/widgets/metronome.cpp index e639df81..e6b7bd91 100644 --- a/muse2/muse/widgets/metronome.cpp +++ b/muse2/muse/widgets/metronome.cpp @@ -30,7 +30,7 @@ #include "track.h" #include "audio.h" -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // MetronomeConfig @@ -75,15 +75,15 @@ MetronomeConfig::MetronomeConfig(QDialog* parent) void MetronomeConfig::audioBeepRoutesClicked() { - if(song->outputs()->size() == 0) + if(MusEGlobal::song->outputs()->size() == 0) return; QMenu* pup = new QMenu; - OutputList* ol = song->outputs(); + MusECore::OutputList* ol = MusEGlobal::song->outputs(); int nn = 0; - for(iAudioOutput iao = ol->begin(); iao != ol->end(); ++iao) + for(MusECore::iAudioOutput iao = ol->begin(); iao != ol->end(); ++iao) { QAction* action = pup->addAction(QT_TRANSLATE_NOOP("@default", (*iao)->name())); action->setCheckable(true); @@ -98,14 +98,14 @@ void MetronomeConfig::audioBeepRoutesClicked() { //QString s(pup->text(n)); nn = 0; - for(iAudioOutput iao = ol->begin(); iao != ol->end(); ++iao) + for(MusECore::iAudioOutput iao = ol->begin(); iao != ol->end(); ++iao) { //if(((*iao)->name() == s) && (n == nn)) if (nn == clickaction->data()) { //(*iao)->setSendMetronome(); - audio->msgSetSendMetronome(*iao, clickaction->isChecked()); - //song->update(SC_ROUTE); + MusEGlobal::audio->msgSetSendMetronome(*iao, clickaction->isChecked()); + //MusEGlobal::song->update(SC_ROUTE); break; } ++nn; @@ -199,5 +199,5 @@ void MetronomeConfig::beepVolumeChanged(int volume) MusEGlobal::audioClickVolume=volume/100.0; } -} // namespace MusEWidget +} // namespace MusEGui diff --git a/muse2/muse/widgets/metronome.h b/muse2/muse/widgets/metronome.h index 62edcdc5..f93da182 100644 --- a/muse2/muse/widgets/metronome.h +++ b/muse2/muse/widgets/metronome.h @@ -28,7 +28,7 @@ class QDialog; -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // MetronomeConfig @@ -51,6 +51,6 @@ class MetronomeConfig : public QDialog, public Ui::MetronomeConfigBase { MetronomeConfig(QDialog* parent=0); }; -} // namespace MusEWidget +} // namespace MusEGui #endif diff --git a/muse2/muse/widgets/midisyncimpl.cpp b/muse2/muse/widgets/midisyncimpl.cpp index 3829ca43..904e8759 100644 --- a/muse2/muse/widgets/midisyncimpl.cpp +++ b/muse2/muse/widgets/midisyncimpl.cpp @@ -41,13 +41,13 @@ #include "driver/audiodev.h" #include "audio.h" -namespace MusEWidget { +namespace MusEGui { enum { DEVCOL_NO = 0, DEVCOL_NAME, DEVCOL_IN, DEVCOL_TICKIN, DEVCOL_MRTIN, DEVCOL_MMCIN, DEVCOL_MTCIN, DEVCOL_MTCTYPE, DEVCOL_RID, DEVCOL_RCLK, DEVCOL_RMRT, DEVCOL_RMMC, DEVCOL_RMTC, DEVCOL_RREWSTART, DEVCOL_TID, DEVCOL_TCLK, DEVCOL_TMRT, DEVCOL_TMMC, DEVCOL_TMTC, /* DEVCOL_TREWSTART, */ }; -//MidiSyncInfo tmpMidiSyncPorts[MIDI_PORTS]; +//MusECore::MidiSyncInfo tmpMidiSyncPorts[MIDI_PORTS]; //--------------------------------------------------------- // MidiSyncConfig::setToolTips @@ -143,7 +143,7 @@ void MidiSyncConfig::addDevice(QTreeWidgetItem *item, QTreeWidget *tree) // setDevice //--------------------------------------------------------- -void MidiSyncLViewItem::setDevice(MidiDevice* d) +void MidiSyncLViewItem::setDevice(MusECore::MidiDevice* d) { _device = d; if(_device) @@ -162,8 +162,8 @@ void MidiSyncLViewItem::setPort(int port) if(_port < 0 || port > MIDI_PORTS) return; - //_syncInfo.copyParams(midiPorts[port].syncInfo()); - copyFromSyncInfo(midiPorts[port].syncInfo()); + //_syncInfo.copyParams(MusEGlobal::midiPorts[port].syncInfo()); + copyFromSyncInfo(MusEGlobal::midiPorts[port].syncInfo()); } //--------------------------------------------------------- @@ -171,7 +171,7 @@ void MidiSyncLViewItem::setPort(int port) // copyFromSyncInfo //--------------------------------------------------------- -void MidiSyncLViewItem::copyFromSyncInfo(const MidiSyncInfo &sp) +void MidiSyncLViewItem::copyFromSyncInfo(const MusECore::MidiSyncInfo &sp) { _idOut = sp.idOut(); _idIn = sp.idIn(); @@ -192,7 +192,7 @@ void MidiSyncLViewItem::copyFromSyncInfo(const MidiSyncInfo &sp) // copyToSyncInfo //--------------------------------------------------------- -void MidiSyncLViewItem::copyToSyncInfo(MidiSyncInfo &sp) +void MidiSyncLViewItem::copyToSyncInfo(MusECore::MidiSyncInfo &sp) { sp.setIdOut(_idOut); sp.setIdIn(_idIn); @@ -226,10 +226,10 @@ MidiSyncConfig::MidiSyncConfig(QWidget* parent) //for(int i = 0; i < MIDI_PORTS; ++i) // tmpMidiSyncPorts[i] = midiSyncPorts[i]; - //bool ext = extSyncFlag.value(); + //bool ext = MusEGlobal::extSyncFlag.value(); //syncMode->setButton(int(ext)); //syncChanged(ext); -// extSyncCheckbox->setChecked(extSyncFlag.value()); +// extSyncCheckbox->setChecked(MusEGlobal::extSyncFlag.value()); // dstDevId->setValue(txDeviceId); // srcDevId->setValue(rxDeviceId); @@ -245,13 +245,13 @@ MidiSyncConfig::MidiSyncConfig(QWidget* parent) // acceptMCCheckbox->setChecked(acceptMC); // acceptMMCCheckbox->setChecked(acceptMMC); -// mtcSyncType->setCurrentItem(mtcType); +// mtcSyncType->setCurrentItem(MusEGlobal::mtcType); -// mtcOffH->setValue(mtcOffset.h()); -// mtcOffM->setValue(mtcOffset.m()); -// mtcOffS->setValue(mtcOffset.s()); -// mtcOffF->setValue(mtcOffset.f()); -// mtcOffSf->setValue(mtcOffset.sf()); +// mtcOffH->setValue(MusEGlobal::mtcOffset.h()); +// mtcOffM->setValue(MusEGlobal::mtcOffset.m()); +// mtcOffS->setValue(MusEGlobal::mtcOffset.s()); +// mtcOffF->setValue(MusEGlobal::mtcOffset.f()); +// mtcOffSf->setValue(MusEGlobal::mtcOffset.sf()); @@ -308,11 +308,11 @@ MidiSyncConfig::MidiSyncConfig(QWidget* parent) connect(mtcSyncType, SIGNAL(activated(int)), SLOT(syncChanged())); connect(useJackTransportCheckbox, SIGNAL(clicked()), SLOT(syncChanged())); connect(jackTransportMasterCheckbox, SIGNAL(clicked()), SLOT(syncChanged())); - connect(&extSyncFlag, SIGNAL(valueChanged(bool)), SLOT(extSyncChanged(bool))); + connect(&MusEGlobal::extSyncFlag, SIGNAL(valueChanged(bool)), SLOT(extSyncChanged(bool))); connect(syncDelaySpinBox, SIGNAL(valueChanged(int)), SLOT(syncChanged())); // Done in show(). - //connect(song, SIGNAL(songChanged(int)), SLOT(songChanged(int))); + //connect(MusEGlobal::song, SIGNAL(songChanged(int)), SLOT(songChanged(int))); //connect(MusEGlobal::heartBeatTimer, SIGNAL(timeout()), SLOT(heartBeat())); //inHeartBeat = false; @@ -347,28 +347,28 @@ void MidiSyncConfig::songChanged(int flags) useJackTransportCheckbox->blockSignals(true); jackTransportMasterCheckbox->blockSignals(true); syncDelaySpinBox->blockSignals(true); - extSyncCheckbox->setChecked(extSyncFlag.value()); - useJackTransportCheckbox->setChecked(useJackTransport.value()); - jackTransportMasterCheckbox->setChecked(jackTransportMaster); - //jackTransportMasterCheckbox->setEnabled(useJackTransport); - syncDelaySpinBox->setValue(syncSendFirstClockDelay); + extSyncCheckbox->setChecked(MusEGlobal::extSyncFlag.value()); + useJackTransportCheckbox->setChecked(MusEGlobal::useJackTransport.value()); + jackTransportMasterCheckbox->setChecked(MusEGlobal::jackTransportMaster); + //jackTransportMasterCheckbox->setEnabled(MusEGlobal::useJackTransport); + syncDelaySpinBox->setValue(MusEGlobal::syncSendFirstClockDelay); syncDelaySpinBox->blockSignals(false); jackTransportMasterCheckbox->blockSignals(false); useJackTransportCheckbox->blockSignals(false); extSyncCheckbox->blockSignals(false); - mtcSyncType->setCurrentIndex(mtcType); + mtcSyncType->setCurrentIndex(MusEGlobal::mtcType); mtcOffH->blockSignals(true); mtcOffM->blockSignals(true); mtcOffS->blockSignals(true); mtcOffF->blockSignals(true); mtcOffSf->blockSignals(true); - mtcOffH->setValue(mtcOffset.h()); - mtcOffM->setValue(mtcOffset.m()); - mtcOffS->setValue(mtcOffset.s()); - mtcOffF->setValue(mtcOffset.f()); - mtcOffSf->setValue(mtcOffset.sf()); + mtcOffH->setValue(MusEGlobal::mtcOffset.h()); + mtcOffM->setValue(MusEGlobal::mtcOffset.m()); + mtcOffS->setValue(MusEGlobal::mtcOffset.s()); + mtcOffF->setValue(MusEGlobal::mtcOffset.f()); + mtcOffSf->setValue(MusEGlobal::mtcOffset.sf()); mtcOffH->blockSignals(false); mtcOffM->blockSignals(false); mtcOffS->blockSignals(false); @@ -393,10 +393,10 @@ void MidiSyncConfig::heartBeat() int port = lvi->port(); if(port >= 0 && port < MIDI_PORTS) { - bool sdet = midiPorts[port].syncInfo().MCSyncDetect(); + bool sdet = MusEGlobal::midiPorts[port].syncInfo().MCSyncDetect(); if(sdet) { - if(port == curMidiSyncInPort) + if(port == MusEGlobal::curMidiSyncInPort) { if(!lvi->_curDet) { @@ -432,7 +432,7 @@ void MidiSyncConfig::heartBeat() } } - sdet = midiPorts[port].syncInfo().tickDetect(); + sdet = MusEGlobal::midiPorts[port].syncInfo().tickDetect(); if(sdet) { if(!lvi->_tickDet) @@ -456,7 +456,7 @@ void MidiSyncConfig::heartBeat() } } - sdet = midiPorts[port].syncInfo().MRTDetect(); + sdet = MusEGlobal::midiPorts[port].syncInfo().MRTDetect(); if(sdet) { if(!lvi->_MRTDet) @@ -480,9 +480,9 @@ void MidiSyncConfig::heartBeat() } } - int type = midiPorts[port].syncInfo().recMTCtype(); - sdet = midiPorts[port].syncInfo().MMCDetect(); - bool mtcdet = midiPorts[port].syncInfo().MTCDetect(); + int type = MusEGlobal::midiPorts[port].syncInfo().recMTCtype(); + sdet = MusEGlobal::midiPorts[port].syncInfo().MMCDetect(); + bool mtcdet = MusEGlobal::midiPorts[port].syncInfo().MTCDetect(); if(sdet) { if(!lvi->_MMCDet) @@ -531,7 +531,7 @@ void MidiSyncConfig::heartBeat() if(mtcdet) { - if(port == curMidiSyncInPort) + if(port == MusEGlobal::curMidiSyncInPort) { if(!lvi->_curMTCDet) { @@ -591,7 +591,7 @@ void MidiSyncConfig::heartBeat() } } - //MidiDevice* dev = lvi->device(); + //MusECore::MidiDevice* dev = lvi->device(); //bool sdet = dev->syncInfo().MCSyncDetect(); //if(lvi->pixmap(DEVCOL_IN) != (sdet ? *dotIcon : *dothIcon)) // lvi->setIcon(DEVCOL_IN, QIcon( sdet ? *dotIcon : *dothIcon)); @@ -611,7 +611,7 @@ void MidiSyncConfig::syncChanged() { setDirty(); - //jackTransportMasterCheckbox->setEnabled(useJackTransport); + //MusEGlobal::jackTransportMasterCheckbox->setEnabled(MusEGlobal::useJackTransport); //acceptMTCCheckbox->setEnabled(val); // acceptMTCCheckbox->setEnabled(false); @@ -628,7 +628,7 @@ void MidiSyncConfig::extSyncChanged(bool v) extSyncCheckbox->blockSignals(true); extSyncCheckbox->setChecked(v); // if(v) -// song->setMasterFlag(false); +// MusEGlobal::song->setMasterFlag(false); extSyncCheckbox->blockSignals(false); } @@ -662,7 +662,7 @@ void MidiSyncConfig::cancel() void MidiSyncConfig::show() { songChanged(-1); - connect(song, SIGNAL(songChanged(int)), SLOT(songChanged(int))); + connect(MusEGlobal::song, SIGNAL(songChanged(int)), SLOT(songChanged(int))); connect(MusEGlobal::heartBeatTimer, SIGNAL(timeout()), SLOT(heartBeat())); QDialog::show(); } @@ -691,7 +691,7 @@ void MidiSyncConfig::closeEvent(QCloseEvent* e) } disconnect(MusEGlobal::heartBeatTimer, SIGNAL(timeout()), this, SLOT(heartBeat())); - disconnect(song, SIGNAL(songChanged(int)), this, SLOT(songChanged(int))); + disconnect(MusEGlobal::song, SIGNAL(songChanged(int)), this, SLOT(songChanged(int))); e->accept(); } @@ -711,29 +711,29 @@ void MidiSyncConfig::apply() // genMCSync = mcSync->isChecked(); // genMMC = midiMachineControl->isChecked(); - syncSendFirstClockDelay = syncDelaySpinBox->value(); + MusEGlobal::syncSendFirstClockDelay = syncDelaySpinBox->value(); - mtcType = mtcSyncType->currentIndex(); - //extSyncFlag.setValue(syncMode->id(syncMode->selected())); - //extSyncFlag.blockSignals(true); - extSyncFlag.setValue(extSyncCheckbox->isChecked()); -// if(extSyncFlag.value()) -// song->setMasterFlag(false); - //extSyncFlag.blockSignals(false); - useJackTransport.setValue(useJackTransportCheckbox->isChecked()); -// if(useJackTransport) - jackTransportMaster = jackTransportMasterCheckbox->isChecked(); + MusEGlobal::mtcType = mtcSyncType->currentIndex(); + //MusEGlobal::extSyncFlag.setValue(syncMode->id(syncMode->selected())); + //MusEGlobal::extSyncFlag.blockSignals(true); + MusEGlobal::extSyncFlag.setValue(extSyncCheckbox->isChecked()); +// if(MusEGlobal::extSyncFlag.value()) +// MusEGlobal::song->setMasterFlag(false); + //MusEGlobal::extSyncFlag.blockSignals(false); + MusEGlobal::useJackTransport.setValue(useJackTransportCheckbox->isChecked()); +// if(MusEGlobal::useJackTransport) + MusEGlobal::jackTransportMaster = jackTransportMasterCheckbox->isChecked(); // else -// jackTransportMaster = false; -// jackTransportMasterCheckbox->setEnabled(useJackTransport); - if(audioDevice) - audioDevice->setMaster(jackTransportMaster); +// MusEGlobal::jackTransportMaster = false; +// MusEGlobal::jackTransportMasterCheckbox->setEnabled(MusEGlobal::useJackTransport); + if(MusEGlobal::audioDevice) + MusEGlobal::audioDevice->setMaster(MusEGlobal::jackTransportMaster); - mtcOffset.setH(mtcOffH->value()); - mtcOffset.setM(mtcOffM->value()); - mtcOffset.setS(mtcOffS->value()); - mtcOffset.setF(mtcOffF->value()); - mtcOffset.setSf(mtcOffSf->value()); + MusEGlobal::mtcOffset.setH(mtcOffH->value()); + MusEGlobal::mtcOffset.setM(mtcOffM->value()); + MusEGlobal::mtcOffset.setS(mtcOffS->value()); + MusEGlobal::mtcOffset.setF(mtcOffF->value()); + MusEGlobal::mtcOffset.setSf(mtcOffSf->value()); // acceptMC = acceptMCCheckbox->isChecked(); // acceptMMC = acceptMMCCheckbox->isChecked(); @@ -745,14 +745,14 @@ void MidiSyncConfig::apply() for (int i = MIDI_PORTS-1; i >= 0; --i) { MidiSyncLViewItem* lvi = (MidiSyncLViewItem*)devicesListView->topLevelItem(i); - //MidiDevice* dev = lvi->device(); + //MusECore::MidiDevice* dev = lvi->device(); // Does the device really exist? //if(midiDevices.find(dev) != midiDevices.end()) // dev->syncInfo().copyParams(lvi->syncInfo()); int port = lvi->port(); if(port >= 0 && port < MIDI_PORTS) - //midiPorts[port].syncInfo().copyParams(lvi->syncInfo()); - lvi->copyToSyncInfo(midiPorts[port].syncInfo()); + //MusEGlobal::midiPorts[port].syncInfo().copyParams(lvi->syncInfo()); + lvi->copyToSyncInfo(MusEGlobal::midiPorts[port].syncInfo()); } @@ -775,8 +775,8 @@ void MidiSyncConfig::updateSyncInfoLV() devicesListView->clear(); for(int i = 0; i < MIDI_PORTS; ++i) { - MidiPort* port = &midiPorts[i]; - MidiDevice* dev = port->device(); + MusECore::MidiPort* port = &MusEGlobal::midiPorts[i]; + MusECore::MidiDevice* dev = port->device(); // p3.3.31 // Don't show if it is a synthesizer device. // Hmm, some synths might support transport commands or even sync? @@ -791,10 +791,10 @@ void MidiSyncConfig::updateSyncInfoLV() s.setNum(i+1); MidiSyncLViewItem* lvi = new MidiSyncLViewItem(devicesListView); lvi->setPort(i); // setPort will copy parameters. - //MidiSyncInfo& si = lvi->syncInfo(); + //MusECore::MidiSyncInfo& si = lvi->syncInfo(); //si.copyParams(port->syncInfo()); //lvi.copyFromSyncInfo(port->syncInfo()); - MidiSyncInfo& portsi = port->syncInfo(); + MusECore::MidiSyncInfo& portsi = port->syncInfo(); lvi->setText(DEVCOL_NO, s); @@ -805,7 +805,7 @@ void MidiSyncConfig::updateSyncInfoLV() if(portsi.MCSyncDetect()) { - if(i == curMidiSyncInPort) + if(i == MusEGlobal::curMidiSyncInPort) { lvi->_curDet = true; lvi->_inDet = false; @@ -882,7 +882,7 @@ void MidiSyncConfig::updateSyncInfoLV() if(portsi.MTCDetect()) { - if(i == curMidiSyncInPort) + if(i == MusEGlobal::curMidiSyncInPort) { lvi->_curMTCDet = true; lvi->_MTCDet = false; @@ -990,17 +990,17 @@ void MidiSyncConfig::updateSyncInfoLV() /* - for(iMidiDevice id = midiDevices.begin(); id != midiDevices.end(); ++id) + for(MusECore::iMidiDevice id = midiDevices.begin(); id != midiDevices.end(); ++id) { - MidiDevice* dev = *id; + MusECore::MidiDevice* dev = *id; - //MidiPort* port = &midiPorts[i]; - //MidiDevice* dev = port->device(); + //MusECore::MidiPort* port = &MusEGlobal::midiPorts[i]; + //MusECore::MidiDevice* dev = port->device(); MidiSyncLViewItem* lvi = new MidiSyncLViewItem(devicesListView); //lvi->setPort(i); // setDevice will copy parameters. lvi->setDevice(dev); - MidiSyncInfo& si = lvi->syncInfo(); + MusECore::MidiSyncInfo& si = lvi->syncInfo(); //si.copyParams(dev->syncInfo()); lvi->setText(DEVCOL_NAME, dev->name()); @@ -1037,18 +1037,18 @@ void MidiSyncConfig::dlvClicked(QTreeWidgetItem* item, int col) int no = lvi->port(); if (no < 0 || no >= MIDI_PORTS) return; - //MidiDevice* dev = lvi->device(); + //MusECore::MidiDevice* dev = lvi->device(); // Does the device really exist? //if(midiDevices.find(dev) == midiDevices.end()) // return; //int n; - //MidiPort* port = &midiPorts[no]; - //MidiDevice* dev = port->device(); + //MusECore::MidiPort* port = &MusEGlobal::midiPorts[no]; + //MusECore::MidiDevice* dev = port->device(); //int rwFlags = dev ? dev->rwFlags() : 0; //int openFlags = dev ? dev->openFlags() : 0; - //MidiSyncInfo& si = lvi->syncInfo(); - //MidiSyncInfo& portsi = midiPorts[no].syncInfo(); + //MusECore::MidiSyncInfo& si = lvi->syncInfo(); + //MusECore::MidiSyncInfo& portsi = MusEGlobal::midiPorts[no].syncInfo(); switch (col) { @@ -1060,18 +1060,18 @@ void MidiSyncConfig::dlvClicked(QTreeWidgetItem* item, int col) // If this is not the current midi sync in port, and sync in from this port is enabled, // and sync is in fact detected on this port, allow the user to force this port to now be the // current sync in port. - //if(no != curMidiSyncInPort && si.MCIn() && midiPorts[no].syncInfo().MCSyncDetect()) - //if(no != curMidiSyncInPort && lvi->_recMC && midiPorts[no].syncInfo().MCSyncDetect()) - if(no != curMidiSyncInPort) + //if(no != MusEGlobal::curMidiSyncInPort && si.MCIn() && MusEGlobal::midiPorts[no].syncInfo().MCSyncDetect()) + //if(no != MusEGlobal::curMidiSyncInPort && lvi->_recMC && MusEGlobal::midiPorts[no].syncInfo().MCSyncDetect()) + if(no != MusEGlobal::curMidiSyncInPort) { - if(lvi->_recMC && midiPorts[no].syncInfo().MCSyncDetect()) + if(lvi->_recMC && MusEGlobal::midiPorts[no].syncInfo().MCSyncDetect()) { - curMidiSyncInPort = no; + MusEGlobal::curMidiSyncInPort = no; lvi->setIcon(DEVCOL_IN, QIcon( *record1_Icon)); } - if(lvi->_recMTC && midiPorts[no].syncInfo().MTCDetect()) + if(lvi->_recMTC && MusEGlobal::midiPorts[no].syncInfo().MTCDetect()) { - curMidiSyncInPort = no; + MusEGlobal::curMidiSyncInPort = no; lvi->setIcon(DEVCOL_MTCIN, QIcon( *record1_Icon)); } } @@ -1084,18 +1084,18 @@ void MidiSyncConfig::dlvClicked(QTreeWidgetItem* item, int col) // If this is not the current midi sync in port, and sync in from this port is enabled, // and sync is in fact detected on this port, allow the user to force this port to now be the // current sync in port. - //if(no != curMidiSyncInPort && si.MTCIn() && midiPorts[no].syncInfo().MTCDetect()) - //if(no != curMidiSyncInPort && lvi->_recMTC && midiPorts[no].syncInfo().MTCDetect()) - if(no != curMidiSyncInPort) + //if(no != MusEGlobal::curMidiSyncInPort && si.MTCIn() && MusEGlobal::midiPorts[no].syncInfo().MTCDetect()) + //if(no != MusEGlobal::curMidiSyncInPort && lvi->_recMTC && MusEGlobal::midiPorts[no].syncInfo().MTCDetect()) + if(no != MusEGlobal::curMidiSyncInPort) { - if(lvi->_recMTC && midiPorts[no].syncInfo().MTCDetect()) + if(lvi->_recMTC && MusEGlobal::midiPorts[no].syncInfo().MTCDetect()) { - curMidiSyncInPort = no; + MusEGlobal::curMidiSyncInPort = no; lvi->setIcon(DEVCOL_MTCIN, QIcon( *record1_Icon)); } - if(lvi->_recMC && midiPorts[no].syncInfo().MCSyncDetect()) + if(lvi->_recMC && MusEGlobal::midiPorts[no].syncInfo().MCSyncDetect()) { - curMidiSyncInPort = no; + MusEGlobal::curMidiSyncInPort = no; lvi->setIcon(DEVCOL_IN, QIcon( *record1_Icon)); } } @@ -1266,4 +1266,4 @@ void MidiSyncConfig::setDirty() applyButton->setEnabled(true); } -} // namespace MusEWidget +} // namespace MusEGui diff --git a/muse2/muse/widgets/midisyncimpl.h b/muse2/muse/widgets/midisyncimpl.h index 50df186e..9c22b55f 100644 --- a/muse2/muse/widgets/midisyncimpl.h +++ b/muse2/muse/widgets/midisyncimpl.h @@ -31,7 +31,7 @@ class QCloseEvent; class QDialog; class QTreeWidgetItem; -namespace MusEWidget { +namespace MusEGui { //---------------------------------------------------------- // MidiSyncLViewItem @@ -39,7 +39,7 @@ namespace MusEWidget { class MidiSyncLViewItem : public QTreeWidgetItem { - //MidiSyncInfo _syncInfo; + //MusECore::MidiSyncInfo _syncInfo; //MidiDevice* _device; int _port; @@ -87,9 +87,9 @@ class MidiSyncLViewItem : public QTreeWidgetItem //MidiDevice* device() const { return _device; } //void setDevice(MidiDevice* d); - //MidiSyncInfo& syncInfo() { return _syncInfo; } - void copyFromSyncInfo(const MidiSyncInfo &sp); - void copyToSyncInfo(MidiSyncInfo &sp); + //MusECore::MidiSyncInfo& syncInfo() { return _syncInfo; } + void copyFromSyncInfo(const MusECore::MidiSyncInfo &sp); + void copyToSyncInfo(MusECore::MidiSyncInfo &sp); }; //--------------------------------------------------------- @@ -129,7 +129,7 @@ class MidiSyncConfig : public QDialog, public Ui::MidiSyncConfigBase { void setDirty(); }; -} // namespace MusEWidget +} // namespace MusEGui #endif diff --git a/muse2/muse/widgets/mittransposebase.ui b/muse2/muse/widgets/mittransposebase.ui index 06a18029..5115b0e7 100644 --- a/muse2/muse/widgets/mittransposebase.ui +++ b/muse2/muse/widgets/mittransposebase.ui @@ -44,7 +44,7 @@ </widget> </item> <item> - <widget class="MusEWidget::PitchEdit" name="triggerKeySpinBox" native="true"/> + <widget class="MusEGui::PitchEdit" name="triggerKeySpinBox" native="true"/> </item> <item> <widget class="QLabel" name="TextLabel2"> @@ -101,7 +101,7 @@ <layoutdefault spacing="6" margin="11"/> <customwidgets> <customwidget> - <class>MusEWidget::PitchEdit</class> + <class>MusEGui::PitchEdit</class> <extends>QWidget</extends> <header>pitchedit.h</header> </customwidget> diff --git a/muse2/muse/widgets/mixdowndialog.cpp b/muse2/muse/widgets/mixdowndialog.cpp index 01c1d049..b97d402d 100644 --- a/muse2/muse/widgets/mixdowndialog.cpp +++ b/muse2/muse/widgets/mixdowndialog.cpp @@ -26,6 +26,8 @@ #include "mixdowndialog.h" #include "wave.h" +namespace MusECore { + //--------------------------------------------------------- // sndFileOpen // sf - old soundfile, used to preset file parameters @@ -33,20 +35,22 @@ SndFile* getSndFile(const SndFile* sf, QWidget* parent) { - MusEWidget::MixdownFileDialog* dialog = new MusEWidget::MixdownFileDialog(sf, parent); + MusEGui::MixdownFileDialog* dialog = new MusEGui::MixdownFileDialog(sf, parent); dialog->exec(); - SndFile* sndFile = dialog->sndFile(); + MusECore::SndFile* sndFile = dialog->sndFile(); delete dialog; return sndFile; } -namespace MusEWidget { +} // namespace MusECore + +namespace MusEGui { //--------------------------------------------------------- // MixdownFileDialog //--------------------------------------------------------- -MixdownFileDialog::MixdownFileDialog(const SndFile* _sf, +MixdownFileDialog::MixdownFileDialog(const MusECore::SndFile* _sf, QWidget* parent, Qt::WFlags fl) : QDialog(parent, fl) { @@ -100,7 +104,7 @@ void MixdownFileDialog::accept() } if (path.right(4) != ".wav") path += ".wav"; - sf = new SndFile(path); + sf = new MusECore::SndFile(path); sf->setFormat(format, channel, MusEGlobal::sampleRate); done(1); } @@ -120,4 +124,4 @@ void MixdownFileDialog::fdialog() editPath->setText(path); } -} // namespace MusEWidget +} // namespace MusEGui diff --git a/muse2/muse/widgets/mixdowndialog.h b/muse2/muse/widgets/mixdowndialog.h index cca60178..c639e71e 100644 --- a/muse2/muse/widgets/mixdowndialog.h +++ b/muse2/muse/widgets/mixdowndialog.h @@ -27,11 +27,12 @@ class QWidget; +namespace MusECore { class SndFile; - extern SndFile* getSndFile(const SndFile* sf, QWidget* parent); +} -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // MixdownFileDialog @@ -39,16 +40,16 @@ namespace MusEWidget { class MixdownFileDialog : public QDialog, public Ui::MixdownFileDialogBase { Q_OBJECT - SndFile* sf; + MusECore::SndFile* sf; private slots: void fdialog(); virtual void accept(); public: - MixdownFileDialog(const SndFile* f, QWidget* parent = 0, + MixdownFileDialog(const MusECore::SndFile* f, QWidget* parent = 0, Qt::WFlags fl = 0); - SndFile* sndFile() { return sf; } + MusECore::SndFile* sndFile() { return sf; } }; } diff --git a/muse2/muse/widgets/mlabel.cpp b/muse2/muse/widgets/mlabel.cpp index 071427b6..3b7160cc 100644 --- a/muse2/muse/widgets/mlabel.cpp +++ b/muse2/muse/widgets/mlabel.cpp @@ -22,11 +22,11 @@ #include "mlabel.h" -namespace MusEWidget { +namespace MusEGui { void MLabel::mousePressEvent(QMouseEvent*) { emit mousePressed(); } -} // namespace MusEWidget +} // namespace MusEGui diff --git a/muse2/muse/widgets/mlabel.h b/muse2/muse/widgets/mlabel.h index 64a52220..bfdf4955 100644 --- a/muse2/muse/widgets/mlabel.h +++ b/muse2/muse/widgets/mlabel.h @@ -25,7 +25,7 @@ #include <QLabel> -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // MLabel @@ -51,7 +51,7 @@ class MLabel : public QLabel { : QLabel(parent) {setObjectName(name);}; }; -} // namespace MusEWidget +} // namespace MusEGui #endif diff --git a/muse2/muse/widgets/mmath.cpp b/muse2/muse/widgets/mmath.cpp index 52dffea2..00f66101 100644 --- a/muse2/muse/widgets/mmath.cpp +++ b/muse2/muse/widgets/mmath.cpp @@ -46,7 +46,7 @@ // qwtInt -- Return nearest integer // qwtLim -- Limit a values -namespace MusEUtil { +namespace MusECore { //------------------------------------------------------------ //.F qwtGetMin @@ -322,4 +322,4 @@ void qwtLogSpace(double *array, int size, double xmin, double xmax) } -} // namespace MusEUtil +} // namespace MusECore diff --git a/muse2/muse/widgets/mmath.h b/muse2/muse/widgets/mmath.h index 813aed93..dc066711 100644 --- a/muse2/muse/widgets/mmath.h +++ b/muse2/muse/widgets/mmath.h @@ -27,7 +27,7 @@ #define LOG_MIN 1.0e-100 #define LOG_MAX 1.0e100 -namespace MusEUtil { +namespace MusECore { double qwtCeil125(double x); double qwtFloor125(double x); diff --git a/muse2/muse/widgets/mtrackinfo.cpp b/muse2/muse/widgets/mtrackinfo.cpp index 57674395..33462d0c 100644 --- a/muse2/muse/widgets/mtrackinfo.cpp +++ b/muse2/muse/widgets/mtrackinfo.cpp @@ -47,13 +47,13 @@ #include "popupmenu.h" #include "routepopup.h" -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // setTrack //--------------------------------------------------------- -void MidiTrackInfo::setTrack(Track* t) +void MidiTrackInfo::setTrack(MusECore::Track* t) { if(!t) { @@ -68,11 +68,11 @@ void MidiTrackInfo::setTrack(Track* t) trackNameLabel->setObjectName(selected->cname()); /*QPalette pal; - if(selected->type() == Track::DRUM) { - pal.setColor(trackNameLabel->backgroundRole(), MusEConfig::config.drumTrackLabelBg); + if(selected->type() == MusECore::Track::DRUM) { + pal.setColor(trackNameLabel->backgroundRole(), MusEGlobal::config.drumTrackLabelBg); iOutputChannel->setEnabled(false); } else { - pal.setColor(trackNameLabel->backgroundRole(), MusEConfig::config.midiTrackLabelBg); + pal.setColor(trackNameLabel->backgroundRole(), MusEGlobal::config.midiTrackLabelBg); iOutputChannel->setEnabled(true); } trackNameLabel->setPalette(pal); */ @@ -85,7 +85,7 @@ void MidiTrackInfo::setTrack(Track* t) // midiTrackInfo //--------------------------------------------------------- -MidiTrackInfo::MidiTrackInfo(QWidget* parent, Track* sel_track) : QWidget(parent) +MidiTrackInfo::MidiTrackInfo(QWidget* parent, MusECore::Track* sel_track) : QWidget(parent) { setupUi(this); _midiDetect = false; @@ -95,16 +95,16 @@ MidiTrackInfo::MidiTrackInfo(QWidget* parent, Track* sel_track) : QWidget(parent // Since program covers 3 controls at once, it is in 'midi controller' units rather than 'gui control' units. //program = -1; - program = CTRL_VAL_UNKNOWN; + program = MusECore::CTRL_VAL_UNKNOWN; pan = -65; volume = -1; - setFont(MusEConfig::config.fonts[2]); + setFont(MusEGlobal::config.fonts[2]); //iChanDetectLabel->setPixmap(*darkgreendotIcon); iChanDetectLabel->setPixmap(*darkRedLedIcon); - recEchoButton->setIcon((selected && ((MidiTrack*)selected)->recEcho()) ? QIcon(*midiThruOnIcon) : QIcon(*midiThruOffIcon)); + recEchoButton->setIcon((selected && ((MusECore::MidiTrack*)selected)->recEcho()) ? QIcon(*midiThruOnIcon) : QIcon(*midiThruOffIcon)); recEchoButton->setIconSize(midiThruOnIcon->size()); // MusE-2: AlignCenter and WordBreak are set in the ui(3) file, but not supported by QLabel. Turn them on here. @@ -122,10 +122,10 @@ MidiTrackInfo::MidiTrackInfo(QWidget* parent, Track* sel_track) : QWidget(parent /*QPalette pal; QColor c; //pal.setColor(trackNameLabel->backgroundRole(), QColor(0, 160, 255)); // Med blue - if(selected->type() == Track::DRUM) - c = MusEConfig::config.drumTrackLabelBg; + if(selected->type() == MusECore::Track::DRUM) + c = MusEGlobal::config.drumTrackLabelBg; else - c = MusEConfig::config.midiTrackLabelBg; + c = MusEGlobal::config.midiTrackLabelBg; QLinearGradient gradient(trackNameLabel->geometry().topLeft(), trackNameLabel->geometry().bottomLeft()); //gradient.setColorAt(0, c.darker()); @@ -140,7 +140,7 @@ MidiTrackInfo::MidiTrackInfo(QWidget* parent, Track* sel_track) : QWidget(parent } //else //{ - // pal.setColor(trackNameLabel->backgroundRole(), MusEConfig::config.midiTrackLabelBg); + // pal.setColor(trackNameLabel->backgroundRole(), MusEGlobal::config.midiTrackLabelBg); // trackNameLabel->setPalette(pal); //} @@ -197,7 +197,7 @@ MidiTrackInfo::MidiTrackInfo(QWidget* parent, Track* sel_track) : QWidget(parent //oRButton->setVisible(false); connect(oRButton, SIGNAL(pressed()), SLOT(outRoutesPressed())); - connect(song, SIGNAL(songChanged(int)), SLOT(songChanged(int))); + connect(MusEGlobal::song, SIGNAL(songChanged(int)), SLOT(songChanged(int))); connect(MusEGlobal::muse, SIGNAL(configChanged()), SLOT(configChanged())); connect(MusEGlobal::heartBeatTimer, SIGNAL(timeout()), SLOT(heartBeat())); @@ -214,11 +214,11 @@ void MidiTrackInfo::heartBeat() return; switch(selected->type()) { - case Track::MIDI: - case Track::DRUM: - case Track::NEW_DRUM: + case MusECore::Track::MIDI: + case MusECore::Track::DRUM: + case MusECore::Track::NEW_DRUM: { - MidiTrack* track = (MidiTrack*)selected; + MusECore::MidiTrack* track = (MusECore::MidiTrack*)selected; int outChannel = track->outChannel(); int outPort = track->outPort(); @@ -226,7 +226,7 @@ void MidiTrackInfo::heartBeat() //int iptMask = track->inPortMask(); ///unsigned int iptMask = track->inPortMask(); - MidiPort* mp = &midiPorts[outPort]; + MusECore::MidiPort* mp = &MusEGlobal::midiPorts[outPort]; // Set record echo. //if(recEchoButton->isChecked() != track->recEcho()) @@ -239,15 +239,15 @@ void MidiTrackInfo::heartBeat() // Check for detection of midi general activity on chosen channels... int mpt = 0; //int mch = 0; - RouteList* rl = track->inRoutes(); + MusECore::RouteList* rl = track->inRoutes(); - ciRoute r = rl->begin(); + MusECore::ciRoute r = rl->begin(); //for( ; mpt < MIDI_PORTS; ++mpt) for( ; r != rl->end(); ++r) { //if(!r->isValid() || ((r->type != Route::ALSA_MIDI_ROUTE) && (r->type != Route::JACK_MIDI_ROUTE))) //if(!r->isValid() || (r->type != Route::MIDI_DEVICE_ROUTE)) - if(!r->isValid() || (r->type != Route::MIDI_PORT_ROUTE)) // p3.3.49 + if(!r->isValid() || (r->type != MusECore::Route::MIDI_PORT_ROUTE)) // p3.3.49 continue; // NOTE: TODO: Code for channelless events like sysex, ** IF we end up using the 'special channel 17' method. @@ -263,10 +263,10 @@ void MidiTrackInfo::heartBeat() //for(; mch < MIDI_CHANNELS; ++mch) //{ - //if(midiPorts[mpt].syncInfo().actDetect(mch) && (iptMask & (1 << mpt)) && (ichMask & (1 << mch)) ) - //if((iptMask & bitShiftLU[mpt]) && (midiPorts[mpt].syncInfo().actDetectBits() & ichMask) ) - //if(midiPorts[mpt].syncInfo().actDetectBits() & bitShiftLU[r->channel]) - if(midiPorts[mpt].syncInfo().actDetectBits() & r->channel) // p3.3.50 Use new channel mask. + //if(MusEGlobal::midiPorts[mpt].syncInfo().actDetect(mch) && (iptMask & (1 << mpt)) && (ichMask & (1 << mch)) ) + //if((iptMask & bitShiftLU[mpt]) && (MusEGlobal::midiPorts[mpt].syncInfo().actDetectBits() & ichMask) ) + //if(MusEGlobal::midiPorts[mpt].syncInfo().actDetectBits() & bitShiftLU[r->channel]) + if(MusEGlobal::midiPorts[mpt].syncInfo().actDetectBits() & r->channel) // p3.3.50 Use new channel mask. { //if(iChanTextLabel->paletteBackgroundColor() != green) // iChanTextLabel->setPaletteBackgroundColor(green); @@ -301,14 +301,14 @@ void MidiTrackInfo::heartBeat() } } - int nprogram = mp->hwCtrlState(outChannel, CTRL_PROGRAM); - if(nprogram == CTRL_VAL_UNKNOWN) + int nprogram = mp->hwCtrlState(outChannel, MusECore::CTRL_PROGRAM); + if(nprogram == MusECore::CTRL_VAL_UNKNOWN) { - if(program != CTRL_VAL_UNKNOWN) + if(program != MusECore::CTRL_VAL_UNKNOWN) { //printf("Arranger::midiTrackInfoHeartBeat setting program to unknown\n"); - program = CTRL_VAL_UNKNOWN; + program = MusECore::CTRL_VAL_UNKNOWN; if(iHBank->value() != 0) { iHBank->blockSignals(true); @@ -329,8 +329,8 @@ void MidiTrackInfo::heartBeat() } } - nprogram = mp->lastValidHWCtrlState(outChannel, CTRL_PROGRAM); - if(nprogram == CTRL_VAL_UNKNOWN) + nprogram = mp->lastValidHWCtrlState(outChannel, MusECore::CTRL_PROGRAM); + if(nprogram == MusECore::CTRL_VAL_UNKNOWN) { //const char* n = "<unknown>"; const QString n(tr("<unknown>")); @@ -344,8 +344,8 @@ void MidiTrackInfo::heartBeat() } else { - MidiInstrument* instr = mp->instrument(); - QString name = instr->getPatchName(outChannel, nprogram, song->mtype(), track->type() == Track::DRUM); //FINDMICHJETZT was soll das? + MusECore::MidiInstrument* instr = mp->instrument(); + QString name = instr->getPatchName(outChannel, nprogram, MusEGlobal::song->mtype(), track->type() == MusECore::Track::DRUM); //FINDMICHJETZT was soll das? if(name.isEmpty()) { const QString n("???"); @@ -384,14 +384,14 @@ void MidiTrackInfo::heartBeat() program = nprogram; //int hb, lb, pr; - //if (program == CTRL_VAL_UNKNOWN) { + //if (program == MusECore::CTRL_VAL_UNKNOWN) { // hb = lb = pr = 0; // iPatch->setText("---"); // } //else //{ - MidiInstrument* instr = mp->instrument(); - QString name = instr->getPatchName(outChannel, program, song->mtype(), track->type() == Track::DRUM); //FINDMICHJETZT was soll das? + MusECore::MidiInstrument* instr = mp->instrument(); + QString name = instr->getPatchName(outChannel, program, MusEGlobal::song->mtype(), track->type() == MusECore::Track::DRUM); //FINDMICHJETZT was soll das? if(iPatch->text() != name) iPatch->setText(name); @@ -430,13 +430,13 @@ void MidiTrackInfo::heartBeat() } } - MidiController* mc = mp->midiController(CTRL_VOLUME); + MusECore::MidiController* mc = mp->midiController(MusECore::CTRL_VOLUME); int mn = mc->minVal(); - int v = mp->hwCtrlState(outChannel, CTRL_VOLUME); - if(v == CTRL_VAL_UNKNOWN) + int v = mp->hwCtrlState(outChannel, MusECore::CTRL_VOLUME); + if(v == MusECore::CTRL_VAL_UNKNOWN) //{ //v = mc->initVal(); - //if(v == CTRL_VAL_UNKNOWN) + //if(v == MusECore::CTRL_VAL_UNKNOWN) // v = 0; v = mn - 1; //} @@ -457,13 +457,13 @@ void MidiTrackInfo::heartBeat() } } - mc = mp->midiController(CTRL_PANPOT); + mc = mp->midiController(MusECore::CTRL_PANPOT); mn = mc->minVal(); - v = mp->hwCtrlState(outChannel, CTRL_PANPOT); - if(v == CTRL_VAL_UNKNOWN) + v = mp->hwCtrlState(outChannel, MusECore::CTRL_PANPOT); + if(v == MusECore::CTRL_VAL_UNKNOWN) //{ //v = mc->initVal(); - //if(v == CTRL_VAL_UNKNOWN) + //if(v == MusECore::CTRL_VAL_UNKNOWN) // v = 0; v = mn - 1; //} @@ -503,12 +503,12 @@ void MidiTrackInfo::heartBeat() } break; - case Track::WAVE: - case Track::AUDIO_OUTPUT: - case Track::AUDIO_INPUT: - case Track::AUDIO_GROUP: - case Track::AUDIO_AUX: - case Track::AUDIO_SOFTSYNTH: + case MusECore::Track::WAVE: + case MusECore::Track::AUDIO_OUTPUT: + case MusECore::Track::AUDIO_INPUT: + case MusECore::Track::AUDIO_GROUP: + case MusECore::Track::AUDIO_AUX: + case MusECore::Track::AUDIO_SOFTSYNTH: break; } } @@ -521,15 +521,15 @@ void MidiTrackInfo::configChanged() { //printf("MidiTrackInfo::configChanged\n"); - //if (MusEConfig::config.canvasBgPixmap.isEmpty()) { - // canvas->setBg(MusEConfig::config.partCanvasBg); + //if (MusEGlobal::config.canvasBgPixmap.isEmpty()) { + // canvas->setBg(MusEGlobal::config.partCanvasBg); // canvas->setBg(QPixmap()); //} //else { - // canvas->setBg(QPixmap(MusEConfig::config.canvasBgPixmap)); + // canvas->setBg(QPixmap(MusEGlobal::config.canvasBgPixmap)); //} - setFont(MusEConfig::config.fonts[2]); + setFont(MusEGlobal::config.fonts[2]); //updateTrackInfo(type); } @@ -555,7 +555,7 @@ void MidiTrackInfo::songChanged(int type) void MidiTrackInfo::setLabelText() { - MidiTrack* track = (MidiTrack*)selected; + MusECore::MidiTrack* track = (MusECore::MidiTrack*)selected; if(track) trackNameLabel->setText(track->name()); else @@ -566,12 +566,12 @@ void MidiTrackInfo::setLabelText() QPalette pal; QColor c; //pal.setColor(trackNameLabel->backgroundRole(), QColor(0, 160, 255)); // Med blue - if(track->type() == Track::DRUM) - c = MusEConfig::config.drumTrackLabelBg; - else if (track->type() == Track::MIDI) - c = MusEConfig::config.midiTrackLabelBg; - else if (track->type() == Track::NEW_DRUM) - c = MusEConfig::config.newDrumTrackLabelBg; + if(track->type() == MusECore::Track::DRUM) + c = MusEGlobal::config.drumTrackLabelBg; + else if (track->type() == MusECore::Track::MIDI) + c = MusEGlobal::config.midiTrackLabelBg; + else if (track->type() == MusECore::Track::NEW_DRUM) + c = MusEGlobal::config.newDrumTrackLabelBg; else printf("THIS SHOULD NEVER HAPPEN: track is not a MIDI track in MidiTrackInfo::setLabelText()!\n"); @@ -596,13 +596,13 @@ void MidiTrackInfo::setLabelFont() { //if(!selected) // return; - //MidiTrack* track = (MidiTrack*)selected; + //MusECore::MidiTrack* track = (MusECore::MidiTrack*)selected; // Use the new font #6 I created just for these labels (so far). // Set the label's font. - trackNameLabel->setFont(MusEConfig::config.fonts[6]); + trackNameLabel->setFont(MusEGlobal::config.fonts[6]); // Dealing with a horizontally constrained label. Ignore vertical. Use a minimum readable point size. - MusEUtil::autoAdjustFontSize(trackNameLabel, trackNameLabel->text(), false, true, MusEConfig::config.fonts[6].pointSize(), 5); + MusECore::autoAdjustFontSize(trackNameLabel, trackNameLabel->text(), false, true, MusEGlobal::config.fonts[6].pointSize(), 5); } //--------------------------------------------------------- @@ -614,21 +614,21 @@ void MidiTrackInfo::iOutputChannelChanged(int channel) --channel; if(!selected) return; - MidiTrack* track = (MidiTrack*)selected; + MusECore::MidiTrack* track = (MusECore::MidiTrack*)selected; if (channel != track->outChannel()) { // Changed by T356. //track->setOutChannel(channel); - audio->msgIdle(true); + MusEGlobal::audio->msgIdle(true); //audio->msgSetTrackOutChannel(track, channel); track->setOutChanAndUpdate(channel); - audio->msgIdle(false); + MusEGlobal::audio->msgIdle(false); // may result in adding/removing mixer strip: - //song->update(-1); - //song->update(SC_MIDI_TRACK_PROP); - audio->msgUpdateSoloStates(); // p4.0.14 - //song->update(SC_MIDI_TRACK_PROP | SC_ROUTE); // - song->update(SC_MIDI_TRACK_PROP); // + //MusEGlobal::song->update(-1); + //MusEGlobal::song->update(SC_MIDI_TRACK_PROP); + MusEGlobal::audio->msgUpdateSoloStates(); // p4.0.14 + //MusEGlobal::song->update(SC_MIDI_TRACK_PROP | SC_ROUTE); // + MusEGlobal::song->update(SC_MIDI_TRACK_PROP); // } } @@ -640,20 +640,20 @@ void MidiTrackInfo::iOutputPortChanged(int index) { if(!selected) return; - MidiTrack* track = (MidiTrack*)selected; + MusECore::MidiTrack* track = (MusECore::MidiTrack*)selected; if (index == track->outPort()) return; // Changed by T356. //track->setOutPort(index); - audio->msgIdle(true); + MusEGlobal::audio->msgIdle(true); //audio->msgSetTrackOutPort(track, index); track->setOutPortAndUpdate(index); - audio->msgIdle(false); + MusEGlobal::audio->msgIdle(false); - //song->update(SC_MIDI_TRACK_PROP); - audio->msgUpdateSoloStates(); // p4.0.14 - //song->update(SC_MIDI_TRACK_PROP | SC_ROUTE); // - song->update(SC_MIDI_TRACK_PROP); // + //MusEGlobal::song->update(SC_MIDI_TRACK_PROP); + MusEGlobal::audio->msgUpdateSoloStates(); // p4.0.14 + //MusEGlobal::song->update(SC_MIDI_TRACK_PROP | SC_ROUTE); // + MusEGlobal::song->update(SC_MIDI_TRACK_PROP); // } //--------------------------------------------------------- @@ -696,7 +696,7 @@ void MidiTrackInfo::iProgHBankChanged() { if(!selected) return; - MidiTrack* track = (MidiTrack*)selected; + MusECore::MidiTrack* track = (MusECore::MidiTrack*)selected; int channel = track->outChannel(); int port = track->outPort(); int hbank = iHBank->value(); @@ -716,20 +716,20 @@ void MidiTrackInfo::iProgHBankChanged() else prog = 0xff; - MidiPort* mp = &midiPorts[port]; + MusECore::MidiPort* mp = &MusEGlobal::midiPorts[port]; if(prog == 0xff && hbank == 0xff && lbank == 0xff) { - program = CTRL_VAL_UNKNOWN; - if(mp->hwCtrlState(channel, CTRL_PROGRAM) != CTRL_VAL_UNKNOWN) - audio->msgSetHwCtrlState(mp, channel, CTRL_PROGRAM, CTRL_VAL_UNKNOWN); + program = MusECore::CTRL_VAL_UNKNOWN; + if(mp->hwCtrlState(channel, MusECore::CTRL_PROGRAM) != MusECore::CTRL_VAL_UNKNOWN) + MusEGlobal::audio->msgSetHwCtrlState(mp, channel, MusECore::CTRL_PROGRAM, MusECore::CTRL_VAL_UNKNOWN); return; } - int np = mp->hwCtrlState(channel, CTRL_PROGRAM); - if(np == CTRL_VAL_UNKNOWN) + int np = mp->hwCtrlState(channel, MusECore::CTRL_PROGRAM); + if(np == MusECore::CTRL_VAL_UNKNOWN) { - np = mp->lastValidHWCtrlState(channel, CTRL_PROGRAM); - if(np != CTRL_VAL_UNKNOWN) + np = mp->lastValidHWCtrlState(channel, MusECore::CTRL_PROGRAM); + if(np != MusECore::CTRL_VAL_UNKNOWN) { lbank = (np & 0xff00) >> 8; prog = np & 0xff; @@ -758,11 +758,11 @@ void MidiTrackInfo::iProgHBankChanged() iProgram->blockSignals(false); } program = (hbank << 16) + (lbank << 8) + prog; - MidiPlayEvent ev(0, port, channel, ME_CONTROLLER, CTRL_PROGRAM, program); - audio->msgPlayMidiEvent(&ev); + MusECore::MidiPlayEvent ev(0, port, channel, MusECore::ME_CONTROLLER, MusECore::CTRL_PROGRAM, program); + MusEGlobal::audio->msgPlayMidiEvent(&ev); - MidiInstrument* instr = mp->instrument(); - iPatch->setText(instr->getPatchName(channel, program, song->mtype(), track->type() == Track::DRUM)); //FINDMICHJETZT was soll das? + MusECore::MidiInstrument* instr = mp->instrument(); + iPatch->setText(instr->getPatchName(channel, program, MusEGlobal::song->mtype(), track->type() == MusECore::Track::DRUM)); //FINDMICHJETZT was soll das? // updateTrackInfo(); } @@ -774,7 +774,7 @@ void MidiTrackInfo::iProgLBankChanged() { if(!selected) return; - MidiTrack* track = (MidiTrack*)selected; + MusECore::MidiTrack* track = (MusECore::MidiTrack*)selected; int channel = track->outChannel(); int port = track->outPort(); int hbank = iHBank->value(); @@ -794,20 +794,20 @@ void MidiTrackInfo::iProgLBankChanged() else prog = 0xff; - MidiPort* mp = &midiPorts[port]; + MusECore::MidiPort* mp = &MusEGlobal::midiPorts[port]; if(prog == 0xff && hbank == 0xff && lbank == 0xff) { - program = CTRL_VAL_UNKNOWN; - if(mp->hwCtrlState(channel, CTRL_PROGRAM) != CTRL_VAL_UNKNOWN) - audio->msgSetHwCtrlState(mp, channel, CTRL_PROGRAM, CTRL_VAL_UNKNOWN); + program = MusECore::CTRL_VAL_UNKNOWN; + if(mp->hwCtrlState(channel, MusECore::CTRL_PROGRAM) != MusECore::CTRL_VAL_UNKNOWN) + MusEGlobal::audio->msgSetHwCtrlState(mp, channel, MusECore::CTRL_PROGRAM, MusECore::CTRL_VAL_UNKNOWN); return; } - int np = mp->hwCtrlState(channel, CTRL_PROGRAM); - if(np == CTRL_VAL_UNKNOWN) + int np = mp->hwCtrlState(channel, MusECore::CTRL_PROGRAM); + if(np == MusECore::CTRL_VAL_UNKNOWN) { - np = mp->lastValidHWCtrlState(channel, CTRL_PROGRAM); - if(np != CTRL_VAL_UNKNOWN) + np = mp->lastValidHWCtrlState(channel, MusECore::CTRL_PROGRAM); + if(np != MusECore::CTRL_VAL_UNKNOWN) { hbank = (np & 0xff0000) >> 16; prog = np & 0xff; @@ -836,11 +836,11 @@ void MidiTrackInfo::iProgLBankChanged() iProgram->blockSignals(false); } program = (hbank << 16) + (lbank << 8) + prog; - MidiPlayEvent ev(0, port, channel, ME_CONTROLLER, CTRL_PROGRAM, program); - audio->msgPlayMidiEvent(&ev); + MusECore::MidiPlayEvent ev(0, port, channel, MusECore::ME_CONTROLLER, MusECore::CTRL_PROGRAM, program); + MusEGlobal::audio->msgPlayMidiEvent(&ev); - MidiInstrument* instr = mp->instrument(); - iPatch->setText(instr->getPatchName(channel, program, song->mtype(), track->type() == Track::DRUM)); //FINDMICHJETZT was soll das? + MusECore::MidiInstrument* instr = mp->instrument(); + iPatch->setText(instr->getPatchName(channel, program, MusEGlobal::song->mtype(), track->type() == MusECore::Track::DRUM)); //FINDMICHJETZT was soll das? // updateTrackInfo(); } @@ -852,7 +852,7 @@ void MidiTrackInfo::iProgramChanged() { if(!selected) return; - MidiTrack* track = (MidiTrack*)selected; + MusECore::MidiTrack* track = (MusECore::MidiTrack*)selected; int channel = track->outChannel(); int port = track->outPort(); int hbank = iHBank->value(); @@ -872,10 +872,10 @@ void MidiTrackInfo::iProgramChanged() else prog = 0xff; - MidiPort *mp = &midiPorts[port]; + MusECore::MidiPort *mp = &MusEGlobal::midiPorts[port]; if(prog == 0xff) { - program = CTRL_VAL_UNKNOWN; + program = MusECore::CTRL_VAL_UNKNOWN; iHBank->blockSignals(true); iLBank->blockSignals(true); iHBank->setValue(0); @@ -883,17 +883,17 @@ void MidiTrackInfo::iProgramChanged() iHBank->blockSignals(false); iLBank->blockSignals(false); - if(mp->hwCtrlState(channel, CTRL_PROGRAM) != CTRL_VAL_UNKNOWN) - audio->msgSetHwCtrlState(mp, channel, CTRL_PROGRAM, CTRL_VAL_UNKNOWN); + if(mp->hwCtrlState(channel, MusECore::CTRL_PROGRAM) != MusECore::CTRL_VAL_UNKNOWN) + MusEGlobal::audio->msgSetHwCtrlState(mp, channel, MusECore::CTRL_PROGRAM, MusECore::CTRL_VAL_UNKNOWN); return; } else { - int np = mp->hwCtrlState(channel, CTRL_PROGRAM); - if(np == CTRL_VAL_UNKNOWN) + int np = mp->hwCtrlState(channel, MusECore::CTRL_PROGRAM); + if(np == MusECore::CTRL_VAL_UNKNOWN) { - np = mp->lastValidHWCtrlState(channel, CTRL_PROGRAM); - if(np != CTRL_VAL_UNKNOWN) + np = mp->lastValidHWCtrlState(channel, MusECore::CTRL_PROGRAM); + if(np != MusECore::CTRL_VAL_UNKNOWN) { hbank = (np & 0xff0000) >> 16; lbank = (np & 0xff00) >> 8; @@ -914,11 +914,11 @@ void MidiTrackInfo::iProgramChanged() } } program = (hbank << 16) + (lbank << 8) + prog; - MidiPlayEvent ev(0, port, channel, ME_CONTROLLER, CTRL_PROGRAM, program); - audio->msgPlayMidiEvent(&ev); + MusECore::MidiPlayEvent ev(0, port, channel, MusECore::ME_CONTROLLER, MusECore::CTRL_PROGRAM, program); + MusEGlobal::audio->msgPlayMidiEvent(&ev); - MidiInstrument* instr = mp->instrument(); - iPatch->setText(instr->getPatchName(channel, program, song->mtype(), track->type() == Track::DRUM)); //FINDMICHJETZT was soll das? + MusECore::MidiInstrument* instr = mp->instrument(); + iPatch->setText(instr->getPatchName(channel, program, MusEGlobal::song->mtype(), track->type() == MusECore::Track::DRUM)); //FINDMICHJETZT was soll das? } // updateTrackInfo(); @@ -932,25 +932,25 @@ void MidiTrackInfo::iLautstChanged(int val) { if(!selected) return; - MidiTrack* track = (MidiTrack*)selected; + MusECore::MidiTrack* track = (MusECore::MidiTrack*)selected; int outPort = track->outPort(); int chan = track->outChannel(); - MidiPort* mp = &midiPorts[outPort]; - MidiController* mctl = mp->midiController(CTRL_VOLUME); + MusECore::MidiPort* mp = &MusEGlobal::midiPorts[outPort]; + MusECore::MidiController* mctl = mp->midiController(MusECore::CTRL_VOLUME); if((val < mctl->minVal()) || (val > mctl->maxVal())) { - if(mp->hwCtrlState(chan, CTRL_VOLUME) != CTRL_VAL_UNKNOWN) - audio->msgSetHwCtrlState(mp, chan, CTRL_VOLUME, CTRL_VAL_UNKNOWN); + if(mp->hwCtrlState(chan, MusECore::CTRL_VOLUME) != MusECore::CTRL_VAL_UNKNOWN) + MusEGlobal::audio->msgSetHwCtrlState(mp, chan, MusECore::CTRL_VOLUME, MusECore::CTRL_VAL_UNKNOWN); } else { val += mctl->bias(); - MidiPlayEvent ev(0, outPort, chan, - ME_CONTROLLER, CTRL_VOLUME, val); - audio->msgPlayMidiEvent(&ev); + MusECore::MidiPlayEvent ev(0, outPort, chan, + MusECore::ME_CONTROLLER, MusECore::CTRL_VOLUME, val); + MusEGlobal::audio->msgPlayMidiEvent(&ev); } - song->update(SC_MIDI_CONTROLLER); + MusEGlobal::song->update(SC_MIDI_CONTROLLER); } //--------------------------------------------------------- @@ -961,9 +961,9 @@ void MidiTrackInfo::iTranspChanged(int val) { if(!selected) return; - MidiTrack* track = (MidiTrack*)selected; + MusECore::MidiTrack* track = (MusECore::MidiTrack*)selected; track->transposition = val; - song->update(SC_MIDI_TRACK_PROP); + MusEGlobal::song->update(SC_MIDI_TRACK_PROP); } //--------------------------------------------------------- @@ -974,9 +974,9 @@ void MidiTrackInfo::iAnschlChanged(int val) { if(!selected) return; - MidiTrack* track = (MidiTrack*)selected; + MusECore::MidiTrack* track = (MusECore::MidiTrack*)selected; track->velocity = val; - song->update(SC_MIDI_TRACK_PROP); + MusEGlobal::song->update(SC_MIDI_TRACK_PROP); } //--------------------------------------------------------- @@ -987,9 +987,9 @@ void MidiTrackInfo::iVerzChanged(int val) { if(!selected) return; - MidiTrack* track = (MidiTrack*)selected; + MusECore::MidiTrack* track = (MusECore::MidiTrack*)selected; track->delay = val; - song->update(SC_MIDI_TRACK_PROP); + MusEGlobal::song->update(SC_MIDI_TRACK_PROP); } //--------------------------------------------------------- @@ -1000,9 +1000,9 @@ void MidiTrackInfo::iLenChanged(int val) { if(!selected) return; - MidiTrack* track = (MidiTrack*)selected; + MusECore::MidiTrack* track = (MusECore::MidiTrack*)selected; track->len = val; - song->update(SC_MIDI_TRACK_PROP); + MusEGlobal::song->update(SC_MIDI_TRACK_PROP); } //--------------------------------------------------------- @@ -1013,9 +1013,9 @@ void MidiTrackInfo::iKomprChanged(int val) { if(!selected) return; - MidiTrack* track = (MidiTrack*)selected; + MusECore::MidiTrack* track = (MusECore::MidiTrack*)selected; track->compression = val; - song->update(SC_MIDI_TRACK_PROP); + MusEGlobal::song->update(SC_MIDI_TRACK_PROP); } //--------------------------------------------------------- @@ -1026,26 +1026,26 @@ void MidiTrackInfo::iPanChanged(int val) { if(!selected) return; - MidiTrack* track = (MidiTrack*)selected; + MusECore::MidiTrack* track = (MusECore::MidiTrack*)selected; int port = track->outPort(); int chan = track->outChannel(); - MidiPort* mp = &midiPorts[port]; - MidiController* mctl = mp->midiController(CTRL_PANPOT); + MusECore::MidiPort* mp = &MusEGlobal::midiPorts[port]; + MusECore::MidiController* mctl = mp->midiController(MusECore::CTRL_PANPOT); if((val < mctl->minVal()) || (val > mctl->maxVal())) { - if(mp->hwCtrlState(chan, CTRL_PANPOT) != CTRL_VAL_UNKNOWN) - audio->msgSetHwCtrlState(mp, chan, CTRL_PANPOT, CTRL_VAL_UNKNOWN); + if(mp->hwCtrlState(chan, MusECore::CTRL_PANPOT) != MusECore::CTRL_VAL_UNKNOWN) + MusEGlobal::audio->msgSetHwCtrlState(mp, chan, MusECore::CTRL_PANPOT, MusECore::CTRL_VAL_UNKNOWN); } else { val += mctl->bias(); // Realtime Change: - MidiPlayEvent ev(0, port, chan, - ME_CONTROLLER, CTRL_PANPOT, val); - audio->msgPlayMidiEvent(&ev); + MusECore::MidiPlayEvent ev(0, port, chan, + MusECore::ME_CONTROLLER, MusECore::CTRL_PANPOT, val); + MusEGlobal::audio->msgPlayMidiEvent(&ev); } - song->update(SC_MIDI_CONTROLLER); + MusEGlobal::song->update(SC_MIDI_CONTROLLER); } //--------------------------------------------------------- @@ -1061,11 +1061,11 @@ void MidiTrackInfo::instrPopupActivated(QAction* act) int rv = act->data().toInt(); if(rv != -1) { - MidiTrack* track = (MidiTrack*)selected; + MusECore::MidiTrack* track = (MusECore::MidiTrack*)selected; int channel = track->outChannel(); int port = track->outPort(); - MidiPlayEvent ev(0, port, channel, ME_CONTROLLER, CTRL_PROGRAM, rv); - audio->msgPlayMidiEvent(&ev); + MusECore::MidiPlayEvent ev(0, port, channel, MusECore::ME_CONTROLLER, MusECore::CTRL_PROGRAM, rv); + MusEGlobal::audio->msgPlayMidiEvent(&ev); updateTrackInfo(-1); } } @@ -1079,15 +1079,15 @@ void MidiTrackInfo::instrPopup() { if(!selected) return; - MidiTrack* track = (MidiTrack*)selected; + MusECore::MidiTrack* track = (MusECore::MidiTrack*)selected; int channel = track->outChannel(); int port = track->outPort(); - MidiInstrument* instr = midiPorts[port].instrument(); + MusECore::MidiInstrument* instr = MusEGlobal::midiPorts[port].instrument(); //QMenu* pup = new QMenu; PopupMenu* pup = new PopupMenu(true); - //instr->populatePatchPopup(pop, channel, song->mtype(), track->type() == Track::DRUM); - instr->populatePatchPopup(pup, channel, song->mtype(), track->type() == Track::DRUM); //FINDMICHJETZT was soll das? + //instr->populatePatchPopup(pop, channel, MusEGlobal::song->mtype(), track->type() == MusECore::Track::DRUM); + populatePatchPopup(instr, pup, channel, MusEGlobal::song->mtype(), track->type() == MusECore::Track::DRUM); //FINDMICHJETZT was soll das? //if(pop->actions().count() == 0) // return; @@ -1107,8 +1107,8 @@ void MidiTrackInfo::instrPopup() int rv = act->data().toInt(); if(rv != -1) { - MidiPlayEvent ev(0, port, channel, ME_CONTROLLER, CTRL_PROGRAM, rv); - audio->msgPlayMidiEvent(&ev); + MusECore::MidiPlayEvent ev(0, port, channel, MusECore::ME_CONTROLLER, MusECore::CTRL_PROGRAM, rv); + MusEGlobal::audio->msgPlayMidiEvent(&ev); updateTrackInfo(-1); } } @@ -1124,9 +1124,9 @@ void MidiTrackInfo::recEchoToggled(bool v) { if(!selected) return; - MidiTrack* track = (MidiTrack*)selected; + MusECore::MidiTrack* track = (MusECore::MidiTrack*)selected; track->setRecEcho(v); - song->update(SC_MIDI_TRACK_PROP); + MusEGlobal::song->update(SC_MIDI_TRACK_PROP); } //--------------------------------------------------------- @@ -1137,27 +1137,27 @@ void MidiTrackInfo::iProgramDoubleClicked() { if(!selected) return; - MidiTrack* track = (MidiTrack*)selected; + MusECore::MidiTrack* track = (MusECore::MidiTrack*)selected; int port = track->outPort(); int chan = track->outChannel(); - MidiPort* mp = &midiPorts[port]; - MidiController* mctl = mp->midiController(CTRL_PROGRAM); + MusECore::MidiPort* mp = &MusEGlobal::midiPorts[port]; + MusECore::MidiController* mctl = mp->midiController(MusECore::CTRL_PROGRAM); if(!track || !mctl) return; - int lastv = mp->lastValidHWCtrlState(chan, CTRL_PROGRAM); - int curv = mp->hwCtrlState(chan, CTRL_PROGRAM); + int lastv = mp->lastValidHWCtrlState(chan, MusECore::CTRL_PROGRAM); + int curv = mp->hwCtrlState(chan, MusECore::CTRL_PROGRAM); - if(curv == CTRL_VAL_UNKNOWN) + if(curv == MusECore::CTRL_VAL_UNKNOWN) { // If no value has ever been set yet, use the current knob value // (or the controller's initial value?) to 'turn on' the controller. - if(lastv == CTRL_VAL_UNKNOWN) + if(lastv == MusECore::CTRL_VAL_UNKNOWN) { int kiv = mctl->initVal(); //int kiv = lrint(_knob->value()); - if(kiv == CTRL_VAL_UNKNOWN) + if(kiv == MusECore::CTRL_VAL_UNKNOWN) kiv = 0; //else //{ @@ -1168,23 +1168,23 @@ void MidiTrackInfo::iProgramDoubleClicked() //kiv += mctrl->bias(); //} - //MidiPlayEvent ev(0, port, chan, ME_CONTROLLER, num, kiv); - MidiPlayEvent ev(0, port, chan, ME_CONTROLLER, CTRL_PROGRAM, kiv); - audio->msgPlayMidiEvent(&ev); + //MusECore::MidiPlayEvent ev(0, port, chan, MusECore::ME_CONTROLLER, num, kiv); + MusECore::MidiPlayEvent ev(0, port, chan, MusECore::ME_CONTROLLER, MusECore::CTRL_PROGRAM, kiv); + MusEGlobal::audio->msgPlayMidiEvent(&ev); } else { - MidiPlayEvent ev(0, port, chan, ME_CONTROLLER, CTRL_PROGRAM, lastv); - audio->msgPlayMidiEvent(&ev); + MusECore::MidiPlayEvent ev(0, port, chan, MusECore::ME_CONTROLLER, MusECore::CTRL_PROGRAM, lastv); + MusEGlobal::audio->msgPlayMidiEvent(&ev); } } else { - if(mp->hwCtrlState(chan, CTRL_PROGRAM) != CTRL_VAL_UNKNOWN) - audio->msgSetHwCtrlState(mp, chan, CTRL_PROGRAM, CTRL_VAL_UNKNOWN); + if(mp->hwCtrlState(chan, MusECore::CTRL_PROGRAM) != MusECore::CTRL_VAL_UNKNOWN) + MusEGlobal::audio->msgSetHwCtrlState(mp, chan, MusECore::CTRL_PROGRAM, MusECore::CTRL_VAL_UNKNOWN); } - song->update(SC_MIDI_CONTROLLER); + MusEGlobal::song->update(SC_MIDI_CONTROLLER); } //--------------------------------------------------------- @@ -1195,27 +1195,27 @@ void MidiTrackInfo::iLautstDoubleClicked() { if(!selected) return; - MidiTrack* track = (MidiTrack*)selected; + MusECore::MidiTrack* track = (MusECore::MidiTrack*)selected; int port = track->outPort(); int chan = track->outChannel(); - MidiPort* mp = &midiPorts[port]; - MidiController* mctl = mp->midiController(CTRL_VOLUME); + MusECore::MidiPort* mp = &MusEGlobal::midiPorts[port]; + MusECore::MidiController* mctl = mp->midiController(MusECore::CTRL_VOLUME); if(!track || !mctl) return; - int lastv = mp->lastValidHWCtrlState(chan, CTRL_VOLUME); - int curv = mp->hwCtrlState(chan, CTRL_VOLUME); + int lastv = mp->lastValidHWCtrlState(chan, MusECore::CTRL_VOLUME); + int curv = mp->hwCtrlState(chan, MusECore::CTRL_VOLUME); - if(curv == CTRL_VAL_UNKNOWN) + if(curv == MusECore::CTRL_VAL_UNKNOWN) { // If no value has ever been set yet, use the current knob value // (or the controller's initial value?) to 'turn on' the controller. - if(lastv == CTRL_VAL_UNKNOWN) + if(lastv == MusECore::CTRL_VAL_UNKNOWN) { int kiv = mctl->initVal(); //int kiv = lrint(_knob->value()); - if(kiv == CTRL_VAL_UNKNOWN) + if(kiv == MusECore::CTRL_VAL_UNKNOWN) // Set volume to 78% of range, so that if range is 0 - 127, then value is 100. kiv = lround(double(mctl->maxVal() - mctl->minVal()) * 0.7874); else @@ -1227,22 +1227,22 @@ void MidiTrackInfo::iLautstDoubleClicked() kiv += mctl->bias(); } - MidiPlayEvent ev(0, port, chan, ME_CONTROLLER, CTRL_VOLUME, kiv); - audio->msgPlayMidiEvent(&ev); + MusECore::MidiPlayEvent ev(0, port, chan, MusECore::ME_CONTROLLER, MusECore::CTRL_VOLUME, kiv); + MusEGlobal::audio->msgPlayMidiEvent(&ev); } else { - MidiPlayEvent ev(0, port, chan, ME_CONTROLLER, CTRL_VOLUME, lastv); - audio->msgPlayMidiEvent(&ev); + MusECore::MidiPlayEvent ev(0, port, chan, MusECore::ME_CONTROLLER, MusECore::CTRL_VOLUME, lastv); + MusEGlobal::audio->msgPlayMidiEvent(&ev); } } else { - if(mp->hwCtrlState(chan, CTRL_VOLUME) != CTRL_VAL_UNKNOWN) - audio->msgSetHwCtrlState(mp, chan, CTRL_VOLUME, CTRL_VAL_UNKNOWN); + if(mp->hwCtrlState(chan, MusECore::CTRL_VOLUME) != MusECore::CTRL_VAL_UNKNOWN) + MusEGlobal::audio->msgSetHwCtrlState(mp, chan, MusECore::CTRL_VOLUME, MusECore::CTRL_VAL_UNKNOWN); } - song->update(SC_MIDI_CONTROLLER); + MusEGlobal::song->update(SC_MIDI_CONTROLLER); } //--------------------------------------------------------- @@ -1253,27 +1253,27 @@ void MidiTrackInfo::iPanDoubleClicked() { if(!selected) return; - MidiTrack* track = (MidiTrack*)selected; + MusECore::MidiTrack* track = (MusECore::MidiTrack*)selected; int port = track->outPort(); int chan = track->outChannel(); - MidiPort* mp = &midiPorts[port]; - MidiController* mctl = mp->midiController(CTRL_PANPOT); + MusECore::MidiPort* mp = &MusEGlobal::midiPorts[port]; + MusECore::MidiController* mctl = mp->midiController(MusECore::CTRL_PANPOT); if(!track || !mctl) return; - int lastv = mp->lastValidHWCtrlState(chan, CTRL_PANPOT); - int curv = mp->hwCtrlState(chan, CTRL_PANPOT); + int lastv = mp->lastValidHWCtrlState(chan, MusECore::CTRL_PANPOT); + int curv = mp->hwCtrlState(chan, MusECore::CTRL_PANPOT); - if(curv == CTRL_VAL_UNKNOWN) + if(curv == MusECore::CTRL_VAL_UNKNOWN) { // If no value has ever been set yet, use the current knob value // (or the controller's initial value?) to 'turn on' the controller. - if(lastv == CTRL_VAL_UNKNOWN) + if(lastv == MusECore::CTRL_VAL_UNKNOWN) { int kiv = mctl->initVal(); //int kiv = lrint(_knob->value()); - if(kiv == CTRL_VAL_UNKNOWN) + if(kiv == MusECore::CTRL_VAL_UNKNOWN) // Set volume to 50% of range, so that if range is 0 - 127, then value is 64. kiv = lround(double(mctl->maxVal() - mctl->minVal()) * 0.5); else @@ -1285,22 +1285,22 @@ void MidiTrackInfo::iPanDoubleClicked() kiv += mctl->bias(); } - MidiPlayEvent ev(0, port, chan, ME_CONTROLLER, CTRL_PANPOT, kiv); - audio->msgPlayMidiEvent(&ev); + MusECore::MidiPlayEvent ev(0, port, chan, MusECore::ME_CONTROLLER, MusECore::CTRL_PANPOT, kiv); + MusEGlobal::audio->msgPlayMidiEvent(&ev); } else { - MidiPlayEvent ev(0, port, chan, ME_CONTROLLER, CTRL_PANPOT, lastv); - audio->msgPlayMidiEvent(&ev); + MusECore::MidiPlayEvent ev(0, port, chan, MusECore::ME_CONTROLLER, MusECore::CTRL_PANPOT, lastv); + MusEGlobal::audio->msgPlayMidiEvent(&ev); } } else { - if(mp->hwCtrlState(chan, CTRL_PANPOT) != CTRL_VAL_UNKNOWN) - audio->msgSetHwCtrlState(mp, chan, CTRL_PANPOT, CTRL_VAL_UNKNOWN); + if(mp->hwCtrlState(chan, MusECore::CTRL_PANPOT) != MusECore::CTRL_VAL_UNKNOWN) + MusEGlobal::audio->msgSetHwCtrlState(mp, chan, MusECore::CTRL_PANPOT, MusECore::CTRL_VAL_UNKNOWN); } - song->update(SC_MIDI_CONTROLLER); + MusEGlobal::song->update(SC_MIDI_CONTROLLER); } @@ -1318,7 +1318,7 @@ void MidiTrackInfo::updateTrackInfo(int flags) if(!selected) return; - MidiTrack* track = (MidiTrack*)selected; + MusECore::MidiTrack* track = (MusECore::MidiTrack*)selected; setLabelText(); setLabelFont(); @@ -1353,7 +1353,7 @@ void MidiTrackInfo::updateTrackInfo(int flags) for (int i = 0; i < MIDI_PORTS; ++i) { QString name; - name.sprintf("%d:%s", i+1, midiPorts[i].portname().toLatin1().constData()); + name.sprintf("%d:%s", i+1, MusEGlobal::midiPorts[i].portname().toLatin1().constData()); iOutput->insertItem(i, name); if (i == outPort) iOutput->setCurrentIndex(i); @@ -1389,9 +1389,9 @@ void MidiTrackInfo::updateTrackInfo(int flags) int outChannel = track->outChannel(); int outPort = track->outPort(); - MidiPort* mp = &midiPorts[outPort]; - int nprogram = mp->hwCtrlState(outChannel, CTRL_PROGRAM); - if(nprogram == CTRL_VAL_UNKNOWN) + MusECore::MidiPort* mp = &MusEGlobal::midiPorts[outPort]; + int nprogram = mp->hwCtrlState(outChannel, MusECore::CTRL_PROGRAM); + if(nprogram == MusECore::CTRL_VAL_UNKNOWN) { iHBank->blockSignals(true); iLBank->blockSignals(true); @@ -1403,15 +1403,15 @@ void MidiTrackInfo::updateTrackInfo(int flags) iLBank->blockSignals(false); iProgram->blockSignals(false); - program = CTRL_VAL_UNKNOWN; - nprogram = mp->lastValidHWCtrlState(outChannel, CTRL_PROGRAM); - if(nprogram == CTRL_VAL_UNKNOWN) + program = MusECore::CTRL_VAL_UNKNOWN; + nprogram = mp->lastValidHWCtrlState(outChannel, MusECore::CTRL_PROGRAM); + if(nprogram == MusECore::CTRL_VAL_UNKNOWN) //iPatch->setText(QString("<unknown>")); iPatch->setText(tr("<unknown>")); else { - MidiInstrument* instr = mp->instrument(); - iPatch->setText(instr->getPatchName(outChannel, nprogram, song->mtype(), track->type() == Track::DRUM)); //FINDMICHJETZT was soll das? + MusECore::MidiInstrument* instr = mp->instrument(); + iPatch->setText(instr->getPatchName(outChannel, nprogram, MusEGlobal::song->mtype(), track->type() == MusECore::Track::DRUM)); //FINDMICHJETZT was soll das? } } else @@ -1420,14 +1420,14 @@ void MidiTrackInfo::updateTrackInfo(int flags) program = nprogram; //int hb, lb, pr; - //if (program == CTRL_VAL_UNKNOWN) { + //if (program == MusECore::CTRL_VAL_UNKNOWN) { // hb = lb = pr = 0; // iPatch->setText("---"); // } //else //{ - MidiInstrument* instr = mp->instrument(); - iPatch->setText(instr->getPatchName(outChannel, program, song->mtype(), track->type() == Track::DRUM)); //FINDMICHJETZT was soll das? + MusECore::MidiInstrument* instr = mp->instrument(); + iPatch->setText(instr->getPatchName(outChannel, program, MusEGlobal::song->mtype(), track->type() == MusECore::Track::DRUM)); //FINDMICHJETZT was soll das? int hb = ((program >> 16) & 0xff) + 1; if (hb == 0x100) @@ -1452,14 +1452,14 @@ void MidiTrackInfo::updateTrackInfo(int flags) iProgram->blockSignals(false); } - MidiController* mc = mp->midiController(CTRL_VOLUME); + MusECore::MidiController* mc = mp->midiController(MusECore::CTRL_VOLUME); int mn = mc->minVal(); - int v = mp->hwCtrlState(outChannel, CTRL_VOLUME); + int v = mp->hwCtrlState(outChannel, MusECore::CTRL_VOLUME); volume = v; - if(v == CTRL_VAL_UNKNOWN) + if(v == MusECore::CTRL_VAL_UNKNOWN) //{ //v = mc->initVal(); - //if(v == CTRL_VAL_UNKNOWN) + //if(v == MusECore::CTRL_VAL_UNKNOWN) // v = 0; v = mn - 1; //} @@ -1471,14 +1471,14 @@ void MidiTrackInfo::updateTrackInfo(int flags) iLautst->setValue(v); iLautst->blockSignals(false); - mc = mp->midiController(CTRL_PANPOT); + mc = mp->midiController(MusECore::CTRL_PANPOT); mn = mc->minVal(); - v = mp->hwCtrlState(outChannel, CTRL_PANPOT); + v = mp->hwCtrlState(outChannel, MusECore::CTRL_PANPOT); pan = v; - if(v == CTRL_VAL_UNKNOWN) + if(v == MusECore::CTRL_VAL_UNKNOWN) //{ //v = mc->initVal(); - //if(v == CTRL_VAL_UNKNOWN) + //if(v == MusECore::CTRL_VAL_UNKNOWN) // v = 0; v = mn - 1; //} @@ -1501,21 +1501,21 @@ void MidiTrackInfo::progRecClicked() { if(!selected) return; - MidiTrack* track = (MidiTrack*)selected; + MusECore::MidiTrack* track = (MusECore::MidiTrack*)selected; int portno = track->outPort(); int channel = track->outChannel(); - MidiPort* port = &midiPorts[portno]; - int program = port->hwCtrlState(channel, CTRL_PROGRAM); - if(program == CTRL_VAL_UNKNOWN || program == 0xffffff) + MusECore::MidiPort* port = &MusEGlobal::midiPorts[portno]; + int program = port->hwCtrlState(channel, MusECore::CTRL_PROGRAM); + if(program == MusECore::CTRL_VAL_UNKNOWN || program == 0xffffff) return; - unsigned tick = song->cpos(); - Event a(Controller); + unsigned tick = MusEGlobal::song->cpos(); + MusECore::Event a(MusECore::Controller); a.setTick(tick); - a.setA(CTRL_PROGRAM); + a.setA(MusECore::CTRL_PROGRAM); a.setB(program); - song->recordEvent(track, a); + MusEGlobal::song->recordEvent(track, a); } //--------------------------------------------------------- @@ -1526,21 +1526,21 @@ void MidiTrackInfo::volRecClicked() { if(!selected) return; - MidiTrack* track = (MidiTrack*)selected; + MusECore::MidiTrack* track = (MusECore::MidiTrack*)selected; int portno = track->outPort(); int channel = track->outChannel(); - MidiPort* port = &midiPorts[portno]; - int volume = port->hwCtrlState(channel, CTRL_VOLUME); - if(volume == CTRL_VAL_UNKNOWN) + MusECore::MidiPort* port = &MusEGlobal::midiPorts[portno]; + int volume = port->hwCtrlState(channel, MusECore::CTRL_VOLUME); + if(volume == MusECore::CTRL_VAL_UNKNOWN) return; - unsigned tick = song->cpos(); - Event a(Controller); + unsigned tick = MusEGlobal::song->cpos(); + MusECore::Event a(MusECore::Controller); a.setTick(tick); - a.setA(CTRL_VOLUME); + a.setA(MusECore::CTRL_VOLUME); a.setB(volume); - song->recordEvent(track, a); + MusEGlobal::song->recordEvent(track, a); } //--------------------------------------------------------- @@ -1551,21 +1551,21 @@ void MidiTrackInfo::panRecClicked() { if(!selected) return; - MidiTrack* track = (MidiTrack*)selected; + MusECore::MidiTrack* track = (MusECore::MidiTrack*)selected; int portno = track->outPort(); int channel = track->outChannel(); - MidiPort* port = &midiPorts[portno]; - int pan = port->hwCtrlState(channel, CTRL_PANPOT); - if(pan == CTRL_VAL_UNKNOWN) + MusECore::MidiPort* port = &MusEGlobal::midiPorts[portno]; + int pan = port->hwCtrlState(channel, MusECore::CTRL_PANPOT); + if(pan == MusECore::CTRL_VAL_UNKNOWN) return; - unsigned tick = song->cpos(); - Event a(Controller); + unsigned tick = MusEGlobal::song->cpos(); + MusECore::Event a(MusECore::Controller); a.setTick(tick); - a.setA(CTRL_PANPOT); + a.setA(MusECore::CTRL_PANPOT); a.setB(pan); - song->recordEvent(track, a); + MusEGlobal::song->recordEvent(track, a); } //--------------------------------------------------------- @@ -1576,38 +1576,38 @@ void MidiTrackInfo::recordClicked() { if(!selected) return; - MidiTrack* track = (MidiTrack*)selected; + MusECore::MidiTrack* track = (MusECore::MidiTrack*)selected; int portno = track->outPort(); int channel = track->outChannel(); - MidiPort* port = &midiPorts[portno]; - unsigned tick = song->cpos(); + MusECore::MidiPort* port = &MusEGlobal::midiPorts[portno]; + unsigned tick = MusEGlobal::song->cpos(); - int program = port->hwCtrlState(channel, CTRL_PROGRAM); - if(program != CTRL_VAL_UNKNOWN && program != 0xffffff) + int program = port->hwCtrlState(channel, MusECore::CTRL_PROGRAM); + if(program != MusECore::CTRL_VAL_UNKNOWN && program != 0xffffff) { - Event a(Controller); + MusECore::Event a(MusECore::Controller); a.setTick(tick); - a.setA(CTRL_PROGRAM); + a.setA(MusECore::CTRL_PROGRAM); a.setB(program); - song->recordEvent(track, a); + MusEGlobal::song->recordEvent(track, a); } - int volume = port->hwCtrlState(channel, CTRL_VOLUME); - if(volume != CTRL_VAL_UNKNOWN) + int volume = port->hwCtrlState(channel, MusECore::CTRL_VOLUME); + if(volume != MusECore::CTRL_VAL_UNKNOWN) { - Event a(Controller); + MusECore::Event a(MusECore::Controller); a.setTick(tick); - a.setA(CTRL_VOLUME); + a.setA(MusECore::CTRL_VOLUME); a.setB(volume); - song->recordEvent(track, a); + MusEGlobal::song->recordEvent(track, a); } - int pan = port->hwCtrlState(channel, CTRL_PANPOT); - if(pan != CTRL_VAL_UNKNOWN) + int pan = port->hwCtrlState(channel, MusECore::CTRL_PANPOT); + if(pan != MusECore::CTRL_VAL_UNKNOWN) { - Event a(Controller); + MusECore::Event a(MusECore::Controller); a.setTick(tick); - a.setA(CTRL_PANPOT); + a.setA(MusECore::CTRL_PANPOT); a.setB(pan); - song->recordEvent(track, a); + MusEGlobal::song->recordEvent(track, a); } } @@ -1619,4 +1619,4 @@ void MidiTrackInfo::resizeEvent(QResizeEvent* ev) setLabelFont(); } -} // namespace MusEWidget +} // namespace MusEGui diff --git a/muse2/muse/widgets/mtrackinfo.h b/muse2/muse/widgets/mtrackinfo.h index 42bcb2bf..b816f289 100644 --- a/muse2/muse/widgets/mtrackinfo.h +++ b/muse2/muse/widgets/mtrackinfo.h @@ -25,9 +25,11 @@ #include "ui_mtrackinfobase.h" +namespace MusECore { class Track; +} -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // MidiTrackInfo @@ -36,7 +38,7 @@ namespace MusEWidget { class MidiTrackInfo : public QWidget, public Ui::MidiTrackInfoBase { Q_OBJECT - Track* selected; + MusECore::Track* selected; bool _midiDetect; int program, pan, volume; int heartBeatCounter; @@ -74,19 +76,19 @@ class MidiTrackInfo : public QWidget, public Ui::MidiTrackInfoBase virtual void heartBeat(); public slots: - void setTrack(Track*); + void setTrack(MusECore::Track*); void configChanged(); void songChanged(int); public: - MidiTrackInfo(QWidget*, Track* = 0); - Track* track() const { return selected; } + MidiTrackInfo(QWidget*, MusECore::Track* = 0); + MusECore::Track* track() const { return selected; } void setLabelText(); void setLabelFont(); void updateTrackInfo(int); }; -} // namespace MusEWidget +} // namespace MusEGui #endif diff --git a/muse2/muse/widgets/mtrackinfobase.ui b/muse2/muse/widgets/mtrackinfobase.ui index 99c06ad0..4a4b9c37 100644 --- a/muse2/muse/widgets/mtrackinfobase.ui +++ b/muse2/muse/widgets/mtrackinfobase.ui @@ -86,7 +86,7 @@ </widget> </item> <item row="2" column="0"> - <widget class="MusEWidget::SpinBox" name="iOutputChannel"> + <widget class="MusEGui::SpinBox" name="iOutputChannel"> <property name="sizePolicy"> <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> <horstretch>0</horstretch> @@ -247,7 +247,7 @@ </layout> </item> <item row="4" column="0"> - <widget class="MusEWidget::SpinBox" name="iTransp"> + <widget class="MusEGui::SpinBox" name="iTransp"> <property name="sizePolicy"> <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> <horstretch>0</horstretch> @@ -291,7 +291,7 @@ </widget> </item> <item row="5" column="0"> - <widget class="MusEWidget::SpinBox" name="iVerz"> + <widget class="MusEGui::SpinBox" name="iVerz"> <property name="sizePolicy"> <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> <horstretch>0</horstretch> @@ -332,7 +332,7 @@ </widget> </item> <item row="6" column="0"> - <widget class="MusEWidget::SpinBox" name="iLen"> + <widget class="MusEGui::SpinBox" name="iLen"> <property name="sizePolicy"> <sizepolicy hsizetype="Maximum" vsizetype="Fixed"> <horstretch>0</horstretch> @@ -376,7 +376,7 @@ </widget> </item> <item row="7" column="0"> - <widget class="MusEWidget::SpinBox" name="iAnschl"> + <widget class="MusEGui::SpinBox" name="iAnschl"> <property name="sizePolicy"> <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> <horstretch>0</horstretch> @@ -423,7 +423,7 @@ </widget> </item> <item row="8" column="0"> - <widget class="MusEWidget::SpinBox" name="iKompr"> + <widget class="MusEGui::SpinBox" name="iKompr"> <property name="sizePolicy"> <sizepolicy hsizetype="Maximum" vsizetype="Fixed"> <horstretch>0</horstretch> @@ -575,7 +575,7 @@ </layout> </item> <item row="12" column="0"> - <widget class="MusEWidget::SpinBox" name="iHBank"> + <widget class="MusEGui::SpinBox" name="iHBank"> <property name="sizePolicy"> <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> <horstretch>0</horstretch> @@ -628,7 +628,7 @@ </widget> </item> <item row="13" column="0"> - <widget class="MusEWidget::SpinBox" name="iLBank"> + <widget class="MusEGui::SpinBox" name="iLBank"> <property name="sizePolicy"> <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> <horstretch>0</horstretch> @@ -681,7 +681,7 @@ </widget> </item> <item row="14" column="0"> - <widget class="MusEWidget::SpinBox" name="iProgram"> + <widget class="MusEGui::SpinBox" name="iProgram"> <property name="sizePolicy"> <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> <horstretch>0</horstretch> @@ -748,7 +748,7 @@ </layout> </item> <item row="15" column="0"> - <widget class="MusEWidget::SpinBox" name="iLautst"> + <widget class="MusEGui::SpinBox" name="iLautst"> <property name="sizePolicy"> <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> <horstretch>0</horstretch> @@ -815,7 +815,7 @@ </layout> </item> <item row="16" column="0"> - <widget class="MusEWidget::SpinBox" name="iPan"> + <widget class="MusEGui::SpinBox" name="iPan"> <property name="sizePolicy"> <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> <horstretch>0</horstretch> @@ -905,7 +905,7 @@ <layoutdefault spacing="6" margin="11"/> <customwidgets> <customwidget> - <class>MusEWidget::SpinBox</class> + <class>MusEGui::SpinBox</class> <extends>QSpinBox</extends> <header location="global">spinbox.h</header> </customwidget> diff --git a/muse2/muse/widgets/mtscale.cpp b/muse2/muse/widgets/mtscale.cpp index 8f63c36b..6211574d 100644 --- a/muse2/muse/widgets/mtscale.cpp +++ b/muse2/muse/widgets/mtscale.cpp @@ -30,7 +30,7 @@ #include "icons.h" #include "gconfig.h" -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // MTScale @@ -45,21 +45,21 @@ MTScale::MTScale(int* r, QWidget* parent, int xs, bool _mode) barLocator = false; raster = r; if (waveMode) { - pos[0] = tempomap.tick2frame(song->cpos()); - pos[1] = tempomap.tick2frame(song->lpos()); - pos[2] = tempomap.tick2frame(song->rpos()); + pos[0] = MusEGlobal::tempomap.tick2frame(MusEGlobal::song->cpos()); + pos[1] = MusEGlobal::tempomap.tick2frame(MusEGlobal::song->lpos()); + pos[2] = MusEGlobal::tempomap.tick2frame(MusEGlobal::song->rpos()); } else { - pos[0] = song->cpos(); - pos[1] = song->lpos(); - pos[2] = song->rpos(); + pos[0] = MusEGlobal::song->cpos(); + pos[1] = MusEGlobal::song->lpos(); + pos[2] = MusEGlobal::song->rpos(); } pos[3] = MAXINT; // do not show button = Qt::NoButton; setMouseTracking(true); - connect(song, SIGNAL(posChanged(int, unsigned, bool)), SLOT(setPos(int, unsigned, bool))); - connect(song, SIGNAL(songChanged(int)), SLOT(songChanged(int))); - connect(song, SIGNAL(markerChanged(int)), SLOT(redraw())); + connect(MusEGlobal::song, SIGNAL(posChanged(int, unsigned, bool)), SLOT(setPos(int, unsigned, bool))); + connect(MusEGlobal::song, SIGNAL(songChanged(int)), SLOT(songChanged(int))); + connect(MusEGlobal::song, SIGNAL(markerChanged(int)), SLOT(redraw())); setFixedHeight(28); setBg(QColor(0xe0, 0xe0, 0xe0)); @@ -73,9 +73,9 @@ void MTScale::songChanged(int type) { if (type & (SC_SIG|SC_TEMPO)) { if ((type & SC_TEMPO) && waveMode) { - pos[0] = tempomap.tick2frame(song->cpos()); - pos[1] = tempomap.tick2frame(song->lpos()); - pos[2] = tempomap.tick2frame(song->rpos()); + pos[0] = MusEGlobal::tempomap.tick2frame(MusEGlobal::song->cpos()); + pos[1] = MusEGlobal::tempomap.tick2frame(MusEGlobal::song->lpos()); + pos[2] = MusEGlobal::tempomap.tick2frame(MusEGlobal::song->rpos()); } redraw(); } @@ -95,7 +95,7 @@ void MTScale::setPos(int idx, unsigned val, bool) return; } if (waveMode) - val = tempomap.tick2frame(val); + val = MusEGlobal::tempomap.tick2frame(val); if (val == pos[idx]) return; //unsigned opos = mapx(pos[idx] == MAXINT ? val : pos[idx]); @@ -160,7 +160,7 @@ void MTScale::viewMouseMoveEvent(QMouseEvent* event) int x = event->x(); if (waveMode) - x = tempomap.frame2tick(x); + x = MusEGlobal::tempomap.frame2tick(x); x = AL::sigmap.raster(x, *raster); if (x < 0) x = 0; @@ -175,7 +175,7 @@ void MTScale::viewMouseMoveEvent(QMouseEvent* event) i = 1; break; case Qt::RightButton: - if ((MusEConfig::config.rangeMarkerWithoutMMB) && (event->modifiers() & Qt::ControlModifier)) + if ((MusEGlobal::config.rangeMarkerWithoutMMB) && (event->modifiers() & Qt::ControlModifier)) i = 1; else i = 2; @@ -183,26 +183,26 @@ void MTScale::viewMouseMoveEvent(QMouseEvent* event) default: return; // if no button is pressed the function returns here } - Pos p(x, true); + MusECore::Pos p(x, true); if(i== 0 && (event->modifiers() & Qt::ShiftModifier )) { // If shift +LMB we add a marker - Marker *alreadyExists = song->getMarkerAt(x); + MusECore::Marker *alreadyExists = MusEGlobal::song->getMarkerAt(x); if (!alreadyExists) { - song->addMarker(QString(""), x, false); + MusEGlobal::song->addMarker(QString(""), x, false); // Removed p3.3.43 // Song::addMarker() already emits a 'markerChanged'. //emit addMarker(x); } } else if (i== 2 && (event->modifiers() & Qt::ShiftModifier )) { // If shift +RMB we remove a marker - Marker *toRemove = song->getMarkerAt(x); + MusECore::Marker *toRemove = MusEGlobal::song->getMarkerAt(x); if (toRemove) - song->removeMarker(toRemove); + MusEGlobal::song->removeMarker(toRemove); else printf("No marker to remove\n"); } else - song->setPos(i, p); // all other cases: relocating one of the locators + MusEGlobal::song->setPos(i, p); // all other cases: relocating one of the locators } //--------------------------------------------------------- @@ -235,12 +235,12 @@ void MTScale::pdraw(QPainter& p, const QRect& r) int y = 12; p.setPen(Qt::black); - p.setFont(MusEConfig::config.fonts[4]); + p.setFont(MusEGlobal::config.fonts[4]); p.drawLine(r.x(), y+1, r.x() + r.width(), y+1); QRect tr(r); tr.setHeight(12); - MarkerList* marker = song->marker(); - for (iMarker m = marker->begin(); m != marker->end(); ++m) { + MusECore::MarkerList* marker = MusEGlobal::song->marker(); + for (MusECore::iMarker m = marker->begin(); m != marker->end(); ++m) { int xp; if(waveMode) @@ -250,12 +250,12 @@ void MTScale::pdraw(QPainter& p, const QRect& r) if (xp > x+w) break; int xe = r.x() + r.width(); - iMarker mm = m; + MusECore::iMarker mm = m; ++mm; if (mm != marker->end()) { if(waveMode) - xe = mapx(tempomap.tick2frame(mm->first)); + xe = mapx(MusEGlobal::tempomap.tick2frame(mm->first)); else xe = mapx(mm->first); } @@ -275,12 +275,12 @@ void MTScale::pdraw(QPainter& p, const QRect& r) } int x2; - //iMarker mm = m; + //MusECore::iMarker mm = m; //++mm; if (mm != marker->end()) { if(waveMode) - x2 = mapx(tempomap.tick2frame(mm->first)); + x2 = mapx(MusEGlobal::tempomap.tick2frame(mm->first)); else x2 = mapx(mm->first); } @@ -355,9 +355,9 @@ void MTScale::pdraw(QPainter& p, const QRect& r) unsigned tick; if (waveMode) { - ctick = tempomap.frame2tick(mapxDev(x)); + ctick = MusEGlobal::tempomap.frame2tick(mapxDev(x)); AL::sigmap.tickValues(ctick, &bar1, &beat, &tick); - AL::sigmap.tickValues(tempomap.frame2tick(mapxDev(x+w)), + AL::sigmap.tickValues(MusEGlobal::tempomap.frame2tick(mapxDev(x+w)), &bar2, &beat, &tick); } else { @@ -374,8 +374,8 @@ void MTScale::pdraw(QPainter& p, const QRect& r) ntick = AL::sigmap.bar2tick(bar+1, 0, 0); int tpix, a, b=0; if (waveMode) { - a = tempomap.tick2frame(ntick); - b = tempomap.tick2frame(stick); + a = MusEGlobal::tempomap.tick2frame(ntick); + b = MusEGlobal::tempomap.tick2frame(stick); tpix = rmapx(a - b); } else { @@ -396,7 +396,7 @@ void MTScale::pdraw(QPainter& p, const QRect& r) n = 32; if (bar % n) continue; - p.setFont(MusEConfig::config.fonts[3]); + p.setFont(MusEGlobal::config.fonts[3]); int x = mapx(waveMode ? b : stick); QString s; s.setNum(bar + 1); @@ -411,7 +411,7 @@ void MTScale::pdraw(QPainter& p, const QRect& r) for (int beat = 0; beat < z; beat++) { int xx = AL::sigmap.bar2tick(bar, beat, 0); if (waveMode) - xx = tempomap.tick2frame(xx); + xx = MusEGlobal::tempomap.tick2frame(xx); int xp = mapx(xx); QString s; QRect r(xp+2, y, 1000, h); @@ -420,12 +420,12 @@ void MTScale::pdraw(QPainter& p, const QRect& r) if (beat == 0) { num = bar + 1; y1 = y + 1; - p.setFont(MusEConfig::config.fonts[3]); + p.setFont(MusEGlobal::config.fonts[3]); } else { num = beat + 1; y1 = y + 7; - p.setFont(MusEConfig::config.fonts[1]); + p.setFont(MusEGlobal::config.fonts[1]); r.setY(y+3); } s.setNum(num); @@ -436,4 +436,4 @@ void MTScale::pdraw(QPainter& p, const QRect& r) } } -} // namespace MusEWidget +} // namespace MusEGui diff --git a/muse2/muse/widgets/mtscale.h b/muse2/muse/widgets/mtscale.h index 820e33c6..a505c832 100644 --- a/muse2/muse/widgets/mtscale.h +++ b/muse2/muse/widgets/mtscale.h @@ -26,7 +26,7 @@ #include "view.h" -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // MTScale diff --git a/muse2/muse/widgets/mtscale_flo.cpp b/muse2/muse/widgets/mtscale_flo.cpp index beb7eef3..df077102 100644 --- a/muse2/muse/widgets/mtscale_flo.cpp +++ b/muse2/muse/widgets/mtscale_flo.cpp @@ -31,7 +31,7 @@ #include "gconfig.h" #include "scoreedit.h" -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // MTScale @@ -42,14 +42,14 @@ MTScaleFlo::MTScaleFlo(ScoreCanvas* parent_editor, QWidget* parent_widget) : View(parent_widget, 1, 1) { setToolTip(tr("bar scale")); - pos[0] = song->cpos(); - pos[1] = song->lpos(); - pos[2] = song->rpos(); + pos[0] = MusEGlobal::song->cpos(); + pos[1] = MusEGlobal::song->lpos(); + pos[2] = MusEGlobal::song->rpos(); button = Qt::NoButton; setMouseTracking(true); - connect(song, SIGNAL(posChanged(int, unsigned, bool)), SLOT(setPos(int, unsigned, bool))); - connect(song, SIGNAL(songChanged(int)), SLOT(songChanged(int))); - connect(song, SIGNAL(markerChanged(int)), SLOT(redraw())); + connect(MusEGlobal::song, SIGNAL(posChanged(int, unsigned, bool)), SLOT(setPos(int, unsigned, bool))); + connect(MusEGlobal::song, SIGNAL(songChanged(int)), SLOT(songChanged(int))); + connect(MusEGlobal::song, SIGNAL(markerChanged(int)), SLOT(redraw())); parent=parent_editor; @@ -145,7 +145,7 @@ void MTScaleFlo::mouseMoveEvent(QMouseEvent* event) i = 1; break; case Qt::RightButton: - if ((MusEConfig::config.rangeMarkerWithoutMMB) && (event->modifiers() & Qt::ControlModifier)) + if ((MusEGlobal::config.rangeMarkerWithoutMMB) && (event->modifiers() & Qt::ControlModifier)) i = 1; else i = 2; @@ -153,22 +153,22 @@ void MTScaleFlo::mouseMoveEvent(QMouseEvent* event) default: return; // if no button is pressed the function returns here } - Pos p(tick, true); + MusECore::Pos p(tick, true); if(i== 0 && (event->modifiers() & Qt::ShiftModifier )) { // If shift +LMB we add a marker - Marker *alreadyExists = song->getMarkerAt(tick); + MusECore::Marker *alreadyExists = MusEGlobal::song->getMarkerAt(tick); if (!alreadyExists) - song->addMarker(QString(""), tick, false); + MusEGlobal::song->addMarker(QString(""), tick, false); } else if (i== 2 && (event->modifiers() & Qt::ShiftModifier )) { // If shift +RMB we remove a marker - Marker *toRemove = song->getMarkerAt(tick); + MusECore::Marker *toRemove = MusEGlobal::song->getMarkerAt(tick); if (toRemove) - song->removeMarker(toRemove); + MusEGlobal::song->removeMarker(toRemove); else printf("No marker to remove\n"); } else - song->setPos(i, p); // all other cases: relocating one of the locators + MusEGlobal::song->setPos(i, p); // all other cases: relocating one of the locators } @@ -191,18 +191,18 @@ void MTScaleFlo::draw(QPainter& p, const QRect& r) int y = 12; p.setPen(Qt::black); - p.setFont(MusEConfig::config.fonts[4]); + p.setFont(MusEGlobal::config.fonts[4]); p.drawLine(r.x(), y+1, r.x() + r.width(), y+1); QRect tr(r); tr.setHeight(12); - MarkerList* marker = song->marker(); - for (iMarker m = marker->begin(); m != marker->end(); ++m) { + MusECore::MarkerList* marker = MusEGlobal::song->marker(); + for (MusECore::iMarker m = marker->begin(); m != marker->end(); ++m) { int xp = parent->tick_to_x(m->second.tick()) + xoffset - xpos; if (xp > x+w) break; int xe = r.x() + r.width(); - iMarker mm = m; + MusECore::iMarker mm = m; ++mm; if (mm != marker->end()) xe = parent->tick_to_x(mm->first) + xoffset - xpos; @@ -290,7 +290,7 @@ void MTScaleFlo::draw(QPainter& p, const QRect& r) n = 32; if (bar % n) continue; - p.setFont(MusEConfig::config.fonts[3]); + p.setFont(MusEGlobal::config.fonts[3]); int x = parent->tick_to_x(stick) + xoffset - xpos; QString s; s.setNum(bar + 1); @@ -311,12 +311,12 @@ void MTScaleFlo::draw(QPainter& p, const QRect& r) if (beat == 0) { num = bar + 1; y1 = y + 1; - p.setFont(MusEConfig::config.fonts[3]); + p.setFont(MusEGlobal::config.fonts[3]); } else { num = beat + 1; y1 = y + 7; - p.setFont(MusEConfig::config.fonts[1]); + p.setFont(MusEGlobal::config.fonts[1]); r.setY(y+3); } s.setNum(num); @@ -344,4 +344,4 @@ void MTScaleFlo::pos_add_changed() redraw(); } -} // namespace MusEWidget +} // namespace MusEGui diff --git a/muse2/muse/widgets/mtscale_flo.h b/muse2/muse/widgets/mtscale_flo.h index b7169ab6..9a0b414e 100644 --- a/muse2/muse/widgets/mtscale_flo.h +++ b/muse2/muse/widgets/mtscale_flo.h @@ -26,9 +26,9 @@ #include "view.h" -class ScoreCanvas; +namespace MusEGui { -namespace MusEWidget { +class ScoreCanvas; //--------------------------------------------------------- // MTScaleFlo @@ -65,7 +65,7 @@ class MTScaleFlo : public View { MTScaleFlo(ScoreCanvas* parent_editor, QWidget* parent_widget); }; -} // namespace MusEWidget +} // namespace MusEGui #endif diff --git a/muse2/muse/widgets/musewidgetsplug.cpp b/muse2/muse/widgets/musewidgetsplug.cpp index 01cc68b3..26a3054d 100644 --- a/muse2/muse/widgets/musewidgetsplug.cpp +++ b/muse2/muse/widgets/musewidgetsplug.cpp @@ -43,7 +43,7 @@ int sampleRate = 44100; // some dummy values to get things compiled/linked int division = 384; -int mtcType = 0; +int MusEGlobal::mtcType = 0; bool hIsB = false; static const char* vall[] = { diff --git a/muse2/muse/widgets/nentry.cpp b/muse2/muse/widgets/nentry.cpp index a70b1a54..e1ff4a1c 100644 --- a/muse2/muse/widgets/nentry.cpp +++ b/muse2/muse/widgets/nentry.cpp @@ -37,7 +37,7 @@ #define TIMEC2 20 #define TIMER4 50 -namespace MusEWidget { +namespace MusEGui { NentryFilter::NentryFilter(QObject* parent) : QObject(parent) @@ -255,7 +255,7 @@ void Nentry::repeat() switch (button) { case Qt::LeftButton: - if (!MusEConfig::config.leftMouseButtonCanDecrease) + if (!MusEGlobal::config.leftMouseButtonCanDecrease) return; // else fall through case Qt::MidButton: @@ -419,4 +419,4 @@ bool Nentry::keyPress(QKeyEvent* event) return true; } -} // namespace MusEWidget +} // namespace MusEGui diff --git a/muse2/muse/widgets/nentry.h b/muse2/muse/widgets/nentry.h index c0508c63..dab5278a 100644 --- a/muse2/muse/widgets/nentry.h +++ b/muse2/muse/widgets/nentry.h @@ -30,7 +30,7 @@ class QLabel; class QLineEdit; class QTimer; -namespace MusEWidget { +namespace MusEGui { class NentryFilter : public QObject { Q_OBJECT @@ -99,6 +99,6 @@ class Nentry : public QFrame { bool contextMenu(QContextMenuEvent*); }; -} // namespace MusEWidget +} // namespace MusEGui #endif diff --git a/muse2/muse/widgets/noteinfo.cpp b/muse2/muse/widgets/noteinfo.cpp index 2a262723..1411b7b5 100644 --- a/muse2/muse/widgets/noteinfo.cpp +++ b/muse2/muse/widgets/noteinfo.cpp @@ -31,7 +31,7 @@ ///#include "posedit.h" #include "pitchedit.h" -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------- // NoteInfo @@ -105,7 +105,7 @@ NoteInfo::NoteInfo(QWidget* parent) connect(selPitch, SIGNAL(valueChanged(int)), SLOT(pitchChanged(int))); connect(selVelOn, SIGNAL(valueChanged(int)), SLOT(velOnChanged(int))); connect(selVelOff, SIGNAL(valueChanged(int)), SLOT(velOffChanged(int))); - connect(selTime, SIGNAL(valueChanged(const Pos&)), SLOT(timeChanged(const Pos&))); + connect(selTime, SIGNAL(valueChanged(const MusECore::Pos&)), SLOT(timeChanged(const MusECore::Pos&))); } //--------------------------------------------------------- @@ -220,10 +220,10 @@ void NoteInfo::setValues(unsigned tick, int val2, int val3, int val4, // timeChanged //--------------------------------------------------------- -void NoteInfo::timeChanged(const Pos& pos) +void NoteInfo::timeChanged(const MusECore::Pos& pos) { if (!signalsBlocked()) emit valueChanged(VAL_TIME, pos.tick()); } -} // namespace MusEWidget +} // namespace MusEGui diff --git a/muse2/muse/widgets/noteinfo.h b/muse2/muse/widgets/noteinfo.h index 9d33db6b..078ba85c 100644 --- a/muse2/muse/widgets/noteinfo.h +++ b/muse2/muse/widgets/noteinfo.h @@ -32,9 +32,11 @@ namespace Awl { class QSpinBox; ///class PosEdit; +namespace MusECore { class Pos; +} -namespace MusEWidget { +namespace MusEGui { class PitchEdit; @@ -67,16 +69,16 @@ class NoteInfo : public QToolBar { void velOnChanged(int); void velOffChanged(int); void pitchChanged(int); - void timeChanged(const Pos&); + void timeChanged(const MusECore::Pos&); public slots: void setValue(ValType, int); signals: - void valueChanged(MusEWidget::NoteInfo::ValType, int); + void valueChanged(MusEGui::NoteInfo::ValType, int); }; -} // namespace MusEWidget +} // namespace MusEGui #endif diff --git a/muse2/muse/widgets/pastedialog.cpp b/muse2/muse/widgets/pastedialog.cpp index bc031b30..5b582f30 100644 --- a/muse2/muse/widgets/pastedialog.cpp +++ b/muse2/muse/widgets/pastedialog.cpp @@ -25,9 +25,9 @@ #include "xml.h" #include "gconfig.h" -using MusEConfig::config; +using MusEGlobal::config; -namespace MusEDialog { +namespace MusEGui { PasteDialog::PasteDialog(QWidget* parent) : QDialog(parent) @@ -103,18 +103,18 @@ void PasteDialog::number_changed(int n) } -void PasteDialog::read_configuration(Xml& xml) +void PasteDialog::read_configuration(MusECore::Xml& xml) { for (;;) { - Xml::Token token = xml.parse(); - if (token == Xml::Error || token == Xml::End) + MusECore::Xml::Token token = xml.parse(); + if (token == MusECore::Xml::Error || token == MusECore::Xml::End) break; const QString& tag = xml.s1(); switch (token) { - case Xml::TagStart: + case MusECore::Xml::TagStart: if (tag == "insert_method") insert_method=xml.parseInt(); else if (tag == "number") @@ -129,7 +129,7 @@ void PasteDialog::read_configuration(Xml& xml) xml.unknown("PasteDialog"); break; - case Xml::TagEnd: + case MusECore::Xml::TagEnd: if (tag == "pastedialog") return; @@ -139,7 +139,7 @@ void PasteDialog::read_configuration(Xml& xml) } } -void PasteDialog::write_configuration(int level, Xml& xml) +void PasteDialog::write_configuration(int level, MusECore::Xml& xml) { xml.tag(level++, "pastedialog"); xml.intTag(level, "insert_method", insert_method); @@ -150,4 +150,4 @@ void PasteDialog::write_configuration(int level, Xml& xml) xml.tag(level, "/pastedialog"); } -} // namespace MusEDialog +} // namespace MusEGui diff --git a/muse2/muse/widgets/pastedialog.h b/muse2/muse/widgets/pastedialog.h index 39121964..af28d3b1 100644 --- a/muse2/muse/widgets/pastedialog.h +++ b/muse2/muse/widgets/pastedialog.h @@ -26,9 +26,11 @@ #include "ui_pastedialogbase.h" #include <QString> +namespace MusECore { class Xml; +} -namespace MusEDialog { +namespace MusEGui { class PasteDialog : public QDialog, public Ui::PasteDialogBase { @@ -53,15 +55,15 @@ class PasteDialog : public QDialog, public Ui::PasteDialogBase bool all_in_one_track; bool clone; - void read_configuration(Xml& xml); - void write_configuration(int level, Xml& xml); + void read_configuration(MusECore::Xml& xml); + void write_configuration(int level, MusECore::Xml& xml); public slots: int exec(); }; -} // namespace MusEDialog +} // namespace MusEGui #endif diff --git a/muse2/muse/widgets/pasteeventsdialog.cpp b/muse2/muse/widgets/pasteeventsdialog.cpp index e8436711..48782e25 100644 --- a/muse2/muse/widgets/pasteeventsdialog.cpp +++ b/muse2/muse/widgets/pasteeventsdialog.cpp @@ -25,9 +25,9 @@ #include "xml.h" #include "gconfig.h" -using MusEConfig::config; +using MusEGlobal::config; -namespace MusEDialog { +namespace MusEGui { PasteEventsDialog::PasteEventsDialog(QWidget* parent) : QDialog(parent) @@ -122,18 +122,18 @@ void PasteEventsDialog::number_changed(int n) } -void PasteEventsDialog::read_configuration(Xml& xml) +void PasteEventsDialog::read_configuration(MusECore::Xml& xml) { for (;;) { - Xml::Token token = xml.parse(); - if (token == Xml::Error || token == Xml::End) + MusECore::Xml::Token token = xml.parse(); + if (token == MusECore::Xml::Error || token == MusECore::Xml::End) break; const QString& tag = xml.s1(); switch (token) { - case Xml::TagStart: + case MusECore::Xml::TagStart: if (tag == "number") number=xml.parseInt(); else if (tag == "raster") @@ -150,7 +150,7 @@ void PasteEventsDialog::read_configuration(Xml& xml) xml.unknown("PasteEventsDialog"); break; - case Xml::TagEnd: + case MusECore::Xml::TagEnd: if (tag == "pasteeventsdialog") return; @@ -160,7 +160,7 @@ void PasteEventsDialog::read_configuration(Xml& xml) } } -void PasteEventsDialog::write_configuration(int level, Xml& xml) +void PasteEventsDialog::write_configuration(int level, MusECore::Xml& xml) { xml.tag(level++, "pasteeventsdialog"); xml.intTag(level, "number", number); @@ -172,4 +172,4 @@ void PasteEventsDialog::write_configuration(int level, Xml& xml) xml.tag(level, "/pasteeventsdialog"); } -} // namespace MusEDialog +} // namespace MusEGui diff --git a/muse2/muse/widgets/pasteeventsdialog.h b/muse2/muse/widgets/pasteeventsdialog.h index 59e6f52b..e22a3693 100644 --- a/muse2/muse/widgets/pasteeventsdialog.h +++ b/muse2/muse/widgets/pasteeventsdialog.h @@ -26,9 +26,11 @@ #include "ui_pasteeventsdialogbase.h" #include <QString> +namespace MusECore { class Xml; +} -namespace MusEDialog { +namespace MusEGui { class PasteEventsDialog : public QDialog, public Ui::PasteEventsDialogBase { @@ -55,15 +57,15 @@ class PasteEventsDialog : public QDialog, public Ui::PasteEventsDialogBase bool into_single_part; bool into_single_part_allowed; - void read_configuration(Xml& xml); - void write_configuration(int level, Xml& xml); + void read_configuration(MusECore::Xml& xml); + void write_configuration(int level, MusECore::Xml& xml); public slots: int exec(); }; -} // namespace MusEDialog +} // namespace MusEGui #endif diff --git a/muse2/muse/widgets/pitchedit.cpp b/muse2/muse/widgets/pitchedit.cpp index 4b937237..3cbe882e 100644 --- a/muse2/muse/widgets/pitchedit.cpp +++ b/muse2/muse/widgets/pitchedit.cpp @@ -24,7 +24,7 @@ #include "pitchedit.h" #include "helper.h" -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // PitchEdit @@ -51,7 +51,7 @@ QString PitchEdit::mapValueToText(int v) return s; } else - return MusEUtil::pitch2string(v); + return MusECore::pitch2string(v); } //--------------------------------------------------------- @@ -79,4 +79,4 @@ void PitchEdit::setDeltaMode(bool val) setRange(0, 127); } -} // namespace MusEWidget +} // namespace MusEGui diff --git a/muse2/muse/widgets/pitchedit.h b/muse2/muse/widgets/pitchedit.h index d5bb7654..bcd77100 100644 --- a/muse2/muse/widgets/pitchedit.h +++ b/muse2/muse/widgets/pitchedit.h @@ -25,7 +25,7 @@ #include <QSpinBox> -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // PitchEdit @@ -45,6 +45,6 @@ class PitchEdit : public QSpinBox { void setDeltaMode(bool); }; -} // namespace MusEWidget +} // namespace MusEGui #endif diff --git a/muse2/muse/widgets/pitchlabel.cpp b/muse2/muse/widgets/pitchlabel.cpp index b1b9c1f1..1ab5aa8e 100644 --- a/muse2/muse/widgets/pitchlabel.cpp +++ b/muse2/muse/widgets/pitchlabel.cpp @@ -27,7 +27,7 @@ #include "pitchlabel.h" #include "helper.h" -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // PitchLabel @@ -83,7 +83,7 @@ void PitchLabel::setValue(int val) _value = val; QString s; if (_pitchMode) - s = MusEUtil::pitch2string(_value); + s = MusECore::pitch2string(_value); else s.sprintf("%d", _value); setText(s); @@ -112,4 +112,4 @@ void PitchLabel::setPitch(int val) setValue(val); } -} // namespace MusEWidget +} // namespace MusEGui diff --git a/muse2/muse/widgets/pitchlabel.h b/muse2/muse/widgets/pitchlabel.h index 3fe2eb42..8300357a 100644 --- a/muse2/muse/widgets/pitchlabel.h +++ b/muse2/muse/widgets/pitchlabel.h @@ -25,7 +25,7 @@ #include <QLabel> -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // PitchLabel @@ -53,7 +53,7 @@ class PitchLabel : public QLabel { bool pitchMode() const { return _pitchMode; } }; -} // namespace MusEWidget +} // namespace MusEGui #endif diff --git a/muse2/muse/widgets/popupmenu.cpp b/muse2/muse/widgets/popupmenu.cpp index 2b0b6711..af546ec3 100644 --- a/muse2/muse/widgets/popupmenu.cpp +++ b/muse2/muse/widgets/popupmenu.cpp @@ -41,7 +41,7 @@ #include "route.h" -namespace MusEWidget { +namespace MusEGui { //====================== // PopupMenu @@ -152,9 +152,9 @@ QAction* PopupMenu::findActionFromData(const QVariant& v) const // are not called. Instead the values' addresses are compared." // // Take care of struct Route first. Insert other future custom structures here too ! - if(act->data().canConvert<Route>() && v.canConvert<Route>()) + if(act->data().canConvert<MusECore::Route>() && v.canConvert<MusECore::Route>()) { - if(act->data().value<Route>() == v.value<Route>()) + if(act->data().value<MusECore::Route>() == v.value<MusECore::Route>()) return act; } else @@ -174,7 +174,7 @@ bool PopupMenu::event(QEvent* event) case QEvent::MouseButtonDblClick: { if(_stayOpen) - //if(_stayOpen && MusEConfig::config.popupsDefaultStayOpen) + //if(_stayOpen && MusEGlobal::config.popupsDefaultStayOpen) { QMouseEvent* e = static_cast<QMouseEvent*>(event); if(e->modifiers() == Qt::NoModifier) @@ -193,7 +193,7 @@ bool PopupMenu::event(QEvent* event) case QEvent::KeyPress: { if(_stayOpen) - //if(_stayOpen && MusEConfig::config.popupsDefaultStayOpen) + //if(_stayOpen && MusEGlobal::config.popupsDefaultStayOpen) { QKeyEvent* e = static_cast<QKeyEvent*>(event); if(e->modifiers() == Qt::NoModifier && e->key() == Qt::Key_Space) @@ -347,7 +347,7 @@ void PopupMenu::mouseReleaseEvent(QMouseEvent *e) #else // Check for Ctrl to stay open. - if(!_stayOpen || (!MusEConfig::config.popupsDefaultStayOpen && (e->modifiers() & Qt::ControlModifier) == 0)) + if(!_stayOpen || (!MusEGlobal::config.popupsDefaultStayOpen && (e->modifiers() & Qt::ControlModifier) == 0)) { QMenu::mouseReleaseEvent(e); return; @@ -390,4 +390,4 @@ void PopupView::clear() } */ -} // namespace MusEWidget +} // namespace MusEGui diff --git a/muse2/muse/widgets/popupmenu.h b/muse2/muse/widgets/popupmenu.h index b51cfd56..7fc07698 100644 --- a/muse2/muse/widgets/popupmenu.h +++ b/muse2/muse/widgets/popupmenu.h @@ -47,7 +47,7 @@ class QEvent; //class QTimer; //class QStandardItemModel; -namespace MusEWidget { +namespace MusEGui { class PopupMenu : public QMenu { @@ -101,7 +101,7 @@ class PopupView : public QColumnView }; */ -} // namespace MusEWidget +} // namespace MusEGui #endif diff --git a/muse2/muse/widgets/posedit.cpp b/muse2/muse/widgets/posedit.cpp index 772d434a..b1637da8 100644 --- a/muse2/muse/widgets/posedit.cpp +++ b/muse2/muse/widgets/posedit.cpp @@ -36,9 +36,9 @@ #include "sig.h" #include "spinbox.h" -extern int mtcType; +extern int MusEGlobal::mtcType; -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // QNumberSection @@ -644,7 +644,7 @@ void PosEdit::setSec(int secNo, int val) val = 59; break; case 2: - switch(mtcType) { + switch(MusEGlobal::mtcType) { case 0: // 24 frames sec if (val > 23) val = 23; @@ -719,7 +719,7 @@ bool PosEdit::outOfRange(int secNo, int val) const limit = 59; break; case 2: - switch(mtcType) { + switch(MusEGlobal::mtcType) { case 0: // 24 frames sec limit = 23; break; @@ -871,4 +871,4 @@ void PosEdit::setEnabled(bool v) updateButtons(); } -} // namespace MusEWidget +} // namespace MusEGui diff --git a/muse2/muse/widgets/posedit.h b/muse2/muse/widgets/posedit.h index 5f763f51..1b013a11 100644 --- a/muse2/muse/widgets/posedit.h +++ b/muse2/muse/widgets/posedit.h @@ -34,7 +34,7 @@ class QTimerEvent; class PosEditor; class SpinBox; -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // PosEdit @@ -118,6 +118,6 @@ class PosEdit : public QWidget void enterPressed(); }; -} // namespace MusEWidget +} // namespace MusEGui #endif diff --git a/muse2/muse/widgets/poslabel.cpp b/muse2/muse/widgets/poslabel.cpp index 98a7eba3..6cdcb27e 100644 --- a/muse2/muse/widgets/poslabel.cpp +++ b/muse2/muse/widgets/poslabel.cpp @@ -33,9 +33,11 @@ #include "tempo.h" #include "globals.h" +namespace MusEGlobal { extern int mtcType; +} -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // PosLabel @@ -87,7 +89,7 @@ void PosLabel::updateValue() int min = int(time) / 60; int sec = int(time) % 60; double rest = time - (min * 60 + sec); - switch(mtcType) { + switch(MusEGlobal::mtcType) { case 0: // 24 frames sec rest *= 24; break; @@ -165,10 +167,10 @@ void PosLabel::setSmpte(bool val) { _smpte = val; if (val) - _sampleValue = tempomap.tick2frame(_tickValue); + _sampleValue = MusEGlobal::tempomap.tick2frame(_tickValue); else - _tickValue = tempomap.frame2tick(_sampleValue); + _tickValue = MusEGlobal::tempomap.frame2tick(_sampleValue); updateValue(); } -} // namespace MusEWidget +} // namespace MusEGui diff --git a/muse2/muse/widgets/poslabel.h b/muse2/muse/widgets/poslabel.h index 38236ac7..3662c82e 100644 --- a/muse2/muse/widgets/poslabel.h +++ b/muse2/muse/widgets/poslabel.h @@ -25,7 +25,7 @@ #include <QLabel> -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // PosLabel @@ -58,7 +58,7 @@ class PosLabel : public QLabel { bool smpte() const { return _smpte; } }; -} // namespace MusEWidget +} // namespace MusEGui #endif diff --git a/muse2/muse/widgets/projectcreateimpl.cpp b/muse2/muse/widgets/projectcreateimpl.cpp index d6f918b3..31973101 100644 --- a/muse2/muse/widgets/projectcreateimpl.cpp +++ b/muse2/muse/widgets/projectcreateimpl.cpp @@ -28,14 +28,14 @@ #include "globals.h" #include "app.h" -namespace MusEWidget { +namespace MusEGui { ProjectCreateImpl::ProjectCreateImpl(QWidget *parent) : QDialog(parent) { setupUi(this); - createFolderCheckbox->setChecked(MusEConfig::config.projectStoreInFolder); + createFolderCheckbox->setChecked(MusEGlobal::config.projectStoreInFolder); connect(browseDirButton,SIGNAL(clicked()), this, SLOT(selectDirectory())); connect(projectNameEdit,SIGNAL(textChanged(QString)), this, SLOT(updateDirectoryPath())); connect(createFolderCheckbox,SIGNAL(clicked()), this, SLOT(updateDirectoryPath())); @@ -46,7 +46,7 @@ ProjectCreateImpl::ProjectCreateImpl(QWidget *parent) : // as of Qt-4.7.1 //commentEdit->setPlaceholderText("<Add information about project here>"); #endif - directoryPath = MusEConfig::config.projectBaseFolder; + directoryPath = MusEGlobal::config.projectBaseFolder; updateDirectoryPath(); show(); } @@ -88,10 +88,10 @@ QString ProjectCreateImpl::getSongInfo() } void ProjectCreateImpl::ok() { - MusEConfig::config.projectStoreInFolder = createFolderCheckbox->isChecked(); - MusEConfig::config.projectBaseFolder = directoryPath; + MusEGlobal::config.projectStoreInFolder = createFolderCheckbox->isChecked(); + MusEGlobal::config.projectBaseFolder = directoryPath; MusEGlobal::muse->changeConfig(true); emit accept(); } -} //namespace MusEWidget +} //namespace MusEGui diff --git a/muse2/muse/widgets/projectcreateimpl.h b/muse2/muse/widgets/projectcreateimpl.h index d6881840..258b0921 100644 --- a/muse2/muse/widgets/projectcreateimpl.h +++ b/muse2/muse/widgets/projectcreateimpl.h @@ -26,7 +26,7 @@ #include <QDialog> #include "ui_projectcreate.h" -namespace MusEWidget { +namespace MusEGui { class ProjectCreateImpl : public QDialog, Ui::ProjectCreate { @@ -47,6 +47,6 @@ public slots: }; -} // namespace MusEWidget +} // namespace MusEGui #endif // PROJECTCREATEIMPL_H diff --git a/muse2/muse/widgets/routepopup.cpp b/muse2/muse/widgets/routepopup.cpp index 0336f8ed..799d9079 100644 --- a/muse2/muse/widgets/routepopup.cpp +++ b/muse2/muse/widgets/routepopup.cpp @@ -34,16 +34,16 @@ #include "menutitleitem.h" #include "popupmenu.h" -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // addMenuItem //--------------------------------------------------------- -int RoutePopupMenu::addMenuItem(AudioTrack* track, Track* route_track, PopupMenu* lb, int id, int channel, int channels, bool isOutput) +int RoutePopupMenu::addMenuItem(MusECore::AudioTrack* track, MusECore::Track* route_track, PopupMenu* lb, int id, int channel, int channels, bool isOutput) { // totalInChannels is only used by syntis. - int toch = ((AudioTrack*)track)->totalOutChannels(); + int toch = ((MusECore::AudioTrack*)track)->totalOutChannels(); // If track channels = 1, it must be a mono synth. And synti channels cannot be changed by user. if(track->channels() == 1) toch = 1; @@ -52,7 +52,7 @@ int RoutePopupMenu::addMenuItem(AudioTrack* track, Track* route_track, PopupMenu //if(route_track->channels() > 1 && (channel+1 == chans)) // return id; - RouteList* rl = isOutput ? track->outRoutes() : track->inRoutes(); + MusECore::RouteList* rl = isOutput ? track->outRoutes() : track->inRoutes(); QAction* act; @@ -64,15 +64,15 @@ int RoutePopupMenu::addMenuItem(AudioTrack* track, Track* route_track, PopupMenu int ach = channel; int bch = -1; - Route r(route_track, isOutput ? ach : bch, channels); + MusECore::Route r(route_track, isOutput ? ach : bch, channels); r.remoteChannel = isOutput ? bch : ach; act->setData(qVariantFromValue(r)); - for(ciRoute ir = rl->begin(); ir != rl->end(); ++ir) + for(MusECore::ciRoute ir = rl->begin(); ir != rl->end(); ++ir) { - if(ir->type == Route::TRACK_ROUTE && ir->track == route_track && ir->remoteChannel == r.remoteChannel) + if(ir->type == MusECore::Route::TRACK_ROUTE && ir->track == route_track && ir->remoteChannel == r.remoteChannel) { int tcompch = r.channel; if(tcompch == -1) @@ -102,11 +102,11 @@ int RoutePopupMenu::addMenuItem(AudioTrack* track, Track* route_track, PopupMenu // addAuxPorts //--------------------------------------------------------- -int RoutePopupMenu::addAuxPorts(AudioTrack* t, PopupMenu* lb, int id, int channel, int channels, bool isOutput) +int RoutePopupMenu::addAuxPorts(MusECore::AudioTrack* t, PopupMenu* lb, int id, int channel, int channels, bool isOutput) { - AuxList* al = song->auxs(); - for (iAudioAux i = al->begin(); i != al->end(); ++i) { - Track* track = *i; + MusECore::AuxList* al = MusEGlobal::song->auxs(); + for (MusECore::iAudioAux i = al->begin(); i != al->end(); ++i) { + MusECore::Track* track = *i; if (t == track) continue; id = addMenuItem(t, track, lb, id, channel, channels, isOutput); @@ -118,11 +118,11 @@ int RoutePopupMenu::addAuxPorts(AudioTrack* t, PopupMenu* lb, int id, int channe // addInPorts //--------------------------------------------------------- -int RoutePopupMenu::addInPorts(AudioTrack* t, PopupMenu* lb, int id, int channel, int channels, bool isOutput) +int RoutePopupMenu::addInPorts(MusECore::AudioTrack* t, PopupMenu* lb, int id, int channel, int channels, bool isOutput) { - InputList* al = song->inputs(); - for (iAudioInput i = al->begin(); i != al->end(); ++i) { - Track* track = *i; + MusECore::InputList* al = MusEGlobal::song->inputs(); + for (MusECore::iAudioInput i = al->begin(); i != al->end(); ++i) { + MusECore::Track* track = *i; if (t == track) continue; id = addMenuItem(t, track, lb, id, channel, channels, isOutput); @@ -134,11 +134,11 @@ int RoutePopupMenu::addInPorts(AudioTrack* t, PopupMenu* lb, int id, int channel // addOutPorts //--------------------------------------------------------- -int RoutePopupMenu::addOutPorts(AudioTrack* t, PopupMenu* lb, int id, int channel, int channels, bool isOutput) +int RoutePopupMenu::addOutPorts(MusECore::AudioTrack* t, PopupMenu* lb, int id, int channel, int channels, bool isOutput) { - OutputList* al = song->outputs(); - for (iAudioOutput i = al->begin(); i != al->end(); ++i) { - Track* track = *i; + MusECore::OutputList* al = MusEGlobal::song->outputs(); + for (MusECore::iAudioOutput i = al->begin(); i != al->end(); ++i) { + MusECore::Track* track = *i; if (t == track) continue; id = addMenuItem(t, track, lb, id, channel, channels, isOutput); @@ -150,11 +150,11 @@ int RoutePopupMenu::addOutPorts(AudioTrack* t, PopupMenu* lb, int id, int channe // addGroupPorts //--------------------------------------------------------- -int RoutePopupMenu::addGroupPorts(AudioTrack* t, PopupMenu* lb, int id, int channel, int channels, bool isOutput) +int RoutePopupMenu::addGroupPorts(MusECore::AudioTrack* t, PopupMenu* lb, int id, int channel, int channels, bool isOutput) { - GroupList* al = song->groups(); - for (iAudioGroup i = al->begin(); i != al->end(); ++i) { - Track* track = *i; + MusECore::GroupList* al = MusEGlobal::song->groups(); + for (MusECore::iAudioGroup i = al->begin(); i != al->end(); ++i) { + MusECore::Track* track = *i; if (t == track) continue; id = addMenuItem(t, track, lb, id, channel, channels, isOutput); @@ -166,11 +166,11 @@ int RoutePopupMenu::addGroupPorts(AudioTrack* t, PopupMenu* lb, int id, int chan // addWavePorts //--------------------------------------------------------- -int RoutePopupMenu::addWavePorts(AudioTrack* t, PopupMenu* lb, int id, int channel, int channels, bool isOutput) +int RoutePopupMenu::addWavePorts(MusECore::AudioTrack* t, PopupMenu* lb, int id, int channel, int channels, bool isOutput) { - WaveTrackList* al = song->waves(); - for (iWaveTrack i = al->begin(); i != al->end(); ++i) { - Track* track = *i; + MusECore::WaveTrackList* al = MusEGlobal::song->waves(); + for (MusECore::iWaveTrack i = al->begin(); i != al->end(); ++i) { + MusECore::Track* track = *i; if (t == track) continue; id = addMenuItem(t, track, lb, id, channel, channels, isOutput); @@ -182,26 +182,26 @@ int RoutePopupMenu::addWavePorts(AudioTrack* t, PopupMenu* lb, int id, int chann // addSyntiPorts //--------------------------------------------------------- -int RoutePopupMenu::addSyntiPorts(AudioTrack* t, PopupMenu* lb, int id, +int RoutePopupMenu::addSyntiPorts(MusECore::AudioTrack* t, PopupMenu* lb, int id, int channel, int channels, bool isOutput) { - RouteList* rl = isOutput ? t->outRoutes() : t->inRoutes(); + MusECore::RouteList* rl = isOutput ? t->outRoutes() : t->inRoutes(); QAction* act; - SynthIList* al = song->syntis(); - for (iSynthI i = al->begin(); i != al->end(); ++i) + MusECore::SynthIList* al = MusEGlobal::song->syntis(); + for (MusECore::iSynthI i = al->begin(); i != al->end(); ++i) { - Track* track = *i; + MusECore::Track* track = *i; if (t == track) continue; - int toch = ((AudioTrack*)track)->totalOutChannels(); + int toch = ((MusECore::AudioTrack*)track)->totalOutChannels(); // If track channels = 1, it must be a mono synth. And synti channels cannot be changed by user. if(track->channels() == 1) toch = 1; // totalInChannels is only used by syntis. - int chans = (!isOutput || track->type() != Track::AUDIO_SOFTSYNTH) ? toch : ((AudioTrack*)track)->totalInChannels(); + int chans = (!isOutput || track->type() != MusECore::Track::AUDIO_SOFTSYNTH) ? toch : ((MusECore::AudioTrack*)track)->totalInChannels(); int tchans = (channels != -1) ? channels: t->channels(); if(tchans == 2) @@ -229,14 +229,14 @@ int RoutePopupMenu::addSyntiPorts(AudioTrack* t, PopupMenu* lb, int id, int ach = (channel == -1) ? ch : channel; int bch = (channel == -1) ? -1 : ch; - Route rt(track, (t->type() != Track::AUDIO_SOFTSYNTH || isOutput) ? ach : bch, tchans); - rt.remoteChannel = (t->type() != Track::AUDIO_SOFTSYNTH || isOutput) ? bch : ach; + MusECore::Route rt(track, (t->type() != MusECore::Track::AUDIO_SOFTSYNTH || isOutput) ? ach : bch, tchans); + rt.remoteChannel = (t->type() != MusECore::Track::AUDIO_SOFTSYNTH || isOutput) ? bch : ach; act->setData(qVariantFromValue(rt)); - for(ciRoute ir = rl->begin(); ir != rl->end(); ++ir) + for(MusECore::ciRoute ir = rl->begin(); ir != rl->end(); ++ir) { - if(ir->type == Route::TRACK_ROUTE && ir->track == track && ir->remoteChannel == rt.remoteChannel) + if(ir->type == MusECore::Route::TRACK_ROUTE && ir->track == track && ir->remoteChannel == rt.remoteChannel) { int tcompch = rt.channel; if(tcompch == -1) @@ -272,7 +272,7 @@ int RoutePopupMenu::addSyntiPorts(AudioTrack* t, PopupMenu* lb, int id, // addMultiChannelOutPorts //--------------------------------------------------------- -int RoutePopupMenu::addMultiChannelPorts(AudioTrack* t, PopupMenu* pup, int id, bool isOutput) +int RoutePopupMenu::addMultiChannelPorts(MusECore::AudioTrack* t, PopupMenu* pup, int id, bool isOutput) { int toch = t->totalOutChannels(); // If track channels = 1, it must be a mono synth. And synti channels cannot be changed by user. @@ -281,7 +281,7 @@ int RoutePopupMenu::addMultiChannelPorts(AudioTrack* t, PopupMenu* pup, int id, // Number of allocated buffers is always MAX_CHANNELS or more, even if _totalOutChannels is less. // totalInChannels is only used by syntis. - int chans = (isOutput || t->type() != Track::AUDIO_SOFTSYNTH) ? toch : t->totalInChannels(); + int chans = (isOutput || t->type() != MusECore::Track::AUDIO_SOFTSYNTH) ? toch : t->totalInChannels(); if(chans > 1) pup->addAction(new MenuTitleItem("<Mono>", pup)); @@ -303,11 +303,11 @@ int RoutePopupMenu::addMultiChannelPorts(AudioTrack* t, PopupMenu* pup, int id, switch(t->type()) { - case Track::AUDIO_INPUT: - case Track::WAVE: - case Track::AUDIO_GROUP: - case Track::AUDIO_SOFTSYNTH: - case Track::AUDIO_AUX: + case MusECore::Track::AUDIO_INPUT: + case MusECore::Track::WAVE: + case MusECore::Track::AUDIO_GROUP: + case MusECore::Track::AUDIO_SOFTSYNTH: + case MusECore::Track::AUDIO_AUX: id = addWavePorts(t, chpup, id, ch, 1, isOutput); id = addOutPorts(t, chpup, id, ch, 1, isOutput); id = addGroupPorts(t, chpup, id, ch, 1, isOutput); @@ -322,16 +322,16 @@ int RoutePopupMenu::addMultiChannelPorts(AudioTrack* t, PopupMenu* pup, int id, switch(t->type()) { - case Track::AUDIO_OUTPUT: + case MusECore::Track::AUDIO_OUTPUT: id = addWavePorts(t, chpup, id, ch, 1, isOutput); id = addInPorts(t, chpup, id, ch, 1, isOutput); id = addGroupPorts(t, chpup, id, ch, 1, isOutput); id = addAuxPorts(t, chpup, id, ch, 1, isOutput); id = addSyntiPorts(t, chpup, id, ch, 1, isOutput); break; - case Track::WAVE: - case Track::AUDIO_SOFTSYNTH: - case Track::AUDIO_GROUP: + case MusECore::Track::WAVE: + case MusECore::Track::AUDIO_SOFTSYNTH: + case MusECore::Track::AUDIO_GROUP: id = addWavePorts(t, chpup, id, ch, 1, isOutput); id = addInPorts(t, chpup, id, ch, 1, isOutput); id = addGroupPorts(t, chpup, id, ch, 1, isOutput); @@ -382,11 +382,11 @@ int RoutePopupMenu::addMultiChannelPorts(AudioTrack* t, PopupMenu* pup, int id, { switch(t->type()) { - case Track::AUDIO_INPUT: - case Track::WAVE: - case Track::AUDIO_GROUP: - case Track::AUDIO_SOFTSYNTH: - case Track::AUDIO_AUX: + case MusECore::Track::AUDIO_INPUT: + case MusECore::Track::WAVE: + case MusECore::Track::AUDIO_GROUP: + case MusECore::Track::AUDIO_SOFTSYNTH: + case MusECore::Track::AUDIO_AUX: id = addWavePorts(t, chpup, id, ch, 2, isOutput); id = addOutPorts(t, chpup, id, ch, 2, isOutput); id = addGroupPorts(t, chpup, id, ch, 2, isOutput); @@ -400,16 +400,16 @@ int RoutePopupMenu::addMultiChannelPorts(AudioTrack* t, PopupMenu* pup, int id, { switch(t->type()) { - case Track::AUDIO_OUTPUT: + case MusECore::Track::AUDIO_OUTPUT: id = addWavePorts(t, chpup, id, ch, 2, isOutput); id = addInPorts(t, chpup, id, ch, 2, isOutput); id = addGroupPorts(t, chpup, id, ch, 2, isOutput); id = addAuxPorts(t, chpup, id, ch, 2, isOutput); id = addSyntiPorts(t, chpup, id, ch, 2, isOutput); break; - case Track::WAVE: - case Track::AUDIO_SOFTSYNTH: - case Track::AUDIO_GROUP: + case MusECore::Track::WAVE: + case MusECore::Track::AUDIO_SOFTSYNTH: + case MusECore::Track::AUDIO_GROUP: id = addWavePorts(t, chpup, id, ch, 2, isOutput); id = addInPorts(t, chpup, id, ch, 2, isOutput); id = addGroupPorts(t, chpup, id, ch, 2, isOutput); @@ -439,25 +439,25 @@ int RoutePopupMenu::addMultiChannelPorts(AudioTrack* t, PopupMenu* pup, int id, // nonSyntiTrackAddSyntis //--------------------------------------------------------- -int RoutePopupMenu::nonSyntiTrackAddSyntis(AudioTrack* t, PopupMenu* lb, int id, bool isOutput) +int RoutePopupMenu::nonSyntiTrackAddSyntis(MusECore::AudioTrack* t, PopupMenu* lb, int id, bool isOutput) { - RouteList* rl = isOutput ? t->outRoutes() : t->inRoutes(); + MusECore::RouteList* rl = isOutput ? t->outRoutes() : t->inRoutes(); QAction* act; - SynthIList* al = song->syntis(); - for (iSynthI i = al->begin(); i != al->end(); ++i) + MusECore::SynthIList* al = MusEGlobal::song->syntis(); + for (MusECore::iSynthI i = al->begin(); i != al->end(); ++i) { - Track* track = *i; + MusECore::Track* track = *i; if (t == track) continue; - int toch = ((AudioTrack*)track)->totalOutChannels(); + int toch = ((MusECore::AudioTrack*)track)->totalOutChannels(); // If track channels = 1, it must be a mono synth. And synti channels cannot be changed by user. if(track->channels() == 1) toch = 1; // totalInChannels is only used by syntis. - int chans = (!isOutput || track->type() != Track::AUDIO_SOFTSYNTH) ? toch : ((AudioTrack*)track)->totalInChannels(); + int chans = (!isOutput || track->type() != MusECore::Track::AUDIO_SOFTSYNTH) ? toch : ((MusECore::AudioTrack*)track)->totalInChannels(); //int schans = synti->channels(); //if(schans < chans) @@ -489,15 +489,15 @@ int RoutePopupMenu::nonSyntiTrackAddSyntis(AudioTrack* t, PopupMenu* lb, int id, int ach = ch; int bch = -1; - Route rt(track, isOutput ? bch : ach, 1); + MusECore::Route rt(track, isOutput ? bch : ach, 1); rt.remoteChannel = isOutput ? ach : bch; act->setData(qVariantFromValue(rt)); - for(ciRoute ir = rl->begin(); ir != rl->end(); ++ir) + for(MusECore::ciRoute ir = rl->begin(); ir != rl->end(); ++ir) { - if(ir->type == Route::TRACK_ROUTE && ir->track == track && ir->remoteChannel == rt.remoteChannel) + if(ir->type == MusECore::Route::TRACK_ROUTE && ir->track == track && ir->remoteChannel == rt.remoteChannel) { int tcompch = rt.channel; if(tcompch == -1) @@ -542,15 +542,15 @@ int RoutePopupMenu::nonSyntiTrackAddSyntis(AudioTrack* t, PopupMenu* lb, int id, int ach = ch; int bch = -1; - Route rt(track, isOutput ? bch : ach, 2); + MusECore::Route rt(track, isOutput ? bch : ach, 2); rt.remoteChannel = isOutput ? ach : bch; act->setData(qVariantFromValue(rt)); - for(ciRoute ir = rl->begin(); ir != rl->end(); ++ir) + for(MusECore::ciRoute ir = rl->begin(); ir != rl->end(); ++ir) { - if(ir->type == Route::TRACK_ROUTE && ir->track == track && ir->remoteChannel == rt.remoteChannel) + if(ir->type == MusECore::Route::TRACK_ROUTE && ir->track == track && ir->remoteChannel == rt.remoteChannel) { int tcompch = rt.channel; if(tcompch == -1) @@ -587,13 +587,13 @@ int RoutePopupMenu::nonSyntiTrackAddSyntis(AudioTrack* t, PopupMenu* lb, int id, // addMidiPorts //--------------------------------------------------------- -int RoutePopupMenu::addMidiPorts(AudioTrack* t, PopupMenu* pup, int id, bool isOutput) +int RoutePopupMenu::addMidiPorts(MusECore::AudioTrack* t, PopupMenu* pup, int id, bool isOutput) { QAction* act; for(int i = 0; i < MIDI_PORTS; ++i) { - MidiPort* mp = &midiPorts[i]; - MidiDevice* md = mp->device(); + MusECore::MidiPort* mp = &MusEGlobal::midiPorts[i]; + MusECore::MidiDevice* md = mp->device(); // This is desirable, but could lead to 'hidden' routes unless we add more support // such as removing the existing routes when user changes flags. @@ -607,7 +607,7 @@ int RoutePopupMenu::addMidiPorts(AudioTrack* t, PopupMenu* pup, int id, bool isO if(md->isSynti()) continue; - RouteList* rl = isOutput ? t->outRoutes() : t->inRoutes(); + MusECore::RouteList* rl = isOutput ? t->outRoutes() : t->inRoutes(); PopupMenu* subp = new PopupMenu(pup, true); subp->setTitle(md->name()); @@ -615,9 +615,9 @@ int RoutePopupMenu::addMidiPorts(AudioTrack* t, PopupMenu* pup, int id, bool isO int chanmask = 0; // To reduce number of routes required, from one per channel to just one containing a channel mask. // Look for the first route to this midi port. There should always be only a single route for each midi port, now. - for(ciRoute ir = rl->begin(); ir != rl->end(); ++ir) + for(MusECore::ciRoute ir = rl->begin(); ir != rl->end(); ++ir) { - if(ir->type == Route::MIDI_PORT_ROUTE && ir->midiPort == i) + if(ir->type == MusECore::Route::MIDI_PORT_ROUTE && ir->midiPort == i) { // We have a route to the midi port. Grab the channel mask. chanmask = ir->channel; @@ -631,7 +631,7 @@ int RoutePopupMenu::addMidiPorts(AudioTrack* t, PopupMenu* pup, int id, bool isO act->setCheckable(true); int chbit = 1 << ch; - Route srcRoute(i, chbit); // In accordance with channel mask, use the bit position. + MusECore::Route srcRoute(i, chbit); // In accordance with channel mask, use the bit position. act->setData(qVariantFromValue(srcRoute)); @@ -644,7 +644,7 @@ int RoutePopupMenu::addMidiPorts(AudioTrack* t, PopupMenu* pup, int id, bool isO //gid = MIDI_PORTS * MIDI_CHANNELS + i; // Make sure each 'toggle' item gets a unique id. act = subp->addAction(QString("Toggle all")); //act->setCheckable(true); - Route togRoute(i, (1 << MIDI_CHANNELS) - 1); // Set all channel bits. + MusECore::Route togRoute(i, (1 << MIDI_CHANNELS) - 1); // Set all channel bits. act->setData(qVariantFromValue(togRoute)); ++id; @@ -658,14 +658,14 @@ int RoutePopupMenu::addMidiPorts(AudioTrack* t, PopupMenu* pup, int id, bool isO // RoutePopupMenu //====================== -RoutePopupMenu::RoutePopupMenu(QWidget* parent, Track* track, bool isOutput) +RoutePopupMenu::RoutePopupMenu(QWidget* parent, MusECore::Track* track, bool isOutput) : _track(track), _isOutMenu(isOutput) { _pup = new PopupMenu(parent, true); init(); } -RoutePopupMenu::RoutePopupMenu(const QString& title, QWidget* parent, Track* track, bool isOutput) +RoutePopupMenu::RoutePopupMenu(const QString& title, QWidget* parent, MusECore::Track* track, bool isOutput) : _track(track), _isOutMenu(isOutput) { _pup = new PopupMenu(title, parent, true); @@ -682,7 +682,7 @@ RoutePopupMenu::~RoutePopupMenu() void RoutePopupMenu::init() { - connect(song, SIGNAL(songChanged(int)), SLOT(songChanged(int))); + connect(MusEGlobal::song, SIGNAL(songChanged(int)), SLOT(songChanged(int))); } void RoutePopupMenu::songChanged(int val) @@ -703,7 +703,7 @@ void RoutePopupMenu::updateRouteMenus() if(!_track || !_pup || _pup->actions().isEmpty() || !_pup->isVisible()) return; - RouteList* rl = _isOutMenu ? _track->outRoutes() : _track->inRoutes(); + MusECore::RouteList* rl = _isOutMenu ? _track->outRoutes() : _track->inRoutes(); // Clear all the action check marks. _pup->clearAllChecks(); @@ -711,22 +711,22 @@ void RoutePopupMenu::updateRouteMenus() // Take care of Midi Port to Audio Input routes first... if(_isOutMenu && _track->isMidiTrack()) { - int port = ((MidiTrack*)_track)->outPort(); + int port = ((MusECore::MidiTrack*)_track)->outPort(); if(port >= 0 && port < MIDI_PORTS) { - MidiPort* mp = &midiPorts[port]; - RouteList* mprl = mp->outRoutes(); - for (ciRoute ir = mprl->begin(); ir != mprl->end(); ++ir) + MusECore::MidiPort* mp = &MusEGlobal::midiPorts[port]; + MusECore::RouteList* mprl = mp->outRoutes(); + for (MusECore::ciRoute ir = mprl->begin(); ir != mprl->end(); ++ir) { - if(ir->type == Route::TRACK_ROUTE && ir->track && ir->track->type() == Track::AUDIO_INPUT) + if(ir->type == MusECore::Route::TRACK_ROUTE && ir->track && ir->track->type() == MusECore::Track::AUDIO_INPUT) { for(int ch = 0; ch < MIDI_CHANNELS; ++ch) { int chbits = 1 << ch; if(ir->channel & chbits) { - Route r(ir->track, chbits); - //printf("RoutePopupMenu::updateRouteMenus MidiPort to AudioInput chbits:%d\n", chbits); + MusECore::Route r(ir->track, chbits); + //printf("RoutePopupMenu::updateRouteMenus MusECore::MidiPort to AudioInput chbits:%d\n", chbits); QAction* act = _pup->findActionFromData(qVariantFromValue(r)); if(act) act->setChecked(true); @@ -738,10 +738,10 @@ void RoutePopupMenu::updateRouteMenus() } // Now check the ones that are found in the route list. - for(ciRoute irl = rl->begin(); irl != rl->end(); ++irl) + for(MusECore::ciRoute irl = rl->begin(); irl != rl->end(); ++irl) { // Do MidiTrack to MidiPort routes... - if(irl->type == Route::MIDI_PORT_ROUTE) + if(irl->type == MusECore::Route::MIDI_PORT_ROUTE) { //printf("RoutePopupMenu::updateRouteMenus MIDI_PORT_ROUTE\n"); for(int ch = 0; ch < MIDI_CHANNELS; ++ch) @@ -749,7 +749,7 @@ void RoutePopupMenu::updateRouteMenus() int chbits = 1 << ch; if(irl->channel & chbits) { - Route r(irl->midiPort, chbits); + MusECore::Route r(irl->midiPort, chbits); QAction* act = _pup->findActionFromData(qVariantFromValue(r)); if(act) act->setChecked(true); @@ -774,25 +774,25 @@ void RoutePopupMenu::popupActivated(QAction* action) if(_track->isMidiTrack()) { - RouteList* rl = _isOutMenu ? _track->outRoutes() : _track->inRoutes(); + MusECore::RouteList* rl = _isOutMenu ? _track->outRoutes() : _track->inRoutes(); // Take care of Route data items first... - if(qVariantCanConvert<Route>(action->data())) + if(qVariantCanConvert<MusECore::Route>(action->data())) { - Route aRoute = action->data().value<Route>(); + MusECore::Route aRoute = action->data().value<MusECore::Route>(); // Support Midi Port to Audio Input track routes. - if(aRoute.type == Route::TRACK_ROUTE && aRoute.track && aRoute.track->type() == Track::AUDIO_INPUT) + if(aRoute.type == MusECore::Route::TRACK_ROUTE && aRoute.track && aRoute.track->type() == MusECore::Track::AUDIO_INPUT) { //if(gIsOutRoutingPopupMenu) // Try to avoid splitting like this. { int chbit = aRoute.channel; - int port = ((MidiTrack*)_track)->outPort(); + int port = ((MusECore::MidiTrack*)_track)->outPort(); if(port < 0 || port >= MIDI_PORTS) return; - MidiPort* mp = &midiPorts[port]; - //MidiDevice* md = mp->device(); + MusECore::MidiPort* mp = &MusEGlobal::midiPorts[port]; + //MusECore::MidiDevice* md = mp->device(); // This is desirable, but could lead to 'hidden' routes unless we add more support // such as removing the existing routes when user changes flags. @@ -802,14 +802,14 @@ void RoutePopupMenu::popupActivated(QAction* action) //if(!(md->rwFlags() & (gIsOutRoutingPopupMenu ? 1 : 2))) // return; - Route bRoute(port, chbit); + MusECore::Route bRoute(port, chbit); int chmask = 0; - RouteList* mprl = _isOutMenu ? mp->outRoutes() : mp->inRoutes(); - ciRoute ir = mprl->begin(); + MusECore::RouteList* mprl = _isOutMenu ? mp->outRoutes() : mp->inRoutes(); + MusECore::ciRoute ir = mprl->begin(); for (; ir != mprl->end(); ++ir) { - if(ir->type == Route::TRACK_ROUTE && ir->track == aRoute.track) // Is there already a route to this port? + if(ir->type == MusECore::Route::TRACK_ROUTE && ir->track == aRoute.track) // Is there already a route to this port? { chmask = ir->channel; // Grab the channel mask. break; @@ -819,33 +819,33 @@ void RoutePopupMenu::popupActivated(QAction* action) { // disconnect if(_isOutMenu) - audio->msgRemoveRoute(bRoute, aRoute); + MusEGlobal::audio->msgRemoveRoute(bRoute, aRoute); else - audio->msgRemoveRoute(aRoute, bRoute); + MusEGlobal::audio->msgRemoveRoute(aRoute, bRoute); } else { // connect if(_isOutMenu) - audio->msgAddRoute(bRoute, aRoute); + MusEGlobal::audio->msgAddRoute(bRoute, aRoute); else - audio->msgAddRoute(aRoute, bRoute); + MusEGlobal::audio->msgAddRoute(aRoute, bRoute); } - audio->msgUpdateSoloStates(); - song->update(SC_ROUTE); + MusEGlobal::audio->msgUpdateSoloStates(); + MusEGlobal::song->update(SC_ROUTE); } return; } - else if(aRoute.type == Route::MIDI_PORT_ROUTE) + else if(aRoute.type == MusECore::Route::MIDI_PORT_ROUTE) { int chbit = aRoute.channel; - Route bRoute(_track, chbit); + MusECore::Route bRoute(_track, chbit); int mdidx = aRoute.midiPort; - MidiPort* mp = &midiPorts[mdidx]; - MidiDevice* md = mp->device(); + MusECore::MidiPort* mp = &MusEGlobal::midiPorts[mdidx]; + MusECore::MidiDevice* md = mp->device(); //if(!md) // Rem. Allow connections to ports with no device. // return; @@ -855,10 +855,10 @@ void RoutePopupMenu::popupActivated(QAction* action) return; int chmask = 0; - ciRoute iir = rl->begin(); + MusECore::ciRoute iir = rl->begin(); for (; iir != rl->end(); ++iir) { - if(iir->type == Route::MIDI_PORT_ROUTE && iir->midiPort == mdidx) // Is there already a route to this port? + if(iir->type == MusECore::Route::MIDI_PORT_ROUTE && iir->midiPort == mdidx) // Is there already a route to this port? { chmask = iir->channel; // Grab the channel mask. break; @@ -868,21 +868,21 @@ void RoutePopupMenu::popupActivated(QAction* action) { // disconnect if(_isOutMenu) - audio->msgRemoveRoute(bRoute, aRoute); + MusEGlobal::audio->msgRemoveRoute(bRoute, aRoute); else - audio->msgRemoveRoute(aRoute, bRoute); + MusEGlobal::audio->msgRemoveRoute(aRoute, bRoute); } else { // connect if(_isOutMenu) - audio->msgAddRoute(bRoute, aRoute); + MusEGlobal::audio->msgAddRoute(bRoute, aRoute); else - audio->msgAddRoute(aRoute, bRoute); + MusEGlobal::audio->msgAddRoute(aRoute, bRoute); } - audio->msgUpdateSoloStates(); - song->update(SC_ROUTE); + MusEGlobal::audio->msgUpdateSoloStates(); + MusEGlobal::song->update(SC_ROUTE); } } else @@ -897,50 +897,50 @@ void RoutePopupMenu::popupActivated(QAction* action) } else { - AudioTrack* t = (AudioTrack*)_track; - RouteList* rl = _isOutMenu ? t->outRoutes() : t->inRoutes(); + MusECore::AudioTrack* t = (MusECore::AudioTrack*)_track; + MusECore::RouteList* rl = _isOutMenu ? t->outRoutes() : t->inRoutes(); - if(!qVariantCanConvert<Route>(action->data())) + if(!qVariantCanConvert<MusECore::Route>(action->data())) return; if(_isOutMenu) { - Route dstRoute = action->data().value<Route>(); - Route srcRoute(t, dstRoute.channel, dstRoute.channels); + MusECore::Route dstRoute = action->data().value<MusECore::Route>(); + MusECore::Route srcRoute(t, dstRoute.channel, dstRoute.channels); srcRoute.remoteChannel = dstRoute.remoteChannel; // check if route src->dst exists: - ciRoute irl = rl->begin(); + MusECore::ciRoute irl = rl->begin(); for (; irl != rl->end(); ++irl) { if (*irl == dstRoute) break; } if (irl != rl->end()) { // disconnect if route exists - audio->msgRemoveRoute(srcRoute, dstRoute); + MusEGlobal::audio->msgRemoveRoute(srcRoute, dstRoute); } else { // connect if route does not exist - audio->msgAddRoute(srcRoute, dstRoute); + MusEGlobal::audio->msgAddRoute(srcRoute, dstRoute); } - audio->msgUpdateSoloStates(); - song->update(SC_ROUTE); + MusEGlobal::audio->msgUpdateSoloStates(); + MusEGlobal::song->update(SC_ROUTE); } else { - Route srcRoute = action->data().value<Route>(); + MusECore::Route srcRoute = action->data().value<MusECore::Route>(); // Support Midi Port to Audio Input routes. - if(_track->type() == Track::AUDIO_INPUT && srcRoute.type == Route::MIDI_PORT_ROUTE) + if(_track->type() == MusECore::Track::AUDIO_INPUT && srcRoute.type == MusECore::Route::MIDI_PORT_ROUTE) { int chbit = srcRoute.channel; - Route dstRoute(t, chbit); + MusECore::Route dstRoute(t, chbit); int mdidx = srcRoute.midiPort; int chmask = 0; - ciRoute iir = rl->begin(); + MusECore::ciRoute iir = rl->begin(); for (; iir != rl->end(); ++iir) { - if(iir->type == Route::MIDI_PORT_ROUTE && iir->midiPort == mdidx) // Is there already a route to this port? + if(iir->type == MusECore::Route::MIDI_PORT_ROUTE && iir->midiPort == mdidx) // Is there already a route to this port? { chmask = iir->channel; // Grab the channel mask. break; @@ -950,37 +950,37 @@ void RoutePopupMenu::popupActivated(QAction* action) if ((chmask & chbit) == chbit) // Is the channel's bit(s) set? { //printf("routingPopupMenuActivated: removing src route ch:%d dst route ch:%d\n", srcRoute.channel, dstRoute.channel); - audio->msgRemoveRoute(srcRoute, dstRoute); + MusEGlobal::audio->msgRemoveRoute(srcRoute, dstRoute); } else { //printf("routingPopupMenuActivated: adding src route ch:%d dst route ch:%d\n", srcRoute.channel, dstRoute.channel); - audio->msgAddRoute(srcRoute, dstRoute); + MusEGlobal::audio->msgAddRoute(srcRoute, dstRoute); } - audio->msgUpdateSoloStates(); - song->update(SC_ROUTE); + MusEGlobal::audio->msgUpdateSoloStates(); + MusEGlobal::song->update(SC_ROUTE); return; } - Route dstRoute(t, srcRoute.channel, srcRoute.channels); + MusECore::Route dstRoute(t, srcRoute.channel, srcRoute.channels); dstRoute.remoteChannel = srcRoute.remoteChannel; - ciRoute irl = rl->begin(); + MusECore::ciRoute irl = rl->begin(); for (; irl != rl->end(); ++irl) { if (*irl == srcRoute) break; } if (irl != rl->end()) { // disconnect - audio->msgRemoveRoute(srcRoute, dstRoute); + MusEGlobal::audio->msgRemoveRoute(srcRoute, dstRoute); } else { // connect - audio->msgAddRoute(srcRoute, dstRoute); + MusEGlobal::audio->msgAddRoute(srcRoute, dstRoute); } - audio->msgUpdateSoloStates(); - song->update(SC_ROUTE); + MusEGlobal::audio->msgUpdateSoloStates(); + MusEGlobal::song->update(SC_ROUTE); } @@ -1002,7 +1002,7 @@ void RoutePopupMenu::prepare() if(_track->isMidiTrack()) { - RouteList* rl = _isOutMenu ? _track->outRoutes() : _track->inRoutes(); + MusECore::RouteList* rl = _isOutMenu ? _track->outRoutes() : _track->inRoutes(); int gid = 0; QAction* act = 0; @@ -1010,10 +1010,10 @@ void RoutePopupMenu::prepare() if(_isOutMenu) { // Support Midi Port to Audio Input track routes. - int port = ((MidiTrack*)_track)->outPort(); + int port = ((MusECore::MidiTrack*)_track)->outPort(); if(port >= 0 && port < MIDI_PORTS) { - MidiPort* mp = &midiPorts[port]; + MusECore::MidiPort* mp = &MusEGlobal::midiPorts[port]; // Do not list synth devices! Requiring valid device is desirable, // but could lead to 'hidden' routes unless we add more support @@ -1021,9 +1021,9 @@ void RoutePopupMenu::prepare() // So for now, just list all valid ports whether read or write. if(mp->device() && !mp->device()->isSynti()) { - RouteList* mprl = mp->outRoutes(); - int chbits = 1 << ((MidiTrack*)_track)->outChannel(); - //MidiDevice* md = mp->device(); + MusECore::RouteList* mprl = mp->outRoutes(); + int chbits = 1 << ((MusECore::MidiTrack*)_track)->outChannel(); + //MusECore::MidiDevice* md = mp->device(); //if(!md) // continue; @@ -1033,18 +1033,18 @@ void RoutePopupMenu::prepare() subp->setTitle(tr("Audio returns")); _pup->addMenu(subp); - InputList* al = song->inputs(); - for (ciAudioInput i = al->begin(); i != al->end(); ++i) + MusECore::InputList* al = MusEGlobal::song->inputs(); + for (MusECore::ciAudioInput i = al->begin(); i != al->end(); ++i) { - Track* t = *i; + MusECore::Track* t = *i; QString s(t->name()); act = subp->addAction(s); act->setCheckable(true); - Route r(t, chbits); + MusECore::Route r(t, chbits); act->setData(qVariantFromValue(r)); - for(ciRoute ir = mprl->begin(); ir != mprl->end(); ++ir) + for(MusECore::ciRoute ir = mprl->begin(); ir != mprl->end(); ++ir) { - if(ir->type == Route::TRACK_ROUTE && ir->track == t && (ir->channel & chbits)) + if(ir->type == MusECore::Route::TRACK_ROUTE && ir->track == t && (ir->channel & chbits)) { act->setChecked(true); break; @@ -1061,7 +1061,7 @@ void RoutePopupMenu::prepare() int pi = 0; for( ; pi < MIDI_PORTS; ++pi) { - MidiDevice* md = midiPorts[pi].device(); + MusECore::MidiDevice* md = MusEGlobal::midiPorts[pi].device(); //if(md && !md->isSynti() && (md->rwFlags() & 2)) //if(md && (md->rwFlags() & 2)) // p4.0.27 if(md && (md->rwFlags() & 2 || md->isSynti()) ) // p4.0.27 @@ -1085,8 +1085,8 @@ void RoutePopupMenu::prepare() for(int i = 0; i < MIDI_PORTS; ++i) { // NOTE: Could possibly list all devices, bypassing ports, but no, let's stick with ports. - MidiPort* mp = &midiPorts[i]; - MidiDevice* md = mp->device(); + MusECore::MidiPort* mp = &MusEGlobal::midiPorts[i]; + MusECore::MidiDevice* md = mp->device(); //if(!md) // continue; @@ -1104,10 +1104,10 @@ void RoutePopupMenu::prepare() int chanmask = 0; // To reduce number of routes required, from one per channel to just one containing a channel mask. // Look for the first route to this midi port. There should always be only a single route for each midi port, now. - ciRoute ir = rl->begin(); + MusECore::ciRoute ir = rl->begin(); for( ; ir != rl->end(); ++ir) { - if(ir->type == Route::MIDI_PORT_ROUTE && ir->midiPort == i) + if(ir->type == MusECore::Route::MIDI_PORT_ROUTE && ir->midiPort == i) { // We have a route to the midi port. Grab the channel mask. chanmask = ir->channel; @@ -1126,7 +1126,7 @@ void RoutePopupMenu::prepare() act = subp->addAction(QString("Channel %1").arg(ch+1)); act->setCheckable(true); int chbit = 1 << ch; - Route srcRoute(i, chbit); // In accordance with channel mask, use the bit position. + MusECore::Route srcRoute(i, chbit); // In accordance with channel mask, use the bit position. act->setData(qVariantFromValue(srcRoute)); if(chanmask & chbit) // Is the channel already set? Show item check mark. act->setChecked(true); @@ -1135,7 +1135,7 @@ void RoutePopupMenu::prepare() //gid = MIDI_PORTS * MIDI_CHANNELS + i; // Make sure each 'toggle' item gets a unique id. act = subp->addAction(tr("Toggle all")); //act->setCheckable(true); - Route togRoute(i, (1 << MIDI_CHANNELS) - 1); // Set all channel bits. + MusECore::Route togRoute(i, (1 << MIDI_CHANNELS) - 1); // Set all channel bits. act->setData(qVariantFromValue(togRoute)); ++gid; _pup->addMenu(subp); @@ -1147,7 +1147,7 @@ void RoutePopupMenu::prepare() morep->setTitle(tr("More...")); for(int i = 0; i < MIDI_PORTS; ++i) { - MidiPort* mp = &midiPorts[i]; + MusECore::MidiPort* mp = &MusEGlobal::midiPorts[i]; if(mp->device()) continue; @@ -1161,7 +1161,7 @@ void RoutePopupMenu::prepare() iRoute ir = rl->begin(); for( ; ir != rl->end(); ++ir) { - if(ir->type == Route::MIDI_PORT_ROUTE && ir->midiPort == i) + if(ir->type == MusECore::Route::MIDI_PORT_ROUTE && ir->midiPort == i) break; } if(ir != rl->end()) @@ -1174,7 +1174,7 @@ void RoutePopupMenu::prepare() act->setData(gid); int chbit = 1 << ch; - Route srcRoute(i, chbit); // In accordance with new channel mask, use the bit position. + MusECore::Route srcRoute(i, chbit); // In accordance with new channel mask, use the bit position. gRoutingMenuMap.insert( pRouteMenuMap(gid, srcRoute) ); @@ -1187,7 +1187,7 @@ void RoutePopupMenu::prepare() act = subp->addAction(QString("Toggle all")); //act->setCheckable(true); act->setData(gid); - Route togRoute(i, (1 << MIDI_CHANNELS) - 1); // Set all channel bits. + MusECore::Route togRoute(i, (1 << MIDI_CHANNELS) - 1); // Set all channel bits. gRoutingMenuMap.insert( pRouteMenuMap(gid, togRoute) ); ++gid; morep->addMenu(subp); @@ -1200,11 +1200,11 @@ void RoutePopupMenu::prepare() } else { - AudioTrack* t = (AudioTrack*)_track; + MusECore::AudioTrack* t = (MusECore::AudioTrack*)_track; int channel = t->channels(); if(_isOutMenu) { - RouteList* orl = t->outRoutes(); + MusECore::RouteList* orl = t->outRoutes(); QAction* act = 0; int gid = 0; @@ -1212,7 +1212,7 @@ void RoutePopupMenu::prepare() switch(_track->type()) { - case Track::AUDIO_OUTPUT: + case MusECore::Track::AUDIO_OUTPUT: { for(int i = 0; i < channel; ++i) { @@ -1226,16 +1226,16 @@ void RoutePopupMenu::prepare() _pup->clear(); return; } - std::list<QString> ol = audioDevice->inputPorts(); + std::list<QString> ol = MusEGlobal::audioDevice->inputPorts(); for(std::list<QString>::iterator ip = ol.begin(); ip != ol.end(); ++ip) { act = _pup->addAction(*ip); act->setCheckable(true); - Route dst(*ip, true, i, Route::JACK_ROUTE); + MusECore::Route dst(*ip, true, i, MusECore::Route::JACK_ROUTE); act->setData(qVariantFromValue(dst)); ++gid; - for(ciRoute ir = orl->begin(); ir != orl->end(); ++ir) + for(MusECore::ciRoute ir = orl->begin(); ir != orl->end(); ++ir) { if(*ir == dst) { @@ -1266,14 +1266,14 @@ void RoutePopupMenu::prepare() //gid = addInPorts(t, _pup, gid, -1, -1, true); } break; - case Track::AUDIO_SOFTSYNTH: + case MusECore::Track::AUDIO_SOFTSYNTH: gid = addMultiChannelPorts(t, _pup, gid, true); break; - case Track::AUDIO_INPUT: - case Track::WAVE: - case Track::AUDIO_GROUP: - case Track::AUDIO_AUX: + case MusECore::Track::AUDIO_INPUT: + case MusECore::Track::WAVE: + case MusECore::Track::AUDIO_GROUP: + case MusECore::Track::AUDIO_AUX: gid = addWavePorts( t, _pup, gid, -1, -1, true); gid = addOutPorts( t, _pup, gid, -1, -1, true); gid = addGroupPorts( t, _pup, gid, -1, -1, true); @@ -1286,10 +1286,10 @@ void RoutePopupMenu::prepare() } else { - if(_track->type() == Track::AUDIO_AUX) + if(_track->type() == MusECore::Track::AUDIO_AUX) return; - RouteList* irl = t->inRoutes(); + MusECore::RouteList* irl = t->inRoutes(); QAction* act = 0; int gid = 0; @@ -1297,7 +1297,7 @@ void RoutePopupMenu::prepare() switch(_track->type()) { - case Track::AUDIO_INPUT: + case MusECore::Track::AUDIO_INPUT: { for(int i = 0; i < channel; ++i) { @@ -1311,16 +1311,16 @@ void RoutePopupMenu::prepare() _pup->clear(); return; } - std::list<QString> ol = audioDevice->outputPorts(); + std::list<QString> ol = MusEGlobal::audioDevice->outputPorts(); for(std::list<QString>::iterator ip = ol.begin(); ip != ol.end(); ++ip) { act = _pup->addAction(*ip); act->setCheckable(true); - Route dst(*ip, true, i, Route::JACK_ROUTE); + MusECore::Route dst(*ip, true, i, MusECore::Route::JACK_ROUTE); act->setData(qVariantFromValue(dst)); ++gid; - for(ciRoute ir = irl->begin(); ir != irl->end(); ++ir) + for(MusECore::ciRoute ir = irl->begin(); ir != irl->end(); ++ir) { if(*ir == dst) { @@ -1356,21 +1356,21 @@ void RoutePopupMenu::prepare() //addMidiPorts(t, _pup, gid, false); } break; - case Track::AUDIO_OUTPUT: + case MusECore::Track::AUDIO_OUTPUT: gid = addWavePorts( t, _pup, gid, -1, -1, false); gid = addInPorts( t, _pup, gid, -1, -1, false); gid = addGroupPorts(t, _pup, gid, -1, -1, false); gid = addAuxPorts( t, _pup, gid, -1, -1, false); gid = nonSyntiTrackAddSyntis(t, _pup, gid, false); break; - case Track::WAVE: + case MusECore::Track::WAVE: gid = addWavePorts( t, _pup, gid, -1, -1, false); gid = addInPorts( t, _pup, gid, -1, -1, false); gid = addGroupPorts(t, _pup, gid, -1, -1, false); gid = addAuxPorts( t, _pup, gid, -1, -1, false); gid = nonSyntiTrackAddSyntis(t, _pup, gid, false); break; - case Track::AUDIO_GROUP: + case MusECore::Track::AUDIO_GROUP: gid = addWavePorts( t, _pup, gid, -1, -1, false); gid = addInPorts( t, _pup, gid, -1, -1, false); gid = addGroupPorts(t, _pup, gid, -1, -1, false); @@ -1378,7 +1378,7 @@ void RoutePopupMenu::prepare() gid = nonSyntiTrackAddSyntis(t, _pup, gid, false); break; - case Track::AUDIO_SOFTSYNTH: + case MusECore::Track::AUDIO_SOFTSYNTH: gid = addMultiChannelPorts(t, _pup, gid, false); break; default: @@ -1389,7 +1389,7 @@ void RoutePopupMenu::prepare() } } -void RoutePopupMenu::exec(Track* track, bool isOutput) +void RoutePopupMenu::exec(MusECore::Track* track, bool isOutput) { if(track) { @@ -1400,7 +1400,7 @@ void RoutePopupMenu::exec(Track* track, bool isOutput) _pup->exec(); } -void RoutePopupMenu::exec(const QPoint& p, Track* track, bool isOutput) +void RoutePopupMenu::exec(const QPoint& p, MusECore::Track* track, bool isOutput) { if(track) { @@ -1411,7 +1411,7 @@ void RoutePopupMenu::exec(const QPoint& p, Track* track, bool isOutput) _pup->exec(p); } -void RoutePopupMenu::popup(const QPoint& p, Track* track, bool isOutput) +void RoutePopupMenu::popup(const QPoint& p, MusECore::Track* track, bool isOutput) { if(track) { @@ -1422,4 +1422,4 @@ void RoutePopupMenu::popup(const QPoint& p, Track* track, bool isOutput) _pup->popup(p); } -} // namespace MusEWidget +} // namespace MusEGui diff --git a/muse2/muse/widgets/routepopup.h b/muse2/muse/widgets/routepopup.h index 7f5a8820..842ba130 100644 --- a/muse2/muse/widgets/routepopup.h +++ b/muse2/muse/widgets/routepopup.h @@ -25,14 +25,17 @@ #include <QObject> -class Track; +namespace MusECore { class AudioTrack; +class Track; +} + class QWidget; class QString; class QAction; class QPoint; -namespace MusEWidget { +namespace MusEGui { class PopupMenu; @@ -41,38 +44,38 @@ class RoutePopupMenu : public QObject Q_OBJECT PopupMenu* _pup; - Track* _track; + MusECore::Track* _track; // Whether the route popup was shown by clicking the output routes button, or input routes button. bool _isOutMenu; void init(); void prepare(); - int addMenuItem(AudioTrack* track, Track* route_track, PopupMenu* lb, int id, int channel, + int addMenuItem(MusECore::AudioTrack* track, MusECore::Track* route_track, PopupMenu* lb, int id, int channel, int channels, bool isOutput); - int addAuxPorts(AudioTrack* t, PopupMenu* lb, int id, int channel, int channels, bool isOutput); - int addInPorts(AudioTrack* t, PopupMenu* lb, int id, int channel, int channels, bool isOutput); - int addOutPorts(AudioTrack* t, PopupMenu* lb, int id, int channel, int channels, bool isOutput); - int addGroupPorts(AudioTrack* t, PopupMenu* lb, int id, int channel, int channels, bool isOutput); - int addWavePorts(AudioTrack* t, PopupMenu* lb, int id, int channel, int channels, bool isOutput); - int addSyntiPorts(AudioTrack* t, PopupMenu* lb, int id, int channel, int channels, bool isOutput); - int addMultiChannelPorts(AudioTrack* t, PopupMenu* pup, int id, bool isOutput); - int nonSyntiTrackAddSyntis(AudioTrack* t, PopupMenu* lb, int id, bool isOutput); - int addMidiPorts(AudioTrack* t, PopupMenu* pup, int id, bool isOutput); + int addAuxPorts(MusECore::AudioTrack* t, PopupMenu* lb, int id, int channel, int channels, bool isOutput); + int addInPorts(MusECore::AudioTrack* t, PopupMenu* lb, int id, int channel, int channels, bool isOutput); + int addOutPorts(MusECore::AudioTrack* t, PopupMenu* lb, int id, int channel, int channels, bool isOutput); + int addGroupPorts(MusECore::AudioTrack* t, PopupMenu* lb, int id, int channel, int channels, bool isOutput); + int addWavePorts(MusECore::AudioTrack* t, PopupMenu* lb, int id, int channel, int channels, bool isOutput); + int addSyntiPorts(MusECore::AudioTrack* t, PopupMenu* lb, int id, int channel, int channels, bool isOutput); + int addMultiChannelPorts(MusECore::AudioTrack* t, PopupMenu* pup, int id, bool isOutput); + int nonSyntiTrackAddSyntis(MusECore::AudioTrack* t, PopupMenu* lb, int id, bool isOutput); + int addMidiPorts(MusECore::AudioTrack* t, PopupMenu* pup, int id, bool isOutput); private slots: void popupActivated(QAction*); void songChanged(int); public: - RoutePopupMenu(QWidget* parent = 0, Track* track = 0, bool isOutput = false); - RoutePopupMenu(const QString& title, QWidget* parent = 0, Track* track = 0, bool isOutput = false); + RoutePopupMenu(QWidget* parent = 0, MusECore::Track* track = 0, bool isOutput = false); + RoutePopupMenu(const QString& title, QWidget* parent = 0, MusECore::Track* track = 0, bool isOutput = false); ~RoutePopupMenu(); void updateRouteMenus(); - void exec(Track* track = 0, bool isOutput = false); - void exec(const QPoint& p, Track* track = 0, bool isOutput = false); - void popup(const QPoint& p, Track* track = 0, bool isOutput = false); + void exec(MusECore::Track* track = 0, bool isOutput = false); + void exec(const QPoint& p, MusECore::Track* track = 0, bool isOutput = false); + void popup(const QPoint& p, MusECore::Track* track = 0, bool isOutput = false); }; } diff --git a/muse2/muse/widgets/scldiv.cpp b/muse2/muse/widgets/scldiv.cpp index ba19f659..26fe9bce 100644 --- a/muse2/muse/widgets/scldiv.cpp +++ b/muse2/muse/widgets/scldiv.cpp @@ -26,7 +26,7 @@ #include "scldiv.h" #include "mmath.h" -namespace MusEWidget { +namespace MusEGui { // ScaleDiv - A class for building scale divisions // @@ -84,10 +84,10 @@ static bool limRange(double &val, double v1, double v2, double eps_rel = 0.0, { bool rv = TRUE; - double vmin = MusEUtil::qwtMin(v1, v2); - double vmax = MusEUtil::qwtMax(v1, v2); - double delta_min = MusEUtil::qwtMax(MusEUtil::qwtAbs(eps_rel * vmin), MusEUtil::qwtAbs(eps_abs)); - double delta_max = MusEUtil::qwtMax(MusEUtil::qwtAbs(eps_rel * vmax), MusEUtil::qwtAbs(eps_abs)); + double vmin = MusECore::qwtMin(v1, v2); + double vmax = MusECore::qwtMax(v1, v2); + double delta_min = MusECore::qwtMax(MusECore::qwtAbs(eps_rel * vmin), MusECore::qwtAbs(eps_abs)); + double delta_max = MusECore::qwtMax(MusECore::qwtAbs(eps_rel * vmax), MusECore::qwtAbs(eps_abs)); if (val < vmin) { @@ -233,8 +233,8 @@ bool ScaleDiv::rebuild(double x1, double x2, int maxMajSteps, int maxMinSteps, int rv; - d_lBound = MusEUtil::qwtMin(x1, x2); - d_hBound = MusEUtil::qwtMax(x1, x2); + d_lBound = MusECore::qwtMin(x1, x2); + d_hBound = MusECore::qwtMax(x1, x2); d_log = log; if (d_log) @@ -246,8 +246,8 @@ bool ScaleDiv::rebuild(double x1, double x2, int maxMajSteps, int maxMinSteps, { d_lBound = x1; d_hBound = x2; - MusEUtil::qwtTwistArray(d_majMarks.data(), d_majMarks.size()); - MusEUtil::qwtTwistArray(d_minMarks.data(), d_minMarks.size()); + MusECore::qwtTwistArray(d_majMarks.data(), d_majMarks.size()); + MusECore::qwtTwistArray(d_minMarks.data(), d_minMarks.size()); } return rv; @@ -293,9 +293,9 @@ bool ScaleDiv::buildLinDiv(int maxMajSteps, int maxMinSteps, double step) bool rv = TRUE; // parameter range check - maxMajSteps = MusEUtil::qwtMax(1, maxMajSteps); - maxMinSteps = MusEUtil::qwtMax(0, maxMinSteps); - step = MusEUtil::qwtAbs(step); + maxMajSteps = MusECore::qwtMax(1, maxMajSteps); + maxMinSteps = MusECore::qwtMax(0, maxMinSteps); + step = MusECore::qwtAbs(step); // reset vectors d_minMarks.resize(0); @@ -307,7 +307,7 @@ bool ScaleDiv::buildLinDiv(int maxMajSteps, int maxMinSteps, double step) // Set up major divisions // if (step == 0.0) - d_majStep = MusEUtil::qwtCeil125(MusEUtil::qwtAbs(d_hBound - d_lBound) * 0.999999 + d_majStep = MusECore::qwtCeil125(MusECore::qwtAbs(d_hBound - d_lBound) * 0.999999 / double(maxMajSteps)); else d_majStep = step; @@ -317,10 +317,10 @@ bool ScaleDiv::buildLinDiv(int maxMajSteps, int maxMinSteps, double step) firstTick = ceil( (d_lBound - step_eps * d_majStep) / d_majStep) * d_majStep; lastTick = floor( (d_hBound + step_eps * d_majStep) / d_majStep) * d_majStep; - nMaj = MusEUtil::qwtMin(10000, int(rint((lastTick - firstTick) / d_majStep)) + 1); + nMaj = MusECore::qwtMin(10000, int(rint((lastTick - firstTick) / d_majStep)) + 1); d_majMarks.resize(nMaj); - MusEUtil::qwtLinSpace(d_majMarks.data(), d_majMarks.size(), firstTick, lastTick); + MusECore::qwtLinSpace(d_majMarks.data(), d_majMarks.size(), firstTick, lastTick); // // Set up minor divisions @@ -328,14 +328,14 @@ bool ScaleDiv::buildLinDiv(int maxMajSteps, int maxMinSteps, double step) if (maxMinSteps < 1) // no minor divs return TRUE; - minStep = MusEUtil::qwtCeil125( d_majStep / double(maxMinSteps) ); + minStep = MusECore::qwtCeil125( d_majStep / double(maxMinSteps) ); if (minStep == 0.0) return TRUE; - nMin = MusEUtil::qwtAbs(int(rint(d_majStep / minStep))) - 1; // # minor steps per interval + nMin = MusECore::qwtAbs(int(rint(d_majStep / minStep))) - 1; // # minor steps per interval // Do the minor steps fit into the interval? - if ( MusEUtil::qwtAbs(double(nMin + 1) * minStep - d_majStep) > step_eps * d_majStep) + if ( MusECore::qwtAbs(double(nMin + 1) * minStep - d_majStep) > step_eps * d_majStep) { nMin = 1; minStep = d_majStep * 0.5; @@ -410,9 +410,9 @@ bool ScaleDiv::buildLogDiv(int maxMajSteps, int maxMinSteps, double majStep) // Parameter range check - maxMajSteps = MusEUtil::qwtMax(1, MusEUtil::qwtAbs(maxMajSteps)); - maxMinSteps = MusEUtil::qwtMax(0, MusEUtil::qwtAbs(maxMinSteps)); - majStep = MusEUtil::qwtAbs(majStep); + maxMajSteps = MusECore::qwtMax(1, MusECore::qwtAbs(maxMajSteps)); + maxMinSteps = MusECore::qwtMax(0, MusECore::qwtAbs(maxMinSteps)); + majStep = MusECore::qwtAbs(majStep); // boundary check limRange(d_hBound, LOG_MIN, LOG_MAX); @@ -442,12 +442,12 @@ bool ScaleDiv::buildLogDiv(int maxMajSteps, int maxMinSteps, double majStep) // Set up major scale divisions // if (majStep == 0.0) - d_majStep = MusEUtil::qwtCeil125( width * 0.999999 / double(maxMajSteps)); + d_majStep = MusECore::qwtCeil125( width * 0.999999 / double(maxMajSteps)); else d_majStep = majStep; // major step must be >= 1 decade - d_majStep = MusEUtil::qwtMax(d_majStep, 1.0); + d_majStep = MusECore::qwtMax(d_majStep, 1.0); lFirst = ceil((log10(d_lBound) - step_eps * d_majStep) / d_majStep) * d_majStep; @@ -456,10 +456,10 @@ bool ScaleDiv::buildLogDiv(int maxMajSteps, int maxMinSteps, double majStep) firstTick = pow(10.0, lFirst); lastTick = pow(10.0, lLast); - nMaj = MusEUtil::qwtMin(10000, int(rint(MusEUtil::qwtAbs(lLast - lFirst) / d_majStep)) + 1); + nMaj = MusECore::qwtMin(10000, int(rint(MusECore::qwtAbs(lLast - lFirst) / d_majStep)) + 1); d_majMarks.resize(nMaj); - MusEUtil::qwtLogSpace(d_majMarks.data(), d_majMarks.size(), firstTick, lastTick); + MusECore::qwtLogSpace(d_majMarks.data(), d_majMarks.size(), firstTick, lastTick); // @@ -538,15 +538,15 @@ bool ScaleDiv::buildLogDiv(int maxMajSteps, int maxMinSteps, double majStep) { // substep width in decades, at least one decade - minStep = MusEUtil::qwtCeil125( (d_majStep - step_eps * (d_majStep / double(maxMinSteps))) + minStep = MusECore::qwtCeil125( (d_majStep - step_eps * (d_majStep / double(maxMinSteps))) / double(maxMinSteps) ); - minStep = MusEUtil::qwtMax(1.0, minStep); + minStep = MusECore::qwtMax(1.0, minStep); // # subticks per interval nMin = int(rint(d_majStep / minStep)) - 1; // Do the minor steps fit into the interval? - if ( MusEUtil::qwtAbs( double(nMin + 1) * minStep - d_majStep) > step_eps * d_majStep) + if ( MusECore::qwtAbs( double(nMin + 1) * minStep - d_majStep) > step_eps * d_majStep) nMin = 0; if (nMin < 1) return TRUE; // no subticks @@ -555,7 +555,7 @@ bool ScaleDiv::buildLogDiv(int maxMajSteps, int maxMinSteps, double majStep) buffer.resize((d_majMarks.size() + 1) * nMin ); // substep factor = 10^substeps - minFactor = MusEUtil::qwtMax(pow(10,minStep), 10.0); + minFactor = MusECore::qwtMax(pow(10,minStep), 10.0); // Are there minor ticks below the first major tick? if ( d_lBound < firstTick ) @@ -659,7 +659,7 @@ void ScaleDiv::reset() d_log = FALSE; } -} // namespace MusEWidget +} // namespace MusEGui diff --git a/muse2/muse/widgets/scldiv.h b/muse2/muse/widgets/scldiv.h index 1f91c2db..e799f10a 100644 --- a/muse2/muse/widgets/scldiv.h +++ b/muse2/muse/widgets/scldiv.h @@ -27,7 +27,7 @@ #include <QVector> -namespace MusEWidget { +namespace MusEGui { class ScaleDiv { @@ -66,6 +66,6 @@ class ScaleDiv bool log, double step = 0.0, bool ascend = TRUE); }; -} // namespace MusEWidget +} // namespace MusEGui #endif diff --git a/muse2/muse/widgets/scldraw.cpp b/muse2/muse/widgets/scldraw.cpp index c35d04e0..38adff25 100644 --- a/muse2/muse/widgets/scldraw.cpp +++ b/muse2/muse/widgets/scldraw.cpp @@ -30,7 +30,7 @@ #include "scldraw.h" -namespace MusEWidget { +namespace MusEGui { int const ScaleDraw::minLen = 10; @@ -224,7 +224,7 @@ void ScaleDraw::draw(QPainter *p) const hval = majTick - 0.5 * d_scldiv.majStep(); } - if (MusEUtil::qwtAbs(val-hval) < step_eps * d_scldiv.majStep()) + if (MusECore::qwtAbs(val-hval) < step_eps * d_scldiv.majStep()) drawTick(p, val, d_medLen); else drawTick(p, val, d_minLen); @@ -277,10 +277,10 @@ void ScaleDraw::drawTick(QPainter *p, double val, int len) const if ((tval <= d_minAngle + 359 * 16) || (tval >= d_minAngle - 359 * 16)) { arc = double(tval) / 16.0 * M_PI / 180.0; - x1 = MusEUtil::qwtInt(d_xCenter + sin(arc) * d_radius); - x2 = MusEUtil::qwtInt(d_xCenter + sin(arc) * (d_radius + double(len))); - y1 = MusEUtil::qwtInt(d_yCenter - cos(arc) * d_radius); - y2 = MusEUtil::qwtInt(d_yCenter - cos(arc) * (d_radius + double(len))); + x1 = MusECore::qwtInt(d_xCenter + sin(arc) * d_radius); + x2 = MusECore::qwtInt(d_xCenter + sin(arc) * (d_radius + double(len))); + y1 = MusECore::qwtInt(d_yCenter - cos(arc) * d_radius); + y2 = MusECore::qwtInt(d_yCenter - cos(arc) * (d_radius + double(len))); p->drawLine(x1, y1, x2, y2); } break; @@ -324,7 +324,7 @@ void ScaleDraw::drawLabel(QPainter *p, double val) const tval = transform(val); // correct rounding errors if val = 0 - if ((!d_scldiv.logScale()) && (MusEUtil::qwtAbs(val) < MusEUtil::qwtAbs(step_eps * d_scldiv.majStep()))) + if ((!d_scldiv.logScale()) && (MusECore::qwtAbs(val) < MusECore::qwtAbs(step_eps * d_scldiv.majStep()))) val = 0.0; label.setNum(val, d_fmt, d_prec); @@ -355,12 +355,12 @@ void ScaleDraw::drawLabel(QPainter *p, double val) const if ((arc < -M_PI) || (arc > M_PI)) arc -= floor((arc + M_PI) / M_PI * 0.5) * 2.0 * M_PI; - xpos = 1 + MusEUtil::qwtInt(d_xCenter + (d_radius + double(d_majLen + d_vpad)) * sin(arc)); - ypos = MusEUtil::qwtInt(d_yCenter - (d_radius + double(d_majLen + d_vpad)) * cos(arc)); + xpos = 1 + MusECore::qwtInt(d_xCenter + (d_radius + double(d_majLen + d_vpad)) * sin(arc)); + ypos = MusECore::qwtInt(d_yCenter - (d_radius + double(d_majLen + d_vpad)) * cos(arc)); if (arc < -pi_75) { - p->drawText(xpos - MusEUtil::qwtInt(double(fm.width(label)) + p->drawText(xpos - MusECore::qwtInt(double(fm.width(label)) * (1.0 + (arc + pi_75) * M_2_PI) ), ypos + fm.ascent() - 1, label); @@ -370,13 +370,13 @@ void ScaleDraw::drawLabel(QPainter *p, double val) const p->drawText(xpos - fm.width(label), - ypos - MusEUtil::qwtInt(double(fm.ascent() - 1) + ypos - MusECore::qwtInt(double(fm.ascent() - 1) * (arc + M_PI_4) * M_2_PI), label); } else if (arc < pi_4) { - p->drawText(xpos + MusEUtil::qwtInt(double(fm.width(label)) + p->drawText(xpos + MusECore::qwtInt(double(fm.width(label)) * ( arc - M_PI_4 ) * M_2_PI ), ypos, label); @@ -384,13 +384,13 @@ void ScaleDraw::drawLabel(QPainter *p, double val) const else if (arc < pi_75) { p->drawText(xpos, - ypos + MusEUtil::qwtInt(double(fm.ascent() - 1) + ypos + MusECore::qwtInt(double(fm.ascent() - 1) * (arc - M_PI_4) * M_2_PI), label); } else { - p->drawText(xpos - MusEUtil::qwtInt(double(fm.width(label)) + p->drawText(xpos - MusECore::qwtInt(double(fm.width(label)) * ( arc - pi_75) * M_2_PI ), ypos + fm.ascent() - 1, label); @@ -433,8 +433,8 @@ void ScaleDraw::drawBackbone(QPainter *p) const break; case Round: - a1 = MusEUtil::qwtMin(i1(), i2()) - 90 * 16; - a2 = MusEUtil::qwtMax(i1(), i2()) - 90 * 16; + a1 = MusECore::qwtMin(i1(), i2()) - 90 * 16; + a2 = MusECore::qwtMax(i1(), i2()) - 90 * 16; p->drawArc(d_xorg, d_yorg, d_len, d_len, @@ -694,7 +694,7 @@ QRect ScaleDraw::maxBoundingRect(QPainter *p) const while (a > 2880) a -= 5760; while (a < - 2880) a += 5760; - ar = MusEUtil::qwtAbs(a); + ar = MusECore::qwtAbs(a); if (ar < amin) amin = ar; if (ar > amax) amax = ar; @@ -708,18 +708,18 @@ QRect ScaleDraw::maxBoundingRect(QPainter *p) const while (a > 2880) a -= 5760; while (a < - 2880) a += 5760; - ar = MusEUtil::qwtAbs(a); + ar = MusECore::qwtAbs(a); if (ar < amin) amin = ar; if (ar > amax) amax = ar; } arc = double(amin) / 16.0 * M_PI / 180.0; - r.setTop(MusEUtil::qwtInt(d_yCenter - (d_radius + double(d_majLen + d_vpad)) * cos(arc)) + r.setTop(MusECore::qwtInt(d_yCenter - (d_radius + double(d_majLen + d_vpad)) * cos(arc)) + fm.ascent() ); arc = double(amax) / 16.0 * M_PI / 180.0; - r.setBottom(MusEUtil::qwtInt(d_yCenter - (d_radius + double(d_majLen + d_vpad)) * cos(arc)) + r.setBottom(MusECore::qwtInt(d_yCenter - (d_radius + double(d_majLen + d_vpad)) * cos(arc)) + fm.height() ); wmax = d_len + d_majLen + d_hpad + wl; @@ -765,10 +765,10 @@ void ScaleDraw::setAngleRange(double angle1, double angle2) { int amin, amax; - angle1 = MusEUtil::qwtLim(angle1, -360.0, 360.0); - angle2 = MusEUtil::qwtLim(angle2, -360.0, 360.0); - amin = int(rint(MusEUtil::qwtMin(angle1, angle2) * 16.0)); - amax = int(rint(MusEUtil::qwtMax(angle1, angle2) * 16.0)); + angle1 = MusECore::qwtLim(angle1, -360.0, 360.0); + angle2 = MusECore::qwtLim(angle2, -360.0, 360.0); + amin = int(rint(MusECore::qwtMin(angle1, angle2) * 16.0)); + amax = int(rint(MusECore::qwtMax(angle1, angle2) * 16.0)); if (amin == amax) { @@ -844,10 +844,10 @@ int ScaleDraw::maxLabelWidth(QPainter *p, int worst) const { val = d_scldiv.majMark(i); // correct rounding errors if val = 0 - if ((!d_scldiv.logScale()) && (MusEUtil::qwtAbs(val) < step_eps * MusEUtil::qwtAbs(d_scldiv.majStep()))) + if ((!d_scldiv.logScale()) && (MusECore::qwtAbs(val) < step_eps * MusECore::qwtAbs(d_scldiv.majStep()))) val = 0.0; s.setNum(val, d_fmt, d_prec); - rv = MusEUtil::qwtMax(rv,fm.width(s)); + rv = MusECore::qwtMax(rv,fm.width(s)); } } @@ -882,7 +882,7 @@ int ScaleDraw::maxLabelWidth(QPainter *p, int worst) const // //------------------------------------------------------------ -} // namespace MusEWidget +} // namespace MusEGui diff --git a/muse2/muse/widgets/scldraw.h b/muse2/muse/widgets/scldraw.h index 2c1543cd..be8cab1c 100644 --- a/muse2/muse/widgets/scldraw.h +++ b/muse2/muse/widgets/scldraw.h @@ -31,7 +31,7 @@ class QPainter; class QRect; -namespace MusEWidget { +namespace MusEGui { class ScaleDraw : public DiMap { public: @@ -87,7 +87,7 @@ class ScaleDraw : public DiMap { void draw(QPainter *p) const; }; -} // namespace MusEWidget +} // namespace MusEGui #endif diff --git a/muse2/muse/widgets/sclif.cpp b/muse2/muse/widgets/sclif.cpp index 93987999..d4e86774 100644 --- a/muse2/muse/widgets/sclif.cpp +++ b/muse2/muse/widgets/sclif.cpp @@ -24,7 +24,7 @@ #include "sclif.h" -namespace MusEWidget { +namespace MusEGui { // ScaleIf - An interface class for widgets containing a scale // @@ -216,4 +216,4 @@ void ScaleIf::setScaleMaxMinor(int ticks) } } -} // namespace MusEWidget +} // namespace MusEGui diff --git a/muse2/muse/widgets/sclif.h b/muse2/muse/widgets/sclif.h index e168dfc3..a7cde746 100644 --- a/muse2/muse/widgets/sclif.h +++ b/muse2/muse/widgets/sclif.h @@ -27,7 +27,7 @@ #include "scldraw.h" -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // ScaleIf @@ -59,7 +59,7 @@ class ScaleIf int scaleMaxMajor() const {return d_maxMinor;} }; -} // namespace MusEWidget +} // namespace MusEGui #endif diff --git a/muse2/muse/widgets/scrollscale.cpp b/muse2/muse/widgets/scrollscale.cpp index 572a1d86..4f3f4771 100644 --- a/muse2/muse/widgets/scrollscale.cpp +++ b/muse2/muse/widgets/scrollscale.cpp @@ -35,7 +35,7 @@ #include "scrollscale.h" #include "icons.h" -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // setScale @@ -528,4 +528,4 @@ int ScrollScale::convertQuickZoomLevelToMag(int zoomlevel) return vals[zoomlevel]; } -} // namespace MusEWidget +} // namespace MusEGui diff --git a/muse2/muse/widgets/scrollscale.h b/muse2/muse/widgets/scrollscale.h index 0fce5b56..2c7ea0ef 100644 --- a/muse2/muse/widgets/scrollscale.h +++ b/muse2/muse/widgets/scrollscale.h @@ -31,7 +31,7 @@ class QResizeEvent; class QScrollBar; class QToolButton; -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // ScrollScale @@ -99,7 +99,7 @@ class ScrollScale : public QWidget { static int convertQuickZoomLevelToMag(int zoomlvl); }; -} // namespace MusEWidget +} // namespace MusEGui #endif diff --git a/muse2/muse/widgets/section.h b/muse2/muse/widgets/section.h index 02b84355..afa5e510 100644 --- a/muse2/muse/widgets/section.h +++ b/muse2/muse/widgets/section.h @@ -23,7 +23,7 @@ #ifndef __SECTION_H__ #define __SECTION_H__ -namespace MusEWidget { +namespace MusEGui { struct Section { int offset; @@ -32,7 +32,7 @@ struct Section { int val; }; -} // namespace MusEWidget +} // namespace MusEGui #endif diff --git a/muse2/muse/widgets/shortcutcapturedialog.cpp b/muse2/muse/widgets/shortcutcapturedialog.cpp index 26526f1e..46a3e75d 100644 --- a/muse2/muse/widgets/shortcutcapturedialog.cpp +++ b/muse2/muse/widgets/shortcutcapturedialog.cpp @@ -40,7 +40,7 @@ #include <QInputEvent> #include <QChar> -namespace MusEWidget { +namespace MusEGui { ShortcutCaptureDialog::ShortcutCaptureDialog(QWidget* parent, int index) : QDialog(parent) @@ -125,4 +125,4 @@ void ShortcutCaptureDialog::apply() done(key); } -} // namespace MusEWidget +} // namespace MusEGui diff --git a/muse2/muse/widgets/shortcutcapturedialog.h b/muse2/muse/widgets/shortcutcapturedialog.h index 9af3f7c2..f0387768 100644 --- a/muse2/muse/widgets/shortcutcapturedialog.h +++ b/muse2/muse/widgets/shortcutcapturedialog.h @@ -38,7 +38,7 @@ class QKeyEvent; -namespace MusEWidget { +namespace MusEGui { class ShortcutCaptureDialog : public QDialog, public Ui::ShortcutCaptureDialogBase { @@ -57,4 +57,4 @@ class ShortcutCaptureDialog : public QDialog, public Ui::ShortcutCaptureDialogBa ~ShortcutCaptureDialog(); }; -} // namespace MusEWidget +} // namespace MusEGui diff --git a/muse2/muse/widgets/shortcutconfig.cpp b/muse2/muse/widgets/shortcutconfig.cpp index 8e4d7b1a..fc08e7ce 100644 --- a/muse2/muse/widgets/shortcutconfig.cpp +++ b/muse2/muse/widgets/shortcutconfig.cpp @@ -41,7 +41,7 @@ #include "shortcutcapturedialog.h" #include "shortcuts.h" -namespace MusEWidget { +namespace MusEGui { ShortcutConfig::ShortcutConfig(QWidget* parent) : QDialog(parent) @@ -158,4 +158,4 @@ void ShortcutConfig::assignAll() done(_config_changed); } -} // namespace MusEWidget +} // namespace MusEGui diff --git a/muse2/muse/widgets/shortcutconfig.h b/muse2/muse/widgets/shortcutconfig.h index fe417c05..3faf2b5e 100644 --- a/muse2/muse/widgets/shortcutconfig.h +++ b/muse2/muse/widgets/shortcutconfig.h @@ -41,7 +41,7 @@ class QCloseEvent; #define SHRT_CATEGORY_COL 0 -namespace MusEWidget { +namespace MusEGui { enum { @@ -83,6 +83,6 @@ class ShortcutConfig : public QDialog, public Ui::ShortcutConfigBase { }; -} // namespace MusEWidget +} // namespace MusEGui #endif diff --git a/muse2/muse/widgets/sigedit.cpp b/muse2/muse/widgets/sigedit.cpp index a952cfef..2157b54a 100644 --- a/muse2/muse/widgets/sigedit.cpp +++ b/muse2/muse/widgets/sigedit.cpp @@ -40,9 +40,9 @@ #include "sigedit.h" #include "spinbox.h" -extern int mtcType; +extern int MusEGlobal::mtcType; -namespace MusEWidget { +namespace MusEGui { bool Sig::isValid() const { @@ -756,4 +756,4 @@ void SigEdit::enterPressed() emit returnPressed(); } -} // namespace MusEWidget +} // namespace MusEGui diff --git a/muse2/muse/widgets/sigedit.h b/muse2/muse/widgets/sigedit.h index 05684db1..51b4b13e 100644 --- a/muse2/muse/widgets/sigedit.h +++ b/muse2/muse/widgets/sigedit.h @@ -30,7 +30,7 @@ class QResizeEvent; class QTimerEvent; -namespace MusEWidget { +namespace MusEGui { class SigEditor; class SpinBox; @@ -102,6 +102,6 @@ class SigEdit : public QWidget void enterPressed(); }; -} // namespace MusEWidget +} // namespace MusEGui #endif diff --git a/muse2/muse/widgets/siglabel.cpp b/muse2/muse/widgets/siglabel.cpp index f571c2f1..2a21efe3 100644 --- a/muse2/muse/widgets/siglabel.cpp +++ b/muse2/muse/widgets/siglabel.cpp @@ -36,7 +36,7 @@ #include <QWheelEvent> #include <QLabel> -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // SigLabel @@ -71,7 +71,7 @@ void SigLabel::mousePressEvent(QMouseEvent* event) int zz = z, nn = n; switch (button) { case Qt::LeftButton: - if (!MusEConfig::config.leftMouseButtonCanDecrease) + if (!MusEGlobal::config.leftMouseButtonCanDecrease) return; // else fall through case Qt::MidButton: @@ -183,4 +183,4 @@ void SigLabel::setFrame(bool flag) setLineWidth(2); } -} // namespace MusEWidget +} // namespace MusEGui diff --git a/muse2/muse/widgets/siglabel.h b/muse2/muse/widgets/siglabel.h index 33248e53..f5afb41e 100644 --- a/muse2/muse/widgets/siglabel.h +++ b/muse2/muse/widgets/siglabel.h @@ -30,7 +30,7 @@ class QWheelEvent; class QMouseEvent; -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // SigLabel @@ -61,7 +61,7 @@ class SigLabel : public QLabel { void setFrame(bool); }; -} // namespace MusEWidget +} // namespace MusEGui #endif diff --git a/muse2/muse/widgets/sigscale.cpp b/muse2/muse/widgets/sigscale.cpp index 2a4350b3..e1fdf345 100644 --- a/muse2/muse/widgets/sigscale.cpp +++ b/muse2/muse/widgets/sigscale.cpp @@ -32,7 +32,7 @@ #include "song.h" #include "gconfig.h" -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // SigScale @@ -43,12 +43,12 @@ SigScale::SigScale(int* r, QWidget* parent, int xs) { setToolTip(tr("signature scale")); raster = r; - pos[0] = song->cpos(); - pos[1] = song->lpos(); - pos[2] = song->rpos(); + pos[0] = MusEGlobal::song->cpos(); + pos[1] = MusEGlobal::song->lpos(); + pos[2] = MusEGlobal::song->rpos(); button = Qt::NoButton; setMouseTracking(true); - connect(song, SIGNAL(posChanged(int, unsigned, bool)), this, SLOT(setPos(int, unsigned, bool))); + connect(MusEGlobal::song, SIGNAL(posChanged(int, unsigned, bool)), this, SLOT(setPos(int, unsigned, bool))); setFixedHeight(18); } @@ -102,7 +102,7 @@ void SigScale::viewMouseMoveEvent(QMouseEvent* event) i = 1; break; case Qt::RightButton: - if ((MusEConfig::config.rangeMarkerWithoutMMB) && (event->modifiers() & Qt::ControlModifier)) + if ((MusEGlobal::config.rangeMarkerWithoutMMB) && (event->modifiers() & Qt::ControlModifier)) i = 1; else i = 2; @@ -110,8 +110,8 @@ void SigScale::viewMouseMoveEvent(QMouseEvent* event) default: return; } - Pos p(x, true); - song->setPos(i, p); + MusECore::Pos p(x, true); + MusEGlobal::song->setPos(i, p); } //--------------------------------------------------------- @@ -135,7 +135,7 @@ void SigScale::pdraw(QPainter& p, const QRect& r) if (x < 0) x = 0; - p.setFont(MusEConfig::config.fonts[3]); + p.setFont(MusEGlobal::config.fonts[3]); ///for (ciSigEvent si = sigmap.begin(); si != sigmap.end(); ++si) { for (AL::ciSigEvent si = AL::sigmap.begin(); si != AL::sigmap.end(); ++si) { ///SigEvent* e = si->second; @@ -169,4 +169,4 @@ void SigScale::pdraw(QPainter& p, const QRect& r) p.drawLine(xp, 0, xp, h); } -} // namespace MusEWidget +} // namespace MusEGui diff --git a/muse2/muse/widgets/sigscale.h b/muse2/muse/widgets/sigscale.h index 9ecacfb1..7073f4e7 100644 --- a/muse2/muse/widgets/sigscale.h +++ b/muse2/muse/widgets/sigscale.h @@ -27,7 +27,7 @@ class MidiEditor; -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // SigScale @@ -60,7 +60,7 @@ class SigScale : public View { SigScale(int* raster, QWidget* parent, int xscale); }; -} // namespace MusEWidget +} // namespace MusEGui #endif diff --git a/muse2/muse/widgets/slider.cpp b/muse2/muse/widgets/slider.cpp index 863933d2..874566d4 100644 --- a/muse2/muse/widgets/slider.cpp +++ b/muse2/muse/widgets/slider.cpp @@ -30,7 +30,7 @@ #include "utils.h" #include "slider.h" -namespace MusEWidget { +namespace MusEGui { //------------------------------------------------------------- // Slider - The Slider Widget @@ -120,7 +120,7 @@ Slider::~Slider() //----------------------------------------------------- void Slider::setThumbLength(int l) { - d_thumbLength = MusEUtil::qwtMax(l,8); + d_thumbLength = MusECore::qwtMax(l,8); d_thumbHalf = d_thumbLength / 2; resize(size()); } @@ -139,7 +139,7 @@ void Slider::setThumbLength(int l) //------------------------------------------------------------ void Slider::setThumbWidth(int w) { - d_thumbWidth = MusEUtil::qwtMax(w,4); + d_thumbWidth = MusECore::qwtMax(w,4); resize(size()); } @@ -259,9 +259,9 @@ void Slider::drawSlider(QPainter *p, const QRect &r) // // Draw background // - QPainterPath bg_rect = MusEUtil::roundedPath(cr, + QPainterPath bg_rect = MusECore::roundedPath(cr, xrad, yrad, - (MusEUtil::Corner) (MusEUtil::UpperLeft | MusEUtil::UpperRight | MusEUtil::LowerLeft | MusEUtil::LowerRight) ); + (MusECore::Corner) (MusECore::UpperLeft | MusECore::UpperRight | MusECore::LowerLeft | MusECore::LowerRight) ); p->fillPath(bg_rect, d_fillColor); @@ -277,9 +277,9 @@ void Slider::drawSlider(QPainter *p, const QRect &r) e_mask.setStart(QPointF(0, cr.y())); e_mask.setFinalStop(QPointF(0, cr.y() + cr.height())); - QPainterPath e_rect = MusEUtil::roundedPath(ipos + d_thumbLength, cr.y(), + QPainterPath e_rect = MusECore::roundedPath(ipos + d_thumbLength, cr.y(), cr.width() - d_thumbLength - dist1, cr.height(), - xrad, yrad, (MusEUtil::Corner) (MusEUtil::UpperRight | MusEUtil::LowerRight) ); + xrad, yrad, (MusECore::Corner) (MusECore::UpperRight | MusECore::LowerRight) ); p->fillPath(e_rect, QBrush(e_mask)); @@ -291,10 +291,10 @@ void Slider::drawSlider(QPainter *p, const QRect &r) f_mask.setStart(QPointF(0, cr.y())); f_mask.setFinalStop(QPointF(0, cr.y() + cr.height())); - QPainterPath f_rect = MusEUtil::roundedPath(cr.x(), cr.y(), + QPainterPath f_rect = MusECore::roundedPath(cr.x(), cr.y(), ipos + 1, cr.height(), xrad, yrad, - (MusEUtil::Corner) (MusEUtil::LowerLeft | MusEUtil::UpperLeft) ); + (MusECore::Corner) (MusECore::LowerLeft | MusECore::UpperLeft) ); p->fillPath(f_rect, QBrush(f_mask)); @@ -303,10 +303,10 @@ void Slider::drawSlider(QPainter *p, const QRect &r) // Draw thumb // - QPainterPath thumb_rect = MusEUtil::roundedPath(ipos, r.y(), + QPainterPath thumb_rect = MusECore::roundedPath(ipos, r.y(), d_thumbLength, r.height(), 2, 2, - (MusEUtil::Corner) (MusEUtil::UpperLeft | MusEUtil::UpperRight | MusEUtil::LowerLeft | MusEUtil::LowerRight) ); + (MusECore::Corner) (MusECore::UpperLeft | MusECore::UpperRight | MusECore::LowerLeft | MusECore::LowerRight) ); thumbGrad.setStart(QPointF(0, cr.y())); thumbGrad.setFinalStop(QPointF(0, cr.y() + cr.height())); @@ -331,9 +331,9 @@ void Slider::drawSlider(QPainter *p, const QRect &r) // // Draw background // - QPainterPath bg_rect = MusEUtil::roundedPath(cr, + QPainterPath bg_rect = MusECore::roundedPath(cr, xrad, yrad, - (MusEUtil::Corner) (MusEUtil::UpperLeft | MusEUtil::UpperRight | MusEUtil::LowerLeft | MusEUtil::LowerRight) ); + (MusECore::Corner) (MusECore::UpperLeft | MusECore::UpperRight | MusECore::LowerLeft | MusECore::LowerRight) ); p->fillPath(bg_rect, d_fillColor); @@ -349,10 +349,10 @@ void Slider::drawSlider(QPainter *p, const QRect &r) e_mask.setStart(QPointF(cr.x(), 0)); e_mask.setFinalStop(QPointF(cr.x() + cr.width(), 0)); - QPainterPath e_rect = MusEUtil::roundedPath(cr.x(), cr.y(), + QPainterPath e_rect = MusECore::roundedPath(cr.x(), cr.y(), cr.width(), ipos + 1, xrad, yrad, - (MusEUtil::Corner) (MusEUtil::UpperLeft | MusEUtil::UpperRight) ); + (MusECore::Corner) (MusECore::UpperLeft | MusECore::UpperRight) ); p->fillPath(e_rect, QBrush(e_mask)); @@ -364,9 +364,9 @@ void Slider::drawSlider(QPainter *p, const QRect &r) f_mask.setStart(QPointF(cr.x(), 0)); f_mask.setFinalStop(QPointF(cr.x() + cr.width(), 0)); - QPainterPath f_rect = MusEUtil::roundedPath(cr.x(), ipos + d_thumbLength, + QPainterPath f_rect = MusECore::roundedPath(cr.x(), ipos + d_thumbLength, cr.width(), cr.height() - d_thumbLength - dist1, - xrad, yrad, (MusEUtil::Corner) (MusEUtil::LowerLeft | MusEUtil::LowerRight) ); + xrad, yrad, (MusECore::Corner) (MusECore::LowerLeft | MusECore::LowerRight) ); p->fillPath(f_rect, QBrush(f_mask)); @@ -375,10 +375,10 @@ void Slider::drawSlider(QPainter *p, const QRect &r) // Draw thumb // - QPainterPath thumb_rect = MusEUtil::roundedPath(r.x(), ipos, + QPainterPath thumb_rect = MusECore::roundedPath(r.x(), ipos, r.width(), d_thumbLength, 2, 2, - (MusEUtil::Corner) (MusEUtil::UpperLeft | MusEUtil::UpperRight | MusEUtil::LowerLeft | MusEUtil::LowerRight) ); + (MusECore::Corner) (MusECore::UpperLeft | MusECore::UpperRight | MusECore::LowerLeft | MusECore::LowerRight) ); thumbGrad.setStart(QPointF(cr.x(), 0)); thumbGrad.setFinalStop(QPointF(cr.x() + cr.width(), 0)); @@ -580,7 +580,7 @@ void Slider::paintEvent(QPaintEvent* /*ev*/) void Slider::resizeEvent(QResizeEvent *e) { - MusEWidget::SliderBase::resizeEvent(e); + SliderBase::resizeEvent(e); d_resized = TRUE; QSize s = e->size(); /* Scale is not supported @@ -712,8 +712,8 @@ void Slider::rangeChange() //------------------------------------------------------------ void Slider::setMargins(int hor, int vert) { - d_xMargin = MusEUtil::qwtMax(0, hor); - d_yMargin = MusEUtil::qwtMin(0, vert); + d_xMargin = MusECore::qwtMax(0, hor); + d_yMargin = MusECore::qwtMin(0, vert); resize(this->size()); } @@ -837,4 +837,4 @@ void Slider::setPageStep(double) { } -} // namespace MusEWidget +} // namespace MusEGui diff --git a/muse2/muse/widgets/slider.h b/muse2/muse/widgets/slider.h index b1281da0..0cc94c70 100644 --- a/muse2/muse/widgets/slider.h +++ b/muse2/muse/widgets/slider.h @@ -30,7 +30,7 @@ #include "sliderbase.h" #include "scldraw.h" -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // Slider @@ -110,6 +110,6 @@ class Slider : public SliderBase, public ScaleIf void setSizeHint(uint w, uint h); }; -} // namespace MusEWidget +} // namespace MusEGui #endif diff --git a/muse2/muse/widgets/sliderbase.cpp b/muse2/muse/widgets/sliderbase.cpp index 8b85878e..15497235 100644 --- a/muse2/muse/widgets/sliderbase.cpp +++ b/muse2/muse/widgets/sliderbase.cpp @@ -29,7 +29,7 @@ #include <QMouseEvent> #include <QTimerEvent> -namespace MusEWidget { +namespace MusEGui { // DESCRIPTION // SliderBase is a base class for @@ -184,7 +184,7 @@ void SliderBase::mousePressEvent(QMouseEvent *e) d_mouseOffset = 0; DoubleRange::incPages(d_direction); emit sliderMoved(value(), _id); - d_tmrID = startTimer(MusEUtil::qwtMax(250, 2 * d_updTime)); + d_tmrID = startTimer(MusECore::qwtMax(250, 2 * d_updTime)); break; case ScrMouse: @@ -729,7 +729,7 @@ void SliderBase::stepPages(int pages) // //------------------------------------------------------------ -} // namespace MusEWidget +} // namespace MusEGui diff --git a/muse2/muse/widgets/sliderbase.h b/muse2/muse/widgets/sliderbase.h index 39860153..56c7a586 100644 --- a/muse2/muse/widgets/sliderbase.h +++ b/muse2/muse/widgets/sliderbase.h @@ -30,7 +30,7 @@ #include <QTime> #include <QWidget> -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // SliderBase @@ -111,6 +111,6 @@ class SliderBase : public QWidget, public DoubleRange void setId(int i) { _id = i; } }; -} // namespace MusEWidget +} // namespace MusEGui #endif diff --git a/muse2/muse/widgets/songinfo.h b/muse2/muse/widgets/songinfo.h index 8e576876..90e2fb00 100644 --- a/muse2/muse/widgets/songinfo.h +++ b/muse2/muse/widgets/songinfo.h @@ -25,7 +25,7 @@ class QDialog; -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // SongInfoWidget @@ -40,4 +40,4 @@ class SongInfoWidget : public QDialog, public Ui::SongInfo SongInfoWidget(QDialog *parent = 0) : QDialog(parent) { setupUi(this); } }; -} // namespace MusEWidget +} // namespace MusEGui diff --git a/muse2/muse/widgets/spinbox.cpp b/muse2/muse/widgets/spinbox.cpp index 0111158d..f7afcf2a 100644 --- a/muse2/muse/widgets/spinbox.cpp +++ b/muse2/muse/widgets/spinbox.cpp @@ -24,7 +24,7 @@ #include <QEvent> #include "spinbox.h" -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // SpinBox @@ -99,4 +99,4 @@ void SpinBox::stepDown() _clearFocus = true; } -} // namespace MusEWidget +} // namespace MusEGui diff --git a/muse2/muse/widgets/spinbox.h b/muse2/muse/widgets/spinbox.h index 01cd6ad5..cee112d4 100644 --- a/muse2/muse/widgets/spinbox.h +++ b/muse2/muse/widgets/spinbox.h @@ -30,7 +30,7 @@ #include <QSpinBox> #include <QEvent> -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // SpinBox @@ -56,7 +56,7 @@ class SpinBox : public QSpinBox { SpinBox(int minValue, int maxValue, int step = 1, QWidget* parent=0); }; -} // namespace MusEWidget +} // namespace MusEGui #endif diff --git a/muse2/muse/widgets/spinboxFP.cpp b/muse2/muse/widgets/spinboxFP.cpp index 696e589f..89a41770 100644 --- a/muse2/muse/widgets/spinboxFP.cpp +++ b/muse2/muse/widgets/spinboxFP.cpp @@ -29,7 +29,7 @@ #include "spinboxFP.h" -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // SpinBoxFP @@ -188,4 +188,4 @@ int SpinBoxFP::valueFromText(const QString& text) const */ -} // namespace MusEWidget +} // namespace MusEGui diff --git a/muse2/muse/widgets/spinboxFP.h b/muse2/muse/widgets/spinboxFP.h index 81fc4876..98b7e561 100644 --- a/muse2/muse/widgets/spinboxFP.h +++ b/muse2/muse/widgets/spinboxFP.h @@ -29,7 +29,7 @@ //class QValidator; //class QDoubleValidator; -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // SpinBoxFP @@ -66,7 +66,7 @@ class SpinBoxFP : public QDoubleSpinBox { //int decimals() const { return _decimals; } }; -} // namespace MusEWidget +} // namespace MusEGui #endif diff --git a/muse2/muse/widgets/splitter.cpp b/muse2/muse/widgets/splitter.cpp index 09220b24..a1f4a921 100644 --- a/muse2/muse/widgets/splitter.cpp +++ b/muse2/muse/widgets/splitter.cpp @@ -26,7 +26,7 @@ #include <QList> #include <QStringList> -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // Splitter @@ -43,38 +43,38 @@ Splitter::Splitter(Qt::Orientation o, QWidget* parent, const char* name) // saveConfiguration //--------------------------------------------------------- -void Splitter::writeStatus(int level, Xml& xml) +void Splitter::writeStatus(int level, MusECore::Xml& xml) { QList<int> vl = sizes(); //xml.nput(level++, "<%s>", name()); - xml.nput(level++, "<%s>", Xml::xmlString(objectName()).toLatin1().constData()); + xml.nput(level++, "<%s>", MusECore::Xml::xmlString(objectName()).toLatin1().constData()); QList<int>::iterator ivl = vl.begin(); for (; ivl != vl.end(); ++ivl) { xml.nput("%d ", *ivl); } //xml.nput("</%s>\n", name()); - xml.nput("</%s>\n", Xml::xmlString(objectName()).toLatin1().constData()); + xml.nput("</%s>\n", MusECore::Xml::xmlString(objectName()).toLatin1().constData()); } //--------------------------------------------------------- // loadConfiguration //--------------------------------------------------------- -void Splitter::readStatus(Xml& xml) +void Splitter::readStatus(MusECore::Xml& xml) { QList<int> vl; for (;;) { - Xml::Token token = xml.parse(); + MusECore::Xml::Token token = xml.parse(); const QString& tag = xml.s1(); switch (token) { - case Xml::Error: - case Xml::End: + case MusECore::Xml::Error: + case MusECore::Xml::End: return; - case Xml::TagStart: + case MusECore::Xml::TagStart: xml.unknown("Splitter"); break; - case Xml::Text: + case MusECore::Xml::Text: { //QStringList sl = QStringList::split(' ', tag); QStringList sl = tag.split(QString(" "), QString::SkipEmptyParts); @@ -84,7 +84,7 @@ void Splitter::readStatus(Xml& xml) } } break; - case Xml::TagEnd: + case MusECore::Xml::TagEnd: if (tag == objectName()) { setSizes(vl); return; @@ -95,4 +95,4 @@ void Splitter::readStatus(Xml& xml) } } -} // namespace MusEWidget +} // namespace MusEGui diff --git a/muse2/muse/widgets/splitter.h b/muse2/muse/widgets/splitter.h index 3121fe87..d1bafd40 100644 --- a/muse2/muse/widgets/splitter.h +++ b/muse2/muse/widgets/splitter.h @@ -25,9 +25,11 @@ #include <QSplitter> +namespace MusECore { class Xml; +} -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // Splitter @@ -38,8 +40,8 @@ class Splitter : public QSplitter { public: Splitter(Qt::Orientation o, QWidget* parent, const char* name); - void writeStatus(int level, Xml&); - void readStatus(Xml&); + void writeStatus(int level, MusECore::Xml&); + void readStatus(MusECore::Xml&); }; } diff --git a/muse2/muse/widgets/swidget.cpp b/muse2/muse/widgets/swidget.cpp index 51796781..f082735b 100644 --- a/muse2/muse/widgets/swidget.cpp +++ b/muse2/muse/widgets/swidget.cpp @@ -24,7 +24,7 @@ #include <QResizeEvent> -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // resizeEvent @@ -36,4 +36,4 @@ void SWidget::resizeEvent(QResizeEvent* ev) emit heightChanged(ev->size().height()); } -} // namespace MusEWidget +} // namespace MusEGui diff --git a/muse2/muse/widgets/swidget.h b/muse2/muse/widgets/swidget.h index 0412ac41..c63642cf 100644 --- a/muse2/muse/widgets/swidget.h +++ b/muse2/muse/widgets/swidget.h @@ -25,7 +25,7 @@ #include <QWidget> -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // SWidget @@ -45,7 +45,7 @@ class SWidget : public QWidget { SWidget(QWidget* parent) : QWidget(parent) {} }; -} // namespace MusEWidget +} // namespace MusEGui #endif diff --git a/muse2/muse/widgets/tb1.cpp b/muse2/muse/widgets/tb1.cpp index 272359f0..3174260f 100644 --- a/muse2/muse/widgets/tb1.cpp +++ b/muse2/muse/widgets/tb1.cpp @@ -35,7 +35,7 @@ #include "poslabel.h" #include "pitchlabel.h" -namespace MusEWidget { +namespace MusEGui { static int rasterTable[] = { //------ 8 4 2 @@ -210,4 +210,4 @@ void Toolbar1::setPitchMode(bool /*flag*/) // pitch->setPitchMode(flag); } -} // namespace MusEWidget +} // namespace MusEGui diff --git a/muse2/muse/widgets/tb1.h b/muse2/muse/widgets/tb1.h index 93181c39..bbbb9904 100644 --- a/muse2/muse/widgets/tb1.h +++ b/muse2/muse/widgets/tb1.h @@ -31,7 +31,7 @@ class QTableWidget; class Track; class LabelCombo; -namespace MusEWidget { +namespace MusEGui { class PitchLabel; class PosLabel; @@ -71,6 +71,6 @@ class Toolbar1 : public QToolBar { void setPitchMode(bool flag); }; -} // namespace MusEWidget +} // namespace MusEGui #endif diff --git a/muse2/muse/widgets/tempolabel.cpp b/muse2/muse/widgets/tempolabel.cpp index cdbc029d..cc628f50 100644 --- a/muse2/muse/widgets/tempolabel.cpp +++ b/muse2/muse/widgets/tempolabel.cpp @@ -25,7 +25,7 @@ #include "tempolabel.h" -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // TempoLabel @@ -137,4 +137,4 @@ void TempoEdit::setValue(double val) // return lrint(60000000.0/value()); // } -} // namespace MusEWidget +} // namespace MusEGui diff --git a/muse2/muse/widgets/tempolabel.h b/muse2/muse/widgets/tempolabel.h index 682c1e37..50d70180 100644 --- a/muse2/muse/widgets/tempolabel.h +++ b/muse2/muse/widgets/tempolabel.h @@ -26,7 +26,7 @@ #include <QLabel> #include <QDoubleSpinBox> -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // TempoLabel @@ -76,7 +76,7 @@ class TempoEdit : public QDoubleSpinBox { //int tempo() const; }; -} // namespace MusEWidget +} // namespace MusEGui #endif diff --git a/muse2/muse/widgets/tools.cpp b/muse2/muse/widgets/tools.cpp index 113de6c4..162d2b97 100644 --- a/muse2/muse/widgets/tools.cpp +++ b/muse2/muse/widgets/tools.cpp @@ -28,7 +28,7 @@ #include "icons.h" #include "action.h" -namespace MusEWidget { +namespace MusEGui { const char* infoPointer = QT_TRANSLATE_NOOP("@default", "select Pointer Tool:\n" "with the pointer tool you can:\n" @@ -162,4 +162,4 @@ int EditToolBar::curTool() return -1; } -} // namespace MusEWidget +} // namespace MusEGui diff --git a/muse2/muse/widgets/tools.h b/muse2/muse/widgets/tools.h index 55c75c4a..71e63558 100644 --- a/muse2/muse/widgets/tools.h +++ b/muse2/muse/widgets/tools.h @@ -30,7 +30,7 @@ class QAction; class QPixmap; class QWidget; -namespace MusEWidget { +namespace MusEGui { class Action; @@ -84,7 +84,7 @@ class EditToolBar : public QToolBar { int curTool(); }; -} // namespace MusEWidget +} // namespace MusEGui #endif diff --git a/muse2/muse/widgets/transformbase.ui b/muse2/muse/widgets/transformbase.ui index ffa56338..845a2b8a 100644 --- a/muse2/muse/widgets/transformbase.ui +++ b/muse2/muse/widgets/transformbase.ui @@ -417,7 +417,7 @@ </widget> </item> <item row="2" column="1"> - <widget class="MusEWidget::SpinBoxFP" name="procVal1a"> + <widget class="MusEGui::SpinBoxFP" name="procVal1a"> <property name="maximum" stdset="0"> <number>99999999</number> </property> @@ -453,21 +453,21 @@ </widget> </item> <item row="2" column="2"> - <widget class="MusEWidget::SpinBoxFP" name="procVal2a"> + <widget class="MusEGui::SpinBoxFP" name="procVal2a"> <property name="maximum" stdset="0"> <number>99999999</number> </property> </widget> </item> <item row="2" column="3"> - <widget class="MusEWidget::SpinBoxFP" name="procLenA"> + <widget class="MusEGui::SpinBoxFP" name="procLenA"> <property name="maximum" stdset="0"> <number>99999999</number> </property> </widget> </item> <item row="2" column="4"> - <widget class="MusEWidget::SpinBoxFP" name="procPosA"> + <widget class="MusEGui::SpinBoxFP" name="procPosA"> <property name="maximum" stdset="0"> <number>99999999</number> </property> @@ -798,14 +798,14 @@ </widget> </item> <item row="3" column="4"> - <widget class="MusEWidget::SpinBoxFP" name="selBarB"> + <widget class="MusEGui::SpinBoxFP" name="selBarB"> <property name="decimals" stdset="0"> <number>3</number> </property> </widget> </item> <item row="2" column="4"> - <widget class="MusEWidget::SpinBoxFP" name="selBarA"> + <widget class="MusEGui::SpinBoxFP" name="selBarA"> <property name="minimum" stdset="0"> <number>1000</number> </property> @@ -974,7 +974,7 @@ </widget> </item> <item> - <widget class="MusEWidget::ComboQuant" name="funcQuantVal" native="true"/> + <widget class="MusEGui::ComboQuant" name="funcQuantVal" native="true"/> </item> </layout> </widget> @@ -986,12 +986,12 @@ <layoutdefault spacing="6" margin="11"/> <customwidgets> <customwidget> - <class>MusEWidget::SpinBoxFP</class> + <class>MusEGui::SpinBoxFP</class> <extends>QDoubleSpinBox</extends> <header>spinboxFP.h</header> </customwidget> <customwidget> - <class>MusEWidget::ComboQuant</class> + <class>MusEGui::ComboQuant</class> <extends>QComboBox</extends> <header>comboQuant.h</header> </customwidget> diff --git a/muse2/muse/widgets/ttoolbutton.cpp b/muse2/muse/widgets/ttoolbutton.cpp index 6bf43b1f..1bde3bf8 100644 --- a/muse2/muse/widgets/ttoolbutton.cpp +++ b/muse2/muse/widgets/ttoolbutton.cpp @@ -27,7 +27,7 @@ #include "gconfig.h" #include "icons.h" -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // drawButton @@ -43,4 +43,4 @@ void TransparentToolButton::drawButton(QPainter* p) p->drawPixmap(QPoint((w - pm.width())/2, (h - pm.height())/2), pm); } -} // namespace MusEWidget +} // namespace MusEGui diff --git a/muse2/muse/widgets/ttoolbutton.h b/muse2/muse/widgets/ttoolbutton.h index b61d2f7c..566a8cae 100644 --- a/muse2/muse/widgets/ttoolbutton.h +++ b/muse2/muse/widgets/ttoolbutton.h @@ -25,7 +25,7 @@ #include <QToolButton> -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // TransparentToolButton @@ -41,7 +41,7 @@ class TransparentToolButton : public QToolButton { : QToolButton(parent) {setObjectName(name);} }; -} // namespace MusEWidget +} // namespace MusEGui #endif diff --git a/muse2/muse/widgets/unusedwavefiles.cpp b/muse2/muse/widgets/unusedwavefiles.cpp index 07fcbf0c..a7f2c776 100644 --- a/muse2/muse/widgets/unusedwavefiles.cpp +++ b/muse2/muse/widgets/unusedwavefiles.cpp @@ -31,7 +31,7 @@ #include "globals.h" #include "app.h" -namespace MusEWidget { +namespace MusEGui { UnusedWaveFiles::UnusedWaveFiles(QWidget *parent) : QDialog(parent), @@ -120,4 +120,4 @@ void UnusedWaveFiles::accept() QDialog::accept(); } -} // namespace MusEWidget +} // namespace MusEGui diff --git a/muse2/muse/widgets/unusedwavefiles.h b/muse2/muse/widgets/unusedwavefiles.h index fba41212..11334ddb 100644 --- a/muse2/muse/widgets/unusedwavefiles.h +++ b/muse2/muse/widgets/unusedwavefiles.h @@ -26,10 +26,10 @@ #include <QDialog> namespace Ui { - class UnusedWaveFiles; +class UnusedWaveFiles; } -namespace MusEWidget { +namespace MusEGui { class UnusedWaveFiles : public QDialog { @@ -47,6 +47,6 @@ private: Ui::UnusedWaveFiles *ui; }; -} // namespace MusEWidget +} // namespace MusEGui #endif // UNUSEDWAVEFILES_H diff --git a/muse2/muse/widgets/utils.cpp b/muse2/muse/widgets/utils.cpp index 41c5a180..708bef07 100644 --- a/muse2/muse/widgets/utils.cpp +++ b/muse2/muse/widgets/utils.cpp @@ -41,7 +41,7 @@ #include "utils.h" #include "xml.h" -namespace MusEUtil { +namespace MusECore { //--------------------------------------------------------- // curTime @@ -553,4 +553,4 @@ int get_paste_len() return end_tick - begin_tick; } -} // namespace MusEUtils +} // namespace MusECore diff --git a/muse2/muse/widgets/utils.h b/muse2/muse/widgets/utils.h index 6e4c8758..95b9a133 100644 --- a/muse2/muse/widgets/utils.h +++ b/muse2/muse/widgets/utils.h @@ -32,7 +32,7 @@ class QPointF; class QColor; class QPainterPath; -namespace MusEUtil { +namespace MusECore { enum Corner { UpperLeft = 0x1, UpperRight = 0x2, LowerLeft = 0x4, LowerRight = 0x8 }; @@ -55,7 +55,7 @@ extern QPainterPath roundedPath(int x, int y, int w, int h, int xrad, int yrad, extern QIcon colorRect(const QColor& color, int width, int height); extern int get_paste_len(); -} // namespace MusEUtils +} // namespace MusECores #endif diff --git a/muse2/muse/widgets/verticalmeter.cpp b/muse2/muse/widgets/verticalmeter.cpp index 4553b156..b8524d33 100644 --- a/muse2/muse/widgets/verticalmeter.cpp +++ b/muse2/muse/widgets/verticalmeter.cpp @@ -34,7 +34,7 @@ #include "mmath.h" #include "utils.h" -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // VerticalMeter @@ -55,7 +55,7 @@ VerticalMeter::VerticalMeter(QWidget* parent, MeterType type) overflow = false; val = 0.0; maxVal = 0.0; - minScale = mtype == DBMeter ? MusEConfig::config.minMeter : 0.0; // min value in dB or int + minScale = mtype == DBMeter ? MusEGlobal::config.minMeter : 0.0; // min value in dB or int maxScale = mtype == DBMeter ? 10.0 : 127.0; yellowScale = -10; redScale = 0; @@ -152,7 +152,7 @@ void VerticalMeter::paintEvent(QPaintEvent* /*ev*/) if(mtype == DBMeter) - xv = int(((maxScale - (fast_log10(val) * 20.0)) * w)/range); + xv = int(((maxScale - (MusECore::fast_log10(val) * 20.0)) * w)/range); else { xv = int(((maxScale - val) * w)/range); } @@ -167,7 +167,7 @@ void VerticalMeter::paintEvent(QPaintEvent* /*ev*/) /* int xcenter; if(mtype == DBMeter) - xcenter = maxVal == 0 ? 0 : int(((maxScale - (fast_log10(0) * 20.0)) * w)/range); + xcenter = maxVal == 0 ? 0 : int(((maxScale - (MusECore::fast_log10(0) * 20.0)) * w)/range); else xcenter = maxVal == 0 ? 0 : int(((maxVal) * w)/range); p.setPen(peak_color); @@ -177,7 +177,7 @@ void VerticalMeter::paintEvent(QPaintEvent* /*ev*/) // Draw the transparent layer on top of everything to give a 3d look QPainterPath round_path = roundedPath(0, 0, w, h, xrad, yrad, - (MusEUtil::Corner) (MusEUtil::UpperLeft | MusEUtil::UpperRight | MusEUtil::LowerLeft | MusEUtil::LowerRight ) ); + (MusECore::Corner) (MusECore::UpperLeft | MusECore::UpperRight | MusECore::LowerLeft | MusECore::LowerRight ) ); maskGrad.setStart(QPointF(0, 0)); maskGrad.setFinalStop(QPointF(0, h)); p.fillPath(round_path, QBrush(maskGrad)); @@ -211,18 +211,18 @@ void VerticalMeter::drawVU(QPainter& p, int w, int h, int xv) QPainterPath p_left = roundedPath(0, 0, x1, h, xrad, yrad, - (MusEUtil::Corner) (MusEUtil::UpperLeft | MusEUtil::LowerLeft ) ); + (MusECore::Corner) (MusECore::UpperLeft | MusECore::LowerLeft ) ); QPainterPath p_right = roundedPath(x2, 0, w-x2, h, xrad, yrad, - (MusEUtil::Corner) (MusEUtil::LowerRight | MusEUtil::UpperRight ) ); + (MusECore::Corner) (MusECore::LowerRight | MusECore::UpperRight ) ); if(xv < x1) { QPainterPath p_light_green = roundedPath(0, 0, xv, h, xrad, yrad, - (MusEUtil::Corner) (MusEUtil::UpperLeft | MusEUtil::LowerLeft ) ); + (MusECore::Corner) (MusECore::UpperLeft | MusECore::LowerLeft ) ); p_left = p_left.subtracted(p_light_green); @@ -254,7 +254,7 @@ void VerticalMeter::drawVU(QPainter& p, int w, int h, int xv) { QPainterPath p_dark_red = roundedPath(xv, 0, w-xv, h, xrad, yrad, - (MusEUtil::Corner) (MusEUtil::LowerRight | MusEUtil::UpperRight ) ); + (MusECore::Corner) (MusECore::LowerRight | MusECore::UpperRight ) ); p_right = p_right.subtracted(p_dark_red); @@ -288,18 +288,18 @@ void VerticalMeter::drawVU(QPainter& p, int w, int h, int xv) QPainterPath p_left = roundedPath(0, 0, cut, h, xrad, yrad, - (MusEUtil::Corner) (MusEUtil::UpperLeft | MusEUtil::LowerLeft ) ); + (MusECore::Corner) (MusECore::UpperLeft | MusECore::LowerLeft ) ); QPainterPath p_right = roundedPath(cut, 0, w-cut, h, xrad, yrad, - (MusEUtil::Corner) (MusEUtil::LowerRight | MusEUtil::UpperRight ) ); + (MusECore::Corner) (MusECore::LowerRight | MusECore::UpperRight ) ); if(xv < cut) { QPainterPath p_light = roundedPath(0, 0, xv, h, xrad, yrad, - (MusEUtil::Corner) (MusEUtil::UpperLeft | MusEUtil::LowerLeft ) ); + (MusECore::Corner) (MusECore::UpperLeft | MusECore::LowerLeft ) ); p_left = p_left.subtracted(p_light); @@ -314,7 +314,7 @@ void VerticalMeter::drawVU(QPainter& p, int w, int h, int xv) { QPainterPath p_dark = roundedPath(xv, 0, w-xv, h, xrad, yrad, - (MusEUtil::Corner) (MusEUtil::UpperRight | MusEUtil::LowerRight ) ); + (MusECore::Corner) (MusECore::UpperRight | MusECore::LowerRight ) ); p_right = p_right.subtracted(p_dark); // left section: @@ -335,7 +335,7 @@ void VerticalMeter::drawVU(QPainter& p, int w, int h, int xv) void VerticalMeter::resizeEvent(QResizeEvent* ev) { - MusEWidget::Meter::resizeEvent(ev); + Meter::resizeEvent(ev); } -} // namespace MusEWidget +} // namespace MusEGui diff --git a/muse2/muse/widgets/verticalmeter.h b/muse2/muse/widgets/verticalmeter.h index 024ecc10..58185266 100644 --- a/muse2/muse/widgets/verticalmeter.h +++ b/muse2/muse/widgets/verticalmeter.h @@ -31,7 +31,7 @@ class QResizeEvent; class QMouseEvent; class QPainter; -namespace MusEWidget { +namespace MusEGui { class VerticalMeter : public Meter { Q_OBJECT @@ -59,7 +59,7 @@ class VerticalMeter : public Meter { void setRange(double min, double max); }; -} // namespace MusEWidget +} // namespace MusEGui #endif diff --git a/muse2/muse/widgets/view.cpp b/muse2/muse/widgets/view.cpp index 8a9d82b4..fb53be46 100644 --- a/muse2/muse/widgets/view.cpp +++ b/muse2/muse/widgets/view.cpp @@ -42,7 +42,7 @@ // just ate up all the time no matter what I tried. //#defines VIEW_USE_DOUBLE_BUFFERING 1 -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // View::View @@ -981,4 +981,4 @@ QRect View::devToVirt(const QRect& r) } */ -} // namespace MusEWidget +} // namespace MusEGui diff --git a/muse2/muse/widgets/view.h b/muse2/muse/widgets/view.h index e5f33657..30f234bb 100644 --- a/muse2/muse/widgets/view.h +++ b/muse2/muse/widgets/view.h @@ -34,7 +34,7 @@ class QPainter; class QPixmap; class QResizeEvent; -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // View @@ -128,7 +128,7 @@ class View : public QWidget { int rmapx(int x) const; }; -} // namespace MusEWidget +} // namespace MusEGui #endif diff --git a/muse2/muse/widgets/visibletracks.cpp b/muse2/muse/widgets/visibletracks.cpp index 7e56bb36..84e7dd42 100644 --- a/muse2/muse/widgets/visibletracks.cpp +++ b/muse2/muse/widgets/visibletracks.cpp @@ -30,7 +30,7 @@ #include "track.h" #include "synth.h" -namespace MusEWidget { +namespace MusEGui { const char* waveTrack = QT_TRANSLATE_NOOP("@default", "Show wave tracks"); const char* groupTrack = QT_TRANSLATE_NOOP("@default", "Show group tracks"); @@ -90,13 +90,13 @@ VisibleTracks::VisibleTracks(QWidget* parent, const char*) //--------------------------------------------------------- void VisibleTracks::updateVisibleTracksButtons() { - actions[0]->setChecked(WaveTrack::visible()); - actions[1]->setChecked(AudioGroup::visible()); - actions[2]->setChecked(AudioAux::visible()); - actions[3]->setChecked(AudioInput::visible()); - actions[4]->setChecked(AudioOutput::visible()); - actions[5]->setChecked(MidiTrack::visible()); - actions[6]->setChecked(SynthI::visible()); + actions[0]->setChecked(MusECore::WaveTrack::visible()); + actions[1]->setChecked(MusECore::AudioGroup::visible()); + actions[2]->setChecked(MusECore::AudioAux::visible()); + actions[3]->setChecked(MusECore::AudioInput::visible()); + actions[4]->setChecked(MusECore::AudioOutput::visible()); + actions[5]->setChecked(MusECore::MidiTrack::visible()); + actions[6]->setChecked(MusECore::SynthI::visible()); } //--------------------------------------------------------- // toolChanged @@ -107,25 +107,25 @@ void VisibleTracks::visibilityChanged(QAction* action) // printf("update visibility\n"); switch (((Action*)action)->id()) { case 0: - WaveTrack::setVisible(action->isChecked()); + MusECore::WaveTrack::setVisible(action->isChecked()); break; case 1: - AudioGroup::setVisible(action->isChecked()); + MusECore::AudioGroup::setVisible(action->isChecked()); break; case 2: - AudioAux::setVisible(action->isChecked()); + MusECore::AudioAux::setVisible(action->isChecked()); break; case 3: - AudioInput::setVisible(action->isChecked()); + MusECore::AudioInput::setVisible(action->isChecked()); break; case 4: - AudioOutput::setVisible(action->isChecked()); + MusECore::AudioOutput::setVisible(action->isChecked()); break; case 5: - MidiTrack::setVisible(action->isChecked()); + MusECore::MidiTrack::setVisible(action->isChecked()); break; case 6: - SynthI::setVisible(action->isChecked()); + MusECore::SynthI::setVisible(action->isChecked()); break; default: break; @@ -142,4 +142,4 @@ VisibleTracks::~VisibleTracks() delete [] actions; } -} // namespace MusEWidget +} // namespace MusEGui diff --git a/muse2/muse/widgets/visibletracks.h b/muse2/muse/widgets/visibletracks.h index b0e92d26..d56c9ce7 100644 --- a/muse2/muse/widgets/visibletracks.h +++ b/muse2/muse/widgets/visibletracks.h @@ -29,7 +29,7 @@ class QAction; class QPixmap; class QWidget; -namespace MusEWidget { +namespace MusEGui { class Action; @@ -62,6 +62,6 @@ class VisibleTracks : public QToolBar { ~VisibleTracks(); }; -} // namespace MusEWidget +} // namespace MusEGui #endif // VISIBLETRACKS_H diff --git a/muse2/muse/widgets/vscale.cpp b/muse2/muse/widgets/vscale.cpp index 22af7889..f47e1c41 100644 --- a/muse2/muse/widgets/vscale.cpp +++ b/muse2/muse/widgets/vscale.cpp @@ -25,7 +25,7 @@ #include <QPainter> #include <QPaintEvent> -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // paintEvent @@ -43,4 +43,4 @@ void VScale::paintEvent(QPaintEvent*) p.end(); } -} // namespace MusEWidget +} // namespace MusEGui diff --git a/muse2/muse/widgets/vscale.h b/muse2/muse/widgets/vscale.h index e926b3cb..62f1d553 100644 --- a/muse2/muse/widgets/vscale.h +++ b/muse2/muse/widgets/vscale.h @@ -27,7 +27,7 @@ class QPaintEvent; -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // VScale @@ -42,7 +42,7 @@ class VScale : public QWidget { VScale(QWidget* parent=0) : QWidget(parent) {setFixedWidth(18);} }; -} // namespace MusEWidget +} // namespace MusEGui #endif diff --git a/muse2/muse/widgets/wtscale.cpp b/muse2/muse/widgets/wtscale.cpp index 94bd058d..82ab0ca4 100644 --- a/muse2/muse/widgets/wtscale.cpp +++ b/muse2/muse/widgets/wtscale.cpp @@ -34,7 +34,7 @@ #include "../marker/marker.h" #include "icons.h" -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // WTScale @@ -47,15 +47,15 @@ WTScale::WTScale(int* r, QWidget* parent, int xs) QToolTip::add(this, tr("bar scale")); barLocator = false; raster = r; - pos[0] = int(song->tempomap()->tick2time(song->cpos()) * sampleRate); - pos[1] = int(song->tempomap()->tick2time(song->lpos()) * sampleRate); - pos[2] = int(song->tempomap()->tick2time(song->rpos()) * sampleRate); + pos[0] = int(MusEGlobal::song->tempomap()->tick2time(MusEGlobal::song->cpos()) * sampleRate); + pos[1] = int(MusEGlobal::song->tempomap()->tick2time(MusEGlobal::song->lpos()) * sampleRate); + pos[2] = int(MusEGlobal::song->tempomap()->tick2time(MusEGlobal::song->rpos()) * sampleRate); pos[3] = -1; // do not show button = Qt::NoButton; setMouseTracking(true); - connect(song, SIGNAL(posChanged(int, unsigned, bool)), SLOT(setPos(int, unsigned, bool))); - connect(song, SIGNAL(songChanged(int)), SLOT(songChanged(int))); - connect(song, SIGNAL(markerChanged(int)), SLOT(redraw())); + connect(MusEGlobal::song, SIGNAL(posChanged(int, unsigned, bool)), SLOT(setPos(int, unsigned, bool))); + connect(MusEGlobal::song, SIGNAL(songChanged(int)), SLOT(songChanged(int))); + connect(MusEGlobal::song, SIGNAL(markerChanged(int)), SLOT(redraw())); setFixedHeight(28); setBg(QColor(0xe0, 0xe0, 0xe0)); } @@ -74,7 +74,7 @@ void WTScale::songChanged(int /*type*/) void WTScale::setPos(int idx, unsigned val, bool adjustScrollbar) { - val = int(song->tempomap()->tick2time(val) * sampleRate); + val = int(MusEGlobal::song->tempomap()->tick2time(val) * sampleRate); if (val == pos[idx]) return; int opos = mapx(pos[idx] == -1 ? val : pos[idx]); @@ -120,8 +120,8 @@ void WTScale::viewMouseReleaseEvent(QMouseEvent* event) void WTScale::viewMouseMoveEvent(QMouseEvent* event) { - int x= song->tempomap()->time2tick(double(event->x())/double(sampleRate)); - x = song->raster(x, *raster); + int x= MusEGlobal::song->tempomap()->time2tick(double(event->x())/double(sampleRate)); + x = MusEGlobal::song->raster(x, *raster); if (x < 0) x = 0; emit timeChanged(x); @@ -134,7 +134,7 @@ void WTScale::viewMouseMoveEvent(QMouseEvent* event) i = 1; break; case Qt::RightButton: - if ((MusEConfig::config.rangeMarkerWithoutMMB) && (event->modifiers() & Qt::ControlModifier)) + if ((MusEGlobal::config.rangeMarkerWithoutMMB) && (event->modifiers() & Qt::ControlModifier)) i = 1; else i = 2; @@ -142,7 +142,7 @@ void WTScale::viewMouseMoveEvent(QMouseEvent* event) default: return; } - song->setPos(i, x); + MusEGlobal::song->setPos(i, x); } //--------------------------------------------------------- @@ -175,7 +175,7 @@ void WTScale::pdraw(QPainter& p, const QRect& r) p.drawLine(r.x(), y+1, r.x() + r.width(), y+1); QRect tr(r); tr.setHeight(12); - MarkerList* marker = song->marker(); + MarkerList* marker = MusEGlobal::song->marker(); for (iMarker m = marker->begin(); m != marker->end(); ++m) { int xp = mapx(int(m->second.time() * sampleRate)); if (xp > x+w) @@ -239,19 +239,19 @@ void WTScale::pdraw(QPainter& p, const QRect& r) p.drawLine(xp, 0, xp, height()); } - int ctick = song->samples2tick(mapxDev(x)); + int ctick = MusEGlobal::song->samples2tick(mapxDev(x)); int bar1, bar2, beat, tick; - song->tickValues(ctick, &bar1, &beat, &tick); - song->tickValues(song->samples2tick(mapxDev(x+w)), &bar2, &beat, &tick); + MusEGlobal::song->tickValues(ctick, &bar1, &beat, &tick); + MusEGlobal::song->tickValues(MusEGlobal::song->samples2tick(mapxDev(x+w)), &bar2, &beat, &tick); //printf("bar %d %d-%d=%d\n", bar, ntick, stick, ntick-stick); - int stick = song->bar2tick(bar1, 0, 0); + int stick = MusEGlobal::song->bar2tick(bar1, 0, 0); int ntick; for (int bar = bar1; bar <= bar2; bar++, stick = ntick) { - ntick = song->bar2tick(bar+1, 0, 0); - int a = song->tick2samples(ntick); - int b = song->tick2samples(stick); + ntick = MusEGlobal::song->bar2tick(bar+1, 0, 0); + int a = MusEGlobal::song->tick2samples(ntick); + int b = MusEGlobal::song->tick2samples(stick); int tpix = rmapx(a - b); if (tpix < 64) { // donīt show beats if measure is this small @@ -278,9 +278,9 @@ void WTScale::pdraw(QPainter& p, const QRect& r) } else { int z, n; - song->timesig(stick, z, n); + MusEGlobal::song->timesig(stick, z, n); for (int beat = 0; beat < z; beat++) { - int xx = song->tick2samples(song->bar2tick(bar, beat, 0)); + int xx = MusEGlobal::song->tick2samples(MusEGlobal::song->bar2tick(bar, beat, 0)); int xp = mapx(xx); QString s; QRect r(xp+2, y, 0, h); @@ -305,5 +305,5 @@ void WTScale::pdraw(QPainter& p, const QRect& r) } } -} // namespace MusEWidget +} // namespace MusEGui diff --git a/muse2/muse/widgets/wtscale.h b/muse2/muse/widgets/wtscale.h index b25de627..1999a91f 100644 --- a/muse2/muse/widgets/wtscale.h +++ b/muse2/muse/widgets/wtscale.h @@ -25,7 +25,7 @@ #include "view.h" -namespace MusEWidget { +namespace MusEGui { //--------------------------------------------------------- // WTScale @@ -60,7 +60,7 @@ class WTScale : public View { void setBarLocator(bool f) { barLocator = f; } }; -} // namespace MusEWidget +} // namespace MusEGui #endif |