mirror of https://github.com/AxioDL/amuse.git
Add support for Keymap playback
This commit is contained in:
parent
409d52c120
commit
2b45f69ff4
|
@ -522,6 +522,12 @@ amuse::ObjToken<amuse::Voice> MainWindow::startEditorVoice(uint8_t key, uint8_t
|
||||||
ProjectModel::SoundMacroNode* cNode = static_cast<ProjectModel::SoundMacroNode*>(node);
|
ProjectModel::SoundMacroNode* cNode = static_cast<ProjectModel::SoundMacroNode*>(node);
|
||||||
vox = m_engine->macroStart(group, cNode->id(), key, velocity, m_ctrlVals[1]);
|
vox = m_engine->macroStart(group, cNode->id(), key, velocity, m_ctrlVals[1]);
|
||||||
}
|
}
|
||||||
|
else if (node->type() == ProjectModel::INode::Type::Keymap ||
|
||||||
|
node->type() == ProjectModel::INode::Type::Layer)
|
||||||
|
{
|
||||||
|
ProjectModel::BasePoolObjectNode* cNode = static_cast<ProjectModel::BasePoolObjectNode*>(node);
|
||||||
|
vox = m_engine->pageObjectStart(group, cNode->id(), key, velocity, m_ctrlVals[1]);
|
||||||
|
}
|
||||||
else if (node->type() == ProjectModel::INode::Type::Sample)
|
else if (node->type() == ProjectModel::INode::Type::Sample)
|
||||||
{
|
{
|
||||||
SampleEditor* editor = static_cast<SampleEditor*>(m_ui.editorContents->currentWidget());
|
SampleEditor* editor = static_cast<SampleEditor*>(m_ui.editorContents->currentWidget());
|
||||||
|
|
|
@ -269,10 +269,6 @@ void ProjectModel::_resetModelData()
|
||||||
col.reserve(keymaps.size());
|
col.reserve(keymaps.size());
|
||||||
for (auto& keymap : SortUnorderedMap(keymaps))
|
for (auto& keymap : SortUnorderedMap(keymaps))
|
||||||
col.makeChild<KeymapNode>(keymap.first, keymap.second.get());
|
col.makeChild<KeymapNode>(keymap.first, keymap.second.get());
|
||||||
amuse::KeymapId id = 42;
|
|
||||||
amuse::KeymapId::CurNameDB->registerPair("test", id);
|
|
||||||
auto km = amuse::MakeObj<std::array<amuse::Keymap, 128>>();
|
|
||||||
col.makeChild<KeymapNode>(id, km);
|
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
CollectionNode& col =
|
CollectionNode& col =
|
||||||
|
|
|
@ -396,13 +396,13 @@
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../MainWindow.cpp" line="225"/>
|
<location filename="../MainWindow.cpp" line="225"/>
|
||||||
<location filename="../MainWindow.cpp" line="570"/>
|
<location filename="../MainWindow.cpp" line="576"/>
|
||||||
<source>The directory at '%1' must not be empty.</source>
|
<source>The directory at '%1' must not be empty.</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../MainWindow.cpp" line="226"/>
|
<location filename="../MainWindow.cpp" line="226"/>
|
||||||
<location filename="../MainWindow.cpp" line="571"/>
|
<location filename="../MainWindow.cpp" line="577"/>
|
||||||
<source>Directory empty</source>
|
<source>Directory empty</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -447,122 +447,122 @@
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../MainWindow.cpp" line="553"/>
|
<location filename="../MainWindow.cpp" line="559"/>
|
||||||
<source>New Project</source>
|
<source>New Project</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../MainWindow.cpp" line="576"/>
|
<location filename="../MainWindow.cpp" line="582"/>
|
||||||
<source>The directory at '%1' does not exist.</source>
|
<source>The directory at '%1' does not exist.</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../MainWindow.cpp" line="577"/>
|
<location filename="../MainWindow.cpp" line="583"/>
|
||||||
<source>Bad Directory</source>
|
<source>Bad Directory</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../MainWindow.cpp" line="592"/>
|
<location filename="../MainWindow.cpp" line="598"/>
|
||||||
<source>Opening</source>
|
<source>Opening</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../MainWindow.cpp" line="592"/>
|
<location filename="../MainWindow.cpp" line="598"/>
|
||||||
<location filename="../MainWindow.cpp" line="670"/>
|
<location filename="../MainWindow.cpp" line="676"/>
|
||||||
<location filename="../MainWindow.cpp" line="753"/>
|
<location filename="../MainWindow.cpp" line="759"/>
|
||||||
<location filename="../MainWindow.cpp" line="798"/>
|
<location filename="../MainWindow.cpp" line="804"/>
|
||||||
<source>Scanning Project</source>
|
<source>Scanning Project</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../MainWindow.cpp" line="604"/>
|
<location filename="../MainWindow.cpp" line="610"/>
|
||||||
<source>Opening %1</source>
|
<source>Opening %1</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../MainWindow.cpp" line="616"/>
|
<location filename="../MainWindow.cpp" line="622"/>
|
||||||
<source>Open Project</source>
|
<source>Open Project</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../MainWindow.cpp" line="670"/>
|
<location filename="../MainWindow.cpp" line="676"/>
|
||||||
<source>Reloading Samples</source>
|
<source>Reloading Samples</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../MainWindow.cpp" line="682"/>
|
<location filename="../MainWindow.cpp" line="688"/>
|
||||||
<source>Scanning %1</source>
|
<source>Scanning %1</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../MainWindow.cpp" line="692"/>
|
<location filename="../MainWindow.cpp" line="698"/>
|
||||||
<source>Import Project</source>
|
<source>Import Project</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../MainWindow.cpp" line="701"/>
|
<location filename="../MainWindow.cpp" line="707"/>
|
||||||
<source>The file at '%1' could not be interpreted as a MusyX container.</source>
|
<source>The file at '%1' could not be interpreted as a MusyX container.</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../MainWindow.cpp" line="702"/>
|
<location filename="../MainWindow.cpp" line="708"/>
|
||||||
<source>Unsupported MusyX Container</source>
|
<source>Unsupported MusyX Container</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../MainWindow.cpp" line="707"/>
|
<location filename="../MainWindow.cpp" line="713"/>
|
||||||
<source>Sample Import Mode</source>
|
<source>Sample Import Mode</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../MainWindow.cpp" line="708"/>
|
<location filename="../MainWindow.cpp" line="714"/>
|
||||||
<source>Amuse can import samples as WAV files for ease of editing, import original compressed data for lossless repacking, or both. Exporting the project will prefer whichever version was modified most recently.</source>
|
<source>Amuse can import samples as WAV files for ease of editing, import original compressed data for lossless repacking, or both. Exporting the project will prefer whichever version was modified most recently.</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../MainWindow.cpp" line="712"/>
|
<location filename="../MainWindow.cpp" line="718"/>
|
||||||
<source>Import Compressed</source>
|
<source>Import Compressed</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../MainWindow.cpp" line="712"/>
|
<location filename="../MainWindow.cpp" line="718"/>
|
||||||
<source>Import WAVs</source>
|
<source>Import WAVs</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../MainWindow.cpp" line="712"/>
|
<location filename="../MainWindow.cpp" line="718"/>
|
||||||
<source>Import Both</source>
|
<source>Import Both</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../MainWindow.cpp" line="728"/>
|
<location filename="../MainWindow.cpp" line="734"/>
|
||||||
<source>Raw Import Mode</source>
|
<source>Raw Import Mode</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../MainWindow.cpp" line="729"/>
|
<location filename="../MainWindow.cpp" line="735"/>
|
||||||
<source>Would you like to scan for all MusyX group files in this directory?</source>
|
<source>Would you like to scan for all MusyX group files in this directory?</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../MainWindow.cpp" line="739"/>
|
<location filename="../MainWindow.cpp" line="745"/>
|
||||||
<source>Project Name</source>
|
<source>Project Name</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../MainWindow.cpp" line="739"/>
|
<location filename="../MainWindow.cpp" line="745"/>
|
||||||
<source>What should this project be named?</source>
|
<source>What should this project be named?</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../MainWindow.cpp" line="753"/>
|
<location filename="../MainWindow.cpp" line="759"/>
|
||||||
<location filename="../MainWindow.cpp" line="798"/>
|
<location filename="../MainWindow.cpp" line="804"/>
|
||||||
<source>Importing</source>
|
<source>Importing</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../MainWindow.cpp" line="765"/>
|
<location filename="../MainWindow.cpp" line="771"/>
|
||||||
<location filename="../MainWindow.cpp" line="807"/>
|
<location filename="../MainWindow.cpp" line="813"/>
|
||||||
<source>Importing %1</source>
|
<source>Importing %1</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -614,17 +614,17 @@
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../ProjectModel.cpp" line="279"/>
|
<location filename="../ProjectModel.cpp" line="275"/>
|
||||||
<source>Layers</source>
|
<source>Layers</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../ProjectModel.cpp" line="286"/>
|
<location filename="../ProjectModel.cpp" line="282"/>
|
||||||
<source>Samples</source>
|
<source>Samples</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../ProjectModel.cpp" line="438"/>
|
<location filename="../ProjectModel.cpp" line="434"/>
|
||||||
<source>Delete %1</source>
|
<source>Delete %1</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
|
|
@ -112,6 +112,15 @@ public:
|
||||||
return macroStart(group, macro, key, vel, mod, m_defaultStudio);
|
return macroStart(group, macro, key, vel, mod, m_defaultStudio);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Start PageObject node playing directly (for editor use) */
|
||||||
|
ObjToken<Voice> pageObjectStart(const AudioGroup* group, ObjectId id, uint8_t key,
|
||||||
|
uint8_t vel, uint8_t mod, ObjToken<Studio> smx);
|
||||||
|
ObjToken<Voice> pageObjectStart(const AudioGroup* group, ObjectId id, uint8_t key,
|
||||||
|
uint8_t vel, uint8_t mod)
|
||||||
|
{
|
||||||
|
return pageObjectStart(group, id, key, vel, mod, m_defaultStudio);
|
||||||
|
}
|
||||||
|
|
||||||
/** Start soundFX playing from loaded audio groups, attach to positional emitter */
|
/** Start soundFX playing from loaded audio groups, attach to positional emitter */
|
||||||
ObjToken<Emitter> addEmitter(const float* pos, const float* dir, float maxDist, float falloff,
|
ObjToken<Emitter> addEmitter(const float* pos, const float* dir, float maxDist, float falloff,
|
||||||
int sfxId, float minVol, float maxVol, bool doppler, ObjToken<Studio> smx);
|
int sfxId, float minVol, float maxVol, bool doppler, ObjToken<Studio> smx);
|
||||||
|
|
|
@ -353,6 +353,11 @@ AudioGroupPool AudioGroupPool::CreateAudioGroupPool(SystemStringView groupPath)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
amuse::KeymapId id = 42;
|
||||||
|
amuse::KeymapId::CurNameDB->registerPair("test", id);
|
||||||
|
auto& kmOut = ret.m_keymaps[id];
|
||||||
|
kmOut = MakeObj<std::array<Keymap, 128>>();
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -332,6 +332,25 @@ ObjToken<Voice> Engine::macroStart(const AudioGroup* group, const SoundMacro* ma
|
||||||
return *ret;
|
return *ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Start PageObject node playing directly (for editor use) */
|
||||||
|
ObjToken<Voice> Engine::pageObjectStart(const AudioGroup* group, ObjectId id, uint8_t key,
|
||||||
|
uint8_t vel, uint8_t mod, ObjToken<Studio> smx)
|
||||||
|
{
|
||||||
|
if (!group)
|
||||||
|
return {};
|
||||||
|
|
||||||
|
std::list<ObjToken<Voice>>::iterator ret =
|
||||||
|
_allocateVoice(*group, {}, NativeSampleRate, true, false, smx);
|
||||||
|
|
||||||
|
if (!(*ret)->loadPageObject(id, 1000.f, key, vel, mod))
|
||||||
|
{
|
||||||
|
_destroyVoice(ret);
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
|
return *ret;
|
||||||
|
}
|
||||||
|
|
||||||
/** Start soundFX playing from loaded audio groups, attach to positional emitter */
|
/** Start soundFX playing from loaded audio groups, attach to positional emitter */
|
||||||
ObjToken<Emitter> Engine::addEmitter(const float* pos, const float* dir, float maxDist, float falloff,
|
ObjToken<Emitter> Engine::addEmitter(const float* pos, const float* dir, float maxDist, float falloff,
|
||||||
int sfxId, float minVol, float maxVol, bool doppler, ObjToken<Studio> smx)
|
int sfxId, float minVol, float maxVol, bool doppler, ObjToken<Studio> smx)
|
||||||
|
|
Loading…
Reference in New Issue