diff options
Diffstat (limited to 'muse2/muse/master')
-rw-r--r-- | muse2/muse/master/lmaster.cpp | 33 | ||||
-rw-r--r-- | muse2/muse/master/lmaster.h | 22 | ||||
-rw-r--r-- | muse2/muse/master/masteredit.cpp | 18 | ||||
-rw-r--r-- | muse2/muse/master/masteredit.h | 6 |
4 files changed, 51 insertions, 28 deletions
diff --git a/muse2/muse/master/lmaster.cpp b/muse2/muse/master/lmaster.cpp index 03054fd6..06f816ba 100644 --- a/muse2/muse/master/lmaster.cpp +++ b/muse2/muse/master/lmaster.cpp @@ -5,13 +5,16 @@ // (C) Copyright 2000 Werner Schweer (ws@seh.de) //========================================================= +#include "awl/posedit.h" +#include "awl/sigedit.h" + #include "lmaster.h" #include "xml.h" #include "song.h" #include "globals.h" #include "audio.h" -#include "posedit.h" -#include "sigedit.h" +///#include "posedit.h" +///#include "sigedit.h" #include "shortcuts.h" #include "debug.h" @@ -165,7 +168,7 @@ LMaster::~LMaster() // insertSig //--------------------------------------------------------- -void LMaster::insertSig(const SigEvent* ev) +void LMaster::insertSig(const AL::SigEvent* ev) { new LMasterSigEventItem(view, ev); } @@ -196,10 +199,10 @@ void LMaster::updateList() view->clear(); const TempoList* t = &tempomap; - const SigList* s = &sigmap; + const AL::SigList* s = &AL::sigmap; criTEvent it = t->rbegin(); - criSigEvent is = s->rbegin(); + AL::criSigEvent is = s->rbegin(); for (;;) { if (it == t->rend()) { while(is != s->rend()) { @@ -409,7 +412,8 @@ void LMaster::itemDoubleClicked(QTreeWidgetItem* i) // Everything OK else { if (!pos_editor) - pos_editor = new PosEdit(view->viewport()); + ///pos_editor = new PosEdit(view->viewport()); + pos_editor = new Awl::PosEdit(view->viewport()); pos_editor->setValue(editedItem->tick()); QRect itemRect = view->visualItemRect(editedItem); itemRect.setX(0); @@ -524,7 +528,8 @@ void LMaster::returnPressed() // else if (editedItem->getType() == LMASTER_SIGEVENT && editorColumn == LMASTER_VAL_COL) { - Sig newSig = sig_editor->sig(); + ///Sig newSig = sig_editor->sig(); + AL::TimeSignature newSig = sig_editor->sig(); sig_editor->hide(); @@ -593,7 +598,7 @@ LMasterTempoItem::LMasterTempoItem(QTreeWidget* parent, const TEvent* ev) //QString c1, c2, c3, c4; int bar, beat; unsigned tick; - sigmap.tickValues(t, &bar, &beat, &tick); + AL::sigmap.tickValues(t, &bar, &beat, &tick); c1.sprintf("%04d.%02d.%03d", bar+1, beat+1, tick); double time = double(ev->frame) / double(sampleRate); @@ -614,14 +619,14 @@ LMasterTempoItem::LMasterTempoItem(QTreeWidget* parent, const TEvent* ev) // LMasterSigEventItem //! Initializes a ListView item with a SigEvent //--------------------------------------------------------- -LMasterSigEventItem::LMasterSigEventItem(QTreeWidget* parent, const SigEvent* ev) +LMasterSigEventItem::LMasterSigEventItem(QTreeWidget* parent, const AL::SigEvent* ev) : LMasterLViewItem(parent) { sigEvent = ev; unsigned t = ev->tick; int bar, beat; unsigned tick; - sigmap.tickValues(t, &bar, &beat, &tick); + AL::sigmap.tickValues(t, &bar, &beat, &tick); c1.sprintf("%04d.%02d.%03d", bar+1, beat+1, tick); double time = double(tempomap.tick2frame(t)) / double (sampleRate); @@ -630,7 +635,7 @@ LMasterSigEventItem::LMasterSigEventItem(QTreeWidget* parent, const SigEvent* ev int msec = int((time - (min*60 + sec)) * 1000.0); c2.sprintf("%03d:%02d:%03d", min, sec, msec); c3 = "Timesig"; - c4.sprintf("%d/%d", ev->z, ev->n); + c4.sprintf("%d/%d", ev->sig.z, ev->sig.n); setText(0, c1); setText(1, c2); setText(2, c3); @@ -649,7 +654,7 @@ void LMaster::tempoButtonClicked() Pos p = Pos(beatString); p.mbt(&m, &b, &t); m++; //Next bar - int newTick = sigmap.bar2tick(m, b, t); + int newTick = AL::sigmap.bar2tick(m, b, t); TEvent* ev = new TEvent(lastTempo->tempo(), newTick); new LMasterTempoItem(view, ev); QTreeWidgetItem* newTempoItem = view->topLevelItem(0); @@ -675,8 +680,8 @@ void LMaster::timeSigButtonClicked() Pos p = Pos(beatString); p.mbt(&m, &b, &t); m++; - int newTick = sigmap.bar2tick(m, b, t); - SigEvent* ev = new SigEvent(lastSig->z(), lastSig->n(), newTick); + int newTick = AL::sigmap.bar2tick(m, b, t); + AL::SigEvent* ev = new AL::SigEvent(AL::TimeSignature(lastSig->z(), lastSig->n()), newTick); new LMasterSigEventItem(view, ev); QTreeWidgetItem* newSigItem = view->topLevelItem(0); //LMasterSigEventItem* newSigItem = new LMasterSigEventItem(view, ev); diff --git a/muse2/muse/master/lmaster.h b/muse2/muse/master/lmaster.h index 92c213b0..cdad4c77 100644 --- a/muse2/muse/master/lmaster.h +++ b/muse2/muse/master/lmaster.h @@ -12,14 +12,24 @@ #include "noteinfo.h" #include "cobject.h" #include "tempo.h" -#include "sig.h" +///#include "sig.h" +//#include "al/sig.h" #include <QTreeWidgetItem> +namespace AL { + class SigEvent; + }; +using AL::SigEvent; + +namespace Awl { + class PosEdit; + class SigEdit; + }; +using Awl::PosEdit; +using Awl::SigEdit; + class QLineEdit; -class SigEvent; -class PosEdit; -class SigEdit; enum LMASTER_LVTYPE { @@ -74,8 +84,8 @@ class LMasterSigEventItem : public LMasterLViewItem { virtual LMASTER_LVTYPE getType() { return LMASTER_SIGEVENT; } const SigEvent* getEvent() { return sigEvent; } virtual unsigned tick() { return sigEvent->tick; } - int z() { return sigEvent->z; } - int n() { return sigEvent->n; } + int z() { return sigEvent->sig.z; } + int n() { return sigEvent->sig.n; } }; diff --git a/muse2/muse/master/masteredit.cpp b/muse2/muse/master/masteredit.cpp index 2736808e..d4fd3e0d 100644 --- a/muse2/muse/master/masteredit.cpp +++ b/muse2/muse/master/masteredit.cpp @@ -5,6 +5,8 @@ // (C) Copyright 1999 Werner Schweer (ws@seh.de) //========================================================= +#include "awl/sigedit.h" + #include "masteredit.h" #include "mtscale.h" #include "hitscale.h" @@ -18,7 +20,7 @@ #include "xml.h" #include "lcombo.h" #include "doublelabel.h" -#include "sigedit.h" +///#include "sigedit.h" #include "globals.h" #include <values.h> @@ -55,9 +57,9 @@ void MasterEdit::songChanged(int type) } if (type & SC_SIG) { int z, n; - sigmap.timesig(song->cpos(), z, n); + AL::sigmap.timesig(song->cpos(), z, n); curSig->blockSignals(true); - curSig->setValue(Sig(z, n)); + curSig->setValue(AL::TimeSignature(z, n)); curSig->blockSignals(false); sign->redraw(); } @@ -131,12 +133,14 @@ MasterEdit::MasterEdit() info->addWidget(new QLabel(tr("CurPos "))); curTempo = new TempoEdit(0); curSig = new SigEdit(0); - curSig->setValue(Sig(4, 4)); + curSig->setValue(AL::TimeSignature(4, 4)); curTempo->setToolTip(tr("tempo at current position")); curSig->setToolTip(tr("time signature at current position")); info->addWidget(curTempo); info->addWidget(curSig); - connect(curSig, SIGNAL(valueChanged(int,int)), song, SLOT(setSig(int,int))); + ///connect(curSig, SIGNAL(valueChanged(int,int)), song, SLOT(setSig(int,int))); + connect(curSig, SIGNAL(valueChanged(const AL::TimeSignature&)), song, SLOT(setSig(const AL::TimeSignature&))); + ///connect(curTempo, SIGNAL(valueChanged(double)), song, SLOT(setTempo(double))); connect(curTempo, SIGNAL(tempoChanged(double)), song, SLOT(setTempo(double))); @@ -354,12 +358,12 @@ void MasterEdit::posChanged(int idx, unsigned val, bool) if (idx == 0) { int z, n; int tempo = tempomap.tempo(val); - sigmap.timesig(val, z, n); + AL::sigmap.timesig(val, z, n); curTempo->blockSignals(true); curSig->blockSignals(true); curTempo->setValue(double(60000000.0/tempo)); - curSig->setValue(Sig(z, n)); + curSig->setValue(AL::TimeSignature(z, n)); curTempo->blockSignals(false); curSig->blockSignals(false); diff --git a/muse2/muse/master/masteredit.h b/muse2/muse/master/masteredit.h index 9fa3bd6d..af43c7b0 100644 --- a/muse2/muse/master/masteredit.h +++ b/muse2/muse/master/masteredit.h @@ -12,6 +12,11 @@ #include "noteinfo.h" #include "cobject.h" +namespace Awl { + class SigEdit; + }; +using Awl::SigEdit; + class QCloseEvent; class QToolBar; class QToolButton; @@ -23,7 +28,6 @@ class SigScale; class HitScale; class TScale; class TempoEdit; -class SigEdit; class LabelCombo; class PosLabel; class TempoLabel; |