From a328390d794b66a2c47b72b7dc0a3c8b7bff82ca Mon Sep 17 00:00:00 2001 From: Werner Schweer Date: Thu, 19 Apr 2007 16:00:28 +0000 Subject: updates --- muse/ChangeLog | 2 + muse/al/dsp.cpp | 10 +---- muse/al/dsp.h | 9 ++++- muse/muse/audiotrack.cpp | 4 +- muse/muse/fifo.cpp | 3 +- muse/muse/mixer/astrip.cpp | 7 +++- muse/muse/mixer/mixer.cpp | 13 +++---- muse/muse/mixer/strip.cpp | 12 +++--- muse/muse/mixer/strip.h | 3 ++ muse/muse/pipeline.cpp | 3 +- muse/muse/songfile.cpp | 95 ++++++++++++++++++++++++++++++---------------- muse/muse/wavetrack.cpp | 3 +- muse/muse/xpm/mono.svg | 27 +++++++------ muse/muse/xpm/mono.xpm | 16 -------- muse/muse/xpm/stereo.svg | 86 +++++++++++++++++++---------------------- muse/muse/xpm/stereo.xpm | 14 ------- 16 files changed, 155 insertions(+), 152 deletions(-) delete mode 100644 muse/muse/xpm/mono.xpm delete mode 100644 muse/muse/xpm/stereo.xpm diff --git a/muse/ChangeLog b/muse/ChangeLog index f6be4d38..389cff53 100644 --- a/muse/ChangeLog +++ b/muse/ChangeLog @@ -1,4 +1,6 @@ 19.04 (ws) + - disable routing buttons in mixer strip when in off state + - fixed crash when removing track from mixer - framework for importing muse0.9 projectfiles - align buffer in dummy audio driver so that the sse routines do not choke; same for AuxPluginF, Pipeline, Fifo diff --git a/muse/al/dsp.cpp b/muse/al/dsp.cpp index b9032443..7fb41fe7 100644 --- a/muse/al/dsp.cpp +++ b/muse/al/dsp.cpp @@ -93,15 +93,7 @@ void initDsp() unsigned long useSSE = 0; #ifdef __x86_64__ - asm ( - "pushq %%rbx\n" - "movq $1, %%rax\n" - "cpuid\n" - "movq %%rdx, %0\n" - "popq %%rbx\n" - : "=r" (useSSE) - : - : "%rax", "%rcx", "%rdx", "memory"); + useSSE = 1 << 25; // we know the platform has SSE #else asm ( "mov $1, %%eax\n" diff --git a/muse/al/dsp.h b/muse/al/dsp.h index d8da11dc..6c7123ac 100644 --- a/muse/al/dsp.h +++ b/muse/al/dsp.h @@ -23,7 +23,6 @@ namespace AL { - //--------------------------------------------------------- // f_max //--------------------------------------------------------- @@ -65,6 +64,14 @@ class Dsp { for (unsigned i = 0; i < n; ++i) dst[i] += src[i]; } + virtual void cpy(float* dst, float* src, unsigned n) { +#if defined(ARCH_X86) || defined(ARCH_X86_64) + register unsinged long int dummy; + __asm__ __volatile__ "rep; movsl" :"=&D"(dst), "=&S"(src), "=&c"(dummy) :"0" (to), "1" (from),"2" (n) : "memory"); +#else + memcpy(dst, src, sizeof(float) * n); +#endif + } }; extern void initDsp(); diff --git a/muse/muse/audiotrack.cpp b/muse/muse/audiotrack.cpp index 1d0940fd..7ef63f1b 100644 --- a/muse/muse/audiotrack.cpp +++ b/muse/muse/audiotrack.cpp @@ -20,12 +20,12 @@ #include "al/al.h" #include "al/dsp.h" +#include "al/xml.h" #include "track.h" #include "event.h" #include "song.h" #include "audio.h" #include "wave.h" -#include "al/xml.h" #include "auxplugin.h" #include "pipeline.h" #include "driver/audiodev.h" @@ -514,7 +514,7 @@ bool AudioTrack::copy(int srcChannels, float** srcBuffer) if (srcChannels == dstChannels) { for (int c = 0; c < dstChannels; ++c) - memcpy(buffer[c], srcBuffer[c], sizeof(float) * segmentSize); + AL::dsp->cpy(buffer[c], srcBuffer[c], segmentSize); } else if (srcChannels == 1 && dstChannels == 2) { float* sp = srcBuffer[0]; diff --git a/muse/muse/fifo.cpp b/muse/muse/fifo.cpp index 5b6e43cf..32300f92 100644 --- a/muse/muse/fifo.cpp +++ b/muse/muse/fifo.cpp @@ -20,6 +20,7 @@ #include "fifo.h" #include "globals.h" +#include "al/dsp.h" //--------------------------------------------------------- // clear @@ -95,7 +96,7 @@ bool Fifo::put(int segs, unsigned long samples, float** src, unsigned pos) b->segs = segs; b->pos = pos; for (int i = 0; i < segs; ++i) - memcpy(b->buffer + i * samples, src[i], samples * sizeof(float)); + AL::dsp->cpy(b->buffer + i * samples, src[i], samples); push(); return false; } diff --git a/muse/muse/mixer/astrip.cpp b/muse/muse/mixer/astrip.cpp index 1f1326e2..11b6833e 100644 --- a/muse/muse/mixer/astrip.cpp +++ b/muse/muse/mixer/astrip.cpp @@ -275,9 +275,12 @@ void AudioStrip::updateOffState() iR->setEnabled(val); if (oR) oR->setEnabled(val); - if (off) { + if (off) off->setChecked(track->off()); - } + if (ar) + ar->setEnabled(val); + if (aw) + aw->setEnabled(val); } //--------------------------------------------------------- diff --git a/muse/muse/mixer/mixer.cpp b/muse/muse/mixer/mixer.cpp index d2e04aea..b3e5ce06 100644 --- a/muse/muse/mixer/mixer.cpp +++ b/muse/muse/mixer/mixer.cpp @@ -171,16 +171,13 @@ void Mixer::updateMixer(int action) showSyntiTracksId->setChecked(cfg->showSyntiTracks); if (action == STRIP_REMOVED) { - StripList::iterator si = stripList.begin(); - for (; si != stripList.end();) { - Track* track = (*si)->getTrack(); - StripList::iterator ssi = si; - ++si; + foreach(Strip* strip, stripList) { + Track* track = strip->getTrack(); if (song->trackExists(track)) continue; - layout->removeWidget(*ssi); - delete *ssi; - stripList.erase(ssi); + layout->removeWidget(strip); + delete strip; + stripList.removeAt(stripList.indexOf(strip)); } int idx = stripList.size(); setMaximumWidth(STRIP_WIDTH * idx + 4); diff --git a/muse/muse/mixer/strip.cpp b/muse/muse/mixer/strip.cpp index da73c00c..c02dabe8 100644 --- a/muse/muse/mixer/strip.cpp +++ b/muse/muse/mixer/strip.cpp @@ -57,6 +57,8 @@ void Strip::updateLabel() Strip::Strip(Mixer* m, Track* t, bool align) : QFrame() { + ar = 0; + aw = 0; setAttribute(Qt::WA_DeleteOnClose, true); mixer = m; _align = align; @@ -108,16 +110,14 @@ void Strip::configChanged() void Strip::addAutomationButtons(int row) { - QHBoxLayout* aBox = new QHBoxLayout; - SimpleButton* ar = newAutoReadButton(); + ar = newAutoReadButton(); ar->setFixedHeight(BUTTON_HEIGHT); ar->setChecked(track->autoRead()); - aBox->addWidget(ar); - SimpleButton* aw = newAutoWriteButton(); + grid->addWidget(ar, row, 0); + aw = newAutoWriteButton(); aw->setFixedHeight(BUTTON_HEIGHT); aw->setChecked(track->autoWrite()); - aBox->addWidget(aw); - grid->addLayout(aBox, row, 0, 1, 2); + grid->addWidget(aw, row, 1); connect(ar, SIGNAL(clicked(bool)), SLOT(autoReadToggled(bool))); connect(aw, SIGNAL(clicked(bool)), SLOT(autoWriteToggled(bool))); connect(track, SIGNAL(autoReadChanged(bool)), ar, SLOT(setChecked(bool))); diff --git a/muse/muse/mixer/strip.h b/muse/muse/mixer/strip.h index c4ef3604..f9bc06ea 100644 --- a/muse/muse/mixer/strip.h +++ b/muse/muse/mixer/strip.h @@ -47,6 +47,9 @@ class Strip : public QFrame { SimpleButton* solo; SimpleButton* mute; + SimpleButton* ar; + SimpleButton* aw; + void updateLabel(); bool _align; // align elements for mixer app diff --git a/muse/muse/pipeline.cpp b/muse/muse/pipeline.cpp index de42c867..ae5b9d25 100644 --- a/muse/muse/pipeline.cpp +++ b/muse/muse/pipeline.cpp @@ -21,6 +21,7 @@ #include "pipeline.h" #include "plugin.h" #include "plugingui.h" +#include "al/dsp.h" //--------------------------------------------------------- // Pipeline @@ -214,7 +215,7 @@ void Pipeline::apply(int ports, unsigned long nframes, float** buffer1) } if (swap) { for (int i = 0; i < ports; ++i) - memcpy(buffer1[i], buffer[i], sizeof(float) * nframes); + AL::dsp->cpy(buffer1[i], buffer[i], nframes); } } diff --git a/muse/muse/songfile.cpp b/muse/muse/songfile.cpp index f40ace80..5aa19206 100644 --- a/muse/muse/songfile.cpp +++ b/muse/muse/songfile.cpp @@ -390,62 +390,93 @@ void Song::read20(QDomNode node) if (e.isNull()) continue; QString t(e.tagName()); + int i = e.text().toInt(); if (t == "automation") ; - else if (t == "cpos") - ; - else if (t == "rpos") - ; - else if (t == "lpos") - ; + else if (t == "cpos") { + int pos = i; + Pos p(pos, AL::TICKS); + setPos(Song::CPOS, p, false, false, false); + } + else if (t == "rpos") { + int pos = i; + Pos p(pos, AL::TICKS); + setPos(Song::RPOS, p, false, false, false); + } + else if (t == "lpos") { + int pos = i; + Pos p(pos, AL::TICKS); + setPos(Song::LPOS, p, false, false, false); + } else if (t == "master") - ; + setMasterFlag(i); else if (t == "loop") - ; + setLoop(i); else if (t == "punchin") - ; + setPunchin(i); else if (t == "punchout") - ; + setPunchout(i); else if (t == "record") ; else if (t == "solo") - ; + soloFlag = i; else if (t == "type") ; else if (t == "recmode") - ; + _recMode = i; else if (t == "cycle") - ; + _cycleMode = i; else if (t == "click") - ; + setClick(i); else if (t == "quantize") - ; + _quantize = i; else if (t == "len") - ; + _len = i; else if (t == "follow") ; else if (t == "drummap") ; else if (t == "siglist") - ; + AL::sigmap.read(node.firstChild()); else if (t == "tempolist") - ; + AL::tempomap.read(node); else if (t == "Route") ; - else if (t == "AudioAux") - ; - else if (t == "AudioInput") - ; - else if (t == "AudioGroup") - ; - else if (t == "AudioOutput") - ; - else if (t == "wavetrack") - ; - else if (t == "drumtrack") - ; - else if (t == "miditrack") - ; + else if (t == "AudioAux") { + AudioGroup* track = new AudioGroup(); + track->read(node.firstChild()); + insertTrack0(track,-1); + } + else if (t == "AudioInput") { + AudioInput* track = new AudioInput(); + track->read(node.firstChild()); + insertTrack0(track,-1); + } + else if (t == "AudioGroup") { + AudioGroup* track = new AudioGroup(); + track->read(node.firstChild()); + insertTrack0(track,-1); + } + else if (t == "AudioOutput") { + AudioOutput* track = new AudioOutput(); + track->read(node.firstChild()); + insertTrack0(track,-1); + } + else if (t == "wavetrack") { + MidiTrack* track = new MidiTrack(); + track->read(node.firstChild()); + insertTrack0(track, -1); + } + else if (t == "drumtrack") { + MidiTrack* track = new MidiTrack(); + track->read(node.firstChild()); + insertTrack0(track, -1); + } + else if (t == "miditrack") { + MidiTrack* track = new MidiTrack(); + track->read(node.firstChild()); + insertTrack0(track, -1); + } else domError(n1); } diff --git a/muse/muse/wavetrack.cpp b/muse/muse/wavetrack.cpp index 77ddc046..38df1158 100644 --- a/muse/muse/wavetrack.cpp +++ b/muse/muse/wavetrack.cpp @@ -23,6 +23,7 @@ #include "audio.h" #include "wave.h" #include "al/xml.h" +#include "al/dsp.h" #include "song.h" #include "globals.h" #include "part.h" @@ -346,7 +347,7 @@ void WaveTrack::collectInputData() else { float** bpp = readBuffer[idx]; for (int i = 0; i < channels(); ++i) - memcpy(buffer[i], bpp[i], sizeof(float) * segmentSize); + AL::dsp->cpy(buffer[i], bpp[i], sizeof(float)); } } } diff --git a/muse/muse/xpm/mono.svg b/muse/muse/xpm/mono.svg index 850fcfe9..ac764181 100644 --- a/muse/muse/xpm/mono.svg +++ b/muse/muse/xpm/mono.svg @@ -6,16 +6,18 @@ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" - xmlns:sodipodi="http://inkscape.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="33" - height="20" + width="16" + height="16" id="svg1307" sodipodi:version="0.32" - inkscape:version="0.43" + inkscape:version="0.45" version="1.0" sodipodi:docbase="/home/ws/projects/muse/muse/trunk/muse/muse/xpm" - sodipodi:docname="mono.svg"> + sodipodi:docname="mono.svg" + inkscape:output_extension="org.inkscape.output.svg.inkscape" + sodipodi:modified="true"> + inkscape:window-width="907" + inkscape:window-height="591" + inkscape:window-x="608" + inkscape:window-y="401" + width="16px" + height="16px" /> @@ -50,7 +54,8 @@ + inkscape:groupmode="layer" + transform="translate(-7.6895154,-1)"> + transform="matrix(0.7216721,0,0,0.8227871,6.6137967,0.5665679)" /> diff --git a/muse/muse/xpm/mono.xpm b/muse/muse/xpm/mono.xpm deleted file mode 100644 index 9acebb58..00000000 --- a/muse/muse/xpm/mono.xpm +++ /dev/null @@ -1,16 +0,0 @@ -/* XPM */ -static const char *mono_xpm[] = { -"15 9 2 1", -" c #303030", -". c none", -/* pixels */ -"..... .....", -".... ....", -"... ... ...", -"... ..... ...", -"... ..... ...", -"... ..... ...", -"... ... ...", -".... ....", -"..... ....." -}; diff --git a/muse/muse/xpm/stereo.svg b/muse/muse/xpm/stereo.svg index 1d7bc30a..2d222f61 100644 --- a/muse/muse/xpm/stereo.svg +++ b/muse/muse/xpm/stereo.svg @@ -6,38 +6,20 @@ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" - xmlns:sodipodi="http://inkscape.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="33" - height="20" + version="1.0" + width="16" + height="16" id="svg1307" sodipodi:version="0.32" - inkscape:version="0.43" - version="1.0" + inkscape:version="0.45" + sodipodi:docname="stereo.svg" + inkscape:output_extension="org.inkscape.output.svg.inkscape" sodipodi:docbase="/home/ws/projects/muse/muse/trunk/muse/muse/xpm" - sodipodi:docname="Stereo.svg"> - - + sodipodi:modified="true"> + id="metadata8"> @@ -47,32 +29,40 @@ + + + transform="matrix(0.6319982,0,0,0.6402952,-2.3836027,1.951611)"> + style="fill:#ff0000;fill-opacity:0;stroke:#3e3e3e;stroke-width:2.26799989;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="path1317" /> + id="path2192" /> diff --git a/muse/muse/xpm/stereo.xpm b/muse/muse/xpm/stereo.xpm deleted file mode 100644 index c2787780..00000000 --- a/muse/muse/xpm/stereo.xpm +++ /dev/null @@ -1,14 +0,0 @@ -/* XPM */ -static const char* stereo_xpm[] = { -"15 9 2 1", -" c none", -". c #303030", -" ..... ..... ", -" ............. ", -"... ... ...", -".. ... ..", -".. .... ..", -".. ... ..", -"... ... ...", -" ............. ", -" ..... ..... "}; -- cgit v1.2.3