diff options
author | Orcan Ogetbil <oget.fedora@gmail.com> | 2011-09-09 03:49:53 +0000 |
---|---|---|
committer | Orcan Ogetbil <oget.fedora@gmail.com> | 2011-09-09 03:49:53 +0000 |
commit | ad72332d2cbd0d22e5d49d9fd60c985e563b17d0 (patch) | |
tree | 11f22bb42664eb9e8aa2527ec175d20dd09a0390 /muse2 | |
parent | d3e8a1b4c98cb3ba8b73f367ea88ad23f8dbca66 (diff) |
namespace work (part deux)
Diffstat (limited to 'muse2')
227 files changed, 1363 insertions, 776 deletions
diff --git a/muse2/ChangeLog b/muse2/ChangeLog index b4ca02a7..bdc4cb57 100644 --- a/muse2/ChangeLog +++ b/muse2/ChangeLog @@ -1,3 +1,5 @@ +08.09.2011: + - Finished namespace MusEWidget. Added namespaces MusEUtil, MusEDialog. (Orcan) 07.09.2011: - Introducing namespaces. So far, we have MusEApp, MusEGlobal, MusEConfig, and I just started MusEWidget. zynaddsubfx does not crash anymore. (Orcan) diff --git a/muse2/muse/app.cpp b/muse2/muse/app.cpp index db14aa05..e3741071 100644 --- a/muse2/muse/app.cpp +++ b/muse2/muse/app.cpp @@ -1581,7 +1581,7 @@ void MusE::loadProjectFile1(const QString& name, bool songTemplate, bool loadAll // read *.med file // bool popenFlag; - FILE* f = fileOpen(this, fi.filePath(), QString(".med"), "r", popenFlag, true); + FILE* f = MusEWidget::fileOpen(this, fi.filePath(), QString(".med"), "r", popenFlag, true); if (f == 0) { if (errno != ENOENT) { QMessageBox::critical(this, QString("MusE"), @@ -1752,7 +1752,7 @@ void MusE::setFollow() void MusE::loadProject() { bool loadAll; - QString fn = getOpenFileName(QString(""), MusEGlobal::med_file_pattern, this, + QString fn = MusEWidget::getOpenFileName(QString(""), MusEGlobal::med_file_pattern, this, tr("MusE: load project"), &loadAll); if (!fn.isEmpty()) { MusEGlobal::museProject = QFileInfo(fn).absolutePath(); @@ -1766,8 +1766,8 @@ void MusE::loadProject() void MusE::loadTemplate() { - QString fn = getOpenFileName(QString("templates"), MusEGlobal::med_file_pattern, this, - tr("MusE: load template"), 0, MFileDialog::GLOBAL_VIEW); + QString fn = MusEWidget::getOpenFileName(QString("templates"), MusEGlobal::med_file_pattern, this, + tr("MusE: load template"), 0, MusEWidget::MFileDialog::GLOBAL_VIEW); if (!fn.isEmpty()) { // MusEGlobal::museProject = QFileInfo(fn).absolutePath(); @@ -1819,7 +1819,7 @@ bool MusE::save(const QString& name, bool overwriteWarn) system(backupCommand.toLatin1().constData()); bool popenFlag; - FILE* f = fileOpen(this, name, QString(".med"), "w", popenFlag, false, overwriteWarn); + FILE* f = MusEWidget::fileOpen(this, name, QString(".med"), "w", popenFlag, false, overwriteWarn); if (f == 0) return false; Xml xml(f); @@ -2041,10 +2041,10 @@ void MusE::showTransport(bool flag) // by audio strip, midi strip, and midi trackinfo. //--------------------------------------------------------- -RoutePopupMenu* MusE::getRoutingPopupMenu() +MusEWidget::RoutePopupMenu* MusE::getRoutingPopupMenu() { if(!routingPopupMenu) - routingPopupMenu = new RoutePopupMenu(this); + routingPopupMenu = new MusEWidget::RoutePopupMenu(this); return routingPopupMenu; } @@ -2057,7 +2057,7 @@ bool MusE::saveAs() QString name; if (MusEGlobal::museProject == MusEGlobal::museProjectInitPath ) { if (MusEConfig::config.useProjectSaveDialog) { - ProjectCreateImpl pci(MusEGlobal::muse); + MusEWidget::ProjectCreateImpl pci(MusEGlobal::muse); if (pci.exec() == QDialog::Rejected) { return false; } @@ -2065,7 +2065,7 @@ bool MusE::saveAs() song->setSongInfo(pci.getSongInfo(), true); name = pci.getProjectPath(); } else { - name = getSaveFileName(QString(""), MusEGlobal::med_file_save_pattern, this, tr("MusE: Save As")); + name = MusEWidget::getSaveFileName(QString(""), MusEGlobal::med_file_save_pattern, this, tr("MusE: Save As")); if (name.isEmpty()) return false; } @@ -2078,7 +2078,7 @@ bool MusE::saveAs() } } else { - name = getSaveFileName(QString(""), MusEGlobal::med_file_save_pattern, this, tr("MusE: Save As")); + name = MusEWidget::getSaveFileName(QString(""), MusEGlobal::med_file_save_pattern, this, tr("MusE: Save As")); } bool ok = false; if (!name.isEmpty()) { @@ -2353,7 +2353,7 @@ void MusE::startWaveEditor(PartList* pl) //--------------------------------------------------------- void MusE::startSongInfo(bool editable) { - SongInfoWidget info; + MusEWidget::SongInfoWidget info; info.viewCheckBox->setChecked(song->showSongInfoOnStartup()); info.viewCheckBox->setEnabled(editable); info.songInfoText->setPlainText(song->getSongInfo()); @@ -2374,7 +2374,7 @@ void MusE::startSongInfo(bool editable) void MusE::showDidYouKnowDialog() { if ((bool)MusEConfig::config.showDidYouKnow == true) { - DidYouKnowWidget dyk; + MusEWidget::DidYouKnowWidget dyk; dyk.tipText->setText("To get started with MusE why don't you try some demo songs available at http://demos.muse-sequencer.org/"); dyk.show(); if( dyk.exec()) { @@ -2914,7 +2914,7 @@ void MusE::changeConfig(bool writeFlag) void MusE::configMetronome() { if (!metronomeConfig) - metronomeConfig = new MetronomeConfig; + metronomeConfig = new MusEWidget::MetronomeConfig; if(metronomeConfig->isVisible()) { metronomeConfig->raise(); @@ -2932,7 +2932,7 @@ void MusE::configMetronome() void MusE::configShortCuts() { if (!shortcutConfig) - shortcutConfig = new ShortcutConfig(this); + shortcutConfig = new MusEWidget::ShortcutConfig(this); shortcutConfig->_config_changed = false; if (shortcutConfig->exec()) changeConfig(true); @@ -3621,7 +3621,7 @@ void MusE::execUserScript(int id) //--------------------------------------------------------- void MusE::findUnusedWaveFiles() { - UnusedWaveFiles unused(MusEGlobal::muse); + MusEWidget::UnusedWaveFiles unused(MusEGlobal::muse); unused.exec(); } diff --git a/muse2/muse/app.h b/muse2/muse/app.h index 9036de19..4b0d4195 100644 --- a/muse2/muse/app.h +++ b/muse2/muse/app.h @@ -45,6 +45,11 @@ class QProgressDialog; namespace MusEWidget { class BigTime; class EditToolBar; +class GlobalSettingsConfig; +class MetronomeConfig; +class MidiSyncConfig; +class RoutePopupMenu; +class ShortcutConfig; class VisibleTracks; } @@ -53,12 +58,9 @@ class PartList; class Transport; class Arranger; class Instrument; -class RoutePopupMenu; class Track; class PrinterConfig; -class MidiSyncConfig; class MRConfig; -class MetronomeConfig; class AudioConf; class Xml; class AudioMixerApp; @@ -67,7 +69,6 @@ class AudioRecord; class MidiFileConfig; class MidiFilterConfig; class MarkerView; -class GlobalSettingsConfig; class MidiControllerEditDialog; class MidiInputTransformDialog; class MidiTransformerDialog; @@ -76,7 +77,6 @@ class RhythmGen; class MidiTrack; class MidiInstrument; class MidiPort; -class ShortcutConfig; class Appearance; class WaveTrack; class AudioOutput; @@ -182,23 +182,23 @@ class MusE : public QMainWindow QMenu* select, *master, *midiEdit, *addTrack; // Special common menu for routes. Used (so far) by audio and midi strip, and midi trackinfo. - RoutePopupMenu* routingPopupMenu; + MusEWidget::RoutePopupMenu* routingPopupMenu; QMenu* follow; QMenu* midiInputPlugins; QWidget* midiPortConfig; QWidget* softSynthesizerConfig; - MidiSyncConfig* midiSyncConfig; + MusEWidget::MidiSyncConfig* midiSyncConfig; MRConfig* midiRemoteConfig; RhythmGen* midiRhythmGenerator; - MetronomeConfig* metronomeConfig; + MusEWidget::MetronomeConfig* metronomeConfig; AudioConf* audioConfig; MidiFileConfig* midiFileConfig; - GlobalSettingsConfig* globalSettingsConfig; + MusEWidget::GlobalSettingsConfig* globalSettingsConfig; MidiFilterConfig* midiFilterConfig; MidiInputTransformDialog* midiInputTransform; - ShortcutConfig* shortcutConfig; + MusEWidget::ShortcutConfig* shortcutConfig; Appearance* appearance; AudioMixerApp* mixer1; AudioMixerApp* mixer2; @@ -385,7 +385,7 @@ class MusE : public QMainWindow bool importWaveToTrack(QString& name, unsigned tick=0, Track* track=NULL); void importPartToTrack(QString& filename, unsigned tick, Track* track); void showTransport(bool flag); - RoutePopupMenu* getRoutingPopupMenu(); + MusEWidget::RoutePopupMenu* getRoutingPopupMenu(); #ifdef HAVE_LASH void lash_idle_cb (); diff --git a/muse2/muse/appearance.cpp b/muse2/muse/appearance.cpp index 253df1f9..c26f9542 100644 --- a/muse2/muse/appearance.cpp +++ b/muse2/muse/appearance.cpp @@ -765,7 +765,7 @@ void Appearance::removeBackground() void Appearance::addBackground() { QString cur = getenv("HOME"); - QString user_bgfile = getImageFileName(cur, MusEGlobal::image_file_pattern, this, + QString user_bgfile = MusEWidget::getImageFileName(cur, MusEGlobal::image_file_pattern, this, tr("MusE: load image")); bool image_exists = false; diff --git a/muse2/muse/arranger/arranger.cpp b/muse2/muse/arranger/arranger.cpp index d78ac502..6f5ba175 100644 --- a/muse2/muse/arranger/arranger.cpp +++ b/muse2/muse/arranger/arranger.cpp @@ -142,7 +142,7 @@ Arranger::Arranger(QMainWindow* parent, const char* name) label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); label->setIndent(3); toolbar->addWidget(label); - cursorPos = new PosLabel(0); + cursorPos = new MusEWidget::PosLabel(0); cursorPos->setEnabled(false); cursorPos->setFixedHeight(22); toolbar->addWidget(cursorPos); @@ -174,14 +174,14 @@ Arranger::Arranger(QMainWindow* parent, const char* name) // song length is limited to 10000 bars; the real song len is limited // by overflows in tick computations // - lenEntry = new SpinBox(1, 10000, 1); + lenEntry = new MusEWidget::SpinBox(1, 10000, 1); lenEntry->setValue(song->len()); lenEntry->setToolTip(tr("song length - bars")); lenEntry->setWhatsThis(tr("song length - bars")); toolbar->addWidget(lenEntry); connect(lenEntry, SIGNAL(valueChanged(int)), SLOT(songlenChanged(int))); - typeBox = new LabelCombo(tr("Type"), 0); + typeBox = new MusEWidget::LabelCombo(tr("Type"), 0); typeBox->insertItem(0, tr("NO")); typeBox->insertItem(1, tr("GM")); typeBox->insertItem(2, tr("GS")); @@ -199,7 +199,7 @@ Arranger::Arranger(QMainWindow* parent, const char* name) label->setIndent(3); toolbar->addWidget(label); - globalPitchSpinBox = new SpinBox(-127, 127, 1); + globalPitchSpinBox = new MusEWidget::SpinBox(-127, 127, 1); globalPitchSpinBox->setValue(song->globalPitchShift()); globalPitchSpinBox->setToolTip(tr("midi pitch")); globalPitchSpinBox->setWhatsThis(tr("global midi pitch shift")); @@ -211,7 +211,7 @@ Arranger::Arranger(QMainWindow* parent, const char* name) label->setIndent(3); toolbar->addWidget(label); - globalTempoSpinBox = new SpinBox(50, 200, 1, toolbar); + globalTempoSpinBox = new MusEWidget::SpinBox(50, 200, 1, toolbar); globalTempoSpinBox->setSuffix(QString("%")); globalTempoSpinBox->setValue(tempomap.globalTempo()); globalTempoSpinBox->setToolTip(tr("midi tempo")); @@ -237,8 +237,8 @@ Arranger::Arranger(QMainWindow* parent, const char* name) QVBoxLayout* box = new QVBoxLayout(this); box->setContentsMargins(0, 0, 0, 0); box->setSpacing(0); - box->addWidget(hLine(this), Qt::AlignTop); - //QFrame* hline = hLine(this); + box->addWidget(MusEUtil::hLine(this), Qt::AlignTop); + //QFrame* hline = MusEUtil::hLine(this); //hline->setLineWidth(0); //box->addWidget(hline, Qt::AlignTop); @@ -249,7 +249,7 @@ Arranger::Arranger(QMainWindow* parent, const char* name) int xscale = -100; int yscale = 1; - split = new Splitter(Qt::Horizontal, this, "split"); + split = new MusEWidget::Splitter(Qt::Horizontal, this, "split"); split->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding)); box->addWidget(split, 1000); //split->setHandleWidth(10); @@ -291,7 +291,7 @@ Arranger::Arranger(QMainWindow* parent, const char* name) ib->setFocusPolicy(Qt::NoFocus); connect(ib, SIGNAL(toggled(bool)), SLOT(showTrackInfo(bool))); - header = new Header(tracklist, "header"); + header = new MusEWidget::Header(tracklist, "header"); header->setFixedHeight(30); @@ -353,7 +353,7 @@ Arranger::Arranger(QMainWindow* parent, const char* name) tgrid->wadd(1, infoScroll); tgrid->wadd(2, header); tgrid->wadd(3, list); - tgrid->wadd(4, hLine(tracklist)); + tgrid->wadd(4, MusEUtil::hLine(tracklist)); tgrid->wadd(5, ib); //--------------------------------------------------- @@ -361,7 +361,7 @@ Arranger::Arranger(QMainWindow* parent, const char* name) //--------------------------------------------------- int offset = AL::sigmap.ticksMeasure(0); - hscroll = new ScrollScale(-1000, -10, xscale, song->len(), Qt::Horizontal, editor, -offset); + hscroll = new MusEWidget::ScrollScale(-1000, -10, xscale, song->len(), Qt::Horizontal, editor, -offset); hscroll->setFocusPolicy(Qt::NoFocus); ib->setFixedHeight(hscroll->sizeHint().height()); @@ -389,7 +389,7 @@ Arranger::Arranger(QMainWindow* parent, const char* name) egrid->setContentsMargins(0, 0, 0, 0); egrid->setSpacing(0); - time = new MTScale(&_raster, editor, xscale); + time = new MusEWidget::MTScale(&_raster, editor, xscale); time->setOrigin(-offset, 0); canvas = new PartCanvas(&_raster, editor, xscale, yscale); canvas->setBg(MusEConfig::config.partCanvasBg); @@ -410,9 +410,9 @@ Arranger::Arranger(QMainWindow* parent, const char* name) connect(list, SIGNAL(redirectWheelEvent(QWheelEvent*)), canvas, SLOT(redirectedWheelEvent(QWheelEvent*))); //egrid->addMultiCellWidget(time, 0, 0, 0, 1); - //egrid->addMultiCellWidget(hLine(editor), 1, 1, 0, 1); + //egrid->addMultiCellWidget(MusEUtil::hLine(editor), 1, 1, 0, 1); egrid->addWidget(time, 0, 0, 1, 2); - egrid->addWidget(hLine(editor), 1, 0, 1, 2); + egrid->addWidget(MusEUtil::hLine(editor), 1, 0, 1, 2); egrid->addWidget(canvas, 2, 0); egrid->addWidget(vscroll, 2, 1); @@ -1006,14 +1006,14 @@ void Arranger::genTrackInfo(QWidget* parent) noTrackInfo->setGeometry(0, 0, 65, 200); noTrackInfo->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding)); - midiTrackInfo = new MidiTrackInfo(trackInfo); + midiTrackInfo = new MusEWidget::MidiTrackInfo(trackInfo); //midiTrackInfo->setFocusPolicy(Qt::TabFocus); // p4.0.9 //midiTrackInfo->setSizePolicy(QSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum)); trackInfo->addWidget(noTrackInfo, 0); trackInfo->addWidget(midiTrackInfo, 1); trackInfo->addWidget(0, 2); -/// genMidiTrackInfo(); +/// genMusEWidget::MidiTrackInfo(); } //--------------------------------------------------------- @@ -1114,11 +1114,11 @@ void Arranger::keyPressEvent(QKeyEvent* event) void Arranger::horizontalZoomIn() { int mag = hscroll->mag(); - int zoomlvl = ScrollScale::getQuickZoomLevel(mag); + int zoomlvl = MusEWidget::ScrollScale::getQuickZoomLevel(mag); if (zoomlvl < 23) zoomlvl++; - int newmag = ScrollScale::convertQuickZoomLevelToMag(zoomlvl); + int newmag = MusEWidget::ScrollScale::convertQuickZoomLevelToMag(zoomlvl); hscroll->setMag(newmag); @@ -1127,11 +1127,11 @@ void Arranger::horizontalZoomIn() void Arranger::horizontalZoomOut() { int mag = hscroll->mag(); - int zoomlvl = ScrollScale::getQuickZoomLevel(mag); + int zoomlvl = MusEWidget::ScrollScale::getQuickZoomLevel(mag); if (zoomlvl > 1) zoomlvl--; - int newmag = ScrollScale::convertQuickZoomLevelToMag(zoomlvl); + int newmag = MusEWidget::ScrollScale::convertQuickZoomLevelToMag(zoomlvl); hscroll->setMag(newmag); diff --git a/muse2/muse/arranger/arranger.h b/muse2/muse/arranger/arranger.h index da8e4059..77299ef6 100644 --- a/muse2/muse/arranger/arranger.h +++ b/muse2/muse/arranger/arranger.h @@ -39,20 +39,23 @@ class QWheelEvent; class QKeyEvent; //class QStackedWidget; -class Header; class TList; -class ScrollScale; -class MTScale; class Track; class Xml; -class Splitter; -class LabelCombo; -class PosLabel; -class MidiTrackInfo; class TLLayout; class WidgetStack; class AudioStrip; + +namespace MusEWidget { +class Header; +class LabelCombo; +class MidiTrackInfo; +class MTScale; +class PosLabel; +class ScrollScale; +class Splitter; class SpinBox; +} //--------------------------------------------------------- // WidgetStack @@ -84,33 +87,33 @@ class Arranger : public QWidget { int _quant, _raster; PartCanvas* canvas; - ScrollScale* hscroll; + MusEWidget::ScrollScale* hscroll; QScrollBar* vscroll; TList* list; - Header* header; - MTScale* time; - SpinBox* lenEntry; + MusEWidget::Header* header; + MusEWidget::MTScale* time; + MusEWidget::SpinBox* lenEntry; bool showTrackinfoFlag; WidgetStack* trackInfo; //QStackedWidget* trackInfo; QScrollBar* infoScroll; //MidiTrackInfoBase* midiTrackInfo; - MidiTrackInfo* midiTrackInfo; + MusEWidget::MidiTrackInfo* midiTrackInfo; AudioStrip* waveTrackInfo; QWidget* noTrackInfo; TLLayout* tgrid; Track* selected; - LabelCombo* typeBox; + MusEWidget::LabelCombo* typeBox; QToolButton* ib; int trackInfoType; - Splitter* split; + MusEWidget::Splitter* split; ///QMenu* pop; int songType; - PosLabel* cursorPos; - SpinBox* globalTempoSpinBox; - SpinBox* globalPitchSpinBox; + MusEWidget::PosLabel* cursorPos; + MusEWidget::SpinBox* globalTempoSpinBox; + MusEWidget::SpinBox* globalPitchSpinBox; unsigned cursVal; void genTrackInfo(QWidget* parent); diff --git a/muse2/muse/arranger/pcanvas.cpp b/muse2/muse/arranger/pcanvas.cpp index 91a01d8f..0d73ace6 100644 --- a/muse2/muse/arranger/pcanvas.cpp +++ b/muse2/muse/arranger/pcanvas.cpp @@ -84,7 +84,7 @@ QIcon colorRect(const QColor& color, int width, int height) { // NPart //--------------------------------------------------------- -NPart::NPart(Part* e) : CItem(Event(), e) +NPart::NPart(Part* e) : MusEWidget::CItem(Event(), e) { leftBorderTouches = false; rightBorderTouches = false; @@ -274,13 +274,13 @@ void PartCanvas::updateSong(DragType t, int flags) // moveCanvasItems //--------------------------------------------------------- -void PartCanvas::moveCanvasItems(CItemList& items, int dp, int dx, DragType dtype) +void PartCanvas::moveCanvasItems(MusEWidget::CItemList& items, int dp, int dx, DragType dtype) { Undo operations; - for(iCItem ici = items.begin(); ici != items.end(); ++ici) + for(MusEWidget::iCItem ici = items.begin(); ici != items.end(); ++ici) { - CItem* ci = ici->second; + MusEWidget::CItem* ci = ici->second; // If this item's part is in the parts2change list, change the item's part to the new part. //Part* pt = ci->part(); @@ -319,7 +319,7 @@ void PartCanvas::moveCanvasItems(CItemList& items, int dp, int dx, DragType dtyp //--------------------------------------------------------- // Changed by T356. -UndoOp PartCanvas::moveItem(CItem* item, const QPoint& newpos, DragType t) +UndoOp PartCanvas::moveItem(MusEWidget::CItem* item, const QPoint& newpos, DragType t) { UndoOp result; NPart* npart = (NPart*) item; @@ -466,7 +466,7 @@ void PartCanvas::partsChanged() void PartCanvas::updateSelection() { - for (iCItem i = items.begin(); i != items.end(); ++i) { + for (MusEWidget::iCItem i = items.begin(); i != items.end(); ++i) { NPart* part = (NPart*)(i->second); part->part()->setSelected(i->second->isSelected()); } @@ -478,7 +478,7 @@ void PartCanvas::updateSelection() // resizeItem //--------------------------------------------------------- -void PartCanvas::resizeItem(CItem* i, bool noSnap, bool ctrl) +void PartCanvas::resizeItem(MusEWidget::CItem* i, bool noSnap, bool ctrl) { Track* t = ((NPart*)(i))->track(); Part* p = ((NPart*)(i))->part(); @@ -500,7 +500,7 @@ void PartCanvas::resizeItem(CItem* i, bool noSnap, bool ctrl) // first create local Item //--------------------------------------------------------- -CItem* PartCanvas::newItem(const QPoint& pos, int) +MusEWidget::CItem* PartCanvas::newItem(const QPoint& pos, int) { int x = pos.x(); if (x < 0) @@ -544,7 +544,7 @@ CItem* PartCanvas::newItem(const QPoint& pos, int) // newItem //--------------------------------------------------------- -void PartCanvas::newItem(CItem* i, bool noSnap) +void PartCanvas::newItem(MusEWidget::CItem* i, bool noSnap) { Part* p = ((NPart*)(i))->part(); @@ -562,7 +562,7 @@ void PartCanvas::newItem(CItem* i, bool noSnap) // deleteItem //--------------------------------------------------------- -bool PartCanvas::deleteItem(CItem* i) +bool PartCanvas::deleteItem(MusEWidget::CItem* i) { Part* p = ((NPart*)(i))->part(); audio->msgRemovePart(p, true); //Invokes songChanged which calls partsChanged which makes it difficult to delete them there @@ -573,7 +573,7 @@ bool PartCanvas::deleteItem(CItem* i) // splitItem //--------------------------------------------------------- -void PartCanvas::splitItem(CItem* item, const QPoint& pt) +void PartCanvas::splitItem(MusEWidget::CItem* item, const QPoint& pt) { NPart* np = (NPart*) item; Track* t = np->track(); @@ -588,7 +588,7 @@ void PartCanvas::splitItem(CItem* item, const QPoint& pt) // glueItem //--------------------------------------------------------- -void PartCanvas::glueItem(CItem* item) +void PartCanvas::glueItem(MusEWidget::CItem* item) { NPart* np = (NPart*) item; Track* t = np->track(); @@ -600,7 +600,7 @@ void PartCanvas::glueItem(CItem* item) // genItemPopup //--------------------------------------------------------- -QMenu* PartCanvas::genItemPopup(CItem* item) +QMenu* PartCanvas::genItemPopup(MusEWidget::CItem* item) { NPart* npart = (NPart*) item; Track::TrackType trackType = npart->track()->type(); @@ -692,7 +692,7 @@ QMenu* PartCanvas::genItemPopup(CItem* item) // itemPopup //--------------------------------------------------------- -void PartCanvas::itemPopup(CItem* item, int n, const QPoint& pt) +void PartCanvas::itemPopup(MusEWidget::CItem* item, int n, const QPoint& pt) { PartList* pl = new PartList; NPart* npart = (NPart*)(item); @@ -813,7 +813,7 @@ void PartCanvas::itemPopup(CItem* item, int n, const QPoint& pt) curColorIndex = n - 20; bool selfound = false; //Loop through all parts and set color on selected: - for (iCItem i = items.begin(); i != items.end(); i++) { + for (MusEWidget::iCItem i = items.begin(); i != items.end(); i++) { if (i->second->isSelected()) { selfound = true; i->second->part()->setColorIndex(curColorIndex); @@ -845,7 +845,7 @@ void PartCanvas::mousePress(QMouseEvent* event) return; } QPoint pt = event->pos(); - CItem* item = items.find(pt); + MusEWidget::CItem* item = items.find(pt); if (item == 0 && _tool!=MusEWidget::AutomationTool) return; switch (_tool) { @@ -1043,7 +1043,7 @@ void PartCanvas::keyPress(QKeyEvent* event) event->ignore(); // give global accelerators a chance return; } - for (iCItem i = items.begin(); i != items.end(); ++i) { + for (MusEWidget::iCItem i = items.begin(); i != items.end(); ++i) { NPart* part = (NPart*)(i->second); if (part->isSelected()) { curItem=part; @@ -1054,13 +1054,13 @@ void PartCanvas::keyPress(QKeyEvent* event) curItem = (NPart*)items.begin()->second; // just grab the first part } - CItem* newItem = 0; + MusEWidget::CItem* newItem = 0; bool singleSelection = isSingleSelection(); bool add = false; //Locators to selection if (key == shortcuts[SHRT_LOCATORS_TO_SELECTION].key) { - CItem *leftmost = 0, *rightmost = 0; - for (iCItem i = items.begin(); i != items.end(); i++) { + MusEWidget::CItem *leftmost = 0, *rightmost = 0; + for (MusEWidget::iCItem i = items.begin(); i != items.end(); i++) { if (i->second->isSelected()) { // Check leftmost: if (!leftmost) @@ -1096,7 +1096,7 @@ void PartCanvas::keyPress(QKeyEvent* event) Track* track = part->track(); unsigned int tick = part->tick(); bool afterthis = false; - for (iCItem i = items.begin(); i != items.end(); ++i) { + for (MusEWidget::iCItem i = items.begin(); i != items.end(); ++i) { NPart* npart = (NPart*)(i->second); Part* ipart = npart->part(); if (ipart->track() != track) @@ -1124,7 +1124,7 @@ void PartCanvas::keyPress(QKeyEvent* event) Track* track = part->track(); unsigned int tick = part->tick(); - for (iCItem i = items.begin(); i != items.end(); ++i) { + for (MusEWidget::iCItem i = items.begin(); i != items.end(); ++i) { NPart* npart = (NPart*)(i->second); Part* ipart = npart->part(); @@ -1153,7 +1153,7 @@ void PartCanvas::keyPress(QKeyEvent* event) return; } int middle = curItem->x() + curItem->part()->lenTick()/2; - CItem *aboveL = 0, *aboveR = 0; + MusEWidget::CItem *aboveL = 0, *aboveR = 0; //Upper limit: song end, lower limit: song start int ulimit = song->len(); int llimit = 0; @@ -1174,7 +1174,7 @@ void PartCanvas::keyPress(QKeyEvent* event) } if ((aboveL || aboveR) != 0) { //We've hit something - CItem* above = 0; + MusEWidget::CItem* above = 0; above = (aboveL !=0) ? aboveL : aboveR; newItem = above; } @@ -1200,7 +1200,7 @@ void PartCanvas::keyPress(QKeyEvent* event) if (!track) return; - CItem *belowL = 0, *belowR = 0; + MusEWidget::CItem *belowL = 0, *belowR = 0; //Upper limit: song end , lower limit: song start int ulimit = song->len(); int llimit = 0; @@ -1220,7 +1220,7 @@ void PartCanvas::keyPress(QKeyEvent* event) } if ((belowL || belowR) != 0) { //We've hit something - CItem* below = 0; + MusEWidget::CItem* below = 0; below = (belowL !=0) ? belowL : belowR; newItem = below; } @@ -1304,7 +1304,7 @@ void PartCanvas::keyPress(QKeyEvent* event) //--------------------------------------------------------- #if 0 -void PartCanvas::drawItem(QPainter& p, const CItem* item, const QRect& rect) +void PartCanvas::drawItem(QPainter& p, const MusEWidget::CItem* item, const QRect& rect) { int from = rect.x(); int to = from + rect.width(); @@ -1401,7 +1401,7 @@ void PartCanvas::drawItem(QPainter& p, const CItem* item, const QRect& rect) QColor c(Qt::black); c.setAlpha(MusEConfig::config.globalAlphaBlend); QLinearGradient gradient(r.topLeft(), r.bottomLeft()); - // Use a colour only about 20% lighter than black, rather than the 50% we use in gGradientFromQColor + // Use a colour only about 20% lighter than black, rather than the 50% we use in MusEUtil::gGradientFromQColor // and is used in darker()/lighter(), so that it is distinguished a bit better from grey non-part tracks. //c.setRgba(64, 64, 64, c.alpha()); gradient.setColorAt(0, QColor(51, 51, 51, MusEConfig::config.globalAlphaBlend)); @@ -1429,7 +1429,7 @@ void PartCanvas::drawItem(QPainter& p, const CItem* item, const QRect& rect) { QColor c(MusEConfig::config.partColors[cidx]); c.setAlpha(MusEConfig::config.globalAlphaBlend); - brush = QBrush(gGradientFromQColor(c, r.topLeft(), r.bottomLeft())); + brush = QBrush(MusEUtil::gGradientFromQColor(c, r.topLeft(), r.bottomLeft())); } double h = r.height(); @@ -1508,7 +1508,7 @@ void PartCanvas::drawItem(QPainter& p, const CItem* item, const QRect& rect) else color_brightness=223; // too dark: use lighter color QColor c(color_brightness,color_brightness,color_brightness, MusEConfig::config.globalAlphaBlend); - p.setBrush(QBrush(gGradientFromQColor(c, r.topLeft(), r.bottomLeft()))); + p.setBrush(QBrush(MusEUtil::gGradientFromQColor(c, r.topLeft(), r.bottomLeft()))); //p.setBrush(QBrush(c)); if(het & Part::RightEventsHidden) { @@ -1703,7 +1703,7 @@ void PartCanvas::drawItem(QPainter& p, const CItem* item, const QRect& rect) // get the lowest colour in the gradient used to draw the part. QRect rr = map(r); rr.setX(rr.x() + 3); - gGradientFromQColor(MusEConfig::config.partColors[cidx], rr.topLeft(), rr.bottomLeft()).stops().last().second.getRgb(&part_r, &part_g, &part_b); + MusEUtil::gGradientFromQColor(MusEConfig::config.partColors[cidx], rr.topLeft(), rr.bottomLeft()).stops().last().second.getRgb(&part_r, &part_g, &part_b); brightness = part_r*29 + part_g*59 + part_b*12; //bool rev = (brightness < 12000 || part->selected()) && !part->mute() && !item->isMoving(); bool rev = brightness >= 12000 && !part->selected(); @@ -1725,7 +1725,7 @@ void PartCanvas::drawItem(QPainter& p, const CItem* item, const QRect& rect) } #endif -void PartCanvas::drawItem(QPainter& p, const CItem* item, const QRect& rect) +void PartCanvas::drawItem(QPainter& p, const MusEWidget::CItem* item, const QRect& rect) { int from = rect.x(); int to = from + rect.width(); @@ -1826,7 +1826,7 @@ void PartCanvas::drawItem(QPainter& p, const CItem* item, const QRect& rect) QColor c(Qt::black); c.setAlpha(MusEConfig::config.globalAlphaBlend); QLinearGradient gradient(rr.topLeft(), rr.bottomLeft()); - // Use a colour only about 20% lighter than black, rather than the 50% we use in gGradientFromQColor + // Use a colour only about 20% lighter than black, rather than the 50% we use in MusEUtil::gGradientFromQColor // and is used in darker()/lighter(), so that it is distinguished a bit better from grey non-part tracks. //c.setRgba(64, 64, 64, c.alpha()); gradient.setColorAt(0, QColor(51, 51, 51, MusEConfig::config.globalAlphaBlend)); @@ -1847,7 +1847,7 @@ void PartCanvas::drawItem(QPainter& p, const CItem* item, const QRect& rect) { QColor c(MusEConfig::config.partColors[cidx]); c.setAlpha(MusEConfig::config.globalAlphaBlend); - brush = QBrush(gGradientFromQColor(c, rr.topLeft(), rr.bottomLeft())); + brush = QBrush(MusEUtil::gGradientFromQColor(c, rr.topLeft(), rr.bottomLeft())); } int h = rr.height(); @@ -1948,7 +1948,7 @@ void PartCanvas::drawItem(QPainter& p, const CItem* item, const QRect& rect) else color_brightness=180; //255; // too dark: use lighter color QColor c(color_brightness,color_brightness,color_brightness, MusEConfig::config.globalAlphaBlend); - p.setBrush(QBrush(gGradientFromQColor(c, rr.topLeft(), rr.bottomLeft()))); + p.setBrush(QBrush(MusEUtil::gGradientFromQColor(c, rr.topLeft(), rr.bottomLeft()))); //p.setBrush(QBrush(c)); if(het & Part::RightEventsHidden) { @@ -2167,7 +2167,7 @@ void PartCanvas::drawItem(QPainter& p, const CItem* item, const QRect& rect) //QRect rr = map(r); QRect tr = rr; tr.setX(tr.x() + 3); - gGradientFromQColor(MusEConfig::config.partColors[cidx], tr.topLeft(), tr.bottomLeft()).stops().last().second.getRgb(&part_r, &part_g, &part_b); + MusEUtil::gGradientFromQColor(MusEConfig::config.partColors[cidx], tr.topLeft(), tr.bottomLeft()).stops().last().second.getRgb(&part_r, &part_g, &part_b); brightness = part_r*29 + part_g*59 + part_b*12; //bool rev = (brightness < 12000 || part->selected()) && !part->mute() && !item->isMoving(); bool rev = brightness >= 12000 && !part->selected(); @@ -2193,7 +2193,7 @@ void PartCanvas::drawItem(QPainter& p, const CItem* item, const QRect& rect) // draws moving items //--------------------------------------------------------- -void PartCanvas::drawMoving(QPainter& p, const CItem* item, const QRect&) +void PartCanvas::drawMoving(QPainter& p, const MusEWidget::CItem* item, const QRect&) { p.setPen( Qt::black); Part* part = ((NPart*)item)->part(); @@ -2560,7 +2560,7 @@ void PartCanvas::drawWavePart(QPainter& p, void PartCanvas::cmd(int cmd) { PartList pl; - for (iCItem i = items.begin(); i != items.end(); ++i) { + for (MusEWidget::iCItem i = items.begin(); i != items.end(); ++i) { if (!i->second->isSelected()) continue; NPart* npart = (NPart*)(i->second); @@ -2573,7 +2573,7 @@ void PartCanvas::cmd(int cmd) Undo operations; - for (iCItem i = items.begin(); i != items.end(); ++i) { + for (MusEWidget::iCItem i = items.begin(); i != items.end(); ++i) { if (i->second->isSelected()) { NPart* p = (NPart*)(i->second); Part* part = p->part(); @@ -2895,7 +2895,7 @@ Undo PartCanvas::movePartsTotheRight(unsigned int startTicks, int length) Undo operations; // all parts that start after the pasted parts will be moved the entire length of the pasted parts - for (iCItem i = items.begin(); i != items.end(); ++i) { + for (MusEWidget::iCItem i = items.begin(); i != items.end(); ++i) { if (!i->second->isSelected()) { Part* part = i->second->part(); if (part->tick() >= startTicks) { @@ -2925,7 +2925,7 @@ Undo PartCanvas::movePartsTotheRight(unsigned int startTicks, int length) // startDrag //--------------------------------------------------------- -void PartCanvas::startDrag(CItem* item, DragType t) +void PartCanvas::startDrag(MusEWidget::CItem* item, DragType t) { NPart* p = (NPart*)(item); Part* part = p->part(); diff --git a/muse2/muse/arranger/pcanvas.h b/muse2/muse/arranger/pcanvas.h index 4f154a97..927a64e1 100644 --- a/muse2/muse/arranger/pcanvas.h +++ b/muse2/muse/arranger/pcanvas.h @@ -45,7 +45,7 @@ class QDragEnterEvent; // for displaying //--------------------------------------------------------- -class NPart : public CItem { +class NPart : public MusEWidget::CItem { public: NPart(Part* e); const QString name() const { return part()->name(); } @@ -98,30 +98,30 @@ class PartCanvas : public MusEWidget::Canvas { virtual void mouseRelease(const QPoint&); virtual void viewMouseDoubleClickEvent(QMouseEvent*); virtual void leaveEvent(QEvent*e); - virtual void drawItem(QPainter&, const CItem*, const QRect&); - virtual void drawMoving(QPainter&, const CItem*, const QRect&); + virtual void drawItem(QPainter&, const MusEWidget::CItem*, const QRect&); + virtual void drawMoving(QPainter&, const MusEWidget::CItem*, const QRect&); virtual void updateSelection(); virtual QPoint raster(const QPoint&) const; virtual int y2pitch(int y) const; virtual int pitch2y(int p) const; - virtual CItem* newItem(const QPoint&, int); - virtual void resizeItem(CItem*,bool, bool ctrl); - virtual void newItem(CItem*,bool); - virtual bool deleteItem(CItem*); - virtual void moveCanvasItems(CItemList&, int, int, DragType); - virtual UndoOp moveItem(CItem*, const QPoint&, DragType); + virtual MusEWidget::CItem* newItem(const QPoint&, int); + virtual void resizeItem(MusEWidget::CItem*,bool, bool ctrl); + virtual void newItem(MusEWidget::CItem*,bool); + virtual bool deleteItem(MusEWidget::CItem*); + virtual void moveCanvasItems(MusEWidget::CItemList&, int, int, DragType); + virtual UndoOp moveItem(MusEWidget::CItem*, const QPoint&, DragType); virtual void updateSong(DragType, int); - virtual void startDrag(CItem*, DragType); + virtual void startDrag(MusEWidget::CItem*, DragType); virtual void dragEnterEvent(QDragEnterEvent*); virtual void viewDropEvent(QDropEvent*); - virtual QMenu* genItemPopup(CItem*); - virtual void itemPopup(CItem*, int, const QPoint&); + virtual QMenu* genItemPopup(MusEWidget::CItem*); + virtual void itemPopup(MusEWidget::CItem*, int, const QPoint&); - void glueItem(CItem* item); - void splitItem(CItem* item, const QPoint&); + void glueItem(MusEWidget::CItem* item); + void splitItem(MusEWidget::CItem* item, const QPoint&); void copy(PartList*); void paste(bool clone = false, bool toTrack = true, bool doInsert=false); diff --git a/muse2/muse/arranger/tlist.cpp b/muse2/muse/arranger/tlist.cpp index 4199e135..db83ad71 100644 --- a/muse2/muse/arranger/tlist.cpp +++ b/muse2/muse/arranger/tlist.cpp @@ -78,7 +78,7 @@ QColor collist[] = { Qt::red, Qt::yellow, Qt::blue , Qt::black, Qt::white, Qt::g // TList //--------------------------------------------------------- -TList::TList(Header* hdr, QWidget* parent, const char* name) +TList::TList(MusEWidget::Header* hdr, QWidget* parent, const char* name) : QWidget(parent) // Qt::WNoAutoErase | Qt::WResizeNoErase are no longer needed according to Qt4 doc { setBackgroundRole(QPalette::NoRole); @@ -570,7 +570,7 @@ void TList::portsPopupMenu(Track* t, int x, int y) { MidiTrack* track = (MidiTrack*)t; - //QPopupMenu* p = midiPortsPopup(0); + //QMusEWidget::PopupMenu* p = midiPortsPopup(0); MidiDevice* md = 0; int port = -1; if(t->type() == Track::AUDIO_SOFTSYNTH) @@ -953,10 +953,10 @@ void TList::changeAutomationColor(QAction* act) // colorMenu //--------------------------------------------------------- //QMenu* TList::colorMenu(QColor c, int id) -PopupMenu* TList::colorMenu(QColor c, int id) +MusEWidget::PopupMenu* TList::colorMenu(QColor c, int id) { //QMenu * m = new QMenu(this); - PopupMenu * m = new PopupMenu(this); //, true); TODO + MusEWidget::PopupMenu * m = new MusEWidget::PopupMenu(this); //, true); TODO for (int i = 0; i< 6; i++) { QPixmap pix(10,10); QPainter p(&pix); @@ -1160,7 +1160,7 @@ void TList::mousePressEvent(QMouseEvent* ev) { if (!t->isMidiTrack()) { editAutomation = t; - PopupMenu* p = new PopupMenu(true); + MusEWidget::PopupMenu* p = new MusEWidget::PopupMenu(true); p->disconnect(); p->clear(); p->setTitle(tr("Viewable automation")); @@ -1178,7 +1178,7 @@ void TList::mousePressEvent(QMouseEvent* ev) data += 150; // illegal color > 100 act->setData(data); //QMenu *m = colorMenu(cl->color(), cl->id()); - PopupMenu *m = colorMenu(cl->color(), cl->id()); + MusEWidget::PopupMenu *m = colorMenu(cl->color(), cl->id()); act->setMenu(m); } connect(p, SIGNAL(triggered(QAction*)), SLOT(changeAutomation(QAction*))); @@ -1306,7 +1306,7 @@ void TList::mousePressEvent(QMouseEvent* ev) case 1: // show track comment { - TrackComment* tc = new TrackComment(t, 0); + MusEWidget::TrackComment* tc = new MusEWidget::TrackComment(t, 0); tc->show(); //QToolTip::add( this, "FOOOOOOOOOOOOO" ); } diff --git a/muse2/muse/arranger/tlist.h b/muse2/muse/arranger/tlist.h index 44b2ecc9..970df420 100644 --- a/muse2/muse/arranger/tlist.h +++ b/muse2/muse/arranger/tlist.h @@ -36,12 +36,15 @@ class QResizeEvent; class QScrollBar; class QWheelEvent; //class QMenu; -class PopupMenu; class ScrollScale; class Track; class Xml; + +namespace MusEWidget { class Header; +class PopupMenu; +} enum TrackColumn { COL_RECORD = 0, @@ -70,7 +73,7 @@ class TList : public QWidget { QPixmap bgPixmap; // background Pixmap bool resizeFlag; // true if resize cursor is shown - Header* header; + MusEWidget::Header* header; QScrollBar* _scroll; QLineEdit* editor; QSpinBox* chan_edit; @@ -105,7 +108,7 @@ class TList : public QWidget { TrackList getRecEnabledTracks(); void setHeaderToolTips(); //QMenu* colorMenu(QColor c, int id); - PopupMenu* colorMenu(QColor c, int id); + MusEWidget::PopupMenu* colorMenu(QColor c, int id); private slots: void returnPressed(); @@ -130,7 +133,7 @@ class TList : public QWidget { void selectTrackBelow(); public: - TList(Header*, QWidget* parent, const char* name); + TList(MusEWidget::Header*, QWidget* parent, const char* name); void setScroll(QScrollBar* s) { _scroll = s; } Track* track() const { return editTrack; } void writeStatus(int level, Xml&, const char* name) const; diff --git a/muse2/muse/audio.cpp b/muse2/muse/audio.cpp index 09acb425..a82fbe13 100644 --- a/muse2/muse/audio.cpp +++ b/muse2/muse/audio.cpp @@ -48,7 +48,10 @@ #include "pos.h" #include "ticksynth.h" +namespace MusEUtil { extern double curTime(); +} + Audio* audio; AudioDevice* audioDevice; // current audio device in use @@ -508,7 +511,7 @@ void Audio::process(unsigned frames) // resync with audio interface // syncFrame = audioDevice->framePos(); - syncTime = curTime(); + syncTime = MusEUtil::curTime(); frameOffset = syncFrame - samplePos; //printf("Audio::process calling process1:\n"); @@ -769,7 +772,7 @@ void Audio::processMsg(AudioMsg* msg) _pos.setTick(curTickPos); int samplePos = _pos.frame(); syncFrame = audioDevice->framePos(); - syncTime = curTime(); + syncTime = MusEUtil::curTime(); frameOffset = syncFrame - samplePos; } break; @@ -1473,7 +1476,7 @@ void Audio::recordStop() unsigned int Audio::curFrame() const { - return lrint((curTime() - syncTime) * MusEGlobal::sampleRate) + syncFrame; + return lrint((MusEUtil::curTime() - syncTime) * MusEGlobal::sampleRate) + syncFrame; } //--------------------------------------------------------- diff --git a/muse2/muse/conf.cpp b/muse2/muse/conf.cpp index 69a36d9b..25f74448 100644 --- a/muse2/muse/conf.cpp +++ b/muse2/muse/conf.cpp @@ -1486,8 +1486,8 @@ void MusE::writeConfiguration(int level, Xml& xml) const void MusE::configMidiSync() { if (!midiSyncConfig) - //midiSyncConfig = new MidiSyncConfig(this); - midiSyncConfig = new MidiSyncConfig; + //midiSyncConfig = new MusEWidget::MidiSyncConfig(this); + midiSyncConfig = new MusEWidget::MidiSyncConfig; if (midiSyncConfig->isVisible()) { midiSyncConfig->raise(); @@ -1522,7 +1522,7 @@ void MusE::configMidiFile() void MusE::configGlobalSettings() { if (!globalSettingsConfig) - globalSettingsConfig = new GlobalSettingsConfig(); + globalSettingsConfig = new MusEWidget::GlobalSettingsConfig(); if (globalSettingsConfig->isVisible()) { globalSettingsConfig->raise(); diff --git a/muse2/muse/confmport.cpp b/muse2/muse/confmport.cpp index b451a749..42fb5276 100644 --- a/muse2/muse/confmport.cpp +++ b/muse2/muse/confmport.cpp @@ -130,7 +130,7 @@ void MPConfig::changeDefInputRoutes(QAction* act) else chbits = defch ^ (1 << actid); midiPorts[no].setDefaultInChannels(chbits); - mdevView->item(item->row(), DEVCOL_DEF_IN_CHANS)->setText(bitmap2String(chbits)); + mdevView->item(item->row(), DEVCOL_DEF_IN_CHANS)->setText(MusEUtil::bitmap2String(chbits)); } } @@ -217,7 +217,7 @@ void MPConfig::changeDefOutputRoutes(QAction* act) else chbits = defch ^ (1 << actid); midiPorts[no].setDefaultOutChannels(chbits); - mdevView->item(item->row(), DEVCOL_DEF_OUT_CHANS)->setText(bitmap2String(chbits)); + mdevView->item(item->row(), DEVCOL_DEF_OUT_CHANS)->setText(MusEUtil::bitmap2String(chbits)); #else if(actid < MIDI_CHANNELS) { @@ -226,7 +226,7 @@ void MPConfig::changeDefOutputRoutes(QAction* act) setPortExclusiveDefOutChan(no, chbits); int j = mdevView->rowCount(); for(int i = 0; i < j; ++i) - mdevView->item(i, DEVCOL_DEF_OUT_CHANS)->setText(bitmap2String(i == no ? chbits : 0)); + mdevView->item(i, DEVCOL_DEF_OUT_CHANS)->setText(MusEUtil::bitmap2String(i == no ? chbits : 0)); if(defpup) { QAction* a; @@ -624,8 +624,8 @@ void MPConfig::rbClicked(QTableWidgetItem* item) return; #else { - defpup = new PopupMenu(this, true); - defpup->addAction(new MenuTitleItem("Channel", defpup)); + defpup = new MusEWidget::PopupMenu(this, true); + defpup->addAction(new MusEWidget::MenuTitleItem("Channel", defpup)); QAction* act = 0; int chbits = midiPorts[no].defaultInChannels(); for(int i = 0; i < MIDI_CHANNELS; ++i) @@ -647,7 +647,7 @@ void MPConfig::rbClicked(QTableWidgetItem* item) act->setEnabled(!song->midis()->empty()); // && midiPorts[no].device()); connect(defpup, SIGNAL(triggered(QAction*)), SLOT(changeDefInputRoutes(QAction*))); - //connect(defpup, SIGNAL(aboutToHide()), MusEGlobal::muse, SLOT(routingPopupMenuAboutToHide())); + //connect(defpup, SIGNAL(aboutToHide()), MusEGlobal::muse, SLOT(routingMusEWidget::PopupMenuAboutToHide())); //defpup->popup(QCursor::pos()); defpup->exec(QCursor::pos()); delete defpup; @@ -664,8 +664,8 @@ void MPConfig::rbClicked(QTableWidgetItem* item) return; #else { - defpup = new PopupMenu(this, true); - defpup->addAction(new MenuTitleItem("Channel", defpup)); + defpup = new MusEWidget::PopupMenu(this, true); + defpup->addAction(new MusEWidget::MenuTitleItem("Channel", defpup)); QAction* act = 0; int chbits = midiPorts[no].defaultOutChannels(); for(int i = 0; i < MIDI_CHANNELS; ++i) @@ -690,7 +690,7 @@ void MPConfig::rbClicked(QTableWidgetItem* item) act->setEnabled(!song->midis()->empty()); // && midiPorts[no].device()); connect(defpup, SIGNAL(triggered(QAction*)), SLOT(changeDefOutputRoutes(QAction*))); - //connect(defpup, SIGNAL(aboutToHide()), MusEGlobal::muse, SLOT(routingPopupMenuAboutToHide())); + //connect(defpup, SIGNAL(aboutToHide()), MusEGlobal::muse, SLOT(routingMusEWidget::PopupMenuAboutToHide())); //defpup->popup(QCursor::pos()); defpup->exec(QCursor::pos()); delete defpup; @@ -772,7 +772,7 @@ void MPConfig::rbClicked(QTableWidgetItem* item) //if(!mapALSA.empty()) { pup->addSeparator(); - pup->addAction(new MenuTitleItem(QT_TRANSLATE_NOOP("@default", "ALSA:"), pup)); + pup->addAction(new MusEWidget::MenuTitleItem(QT_TRANSLATE_NOOP("@default", "ALSA:"), pup)); for(imap i = mapALSA.begin(); i != mapALSA.end(); ++i) { @@ -798,7 +798,7 @@ void MPConfig::rbClicked(QTableWidgetItem* item) if(!mapSYNTH.empty()) { pup->addSeparator(); - pup->addAction(new MenuTitleItem(QT_TRANSLATE_NOOP("@default", "SYNTH:"), pup)); + pup->addAction(new MusEWidget::MenuTitleItem(QT_TRANSLATE_NOOP("@default", "SYNTH:"), pup)); for(imap i = mapSYNTH.begin(); i != mapSYNTH.end(); ++i) { @@ -824,7 +824,7 @@ void MPConfig::rbClicked(QTableWidgetItem* item) //if(!mapJACK.empty()) { pup->addSeparator(); - pup->addAction(new MenuTitleItem(QT_TRANSLATE_NOOP("@default", "JACK:"), pup)); + pup->addAction(new MusEWidget::MenuTitleItem(QT_TRANSLATE_NOOP("@default", "JACK:"), pup)); for(imap i = mapJACK.begin(); i != mapJACK.end(); ++i) { @@ -1179,10 +1179,10 @@ void MPConfig::songChanged(int flags) QTableWidgetItem* itemin = new QTableWidgetItem; addItem(i, DEVCOL_INROUTES, itemin, mdevView); itemin->setFlags(Qt::ItemIsEnabled); - //QTableWidgetItem* itemdefin = new QTableWidgetItem(bitmap2String(port->defaultInChannels())); + //QTableWidgetItem* itemdefin = new QTableWidgetItem(MusEUtil::bitmap2String(port->defaultInChannels())); // Ignore synth devices. Default input routes make no sense for them (right now). QTableWidgetItem* itemdefin = new QTableWidgetItem((dev && dev->isSynti()) ? - QString() : bitmap2String(port->defaultInChannels())); + QString() : MusEUtil::bitmap2String(port->defaultInChannels())); addItem(i, DEVCOL_DEF_IN_CHANS, itemdefin, mdevView); // Enabled: Use editor (not good). Disabled: Use pop-up menu. #if 0 @@ -1199,12 +1199,12 @@ void MPConfig::songChanged(int flags) // Turn on if and when multiple output routes are supported. #if 0 - QTableWidgetItem* itemdefout = new QTableWidgetItem(bitmap2String(port->defaultOutChannels())); + QTableWidgetItem* itemdefout = new QTableWidgetItem(MusEUtil::bitmap2String(port->defaultOutChannels())); addItem(i, DEVCOL_DEF_OUT_CHANS, itemdefout, mdevView); itemdefout->setFlags(Qt::ItemIsEditable | Qt::ItemIsEnabled); #else //QTableWidgetItem* itemdefout = new QTableWidgetItem(QString("--")); - QTableWidgetItem* itemdefout = new QTableWidgetItem(bitmap2String(0)); + QTableWidgetItem* itemdefout = new QTableWidgetItem(MusEUtil::bitmap2String(0)); defochs = port->defaultOutChannels(); if(defochs) { diff --git a/muse2/muse/confmport.h b/muse2/muse/confmport.h index e6ea5f0e..3e286b60 100644 --- a/muse2/muse/confmport.h +++ b/muse2/muse/confmport.h @@ -34,9 +34,12 @@ class QTableWidget; class QPoint; class QMenu; class QAction; -class PopupMenu; class Xml; +namespace MusEWidget { +class PopupMenu; +} + //--------------------------------------------------------- // MPConfig // Midi Port Config @@ -46,7 +49,7 @@ class MPConfig : public QDialog, Ui::SynthConfigBase { Q_OBJECT QMenu* instrPopup; //QMenu* popup; - PopupMenu* defpup; + MusEWidget::PopupMenu* defpup; int _showAliases; // -1: None. 0: First aliases. 1: Second aliases etc. void setWhatsThis(QTableWidgetItem *item, int col); void setToolTip(QTableWidgetItem *item, int col); diff --git a/muse2/muse/ctrl/ctrlcanvas.h b/muse2/muse/ctrl/ctrlcanvas.h index 8846d2ce..c9baf752 100644 --- a/muse2/muse/ctrl/ctrlcanvas.h +++ b/muse2/muse/ctrl/ctrlcanvas.h @@ -95,7 +95,7 @@ class CEventList: public std::list<CEvent*> { // CtrlCanvas //--------------------------------------------------------- -class CtrlCanvas : public View { +class CtrlCanvas : public MusEWidget::View { Q_OBJECT MidiEditor* editor; diff --git a/muse2/muse/ctrl/ctrledit.cpp b/muse2/muse/ctrl/ctrledit.cpp index c9c33999..61f87d28 100644 --- a/muse2/muse/ctrl/ctrledit.cpp +++ b/muse2/muse/ctrl/ctrledit.cpp @@ -55,7 +55,7 @@ CtrlEdit::CtrlEdit(QWidget* parent, MidiEditor* e, int xmag, QHBoxLayout* hbox = new QHBoxLayout; panel = new CtrlPanel(0, e, "panel"); canvas = new CtrlCanvas(e, 0, xmag, "ctrlcanvas", panel); - QWidget* vscale = new VScale; + QWidget* vscale = new MusEWidget::VScale; hbox->setContentsMargins(0, 0, 0, 0); hbox->setSpacing (0); diff --git a/muse2/muse/ctrl/ctrlpanel.cpp b/muse2/muse/ctrl/ctrlpanel.cpp index 998058d7..cb18afad 100644 --- a/muse2/muse/ctrl/ctrlpanel.cpp +++ b/muse2/muse/ctrl/ctrlpanel.cpp @@ -111,7 +111,7 @@ CtrlPanel::CtrlPanel(QWidget* parent, MidiEditor* e, const char* name) _val = CTRL_VAL_UNKNOWN; _dnum = -1; - _knob = new Knob; + _knob = new MusEWidget::Knob; _knob->setFixedWidth(25); _knob->setFixedHeight(25); _knob->setToolTip(tr("manual adjust")); @@ -121,7 +121,7 @@ CtrlPanel::CtrlPanel(QWidget* parent, MidiEditor* e, const char* name) _knob->hide(); _knob->setAltFaceColor(Qt::red); - _dl = new DoubleLabel(-1.0, 0.0, +127.0); + _dl = new MusEWidget::DoubleLabel(-1.0, 0.0, +127.0); _dl->setPrecision(0); _dl->setToolTip(tr("double click on/off")); _dl->setSpecialText(tr("off")); @@ -184,7 +184,7 @@ void CtrlPanel::heartBeat() int v = mp->hwCtrlState(chan, _dnum); if(v == CTRL_VAL_UNKNOWN) { - // DoubleLabel ignores the value if already set... + // MusEWidget::DoubleLabel ignores the value if already set... _dl->setValue(_dl->off() - 1.0); _val = CTRL_VAL_UNKNOWN; v = mp->lastValidHWCtrlState(chan, _dnum); @@ -210,7 +210,7 @@ void CtrlPanel::heartBeat() _val = v; if(v == CTRL_VAL_UNKNOWN || ((_dnum == CTRL_PROGRAM) && ((v & 0xff) == 0xff) )) { - // DoubleLabel ignores the value if already set... + // MusEWidget::DoubleLabel ignores the value if already set... //_dl->setValue(double(_ctrl->minVal() - 1)); _dl->setValue(_dl->off() - 1.0); } @@ -774,10 +774,10 @@ void CtrlPanel::ctrlPopup() } } - PopupMenu* ctrlMainPop = new PopupMenu; + MusEWidget::PopupMenu* ctrlMainPop = new MusEWidget::PopupMenu; //ctrlMainPop->addSeparator(); - ctrlMainPop->addAction(new MenuTitleItem(tr("Instrument-defined"), ctrlMainPop)); + ctrlMainPop->addAction(new MusEWidget::MenuTitleItem(tr("Instrument-defined"), ctrlMainPop)); //ctrlMainPop->addAction(QIcon(*configureIcon), tr("Add ..."))->setData(max + 1); @@ -796,7 +796,7 @@ void CtrlPanel::ctrlPopup() //ctrlMainPop->addAction(QIcon(*midi_edit_instrumentIcon), tr("Edit instruments"))->setData(max + 2); ctrlMainPop->addSeparator(); - ctrlMainPop->addAction(new MenuTitleItem(tr("Others"), ctrlMainPop)); + ctrlMainPop->addAction(new MusEWidget::MenuTitleItem(tr("Others"), ctrlMainPop)); //ctrlMainPop->addAction(QIcon(*configureIcon), tr("Add ..."))->setData(max + 3); @@ -834,8 +834,8 @@ void CtrlPanel::ctrlPopup() } else if (rv == max + 1) { // add new instrument controller - PopupMenu * ctrlSubPop = new PopupMenu(this); - ctrlSubPop->addAction(new MenuTitleItem(tr("Instrument-defined"), ctrlSubPop)); + MusEWidget::PopupMenu * ctrlSubPop = new MusEWidget::PopupMenu(this); + ctrlSubPop->addAction(new MusEWidget::MenuTitleItem(tr("Instrument-defined"), ctrlSubPop)); // // populate popup with all controllers available for @@ -906,8 +906,8 @@ void CtrlPanel::ctrlPopup() // MusEGlobal::muse->startEditInstrument(); else if (rv == max + 3) { // add new other controller - PopupMenu* ctrlSubPop = new PopupMenu(this); - ctrlSubPop->addAction(new MenuTitleItem(tr("Common Controls"), ctrlSubPop)); + MusEWidget::PopupMenu* ctrlSubPop = new MusEWidget::PopupMenu(this); + ctrlSubPop->addAction(new MusEWidget::MenuTitleItem(tr("Common Controls"), ctrlSubPop)); for(int num = 0; num < 127; ++num) if(cll->find(channel, num) == cll->end()) diff --git a/muse2/muse/ctrl/ctrlpanel.h b/muse2/muse/ctrl/ctrlpanel.h index 58282b64..0376a245 100644 --- a/muse2/muse/ctrl/ctrlpanel.h +++ b/muse2/muse/ctrl/ctrlpanel.h @@ -29,9 +29,12 @@ class MidiController; class QPushButton; -class MidiEditor; +namespace MusEWidget { class Knob; class DoubleLabel; +} + +class MidiEditor; class MidiPort; class MidiTrack; @@ -50,8 +53,8 @@ class CtrlPanel: public QWidget { MidiController* _ctrl; int _dnum; bool inHeartBeat; - Knob* _knob; - DoubleLabel* _dl; + MusEWidget::Knob* _knob; + MusEWidget::DoubleLabel* _dl; int _val; diff --git a/muse2/muse/driver/dummyaudio.cpp b/muse2/muse/driver/dummyaudio.cpp index 77b08252..4466e293 100644 --- a/muse2/muse/driver/dummyaudio.cpp +++ b/muse2/muse/driver/dummyaudio.cpp @@ -140,7 +140,7 @@ class DummyAudioDevice : public AudioDevice { return _framePos; } virtual unsigned frameTime() const { - return lrint(curTime() * MusEGlobal::sampleRate); + return lrint(MusEUtil::curTime() * MusEGlobal::sampleRate); } virtual bool isRealtime() { return realtimeFlag; } //virtual int realtimePriority() const { return 40; } @@ -221,7 +221,7 @@ DummyAudioDevice::DummyAudioDevice() realtimeFlag = false; seekflag = false; state = Audio::STOP; - //startTime = curTime(); + //startTime = MusEUtil::curTime(); _framePos = 0; playPos = 0; cmdQueue.clear(); diff --git a/muse2/muse/driver/jack.cpp b/muse2/muse/driver/jack.cpp index f99e07b9..31179ea3 100644 --- a/muse2/muse/driver/jack.cpp +++ b/muse2/muse/driver/jack.cpp @@ -1868,11 +1868,11 @@ bool JackAudioDevice::dummySync(int state) //timespec ts = { 0, (1000000000 * MusEGlobal::segmentSize) / MusEGlobal::sampleRate }; // In nanoseconds. unsigned int sl = (1000000 * MusEGlobal::segmentSize) / MusEGlobal::sampleRate; // In microseconds. - double ct = curTime(); + double ct = MusEUtil::curTime(); // Wait for a default maximum of 5 seconds. // Similar to how Jack is supposed to wait a default of 2 seconds for slow clients. // TODO: Make this timeout a 'settings' option so it can be applied both to Jack and here. - while((curTime() - ct) < 5.0) + while((MusEUtil::curTime() - ct) < 5.0) { // Is MusE audio ready to roll? if(audio->sync(state, dummyPos)) diff --git a/muse2/muse/dssihost.cpp b/muse2/muse/dssihost.cpp index 9787f3f0..1f7009a4 100644 --- a/muse2/muse/dssihost.cpp +++ b/muse2/muse/dssihost.cpp @@ -3419,7 +3419,7 @@ const char* DssiSynthIF::getPatchName(int /*chan*/, int prog, MType /*type*/, bo //--------------------------------------------------------- //void DssiSynthIF::populatePatchPopup(QMenu* menu, int) -void DssiSynthIF::populatePatchPopup(PopupMenu* menu, int /*ch*/, MType /*type*/, bool /*drum*/) +void DssiSynthIF::populatePatchPopup(MusEWidget::PopupMenu* menu, int /*ch*/, MType /*type*/, bool /*drum*/) { // The plugin can change the programs, patches etc. // So make sure we're up to date by calling queryPrograms. diff --git a/muse2/muse/dssihost.h b/muse2/muse/dssihost.h index d84a9716..802e0e95 100644 --- a/muse2/muse/dssihost.h +++ b/muse2/muse/dssihost.h @@ -211,7 +211,7 @@ class DssiSynthIF : public SynthIF, public PluginIBase //virtual void populatePatchPopup(QMenu*, int); //virtual void populatePatchPopup(QMenu*, int, MType, bool); - virtual void populatePatchPopup(PopupMenu*, int, MType, bool); + virtual void populatePatchPopup(MusEWidget::PopupMenu*, int, MType, bool); //virtual void write(Xml& xml) const; virtual void write(int level, Xml& xml) const; diff --git a/muse2/muse/exportmidi.cpp b/muse2/muse/exportmidi.cpp index 332ad026..450aa992 100644 --- a/muse2/muse/exportmidi.cpp +++ b/muse2/muse/exportmidi.cpp @@ -136,7 +136,7 @@ namespace MusEApp { void MusE::exportMidi() { - MFile file(QString("midis"), QString(".mid")); + MusEWidget::MFile file(QString("midis"), QString(".mid")); //FILE* fp = file.open("w", midi_file_pattern, this, false, true, FILE* fp = file.open("w", MusEGlobal::midi_file_save_pattern, this, false, true, diff --git a/muse2/muse/functions.cpp b/muse2/muse/functions.cpp index 52c27629..b178bcb6 100644 --- a/muse2/muse/functions.cpp +++ b/muse2/muse/functions.cpp @@ -45,29 +45,29 @@ using namespace std; -GateTime* gatetime_dialog=NULL; -Velocity* velocity_dialog=NULL; -Quantize* quantize_dialog=NULL; -Remove* erase_dialog=NULL; -DelOverlaps* del_overlaps_dialog=NULL; -Setlen* set_notelen_dialog=NULL; -Move* move_notes_dialog=NULL; -Transpose* transpose_dialog=NULL; -Crescendo* crescendo_dialog=NULL; -Legato* legato_dialog=NULL; +MusEDialog::GateTime* gatetime_dialog=NULL; +MusEDialog::Velocity* velocity_dialog=NULL; +MusEDialog::Quantize* quantize_dialog=NULL; +MusEDialog::Remove* erase_dialog=NULL; +MusEDialog::DelOverlaps* del_overlaps_dialog=NULL; +MusEDialog::Setlen* set_notelen_dialog=NULL; +MusEDialog::Move* move_notes_dialog=NULL; +MusEDialog::Transpose* transpose_dialog=NULL; +MusEDialog::Crescendo* crescendo_dialog=NULL; +MusEDialog::Legato* legato_dialog=NULL; void init_function_dialogs(QWidget* parent) { - gatetime_dialog = new GateTime(parent); - velocity_dialog = new Velocity(parent); - quantize_dialog = new Quantize(parent); - erase_dialog = new Remove(parent); - del_overlaps_dialog = new DelOverlaps(parent); - set_notelen_dialog = new Setlen(parent); - move_notes_dialog = new Move(parent); - transpose_dialog = new Transpose(parent); - crescendo_dialog = new Crescendo(parent); - legato_dialog = new Legato(parent); + gatetime_dialog = new MusEDialog::GateTime(parent); + velocity_dialog = new MusEDialog::Velocity(parent); + quantize_dialog = new MusEDialog::Quantize(parent); + erase_dialog = new MusEDialog::Remove(parent); + del_overlaps_dialog = new MusEDialog::DelOverlaps(parent); + set_notelen_dialog = new MusEDialog::Setlen(parent); + move_notes_dialog = new MusEDialog::Move(parent); + transpose_dialog = new MusEDialog::Transpose(parent); + crescendo_dialog = new MusEDialog::Crescendo(parent); + legato_dialog = new MusEDialog::Legato(parent); } set<Part*> partlist_to_set(PartList* pl) diff --git a/muse2/muse/functions.h b/muse2/muse/functions.h index 04b95b0f..6a74b21d 100644 --- a/muse2/muse/functions.h +++ b/muse2/muse/functions.h @@ -41,16 +41,17 @@ class QString; class QMimeData; class Undo; -extern GateTime* gatetime_dialog; -extern Velocity* velocity_dialog; -extern Quantize* quantize_dialog; -extern Remove* erase_dialog; -extern DelOverlaps* del_overlaps_dialog; -extern Setlen* set_notelen_dialog; -extern Move* move_notes_dialog; -extern Transpose* transpose_dialog; -extern Crescendo* crescendo_dialog; -extern Legato* legato_dialog; +extern MusEDialog::GateTime* gatetime_dialog; +extern MusEDialog::Velocity* velocity_dialog; +extern MusEDialog::Quantize* quantize_dialog; +extern MusEDialog::Remove* erase_dialog; +extern MusEDialog::DelOverlaps* del_overlaps_dialog; +extern MusEDialog::Setlen* set_notelen_dialog; +extern MusEDialog::Move* move_notes_dialog; +extern MusEDialog::Transpose* transpose_dialog; +extern MusEDialog::Crescendo* crescendo_dialog; +extern MusEDialog::Legato* legato_dialog; + void init_function_dialogs(QWidget* parent); diff --git a/muse2/muse/importmidi.cpp b/muse2/muse/importmidi.cpp index abf64fe2..c7c02253 100644 --- a/muse2/muse/importmidi.cpp +++ b/muse2/muse/importmidi.cpp @@ -70,7 +70,7 @@ void MusE::importMidi(const QString &file) { QString fn; if (file.isEmpty()) { - fn = getOpenFileName(MusEGlobal::lastMidiPath, MusEGlobal::midi_file_pattern, this, + fn = MusEWidget::getOpenFileName(MusEGlobal::lastMidiPath, MusEGlobal::midi_file_pattern, this, tr("MusE: Import Midi"), 0); if (fn.isEmpty()) return; @@ -106,7 +106,7 @@ void MusE::importMidi(const QString &file) bool MusE::importMidi(const QString name, bool merge) { bool popenFlag; - FILE* fp = fileOpen(this, name, QString(".mid"), "r", popenFlag); + FILE* fp = MusEWidget::fileOpen(this, name, QString(".mid"), "r", popenFlag); if (fp == 0) return true; MidiFile mf(fp); @@ -479,7 +479,7 @@ void MusE::importPart() if (track) { bool loadAll; - QString filename = getOpenFileName(QString(""), MusEGlobal::part_file_pattern, this, tr("MusE: load part"), &loadAll); + QString filename = MusEWidget::getOpenFileName(QString(""), MusEGlobal::part_file_pattern, this, tr("MusE: load part"), &loadAll); if (!filename.isEmpty()){ // Make a backup of the current clone list, to retain any 'copy' items, // so that pasting works properly after. @@ -509,7 +509,7 @@ void MusE::importPartToTrack(QString& filename, unsigned tick, Track* track) // Changed by T356 /* bool popenFlag = false; - FILE* fp = fileOpen(this, filename, ".mpt", "r", popenFlag, false, false); + FILE* fp = MusEWidget::fileOpen(this, filename, ".mpt", "r", popenFlag, false, false); if(fp) { @@ -548,7 +548,7 @@ void MusE::importPartToTrack(QString& filename, unsigned tick, Track* track) bool popenFlag = false; - FILE* fp = fileOpen(this, filename, ".mpt", "r", popenFlag, false, false); + FILE* fp = MusEWidget::fileOpen(this, filename, ".mpt", "r", popenFlag, false, false); if(fp) { diff --git a/muse2/muse/instruments/minstrument.cpp b/muse2/muse/instruments/minstrument.cpp index 299f76bb..dfdf94c6 100644 --- a/muse2/muse/instruments/minstrument.cpp +++ b/muse2/muse/instruments/minstrument.cpp @@ -934,7 +934,7 @@ QString MidiInstrument::getPatchName(int channel, int prog, MType mode, bool dru // populatePatchPopup //--------------------------------------------------------- -void MidiInstrument::populatePatchPopup(PopupMenu* menu, int chan, MType songType, bool drum) +void MidiInstrument::populatePatchPopup(MusEWidget::PopupMenu* menu, int chan, MType songType, bool drum) { menu->clear(); int mask = 0; @@ -959,7 +959,7 @@ void MidiInstrument::populatePatchPopup(PopupMenu* menu, int chan, MType songTyp for (ciPatchGroup i = pg.begin(); i != pg.end(); ++i) { PatchGroup* pgp = *i; //QMenu* pm = menu->addMenu(pgp->name); - PopupMenu* pm = new PopupMenu(pgp->name, menu, menu->stayOpen()); // Use the parent stayOpen here. + MusEWidget::PopupMenu* pm = new MusEWidget::PopupMenu(pgp->name, menu, menu->stayOpen()); // Use the parent stayOpen here. menu->addMenu(pm); pm->setFont(MusEConfig::config.fonts[0]); const PatchList& pl = pgp->patches; diff --git a/muse2/muse/instruments/minstrument.h b/muse2/muse/instruments/minstrument.h index 640351f8..e7800eea 100644 --- a/muse2/muse/instruments/minstrument.h +++ b/muse2/muse/instruments/minstrument.h @@ -28,14 +28,17 @@ #include <list> #include <vector> +class QString; + class MidiPort; -//class QMenu; -class PopupMenu; class MidiPlayEvent; class Xml; class EventList; class MidiControllerList; -class QString; + +namespace MusEWidget { +class PopupMenu; +} //--------------------------------------------------------- // Patch @@ -138,7 +141,7 @@ class MidiInstrument { virtual void reset(int, MType); virtual QString getPatchName(int,int,MType,bool); //virtual void populatePatchPopup(QMenu*, int, MType, bool); - virtual void populatePatchPopup(PopupMenu*, int, MType, bool); + virtual void populatePatchPopup(MusEWidget::PopupMenu*, int, MType, bool); void read(Xml&); void write(int level, Xml&); diff --git a/muse2/muse/liste/editevent.cpp b/muse2/muse/liste/editevent.cpp index 0da0bbcb..e211e7f7 100644 --- a/muse2/muse/liste/editevent.cpp +++ b/muse2/muse/liste/editevent.cpp @@ -312,7 +312,7 @@ EditMetaDialog::EditMetaDialog(int tick, const Event& ev, epos = new Awl::PosEdit; QLabel* l2 = new QLabel(tr("Meta Type")); - il2 = new IntLabel(-1, 0, 127, this, -1); + il2 = new MusEWidget::IntLabel(-1, 0, 127, this, -1); il2->setFixedWidth(100); il2->setFrame(true); il2->setDark(); @@ -447,7 +447,7 @@ EditCAfterDialog::EditCAfterDialog(int tick, const Event& event, epos = new Awl::PosEdit; QLabel* l2 = new QLabel(tr("Pressure")); - il2 = new IntLabel(-1, 0, 127, this, -1); + il2 = new MusEWidget::IntLabel(-1, 0, 127, this, -1); il2->setFrame(true); il2->setDark(); @@ -506,9 +506,9 @@ EditPAfterDialog::EditPAfterDialog(int tick, const Event& event, epos = new Awl::PosEdit; QLabel* l2 = new QLabel(tr("Pitch")); - pl = new PitchEdit; + pl = new MusEWidget::PitchEdit; QLabel* l3 = new QLabel(tr("Pressure")); - il2 = new IntLabel(-1, 0, 127, this, -1); + il2 = new MusEWidget::IntLabel(-1, 0, 127, this, -1); il2->setFrame(true); il2->setDark(); @@ -696,7 +696,7 @@ EditCtrlDialog::EditCtrlDialog(int tick, const Event& event, void EditCtrlDialog::newController() { //QMenu* pup = new QMenu(this); - PopupMenu* pup = new PopupMenu(this); + MusEWidget::PopupMenu* pup = new MusEWidget::PopupMenu(this); //pup->setCheckable(this);//not necessary in Qt4 // // populate popup with all controllers available for @@ -871,7 +871,7 @@ void EditCtrlDialog::instrPopup() ///instr->populatePatchPopup(pop, channel, song->mtype(), track->type() == Track::DRUM); //QMenu* pup = new QMenu(this); - PopupMenu* pup = new PopupMenu(this); + MusEWidget::PopupMenu* pup = new MusEWidget::PopupMenu(this); instr->populatePatchPopup(pup, channel, song->mtype(), track->type() == Track::DRUM); ///if(pop->actions().count() == 0) diff --git a/muse2/muse/liste/editevent.h b/muse2/muse/liste/editevent.h index 454d81bc..02befe7e 100644 --- a/muse2/muse/liste/editevent.h +++ b/muse2/muse/liste/editevent.h @@ -33,8 +33,11 @@ namespace Awl { }; ///class PosEdit; +namespace MusEWidget { class IntLabel; class PitchEdit; +} + class QDialog; class QLabel; class QGridLayout; @@ -143,7 +146,7 @@ class EditMetaDialog : public EditEventDialog { ///PosEdit* epos; Awl::PosEdit* epos; QTextEdit* edit; - IntLabel* il2; + MusEWidget::IntLabel* il2; QRadioButton* hexButton; QLabel* typeLabel; @@ -173,7 +176,7 @@ class EditCAfterDialog : public EditEventDialog { ///PosEdit* epos; Awl::PosEdit* epos; - IntLabel* il2; + MusEWidget::IntLabel* il2; protected: QGridLayout* layout; @@ -195,8 +198,8 @@ class EditPAfterDialog : public EditEventDialog { ///PosEdit* epos; Awl::PosEdit* epos; - PitchEdit* pl; - IntLabel* il2; + MusEWidget::PitchEdit* pl; + MusEWidget::IntLabel* il2; protected: QGridLayout* layout; diff --git a/muse2/muse/liste/listedit.cpp b/muse2/muse/liste/listedit.cpp index cfc7132f..37989ca9 100644 --- a/muse2/muse/liste/listedit.cpp +++ b/muse2/muse/liste/listedit.cpp @@ -381,7 +381,7 @@ QString EventListItem::text(int col) const break; case 4: if (event.isNote() || event.type() == PAfter) - s = pitch2string(event.dataA()); + s = pitch2string(event.dataA()); else if (event.type() == Controller) s.setNum(event.dataA() & 0xffff); // mask off type bits else diff --git a/muse2/muse/master/master.h b/muse2/muse/master/master.h index 9cdbf6cc..4f181755 100644 --- a/muse2/muse/master/master.h +++ b/muse2/muse/master/master.h @@ -40,7 +40,7 @@ class ScrollScale; // Master //--------------------------------------------------------- -class Master : public View { +class Master : public MusEWidget::View { Q_OBJECT enum DragMode { DRAG_OFF, DRAG_NEW, DRAG_MOVE_START, DRAG_MOVE, DRAG_DELETE, DRAG_COPY_START, DRAG_COPY, diff --git a/muse2/muse/master/masteredit.cpp b/muse2/muse/master/masteredit.cpp index 3e400399..1a737476 100644 --- a/muse2/muse/master/masteredit.cpp +++ b/muse2/muse/master/masteredit.cpp @@ -137,11 +137,11 @@ MasterEdit::MasterEdit() label->setIndent(3); info->addWidget(label); - cursorPos = new PosLabel(0); + cursorPos = new MusEWidget::PosLabel(0); cursorPos->setFixedHeight(22); cursorPos->setToolTip(tr("time at cursor position")); info->addWidget(cursorPos); - tempo = new TempoLabel(0); + tempo = new MusEWidget::TempoLabel(0); tempo->setFixedHeight(22); tempo->setToolTip(tr("tempo at cursor position")); info->addWidget(tempo); @@ -149,7 +149,7 @@ MasterEdit::MasterEdit() const char* rastval[] = { QT_TRANSLATE_NOOP("@default", "Off"), "Bar", "1/2", "1/4", "1/8", "1/16" }; - rasterLabel = new LabelCombo(tr("Snap"), 0); + rasterLabel = new MusEWidget::LabelCombo(tr("Snap"), 0); rasterLabel->setFocusPolicy(Qt::NoFocus); for (int i = 0; i < 6; i++) rasterLabel->insertItem(i, tr(rastval[i])); @@ -159,7 +159,7 @@ MasterEdit::MasterEdit() //---------values for current position--------------- info->addWidget(new QLabel(tr("CurPos "))); - curTempo = new TempoEdit(0); + curTempo = new MusEWidget::TempoEdit(0); curSig = new SigEdit(0); curSig->setValue(AL::TimeSignature(4, 4)); curTempo->setToolTip(tr("tempo at current position")); @@ -178,17 +178,17 @@ MasterEdit::MasterEdit() int xscale = -20; int yscale = -500; - hscroll = new ScrollScale(-100, -2, xscale, song->len(), Qt::Horizontal, mainw); - vscroll = new ScrollScale(-1000, -100, yscale, 120000, Qt::Vertical, mainw); + hscroll = new MusEWidget::ScrollScale(-100, -2, xscale, song->len(), Qt::Horizontal, mainw); + vscroll = new MusEWidget::ScrollScale(-1000, -100, yscale, 120000, Qt::Vertical, mainw); vscroll->setRange(30000, 250000); - time1 = new MTScale(&_raster, mainw, xscale); - sign = new SigScale(&_raster, mainw, xscale); -// thits = new HitScale(&_raster, mainw, xscale); + time1 = new MusEWidget::MTScale(&_raster, mainw, xscale); + sign = new MusEWidget::SigScale(&_raster, mainw, xscale); +// thits = new MusEWidget::HitScale(&_raster, mainw, xscale); canvas = new Master(this, mainw, xscale, yscale); -// zhits = new HitScale(&_raster, mainw, xscale); - time2 = new MTScale(&_raster, mainw, xscale); +// zhits = new MusEWidget::HitScale(&_raster, mainw, xscale); + time2 = new MusEWidget::MTScale(&_raster, mainw, xscale); tscale = new TScale(mainw, yscale); time2->setBarLocator(true); @@ -201,18 +201,18 @@ MasterEdit::MasterEdit() mainGrid->setRowStretch(5, 100); mainGrid->setColumnStretch(1, 100); - mainGrid->addWidget(hLine(mainw), 0, 1); + mainGrid->addWidget(MusEUtil::hLine(mainw), 0, 1); mainGrid->addWidget(time1, 1, 1); - mainGrid->addWidget(hLine(mainw), 2, 1); + mainGrid->addWidget(MusEUtil::hLine(mainw), 2, 1); mainGrid->addWidget(sign, 3, 1); - mainGrid->addWidget(hLine(mainw), 4, 1); + mainGrid->addWidget(MusEUtil::hLine(mainw), 4, 1); // mainGrid->addWidget(thits, 5, 1); -// mainGrid->addWidget(hLine(mainw), 6, 1); +// mainGrid->addWidget(MusEUtil::hLine(mainw), 6, 1); mainGrid->addWidget(canvas, 5, 1); mainGrid->addWidget(tscale, 5, 0); - mainGrid->addWidget(hLine(mainw), 6, 1); + mainGrid->addWidget(MusEUtil::hLine(mainw), 6, 1); // mainGrid->addWidget(zhits, 9, 1); -// mainGrid->addWidget(hLine(mainw), 7, 1); +// mainGrid->addWidget(MusEUtil::hLine(mainw), 7, 1); mainGrid->addWidget(time2, 7, 1); mainGrid->addWidget(hscroll, 8, 1); mainGrid->addWidget(vscroll, 0, 2, 10, 1); diff --git a/muse2/muse/master/masteredit.h b/muse2/muse/master/masteredit.h index 311bedbf..c4846f78 100644 --- a/muse2/muse/master/masteredit.h +++ b/muse2/muse/master/masteredit.h @@ -40,15 +40,18 @@ class QToolBar; class QToolButton; class Master; -class ScrollScale; -class MTScale; -class SigScale; -class HitScale; class TScale; -class TempoEdit; + +namespace MusEWidget { +class HitScale; class LabelCombo; +class MTScale; class PosLabel; +class ScrollScale; +class SigScale; +class TempoEdit; class TempoLabel; +} //--------------------------------------------------------- // MasterEdit @@ -58,21 +61,21 @@ class MasterEdit : public MidiEditor { Q_OBJECT Master* canvas; - ScrollScale* hscroll; - ScrollScale* vscroll; - MTScale* time1; - MTScale* time2; - SigScale* sign; - HitScale* thits; - HitScale* zhits; + MusEWidget::ScrollScale* hscroll; + MusEWidget::ScrollScale* vscroll; + MusEWidget::MTScale* time1; + MusEWidget::MTScale* time2; + MusEWidget::SigScale* sign; + MusEWidget::HitScale* thits; + MusEWidget::HitScale* zhits; TScale* tscale; - TempoEdit* curTempo; + MusEWidget::TempoEdit* curTempo; SigEdit* curSig; - LabelCombo* rasterLabel; + MusEWidget::LabelCombo* rasterLabel; QToolBar* tools; - PosLabel* cursorPos; - TempoLabel* tempo; + MusEWidget::PosLabel* cursorPos; + MusEWidget::TempoLabel* tempo; QToolButton* enableButton; static int _rasterInit; diff --git a/muse2/muse/master/tscale.h b/muse2/muse/master/tscale.h index 19aacae9..2c03839f 100644 --- a/muse2/muse/master/tscale.h +++ b/muse2/muse/master/tscale.h @@ -29,7 +29,7 @@ // Tscale //--------------------------------------------------------- -class TScale : public View { +class TScale : public MusEWidget::View { Q_OBJECT double curTempo; diff --git a/muse2/muse/midiedit/dcanvas.cpp b/muse2/muse/midiedit/dcanvas.cpp index da8bb884..11d8958e 100644 --- a/muse2/muse/midiedit/dcanvas.cpp +++ b/muse2/muse/midiedit/dcanvas.cpp @@ -115,7 +115,7 @@ DrumCanvas::DrumCanvas(MidiEditor* pr, QWidget* parent, int sx, // moveCanvasItems //--------------------------------------------------------- -Undo DrumCanvas::moveCanvasItems(CItemList& items, int dp, int dx, DragType dtype) +Undo DrumCanvas::moveCanvasItems(MusEWidget::CItemList& items, int dp, int dx, DragType dtype) { if(editor->parts()->empty()) return Undo(); //return empty list @@ -130,9 +130,9 @@ Undo DrumCanvas::moveCanvasItems(CItemList& items, int dp, int dx, DragType dtyp continue; int npartoffset = 0; - for(iCItem ici = items.begin(); ici != items.end(); ++ici) + for(MusEWidget::iCItem ici = items.begin(); ici != items.end(); ++ici) { - CItem* ci = ici->second; + MusEWidget::CItem* ci = ici->second; if(ci->part() != part) continue; @@ -185,12 +185,12 @@ Undo DrumCanvas::moveCanvasItems(CItemList& items, int dp, int dx, DragType dtyp if (!forbidden) { - std::vector< CItem* > doneList; - typedef std::vector< CItem* >::iterator iDoneList; + std::vector< MusEWidget::CItem* > doneList; + typedef std::vector< MusEWidget::CItem* >::iterator iDoneList; - for(iCItem ici = items.begin(); ici != items.end(); ++ici) + for(MusEWidget::iCItem ici = items.begin(); ici != items.end(); ++ici) { - CItem* ci = ici->second; + MusEWidget::CItem* ci = ici->second; int x = ci->pos().x(); int y = ci->pos().y(); @@ -240,7 +240,7 @@ Undo DrumCanvas::moveCanvasItems(CItemList& items, int dp, int dx, DragType dtyp // moveItem //--------------------------------------------------------- -UndoOp DrumCanvas::moveItem(CItem* item, const QPoint& pos, DragType dtype) +UndoOp DrumCanvas::moveItem(MusEWidget::CItem* item, const QPoint& pos, DragType dtype) { DEvent* nevent = (DEvent*) item; @@ -274,7 +274,7 @@ UndoOp DrumCanvas::moveItem(CItem* item, const QPoint& pos, DragType dtype) // newItem //--------------------------------------------------------- -CItem* DrumCanvas::newItem(const QPoint& p, int state) +MusEWidget::CItem* DrumCanvas::newItem(const QPoint& p, int state) { int instr = y2pitch(p.y()); //drumInmap[y2pitch(p.y())]; int velo = drumMap[instr].lv4; @@ -292,7 +292,7 @@ CItem* DrumCanvas::newItem(const QPoint& p, int state) // newItem //--------------------------------------------------------- -CItem* DrumCanvas::newItem(int tick, int instrument, int velocity) +MusEWidget::CItem* DrumCanvas::newItem(int tick, int instrument, int velocity) { tick -= curPart->tick(); Event e(Note); @@ -307,7 +307,7 @@ CItem* DrumCanvas::newItem(int tick, int instrument, int velocity) // resizeItem //--------------------------------------------------------- -void DrumCanvas::resizeItem(CItem* item, bool, bool) +void DrumCanvas::resizeItem(MusEWidget::CItem* item, bool, bool) { DEvent* nevent = (DEvent*) item; Event ev = nevent->event(); @@ -318,11 +318,11 @@ void DrumCanvas::resizeItem(CItem* item, bool, bool) //--------------------------------------------------------- // newItem //--------------------------------------------------------- -void DrumCanvas::newItem(CItem* item, bool noSnap) { +void DrumCanvas::newItem(MusEWidget::CItem* item, bool noSnap) { newItem(item, noSnap,false); } -void DrumCanvas::newItem(CItem* item, bool noSnap, bool replace) +void DrumCanvas::newItem(MusEWidget::CItem* item, bool noSnap, bool replace) { DEvent* nevent = (DEvent*) item; Event event = nevent->event(); @@ -383,7 +383,7 @@ void DrumCanvas::newItem(CItem* item, bool noSnap, bool replace) // deleteItem //--------------------------------------------------------- -bool DrumCanvas::deleteItem(CItem* item) +bool DrumCanvas::deleteItem(MusEWidget::CItem* item) { Event ev = ((DEvent*)item)->event(); // Indicate do undo, and do not do port controller values and clone parts. @@ -395,7 +395,7 @@ bool DrumCanvas::deleteItem(CItem* item) // drawItem //--------------------------------------------------------- -void DrumCanvas::drawItem(QPainter&p, const CItem*item, const QRect& rect) +void DrumCanvas::drawItem(QPainter&p, const MusEWidget::CItem*item, const QRect& rect) { DEvent* e = (DEvent*) item; int x = 0, y = 0; @@ -453,7 +453,7 @@ void DrumCanvas::drawItem(QPainter&p, const CItem*item, const QRect& rect) // draws moving items //--------------------------------------------------------- -void DrumCanvas::drawMoving(QPainter& p, const CItem* item, const QRect& rect) +void DrumCanvas::drawMoving(QPainter& p, const MusEWidget::CItem* item, const QRect& rect) { QPolygon pa(4); QPoint pt = map(item->mp()); @@ -545,7 +545,7 @@ void DrumCanvas::cmd(int cmd) { switch (cmd) { case CMD_SELECT_ALL: // select all - for (iCItem k = items.begin(); k != items.end(); ++k) { + for (MusEWidget::iCItem k = items.begin(); k != items.end(); ++k) { if (!k->second->isSelected()) selectItem(k->second, true); } @@ -554,12 +554,12 @@ void DrumCanvas::cmd(int cmd) deselectAll(); break; case CMD_SELECT_INVERT: // invert selection - for (iCItem k = items.begin(); k != items.end(); ++k) { + for (MusEWidget::iCItem k = items.begin(); k != items.end(); ++k) { selectItem(k->second, !k->second->isSelected()); } break; case CMD_SELECT_ILOOP: // select inside loop - for (iCItem k = items.begin(); k != items.end(); ++k) { + for (MusEWidget::iCItem k = items.begin(); k != items.end(); ++k) { DEvent* nevent =(DEvent*)(k->second); Part* part = nevent->part(); Event event = nevent->event(); @@ -571,7 +571,7 @@ void DrumCanvas::cmd(int cmd) } break; case CMD_SELECT_OLOOP: // select outside loop - for (iCItem k = items.begin(); k != items.end(); ++k) { + for (MusEWidget::iCItem k = items.begin(); k != items.end(); ++k) { DEvent* nevent = (DEvent*)(k->second); Part* part = nevent->part(); Event event = nevent->event(); @@ -628,7 +628,7 @@ void DrumCanvas::cmd(int cmd) if (!selectionSize()) break; song->startUndo(); - for (iCItem k = items.begin(); k != items.end(); ++k) { + for (MusEWidget::iCItem k = items.begin(); k != items.end(); ++k) { if (k->second->isSelected()) { DEvent* devent = (DEvent*)(k->second); Event event = devent->event(); @@ -687,7 +687,7 @@ void DrumCanvas::cmd(int cmd) // startDrag //--------------------------------------------------------- -void DrumCanvas::startDrag(CItem* /* item*/, bool copymode) +void DrumCanvas::startDrag(MusEWidget::CItem* /* item*/, bool copymode) { QMimeData* md = selected_events_to_mime(partlist_to_set(editor->parts()), 1); @@ -868,11 +868,11 @@ void DrumCanvas::resizeEvent(QResizeEvent* ev) // modifySelected //--------------------------------------------------------- -void DrumCanvas::modifySelected(NoteInfo::ValType type, int delta) +void DrumCanvas::modifySelected(MusEWidget::NoteInfo::ValType type, int delta) { audio->msgIdle(true); song->startUndo(); - for (iCItem i = items.begin(); i != items.end(); ++i) { + for (MusEWidget::iCItem i = items.begin(); i != items.end(); ++i) { if (!(i->second->isSelected())) continue; DEvent* e = (DEvent*)(i->second); @@ -884,7 +884,7 @@ void DrumCanvas::modifySelected(NoteInfo::ValType type, int delta) Event newEvent = event.clone(); switch (type) { - case NoteInfo::VAL_TIME: + case MusEWidget::NoteInfo::VAL_TIME: { int newTime = event.tick() + delta; if (newTime < 0) @@ -892,16 +892,16 @@ void DrumCanvas::modifySelected(NoteInfo::ValType type, int delta) newEvent.setTick(newTime); } break; - case NoteInfo::VAL_LEN: - printf("DrumCanvas::modifySelected - NoteInfo::VAL_LEN not implemented\n"); + case MusEWidget::NoteInfo::VAL_LEN: + printf("DrumCanvas::modifySelected - MusEWidget::NoteInfo::VAL_LEN not implemented\n"); break; - case NoteInfo::VAL_VELON: - printf("DrumCanvas::modifySelected - NoteInfo::VAL_VELON not implemented\n"); + case MusEWidget::NoteInfo::VAL_VELON: + printf("DrumCanvas::modifySelected - MusEWidget::NoteInfo::VAL_VELON not implemented\n"); break; - case NoteInfo::VAL_VELOFF: - printf("DrumCanvas::modifySelected - NoteInfo::VAL_VELOFF not implemented\n"); + case MusEWidget::NoteInfo::VAL_VELOFF: + printf("DrumCanvas::modifySelected - MusEWidget::NoteInfo::VAL_VELOFF not implemented\n"); break; - case NoteInfo::VAL_PITCH: + case MusEWidget::NoteInfo::VAL_PITCH: { int pitch = event.pitch() - delta; // Reversing order since the drumlist is displayed in increasing order if (pitch > 127) @@ -1084,7 +1084,7 @@ Event *DrumCanvas::getEventAtCursorPos() //--------------------------------------------------------- void DrumCanvas::selectCursorEvent(Event *ev) { - for (iCItem i = items.begin(); i != items.end(); ++i) + for (MusEWidget::iCItem i = items.begin(); i != items.end(); ++i) { Event e = i->second->event(); @@ -1103,7 +1103,7 @@ void DrumCanvas::moveAwayUnused() using std::set; set<int> used; - for (iCItem it=items.begin(); it!=items.end(); it++) + for (MusEWidget::iCItem it=items.begin(); it!=items.end(); it++) { const Event& ev=it->second->event(); diff --git a/muse2/muse/midiedit/dcanvas.h b/muse2/muse/midiedit/dcanvas.h index 5d308426..0256de01 100644 --- a/muse2/muse/midiedit/dcanvas.h +++ b/muse2/muse/midiedit/dcanvas.h @@ -43,7 +43,7 @@ class MidiEditor; // ''visual'' Drum Event //--------------------------------------------------------- -class DEvent : public CItem { +class DEvent : public MusEWidget::CItem { public: DEvent(Event e, Part* p); }; @@ -66,21 +66,21 @@ class DrumCanvas : public EventCanvas { virtual void drawCanvas(QPainter&, const QRect&); - virtual void drawItem(QPainter&, const CItem*, const QRect&); + virtual void drawItem(QPainter&, const MusEWidget::CItem*, const QRect&); void drawTopItem(QPainter& p, const QRect& rect); - virtual void drawMoving(QPainter&, const CItem*, const QRect&); - virtual Undo moveCanvasItems(CItemList&, int, int, DragType); - virtual UndoOp moveItem(CItem*, const QPoint&, DragType); - virtual CItem* newItem(const QPoint&, int); - virtual void resizeItem(CItem*, bool, bool); - virtual void newItem(CItem*, bool); - virtual void newItem(CItem*, bool, bool replace ); - virtual bool deleteItem(CItem*); - CItem* newItem(int tick, int instrument, int velocity); + virtual void drawMoving(QPainter&, const MusEWidget::CItem*, const QRect&); + virtual Undo moveCanvasItems(MusEWidget::CItemList&, int, int, DragType); + virtual UndoOp moveItem(MusEWidget::CItem*, const QPoint&, DragType); + virtual MusEWidget::CItem* newItem(const QPoint&, int); + virtual void resizeItem(MusEWidget::CItem*, bool, bool); + virtual void newItem(MusEWidget::CItem*, bool); + virtual void newItem(MusEWidget::CItem*, bool, bool replace ); + virtual bool deleteItem(MusEWidget::CItem*); + MusEWidget::CItem* newItem(int tick, int instrument, int velocity); int y2pitch(int y) const; int pitch2y(int pitch) const; - void startDrag(CItem*, bool copymode); + void startDrag(MusEWidget::CItem*, bool copymode); void dragEnterEvent(QDragEnterEvent* event); void dragMoveEvent(QDragMoveEvent*); void dragLeaveEvent(QDragLeaveEvent*); @@ -115,7 +115,7 @@ class DrumCanvas : public EventCanvas { DrumCanvas(MidiEditor*, QWidget*, int, int, const char* name = 0); void cmd(int); - virtual void modifySelected(NoteInfo::ValType type, int delta); + virtual void modifySelected(MusEWidget::NoteInfo::ValType type, int delta); virtual void keyPress(QKeyEvent* event); Event *getEventAtCursorPos(); void selectCursorEvent(Event *ev); diff --git a/muse2/muse/midiedit/dlist.cpp b/muse2/muse/midiedit/dlist.cpp index ee563edd..165bb4cb 100644 --- a/muse2/muse/midiedit/dlist.cpp +++ b/muse2/muse/midiedit/dlist.cpp @@ -90,10 +90,10 @@ void DList::draw(QPainter& p, const QRect& rect) s.setNum(dm->len); break; case COL_ANOTE: - s = pitch2string(dm->anote); + s = pitch2string(dm->anote); break; case COL_ENOTE: - s = pitch2string(dm->enote); + s = pitch2string(dm->enote); break; case COL_LV1: s.setNum(dm->lv1); @@ -739,7 +739,7 @@ void DList::songChanged(int flags) //--------------------------------------------------------- DList::DList(QHeaderView* h, QWidget* parent, int ymag) - : View(parent, 1, ymag) + : MusEWidget::View(parent, 1, ymag) { setBg(Qt::white); if (!h){ diff --git a/muse2/muse/midiedit/dlist.h b/muse2/muse/midiedit/dlist.h index a622fbda..0fb1fd0b 100644 --- a/muse2/muse/midiedit/dlist.h +++ b/muse2/muse/midiedit/dlist.h @@ -84,7 +84,7 @@ class DPitchEdit: public Awl::PitchEdit // DList //--------------------------------------------------------- -class DList : public View { +class DList : public MusEWidget::View { Q_OBJECT QHeaderView* header; diff --git a/muse2/muse/midiedit/drumedit.cpp b/muse2/muse/midiedit/drumedit.cpp index e7fafac4..e8997367 100644 --- a/muse2/muse/midiedit/drumedit.cpp +++ b/muse2/muse/midiedit/drumedit.cpp @@ -351,24 +351,24 @@ DrumEdit::DrumEdit(PartList* pl, QWidget* parent, const char* name, unsigned ini addToolBarBreak(); // don't show pitch value in toolbar - toolbar = new Toolbar1(this, _rasterInit, false); + toolbar = new MusEWidget::Toolbar1(this, _rasterInit, false); addToolBar(toolbar); addToolBarBreak(); - info = new NoteInfo(this); + info = new MusEWidget::NoteInfo(this); addToolBar(info); //--------------------------------------------------- // split //--------------------------------------------------- - split1 = new Splitter(Qt::Vertical, mainw, "split1"); + split1 = new MusEWidget::Splitter(Qt::Vertical, mainw, "split1"); QPushButton* ctrl = new QPushButton(tr("ctrl"), mainw); ctrl->setObjectName("Ctrl"); ctrl->setFont(MusEConfig::config.fonts[3]); - //hscroll = new ScrollScale(-25, -2, xscale, 20000, Qt::Horizontal, mainw); + //hscroll = new MusEWidget::ScrollScale(-25, -2, xscale, 20000, Qt::Horizontal, mainw); // Increased scale to -1. To resolve/select/edit 1-tick-wide (controller graph) events. p4.0.18 Tim. - hscroll = new ScrollScale(-25, -1, xscale, 20000, Qt::Horizontal, mainw); + hscroll = new MusEWidget::ScrollScale(-25, -1, xscale, 20000, Qt::Horizontal, mainw); ctrl->setFixedSize(40, hscroll->sizeHint().height()); ctrl->setToolTip(tr("Add Controller View")); @@ -385,7 +385,7 @@ DrumEdit::DrumEdit(PartList* pl, QWidget* parent, const char* name, unsigned ini // mainGrid->addRowSpacing(1, hscroll->sizeHint().height()); // mainGrid->addItem(new QSpacerItem(0, hscroll->sizeHint().height()), 1, 0); - split2 = new Splitter(Qt::Horizontal, split1, "split2"); + split2 = new MusEWidget::Splitter(Qt::Horizontal, split1, "split2"); split1w1 = new QWidget(split2); QWidget* split1w2 = new QWidget(split2); QGridLayout* gridS1 = new QGridLayout(split1w1); @@ -394,9 +394,9 @@ DrumEdit::DrumEdit(PartList* pl, QWidget* parent, const char* name, unsigned ini gridS1->setSpacing(0); gridS2->setContentsMargins(0, 0, 0, 0); gridS2->setSpacing(0); - time = new MTScale(&_raster, split1w2, xscale); + time = new MusEWidget::MTScale(&_raster, split1w2, xscale); canvas = new DrumCanvas(this, split1w2, xscale, yscale); - vscroll = new ScrollScale(-4, 1, yscale, DRUM_MAPSIZE*TH, Qt::Vertical, split1w2); + vscroll = new MusEWidget::ScrollScale(-4, 1, yscale, DRUM_MAPSIZE*TH, Qt::Vertical, split1w2); int offset = -(MusEConfig::config.division/4); canvas->setOrigin(offset, 0); canvas->setCanvasTools(drumeditTools); @@ -412,20 +412,20 @@ DrumEdit::DrumEdit(PartList* pl, QWidget* parent, const char* name, unsigned ini split2->setSizes(mops); // By T356. Not much choice but to disable this for now, to stop runaway resize bug. // Can't seem to get the splitter to readjust when manually setting sizes. - //split2->setResizeMode(split1w1, QSplitter::KeepSize); + //split2->setResizeMode(split1w1, QMusEWidget::Splitter::KeepSize); gridS2->setRowStretch(1, 100); gridS2->setColumnStretch(0, 100); gridS2->addWidget(time, 0, 0, 1, 2); - gridS2->addWidget(hLine(split1w2), 1, 0, 1, 2); + gridS2->addWidget(MusEUtil::hLine(split1w2), 1, 0, 1, 2); gridS2->addWidget(canvas, 2, 0); gridS2->addWidget(vscroll, 2, 1); // // Reihenfolge in dlist.c festgeschrieben ("Dcols") // - header = new Header(split1w1, "header"); + header = new MusEWidget::Header(split1w1, "header"); header->setFixedHeight(31); header->setColumnLabel(tr("M"), COL_MUTE, 20); header->setColumnLabel(tr("Sound"), COL_NAME, 120); @@ -492,7 +492,7 @@ DrumEdit::DrumEdit(PartList* pl, QWidget* parent, const char* name, unsigned ini connect(time, SIGNAL(timeChanged(unsigned)), SLOT(setTime(unsigned))); connect(toolbar, SIGNAL(rasterChanged(int)), SLOT(setRaster(int))); connect(toolbar, SIGNAL(soloChanged(bool)), SLOT(soloChanged(bool))); - connect(info, SIGNAL(valueChanged(NoteInfo::ValType, int)), SLOT(noteinfoChanged(NoteInfo::ValType, int))); + connect(info, SIGNAL(valueChanged(MusEWidget::NoteInfo::ValType, int)), SLOT(noteinfoChanged(MusEWidget::NoteInfo::ValType, int))); connect(ctrl, SIGNAL(clicked()), SLOT(addCtrl())); @@ -642,7 +642,7 @@ void DrumEdit::setRaster(int val) // edit currently selected Event //--------------------------------------------------------- -void DrumEdit::noteinfoChanged(NoteInfo::ValType type, int val) +void DrumEdit::noteinfoChanged(MusEWidget::NoteInfo::ValType type, int val) { if (selEvent.empty()) { printf("noteinfoChanged while note is zero %d\n", type); @@ -650,19 +650,19 @@ void DrumEdit::noteinfoChanged(NoteInfo::ValType type, int val) } Event event = selEvent.clone(); switch (type) { - case NoteInfo::VAL_TIME: + case MusEWidget::NoteInfo::VAL_TIME: event.setTick(val - selPart->tick()); break; - case NoteInfo::VAL_LEN: + case MusEWidget::NoteInfo::VAL_LEN: event.setLenTick(val); break; - case NoteInfo::VAL_VELON: + case MusEWidget::NoteInfo::VAL_VELON: event.setVelo(val); break; - case NoteInfo::VAL_VELOFF: + case MusEWidget::NoteInfo::VAL_VELOFF: event.setVeloOff(val); break; - case NoteInfo::VAL_PITCH: + case MusEWidget::NoteInfo::VAL_PITCH: event.setPitch(val); break; } @@ -820,13 +820,13 @@ void DrumEdit::writeConfiguration(int level, Xml& xml) void DrumEdit::load() { - //QString fn = getOpenFileName("drummaps", map_file_pattern, - QString fn = getOpenFileName("drummaps", MusEGlobal::drum_map_file_pattern, + //QString fn = MusEWidget::getOpenFileName("drummaps", map_file_pattern, + QString fn = MusEWidget::getOpenFileName("drummaps", MusEGlobal::drum_map_file_pattern, this, tr("Muse: Load Drum Map"), 0); if (fn.isEmpty()) return; bool popenFlag; - FILE* f = fileOpen(this, fn, QString(".map"), "r", popenFlag, true); + FILE* f = MusEWidget::fileOpen(this, fn, QString(".map"), "r", popenFlag, true); if (f == 0) return; @@ -873,13 +873,13 @@ ende: void DrumEdit::save() { - //QString fn = getSaveFileName(QString("drummaps"), map_file_pattern, - QString fn = getSaveFileName(QString("drummaps"), MusEGlobal::drum_map_file_save_pattern, + //QString fn = MusEWidget::getSaveFileName(QString("drummaps"), map_file_pattern, + QString fn = MusEWidget::getSaveFileName(QString("drummaps"), MusEGlobal::drum_map_file_save_pattern, this, tr("MusE: Store Drum Map")); if (fn.isEmpty()) return; bool popenFlag; - FILE* f = fileOpen(this, fn, QString(".map"), "w", popenFlag, false, true); + FILE* f = MusEWidget::fileOpen(this, fn, QString(".map"), "w", popenFlag, false, true); if (f == 0) return; Xml xml(f); @@ -1202,11 +1202,11 @@ void DrumEdit::keyPressEvent(QKeyEvent* event) } else if (key == shortcuts[SHRT_ZOOM_IN].key) { int mag = hscroll->mag(); - int zoomlvl = ScrollScale::getQuickZoomLevel(mag); + int zoomlvl = MusEWidget::ScrollScale::getQuickZoomLevel(mag); if (zoomlvl < 23) zoomlvl++; - int newmag = ScrollScale::convertQuickZoomLevelToMag(zoomlvl); + int newmag = MusEWidget::ScrollScale::convertQuickZoomLevelToMag(zoomlvl); hscroll->setMag(newmag); //printf("mag = %d zoomlvl = %d newmag = %d\n", mag, zoomlvl, newmag); @@ -1214,11 +1214,11 @@ void DrumEdit::keyPressEvent(QKeyEvent* event) } else if (key == shortcuts[SHRT_ZOOM_OUT].key) { int mag = hscroll->mag(); - int zoomlvl = ScrollScale::getQuickZoomLevel(mag); + int zoomlvl = MusEWidget::ScrollScale::getQuickZoomLevel(mag); if (zoomlvl > 1) zoomlvl--; - int newmag = ScrollScale::convertQuickZoomLevelToMag(zoomlvl); + int newmag = MusEWidget::ScrollScale::convertQuickZoomLevelToMag(zoomlvl); hscroll->setMag(newmag); //printf("mag = %d zoomlvl = %d newmag = %d\n", mag, zoomlvl, newmag); return; diff --git a/muse2/muse/midiedit/drumedit.h b/muse2/muse/midiedit/drumedit.h index 3ca3df5d..d9812ebc 100644 --- a/muse2/muse/midiedit/drumedit.h +++ b/muse2/muse/midiedit/drumedit.h @@ -47,18 +47,20 @@ class MidiPart; class DrumCanvas; class ScrollScale; class ScoreConfig; -class MTScale; -class Splitter; class PartList; -class Toolbar1; class CtrlCanvas; class Xml; class DList; -class Header; class CtrlEdit; class Part; class SNode; +namespace MusEWidget { +class Header; +class Splitter; +class Toolbar1; +} + //--------------------------------------------------------- // DrumEdit //--------------------------------------------------------- @@ -71,17 +73,17 @@ class DrumEdit : public MidiEditor { int selTick; QMenu* menuEdit, *menuFunctions, *menuFile, *menuSelect; - NoteInfo* info; + MusEWidget::NoteInfo* info; QToolButton* srec; QToolButton* midiin; MusEWidget::EditToolBar* tools2; - Toolbar1* toolbar; - Splitter* split1; - Splitter* split2; + MusEWidget::Toolbar1* toolbar; + MusEWidget::Splitter* split1; + MusEWidget::Splitter* split2; QWidget* split1w1; DList* dlist; - Header* header; + MusEWidget::Header* header; QToolBar* tools; QComboBox *stepLenWidget; @@ -112,7 +114,7 @@ class DrumEdit : public MidiEditor { private slots: void setRaster(int); - void noteinfoChanged(NoteInfo::ValType type, int val); + void noteinfoChanged(MusEWidget::NoteInfo::ValType type, int val); //CtrlEdit* addCtrl(); void removeCtrl(CtrlEdit* ctrl); void cmd(int); diff --git a/muse2/muse/midiedit/ecanvas.cpp b/muse2/muse/midiedit/ecanvas.cpp index aaa62eba..e15256ac 100644 --- a/muse2/muse/midiedit/ecanvas.cpp +++ b/muse2/muse/midiedit/ecanvas.cpp @@ -182,10 +182,10 @@ void EventCanvas::songChanged(int flags) Event event; MidiPart* part = 0; int x = 0; - CItem* nevent = 0; + MusEWidget::CItem* nevent = 0; int n = 0; // count selections - for (iCItem k = items.begin(); k != items.end(); ++k) { + for (MusEWidget::iCItem k = items.begin(); k != items.end(); ++k) { Event ev = k->second->event(); bool selected = ev.selected(); if (selected) { @@ -224,11 +224,11 @@ void EventCanvas::selectAtTick(unsigned int tick) { //Select note nearest tick, if none selected and there are any if (!items.empty() && selectionSize() == 0) { - iCItem i = items.begin(); - CItem* nearest = i->second; + MusEWidget::iCItem i = items.begin(); + MusEWidget::CItem* nearest = i->second; while (i != items.end()) { - CItem* cur=i->second; + MusEWidget::CItem* cur=i->second; unsigned int curtk=abs(cur->x() + cur->part()->tick() - tick); unsigned int neartk=abs(nearest->x() + nearest->part()->tick() - tick); @@ -282,7 +282,7 @@ void EventCanvas::keyPress(QKeyEvent* event) int tick_min = INT_MAX; bool found = false; - for (iCItem i= items.begin(); i != items.end(); i++) { + for (MusEWidget::iCItem i= items.begin(); i != items.end(); i++) { if (!i->second->isSelected()) continue; @@ -303,8 +303,8 @@ void EventCanvas::keyPress(QKeyEvent* event) } // Select items by key (PianoRoll & DrumEditor) else if (key == shortcuts[SHRT_SEL_RIGHT].key || key == shortcuts[SHRT_SEL_RIGHT_ADD].key) { - iCItem i, iRightmost; - CItem* rightmost = NULL; + MusEWidget::iCItem i, iRightmost; + MusEWidget::CItem* rightmost = NULL; //Get the rightmost selected note (if any) for (i = items.begin(); i != items.end(); ++i) { if (i->second->isSelected()) { @@ -312,7 +312,7 @@ void EventCanvas::keyPress(QKeyEvent* event) } } if (rightmost) { - iCItem temp = iRightmost; temp++; + MusEWidget::iCItem temp = iRightmost; temp++; //If so, deselect current note and select the one to the right if (temp != items.end()) { if (key != shortcuts[SHRT_SEL_RIGHT_ADD].key) @@ -329,8 +329,8 @@ void EventCanvas::keyPress(QKeyEvent* event) } //Select items by key: (PianoRoll & DrumEditor) else if (key == shortcuts[SHRT_SEL_LEFT].key || key == shortcuts[SHRT_SEL_LEFT_ADD].key) { - iCItem i, iLeftmost; - CItem* leftmost = NULL; + MusEWidget::iCItem i, iLeftmost; + MusEWidget::CItem* leftmost = NULL; if (items.size() > 0 ) { for (i = items.end(), i--; i != items.begin(); i--) { if (i->second->isSelected()) { @@ -353,27 +353,27 @@ void EventCanvas::keyPress(QKeyEvent* event) } } else if (key == shortcuts[SHRT_INC_PITCH].key) { - modifySelected(NoteInfo::VAL_PITCH, 1); + modifySelected(MusEWidget::NoteInfo::VAL_PITCH, 1); } else if (key == shortcuts[SHRT_DEC_PITCH].key) { - modifySelected(NoteInfo::VAL_PITCH, -1); + modifySelected(MusEWidget::NoteInfo::VAL_PITCH, -1); } else if (key == shortcuts[SHRT_INC_POS].key) { // TODO: Check boundaries - modifySelected(NoteInfo::VAL_TIME, editor->raster()); + modifySelected(MusEWidget::NoteInfo::VAL_TIME, editor->raster()); } else if (key == shortcuts[SHRT_DEC_POS].key) { // TODO: Check boundaries - modifySelected(NoteInfo::VAL_TIME, 0 - editor->raster()); + modifySelected(MusEWidget::NoteInfo::VAL_TIME, 0 - editor->raster()); } else if (key == shortcuts[SHRT_INCREASE_LEN].key) { // TODO: Check boundaries - modifySelected(NoteInfo::VAL_LEN, editor->raster()); + modifySelected(MusEWidget::NoteInfo::VAL_LEN, editor->raster()); } else if (key == shortcuts[SHRT_DECREASE_LEN].key) { // TODO: Check boundaries - modifySelected(NoteInfo::VAL_LEN, 0 - editor->raster()); + modifySelected(MusEWidget::NoteInfo::VAL_LEN, 0 - editor->raster()); } else diff --git a/muse2/muse/midiedit/ecanvas.h b/muse2/muse/midiedit/ecanvas.h index 773675b9..f31b5f6b 100644 --- a/muse2/muse/midiedit/ecanvas.h +++ b/muse2/muse/midiedit/ecanvas.h @@ -68,8 +68,8 @@ class EventCanvas : public MusEWidget::Canvas { virtual void addItem(Part*, Event&) = 0; // Added by T356. virtual QPoint raster(const QPoint&) const; - virtual Undo moveCanvasItems(CItemList&, int, int, DragType) = 0; - virtual UndoOp moveItem(CItem*, const QPoint&, DragType) = 0; + virtual Undo moveCanvasItems(MusEWidget::CItemList&, int, int, DragType) = 0; + virtual UndoOp moveItem(MusEWidget::CItem*, const QPoint&, DragType) = 0; virtual void endMoveItems(const QPoint&, DragType, int dir); public slots: @@ -96,7 +96,7 @@ class EventCanvas : public MusEWidget::Canvas { void playEvents(bool flag) { _playEvents = flag; } void selectAtTick(unsigned int tick); void viewDropEvent(QDropEvent* event); - virtual void modifySelected(NoteInfo::ValType, int) {} + virtual void modifySelected(MusEWidget::NoteInfo::ValType, int) {} virtual void keyPress(QKeyEvent*); }; diff --git a/muse2/muse/midiedit/piano.cpp b/muse2/muse/midiedit/piano.cpp index c034868a..d347b10a 100644 --- a/muse2/muse/midiedit/piano.cpp +++ b/muse2/muse/midiedit/piano.cpp @@ -367,7 +367,7 @@ static const char *mk4_xpm[] = { //--------------------------------------------------------- Piano::Piano(QWidget* parent, int ymag) - : View(parent, 1, ymag) + : MusEWidget::View(parent, 1, ymag) { setMouseTracking(true); curPitch = -1; diff --git a/muse2/muse/midiedit/piano.h b/muse2/muse/midiedit/piano.h index 28ddd2c9..133295ab 100644 --- a/muse2/muse/midiedit/piano.h +++ b/muse2/muse/midiedit/piano.h @@ -36,7 +36,7 @@ class QPixmap; // Piano //--------------------------------------------------------- -class Piano : public View +class Piano : public MusEWidget::View { Q_OBJECT diff --git a/muse2/muse/midiedit/pianoroll.cpp b/muse2/muse/midiedit/pianoroll.cpp index c207ed45..e07d95bb 100644 --- a/muse2/muse/midiedit/pianoroll.cpp +++ b/muse2/muse/midiedit/pianoroll.cpp @@ -277,21 +277,21 @@ PianoRoll::PianoRoll(PartList* pl, QWidget* parent, const char* name, unsigned i transport->addActions(MusEGlobal::transportAction->actions()); addToolBarBreak(); - toolbar = new Toolbar1(this, _rasterInit); + toolbar = new MusEWidget::Toolbar1(this, _rasterInit); addToolBar(toolbar); addToolBarBreak(); - info = new NoteInfo(this); + info = new MusEWidget::NoteInfo(this); addToolBar(info); //--------------------------------------------------- // split //--------------------------------------------------- - splitter = new Splitter(Qt::Vertical, mainw, "splitter"); + splitter = new MusEWidget::Splitter(Qt::Vertical, mainw, "splitter"); splitter->setHandleWidth(2); - hsplitter = new Splitter(Qt::Horizontal, mainw, "hsplitter"); + hsplitter = new MusEWidget::Splitter(Qt::Horizontal, mainw, "hsplitter"); hsplitter->setChildrenCollapsible(true); hsplitter->setHandleWidth(2); @@ -300,9 +300,9 @@ PianoRoll::PianoRoll(PartList* pl, QWidget* parent, const char* name, unsigned i ctrl->setObjectName("Ctrl"); ctrl->setFont(MusEConfig::config.fonts[3]); ctrl->setToolTip(tr("Add Controller View")); - //hscroll = new ScrollScale(-25, -2, xscale, 20000, Qt::Horizontal, mainw); + //hscroll = new MusEWidget::ScrollScale(-25, -2, xscale, 20000, Qt::Horizontal, mainw); // Increased scale to -1. To resolve/select/edit 1-tick-wide (controller graph) events. p4.0.18 Tim. - hscroll = new ScrollScale(-25, -1, xscale, 20000, Qt::Horizontal, mainw); + hscroll = new MusEWidget::ScrollScale(-25, -1, xscale, 20000, Qt::Horizontal, mainw); ctrl->setFixedSize(pianoWidth, hscroll->sizeHint().height()); //ctrl->setFixedSize(pianoWidth / 2, hscroll->sizeHint().height()); // Tim. @@ -317,7 +317,7 @@ PianoRoll::PianoRoll(PartList* pl, QWidget* parent, const char* name, unsigned i QSizeGrip* corner = new QSizeGrip(mainw); - midiTrackInfo = new MidiTrackInfo(mainw); + midiTrackInfo = new MusEWidget::MidiTrackInfo(mainw); int mtiw = midiTrackInfo->width(); // Save this. midiTrackInfo->setMinimumWidth(100); //midiTrackInfo->setMaximumWidth(150); @@ -370,10 +370,10 @@ PianoRoll::PianoRoll(PartList* pl, QWidget* parent, const char* name, unsigned i gridS1->setSpacing(0); //Defined and configure your program change bar here. //This may well be a copy of MTScale extended for our needs - time = new MTScale(&_raster, split1, xscale); + time = new MusEWidget::MTScale(&_raster, split1, xscale); Piano* piano = new Piano(split1, yscale); canvas = new PianoCanvas(this, split1, xscale, yscale); - vscroll = new ScrollScale(-3, 7, yscale, KH * 75, Qt::Vertical, split1); + vscroll = new MusEWidget::ScrollScale(-3, 7, yscale, KH * 75, Qt::Vertical, split1); //setFocusProxy(canvas); // Tim. @@ -391,7 +391,7 @@ PianoRoll::PianoRoll(PartList* pl, QWidget* parent, const char* name, unsigned i //gridS1->setColumnStretch(2, 100); // Tim. gridS1->addWidget(time, 0, 1, 1, 2); - gridS1->addWidget(hLine(split1), 1, 0, 1, 3); + gridS1->addWidget(MusEUtil::hLine(split1), 1, 0, 1, 3); gridS1->addWidget(piano, 2, 0); gridS1->addWidget(canvas, 2, 1); gridS1->addWidget(vscroll, 2, 2); @@ -399,7 +399,7 @@ PianoRoll::PianoRoll(PartList* pl, QWidget* parent, const char* name, unsigned i // Tim. /* gridS1->addWidget(time, 0, 2, 1, 3); - gridS1->addWidget(hLine(split1), 1, 1, 1, 4); + gridS1->addWidget(MusEUtil::hLine(split1), 1, 1, 1, 4); //gridS1->addWidget(infoScroll, 2, 0); gridS1->addWidget(infoScroll, 0, 0, 3, 1); gridS1->addWidget(piano, 2, 1); @@ -407,7 +407,7 @@ PianoRoll::PianoRoll(PartList* pl, QWidget* parent, const char* name, unsigned i gridS1->addWidget(vscroll, 2, 3); */ - ctrlLane = new Splitter(Qt::Vertical, splitter, "ctrllane"); + ctrlLane = new MusEWidget::Splitter(Qt::Vertical, splitter, "ctrllane"); QWidget* split2 = new QWidget(splitter); split2->setMaximumHeight(hscroll->sizeHint().height()); split2->setMinimumHeight(hscroll->sizeHint().height()); @@ -433,7 +433,7 @@ PianoRoll::PianoRoll(PartList* pl, QWidget* parent, const char* name, unsigned i connect(ctrl, SIGNAL(clicked()), SLOT(addCtrl())); //connect(trackInfoButton, SIGNAL(clicked()), SLOT(toggleTrackInfo())); Tim. - connect(info, SIGNAL(valueChanged(NoteInfo::ValType, int)), SLOT(noteinfoChanged(NoteInfo::ValType, int))); + connect(info, SIGNAL(valueChanged(MusEWidget::NoteInfo::ValType, int)), SLOT(noteinfoChanged(MusEWidget::NoteInfo::ValType, int))); connect(vscroll, SIGNAL(scrollChanged(int)), piano, SLOT(setYPos(int))); connect(vscroll, SIGNAL(scrollChanged(int)), canvas, SLOT(setYPos(int))); connect(vscroll, SIGNAL(scaleChanged(int)), canvas, SLOT(setYMag(int))); @@ -692,7 +692,7 @@ void PianoRoll::setSelection(int tick, Event& e, Part* p) // edit currently selected Event //--------------------------------------------------------- -void PianoRoll::noteinfoChanged(NoteInfo::ValType type, int val) +void PianoRoll::noteinfoChanged(MusEWidget::NoteInfo::ValType type, int val) { int selections = canvas->selectionSize(); @@ -702,19 +702,19 @@ void PianoRoll::noteinfoChanged(NoteInfo::ValType type, int val) else if (selections == 1) { Event event = selEvent.clone(); switch(type) { - case NoteInfo::VAL_TIME: + case MusEWidget::NoteInfo::VAL_TIME: event.setTick(val - selPart->tick()); break; - case NoteInfo::VAL_LEN: + case MusEWidget::NoteInfo::VAL_LEN: event.setLenTick(val); break; - case NoteInfo::VAL_VELON: + case MusEWidget::NoteInfo::VAL_VELON: event.setVelo(val); break; - case NoteInfo::VAL_VELOFF: + case MusEWidget::NoteInfo::VAL_VELOFF: event.setVeloOff(val); break; - case NoteInfo::VAL_PITCH: + case MusEWidget::NoteInfo::VAL_PITCH: event.setPitch(val); break; } @@ -728,23 +728,23 @@ void PianoRoll::noteinfoChanged(NoteInfo::ValType type, int val) int delta = 0; switch (type) { - case NoteInfo::VAL_TIME: + case MusEWidget::NoteInfo::VAL_TIME: delta = val - tickOffset; tickOffset = val; break; - case NoteInfo::VAL_LEN: + case MusEWidget::NoteInfo::VAL_LEN: delta = val - lenOffset; lenOffset = val; break; - case NoteInfo::VAL_VELON: + case MusEWidget::NoteInfo::VAL_VELON: delta = val - veloOnOffset; veloOnOffset = val; break; - case NoteInfo::VAL_VELOFF: + case MusEWidget::NoteInfo::VAL_VELOFF: delta = val - veloOffOffset; veloOffOffset = val; break; - case NoteInfo::VAL_PITCH: + case MusEWidget::NoteInfo::VAL_PITCH: delta = val - pitchOffset; pitchOffset = val; break; @@ -1063,22 +1063,22 @@ void PianoRoll::keyPressEvent(QKeyEvent* event) } else if (key == shortcuts[SHRT_ZOOM_IN].key) { int mag = hscroll->mag(); - int zoomlvl = ScrollScale::getQuickZoomLevel(mag); + int zoomlvl = MusEWidget::ScrollScale::getQuickZoomLevel(mag); if (zoomlvl < 23) zoomlvl++; - int newmag = ScrollScale::convertQuickZoomLevelToMag(zoomlvl); + int newmag = MusEWidget::ScrollScale::convertQuickZoomLevelToMag(zoomlvl); hscroll->setMag(newmag); //printf("mag = %d zoomlvl = %d newmag = %d\n", mag, zoomlvl, newmag); return; } else if (key == shortcuts[SHRT_ZOOM_OUT].key) { int mag = hscroll->mag(); - int zoomlvl = ScrollScale::getQuickZoomLevel(mag); + int zoomlvl = MusEWidget::ScrollScale::getQuickZoomLevel(mag); if (zoomlvl > 1) zoomlvl--; - int newmag = ScrollScale::convertQuickZoomLevelToMag(zoomlvl); + int newmag = MusEWidget::ScrollScale::convertQuickZoomLevelToMag(zoomlvl); hscroll->setMag(newmag); //printf("mag = %d zoomlvl = %d newmag = %d\n", mag, zoomlvl, newmag); return; diff --git a/muse2/muse/midiedit/pianoroll.h b/muse2/muse/midiedit/pianoroll.h index 885d6538..9a6eb655 100644 --- a/muse2/muse/midiedit/pianoroll.h +++ b/muse2/muse/midiedit/pianoroll.h @@ -47,9 +47,7 @@ class QToolButton; class QToolBar; class QPushButton; class CtrlEdit; -class Splitter; class PartList; -class Toolbar1; class Xml; class ScrollScale; class Part; @@ -58,9 +56,14 @@ class QMenu; class QAction; class QWidget; class QScrollBar; -class MidiTrackInfo; class QScrollArea; +namespace MusEWidget { +class MidiTrackInfo; +class Splitter; +class Toolbar1; +} + //--------------------------------------------------------- // PianoRoll //--------------------------------------------------------- @@ -78,7 +81,7 @@ class PianoRoll : public MidiEditor { QMenu *menuEdit, *menuFunctions, *menuSelect, *menuConfig, *eventColor, *menuPlugins; - MidiTrackInfo *midiTrackInfo; + MusEWidget::MidiTrackInfo *midiTrackInfo; Track* selected; QAction* editCutAction; @@ -116,14 +119,14 @@ class PianoRoll : public MidiEditor { int veloOffOffset; bool deltaMode; - NoteInfo* info; + MusEWidget::NoteInfo* info; QToolButton* srec; QToolButton* midiin; - Toolbar1* toolbar; - Splitter* splitter; - Splitter* hsplitter; - Splitter* ctrlLane; + MusEWidget::Toolbar1* toolbar; + MusEWidget::Splitter* splitter; + MusEWidget::Splitter* hsplitter; + MusEWidget::Splitter* ctrlLane; QToolButton* speaker; QToolBar* tools; @@ -154,7 +157,7 @@ class PianoRoll : public MidiEditor { private slots: void setSelection(int, Event&, Part*); - void noteinfoChanged(NoteInfo::ValType, int); + void noteinfoChanged(MusEWidget::NoteInfo::ValType, int); //CtrlEdit* addCtrl(); void removeCtrl(CtrlEdit* ctrl); void soloChanged(bool flag); diff --git a/muse2/muse/midiedit/prcanvas.cpp b/muse2/muse/midiedit/prcanvas.cpp index 1a2644f6..55d51ad0 100644 --- a/muse2/muse/midiedit/prcanvas.cpp +++ b/muse2/muse/midiedit/prcanvas.cpp @@ -60,7 +60,7 @@ // NEvent //--------------------------------------------------------- -NEvent::NEvent(Event& e, Part* p, int y) : CItem(e, p) +NEvent::NEvent(Event& e, Part* p, int y) : MusEWidget::CItem(e, p) { y = y - KH/4; unsigned tick = e.tick() + p->tick(); @@ -156,7 +156,7 @@ int PianoCanvas::y2pitch(int y) const // draws a note //--------------------------------------------------------- -void PianoCanvas::drawItem(QPainter& p, const CItem* item, +void PianoCanvas::drawItem(QPainter& p, const MusEWidget::CItem* item, const QRect& rect) { QRect r = item->bbox(); @@ -295,7 +295,7 @@ void PianoCanvas::drawTopItem(QPainter& , const QRect&) // draws moving items //--------------------------------------------------------- -void PianoCanvas::drawMoving(QPainter& p, const CItem* item, const QRect& rect) +void PianoCanvas::drawMoving(QPainter& p, const MusEWidget::CItem* item, const QRect& rect) { //if(((NEvent*)item)->part() != curPart) // return; @@ -326,7 +326,7 @@ void PianoCanvas::viewMouseDoubleClickEvent(QMouseEvent* event) // moveCanvasItems //--------------------------------------------------------- -Undo PianoCanvas::moveCanvasItems(CItemList& items, int dp, int dx, DragType dtype) +Undo PianoCanvas::moveCanvasItems(MusEWidget::CItemList& items, int dp, int dx, DragType dtype) { if(editor->parts()->empty()) return Undo(); //return empty list @@ -341,9 +341,9 @@ Undo PianoCanvas::moveCanvasItems(CItemList& items, int dp, int dx, DragType dty continue; int npartoffset = 0; - for(iCItem ici = items.begin(); ici != items.end(); ++ici) + for(MusEWidget::iCItem ici = items.begin(); ici != items.end(); ++ici) { - CItem* ci = ici->second; + MusEWidget::CItem* ci = ici->second; if(ci->part() != part) continue; @@ -396,12 +396,12 @@ Undo PianoCanvas::moveCanvasItems(CItemList& items, int dp, int dx, DragType dty if (!forbidden) { - std::vector< CItem* > doneList; - typedef std::vector< CItem* >::iterator iDoneList; + std::vector< MusEWidget::CItem* > doneList; + typedef std::vector< MusEWidget::CItem* >::iterator iDoneList; - for(iCItem ici = items.begin(); ici != items.end(); ++ici) + for(MusEWidget::iCItem ici = items.begin(); ici != items.end(); ++ici) { - CItem* ci = ici->second; + MusEWidget::CItem* ci = ici->second; int x = ci->pos().x(); int y = ci->pos().y(); @@ -452,7 +452,7 @@ Undo PianoCanvas::moveCanvasItems(CItemList& items, int dp, int dx, DragType dty // called after moving an object //--------------------------------------------------------- -UndoOp PianoCanvas::moveItem(CItem* item, const QPoint& pos, DragType dtype) +UndoOp PianoCanvas::moveItem(MusEWidget::CItem* item, const QPoint& pos, DragType dtype) { NEvent* nevent = (NEvent*) item; Event event = nevent->event(); @@ -497,7 +497,7 @@ UndoOp PianoCanvas::moveItem(CItem* item, const QPoint& pos, DragType dtype) // newItem(p, state) //--------------------------------------------------------- -CItem* PianoCanvas::newItem(const QPoint& p, int) +MusEWidget::CItem* PianoCanvas::newItem(const QPoint& p, int) { //printf("newItem point\n"); int pitch = y2pitch(p.y()); @@ -514,7 +514,7 @@ CItem* PianoCanvas::newItem(const QPoint& p, int) return new NEvent(e, curPart, pitch2y(pitch)); } -void PianoCanvas::newItem(CItem* item, bool noSnap) +void PianoCanvas::newItem(MusEWidget::CItem* item, bool noSnap) { //printf("newItem citem\n"); NEvent* nevent = (NEvent*) item; @@ -560,7 +560,7 @@ void PianoCanvas::newItem(CItem* item, bool noSnap) // resizeItem //--------------------------------------------------------- -void PianoCanvas::resizeItem(CItem* item, bool noSnap, bool) // experimental changes to try dynamically extending parts +void PianoCanvas::resizeItem(MusEWidget::CItem* item, bool noSnap, bool) // experimental changes to try dynamically extending parts { //printf("resizeItem!\n"); NEvent* nevent = (NEvent*) item; @@ -604,7 +604,7 @@ void PianoCanvas::resizeItem(CItem* item, bool noSnap, bool) // experime // deleteItem //--------------------------------------------------------- -bool PianoCanvas::deleteItem(CItem* item) +bool PianoCanvas::deleteItem(MusEWidget::CItem* item) { NEvent* nevent = (NEvent*) item; if (nevent->part() == curPart) { @@ -828,7 +828,7 @@ void PianoCanvas::cmd(int cmd) { switch (cmd) { case CMD_SELECT_ALL: // select all - for (iCItem k = items.begin(); k != items.end(); ++k) { + for (MusEWidget::iCItem k = items.begin(); k != items.end(); ++k) { if (!k->second->isSelected()) selectItem(k->second, true); } @@ -837,12 +837,12 @@ void PianoCanvas::cmd(int cmd) deselectAll(); break; case CMD_SELECT_INVERT: // invert selection - for (iCItem k = items.begin(); k != items.end(); ++k) { + for (MusEWidget::iCItem k = items.begin(); k != items.end(); ++k) { selectItem(k->second, !k->second->isSelected()); } break; case CMD_SELECT_ILOOP: // select inside loop - for (iCItem k = items.begin(); k != items.end(); ++k) { + for (MusEWidget::iCItem k = items.begin(); k != items.end(); ++k) { NEvent* nevent = (NEvent*)(k->second); Part* part = nevent->part(); Event event = nevent->event(); @@ -854,7 +854,7 @@ void PianoCanvas::cmd(int cmd) } break; case CMD_SELECT_OLOOP: // select outside loop - for (iCItem k = items.begin(); k != items.end(); ++k) { + for (MusEWidget::iCItem k = items.begin(); k != items.end(); ++k) { NEvent* nevent = (NEvent*)(k->second); Part* part = nevent->part(); Event event = nevent->event(); @@ -956,7 +956,7 @@ void PianoCanvas::midiNote(int pitch, int velo) // startDrag //--------------------------------------------------------- -void PianoCanvas::startDrag(CItem* /* item*/, bool copymode) +void PianoCanvas::startDrag(MusEWidget::CItem* /* item*/, bool copymode) { QMimeData* md = selected_events_to_mime(partlist_to_set(editor->parts()), 1); @@ -1008,7 +1008,7 @@ void PianoCanvas::dragLeaveEvent(QDragLeaveEvent*) // itemPressed //--------------------------------------------------------- -void PianoCanvas::itemPressed(const CItem* item) +void PianoCanvas::itemPressed(const MusEWidget::CItem* item) { if (!_playEvents) return; @@ -1029,7 +1029,7 @@ void PianoCanvas::itemPressed(const CItem* item) // itemReleased //--------------------------------------------------------- -void PianoCanvas::itemReleased(const CItem*, const QPoint&) +void PianoCanvas::itemReleased(const MusEWidget::CItem*, const QPoint&) { if (!_playEvents) return; @@ -1046,7 +1046,7 @@ void PianoCanvas::itemReleased(const CItem*, const QPoint&) // itemMoved //--------------------------------------------------------- -void PianoCanvas::itemMoved(const CItem* item, const QPoint& pos) +void PianoCanvas::itemMoved(const MusEWidget::CItem* item, const QPoint& pos) { int npitch = y2pitch(pos.y()); if ((playedPitch != -1) && (playedPitch != npitch)) { @@ -1078,11 +1078,11 @@ void PianoCanvas::curPartChanged() // modifySelected //--------------------------------------------------------- -void PianoCanvas::modifySelected(NoteInfo::ValType type, int delta) +void PianoCanvas::modifySelected(MusEWidget::NoteInfo::ValType type, int delta) { audio->msgIdle(true); song->startUndo(); - for (iCItem i = items.begin(); i != items.end(); ++i) { + for (MusEWidget::iCItem i = items.begin(); i != items.end(); ++i) { if (!(i->second->isSelected())) continue; NEvent* e = (NEvent*)(i->second); @@ -1094,7 +1094,7 @@ void PianoCanvas::modifySelected(NoteInfo::ValType type, int delta) Event newEvent = event.clone(); switch (type) { - case NoteInfo::VAL_TIME: + case MusEWidget::NoteInfo::VAL_TIME: { int newTime = event.tick() + delta; if (newTime < 0) @@ -1102,7 +1102,7 @@ void PianoCanvas::modifySelected(NoteInfo::ValType type, int delta) newEvent.setTick(newTime); } break; - case NoteInfo::VAL_LEN: + case MusEWidget::NoteInfo::VAL_LEN: { int len = event.lenTick() + delta; if (len < 1) @@ -1110,7 +1110,7 @@ void PianoCanvas::modifySelected(NoteInfo::ValType type, int delta) newEvent.setLenTick(len); } break; - case NoteInfo::VAL_VELON: + case MusEWidget::NoteInfo::VAL_VELON: { int velo = event.velo() + delta; if (velo > 127) @@ -1120,7 +1120,7 @@ void PianoCanvas::modifySelected(NoteInfo::ValType type, int delta) newEvent.setVelo(velo); } break; - case NoteInfo::VAL_VELOFF: + case MusEWidget::NoteInfo::VAL_VELOFF: { int velo = event.veloOff() + delta; if (velo > 127) @@ -1130,7 +1130,7 @@ void PianoCanvas::modifySelected(NoteInfo::ValType type, int delta) newEvent.setVeloOff(velo); } break; - case NoteInfo::VAL_PITCH: + case MusEWidget::NoteInfo::VAL_PITCH: { int pitch = event.pitch() + delta; if (pitch > 127) diff --git a/muse2/muse/midiedit/prcanvas.h b/muse2/muse/midiedit/prcanvas.h index 9fc1479a..d239994e 100644 --- a/muse2/muse/midiedit/prcanvas.h +++ b/muse2/muse/midiedit/prcanvas.h @@ -41,7 +41,7 @@ // ''visual'' Note Event //--------------------------------------------------------- -class NEvent : public CItem { +class NEvent : public MusEWidget::CItem { public: NEvent(Event& e, Part* p, int y); }; @@ -66,16 +66,16 @@ class PianoCanvas : public EventCanvas { virtual void viewMouseDoubleClickEvent(QMouseEvent*); - virtual void drawItem(QPainter&, const CItem*, const QRect&); + virtual void drawItem(QPainter&, const MusEWidget::CItem*, const QRect&); void drawTopItem(QPainter &p, const QRect &rect); - virtual void drawMoving(QPainter&, const CItem*, const QRect&); - virtual Undo moveCanvasItems(CItemList&, int, int, DragType); - virtual UndoOp moveItem(CItem*, const QPoint&, DragType); - virtual CItem* newItem(const QPoint&, int); - virtual void resizeItem(CItem*, bool noSnap, bool); - virtual void newItem(CItem*, bool noSnap); - virtual bool deleteItem(CItem*); - virtual void startDrag(CItem* item, bool copymode); + virtual void drawMoving(QPainter&, const MusEWidget::CItem*, const QRect&); + virtual Undo moveCanvasItems(MusEWidget::CItemList&, int, int, DragType); + virtual UndoOp moveItem(MusEWidget::CItem*, const QPoint&, DragType); + virtual MusEWidget::CItem* newItem(const QPoint&, int); + virtual void resizeItem(MusEWidget::CItem*, bool noSnap, bool); + virtual void newItem(MusEWidget::CItem*, bool noSnap); + virtual bool deleteItem(MusEWidget::CItem*); + virtual void startDrag(MusEWidget::CItem* item, bool copymode); virtual void dragEnterEvent(QDragEnterEvent* event); virtual void dragMoveEvent(QDragMoveEvent*); virtual void dragLeaveEvent(QDragLeaveEvent*); @@ -84,9 +84,9 @@ class PianoCanvas : public EventCanvas { int y2pitch(int) const; int pitch2y(int) const; virtual void drawCanvas(QPainter&, const QRect&); - virtual void itemPressed(const CItem*); - virtual void itemReleased(const CItem*, const QPoint&); - virtual void itemMoved(const CItem*, const QPoint&); + virtual void itemPressed(const MusEWidget::CItem*); + virtual void itemReleased(const MusEWidget::CItem*, const QPoint&); + virtual void itemMoved(const MusEWidget::CItem*, const QPoint&); virtual void curPartChanged(); virtual void resizeEvent(QResizeEvent*); @@ -122,7 +122,7 @@ class PianoCanvas : public EventCanvas { colorMode = mode; redraw(); } - virtual void modifySelected(NoteInfo::ValType type, int delta); + virtual void modifySelected(MusEWidget::NoteInfo::ValType type, int delta); }; #endif diff --git a/muse2/muse/midiedit/scoreedit.cpp b/muse2/muse/midiedit/scoreedit.cpp index 7965be1a..8847c105 100644 --- a/muse2/muse/midiedit/scoreedit.cpp +++ b/muse2/muse/midiedit/scoreedit.cpp @@ -194,7 +194,7 @@ ScoreEdit::ScoreEdit(QWidget* parent, const char* name, unsigned initPos) score_canvas=new ScoreCanvas(this, mainw); xscroll = new QScrollBar(Qt::Horizontal, mainw); yscroll = new QScrollBar(Qt::Vertical, mainw); - time_bar = new MTScaleFlo(score_canvas, mainw); + time_bar = new MusEWidget::MTScaleFlo(score_canvas, mainw); connect(xscroll, SIGNAL(valueChanged(int)), score_canvas, SLOT(x_scroll_event(int))); connect(score_canvas, SIGNAL(xscroll_changed(int)), xscroll, SLOT(setValue(int))); diff --git a/muse2/muse/midiedit/scoreedit.h b/muse2/muse/midiedit/scoreedit.h index f340a9b0..4d553e82 100644 --- a/muse2/muse/midiedit/scoreedit.h +++ b/muse2/muse/midiedit/scoreedit.h @@ -109,7 +109,7 @@ class ScoreEdit : public TopWin QGridLayout* mainGrid; QWidget* mainw; - MusEWidget::EditToolBar* edit_tools; + MusEWidget::EditToolBar* edit_tools; QSpinBox* velo_spinbox; QSpinBox* velo_off_spinbox; @@ -162,7 +162,7 @@ class ScoreEdit : public TopWin QScrollBar* xscroll; QScrollBar* yscroll; ScoreCanvas* score_canvas; - MTScaleFlo* time_bar; + MusEWidget::MTScaleFlo* time_bar; QLabel* apply_velo_to_label; bool apply_velo; @@ -608,7 +608,7 @@ int calc_timesig_width(int num, int denom); int calc_number_width(int n); -class ScoreCanvas : public View +class ScoreCanvas : public MusEWidget::View { Q_OBJECT private: diff --git a/muse2/muse/midieditor.cpp b/muse2/muse/midieditor.cpp index ff33a789..71d8e97f 100644 --- a/muse2/muse/midieditor.cpp +++ b/muse2/muse/midieditor.cpp @@ -244,11 +244,11 @@ void MidiEditor::setCurCanvasPart(Part* part) void MidiEditor::horizontalZoomIn() { int mag = hscroll->mag(); - int zoomlvl = ScrollScale::getQuickZoomLevel(mag); + int zoomlvl = MusEWidget::ScrollScale::getQuickZoomLevel(mag); if (zoomlvl < 23) zoomlvl++; - int newmag = ScrollScale::convertQuickZoomLevelToMag(zoomlvl); + int newmag = MusEWidget::ScrollScale::convertQuickZoomLevelToMag(zoomlvl); hscroll->setMag(newmag); @@ -257,11 +257,11 @@ void MidiEditor::horizontalZoomIn() void MidiEditor::horizontalZoomOut() { int mag = hscroll->mag(); - int zoomlvl = ScrollScale::getQuickZoomLevel(mag); + int zoomlvl = MusEWidget::ScrollScale::getQuickZoomLevel(mag); if (zoomlvl > 1) zoomlvl--; - int newmag = ScrollScale::convertQuickZoomLevelToMag(zoomlvl); + int newmag = MusEWidget::ScrollScale::convertQuickZoomLevelToMag(zoomlvl); hscroll->setMag(newmag); diff --git a/muse2/muse/midieditor.h b/muse2/muse/midieditor.h index 6d0bda9a..abfe8e8d 100644 --- a/muse2/muse/midieditor.h +++ b/muse2/muse/midieditor.h @@ -33,13 +33,16 @@ class QWidget; class PartList; class Xml; class EventCanvas; -class ScrollScale; class CtrlEdit; -class MTScale; class WaveView; class Part; class WavePart; +namespace MusEWidget { +class MTScale; +class ScrollScale; +} + //--------------------------------------------------------- // MidiEditor //--------------------------------------------------------- @@ -52,9 +55,9 @@ class MidiEditor : public TopWin { int _curDrumInstrument; // currently selected instrument if drum // editor protected: - ScrollScale* hscroll; - ScrollScale* vscroll; - MTScale* time; + MusEWidget::ScrollScale* hscroll; + MusEWidget::ScrollScale* vscroll; + MusEWidget::MTScale* time; EventCanvas* canvas; WaveView* wview; diff --git a/muse2/muse/mixer/astrip.cpp b/muse2/muse/mixer/astrip.cpp index 11927e25..4084a7d4 100644 --- a/muse2/muse/mixer/astrip.cpp +++ b/muse2/muse/mixer/astrip.cpp @@ -601,7 +601,7 @@ void AudioStrip::updateChannels() if (c > channel) { for (int cc = channel; cc < c; ++cc) { - meter[cc] = new Meter(this); + meter[cc] = new MusEWidget::Meter(this); //meter[cc]->setRange(MusEConfig::config.minSlider, 10.0); meter[cc]->setRange(MusEConfig::config.minMeter, 10.0); meter[cc]->setFixedWidth(15); @@ -624,14 +624,14 @@ void AudioStrip::updateChannels() } //--------------------------------------------------------- -// addKnob +// addMusEWidget::Knob // type = 0 - panorama // 1 - aux send //--------------------------------------------------------- -Knob* AudioStrip::addKnob(int type, int id, DoubleLabel** dlabel) +MusEWidget::Knob* AudioStrip::addKnob(int type, int id, MusEWidget::DoubleLabel** dlabel) { - Knob* knob = new Knob(this); + MusEWidget::Knob* knob = new MusEWidget::Knob(this); knob->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum)); if (type == 0) knob->setRange(-1.0, +1.0); @@ -644,11 +644,11 @@ Knob* AudioStrip::addKnob(int type, int id, DoubleLabel** dlabel) else knob->setToolTip(tr("aux send level")); - DoubleLabel* pl; + MusEWidget::DoubleLabel* pl; if (type == 0) - pl = new DoubleLabel(0, -1.0, +1.0, this); + pl = new MusEWidget::DoubleLabel(0, -1.0, +1.0, this); else - pl = new DoubleLabel(0.0, MusEConfig::config.minSlider, 10.1, this); + pl = new MusEWidget::DoubleLabel(0.0, MusEConfig::config.minSlider, 10.1, this); if (dlabel) *dlabel = pl; @@ -733,7 +733,7 @@ AudioStrip::AudioStrip(QWidget* parent, AudioTrack* at) int ch = 0; for (; ch < channel; ++ch) - meter[ch] = new Meter(this); + meter[ch] = new MusEWidget::Meter(this); for (; ch < MAX_CHANNELS; ++ch) meter[ch] = 0; @@ -786,8 +786,8 @@ AudioStrip::AudioStrip(QWidget* parent, AudioTrack* at) int auxsSize = song->auxs()->size(); if (t->hasAuxSend()) { for (int idx = 0; idx < auxsSize; ++idx) { - DoubleLabel* al; - Knob* ak = addKnob(1, idx, &al); + MusEWidget::DoubleLabel* al; + MusEWidget::Knob* ak = addKnob(1, idx, &al); auxKnob.push_back(ak); auxLabel.push_back(al); double val = fast_log10(t->auxSend(idx))*20.0; @@ -810,7 +810,7 @@ AudioStrip::AudioStrip(QWidget* parent, AudioTrack* at) sliderGrid->setContentsMargins(0, 0, 0, 0); sliderGrid->setSpacing(0); - slider = new Slider(this, "vol", Qt::Vertical, Slider::None); + slider = new MusEWidget::Slider(this, "vol", Qt::Vertical, MusEWidget::Slider::None); slider->setCursorHoming(true); slider->setRange(MusEConfig::config.minSlider-0.1, 10.0); @@ -831,7 +831,7 @@ AudioStrip::AudioStrip(QWidget* parent, AudioTrack* at) sliderGrid->addItem(new QSpacerItem(2,0),0,3); grid->addLayout(sliderGrid, _curGridRow++, 0, 1, 2); - sl = new DoubleLabel(0.0, MusEConfig::config.minSlider, 10.0, this); + sl = new MusEWidget::DoubleLabel(0.0, MusEConfig::config.minSlider, 10.0, this); sl->setSlider(slider); sl->setFont(MusEConfig::config.fonts[1]); sl->setBackgroundRole(QPalette::Mid); @@ -862,7 +862,7 @@ AudioStrip::AudioStrip(QWidget* parent, AudioTrack* at) //--------------------------------------------------- if (track->canRecord()) { - record = new TransparentToolButton(this); + record = new MusEWidget::TransparentToolButton(this); record->setCheckable(true); record->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum)); record->setBackgroundRole(QPalette::Mid); @@ -919,7 +919,7 @@ AudioStrip::AudioStrip(QWidget* parent, AudioTrack* at) solo->setToolTip(tr("solo mode")); } - off = new TransparentToolButton(this); + off = new MusEWidget::TransparentToolButton(this); QIcon iconSet; iconSet.addPixmap(*exit1Icon, QIcon::Normal, QIcon::On); iconSet.addPixmap(*exitIcon, QIcon::Normal, QIcon::Off); @@ -967,7 +967,7 @@ AudioStrip::AudioStrip(QWidget* parent, AudioTrack* at) // automation type //--------------------------------------------------- - autoType = new ComboBox(); + autoType = new MusEWidget::ComboBox(); autoType->setFont(MusEConfig::config.fonts[1]); autoType->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum)); @@ -1025,7 +1025,7 @@ AudioStrip::AudioStrip(QWidget* parent, AudioTrack* at) void AudioStrip::iRoutePressed() { - RoutePopupMenu* pup = MusEGlobal::muse->getRoutingPopupMenu(); + MusEWidget::RoutePopupMenu* pup = MusEGlobal::muse->getRoutingPopupMenu(); iR->setDown(false); pup->exec(QCursor::pos(), track, false); } @@ -1036,7 +1036,7 @@ void AudioStrip::iRoutePressed() void AudioStrip::oRoutePressed() { - RoutePopupMenu* pup = MusEGlobal::muse->getRoutingPopupMenu(); + MusEWidget::RoutePopupMenu* pup = MusEGlobal::muse->getRoutingPopupMenu(); oR->setDown(false); pup->exec(QCursor::pos(), track, true); } diff --git a/muse2/muse/mixer/astrip.h b/muse2/muse/mixer/astrip.h index 19b1d8b9..fc25bb9b 100644 --- a/muse2/muse/mixer/astrip.h +++ b/muse2/muse/mixer/astrip.h @@ -29,17 +29,20 @@ #include "strip.h" //#include "route.h" +namespace MusEWidget { +class DoubleLabel; class Slider; class Knob; +class TransparentToolButton; +} + //class QDialog; class QToolButton; //class QAction; //class QPopupMenu; //class PopupMenu; class QButton; -class TransparentToolButton; class AudioTrack; -class DoubleLabel; class EffectRack; //--------------------------------------------------------- @@ -50,19 +53,19 @@ class AudioStrip : public Strip { Q_OBJECT int channel; - Slider* slider; - DoubleLabel* sl; + MusEWidget::Slider* slider; + MusEWidget::DoubleLabel* sl; EffectRack* rack; - Knob* pan; - DoubleLabel* panl; + MusEWidget::Knob* pan; + MusEWidget::DoubleLabel* panl; - std::vector<Knob*> auxKnob; - std::vector<DoubleLabel*> auxLabel; + std::vector<MusEWidget::Knob*> auxKnob; + std::vector<MusEWidget::DoubleLabel*> auxLabel; QToolButton* stereo; QToolButton* pre; - TransparentToolButton* off; + MusEWidget::TransparentToolButton* off; double volume; double panVal; @@ -70,7 +73,7 @@ class AudioStrip : public Strip { //QToolButton* iR; //QToolButton* oR; - Knob* addKnob(int, int, DoubleLabel**); + MusEWidget::Knob* addKnob(int, int, MusEWidget::DoubleLabel**); void updateOffState(); void updateVolume(); diff --git a/muse2/muse/mixer/auxknob.cpp b/muse2/muse/mixer/auxknob.cpp index d770fe7b..a9b9c4e2 100644 --- a/muse2/muse/mixer/auxknob.cpp +++ b/muse2/muse/mixer/auxknob.cpp @@ -25,12 +25,14 @@ #include "auxknob.h" #include "gconfig.h" +namespace MusEWidget { + //--------------------------------------------------------- // Aux //--------------------------------------------------------- AuxKnob::AuxKnob(QWidget* parent, int i) - : Knob(parent, "aux") + : MusEWidget::Knob(parent, "aux") { idx = i; setRange(MusEConfig::config.minSlider-0.1, 10.0); @@ -53,3 +55,4 @@ void AuxKnob::valueChanged(double val) emit auxChanged(idx, vol); } +} // namespace MusEWidget diff --git a/muse2/muse/mixer/auxknob.h b/muse2/muse/mixer/auxknob.h index 6e20b05a..c8693698 100644 --- a/muse2/muse/mixer/auxknob.h +++ b/muse2/muse/mixer/auxknob.h @@ -26,6 +26,8 @@ #include "knob.h" +namespace MusEWidget { + //--------------------------------------------------------- // AuxKnob //--------------------------------------------------------- @@ -44,5 +46,7 @@ class AuxKnob : public Knob { AuxKnob(QWidget* parent, int idx); }; +} // namespace MusEWidget + #endif diff --git a/muse2/muse/mixer/mstrip.cpp b/muse2/muse/mixer/mstrip.cpp index 17d21b21..d8e09adb 100644 --- a/muse2/muse/mixer/mstrip.cpp +++ b/muse2/muse/mixer/mstrip.cpp @@ -92,7 +92,7 @@ void MidiStrip::addKnob(int idx, const QString& tt, const QString& label, mn = mc->minVal(); mx = mc->maxVal(); - Knob* knob = new Knob(this); + MusEWidget::Knob* knob = new MusEWidget::Knob(this); knob->setRange(double(mn), double(mx), 1.0); knob->setId(ctl); @@ -102,7 +102,7 @@ void MidiStrip::addKnob(int idx, const QString& tt, const QString& label, knob->setToolTip(tt); knob->setEnabled(enabled); - DoubleLabel* dl = new DoubleLabel(0.0, double(mn), double(mx), this); + MusEWidget::DoubleLabel* dl = new MusEWidget::DoubleLabel(0.0, double(mn), double(mx), this); dl->setId(idx); dl->setSpecialText(tr("off")); dl->setToolTip(tr("double click on/off")); @@ -203,7 +203,7 @@ MidiStrip::MidiStrip(QWidget* parent, MidiTrack* t) int mn = mc->minVal(); int mx = mc->maxVal(); - slider = new Slider(this, "vol", Qt::Vertical, Slider::None, + slider = new MusEWidget::Slider(this, "vol", Qt::Vertical, MusEWidget::Slider::None, QColor(100, 255, 100)); slider->setCursorHoming(true); slider->setRange(double(mn), double(mx), 1.0); @@ -211,7 +211,7 @@ MidiStrip::MidiStrip(QWidget* parent, MidiTrack* t) slider->setFont(MusEConfig::config.fonts[1]); slider->setId(CTRL_VOLUME); - meter[0] = new Meter(this, Meter::LinMeter); + meter[0] = new MusEWidget::Meter(this, MusEWidget::Meter::LinMeter); meter[0]->setRange(0, 127.0); meter[0]->setFixedWidth(15); connect(meter[0], SIGNAL(mousePress()), this, SLOT(resetPeaks())); @@ -222,7 +222,7 @@ MidiStrip::MidiStrip(QWidget* parent, MidiTrack* t) sliderGrid->addWidget(meter[0], 0, 1, Qt::AlignLeft); grid->addLayout(sliderGrid, _curGridRow++, 0, 1, 2); - sl = new DoubleLabel(0.0, -98.0, 0.0, this); + sl = new MusEWidget::DoubleLabel(0.0, -98.0, 0.0, this); sl->setFont(MusEConfig::config.fonts[1]); sl->setBackgroundRole(QPalette::Mid); sl->setSpecialText(tr("off")); @@ -290,7 +290,7 @@ MidiStrip::MidiStrip(QWidget* parent, MidiTrack* t) // record, mixdownfile //--------------------------------------------------- - record = new TransparentToolButton(this); + record = new MusEWidget::TransparentToolButton(this); record->setBackgroundRole(QPalette::Mid); record->setCheckable(true); record->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum)); @@ -348,7 +348,7 @@ MidiStrip::MidiStrip(QWidget* parent, MidiTrack* t) // Special here: Must make label same size as the 'exit' button would be IF this were an audio strip... // (The 'exit1' icon is BIGGER than the 'record on' icon.) - TransparentToolButton* off = new TransparentToolButton(this); + MusEWidget::TransparentToolButton* off = new MusEWidget::TransparentToolButton(this); QIcon iconOff; iconOff.addPixmap(*exit1Icon, QIcon::Normal, QIcon::On); iconOff.addPixmap(*exitIcon, QIcon::Normal, QIcon::Off); @@ -374,7 +374,7 @@ MidiStrip::MidiStrip(QWidget* parent, MidiTrack* t) QToolTip::add(dev_ch_label, tr("output port and channel")); */ - off = new TransparentToolButton(this); + off = new MusEWidget::TransparentToolButton(this); QIcon iconOff; iconOff.addPixmap(*exit1Icon, QIcon::Normal, QIcon::On); iconOff.addPixmap(*exitIcon, QIcon::Normal, QIcon::Off); @@ -420,7 +420,7 @@ MidiStrip::MidiStrip(QWidget* parent, MidiTrack* t) // automation mode //--------------------------------------------------- - autoType = new ComboBox(); + autoType = new MusEWidget::ComboBox(); autoType->setFont(MusEConfig::config.fonts[1]); autoType->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum)); autoType->setEnabled(false); @@ -674,7 +674,7 @@ void MidiStrip::updateControls() { //if(nvolume != volume) //{ - // DoubleLabel ignores the value if already set... + // MusEWidget::DoubleLabel ignores the value if already set... sl->setValue(sl->off() - 1.0); //volume = nvolume; //} @@ -736,7 +736,7 @@ void MidiStrip::updateControls() int npan = mp->hwCtrlState(channel, CTRL_PANPOT); if(npan == CTRL_VAL_UNKNOWN) { - // DoubleLabel ignores the value if already set... + // MusEWidget::DoubleLabel ignores the value if already set... //if(npan != pan) //{ gcon->dl->setValue(gcon->dl->off() - 1.0); @@ -788,7 +788,7 @@ void MidiStrip::updateControls() int nvariSend = icl->second->hwVal(); if(nvariSend == CTRL_VAL_UNKNOWN) { - // DoubleLabel ignores the value if already set... + // MusEWidget::DoubleLabel ignores the value if already set... //if(nvariSend != variSend) //{ gcon->dl->setValue(gcon->dl->off() - 1.0); @@ -836,7 +836,7 @@ void MidiStrip::updateControls() int nreverbSend = icl->second->hwVal(); if(nreverbSend == CTRL_VAL_UNKNOWN) { - // DoubleLabel ignores the value if already set... + // MusEWidget::DoubleLabel ignores the value if already set... //if(nreverbSend != reverbSend) //{ gcon->dl->setValue(gcon->dl->off() - 1.0); @@ -884,7 +884,7 @@ void MidiStrip::updateControls() int nchorusSend = icl->second->hwVal(); if(nchorusSend == CTRL_VAL_UNKNOWN) { - // DoubleLabel ignores the value if already set... + // MusEWidget::DoubleLabel ignores the value if already set... //if(nchorusSend != chorusSend) //{ gcon->dl->setValue(gcon->dl->off() - 1.0); @@ -1012,7 +1012,7 @@ void MidiStrip::setReverbSend(double val) void MidiStrip::iRoutePressed() { - RoutePopupMenu* pup = MusEGlobal::muse->getRoutingPopupMenu(); + MusEWidget::RoutePopupMenu* pup = MusEGlobal::muse->getRoutingPopupMenu(); iR->setDown(false); pup->exec(QCursor::pos(), track, false); } @@ -1023,7 +1023,7 @@ void MidiStrip::iRoutePressed() void MidiStrip::oRoutePressed() { - RoutePopupMenu* pup = MusEGlobal::muse->getRoutingPopupMenu(); + MusEWidget::RoutePopupMenu* pup = MusEGlobal::muse->getRoutingPopupMenu(); oR->setDown(false); pup->exec(QCursor::pos(), track, true); } diff --git a/muse2/muse/mixer/mstrip.h b/muse2/muse/mixer/mstrip.h index 54adc161..2f0a133d 100644 --- a/muse2/muse/mixer/mstrip.h +++ b/muse2/muse/mixer/mstrip.h @@ -27,15 +27,20 @@ #include "strip.h" #include <QLabel> -class Slider; -class DoubleLabel; +class QAction; class QDialog; -class Knob; -class QString; -class MidiTrack; class QLabel; -class QAction; +class QString; + +namespace MusEWidget { +class DoubleLabel; +class Knob; +class Slider; class TransparentToolButton; +} + +class MidiTrack; + //--------------------------------------------------------- // MidiStrip @@ -44,13 +49,13 @@ class TransparentToolButton; class MidiStrip : public Strip { Q_OBJECT - Slider* slider; - DoubleLabel* sl; - TransparentToolButton* off; + MusEWidget::Slider* slider; + MusEWidget::DoubleLabel* sl; + MusEWidget::TransparentToolButton* off; struct KNOB { - Knob* knob; - DoubleLabel* dl; + MusEWidget::Knob* knob; + MusEWidget::DoubleLabel* dl; QLabel* lb; } controller[4]; // pan variation reverb chorus diff --git a/muse2/muse/mixer/panknob.cpp b/muse2/muse/mixer/panknob.cpp index e78a4837..077b39e1 100644 --- a/muse2/muse/mixer/panknob.cpp +++ b/muse2/muse/mixer/panknob.cpp @@ -27,11 +27,11 @@ #include "track.h" //--------------------------------------------------------- -// PanKnob +// PanMusEWidget::Knob //--------------------------------------------------------- -PanKnob::PanKnob(QWidget* parent, AudioTrack* s) - : Knob(parent, "pan") +PanMusEWidget::Knob::PanMusEWidget::Knob(QWidget* parent, AudioTrack* s) + : MusEWidget::Knob(parent, "pan") { src = s; connect(this, SIGNAL(valueChanged(double,int)), SLOT(valueChanged(double))); @@ -41,7 +41,7 @@ PanKnob::PanKnob(QWidget* parent, AudioTrack* s) // panChanged //--------------------------------------------------------- -void PanKnob::valueChanged(double val) +void PanMusEWidget::Knob::valueChanged(double val) { //audio->msgSetPan(src, val); // p4.0.21 audio->msgXXX waits. Do we really need to? diff --git a/muse2/muse/mixer/rack.cpp b/muse2/muse/mixer/rack.cpp index 86c3ff77..9e7dc754 100644 --- a/muse2/muse/mixer/rack.cpp +++ b/muse2/muse/mixer/rack.cpp @@ -414,8 +414,8 @@ void EffectRack::doubleClicked(QListWidgetItem* it) void EffectRack::savePreset(int idx) { - //QString name = getSaveFileName(QString(""), plug_file_pattern, this, - QString name = getSaveFileName(QString(""), MusEGlobal::preset_file_save_pattern, this, + //QString name = MusEWidget::getSaveFileName(QString(""), plug_file_pattern, this, + QString name = MusEWidget::getSaveFileName(QString(""), MusEGlobal::preset_file_save_pattern, this, tr("MusE: Save Preset")); if(name.isEmpty()) @@ -423,7 +423,7 @@ void EffectRack::savePreset(int idx) //FILE* presetFp = fopen(name.ascii(),"w+"); bool popenFlag; - FILE* presetFp = fileOpen(this, name, QString(".pre"), "w", popenFlag, false, true); + FILE* presetFp = MusEWidget::fileOpen(this, name, QString(".pre"), "w", popenFlag, false, true); if (presetFp == 0) { //fprintf(stderr, "EffectRack::savePreset() fopen failed: %s\n", // strerror(errno)); @@ -590,7 +590,7 @@ void EffectRack::dropEvent(QDropEvent *event) { //bool popenFlag = false; bool popenFlag; - FILE* fp = fileOpen(this, text, ".pre", "r", popenFlag, false, false); + FILE* fp = MusEWidget::fileOpen(this, text, ".pre", "r", popenFlag, false, false); if (fp) { Xml xml(fp); diff --git a/muse2/muse/mixer/strip.cpp b/muse2/muse/mixer/strip.cpp index 8f899c13..750f1623 100644 --- a/muse2/muse/mixer/strip.cpp +++ b/muse2/muse/mixer/strip.cpp @@ -97,7 +97,7 @@ void Strip::setLabelFont() // Set the label's font. label->setFont(MusEConfig::config.fonts[6]); // Dealing with a horizontally constrained label. Ignore vertical. Use a minimum readable point size. - autoAdjustFontSize(label, label->text(), false, true, MusEConfig::config.fonts[6].pointSize(), 5); + MusEUtil::autoAdjustFontSize(label, label->text(), false, true, MusEConfig::config.fonts[6].pointSize(), 5); } //--------------------------------------------------------- diff --git a/muse2/muse/mixer/strip.h b/muse2/muse/mixer/strip.h index e8bf8ce1..602e6e07 100644 --- a/muse2/muse/mixer/strip.h +++ b/muse2/muse/mixer/strip.h @@ -36,10 +36,13 @@ class Track; class QLabel; //class QVBoxLayout; -class Meter; class QToolButton; class QGridLayout; + +namespace MusEWidget { class ComboBox; +class Meter; +} static const int STRIP_WIDTH = 65; @@ -56,7 +59,7 @@ class Strip : public QFrame { //QVBoxLayout* layout; QGridLayout* grid; int _curGridRow; - Meter* meter[MAX_CHANNELS]; + MusEWidget::Meter* meter[MAX_CHANNELS]; bool useSoloIconSet2; QToolButton* record; @@ -65,7 +68,7 @@ class Strip : public QFrame { QToolButton* iR; // Input routing button QToolButton* oR; // Output routing button QGridLayout* sliderGrid; - ComboBox* autoType; + MusEWidget::ComboBox* autoType; void setLabelText(); private slots: diff --git a/muse2/muse/mplugins/midifilter.ui b/muse2/muse/mplugins/midifilter.ui index 529f893a..55263f2f 100644 --- a/muse2/muse/mplugins/midifilter.ui +++ b/muse2/muse/mplugins/midifilter.ui @@ -269,16 +269,16 @@ <number>11</number> </property> <item> - <widget class="CtrlComboBox" name="cb1" native="true"/> + <widget class="MusEWidget::CtrlComboBox" name="cb1" native="true"/> </item> <item> - <widget class="CtrlComboBox" name="cb2" native="true"/> + <widget class="MusEWidget::CtrlComboBox" name="cb2" native="true"/> </item> <item> - <widget class="CtrlComboBox" name="cb3" native="true"/> + <widget class="MusEWidget::CtrlComboBox" name="cb3" native="true"/> </item> <item> - <widget class="CtrlComboBox" name="cb4" native="true"/> + <widget class="MusEWidget::CtrlComboBox" name="cb4" native="true"/> </item> </layout> </widget> @@ -685,7 +685,7 @@ <layoutdefault spacing="6" margin="11"/> <customwidgets> <customwidget> - <class>CtrlComboBox</class> + <class>MusEWidget::CtrlComboBox</class> <extends>QWidget</extends> <header location="global">ctrlcombo.h</header> </customwidget> diff --git a/muse2/muse/plugin.cpp b/muse2/muse/plugin.cpp index a6a76a21..99d89640 100644 --- a/muse2/muse/plugin.cpp +++ b/muse2/muse/plugin.cpp @@ -3466,7 +3466,7 @@ PluginGui::PluginGui(PluginIBase* p) QSignalMapper* mapper = new QSignalMapper(this); // FIXME: There's no unsigned for gui params. We would need to limit nobj to MAXINT. // p4.0.21 - // FIXME: Our Slider class uses doubles for values, giving some problems with float conversion. // p4.0.21 + // FIXME: Our MusEWidget::Slider class uses doubles for values, giving some problems with float conversion. // p4.0.21 connect(mapper, SIGNAL(mapped(int)), SLOT(guiParamChanged(int))); @@ -3498,30 +3498,30 @@ PluginGui::PluginGui(PluginIBase* p) gw[nobj].param = parameter; gw[nobj].type = -1; - if (strcmp(obj->metaObject()->className(), "Slider") == 0) { + if (strcmp(obj->metaObject()->className(), "MusEWidget::Slider") == 0) { gw[nobj].type = GuiWidgets::SLIDER; - ((Slider*)obj)->setId(nobj); - ((Slider*)obj)->setCursorHoming(true); + ((MusEWidget::Slider*)obj)->setId(nobj); + ((MusEWidget::Slider*)obj)->setCursorHoming(true); //for(int i = 0; i < nobj; i++) for(unsigned long i = 0; i < nobj; i++) // p4.0.21 { if(gw[i].type == GuiWidgets::DOUBLE_LABEL && gw[i].param == parameter) - ((DoubleLabel*)gw[i].widget)->setSlider((Slider*)obj); + ((MusEWidget::DoubleLabel*)gw[i].widget)->setSlider((MusEWidget::Slider*)obj); } connect(obj, SIGNAL(sliderMoved(double,int)), mapper, SLOT(map())); connect(obj, SIGNAL(sliderPressed(int)), SLOT(guiSliderPressed(int))); connect(obj, SIGNAL(sliderReleased(int)), SLOT(guiSliderReleased(int))); connect(obj, SIGNAL(sliderRightClicked(const QPoint &, int)), SLOT(guiSliderRightClicked(const QPoint &, int))); } - else if (strcmp(obj->metaObject()->className(), "DoubleLabel") == 0) { + else if (strcmp(obj->metaObject()->className(), "MusEWidget::DoubleLabel") == 0) { gw[nobj].type = GuiWidgets::DOUBLE_LABEL; - ((DoubleLabel*)obj)->setId(nobj); + ((MusEWidget::DoubleLabel*)obj)->setId(nobj); //for(int i = 0; i < nobj; i++) for(unsigned long i = 0; i < nobj; i++) { if(gw[i].type == GuiWidgets::SLIDER && gw[i].param == parameter) { - ((DoubleLabel*)obj)->setSlider((Slider*)gw[i].widget); + ((MusEWidget::DoubleLabel*)obj)->setSlider((MusEWidget::Slider*)gw[i].widget); break; } } @@ -3561,7 +3561,7 @@ PluginGui::PluginGui(PluginIBase* p) unsigned long n = plugin->parameters(); // p4.0.21 params = new GuiParam[n]; - //int style = Slider::BgTrough | Slider::BgSlot; + //int style = MusEWidget::Slider::BgTrough | MusEWidget::Slider::BgSlot; QFontMetrics fm = fontMetrics(); int h = fm.height() + 4; @@ -3581,7 +3581,7 @@ PluginGui::PluginGui(PluginIBase* p) if (LADSPA_IS_HINT_TOGGLED(range.HintDescriptor)) { params[i].type = GuiParam::GUI_SWITCH; - CheckBox* cb = new CheckBox(mw, i, "param"); + MusEWidget::CheckBox* cb = new MusEWidget::CheckBox(mw, i, "param"); cb->setId(i); cb->setText(QString(plugin->paramName(i))); cb->setChecked(plugin->param(i) != 0.0); @@ -3591,13 +3591,13 @@ PluginGui::PluginGui(PluginIBase* p) else { label = new QLabel(QString(plugin->paramName(i)), 0); params[i].type = GuiParam::GUI_SLIDER; - params[i].label = new DoubleLabel(val, lower, upper, 0); + params[i].label = new MusEWidget::DoubleLabel(val, lower, upper, 0); params[i].label->setFrame(true); params[i].label->setPrecision(2); params[i].label->setId(i); - Slider* s = new Slider(0, "param", Qt::Horizontal, - Slider::None); //, style); + MusEWidget::Slider* s = new MusEWidget::Slider(0, "param", Qt::Horizontal, + MusEWidget::Slider::None); //, style); s->setCursorHoming(true); s->setId(i); @@ -3607,7 +3607,7 @@ PluginGui::PluginGui(PluginIBase* p) s->setStep(1.0); s->setValue(dval); params[i].actuator = s; - params[i].label->setSlider((Slider*)params[i].actuator); + params[i].label->setSlider((MusEWidget::Slider*)params[i].actuator); } //params[i].actuator->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Maximum)); params[i].actuator->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed)); @@ -3658,21 +3658,21 @@ PluginGui::PluginGui(PluginIBase* p) getPluginConvertedValues(range, lower, upper, dlower, dupper, dval); label = new QLabel(QString(plugin->paramOutName(i)), 0); paramsOut[i].type = GuiParam::GUI_METER; - paramsOut[i].label = new DoubleLabel(val, lower, upper, 0); + paramsOut[i].label = new MusEWidget::DoubleLabel(val, lower, upper, 0); paramsOut[i].label->setFrame(true); paramsOut[i].label->setPrecision(2); paramsOut[i].label->setId(i); - Meter::MeterType mType=Meter::LinMeter; + MusEWidget::Meter::MeterType mType=MusEWidget::Meter::LinMeter; if(LADSPA_IS_HINT_INTEGER(range.HintDescriptor)) - mType=Meter::DBMeter; - VerticalMeter* m = new VerticalMeter(this, mType); + mType=MusEWidget::Meter::DBMeter; + MusEWidget::VerticalMeter* m = new MusEWidget::VerticalMeter(this, mType); //printf("lower =%f upper=%f dlower=%f dupper=%f\n", lower, upper,dlower,dupper); m->setRange(dlower, dupper); m->setVal(dval); paramsOut[i].actuator = m; -// paramsOut[i].label->setSlider((Slider*)params[i].actuator); +// paramsOut[i].label->setMusEWidget::Slider((MusEWidget::Slider*)params[i].actuator); //paramsOut[i].actuator->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed)); label->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed)); paramsOut[i].label->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed)); @@ -3765,13 +3765,13 @@ void PluginGui::ctrlPressed(int param) if(params[param].type == GuiParam::GUI_SLIDER) { - double val = ((Slider*)params[param].actuator)->value(); + double val = ((MusEWidget::Slider*)params[param].actuator)->value(); if (LADSPA_IS_HINT_LOGARITHMIC(params[param].hint)) val = pow(10.0, val/20.0); else if (LADSPA_IS_HINT_INTEGER(params[param].hint)) val = rint(val); plugin->setParam(param, val); - ((DoubleLabel*)params[param].label)->setValue(val); + ((MusEWidget::DoubleLabel*)params[param].label)->setValue(val); // p3.3.43 //audio->msgSetPluginCtrlVal(((PluginI*)plugin), id, val); @@ -3788,8 +3788,8 @@ void PluginGui::ctrlPressed(int param) } else if(params[param].type == GuiParam::GUI_SWITCH) { - //double val = (double)((CheckBox*)params[param].actuator)->isChecked(); - float val = (float)((CheckBox*)params[param].actuator)->isChecked(); // p4.0.21 + //double val = (double)((MusEWidget::CheckBox*)params[param].actuator)->isChecked(); + float val = (float)((MusEWidget::CheckBox*)params[param].actuator)->isChecked(); // p4.0.21 plugin->setParam(param, val); // p3.3.43 @@ -3831,7 +3831,7 @@ void PluginGui::ctrlReleased(int param) if(params[param].type == GuiParam::GUI_SLIDER) { - double val = ((Slider*)params[param].actuator)->value(); + double val = ((MusEWidget::Slider*)params[param].actuator)->value(); if (LADSPA_IS_HINT_LOGARITHMIC(params[param].hint)) val = pow(10.0, val/20.0); else if (LADSPA_IS_HINT_INTEGER(params[param].hint)) @@ -3840,7 +3840,7 @@ void PluginGui::ctrlReleased(int param) } //else if(params[param].type == GuiParam::GUI_SWITCH) //{ - //double val = (double)((CheckBox*)params[param].actuator)->isChecked(); + //double val = (double)((MusEWidget::CheckBox*)params[param].actuator)->isChecked(); // No concept of 'untouching' a checkbox. Remain 'touched' until stop. //plugin->track()->stopAutoRecord(genACnum(plugin->id(), param), val); //} @@ -3878,7 +3878,7 @@ void PluginGui::sliderChanged(double val, int param) val = rint(val); if (plugin->param(param) != val) { plugin->setParam(param, val); - ((DoubleLabel*)params[param].label)->setValue(val); + ((MusEWidget::DoubleLabel*)params[param].label)->setValue(val); } int id = plugin->id(); @@ -3921,7 +3921,7 @@ void PluginGui::labelChanged(double val, int param) dval = rint(val); if (plugin->param(param) != val) { plugin->setParam(param, val); - ((Slider*)params[param].actuator)->setValue(dval); + ((MusEWidget::Slider*)params[param].actuator)->setValue(dval); } int id = plugin->id(); @@ -3955,12 +3955,12 @@ void PluginGui::load() s += plugin->pluginLabel(); s += "/"; - QString fn = getOpenFileName(s, MusEGlobal::preset_file_pattern, + QString fn = MusEWidget::getOpenFileName(s, MusEGlobal::preset_file_pattern, this, tr("MusE: load preset"), 0); if (fn.isEmpty()) return; bool popenFlag; - FILE* f = fileOpen(this, fn, QString(".pre"), "r", popenFlag, true); + FILE* f = MusEWidget::fileOpen(this, fn, QString(".pre"), "r", popenFlag, true); if (f == 0) return; @@ -4020,13 +4020,13 @@ void PluginGui::save() s += plugin->pluginLabel(); s += "/"; - //QString fn = getSaveFileName(s, MusEGlobal::preset_file_pattern, this, - QString fn = getSaveFileName(s, MusEGlobal::preset_file_save_pattern, this, + //QString fn = MusEWidget::getSaveFileName(s, MusEGlobal::preset_file_pattern, this, + QString fn = MusEWidget::getSaveFileName(s, MusEGlobal::preset_file_save_pattern, this, tr("MusE: save preset")); if (fn.isEmpty()) return; bool popenFlag; - FILE* f = fileOpen(this, fn, QString(".pre"), "w", popenFlag, false, true); + FILE* f = MusEWidget::fileOpen(this, fn, QString(".pre"), "w", popenFlag, false, true); if (f == 0) return; Xml xml(f); @@ -4083,10 +4083,10 @@ void PluginGui::updateValues() lv = sv; } gp->label->setValue(lv); - ((Slider*)(gp->actuator))->setValue(sv); + ((MusEWidget::Slider*)(gp->actuator))->setValue(sv); } else if (gp->type == GuiParam::GUI_SWITCH) { - ((CheckBox*)(gp->actuator))->setChecked(int(plugin->param(i))); + ((MusEWidget::CheckBox*)(gp->actuator))->setChecked(int(plugin->param(i))); } } } @@ -4101,10 +4101,10 @@ void PluginGui::updateValues() float val = plugin->param(param); switch(type) { case GuiWidgets::SLIDER: - ((Slider*)widget)->setValue(val); // Note conversion to double + ((MusEWidget::Slider*)widget)->setValue(val); // Note conversion to double break; case GuiWidgets::DOUBLE_LABEL: - ((DoubleLabel*)widget)->setValue(val); // Note conversion to double + ((MusEWidget::DoubleLabel*)widget)->setValue(val); // Note conversion to double break; case GuiWidgets::QCHECKBOX: ((QCheckBox*)widget)->setChecked(int(val)); @@ -4141,7 +4141,7 @@ void PluginGui::updateControls() sv = rint(lv); lv = sv; } - ((VerticalMeter*)(gp->actuator))->setVal(sv); + ((MusEWidget::VerticalMeter*)(gp->actuator))->setVal(sv); gp->label->setValue(lv); } @@ -4171,15 +4171,15 @@ void PluginGui::updateControls() sv = rint(lv); lv = sv; } - if(((Slider*)(gp->actuator))->value() != sv) + if(((MusEWidget::Slider*)(gp->actuator))->value() != sv) { //printf("PluginGui::updateControls slider\n"); gp->label->blockSignals(true); - ((Slider*)(gp->actuator))->blockSignals(true); - ((Slider*)(gp->actuator))->setValue(sv); + ((MusEWidget::Slider*)(gp->actuator))->blockSignals(true); + ((MusEWidget::Slider*)(gp->actuator))->setValue(sv); gp->label->setValue(lv); - ((Slider*)(gp->actuator))->blockSignals(false); + ((MusEWidget::Slider*)(gp->actuator))->blockSignals(false); gp->label->blockSignals(false); } } @@ -4189,13 +4189,13 @@ void PluginGui::updateControls() if( plugin->controllerEnabled(i) && plugin->controllerEnabled2(i) ) { bool v = (int)plugin->track()->pluginCtrlVal(genACnum(plugin->id(), i)); - if(((CheckBox*)(gp->actuator))->isChecked() != v) + if(((MusEWidget::CheckBox*)(gp->actuator))->isChecked() != v) { //printf("PluginGui::updateControls switch\n"); - ((CheckBox*)(gp->actuator))->blockSignals(true); - ((CheckBox*)(gp->actuator))->setChecked(v); - ((CheckBox*)(gp->actuator))->blockSignals(false); + ((MusEWidget::CheckBox*)(gp->actuator))->blockSignals(true); + ((MusEWidget::CheckBox*)(gp->actuator))->setChecked(v); + ((MusEWidget::CheckBox*)(gp->actuator))->blockSignals(false); } } } @@ -4213,13 +4213,13 @@ void PluginGui::updateControls() if( plugin->controllerEnabled(param) && plugin->controllerEnabled2(param) ) { double v = plugin->track()->pluginCtrlVal(genACnum(plugin->id(), param)); - if(((Slider*)widget)->value() != v) + if(((MusEWidget::Slider*)widget)->value() != v) { //printf("PluginGui::updateControls slider\n"); - ((Slider*)widget)->blockSignals(true); - ((Slider*)widget)->setValue(v); - ((Slider*)widget)->blockSignals(false); + ((MusEWidget::Slider*)widget)->blockSignals(true); + ((MusEWidget::Slider*)widget)->setValue(v); + ((MusEWidget::Slider*)widget)->blockSignals(false); } } break; @@ -4227,13 +4227,13 @@ void PluginGui::updateControls() if( plugin->controllerEnabled(param) && plugin->controllerEnabled2(param) ) { double v = plugin->track()->pluginCtrlVal(genACnum(plugin->id(), param)); - if(((DoubleLabel*)widget)->value() != v) + if(((MusEWidget::DoubleLabel*)widget)->value() != v) { //printf("PluginGui::updateControls label\n"); - ((DoubleLabel*)widget)->blockSignals(true); - ((DoubleLabel*)widget)->setValue(v); - ((DoubleLabel*)widget)->blockSignals(false); + ((MusEWidget::DoubleLabel*)widget)->blockSignals(true); + ((MusEWidget::DoubleLabel*)widget)->setValue(v); + ((MusEWidget::DoubleLabel*)widget)->blockSignals(false); } } break; @@ -4292,10 +4292,10 @@ void PluginGui::guiParamChanged(int idx) double val = 0.0; switch(type) { case GuiWidgets::SLIDER: - val = ((Slider*)w)->value(); + val = ((MusEWidget::Slider*)w)->value(); break; case GuiWidgets::DOUBLE_LABEL: - val = ((DoubleLabel*)w)->value(); + val = ((MusEWidget::DoubleLabel*)w)->value(); break; case GuiWidgets::QCHECKBOX: val = double(((QCheckBox*)w)->isChecked()); @@ -4313,10 +4313,10 @@ void PluginGui::guiParamChanged(int idx) int type = gw[i].type; switch(type) { case GuiWidgets::SLIDER: - ((Slider*)widget)->setValue(val); + ((MusEWidget::Slider*)widget)->setValue(val); break; case GuiWidgets::DOUBLE_LABEL: - ((DoubleLabel*)widget)->setValue(val); + ((MusEWidget::DoubleLabel*)widget)->setValue(val); break; case GuiWidgets::QCHECKBOX: ((QCheckBox*)widget)->setChecked(int(val)); @@ -4381,13 +4381,13 @@ void PluginGui::guiParamPressed(int idx) id = genACnum(id, param); // NOTE: For this to be of any use, the freeverb gui 2142.ui - // would have to be used, and changed to use CheckBox and ComboBox + // would have to be used, and changed to use MusEWidget::CheckBox and ComboBox // instead of QCheckBox and QComboBox, since both of those would // need customization (Ex. QCheckBox doesn't check on click). /* switch(type) { case GuiWidgets::QCHECKBOX: - double val = (double)((CheckBox*)w)->isChecked(); + double val = (double)((MusEWidget::CheckBox*)w)->isChecked(); track->startAutoRecord(id, val); break; case GuiWidgets::QCOMBOBOX: @@ -4427,13 +4427,13 @@ void PluginGui::guiParamReleased(int idx) id = genACnum(id, param); // NOTE: For this to be of any use, the freeverb gui 2142.ui - // would have to be used, and changed to use CheckBox and ComboBox + // would have to be used, and changed to use MusEWidget::CheckBox and ComboBox // instead of QCheckBox and QComboBox, since both of those would // need customization (Ex. QCheckBox doesn't check on click). /* switch(type) { case GuiWidgets::QCHECKBOX: - double val = (double)((CheckBox*)w)->isChecked(); + double val = (double)((MusEWidget::CheckBox*)w)->isChecked(); track->stopAutoRecord(id, param); break; case GuiWidgets::QCOMBOBOX: @@ -4469,7 +4469,7 @@ void PluginGui::guiSliderPressed(int idx) id = genACnum(id, param); - double val = ((Slider*)w)->value(); + double val = ((MusEWidget::Slider*)w)->value(); plugin->setParam(param, val); //audio->msgSetPluginCtrlVal(((PluginI*)plugin), id, val); @@ -4489,10 +4489,10 @@ void PluginGui::guiSliderPressed(int idx) int type = gw[i].type; switch(type) { case GuiWidgets::SLIDER: - ((Slider*)widget)->setValue(val); + ((MusEWidget::Slider*)widget)->setValue(val); break; case GuiWidgets::DOUBLE_LABEL: - ((DoubleLabel*)widget)->setValue(val); + ((MusEWidget::DoubleLabel*)widget)->setValue(val); break; case GuiWidgets::QCHECKBOX: ((QCheckBox*)widget)->setChecked(int(val)); @@ -4528,7 +4528,7 @@ void PluginGui::guiSliderReleased(int idx) id = genACnum(id, param); - double val = ((Slider*)w)->value(); + double val = ((MusEWidget::Slider*)w)->value(); track->stopAutoRecord(id, val); } @@ -4550,10 +4550,10 @@ void PluginGui::guiSliderRightClicked(const QPoint &p, int idx) //--------------------------------------------------------- QWidget* PluginLoader::createWidget(const QString & className, QWidget * parent, const QString & name) { - if(className == QString("DoubleLabel")) - return new DoubleLabel(parent, name.toLatin1().constData()); - if(className == QString("Slider")) - return new Slider(parent, name.toLatin1().constData(), Qt::Horizontal); + if(className == QString("MusEWidget::DoubleLabel")) + return new MusEWidget::DoubleLabel(parent, name.toLatin1().constData()); + if(className == QString("MusEWidget::Slider")) + return new MusEWidget::Slider(parent, name.toLatin1().constData(), Qt::Horizontal); return QUiLoader::createWidget(className, parent, name); }; diff --git a/muse2/muse/plugin.h b/muse2/muse/plugin.h index f70f6086..2a98760e 100644 --- a/muse2/muse/plugin.h +++ b/muse2/muse/plugin.h @@ -61,8 +61,11 @@ class QToolButton; class QTreeWidget; class Xml; -class Slider; + +namespace MusEWidget { class DoubleLabel; +} + class AudioTrack; class MidiController; @@ -265,7 +268,7 @@ struct GuiParam { int type; int hint; - DoubleLabel* label; + MusEWidget::DoubleLabel* label; QWidget* actuator; // Slider or Toggle Button (SWITCH) }; diff --git a/muse2/muse/song.cpp b/muse2/muse/song.cpp index f5a5ed90..65bfec13 100644 --- a/muse2/muse/song.cpp +++ b/muse2/muse/song.cpp @@ -2580,7 +2580,7 @@ int Song::execAutomationCtlPopup(AudioTrack* track, const QPoint& menupos, int a //menu->setItemEnabled(HEADER, false); //MenuTitleItem* title = new MenuTitleItem(tr("Automation:")); ddskrjo //menu->insertItem(title, HEADER, HEADER); ddskrjo - menu->addAction(new MenuTitleItem(tr("Automation:"), menu)); + menu->addAction(new MusEWidget::MenuTitleItem(tr("Automation:"), menu)); //menu->insertSeparator(SEP1); diff --git a/muse2/muse/sync.cpp b/muse2/muse/sync.cpp index afc378af..66055aab 100644 --- a/muse2/muse/sync.cpp +++ b/muse2/muse/sync.cpp @@ -195,7 +195,7 @@ void MidiSyncInfo::setTime() // Note: CurTime() makes a system call to gettimeofday(), // which apparently can be slow in some cases. So I avoid calling this function // too frequently by calling it (at the heartbeat rate) in Song::beat(). T356 - double t = curTime(); + double t = MusEUtil::curTime(); if(_clockTrig) { @@ -743,7 +743,7 @@ void MidiSeq::mtcInputFull(int port, const unsigned char* p, int n) if (p[3] != 1) { if (p[3] != 2) { // silently ignore user bits printf("unknown mtc msg subtype 0x%02x\n", p[3]); - dump(p, n); + MusEUtil::dump(p, n); } return; } @@ -798,7 +798,7 @@ void MidiSeq::nonRealtimeSystemSysex(int /*port*/, const unsigned char* p, int n break; default: printf("unknown NRT Msg 0x%02x\n", p[3]); - dump(p, n); + MusEUtil::dump(p, n); break; } } @@ -938,7 +938,7 @@ void MidiSeq::realtimeSystemInput(int port, int c) if(port != curMidiSyncInPort) break; - //printf("midi clock:%f\n", curTime()); + //printf("midi clock:%f\n", MusEUtil::curTime()); // Re-transmit clock to other devices if clock out turned on. // Must be careful not to allow more than one clock input at a time. @@ -966,7 +966,7 @@ void MidiSeq::realtimeSystemInput(int port, int c) if(playStateExt) { lastExtMidiSyncTime = curExtMidiSyncTime; - curExtMidiSyncTime = curTime(); + curExtMidiSyncTime = MusEUtil::curTime(); int div = MusEConfig::config.division/24; midiExtSyncTicks += div; lastExtMidiSyncTick = curExtMidiSyncTick; @@ -975,7 +975,7 @@ void MidiSeq::realtimeSystemInput(int port, int c) //BEGIN : Original code: /* - double mclock0 = curTime(); + double mclock0 = MusEUtil::curTime(); // Difference in time last 2 rounds: double tdiff0 = mclock0 - mclock1; double tdiff1 = mclock1 - mclock2; @@ -1089,7 +1089,7 @@ void MidiSeq::realtimeSystemInput(int port, int c) //BEGIN : Using external tempo map: /* - double mclock0 = curTime(); + double mclock0 = MusEUtil::curTime(); // Difference in time last 2 rounds: double tdiff0 = mclock0 - mclock1; double tdiff1 = mclock1 - mclock2; @@ -1248,7 +1248,7 @@ void MidiSeq::realtimeSystemInput(int port, int c) if (debugSync) printf(" start\n"); - //printf("midi start:%f\n", curTime()); + //printf("midi start:%f\n", MusEUtil::curTime()); if (1 /* !audio->isPlaying()*/ /*state == IDLE*/) { if (!MusEGlobal::checkAudioDevice()) return; @@ -1297,7 +1297,7 @@ void MidiSeq::realtimeSystemInput(int port, int c) if (debugSync) printf("realtimeSystemInput continue\n"); - //printf("continue:%f\n", curTime()); + //printf("continue:%f\n", MusEUtil::curTime()); if (1 /* !audio->isPlaying() */ /*state == IDLE */) { //unsigned curFrame = audio->curFrame(); @@ -1332,7 +1332,7 @@ void MidiSeq::realtimeSystemInput(int port, int c) //lastStoppedBeat = (audio->tickPos() * 4) / MusEConfig::config.division; //curExtMidiSyncTick = (MusEConfig::config.division * lastStoppedBeat) / 4; - //printf("stop:%f\n", curTime()); + //printf("stop:%f\n", MusEUtil::curTime()); if (audio->isPlaying() /*state == PLAY*/) { audio->msgPlay(false); diff --git a/muse2/muse/synth.cpp b/muse2/muse/synth.cpp index 467aca72..5435f8ce 100644 --- a/muse2/muse/synth.cpp +++ b/muse2/muse/synth.cpp @@ -911,7 +911,7 @@ const char* MessSynthIF::getPatchName(int channel, int prog, MType type, bool dr // populatePatchPopup //--------------------------------------------------------- -void MessSynthIF::populatePatchPopup(PopupMenu* menu, int ch, MType, bool) +void MessSynthIF::populatePatchPopup(MusEWidget::PopupMenu* menu, int ch, MType, bool) { menu->clear(); const MidiPatch* mp = _mess->getPatchInfo(ch, 0); diff --git a/muse2/muse/synth.h b/muse2/muse/synth.h index 43ab9370..a76d798d 100644 --- a/muse2/muse/synth.h +++ b/muse2/muse/synth.h @@ -41,7 +41,9 @@ #define SYNTH_MIDI_STATE_SAVE_VERSION 2 //class QMenu; +namespace MusEWidget { class PopupMenu; +} //class MidiEvent; class MidiPlayEvent; @@ -175,7 +177,7 @@ class SynthIF { virtual const char* getPatchName(int, int, int, bool) const = 0; virtual const char* getPatchName(int, int, MType, bool) = 0; //virtual void populatePatchPopup(QMenu*, int, MType, bool) = 0; - virtual void populatePatchPopup(PopupMenu*, int, MType, bool) = 0; + virtual void populatePatchPopup(MusEWidget::PopupMenu*, int, MType, bool) = 0; virtual void write(int level, Xml& xml) const = 0; virtual float getParameter(unsigned long idx) const = 0; virtual void setParameter(unsigned long idx, float value) = 0; @@ -260,7 +262,7 @@ class SynthI : public AudioTrack, public MidiDevice, } //virtual void populatePatchPopup(QMenu* m, int i, MType t, bool d) { - virtual void populatePatchPopup(PopupMenu* m, int i, MType t, bool d) { + virtual void populatePatchPopup(MusEWidget::PopupMenu* m, int i, MType t, bool d) { _sif->populatePatchPopup(m, i, t, d); } @@ -350,7 +352,7 @@ class MessSynthIF : public SynthIF { virtual const char* getPatchName(int, int, int, bool) const { return ""; } virtual const char* getPatchName(int, int, MType, bool); //virtual void populatePatchPopup(QMenu*, int, MType, bool); - virtual void populatePatchPopup(PopupMenu*, int, MType, bool); + virtual void populatePatchPopup(MusEWidget::PopupMenu*, int, MType, bool); virtual void write(int level, Xml& xml) const; virtual float getParameter(unsigned long) const { return 0.0; } virtual void setParameter(unsigned long, float) {} diff --git a/muse2/muse/ticksynth.cpp b/muse2/muse/ticksynth.cpp index 41e0a170..57ed6272 100644 --- a/muse2/muse/ticksynth.cpp +++ b/muse2/muse/ticksynth.cpp @@ -109,7 +109,7 @@ class MetronomeSynthIF : public SynthIF virtual const char* getPatchName(int, int, int, bool) const { return ""; } virtual const char* getPatchName(int, int, MType, bool) { return ""; } //virtual void populatePatchPopup(QMenu*, int, MType, bool) {}; - virtual void populatePatchPopup(PopupMenu*, int, MType, bool) {}; + virtual void populatePatchPopup(MusEWidget::PopupMenu*, int, MType, bool) {}; virtual void write(int, Xml&) const {} virtual float getParameter(unsigned long) const { return 0.0; } virtual void setParameter(unsigned long, float) {} diff --git a/muse2/muse/transport.cpp b/muse2/muse/transport.cpp index e51a1676..72415995 100644 --- a/muse2/muse/transport.cpp +++ b/muse2/muse/transport.cpp @@ -139,12 +139,12 @@ TempoSig::TempoSig(QWidget* parent) f->setLineWidth(1); // ORCAN get rid of l1 l2 last arguments (parent)? - l1 = new DoubleLabel(120.0, 20.0, 400.0, 0); + l1 = new MusEWidget::DoubleLabel(120.0, 20.0, 400.0, 0); l1->setFocusPolicy(Qt::NoFocus); l1->setSpecialText(QString("extern")); vb2->addWidget(l1); - l2 = new SigLabel(4, 4, 0); + l2 = new MusEWidget::SigLabel(4, 4, 0); l2->setFocusPolicy(Qt::NoFocus); vb2->addWidget(l2); diff --git a/muse2/muse/transport.h b/muse2/muse/transport.h index 0b5a4fd1..abe1534f 100644 --- a/muse2/muse/transport.h +++ b/muse2/muse/transport.h @@ -40,8 +40,11 @@ class QLabel; class QSlider; class QToolButton; +namespace MusEWidget { class DoubleLabel; class SigLabel; +} + class Pos; //--------------------------------------------------------- @@ -51,8 +54,8 @@ class Pos; class TempoSig : public QWidget { Q_OBJECT - DoubleLabel* l1; - SigLabel* l2; + MusEWidget::DoubleLabel* l1; + MusEWidget::SigLabel* l2; QLabel* l3; diff --git a/muse2/muse/wave.cpp b/muse2/muse/wave.cpp index 584d2882..6f97a3f0 100644 --- a/muse2/muse/wave.cpp +++ b/muse2/muse/wave.cpp @@ -822,8 +822,8 @@ void MusE::importWave() "a wave track")); return; } - //QString fn = getOpenFileName(MusEGlobal::lastWavePath, audioFilePattern, this, - QString fn = getOpenFileName(MusEGlobal::lastWavePath, MusEGlobal::audio_file_pattern, this, + //QString fn = MusEWidget::getOpenFileName(MusEGlobal::lastWavePath, audioFilePattern, this, + QString fn = MusEWidget::getOpenFileName(MusEGlobal::lastWavePath, MusEGlobal::audio_file_pattern, this, tr("Import Wave File"), 0); if (!fn.isEmpty()) { MusEGlobal::lastWavePath = fn; diff --git a/muse2/muse/waveedit/waveedit.cpp b/muse2/muse/waveedit/waveedit.cpp index 7ba69e95..00c68cef 100644 --- a/muse2/muse/waveedit/waveedit.cpp +++ b/muse2/muse/waveedit/waveedit.cpp @@ -201,10 +201,10 @@ WaveEdit::WaveEdit(PartList* pl) tb1->addWidget(label); label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); label->setIndent(3); - pos1 = new PosLabel(0); + pos1 = new MusEWidget::PosLabel(0); pos1->setFixedHeight(22); tb1->addWidget(pos1); - pos2 = new PosLabel(0); + pos2 = new MusEWidget::PosLabel(0); pos2->setFixedHeight(22); pos2->setSmpte(true); tb1->addWidget(pos2); @@ -224,7 +224,7 @@ WaveEdit::WaveEdit(PartList* pl) xscale = -8000; } - hscroll = new ScrollScale(1, -32768, xscale, 10000, Qt::Horizontal, mainw, 0, true, 10000.0); + hscroll = new MusEWidget::ScrollScale(1, -32768, xscale, 10000, Qt::Horizontal, mainw, 0, true, 10000.0); view = new WaveView(this, mainw, xscale, yscale); wview = view; // HACK! @@ -235,7 +235,7 @@ WaveEdit::WaveEdit(PartList* pl) ymag->setPageStep(256); ymag->setValue(yscale); - time = new MTScale(&_raster, mainw, xscale, true); + time = new MusEWidget::MTScale(&_raster, mainw, xscale, true); ymag->setFixedWidth(16); connect(view, SIGNAL(mouseWheelMoved(int)), this, SLOT(moveVerticalSlider(int))); connect(ymag, SIGNAL(valueChanged(int)), view, SLOT(setYScale(int))); @@ -248,7 +248,7 @@ WaveEdit::WaveEdit(PartList* pl) mainGrid->setColumnStretch(0, 100); mainGrid->addWidget(time, 0, 0, 1, 2); - mainGrid->addWidget(hLine(mainw), 1, 0, 1, 2); + mainGrid->addWidget(MusEUtil::hLine(mainw), 1, 0, 1, 2); mainGrid->addWidget(view, 2, 0); mainGrid->addWidget(ymag, 2, 1); mainGrid->addWidget(hscroll, 3, 0); @@ -551,11 +551,11 @@ void WaveEdit::moveVerticalSlider(int val) void WaveEdit::horizontalZoomIn() { int mag = hscroll->mag(); - int zoomlvl = ScrollScale::getQuickZoomLevel(mag); + int zoomlvl = MusEWidget::ScrollScale::getQuickZoomLevel(mag); if (zoomlvl < 23) zoomlvl++; - int newmag = ScrollScale::convertQuickZoomLevelToMag(zoomlvl); + int newmag = MusEWidget::ScrollScale::convertQuickZoomLevelToMag(zoomlvl); hscroll->setMag(newmag); @@ -564,11 +564,11 @@ void WaveEdit::horizontalZoomIn() void WaveEdit::horizontalZoomOut() { int mag = hscroll->mag(); - int zoomlvl = ScrollScale::getQuickZoomLevel(mag); + int zoomlvl = MusEWidget::ScrollScale::getQuickZoomLevel(mag); if (zoomlvl > 1) zoomlvl--; - int newmag = ScrollScale::convertQuickZoomLevelToMag(zoomlvl); + int newmag = MusEWidget::ScrollScale::convertQuickZoomLevelToMag(zoomlvl); hscroll->setMag(newmag); diff --git a/muse2/muse/waveedit/waveedit.h b/muse2/muse/waveedit/waveedit.h index 802b9389..3e5a5a61 100644 --- a/muse2/muse/waveedit/waveedit.h +++ b/muse2/muse/waveedit/waveedit.h @@ -38,11 +38,14 @@ class PartList; class WaveView; class ScrollScale; class QSlider; -class PosLabel; class QResizeEvent; class SNode; class QAction; +namespace MusEWidget { +class PosLabel; +} + //--------------------------------------------------------- // WaveEdit //--------------------------------------------------------- @@ -55,8 +58,8 @@ class WaveEdit : public MidiEditor { QToolBar* tools; QToolBar* tb1; QToolButton* solo; - PosLabel* pos1; - PosLabel* pos2; + MusEWidget::PosLabel* pos1; + MusEWidget::PosLabel* pos2; QAction* selectAllAction; QAction* selectNoneAction; QAction* cutAction; diff --git a/muse2/muse/waveedit/waveview.cpp b/muse2/muse/waveedit/waveview.cpp index b28b1914..2b3ddfbf 100644 --- a/muse2/muse/waveedit/waveview.cpp +++ b/muse2/muse/waveedit/waveview.cpp @@ -48,7 +48,7 @@ bool modifyWarnedYet = false; //--------------------------------------------------------- WaveView::WaveView(MidiEditor* pr, QWidget* parent, int xscale, int yscale) - : View(parent, xscale, 1) + : MusEWidget::View(parent, xscale, 1) { editor = pr; setVirt(true); diff --git a/muse2/muse/waveedit/waveview.h b/muse2/muse/waveedit/waveview.h index a8108dbe..664fcb51 100644 --- a/muse2/muse/waveedit/waveview.h +++ b/muse2/muse/waveedit/waveview.h @@ -48,7 +48,7 @@ typedef std::list<WaveEventSelection>::iterator iWaveSelection; // WaveView //--------------------------------------------------------- -class WaveView : public View { +class WaveView : public MusEWidget::View { Q_OBJECT MidiEditor* editor; diff --git a/muse2/muse/widgets/CMakeLists.txt b/muse2/muse/widgets/CMakeLists.txt index 8f2f9420..48299f4a 100644 --- a/muse2/muse/widgets/CMakeLists.txt +++ b/muse2/muse/widgets/CMakeLists.txt @@ -184,7 +184,7 @@ file (GLOB widgets_source_files tb1.cpp tempolabel.cpp tools.cpp - ttoolbar.cpp + # ttoolbar.cpp ttoolbutton.cpp unusedwavefiles.cpp utils.cpp diff --git a/muse2/muse/widgets/checkbox.cpp b/muse2/muse/widgets/checkbox.cpp index e707fcbc..def23730 100644 --- a/muse2/muse/widgets/checkbox.cpp +++ b/muse2/muse/widgets/checkbox.cpp @@ -24,6 +24,8 @@ #include <QMouseEvent> +namespace MusEWidget { + //--------------------------------------------------------- // CheckBox //--------------------------------------------------------- @@ -71,4 +73,4 @@ void CheckBox::mouseReleaseEvent(QMouseEvent *e) emit checkboxReleased(_id); } - +} // namespace MusEWidget diff --git a/muse2/muse/widgets/checkbox.h b/muse2/muse/widgets/checkbox.h index 19022557..d50b31d3 100644 --- a/muse2/muse/widgets/checkbox.h +++ b/muse2/muse/widgets/checkbox.h @@ -25,6 +25,7 @@ #include <QCheckBox> +namespace MusEWidget { //--------------------------------------------------------- // CheckBox @@ -55,5 +56,7 @@ class CheckBox : public QCheckBox { void setId(int i) { _id = i; } }; +} // namespace MusEWidget + #endif diff --git a/muse2/muse/widgets/citem.cpp b/muse2/muse/widgets/citem.cpp index ebca00fc..1fe861a0 100644 --- a/muse2/muse/widgets/citem.cpp +++ b/muse2/muse/widgets/citem.cpp @@ -24,6 +24,8 @@ #include "citem.h" #include <stdio.h> +namespace MusEWidget { + //--------------------------------------------------------- // CItem //--------------------------------------------------------- @@ -106,3 +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 diff --git a/muse2/muse/widgets/citem.h b/muse2/muse/widgets/citem.h index 659b898b..bdeca213 100644 --- a/muse2/muse/widgets/citem.h +++ b/muse2/muse/widgets/citem.h @@ -32,6 +32,8 @@ class Event; class Part; +namespace MusEWidget { + //--------------------------------------------------------- // CItem // virtuelle Basisklasse fr alle Canvas Item's @@ -101,5 +103,7 @@ class CItemList: public std::multimap<int, CItem*, std::less<int> > { CItem* find(const QPoint& pos) const; }; +} // namespace MusEWidget + #endif diff --git a/muse2/muse/widgets/comboQuant.cpp b/muse2/muse/widgets/comboQuant.cpp index b24ca673..c455851a 100644 --- a/muse2/muse/widgets/comboQuant.cpp +++ b/muse2/muse/widgets/comboQuant.cpp @@ -28,6 +28,8 @@ #include "comboQuant.h" +namespace MusEWidget { + static int quantTable[] = { 1, 16, 32, 64, 128, 256, 512, 1024, 1, 24, 48, 96, 192, 384, 768, 1536, @@ -107,3 +109,4 @@ void ComboQuant::setValue(int val) setCurrentIndex(0); } +} // namespace MusEWidget diff --git a/muse2/muse/widgets/comboQuant.h b/muse2/muse/widgets/comboQuant.h index 0a9460b8..8e1d80ea 100644 --- a/muse2/muse/widgets/comboQuant.h +++ b/muse2/muse/widgets/comboQuant.h @@ -30,6 +30,8 @@ class QWidget; class QTableWidget; +namespace MusEWidget { + //--------------------------------------------------------- // ComboQuant //--------------------------------------------------------- @@ -50,5 +52,7 @@ class ComboQuant : public QComboBox { void setValue(int val); }; +} + #endif diff --git a/muse2/muse/widgets/combobox.cpp b/muse2/muse/widgets/combobox.cpp index c151e3ae..d32685d0 100644 --- a/muse2/muse/widgets/combobox.cpp +++ b/muse2/muse/widgets/combobox.cpp @@ -26,6 +26,8 @@ #include "combobox.h" +namespace MusEWidget { + //--------------------------------------------------------- // ComboBox //--------------------------------------------------------- @@ -103,3 +105,4 @@ void ComboBox::addAction(const QString& s, int id) itemlist << id; } +} // namespace MusEWidget diff --git a/muse2/muse/widgets/combobox.h b/muse2/muse/widgets/combobox.h index b2f973dc..8de82989 100644 --- a/muse2/muse/widgets/combobox.h +++ b/muse2/muse/widgets/combobox.h @@ -28,6 +28,8 @@ class QMenu; class QSignalMapper; +namespace MusEWidget { + //--------------------------------------------------------- // ComboBox //--------------------------------------------------------- @@ -57,6 +59,8 @@ class ComboBox : public QToolButton { void addAction(const QString& s, int id = -1); }; +} // namespace MusEWidget + #endif diff --git a/muse2/muse/widgets/comment.cpp b/muse2/muse/widgets/comment.cpp index 926cfbb3..99fd8487 100644 --- a/muse2/muse/widgets/comment.cpp +++ b/muse2/muse/widgets/comment.cpp @@ -26,6 +26,8 @@ #include <QWidget> +namespace MusEWidget { + //--------------------------------------------------------- // Comment //--------------------------------------------------------- @@ -102,3 +104,4 @@ void TrackComment::setText(const QString& s) song->update(SC_TRACK_MODIFIED); } +} // namespace MusEWidget diff --git a/muse2/muse/widgets/comment.h b/muse2/muse/widgets/comment.h index 7aa32551..4fc0bd33 100644 --- a/muse2/muse/widgets/comment.h +++ b/muse2/muse/widgets/comment.h @@ -29,6 +29,8 @@ class Xml; class Track; class QWidget; +namespace MusEWidget { + //--------------------------------------------------------- // Comment //--------------------------------------------------------- @@ -66,5 +68,7 @@ class TrackComment : public Comment { TrackComment(Track*, QWidget*); }; +} // namespace MusEWidget + #endif diff --git a/muse2/muse/widgets/ctrlcombo.cpp b/muse2/muse/widgets/ctrlcombo.cpp index e95b0ca6..61a7e50f 100644 --- a/muse2/muse/widgets/ctrlcombo.cpp +++ b/muse2/muse/widgets/ctrlcombo.cpp @@ -23,6 +23,8 @@ #include "ctrlcombo.h" +namespace MusEWidget { + //--------------------------------------------------------- // CtrlComboBox //--------------------------------------------------------- @@ -69,3 +71,4 @@ CtrlComboBox::CtrlComboBox(QWidget* parent) insertItem(i, QString(ctxt[i])); } +} // namespace MusEWidget diff --git a/muse2/muse/widgets/ctrlcombo.h b/muse2/muse/widgets/ctrlcombo.h index dfdf42ca..dca3d91e 100644 --- a/muse2/muse/widgets/ctrlcombo.h +++ b/muse2/muse/widgets/ctrlcombo.h @@ -26,12 +26,15 @@ #include <QComboBox> +namespace MusEWidget { + class CtrlComboBox : public QComboBox { Q_OBJECT public: CtrlComboBox(QWidget* parent); }; +} // namespace MusEWidget #endif diff --git a/muse2/muse/widgets/dentry.cpp b/muse2/muse/widgets/dentry.cpp index 15f90d09..000dec50 100644 --- a/muse2/muse/widgets/dentry.cpp +++ b/muse2/muse/widgets/dentry.cpp @@ -35,6 +35,8 @@ #define TIMEC2 20 #define TIMER4 50 +namespace MusEWidget { + //--------------------------------------------------------- // Dentry // lineedit double values @@ -255,3 +257,4 @@ void Dentry::setValue(double v) val = v; } +} // namespace MusEWidget diff --git a/muse2/muse/widgets/dentry.h b/muse2/muse/widgets/dentry.h index 5cf7d7a3..1e429187 100644 --- a/muse2/muse/widgets/dentry.h +++ b/muse2/muse/widgets/dentry.h @@ -27,6 +27,8 @@ #include "sliderbase.h" +namespace MusEWidget { + //--------------------------------------------------------- // Dentry //--------------------------------------------------------- @@ -85,4 +87,7 @@ class Dentry : public QLineEdit { SliderBase* slider() const { return _slider; } void setSlider(SliderBase* s) { _slider = s; } }; + +} // namespace MusEWidget + #endif diff --git a/muse2/muse/widgets/didyouknow.h b/muse2/muse/widgets/didyouknow.h index b60e9520..212e9254 100644 --- a/muse2/muse/widgets/didyouknow.h +++ b/muse2/muse/widgets/didyouknow.h @@ -23,6 +23,7 @@ class QDialog; +namespace MusEWidget { //--------------------------------------------------------- // DidYouKnowWidget @@ -36,3 +37,5 @@ class DidYouKnowWidget : public QDialog, public Ui::DidYouKnow public: DidYouKnowWidget(QDialog *parent = 0) : QDialog(parent) { setupUi(this); } }; + +} // namespace MusEWidget diff --git a/muse2/muse/widgets/dimap.cpp b/muse2/muse/widgets/dimap.cpp index b6a2c9a3..7fff9115 100644 --- a/muse2/muse/widgets/dimap.cpp +++ b/muse2/muse/widgets/dimap.cpp @@ -26,6 +26,8 @@ #include "dimap.h" #include "mmath.h" +namespace MusEWidget { + const double DiMap::LogMin = 1.0e-150; const double DiMap::LogMax = 1.0e150; @@ -111,7 +113,7 @@ DiMap::~DiMap() bool DiMap::contains(double x) const { - return ( (x >= qwtMin(d_x1, d_x1)) && (x <= qwtMax(d_x1, d_x2))); + return ( (x >= MusEUtil::qwtMin(d_x1, d_x1)) && (x <= MusEUtil::qwtMax(d_x1, d_x2))); } //------------------------------------------------------------ @@ -128,7 +130,7 @@ bool DiMap::contains(double x) const bool DiMap::contains(int x) const { - return ( (x >= qwtMin(d_y1, d_y1)) && (x <= qwtMax(d_y1, d_y2))); + return ( (x >= MusEUtil::qwtMin(d_y1, d_y1)) && (x <= MusEUtil::qwtMax(d_y1, d_y2))); } //------------------------------------------------------------ @@ -267,10 +269,10 @@ double DiMap::invTransform(int y) const int DiMap::limTransform(double x) const { - if ( x > qwtMax(d_x1, d_x2) ) - x = qwtMax(d_x1, d_x2); - else if ( x < qwtMin(d_x1, d_x2)) - x = qwtMin(d_x1, d_x2); + 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); return transform(x); } @@ -317,3 +319,5 @@ void DiMap::newFactor() else d_cnv = 0.0; } + +} // namespace MusEWidget diff --git a/muse2/muse/widgets/dimap.h b/muse2/muse/widgets/dimap.h index faa23ab6..fc522b4e 100644 --- a/muse2/muse/widgets/dimap.h +++ b/muse2/muse/widgets/dimap.h @@ -27,6 +27,8 @@ #include <QtGlobal> +namespace MusEWidget { + class DiMap { double d_x1, d_x2; // double interval boundaries @@ -63,4 +65,6 @@ class DiMap bool logarithmic() const { return d_log;} }; +} // namespace MusEWidget + #endif diff --git a/muse2/muse/widgets/doublelabel.cpp b/muse2/muse/widgets/doublelabel.cpp index 043944f5..00d9e2fa 100644 --- a/muse2/muse/widgets/doublelabel.cpp +++ b/muse2/muse/widgets/doublelabel.cpp @@ -24,6 +24,8 @@ #include "doublelabel.h" +namespace MusEWidget { + //--------------------------------------------------------- // DoubleLabel //--------------------------------------------------------- @@ -206,3 +208,5 @@ QSize DoubleLabel::minimumSizeHint() const { return sizeHint(); } + +} // namespace MusEWidget diff --git a/muse2/muse/widgets/doublelabel.h b/muse2/muse/widgets/doublelabel.h index 20732391..d02546e6 100644 --- a/muse2/muse/widgets/doublelabel.h +++ b/muse2/muse/widgets/doublelabel.h @@ -25,6 +25,8 @@ #include "dentry.h" +namespace MusEWidget { + //--------------------------------------------------------- // DoubleLabel //--------------------------------------------------------- @@ -73,4 +75,6 @@ class DoubleLabel : public Dentry { void setSuffix(const QString& s) { _suffix = s; } }; +} // namespace MusEWidget + #endif diff --git a/muse2/muse/widgets/drange.cpp b/muse2/muse/widgets/drange.cpp index 04b51905..18868b2c 100644 --- a/muse2/muse/widgets/drange.cpp +++ b/muse2/muse/widgets/drange.cpp @@ -29,6 +29,8 @@ #include "mmath.h" #include "drange.h" +namespace MusEWidget { + const double DoubleRange::MinRelStep = 1.0e-10; const double DoubleRange::DefaultRelStep = 1.0e-2; const double DoubleRange::MinEps = 1.0e-10; @@ -71,8 +73,8 @@ void DoubleRange::setNewValue(double x, bool align) { d_prevValue = d_value; - double vmin = qwtMin(d_minValue, d_maxValue); - double vmax = qwtMax(d_minValue, d_maxValue); + double vmin = MusEUtil::qwtMin(d_minValue, d_maxValue); + double vmax = MusEUtil::qwtMax(d_minValue, d_maxValue); // Range check @@ -104,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 * qwtAbs(d_step)) + if (fabs(d_value - d_maxValue) < MinEps * MusEUtil::qwtAbs(d_step)) d_value = d_maxValue; // correct rounding error if value = 0 - if (fabs(d_value) < MinEps * qwtAbs(d_step)) + if (fabs(d_value) < MinEps * MusEUtil::qwtAbs(d_step)) d_value = 0.0; } if (d_prevValue != d_value) @@ -177,7 +179,7 @@ void DoubleRange::setRange(double vmin, double vmax, double vstep, int pageSize) // // limit page size // - d_pageSize = qwtLim(pageSize,0, int(qwtAbs((d_maxValue - d_minValue) / d_step))); + d_pageSize = MusEUtil::qwtLim(pageSize,0, int(MusEUtil::qwtAbs((d_maxValue - d_minValue) / d_step))); // // If the value lies out of the range, it @@ -271,6 +273,7 @@ void DoubleRange::incPages(int nPages) double DoubleRange::step() const { - return qwtAbs(d_step); + return MusEUtil::qwtAbs(d_step); } +} // namespace MusEWidget diff --git a/muse2/muse/widgets/drange.h b/muse2/muse/widgets/drange.h index 3b5971cf..938b70c6 100644 --- a/muse2/muse/widgets/drange.h +++ b/muse2/muse/widgets/drange.h @@ -25,6 +25,8 @@ #ifndef __DOUBLE_RANGE_H__ #define __DOUBLE_RANGE_H__ +namespace MusEWidget { + //--------------------------------------------------------- // DoubleRange //--------------------------------------------------------- @@ -77,4 +79,6 @@ class DoubleRange double step() const; }; +} // namespace MusEWidget + #endif diff --git a/muse2/muse/widgets/editnotedialogbase.ui b/muse2/muse/widgets/editnotedialogbase.ui index b19efc49..165bdf02 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="PitchEdit" name="pl" native="true"/> + <widget class="MusEWidget::PitchEdit" name="pl" native="true"/> </item> </layout> </widget> @@ -169,7 +169,7 @@ <container>0</container> </customwidget> <customwidget> - <class>PitchEdit</class> + <class>MusEWidget::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 ada1505c..0df0fa7f 100644 --- a/muse2/muse/widgets/filedialog.cpp +++ b/muse2/muse/widgets/filedialog.cpp @@ -34,6 +34,7 @@ #include "../globals.h" #include "gconfig.h" +namespace MusEWidget { MFileDialog::ViewType MFileDialog::lastViewUsed = GLOBAL_VIEW; //QString MFileDialog::lastUserDir = ""; @@ -564,3 +565,4 @@ FILE* MFile::open(const char* mode, const QStringList& pattern, return f; } +} // namespace MusEWidget diff --git a/muse2/muse/widgets/filedialog.h b/muse2/muse/widgets/filedialog.h index a2beeb3b..74297210 100644 --- a/muse2/muse/widgets/filedialog.h +++ b/muse2/muse/widgets/filedialog.h @@ -26,6 +26,8 @@ class QStringList; +namespace MusEWidget { + //--------------------------------------------------------- // FileDialogButtonsWidget // Wrapper around Ui::FileDialogButtons @@ -123,3 +125,4 @@ class MFile { bool warnIfOverwrite, const QString& caption); }; +} // namespace MusEWidget diff --git a/muse2/muse/widgets/function_dialogs/crescendo.cpp b/muse2/muse/widgets/function_dialogs/crescendo.cpp index 53d6238d..f8245b24 100644 --- a/muse2/muse/widgets/function_dialogs/crescendo.cpp +++ b/muse2/muse/widgets/function_dialogs/crescendo.cpp @@ -24,6 +24,8 @@ #include "crescendo.h" #include "xml.h" +namespace MusEDialog { + Crescendo::Crescendo(QWidget* parent) : QDialog(parent) { @@ -125,3 +127,5 @@ void Crescendo::absolute_changed(bool val) end_spinbox->setSuffix(" %"); } } + +} // namespace MusEDialog diff --git a/muse2/muse/widgets/function_dialogs/crescendo.h b/muse2/muse/widgets/function_dialogs/crescendo.h index c920d610..c0871ab8 100644 --- a/muse2/muse/widgets/function_dialogs/crescendo.h +++ b/muse2/muse/widgets/function_dialogs/crescendo.h @@ -28,6 +28,8 @@ class QButtonGroup; class Xml; +namespace MusEDialog { + class Crescendo : public QDialog, public Ui::CrescendoBase { Q_OBJECT @@ -58,5 +60,7 @@ class Crescendo : public QDialog, public Ui::CrescendoBase void absolute_changed(bool); }; +} // namespace MusEDialog + #endif diff --git a/muse2/muse/widgets/function_dialogs/deloverlaps.cpp b/muse2/muse/widgets/function_dialogs/deloverlaps.cpp index 7fa81ef5..0841b6e9 100644 --- a/muse2/muse/widgets/function_dialogs/deloverlaps.cpp +++ b/muse2/muse/widgets/function_dialogs/deloverlaps.cpp @@ -24,6 +24,7 @@ #include "deloverlaps.h" #include "xml.h" +namespace MusEDialog { DelOverlaps::DelOverlaps(QWidget* parent) : QDialog(parent) @@ -92,3 +93,5 @@ void DelOverlaps::write_configuration(int level, Xml& xml) xml.intTag(level, "range", range); xml.tag(level, "/del_overlaps"); } + +} // namespace MusEDialog diff --git a/muse2/muse/widgets/function_dialogs/deloverlaps.h b/muse2/muse/widgets/function_dialogs/deloverlaps.h index 9d51e0bd..2fc470cd 100644 --- a/muse2/muse/widgets/function_dialogs/deloverlaps.h +++ b/muse2/muse/widgets/function_dialogs/deloverlaps.h @@ -28,6 +28,8 @@ class QButtonGroup; class Xml; +namespace MusEDialog { + class DelOverlaps : public QDialog, public Ui::DelOverlapsBase { Q_OBJECT @@ -51,5 +53,7 @@ class DelOverlaps : public QDialog, public Ui::DelOverlapsBase int exec(); }; +} // namespace MusEDialog + #endif diff --git a/muse2/muse/widgets/function_dialogs/gatetime.cpp b/muse2/muse/widgets/function_dialogs/gatetime.cpp index dc810ff3..537260ca 100644 --- a/muse2/muse/widgets/function_dialogs/gatetime.cpp +++ b/muse2/muse/widgets/function_dialogs/gatetime.cpp @@ -28,6 +28,8 @@ #include "xml.h" #include "song.h" +namespace MusEDialog { + //--------------------------------------------------------- // GateTime //--------------------------------------------------------- @@ -121,3 +123,5 @@ void GateTime::write_configuration(int level, Xml& xml) xml.intTag(level, "rate", rateVal); xml.tag(level, "/mod_len"); } + +} // namespace MusEDialog diff --git a/muse2/muse/widgets/function_dialogs/gatetime.h b/muse2/muse/widgets/function_dialogs/gatetime.h index 79c6bd75..20d28948 100644 --- a/muse2/muse/widgets/function_dialogs/gatetime.h +++ b/muse2/muse/widgets/function_dialogs/gatetime.h @@ -28,6 +28,8 @@ class QButtonGroup; class Xml; +namespace MusEDialog { + //--------------------------------------------------------- // GateTime //--------------------------------------------------------- @@ -57,5 +59,7 @@ class GateTime : public QDialog, public Ui::GateTimeBase { int exec(); }; +} // namespace MusEDialog + #endif diff --git a/muse2/muse/widgets/function_dialogs/legato.cpp b/muse2/muse/widgets/function_dialogs/legato.cpp index 0c117d2c..5ca6e29b 100644 --- a/muse2/muse/widgets/function_dialogs/legato.cpp +++ b/muse2/muse/widgets/function_dialogs/legato.cpp @@ -24,6 +24,8 @@ #include "legato.h" #include "xml.h" +namespace MusEDialog { + Legato::Legato(QWidget* parent) : QDialog(parent) { @@ -101,3 +103,5 @@ void Legato::write_configuration(int level, Xml& xml) xml.intTag(level, "allow_shortening", allow_shortening); xml.tag(level, "/legato"); } + +} // namespace MusEDialog diff --git a/muse2/muse/widgets/function_dialogs/legato.h b/muse2/muse/widgets/function_dialogs/legato.h index c701a716..c2cbeabc 100644 --- a/muse2/muse/widgets/function_dialogs/legato.h +++ b/muse2/muse/widgets/function_dialogs/legato.h @@ -28,6 +28,8 @@ class QButtonGroup; class Xml; +namespace MusEDialog { + class Legato : public QDialog, public Ui::LegatoBase { Q_OBJECT @@ -54,5 +56,7 @@ class Legato : public QDialog, public Ui::LegatoBase int exec(); }; +} // namespace MusEDialog + #endif diff --git a/muse2/muse/widgets/function_dialogs/move.cpp b/muse2/muse/widgets/function_dialogs/move.cpp index 379ae30e..2529cb68 100644 --- a/muse2/muse/widgets/function_dialogs/move.cpp +++ b/muse2/muse/widgets/function_dialogs/move.cpp @@ -24,6 +24,8 @@ #include "move.h" #include "xml.h" +namespace MusEDialog { + Move::Move(QWidget* parent) : QDialog(parent) { @@ -97,3 +99,5 @@ void Move::write_configuration(int level, Xml& xml) xml.intTag(level, "amount", amount); xml.tag(level, "/move"); } + +} // namespace MusEDialog diff --git a/muse2/muse/widgets/function_dialogs/move.h b/muse2/muse/widgets/function_dialogs/move.h index c4c91484..39718134 100644 --- a/muse2/muse/widgets/function_dialogs/move.h +++ b/muse2/muse/widgets/function_dialogs/move.h @@ -28,6 +28,8 @@ class QButtonGroup; class Xml; +namespace MusEDialog { + class Move : public QDialog, public Ui::MoveBase { Q_OBJECT @@ -53,5 +55,7 @@ class Move : public QDialog, public Ui::MoveBase int exec(); }; +} // namespace MusEDialog + #endif diff --git a/muse2/muse/widgets/function_dialogs/quantize.cpp b/muse2/muse/widgets/function_dialogs/quantize.cpp index cc225d45..0841e106 100644 --- a/muse2/muse/widgets/function_dialogs/quantize.cpp +++ b/muse2/muse/widgets/function_dialogs/quantize.cpp @@ -24,6 +24,8 @@ #include "quantize.h" #include "xml.h" +namespace MusEDialog { + Quantize::Quantize(QWidget* parent) : QDialog(parent) { @@ -116,3 +118,6 @@ void Quantize::write_configuration(int level, Xml& xml) xml.intTag(level, "quant_len", quant_len); xml.tag(level, "/quantize"); } + +} // namespace MusEDialog + diff --git a/muse2/muse/widgets/function_dialogs/quantize.h b/muse2/muse/widgets/function_dialogs/quantize.h index c8b933c9..69498810 100644 --- a/muse2/muse/widgets/function_dialogs/quantize.h +++ b/muse2/muse/widgets/function_dialogs/quantize.h @@ -28,6 +28,8 @@ class QButtonGroup; class Xml; +namespace MusEDialog { + class Quantize : public QDialog, public Ui::QuantBase { Q_OBJECT @@ -57,5 +59,7 @@ class Quantize : public QDialog, public Ui::QuantBase int exec(); }; +} // namespace MusEDialog + #endif diff --git a/muse2/muse/widgets/function_dialogs/remove.cpp b/muse2/muse/widgets/function_dialogs/remove.cpp index 4742dce4..69558fc3 100644 --- a/muse2/muse/widgets/function_dialogs/remove.cpp +++ b/muse2/muse/widgets/function_dialogs/remove.cpp @@ -24,6 +24,8 @@ #include "remove.h" #include "xml.h" +namespace MusEDialog { + Remove::Remove(QWidget* parent) : QDialog(parent) { @@ -111,3 +113,6 @@ void Remove::write_configuration(int level, Xml& xml) xml.intTag(level, "len_thres_used", len_thres_used); xml.tag(level, "/erase"); } + +} // namespace MusEDialog + diff --git a/muse2/muse/widgets/function_dialogs/remove.h b/muse2/muse/widgets/function_dialogs/remove.h index 785d72eb..aba05909 100644 --- a/muse2/muse/widgets/function_dialogs/remove.h +++ b/muse2/muse/widgets/function_dialogs/remove.h @@ -28,6 +28,8 @@ class QButtonGroup; class Xml; +namespace MusEDialog { + class Remove : public QDialog, public Ui::RemoveBase { Q_OBJECT @@ -56,5 +58,7 @@ class Remove : public QDialog, public Ui::RemoveBase int exec(); }; +} // namespace MusEDialog + #endif diff --git a/muse2/muse/widgets/function_dialogs/setlen.cpp b/muse2/muse/widgets/function_dialogs/setlen.cpp index f75f878c..81a589ae 100644 --- a/muse2/muse/widgets/function_dialogs/setlen.cpp +++ b/muse2/muse/widgets/function_dialogs/setlen.cpp @@ -24,6 +24,8 @@ #include "setlen.h" #include "xml.h" +namespace MusEDialog { + Setlen::Setlen(QWidget* parent) : QDialog(parent) { @@ -96,3 +98,5 @@ void Setlen::write_configuration(int level, Xml& xml) xml.intTag(level, "len", len); xml.tag(level, "/setlen"); } + +} // namespace MusEDialog diff --git a/muse2/muse/widgets/function_dialogs/setlen.h b/muse2/muse/widgets/function_dialogs/setlen.h index 930652ab..fea6a5dd 100644 --- a/muse2/muse/widgets/function_dialogs/setlen.h +++ b/muse2/muse/widgets/function_dialogs/setlen.h @@ -28,6 +28,8 @@ class QButtonGroup; class Xml; +namespace MusEDialog { + class Setlen : public QDialog, public Ui::SetlenBase { Q_OBJECT @@ -53,5 +55,7 @@ class Setlen : public QDialog, public Ui::SetlenBase int exec(); }; +} // namespace MusEDialog + #endif diff --git a/muse2/muse/widgets/function_dialogs/transpose.cpp b/muse2/muse/widgets/function_dialogs/transpose.cpp index 1d4d512d..dd642050 100644 --- a/muse2/muse/widgets/function_dialogs/transpose.cpp +++ b/muse2/muse/widgets/function_dialogs/transpose.cpp @@ -24,6 +24,8 @@ #include "transpose.h" #include "xml.h" +namespace MusEDialog { + Transpose::Transpose(QWidget* parent) : QDialog(parent) { @@ -96,3 +98,5 @@ void Transpose::write_configuration(int level, Xml& xml) xml.intTag(level, "amount", amount); xml.tag(level, "/transpose"); } + +} // namespace MusEDialog diff --git a/muse2/muse/widgets/function_dialogs/transpose.h b/muse2/muse/widgets/function_dialogs/transpose.h index 651976d8..b6363ae5 100644 --- a/muse2/muse/widgets/function_dialogs/transpose.h +++ b/muse2/muse/widgets/function_dialogs/transpose.h @@ -28,6 +28,8 @@ class QButtonGroup; class Xml; +namespace MusEDialog { + class Transpose : public QDialog, public Ui::TransposeBase { Q_OBJECT @@ -51,5 +53,7 @@ class Transpose : public QDialog, public Ui::TransposeBase int exec(); }; +} // namespace MusEDialog + #endif diff --git a/muse2/muse/widgets/function_dialogs/velocity.cpp b/muse2/muse/widgets/function_dialogs/velocity.cpp index 56019e23..81655b5f 100644 --- a/muse2/muse/widgets/function_dialogs/velocity.cpp +++ b/muse2/muse/widgets/function_dialogs/velocity.cpp @@ -24,6 +24,8 @@ #include "velocity.h" #include "xml.h" +namespace MusEDialog { + //--------------------------------------------------------- // Velocity //--------------------------------------------------------- @@ -115,3 +117,5 @@ void Velocity::write_configuration(int level, Xml& xml) xml.intTag(level, "rate", rateVal); xml.tag(level, "/mod_velo"); } + +} // namespace MusEDialog diff --git a/muse2/muse/widgets/function_dialogs/velocity.h b/muse2/muse/widgets/function_dialogs/velocity.h index 1642a99d..9ef6cd2a 100644 --- a/muse2/muse/widgets/function_dialogs/velocity.h +++ b/muse2/muse/widgets/function_dialogs/velocity.h @@ -28,6 +28,8 @@ class QButtonGroup; class Xml; +namespace MusEDialog { + //--------------------------------------------------------- // Velocity //--------------------------------------------------------- @@ -57,5 +59,7 @@ class Velocity : public QDialog, public Ui::VelocityBase { int exec(); }; +} // namespace MusEDialog + #endif diff --git a/muse2/muse/widgets/genset.cpp b/muse2/muse/widgets/genset.cpp index d910e5a8..b8a93089 100644 --- a/muse2/muse/widgets/genset.cpp +++ b/muse2/muse/widgets/genset.cpp @@ -34,6 +34,8 @@ #include "globals.h" #include "icons.h" +namespace MusEWidget { + static int rtcResolutions[] = { 1024, 2048, 4096, 8192, 16384, 32768 }; @@ -511,3 +513,5 @@ void GlobalSettingsConfig::defaultInstrumentsPath() QString dir = MusEGlobal::configPath + "/instruments"; userInstrumentsPath->setText(dir); } + +} // namespace MusEWidget diff --git a/muse2/muse/widgets/genset.h b/muse2/muse/widgets/genset.h index 592f0395..3a2c6354 100644 --- a/muse2/muse/widgets/genset.h +++ b/muse2/muse/widgets/genset.h @@ -28,6 +28,8 @@ #include <QShowEvent> +namespace MusEWidget { + //--------------------------------------------------------- // GlobalSettingsConfig //--------------------------------------------------------- @@ -56,4 +58,6 @@ class GlobalSettingsConfig : public QDialog, public Ui::GlobalSettingsDialogBase GlobalSettingsConfig(QWidget* parent=0); }; +} // namespace MusEWidget + #endif diff --git a/muse2/muse/widgets/header.cpp b/muse2/muse/widgets/header.cpp index c720e605..8e2efe21 100644 --- a/muse2/muse/widgets/header.cpp +++ b/muse2/muse/widgets/header.cpp @@ -28,6 +28,8 @@ #include <QStandardItemModel> #include <QMouseEvent> +namespace MusEWidget { + //--------------------------------------------------------- // readStatus //--------------------------------------------------------- @@ -189,3 +191,5 @@ void Header::changeColumns(QAction *a) else hideSection(section); } + +} // namespace MusEWidget diff --git a/muse2/muse/widgets/header.h b/muse2/muse/widgets/header.h index 3f26f392..47c79192 100644 --- a/muse2/muse/widgets/header.h +++ b/muse2/muse/widgets/header.h @@ -30,6 +30,8 @@ class QStandardItemModel; class Xml; +namespace MusEWidget { + class Header : public QHeaderView { Q_OBJECT @@ -47,5 +49,7 @@ class Header : public QHeaderView { void changeColumns(QAction* a); }; +} // namespace MusEWidget + #endif diff --git a/muse2/muse/widgets/hitscale.cpp b/muse2/muse/widgets/hitscale.cpp index aaa7dd3b..c1fcdd87 100644 --- a/muse2/muse/widgets/hitscale.cpp +++ b/muse2/muse/widgets/hitscale.cpp @@ -28,6 +28,8 @@ #include "song.h" +namespace MusEWidget { + //--------------------------------------------------------- // HitScale //--------------------------------------------------------- @@ -145,4 +147,5 @@ void HitScale::pdraw(QPainter& p, const QRect& r) p.drawLine(xp, 0, xp, height()); } +} diff --git a/muse2/muse/widgets/hitscale.h b/muse2/muse/widgets/hitscale.h index fadebb8a..cf43ef4a 100644 --- a/muse2/muse/widgets/hitscale.h +++ b/muse2/muse/widgets/hitscale.h @@ -27,6 +27,8 @@ class MidiEditor; +namespace MusEWidget { + //--------------------------------------------------------- // HitScale // scale for midi track @@ -57,5 +59,8 @@ class HitScale : public View { public: HitScale(int* raster, QWidget* parent, int xscale); }; + +} // namespace MusEWidget + #endif diff --git a/muse2/muse/widgets/intlabel.cpp b/muse2/muse/widgets/intlabel.cpp index 890aac1f..6884adfb 100644 --- a/muse2/muse/widgets/intlabel.cpp +++ b/muse2/muse/widgets/intlabel.cpp @@ -25,6 +25,8 @@ #include "intlabel.h" #include "utils.h" +namespace MusEWidget { + //--------------------------------------------------------- // IntLabel //--------------------------------------------------------- @@ -39,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 = num2cols(min, max); + int len = MusEUtil::num2cols(min, max); setSize(len); } @@ -57,7 +59,7 @@ void IntLabel::setRange(int mn, int mx) { min = mn; max = mx; - setSize(num2cols(min, max)); + setSize(MusEUtil::num2cols(min, max)); int v = val; if(val < mn) v = mn; @@ -153,3 +155,4 @@ void IntLabel::setOff(int v) setString(val); } +} // namespace MusEWidget diff --git a/muse2/muse/widgets/intlabel.h b/muse2/muse/widgets/intlabel.h index f68667e4..34c075d8 100644 --- a/muse2/muse/widgets/intlabel.h +++ b/muse2/muse/widgets/intlabel.h @@ -28,6 +28,8 @@ class QString; +namespace MusEWidget { + //--------------------------------------------------------- // IntLabel //--------------------------------------------------------- @@ -58,4 +60,6 @@ class IntLabel : public Nentry { void setRange(int, int); }; +} // namespace MusEWidget + #endif diff --git a/muse2/muse/widgets/itransformbase.ui b/muse2/muse/widgets/itransformbase.ui index 51280e56..2e9fb602 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="SpinBoxFP" name="procVal1a"> + <widget class="MusEWidget::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="SpinBoxFP" name="procVal2a"> + <widget class="MusEWidget::SpinBoxFP" name="procVal2a"> <property name="maximum" stdset="0"> <number>99999999</number> </property> </widget> </item> <item row="2" column="3"> - <widget class="SpinBoxFP" name="procPortVala"> + <widget class="MusEWidget::SpinBoxFP" name="procPortVala"> <property name="maximum" stdset="0"> <number>99999999</number> </property> </widget> </item> <item row="2" column="4"> - <widget class="SpinBoxFP" name="procChannelVala"> + <widget class="MusEWidget::SpinBoxFP" name="procChannelVala"> <property name="maximum" stdset="0"> <number>99999999</number> </property> @@ -1106,7 +1106,7 @@ <layoutdefault spacing="6" margin="11"/> <customwidgets> <customwidget> - <class>SpinBoxFP</class> + <class>MusEWidget::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 e792e1ce..9bc63b33 100644 --- a/muse2/muse/widgets/knob.cpp +++ b/muse2/muse/widgets/knob.cpp @@ -34,6 +34,8 @@ #include <QPaintEvent> #include <QResizeEvent> +namespace MusEWidget { + //--------------------------------------------------------- // The QwtKnob widget imitates look and behaviour of a volume knob on a radio. // It contains @@ -333,8 +335,8 @@ void Knob::resizeEvent(QResizeEvent *) // printf("resize %d %d %d\n", r.height(), r.width(), d_knobWidth); -// width = qwtMin(qwtMin(r.height(), r.width()), d_knobWidth); - width = qwtMin(r.height(), r.width()); +// width = MusEUtil::qwtMin(MusEUtil::qwtMin(r.height(), r.width()), d_knobWidth); + width = MusEUtil::qwtMin(r.height(), r.width()); width_2 = width / 2; int x = r.x() + r.width() / 2 - width_2; @@ -423,7 +425,7 @@ void Knob::drawMarker(QPainter *p, double arc, const QColor &c) p->setBrush(c); p->setPen(Qt::NoPen); - rb = double(qwtMax(radius - 4 - d_dotWidth / 2, 0)); + rb = double(MusEUtil::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); @@ -436,8 +438,8 @@ void Knob::drawMarker(QPainter *p, double arc, const QColor &c) pn.setWidth(2); p->setPen(pn); - rb = qwtMax(double((radius - 1) / 3.0), 0.0); - re = qwtMax(double(radius - 1), 0.0); + rb = MusEUtil::qwtMax(double((radius - 1) / 3.0), 0.0); + re = MusEUtil::qwtMax(double(radius - 1), 0.0); p->setRenderHint(QPainter::Antialiasing, true); p->drawLine( xm, @@ -468,7 +470,7 @@ void Knob::drawMarker(QPainter *p, double arc, const QColor &c) //------------------------------------------------------------ void Knob::setKnobWidth(int w) { - d_knobWidth = qwtMax(w,5); + d_knobWidth = MusEUtil::qwtMax(w,5); resize(size()); repaint(); } @@ -487,7 +489,7 @@ void Knob::setKnobWidth(int w) //------------------------------------------------------------ void Knob::setBorderWidth(int bw) { - d_borderWidth = qwtMax(bw, 0); + d_borderWidth = MusEUtil::qwtMax(bw, 0); resize(size()); repaint(); } @@ -571,3 +573,4 @@ void Knob::setMarkerColor(const QColor c) repaint(); } +} // namespace MusEWidget diff --git a/muse2/muse/widgets/knob.h b/muse2/muse/widgets/knob.h index 6c44ad27..a629f158 100644 --- a/muse2/muse/widgets/knob.h +++ b/muse2/muse/widgets/knob.h @@ -30,6 +30,7 @@ #include <QResizeEvent> #include <QPaintEvent> +namespace MusEWidget { //--------------------------------------------------------- // Knob @@ -103,5 +104,6 @@ class Knob : public SliderBase, public ScaleIf void setMarkerColor(const QColor c); }; +} // namespace MusEWidget #endif diff --git a/muse2/muse/widgets/lcombo.cpp b/muse2/muse/widgets/lcombo.cpp index 6136994c..ca17e5e3 100644 --- a/muse2/muse/widgets/lcombo.cpp +++ b/muse2/muse/widgets/lcombo.cpp @@ -25,6 +25,7 @@ #include <QHBoxLayout> #include <QLabel> +namespace MusEWidget { //--------------------------------------------------------- // LabelCombo @@ -64,3 +65,5 @@ void LabelCombo::setCurrentIndex(int i) if(box->currentIndex() != r) box->setCurrentIndex(r); } + +} // namespace MusEWidget diff --git a/muse2/muse/widgets/lcombo.h b/muse2/muse/widgets/lcombo.h index 98c50158..f500dc60 100644 --- a/muse2/muse/widgets/lcombo.h +++ b/muse2/muse/widgets/lcombo.h @@ -29,6 +29,7 @@ class QString; +namespace MusEWidget { //--------------------------------------------------------- // LabelCombo @@ -56,4 +57,6 @@ class LabelCombo : public QWidget { void setFocusPolicy ( Qt::FocusPolicy fp ) { box->setFocusPolicy(fp); } }; +} // namespace MusEWidget + #endif diff --git a/muse2/muse/widgets/menutitleitem.cpp b/muse2/muse/widgets/menutitleitem.cpp index 684f6842..c15c8c64 100644 --- a/muse2/muse/widgets/menutitleitem.cpp +++ b/muse2/muse/widgets/menutitleitem.cpp @@ -22,6 +22,8 @@ #include "menutitleitem.h" +namespace MusEWidget { + //--------------------------------------------------------- // MenuTitleItem //--------------------------------------------------------- @@ -48,3 +50,4 @@ QWidget* MenuTitleItem::createWidget(QWidget *parent) return l; } +} // namespace MusEWidget diff --git a/muse2/muse/widgets/menutitleitem.h b/muse2/muse/widgets/menutitleitem.h index cfc6f6da..98573c72 100644 --- a/muse2/muse/widgets/menutitleitem.h +++ b/muse2/muse/widgets/menutitleitem.h @@ -25,6 +25,8 @@ #include <QWidgetAction> +namespace MusEWidget { + //--------------------------------------------------------- // MenuTitleItem //--------------------------------------------------------- @@ -41,4 +43,5 @@ class MenuTitleItem : public QWidgetAction { QWidget* createWidget(QWidget* /*parent*/); }; +} // namespace MusEWidget #endif diff --git a/muse2/muse/widgets/meter.cpp b/muse2/muse/widgets/meter.cpp index c4216c0c..f4d907d1 100644 --- a/muse2/muse/widgets/meter.cpp +++ b/muse2/muse/widgets/meter.cpp @@ -33,6 +33,8 @@ #include "gconfig.h" #include "fastlog.h" +namespace MusEWidget { + //--------------------------------------------------------- // Meter //--------------------------------------------------------- @@ -357,3 +359,4 @@ void Meter::mousePressEvent(QMouseEvent*) emit mousePress(); } +} // namespace MusEWidget diff --git a/muse2/muse/widgets/meter.h b/muse2/muse/widgets/meter.h index 09464988..62ad3fe0 100644 --- a/muse2/muse/widgets/meter.h +++ b/muse2/muse/widgets/meter.h @@ -32,6 +32,7 @@ class QResizeEvent; class QMouseEvent; class QPainter; +namespace MusEWidget { class Meter : public QFrame { Q_OBJECT @@ -97,5 +98,8 @@ class Meter : public QFrame { Meter(QWidget* parent, MeterType type = DBMeter); void setRange(double min, double max); }; + +} // namespace MusEWidget + #endif diff --git a/muse2/muse/widgets/metronome.cpp b/muse2/muse/widgets/metronome.cpp index 4bb58160..e639df81 100644 --- a/muse2/muse/widgets/metronome.cpp +++ b/muse2/muse/widgets/metronome.cpp @@ -30,6 +30,8 @@ #include "track.h" #include "audio.h" +namespace MusEWidget { + //--------------------------------------------------------- // MetronomeConfig //--------------------------------------------------------- @@ -196,3 +198,6 @@ void MetronomeConfig::beepVolumeChanged(int volume) // this value is directly applied, not using th Apply button, it just seems more usable this way. MusEGlobal::audioClickVolume=volume/100.0; } + +} // namespace MusEWidget + diff --git a/muse2/muse/widgets/metronome.h b/muse2/muse/widgets/metronome.h index 93dc05f0..62edcdc5 100644 --- a/muse2/muse/widgets/metronome.h +++ b/muse2/muse/widgets/metronome.h @@ -28,6 +28,8 @@ class QDialog; +namespace MusEWidget { + //--------------------------------------------------------- // MetronomeConfig //--------------------------------------------------------- @@ -48,4 +50,7 @@ class MetronomeConfig : public QDialog, public Ui::MetronomeConfigBase { public: MetronomeConfig(QDialog* parent=0); }; + +} // namespace MusEWidget + #endif diff --git a/muse2/muse/widgets/midisyncimpl.cpp b/muse2/muse/widgets/midisyncimpl.cpp index 1e6e27e2..89075af9 100644 --- a/muse2/muse/widgets/midisyncimpl.cpp +++ b/muse2/muse/widgets/midisyncimpl.cpp @@ -41,6 +41,8 @@ #include "driver/audiodev.h" #include "audio.h" +namespace MusEWidget { + 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, */ }; @@ -1266,3 +1268,4 @@ void MidiSyncConfig::setDirty() applyButton->setEnabled(true); } +} // namespace MusEWidget diff --git a/muse2/muse/widgets/midisyncimpl.h b/muse2/muse/widgets/midisyncimpl.h index 21300be9..ddccf7c9 100644 --- a/muse2/muse/widgets/midisyncimpl.h +++ b/muse2/muse/widgets/midisyncimpl.h @@ -31,6 +31,8 @@ class QCloseEvent; class QDialog; class QTreeWidgetItem; +namespace MusEWidget { + //---------------------------------------------------------- // MidiSyncLViewItem //---------------------------------------------------------- @@ -130,5 +132,7 @@ class MidiSyncConfig : public QDialog, public Ui::MidiSyncConfigBase { void setDirty(); }; +} // namespace MusEWidget + #endif diff --git a/muse2/muse/widgets/mittransposebase.ui b/muse2/muse/widgets/mittransposebase.ui index b29e34ed..06a18029 100644 --- a/muse2/muse/widgets/mittransposebase.ui +++ b/muse2/muse/widgets/mittransposebase.ui @@ -44,7 +44,7 @@ </widget> </item> <item> - <widget class="PitchEdit" name="triggerKeySpinBox" native="true"/> + <widget class="MusEWidget::PitchEdit" name="triggerKeySpinBox" native="true"/> </item> <item> <widget class="QLabel" name="TextLabel2"> @@ -101,7 +101,7 @@ <layoutdefault spacing="6" margin="11"/> <customwidgets> <customwidget> - <class>PitchEdit</class> + <class>MusEWidget::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 40bf69c3..01c1d049 100644 --- a/muse2/muse/widgets/mixdowndialog.cpp +++ b/muse2/muse/widgets/mixdowndialog.cpp @@ -33,13 +33,15 @@ SndFile* getSndFile(const SndFile* sf, QWidget* parent) { - MixdownFileDialog* dialog = new MixdownFileDialog(sf, parent); + MusEWidget::MixdownFileDialog* dialog = new MusEWidget::MixdownFileDialog(sf, parent); dialog->exec(); SndFile* sndFile = dialog->sndFile(); delete dialog; return sndFile; } +namespace MusEWidget { + //--------------------------------------------------------- // MixdownFileDialog //--------------------------------------------------------- @@ -118,3 +120,4 @@ void MixdownFileDialog::fdialog() editPath->setText(path); } +} // namespace MusEWidget diff --git a/muse2/muse/widgets/mixdowndialog.h b/muse2/muse/widgets/mixdowndialog.h index 71eafa8b..cca60178 100644 --- a/muse2/muse/widgets/mixdowndialog.h +++ b/muse2/muse/widgets/mixdowndialog.h @@ -31,6 +31,8 @@ class SndFile; extern SndFile* getSndFile(const SndFile* sf, QWidget* parent); +namespace MusEWidget { + //--------------------------------------------------------- // MixdownFileDialog //--------------------------------------------------------- @@ -49,5 +51,7 @@ class MixdownFileDialog : public QDialog, public Ui::MixdownFileDialogBase { SndFile* sndFile() { return sf; } }; +} + #endif diff --git a/muse2/muse/widgets/mlabel.cpp b/muse2/muse/widgets/mlabel.cpp index 6f1b3810..071427b6 100644 --- a/muse2/muse/widgets/mlabel.cpp +++ b/muse2/muse/widgets/mlabel.cpp @@ -22,9 +22,11 @@ #include "mlabel.h" +namespace MusEWidget { void MLabel::mousePressEvent(QMouseEvent*) { emit mousePressed(); } +} // namespace MusEWidget diff --git a/muse2/muse/widgets/mlabel.h b/muse2/muse/widgets/mlabel.h index 07c83feb..64a52220 100644 --- a/muse2/muse/widgets/mlabel.h +++ b/muse2/muse/widgets/mlabel.h @@ -25,6 +25,8 @@ #include <QLabel> +namespace MusEWidget { + //--------------------------------------------------------- // MLabel // label widged which sends signal mousePressed @@ -48,5 +50,8 @@ class MLabel : public QLabel { MLabel(QWidget* parent, const char* name = 0) : QLabel(parent) {setObjectName(name);}; }; + +} // namespace MusEWidget + #endif diff --git a/muse2/muse/widgets/mmath.cpp b/muse2/muse/widgets/mmath.cpp index 31c22744..52dffea2 100644 --- a/muse2/muse/widgets/mmath.cpp +++ b/muse2/muse/widgets/mmath.cpp @@ -46,6 +46,7 @@ // qwtInt -- Return nearest integer // qwtLim -- Limit a values +namespace MusEUtil { //------------------------------------------------------------ //.F qwtGetMin @@ -320,3 +321,5 @@ void qwtLogSpace(double *array, int size, double xmin, double xmax) array[i] = exp(lxmin + double(i) * lstep); } + +} // namespace MusEUtil diff --git a/muse2/muse/widgets/mmath.h b/muse2/muse/widgets/mmath.h index 0449b3ad..813aed93 100644 --- a/muse2/muse/widgets/mmath.h +++ b/muse2/muse/widgets/mmath.h @@ -27,6 +27,8 @@ #define LOG_MIN 1.0e-100 #define LOG_MAX 1.0e100 +namespace MusEUtil { + double qwtCeil125(double x); double qwtFloor125(double x); void qwtTwistArray(double *array, int size); @@ -88,5 +90,7 @@ T qwtLim(const T& x, const T& x1, const T& x2) return rv; } +} + #endif diff --git a/muse2/muse/widgets/mtrackinfo.cpp b/muse2/muse/widgets/mtrackinfo.cpp index 60baebce..e4c4e217 100644 --- a/muse2/muse/widgets/mtrackinfo.cpp +++ b/muse2/muse/widgets/mtrackinfo.cpp @@ -43,6 +43,8 @@ #include "popupmenu.h" #include "routepopup.h" +namespace MusEWidget { + //--------------------------------------------------------- // setTrack //--------------------------------------------------------- @@ -557,7 +559,7 @@ void MidiTrackInfo::setLabelFont() // Set the label's font. trackNameLabel->setFont(MusEConfig::config.fonts[6]); // Dealing with a horizontally constrained label. Ignore vertical. Use a minimum readable point size. - autoAdjustFontSize(trackNameLabel, trackNameLabel->text(), false, true, MusEConfig::config.fonts[6].pointSize(), 5); + MusEUtil::autoAdjustFontSize(trackNameLabel, trackNameLabel->text(), false, true, MusEConfig::config.fonts[6].pointSize(), 5); } //--------------------------------------------------------- @@ -1564,3 +1566,4 @@ void MidiTrackInfo::recordClicked() } } +} // namespace MusEWidget diff --git a/muse2/muse/widgets/mtrackinfo.h b/muse2/muse/widgets/mtrackinfo.h index 122d8aa0..42be1f58 100644 --- a/muse2/muse/widgets/mtrackinfo.h +++ b/muse2/muse/widgets/mtrackinfo.h @@ -26,6 +26,8 @@ class Track; +namespace MusEWidget { + //--------------------------------------------------------- // MidiTrackInfo //--------------------------------------------------------- @@ -80,7 +82,7 @@ class MidiTrackInfo : public QWidget, public Ui::MidiTrackInfoBase void updateTrackInfo(int); }; - +} // namespace MusEWidget #endif diff --git a/muse2/muse/widgets/mtrackinfobase.ui b/muse2/muse/widgets/mtrackinfobase.ui index 53e772c8..99c06ad0 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="SpinBox" name="iOutputChannel"> + <widget class="MusEWidget::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="SpinBox" name="iTransp"> + <widget class="MusEWidget::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="SpinBox" name="iVerz"> + <widget class="MusEWidget::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="SpinBox" name="iLen"> + <widget class="MusEWidget::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="SpinBox" name="iAnschl"> + <widget class="MusEWidget::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="SpinBox" name="iKompr"> + <widget class="MusEWidget::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="SpinBox" name="iHBank"> + <widget class="MusEWidget::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="SpinBox" name="iLBank"> + <widget class="MusEWidget::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="SpinBox" name="iProgram"> + <widget class="MusEWidget::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="SpinBox" name="iLautst"> + <widget class="MusEWidget::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="SpinBox" name="iPan"> + <widget class="MusEWidget::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>SpinBox</class> + <class>MusEWidget::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 d7046fa7..1bd34de3 100644 --- a/muse2/muse/widgets/mtscale.cpp +++ b/muse2/muse/widgets/mtscale.cpp @@ -30,6 +30,8 @@ #include "icons.h" #include "gconfig.h" +namespace MusEWidget { + //--------------------------------------------------------- // MTScale // Midi Time Scale @@ -431,3 +433,4 @@ void MTScale::pdraw(QPainter& p, const QRect& r) } } +} // namespace MusEWidget diff --git a/muse2/muse/widgets/mtscale.h b/muse2/muse/widgets/mtscale.h index 36443fca..820e33c6 100644 --- a/muse2/muse/widgets/mtscale.h +++ b/muse2/muse/widgets/mtscale.h @@ -26,6 +26,8 @@ #include "view.h" +namespace MusEWidget { + //--------------------------------------------------------- // MTScale // scale for midi track @@ -60,5 +62,8 @@ class MTScale : public View { MTScale(int* raster, QWidget* parent, int xscale, bool f = false); void setBarLocator(bool f) { barLocator = f; } }; + +} + #endif diff --git a/muse2/muse/widgets/mtscale_flo.cpp b/muse2/muse/widgets/mtscale_flo.cpp index e60738bb..50abf75d 100644 --- a/muse2/muse/widgets/mtscale_flo.cpp +++ b/muse2/muse/widgets/mtscale_flo.cpp @@ -31,6 +31,8 @@ #include "gconfig.h" #include "scoreedit.h" +namespace MusEWidget { + //--------------------------------------------------------- // MTScale // Midi Time Scale @@ -338,3 +340,5 @@ void MTScaleFlo::pos_add_changed() { redraw(); } + +} // namespace MusEWidget diff --git a/muse2/muse/widgets/mtscale_flo.h b/muse2/muse/widgets/mtscale_flo.h index 3ac30651..b7169ab6 100644 --- a/muse2/muse/widgets/mtscale_flo.h +++ b/muse2/muse/widgets/mtscale_flo.h @@ -28,6 +28,8 @@ class ScoreCanvas; +namespace MusEWidget { + //--------------------------------------------------------- // MTScaleFlo // scale for midi track @@ -62,5 +64,8 @@ class MTScaleFlo : public View { public: MTScaleFlo(ScoreCanvas* parent_editor, QWidget* parent_widget); }; + +} // namespace MusEWidget + #endif diff --git a/muse2/muse/widgets/nentry.cpp b/muse2/muse/widgets/nentry.cpp index c5132f83..13569b0d 100644 --- a/muse2/muse/widgets/nentry.cpp +++ b/muse2/muse/widgets/nentry.cpp @@ -36,6 +36,8 @@ #define TIMEC2 20 #define TIMER4 50 +namespace MusEWidget { + NentryFilter::NentryFilter(QObject* parent) : QObject(parent) { @@ -414,3 +416,4 @@ bool Nentry::keyPress(QKeyEvent* event) return true; } +} // namespace MusEWidget diff --git a/muse2/muse/widgets/nentry.h b/muse2/muse/widgets/nentry.h index a82a258c..c0508c63 100644 --- a/muse2/muse/widgets/nentry.h +++ b/muse2/muse/widgets/nentry.h @@ -30,6 +30,8 @@ class QLabel; class QLineEdit; class QTimer; +namespace MusEWidget { + class NentryFilter : public QObject { Q_OBJECT @@ -96,4 +98,7 @@ class Nentry : public QFrame { void setFocusPolicy(Qt::FocusPolicy); bool contextMenu(QContextMenuEvent*); }; + +} // namespace MusEWidget + #endif diff --git a/muse2/muse/widgets/noteinfo.cpp b/muse2/muse/widgets/noteinfo.cpp index 78e8e882..2a262723 100644 --- a/muse2/muse/widgets/noteinfo.cpp +++ b/muse2/muse/widgets/noteinfo.cpp @@ -31,6 +31,8 @@ ///#include "posedit.h" #include "pitchedit.h" +namespace MusEWidget { + //--------------------------------------------------- // NoteInfo // ToolBar @@ -224,3 +226,4 @@ void NoteInfo::timeChanged(const Pos& pos) emit valueChanged(VAL_TIME, pos.tick()); } +} // namespace MusEWidget diff --git a/muse2/muse/widgets/noteinfo.h b/muse2/muse/widgets/noteinfo.h index 499662a6..6ca34a42 100644 --- a/muse2/muse/widgets/noteinfo.h +++ b/muse2/muse/widgets/noteinfo.h @@ -32,9 +32,12 @@ namespace Awl { class QSpinBox; ///class PosEdit; -class PitchEdit; class Pos; +namespace MusEWidget { + +class PitchEdit; + //--------------------------------------------------------- // NoteInfo //--------------------------------------------------------- @@ -72,5 +75,8 @@ class NoteInfo : public QToolBar { signals: void valueChanged(NoteInfo::ValType, int); }; + +} // namespace MusEWidget + #endif diff --git a/muse2/muse/widgets/pitchedit.cpp b/muse2/muse/widgets/pitchedit.cpp index 61e962fc..7d637d01 100644 --- a/muse2/muse/widgets/pitchedit.cpp +++ b/muse2/muse/widgets/pitchedit.cpp @@ -24,6 +24,8 @@ #include "pitchedit.h" #include "helper.h" +namespace MusEWidget { + //--------------------------------------------------------- // PitchEdit //--------------------------------------------------------- @@ -77,3 +79,4 @@ void PitchEdit::setDeltaMode(bool val) setRange(0, 127); } +} // namespace MusEWidget diff --git a/muse2/muse/widgets/pitchedit.h b/muse2/muse/widgets/pitchedit.h index 6cce3f1d..0c334d22 100644 --- a/muse2/muse/widgets/pitchedit.h +++ b/muse2/muse/widgets/pitchedit.h @@ -25,6 +25,10 @@ #include <QSpinBox> +extern QString pitch2string(int v); + +namespace MusEWidget { + //--------------------------------------------------------- // PitchEdit //--------------------------------------------------------- @@ -43,6 +47,6 @@ class PitchEdit : public QSpinBox { void setDeltaMode(bool); }; -extern QString pitch2string(int v); +} // namespace MusEWidget #endif diff --git a/muse2/muse/widgets/pitchlabel.cpp b/muse2/muse/widgets/pitchlabel.cpp index b9cd6d3d..b1f062a8 100644 --- a/muse2/muse/widgets/pitchlabel.cpp +++ b/muse2/muse/widgets/pitchlabel.cpp @@ -27,6 +27,8 @@ #include "pitchlabel.h" #include "helper.h" +namespace MusEWidget { + //--------------------------------------------------------- // PitchLabel //--------------------------------------------------------- @@ -110,3 +112,4 @@ void PitchLabel::setPitch(int val) setValue(val); } +} // namespace MusEWidget diff --git a/muse2/muse/widgets/pitchlabel.h b/muse2/muse/widgets/pitchlabel.h index da0c42e8..3fe2eb42 100644 --- a/muse2/muse/widgets/pitchlabel.h +++ b/muse2/muse/widgets/pitchlabel.h @@ -25,6 +25,8 @@ #include <QLabel> +namespace MusEWidget { + //--------------------------------------------------------- // PitchLabel //--------------------------------------------------------- @@ -51,6 +53,7 @@ class PitchLabel : public QLabel { bool pitchMode() const { return _pitchMode; } }; +} // namespace MusEWidget #endif diff --git a/muse2/muse/widgets/popupmenu.cpp b/muse2/muse/widgets/popupmenu.cpp index 827e60b9..2b0b6711 100644 --- a/muse2/muse/widgets/popupmenu.cpp +++ b/muse2/muse/widgets/popupmenu.cpp @@ -41,6 +41,8 @@ #include "route.h" +namespace MusEWidget { + //====================== // PopupMenu //====================== @@ -388,3 +390,4 @@ void PopupView::clear() } */ +} // namespace MusEWidget diff --git a/muse2/muse/widgets/popupmenu.h b/muse2/muse/widgets/popupmenu.h index 309adfdb..b51cfd56 100644 --- a/muse2/muse/widgets/popupmenu.h +++ b/muse2/muse/widgets/popupmenu.h @@ -47,6 +47,8 @@ class QEvent; //class QTimer; //class QStandardItemModel; +namespace MusEWidget { + class PopupMenu : public QMenu { Q_OBJECT @@ -99,6 +101,7 @@ class PopupView : public QColumnView }; */ +} // namespace MusEWidget #endif diff --git a/muse2/muse/widgets/posedit.cpp b/muse2/muse/widgets/posedit.cpp index c09a385b..0e031c38 100644 --- a/muse2/muse/widgets/posedit.cpp +++ b/muse2/muse/widgets/posedit.cpp @@ -38,6 +38,8 @@ extern int mtcType; +namespace MusEWidget { + //--------------------------------------------------------- // QNumberSection //--------------------------------------------------------- @@ -867,3 +869,5 @@ void PosEdit::setEnabled(bool v) QWidget::setEnabled(v); updateButtons(); } + +} // namespace MusEWidget diff --git a/muse2/muse/widgets/posedit.h b/muse2/muse/widgets/posedit.h index 8db08d59..3224a3a6 100644 --- a/muse2/muse/widgets/posedit.h +++ b/muse2/muse/widgets/posedit.h @@ -34,6 +34,8 @@ class QTimerEvent; class PosEditor; class SpinBox; +namespace MusEWidget { + //--------------------------------------------------------- // PosEdit //--------------------------------------------------------- @@ -116,4 +118,6 @@ class PosEdit : public QWidget void enterPressed(); }; +} // namespace MusEWidget + #endif diff --git a/muse2/muse/widgets/poslabel.cpp b/muse2/muse/widgets/poslabel.cpp index cb54de0c..98a7eba3 100644 --- a/muse2/muse/widgets/poslabel.cpp +++ b/muse2/muse/widgets/poslabel.cpp @@ -35,6 +35,8 @@ extern int mtcType; +namespace MusEWidget { + //--------------------------------------------------------- // PosLabel //--------------------------------------------------------- @@ -169,3 +171,4 @@ void PosLabel::setSmpte(bool val) updateValue(); } +} // namespace MusEWidget diff --git a/muse2/muse/widgets/poslabel.h b/muse2/muse/widgets/poslabel.h index f458ec6c..38236ac7 100644 --- a/muse2/muse/widgets/poslabel.h +++ b/muse2/muse/widgets/poslabel.h @@ -25,6 +25,8 @@ #include <QLabel> +namespace MusEWidget { + //--------------------------------------------------------- // PosLabel //--------------------------------------------------------- @@ -56,6 +58,7 @@ class PosLabel : public QLabel { bool smpte() const { return _smpte; } }; +} // namespace MusEWidget #endif diff --git a/muse2/muse/widgets/projectcreateimpl.cpp b/muse2/muse/widgets/projectcreateimpl.cpp index bb36f6f4..d6f918b3 100644 --- a/muse2/muse/widgets/projectcreateimpl.cpp +++ b/muse2/muse/widgets/projectcreateimpl.cpp @@ -28,6 +28,8 @@ #include "globals.h" #include "app.h" +namespace MusEWidget { + ProjectCreateImpl::ProjectCreateImpl(QWidget *parent) : QDialog(parent) { @@ -91,3 +93,5 @@ void ProjectCreateImpl::ok() MusEGlobal::muse->changeConfig(true); emit accept(); } + +} //namespace MusEWidget diff --git a/muse2/muse/widgets/projectcreateimpl.h b/muse2/muse/widgets/projectcreateimpl.h index aa5613f4..d6881840 100644 --- a/muse2/muse/widgets/projectcreateimpl.h +++ b/muse2/muse/widgets/projectcreateimpl.h @@ -26,6 +26,8 @@ #include <QDialog> #include "ui_projectcreate.h" +namespace MusEWidget { + class ProjectCreateImpl : public QDialog, Ui::ProjectCreate { Q_OBJECT @@ -45,4 +47,6 @@ public slots: }; +} // namespace MusEWidget + #endif // PROJECTCREATEIMPL_H diff --git a/muse2/muse/widgets/routepopup.cpp b/muse2/muse/widgets/routepopup.cpp index e2d83b65..ec3f3ea0 100644 --- a/muse2/muse/widgets/routepopup.cpp +++ b/muse2/muse/widgets/routepopup.cpp @@ -34,6 +34,8 @@ #include "menutitleitem.h" #include "popupmenu.h" +namespace MusEWidget { + //--------------------------------------------------------- // addMenuItem //--------------------------------------------------------- @@ -1420,3 +1422,4 @@ void RoutePopupMenu::popup(const QPoint& p, Track* track, bool isOutput) _pup->popup(p); } +} // namespace MusEWidget diff --git a/muse2/muse/widgets/routepopup.h b/muse2/muse/widgets/routepopup.h index 330a800b..7f5a8820 100644 --- a/muse2/muse/widgets/routepopup.h +++ b/muse2/muse/widgets/routepopup.h @@ -27,12 +27,15 @@ class Track; class AudioTrack; -class PopupMenu; class QWidget; class QString; class QAction; class QPoint; +namespace MusEWidget { + +class PopupMenu; + class RoutePopupMenu : public QObject { Q_OBJECT @@ -72,4 +75,6 @@ class RoutePopupMenu : public QObject void popup(const QPoint& p, Track* track = 0, bool isOutput = false); }; +} + #endif diff --git a/muse2/muse/widgets/scldiv.cpp b/muse2/muse/widgets/scldiv.cpp index f0058848..ba19f659 100644 --- a/muse2/muse/widgets/scldiv.cpp +++ b/muse2/muse/widgets/scldiv.cpp @@ -26,6 +26,8 @@ #include "scldiv.h" #include "mmath.h" +namespace MusEWidget { + // ScaleDiv - A class for building scale divisions // // The ScaleDiv class can build @@ -82,10 +84,10 @@ static bool limRange(double &val, double v1, double v2, double eps_rel = 0.0, { bool rv = TRUE; - double vmin = qwtMin(v1, v2); - double vmax = qwtMax(v1, v2); - double delta_min = qwtMax(qwtAbs(eps_rel * vmin), qwtAbs(eps_abs)); - double delta_max = qwtMax(qwtAbs(eps_rel * vmax), qwtAbs(eps_abs)); + 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)); if (val < vmin) { @@ -231,8 +233,8 @@ bool ScaleDiv::rebuild(double x1, double x2, int maxMajSteps, int maxMinSteps, int rv; - d_lBound = qwtMin(x1, x2); - d_hBound = qwtMax(x1, x2); + d_lBound = MusEUtil::qwtMin(x1, x2); + d_hBound = MusEUtil::qwtMax(x1, x2); d_log = log; if (d_log) @@ -244,8 +246,8 @@ bool ScaleDiv::rebuild(double x1, double x2, int maxMajSteps, int maxMinSteps, { d_lBound = x1; d_hBound = x2; - qwtTwistArray(d_majMarks.data(), d_majMarks.size()); - qwtTwistArray(d_minMarks.data(), d_minMarks.size()); + MusEUtil::qwtTwistArray(d_majMarks.data(), d_majMarks.size()); + MusEUtil::qwtTwistArray(d_minMarks.data(), d_minMarks.size()); } return rv; @@ -291,9 +293,9 @@ bool ScaleDiv::buildLinDiv(int maxMajSteps, int maxMinSteps, double step) bool rv = TRUE; // parameter range check - maxMajSteps = qwtMax(1, maxMajSteps); - maxMinSteps = qwtMax(0, maxMinSteps); - step = qwtAbs(step); + maxMajSteps = MusEUtil::qwtMax(1, maxMajSteps); + maxMinSteps = MusEUtil::qwtMax(0, maxMinSteps); + step = MusEUtil::qwtAbs(step); // reset vectors d_minMarks.resize(0); @@ -305,7 +307,7 @@ bool ScaleDiv::buildLinDiv(int maxMajSteps, int maxMinSteps, double step) // Set up major divisions // if (step == 0.0) - d_majStep = qwtCeil125(qwtAbs(d_hBound - d_lBound) * 0.999999 + d_majStep = MusEUtil::qwtCeil125(MusEUtil::qwtAbs(d_hBound - d_lBound) * 0.999999 / double(maxMajSteps)); else d_majStep = step; @@ -315,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 = qwtMin(10000, int(rint((lastTick - firstTick) / d_majStep)) + 1); + nMaj = MusEUtil::qwtMin(10000, int(rint((lastTick - firstTick) / d_majStep)) + 1); d_majMarks.resize(nMaj); - qwtLinSpace(d_majMarks.data(), d_majMarks.size(), firstTick, lastTick); + MusEUtil::qwtLinSpace(d_majMarks.data(), d_majMarks.size(), firstTick, lastTick); // // Set up minor divisions @@ -326,14 +328,14 @@ bool ScaleDiv::buildLinDiv(int maxMajSteps, int maxMinSteps, double step) if (maxMinSteps < 1) // no minor divs return TRUE; - minStep = qwtCeil125( d_majStep / double(maxMinSteps) ); + minStep = MusEUtil::qwtCeil125( d_majStep / double(maxMinSteps) ); if (minStep == 0.0) return TRUE; - nMin = qwtAbs(int(rint(d_majStep / minStep))) - 1; // # minor steps per interval + nMin = MusEUtil::qwtAbs(int(rint(d_majStep / minStep))) - 1; // # minor steps per interval // Do the minor steps fit into the interval? - if ( qwtAbs(double(nMin + 1) * minStep - d_majStep) > step_eps * d_majStep) + if ( MusEUtil::qwtAbs(double(nMin + 1) * minStep - d_majStep) > step_eps * d_majStep) { nMin = 1; minStep = d_majStep * 0.5; @@ -408,9 +410,9 @@ bool ScaleDiv::buildLogDiv(int maxMajSteps, int maxMinSteps, double majStep) // Parameter range check - maxMajSteps = qwtMax(1, qwtAbs(maxMajSteps)); - maxMinSteps = qwtMax(0, qwtAbs(maxMinSteps)); - majStep = qwtAbs(majStep); + maxMajSteps = MusEUtil::qwtMax(1, MusEUtil::qwtAbs(maxMajSteps)); + maxMinSteps = MusEUtil::qwtMax(0, MusEUtil::qwtAbs(maxMinSteps)); + majStep = MusEUtil::qwtAbs(majStep); // boundary check limRange(d_hBound, LOG_MIN, LOG_MAX); @@ -440,12 +442,12 @@ bool ScaleDiv::buildLogDiv(int maxMajSteps, int maxMinSteps, double majStep) // Set up major scale divisions // if (majStep == 0.0) - d_majStep = qwtCeil125( width * 0.999999 / double(maxMajSteps)); + d_majStep = MusEUtil::qwtCeil125( width * 0.999999 / double(maxMajSteps)); else d_majStep = majStep; // major step must be >= 1 decade - d_majStep = qwtMax(d_majStep, 1.0); + d_majStep = MusEUtil::qwtMax(d_majStep, 1.0); lFirst = ceil((log10(d_lBound) - step_eps * d_majStep) / d_majStep) * d_majStep; @@ -454,10 +456,10 @@ bool ScaleDiv::buildLogDiv(int maxMajSteps, int maxMinSteps, double majStep) firstTick = pow(10.0, lFirst); lastTick = pow(10.0, lLast); - nMaj = qwtMin(10000, int(rint(qwtAbs(lLast - lFirst) / d_majStep)) + 1); + nMaj = MusEUtil::qwtMin(10000, int(rint(MusEUtil::qwtAbs(lLast - lFirst) / d_majStep)) + 1); d_majMarks.resize(nMaj); - qwtLogSpace(d_majMarks.data(), d_majMarks.size(), firstTick, lastTick); + MusEUtil::qwtLogSpace(d_majMarks.data(), d_majMarks.size(), firstTick, lastTick); // @@ -536,15 +538,15 @@ bool ScaleDiv::buildLogDiv(int maxMajSteps, int maxMinSteps, double majStep) { // substep width in decades, at least one decade - minStep = qwtCeil125( (d_majStep - step_eps * (d_majStep / double(maxMinSteps))) + minStep = MusEUtil::qwtCeil125( (d_majStep - step_eps * (d_majStep / double(maxMinSteps))) / double(maxMinSteps) ); - minStep = qwtMax(1.0, minStep); + minStep = MusEUtil::qwtMax(1.0, minStep); // # subticks per interval nMin = int(rint(d_majStep / minStep)) - 1; // Do the minor steps fit into the interval? - if ( qwtAbs( double(nMin + 1) * minStep - d_majStep) > step_eps * d_majStep) + if ( MusEUtil::qwtAbs( double(nMin + 1) * minStep - d_majStep) > step_eps * d_majStep) nMin = 0; if (nMin < 1) return TRUE; // no subticks @@ -553,7 +555,7 @@ bool ScaleDiv::buildLogDiv(int maxMajSteps, int maxMinSteps, double majStep) buffer.resize((d_majMarks.size() + 1) * nMin ); // substep factor = 10^substeps - minFactor = qwtMax(pow(10,minStep), 10.0); + minFactor = MusEUtil::qwtMax(pow(10,minStep), 10.0); // Are there minor ticks below the first major tick? if ( d_lBound < firstTick ) @@ -657,7 +659,7 @@ void ScaleDiv::reset() d_log = FALSE; } - +} // namespace MusEWidget diff --git a/muse2/muse/widgets/scldiv.h b/muse2/muse/widgets/scldiv.h index a788e7b8..1f91c2db 100644 --- a/muse2/muse/widgets/scldiv.h +++ b/muse2/muse/widgets/scldiv.h @@ -27,6 +27,8 @@ #include <QVector> +namespace MusEWidget { + class ScaleDiv { double d_lBound; @@ -64,4 +66,6 @@ class ScaleDiv bool log, double step = 0.0, bool ascend = TRUE); }; +} // namespace MusEWidget + #endif diff --git a/muse2/muse/widgets/scldraw.cpp b/muse2/muse/widgets/scldraw.cpp index cf69852e..c35d04e0 100644 --- a/muse2/muse/widgets/scldraw.cpp +++ b/muse2/muse/widgets/scldraw.cpp @@ -30,6 +30,8 @@ #include "scldraw.h" +namespace MusEWidget { + int const ScaleDraw::minLen = 10; const double step_eps = 1.0e-6; @@ -222,7 +224,7 @@ void ScaleDraw::draw(QPainter *p) const hval = majTick - 0.5 * d_scldiv.majStep(); } - if (qwtAbs(val-hval) < step_eps * d_scldiv.majStep()) + if (MusEUtil::qwtAbs(val-hval) < step_eps * d_scldiv.majStep()) drawTick(p, val, d_medLen); else drawTick(p, val, d_minLen); @@ -275,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 = qwtInt(d_xCenter + sin(arc) * d_radius); - x2 = qwtInt(d_xCenter + sin(arc) * (d_radius + double(len))); - y1 = qwtInt(d_yCenter - cos(arc) * d_radius); - y2 = qwtInt(d_yCenter - cos(arc) * (d_radius + double(len))); + 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))); p->drawLine(x1, y1, x2, y2); } break; @@ -322,7 +324,7 @@ void ScaleDraw::drawLabel(QPainter *p, double val) const tval = transform(val); // correct rounding errors if val = 0 - if ((!d_scldiv.logScale()) && (qwtAbs(val) < qwtAbs(step_eps * d_scldiv.majStep()))) + if ((!d_scldiv.logScale()) && (MusEUtil::qwtAbs(val) < MusEUtil::qwtAbs(step_eps * d_scldiv.majStep()))) val = 0.0; label.setNum(val, d_fmt, d_prec); @@ -353,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 + qwtInt(d_xCenter + (d_radius + double(d_majLen + d_vpad)) * sin(arc)); - ypos = qwtInt(d_yCenter - (d_radius + double(d_majLen + d_vpad)) * cos(arc)); + 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)); if (arc < -pi_75) { - p->drawText(xpos - qwtInt(double(fm.width(label)) + p->drawText(xpos - MusEUtil::qwtInt(double(fm.width(label)) * (1.0 + (arc + pi_75) * M_2_PI) ), ypos + fm.ascent() - 1, label); @@ -368,13 +370,13 @@ void ScaleDraw::drawLabel(QPainter *p, double val) const p->drawText(xpos - fm.width(label), - ypos - qwtInt(double(fm.ascent() - 1) + ypos - MusEUtil::qwtInt(double(fm.ascent() - 1) * (arc + M_PI_4) * M_2_PI), label); } else if (arc < pi_4) { - p->drawText(xpos + qwtInt(double(fm.width(label)) + p->drawText(xpos + MusEUtil::qwtInt(double(fm.width(label)) * ( arc - M_PI_4 ) * M_2_PI ), ypos, label); @@ -382,13 +384,13 @@ void ScaleDraw::drawLabel(QPainter *p, double val) const else if (arc < pi_75) { p->drawText(xpos, - ypos + qwtInt(double(fm.ascent() - 1) + ypos + MusEUtil::qwtInt(double(fm.ascent() - 1) * (arc - M_PI_4) * M_2_PI), label); } else { - p->drawText(xpos - qwtInt(double(fm.width(label)) + p->drawText(xpos - MusEUtil::qwtInt(double(fm.width(label)) * ( arc - pi_75) * M_2_PI ), ypos + fm.ascent() - 1, label); @@ -431,8 +433,8 @@ void ScaleDraw::drawBackbone(QPainter *p) const break; case Round: - a1 = qwtMin(i1(), i2()) - 90 * 16; - a2 = qwtMax(i1(), i2()) - 90 * 16; + a1 = MusEUtil::qwtMin(i1(), i2()) - 90 * 16; + a2 = MusEUtil::qwtMax(i1(), i2()) - 90 * 16; p->drawArc(d_xorg, d_yorg, d_len, d_len, @@ -692,7 +694,7 @@ QRect ScaleDraw::maxBoundingRect(QPainter *p) const while (a > 2880) a -= 5760; while (a < - 2880) a += 5760; - ar = qwtAbs(a); + ar = MusEUtil::qwtAbs(a); if (ar < amin) amin = ar; if (ar > amax) amax = ar; @@ -706,18 +708,18 @@ QRect ScaleDraw::maxBoundingRect(QPainter *p) const while (a > 2880) a -= 5760; while (a < - 2880) a += 5760; - ar = qwtAbs(a); + ar = MusEUtil::qwtAbs(a); if (ar < amin) amin = ar; if (ar > amax) amax = ar; } arc = double(amin) / 16.0 * M_PI / 180.0; - r.setTop(qwtInt(d_yCenter - (d_radius + double(d_majLen + d_vpad)) * cos(arc)) + r.setTop(MusEUtil::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(qwtInt(d_yCenter - (d_radius + double(d_majLen + d_vpad)) * cos(arc)) + r.setBottom(MusEUtil::qwtInt(d_yCenter - (d_radius + double(d_majLen + d_vpad)) * cos(arc)) + fm.height() ); wmax = d_len + d_majLen + d_hpad + wl; @@ -763,10 +765,10 @@ void ScaleDraw::setAngleRange(double angle1, double angle2) { int amin, amax; - angle1 = qwtLim(angle1, -360.0, 360.0); - angle2 = qwtLim(angle2, -360.0, 360.0); - amin = int(rint(qwtMin(angle1, angle2) * 16.0)); - amax = int(rint(qwtMax(angle1, angle2) * 16.0)); + 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)); if (amin == amax) { @@ -842,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()) && (qwtAbs(val) < step_eps * qwtAbs(d_scldiv.majStep()))) + if ((!d_scldiv.logScale()) && (MusEUtil::qwtAbs(val) < step_eps * MusEUtil::qwtAbs(d_scldiv.majStep()))) val = 0.0; s.setNum(val, d_fmt, d_prec); - rv = qwtMax(rv,fm.width(s)); + rv = MusEUtil::qwtMax(rv,fm.width(s)); } } @@ -880,7 +882,7 @@ int ScaleDraw::maxLabelWidth(QPainter *p, int worst) const // //------------------------------------------------------------ - +} // namespace MusEWidget diff --git a/muse2/muse/widgets/scldraw.h b/muse2/muse/widgets/scldraw.h index f79a215e..2c1543cd 100644 --- a/muse2/muse/widgets/scldraw.h +++ b/muse2/muse/widgets/scldraw.h @@ -31,7 +31,7 @@ class QPainter; class QRect; -class AutoScale; +namespace MusEWidget { class ScaleDraw : public DiMap { public: @@ -87,6 +87,8 @@ class ScaleDraw : public DiMap { void draw(QPainter *p) const; }; +} // namespace MusEWidget + #endif diff --git a/muse2/muse/widgets/sclif.cpp b/muse2/muse/widgets/sclif.cpp index 9922429f..93987999 100644 --- a/muse2/muse/widgets/sclif.cpp +++ b/muse2/muse/widgets/sclif.cpp @@ -24,6 +24,8 @@ #include "sclif.h" +namespace MusEWidget { + // ScaleIf - An interface class for widgets containing a scale // // This interface class is used to provide classes @@ -214,3 +216,4 @@ void ScaleIf::setScaleMaxMinor(int ticks) } } +} // namespace MusEWidget diff --git a/muse2/muse/widgets/sclif.h b/muse2/muse/widgets/sclif.h index 0b505b5a..e168dfc3 100644 --- a/muse2/muse/widgets/sclif.h +++ b/muse2/muse/widgets/sclif.h @@ -27,6 +27,8 @@ #include "scldraw.h" +namespace MusEWidget { + //--------------------------------------------------------- // ScaleIf //--------------------------------------------------------- @@ -57,5 +59,7 @@ class ScaleIf int scaleMaxMajor() const {return d_maxMinor;} }; +} // namespace MusEWidget + #endif diff --git a/muse2/muse/widgets/scrollscale.cpp b/muse2/muse/widgets/scrollscale.cpp index 6341d6b9..21ed10b6 100644 --- a/muse2/muse/widgets/scrollscale.cpp +++ b/muse2/muse/widgets/scrollscale.cpp @@ -35,6 +35,8 @@ #include "scrollscale.h" #include "icons.h" +namespace MusEWidget { + //--------------------------------------------------------- // setScale // "val" - slider value in range 0-1024 @@ -524,3 +526,4 @@ int ScrollScale::convertQuickZoomLevelToMag(int zoomlevel) return vals[zoomlevel]; } +} // namespace MusEWidget diff --git a/muse2/muse/widgets/scrollscale.h b/muse2/muse/widgets/scrollscale.h index df85075a..0fce5b56 100644 --- a/muse2/muse/widgets/scrollscale.h +++ b/muse2/muse/widgets/scrollscale.h @@ -31,6 +31,8 @@ class QResizeEvent; class QScrollBar; class QToolButton; +namespace MusEWidget { + //--------------------------------------------------------- // ScrollScale //--------------------------------------------------------- @@ -97,5 +99,7 @@ class ScrollScale : public QWidget { static int convertQuickZoomLevelToMag(int zoomlvl); }; +} // namespace MusEWidget + #endif diff --git a/muse2/muse/widgets/section.h b/muse2/muse/widgets/section.h index a61bf684..02b84355 100644 --- a/muse2/muse/widgets/section.h +++ b/muse2/muse/widgets/section.h @@ -23,6 +23,8 @@ #ifndef __SECTION_H__ #define __SECTION_H__ +namespace MusEWidget { + struct Section { int offset; unsigned len; @@ -30,5 +32,7 @@ struct Section { int val; }; +} // namespace MusEWidget + #endif diff --git a/muse2/muse/widgets/shortcutcapturedialog.cpp b/muse2/muse/widgets/shortcutcapturedialog.cpp index db800a8a..a470d698 100644 --- a/muse2/muse/widgets/shortcutcapturedialog.cpp +++ b/muse2/muse/widgets/shortcutcapturedialog.cpp @@ -40,6 +40,8 @@ #include <QInputEvent> #include <QChar> +namespace MusEWidget { + ShortcutCaptureDialog::ShortcutCaptureDialog(QWidget* parent, int index) : QDialog(parent) { @@ -123,3 +125,4 @@ void ShortcutCaptureDialog::apply() done(key); } +} // namespace MusEWidget diff --git a/muse2/muse/widgets/shortcutcapturedialog.h b/muse2/muse/widgets/shortcutcapturedialog.h index 390da333..9af3f7c2 100644 --- a/muse2/muse/widgets/shortcutcapturedialog.h +++ b/muse2/muse/widgets/shortcutcapturedialog.h @@ -38,6 +38,8 @@ class QKeyEvent; +namespace MusEWidget { + class ShortcutCaptureDialog : public QDialog, public Ui::ShortcutCaptureDialogBase { Q_OBJECT @@ -55,3 +57,4 @@ class ShortcutCaptureDialog : public QDialog, public Ui::ShortcutCaptureDialogBa ~ShortcutCaptureDialog(); }; +} // namespace MusEWidget diff --git a/muse2/muse/widgets/shortcutconfig.cpp b/muse2/muse/widgets/shortcutconfig.cpp index c58652fd..8e4d7b1a 100644 --- a/muse2/muse/widgets/shortcutconfig.cpp +++ b/muse2/muse/widgets/shortcutconfig.cpp @@ -41,6 +41,8 @@ #include "shortcutcapturedialog.h" #include "shortcuts.h" +namespace MusEWidget { + ShortcutConfig::ShortcutConfig(QWidget* parent) : QDialog(parent) { @@ -155,3 +157,5 @@ void ShortcutConfig::assignAll() applyButton->setDown(false); done(_config_changed); } + +} // namespace MusEWidget diff --git a/muse2/muse/widgets/shortcutconfig.h b/muse2/muse/widgets/shortcutconfig.h index 0346bf04..fe417c05 100644 --- a/muse2/muse/widgets/shortcutconfig.h +++ b/muse2/muse/widgets/shortcutconfig.h @@ -40,6 +40,9 @@ class QCloseEvent; #include "ui_shortcutconfigbase.h" #define SHRT_CATEGORY_COL 0 + +namespace MusEWidget { + enum { SHRT_SHRTCUT_COL = 0, @@ -80,4 +83,6 @@ class ShortcutConfig : public QDialog, public Ui::ShortcutConfigBase { }; +} // namespace MusEWidget + #endif diff --git a/muse2/muse/widgets/sigedit.cpp b/muse2/muse/widgets/sigedit.cpp index 950e480a..c2c5a842 100644 --- a/muse2/muse/widgets/sigedit.cpp +++ b/muse2/muse/widgets/sigedit.cpp @@ -42,6 +42,8 @@ extern int mtcType; +namespace MusEWidget { + bool Sig::isValid() const { if((z < 1) || (z > 63)) @@ -752,3 +754,5 @@ void SigEdit::enterPressed() { emit returnPressed(); } + +} // namespace MusEWidget diff --git a/muse2/muse/widgets/sigedit.h b/muse2/muse/widgets/sigedit.h index 38b229a1..3b1ca635 100644 --- a/muse2/muse/widgets/sigedit.h +++ b/muse2/muse/widgets/sigedit.h @@ -30,6 +30,8 @@ class QResizeEvent; class QTimerEvent; +namespace MusEWidget { + class SigEditor; class SpinBox; @@ -100,4 +102,6 @@ class SigEdit : public QWidget void enterPressed(); }; +} // namespace MusEWidget + #endif diff --git a/muse2/muse/widgets/siglabel.cpp b/muse2/muse/widgets/siglabel.cpp index 9941b018..1a1c9164 100644 --- a/muse2/muse/widgets/siglabel.cpp +++ b/muse2/muse/widgets/siglabel.cpp @@ -35,6 +35,8 @@ #include <QWheelEvent> #include <QLabel> +namespace MusEWidget { + //--------------------------------------------------------- // SigLabel // edit Signature Values (4/4) @@ -177,3 +179,5 @@ void SigLabel::setFrame(bool flag) setFrameStyle(flag ? Panel | Sunken : NoFrame); setLineWidth(2); } + +} // namespace MusEWidget diff --git a/muse2/muse/widgets/siglabel.h b/muse2/muse/widgets/siglabel.h index 88617d78..33248e53 100644 --- a/muse2/muse/widgets/siglabel.h +++ b/muse2/muse/widgets/siglabel.h @@ -30,6 +30,8 @@ class QWheelEvent; class QMouseEvent; +namespace MusEWidget { + //--------------------------------------------------------- // SigLabel // show/edit time signature @@ -58,5 +60,8 @@ class SigLabel : public QLabel { AL::TimeSignature value() const { return AL::TimeSignature(z, n); } void setFrame(bool); }; + +} // namespace MusEWidget + #endif diff --git a/muse2/muse/widgets/sigscale.cpp b/muse2/muse/widgets/sigscale.cpp index 8ec0ca70..bcfb540e 100644 --- a/muse2/muse/widgets/sigscale.cpp +++ b/muse2/muse/widgets/sigscale.cpp @@ -32,6 +32,8 @@ #include "song.h" #include "gconfig.h" +namespace MusEWidget { + //--------------------------------------------------------- // SigScale //--------------------------------------------------------- @@ -164,4 +166,4 @@ void SigScale::pdraw(QPainter& p, const QRect& r) p.drawLine(xp, 0, xp, h); } - +} // namespace MusEWidget diff --git a/muse2/muse/widgets/sigscale.h b/muse2/muse/widgets/sigscale.h index 576967cd..9ecacfb1 100644 --- a/muse2/muse/widgets/sigscale.h +++ b/muse2/muse/widgets/sigscale.h @@ -27,6 +27,8 @@ class MidiEditor; +namespace MusEWidget { + //--------------------------------------------------------- // SigScale // Time Signature Scale @@ -57,5 +59,8 @@ class SigScale : public View { public: SigScale(int* raster, QWidget* parent, int xscale); }; + +} // namespace MusEWidget + #endif diff --git a/muse2/muse/widgets/slider.cpp b/muse2/muse/widgets/slider.cpp index 853eae29..f50c144a 100644 --- a/muse2/muse/widgets/slider.cpp +++ b/muse2/muse/widgets/slider.cpp @@ -29,6 +29,7 @@ #include "slider.h" +namespace MusEWidget { //------------------------------------------------------------- // Slider - The Slider Widget @@ -108,7 +109,7 @@ Slider::~Slider() //----------------------------------------------------- void Slider::setThumbLength(int l) { - d_thumbLength = qwtMax(l,8); + d_thumbLength = MusEUtil::qwtMax(l,8); d_thumbHalf = d_thumbLength / 2; resize(size()); } @@ -127,7 +128,7 @@ void Slider::setThumbLength(int l) //------------------------------------------------------------ void Slider::setThumbWidth(int w) { - d_thumbWidth = qwtMax(w,4); + d_thumbWidth = MusEUtil::qwtMax(w,4); resize(size()); } @@ -761,8 +762,8 @@ void Slider::rangeChange() //------------------------------------------------------------ void Slider::setMargins(int hor, int vert) { - d_xMargin = qwtMax(0, hor); - d_yMargin = qwtMin(0, vert); + d_xMargin = MusEUtil::qwtMax(0, hor); + d_yMargin = MusEUtil::qwtMin(0, vert); resize(this->size()); } @@ -871,3 +872,4 @@ void Slider::setPageStep(double) { } +} // namespace MusEWidget diff --git a/muse2/muse/widgets/slider.h b/muse2/muse/widgets/slider.h index 696d0f0d..a76c5270 100644 --- a/muse2/muse/widgets/slider.h +++ b/muse2/muse/widgets/slider.h @@ -30,6 +30,8 @@ #include "sliderbase.h" #include "scldraw.h" +namespace MusEWidget { + //--------------------------------------------------------- // Slider //--------------------------------------------------------- @@ -106,4 +108,7 @@ class Slider : public SliderBase, public ScaleIf void setMargins(int x, int y); QSize sizeHint(); // const; }; + +} // namespace MusEWidget + #endif diff --git a/muse2/muse/widgets/sliderbase.cpp b/muse2/muse/widgets/sliderbase.cpp index bee1a638..8b85878e 100644 --- a/muse2/muse/widgets/sliderbase.cpp +++ b/muse2/muse/widgets/sliderbase.cpp @@ -29,6 +29,8 @@ #include <QMouseEvent> #include <QTimerEvent> +namespace MusEWidget { + // DESCRIPTION // SliderBase is a base class for // slider widgets. QwtSliderBase handles the mouse events @@ -182,7 +184,7 @@ void SliderBase::mousePressEvent(QMouseEvent *e) d_mouseOffset = 0; DoubleRange::incPages(d_direction); emit sliderMoved(value(), _id); - d_tmrID = startTimer(qwtMax(250, 2 * d_updTime)); + d_tmrID = startTimer(MusEUtil::qwtMax(250, 2 * d_updTime)); break; case ScrMouse: @@ -727,6 +729,7 @@ void SliderBase::stepPages(int pages) // //------------------------------------------------------------ +} // namespace MusEWidget diff --git a/muse2/muse/widgets/sliderbase.h b/muse2/muse/widgets/sliderbase.h index 78e40335..39860153 100644 --- a/muse2/muse/widgets/sliderbase.h +++ b/muse2/muse/widgets/sliderbase.h @@ -30,6 +30,8 @@ #include <QTime> #include <QWidget> +namespace MusEWidget { + //--------------------------------------------------------- // SliderBase //--------------------------------------------------------- @@ -109,4 +111,6 @@ class SliderBase : public QWidget, public DoubleRange void setId(int i) { _id = i; } }; +} // namespace MusEWidget + #endif diff --git a/muse2/muse/widgets/songinfo.h b/muse2/muse/widgets/songinfo.h index 926d93a8..8e576876 100644 --- a/muse2/muse/widgets/songinfo.h +++ b/muse2/muse/widgets/songinfo.h @@ -25,6 +25,8 @@ class QDialog; +namespace MusEWidget { + //--------------------------------------------------------- // SongInfoWidget // Wrapper around Ui::SongInfo @@ -37,3 +39,5 @@ class SongInfoWidget : public QDialog, public Ui::SongInfo public: SongInfoWidget(QDialog *parent = 0) : QDialog(parent) { setupUi(this); } }; + +} // namespace MusEWidget diff --git a/muse2/muse/widgets/spinbox.cpp b/muse2/muse/widgets/spinbox.cpp index b263b317..0111158d 100644 --- a/muse2/muse/widgets/spinbox.cpp +++ b/muse2/muse/widgets/spinbox.cpp @@ -24,6 +24,8 @@ #include <QEvent> #include "spinbox.h" +namespace MusEWidget { + //--------------------------------------------------------- // SpinBox //--------------------------------------------------------- @@ -97,3 +99,4 @@ void SpinBox::stepDown() _clearFocus = true; } +} // namespace MusEWidget diff --git a/muse2/muse/widgets/spinbox.h b/muse2/muse/widgets/spinbox.h index 5f870eb5..01cd6ad5 100644 --- a/muse2/muse/widgets/spinbox.h +++ b/muse2/muse/widgets/spinbox.h @@ -30,6 +30,8 @@ #include <QSpinBox> #include <QEvent> +namespace MusEWidget { + //--------------------------------------------------------- // SpinBox //--------------------------------------------------------- @@ -54,5 +56,7 @@ class SpinBox : public QSpinBox { SpinBox(int minValue, int maxValue, int step = 1, QWidget* parent=0); }; +} // namespace MusEWidget + #endif diff --git a/muse2/muse/widgets/spinboxFP.cpp b/muse2/muse/widgets/spinboxFP.cpp index 52b94e03..696e589f 100644 --- a/muse2/muse/widgets/spinboxFP.cpp +++ b/muse2/muse/widgets/spinboxFP.cpp @@ -29,6 +29,8 @@ #include "spinboxFP.h" +namespace MusEWidget { + //--------------------------------------------------------- // SpinBoxFP //--------------------------------------------------------- @@ -184,4 +186,6 @@ int SpinBoxFP::valueFromText(const QString& text) const return QSpinBox::valueFromText(text); } -*/
\ No newline at end of file +*/ + +} // namespace MusEWidget diff --git a/muse2/muse/widgets/spinboxFP.h b/muse2/muse/widgets/spinboxFP.h index 2b9d65f0..81fc4876 100644 --- a/muse2/muse/widgets/spinboxFP.h +++ b/muse2/muse/widgets/spinboxFP.h @@ -29,6 +29,8 @@ //class QValidator; //class QDoubleValidator; +namespace MusEWidget { + //--------------------------------------------------------- // SpinBoxFP //--------------------------------------------------------- @@ -64,5 +66,7 @@ class SpinBoxFP : public QDoubleSpinBox { //int decimals() const { return _decimals; } }; +} // namespace MusEWidget + #endif diff --git a/muse2/muse/widgets/splitter.cpp b/muse2/muse/widgets/splitter.cpp index fcc74214..09220b24 100644 --- a/muse2/muse/widgets/splitter.cpp +++ b/muse2/muse/widgets/splitter.cpp @@ -26,6 +26,8 @@ #include <QList> #include <QStringList> +namespace MusEWidget { + //--------------------------------------------------------- // Splitter //--------------------------------------------------------- @@ -92,3 +94,5 @@ void Splitter::readStatus(Xml& xml) } } } + +} // namespace MusEWidget diff --git a/muse2/muse/widgets/splitter.h b/muse2/muse/widgets/splitter.h index 1f921309..3121fe87 100644 --- a/muse2/muse/widgets/splitter.h +++ b/muse2/muse/widgets/splitter.h @@ -27,6 +27,8 @@ class Xml; +namespace MusEWidget { + //--------------------------------------------------------- // Splitter //--------------------------------------------------------- @@ -40,5 +42,7 @@ class Splitter : public QSplitter { void readStatus(Xml&); }; +} + #endif diff --git a/muse2/muse/widgets/swidget.cpp b/muse2/muse/widgets/swidget.cpp index 06e3f91d..f8461977 100644 --- a/muse2/muse/widgets/swidget.cpp +++ b/muse2/muse/widgets/swidget.cpp @@ -24,6 +24,8 @@ #include <QResizeEvent> +namespace MusEWidget { + //--------------------------------------------------------- // resizeEvent //--------------------------------------------------------- @@ -33,3 +35,4 @@ void SWidget::resizeEvent(QResizeEvent* ev) emit heightChanged(ev->size().height()); } +} // namespace MusEWidget diff --git a/muse2/muse/widgets/swidget.h b/muse2/muse/widgets/swidget.h index 50f55b84..0412ac41 100644 --- a/muse2/muse/widgets/swidget.h +++ b/muse2/muse/widgets/swidget.h @@ -25,6 +25,8 @@ #include <QWidget> +namespace MusEWidget { + //--------------------------------------------------------- // SWidget // a simple widget which emits a heighChanged signal @@ -43,5 +45,7 @@ class SWidget : public QWidget { SWidget(QWidget* parent) : QWidget(parent) {} }; +} // namespace MusEWidget + #endif diff --git a/muse2/muse/widgets/tb1.cpp b/muse2/muse/widgets/tb1.cpp index fdd08e2a..272359f0 100644 --- a/muse2/muse/widgets/tb1.cpp +++ b/muse2/muse/widgets/tb1.cpp @@ -35,6 +35,8 @@ #include "poslabel.h" #include "pitchlabel.h" +namespace MusEWidget { + static int rasterTable[] = { //------ 8 4 2 1, 4, 8, 16, 32, 64, 128, 256, 512, 1024, @@ -208,3 +210,4 @@ void Toolbar1::setPitchMode(bool /*flag*/) // pitch->setPitchMode(flag); } +} // namespace MusEWidget diff --git a/muse2/muse/widgets/tb1.h b/muse2/muse/widgets/tb1.h index eb1d7269..93181c39 100644 --- a/muse2/muse/widgets/tb1.h +++ b/muse2/muse/widgets/tb1.h @@ -28,11 +28,14 @@ class QToolButton; class QTableWidget; -class PosLabel; -class PitchLabel; class Track; class LabelCombo; +namespace MusEWidget { + +class PitchLabel; +class PosLabel; + //--------------------------------------------------------- // Toolbar1 //--------------------------------------------------------- @@ -68,4 +71,6 @@ class Toolbar1 : public QToolBar { void setPitchMode(bool flag); }; +} // namespace MusEWidget + #endif diff --git a/muse2/muse/widgets/tempolabel.cpp b/muse2/muse/widgets/tempolabel.cpp index 526a4245..cdbc029d 100644 --- a/muse2/muse/widgets/tempolabel.cpp +++ b/muse2/muse/widgets/tempolabel.cpp @@ -25,6 +25,8 @@ #include "tempolabel.h" +namespace MusEWidget { + //--------------------------------------------------------- // TempoLabel //--------------------------------------------------------- @@ -135,4 +137,4 @@ void TempoEdit::setValue(double val) // return lrint(60000000.0/value()); // } - +} // namespace MusEWidget diff --git a/muse2/muse/widgets/tempolabel.h b/muse2/muse/widgets/tempolabel.h index 7604cae8..682c1e37 100644 --- a/muse2/muse/widgets/tempolabel.h +++ b/muse2/muse/widgets/tempolabel.h @@ -26,6 +26,8 @@ #include <QLabel> #include <QDoubleSpinBox> +namespace MusEWidget { + //--------------------------------------------------------- // TempoLabel //--------------------------------------------------------- @@ -74,5 +76,7 @@ class TempoEdit : public QDoubleSpinBox { //int tempo() const; }; +} // namespace MusEWidget + #endif diff --git a/muse2/muse/widgets/transformbase.ui b/muse2/muse/widgets/transformbase.ui index 578b4a97..ffa56338 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="SpinBoxFP" name="procVal1a"> + <widget class="MusEWidget::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="SpinBoxFP" name="procVal2a"> + <widget class="MusEWidget::SpinBoxFP" name="procVal2a"> <property name="maximum" stdset="0"> <number>99999999</number> </property> </widget> </item> <item row="2" column="3"> - <widget class="SpinBoxFP" name="procLenA"> + <widget class="MusEWidget::SpinBoxFP" name="procLenA"> <property name="maximum" stdset="0"> <number>99999999</number> </property> </widget> </item> <item row="2" column="4"> - <widget class="SpinBoxFP" name="procPosA"> + <widget class="MusEWidget::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="SpinBoxFP" name="selBarB"> + <widget class="MusEWidget::SpinBoxFP" name="selBarB"> <property name="decimals" stdset="0"> <number>3</number> </property> </widget> </item> <item row="2" column="4"> - <widget class="SpinBoxFP" name="selBarA"> + <widget class="MusEWidget::SpinBoxFP" name="selBarA"> <property name="minimum" stdset="0"> <number>1000</number> </property> @@ -974,7 +974,7 @@ </widget> </item> <item> - <widget class="ComboQuant" name="funcQuantVal" native="true"/> + <widget class="MusEWidget::ComboQuant" name="funcQuantVal" native="true"/> </item> </layout> </widget> @@ -986,12 +986,12 @@ <layoutdefault spacing="6" margin="11"/> <customwidgets> <customwidget> - <class>SpinBoxFP</class> + <class>MusEWidget::SpinBoxFP</class> <extends>QDoubleSpinBox</extends> <header>spinboxFP.h</header> </customwidget> <customwidget> - <class>ComboQuant</class> + <class>MusEWidget::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 1703083f..6bf43b1f 100644 --- a/muse2/muse/widgets/ttoolbutton.cpp +++ b/muse2/muse/widgets/ttoolbutton.cpp @@ -27,6 +27,8 @@ #include "gconfig.h" #include "icons.h" +namespace MusEWidget { + //--------------------------------------------------------- // drawButton //--------------------------------------------------------- @@ -41,4 +43,4 @@ void TransparentToolButton::drawButton(QPainter* p) p->drawPixmap(QPoint((w - pm.width())/2, (h - pm.height())/2), pm); } - +} // namespace MusEWidget diff --git a/muse2/muse/widgets/ttoolbutton.h b/muse2/muse/widgets/ttoolbutton.h index 8a79f16f..b61d2f7c 100644 --- a/muse2/muse/widgets/ttoolbutton.h +++ b/muse2/muse/widgets/ttoolbutton.h @@ -25,6 +25,8 @@ #include <QToolButton> +namespace MusEWidget { + //--------------------------------------------------------- // TransparentToolButton //--------------------------------------------------------- @@ -39,5 +41,7 @@ class TransparentToolButton : public QToolButton { : QToolButton(parent) {setObjectName(name);} }; +} // namespace MusEWidget + #endif diff --git a/muse2/muse/widgets/unusedwavefiles.cpp b/muse2/muse/widgets/unusedwavefiles.cpp index 810105bf..07fcbf0c 100644 --- a/muse2/muse/widgets/unusedwavefiles.cpp +++ b/muse2/muse/widgets/unusedwavefiles.cpp @@ -31,6 +31,8 @@ #include "globals.h" #include "app.h" +namespace MusEWidget { + UnusedWaveFiles::UnusedWaveFiles(QWidget *parent) : QDialog(parent), ui(new Ui::UnusedWaveFiles) @@ -117,3 +119,5 @@ void UnusedWaveFiles::accept() } QDialog::accept(); } + +} // namespace MusEWidget diff --git a/muse2/muse/widgets/unusedwavefiles.h b/muse2/muse/widgets/unusedwavefiles.h index d3a66234..fba41212 100644 --- a/muse2/muse/widgets/unusedwavefiles.h +++ b/muse2/muse/widgets/unusedwavefiles.h @@ -29,6 +29,8 @@ namespace Ui { class UnusedWaveFiles; } +namespace MusEWidget { + class UnusedWaveFiles : public QDialog { Q_OBJECT @@ -45,4 +47,6 @@ private: Ui::UnusedWaveFiles *ui; }; +} // namespace MusEWidget + #endif // UNUSEDWAVEFILES_H diff --git a/muse2/muse/widgets/utils.cpp b/muse2/muse/widgets/utils.cpp index c2c60d12..e46d265c 100644 --- a/muse2/muse/widgets/utils.cpp +++ b/muse2/muse/widgets/utils.cpp @@ -34,6 +34,8 @@ #include "utils.h" +namespace MusEUtil { + //--------------------------------------------------------- // curTime //--------------------------------------------------------- @@ -400,4 +402,6 @@ QGradient gGradientFromQColor(const QColor& c, const QPointF& start, const QPoin gradient.setColorAt(1, c1); return gradient; -}
\ No newline at end of file +} + +} // namespace MusEUtils diff --git a/muse2/muse/widgets/utils.h b/muse2/muse/widgets/utils.h index 5862443a..b74ba394 100644 --- a/muse2/muse/widgets/utils.h +++ b/muse2/muse/widgets/utils.h @@ -31,6 +31,7 @@ class QCanvas; class QPointF; class QColor; +namespace MusEUtil { extern QString bitmap2String(int bm); extern int string2bitmap(const QString& str); @@ -45,5 +46,7 @@ extern QFrame* vLine(QWidget* parent); extern void dump(const unsigned char* p, int n); extern double curTime(); +} // namespace MusEUtils + #endif diff --git a/muse2/muse/widgets/verticalmeter.cpp b/muse2/muse/widgets/verticalmeter.cpp index e76d7015..b0e0198f 100644 --- a/muse2/muse/widgets/verticalmeter.cpp +++ b/muse2/muse/widgets/verticalmeter.cpp @@ -32,6 +32,8 @@ #include "gconfig.h" #include "fastlog.h" +namespace MusEWidget { + //--------------------------------------------------------- // VerticalMeter //--------------------------------------------------------- @@ -269,3 +271,5 @@ void VerticalMeter::resizeEvent(QResizeEvent* ev) QRegion maskregion(rounded_rect.toFillPolygon().toPolygon()); setMask(maskregion); } + +} // namespace MusEWidget diff --git a/muse2/muse/widgets/verticalmeter.h b/muse2/muse/widgets/verticalmeter.h index 3579600a..d6bee245 100644 --- a/muse2/muse/widgets/verticalmeter.h +++ b/muse2/muse/widgets/verticalmeter.h @@ -31,6 +31,8 @@ class QResizeEvent; class QMouseEvent; class QPainter; +namespace MusEWidget { + class VerticalMeter : public Meter { Q_OBJECT @@ -56,5 +58,8 @@ class VerticalMeter : public Meter { VerticalMeter(QWidget* parent, MeterType type = DBMeter); void setRange(double min, double max); }; + +} // namespace MusEWidget + #endif diff --git a/muse2/muse/widgets/view.cpp b/muse2/muse/widgets/view.cpp index 99d86d3c..9be66ed5 100644 --- a/muse2/muse/widgets/view.cpp +++ b/muse2/muse/widgets/view.cpp @@ -42,6 +42,8 @@ // just ate up all the time no matter what I tried. //#defines VIEW_USE_DOUBLE_BUFFERING 1 +namespace MusEWidget { + //--------------------------------------------------------- // View::View // double xMag = (xmag < 0) ? 1.0/-xmag : double(xmag) @@ -977,3 +979,5 @@ QRect View::devToVirt(const QRect& r) return QRect(x, y, w, h); } */ + +} // namespace MusEWidget diff --git a/muse2/muse/widgets/view.h b/muse2/muse/widgets/view.h index 1569d60f..e5f33657 100644 --- a/muse2/muse/widgets/view.h +++ b/muse2/muse/widgets/view.h @@ -34,6 +34,8 @@ class QPainter; class QPixmap; class QResizeEvent; +namespace MusEWidget { + //--------------------------------------------------------- // View // horizontal View with double buffering @@ -126,5 +128,7 @@ class View : public QWidget { int rmapx(int x) const; }; +} // namespace MusEWidget + #endif diff --git a/muse2/muse/widgets/vscale.cpp b/muse2/muse/widgets/vscale.cpp index c4a9df08..22af7889 100644 --- a/muse2/muse/widgets/vscale.cpp +++ b/muse2/muse/widgets/vscale.cpp @@ -25,6 +25,8 @@ #include <QPainter> #include <QPaintEvent> +namespace MusEWidget { + //--------------------------------------------------------- // paintEvent //--------------------------------------------------------- @@ -41,3 +43,4 @@ void VScale::paintEvent(QPaintEvent*) p.end(); } +} // namespace MusEWidget diff --git a/muse2/muse/widgets/vscale.h b/muse2/muse/widgets/vscale.h index bba35c04..e926b3cb 100644 --- a/muse2/muse/widgets/vscale.h +++ b/muse2/muse/widgets/vscale.h @@ -27,6 +27,8 @@ class QPaintEvent; +namespace MusEWidget { + //--------------------------------------------------------- // VScale //--------------------------------------------------------- @@ -40,5 +42,7 @@ class VScale : public QWidget { VScale(QWidget* parent=0) : QWidget(parent) {setFixedWidth(18);} }; +} // namespace MusEWidget + #endif diff --git a/muse2/muse/widgets/wtscale.cpp b/muse2/muse/widgets/wtscale.cpp index 1ffabae3..3b6aa6eb 100644 --- a/muse2/muse/widgets/wtscale.cpp +++ b/muse2/muse/widgets/wtscale.cpp @@ -33,6 +33,8 @@ #include "../marker/marker.h" #include "icons.h" +namespace MusEWidget { + //--------------------------------------------------------- // WTScale // Wave Time Scale @@ -299,3 +301,5 @@ void WTScale::pdraw(QPainter& p, const QRect& r) } } +} // namespace MusEWidget + diff --git a/muse2/muse/widgets/wtscale.h b/muse2/muse/widgets/wtscale.h index dd6d5eef..b25de627 100644 --- a/muse2/muse/widgets/wtscale.h +++ b/muse2/muse/widgets/wtscale.h @@ -25,6 +25,8 @@ #include "view.h" +namespace MusEWidget { + //--------------------------------------------------------- // WTScale // scale for wave track @@ -57,5 +59,8 @@ class WTScale : public View { WTScale(int* raster, QWidget* parent, int xscale); void setBarLocator(bool f) { barLocator = f; } }; + +} // namespace MusEWidget + #endif |