Skip to content

Commit

Permalink
Default add-track to not use a buss, use midi pan knob color, Fix ini…
Browse files Browse the repository at this point in the history
…tial pan state on track header
  • Loading branch information
linuxras committed Mar 21, 2012
1 parent cfe5ffb commit 23a5542
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 22 deletions.
4 changes: 2 additions & 2 deletions oom/TrackManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1398,7 +1398,7 @@ void TrackManager::removeTrack(qint64 id)/*{{{*/
}
}/*}}}*/

void TrackManager::removeSelectedTracks()
void TrackManager::removeSelectedTracks()/*{{{*/
{
QList<qint64> selected = song->selectedTracks();
if(selected.isEmpty())
Expand Down Expand Up @@ -1480,7 +1480,7 @@ void TrackManager::removeSelectedTracks()
audio->msgRemoveTrackGroup(idList, true);
}
}
}
}/*}}}*/

bool TrackManager::removeTrack(VirtualTrack* vtrack)/*{{{*/
{
Expand Down
14 changes: 9 additions & 5 deletions oom/widgets/CreateTrackDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -679,13 +679,14 @@ void CreateTrackDialog::updateBussSelected(bool raw)/*{{{*/
}
else
{
m_panKnob->setKnobImage(QString(":images/knob_midi_new.png"));
//m_panKnob->setKnobImage(QString(":images/knob_midi_new.png"));
m_panKnob->setKnobImage(QString(":images/knob_audio_new.png"));
}
m_panKnob->update();
}/*}}}*/

//Track type combo slot
void CreateTrackDialog::trackTypeChanged(int type)
void CreateTrackDialog::trackTypeChanged(int type)/*{{{*/
{
Track::TrackType curtype = (Track::TrackType)m_insertType;
if(curtype == Track::MIDI && m_instrumentLoaded)
Expand All @@ -699,7 +700,7 @@ void CreateTrackDialog::trackTypeChanged(int type)
populateInstrumentList();
populateMonitorList();
populateBussList();
}
}/*}}}*/

void CreateTrackDialog::trackNameEdited()
{
Expand Down Expand Up @@ -1008,7 +1009,10 @@ void CreateTrackDialog::populateNewInputList()/*{{{*/
{
if ((*i)->deviceType() == MidiDevice::ALSA_MIDI)
{
cmbInput->addItem((*i)->name(), MidiDevice::ALSA_MIDI);
if ((*i)->rwFlags() & 0x2)
{
cmbInput->addItem((*i)->name(), MidiDevice::ALSA_MIDI);
}
}
}
if(audioDevice->deviceType() != AudioDevice::JACK_AUDIO)
Expand Down Expand Up @@ -1084,7 +1088,7 @@ void CreateTrackDialog::updateVisibleElements()/*{{{*/
chkOutput->setEnabled(true);
chkInput->setChecked(true);
chkOutput->setChecked(true);
chkBuss->setChecked(true);
chkBuss->setChecked(false);
chkAutoCreate->setChecked(true);
cmbMonitor->setEnabled(true);
trackNameEdited();
Expand Down
19 changes: 5 additions & 14 deletions oom/widgets/TrackEffects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,26 +103,17 @@ void TrackEffects::setupAuxPanel()/*{{{*/
{
if(!hasAux)
return;
Track *in = 0;
if(m_track->hasChildren())
if(m_track->isMidiTrack())
{
QList<qint64> *chain = m_track->audioChain();
for(int i = 0; i < chain->size(); i++)
{
in = song->findTrackByIdAndType(chain->at(i), Track::AUDIO_INPUT);
if(in)
{
break;
}
}
Track *in = m_track->inputTrack();
if(in)
{
QLabel* inputLabel = new QLabel(tr("Input Aux"));
m_auxBox->addWidget(inputLabel);
//QLabel* inputLabel = new QLabel(tr("Input Aux"));
//m_auxBox->addWidget(inputLabel);
populateAuxForTrack((AudioTrack*)in);
}
}
if(!m_track->isMidiTrack())
else
{//Populate my own aux send
QLabel* auxLabel = new QLabel(tr("Aux"));
m_auxBox->addWidget(auxLabel);
Expand Down
14 changes: 13 additions & 1 deletion oom/widgets/trackheader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1890,7 +1890,6 @@ void TrackHeader::initPan()/*{{{*/
connect(m_pan, SIGNAL(sliderMoved(double, int)), SLOT(panChanged(double)));
//connect(m_pan, SIGNAL(sliderRightClicked(const QPoint &, int)), SLOT(controlRightClicked(const QPoint &, int)));
*/
//Track *in = m_track->inputTrack();
m_pan = new Knob(this);/*{{{*/
m_pan->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum));
m_pan->setRange(-1.0, +1.0);
Expand All @@ -1910,6 +1909,19 @@ void TrackHeader::initPan()/*{{{*/
m_panLayout->insertWidget(1, m_pan);
}
m_pan->show();
Track *in = m_track->inputTrack();
if(in)
{
double v = ((AudioTrack*) in)->pan();
m_pan->blockSignals(true);
m_pan->setValue(v);
m_pan->blockSignals(false);
panVal = v;
if(((AudioTrack*) in)->panFromAutomation())
{
midiMonitor->msgSendAudioOutputEvent((Track*)in, CTRL_PANPOT, v);
}
}
connect(m_pan, SIGNAL(sliderMoved(double, int)), SLOT(panChanged(double)));
connect(m_pan, SIGNAL(sliderPressed(int)), SLOT(panPressed()));
connect(m_pan, SIGNAL(sliderReleased(int)), SLOT(panReleased()));/*}}}*/
Expand Down

0 comments on commit 23a5542

Please sign in to comment.