summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWerner Schweer <ws.seh.de>2006-11-01 21:04:31 +0000
committerWerner Schweer <ws.seh.de>2006-11-01 21:04:31 +0000
commit3b54037604daf134fc59d01015007311e69c473a (patch)
tree1b692681e9738a6e433471a388c7ec74c40bae7b
parentee889893c5da28274b26c689146948565b94a715 (diff)
fix remove audio out undo/redo
-rw-r--r--muse/muse/track.cpp8
-rw-r--r--muse/muse/widgets/mixdowndialog.cpp21
-rw-r--r--muse/muse/widgets/mixdowndialog.ui10
3 files changed, 26 insertions, 13 deletions
diff --git a/muse/muse/track.cpp b/muse/muse/track.cpp
index aab33bae..88cb3f9b 100644
--- a/muse/muse/track.cpp
+++ b/muse/muse/track.cpp
@@ -986,7 +986,8 @@ void Track::activate1()
for (int i = 0; i < channels(); ++i) {
if (!jackPort(i).isZero())
- printf("Track::activate1(): already active!\n");
+ printf("Track<%s>::activate1(): channel %d already active!\n",
+ name().toLatin1().data(), i);
else {
QString s(QString("%1-%2").arg(_name).arg(i));
if (type() == AUDIO_OUTPUT)
@@ -1048,6 +1049,7 @@ void Track::activate2()
void Track::deactivate()
{
+// printf("deactivate<%s>\n", name().toLatin1().data());
for (iRoute ri = _outRoutes.begin(); ri != _outRoutes.end(); ++ri) {
Route& r = *ri;
if (r.type == Route::JACKMIDIPORT) {
@@ -1081,11 +1083,11 @@ void Track::deactivate()
for (int i = 0; i < channels(); ++i) {
if (!_jackPort[i].isZero()) {
audioDriver->unregisterPort(_jackPort[i]);
- _jackPort[i] = 0;
+ _jackPort[i].setZero();
}
if (!_alsaPort[i].isZero()) {
midiDriver->unregisterPort(_alsaPort[i]);
- _alsaPort[i] = 0;
+ _alsaPort[i].setZero();
}
}
}
diff --git a/muse/muse/widgets/mixdowndialog.cpp b/muse/muse/widgets/mixdowndialog.cpp
index 6fc2fa28..ac517d30 100644
--- a/muse/muse/widgets/mixdowndialog.cpp
+++ b/muse/muse/widgets/mixdowndialog.cpp
@@ -22,6 +22,8 @@
#include "mixdowndialog.h"
#include "globals.h"
#include "wave.h"
+#include "song.h"
+#include "gconfig.h"
//---------------------------------------------------------
// sndFileOpen
@@ -59,6 +61,20 @@ MixdownFileDialog::MixdownFileDialog(SndFile* _sf, QWidget* parent)
comboChannel->setCurrentIndex(channels);
comboFormat->setCurrentIndex(format);
}
+ else {
+ // create unique mixdown file path
+ QString path = QDir::homePath() + "/" + config.projectPath + "/" + song->projectPath();
+
+ QDir dir(path);
+ for (int i = 1; i < 1000; ++i) {
+ QString fp = QString("md%2.wav").arg(i);
+ if (!dir.exists(fp)) {
+ path = dir.filePath(fp);
+ break;
+ }
+ }
+ editPath->setText(path);
+ }
}
//---------------------------------------------------------
@@ -105,13 +121,10 @@ void MixdownFileDialog::accept()
void MixdownFileDialog::fdialog()
{
- QString oldpath;
- if (sf)
- oldpath = sf->finfo()->filePath();
QString path = QFileDialog::getSaveFileName(
this,
tr("MusE: set mixdown file name"),
- oldpath,
+ editPath->text(),
tr("Wave Files (*.wav);;All Files (*)")
);
if (!path.isEmpty())
diff --git a/muse/muse/widgets/mixdowndialog.ui b/muse/muse/widgets/mixdowndialog.ui
index 1789935d..c1c3d4fa 100644
--- a/muse/muse/widgets/mixdowndialog.ui
+++ b/muse/muse/widgets/mixdowndialog.ui
@@ -1,7 +1,4 @@
<ui version="4.0" >
- <author></author>
- <comment></comment>
- <exportmacro></exportmacro>
<class>MixdownFileDialogBase</class>
<widget class="QDialog" name="MixdownFileDialogBase" >
<property name="geometry" >
@@ -105,7 +102,7 @@
<string/>
</property>
<property name="icon" >
- <iconset/>
+ <iconset resource="../muse.qrc" >:/xpm/fileopen.png</iconset>
</property>
</widget>
</item>
@@ -175,8 +172,9 @@
</layout>
</widget>
<layoutdefault spacing="6" margin="11" />
- <pixmapfunction></pixmapfunction>
- <resources/>
+ <resources>
+ <include location="../muse.qrc" />
+ </resources>
<connections>
<connection>
<sender>buttonOk</sender>