summaryrefslogtreecommitdiff
path: root/muse2/muse
diff options
context:
space:
mode:
authorRobert Jonsson <spamatica@gmail.com>2012-07-08 12:15:42 +0000
committerRobert Jonsson <spamatica@gmail.com>2012-07-08 12:15:42 +0000
commit164c30b96d94561ba71c770eb0598d0195728615 (patch)
treea5f5db76ac0b84e46488c3f6d9e472673b3cc569 /muse2/muse
parentedd120313caf03650daf32c7b9c383188061b5bc (diff)
see ChangeLog
Diffstat (limited to 'muse2/muse')
-rw-r--r--muse2/muse/arranger/arrangerview.cpp22
-rw-r--r--muse2/muse/audiotrack.cpp15
-rw-r--r--muse2/muse/globals.cpp2
-rw-r--r--muse2/muse/globals.h2
-rw-r--r--muse2/muse/track.h1
-rw-r--r--muse2/muse/wave.cpp4
-rw-r--r--muse2/muse/widgets/view.cpp1
7 files changed, 28 insertions, 19 deletions
diff --git a/muse2/muse/arranger/arrangerview.cpp b/muse2/muse/arranger/arrangerview.cpp
index 57c12d15..9c24c7ce 100644
--- a/muse2/muse/arranger/arrangerview.cpp
+++ b/muse2/muse/arranger/arrangerview.cpp
@@ -492,19 +492,29 @@ void ArrangerView::cmd(int cmd)
arranger->cmd(Arranger::CMD_INSERT_EMPTYMEAS);
break;
case CMD_DELETE:
- if (!MusEGlobal::song->msgRemoveParts()) //automatically does undo if neccessary and returns true then
{
- //msgRemoveParts() returned false -> no parts to remove?
- MusEGlobal::song->startUndo();
- MusEGlobal::audio->msgRemoveTracks(); //TODO FINDME this could still be speeded up!
- MusEGlobal::song->endUndo(SC_TRACK_REMOVED);
+ QMessageBox::StandardButton btn = QMessageBox::warning(
+ this,tr("Remove track(s)"),tr("Are you sure you want to remove this track(s)?"),
+ QMessageBox::Ok|QMessageBox::Cancel, QMessageBox::Ok);
+
+ if (btn == QMessageBox::Cancel)
+ break;
+ if (!MusEGlobal::song->msgRemoveParts()) //automatically does undo if neccessary and returns true then
+ {
+ //msgRemoveParts() returned false -> no parts to remove?
+ MusEGlobal::song->startUndo();
+ MusEGlobal::audio->msgRemoveTracks(); //TODO FINDME this could still be speeded up!
+ MusEGlobal::song->endUndo(SC_TRACK_REMOVED);
+ }
}
break;
- case CMD_DELETE_TRACK:
+ case CMD_DELETE_TRACK: // from menu
+ {
MusEGlobal::song->startUndo();
MusEGlobal::audio->msgRemoveTracks();
MusEGlobal::song->endUndo(SC_TRACK_REMOVED);
MusEGlobal::audio->msgUpdateSoloStates();
+ }
break;
case CMD_DUPLICATE_TRACK:
diff --git a/muse2/muse/audiotrack.cpp b/muse2/muse/audiotrack.cpp
index dac496d7..32922c3b 100644
--- a/muse2/muse/audiotrack.cpp
+++ b/muse2/muse/audiotrack.cpp
@@ -102,6 +102,7 @@ AudioTrack::AudioTrack(TrackType t)
_sendMetronome = false;
_prefader = false;
_efxPipe = new Pipeline();
+ recFileNumber = 1;
//_recFile = 0; //unneeded, _recFile's ctor does this
_channels = 0;
_automationType = AUTO_OFF;
@@ -130,7 +131,8 @@ AudioTrack::AudioTrack(const AudioTrack& t, int flags)
_processed = false;
_haveData = false;
_efxPipe = new Pipeline(); // Start off with a new pipeline.
-
+ recFileNumber = 1;
+
// Don't allocate outBuffers here. Let internal_assign() call setTotalOutChannels to set them up.
outBuffers = 0;
_totalOutChannels = 0;
@@ -1881,10 +1883,11 @@ bool AudioTrack::prepareRecording()
//
char buffer[128];
QFile fil;
- for (;;++MusEGlobal::recFileNumber) {
- sprintf(buffer, "%s/rec%d.wav",
- MusEGlobal::museProject.toLatin1().constData(),
- MusEGlobal::recFileNumber);
+ for (;;++recFileNumber) {
+ sprintf(buffer, "%s/TRACK_%s_TAKE_%d.wav",
+ MusEGlobal::museProject.toLocal8Bit().constData(),
+ name().simplified().replace(" ","_").toLocal8Bit().constData(),
+ recFileNumber);
fil.setFileName(QString(buffer));
if (!fil.exists())
break;
@@ -1896,7 +1899,7 @@ bool AudioTrack::prepareRecording()
}
if (MusEGlobal::debugMsg)
- printf("AudioNode::setRecordFlag1: init internal file %s\n", _recFile->path().toLatin1().constData());
+ printf("AudioNode::setRecordFlag1: init internal file %s\n", _recFile->path().toLatin1().constData());
if(_recFile->openWrite())
{
diff --git a/muse2/muse/globals.cpp b/muse2/muse/globals.cpp
index b3765074..967f0870 100644
--- a/muse2/muse/globals.cpp
+++ b/muse2/muse/globals.cpp
@@ -35,8 +35,6 @@
namespace MusEGlobal {
-int recFileNumber = 1;
-
int sampleRate = 44100;
unsigned segmentSize = 1024U; // segmentSize in frames (set by JACK)
unsigned fifoLength = 128; // 131072/segmentSize
diff --git a/muse2/muse/globals.h b/muse2/muse/globals.h
index bdf383c8..915486e1 100644
--- a/muse2/muse/globals.h
+++ b/muse2/muse/globals.h
@@ -44,8 +44,6 @@ namespace MusEGlobal {
extern const float denormalBias;
-extern int recFileNumber;
-
extern int sampleRate;
extern unsigned segmentSize;
extern unsigned fifoLength; // inversely proportional to segmentSize
diff --git a/muse2/muse/track.h b/muse2/muse/track.h
index 3da34912..3efc6912 100644
--- a/muse2/muse/track.h
+++ b/muse2/muse/track.h
@@ -346,6 +346,7 @@ class AudioTrack : public Track {
bool _prefader; // prefader metering
std::vector<double> _auxSend;
void readAuxSend(Xml& xml);
+ int recFileNumber;
bool _sendMetronome;
AutomationType _automationType;
diff --git a/muse2/muse/wave.cpp b/muse2/muse/wave.cpp
index 8d17a10d..0657bbe0 100644
--- a/muse2/muse/wave.cpp
+++ b/muse2/muse/wave.cpp
@@ -150,7 +150,7 @@ void SndFile::readCache(const QString& path, bool showProgress)
for (unsigned ch = 0; ch < channels(); ++ch)
cache[ch] = new SampleV[csize];
- FILE* cfile = fopen(path.toLatin1().constData(), "r");
+ FILE* cfile = fopen(path.toLocal8Bit().constData(), "r");
if (cfile) {
for (unsigned ch = 0; ch < channels(); ++ch)
fread(cache[ch], csize * sizeof(SampleV), 1, cfile);
@@ -344,7 +344,7 @@ bool SndFile::openWrite()
return false;
}
QString p = path();
- sf = sf_open(p.toLatin1().constData(), SFM_RDWR, &sfinfo);
+ sf = sf_open(p.toLocal8Bit().constData(), SFM_RDWR, &sfinfo);
sfUI = 0;
if (sf) {
openFlag = true;
diff --git a/muse2/muse/widgets/view.cpp b/muse2/muse/widgets/view.cpp
index 60056848..fb53be46 100644
--- a/muse2/muse/widgets/view.cpp
+++ b/muse2/muse/widgets/view.cpp
@@ -513,7 +513,6 @@ void View::pdraw(QPainter& p, const QRect& r)
int y = r.y();
int w = r.width();
int h = r.height();
- printf("xmag=%d\n",xmag);
if (xmag <= 0) {
// TODO These adjustments are required, otherwise gaps. Tried, unable to remove them for now. p4.0.30
x -= 1;