summaryrefslogtreecommitdiff
path: root/muse2
diff options
context:
space:
mode:
Diffstat (limited to 'muse2')
-rw-r--r--muse2/ChangeLog3
-rw-r--r--muse2/muse/app.cpp2
-rw-r--r--muse2/muse/app.h2
-rw-r--r--muse2/muse/arranger/tlist.cpp15
-rw-r--r--muse2/muse/song.h2
-rw-r--r--muse2/muse/songfile.cpp8
-rw-r--r--muse2/muse/widgets/header.cpp2
-rw-r--r--muse2/muse/widgets/mtrackinfo.cpp9
8 files changed, 29 insertions, 14 deletions
diff --git a/muse2/ChangeLog b/muse2/ChangeLog
index bef2769f..742d5a48 100644
--- a/muse2/ChangeLog
+++ b/muse2/ChangeLog
@@ -6,6 +6,9 @@
under Midi -> Input Plugins -> Remote Control
- song->midiNote now also delivers note off events (flo93)
- fixed pitch-spinbox (flo93)
+ - removed auto-resize from tracklist-header (rj)
+ - removed channel from track list for a drum track and grayed it out in track info (rj)
+ - fixed samplerate warning from templates (rj)
23.05.2011: (all changes made by flo93, except one)
Function-related changes:
- made all the stuff in the "functions" menu global
diff --git a/muse2/muse/app.cpp b/muse2/muse/app.cpp
index f94f4a64..62871b18 100644
--- a/muse2/muse/app.cpp
+++ b/muse2/muse/app.cpp
@@ -1815,7 +1815,7 @@ void MusE::loadProjectFile1(const QString& name, bool songTemplate, bool loadAll
}
else {
Xml xml(f);
- read(xml, !loadAll);
+ read(xml, !loadAll, songTemplate);
bool fileError = ferror(f);
popenFlag ? pclose(f) : fclose(f);
if (fileError) {
diff --git a/muse2/muse/app.h b/muse2/muse/app.h
index 2aa2834f..c194b603 100644
--- a/muse2/muse/app.h
+++ b/muse2/muse/app.h
@@ -195,7 +195,7 @@ class MusE : public QMainWindow
QMenu* openRecent;
bool readMidi(FILE*);
- void read(Xml& xml, bool skipConfig);
+ void read(Xml& xml, bool skipConfig, bool isTemplate);
void processTrack(MidiTrack* track);
void write(Xml& xml) const;
diff --git a/muse2/muse/arranger/tlist.cpp b/muse2/muse/arranger/tlist.cpp
index fbd763d8..b1033a2a 100644
--- a/muse2/muse/arranger/tlist.cpp
+++ b/muse2/muse/arranger/tlist.cpp
@@ -299,7 +299,11 @@ void TList::paint(const QRect& r)
{
QString s;
int n;
- if (track->isMidiTrack()) {
+ if (track->isMidiTrack() && track->type() == Track::DRUM) {
+ p.drawText(r, Qt::AlignVCenter|Qt::AlignHCenter, "-");
+ break;
+ }
+ else if (track->isMidiTrack()) {
n = ((MidiTrack*)track)->outChannel() + 1;
}
else {
@@ -1279,8 +1283,10 @@ void TList::mousePressEvent(QMouseEvent* ev)
{
MidiTrack* mt = dynamic_cast<MidiTrack*>(t);
if (mt == 0)
- break;
-
+ break;
+ if (mt->type() == Track::DRUM)
+ break;
+
int channel = mt->outChannel();
channel += delta;
if(channel >= MIDI_CHANNELS)
@@ -1554,6 +1560,9 @@ void TList::wheelEvent(QWheelEvent* ev)
case COL_OCHANNEL:
if (t->isMidiTrack()) {
MidiTrack* mt = (MidiTrack*)t;
+ if (mt && mt->type() == Track::DRUM)
+ break;
+
int channel = mt->outChannel() + delta;
if (channel >= MIDI_CHANNELS)
diff --git a/muse2/muse/song.h b/muse2/muse/song.h
index e1378480..47fd96d4 100644
--- a/muse2/muse/song.h
+++ b/muse2/muse/song.h
@@ -162,7 +162,7 @@ class Song : public QObject {
AudioOutput* bounceOutput;
void updatePos();
- void read(Xml&);
+ void read(Xml&, bool isTemplate=false);
void write(int, Xml&) const;
void writeFont(int level, Xml& xml, const char* name,
const QFont& font) const;
diff --git a/muse2/muse/songfile.cpp b/muse2/muse/songfile.cpp
index a8134b1d..72cacfaa 100644
--- a/muse2/muse/songfile.cpp
+++ b/muse2/muse/songfile.cpp
@@ -1213,7 +1213,7 @@ void Song::readMarker(Xml& xml)
// read
//---------------------------------------------------------
-void Song::read(Xml& xml)
+void Song::read(Xml& xml, bool isTemplate)
{
cloneList.clear();
for (;;) {
@@ -1260,7 +1260,7 @@ void Song::read(Xml& xml)
_follow = FollowMode(xml.parseInt());
else if (tag == "sampleRate") {
int sRate = xml.parseInt();
- if (audioDevice->deviceType() != AudioDevice::DUMMY_AUDIO && sRate != sampleRate)
+ if (!isTemplate && audioDevice->deviceType() != AudioDevice::DUMMY_AUDIO && sRate != sampleRate)
QMessageBox::warning(muse,"Wrong sample rate", "The sample rate in this project and the current system setting differs, the project may not work as intended!");
}
else if (tag == "tempolist") {
@@ -1373,7 +1373,7 @@ void Song::read(Xml& xml)
// read song
//---------------------------------------------------------
-void MusE::read(Xml& xml, bool skipConfig)
+void MusE::read(Xml& xml, bool skipConfig, bool isTemplate)
{
bool skipmode = true;
for (;;) {
@@ -1398,7 +1398,7 @@ void MusE::read(Xml& xml, bool skipConfig)
readConfiguration(xml, false);
else if (tag == "song")
{
- song->read(xml);
+ song->read(xml, isTemplate);
audio->msgUpdateSoloStates();
}
else if (tag == "midiport")
diff --git a/muse2/muse/widgets/header.cpp b/muse2/muse/widgets/header.cpp
index 00cbd29c..61ebcc74 100644
--- a/muse2/muse/widgets/header.cpp
+++ b/muse2/muse/widgets/header.cpp
@@ -88,7 +88,7 @@ Header::Header(QWidget* parent, const char* name)
itemModel = new QStandardItemModel;
setModel(itemModel);
setDefaultSectionSize(30);
- setStretchLastSection(true);
+// setStretchLastSection(true);
}
diff --git a/muse2/muse/widgets/mtrackinfo.cpp b/muse2/muse/widgets/mtrackinfo.cpp
index e6e618bd..465b7130 100644
--- a/muse2/muse/widgets/mtrackinfo.cpp
+++ b/muse2/muse/widgets/mtrackinfo.cpp
@@ -44,10 +44,13 @@ void MidiTrackInfo::setTrack(Track* t)
selected = t;
QPalette pal;
- if(selected->type() == Track::DRUM)
+ if(selected->type() == Track::DRUM) {
pal.setColor(trackNameLabel->backgroundRole(), config.drumTrackLabelBg);
- else
- pal.setColor(trackNameLabel->backgroundRole(), config.midiTrackLabelBg);
+ iOutputChannel->setEnabled(false);
+ } else {
+ pal.setColor(trackNameLabel->backgroundRole(), config.midiTrackLabelBg);
+ iOutputChannel->setEnabled(true);
+ }
trackNameLabel->setPalette(pal);
updateTrackInfo(-1);