Vapor: add API used to set ADM meta-data
This commit is contained in:
parent
7dc1fbab5a
commit
3f7c98e2db
|
@ -96,6 +96,9 @@ public:
|
|||
|
||||
samplecnt_t signal_latency () const;
|
||||
|
||||
/* XXX this is only for testing */
|
||||
void set_bed_mix (bool on, int32_t types[10], int32_t ids[10], double);
|
||||
|
||||
int set_state (XMLNode const&, int version);
|
||||
|
||||
protected:
|
||||
|
@ -157,6 +160,7 @@ private:
|
|||
samplepos_t _export_start;
|
||||
samplepos_t _export_end;
|
||||
bool _rolling;
|
||||
bool _with_bed;
|
||||
std::atomic<int> _flush;
|
||||
};
|
||||
|
||||
|
|
|
@ -111,6 +111,13 @@ public:
|
|||
uint32_t surr_Settings;
|
||||
uint32_t surr_BinauralRenderMode;
|
||||
uint32_t surr_ChannelCount;
|
||||
uint32_t surr_ChannelDescription;
|
||||
uint32_t surr_ChannelTypes;
|
||||
uint32_t surr_ChannelBedIds;
|
||||
uint32_t surr_ProgramData;
|
||||
uint32_t surr_ContentFFOA;
|
||||
uint32_t surr_ContentStart;
|
||||
uint32_t surr_ContentFPS;
|
||||
uint32_t surr_DownmixMode;
|
||||
uint32_t surr_OutputFormat;
|
||||
uint32_t surr_WarpMode;
|
||||
|
|
|
@ -454,6 +454,9 @@ LuaBindings::stddef (lua_State* L)
|
|||
.beginStdVector <uint8_t> ("ByteVector")
|
||||
.endClass ()
|
||||
|
||||
.beginStdVector <int32_t> ("IntVector")
|
||||
.endClass ()
|
||||
|
||||
.beginStdVector <float*> ("FloatArrayVector")
|
||||
.endClass ()
|
||||
|
||||
|
@ -1896,22 +1899,24 @@ LuaBindings::common (lua_State* L)
|
|||
.endClass ()
|
||||
|
||||
.deriveWSPtrClass <SurroundPannable, Automatable> ("SurroundPannable")
|
||||
.addData ("name", &SurroundPannable::pan_pos_x)
|
||||
.addData ("name", &SurroundPannable::pan_pos_y)
|
||||
.addData ("name", &SurroundPannable::pan_pos_z)
|
||||
.addData ("name", &SurroundPannable::pan_size)
|
||||
.addData ("name", &SurroundPannable::pan_snap)
|
||||
.addData ("pan_pos_x", &SurroundPannable::pan_pos_x)
|
||||
.addData ("pan_pos_y", &SurroundPannable::pan_pos_y)
|
||||
.addData ("pan_pos_z", &SurroundPannable::pan_pos_z)
|
||||
.addData ("pan_size", &SurroundPannable::pan_size)
|
||||
.addData ("pan_snap", &SurroundPannable::pan_snap)
|
||||
.addData ("binaural_render_mode", &SurroundPannable::binaural_render_mode)
|
||||
.endClass ()
|
||||
|
||||
.deriveWSPtrClass <SurroundSend, Processor> ("SurroundSend")
|
||||
.addFunction ("get_delay_in", &SurroundSend::get_delay_in)
|
||||
.addFunction ("get_delay_out", &SurroundSend::get_delay_out)
|
||||
.addFunction ("gain_control", &SurroundSend::gain_control)
|
||||
.addFunction ("n_pannables", &SurroundSend::gain_control)
|
||||
.addFunction ("n_pannables", &SurroundSend::n_pannables)
|
||||
.addFunction ("pannable", &SurroundSend::pannable)
|
||||
.endClass ()
|
||||
|
||||
.deriveWSPtrClass <SurroundReturn, Processor> ("SurroundReturn")
|
||||
.addFunction ("set_bed_mix", &SurroundReturn::set_bed_mix)
|
||||
.endClass ()
|
||||
|
||||
.deriveWSPtrClass <Return, IOProcessor> ("Return")
|
||||
|
@ -3018,6 +3023,8 @@ LuaBindings::common (lua_State* L)
|
|||
.addFunction ("snap_name", &Session::snap_name)
|
||||
.addFunction ("monitor_out", &Session::monitor_out)
|
||||
.addFunction ("master_out", &Session::master_out)
|
||||
.addFunction ("master_volume", &Session::master_volume)
|
||||
.addFunction ("surround_master", &Session::surround_master)
|
||||
.addFunction ("add_internal_send", (void (Session::*)(std::shared_ptr<Route>, std::shared_ptr<Processor>, std::shared_ptr<Route>))&Session::add_internal_send)
|
||||
.addFunction ("add_internal_sends", &Session::add_internal_sends)
|
||||
.addFunction ("locations", &Session::locations)
|
||||
|
|
|
@ -78,6 +78,8 @@ SurroundReturn::SurroundReturn (Session& s, Route* r)
|
|||
, _exporting (false)
|
||||
, _export_start (0)
|
||||
, _export_end (0)
|
||||
, _rolling (false)
|
||||
, _with_bed (false)
|
||||
{
|
||||
#if !(defined(LV2_EXTENDED) && defined(HAVE_LV2_1_10_0))
|
||||
throw failed_constructor ();
|
||||
|
@ -258,6 +260,39 @@ SurroundReturn::flush ()
|
|||
_flush.store (1);
|
||||
}
|
||||
|
||||
void
|
||||
SurroundReturn::set_bed_mix (bool on, int32_t chan_types[10], int32_t bed_ids[10], double ffoa) {
|
||||
_with_bed = on;
|
||||
|
||||
if (!_with_bed) {
|
||||
return;
|
||||
}
|
||||
|
||||
URIMap::URIDs const& urids = URIMap::instance ().urids;
|
||||
LV2_Atom_Forge_Frame frame;
|
||||
lv2_atom_forge_set_buffer (&_forge, _atom_buf, sizeof (_atom_buf));
|
||||
lv2_atom_forge_frame_time (&_forge, 0);
|
||||
LV2_Atom* msg = (LV2_Atom*)lv2_atom_forge_object (&_forge, &frame, 1, urids.surr_ChannelDescription);
|
||||
lv2_atom_forge_key (&_forge, urids.surr_ChannelTypes);
|
||||
lv2_atom_forge_vector(&_forge, sizeof(int32_t), urids.atom_Int, 10, chan_types);
|
||||
lv2_atom_forge_key (&_forge, urids.surr_ChannelBedIds);
|
||||
lv2_atom_forge_vector(&_forge, sizeof(int32_t), urids.atom_Int, 10, bed_ids);
|
||||
lv2_atom_forge_pop (&_forge, &frame);
|
||||
_surround_processor->write_from_ui (0, urids.atom_eventTransfer, lv2_atom_total_size (msg), (const uint8_t*)msg);
|
||||
|
||||
lv2_atom_forge_set_buffer (&_forge, _atom_buf, sizeof (_atom_buf));
|
||||
lv2_atom_forge_frame_time (&_forge, 0);
|
||||
msg = (LV2_Atom*)lv2_atom_forge_object (&_forge, &frame, 1, urids.surr_ProgramData);
|
||||
lv2_atom_forge_key (&_forge, urids.surr_ContentFFOA);
|
||||
lv2_atom_forge_float (&_forge, ffoa);
|
||||
lv2_atom_forge_key (&_forge, urids.surr_ContentStart);
|
||||
lv2_atom_forge_float (&_forge, 0); // TODO
|
||||
lv2_atom_forge_key (&_forge, urids.surr_ContentFPS);
|
||||
lv2_atom_forge_int (&_forge, 0); // TODO
|
||||
lv2_atom_forge_pop (&_forge, &frame);
|
||||
_surround_processor->write_from_ui (0, urids.atom_eventTransfer, lv2_atom_total_size (msg), (const uint8_t*)msg);
|
||||
}
|
||||
|
||||
void
|
||||
SurroundReturn::run (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_sample, double speed, pframes_t nframes, bool)
|
||||
{
|
||||
|
@ -270,13 +305,15 @@ SurroundReturn::run (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_
|
|||
_surround_processor->flush ();
|
||||
}
|
||||
|
||||
bool with_bed = _with_bed;
|
||||
|
||||
bufs.set_count (_configured_output);
|
||||
_surround_bufs.silence (nframes, 0);
|
||||
|
||||
RouteList rl = *_session.get_routes (); // XXX this allocates memory
|
||||
rl.sort (Stripable::Sorter (true));
|
||||
|
||||
size_t id = 10; // First 10 IDs are reseved for bed mixes
|
||||
size_t id = with_bed ? 0 : 10; // First 10 IDs are reseved for bed mixes
|
||||
|
||||
for (auto const& r : rl) {
|
||||
std::shared_ptr<SurroundSend> ss;
|
||||
|
@ -340,6 +377,12 @@ SurroundReturn::run (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_
|
|||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
/* bed mix */
|
||||
dst_ab.merge_from (src_ab, nframes);
|
||||
}
|
||||
|
||||
if (id > 9 || with_bed) {
|
||||
/* configure near/mid/far - not sample-accurate */
|
||||
int const brm = p->binaural_render_mode->get_value ();
|
||||
if (brm != _current_render_mode[id]) {
|
||||
|
@ -349,11 +392,8 @@ SurroundReturn::run (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_
|
|||
forge_int_msg (urids.surr_Settings, urids.surr_Channel, id, urids.surr_BinauralRenderMode, brm);
|
||||
#endif
|
||||
}
|
||||
|
||||
} else {
|
||||
/* bed mix */
|
||||
dst_ab.merge_from (src_ab, nframes);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (id >= max_object_id) {
|
||||
|
@ -398,11 +438,12 @@ SurroundReturn::run (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_
|
|||
#if defined(LV2_EXTENDED) && defined(HAVE_LV2_1_10_0)
|
||||
/* trigger export */
|
||||
//std::cout << "SURR START EXPORT " << start_sample << " <= " << _export_start << " < " << end_sample << "\n";
|
||||
|
||||
URIMap::URIDs const& urids = URIMap::instance ().urids;
|
||||
forge_int_msg (urids.surr_ExportStart, urids.time_frame, meter_offset);
|
||||
|
||||
/* Re-transmit pan pos - using export-start */
|
||||
size_t id = 10; // First 10 IDs are reseved for bed mixes
|
||||
size_t id = with_bed ? 0 : 10; // First 10 IDs are reseved for bed mixes
|
||||
for (auto const& r : rl) {
|
||||
std::shared_ptr<SurroundSend> ss;
|
||||
if (!r->active ()) {
|
||||
|
|
|
@ -88,6 +88,13 @@ URIMap::URIDs::init(URIMap& uri_map)
|
|||
surr_Settings = uri_map.uri_to_id("urn:ardour:a-vapor#Settings");
|
||||
surr_BinauralRenderMode = uri_map.uri_to_id("urn:ardour:a-vapor#BinauralRenderMode");
|
||||
surr_ChannelCount = uri_map.uri_to_id("urn:ardour:a-vapor#ChannelCount");
|
||||
surr_ChannelDescription = uri_map.uri_to_id("urn:ardour:a-vapor#ChannelDescription");
|
||||
surr_ChannelTypes = uri_map.uri_to_id("urn:ardour:a-vapor#ChannelTypes");
|
||||
surr_ChannelBedIds = uri_map.uri_to_id("urn:ardour:a-vapor#ChannelBedIds");
|
||||
surr_ProgramData = uri_map.uri_to_id("urn:ardour:a-vapor#ProgramData");
|
||||
surr_ContentFFOA = uri_map.uri_to_id("urn:ardour:a-vapor#ContentFFOA");
|
||||
surr_ContentStart = uri_map.uri_to_id("urn:ardour:a-vapor#ContentStart");
|
||||
surr_ContentFPS = uri_map.uri_to_id("urn:ardour:a-vapor#ContentFPS");
|
||||
surr_DownmixMode = uri_map.uri_to_id("urn:ardour:a-vapor#DownmixMode");
|
||||
surr_OutputFormat = uri_map.uri_to_id("urn:ardour:a-vapor#OutputFormat");
|
||||
surr_WarpMode = uri_map.uri_to_id("urn:ardour:a-vapor#WarpMode");
|
||||
|
|
Loading…
Reference in New Issue