diff options
author | Werner Schweer <ws.seh.de> | 2006-09-24 11:49:39 +0000 |
---|---|---|
committer | Werner Schweer <ws.seh.de> | 2006-09-24 11:49:39 +0000 |
commit | 2e8dd6bdf336c3595edf3c126e97c01374da955f (patch) | |
tree | 549e9e661b2223d2f6cc8d4306e2b7051711581d | |
parent | fba231e9ca325c5247032ad3f6e9aea59c676431 (diff) |
marker fixes
-rw-r--r-- | muse/doc/man/de/installation.tex | 45 | ||||
-rw-r--r-- | muse/doc/man/de/man-de.tex | 1 | ||||
-rw-r--r-- | muse/doc/man/de/miditracks.tex | 2 | ||||
-rw-r--r-- | muse/muse/marker/markerview.cpp | 84 | ||||
-rw-r--r-- | muse/muse/marker/markerview.h | 2 | ||||
-rw-r--r-- | muse/muse/muse.cpp | 1 | ||||
-rw-r--r-- | muse/muse/song.cpp | 67 | ||||
-rw-r--r-- | muse/muse/song.h | 1 |
8 files changed, 128 insertions, 75 deletions
diff --git a/muse/doc/man/de/installation.tex b/muse/doc/man/de/installation.tex new file mode 100644 index 00000000..19a13032 --- /dev/null +++ b/muse/doc/man/de/installation.tex @@ -0,0 +1,45 @@ +\chapter{Installation} + \section{Tips für Ubuntu/Kubuntu} + + \subsection{Alsa-Sequencer} + + \M\ benötigt das ALSA Sequencer Modul. Dies wird von Ubuntu leider + beim Systemstart nicht installiert. + + Wir können das aber leicht durch einen Eintrag in {\tt /etc/modules} + beheben: + + \starttyping + sudo bash + modprobe snd-seq + echo snd-seq >> /etc/modules + \stoptyping + + + \subsection{Realtime Clock} + + Normalen Programmen ist der Zugriff auf die Echtzeituhr + (RTC = "realtime clock") von Linux + verwehrt. \M\ benötigt jedoch eine genaue Uhr, um ein exaktes + Miditiming erzeugen zu können. + Zunächst wollen wir daher die RTC für alle Audioprogrammen + verfügbar machen: + + \starttyping + sudo chown -vv root:audio /dev/rtc + sudo chmod g+rw /dev/rtc + \stoptyping + + Jetzt haben alle Programme der audio Gruppe Zugriff auf die + RTC, dürfen jedoch noch nicht die hohen von \M\ benötigten + Auflösungen einstellen. + Um dies zu Erlauben geben wir ein: + + \starttyping + sudo bash + echo 1024 > /proc/sys/dev/rtc/max-user-freq + echo dev.rtc.max-user-freq=1024 >> /etc/sysctl.conf + \stoptyping + + Durch den Eintrag in der Datei {\tt /etc/sysctl.conf} erfolgt diese + Einstellung nun auch nach jedem Systemstart. diff --git a/muse/doc/man/de/man-de.tex b/muse/doc/man/de/man-de.tex index 2dc3f6b3..7b73a6b0 100644 --- a/muse/doc/man/de/man-de.tex +++ b/muse/doc/man/de/man-de.tex @@ -173,6 +173,7 @@ \component projekte.tex \component struktur.tex \component miditracks.tex +\component installation.tex \startappendices \component ../gpl.tex diff --git a/muse/doc/man/de/miditracks.tex b/muse/doc/man/de/miditracks.tex index dd299ae3..901ab188 100644 --- a/muse/doc/man/de/miditracks.tex +++ b/muse/doc/man/de/miditracks.tex @@ -102,7 +102,7 @@ \section{Midi Port} \index{Midi Port} Ein Midi Port representiert ein externes Midi - Gerä und hat folgende Eigenschaften: + Gerät und hat folgende Eigenschaften: \blank[big] \Input{Instrument:} \index{Midi Instrument} beschreibt die diff --git a/muse/muse/marker/markerview.cpp b/muse/muse/marker/markerview.cpp index 0e3dc55c..da522404 100644 --- a/muse/muse/marker/markerview.cpp +++ b/muse/muse/marker/markerview.cpp @@ -69,9 +69,7 @@ MarkerItem::MarkerItem(QTreeWidget* parent, AL::Marker* m) _marker = m; setText(COL_NAME, m->name()); setTick(m->tick()); - if (m->type() == AL::FRAMES) - setIcon(COL_LOCK, *lockIcon); - setLock(m->type() == AL::FRAMES); + setIcon(COL_LOCK, m->type() == AL::FRAMES ? *lockIcon : QIcon()); } //--------------------------------------------------------- @@ -217,8 +215,7 @@ MarkerView::MarkerView() editSMPTE, SLOT(setValue(const Pos&))); connect(lock, SIGNAL(toggled(bool)), SLOT(lockChanged(bool))); - connect(song, SIGNAL(markerChanged(int)), - SLOT(markerChanged(int))); + connect(song, SIGNAL(markerChanged(int)), SLOT(markerChanged(int))); vbox->addWidget(table); vbox->addWidget(props); @@ -227,17 +224,9 @@ MarkerView::MarkerView() // Rest //--------------------------------------------------- - connect(song, SIGNAL(songChanged(int)), SLOT(updateList())); +// connect(song, SIGNAL(songChanged(int)), SLOT(updateList())); updateList(); - } - -//--------------------------------------------------------- -// MArkerView -//--------------------------------------------------------- - -MarkerView::~MarkerView() - { -// undoRedo->removeFrom(tools); + markerChanged(Song::MARKER_CUR); // select current marker } //--------------------------------------------------------- @@ -251,23 +240,12 @@ void MarkerView::addMarker() void MarkerView::addMarker(const AL::Pos& pos) { - AL::Marker* m = song->addMarker(QString(""), pos); - MarkerItem* newItem = new MarkerItem(table, m); - table->setCurrentItem(newItem); - table->setItemSelected(newItem, true); +// new MarkerItem(table, m); + song->addMarker(QString(""), pos); table->sortItems(0, Qt::AscendingOrder); } //--------------------------------------------------------- -// removeMarker -//--------------------------------------------------------- - -void MarkerView::removeMarker(const AL::Pos&) - { - printf("delete marker: not implemented\n"); - } - -//--------------------------------------------------------- // deleteMarker //--------------------------------------------------------- @@ -275,8 +253,9 @@ void MarkerView::deleteMarker() { MarkerItem* item = (MarkerItem*)table->currentItem(); if (item) { - song->removeMarker(item->marker()); + AL::Marker* marker = item->marker(); delete item; + song->removeMarker(marker); } } @@ -290,8 +269,6 @@ void MarkerView::updateList() AL::MarkerList* marker = song->marker(); for (AL::iMarker i = marker->begin(); i != marker->end(); ++i) { AL::Marker* m = &i->second; - QString tick; - tick.setNum(i->first); new MarkerItem(table, m); } } @@ -325,6 +302,10 @@ void MarkerView::markerSelectionChanged(QTreeWidgetItem* i) } } +//--------------------------------------------------------- +// clicked +//--------------------------------------------------------- + void MarkerView::clicked(QTreeWidgetItem* i) { MarkerItem* item = (MarkerItem*)i; @@ -377,28 +358,37 @@ void MarkerView::lockChanged(bool lck) } //--------------------------------------------------------- -// posChanged -// select appropriate Marker +// markerChanged //--------------------------------------------------------- -void MarkerView::markerChanged(int) +void MarkerView::markerChanged(int val) { -#if 0 - if (val != Song::MARKER_CUR) - return; - MarkerList* marker = song->marker(); - for (iMarker i = marker->begin(); i != marker->end(); ++i) { - if (i->second.current()) { - MarkerItem* item = (MarkerItem*)table->firstChild(); - while (item) { - if (item->marker() == &i->second) { - table->setSelected(item, true); - return; + switch (val) { + case Song::MARKER_ADD: + case Song::MARKER_REMOVE: + updateList(); + // fall through + case Song::MARKER_CUR: + { + AL::MarkerList* marker = song->marker(); + for (AL::iMarker i = marker->begin(); i != marker->end(); ++i) { + if (i->second.current()) { + int n = table->topLevelItemCount(); + for (int k = 0; k < n; ++k) { + MarkerItem* item = (MarkerItem*)(table->topLevelItem(k)); + if (item->marker() == &i->second) { + table->setCurrentItem(item); + return; + } + } } - item = (MarkerItem*)item->nextSibling(); } } + break; + case Song::MARKER_NAME: + case Song::MARKER_TICK: + case Song::MARKER_LOCK: + break; } -#endif } diff --git a/muse/muse/marker/markerview.h b/muse/muse/marker/markerview.h index 2129d415..e9940bc4 100644 --- a/muse/muse/marker/markerview.h +++ b/muse/muse/marker/markerview.h @@ -78,7 +78,6 @@ class MarkerView : public TopWin { private slots: void addMarker(); void addMarker(const AL::Pos&); - void removeMarker(const AL::Pos&); void deleteMarker(); void markerSelectionChanged(QTreeWidgetItem*); void nameChanged(const QString&); @@ -90,7 +89,6 @@ class MarkerView : public TopWin { public: MarkerView(); - virtual ~MarkerView(); }; #endif diff --git a/muse/muse/muse.cpp b/muse/muse/muse.cpp index dc681ae8..73def94a 100644 --- a/muse/muse/muse.cpp +++ b/muse/muse/muse.cpp @@ -1240,6 +1240,7 @@ void MusE::loadProject1(const QString& path) selectionChanged(); // enable/disable "Copy" & "Paste" arranger->endLoadSong(); song->updatePos(); + song->updateCurrentMarker(); // // send "cur" controller values to devices // diff --git a/muse/muse/song.cpp b/muse/muse/song.cpp index 0f90625b..eb131878 100644 --- a/muse/muse/song.cpp +++ b/muse/muse/song.cpp @@ -548,38 +548,47 @@ void Song::setPos(int idx, const Pos& val, bool sig, bool isSeek, bool follow) emit posChanged(idx, pos[idx], follow); } - if (idx == CPOS) { - AL::iMarker i1 = _markerList->begin(); - AL::iMarker i2 = i1; - bool currentChanged = false; - for (; i1 != _markerList->end(); ++i1) { - ++i2; - if (val.tick() >= i1->first && (i2==_markerList->end() || val.tick() < i2->first)) { - if (i1->second.current()) - return; - i1->second.setCurrent(true); - if (currentChanged) { - emit markerChanged(MARKER_CUR); - return; - } - ++i1; - for (; i1 != _markerList->end(); ++i1) { - if (i1->second.current()) - i1->second.setCurrent(false); - } + if (idx == CPOS) + updateCurrentMarker(); + } + +//--------------------------------------------------------- +// updateCurrentMarker +//--------------------------------------------------------- + +void Song::updateCurrentMarker() + { + AL::iMarker i1 = _markerList->begin(); + AL::iMarker i2 = i1; + bool currentChanged = false; + Pos& val = pos[CPOS]; + for (; i1 != _markerList->end(); ++i1) { + ++i2; + if (val.tick() >= i1->first && (i2==_markerList->end() || val.tick() < i2->first)) { + if (i1->second.current()) + return; + i1->second.setCurrent(true); + if (currentChanged) { emit markerChanged(MARKER_CUR); return; } - else { - if (i1->second.current()) { - currentChanged = true; + ++i1; + for (; i1 != _markerList->end(); ++i1) { + if (i1->second.current()) i1->second.setCurrent(false); - } } - } - if (currentChanged) emit markerChanged(MARKER_CUR); + return; + } + else { + if (i1->second.current()) { + currentChanged = true; + i1->second.setCurrent(false); + } + } } + if (currentChanged) + emit markerChanged(MARKER_CUR); } //--------------------------------------------------------- @@ -881,6 +890,7 @@ void Song::setMeasureLen(int b) AL::Marker* Song::addMarker(const QString& s, const AL::Pos& pos) { AL::Marker* marker = _markerList->add(s, pos); + updateCurrentMarker(); emit markerChanged(MARKER_ADD); return marker; } @@ -892,9 +902,14 @@ AL::Marker* Song::addMarker(const QString& s, const AL::Pos& pos) void Song::removeMarker(AL::Marker* marker) { _markerList->remove(marker); + updateCurrentMarker(); emit markerChanged(MARKER_REMOVE); } +//--------------------------------------------------------- +// setMarkerName +//--------------------------------------------------------- + AL::Marker* Song::setMarkerName(AL::Marker* m, const QString& s) { m->setName(s); @@ -908,6 +923,7 @@ AL::Marker* Song::setMarkerTick(AL::Marker* m, int t) _markerList->remove(m); mm.setTick(t); m = _markerList->add(mm); + updateCurrentMarker(); emit markerChanged(MARKER_TICK); return m; } @@ -915,6 +931,7 @@ AL::Marker* Song::setMarkerTick(AL::Marker* m, int t) AL::Marker* Song::setMarkerLock(AL::Marker* m, bool f) { m->setType(f ? AL::FRAMES : AL::TICKS); + updateCurrentMarker(); emit markerChanged(MARKER_LOCK); return m; } diff --git a/muse/muse/song.h b/muse/muse/song.h index 00708d59..65e1262f 100644 --- a/muse/muse/song.h +++ b/muse/muse/song.h @@ -412,6 +412,7 @@ class Song : public QObject { bool read(QFile* qf); void read20(QDomNode node); void read10(QDomNode); + void updateCurrentMarker(); }; extern Song* song; |