diff options
author | Robin Gareus <robin@gareus.org> | 2014-02-21 18:00:45 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2014-02-22 03:11:48 +0100 |
commit | b3154e8ed6b5bb62acdc4b5a72133ceaeab7e53e (patch) | |
tree | ce6e7bc75048fbb883d10fca6170023288d73636 /libs/ardour | |
parent | dfeb68aeb4cfb23b335e3a171314b78327d832e3 (diff) |
NOOP, whitespace change only
Diffstat (limited to 'libs/ardour')
-rw-r--r-- | libs/ardour/session_vst.cc | 69 | ||||
-rw-r--r-- | libs/ardour/vst_plugin.cc | 63 |
2 files changed, 65 insertions, 67 deletions
diff --git a/libs/ardour/session_vst.cc b/libs/ardour/session_vst.cc index 3f2054aadc..461934b5f4 100644 --- a/libs/ardour/session_vst.cc +++ b/libs/ardour/session_vst.cc @@ -60,7 +60,7 @@ intptr_t Session::vst_callback ( } if (effect && effect->user) { - plug = (VSTPlugin *) (effect->user); + plug = (VSTPlugin *) (effect->user); session = &plug->session(); #ifdef COMPILER_MSVC SHOW_CALLBACK ("am callback 0x%x, opcode = %d, plugin = \"%s\" ", (int) pthread_self().p, opcode, plug->name()); @@ -155,7 +155,7 @@ intptr_t Session::vst_callback ( _timeInfo.samplePos = now; _timeInfo.sampleRate = session->frame_rate(); - + const TempoMetric& tm (session->tempo_map().metric_at (now)); if (value & (kVstTempoValid)) { @@ -174,22 +174,21 @@ intptr_t Session::vst_callback ( try { session->tempo_map().bbt_time_rt (now, bbt); - + /* PPQ = pulse per quarter - VST's "pulse" is our "division". - - 8 divisions per bar, 1 division = quarter, so 8 quarters per bar, ppq = 1 - 8 divisions per bar, 1 division = eighth, so 4 quarters per bar, ppq = 2 - 4 divisions per bar, 1 division = quarter, so 4 quarters per bar, ppq = 1 - 4 divisions per bar, 1 division = half, so 8 quarters per bar, ppq = 0.5 - 4 divisions per bar, 1 division = fifth, so (4 * 5/4) quarters per bar, ppq = 5/4 - - general: divs_per_bar / (note_type / 4.0) - */ + * VST's "pulse" is our "division". + * + * 8 divisions per bar, 1 division = quarter, so 8 quarters per bar, ppq = 1 + * 8 divisions per bar, 1 division = eighth, so 4 quarters per bar, ppq = 2 + * 4 divisions per bar, 1 division = quarter, so 4 quarters per bar, ppq = 1 + * 4 divisions per bar, 1 division = half, so 8 quarters per bar, ppq = 0.5 + * 4 divisions per bar, 1 division = fifth, so (4 * 5/4) quarters per bar, ppq = 5/4 + * + * general: divs_per_bar / (note_type / 4.0) + */ double ppq_scaling = tm.meter().note_divisor() / 4.0; - /* Note that this assumes constant meter/tempo throughout the session. Stupid VST - */ + /* Note that this assumes constant meter/tempo throughout the session. Stupid VST */ double ppqBar = double(bbt.bars - 1) * tm.meter().divisions_per_bar(); double ppqBeat = double(bbt.beats - 1); double ppqTick = double(bbt.ticks) / Timecode::BBT_Time::ticks_per_beat; @@ -197,17 +196,17 @@ intptr_t Session::vst_callback ( ppqBar *= ppq_scaling; ppqBeat *= ppq_scaling; ppqTick *= ppq_scaling; - + if (value & (kVstPpqPosValid)) { _timeInfo.ppqPos = ppqBar + ppqBeat + ppqTick; _timeInfo.flags |= (kVstPpqPosValid); } - + if (value & (kVstBarsValid)) { _timeInfo.barStartPos = ppqBar; _timeInfo.flags |= (kVstBarsValid); } - + } catch (...) { /* relax */ } @@ -215,13 +214,13 @@ intptr_t Session::vst_callback ( if (value & (kVstSmpteValid)) { Timecode::Time t; - + session->timecode_time (now, t); - - _timeInfo.smpteOffset = (t.hours * t.rate * 60.0 * 60.0) + - (t.minutes * t.rate * 60.0) + - (t.seconds * t.rate) + - (t.frames) + + + _timeInfo.smpteOffset = (t.hours * t.rate * 60.0 * 60.0) + + (t.minutes * t.rate * 60.0) + + (t.seconds * t.rate) + + (t.frames) + (t.subframes); _timeInfo.smpteOffset *= 80.0; /* VST spec is 1/80th frames */ @@ -257,7 +256,7 @@ intptr_t Session::vst_callback ( _timeInfo.samplePos = 0; _timeInfo.sampleRate = AudioEngine::instance()->sample_rate(); } - + return (intptr_t) &_timeInfo; case audioMasterProcessEvents: @@ -286,14 +285,14 @@ intptr_t Session::vst_callback ( case audioMasterGetParameterQuantization: SHOW_CALLBACK ("amc: audioMasterGetParameterQuantization\n"); - // returns the integer value for +1.0 representation, - // or 1 if full single float precision is maintained - // in automation. parameter index in <value> (-1: all, any) + // returns the integer value for +1.0 representation, + // or 1 if full single float precision is maintained + // in automation. parameter index in <value> (-1: all, any) return 0; case audioMasterIOChanged: SHOW_CALLBACK ("amc: audioMasterIOChanged\n"); - // numInputs and/or numOutputs has changed + // numInputs and/or numOutputs has changed return 0; case audioMasterNeedIdle: @@ -333,16 +332,16 @@ intptr_t Session::vst_callback ( case audioMasterGetPreviousPlug: SHOW_CALLBACK ("amc: audioMasterGetPreviousPlug\n"); - // input pin in <value> (-1: first to come), returns cEffect* + // input pin in <value> (-1: first to come), returns cEffect* return 0; case audioMasterGetNextPlug: SHOW_CALLBACK ("amc: audioMasterGetNextPlug\n"); - // output pin in <value> (-1: first to come), returns cEffect* + // output pin in <value> (-1: first to come), returns cEffect* case audioMasterWillReplaceOrAccumulate: SHOW_CALLBACK ("amc: audioMasterWillReplaceOrAccumulate\n"); - // returns: 0: not supported, 1: replace, 2: accumulate + // returns: 0: not supported, 1: replace, 2: accumulate return 0; case audioMasterGetCurrentProcessLevel: @@ -364,10 +363,10 @@ intptr_t Session::vst_callback ( case audioMasterOfflineStart: SHOW_CALLBACK ("amc: audioMasterOfflineStart\n"); return 0; - + case audioMasterOfflineRead: SHOW_CALLBACK ("amc: audioMasterOfflineRead\n"); - // ptr points to offline structure, see below. return 0: error, 1 ok + // ptr points to offline structure, see below. return 0: error, 1 ok return 0; case audioMasterOfflineWrite: @@ -378,7 +377,7 @@ intptr_t Session::vst_callback ( case audioMasterOfflineGetCurrentPass: SHOW_CALLBACK ("amc: audioMasterOfflineGetCurrentPass\n"); return 0; - + case audioMasterOfflineGetCurrentMetaPass: SHOW_CALLBACK ("amc: audioMasterOfflineGetCurrentMetaPass\n"); return 0; diff --git a/libs/ardour/vst_plugin.cc b/libs/ardour/vst_plugin.cc index f22ddf525e..23383496bf 100644 --- a/libs/ardour/vst_plugin.cc +++ b/libs/ardour/vst_plugin.cc @@ -46,12 +46,12 @@ VSTPlugin::VSTPlugin (AudioEngine& engine, Session& session, VSTHandle* handle) , _state (0) , _plugin (0) { - + } VSTPlugin::~VSTPlugin () { - + } void @@ -78,7 +78,7 @@ VSTPlugin::activate () _plugin->dispatcher (_plugin, effMainsChanged, 0, 1, NULL, 0.0f); } -int +int VSTPlugin::set_block_size (pframes_t nframes) { deactivate (); @@ -93,13 +93,13 @@ VSTPlugin::default_value (uint32_t) return 0; } -float +float VSTPlugin::get_parameter (uint32_t which) const { return _plugin->getParameter (_plugin, which); } -void +void VSTPlugin::set_parameter (uint32_t which, float newval) { float oldval = get_parameter (which); @@ -109,7 +109,7 @@ VSTPlugin::set_parameter (uint32_t which, float newval) } _plugin->setParameter (_plugin, which, newval); - + float curval = get_parameter (which); if (!PBD::floateq (curval, oldval, 1)) { @@ -215,8 +215,8 @@ VSTPlugin::set_state (const XMLNode& node, int version) for (n = child->children ().begin (); n != child->children ().end (); ++n) { if ((*n)->is_content ()) { /* XXX: this may be dubious for the same reasons that we delay - execution of load_preset. - */ + execution of load_preset. + */ ret = set_chunk ((*n)->content().c_str(), false); } } @@ -301,7 +301,7 @@ VSTPlugin::get_parameter_descriptor (uint32_t which, ParameterDescriptor& desc) memset (label, 0, sizeof (label)); _plugin->dispatcher (_plugin, effGetParamName, which, 0, label, 0); - + desc.label = label; desc.integer_step = false; desc.lower = 0.0f; @@ -335,7 +335,7 @@ VSTPlugin::load_preset (PresetRecord r) return s; } -bool +bool VSTPlugin::load_plugin_preset (PresetRecord r) { /* This is a plugin-provided preset. @@ -348,7 +348,7 @@ VSTPlugin::load_plugin_preset (PresetRecord r) #ifndef NDEBUG int const p = sscanf (r.uri.c_str(), "VST:%d:%d", &id, &index); assert (p == 2); -#else +#else sscanf (r.uri.c_str(), "VST:%d:%d", &id, &index); #endif @@ -372,13 +372,12 @@ VSTPlugin::load_plugin_preset (PresetRecord r) } #else - _state->want_program = index; #endif return true; } -bool +bool VSTPlugin::load_user_preset (PresetRecord r) { /* This is a user preset; we load it, and this code also knows about the @@ -424,7 +423,7 @@ VSTPlugin::load_user_preset (PresetRecord r) return false; } else { - + for (XMLNodeList::const_iterator j = (*i)->children().begin(); j != (*i)->children().end(); ++j) { if ((*j)->name() == X_("Parameter")) { XMLProperty* index = (*j)->property (X_("index")); @@ -442,7 +441,7 @@ VSTPlugin::load_user_preset (PresetRecord r) return false; } -string +string VSTPlugin::do_save_preset (string name) { boost::shared_ptr<XMLTree> t (presets_tree ()); @@ -488,7 +487,7 @@ VSTPlugin::do_save_preset (string name) return uri; } -void +void VSTPlugin::do_remove_preset (string name) { boost::shared_ptr<XMLTree> t (presets_tree ()); @@ -504,7 +503,7 @@ VSTPlugin::do_remove_preset (string name) t->write (f); } -string +string VSTPlugin::describe_parameter (Evoral::Parameter param) { char name[64]; @@ -521,7 +520,7 @@ VSTPlugin::describe_parameter (Evoral::Parameter param) return name; } -framecnt_t +framecnt_t VSTPlugin::signal_latency () const { if (_user_latency) { @@ -531,7 +530,7 @@ VSTPlugin::signal_latency () const return *((int32_t *) (((char *) &_plugin->flags) + 12)); /* initialDelay */ } -set<Evoral::Parameter> +set<Evoral::Parameter> VSTPlugin::automatable () const { set<Evoral::Parameter> ret; @@ -545,8 +544,8 @@ VSTPlugin::automatable () const int VSTPlugin::connect_and_run (BufferSet& bufs, - ChanMapping in_map, ChanMapping out_map, - pframes_t nframes, framecnt_t offset) + ChanMapping in_map, ChanMapping out_map, + pframes_t nframes, framecnt_t offset) { Plugin::connect_and_run (bufs, in_map, out_map, nframes, offset); @@ -557,14 +556,14 @@ VSTPlugin::connect_and_run (BufferSet& bufs, BufferSet& silent_bufs = _session.get_silent_buffers(bufs_count); BufferSet& scratch_bufs = _session.get_scratch_buffers(bufs_count); - /* VC++ doesn't support the C99 extension that allows + /* VC++ doesn't support the C99 extension that allows typeName foo[variableDefiningSize]; - + Use alloca instead of dynamic array (rather than std::vector which allocs on the heap) because this is realtime code. */ - + float** ins = (float**)alloca(_plugin->numInputs*sizeof(float*)); float** outs = (float**)alloca(_plugin->numInputs*sizeof(float*)); @@ -601,48 +600,48 @@ VSTPlugin::connect_and_run (BufferSet& bufs, return 0; } -string +string VSTPlugin::unique_id () const { char buf[32]; snprintf (buf, sizeof (buf), "%d", _plugin->uniqueID); - + return string (buf); } -const char * +const char * VSTPlugin::name () const { return _handle->name; } -const char * +const char * VSTPlugin::maker () const { return _info->creator.c_str(); } -const char * +const char * VSTPlugin::label () const { return _handle->name; } -uint32_t +uint32_t VSTPlugin::parameter_count () const { return _plugin->numParams; } -bool +bool VSTPlugin::has_editor () const { return _plugin->flags & effFlagsHasEditor; } -void +void VSTPlugin::print_parameter (uint32_t param, char *buf, uint32_t /*len*/) const { char *first_nonws; |