Skip to content

Commit

Permalink
Fixed synth instruments adding with invalid verb, added .mid and .kar…
Browse files Browse the repository at this point in the history
… support to cliplist
  • Loading branch information
linuxras committed Mar 22, 2012
1 parent 6e62fb6 commit fd0356e
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 11 deletions.
2 changes: 2 additions & 0 deletions oom/Composer/Composer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,8 @@ void Composer::currentTabChanged(int tab)
{
//printf("PatchSequencer Tab clicked\n");
midiConductor->update();
if(selected && selected->isMidiTrack())
midiConductor->setTrack(selected);
}
if(m_clipList)
{
Expand Down
6 changes: 3 additions & 3 deletions oom/instruments/minstrument.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -307,9 +307,6 @@ void MidiInstrument::init()
_midiReset = new EventList();
_midiState = new EventList();
_controller = new MidiControllerList;
m_oomInstrument = false;
m_panValue = 0.0;
m_verbValue = config.minSlider;

// add some default controller to controller list
// this controllers are always available for all instruments
Expand All @@ -321,6 +318,9 @@ void MidiInstrument::init()

MidiInstrument::MidiInstrument()
{
m_oomInstrument = false;
m_panValue = 0.0;
m_verbValue = config.minSlider;
init();
}

Expand Down
39 changes: 31 additions & 8 deletions oom/widgets/ClipList/AudioClipList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ AudioClipList::AudioClipList(QWidget *parent)
{
setupUi(this);

m_filters << "wav" << "ogg" << "mpt";
m_filters << "wav" << "ogg" << "mpt" << "mid" << "kar";
m_watcher = new QFileSystemWatcher(this);
m_active = true;

Expand Down Expand Up @@ -306,13 +306,24 @@ void AudioClipList::fileItemContextMenu(const QPoint& pos)/*{{{*/
}
else
{
QAction* add = m->addAction(QIcon(":/images/icons/clip-file-audio.png"), tr("Add to Selected Track"));
add->setData(2);
QAction* asnew = m->addAction(QIcon(":/images/icons/clip-file-audio.png"), tr("Add to New Track"));
asnew->setData(3);
if(f.suffix().endsWith("mid", Qt::CaseInsensitive) ||
f.suffix().endsWith("kar", Qt::CaseInsensitive))
{
QAction* add = m->addAction(QIcon(":/images/icons/clip-file-audio.png"), tr("Import and Append"));
add->setData(4);
QAction* rep = m->addAction(QIcon(":/images/icons/clip-file-audio.png"), tr("Import and Replace"));
rep->setData(5);
}
else
{
QAction* add = m->addAction(QIcon(":/images/icons/clip-file-audio.png"), tr("Add to Selected Track"));
add->setData(2);
QAction* asnew = m->addAction(QIcon(":/images/icons/clip-file-audio.png"), tr("Add to New Track"));
asnew->setData(3);
}
}
QAction* ref = m->addAction(QIcon(":/images/icons/clip-folder-refresh.png"), tr("Refresh"));
ref->setData(4);
ref->setData(6);
QAction* act = m->exec(QCursor::pos());
if(act)
{
Expand Down Expand Up @@ -380,6 +391,17 @@ void AudioClipList::fileItemContextMenu(const QPoint& pos)/*{{{*/
}
break;
case 4:
{
oom->importMidi(f.filePath(), true);
song->update();
}
break;
case 5:
{//Replace
oom->loadProjectFile(f.filePath(), false, false);
}
break;
case 6:
setDir(m_currentPath);
break;
default:
Expand Down Expand Up @@ -560,7 +582,7 @@ void AudioClipList::playClicked(bool state)/*{{{*/
if(item)
{
QFileInfo info(item->data().toString());
if(!info.isDir() && !info.suffix().endsWith("mpt"))
if(!info.isDir() && (info.suffix().endsWith("wav") || info.suffix().endsWith("ogg")))
{
m_playlist.append(info.filePath());
if(m_currentSong != info.filePath())
Expand All @@ -577,7 +599,8 @@ void AudioClipList::playClicked(bool state)/*{{{*/
}
else if(!m_currentSong.isEmpty())
{
m_playlist.append(info.filePath());
//m_playlist.append(info.filePath());
m_playlist.append(m_currentSong);
if(player.isPlaying())
player.stop();
else
Expand Down
7 changes: 7 additions & 0 deletions oom/widgets/CreateTrackDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,8 @@ void CreateTrackDialog::addTrack()/*{{{*/
break;
}
}
m_vtrack->instrumentPan = 0.0;
m_vtrack->instrumentVerb = config.minSlider;
}/*}}}*/

m_vtrack->autoCreateInstrument = chkAutoCreate->isChecked();
Expand Down Expand Up @@ -329,6 +331,11 @@ void CreateTrackDialog::addTrack()/*{{{*/
m_vtrack->bussConfig = qMakePair(iBuss, selectedBuss);
}
}
else
{
m_vtrack->instrumentPan = 0.0;
m_vtrack->instrumentVerb = config.minSlider;
}
}
}
break;
Expand Down

0 comments on commit fd0356e

Please sign in to comment.